@wordpress/block-editor 14.10.1 → 14.11.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 (247) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/build/components/background-image-control/index.js +0 -1
  3. package/build/components/background-image-control/index.js.map +1 -1
  4. package/build/components/block-actions/index.js +0 -3
  5. package/build/components/block-actions/index.js.map +1 -1
  6. package/build/components/block-inspector/index.js +6 -11
  7. package/build/components/block-inspector/index.js.map +1 -1
  8. package/build/components/block-list/use-block-props/use-focus-handler.js +1 -1
  9. package/build/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  10. package/build/components/block-rename/modal.js +36 -11
  11. package/build/components/block-rename/modal.js.map +1 -1
  12. package/build/components/block-rename/rename-control.js +2 -43
  13. package/build/components/block-rename/rename-control.js.map +1 -1
  14. package/build/components/block-settings-menu/block-settings-dropdown.js +12 -3
  15. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  16. package/build/components/block-styles/preview.native.js +1 -1
  17. package/build/components/block-styles/preview.native.js.map +1 -1
  18. package/build/components/block-switcher/block-transformations-menu.js +7 -7
  19. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  20. package/build/components/block-switcher/block-variation-transformations.js +2 -2
  21. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  22. package/build/components/block-switcher/index.js +1 -1
  23. package/build/components/block-switcher/index.js.map +1 -1
  24. package/build/components/block-switcher/use-transformed-patterns.js +1 -1
  25. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  26. package/build/components/block-toolbar/index.native.js +2 -2
  27. package/build/components/block-toolbar/index.native.js.map +1 -1
  28. package/build/components/date-format-picker/index.js +1 -1
  29. package/build/components/date-format-picker/index.js.map +1 -1
  30. package/build/components/global-styles/filters-panel.js +2 -2
  31. package/build/components/global-styles/filters-panel.js.map +1 -1
  32. package/build/components/global-styles/image-settings-panel.js +2 -2
  33. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  34. package/build/components/global-styles/use-global-styles-output.js +3 -3
  35. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  36. package/build/components/iframe/get-compatibility-styles.js +1 -1
  37. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  38. package/build/components/iframe/index.js +1 -1
  39. package/build/components/iframe/index.js.map +1 -1
  40. package/build/components/image-size-control/index.js +2 -1
  41. package/build/components/image-size-control/index.js.map +1 -1
  42. package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  43. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  44. package/build/components/inserter/reusable-blocks-tab.native.js +1 -1
  45. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  46. package/build/components/line-height-control/index.native.js +1 -1
  47. package/build/components/line-height-control/index.native.js.map +1 -1
  48. package/build/components/link-control/index.js +1 -1
  49. package/build/components/link-control/index.js.map +1 -1
  50. package/build/components/link-control/use-search-handler.js +1 -1
  51. package/build/components/link-control/use-search-handler.js.map +1 -1
  52. package/build/components/list-view/block-select-button.js +5 -2
  53. package/build/components/list-view/block-select-button.js.map +1 -1
  54. package/build/components/media-placeholder/index.js +1 -0
  55. package/build/components/media-placeholder/index.js.map +1 -1
  56. package/build/components/observe-typing/index.js +1 -1
  57. package/build/components/observe-typing/index.js.map +1 -1
  58. package/build/components/provider/index.js +0 -2
  59. package/build/components/provider/index.js.map +1 -1
  60. package/build/components/provider/use-block-sync.js +2 -2
  61. package/build/components/provider/use-block-sync.js.map +1 -1
  62. package/build/components/rich-text/event-listeners/input-rules.js +3 -3
  63. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
  64. package/build/components/rich-text/native/use-format-types.js +1 -1
  65. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  66. package/build/components/rich-text/use-format-types.js +1 -1
  67. package/build/components/rich-text/use-format-types.js.map +1 -1
  68. package/build/components/tabbed-sidebar/index.js +39 -0
  69. package/build/components/tabbed-sidebar/index.js.map +1 -1
  70. package/build/components/typewriter/index.js +1 -1
  71. package/build/components/typewriter/index.js.map +1 -1
  72. package/build/components/url-popover/image-url-input-ui.js +3 -3
  73. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  74. package/build/components/use-block-commands/index.js +1 -1
  75. package/build/components/use-block-commands/index.js.map +1 -1
  76. package/build/components/use-moving-animation/index.js +1 -1
  77. package/build/components/use-moving-animation/index.js.map +1 -1
  78. package/build/store/actions.js +1 -1
  79. package/build/store/actions.js.map +1 -1
  80. package/build/store/selectors.js +5 -5
  81. package/build/store/selectors.js.map +1 -1
  82. package/build/utils/transform-styles/index.js +1 -1
  83. package/build/utils/transform-styles/index.js.map +1 -1
  84. package/build/utils/use-notify-copy.js +19 -11
  85. package/build/utils/use-notify-copy.js.map +1 -1
  86. package/build-module/components/background-image-control/index.js +0 -1
  87. package/build-module/components/background-image-control/index.js.map +1 -1
  88. package/build-module/components/block-actions/index.js +0 -3
  89. package/build-module/components/block-actions/index.js.map +1 -1
  90. package/build-module/components/block-inspector/index.js +6 -11
  91. package/build-module/components/block-inspector/index.js.map +1 -1
  92. package/build-module/components/block-list/use-block-props/use-focus-handler.js +1 -1
  93. package/build-module/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  94. package/build-module/components/block-rename/modal.js +36 -11
  95. package/build-module/components/block-rename/modal.js.map +1 -1
  96. package/build-module/components/block-rename/rename-control.js +2 -43
  97. package/build-module/components/block-rename/rename-control.js.map +1 -1
  98. package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -3
  99. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  100. package/build-module/components/block-styles/preview.native.js +1 -1
  101. package/build-module/components/block-styles/preview.native.js.map +1 -1
  102. package/build-module/components/block-switcher/block-transformations-menu.js +7 -7
  103. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  104. package/build-module/components/block-switcher/block-variation-transformations.js +2 -2
  105. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  106. package/build-module/components/block-switcher/index.js +1 -1
  107. package/build-module/components/block-switcher/index.js.map +1 -1
  108. package/build-module/components/block-switcher/use-transformed-patterns.js +1 -1
  109. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  110. package/build-module/components/block-toolbar/index.native.js +2 -2
  111. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  112. package/build-module/components/date-format-picker/index.js +1 -1
  113. package/build-module/components/date-format-picker/index.js.map +1 -1
  114. package/build-module/components/global-styles/filters-panel.js +2 -2
  115. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  116. package/build-module/components/global-styles/image-settings-panel.js +2 -2
  117. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  118. package/build-module/components/global-styles/use-global-styles-output.js +3 -3
  119. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  120. package/build-module/components/iframe/get-compatibility-styles.js +1 -1
  121. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  122. package/build-module/components/iframe/index.js +1 -1
  123. package/build-module/components/iframe/index.js.map +1 -1
  124. package/build-module/components/image-size-control/index.js +3 -2
  125. package/build-module/components/image-size-control/index.js.map +1 -1
  126. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  127. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  128. package/build-module/components/inserter/reusable-blocks-tab.native.js +1 -1
  129. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  130. package/build-module/components/line-height-control/index.native.js +1 -1
  131. package/build-module/components/line-height-control/index.native.js.map +1 -1
  132. package/build-module/components/link-control/index.js +1 -1
  133. package/build-module/components/link-control/index.js.map +1 -1
  134. package/build-module/components/link-control/use-search-handler.js +1 -1
  135. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  136. package/build-module/components/list-view/block-select-button.js +6 -3
  137. package/build-module/components/list-view/block-select-button.js.map +1 -1
  138. package/build-module/components/media-placeholder/index.js +1 -0
  139. package/build-module/components/media-placeholder/index.js.map +1 -1
  140. package/build-module/components/observe-typing/index.js +1 -1
  141. package/build-module/components/observe-typing/index.js.map +1 -1
  142. package/build-module/components/provider/index.js +0 -1
  143. package/build-module/components/provider/index.js.map +1 -1
  144. package/build-module/components/provider/use-block-sync.js +2 -2
  145. package/build-module/components/provider/use-block-sync.js.map +1 -1
  146. package/build-module/components/rich-text/event-listeners/input-rules.js +3 -3
  147. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  148. package/build-module/components/rich-text/native/use-format-types.js +1 -1
  149. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  150. package/build-module/components/rich-text/use-format-types.js +1 -1
  151. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  152. package/build-module/components/tabbed-sidebar/index.js +39 -0
  153. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  154. package/build-module/components/typewriter/index.js +1 -1
  155. package/build-module/components/typewriter/index.js.map +1 -1
  156. package/build-module/components/url-popover/image-url-input-ui.js +3 -3
  157. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  158. package/build-module/components/use-block-commands/index.js +1 -1
  159. package/build-module/components/use-block-commands/index.js.map +1 -1
  160. package/build-module/components/use-moving-animation/index.js +1 -1
  161. package/build-module/components/use-moving-animation/index.js.map +1 -1
  162. package/build-module/store/actions.js +1 -1
  163. package/build-module/store/actions.js.map +1 -1
  164. package/build-module/store/selectors.js +5 -5
  165. package/build-module/store/selectors.js.map +1 -1
  166. package/build-module/utils/transform-styles/index.js +1 -1
  167. package/build-module/utils/transform-styles/index.js.map +1 -1
  168. package/build-module/utils/use-notify-copy.js +19 -11
  169. package/build-module/utils/use-notify-copy.js.map +1 -1
  170. package/build-style/content-rtl.css +0 -9
  171. package/build-style/content.css +0 -9
  172. package/build-style/style-rtl.css +18 -21
  173. package/build-style/style.css +18 -21
  174. package/package.json +34 -33
  175. package/src/components/background-image-control/index.js +0 -1
  176. package/src/components/block-actions/index.js +0 -3
  177. package/src/components/block-icon/content.scss +1 -1
  178. package/src/components/{block-card → block-icon}/stories/index.story.js +16 -26
  179. package/src/components/block-icon/style.scss +1 -1
  180. package/src/components/block-inspector/index.js +7 -10
  181. package/src/components/block-list/use-block-props/use-focus-handler.js +1 -1
  182. package/src/components/block-preview/style.scss +1 -1
  183. package/src/components/block-rename/modal.js +40 -12
  184. package/src/components/block-rename/rename-control.js +1 -53
  185. package/src/components/block-settings-menu/block-settings-dropdown.js +16 -2
  186. package/src/components/block-styles/preview.native.js +1 -1
  187. package/src/components/block-switcher/block-transformations-menu.js +9 -9
  188. package/src/components/block-switcher/block-variation-transformations.js +2 -2
  189. package/src/components/block-switcher/index.js +1 -1
  190. package/src/components/block-switcher/use-transformed-patterns.js +1 -1
  191. package/src/components/block-toolbar/index.native.js +2 -2
  192. package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
  193. package/src/components/colors-gradients/style.scss +1 -0
  194. package/src/components/colors-gradients/test/control.js +2 -2
  195. package/src/components/date-format-picker/index.js +1 -1
  196. package/src/components/duotone-control/style.scss +2 -2
  197. package/src/components/global-styles/filters-panel.js +4 -2
  198. package/src/components/global-styles/image-settings-panel.js +2 -2
  199. package/src/components/global-styles/test/typography-utils.js +1 -1
  200. package/src/components/global-styles/use-global-styles-output.js +3 -3
  201. package/src/components/iframe/get-compatibility-styles.js +1 -1
  202. package/src/components/iframe/index.js +1 -1
  203. package/src/components/image-size-control/index.js +6 -2
  204. package/src/components/inner-blocks/README.md +1 -1
  205. package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  206. package/src/components/inserter/reusable-blocks-tab.native.js +1 -1
  207. package/src/components/line-height-control/index.native.js +1 -1
  208. package/src/components/link-control/README.md +2 -2
  209. package/src/components/link-control/index.js +1 -1
  210. package/src/components/link-control/test/index.js +3 -3
  211. package/src/components/link-control/use-search-handler.js +1 -1
  212. package/src/components/list-view/README.md +1 -1
  213. package/src/components/list-view/block-select-button.js +5 -5
  214. package/src/components/list-view/style.scss +3 -7
  215. package/src/components/media-placeholder/content.scss +0 -8
  216. package/src/components/media-placeholder/index.js +1 -0
  217. package/src/components/media-placeholder/style.scss +7 -0
  218. package/src/components/observe-typing/index.js +1 -1
  219. package/src/components/provider/index.js +0 -1
  220. package/src/components/provider/use-block-sync.js +2 -2
  221. package/src/components/resolution-tool/stories/index.story.js +52 -2
  222. package/src/components/rich-text/README.md +1 -1
  223. package/src/components/rich-text/event-listeners/input-rules.js +3 -3
  224. package/src/components/rich-text/native/use-format-types.js +1 -1
  225. package/src/components/rich-text/use-format-types.js +1 -1
  226. package/src/components/tabbed-sidebar/README.md +24 -13
  227. package/src/components/tabbed-sidebar/index.js +38 -0
  228. package/src/components/tabbed-sidebar/stories/index.story.js +104 -0
  229. package/src/components/typewriter/index.js +1 -1
  230. package/src/components/unit-control/README.md +1 -1
  231. package/src/components/unit-control/stories/index.story.js +124 -0
  232. package/src/components/url-popover/image-url-input-ui.js +3 -3
  233. package/src/components/use-block-commands/index.js +1 -1
  234. package/src/components/use-moving-animation/index.js +1 -1
  235. package/src/components/use-settings/README.md +1 -1
  236. package/src/components/warning/content.scss +1 -1
  237. package/src/components/writing-flow/test/index.js +1 -1
  238. package/src/hooks/color.scss +0 -7
  239. package/src/store/actions.js +1 -1
  240. package/src/store/selectors.js +5 -5
  241. package/src/store/test/private-selectors.js +1 -1
  242. package/src/store/test/selectors.js +3 -3
  243. package/src/style.scss +1 -0
  244. package/src/utils/test/sorting.js +1 -1
  245. package/src/utils/transform-styles/index.js +1 -1
  246. package/src/utils/use-notify-copy.js +51 -43
  247. package/tsconfig.json +1 -0
@@ -137,7 +137,7 @@ function transformStyle({
137
137
  /**
138
138
  * @typedef {Object} EditorStyle
139
139
  * @property {string} css the CSS block(s), as a single string.
140
- * @property {?string} baseURL the base URL to be used as the reference when rewritting urls.
140
+ * @property {?string} baseURL the base URL to be used as the reference when rewriting urls.
141
141
  * @property {?string[]} ignoredSelectors the selectors not to wrap.
142
142
  */
143
143
 
@@ -1 +1 @@
1
- {"version":3,"names":["parsel","Processor","CssSyntaxError","prefixSelector","rebaseUrl","cacheByWrapperSelector","Map","ROOT_SELECTOR_TOKENS","type","content","prefixRootSelector","prefix","selector","tokenized","tokenize","lastRootIndex","findLastIndex","some","rootSelector","insertionPoint","i","length","tokenizedPrefix","splice","stringify","transformStyle","css","ignoredSelectors","baseURL","wrapperSelector","transformOptions","_transformOptions$ign","excludedSelectors","transform","prefixedSelector","excludedSelector","RegExp","match","includes","hasRootSelector","startsWith","rootUrl","filter","Boolean","process","error","console","warn","message","showSourceCode","transformStyles","styles","cache","get","WeakMap","set","map","style"],"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as parsel from 'parsel-js';\nimport Processor from 'postcss/lib/processor';\nimport CssSyntaxError from 'postcss/lib/css-syntax-error';\nimport prefixSelector from 'postcss-prefix-selector';\nimport rebaseUrl from 'postcss-urlrebase';\n\nconst cacheByWrapperSelector = new Map();\n\nconst ROOT_SELECTOR_TOKENS = [\n\t{ type: 'type', content: 'body' },\n\t{ type: 'type', content: 'html' },\n\t{ type: 'pseudo-class', content: ':root' },\n\t{ type: 'pseudo-class', content: ':where(body)' },\n\t{ type: 'pseudo-class', content: ':where(:root)' },\n\t{ type: 'pseudo-class', content: ':where(html)' },\n];\n\n/**\n * Prefixes root selectors in a way that ensures consistent specificity.\n * This requires special handling, since prefixing a classname before\n * html, body, or :root will generally result in an invalid selector.\n *\n * Some libraries will simply replace the root selector with the prefix\n * instead, but this results in inconsistent specificity.\n *\n * This function instead inserts the prefix after the root tags but before\n * any other part of the selector. This results in consistent specificity:\n * - If a `:where()` selector is used for the prefix, all selectors output\n * by `transformStyles` will have no specificity increase.\n * - If a classname, id, or something else is used as the prefix, all selectors\n * will have the same specificity bump when transformed.\n *\n * @param {string} prefix The prefix.\n * @param {string} selector The selector.\n *\n * @return {string} The prefixed root selector.\n */\nfunction prefixRootSelector( prefix, selector ) {\n\t// Use a tokenizer, since regular expressions are unreliable.\n\tconst tokenized = parsel.tokenize( selector );\n\n\t// Find the last token that contains a root selector by walking back\n\t// through the tokens.\n\tconst lastRootIndex = tokenized.findLastIndex( ( { content, type } ) => {\n\t\treturn ROOT_SELECTOR_TOKENS.some(\n\t\t\t( rootSelector ) =>\n\t\t\t\tcontent === rootSelector.content && type === rootSelector.type\n\t\t);\n\t} );\n\n\t// Walk forwards to find the combinator after the last root.\n\t// This is where the root ends and the rest of the selector begins,\n\t// and the index to insert before.\n\t// Doing it this way takes into account that a root selector like\n\t// 'body' may have additional id/class/pseudo-class/attribute-selector\n\t// parts chained to it, which is difficult to quantify using a regex.\n\tlet insertionPoint = -1;\n\tfor ( let i = lastRootIndex + 1; i < tokenized.length; i++ ) {\n\t\tif ( tokenized[ i ].type === 'combinator' ) {\n\t\t\tinsertionPoint = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Tokenize and insert the prefix with a ' ' combinator before it.\n\tconst tokenizedPrefix = parsel.tokenize( prefix );\n\ttokenized.splice(\n\t\t// Insert at the insertion point, or the end.\n\t\tinsertionPoint === -1 ? tokenized.length : insertionPoint,\n\t\t0,\n\t\t{\n\t\t\ttype: 'combinator',\n\t\t\tcontent: ' ',\n\t\t},\n\t\t...tokenizedPrefix\n\t);\n\n\treturn parsel.stringify( tokenized );\n}\n\nfunction transformStyle(\n\t{ css, ignoredSelectors = [], baseURL },\n\twrapperSelector = '',\n\ttransformOptions\n) {\n\t// When there is no wrapper selector and no base URL, there is no need\n\t// to transform the CSS. This is most cases because in the default\n\t// iframed editor, no wrapping is needed, and not many styles\n\t// provide a base URL.\n\tif ( ! wrapperSelector && ! baseURL ) {\n\t\treturn css;\n\t}\n\n\ttry {\n\t\tconst excludedSelectors = [\n\t\t\t...ignoredSelectors,\n\t\t\t...( transformOptions?.ignoredSelectors ?? [] ),\n\t\t\twrapperSelector,\n\t\t];\n\n\t\treturn new Processor(\n\t\t\t[\n\t\t\t\twrapperSelector &&\n\t\t\t\t\tprefixSelector( {\n\t\t\t\t\t\tprefix: wrapperSelector,\n\t\t\t\t\t\ttransform( prefix, selector, prefixedSelector ) {\n\t\t\t\t\t\t\t// For backwards compatibility, don't use the `exclude` option\n\t\t\t\t\t\t\t// of postcss-prefix-selector, instead handle it here to match\n\t\t\t\t\t\t\t// the behavior of the old library (postcss-prefix-wrap) that\n\t\t\t\t\t\t\t// `transformStyle` previously used.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\texcludedSelectors.some( ( excludedSelector ) =>\n\t\t\t\t\t\t\t\t\texcludedSelector instanceof RegExp\n\t\t\t\t\t\t\t\t\t\t? selector.match( excludedSelector )\n\t\t\t\t\t\t\t\t\t\t: selector.includes( excludedSelector )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn selector;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst hasRootSelector = ROOT_SELECTOR_TOKENS.some(\n\t\t\t\t\t\t\t\t( rootSelector ) =>\n\t\t\t\t\t\t\t\t\tselector.startsWith( rootSelector.content )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// Reorganize root selectors such that the root part comes before the prefix,\n\t\t\t\t\t\t\t// but the prefix still comes before the remaining part of the selector.\n\t\t\t\t\t\t\tif ( hasRootSelector ) {\n\t\t\t\t\t\t\t\treturn prefixRootSelector( prefix, selector );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prefixedSelector;\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t\tbaseURL && rebaseUrl( { rootUrl: baseURL } ),\n\t\t\t].filter( Boolean )\n\t\t).process( css, {} ).css; // use sync PostCSS API\n\t} catch ( error ) {\n\t\tif ( error instanceof CssSyntaxError ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror.message + '\\n' + error.showSourceCode( false )\n\t\t\t);\n\t\t} else {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\n/**\n * @typedef {Object} EditorStyle\n * @property {string} css the CSS block(s), as a single string.\n * @property {?string} baseURL the base URL to be used as the reference when rewritting urls.\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * @typedef {Object} TransformOptions\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.\n *\n * @param {EditorStyle[]} styles CSS rules.\n * @param {string} wrapperSelector Wrapper selector.\n * @param {TransformOptions} transformOptions Additional options for style transformation.\n * @return {Array} converted rules.\n */\nconst transformStyles = ( styles, wrapperSelector = '', transformOptions ) => {\n\tlet cache = cacheByWrapperSelector.get( wrapperSelector );\n\tif ( ! cache ) {\n\t\tcache = new WeakMap();\n\t\tcacheByWrapperSelector.set( wrapperSelector, cache );\n\t}\n\treturn styles.map( ( style ) => {\n\t\tlet css = cache.get( style );\n\t\tif ( ! css ) {\n\t\t\tcss = transformStyle( style, wrapperSelector, transformOptions );\n\t\t\tcache.set( style, css );\n\t\t}\n\t\treturn css;\n\t} );\n};\n\nexport default transformStyles;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAO,KAAKA,MAAM,MAAM,WAAW;AACnC,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,cAAc,MAAM,8BAA8B;AACzD,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,SAAS,MAAM,mBAAmB;AAEzC,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CAAC;AAExC,MAAMC,oBAAoB,GAAG,CAC5B;EAAEC,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAO,CAAC,EACjC;EAAED,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAA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ACJ,CAAC;AAED,eAAewB,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["parsel","Processor","CssSyntaxError","prefixSelector","rebaseUrl","cacheByWrapperSelector","Map","ROOT_SELECTOR_TOKENS","type","content","prefixRootSelector","prefix","selector","tokenized","tokenize","lastRootIndex","findLastIndex","some","rootSelector","insertionPoint","i","length","tokenizedPrefix","splice","stringify","transformStyle","css","ignoredSelectors","baseURL","wrapperSelector","transformOptions","_transformOptions$ign","excludedSelectors","transform","prefixedSelector","excludedSelector","RegExp","match","includes","hasRootSelector","startsWith","rootUrl","filter","Boolean","process","error","console","warn","message","showSourceCode","transformStyles","styles","cache","get","WeakMap","set","map","style"],"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as parsel from 'parsel-js';\nimport Processor from 'postcss/lib/processor';\nimport CssSyntaxError from 'postcss/lib/css-syntax-error';\nimport prefixSelector from 'postcss-prefix-selector';\nimport rebaseUrl from 'postcss-urlrebase';\n\nconst cacheByWrapperSelector = new Map();\n\nconst ROOT_SELECTOR_TOKENS = [\n\t{ type: 'type', content: 'body' },\n\t{ type: 'type', content: 'html' },\n\t{ type: 'pseudo-class', content: ':root' },\n\t{ type: 'pseudo-class', content: ':where(body)' },\n\t{ type: 'pseudo-class', content: ':where(:root)' },\n\t{ type: 'pseudo-class', content: ':where(html)' },\n];\n\n/**\n * Prefixes root selectors in a way that ensures consistent specificity.\n * This requires special handling, since prefixing a classname before\n * html, body, or :root will generally result in an invalid selector.\n *\n * Some libraries will simply replace the root selector with the prefix\n * instead, but this results in inconsistent specificity.\n *\n * This function instead inserts the prefix after the root tags but before\n * any other part of the selector. This results in consistent specificity:\n * - If a `:where()` selector is used for the prefix, all selectors output\n * by `transformStyles` will have no specificity increase.\n * - If a classname, id, or something else is used as the prefix, all selectors\n * will have the same specificity bump when transformed.\n *\n * @param {string} prefix The prefix.\n * @param {string} selector The selector.\n *\n * @return {string} The prefixed root selector.\n */\nfunction prefixRootSelector( prefix, selector ) {\n\t// Use a tokenizer, since regular expressions are unreliable.\n\tconst tokenized = parsel.tokenize( selector );\n\n\t// Find the last token that contains a root selector by walking back\n\t// through the tokens.\n\tconst lastRootIndex = tokenized.findLastIndex( ( { content, type } ) => {\n\t\treturn ROOT_SELECTOR_TOKENS.some(\n\t\t\t( rootSelector ) =>\n\t\t\t\tcontent === rootSelector.content && type === rootSelector.type\n\t\t);\n\t} );\n\n\t// Walk forwards to find the combinator after the last root.\n\t// This is where the root ends and the rest of the selector begins,\n\t// and the index to insert before.\n\t// Doing it this way takes into account that a root selector like\n\t// 'body' may have additional id/class/pseudo-class/attribute-selector\n\t// parts chained to it, which is difficult to quantify using a regex.\n\tlet insertionPoint = -1;\n\tfor ( let i = lastRootIndex + 1; i < tokenized.length; i++ ) {\n\t\tif ( tokenized[ i ].type === 'combinator' ) {\n\t\t\tinsertionPoint = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Tokenize and insert the prefix with a ' ' combinator before it.\n\tconst tokenizedPrefix = parsel.tokenize( prefix );\n\ttokenized.splice(\n\t\t// Insert at the insertion point, or the end.\n\t\tinsertionPoint === -1 ? tokenized.length : insertionPoint,\n\t\t0,\n\t\t{\n\t\t\ttype: 'combinator',\n\t\t\tcontent: ' ',\n\t\t},\n\t\t...tokenizedPrefix\n\t);\n\n\treturn parsel.stringify( tokenized );\n}\n\nfunction transformStyle(\n\t{ css, ignoredSelectors = [], baseURL },\n\twrapperSelector = '',\n\ttransformOptions\n) {\n\t// When there is no wrapper selector and no base URL, there is no need\n\t// to transform the CSS. This is most cases because in the default\n\t// iframed editor, no wrapping is needed, and not many styles\n\t// provide a base URL.\n\tif ( ! wrapperSelector && ! baseURL ) {\n\t\treturn css;\n\t}\n\n\ttry {\n\t\tconst excludedSelectors = [\n\t\t\t...ignoredSelectors,\n\t\t\t...( transformOptions?.ignoredSelectors ?? [] ),\n\t\t\twrapperSelector,\n\t\t];\n\n\t\treturn new Processor(\n\t\t\t[\n\t\t\t\twrapperSelector &&\n\t\t\t\t\tprefixSelector( {\n\t\t\t\t\t\tprefix: wrapperSelector,\n\t\t\t\t\t\ttransform( prefix, selector, prefixedSelector ) {\n\t\t\t\t\t\t\t// For backwards compatibility, don't use the `exclude` option\n\t\t\t\t\t\t\t// of postcss-prefix-selector, instead handle it here to match\n\t\t\t\t\t\t\t// the behavior of the old library (postcss-prefix-wrap) that\n\t\t\t\t\t\t\t// `transformStyle` previously used.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\texcludedSelectors.some( ( excludedSelector ) =>\n\t\t\t\t\t\t\t\t\texcludedSelector instanceof RegExp\n\t\t\t\t\t\t\t\t\t\t? selector.match( excludedSelector )\n\t\t\t\t\t\t\t\t\t\t: selector.includes( excludedSelector )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn selector;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst hasRootSelector = ROOT_SELECTOR_TOKENS.some(\n\t\t\t\t\t\t\t\t( rootSelector ) =>\n\t\t\t\t\t\t\t\t\tselector.startsWith( rootSelector.content )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// Reorganize root selectors such that the root part comes before the prefix,\n\t\t\t\t\t\t\t// but the prefix still comes before the remaining part of the selector.\n\t\t\t\t\t\t\tif ( hasRootSelector ) {\n\t\t\t\t\t\t\t\treturn prefixRootSelector( prefix, selector );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prefixedSelector;\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t\tbaseURL && rebaseUrl( { rootUrl: baseURL } ),\n\t\t\t].filter( Boolean )\n\t\t).process( css, {} ).css; // use sync PostCSS API\n\t} catch ( error ) {\n\t\tif ( error instanceof CssSyntaxError ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror.message + '\\n' + error.showSourceCode( false )\n\t\t\t);\n\t\t} else {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\n/**\n * @typedef {Object} EditorStyle\n * @property {string} css the CSS block(s), as a single string.\n * @property {?string} baseURL the base URL to be used as the reference when rewriting urls.\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * @typedef {Object} TransformOptions\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.\n *\n * @param {EditorStyle[]} styles CSS rules.\n * @param {string} wrapperSelector Wrapper selector.\n * @param {TransformOptions} transformOptions Additional options for style transformation.\n * @return {Array} converted rules.\n */\nconst transformStyles = ( styles, wrapperSelector = '', transformOptions ) => {\n\tlet cache = cacheByWrapperSelector.get( wrapperSelector );\n\tif ( ! cache ) {\n\t\tcache = new WeakMap();\n\t\tcacheByWrapperSelector.set( wrapperSelector, cache );\n\t}\n\treturn styles.map( ( style ) => {\n\t\tlet css = cache.get( style );\n\t\tif ( ! css ) {\n\t\t\tcss = transformStyle( style, wrapperSelector, transformOptions );\n\t\t\tcache.set( style, css );\n\t\t}\n\t\treturn css;\n\t} );\n};\n\nexport default transformStyles;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAO,KAAKA,MAAM,MAAM,WAAW;AACnC,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,cAAc,MAAM,8BAA8B;AACzD,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,SAAS,MAAM,mBAAmB;AAEzC,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CAAC;AAExC,MAAMC,oBAAoB,GAAG,CAC5B;EAAEC,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE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AK,EAAE/B,GAAI,CAAC;IACxB;IACA,OAAOA,GAAG;EACX,CAAE,CAAC;AACJ,CAAC;AAED,eAAewB,eAAe","ignoreList":[]}
@@ -23,24 +23,32 @@ export function useNotifyCopy() {
23
23
  } = useDispatch(noticesStore);
24
24
  return useCallback((eventType, selectedBlockClientIds) => {
25
25
  let notice = '';
26
- if (selectedBlockClientIds.length === 1) {
26
+ if (eventType === 'copyStyles') {
27
+ notice = __('Styles copied to clipboard.');
28
+ } else if (selectedBlockClientIds.length === 1) {
27
29
  const clientId = selectedBlockClientIds[0];
28
30
  const title = getBlockType(getBlockName(clientId))?.title;
29
- notice = eventType === 'copy' ? sprintf(
30
- // Translators: Name of the block being copied, e.g. "Paragraph".
31
- __('Copied "%s" to clipboard.'), title) : sprintf(
32
- // Translators: Name of the block being cut, e.g. "Paragraph".
33
- __('Moved "%s" to clipboard.'), title);
34
- } else {
35
- notice = eventType === 'copy' ? sprintf(
31
+ if (eventType === 'copy') {
32
+ notice = sprintf(
33
+ // Translators: Name of the block being copied, e.g. "Paragraph".
34
+ __('Copied "%s" to clipboard.'), title);
35
+ } else {
36
+ notice = sprintf(
37
+ // Translators: Name of the block being cut, e.g. "Paragraph".
38
+ __('Moved "%s" to clipboard.'), title);
39
+ }
40
+ } else if (eventType === 'copy') {
41
+ notice = sprintf(
36
42
  // Translators: %d: Number of blocks being copied.
37
- _n('Copied %d block to clipboard.', 'Copied %d blocks to clipboard.', selectedBlockClientIds.length), selectedBlockClientIds.length) : sprintf(
38
- // Translators: %d: Number of blocks being cut.
43
+ _n('Copied %d block to clipboard.', 'Copied %d blocks to clipboard.', selectedBlockClientIds.length), selectedBlockClientIds.length);
44
+ } else {
45
+ notice = sprintf(
46
+ // Translators: %d: Number of blocks being moved.
39
47
  _n('Moved %d block to clipboard.', 'Moved %d blocks to clipboard.', selectedBlockClientIds.length), selectedBlockClientIds.length);
40
48
  }
41
49
  createSuccessNotice(notice, {
42
50
  type: 'snackbar'
43
51
  });
44
- }, []);
52
+ }, [createSuccessNotice, getBlockName, getBlockType]);
45
53
  }
46
54
  //# sourceMappingURL=use-notify-copy.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","store","blocksStore","useDispatch","useSelect","__","_n","sprintf","noticesStore","blockEditorStore","useNotifyCopy","getBlockName","getBlockType","createSuccessNotice","eventType","selectedBlockClientIds","notice","length","clientId","title","type"],"sources":["@wordpress/block-editor/src/utils/use-notify-copy.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\n\nexport function useNotifyCopy() {\n\tconst { getBlockName } = useSelect( blockEditorStore );\n\tconst { getBlockType } = useSelect( blocksStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\treturn useCallback( ( eventType, selectedBlockClientIds ) => {\n\t\tlet notice = '';\n\t\tif ( selectedBlockClientIds.length === 1 ) {\n\t\t\tconst clientId = selectedBlockClientIds[ 0 ];\n\t\t\tconst title = getBlockType( getBlockName( clientId ) )?.title;\n\t\t\tnotice =\n\t\t\t\teventType === 'copy'\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// Translators: Name of the block being copied, e.g. \"Paragraph\".\n\t\t\t\t\t\t\t__( 'Copied \"%s\" to clipboard.' ),\n\t\t\t\t\t\t\ttitle\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// Translators: Name of the block being cut, e.g. \"Paragraph\".\n\t\t\t\t\t\t\t__( 'Moved \"%s\" to clipboard.' ),\n\t\t\t\t\t\t\ttitle\n\t\t\t\t\t );\n\t\t} else {\n\t\t\tnotice =\n\t\t\t\teventType === 'copy'\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// Translators: %d: Number of blocks being copied.\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Copied %d block to clipboard.',\n\t\t\t\t\t\t\t\t'Copied %d blocks to clipboard.',\n\t\t\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// Translators: %d: Number of blocks being cut.\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Moved %d block to clipboard.',\n\t\t\t\t\t\t\t\t'Moved %d blocks to clipboard.',\n\t\t\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t );\n\t\t}\n\t\tcreateSuccessNotice( notice, {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}, [] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,oBAAoB;AAChD,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASN,KAAK,IAAIO,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,UAAU;AAEpD,OAAO,SAASC,aAAaA,CAAA,EAAG;EAC/B,MAAM;IAAEC;EAAa,CAAC,GAAGP,SAAS,CAAEK,gBAAiB,CAAC;EACtD,MAAM;IAAEG;EAAa,CAAC,GAAGR,SAAS,CAAEF,WAAY,CAAC;EACjD,MAAM;IAAEW;EAAoB,CAAC,GAAGV,WAAW,CAAEK,YAAa,CAAC;EAE3D,OAAOR,WAAW,CAAE,CAAEc,SAAS,EAAEC,sBAAsB,KAAM;IAC5D,IAAIC,MAAM,GAAG,EAAE;IACf,IAAKD,sBAAsB,CAACE,MAAM,KAAK,CAAC,EAAG;MAC1C,MAAMC,QAAQ,GAAGH,sBAAsB,CAAE,CAAC,CAAE;MAC5C,MAAMI,KAAK,GAAGP,YAAY,CAAED,YAAY,CAAEO,QAAS,CAAE,CAAC,EAAEC,KAAK;MAC7DH,MAAM,GACLF,SAAS,KAAK,MAAM,GACjBP,OAAO;MACP;MACAF,EAAE,CAAE,2BAA4B,CAAC,EACjCc,KACA,CAAC,GACDZ,OAAO;MACP;MACAF,EAAE,CAAE,0BAA2B,CAAC,EAChCc,KACA,CAAC;IACN,CAAC,MAAM;MACNH,MAAM,GACLF,SAAS,KAAK,MAAM,GACjBP,OAAO;MACP;MACAD,EAAE,CACD,+BAA+B,EAC/B,gCAAgC,EAChCS,sBAAsB,CAACE,MACxB,CAAC,EACDF,sBAAsB,CAACE,MACvB,CAAC,GACDV,OAAO;MACP;MACAD,EAAE,CACD,8BAA8B,EAC9B,+BAA+B,EAC/BS,sBAAsB,CAACE,MACxB,CAAC,EACDF,sBAAsB,CAACE,MACvB,CAAC;IACN;IACAJ,mBAAmB,CAAEG,MAAM,EAAE;MAC5BI,IAAI,EAAE;IACP,CAAE,CAAC;EACJ,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","store","blocksStore","useDispatch","useSelect","__","_n","sprintf","noticesStore","blockEditorStore","useNotifyCopy","getBlockName","getBlockType","createSuccessNotice","eventType","selectedBlockClientIds","notice","length","clientId","title","type"],"sources":["@wordpress/block-editor/src/utils/use-notify-copy.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\n\nexport function useNotifyCopy() {\n\tconst { getBlockName } = useSelect( blockEditorStore );\n\tconst { getBlockType } = useSelect( blocksStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\treturn useCallback(\n\t\t( eventType, selectedBlockClientIds ) => {\n\t\t\tlet notice = '';\n\n\t\t\tif ( eventType === 'copyStyles' ) {\n\t\t\t\tnotice = __( 'Styles copied to clipboard.' );\n\t\t\t} else if ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\tconst clientId = selectedBlockClientIds[ 0 ];\n\t\t\t\tconst title = getBlockType( getBlockName( clientId ) )?.title;\n\n\t\t\t\tif ( eventType === 'copy' ) {\n\t\t\t\t\tnotice = sprintf(\n\t\t\t\t\t\t// Translators: Name of the block being copied, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Copied \"%s\" to clipboard.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tnotice = sprintf(\n\t\t\t\t\t\t// Translators: Name of the block being cut, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Moved \"%s\" to clipboard.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if ( eventType === 'copy' ) {\n\t\t\t\tnotice = sprintf(\n\t\t\t\t\t// Translators: %d: Number of blocks being copied.\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Copied %d block to clipboard.',\n\t\t\t\t\t\t'Copied %d blocks to clipboard.',\n\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t),\n\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tnotice = sprintf(\n\t\t\t\t\t// Translators: %d: Number of blocks being moved.\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Moved %d block to clipboard.',\n\t\t\t\t\t\t'Moved %d blocks to clipboard.',\n\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t),\n\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t);\n\t\t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;QACAF,EAAE,CAAE,0BAA2B,CAAC,EAChCc,KACD,CAAC;MACF;IACD,CAAC,MAAM,IAAKL,SAAS,KAAK,MAAM,EAAG;MAClCE,MAAM,GAAGT,OAAO;MACf;MACAD,EAAE,CACD,+BAA+B,EAC/B,gCAAgC,EAChCS,sBAAsB,CAACE,MACxB,CAAC,EACDF,sBAAsB,CAACE,MACxB,CAAC;IACF,CAAC,MAAM;MACND,MAAM,GAAGT,OAAO;MACf;MACAD,EAAE,CACD,8BAA8B,EAC9B,+BAA+B,EAC/BS,sBAAsB,CAACE,MACxB,CAAC,EACDF,sBAAsB,CAACE,MACxB,CAAC;IACF;IAEAJ,mBAAmB,CAAEG,MAAM,EAAE;MAC5BI,IAAI,EAAE;IACP,CAAE,CAAC;EACJ,CAAC,EACD,CAAEP,mBAAmB,EAAEF,YAAY,EAAEC,YAAY,CAClD,CAAC;AACF","ignoreList":[]}
@@ -821,15 +821,6 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
821
821
  cursor: grab;
822
822
  }
823
823
 
824
- .block-editor-media-placeholder__url-input-form {
825
- min-width: 260px;
826
- }
827
- @media (min-width: 600px) {
828
- .block-editor-media-placeholder__url-input-form {
829
- width: 300px;
830
- }
831
- }
832
-
833
824
  .block-editor-media-placeholder__cancel-button.is-link {
834
825
  margin: 1em;
835
826
  display: block;
@@ -821,15 +821,6 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
821
821
  cursor: grab;
822
822
  }
823
823
 
824
- .block-editor-media-placeholder__url-input-form {
825
- min-width: 260px;
826
- }
827
- @media (min-width: 600px) {
828
- .block-editor-media-placeholder__url-input-form {
829
- width: 300px;
830
- }
831
- }
832
-
833
824
  .block-editor-media-placeholder__cancel-button.is-link {
834
825
  margin: 1em;
835
826
  display: block;
@@ -1634,6 +1634,7 @@ iframe[name=editor-canvas] {
1634
1634
  white-space: nowrap;
1635
1635
  overflow: hidden;
1636
1636
  text-overflow: ellipsis;
1637
+ max-width: calc(100% - 44px);
1637
1638
  }
1638
1639
 
1639
1640
  .block-editor-panel-color-gradient-settings__dropdown {
@@ -1679,14 +1680,14 @@ iframe[name=editor-canvas] {
1679
1680
  border-top: 1px solid #ddd;
1680
1681
  }
1681
1682
 
1682
- .block-editor-duotone-control__popover > .components-popover__content {
1683
- padding: 16px;
1683
+ .block-editor-duotone-control__popover.components-popover > .components-popover__content {
1684
+ padding: 8px;
1684
1685
  width: 260px;
1685
1686
  }
1686
- .block-editor-duotone-control__popover .components-menu-group__label {
1687
+ .block-editor-duotone-control__popover.components-popover .components-menu-group__label {
1687
1688
  padding: 0;
1688
1689
  }
1689
- .block-editor-duotone-control__popover .components-circular-option-picker__swatches {
1690
+ .block-editor-duotone-control__popover.components-popover .components-circular-option-picker__swatches {
1690
1691
  display: grid;
1691
1692
  grid-template-columns: repeat(6, 28px);
1692
1693
  gap: 12px;
@@ -2703,8 +2704,6 @@ iframe[name=editor-canvas] {
2703
2704
  }
2704
2705
  .block-editor-list-view-leaf.is-visible .block-editor-list-view-block-contents {
2705
2706
  opacity: 1;
2706
- animation: __wp-base-styles-fade-in 0.08s linear 0s;
2707
- animation-fill-mode: forwards;
2708
2707
  }
2709
2708
  @keyframes __wp-base-styles-fade-in {
2710
2709
  from {
@@ -2714,10 +2713,10 @@ iframe[name=editor-canvas] {
2714
2713
  opacity: 1;
2715
2714
  }
2716
2715
  }
2717
- @media (prefers-reduced-motion: reduce) {
2716
+ @media not (prefers-reduced-motion) {
2718
2717
  .block-editor-list-view-leaf.is-visible .block-editor-list-view-block-contents {
2719
- animation-duration: 1ms;
2720
- animation-delay: 0s;
2718
+ animation: __wp-base-styles-fade-in 0.08s linear 0s;
2719
+ animation-fill-mode: forwards;
2721
2720
  }
2722
2721
  }
2723
2722
  .block-editor-list-view-leaf .block-editor-block-icon {
@@ -2826,14 +2825,10 @@ iframe[name=editor-canvas] {
2826
2825
  position: absolute;
2827
2826
  left: 0;
2828
2827
  transform: translateY(-50%);
2829
- background: rgba(0, 0, 0, 0.1);
2830
- border-radius: 1px;
2831
- padding: 2px 6px;
2832
- max-width: 100%;
2833
- box-sizing: border-box;
2834
2828
  }
2835
2829
  .block-editor-list-view-leaf.is-selected .block-editor-list-view-block-select-button__anchor {
2836
2830
  background: rgba(0, 0, 0, 0.3);
2831
+ color: #fff;
2837
2832
  }
2838
2833
  .block-editor-list-view-leaf .block-editor-list-view-block-select-button__lock,
2839
2834
  .block-editor-list-view-leaf .block-editor-list-view-block-select-button__sticky {
@@ -2989,6 +2984,15 @@ iframe[name=editor-canvas] {
2989
2984
  display: none;
2990
2985
  }
2991
2986
 
2987
+ .block-editor-media-placeholder__url-input-form {
2988
+ min-width: 260px;
2989
+ }
2990
+ @media (min-width: 600px) {
2991
+ .block-editor-media-placeholder__url-input-form {
2992
+ width: 300px;
2993
+ }
2994
+ }
2995
+
2992
2996
  .modal-open .block-editor-media-replace-flow__options {
2993
2997
  display: none;
2994
2998
  }
@@ -3446,13 +3450,6 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
3446
3450
  */
3447
3451
  }
3448
3452
  .color-block-support-panel .block-editor-contrast-checker {
3449
- /**
3450
- * Contrast checkers are forced to the bottom of the panel so all
3451
- * injected color controls can appear as a single item group without
3452
- * the contrast checkers suddenly appearing between items.
3453
- */
3454
- /* stylelint-disable-next-line property-disallowed-list -- This should be removed when https://github.com/WordPress/gutenberg/issues/58936 is fixed. */
3455
- order: 9999;
3456
3453
  grid-column: span 2;
3457
3454
  margin-top: 16px;
3458
3455
  }
@@ -1634,6 +1634,7 @@ iframe[name=editor-canvas] {
1634
1634
  white-space: nowrap;
1635
1635
  overflow: hidden;
1636
1636
  text-overflow: ellipsis;
1637
+ max-width: calc(100% - 44px);
1637
1638
  }
1638
1639
 
1639
1640
  .block-editor-panel-color-gradient-settings__dropdown {
@@ -1679,14 +1680,14 @@ iframe[name=editor-canvas] {
1679
1680
  border-top: 1px solid #ddd;
1680
1681
  }
1681
1682
 
1682
- .block-editor-duotone-control__popover > .components-popover__content {
1683
- padding: 16px;
1683
+ .block-editor-duotone-control__popover.components-popover > .components-popover__content {
1684
+ padding: 8px;
1684
1685
  width: 260px;
1685
1686
  }
1686
- .block-editor-duotone-control__popover .components-menu-group__label {
1687
+ .block-editor-duotone-control__popover.components-popover .components-menu-group__label {
1687
1688
  padding: 0;
1688
1689
  }
1689
- .block-editor-duotone-control__popover .components-circular-option-picker__swatches {
1690
+ .block-editor-duotone-control__popover.components-popover .components-circular-option-picker__swatches {
1690
1691
  display: grid;
1691
1692
  grid-template-columns: repeat(6, 28px);
1692
1693
  gap: 12px;
@@ -2704,8 +2705,6 @@ iframe[name=editor-canvas] {
2704
2705
  }
2705
2706
  .block-editor-list-view-leaf.is-visible .block-editor-list-view-block-contents {
2706
2707
  opacity: 1;
2707
- animation: __wp-base-styles-fade-in 0.08s linear 0s;
2708
- animation-fill-mode: forwards;
2709
2708
  }
2710
2709
  @keyframes __wp-base-styles-fade-in {
2711
2710
  from {
@@ -2715,10 +2714,10 @@ iframe[name=editor-canvas] {
2715
2714
  opacity: 1;
2716
2715
  }
2717
2716
  }
2718
- @media (prefers-reduced-motion: reduce) {
2717
+ @media not (prefers-reduced-motion) {
2719
2718
  .block-editor-list-view-leaf.is-visible .block-editor-list-view-block-contents {
2720
- animation-duration: 1ms;
2721
- animation-delay: 0s;
2719
+ animation: __wp-base-styles-fade-in 0.08s linear 0s;
2720
+ animation-fill-mode: forwards;
2722
2721
  }
2723
2722
  }
2724
2723
  .block-editor-list-view-leaf .block-editor-block-icon {
@@ -2827,14 +2826,10 @@ iframe[name=editor-canvas] {
2827
2826
  position: absolute;
2828
2827
  right: 0;
2829
2828
  transform: translateY(-50%);
2830
- background: rgba(0, 0, 0, 0.1);
2831
- border-radius: 1px;
2832
- padding: 2px 6px;
2833
- max-width: 100%;
2834
- box-sizing: border-box;
2835
2829
  }
2836
2830
  .block-editor-list-view-leaf.is-selected .block-editor-list-view-block-select-button__anchor {
2837
2831
  background: rgba(0, 0, 0, 0.3);
2832
+ color: #fff;
2838
2833
  }
2839
2834
  .block-editor-list-view-leaf .block-editor-list-view-block-select-button__lock,
2840
2835
  .block-editor-list-view-leaf .block-editor-list-view-block-select-button__sticky {
@@ -2990,6 +2985,15 @@ iframe[name=editor-canvas] {
2990
2985
  display: none;
2991
2986
  }
2992
2987
 
2988
+ .block-editor-media-placeholder__url-input-form {
2989
+ min-width: 260px;
2990
+ }
2991
+ @media (min-width: 600px) {
2992
+ .block-editor-media-placeholder__url-input-form {
2993
+ width: 300px;
2994
+ }
2995
+ }
2996
+
2993
2997
  .modal-open .block-editor-media-replace-flow__options {
2994
2998
  display: none;
2995
2999
  }
@@ -3447,13 +3451,6 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
3447
3451
  */
3448
3452
  }
3449
3453
  .color-block-support-panel .block-editor-contrast-checker {
3450
- /**
3451
- * Contrast checkers are forced to the bottom of the panel so all
3452
- * injected color controls can appear as a single item group without
3453
- * the contrast checkers suddenly appearing between items.
3454
- */
3455
- /* stylelint-disable-next-line property-disallowed-list -- This should be removed when https://github.com/WordPress/gutenberg/issues/58936 is fixed. */
3456
- order: 9999;
3457
3454
  grid-column: span 2;
3458
3455
  margin-top: 16px;
3459
3456
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "14.10.1",
3
+ "version": "14.11.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,37 +37,38 @@
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": "^4.15.1",
41
- "@wordpress/api-fetch": "^7.15.1",
42
- "@wordpress/blob": "^4.15.0",
43
- "@wordpress/block-serialization-default-parser": "^5.15.0",
44
- "@wordpress/blocks": "^14.4.1",
45
- "@wordpress/commands": "^1.15.1",
46
- "@wordpress/components": "^29.1.1",
47
- "@wordpress/compose": "^7.15.1",
48
- "@wordpress/data": "^10.15.1",
49
- "@wordpress/date": "^5.15.1",
50
- "@wordpress/deprecated": "^4.15.1",
51
- "@wordpress/dom": "^4.15.1",
52
- "@wordpress/element": "^6.15.1",
53
- "@wordpress/escape-html": "^3.15.0",
54
- "@wordpress/hooks": "^4.15.0",
55
- "@wordpress/html-entities": "^4.15.0",
56
- "@wordpress/i18n": "^5.15.1",
57
- "@wordpress/icons": "^10.15.1",
58
- "@wordpress/is-shallow-equal": "^5.15.0",
59
- "@wordpress/keyboard-shortcuts": "^5.15.1",
60
- "@wordpress/keycodes": "^4.15.1",
61
- "@wordpress/notices": "^5.15.1",
62
- "@wordpress/preferences": "^4.15.1",
63
- "@wordpress/priority-queue": "^3.15.0",
64
- "@wordpress/private-apis": "^1.15.0",
65
- "@wordpress/rich-text": "^7.15.1",
66
- "@wordpress/style-engine": "^2.15.0",
67
- "@wordpress/token-list": "^3.15.0",
68
- "@wordpress/url": "^4.15.0",
69
- "@wordpress/warning": "^3.15.0",
70
- "@wordpress/wordcount": "^4.15.0",
40
+ "@wordpress/a11y": "^4.16.0",
41
+ "@wordpress/api-fetch": "^7.16.0",
42
+ "@wordpress/blob": "^4.16.0",
43
+ "@wordpress/block-serialization-default-parser": "^5.16.0",
44
+ "@wordpress/blocks": "^14.5.0",
45
+ "@wordpress/commands": "^1.16.0",
46
+ "@wordpress/components": "^29.2.0",
47
+ "@wordpress/compose": "^7.16.0",
48
+ "@wordpress/data": "^10.16.0",
49
+ "@wordpress/date": "^5.16.0",
50
+ "@wordpress/deprecated": "^4.16.0",
51
+ "@wordpress/dom": "^4.16.0",
52
+ "@wordpress/element": "^6.16.0",
53
+ "@wordpress/escape-html": "^3.16.0",
54
+ "@wordpress/hooks": "^4.16.0",
55
+ "@wordpress/html-entities": "^4.16.0",
56
+ "@wordpress/i18n": "^5.16.0",
57
+ "@wordpress/icons": "^10.16.0",
58
+ "@wordpress/is-shallow-equal": "^5.16.0",
59
+ "@wordpress/keyboard-shortcuts": "^5.16.0",
60
+ "@wordpress/keycodes": "^4.16.0",
61
+ "@wordpress/notices": "^5.16.0",
62
+ "@wordpress/preferences": "^4.16.0",
63
+ "@wordpress/priority-queue": "^3.16.0",
64
+ "@wordpress/private-apis": "^1.16.0",
65
+ "@wordpress/rich-text": "^7.16.0",
66
+ "@wordpress/style-engine": "^2.16.0",
67
+ "@wordpress/token-list": "^3.16.0",
68
+ "@wordpress/upload-media": "^0.1.0",
69
+ "@wordpress/url": "^4.16.0",
70
+ "@wordpress/warning": "^3.16.0",
71
+ "@wordpress/wordcount": "^4.16.0",
71
72
  "change-case": "^4.1.2",
72
73
  "clsx": "^2.1.1",
73
74
  "colord": "^2.7.0",
@@ -90,5 +91,5 @@
90
91
  "publishConfig": {
91
92
  "access": "public"
92
93
  },
93
- "gitHead": "0d4503ecc364cf4ca16024673baf5a84dacf212f"
94
+ "gitHead": "f48b9f56629e400891abb5ae491504de475237ff"
94
95
  }
@@ -378,7 +378,6 @@ function BackgroundImageControls( {
378
378
  label={ imgLabel }
379
379
  />
380
380
  }
381
- variant="secondary"
382
381
  renderToggle={ ( props ) => (
383
382
  <Button { ...props } __next40pxDefaultSize />
384
383
  ) }
@@ -11,7 +11,6 @@ import {
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
- import { useNotifyCopy } from '../../utils/use-notify-copy';
15
14
  import usePasteStyles from '../use-paste-styles';
16
15
  import { store as blockEditorStore } from '../../store';
17
16
 
@@ -76,7 +75,6 @@ export default function BlockActions( {
76
75
  flashBlock,
77
76
  } = useDispatch( blockEditorStore );
78
77
 
79
- const notifyCopy = useNotifyCopy();
80
78
  const pasteStyles = usePasteStyles();
81
79
 
82
80
  return children( {
@@ -130,7 +128,6 @@ export default function BlockActions( {
130
128
  if ( clientIds.length === 1 ) {
131
129
  flashBlock( clientIds[ 0 ] );
132
130
  }
133
- notifyCopy( 'copy', clientIds );
134
131
  },
135
132
  async onPasteStyles() {
136
133
  await pasteStyles( getBlocksByClientId( clientIds ) );
@@ -9,7 +9,7 @@
9
9
  svg {
10
10
  fill: currentColor;
11
11
 
12
- // Optimizate for high contrast modes.
12
+ // Optimize for high contrast modes.
13
13
  // See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
14
14
  @media (forced-colors: active) {
15
15
  fill: CanvasText;
@@ -6,35 +6,21 @@ import { box, button, cog, paragraph } from '@wordpress/icons';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import BlockCard from '../';
9
+ import BlockIcon from '../';
10
10
 
11
11
  const meta = {
12
- title: 'BlockEditor/BlockCard',
13
- component: BlockCard,
12
+ title: 'BlockEditor/BlockIcon',
13
+ component: BlockIcon,
14
14
  parameters: {
15
15
  docs: {
16
16
  description: {
17
17
  component:
18
- 'The `BlockCard` component allows to display a "card" which contains the title of a block, its icon and its description.',
18
+ 'The `BlockIcon` component allows to display an icon for a block.',
19
19
  },
20
20
  canvas: { sourceState: 'shown' },
21
21
  },
22
22
  },
23
23
  argTypes: {
24
- title: {
25
- control: 'text',
26
- description: 'The title of the block.',
27
- table: {
28
- type: { summary: 'string' },
29
- },
30
- },
31
- description: {
32
- control: 'text',
33
- description: 'A description of the block functionality.',
34
- table: {
35
- type: { summary: 'string' },
36
- },
37
- },
38
24
  icon: {
39
25
  control: 'select',
40
26
  options: [ 'paragraph', 'cog', 'box', 'button' ],
@@ -50,16 +36,23 @@ const meta = {
50
36
  type: { summary: 'string | object' },
51
37
  },
52
38
  },
53
- name: {
39
+ showColors: {
40
+ control: 'boolean',
41
+ description: 'Whether to show background and foreground colors.',
42
+ table: {
43
+ type: { summary: 'boolean' },
44
+ },
45
+ },
46
+ className: {
54
47
  control: 'text',
55
- description: 'Optional custom name for the block.',
48
+ description: 'Additional CSS class for the icon.',
56
49
  table: {
57
50
  type: { summary: 'string' },
58
51
  },
59
52
  },
60
- className: {
53
+ context: {
61
54
  control: 'text',
62
- description: 'Additional CSS class names.',
55
+ description: 'Context where the icon is being used.',
63
56
  table: {
64
57
  type: { summary: 'string' },
65
58
  },
@@ -71,9 +64,6 @@ export default meta;
71
64
 
72
65
  export const Default = {
73
66
  args: {
74
- title: 'Paragraph',
75
- icon: paragraph,
76
- description: 'This is a paragraph block description.',
77
- name: 'Paragraph Block',
67
+ icon: 'paragraph',
78
68
  },
79
69
  };
@@ -9,7 +9,7 @@
9
9
  svg {
10
10
  fill: currentColor;
11
11
 
12
- // Optimizate for high contrast modes.
12
+ // Optimize for high contrast modes.
13
13
  // See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
14
14
  @media (forced-colors: active) {
15
15
  fill: CanvasText;
@@ -39,7 +39,7 @@ function BlockStylesPanel( { clientId } ) {
39
39
  );
40
40
  }
41
41
 
42
- const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
42
+ function BlockInspector() {
43
43
  const {
44
44
  count,
45
45
  selectedBlockName,
@@ -137,14 +137,11 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
137
137
  ! selectedBlockClientId ||
138
138
  isSelectedBlockUnregistered
139
139
  ) {
140
- if ( showNoBlockSelectedMessage ) {
141
- return (
142
- <span className="block-editor-block-inspector__no-blocks">
143
- { __( 'No block selected.' ) }
144
- </span>
145
- );
146
- }
147
- return null;
140
+ return (
141
+ <span className="block-editor-block-inspector__no-blocks">
142
+ { __( 'No block selected.' ) }
143
+ </span>
144
+ );
148
145
  }
149
146
 
150
147
  return (
@@ -168,7 +165,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
168
165
  />
169
166
  </BlockInspectorSingleBlockWrapper>
170
167
  );
171
- };
168
+ }
172
169
 
173
170
  const BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {
174
171
  return animate ? wrapper( children ) : children;
@@ -48,7 +48,7 @@ export function useFocusHandler( clientId ) {
48
48
  return;
49
49
  }
50
50
 
51
- // If an inner block is focussed, that block is resposible for
51
+ // If an inner block is focussed, that block is responsible for
52
52
  // setting the selected block.
53
53
  if ( ! isInsideRootBlock( node, event.target ) ) {
54
54
  return;
@@ -1,6 +1,6 @@
1
1
  // These rules ensure the preview scales smoothly regardless of the container size.
2
2
  .block-editor-block-preview__container {
3
- // In the component, a top padding is provided as an inline style to provid an aspect-ratio.
3
+ // In the component, a top padding is provided as an inline style to provide an aspect-ratio.
4
4
  // This positioning enables the content to sit on top of that padding to fit.
5
5
  position: relative;
6
6