@wordpress/block-editor 14.6.0 → 14.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-list/block.js +14 -28
  3. package/build/components/block-list/block.js.map +1 -1
  4. package/build/components/block-patterns-list/index.js +23 -26
  5. package/build/components/block-patterns-list/index.js.map +1 -1
  6. package/build/components/block-popover/index.js +1 -1
  7. package/build/components/block-popover/index.js.map +1 -1
  8. package/build/components/block-preview/async.js +51 -0
  9. package/build/components/block-preview/async.js.map +1 -0
  10. package/build/components/block-preview/index.js +4 -1
  11. package/build/components/block-preview/index.js.map +1 -1
  12. package/build/components/block-toolbar/change-design.js +1 -4
  13. package/build/components/block-toolbar/change-design.js.map +1 -1
  14. package/build/components/block-tools/index.js +12 -9
  15. package/build/components/block-tools/index.js.map +1 -1
  16. package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  17. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  18. package/build/components/block-tools/use-show-block-tools.js +4 -1
  19. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  20. package/build/components/global-styles/dimensions-panel.js +26 -14
  21. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  22. package/build/components/iframe/get-compatibility-styles.js +4 -4
  23. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  24. package/build/components/iframe/index.js +16 -0
  25. package/build/components/iframe/index.js.map +1 -1
  26. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  27. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  28. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  29. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  30. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +3 -1
  31. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  32. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
  33. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  34. package/build/components/inserter/block-patterns-tab/utils.js +5 -1
  35. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  36. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  37. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  38. package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
  39. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  40. package/build/components/inserter/search-results.js +0 -2
  41. package/build/components/inserter/search-results.js.map +1 -1
  42. package/build/components/media-placeholder/index.js +4 -4
  43. package/build/components/media-placeholder/index.js.map +1 -1
  44. package/build/components/rich-text/index.js +1 -1
  45. package/build/components/rich-text/index.js.map +1 -1
  46. package/build/components/tabbed-sidebar/index.js +1 -1
  47. package/build/components/tabbed-sidebar/index.js.map +1 -1
  48. package/build/components/url-input/index.js +3 -1
  49. package/build/components/url-input/index.js.map +1 -1
  50. package/build/components/use-block-commands/index.js +5 -6
  51. package/build/components/use-block-commands/index.js.map +1 -1
  52. package/build/hooks/font-family.js +1 -1
  53. package/build/hooks/font-family.js.map +1 -1
  54. package/build/hooks/supports.js +6 -6
  55. package/build/hooks/supports.js.map +1 -1
  56. package/build/hooks/typography.js +5 -5
  57. package/build/hooks/typography.js.map +1 -1
  58. package/build/hooks/utils.js +2 -2
  59. package/build/hooks/utils.js.map +1 -1
  60. package/build/lock-unlock.js.map +1 -1
  61. package/build/store/private-selectors.js +2 -2
  62. package/build/store/private-selectors.js.map +1 -1
  63. package/build/store/selectors.js +9 -8
  64. package/build/store/selectors.js.map +1 -1
  65. package/build/store/utils.js +5 -4
  66. package/build/store/utils.js.map +1 -1
  67. package/build/utils/dom.js +27 -22
  68. package/build/utils/dom.js.map +1 -1
  69. package/build-module/components/block-list/block.js +15 -27
  70. package/build-module/components/block-list/block.js.map +1 -1
  71. package/build-module/components/block-patterns-list/index.js +23 -26
  72. package/build-module/components/block-patterns-list/index.js.map +1 -1
  73. package/build-module/components/block-popover/index.js +2 -2
  74. package/build-module/components/block-popover/index.js.map +1 -1
  75. package/build-module/components/block-preview/async.js +44 -0
  76. package/build-module/components/block-preview/async.js.map +1 -0
  77. package/build-module/components/block-preview/index.js +4 -1
  78. package/build-module/components/block-preview/index.js.map +1 -1
  79. package/build-module/components/block-toolbar/change-design.js +1 -4
  80. package/build-module/components/block-toolbar/change-design.js.map +1 -1
  81. package/build-module/components/block-tools/index.js +13 -10
  82. package/build-module/components/block-tools/index.js.map +1 -1
  83. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  84. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  85. package/build-module/components/block-tools/use-show-block-tools.js +4 -1
  86. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  87. package/build-module/components/global-styles/dimensions-panel.js +26 -14
  88. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  89. package/build-module/components/iframe/get-compatibility-styles.js +4 -4
  90. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  91. package/build-module/components/iframe/index.js +16 -0
  92. package/build-module/components/iframe/index.js.map +1 -1
  93. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  94. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  95. package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
  96. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  97. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -2
  98. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  99. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
  100. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  101. package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
  102. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  103. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  104. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  105. package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
  106. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  107. package/build-module/components/inserter/search-results.js +0 -2
  108. package/build-module/components/inserter/search-results.js.map +1 -1
  109. package/build-module/components/media-placeholder/index.js +4 -4
  110. package/build-module/components/media-placeholder/index.js.map +1 -1
  111. package/build-module/components/rich-text/index.js +1 -1
  112. package/build-module/components/rich-text/index.js.map +1 -1
  113. package/build-module/components/tabbed-sidebar/index.js +1 -1
  114. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  115. package/build-module/components/url-input/index.js +3 -1
  116. package/build-module/components/url-input/index.js.map +1 -1
  117. package/build-module/components/use-block-commands/index.js +4 -4
  118. package/build-module/components/use-block-commands/index.js.map +1 -1
  119. package/build-module/hooks/font-family.js +1 -1
  120. package/build-module/hooks/font-family.js.map +1 -1
  121. package/build-module/hooks/supports.js +6 -6
  122. package/build-module/hooks/supports.js.map +1 -1
  123. package/build-module/hooks/typography.js +5 -5
  124. package/build-module/hooks/typography.js.map +1 -1
  125. package/build-module/hooks/utils.js +2 -2
  126. package/build-module/hooks/utils.js.map +1 -1
  127. package/build-module/lock-unlock.js.map +1 -1
  128. package/build-module/store/private-selectors.js +2 -2
  129. package/build-module/store/private-selectors.js.map +1 -1
  130. package/build-module/store/selectors.js +9 -8
  131. package/build-module/store/selectors.js.map +1 -1
  132. package/build-module/store/utils.js +3 -3
  133. package/build-module/store/utils.js.map +1 -1
  134. package/build-module/utils/dom.js +25 -21
  135. package/build-module/utils/dom.js.map +1 -1
  136. package/build-style/content-rtl.css +7 -6
  137. package/build-style/content.css +7 -6
  138. package/build-style/style-rtl.css +14 -3
  139. package/build-style/style.css +14 -3
  140. package/build-types/utils/dom.d.ts +7 -9
  141. package/build-types/utils/dom.d.ts.map +1 -1
  142. package/package.json +4 -3
  143. package/src/components/block-canvas/style.scss +1 -1
  144. package/src/components/block-inspector/style.scss +2 -1
  145. package/src/components/block-list/block.js +28 -48
  146. package/src/components/block-patterns-list/README.md +8 -8
  147. package/src/components/block-patterns-list/index.js +35 -51
  148. package/src/components/block-patterns-list/stories/index.story.js +2 -19
  149. package/src/components/block-popover/index.js +4 -4
  150. package/src/components/block-preview/async.js +43 -0
  151. package/src/components/block-preview/index.js +6 -1
  152. package/src/components/block-toolbar/change-design.js +1 -7
  153. package/src/components/block-tools/index.js +26 -10
  154. package/src/components/block-tools/style.scss +12 -0
  155. package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  156. package/src/components/block-tools/use-show-block-tools.js +3 -1
  157. package/src/components/default-block-appender/content.scss +13 -19
  158. package/src/components/global-styles/dimensions-panel.js +22 -16
  159. package/src/components/iframe/get-compatibility-styles.js +4 -9
  160. package/src/components/iframe/index.js +17 -0
  161. package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
  162. package/src/components/inserter/block-patterns-tab/index.js +0 -1
  163. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +8 -1
  164. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
  165. package/src/components/inserter/block-patterns-tab/utils.js +5 -0
  166. package/src/components/inserter/hooks/use-block-types-state.js +6 -1
  167. package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
  168. package/src/components/inserter/search-results.js +0 -6
  169. package/src/components/media-placeholder/index.js +4 -4
  170. package/src/components/rich-text/index.js +8 -1
  171. package/src/components/tabbed-sidebar/index.js +1 -1
  172. package/src/components/tabbed-sidebar/style.scss +1 -1
  173. package/src/components/url-input/index.js +3 -4
  174. package/src/components/use-block-commands/index.js +245 -234
  175. package/src/hooks/font-family.js +1 -1
  176. package/src/hooks/supports.js +6 -6
  177. package/src/hooks/typography.js +5 -5
  178. package/src/hooks/utils.js +7 -2
  179. package/src/store/private-selectors.js +5 -6
  180. package/src/store/selectors.js +57 -45
  181. package/src/store/test/private-selectors.js +5 -0
  182. package/src/store/utils.js +12 -11
  183. package/src/utils/dom.js +26 -21
  184. package/src/utils/test/dom.js +224 -0
  185. package/tsconfig.json +1 -0
  186. package/tsconfig.tsbuildinfo +1 -1
  187. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__","sprintf","_n","Component","createRef","UP","DOWN","ENTER","TAB","BaseControl","Button","__experimentalInputControl","InputControl","Spinner","withSpokenMessages","Popover","compose","debounce","withInstanceId","withSafeTimeout","withSelect","isURL","store","blockEditorStore","Fragment","_Fragment","jsxs","_jsxs","jsx","_jsx","createElement","_createElement","isFunction","maybeFunc","URLInput","constructor","props","onChange","bind","onFocus","onKeyDown","selectLink","handleOnClick","bindSuggestionNode","autocompleteRef","inputRef","updateSuggestions","suggestionNodes","suggestionsRequest","state","suggestions","showSuggestions","suggestionsValue","selectedSuggestion","suggestionsListboxId","suggestionOptionIdPrefix","componentDidUpdate","prevProps","value","__experimentalShowInitialSuggestions","scrollIntoView","behavior","block","inline","disableSuggestions","length","componentDidMount","shouldShowInitialSuggestions","componentWillUnmount","cancel","index","ref","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalHandleURLSuggestions","handleURLSuggestions","isInitialSuggestions","trim","setState","loading","request","then","debouncedSpeak","catch","finally","newValue","event","keyCode","target","selectionStart","preventDefault","setSelectionRange","onSubmit","suggestion","previousIndex","nextIndex","speak","url","current","focus","getDerivedStateFromProps","instanceId","shouldShowSuggestions","hasValue","render","children","renderControl","renderSuggestions","label","className","isFullWidth","placeholder","__experimentalRenderControl","hideLabelFromVision","inputId","controlProps","id","inputProps","required","type","role","undefined","suffix","__nextHasNoMarginBottom","__next40pxDefaultSize","__experimentalRenderSuggestions","suggestionsListProps","buildSuggestionItemProps","tabIndex","isLoading","handleSuggestionClick","currentInputValue","placement","focusOnMount","map","key","onClick","title","select","getSettings"],"sources":["@wordpress/block-editor/src/components/url-input/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';\nimport {\n\tBaseControl,\n\tButton,\n\t__experimentalInputControl as InputControl,\n\tSpinner,\n\twithSpokenMessages,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tcompose,\n\tdebounce,\n\twithInstanceId,\n\twithSafeTimeout,\n} from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nclass URLInput extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.selectLink = this.selectLink.bind( this );\n\t\tthis.handleOnClick = this.handleOnClick.bind( this );\n\t\tthis.bindSuggestionNode = this.bindSuggestionNode.bind( this );\n\t\tthis.autocompleteRef = props.autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = debounce(\n\t\t\tthis.updateSuggestions.bind( this ),\n\t\t\t200\n\t\t);\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.suggestionsRequest = null;\n\n\t\tthis.state = {\n\t\t\tsuggestions: [],\n\t\t\tshowSuggestions: false,\n\t\t\tsuggestionsValue: null,\n\t\t\tselectedSuggestion: null,\n\t\t\tsuggestionsListboxId: '',\n\t\t\tsuggestionOptionIdPrefix: '',\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\tconst { value, __experimentalShowInitialSuggestions = false } =\n\t\t\tthis.props;\n\n\t\t// Only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded.\n\t\tif (\n\t\t\tshowSuggestions &&\n\t\t\tselectedSuggestion !== null &&\n\t\t\tthis.suggestionNodes[ selectedSuggestion ]\n\t\t) {\n\t\t\tthis.suggestionNodes[ selectedSuggestion ].scrollIntoView( {\n\t\t\t\tbehavior: 'instant',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tinline: 'nearest',\n\t\t\t} );\n\t\t}\n\n\t\t// Update suggestions when the value changes.\n\t\tif ( prevProps.value !== value && ! this.props.disableSuggestions ) {\n\t\t\tif ( value?.length ) {\n\t\t\t\t// If the new value is not empty we need to update with suggestions for it.\n\t\t\t\tthis.updateSuggestions( value );\n\t\t\t} else if ( __experimentalShowInitialSuggestions ) {\n\t\t\t\t// If the new value is empty and we can show initial suggestions, then show initial suggestions.\n\t\t\t\tthis.updateSuggestions();\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.shouldShowInitialSuggestions() ) {\n\t\t\tthis.updateSuggestions();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.suggestionsRequest?.cancel?.();\n\t\tthis.suggestionsRequest = null;\n\t}\n\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n\tshouldShowInitialSuggestions() {\n\t\tconst { __experimentalShowInitialSuggestions = false, value } =\n\t\t\tthis.props;\n\t\treturn (\n\t\t\t__experimentalShowInitialSuggestions && ! ( value && value.length )\n\t\t);\n\t}\n\n\tupdateSuggestions( value = '' ) {\n\t\tconst {\n\t\t\t__experimentalFetchLinkSuggestions: fetchLinkSuggestions,\n\t\t\t__experimentalHandleURLSuggestions: handleURLSuggestions,\n\t\t} = this.props;\n\n\t\tif ( ! fetchLinkSuggestions ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initial suggestions may only show if there is no value\n\t\t// (note: this includes whitespace).\n\t\tconst isInitialSuggestions = ! value?.length;\n\n\t\t// Trim only now we've determined whether or not it originally had a \"length\"\n\t\t// (even if that value was all whitespace).\n\t\tvalue = value.trim();\n\n\t\t// Allow a suggestions request if:\n\t\t// - there are at least 2 characters in the search input (except manual searches where\n\t\t// search input length is not required to trigger a fetch)\n\t\t// - this is a direct entry (eg: a URL)\n\t\tif (\n\t\t\t! isInitialSuggestions &&\n\t\t\t( value.length < 2 || ( ! handleURLSuggestions && isURL( value ) ) )\n\t\t) {\n\t\t\tthis.suggestionsRequest?.cancel?.();\n\t\t\tthis.suggestionsRequest = null;\n\n\t\t\tthis.setState( {\n\t\t\t\tsuggestions: [],\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tsuggestionsValue: value,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n\t\tconst request = fetchLinkSuggestions( value, {\n\t\t\tisInitialSuggestions,\n\t\t} );\n\n\t\trequest\n\t\t\t.then( ( suggestions ) => {\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tsuggestions,\n\t\t\t\t\tsuggestionsValue: value,\n\t\t\t\t\tloading: false,\n\t\t\t\t\tshowSuggestions: !! suggestions.length,\n\t\t\t\t} );\n\n\t\t\t\tif ( !! suggestions.length ) {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\t__( 'No results.' ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.finally( () => {\n\t\t\t\t// If this is the current promise then reset the reference\n\t\t\t\t// to allow for checking if a new request is made.\n\t\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\t\tthis.suggestionsRequest = null;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t// Note that this assignment is handled *before* the async search request\n\t\t// as a Promise always resolves on the next tick of the event loop.\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\tonChange( newValue ) {\n\t\tthis.props.onChange( newValue );\n\t}\n\n\tonFocus() {\n\t\tconst { suggestions } = this.state;\n\t\tconst { disableSuggestions, value } = this.props;\n\n\t\t// When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value\n\t\t// Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons)\n\t\t// or there is already a request in progress.\n\t\tif (\n\t\t\tvalue &&\n\t\t\t! disableSuggestions &&\n\t\t\t! ( suggestions && suggestions.length ) &&\n\t\t\tthis.suggestionsRequest === null\n\t\t) {\n\t\t\t// Ensure the suggestions are updated with the current input value.\n\t\t\tthis.updateSuggestions( value );\n\t\t}\n\t}\n\n\tonKeyDown( event ) {\n\t\tthis.props.onKeyDown?.( event );\n\t\tconst { showSuggestions, selectedSuggestion, suggestions, loading } =\n\t\t\tthis.state;\n\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation.\n\t\tif ( ! showSuggestions || ! suggestions.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0.\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.props.value.length !== event.target.selectionStart\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position.\n\t\t\t\t\t\tevent.target.setSelectionRange(\n\t\t\t\t\t\t\tthis.props.value.length,\n\t\t\t\t\t\t\tthis.props.value.length\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Submitting while loading should trigger onSubmit.\n\t\t\t\tcase ENTER: {\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst suggestion =\n\t\t\tthis.state.suggestions[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion\n\t\t\t\t\t? suggestions.length - 1\n\t\t\t\t\t: selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex =\n\t\t\t\t\tselectedSuggestion === null ||\n\t\t\t\t\tselectedSuggestion === suggestions.length - 1\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tthis.props.onSubmit( suggestion, event );\n\t\t\t\t\t}\n\t\t\t\t} else if ( this.props.onSubmit ) {\n\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tselectLink( suggestion ) {\n\t\tthis.props.onChange( suggestion.url, suggestion );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n\thandleOnClick( suggestion ) {\n\t\tthis.selectLink( suggestion );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n\tstatic getDerivedStateFromProps(\n\t\t{\n\t\t\tvalue,\n\t\t\tinstanceId,\n\t\t\tdisableSuggestions,\n\t\t\t__experimentalShowInitialSuggestions = false,\n\t\t},\n\t\t{ showSuggestions }\n\t) {\n\t\tlet shouldShowSuggestions = showSuggestions;\n\n\t\tconst hasValue = value && value.length;\n\n\t\tif ( ! __experimentalShowInitialSuggestions && ! hasValue ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\tif ( disableSuggestions === true ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\treturn {\n\t\t\tshowSuggestions: shouldShowSuggestions,\n\t\t\tsuggestionsListboxId: `block-editor-url-input-suggestions-${ instanceId }`,\n\t\t\tsuggestionOptionIdPrefix: `block-editor-url-input-suggestion-${ instanceId }`,\n\t\t};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ this.renderControl() }\n\t\t\t\t{ this.renderSuggestions() }\n\t\t\t</>\n\t\t);\n\t}\n\n\trenderControl() {\n\t\tconst {\n\t\t\tlabel = null,\n\t\t\tclassName,\n\t\t\tisFullWidth,\n\t\t\tinstanceId,\n\t\t\tplaceholder = __( 'Paste URL or type to search' ),\n\t\t\t__experimentalRenderControl: renderControl,\n\t\t\tvalue = '',\n\t\t\thideLabelFromVision = false,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tloading,\n\t\t\tshowSuggestions,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t} = this.state;\n\n\t\tconst inputId = `url-input-control-${ instanceId }`;\n\n\t\tconst controlProps = {\n\t\t\tid: inputId, // Passes attribute to label for the for attribute\n\t\t\tlabel,\n\t\t\tclassName: clsx( 'block-editor-url-input', className, {\n\t\t\t\t'is-full-width': isFullWidth,\n\t\t\t} ),\n\t\t\thideLabelFromVision,\n\t\t};\n\n\t\tconst inputProps = {\n\t\t\tid: inputId,\n\t\t\tvalue,\n\t\t\trequired: true,\n\t\t\ttype: 'text',\n\t\t\tonChange: this.onChange,\n\t\t\tonFocus: this.onFocus,\n\t\t\tplaceholder,\n\t\t\tonKeyDown: this.onKeyDown,\n\t\t\trole: 'combobox',\n\t\t\t'aria-label': label ? undefined : __( 'URL' ), // Ensure input always has an accessible label\n\t\t\t'aria-expanded': showSuggestions,\n\t\t\t'aria-autocomplete': 'list',\n\t\t\t'aria-owns': suggestionsListboxId,\n\t\t\t'aria-activedescendant':\n\t\t\t\tselectedSuggestion !== null\n\t\t\t\t\t? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }`\n\t\t\t\t\t: undefined,\n\t\t\tref: this.inputRef,\n\t\t\tsuffix: this.props.suffix,\n\t\t};\n\n\t\tif ( renderControl ) {\n\t\t\treturn renderControl( controlProps, inputProps, loading );\n\t\t}\n\n\t\treturn (\n\t\t\t<BaseControl __nextHasNoMarginBottom { ...controlProps }>\n\t\t\t\t<InputControl { ...inputProps } __next40pxDefaultSize />\n\t\t\t\t{ loading && <Spinner /> }\n\t\t\t</BaseControl>\n\t\t);\n\t}\n\n\trenderSuggestions() {\n\t\tconst {\n\t\t\tclassName,\n\t\t\t__experimentalRenderSuggestions: renderSuggestions,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tshowSuggestions,\n\t\t\tsuggestions,\n\t\t\tsuggestionsValue,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t\tloading,\n\t\t} = this.state;\n\n\t\tif ( ! showSuggestions || suggestions.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst suggestionsListProps = {\n\t\t\tid: suggestionsListboxId,\n\t\t\tref: this.autocompleteRef,\n\t\t\trole: 'listbox',\n\t\t};\n\n\t\tconst buildSuggestionItemProps = ( suggestion, index ) => {\n\t\t\treturn {\n\t\t\t\trole: 'option',\n\t\t\t\ttabIndex: '-1',\n\t\t\t\tid: `${ suggestionOptionIdPrefix }-${ index }`,\n\t\t\t\tref: this.bindSuggestionNode( index ),\n\t\t\t\t'aria-selected':\n\t\t\t\t\tindex === selectedSuggestion ? true : undefined,\n\t\t\t};\n\t\t};\n\n\t\tif ( isFunction( renderSuggestions ) ) {\n\t\t\treturn renderSuggestions( {\n\t\t\t\tsuggestions,\n\t\t\t\tselectedSuggestion,\n\t\t\t\tsuggestionsListProps,\n\t\t\t\tbuildSuggestionItemProps,\n\t\t\t\tisLoading: loading,\n\t\t\t\thandleSuggestionClick: this.handleOnClick,\n\t\t\t\tisInitialSuggestions: ! suggestionsValue?.length,\n\t\t\t\tcurrentInputValue: suggestionsValue,\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Popover placement=\"bottom\" focusOnMount={ false }>\n\t\t\t\t<div\n\t\t\t\t\t{ ...suggestionsListProps }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-url-input__suggestions',\n\t\t\t\t\t\t`${ className }__suggestions`\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ suggestions.map( ( suggestion, index ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t{ ...buildSuggestionItemProps( suggestion, index ) }\n\t\t\t\t\t\t\tkey={ suggestion.id }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-url-input__suggestion',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( suggestion ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ suggestion.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) ) }\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md\n */\nexport default compose(\n\twithSafeTimeout,\n\twithSpokenMessages,\n\twithInstanceId,\n\twithSelect( ( select, props ) => {\n\t\t// If a link suggestions handler is already provided then\n\t\t// bail.\n\t\tif ( isFunction( props.__experimentalFetchLinkSuggestions ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\t__experimentalFetchLinkSuggestions:\n\t\t\t\tgetSettings().__experimentalFetchLinkSuggestions,\n\t\t};\n\t} )\n)( URLInput );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,EAAE,EAAEC,IAAI,EAAEC,KAAK,EAAEC,GAAG,QAAQ,qBAAqB;AAC1D,SACCC,WAAW,EACXC,MAAM,EACNC,0BAA0B,IAAIC,YAAY,EAC1CC,OAAO,EACPC,kBAAkB,EAClBC,OAAO,QACD,uBAAuB;AAC9B,SACCC,OAAO,EACPC,QAAQ,EACRC,cAAc,EACdC,eAAe,QACT,oBAAoB;AAC3B,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,QAAQ,gBAAgB;;AAEtC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,aAAA,IAAAC,cAAA;AAMA,SAASC,UAAUA,CAAEC,SAAS,EA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AAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","sprintf","_n","Component","createRef","UP","DOWN","ENTER","TAB","BaseControl","Button","__experimentalInputControl","InputControl","Spinner","withSpokenMessages","Popover","compose","debounce","withInstanceId","withSafeTimeout","withSelect","isURL","store","blockEditorStore","Fragment","_Fragment","jsxs","_jsxs","jsx","_jsx","createElement","_createElement","isFunction","maybeFunc","URLInput","constructor","props","onChange","bind","onFocus","onKeyDown","selectLink","handleOnClick","bindSuggestionNode","autocompleteRef","inputRef","updateSuggestions","suggestionNodes","suggestionsRequest","state","suggestions","showSuggestions","suggestionsValue","selectedSuggestion","suggestionsListboxId","suggestionOptionIdPrefix","componentDidUpdate","prevProps","value","__experimentalShowInitialSuggestions","scrollIntoView","behavior","block","inline","disableSuggestions","length","componentDidMount","shouldShowInitialSuggestions","componentWillUnmount","cancel","index","ref","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalHandleURLSuggestions","handleURLSuggestions","isInitialSuggestions","trim","setState","loading","request","then","debouncedSpeak","catch","finally","newValue","event","keyCode","target","selectionStart","preventDefault","setSelectionRange","onSubmit","suggestion","previousIndex","nextIndex","speak","url","current","focus","getDerivedStateFromProps","instanceId","shouldShowSuggestions","hasValue","render","children","renderControl","renderSuggestions","label","className","isFullWidth","placeholder","__experimentalRenderControl","hideLabelFromVision","inputId","controlProps","id","inputProps","required","type","role","undefined","suffix","__nextHasNoMarginBottom","__next40pxDefaultSize","__experimentalRenderSuggestions","suggestionsListProps","buildSuggestionItemProps","tabIndex","isLoading","handleSuggestionClick","currentInputValue","placement","focusOnMount","map","key","onClick","title","select","getSettings"],"sources":["@wordpress/block-editor/src/components/url-input/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';\nimport {\n\tBaseControl,\n\tButton,\n\t__experimentalInputControl as InputControl,\n\tSpinner,\n\twithSpokenMessages,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tcompose,\n\tdebounce,\n\twithInstanceId,\n\twithSafeTimeout,\n} from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nclass URLInput extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.selectLink = this.selectLink.bind( this );\n\t\tthis.handleOnClick = this.handleOnClick.bind( this );\n\t\tthis.bindSuggestionNode = this.bindSuggestionNode.bind( this );\n\t\tthis.autocompleteRef = props.autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = debounce(\n\t\t\tthis.updateSuggestions.bind( this ),\n\t\t\t200\n\t\t);\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.suggestionsRequest = null;\n\n\t\tthis.state = {\n\t\t\tsuggestions: [],\n\t\t\tshowSuggestions: false,\n\t\t\tsuggestionsValue: null,\n\t\t\tselectedSuggestion: null,\n\t\t\tsuggestionsListboxId: '',\n\t\t\tsuggestionOptionIdPrefix: '',\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\tconst { value, __experimentalShowInitialSuggestions = false } =\n\t\t\tthis.props;\n\n\t\t// Only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded.\n\t\tif (\n\t\t\tshowSuggestions &&\n\t\t\tselectedSuggestion !== null &&\n\t\t\tthis.suggestionNodes[ selectedSuggestion ]\n\t\t) {\n\t\t\tthis.suggestionNodes[ selectedSuggestion ].scrollIntoView( {\n\t\t\t\tbehavior: 'instant',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tinline: 'nearest',\n\t\t\t} );\n\t\t}\n\n\t\t// Update suggestions when the value changes.\n\t\tif ( prevProps.value !== value && ! this.props.disableSuggestions ) {\n\t\t\tif ( value?.length ) {\n\t\t\t\t// If the new value is not empty we need to update with suggestions for it.\n\t\t\t\tthis.updateSuggestions( value );\n\t\t\t} else if ( __experimentalShowInitialSuggestions ) {\n\t\t\t\t// If the new value is empty and we can show initial suggestions, then show initial suggestions.\n\t\t\t\tthis.updateSuggestions();\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.shouldShowInitialSuggestions() ) {\n\t\t\tthis.updateSuggestions();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.suggestionsRequest?.cancel?.();\n\t\tthis.suggestionsRequest = null;\n\t}\n\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n\tshouldShowInitialSuggestions() {\n\t\tconst { __experimentalShowInitialSuggestions = false, value } =\n\t\t\tthis.props;\n\t\treturn (\n\t\t\t__experimentalShowInitialSuggestions && ! ( value && value.length )\n\t\t);\n\t}\n\n\tupdateSuggestions( value = '' ) {\n\t\tconst {\n\t\t\t__experimentalFetchLinkSuggestions: fetchLinkSuggestions,\n\t\t\t__experimentalHandleURLSuggestions: handleURLSuggestions,\n\t\t} = this.props;\n\n\t\tif ( ! fetchLinkSuggestions ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initial suggestions may only show if there is no value\n\t\t// (note: this includes whitespace).\n\t\tconst isInitialSuggestions = ! value?.length;\n\n\t\t// Trim only now we've determined whether or not it originally had a \"length\"\n\t\t// (even if that value was all whitespace).\n\t\tvalue = value.trim();\n\n\t\t// Allow a suggestions request if:\n\t\t// - there are at least 2 characters in the search input (except manual searches where\n\t\t// search input length is not required to trigger a fetch)\n\t\t// - this is a direct entry (eg: a URL)\n\t\tif (\n\t\t\t! isInitialSuggestions &&\n\t\t\t( value.length < 2 || ( ! handleURLSuggestions && isURL( value ) ) )\n\t\t) {\n\t\t\tthis.suggestionsRequest?.cancel?.();\n\t\t\tthis.suggestionsRequest = null;\n\n\t\t\tthis.setState( {\n\t\t\t\tsuggestions: [],\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tsuggestionsValue: value,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n\t\tconst request = fetchLinkSuggestions( value, {\n\t\t\tisInitialSuggestions,\n\t\t} );\n\n\t\trequest\n\t\t\t.then( ( suggestions ) => {\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tsuggestions,\n\t\t\t\t\tsuggestionsValue: value,\n\t\t\t\t\tloading: false,\n\t\t\t\t\tshowSuggestions: !! suggestions.length,\n\t\t\t\t} );\n\n\t\t\t\tif ( !! suggestions.length ) {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\t__( 'No results.' ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.finally( () => {\n\t\t\t\t// If this is the current promise then reset the reference\n\t\t\t\t// to allow for checking if a new request is made.\n\t\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\t\tthis.suggestionsRequest = null;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t// Note that this assignment is handled *before* the async search request\n\t\t// as a Promise always resolves on the next tick of the event loop.\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\tonChange( newValue ) {\n\t\tthis.props.onChange( newValue );\n\t}\n\n\tonFocus() {\n\t\tconst { suggestions } = this.state;\n\t\tconst { disableSuggestions, value } = this.props;\n\n\t\t// When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value\n\t\t// Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons)\n\t\t// or there is already a request in progress.\n\t\tif (\n\t\t\tvalue &&\n\t\t\t! disableSuggestions &&\n\t\t\t! ( suggestions && suggestions.length ) &&\n\t\t\tthis.suggestionsRequest === null\n\t\t) {\n\t\t\t// Ensure the suggestions are updated with the current input value.\n\t\t\tthis.updateSuggestions( value );\n\t\t}\n\t}\n\n\tonKeyDown( event ) {\n\t\tthis.props.onKeyDown?.( event );\n\t\tconst { showSuggestions, selectedSuggestion, suggestions, loading } =\n\t\t\tthis.state;\n\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation.\n\t\tif ( ! showSuggestions || ! suggestions.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0.\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.props.value.length !== event.target.selectionStart\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position.\n\t\t\t\t\t\tevent.target.setSelectionRange(\n\t\t\t\t\t\t\tthis.props.value.length,\n\t\t\t\t\t\t\tthis.props.value.length\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Submitting while loading should trigger onSubmit.\n\t\t\t\tcase ENTER: {\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst suggestion =\n\t\t\tthis.state.suggestions[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion\n\t\t\t\t\t? suggestions.length - 1\n\t\t\t\t\t: selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex =\n\t\t\t\t\tselectedSuggestion === null ||\n\t\t\t\t\tselectedSuggestion === suggestions.length - 1\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tthis.props.onSubmit( suggestion, event );\n\t\t\t\t\t}\n\t\t\t\t} else if ( this.props.onSubmit ) {\n\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tselectLink( suggestion ) {\n\t\tthis.props.onChange( suggestion.url, suggestion );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n\thandleOnClick( suggestion ) {\n\t\tthis.selectLink( suggestion );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n\tstatic getDerivedStateFromProps(\n\t\t{\n\t\t\tvalue,\n\t\t\tinstanceId,\n\t\t\tdisableSuggestions,\n\t\t\t__experimentalShowInitialSuggestions = false,\n\t\t},\n\t\t{ showSuggestions }\n\t) {\n\t\tlet shouldShowSuggestions = showSuggestions;\n\n\t\tconst hasValue = value && value.length;\n\n\t\tif ( ! __experimentalShowInitialSuggestions && ! hasValue ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\tif ( disableSuggestions === true ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\treturn {\n\t\t\tshowSuggestions: shouldShowSuggestions,\n\t\t\tsuggestionsListboxId: `block-editor-url-input-suggestions-${ instanceId }`,\n\t\t\tsuggestionOptionIdPrefix: `block-editor-url-input-suggestion-${ instanceId }`,\n\t\t};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ this.renderControl() }\n\t\t\t\t{ this.renderSuggestions() }\n\t\t\t</>\n\t\t);\n\t}\n\n\trenderControl() {\n\t\tconst {\n\t\t\tlabel = null,\n\t\t\tclassName,\n\t\t\tisFullWidth,\n\t\t\tinstanceId,\n\t\t\tplaceholder = __( 'Paste URL or type to search' ),\n\t\t\t__experimentalRenderControl: renderControl,\n\t\t\tvalue = '',\n\t\t\thideLabelFromVision = false,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tloading,\n\t\t\tshowSuggestions,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t} = this.state;\n\n\t\tconst inputId = `url-input-control-${ instanceId }`;\n\n\t\tconst controlProps = {\n\t\t\tid: inputId, // Passes attribute to label for the for attribute\n\t\t\tlabel,\n\t\t\tclassName: clsx( 'block-editor-url-input', className, {\n\t\t\t\t'is-full-width': isFullWidth,\n\t\t\t} ),\n\t\t\thideLabelFromVision,\n\t\t};\n\n\t\tconst inputProps = {\n\t\t\tid: inputId,\n\t\t\tvalue,\n\t\t\trequired: true,\n\t\t\ttype: 'text',\n\t\t\tonChange: this.onChange,\n\t\t\tonFocus: this.onFocus,\n\t\t\tplaceholder,\n\t\t\tonKeyDown: this.onKeyDown,\n\t\t\trole: 'combobox',\n\t\t\t'aria-label': label ? undefined : __( 'URL' ), // Ensure input always has an accessible label\n\t\t\t'aria-expanded': showSuggestions,\n\t\t\t'aria-autocomplete': 'list',\n\t\t\t'aria-owns': suggestionsListboxId,\n\t\t\t'aria-activedescendant':\n\t\t\t\tselectedSuggestion !== null\n\t\t\t\t\t? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }`\n\t\t\t\t\t: undefined,\n\t\t\tref: this.inputRef,\n\t\t\tsuffix: this.props.suffix,\n\t\t};\n\n\t\tif ( renderControl ) {\n\t\t\treturn renderControl( controlProps, inputProps, loading );\n\t\t}\n\n\t\treturn (\n\t\t\t<BaseControl __nextHasNoMarginBottom { ...controlProps }>\n\t\t\t\t<InputControl { ...inputProps } __next40pxDefaultSize />\n\t\t\t\t{ loading && <Spinner /> }\n\t\t\t</BaseControl>\n\t\t);\n\t}\n\n\trenderSuggestions() {\n\t\tconst {\n\t\t\tclassName,\n\t\t\t__experimentalRenderSuggestions: renderSuggestions,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tshowSuggestions,\n\t\t\tsuggestions,\n\t\t\tsuggestionsValue,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t\tloading,\n\t\t} = this.state;\n\n\t\tif ( ! showSuggestions || suggestions.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst suggestionsListProps = {\n\t\t\tid: suggestionsListboxId,\n\t\t\tref: this.autocompleteRef,\n\t\t\trole: 'listbox',\n\t\t};\n\n\t\tconst buildSuggestionItemProps = ( suggestion, index ) => {\n\t\t\treturn {\n\t\t\t\trole: 'option',\n\t\t\t\ttabIndex: '-1',\n\t\t\t\tid: `${ suggestionOptionIdPrefix }-${ index }`,\n\t\t\t\tref: this.bindSuggestionNode( index ),\n\t\t\t\t'aria-selected':\n\t\t\t\t\tindex === selectedSuggestion ? true : undefined,\n\t\t\t};\n\t\t};\n\n\t\tif ( isFunction( renderSuggestions ) ) {\n\t\t\treturn renderSuggestions( {\n\t\t\t\tsuggestions,\n\t\t\t\tselectedSuggestion,\n\t\t\t\tsuggestionsListProps,\n\t\t\t\tbuildSuggestionItemProps,\n\t\t\t\tisLoading: loading,\n\t\t\t\thandleSuggestionClick: this.handleOnClick,\n\t\t\t\tisInitialSuggestions: ! suggestionsValue?.length,\n\t\t\t\tcurrentInputValue: suggestionsValue,\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Popover placement=\"bottom\" focusOnMount={ false }>\n\t\t\t\t<div\n\t\t\t\t\t{ ...suggestionsListProps }\n\t\t\t\t\tclassName={ clsx( 'block-editor-url-input__suggestions', {\n\t\t\t\t\t\t[ `${ className }__suggestions` ]: className,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ suggestions.map( ( suggestion, index ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t{ ...buildSuggestionItemProps( suggestion, index ) }\n\t\t\t\t\t\t\tkey={ suggestion.id }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-url-input__suggestion',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( suggestion ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ suggestion.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) ) }\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md\n */\nexport default compose(\n\twithSafeTimeout,\n\twithSpokenMessages,\n\twithInstanceId,\n\twithSelect( ( select, props ) => {\n\t\t// If a link suggestions handler is already provided then\n\t\t// bail.\n\t\tif ( isFunction( props.__experimentalFetchLinkSuggestions ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\t__experimentalFetchLinkSuggestions:\n\t\t\t\tgetSettings().__experimentalFetchLinkSuggestions,\n\t\t};\n\t} )\n)( URLInput );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,EAAE,EAAEC,IAAI,EAAEC,KAAK,EAAEC,GAAG,QAAQ,qBAAqB;AAC1D,SACCC,WAAW,EACXC,MAAM,EACNC,0BAA0B,IAAIC,YAAY,EAC1CC,OAAO,EACPC,kBAAkB,EAClBC,OAAO,QACD,uBAAuB;AAC9B,SACCC,OAAO,EACPC,QAAQ,EACRC,cAAc,EACdC,eAAe,QACT,oBAAoB;AAC3B,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,QAAQ,gBAAgB;;AAEtC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,aAAA,IAAAC,cAAA;AAMA,SAASC,UAAUA,CAAEC,SAAS,EAAG;EAChC,OAAO,OAAOA,SAAS,KAAK,UAAU;AACvC;AAEA,MAAMC,QAAQ,SAAS/B,SAAS,CAAC;EAChCgC,WAAWA,CAAEC,KAAK,EAAG;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QAChDkE,iBAAiB,EAAE/E;MACpB,CAAE,CAAC;IACJ;IAEA,oBACCvB,IAAA,CAACd,OAAO;MAACqH,SAAS,EAAC,QAAQ;MAACC,YAAY,EAAG,KAAO;MAAA5B,QAAA,eACjD5E,IAAA;QAAA,GACMiG,oBAAoB;QACzBjB,SAAS,EAAG9G,IAAI,CAAE,qCAAqC,EAAE;UACxD,CAAE,GAAI8G,SAAS,eAAgB,GAAIA;QACpC,CAAE,CAAG;QAAAJ,QAAA,EAEHvD,WAAW,CAACoF,GAAG,CAAE,CAAEzC,UAAU,EAAEvB,KAAK,kBACrCvC,cAAA,CAACrB,MAAM;UACNkH,qBAAqB;UAAA,GAChBG,wBAAwB,CAAElC,UAAU,EAAEvB,KAAM,CAAC;UAClDiE,GAAG,EAAG1C,UAAU,CAACuB,EAAI;UACrBP,SAAS,EAAG9G,IAAI,CACf,oCAAoC,EACpC;YACC,aAAa,EAAEuE,KAAK,KAAKjB;UAC1B,CACD,CAAG;UACHmF,OAAO,EAAGA,CAAA,KAAM,IAAI,CAAC9F,aAAa,CAAEmD,UAAW;QAAG,GAEhDA,UAAU,CAAC4C,KACN,CACP;MAAC,CACC;IAAC,CACE,CAAC;EAEZ;AACD;;AAEA;AACA;AACA;AACA,eAAezH,OAAO,CACrBG,eAAe,EACfL,kBAAkB,EAClBI,cAAc,EACdE,UAAU,CAAE,CAAEsH,MAAM,EAAEtG,KAAK,KAAM;EAChC;EACA;EACA,IAAKJ,UAAU,CAAEI,KAAK,CAACoC,kCAAmC,CAAC,EAAG;IAC7D;EACD;EACA,MAAM;IAAEmE;EAAY,CAAC,GAAGD,MAAM,CAAEnH,gBAAiB,CAAC;EAClD,OAAO;IACNiD,kCAAkC,EACjCmE,WAAW,CAAC,CAAC,CAACnE;EAChB,CAAC;AACF,CAAE,CACH,CAAC,CAAEtC,QAAS,CAAC","ignoreList":[]}
@@ -13,7 +13,7 @@ import { copy, trash as remove, plus as add, group, ungroup } from '@wordpress/i
13
13
  import BlockIcon from '../block-icon';
14
14
  import { store as blockEditorStore } from '../../store';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
- export const useTransformCommands = () => {
16
+ const getTransformCommands = () => function useTransformCommands() {
17
17
  const {
18
18
  replaceBlocks,
19
19
  multiSelect
@@ -111,7 +111,7 @@ export const useTransformCommands = () => {
111
111
  commands
112
112
  };
113
113
  };
114
- const useQuickActionsCommands = () => {
114
+ const getQuickActionsCommands = () => function useQuickActionsCommands() {
115
115
  const {
116
116
  clientIds,
117
117
  isUngroupable,
@@ -251,11 +251,11 @@ const useQuickActionsCommands = () => {
251
251
  export const useBlockCommands = () => {
252
252
  useCommandLoader({
253
253
  name: 'core/block-editor/blockTransforms',
254
- hook: useTransformCommands
254
+ hook: getTransformCommands()
255
255
  });
256
256
  useCommandLoader({
257
257
  name: 'core/block-editor/blockQuickActions',
258
- hook: useQuickActionsCommands,
258
+ hook: getQuickActionsCommands(),
259
259
  context: 'block-selection-edit'
260
260
  });
261
261
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","hasBlockSupport","store","blocksStore","switchToBlockType","isTemplatePart","useSelect","useDispatch","useCommandLoader","copy","trash","remove","plus","add","group","ungroup","BlockIcon","blockEditorStore","jsx","_jsx","useTransformCommands","replaceBlocks","multiSelect","blocks","clientIds","canRemove","possibleBlockTransformations","invalidSelection","select","getBlockRootClientId","getBlockTransformItems","getSelectedBlockClientIds","getBlocksByClientId","canRemoveBlocks","selectedBlockClientIds","selectedBlocks","filter","block","length","rootClientId","isLoading","commands","isTemplate","selectForMultipleBlocks","insertedBlocks","clientId","onBlockTransform","name","newBlocks","hasPossibleBlockTransformations","map","transformation","title","icon","replace","label","callback","close","useQuickActionsCommands","isUngroupable","isGroupable","_isUngroupable","_isGroupable","canInsertBlockType","getDefaultBlockName","getGroupingBlockName","removeBlocks","duplicateBlocks","insertAfterBlock","insertBeforeBlock","onGroup","groupingBlockName","onUngroup","innerBlocks","canInsertDefaultBlock","canDuplicate","every","push","Array","isArray","command","useBlockCommands","hook","context"],"sources":["@wordpress/block-editor/src/components/use-block-commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\thasBlockSupport,\n\tstore as blocksStore,\n\tswitchToBlockType,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCommandLoader } from '@wordpress/commands';\nimport {\n\tcopy,\n\ttrash as remove,\n\tplus as add,\n\tgroup,\n\tungroup,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\n\nexport const useTransformCommands = () => {\n\tconst { replaceBlocks, multiSelect } = useDispatch( blockEditorStore );\n\tconst {\n\t\tblocks,\n\t\tclientIds,\n\t\tcanRemove,\n\t\tpossibleBlockTransformations,\n\t\tinvalidSelection,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockTransformItems,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetBlocksByClientId,\n\t\t\tcanRemoveBlocks,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst selectedBlocks = getBlocksByClientId( selectedBlockClientIds );\n\n\t\t// selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId.\n\t\t// These nulls will cause fatal errors down the line.\n\t\t// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.\n\t\t// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536\n\t\tif ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {\n\t\t\treturn {\n\t\t\t\tinvalidSelection: true,\n\t\t\t};\n\t\t}\n\n\t\tconst rootClientId = getBlockRootClientId(\n\t\t\tselectedBlockClientIds[ 0 ]\n\t\t);\n\t\treturn {\n\t\t\tblocks: selectedBlocks,\n\t\t\tclientIds: selectedBlockClientIds,\n\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\tselectedBlocks,\n\t\t\t\trootClientId\n\t\t\t),\n\t\t\tcanRemove: canRemoveBlocks( selectedBlockClientIds ),\n\t\t\tinvalidSelection: false,\n\t\t};\n\t}, [] );\n\n\tif ( invalidSelection ) {\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands: [],\n\t\t};\n\t}\n\tconst isTemplate = blocks.length === 1 && isTemplatePart( blocks[ 0 ] );\n\n\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\tmultiSelect(\n\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t);\n\t\t}\n\t}\n\n\t// Simple block tranformation based on the `Block Transforms` API.\n\tfunction onBlockTransform( name ) {\n\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\treplaceBlocks( clientIds, newBlocks );\n\t\tselectForMultipleBlocks( newBlocks );\n\t}\n\n\t/**\n\t * The `isTemplate` check is a stopgap solution here.\n\t * Ideally, the Transforms API should handle this\n\t * by allowing to exclude blocks from wildcard transformations.\n\t */\n\tconst hasPossibleBlockTransformations =\n\t\t!! possibleBlockTransformations.length && canRemove && ! isTemplate;\n\n\tif (\n\t\t! clientIds ||\n\t\tclientIds.length < 1 ||\n\t\t! hasPossibleBlockTransformations\n\t) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = possibleBlockTransformations.map( ( transformation ) => {\n\t\tconst { name, title, icon } = transformation;\n\t\treturn {\n\t\t\tname: 'core/block-editor/transform-to-' + name.replace( '/', '-' ),\n\t\t\t/* translators: %s: Block or block variation name. */\n\t\t\tlabel: sprintf( __( 'Transform to %s' ), title ),\n\t\t\ticon: <BlockIcon icon={ icon } />,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tonBlockTransform( name );\n\t\t\t\tclose();\n\t\t\t},\n\t\t};\n\t} );\n\n\treturn { isLoading: false, commands };\n};\n\nconst useQuickActionsCommands = () => {\n\tconst { clientIds, isUngroupable, isGroupable } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisUngroupable: _isUngroupable,\n\t\t\tisGroupable: _isGroupable,\n\t\t} = select( blockEditorStore );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\treturn {\n\t\t\tclientIds: selectedBlockClientIds,\n\t\t\tisUngroupable: _isUngroupable(),\n\t\t\tisGroupable: _isGroupable(),\n\t\t};\n\t}, [] );\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetBlockRootClientId,\n\t\tgetBlocksByClientId,\n\t\tcanRemoveBlocks,\n\t} = useSelect( blockEditorStore );\n\tconst { getDefaultBlockName, getGroupingBlockName } =\n\t\tuseSelect( blocksStore );\n\n\tconst blocks = getBlocksByClientId( clientIds );\n\n\tconst {\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\tduplicateBlocks,\n\t\tinsertAfterBlock,\n\t\tinsertBeforeBlock,\n\t} = useDispatch( blockEditorStore );\n\n\tconst onGroup = () => {\n\t\tif ( ! blocks.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst groupingBlockName = getGroupingBlockName();\n\n\t\t// Activate the `transform` on `core/group` which does the conversion.\n\t\tconst newBlocks = switchToBlockType( blocks, groupingBlockName );\n\n\t\tif ( ! newBlocks ) {\n\t\t\treturn;\n\t\t}\n\t\treplaceBlocks( clientIds, newBlocks );\n\t};\n\tconst onUngroup = () => {\n\t\tif ( ! blocks.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst innerBlocks = blocks[ 0 ].innerBlocks;\n\n\t\tif ( ! innerBlocks.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\treplaceBlocks( clientIds, innerBlocks );\n\t};\n\n\tif ( ! clientIds || clientIds.length < 1 ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\tconst canInsertDefaultBlock = canInsertBlockType(\n\t\tgetDefaultBlockName(),\n\t\trootClientId\n\t);\n\tconst canDuplicate = blocks.every( ( block ) => {\n\t\treturn (\n\t\t\t!! block &&\n\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\tcanInsertBlockType( block.name, rootClientId )\n\t\t);\n\t} );\n\tconst canRemove = canRemoveBlocks( clientIds );\n\n\tconst commands = [];\n\n\tif ( canDuplicate ) {\n\t\tcommands.push( {\n\t\t\tname: 'duplicate',\n\t\t\tlabel: __( 'Duplicate' ),\n\t\t\tcallback: () => duplicateBlocks( clientIds, true ),\n\t\t\ticon: copy,\n\t\t} );\n\t}\n\n\tif ( canInsertDefaultBlock ) {\n\t\tcommands.push(\n\t\t\t{\n\t\t\t\tname: 'add-before',\n\t\t\t\tlabel: __( 'Add before' ),\n\t\t\t\tcallback: () => {\n\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t? clientIds[ 0 ]\n\t\t\t\t\t\t: clientId;\n\t\t\t\t\tinsertBeforeBlock( clientId );\n\t\t\t\t},\n\t\t\t\ticon: add,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'add-after',\n\t\t\t\tlabel: __( 'Add after' ),\n\t\t\t\tcallback: () => {\n\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t? clientIds[ clientIds.length - 1 ]\n\t\t\t\t\t\t: clientId;\n\t\t\t\t\tinsertAfterBlock( clientId );\n\t\t\t\t},\n\t\t\t\ticon: add,\n\t\t\t}\n\t\t);\n\t}\n\n\tif ( isGroupable ) {\n\t\tcommands.push( {\n\t\t\tname: 'Group',\n\t\t\tlabel: __( 'Group' ),\n\t\t\tcallback: onGroup,\n\t\t\ticon: group,\n\t\t} );\n\t}\n\n\tif ( isUngroupable ) {\n\t\tcommands.push( {\n\t\t\tname: 'ungroup',\n\t\t\tlabel: __( 'Ungroup' ),\n\t\t\tcallback: onUngroup,\n\t\t\ticon: ungroup,\n\t\t} );\n\t}\n\n\tif ( canRemove ) {\n\t\tcommands.push( {\n\t\t\tname: 'remove',\n\t\t\tlabel: __( 'Delete' ),\n\t\t\tcallback: () => removeBlocks( clientIds, true ),\n\t\t\ticon: remove,\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands: commands.map( ( command ) => ( {\n\t\t\t...command,\n\t\t\tname: 'core/block-editor/action-' + command.name,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tcommand.callback();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} ) ),\n\t};\n};\n\nexport const useBlockCommands = () => {\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockTransforms',\n\t\thook: useTransformCommands,\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockQuickActions',\n\t\thook: useQuickActionsCommands,\n\t\tcontext: 'block-selection-edit',\n\t} );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,iBAAiB,EACjBC,cAAc,QACR,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SACCC,IAAI,EACJC,KAAK,IAAIC,MAAM,EACfC,IAAI,IAAIC,GAAG,EACXC,KAAK,EACLC,OAAO,QACD,kBAAkB;;AAEzB;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,SAASd,KAAK,IAAIe,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExD,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACzC,MAAM;IAAEC,aAAa;IAAEC;EAAY,CAAC,GAAGf,WAAW,CAAEU,gBAAiB,CAAC;EACtE,MAAM;IACLM,M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AI8B,OAAO,KAAQ;MACxC,GAAGA,OAAO;MACVjC,IAAI,EAAE,2BAA2B,GAAGiC,OAAO,CAACjC,IAAI;MAChDS,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1BuB,OAAO,CAACxB,QAAQ,CAAC,CAAC;QAClBC,KAAK,CAAC,CAAC;MACR;IACD,CAAC,CAAG;EACL,CAAC;AACF,CAAC;AAED,OAAO,MAAMwB,gBAAgB,GAAGA,CAAA,KAAM;EACrCzE,gBAAgB,CAAE;IACjBuC,IAAI,EAAE,mCAAmC;IACzCmC,IAAI,EAAE9D;EACP,CAAE,CAAC;EACHZ,gBAAgB,CAAE;IACjBuC,IAAI,EAAE,qCAAqC;IAC3CmC,IAAI,EAAExB,uBAAuB;IAC7ByB,OAAO,EAAE;EACV,CAAE,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","hasBlockSupport","store","blocksStore","switchToBlockType","isTemplatePart","useSelect","useDispatch","useCommandLoader","copy","trash","remove","plus","add","group","ungroup","BlockIcon","blockEditorStore","jsx","_jsx","getTransformCommands","useTransformCommands","replaceBlocks","multiSelect","blocks","clientIds","canRemove","possibleBlockTransformations","invalidSelection","select","getBlockRootClientId","getBlockTransformItems","getSelectedBlockClientIds","getBlocksByClientId","canRemoveBlocks","selectedBlockClientIds","selectedBlocks","filter","block","length","rootClientId","isLoading","commands","isTemplate","selectForMultipleBlocks","insertedBlocks","clientId","onBlockTransform","name","newBlocks","hasPossibleBlockTransformations","map","transformation","title","icon","replace","label","callback","close","getQuickActionsCommands","useQuickActionsCommands","isUngroupable","isGroupable","_isUngroupable","_isGroupable","canInsertBlockType","getDefaultBlockName","getGroupingBlockName","removeBlocks","duplicateBlocks","insertAfterBlock","insertBeforeBlock","onGroup","groupingBlockName","onUngroup","innerBlocks","canInsertDefaultBlock","canDuplicate","every","push","Array","isArray","command","useBlockCommands","hook","context"],"sources":["@wordpress/block-editor/src/components/use-block-commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\thasBlockSupport,\n\tstore as blocksStore,\n\tswitchToBlockType,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCommandLoader } from '@wordpress/commands';\nimport {\n\tcopy,\n\ttrash as remove,\n\tplus as add,\n\tgroup,\n\tungroup,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\n\nconst getTransformCommands = () =>\n\tfunction useTransformCommands() {\n\t\tconst { replaceBlocks, multiSelect } = useDispatch( blockEditorStore );\n\t\tconst {\n\t\t\tblocks,\n\t\t\tclientIds,\n\t\t\tcanRemove,\n\t\t\tpossibleBlockTransformations,\n\t\t\tinvalidSelection,\n\t\t} = useSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockTransformItems,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\t\tconst selectedBlocks = getBlocksByClientId(\n\t\t\t\tselectedBlockClientIds\n\t\t\t);\n\n\t\t\t// selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId.\n\t\t\t// These nulls will cause fatal errors down the line.\n\t\t\t// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.\n\t\t\t// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536\n\t\t\tif ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {\n\t\t\t\treturn {\n\t\t\t\t\tinvalidSelection: true,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst rootClientId = getBlockRootClientId(\n\t\t\t\tselectedBlockClientIds[ 0 ]\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tblocks: selectedBlocks,\n\t\t\t\tclientIds: selectedBlockClientIds,\n\t\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\t\tselectedBlocks,\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tcanRemove: canRemoveBlocks( selectedBlockClientIds ),\n\t\t\t\tinvalidSelection: false,\n\t\t\t};\n\t\t}, [] );\n\n\t\tif ( invalidSelection ) {\n\t\t\treturn {\n\t\t\t\tisLoading: false,\n\t\t\t\tcommands: [],\n\t\t\t};\n\t\t}\n\t\tconst isTemplate = blocks.length === 1 && isTemplatePart( blocks[ 0 ] );\n\n\t\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\t\tmultiSelect(\n\t\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Simple block tranformation based on the `Block Transforms` API.\n\t\tfunction onBlockTransform( name ) {\n\t\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t\tselectForMultipleBlocks( newBlocks );\n\t\t}\n\n\t\t/**\n\t\t * The `isTemplate` check is a stopgap solution here.\n\t\t * Ideally, the Transforms API should handle this\n\t\t * by allowing to exclude blocks from wildcard transformations.\n\t\t */\n\t\tconst hasPossibleBlockTransformations =\n\t\t\t!! possibleBlockTransformations.length && canRemove && ! isTemplate;\n\n\t\tif (\n\t\t\t! clientIds ||\n\t\t\tclientIds.length < 1 ||\n\t\t\t! hasPossibleBlockTransformations\n\t\t) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst commands = possibleBlockTransformations.map(\n\t\t\t( transformation ) => {\n\t\t\t\tconst { name, title, icon } = transformation;\n\t\t\t\treturn {\n\t\t\t\t\tname:\n\t\t\t\t\t\t'core/block-editor/transform-to-' +\n\t\t\t\t\t\tname.replace( '/', '-' ),\n\t\t\t\t\t/* translators: %s: Block or block variation name. */\n\t\t\t\t\tlabel: sprintf( __( 'Transform to %s' ), title ),\n\t\t\t\t\ticon: <BlockIcon icon={ icon } />,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tonBlockTransform( name );\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\n\t\treturn { isLoading: false, commands };\n\t};\n\nconst getQuickActionsCommands = () =>\n\tfunction useQuickActionsCommands() {\n\t\tconst { clientIds, isUngroupable, isGroupable } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t\tisUngroupable: _isUngroupable,\n\t\t\t\t\tisGroupable: _isGroupable,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\t\t\treturn {\n\t\t\t\t\tclientIds: selectedBlockClientIds,\n\t\t\t\t\tisUngroupable: _isUngroupable(),\n\t\t\t\t\tisGroupable: _isGroupable(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst {\n\t\t\tcanInsertBlockType,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlocksByClientId,\n\t\t\tcanRemoveBlocks,\n\t\t} = useSelect( blockEditorStore );\n\t\tconst { getDefaultBlockName, getGroupingBlockName } =\n\t\t\tuseSelect( blocksStore );\n\n\t\tconst blocks = getBlocksByClientId( clientIds );\n\n\t\tconst {\n\t\t\tremoveBlocks,\n\t\t\treplaceBlocks,\n\t\t\tduplicateBlocks,\n\t\t\tinsertAfterBlock,\n\t\t\tinsertBeforeBlock,\n\t\t} = useDispatch( blockEditorStore );\n\n\t\tconst onGroup = () => {\n\t\t\tif ( ! blocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst groupingBlockName = getGroupingBlockName();\n\n\t\t\t// Activate the `transform` on `core/group` which does the conversion.\n\t\t\tconst newBlocks = switchToBlockType( blocks, groupingBlockName );\n\n\t\t\tif ( ! newBlocks ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t};\n\t\tconst onUngroup = () => {\n\t\t\tif ( ! blocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst innerBlocks = blocks[ 0 ].innerBlocks;\n\n\t\t\tif ( ! innerBlocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treplaceBlocks( clientIds, innerBlocks );\n\t\t};\n\n\t\tif ( ! clientIds || clientIds.length < 1 ) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\tconst canInsertDefaultBlock = canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t);\n\t\tconst canDuplicate = blocks.every( ( block ) => {\n\t\t\treturn (\n\t\t\t\t!! block &&\n\t\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\t\tcanInsertBlockType( block.name, rootClientId )\n\t\t\t);\n\t\t} );\n\t\tconst canRemove = canRemoveBlocks( clientIds );\n\n\t\tconst commands = [];\n\n\t\tif ( canDuplicate ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'duplicate',\n\t\t\t\tlabel: __( 'Duplicate' ),\n\t\t\t\tcallback: () => duplicateBlocks( clientIds, true ),\n\t\t\t\ticon: copy,\n\t\t\t} );\n\t\t}\n\n\t\tif ( canInsertDefaultBlock ) {\n\t\t\tcommands.push(\n\t\t\t\t{\n\t\t\t\t\tname: 'add-before',\n\t\t\t\t\tlabel: __( 'Add before' ),\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t\t? clientIds[ 0 ]\n\t\t\t\t\t\t\t: clientId;\n\t\t\t\t\t\tinsertBeforeBlock( clientId );\n\t\t\t\t\t},\n\t\t\t\t\ticon: add,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'add-after',\n\t\t\t\t\tlabel: __( 'Add after' ),\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t\t? clientIds[ clientIds.length - 1 ]\n\t\t\t\t\t\t\t: clientId;\n\t\t\t\t\t\tinsertAfterBlock( clientId );\n\t\t\t\t\t},\n\t\t\t\t\ticon: add,\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif ( isGroupable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'Group',\n\t\t\t\tlabel: __( 'Group' ),\n\t\t\t\tcallback: onGroup,\n\t\t\t\ticon: group,\n\t\t\t} );\n\t\t}\n\n\t\tif ( isUngroupable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'ungroup',\n\t\t\t\tlabel: __( 'Ungroup' ),\n\t\t\t\tcallback: onUngroup,\n\t\t\t\ticon: ungroup,\n\t\t\t} );\n\t\t}\n\n\t\tif ( canRemove ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'remove',\n\t\t\t\tlabel: __( 'Delete' ),\n\t\t\t\tcallback: () => removeBlocks( clientIds, true ),\n\t\t\t\ticon: remove,\n\t\t\t} );\n\t\t}\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands: commands.map( ( command ) => ( {\n\t\t\t\t...command,\n\t\t\t\tname: 'core/block-editor/action-' + command.name,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tcommand.callback();\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} ) ),\n\t\t};\n\t};\n\nexport const useBlockCommands = () => {\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockTransforms',\n\t\thook: getTransformCommands(),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockQuickActions',\n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,CAAC,CAAC;IAC/B0B,OAAO,EAAE;EACV,CAAE,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -12,7 +12,7 @@ import { privateApis as componentsPrivateApis } from '@wordpress/components';
12
12
  import { shouldSkipSerialization } from './utils';
13
13
  import { TYPOGRAPHY_SUPPORT_KEY } from './typography';
14
14
  import { unlock } from '../lock-unlock';
15
- export const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
15
+ export const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';
16
16
  const {
17
17
  kebabCase
18
18
  } = unlock(componentsPrivateApis);
@@ -1 +1 @@
1
- {"version":3,"names":["addFilter","hasBlockSupport","TokenList","privateApis","componentsPrivateApis","shouldSkipSerialization","TYPOGRAPHY_SUPPORT_KEY","unlock","FONT_FAMILY_SUPPORT_KEY","kebabCase","addAttributes","settings","attributes","fontFamily","Object","assign","type","addSaveProps","props","blockType","classes","className","add","newClassName","value","undefined","useBlockProps","name","attributeKeys","hasSupport","resetFontFamily","setAttributes"],"sources":["@wordpress/block-editor/src/hooks/font-family.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport TokenList from '@wordpress/token-list';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { shouldSkipSerialization } from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\nimport { unlock } from '../lock-unlock';\n\nexport const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `fontFamily` attribute.\n *\n * @param {Object} settings Original block settings\n * @return {Object} Filtered block settings\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBlockSupport( settings, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify a default value if needed.\n\tif ( ! settings.attributes.fontFamily ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tfontFamily: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject font family.\n *\n * @param {Object} props Additional props applied to save element\n * @param {Object} blockType Block type\n * @param {Object} attributes Block attributes\n * @return {Object} Filtered props applied to save element\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif ( ! hasBlockSupport( blockType, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn props;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'fontFamily'\n\t\t)\n\t) {\n\t\treturn props;\n\t}\n\n\tif ( ! attributes?.fontFamily ) {\n\t\treturn props;\n\t}\n\n\t// Use TokenList to dedupe classes.\n\tconst classes = new TokenList( props.className );\n\tclasses.add( `has-${ kebabCase( attributes?.fontFamily ) }-font-family` );\n\tconst newClassName = classes.value;\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction useBlockProps( { name, fontFamily } ) {\n\treturn addSaveProps( {}, name, { fontFamily } );\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'fontFamily' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, FONT_FAMILY_SUPPORT_KEY );\n\t},\n};\n\n/**\n * Resets the font family block support attribute. This can be used when\n * disabling the font family support controls for a block via a progressive\n * discovery panel.\n *\n * @param {Object} props Block props.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetFontFamily( { setAttributes } ) {\n\tsetAttributes( { fontFamily: undefined } );\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/fontFamily/addAttribute',\n\taddAttributes\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ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EACzE,MAAMU,YAAY,GAAGH,OAAO,CAACI,KAAK;EAClCN,KAAK,CAACG,SAAS,GAAGE,YAAY,GAAGA,YAAY,GAAGE,SAAS;EAEzD,OAAOP,KAAK;AACb;AAEA,SAASQ,aAAaA,CAAE;EAAEC,IAAI;EAAEd;AAAW,CAAC,EAAG;EAC9C,OAAOI,YAAY,CAAE,CAAC,CAAC,EAAEU,IAAI,EAAE;IAAEd;EAAW,CAAE,CAAC;AAChD;AAEA,eAAe;EACda,aAAa;EACbT,YAAY;EACZW,aAAa,EAAE,CAAE,YAAY,CAAE;EAC/BC,UAAUA,CAAEF,IAAI,EAAG;IAClB,OAAO1B,eAAe,CAAE0B,IAAI,EAAEnB,uBAAwB,CAAC;EACxD;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASsB,eAAeA,CAAE;EAAEC;AAAc,CAAC,EAAG;EACpDA,aAAa,CAAE;IAAElB,UAAU,EAAEY;EAAU,CAAE,CAAC;AAC3C;AAEAzB,SAAS,CACR,0BAA0B,EAC1B,8BAA8B,EAC9BU,aACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["addFilter","hasBlockSupport","TokenList","privateApis","componentsPrivateApis","shouldSkipSerialization","TYPOGRAPHY_SUPPORT_KEY","unlock","FONT_FAMILY_SUPPORT_KEY","kebabCase","addAttributes","settings","attributes","fontFamily","Object","assign","type","addSaveProps","props","blockType","classes","className","add","newClassName","value","undefined","useBlockProps","name","attributeKeys","hasSupport","resetFontFamily","setAttributes"],"sources":["@wordpress/block-editor/src/hooks/font-family.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport TokenList from '@wordpress/token-list';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { shouldSkipSerialization } from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\nimport { unlock } from '../lock-unlock';\n\nexport const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `fontFamily` attribute.\n *\n * @param {Object} settings Original block settings\n * @return {Object} Filtered block settings\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBlockSupport( settings, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify a default value if needed.\n\tif ( ! settings.attributes.fontFamily ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tfontFamily: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject font family.\n *\n * @param {Object} props Additional props applied to save element\n * @param {Object} blockType Block type\n * @param {Object} attributes Block attributes\n * @return {Object} Filtered props applied to save element\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif ( ! hasBlockSupport( blockType, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn props;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'fontFamily'\n\t\t)\n\t) {\n\t\treturn props;\n\t}\n\n\tif ( ! attributes?.fontFamily ) {\n\t\treturn props;\n\t}\n\n\t// Use TokenList to dedupe classes.\n\tconst classes = new TokenList( props.className );\n\tclasses.add( `has-${ kebabCase( attributes?.fontFamily ) }-font-family` );\n\tconst newClassName = classes.value;\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction useBlockProps( { name, fontFamily } ) {\n\treturn addSaveProps( {}, name, { fontFamily } );\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'fontFamily' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, FONT_FAMILY_SUPPORT_KEY );\n\t},\n};\n\n/**\n * Resets the font family block support attribute. This can be used when\n * disabling the font family support controls for a block via a progressive\n * discovery panel.\n *\n * @param {Object} props Block props.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetFontFamily( { setAttributes } ) {\n\tsetAttributes( { fontFamily: undefined } );\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/fontFamily/addAttribute',\n\taddAttributes\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;AACnD,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,SAAS;AACjD,SAASC,sBAAsB,QAAQ,cAAc;AACrD,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,OAAO,MAAMC,uBAAuB,GAAG,uBAAuB;AAC9D,MAAM;EAAEC;AAAU,CAAC,GAAGF,MAAM,CAAEH,qBAAsB,CAAC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASM,aAAaA,CAAEC,QAAQ,EAAG;EAClC,IAAK,CAAEV,eAAe,CAAEU,QAAQ,EAAEH,uBAAwB,CAAC,EAAG;IAC7D,OAAOG,QAAQ;EAChB;;EAEA;EACA,IAAK,CAAEA,QAAQ,CAACC,UAAU,CAACC,UAAU,EAAG;IACvCC,MAAM,CAACC,MAAM,CAAEJ,QAAQ,CAACC,UAAU,EAAE;MACnCC,UAAU,EAAE;QACXG,IAAI,EAAE;MACP;IACD,CAAE,CAAC;EACJ;EAEA,OAAOL,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASM,YAAYA,CAAEC,KAAK,EAAEC,SAAS,EAAEP,UAAU,EAAG;EACrD,IAAK,CAAEX,eAAe,CAAEkB,SAAS,EAAEX,uBAAwB,CAAC,EAAG;IAC9D,OAAOU,KAAK;EACb;EAEA,IACCb,uBAAuB,CACtBc,SAAS,EACTb,sBAAsB,EACtB,YACD,CAAC,EACA;IACD,OAAOY,KAAK;EACb;EAEA,IAAK,CAAEN,UAAU,EAAEC,UAAU,EAAG;IAC/B,OAAOK,KAAK;EACb;;EAEA;EACA,MAAME,OAAO,GAAG,IAAIlB,SAAS,CAAEgB,KAAK,CAACG,SAAU,CAAC;EAChDD,OAAO,CAACE,GAAG,CAAE,OAAQb,SAAS,CAAEG,UAAU,EAAEC,UAAW,CAAC,cAAgB,CAAC;EACzE,MAAMU,YAAY,GAAGH,OAAO,CAACI,KAAK;EAClCN,KAAK,CAACG,SAAS,GAAGE,YAAY,GAAGA,YAAY,GAAGE,SAAS;EAEzD,OAAOP,KAAK;AACb;AAEA,SAASQ,aAAaA,CAAE;EAAEC,IAAI;EAAEd;AAAW,CAAC,EAAG;EAC9C,OAAOI,YAAY,CAAE,CAAC,CAAC,EAAEU,IAAI,EAAE;IAAEd;EAAW,CAAE,CAAC;AAChD;AAEA,eAAe;EACda,aAAa;EACbT,YAAY;EACZW,aAAa,EAAE,CAAE,YAAY,CAAE;EAC/BC,UAAUA,CAAEF,IAAI,EAAG;IAClB,OAAO1B,eAAe,CAAE0B,IAAI,EAAEnB,uBAAwB,CAAC;EACxD;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASsB,eAAeA,CAAE;EAAEC;AAAc,CAAC,EAAG;EACpDA,aAAa,CAAE;IAAElB,UAAU,EAAEY;EAAU,CAAE,CAAC;AAC3C;AAEAzB,SAAS,CACR,0BAA0B,EAC1B,8BAA8B,EAC9BU,aACD,CAAC","ignoreList":[]}
@@ -8,17 +8,17 @@ const ALIGN_WIDE_SUPPORT_KEY = 'alignWide';
8
8
  const BORDER_SUPPORT_KEY = '__experimentalBorder';
9
9
  const COLOR_SUPPORT_KEY = 'color';
10
10
  const CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';
11
- const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
11
+ const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';
12
12
  const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
13
13
  const LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';
14
14
  /**
15
15
  * Key within block settings' support array indicating support for font style.
16
16
  */
17
- const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
17
+ const FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';
18
18
  /**
19
19
  * Key within block settings' support array indicating support for font weight.
20
20
  */
21
- const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
21
+ const FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';
22
22
  /**
23
23
  * Key within block settings' supports array indicating support for text
24
24
  * align e.g. settings found in `block.json`.
@@ -33,7 +33,7 @@ const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
33
33
  * Key within block settings' supports array indicating support for text
34
34
  * decorations e.g. settings found in `block.json`.
35
35
  */
36
- const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
36
+ const TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';
37
37
  /**
38
38
  * Key within block settings' supports array indicating support for writing mode
39
39
  * e.g. settings found in `block.json`.
@@ -43,13 +43,13 @@ const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
43
43
  * Key within block settings' supports array indicating support for text
44
44
  * transforms e.g. settings found in `block.json`.
45
45
  */
46
- const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
46
+ const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';
47
47
 
48
48
  /**
49
49
  * Key within block settings' supports array indicating support for letter-spacing
50
50
  * e.g. settings found in `block.json`.
51
51
  */
52
- const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
52
+ const LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';
53
53
  const LAYOUT_SUPPORT_KEY = 'layout';
54
54
  const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_ALIGN_SUPPORT_KEY, TEXT_COLUMNS_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, WRITING_MODE_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY];
55
55
  const EFFECTS_SUPPORT_KEYS = ['shadow'];
@@ -1 +1 @@
1
- {"version":3,"names":["getBlockSupport","hasBlockSupport","Platform","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","getAlignSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextAlignSupport","getTextAlignSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"sources":["@wordpress/block-editor/src/hooks/supports.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,QAAQ,QAAQ,oBAAoB;AAE7C,MAAMC,iBAAiB,GAAG,OAAO;AACjC,MAAMC,sBAAsB,GAAG,WAAW;AAC1C,MAAMC,kBAAkB,GAAG,sBAAsB;AACjD,MAAMC,iBAAiB,GAAG,OAAO;AACjC,MAAMC,6BAA6B,GAAG,iBAAiB;AACvD,MAAMC,uBAAuB,GAAG,qCAAqC;AACrE,MAAMC,qBAAqB,GAAG,qBAAqB;AACnD,MAAMC,uBAAuB,GAAG,uBAAuB;AACvD;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,oCAAoC;AACnE;AACA;AACA;AACA,MAAMC,uBAAuB,GAAG,qCAAqC;AACrE;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,sBAAsB;AACrD;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,wBAAwB;AACzD;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,GAAG,yCAAyC;AAC7E;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,sCAAsC;AACvE;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,wCAAwC;;AAE3E;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,wCAAwC;AAC3E,MAAMC,kBAAkB,GAAG,QAAQ;AACnC,MAAMC,uBAAuB,GAAG,CAC/BV,uBAAuB,EACvBD,qBAAqB,EACrBE,sBAAsB,EACtBC,u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M+C,oBAAoB,GAAK7B,UAAU,IAC/CxB,eAAe,CAAEwB,UAAU,EAAEjB,uBAAwB,CAAC;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM+C,oBAAoB,GAAK9B,UAAU,IAC/CzB,eAAe,CAAEyB,UAAU,EAAEjB,uBAAwB,CAAC;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMgD,kBAAkB,GAAK/B,UAAU,IAC7CxB,eAAe,CAAEwB,UAAU,EAAEhB,qBAAsB,CAAC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMgD,kBAAkB,GAAKhC,UAAU,IAC7CzB,eAAe,CAAEyB,UAAU,EAAEhB,qBAAsB,CAAC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMiD,gBAAgB,GAAKjC,UAAU,IAC3CxB,eAAe,CAAEwB,UAAU,EAAEN,kBAAmB,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMwC,gBAAgB,GAAKlC,UAAU,IAC3CzB,eAAe,CAAEyB,UAAU,EAAEN,kBAAmB,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMyC,eAAe,GAAKnC,UAAU,IAC1CF,gBAAgB,CAACsC,IAAI,CAAIC,GAAG,IAAM7D,eAAe,CAAEwB,UAAU,EAAEqC,GAAI,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getBlockSupport","hasBlockSupport","Platform","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","getAlignSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextAlignSupport","getTextAlignSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"sources":["@wordpress/block-editor/src/hooks/supports.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,QAAQ,QAAQ,oBAAoB;AAE7C,MAAMC,iBAAiB,GAAG,OAAO;AACjC,MAAMC,sBAAsB,GAAG,WAAW;AAC1C,MAAMC,kBAAkB,GAAG,sBAAsB;AACjD,MAAMC,iBAAiB,GAAG,OAAO;AACjC,MAAMC,6BAA6B,GAAG,iBAAiB;AACvD,MAAMC,uBAAuB,GAAG,uBAAuB;AACvD,MAAMC,qBAAqB,GAAG,qBAAqB;AACnD,MAAMC,uBAAuB,GAAG,uBAAuB;AACvD;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,sBAAsB;AACrD;AACA;AACA;AACA,MAAMC,uBAAuB,GAAG,u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GAAKnC,UAAU,IAC1CF,gBAAgB,CAACsC,IAAI,CAAIC,GAAG,IAAM7D,eAAe,CAAEwB,UAAU,EAAEqC,GAAI,CAAE,CAAC","ignoreList":[]}
@@ -20,12 +20,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  function omit(object, keys) {
21
21
  return Object.fromEntries(Object.entries(object).filter(([key]) => !keys.includes(key)));
22
22
  }
23
- const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
24
- const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
25
- const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
23
+ const LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';
24
+ const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';
25
+ const TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';
26
26
  const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
27
- const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
28
- const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
27
+ const FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';
28
+ const FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';
29
29
  const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
30
30
  export const TYPOGRAPHY_SUPPORT_KEY = 'typography';
31
31
  export const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_ALIGN_SUPPORT_KEY, TEXT_COLUMNS_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, WRITING_MODE_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY];
@@ -1 +1 @@
1
- {"version":3,"names":["getBlockSupport","hasBlockSupport","useMemo","useCallback","useSelect","InspectorControls","default","StylesTypographyPanel","useHasTypographyPanel","LINE_HEIGHT_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","cleanEmptyObject","store","blockEditorStore","jsx","_jsx","omit","object","keys","Object","fromEntries","entries","filter","key","includes","LETTER_SPACING_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","existingStyle","group","TypographyPanel","clientId","name","setAttributes","settings","selector","select","getBlockAttributes","isEnabled","value","onChange","newStyle","defaultControls","as","panelId","hasTypographySupport","blockName","some"],"sources":["@wordpress/block-editor/src/hooks/typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { TEXT_ALIGN_SUPPORT_KEY } from './text-align';\nimport { cleanEmptyObject } from './utils';\nimport { store as blockEditorStore } from '../store';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst fontSizeSlug = fontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( { clientId, name, setAttributes, settings } ) {\n\tfunction selector( select ) {\n\t\tconst { style, fontFamily, fontSize } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, fontFamily, fontSize };\n\t}\n\tconst { style, fontFamily, fontSize } = useSelect( selector, [ clientId ] );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\tconst value = useMemo(\n\t\t() => attributesToStyle( { style, fontFamily, fontSize } ),\n\t\t[ style, fontSize, fontFamily ]\n\t);\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ TypographyInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,SACCC,OAAO,IAAIC,qBAAqB,EAChCC,qBAAqB,QACf,8CAA8C;AAErD,SAASC,uBAAuB,QAAQ,eAAe;AACvD,SAASC,uBAAuB,QAAQ,eAAe;AACvD,SAASC,qBAAqB,QAAQ,aAAa;AACnD,SAASC,sBAAsB,QAAQ,cAAc;AACrD,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErD,SAASC,IAAIA,CAAEC,MAAM,EAAEC,IAAI,EAAG;EAC7B,OAAOC,MAAM,CAACC,WAAW,CACxBD,MAAM,CAACE,OAAO,CAAEJ,MAAO,CAAC,CAACK,MAAM,CAAE,CAAE,CAAEC,GAAG,CAAE,KAAM,CAAEL,IAAI,CAACM,QAAQ,CAAED,GAAI,CAAE,CACxE,CAAC;AACF;AAEA,MAAME,0BAA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,IAAI,CAAC,CAAC;IAChE,OAAO;MAAEtB,KAAK;MAAEM,UAAU;MAAEF;IAAS,CAAC;EACvC;EACA,MAAM;IAAEJ,KAAK;IAAEM,UAAU;IAAEF;EAAS,CAAC,GAAGrC,SAAS,CAAE2D,QAAQ,EAAE,CAAEJ,QAAQ,CAAG,CAAC;EAC3E,MAAMO,SAAS,GAAG1D,qBAAqB,CAAEsD,QAAS,CAAC;EACnD,MAAMK,KAAK,GAAGjE,OAAO,CACpB,MAAMgD,iBAAiB,CAAE;IAAEb,KAAK;IAAEM,UAAU;IAAEF;EAAS,CAAE,CAAC,EAC1D,CAAEJ,KAAK,EAAEI,QAAQ,EAAEE,UAAU,CAC9B,CAAC;EAED,MAAMyB,QAAQ,GAAKC,QAAQ,IAAM;IAChCR,aAAa,CAAEzB,iBAAiB,CAAEiC,QAAS,CAAE,CAAC;EAC/C,CAAC;EAED,IAAK,CAAEH,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMI,eAAe,GAAGtE,eAAe,CAAE4D,IAAI,EAAE,CAC9C1B,sBAAsB,EACtB,+BAA+B,CAC9B,CAAC;EAEH,oBACCjB,IAAA,CAACV,qBAAqB;IACrBgE,EAAE,EAAGnB,0BAA4B;IACjCoB,OAAO,EAAGb,QAAU;IACpBG,QAAQ,EAAGA,QAAU;IACrBK,KAAK,EAAGA,KAAO;IACfC,QAAQ,EAAGA,QAAU;IACrBE,eAAe,EAAGA;EAAiB,CACnC,CAAC;AAEJ;AAEA,OAAO,MAAMG,oBAAoB,GAAKC,SAAS,IAAM;EACpD,OAAOvC,uBAAuB,CAACwC,IAAI,CAAIlD,GAAG,IACzCxB,eAAe,CAAEyE,SAAS,EAAEjD,GAAI,CACjC,CAAC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getBlockSupport","hasBlockSupport","useMemo","useCallback","useSelect","InspectorControls","default","StylesTypographyPanel","useHasTypographyPanel","LINE_HEIGHT_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","cleanEmptyObject","store","blockEditorStore","jsx","_jsx","omit","object","keys","Object","fromEntries","entries","filter","key","includes","LETTER_SPACING_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","existingStyle","group","TypographyPanel","clientId","name","setAttributes","settings","selector","select","getBlockAttributes","isEnabled","value","onChange","newStyle","defaultControls","as","panelId","hasTypographySupport","blockName","some"],"sources":["@wordpress/block-editor/src/hooks/typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { TEXT_ALIGN_SUPPORT_KEY } from './text-align';\nimport { cleanEmptyObject } from './utils';\nimport { store as blockEditorStore } from '../store';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst fontSizeSlug = fontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( { clientId, name, setAttributes, settings } ) {\n\tfunction selector( select ) {\n\t\tconst { style, fontFamily, fontSize } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, fontFamily, fontSize };\n\t}\n\tconst { style, fontFamily, fontSize } = useSelect( selector, [ clientId ] );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\tconst value = useMemo(\n\t\t() => attributesToStyle( { style, fontFamily, fontSize } ),\n\t\t[ style, fontSize, fontFamily ]\n\t);\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ TypographyInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,SACCC,OAAO,IAAIC,qBAAqB,EAChCC,qBAAqB,QACf,8CAA8C;AAErD,SAASC,uBAAuB,QAAQ,eAAe;AACvD,SAASC,uBAAuB,QAAQ,eAAe;AACvD,SAASC,qBAAqB,QAAQ,aAAa;AACnD,SAASC,sBAAsB,QAAQ,cAAc;AACrD,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErD,SAASC,IAAIA,CAAEC,MAAM,EAAEC,IAAI,EAAG;EAC7B,OAAOC,MAAM,CAACC,WAAW,CACxBD,MAAM,CAACE,OAAO,CAAEJ,MAAO,CAAC,CAACK,MAAM,CAAE,CAAE,CAAEC,GAAG,CAAE,KAAM,CAAEL,IAAI,CAACM,QAAQ,CAAED,GAAI,CAAE,CACxE,CAAC;AACF;AAEA,MAAME,0BAA0B,GAAG,0BAA0B;AAC7D,MAAMC,0BAA0B,GAAG,0BAA0B;AAC7D,MAAMC,2BAA2B,GAAG,2BAA2B;AAC/D,MAAMC,wBAAwB,GAAG,wBAAwB;AACzD,MAAMC,sBAAsB,GAAG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CAAE2D,QAAQ,EAAE,CAAEJ,QAAQ,CAAG,CAAC;EAC3E,MAAMO,SAAS,GAAG1D,qBAAqB,CAAEsD,QAAS,CAAC;EACnD,MAAMK,KAAK,GAAGjE,OAAO,CACpB,MAAMgD,iBAAiB,CAAE;IAAEb,KAAK;IAAEM,UAAU;IAAEF;EAAS,CAAE,CAAC,EAC1D,CAAEJ,KAAK,EAAEI,QAAQ,EAAEE,UAAU,CAC9B,CAAC;EAED,MAAMyB,QAAQ,GAAKC,QAAQ,IAAM;IAChCR,aAAa,CAAEzB,iBAAiB,CAAEiC,QAAS,CAAE,CAAC;EAC/C,CAAC;EAED,IAAK,CAAEH,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMI,eAAe,GAAGtE,eAAe,CAAE4D,IAAI,EAAE,CAC9C1B,sBAAsB,EACtB,+BAA+B,CAC9B,CAAC;EAEH,oBACCjB,IAAA,CAACV,qBAAqB;IACrBgE,EAAE,EAAGnB,0BAA4B;IACjCoB,OAAO,EAAGb,QAAU;IACpBG,QAAQ,EAAGA,QAAU;IACrBK,KAAK,EAAGA,KAAO;IACfC,QAAQ,EAAGA,QAAU;IACrBE,eAAe,EAAGA;EAAiB,CACnC,CAAC;AAEJ;AAEA,OAAO,MAAMG,oBAAoB,GAAKC,SAAS,IAAM;EACpD,OAAOvC,uBAAuB,CAACwC,IAAI,CAAIlD,GAAG,IACzCxB,eAAe,CAAEyE,SAAS,EAAEjD,GAAI,CACjC,CAAC;AACF,CAAC","ignoreList":[]}
@@ -324,11 +324,11 @@ export function createBlockEditFilter(features) {
324
324
  }
325
325
  function BlockProps({
326
326
  index,
327
- useBlockProps,
327
+ useBlockProps: hook,
328
328
  setAllWrapperProps,
329
329
  ...props
330
330
  }) {
331
- const wrapperProps = useBlockProps(props);
331
+ const wrapperProps = hook(props);
332
332
  const setWrapperProps = next => setAllWrapperProps(prev => {
333
333
  const nextAll = [...prev];
334
334
  nextAll[index] = next;