@wordpress/block-library 9.12.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/build/block-keyboard-shortcuts/index.js +7 -7
- package/build/block-keyboard-shortcuts/index.js.map +1 -1
- package/build/cover/edit/index.js +1 -1
- 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/shared.js +6 -7
- package/build/cover/shared.js.map +1 -1
- package/build/details/index.js +19 -0
- package/build/details/index.js.map +1 -1
- package/build/file/edit.js +7 -3
- 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/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/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/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 +1 -11
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/utils.js +6 -8
- 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/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/tracks-editor.js +135 -121
- 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/cover/edit/index.js +1 -1
- 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/shared.js +6 -7
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/details/index.js +20 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/edit.js +7 -3
- 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/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/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/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 +1 -11
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/utils.js +6 -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/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/tracks-editor.js +136 -122
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/editor-rtl.css +12 -8
- package/build-style/editor.css +12 -8
- 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 +8 -4
- package/build-style/style.css +8 -4
- package/build-style/video/editor-rtl.css +8 -0
- package/build-style/video/editor.css +8 -0
- package/package.json +33 -33
- package/src/block-keyboard-shortcuts/index.js +25 -11
- package/src/cover/edit/index.js +1 -1
- package/src/cover/index.js +8 -8
- package/src/cover/shared.js +10 -10
- package/src/cover/test/edit.js +2 -2
- package/src/details/index.js +23 -1
- package/src/file/edit.js +8 -2
- package/src/freeform/modal.js +1 -1
- 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/navigation/index.php +4 -150
- 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/query/edit/inspector-controls/enhanced-pagination-control.js +3 -5
- package/src/query/edit/inspector-controls/index.js +0 -10
- package/src/query/editor.scss +0 -4
- package/src/query/index.php +1 -1
- package/src/query/utils.js +14 -15
- package/src/rss/index.php +11 -8
- 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/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/editor.scss +9 -0
- package/src/video/tracks-editor.js +157 -139
- 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
|
@@ -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,MAAM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ACfC,QAAQ,EAAE,QAAQ;UAClBC,SAAS,EAAE,GAAInB,KAAK;QACrB;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEX,gBAAgB,CAAG,CAAC;EAEzB,IAAAiC,8BAAW,EACV,kDAAkD,EAChDvB,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;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":[]}
|
|
@@ -157,7 +157,7 @@ function CoverEdit({
|
|
|
157
157
|
// See issue #52835 for context.
|
|
158
158
|
const newDimRatio = originalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;
|
|
159
159
|
const newIsDark = (0, _colorUtils.compositeIsDark)(newDimRatio, newOverlayColor, averageBackgroundColor);
|
|
160
|
-
if (backgroundType === _shared.IMAGE_BACKGROUND_TYPE && mediaAttributes
|
|
160
|
+
if (backgroundType === _shared.IMAGE_BACKGROUND_TYPE && mediaAttributes?.id) {
|
|
161
161
|
const {
|
|
162
162
|
imageDefaultSize
|
|
163
163
|
} = getSettings();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_components","_compose","_blockEditor","_i18n","_data","_blob","_notices","_shared","_inspectorControls","_blockControls","_coverPlaceholder","_resizableCoverPopover","_colorUtils","_constants","_jsxRuntime","getInnerBlocksTemplate","attributes","align","placeholder","__","isTemporaryMedia","id","url","isBlobURL","CoverEdit","clientId","isSelected","overlayColor","setAttributes","setOverlayColor","toggleSelection","context","postId","postType","contentPosition","originalUrl","backgroundType","originalBackgroundType","useFeaturedImage","dimRatio","focalPoint","hasParallax","isDark","isRepeated","minHeight","minHeightUnit","alt","allowedBlocks","templateLock","tagName","TagName","isUserOverlayColor","sizeSlug","featuredImage","useEntityProp","getSettings","useSelect","blockEditorStore","__unstableMarkNextChangeAsNotPersistent","useDispatch","media","select","coreStore","getMedia","mediaUrl","source_url","useEffect","averageBackgroundColor","getMediaColor","newOverlayColor","color","newIsDark","compositeIsDark","replaceAll","IMAGE_BACKGROUND_TYPE","createErrorNotice","noticesStore","gradientClass","gradientValue","__experimentalUseGradient","onSelectMedia","newMedia","mediaAttributes","attributesFromMedia","isImage","type","media_type","includes","undefined","newDimRatio","imageDefaultSize","sizes","media_details","DEFAULT_MEDIA_SIZE_SLUG","onClearMedia","DEFAULT_OVERLAY_COLOR","DEFAULT_BACKGROUND_COLOR","onSetOverlayColor","onUpdateDimRatio","onUploadError","message","isUploadingMedia","isImageBackground","isVideoBackground","VIDEO_BACKGROUND_TYPE","blockEditingMode","useBlockEditingMode","hasNonContentControls","resizeListener","height","width","useResizeObserver","resizableBoxDimensions","useMemo","minHeightWithUnit","isImgElement","style","backgroundImage","backgroundPosition","mediaPosition","bgStyle","backgroundColor","mediaStyle","objectPosition","hasBackground","hasInnerBlocks","getBlock","innerBlocks","length","ref","useRef","blockProps","useBlockProps","fontSizes","useSettings","hasFontSizes","innerBlocksTemplate","fontSize","innerBlocksProps","useInnerBlocksProps","className","template","templateInsertUpdatesSelection","dropZoneElement","current","mediaElement","currentSettings","toggleUseFeaturedImage","newUseFeaturedImage","blockControls","jsx","default","inspectorControls","coverRef","updateDimRatio","resizableCoverProps","onResizeStart","onResize","value","onResizeStop","newMinHeight","showHandle","dimensions","aspectRatio","size","jsxs","Fragment","children","clsx","onError","ColorPalette","disableCustomColors","onChange","clearable","classes","isContentPositionCenter","getPositionClassName","showOverlay","Placeholder","withIllustration","src","role","autoPlay","muted","loop","dimRatioToClass","class","Spinner","disableMediaButtons","_default","exports","compose","withColors"],"sources":["@wordpress/block-library/src/cover/edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { Placeholder, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseSettings,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\talign: 'center',\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t\tsizeSlug,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl = media?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\tlet newOverlayColor = overlayColor.color;\n\t\t\tif ( ! isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tdimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Update the block only when the featured image changes.\n\t}, [ mediaUrl ] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t originalUrl?.replaceAll( '&', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tif ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes.id ) {\n\t\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t\t// Try to use the previous selected image size if it's available\n\t\t\t// otherwise try the default image size or fallback to full size.\n\t\t\tif (\n\t\t\t\tsizeSlug &&\n\t\t\t\t( newMedia?.sizes?.[ sizeSlug ] ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ] )\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = sizeSlug;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ sizeSlug ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ]?.source_url;\n\t\t\t} else if (\n\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ] ||\n\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = imageDefaultSize;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t\t\t\t?.source_url;\n\t\t\t} else {\n\t\t\t\tmediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG;\n\t\t\t}\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\n\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tsetAttributes( {\n\t\t\tisUserOverlayColor: true,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\toverlayColor.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\t// Check for fontSize support before we pass a fontSize attribute to the innerBlocks.\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\tconst hasFontSizes = fontSizes?.length > 0;\n\tconst innerBlocksTemplate = getInnerBlocksTemplate( {\n\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\t// Avoid template sync when the `templateLock` value is `all` or `contentOnly`.\n\t\t\t// See: https://github.com/WordPress/gutenberg/pull/45632\n\t\t\ttemplate: ! hasInnerBlocks ? innerBlocksTemplate : undefined,\n\t\t\ttemplateInsertUpdatesSelection: true,\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\tconst newOverlayColor = ! isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: overlayColor.color;\n\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio = dimRatio === 100 ? 50 : dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ isUploadingMedia && <Spinner /> }\n\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],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BAAU,EAAE;EAAErK,YAAY,EAAE;AAAmB,CAAE,CAAC,CACjD,CAAC,CAAEH,SAAU,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_components","_compose","_blockEditor","_i18n","_data","_blob","_notices","_shared","_inspectorControls","_blockControls","_coverPlaceholder","_resizableCoverPopover","_colorUtils","_constants","_jsxRuntime","getInnerBlocksTemplate","attributes","align","placeholder","__","isTemporaryMedia","id","url","isBlobURL","CoverEdit","clientId","isSelected","overlayColor","setAttributes","setOverlayColor","toggleSelection","context","postId","postType","contentPosition","originalUrl","backgroundType","originalBackgroundType","useFeaturedImage","dimRatio","focalPoint","hasParallax","isDark","isRepeated","minHeight","minHeightUnit","alt","allowedBlocks","templateLock","tagName","TagName","isUserOverlayColor","sizeSlug","featuredImage","useEntityProp","getSettings","useSelect","blockEditorStore","__unstableMarkNextChangeAsNotPersistent","useDispatch","media","select","coreStore","getMedia","mediaUrl","source_url","useEffect","averageBackgroundColor","getMediaColor","newOverlayColor","color","newIsDark","compositeIsDark","replaceAll","IMAGE_BACKGROUND_TYPE","createErrorNotice","noticesStore","gradientClass","gradientValue","__experimentalUseGradient","onSelectMedia","newMedia","mediaAttributes","attributesFromMedia","isImage","type","media_type","includes","undefined","newDimRatio","imageDefaultSize","sizes","media_details","DEFAULT_MEDIA_SIZE_SLUG","onClearMedia","DEFAULT_OVERLAY_COLOR","DEFAULT_BACKGROUND_COLOR","onSetOverlayColor","onUpdateDimRatio","onUploadError","message","isUploadingMedia","isImageBackground","isVideoBackground","VIDEO_BACKGROUND_TYPE","blockEditingMode","useBlockEditingMode","hasNonContentControls","resizeListener","height","width","useResizeObserver","resizableBoxDimensions","useMemo","minHeightWithUnit","isImgElement","style","backgroundImage","backgroundPosition","mediaPosition","bgStyle","backgroundColor","mediaStyle","objectPosition","hasBackground","hasInnerBlocks","getBlock","innerBlocks","length","ref","useRef","blockProps","useBlockProps","fontSizes","useSettings","hasFontSizes","innerBlocksTemplate","fontSize","innerBlocksProps","useInnerBlocksProps","className","template","templateInsertUpdatesSelection","dropZoneElement","current","mediaElement","currentSettings","toggleUseFeaturedImage","newUseFeaturedImage","blockControls","jsx","default","inspectorControls","coverRef","updateDimRatio","resizableCoverProps","onResizeStart","onResize","value","onResizeStop","newMinHeight","showHandle","dimensions","aspectRatio","size","jsxs","Fragment","children","clsx","onError","ColorPalette","disableCustomColors","onChange","clearable","classes","isContentPositionCenter","getPositionClassName","showOverlay","Placeholder","withIllustration","src","role","autoPlay","muted","loop","dimRatioToClass","class","Spinner","disableMediaButtons","_default","exports","compose","withColors"],"sources":["@wordpress/block-library/src/cover/edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { Placeholder, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseSettings,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\talign: 'center',\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t\tsizeSlug,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl = media?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\tlet newOverlayColor = overlayColor.color;\n\t\t\tif ( ! isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tdimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Update the block only when the featured image changes.\n\t}, [ mediaUrl ] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t originalUrl?.replaceAll( '&', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tif ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id ) {\n\t\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t\t// Try to use the previous selected image size if it's available\n\t\t\t// otherwise try the default image size or fallback to full size.\n\t\t\tif (\n\t\t\t\tsizeSlug &&\n\t\t\t\t( newMedia?.sizes?.[ sizeSlug ] ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ] )\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = sizeSlug;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ sizeSlug ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ]?.source_url;\n\t\t\t} else if (\n\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ] ||\n\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = imageDefaultSize;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t\t\t\t?.source_url;\n\t\t\t} else {\n\t\t\t\tmediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG;\n\t\t\t}\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\n\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tsetAttributes( {\n\t\t\tisUserOverlayColor: true,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\toverlayColor.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\t// Check for fontSize support before we pass a fontSize attribute to the innerBlocks.\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\tconst hasFontSizes = fontSizes?.length > 0;\n\tconst innerBlocksTemplate = getInnerBlocksTemplate( {\n\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\t// Avoid template sync when the `templateLock` value is `all` or `contentOnly`.\n\t\t\t// See: https://github.com/WordPress/gutenberg/pull/45632\n\t\t\ttemplate: ! hasInnerBlocks ? innerBlocksTemplate : undefined,\n\t\t\ttemplateInsertUpdatesSelection: true,\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\tconst newOverlayColor = ! isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: overlayColor.color;\n\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio = dimRatio === 100 ? 50 : dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ isUploadingMedia && <Spinner /> }\n\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAA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CAAE,CAAC,CACjD,CAAC,CAAEH,SAAU,CAAC","ignoreList":[]}
|
package/build/cover/index.js
CHANGED
|
@@ -175,21 +175,21 @@ const settings = exports.settings = {
|
|
|
175
175
|
attributes: {
|
|
176
176
|
customOverlayColor: '#065174',
|
|
177
177
|
dimRatio: 40,
|
|
178
|
-
url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
|
|
178
|
+
url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',
|
|
179
|
+
style: {
|
|
180
|
+
typography: {
|
|
181
|
+
fontSize: 48
|
|
182
|
+
},
|
|
183
|
+
color: {
|
|
184
|
+
text: 'white'
|
|
185
|
+
}
|
|
186
|
+
}
|
|
179
187
|
},
|
|
180
188
|
innerBlocks: [{
|
|
181
189
|
name: 'core/paragraph',
|
|
182
190
|
attributes: {
|
|
183
191
|
content: (0, _i18n.__)('<strong>Snow Patrol</strong>'),
|
|
184
|
-
align: 'center'
|
|
185
|
-
style: {
|
|
186
|
-
typography: {
|
|
187
|
-
fontSize: 48
|
|
188
|
-
},
|
|
189
|
-
color: {
|
|
190
|
-
text: 'white'
|
|
191
|
-
}
|
|
192
|
-
}
|
|
192
|
+
align: 'center'
|
|
193
193
|
}
|
|
194
194
|
}]
|
|
195
195
|
},
|
package/build/cover/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","_variations","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","url","type","useFeaturedImage","id","alt","hasParallax","isRepeated","dimRatio","overlayColor","customOverlayColor","isUserOverlayColor","backgroundType","focalPoint","minHeight","minHeightUnit","gradient","customGradient","contentPosition","isDark","allowedBlocks","templateLock","tagName","sizeSlug","usesContext","supports","anchor","align","html","shadow","spacing","padding","margin","blockGap","__experimentalDefaultControls","__experimentalBorder","color","radius","style","width","__experimentalDuotone","heading","text","background","__experimentalSkipSerialization","enableContrastChecker","dimensions","aspectRatio","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowJustification","interactivity","clientNavigation","editorStyle","settings","icon","example","innerBlocks","content","__","transforms","save","edit","deprecated","variations","init","initBlock"],"sources":["@wordpress/block-library/src/cover/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { cover 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';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcustomOverlayColor: '#065174',\n\t\t\tdimRatio: 40,\n\t\t\turl: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',\n\t\t
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","_variations","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","url","type","useFeaturedImage","id","alt","hasParallax","isRepeated","dimRatio","overlayColor","customOverlayColor","isUserOverlayColor","backgroundType","focalPoint","minHeight","minHeightUnit","gradient","customGradient","contentPosition","isDark","allowedBlocks","templateLock","tagName","sizeSlug","usesContext","supports","anchor","align","html","shadow","spacing","padding","margin","blockGap","__experimentalDefaultControls","__experimentalBorder","color","radius","style","width","__experimentalDuotone","heading","text","background","__experimentalSkipSerialization","enableContrastChecker","dimensions","aspectRatio","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowJustification","interactivity","clientNavigation","editorStyle","settings","icon","example","innerBlocks","content","__","transforms","save","edit","deprecated","variations","init","initBlock"],"sources":["@wordpress/block-library/src/cover/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { cover 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';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcustomOverlayColor: '#065174',\n\t\t\tdimRatio: 40,\n\t\t\turl: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',\n\t\t\tstyle: {\n\t\t\t\ttypography: {\n\t\t\t\t\tfontSize: 48,\n\t\t\t\t},\n\t\t\t\tcolor: {\n\t\t\t\t\ttext: 'white',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( '<strong>Snow Patrol</strong>' ),\n\t\t\t\t\talign: 'center',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tsave,\n\tedit,\n\tdeprecated,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,WAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,WAAA,GAAAL,sBAAA,CAAAH,OAAA;AAfA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAS,QAAA,GAAA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EJ,QAAQ;EAAEuE;AAAS,CAAE,CAAC;AAACtE,OAAA,CAAAiF,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/build/cover/shared.js
CHANGED
|
@@ -46,7 +46,7 @@ function dimRatioToClass(ratio) {
|
|
|
46
46
|
return ratio === 50 || ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
|
|
47
47
|
}
|
|
48
48
|
function attributesFromMedia(media) {
|
|
49
|
-
if (!media || !media.url) {
|
|
49
|
+
if (!media || !media.url && !media.src) {
|
|
50
50
|
return {
|
|
51
51
|
url: undefined,
|
|
52
52
|
id: undefined
|
|
@@ -61,19 +61,18 @@ function attributesFromMedia(media) {
|
|
|
61
61
|
if (media.media_type === IMAGE_BACKGROUND_TYPE) {
|
|
62
62
|
mediaType = IMAGE_BACKGROUND_TYPE;
|
|
63
63
|
} else {
|
|
64
|
-
//
|
|
64
|
+
// Only images and videos are accepted so if the media_type is not an image we can assume it is a video.
|
|
65
65
|
// Videos contain the media type of 'file' in the object returned from the rest api.
|
|
66
66
|
mediaType = VIDEO_BACKGROUND_TYPE;
|
|
67
67
|
}
|
|
68
|
-
} else {
|
|
69
68
|
// For media selections originated from existing files in the media library.
|
|
70
|
-
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
69
|
+
} else if (media.type && (media.type === IMAGE_BACKGROUND_TYPE || media.type === VIDEO_BACKGROUND_TYPE)) {
|
|
73
70
|
mediaType = media.type;
|
|
71
|
+
} else {
|
|
72
|
+
return;
|
|
74
73
|
}
|
|
75
74
|
return {
|
|
76
|
-
url: media.url,
|
|
75
|
+
url: media.url || media.src,
|
|
77
76
|
id: media.id,
|
|
78
77
|
alt: media?.alt,
|
|
79
78
|
backgroundType: mediaType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blob","require","POSITION_CLASSNAMES","center","IMAGE_BACKGROUND_TYPE","exports","VIDEO_BACKGROUND_TYPE","COVER_MIN_HEIGHT","COVER_MAX_HEIGHT","COVER_DEFAULT_HEIGHT","DEFAULT_FOCAL_POINT","x","y","ALLOWED_MEDIA_TYPES","mediaPosition","Math","round","dimRatioToClass","ratio","undefined","attributesFromMedia","media","url","id","isBlobURL","type","getBlobTypeByURL","mediaType","media_type","alt","backgroundType","hasParallax","isContentPositionCenter","contentPosition","getPositionClassName"],"sources":["@wordpress/block-library/src/cover/shared.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlobTypeByURL, isBlobURL } from '@wordpress/blob';\n\nconst POSITION_CLASSNAMES = {\n\t'top left': 'is-position-top-left',\n\t'top center': 'is-position-top-center',\n\t'top right': 'is-position-top-right',\n\t'center left': 'is-position-center-left',\n\t'center center': 'is-position-center-center',\n\tcenter: 'is-position-center-center',\n\t'center right': 'is-position-center-right',\n\t'bottom left': 'is-position-bottom-left',\n\t'bottom center': 'is-position-bottom-center',\n\t'bottom right': 'is-position-bottom-right',\n};\n\nexport const IMAGE_BACKGROUND_TYPE = 'image';\nexport const VIDEO_BACKGROUND_TYPE = 'video';\nexport const COVER_MIN_HEIGHT = 50;\nexport const COVER_MAX_HEIGHT = 1000;\nexport const COVER_DEFAULT_HEIGHT = 300;\nexport const DEFAULT_FOCAL_POINT = { x: 0.5, y: 0.5 };\nexport const ALLOWED_MEDIA_TYPES = [ 'image', 'video' ];\n\nexport function mediaPosition( { x, y } = DEFAULT_FOCAL_POINT ) {\n\treturn `${ Math.round( x * 100 ) }% ${ Math.round( y * 100 ) }%`;\n}\n\nexport function dimRatioToClass( ratio ) {\n\treturn ratio === 50 || ratio === undefined\n\t\t? null\n\t\t: 'has-background-dim-' + 10 * Math.round( ratio / 10 );\n}\n\nexport function attributesFromMedia( media ) {\n\tif ( ! media || ! media.url ) {\n\t\treturn {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t};\n\t}\n\n\tif ( isBlobURL( media.url ) ) {\n\t\tmedia.type = getBlobTypeByURL( media.url );\n\t}\n\n\tlet mediaType;\n\t// For media selections originated from a file upload.\n\tif ( media.media_type ) {\n\t\tif ( media.media_type === IMAGE_BACKGROUND_TYPE ) {\n\t\t\tmediaType = IMAGE_BACKGROUND_TYPE;\n\t\t} else {\n\t\t\t//
|
|
1
|
+
{"version":3,"names":["_blob","require","POSITION_CLASSNAMES","center","IMAGE_BACKGROUND_TYPE","exports","VIDEO_BACKGROUND_TYPE","COVER_MIN_HEIGHT","COVER_MAX_HEIGHT","COVER_DEFAULT_HEIGHT","DEFAULT_FOCAL_POINT","x","y","ALLOWED_MEDIA_TYPES","mediaPosition","Math","round","dimRatioToClass","ratio","undefined","attributesFromMedia","media","url","src","id","isBlobURL","type","getBlobTypeByURL","mediaType","media_type","alt","backgroundType","hasParallax","isContentPositionCenter","contentPosition","getPositionClassName"],"sources":["@wordpress/block-library/src/cover/shared.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlobTypeByURL, isBlobURL } from '@wordpress/blob';\n\nconst POSITION_CLASSNAMES = {\n\t'top left': 'is-position-top-left',\n\t'top center': 'is-position-top-center',\n\t'top right': 'is-position-top-right',\n\t'center left': 'is-position-center-left',\n\t'center center': 'is-position-center-center',\n\tcenter: 'is-position-center-center',\n\t'center right': 'is-position-center-right',\n\t'bottom left': 'is-position-bottom-left',\n\t'bottom center': 'is-position-bottom-center',\n\t'bottom right': 'is-position-bottom-right',\n};\n\nexport const IMAGE_BACKGROUND_TYPE = 'image';\nexport const VIDEO_BACKGROUND_TYPE = 'video';\nexport const COVER_MIN_HEIGHT = 50;\nexport const COVER_MAX_HEIGHT = 1000;\nexport const COVER_DEFAULT_HEIGHT = 300;\nexport const DEFAULT_FOCAL_POINT = { x: 0.5, y: 0.5 };\nexport const ALLOWED_MEDIA_TYPES = [ 'image', 'video' ];\n\nexport function mediaPosition( { x, y } = DEFAULT_FOCAL_POINT ) {\n\treturn `${ Math.round( x * 100 ) }% ${ Math.round( y * 100 ) }%`;\n}\n\nexport function dimRatioToClass( ratio ) {\n\treturn ratio === 50 || ratio === undefined\n\t\t? null\n\t\t: 'has-background-dim-' + 10 * Math.round( ratio / 10 );\n}\n\nexport function attributesFromMedia( media ) {\n\tif ( ! media || ( ! media.url && ! media.src ) ) {\n\t\treturn {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t};\n\t}\n\n\tif ( isBlobURL( media.url ) ) {\n\t\tmedia.type = getBlobTypeByURL( media.url );\n\t}\n\n\tlet mediaType;\n\t// For media selections originated from a file upload.\n\tif ( media.media_type ) {\n\t\tif ( media.media_type === IMAGE_BACKGROUND_TYPE ) {\n\t\t\tmediaType = IMAGE_BACKGROUND_TYPE;\n\t\t} else {\n\t\t\t// Only images and videos are accepted so if the media_type is not an image we can assume it is a video.\n\t\t\t// Videos contain the media type of 'file' in the object returned from the rest api.\n\t\t\tmediaType = VIDEO_BACKGROUND_TYPE;\n\t\t}\n\t\t// For media selections originated from existing files in the media library.\n\t} else if (\n\t\tmedia.type &&\n\t\t( media.type === IMAGE_BACKGROUND_TYPE ||\n\t\t\tmedia.type === VIDEO_BACKGROUND_TYPE )\n\t) {\n\t\tmediaType = media.type;\n\t} else {\n\t\treturn;\n\t}\n\n\treturn {\n\t\turl: media.url || media.src,\n\t\tid: media.id,\n\t\talt: media?.alt,\n\t\tbackgroundType: mediaType,\n\t\t...( mediaType === VIDEO_BACKGROUND_TYPE\n\t\t\t? { hasParallax: undefined }\n\t\t\t: {} ),\n\t};\n}\n\n/**\n * Checks of the contentPosition is the center (default) position.\n *\n * @param {string} contentPosition The current content position.\n * @return {boolean} Whether the contentPosition is center.\n */\nexport function isContentPositionCenter( contentPosition ) {\n\treturn (\n\t\t! contentPosition ||\n\t\tcontentPosition === 'center center' ||\n\t\tcontentPosition === 'center'\n\t);\n}\n\n/**\n * Retrieves the className for the current contentPosition.\n * The default position (center) will not have a className.\n *\n * @param {string} contentPosition The current content position.\n * @return {string} The className assigned to the contentPosition.\n */\nexport function getPositionClassName( contentPosition ) {\n\t/*\n\t * Only render a className if the contentPosition is not center (the default).\n\t */\n\tif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;AACA;AACA;AACA;AACO,SAASc,uBAAuBA,CAAEC,eAAe,EAAG;EAC1D,OACC,CAAEA,eAAe,IACjBA,eAAe,KAAK,eAAe,IACnCA,eAAe,KAAK,QAAQ;AAE9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAAED,eAAe,EAAG;EACvD;AACD;AACA;EACC,IAAKD,uBAAuB,CAAEC,eAAgB,CAAC,EAAG;IACjD,OAAO,EAAE;EACV;EAEA,OAAOhC,mBAAmB,CAAEgC,eAAe,CAAE;AAC9C","ignoreList":[]}
|
package/build/details/index.js
CHANGED
|
@@ -105,6 +105,25 @@ const settings = exports.settings = {
|
|
|
105
105
|
}
|
|
106
106
|
}]
|
|
107
107
|
},
|
|
108
|
+
__experimentalLabel(attributes, {
|
|
109
|
+
context
|
|
110
|
+
}) {
|
|
111
|
+
const {
|
|
112
|
+
summary
|
|
113
|
+
} = attributes;
|
|
114
|
+
const customName = attributes?.metadata?.name;
|
|
115
|
+
const hasSummary = summary?.trim().length > 0;
|
|
116
|
+
|
|
117
|
+
// In the list view, use the block's summary as the label.
|
|
118
|
+
// If the summary is empty, fall back to the default label.
|
|
119
|
+
if (context === 'list-view' && (customName || hasSummary)) {
|
|
120
|
+
return customName || summary;
|
|
121
|
+
}
|
|
122
|
+
if (context === 'accessibility') {
|
|
123
|
+
return !hasSummary ? (0, _i18n.__)('Details. Empty.') : (0, _i18n.sprintf)(/* translators: accessibility text; summary title. */
|
|
124
|
+
(0, _i18n.__)('Details. %s'), summary);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
108
127
|
save: _save.default,
|
|
109
128
|
edit: _edit.default,
|
|
110
129
|
transforms: _transforms.default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","showContent","type","summary","source","selector","supports","__experimentalOnEnter","align","anchor","color","gradients","link","__experimentalDefaultControls","background","text","__experimentalBorder","width","style","html","spacing","margin","padding","blockGap","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowEditing","interactivity","clientNavigation","editorStyle","settings","icon","example","innerBlocks","content","__","save","edit","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/details/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { details as icon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsummary: 'La Mancha',\n\t\t\tshowContent: true,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __(\n\t\t\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tsave,\n\tedit,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,WAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAA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AAC;EACDC,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;
|
|
1
|
+
{"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","showContent","type","summary","source","selector","supports","__experimentalOnEnter","align","anchor","color","gradients","link","__experimentalDefaultControls","background","text","__experimentalBorder","width","style","html","spacing","margin","padding","blockGap","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowEditing","interactivity","clientNavigation","editorStyle","settings","icon","example","innerBlocks","content","__","__experimentalLabel","context","customName","hasSummary","trim","length","sprintf","save","edit","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/details/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { details as icon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsummary: 'La Mancha',\n\t\t\tshowContent: true,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __(\n\t\t\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { summary } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\t\tconst hasSummary = summary?.trim().length > 0;\n\n\t\t// In the list view, use the block's summary as the label.\n\t\t// If the summary is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || hasSummary ) ) {\n\t\t\treturn customName || summary;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\treturn ! hasSummary\n\t\t\t\t? __( 'Details. Empty.' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text; summary title. */\n\t\t\t\t\t\t__( 'Details. %s' ),\n\t\t\t\t\t\tsummary\n\t\t\t\t );\n\t\t}\n\t},\n\tsave,\n\tedit,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,WAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,WAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAD,IAAA;MAAAE,MAAA;MAAAC,QAAA;IAAA;EAAA;EAAAC,QAAA;IAAAC,qBAAA;IAAAC,KAAA;IAAAC,MAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,oBAAA;MAAAN,KAAA;MAAAO,KAAA;MAAAC,KAAA;IAAA;IAAA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AAEE,UAAU,GAChB,IAAAJ,QAAE,EAAE,iBAAkB,CAAC,GACvB,IAAAO,aAAO,EACP;MACA,IAAAP,QAAE,EAAE,aAAc,CAAC,EACnBxC,OACA,CAAC;IACL;EACD,CAAC;EACDgD,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE7D,IAAI;EAAEJ,QAAQ;EAAEgD;AAAS,CAAE,CAAC;AAAC/C,OAAA,CAAA+D,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/build/file/edit.js
CHANGED
|
@@ -103,6 +103,7 @@ function FileEdit({
|
|
|
103
103
|
// This effect should only run on mount.
|
|
104
104
|
}, []);
|
|
105
105
|
function onSelectFile(newMedia) {
|
|
106
|
+
var _attributes$displayPr, _attributes$previewHe;
|
|
106
107
|
if (!newMedia || !newMedia.url) {
|
|
107
108
|
// Reset attributes.
|
|
108
109
|
setAttributes({
|
|
@@ -122,15 +123,18 @@ function FileEdit({
|
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
125
|
const isPdf = newMedia.url.endsWith('.pdf');
|
|
126
|
+
const pdfAttributes = {
|
|
127
|
+
displayPreview: isPdf ? (_attributes$displayPr = attributes.displayPreview) !== null && _attributes$displayPr !== void 0 ? _attributes$displayPr : true : undefined,
|
|
128
|
+
previewHeight: isPdf ? (_attributes$previewHe = attributes.previewHeight) !== null && _attributes$previewHe !== void 0 ? _attributes$previewHe : 600 : undefined
|
|
129
|
+
};
|
|
125
130
|
setAttributes({
|
|
126
131
|
href: newMedia.url,
|
|
127
132
|
fileName: newMedia.title,
|
|
128
133
|
textLinkHref: newMedia.url,
|
|
129
134
|
id: newMedia.id,
|
|
130
|
-
displayPreview: isPdf ? true : undefined,
|
|
131
|
-
previewHeight: isPdf ? 600 : undefined,
|
|
132
135
|
fileId: `wp-block-file--media-${clientId}`,
|
|
133
|
-
blob: undefined
|
|
136
|
+
blob: undefined,
|
|
137
|
+
...pdfAttributes
|
|
134
138
|
});
|
|
135
139
|
setTemporaryURL();
|
|
136
140
|
}
|
package/build/file/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blob","_components","_data","_blockEditor","_element","_compose","_i18n","_icons","_coreData","_notices","_inspector","_utils","_removeAnchorTag","_hooks","_jsxRuntime","MIN_PREVIEW_HEIGHT","exports","MAX_PREVIEW_HEIGHT","ClipboardToolbarButton","text","disabled","createNotice","useDispatch","noticesStore","ref","useCopyToClipboard","__","isDismissible","type","jsx","ToolbarButton","className","children","FileEdit","attributes","isSelected","setAttributes","clientId","id","fileName","href","textLinkHref","textLinkTarget","showDownloadButton","downloadButtonText","displayPreview","previewHeight","temporaryURL","setTemporaryURL","useState","blob","media","useSelect","select","undefined","coreStore","getMedia","createErrorNotice","toggleSelection","__unstableMarkNextChangeAsNotPersistent","blockEditorStore","useUploadMediaFromBlobURL","url","onChange","onSelectFile","onError","onUploadError","useEffect","RichText","isEmpty","_x","newMedia","fileId","isBlobURL","isPdf","endsWith","title","message","changeLinkDestinationOption","newHref","changeOpenInNewWindow","newValue","changeShowDownloadButton","changeDisplayPreview","handleOnResizeStop","event","direction","elt","delta","newHeight","parseInt","height","changePreviewHeight","Math","max","attachmentPage","link","blockProps","useBlockProps","clsx","getAnimateClassName","displayPreviewInEditor","browserSupportsPdfs","MediaPlaceholder","icon","BlockIcon","labels","instructions","onSelect","accept","jsxs","Fragment","default","hrefs","openInNewWindow","BlockControls","group","MediaReplaceFlow","mediaId","mediaURL","onReset","ResizableBox","size","minHeight","maxHeight","minWidth","grid","enable","top","right","bottom","left","topRight","bottomRight","bottomLeft","topLeft","onResizeStart","onResizeStop","showHandle","data","identifier","tagName","value","placeholder","withoutInteractiveFormatting","removeAnchorTag","__experimentalGetElementClassName","_default"],"sources":["@wordpress/block-library/src/file/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\t__unstableGetAnimateClassName as getAnimateClassName,\n\tResizableBox,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { __, _x } from '@wordpress/i18n';\nimport { file as icon } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport FileBlockInspector from './inspector';\nimport { browserSupportsPdfs } from './utils';\nimport removeAnchorTag from '../utils/remove-anchor-tag';\nimport { useUploadMediaFromBlobURL } from '../utils/hooks';\n\nexport const MIN_PREVIEW_HEIGHT = 200;\nexport const MAX_PREVIEW_HEIGHT = 2000;\n\nfunction ClipboardToolbarButton( { text, disabled } ) {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tcreateNotice( 'info', __( 'Copied URL to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tclassName=\"components-clipboard-toolbar-button\"\n\t\t\tref={ ref }\n\t\t\tdisabled={ disabled }\n\t\t>\n\t\t\t{ __( 'Copy URL' ) }\n\t\t</ToolbarButton>\n\t);\n}\n\nfunction FileEdit( { attributes, isSelected, setAttributes, clientId } ) {\n\tconst {\n\t\tid,\n\t\tfileName,\n\t\thref,\n\t\ttextLinkHref,\n\t\ttextLinkTarget,\n\t\tshowDownloadButton,\n\t\tdownloadButtonText,\n\t\tdisplayPreview,\n\t\tpreviewHeight,\n\t} = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst { media } = useSelect(\n\t\t( select ) => ( {\n\t\t\tmedia:\n\t\t\t\tid === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: select( coreStore ).getMedia( id ),\n\t\t} ),\n\t\t[ id ]\n\t);\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { toggleSelection, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tonChange: onSelectFile,\n\t\tonError: onUploadError,\n\t} );\n\n\t// Note: Handle setting a default value for `downloadButtonText` via HTML API\n\t// when it supports replacing text content for HTML tags.\n\tuseEffect( () => {\n\t\tif ( RichText.isEmpty( downloadButtonText ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tdownloadButtonText: _x( 'Download', 'button label' ),\n\t\t\t} );\n\t\t}\n\t\t// This effect should only run on mount.\n\t}, [] );\n\n\tfunction onSelectFile( newMedia ) {\n\t\tif ( ! newMedia || ! newMedia.url ) {\n\t\t\t// Reset attributes.\n\t\t\tsetAttributes( {\n\t\t\t\thref: undefined,\n\t\t\t\tfileName: undefined,\n\t\t\t\ttextLinkHref: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tfileId: undefined,\n\t\t\t\tdisplayPreview: undefined,\n\t\t\t\tpreviewHeight: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( newMedia.url ) ) {\n\t\t\tsetTemporaryURL( newMedia.url );\n\t\t\treturn;\n\t\t}\n\n\t\tconst isPdf = newMedia.url.endsWith( '.pdf' );\n\t\tsetAttributes( {\n\t\t\thref: newMedia.url,\n\t\t\tfileName: newMedia.title,\n\t\t\ttextLinkHref: newMedia.url,\n\t\t\tid: newMedia.id,\n\t\t\tdisplayPreview: isPdf ? true : undefined,\n\t\t\tpreviewHeight: isPdf ? 600 : undefined,\n\t\t\tfileId: `wp-block-file--media-${ clientId }`,\n\t\t\tblob: undefined,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tsetAttributes( { href: undefined } );\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\tfunction changeLinkDestinationOption( newHref ) {\n\t\t// Choose Media File or Attachment Page (when file is in Media Library).\n\t\tsetAttributes( { textLinkHref: newHref } );\n\t}\n\n\tfunction changeOpenInNewWindow( newValue ) {\n\t\tsetAttributes( {\n\t\t\ttextLinkTarget: newValue ? '_blank' : false,\n\t\t} );\n\t}\n\n\tfunction changeShowDownloadButton( newValue ) {\n\t\tsetAttributes( { showDownloadButton: newValue } );\n\t}\n\n\tfunction changeDisplayPreview( newValue ) {\n\t\tsetAttributes( { displayPreview: newValue } );\n\t}\n\n\tfunction handleOnResizeStop( event, direction, elt, delta ) {\n\t\ttoggleSelection( true );\n\n\t\tconst newHeight = parseInt( previewHeight + delta.height, 10 );\n\t\tsetAttributes( { previewHeight: newHeight } );\n\t}\n\n\tfunction changePreviewHeight( newValue ) {\n\t\tconst newHeight = Math.max(\n\t\t\tparseInt( newValue, 10 ),\n\t\t\tMIN_PREVIEW_HEIGHT\n\t\t);\n\t\tsetAttributes( { previewHeight: newHeight } );\n\t}\n\n\tconst attachmentPage = media && media.link;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx(\n\t\t\t!! temporaryURL && getAnimateClassName( { type: 'loading' } ),\n\t\t\t{\n\t\t\t\t'is-transient': !! temporaryURL,\n\t\t\t}\n\t\t),\n\t} );\n\n\tconst displayPreviewInEditor = browserSupportsPdfs() && displayPreview;\n\n\tif ( ! href && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tlabels={ {\n\t\t\t\t\t\ttitle: __( 'File' ),\n\t\t\t\t\t\tinstructions: __(\n\t\t\t\t\t\t\t'Drag and drop a file, upload, or choose from your library.'\n\t\t\t\t\t\t),\n\t\t\t\t\t} }\n\t\t\t\t\tonSelect={ onSelectFile }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\taccept=\"*\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FileBlockInspector\n\t\t\t\threfs={ {\n\t\t\t\t\thref: href || temporaryURL,\n\t\t\t\t\ttextLinkHref,\n\t\t\t\t\tattachmentPage,\n\t\t\t\t} }\n\t\t\t\t{ ...{\n\t\t\t\t\topenInNewWindow: !! textLinkTarget,\n\t\t\t\t\tshowDownloadButton,\n\t\t\t\t\tchangeLinkDestinationOption,\n\t\t\t\t\tchangeOpenInNewWindow,\n\t\t\t\t\tchangeShowDownloadButton,\n\t\t\t\t\tdisplayPreview,\n\t\t\t\t\tchangeDisplayPreview,\n\t\t\t\t\tpreviewHeight,\n\t\t\t\t\tchangePreviewHeight,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ href }\n\t\t\t\t\taccept=\"*\"\n\t\t\t\t\tonSelect={ onSelectFile }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tonReset={ () => onSelectFile( undefined ) }\n\t\t\t\t/>\n\t\t\t\t<ClipboardToolbarButton\n\t\t\t\t\ttext={ href }\n\t\t\t\t\tdisabled={ isBlobURL( href ) }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ displayPreviewInEditor && (\n\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\tsize={ { height: previewHeight } }\n\t\t\t\t\t\tminHeight={ MIN_PREVIEW_HEIGHT }\n\t\t\t\t\t\tmaxHeight={ MAX_PREVIEW_HEIGHT }\n\t\t\t\t\t\tminWidth=\"100%\"\n\t\t\t\t\t\tgrid={ [ 10, 10 ] }\n\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\tright: false,\n\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\tleft: false,\n\t\t\t\t\t\t\ttopRight: false,\n\t\t\t\t\t\t\tbottomRight: false,\n\t\t\t\t\t\t\tbottomLeft: false,\n\t\t\t\t\t\t\ttopLeft: false,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonResizeStart={ () => toggleSelection( false ) }\n\t\t\t\t\t\tonResizeStop={ handleOnResizeStop }\n\t\t\t\t\t\tshowHandle={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t<object\n\t\t\t\t\t\t\tclassName=\"wp-block-file__preview\"\n\t\t\t\t\t\t\tdata={ href }\n\t\t\t\t\t\t\ttype=\"application/pdf\"\n\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t'Embed of the selected PDF file.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isSelected && (\n\t\t\t\t\t\t\t<div className=\"wp-block-file__preview-overlay\" />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ResizableBox>\n\t\t\t\t) }\n\t\t\t\t<div className=\"wp-block-file__content-wrapper\">\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"fileName\"\n\t\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\t\tvalue={ fileName }\n\t\t\t\t\t\tplaceholder={ __( 'Write file name…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tonChange={ ( text ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tfileName: removeAnchorTag( text ),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thref={ textLinkHref }\n\t\t\t\t\t/>\n\t\t\t\t\t{ showDownloadButton && (\n\t\t\t\t\t\t<div className=\"wp-block-file__button-richtext-wrapper\">\n\t\t\t\t\t\t\t{ /* Using RichText here instead of PlainText so that it can be styled like a button. */ }\n\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\tidentifier=\"downloadButtonText\"\n\t\t\t\t\t\t\t\ttagName=\"div\" // Must be block-level or else cursor disappears.\n\t\t\t\t\t\t\t\taria-label={ __( 'Download button text' ) }\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t'wp-block-file__button',\n\t\t\t\t\t\t\t\t\t__experimentalGetElementClassName(\n\t\t\t\t\t\t\t\t\t\t'button'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ downloadButtonText }\n\t\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\t\tplaceholder={ __( 'Add text…' ) }\n\t\t\t\t\t\t\t\tonChange={ ( text ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tdownloadButtonText:\n\t\t\t\t\t\t\t\t\t\t\tremoveAnchorTag( text ),\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default FileEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAUA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IA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H,QAAE,EAAE,kBAAmB,CAAG;UACxCsH,4BAA4B;UAC5BjF,QAAQ,EAAK5C,IAAI,IAChBiB,aAAa,CAAE;YACdG,QAAQ,EAAE,IAAA0G,wBAAe,EAAE9H,IAAK;UACjC,CAAE,CACF;UACDqB,IAAI,EAAGC;QAAc,CACrB,CAAC,EACAE,kBAAkB,iBACnB,IAAA7B,WAAA,CAAAe,GAAA;UAAKE,SAAS,EAAC,wCAAwC;UAAAC,QAAA,eAEtD,IAAAlB,WAAA,CAAAe,GAAA,EAAC1B,YAAA,CAAAiE,QAAQ;YACRwE,UAAU,EAAC,oBAAoB;YAC/BC,OAAO,EAAC,KAAK,CAAC;YAAA;YACd,cAAa,IAAAnH,QAAE,EAAE,sBAAuB,CAAG;YAC3CK,SAAS,EAAG,IAAAoE,aAAI,EACf,uBAAuB,EACvB,IAAA+C,8CAAiC,EAChC,QACD,CACD,CAAG;YACHJ,KAAK,EAAGlG,kBAAoB;YAC5BoG,4BAA4B;YAC5BD,WAAW,EAAG,IAAArH,QAAE,EAAE,WAAY,CAAG;YACjCqC,QAAQ,EAAK5C,IAAI,IAChBiB,aAAa,CAAE;cACdQ,kBAAkB,EACjB,IAAAqG,wBAAe,EAAE9H,IAAK;YACxB,CAAE;UACF,CACD;QAAC,CACE,CACL;MAAA,CACG,CAAC;IAAA,CACF,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAgI,QAAA,GAAAnI,OAAA,CAAAgG,OAAA,GAEc/E,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blob","_components","_data","_blockEditor","_element","_compose","_i18n","_icons","_coreData","_notices","_inspector","_utils","_removeAnchorTag","_hooks","_jsxRuntime","MIN_PREVIEW_HEIGHT","exports","MAX_PREVIEW_HEIGHT","ClipboardToolbarButton","text","disabled","createNotice","useDispatch","noticesStore","ref","useCopyToClipboard","__","isDismissible","type","jsx","ToolbarButton","className","children","FileEdit","attributes","isSelected","setAttributes","clientId","id","fileName","href","textLinkHref","textLinkTarget","showDownloadButton","downloadButtonText","displayPreview","previewHeight","temporaryURL","setTemporaryURL","useState","blob","media","useSelect","select","undefined","coreStore","getMedia","createErrorNotice","toggleSelection","__unstableMarkNextChangeAsNotPersistent","blockEditorStore","useUploadMediaFromBlobURL","url","onChange","onSelectFile","onError","onUploadError","useEffect","RichText","isEmpty","_x","newMedia","_attributes$displayPr","_attributes$previewHe","fileId","isBlobURL","isPdf","endsWith","pdfAttributes","title","message","changeLinkDestinationOption","newHref","changeOpenInNewWindow","newValue","changeShowDownloadButton","changeDisplayPreview","handleOnResizeStop","event","direction","elt","delta","newHeight","parseInt","height","changePreviewHeight","Math","max","attachmentPage","link","blockProps","useBlockProps","clsx","getAnimateClassName","displayPreviewInEditor","browserSupportsPdfs","MediaPlaceholder","icon","BlockIcon","labels","instructions","onSelect","accept","jsxs","Fragment","default","hrefs","openInNewWindow","BlockControls","group","MediaReplaceFlow","mediaId","mediaURL","onReset","ResizableBox","size","minHeight","maxHeight","minWidth","grid","enable","top","right","bottom","left","topRight","bottomRight","bottomLeft","topLeft","onResizeStart","onResizeStop","showHandle","data","identifier","tagName","value","placeholder","withoutInteractiveFormatting","removeAnchorTag","__experimentalGetElementClassName","_default"],"sources":["@wordpress/block-library/src/file/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\t__unstableGetAnimateClassName as getAnimateClassName,\n\tResizableBox,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { __, _x } from '@wordpress/i18n';\nimport { file as icon } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport FileBlockInspector from './inspector';\nimport { browserSupportsPdfs } from './utils';\nimport removeAnchorTag from '../utils/remove-anchor-tag';\nimport { useUploadMediaFromBlobURL } from '../utils/hooks';\n\nexport const MIN_PREVIEW_HEIGHT = 200;\nexport const MAX_PREVIEW_HEIGHT = 2000;\n\nfunction ClipboardToolbarButton( { text, disabled } ) {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tcreateNotice( 'info', __( 'Copied URL to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tclassName=\"components-clipboard-toolbar-button\"\n\t\t\tref={ ref }\n\t\t\tdisabled={ disabled }\n\t\t>\n\t\t\t{ __( 'Copy URL' ) }\n\t\t</ToolbarButton>\n\t);\n}\n\nfunction FileEdit( { attributes, isSelected, setAttributes, clientId } ) {\n\tconst {\n\t\tid,\n\t\tfileName,\n\t\thref,\n\t\ttextLinkHref,\n\t\ttextLinkTarget,\n\t\tshowDownloadButton,\n\t\tdownloadButtonText,\n\t\tdisplayPreview,\n\t\tpreviewHeight,\n\t} = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst { media } = useSelect(\n\t\t( select ) => ( {\n\t\t\tmedia:\n\t\t\t\tid === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: select( coreStore ).getMedia( id ),\n\t\t} ),\n\t\t[ id ]\n\t);\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { toggleSelection, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tonChange: onSelectFile,\n\t\tonError: onUploadError,\n\t} );\n\n\t// Note: Handle setting a default value for `downloadButtonText` via HTML API\n\t// when it supports replacing text content for HTML tags.\n\tuseEffect( () => {\n\t\tif ( RichText.isEmpty( downloadButtonText ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tdownloadButtonText: _x( 'Download', 'button label' ),\n\t\t\t} );\n\t\t}\n\t\t// This effect should only run on mount.\n\t}, [] );\n\n\tfunction onSelectFile( newMedia ) {\n\t\tif ( ! newMedia || ! newMedia.url ) {\n\t\t\t// Reset attributes.\n\t\t\tsetAttributes( {\n\t\t\t\thref: undefined,\n\t\t\t\tfileName: undefined,\n\t\t\t\ttextLinkHref: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tfileId: undefined,\n\t\t\t\tdisplayPreview: undefined,\n\t\t\t\tpreviewHeight: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( newMedia.url ) ) {\n\t\t\tsetTemporaryURL( newMedia.url );\n\t\t\treturn;\n\t\t}\n\n\t\tconst isPdf = newMedia.url.endsWith( '.pdf' );\n\t\tconst pdfAttributes = {\n\t\t\tdisplayPreview: isPdf\n\t\t\t\t? attributes.displayPreview ?? true\n\t\t\t\t: undefined,\n\t\t\tpreviewHeight: isPdf ? attributes.previewHeight ?? 600 : undefined,\n\t\t};\n\n\t\tsetAttributes( {\n\t\t\thref: newMedia.url,\n\t\t\tfileName: newMedia.title,\n\t\t\ttextLinkHref: newMedia.url,\n\t\t\tid: newMedia.id,\n\t\t\tfileId: `wp-block-file--media-${ clientId }`,\n\t\t\tblob: undefined,\n\t\t\t...pdfAttributes,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tsetAttributes( { href: undefined } );\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\tfunction changeLinkDestinationOption( newHref ) {\n\t\t// Choose Media File or Attachment Page (when file is in Media Library).\n\t\tsetAttributes( { textLinkHref: newHref } );\n\t}\n\n\tfunction changeOpenInNewWindow( newValue ) {\n\t\tsetAttributes( {\n\t\t\ttextLinkTarget: newValue ? '_blank' : false,\n\t\t} );\n\t}\n\n\tfunction changeShowDownloadButton( newValue ) {\n\t\tsetAttributes( { showDownloadButton: newValue } );\n\t}\n\n\tfunction changeDisplayPreview( newValue ) {\n\t\tsetAttributes( { displayPreview: newValue } );\n\t}\n\n\tfunction handleOnResizeStop( event, direction, elt, delta ) {\n\t\ttoggleSelection( true );\n\n\t\tconst newHeight = parseInt( previewHeight + delta.height, 10 );\n\t\tsetAttributes( { previewHeight: newHeight } );\n\t}\n\n\tfunction changePreviewHeight( newValue ) {\n\t\tconst newHeight = Math.max(\n\t\t\tparseInt( newValue, 10 ),\n\t\t\tMIN_PREVIEW_HEIGHT\n\t\t);\n\t\tsetAttributes( { previewHeight: newHeight } );\n\t}\n\n\tconst attachmentPage = media && media.link;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx(\n\t\t\t!! temporaryURL && getAnimateClassName( { type: 'loading' } ),\n\t\t\t{\n\t\t\t\t'is-transient': !! temporaryURL,\n\t\t\t}\n\t\t),\n\t} );\n\n\tconst displayPreviewInEditor = browserSupportsPdfs() && displayPreview;\n\n\tif ( ! href && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tlabels={ {\n\t\t\t\t\t\ttitle: __( 'File' ),\n\t\t\t\t\t\tinstructions: __(\n\t\t\t\t\t\t\t'Drag and drop a file, upload, or choose from your library.'\n\t\t\t\t\t\t),\n\t\t\t\t\t} }\n\t\t\t\t\tonSelect={ onSelectFile }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\taccept=\"*\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FileBlockInspector\n\t\t\t\threfs={ {\n\t\t\t\t\thref: href || temporaryURL,\n\t\t\t\t\ttextLinkHref,\n\t\t\t\t\tattachmentPage,\n\t\t\t\t} }\n\t\t\t\t{ ...{\n\t\t\t\t\topenInNewWindow: !! textLinkTarget,\n\t\t\t\t\tshowDownloadButton,\n\t\t\t\t\tchangeLinkDestinationOption,\n\t\t\t\t\tchangeOpenInNewWindow,\n\t\t\t\t\tchangeShowDownloadButton,\n\t\t\t\t\tdisplayPreview,\n\t\t\t\t\tchangeDisplayPreview,\n\t\t\t\t\tpreviewHeight,\n\t\t\t\t\tchangePreviewHeight,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ href }\n\t\t\t\t\taccept=\"*\"\n\t\t\t\t\tonSelect={ onSelectFile }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tonReset={ () => onSelectFile( undefined ) }\n\t\t\t\t/>\n\t\t\t\t<ClipboardToolbarButton\n\t\t\t\t\ttext={ href }\n\t\t\t\t\tdisabled={ isBlobURL( href ) }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ displayPreviewInEditor && (\n\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\tsize={ { height: previewHeight } }\n\t\t\t\t\t\tminHeight={ MIN_PREVIEW_HEIGHT }\n\t\t\t\t\t\tmaxHeight={ MAX_PREVIEW_HEIGHT }\n\t\t\t\t\t\tminWidth=\"100%\"\n\t\t\t\t\t\tgrid={ [ 10, 10 ] }\n\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\tright: false,\n\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\tleft: false,\n\t\t\t\t\t\t\ttopRight: false,\n\t\t\t\t\t\t\tbottomRight: false,\n\t\t\t\t\t\t\tbottomLeft: false,\n\t\t\t\t\t\t\ttopLeft: false,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonResizeStart={ () => toggleSelection( false ) }\n\t\t\t\t\t\tonResizeStop={ handleOnResizeStop }\n\t\t\t\t\t\tshowHandle={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t<object\n\t\t\t\t\t\t\tclassName=\"wp-block-file__preview\"\n\t\t\t\t\t\t\tdata={ href }\n\t\t\t\t\t\t\ttype=\"application/pdf\"\n\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t'Embed of the selected PDF file.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isSelected && (\n\t\t\t\t\t\t\t<div className=\"wp-block-file__preview-overlay\" />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ResizableBox>\n\t\t\t\t) }\n\t\t\t\t<div className=\"wp-block-file__content-wrapper\">\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"fileName\"\n\t\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\t\tvalue={ fileName }\n\t\t\t\t\t\tplaceholder={ __( 'Write file name…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tonChange={ ( text ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tfileName: removeAnchorTag( text ),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thref={ textLinkHref }\n\t\t\t\t\t/>\n\t\t\t\t\t{ showDownloadButton && (\n\t\t\t\t\t\t<div className=\"wp-block-file__button-richtext-wrapper\">\n\t\t\t\t\t\t\t{ /* Using RichText here instead of PlainText so that it can be styled like a button. */ }\n\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\tidentifier=\"downloadButtonText\"\n\t\t\t\t\t\t\t\ttagName=\"div\" // Must be block-level or else cursor disappears.\n\t\t\t\t\t\t\t\taria-label={ __( 'Download button text' ) }\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t'wp-block-file__button',\n\t\t\t\t\t\t\t\t\t__experimentalGetElementClassName(\n\t\t\t\t\t\t\t\t\t\t'button'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ downloadButtonText }\n\t\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\t\tplaceholder={ __( 'Add text…' ) }\n\t\t\t\t\t\t\t\tonChange={ ( text ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tdownloadButtonText:\n\t\t\t\t\t\t\t\t\t\t\tremoveAnchorTag( text ),\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default FileEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAUA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,gBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAA2D,IAAAe,WAAA,GAAAf,OAAA;AAt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