@wordpress/block-editor 14.8.0 → 14.8.1-next.cd6172eb0.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 (249) hide show
  1. package/build/autocompleters/block.js +2 -4
  2. package/build/autocompleters/block.js.map +1 -1
  3. package/build/autocompleters/link.js +2 -4
  4. package/build/autocompleters/link.js.map +1 -1
  5. package/build/components/block-canvas/index.js +3 -6
  6. package/build/components/block-canvas/index.js.map +1 -1
  7. package/build/components/block-list/block.js +6 -5
  8. package/build/components/block-list/block.js.map +1 -1
  9. package/build/components/block-list/index.js +0 -1
  10. package/build/components/block-list/index.js.map +1 -1
  11. package/build/components/block-list/use-block-props/index.js +7 -2
  12. package/build/components/block-list/use-block-props/index.js.map +1 -1
  13. package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +34 -0
  14. package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -0
  15. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +98 -5
  16. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  17. package/build/components/block-patterns-list/index.js +13 -4
  18. package/build/components/block-patterns-list/index.js.map +1 -1
  19. package/build/components/block-popover/inbetween.js +4 -0
  20. package/build/components/block-popover/inbetween.js.map +1 -1
  21. package/build/components/block-settings-menu/block-settings-dropdown.js +7 -4
  22. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  23. package/build/components/block-settings-menu-controls/index.js +1 -1
  24. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  25. package/build/components/block-switcher/index.js +12 -22
  26. package/build/components/block-switcher/index.js.map +1 -1
  27. package/build/components/block-switcher/use-transformed-patterns.js +0 -1
  28. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  29. package/build/components/block-switcher/utils.js +0 -1
  30. package/build/components/block-switcher/utils.js.map +1 -1
  31. package/build/components/block-toolbar/index.js +7 -6
  32. package/build/components/block-toolbar/index.js.map +1 -1
  33. package/build/components/block-variation-transforms/index.js +0 -1
  34. package/build/components/block-variation-transforms/index.js.map +1 -1
  35. package/build/components/date-format-picker/index.js +0 -1
  36. package/build/components/date-format-picker/index.js.map +1 -1
  37. package/build/components/font-appearance-control/index.js +1 -0
  38. package/build/components/font-appearance-control/index.js.map +1 -1
  39. package/build/components/font-family/index.js +10 -0
  40. package/build/components/font-family/index.js.map +1 -1
  41. package/build/components/global-styles/dimensions-panel.js +17 -16
  42. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  43. package/build/components/global-styles/get-global-styles-changes.js +0 -1
  44. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  45. package/build/components/iframe/use-scale-canvas.js +68 -47
  46. package/build/components/iframe/use-scale-canvas.js.map +1 -1
  47. package/build/components/inserter/block-patterns-tab/index.js +0 -10
  48. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  49. package/build/components/inserter/menu.js +2 -1
  50. package/build/components/inserter/menu.js.map +1 -1
  51. package/build/components/inserter-draggable-blocks/index.js +19 -10
  52. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  53. package/build/components/letter-spacing-control/index.js +10 -0
  54. package/build/components/letter-spacing-control/index.js.map +1 -1
  55. package/build/components/line-height-control/index.js +1 -0
  56. package/build/components/line-height-control/index.js.map +1 -1
  57. package/build/components/media-placeholder/index.js +18 -18
  58. package/build/components/media-placeholder/index.js.map +1 -1
  59. package/build/components/observe-typing/index.js +0 -1
  60. package/build/components/observe-typing/index.js.map +1 -1
  61. package/build/components/recursion-provider/index.js +0 -1
  62. package/build/components/recursion-provider/index.js.map +1 -1
  63. package/build/components/rich-text/index.js +5 -1
  64. package/build/components/rich-text/index.js.map +1 -1
  65. package/build/components/rich-text/native/use-format-types.js +0 -1
  66. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  67. package/build/components/rich-text/use-format-types.js +0 -1
  68. package/build/components/rich-text/use-format-types.js.map +1 -1
  69. package/build/components/spacing-sizes-control/utils.js +0 -1
  70. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  71. package/build/components/typewriter/index.js +0 -1
  72. package/build/components/typewriter/index.js.map +1 -1
  73. package/build/components/use-block-drop-zone/index.js +11 -2
  74. package/build/components/use-block-drop-zone/index.js.map +1 -1
  75. package/build/components/use-moving-animation/index.js +15 -2
  76. package/build/components/use-moving-animation/index.js.map +1 -1
  77. package/build/components/use-resize-canvas/index.js +1 -1
  78. package/build/components/use-resize-canvas/index.js.map +1 -1
  79. package/build/components/writing-flow/use-drag-selection.js +11 -0
  80. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  81. package/build/components/writing-flow/use-tab-nav.js +6 -2
  82. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  83. package/build/hooks/block-bindings.js +4 -3
  84. package/build/hooks/block-bindings.js.map +1 -1
  85. package/build/hooks/gap.js +1 -1
  86. package/build/hooks/gap.js.map +1 -1
  87. package/build/hooks/generated-class-name.js +0 -1
  88. package/build/hooks/generated-class-name.js.map +1 -1
  89. package/build/store/private-selectors.js +1 -7
  90. package/build/store/private-selectors.js.map +1 -1
  91. package/build/store/reducer.js +478 -2
  92. package/build/store/reducer.js.map +1 -1
  93. package/build/store/selectors.js +12 -55
  94. package/build/store/selectors.js.map +1 -1
  95. package/build/utils/object.js +0 -1
  96. package/build/utils/object.js.map +1 -1
  97. package/build-module/autocompleters/block.js +2 -4
  98. package/build-module/autocompleters/block.js.map +1 -1
  99. package/build-module/autocompleters/link.js +2 -4
  100. package/build-module/autocompleters/link.js.map +1 -1
  101. package/build-module/components/block-canvas/index.js +3 -6
  102. package/build-module/components/block-canvas/index.js.map +1 -1
  103. package/build-module/components/block-list/block.js +8 -7
  104. package/build-module/components/block-list/block.js.map +1 -1
  105. package/build-module/components/block-list/index.js +0 -1
  106. package/build-module/components/block-list/index.js.map +1 -1
  107. package/build-module/components/block-list/use-block-props/index.js +7 -2
  108. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  109. package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +28 -0
  110. package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -0
  111. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +97 -5
  112. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  113. package/build-module/components/block-patterns-list/index.js +13 -4
  114. package/build-module/components/block-patterns-list/index.js.map +1 -1
  115. package/build-module/components/block-popover/inbetween.js +4 -0
  116. package/build-module/components/block-popover/inbetween.js.map +1 -1
  117. package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -4
  118. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  119. package/build-module/components/block-settings-menu-controls/index.js +1 -1
  120. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  121. package/build-module/components/block-switcher/index.js +13 -23
  122. package/build-module/components/block-switcher/index.js.map +1 -1
  123. package/build-module/components/block-switcher/use-transformed-patterns.js +0 -1
  124. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  125. package/build-module/components/block-switcher/utils.js +0 -1
  126. package/build-module/components/block-switcher/utils.js.map +1 -1
  127. package/build-module/components/block-toolbar/index.js +7 -6
  128. package/build-module/components/block-toolbar/index.js.map +1 -1
  129. package/build-module/components/block-variation-transforms/index.js +0 -1
  130. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  131. package/build-module/components/date-format-picker/index.js +0 -1
  132. package/build-module/components/date-format-picker/index.js.map +1 -1
  133. package/build-module/components/font-appearance-control/index.js +1 -0
  134. package/build-module/components/font-appearance-control/index.js.map +1 -1
  135. package/build-module/components/font-family/index.js +10 -0
  136. package/build-module/components/font-family/index.js.map +1 -1
  137. package/build-module/components/global-styles/dimensions-panel.js +17 -16
  138. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  139. package/build-module/components/global-styles/get-global-styles-changes.js +0 -1
  140. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  141. package/build-module/components/iframe/use-scale-canvas.js +68 -47
  142. package/build-module/components/iframe/use-scale-canvas.js.map +1 -1
  143. package/build-module/components/inserter/block-patterns-tab/index.js +1 -11
  144. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  145. package/build-module/components/inserter/menu.js +2 -1
  146. package/build-module/components/inserter/menu.js.map +1 -1
  147. package/build-module/components/inserter-draggable-blocks/index.js +20 -11
  148. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  149. package/build-module/components/letter-spacing-control/index.js +9 -0
  150. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  151. package/build-module/components/line-height-control/index.js +1 -0
  152. package/build-module/components/line-height-control/index.js.map +1 -1
  153. package/build-module/components/media-placeholder/index.js +18 -18
  154. package/build-module/components/media-placeholder/index.js.map +1 -1
  155. package/build-module/components/observe-typing/index.js +0 -1
  156. package/build-module/components/observe-typing/index.js.map +1 -1
  157. package/build-module/components/recursion-provider/index.js +0 -1
  158. package/build-module/components/recursion-provider/index.js.map +1 -1
  159. package/build-module/components/rich-text/index.js +5 -1
  160. package/build-module/components/rich-text/index.js.map +1 -1
  161. package/build-module/components/rich-text/native/use-format-types.js +0 -1
  162. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  163. package/build-module/components/rich-text/use-format-types.js +0 -1
  164. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  165. package/build-module/components/spacing-sizes-control/utils.js +0 -1
  166. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  167. package/build-module/components/typewriter/index.js +0 -1
  168. package/build-module/components/typewriter/index.js.map +1 -1
  169. package/build-module/components/use-block-drop-zone/index.js +11 -2
  170. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  171. package/build-module/components/use-moving-animation/index.js +15 -2
  172. package/build-module/components/use-moving-animation/index.js.map +1 -1
  173. package/build-module/components/use-resize-canvas/index.js +1 -1
  174. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  175. package/build-module/components/writing-flow/use-drag-selection.js +11 -0
  176. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  177. package/build-module/components/writing-flow/use-tab-nav.js +6 -2
  178. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  179. package/build-module/hooks/block-bindings.js +4 -3
  180. package/build-module/hooks/block-bindings.js.map +1 -1
  181. package/build-module/hooks/gap.js +1 -1
  182. package/build-module/hooks/gap.js.map +1 -1
  183. package/build-module/hooks/generated-class-name.js +0 -1
  184. package/build-module/hooks/generated-class-name.js.map +1 -1
  185. package/build-module/store/private-selectors.js +1 -6
  186. package/build-module/store/private-selectors.js.map +1 -1
  187. package/build-module/store/reducer.js +479 -3
  188. package/build-module/store/reducer.js.map +1 -1
  189. package/build-module/store/selectors.js +12 -55
  190. package/build-module/store/selectors.js.map +1 -1
  191. package/build-module/utils/object.js +0 -1
  192. package/build-module/utils/object.js.map +1 -1
  193. package/build-style/content-rtl.css +17 -4
  194. package/build-style/content.css +17 -4
  195. package/build-style/style-rtl.css +21 -16
  196. package/build-style/style.css +21 -16
  197. package/package.json +32 -32
  198. package/src/autocompleters/block.js +2 -4
  199. package/src/autocompleters/link.js +2 -4
  200. package/src/components/alignment-control/stories/aliginment-toolbar.story.js +47 -0
  201. package/src/components/alignment-control/stories/index.story.js +51 -0
  202. package/src/components/alignment-control/test/__snapshots__/index.js.snap +5 -5
  203. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +4 -4
  204. package/src/components/block-canvas/index.js +3 -5
  205. package/src/components/block-draggable/content.scss +11 -5
  206. package/src/components/block-list/block.js +7 -13
  207. package/src/components/block-list/content.scss +6 -0
  208. package/src/components/block-list/use-block-props/index.js +7 -0
  209. package/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +25 -0
  210. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +112 -8
  211. package/src/components/block-patterns-list/index.js +12 -1
  212. package/src/components/block-patterns-list/style.scss +16 -5
  213. package/src/components/block-popover/inbetween.js +4 -0
  214. package/src/components/block-settings-menu/block-settings-dropdown.js +6 -1
  215. package/src/components/block-settings-menu-controls/index.js +2 -1
  216. package/src/components/block-switcher/index.js +19 -21
  217. package/src/components/block-switcher/style.scss +0 -9
  218. package/src/components/block-title/test/index.js +2 -0
  219. package/src/components/block-toolbar/index.js +8 -6
  220. package/src/components/block-tools/style.scss +5 -0
  221. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
  222. package/src/components/font-appearance-control/index.js +1 -0
  223. package/src/components/font-family/index.js +10 -0
  224. package/src/components/font-family/style.scss +5 -0
  225. package/src/components/global-styles/dimensions-panel.js +16 -16
  226. package/src/components/iframe/content.scss +6 -1
  227. package/src/components/iframe/use-scale-canvas.js +103 -81
  228. package/src/components/inserter/block-patterns-tab/index.js +1 -17
  229. package/src/components/inserter/menu.js +8 -1
  230. package/src/components/inserter-draggable-blocks/index.js +19 -29
  231. package/src/components/letter-spacing-control/README.md +2 -1
  232. package/src/components/letter-spacing-control/index.js +17 -0
  233. package/src/components/line-height-control/index.js +1 -0
  234. package/src/components/media-placeholder/index.js +25 -28
  235. package/src/components/rich-text/index.js +5 -0
  236. package/src/components/use-block-drop-zone/index.js +18 -1
  237. package/src/components/use-moving-animation/index.js +15 -0
  238. package/src/components/use-resize-canvas/index.js +1 -1
  239. package/src/components/writing-flow/use-drag-selection.js +11 -0
  240. package/src/components/writing-flow/use-tab-nav.js +9 -6
  241. package/src/hooks/block-bindings.js +8 -4
  242. package/src/hooks/gap.js +1 -1
  243. package/src/store/private-selectors.js +2 -17
  244. package/src/store/reducer.js +639 -2
  245. package/src/store/selectors.js +19 -69
  246. package/src/store/test/private-selectors.js +1 -0
  247. package/src/store/test/reducer.js +849 -0
  248. package/src/store/test/selectors.js +4 -110
  249. package/src/style.scss +1 -0
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * Immutably sets a value inside an object. Like `lodash#set`, but returning a
4
3
  * new object. Treats nullish initial values as empty objects. Clones any
@@ -1 +1 @@
1
- {"version":3,"names":["setImmutably","object","path","value","Array","isArray","leaf","pop","prev","key","lvl","getValueFromObjectPath","defaultValue","_value","arrayPath","split","forEach","fieldName","uniqByProperty","array","property","seen","Set","filter","item","has","add"],"sources":["@wordpress/block-editor/src/utils/object.js"],"sourcesContent":["/**\n * Immutably sets a value inside an object. Like `lodash#set`, but returning a\n * new object. Treats nullish initial values as empty objects. Clones any\n * nested objects. Supports arrays, too.\n *\n * @param {Object} object Object to set a value in.\n * @param {number|string|Array} path Path in the object to modify.\n * @param {*} value New value to set.\n * @return {Object} Cloned object with the new value set.\n */\nexport function setImmutably( object, path, value ) {\n\t// Normalize path\n\tpath = Array.isArray( path ) ? [ ...path ] : [ path ];\n\n\t// Shallowly clone the base of the object\n\tobject = Array.isArray( object ) ? [ ...object ] : { ...object };\n\n\tconst leaf = path.pop();\n\n\t// Traverse object from root to leaf, shallowly cloning at each level\n\tlet prev = object;\n\tfor ( const key of path ) {\n\t\tconst lvl = prev[ key ];\n\t\tprev = prev[ key ] = Array.isArray( lvl ) ? [ ...lvl ] : { ...lvl };\n\t}\n\n\tprev[ leaf ] = value;\n\n\treturn object;\n}\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as either:\n * - a string of properties, separated by dots, for example: \"x.y\".\n * - an array of properties, for example `[ 'x', 'y' ]`.\n * You can also specify a default value in case the result is nullish.\n *\n * @param {Object} object Input object.\n * @param {string|Array} path Path to the object property.\n * @param {*} defaultValue Default value if the value at the specified path is nullish.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path, defaultValue ) => {\n\tconst arrayPath = Array.isArray( path ) ? path : path.split( '.' );\n\tlet value = object;\n\tarrayPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value ?? defaultValue;\n};\n\n/**\n * Helper util to filter out objects with duplicate values for a given property.\n *\n * @param {Object[]} array Array of objects to filter.\n * @param {string} property Property to filter unique values by.\n *\n * @return {Object[]} Array of objects with unique values for the specified property.\n */\nexport function uniqByProperty( array, property ) {\n\tconst seen = new Set();\n\treturn array.filter( ( item ) => {\n\t\tconst value = item[ property ];\n\t\treturn seen.has( value ) ? false : seen.add( value );\n\t} );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,YAAYA,CAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAG;EACnD;EACAD,IAAI,GAAGE,KAAK,CAACC,OAAO,CAAEH,IAAK,CAAC,GAAG,CAAE,GAAGA,IAAI,CAAE,GAAG,CAAEA,IAAI,CAAE;;EAErD;EACAD,MAAM,GAAGG,KAAK,CAACC,OAAO,CAAEJ,MAAO,CAAC,GAAG,CAAE,GAAGA,MAAM,CAAE,GAAG;IAAE,GAAGA;EAAO,CAAC;EAEhE,MAAMK,IAAI,GAAGJ,IAAI,CAACK,GAAG,CAAC,CAAC;;EAEvB;EACA,IAAIC,IAAI,GAAGP,MAAM;EACjB,KAAM,MAAMQ,GAAG,IAAIP,IAAI,EAAG;IACzB,MAAMQ,GAAG,GAAGF,IAAI,CAAEC,GAAG,CAAE;IACvBD,IAAI,GAAGA,IAAI,CAAEC,GAAG,CAAE,GAAGL,KAAK,CAACC,OAAO,CAAEK,GAAI,CAAC,GAAG,CAAE,GAAGA,GAAG,CAAE,GAAG;MAAE,GAAGA;IAAI,CAAC;EACpE;EAEAF,IAAI,CAAEF,IAAI,CAAE,GAAGH,KAAK;EAEpB,OAAOF,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,sBAAsB,GAAGA,CAAEV,MAAM,EAAEC,IAAI,EAAEU,YAAY,KAAM;EAAA,IAAAC,MAAA;EACvE,MAAMC,SAAS,GAAGV,KAAK,CAACC,OAAO,CAAEH,IAAK,CAAC,GAAGA,IAAI,GAAGA,IAAI,CAACa,KAAK,CAAE,GAAI,CAAC;EAClE,IAAIZ,KAAK,GAAGF,MAAM;EAClBa,SAAS,CAACE,OAAO,CAAIC,SAAS,IAAM;IACnCd,KAAK,GAAGA,KAAK,GAAIc,SAAS,CAAE;EAC7B,CAAE,CAAC;EACH,QAAAJ,MAAA,GAAOV,KAAK,cAAAU,MAAA,cAAAA,MAAA,GAAID,YAAY;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,cAAcA,CAAEC,KAAK,EAAEC,QAAQ,EAAG;EACjD,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAC,CAAC;EACtB,OAAOH,KAAK,CAACI,MAAM,CAAIC,IAAI,IAAM;IAChC,MAAMrB,KAAK,GAAGqB,IAAI,CAAEJ,QAAQ,CAAE;IAC9B,OAAOC,IAAI,CAACI,GAAG,CAAEtB,KAAM,CAAC,GAAG,KAAK,GAAGkB,IAAI,CAACK,GAAG,CAAEvB,KAAM,CAAC;EACrD,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["setImmutably","object","path","value","Array","isArray","leaf","pop","prev","key","lvl","getValueFromObjectPath","defaultValue","_value","arrayPath","split","forEach","fieldName","uniqByProperty","array","property","seen","Set","filter","item","has","add"],"sources":["@wordpress/block-editor/src/utils/object.js"],"sourcesContent":["/**\n * Immutably sets a value inside an object. Like `lodash#set`, but returning a\n * new object. Treats nullish initial values as empty objects. Clones any\n * nested objects. Supports arrays, too.\n *\n * @param {Object} object Object to set a value in.\n * @param {number|string|Array} path Path in the object to modify.\n * @param {*} value New value to set.\n * @return {Object} Cloned object with the new value set.\n */\nexport function setImmutably( object, path, value ) {\n\t// Normalize path\n\tpath = Array.isArray( path ) ? [ ...path ] : [ path ];\n\n\t// Shallowly clone the base of the object\n\tobject = Array.isArray( object ) ? [ ...object ] : { ...object };\n\n\tconst leaf = path.pop();\n\n\t// Traverse object from root to leaf, shallowly cloning at each level\n\tlet prev = object;\n\tfor ( const key of path ) {\n\t\tconst lvl = prev[ key ];\n\t\tprev = prev[ key ] = Array.isArray( lvl ) ? [ ...lvl ] : { ...lvl };\n\t}\n\n\tprev[ leaf ] = value;\n\n\treturn object;\n}\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as either:\n * - a string of properties, separated by dots, for example: \"x.y\".\n * - an array of properties, for example `[ 'x', 'y' ]`.\n * You can also specify a default value in case the result is nullish.\n *\n * @param {Object} object Input object.\n * @param {string|Array} path Path to the object property.\n * @param {*} defaultValue Default value if the value at the specified path is nullish.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path, defaultValue ) => {\n\tconst arrayPath = Array.isArray( path ) ? path : path.split( '.' );\n\tlet value = object;\n\tarrayPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value ?? defaultValue;\n};\n\n/**\n * Helper util to filter out objects with duplicate values for a given property.\n *\n * @param {Object[]} array Array of objects to filter.\n * @param {string} property Property to filter unique values by.\n *\n * @return {Object[]} Array of objects with unique values for the specified property.\n */\nexport function uniqByProperty( array, property ) {\n\tconst seen = new Set();\n\treturn array.filter( ( item ) => {\n\t\tconst value = item[ property ];\n\t\treturn seen.has( value ) ? false : seen.add( value );\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,YAAYA,CAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAG;EACnD;EACAD,IAAI,GAAGE,KAAK,CAACC,OAAO,CAAEH,IAAK,CAAC,GAAG,CAAE,GAAGA,IAAI,CAAE,GAAG,CAAEA,IAAI,CAAE;;EAErD;EACAD,MAAM,GAAGG,KAAK,CAACC,OAAO,CAAEJ,MAAO,CAAC,GAAG,CAAE,GAAGA,MAAM,CAAE,GAAG;IAAE,GAAGA;EAAO,CAAC;EAEhE,MAAMK,IAAI,GAAGJ,IAAI,CAACK,GAAG,CAAC,CAAC;;EAEvB;EACA,IAAIC,IAAI,GAAGP,MAAM;EACjB,KAAM,MAAMQ,GAAG,IAAIP,IAAI,EAAG;IACzB,MAAMQ,GAAG,GAAGF,IAAI,CAAEC,GAAG,CAAE;IACvBD,IAAI,GAAGA,IAAI,CAAEC,GAAG,CAAE,GAAGL,KAAK,CAACC,OAAO,CAAEK,GAAI,CAAC,GAAG,CAAE,GAAGA,GAAG,CAAE,GAAG;MAAE,GAAGA;IAAI,CAAC;EACpE;EAEAF,IAAI,CAAEF,IAAI,CAAE,GAAGH,KAAK;EAEpB,OAAOF,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,sBAAsB,GAAGA,CAAEV,MAAM,EAAEC,IAAI,EAAEU,YAAY,KAAM;EAAA,IAAAC,MAAA;EACvE,MAAMC,SAAS,GAAGV,KAAK,CAACC,OAAO,CAAEH,IAAK,CAAC,GAAGA,IAAI,GAAGA,IAAI,CAACa,KAAK,CAAE,GAAI,CAAC;EAClE,IAAIZ,KAAK,GAAGF,MAAM;EAClBa,SAAS,CAACE,OAAO,CAAIC,SAAS,IAAM;IACnCd,KAAK,GAAGA,KAAK,GAAIc,SAAS,CAAE;EAC7B,CAAE,CAAC;EACH,QAAAJ,MAAA,GAAOV,KAAK,cAAAU,MAAA,cAAAA,MAAA,GAAID,YAAY;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,cAAcA,CAAEC,KAAK,EAAEC,QAAQ,EAAG;EACjD,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAC,CAAC;EACtB,OAAOH,KAAK,CAACI,MAAM,CAAIC,IAAI,IAAM;IAChC,MAAMrB,KAAK,GAAGqB,IAAI,CAAEJ,QAAQ,CAAE;IAC9B,OAAOC,IAAI,CAACI,GAAG,CAAEtB,KAAM,CAAC,GAAG,KAAK,GAAGkB,IAAI,CAACK,GAAG,CAAEvB,KAAM,CAAC;EACrD,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -490,6 +490,10 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
490
490
  margin: 0 calc(-1 * var(--wp--style--root--padding-left) - 1px) 0 calc(-1 * var(--wp--style--root--padding-right) - 1px) !important;
491
491
  }
492
492
 
493
+ .is-dragging {
494
+ cursor: grabbing;
495
+ }
496
+
493
497
  .is-vertical .block-list-appender {
494
498
  width: 24px;
495
499
  margin-left: auto;
@@ -519,10 +523,11 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
519
523
  }
520
524
 
521
525
  .block-editor-block-list__layout .is-dragging {
522
- background-color: currentColor !important;
523
- opacity: 0.05 !important;
526
+ opacity: 0.1 !important;
524
527
  border-radius: 2px !important;
525
- pointer-events: none !important;
528
+ }
529
+ .block-editor-block-list__layout .is-dragging iframe {
530
+ pointer-events: none;
526
531
  }
527
532
  .block-editor-block-list__layout .is-dragging::selection {
528
533
  background: transparent !important;
@@ -531,6 +536,11 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
531
536
  content: none !important;
532
537
  }
533
538
 
539
+ .wp-block img:not([draggable]),
540
+ .wp-block svg:not([draggable]) {
541
+ pointer-events: none;
542
+ }
543
+
534
544
  .block-editor-block-preview__content-iframe .block-list-appender {
535
545
  display: none;
536
546
  }
@@ -785,7 +795,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
785
795
  left: 0;
786
796
  top: calc(-1 * var(--wp-block-editor-iframe-zoom-out-scroll-top, 0));
787
797
  bottom: 0;
788
- overflow-y: scroll;
798
+ overflow-y: var(--wp-block-editor-iframe-zoom-out-overflow-behavior, scroll);
789
799
  }
790
800
  .block-editor-iframe__html.is-zoomed-out {
791
801
  transform: translateX(calc(-1*((var(--wp-block-editor-iframe-zoom-out-scale-container-width) - var(--wp-block-editor-iframe-zoom-out-container-width, 100vw)) / 2 / var(--wp-block-editor-iframe-zoom-out-scale, 1))));
@@ -807,6 +817,9 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
807
817
  .block-editor-iframe__html.is-zoomed-out body > .is-root-container:not(.wp-block-post-content) > main {
808
818
  flex: 1;
809
819
  }
820
+ .block-editor-iframe__html.is-zoomed-out .wp-block[draggable] {
821
+ cursor: grab;
822
+ }
810
823
 
811
824
  .block-editor-media-placeholder__url-input-form {
812
825
  min-width: 260px;
@@ -490,6 +490,10 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
490
490
  margin: 0 calc(-1 * var(--wp--style--root--padding-right) - 1px) 0 calc(-1 * var(--wp--style--root--padding-left) - 1px) !important;
491
491
  }
492
492
 
493
+ .is-dragging {
494
+ cursor: grabbing;
495
+ }
496
+
493
497
  .is-vertical .block-list-appender {
494
498
  width: 24px;
495
499
  margin-right: auto;
@@ -519,10 +523,11 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
519
523
  }
520
524
 
521
525
  .block-editor-block-list__layout .is-dragging {
522
- background-color: currentColor !important;
523
- opacity: 0.05 !important;
526
+ opacity: 0.1 !important;
524
527
  border-radius: 2px !important;
525
- pointer-events: none !important;
528
+ }
529
+ .block-editor-block-list__layout .is-dragging iframe {
530
+ pointer-events: none;
526
531
  }
527
532
  .block-editor-block-list__layout .is-dragging::selection {
528
533
  background: transparent !important;
@@ -531,6 +536,11 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
531
536
  content: none !important;
532
537
  }
533
538
 
539
+ .wp-block img:not([draggable]),
540
+ .wp-block svg:not([draggable]) {
541
+ pointer-events: none;
542
+ }
543
+
534
544
  .block-editor-block-preview__content-iframe .block-list-appender {
535
545
  display: none;
536
546
  }
@@ -785,7 +795,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
785
795
  right: 0;
786
796
  top: calc(-1 * var(--wp-block-editor-iframe-zoom-out-scroll-top, 0));
787
797
  bottom: 0;
788
- overflow-y: scroll;
798
+ overflow-y: var(--wp-block-editor-iframe-zoom-out-overflow-behavior, scroll);
789
799
  }
790
800
  .block-editor-iframe__html.is-zoomed-out {
791
801
  transform: translateX(calc((var(--wp-block-editor-iframe-zoom-out-scale-container-width) - var(--wp-block-editor-iframe-zoom-out-container-width, 100vw)) / 2 / var(--wp-block-editor-iframe-zoom-out-scale, 1)));
@@ -807,6 +817,9 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
807
817
  .block-editor-iframe__html.is-zoomed-out body > .is-root-container:not(.wp-block-post-content) > main {
808
818
  flex: 1;
809
819
  }
820
+ .block-editor-iframe__html.is-zoomed-out .wp-block[draggable] {
821
+ cursor: grab;
822
+ }
810
823
 
811
824
  .block-editor-media-placeholder__url-input-form {
812
825
  min-width: 260px;
@@ -475,6 +475,9 @@ iframe[name=editor-canvas] {
475
475
  .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button:focus::before {
476
476
  box-shadow: inset 0 0 0 1px #1e1e1e, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
477
477
  }
478
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button:disabled, .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button[aria-disabled=true] {
479
+ color: #757575;
480
+ }
478
481
  .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
479
482
  border-color: #2f2f2f;
480
483
  background-color: #1e1e1e;
@@ -1007,22 +1010,27 @@ iframe[name=editor-canvas] {
1007
1010
  outline: 1px solid rgba(0, 0, 0, 0.1);
1008
1011
  outline-offset: -1px;
1009
1012
  border-radius: 4px;
1010
- }
1011
- .block-editor-block-patterns-list__item:hover:not(:focus) .block-editor-block-preview__container::after {
1012
- outline-color: rgba(0, 0, 0, 0.3);
1013
- }
1014
- .block-editor-block-patterns-list__item:focus .block-editor-block-preview__container::after {
1015
- outline-color: var(--wp-admin-theme-color);
1016
- outline-width: var(--wp-admin-border-width-focus);
1017
- outline-offset: calc((-1 * var(--wp-admin-border-width-focus)));
1018
1013
  transition: outline 0.1s linear;
1019
1014
  }
1020
1015
  @media (prefers-reduced-motion: reduce) {
1021
- .block-editor-block-patterns-list__item:focus .block-editor-block-preview__container::after {
1016
+ .block-editor-block-patterns-list__item .block-editor-block-preview__container::after {
1022
1017
  transition-duration: 0s;
1023
1018
  transition-delay: 0s;
1024
1019
  }
1025
1020
  }
1021
+ .block-editor-block-patterns-list__item.is-selected .block-editor-block-preview__container::after {
1022
+ outline-color: #1e1e1e;
1023
+ outline-width: var(--wp-admin-border-width-focus);
1024
+ outline-offset: calc(-1 * var(--wp-admin-border-width-focus));
1025
+ }
1026
+ .block-editor-block-patterns-list__item:hover .block-editor-block-preview__container::after {
1027
+ outline-color: rgba(0, 0, 0, 0.3);
1028
+ }
1029
+ .block-editor-block-patterns-list__item[data-focus-visible] .block-editor-block-preview__container::after {
1030
+ outline-color: var(--wp-admin-theme-color);
1031
+ outline-width: var(--wp-admin-border-width-focus);
1032
+ outline-offset: calc(-1 * var(--wp-admin-border-width-focus));
1033
+ }
1026
1034
  .block-editor-block-patterns-list__item .block-editor-patterns__pattern-details:not(:empty) {
1027
1035
  align-items: center;
1028
1036
  margin-top: 8px;
@@ -1200,13 +1208,6 @@ iframe[name=editor-canvas] {
1200
1208
  margin: auto;
1201
1209
  }
1202
1210
 
1203
- .block-editor-block-switcher__toggle-text {
1204
- margin-right: 8px;
1205
- }
1206
- .show-icon-labels .block-editor-block-switcher__toggle-text {
1207
- display: none;
1208
- }
1209
-
1210
1211
  .components-button.block-editor-block-switcher__no-switcher-icon {
1211
1212
  display: flex;
1212
1213
  }
@@ -1664,6 +1665,10 @@ iframe[name=editor-canvas] {
1664
1665
  text-transform: capitalize;
1665
1666
  }
1666
1667
 
1668
+ .block-editor-font-family-control:not(.is-next-has-no-margin-bottom) {
1669
+ margin-bottom: 8px;
1670
+ }
1671
+
1667
1672
  .block-editor-global-styles__toggle-icon {
1668
1673
  fill: currentColor;
1669
1674
  }
@@ -475,6 +475,9 @@ iframe[name=editor-canvas] {
475
475
  .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button:focus::before {
476
476
  box-shadow: inset 0 0 0 1px #1e1e1e, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
477
477
  }
478
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button:disabled, .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button[aria-disabled=true] {
479
+ color: #757575;
480
+ }
478
481
  .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
479
482
  border-color: #2f2f2f;
480
483
  background-color: #1e1e1e;
@@ -1007,22 +1010,27 @@ iframe[name=editor-canvas] {
1007
1010
  outline: 1px solid rgba(0, 0, 0, 0.1);
1008
1011
  outline-offset: -1px;
1009
1012
  border-radius: 4px;
1010
- }
1011
- .block-editor-block-patterns-list__item:hover:not(:focus) .block-editor-block-preview__container::after {
1012
- outline-color: rgba(0, 0, 0, 0.3);
1013
- }
1014
- .block-editor-block-patterns-list__item:focus .block-editor-block-preview__container::after {
1015
- outline-color: var(--wp-admin-theme-color);
1016
- outline-width: var(--wp-admin-border-width-focus);
1017
- outline-offset: calc((-1 * var(--wp-admin-border-width-focus)));
1018
1013
  transition: outline 0.1s linear;
1019
1014
  }
1020
1015
  @media (prefers-reduced-motion: reduce) {
1021
- .block-editor-block-patterns-list__item:focus .block-editor-block-preview__container::after {
1016
+ .block-editor-block-patterns-list__item .block-editor-block-preview__container::after {
1022
1017
  transition-duration: 0s;
1023
1018
  transition-delay: 0s;
1024
1019
  }
1025
1020
  }
1021
+ .block-editor-block-patterns-list__item.is-selected .block-editor-block-preview__container::after {
1022
+ outline-color: #1e1e1e;
1023
+ outline-width: var(--wp-admin-border-width-focus);
1024
+ outline-offset: calc(-1 * var(--wp-admin-border-width-focus));
1025
+ }
1026
+ .block-editor-block-patterns-list__item:hover .block-editor-block-preview__container::after {
1027
+ outline-color: rgba(0, 0, 0, 0.3);
1028
+ }
1029
+ .block-editor-block-patterns-list__item[data-focus-visible] .block-editor-block-preview__container::after {
1030
+ outline-color: var(--wp-admin-theme-color);
1031
+ outline-width: var(--wp-admin-border-width-focus);
1032
+ outline-offset: calc(-1 * var(--wp-admin-border-width-focus));
1033
+ }
1026
1034
  .block-editor-block-patterns-list__item .block-editor-patterns__pattern-details:not(:empty) {
1027
1035
  align-items: center;
1028
1036
  margin-top: 8px;
@@ -1200,13 +1208,6 @@ iframe[name=editor-canvas] {
1200
1208
  margin: auto;
1201
1209
  }
1202
1210
 
1203
- .block-editor-block-switcher__toggle-text {
1204
- margin-left: 8px;
1205
- }
1206
- .show-icon-labels .block-editor-block-switcher__toggle-text {
1207
- display: none;
1208
- }
1209
-
1210
1211
  .components-button.block-editor-block-switcher__no-switcher-icon {
1211
1212
  display: flex;
1212
1213
  }
@@ -1664,6 +1665,10 @@ iframe[name=editor-canvas] {
1664
1665
  text-transform: capitalize;
1665
1666
  }
1666
1667
 
1668
+ .block-editor-font-family-control:not(.is-next-has-no-margin-bottom) {
1669
+ margin-bottom: 8px;
1670
+ }
1671
+
1667
1672
  .block-editor-global-styles__toggle-icon {
1668
1673
  fill: currentColor;
1669
1674
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "14.8.0",
3
+ "version": "14.8.1-next.cd6172eb0.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,37 +37,37 @@
37
37
  "@emotion/react": "^11.7.1",
38
38
  "@emotion/styled": "^11.6.0",
39
39
  "@react-spring/web": "^9.4.5",
40
- "@wordpress/a11y": "*",
41
- "@wordpress/api-fetch": "*",
42
- "@wordpress/blob": "*",
43
- "@wordpress/block-serialization-default-parser": "*",
44
- "@wordpress/blocks": "*",
45
- "@wordpress/commands": "*",
40
+ "@wordpress/a11y": "^4.13.1-next.cd6172eb0.0",
41
+ "@wordpress/api-fetch": "^7.13.1-next.cd6172eb0.0",
42
+ "@wordpress/blob": "^4.13.1-next.cd6172eb0.0",
43
+ "@wordpress/block-serialization-default-parser": "^5.13.1-next.cd6172eb0.0",
44
+ "@wordpress/blocks": "^14.2.1-next.cd6172eb0.0",
45
+ "@wordpress/commands": "^1.13.1-next.cd6172eb0.0",
46
46
  "@wordpress/components": "*",
47
- "@wordpress/compose": "*",
48
- "@wordpress/data": "*",
49
- "@wordpress/date": "*",
50
- "@wordpress/deprecated": "*",
51
- "@wordpress/dom": "*",
52
- "@wordpress/element": "*",
53
- "@wordpress/escape-html": "*",
54
- "@wordpress/hooks": "*",
55
- "@wordpress/html-entities": "*",
56
- "@wordpress/i18n": "*",
57
- "@wordpress/icons": "*",
58
- "@wordpress/is-shallow-equal": "*",
59
- "@wordpress/keyboard-shortcuts": "*",
60
- "@wordpress/keycodes": "*",
61
- "@wordpress/notices": "*",
62
- "@wordpress/preferences": "*",
63
- "@wordpress/priority-queue": "*",
64
- "@wordpress/private-apis": "*",
65
- "@wordpress/rich-text": "*",
66
- "@wordpress/style-engine": "*",
67
- "@wordpress/token-list": "*",
68
- "@wordpress/url": "*",
69
- "@wordpress/warning": "*",
70
- "@wordpress/wordcount": "*",
47
+ "@wordpress/compose": "^7.13.1-next.cd6172eb0.0",
48
+ "@wordpress/data": "^10.13.1-next.cd6172eb0.0",
49
+ "@wordpress/date": "^5.13.1-next.cd6172eb0.0",
50
+ "@wordpress/deprecated": "^4.13.1-next.cd6172eb0.0",
51
+ "@wordpress/dom": "^4.13.1-next.cd6172eb0.0",
52
+ "@wordpress/element": "^6.13.1-next.cd6172eb0.0",
53
+ "@wordpress/escape-html": "^3.13.1-next.cd6172eb0.0",
54
+ "@wordpress/hooks": "^4.13.1-next.cd6172eb0.0",
55
+ "@wordpress/html-entities": "^4.13.1-next.cd6172eb0.0",
56
+ "@wordpress/i18n": "^5.13.1-next.cd6172eb0.0",
57
+ "@wordpress/icons": "^10.13.1-next.cd6172eb0.0",
58
+ "@wordpress/is-shallow-equal": "^5.13.1-next.cd6172eb0.0",
59
+ "@wordpress/keyboard-shortcuts": "^5.13.1-next.cd6172eb0.0",
60
+ "@wordpress/keycodes": "^4.13.1-next.cd6172eb0.0",
61
+ "@wordpress/notices": "^5.13.1-next.cd6172eb0.0",
62
+ "@wordpress/preferences": "^4.13.1-next.cd6172eb0.0",
63
+ "@wordpress/priority-queue": "^3.13.1-next.cd6172eb0.0",
64
+ "@wordpress/private-apis": "^1.13.1-next.cd6172eb0.0",
65
+ "@wordpress/rich-text": "^7.13.1-next.cd6172eb0.0",
66
+ "@wordpress/style-engine": "^2.13.1-next.cd6172eb0.0",
67
+ "@wordpress/token-list": "^3.13.1-next.cd6172eb0.0",
68
+ "@wordpress/url": "^4.13.1-next.cd6172eb0.0",
69
+ "@wordpress/warning": "^3.13.1-next.cd6172eb0.0",
70
+ "@wordpress/wordcount": "^4.13.1-next.cd6172eb0.0",
71
71
  "change-case": "^4.1.2",
72
72
  "clsx": "^2.1.1",
73
73
  "colord": "^2.7.0",
@@ -90,5 +90,5 @@
90
90
  "publishConfig": {
91
91
  "access": "public"
92
92
  },
93
- "gitHead": "cce81c13739c2a8b53d91df90c4f037cb68c2665"
93
+ "gitHead": "4cc93dc1781d8a7bc2bbde265913917920e2bd45"
94
94
  }
@@ -23,12 +23,10 @@ import { orderInserterBlockItems } from '../utils/order-inserter-block-items';
23
23
  const noop = () => {};
24
24
  const SHOWN_BLOCK_TYPES = 9;
25
25
 
26
- /** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */
27
-
28
26
  /**
29
27
  * Creates a blocks repeater for replacing the current block with a selected block type.
30
28
  *
31
- * @return {WPCompleter} A blocks completer.
29
+ * @return {Object} A blocks completer.
32
30
  */
33
31
  function createBlockCompleter() {
34
32
  return {
@@ -157,6 +155,6 @@ function createBlockCompleter() {
157
155
  /**
158
156
  * Creates a blocks repeater for replacing the current block with a selected block type.
159
157
  *
160
- * @return {WPCompleter} A blocks completer.
158
+ * @return {Object} A blocks completer.
161
159
  */
162
160
  export default createBlockCompleter();
@@ -10,12 +10,10 @@ import { decodeEntities } from '@wordpress/html-entities';
10
10
 
11
11
  const SHOWN_SUGGESTIONS = 10;
12
12
 
13
- /** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */
14
-
15
13
  /**
16
14
  * Creates a suggestion list for links to posts or pages.
17
15
  *
18
- * @return {WPCompleter} A links completer.
16
+ * @return {Object} A links completer.
19
17
  */
20
18
  function createLinkCompleter() {
21
19
  return {
@@ -60,6 +58,6 @@ function createLinkCompleter() {
60
58
  /**
61
59
  * Creates a suggestion list for links to posts or pages..
62
60
  *
63
- * @return {WPCompleter} A link completer.
61
+ * @return {Object} A link completer.
64
62
  */
65
63
  export default createLinkCompleter();
@@ -0,0 +1,47 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useState } from '@wordpress/element';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { AlignmentToolbar } from '..';
10
+
11
+ /**
12
+ * The `AlignmentToolbar` component renders a dropdown menu that displays alignment options for the selected block in `Toolbar`.
13
+ */
14
+ const meta = {
15
+ title: 'BlockEditor/AlignmentToolbar',
16
+ component: AlignmentToolbar,
17
+ argTypes: {
18
+ value: {
19
+ control: { type: null },
20
+ defaultValue: 'undefined',
21
+ description: 'The current value of the alignment setting.',
22
+ },
23
+ onChange: {
24
+ action: 'onChange',
25
+ control: { type: null },
26
+ description:
27
+ "A callback function invoked when the toolbar's alignment value is changed via an interaction with any of the toolbar's buttons. Called with the new alignment value (ie: `left`, `center`, `right`, `undefined`) as the only argument.",
28
+ },
29
+ },
30
+ };
31
+ export default meta;
32
+
33
+ export const Default = {
34
+ render: function Template( { onChange, ...args } ) {
35
+ const [ value, setValue ] = useState();
36
+ return (
37
+ <AlignmentToolbar
38
+ { ...args }
39
+ onChange={ ( ...changeArgs ) => {
40
+ onChange( ...changeArgs );
41
+ setValue( ...changeArgs );
42
+ } }
43
+ value={ value }
44
+ />
45
+ );
46
+ },
47
+ };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useState } from '@wordpress/element';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { AlignmentControl } from '../';
10
+
11
+ /**
12
+ * The `AlignmentControl` component renders a dropdown menu that displays alignment options for the selected block.
13
+ *
14
+ * This component is mostly used for blocks that display text, such as Heading, Paragraph, Post Author, Post Comments, Verse, Quote, Post Title, etc... And the available alignment options are `left`, `center` or `right` alignment.
15
+ *
16
+ * If you want to use the alignment control in a toolbar, you should use the `AlignmentToolbar` component instead.
17
+ */
18
+ const meta = {
19
+ title: 'BlockEditor/AlignmentControl',
20
+ component: AlignmentControl,
21
+ argTypes: {
22
+ value: {
23
+ control: { type: null },
24
+ defaultValue: 'undefined',
25
+ description: 'The current value of the alignment setting.',
26
+ },
27
+ onChange: {
28
+ action: 'onChange',
29
+ control: { type: null },
30
+ description:
31
+ "A callback function invoked when the toolbar's alignment value is changed via an interaction with any of the toolbar's buttons. Called with the new alignment value (ie: `left`, `center`, `right`, `undefined`) as the only argument.",
32
+ },
33
+ },
34
+ };
35
+ export default meta;
36
+
37
+ export const Default = {
38
+ render: function Template( { onChange, ...args } ) {
39
+ const [ value, setValue ] = useState();
40
+ return (
41
+ <AlignmentControl
42
+ { ...args }
43
+ onChange={ ( ...changeArgs ) => {
44
+ onChange( ...changeArgs );
45
+ setValue( ...changeArgs );
46
+ } }
47
+ value={ value }
48
+ />
49
+ );
50
+ },
51
+ };
@@ -12,7 +12,7 @@ exports[`AlignmentUI should allow custom alignment controls to be specified 1`]
12
12
  align="custom-left"
13
13
  aria-label="My custom left"
14
14
  aria-pressed="false"
15
- class="components-button components-toolbar__control has-icon"
15
+ class="components-button components-toolbar__control is-compact has-icon"
16
16
  data-toolbar-item="true"
17
17
  type="button"
18
18
  >
@@ -35,7 +35,7 @@ exports[`AlignmentUI should allow custom alignment controls to be specified 1`]
35
35
  align="custom-right"
36
36
  aria-label="My custom right"
37
37
  aria-pressed="true"
38
- class="components-button components-toolbar__control is-pressed has-icon"
38
+ class="components-button components-toolbar__control is-compact is-pressed has-icon"
39
39
  data-toolbar-item="true"
40
40
  type="button"
41
41
  >
@@ -100,7 +100,7 @@ exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
100
100
  align="left"
101
101
  aria-label="Align text left"
102
102
  aria-pressed="true"
103
- class="components-button components-toolbar__control is-pressed has-icon"
103
+ class="components-button components-toolbar__control is-compact is-pressed has-icon"
104
104
  data-toolbar-item="true"
105
105
  type="button"
106
106
  >
@@ -123,7 +123,7 @@ exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
123
123
  align="center"
124
124
  aria-label="Align text center"
125
125
  aria-pressed="false"
126
- class="components-button components-toolbar__control has-icon"
126
+ class="components-button components-toolbar__control is-compact has-icon"
127
127
  data-toolbar-item="true"
128
128
  type="button"
129
129
  >
@@ -146,7 +146,7 @@ exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
146
146
  align="right"
147
147
  aria-label="Align text right"
148
148
  aria-pressed="false"
149
- class="components-button components-toolbar__control has-icon"
149
+ class="components-button components-toolbar__control is-compact has-icon"
150
150
  data-toolbar-item="true"
151
151
  type="button"
152
152
  >
@@ -42,7 +42,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
42
42
  <button
43
43
  aria-label="None"
44
44
  aria-pressed="false"
45
- class="components-button components-toolbar__control has-icon"
45
+ class="components-button components-toolbar__control is-compact has-icon"
46
46
  data-toolbar-item="true"
47
47
  type="button"
48
48
  >
@@ -64,7 +64,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
64
64
  <button
65
65
  aria-label="Align left"
66
66
  aria-pressed="true"
67
- class="components-button components-toolbar__control is-pressed has-icon"
67
+ class="components-button components-toolbar__control is-compact is-pressed has-icon"
68
68
  data-toolbar-item="true"
69
69
  type="button"
70
70
  >
@@ -86,7 +86,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
86
86
  <button
87
87
  aria-label="Align center"
88
88
  aria-pressed="false"
89
- class="components-button components-toolbar__control has-icon"
89
+ class="components-button components-toolbar__control is-compact has-icon"
90
90
  data-toolbar-item="true"
91
91
  type="button"
92
92
  >
@@ -108,7 +108,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
108
108
  <button
109
109
  aria-label="Align right"
110
110
  aria-pressed="false"
111
- class="components-button components-toolbar__control has-icon"
111
+ class="components-button components-toolbar__control is-compact has-icon"
112
112
  data-toolbar-item="true"
113
113
  type="button"
114
114
  >
@@ -56,7 +56,8 @@ export function ExperimentalBlockCanvas( {
56
56
  return (
57
57
  <BlockTools
58
58
  __unstableContentRef={ localRef }
59
- style={ { height, display: 'flex' } }
59
+ className="block-editor-block-canvas"
60
+ style={ { height } }
60
61
  >
61
62
  <EditorStyles
62
63
  styles={ styles }
@@ -67,10 +68,6 @@ export function ExperimentalBlockCanvas( {
67
68
  ref={ contentRef }
68
69
  className="editor-styles-wrapper"
69
70
  tabIndex={ -1 }
70
- style={ {
71
- height: '100%',
72
- width: '100%',
73
- } }
74
71
  >
75
72
  { children }
76
73
  </WritingFlow>
@@ -81,6 +78,7 @@ export function ExperimentalBlockCanvas( {
81
78
  return (
82
79
  <BlockTools
83
80
  __unstableContentRef={ localRef }
81
+ className="block-editor-block-canvas"
84
82
  style={ { height, display: 'flex' } }
85
83
  >
86
84
  <Iframe
@@ -1,13 +1,12 @@
1
1
  // This creates a "slot" where the block you're dragging appeared.
2
2
  // We use !important as one of the rules are meant to be overridden.
3
3
  .block-editor-block-list__layout .is-dragging {
4
- background-color: currentColor !important;
5
- opacity: 0.05 !important;
4
+ opacity: 0.1 !important;
6
5
  border-radius: $radius-small !important;
7
6
 
8
- // Disabling pointer events during the drag event is necessary,
9
- // lest the block might affect your drag operation.
10
- pointer-events: none !important;
7
+ iframe {
8
+ pointer-events: none;
9
+ }
11
10
 
12
11
  // Hide the multi selection indicator when dragging.
13
12
  &::selection {
@@ -18,3 +17,10 @@
18
17
  content: none !important;
19
18
  }
20
19
  }
20
+
21
+ // Images are draggable by default, so disable drag for them if not explicitly
22
+ // set. This is done so that the block can capture the drag event instead.
23
+ .wp-block img:not([draggable]),
24
+ .wp-block svg:not([draggable]) {
25
+ pointer-events: none;
26
+ }