@wordpress/edit-post 8.19.3 → 8.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/layout/use-should-iframe.js +8 -8
- package/build/components/layout/use-should-iframe.js.map +1 -1
- package/build-module/components/layout/use-should-iframe.js +8 -8
- package/build-module/components/layout/use-should-iframe.js.map +1 -1
- package/package.json +12 -12
- package/src/components/layout/use-should-iframe.js +10 -8
|
@@ -17,6 +17,7 @@ var _lockUnlock = require("../../lock-unlock");
|
|
|
17
17
|
* Internal dependencies
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
+
const isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
|
|
20
21
|
function useShouldIframe() {
|
|
21
22
|
return (0, _data.useSelect)(select => {
|
|
22
23
|
const {
|
|
@@ -25,17 +26,16 @@ function useShouldIframe() {
|
|
|
25
26
|
getDeviceType
|
|
26
27
|
} = select(_editor.store);
|
|
27
28
|
return (
|
|
28
|
-
// If the theme is block based
|
|
29
|
-
// consistency across the post and site
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// For classic themes, we also still want to iframe all the special
|
|
29
|
+
// If the theme is block based and the Gutenberg plugin is active,
|
|
30
|
+
// we ALWAYS use the iframe for consistency across the post and site
|
|
31
|
+
// editor.
|
|
32
|
+
isGutenbergPlugin && getEditorSettings().__unstableIsBlockBasedTheme ||
|
|
33
|
+
// We also still want to iframe all the special
|
|
34
34
|
// editor features and modes such as device previews, zoom out, and
|
|
35
35
|
// template/pattern editing.
|
|
36
36
|
getDeviceType() !== 'Desktop' || ['wp_template', 'wp_block'].includes(getCurrentPostType()) || (0, _lockUnlock.unlock)(select(_blockEditor.store)).isZoomOut() ||
|
|
37
|
-
// Finally, still iframe the editor
|
|
38
|
-
//
|
|
37
|
+
// Finally, still iframe the editor if all blocks are v3 (which means
|
|
38
|
+
// they are marked as iframe-compatible).
|
|
39
39
|
select(_blocks.store).getBlockTypes().every(type => type.apiVersion >= 3)
|
|
40
40
|
);
|
|
41
41
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","_data","_blocks","_blockEditor","_lockUnlock","useShouldIframe","useSelect","select","getEditorSettings","getCurrentPostType","getDeviceType","editorStore","__unstableIsBlockBasedTheme","includes","unlock","blockEditorStore","isZoomOut","blocksStore","getBlockTypes","every","type","apiVersion"],"sources":["@wordpress/edit-post/src/components/layout/use-should-iframe.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nexport function useShouldIframe() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentPostType, getDeviceType } =\n\t\t\tselect( editorStore );\n\t\treturn (\n\t\t\t// If the theme is block based
|
|
1
|
+
{"version":3,"names":["_editor","require","_data","_blocks","_blockEditor","_lockUnlock","isGutenbergPlugin","globalThis","IS_GUTENBERG_PLUGIN","useShouldIframe","useSelect","select","getEditorSettings","getCurrentPostType","getDeviceType","editorStore","__unstableIsBlockBasedTheme","includes","unlock","blockEditorStore","isZoomOut","blocksStore","getBlockTypes","every","type","apiVersion"],"sources":["@wordpress/edit-post/src/components/layout/use-should-iframe.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;\n\nexport function useShouldIframe() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentPostType, getDeviceType } =\n\t\t\tselect( editorStore );\n\t\treturn (\n\t\t\t// If the theme is block based and the Gutenberg plugin is active,\n\t\t\t// we ALWAYS use the iframe for consistency across the post and site\n\t\t\t// editor.\n\t\t\t( isGutenbergPlugin &&\n\t\t\t\tgetEditorSettings().__unstableIsBlockBasedTheme ) ||\n\t\t\t// We also still want to iframe all the special\n\t\t\t// editor features and modes such as device previews, zoom out, and\n\t\t\t// template/pattern editing.\n\t\t\tgetDeviceType() !== 'Desktop' ||\n\t\t\t[ 'wp_template', 'wp_block' ].includes( getCurrentPostType() ) ||\n\t\t\tunlock( select( blockEditorStore ) ).isZoomOut() ||\n\t\t\t// Finally, still iframe the editor if all blocks are v3 (which means\n\t\t\t// they are marked as iframe-compatible).\n\t\t\tselect( blocksStore )\n\t\t\t\t.getBlockTypes()\n\t\t\t\t.every( ( type ) => type.apiVersion >= 3 )\n\t\t);\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAMK,iBAAiB,GAAGC,UAAU,CAACC,mBAAmB,GAAG,IAAI,GAAG,KAAK;AAEhE,SAASC,eAAeA,CAAA,EAAG;EACjC,OAAO,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC/B,MAAM;MAAEC,iBAAiB;MAAEC,kBAAkB;MAAEC;IAAc,CAAC,GAC7DH,MAAM,CAAEI,aAAY,CAAC;IACtB;MACC;MACA;MACA;MACET,iBAAiB,IAClBM,iBAAiB,CAAC,CAAC,CAACI,2BAA2B;MAChD;MACA;MACA;MACAF,aAAa,CAAC,CAAC,KAAK,SAAS,IAC7B,CAAE,aAAa,EAAE,UAAU,CAAE,CAACG,QAAQ,CAAEJ,kBAAkB,CAAC,CAAE,CAAC,IAC9D,IAAAK,kBAAM,EAAEP,MAAM,CAAEQ,kBAAiB,CAAE,CAAC,CAACC,SAAS,CAAC,CAAC;MAChD;MACA;MACAT,MAAM,CAAEU,aAAY,CAAC,CACnBC,aAAa,CAAC,CAAC,CACfC,KAAK,CAAIC,IAAI,IAAMA,IAAI,CAACC,UAAU,IAAI,CAAE;IAAC;EAE7C,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { unlock } from '../../lock-unlock';
|
|
13
|
+
const isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
|
|
13
14
|
export function useShouldIframe() {
|
|
14
15
|
return useSelect(select => {
|
|
15
16
|
const {
|
|
@@ -18,17 +19,16 @@ export function useShouldIframe() {
|
|
|
18
19
|
getDeviceType
|
|
19
20
|
} = select(editorStore);
|
|
20
21
|
return (
|
|
21
|
-
// If the theme is block based
|
|
22
|
-
// consistency across the post and site
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// For classic themes, we also still want to iframe all the special
|
|
22
|
+
// If the theme is block based and the Gutenberg plugin is active,
|
|
23
|
+
// we ALWAYS use the iframe for consistency across the post and site
|
|
24
|
+
// editor.
|
|
25
|
+
isGutenbergPlugin && getEditorSettings().__unstableIsBlockBasedTheme ||
|
|
26
|
+
// We also still want to iframe all the special
|
|
27
27
|
// editor features and modes such as device previews, zoom out, and
|
|
28
28
|
// template/pattern editing.
|
|
29
29
|
getDeviceType() !== 'Desktop' || ['wp_template', 'wp_block'].includes(getCurrentPostType()) || unlock(select(blockEditorStore)).isZoomOut() ||
|
|
30
|
-
// Finally, still iframe the editor
|
|
31
|
-
//
|
|
30
|
+
// Finally, still iframe the editor if all blocks are v3 (which means
|
|
31
|
+
// they are marked as iframe-compatible).
|
|
32
32
|
select(blocksStore).getBlockTypes().every(type => type.apiVersion >= 3)
|
|
33
33
|
);
|
|
34
34
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","editorStore","useSelect","blocksStore","blockEditorStore","unlock","useShouldIframe","select","getEditorSettings","getCurrentPostType","getDeviceType","__unstableIsBlockBasedTheme","includes","isZoomOut","getBlockTypes","every","type","apiVersion"],"sources":["@wordpress/edit-post/src/components/layout/use-should-iframe.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nexport function useShouldIframe() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentPostType, getDeviceType } =\n\t\t\tselect( editorStore );\n\t\treturn (\n\t\t\t// If the theme is block based
|
|
1
|
+
{"version":3,"names":["store","editorStore","useSelect","blocksStore","blockEditorStore","unlock","isGutenbergPlugin","globalThis","IS_GUTENBERG_PLUGIN","useShouldIframe","select","getEditorSettings","getCurrentPostType","getDeviceType","__unstableIsBlockBasedTheme","includes","isZoomOut","getBlockTypes","every","type","apiVersion"],"sources":["@wordpress/edit-post/src/components/layout/use-should-iframe.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;\n\nexport function useShouldIframe() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentPostType, getDeviceType } =\n\t\t\tselect( editorStore );\n\t\treturn (\n\t\t\t// If the theme is block based and the Gutenberg plugin is active,\n\t\t\t// we ALWAYS use the iframe for consistency across the post and site\n\t\t\t// editor.\n\t\t\t( isGutenbergPlugin &&\n\t\t\t\tgetEditorSettings().__unstableIsBlockBasedTheme ) ||\n\t\t\t// We also still want to iframe all the special\n\t\t\t// editor features and modes such as device previews, zoom out, and\n\t\t\t// template/pattern editing.\n\t\t\tgetDeviceType() !== 'Desktop' ||\n\t\t\t[ 'wp_template', 'wp_block' ].includes( getCurrentPostType() ) ||\n\t\t\tunlock( select( blockEditorStore ) ).isZoomOut() ||\n\t\t\t// Finally, still iframe the editor if all blocks are v3 (which means\n\t\t\t// they are marked as iframe-compatible).\n\t\t\tselect( blocksStore )\n\t\t\t\t.getBlockTypes()\n\t\t\t\t.every( ( type ) => type.apiVersion >= 3 )\n\t\t);\n\t}, [] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASF,KAAK,IAAIG,WAAW,QAAQ,mBAAmB;AACxD,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAMC,iBAAiB,GAAGC,UAAU,CAACC,mBAAmB,GAAG,IAAI,GAAG,KAAK;AAEvE,OAAO,SAASC,eAAeA,CAAA,EAAG;EACjC,OAAOP,SAAS,CAAIQ,MAAM,IAAM;IAC/B,MAAM;MAAEC,iBAAiB;MAAEC,kBAAkB;MAAEC;IAAc,CAAC,GAC7DH,MAAM,CAAET,WAAY,CAAC;IACtB;MACC;MACA;MACA;MACEK,iBAAiB,IAClBK,iBAAiB,CAAC,CAAC,CAACG,2BAA2B;MAChD;MACA;MACA;MACAD,aAAa,CAAC,CAAC,KAAK,SAAS,IAC7B,CAAE,aAAa,EAAE,UAAU,CAAE,CAACE,QAAQ,CAAEH,kBAAkB,CAAC,CAAE,CAAC,IAC9DP,MAAM,CAAEK,MAAM,CAAEN,gBAAiB,CAAE,CAAC,CAACY,SAAS,CAAC,CAAC;MAChD;MACA;MACAN,MAAM,CAAEP,WAAY,CAAC,CACnBc,aAAa,CAAC,CAAC,CACfC,KAAK,CAAIC,IAAI,IAAMA,IAAI,CAACC,UAAU,IAAI,CAAE;IAAC;EAE7C,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "8.19.
|
|
3
|
+
"version": "8.19.4",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"@babel/runtime": "7.25.7",
|
|
32
32
|
"@wordpress/a11y": "^4.19.1",
|
|
33
33
|
"@wordpress/api-fetch": "^7.19.1",
|
|
34
|
-
"@wordpress/block-editor": "^14.14.
|
|
35
|
-
"@wordpress/block-library": "^9.19.
|
|
34
|
+
"@wordpress/block-editor": "^14.14.3",
|
|
35
|
+
"@wordpress/block-library": "^9.19.3",
|
|
36
36
|
"@wordpress/blocks": "^14.8.1",
|
|
37
|
-
"@wordpress/commands": "^1.19.
|
|
38
|
-
"@wordpress/components": "^29.5.
|
|
37
|
+
"@wordpress/commands": "^1.19.2",
|
|
38
|
+
"@wordpress/components": "^29.5.2",
|
|
39
39
|
"@wordpress/compose": "^7.19.1",
|
|
40
|
-
"@wordpress/core-commands": "^1.19.
|
|
41
|
-
"@wordpress/core-data": "^7.19.
|
|
40
|
+
"@wordpress/core-commands": "^1.19.3",
|
|
41
|
+
"@wordpress/core-data": "^7.19.3",
|
|
42
42
|
"@wordpress/data": "^10.19.1",
|
|
43
43
|
"@wordpress/deprecated": "^4.19.1",
|
|
44
44
|
"@wordpress/dom": "^4.19.1",
|
|
45
|
-
"@wordpress/editor": "^14.19.
|
|
45
|
+
"@wordpress/editor": "^14.19.4",
|
|
46
46
|
"@wordpress/element": "^6.19.1",
|
|
47
47
|
"@wordpress/hooks": "^4.19.1",
|
|
48
48
|
"@wordpress/html-entities": "^4.19.1",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"@wordpress/keyboard-shortcuts": "^5.19.1",
|
|
52
52
|
"@wordpress/keycodes": "^4.19.1",
|
|
53
53
|
"@wordpress/notices": "^5.19.1",
|
|
54
|
-
"@wordpress/plugins": "^7.19.
|
|
55
|
-
"@wordpress/preferences": "^4.19.
|
|
54
|
+
"@wordpress/plugins": "^7.19.2",
|
|
55
|
+
"@wordpress/preferences": "^4.19.2",
|
|
56
56
|
"@wordpress/private-apis": "^1.19.1",
|
|
57
57
|
"@wordpress/url": "^4.19.1",
|
|
58
58
|
"@wordpress/viewport": "^6.19.1",
|
|
59
59
|
"@wordpress/warning": "^3.19.1",
|
|
60
|
-
"@wordpress/widgets": "^4.19.
|
|
60
|
+
"@wordpress/widgets": "^4.19.3",
|
|
61
61
|
"clsx": "^2.1.1",
|
|
62
62
|
"memize": "^2.1.0"
|
|
63
63
|
},
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "0750912b313e3e488ec2cad0c084e548cedd6b95"
|
|
72
72
|
}
|
|
@@ -11,24 +11,26 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
|
11
11
|
*/
|
|
12
12
|
import { unlock } from '../../lock-unlock';
|
|
13
13
|
|
|
14
|
+
const isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
|
|
15
|
+
|
|
14
16
|
export function useShouldIframe() {
|
|
15
17
|
return useSelect( ( select ) => {
|
|
16
18
|
const { getEditorSettings, getCurrentPostType, getDeviceType } =
|
|
17
19
|
select( editorStore );
|
|
18
20
|
return (
|
|
19
|
-
// If the theme is block based
|
|
20
|
-
// consistency across the post and site
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//
|
|
21
|
+
// If the theme is block based and the Gutenberg plugin is active,
|
|
22
|
+
// we ALWAYS use the iframe for consistency across the post and site
|
|
23
|
+
// editor.
|
|
24
|
+
( isGutenbergPlugin &&
|
|
25
|
+
getEditorSettings().__unstableIsBlockBasedTheme ) ||
|
|
26
|
+
// We also still want to iframe all the special
|
|
25
27
|
// editor features and modes such as device previews, zoom out, and
|
|
26
28
|
// template/pattern editing.
|
|
27
29
|
getDeviceType() !== 'Desktop' ||
|
|
28
30
|
[ 'wp_template', 'wp_block' ].includes( getCurrentPostType() ) ||
|
|
29
31
|
unlock( select( blockEditorStore ) ).isZoomOut() ||
|
|
30
|
-
// Finally, still iframe the editor
|
|
31
|
-
//
|
|
32
|
+
// Finally, still iframe the editor if all blocks are v3 (which means
|
|
33
|
+
// they are marked as iframe-compatible).
|
|
32
34
|
select( blocksStore )
|
|
33
35
|
.getBlockTypes()
|
|
34
36
|
.every( ( type ) => type.apiVersion >= 3 )
|