Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .plugin-data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "1.0.2",
"version": "1.1.0",
"slug": "blockparty-iframe"
}
6 changes: 5 additions & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{}
{
"plugins": [
"."
]
}
71 changes: 70 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,73 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/).

## [1.0.0] - 2025-01-09
## [1.1.0] - 2026-01-12

### 🚀 Added

#### Iframe Code Parsing

- **HTML iframe code support**: You can now paste complete iframe HTML code instead of just URLs
- **Automatic URL extraction**: The `src` attribute is automatically extracted from iframe code
- **Auto-fill title**: The `title` attribute is automatically extracted and fills the title field
- **Custom attributes preservation**: All custom iframe attributes are extracted and preserved in the final output
- **Smart content filtering**: HTML content inside iframe tags is automatically removed during parsing

#### Attribute Management

- **Custom attributes storage**: New `iframeAttributes` block attribute (array of key-value objects)
- **Boolean attributes support**: Proper handling of HTML boolean attributes like `allowfullscreen`
- **React prop mapping**: Automatic conversion of HTML attributes to React prop names
- `allowfullscreen` → `allowFullScreen`
- `allowpaymentrequest` → `allowPaymentRequest`
- `referrerpolicy` → `referrerPolicy`
- **Deprecated attributes filtering**: Automatic exclusion of deprecated HTML attributes
- `frameborder`, `marginwidth`, `marginheight`, `scrolling`, `align`, `longdesc`
- **Problematic attributes filtering**: Exclusion of attributes that cause issues in React
- `style` (requires object format in React)
- `name` (can cause conflicts)
- `width`, `height` (managed by block dimension supports)

#### Code Quality

- **Utility functions**: New `utils.js` module for shared functionality
- **Code refactoring**: Eliminated duplication between `edit.js` and `save.js`
- **Better error handling**: Improved parsing with `insertAdjacentHTML` for safer DOM manipulation

### 🔧 Changed

- **Source field enhancement**: The URL field now accepts both URLs and iframe HTML code
- **Placeholder text**: Updated to reflect dual input capability
- **Help text**: Added contextual help explaining the new paste functionality

### 📚 Technical Details

- **New file**: `src/blockparty-iframe/utils.js` with exported utility functions:
- `parseIframeCode()`: Parse iframe HTML and extract attributes
- `convertAttributesToProps()`: Convert attributes array to React props
- `mapHtmlAttributeToReact()`: Map HTML attribute names to React prop names
- `isBooleanAttribute()`: Identify boolean HTML attributes
- `isExcludedIframeAttribute()`: Filter out problematic attributes

---

## [1.0.2] - 2026-01-10

### 🔧 Changed

- **Release workflow**: Updated GitHub Actions release workflow configuration

---

## [1.0.1] - 2026-01-09

### 🐛 Fixed

- **Build artifacts**: Updated `.distignore` and `.gitattributes` for proper release packaging

---

## [1.0.0] - 2026-01-09

### 🎉 Initial Release

Expand Down Expand Up @@ -59,4 +125,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

---

[1.1.0]: https://github.com/BeAPI/blockparty-iframe/releases/tag/1.1.0
[1.0.2]: https://github.com/BeAPI/blockparty-iframe/releases/tag/1.0.2
[1.0.1]: https://github.com/BeAPI/blockparty-iframe/releases/tag/1.0.1
[1.0.0]: https://github.com/BeAPI/blockparty-iframe/releases/tag/1.0.0
4 changes: 2 additions & 2 deletions blockparty-iframe.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Blockparty Iframe
* Description: Add a block to display an embedded frame in the WordPress editor.
* Version: 1.0.2
* Version: 1.1.0
* Requires at least: 6.7
* Requires PHP: 8.1
* Author: Be API Technical team
Expand All @@ -19,7 +19,7 @@
exit; // Exit if accessed directly.
}

define( 'BLOCKPARTY_IFRAME_VERSION', '1.0.2' );
define( 'BLOCKPARTY_IFRAME_VERSION', '1.1.0' );
define( 'BLOCKPARTY_IFRAME_URL', plugin_dir_url( __FILE__ ) );
define( 'BLOCKPARTY_IFRAME_DIR', plugin_dir_path( __FILE__ ) );
define( 'BLOCKPARTY_IFRAME_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translation-revision-date":"2025-12-24 15:10+0100","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-iframe\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Replace":["Remplacer"],"View":["Voir"],"Settings":["R\u00e9glages"],"Enable lazyloading":["Activer le chargement diff\u00e9r\u00e9"],"Iframe":["Cadre"],"Fill the URL and the title of the iframe.":["Veuillez saisir une URL et un titre pour le cadre."],"URL":["URL"],"The URL is invalid.":["L\u2019URL n\u2019est pas valide."],"Title":["Titre"],"The title of the iframe is used for accessibility purposes and it will only be visible to screen readers.":["Le titre du cadre est utilis\u00e9 \u00e0 des fins d\u2019accessibilit\u00e9 et sera uniquement visible pour les technologies d\u2019assistance."],"Add iframe":["Ajouter le cadre"]}}}
{"translation-revision-date":"2026-01-12 11:32+0100","generator":"WP-CLI\/2.11.0","source":"build\/blockparty-iframe\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_FR","plural-forms":"nplurals=2; plural=(n != 1);"},"Replace":["Remplacer"],"View":["Voir"],"Settings":["R\u00e9glages"],"Enable lazyloading":["Activer le chargement diff\u00e9r\u00e9"],"Iframe":["Cadre"],"Fill the iframe source and the title of the iframe.":["Veuillez remplir la source du cadre ainsi que son titre."],"Source":["Source"],"You can either paste a URL or the iframe code.":["Vous pouvez soit renseigner une URL soit le code HTML du cadre."],"Title":["Titre"],"The title of the iframe is used for accessibility purposes and it will only be visible to screen readers.":["Le titre du cadre est utilis\u00e9 \u00e0 des fins d\u2019accessibilit\u00e9 et ne sera visible que par les technologies d\u2019assistance."],"Add iframe":["Ajouter un cadre"]}}}
Binary file modified languages/blockparty-iframe-fr_FR.mo
Binary file not shown.
60 changes: 55 additions & 5 deletions languages/blockparty-iframe-fr_FR.po
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: Blockparty Iframe 1.0.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blockparty-iframe\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blockparty-"
"iframe\n"
"POT-Creation-Date: 2026-01-12T10:29:55+00:00\n"
"PO-Revision-Date: 2026-01-12 11:32+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2025-12-24T14:09:32+00:00\n"
"PO-Revision-Date: 2025-12-24 15:10+0100\n"
"Language: fr_FR\n"
"X-Generator: Poedit 3.8\n"
"X-Domain: blockparty-iframe\n"

Expand All @@ -21,13 +22,62 @@ msgstr "Blockparty Cadre"
#. Description of the plugin
#: blockparty-iframe.php
msgid "Add a block to display an embedded frame in the WordPress editor."
msgstr "Ajoute un bloc pour afficher un cadre intégré dans l’éditeur WordPress."
msgstr ""
"Ajoute un bloc pour afficher un cadre intégré dans l’éditeur WordPress."

#. Author of the plugin
#: blockparty-iframe.php
msgid "Be API Technical team"
msgstr "L’ équipe technique de Be API"

#: build/blockparty-iframe/index.js:1
msgid "Replace"
msgstr "Remplacer"

#: build/blockparty-iframe/index.js:1
msgid "View"
msgstr "Voir"

#: build/blockparty-iframe/index.js:1
msgid "Settings"
msgstr "Réglages"

#: build/blockparty-iframe/index.js:1
msgid "Enable lazyloading"
msgstr "Activer le chargement différé"

#: build/blockparty-iframe/index.js:1
msgid "Iframe"
msgstr "Cadre"

#: build/blockparty-iframe/index.js:1
msgid "Fill the iframe source and the title of the iframe."
msgstr "Veuillez remplir la source du cadre ainsi que son titre."

#: build/blockparty-iframe/index.js:1
msgid "Source"
msgstr "Source"

#: build/blockparty-iframe/index.js:1
msgid "You can either paste a URL or the iframe code."
msgstr "Vous pouvez soit renseigner une URL soit le code HTML du cadre."

#: build/blockparty-iframe/index.js:1
msgid "Title"
msgstr "Titre"

#: build/blockparty-iframe/index.js:1
msgid ""
"The title of the iframe is used for accessibility purposes and it will only "
"be visible to screen readers."
msgstr ""
"Le titre du cadre est utilisé à des fins d’accessibilité et ne sera visible "
"que par les technologies d’assistance."

#: build/blockparty-iframe/index.js:1
msgid "Add iframe"
msgstr "Ajouter un cadre"

#: build/blockparty-iframe/block.json
msgctxt "block title"
msgid "Iframe"
Expand Down
12 changes: 6 additions & 6 deletions languages/blockparty-iframe.pot
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (C) 2025 Be API Technical team
# Copyright (C) 2026 Be API Technical team
# This file is distributed under the GPL-2.0-or-later.
msgid ""
msgstr ""
"Project-Id-Version: Blockparty Iframe 1.0.0\n"
"Project-Id-Version: Blockparty Iframe 1.1.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blockparty-iframe\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2025-12-24T14:09:32+00:00\n"
"POT-Creation-Date: 2026-01-12T10:29:55+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: blockparty-iframe\n"
Expand Down Expand Up @@ -50,15 +50,15 @@ msgid "Iframe"
msgstr ""

#: build/blockparty-iframe/index.js:1
msgid "Fill the URL and the title of the iframe."
msgid "Fill the iframe source and the title of the iframe."
msgstr ""

#: build/blockparty-iframe/index.js:1
msgid "URL"
msgid "Source"
msgstr ""

#: build/blockparty-iframe/index.js:1
msgid "The URL is invalid."
msgid "You can either paste a URL or the iframe code."
msgstr ""

#: build/blockparty-iframe/index.js:1
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockparty-iframe",
"version": "1.0.2",
"version": "1.1.0",
"description": "Add a block to display an embedded frame in the WordPress editor.",
"author": "Be API Technical team",
"license": "GPL-2.0-or-later",
Expand All @@ -12,6 +12,8 @@
"lint:js": "wp-scripts lint-js",
"packages-update": "wp-scripts packages-update",
"plugin-zip": "wp-scripts plugin-zip",
"make-pot": "wp i18n make-pot . languages/blockparty-iframe.pot --exclude=\"src\" --domain=blockparty-iframe",
"make-json": "wp i18n make-json languages/blockparty-iframe-fr_FR.po languages/ --no-purge",
"start": "wp-scripts start --blocks-manifest",
"start:env": "wp-env start --config=./wp-env.json",
"stop:env": "wp-env stop --config=./wp-env.json"
Expand Down
17 changes: 16 additions & 1 deletion src/blockparty-iframe/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "blockparty/iframe",
"version": "1.0.2",
"version": "1.1.0",
"title": "Iframe",
"category": "widgets",
"description": "Display an embedded frame.",
Expand All @@ -28,6 +28,21 @@
"url": {
"type": "string",
"default": ""
},
"iframeAttributes": {
"type": "array",
"default": [],
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"textdomain": "blockparty-iframe",
Expand Down
Loading
Loading