@wordpress/block-library 9.10.0 → 9.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +10 -5
- package/build/archives/index.js +6 -0
- package/build/archives/index.js.map +1 -1
- package/build/avatar/hooks.js +2 -3
- package/build/avatar/hooks.js.map +1 -1
- package/build/button/get-updated-link-attributes.js +1 -1
- package/build/button/get-updated-link-attributes.js.map +1 -1
- package/build/comments/index.js +12 -0
- package/build/comments/index.js.map +1 -1
- package/build/cover/constants.js +8 -0
- package/build/cover/constants.js.map +1 -0
- package/build/cover/edit/index.js +24 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +40 -2
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +3 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +3 -1
- package/build/cover/save.js.map +1 -1
- package/build/file/edit.js +1 -2
- package/build/file/edit.js.map +1 -1
- package/build/gallery/constants.js +2 -1
- package/build/gallery/constants.js.map +1 -1
- package/build/gallery/edit.js +11 -2
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/utils.js +26 -5
- package/build/gallery/utils.js.map +1 -1
- package/build/html/edit.js +5 -1
- package/build/html/edit.js.map +1 -1
- package/build/html/preview.js +2 -2
- package/build/html/preview.js.map +1 -1
- package/build/latest-posts/edit.js +3 -8
- package/build/latest-posts/edit.js.map +1 -1
- package/build/navigation/edit/index.js +23 -2
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +1 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +2 -2
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/paragraph/edit.js +1 -1
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-time-to-read/edit.js +2 -2
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/query/edit/inspector-controls/order-control.js +2 -2
- package/build/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build/query-title/edit.js +1 -1
- package/build/query-title/edit.js.map +1 -1
- package/build/search/edit.js +19 -14
- package/build/search/edit.js.map +1 -1
- package/build/separator/transforms.js +12 -0
- package/build/separator/transforms.js.map +1 -1
- package/build/social-links/edit.js +0 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/spacer/index.js +2 -0
- package/build/spacer/index.js.map +1 -1
- package/build/spacer/transforms.js +27 -0
- package/build/spacer/transforms.js.map +1 -0
- package/build/table/edit.js +0 -1
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +2 -7
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/template-part/edit/index.js +1 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/video/tracks-editor.js +1 -1
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/index.js +6 -0
- package/build-module/archives/index.js.map +1 -1
- package/build-module/avatar/hooks.js +2 -3
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/button/get-updated-link-attributes.js +1 -1
- package/build-module/button/get-updated-link-attributes.js.map +1 -1
- package/build-module/comments/index.js +12 -0
- package/build-module/comments/index.js.map +1 -1
- package/build-module/cover/constants.js +2 -0
- package/build-module/cover/constants.js.map +1 -0
- package/build-module/cover/edit/index.js +24 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +41 -3
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/index.js +3 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +3 -1
- package/build-module/cover/save.js.map +1 -1
- package/build-module/file/edit.js +1 -2
- package/build-module/file/edit.js.map +1 -1
- package/build-module/gallery/constants.js +1 -0
- package/build-module/gallery/constants.js.map +1 -1
- package/build-module/gallery/edit.js +14 -5
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/utils.js +27 -6
- package/build-module/gallery/utils.js.map +1 -1
- package/build-module/html/edit.js +6 -2
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/preview.js +2 -2
- package/build-module/html/preview.js.map +1 -1
- package/build-module/latest-posts/edit.js +3 -8
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/navigation/edit/index.js +23 -2
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +1 -3
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +2 -2
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/paragraph/edit.js +1 -1
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +1 -1
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-time-to-read/edit.js +2 -2
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/query/edit/inspector-controls/order-control.js +2 -2
- package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build-module/query-title/edit.js +2 -2
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/search/edit.js +20 -15
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/transforms.js +12 -0
- package/build-module/separator/transforms.js.map +1 -1
- package/build-module/social-links/edit.js +0 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/spacer/index.js +2 -0
- package/build-module/spacer/index.js.map +1 -1
- package/build-module/spacer/transforms.js +20 -0
- package/build-module/spacer/transforms.js.map +1 -0
- package/build-module/table/edit.js +0 -1
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +2 -7
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/video/tracks-editor.js +2 -2
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/archives/editor-rtl.css +5 -0
- package/build-style/archives/editor.css +5 -0
- package/build-style/button/style-rtl.css +3 -0
- package/build-style/button/style.css +3 -0
- package/build-style/comments/editor-rtl.css +4 -0
- package/build-style/comments/editor.css +4 -0
- package/build-style/comments/style-rtl.css +4 -0
- package/build-style/comments/style.css +4 -0
- package/build-style/cover/style-rtl.css +5 -0
- package/build-style/cover/style.css +5 -0
- package/build-style/editor-rtl.css +20 -0
- package/build-style/editor.css +20 -0
- package/build-style/group/editor-rtl.css +10 -0
- package/build-style/group/editor.css +10 -0
- package/build-style/image/style-rtl.css +2 -0
- package/build-style/image/style.css +2 -0
- package/build-style/navigation/editor-rtl.css +1 -0
- package/build-style/navigation/editor.css +1 -0
- package/build-style/style-rtl.css +14 -0
- package/build-style/style.css +14 -0
- package/package.json +36 -35
- package/src/archives/block.json +6 -0
- package/src/archives/editor.scss +8 -0
- package/src/avatar/hooks.js +2 -3
- package/src/avatar/index.php +4 -5
- package/src/button/get-updated-link-attributes.js +1 -1
- package/src/button/style.scss +3 -0
- package/src/button/test/get-updated-link-attributes.js +15 -0
- package/src/comment-author-avatar/index.php +1 -1
- package/src/comments/block.json +21 -3
- package/src/comments/style.scss +4 -1
- package/src/cover/block.json +3 -0
- package/src/cover/constants.js +1 -0
- package/src/cover/edit/index.js +20 -2
- package/src/cover/edit/inspector-controls.js +46 -1
- package/src/cover/save.js +2 -0
- package/src/cover/style.scss +6 -0
- package/src/cover/test/edit.js +1 -3
- package/src/file/edit.js +1 -2
- package/src/gallery/constants.js +1 -0
- package/src/gallery/edit.js +25 -2
- package/src/gallery/utils.js +23 -2
- package/src/group/editor.scss +12 -0
- package/src/html/edit.js +7 -1
- package/src/html/preview.js +3 -2
- package/src/image/style.scss +1 -0
- package/src/latest-posts/edit.js +3 -7
- package/src/latest-posts/index.php +1 -1
- package/src/navigation/edit/index.js +30 -3
- package/src/navigation/edit/menu-inspector-controls.js +2 -2
- package/src/navigation/edit/navigation-menu-selector.js +2 -2
- package/src/navigation/editor.scss +1 -0
- package/src/paragraph/edit.js +1 -1
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-time-to-read/edit.js +2 -2
- package/src/post-time-to-read/index.php +1 -1
- package/src/query/edit/inspector-controls/order-control.js +2 -2
- package/src/query-title/edit.js +2 -2
- package/src/rss/index.php +1 -1
- package/src/search/edit.js +28 -25
- package/src/separator/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/separator/test/transforms.native.js +1 -1
- package/src/separator/transforms.js +11 -0
- package/src/social-links/edit.js +0 -1
- package/src/spacer/index.js +2 -0
- package/src/spacer/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/spacer/test/transforms.native.js +1 -1
- package/src/spacer/transforms.js +20 -0
- package/src/table/edit.js +0 -1
- package/src/table-of-contents/edit.js +2 -6
- package/src/template-part/edit/index.js +1 -1
- package/src/video/tracks-editor.js +2 -2
package/build/search/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_element","_components","_compose","_icons","_i18n","_dom","_icons2","_utils","_jsxRuntime","DEFAULT_INNER_PADDING","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","useSelect","select","getBlockParentsByBlockName","wasBlockJustInserted","blockEditorStore","length","__unstableMarkNextChangeAsNotPersistent","useDispatch","useEffect","borderRadius","border","radius","borderProps","useBorderProps","colorProps","useColorProps","fluidTypographySettings","layout","useSettings","typographyProps","useTypographyProps","typography","fluid","wideSize","unitControlInstanceId","useInstanceId","UnitControl","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","useRef","buttonRef","units","useCustomUnits","availableUnits","defaultValues","PC_WIDTH_DEFAULT","px","PX_WIDTH_DEFAULT","getBlockClassNames","clsx","undefined","buttonPositionControls","role","title","__","isActive","icon","buttonOutside","onClick","buttonInside","noButton","buttonOnly","getButtonPositionIcon","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","jsx","type","value","onChange","event","target","ref","renderButton","buttonClasses","__experimentalGetElementClassName","buttonStyles","handleButtonClick","jsxs","Fragment","children","stripHTML","Icon","search","RichText","identifier","withoutInteractiveFormatting","html","controls","BlockControls","ToolbarGroup","ToolbarButton","toggleLabel","ToolbarDropdownMenu","buttonWithIcon","InspectorControls","PanelBody","__experimentalVStack","spacing","__experimentalUnitControl","__next40pxDefaultSize","id","min","isPercentageUnit","MIN_WIDTH","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","ButtonGroup","map","widthValue","Button","size","variant","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","useBlockProps","labelClassnames","ResizableBox","height","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tButton,\n\tButtonGroup,\n\tToolbarButton,\n\tResizableBox,\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tbuttonOnly,\n\tbuttonOutside,\n\tbuttonInside,\n\tnoButton,\n\tbuttonWithIcon,\n\ttoggleLabel,\n} from './icons';\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst wasJustInsertedIntoNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( wasJustInsertedIntoNavigationBlock ) {\n\t\t\t// This side-effect should not create an undo level.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tshowLabel: false,\n\t\t\t\tbuttonUseIcon: true,\n\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t} );\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\twasJustInsertedIntoNavigationBlock,\n\t\tsetAttributes,\n\t] );\n\n\tconst borderRadius = style?.border?.radius;\n\tlet borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps = {\n\t\t\t...borderProps,\n\t\t\tstyle: {\n\t\t\t\t...borderProps.style,\n\t\t\t\tborderRadius: `${ borderRadius }px`,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst colorProps = useColorProps( attributes );\n\tconst [ fluidTypographySettings, layout ] = useSettings(\n\t\t'typography.fluid',\n\t\t'layout'\n\t);\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn clsx(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button outside' ),\n\t\t\tisActive: buttonPosition === 'button-outside',\n\t\t\ticon: buttonOutside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button inside' ),\n\t\t\tisActive: buttonPosition === 'button-inside',\n\t\t\ticon: buttonInside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'No button' ),\n\t\t\tisActive: buttonPosition === 'no-button',\n\t\t\ticon: noButton,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'no-button',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button only' ),\n\t\t\tisActive: buttonPosition === 'button-only',\n\t\t\ticon: buttonOnly,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-only',\n\t\t\t\t\tisSearchFieldHidden: true,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t];\n\n\tconst getButtonPositionIcon = () => {\n\t\tswitch ( buttonPosition ) {\n\t\t\tcase 'button-inside':\n\t\t\t\treturn buttonInside;\n\t\t\tcase 'button-outside':\n\t\t\t\treturn buttonOutside;\n\t\t\tcase 'no-button':\n\t\t\t\treturn noButton;\n\t\t\tcase 'button-only':\n\t\t\t\treturn buttonOnly;\n\t\t}\n\t};\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = clsx(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t\t...typographyProps.style,\n\t\t\ttextDecoration: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName={ textFieldClasses }\n\t\t\t\tstyle={ textFieldStyles }\n\t\t\t\taria-label={ __( 'Optional placeholder text' ) }\n\t\t\t\t// We hide the placeholder field's placeholder when there is a value. This\n\t\t\t\t// stops screen readers from reading the placeholder field's placeholder\n\t\t\t\t// which is confusing.\n\t\t\t\tplaceholder={\n\t\t\t\t\tplaceholder ? undefined : __( 'Optional placeholder…' )\n\t\t\t\t}\n\t\t\t\tvalue={ placeholder }\n\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\tsetAttributes( { placeholder: event.target.value } )\n\t\t\t\t}\n\t\t\t\tref={ searchFieldRef }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderButton = () => {\n\t\t// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.\n\t\tconst buttonClasses = clsx(\n\t\t\t'wp-block-search__button',\n\t\t\tcolorProps.className,\n\t\t\ttypographyProps.className,\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\tbuttonUseIcon ? 'has-icon' : undefined,\n\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t);\n\t\tconst buttonStyles = {\n\t\t\t...colorProps.style,\n\t\t\t...typographyProps.style,\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t};\n\t\tconst handleButtonClick = () => {\n\t\t\tif ( hasOnlyButton ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisSearchFieldHidden: ! isSearchFieldHidden,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ buttonUseIcon && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\tbuttonText\n\t\t\t\t\t\t\t\t? stripHTML( buttonText )\n\t\t\t\t\t\t\t\t: __( 'Search' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t\tref={ buttonRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ search } />\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\n\t\t\t\t{ ! buttonUseIcon && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"buttonText\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add button text…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ buttonText }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { buttonText: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Toggle search label' ) }\n\t\t\t\t\t\ticon={ toggleLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: ! showLabel,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName={ showLabel ? 'is-pressed' : undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\ticon={ getButtonPositionIcon() }\n\t\t\t\t\t\tlabel={ __( 'Change button position' ) }\n\t\t\t\t\t\tcontrols={ buttonPositionControls }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! hasNoButton && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ttitle={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\ticon={ buttonWithIcon }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: ! buttonUseIcon,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\tbuttonUseIcon ? 'is-pressed' : undefined\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</ToolbarGroup>\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tclassName=\"wp-block-search__inspector-controls\"\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tid={ unitControlInputId } // unused, kept for backwards compatibility\n\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 0 : MIN_WIDTH\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 100 : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\tconst parsedNewWidth =\n\t\t\t\t\t\t\t\t\tnewWidth === ''\n\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t: parseInt( newWidth, 10 );\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth: parsedNewWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\t\t\t\t\t\t\t\t\t\t? PC_WIDTH_DEFAULT\n\t\t\t\t\t\t\t\t\t\t\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ButtonGroup\n\t\t\t\t\t\t\tclassName=\"wp-block-search__components-button-group\" // unused, kept for backwards compatibility\n\t\t\t\t\t\t\taria-label={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\twidthValue === width &&\n\t\t\t\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'primary'\n\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: widthValue,\n\t\t\t\t\t\t\t\t\t\t\t\twidthUnit: '%',\n\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ widthValue }%\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tradius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;\n\n\tconst getWrapperStyles = () => {\n\t\tconst styles = isButtonPositionInside\n\t\t\t? borderProps.style\n\t\t\t: {\n\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\tborderTopLeftRadius: borderProps.style?.borderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t };\n\n\t\tconst isNonZeroBorderRadius =\n\t\t\tborderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;\n\n\t\tif ( isButtonPositionInside && isNonZeroBorderRadius ) {\n\t\t\t// We have button inside wrapper and a border radius value to apply.\n\t\t\t// Add default padding so we don't get \"fat\" corners.\n\t\t\t//\n\t\t\t// CSS calc() is used here to support non-pixel units. The inline\n\t\t\t// style using calc() will only apply if both values have units.\n\n\t\t\tif ( typeof borderRadius === 'object' ) {\n\t\t\t\t// Individual corner border radii present.\n\t\t\t\tconst { topLeft, topRight, bottomLeft, bottomRight } =\n\t\t\t\t\tborderRadius;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( topLeft ),\n\t\t\t\t\tborderTopRightRadius: padBorderRadius( topRight ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius( bottomLeft ),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius( bottomRight ),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// The inline style using calc() will only apply if both values\n\t\t\t// supplied to calc() have units. Deprecated block's may have\n\t\t\t// unitless integer.\n\t\t\tconst radius = Number.isInteger( borderRadius )\n\t\t\t\t? `${ borderRadius }px`\n\t\t\t\t: borderRadius;\n\n\t\t\tstyles.borderRadius = `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`;\n\t\t}\n\n\t\treturn styles;\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: getBlockClassNames(),\n\t\tstyle: {\n\t\t\t...typographyProps.style,\n\t\t\t// Input opts out of text decoration.\n\t\t\ttextDecoration: undefined,\n\t\t},\n\t} );\n\n\tconst labelClassnames = clsx(\n\t\t'wp-block-search__label',\n\t\ttypographyProps.className\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\n\t\t\t{ showLabel && (\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\tclassName={ labelClassnames }\n\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add label…' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( html ) => setAttributes( { label: html } ) }\n\t\t\t\t\tstyle={ typographyProps.style }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth:\n\t\t\t\t\t\twidth === undefined\n\t\t\t\t\t\t\t? 'auto'\n\t\t\t\t\t\t\t: `${ width }${ widthUnit }`,\n\t\t\t\t\theight: 'auto',\n\t\t\t\t} }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'wp-block-search__inside-wrapper',\n\t\t\t\t\tisButtonPositionInside ? borderProps.className : undefined\n\t\t\t\t) }\n\t\t\t\tstyle={ getWrapperStyles() }\n\t\t\t\tminWidth={ MIN_WIDTH }\n\t\t\t\tenable={ getResizableSides() }\n\t\t\t\tonResizeStart={ ( event, direction, elt ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( elt.offsetWidth, 10 ),\n\t\t\t\t\t\twidthUnit: 'px',\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( width + delta.width, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t>\n\t\t\t\t{ ( isButtonPositionInside ||\n\t\t\t\t\tisButtonPositionOutside ||\n\t\t\t\t\thasOnlyButton ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ renderTextField() }\n\t\t\t\t\t\t{ renderButton() }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ hasNoButton && renderTextField() }\n\t\t\t</ResizableBox>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAYA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAYA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GAAAR,OAAA;AAKA,IAAAS,OAAA,GAAAT,OAAA;AAQA,IAAAU,MAAA,GAAAV,OAAA;AAKoB,IAAAW,WAAA,GAAAX,OAAA;AAvDpB;AACA;AACA;;AAGA;AACA;AACA;;AAgCA;AACA;AACA;;AAgBA;AACA;AACA,MAAMY,qBAAqB,GAAG,KAAK;AAEpB,SAASC,UAAUA,CAAE;EACnCC,SAAS;EACTC,UAAU;EACVC,aAAa;EACbC,eAAe;EACfC,UAAU;EACVC;AACD,CAAC,EAAG;EAC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element","_components","_compose","_icons","_i18n","_dom","_icons2","_utils","_jsxRuntime","DEFAULT_INNER_PADDING","PERCENTAGE_WIDTHS","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","useSelect","select","getBlockParentsByBlockName","wasBlockJustInserted","blockEditorStore","length","__unstableMarkNextChangeAsNotPersistent","useDispatch","useEffect","borderRadius","border","radius","borderProps","useBorderProps","colorProps","useColorProps","fluidTypographySettings","layout","useSettings","typographyProps","useTypographyProps","typography","fluid","wideSize","unitControlInstanceId","useInstanceId","UnitControl","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","useRef","buttonRef","units","useCustomUnits","availableUnits","defaultValues","PC_WIDTH_DEFAULT","px","PX_WIDTH_DEFAULT","getBlockClassNames","clsx","undefined","buttonPositionControls","role","title","__","isActive","icon","buttonOutside","onClick","buttonInside","noButton","buttonOnly","getButtonPositionIcon","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","jsx","type","value","onChange","event","target","ref","renderButton","buttonClasses","__experimentalGetElementClassName","buttonStyles","handleButtonClick","jsxs","Fragment","children","stripHTML","Icon","search","RichText","identifier","withoutInteractiveFormatting","html","controls","BlockControls","ToolbarGroup","ToolbarButton","toggleLabel","ToolbarDropdownMenu","buttonWithIcon","InspectorControls","PanelBody","__experimentalVStack","spacing","__experimentalUnitControl","__next40pxDefaultSize","id","min","isPercentageUnit","MIN_WIDTH","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","__experimentalToggleGroupControl","includes","hideLabelFromVision","isBlock","__nextHasNoMarginBottom","map","widthValue","__experimentalToggleGroupControlOption","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","useBlockProps","labelClassnames","ResizableBox","size","height","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tToolbarButton,\n\tResizableBox,\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tbuttonOnly,\n\tbuttonOutside,\n\tbuttonInside,\n\tnoButton,\n\tbuttonWithIcon,\n\ttoggleLabel,\n} from './icons';\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\nconst PERCENTAGE_WIDTHS = [ 25, 50, 75, 100 ];\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst wasJustInsertedIntoNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( wasJustInsertedIntoNavigationBlock ) {\n\t\t\t// This side-effect should not create an undo level.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tshowLabel: false,\n\t\t\t\tbuttonUseIcon: true,\n\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t} );\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\twasJustInsertedIntoNavigationBlock,\n\t\tsetAttributes,\n\t] );\n\n\tconst borderRadius = style?.border?.radius;\n\tlet borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps = {\n\t\t\t...borderProps,\n\t\t\tstyle: {\n\t\t\t\t...borderProps.style,\n\t\t\t\tborderRadius: `${ borderRadius }px`,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst colorProps = useColorProps( attributes );\n\tconst [ fluidTypographySettings, layout ] = useSettings(\n\t\t'typography.fluid',\n\t\t'layout'\n\t);\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn clsx(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button outside' ),\n\t\t\tisActive: buttonPosition === 'button-outside',\n\t\t\ticon: buttonOutside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button inside' ),\n\t\t\tisActive: buttonPosition === 'button-inside',\n\t\t\ticon: buttonInside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'No button' ),\n\t\t\tisActive: buttonPosition === 'no-button',\n\t\t\ticon: noButton,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'no-button',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button only' ),\n\t\t\tisActive: buttonPosition === 'button-only',\n\t\t\ticon: buttonOnly,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-only',\n\t\t\t\t\tisSearchFieldHidden: true,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t];\n\n\tconst getButtonPositionIcon = () => {\n\t\tswitch ( buttonPosition ) {\n\t\t\tcase 'button-inside':\n\t\t\t\treturn buttonInside;\n\t\t\tcase 'button-outside':\n\t\t\t\treturn buttonOutside;\n\t\t\tcase 'no-button':\n\t\t\t\treturn noButton;\n\t\t\tcase 'button-only':\n\t\t\t\treturn buttonOnly;\n\t\t}\n\t};\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = clsx(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t\t...typographyProps.style,\n\t\t\ttextDecoration: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName={ textFieldClasses }\n\t\t\t\tstyle={ textFieldStyles }\n\t\t\t\taria-label={ __( 'Optional placeholder text' ) }\n\t\t\t\t// We hide the placeholder field's placeholder when there is a value. This\n\t\t\t\t// stops screen readers from reading the placeholder field's placeholder\n\t\t\t\t// which is confusing.\n\t\t\t\tplaceholder={\n\t\t\t\t\tplaceholder ? undefined : __( 'Optional placeholder…' )\n\t\t\t\t}\n\t\t\t\tvalue={ placeholder }\n\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\tsetAttributes( { placeholder: event.target.value } )\n\t\t\t\t}\n\t\t\t\tref={ searchFieldRef }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderButton = () => {\n\t\t// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.\n\t\tconst buttonClasses = clsx(\n\t\t\t'wp-block-search__button',\n\t\t\tcolorProps.className,\n\t\t\ttypographyProps.className,\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\tbuttonUseIcon ? 'has-icon' : undefined,\n\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t);\n\t\tconst buttonStyles = {\n\t\t\t...colorProps.style,\n\t\t\t...typographyProps.style,\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t};\n\t\tconst handleButtonClick = () => {\n\t\t\tif ( hasOnlyButton ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisSearchFieldHidden: ! isSearchFieldHidden,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ buttonUseIcon && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\tbuttonText\n\t\t\t\t\t\t\t\t? stripHTML( buttonText )\n\t\t\t\t\t\t\t\t: __( 'Search' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t\tref={ buttonRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ search } />\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\n\t\t\t\t{ ! buttonUseIcon && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"buttonText\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add button text…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ buttonText }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { buttonText: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Show search label' ) }\n\t\t\t\t\t\ticon={ toggleLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: ! showLabel,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName={ showLabel ? 'is-pressed' : undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\ticon={ getButtonPositionIcon() }\n\t\t\t\t\t\tlabel={ __( 'Change button position' ) }\n\t\t\t\t\t\tcontrols={ buttonPositionControls }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! hasNoButton && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ttitle={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\ticon={ buttonWithIcon }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: ! buttonUseIcon,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\tbuttonUseIcon ? 'is-pressed' : undefined\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</ToolbarGroup>\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tclassName=\"wp-block-search__inspector-controls\"\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tid={ unitControlInputId } // unused, kept for backwards compatibility\n\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 0 : MIN_WIDTH\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 100 : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\tconst parsedNewWidth =\n\t\t\t\t\t\t\t\t\tnewWidth === ''\n\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t: parseInt( newWidth, 10 );\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth: parsedNewWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\t\t\t\t\t\t\t\t\t\t? PC_WIDTH_DEFAULT\n\t\t\t\t\t\t\t\t\t\t\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\tlabel={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tPERCENTAGE_WIDTHS.includes( width ) &&\n\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t? width\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\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth: newWidth,\n\t\t\t\t\t\t\t\t\twidthUnit: '%',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ PERCENTAGE_WIDTHS.map( ( widthValue ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\t\t\tlabel={ `${ widthValue }%` }\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</ToggleGroupControl>\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tradius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;\n\n\tconst getWrapperStyles = () => {\n\t\tconst styles = isButtonPositionInside\n\t\t\t? borderProps.style\n\t\t\t: {\n\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\tborderTopLeftRadius: borderProps.style?.borderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t };\n\n\t\tconst isNonZeroBorderRadius =\n\t\t\tborderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;\n\n\t\tif ( isButtonPositionInside && isNonZeroBorderRadius ) {\n\t\t\t// We have button inside wrapper and a border radius value to apply.\n\t\t\t// Add default padding so we don't get \"fat\" corners.\n\t\t\t//\n\t\t\t// CSS calc() is used here to support non-pixel units. The inline\n\t\t\t// style using calc() will only apply if both values have units.\n\n\t\t\tif ( typeof borderRadius === 'object' ) {\n\t\t\t\t// Individual corner border radii present.\n\t\t\t\tconst { topLeft, topRight, bottomLeft, bottomRight } =\n\t\t\t\t\tborderRadius;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( topLeft ),\n\t\t\t\t\tborderTopRightRadius: padBorderRadius( topRight ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius( bottomLeft ),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius( bottomRight ),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// The inline style using calc() will only apply if both values\n\t\t\t// supplied to calc() have units. Deprecated block's may have\n\t\t\t// unitless integer.\n\t\t\tconst radius = Number.isInteger( borderRadius )\n\t\t\t\t? `${ borderRadius }px`\n\t\t\t\t: borderRadius;\n\n\t\t\tstyles.borderRadius = `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`;\n\t\t}\n\n\t\treturn styles;\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: getBlockClassNames(),\n\t\tstyle: {\n\t\t\t...typographyProps.style,\n\t\t\t// Input opts out of text decoration.\n\t\t\ttextDecoration: undefined,\n\t\t},\n\t} );\n\n\tconst labelClassnames = clsx(\n\t\t'wp-block-search__label',\n\t\ttypographyProps.className\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\n\t\t\t{ showLabel && (\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\tclassName={ labelClassnames }\n\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add label…' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( html ) => setAttributes( { label: html } ) }\n\t\t\t\t\tstyle={ typographyProps.style }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth:\n\t\t\t\t\t\twidth === undefined\n\t\t\t\t\t\t\t? 'auto'\n\t\t\t\t\t\t\t: `${ width }${ widthUnit }`,\n\t\t\t\t\theight: 'auto',\n\t\t\t\t} }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'wp-block-search__inside-wrapper',\n\t\t\t\t\tisButtonPositionInside ? borderProps.className : undefined\n\t\t\t\t) }\n\t\t\t\tstyle={ getWrapperStyles() }\n\t\t\t\tminWidth={ MIN_WIDTH }\n\t\t\t\tenable={ getResizableSides() }\n\t\t\t\tonResizeStart={ ( event, direction, elt ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( elt.offsetWidth, 10 ),\n\t\t\t\t\t\twidthUnit: 'px',\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( width + delta.width, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t>\n\t\t\t\t{ ( isButtonPositionInside ||\n\t\t\t\t\tisButtonPositionOutside ||\n\t\t\t\t\thasOnlyButton ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ renderTextField() }\n\t\t\t\t\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AAGA,CAAEzE,KAAK,EAAE0E,SAAS,EAAEC,GAAG,KAAM;QAC5C/J,aAAa,CAAE;UACdO,KAAK,EAAEoH,QAAQ,CAAEoC,GAAG,CAACC,WAAW,EAAE,EAAG,CAAC;UACtCxJ,SAAS,EAAE;QACZ,CAAE,CAAC;QACHP,eAAe,CAAE,KAAM,CAAC;MACzB,CAAG;MACHgK,YAAY,EAAGA,CAAE7E,KAAK,EAAE0E,SAAS,EAAEC,GAAG,EAAEG,KAAK,KAAM;QAClDlK,aAAa,CAAE;UACdO,KAAK,EAAEoH,QAAQ,CAAEpH,KAAK,GAAG2J,KAAK,CAAC3J,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACHkK,UAAU,EAAGjK,UAAY;MAAA4F,QAAA,GAEvB,CAAElD,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb,IAAArD,WAAA,CAAAkG,IAAA,EAAAlG,WAAA,CAAAmG,QAAA;QAAAC,QAAA,GACGlB,eAAe,CAAC,CAAC,EACjBW,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAECzC,WAAW,IAAI8B,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
|
|
@@ -20,6 +20,18 @@ const transforms = {
|
|
|
20
20
|
schema: {
|
|
21
21
|
hr: {}
|
|
22
22
|
}
|
|
23
|
+
}],
|
|
24
|
+
to: [{
|
|
25
|
+
type: 'block',
|
|
26
|
+
blocks: ['core/spacer'],
|
|
27
|
+
// Transform to Spacer.
|
|
28
|
+
transform: ({
|
|
29
|
+
anchor
|
|
30
|
+
}) => {
|
|
31
|
+
return (0, _blocks.createBlock)('core/spacer', {
|
|
32
|
+
anchor: anchor || ''
|
|
33
|
+
});
|
|
34
|
+
}
|
|
23
35
|
}]
|
|
24
36
|
};
|
|
25
37
|
var _default = exports.default = transforms;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","transforms","from","type","regExp","transform","createBlock","selector","schema","hr","_default","exports","default"],"sources":["@wordpress/block-library/src/separator/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'enter',\n\t\t\tregExp: /^-{3,}$/,\n\t\t\ttransform: () => createBlock( 'core/separator' ),\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'hr',\n\t\t\tschema: {\n\t\t\t\thr: {},\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,IAAI,EAAE,CACL;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,SAAS;IACjBC,SAAS,EAAEA,CAAA,KAAM,IAAAC,mBAAW,EAAE,gBAAiB;EAChD,CAAC,EACD;IACCH,IAAI,EAAE,KAAK;IACXI,QAAQ,EAAE,IAAI;IACdC,MAAM,EAAE;MACPC,EAAE,EAAE,CAAC;IACN;EACD,CAAC;AAEH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,
|
|
1
|
+
{"version":3,"names":["_blocks","require","transforms","from","type","regExp","transform","createBlock","selector","schema","hr","to","blocks","anchor","_default","exports","default"],"sources":["@wordpress/block-library/src/separator/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'enter',\n\t\t\tregExp: /^-{3,}$/,\n\t\t\ttransform: () => createBlock( 'core/separator' ),\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'hr',\n\t\t\tschema: {\n\t\t\t\thr: {},\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/spacer' ], // Transform to Spacer.\n\t\t\ttransform: ( { anchor } ) => {\n\t\t\t\treturn createBlock( 'core/spacer', {\n\t\t\t\t\tanchor: anchor || '',\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,IAAI,EAAE,CACL;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,SAAS;IACjBC,SAAS,EAAEA,CAAA,KAAM,IAAAC,mBAAW,EAAE,gBAAiB;EAChD,CAAC,EACD;IACCH,IAAI,EAAE,KAAK;IACXI,QAAQ,EAAE,IAAI;IACdC,MAAM,EAAE;MACPC,EAAE,EAAE,CAAC;IACN;EACD,CAAC,CACD;EACDC,EAAE,EAAE,CACH;IACCP,IAAI,EAAE,OAAO;IACbQ,MAAM,EAAE,CAAE,aAAa,CAAE;IAAE;IAC3BN,SAAS,EAAEA,CAAE;MAAEO;IAAO,CAAC,KAAM;MAC5B,OAAO,IAAAN,mBAAW,EAAE,aAAa,EAAE;QAClCM,MAAM,EAAEA,MAAM,IAAI;MACnB,CAAE,CAAC;IACJ;EACD,CAAC;AAEH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,UAAU","ignoreList":[]}
|
|
@@ -79,7 +79,6 @@ function SocialLinksEdit(props) {
|
|
|
79
79
|
...backgroundBackupRef.current
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
82
|
}, [logosOnly]);
|
|
84
83
|
const SocialPlaceholder = /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
85
84
|
className: "wp-block-social-links__social-placeholder",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_components","_i18n","_icons","_data","_jsxRuntime","sizeOptions","name","__","value","SocialLinksEdit","props","_attributes$layout$or","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","hasSelectedChild","useSelect","select","blockEditorStore","hasSelectedInnerBlock","hasAnySelected","logosOnly","className","includes","backgroundBackupRef","useRef","useEffect","current","undefined","SocialPlaceholder","jsx","children","jsxs","clsx","color","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","placeholder","templateLock","orientation","layout","__experimentalAppenderTagName","renderAppender","InnerBlocks","ButtonBlockAppender","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","useMultipleOriginColorsAndGradients","Fragment","BlockControls","group","ToolbarDropdownMenu","text","icon","popoverProps","onClose","MenuGroup","map","entry","MenuItem","check","onClick","role","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","checked","hasColorsOrGradients","__experimentalColorGradientSettingsDropdown","__experimentalIsRenderedInSidebar","settings","onColorChange","isShownByDefault","enableAlpha","panelId","ContrastChecker","textColor","backgroundColor","isLargeText","iconColorAttributes","_default","exports","default","withColors"],"sources":["@wordpress/block-library/src/social-links/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst hasSelectedChild = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackupRef = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackupRef.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackupRef.current } );\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tplaceholder: ! isSelected && SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\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\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\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{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\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\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\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\t{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\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<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAYA,IAAAG,WAAA,GAAAH,OAAA;AAOA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAA4C,IAAAO,WAAA,GAAAP,OAAA;AA9B5C;AACA;AACA;;AAGA;AACA;AACA;;AAyBA,MAAMQ,WAAW,GAAG,CACnB;EAAEC,IAAI,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EAAEC,KAAK,EAAE;AAAsB,CAAC,EACrD;EAAEF,IAAI,EAAE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AAA,CAAAqC,GAAA;MAAA,GAASO;IAAgB,CAAI,CAAC;EAAA,CAC7B,CAAC;AAEL;AAEA,MAAMqD,mBAAmB,GAAG;EAC3BtF,SAAS,EAAE,YAAY;EACvBD,mBAAmB,EAAE;AACtB,CAAC;AAAC,IAAAwF,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,uBAAU,EAAEJ,mBAAoB,CAAC,CAAE5F,eAAgB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_components","_i18n","_icons","_data","_jsxRuntime","sizeOptions","name","__","value","SocialLinksEdit","props","_attributes$layout$or","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","hasSelectedChild","useSelect","select","blockEditorStore","hasSelectedInnerBlock","hasAnySelected","logosOnly","className","includes","backgroundBackupRef","useRef","useEffect","current","undefined","SocialPlaceholder","jsx","children","jsxs","clsx","color","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","placeholder","templateLock","orientation","layout","__experimentalAppenderTagName","renderAppender","InnerBlocks","ButtonBlockAppender","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","useMultipleOriginColorsAndGradients","Fragment","BlockControls","group","ToolbarDropdownMenu","text","icon","popoverProps","onClose","MenuGroup","map","entry","MenuItem","check","onClick","role","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","checked","hasColorsOrGradients","__experimentalColorGradientSettingsDropdown","__experimentalIsRenderedInSidebar","settings","onColorChange","isShownByDefault","enableAlpha","panelId","ContrastChecker","textColor","backgroundColor","isLargeText","iconColorAttributes","_default","exports","default","withColors"],"sources":["@wordpress/block-library/src/social-links/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst hasSelectedChild = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackupRef = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackupRef.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackupRef.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tplaceholder: ! isSelected && SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\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\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\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{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\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\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\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\t{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\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<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAYA,IAAAG,WAAA,GAAAH,OAAA;AAOA,I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OAAO,EAAGpF,QAAU;QAAA,GACfsD;MAAqB,GAbpB,sBAAuBH,KAAK,EAclC,CAEH,CAAC,EACC,CAAE/B,SAAS,iBACZ,IAAA5B,WAAA,CAAAqC,GAAA,EAAC1C,YAAA,CAAAkG,eAAe;QAEdC,SAAS,EAAE5E,cAAc;QACzB6E,eAAe,EAAE/E,wBAAwB;QAE1CgF,WAAW,EAAG;MAAO,CACrB,CACD;IAAA,CACiB,CACnB,eACD,IAAAhG,WAAA,CAAAqC,GAAA;MAAA,GAASO;IAAgB,CAAI,CAAC;EAAA,CAC7B,CAAC;AAEL;AAEA,MAAMqD,mBAAmB,GAAG;EAC3BtF,SAAS,EAAE,YAAY;EACvBD,mBAAmB,EAAE;AACtB,CAAC;AAAC,IAAAwF,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,uBAAU,EAAEJ,mBAAoB,CAAC,CAAE5F,eAAgB,CAAC","ignoreList":[]}
|
package/build/spacer/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var _icons = require("@wordpress/icons");
|
|
|
9
9
|
var _initBlock = _interopRequireDefault(require("../utils/init-block"));
|
|
10
10
|
var _deprecated = _interopRequireDefault(require("./deprecated"));
|
|
11
11
|
var _edit = _interopRequireDefault(require("./edit"));
|
|
12
|
+
var _transforms = _interopRequireDefault(require("./transforms"));
|
|
12
13
|
var _save = _interopRequireDefault(require("./save"));
|
|
13
14
|
/**
|
|
14
15
|
* WordPress dependencies
|
|
@@ -55,6 +56,7 @@ const {
|
|
|
55
56
|
exports.name = name;
|
|
56
57
|
const settings = exports.settings = {
|
|
57
58
|
icon: _icons.resizeCornerNE,
|
|
59
|
+
transforms: _transforms.default,
|
|
58
60
|
edit: _edit.default,
|
|
59
61
|
save: _save.default,
|
|
60
62
|
deprecated: _deprecated.default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","height","type","width","usesContext","supports","anchor","spacing","margin","__experimentalDefaultControls","interactivity","clientNavigation","editorStyle","style","settings","icon","edit","save","deprecated","init","initBlock"],"sources":["@wordpress/block-library/src/spacer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { resizeCornerNE as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_deprecated","_edit","_transforms","_save","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","height","type","width","usesContext","supports","anchor","spacing","margin","__experimentalDefaultControls","interactivity","clientNavigation","editorStyle","style","settings","icon","transforms","edit","save","deprecated","init","initBlock"],"sources":["@wordpress/block-library/src/spacer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { resizeCornerNE as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport transforms from './transforms';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAA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true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _blocks = require("@wordpress/blocks");
|
|
8
|
+
/**
|
|
9
|
+
* WordPress dependencies
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const transforms = {
|
|
13
|
+
to: [{
|
|
14
|
+
type: 'block',
|
|
15
|
+
blocks: ['core/separator'],
|
|
16
|
+
// Transform to Separator.
|
|
17
|
+
transform: ({
|
|
18
|
+
anchor
|
|
19
|
+
}) => {
|
|
20
|
+
return (0, _blocks.createBlock)('core/separator', {
|
|
21
|
+
anchor: anchor || ''
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}]
|
|
25
|
+
};
|
|
26
|
+
var _default = exports.default = transforms;
|
|
27
|
+
//# sourceMappingURL=transforms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_blocks","require","transforms","to","type","blocks","transform","anchor","createBlock","_default","exports","default"],"sources":["@wordpress/block-library/src/spacer/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/separator' ], // Transform to Separator.\n\t\t\ttransform: ( { anchor } ) => {\n\t\t\t\treturn createBlock( 'core/separator', {\n\t\t\t\t\tanchor: anchor || '',\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,EAAE,EAAE,CACH;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,gBAAgB,CAAE;IAAE;IAC9BC,SAAS,EAAEA,CAAE;MAAEC;IAAO,CAAC,KAAM;MAC5B,OAAO,IAAAC,mBAAW,EAAE,gBAAgB,EAAE;QACrCD,MAAM,EAAEA,MAAM,IAAI;MACnB,CAAE,CAAC;IACJ;EACD,CAAC;AAEH,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaT,UAAU","ignoreList":[]}
|
package/build/table/edit.js
CHANGED
|
@@ -391,7 +391,6 @@ function TableEdit({
|
|
|
391
391
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
|
|
392
392
|
group: "other",
|
|
393
393
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarDropdownMenu, {
|
|
394
|
-
hasArrowIndicator: true,
|
|
395
394
|
icon: _icons.table,
|
|
396
395
|
label: (0, _i18n.__)('Edit table'),
|
|
397
396
|
controls: tableControls
|
package/build/table/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_i18n","_components","_icons","_state","_caption","_jsxRuntime","ALIGNMENT_CONTROLS","icon","alignLeft","title","__","align","alignCenter","alignRight","cellAriaLabel","head","body","foot","placeholder","TSection","name","props","TagName","jsx","TableEdit","attributes","setAttributes","insertBlocksAfter","isSelected","isSingleSelected","hasFixedLayout","initialRowCount","setInitialRowCount","useState","initialColumnCount","setInitialColumnCount","selectedCell","setSelectedCell","colorProps","useColorProps","borderProps","useBorderProps","tableRef","useRef","hasTableCreated","setHasTableCreated","onChangeInitialColumnCount","count","onChangeInitialRowCount","onCreateTable","event","preventDefault","createTable","rowCount","parseInt","columnCount","onChangeFixedLayout","onChange","content","updateSelectedCell","cellAttributes","onChangeColumnAlignment","columnSelection","type","columnIndex","newAttributes","getCellAlignment","getCellAttribute","onToggleHeaderSection","toggleSection","onToggleFooterSection","onInsertRow","delta","sectionName","rowIndex","newRowIndex","insertRow","onInsertRowBefore","onInsertRowAfter","onDeleteRow","deleteRow","onInsertColumn","newColumnIndex","insertColumn","onInsertColumnBefore","onInsertColumnAfter","onDeleteColumn","deleteColumn","useEffect","current","querySelector","focus","sections","filter","isEmptyTableSection","tableControls","tableRowBefore","isDisabled","onClick","tableRowAfter","tableRowDelete","tableColumnBefore","tableColumnAfter","tableColumnDelete","renderedSections","map","children","cells","tag","CellTag","scope","colspan","rowspan","undefined","colSpan","rowSpan","className","clsx","RichText","value","onFocus","isEmpty","length","jsxs","useBlockProps","ref","Fragment","BlockControls","group","AlignmentControl","label","alignmentControls","nextAlign","ToolbarDropdownMenu","hasArrowIndicator","table","controls","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","checked","hasSplitBorders","style","border","Placeholder","BlockIcon","showColors","instructions","onSubmit","TextControl","__next40pxDefaultSize","min","Button","variant","Caption","showToolbarButton","_default","exports","default"],"sources":["@wordpress/block-library/src/table/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tRichText,\n\tBlockIcon,\n\tAlignmentControl,\n\tuseBlockProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalUseBorderProps as useBorderProps,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tPanelBody,\n\tPlaceholder,\n\tTextControl,\n\tToggleControl,\n\tToolbarDropdownMenu,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n} from '@wordpress/components';\nimport {\n\talignLeft,\n\talignRight,\n\talignCenter,\n\tblockTable as icon,\n\ttableColumnAfter,\n\ttableColumnBefore,\n\ttableColumnDelete,\n\ttableRowAfter,\n\ttableRowBefore,\n\ttableRowDelete,\n\ttable,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcreateTable,\n\tupdateSelectedCell,\n\tgetCellAttribute,\n\tinsertRow,\n\tdeleteRow,\n\tinsertColumn,\n\tdeleteColumn,\n\ttoggleSection,\n\tisEmptyTableSection,\n} from './state';\nimport { Caption } from '../utils/caption';\n\nconst ALIGNMENT_CONTROLS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align column left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align column center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align column right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst cellAriaLabel = {\n\thead: __( 'Header cell text' ),\n\tbody: __( 'Body cell text' ),\n\tfoot: __( 'Footer cell text' ),\n};\n\nconst placeholder = {\n\thead: __( 'Header label' ),\n\tfoot: __( 'Footer label' ),\n};\n\nfunction TSection( { name, ...props } ) {\n\tconst TagName = `t${ name }`;\n\treturn <TagName { ...props } />;\n}\n\nfunction TableEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tisSelected: isSingleSelected,\n} ) {\n\tconst { hasFixedLayout, head, foot } = attributes;\n\tconst [ initialRowCount, setInitialRowCount ] = useState( 2 );\n\tconst [ initialColumnCount, setInitialColumnCount ] = useState( 2 );\n\tconst [ selectedCell, setSelectedCell ] = useState();\n\n\tconst colorProps = useColorProps( attributes );\n\tconst borderProps = useBorderProps( attributes );\n\n\tconst tableRef = useRef();\n\tconst [ hasTableCreated, setHasTableCreated ] = useState( false );\n\n\t/**\n\t * Updates the initial column count used for table creation.\n\t *\n\t * @param {number} count New initial column count.\n\t */\n\tfunction onChangeInitialColumnCount( count ) {\n\t\tsetInitialColumnCount( count );\n\t}\n\n\t/**\n\t * Updates the initial row count used for table creation.\n\t *\n\t * @param {number} count New initial row count.\n\t */\n\tfunction onChangeInitialRowCount( count ) {\n\t\tsetInitialRowCount( count );\n\t}\n\n\t/**\n\t * Creates a table based on dimensions in local state.\n\t *\n\t * @param {Object} event Form submit event.\n\t */\n\tfunction onCreateTable( event ) {\n\t\tevent.preventDefault();\n\n\t\tsetAttributes(\n\t\t\tcreateTable( {\n\t\t\t\trowCount: parseInt( initialRowCount, 10 ) || 2,\n\t\t\t\tcolumnCount: parseInt( initialColumnCount, 10 ) || 2,\n\t\t\t} )\n\t\t);\n\t\tsetHasTableCreated( true );\n\t}\n\n\t/**\n\t * Toggles whether the table has a fixed layout or not.\n\t */\n\tfunction onChangeFixedLayout() {\n\t\tsetAttributes( { hasFixedLayout: ! hasFixedLayout } );\n\t}\n\n\t/**\n\t * Changes the content of the currently selected cell.\n\t *\n\t * @param {Array} content A RichText content value.\n\t */\n\tfunction onChange( content ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes(\n\t\t\tupdateSelectedCell(\n\t\t\t\tattributes,\n\t\t\t\tselectedCell,\n\t\t\t\t( cellAttributes ) => ( {\n\t\t\t\t\t...cellAttributes,\n\t\t\t\t\tcontent,\n\t\t\t\t} )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Align text within the a column.\n\t *\n\t * @param {string} align The new alignment to apply to the column.\n\t */\n\tfunction onChangeColumnAlignment( align ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Convert the cell selection to a column selection so that alignment\n\t\t// is applied to the entire column.\n\t\tconst columnSelection = {\n\t\t\ttype: 'column',\n\t\t\tcolumnIndex: selectedCell.columnIndex,\n\t\t};\n\n\t\tconst newAttributes = updateSelectedCell(\n\t\t\tattributes,\n\t\t\tcolumnSelection,\n\t\t\t( cellAttributes ) => ( {\n\t\t\t\t...cellAttributes,\n\t\t\t\talign,\n\t\t\t} )\n\t\t);\n\t\tsetAttributes( newAttributes );\n\t}\n\n\t/**\n\t * Get the alignment of the currently selected cell.\n\t *\n\t * @return {string | undefined} The new alignment to apply to the column.\n\t */\n\tfunction getCellAlignment() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn getCellAttribute( attributes, selectedCell, 'align' );\n\t}\n\n\t/**\n\t * Add or remove a `head` table section.\n\t */\n\tfunction onToggleHeaderSection() {\n\t\tsetAttributes( toggleSection( attributes, 'head' ) );\n\t}\n\n\t/**\n\t * Add or remove a `foot` table section.\n\t */\n\tfunction onToggleFooterSection() {\n\t\tsetAttributes( toggleSection( attributes, 'foot' ) );\n\t}\n\n\t/**\n\t * Inserts a row at the currently selected row index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected row index at which to insert.\n\t */\n\tfunction onInsertRow( delta ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\t\tconst newRowIndex = rowIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertRow( attributes, {\n\t\t\t\tsectionName,\n\t\t\t\trowIndex: newRowIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new row.\n\t\tsetSelectedCell( {\n\t\t\tsectionName,\n\t\t\trowIndex: newRowIndex,\n\t\t\tcolumnIndex: 0,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a row before the currently selected row.\n\t */\n\tfunction onInsertRowBefore() {\n\t\tonInsertRow( 0 );\n\t}\n\n\t/**\n\t * Inserts a row after the currently selected row.\n\t */\n\tfunction onInsertRowAfter() {\n\t\tonInsertRow( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected row.\n\t */\n\tfunction onDeleteRow() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes( deleteRow( attributes, { sectionName, rowIndex } ) );\n\t}\n\n\t/**\n\t * Inserts a column at the currently selected column index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected column index at which to insert.\n\t */\n\tfunction onInsertColumn( delta = 0 ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { columnIndex } = selectedCell;\n\t\tconst newColumnIndex = columnIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertColumn( attributes, {\n\t\t\t\tcolumnIndex: newColumnIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new column.\n\t\tsetSelectedCell( {\n\t\t\trowIndex: 0,\n\t\t\tcolumnIndex: newColumnIndex,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a column before the currently selected column.\n\t */\n\tfunction onInsertColumnBefore() {\n\t\tonInsertColumn( 0 );\n\t}\n\n\t/**\n\t * Inserts a column after the currently selected column.\n\t */\n\tfunction onInsertColumnAfter() {\n\t\tonInsertColumn( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected column.\n\t */\n\tfunction onDeleteColumn() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, columnIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes(\n\t\t\tdeleteColumn( attributes, { sectionName, columnIndex } )\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSingleSelected ) {\n\t\t\tsetSelectedCell();\n\t\t}\n\t}, [ isSingleSelected ] );\n\n\tuseEffect( () => {\n\t\tif ( hasTableCreated ) {\n\t\t\ttableRef?.current\n\t\t\t\t?.querySelector( 'td div[contentEditable=\"true\"]' )\n\t\t\t\t?.focus();\n\t\t\tsetHasTableCreated( false );\n\t\t}\n\t}, [ hasTableCreated ] );\n\n\tconst sections = [ 'head', 'body', 'foot' ].filter(\n\t\t( name ) => ! isEmptyTableSection( attributes[ name ] )\n\t);\n\n\tconst tableControls = [\n\t\t{\n\t\t\ticon: tableRowBefore,\n\t\t\ttitle: __( 'Insert row before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowAfter,\n\t\t\ttitle: __( 'Insert row after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowDelete,\n\t\t\ttitle: __( 'Delete row' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnBefore,\n\t\t\ttitle: __( 'Insert column before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnAfter,\n\t\t\ttitle: __( 'Insert column after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnDelete,\n\t\t\ttitle: __( 'Delete column' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteColumn,\n\t\t},\n\t];\n\n\tconst renderedSections = sections.map( ( name ) => (\n\t\t<TSection name={ name } key={ name }>\n\t\t\t{ attributes[ name ].map( ( { cells }, rowIndex ) => (\n\t\t\t\t<tr key={ rowIndex }>\n\t\t\t\t\t{ cells.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\ttag: CellTag,\n\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\talign,\n\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcolumnIndex\n\t\t\t\t\t\t) => (\n\t\t\t\t\t\t\t<CellTag\n\t\t\t\t\t\t\t\tkey={ columnIndex }\n\t\t\t\t\t\t\t\tscope={ CellTag === 'th' ? scope : undefined }\n\t\t\t\t\t\t\t\tcolSpan={ colspan }\n\t\t\t\t\t\t\t\trowSpan={ rowspan }\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'wp-block-table__cell-content'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\t\tonFocus={ () => {\n\t\t\t\t\t\t\t\t\t\tsetSelectedCell( {\n\t\t\t\t\t\t\t\t\t\t\tsectionName: name,\n\t\t\t\t\t\t\t\t\t\t\trowIndex,\n\t\t\t\t\t\t\t\t\t\t\tcolumnIndex,\n\t\t\t\t\t\t\t\t\t\t\ttype: 'cell',\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-label={ cellAriaLabel[ name ] }\n\t\t\t\t\t\t\t\t\tplaceholder={ placeholder[ name ] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</CellTag>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t</tr>\n\t\t\t) ) }\n\t\t</TSection>\n\t) );\n\n\tconst isEmpty = ! sections.length;\n\n\treturn (\n\t\t<figure { ...useBlockProps( { ref: tableRef } ) }>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\t\tlabel={ __( 'Change column alignment' ) }\n\t\t\t\t\t\t\talignmentControls={ ALIGNMENT_CONTROLS }\n\t\t\t\t\t\t\tvalue={ getCellAlignment() }\n\t\t\t\t\t\t\tonChange={ ( nextAlign ) =>\n\t\t\t\t\t\t\t\tonChangeColumnAlignment( nextAlign )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\t\thasArrowIndicator\n\t\t\t\t\t\t\ticon={ table }\n\t\t\t\t\t\t\tlabel={ __( 'Edit table' ) }\n\t\t\t\t\t\t\tcontrols={ tableControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\t\tclassName=\"blocks-table-settings\"\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Fixed width table cells' ) }\n\t\t\t\t\t\tchecked={ !! hasFixedLayout }\n\t\t\t\t\t\tonChange={ onChangeFixedLayout }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Header section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( head && head.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleHeaderSection }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Footer section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( foot && foot.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleFooterSection }\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{ ! isEmpty && (\n\t\t\t\t<table\n\t\t\t\t\tclassName={ clsx(\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-fixed-layout': hasFixedLayout,\n\t\t\t\t\t\t\t// This is required in the editor only to overcome\n\t\t\t\t\t\t\t// the fact the editor rewrites individual border\n\t\t\t\t\t\t\t// widths into a shorthand format.\n\t\t\t\t\t\t\t'has-individual-borders': hasSplitBorders(\n\t\t\t\t\t\t\t\tattributes?.style?.border\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\tstyle={ { ...colorProps.style, ...borderProps.style } }\n\t\t\t\t>\n\t\t\t\t\t{ renderedSections }\n\t\t\t\t</table>\n\t\t\t) }\n\t\t\t{ isEmpty ? (\n\t\t\t\t<Placeholder\n\t\t\t\t\tlabel={ __( 'Table' ) }\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\t\t\tinstructions={ __( 'Insert a table for sharing data.' ) }\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tclassName=\"blocks-table__placeholder-form\"\n\t\t\t\t\t\tonSubmit={ onCreateTable }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Column count' ) }\n\t\t\t\t\t\t\tvalue={ initialColumnCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialColumnCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Row count' ) }\n\t\t\t\t\t\t\tvalue={ initialRowCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialRowCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create Table' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</Placeholder>\n\t\t\t) : (\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Table caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSingleSelected }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n\nexport default TableEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAUA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AASA,IAAAK,MAAA,GAAAL,OAAA;AAiBA,IAAAM,MAAA,GAAAN,OAAA;AAWA,IAAAO,QAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAzD3C;AACA;AACA;;AAGA;AACA;AACA;;AAoCA;AACA;AACA;;AAcA,MAAMS,kBAAkB,GAAG,CAC1B;EACCC,IAAI,EAAEC,gBAAS;EACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAoB,CAAC;EAChCC,KAAK,EAAE;AACR,CAAC,EACD;EACCJ,IAAI,EAAEK,kBAAW;EACjBH,KAAK,EAAE,IAAAC,QAAE,EAAE,qBAAsB,CAAC;EAClCC,KAAK,EAAE;AACR,CAAC,EACD;EACCJ,IAAI,EAAEM,iBAAU;EAChBJ,KAAK,EAAE,IAAAC,QAAE,EAAE,oBAAqB,CAAC;EACjCC,KAAK,EAAE;AACR,CAAC,CACD;AAED,MAAMG,aAAa,GAAG;EACrBC,IAAI,EAAE,IAAAL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MAAM;UACNF,qBAAqB;UACrBG,OAAO,EAAC,SAAS;UACjB3F,IAAI,EAAC,QAAQ;UAAA2C,QAAA,EAEX,IAAAhG,QAAE,EAAE,cAAe;QAAC,CACf,CAAC;MAAA,CACJ;IAAC,CACK,CAAC,gBAEd,IAAAL,WAAA,CAAAkB,GAAA,EAACnB,QAAA,CAAAuJ,OAAO;MACPlI,UAAU,EAAGA,UAAY;MACzBC,aAAa,EAAGA,aAAe;MAC/BE,UAAU,EAAGC,gBAAkB;MAC/BF,iBAAiB,EAAGA,iBAAmB;MACvCuG,KAAK,EAAG,IAAAxH,QAAE,EAAE,oBAAqB,CAAG;MACpCkJ,iBAAiB,EAAG/H;IAAkB,CACtC,CACD;EAAA,CACM,CAAC;AAEX;AAAC,IAAAgI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcvI,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_i18n","_components","_icons","_state","_caption","_jsxRuntime","ALIGNMENT_CONTROLS","icon","alignLeft","title","__","align","alignCenter","alignRight","cellAriaLabel","head","body","foot","placeholder","TSection","name","props","TagName","jsx","TableEdit","attributes","setAttributes","insertBlocksAfter","isSelected","isSingleSelected","hasFixedLayout","initialRowCount","setInitialRowCount","useState","initialColumnCount","setInitialColumnCount","selectedCell","setSelectedCell","colorProps","useColorProps","borderProps","useBorderProps","tableRef","useRef","hasTableCreated","setHasTableCreated","onChangeInitialColumnCount","count","onChangeInitialRowCount","onCreateTable","event","preventDefault","createTable","rowCount","parseInt","columnCount","onChangeFixedLayout","onChange","content","updateSelectedCell","cellAttributes","onChangeColumnAlignment","columnSelection","type","columnIndex","newAttributes","getCellAlignment","getCellAttribute","onToggleHeaderSection","toggleSection","onToggleFooterSection","onInsertRow","delta","sectionName","rowIndex","newRowIndex","insertRow","onInsertRowBefore","onInsertRowAfter","onDeleteRow","deleteRow","onInsertColumn","newColumnIndex","insertColumn","onInsertColumnBefore","onInsertColumnAfter","onDeleteColumn","deleteColumn","useEffect","current","querySelector","focus","sections","filter","isEmptyTableSection","tableControls","tableRowBefore","isDisabled","onClick","tableRowAfter","tableRowDelete","tableColumnBefore","tableColumnAfter","tableColumnDelete","renderedSections","map","children","cells","tag","CellTag","scope","colspan","rowspan","undefined","colSpan","rowSpan","className","clsx","RichText","value","onFocus","isEmpty","length","jsxs","useBlockProps","ref","Fragment","BlockControls","group","AlignmentControl","label","alignmentControls","nextAlign","ToolbarDropdownMenu","table","controls","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","checked","hasSplitBorders","style","border","Placeholder","BlockIcon","showColors","instructions","onSubmit","TextControl","__next40pxDefaultSize","min","Button","variant","Caption","showToolbarButton","_default","exports","default"],"sources":["@wordpress/block-library/src/table/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tRichText,\n\tBlockIcon,\n\tAlignmentControl,\n\tuseBlockProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalUseBorderProps as useBorderProps,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tPanelBody,\n\tPlaceholder,\n\tTextControl,\n\tToggleControl,\n\tToolbarDropdownMenu,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n} from '@wordpress/components';\nimport {\n\talignLeft,\n\talignRight,\n\talignCenter,\n\tblockTable as icon,\n\ttableColumnAfter,\n\ttableColumnBefore,\n\ttableColumnDelete,\n\ttableRowAfter,\n\ttableRowBefore,\n\ttableRowDelete,\n\ttable,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcreateTable,\n\tupdateSelectedCell,\n\tgetCellAttribute,\n\tinsertRow,\n\tdeleteRow,\n\tinsertColumn,\n\tdeleteColumn,\n\ttoggleSection,\n\tisEmptyTableSection,\n} from './state';\nimport { Caption } from '../utils/caption';\n\nconst ALIGNMENT_CONTROLS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align column left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align column center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align column right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst cellAriaLabel = {\n\thead: __( 'Header cell text' ),\n\tbody: __( 'Body cell text' ),\n\tfoot: __( 'Footer cell text' ),\n};\n\nconst placeholder = {\n\thead: __( 'Header label' ),\n\tfoot: __( 'Footer label' ),\n};\n\nfunction TSection( { name, ...props } ) {\n\tconst TagName = `t${ name }`;\n\treturn <TagName { ...props } />;\n}\n\nfunction TableEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tisSelected: isSingleSelected,\n} ) {\n\tconst { hasFixedLayout, head, foot } = attributes;\n\tconst [ initialRowCount, setInitialRowCount ] = useState( 2 );\n\tconst [ initialColumnCount, setInitialColumnCount ] = useState( 2 );\n\tconst [ selectedCell, setSelectedCell ] = useState();\n\n\tconst colorProps = useColorProps( attributes );\n\tconst borderProps = useBorderProps( attributes );\n\n\tconst tableRef = useRef();\n\tconst [ hasTableCreated, setHasTableCreated ] = useState( false );\n\n\t/**\n\t * Updates the initial column count used for table creation.\n\t *\n\t * @param {number} count New initial column count.\n\t */\n\tfunction onChangeInitialColumnCount( count ) {\n\t\tsetInitialColumnCount( count );\n\t}\n\n\t/**\n\t * Updates the initial row count used for table creation.\n\t *\n\t * @param {number} count New initial row count.\n\t */\n\tfunction onChangeInitialRowCount( count ) {\n\t\tsetInitialRowCount( count );\n\t}\n\n\t/**\n\t * Creates a table based on dimensions in local state.\n\t *\n\t * @param {Object} event Form submit event.\n\t */\n\tfunction onCreateTable( event ) {\n\t\tevent.preventDefault();\n\n\t\tsetAttributes(\n\t\t\tcreateTable( {\n\t\t\t\trowCount: parseInt( initialRowCount, 10 ) || 2,\n\t\t\t\tcolumnCount: parseInt( initialColumnCount, 10 ) || 2,\n\t\t\t} )\n\t\t);\n\t\tsetHasTableCreated( true );\n\t}\n\n\t/**\n\t * Toggles whether the table has a fixed layout or not.\n\t */\n\tfunction onChangeFixedLayout() {\n\t\tsetAttributes( { hasFixedLayout: ! hasFixedLayout } );\n\t}\n\n\t/**\n\t * Changes the content of the currently selected cell.\n\t *\n\t * @param {Array} content A RichText content value.\n\t */\n\tfunction onChange( content ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes(\n\t\t\tupdateSelectedCell(\n\t\t\t\tattributes,\n\t\t\t\tselectedCell,\n\t\t\t\t( cellAttributes ) => ( {\n\t\t\t\t\t...cellAttributes,\n\t\t\t\t\tcontent,\n\t\t\t\t} )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Align text within the a column.\n\t *\n\t * @param {string} align The new alignment to apply to the column.\n\t */\n\tfunction onChangeColumnAlignment( align ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Convert the cell selection to a column selection so that alignment\n\t\t// is applied to the entire column.\n\t\tconst columnSelection = {\n\t\t\ttype: 'column',\n\t\t\tcolumnIndex: selectedCell.columnIndex,\n\t\t};\n\n\t\tconst newAttributes = updateSelectedCell(\n\t\t\tattributes,\n\t\t\tcolumnSelection,\n\t\t\t( cellAttributes ) => ( {\n\t\t\t\t...cellAttributes,\n\t\t\t\talign,\n\t\t\t} )\n\t\t);\n\t\tsetAttributes( newAttributes );\n\t}\n\n\t/**\n\t * Get the alignment of the currently selected cell.\n\t *\n\t * @return {string | undefined} The new alignment to apply to the column.\n\t */\n\tfunction getCellAlignment() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn getCellAttribute( attributes, selectedCell, 'align' );\n\t}\n\n\t/**\n\t * Add or remove a `head` table section.\n\t */\n\tfunction onToggleHeaderSection() {\n\t\tsetAttributes( toggleSection( attributes, 'head' ) );\n\t}\n\n\t/**\n\t * Add or remove a `foot` table section.\n\t */\n\tfunction onToggleFooterSection() {\n\t\tsetAttributes( toggleSection( attributes, 'foot' ) );\n\t}\n\n\t/**\n\t * Inserts a row at the currently selected row index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected row index at which to insert.\n\t */\n\tfunction onInsertRow( delta ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\t\tconst newRowIndex = rowIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertRow( attributes, {\n\t\t\t\tsectionName,\n\t\t\t\trowIndex: newRowIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new row.\n\t\tsetSelectedCell( {\n\t\t\tsectionName,\n\t\t\trowIndex: newRowIndex,\n\t\t\tcolumnIndex: 0,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a row before the currently selected row.\n\t */\n\tfunction onInsertRowBefore() {\n\t\tonInsertRow( 0 );\n\t}\n\n\t/**\n\t * Inserts a row after the currently selected row.\n\t */\n\tfunction onInsertRowAfter() {\n\t\tonInsertRow( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected row.\n\t */\n\tfunction onDeleteRow() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes( deleteRow( attributes, { sectionName, rowIndex } ) );\n\t}\n\n\t/**\n\t * Inserts a column at the currently selected column index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected column index at which to insert.\n\t */\n\tfunction onInsertColumn( delta = 0 ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { columnIndex } = selectedCell;\n\t\tconst newColumnIndex = columnIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertColumn( attributes, {\n\t\t\t\tcolumnIndex: newColumnIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new column.\n\t\tsetSelectedCell( {\n\t\t\trowIndex: 0,\n\t\t\tcolumnIndex: newColumnIndex,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a column before the currently selected column.\n\t */\n\tfunction onInsertColumnBefore() {\n\t\tonInsertColumn( 0 );\n\t}\n\n\t/**\n\t * Inserts a column after the currently selected column.\n\t */\n\tfunction onInsertColumnAfter() {\n\t\tonInsertColumn( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected column.\n\t */\n\tfunction onDeleteColumn() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, columnIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes(\n\t\t\tdeleteColumn( attributes, { sectionName, columnIndex } )\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSingleSelected ) {\n\t\t\tsetSelectedCell();\n\t\t}\n\t}, [ isSingleSelected ] );\n\n\tuseEffect( () => {\n\t\tif ( hasTableCreated ) {\n\t\t\ttableRef?.current\n\t\t\t\t?.querySelector( 'td div[contentEditable=\"true\"]' )\n\t\t\t\t?.focus();\n\t\t\tsetHasTableCreated( false );\n\t\t}\n\t}, [ hasTableCreated ] );\n\n\tconst sections = [ 'head', 'body', 'foot' ].filter(\n\t\t( name ) => ! isEmptyTableSection( attributes[ name ] )\n\t);\n\n\tconst tableControls = [\n\t\t{\n\t\t\ticon: tableRowBefore,\n\t\t\ttitle: __( 'Insert row before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowAfter,\n\t\t\ttitle: __( 'Insert row after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowDelete,\n\t\t\ttitle: __( 'Delete row' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnBefore,\n\t\t\ttitle: __( 'Insert column before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnAfter,\n\t\t\ttitle: __( 'Insert column after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnDelete,\n\t\t\ttitle: __( 'Delete column' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteColumn,\n\t\t},\n\t];\n\n\tconst renderedSections = sections.map( ( name ) => (\n\t\t<TSection name={ name } key={ name }>\n\t\t\t{ attributes[ name ].map( ( { cells }, rowIndex ) => (\n\t\t\t\t<tr key={ rowIndex }>\n\t\t\t\t\t{ cells.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\ttag: CellTag,\n\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\talign,\n\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcolumnIndex\n\t\t\t\t\t\t) => (\n\t\t\t\t\t\t\t<CellTag\n\t\t\t\t\t\t\t\tkey={ columnIndex }\n\t\t\t\t\t\t\t\tscope={ CellTag === 'th' ? scope : undefined }\n\t\t\t\t\t\t\t\tcolSpan={ colspan }\n\t\t\t\t\t\t\t\trowSpan={ rowspan }\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'wp-block-table__cell-content'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\t\tonFocus={ () => {\n\t\t\t\t\t\t\t\t\t\tsetSelectedCell( {\n\t\t\t\t\t\t\t\t\t\t\tsectionName: name,\n\t\t\t\t\t\t\t\t\t\t\trowIndex,\n\t\t\t\t\t\t\t\t\t\t\tcolumnIndex,\n\t\t\t\t\t\t\t\t\t\t\ttype: 'cell',\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-label={ cellAriaLabel[ name ] }\n\t\t\t\t\t\t\t\t\tplaceholder={ placeholder[ name ] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</CellTag>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t</tr>\n\t\t\t) ) }\n\t\t</TSection>\n\t) );\n\n\tconst isEmpty = ! sections.length;\n\n\treturn (\n\t\t<figure { ...useBlockProps( { ref: tableRef } ) }>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\t\tlabel={ __( 'Change column alignment' ) }\n\t\t\t\t\t\t\talignmentControls={ ALIGNMENT_CONTROLS }\n\t\t\t\t\t\t\tvalue={ getCellAlignment() }\n\t\t\t\t\t\t\tonChange={ ( nextAlign ) =>\n\t\t\t\t\t\t\t\tonChangeColumnAlignment( nextAlign )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\t\ticon={ table }\n\t\t\t\t\t\t\tlabel={ __( 'Edit table' ) }\n\t\t\t\t\t\t\tcontrols={ tableControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\t\tclassName=\"blocks-table-settings\"\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Fixed width table cells' ) }\n\t\t\t\t\t\tchecked={ !! hasFixedLayout }\n\t\t\t\t\t\tonChange={ onChangeFixedLayout }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Header section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( head && head.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleHeaderSection }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Footer section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( foot && foot.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleFooterSection }\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{ ! isEmpty && (\n\t\t\t\t<table\n\t\t\t\t\tclassName={ clsx(\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-fixed-layout': hasFixedLayout,\n\t\t\t\t\t\t\t// This is required in the editor only to overcome\n\t\t\t\t\t\t\t// the fact the editor rewrites individual border\n\t\t\t\t\t\t\t// widths into a shorthand format.\n\t\t\t\t\t\t\t'has-individual-borders': hasSplitBorders(\n\t\t\t\t\t\t\t\tattributes?.style?.border\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\tstyle={ { ...colorProps.style, ...borderProps.style } }\n\t\t\t\t>\n\t\t\t\t\t{ renderedSections }\n\t\t\t\t</table>\n\t\t\t) }\n\t\t\t{ isEmpty ? (\n\t\t\t\t<Placeholder\n\t\t\t\t\tlabel={ __( 'Table' ) }\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\t\t\tinstructions={ __( 'Insert a table for sharing data.' ) }\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tclassName=\"blocks-table__placeholder-form\"\n\t\t\t\t\t\tonSubmit={ onCreateTable }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Column count' ) }\n\t\t\t\t\t\t\tvalue={ initialColumnCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialColumnCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Row count' ) }\n\t\t\t\t\t\t\tvalue={ initialRowCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialRowCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create Table' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</Placeholder>\n\t\t\t) : (\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Table caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSingleSelected }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n\nexport default TableEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAUA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AASA,IAAAK,MAAA,GAAAL,OAAA;AAiBA,IAAAM,MAAA,GAAAN,OAAA;AAWA,IAAAO,QAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAzD3C;AACA;AACA;;AAGA;AACA;AACA;;AAoCA;AACA;AACA;;AAcA,MAAMS,kBAAkB,GAAG,CAC1B;EACCC,IAAI,EAAEC,gBAAS;EACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAoB,CAAC;EAChCC,KAAK,EAAE;AACR,CAAC,EACD;EACCJ,IAAI,EAAEK,kBAAW;EACjBH,KAAK,EAAE,IAAAC,QAAE,EAAE,qBAAsB,CAAC;EAClCC,KAAK,EAAE;AACR,CAAC,EACD;EACCJ,IAAI,EAAEM,iBAAU;EAChBJ,KAAK,EAAE,IAAAC,QAAE,EAAE,oBAAqB,CAAC;EACjCC,KAAK,EAAE;AACR,CAAC,CACD;AAED,MAAMG,aAAa,GAAG;E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AAuJ,MAAM;UACNF,qBAAqB;UACrBG,OAAO,EAAC,SAAS;UACjB1F,IAAI,EAAC,QAAQ;UAAA2C,QAAA,EAEX,IAAAhG,QAAE,EAAE,cAAe;QAAC,CACf,CAAC;MAAA,CACJ;IAAC,CACK,CAAC,gBAEd,IAAAL,WAAA,CAAAkB,GAAA,EAACnB,QAAA,CAAAsJ,OAAO;MACPjI,UAAU,EAAGA,UAAY;MACzBC,aAAa,EAAGA,aAAe;MAC/BE,UAAU,EAAGC,gBAAkB;MAC/BF,iBAAiB,EAAGA,iBAAmB;MACvCuG,KAAK,EAAG,IAAAxH,QAAE,EAAE,oBAAqB,CAAG;MACpCiJ,iBAAiB,EAAG9H;IAAkB,CACtC,CACD;EAAA,CACM,CAAC;AAEX;AAAC,IAAA+H,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctI,SAAS","ignoreList":[]}
|
|
@@ -53,17 +53,12 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
53
53
|
|
|
54
54
|
// If a user clicks to a link prevent redirection and show a warning.
|
|
55
55
|
const {
|
|
56
|
-
createWarningNotice
|
|
57
|
-
removeNotice
|
|
56
|
+
createWarningNotice
|
|
58
57
|
} = (0, _data.useDispatch)(_notices.store);
|
|
59
|
-
let noticeId;
|
|
60
58
|
const showRedirectionPreventedNotice = event => {
|
|
61
59
|
event.preventDefault();
|
|
62
|
-
// Remove previous warning if any, to show one at a time per block.
|
|
63
|
-
removeNotice(noticeId);
|
|
64
|
-
noticeId = `block-library/core/table-of-contents/redirection-prevented/${instanceId}`;
|
|
65
60
|
createWarningNotice((0, _i18n.__)('Links are disabled in the editor.'), {
|
|
66
|
-
id:
|
|
61
|
+
id: `block-library/core/table-of-contents/redirection-prevented/${instanceId}`,
|
|
67
62
|
type: 'snackbar'
|
|
68
63
|
});
|
|
69
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_blocks","_components","_data","_element","_i18n","_compose","_notices","_icons","_list","_interopRequireDefault","_utils","_hooks","_jsxRuntime","TableOfContentsEdit","attributes","headings","onlyIncludeCurrentPage","clientId","setAttributes","useObserveHeadings","blockProps","useBlockProps","instanceId","useInstanceId","createWarningNotice","removeNotice","useDispatch","noticeStore","noticeId","showRedirectionPreventedNotice","event","preventDefault","__","id","type","canInsertList","useSelect","select","getBlockRootClientId","canInsertBlockType","blockEditorStore","rootClientId","replaceBlocks","headingTree","linearToNestedHeadingList","toolbarControls","jsx","BlockControls","children","ToolbarGroup","ToolbarButton","onClick","createBlock","ordered","values","renderToString","default","nestedHeadingList","inspectorControls","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","onChange","value","help","length","jsxs","Fragment","Placeholder","icon","BlockIcon","instructions","disableLinkActivation"],"sources":["@wordpress/block-library/src/table-of-contents/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tPanelBody,\n\tPlaceholder,\n\tToggleControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { renderToString } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as noticeStore } from '@wordpress/notices';\nimport { tableOfContents as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsList from './list';\nimport { linearToNestedHeadingList } from './utils';\nimport { useObserveHeadings } from './hooks';\n\n/** @typedef {import('./utils').HeadingData} HeadingData */\n\n/**\n * Table of Contents block edit component.\n *\n * @param {Object} props The props.\n * @param {Object} props.attributes The block attributes.\n * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post.\n * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated).\n * @param {string} props.clientId\n * @param {(attributes: Object) => void} props.setAttributes\n *\n * @return {Component} The component.\n */\nexport default function TableOfContentsEdit( {\n\tattributes: { headings = [], onlyIncludeCurrentPage },\n\tclientId,\n\tsetAttributes,\n} ) {\n\tuseObserveHeadings( clientId );\n\n\tconst blockProps = useBlockProps();\n\tconst instanceId = useInstanceId(\n\t\tTableOfContentsEdit,\n\t\t'table-of-contents'\n\t);\n\n\t// If a user clicks to a link prevent redirection and show a warning.\n\tconst { createWarningNotice, removeNotice } = useDispatch( noticeStore );\n\tlet noticeId;\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\t// Remove previous warning if any, to show one at a time per block.\n\t\tremoveNotice( noticeId );\n\t\tnoticeId = `block-library/core/table-of-contents/redirection-prevented/${ instanceId }`;\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: noticeId,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst canInsertList = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\treturn canInsertBlockType( 'core/list', rootClientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\n\tconst headingTree = linearToNestedHeadingList( headings );\n\n\tconst toolbarControls = canInsertList && (\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlock( 'core/list', {\n\t\t\t\t\t\t\t\tordered: true,\n\t\t\t\t\t\t\t\tvalues: renderToString(\n\t\t\t\t\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\t\t\t\t\tnestedHeadingList={ headingTree }\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}\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Convert to static list' ) }\n\t\t\t\t</ToolbarButton>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Only include current page' ) }\n\t\t\t\t\tchecked={ onlyIncludeCurrentPage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { onlyIncludeCurrentPage: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={\n\t\t\t\t\t\tonlyIncludeCurrentPage\n\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t'Only including headings from the current page (if the post is paginated).'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'Toggle to only include headings from the current page (if the post is paginated).'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\t// If there are no headings or the only heading is empty.\n\t// Note that the toolbar controls are intentionally omitted since the\n\t// \"Convert to static list\" option is useless to the placeholder state.\n\tif ( headings.length === 0 ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\tlabel={ __( 'Table of Contents' ) }\n\t\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t\t'Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{ inspectorControls }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<nav { ...blockProps }>\n\t\t\t\t<ol>\n\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\tnestedHeadingList={ headingTree }\n\t\t\t\t\t\tdisableLinkActivation\n\t\t\t\t\t\tonClick={ showRedirectionPreventedNotice }\n\t\t\t\t\t/>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t\t{ toolbarControls }\n\t\t\t{ inspectorControls }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAKA,IAAAS,KAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAA6C,IAAAa,WAAA,GAAAb,OAAA;AA9B7C;AACA;AACA;;AAuBA;AACA;AACA;;AAKA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACe,SAASc,mBAAmBA,CAAE;EAC5CC,UAAU,EAAE;IAAEC,QAAQ,GAAG,EAAE;IAAEC;EAAuB,CAAC;EACrDC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,IAAAC,yBAAkB,EAAEF,QAAS,CAAC;EAE9B,MAAMG,UAAU,GAAG,IAAAC,0BAAa,EAAC,CAAC;EAClC,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAC/BV,mBAAmB,EACnB,mBACD,CAAC;;EAED;EACA,MAAM;IAAEW,mBAAmB;IAAEC;EAAa,CAAC,GAAG,IAAAC,iBAAW,E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,QAAE,EAChB,4GACD;QAAG,CACH;MAAC,CACE,CAAC,EACJ0B,iBAAiB;IAAA,CAClB,CAAC;EAEL;EAEA,oBACC,IAAA9C,WAAA,CAAA0D,IAAA,EAAA1D,WAAA,CAAA2D,QAAA;IAAAvB,QAAA,gBACC,IAAApC,WAAA,CAAAkC,GAAA;MAAA,GAAU1B,UAAU;MAAA4B,QAAA,eACnB,IAAApC,WAAA,CAAAkC,GAAA;QAAAE,QAAA,eACC,IAAApC,WAAA,CAAAkC,GAAA,EAACtC,KAAA,CAAAgD,OAAmB;UACnBC,iBAAiB,EAAGd,WAAa;UACjCiC,qBAAqB;UACrBzB,OAAO,EAAGtB;QAAgC,CAC1C;MAAC,CACC;IAAC,CACD,CAAC,EACJgB,eAAe,EACfa,iBAAiB;EAAA,CAClB,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_blocks","_components","_data","_element","_i18n","_compose","_notices","_icons","_list","_interopRequireDefault","_utils","_hooks","_jsxRuntime","TableOfContentsEdit","attributes","headings","onlyIncludeCurrentPage","clientId","setAttributes","useObserveHeadings","blockProps","useBlockProps","instanceId","useInstanceId","createWarningNotice","useDispatch","noticeStore","showRedirectionPreventedNotice","event","preventDefault","__","id","type","canInsertList","useSelect","select","getBlockRootClientId","canInsertBlockType","blockEditorStore","rootClientId","replaceBlocks","headingTree","linearToNestedHeadingList","toolbarControls","jsx","BlockControls","children","ToolbarGroup","ToolbarButton","onClick","createBlock","ordered","values","renderToString","default","nestedHeadingList","inspectorControls","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","onChange","value","help","length","jsxs","Fragment","Placeholder","icon","BlockIcon","instructions","disableLinkActivation"],"sources":["@wordpress/block-library/src/table-of-contents/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tPanelBody,\n\tPlaceholder,\n\tToggleControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { renderToString } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as noticeStore } from '@wordpress/notices';\nimport { tableOfContents as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsList from './list';\nimport { linearToNestedHeadingList } from './utils';\nimport { useObserveHeadings } from './hooks';\n\n/** @typedef {import('./utils').HeadingData} HeadingData */\n\n/**\n * Table of Contents block edit component.\n *\n * @param {Object} props The props.\n * @param {Object} props.attributes The block attributes.\n * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post.\n * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated).\n * @param {string} props.clientId\n * @param {(attributes: Object) => void} props.setAttributes\n *\n * @return {Component} The component.\n */\nexport default function TableOfContentsEdit( {\n\tattributes: { headings = [], onlyIncludeCurrentPage },\n\tclientId,\n\tsetAttributes,\n} ) {\n\tuseObserveHeadings( clientId );\n\n\tconst blockProps = useBlockProps();\n\tconst instanceId = useInstanceId(\n\t\tTableOfContentsEdit,\n\t\t'table-of-contents'\n\t);\n\n\t// If a user clicks to a link prevent redirection and show a warning.\n\tconst { createWarningNotice } = useDispatch( noticeStore );\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: `block-library/core/table-of-contents/redirection-prevented/${ instanceId }`,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst canInsertList = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\treturn canInsertBlockType( 'core/list', rootClientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\n\tconst headingTree = linearToNestedHeadingList( headings );\n\n\tconst toolbarControls = canInsertList && (\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlock( 'core/list', {\n\t\t\t\t\t\t\t\tordered: true,\n\t\t\t\t\t\t\t\tvalues: renderToString(\n\t\t\t\t\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\t\t\t\t\tnestedHeadingList={ headingTree }\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}\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Convert to static list' ) }\n\t\t\t\t</ToolbarButton>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Only include current page' ) }\n\t\t\t\t\tchecked={ onlyIncludeCurrentPage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { onlyIncludeCurrentPage: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={\n\t\t\t\t\t\tonlyIncludeCurrentPage\n\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t'Only including headings from the current page (if the post is paginated).'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'Toggle to only include headings from the current page (if the post is paginated).'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\t// If there are no headings or the only heading is empty.\n\t// Note that the toolbar controls are intentionally omitted since the\n\t// \"Convert to static list\" option is useless to the placeholder state.\n\tif ( headings.length === 0 ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\tlabel={ __( 'Table of Contents' ) }\n\t\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t\t'Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{ inspectorControls }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<nav { ...blockProps }>\n\t\t\t\t<ol>\n\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\tnestedHeadingList={ headingTree }\n\t\t\t\t\t\tdisableLinkActivation\n\t\t\t\t\t\tonClick={ showRedirectionPreventedNotice }\n\t\t\t\t\t/>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t\t{ toolbarControls }\n\t\t\t{ inspectorControls }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAKA,IAAAS,KAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAA6C,IAAAa,WAAA,G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