@wordpress/block-editor 12.3.5 → 12.3.7

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 (76) hide show
  1. package/build/components/block-draggable/index.js +6 -3
  2. package/build/components/block-draggable/index.js.map +1 -1
  3. package/build/components/iframe/index.js +21 -46
  4. package/build/components/iframe/index.js.map +1 -1
  5. package/build/components/inserter/reusable-block-rename-hint.js +1 -1
  6. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
  7. package/build/components/link-control/constants.js +1 -1
  8. package/build/components/link-control/constants.js.map +1 -1
  9. package/build/components/link-control/search-create-button.js +5 -21
  10. package/build/components/link-control/search-create-button.js.map +1 -1
  11. package/build/components/link-control/search-item.js +13 -30
  12. package/build/components/link-control/search-item.js.map +1 -1
  13. package/build/components/link-control/search-results.js +2 -2
  14. package/build/components/link-control/search-results.js.map +1 -1
  15. package/build/components/rich-text/content.js +0 -36
  16. package/build/components/rich-text/content.js.map +1 -1
  17. package/build/components/rich-text/get-rich-text-values.js +112 -0
  18. package/build/components/rich-text/get-rich-text-values.js.map +1 -0
  19. package/build/components/use-block-display-information/index.js +7 -3
  20. package/build/components/use-block-display-information/index.js.map +1 -1
  21. package/build/hooks/margin.js +1 -1
  22. package/build/hooks/margin.js.map +1 -1
  23. package/build/hooks/padding.js +1 -1
  24. package/build/hooks/padding.js.map +1 -1
  25. package/build/private-apis.js +2 -2
  26. package/build/private-apis.js.map +1 -1
  27. package/build/store/selectors.js +1 -1
  28. package/build/store/selectors.js.map +1 -1
  29. package/build-module/components/block-draggable/index.js +6 -3
  30. package/build-module/components/block-draggable/index.js.map +1 -1
  31. package/build-module/components/iframe/index.js +22 -47
  32. package/build-module/components/iframe/index.js.map +1 -1
  33. package/build-module/components/inserter/reusable-block-rename-hint.js +1 -1
  34. package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -1
  35. package/build-module/components/link-control/constants.js +1 -1
  36. package/build-module/components/link-control/constants.js.map +1 -1
  37. package/build-module/components/link-control/search-create-button.js +7 -20
  38. package/build-module/components/link-control/search-create-button.js.map +1 -1
  39. package/build-module/components/link-control/search-item.js +14 -28
  40. package/build-module/components/link-control/search-item.js.map +1 -1
  41. package/build-module/components/link-control/search-results.js +3 -3
  42. package/build-module/components/link-control/search-results.js.map +1 -1
  43. package/build-module/components/rich-text/content.js +1 -36
  44. package/build-module/components/rich-text/content.js.map +1 -1
  45. package/build-module/components/rich-text/get-rich-text-values.js +99 -0
  46. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -0
  47. package/build-module/components/use-block-display-information/index.js +7 -3
  48. package/build-module/components/use-block-display-information/index.js.map +1 -1
  49. package/build-module/hooks/margin.js +1 -1
  50. package/build-module/hooks/margin.js.map +1 -1
  51. package/build-module/hooks/padding.js +1 -1
  52. package/build-module/hooks/padding.js.map +1 -1
  53. package/build-module/private-apis.js +1 -1
  54. package/build-module/private-apis.js.map +1 -1
  55. package/build-module/store/selectors.js +1 -1
  56. package/build-module/store/selectors.js.map +1 -1
  57. package/build-style/style-rtl.css +20 -83
  58. package/build-style/style.css +20 -83
  59. package/package.json +5 -5
  60. package/src/components/block-draggable/index.js +13 -4
  61. package/src/components/iframe/index.js +16 -47
  62. package/src/components/inserter/reusable-block-rename-hint.js +1 -1
  63. package/src/components/link-control/constants.js +1 -1
  64. package/src/components/link-control/search-create-button.js +8 -26
  65. package/src/components/link-control/search-item.js +21 -43
  66. package/src/components/link-control/search-results.js +48 -46
  67. package/src/components/link-control/style.scss +25 -95
  68. package/src/components/link-control/test/index.js +6 -7
  69. package/src/components/rich-text/content.js +1 -46
  70. package/src/components/rich-text/get-rich-text-values.js +95 -0
  71. package/src/components/use-block-display-information/index.js +12 -5
  72. package/src/hooks/margin.js +4 -1
  73. package/src/hooks/padding.js +4 -1
  74. package/src/private-apis.js +1 -1
  75. package/src/store/selectors.js +1 -1
  76. package/src/store/test/selectors.js +1 -1
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getRichTextValues = getRichTextValues;
9
+
10
+ var _element = require("@wordpress/element");
11
+
12
+ var _blocks = require("@wordpress/blocks");
13
+
14
+ var _innerBlocks = _interopRequireDefault(require("../inner-blocks"));
15
+
16
+ var _content = require("./content");
17
+
18
+ /**
19
+ * WordPress dependencies
20
+ */
21
+
22
+ /**
23
+ * Internal dependencies
24
+ */
25
+
26
+ /*
27
+ * This function is similar to `@wordpress/element`'s `renderToString` function,
28
+ * except that it does not render the elements to a string, but instead collects
29
+ * the values of all rich text `Content` elements.
30
+ */
31
+ function addValuesForElement(element, ...args) {
32
+ if (null === element || undefined === element || false === element) {
33
+ return;
34
+ }
35
+
36
+ if (Array.isArray(element)) {
37
+ return addValuesForElements(element, ...args);
38
+ }
39
+
40
+ switch (typeof element) {
41
+ case 'string':
42
+ case 'number':
43
+ return;
44
+ }
45
+
46
+ const {
47
+ type,
48
+ props
49
+ } = element;
50
+
51
+ switch (type) {
52
+ case _element.StrictMode:
53
+ case _element.Fragment:
54
+ return addValuesForElements(props.children, ...args);
55
+
56
+ case _element.RawHTML:
57
+ return;
58
+
59
+ case _innerBlocks.default.Content:
60
+ return addValuesForBlocks(...args);
61
+
62
+ case _content.Content:
63
+ const [values] = args;
64
+ values.push(props.value);
65
+ return;
66
+ }
67
+
68
+ switch (typeof type) {
69
+ case 'string':
70
+ if (typeof props.children !== 'undefined') {
71
+ return addValuesForElements(props.children, ...args);
72
+ }
73
+
74
+ return;
75
+
76
+ case 'function':
77
+ if (type.prototype && typeof type.prototype.render === 'function') {
78
+ return addValuesForElement(new type(props).render(), ...args);
79
+ }
80
+
81
+ return addValuesForElement(type(props), ...args);
82
+ }
83
+ }
84
+
85
+ function addValuesForElements(children, ...args) {
86
+ children = Array.isArray(children) ? children : [children];
87
+
88
+ for (let i = 0; i < children.length; i++) {
89
+ addValuesForElement(children[i], ...args);
90
+ }
91
+ }
92
+
93
+ function addValuesForBlocks(values, blocks) {
94
+ for (let i = 0; i < blocks.length; i++) {
95
+ const {
96
+ name,
97
+ attributes,
98
+ innerBlocks
99
+ } = blocks[i];
100
+ const saveElement = (0, _blocks.getSaveElement)(name, attributes);
101
+ addValuesForElement(saveElement, values, innerBlocks);
102
+ }
103
+ }
104
+
105
+ function getRichTextValues(blocks = []) {
106
+ _blocks.__unstableGetBlockProps.skipFilters = true;
107
+ const values = [];
108
+ addValuesForBlocks(values, blocks);
109
+ _blocks.__unstableGetBlockProps.skipFilters = false;
110
+ return values;
111
+ }
112
+ //# sourceMappingURL=get-rich-text-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/rich-text/get-rich-text-values.js"],"names":["addValuesForElement","element","args","undefined","Array","isArray","addValuesForElements","type","props","StrictMode","Fragment","children","RawHTML","InnerBlocks","Content","addValuesForBlocks","values","push","value","prototype","render","i","length","blocks","name","attributes","innerBlocks","saveElement","getRichTextValues","getBlockProps","skipFilters"],"mappings":";;;;;;;;;AAGA;;AACA;;AAQA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA,SAASA,mBAAT,CAA8BC,OAA9B,EAAuC,GAAGC,IAA1C,EAAiD;AAChD,MAAK,SAASD,OAAT,IAAoBE,SAAS,KAAKF,OAAlC,IAA6C,UAAUA,OAA5D,EAAsE;AACrE;AACA;;AAED,MAAKG,KAAK,CAACC,OAAN,CAAeJ,OAAf,CAAL,EAAgC;AAC/B,WAAOK,oBAAoB,CAAEL,OAAF,EAAW,GAAGC,IAAd,CAA3B;AACA;;AAED,UAAS,OAAOD,OAAhB;AACC,SAAK,QAAL;AACA,SAAK,QAAL;AACC;AAHF;;AAMA,QAAM;AAAEM,IAAAA,IAAF;AAAQC,IAAAA;AAAR,MAAkBP,OAAxB;;AAEA,UAASM,IAAT;AACC,SAAKE,mBAAL;AACA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AA7B,EAAqCO,MAArC,EAA8C;AAC7C,OAAM,IAAIF,CAAC,GAAG,CAAd,EAAiBA,CAAC,GAAGE,MAAM,CAACD,MAA5B,EAAoCD,CAAC,EAArC,EAA0C;AACzC,UAAM;AAAEG,MAAAA,IAAF;AAAQC,MAAAA,UAAR;AAAoBC,MAAAA;AAApB,QAAoCH,MAAM,CAAEF,CAAF,CAAhD;AACA,UAAMM,WAAW,GAAG,4BAAgBH,IAAhB,EAAsBC,UAAtB,CAApB;AACAzB,IAAAA,mBAAmB,CAAE2B,WAAF,EAAeX,MAAf,EAAuBU,WAAvB,CAAnB;AACA;AACD;;AAEM,SAASE,iBAAT,CAA4BL,MAAM,GAAG,EAArC,EAA0C;AAChDM,kCAAcC,WAAd,GAA4B,IAA5B;AACA,QAAMd,MAAM,GAAG,EAAf;AACAD,EAAAA,kBAAkB,CAAEC,MAAF,EAAUO,MAAV,CAAlB;AACAM,kCAAcC,WAAd,GAA4B,KAA5B;AACA,SAAOd,MAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RawHTML, StrictMode, Fragment } from '@wordpress/element';\nimport {\n\tgetSaveElement,\n\t__unstableGetBlockProps as getBlockProps,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport InnerBlocks from '../inner-blocks';\nimport { Content } from './content';\n\n/*\n * This function is similar to `@wordpress/element`'s `renderToString` function,\n * except that it does not render the elements to a string, but instead collects\n * the values of all rich text `Content` elements.\n */\nfunction addValuesForElement( element, ...args ) {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn;\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn addValuesForElements( element, ...args );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn;\n\t}\n\n\tconst { type, props } = element;\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn addValuesForElements( props.children, ...args );\n\t\tcase RawHTML:\n\t\t\treturn;\n\t\tcase InnerBlocks.Content:\n\t\t\treturn addValuesForBlocks( ...args );\n\t\tcase Content:\n\t\t\tconst [ values ] = args;\n\t\t\tvalues.push( props.value );\n\t\t\treturn;\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\tif ( typeof props.children !== 'undefined' ) {\n\t\t\t\treturn addValuesForElements( props.children, ...args );\n\t\t\t}\n\t\t\treturn;\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn addValuesForElement(\n\t\t\t\t\tnew type( props ).render(),\n\t\t\t\t\t...args\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn addValuesForElement( type( props ), ...args );\n\t}\n}\n\nfunction addValuesForElements( children, ...args ) {\n\tchildren = Array.isArray( children ) ? children : [ children ];\n\n\tfor ( let i = 0; i < children.length; i++ ) {\n\t\taddValuesForElement( children[ i ], ...args );\n\t}\n}\n\nfunction addValuesForBlocks( values, blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tconst { name, attributes, innerBlocks } = blocks[ i ];\n\t\tconst saveElement = getSaveElement( name, attributes );\n\t\taddValuesForElement( saveElement, values, innerBlocks );\n\t}\n}\n\nexport function getRichTextValues( blocks = [] ) {\n\tgetBlockProps.skipFilters = true;\n\tconst values = [];\n\taddValuesForBlocks( values, blocks );\n\tgetBlockProps.skipFilters = false;\n\treturn values;\n}\n"]}
@@ -75,7 +75,8 @@ function useBlockDisplayInformation(clientId) {
75
75
  if (!clientId) return null;
76
76
  const {
77
77
  getBlockName,
78
- getBlockAttributes
78
+ getBlockAttributes,
79
+ __experimentalGetReusableBlockTitle
79
80
  } = select(_store.store);
80
81
  const {
81
82
  getBlockType,
@@ -86,11 +87,14 @@ function useBlockDisplayInformation(clientId) {
86
87
  if (!blockType) return null;
87
88
  const attributes = getBlockAttributes(clientId);
88
89
  const match = getActiveBlockVariation(blockName, attributes);
89
- const isSynced = (0, _blocks.isReusableBlock)(blockType) || (0, _blocks.isTemplatePart)(blockType);
90
+ const isReusable = (0, _blocks.isReusableBlock)(blockType);
91
+ const resusableTitle = isReusable ? __experimentalGetReusableBlockTitle(attributes.ref) : undefined;
92
+ const title = resusableTitle || blockType.title;
93
+ const isSynced = isReusable || (0, _blocks.isTemplatePart)(blockType);
90
94
  const positionLabel = getPositionTypeLabel(attributes);
91
95
  const blockTypeInfo = {
92
96
  isSynced,
93
- title: blockType.title,
97
+ title,
94
98
  icon: blockType.icon,
95
99
  description: blockType.description,
96
100
  anchor: attributes?.anchor,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-block-display-information/index.js"],"names":["getPositionTypeLabel","attributes","positionType","style","position","type","useBlockDisplayInformation","clientId","select","getBlockName","getBlockAttributes","blockEditorStore","getBlockType","getActiveBlockVariation","blocksStore","blockName","blockType","match","isSynced","positionLabel","blockTypeInfo","title","icon","description","anchor"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AAdA;AACA;AACA;;AASA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,oBAAT,CAA+BC,UAA/B,EAA4C;AAC3C,QAAMC,YAAY,GAAGD,UAAU,EAAEE,KAAZ,EAAmBC,QAAnB,EAA6BC,IAAlD;;AAEA,MAAKH,YAAY,KAAK,QAAtB,EAAiC;AAChC,WAAO,cAAI,QAAJ,CAAP;AACA;;AAED,MAAKA,YAAY,KAAK,OAAtB,EAAgC;AAC/B,WAAO,cAAI,OAAJ,CAAP;AACA;;AAED,SAAO,IAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEe,SAASI,0BAAT,CAAqCC,QAArC,EAAgD;AAC9D,SAAO,qBACJC,MAAF,IAAc;AACb,QAAK,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C;AAKNC,MAAAA,MAAM,EAAEvB,UAAU,EAAEuB,MALd;AAMNL,MAAAA,aANM;AAONjB,MAAAA,YAAY,EAAED,UAAU,EAAEE,KAAZ,EAAmBC,QAAnB,EAA6BC;AAPrC,KAAP;AASA,GAnCK,EAoCN,CAAEE,QAAF,CApCM,CAAP;AAsCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blocksStore,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/** @typedef {import('@wordpress/blocks').WPIcon} WPIcon */\n\n/**\n * Contains basic block's information for display reasons.\n *\n * @typedef {Object} WPBlockDisplayInformation\n *\n * @property {boolean} isSynced True if is a reusable block or template part\n * @property {string} title Human-readable block type label.\n * @property {WPIcon} icon Block type icon.\n * @property {string} description A detailed block type description.\n * @property {string} anchor HTML anchor.\n */\n\n/**\n * Get the display label for a block's position type.\n *\n * @param {Object} attributes Block attributes.\n * @return {string} The position type label.\n */\nfunction getPositionTypeLabel( attributes ) {\n\tconst positionType = attributes?.style?.position?.type;\n\n\tif ( positionType === 'sticky' ) {\n\t\treturn __( 'Sticky' );\n\t}\n\n\tif ( positionType === 'fixed' ) {\n\t\treturn __( 'Fixed' );\n\t}\n\n\treturn null;\n}\n\n/**\n * Hook used to try to find a matching block variation and return\n * the appropriate information for display reasons. In order to\n * to try to find a match we need to things:\n * 1. Block's client id to extract it's current attributes.\n * 2. A block variation should have set `isActive` prop to a proper function.\n *\n * If for any reason a block variation match cannot be found,\n * the returned information come from the Block Type.\n * If no blockType is found with the provided clientId, returns null.\n *\n * @param {string} clientId Block's client id.\n * @return {?WPBlockDisplayInformation} Block's display information, or `null` when the block or its type not found.\n */\n\nexport default function useBlockDisplayInformation( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId ) return null;\n\t\t\tconst { getBlockName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tif ( ! blockType ) return null;\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\tconst match = getActiveBlockVariation( blockName, attributes );\n\t\t\tconst isSynced =\n\t\t\t\tisReusableBlock( blockType ) || isTemplatePart( blockType );\n\t\t\tconst positionLabel = getPositionTypeLabel( attributes );\n\t\t\tconst blockTypeInfo = {\n\t\t\t\tisSynced,\n\t\t\t\ttitle: blockType.title,\n\t\t\t\ticon: blockType.icon,\n\t\t\t\tdescription: blockType.description,\n\t\t\t\tanchor: attributes?.anchor,\n\t\t\t\tpositionLabel,\n\t\t\t\tpositionType: attributes?.style?.position?.type,\n\t\t\t};\n\t\t\tif ( ! match ) return blockTypeInfo;\n\n\t\t\treturn {\n\t\t\t\tisSynced,\n\t\t\t\ttitle: match.title || blockType.title,\n\t\t\t\ticon: match.icon || blockType.icon,\n\t\t\t\tdescription: match.description || blockType.description,\n\t\t\t\tanchor: attributes?.anchor,\n\t\t\t\tpositionLabel,\n\t\t\t\tpositionType: attributes?.style?.position?.type,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-block-display-information/index.js"],"names":["getPositionTypeLabel","attributes","positionType","style","position","type","useBlockDisplayInformation","clientId","select","getBlockName","getBlockAttributes","__experimentalGetReusableBlockTitle","blockEditorStore","getBlockType","getActiveBlockVariation","blocksStore","blockName","blockType","match","isReusable","resusableTitle","ref","undefined","title","isSynced","positionLabel","blockTypeInfo","icon","description","anchor"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AAdA;AACA;AACA;;AASA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;A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,4BAAgBF,SAAhB,CAA/B;AACA,UAAMQ,aAAa,GAAGzB,oBAAoB,CAAEC,UAAF,CAA1C;AACA,UAAMyB,aAAa,GAAG;AACrBF,MAAAA,QADqB;AAErBD,MAAAA,KAFqB;AAGrBI,MAAAA,IAAI,EAAEV,SAAS,CAACU,IAHK;AAIrBC,MAAAA,WAAW,EAAEX,SAAS,CAACW,WAJF;AAKrBC,MAAAA,MAAM,EAAE5B,UAAU,EAAE4B,MALC;AAMrBJ,MAAAA,aANqB;AAOrBvB,MAAAA,YAAY,EAAED,UAAU,EAAEE,KAAZ,EAAmBC,QAAnB,EAA6BC;AAPtB,KAAtB;AASA,QAAK,CAAEa,KAAP,EAAe,OAAOQ,aAAP;AAEf,WAAO;AACNF,MAAAA,QADM;AAEND,MAAAA,KAAK,EAAEL,KAAK,CAACK,KAAN,IAAeN,SAAS,CAACM,KAF1B;AAGNI,MAAAA,IAAI,EAAET,KAAK,CAACS,IAAN,IAAcV,SAAS,CAACU,IAHxB;AAINC,MAAAA,WAAW,EAAEV,KAAK,CAACU,WAAN,IAAqBX,SAAS,CAACW,WAJtC;AAKNC,MAAAA,MAAM,EAAE5B,UAAU,EAAE4B,MALd;AAMNJ,MAAAA,aANM;AAONvB,MAAAA,YAAY,EAAED,UAAU,EAAEE,KAAZ,EAAmBC,QAAnB,EAA6BC;AAPrC,KAAP;AASA,GA1CK,EA2CN,CAAEE,QAAF,CA3CM,CAAP;AA6CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blocksStore,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/** @typedef {import('@wordpress/blocks').WPIcon} WPIcon */\n\n/**\n * Contains basic block's information for display reasons.\n *\n * @typedef {Object} WPBlockDisplayInformation\n *\n * @property {boolean} isSynced True if is a reusable block or template part\n * @property {string} title Human-readable block type label.\n * @property {WPIcon} icon Block type icon.\n * @property {string} description A detailed block type description.\n * @property {string} anchor HTML anchor.\n */\n\n/**\n * Get the display label for a block's position type.\n *\n * @param {Object} attributes Block attributes.\n * @return {string} The position type label.\n */\nfunction getPositionTypeLabel( attributes ) {\n\tconst positionType = attributes?.style?.position?.type;\n\n\tif ( positionType === 'sticky' ) {\n\t\treturn __( 'Sticky' );\n\t}\n\n\tif ( positionType === 'fixed' ) {\n\t\treturn __( 'Fixed' );\n\t}\n\n\treturn null;\n}\n\n/**\n * Hook used to try to find a matching block variation and return\n * the appropriate information for display reasons. In order to\n * to try to find a match we need to things:\n * 1. Block's client id to extract it's current attributes.\n * 2. A block variation should have set `isActive` prop to a proper function.\n *\n * If for any reason a block variation match cannot be found,\n * the returned information come from the Block Type.\n * If no blockType is found with the provided clientId, returns null.\n *\n * @param {string} clientId Block's client id.\n * @return {?WPBlockDisplayInformation} Block's display information, or `null` when the block or its type not found.\n */\n\nexport default function useBlockDisplayInformation( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId ) return null;\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\t__experimentalGetReusableBlockTitle,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tif ( ! blockType ) return null;\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\tconst match = getActiveBlockVariation( blockName, attributes );\n\t\t\tconst isReusable = isReusableBlock( blockType );\n\t\t\tconst resusableTitle = isReusable\n\t\t\t\t? __experimentalGetReusableBlockTitle( attributes.ref )\n\t\t\t\t: undefined;\n\t\t\tconst title = resusableTitle || blockType.title;\n\t\t\tconst isSynced = isReusable || isTemplatePart( blockType );\n\t\t\tconst positionLabel = getPositionTypeLabel( attributes );\n\t\t\tconst blockTypeInfo = {\n\t\t\t\tisSynced,\n\t\t\t\ttitle,\n\t\t\t\ticon: blockType.icon,\n\t\t\t\tdescription: blockType.description,\n\t\t\t\tanchor: attributes?.anchor,\n\t\t\t\tpositionLabel,\n\t\t\t\tpositionType: attributes?.style?.position?.type,\n\t\t\t};\n\t\t\tif ( ! match ) return blockTypeInfo;\n\n\t\t\treturn {\n\t\t\t\tisSynced,\n\t\t\t\ttitle: match.title || blockType.title,\n\t\t\t\ticon: match.icon || blockType.icon,\n\t\t\t\tdescription: match.description || blockType.description,\n\t\t\t\tanchor: attributes?.anchor,\n\t\t\t\tpositionLabel,\n\t\t\t\tpositionType: attributes?.style?.position?.type,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"]}
@@ -35,7 +35,7 @@ function MarginVisualizer({
35
35
  const [style, setStyle] = (0, _element.useState)();
36
36
  const margin = attributes?.style?.spacing?.margin;
37
37
  (0, _element.useEffect)(() => {
38
- if (!blockElement) {
38
+ if (!blockElement || null === blockElement.ownerDocument.defaultView) {
39
39
  return;
40
40
  }
41
41
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/margin.js"],"names":["getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue","MarginVisualizer","clientId","attributes","forceShow","blockElement","style","setStyle","margin","spacing","top","right","bottom","left","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","isActive","setIsActive","valueRef","timeoutRef","clearTimer","current","window","clearTimeout","setTimeout"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,cAAT,CAAyBC,OAAzB,EAAkCC,QAAlC,EAA6C;AAC5C,SAAOD,OAAO,CAACE,aAAR,CAAsBC,WAAtB,CACLC,gBADK,CACaJ,OADb,EAELK,gBAFK,CAEaJ,QAFb,CAAP;AAGA;;AAEM,SAASK,gBAAT,CAA2B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B;AACA,QAAMa,UAAU,GAAG,sBAAnB;;AAEA,QAAMC,UAAU,GAAG,MAAM;AACxB,QAAKD,UAAU,CAACE,OAAhB,EAA0B;AACzBC,MAAAA,MAAM,CAACC,YAAP,CAAqBJ,UAAU,CAACE,OAAhC;AACA;AACD,GAJD;;AAMA,0BAAW,MAAM;AAChB,QAAK,CAAE,6BAAgBf,MAAhB,EAAwBY,QAAQ,CAACG,OAAjC,CAAF,IAAgD,CAAEnB,SAAvD,EAAmE;AAClEe,MAAAA,WAAW,CAAE,IAAF,CAAX;AACAC,MAAAA,QAAQ,CAACG,OAAT,GAAmBf,MAAnB;AAEAa,MAAAA,UAAU,CAACE,OAAX,GAAqBG,UAAU,CAAE,MAAM;AACtCP,QAAAA,WAAW,CAAE,KAAF,CAAX;AACA,OAF8B,EAE5B,GAF4B,CAA/B;AAGA;;AAED,WAAO,MAAM;AACZA,MAAAA,WAAW,CAAE,KAAF,CAAX;AACAG,MAAAA,UAAU;AACV,KAHD;AAIA,GAdD,EAcG,CAAEd,MAAF,EAAUJ,SAAV,CAdH;;AAgBA,MAAK,CAAEc,QAAF,IAAc,CAAEd,SAArB,EAAiC;AAChC,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD;AACC,IAAA,QAAQ,EAAGF,QADZ;AAEC,IAAA,qBAAqB,MAFtB;AAGC,IAAA,qBAAqB,EAAGM,MAHzB;AAIC,IAAA,qBAAqB,EAAC,eAJvB;AAKC,IAAA,KAAK,EAAG;AALT,KAOC;AAAK,IAAA,SAAS,EAAC,kCAAf;AAAkD,IAAA,KAAK,EAAGF;AAA1D,IAPD,CADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../components/block-popover';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n\nexport function MarginVisualizer( { clientId, attributes, forceShow } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst [ style, setStyle ] = useState();\n\n\tconst margin = attributes?.style?.spacing?.margin;\n\n\tuseEffect( () => {\n\t\tif ( ! blockElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst top = getComputedCSS( blockElement, 'margin-top' );\n\t\tconst right = getComputedCSS( blockElement, 'margin-right' );\n\t\tconst bottom = getComputedCSS( blockElement, 'margin-bottom' );\n\t\tconst left = getComputedCSS( blockElement, 'margin-left' );\n\n\t\tsetStyle( {\n\t\t\tborderTopWidth: top,\n\t\t\tborderRightWidth: right,\n\t\t\tborderBottomWidth: bottom,\n\t\t\tborderLeftWidth: left,\n\t\t\ttop: top ? `-${ top }` : 0,\n\t\t\tright: right ? `-${ right }` : 0,\n\t\t\tbottom: bottom ? `-${ bottom }` : 0,\n\t\t\tleft: left ? `-${ left }` : 0,\n\t\t} );\n\t}, [ blockElement, margin ] );\n\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst valueRef = useRef( margin );\n\tconst timeoutRef = useRef();\n\n\tconst clearTimer = () => {\n\t\tif ( timeoutRef.current ) {\n\t\t\twindow.clearTimeout( timeoutRef.current );\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isShallowEqual( margin, valueRef.current ) && ! forceShow ) {\n\t\t\tsetIsActive( true );\n\t\t\tvalueRef.current = margin;\n\n\t\t\ttimeoutRef.current = setTimeout( () => {\n\t\t\t\tsetIsActive( false );\n\t\t\t}, 400 );\n\t\t}\n\n\t\treturn () => {\n\t\t\tsetIsActive( false );\n\t\t\tclearTimer();\n\t\t};\n\t}, [ margin, forceShow ] );\n\n\tif ( ! isActive && ! forceShow ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\t__unstableCoverTarget\n\t\t\t__unstableRefreshSize={ margin }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tshift={ false }\n\t\t>\n\t\t\t<div className=\"block-editor__padding-visualizer\" style={ style } />\n\t\t</BlockPopover>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/margin.js"],"names":["getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue","MarginVisualizer","clientId","attributes","forceShow","blockElement","style","setStyle","margin","spacing","top","right","bottom","left","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","isActive","setIsActive","valueRef","timeoutRef","clearTimer","current","window","clearTimeout","setTimeout"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,cAAT,CAAyBC,OAAzB,EAAkCC,QAAlC,EAA6C;AAC5C,SAAOD,OAAO,CAACE,aAAR,CAAsBC,WAAtB,CACLC,gBADK,CACaJ,OADb,EAELK,gBAFK,CAEaJ,QAFb,CAAP;AAGA;;AAEM,SAASK,gBAAT,CAA2B;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,UAAZ;AAAwBC,EAAAA;AAAxB,CAA3B,EAAiE;AACvE,QAAMC,YAAY,GAAG,6CAAiBH,QAAjB,CAArB;AACA,QAAM,CAAEI,KAAF,EAASC,QAAT,IAAsB,wBAA5B;AAEA,QAAMC,MAAM,GAAGL,UAAU,EAAEG,KAAZ,EAAmBG,OAAnB,EAA4BD,MAA3C;AAEA,0BAAW,MAAM;AAChB,QACC,CAAEH,YAAF,IACA,SAASA,YAAY,CAACR,aAAb,CAA2BC,WAFrC,EAGE;AACD;AACA;;AAED,UAAMY,GAAG,GAAGhB,cAAc,CAAEW,YAAF,EAAgB,YAAhB,CAA1B;AACA,UAAMM,KAAK,GAAGjB,cAAc,CAAEW,YAAF,EAAgB,cAAhB,CAA5B;AACA,UAAMO,MAAM,GAAGlB,cAAc,CAAEW,YA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8B,EAE5B,GAF4B,CAA/B;AAGA;;AAED,WAAO,MAAM;AACZA,MAAAA,WAAW,CAAE,KAAF,CAAX;AACAG,MAAAA,UAAU;AACV,KAHD;AAIA,GAdD,EAcG,CAAEd,MAAF,EAAUJ,SAAV,CAdH;;AAgBA,MAAK,CAAEc,QAAF,IAAc,CAAEd,SAArB,EAAiC;AAChC,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD;AACC,IAAA,QAAQ,EAAGF,QADZ;AAEC,IAAA,qBAAqB,MAFtB;AAGC,IAAA,qBAAqB,EAAGM,MAHzB;AAIC,IAAA,qBAAqB,EAAC,eAJvB;AAKC,IAAA,KAAK,EAAG;AALT,KAOC;AAAK,IAAA,SAAS,EAAC,kCAAf;AAAkD,IAAA,KAAK,EAAGF;AAA1D,IAPD,CADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../components/block-popover';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n\nexport function MarginVisualizer( { clientId, attributes, forceShow } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst [ style, setStyle ] = useState();\n\n\tconst margin = attributes?.style?.spacing?.margin;\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! blockElement ||\n\t\t\tnull === blockElement.ownerDocument.defaultView\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst top = getComputedCSS( blockElement, 'margin-top' );\n\t\tconst right = getComputedCSS( blockElement, 'margin-right' );\n\t\tconst bottom = getComputedCSS( blockElement, 'margin-bottom' );\n\t\tconst left = getComputedCSS( blockElement, 'margin-left' );\n\n\t\tsetStyle( {\n\t\t\tborderTopWidth: top,\n\t\t\tborderRightWidth: right,\n\t\t\tborderBottomWidth: bottom,\n\t\t\tborderLeftWidth: left,\n\t\t\ttop: top ? `-${ top }` : 0,\n\t\t\tright: right ? `-${ right }` : 0,\n\t\t\tbottom: bottom ? `-${ bottom }` : 0,\n\t\t\tleft: left ? `-${ left }` : 0,\n\t\t} );\n\t}, [ blockElement, margin ] );\n\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst valueRef = useRef( margin );\n\tconst timeoutRef = useRef();\n\n\tconst clearTimer = () => {\n\t\tif ( timeoutRef.current ) {\n\t\t\twindow.clearTimeout( timeoutRef.current );\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isShallowEqual( margin, valueRef.current ) && ! forceShow ) {\n\t\t\tsetIsActive( true );\n\t\t\tvalueRef.current = margin;\n\n\t\t\ttimeoutRef.current = setTimeout( () => {\n\t\t\t\tsetIsActive( false );\n\t\t\t}, 400 );\n\t\t}\n\n\t\treturn () => {\n\t\t\tsetIsActive( false );\n\t\t\tclearTimer();\n\t\t};\n\t}, [ margin, forceShow ] );\n\n\tif ( ! isActive && ! forceShow ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\t__unstableCoverTarget\n\t\t\t__unstableRefreshSize={ margin }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tshift={ false }\n\t\t>\n\t\t\t<div className=\"block-editor__padding-visualizer\" style={ style } />\n\t\t</BlockPopover>\n\t);\n}\n"]}
@@ -35,7 +35,7 @@ function PaddingVisualizer({
35
35
  const [style, setStyle] = (0, _element.useState)();
36
36
  const padding = attributes?.style?.spacing?.padding;
37
37
  (0, _element.useEffect)(() => {
38
- if (!blockElement) {
38
+ if (!blockElement || null === blockElement.ownerDocument.defaultView) {
39
39
  return;
40
40
  }
41
41
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/padding.js"],"names":["getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue","PaddingVisualizer","clientId","attributes","forceShow","blockElement","style","setStyle","padding","spacing","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","isActive","setIsActive","valueRef","timeoutRef","clearTimer","current","window","clearTimeout","setTimeout"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,cAAT,CAAyBC,OAAzB,EAAkCC,QAAlC,EAA6C;AAC5C,SAAOD,OAAO,CAACE,aAAR,CAAsBC,WAAtB,CACLC,gBADK,CACaJ,OADb,EAELK,gBAFK,CAEaJ,QAFb,CAAP;AAGA;;AAEM,SAASK,iBAAT,CAA4B;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,UAAZ;AAAwBC,EAAAA;AAAxB,CAA5B,EAAkE;AACxE,QAAMC,YAAY,GAAG,6CAAiBH,QAAjB,CAArB;AACA,QAAM,CAAEI,KAAF,EAASC,QAAT,IAAsB,wBAA5B;AAEA,QAAMC,OAAO,GAAGL,UAAU,EAAEG,KAAZ,EAAmBG,OAAnB,EAA4BD,OAA5C;AAEA,0BAAW,MAAM;AAChB,QAAK,CAAEH,YAAP,EAAsB;AACrB;AACA;;AAEDE,IAAAA,QAAQ,CAAE;AACTG,MAAAA,cAAc,EAAEhB,cAAc,CAAEW,YAAF,EAAgB,aAAhB,CADrB;AAETM,MAAAA,gBAAgB,EAAEjB,cAAc,CAAEW,YAAF,EAAgB,eAAhB,CAFvB;AAGTO,MAAAA,iBAAiB,EAAElB,cAAc,CAAEW,YAAF,EAAgB,gBAAhB,CAHxB;AAITQ,MAAAA,eAAe,EAAEnB,cAAc,CAAEW,YAAF,EAAgB,cAAhB;AAJtB,KAAF,CAAR;AAMA,GAXD,EAWG,CAAEA,YAAF,EAAgBG,OAAhB,CAXH;AAaA,QAAM,CAAEM,QAAF,EAAYC,WAAZ,IAA4B,uBAAU,KAAV,CAAlC;AACA,QAAMC,QAAQ,GAAG,qBAAQR,OAAR,CAAjB;AACA,QAAMS,UAAU,GAAG,sBAAnB;;AAEA,QAAMC,UAAU,GAAG,MAAM;AACxB,QAAKD,UAAU,CAACE,OAAhB,EAA0B;AACzBC,MAAAA,MAAM,CAACC,YAAP,CAAqBJ,UAAU,CAACE,OAAhC;AACA;AACD,GAJD;;AAMA,0BAAW,MAAM;AAChB,QAAK,CAAE,6BAAgBX,OAAhB,EAAyBQ,QAAQ,CAACG,OAAlC,CAAF,IAAiD,CAAEf,SAAxD,EAAoE;AACnEW,MAAAA,WAAW,CAAE,IAAF,CAAX;AACAC,MAAAA,QAAQ,CAACG,OAAT,GAAmBX,OAAnB;AAEAS,MAAAA,UAAU,CAACE,OAAX,GAAqBG,UAAU,CAAE,MAAM;AACtCP,QAAAA,WAAW,CAAE,KAAF,CAAX;AACA,OAF8B,EAE5B,GAF4B,CAA/B;AAGA;;AAED,WAAO,MAAM;AACZA,MAAAA,WAAW,CAAE,KAAF,CAAX;AACAG,MAAAA,UAAU;AACV,KAHD;AAIA,GAdD,EAcG,CAAEV,OAAF,EAAWJ,SAAX,CAdH;;AAgBA,MAAK,CAAEU,QAAF,IAAc,CAAEV,SAArB,EAAiC;AAChC,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD;AACC,IAAA,QAAQ,EAAGF,QADZ;AAEC,IAAA,qBAAqB,MAFtB;AAGC,IAAA,qBAAqB,EAAGM,OAHzB;AAIC,IAAA,qBAAqB,EAAC,eAJvB;AAKC,IAAA,KAAK,EAAG;AALT,KAOC;AAAK,IAAA,SAAS,EAAC,kCAAf;AAAkD,IAAA,KAAK,EAAGF;AAA1D,IAPD,CADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../components/block-popover';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n\nexport function PaddingVisualizer( { clientId, attributes, forceShow } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst [ style, setStyle ] = useState();\n\n\tconst padding = attributes?.style?.spacing?.padding;\n\n\tuseEffect( () => {\n\t\tif ( ! blockElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetStyle( {\n\t\t\tborderTopWidth: getComputedCSS( blockElement, 'padding-top' ),\n\t\t\tborderRightWidth: getComputedCSS( blockElement, 'padding-right' ),\n\t\t\tborderBottomWidth: getComputedCSS( blockElement, 'padding-bottom' ),\n\t\t\tborderLeftWidth: getComputedCSS( blockElement, 'padding-left' ),\n\t\t} );\n\t}, [ blockElement, padding ] );\n\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst valueRef = useRef( padding );\n\tconst timeoutRef = useRef();\n\n\tconst clearTimer = () => {\n\t\tif ( timeoutRef.current ) {\n\t\t\twindow.clearTimeout( timeoutRef.current );\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isShallowEqual( padding, valueRef.current ) && ! forceShow ) {\n\t\t\tsetIsActive( true );\n\t\t\tvalueRef.current = padding;\n\n\t\t\ttimeoutRef.current = setTimeout( () => {\n\t\t\t\tsetIsActive( false );\n\t\t\t}, 400 );\n\t\t}\n\n\t\treturn () => {\n\t\t\tsetIsActive( false );\n\t\t\tclearTimer();\n\t\t};\n\t}, [ padding, forceShow ] );\n\n\tif ( ! isActive && ! forceShow ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\t__unstableCoverTarget\n\t\t\t__unstableRefreshSize={ padding }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tshift={ false }\n\t\t>\n\t\t\t<div className=\"block-editor__padding-visualizer\" style={ style } />\n\t\t</BlockPopover>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/padding.js"],"names":["getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue","PaddingVisualizer","clientId","attributes","forceShow","blockElement","style","setStyle","padding","spacing","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","isActive","setIsActive","valueRef","timeoutRef","clearTimer","current","window","clearTimeout","setTimeout"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,cAAT,CAAyBC,OAAzB,EAAkCC,QAAlC,EAA6C;AAC5C,SAAOD,OAAO,CAACE,aAAR,CAAsBC,WAAtB,CACLC,gBADK,CACaJ,OADb,EAELK,gBAFK,CAEaJ,QAFb,CAAP;AAGA;;AAEM,SAASK,iBAAT,CAA4B;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,UAAZ;AAAwBC,EAAAA;AAAxB,CAA5B,EAAkE;AACxE,QAAMC,YAAY,GAAG,6CAAiBH,QAAjB,CAArB;AACA,QAAM,CAAEI,KAAF,EAASC,QAAT,IAAsB,wBAA5B;AAEA,QAAMC,OAAO,GAAGL,UAAU,EAAEG,KAAZ,EAAmBG,OAAnB,EAA4BD,OAA5C;AAEA,0BAAW,MAAM;AAChB,QACC,CAAEH,YAAF,IACA,SAASA,YAAY,CAACR,aAAb,CAA2BC,WAFrC,EAGE;AACD;AACA;;AAEDS,IAAAA,QAAQ,CAAE;AACTG,MAAAA,cAAc,EAAEhB,cAAc,CAAEW,YAAF,EAAgB,aAAhB,CADrB;AAETM,MAAAA,gBAAgB,EAAEjB,cAAc,CAAEW,YAAF,EAAgB,eAAhB,CAFvB;AAGTO,MAAAA,iBAAiB,EAAElB,cAAc,CAAEW,YAAF,EAAgB,gBAAhB,CAHxB;AAITQ,MAAAA,eAAe,EAAEnB,cAAc,CAAEW,YAAF,EAAgB,cAAhB;AAJtB,KAAF,CAAR;AAMA,GAdD,EAcG,CAAEA,YAAF,EAAgBG,OAAhB,CAdH;AAgBA,QAAM,CAAEM,QAAF,EAAYC,WAAZ,IAA4B,uBAAU,KAAV,CAAlC;AACA,QAAMC,QAAQ,GAAG,qBAAQR,OAAR,CAAjB;AACA,QAAMS,UAAU,GAAG,sBAAnB;;AAEA,QAAMC,UAAU,GAAG,MAAM;AACxB,QAAKD,UAAU,CAACE,OAAhB,EAA0B;AACzBC,MAAAA,MAAM,CAACC,YAAP,CAAqBJ,UAAU,CAACE,OAAhC;AACA;AACD,GAJD;;AAMA,0BAAW,MAAM;AAChB,QAAK,CAAE,6BAAgBX,OAAhB,EAAyBQ,QAAQ,CAACG,OAAlC,CAAF,IAAiD,CAAEf,SAAxD,EAAoE;AACnEW,MAAAA,WAAW,CAAE,IAAF,CAAX;AACAC,MAAAA,QAAQ,CAACG,OAAT,GAAmBX,OAAnB;AAEAS,MAAAA,UAAU,CAACE,OAAX,GAAqBG,UAAU,CAAE,MAAM;AACtCP,QAAAA,WAAW,CAAE,KAAF,CAAX;AACA,OAF8B,EAE5B,GAF4B,CAA/B;AAGA;;AAED,WAAO,MAAM;AACZA,MAAAA,WAAW,CAAE,KAAF,CAAX;AACAG,MAAAA,UAAU;AACV,KAHD;AAIA,GAdD,EAcG,CAAEV,OAAF,EAAWJ,SAAX,CAdH;;AAgBA,MAAK,CAAEU,QAAF,IAAc,CAAEV,SAArB,EAAiC;AAChC,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD;AACC,IAAA,QAAQ,EAAGF,QADZ;AAEC,IAAA,qBAAqB,MAFtB;AAGC,IAAA,qBAAqB,EAAGM,OAHzB;AAIC,IAAA,qBAAqB,EAAC,eAJvB;AAKC,IAAA,KAAK,EAAG;AALT,KAOC;AAAK,IAAA,SAAS,EAAC,kCAAf;AAAkD,IAAA,KAAK,EAAGF;AAA1D,IAPD,CADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../components/block-popover';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n\nexport function PaddingVisualizer( { clientId, attributes, forceShow } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst [ style, setStyle ] = useState();\n\n\tconst padding = attributes?.style?.spacing?.padding;\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! blockElement ||\n\t\t\tnull === blockElement.ownerDocument.defaultView\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetStyle( {\n\t\t\tborderTopWidth: getComputedCSS( blockElement, 'padding-top' ),\n\t\t\tborderRightWidth: getComputedCSS( blockElement, 'padding-right' ),\n\t\t\tborderBottomWidth: getComputedCSS( blockElement, 'padding-bottom' ),\n\t\t\tborderLeftWidth: getComputedCSS( blockElement, 'padding-left' ),\n\t\t} );\n\t}, [ blockElement, padding ] );\n\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst valueRef = useRef( padding );\n\tconst timeoutRef = useRef();\n\n\tconst clearTimer = () => {\n\t\tif ( timeoutRef.current ) {\n\t\t\twindow.clearTimeout( timeoutRef.current );\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isShallowEqual( padding, valueRef.current ) && ! forceShow ) {\n\t\t\tsetIsActive( true );\n\t\t\tvalueRef.current = padding;\n\n\t\t\ttimeoutRef.current = setTimeout( () => {\n\t\t\t\tsetIsActive( false );\n\t\t\t}, 400 );\n\t\t}\n\n\t\treturn () => {\n\t\t\tsetIsActive( false );\n\t\t\tclearTimer();\n\t\t};\n\t}, [ padding, forceShow ] );\n\n\tif ( ! isActive && ! forceShow ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\t__unstableCoverTarget\n\t\t\t__unstableRefreshSize={ padding }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tshift={ false }\n\t\t>\n\t\t\t<div className=\"block-editor__padding-visualizer\" style={ style } />\n\t\t</BlockPopover>\n\t);\n}\n"]}
@@ -13,7 +13,7 @@ var _provider = require("./components/provider");
13
13
 
14
14
  var _lockUnlock = require("./lock-unlock");
15
15
 
16
- var _content = require("./components/rich-text/content");
16
+ var _getRichTextValues = require("./components/rich-text/get-rich-text-values");
17
17
 
18
18
  var _resizableBoxPopover = _interopRequireDefault(require("./components/resizable-box-popover"));
19
19
 
@@ -56,7 +56,7 @@ const privateApis = {};
56
56
  exports.privateApis = privateApis;
57
57
  (0, _lockUnlock.lock)(privateApis, { ...globalStyles,
58
58
  ExperimentalBlockEditorProvider: _provider.ExperimentalBlockEditorProvider,
59
- getRichTextValues: _content.getRichTextValues,
59
+ getRichTextValues: _getRichTextValues.getRichTextValues,
60
60
  PrivateInserter: _inserter.ComposedPrivateInserter,
61
61
  PrivateListView: _listView.PrivateListView,
62
62
  ResizableBoxPopover: _resizableBoxPopover.default,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/private-apis.js"],"names":["privateApis","globalStyles","ExperimentalBlockEditorProvider","getRichTextValues","PrivateInserter","PrivateListView","ResizableBoxPopover","BlockInfo","useShouldContextualToolbarShow","cleanEmptyObject","useBlockEditingMode","BlockQuickNavigation","LayoutStyle","BlockRemovalWarningModal","useLayoutClasses","useLayoutStyles","DimensionsTool","ResolutionTool"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAnBA;AACA;AACA;;AAmBA;AACA;AACA;AACO,MAAMA,WAAW,GAAG,EAApB;;AACP,sBAAMA,WAAN,EAAmB,EAClB,GAAGC,YADe;AAElBC,EAAAA,+BAA+B,EAA/BA,yCAFkB;AAGlBC,EAAAA,iBAAiB,EAAjBA,0BAHkB;AAIlBC,EAAAA,eAAe,EAAfA,iCAJkB;AAKlBC,EAAAA,eAAe,EAAfA,yBALkB;AAMlBC,EAAAA,mBAAmB,EAAnBA,4BANkB;AAOlBC,EAAAA,SAAS,EAATA,0BAPkB;AAQlBC,EAAAA,8BAA8B,EAA9BA,8DARkB;AASlBC,EAAAA,gBAAgB,EAAhBA,uBATkB;AAUlBC,EAAAA,mBAAmB,EAAnBA,qCAVkB;AAWlBC,EAAAA,oBAAoB,EAApBA,6BAXkB;AAYlBC,EAAAA,WAAW,EAAXA,mBAZkB;AAalBC,EAAAA,wBAAwB,EAAxBA,kDAbkB;AAclBC,EAAAA,gBAAgB,EAAhBA,uBAdkB;AAelBC,EAAAA,eAAe,EAAfA,sBAfkB;AAgBlBC,EAAAA,cAAc,EAAdA,uBAhBkB;AAiBlBC,EAAAA,cAAc,EAAdA;AAjBkB,CAAnB","sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { getRichTextValues } from './components/rich-text/content';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { ComposedPrivateInserter as PrivateInserter } from './components/inserter';\nimport { PrivateListView } from './components/list-view';\nimport BlockInfo from './components/block-info-slot-fill';\nimport { useShouldContextualToolbarShow } from './utils/use-should-contextual-toolbar-show';\nimport { cleanEmptyObject } from './hooks/utils';\nimport { useBlockEditingMode } from './components/block-editing-mode';\nimport BlockQuickNavigation from './components/block-quick-navigation';\nimport { LayoutStyle } from './components/block-list/layout';\nimport { BlockRemovalWarningModal } from './components/block-removal-warning-modal';\nimport { useLayoutClasses, useLayoutStyles } from './hooks';\nimport DimensionsTool from './components/dimensions-tool';\nimport ResolutionTool from './components/resolution-tool';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockEditorProvider,\n\tgetRichTextValues,\n\tPrivateInserter,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tBlockInfo,\n\tuseShouldContextualToolbarShow,\n\tcleanEmptyObject,\n\tuseBlockEditingMode,\n\tBlockQuickNavigation,\n\tLayoutStyle,\n\tBlockRemovalWarningModal,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tDimensionsTool,\n\tResolutionTool,\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/private-apis.js"],"names":["privateApis","globalStyles","ExperimentalBlockEditorProvider","getRichTextValues","PrivateInserter","PrivateListView","ResizableBoxPopover","BlockInfo","useShouldContextualToolbarShow","cleanEmptyObject","useBlockEditingMode","BlockQuickNavigation","LayoutStyle","BlockRemovalWarningModal","useLayoutClasses","useLayoutStyles","DimensionsTool","ResolutionTool"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAnBA;AACA;AACA;;AAmBA;AACA;AACA;AACO,MAAMA,WAAW,GAAG,EAApB;;AACP,sBAAMA,WAAN,EAAmB,EAClB,GAAGC,YADe;AAElBC,EAAAA,+BAA+B,EAA/BA,yCAFkB;AAGlBC,EAAAA,iBAAiB,EAAjBA,oCAHkB;AAIlBC,EAAAA,eAAe,EAAfA,iCAJkB;AAKlBC,EAAAA,eAAe,EAAfA,yBALkB;AAMlBC,EAAAA,mBAAmB,EAAnBA,4BANkB;AAOlBC,EAAAA,SAAS,EAATA,0BAPkB;AAQlBC,EAAAA,8BAA8B,EAA9BA,8DARkB;AASlBC,EAAAA,gBAAgB,EAAhBA,uBATkB;AAUlBC,EAAAA,mBAAmB,EAAnBA,qCAVkB;AAWlBC,EAAAA,oBAAoB,EAApBA,6BAXkB;AAYlBC,EAAAA,WAAW,EAAXA,mBAZkB;AAalBC,EAAAA,wBAAwB,EAAxBA,kDAbkB;AAclBC,EAAAA,gBAAgB,EAAhBA,uBAdkB;AAelBC,EAAAA,eAAe,EAAfA,sBAfkB;AAgBlBC,EAAAA,cAAc,EAAdA,uBAhBkB;AAiBlBC,EAAAA,cAAc,EAAdA;AAjBkB,CAAnB","sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { getRichTextValues } from './components/rich-text/get-rich-text-values';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { ComposedPrivateInserter as PrivateInserter } from './components/inserter';\nimport { PrivateListView } from './components/list-view';\nimport BlockInfo from './components/block-info-slot-fill';\nimport { useShouldContextualToolbarShow } from './utils/use-should-contextual-toolbar-show';\nimport { cleanEmptyObject } from './hooks/utils';\nimport { useBlockEditingMode } from './components/block-editing-mode';\nimport BlockQuickNavigation from './components/block-quick-navigation';\nimport { LayoutStyle } from './components/block-list/layout';\nimport { BlockRemovalWarningModal } from './components/block-removal-warning-modal';\nimport { useLayoutClasses, useLayoutStyles } from './hooks';\nimport DimensionsTool from './components/dimensions-tool';\nimport ResolutionTool from './components/resolution-tool';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockEditorProvider,\n\tgetRichTextValues,\n\tPrivateInserter,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tBlockInfo,\n\tuseShouldContextualToolbarShow,\n\tcleanEmptyObject,\n\tuseBlockEditingMode,\n\tBlockQuickNavigation,\n\tLayoutStyle,\n\tBlockRemovalWarningModal,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tDimensionsTool,\n\tResolutionTool,\n} );\n"]}
@@ -2040,7 +2040,7 @@ const getInserterItems = (0, _rememo.default)((state, rootClientId = null) => {
2040
2040
  title: reusableBlock.title.raw,
2041
2041
  icon,
2042
2042
  category: 'reusable',
2043
- keywords: [],
2043
+ keywords: ['reusable'],
2044
2044
  isDisabled: false,
2045
2045
  utility: 1,
2046
2046
  // Deprecated.