@wordpress/block-library 9.11.0 → 9.12.1-next.082ed6819.0
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/CHANGELOG.md +2 -0
- package/build/block-keyboard-shortcuts/index.js +7 -7
- package/build/block-keyboard-shortcuts/index.js.map +1 -1
- package/build/button/index.js +1 -1
- package/build/button/index.js.map +1 -1
- package/build/cover/deprecated.js +140 -4
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +1 -1
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/cover-placeholder.js +1 -2
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +23 -23
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/index.js +10 -10
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +13 -13
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +6 -7
- package/build/cover/shared.js.map +1 -1
- package/build/details/index.js +20 -0
- package/build/details/index.js.map +1 -1
- package/build/file/edit.js +8 -4
- package/build/file/edit.js.map +1 -1
- package/build/freeform/modal.js +1 -1
- package/build/freeform/modal.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/heading/index.js +1 -7
- package/build/heading/index.js.map +1 -1
- package/build/home-link/edit.js +20 -36
- package/build/home-link/edit.js.map +1 -1
- package/build/image/edit.js +1 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +144 -78
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +1 -1
- package/build/latest-posts/edit.js +0 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/navigation/edit/index.js +2 -23
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +6 -8
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/page-list/index.js +14 -0
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +26 -25
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-content/index.js +13 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-template/edit.js +11 -0
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +3 -13
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js +0 -3
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/edit/query-content.js +10 -12
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/index.js +1 -1
- package/build/query/utils.js +38 -9
- package/build/query/utils.js.map +1 -1
- package/build/social-link/edit.js +22 -9
- package/build/social-link/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -7
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +1 -4
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +0 -3
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/get-template-part-icon.js +23 -0
- package/build/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build/template-part/edit/utils/hooks.js +1 -6
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/variations.js +6 -12
- package/build/template-part/variations.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +135 -123
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/block-keyboard-shortcuts/index.js +7 -7
- package/build-module/block-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/button/index.js +1 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/cover/deprecated.js +140 -4
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +1 -1
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/cover-placeholder.js +1 -2
- package/build-module/cover/edit/cover-placeholder.js.map +1 -1
- package/build-module/cover/edit/index.js +23 -23
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/index.js +10 -10
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +13 -13
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +6 -7
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/details/index.js +21 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/edit.js +8 -4
- package/build-module/file/edit.js.map +1 -1
- package/build-module/freeform/modal.js +1 -1
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/heading/index.js +1 -7
- package/build-module/heading/index.js.map +1 -1
- package/build-module/home-link/edit.js +23 -39
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/image/edit.js +1 -1
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +149 -83
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +1 -1
- package/build-module/latest-posts/edit.js +0 -1
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/navigation/edit/index.js +2 -23
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +6 -8
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/page-list/index.js +14 -0
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +26 -25
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-content/index.js +13 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-template/edit.js +11 -0
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +3 -13
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js +0 -3
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/edit/query-content.js +10 -12
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/index.js +1 -1
- package/build-module/query/utils.js +35 -8
- package/build-module/query/utils.js.map +1 -1
- package/build-module/social-link/edit.js +24 -11
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +3 -8
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -4
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +0 -3
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/get-template-part-icon.js +15 -0
- package/build-module/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build-module/template-part/edit/utils/hooks.js +1 -6
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/variations.js +5 -11
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +136 -124
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/cover/editor-rtl.css +3 -5
- package/build-style/cover/editor.css +3 -5
- package/build-style/cover/style-rtl.css +19 -15
- package/build-style/cover/style.css +19 -15
- package/build-style/editor-rtl.css +19 -30
- package/build-style/editor.css +19 -30
- package/build-style/group/editor-rtl.css +0 -10
- package/build-style/group/editor.css +0 -10
- package/build-style/image/editor-rtl.css +4 -0
- package/build-style/image/editor.css +4 -0
- package/build-style/image/style-rtl.css +0 -2
- package/build-style/image/style.css +0 -2
- package/build-style/latest-posts/editor-rtl.css +0 -7
- package/build-style/latest-posts/editor.css +0 -7
- package/build-style/media-text/style-rtl.css +1 -1
- package/build-style/media-text/style.css +1 -1
- package/build-style/navigation/style-rtl.css +1 -1
- package/build-style/navigation/style.css +1 -1
- package/build-style/page-list/style-rtl.css +4 -0
- package/build-style/page-list/style.css +4 -0
- package/build-style/query/editor-rtl.css +0 -4
- package/build-style/query/editor.css +0 -4
- package/build-style/search/style-rtl.css +3 -3
- package/build-style/search/style.css +3 -3
- package/build-style/social-link/editor-rtl.css +4 -4
- package/build-style/social-link/editor.css +4 -4
- package/build-style/style-rtl.css +28 -22
- package/build-style/style.css +28 -22
- package/build-style/video/editor-rtl.css +8 -0
- package/build-style/video/editor.css +8 -0
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/package.json +39 -39
- package/src/block-keyboard-shortcuts/index.js +25 -11
- package/src/button/index.js +1 -1
- package/src/comments/block.json +3 -9
- package/src/cover/deprecated.js +182 -4
- package/src/cover/edit/block-controls.js +1 -1
- package/src/cover/edit/cover-placeholder.js +0 -3
- package/src/cover/edit/index.js +42 -27
- package/src/cover/editor.scss +4 -5
- package/src/cover/index.js +8 -8
- package/src/cover/save.js +27 -20
- package/src/cover/shared.js +10 -10
- package/src/cover/style.scss +40 -16
- package/src/cover/test/__snapshots__/edit.native.js.snap +9 -9
- package/src/cover/test/__snapshots__/transforms.native.js.snap +4 -4
- package/src/cover/test/edit.js +2 -2
- package/src/cover/test/edit.native.js +4 -4
- package/src/cover/test/transforms.native.js +4 -4
- package/src/details/block.json +1 -0
- package/src/details/index.js +23 -1
- package/src/file/edit.js +9 -3
- package/src/freeform/modal.js +1 -1
- package/src/gallery/edit.js +1 -1
- package/src/group/editor.scss +0 -12
- package/src/heading/block.json +1 -7
- package/src/home-link/edit.js +27 -45
- package/src/home-link/index.php +0 -3
- package/src/image/block.json +1 -1
- package/src/image/edit.js +1 -1
- package/src/image/editor.scss +4 -0
- package/src/image/image.js +200 -109
- package/src/image/style.scss +0 -1
- package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/latest-posts/edit.js +0 -1
- package/src/latest-posts/editor.scss +0 -11
- package/src/media-text/style.scss +1 -1
- package/src/media-text/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/navigation/edit/index.js +3 -30
- package/src/navigation/index.php +5 -151
- package/src/navigation/style.scss +1 -1
- package/src/navigation/use-template-part-area-label.js +10 -10
- package/src/page-list/block.json +14 -0
- package/src/page-list/style.scss +4 -0
- package/src/paragraph/edit.js +20 -17
- package/src/pattern/index.php +0 -7
- package/src/post-content/block.json +14 -1
- package/src/post-template/block.json +2 -1
- package/src/post-template/edit.js +19 -0
- package/src/query/block.json +1 -1
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -5
- package/src/query/edit/inspector-controls/index.js +2 -12
- package/src/query/edit/pattern-selection-modal.js +0 -3
- package/src/query/edit/query-content.js +9 -17
- package/src/query/editor.scss +0 -4
- package/src/query/index.php +1 -1
- package/src/query/test/utils.js +59 -1
- package/src/query/utils.js +43 -15
- package/src/rss/index.php +11 -8
- package/src/search/index.php +2 -2
- package/src/search/style.scss +3 -5
- package/src/social-link/edit.js +47 -19
- package/src/social-link/editor.scss +6 -7
- package/src/template-part/edit/advanced-controls.js +13 -13
- package/src/template-part/edit/index.js +1 -4
- package/src/template-part/edit/selection-modal.js +0 -3
- package/src/template-part/edit/utils/get-template-part-icon.js +20 -0
- package/src/template-part/edit/utils/hooks.js +2 -7
- package/src/template-part/variations.js +4 -16
- package/src/video/edit.js +1 -1
- package/src/video/editor.scss +9 -0
- package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/video/tracks-editor.js +157 -141
- package/tsconfig.tsbuildinfo +1 -1
- package/build/query/edit/inspector-controls/create-new-post-link.js +0 -40
- package/build/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/build-module/query/edit/inspector-controls/create-new-post-link.js +0 -33
- package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/src/query/edit/inspector-controls/create-new-post-link.js +0 -32
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -81,14 +81,14 @@ function BlockKeyboardShortcuts() {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
-
}, []);
|
|
84
|
+
}, [registerShortcut]);
|
|
85
85
|
(0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-heading-to-paragraph', event => handleTransformHeadingAndParagraph(event, 0));
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
(0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-1', event => handleTransformHeadingAndParagraph(event, 1));
|
|
87
|
+
(0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-2', event => handleTransformHeadingAndParagraph(event, 2));
|
|
88
|
+
(0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-3', event => handleTransformHeadingAndParagraph(event, 3));
|
|
89
|
+
(0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-4', event => handleTransformHeadingAndParagraph(event, 4));
|
|
90
|
+
(0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-5', event => handleTransformHeadingAndParagraph(event, 5));
|
|
91
|
+
(0, _keyboardShortcuts.useShortcut)('core/block-editor/transform-paragraph-to-heading-6', event => handleTransformHeadingAndParagraph(event, 6));
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
94
|
var _default = exports.default = BlockKeyboardShortcuts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_keyboardShortcuts","_i18n","_blocks","_blockEditor","BlockKeyboardShortcuts","registerShortcut","useDispatch","keyboardShortcutsStore","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","useSelect","handleTransformHeadingAndParagraph","event","level","preventDefault","currentClientId","blockName","isParagraph","isHeading","destinationBlockName","attributes","textAlign","destinationTextAlign","createBlock","content","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","forEach","useShortcut","_default","exports","default"],"sources":["@wordpress/block-library/src/block-keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { createBlock } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockKeyboardShortcuts() {\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTransformHeadingAndParagraph = ( event, level ) => {\n\t\tevent.preventDefault();\n\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tconst isParagraph = blockName === 'core/paragraph';\n\t\tconst isHeading = blockName === 'core/heading';\n\n\t\tif ( ! isParagraph && ! isHeading ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\n\t\t// Avoid unnecessary block transform when attempting to transform to\n\t\t// the same block type and/or same level.\n\t\tif (\n\t\t\t( isParagraph && level === 0 ) ||\n\t\t\t( isHeading && attributes.level === level )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/block-editor/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: '0',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: '7',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/block-editor/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [] );\n\n\tuseShortcut(\n\t\t'core/block-editor/transform-heading-to-paragraph',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 0 )\n\t);\n\n\t
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_keyboardShortcuts","_i18n","_blocks","_blockEditor","BlockKeyboardShortcuts","registerShortcut","useDispatch","keyboardShortcutsStore","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","useSelect","handleTransformHeadingAndParagraph","event","level","preventDefault","currentClientId","blockName","isParagraph","isHeading","destinationBlockName","attributes","textAlign","destinationTextAlign","createBlock","content","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","forEach","useShortcut","_default","exports","default"],"sources":["@wordpress/block-library/src/block-keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { createBlock } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockKeyboardShortcuts() {\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTransformHeadingAndParagraph = ( event, level ) => {\n\t\tevent.preventDefault();\n\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tconst isParagraph = blockName === 'core/paragraph';\n\t\tconst isHeading = blockName === 'core/heading';\n\n\t\tif ( ! isParagraph && ! isHeading ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\n\t\t// Avoid unnecessary block transform when attempting to transform to\n\t\t// the same block type and/or same level.\n\t\tif (\n\t\t\t( isParagraph && level === 0 ) ||\n\t\t\t( isHeading && attributes.level === level )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/block-editor/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: '0',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: '7',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/block-editor/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\tuseShortcut(\n\t\t'core/block-editor/transform-heading-to-paragraph',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 0 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-1',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 1 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-2',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 2 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-3',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 3 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-4',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 4 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-5',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 5 )\n\t);\n\tuseShortcut(\n\t\t'core/block-editor/transform-paragraph-to-heading-6',\n\t\t( event ) => handleTransformHeadingAndParagraph( event, 6 )\n\t);\n\n\treturn null;\n}\n\nexport default BlockKeyboardShortcuts;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAWA,SAASM,sBAAsBA,CAAA,EAAG;EACjC,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,wBAAuB,CAAC;EAClE,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAF,iBAAW,EAAEG,kBAAiB,CAAC;EACzD,MAAM;IAAEC,YAAY;IAAEC,wBAAwB;IAAEC;EAAmB,CAAC,GACnE,IAAAC,eAAS,EAAEJ,kBAAiB,CAAC;EAE9B,MAAMK,kCAAkC,GAAGA,CAAEC,KAAK,EAAEC,KAAK,KAAM;IAC9DD,KAAK,CAACE,cAAc,CAAC,CAAC;IAEtB,MAAMC,eAAe,GAAGP,wBAAwB,CAAC,CAAC;IAClD,IAAKO,eAAe,KAAK,IAAI,EAAG;MAC/B;IACD;IAEA,MAAMC,SAAS,GAAGT,YAAY,CAAEQ,eAAgB,CAAC;IACjD,MAAME,WAAW,GAAGD,SAAS,KAAK,gBAAgB;IAClD,MAAME,SAAS,GAAGF,SAAS,KAAK,cAAc;IAE9C,IAAK,CAAEC,WAAW,IAAI,CAAEC,SAAS,EAAG;MACnC;IACD;IAEA,MAAMC,oBAAoB,GACzBN,KAAK,KAAK,CAAC,GAAG,gBAAgB,GAAG,cAAc;IAEhD,MAAMO,UAAU,GAAGX,kBAAkB,CAAEM,eAAgB,CAAC;;IAExD;IACA;IACA,IACGE,WAAW,IAAIJ,KAAK,KAAK,CAAC,IAC1BK,SAAS,IAAIE,U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AMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EACD,IAAAuB,8BAAW,EACV,oDAAoD,EAClDvB,KAAK,IAAMD,kCAAkC,CAAEC,KAAK,EAAE,CAAE,CAC3D,CAAC;EAED,OAAO,IAAI;AACZ;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrC,sBAAsB","ignoreList":[]}
|
package/build/button/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","role","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","role","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to action' ),\n\t\t},\n\t},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I;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,KAAK,EAAEA,CAAEC,CAAC,EAAE;IAAEnD,IAAI,GAAG;EAAG,CAAC,MAAQ;IAChC,GAAGmD,CAAC;IACJnD,IAAI,EAAE,CAAEmD,CAAC,CAACnD,IAAI,IAAI,EAAE,IAAKA;EAC1B,CAAC;AACF,CAAC;AAEM,MAAMoD,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAErE,IAAI;EAAEJ,QAAQ;EAAE8D;AAAS,CAAE,CAAC;AAAC7D,OAAA,CAAAuE,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -153,7 +153,7 @@ const v8ToV11BlockAttributes = {
|
|
|
153
153
|
enum: ['all', 'insert', false]
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
const
|
|
156
|
+
const v12toV13BlockAttributes = {
|
|
157
157
|
...v8ToV11BlockAttributes,
|
|
158
158
|
useFeaturedImage: {
|
|
159
159
|
type: 'boolean',
|
|
@@ -164,6 +164,19 @@ const v12BlockAttributes = {
|
|
|
164
164
|
default: 'div'
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
|
+
const v14BlockAttributes = {
|
|
168
|
+
...v12toV13BlockAttributes,
|
|
169
|
+
isUserOverlayColor: {
|
|
170
|
+
type: 'boolean'
|
|
171
|
+
},
|
|
172
|
+
sizeSlug: {
|
|
173
|
+
type: 'string'
|
|
174
|
+
},
|
|
175
|
+
alt: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
default: ''
|
|
178
|
+
}
|
|
179
|
+
};
|
|
167
180
|
const v7toV11BlockSupports = {
|
|
168
181
|
anchor: true,
|
|
169
182
|
align: true,
|
|
@@ -228,10 +241,133 @@ const v12BlockSupports = {
|
|
|
228
241
|
allowJustification: false
|
|
229
242
|
}
|
|
230
243
|
};
|
|
244
|
+
const v14BlockSupports = {
|
|
245
|
+
...v12BlockSupports,
|
|
246
|
+
shadow: true,
|
|
247
|
+
dimensions: {
|
|
248
|
+
aspectRatio: true
|
|
249
|
+
},
|
|
250
|
+
interactivity: {
|
|
251
|
+
clientNavigation: true
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// Deprecation for blocks that have z-index.
|
|
256
|
+
const v14 = {
|
|
257
|
+
attributes: v14BlockAttributes,
|
|
258
|
+
supports: v14BlockSupports,
|
|
259
|
+
save({
|
|
260
|
+
attributes
|
|
261
|
+
}) {
|
|
262
|
+
const {
|
|
263
|
+
backgroundType,
|
|
264
|
+
gradient,
|
|
265
|
+
contentPosition,
|
|
266
|
+
customGradient,
|
|
267
|
+
customOverlayColor,
|
|
268
|
+
dimRatio,
|
|
269
|
+
focalPoint,
|
|
270
|
+
useFeaturedImage,
|
|
271
|
+
hasParallax,
|
|
272
|
+
isDark,
|
|
273
|
+
isRepeated,
|
|
274
|
+
overlayColor,
|
|
275
|
+
url,
|
|
276
|
+
alt,
|
|
277
|
+
id,
|
|
278
|
+
minHeight: minHeightProp,
|
|
279
|
+
minHeightUnit,
|
|
280
|
+
tagName: Tag,
|
|
281
|
+
sizeSlug
|
|
282
|
+
} = attributes;
|
|
283
|
+
const overlayColorClass = (0, _blockEditor.getColorClassName)('background-color', overlayColor);
|
|
284
|
+
const gradientClass = (0, _blockEditor.__experimentalGetGradientClass)(gradient);
|
|
285
|
+
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
|
|
286
|
+
const isImageBackground = _shared.IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
287
|
+
const isVideoBackground = _shared.VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
288
|
+
const isImgElement = !(hasParallax || isRepeated);
|
|
289
|
+
const style = {
|
|
290
|
+
minHeight: minHeight || undefined
|
|
291
|
+
};
|
|
292
|
+
const bgStyle = {
|
|
293
|
+
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
|
|
294
|
+
background: customGradient ? customGradient : undefined
|
|
295
|
+
};
|
|
296
|
+
const objectPosition =
|
|
297
|
+
// prettier-ignore
|
|
298
|
+
focalPoint && isImgElement ? (0, _shared.mediaPosition)(focalPoint) : undefined;
|
|
299
|
+
const backgroundImage = url ? `url(${url})` : undefined;
|
|
300
|
+
const backgroundPosition = (0, _shared.mediaPosition)(focalPoint);
|
|
301
|
+
const classes = (0, _clsx.default)({
|
|
302
|
+
'is-light': !isDark,
|
|
303
|
+
'has-parallax': hasParallax,
|
|
304
|
+
'is-repeated': isRepeated,
|
|
305
|
+
'has-custom-content-position': !(0, _shared.isContentPositionCenter)(contentPosition)
|
|
306
|
+
}, (0, _shared.getPositionClassName)(contentPosition));
|
|
307
|
+
const imgClasses = (0, _clsx.default)('wp-block-cover__image-background', id ? `wp-image-${id}` : null, {
|
|
308
|
+
[`size-${sizeSlug}`]: sizeSlug,
|
|
309
|
+
'has-parallax': hasParallax,
|
|
310
|
+
'is-repeated': isRepeated
|
|
311
|
+
});
|
|
312
|
+
const gradientValue = gradient || customGradient;
|
|
313
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tag, {
|
|
314
|
+
..._blockEditor.useBlockProps.save({
|
|
315
|
+
className: classes,
|
|
316
|
+
style
|
|
317
|
+
}),
|
|
318
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
319
|
+
"aria-hidden": "true",
|
|
320
|
+
className: (0, _clsx.default)('wp-block-cover__background', overlayColorClass, (0, _shared.dimRatioToClass)(dimRatio), {
|
|
321
|
+
'has-background-dim': dimRatio !== undefined,
|
|
322
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
323
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
324
|
+
// media, a gradient and a dim.
|
|
325
|
+
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
|
|
326
|
+
'has-background-gradient': gradientValue,
|
|
327
|
+
[gradientClass]: gradientClass
|
|
328
|
+
}),
|
|
329
|
+
style: bgStyle
|
|
330
|
+
}), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
331
|
+
className: imgClasses,
|
|
332
|
+
alt: alt,
|
|
333
|
+
src: url,
|
|
334
|
+
style: {
|
|
335
|
+
objectPosition
|
|
336
|
+
},
|
|
337
|
+
"data-object-fit": "cover",
|
|
338
|
+
"data-object-position": objectPosition
|
|
339
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
340
|
+
role: alt ? 'img' : undefined,
|
|
341
|
+
"aria-label": alt ? alt : undefined,
|
|
342
|
+
className: imgClasses,
|
|
343
|
+
style: {
|
|
344
|
+
backgroundPosition,
|
|
345
|
+
backgroundImage
|
|
346
|
+
}
|
|
347
|
+
})), isVideoBackground && url && /*#__PURE__*/(0, _jsxRuntime.jsx)("video", {
|
|
348
|
+
className: (0, _clsx.default)('wp-block-cover__video-background', 'intrinsic-ignore'),
|
|
349
|
+
autoPlay: true,
|
|
350
|
+
muted: true,
|
|
351
|
+
loop: true,
|
|
352
|
+
playsInline: true,
|
|
353
|
+
src: url,
|
|
354
|
+
style: {
|
|
355
|
+
objectPosition
|
|
356
|
+
},
|
|
357
|
+
"data-object-fit": "cover",
|
|
358
|
+
"data-object-position": objectPosition
|
|
359
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
360
|
+
..._blockEditor.useInnerBlocksProps.save({
|
|
361
|
+
className: 'wp-block-cover__inner-container'
|
|
362
|
+
})
|
|
363
|
+
})]
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
};
|
|
231
367
|
|
|
232
368
|
// Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated.
|
|
233
369
|
const v13 = {
|
|
234
|
-
attributes:
|
|
370
|
+
attributes: v12toV13BlockAttributes,
|
|
235
371
|
supports: v12BlockSupports,
|
|
236
372
|
save({
|
|
237
373
|
attributes
|
|
@@ -341,7 +477,7 @@ const v13 = {
|
|
|
341
477
|
|
|
342
478
|
// Deprecation for blocks to prevent auto overlay color from overriding previously set values.
|
|
343
479
|
const v12 = {
|
|
344
|
-
attributes:
|
|
480
|
+
attributes: v12toV13BlockAttributes,
|
|
345
481
|
supports: v12BlockSupports,
|
|
346
482
|
isEligible(attributes) {
|
|
347
483
|
return (attributes.customOverlayColor !== undefined || attributes.overlayColor !== undefined) && attributes.isUserOverlayColor === undefined;
|
|
@@ -1430,5 +1566,5 @@ const v1 = {
|
|
|
1430
1566
|
})]];
|
|
1431
1567
|
}
|
|
1432
1568
|
};
|
|
1433
|
-
var _default = exports.default = [v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1];
|
|
1569
|
+
var _default = exports.default = [v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1];
|
|
1434
1570
|
//# sourceMappingURL=deprecated.js.map
|