@wordpress/block-library 8.21.1-next.f8d8eceb.0 → 8.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/block/edit.js +6 -5
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +57 -2
- package/build/button/edit.js.map +1 -1
- package/build/code/transforms.js +20 -7
- package/build/code/transforms.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +1 -0
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +1 -0
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/details/edit.js +1 -2
- package/build/details/edit.js.map +1 -1
- package/build/form/edit.js +1 -1
- package/build/form/edit.js.map +1 -1
- package/build/form/index.js +25 -5
- package/build/form/index.js.map +1 -1
- package/build/form-input/index.js +1 -1
- package/build/form-input/index.js.map +1 -1
- package/build/form-submission-notification/index.js +1 -1
- package/build/form-submission-notification/index.js.map +1 -1
- package/build/form-submit-button/edit.js +2 -1
- package/build/form-submit-button/edit.js.map +1 -1
- package/build/form-submit-button/index.js +1 -1
- package/build/form-submit-button/index.js.map +1 -1
- package/build/gallery/gap-styles.js +12 -7
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/group/edit.js +1 -0
- package/build/group/edit.js.map +1 -1
- package/build/html/transforms.js +7 -2
- package/build/html/transforms.js.map +1 -1
- package/build/image/deprecated.js +8 -0
- package/build/image/deprecated.js.map +1 -1
- package/build/image/view.js +10 -7
- package/build/image/view.js.map +1 -1
- package/build/missing/index.js +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +1 -1
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +2 -1
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/pattern/edit.js +1 -1
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js +0 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +21 -6
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-template/edit.js +2 -8
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -1
- package/build/post-terms/edit.js +2 -4
- package/build/post-terms/edit.js.map +1 -1
- package/build/preformatted/transforms.js +1 -4
- package/build/preformatted/transforms.js.map +1 -1
- package/build/query/edit/query-content.js +1 -0
- package/build/query/edit/query-content.js.map +1 -1
- package/build/quote/index.js +6 -0
- package/build/quote/index.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +1 -0
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +3 -7
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/index.js +6 -2
- package/build/template-part/index.js.map +1 -1
- package/build/template-part/variations.js +5 -1
- package/build/template-part/variations.js.map +1 -1
- package/build-module/block/edit.js +6 -5
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +61 -6
- package/build-module/button/edit.js.map +1 -1
- package/build-module/code/transforms.js +20 -7
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +1 -0
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +1 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/details/edit.js +1 -2
- package/build-module/details/edit.js.map +1 -1
- package/build-module/form/edit.js +1 -1
- package/build-module/form/edit.js.map +1 -1
- package/build-module/form/index.js +29 -5
- package/build-module/form/index.js.map +1 -1
- package/build-module/form-input/index.js +1 -1
- package/build-module/form-input/index.js.map +1 -1
- package/build-module/form-submission-notification/index.js +1 -1
- package/build-module/form-submission-notification/index.js.map +1 -1
- package/build-module/form-submit-button/edit.js +2 -1
- package/build-module/form-submit-button/edit.js.map +1 -1
- package/build-module/form-submit-button/index.js +1 -1
- package/build-module/form-submit-button/index.js.map +1 -1
- package/build-module/gallery/gap-styles.js +13 -8
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/group/edit.js +1 -0
- package/build-module/group/edit.js.map +1 -1
- package/build-module/html/transforms.js +7 -2
- package/build-module/html/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +8 -0
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/view.js +10 -7
- package/build-module/image/view.js.map +1 -1
- package/build-module/missing/index.js +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +2 -1
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/navigation-link/edit.js +2 -2
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/pattern/edit.js +1 -1
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-author/edit.js +0 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +21 -6
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-template/edit.js +2 -8
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -1
- package/build-module/post-terms/edit.js +2 -4
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/preformatted/transforms.js +1 -4
- package/build-module/preformatted/transforms.js.map +1 -1
- package/build-module/query/edit/query-content.js +1 -0
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/quote/index.js +6 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +1 -0
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +5 -9
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/index.js +6 -2
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/template-part/variations.js +5 -1
- package/build-module/template-part/variations.js.map +1 -1
- package/build-style/editor-rtl.css +12 -0
- package/build-style/editor.css +12 -0
- package/build-style/image/editor-rtl.css +3 -0
- package/build-style/image/editor.css +3 -0
- package/build-style/image/style-rtl.css +19 -13
- package/build-style/image/style.css +19 -13
- package/build-style/post-featured-image/editor-rtl.css +9 -0
- package/build-style/post-featured-image/editor.css +9 -0
- package/build-style/quote/style-rtl.css +3 -0
- package/build-style/quote/style.css +3 -0
- package/build-style/read-more/style-rtl.css +2 -2
- package/build-style/read-more/style.css +2 -2
- package/build-style/style-rtl.css +24 -15
- package/build-style/style.css +24 -15
- package/package.json +32 -32
- package/src/block/edit.js +3 -2
- package/src/button/edit.js +70 -4
- package/src/code/transforms.js +14 -8
- package/src/comments/edit/comments-inspector-controls.js +1 -0
- package/src/cover/edit/inspector-controls.js +1 -0
- package/src/details/edit.js +0 -1
- package/src/form/edit.js +2 -0
- package/src/form/index.js +38 -1
- package/src/form-input/block.json +1 -1
- package/src/form-submission-notification/block.json +1 -1
- package/src/form-submit-button/block.json +1 -1
- package/src/form-submit-button/edit.js +1 -0
- package/src/gallery/gap-styles.js +10 -9
- package/src/group/edit.js +1 -0
- package/src/html/transforms.js +5 -2
- package/src/image/deprecated.js +8 -0
- package/src/image/editor.scss +7 -0
- package/src/image/index.php +3 -4
- package/src/image/style.scss +18 -13
- package/src/image/view.js +24 -11
- package/src/missing/block.json +1 -1
- package/src/navigation/edit/overlay-menu-preview.js +1 -1
- package/src/navigation/index.php +37 -402
- package/src/navigation/use-template-part-area-label.js +4 -2
- package/src/navigation-link/edit.js +2 -2
- package/src/navigation-link/index.php +57 -0
- package/src/paragraph/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/paragraph/test/transforms.native.js +1 -0
- package/src/pattern/edit.js +2 -1
- package/src/pattern/index.php +6 -1
- package/src/post-author/edit.js +0 -1
- package/src/post-featured-image/edit.js +38 -5
- package/src/post-featured-image/editor.scss +19 -0
- package/src/post-template/block.json +0 -1
- package/src/post-template/edit.js +1 -5
- package/src/post-terms/edit.js +2 -4
- package/src/preformatted/transforms.js +1 -4
- package/src/query/edit/query-content.js +1 -0
- package/src/query/index.php +6 -2
- package/src/quote/block.json +6 -0
- package/src/quote/style.scss +4 -0
- package/src/read-more/style.scss +1 -1
- package/src/template-part/edit/advanced-controls.js +1 -0
- package/src/template-part/edit/index.js +7 -14
- package/src/template-part/index.js +4 -3
- package/src/template-part/index.php +4 -4
- package/src/template-part/variations.js +4 -2
package/CHANGELOG.md
CHANGED
package/build/block/edit.js
CHANGED
|
@@ -25,6 +25,9 @@ var _lockUnlock = require("../lock-unlock");
|
|
|
25
25
|
* Internal dependencies
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
+
const {
|
|
29
|
+
useLayoutClasses
|
|
30
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
28
31
|
const fullAlignments = ['full', 'wide', 'left', 'right'];
|
|
29
32
|
const useInferredLayout = (blocks, parentLayout) => {
|
|
30
33
|
const initialInferredAlignmentRef = (0, _element.useRef)();
|
|
@@ -57,9 +60,6 @@ function ReusableBlockEdit({
|
|
|
57
60
|
},
|
|
58
61
|
__unstableParentLayout: parentLayout
|
|
59
62
|
}) {
|
|
60
|
-
const {
|
|
61
|
-
useLayoutClasses
|
|
62
|
-
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
63
63
|
const hasAlreadyRendered = (0, _blockEditor.__experimentalUseHasRecursion)(ref);
|
|
64
64
|
const {
|
|
65
65
|
record,
|
|
@@ -107,10 +107,11 @@ function ReusableBlockEdit({
|
|
|
107
107
|
return (0, _react.createElement)(_blockEditor.__experimentalRecursionProvider, {
|
|
108
108
|
uniqueId: ref
|
|
109
109
|
}, (0, _react.createElement)(_blockEditor.InspectorControls, null, (0, _react.createElement)(_components.PanelBody, null, (0, _react.createElement)(_components.TextControl, {
|
|
110
|
-
__nextHasNoMarginBottom: true,
|
|
111
110
|
label: (0, _i18n.__)('Name'),
|
|
112
111
|
value: title,
|
|
113
|
-
onChange: setTitle
|
|
112
|
+
onChange: setTitle,
|
|
113
|
+
__nextHasNoMarginBottom: true,
|
|
114
|
+
__next40pxDefaultSize: true
|
|
114
115
|
}))), (0, _react.createElement)("div", {
|
|
115
116
|
...innerBlocksProps
|
|
116
117
|
}));
|
package/build/block/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_coreData","_components","_i18n","_blockEditor","_element","_lockUnlock","fullAlignments","useInferredLayout","blocks","parentLayout","initialInferredAlignmentRef","useRef","useMemo","length","alignment","current","undefined","isConstrained","type","hasFullAlignment","some","block","includes","attributes","align","layout","ReusableBlockEdit","name","ref","__unstableParentLayout","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_coreData","_components","_i18n","_blockEditor","_element","_lockUnlock","useLayoutClasses","unlock","blockEditorPrivateApis","fullAlignments","useInferredLayout","blocks","parentLayout","initialInferredAlignmentRef","useRef","useMemo","length","alignment","current","undefined","isConstrained","type","hasFullAlignment","some","block","includes","attributes","align","layout","ReusableBlockEdit","name","ref","__unstableParentLayout","hasAlreadyRendered","useHasRecursion","record","hasResolved","useEntityRecord","isMissing","onInput","onChange","useEntityBlockEditor","id","title","setTitle","useEntityProp","layoutClasses","blockProps","useBlockProps","className","classnames","innerBlocksProps","useInnerBlocksProps","value","renderAppender","InnerBlocks","ButtonBlockAppender","_react","createElement","Warning","__","Placeholder","Spinner","__experimentalRecursionProvider","uniqueId","InspectorControls","PanelBody","TextControl","label","__nextHasNoMarginBottom","__next40pxDefaultSize"],"sources":["@wordpress/block-library/src/block/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseEntityBlockEditor,\n\tuseEntityProp,\n\tuseEntityRecord,\n} from '@wordpress/core-data';\nimport {\n\tPlaceholder,\n\tSpinner,\n\tTextControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseInnerBlocksProps,\n\t__experimentalRecursionProvider as RecursionProvider,\n\t__experimentalUseHasRecursion as useHasRecursion,\n\tInnerBlocks,\n\tInspectorControls,\n\tuseBlockProps,\n\tWarning,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useRef, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { useLayoutClasses } = unlock( blockEditorPrivateApis );\nconst fullAlignments = [ 'full', 'wide', 'left', 'right' ];\n\nconst useInferredLayout = ( blocks, parentLayout ) => {\n\tconst initialInferredAlignmentRef = useRef();\n\n\treturn useMemo( () => {\n\t\t// Exit early if the pattern's blocks haven't loaded yet.\n\t\tif ( ! blocks?.length ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tlet alignment = initialInferredAlignmentRef.current;\n\n\t\t// Only track the initial alignment so that temporarily removed\n\t\t// alignments can be reapplied.\n\t\tif ( alignment === undefined ) {\n\t\t\tconst isConstrained = parentLayout?.type === 'constrained';\n\t\t\tconst hasFullAlignment = blocks.some( ( block ) =>\n\t\t\t\tfullAlignments.includes( block.attributes.align )\n\t\t\t);\n\n\t\t\talignment = isConstrained && hasFullAlignment ? 'full' : null;\n\t\t\tinitialInferredAlignmentRef.current = alignment;\n\t\t}\n\n\t\tconst layout = alignment ? parentLayout : undefined;\n\n\t\treturn { alignment, layout };\n\t}, [ blocks, parentLayout ] );\n};\n\nexport default function ReusableBlockEdit( {\n\tname,\n\tattributes: { ref },\n\t__unstableParentLayout: parentLayout,\n} ) {\n\tconst hasAlreadyRendered = useHasRecursion( ref );\n\tconst { record, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'wp_block',\n\t\tref\n\t);\n\tconst isMissing = hasResolved && ! record;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\t'wp_block',\n\t\t{ id: ref }\n\t);\n\n\tconst [ title, setTitle ] = useEntityProp(\n\t\t'postType',\n\t\t'wp_block',\n\t\t'title',\n\t\tref\n\t);\n\n\tconst { alignment, layout } = useInferredLayout( blocks, parentLayout );\n\tconst layoutClasses = useLayoutClasses( { layout }, name );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames(\n\t\t\t'block-library-block__reusable-block-container',\n\t\t\tlayout && layoutClasses,\n\t\t\t{ [ `align${ alignment }` ]: alignment }\n\t\t),\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tvalue: blocks,\n\t\tlayout,\n\t\tonInput,\n\t\tonChange,\n\t\trenderAppender: blocks?.length\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tif ( hasAlreadyRendered ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( isMissing ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Block has been deleted or is unavailable.' ) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( ! hasResolved ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Placeholder>\n\t\t\t\t\t<Spinner />\n\t\t\t\t</Placeholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<RecursionProvider uniqueId={ ref }>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</RecursionPro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,6 +17,7 @@ var _keycodes = require("@wordpress/keycodes");
|
|
|
17
17
|
var _icons = require("@wordpress/icons");
|
|
18
18
|
var _blocks = require("@wordpress/blocks");
|
|
19
19
|
var _compose = require("@wordpress/compose");
|
|
20
|
+
var _data = require("@wordpress/data");
|
|
20
21
|
/**
|
|
21
22
|
* External dependencies
|
|
22
23
|
*/
|
|
@@ -33,6 +34,54 @@ const LINK_SETTINGS = [..._blockEditor.__experimentalLinkControl.DEFAULT_LINK_SE
|
|
|
33
34
|
id: 'nofollow',
|
|
34
35
|
title: (0, _i18n.__)('Mark as nofollow')
|
|
35
36
|
}];
|
|
37
|
+
function useEnter(props) {
|
|
38
|
+
const {
|
|
39
|
+
replaceBlocks,
|
|
40
|
+
selectionChange
|
|
41
|
+
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
42
|
+
const {
|
|
43
|
+
getBlock,
|
|
44
|
+
getBlockRootClientId,
|
|
45
|
+
getBlockIndex
|
|
46
|
+
} = (0, _data.useSelect)(_blockEditor.store);
|
|
47
|
+
const propsRef = (0, _element.useRef)(props);
|
|
48
|
+
propsRef.current = props;
|
|
49
|
+
return (0, _compose.useRefEffect)(element => {
|
|
50
|
+
function onKeyDown(event) {
|
|
51
|
+
if (event.defaultPrevented || event.keyCode !== _keycodes.ENTER) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const {
|
|
55
|
+
content,
|
|
56
|
+
clientId
|
|
57
|
+
} = propsRef.current;
|
|
58
|
+
if (content.length) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
const topParentListBlock = getBlock(getBlockRootClientId(clientId));
|
|
63
|
+
const blockIndex = getBlockIndex(clientId);
|
|
64
|
+
const head = (0, _blocks.cloneBlock)({
|
|
65
|
+
...topParentListBlock,
|
|
66
|
+
innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex)
|
|
67
|
+
});
|
|
68
|
+
const middle = (0, _blocks.createBlock)((0, _blocks.getDefaultBlockName)());
|
|
69
|
+
const after = topParentListBlock.innerBlocks.slice(blockIndex + 1);
|
|
70
|
+
const tail = after.length ? [(0, _blocks.cloneBlock)({
|
|
71
|
+
...topParentListBlock,
|
|
72
|
+
innerBlocks: after
|
|
73
|
+
})] : [];
|
|
74
|
+
replaceBlocks(topParentListBlock.clientId, [head, middle, ...tail], 1);
|
|
75
|
+
// We manually change the selection here because we are replacing
|
|
76
|
+
// a different block than the selected one.
|
|
77
|
+
selectionChange(middle.clientId);
|
|
78
|
+
}
|
|
79
|
+
element.addEventListener('keydown', onKeyDown);
|
|
80
|
+
return () => {
|
|
81
|
+
element.removeEventListener('keydown', onKeyDown);
|
|
82
|
+
};
|
|
83
|
+
}, []);
|
|
84
|
+
}
|
|
36
85
|
function WidthPanel({
|
|
37
86
|
selectedWidth,
|
|
38
87
|
setAttributes
|
|
@@ -66,7 +115,8 @@ function ButtonEdit(props) {
|
|
|
66
115
|
className,
|
|
67
116
|
isSelected,
|
|
68
117
|
onReplace,
|
|
69
|
-
mergeBlocks
|
|
118
|
+
mergeBlocks,
|
|
119
|
+
clientId
|
|
70
120
|
} = props;
|
|
71
121
|
const {
|
|
72
122
|
tagName,
|
|
@@ -137,6 +187,11 @@ function ButtonEdit(props) {
|
|
|
137
187
|
opensInNewTab,
|
|
138
188
|
nofollow
|
|
139
189
|
}), [url, opensInNewTab, nofollow]);
|
|
190
|
+
const useEnterRef = useEnter({
|
|
191
|
+
content: text,
|
|
192
|
+
clientId
|
|
193
|
+
});
|
|
194
|
+
const mergedRef = (0, _compose.useMergeRefs)([useEnterRef, richTextRef]);
|
|
140
195
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("div", {
|
|
141
196
|
...blockProps,
|
|
142
197
|
className: (0, _classnames.default)(blockProps.className, {
|
|
@@ -144,7 +199,7 @@ function ButtonEdit(props) {
|
|
|
144
199
|
[`has-custom-font-size`]: blockProps.style.fontSize
|
|
145
200
|
})
|
|
146
201
|
}, (0, _react.createElement)(_blockEditor.RichText, {
|
|
147
|
-
ref:
|
|
202
|
+
ref: mergedRef,
|
|
148
203
|
"aria-label": (0, _i18n.__)('Button text'),
|
|
149
204
|
placeholder: placeholder || (0, _i18n.__)('Add text…'),
|
|
150
205
|
value: text,
|
package/build/button/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_constants","_getUpdatedLinkAttributes","_i18n","_element","_components","_blockEditor","_keycodes","_icons","_blocks","_compose","LINK_SETTINGS","LinkControl","DEFAULT_LINK_SETTINGS","id","title","__","WidthPanel","selectedWidth","setAttributes","handleChange","newWidth","width","undefined","_react","createElement","PanelBody","ButtonGroup","map","widthValue","Button","key","size","variant","onClick","ButtonEdit","props","attributes","className","isSelected","onReplace","mergeBlocks","tagName","textAlign","linkTarget","placeholder","rel","style","text","url","TagName","setButtonText","newText","replace","onKeyDown","event","isKeyboardEvent","primary","startEditing","primaryShift","unlink","richTextRef","current","focus","popoverAnchor","setPopoverAnchor","useState","borderProps","useBorderProps","colorProps","useColorProps","spacingProps","useSpacingProps","ref","useRef","blockProps","useBlockProps","useMergeRefs","isEditingURL","setIsEditingURL","isURLSet","opensInNewTab","NEW_TAB_TARGET","nofollow","includes","NOFOLLOW_REL","isLinkTag","preventDefault","useEffect","linkValue","useMemo","Fragment","classnames","fontSize","RichText","value","onChange","withoutInteractiveFormatting","border","radius","__experimentalGetElementClassName","onSplit","createBlock","onMerge","identifier","BlockControls","group","AlignmentControl","nextAlign","ToolbarButton","name","icon","link","shortcut","displayShortcut","linkOff","isActive","Popover","placement","onClose","anchor","focusOnMount","__unstableSlotName","shift","__experimentalLinkControl","newURL","newOpensInNewTab","newNofollow","getUpdatedLinkAttributes","onRemove","forceIsEditingLink","settings","InspectorControls","TextControl","__nextHasNoMarginBottom","label","newRel","_default","exports","default"],"sources":["@wordpress/block-library/src/button/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';\nimport { getUpdatedLinkAttributes } from './get-updated-link-attributes';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useState, useRef, useMemo } from '@wordpress/element';\nimport {\n\tButton,\n\tButtonGroup,\n\tPanelBody,\n\tTextControl,\n\tToolbarButton,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalGetSpacingClassesAndStyles as useSpacingProps,\n\t__experimentalLinkControl as LinkControl,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { link, linkOff } from '@wordpress/icons';\nimport { createBlock } from '@wordpress/blocks';\nimport { useMergeRefs } from '@wordpress/compose';\n\nconst LINK_SETTINGS = [\n\t...LinkControl.DEFAULT_LINK_SETTINGS,\n\t{\n\t\tid: 'nofollow',\n\t\ttitle: __( 'Mark as nofollow' ),\n\t},\n];\n\nfunction WidthPanel( { selectedWidth, setAttributes } ) {\n\tfunction handleChange( newWidth ) {\n\t\t// Check if we are toggling the width off\n\t\tconst width = selectedWidth === newWidth ? undefined : newWidth;\n\n\t\t// Update attributes.\n\t\tsetAttributes( { width } );\n\t}\n\n\treturn (\n\t\t<PanelBody title={ __( 'Width settings' ) }>\n\t\t\t<ButtonGroup aria-label={ __( 'Button width' ) }>\n\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\twidthValue === selectedWidth\n\t\t\t\t\t\t\t\t\t? 'primary'\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ () => handleChange( widthValue ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ widthValue }%\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ButtonGroup>\n\t\t</PanelBody>\n\t);\n}\n\nfunction ButtonEdit( props ) {\n\tconst {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tclassName,\n\t\tisSelected,\n\t\tonReplace,\n\t\tmergeBlocks,\n\t} = props;\n\tconst {\n\t\ttagName,\n\t\ttextAlign,\n\t\tlinkTarget,\n\t\tplaceholder,\n\t\trel,\n\t\tstyle,\n\t\ttext,\n\t\turl,\n\t\twidth,\n\t} = attributes;\n\n\tconst TagName = tagName || 'a';\n\n\tfunction setButtonText( newText ) {\n\t\t// Remove anchor tags from button text content.\n\t\tsetAttributes( { text: newText.replace( /<\\/?a[^>]*>/g, '' ) } );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tstartEditing( event );\n\t\t} else if ( isKeyboardEvent.primaryShift( event, 'k' ) ) {\n\t\t\tunlink();\n\t\t\trichTextRef.current?.focus();\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst colorProps = useColorProps( attributes );\n\tconst spacingProps = useSpacingProps( attributes );\n\tconst ref = useRef();\n\tconst richTextRef = useRef();\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, ref ] ),\n\t\tonKeyDown,\n\t} );\n\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst isURLSet = !! url;\n\tconst opensInNewTab = linkTarget === NEW_TAB_TARGET;\n\tconst nofollow = !! rel?.includes( NOFOLLOW_REL );\n\tconst isLinkTag = 'a' === TagName;\n\n\tfunction startEditing( event ) {\n\t\tevent.preventDefault();\n\t\tsetIsEditingURL( true );\n\t}\n\n\tfunction unlink() {\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlinkTarget: undefined,\n\t\t\trel: undefined,\n\t\t} );\n\t\tsetIsEditingURL( false );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsEditingURL( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// Memoize link value to avoid overriding the LinkControl's internal state.\n\t// This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256.\n\tconst linkValue = useMemo(\n\t\t() => ( { url, opensInNewTab, nofollow } ),\n\t\t[ url, opensInNewTab, nofollow ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ classnames( blockProps.className, {\n\t\t\t\t\t[ `has-custom-width wp-block-button__width-${ width }` ]:\n\t\t\t\t\t\twidth,\n\t\t\t\t\t[ `has-custom-font-size` ]: blockProps.style.fontSize,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tref={ richTextRef }\n\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\tplaceholder={ placeholder || __( 'Add text…' ) }\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tonChange={ ( value ) => setButtonText( value ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t'wp-block-button__link',\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t\t\t\t\t// For backwards compatibility add style that isn't\n\t\t\t\t\t\t\t// provided via block support.\n\t\t\t\t\t\t\t'no-border-radius': style?.border?.radius === 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...colorProps.style,\n\t\t\t\t\t\t...spacingProps.style,\n\t\t\t\t\t} }\n\t\t\t\t\tonSplit={ ( value ) =>\n\t\t\t\t\t\tcreateBlock( 'core/button', {\n\t\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t\ttext: value,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\tidentifier=\"text\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ ! isURLSet && isLinkTag && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ link }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ startEditing }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isURLSet && isLinkTag && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\ttitle={ __( 'Unlink' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift( 'k' ) }\n\t\t\t\t\t\tonClick={ unlink }\n\t\t\t\t\t\tisActive={ true }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t{ isLinkTag && isSelected && ( isEditingURL || isURLSet ) && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t} }\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tfocusOnMount={ isEditingURL ? 'firstElement' : false }\n\t\t\t\t\t__unstableSlotName={ '__unstable-block-tools-after' }\n\t\t\t\t\tshift\n\t\t\t\t>\n\t\t\t\t\t<LinkControl\n\t\t\t\t\t\tvalue={ linkValue }\n\t\t\t\t\t\tonChange={ ( {\n\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t} ) =>\n\t\t\t\t\t\t\tsetAttributes(\n\t\t\t\t\t\t\t\tgetUpdatedLinkAttributes( {\n\t\t\t\t\t\t\t\t\trel,\n\t\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tunlink();\n\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tforceIsEditingLink={ isEditingURL }\n\t\t\t\t\t\tsettings={ LINK_SETTINGS }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<WidthPanel\n\t\t\t\t\tselectedWidth={ width }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t{ isLinkTag && (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n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AK,EAAC;EAAU,GAChCpB,SAAS,IACV,IAAA9D,MAAA,CAAAC,aAAA,EAACpB,WAAA,CAAAgI,WAAW;IACXC,uBAAuB;IACvBC,KAAK,EAAG,IAAAvH,QAAE,EAAE,UAAW,CAAG;IAC1B+E,KAAK,EAAGjD,GAAG,IAAI,EAAI;IACnBkD,QAAQ,EAAKwC,MAAM,IAClBrH,aAAa,CAAE;MAAE2B,GAAG,EAAE0F;IAAO,CAAE;EAC/B,CACD,CAEgB,CAClB,CAAC;AAEL;AAAC,IAAAC,QAAA,GAEctG,UAAU;AAAAuG,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_constants","_getUpdatedLinkAttributes","_i18n","_element","_components","_blockEditor","_keycodes","_icons","_blocks","_compose","_data","LINK_SETTINGS","LinkControl","DEFAULT_LINK_SETTINGS","id","title","__","useEnter","props","replaceBlocks","selectionChange","useDispatch","blockEditorStore","getBlock","getBlockRootClientId","getBlockIndex","useSelect","propsRef","useRef","current","useRefEffect","element","onKeyDown","event","defaultPrevented","keyCode","ENTER","content","clientId","length","preventDefault","topParentListBlock","blockIndex","head","cloneBlock","innerBlocks","slice","middle","createBlock","getDefaultBlockName","after","tail","addEventListener","removeEventListener","WidthPanel","selectedWidth","setAttributes","handleChange","newWidth","width","undefined","_react","createElement","PanelBody","ButtonGroup","map","widthValue","Button","key","size","variant","onClick","ButtonEdit","attributes","className","isSelected","onReplace","mergeBlocks","tagName","textAlign","linkTarget","placeholder","rel","style","text","url","TagName","setButtonText","newText","replace","isKeyboardEvent","primary","startEditing","primaryShift","unlink","richTextRef","focus","popoverAnchor","setPopoverAnchor","useState","borderProps","useBorderProps","colorProps","useColorProps","spacingProps","useSpacingProps","ref","blockProps","useBlockProps","useMergeRefs","isEditingURL","setIsEditingURL","isURLSet","opensInNewTab","NEW_TAB_TARGET","nofollow","includes","NOFOLLOW_REL","isLinkTag","useEffect","linkValue","useMemo","useEnterRef","mergedRef","Fragment","classnames","fontSize","RichText","value","onChange","withoutInteractiveFormatting","border","radius","__experimentalGetElementClassName","onSplit","onMerge","identifier","BlockControls","group","AlignmentControl","nextAlign","ToolbarButton","name","icon","link","shortcut","displayShortcut","linkOff","isActive","Popover","placement","onClose","anchor","focusOnMount","__unstableSlotName","shift","__experimentalLinkControl","newURL","newOpensInNewTab","newNofollow","getUpdatedLinkAttributes","onRemove","forceIsEditingLink","settings","InspectorControls","TextControl","__nextHasNoMarginBottom","label","newRel","_default","exports","default"],"sources":["@wordpress/block-library/src/button/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';\nimport { getUpdatedLinkAttributes } from './get-updated-link-attributes';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useState, useRef, useMemo } from '@wordpress/element';\nimport {\n\tButton,\n\tButtonGroup,\n\tPanelBody,\n\tTextControl,\n\tToolbarButton,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalGetSpacingClassesAndStyles as useSpacingProps,\n\t__experimentalLinkControl as LinkControl,\n\t__experimentalGetElementClassName,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';\nimport { link, linkOff } from '@wordpress/icons';\nimport {\n\tcreateBlock,\n\tcloneBlock,\n\tgetDefaultBlockName,\n} from '@wordpress/blocks';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst LINK_SETTINGS = [\n\t...LinkControl.DEFAULT_LINK_SETTINGS,\n\t{\n\t\tid: 'nofollow',\n\t\ttitle: __( 'Mark as nofollow' ),\n\t},\n];\n\nfunction useEnter( props ) {\n\tconst { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );\n\tconst { getBlock, getBlockRootClientId, getBlockIndex } =\n\t\tuseSelect( blockEditorStore );\n\tconst propsRef = useRef( props );\n\tpropsRef.current = props;\n\treturn useRefEffect( ( element ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented || event.keyCode !== ENTER ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { content, clientId } = propsRef.current;\n\t\t\tif ( content.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tconst topParentListBlock = getBlock(\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t\tconst blockIndex = getBlockIndex( clientId );\n\t\t\tconst head = cloneBlock( {\n\t\t\t\t...topParentListBlock,\n\t\t\t\tinnerBlocks: topParentListBlock.innerBlocks.slice(\n\t\t\t\t\t0,\n\t\t\t\t\tblockIndex\n\t\t\t\t),\n\t\t\t} );\n\t\t\tconst middle = createBlock( getDefaultBlockName() );\n\t\t\tconst after = topParentListBlock.innerBlocks.slice(\n\t\t\t\tblockIndex + 1\n\t\t\t);\n\t\t\tconst tail = after.length\n\t\t\t\t? [\n\t\t\t\t\t\tcloneBlock( {\n\t\t\t\t\t\t\t...topParentListBlock,\n\t\t\t\t\t\t\tinnerBlocks: after,\n\t\t\t\t\t\t} ),\n\t\t\t\t ]\n\t\t\t\t: [];\n\t\t\treplaceBlocks(\n\t\t\t\ttopParentListBlock.clientId,\n\t\t\t\t[ head, middle, ...tail ],\n\t\t\t\t1\n\t\t\t);\n\t\t\t// We manually change the selection here because we are replacing\n\t\t\t// a different block than the selected one.\n\t\t\tselectionChange( middle.clientId );\n\t\t}\n\n\t\telement.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\telement.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n\nfunction WidthPanel( { selectedWidth, setAttributes } ) {\n\tfunction handleChange( newWidth ) {\n\t\t// Check if we are toggling the width off\n\t\tconst width = selectedWidth === newWidth ? undefined : newWidth;\n\n\t\t// Update attributes.\n\t\tsetAttributes( { width } );\n\t}\n\n\treturn (\n\t\t<PanelBody title={ __( 'Width settings' ) }>\n\t\t\t<ButtonGroup aria-label={ __( 'Button width' ) }>\n\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\twidthValue === selectedWidth\n\t\t\t\t\t\t\t\t\t? 'primary'\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ () => handleChange( widthValue ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ widthValue }%\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ButtonGroup>\n\t\t</PanelBody>\n\t);\n}\n\nfunction ButtonEdit( props ) {\n\tconst {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tclassName,\n\t\tisSelected,\n\t\tonReplace,\n\t\tmergeBlocks,\n\t\tclientId,\n\t} = props;\n\tconst {\n\t\ttagName,\n\t\ttextAlign,\n\t\tlinkTarget,\n\t\tplaceholder,\n\t\trel,\n\t\tstyle,\n\t\ttext,\n\t\turl,\n\t\twidth,\n\t} = attributes;\n\n\tconst TagName = tagName || 'a';\n\n\tfunction setButtonText( newText ) {\n\t\t// Remove anchor tags from button text content.\n\t\tsetAttributes( { text: newText.replace( /<\\/?a[^>]*>/g, '' ) } );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tstartEditing( event );\n\t\t} else if ( isKeyboardEvent.primaryShift( event, 'k' ) ) {\n\t\t\tunlink();\n\t\t\trichTextRef.current?.focus();\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst colorProps = useColorProps( attributes );\n\tconst spacingProps = useSpacingProps( attributes );\n\tconst ref = useRef();\n\tconst richTextRef = useRef();\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, ref ] ),\n\t\tonKeyDown,\n\t} );\n\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst isURLSet = !! url;\n\tconst opensInNewTab = linkTarget === NEW_TAB_TARGET;\n\tconst nofollow = !! rel?.includes( NOFOLLOW_REL );\n\tconst isLinkTag = 'a' === TagName;\n\n\tfunction startEditing( event ) {\n\t\tevent.preventDefault();\n\t\tsetIsEditingURL( true );\n\t}\n\n\tfunction unlink() {\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlinkTarget: undefined,\n\t\t\trel: undefined,\n\t\t} );\n\t\tsetIsEditingURL( false );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsEditingURL( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// Memoize link value to avoid overriding the LinkControl's internal state.\n\t// This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256.\n\tconst linkValue = useMemo(\n\t\t() => ( { url, opensInNewTab, nofollow } ),\n\t\t[ url, opensInNewTab, nofollow ]\n\t);\n\n\tconst useEnterRef = useEnter( { content: text, clientId } );\n\tconst mergedRef = useMergeRefs( [ useEnterRef, richTextRef ] );\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ classnames( blockProps.className, {\n\t\t\t\t\t[ `has-custom-width wp-block-button__width-${ width }` ]:\n\t\t\t\t\t\twidth,\n\t\t\t\t\t[ `has-custom-font-size` ]: blockProps.style.fontSize,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tref={ mergedRef }\n\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\tplaceholder={ placeholder || __( 'Add text…' ) }\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tonChange={ ( value ) => setButtonText( value ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t'wp-block-button__link',\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t\t\t\t\t// For backwards compatibility add style that isn't\n\t\t\t\t\t\t\t// provided via block support.\n\t\t\t\t\t\t\t'no-border-radius': style?.border?.radius === 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...colorProps.style,\n\t\t\t\t\t\t...spacingProps.style,\n\t\t\t\t\t} }\n\t\t\t\t\tonSplit={ ( value ) =>\n\t\t\t\t\t\tcreateBlock( 'core/button', {\n\t\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t\ttext: value,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\tidentifier=\"text\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ ! isURLSet && isLinkTag && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ link }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ startEditing }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isURLSet && isLinkTag && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\ttitle={ __( 'Unlink' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift( 'k' ) }\n\t\t\t\t\t\tonClick={ unlink }\n\t\t\t\t\t\tisActive={ true }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t{ isLinkTag && isSelected && ( isEditingURL || isURLSet ) && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t} }\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tfocusOnMount={ isEditingURL ? 'firstElement' : false }\n\t\t\t\t\t__unstableSlotName={ '__unstable-block-tools-after' }\n\t\t\t\t\tshift\n\t\t\t\t>\n\t\t\t\t\t<LinkControl\n\t\t\t\t\t\tvalue={ linkValue }\n\t\t\t\t\t\tonChange={ ( {\n\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t} ) =>\n\t\t\t\t\t\t\tsetAttributes(\n\t\t\t\t\t\t\t\tgetUpdatedLinkAttributes( {\n\t\t\t\t\t\t\t\t\trel,\n\t\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tunlink();\n\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tforceIsEditingLink={ isEditingURL }\n\t\t\t\t\t\tsettings={ LINK_SETTINGS }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<WidthPanel\n\t\t\t\t\tselectedWidth={ width }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t{ isLinkTag && (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n\nexport default ButtonEdit;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAQA,IAAAM,YAAA,GAAAN,OAAA;AAaA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAKA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,KAAA,GAAAX,OAAA;AA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iB;IAAC1B,KAAK,EAAC;EAAU,GAChCpB,SAAS,IACV,IAAAzD,MAAA,CAAAC,aAAA,EAAC1D,WAAA,CAAAiK,WAAW;IACXC,uBAAuB;IACvBC,KAAK,EAAG,IAAAvJ,QAAE,EAAE,UAAW,CAAG;IAC1BgH,KAAK,EAAG9C,GAAG,IAAI,EAAI;IACnB+C,QAAQ,EAAKuC,MAAM,IAClBhH,aAAa,CAAE;MAAE0B,GAAG,EAAEsF;IAAO,CAAE;EAC/B,CACD,CAEgB,CAClB,CAAC;AAEL;AAAC,IAAAC,QAAA,GAEcjG,UAAU;AAAAkG,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
package/build/code/transforms.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _blocks = require("@wordpress/blocks");
|
|
8
|
+
var _richText = require("@wordpress/rich-text");
|
|
8
9
|
/**
|
|
9
10
|
* WordPress dependencies
|
|
10
11
|
*/
|
|
@@ -16,12 +17,26 @@ const transforms = {
|
|
|
16
17
|
transform: () => (0, _blocks.createBlock)('core/code')
|
|
17
18
|
}, {
|
|
18
19
|
type: 'block',
|
|
19
|
-
blocks: ['core/
|
|
20
|
+
blocks: ['core/paragraph'],
|
|
20
21
|
transform: ({
|
|
21
22
|
content
|
|
23
|
+
}) => (0, _blocks.createBlock)('core/code', {
|
|
24
|
+
content
|
|
25
|
+
})
|
|
26
|
+
}, {
|
|
27
|
+
type: 'block',
|
|
28
|
+
blocks: ['core/html'],
|
|
29
|
+
transform: ({
|
|
30
|
+
content: text
|
|
22
31
|
}) => {
|
|
23
32
|
return (0, _blocks.createBlock)('core/code', {
|
|
24
|
-
|
|
33
|
+
// The HTML is plain text (with plain line breaks), so
|
|
34
|
+
// convert it to rich text.
|
|
35
|
+
content: (0, _richText.toHTMLString)({
|
|
36
|
+
value: (0, _richText.create)({
|
|
37
|
+
text
|
|
38
|
+
})
|
|
39
|
+
})
|
|
25
40
|
});
|
|
26
41
|
}
|
|
27
42
|
}, {
|
|
@@ -44,11 +59,9 @@ const transforms = {
|
|
|
44
59
|
blocks: ['core/paragraph'],
|
|
45
60
|
transform: ({
|
|
46
61
|
content
|
|
47
|
-
}) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
});
|
|
51
|
-
}
|
|
62
|
+
}) => (0, _blocks.createBlock)('core/paragraph', {
|
|
63
|
+
content
|
|
64
|
+
})
|
|
52
65
|
}]
|
|
53
66
|
};
|
|
54
67
|
var _default = transforms;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","transforms","from","type","regExp","transform","createBlock","blocks","content","isMatch","node","nodeName","children","length","firstChild","schema","pre","code","to","
|
|
1
|
+
{"version":3,"names":["_blocks","require","_richText","transforms","from","type","regExp","transform","createBlock","blocks","content","text","toHTMLString","value","create","isMatch","node","nodeName","children","length","firstChild","schema","pre","code","to","_default","exports","default"],"sources":["@wordpress/block-library/src/code/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { create, toHTMLString } from '@wordpress/rich-text';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'enter',\n\t\t\tregExp: /^```$/,\n\t\t\ttransform: () => createBlock( 'core/code' ),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\ttransform: ( { content } ) =>\n\t\t\t\tcreateBlock( 'core/code', { content } ),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/html' ],\n\t\t\ttransform: ( { content: text } ) => {\n\t\t\t\treturn createBlock( 'core/code', {\n\t\t\t\t\t// The HTML is plain text (with plain line breaks), so\n\t\t\t\t\t// convert it to rich text.\n\t\t\t\t\tcontent: toHTMLString( { value: create( { text } ) } ),\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'PRE' &&\n\t\t\t\tnode.children.length === 1 &&\n\t\t\t\tnode.firstChild.nodeName === 'CODE',\n\t\t\tschema: {\n\t\t\t\tpre: {\n\t\t\t\t\tchildren: {\n\t\t\t\t\t\tcode: {\n\t\t\t\t\t\t\tchildren: {\n\t\t\t\t\t\t\t\t'#text': {},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\ttransform: ( { content } ) =>\n\t\t\t\tcreateBlock( 'core/paragraph', { content } ),\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,UAAU,GAAG;EAClBC,IAAI,EAAE,CACL;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,OAAO;IACfC,SAAS,EAAEA,CAAA,KAAM,IAAAC,mBAAW,EAAE,WAAY;EAC3C,CAAC,EACD;IACCH,IAAI,EAAE,OAAO;IACbI,MAAM,EAAE,CAAE,gBAAgB,CAAE;IAC5BF,SAAS,EAAEA,CAAE;MAAEG;IAAQ,CAAC,KACvB,IAAAF,mBAAW,EAAE,WAAW,EAAE;MAAEE;IAAQ,CAAE;EACxC,CAAC,EACD;IACCL,IAAI,EAAE,OAAO;IACbI,MAAM,EAAE,CAAE,WAAW,CAAE;IACvBF,SAAS,EAAEA,CAAE;MAAEG,OAAO,EAAEC;IAAK,CAAC,KAAM;MACnC,OAAO,IAAAH,mBAAW,EAAE,WAAW,EAAE;QAChC;QACA;QACAE,OAAO,EAAE,IAAAE,sBAAY,EAAE;UAAEC,KAAK,EAAE,IAAAC,gBAAM,EAAE;YAAEH;UAAK,CAAE;QAAE,CAAE;MACtD,CAAE,CAAC;IACJ;EACD,CAAC,EACD;IACCN,IAAI,EAAE,KAAK;IACXU,OAAO,EAAIC,IAAI,IACdA,IAAI,CAACC,QAAQ,KAAK,KAAK,IACvBD,IAAI,CAACE,QAAQ,CAACC,MAAM,KAAK,CAAC,IAC1BH,IAAI,CAACI,UAAU,CAACH,QAAQ,KAAK,MAAM;IACpCI,MAAM,EAAE;MACPC,GAAG,EAAE;QACJJ,QAAQ,EAAE;UACTK,IAAI,EAAE;YACLL,QAAQ,EAAE;cACT,OAAO,EAAE,CAAC;YACX;UACD;QACD;MACD;IACD;EACD,CAAC,CACD;EACDM,EAAE,EAAE,CACH;IACCnB,IAAI,EAAE,OAAO;IACbI,MAAM,EAAE,CAAE,gBAAgB,CAAE;IAC5BF,SAAS,EAAEA,CAAE;MAAEG;IAAQ,CAAC,KACvB,IAAAF,mBAAW,EAAE,gBAAgB,EAAE;MAAEE;IAAQ,CAAE;EAC7C,CAAC;AAEH,CAAC;AAAC,IAAAe,QAAA,GAEatB,UAAU;AAAAuB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -26,6 +26,7 @@ function CommentsInspectorControls({
|
|
|
26
26
|
group: "advanced"
|
|
27
27
|
}, (0, _react.createElement)(_components.SelectControl, {
|
|
28
28
|
__nextHasNoMarginBottom: true,
|
|
29
|
+
__next40pxDefaultSize: true,
|
|
29
30
|
label: (0, _i18n.__)('HTML element'),
|
|
30
31
|
options: [{
|
|
31
32
|
label: (0, _i18n.__)('Default (<div>)'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_blockEditor","CommentsInspectorControls","attributes","tagName","setAttributes","htmlElementMessages","section","__","aside","_react","createElement","InspectorControls","group","SelectControl","__nextHasNoMarginBottom","label","options","value","onChange","help"],"sources":["@wordpress/block-library/src/comments/edit/comments-inspector-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\n\nexport default function CommentsInspectorControls( {\n\tattributes: { tagName },\n\tsetAttributes,\n} ) {\n\tconst htmlElementMessages = {\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t};\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</InspectorControls>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKe,SAASG,yBAAyBA,CAAE;EAClDC,UAAU,EAAE;IAAEC;EAAQ,CAAC;EACvBC;AACD,CAAC,EAAG;EACH,MAAMC,mBAAmB,GAAG;IAC3BC,OAAO,EAAE,IAAAC,QAAE,EACV,kIACD,CAAC;IACDC,KAAK,EAAE,IAAAD,QAAE,EACR,uIACD;EACD,CAAC;EACD,OACC,IAAAE,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,iBAAiB,QACjB,IAAAF,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,iBAAiB;IAACC,KAAK,EAAC;EAAU,GAClC,IAAAH,MAAA,CAAAC,aAAA,EAACb,WAAA,CAAAgB,aAAa;IACbC,uBAAuB;IACvBC,KAAK,EAAG,
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_blockEditor","CommentsInspectorControls","attributes","tagName","setAttributes","htmlElementMessages","section","__","aside","_react","createElement","InspectorControls","group","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onChange","help"],"sources":["@wordpress/block-library/src/comments/edit/comments-inspector-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\n\nexport default function CommentsInspectorControls( {\n\tattributes: { tagName },\n\tsetAttributes,\n} ) {\n\tconst htmlElementMessages = {\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t};\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</InspectorControls>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKe,SAASG,yBAAyBA,CAAE;EAClDC,UAAU,EAAE;IAAEC;EAAQ,CAAC;EACvBC;AACD,CAAC,EAAG;EACH,MAAMC,mBAAmB,GAAG;IAC3BC,OAAO,EAAE,IAAAC,QAAE,EACV,kIACD,CAAC;IACDC,KAAK,EAAE,IAAAD,QAAE,EACR,uIACD;EACD,CAAC;EACD,OACC,IAAAE,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,iBAAiB,QACjB,IAAAF,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,iBAAiB;IAACC,KAAK,EAAC;EAAU,GAClC,IAAAH,MAAA,CAAAC,aAAA,EAACb,WAAA,CAAAgB,aAAa;IACbC,uBAAuB;IACvBC,qBAAqB;IACrBC,KAAK,EAAG,IAAAT,QAAE,EAAE,cAAe,CAAG;IAC9BU,OAAO,EAAG,CACT;MAAED,KAAK,EAAE,IAAAT,QAAE,EAAE,iBAAkB,CAAC;MAAEW,KAAK,EAAE;IAAM,CAAC,EAChD;MAAEF,KAAK,EAAE,WAAW;MAAEE,KAAK,EAAE;IAAU,CAAC,EACxC;MAAEF,KAAK,EAAE,SAAS;MAAEE,KAAK,EAAE;IAAQ,CAAC,CAClC;IACHA,KAAK,EAAGf,OAAS;IACjBgB,QAAQ,EAAKD,KAAK,IACjBd,aAAa,CAAE;MAAED,OAAO,EAAEe;IAAM,CAAE,CAClC;IACDE,IAAI,EAAGf,mBAAmB,CAAEF,OAAO;EAAI,CACvC,CACiB,CACD,CAAC;AAEtB"}
|
|
@@ -231,6 +231,7 @@ function CoverInspectorControls({
|
|
|
231
231
|
group: "advanced"
|
|
232
232
|
}, (0, _react.createElement)(_components.SelectControl, {
|
|
233
233
|
__nextHasNoMarginBottom: true,
|
|
234
|
+
__next40pxDefaultSize: true,
|
|
234
235
|
label: (0, _i18n.__)('HTML element'),
|
|
235
236
|
options: [{
|
|
236
237
|
label: (0, _i18n.__)('Default (<div>)'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_compose","_blockEditor","_i18n","_shared","CoverHeightInput","onChange","onUnitChange","unit","value","instanceId","useInstanceId","UnitControl","inputId","isPx","availableUnits","useSettings","units","useCustomUnits","defaultValues","px","em","rem","vw","vh","handleOnChange","unprocessedValue","inputValue","parseFloat","undefined","isNaN","computedValue","useMemo","parsedQuantity","parseQuantityAndUnitFromRawValue","join","min","COVER_MIN_HEIGHT","_react","createElement","__experimentalUnitControl","label","__","id","isResetValueOnUnitChange","__unstableInputWidth","CoverInspectorControls","attributes","setAttributes","clientId","setOverlayColor","coverRef","currentSettings","updateDimRatio","onClearMedia","useFeaturedImage","dimRatio","focalPoint","hasParallax","isRepeated","minHeight","minHeightUnit","alt","tagName","isVideoBackground","isImageBackground","mediaElement","url","overlayColor","gradientValue","setGradient","__experimentalUseGradient","toggleParallax","toggleIsRepeated","showFocalPointPicker","imperativeFocalPointPreview","styleOfRef","property","current","style","mediaPosition","colorGradientSettings","useMultipleOriginColorsAndGradients","htmlElementMessages","header","main","section","article","aside","footer","Fragment","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","checked","FocalPointPicker","onDragStart","onDrag","newFocalPoint","TextareaControl","newAlt","help","ExternalLink","href","PanelRow","Button","variant","isSmall","className","onClick","hasColorsOrGradients","group","__experimentalColorGradientSettingsDropdown","__experimentalIsRenderedInSidebar","settings","colorValue","color","onColorChange","onGradientChange","isShownByDefault","resetAllFilter","customOverlayColor","gradient","customGradient","panelId","__experimentalToolsPanelItem","hasValue","onDeselect","RangeControl","newDimRatio","max","step","required","__next40pxDefaultSize","newMinHeight","nextUnit","SelectControl","options"],"sources":["@wordpress/block-library/src/cover/edit/inspector-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport {\n\tButton,\n\tExternalLink,\n\tFocalPointPicker,\n\tPanelBody,\n\tPanelRow,\n\tRangeControl,\n\tTextareaControl,\n\tToggleControl,\n\tSelectControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tInspectorControls,\n\tuseSettings,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseGradient,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { COVER_MIN_HEIGHT, mediaPosition } from '../shared';\n\nfunction CoverHeightInput( {\n\tonChange,\n\tonUnitChange,\n\tunit = 'px',\n\tvalue = '',\n} ) {\n\tconst instanceId = useInstanceId( UnitControl );\n\tconst inputId = `block-cover-height-input-${ instanceId }`;\n\tconst isPx = unit === 'px';\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],\n\t\tdefaultValues: { px: 430, '%': 20, em: 20, rem: 20, vw: 20, vh: 50 },\n\t} );\n\n\tconst handleOnChange = ( unprocessedValue ) => {\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== ''\n\t\t\t\t? parseFloat( unprocessedValue )\n\t\t\t\t: undefined;\n\n\t\tif ( isNaN( inputValue ) && inputValue !== undefined ) {\n\t\t\treturn;\n\t\t}\n\t\tonChange( inputValue );\n\t};\n\n\tconst computedValue = useMemo( () => {\n\t\tconst [ parsedQuantity ] = parseQuantityAndUnitFromRawValue( value );\n\t\treturn [ parsedQuantity, unit ].join( '' );\n\t}, [ unit, value ] );\n\n\tconst min = isPx ? COVER_MIN_HEIGHT : 0;\n\n\treturn (\n\t\t<UnitControl\n\t\t\tlabel={ __( 'Minimum height of cover' ) }\n\t\t\tid={ inputId }\n\t\t\tisResetValueOnUnitChange\n\t\t\tmin={ min }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ onUnitChange }\n\t\t\t__unstableInputWidth={ '80px' }\n\t\t\tunits={ units }\n\t\t\tvalue={ computedValue }\n\t\t/>\n\t);\n}\nexport default function CoverInspectorControls( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tsetOverlayColor,\n\tcoverRef,\n\tcurrentSettings,\n\tupdateDimRatio,\n\tonClearMedia,\n} ) {\n\tconst {\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\ttagName,\n\t} = attributes;\n\tconst {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\turl,\n\t\toverlayColor,\n\t} = currentSettings;\n\n\tconst { gradientValue, setGradient } = __experimentalUseGradient();\n\n\tconst toggleParallax = () => {\n\t\tsetAttributes( {\n\t\t\thasParallax: ! hasParallax,\n\t\t\t...( ! hasParallax ? { focalPoint: undefined } : {} ),\n\t\t} );\n\t};\n\n\tconst toggleIsRepeated = () => {\n\t\tsetAttributes( {\n\t\t\tisRepeated: ! isRepeated,\n\t\t} );\n\t};\n\n\tconst showFocalPointPicker =\n\t\tisVideoBackground ||\n\t\t( isImageBackground && ( ! hasParallax || isRepeated ) );\n\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tconst [ styleOfRef, property ] = mediaElement.current\n\t\t\t? [ mediaElement.current.style, 'objectPosition' ]\n\t\t\t: [ coverRef.current.style, 'backgroundPosition' ];\n\t\tstyleOfRef[ property ] = mediaPosition( value );\n\t};\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\tconst htmlElementMessages = {\n\t\theader: __(\n\t\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t\t),\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only.'\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\tarticle: __(\n\t\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t\tfooter: __(\n\t\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t\t),\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ !! url && (\n\t\t\t\t\t<PanelBody title={ __( 'Media settings' ) }>\n\t\t\t\t\t\t{ isImageBackground && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\tchecked={ hasParallax }\n\t\t\t\t\t\t\t\t\tonChange={ toggleParallax }\n\t\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\tchecked={ isRepeated }\n\t\t\t\t\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showFocalPointPicker && (\n\t\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Focal point picker' ) }\n\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\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) }\n\t\t\t\t\t\t{ ! useFeaturedImage && url && ! isVideoBackground && (\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\t\t\tonChange={ ( newAlt ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { alt: newAlt } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/WAI/tutorials/images/decision-tree\">\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\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) }\n\t\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\tclassName=\"block-library-cover__reset-button\"\n\t\t\t\t\t\t\t\tonClick={ onClearMedia }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Clear Media' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</PanelRow>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcolorValue: overlayColor.color,\n\t\t\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\t\t\tlabel: __( 'Overlay' ),\n\t\t\t\t\t\t\t\tonColorChange: setOverlayColor,\n\t\t\t\t\t\t\t\tonGradientChange: setGradient,\n\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\tresetAllFilter: () => ( {\n\t\t\t\t\t\t\t\t\toverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tcustomOverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tgradient: undefined,\n\t\t\t\t\t\t\t\t\tcustomGradient: undefined,\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => {\n\t\t\t\t\t\t\t// If there's a media background the dimRatio will be\n\t\t\t\t\t\t\t// defaulted to 50 whereas it will be 100 for colors.\n\t\t\t\t\t\t\treturn dimRatio === undefined\n\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t: dimRatio !== ( url ? 50 : 100 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\tonDeselect={ () => updateDimRatio( url ? 50 : 100 ) }\n\t\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\t\tdimRatio: url ? 50 : 100,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\t\tvalue={ dimRatio }\n\t\t\t\t\t\t\tonChange={ ( newDimRatio ) =>\n\t\t\t\t\t\t\t\tupdateDimRatio( newDimRatio )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\tstep={ 10 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"dimensions\">\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! minHeight }\n\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tminHeight: undefined,\n\t\t\t\t\t\t\tminHeightUnit: undefined,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\tminHeight: undefined,\n\t\t\t\t\t\tminHeightUnit: undefined,\n\t\t\t\t\t} ) }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<CoverHeightInput\n\t\t\t\t\t\tvalue={ minHeight }\n\t\t\t\t\t\tunit={ minHeightUnit }\n\t\t\t\t\t\tonChange={ ( newMinHeight ) =>\n\t\t\t\t\t\t\tsetAttributes( { minHeight: newMinHeight } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonUnitChange={ ( nextUnit ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tminHeightUnit: nextUnit,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAeA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAL,OAAA;AAhCA;AACA;AACA;;AA2BA;AACA;AACA;;AAGA,SAASM,gBAAgBA,CAAE;EAC1BC,QAAQ;EACRC,YAAY;EACZC,IAAI,GAAG,IAAI;EACXC,K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,QAAQ,IACxBzF,aAAa,CAAE;MACda,aAAa,EAAE4E;IAChB,CAAE;EACF,CACD,CACc,CACE,CAAC,EACpB,IAAAnG,MAAA,CAAAC,aAAA,EAACrC,YAAA,CAAAyF,iBAAiB;IAACsB,KAAK,EAAC;EAAU,GAClC,IAAA3E,MAAA,CAAAC,aAAA,EAACvC,WAAA,CAAA0I,aAAa;IACb3C,uBAAuB;IACvBtD,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;IAC9BiG,OAAO,EAAG,CACT;MAAElG,KAAK,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC;MAAEjC,KAAK,EAAE;IAAM,CAAC,EAChD;MAAEgC,KAAK,EAAE,UAAU;MAAEhC,KAAK,EAAE;IAAS,CAAC,EACtC;MAAEgC,KAAK,EAAE,QAAQ;MAAEhC,KAAK,EAAE;IAAO,CAAC,EAClC;MAAEgC,KAAK,EAAE,WAAW;MAAEhC,KAAK,EAAE;IAAU,CAAC,EACxC;MAAEgC,KAAK,EAAE,WAAW;MAAEhC,KAAK,EAAE;IAAU,CAAC,EACxC;MAAEgC,KAAK,EAAE,SAAS;MAAEhC,KAAK,EAAE;IAAQ,CAAC,EACpC;MAAEgC,KAAK,EAAE,UAAU;MAAEhC,KAAK,EAAE;IAAS,CAAC,CACpC;IACHA,KAAK,EAAGsD,OAAS;IACjBzD,QAAQ,EAAKG,KAAK,IACjBuC,aAAa,CAAE;MAAEe,OAAO,EAAEtD;IAAM,CAAE,CAClC;IACD8F,IAAI,EAAGpB,mBAAmB,CAAEpB,OAAO;EAAI,CACvC,CACiB,CAClB,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_compose","_blockEditor","_i18n","_shared","CoverHeightInput","onChange","onUnitChange","unit","value","instanceId","useInstanceId","UnitControl","inputId","isPx","availableUnits","useSettings","units","useCustomUnits","defaultValues","px","em","rem","vw","vh","handleOnChange","unprocessedValue","inputValue","parseFloat","undefined","isNaN","computedValue","useMemo","parsedQuantity","parseQuantityAndUnitFromRawValue","join","min","COVER_MIN_HEIGHT","_react","createElement","__experimentalUnitControl","label","__","id","isResetValueOnUnitChange","__unstableInputWidth","CoverInspectorControls","attributes","setAttributes","clientId","setOverlayColor","coverRef","currentSettings","updateDimRatio","onClearMedia","useFeaturedImage","dimRatio","focalPoint","hasParallax","isRepeated","minHeight","minHeightUnit","alt","tagName","isVideoBackground","isImageBackground","mediaElement","url","overlayColor","gradientValue","setGradient","__experimentalUseGradient","toggleParallax","toggleIsRepeated","showFocalPointPicker","imperativeFocalPointPreview","styleOfRef","property","current","style","mediaPosition","colorGradientSettings","useMultipleOriginColorsAndGradients","htmlElementMessages","header","main","section","article","aside","footer","Fragment","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","checked","FocalPointPicker","onDragStart","onDrag","newFocalPoint","TextareaControl","newAlt","help","ExternalLink","href","PanelRow","Button","variant","isSmall","className","onClick","hasColorsOrGradients","group","__experimentalColorGradientSettingsDropdown","__experimentalIsRenderedInSidebar","settings","colorValue","color","onColorChange","onGradientChange","isShownByDefault","resetAllFilter","customOverlayColor","gradient","customGradient","panelId","__experimentalToolsPanelItem","hasValue","onDeselect","RangeControl","newDimRatio","max","step","required","__next40pxDefaultSize","newMinHeight","nextUnit","SelectControl","options"],"sources":["@wordpress/block-library/src/cover/edit/inspector-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport {\n\tButton,\n\tExternalLink,\n\tFocalPointPicker,\n\tPanelBody,\n\tPanelRow,\n\tRangeControl,\n\tTextareaControl,\n\tToggleControl,\n\tSelectControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tInspectorControls,\n\tuseSettings,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseGradient,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { COVER_MIN_HEIGHT, mediaPosition } from '../shared';\n\nfunction CoverHeightInput( {\n\tonChange,\n\tonUnitChange,\n\tunit = 'px',\n\tvalue = '',\n} ) {\n\tconst instanceId = useInstanceId( UnitControl );\n\tconst inputId = `block-cover-height-input-${ instanceId }`;\n\tconst isPx = unit === 'px';\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],\n\t\tdefaultValues: { px: 430, '%': 20, em: 20, rem: 20, vw: 20, vh: 50 },\n\t} );\n\n\tconst handleOnChange = ( unprocessedValue ) => {\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== ''\n\t\t\t\t? parseFloat( unprocessedValue )\n\t\t\t\t: undefined;\n\n\t\tif ( isNaN( inputValue ) && inputValue !== undefined ) {\n\t\t\treturn;\n\t\t}\n\t\tonChange( inputValue );\n\t};\n\n\tconst computedValue = useMemo( () => {\n\t\tconst [ parsedQuantity ] = parseQuantityAndUnitFromRawValue( value );\n\t\treturn [ parsedQuantity, unit ].join( '' );\n\t}, [ unit, value ] );\n\n\tconst min = isPx ? COVER_MIN_HEIGHT : 0;\n\n\treturn (\n\t\t<UnitControl\n\t\t\tlabel={ __( 'Minimum height of cover' ) }\n\t\t\tid={ inputId }\n\t\t\tisResetValueOnUnitChange\n\t\t\tmin={ min }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ onUnitChange }\n\t\t\t__unstableInputWidth={ '80px' }\n\t\t\tunits={ units }\n\t\t\tvalue={ computedValue }\n\t\t/>\n\t);\n}\nexport default function CoverInspectorControls( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tsetOverlayColor,\n\tcoverRef,\n\tcurrentSettings,\n\tupdateDimRatio,\n\tonClearMedia,\n} ) {\n\tconst {\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\ttagName,\n\t} = attributes;\n\tconst {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\turl,\n\t\toverlayColor,\n\t} = currentSettings;\n\n\tconst { gradientValue, setGradient } = __experimentalUseGradient();\n\n\tconst toggleParallax = () => {\n\t\tsetAttributes( {\n\t\t\thasParallax: ! hasParallax,\n\t\t\t...( ! hasParallax ? { focalPoint: undefined } : {} ),\n\t\t} );\n\t};\n\n\tconst toggleIsRepeated = () => {\n\t\tsetAttributes( {\n\t\t\tisRepeated: ! isRepeated,\n\t\t} );\n\t};\n\n\tconst showFocalPointPicker =\n\t\tisVideoBackground ||\n\t\t( isImageBackground && ( ! hasParallax || isRepeated ) );\n\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tconst [ styleOfRef, property ] = mediaElement.current\n\t\t\t? [ mediaElement.current.style, 'objectPosition' ]\n\t\t\t: [ coverRef.current.style, 'backgroundPosition' ];\n\t\tstyleOfRef[ property ] = mediaPosition( value );\n\t};\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\tconst htmlElementMessages = {\n\t\theader: __(\n\t\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t\t),\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only.'\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\tarticle: __(\n\t\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t\tfooter: __(\n\t\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t\t),\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ !! url && (\n\t\t\t\t\t<PanelBody title={ __( 'Media settings' ) }>\n\t\t\t\t\t\t{ isImageBackground && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\tchecked={ hasParallax }\n\t\t\t\t\t\t\t\t\tonChange={ toggleParallax }\n\t\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\tchecked={ isRepeated }\n\t\t\t\t\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showFocalPointPicker && (\n\t\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Focal point picker' ) }\n\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\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) }\n\t\t\t\t\t\t{ ! useFeaturedImage && url && ! isVideoBackground && (\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\t\t\tonChange={ ( newAlt ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { alt: newAlt } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/WAI/tutorials/images/decision-tree\">\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\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) }\n\t\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\tclassName=\"block-library-cover__reset-button\"\n\t\t\t\t\t\t\t\tonClick={ onClearMedia }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Clear Media' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</PanelRow>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcolorValue: overlayColor.color,\n\t\t\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\t\t\tlabel: __( 'Overlay' ),\n\t\t\t\t\t\t\t\tonColorChange: setOverlayColor,\n\t\t\t\t\t\t\t\tonGradientChange: setGradient,\n\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\tresetAllFilter: () => ( {\n\t\t\t\t\t\t\t\t\toverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tcustomOverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tgradient: undefined,\n\t\t\t\t\t\t\t\t\tcustomGradient: undefined,\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => {\n\t\t\t\t\t\t\t// If there's a media background the dimRatio will be\n\t\t\t\t\t\t\t// defaulted to 50 whereas it will be 100 for colors.\n\t\t\t\t\t\t\treturn dimRatio === undefined\n\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t: dimRatio !== ( url ? 50 : 100 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\tonDeselect={ () => updateDimRatio( url ? 50 : 100 ) }\n\t\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\t\tdimRatio: url ? 50 : 100,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\t\tvalue={ dimRatio }\n\t\t\t\t\t\t\tonChange={ ( newDimRatio ) =>\n\t\t\t\t\t\t\t\tupdateDimRatio( newDimRatio )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\tstep={ 10 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"dimensions\">\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! minHeight }\n\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tminHeight: undefined,\n\t\t\t\t\t\t\tminHeightUnit: undefined,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\tminHeight: undefined,\n\t\t\t\t\t\tminHeightUnit: undefined,\n\t\t\t\t\t} ) }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<CoverHeightInput\n\t\t\t\t\t\tvalue={ minHeight }\n\t\t\t\t\t\tunit={ minHeightUnit }\n\t\t\t\t\t\tonChange={ ( newMinHeight ) =>\n\t\t\t\t\t\t\tsetAttributes( { minHeight: newMinHeight } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonUnitChange={ ( nextUnit ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tminHeightUnit: nextUnit,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAeA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAL,OAAA;AAhCA;AACA;AACA;;AA2BA;AACA;AACA;;AAGA,SAASM,gBAAgBA,CAAE;EAC1BC,QAAQ;EACRC,YAAY;EACZC,IAAI,GAAG,IAAI;EACXC,KAAK,GAAG;AACT,CAAC,EAAG;EACH,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEC,qCAAY,CAAC;EAC/C,MAAMC,OAAO,GAAI,4BAA4BH,UAAY,EAAC;EAC1D,MAAMI,IAAI,GAAGN,IAAI,KAAK,IAAI;EAE1B,MAAM,CAAEO,cAAc,CAAE,GAAG,IAAAC,wBAAW,EAAE,eAAgB,CAAC;EACzD,MAAMC,KAAK,GAAG,IAAAC,wCAAc,EAAE;IAC7BH,cAAc,EAA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AG;IAC9BiG,OAAO,EAAG,CACT;MAAElG,KAAK,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC;MAAEjC,KAAK,EAAE;IAAM,CAAC,EAChD;MAAEgC,KAAK,EAAE,UAAU;MAAEhC,KAAK,EAAE;IAAS,CAAC,EACtC;MAAEgC,KAAK,EAAE,QAAQ;MAAEhC,KAAK,EAAE;IAAO,CAAC,EAClC;MAAEgC,KAAK,EAAE,WAAW;MAAEhC,KAAK,EAAE;IAAU,CAAC,EACxC;MAAEgC,KAAK,EAAE,WAAW;MAAEhC,KAAK,EAAE;IAAU,CAAC,EACxC;MAAEgC,KAAK,EAAE,SAAS;MAAEhC,KAAK,EAAE;IAAQ,CAAC,EACpC;MAAEgC,KAAK,EAAE,UAAU;MAAEhC,KAAK,EAAE;IAAS,CAAC,CACpC;IACHA,KAAK,EAAGsD,OAAS;IACjBzD,QAAQ,EAAKG,KAAK,IACjBuC,aAAa,CAAE;MAAEe,OAAO,EAAEtD;IAAM,CAAE,CAClC;IACD8F,IAAI,EAAGpB,mBAAmB,CAAEpB,OAAO;EAAI,CACvC,CACiB,CAClB,CAAC;AAEL"}
|
package/build/details/edit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_data","_components","_i18n","TEMPLATE","placeholder","__","DetailsEdit","attributes","setAttributes","clientId","showContent","summary","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","__experimentalCaptureToolbars","hasSelection","useSelect","select","isBlockSelected","hasSelectedInnerBlock","blockEditorStore","_react","createElement","Fragment","InspectorControls","PanelBody","title","ToggleControl","label","checked","onChange","open","onClick","event","preventDefault","RichText","allowedFormats","withoutInteractiveFormatting","value","newSummary","
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_data","_components","_i18n","TEMPLATE","placeholder","__","DetailsEdit","attributes","setAttributes","clientId","showContent","summary","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","__experimentalCaptureToolbars","hasSelection","useSelect","select","isBlockSelected","hasSelectedInnerBlock","blockEditorStore","_react","createElement","Fragment","InspectorControls","PanelBody","title","ToggleControl","label","checked","onChange","open","onClick","event","preventDefault","RichText","allowedFormats","withoutInteractiveFormatting","value","newSummary","children","_default","exports","default"],"sources":["@wordpress/block-library/src/details/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n\tInspectorControls,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst TEMPLATE = [\n\t[\n\t\t'core/paragraph',\n\t\t{\n\t\t\tplaceholder: __( 'Type / to add a hidden block' ),\n\t\t},\n\t],\n];\n\nfunction DetailsEdit( { attributes, setAttributes, clientId } ) {\n\tconst { showContent, summary } = attributes;\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\t__experimentalCaptureToolbars: true,\n\t} );\n\n\t// Check if either the block or the inner blocks are selected.\n\tconst hasSelection = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isBlockSelected, hasSelectedInnerBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\t/* Sets deep to true to also find blocks inside the details content block. */\n\t\t\treturn (\n\t\t\t\thasSelectedInnerBlock( clientId, true ) ||\n\t\t\t\tisBlockSelected( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open by default' ) }\n\t\t\t\t\t\tchecked={ showContent }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowContent: ! showContent,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<details\n\t\t\t\t{ ...innerBlocksProps }\n\t\t\t\topen={ hasSelection || showContent }\n\t\t\t>\n\t\t\t\t<summary onClick={ ( event ) => event.preventDefault() }>\n\t\t\t\t\t<RichText\n\t\t\t\t\t\taria-label={ __( 'Write summary' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Write summary…' ) }\n\t\t\t\t\t\tallowedFormats={ [] }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ summary }\n\t\t\t\t\t\tonChange={ ( newSummary ) =>\n\t\t\t\t\t\t\tsetAttributes( { summary: newSummary } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</summary>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t</details>\n\t\t</>\n\t);\n}\n\nexport default DetailsEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAZA;AACA;AACA;;AAYA,MAAMI,QAAQ,GAAG,CAChB,CACC,gBAAgB,EAChB;EACCC,WAAW,EAAE,IAAAC,QAAE,EAAE,8BAA+B;AACjD,CAAC,CACD,CACD;AAED,SAASC,WAAWA,CAAE;EAAEC,UAAU;EAAEC,aAAa;EAAEC;AAAS,CAAC,EAAG;EAC/D,MAAM;IAAEC,WAAW;IAAEC;EAAQ,CAAC,GAAGJ,UAAU;EAC3C,MAAMK,UAAU,GAAG,IAAAC,0BAAa,EAAC,CAAC;EAClC,MAAMC,gBAAgB,GAAG,IAAAC,gCAAmB,EAAEH,UAAU,EAAE;IACzDI,QAAQ,EAAEb,QAAQ;IAClBc,6BAA6B,EAAE;EAChC,CAAE,CAAC;;EAEH;EACA,MAAMC,YAA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,EAAE+B;IAAW,CAAE;EACvC,CACD,CACO,CAAC,EACR5B,gBAAgB,CAAC6B,QACX,CACR,CAAC;AAEL;AAAC,IAAAC,QAAA,GAEctC,WAAW;AAAAuC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
package/build/form/edit.js
CHANGED
|
@@ -18,7 +18,7 @@ var _utils = require("./utils.js");
|
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
const ALLOWED_BLOCKS = ['core/paragraph', 'core/heading', 'core/form-input', 'core/form-submit-button', 'core/form-submission-notification'];
|
|
21
|
+
const ALLOWED_BLOCKS = ['core/paragraph', 'core/heading', 'core/form-input', 'core/form-submit-button', 'core/form-submission-notification', 'core/group', 'core/columns'];
|
|
22
22
|
const TEMPLATE = [_utils.formSubmissionNotificationSuccess, _utils.formSubmissionNotificationError, ['core/form-input', {
|
|
23
23
|
type: 'text',
|
|
24
24
|
label: (0, _i18n.__)('Name'),
|
package/build/form/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blockEditor","_components","_data","_utils","ALLOWED_BLOCKS","TEMPLATE","formSubmissionNotificationSuccess","formSubmissionNotificationError","type","label","__","required","Edit","attributes","setAttributes","clientId","action","method","email","submissionMethod","blockProps","useBlockProps","hasInnerBlocks","useSelect","select","getBlock","blockEditorStore","block","innerBlocks","length","innerBlocksProps","useInnerBlocksProps","allowedBlocks","template","renderAppender","undefined","InnerBlocks","ButtonBlockAppender","_react","createElement","Fragment","InspectorControls","PanelBody","title","SelectControl","options","value","onChange","help","TextControl","__nextHasNoMarginBottom","autoComplete","group","newVal","className","encType","_default","exports","default"],"sources":["@wordpress/block-library/src/form/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { TextControl, SelectControl, PanelBody } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n} from './utils.js';\n\nconst ALLOWED_BLOCKS = [\n\t'core/paragraph',\n\t'core/heading',\n\t'core/form-input',\n\t'core/form-submit-button',\n\t'core/form-submission-notification',\n];\n\nconst TEMPLATE = [\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'text',\n\t\t\tlabel: __( 'Name' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'email',\n\t\t\tlabel: __( 'Email' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'textarea',\n\t\t\tlabel: __( 'Comment' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[ 'core/form-submit-button', {} ],\n];\n\nconst Edit = ( { attributes, setAttributes, clientId } ) => {\n\tconst { action, method, email, submissionMethod } = attributes;\n\tconst blockProps = useBlockProps();\n\n\tconst { hasInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\ttemplate: TEMPLATE,\n\t\trenderAppender: hasInnerBlocks\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t// __nextHasNoMarginBottom\n\t\t\t\t\t\t// size={ '__unstable-large' }\n\t\t\t\t\t\tlabel={ __( 'Submissions method' ) }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t// TODO: Allow plugins to add their own submission methods.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Send email' ),\n\t\t\t\t\t\t\t\tvalue: 'email',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( '- Custom -' ),\n\t\t\t\t\t\t\t\tvalue: 'custom',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tvalue={ submissionMethod }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { submissionMethod: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tsubmissionMethod === 'custom'\n\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t'Select the method to use for form submissions. Additional options for the \"custom\" mode can be found in the \"Advanced\" section.'\n\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\t\t\t'Select the method to use for form submissions.'\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ submissionMethod === 'email' && (\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tlabel={ __( 'Email for form submissions' ) }\n\t\t\t\t\t\t\tvalue={ email }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { email: value } );\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\taction: `mailto:${ value }`,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tsetAttributes( { method: 'post' } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The email address where form submissions will be sent. Separate multiple email addresses with a comma.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ submissionMethod !== 'email' && (\n\t\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Method' ) }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ label: 'Get', value: 'get' },\n\t\t\t\t\t\t\t{ label: 'Post', value: 'post' },\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tvalue={ method }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { method: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Select the method to use for form submissions.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tlabel={ __( 'Form action' ) }\n\t\t\t\t\t\tvalue={ action }\n\t\t\t\t\t\tonChange={ ( newVal ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\taction: newVal,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The URL where the form should be submitted.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<form\n\t\t\t\t{ ...innerBlocksProps }\n\t\t\t\tclassName=\"wp-block-form\"\n\t\t\t\tencType={ submissionMethod === 'email' ? 'text/plain' : null }\n\t\t\t/>\n\t\t</>\n\t);\n};\nexport default Edit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAMA,MAAMK,cAAc,GAAG,CACtB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,yBAAyB,EACzB,mCAAmC,
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blockEditor","_components","_data","_utils","ALLOWED_BLOCKS","TEMPLATE","formSubmissionNotificationSuccess","formSubmissionNotificationError","type","label","__","required","Edit","attributes","setAttributes","clientId","action","method","email","submissionMethod","blockProps","useBlockProps","hasInnerBlocks","useSelect","select","getBlock","blockEditorStore","block","innerBlocks","length","innerBlocksProps","useInnerBlocksProps","allowedBlocks","template","renderAppender","undefined","InnerBlocks","ButtonBlockAppender","_react","createElement","Fragment","InspectorControls","PanelBody","title","SelectControl","options","value","onChange","help","TextControl","__nextHasNoMarginBottom","autoComplete","group","newVal","className","encType","_default","exports","default"],"sources":["@wordpress/block-library/src/form/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { TextControl, SelectControl, PanelBody } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n} from './utils.js';\n\nconst ALLOWED_BLOCKS = [\n\t'core/paragraph',\n\t'core/heading',\n\t'core/form-input',\n\t'core/form-submit-button',\n\t'core/form-submission-notification',\n\t'core/group',\n\t'core/columns',\n];\n\nconst TEMPLATE = [\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'text',\n\t\t\tlabel: __( 'Name' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'email',\n\t\t\tlabel: __( 'Email' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'textarea',\n\t\t\tlabel: __( 'Comment' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[ 'core/form-submit-button', {} ],\n];\n\nconst Edit = ( { attributes, setAttributes, clientId } ) => {\n\tconst { action, method, email, submissionMethod } = attributes;\n\tconst blockProps = useBlockProps();\n\n\tconst { hasInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\ttemplate: TEMPLATE,\n\t\trenderAppender: hasInnerBlocks\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t// __nextHasNoMarginBottom\n\t\t\t\t\t\t// size={ '__unstable-large' }\n\t\t\t\t\t\tlabel={ __( 'Submissions method' ) }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t// TODO: Allow plugins to add their own submission methods.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Send email' ),\n\t\t\t\t\t\t\t\tvalue: 'email',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( '- Custom -' ),\n\t\t\t\t\t\t\t\tvalue: 'custom',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tvalue={ submissionMethod }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { submissionMethod: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tsubmissionMethod === 'custom'\n\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t'Select the method to use for form submissions. Additional options for the \"custom\" mode can be found in the \"Advanced\" section.'\n\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\t\t\t'Select the method to use for form submissions.'\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ submissionMethod === 'email' && (\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tlabel={ __( 'Email for form submissions' ) }\n\t\t\t\t\t\t\tvalue={ email }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { email: value } );\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\taction: `mailto:${ value }`,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tsetAttributes( { method: 'post' } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The email address where form submissions will be sent. Separate multiple email addresses with a comma.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ submissionMethod !== 'email' && (\n\t\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Method' ) }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ label: 'Get', value: 'get' },\n\t\t\t\t\t\t\t{ label: 'Post', value: 'post' },\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tvalue={ method }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { method: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Select the method to use for form submissions.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tlabel={ __( 'Form action' ) }\n\t\t\t\t\t\tvalue={ action }\n\t\t\t\t\t\tonChange={ ( newVal ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\taction: newVal,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The URL where the form should be submitted.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<form\n\t\t\t\t{ ...innerBlocksProps }\n\t\t\t\tclassName=\"wp-block-form\"\n\t\t\t\tencType={ submissionMethod === 'email' ? 'text/plain' : null }\n\t\t\t/>\n\t\t</>\n\t);\n};\nexport default Edit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAMA,MAAMK,cAAc,GAAG,CACtB,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