@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","_interopRequireDefault","require","_keycodes","_data","_blockEditor","_element","_components","_compose","_i18n","_icons","_socialList","_jsxRuntime","SocialLinkURLPopover","url","setAttributes","setPopover","popoverAnchor","clientId","removeBlock","useDispatch","blockEditorStore","jsx","URLPopover","anchor","__","onClose","focus","children","className","onSubmit","event","preventDefault","URLInput","value","onChange","nextURL","placeholder","label","hideLabelFromVision","disableSuggestions","onKeyDown","defaultPrevented","BACKSPACE","DELETE","includes","keyCode","suffix","__experimentalInputControlSuffixWrapper","variant","Button","icon","keyboardReturn","type","size","SocialLinkEdit","attributes","context","isSelected","service","rel","showLabels","iconColor","iconColorValue","iconBackgroundColor","iconBackgroundColorValue","showURLPopover","useState","wrapperClasses","clsx","setPopoverAnchor","isContentOnlyMode","useBlockEditingMode","IconComponent","getIconBySite","socialLinkName","getNameBySite","socialLinkText","trim","ref","useRef","blockProps","useBlockProps","useMergeRefs","onClick","ENTER","jsxs","Fragment","BlockControls","group","Dropdown","popoverProps","position","renderToggle","isOpen","onToggle","ToolbarButton","renderContent","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","help","InspectorControls","PanelBody","title","PanelRow","role","style","color","backgroundColor","_default","exports","default"],"sources":["@wordpress/block-library/src/social-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { DELETE, BACKSPACE, ENTER } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\n\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tURLPopover,\n\tURLInput,\n\tuseBlockEditingMode,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useState, useRef } from '@wordpress/element';\nimport {\n\tButton,\n\tDropdown,\n\tPanelBody,\n\tPanelRow,\n\tTextControl,\n\tToolbarButton,\n\t__experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,\n} from '@wordpress/components';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { keyboardReturn } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getIconBySite, getNameBySite } from './social-list';\n\nconst SocialLinkURLPopover = ( {\n\turl,\n\tsetAttributes,\n\tsetPopover,\n\tpopoverAnchor,\n\tclientId,\n} ) => {\n\tconst { removeBlock } = useDispatch( blockEditorStore );\n\treturn (\n\t\t<URLPopover\n\t\t\tanchor={ popoverAnchor }\n\t\t\taria-label={ __( 'Edit social link' ) }\n\t\t\tonClose={ () => {\n\t\t\t\tsetPopover( false );\n\t\t\t\tpopoverAnchor?.focus();\n\t\t\t} }\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"block-editor-url-popover__link-editor\"\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tsetPopover( false );\n\t\t\t\t\tpopoverAnchor?.focus();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-url-input\">\n\t\t\t\t\t<URLInput\n\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\tonChange={ ( nextURL ) =>\n\t\t\t\t\t\t\tsetAttributes( { url: nextURL } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={ __( 'Enter social link' ) }\n\t\t\t\t\t\tlabel={ __( 'Enter social link' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tdisableSuggestions\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!! url ||\n\t\t\t\t\t\t\t\tevent.defaultPrevented ||\n\t\t\t\t\t\t\t\t! [ BACKSPACE, DELETE ].includes(\n\t\t\t\t\t\t\t\t\tevent.keyCode\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsuffix={\n\t\t\t\t\t\t\t<InputControlSuffixWrapper variant=\"control\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ticon={ keyboardReturn }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Apply' ) }\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</InputControlSuffixWrapper>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</URLPopover>\n\t);\n};\n\nconst SocialLinkEdit = ( {\n\tattributes,\n\tcontext,\n\tisSelected,\n\tsetAttributes,\n\tclientId,\n} ) => {\n\tconst { url, service, label = '', rel } = attributes;\n\tconst {\n\t\tshowLabels,\n\t\ticonColor,\n\t\ticonColorValue,\n\t\ticonBackgroundColor,\n\t\ticonBackgroundColorValue,\n\t} = context;\n\tconst [ showURLPopover, setPopover ] = useState( false );\n\tconst wrapperClasses = clsx(\n\t\t'wp-social-link',\n\t\t// Manually adding this class for backwards compatibility of CSS when moving the\n\t\t// blockProps from the li to the button: https://github.com/WordPress/gutenberg/pull/64883\n\t\t'wp-block-social-link',\n\t\t'wp-social-link-' + service,\n\t\t{\n\t\t\t'wp-social-link__is-incomplete': ! url,\n\t\t\t[ `has-${ iconColor }-color` ]: iconColor,\n\t\t\t[ `has-${ iconBackgroundColor }-background-color` ]:\n\t\t\t\ticonBackgroundColor,\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\tconst isContentOnlyMode = useBlockEditingMode() === 'contentOnly';\n\n\tconst IconComponent = getIconBySite( service );\n\tconst socialLinkName = getNameBySite( service );\n\t// The initial label (ie. the link text) is an empty string.\n\t// We want to prevent empty links so that the link text always fallbacks to\n\t// the social name, even when users enter and save an empty string or only\n\t// spaces. The PHP render callback fallbacks to the social name as well.\n\tconst socialLinkText = label.trim() === '' ? socialLinkName : label;\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'wp-block-social-link-anchor',\n\t\tref: useMergeRefs( [ setPopoverAnchor, ref ] ),\n\t\tonClick: () => setPopover( true ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetPopover( true );\n\t\t\t}\n\t\t},\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t{ isContentOnlyMode && showLabels && (\n\t\t\t\t// Add an extra control to modify the label attribute when content only mode is active.\n\t\t\t\t// With content only mode active, the inspector is hidden, so users need another way\n\t\t\t\t// to edit this attribute.\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Text' ) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"wp-block-social-link__toolbar_content_text\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Provide a text label or use the default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { label: value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tplaceholder={ socialLinkName }\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</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The text is visible when enabled from the parent Social Icons block.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplaceholder={ socialLinkName }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\tonChange={ ( value ) => setAttributes( { rel: value } ) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ /*\n\t\t\t * Because the `<ul>` element has a role=document, the `<li>` is\n\t\t\t * not semantically correct, so adding role=presentation is cleaner.\n\t\t\t * https://github.com/WordPress/gutenberg/pull/64883#issuecomment-2472874551\n\t\t\t */ }\n\t\t\t<li\n\t\t\t\trole=\"presentation\"\n\t\t\t\tclassName={ wrapperClasses }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: iconColorValue,\n\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ /*\n\t\t\t\t * Disable reason: The `button` ARIA role is redundant but\n\t\t\t\t * blockProps has a role of `document` automatically applied\n\t\t\t\t * which breaks the semantics of this button since it removes\n\t\t\t\t * the information about the popover.\n\t\t\t\t */\n\t\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t\t<button aria-haspopup=\"dialog\" { ...blockProps } role=\"button\">\n\t\t\t\t\t<IconComponent />\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx( 'wp-block-social-link-label', {\n\t\t\t\t\t\t\t'screen-reader-text': ! showLabels,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ socialLinkText }\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t\t\t{ isSelected && showURLPopover && (\n\t\t\t\t\t<SocialLinkURLPopover\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tsetPopover={ setPopover }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t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G,IAAAwC,aAAI,EAAE,4BAA4B,EAAE;YAC/C,oBAAoB,EAAE,CAAER;UACzB,CAAE,CAAG;UAAAjC,QAAA,EAEHiD;QAAc,CACX,CAAC;MAAA,CACA,CAAC,EAEPnB,UAAU,IAAIQ,cAAc,iBAC7B,IAAAtD,WAAA,CAAAU,GAAA,EAACT,oBAAoB;QACpBC,GAAG,EAAGA,GAAK;QACXC,aAAa,EAAGA,aAAe;QAC/BC,UAAU,EAAGA,UAAY;QACzBC,aAAa,EAAGA,aAAe;QAC/BC,QAAQ,EAAGA;MAAU,CACrB,CACD;IAAA,CACE,CAAC;EAAA,CACJ,CAAC;AAEL,CAAC;AAAC,IAAA4F,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEazD,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_keycodes","_data","_blockEditor","_element","_components","_compose","_i18n","_icons","_socialList","_hooks","_jsxRuntime","SocialLinkURLPopover","url","setAttributes","setPopover","popoverAnchor","clientId","removeBlock","useDispatch","blockEditorStore","jsx","URLPopover","anchor","__","onClose","focus","children","className","onSubmit","event","preventDefault","URLInput","value","onChange","nextURL","placeholder","label","hideLabelFromVision","disableSuggestions","onKeyDown","defaultPrevented","BACKSPACE","DELETE","includes","keyCode","suffix","__experimentalInputControlSuffixWrapper","variant","Button","icon","keyboardReturn","type","size","SocialLinkEdit","attributes","context","isSelected","service","rel","dropdownMenuProps","useToolsPanelDropdownMenuProps","showLabels","iconColor","iconColorValue","iconBackgroundColor","iconBackgroundColorValue","showURLPopover","useState","wrapperClasses","clsx","setPopoverAnchor","isContentOnlyMode","useBlockEditingMode","IconComponent","getIconBySite","socialLinkName","getNameBySite","socialLinkText","trim","ref","useRef","blockProps","useBlockProps","useMergeRefs","onClick","ENTER","jsxs","Fragment","BlockControls","group","Dropdown","popoverProps","position","renderToggle","isOpen","onToggle","ToolbarButton","renderContent","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","help","InspectorControls","__experimentalToolsPanel","resetAll","undefined","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","role","style","color","backgroundColor","_default","exports","default"],"sources":["@wordpress/block-library/src/social-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { DELETE, BACKSPACE, ENTER } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\n\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tURLPopover,\n\tURLInput,\n\tuseBlockEditingMode,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useState, useRef } from '@wordpress/element';\nimport {\n\tButton,\n\tDropdown,\n\tTextControl,\n\tToolbarButton,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,\n} from '@wordpress/components';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { keyboardReturn } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getIconBySite, getNameBySite } from './social-list';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst SocialLinkURLPopover = ( {\n\turl,\n\tsetAttributes,\n\tsetPopover,\n\tpopoverAnchor,\n\tclientId,\n} ) => {\n\tconst { removeBlock } = useDispatch( blockEditorStore );\n\treturn (\n\t\t<URLPopover\n\t\t\tanchor={ popoverAnchor }\n\t\t\taria-label={ __( 'Edit social link' ) }\n\t\t\tonClose={ () => {\n\t\t\t\tsetPopover( false );\n\t\t\t\tpopoverAnchor?.focus();\n\t\t\t} }\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"block-editor-url-popover__link-editor\"\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tsetPopover( false );\n\t\t\t\t\tpopoverAnchor?.focus();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-url-input\">\n\t\t\t\t\t<URLInput\n\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\tonChange={ ( nextURL ) =>\n\t\t\t\t\t\t\tsetAttributes( { url: nextURL } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={ __( 'Enter social link' ) }\n\t\t\t\t\t\tlabel={ __( 'Enter social link' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tdisableSuggestions\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!! url ||\n\t\t\t\t\t\t\t\tevent.defaultPrevented ||\n\t\t\t\t\t\t\t\t! [ BACKSPACE, DELETE ].includes(\n\t\t\t\t\t\t\t\t\tevent.keyCode\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsuffix={\n\t\t\t\t\t\t\t<InputControlSuffixWrapper variant=\"control\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ticon={ keyboardReturn }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Apply' ) }\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</InputControlSuffixWrapper>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</URLPopover>\n\t);\n};\n\nconst SocialLinkEdit = ( {\n\tattributes,\n\tcontext,\n\tisSelected,\n\tsetAttributes,\n\tclientId,\n} ) => {\n\tconst { url, service, label = '', rel } = attributes;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst {\n\t\tshowLabels,\n\t\ticonColor,\n\t\ticonColorValue,\n\t\ticonBackgroundColor,\n\t\ticonBackgroundColorValue,\n\t} = context;\n\tconst [ showURLPopover, setPopover ] = useState( false );\n\tconst wrapperClasses = clsx(\n\t\t'wp-social-link',\n\t\t// Manually adding this class for backwards compatibility of CSS when moving the\n\t\t// blockProps from the li to the button: https://github.com/WordPress/gutenberg/pull/64883\n\t\t'wp-block-social-link',\n\t\t'wp-social-link-' + service,\n\t\t{\n\t\t\t'wp-social-link__is-incomplete': ! url,\n\t\t\t[ `has-${ iconColor }-color` ]: iconColor,\n\t\t\t[ `has-${ iconBackgroundColor }-background-color` ]:\n\t\t\t\ticonBackgroundColor,\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\tconst isContentOnlyMode = useBlockEditingMode() === 'contentOnly';\n\n\tconst IconComponent = getIconBySite( service );\n\tconst socialLinkName = getNameBySite( service );\n\t// The initial label (ie. the link text) is an empty string.\n\t// We want to prevent empty links so that the link text always fallbacks to\n\t// the social name, even when users enter and save an empty string or only\n\t// spaces. The PHP render callback fallbacks to the social name as well.\n\tconst socialLinkText = label.trim() === '' ? socialLinkName : label;\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'wp-block-social-link-anchor',\n\t\tref: useMergeRefs( [ setPopoverAnchor, ref ] ),\n\t\tonClick: () => setPopover( true ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetPopover( true );\n\t\t\t}\n\t\t},\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t{ isContentOnlyMode && showLabels && (\n\t\t\t\t// Add an extra control to modify the label attribute when content only mode is active.\n\t\t\t\t// With content only mode active, the inspector is hidden, so users need another way\n\t\t\t\t// to edit this attribute.\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Text' ) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"wp-block-social-link__toolbar_content_text\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Provide a text label or use the default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { label: value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tplaceholder={ socialLinkName }\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</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( { label: undefined } );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\thasValue={ () => !! label }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( { label: undefined } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The text is visible when enabled from the parent Social Icons block.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplaceholder={ socialLinkName }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\tonChange={ ( value ) => setAttributes( { rel: value } ) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ /*\n\t\t\t * Because the `<ul>` element has a role=document, the `<li>` is\n\t\t\t * not semantically correct, so adding role=presentation is cleaner.\n\t\t\t * https://github.com/WordPress/gutenberg/pull/64883#issuecomment-2472874551\n\t\t\t */ }\n\t\t\t<li\n\t\t\t\trole=\"presentation\"\n\t\t\t\tclassName={ wrapperClasses }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: iconColorValue,\n\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ /*\n\t\t\t\t * Disable reason: The `button` ARIA role is redundant but\n\t\t\t\t * blockProps has a role of `document` automatically applied\n\t\t\t\t * which breaks the semantics of this button since it removes\n\t\t\t\t * the information about the popover.\n\t\t\t\t */\n\t\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t\t<button aria-haspopup=\"dialog\" { ...blockProps } role=\"button\">\n\t\t\t\t\t<IconComponent />\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx( 'wp-block-social-link-label', {\n\t\t\t\t\t\t\t'screen-reader-text': ! showLabels,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ socialLinkText }\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t\t\t{ isSelected && showURLPopover && (\n\t\t\t\t\t<SocialLinkURLPopover\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tsetPopover={ setPopover }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</li>\n\t\t</>\n\t);\n};\n\nexport default SocialLinkEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AASA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AASA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAAgE,IAAAW,WAAA,GAAAX,OAAA;AAtChE;AACA;AACA;;AAGA;AACA;AACA;;AA2BA;AACA;AACA;;AAIA,MAAMY,oBAAoB,GAAGA,CAAE;EAC9BC,GAAG;EACHC,aAAa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EAEHmD;QAAc,CACX,CAAC;MAAA,CACA,CAAC,EAEPrB,UAAU,IAAIU,cAAc,iBAC7B,IAAAxD,WAAA,CAAAU,GAAA,EAACT,oBAAoB;QACpBC,GAAG,EAAGA,GAAK;QACXC,aAAa,EAAGA,aAAe;QAC/BC,UAAU,EAAGA,UAAY;QACzBC,aAAa,EAAGA,aAAe;QAC/BC,QAAQ,EAAGA;MAAU,CACrB,CACD;IAAA,CACE,CAAC;EAAA,CACJ,CAAC;AAEL,CAAC;AAAC,IAAAkG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa/D,cAAc","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@ var _components = require("@wordpress/components");
|
|
|
14
14
|
var _i18n = require("@wordpress/i18n");
|
|
15
15
|
var _icons = require("@wordpress/icons");
|
|
16
16
|
var _data = require("@wordpress/data");
|
|
17
|
+
var _hooks = require("../utils/hooks");
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
/**
|
|
19
20
|
* External dependencies
|
|
@@ -23,6 +24,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
24
|
* WordPress dependencies
|
|
24
25
|
*/
|
|
25
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Internal dependencies
|
|
29
|
+
*/
|
|
30
|
+
|
|
26
31
|
const sizeOptions = [{
|
|
27
32
|
name: (0, _i18n.__)('Small'),
|
|
28
33
|
value: 'has-small-icon-size'
|
|
@@ -59,6 +64,7 @@ function SocialLinksEdit(props) {
|
|
|
59
64
|
const hasSelectedChild = (0, _data.useSelect)(select => select(_blockEditor.store).hasSelectedInnerBlock(clientId), [clientId]);
|
|
60
65
|
const hasAnySelected = isSelected || hasSelectedChild;
|
|
61
66
|
const logosOnly = attributes.className?.includes('is-style-logos-only');
|
|
67
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
62
68
|
|
|
63
69
|
// Remove icon background color when logos only style is selected or
|
|
64
70
|
// restore it when any other style is selected.
|
|
@@ -182,21 +188,44 @@ function SocialLinksEdit(props) {
|
|
|
182
188
|
})
|
|
183
189
|
})
|
|
184
190
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
185
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
192
|
+
label: (0, _i18n.__)('Settings'),
|
|
193
|
+
resetAll: () => {
|
|
194
|
+
setAttributes({
|
|
195
|
+
openInNewTab: false,
|
|
196
|
+
showLabels: false
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
200
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
201
|
+
isShownByDefault: true,
|
|
189
202
|
label: (0, _i18n.__)('Open links in new tab'),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
openInNewTab:
|
|
203
|
+
hasValue: () => !!openInNewTab,
|
|
204
|
+
onDeselect: () => setAttributes({
|
|
205
|
+
openInNewTab: false
|
|
206
|
+
}),
|
|
207
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
208
|
+
__nextHasNoMarginBottom: true,
|
|
209
|
+
label: (0, _i18n.__)('Open links in new tab'),
|
|
210
|
+
checked: openInNewTab,
|
|
211
|
+
onChange: () => setAttributes({
|
|
212
|
+
openInNewTab: !openInNewTab
|
|
213
|
+
})
|
|
193
214
|
})
|
|
194
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.
|
|
195
|
-
|
|
215
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
216
|
+
isShownByDefault: true,
|
|
196
217
|
label: (0, _i18n.__)('Show text'),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
showLabels:
|
|
218
|
+
hasValue: () => !!showLabels,
|
|
219
|
+
onDeselect: () => setAttributes({
|
|
220
|
+
showLabels: false
|
|
221
|
+
}),
|
|
222
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
223
|
+
__nextHasNoMarginBottom: true,
|
|
224
|
+
label: (0, _i18n.__)('Show text'),
|
|
225
|
+
checked: showLabels,
|
|
226
|
+
onChange: () => setAttributes({
|
|
227
|
+
showLabels: !showLabels
|
|
228
|
+
})
|
|
200
229
|
})
|
|
201
230
|
})]
|
|
202
231
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_components","_i18n","_icons","_data","_jsxRuntime","sizeOptions","name","__","value","SocialLinksEdit","props","_attributes$layout$or","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","hasSelectedChild","useSelect","select","blockEditorStore","hasSelectedInnerBlock","hasAnySelected","logosOnly","className","includes","backgroundBackupRef","useRef","useEffect","current","undefined","SocialPlaceholder","jsx","children","jsxs","clsx","color","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","placeholder","templateLock","orientation","layout","__experimentalAppenderTagName","renderAppender","InnerBlocks","ButtonBlockAppender","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","useMultipleOriginColorsAndGradients","Fragment","BlockControls","group","ToolbarDropdownMenu","text","icon","popoverProps","onClose","MenuGroup","map","entry","MenuItem","check","onClick","role","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","checked","hasColorsOrGradients","__experimentalColorGradientSettingsDropdown","__experimentalIsRenderedInSidebar","settings","onColorChange","isShownByDefault","enableAlpha","panelId","ContrastChecker","textColor","backgroundColor","isLargeText","iconColorAttributes","_default","exports","default","withColors"],"sources":["@wordpress/block-library/src/social-links/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst hasSelectedChild = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackupRef = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackupRef.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackupRef.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tplaceholder: ! isSelected && SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBA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,KAAK;UACL8B,aAAa,EAAEhC,QAAQ;UACvBiC,gBAAgB,EAAE,IAAI;UACtB9B,cAAc;UACd+B,WAAW,EAAE;QACd,CAAC,CACC;QACHC,OAAO,EAAGpF,QAAU;QAAA,GACfsD;MAAqB,GAbpB,sBAAuBH,KAAK,EAclC,CAEH,CAAC,EACC,CAAE/B,SAAS,iBACZ,IAAA5B,WAAA,CAAAqC,GAAA,EAAC1C,YAAA,CAAAkG,eAAe;QAEdC,SAAS,EAAE5E,cAAc;QACzB6E,eAAe,EAAE/E,wBAAwB;QAE1CgF,WAAW,EAAG;MAAO,CACrB,CACD;IAAA,CACiB,CACnB,eACD,IAAAhG,WAAA,CAAAqC,GAAA;MAAA,GAASO;IAAgB,CAAI,CAAC;EAAA,CAC7B,CAAC;AAEL;AAEA,MAAMqD,mBAAmB,GAAG;EAC3BtF,SAAS,EAAE,YAAY;EACvBD,mBAAmB,EAAE;AACtB,CAAC;AAAC,IAAAwF,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,uBAAU,EAAEJ,mBAAoB,CAAC,CAAE5F,eAAgB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_components","_i18n","_icons","_data","_hooks","_jsxRuntime","sizeOptions","name","__","value","SocialLinksEdit","props","_attributes$layout$or","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","hasSelectedChild","useSelect","select","blockEditorStore","hasSelectedInnerBlock","hasAnySelected","logosOnly","className","includes","dropdownMenuProps","useToolsPanelDropdownMenuProps","backgroundBackupRef","useRef","useEffect","current","undefined","SocialPlaceholder","jsx","children","jsxs","clsx","color","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","placeholder","templateLock","orientation","layout","__experimentalAppenderTagName","renderAppender","InnerBlocks","ButtonBlockAppender","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","useMultipleOriginColorsAndGradients","Fragment","BlockControls","group","ToolbarDropdownMenu","text","icon","popoverProps","onClose","MenuGroup","map","entry","MenuItem","check","onClick","role","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","ToggleControl","__nextHasNoMarginBottom","checked","hasColorsOrGradients","__experimentalColorGradientSettingsDropdown","__experimentalIsRenderedInSidebar","settings","onColorChange","enableAlpha","panelId","ContrastChecker","textColor","backgroundColor","isLargeText","iconColorAttributes","_default","exports","default","withColors"],"sources":["@wordpress/block-library/src/social-links/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tToggleControl,\n\tToolbarDropdownMenu,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst hasSelectedChild = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackupRef = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackupRef.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackupRef.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tplaceholder: ! isSelected && SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\topenInNewTab: false,\n\t\t\t\t\t\t\tshowLabels: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\thasValue={ () => !! openInNewTab }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\topenInNewTab: ! openInNewTab,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\thasValue={ () => !! showLabels }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAYA,IAAAG,WAAA,GAAAH,OAAA;AAQA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAAgE,IAAAQ,WAAA,GAAAR,OAAA;AApChE;AACA;AACA;;AAGA;AACA;AACA;;AA0BA;AACA;AACA;;AAGA,MAAMS,WAAW,GAAG,CACnB;EAAEC,IAAI,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EAAEC,KAAK,EAAE;AAAsB,CAAC,EACrD;EAAEF,IAAI,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EAAEC,KAAK,EAAE;AAAuB,CAAC,EACvD;EAAEF,IAAI,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EAAEC,KAAK,EAAE;AAAsB,CAAC,EACrD;EAAEF,IAAI,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;EAAEC,KAAK,EAAE;AAAqB,CAAC,CACnD;AAEM,SAASC,eAAeA,CAAEC,KAAK,EAAG;EAAA,IAAAC,qBAAA;EACxC,MAAM;IACLC,QAAQ;IACRC,UAAU;IACVC,mBAAmB;IACnBC,SAAS;IACTC,UAAU;IACVC,aAAa;IACbC,sBAAsB;IACtBC;EACD,CAAC,GAAGT,KAAK;EAET,MAAM;IACLU,wBAAwB;IACxBC,yBAAyB;IACzBC,cAAc;IACdC,YAAY;IACZC,UAAU;IACVC;EACD,CAAC,GAAGZ,UAAU;EAEd,MAAMa,gBAAgB,GAAG,IAAAC,eAAS,EAC/BC,MAAM,IACPA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,q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AAA,EAAC7C,YAAA,CAAAwG,eAAe;QAEdC,SAAS,EAAEjF,cAAc;QACzBkF,eAAe,EAAEpF,wBAAwB;QAE1CqF,WAAW,EAAG;MAAO,CACrB,CACD;IAAA,CACiB,CACnB,eACD,IAAArG,WAAA,CAAAuC,GAAA;MAAA,GAASO;IAAgB,CAAI,CAAC;EAAA,CAC7B,CAAC;AAEL;AAEA,MAAMwD,mBAAmB,GAAG;EAC3B3F,SAAS,EAAE,YAAY;EACvBD,mBAAmB,EAAE;AACtB,CAAC;AAAC,IAAA6F,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,uBAAU,EAAEJ,mBAAoB,CAAC,CAAEjG,eAAgB,CAAC","ignoreList":[]}
|
package/build/spacer/controls.js
CHANGED
|
@@ -89,22 +89,44 @@ function SpacerControls({
|
|
|
89
89
|
isResizing
|
|
90
90
|
}) {
|
|
91
91
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
92
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
93
|
+
label: (0, _i18n.__)('Settings'),
|
|
94
|
+
resetAll: () => {
|
|
95
|
+
setAttributes({
|
|
96
|
+
width: undefined,
|
|
97
|
+
height: '100px'
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
children: [orientation === 'horizontal' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
95
101
|
label: (0, _i18n.__)('Width'),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
isShownByDefault: true,
|
|
103
|
+
hasValue: () => width !== undefined,
|
|
104
|
+
onDeselect: () => setAttributes({
|
|
105
|
+
width: undefined
|
|
99
106
|
}),
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DimensionInput, {
|
|
108
|
+
label: (0, _i18n.__)('Width'),
|
|
109
|
+
value: width,
|
|
110
|
+
onChange: nextWidth => setAttributes({
|
|
111
|
+
width: nextWidth
|
|
112
|
+
}),
|
|
113
|
+
isResizing: isResizing
|
|
114
|
+
})
|
|
115
|
+
}), orientation !== 'horizontal' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
102
116
|
label: (0, _i18n.__)('Height'),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
117
|
+
isShownByDefault: true,
|
|
118
|
+
hasValue: () => height !== '100px',
|
|
119
|
+
onDeselect: () => setAttributes({
|
|
120
|
+
height: '100px'
|
|
106
121
|
}),
|
|
107
|
-
|
|
122
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DimensionInput, {
|
|
123
|
+
label: (0, _i18n.__)('Height'),
|
|
124
|
+
value: height,
|
|
125
|
+
onChange: nextHeight => setAttributes({
|
|
126
|
+
height: nextHeight
|
|
127
|
+
}),
|
|
128
|
+
isResizing: isResizing
|
|
129
|
+
})
|
|
108
130
|
})]
|
|
109
131
|
})
|
|
110
132
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blockEditor","_components","_compose","_primitives","_lockUnlock","_constants","_jsxRuntime","useSpacingSizes","unlock","blockEditorPrivateApis","DimensionInput","label","onChange","isResizing","value","inputId","useInstanceId","UnitControl","spacingSizes","spacingUnits","useSettings","availableUnits","filter","unit","units","useCustomUnits","defaultValues","px","em","rem","vw","vh","handleOnChange","unprocessedValue","all","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","computedValue","isValueSpacingPreset","join","jsxs","Fragment","children","length","jsx","__experimentalUnitControl","id","isResetValueOnUnitChange","min","MIN_SPACER_SIZE","__next40pxDefaultSize","View","className","__experimentalSpacingSizesControl","values","sides","allowReset","splitOnAxis","showSideInLabel","SpacerControls","setAttributes","orientation","height","width","InspectorControls","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blockEditor","_components","_compose","_primitives","_lockUnlock","_constants","_jsxRuntime","useSpacingSizes","unlock","blockEditorPrivateApis","DimensionInput","label","onChange","isResizing","value","inputId","useInstanceId","UnitControl","spacingSizes","spacingUnits","useSettings","availableUnits","filter","unit","units","useCustomUnits","defaultValues","px","em","rem","vw","vh","handleOnChange","unprocessedValue","all","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","computedValue","isValueSpacingPreset","join","jsxs","Fragment","children","length","jsx","__experimentalUnitControl","id","isResetValueOnUnitChange","min","MIN_SPACER_SIZE","__next40pxDefaultSize","View","className","__experimentalSpacingSizesControl","values","sides","allowReset","splitOnAxis","showSideInLabel","SpacerControls","setAttributes","orientation","height","width","InspectorControls","__experimentalToolsPanel","__","resetAll","undefined","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","nextWidth","nextHeight"],"sources":["@wordpress/block-library/src/spacer/controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseSettings,\n\t__experimentalSpacingSizesControl as SpacingSizesControl,\n\tisValueSpacingPreset,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { View } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { MIN_SPACER_SIZE } from './constants';\n\nconst { useSpacingSizes } = unlock( blockEditorPrivateApis );\n\nfunction DimensionInput( { label, onChange, isResizing, value = '' } ) {\n\tconst inputId = useInstanceId( UnitControl, 'block-spacer-height-input' );\n\tconst spacingSizes = useSpacingSizes();\n\tconst [ spacingUnits ] = useSettings( 'spacing.units' );\n\t// In most contexts the spacer size cannot meaningfully be set to a\n\t// percentage, since this is relative to the parent container. This\n\t// unit is disabled from the UI.\n\tconst availableUnits = spacingUnits\n\t\t? spacingUnits.filter( ( unit ) => unit !== '%' )\n\t\t: [ 'px', 'em', 'rem', 'vw', 'vh' ];\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits,\n\t\tdefaultValues: { px: 100, em: 10, rem: 10, vw: 10, vh: 25 },\n\t} );\n\n\tconst handleOnChange = ( unprocessedValue ) => {\n\t\tonChange( unprocessedValue.all );\n\t};\n\n\t// Force the unit to update to `px` when the Spacer is being resized.\n\tconst [ parsedQuantity, parsedUnit ] =\n\t\tparseQuantityAndUnitFromRawValue( value );\n\tconst computedValue = isValueSpacingPreset( value )\n\t\t? value\n\t\t: [ parsedQuantity, isResizing ? 'px' : parsedUnit ].join( '' );\n\n\treturn (\n\t\t<>\n\t\t\t{ ( ! spacingSizes || spacingSizes?.length === 0 ) && (\n\t\t\t\t<UnitControl\n\t\t\t\t\tid={ inputId }\n\t\t\t\t\tisResetValueOnUnitChange\n\t\t\t\t\tmin={ MIN_SPACER_SIZE }\n\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\tvalue={ computedValue }\n\t\t\t\t\tunits={ units }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ spacingSizes?.length > 0 && (\n\t\t\t\t<View className=\"tools-panel-item-spacing\">\n\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\tvalues={ { all: computedValue } }\n\t\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tsides={ [ 'all' ] }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\tsplitOnAxis={ false }\n\t\t\t\t\t\tshowSideInLabel={ false }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default function SpacerControls( {\n\tsetAttributes,\n\torientation,\n\theight,\n\twidth,\n\tisResizing,\n} ) {\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\theight: '100px',\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ orientation === 'horizontal' && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => width !== undefined }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { width: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DimensionInput\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tvalue={ width }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { width: nextWidth } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisResizing={ isResizing }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t\t{ orientation !== 'horizontal' && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => height !== '100px' }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { height: '100px' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DimensionInput\n\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\tvalue={ height }\n\t\t\t\t\t\t\tonChange={ ( nextHeight ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { height: nextHeight } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisResizing={ isResizing }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAA8C,IAAAO,WAAA,GAAAP,OAAA;AAzB9C;AACA;AACA;;AAmBA;AACA;AACA;;AAIA,MAAM;EAAEQ;AAAgB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE5D,SAASC,cAAcA,CAAE;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,UAAU;EAAEC,KAAK,GAAG;AAAG,CAAC,EAAG;EACtE,MAAMC,OAAO,GAAG,IAAAC,sBAAa,EAAEC,qCAAW,EAAE,2BAA4B,CAAC;EACzE,MAAMC,YAAY,GAAGX,eAAe,CAAC,CAAC;EACtC,MAAM,CAAEY,YAAY,CAAE,GAAG,IAAAC,wBAAW,EAAE,eAAgB,CAAC;EACvD;EACA;EACA;EACA,MAAMC,cAAc,GAAGF,YAAY,GAChCA,YAAY,CAACG,MAAM,CAAIC,IAAI,IAAMA,IAAI,KAAK,GAAI,CAAC,GAC/C,CAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAE;EAEpC,MAAMC,KAAK,GAAG,IAAAC,wCAAc,EAAE;IAC7BJ,cAAc;IACdK,aAAa,EAAE;MAAEC,EAAE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,WAAW,KAAK,YAAY,iBAC7B,IAAAxD,WAAA,CAAAuC,GAAA,EAAC5C,WAAA,CAAAqE,4BAAc;QACd3D,KAAK,EAAG,IAAAwD,QAAE,EAAE,QAAS,CAAG;QACxBI,gBAAgB;QAChBC,QAAQ,EAAGA,CAAA,KAAMT,MAAM,KAAK,OAAS;QACrCU,UAAU,EAAGA,CAAA,KACZZ,aAAa,CAAE;UAAEE,MAAM,EAAE;QAAQ,CAAE,CACnC;QAAApB,QAAA,eAED,IAAArC,WAAA,CAAAuC,GAAA,EAACnC,cAAc;UACdC,KAAK,EAAG,IAAAwD,QAAE,EAAE,QAAS,CAAG;UACxBrD,KAAK,EAAGiD,MAAQ;UAChBnD,QAAQ,EAAK+D,UAAU,IACtBd,aAAa,CAAE;YAAEE,MAAM,EAAEY;UAAW,CAAE,CACtC;UACD9D,UAAU,EAAGA;QAAY,CACzB;MAAC,CACa,CAChB;IAAA,CACU;EAAC,CACK,CAAC;AAEtB","ignoreList":[]}
|
package/build/table/edit.js
CHANGED
|
@@ -14,6 +14,7 @@ var _components = require("@wordpress/components");
|
|
|
14
14
|
var _icons = require("@wordpress/icons");
|
|
15
15
|
var _state = require("./state");
|
|
16
16
|
var _caption = require("../utils/caption");
|
|
17
|
+
var _hooks = require("../utils/hooks");
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
/**
|
|
19
20
|
* External dependencies
|
|
@@ -76,6 +77,7 @@ function TableEdit({
|
|
|
76
77
|
const borderProps = (0, _blockEditor.__experimentalUseBorderProps)(attributes);
|
|
77
78
|
const tableRef = (0, _element.useRef)();
|
|
78
79
|
const [hasTableCreated, setHasTableCreated] = (0, _element.useState)(false);
|
|
80
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
79
81
|
|
|
80
82
|
/**
|
|
81
83
|
* Updates the initial column count used for table creation.
|
|
@@ -398,25 +400,56 @@ function TableEdit({
|
|
|
398
400
|
})
|
|
399
401
|
})]
|
|
400
402
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
401
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
403
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
404
|
+
label: (0, _i18n.__)('Settings'),
|
|
405
|
+
resetAll: () => {
|
|
406
|
+
setAttributes({
|
|
407
|
+
hasFixedLayout: true,
|
|
408
|
+
head: [],
|
|
409
|
+
foot: []
|
|
410
|
+
});
|
|
411
|
+
},
|
|
412
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
413
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
414
|
+
hasValue: () => hasFixedLayout !== true,
|
|
406
415
|
label: (0, _i18n.__)('Fixed width table cells'),
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
416
|
+
onDeselect: () => setAttributes({
|
|
417
|
+
hasFixedLayout: true
|
|
418
|
+
}),
|
|
419
|
+
isShownByDefault: true,
|
|
420
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
411
421
|
__nextHasNoMarginBottom: true,
|
|
422
|
+
label: (0, _i18n.__)('Fixed width table cells'),
|
|
423
|
+
checked: !!hasFixedLayout,
|
|
424
|
+
onChange: onChangeFixedLayout
|
|
425
|
+
})
|
|
426
|
+
}), !isEmpty && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
427
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
428
|
+
hasValue: () => head && head.length,
|
|
412
429
|
label: (0, _i18n.__)('Header section'),
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
430
|
+
onDeselect: () => setAttributes({
|
|
431
|
+
head: []
|
|
432
|
+
}),
|
|
433
|
+
isShownByDefault: true,
|
|
434
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
435
|
+
__nextHasNoMarginBottom: true,
|
|
436
|
+
label: (0, _i18n.__)('Header section'),
|
|
437
|
+
checked: !!(head && head.length),
|
|
438
|
+
onChange: onToggleHeaderSection
|
|
439
|
+
})
|
|
440
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
441
|
+
hasValue: () => foot && foot.length,
|
|
417
442
|
label: (0, _i18n.__)('Footer section'),
|
|
418
|
-
|
|
419
|
-
|
|
443
|
+
onDeselect: () => setAttributes({
|
|
444
|
+
foot: []
|
|
445
|
+
}),
|
|
446
|
+
isShownByDefault: true,
|
|
447
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
448
|
+
__nextHasNoMarginBottom: true,
|
|
449
|
+
label: (0, _i18n.__)('Footer section'),
|
|
450
|
+
checked: !!(foot && foot.length),
|
|
451
|
+
onChange: onToggleFooterSection
|
|
452
|
+
})
|
|
420
453
|
})]
|
|
421
454
|
})]
|
|
422
455
|
})
|
package/build/table/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_i18n","_components","_icons","_state","_caption","_jsxRuntime","ALIGNMENT_CONTROLS","icon","alignLeft","title","__","align","alignCenter","alignRight","cellAriaLabel","head","body","foot","placeholder","TSection","name","props","TagName","jsx","TableEdit","attributes","setAttributes","insertBlocksAfter","isSelected","isSingleSelected","hasFixedLayout","initialRowCount","setInitialRowCount","useState","initialColumnCount","setInitialColumnCount","selectedCell","setSelectedCell","colorProps","useColorProps","borderProps","useBorderProps","tableRef","useRef","hasTableCreated","setHasTableCreated","onChangeInitialColumnCount","count","onChangeInitialRowCount","onCreateTable","event","preventDefault","createTable","rowCount","parseInt","columnCount","onChangeFixedLayout","onChange","content","updateSelectedCell","cellAttributes","onChangeColumnAlignment","columnSelection","type","columnIndex","newAttributes","getCellAlignment","getCellAttribute","onToggleHeaderSection","toggleSection","onToggleFooterSection","onInsertRow","delta","sectionName","rowIndex","newRowIndex","insertRow","onInsertRowBefore","onInsertRowAfter","onDeleteRow","deleteRow","onInsertColumn","newColumnIndex","insertColumn","onInsertColumnBefore","onInsertColumnAfter","onDeleteColumn","deleteColumn","useEffect","current","querySelector","focus","sections","filter","isEmptyTableSection","tableControls","tableRowBefore","isDisabled","onClick","tableRowAfter","tableRowDelete","tableColumnBefore","tableColumnAfter","tableColumnDelete","renderedSections","map","children","cells","tag","CellTag","scope","colspan","rowspan","undefined","colSpan","rowSpan","className","clsx","RichText","value","onFocus","isEmpty","length","jsxs","useBlockProps","ref","Fragment","BlockControls","group","AlignmentControl","label","alignmentControls","nextAlign","ToolbarDropdownMenu","table","controls","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","checked","hasSplitBorders","style","border","Placeholder","BlockIcon","showColors","instructions","onSubmit","TextControl","__next40pxDefaultSize","min","Button","variant","Caption","showToolbarButton","_default","exports","default"],"sources":["@wordpress/block-library/src/table/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tRichText,\n\tBlockIcon,\n\tAlignmentControl,\n\tuseBlockProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalUseBorderProps as useBorderProps,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tPanelBody,\n\tPlaceholder,\n\tTextControl,\n\tToggleControl,\n\tToolbarDropdownMenu,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n} from '@wordpress/components';\nimport {\n\talignLeft,\n\talignRight,\n\talignCenter,\n\tblockTable as icon,\n\ttableColumnAfter,\n\ttableColumnBefore,\n\ttableColumnDelete,\n\ttableRowAfter,\n\ttableRowBefore,\n\ttableRowDelete,\n\ttable,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcreateTable,\n\tupdateSelectedCell,\n\tgetCellAttribute,\n\tinsertRow,\n\tdeleteRow,\n\tinsertColumn,\n\tdeleteColumn,\n\ttoggleSection,\n\tisEmptyTableSection,\n} from './state';\nimport { Caption } from '../utils/caption';\n\nconst ALIGNMENT_CONTROLS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align column left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align column center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align column right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst cellAriaLabel = {\n\thead: __( 'Header cell text' ),\n\tbody: __( 'Body cell text' ),\n\tfoot: __( 'Footer cell text' ),\n};\n\nconst placeholder = {\n\thead: __( 'Header label' ),\n\tfoot: __( 'Footer label' ),\n};\n\nfunction TSection( { name, ...props } ) {\n\tconst TagName = `t${ name }`;\n\treturn <TagName { ...props } />;\n}\n\nfunction TableEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tisSelected: isSingleSelected,\n} ) {\n\tconst { hasFixedLayout, head, foot } = attributes;\n\tconst [ initialRowCount, setInitialRowCount ] = useState( 2 );\n\tconst [ initialColumnCount, setInitialColumnCount ] = useState( 2 );\n\tconst [ selectedCell, setSelectedCell ] = useState();\n\n\tconst colorProps = useColorProps( attributes );\n\tconst borderProps = useBorderProps( attributes );\n\n\tconst tableRef = useRef();\n\tconst [ hasTableCreated, setHasTableCreated ] = useState( false );\n\n\t/**\n\t * Updates the initial column count used for table creation.\n\t *\n\t * @param {number} count New initial column count.\n\t */\n\tfunction onChangeInitialColumnCount( count ) {\n\t\tsetInitialColumnCount( count );\n\t}\n\n\t/**\n\t * Updates the initial row count used for table creation.\n\t *\n\t * @param {number} count New initial row count.\n\t */\n\tfunction onChangeInitialRowCount( count ) {\n\t\tsetInitialRowCount( count );\n\t}\n\n\t/**\n\t * Creates a table based on dimensions in local state.\n\t *\n\t * @param {Object} event Form submit event.\n\t */\n\tfunction onCreateTable( event ) {\n\t\tevent.preventDefault();\n\n\t\tsetAttributes(\n\t\t\tcreateTable( {\n\t\t\t\trowCount: parseInt( initialRowCount, 10 ) || 2,\n\t\t\t\tcolumnCount: parseInt( initialColumnCount, 10 ) || 2,\n\t\t\t} )\n\t\t);\n\t\tsetHasTableCreated( true );\n\t}\n\n\t/**\n\t * Toggles whether the table has a fixed layout or not.\n\t */\n\tfunction onChangeFixedLayout() {\n\t\tsetAttributes( { hasFixedLayout: ! hasFixedLayout } );\n\t}\n\n\t/**\n\t * Changes the content of the currently selected cell.\n\t *\n\t * @param {Array} content A RichText content value.\n\t */\n\tfunction onChange( content ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes(\n\t\t\tupdateSelectedCell(\n\t\t\t\tattributes,\n\t\t\t\tselectedCell,\n\t\t\t\t( cellAttributes ) => ( {\n\t\t\t\t\t...cellAttributes,\n\t\t\t\t\tcontent,\n\t\t\t\t} )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Align text within the a column.\n\t *\n\t * @param {string} align The new alignment to apply to the column.\n\t */\n\tfunction onChangeColumnAlignment( align ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Convert the cell selection to a column selection so that alignment\n\t\t// is applied to the entire column.\n\t\tconst columnSelection = {\n\t\t\ttype: 'column',\n\t\t\tcolumnIndex: selectedCell.columnIndex,\n\t\t};\n\n\t\tconst newAttributes = updateSelectedCell(\n\t\t\tattributes,\n\t\t\tcolumnSelection,\n\t\t\t( cellAttributes ) => ( {\n\t\t\t\t...cellAttributes,\n\t\t\t\talign,\n\t\t\t} )\n\t\t);\n\t\tsetAttributes( newAttributes );\n\t}\n\n\t/**\n\t * Get the alignment of the currently selected cell.\n\t *\n\t * @return {string | undefined} The new alignment to apply to the column.\n\t */\n\tfunction getCellAlignment() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn getCellAttribute( attributes, selectedCell, 'align' );\n\t}\n\n\t/**\n\t * Add or remove a `head` table section.\n\t */\n\tfunction onToggleHeaderSection() {\n\t\tsetAttributes( toggleSection( attributes, 'head' ) );\n\t}\n\n\t/**\n\t * Add or remove a `foot` table section.\n\t */\n\tfunction onToggleFooterSection() {\n\t\tsetAttributes( toggleSection( attributes, 'foot' ) );\n\t}\n\n\t/**\n\t * Inserts a row at the currently selected row index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected row index at which to insert.\n\t */\n\tfunction onInsertRow( delta ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\t\tconst newRowIndex = rowIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertRow( attributes, {\n\t\t\t\tsectionName,\n\t\t\t\trowIndex: newRowIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new row.\n\t\tsetSelectedCell( {\n\t\t\tsectionName,\n\t\t\trowIndex: newRowIndex,\n\t\t\tcolumnIndex: 0,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a row before the currently selected row.\n\t */\n\tfunction onInsertRowBefore() {\n\t\tonInsertRow( 0 );\n\t}\n\n\t/**\n\t * Inserts a row after the currently selected row.\n\t */\n\tfunction onInsertRowAfter() {\n\t\tonInsertRow( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected row.\n\t */\n\tfunction onDeleteRow() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes( deleteRow( attributes, { sectionName, rowIndex } ) );\n\t}\n\n\t/**\n\t * Inserts a column at the currently selected column index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected column index at which to insert.\n\t */\n\tfunction onInsertColumn( delta = 0 ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { columnIndex } = selectedCell;\n\t\tconst newColumnIndex = columnIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertColumn( attributes, {\n\t\t\t\tcolumnIndex: newColumnIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new column.\n\t\tsetSelectedCell( {\n\t\t\trowIndex: 0,\n\t\t\tcolumnIndex: newColumnIndex,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a column before the currently selected column.\n\t */\n\tfunction onInsertColumnBefore() {\n\t\tonInsertColumn( 0 );\n\t}\n\n\t/**\n\t * Inserts a column after the currently selected column.\n\t */\n\tfunction onInsertColumnAfter() {\n\t\tonInsertColumn( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected column.\n\t */\n\tfunction onDeleteColumn() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, columnIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes(\n\t\t\tdeleteColumn( attributes, { sectionName, columnIndex } )\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSingleSelected ) {\n\t\t\tsetSelectedCell();\n\t\t}\n\t}, [ isSingleSelected ] );\n\n\tuseEffect( () => {\n\t\tif ( hasTableCreated ) {\n\t\t\ttableRef?.current\n\t\t\t\t?.querySelector( 'td div[contentEditable=\"true\"]' )\n\t\t\t\t?.focus();\n\t\t\tsetHasTableCreated( false );\n\t\t}\n\t}, [ hasTableCreated ] );\n\n\tconst sections = [ 'head', 'body', 'foot' ].filter(\n\t\t( name ) => ! isEmptyTableSection( attributes[ name ] )\n\t);\n\n\tconst tableControls = [\n\t\t{\n\t\t\ticon: tableRowBefore,\n\t\t\ttitle: __( 'Insert row before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowAfter,\n\t\t\ttitle: __( 'Insert row after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowDelete,\n\t\t\ttitle: __( 'Delete row' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnBefore,\n\t\t\ttitle: __( 'Insert column before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnAfter,\n\t\t\ttitle: __( 'Insert column after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnDelete,\n\t\t\ttitle: __( 'Delete column' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteColumn,\n\t\t},\n\t];\n\n\tconst renderedSections = sections.map( ( name ) => (\n\t\t<TSection name={ name } key={ name }>\n\t\t\t{ attributes[ name ].map( ( { cells }, rowIndex ) => (\n\t\t\t\t<tr key={ rowIndex }>\n\t\t\t\t\t{ cells.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\ttag: CellTag,\n\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\talign,\n\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcolumnIndex\n\t\t\t\t\t\t) => (\n\t\t\t\t\t\t\t<CellTag\n\t\t\t\t\t\t\t\tkey={ columnIndex }\n\t\t\t\t\t\t\t\tscope={ CellTag === 'th' ? scope : undefined }\n\t\t\t\t\t\t\t\tcolSpan={ colspan }\n\t\t\t\t\t\t\t\trowSpan={ rowspan }\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'wp-block-table__cell-content'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\t\tonFocus={ () => {\n\t\t\t\t\t\t\t\t\t\tsetSelectedCell( {\n\t\t\t\t\t\t\t\t\t\t\tsectionName: name,\n\t\t\t\t\t\t\t\t\t\t\trowIndex,\n\t\t\t\t\t\t\t\t\t\t\tcolumnIndex,\n\t\t\t\t\t\t\t\t\t\t\ttype: 'cell',\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-label={ cellAriaLabel[ name ] }\n\t\t\t\t\t\t\t\t\tplaceholder={ placeholder[ name ] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</CellTag>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t</tr>\n\t\t\t) ) }\n\t\t</TSection>\n\t) );\n\n\tconst isEmpty = ! sections.length;\n\n\treturn (\n\t\t<figure { ...useBlockProps( { ref: tableRef } ) }>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\t\tlabel={ __( 'Change column alignment' ) }\n\t\t\t\t\t\t\talignmentControls={ ALIGNMENT_CONTROLS }\n\t\t\t\t\t\t\tvalue={ getCellAlignment() }\n\t\t\t\t\t\t\tonChange={ ( nextAlign ) =>\n\t\t\t\t\t\t\t\tonChangeColumnAlignment( nextAlign )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\t\ticon={ table }\n\t\t\t\t\t\t\tlabel={ __( 'Edit table' ) }\n\t\t\t\t\t\t\tcontrols={ tableControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\t\tclassName=\"blocks-table-settings\"\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Fixed width table cells' ) }\n\t\t\t\t\t\tchecked={ !! hasFixedLayout }\n\t\t\t\t\t\tonChange={ onChangeFixedLayout }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Header section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( head && head.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleHeaderSection }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Footer section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( foot && foot.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleFooterSection }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<table\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-fixed-layout': hasFixedLayout,\n\t\t\t\t\t\t\t// This is required in the editor only to overcome\n\t\t\t\t\t\t\t// the fact the editor rewrites individual border\n\t\t\t\t\t\t\t// widths into a shorthand format.\n\t\t\t\t\t\t\t'has-individual-borders': hasSplitBorders(\n\t\t\t\t\t\t\t\tattributes?.style?.border\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ { ...colorProps.style, ...borderProps.style } }\n\t\t\t\t>\n\t\t\t\t\t{ renderedSections }\n\t\t\t\t</table>\n\t\t\t) }\n\t\t\t{ isEmpty ? (\n\t\t\t\t<Placeholder\n\t\t\t\t\tlabel={ __( 'Table' ) }\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\t\t\tinstructions={ __( 'Insert a table for sharing data.' ) }\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tclassName=\"blocks-table__placeholder-form\"\n\t\t\t\t\t\tonSubmit={ onCreateTable }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Column count' ) }\n\t\t\t\t\t\t\tvalue={ initialColumnCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialColumnCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Row count' ) }\n\t\t\t\t\t\t\tvalue={ initialRowCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialRowCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create Table' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</Placeholder>\n\t\t\t) : (\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Table caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSingleSelected }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n\nexport default TableEdit;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAUA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AASA,IAAAK,MAAA,GAAAL,OAAA;AAiBA,IAAAM,MAAA,GAAAN,OAAA;AAWA,IAAAO,QAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAzD3C;AACA;AACA;;AAGA;AACA;AACA;;AAoCA;AACA;AACA;;AAcA,MAAMS,kBAAkB,GAAG,CAC1B;EACCC,IAAI,EAAEC,gBAAS;EACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAoB,CAAC;EAChCC,KAAK,EAAE;AACR,CAA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BAAqB;UACrBvF,IAAI,EAAC,QAAQ;UACbmE,KAAK,EAAG,IAAAxH,QAAE,EAAE,WAAY,CAAG;UAC3B6G,KAAK,EAAGxF,eAAiB;UACzB0B,QAAQ,EAAGT,uBAAyB;UACpCuG,GAAG,EAAC,GAAG;UACPnC,SAAS,EAAC;QAAiC,CAC3C,CAAC,eACF,IAAA/G,WAAA,CAAAkB,GAAA,EAACtB,WAAA,CAAAuJ,MAAM;UACNF,qBAAqB;UACrBG,OAAO,EAAC,SAAS;UACjB1F,IAAI,EAAC,QAAQ;UAAA2C,QAAA,EAEX,IAAAhG,QAAE,EAAE,cAAe;QAAC,CACf,CAAC;MAAA,CACJ;IAAC,CACK,CAAC,gBAEd,IAAAL,WAAA,CAAAkB,GAAA,EAACnB,QAAA,CAAAsJ,OAAO;MACPjI,UAAU,EAAGA,UAAY;MACzBC,aAAa,EAAGA,aAAe;MAC/BE,UAAU,EAAGC,gBAAkB;MAC/BF,iBAAiB,EAAGA,iBAAmB;MACvCuG,KAAK,EAAG,IAAAxH,QAAE,EAAE,oBAAqB,CAAG;MACpCiJ,iBAAiB,EAAG9H;IAAkB,CACtC,CACD;EAAA,CACM,CAAC;AAEX;AAAC,IAAA+H,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctI,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_i18n","_components","_icons","_state","_caption","_hooks","_jsxRuntime","ALIGNMENT_CONTROLS","icon","alignLeft","title","__","align","alignCenter","alignRight","cellAriaLabel","head","body","foot","placeholder","TSection","name","props","TagName","jsx","TableEdit","attributes","setAttributes","insertBlocksAfter","isSelected","isSingleSelected","hasFixedLayout","initialRowCount","setInitialRowCount","useState","initialColumnCount","setInitialColumnCount","selectedCell","setSelectedCell","colorProps","useColorProps","borderProps","useBorderProps","tableRef","useRef","hasTableCreated","setHasTableCreated","dropdownMenuProps","useToolsPanelDropdownMenuProps","onChangeInitialColumnCount","count","onChangeInitialRowCount","onCreateTable","event","preventDefault","createTable","rowCount","parseInt","columnCount","onChangeFixedLayout","onChange","content","updateSelectedCell","cellAttributes","onChangeColumnAlignment","columnSelection","type","columnIndex","newAttributes","getCellAlignment","getCellAttribute","onToggleHeaderSection","toggleSection","onToggleFooterSection","onInsertRow","delta","sectionName","rowIndex","newRowIndex","insertRow","onInsertRowBefore","onInsertRowAfter","onDeleteRow","deleteRow","onInsertColumn","newColumnIndex","insertColumn","onInsertColumnBefore","onInsertColumnAfter","onDeleteColumn","deleteColumn","useEffect","current","querySelector","focus","sections","filter","isEmptyTableSection","tableControls","tableRowBefore","isDisabled","onClick","tableRowAfter","tableRowDelete","tableColumnBefore","tableColumnAfter","tableColumnDelete","renderedSections","map","children","cells","tag","CellTag","scope","colspan","rowspan","undefined","colSpan","rowSpan","className","clsx","RichText","value","onFocus","isEmpty","length","jsxs","useBlockProps","ref","Fragment","BlockControls","group","AlignmentControl","label","alignmentControls","nextAlign","ToolbarDropdownMenu","table","controls","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked","hasSplitBorders","style","border","Placeholder","BlockIcon","showColors","instructions","onSubmit","TextControl","__next40pxDefaultSize","min","Button","variant","Caption","showToolbarButton","_default","exports","default"],"sources":["@wordpress/block-library/src/table/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tRichText,\n\tBlockIcon,\n\tAlignmentControl,\n\tuseBlockProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalUseBorderProps as useBorderProps,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tPlaceholder,\n\tTextControl,\n\tToggleControl,\n\tToolbarDropdownMenu,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\talignLeft,\n\talignRight,\n\talignCenter,\n\tblockTable as icon,\n\ttableColumnAfter,\n\ttableColumnBefore,\n\ttableColumnDelete,\n\ttableRowAfter,\n\ttableRowBefore,\n\ttableRowDelete,\n\ttable,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcreateTable,\n\tupdateSelectedCell,\n\tgetCellAttribute,\n\tinsertRow,\n\tdeleteRow,\n\tinsertColumn,\n\tdeleteColumn,\n\ttoggleSection,\n\tisEmptyTableSection,\n} from './state';\nimport { Caption } from '../utils/caption';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst ALIGNMENT_CONTROLS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align column left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align column center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align column right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst cellAriaLabel = {\n\thead: __( 'Header cell text' ),\n\tbody: __( 'Body cell text' ),\n\tfoot: __( 'Footer cell text' ),\n};\n\nconst placeholder = {\n\thead: __( 'Header label' ),\n\tfoot: __( 'Footer label' ),\n};\n\nfunction TSection( { name, ...props } ) {\n\tconst TagName = `t${ name }`;\n\treturn <TagName { ...props } />;\n}\n\nfunction TableEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tisSelected: isSingleSelected,\n} ) {\n\tconst { hasFixedLayout, head, foot } = attributes;\n\tconst [ initialRowCount, setInitialRowCount ] = useState( 2 );\n\tconst [ initialColumnCount, setInitialColumnCount ] = useState( 2 );\n\tconst [ selectedCell, setSelectedCell ] = useState();\n\n\tconst colorProps = useColorProps( attributes );\n\tconst borderProps = useBorderProps( attributes );\n\n\tconst tableRef = useRef();\n\tconst [ hasTableCreated, setHasTableCreated ] = useState( false );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t/**\n\t * Updates the initial column count used for table creation.\n\t *\n\t * @param {number} count New initial column count.\n\t */\n\tfunction onChangeInitialColumnCount( count ) {\n\t\tsetInitialColumnCount( count );\n\t}\n\n\t/**\n\t * Updates the initial row count used for table creation.\n\t *\n\t * @param {number} count New initial row count.\n\t */\n\tfunction onChangeInitialRowCount( count ) {\n\t\tsetInitialRowCount( count );\n\t}\n\n\t/**\n\t * Creates a table based on dimensions in local state.\n\t *\n\t * @param {Object} event Form submit event.\n\t */\n\tfunction onCreateTable( event ) {\n\t\tevent.preventDefault();\n\n\t\tsetAttributes(\n\t\t\tcreateTable( {\n\t\t\t\trowCount: parseInt( initialRowCount, 10 ) || 2,\n\t\t\t\tcolumnCount: parseInt( initialColumnCount, 10 ) || 2,\n\t\t\t} )\n\t\t);\n\t\tsetHasTableCreated( true );\n\t}\n\n\t/**\n\t * Toggles whether the table has a fixed layout or not.\n\t */\n\tfunction onChangeFixedLayout() {\n\t\tsetAttributes( { hasFixedLayout: ! hasFixedLayout } );\n\t}\n\n\t/**\n\t * Changes the content of the currently selected cell.\n\t *\n\t * @param {Array} content A RichText content value.\n\t */\n\tfunction onChange( content ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes(\n\t\t\tupdateSelectedCell(\n\t\t\t\tattributes,\n\t\t\t\tselectedCell,\n\t\t\t\t( cellAttributes ) => ( {\n\t\t\t\t\t...cellAttributes,\n\t\t\t\t\tcontent,\n\t\t\t\t} )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Align text within the a column.\n\t *\n\t * @param {string} align The new alignment to apply to the column.\n\t */\n\tfunction onChangeColumnAlignment( align ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Convert the cell selection to a column selection so that alignment\n\t\t// is applied to the entire column.\n\t\tconst columnSelection = {\n\t\t\ttype: 'column',\n\t\t\tcolumnIndex: selectedCell.columnIndex,\n\t\t};\n\n\t\tconst newAttributes = updateSelectedCell(\n\t\t\tattributes,\n\t\t\tcolumnSelection,\n\t\t\t( cellAttributes ) => ( {\n\t\t\t\t...cellAttributes,\n\t\t\t\talign,\n\t\t\t} )\n\t\t);\n\t\tsetAttributes( newAttributes );\n\t}\n\n\t/**\n\t * Get the alignment of the currently selected cell.\n\t *\n\t * @return {string | undefined} The new alignment to apply to the column.\n\t */\n\tfunction getCellAlignment() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn getCellAttribute( attributes, selectedCell, 'align' );\n\t}\n\n\t/**\n\t * Add or remove a `head` table section.\n\t */\n\tfunction onToggleHeaderSection() {\n\t\tsetAttributes( toggleSection( attributes, 'head' ) );\n\t}\n\n\t/**\n\t * Add or remove a `foot` table section.\n\t */\n\tfunction onToggleFooterSection() {\n\t\tsetAttributes( toggleSection( attributes, 'foot' ) );\n\t}\n\n\t/**\n\t * Inserts a row at the currently selected row index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected row index at which to insert.\n\t */\n\tfunction onInsertRow( delta ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\t\tconst newRowIndex = rowIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertRow( attributes, {\n\t\t\t\tsectionName,\n\t\t\t\trowIndex: newRowIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new row.\n\t\tsetSelectedCell( {\n\t\t\tsectionName,\n\t\t\trowIndex: newRowIndex,\n\t\t\tcolumnIndex: 0,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a row before the currently selected row.\n\t */\n\tfunction onInsertRowBefore() {\n\t\tonInsertRow( 0 );\n\t}\n\n\t/**\n\t * Inserts a row after the currently selected row.\n\t */\n\tfunction onInsertRowAfter() {\n\t\tonInsertRow( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected row.\n\t */\n\tfunction onDeleteRow() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes( deleteRow( attributes, { sectionName, rowIndex } ) );\n\t}\n\n\t/**\n\t * Inserts a column at the currently selected column index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected column index at which to insert.\n\t */\n\tfunction onInsertColumn( delta = 0 ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { columnIndex } = selectedCell;\n\t\tconst newColumnIndex = columnIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertColumn( attributes, {\n\t\t\t\tcolumnIndex: newColumnIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new column.\n\t\tsetSelectedCell( {\n\t\t\trowIndex: 0,\n\t\t\tcolumnIndex: newColumnIndex,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a column before the currently selected column.\n\t */\n\tfunction onInsertColumnBefore() {\n\t\tonInsertColumn( 0 );\n\t}\n\n\t/**\n\t * Inserts a column after the currently selected column.\n\t */\n\tfunction onInsertColumnAfter() {\n\t\tonInsertColumn( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected column.\n\t */\n\tfunction onDeleteColumn() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, columnIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes(\n\t\t\tdeleteColumn( attributes, { sectionName, columnIndex } )\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSingleSelected ) {\n\t\t\tsetSelectedCell();\n\t\t}\n\t}, [ isSingleSelected ] );\n\n\tuseEffect( () => {\n\t\tif ( hasTableCreated ) {\n\t\t\ttableRef?.current\n\t\t\t\t?.querySelector( 'td div[contentEditable=\"true\"]' )\n\t\t\t\t?.focus();\n\t\t\tsetHasTableCreated( false );\n\t\t}\n\t}, [ hasTableCreated ] );\n\n\tconst sections = [ 'head', 'body', 'foot' ].filter(\n\t\t( name ) => ! isEmptyTableSection( attributes[ name ] )\n\t);\n\n\tconst tableControls = [\n\t\t{\n\t\t\ticon: tableRowBefore,\n\t\t\ttitle: __( 'Insert row before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowAfter,\n\t\t\ttitle: __( 'Insert row after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowDelete,\n\t\t\ttitle: __( 'Delete row' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnBefore,\n\t\t\ttitle: __( 'Insert column before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnAfter,\n\t\t\ttitle: __( 'Insert column after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnDelete,\n\t\t\ttitle: __( 'Delete column' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteColumn,\n\t\t},\n\t];\n\n\tconst renderedSections = sections.map( ( name ) => (\n\t\t<TSection name={ name } key={ name }>\n\t\t\t{ attributes[ name ].map( ( { cells }, rowIndex ) => (\n\t\t\t\t<tr key={ rowIndex }>\n\t\t\t\t\t{ cells.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\ttag: CellTag,\n\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\talign,\n\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcolumnIndex\n\t\t\t\t\t\t) => (\n\t\t\t\t\t\t\t<CellTag\n\t\t\t\t\t\t\t\tkey={ columnIndex }\n\t\t\t\t\t\t\t\tscope={ CellTag === 'th' ? scope : undefined }\n\t\t\t\t\t\t\t\tcolSpan={ colspan }\n\t\t\t\t\t\t\t\trowSpan={ rowspan }\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'wp-block-table__cell-content'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\t\tonFocus={ () => {\n\t\t\t\t\t\t\t\t\t\tsetSelectedCell( {\n\t\t\t\t\t\t\t\t\t\t\tsectionName: name,\n\t\t\t\t\t\t\t\t\t\t\trowIndex,\n\t\t\t\t\t\t\t\t\t\t\tcolumnIndex,\n\t\t\t\t\t\t\t\t\t\t\ttype: 'cell',\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-label={ cellAriaLabel[ name ] }\n\t\t\t\t\t\t\t\t\tplaceholder={ placeholder[ name ] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</CellTag>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t</tr>\n\t\t\t) ) }\n\t\t</TSection>\n\t) );\n\n\tconst isEmpty = ! sections.length;\n\n\treturn (\n\t\t<figure { ...useBlockProps( { ref: tableRef } ) }>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\t\tlabel={ __( 'Change column alignment' ) }\n\t\t\t\t\t\t\talignmentControls={ ALIGNMENT_CONTROLS }\n\t\t\t\t\t\t\tvalue={ getCellAlignment() }\n\t\t\t\t\t\t\tonChange={ ( nextAlign ) =>\n\t\t\t\t\t\t\t\tonChangeColumnAlignment( nextAlign )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\t\ticon={ table }\n\t\t\t\t\t\t\tlabel={ __( 'Edit table' ) }\n\t\t\t\t\t\t\tcontrols={ tableControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\thasFixedLayout: true,\n\t\t\t\t\t\t\thead: [],\n\t\t\t\t\t\t\tfoot: [],\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => hasFixedLayout !== true }\n\t\t\t\t\t\tlabel={ __( 'Fixed width table cells' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { hasFixedLayout: true } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Fixed width table cells' ) }\n\t\t\t\t\t\t\tchecked={ !! hasFixedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeFixedLayout }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => head && head.length }\n\t\t\t\t\t\t\t\tlabel={ __( 'Header section' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { head: [] } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Header section' ) }\n\t\t\t\t\t\t\t\t\tchecked={ !! ( head && head.length ) }\n\t\t\t\t\t\t\t\t\tonChange={ onToggleHeaderSection }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => foot && foot.length }\n\t\t\t\t\t\t\t\tlabel={ __( 'Footer section' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { foot: [] } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Footer section' ) }\n\t\t\t\t\t\t\t\t\tchecked={ !! ( foot && foot.length ) }\n\t\t\t\t\t\t\t\t\tonChange={ onToggleFooterSection }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<table\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-fixed-layout': hasFixedLayout,\n\t\t\t\t\t\t\t// This is required in the editor only to overcome\n\t\t\t\t\t\t\t// the fact the editor rewrites individual border\n\t\t\t\t\t\t\t// widths into a shorthand format.\n\t\t\t\t\t\t\t'has-individual-borders': hasSplitBorders(\n\t\t\t\t\t\t\t\tattributes?.style?.border\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ { ...colorProps.style, ...borderProps.style } }\n\t\t\t\t>\n\t\t\t\t\t{ renderedSections }\n\t\t\t\t</table>\n\t\t\t) }\n\t\t\t{ isEmpty ? (\n\t\t\t\t<Placeholder\n\t\t\t\t\tlabel={ __( 'Table' ) }\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\t\t\tinstructions={ __( 'Insert a table for sharing data.' ) }\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tclassName=\"blocks-table__placeholder-form\"\n\t\t\t\t\t\tonSubmit={ onCreateTable }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Column count' ) }\n\t\t\t\t\t\t\tvalue={ initialColumnCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialColumnCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Row count' ) }\n\t\t\t\t\t\t\tvalue={ initialRowCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialRowCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create Table' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</Placeholder>\n\t\t\t) : (\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Table caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSingleSelected }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n\nexport default TableEdit;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAUA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAUA,IAAAK,MAAA,GAAAL,OAAA;AAiBA,IAAAM,MAAA,GAAAN,OAAA;AAWA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAgE,IAAAS,WAAA,GAAAT,OAAA;AA3DhE;AACA;AACA;;AAGA;AACA;AACA;;AAqCA;AACA;AACA;;AAeA,MAAMU,kBAAkB,GAAG,CAC1B;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