@wordpress/block-editor 11.8.0 → 12.0.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 (216) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +15 -3
  3. package/build/components/block-info-slot-fill/index.js +47 -0
  4. package/build/components/block-info-slot-fill/index.js.map +1 -0
  5. package/build/components/block-inspector/index.js +4 -2
  6. package/build/components/block-inspector/index.js.map +1 -1
  7. package/build/components/block-list/block.native.js +3 -4
  8. package/build/components/block-list/block.native.js.map +1 -1
  9. package/build/components/block-toolbar/index.js +2 -1
  10. package/build/components/block-toolbar/index.js.map +1 -1
  11. package/build/components/block-tools/block-contextual-toolbar.js +83 -9
  12. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  13. package/build/components/block-tools/selected-block-popover.js +11 -28
  14. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  15. package/build/components/editor-styles/index.js +4 -3
  16. package/build/components/editor-styles/index.js.map +1 -1
  17. package/build/components/font-sizes/fluid-utils.js +21 -14
  18. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  19. package/build/components/global-styles/border-panel.js +2 -32
  20. package/build/components/global-styles/border-panel.js.map +1 -1
  21. package/build/components/global-styles/color-panel.js +12 -12
  22. package/build/components/global-styles/color-panel.js.map +1 -1
  23. package/build/components/global-styles/color-panel.native.js +174 -0
  24. package/build/components/global-styles/color-panel.native.js.map +1 -0
  25. package/build/components/global-styles/dimensions-panel.js +6 -6
  26. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  27. package/build/components/global-styles/effects-panel.js +1 -1
  28. package/build/components/global-styles/effects-panel.js.map +1 -1
  29. package/build/components/global-styles/filters-panel.js +78 -14
  30. package/build/components/global-styles/filters-panel.js.map +1 -1
  31. package/build/components/global-styles/typography-panel.js +9 -9
  32. package/build/components/global-styles/typography-panel.js.map +1 -1
  33. package/build/components/global-styles/use-global-styles-output.js +87 -77
  34. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  35. package/build/components/index.js +7 -0
  36. package/build/components/index.js.map +1 -1
  37. package/build/components/inserter/block-types-tab.js +12 -7
  38. package/build/components/inserter/block-types-tab.js.map +1 -1
  39. package/build/components/inserter/index.js +2 -1
  40. package/build/components/inserter/index.js.map +1 -1
  41. package/build/components/inspector-controls/groups.js +2 -0
  42. package/build/components/inspector-controls/groups.js.map +1 -1
  43. package/build/components/inspector-controls-tabs/styles-tab.js +2 -0
  44. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  45. package/build/components/list-view/block-select-button.js +7 -2
  46. package/build/components/list-view/block-select-button.js.map +1 -1
  47. package/build/components/list-view/block.js +12 -21
  48. package/build/components/list-view/block.js.map +1 -1
  49. package/build/components/list-view/drop-indicator.js +37 -10
  50. package/build/components/list-view/drop-indicator.js.map +1 -1
  51. package/build/components/list-view/index.js +10 -4
  52. package/build/components/list-view/index.js.map +1 -1
  53. package/build/components/list-view/leaf.js +2 -1
  54. package/build/components/list-view/leaf.js.map +1 -1
  55. package/build/components/list-view/use-block-selection.js +1 -1
  56. package/build/components/list-view/use-block-selection.js.map +1 -1
  57. package/build/components/media-replace-flow/index.js +5 -5
  58. package/build/components/media-replace-flow/index.js.map +1 -1
  59. package/build/components/navigable-toolbar/index.js +12 -4
  60. package/build/components/navigable-toolbar/index.js.map +1 -1
  61. package/build/components/off-canvas-editor/appender.js +2 -7
  62. package/build/components/off-canvas-editor/appender.js.map +1 -1
  63. package/build/hooks/duotone.js +29 -4
  64. package/build/hooks/duotone.js.map +1 -1
  65. package/build/hooks/utils.js +15 -3
  66. package/build/hooks/utils.js.map +1 -1
  67. package/build/private-apis.js +10 -1
  68. package/build/private-apis.js.map +1 -1
  69. package/build/store/actions.js +7 -0
  70. package/build/store/actions.js.map +1 -1
  71. package/build/utils/object.js +5 -5
  72. package/build/utils/object.js.map +1 -1
  73. package/build/utils/transform-styles/index.js +2 -2
  74. package/build/utils/transform-styles/index.js.map +1 -1
  75. package/build/utils/use-should-contextual-toolbar-show.js +68 -0
  76. package/build/utils/use-should-contextual-toolbar-show.js.map +1 -0
  77. package/build-module/components/block-info-slot-fill/index.js +34 -0
  78. package/build-module/components/block-info-slot-fill/index.js.map +1 -0
  79. package/build-module/components/block-inspector/index.js +3 -2
  80. package/build-module/components/block-inspector/index.js.map +1 -1
  81. package/build-module/components/block-list/block.native.js +3 -4
  82. package/build-module/components/block-list/block.native.js.map +1 -1
  83. package/build-module/components/block-toolbar/index.js +2 -1
  84. package/build-module/components/block-toolbar/index.js.map +1 -1
  85. package/build-module/components/block-tools/block-contextual-toolbar.js +79 -9
  86. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  87. package/build-module/components/block-tools/selected-block-popover.js +10 -27
  88. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  89. package/build-module/components/editor-styles/index.js +4 -3
  90. package/build-module/components/editor-styles/index.js.map +1 -1
  91. package/build-module/components/font-sizes/fluid-utils.js +21 -14
  92. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  93. package/build-module/components/global-styles/border-panel.js +2 -32
  94. package/build-module/components/global-styles/border-panel.js.map +1 -1
  95. package/build-module/components/global-styles/color-panel.js +13 -13
  96. package/build-module/components/global-styles/color-panel.js.map +1 -1
  97. package/build-module/components/global-styles/color-panel.native.js +150 -0
  98. package/build-module/components/global-styles/color-panel.native.js.map +1 -0
  99. package/build-module/components/global-styles/dimensions-panel.js +7 -7
  100. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  101. package/build-module/components/global-styles/effects-panel.js +2 -2
  102. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  103. package/build-module/components/global-styles/filters-panel.js +78 -16
  104. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  105. package/build-module/components/global-styles/typography-panel.js +10 -10
  106. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  107. package/build-module/components/global-styles/use-global-styles-output.js +87 -77
  108. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  109. package/build-module/components/index.js +1 -1
  110. package/build-module/components/index.js.map +1 -1
  111. package/build-module/components/inserter/block-types-tab.js +12 -6
  112. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  113. package/build-module/components/inserter/index.js +2 -1
  114. package/build-module/components/inserter/index.js.map +1 -1
  115. package/build-module/components/inspector-controls/groups.js +2 -0
  116. package/build-module/components/inspector-controls/groups.js.map +1 -1
  117. package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -0
  118. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  119. package/build-module/components/list-view/block-select-button.js +7 -2
  120. package/build-module/components/list-view/block-select-button.js.map +1 -1
  121. package/build-module/components/list-view/block.js +14 -22
  122. package/build-module/components/list-view/block.js.map +1 -1
  123. package/build-module/components/list-view/drop-indicator.js +36 -10
  124. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  125. package/build-module/components/list-view/index.js +11 -5
  126. package/build-module/components/list-view/index.js.map +1 -1
  127. package/build-module/components/list-view/leaf.js +2 -1
  128. package/build-module/components/list-view/leaf.js.map +1 -1
  129. package/build-module/components/list-view/use-block-selection.js +1 -1
  130. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  131. package/build-module/components/media-replace-flow/index.js +5 -5
  132. package/build-module/components/media-replace-flow/index.js.map +1 -1
  133. package/build-module/components/navigable-toolbar/index.js +12 -4
  134. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  135. package/build-module/components/off-canvas-editor/appender.js +1 -5
  136. package/build-module/components/off-canvas-editor/appender.js.map +1 -1
  137. package/build-module/hooks/duotone.js +28 -5
  138. package/build-module/hooks/duotone.js.map +1 -1
  139. package/build-module/hooks/utils.js +16 -4
  140. package/build-module/hooks/utils.js.map +1 -1
  141. package/build-module/private-apis.js +7 -1
  142. package/build-module/private-apis.js.map +1 -1
  143. package/build-module/store/actions.js +7 -0
  144. package/build-module/store/actions.js.map +1 -1
  145. package/build-module/utils/object.js +4 -4
  146. package/build-module/utils/object.js.map +1 -1
  147. package/build-module/utils/transform-styles/index.js +2 -2
  148. package/build-module/utils/transform-styles/index.js.map +1 -1
  149. package/build-module/utils/use-should-contextual-toolbar-show.js +56 -0
  150. package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -0
  151. package/build-style/content-rtl.css +9 -6
  152. package/build-style/content.css +9 -6
  153. package/build-style/style-rtl.css +223 -46
  154. package/build-style/style.css +223 -46
  155. package/package.json +32 -32
  156. package/src/components/block-info-slot-fill/index.js +24 -0
  157. package/src/components/block-inspector/index.js +3 -0
  158. package/src/components/block-list/block.native.js +2 -3
  159. package/src/components/block-list/content.scss +16 -15
  160. package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +9 -9
  161. package/src/components/block-mover/style.scss +10 -4
  162. package/src/components/block-mover/test/index.native.js +4 -4
  163. package/src/components/block-toolbar/index.js +4 -3
  164. package/src/components/block-toolbar/style.scss +56 -33
  165. package/src/components/block-tools/block-contextual-toolbar.js +94 -11
  166. package/src/components/block-tools/selected-block-popover.js +11 -44
  167. package/src/components/block-tools/style.scss +157 -3
  168. package/src/components/editor-styles/index.js +9 -5
  169. package/src/components/font-sizes/fluid-utils.js +31 -14
  170. package/src/components/font-sizes/test/fluid-utils.js +5 -16
  171. package/src/components/global-styles/border-panel.js +1 -30
  172. package/src/components/global-styles/color-panel.js +13 -13
  173. package/src/components/global-styles/color-panel.native.js +207 -0
  174. package/src/components/global-styles/dimensions-panel.js +17 -7
  175. package/src/components/global-styles/effects-panel.js +2 -2
  176. package/src/components/global-styles/filters-panel.js +90 -17
  177. package/src/components/global-styles/style.scss +2 -1
  178. package/src/components/global-styles/test/typography-utils.js +63 -22
  179. package/src/components/global-styles/test/use-global-styles-output.js +126 -4
  180. package/src/components/global-styles/typography-panel.js +37 -11
  181. package/src/components/global-styles/use-global-styles-output.js +64 -64
  182. package/src/components/index.js +1 -0
  183. package/src/components/inserter/block-types-tab.js +9 -6
  184. package/src/components/inserter/index.js +1 -1
  185. package/src/components/inspector-controls/groups.js +2 -0
  186. package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
  187. package/src/components/list-view/block-select-button.js +6 -1
  188. package/src/components/list-view/block.js +23 -31
  189. package/src/components/list-view/drop-indicator.js +67 -22
  190. package/src/components/list-view/index.js +8 -1
  191. package/src/components/list-view/leaf.js +1 -0
  192. package/src/components/list-view/style.scss +15 -3
  193. package/src/components/list-view/use-block-selection.js +1 -1
  194. package/src/components/media-replace-flow/README.md +3 -2
  195. package/src/components/media-replace-flow/index.js +4 -5
  196. package/src/components/navigable-toolbar/index.js +12 -3
  197. package/src/components/off-canvas-editor/appender.js +1 -4
  198. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
  199. package/src/hooks/duotone.js +46 -25
  200. package/src/hooks/test/anchor.js +113 -0
  201. package/src/hooks/test/color.js +0 -9
  202. package/src/hooks/test/use-typography-props.js +2 -2
  203. package/src/hooks/test/utils.js +20 -101
  204. package/src/hooks/utils.js +20 -3
  205. package/src/private-apis.js +6 -0
  206. package/src/store/actions.js +7 -0
  207. package/src/utils/object.js +4 -4
  208. package/src/utils/test/object.js +21 -21
  209. package/src/utils/transform-styles/index.js +2 -2
  210. package/src/utils/use-should-contextual-toolbar-show.js +75 -0
  211. package/tsconfig.json +1 -0
  212. package/build/hooks/color-panel.native.js +0 -77
  213. package/build/hooks/color-panel.native.js.map +0 -1
  214. package/build-module/hooks/color-panel.native.js +0 -62
  215. package/build-module/hooks/color-panel.native.js.map +0 -1
  216. package/src/hooks/color-panel.native.js +0 -63
@@ -48,7 +48,7 @@ const cleanEmptyObject = object => {
48
48
  return [key, cleanEmptyObject(value)];
49
49
  }).filter(_ref2 => {
50
50
  let [, value] = _ref2;
51
- return Boolean(value);
51
+ return value !== undefined;
52
52
  }));
53
53
  return (0, _lodash.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
54
54
  };
@@ -97,7 +97,7 @@ function transformStyles(activeSupports, migrationPaths, result, source, index,
97
97
 
98
98
  if (styleValue) {
99
99
  returnBlock = { ...returnBlock,
100
- attributes: (0, _object.immutableSet)(returnBlock.attributes, path, styleValue)
100
+ attributes: (0, _object.setImmutably)(returnBlock.attributes, path, styleValue)
101
101
  };
102
102
  }
103
103
  });
@@ -163,9 +163,14 @@ function useBlockSettings(name, parentLayout) {
163
163
  const borderWidth = (0, _components.useSetting)('border.width');
164
164
  const customColorsEnabled = (0, _components.useSetting)('color.custom');
165
165
  const customColors = (0, _components.useSetting)('color.palette.custom');
166
+ const customDuotone = (0, _components.useSetting)('color.customDuotone');
166
167
  const themeColors = (0, _components.useSetting)('color.palette.theme');
167
168
  const defaultColors = (0, _components.useSetting)('color.palette.default');
168
169
  const defaultPalette = (0, _components.useSetting)('color.defaultPalette');
170
+ const defaultDuotone = (0, _components.useSetting)('color.defaultDuotone');
171
+ const userDuotonePalette = (0, _components.useSetting)('color.duotone.custom');
172
+ const themeDuotonePalette = (0, _components.useSetting)('color.duotone.theme');
173
+ const defaultDuotonePalette = (0, _components.useSetting)('color.duotone.default');
169
174
  const userGradientPalette = (0, _components.useSetting)('color.gradients.custom');
170
175
  const themeGradientPalette = (0, _components.useSetting)('color.gradients.theme');
171
176
  const defaultGradientPalette = (0, _components.useSetting)('color.gradients.default');
@@ -187,10 +192,17 @@ function useBlockSettings(name, parentLayout) {
187
192
  theme: themeGradientPalette,
188
193
  default: defaultGradientPalette
189
194
  },
195
+ duotone: {
196
+ custom: userDuotonePalette,
197
+ theme: themeDuotonePalette,
198
+ default: defaultDuotonePalette
199
+ },
190
200
  defaultGradients,
191
201
  defaultPalette,
202
+ defaultDuotone,
192
203
  custom: customColorsEnabled,
193
204
  customGradient: areCustomGradientsEnabled,
205
+ customDuotone,
194
206
  background: isBackgroundEnabled,
195
207
  link: isLinkEnabled,
196
208
  text: isTextEnabled
@@ -232,7 +244,7 @@ function useBlockSettings(name, parentLayout) {
232
244
  layout,
233
245
  parentLayout
234
246
  };
235
- }, [fontFamilies, fontSizes, customFontSize, fontStyle, fontWeight, lineHeight, textColumns, textDecoration, textTransform, letterSpacing, padding, margin, blockGap, spacingSizes, units, minHeight, layout, parentLayout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, themeColors, defaultColors, defaultPalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled]);
247
+ }, [fontFamilies, fontSizes, customFontSize, fontStyle, fontWeight, lineHeight, textColumns, textDecoration, textTransform, letterSpacing, padding, margin, blockGap, spacingSizes, units, minHeight, layout, parentLayout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled]);
236
248
  return (0, _hooks.useSettingsForBlockElement)(rawSettings, name);
237
249
  }
238
250
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/utils.js"],"names":["cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","fromEntries","entries","map","key","value","filter","Boolean","undefined","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","length","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","shouldSkipSerialization","blockType","featureSet","feature","skipSerialization","__experimentalSkipSerialization","includes","useBlockSettings","name","parentLayout","fontFamilies","fontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textColumns","textDecoration","textTransform","letterSpacing","padding","margin","blockGap","spacingSizes","units","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","themeColors","defaultColors","defaultPalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","rawSettings","color","palette","custom","theme","default","gradients","customGradient","background","link","text","typography","spacing","border","radius","style","width","dimensions"],"mappings":";;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAKC,MAAF,IAAc;AAC7C,MACCA,MAAM,KAAK,IAAX,IACA,OAAOA,MAAP,KAAkB,QADlB,IAEAC,KAAK,CAACC,OAAN,CAAeF,MAAf,CAHD,EAIE;AACD,WAAOA,MAAP;AACA;;AACD,QAAMG,oBAAoB,GAAGC,MAAM,CAACC,WAAP,CAC5BD,MAAM,CAACE,OAAP,CAAgBN,MAAhB,EACEO,GADF,CACO;AAAA,QAAE,CAAEC,GAAF,EAAOC,KAAP,CAAF;AAAA,WAAsB,CAAED,GAAF,EAAOT,gBAAgB,CAAEU,KAAF,CAAvB,CAAtB;AAAA,GADP,EAEEC,MAFF,CAEU;AAAA,QAAE,GAAID,KAAJ,CAAF;AAAA,WAAmBE,OAAO,CAAEF,KAAF,CAA1B;AAAA,GAFV,CAD4B,CAA7B;AAKA,SAAO,qBAASN,oBAAT,IAAkCS,SAAlC,GAA8CT,oBAArD;AACA,CAdM;;;;AAgBA,SAASU,eAAT,CACNC,cADM,EAENC,cAFM,EAGNC,MAHM,EAINC,MAJM,EAKNC,KALM,EAMNC,OANM,EAOL;AAAA;;AACD;AACA,MACCf,MAAM,CAACgB,MAAP,CAAeN,cAAf,aAAeA,cAAf,cAAeA,cAAf,GAAiC,EAAjC,EAAsCO,KAAtC,CACGC,QAAF,IAAgB,CAAEA,QADnB,CADD,EAIE;AACD,WAAON,MAAP;AACA,GARA,CASD;AACA;;;AACA,MAAKG,OAAO,CAACI,MAAR,KAAmB,CAAnB,IAAwBP,MAAM,CAACQ,WAAP,CAAmBD,MAAnB,KAA8BN,MAAM,CAACM,MAAlE,EAA2E;AAC1E,WAAOP,MAAP;AACA,GAbA,CAcD;AACA;AACA;;;A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DiB,CAApB;AAgGA,SAAO,uCAA4BC,WAA5B,EAAyCpC,IAAzC,CAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSetting } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { immutableSet } from '../utils/object';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\tconst cleanedNestedObjects = Object.fromEntries(\n\t\tObject.entries( object )\n\t\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t\t.filter( ( [ , value ] ) => Boolean( value ) )\n\t);\n\treturn isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = get( referenceBlockAttributes, path );\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: immutableSet(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization( blockType, featureSet, feature ) {\n\tconst support = getBlockSupport( blockType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst fontFamilies = useSetting( 'typography.fontFamilies' );\n\tconst fontSizes = useSetting( 'typography.fontSizes' );\n\tconst customFontSize = useSetting( 'typography.customFontSize' );\n\tconst fontStyle = useSetting( 'typography.fontStyle' );\n\tconst fontWeight = useSetting( 'typography.fontWeight' );\n\tconst lineHeight = useSetting( 'typography.lineHeight' );\n\tconst textColumns = useSetting( 'typography.textColumns' );\n\tconst textDecoration = useSetting( 'typography.textDecoration' );\n\tconst textTransform = useSetting( 'typography.textTransform' );\n\tconst letterSpacing = useSetting( 'typography.letterSpacing' );\n\tconst padding = useSetting( 'spacing.padding' );\n\tconst margin = useSetting( 'spacing.margin' );\n\tconst blockGap = useSetting( 'spacing.blockGap' );\n\tconst spacingSizes = useSetting( 'spacing.spacingSizes' );\n\tconst units = useSetting( 'spacing.units' );\n\tconst minHeight = useSetting( 'dimensions.minHeight' );\n\tconst layout = useSetting( 'layout' );\n\tconst borderColor = useSetting( 'border.color' );\n\tconst borderRadius = useSetting( 'border.radius' );\n\tconst borderStyle = useSetting( 'border.style' );\n\tconst borderWidth = useSetting( 'border.width' );\n\tconst customColorsEnabled = useSetting( 'color.custom' );\n\tconst customColors = useSetting( 'color.palette.custom' );\n\tconst themeColors = useSetting( 'color.palette.theme' );\n\tconst defaultColors = useSetting( 'color.palette.default' );\n\tconst defaultPalette = useSetting( 'color.defaultPalette' );\n\tconst userGradientPalette = useSetting( 'color.gradients.custom' );\n\tconst themeGradientPalette = useSetting( 'color.gradients.theme' );\n\tconst defaultGradientPalette = useSetting( 'color.gradients.default' );\n\tconst defaultGradients = useSetting( 'color.defaultGradients' );\n\tconst areCustomGradientsEnabled = useSetting( 'color.customGradient' );\n\tconst isBackgroundEnabled = useSetting( 'color.background' );\n\tconst isLinkEnabled = useSetting( 'color.link' );\n\tconst isTextEnabled = useSetting( 'color.text' );\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: fontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: fontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: spacingSizes,\n\t\t\t\t},\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t};\n\t}, [\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/utils.js"],"names":["cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","fromEntries","entries","map","key","value","filter","undefined","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","length","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","shouldSkipSerialization","blockType","featureSet","feature","skipSerialization","__experimentalSkipSerialization","includes","useBlockSettings","name","parentLayout","fontFamilies","fontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textColumns","textDecoration","textTransform","letterSpacing","padding","margin","blockGap","spacingSizes","units","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","rawSettings","color","palette","custom","theme","default","gradients","duotone","customGradient","background","link","text","typography","spacing","border","radius","style","width","dimensions"],"mappings":";;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAKC,MAAF,IAAc;AAC7C,MACCA,MAAM,KAAK,IAAX,IACA,OAAOA,MAAP,KAAkB,QADlB,IAEAC,KAAK,CAACC,OAAN,CAAeF,MAAf,CAHD,EAIE;AACD,WAAOA,MAAP;AACA;;AACD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C,mBA/BE,EAgCFC,qBAhCE,EAiCFC,mBAjCE,EAkCFC,oBAlCE,EAmCFC,sBAnCE,EAoCFC,gBApCE,EAqCFC,yBArCE,EAsCFC,mBAtCE,EAuCFC,aAvCE,EAwCFC,aAxCE,CAjEiB,CAApB;AA4GA,SAAO,uCAA4BC,WAA5B,EAAyCzC,IAAzC,CAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSetting } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { setImmutably } from '../utils/object';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\tconst cleanedNestedObjects = Object.fromEntries(\n\t\tObject.entries( object )\n\t\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t\t.filter( ( [ , value ] ) => value !== undefined )\n\t);\n\treturn isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = get( referenceBlockAttributes, path );\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization( blockType, featureSet, feature ) {\n\tconst support = getBlockSupport( blockType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst fontFamilies = useSetting( 'typography.fontFamilies' );\n\tconst fontSizes = useSetting( 'typography.fontSizes' );\n\tconst customFontSize = useSetting( 'typography.customFontSize' );\n\tconst fontStyle = useSetting( 'typography.fontStyle' );\n\tconst fontWeight = useSetting( 'typography.fontWeight' );\n\tconst lineHeight = useSetting( 'typography.lineHeight' );\n\tconst textColumns = useSetting( 'typography.textColumns' );\n\tconst textDecoration = useSetting( 'typography.textDecoration' );\n\tconst textTransform = useSetting( 'typography.textTransform' );\n\tconst letterSpacing = useSetting( 'typography.letterSpacing' );\n\tconst padding = useSetting( 'spacing.padding' );\n\tconst margin = useSetting( 'spacing.margin' );\n\tconst blockGap = useSetting( 'spacing.blockGap' );\n\tconst spacingSizes = useSetting( 'spacing.spacingSizes' );\n\tconst units = useSetting( 'spacing.units' );\n\tconst minHeight = useSetting( 'dimensions.minHeight' );\n\tconst layout = useSetting( 'layout' );\n\tconst borderColor = useSetting( 'border.color' );\n\tconst borderRadius = useSetting( 'border.radius' );\n\tconst borderStyle = useSetting( 'border.style' );\n\tconst borderWidth = useSetting( 'border.width' );\n\tconst customColorsEnabled = useSetting( 'color.custom' );\n\tconst customColors = useSetting( 'color.palette.custom' );\n\tconst customDuotone = useSetting( 'color.customDuotone' );\n\tconst themeColors = useSetting( 'color.palette.theme' );\n\tconst defaultColors = useSetting( 'color.palette.default' );\n\tconst defaultPalette = useSetting( 'color.defaultPalette' );\n\tconst defaultDuotone = useSetting( 'color.defaultDuotone' );\n\tconst userDuotonePalette = useSetting( 'color.duotone.custom' );\n\tconst themeDuotonePalette = useSetting( 'color.duotone.theme' );\n\tconst defaultDuotonePalette = useSetting( 'color.duotone.default' );\n\tconst userGradientPalette = useSetting( 'color.gradients.custom' );\n\tconst themeGradientPalette = useSetting( 'color.gradients.theme' );\n\tconst defaultGradientPalette = useSetting( 'color.gradients.default' );\n\tconst defaultGradients = useSetting( 'color.defaultGradients' );\n\tconst areCustomGradientsEnabled = useSetting( 'color.customGradient' );\n\tconst isBackgroundEnabled = useSetting( 'color.background' );\n\tconst isLinkEnabled = useSetting( 'color.link' );\n\tconst isTextEnabled = useSetting( 'color.text' );\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: fontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: fontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: spacingSizes,\n\t\t\t\t},\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t};\n\t}, [\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n"]}
@@ -23,6 +23,12 @@ var _inserter = require("./components/inserter");
23
23
 
24
24
  var _listView = require("./components/list-view");
25
25
 
26
+ var _blockInfoSlotFill = _interopRequireDefault(require("./components/block-info-slot-fill"));
27
+
28
+ var _useShouldContextualToolbarShow = require("./utils/use-should-contextual-toolbar-show");
29
+
30
+ var _utils = require("./hooks/utils");
31
+
26
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
33
 
28
34
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -42,6 +48,9 @@ exports.privateApis = privateApis;
42
48
  OffCanvasEditor: _offCanvasEditor.default,
43
49
  PrivateInserter: _inserter.ComposedPrivateInserter,
44
50
  PrivateListView: _listView.PrivateListView,
45
- ResizableBoxPopover: _resizableBoxPopover.default
51
+ ResizableBoxPopover: _resizableBoxPopover.default,
52
+ BlockInfo: _blockInfoSlotFill.default,
53
+ useShouldContextualToolbarShow: _useShouldContextualToolbarShow.useShouldContextualToolbarShow,
54
+ cleanEmptyObject: _utils.cleanEmptyObject
46
55
  });
47
56
  //# sourceMappingURL=private-apis.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/private-apis.js"],"names":["privateApis","globalStyles","ExperimentalBlockEditorProvider","LeafMoreMenu","OffCanvasEditor","PrivateInserter","PrivateListView","ResizableBoxPopover"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAVA;AACA;AACA;;AAUA;AACA;AACA;AACO,MAAMA,WAAW,GAAG,EAApB;;AACP,sBAAMA,WAAN,EAAmB,EAClB,GAAGC,YADe;AAElBC,EAAAA,+BAA+B,EAA/BA,yCAFkB;AAGlBC,EAAAA,YAAY,EAAZA,qBAHkB;AAIlBC,EAAAA,eAAe,EAAfA,wBAJkB;AAKlBC,EAAAA,eAAe,EAAfA,iCALkB;AAMlBC,EAAAA,eAAe,EAAfA,yBANkB;AAOlBC,EAAAA,mBAAmB,EAAnBA;AAPkB,CAAnB","sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport OffCanvasEditor from './components/off-canvas-editor';\nimport LeafMoreMenu from './components/off-canvas-editor/leaf-more-menu';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { ComposedPrivateInserter as PrivateInserter } from './components/inserter';\nimport { PrivateListView } from './components/list-view';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockEditorProvider,\n\tLeafMoreMenu,\n\tOffCanvasEditor,\n\tPrivateInserter,\n\tPrivateListView,\n\tResizableBoxPopover,\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/private-apis.js"],"names":["privateApis","globalStyles","ExperimentalBlockEditorProvider","LeafMoreMenu","OffCanvasEditor","PrivateInserter","PrivateListView","ResizableBoxPopover","BlockInfo","useShouldContextualToolbarShow","cleanEmptyObject"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAbA;AACA;AACA;;AAaA;AACA;AACA;AACO,MAAMA,WAAW,GAAG,EAApB;;AACP,sBAAMA,WAAN,EAAmB,EAClB,GAAGC,YADe;AAElBC,EAAAA,+BAA+B,EAA/BA,yCAFkB;AAGlBC,EAAAA,YAAY,EAAZA,qBAHkB;AAIlBC,EAAAA,eAAe,EAAfA,wBAJkB;AAKlBC,EAAAA,eAAe,EAAfA,iCALkB;AAMlBC,EAAAA,eAAe,EAAfA,yBANkB;AAOlBC,EAAAA,mBAAmB,EAAnBA,4BAPkB;AAQlBC,EAAAA,SAAS,EAATA,0BARkB;AASlBC,EAAAA,8BAA8B,EAA9BA,8DATkB;AAUlBC,EAAAA,gBAAgB,EAAhBA;AAVkB,CAAnB","sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport OffCanvasEditor from './components/off-canvas-editor';\nimport LeafMoreMenu from './components/off-canvas-editor/leaf-more-menu';\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';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockEditorProvider,\n\tLeafMoreMenu,\n\tOffCanvasEditor,\n\tPrivateInserter,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tBlockInfo,\n\tuseShouldContextualToolbarShow,\n\tcleanEmptyObject,\n} );\n"]}
@@ -641,6 +641,9 @@ function moveBlockToPosition(clientId) {
641
641
  /**
642
642
  * Action that inserts a single block, optionally at a specific index respective a root block list.
643
643
  *
644
+ * Only allowed blocks are inserted. The action may fail silently for blocks that are not allowed or if
645
+ * a templateLock is active on the block list.
646
+ *
644
647
  * @param {Object} block Block object to insert.
645
648
  * @param {?number} index Index at which block should be inserted.
646
649
  * @param {?string} rootClientId Optional root client ID of block list on which to insert.
@@ -659,12 +662,16 @@ function insertBlock(block, index, rootClientId, updateSelection, meta) {
659
662
  /**
660
663
  * Action that inserts an array of blocks, optionally at a specific index respective a root block list.
661
664
  *
665
+ * Only allowed blocks are inserted. The action may fail silently for blocks that are not allowed or if
666
+ * a templateLock is active on the block list.
667
+ *
662
668
  * @param {Object[]} blocks Block objects to insert.
663
669
  * @param {?number} index Index at which block should be inserted.
664
670
  * @param {?string} rootClientId Optional root client ID of block list on which to insert.
665
671
  * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true.
666
672
  * @param {0|-1|null} initialPosition Initial focus position. Setting it to null prevent focusing the inserted block.
667
673
  * @param {?Object} meta Optional Meta values to be passed to the action object.
674
+ *
668
675
  * @return {Object} Action object.
669
676
  */
670
677