@wordpress/block-library 9.14.0 → 9.15.1
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/LICENSE.md +1 -1
- package/build/archives/edit.js +83 -36
- package/build/archives/edit.js.map +1 -1
- package/build/button/deprecated.js +182 -1
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +47 -25
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +8 -2
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +8 -5
- package/build/button/save.js.map +1 -1
- package/build/column/edit.js +33 -13
- package/build/column/edit.js.map +1 -1
- package/build/columns/edit.js +50 -27
- package/build/columns/edit.js.map +1 -1
- package/build/comments/index.js +1 -0
- package/build/comments/index.js.map +1 -1
- package/build/cover/edit/index.js +9 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit.native.js +1 -1
- package/build/cover/edit.native.js.map +1 -1
- package/build/details/edit.js +29 -7
- package/build/details/edit.js.map +1 -1
- package/build/image/transforms.js +1 -0
- package/build/image/transforms.js.map +1 -1
- package/build/latest-posts/deprecated.js +12 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/index.js +12 -0
- package/build/latest-posts/index.js.map +1 -1
- package/build/loginout/edit.js +42 -13
- package/build/loginout/edit.js.map +1 -1
- package/build/media-text/edit.js +59 -31
- package/build/media-text/edit.js.map +1 -1
- package/build/more/edit.js +28 -7
- package/build/more/edit.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +5 -3
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation-link/edit.js +95 -55
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +105 -53
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +44 -25
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +14 -4
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-author/edit.js +15 -3
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +4 -2
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-name/edit.js +11 -5
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-author-name/index.js +4 -2
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comments-form/index.js +6 -1
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +8 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-date/edit.js +58 -18
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +2 -1
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +42 -18
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +17 -19
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +45 -11
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +6 -3
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/index.js +11 -7
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-navigation-link/variations.js +2 -2
- package/build/post-navigation-link/variations.js.map +1 -1
- package/build/post-template/index.js +11 -1
- package/build/post-template/index.js.map +1 -1
- package/build/post-title/index.js +6 -3
- package/build/post-title/index.js.map +1 -1
- package/build/query-no-results/index.js +10 -9
- package/build/query-no-results/index.js.map +1 -1
- package/build/query-pagination/edit.js +47 -17
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination/query-pagination-label-control.js +1 -1
- package/build/query-pagination/query-pagination-label-control.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +33 -15
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-total/edit.js +8 -10
- package/build/query-total/edit.js.map +1 -1
- package/build/query-total/index.js +8 -1
- package/build/query-total/index.js.map +1 -1
- package/build/read-more/index.js +7 -1
- package/build/read-more/index.js.map +1 -1
- package/build/site-logo/index.js +4 -2
- package/build/site-logo/index.js.map +1 -1
- package/build/site-title/edit.js +41 -12
- package/build/site-title/edit.js.map +1 -1
- package/build/site-title/index.js +4 -2
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +19 -3
- package/build/social-link/edit.js.map +1 -1
- package/build/social-links/edit.js +41 -12
- package/build/social-links/edit.js.map +1 -1
- package/build/spacer/controls.js +34 -12
- package/build/spacer/controls.js.map +1 -1
- package/build/table/edit.js +48 -15
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +4 -1
- package/build/table/index.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +24 -23
- package/build/table-of-contents/index.js.map +1 -1
- package/build/tag-cloud/edit.js +56 -11
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/video/edit-common-settings.js +90 -30
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +20 -49
- package/build/video/edit.js.map +1 -1
- package/build/video/poster-image.js +81 -0
- package/build/video/poster-image.js.map +1 -0
- package/build/video/tracks-editor.js +1 -1
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/edit.js +84 -37
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/button/deprecated.js +183 -2
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +50 -28
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +8 -2
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +9 -6
- package/build-module/button/save.js.map +1 -1
- package/build-module/column/edit.js +34 -14
- package/build-module/column/edit.js.map +1 -1
- package/build-module/columns/edit.js +52 -29
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comments/index.js +1 -0
- package/build-module/comments/index.js.map +1 -1
- package/build-module/cover/edit/index.js +9 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit.native.js +2 -2
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/details/edit.js +30 -8
- package/build-module/details/edit.js.map +1 -1
- package/build-module/image/transforms.js +1 -0
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +12 -0
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/index.js +12 -0
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/loginout/edit.js +42 -14
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/media-text/edit.js +59 -31
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/more/edit.js +28 -8
- package/build-module/more/edit.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +5 -3
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation-link/edit.js +96 -56
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +106 -54
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +45 -26
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +15 -6
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-author/edit.js +16 -4
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +4 -2
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-name/edit.js +12 -6
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +4 -2
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +6 -1
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +8 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-date/edit.js +59 -19
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +2 -1
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +44 -20
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +18 -20
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +47 -13
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +6 -3
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +12 -7
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-navigation-link/variations.js +2 -2
- package/build-module/post-navigation-link/variations.js.map +1 -1
- package/build-module/post-template/index.js +11 -1
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-title/index.js +6 -3
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query-no-results/index.js +10 -9
- package/build-module/query-no-results/index.js.map +1 -1
- package/build-module/query-pagination/edit.js +49 -19
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination/query-pagination-label-control.js +1 -1
- package/build-module/query-pagination/query-pagination-label-control.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +34 -16
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-total/edit.js +8 -10
- package/build-module/query-total/edit.js.map +1 -1
- package/build-module/query-total/index.js +8 -1
- package/build-module/query-total/index.js.map +1 -1
- package/build-module/read-more/index.js +7 -1
- package/build-module/read-more/index.js.map +1 -1
- package/build-module/site-logo/index.js +4 -2
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-title/edit.js +42 -13
- package/build-module/site-title/edit.js.map +1 -1
- package/build-module/site-title/index.js +4 -2
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +20 -4
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-links/edit.js +42 -13
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/spacer/controls.js +35 -13
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/table/edit.js +49 -16
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +4 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +26 -25
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/tag-cloud/edit.js +57 -12
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/video/edit-common-settings.js +91 -31
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +24 -53
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/poster-image.js +74 -0
- package/build-module/video/poster-image.js.map +1 -0
- package/build-module/video/tracks-editor.js +1 -1
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/comment-template/style-rtl.css +0 -1
- package/build-style/comment-template/style.css +0 -1
- package/build-style/editor-rtl.css +4 -19
- package/build-style/editor.css +4 -19
- package/build-style/form-input/style-rtl.css +0 -2
- package/build-style/form-input/style.css +0 -2
- package/build-style/freeform/editor-rtl.css +4 -8
- package/build-style/freeform/editor.css +4 -8
- package/build-style/{post-template/editor.css → post-comments-link/style-rtl.css} +2 -4
- package/build-style/{post-template/editor-rtl.css → post-comments-link/style.css} +2 -4
- package/build-style/post-template/style-rtl.css +1 -0
- package/build-style/post-template/style.css +1 -0
- package/build-style/query-total/style-rtl.css +103 -0
- package/build-style/query-total/style.css +103 -0
- package/build-style/read-more/style-rtl.css +0 -1
- package/build-style/read-more/style.css +0 -1
- package/build-style/style-rtl.css +9 -4
- package/build-style/style.css +9 -4
- package/build-style/tag-cloud/editor-rtl.css +0 -5
- package/build-style/tag-cloud/editor.css +0 -5
- package/package.json +35 -35
- package/src/archives/edit.js +94 -36
- package/src/audio/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/block/index.php +20 -0
- package/src/button/block.json +17 -2
- package/src/button/deprecated.js +189 -0
- package/src/button/edit.js +60 -31
- package/src/button/save.js +6 -1
- package/src/column/edit.js +34 -13
- package/src/columns/edit.js +71 -40
- package/src/comments/index.js +1 -0
- package/src/cover/edit/index.js +12 -5
- package/src/cover/edit.native.js +5 -2
- package/src/cover/test/edit.js +5 -7
- package/src/details/edit.js +40 -11
- package/src/editor.scss +0 -1
- package/src/file/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/image/transforms.js +1 -0
- package/src/latest-posts/block.json +12 -0
- package/src/loginout/edit.js +56 -20
- package/src/media-text/edit.js +57 -28
- package/src/more/edit.js +39 -12
- package/src/navigation/edit/navigation-menu-selector.js +9 -2
- package/src/navigation/index.php +2 -2
- package/src/navigation-link/edit.js +101 -61
- package/src/navigation-link/index.php +16 -1
- package/src/navigation-submenu/edit.js +113 -57
- package/src/page-list/edit.js +52 -31
- package/src/paragraph/edit.js +18 -4
- package/src/post-author/block.json +4 -2
- package/src/post-author/edit.js +17 -3
- package/src/post-author/index.php +4 -0
- package/src/post-author-name/block.json +4 -2
- package/src/post-author-name/edit.js +17 -4
- package/src/post-author-name/index.php +4 -0
- package/src/post-comments-form/block.json +6 -1
- package/src/post-comments-link/block.json +8 -1
- package/src/post-comments-link/style.scss +4 -0
- package/src/post-content/index.php +23 -0
- package/src/post-date/block.json +2 -1
- package/src/post-date/edit.js +79 -25
- package/src/post-excerpt/edit.js +59 -22
- package/src/post-featured-image/block.json +6 -3
- package/src/post-featured-image/dimension-controls.js +18 -21
- package/src/post-featured-image/edit.js +67 -10
- package/src/post-navigation-link/block.json +0 -6
- package/src/post-navigation-link/index.js +11 -0
- package/src/post-navigation-link/variations.js +2 -2
- package/src/post-template/block.json +11 -1
- package/src/post-template/style.scss +2 -0
- package/src/post-title/block.json +6 -3
- package/src/query-no-results/block.json +0 -10
- package/src/query-no-results/index.js +11 -0
- package/src/query-pagination/edit.js +57 -15
- package/src/query-pagination/query-pagination-label-control.js +1 -3
- package/src/query-pagination-numbers/edit.js +41 -19
- package/src/query-pagination-previous/index.php +21 -14
- package/src/query-total/block.json +8 -1
- package/src/query-total/edit.js +11 -13
- package/src/query-total/index.php +9 -13
- package/src/query-total/style.scss +4 -0
- package/src/read-more/index.js +6 -0
- package/src/site-logo/block.json +4 -2
- package/src/site-title/block.json +4 -2
- package/src/site-title/edit.js +52 -15
- package/src/social-link/edit.js +21 -6
- package/src/social-links/edit.js +52 -15
- package/src/spacer/controls.js +42 -15
- package/src/style.scss +2 -0
- package/src/table/block.json +4 -1
- package/src/table/edit.js +58 -20
- package/src/table-of-contents/block.json +0 -52
- package/src/table-of-contents/edit.js +1 -1
- package/src/table-of-contents/index.js +53 -0
- package/src/tag-cloud/edit.js +60 -8
- package/src/tag-cloud/editor.scss +0 -8
- package/src/video/edit-common-settings.js +97 -39
- package/src/video/edit.js +29 -75
- package/src/video/poster-image.js +86 -0
- package/src/video/tracks-editor.js +1 -1
- package/tsconfig.json +0 -2
- package/src/post-template/editor.scss +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","NEW_TAB_TARGET","NOFOLLOW_REL","getUpdatedLinkAttributes","removeAnchorTag","__","useEffect","useState","useRef","useMemo","Button","ButtonGroup","PanelBody","TextControl","ToolbarButton","Popover","AlignmentControl","BlockControls","InspectorControls","RichText","useBlockProps","LinkControl","__experimentalUseBorderProps","useBorderProps","__experimentalUseColorProps","useColorProps","__experimentalGetSpacingClassesAndStyles","useSpacingProps","__experimentalGetShadowClassesAndStyles","useShadowProps","__experimentalGetElementClassName","store","blockEditorStore","useBlockEditingMode","displayShortcut","isKeyboardEvent","ENTER","link","linkOff","createBlock","cloneBlock","getDefaultBlockName","getBlockBindingsSource","useMergeRefs","useRefEffect","useSelect","useDispatch","jsxs","_jsxs","jsx","_jsx","Fragment","_Fragment","LINK_SETTINGS","DEFAULT_LINK_SETTINGS","id","title","useEnter","props","replaceBlocks","selectionChange","getBlock","getBlockRootClientId","getBlockIndex","propsRef","current","element","onKeyDown","event","defaultPrevented","keyCode","content","clientId","length","preventDefault","topParentListBlock","blockIndex","head","innerBlocks","slice","middle","after","tail","addEventListener","removeEventListener","WidthPanel","selectedWidth","setAttributes","handleChange","newWidth","width","undefined","children","map","widthValue","size","variant","onClick","ButtonEdit","attributes","className","isSelected","onReplace","mergeBlocks","context","tagName","textAlign","linkTarget","placeholder","rel","style","text","url","metadata","TagName","primary","startEditing","primaryShift","unlink","richTextRef","focus","popoverAnchor","setPopoverAnchor","borderProps","colorProps","spacingProps","shadowProps","ref","blockProps","blockEditingMode","isEditingURL","setIsEditingURL","isURLSet","opensInNewTab","nofollow","includes","isLinkTag","linkValue","useEnterRef","mergedRef","lockUrlControls","select","blockBindingsSource","bindings","source","canUserEditValue","args","fontSize","value","onChange","withoutInteractiveFormatting","border","radius","onMerge","identifier","group","nextAlign","name","icon","shortcut","isActive","placement","onClose","anchor","focusOnMount","__unstableSlotName","shift","newURL","newOpensInNewTab","newNofollow","onRemove","forceIsEditingLink","settings","__next40pxDefaultSize","__nextHasNoMarginBottom","label","newRel"],"sources":["@wordpress/block-library/src/button/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';\nimport { getUpdatedLinkAttributes } from './get-updated-link-attributes';\nimport removeAnchorTag from '../utils/remove-anchor-tag';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useState, useRef, useMemo } from '@wordpress/element';\nimport {\n\tButton,\n\tButtonGroup,\n\tPanelBody,\n\tTextControl,\n\tToolbarButton,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tLinkControl,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalGetSpacingClassesAndStyles as useSpacingProps,\n\t__experimentalGetShadowClassesAndStyles as useShadowProps,\n\t__experimentalGetElementClassName,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';\nimport { link, linkOff } from '@wordpress/icons';\nimport {\n\tcreateBlock,\n\tcloneBlock,\n\tgetDefaultBlockName,\n\tgetBlockBindingsSource,\n} from '@wordpress/blocks';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst LINK_SETTINGS = [\n\t...LinkControl.DEFAULT_LINK_SETTINGS,\n\t{\n\t\tid: 'nofollow',\n\t\ttitle: __( 'Mark as nofollow' ),\n\t},\n];\n\nfunction useEnter( props ) {\n\tconst { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );\n\tconst { getBlock, getBlockRootClientId, getBlockIndex } =\n\t\tuseSelect( blockEditorStore );\n\tconst propsRef = useRef( props );\n\tpropsRef.current = props;\n\treturn useRefEffect( ( element ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented || event.keyCode !== ENTER ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { content, clientId } = propsRef.current;\n\t\t\tif ( content.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tconst topParentListBlock = getBlock(\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t\tconst blockIndex = getBlockIndex( clientId );\n\t\t\tconst head = cloneBlock( {\n\t\t\t\t...topParentListBlock,\n\t\t\t\tinnerBlocks: topParentListBlock.innerBlocks.slice(\n\t\t\t\t\t0,\n\t\t\t\t\tblockIndex\n\t\t\t\t),\n\t\t\t} );\n\t\t\tconst middle = createBlock( getDefaultBlockName() );\n\t\t\tconst after = topParentListBlock.innerBlocks.slice(\n\t\t\t\tblockIndex + 1\n\t\t\t);\n\t\t\tconst tail = after.length\n\t\t\t\t? [\n\t\t\t\t\t\tcloneBlock( {\n\t\t\t\t\t\t\t...topParentListBlock,\n\t\t\t\t\t\t\tinnerBlocks: after,\n\t\t\t\t\t\t} ),\n\t\t\t\t ]\n\t\t\t\t: [];\n\t\t\treplaceBlocks(\n\t\t\t\ttopParentListBlock.clientId,\n\t\t\t\t[ head, middle, ...tail ],\n\t\t\t\t1\n\t\t\t);\n\t\t\t// We manually change the selection here because we are replacing\n\t\t\t// a different block than the selected one.\n\t\t\tselectionChange( middle.clientId );\n\t\t}\n\n\t\telement.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\telement.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n\nfunction WidthPanel( { selectedWidth, setAttributes } ) {\n\tfunction handleChange( newWidth ) {\n\t\t// Check if we are toggling the width off\n\t\tconst width = selectedWidth === newWidth ? undefined : newWidth;\n\n\t\t// Update attributes.\n\t\tsetAttributes( { width } );\n\t}\n\n\treturn (\n\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t<ButtonGroup aria-label={ __( 'Button width' ) }>\n\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\twidthValue === selectedWidth\n\t\t\t\t\t\t\t\t\t? 'primary'\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ () => handleChange( widthValue ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ widthValue }%\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ButtonGroup>\n\t\t</PanelBody>\n\t);\n}\n\nfunction ButtonEdit( props ) {\n\tconst {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tclassName,\n\t\tisSelected,\n\t\tonReplace,\n\t\tmergeBlocks,\n\t\tclientId,\n\t\tcontext,\n\t} = props;\n\tconst {\n\t\ttagName,\n\t\ttextAlign,\n\t\tlinkTarget,\n\t\tplaceholder,\n\t\trel,\n\t\tstyle,\n\t\ttext,\n\t\turl,\n\t\twidth,\n\t\tmetadata,\n\t} = attributes;\n\n\tconst TagName = tagName || 'a';\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tstartEditing( event );\n\t\t} else if ( isKeyboardEvent.primaryShift( event, 'k' ) ) {\n\t\t\tunlink();\n\t\t\trichTextRef.current?.focus();\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst colorProps = useColorProps( attributes );\n\tconst spacingProps = useSpacingProps( attributes );\n\tconst shadowProps = useShadowProps( attributes );\n\tconst ref = useRef();\n\tconst richTextRef = useRef();\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, ref ] ),\n\t\tonKeyDown,\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst isURLSet = !! url;\n\tconst opensInNewTab = linkTarget === NEW_TAB_TARGET;\n\tconst nofollow = !! rel?.includes( NOFOLLOW_REL );\n\tconst isLinkTag = 'a' === TagName;\n\n\tfunction startEditing( event ) {\n\t\tevent.preventDefault();\n\t\tsetIsEditingURL( true );\n\t}\n\n\tfunction unlink() {\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlinkTarget: undefined,\n\t\t\trel: undefined,\n\t\t} );\n\t\tsetIsEditingURL( false );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsEditingURL( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// Memoize link value to avoid overriding the LinkControl's internal state.\n\t// This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256.\n\tconst linkValue = useMemo(\n\t\t() => ( { url, opensInNewTab, nofollow } ),\n\t\t[ url, opensInNewTab, nofollow ]\n\t);\n\n\tconst useEnterRef = useEnter( { content: text, clientId } );\n\tconst mergedRef = useMergeRefs( [ useEnterRef, richTextRef ] );\n\n\tconst { lockUrlControls = false } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst blockBindingsSource = getBlockBindingsSource(\n\t\t\t\tmetadata?.bindings?.url?.source\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! metadata?.bindings?.url &&\n\t\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: metadata?.bindings?.url?.args,\n\t\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ context, isSelected, metadata?.bindings?.url ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( blockProps.className, {\n\t\t\t\t\t[ `has-custom-width wp-block-button__width-${ width }` ]:\n\t\t\t\t\t\twidth,\n\t\t\t\t\t[ `has-custom-font-size` ]: blockProps.style.fontSize,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tref={ mergedRef }\n\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\tplaceholder={ placeholder || __( 'Add text…' ) }\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttext: removeAnchorTag( value ),\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t'wp-block-button__link',\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t\t\t\t\t// For backwards compatibility add style that isn't\n\t\t\t\t\t\t\t// provided via block support.\n\t\t\t\t\t\t\t'no-border-radius': style?.border?.radius === 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...colorProps.style,\n\t\t\t\t\t\t...spacingProps.style,\n\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t} }\n\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\tidentifier=\"text\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! isURLSet && isLinkTag && ! lockUrlControls && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ link }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ startEditing }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isURLSet && isLinkTag && ! lockUrlControls && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\ttitle={ __( 'Unlink' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift( 'k' ) }\n\t\t\t\t\t\tonClick={ unlink }\n\t\t\t\t\t\tisActive\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t{ isLinkTag &&\n\t\t\t\tisSelected &&\n\t\t\t\t( isEditingURL || isURLSet ) &&\n\t\t\t\t! lockUrlControls && (\n\t\t\t\t\t<Popover\n\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\tfocusOnMount={ isEditingURL ? 'firstElement' : false }\n\t\t\t\t\t\t__unstableSlotName=\"__unstable-block-tools-after\"\n\t\t\t\t\t\tshift\n\t\t\t\t\t>\n\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\tvalue={ linkValue }\n\t\t\t\t\t\t\tonChange={ ( {\n\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t\t} ) =>\n\t\t\t\t\t\t\t\tsetAttributes(\n\t\t\t\t\t\t\t\t\tgetUpdatedLinkAttributes( {\n\t\t\t\t\t\t\t\t\t\trel,\n\t\t\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\t\t\tnofollow: newNofollow,\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\tonRemove={ () => {\n\t\t\t\t\t\t\t\tunlink();\n\t\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tforceIsEditingLink={ isEditingURL }\n\t\t\t\t\t\t\tsettings={ LINK_SETTINGS }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Popover>\n\t\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<WidthPanel\n\t\t\t\t\tselectedWidth={ width }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t{ isLinkTag && (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n\nexport default ButtonEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,cAAc,EAAEC,YAAY,QAAQ,aAAa;AAC1D,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,OAAOC,eAAe,MAAM,4BAA4B;;AAExD;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,OAAO,QAAQ,oBAAoB;AACzE,SACCC,MAAM,EACNC,WAAW,EACXC,SAAS,EACTC,WAAW,EACXC,aAAa,EACbC,OAAO,QACD,uBAAuB;AAC9B,SACCC,gBAAgB,EAChBC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACRC,aAAa,EACbC,WAAW,EACXC,4BAA4B,IAAIC,cAAc,EAC9CC,2BAA2B,IAAIC,aAAa,EAC5CC,wCAAwC,IAAIC,eAAe,EAC3DC,uCAAuC,IAAIC,cAAc,EACzDC,iCAAiC,EACjCC,KAAK,IAAIC,gBAAgB,EACzBC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,eAAe,EAAEC,eAAe,EAAEC,KAAK,QAAQ,qBAAqB;AAC7E,SAASC,IAAI,EAAEC,OAAO,QAAQ,kBAAkB;AAChD,SACCC,WAAW,EACXC,UAAU,EACVC,mBAAmB,EACnBC,sBAAsB,QAChB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nC0C,QAAQ,EAAGvH;MAAe,CAC1B;IAAC,CACM,CACT,eACFH,IAAA,CAAChC,iBAAiB;MAAA0E,QAAA,eACjB1C,IAAA,CAACmC,UAAU;QACVC,aAAa,EAAGI,KAAO;QACvBH,aAAa,EAAGA;MAAe,CAC/B;IAAC,CACgB,CAAC,eACpBrC,IAAA,CAAChC,iBAAiB;MAACyI,KAAK,EAAC,UAAU;MAAA/D,QAAA,EAChC4C,SAAS,iBACVtF,IAAA,CAACrC,WAAW;QACXgK,qBAAqB;QACrBC,uBAAuB;QACvBC,KAAK,EAAG1K,EAAE,CAAE,UAAW,CAAG;QAC1B+I,KAAK,EAAGvC,GAAG,IAAI,EAAI;QACnBwC,QAAQ,EAAK2B,MAAM,IAClBzF,aAAa,CAAE;UAAEsB,GAAG,EAAEmE;QAAO,CAAE;MAC/B,CACD;IACD,CACiB,CAAC;EAAA,CACnB,CAAC;AAEL;AAEA,eAAe9E,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","NEW_TAB_TARGET","NOFOLLOW_REL","getUpdatedLinkAttributes","removeAnchorTag","useToolsPanelDropdownMenuProps","__","useEffect","useState","useRef","useMemo","TextControl","ToolbarButton","Popover","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","AlignmentControl","BlockControls","InspectorControls","RichText","useBlockProps","LinkControl","__experimentalUseBorderProps","useBorderProps","__experimentalUseColorProps","useColorProps","__experimentalGetSpacingClassesAndStyles","useSpacingProps","__experimentalGetShadowClassesAndStyles","useShadowProps","__experimentalGetElementClassName","store","blockEditorStore","useBlockEditingMode","getTypographyClassesAndStyles","useTypographyProps","useSettings","displayShortcut","isKeyboardEvent","ENTER","link","linkOff","createBlock","cloneBlock","getDefaultBlockName","getBlockBindingsSource","useMergeRefs","useRefEffect","useSelect","useDispatch","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","LINK_SETTINGS","DEFAULT_LINK_SETTINGS","id","title","useEnter","props","replaceBlocks","selectionChange","getBlock","getBlockRootClientId","getBlockIndex","propsRef","current","element","onKeyDown","event","defaultPrevented","keyCode","content","clientId","length","preventDefault","topParentListBlock","blockIndex","head","innerBlocks","slice","middle","after","tail","addEventListener","removeEventListener","WidthPanel","selectedWidth","setAttributes","dropdownMenuProps","label","resetAll","width","undefined","children","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","value","onChange","newWidth","isBlock","__next40pxDefaultSize","map","widthValue","ButtonEdit","attributes","className","isSelected","onReplace","mergeBlocks","context","tagName","textAlign","linkTarget","placeholder","rel","style","text","url","metadata","TagName","primary","startEditing","primaryShift","unlink","richTextRef","focus","popoverAnchor","setPopoverAnchor","borderProps","colorProps","spacingProps","shadowProps","ref","blockProps","blockEditingMode","isEditingURL","setIsEditingURL","isURLSet","opensInNewTab","nofollow","includes","isLinkTag","linkValue","useEnterRef","mergedRef","lockUrlControls","select","blockBindingsSource","bindings","source","canUserEditValue","args","fluidTypographySettings","layout","typographyProps","typography","fluid","wideSize","withoutInteractiveFormatting","border","radius","fontSize","writingMode","onMerge","identifier","group","nextAlign","name","icon","shortcut","onClick","isActive","placement","onClose","anchor","focusOnMount","__unstableSlotName","shift","newURL","newOpensInNewTab","newNofollow","onRemove","forceIsEditingLink","settings","newRel"],"sources":["@wordpress/block-library/src/button/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';\nimport { getUpdatedLinkAttributes } from './get-updated-link-attributes';\nimport removeAnchorTag from '../utils/remove-anchor-tag';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useState, useRef, useMemo } from '@wordpress/element';\nimport {\n\tTextControl,\n\tToolbarButton,\n\tPopover,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tLinkControl,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalGetSpacingClassesAndStyles as useSpacingProps,\n\t__experimentalGetShadowClassesAndStyles as useShadowProps,\n\t__experimentalGetElementClassName,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';\nimport { link, linkOff } from '@wordpress/icons';\nimport {\n\tcreateBlock,\n\tcloneBlock,\n\tgetDefaultBlockName,\n\tgetBlockBindingsSource,\n} from '@wordpress/blocks';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst LINK_SETTINGS = [\n\t...LinkControl.DEFAULT_LINK_SETTINGS,\n\t{\n\t\tid: 'nofollow',\n\t\ttitle: __( 'Mark as nofollow' ),\n\t},\n];\n\nfunction useEnter( props ) {\n\tconst { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );\n\tconst { getBlock, getBlockRootClientId, getBlockIndex } =\n\t\tuseSelect( blockEditorStore );\n\tconst propsRef = useRef( props );\n\tpropsRef.current = props;\n\treturn useRefEffect( ( element ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented || event.keyCode !== ENTER ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { content, clientId } = propsRef.current;\n\t\t\tif ( content.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tconst topParentListBlock = getBlock(\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t\tconst blockIndex = getBlockIndex( clientId );\n\t\t\tconst head = cloneBlock( {\n\t\t\t\t...topParentListBlock,\n\t\t\t\tinnerBlocks: topParentListBlock.innerBlocks.slice(\n\t\t\t\t\t0,\n\t\t\t\t\tblockIndex\n\t\t\t\t),\n\t\t\t} );\n\t\t\tconst middle = createBlock( getDefaultBlockName() );\n\t\t\tconst after = topParentListBlock.innerBlocks.slice(\n\t\t\t\tblockIndex + 1\n\t\t\t);\n\t\t\tconst tail = after.length\n\t\t\t\t? [\n\t\t\t\t\t\tcloneBlock( {\n\t\t\t\t\t\t\t...topParentListBlock,\n\t\t\t\t\t\t\tinnerBlocks: after,\n\t\t\t\t\t\t} ),\n\t\t\t\t ]\n\t\t\t\t: [];\n\t\t\treplaceBlocks(\n\t\t\t\ttopParentListBlock.clientId,\n\t\t\t\t[ head, middle, ...tail ],\n\t\t\t\t1\n\t\t\t);\n\t\t\t// We manually change the selection here because we are replacing\n\t\t\t// a different block than the selected one.\n\t\t\tselectionChange( middle.clientId );\n\t\t}\n\n\t\telement.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\telement.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n\nfunction WidthPanel( { selectedWidth, setAttributes } ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Settings' ) }\n\t\t\tresetAll={ () => setAttributes( { width: undefined } ) }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! selectedWidth }\n\t\t\t\tonDeselect={ () => setAttributes( { width: undefined } ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t>\n\t\t\t\t<ToggleGroupControl\n\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\tvalue={ selectedWidth }\n\t\t\t\t\tonChange={ ( newWidth ) =>\n\t\t\t\t\t\tsetAttributes( { width: newWidth } )\n\t\t\t\t\t}\n\t\t\t\t\tisBlock\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t>\n\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\tlabel={ `${ widthValue }%` }\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</ToggleGroupControl>\n\t\t\t</ToolsPanelItem>\n\t\t</ToolsPanel>\n\t);\n}\n\nfunction ButtonEdit( props ) {\n\tconst {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tclassName,\n\t\tisSelected,\n\t\tonReplace,\n\t\tmergeBlocks,\n\t\tclientId,\n\t\tcontext,\n\t} = props;\n\tconst {\n\t\ttagName,\n\t\ttextAlign,\n\t\tlinkTarget,\n\t\tplaceholder,\n\t\trel,\n\t\tstyle,\n\t\ttext,\n\t\turl,\n\t\twidth,\n\t\tmetadata,\n\t} = attributes;\n\n\tconst TagName = tagName || 'a';\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tstartEditing( event );\n\t\t} else if ( isKeyboardEvent.primaryShift( event, 'k' ) ) {\n\t\t\tunlink();\n\t\t\trichTextRef.current?.focus();\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst colorProps = useColorProps( attributes );\n\tconst spacingProps = useSpacingProps( attributes );\n\tconst shadowProps = useShadowProps( attributes );\n\tconst ref = useRef();\n\tconst richTextRef = useRef();\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, ref ] ),\n\t\tonKeyDown,\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst isURLSet = !! url;\n\tconst opensInNewTab = linkTarget === NEW_TAB_TARGET;\n\tconst nofollow = !! rel?.includes( NOFOLLOW_REL );\n\tconst isLinkTag = 'a' === TagName;\n\n\tfunction startEditing( event ) {\n\t\tevent.preventDefault();\n\t\tsetIsEditingURL( true );\n\t}\n\n\tfunction unlink() {\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlinkTarget: undefined,\n\t\t\trel: undefined,\n\t\t} );\n\t\tsetIsEditingURL( false );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsEditingURL( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// Memoize link value to avoid overriding the LinkControl's internal state.\n\t// This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256.\n\tconst linkValue = useMemo(\n\t\t() => ( { url, opensInNewTab, nofollow } ),\n\t\t[ url, opensInNewTab, nofollow ]\n\t);\n\n\tconst useEnterRef = useEnter( { content: text, clientId } );\n\tconst mergedRef = useMergeRefs( [ useEnterRef, richTextRef ] );\n\n\tconst { lockUrlControls = false } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst blockBindingsSource = getBlockBindingsSource(\n\t\t\t\tmetadata?.bindings?.url?.source\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! metadata?.bindings?.url &&\n\t\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: metadata?.bindings?.url?.args,\n\t\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ context, isSelected, metadata?.bindings?.url ]\n\t);\n\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\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( blockProps.className, {\n\t\t\t\t\t[ `has-custom-width wp-block-button__width-${ width }` ]:\n\t\t\t\t\t\twidth,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tref={ mergedRef }\n\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\tplaceholder={ placeholder || __( 'Add text…' ) }\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttext: removeAnchorTag( value ),\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t'wp-block-button__link',\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\ttypographyProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t\t\t\t\t// For backwards compatibility add style that isn't\n\t\t\t\t\t\t\t// provided via block support.\n\t\t\t\t\t\t\t'no-border-radius': style?.border?.radius === 0,\n\t\t\t\t\t\t\t[ `has-custom-font-size` ]:\n\t\t\t\t\t\t\t\tblockProps.style.fontSize,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...colorProps.style,\n\t\t\t\t\t\t...spacingProps.style,\n\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t\t...typographyProps.style,\n\t\t\t\t\t\twritingMode: undefined,\n\t\t\t\t\t} }\n\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\tidentifier=\"text\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! isURLSet && isLinkTag && ! lockUrlControls && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ link }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ startEditing }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isURLSet && isLinkTag && ! lockUrlControls && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\ttitle={ __( 'Unlink' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift( 'k' ) }\n\t\t\t\t\t\tonClick={ unlink }\n\t\t\t\t\t\tisActive\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t{ isLinkTag &&\n\t\t\t\tisSelected &&\n\t\t\t\t( isEditingURL || isURLSet ) &&\n\t\t\t\t! lockUrlControls && (\n\t\t\t\t\t<Popover\n\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\tfocusOnMount={ isEditingURL ? 'firstElement' : false }\n\t\t\t\t\t\t__unstableSlotName=\"__unstable-block-tools-after\"\n\t\t\t\t\t\tshift\n\t\t\t\t\t>\n\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\tvalue={ linkValue }\n\t\t\t\t\t\t\tonChange={ ( {\n\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t\t} ) =>\n\t\t\t\t\t\t\t\tsetAttributes(\n\t\t\t\t\t\t\t\t\tgetUpdatedLinkAttributes( {\n\t\t\t\t\t\t\t\t\t\trel,\n\t\t\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\t\t\tnofollow: newNofollow,\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\tonRemove={ () => {\n\t\t\t\t\t\t\t\tunlink();\n\t\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tforceIsEditingLink={ isEditingURL }\n\t\t\t\t\t\t\tsettings={ LINK_SETTINGS }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Popover>\n\t\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<WidthPanel\n\t\t\t\t\tselectedWidth={ width }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t{ isLinkTag && (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n\nexport default ButtonEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,cAAc,EAAEC,YAAY,QAAQ,aAAa;AAC1D,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,OAAOC,eAAe,MAAM,4BAA4B;AACxD,SAASC,8BAA8B,QAAQ,gBAAgB;;AAE/D;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,OAAO,QAAQ,oBAAoB;AACzE,SACCC,WAAW,EACXC,aAAa,EACbC,OAAO,EACPC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,QAC5D,uBAAuB;AAC9B,SACCC,gBAAgB,EAChBC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACRC,aAAa,EACbC,WAAW,EACXC,4BAA4B,IAAIC,cAAc,EAC9CC,2BAA2B,IAAIC,aAAa,EAC5CC,wCAAwC,IAAIC,eAAe,EAC3DC,uCAAuC,IAAIC,cAAc,EACzDC,iCAAiC,EACjCC,KAAK,IAAIC,gBAAgB,EACzBC,mBAAmB,EACnBC,6BAA6B,IAAIC,kBAAkB,EACnDC,WAAW,QACL,yBAAyB;AAChC,SAASC,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AAE,CAAE,UAAW,CAAG;QAC1BqG,KAAK,EAAGkB,GAAG,IAAI,EAAI;QACnBjB,QAAQ,EAAKuF,MAAM,IAClBnG,aAAa,CAAE;UAAE6B,GAAG,EAAEsE;QAAO,CAAE;MAC/B,CACD;IACD,CACiB,CAAC;EAAA,CACnB,CAAC;AAEL;AAEA,eAAejF,UAAU","ignoreList":[]}
|
|
@@ -97,6 +97,7 @@ const metadata = {
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
typography: {
|
|
100
|
+
__experimentalSkipSerialization: ["fontSize", "lineHeight", "fontFamily", "fontWeight", "fontStyle", "textTransform", "textDecoration", "letterSpacing"],
|
|
100
101
|
fontSize: true,
|
|
101
102
|
lineHeight: true,
|
|
102
103
|
__experimentalFontFamily: true,
|
|
@@ -134,7 +135,6 @@ const metadata = {
|
|
|
134
135
|
width: true
|
|
135
136
|
}
|
|
136
137
|
},
|
|
137
|
-
__experimentalSelector: ".wp-block-button .wp-block-button__link",
|
|
138
138
|
interactivity: {
|
|
139
139
|
clientNavigation: true
|
|
140
140
|
}
|
|
@@ -148,7 +148,13 @@ const metadata = {
|
|
|
148
148
|
label: "Outline"
|
|
149
149
|
}],
|
|
150
150
|
editorStyle: "wp-block-button-editor",
|
|
151
|
-
style: "wp-block-button"
|
|
151
|
+
style: "wp-block-button",
|
|
152
|
+
selectors: {
|
|
153
|
+
root: ".wp-block-button .wp-block-button__link",
|
|
154
|
+
typography: {
|
|
155
|
+
writingMode: ".wp-block-button"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
152
158
|
};
|
|
153
159
|
import save from './save';
|
|
154
160
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","button","icon","initBlock","deprecated","edit","metadata","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","role","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","
|
|
1
|
+
{"version":3,"names":["__","button","icon","initBlock","deprecated","edit","metadata","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","role","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","interactivity","clientNavigation","styles","label","isDefault","editorStyle","selectors","root","writingMode","save","settings","example","className","merge","a","init"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,IAAIC,IAAI,QAAQ,kBAAkB;;AAEjD;AACA;AACA;A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AE,CAAC","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { RichText, useBlockProps, __experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles, __experimentalGetColorClassesAndStyles as getColorClassesAndStyles, __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles, __experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles, __experimentalGetElementClassName } from '@wordpress/block-editor';
|
|
9
|
+
import { RichText, useBlockProps, __experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles, __experimentalGetColorClassesAndStyles as getColorClassesAndStyles, __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles, __experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles, __experimentalGetElementClassName, getTypographyClassesAndStyles } from '@wordpress/block-editor';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
export default function save({
|
|
12
12
|
attributes,
|
|
@@ -32,17 +32,21 @@ export default function save({
|
|
|
32
32
|
const colorProps = getColorClassesAndStyles(attributes);
|
|
33
33
|
const spacingProps = getSpacingClassesAndStyles(attributes);
|
|
34
34
|
const shadowProps = getShadowClassesAndStyles(attributes);
|
|
35
|
-
const
|
|
35
|
+
const typographyProps = getTypographyClassesAndStyles(attributes);
|
|
36
|
+
const buttonClasses = clsx('wp-block-button__link', colorProps.className, borderProps.className, typographyProps.className, {
|
|
36
37
|
[`has-text-align-${textAlign}`]: textAlign,
|
|
37
38
|
// For backwards compatibility add style that isn't provided via
|
|
38
39
|
// block support.
|
|
39
|
-
'no-border-radius': style?.border?.radius === 0
|
|
40
|
+
'no-border-radius': style?.border?.radius === 0,
|
|
41
|
+
[`has-custom-font-size`]: fontSize || style?.typography?.fontSize
|
|
40
42
|
}, __experimentalGetElementClassName('button'));
|
|
41
43
|
const buttonStyle = {
|
|
42
44
|
...borderProps.style,
|
|
43
45
|
...colorProps.style,
|
|
44
46
|
...spacingProps.style,
|
|
45
|
-
...shadowProps.style
|
|
47
|
+
...shadowProps.style,
|
|
48
|
+
...typographyProps.style,
|
|
49
|
+
writingMode: undefined
|
|
46
50
|
};
|
|
47
51
|
|
|
48
52
|
// The use of a `title` attribute here is soft-deprecated, but still applied
|
|
@@ -50,8 +54,7 @@ export default function save({
|
|
|
50
54
|
// A title will no longer be assigned for new or updated button block links.
|
|
51
55
|
|
|
52
56
|
const wrapperClasses = clsx(className, {
|
|
53
|
-
[`has-custom-width wp-block-button__width-${width}`]: width
|
|
54
|
-
[`has-custom-font-size`]: fontSize || style?.typography?.fontSize
|
|
57
|
+
[`has-custom-width wp-block-button__width-${width}`]: width
|
|
55
58
|
});
|
|
56
59
|
return /*#__PURE__*/_jsx("div", {
|
|
57
60
|
...useBlockProps.save({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","RichText","useBlockProps","__experimentalGetBorderClassesAndStyles","getBorderClassesAndStyles","__experimentalGetColorClassesAndStyles","getColorClassesAndStyles","__experimentalGetSpacingClassesAndStyles","getSpacingClassesAndStyles","__experimentalGetShadowClassesAndStyles","getShadowClassesAndStyles","__experimentalGetElementClassName","jsx","_jsx","save","attributes","className","tagName","type","textAlign","fontSize","linkTarget","rel","style","text","title","url","width","TagName","isButtonTag","buttonType","borderProps","colorProps","spacingProps","shadowProps","buttonClasses","border","radius","buttonStyle","
|
|
1
|
+
{"version":3,"names":["clsx","RichText","useBlockProps","__experimentalGetBorderClassesAndStyles","getBorderClassesAndStyles","__experimentalGetColorClassesAndStyles","getColorClassesAndStyles","__experimentalGetSpacingClassesAndStyles","getSpacingClassesAndStyles","__experimentalGetShadowClassesAndStyles","getShadowClassesAndStyles","__experimentalGetElementClassName","getTypographyClassesAndStyles","jsx","_jsx","save","attributes","className","tagName","type","textAlign","fontSize","linkTarget","rel","style","text","title","url","width","TagName","isButtonTag","buttonType","borderProps","colorProps","spacingProps","shadowProps","typographyProps","buttonClasses","border","radius","typography","buttonStyle","writingMode","undefined","wrapperClasses","children","Content","href","value","target"],"sources":["@wordpress/block-library/src/button/save.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,\n\t__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,\n\t__experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\t__experimentalGetElementClassName,\n\tgetTypographyClassesAndStyles,\n} from '@wordpress/block-editor';\n\nexport default function save( { attributes, className } ) {\n\tconst {\n\t\ttagName,\n\t\ttype,\n\t\ttextAlign,\n\t\tfontSize,\n\t\tlinkTarget,\n\t\trel,\n\t\tstyle,\n\t\ttext,\n\t\ttitle,\n\t\turl,\n\t\twidth,\n\t} = attributes;\n\n\tconst TagName = tagName || 'a';\n\tconst isButtonTag = 'button' === TagName;\n\tconst buttonType = type || 'button';\n\tconst borderProps = getBorderClassesAndStyles( attributes );\n\tconst colorProps = getColorClassesAndStyles( attributes );\n\tconst spacingProps = getSpacingClassesAndStyles( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst typographyProps = getTypographyClassesAndStyles( attributes );\n\tconst buttonClasses = clsx(\n\t\t'wp-block-button__link',\n\t\tcolorProps.className,\n\t\tborderProps.className,\n\t\ttypographyProps.className,\n\t\t{\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t// For backwards compatibility add style that isn't provided via\n\t\t\t// block support.\n\t\t\t'no-border-radius': style?.border?.radius === 0,\n\t\t\t[ `has-custom-font-size` ]: fontSize || style?.typography?.fontSize,\n\t\t},\n\t\t__experimentalGetElementClassName( 'button' )\n\t);\n\tconst buttonStyle = {\n\t\t...borderProps.style,\n\t\t...colorProps.style,\n\t\t...spacingProps.style,\n\t\t...shadowProps.style,\n\t\t...typographyProps.style,\n\t\twritingMode: undefined,\n\t};\n\n\t// The use of a `title` attribute here is soft-deprecated, but still applied\n\t// if it had already been assigned, for the sake of backward-compatibility.\n\t// A title will no longer be assigned for new or updated button block links.\n\n\tconst wrapperClasses = clsx( className, {\n\t\t[ `has-custom-width wp-block-button__width-${ width }` ]: width,\n\t} );\n\n\treturn (\n\t\t<div { ...useBlockProps.save( { className: wrapperClasses } ) }>\n\t\t\t<RichText.Content\n\t\t\t\ttagName={ TagName }\n\t\t\t\ttype={ isButtonTag ? buttonType : null }\n\t\t\t\tclassName={ buttonClasses }\n\t\t\t\thref={ isButtonTag ? null : url }\n\t\t\t\ttitle={ title }\n\t\t\t\tstyle={ buttonStyle }\n\t\t\t\tvalue={ text }\n\t\t\t\ttarget={ isButtonTag ? null : linkTarget }\n\t\t\t\trel={ isButtonTag ? null : rel }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,aAAa,EACbC,uCAAuC,IAAIC,yBAAyB,EACpEC,sCAAsC,IAAIC,wBAAwB,EAClEC,wCAAwC,IAAIC,0BAA0B,EACtEC,uCAAuC,IAAIC,yBAAyB,EACpEC,iCAAiC,EACjCC,6BAA6B,QACvB,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjC,eAAe,SAASC,IAAIA,CAAE;EAAEC,UAAU;EAAEC;AAAU,CAAC,EAAG;EACzD,MAAM;IACLC,OAAO;IACPC,IAAI;IACJC,SAAS;IACTC,QAAQ;IACRC,UAAU;IACVC,GAAG;IACHC,KAAK;IACLC,IAAI;IACJC,KAAK;IACLC,GAAG;IACHC;EACD,CAAC,GAAGZ,UAAU;EAEd,MAAMa,OAAO,GAAGX,OAAO,IAAI,GAAG;EAC9B,MAAMY,WAAW,GAAG,QAAQ,KAAKD,OAAO;EACxC,MAAME,UAAU,G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,IAAI,EAAGW,WAAW,GAAGC,UAAU,GAAG,IAAM;MACxCd,SAAS,EAAGoB,aAAe;MAC3BU,IAAI,EAAGjB,WAAW,GAAG,IAAI,GAAGH,GAAK;MACjCD,KAAK,EAAGA,KAAO;MACfF,KAAK,EAAGiB,WAAa;MACrBO,KAAK,EAAGvB,IAAM;MACdwB,MAAM,EAAGnB,WAAW,GAAG,IAAI,GAAGR,UAAY;MAC1CC,GAAG,EAAGO,WAAW,GAAG,IAAI,GAAGP;IAAK,CAChC;EAAC,CACE,CAAC;AAER","ignoreList":[]}
|
|
@@ -7,9 +7,14 @@ import clsx from 'clsx';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { InnerBlocks, BlockControls, BlockVerticalAlignmentToolbar, InspectorControls, useBlockProps, useSettings, useInnerBlocksProps, store as blockEditorStore } from '@wordpress/block-editor';
|
|
10
|
-
import { __experimentalUseCustomUnits as useCustomUnits,
|
|
10
|
+
import { __experimentalUseCustomUnits as useCustomUnits, __experimentalUnitControl as UnitControl, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';
|
|
11
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
12
|
import { sprintf, __ } from '@wordpress/i18n';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
13
18
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
19
|
function ColumnInspectorControls({
|
|
15
20
|
width,
|
|
@@ -19,20 +24,35 @@ function ColumnInspectorControls({
|
|
|
19
24
|
const units = useCustomUnits({
|
|
20
25
|
availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw']
|
|
21
26
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
28
|
+
return /*#__PURE__*/_jsx(ToolsPanel, {
|
|
29
|
+
label: __('Settings'),
|
|
30
|
+
resetAll: () => {
|
|
31
|
+
setAttributes({
|
|
32
|
+
width: undefined
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
36
|
+
children: /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
37
|
+
hasValue: () => width !== undefined,
|
|
25
38
|
label: __('Width'),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
onDeselect: () => setAttributes({
|
|
40
|
+
width: undefined
|
|
41
|
+
}),
|
|
42
|
+
isShownByDefault: true,
|
|
43
|
+
children: /*#__PURE__*/_jsx(UnitControl, {
|
|
44
|
+
label: __('Width'),
|
|
45
|
+
__unstableInputWidth: "calc(50% - 8px)",
|
|
46
|
+
__next40pxDefaultSize: true,
|
|
47
|
+
value: width || '',
|
|
48
|
+
onChange: nextWidth => {
|
|
49
|
+
nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
|
|
50
|
+
setAttributes({
|
|
51
|
+
width: nextWidth
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
units: units
|
|
55
|
+
})
|
|
36
56
|
})
|
|
37
57
|
});
|
|
38
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","InnerBlocks","BlockControls","BlockVerticalAlignmentToolbar","InspectorControls","useBlockProps","useSettings","useInnerBlocksProps","store","blockEditorStore","__experimentalUseCustomUnits","useCustomUnits","
|
|
1
|
+
{"version":3,"names":["clsx","InnerBlocks","BlockControls","BlockVerticalAlignmentToolbar","InspectorControls","useBlockProps","useSettings","useInnerBlocksProps","store","blockEditorStore","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","useSelect","useDispatch","sprintf","__","useToolsPanelDropdownMenuProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ColumnInspectorControls","width","setAttributes","availableUnits","units","dropdownMenuProps","label","resetAll","undefined","children","hasValue","onDeselect","isShownByDefault","__unstableInputWidth","__next40pxDefaultSize","value","onChange","nextWidth","parseFloat","ColumnEdit","attributes","verticalAlignment","templateLock","allowedBlocks","clientId","classes","columnsIds","hasChildBlocks","rootClientId","select","getBlockOrder","getBlockRootClientId","rootId","length","updateBlockAttributes","updateAlignment","widthWithUnit","Number","isFinite","blockProps","className","style","flexBasis","columnsCount","currentColumnPosition","indexOf","innerBlocksProps","renderAppender","ButtonBlockAppender","controls"],"sources":["@wordpress/block-library/src/column/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tInnerBlocks,\n\tBlockControls,\n\tBlockVerticalAlignmentToolbar,\n\tInspectorControls,\n\tuseBlockProps,\n\tuseSettings,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { sprintf, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nfunction ColumnInspectorControls( { width, setAttributes } ) {\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ '%', 'px', 'em', 'rem', 'vw' ],\n\t} );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Settings' ) }\n\t\t\tresetAll={ () => {\n\t\t\t\tsetAttributes( { width: undefined } );\n\t\t\t} }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => width !== undefined }\n\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { width: undefined } ) }\n\t\t\t\tisShownByDefault\n\t\t\t>\n\t\t\t\t<UnitControl\n\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t__unstableInputWidth=\"calc(50% - 8px)\"\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvalue={ width || '' }\n\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t0 > parseFloat( nextWidth ) ? '0' : nextWidth;\n\t\t\t\t\t\tsetAttributes( { width: nextWidth } );\n\t\t\t\t\t} }\n\t\t\t\t\tunits={ units }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t</ToolsPanel>\n\t);\n}\n\nfunction ColumnEdit( {\n\tattributes: { verticalAlignment, width, templateLock, allowedBlocks },\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst classes = clsx( 'block-core-columns', {\n\t\t[ `is-vertically-aligned-${ verticalAlignment }` ]: verticalAlignment,\n\t} );\n\tconst { columnsIds, hasChildBlocks, rootClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockOrder, getBlockRootClientId } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootId = getBlockRootClientId( clientId );\n\n\t\t\treturn {\n\t\t\t\thasChildBlocks: getBlockOrder( clientId ).length > 0,\n\t\t\t\trootClientId: rootId,\n\t\t\t\tcolumnsIds: getBlockOrder( rootId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tconst updateAlignment = ( value ) => {\n\t\t// Update own alignment.\n\t\tsetAttributes( { verticalAlignment: value } );\n\t\t// Reset parent Columns block.\n\t\tupdateBlockAttributes( rootClientId, {\n\t\t\tverticalAlignment: null,\n\t\t} );\n\t};\n\n\tconst widthWithUnit = Number.isFinite( width ) ? width + '%' : width;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t\tstyle: widthWithUnit ? { flexBasis: widthWithUnit } : undefined,\n\t} );\n\n\tconst columnsCount = columnsIds.length;\n\tconst currentColumnPosition = columnsIds.indexOf( clientId ) + 1;\n\n\tconst label = sprintf(\n\t\t/* translators: 1: Block label (i.e. \"Block: Column\"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */\n\t\t__( '%1$s (%2$d of %3$d)' ),\n\t\tblockProps[ 'aria-label' ],\n\t\tcurrentColumnPosition,\n\t\tcolumnsCount\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ ...blockProps, 'aria-label': label },\n\t\t{\n\t\t\ttemplateLock,\n\t\t\tallowedBlocks,\n\t\t\trenderAppender: hasChildBlocks\n\t\t\t\t? undefined\n\t\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\t}\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<BlockVerticalAlignmentToolbar\n\t\t\t\t\tonChange={ updateAlignment }\n\t\t\t\t\tvalue={ verticalAlignment }\n\t\t\t\t\tcontrols={ [ 'top', 'center', 'bottom', 'stretch' ] }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<ColumnInspectorControls\n\t\t\t\t\twidth={ width }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nexport default ColumnEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,WAAW,EACXC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AAA,CAACpB,iBAAiB;MAAAkC,QAAA,eACjBd,IAAA,CAACK,uBAAuB;QACvBC,KAAK,EAAGA,KAAO;QACfC,aAAa,EAAGA;MAAe,CAC/B;IAAC,CACgB,CAAC,eACpBP,IAAA;MAAA,GAAUmD;IAAgB,CAAI,CAAC;EAAA,CAC9B,CAAC;AAEL;AAEA,eAAe3B,UAAU","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
|
-
import { Notice,
|
|
11
|
+
import { Notice, RangeControl, ToggleControl, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalVStack as VStack } from '@wordpress/components';
|
|
12
12
|
import { InspectorControls, useInnerBlocksProps, BlockControls, BlockVerticalAlignmentToolbar, __experimentalBlockVariationPicker, useBlockProps, store as blockEditorStore } from '@wordpress/block-editor';
|
|
13
13
|
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
14
14
|
import { createBlock, createBlocksFromInnerBlocksTemplate, store as blocksStore } from '@wordpress/blocks';
|
|
@@ -17,7 +17,8 @@ import { createBlock, createBlocksFromInnerBlocksTemplate, store as blocksStore
|
|
|
17
17
|
* Internal dependencies
|
|
18
18
|
*/
|
|
19
19
|
import { hasExplicitPercentColumnWidths, getMappedColumnWidths, getRedistributedColumnWidths, toWidthPrecision } from './utils';
|
|
20
|
-
import {
|
|
20
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
22
|
const DEFAULT_BLOCK = {
|
|
22
23
|
name: 'core/column'
|
|
23
24
|
};
|
|
@@ -34,21 +35,20 @@ function ColumnInspectorControls({
|
|
|
34
35
|
const {
|
|
35
36
|
canInsertBlockType,
|
|
36
37
|
canRemoveBlock,
|
|
37
|
-
|
|
38
|
-
getBlockCount
|
|
38
|
+
getBlockOrder
|
|
39
39
|
} = select(blockEditorStore);
|
|
40
|
-
const
|
|
40
|
+
const blockOrder = getBlockOrder(clientId);
|
|
41
41
|
|
|
42
42
|
// Get the indexes of columns for which removal is prevented.
|
|
43
43
|
// The highest index will be used to determine the minimum column count.
|
|
44
|
-
const preventRemovalBlockIndexes =
|
|
45
|
-
if (!canRemoveBlock(
|
|
44
|
+
const preventRemovalBlockIndexes = blockOrder.reduce((acc, blockId, index) => {
|
|
45
|
+
if (!canRemoveBlock(blockId)) {
|
|
46
46
|
acc.push(index);
|
|
47
47
|
}
|
|
48
48
|
return acc;
|
|
49
49
|
}, []);
|
|
50
50
|
return {
|
|
51
|
-
count:
|
|
51
|
+
count: blockOrder.length,
|
|
52
52
|
canInsertColumnBlock: canInsertBlockType('core/column', clientId),
|
|
53
53
|
minCount: Math.max(...preventRemovalBlockIndexes) + 1
|
|
54
54
|
};
|
|
@@ -106,28 +106,51 @@ function ColumnInspectorControls({
|
|
|
106
106
|
}
|
|
107
107
|
replaceInnerBlocks(clientId, innerBlocks);
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
109
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
110
|
+
return /*#__PURE__*/_jsxs(ToolsPanel, {
|
|
111
|
+
label: __('Settings'),
|
|
112
|
+
resetAll: () => {
|
|
113
|
+
updateColumns(count, minCount);
|
|
114
|
+
setAttributes({
|
|
115
|
+
isStackedOnMobile: true
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
119
|
+
children: [canInsertColumnBlock && /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
120
|
+
label: __('Columns'),
|
|
121
|
+
isShownByDefault: true,
|
|
122
|
+
hasValue: () => count,
|
|
123
|
+
onDeselect: () => updateColumns(count, minCount),
|
|
124
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
125
|
+
spacing: 4,
|
|
126
|
+
children: [/*#__PURE__*/_jsx(RangeControl, {
|
|
127
|
+
__nextHasNoMarginBottom: true,
|
|
128
|
+
__next40pxDefaultSize: true,
|
|
129
|
+
label: __('Columns'),
|
|
130
|
+
value: count,
|
|
131
|
+
onChange: value => updateColumns(count, Math.max(minCount, value)),
|
|
132
|
+
min: Math.max(1, minCount),
|
|
133
|
+
max: Math.max(6, count)
|
|
134
|
+
}), count > 6 && /*#__PURE__*/_jsx(Notice, {
|
|
135
|
+
status: "warning",
|
|
136
|
+
isDismissible: false,
|
|
137
|
+
children: __('This column count exceeds the recommended amount and may cause visual breakage.')
|
|
138
|
+
})]
|
|
139
|
+
})
|
|
140
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
127
141
|
label: __('Stack on mobile'),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
isShownByDefault: true,
|
|
143
|
+
hasValue: () => isStackedOnMobile !== true,
|
|
144
|
+
onDeselect: () => setAttributes({
|
|
145
|
+
isStackedOnMobile: true
|
|
146
|
+
}),
|
|
147
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
148
|
+
__nextHasNoMarginBottom: true,
|
|
149
|
+
label: __('Stack on mobile'),
|
|
150
|
+
checked: isStackedOnMobile,
|
|
151
|
+
onChange: () => setAttributes({
|
|
152
|
+
isStackedOnMobile: !isStackedOnMobile
|
|
153
|
+
})
|
|
131
154
|
})
|
|
132
155
|
})]
|
|
133
156
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__","Notice","PanelBody","RangeControl","ToggleControl","InspectorControls","useInnerBlocksProps","BlockControls","BlockVerticalAlignmentToolbar","__experimentalBlockVariationPicker","useBlockProps","store","blockEditorStore","useDispatch","useSelect","useRegistry","createBlock","createBlocksFromInnerBlocksTemplate","blocksStore","hasExplicitPercentColumnWidths","getMappedColumnWidths","getRedistributedColumnWidths","toWidthPrecision","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_BLOCK","name","ColumnInspectorControls","clientId","setAttributes","isStackedOnMobile","count","canInsertColumnBlock","minCount","select","canInsertBlockType","canRemoveBlock","getBlocks","getBlockCount","innerBlocks","preventRemovalBlockIndexes","reduce","acc","block","index","push","Math","max","replaceInnerBlocks","updateColumns","previousColumns","newColumns","hasExplicitWidths","isAddingColumn","newColumnWidth","newlyAddedColumns","widths","Array","from","length","map","width","slice","title","children","__nextHasNoMarginBottom","__next40pxDefaultSize","label","value","onChange","min","status","isDismissible","checked","ColumnsEditContainer","attributes","verticalAlignment","templateLock","registry","getBlockOrder","updateBlockAttributes","classes","blockProps","className","innerBlocksProps","defaultBlock","directInsert","orientation","renderAppender","updateAlignment","newVerticalAlignment","innerBlockClientIds","batch","Placeholder","blockType","defaultVariation","variations","getBlockVariations","getBlockType","getDefaultBlockVariation","icon","src","instructions","onSelect","nextVariation","allowSkip","ColumnsEdit","props","hasInnerBlocks","Component"],"sources":["@wordpress/block-library/src/columns/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tNotice,\n\tPanelBody,\n\tRangeControl,\n\tToggleControl,\n} from '@wordpress/components';\n\nimport {\n\tInspectorControls,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tBlockVerticalAlignmentToolbar,\n\t__experimentalBlockVariationPicker,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport {\n\tcreateBlock,\n\tcreateBlocksFromInnerBlocksTemplate,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\thasExplicitPercentColumnWidths,\n\tgetMappedColumnWidths,\n\tgetRedistributedColumnWidths,\n\ttoWidthPrecision,\n} from './utils';\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/column',\n};\n\nfunction ColumnInspectorControls( {\n\tclientId,\n\tsetAttributes,\n\tisStackedOnMobile,\n} ) {\n\tconst { count, canInsertColumnBlock, minCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanInsertBlockType,\n\t\t\t\tcanRemoveBlock,\n\t\t\t\tgetBlocks,\n\t\t\t\tgetBlockCount,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst innerBlocks = getBlocks( clientId );\n\n\t\t\t// Get the indexes of columns for which removal is prevented.\n\t\t\t// The highest index will be used to determine the minimum column count.\n\t\t\tconst preventRemovalBlockIndexes = innerBlocks.reduce(\n\t\t\t\t( acc, block, index ) => {\n\t\t\t\t\tif ( ! canRemoveBlock( block.clientId ) ) {\n\t\t\t\t\t\tacc.push( index );\n\t\t\t\t\t}\n\t\t\t\t\treturn acc;\n\t\t\t\t},\n\t\t\t\t[]\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tcount: getBlockCount( clientId ),\n\t\t\t\tcanInsertColumnBlock: canInsertBlockType(\n\t\t\t\t\t'core/column',\n\t\t\t\t\tclientId\n\t\t\t\t),\n\t\t\t\tminCount: Math.max( ...preventRemovalBlockIndexes ) + 1,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\n\t/**\n\t * Updates the column count, including necessary revisions to child Column\n\t * blocks to grant required or redistribute available space.\n\t *\n\t * @param {number} previousColumns Previous column count.\n\t * @param {number} newColumns New column count.\n\t */\n\tfunction updateColumns( previousColumns, newColumns ) {\n\t\tlet innerBlocks = getBlocks( clientId );\n\t\tconst hasExplicitWidths = hasExplicitPercentColumnWidths( innerBlocks );\n\n\t\t// Redistribute available width for existing inner blocks.\n\t\tconst isAddingColumn = newColumns > previousColumns;\n\n\t\tif ( isAddingColumn && hasExplicitWidths ) {\n\t\t\t// If adding a new column, assign width to the new column equal to\n\t\t\t// as if it were `1 / columns` of the total available space.\n\t\t\tconst newColumnWidth = toWidthPrecision( 100 / newColumns );\n\t\t\tconst newlyAddedColumns = newColumns - previousColumns;\n\n\t\t\t// Redistribute in consideration of pending block insertion as\n\t\t\t// constraining the available working width.\n\t\t\tconst widths = getRedistributedColumnWidths(\n\t\t\t\tinnerBlocks,\n\t\t\t\t100 - newColumnWidth * newlyAddedColumns\n\t\t\t);\n\n\t\t\tinnerBlocks = [\n\t\t\t\t...getMappedColumnWidths( innerBlocks, widths ),\n\t\t\t\t...Array.from( {\n\t\t\t\t\tlength: newlyAddedColumns,\n\t\t\t\t} ).map( () => {\n\t\t\t\t\treturn createBlock( 'core/column', {\n\t\t\t\t\t\twidth: `${ newColumnWidth }%`,\n\t\t\t\t\t} );\n\t\t\t\t} ),\n\t\t\t];\n\t\t} else if ( isAddingColumn ) {\n\t\t\tinnerBlocks = [\n\t\t\t\t...innerBlocks,\n\t\t\t\t...Array.from( {\n\t\t\t\t\tlength: newColumns - previousColumns,\n\t\t\t\t} ).map( () => {\n\t\t\t\t\treturn createBlock( 'core/column' );\n\t\t\t\t} ),\n\t\t\t];\n\t\t} else if ( newColumns < previousColumns ) {\n\t\t\t// The removed column will be the last of the inner blocks.\n\t\t\tinnerBlocks = innerBlocks.slice(\n\t\t\t\t0,\n\t\t\t\t-( previousColumns - newColumns )\n\t\t\t);\n\t\t\tif ( hasExplicitWidths ) {\n\t\t\t\t// Redistribute as if block is already removed.\n\t\t\t\tconst widths = getRedistributedColumnWidths( innerBlocks, 100 );\n\n\t\t\t\tinnerBlocks = getMappedColumnWidths( innerBlocks, widths );\n\t\t\t}\n\t\t}\n\n\t\treplaceInnerBlocks( clientId, innerBlocks );\n\t}\n\n\treturn (\n\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t{ canInsertColumnBlock && (\n\t\t\t\t<>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\tvalue={ count }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tupdateColumns( count, Math.max( minCount, value ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ Math.max( 1, minCount ) }\n\t\t\t\t\t\tmax={ Math.max( 6, count ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ count > 6 && (\n\t\t\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Notice>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Stack on mobile' ) }\n\t\t\t\tchecked={ isStackedOnMobile }\n\t\t\t\tonChange={ () =>\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tisStackedOnMobile: ! isStackedOnMobile,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nfunction ColumnsEditContainer( { attributes, setAttributes, clientId } ) {\n\tconst { isStackedOnMobile, verticalAlignment, templateLock } = attributes;\n\tconst registry = useRegistry();\n\tconst { getBlockOrder } = useSelect( blockEditorStore );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tconst classes = clsx( {\n\t\t[ `are-vertically-aligned-${ verticalAlignment }` ]: verticalAlignment,\n\t\t[ `is-not-stacked-on-mobile` ]: ! isStackedOnMobile,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\t\torientation: 'horizontal',\n\t\trenderAppender: false,\n\t\ttemplateLock,\n\t} );\n\n\t/**\n\t * Update all child Column blocks with a new vertical alignment setting\n\t * based on whatever alignment is passed in. This allows change to parent\n\t * to overide anything set on a individual column basis.\n\t *\n\t * @param {string} newVerticalAlignment The vertical alignment setting.\n\t */\n\tfunction updateAlignment( newVerticalAlignment ) {\n\t\tconst innerBlockClientIds = getBlockOrder( clientId );\n\n\t\t// Update own and child Column block vertical alignments.\n\t\t// This is a single action; the batching prevents creating multiple history records.\n\t\tregistry.batch( () => {\n\t\t\tsetAttributes( { verticalAlignment: newVerticalAlignment } );\n\t\t\tupdateBlockAttributes( innerBlockClientIds, {\n\t\t\t\tverticalAlignment: newVerticalAlignment,\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<BlockVerticalAlignmentToolbar\n\t\t\t\t\tonChange={ updateAlignment }\n\t\t\t\t\tvalue={ verticalAlignment }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<ColumnInspectorControls\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisStackedOnMobile={ isStackedOnMobile }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nfunction Placeholder( { clientId, name, setAttributes } ) {\n\tconst { blockType, defaultVariation, variations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockVariations,\n\t\t\t\tgetBlockType,\n\t\t\t\tgetDefaultBlockVariation,\n\t\t\t} = select( blocksStore );\n\n\t\t\treturn {\n\t\t\t\tblockType: getBlockType( name ),\n\t\t\t\tdefaultVariation: getDefaultBlockVariation( name, 'block' ),\n\t\t\t\tvariations: getBlockVariations( name, 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst blockProps = useBlockProps();\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<__experimentalBlockVariationPicker\n\t\t\t\ticon={ blockType?.icon?.src }\n\t\t\t\tlabel={ blockType?.title }\n\t\t\t\tvariations={ variations }\n\t\t\t\tinstructions={ __( 'Divide into columns. Select a layout:' ) }\n\t\t\t\tonSelect={ ( nextVariation = defaultVariation ) => {\n\t\t\t\t\tif ( nextVariation.attributes ) {\n\t\t\t\t\t\tsetAttributes( nextVariation.attributes );\n\t\t\t\t\t}\n\t\t\t\t\tif ( nextVariation.innerBlocks ) {\n\t\t\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlocksFromInnerBlocksTemplate(\n\t\t\t\t\t\t\t\tnextVariation.innerBlocks\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t\tallowSkip\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nconst ColumnsEdit = ( props ) => {\n\tconst { clientId } = props;\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlocks( clientId ).length > 0,\n\t\t[ clientId ]\n\t);\n\tconst Component = hasInnerBlocks ? ColumnsEditContainer : Placeholder;\n\n\treturn <Component { ...props } />;\n};\n\nexport default ColumnsEdit;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,MAAM,EACNC,SAAS,EACTC,YAAY,EACZC,aAAa,QACP,uBAAuB;AAE9B,SACCC,iBAAiB,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AA,CAACf,kCAAkC;MAClC+F,IAAI,EAAGN,SAAS,EAAEM,IAAI,EAAEC,GAAK;MAC7BlC,KAAK,EAAG2B,SAAS,EAAE/B,KAAO;MAC1BiC,UAAU,EAAGA,UAAY;MACzBM,YAAY,EAAG1G,EAAE,CAAE,uCAAwC,CAAG;MAC9D2G,QAAQ,EAAGA,CAAEC,aAAa,GAAGT,gBAAgB,KAAM;QAClD,IAAKS,aAAa,CAAC7B,UAAU,EAAG;UAC/B9C,aAAa,CAAE2E,aAAa,CAAC7B,UAAW,CAAC;QAC1C;QACA,IAAK6B,aAAa,CAACjE,WAAW,EAAG;UAChCS,kBAAkB,CACjBpB,QAAQ,EACRf,mCAAmC,CAClC2F,aAAa,CAACjE,WACf,CAAC,EACD,IACD,CAAC;QACF;MACD,CAAG;MACHkE,SAAS;IAAA,CACT;EAAC,CACE,CAAC;AAER;AAEA,MAAMC,WAAW,GAAKC,KAAK,IAAM;EAChC,MAAM;IAAE/E;EAAS,CAAC,GAAG+E,KAAK;EAC1B,MAAMC,cAAc,GAAGlG,SAAS,CAC7BwB,MAAM,IACPA,MAAM,CAAE1B,gBAAiB,CAAC,CAAC6B,SAAS,CAAET,QAAS,CAAC,CAAC+B,MAAM,GAAG,CAAC,EAC5D,CAAE/B,QAAQ,CACX,CAAC;EACD,MAAMiF,SAAS,GAAGD,cAAc,GAAGlC,oBAAoB,GAAGmB,WAAW;EAErE,oBAAOzE,IAAA,CAACyF,SAAS;IAAA,GAAMF;EAAK,CAAI,CAAC;AAClC,CAAC;AAED,eAAeD,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","__","Notice","RangeControl","ToggleControl","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalVStack","VStack","InspectorControls","useInnerBlocksProps","BlockControls","BlockVerticalAlignmentToolbar","__experimentalBlockVariationPicker","useBlockProps","store","blockEditorStore","useDispatch","useSelect","useRegistry","createBlock","createBlocksFromInnerBlocksTemplate","blocksStore","hasExplicitPercentColumnWidths","getMappedColumnWidths","getRedistributedColumnWidths","toWidthPrecision","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DEFAULT_BLOCK","name","ColumnInspectorControls","clientId","setAttributes","isStackedOnMobile","count","canInsertColumnBlock","minCount","select","canInsertBlockType","canRemoveBlock","getBlockOrder","blockOrder","preventRemovalBlockIndexes","reduce","acc","blockId","index","push","length","Math","max","getBlocks","replaceInnerBlocks","updateColumns","previousColumns","newColumns","innerBlocks","hasExplicitWidths","isAddingColumn","newColumnWidth","newlyAddedColumns","widths","Array","from","map","width","slice","dropdownMenuProps","label","resetAll","children","isShownByDefault","hasValue","onDeselect","spacing","__nextHasNoMarginBottom","__next40pxDefaultSize","value","onChange","min","status","isDismissible","checked","ColumnsEditContainer","attributes","verticalAlignment","templateLock","registry","updateBlockAttributes","classes","blockProps","className","innerBlocksProps","defaultBlock","directInsert","orientation","renderAppender","updateAlignment","newVerticalAlignment","innerBlockClientIds","batch","Placeholder","blockType","defaultVariation","variations","getBlockVariations","getBlockType","getDefaultBlockVariation","icon","src","title","instructions","onSelect","nextVariation","allowSkip","ColumnsEdit","props","hasInnerBlocks","Component"],"sources":["@wordpress/block-library/src/columns/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tNotice,\n\tRangeControl,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\nimport {\n\tInspectorControls,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tBlockVerticalAlignmentToolbar,\n\t__experimentalBlockVariationPicker,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport {\n\tcreateBlock,\n\tcreateBlocksFromInnerBlocksTemplate,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\thasExplicitPercentColumnWidths,\n\tgetMappedColumnWidths,\n\tgetRedistributedColumnWidths,\n\ttoWidthPrecision,\n} from './utils';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/column',\n};\n\nfunction ColumnInspectorControls( {\n\tclientId,\n\tsetAttributes,\n\tisStackedOnMobile,\n} ) {\n\tconst { count, canInsertColumnBlock, minCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canInsertBlockType, canRemoveBlock, getBlockOrder } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst blockOrder = getBlockOrder( clientId );\n\n\t\t\t// Get the indexes of columns for which removal is prevented.\n\t\t\t// The highest index will be used to determine the minimum column count.\n\t\t\tconst preventRemovalBlockIndexes = blockOrder.reduce(\n\t\t\t\t( acc, blockId, index ) => {\n\t\t\t\t\tif ( ! canRemoveBlock( blockId ) ) {\n\t\t\t\t\t\tacc.push( index );\n\t\t\t\t\t}\n\t\t\t\t\treturn acc;\n\t\t\t\t},\n\t\t\t\t[]\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tcount: blockOrder.length,\n\t\t\t\tcanInsertColumnBlock: canInsertBlockType(\n\t\t\t\t\t'core/column',\n\t\t\t\t\tclientId\n\t\t\t\t),\n\t\t\t\tminCount: Math.max( ...preventRemovalBlockIndexes ) + 1,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\n\t/**\n\t * Updates the column count, including necessary revisions to child Column\n\t * blocks to grant required or redistribute available space.\n\t *\n\t * @param {number} previousColumns Previous column count.\n\t * @param {number} newColumns New column count.\n\t */\n\tfunction updateColumns( previousColumns, newColumns ) {\n\t\tlet innerBlocks = getBlocks( clientId );\n\t\tconst hasExplicitWidths = hasExplicitPercentColumnWidths( innerBlocks );\n\n\t\t// Redistribute available width for existing inner blocks.\n\t\tconst isAddingColumn = newColumns > previousColumns;\n\n\t\tif ( isAddingColumn && hasExplicitWidths ) {\n\t\t\t// If adding a new column, assign width to the new column equal to\n\t\t\t// as if it were `1 / columns` of the total available space.\n\t\t\tconst newColumnWidth = toWidthPrecision( 100 / newColumns );\n\t\t\tconst newlyAddedColumns = newColumns - previousColumns;\n\n\t\t\t// Redistribute in consideration of pending block insertion as\n\t\t\t// constraining the available working width.\n\t\t\tconst widths = getRedistributedColumnWidths(\n\t\t\t\tinnerBlocks,\n\t\t\t\t100 - newColumnWidth * newlyAddedColumns\n\t\t\t);\n\n\t\t\tinnerBlocks = [\n\t\t\t\t...getMappedColumnWidths( innerBlocks, widths ),\n\t\t\t\t...Array.from( {\n\t\t\t\t\tlength: newlyAddedColumns,\n\t\t\t\t} ).map( () => {\n\t\t\t\t\treturn createBlock( 'core/column', {\n\t\t\t\t\t\twidth: `${ newColumnWidth }%`,\n\t\t\t\t\t} );\n\t\t\t\t} ),\n\t\t\t];\n\t\t} else if ( isAddingColumn ) {\n\t\t\tinnerBlocks = [\n\t\t\t\t...innerBlocks,\n\t\t\t\t...Array.from( {\n\t\t\t\t\tlength: newColumns - previousColumns,\n\t\t\t\t} ).map( () => {\n\t\t\t\t\treturn createBlock( 'core/column' );\n\t\t\t\t} ),\n\t\t\t];\n\t\t} else if ( newColumns < previousColumns ) {\n\t\t\t// The removed column will be the last of the inner blocks.\n\t\t\tinnerBlocks = innerBlocks.slice(\n\t\t\t\t0,\n\t\t\t\t-( previousColumns - newColumns )\n\t\t\t);\n\t\t\tif ( hasExplicitWidths ) {\n\t\t\t\t// Redistribute as if block is already removed.\n\t\t\t\tconst widths = getRedistributedColumnWidths( innerBlocks, 100 );\n\n\t\t\t\tinnerBlocks = getMappedColumnWidths( innerBlocks, widths );\n\t\t\t}\n\t\t}\n\n\t\treplaceInnerBlocks( clientId, innerBlocks );\n\t}\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Settings' ) }\n\t\t\tresetAll={ () => {\n\t\t\t\tupdateColumns( count, minCount );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisStackedOnMobile: true,\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ canInsertColumnBlock && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => count }\n\t\t\t\t\tonDeselect={ () => updateColumns( count, minCount ) }\n\t\t\t\t>\n\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t<RangeControl\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\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\tvalue={ count }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateColumns(\n\t\t\t\t\t\t\t\t\tcount,\n\t\t\t\t\t\t\t\t\tMath.max( minCount, value )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ Math.max( 1, minCount ) }\n\t\t\t\t\t\t\tmax={ Math.max( 6, count ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ count > 6 && (\n\t\t\t\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Stack on mobile' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => isStackedOnMobile !== true }\n\t\t\t\tonDeselect={ () =>\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tisStackedOnMobile: true,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Stack on mobile' ) }\n\t\t\t\t\tchecked={ isStackedOnMobile }\n\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tisStackedOnMobile: ! isStackedOnMobile,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t</ToolsPanel>\n\t);\n}\n\nfunction ColumnsEditContainer( { attributes, setAttributes, clientId } ) {\n\tconst { isStackedOnMobile, verticalAlignment, templateLock } = attributes;\n\tconst registry = useRegistry();\n\tconst { getBlockOrder } = useSelect( blockEditorStore );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tconst classes = clsx( {\n\t\t[ `are-vertically-aligned-${ verticalAlignment }` ]: verticalAlignment,\n\t\t[ `is-not-stacked-on-mobile` ]: ! isStackedOnMobile,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\t\torientation: 'horizontal',\n\t\trenderAppender: false,\n\t\ttemplateLock,\n\t} );\n\n\t/**\n\t * Update all child Column blocks with a new vertical alignment setting\n\t * based on whatever alignment is passed in. This allows change to parent\n\t * to overide anything set on a individual column basis.\n\t *\n\t * @param {string} newVerticalAlignment The vertical alignment setting.\n\t */\n\tfunction updateAlignment( newVerticalAlignment ) {\n\t\tconst innerBlockClientIds = getBlockOrder( clientId );\n\n\t\t// Update own and child Column block vertical alignments.\n\t\t// This is a single action; the batching prevents creating multiple history records.\n\t\tregistry.batch( () => {\n\t\t\tsetAttributes( { verticalAlignment: newVerticalAlignment } );\n\t\t\tupdateBlockAttributes( innerBlockClientIds, {\n\t\t\t\tverticalAlignment: newVerticalAlignment,\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<BlockVerticalAlignmentToolbar\n\t\t\t\t\tonChange={ updateAlignment }\n\t\t\t\t\tvalue={ verticalAlignment }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<ColumnInspectorControls\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisStackedOnMobile={ isStackedOnMobile }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nfunction Placeholder( { clientId, name, setAttributes } ) {\n\tconst { blockType, defaultVariation, variations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockVariations,\n\t\t\t\tgetBlockType,\n\t\t\t\tgetDefaultBlockVariation,\n\t\t\t} = select( blocksStore );\n\n\t\t\treturn {\n\t\t\t\tblockType: getBlockType( name ),\n\t\t\t\tdefaultVariation: getDefaultBlockVariation( name, 'block' ),\n\t\t\t\tvariations: getBlockVariations( name, 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst blockProps = useBlockProps();\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<__experimentalBlockVariationPicker\n\t\t\t\ticon={ blockType?.icon?.src }\n\t\t\t\tlabel={ blockType?.title }\n\t\t\t\tvariations={ variations }\n\t\t\t\tinstructions={ __( 'Divide into columns. Select a layout:' ) }\n\t\t\t\tonSelect={ ( nextVariation = defaultVariation ) => {\n\t\t\t\t\tif ( nextVariation.attributes ) {\n\t\t\t\t\t\tsetAttributes( nextVariation.attributes );\n\t\t\t\t\t}\n\t\t\t\t\tif ( nextVariation.innerBlocks ) {\n\t\t\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlocksFromInnerBlocksTemplate(\n\t\t\t\t\t\t\t\tnextVariation.innerBlocks\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t\tallowSkip\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nconst ColumnsEdit = ( props ) => {\n\tconst { clientId } = props;\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlocks( clientId ).length > 0,\n\t\t[ clientId ]\n\t);\n\tconst Component = hasInnerBlocks ? ColumnsEditContainer : Placeholder;\n\n\treturn <Component { ...props } />;\n};\n\nexport default ColumnsEdit;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,MAAM,EACNC,YAAY,EACZC,aAAa,EACbC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAE9B,SACCC,iBAAiB,EACjBC,mBAAmB,EACnBC,aAAa,EACbC,6BAA6B,EAC7BC,kCAAkC,EAClCC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,WAAW,EAAEC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACrE,SACCC,WAAW,EACXC,mCAAmC,EACnCN,KAAK,IAAIO,WAAW,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA,SACCC,8BAA8B,EAC9BC,qBAAqB,EACrBC,4BA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