@wordpress/block-editor 12.8.0 → 12.9.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 (173) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +30 -12
  3. package/build/components/block-controls/slot.js +1 -1
  4. package/build/components/block-controls/slot.js.map +1 -1
  5. package/build/components/block-controls/slot.native.js +1 -1
  6. package/build/components/block-controls/slot.native.js.map +1 -1
  7. package/build/components/block-controls/use-has-block-controls.js +1 -1
  8. package/build/components/block-controls/use-has-block-controls.js.map +1 -1
  9. package/build/components/block-list/block-outline.native.js +4 -3
  10. package/build/components/block-list/block-outline.native.js.map +1 -1
  11. package/build/components/block-list/index.js +4 -3
  12. package/build/components/block-list/index.js.map +1 -1
  13. package/build/components/block-list/use-block-props/index.js +27 -1
  14. package/build/components/block-list/use-block-props/index.js.map +1 -1
  15. package/build/components/block-list/use-block-props/use-nav-mode-exit.js +1 -1
  16. package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +1 -1
  17. package/build/components/block-lock/menu-item.js +3 -1
  18. package/build/components/block-lock/menu-item.js.map +1 -1
  19. package/build/components/block-lock/toolbar.js +3 -1
  20. package/build/components/block-lock/toolbar.js.map +1 -1
  21. package/build/components/block-popover/inbetween.js +4 -5
  22. package/build/components/block-popover/inbetween.js.map +1 -1
  23. package/build/components/block-popover/index.js +3 -2
  24. package/build/components/block-popover/index.js.map +1 -1
  25. package/build/components/color-style-selector/index.js +1 -1
  26. package/build/components/color-style-selector/index.js.map +1 -1
  27. package/build/components/iframe/index.js +1 -0
  28. package/build/components/iframe/index.js.map +1 -1
  29. package/build/components/inserter/reusable-blocks-tab.native.js +7 -4
  30. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  31. package/build/components/inserter/search-results.native.js +10 -8
  32. package/build/components/inserter/search-results.native.js.map +1 -1
  33. package/build/components/inspector-controls/fill.js +1 -1
  34. package/build/components/inspector-controls/fill.js.map +1 -1
  35. package/build/components/inspector-controls/fill.native.js +1 -1
  36. package/build/components/inspector-controls/fill.native.js.map +1 -1
  37. package/build/components/inspector-controls/slot.js +1 -1
  38. package/build/components/inspector-controls/slot.js.map +1 -1
  39. package/build/components/inspector-controls/slot.native.js +1 -1
  40. package/build/components/inspector-controls/slot.native.js.map +1 -1
  41. package/build/components/link-control/index.js +1 -7
  42. package/build/components/link-control/index.js.map +1 -1
  43. package/build/components/list-view/block-select-button.js +48 -7
  44. package/build/components/list-view/block-select-button.js.map +1 -1
  45. package/build/components/list-view/drop-indicator.js +3 -3
  46. package/build/components/list-view/drop-indicator.js.map +1 -1
  47. package/build/components/list-view/index.js +14 -8
  48. package/build/components/list-view/index.js.map +1 -1
  49. package/build/components/list-view/use-list-view-images.js +5 -4
  50. package/build/components/list-view/use-list-view-images.js.map +1 -1
  51. package/build/components/preview-options/index.js +3 -1
  52. package/build/components/preview-options/index.js.map +1 -1
  53. package/build/components/provider/index.js +3 -1
  54. package/build/components/provider/index.js.map +1 -1
  55. package/build/components/rich-text/use-remove-browser-shortcuts.js +1 -1
  56. package/build/components/rich-text/use-remove-browser-shortcuts.js.map +1 -1
  57. package/build/components/use-block-commands/index.js +74 -63
  58. package/build/components/use-block-commands/index.js.map +1 -1
  59. package/build/components/warning/index.js +1 -1
  60. package/build/components/warning/index.js.map +1 -1
  61. package/build/hooks/auto-inserting-blocks.js +174 -0
  62. package/build/hooks/auto-inserting-blocks.js.map +1 -0
  63. package/build/hooks/index.js +1 -0
  64. package/build/hooks/index.js.map +1 -1
  65. package/build/store/selectors.js +1 -1
  66. package/build/store/selectors.js.map +1 -1
  67. package/build-module/components/block-controls/slot.js +1 -1
  68. package/build-module/components/block-controls/slot.js.map +1 -1
  69. package/build-module/components/block-controls/slot.native.js +1 -1
  70. package/build-module/components/block-controls/slot.native.js.map +1 -1
  71. package/build-module/components/block-controls/use-has-block-controls.js +1 -1
  72. package/build-module/components/block-controls/use-has-block-controls.js.map +1 -1
  73. package/build-module/components/block-list/block-outline.native.js +4 -3
  74. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  75. package/build-module/components/block-list/index.js +4 -3
  76. package/build-module/components/block-list/index.js.map +1 -1
  77. package/build-module/components/block-list/use-block-props/index.js +27 -1
  78. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  79. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js +1 -1
  80. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +1 -1
  81. package/build-module/components/block-lock/menu-item.js +3 -1
  82. package/build-module/components/block-lock/menu-item.js.map +1 -1
  83. package/build-module/components/block-lock/toolbar.js +3 -1
  84. package/build-module/components/block-lock/toolbar.js.map +1 -1
  85. package/build-module/components/block-popover/inbetween.js +4 -5
  86. package/build-module/components/block-popover/inbetween.js.map +1 -1
  87. package/build-module/components/block-popover/index.js +3 -2
  88. package/build-module/components/block-popover/index.js.map +1 -1
  89. package/build-module/components/color-style-selector/index.js +1 -1
  90. package/build-module/components/color-style-selector/index.js.map +1 -1
  91. package/build-module/components/iframe/index.js +1 -0
  92. package/build-module/components/iframe/index.js.map +1 -1
  93. package/build-module/components/inserter/reusable-blocks-tab.native.js +8 -4
  94. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  95. package/build-module/components/inserter/search-results.native.js +11 -8
  96. package/build-module/components/inserter/search-results.native.js.map +1 -1
  97. package/build-module/components/inspector-controls/fill.js +1 -1
  98. package/build-module/components/inspector-controls/fill.js.map +1 -1
  99. package/build-module/components/inspector-controls/fill.native.js +1 -1
  100. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  101. package/build-module/components/inspector-controls/slot.js +1 -1
  102. package/build-module/components/inspector-controls/slot.js.map +1 -1
  103. package/build-module/components/inspector-controls/slot.native.js +1 -1
  104. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  105. package/build-module/components/link-control/index.js +1 -7
  106. package/build-module/components/link-control/index.js.map +1 -1
  107. package/build-module/components/list-view/block-select-button.js +48 -7
  108. package/build-module/components/list-view/block-select-button.js.map +1 -1
  109. package/build-module/components/list-view/drop-indicator.js +3 -3
  110. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  111. package/build-module/components/list-view/index.js +14 -8
  112. package/build-module/components/list-view/index.js.map +1 -1
  113. package/build-module/components/list-view/use-list-view-images.js +5 -4
  114. package/build-module/components/list-view/use-list-view-images.js.map +1 -1
  115. package/build-module/components/preview-options/index.js +3 -1
  116. package/build-module/components/preview-options/index.js.map +1 -1
  117. package/build-module/components/provider/index.js +3 -1
  118. package/build-module/components/provider/index.js.map +1 -1
  119. package/build-module/components/rich-text/use-remove-browser-shortcuts.js +1 -1
  120. package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +1 -1
  121. package/build-module/components/use-block-commands/index.js +74 -63
  122. package/build-module/components/use-block-commands/index.js.map +1 -1
  123. package/build-module/components/warning/index.js +2 -2
  124. package/build-module/components/warning/index.js.map +1 -1
  125. package/build-module/hooks/auto-inserting-blocks.js +167 -0
  126. package/build-module/hooks/auto-inserting-blocks.js.map +1 -0
  127. package/build-module/hooks/index.js +1 -0
  128. package/build-module/hooks/index.js.map +1 -1
  129. package/build-module/store/selectors.js +1 -1
  130. package/build-module/store/selectors.js.map +1 -1
  131. package/build-style/content-rtl.css +8 -7
  132. package/build-style/content.css +8 -7
  133. package/build-style/style-rtl.css +0 -3
  134. package/build-style/style.css +0 -3
  135. package/package.json +32 -32
  136. package/src/components/block-icon/test/index.js +2 -2
  137. package/src/components/block-list/block-outline.native.js +5 -2
  138. package/src/components/block-list/content.scss +2 -3
  139. package/src/components/block-list/index.js +4 -3
  140. package/src/components/block-list/use-block-props/index.js +26 -0
  141. package/src/components/block-list/use-block-props/use-nav-mode-exit.js +1 -1
  142. package/src/components/block-lock/menu-item.js +2 -0
  143. package/src/components/block-lock/toolbar.js +3 -1
  144. package/src/components/block-popover/inbetween.js +4 -3
  145. package/src/components/block-popover/index.js +3 -2
  146. package/src/components/block-styles/style.scss +0 -3
  147. package/src/components/button-block-appender/content.scss +8 -0
  148. package/src/components/color-style-selector/index.js +1 -1
  149. package/src/components/iframe/index.js +1 -0
  150. package/src/components/inserter/reusable-blocks-tab.native.js +7 -2
  151. package/src/components/inserter/search-results.native.js +13 -9
  152. package/src/components/link-control/index.js +1 -5
  153. package/src/components/link-control/test/index.js +1 -0
  154. package/src/components/list-view/block-select-button.js +67 -15
  155. package/src/components/list-view/drop-indicator.js +4 -5
  156. package/src/components/list-view/index.js +19 -13
  157. package/src/components/list-view/use-list-view-images.js +8 -4
  158. package/src/components/observe-typing/README.md +2 -2
  159. package/src/components/preview-options/index.js +2 -0
  160. package/src/components/provider/index.js +8 -1
  161. package/src/components/rich-text/use-remove-browser-shortcuts.js +1 -1
  162. package/src/components/use-block-commands/index.js +92 -88
  163. package/src/components/warning/index.js +2 -2
  164. package/src/hooks/auto-inserting-blocks.js +232 -0
  165. package/src/hooks/index.js +1 -0
  166. package/src/store/selectors.js +1 -1
  167. package/build/utils/pre-parse-patterns.js +0 -68
  168. package/build/utils/pre-parse-patterns.js.map +0 -1
  169. package/build-module/utils/pre-parse-patterns.js +0 -61
  170. package/build-module/utils/pre-parse-patterns.js.map +0 -1
  171. package/src/components/url-popover/test/__snapshots__/index.js.snap +0 -133
  172. package/src/components/url-popover/test/index.js +0 -75
  173. package/src/utils/pre-parse-patterns.js +0 -69
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useMergeRefs","Popover","forwardRef","useMemo","useReducer","useLayoutEffect","__unstableUseBlockElement","useBlockElement","usePopoverScroll","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","BlockPopover","clientId","bottomClientId","children","__unstableRefreshSize","__unstableCoverTarget","__unstablePopoverSlot","__unstableContentRef","shift","props","ref","selectedElement","lastSelectedElement","mergedRefs","popoverDimensionsRecomputeCounter","forceRecomputePopoverDimensions","s","observer","window","MutationObserver","observe","attributes","disconnect","style","position","width","offsetWidth","height","offsetHeight","popoverAnchor","undefined","getBoundingClientRect","_lastSelectedBCR$left","_lastSelectedBCR$top","_lastSelectedBCR$righ","_lastSelectedBCR$bott","selectedBCR","lastSelectedBCR","left","Math","min","Infinity","top","right","max","bottom","DOMRect","ownerDocument","createElement","animate","focusOnMount","anchor","__unstableSlotName","placement","resize","flip","className","variant"],"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { Popover } from '@wordpress/components';\nimport {\n\tforwardRef,\n\tuseMemo,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nfunction BlockPopover(\n\t{\n\t\tclientId,\n\t\tbottomClientId,\n\t\tchildren,\n\t\t__unstableRefreshSize,\n\t\t__unstableCoverTarget = false,\n\t\t__unstablePopoverSlot,\n\t\t__unstableContentRef,\n\t\tshift = true,\n\t\t...props\n\t},\n\tref\n) {\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( bottomClientId ?? clientId );\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tusePopoverScroll( __unstableContentRef ),\n\t] );\n\n\tconst [\n\t\tpopoverDimensionsRecomputeCounter,\n\t\tforceRecomputePopoverDimensions,\n\t] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\t// When blocks are moved up/down, they are animated to their new position by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! selectedElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new window.MutationObserver(\n\t\t\tforceRecomputePopoverDimensions\n\t\t);\n\t\tobserver.observe( selectedElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ selectedElement ] );\n\n\tconst style = useMemo( () => {\n\t\tif (\n\t\t\t// popoverDimensionsRecomputeCounter is by definition always equal or greater\n\t\t\t// than 0. This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverDimensionsRecomputeCounter < 0 ||\n\t\t\t! selectedElement ||\n\t\t\tlastSelectedElement !== selectedElement\n\t\t) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\twidth: selectedElement.offsetWidth,\n\t\t\theight: selectedElement.offsetHeight,\n\t\t};\n\t}, [\n\t\tselectedElement,\n\t\tlastSelectedElement,\n\t\t__unstableRefreshSize,\n\t\tpopoverDimensionsRecomputeCounter,\n\t] );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverDimensionsRecomputeCounter is by definition always equal or greater\n\t\t\t// than 0. This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverDimensionsRecomputeCounter < 0 ||\n\t\t\t! selectedElement ||\n\t\t\t( bottomClientId && ! lastSelectedElement )\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst selectedBCR = selectedElement.getBoundingClientRect();\n\t\t\t\tconst lastSelectedBCR =\n\t\t\t\t\tlastSelectedElement?.getBoundingClientRect();\n\n\t\t\t\t// Get the biggest rectangle that encompasses completely the currently\n\t\t\t\t// selected element and the last selected element:\n\t\t\t\t// - for top/left coordinates, use the smaller numbers\n\t\t\t\t// - for the bottom/right coordinates, use the largest numbers\n\t\t\t\tconst left = Math.min(\n\t\t\t\t\tselectedBCR.left,\n\t\t\t\t\tlastSelectedBCR?.left ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst top = Math.min(\n\t\t\t\t\tselectedBCR.top,\n\t\t\t\t\tlastSelectedBCR?.top ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst right = Math.max(\n\t\t\t\t\tselectedBCR.right,\n\t\t\t\t\tlastSelectedBCR.right ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst bottom = Math.max(\n\t\t\t\t\tselectedBCR.bottom,\n\t\t\t\t\tlastSelectedBCR.bottom ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst width = right - left;\n\t\t\t\tconst height = bottom - top;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t\townerDocument: selectedElement.ownerDocument,\n\t\t};\n\t}, [\n\t\tbottomClientId,\n\t\tlastSelectedElement,\n\t\tselectedElement,\n\t\tpopoverDimensionsRecomputeCounter,\n\t] );\n\n\tif ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ mergedRefs }\n\t\t\tanimate={ false }\n\t\t\tfocusOnMount={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot || null }\n\t\t\tplacement=\"top-start\"\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tshift={ shift }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t{ __unstableCoverTarget && <div style={ style }>{ children }</div> }\n\t\t\t{ ! __unstableCoverTarget && children }\n\t\t</Popover>\n\t);\n}\n\nexport default forwardRef( BlockPopover );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SACCC,UAAU,EACVC,OAAO,EACPC,UAAU,EACVC,eAAe,QACT,oBAAoB;;AAE3B;AACA;AACA;AACA,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,8CAA8C;AAC3G,OAAOC,gBAAgB,MAAM,sBAAsB;AAEnD,MAAMC,6BAA6B,GAAGC,MAAM,CAACC,gBAAgB;AAE7D,SAASC,YAAYA,CACpB;EACCC,QAAQ;EACRC,cAAc;EACdC,QAAQ;EACRC,qBAAqB;EACrBC,qBAAqB,GAAG,KAAK;EAC7BC,qBAAqB;EACrBC,oBAAoB;EACpBC,KAAK,GAAG,IAAI;EACZ,GAAGC;AACJ,CAAC,EACDC,GAAG,EACF;EACD,MAAMC,eAAe,GAAGhB,eAAe,CAAEM,QAAS,CAAC;EACnD,MAAMW,mBAAmB,GAAGjB,eAAe,CAAEO,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAID,QAAS,CAAC;EACzE,MAAMY,UAAU,GAAGzB,YAAY,CAAE,CAChCsB,GAAG,EACHd,gBAAgB,CAAEW,oBAAqB,CAAC,CACvC,CAAC;EAEH,MAAM,CACLO,iCAAiC,EACjCC,+BAA+B,CAC/B,GAAGvB,UAAU;EACb;EACEwB,CAAC,IAAM,CAAEA,CAAC,GAAG,CAAC,IAAKnB,6BAA6B,EAClD,CACD,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACAJ,eAAe,CAAE,MAAM;IACtB,IAAK,CAAEkB,eAAe,EAAG;MACxB;IACD;IAEA,MAAMM,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAgB,CAC3CJ,+BACD,CAAC;IACDE,QAAQ,CAACG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HC,OAAO,EAAC;EAAU,GAEhBpD,qBAAqB,IAAI2C,aAAA;IAAKzB,KAAK,EAAGA;EAAO,GAAGpB,QAAe,CAAC,EAChE,CAAEE,qBAAqB,IAAIF,QACrB,CAAC;AAEZ;AAEA,eAAeb,UAAU,CAAEU,YAAa,CAAC"}
1
+ {"version":3,"names":["classnames","useMergeRefs","Popover","forwardRef","useMemo","useReducer","useLayoutEffect","__unstableUseBlockElement","useBlockElement","usePopoverScroll","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","BlockPopover","clientId","bottomClientId","children","__unstableRefreshSize","__unstableCoverTarget","__unstablePopoverSlot","__unstableContentRef","shift","props","ref","selectedElement","lastSelectedElement","mergedRefs","popoverDimensionsRecomputeCounter","forceRecomputePopoverDimensions","s","observer","window","MutationObserver","observe","attributes","disconnect","style","position","width","offsetWidth","height","offsetHeight","popoverAnchor","undefined","getBoundingClientRect","_lastSelectedBCR$left","_lastSelectedBCR$top","_lastSelectedBCR$righ","_lastSelectedBCR$bott","selectedBCR","lastSelectedBCR","left","Math","min","Infinity","top","right","max","bottom","DOMRect","contextElement","createElement","animate","focusOnMount","anchor","__unstableSlotName","inline","placement","resize","flip","className","variant"],"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { Popover } from '@wordpress/components';\nimport {\n\tforwardRef,\n\tuseMemo,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nfunction BlockPopover(\n\t{\n\t\tclientId,\n\t\tbottomClientId,\n\t\tchildren,\n\t\t__unstableRefreshSize,\n\t\t__unstableCoverTarget = false,\n\t\t__unstablePopoverSlot,\n\t\t__unstableContentRef,\n\t\tshift = true,\n\t\t...props\n\t},\n\tref\n) {\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( bottomClientId ?? clientId );\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tusePopoverScroll( __unstableContentRef ),\n\t] );\n\n\tconst [\n\t\tpopoverDimensionsRecomputeCounter,\n\t\tforceRecomputePopoverDimensions,\n\t] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\t// When blocks are moved up/down, they are animated to their new position by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! selectedElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new window.MutationObserver(\n\t\t\tforceRecomputePopoverDimensions\n\t\t);\n\t\tobserver.observe( selectedElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ selectedElement ] );\n\n\tconst style = useMemo( () => {\n\t\tif (\n\t\t\t// popoverDimensionsRecomputeCounter is by definition always equal or greater\n\t\t\t// than 0. This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverDimensionsRecomputeCounter < 0 ||\n\t\t\t! selectedElement ||\n\t\t\tlastSelectedElement !== selectedElement\n\t\t) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\twidth: selectedElement.offsetWidth,\n\t\t\theight: selectedElement.offsetHeight,\n\t\t};\n\t}, [\n\t\tselectedElement,\n\t\tlastSelectedElement,\n\t\t__unstableRefreshSize,\n\t\tpopoverDimensionsRecomputeCounter,\n\t] );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverDimensionsRecomputeCounter is by definition always equal or greater\n\t\t\t// than 0. This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverDimensionsRecomputeCounter < 0 ||\n\t\t\t! selectedElement ||\n\t\t\t( bottomClientId && ! lastSelectedElement )\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst selectedBCR = selectedElement.getBoundingClientRect();\n\t\t\t\tconst lastSelectedBCR =\n\t\t\t\t\tlastSelectedElement?.getBoundingClientRect();\n\n\t\t\t\t// Get the biggest rectangle that encompasses completely the currently\n\t\t\t\t// selected element and the last selected element:\n\t\t\t\t// - for top/left coordinates, use the smaller numbers\n\t\t\t\t// - for the bottom/right coordinates, use the largest numbers\n\t\t\t\tconst left = Math.min(\n\t\t\t\t\tselectedBCR.left,\n\t\t\t\t\tlastSelectedBCR?.left ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst top = Math.min(\n\t\t\t\t\tselectedBCR.top,\n\t\t\t\t\tlastSelectedBCR?.top ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst right = Math.max(\n\t\t\t\t\tselectedBCR.right,\n\t\t\t\t\tlastSelectedBCR.right ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst bottom = Math.max(\n\t\t\t\t\tselectedBCR.bottom,\n\t\t\t\t\tlastSelectedBCR.bottom ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst width = right - left;\n\t\t\t\tconst height = bottom - top;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t\tcontextElement: selectedElement,\n\t\t};\n\t}, [\n\t\tbottomClientId,\n\t\tlastSelectedElement,\n\t\tselectedElement,\n\t\tpopoverDimensionsRecomputeCounter,\n\t] );\n\n\tif ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ mergedRefs }\n\t\t\tanimate={ false }\n\t\t\tfocusOnMount={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot }\n\t\t\tinline={ ! __unstablePopoverSlot }\n\t\t\tplacement=\"top-start\"\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tshift={ shift }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t{ __unstableCoverTarget && <div style={ style }>{ children }</div> }\n\t\t\t{ ! __unstableCoverTarget && children }\n\t\t</Popover>\n\t);\n}\n\nexport default forwardRef( BlockPopover );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SACCC,UAAU,EACVC,OAAO,EACPC,UAAU,EACVC,eAAe,QACT,oBAAoB;;AAE3B;AACA;AACA;AACA,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,8CAA8C;AAC3G,OAAOC,gBAAgB,MAAM,sBAAsB;AAEnD,MAAMC,6BAA6B,GAAGC,MAAM,CAACC,gBAAgB;AAE7D,SAASC,YAAYA,CACpB;EACCC,QAAQ;EACRC,cAAc;EACdC,QAAQ;EACRC,qBAAqB;EACrBC,qBAAqB,GAAG,KAAK;EAC7BC,qBAAqB;EACrBC,oBAAoB;EACpBC,KAAK,GAAG,IAAI;EACZ,GAAGC;AACJ,CAAC,EACDC,GAAG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pC;IACjB,CAAC;EACF,CAAC,EAAE,CACFT,cAAc,EACdU,mBAAmB,EACnBD,eAAe,EACfG,iCAAiC,CAChC,CAAC;EAEH,IAAK,CAAEH,eAAe,IAAMT,cAAc,IAAI,CAAEU,mBAAqB,EAAG;IACvE,OAAO,IAAI;EACZ;EAEA,OACCoC,aAAA,CAAC3D,OAAO;IACPqB,GAAG,EAAGG,UAAY;IAClBoC,OAAO,EAAG,KAAO;IACjBC,YAAY,EAAG,KAAO;IACtBC,MAAM,EAAGtB;IACT;IACA;IAAA;IACAuB,kBAAkB,EAAG9C,qBAAuB;IAC5C+C,MAAM,EAAG,CAAE/C,qBAAuB;IAClCgD,SAAS,EAAC,WAAW;IACrBC,MAAM,EAAG,KAAO;IAChBC,IAAI,EAAG,KAAO;IACdhD,KAAK,EAAGA,KAAO;IAAA,GACVC,KAAK;IACVgD,SAAS,EAAGtE,UAAU,CACrB,4BAA4B,EAC5BsB,KAAK,CAACgD,SACP,CAAG;IACHC,OAAO,EAAC;EAAU,GAEhBrD,qBAAqB,IAAI2C,aAAA;IAAKzB,KAAK,EAAGA;EAAO,GAAGpB,QAAe,CAAC,EAChE,CAAEE,qBAAqB,IAAIF,QACrB,CAAC;AAEZ;AAEA,eAAeb,UAAU,CAAEU,YAAa,CAAC"}
@@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
7
7
  import { DOWN } from '@wordpress/keycodes';
8
8
  import deprecated from '@wordpress/deprecated';
9
9
  const ColorSelectorSVGIcon = () => createElement(SVG, {
10
- xmlns: "https://www.w3.org/2000/svg",
10
+ xmlns: "http://www.w3.org/2000/svg",
11
11
  viewBox: "0 0 20 20"
12
12
  }, createElement(Path, {
13
13
  d: "M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"
@@ -1 +1 @@
1
- {"version":3,"names":["ToolbarButton","Dropdown","ToolbarGroup","SVG","Path","__","DOWN","deprecated","ColorSelectorSVGIcon","createElement","xmlns","viewBox","d","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","preventDefault","label","onClick","onKeyDown","icon","BlockColorsStyleSelector","children","other","alternative","since","version","popoverProps","placement","contentClassName","renderToggle","renderContent"],"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport deprecated from '@wordpress/deprecated';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"https://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent =\n\t( { TextColor, BackgroundColor } ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst openOnArrowDown = ( event ) => {\n\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t\t</BackgroundColor>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => {\n\tdeprecated( `wp.blockEditor.BlockColorsStyleSelector`, {\n\t\talternative: 'block supports API',\n\t\tsince: '6.1',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\tclassName=\"block-library-colors-selector\"\n\t\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\t\trenderToggle={ renderToggleComponent( other ) }\n\t\t\trenderContent={ () => children }\n\t\t/>\n\t);\n};\n\nexport default BlockColorsStyleSelector;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,QAAQ,EACRC,YAAY,EACZC,GAAG,EACHC,IAAI,QACE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAE9C,MAAMC,oBAAoB,GAAGA,CAAA,KAC5BC,aAAA,CAACN,GAAG;EAACO,KAAK,EAAC,6BAA6B;EAACC,OAAO,EAAC;AAAW,GAC3DF,aAAA,CAACL,IAAI;EAACQ,CAAC,EAAC;AAA6e,CAAE,CACnf,CACL;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAGA,CAAE;EAAEC,KAAK;EAAEC;AAAU,CAAC,KAAM;EACrD,OACCN,aAAA;IAAKM,SAAS,EAAC;EAA+C,GAC7DN,aAAA;IACCM,SAAS,EAAI,GAAGA,SAAW,iDAAkD;IAC7ED,KAAK,EAAGA;EAAO,GAEfL,aAAA,CAACD,oBAAoB,MAAE,CACnB,CACD,CAAC;AAER,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMQ,qBAAqB,GAC1BA,CAAE;EAAEC,SAAS;EAAEC;AAAgB,CAAC,KAChC,CAAE;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAM;EAC3B,MAAMC,eAAe,GAAKC,KAAK,IAAM;IACpC,IAAK,CAAEF,MAAM,IAAIE,KAAK,CAACC,OAAO,KAAKjB,IAAI,EAAG;MACzCgB,KAAK,CAACE,cAAc,CAAC,CAAC;MACtBL,QAAQ,CAAC,CAAC;IACX;EACD,CAAC;EAED,OACCV,aAAA,CAACP,YAAY,QACZO,aAAA,CAACT,aAAa;IACbe,SAAS,EAAC,mEAAmE;IAC7EU,KAAK,EAAGpB,EAAE,CAAE,sBAAuB,CAAG;IACtCqB,OAAO,EAAGP,QAAU;IACpBQ,SAAS,EAAGN,eAAiB;IAC7BO,IAAI,EACHnB,aAAA,CAACS,eAAe,QACfT,aAAA,CAACQ,SAAS,QACTR,aAAA,CAACI,iBAAiB,MAAE,CACV,CACK;EACjB,CACD,CACY,CAAC;AAEjB,CAAC;AAEF,MAAMgB,wBAAwB,GAAGA,CAAE;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC9DxB,UAAU,CAAG,yCAAwC,EAAE;IACtDyB,WAAW,EAAE,oBAAoB;IACjCC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,OACCzB,aAAA,CAACR,QAAQ;IACRkC,YAAY,EAAG;MAAEC,SAAS,EAAE;IAAe,CAAG;IAC9CrB,SAAS,EAAC,+BAA+B;IACzCsB,gBAAgB,EAAC,wCAAwC;IACzDC,YAAY,EAAGtB,qBAAqB,CAAEe,KAAM,CAAG;IAC/CQ,aAAa,EAAGA,CAAA,KAAMT;EAAU,CAChC,CAAC;AAEJ,CAAC;AAED,eAAeD,wBAAwB"}
1
+ {"version":3,"names":["ToolbarButton","Dropdown","ToolbarGroup","SVG","Path","__","DOWN","deprecated","ColorSelectorSVGIcon","createElement","xmlns","viewBox","d","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","preventDefault","label","onClick","onKeyDown","icon","BlockColorsStyleSelector","children","other","alternative","since","version","popoverProps","placement","contentClassName","renderToggle","renderContent"],"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport deprecated from '@wordpress/deprecated';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent =\n\t( { TextColor, BackgroundColor } ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst openOnArrowDown = ( event ) => {\n\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t\t</BackgroundColor>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => {\n\tdeprecated( `wp.blockEditor.BlockColorsStyleSelector`, {\n\t\talternative: 'block supports API',\n\t\tsince: '6.1',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\tclassName=\"block-library-colors-selector\"\n\t\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\t\trenderToggle={ renderToggleComponent( other ) }\n\t\t\trenderContent={ () => children }\n\t\t/>\n\t);\n};\n\nexport default BlockColorsStyleSelector;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,QAAQ,EACRC,YAAY,EACZC,GAAG,EACHC,IAAI,QACE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAE9C,MAAMC,oBAAoB,GAAGA,CAAA,KAC5BC,aAAA,CAACN,GAA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tDyB,WAAW,EAAE,oBAAoB;IACjCC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,OACCzB,aAAA,CAACR,QAAQ;IACRkC,YAAY,EAAG;MAAEC,SAAS,EAAE;IAAe,CAAG;IAC9CrB,SAAS,EAAC,+BAA+B;IACzCsB,gBAAgB,EAAC,wCAAwC;IACzDC,YAAY,EAAGtB,qBAAqB,CAAEe,KAAM,CAAG;IAC/CQ,aAAa,EAAGA,CAAA,KAAMT;EAAU,CAChC,CAAC;AAEJ,CAAC;AAED,eAAeD,wBAAwB"}
@@ -153,6 +153,7 @@ function Iframe({
153
153
  const html = `<!doctype html>
154
154
  <html>
155
155
  <head>
156
+ <meta charset="utf-8">
156
157
  <script>window.frameElement._load()</script>
157
158
  <style>html{height:auto!important;min-height:100%;}body{margin:0}</style>
158
159
  ${styles}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useState","createPortal","forwardRef","useMemo","useEffect","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","useCompatibilityStyles","store","blockEditorStore","bubbleEvents","doc","defaultView","frameElement","bubbleEvent","event","prototype","Object","getPrototypeOf","constructorName","constructor","name","Constructor","window","init","key","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","cancelled","dispatchEvent","preventDefault","eventTypes","addEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","expand","readonly","forwardedRef","ref","props","resolvedAssets","isPreviewMode","select","settings","getSettings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","iframeDocument","setIframeDocument","bodyClasses","setBodyClasses","compatStyles","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","setRef","node","_load","contentDocument","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","documentElement","Array","from","body","classList","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","removeEventListener","disabledRef","isDisabled","bodyRef","html","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","marginFromScaling","createElement","Fragment","style","marginTop","marginBottom","transform","transition","title","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { useCompatibilityStyles } from './use-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} doc Document to attach listeners to.\n */\nfunction bubbleEvents( doc ) {\n\tconst { defaultView } = doc;\n\tconst { frameElement } = defaultView;\n\n\tfunction bubbleEvent( event ) {\n\t\tconst prototype = Object.getPrototypeOf( event );\n\t\tconst constructorName = prototype.constructor.name;\n\t\tconst Constructor = window[ constructorName ];\n\n\t\tconst init = {};\n\n\t\tfor ( const key in event ) {\n\t\t\tinit[ key ] = event[ key ];\n\t\t}\n\n\t\tif ( event instanceof defaultView.MouseEvent ) {\n\t\t\tconst rect = frameElement.getBoundingClientRect();\n\t\t\tinit.clientX += rect.left;\n\t\t\tinit.clientY += rect.top;\n\t\t}\n\n\t\tconst newEvent = new Constructor( event.type, init );\n\t\tconst cancelled = ! frameElement.dispatchEvent( newEvent );\n\n\t\tif ( cancelled ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\n\tfor ( const name of eventTypes ) {\n\t\tdoc.addEventListener( name, bubbleEvent );\n\t}\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\texpand = false,\n\treadonly,\n\tforwardedRef: ref,\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst compatStyles = useCompatibilityStyles();\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tbubbleEvents( contentDocument );\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of compatStyles ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<script>window.frameElement._load()</script>\n\t\t<style>html{height:auto!important;min-height:100%;}body{margin:0}</style>\n\t\t${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\t// We need to counter the margin created by scaling the iframe. If the scale\n\t// is e.g. 0.45, then the top + bottom margin is 0.55 (1 - scale). Just the\n\t// top or bottom margin is 0.55 / 2 ((1 - scale) / 2).\n\tconst marginFromScaling = ( contentHeight * ( 1 - scale ) ) / 2;\n\n\treturn (\n\t\t<>\n\t\t\t{ tabIndex >= 0 && before }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: expand ? contentHeight : props.style?.height,\n\t\t\t\t\tmarginTop:\n\t\t\t\t\t\tscale !== 1\n\t\t\t\t\t\t\t? -marginFromScaling + frameSize\n\t\t\t\t\t\t\t: props.style?.marginTop,\n\t\t\t\t\tmarginBottom:\n\t\t\t\t\t\tscale !== 1\n\t\t\t\t\t\t\t? -marginFromScaling + frameSize\n\t\t\t\t\t\t\t: props.style?.marginBottom,\n\t\t\t\t\ttransform:\n\t\t\t\t\t\tscale !== 1\n\t\t\t\t\t\t\t? `scale( ${ scale } )`\n\t\t\t\t\t\t\t: props.style?.transform,\n\t\t\t\t\ttransition: 'all .3s',\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ __( 'Editor canvas' ) }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ tabIndex >= 0 && after }\n\t\t</>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAA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c,CAACoB,eAChB,CACM,CAAC,EACPrC,QAAQ,IAAI,CAAC,IAAIyB,KAClB,CAAC;AAEL;AAEA,SAASmD,aAAaA,CAAErE,KAAK,EAAED,GAAG,EAAG;EACpC,MAAMuE,aAAa,GAAGpH,SAAS,CAC5BiD,MAAM,IACPA,MAAM,CAAE5C,gBAAiB,CAAC,CAAC8C,WAAW,CAAC,CAAC,CAACkE,uBAAuB,EACjE,EACD,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OAAOX,aAAA,CAACrE,MAAM;IAAA,GAAMU,KAAK;IAAGF,YAAY,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAevD,UAAU,CAAE6H,aAAc,CAAC"}
1
+ {"version":3,"names":["classnames","useState","createPortal","forwardRef","useMemo","useEffect","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","useCompatibilityStyles","store","blockEditorStore","bubbleEvents","doc","defaultView","frameElement","bubbleEvent","event","prototype","Object","getPrototypeOf","constructorName","constructor","name","Constructor","window","init","key","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","cancelled","dispatchEvent","preventDefault","eventTypes","addEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","expand","readonly","forwardedRef","ref","props","resolvedAssets","isPreviewMode","select","settings","getSettings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","iframeDocument","setIframeDocument","bodyClasses","setBodyClasses","compatStyles","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","setRef","node","_load","contentDocument","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","documentElement","Array","from","body","classList","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","removeEventListener","disabledRef","isDisabled","bodyRef","html","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","marginFromScaling","createElement","Fragment","style","marginTop","marginBottom","transform","transition","title","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { useCompatibilityStyles } from './use-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} doc Document to attach listeners to.\n */\nfunction bubbleEvents( doc ) {\n\tconst { defaultView } = doc;\n\tconst { frameElement } = defaultView;\n\n\tfunction bubbleEvent( event ) {\n\t\tconst prototype = Object.getPrototypeOf( event );\n\t\tconst constructorName = prototype.constructor.name;\n\t\tconst Constructor = window[ constructorName ];\n\n\t\tconst init = {};\n\n\t\tfor ( const key in event ) {\n\t\t\tinit[ key ] = event[ key ];\n\t\t}\n\n\t\tif ( event instanceof defaultView.MouseEvent ) {\n\t\t\tconst rect = frameElement.getBoundingClientRect();\n\t\t\tinit.clientX += rect.left;\n\t\t\tinit.clientY += rect.top;\n\t\t}\n\n\t\tconst newEvent = new Constructor( event.type, init );\n\t\tconst cancelled = ! frameElement.dispatchEvent( newEvent );\n\n\t\tif ( cancelled ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\n\tfor ( const name of eventTypes ) {\n\t\tdoc.addEventListener( name, bubbleEvent );\n\t}\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\texpand = false,\n\treadonly,\n\tforwardedRef: ref,\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst compatStyles = useCompatibilityStyles();\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tbubbleEvents( contentDocument );\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of compatStyles ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<script>window.frameElement._load()</script>\n\t\t<style>html{height:auto!important;min-height:100%;}body{margin:0}</style>\n\t\t${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\t// We need to counter the margin created by scaling the iframe. If the scale\n\t// is e.g. 0.45, then the top + bottom margin is 0.55 (1 - scale). Just the\n\t// top or bottom margin is 0.55 / 2 ((1 - scale) / 2).\n\tconst marginFromScaling = ( contentHeight * ( 1 - scale ) ) / 2;\n\n\treturn (\n\t\t<>\n\t\t\t{ tabIndex >= 0 && before }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: expand ? contentHeight : props.style?.height,\n\t\t\t\t\tmarginTop:\n\t\t\t\t\t\tscale !== 1\n\t\t\t\t\t\t\t? -marginFromScaling + frameSize\n\t\t\t\t\t\t\t: props.style?.marginTop,\n\t\t\t\t\tmarginBottom:\n\t\t\t\t\t\tscale !== 1\n\t\t\t\t\t\t\t? -marginFromScaling + frameSize\n\t\t\t\t\t\t\t: props.style?.marginBottom,\n\t\t\t\t\ttransform:\n\t\t\t\t\t\tscale !== 1\n\t\t\t\t\t\t\t? `scale( ${ scale } )`\n\t\t\t\t\t\t\t: props.style?.transform,\n\t\t\t\t\ttransition: 'all .3s',\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ __( 'Editor canvas' ) }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ tabIndex >= 0 && after }\n\t\t</>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,SAAS,QACH,oBAAoB;AAC3B,SAAS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QAAQ,IAAI,CAAC,IAAIyB,KAClB,CAAC;AAEL;AAEA,SAASmD,aAAaA,CAAErE,KAAK,EAAED,GAAG,EAAG;EACpC,MAAMuE,aAAa,GAAGpH,SAAS,CAC5BiD,MAAM,IACPA,MAAM,CAAE5C,gBAAiB,CAAC,CAAC8C,WAAW,CAAC,CAAC,CAACkE,uBAAuB,EACjE,EACD,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OAAOX,aAAA,CAACrE,MAAM;IAAA,GAAMU,KAAK;IAAGF,YAAY,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAevD,UAAU,CAAE6H,aAAc,CAAC"}
@@ -4,6 +4,7 @@ import { createElement } from "@wordpress/element";
4
4
  */
5
5
  import { useSelect } from '@wordpress/data';
6
6
  import { __ } from '@wordpress/i18n';
7
+ import { useMemo } from '@wordpress/element';
7
8
 
8
9
  /**
9
10
  * Internal dependencies
@@ -17,18 +18,21 @@ function ReusableBlocksTab({
17
18
  listProps
18
19
  }) {
19
20
  const {
20
- items
21
+ inserterItems
21
22
  } = useSelect(select => {
22
23
  const {
23
24
  getInserterItems
24
25
  } = select(blockEditorStore);
25
26
  const allItems = getInserterItems(rootClientId);
26
27
  return {
27
- items: filterInserterItems(allItems, {
28
- onlyReusable: true
29
- })
28
+ inserterItems: allItems
30
29
  };
31
30
  }, [rootClientId]);
31
+ const items = useMemo(() => {
32
+ return filterInserterItems(inserterItems, {
33
+ onlyReusable: true
34
+ });
35
+ }, [inserterItems]);
32
36
  const sections = [createInserterSection({
33
37
  key: 'reuseable',
34
38
  items
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","__","BlockTypesList","store","blockEditorStore","createInserterSection","filterInserterItems","ReusableBlocksTab","onSelect","rootClientId","listProps","items","select","getInserterItems","allItems","onlyReusable","sections","key","createElement","name","label"],"sources":["@wordpress/block-editor/src/components/inserter/reusable-blocks-tab.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport { store as blockEditorStore } from '../../store';\nimport { createInserterSection, filterInserterItems } from './utils';\n\nfunction ReusableBlocksTab( { onSelect, rootClientId, listProps } ) {\n\tconst { items } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getInserterItems } = select( blockEditorStore );\n\t\t\tconst allItems = getInserterItems( rootClientId );\n\n\t\t\treturn {\n\t\t\t\titems: filterInserterItems( allItems, { onlyReusable: true } ),\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\tconst sections = [ createInserterSection( { key: 'reuseable', items } ) ];\n\n\treturn (\n\t\t<BlockTypesList\n\t\t\tname=\"SyncedPatterns\"\n\t\t\tsections={ sections }\n\t\t\tonSelect={ onSelect }\n\t\t\tlistProps={ listProps }\n\t\t\tlabel={ __( 'Synced patterns' ) }\n\t\t/>\n\t);\n}\n\nexport default ReusableBlocksTab;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,qBAAqB;AAChD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,SAAS;AAEpE,SAASC,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC,YAAY;EAAEC;AAAU,CAAC,EAAG;EACnE,MAAM;IAAEC;EAAM,CAAC,GAAGX,SAAS,CACxBY,MAAM,IAAM;IACb,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAER,gBAAiB,CAAC;IACvD,MAAMU,QAAQ,GAAGD,gBAAgB,CAAEJ,YAAa,CAAC;IAEjD,OAAO;MACNE,KAAK,EAAEL,mBAAmB,CAAEQ,QAAQ,EAAE;QAAEC,YAAY,EAAE;MAAK,CAAE;IAC9D,CAAC;EACF,CAAC,EACD,CAAEN,YAAY,CACf,CAAC;EAED,MAAMO,QAAQ,GAAG,CAAEX,qBAAqB,CAAE;IAAEY,GAAG,EAAE,WAAW;IAAEN;EAAM,CAAE,CAAC,CAAE;EAEzE,OACCO,aAAA,CAAChB,cAAc;IACdiB,IAAI,EAAC,gBAAgB;IACrBH,QAAQ,EAAGA,QAAU;IACrBR,QAAQ,EAAGA,QAAU;IACrBE,SAAS,EAAGA,SAAW;IACvBU,KAAK,EAAGnB,EAAE,CAAE,iBAAkB;EAAG,CACjC,CAAC;AAEJ;AAEA,eAAeM,iBAAiB"}
1
+ {"version":3,"names":["useSelect","__","useMemo","BlockTypesList","store","blockEditorStore","createInserterSection","filterInserterItems","ReusableBlocksTab","onSelect","rootClientId","listProps","inserterItems","select","getInserterItems","allItems","items","onlyReusable","sections","key","createElement","name","label"],"sources":["@wordpress/block-editor/src/components/inserter/reusable-blocks-tab.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport { store as blockEditorStore } from '../../store';\nimport { createInserterSection, filterInserterItems } from './utils';\n\nfunction ReusableBlocksTab( { onSelect, rootClientId, listProps } ) {\n\tconst { inserterItems } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getInserterItems } = select( blockEditorStore );\n\t\t\tconst allItems = getInserterItems( rootClientId );\n\n\t\t\treturn {\n\t\t\t\tinserterItems: allItems,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\tconst items = useMemo( () => {\n\t\treturn filterInserterItems( inserterItems, { onlyReusable: true } );\n\t}, [ inserterItems ] );\n\n\tconst sections = [ createInserterSection( { key: 'reuseable', items } ) ];\n\n\treturn (\n\t\t<BlockTypesList\n\t\t\tname=\"SyncedPatterns\"\n\t\t\tsections={ sections }\n\t\t\tonSelect={ onSelect }\n\t\t\tlistProps={ listProps }\n\t\t\tlabel={ __( 'Synced patterns' ) }\n\t\t/>\n\t);\n}\n\nexport default ReusableBlocksTab;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,OAAOC,cAAc,MAAM,qBAAqB;AAChD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,SAAS;AAEpE,SAASC,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC,YAAY;EAAEC;AAAU,CAAC,EAAG;EACnE,MAAM;IAAEC;EAAc,CAAC,GAAGZ,SAAS,CAChCa,MAAM,IAAM;IACb,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAER,gBAAiB,CAAC;IACvD,MAAMU,QAAQ,GAAGD,gBAAgB,CAAEJ,YAAa,CAAC;IAEjD,OAAO;MACNE,aAAa,EAAEG;IAChB,CAAC;EACF,CAAC,EACD,CAAEL,YAAY,CACf,CAAC;EAED,MAAMM,KAAK,GAAGd,OAAO,CAAE,MAAM;IAC5B,OAAOK,mBAAmB,CAAEK,aAAa,EAAE;MAAEK,YAAY,EAAE;IAAK,CAAE,CAAC;EACpE,CAAC,EAAE,CAAEL,aAAa,CAAG,CAAC;EAEtB,MAAMM,QAAQ,GAAG,CAAEZ,qBAAqB,CAAE;IAAEa,GAAG,EAAE,WAAW;IAAEH;EAAM,CAAE,CAAC,CAAE;EAEzE,OACCI,aAAA,CAACjB,cAAc;IACdkB,IAAI,EAAC,gBAAgB;IACrBH,QAAQ,EAAGA,QAAU;IACrBT,QAAQ,EAAGA,QAAU;IACrBE,SAAS,EAAGA,SAAW;IACvBW,KAAK,EAAGrB,EAAE,CAAE,iBAAkB;EAAG,CACjC,CAAC;AAEJ;AAEA,eAAeO,iBAAiB"}
@@ -4,6 +4,7 @@ import { createElement } from "@wordpress/element";
4
4
  */
5
5
  import { useSelect } from '@wordpress/data';
6
6
  import { __ } from '@wordpress/i18n';
7
+ import { useMemo } from '@wordpress/element';
7
8
 
8
9
  /**
9
10
  * Internal dependencies
@@ -22,17 +23,19 @@ function InserterSearchResults({
22
23
  isFullScreen
23
24
  }) {
24
25
  const {
25
- blockTypes
26
+ inserterItems
26
27
  } = useSelect(select => {
27
- const allItems = select(blockEditorStore).getInserterItems(rootClientId);
28
- const availableItems = filterInserterItems(allItems, {
29
- allowReusable: true
30
- });
31
- const filteredItems = searchItems(availableItems, filterValue);
28
+ const items = select(blockEditorStore).getInserterItems(rootClientId);
32
29
  return {
33
- blockTypes: filteredItems
30
+ inserterItems: items
34
31
  };
35
- }, [rootClientId, filterValue]);
32
+ }, [rootClientId]);
33
+ const blockTypes = useMemo(() => {
34
+ const availableItems = filterInserterItems(inserterItems, {
35
+ allowReusable: true
36
+ });
37
+ return searchItems(availableItems, filterValue);
38
+ }, [inserterItems, filterValue]);
36
39
  const {
37
40
  items,
38
41
  trackBlockTypeSelected
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","__","searchItems","BlockTypesList","InserterNoResults","store","blockEditorStore","useBlockTypeImpressions","createInserterSection","filterInserterItems","InserterSearchResults","filterValue","onSelect","listProps","rootClientId","isFullScreen","blockTypes","select","allItems","getInserterItems","availableItems","allowReusable","filteredItems","items","trackBlockTypeSelected","length","createElement","handleSelect","args","name","initialNumToRender","sections","key","label"],"sources":["@wordpress/block-editor/src/components/inserter/search-results.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { searchItems } from './search-items';\nimport BlockTypesList from '../block-types-list';\nimport InserterNoResults from './no-results';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockTypeImpressions from './hooks/use-block-type-impressions';\nimport { createInserterSection, filterInserterItems } from './utils';\n\nfunction InserterSearchResults( {\n\tfilterValue,\n\tonSelect,\n\tlistProps,\n\trootClientId,\n\tisFullScreen,\n} ) {\n\tconst { blockTypes } = useSelect(\n\t\t( select ) => {\n\t\t\tconst allItems =\n\t\t\t\tselect( blockEditorStore ).getInserterItems( rootClientId );\n\n\t\t\tconst availableItems = filterInserterItems( allItems, {\n\t\t\t\tallowReusable: true,\n\t\t\t} );\n\t\t\tconst filteredItems = searchItems( availableItems, filterValue );\n\n\t\t\treturn { blockTypes: filteredItems };\n\t\t},\n\t\t[ rootClientId, filterValue ]\n\t);\n\n\tconst { items, trackBlockTypeSelected } =\n\t\tuseBlockTypeImpressions( blockTypes );\n\n\tif ( ! items || items?.length === 0 ) {\n\t\treturn <InserterNoResults />;\n\t}\n\n\tconst handleSelect = ( ...args ) => {\n\t\ttrackBlockTypeSelected( ...args );\n\t\tonSelect( ...args );\n\t};\n\n\treturn (\n\t\t<BlockTypesList\n\t\t\tname=\"Blocks\"\n\t\t\tinitialNumToRender={ isFullScreen ? 10 : 3 }\n\t\t\tsections={ [ createInserterSection( { key: 'search', items } ) ] }\n\t\t\tonSelect={ handleSelect }\n\t\t\tlistProps={ listProps }\n\t\t\tlabel={ __( 'Blocks' ) }\n\t\t/>\n\t);\n}\n\nexport default InserterSearchResults;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,OAAOC,cAAc,MAAM,qBAAqB;AAChD,OAAOC,iBAAiB,MAAM,cAAc;AAC5C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,uBAAuB,MAAM,oCAAoC;AACxE,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,SAAS;AAEpE,SAASC,qBAAqBA,CAAE;EAC/BC,WAAW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NoResults","store","blockEditorStore","useBlockTypeImpressions","createInserterSection","filterInserterItems","InserterSearchResults","filterValue","onSelect","listProps","rootClientId","isFullScreen","inserterItems","select","items","getInserterItems","blockTypes","availableItems","allowReusable","trackBlockTypeSelected","length","createElement","handleSelect","args","name","initialNumToRender","sections","key","label"],"sources":["@wordpress/block-editor/src/components/inserter/search-results.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { searchItems } from './search-items';\nimport BlockTypesList from '../block-types-list';\nimport InserterNoResults from './no-results';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockTypeImpressions from './hooks/use-block-type-impressions';\nimport { createInserterSection, filterInserterItems } from './utils';\n\nfunction InserterSearchResults( {\n\tfilterValue,\n\tonSelect,\n\tlistProps,\n\trootClientId,\n\tisFullScreen,\n} ) {\n\tconst { inserterItems } = useSelect(\n\t\t( select ) => {\n\t\t\tconst items =\n\t\t\t\tselect( blockEditorStore ).getInserterItems( rootClientId );\n\n\t\t\treturn { inserterItems: items };\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\tconst blockTypes = useMemo( () => {\n\t\tconst availableItems = filterInserterItems( inserterItems, {\n\t\t\tallowReusable: true,\n\t\t} );\n\n\t\treturn searchItems( availableItems, filterValue );\n\t}, [ inserterItems, filterValue ] );\n\n\tconst { items, trackBlockTypeSelected } =\n\t\tuseBlockTypeImpressions( blockTypes );\n\n\tif ( ! items || items?.length === 0 ) {\n\t\treturn <InserterNoResults />;\n\t}\n\n\tconst handleSelect = ( ...args ) => {\n\t\ttrackBlockTypeSelected( ...args );\n\t\tonSelect( ...args );\n\t};\n\n\treturn (\n\t\t<BlockTypesList\n\t\t\tname=\"Blocks\"\n\t\t\tinitialNumToRender={ isFullScreen ? 10 : 3 }\n\t\t\tsections={ [ createInserterSection( { key: 'search', items } ) ] }\n\t\t\tonSelect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OAAOC,aAAA,CAACrB,iBAAiB,MAAE,CAAC;EAC7B;EAEA,MAAMsB,YAAY,GAAGA,CAAE,GAAGC,IAAI,KAAM;IACnCJ,sBAAsB,CAAE,GAAGI,IAAK,CAAC;IACjCf,QAAQ,CAAE,GAAGe,IAAK,CAAC;EACpB,CAAC;EAED,OACCF,aAAA,CAACtB,cAAc;IACdyB,IAAI,EAAC,QAAQ;IACbC,kBAAkB,EAAGd,YAAY,GAAG,EAAE,GAAG,CAAG;IAC5Ce,QAAQ,EAAG,CAAEtB,qBAAqB,CAAE;MAAEuB,GAAG,EAAE,QAAQ;MAAEb;IAAM,CAAE,CAAC,CAAI;IAClEN,QAAQ,EAAGc,YAAc;IACzBb,SAAS,EAAGA,SAAW;IACvBmB,KAAK,EAAGhC,EAAE,CAAE,QAAS;EAAG,CACxB,CAAC;AAEJ;AAEA,eAAeU,qBAAqB"}
@@ -29,7 +29,7 @@ export default function InspectorControlsFill({
29
29
  const isDisplayed = useDisplayBlockControls();
30
30
  const Fill = groups[group]?.Fill;
31
31
  if (!Fill) {
32
- typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warning(`Unknown InspectorControls group "${group}" provided.`) : void 0;
32
+ typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning(`Unknown InspectorControls group "${group}" provided.`) : void 0;
33
33
  return null;
34
34
  }
35
35
  if (!isDisplayed) {
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalStyleProvider","StyleProvider","__experimentalToolsPanelContext","ToolsPanelContext","warning","deprecated","useEffect","useDisplayBlockControls","groups","InspectorControlsFill","children","group","__experimentalGroup","resetAllFilter","since","version","alternative","isDisplayed","Fill","process","env","NODE_ENV","createElement","document","fillProps","ToolsPanelInspectorControl","registerResetAllFilter","deregisterResetAllFilter","value","Object","keys","length","Provider"],"sources":["@wordpress/block-editor/src/components/inspector-controls/fill.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalStyleProvider as StyleProvider,\n\t__experimentalToolsPanelContext as ToolsPanelContext,\n} from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useDisplayBlockControls from '../use-display-block-controls';\nimport groups from './groups';\n\nexport default function InspectorControlsFill( {\n\tchildren,\n\tgroup = 'default',\n\t__experimentalGroup,\n\tresetAllFilter,\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsFill`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\n\tconst isDisplayed = useDisplayBlockControls();\n\tconst Fill = groups[ group ]?.Fill;\n\tif ( ! Fill ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StyleProvider document={ document }>\n\t\t\t<Fill>\n\t\t\t\t{ ( fillProps ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ToolsPanelInspectorControl\n\t\t\t\t\t\t\tfillProps={ fillProps }\n\t\t\t\t\t\t\tchildren={ children }\n\t\t\t\t\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</Fill>\n\t\t</StyleProvider>\n\t);\n}\n\nfunction ToolsPanelInspectorControl( { children, resetAllFilter, fillProps } ) {\n\tconst { registerResetAllFilter, deregisterResetAllFilter } = fillProps;\n\tuseEffect( () => {\n\t\tif ( resetAllFilter && registerResetAllFilter ) {\n\t\t\tregisterResetAllFilter( resetAllFilter );\n\t\t}\n\t\treturn () => {\n\t\t\tif ( resetAllFilter && deregisterResetAllFilter ) {\n\t\t\t\tderegisterResetAllFilter( resetAllFilter );\n\t\t\t}\n\t\t};\n\t}, [ resetAllFilter, registerResetAllFilter, deregisterResetAllFilter ] );\n\n\t// Children passed to InspectorControlsFill will not have\n\t// access to any React Context whose Provider is part of\n\t// the InspectorControlsSlot tree. So we re-create the\n\t// Provider in this subtree.\n\tconst value =\n\t\tfillProps && Object.keys( fillProps ).length > 0 ? fillProps : null;\n\treturn (\n\t\t<ToolsPanelContext.Provider value={ value }>\n\t\t\t{ children }\n\t\t</ToolsPanelContext.Provider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,2BAA2B,IAAIC,aAAa,EAC5CC,+BAA+B,IAAIC,iBAAiB,QAC9C,uBAAuB;AAC9B,OAAOC,OAAO,MAAM,oBAAoB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,+BAA+B;AACnE,OAAOC,MAAM,MAAM,UAAU;AAE7B,eAAe,SAASC,qBAAqBA,CAAE;EAC9CC,QAAQ;EACRC,KAAK,GAAG,SAAS;EACjBC,mBAAmB;EACnBC;AACD,CAAC,EAAG;EACH,IAAKD,mBAAmB,EAAG;IAC1BP,UAAU,CACT,2DAA2D,EAC3D;MACCS,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE;IACd,CACD,CAAC;IACDL,KAAK,GAAGC,mBAAmB;EAC5B;EAEA,MAAMK,WAAW,GAAGV,uBAAuB,CAAC,CAAC;EAC7C,MAAMW,IAAI,GAAGV,MAAM,CAAEG,KAAK,CAAE,EAAEO,IAAI;EAClC,IAAK,CAAEA,IAAI,EAAG;IACb,OAAAC,OAAA,oBAAAA,OAAA,CAAAC,GAAA,IAAAD,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAjB,OAAO,CAAG,oCAAoCO,KAAO,aAAa,CAAC;IACnE,OAAO,IAAI;EACZ;EACA,IAAK,CAAEM,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OACCK,aAAA,CAACrB,aAAa;IAACsB,QAAQ,EAAGA;EAAU,GACnCD,aAAA,CAACJ,IAAI,QACAM,SAAS,IAAM;IAClB,OACCF,aAAA,CAACG,0BAA0B;MAC1BD,SAAS,EAAGA,SAAW;MACvBd,QAAQ,EAAGA,QAAU;MACrBG,cAAc,EAAGA;IAAgB,CACjC,CAAC;EAEJ,CACK,CACQ,CAAC;AAElB;AAEA,SAASY,0BAA0BA,CAAE;EAAEf,QAAQ;EAAEG,cAAc;EAAEW;AAAU,CAAC,EAAG;EAC9E,MAAM;IAAEE,sBAAsB;IAAEC;EAAyB,CAAC,GAAGH,SAAS;EACtElB,SAAS,CAAE,MAAM;IAChB,IAAKO,cAAc,IAAIa,sBAAsB,EAAG;MAC/CA,sBAAsB,CAAEb,cAAe,CAAC;IACzC;IACA,OAAO,MAAM;MACZ,IAAKA,cAAc,IAAIc,wBAAwB,EAAG;QACjDA,wBAAwB,CAAEd,cAAe,CAAC;MAC3C;IACD,CAAC;EACF,CAAC,EAAE,CAAEA,cAAc,EAAEa,sBAAsB,EAAEC,wBAAwB,CAAG,CAAC;;EAEzE;EACA;EACA;EACA;EACA,MAAMC,KAAK,GACVJ,SAAS,IAAIK,MAAM,CAACC,IAAI,CAAEN,SAAU,CAAC,CAACO,MAAM,GAAG,CAAC,GAAGP,SAAS,GAAG,IAAI;EACpE,OACCF,aAAA,CAACnB,iBAAiB,CAAC6B,QAAQ;IAACJ,KAAK,EAAGA;EAAO,GACxClB,QACyB,CAAC;AAE/B"}
1
+ {"version":3,"names":["__experimentalStyleProvider","StyleProvider","__experimentalToolsPanelContext","ToolsPanelContext","warning","deprecated","useEffect","useDisplayBlockControls","groups","InspectorControlsFill","children","group","__experimentalGroup","resetAllFilter","since","version","alternative","isDisplayed","Fill","SCRIPT_DEBUG","createElement","document","fillProps","ToolsPanelInspectorControl","registerResetAllFilter","deregisterResetAllFilter","value","Object","keys","length","Provider"],"sources":["@wordpress/block-editor/src/components/inspector-controls/fill.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalStyleProvider as StyleProvider,\n\t__experimentalToolsPanelContext as ToolsPanelContext,\n} from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useDisplayBlockControls from '../use-display-block-controls';\nimport groups from './groups';\n\nexport default function InspectorControlsFill( {\n\tchildren,\n\tgroup = 'default',\n\t__experimentalGroup,\n\tresetAllFilter,\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsFill`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\n\tconst isDisplayed = useDisplayBlockControls();\n\tconst Fill = groups[ group ]?.Fill;\n\tif ( ! Fill ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StyleProvider document={ document }>\n\t\t\t<Fill>\n\t\t\t\t{ ( fillProps ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ToolsPanelInspectorControl\n\t\t\t\t\t\t\tfillProps={ fillProps }\n\t\t\t\t\t\t\tchildren={ children }\n\t\t\t\t\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</Fill>\n\t\t</StyleProvider>\n\t);\n}\n\nfunction ToolsPanelInspectorControl( { children, resetAllFilter, fillProps } ) {\n\tconst { registerResetAllFilter, deregisterResetAllFilter } = fillProps;\n\tuseEffect( () => {\n\t\tif ( resetAllFilter && registerResetAllFilter ) {\n\t\t\tregisterResetAllFilter( resetAllFilter );\n\t\t}\n\t\treturn () => {\n\t\t\tif ( resetAllFilter && deregisterResetAllFilter ) {\n\t\t\t\tderegisterResetAllFilter( resetAllFilter );\n\t\t\t}\n\t\t};\n\t}, [ resetAllFilter, registerResetAllFilter, deregisterResetAllFilter ] );\n\n\t// Children passed to InspectorControlsFill will not have\n\t// access to any React Context whose Provider is part of\n\t// the InspectorControlsSlot tree. So we re-create the\n\t// Provider in this subtree.\n\tconst value =\n\t\tfillProps && Object.keys( fillProps ).length > 0 ? fillProps : null;\n\treturn (\n\t\t<ToolsPanelContext.Provider value={ value }>\n\t\t\t{ children }\n\t\t</ToolsPanelContext.Provider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,2BAA2B,IAAIC,aAAa,EAC5CC,+BAA+B,IAAIC,iBAAiB,QAC9C,uBAAuB;AAC9B,OAAOC,OAAO,MAAM,oBAAoB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,+BAA+B;AACnE,OAAOC,MAAM,MAAM,UAAU;AAE7B,eAAe,SAASC,qBAAqBA,CAAE;EAC9CC,QAAQ;EACRC,KAAK,GAAG,SAAS;EACjBC,mBAAmB;EACnBC;AACD,CAAC,EAAG;EACH,IAAKD,mBAAmB,EAAG;IAC1BP,UAAU,CACT,2DAA2D,EAC3D;MACCS,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE;IACd,CACD,CAAC;IACDL,KAAK,GAAGC,mBAAmB;EAC5B;EAEA,MAAMK,WAAW,GAAGV,uBAAuB,CAAC,CAAC;EAC7C,MAAMW,IAAI,GAAGV,MAAM,CAAEG,KAAK,CAAE,EAAEO,IAAI;EAClC,IAAK,CAAEA,IAAI,EAAG;IACb,OAAAC,YAAA,oBAAAA,YAAA,YAAAf,OAAO,CAAG,oCAAoCO,KAAO,aAAa,CAAC;IACnE,OAAO,IAAI;EACZ;EACA,IAAK,CAAEM,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OACCG,aAAA,CAACnB,aAAa;IAACoB,QAAQ,EAAGA;EAAU,GACnCD,aAAA,CAACF,IAAI,QACAI,SAAS,IAAM;IAClB,OACCF,aAAA,CAACG,0BAA0B;MAC1BD,SAAS,EAAGA,SAAW;MACvBZ,QAAQ,EAAGA,QAAU;MACrBG,cAAc,EAAGA;IAAgB,CACjC,CAAC;EAEJ,CACK,CACQ,CAAC;AAElB;AAEA,SAASU,0BAA0BA,CAAE;EAAEb,QAAQ;EAAEG,cAAc;EAAES;AAAU,CAAC,EAAG;EAC9E,MAAM;IAAEE,sBAAsB;IAAEC;EAAyB,CAAC,GAAGH,SAAS;EACtEhB,SAAS,CAAE,MAAM;IAChB,IAAKO,cAAc,IAAIW,sBAAsB,EAAG;MAC/CA,sBAAsB,CAAEX,cAAe,CAAC;IACzC;IACA,OAAO,MAAM;MACZ,IAAKA,cAAc,IAAIY,wBAAwB,EAAG;QACjDA,wBAAwB,CAAEZ,cAAe,CAAC;MAC3C;IACD,CAAC;EACF,CAAC,EAAE,CAAEA,cAAc,EAAEW,sBAAsB,EAAEC,wBAAwB,CAAG,CAAC;;EAEzE;EACA;EACA;EACA;EACA,MAAMC,KAAK,GACVJ,SAAS,IAAIK,MAAM,CAACC,IAAI,CAAEN,SAAU,CAAC,CAACO,MAAM,GAAG,CAAC,GAAGP,SAAS,GAAG,IAAI;EACpE,OACCF,aAAA,CAACjB,iBAAiB,CAAC2B,QAAQ;IAACJ,KAAK,EAAGA;EAAO,GACxChB,QACyB,CAAC;AAE/B"}
@@ -35,7 +35,7 @@ export default function InspectorControlsFill({
35
35
  const isDisplayed = useDisplayBlockControls();
36
36
  const Fill = groups[group]?.Fill;
37
37
  if (!Fill) {
38
- typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warning(`Unknown InspectorControls group "${group}" provided.`) : void 0;
38
+ typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning(`Unknown InspectorControls group "${group}" provided.`) : void 0;
39
39
  return null;
40
40
  }
41
41
  if (!isDisplayed) {
@@ -1 +1 @@
1
- {"version":3,"names":["View","Children","BottomSheetConsumer","warning","deprecated","groups","useDisplayBlockControls","BlockSettingsButton","InspectorControlsFill","children","group","__experimentalGroup","props","since","version","alternative","isDisplayed","Fill","process","env","NODE_ENV","createElement","Fragment","count"],"sources":["@wordpress/block-editor/src/components/inspector-controls/fill.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { BottomSheetConsumer } from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport groups from './groups';\nimport useDisplayBlockControls from '../use-display-block-controls';\nimport { BlockSettingsButton } from '../block-settings';\n\nexport default function InspectorControlsFill( {\n\tchildren,\n\tgroup = 'default',\n\t__experimentalGroup,\n\t...props\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsFill`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\tconst isDisplayed = useDisplayBlockControls();\n\n\tconst Fill = groups[ group ]?.Fill;\n\tif ( ! Fill ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Fill { ...props }>\n\t\t\t\t{\n\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t{ () => <View>{ children }</View> }\n\t\t\t\t\t</BottomSheetConsumer>\n\t\t\t\t}\n\t\t\t</Fill>\n\t\t\t{ Children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,KAAK,CAAEd,QAAS,CAAC,GAAG,CAAC,IAAIY,aAAA,CAACd,mBAAmB,MAAE,CACzD,CAAC;AAEL"}
1
+ {"version":3,"names":["View","Children","BottomSheetConsumer","warning","deprecated","groups","useDisplayBlockControls","BlockSettingsButton","InspectorControlsFill","children","group","__experimentalGroup","props","since","version","alternative","isDisplayed","Fill","SCRIPT_DEBUG","createElement","Fragment","count"],"sources":["@wordpress/block-editor/src/components/inspector-controls/fill.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { BottomSheetConsumer } from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport groups from './groups';\nimport useDisplayBlockControls from '../use-display-block-controls';\nimport { BlockSettingsButton } from '../block-settings';\n\nexport default function InspectorControlsFill( {\n\tchildren,\n\tgroup = 'default',\n\t__experimentalGroup,\n\t...props\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsFill`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\tconst isDisplayed = useDisplayBlockControls();\n\n\tconst Fill = groups[ group ]?.Fill;\n\tif ( ! Fill ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Fill { ...props }>\n\t\t\t\t{\n\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t{ () => <View>{ children }</View> }\n\t\t\t\t\t</BottomSheetConsumer>\n\t\t\t\t}\n\t\t\t</Fill>\n\t\t\t{ Children.count( children ) > 0 && <BlockSettingsButton /> }\n\t\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"}
@@ -29,7 +29,7 @@ export default function InspectorControlsSlot({
29
29
  const Slot = groups[group]?.Slot;
30
30
  const fills = useSlotFills(Slot?.__unstableName);
31
31
  if (!Slot) {
32
- typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warning(`Unknown InspectorControls group "${group}" provided.`) : void 0;
32
+ typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning(`Unknown InspectorControls group "${group}" provided.`) : void 0;
33
33
  return null;
34
34
  }
35
35
  if (!fills?.length) {
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalUseSlotFills","useSlotFills","warning","deprecated","BlockSupportToolsPanel","BlockSupportSlotContainer","groups","InspectorControlsSlot","__experimentalGroup","group","label","props","since","version","alternative","Slot","fills","__unstableName","process","env","NODE_ENV","length","createElement","bubblesVirtually"],"sources":["@wordpress/block-editor/src/components/inspector-controls/slot.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseSlotFills as useSlotFills } from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport BlockSupportToolsPanel from './block-support-tools-panel';\nimport BlockSupportSlotContainer from './block-support-slot-container';\nimport groups from './groups';\n\nexport default function InspectorControlsSlot( {\n\t__experimentalGroup,\n\tgroup = 'default',\n\tlabel,\n\t...props\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsSlot`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\tconst Slot = groups[ group ]?.Slot;\n\tconst fills = useSlotFills( Slot?.__unstableName );\n\tif ( ! Slot ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\n\tif ( ! fills?.length ) {\n\t\treturn null;\n\t}\n\n\tif ( label ) {\n\t\treturn (\n\t\t\t<BlockSupportToolsPanel group={ group } label={ label }>\n\t\t\t\t<BlockSupportSlotContainer { ...props } Slot={ Slot } />\n\t\t\t</BlockSupportToolsPanel>\n\t\t);\n\t}\n\n\treturn <Slot { ...props } bubblesVirtually />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,0BAA0B,IAAIC,YAAY,QAAQ,uBAAuB;AAClF,OAAOC,OAAO,MAAM,oBAAoB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,OAAOC,yBAAyB,MAAM,gCAAgC;AACtE,OAAOC,MAAM,MAAM,UAAU;AAE7B,eAAe,SAASC,qBAAqBA,CAAE;EAC9CC,mBAAmB;EACnBC,KAAK,GAAG,SAAS;EACjBC,KAAK;EACL,GAAGC;AACJ,CAAC,EAAG;EACH,IAAKH,mBAAmB,EAAG;IAC1BL,UAAU,CACT,2DAA2D,EAC3D;MACCS,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE;IACd,CACD,CAAC;IACDL,KAAK,GAAGD,mBAAmB;EAC5B;EACA,MAAMO,IAAI,GAAGT,MAAM,CAAEG,KAAK,CAAE,EAAEM,IAAI;EAClC,MAAMC,KAAK,GAAGf,YAAY,CAAEc,IAAI,EAAEE,cAAe,CAAC;EAClD,IAAK,CAAEF,IAAI,EAAG;IACb,OAAAG,OAAA,oBAAAA,OAAA,CAAAC,GAAA,IAAAD,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAlB,OAAO,CAAG,oCAAoCO,KAAO,aAAa,CAAC;IACnE,OAAO,IAAI;EACZ;EAEA,IAAK,CAAEO,KAAK,EAAEK,MAAM,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,IAAKX,KAAK,EAAG;IACZ,OACCY,aAAA,CAAClB,sBAAsB;MAACK,KAAK,EAAGA,KAAO;MAACC,KAAK,EAAGA;IAAO,GACtDY,aAAA,CAACjB,yBAAyB;MAAA,GAAMM,KAAK;MAAGI,IAAI,EAAGA;IAAM,CAAE,CAChC,CAAC;EAE3B;EAEA,OAAOO,aAAA,CAACP,IAAI;IAAA,GAAMJ,KAAK;IAAGY,gBAAgB;EAAA,CAAE,CAAC;AAC9C"}
1
+ {"version":3,"names":["__experimentalUseSlotFills","useSlotFills","warning","deprecated","BlockSupportToolsPanel","BlockSupportSlotContainer","groups","InspectorControlsSlot","__experimentalGroup","group","label","props","since","version","alternative","Slot","fills","__unstableName","SCRIPT_DEBUG","length","createElement","bubblesVirtually"],"sources":["@wordpress/block-editor/src/components/inspector-controls/slot.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseSlotFills as useSlotFills } from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport BlockSupportToolsPanel from './block-support-tools-panel';\nimport BlockSupportSlotContainer from './block-support-slot-container';\nimport groups from './groups';\n\nexport default function InspectorControlsSlot( {\n\t__experimentalGroup,\n\tgroup = 'default',\n\tlabel,\n\t...props\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsSlot`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\tconst Slot = groups[ group ]?.Slot;\n\tconst fills = useSlotFills( Slot?.__unstableName );\n\tif ( ! Slot ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\n\tif ( ! fills?.length ) {\n\t\treturn null;\n\t}\n\n\tif ( label ) {\n\t\treturn (\n\t\t\t<BlockSupportToolsPanel group={ group } label={ label }>\n\t\t\t\t<BlockSupportSlotContainer { ...props } Slot={ Slot } />\n\t\t\t</BlockSup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AAA,CAAE,CAAC;AAC9C"}
@@ -24,7 +24,7 @@ export default function InspectorControlsSlot({
24
24
  }
25
25
  const Slot = groups[group]?.Slot;
26
26
  if (!Slot) {
27
- typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warning(`Unknown InspectorControls group "${group}" provided.`) : void 0;
27
+ typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning(`Unknown InspectorControls group "${group}" provided.`) : void 0;
28
28
  return null;
29
29
  }
30
30
  return createElement(Slot, {
@@ -1 +1 @@
1
- {"version":3,"names":["warning","deprecated","groups","InspectorControlsSlot","__experimentalGroup","group","props","since","version","alternative","Slot","process","env","NODE_ENV","createElement"],"sources":["@wordpress/block-editor/src/components/inspector-controls/slot.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport groups from './groups';\n\nexport default function InspectorControlsSlot( {\n\t__experimentalGroup,\n\tgroup = 'default',\n\t...props\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsSlot`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\tconst Slot = groups[ group ]?.Slot;\n\tif ( ! Slot ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\n\treturn <Slot { ...props } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,OAAO,MAAM,oBAAoB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,UAAU;AAE7B,eAAe,SAASC,qBAAqBA,CAAE;EAC9CC,mBAAmB;EACnBC,KAAK,GAAG,SAAS;EACjB,GAAGC;AACJ,CAAC,EAAG;EACH,IAAKF,mBAAmB,EAAG;IAC1BH,UAAU,CACT,2DAA2D,EAC3D;MACCM,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE;IACd,CACD,CAAC;IACDJ,KAAK,GAAGD,mBAAmB;EAC5B;EACA,MAAMM,IAAI,GAAGR,MAAM,CAAEG,KAAK,CAAE,EAAEK,IAAI;EAClC,IAAK,CAAEA,IAAI,EAAG;IACb,OAAAC,OAAA,oBAAAA,OAAA,CAAAC,GAAA,IAAAD,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAb,OAAO,CAAG,oCAAoCK,KAAO,aAAa,CAAC;IACnE,OAAO,IAAI;EACZ;EAEA,OAAOS,aAAA,CAACJ,IAAI;IAAA,GAAMJ;EAAK,CAAI,CAAC;AAC7B"}
1
+ {"version":3,"names":["warning","deprecated","groups","InspectorControlsSlot","__experimentalGroup","group","props","since","version","alternative","Slot","SCRIPT_DEBUG","createElement"],"sources":["@wordpress/block-editor/src/components/inspector-controls/slot.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport groups from './groups';\n\nexport default function InspectorControlsSlot( {\n\t__experimentalGroup,\n\tgroup = 'default',\n\t...props\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsSlot`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\tconst Slot = groups[ group ]?.Slot;\n\tif ( ! Slot ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\n\treturn <Slot { ...props } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,OAAO,MAAM,oBAAoB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,UAAU;AAE7B,eAAe,SAASC,qBAAqBA,CAAE;EAC9CC,mBAAmB;EACnBC,KAAK,GAAG,SAAS;EACjB,GAAGC;AACJ,CAAC,EAAG;EACH,IAAKF,mBAAmB,EAAG;IAC1BH,UAAU,CACT,2DAA2D,EAC3D;MACCM,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE;IACd,CACD,CAAC;IACDJ,KAAK,GAAGD,mBAAmB;EAC5B;EACA,MAAMM,IAAI,GAAGR,MAAM,CAAEG,KAAK,CAAE,EAAEK,IAAI;EAClC,IAAK,CAAEA,IAAI,EAAG;IACb,OAAAC,YAAA,oBAAAA,YAAA,YAAAX,OAAO,CAAG,oCAAoCK,KAAO,aAAa,CAAC;IACnE,OAAO,IAAI;EACZ;EAEA,OAAOO,aAAA,CAACF,IAAI;IAAA,GAAMJ;EAAK,CAAI,CAAC;AAC7B"}
@@ -349,13 +349,7 @@ function LinkControl({
349
349
  settings: settings?.filter(({
350
350
  id
351
351
  }) => id === 'opensInNewTab'),
352
- onChange: ({
353
- opensInNewTab
354
- }) => {
355
- onChange({
356
- opensInNewTab
357
- });
358
- }
352
+ onChange: onChange
359
353
  });
360
354
  }
361
355
  },
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Button","Spinner","Notice","TextControl","__","useRef","useState","useEffect","focus","ENTER","isShallowEqualObjects","useSelect","useDispatch","store","preferencesStore","LinkControlSettingsDrawer","LinkControlSearchInput","LinkPreview","LinkSettings","useCreatePage","useInternalValue","ViewerFill","DEFAULT_LINK_SETTINGS","noop","PREFERENCE_SCOPE","PREFERENCE_KEY","LinkControl","searchInputPlaceholder","value","settings","onChange","onRemove","onCancel","noDirectEntry","showSuggestions","showInitialSuggestions","forceIsEditingLink","createSuggestion","withCreateSuggestion","inputValue","propInputValue","suggestionsQuery","noURLSuggestion","createSuggestionButtonText","hasRichPreviews","hasTextControl","renderControlBottom","undefined","settingsOpen","setSettingsOpen","advancedSettingsPreference","select","_prefsStore$get","prefsStore","get","set","setPreference","setSettingsOpenWithPreference","prefVal","isSettingsOpen","isMounting","wrapperNode","textInputRef","isEndingEditWithFocus","settingsKeys","map","id","internalControlValue","setInternalControlValue","setInternalURLInputValue","setInternalTextInputValue","createSetInternalSettingValueHandler","valueHasChanges","isEditingLink","setIsEditingLink","url","createPage","isCreatingPage","errorMessage","current","nextFocusTarget","focusable","find","hasLinkValue","trim","length","stopEditing","contains","ownerDocument","activeElement","handleSelectSuggestion","updatedValue","nonSettingsChanges","Object","keys","reduce","acc","key","includes","title","handleSubmit","currentUrlInputValue","handleSubmitWithEnter","event","keyCode","currentInputIsEmpty","preventDefault","resetInternalValues","handleCancel","stopPropagation","shownUnlinkControl","showActions","showTextControl","isEditing","isDisabled","showSettings","createElement","tabIndex","ref","className","Fragment","__nextHasNoMarginBottom","label","onKeyDown","size","currentLink","placeholder","onCreateSuggestion","onSelect","allowDirectEntry","withURLSuggestion","hideLabelFromVision","status","isDismissible","onEditClick","hasUnlinkControl","additionalControls","setting","filter","opensInNewTab","variant","onClick"],"sources":["@wordpress/block-editor/src/components/link-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Spinner, Notice, TextControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useRef, useState, useEffect } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\nimport { ENTER } from '@wordpress/keycodes';\nimport { isShallowEqualObjects } from '@wordpress/is-shallow-equal';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport LinkControlSettingsDrawer from './settings-drawer';\nimport LinkControlSearchInput from './search-input';\nimport LinkPreview from './link-preview';\nimport LinkSettings from './settings';\nimport useCreatePage from './use-create-page';\nimport useInternalValue from './use-internal-value';\nimport { ViewerFill } from './viewer-slot';\nimport { DEFAULT_LINK_SETTINGS } from './constants';\n\n/**\n * Default properties associated with a link control value.\n *\n * @typedef WPLinkControlDefaultValue\n *\n * @property {string} url Link URL.\n * @property {string=} title Link title.\n * @property {boolean=} opensInNewTab Whether link should open in a new browser\n * tab. This value is only assigned if not\n * providing a custom `settings` prop.\n */\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Custom settings values associated with a link.\n *\n * @typedef {{[setting:string]:any}} WPLinkControlSettingsValue\n */\n/* eslint-enable */\n\n/**\n * Custom settings values associated with a link.\n *\n * @typedef WPLinkControlSetting\n *\n * @property {string} id Identifier to use as property for setting value.\n * @property {string} title Human-readable label to show in user interface.\n */\n\n/**\n * Properties associated with a link control value, composed as a union of the\n * default properties and any custom settings values.\n *\n * @typedef {WPLinkControlDefaultValue&WPLinkControlSettingsValue} WPLinkControlValue\n */\n\n/** @typedef {(nextValue:WPLinkControlValue)=>void} WPLinkControlOnChangeProp */\n\n/**\n * Properties associated with a search suggestion used within the LinkControl.\n *\n * @typedef WPLinkControlSuggestion\n *\n * @property {string} id Identifier to use to uniquely identify the suggestion.\n * @property {string} type Identifies the type of the suggestion (eg: `post`,\n * `page`, `url`...etc)\n * @property {string} title Human-readable label to show in user interface.\n * @property {string} url A URL for the suggestion.\n */\n\n/** @typedef {(title:string)=>WPLinkControlSuggestion} WPLinkControlCreateSuggestionProp */\n\n/**\n * @typedef WPLinkControlProps\n *\n * @property {(WPLinkControlSetting[])=} settings An array of settings objects. Each object will used to\n * render a `ToggleControl` for that setting.\n * @property {boolean=} forceIsEditingLink If passed as either `true` or `false`, controls the\n * internal editing state of the component to respective\n * show or not show the URL input field.\n * @property {WPLinkControlValue=} value Current link value.\n * @property {WPLinkControlOnChangeProp=} onChange Value change handler, called with the updated value if\n * the user selects a new link or updates settings.\n * @property {boolean=} noDirectEntry Whether to allow turning a URL-like search query directly into a link.\n * @property {boolean=} showSuggestions Whether to present suggestions when typing the URL.\n * @property {boolean=} showInitialSuggestions Whether to present initial suggestions immediately.\n * @property {boolean=} withCreateSuggestion Whether to allow creation of link value from suggestion.\n * @property {Object=} suggestionsQuery Query parameters to pass along to wp.blockEditor.__experimentalFetchLinkSuggestions.\n * @property {boolean=} noURLSuggestion Whether to add a fallback suggestion which treats the search query as a URL.\n * @property {boolean=} hasTextControl Whether to add a text field to the UI to update the value.title.\n * @property {string|Function|undefined} createSuggestionButtonText The text to use in the button that calls createSuggestion.\n * @property {Function} renderControlBottom Optional controls to be rendered at the bottom of the component.\n */\n\nconst noop = () => {};\n\nconst PREFERENCE_SCOPE = 'core/block-editor';\nconst PREFERENCE_KEY = 'linkControlSettingsDrawer';\n\n/**\n * Renders a link control. A link control is a controlled input which maintains\n * a value associated with a link (HTML anchor element) and relevant settings\n * for how that link is expected to behave.\n *\n * @param {WPLinkControlProps} props Component props.\n */\nfunction LinkControl( {\n\tsearchInputPlaceholder,\n\tvalue,\n\tsettings = DEFAULT_LINK_SETTINGS,\n\tonChange = noop,\n\tonRemove,\n\tonCancel,\n\tnoDirectEntry = false,\n\tshowSuggestions = true,\n\tshowInitialSuggestions,\n\tforceIsEditingLink,\n\tcreateSuggestion,\n\twithCreateSuggestion,\n\tinputValue: propInputValue = '',\n\tsuggestionsQuery = {},\n\tnoURLSuggestion = false,\n\tcreateSuggestionButtonText,\n\thasRichPreviews = false,\n\thasTextControl = false,\n\trenderControlBottom = null,\n} ) {\n\tif ( withCreateSuggestion === undefined && createSuggestion ) {\n\t\twithCreateSuggestion = true;\n\t}\n\n\tconst [ settingsOpen, setSettingsOpen ] = useState( false );\n\n\tconst { advancedSettingsPreference } = useSelect( ( select ) => {\n\t\tconst prefsStore = select( preferencesStore );\n\n\t\treturn {\n\t\t\tadvancedSettingsPreference:\n\t\t\t\tprefsStore.get( PREFERENCE_SCOPE, PREFERENCE_KEY ) ?? false,\n\t\t};\n\t}, [] );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\t/**\n\t * Sets the open/closed state of the Advanced Settings Drawer,\n\t * optionlly persisting the state to the user's preferences.\n\t *\n\t * Note that Block Editor components can be consumed by non-WordPress\n\t * environments which may not have preferences setup.\n\t * Therefore a local state is also used as a fallback.\n\t *\n\t * @param {boolean} prefVal the open/closed state of the Advanced Settings Drawer.\n\t */\n\tconst setSettingsOpenWithPreference = ( prefVal ) => {\n\t\tif ( setPreference ) {\n\t\t\tsetPreference( PREFERENCE_SCOPE, PREFERENCE_KEY, prefVal );\n\t\t}\n\t\tsetSettingsOpen( prefVal );\n\t};\n\n\t// Block Editor components can be consumed by non-WordPress environments\n\t// which may not have these preferences setup.\n\t// Therefore a local state is used as a fallback.\n\tconst isSettingsOpen = advancedSettingsPreference || settingsOpen;\n\n\tconst isMounting = useRef( true );\n\tconst wrapperNode = useRef();\n\tconst textInputRef = useRef();\n\tconst isEndingEditWithFocus = useRef( false );\n\n\tconst settingsKeys = settings.map( ( { id } ) => id );\n\n\tconst [\n\t\tinternalControlValue,\n\t\tsetInternalControlValue,\n\t\tsetInternalURLInputValue,\n\t\tsetInternalTextInputValue,\n\t\tcreateSetInternalSettingValueHandler,\n\t] = useInternalValue( value );\n\n\tconst valueHasChanges =\n\t\tvalue && ! isShallowEqualObjects( internalControlValue, value );\n\n\tconst [ isEditingLink, setIsEditingLink ] = useState(\n\t\tforceIsEditingLink !== undefined\n\t\t\t? forceIsEditingLink\n\t\t\t: ! value || ! value.url\n\t);\n\n\tconst { createPage, isCreatingPage, errorMessage } =\n\t\tuseCreatePage( createSuggestion );\n\n\tuseEffect( () => {\n\t\tif ( forceIsEditingLink === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsEditingLink( forceIsEditingLink );\n\t}, [ forceIsEditingLink ] );\n\n\tuseEffect( () => {\n\t\t// We don't auto focus into the Link UI on mount\n\t\t// because otherwise using the keyboard to select text\n\t\t// *within* the link format is not possible.\n\t\tif ( isMounting.current ) {\n\t\t\tisMounting.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\t// Scenario - when:\n\t\t// - switching between editable and non editable LinkControl\n\t\t// - clicking on a link\n\t\t// ...then move focus to the *first* element to avoid focus loss\n\t\t// and to ensure focus is *within* the Link UI.\n\t\tconst nextFocusTarget =\n\t\t\tfocus.focusable.find( wrapperNode.current )[ 0 ] ||\n\t\t\twrapperNode.current;\n\n\t\tnextFocusTarget.focus();\n\n\t\tisEndingEditWithFocus.current = false;\n\t}, [ isEditingLink, isCreatingPage ] );\n\n\tconst hasLinkValue = value?.url?.trim()?.length > 0;\n\n\t/**\n\t * Cancels editing state and marks that focus may need to be restored after\n\t * the next render, if focus was within the wrapper when editing finished.\n\t */\n\tconst stopEditing = () => {\n\t\tisEndingEditWithFocus.current = !! wrapperNode.current?.contains(\n\t\t\twrapperNode.current.ownerDocument.activeElement\n\t\t);\n\n\t\tsetIsEditingLink( false );\n\t};\n\n\tconst handleSelectSuggestion = ( updatedValue ) => {\n\t\t// Suggestions may contains \"settings\" values (e.g. `opensInNewTab`)\n\t\t// which should not overide any existing settings values set by the\n\t\t// user. This filters out any settings values from the suggestion.\n\t\tconst nonSettingsChanges = Object.keys( updatedValue ).reduce(\n\t\t\t( acc, key ) => {\n\t\t\t\tif ( ! settingsKeys.includes( key ) ) {\n\t\t\t\t\tacc[ key ] = updatedValue[ key ];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\n\t\tonChange( {\n\t\t\t...internalControlValue,\n\t\t\t...nonSettingsChanges,\n\t\t\t// As title is not a setting, it must be manually applied\n\t\t\t// in such a way as to preserve the users changes over\n\t\t\t// any \"title\" value provided by the \"suggestion\".\n\t\t\ttitle: internalControlValue?.title || updatedValue?.title,\n\t\t} );\n\n\t\tstopEditing();\n\t};\n\n\tconst handleSubmit = () => {\n\t\tif ( valueHasChanges ) {\n\t\t\t// Submit the original value with new stored values applied\n\t\t\t// on top. URL is a special case as it may also be a prop.\n\t\t\tonChange( {\n\t\t\t\t...value,\n\t\t\t\t...internalControlValue,\n\t\t\t\turl: currentUrlInputValue,\n\t\t\t} );\n\t\t}\n\t\tstopEditing();\n\t};\n\n\tconst handleSubmitWithEnter = ( event ) => {\n\t\tconst { keyCode } = event;\n\n\t\tif (\n\t\t\tkeyCode === ENTER &&\n\t\t\t! currentInputIsEmpty // Disallow submitting empty values.\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\thandleSubmit();\n\t\t}\n\t};\n\n\tconst resetInternalValues = () => {\n\t\tsetInternalControlValue( value );\n\t};\n\n\tconst handleCancel = ( event ) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t// Ensure that any unsubmitted input changes are reset.\n\t\tresetInternalValues();\n\n\t\tif ( hasLinkValue ) {\n\t\t\t// If there is a link then exist editing mode and show preview.\n\t\t\tstopEditing();\n\t\t} else {\n\t\t\t// If there is no link value, then remove the link entirely.\n\t\t\tonRemove?.();\n\t\t}\n\n\t\tonCancel?.();\n\t};\n\n\tconst currentUrlInputValue =\n\t\tpropInputValue || internalControlValue?.url || '';\n\n\tconst currentInputIsEmpty = ! currentUrlInputValue?.trim()?.length;\n\n\tconst shownUnlinkControl =\n\t\tonRemove && value && ! isEditingLink && ! isCreatingPage;\n\n\tconst showActions = isEditingLink && hasLinkValue;\n\n\t// Only show text control once a URL value has been committed\n\t// and it isn't just empty whitespace.\n\t// See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927.\n\tconst showTextControl = hasLinkValue && hasTextControl;\n\n\tconst isEditing = ( isEditingLink || ! value ) && ! isCreatingPage;\n\tconst isDisabled = ! valueHasChanges || currentInputIsEmpty;\n\tconst showSettings = !! settings?.length && isEditingLink && hasLinkValue;\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={ -1 }\n\t\t\tref={ wrapperNode }\n\t\t\tclassName=\"block-editor-link-control\"\n\t\t>\n\t\t\t{ isCreatingPage && (\n\t\t\t\t<div className=\"block-editor-link-control__loading\">\n\t\t\t\t\t<Spinner /> { __( 'Creating' ) }…\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ isEditing && (\n\t\t\t\t<>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t\t'block-editor-link-control__search-input-wrapper': true,\n\t\t\t\t\t\t\t'has-text-control': showTextControl,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showTextControl && (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tref={ textInputRef }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__field block-editor-link-control__text-content\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\t\tvalue={ internalControlValue?.title }\n\t\t\t\t\t\t\t\tonChange={ setInternalTextInputValue }\n\t\t\t\t\t\t\t\tonKeyDown={ handleSubmitWithEnter }\n\t\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<LinkControlSearchInput\n\t\t\t\t\t\t\tcurrentLink={ value }\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__field block-editor-link-control__search-input\"\n\t\t\t\t\t\t\tplaceholder={ searchInputPlaceholder }\n\t\t\t\t\t\t\tvalue={ currentUrlInputValue }\n\t\t\t\t\t\t\twithCreateSuggestion={ withCreateSuggestion }\n\t\t\t\t\t\t\tonCreateSuggestion={ createPage }\n\t\t\t\t\t\t\tonChange={ setInternalURLInputValue }\n\t\t\t\t\t\t\tonSelect={ handleSelectSuggestion }\n\t\t\t\t\t\t\tshowInitialSuggestions={ showInitialSuggestions }\n\t\t\t\t\t\t\tallowDirectEntry={ ! noDirectEntry }\n\t\t\t\t\t\t\tshowSuggestions={ showSuggestions }\n\t\t\t\t\t\t\tsuggestionsQuery={ suggestionsQuery }\n\t\t\t\t\t\t\twithURLSuggestion={ ! noURLSuggestion }\n\t\t\t\t\t\t\tcreateSuggestionButtonText={\n\t\t\t\t\t\t\t\tcreateSuggestionButtonText\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thideLabelFromVision={ ! showTextControl }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t{ errorMessage && (\n\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__search-error\"\n\t\t\t\t\t\t\tstatus=\"error\"\n\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ errorMessage }\n\t\t\t\t\t\t</Notice>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ value && ! isEditingLink && ! isCreatingPage && (\n\t\t\t\t<LinkPreview\n\t\t\t\t\tkey={ value?.url } // force remount when URL changes to avoid race conditions for rich previews\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonEditClick={ () => setIsEditingLink( true ) }\n\t\t\t\t\thasRichPreviews={ hasRichPreviews }\n\t\t\t\t\thasUnlinkControl={ shownUnlinkControl }\n\t\t\t\t\tadditionalControls={ () => {\n\t\t\t\t\t\t// Expose the \"Opens in new tab\" settings in the preview\n\t\t\t\t\t\t// as it is the most common setting to change.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tsettings?.find(\n\t\t\t\t\t\t\t\t( setting ) => setting.id === 'opensInNewTab'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<LinkSettings\n\t\t\t\t\t\t\t\t\tvalue={ internalControlValue }\n\t\t\t\t\t\t\t\t\tsettings={ settings?.filter(\n\t\t\t\t\t\t\t\t\t\t( { id } ) => id === 'opensInNewTab'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tonChange={ ( { opensInNewTab } ) => {\n\t\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t\topensInNewTab,\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\tsetIsEditingLink( true );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ showSettings && (\n\t\t\t\t<div className=\"block-editor-link-control__tools\">\n\t\t\t\t\t{ ! currentInputIsEmpty && (\n\t\t\t\t\t\t<LinkControlSettingsDrawer\n\t\t\t\t\t\t\tsettingsOpen={ isSettingsOpen }\n\t\t\t\t\t\t\tsetSettingsOpen={ setSettingsOpenWithPreference }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LinkSettings\n\t\t\t\t\t\t\t\tvalue={ internalControlValue }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\tonChange={ createSetInternalSettingValueHandler(\n\t\t\t\t\t\t\t\t\tsettingsKeys\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</LinkControlSettingsDrawer>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ showActions && (\n\t\t\t\t<div className=\"block-editor-link-control__search-actions\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ isDisabled ? noop : handleSubmit }\n\t\t\t\t\t\tclassName=\"block-editor-link-control__search-submit\"\n\t\t\t\t\t\taria-disabled={ isDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button variant=\"tertiary\" onClick={ handleCancel }>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ renderControlBottom && renderControlBottom() }\n\t\t</div>\n\t);\n}\n\nLinkControl.ViewerFill = ViewerFill;\n\nexport default LinkControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AAChE,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,KAAK,QAAQ,qBAAqB;AAC3C,SAASC,qBAAqB,QAAQ,6BAA6B;AACnE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,yBAAyB,MAAM,mBAAmB;AACzD,OAAOC,sBAAsB,MAAM,gBAAgB;AACnD,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,YAAY,MAAM,YAAY;AACrC,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,qBAAqB,QAAQ,aAAa;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,MAAMC,gBAAgB,GAAG,mBAAmB;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,IACbC,aAAA;IAAKG,SAAS,EAAC;EAAkC,GAC9C,CAAEd,mBAAmB,IACtBW,aAAA,CAACrG,yBAAyB;IACzBiC,YAAY,EAAGW,cAAgB;IAC/BV,eAAe,EAAGQ;EAA+B,GAEjD2D,aAAA,CAAClG,YAAY;IACZU,KAAK,EAAGuC,oBAAsB;IAC9BtC,QAAQ,EAAGA,QAAU;IACrBC,QAAQ,EAAGyC,oCAAoC,CAC9CP,YACD;EAAG,CACH,CACyB,CAExB,CACL,EAEC+C,WAAW,IACZK,aAAA;IAAKG,SAAS,EAAC;EAA2C,GACzDH,aAAA,CAACpH,MAAM;IACN4I,OAAO,EAAC,SAAS;IACjBC,OAAO,EAAG3B,UAAU,GAAG3F,IAAI,GAAG6E,YAAc;IAC5CmB,SAAS,EAAC,0CAA0C;IACpD,iBAAgBL;EAAY,GAE1B9G,EAAE,CAAE,MAAO,CACN,CAAC,EACTgH,aAAA,CAACpH,MAAM;IAAC4I,OAAO,EAAC,UAAU;IAACC,OAAO,EAAGjC;EAAc,GAChDxG,EAAE,CAAE,QAAS,CACR,CACJ,CACL,EAEC0C,mBAAmB,IAAIA,mBAAmB,CAAC,CACzC,CAAC;AAER;AAEApB,WAAW,CAACL,UAAU,GAAGA,UAAU;AAEnC,eAAeK,WAAW"}
1
+ {"version":3,"names":["classnames","Button","Spinner","Notice","TextControl","__","useRef","useState","useEffect","focus","ENTER","isShallowEqualObjects","useSelect","useDispatch","store","preferencesStore","LinkControlSettingsDrawer","LinkControlSearchInput","LinkPreview","LinkSettings","useCreatePage","useInternalValue","ViewerFill","DEFAULT_LINK_SETTINGS","noop","PREFERENCE_SCOPE","PREFERENCE_KEY","LinkControl","searchInputPlaceholder","value","settings","onChange","onRemove","onCancel","noDirectEntry","showSuggestions","showInitialSuggestions","forceIsEditingLink","createSuggestion","withCreateSuggestion","inputValue","propInputValue","suggestionsQuery","noURLSuggestion","createSuggestionButtonText","hasRichPreviews","hasTextControl","renderControlBottom","undefined","settingsOpen","setSettingsOpen","advancedSettingsPreference","select","_prefsStore$get","prefsStore","get","set","setPreference","setSettingsOpenWithPreference","prefVal","isSettingsOpen","isMounting","wrapperNode","textInputRef","isEndingEditWithFocus","settingsKeys","map","id","internalControlValue","setInternalControlValue","setInternalURLInputValue","setInternalTextInputValue","createSetInternalSettingValueHandler","valueHasChanges","isEditingLink","setIsEditingLink","url","createPage","isCreatingPage","errorMessage","current","nextFocusTarget","focusable","find","hasLinkValue","trim","length","stopEditing","contains","ownerDocument","activeElement","handleSelectSuggestion","updatedValue","nonSettingsChanges","Object","keys","reduce","acc","key","includes","title","handleSubmit","currentUrlInputValue","handleSubmitWithEnter","event","keyCode","currentInputIsEmpty","preventDefault","resetInternalValues","handleCancel","stopPropagation","shownUnlinkControl","showActions","showTextControl","isEditing","isDisabled","showSettings","createElement","tabIndex","ref","className","Fragment","__nextHasNoMarginBottom","label","onKeyDown","size","currentLink","placeholder","onCreateSuggestion","onSelect","allowDirectEntry","withURLSuggestion","hideLabelFromVision","status","isDismissible","onEditClick","hasUnlinkControl","additionalControls","setting","filter","variant","onClick"],"sources":["@wordpress/block-editor/src/components/link-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Spinner, Notice, TextControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useRef, useState, useEffect } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\nimport { ENTER } from '@wordpress/keycodes';\nimport { isShallowEqualObjects } from '@wordpress/is-shallow-equal';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport LinkControlSettingsDrawer from './settings-drawer';\nimport LinkControlSearchInput from './search-input';\nimport LinkPreview from './link-preview';\nimport LinkSettings from './settings';\nimport useCreatePage from './use-create-page';\nimport useInternalValue from './use-internal-value';\nimport { ViewerFill } from './viewer-slot';\nimport { DEFAULT_LINK_SETTINGS } from './constants';\n\n/**\n * Default properties associated with a link control value.\n *\n * @typedef WPLinkControlDefaultValue\n *\n * @property {string} url Link URL.\n * @property {string=} title Link title.\n * @property {boolean=} opensInNewTab Whether link should open in a new browser\n * tab. This value is only assigned if not\n * providing a custom `settings` prop.\n */\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Custom settings values associated with a link.\n *\n * @typedef {{[setting:string]:any}} WPLinkControlSettingsValue\n */\n/* eslint-enable */\n\n/**\n * Custom settings values associated with a link.\n *\n * @typedef WPLinkControlSetting\n *\n * @property {string} id Identifier to use as property for setting value.\n * @property {string} title Human-readable label to show in user interface.\n */\n\n/**\n * Properties associated with a link control value, composed as a union of the\n * default properties and any custom settings values.\n *\n * @typedef {WPLinkControlDefaultValue&WPLinkControlSettingsValue} WPLinkControlValue\n */\n\n/** @typedef {(nextValue:WPLinkControlValue)=>void} WPLinkControlOnChangeProp */\n\n/**\n * Properties associated with a search suggestion used within the LinkControl.\n *\n * @typedef WPLinkControlSuggestion\n *\n * @property {string} id Identifier to use to uniquely identify the suggestion.\n * @property {string} type Identifies the type of the suggestion (eg: `post`,\n * `page`, `url`...etc)\n * @property {string} title Human-readable label to show in user interface.\n * @property {string} url A URL for the suggestion.\n */\n\n/** @typedef {(title:string)=>WPLinkControlSuggestion} WPLinkControlCreateSuggestionProp */\n\n/**\n * @typedef WPLinkControlProps\n *\n * @property {(WPLinkControlSetting[])=} settings An array of settings objects. Each object will used to\n * render a `ToggleControl` for that setting.\n * @property {boolean=} forceIsEditingLink If passed as either `true` or `false`, controls the\n * internal editing state of the component to respective\n * show or not show the URL input field.\n * @property {WPLinkControlValue=} value Current link value.\n * @property {WPLinkControlOnChangeProp=} onChange Value change handler, called with the updated value if\n * the user selects a new link or updates settings.\n * @property {boolean=} noDirectEntry Whether to allow turning a URL-like search query directly into a link.\n * @property {boolean=} showSuggestions Whether to present suggestions when typing the URL.\n * @property {boolean=} showInitialSuggestions Whether to present initial suggestions immediately.\n * @property {boolean=} withCreateSuggestion Whether to allow creation of link value from suggestion.\n * @property {Object=} suggestionsQuery Query parameters to pass along to wp.blockEditor.__experimentalFetchLinkSuggestions.\n * @property {boolean=} noURLSuggestion Whether to add a fallback suggestion which treats the search query as a URL.\n * @property {boolean=} hasTextControl Whether to add a text field to the UI to update the value.title.\n * @property {string|Function|undefined} createSuggestionButtonText The text to use in the button that calls createSuggestion.\n * @property {Function} renderControlBottom Optional controls to be rendered at the bottom of the component.\n */\n\nconst noop = () => {};\n\nconst PREFERENCE_SCOPE = 'core/block-editor';\nconst PREFERENCE_KEY = 'linkControlSettingsDrawer';\n\n/**\n * Renders a link control. A link control is a controlled input which maintains\n * a value associated with a link (HTML anchor element) and relevant settings\n * for how that link is expected to behave.\n *\n * @param {WPLinkControlProps} props Component props.\n */\nfunction LinkControl( {\n\tsearchInputPlaceholder,\n\tvalue,\n\tsettings = DEFAULT_LINK_SETTINGS,\n\tonChange = noop,\n\tonRemove,\n\tonCancel,\n\tnoDirectEntry = false,\n\tshowSuggestions = true,\n\tshowInitialSuggestions,\n\tforceIsEditingLink,\n\tcreateSuggestion,\n\twithCreateSuggestion,\n\tinputValue: propInputValue = '',\n\tsuggestionsQuery = {},\n\tnoURLSuggestion = false,\n\tcreateSuggestionButtonText,\n\thasRichPreviews = false,\n\thasTextControl = false,\n\trenderControlBottom = null,\n} ) {\n\tif ( withCreateSuggestion === undefined && createSuggestion ) {\n\t\twithCreateSuggestion = true;\n\t}\n\n\tconst [ settingsOpen, setSettingsOpen ] = useState( false );\n\n\tconst { advancedSettingsPreference } = useSelect( ( select ) => {\n\t\tconst prefsStore = select( preferencesStore );\n\n\t\treturn {\n\t\t\tadvancedSettingsPreference:\n\t\t\t\tprefsStore.get( PREFERENCE_SCOPE, PREFERENCE_KEY ) ?? false,\n\t\t};\n\t}, [] );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\t/**\n\t * Sets the open/closed state of the Advanced Settings Drawer,\n\t * optionlly persisting the state to the user's preferences.\n\t *\n\t * Note that Block Editor components can be consumed by non-WordPress\n\t * environments which may not have preferences setup.\n\t * Therefore a local state is also used as a fallback.\n\t *\n\t * @param {boolean} prefVal the open/closed state of the Advanced Settings Drawer.\n\t */\n\tconst setSettingsOpenWithPreference = ( prefVal ) => {\n\t\tif ( setPreference ) {\n\t\t\tsetPreference( PREFERENCE_SCOPE, PREFERENCE_KEY, prefVal );\n\t\t}\n\t\tsetSettingsOpen( prefVal );\n\t};\n\n\t// Block Editor components can be consumed by non-WordPress environments\n\t// which may not have these preferences setup.\n\t// Therefore a local state is used as a fallback.\n\tconst isSettingsOpen = advancedSettingsPreference || settingsOpen;\n\n\tconst isMounting = useRef( true );\n\tconst wrapperNode = useRef();\n\tconst textInputRef = useRef();\n\tconst isEndingEditWithFocus = useRef( false );\n\n\tconst settingsKeys = settings.map( ( { id } ) => id );\n\n\tconst [\n\t\tinternalControlValue,\n\t\tsetInternalControlValue,\n\t\tsetInternalURLInputValue,\n\t\tsetInternalTextInputValue,\n\t\tcreateSetInternalSettingValueHandler,\n\t] = useInternalValue( value );\n\n\tconst valueHasChanges =\n\t\tvalue && ! isShallowEqualObjects( internalControlValue, value );\n\n\tconst [ isEditingLink, setIsEditingLink ] = useState(\n\t\tforceIsEditingLink !== undefined\n\t\t\t? forceIsEditingLink\n\t\t\t: ! value || ! value.url\n\t);\n\n\tconst { createPage, isCreatingPage, errorMessage } =\n\t\tuseCreatePage( createSuggestion );\n\n\tuseEffect( () => {\n\t\tif ( forceIsEditingLink === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsEditingLink( forceIsEditingLink );\n\t}, [ forceIsEditingLink ] );\n\n\tuseEffect( () => {\n\t\t// We don't auto focus into the Link UI on mount\n\t\t// because otherwise using the keyboard to select text\n\t\t// *within* the link format is not possible.\n\t\tif ( isMounting.current ) {\n\t\t\tisMounting.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\t// Scenario - when:\n\t\t// - switching between editable and non editable LinkControl\n\t\t// - clicking on a link\n\t\t// ...then move focus to the *first* element to avoid focus loss\n\t\t// and to ensure focus is *within* the Link UI.\n\t\tconst nextFocusTarget =\n\t\t\tfocus.focusable.find( wrapperNode.current )[ 0 ] ||\n\t\t\twrapperNode.current;\n\n\t\tnextFocusTarget.focus();\n\n\t\tisEndingEditWithFocus.current = false;\n\t}, [ isEditingLink, isCreatingPage ] );\n\n\tconst hasLinkValue = value?.url?.trim()?.length > 0;\n\n\t/**\n\t * Cancels editing state and marks that focus may need to be restored after\n\t * the next render, if focus was within the wrapper when editing finished.\n\t */\n\tconst stopEditing = () => {\n\t\tisEndingEditWithFocus.current = !! wrapperNode.current?.contains(\n\t\t\twrapperNode.current.ownerDocument.activeElement\n\t\t);\n\n\t\tsetIsEditingLink( false );\n\t};\n\n\tconst handleSelectSuggestion = ( updatedValue ) => {\n\t\t// Suggestions may contains \"settings\" values (e.g. `opensInNewTab`)\n\t\t// which should not overide any existing settings values set by the\n\t\t// user. This filters out any settings values from the suggestion.\n\t\tconst nonSettingsChanges = Object.keys( updatedValue ).reduce(\n\t\t\t( acc, key ) => {\n\t\t\t\tif ( ! settingsKeys.includes( key ) ) {\n\t\t\t\t\tacc[ key ] = updatedValue[ key ];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\n\t\tonChange( {\n\t\t\t...internalControlValue,\n\t\t\t...nonSettingsChanges,\n\t\t\t// As title is not a setting, it must be manually applied\n\t\t\t// in such a way as to preserve the users changes over\n\t\t\t// any \"title\" value provided by the \"suggestion\".\n\t\t\ttitle: internalControlValue?.title || updatedValue?.title,\n\t\t} );\n\n\t\tstopEditing();\n\t};\n\n\tconst handleSubmit = () => {\n\t\tif ( valueHasChanges ) {\n\t\t\t// Submit the original value with new stored values applied\n\t\t\t// on top. URL is a special case as it may also be a prop.\n\t\t\tonChange( {\n\t\t\t\t...value,\n\t\t\t\t...internalControlValue,\n\t\t\t\turl: currentUrlInputValue,\n\t\t\t} );\n\t\t}\n\t\tstopEditing();\n\t};\n\n\tconst handleSubmitWithEnter = ( event ) => {\n\t\tconst { keyCode } = event;\n\n\t\tif (\n\t\t\tkeyCode === ENTER &&\n\t\t\t! currentInputIsEmpty // Disallow submitting empty values.\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\thandleSubmit();\n\t\t}\n\t};\n\n\tconst resetInternalValues = () => {\n\t\tsetInternalControlValue( value );\n\t};\n\n\tconst handleCancel = ( event ) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t// Ensure that any unsubmitted input changes are reset.\n\t\tresetInternalValues();\n\n\t\tif ( hasLinkValue ) {\n\t\t\t// If there is a link then exist editing mode and show preview.\n\t\t\tstopEditing();\n\t\t} else {\n\t\t\t// If there is no link value, then remove the link entirely.\n\t\t\tonRemove?.();\n\t\t}\n\n\t\tonCancel?.();\n\t};\n\n\tconst currentUrlInputValue =\n\t\tpropInputValue || internalControlValue?.url || '';\n\n\tconst currentInputIsEmpty = ! currentUrlInputValue?.trim()?.length;\n\n\tconst shownUnlinkControl =\n\t\tonRemove && value && ! isEditingLink && ! isCreatingPage;\n\n\tconst showActions = isEditingLink && hasLinkValue;\n\n\t// Only show text control once a URL value has been committed\n\t// and it isn't just empty whitespace.\n\t// See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927.\n\tconst showTextControl = hasLinkValue && hasTextControl;\n\n\tconst isEditing = ( isEditingLink || ! value ) && ! isCreatingPage;\n\tconst isDisabled = ! valueHasChanges || currentInputIsEmpty;\n\tconst showSettings = !! settings?.length && isEditingLink && hasLinkValue;\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={ -1 }\n\t\t\tref={ wrapperNode }\n\t\t\tclassName=\"block-editor-link-control\"\n\t\t>\n\t\t\t{ isCreatingPage && (\n\t\t\t\t<div className=\"block-editor-link-control__loading\">\n\t\t\t\t\t<Spinner /> { __( 'Creating' ) }…\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ isEditing && (\n\t\t\t\t<>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t\t'block-editor-link-control__search-input-wrapper': true,\n\t\t\t\t\t\t\t'has-text-control': showTextControl,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showTextControl && (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tref={ textInputRef }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__field block-editor-link-control__text-content\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\t\tvalue={ internalControlValue?.title }\n\t\t\t\t\t\t\t\tonChange={ setInternalTextInputValue }\n\t\t\t\t\t\t\t\tonKeyDown={ handleSubmitWithEnter }\n\t\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<LinkControlSearchInput\n\t\t\t\t\t\t\tcurrentLink={ value }\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__field block-editor-link-control__search-input\"\n\t\t\t\t\t\t\tplaceholder={ searchInputPlaceholder }\n\t\t\t\t\t\t\tvalue={ currentUrlInputValue }\n\t\t\t\t\t\t\twithCreateSuggestion={ withCreateSuggestion }\n\t\t\t\t\t\t\tonCreateSuggestion={ createPage }\n\t\t\t\t\t\t\tonChange={ setInternalURLInputValue }\n\t\t\t\t\t\t\tonSelect={ handleSelectSuggestion }\n\t\t\t\t\t\t\tshowInitialSuggestions={ showInitialSuggestions }\n\t\t\t\t\t\t\tallowDirectEntry={ ! noDirectEntry }\n\t\t\t\t\t\t\tshowSuggestions={ showSuggestions }\n\t\t\t\t\t\t\tsuggestionsQuery={ suggestionsQuery }\n\t\t\t\t\t\t\twithURLSuggestion={ ! noURLSuggestion }\n\t\t\t\t\t\t\tcreateSuggestionButtonText={\n\t\t\t\t\t\t\t\tcreateSuggestionButtonText\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thideLabelFromVision={ ! showTextControl }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t{ errorMessage && (\n\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__search-error\"\n\t\t\t\t\t\t\tstatus=\"error\"\n\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ errorMessage }\n\t\t\t\t\t\t</Notice>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ value && ! isEditingLink && ! isCreatingPage && (\n\t\t\t\t<LinkPreview\n\t\t\t\t\tkey={ value?.url } // force remount when URL changes to avoid race conditions for rich previews\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonEditClick={ () => setIsEditingLink( true ) }\n\t\t\t\t\thasRichPreviews={ hasRichPreviews }\n\t\t\t\t\thasUnlinkControl={ shownUnlinkControl }\n\t\t\t\t\tadditionalControls={ () => {\n\t\t\t\t\t\t// Expose the \"Opens in new tab\" settings in the preview\n\t\t\t\t\t\t// as it is the most common setting to change.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tsettings?.find(\n\t\t\t\t\t\t\t\t( setting ) => setting.id === 'opensInNewTab'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<LinkSettings\n\t\t\t\t\t\t\t\t\tvalue={ internalControlValue }\n\t\t\t\t\t\t\t\t\tsettings={ settings?.filter(\n\t\t\t\t\t\t\t\t\t\t( { id } ) => id === 'opensInNewTab'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\tsetIsEditingLink( true );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ showSettings && (\n\t\t\t\t<div className=\"block-editor-link-control__tools\">\n\t\t\t\t\t{ ! currentInputIsEmpty && (\n\t\t\t\t\t\t<LinkControlSettingsDrawer\n\t\t\t\t\t\t\tsettingsOpen={ isSettingsOpen }\n\t\t\t\t\t\t\tsetSettingsOpen={ setSettingsOpenWithPreference }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LinkSettings\n\t\t\t\t\t\t\t\tvalue={ internalControlValue }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\tonChange={ createSetInternalSettingValueHandler(\n\t\t\t\t\t\t\t\t\tsettingsKeys\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</LinkControlSettingsDrawer>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ showActions && (\n\t\t\t\t<div className=\"block-editor-link-control__search-actions\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ isDisabled ? noop : handleSubmit }\n\t\t\t\t\t\tclassName=\"block-editor-link-control__search-submit\"\n\t\t\t\t\t\taria-disabled={ isDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button variant=\"tertiary\" onClick={ handleCancel }>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ renderControlBottom && renderControlBottom() }\n\t\t</div>\n\t);\n}\n\nLinkControl.ViewerFill = ViewerFill;\n\nexport default LinkControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,OAAO,EAAEC,M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