@wordpress/block-editor 8.0.12-next.33ec3857e2.0 → 8.0.12

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 (363) hide show
  1. package/README.md +0 -4
  2. package/build/components/block-caption/index.native.js +3 -14
  3. package/build/components/block-caption/index.native.js.map +1 -1
  4. package/build/components/block-inspector/index.js +33 -12
  5. package/build/components/block-inspector/index.js.map +1 -1
  6. package/build/components/block-list/block.js +1 -1
  7. package/build/components/block-list/block.js.map +1 -1
  8. package/build/components/block-list/block.native.js +2 -3
  9. package/build/components/block-list/block.native.js.map +1 -1
  10. package/build/components/block-list/use-block-props/index.js +1 -3
  11. package/build/components/block-list/use-block-props/index.js.map +1 -1
  12. package/build/components/block-list/use-in-between-inserter.js +1 -1
  13. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  14. package/build/components/block-list-appender/index.js +11 -3
  15. package/build/components/block-list-appender/index.js.map +1 -1
  16. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +2 -2
  17. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  18. package/build/components/block-mover/button.js +2 -2
  19. package/build/components/block-mover/button.js.map +1 -1
  20. package/build/components/block-mover/index.js +2 -2
  21. package/build/components/block-mover/index.js.map +1 -1
  22. package/build/components/block-mover/index.native.js +2 -2
  23. package/build/components/block-mover/index.native.js.map +1 -1
  24. package/build/components/block-preview/auto.js +2 -10
  25. package/build/components/block-preview/auto.js.map +1 -1
  26. package/build/components/block-settings/container.native.js +1 -2
  27. package/build/components/block-settings/container.native.js.map +1 -1
  28. package/build/components/block-styles/index.js +134 -110
  29. package/build/components/block-styles/index.js.map +1 -1
  30. package/build/components/block-styles/utils.js +0 -39
  31. package/build/components/block-styles/utils.js.map +1 -1
  32. package/build/components/block-switcher/block-styles-menu.js +23 -3
  33. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  34. package/build/components/block-tools/back-compat.js +1 -2
  35. package/build/components/block-tools/back-compat.js.map +1 -1
  36. package/build/components/block-tools/block-selection-button.js +3 -3
  37. package/build/components/block-tools/block-selection-button.js.map +1 -1
  38. package/build/components/block-tools/insertion-point.js +1 -11
  39. package/build/components/block-tools/insertion-point.js.map +1 -1
  40. package/build/components/button-block-appender/index.js +1 -2
  41. package/build/components/button-block-appender/index.js.map +1 -1
  42. package/build/components/colors-gradients/panel-color-gradient-settings.js +10 -51
  43. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  44. package/build/components/default-block-appender/index.js +19 -16
  45. package/build/components/default-block-appender/index.js.map +1 -1
  46. package/build/components/default-style-picker/index.js +3 -18
  47. package/build/components/default-style-picker/index.js.map +1 -1
  48. package/build/components/iframe/index.js +4 -3
  49. package/build/components/iframe/index.js.map +1 -1
  50. package/build/components/index.js +9 -9
  51. package/build/components/index.js.map +1 -1
  52. package/build/components/inner-blocks/default-block-appender.js +4 -2
  53. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  54. package/build/components/inserter/hooks/use-insertion-point.js +2 -2
  55. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  56. package/build/components/inserter/index.js +2 -2
  57. package/build/components/inserter/index.js.map +1 -1
  58. package/build/components/inserter/index.native.js +3 -3
  59. package/build/components/inserter/index.native.js.map +1 -1
  60. package/build/components/inserter/quick-inserter.js +1 -1
  61. package/build/components/inserter/quick-inserter.js.map +1 -1
  62. package/build/components/inserter/tabs.native.js +4 -7
  63. package/build/components/inserter/tabs.native.js.map +1 -1
  64. package/build/components/inspector-controls/block-support-slot-container.js +1 -2
  65. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  66. package/build/components/inspector-controls/block-support-tools-panel.js +50 -22
  67. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  68. package/build/components/inspector-controls/fill.native.js +5 -3
  69. package/build/components/inspector-controls/fill.native.js.map +1 -1
  70. package/build/components/inspector-controls/groups.js +0 -2
  71. package/build/components/inspector-controls/groups.js.map +1 -1
  72. package/build/components/inspector-controls/slot.js +3 -1
  73. package/build/components/inspector-controls/slot.js.map +1 -1
  74. package/build/components/letter-spacing-control/index.js +6 -6
  75. package/build/components/letter-spacing-control/index.js.map +1 -1
  76. package/build/components/list-view/block-select-button.js +3 -23
  77. package/build/components/list-view/block-select-button.js.map +1 -1
  78. package/build/components/list-view/use-list-view-drop-zone.js +1 -1
  79. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  80. package/build/components/media-placeholder/index.js +0 -2
  81. package/build/components/media-placeholder/index.js.map +1 -1
  82. package/build/components/media-replace-flow/index.js +0 -2
  83. package/build/components/media-replace-flow/index.js.map +1 -1
  84. package/build/components/provider/use-block-sync.js +37 -10
  85. package/build/components/provider/use-block-sync.js.map +1 -1
  86. package/build/components/rich-text/file-paste-handler.js +1 -1
  87. package/build/components/rich-text/file-paste-handler.js.map +1 -1
  88. package/build/components/rich-text/use-input-rules.js +1 -3
  89. package/build/components/rich-text/use-input-rules.js.map +1 -1
  90. package/build/components/selection-scroll-into-view/index.js +1 -2
  91. package/build/components/selection-scroll-into-view/index.js.map +1 -1
  92. package/build/components/use-canvas-click-redirect/index.js +66 -0
  93. package/build/components/use-canvas-click-redirect/index.js.map +1 -0
  94. package/build/components/use-on-block-drop/index.js +4 -8
  95. package/build/components/use-on-block-drop/index.js.map +1 -1
  96. package/build/components/use-setting/index.js +7 -0
  97. package/build/components/use-setting/index.js.map +1 -1
  98. package/build/components/writing-flow/use-multi-selection.js +1 -3
  99. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  100. package/build/hooks/border-color.js +5 -63
  101. package/build/hooks/border-color.js.map +1 -1
  102. package/build/hooks/border-radius.js +0 -47
  103. package/build/hooks/border-radius.js.map +1 -1
  104. package/build/hooks/border-style.js +0 -41
  105. package/build/hooks/border-style.js.map +1 -1
  106. package/build/hooks/border-width.js +31 -70
  107. package/build/hooks/border-width.js.map +1 -1
  108. package/build/hooks/border.js +11 -81
  109. package/build/hooks/border.js.map +1 -1
  110. package/build/hooks/letter-spacing.js +1 -1
  111. package/build/hooks/letter-spacing.js.map +1 -1
  112. package/build/hooks/typography.js +1 -1
  113. package/build/hooks/typography.js.map +1 -1
  114. package/build/layouts/flex.js +3 -27
  115. package/build/layouts/flex.js.map +1 -1
  116. package/build/store/actions.js +5 -4
  117. package/build/store/actions.js.map +1 -1
  118. package/build/store/defaults.js +1 -5
  119. package/build/store/defaults.js.map +1 -1
  120. package/build/store/reducer.js +24 -1
  121. package/build/store/reducer.js.map +1 -1
  122. package/build/store/selectors.js +9 -27
  123. package/build/store/selectors.js.map +1 -1
  124. package/build/utils/get-paste-event-data.js +1 -1
  125. package/build/utils/get-paste-event-data.js.map +1 -1
  126. package/build/utils/parse-css-unit-to-px.js +1 -1
  127. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  128. package/build-module/components/block-caption/index.native.js +3 -13
  129. package/build-module/components/block-caption/index.native.js.map +1 -1
  130. package/build-module/components/block-inspector/index.js +33 -12
  131. package/build-module/components/block-inspector/index.js.map +1 -1
  132. package/build-module/components/block-list/block.js +1 -1
  133. package/build-module/components/block-list/block.js.map +1 -1
  134. package/build-module/components/block-list/block.native.js +2 -3
  135. package/build-module/components/block-list/block.native.js.map +1 -1
  136. package/build-module/components/block-list/use-block-props/index.js +1 -3
  137. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  138. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  139. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  140. package/build-module/components/block-list-appender/index.js +10 -3
  141. package/build-module/components/block-list-appender/index.js.map +1 -1
  142. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +2 -2
  143. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  144. package/build-module/components/block-mover/button.js +2 -2
  145. package/build-module/components/block-mover/button.js.map +1 -1
  146. package/build-module/components/block-mover/index.js +2 -2
  147. package/build-module/components/block-mover/index.js.map +1 -1
  148. package/build-module/components/block-mover/index.native.js +2 -2
  149. package/build-module/components/block-mover/index.native.js.map +1 -1
  150. package/build-module/components/block-preview/auto.js +2 -10
  151. package/build-module/components/block-preview/auto.js.map +1 -1
  152. package/build-module/components/block-settings/container.native.js +1 -2
  153. package/build-module/components/block-settings/container.native.js.map +1 -1
  154. package/build-module/components/block-styles/index.js +133 -112
  155. package/build-module/components/block-styles/index.js.map +1 -1
  156. package/build-module/components/block-styles/utils.js +0 -34
  157. package/build-module/components/block-styles/utils.js.map +1 -1
  158. package/build-module/components/block-switcher/block-styles-menu.js +21 -3
  159. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  160. package/build-module/components/block-tools/back-compat.js +1 -2
  161. package/build-module/components/block-tools/back-compat.js.map +1 -1
  162. package/build-module/components/block-tools/block-selection-button.js +3 -3
  163. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  164. package/build-module/components/block-tools/insertion-point.js +1 -11
  165. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  166. package/build-module/components/button-block-appender/index.js +1 -2
  167. package/build-module/components/button-block-appender/index.js.map +1 -1
  168. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +13 -54
  169. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  170. package/build-module/components/default-block-appender/index.js +18 -15
  171. package/build-module/components/default-block-appender/index.js.map +1 -1
  172. package/build-module/components/default-style-picker/index.js +3 -17
  173. package/build-module/components/default-style-picker/index.js.map +1 -1
  174. package/build-module/components/iframe/index.js +4 -3
  175. package/build-module/components/iframe/index.js.map +1 -1
  176. package/build-module/components/index.js +1 -1
  177. package/build-module/components/index.js.map +1 -1
  178. package/build-module/components/inner-blocks/default-block-appender.js +4 -2
  179. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  180. package/build-module/components/inserter/hooks/use-insertion-point.js +2 -2
  181. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  182. package/build-module/components/inserter/index.js +2 -2
  183. package/build-module/components/inserter/index.js.map +1 -1
  184. package/build-module/components/inserter/index.native.js +4 -4
  185. package/build-module/components/inserter/index.native.js.map +1 -1
  186. package/build-module/components/inserter/quick-inserter.js +1 -1
  187. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  188. package/build-module/components/inserter/tabs.native.js +4 -7
  189. package/build-module/components/inserter/tabs.native.js.map +1 -1
  190. package/build-module/components/inspector-controls/block-support-slot-container.js +1 -2
  191. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  192. package/build-module/components/inspector-controls/block-support-tools-panel.js +50 -22
  193. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  194. package/build-module/components/inspector-controls/fill.native.js +5 -3
  195. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  196. package/build-module/components/inspector-controls/groups.js +0 -2
  197. package/build-module/components/inspector-controls/groups.js.map +1 -1
  198. package/build-module/components/inspector-controls/slot.js +3 -1
  199. package/build-module/components/inspector-controls/slot.js.map +1 -1
  200. package/build-module/components/letter-spacing-control/index.js +6 -6
  201. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  202. package/build-module/components/list-view/block-select-button.js +3 -22
  203. package/build-module/components/list-view/block-select-button.js.map +1 -1
  204. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
  205. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  206. package/build-module/components/media-placeholder/index.js +0 -2
  207. package/build-module/components/media-placeholder/index.js.map +1 -1
  208. package/build-module/components/media-replace-flow/index.js +0 -2
  209. package/build-module/components/media-replace-flow/index.js.map +1 -1
  210. package/build-module/components/provider/use-block-sync.js +41 -14
  211. package/build-module/components/provider/use-block-sync.js.map +1 -1
  212. package/build-module/components/rich-text/file-paste-handler.js +1 -1
  213. package/build-module/components/rich-text/file-paste-handler.js.map +1 -1
  214. package/build-module/components/rich-text/use-input-rules.js +1 -2
  215. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  216. package/build-module/components/selection-scroll-into-view/index.js +1 -2
  217. package/build-module/components/selection-scroll-into-view/index.js.map +1 -1
  218. package/build-module/components/use-canvas-click-redirect/index.js +54 -0
  219. package/build-module/components/use-canvas-click-redirect/index.js.map +1 -0
  220. package/build-module/components/use-on-block-drop/index.js +4 -8
  221. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  222. package/build-module/components/use-setting/index.js +7 -0
  223. package/build-module/components/use-setting/index.js.map +1 -1
  224. package/build-module/components/writing-flow/use-multi-selection.js +4 -3
  225. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  226. package/build-module/hooks/border-color.js +7 -61
  227. package/build-module/hooks/border-color.js.map +1 -1
  228. package/build-module/hooks/border-radius.js +0 -42
  229. package/build-module/hooks/border-radius.js.map +1 -1
  230. package/build-module/hooks/border-style.js +0 -36
  231. package/build-module/hooks/border-style.js.map +1 -1
  232. package/build-module/hooks/border-width.js +32 -66
  233. package/build-module/hooks/border-width.js.map +1 -1
  234. package/build-module/hooks/border.js +12 -80
  235. package/build-module/hooks/border.js.map +1 -1
  236. package/build-module/hooks/letter-spacing.js +1 -1
  237. package/build-module/hooks/letter-spacing.js.map +1 -1
  238. package/build-module/hooks/typography.js +1 -1
  239. package/build-module/hooks/typography.js.map +1 -1
  240. package/build-module/layouts/flex.js +3 -27
  241. package/build-module/layouts/flex.js.map +1 -1
  242. package/build-module/store/actions.js +5 -4
  243. package/build-module/store/actions.js.map +1 -1
  244. package/build-module/store/defaults.js +1 -5
  245. package/build-module/store/defaults.js.map +1 -1
  246. package/build-module/store/reducer.js +24 -1
  247. package/build-module/store/reducer.js.map +1 -1
  248. package/build-module/store/selectors.js +9 -26
  249. package/build-module/store/selectors.js.map +1 -1
  250. package/build-module/utils/get-paste-event-data.js +1 -1
  251. package/build-module/utils/get-paste-event-data.js.map +1 -1
  252. package/build-module/utils/parse-css-unit-to-px.js +1 -1
  253. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  254. package/build-style/style-rtl.css +180 -212
  255. package/build-style/style.css +180 -212
  256. package/package.json +27 -27
  257. package/src/components/block-caption/index.native.js +4 -22
  258. package/src/components/block-inspector/index.js +32 -13
  259. package/src/components/block-list/block.js +1 -1
  260. package/src/components/block-list/block.native.js +2 -2
  261. package/src/components/block-list/use-block-props/index.js +1 -3
  262. package/src/components/block-list/use-in-between-inserter.js +1 -1
  263. package/src/components/block-list-appender/index.js +21 -5
  264. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +2 -5
  265. package/src/components/block-mover/button.js +2 -6
  266. package/src/components/block-mover/index.js +2 -5
  267. package/src/components/block-mover/index.native.js +2 -5
  268. package/src/components/block-preview/auto.js +2 -7
  269. package/src/components/block-settings/container.native.js +0 -1
  270. package/src/components/block-styles/index.js +145 -125
  271. package/src/components/block-styles/style.scss +51 -59
  272. package/src/components/block-styles/test/{utils.js → index.js} +1 -60
  273. package/src/components/block-styles/utils.js +0 -39
  274. package/src/components/block-switcher/block-styles-menu.js +38 -3
  275. package/src/components/block-tools/back-compat.js +0 -1
  276. package/src/components/block-tools/block-selection-button.js +3 -9
  277. package/src/components/block-tools/insertion-point.js +1 -10
  278. package/src/components/border-style-control/style.scss +1 -0
  279. package/src/components/button-block-appender/index.js +0 -1
  280. package/src/components/colors-gradients/panel-color-gradient-settings.js +19 -75
  281. package/src/components/colors-gradients/style.scss +5 -42
  282. package/src/components/default-block-appender/index.js +24 -17
  283. package/src/components/default-block-appender/style.scss +0 -4
  284. package/src/components/default-block-appender/test/__snapshots__/index.js.snap +24 -12
  285. package/src/components/default-block-appender/test/index.js +14 -4
  286. package/src/components/default-style-picker/index.js +6 -18
  287. package/src/components/iframe/index.js +3 -6
  288. package/src/components/index.js +1 -1
  289. package/src/components/inner-blocks/README.md +0 -2
  290. package/src/components/inner-blocks/default-block-appender.js +7 -2
  291. package/src/components/inserter/hooks/use-insertion-point.js +2 -9
  292. package/src/components/inserter/index.js +2 -2
  293. package/src/components/inserter/index.native.js +4 -7
  294. package/src/components/inserter/quick-inserter.js +1 -1
  295. package/src/components/inserter/tabs.native.js +4 -5
  296. package/src/components/inspector-controls/block-support-slot-container.js +1 -3
  297. package/src/components/inspector-controls/block-support-tools-panel.js +57 -21
  298. package/src/components/inspector-controls/fill.native.js +3 -4
  299. package/src/components/inspector-controls/groups.js +0 -2
  300. package/src/components/inspector-controls/slot.js +7 -2
  301. package/src/components/letter-spacing-control/index.js +6 -6
  302. package/src/components/link-control/README.md +1 -1
  303. package/src/components/link-control/test/index.js +0 -2
  304. package/src/components/list-view/block-select-button.js +1 -20
  305. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  306. package/src/components/media-placeholder/index.js +0 -2
  307. package/src/components/media-replace-flow/index.js +0 -2
  308. package/src/components/provider/use-block-sync.js +45 -11
  309. package/src/components/rich-text/file-paste-handler.js +1 -3
  310. package/src/components/rich-text/use-input-rules.js +1 -2
  311. package/src/components/selection-scroll-into-view/index.js +0 -1
  312. package/src/components/url-input/README.md +0 -5
  313. package/src/components/use-canvas-click-redirect/index.js +57 -0
  314. package/src/components/use-on-block-drop/index.js +4 -11
  315. package/src/components/use-setting/index.js +9 -0
  316. package/src/components/writing-flow/use-multi-selection.js +9 -12
  317. package/src/hooks/border-color.js +3 -55
  318. package/src/hooks/border-radius.js +0 -32
  319. package/src/hooks/border-style.js +0 -26
  320. package/src/hooks/border-width.js +32 -56
  321. package/src/hooks/border.js +20 -115
  322. package/src/hooks/border.scss +17 -3
  323. package/src/hooks/letter-spacing.js +1 -1
  324. package/src/hooks/typography.js +1 -1
  325. package/src/layouts/flex.js +4 -25
  326. package/src/store/actions.js +5 -5
  327. package/src/store/defaults.js +0 -2
  328. package/src/store/reducer.js +23 -1
  329. package/src/store/selectors.js +9 -39
  330. package/src/store/test/reducer.js +35 -0
  331. package/src/store/test/selectors.js +1 -1
  332. package/src/style.scss +3 -4
  333. package/src/utils/get-paste-event-data.js +1 -1
  334. package/src/utils/parse-css-unit-to-px.js +1 -1
  335. package/src/utils/test/parse-css-unit-to-px.js +0 -1
  336. package/tsconfig.tsbuildinfo +1 -1
  337. package/build/components/block-styles/menu-items.js +0 -63
  338. package/build/components/block-styles/menu-items.js.map +0 -1
  339. package/build/components/block-styles/preview-panel.js +0 -45
  340. package/build/components/block-styles/preview-panel.js.map +0 -1
  341. package/build/components/block-styles/use-styles-for-block.js +0 -119
  342. package/build/components/block-styles/use-styles-for-block.js.map +0 -1
  343. package/build/components/rich-text/prevent-event-discovery.js +0 -33
  344. package/build/components/rich-text/prevent-event-discovery.js.map +0 -1
  345. package/build/components/use-display-block-controls/index.native.js +0 -45
  346. package/build/components/use-display-block-controls/index.native.js.map +0 -1
  347. package/build-module/components/block-styles/menu-items.js +0 -50
  348. package/build-module/components/block-styles/menu-items.js.map +0 -1
  349. package/build-module/components/block-styles/preview-panel.js +0 -35
  350. package/build-module/components/block-styles/preview-panel.js.map +0 -1
  351. package/build-module/components/block-styles/use-styles-for-block.js +0 -107
  352. package/build-module/components/block-styles/use-styles-for-block.js.map +0 -1
  353. package/build-module/components/rich-text/prevent-event-discovery.js +0 -25
  354. package/build-module/components/rich-text/prevent-event-discovery.js.map +0 -1
  355. package/build-module/components/use-display-block-controls/index.native.js +0 -34
  356. package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
  357. package/src/components/block-styles/menu-items.js +0 -49
  358. package/src/components/block-styles/preview-panel.js +0 -36
  359. package/src/components/block-styles/use-styles-for-block.js +0 -99
  360. package/src/components/rich-text/prevent-event-discovery.js +0 -23
  361. package/src/components/use-display-block-controls/index.native.js +0 -38
  362. package/src/components/writing-flow/test/use-multi-selection.js +0 -36
  363. package/src/hooks/dimensions.scss +0 -5
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.preventEventDiscovery = preventEventDiscovery;
7
-
8
- var _richText = require("@wordpress/rich-text");
9
-
10
- /**
11
- * WordPress dependencies
12
- */
13
- function preventEventDiscovery(value) {
14
- const searchText = 'tales of gutenberg';
15
- const addText = ' 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️';
16
- const {
17
- start,
18
- text
19
- } = value;
20
-
21
- if (start < searchText.length) {
22
- return value;
23
- }
24
-
25
- const charactersBefore = text.slice(start - searchText.length, start);
26
-
27
- if (charactersBefore.toLowerCase() !== searchText) {
28
- return value;
29
- }
30
-
31
- return (0, _richText.insert)(value, addText);
32
- }
33
- //# sourceMappingURL=prevent-event-discovery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/rich-text/prevent-event-discovery.js"],"names":["preventEventDiscovery","value","searchText","addText","start","text","length","charactersBefore","slice","toLowerCase"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,SAASA,qBAAT,CAAgCC,KAAhC,EAAwC;AAC9C,QAAMC,UAAU,GAAG,oBAAnB;AACA,QAAMC,OAAO,GACZ,4FADD;AAEA,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAkBJ,KAAxB;;AAEA,MAAKG,KAAK,GAAGF,UAAU,CAACI,MAAxB,EAAiC;AAChC,WAAOL,KAAP;AACA;;AAED,QAAMM,gBAAgB,GAAGF,IAAI,CAACG,KAAL,CAAYJ,KAAK,GAAGF,UAAU,CAACI,MAA/B,EAAuCF,KAAvC,CAAzB;;AAEA,MAAKG,gBAAgB,CAACE,WAAjB,OAAmCP,UAAxC,EAAqD;AACpD,WAAOD,KAAP;AACA;;AAED,SAAO,sBAAQA,KAAR,EAAeE,OAAf,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { insert } from '@wordpress/rich-text';\n\nexport function preventEventDiscovery( value ) {\n\tconst searchText = 'tales of gutenberg';\n\tconst addText =\n\t\t' 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️';\n\tconst { start, text } = value;\n\n\tif ( start < searchText.length ) {\n\t\treturn value;\n\t}\n\n\tconst charactersBefore = text.slice( start - searchText.length, start );\n\n\tif ( charactersBefore.toLowerCase() !== searchText ) {\n\t\treturn value;\n\t}\n\n\treturn insert( value, addText );\n}\n"]}
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = useDisplayBlockControls;
7
-
8
- var _data = require("@wordpress/data");
9
-
10
- var _blocks = require("@wordpress/blocks");
11
-
12
- var _context = require("../block-edit/context");
13
-
14
- var _store = require("../../store");
15
-
16
- /**
17
- * WordPress dependencies
18
- */
19
-
20
- /**
21
- * Internal dependencies
22
- */
23
- function useDisplayBlockControls() {
24
- const {
25
- isSelected,
26
- clientId,
27
- name
28
- } = (0, _context.useBlockEditContext)();
29
- return (0, _data.useSelect)(select => {
30
- const {
31
- getBlockName,
32
- getBlockRootClientId
33
- } = select(_store.store);
34
- const parentId = getBlockRootClientId(clientId);
35
- const parentBlockName = getBlockName(parentId);
36
- const hideControls = (0, _blocks.hasBlockSupport)(parentBlockName, '__experimentalHideChildBlockControls', false);
37
-
38
- if (!hideControls && isSelected) {
39
- return true;
40
- }
41
-
42
- return false;
43
- }, [clientId, isSelected, name]);
44
- }
45
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-display-block-controls/index.native.js"],"names":["useDisplayBlockControls","isSelected","clientId","name","select","getBlockName","getBlockRootClientId","blockEditorStore","parentId","parentBlockName","hideControls"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIe,SAASA,uBAAT,GAAmC;AACjD,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,QAAd;AAAwBC,IAAAA;AAAxB,MAAiC,mCAAvC;AACA,SAAO,qBACJC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,YAAF;AAAgBC,MAAAA;AAAhB,QAAyCF,MAAM,CACpDG,YADoD,CAArD;AAIA,UAAMC,QAAQ,GAAGF,oBAAoB,CAAEJ,QAAF,CAArC;AACA,UAAMO,eAAe,GAAGJ,YAAY,CAAEG,QAAF,CAApC;AAEA,UAAME,YAAY,GAAG,6BACpBD,eADoB,EAEpB,sCAFoB,EAGpB,KAHoB,CAArB;;AAMA,QAAK,CAAEC,YAAF,IAAkBT,UAAvB,EAAoC;AACnC,aAAO,IAAP;AACA;;AAED,WAAO,KAAP;AACA,GApBK,EAqBN,CAAEC,QAAF,EAAYD,UAAZ,EAAwBE,IAAxB,CArBM,CAAP;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function useDisplayBlockControls() {\n\tconst { isSelected, clientId, name } = useBlockEditContext();\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockName, getBlockRootClientId } = select(\n\t\t\t\tblockEditorStore\n\t\t\t);\n\n\t\t\tconst parentId = getBlockRootClientId( clientId );\n\t\t\tconst parentBlockName = getBlockName( parentId );\n\n\t\t\tconst hideControls = hasBlockSupport(\n\t\t\t\tparentBlockName,\n\t\t\t\t'__experimentalHideChildBlockControls',\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tif ( ! hideControls && isSelected ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t},\n\t\t[ clientId, isSelected, name ]\n\t);\n}\n"]}
@@ -1,50 +0,0 @@
1
- import { createElement, Fragment } from "@wordpress/element";
2
-
3
- /**
4
- * External dependencies
5
- */
6
- import { noop } from 'lodash';
7
- /**
8
- * WordPress dependencies
9
- */
10
-
11
- import { MenuItem, __experimentalText as Text } from '@wordpress/components';
12
- import { check } from '@wordpress/icons';
13
- /**
14
- * Internal dependencies
15
- */
16
-
17
- import useStylesForBlocks from './use-styles-for-block';
18
- export default function BlockStylesMenuItems(_ref) {
19
- let {
20
- clientId,
21
- onSwitch = noop
22
- } = _ref;
23
- const {
24
- onSelect,
25
- stylesToRender,
26
- activeStyle
27
- } = useStylesForBlocks({
28
- clientId,
29
- onSwitch
30
- });
31
-
32
- if (!stylesToRender || stylesToRender.length === 0) {
33
- return null;
34
- }
35
-
36
- return createElement(Fragment, null, stylesToRender.map(style => {
37
- const menuItemText = style.label || style.name;
38
- return createElement(MenuItem, {
39
- key: style.name,
40
- icon: activeStyle.name === style.name ? check : null,
41
- onClick: () => onSelect(style)
42
- }, createElement(Text, {
43
- as: "span",
44
- limit: 18,
45
- ellipsizeMode: "tail",
46
- truncate: true
47
- }, menuItemText));
48
- }));
49
- }
50
- //# sourceMappingURL=menu-items.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-styles/menu-items.js"],"names":["noop","MenuItem","__experimentalText","Text","check","useStylesForBlocks","BlockStylesMenuItems","clientId","onSwitch","onSelect","stylesToRender","activeStyle","length","map","style","menuItemText","label","name"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,EAAmBC,kBAAkB,IAAIC,IAAzC,QAAqD,uBAArD;AACA,SAASC,KAAT,QAAsB,kBAAtB;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AAEA,eAAe,SAASC,oBAAT,OAA+D;AAAA,MAAhC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAQ,GAAGR;AAAvB,GAAgC;AAC7E,QAAM;AAAES,IAAAA,QAAF;AAAYC,IAAAA,cAAZ;AAA4BC,IAAAA;AAA5B,MAA4CN,kBAAkB,CAAE;AACrEE,IAAAA,QADqE;AAErEC,IAAAA;AAFqE,GAAF,CAApE;;AAKA,MAAK,CAAEE,cAAF,IAAoBA,cAAc,CAACE,MAAf,KAA0B,CAAnD,EAAuD;AACtD,WAAO,IAAP;AACA;;AACD,SACC,8BACGF,cAAc,CAACG,GAAf,CAAsBC,KAAF,IAAa;AAClC,UAAMC,YAAY,GAAGD,KAAK,CAACE,KAAN,IAAeF,KAAK,CAACG,IAA1C;AACA,WACC,cAAC,QAAD;AACC,MAAA,GAAG,EAAGH,KAAK,CAACG,IADb;AAEC,MAAA,IAAI,EAAGN,WAAW,CAACM,IAAZ,KAAqBH,KAAK,CAACG,IAA3B,GAAkCb,KAAlC,GAA0C,IAFlD;AAGC,MAAA,OAAO,EAAG,MAAMK,QAAQ,CAAEK,KAAF;AAHzB,OAKC,cAAC,IAAD;AACC,MAAA,EAAE,EAAC,MADJ;AAEC,MAAA,KAAK,EAAG,EAFT;AAGC,MAAA,aAAa,EAAC,MAHf;AAIC,MAAA,QAAQ;AAJT,OAMGC,YANH,CALD,CADD;AAgBA,GAlBC,CADH,CADD;AAuBA","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { MenuItem, __experimentalText as Text } from '@wordpress/components';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport useStylesForBlocks from './use-styles-for-block';\n\nexport default function BlockStylesMenuItems( { clientId, onSwitch = noop } ) {\n\tconst { onSelect, stylesToRender, activeStyle } = useStylesForBlocks( {\n\t\tclientId,\n\t\tonSwitch,\n\t} );\n\n\tif ( ! stylesToRender || stylesToRender.length === 0 ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t{ stylesToRender.map( ( style ) => {\n\t\t\t\tconst menuItemText = style.label || style.name;\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ style.name }\n\t\t\t\t\t\ticon={ activeStyle.name === style.name ? check : null }\n\t\t\t\t\t\tonClick={ () => onSelect( style ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tas=\"span\"\n\t\t\t\t\t\t\tlimit={ 18 }\n\t\t\t\t\t\t\tellipsizeMode=\"tail\"\n\t\t\t\t\t\t\ttruncate\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ menuItemText }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"]}
@@ -1,35 +0,0 @@
1
- import { createElement } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { useMemo } from '@wordpress/element';
7
- /**
8
- * Internal dependencies
9
- */
10
-
11
- import InserterPreviewPanel from '../inserter/preview-panel';
12
- import { replaceActiveStyle } from './utils';
13
- export default function BlockStylesPreviewPanel(_ref) {
14
- let {
15
- genericPreviewBlock,
16
- style,
17
- className,
18
- activeStyle
19
- } = _ref;
20
- const styleClassName = replaceActiveStyle(className, activeStyle, style);
21
- const previewBlocks = useMemo(() => {
22
- return { ...genericPreviewBlock,
23
- title: style.label || style.name,
24
- description: style.description,
25
- initialAttributes: { ...genericPreviewBlock.attributes,
26
- className: styleClassName + ' block-editor-block-styles__block-preview-container'
27
- }
28
- };
29
- }, [genericPreviewBlock, styleClassName]);
30
- return createElement(InserterPreviewPanel, {
31
- item: previewBlocks,
32
- isStylePreview: true
33
- });
34
- }
35
- //# sourceMappingURL=preview-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-styles/preview-panel.js"],"names":["useMemo","InserterPreviewPanel","replaceActiveStyle","BlockStylesPreviewPanel","genericPreviewBlock","style","className","activeStyle","styleClassName","previewBlocks","title","label","name","description","initialAttributes","attributes"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,SAASC,kBAAT,QAAmC,SAAnC;AAEA,eAAe,SAASC,uBAAT,OAKX;AAAA,MAL6C;AAChDC,IAAAA,mBADgD;AAEhDC,IAAAA,KAFgD;AAGhDC,IAAAA,SAHgD;AAIhDC,IAAAA;AAJgD,GAK7C;AACH,QAAMC,cAAc,GAAGN,kBAAkB,CAAEI,SAAF,EAAaC,WAAb,EAA0BF,KAA1B,CAAzC;AACA,QAAMI,aAAa,GAAGT,OAAO,CAAE,MAAM;AACpC,WAAO,EACN,GAAGI,mBADG;AAENM,MAAAA,KAAK,EAAEL,KAAK,CAACM,KAAN,IAAeN,KAAK,CAACO,IAFtB;AAGNC,MAAAA,WAAW,EAAER,KAAK,CAACQ,WAHb;AAINC,MAAAA,iBAAiB,EAAE,EAClB,GAAGV,mBAAmB,CAACW,UADL;AAElBT,QAAAA,SAAS,EACRE,cAAc,GACd;AAJiB;AAJb,KAAP;AAWA,GAZ4B,EAY1B,CAAEJ,mBAAF,EAAuBI,cAAvB,CAZ0B,CAA7B;AAcA,SACC,cAAC,oBAAD;AAAsB,IAAA,IAAI,EAAGC,aAA7B;AAA6C,IAAA,cAAc,EAAG;AAA9D,IADD;AAGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InserterPreviewPanel from '../inserter/preview-panel';\nimport { replaceActiveStyle } from './utils';\n\nexport default function BlockStylesPreviewPanel( {\n\tgenericPreviewBlock,\n\tstyle,\n\tclassName,\n\tactiveStyle,\n} ) {\n\tconst styleClassName = replaceActiveStyle( className, activeStyle, style );\n\tconst previewBlocks = useMemo( () => {\n\t\treturn {\n\t\t\t...genericPreviewBlock,\n\t\t\ttitle: style.label || style.name,\n\t\t\tdescription: style.description,\n\t\t\tinitialAttributes: {\n\t\t\t\t...genericPreviewBlock.attributes,\n\t\t\t\tclassName:\n\t\t\t\t\tstyleClassName +\n\t\t\t\t\t' block-editor-block-styles__block-preview-container',\n\t\t\t},\n\t\t};\n\t}, [ genericPreviewBlock, styleClassName ] );\n\n\treturn (\n\t\t<InserterPreviewPanel item={ previewBlocks } isStylePreview={ true } />\n\t);\n}\n"]}
@@ -1,107 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useDispatch, useSelect } from '@wordpress/data';
5
- import { cloneBlock, getBlockType, getBlockFromExample, store as blocksStore } from '@wordpress/blocks';
6
- import { useMemo } from '@wordpress/element';
7
- /**
8
- * Internal dependencies
9
- */
10
-
11
- import { getActiveStyle, getRenderedStyles, replaceActiveStyle } from './utils';
12
- import { store as blockEditorStore } from '../../store';
13
- /**
14
- *
15
- * @param {WPBlock} block Block object.
16
- * @param {WPBlockType} type Block type settings.
17
- * @return {WPBlock} A generic block ready for styles preview.
18
- */
19
-
20
- function useGenericPreviewBlock(block, type) {
21
- return useMemo(() => {
22
- const example = type === null || type === void 0 ? void 0 : type.example;
23
- const blockName = type === null || type === void 0 ? void 0 : type.name;
24
-
25
- if (example && blockName) {
26
- return getBlockFromExample(blockName, {
27
- attributes: example.attributes,
28
- innerBlocks: example.innerBlocks
29
- });
30
- }
31
-
32
- if (block) {
33
- return cloneBlock(block);
34
- }
35
- }, [type !== null && type !== void 0 && type.example ? block === null || block === void 0 ? void 0 : block.name : block, type]);
36
- }
37
- /**
38
- * @typedef useStylesForBlocksArguments
39
- * @property {string} clientId Block client ID.
40
- * @property {() => void} onSwitch Block style switch callback function.
41
- */
42
-
43
- /**
44
- *
45
- * @param {useStylesForBlocksArguments} useStylesForBlocks arguments.
46
- * @return {Object} Results of the select methods.
47
- */
48
-
49
-
50
- export default function useStylesForBlocks(_ref) {
51
- let {
52
- clientId,
53
- onSwitch
54
- } = _ref;
55
-
56
- const selector = select => {
57
- const {
58
- getBlock
59
- } = select(blockEditorStore);
60
- const block = getBlock(clientId);
61
-
62
- if (!block) {
63
- return {};
64
- }
65
-
66
- const blockType = getBlockType(block.name);
67
- const {
68
- getBlockStyles
69
- } = select(blocksStore);
70
- return {
71
- block,
72
- blockType,
73
- styles: getBlockStyles(block.name),
74
- className: block.attributes.className || ''
75
- };
76
- };
77
-
78
- const {
79
- styles,
80
- block,
81
- blockType,
82
- className
83
- } = useSelect(selector, [clientId]);
84
- const {
85
- updateBlockAttributes
86
- } = useDispatch(blockEditorStore);
87
- const stylesToRender = getRenderedStyles(styles);
88
- const activeStyle = getActiveStyle(stylesToRender, className);
89
- const genericPreviewBlock = useGenericPreviewBlock(block, blockType);
90
-
91
- const onSelect = style => {
92
- const styleClassName = replaceActiveStyle(className, activeStyle, style);
93
- updateBlockAttributes(clientId, {
94
- className: styleClassName
95
- });
96
- onSwitch();
97
- };
98
-
99
- return {
100
- onSelect,
101
- stylesToRender,
102
- activeStyle,
103
- genericPreviewBlock,
104
- className
105
- };
106
- }
107
- //# sourceMappingURL=use-styles-for-block.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-styles/use-styles-for-block.js"],"names":["useDispatch","useSelect","cloneBlock","getBlockType","getBlockFromExample","store","blocksStore","useMemo","getActiveStyle","getRenderedStyles","replaceActiveStyle","blockEditorStore","useGenericPreviewBlock","block","type","example","blockName","name","attributes","innerBlocks","useStylesForBlocks","clientId","onSwitch","selector","select","getBlock","blockType","getBlockStyles","styles","className","updateBlockAttributes","stylesToRender","activeStyle","genericPreviewBlock","onSelect","style","styleClassName"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SACCC,UADD,EAECC,YAFD,EAGCC,mBAHD,EAICC,KAAK,IAAIC,WAJV,QAKO,mBALP;AAMA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,EAAyBC,iBAAzB,EAA4CC,kBAA5C,QAAsE,SAAtE;AACA,SAASL,KAAK,IAAIM,gBAAlB,QAA0C,aAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,sBAAT,CAAiCC,KAAjC,EAAwCC,IAAxC,EAA+C;AAC9C,SAAOP,OAAO,CAAE,MAAM;AACrB,UAAMQ,OAAO,GAAGD,IAAH,aAAGA,IAAH,uBAAGA,IAAI,CAAEC,OAAtB;AACA,UAAMC,SAAS,GAAGF,IAAH,aAAGA,IAAH,uBAAGA,IAAI,CAAEG,IAAxB;;AAEA,QAAKF,OAAO,IAAIC,SAAhB,EAA4B;AAC3B,aAAOZ,mBAAmB,CAAEY,SAAF,EAAa;AACtCE,QAAAA,UAAU,EAAEH,OAAO,CAACG,UADkB;AAEtCC,QAAAA,WAAW,EAAEJ,OAAO,CAACI;AAFiB,OAAb,CAA1B;AAIA;;AAED,QAAKN,KAAL,EAAa;AACZ,aAAOX,UAAU,CAAEW,KAAF,CAAjB;AACA;AACD,GAda,EAcX,CAAEC,IAAI,SAAJ,IAAAA,IAAI,WAAJ,IAAAA,IAAI,CAAEC,OAAN,GAAgBF,KAAhB,aAAgBA,KAAhB,uBAAgBA,KAAK,CAAEI,IAAvB,GAA8BJ,KAAhC,EAAuCC,IAAvC,CAdW,CAAd;AAeA;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AACA,eAAe,SAASM,kBAAT,OAAsD;AAAA,MAAzB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAyB;;AACpE,QAAMC,QAAQ,GAAKC,MAAF,IAAc;AAC9B,UAAM;AAAEC,MAAAA;AAAF,QAAeD,MAAM,CAAEb,gBAAF,CAA3B;AACA,UAAME,KAAK,GAAGY,QAAQ,CAAEJ,QAAF,CAAtB;;AAEA,QAAK,CAAER,KAAP,EAAe;AACd,aAAO,EAAP;AACA;;AACD,UAAMa,SAAS,GAAGvB,YAAY,CAAEU,KAAK,CAACI,IAAR,CAA9B;AACA,UAAM;AAAEU,MAAAA;AAAF,QAAqBH,MAAM,CAAElB,WAAF,CAAjC;AAEA,WAAO;AACNO,MAAAA,KADM;AAENa,MAAAA,SAFM;AAGNE,MAAAA,MAAM,EAAED,cAAc,CAAEd,KAAK,CAACI,IAAR,CAHhB;AAINY,MAAAA,SAAS,EAAEhB,KAAK,CAACK,UAAN,CAAiBW,SAAjB,IAA8B;AAJnC,KAAP;AAMA,GAhBD;;AAiBA,QAAM;AAAED,IAAAA,MAAF;AAAUf,IAAAA,KAAV;AAAiBa,IAAAA,SAAjB;AAA4BG,IAAAA;AAA5B,MAA0C5B,SAAS,CAAEsB,QAAF,EAAY,CACpEF,QADoE,CAAZ,CAAzD;AAGA,QAAM;AAAES,IAAAA;AAAF,MAA4B9B,WAAW,CAAEW,gBAAF,CAA7C;AACA,QAAMoB,cAAc,GAAGtB,iBAAiB,CAAEmB,MAAF,CAAxC;AACA,QAAMI,WAAW,GAAGxB,cAAc,CAAEuB,cAAF,EAAkBF,SAAlB,CAAlC;AACA,QAAMI,mBAAmB,GAAGrB,sBAAsB,CAAEC,KAAF,EAASa,SAAT,CAAlD;;AAEA,QAAMQ,QAAQ,GAAKC,KAAF,IAAa;AAC7B,UAAMC,cAAc,GAAG1B,kBAAkB,CACxCmB,SADwC,EAExCG,WAFwC,EAGxCG,KAHwC,CAAzC;AAKAL,IAAAA,qBAAqB,CAAET,QAAF,EAAY;AAChCQ,MAAAA,SAAS,EAAEO;AADqB,KAAZ,CAArB;AAGAd,IAAAA,QAAQ;AACR,GAVD;;AAYA,SAAO;AACNY,IAAAA,QADM;AAENH,IAAAA,cAFM;AAGNC,IAAAA,WAHM;AAINC,IAAAA,mBAJM;AAKNJ,IAAAA;AALM,GAAP;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tcloneBlock,\n\tgetBlockType,\n\tgetBlockFromExample,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getActiveStyle, getRenderedStyles, replaceActiveStyle } from './utils';\nimport { store as blockEditorStore } from '../../store';\n\n/**\n *\n * @param {WPBlock} block Block object.\n * @param {WPBlockType} type Block type settings.\n * @return {WPBlock} A generic block ready for styles preview.\n */\nfunction useGenericPreviewBlock( block, type ) {\n\treturn useMemo( () => {\n\t\tconst example = type?.example;\n\t\tconst blockName = type?.name;\n\n\t\tif ( example && blockName ) {\n\t\t\treturn getBlockFromExample( blockName, {\n\t\t\t\tattributes: example.attributes,\n\t\t\t\tinnerBlocks: example.innerBlocks,\n\t\t\t} );\n\t\t}\n\n\t\tif ( block ) {\n\t\t\treturn cloneBlock( block );\n\t\t}\n\t}, [ type?.example ? block?.name : block, type ] );\n}\n\n/**\n * @typedef useStylesForBlocksArguments\n * @property {string} clientId Block client ID.\n * @property {() => void} onSwitch Block style switch callback function.\n */\n\n/**\n *\n * @param {useStylesForBlocksArguments} useStylesForBlocks arguments.\n * @return {Object} Results of the select methods.\n */\nexport default function useStylesForBlocks( { clientId, onSwitch } ) {\n\tconst selector = ( select ) => {\n\t\tconst { getBlock } = select( blockEditorStore );\n\t\tconst block = getBlock( clientId );\n\n\t\tif ( ! block ) {\n\t\t\treturn {};\n\t\t}\n\t\tconst blockType = getBlockType( block.name );\n\t\tconst { getBlockStyles } = select( blocksStore );\n\n\t\treturn {\n\t\t\tblock,\n\t\t\tblockType,\n\t\t\tstyles: getBlockStyles( block.name ),\n\t\t\tclassName: block.attributes.className || '',\n\t\t};\n\t};\n\tconst { styles, block, blockType, className } = useSelect( selector, [\n\t\tclientId,\n\t] );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst stylesToRender = getRenderedStyles( styles );\n\tconst activeStyle = getActiveStyle( stylesToRender, className );\n\tconst genericPreviewBlock = useGenericPreviewBlock( block, blockType );\n\n\tconst onSelect = ( style ) => {\n\t\tconst styleClassName = replaceActiveStyle(\n\t\t\tclassName,\n\t\t\tactiveStyle,\n\t\t\tstyle\n\t\t);\n\t\tupdateBlockAttributes( clientId, {\n\t\t\tclassName: styleClassName,\n\t\t} );\n\t\tonSwitch();\n\t};\n\n\treturn {\n\t\tonSelect,\n\t\tstylesToRender,\n\t\tactiveStyle,\n\t\tgenericPreviewBlock,\n\t\tclassName,\n\t};\n}\n"]}
@@ -1,25 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { insert } from '@wordpress/rich-text';
5
- export function preventEventDiscovery(value) {
6
- const searchText = 'tales of gutenberg';
7
- const addText = ' 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️';
8
- const {
9
- start,
10
- text
11
- } = value;
12
-
13
- if (start < searchText.length) {
14
- return value;
15
- }
16
-
17
- const charactersBefore = text.slice(start - searchText.length, start);
18
-
19
- if (charactersBefore.toLowerCase() !== searchText) {
20
- return value;
21
- }
22
-
23
- return insert(value, addText);
24
- }
25
- //# sourceMappingURL=prevent-event-discovery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/rich-text/prevent-event-discovery.js"],"names":["insert","preventEventDiscovery","value","searchText","addText","start","text","length","charactersBefore","slice","toLowerCase"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,sBAAvB;AAEA,OAAO,SAASC,qBAAT,CAAgCC,KAAhC,EAAwC;AAC9C,QAAMC,UAAU,GAAG,oBAAnB;AACA,QAAMC,OAAO,GACZ,4FADD;AAEA,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAkBJ,KAAxB;;AAEA,MAAKG,KAAK,GAAGF,UAAU,CAACI,MAAxB,EAAiC;AAChC,WAAOL,KAAP;AACA;;AAED,QAAMM,gBAAgB,GAAGF,IAAI,CAACG,KAAL,CAAYJ,KAAK,GAAGF,UAAU,CAACI,MAA/B,EAAuCF,KAAvC,CAAzB;;AAEA,MAAKG,gBAAgB,CAACE,WAAjB,OAAmCP,UAAxC,EAAqD;AACpD,WAAOD,KAAP;AACA;;AAED,SAAOF,MAAM,CAAEE,KAAF,EAASE,OAAT,CAAb;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { insert } from '@wordpress/rich-text';\n\nexport function preventEventDiscovery( value ) {\n\tconst searchText = 'tales of gutenberg';\n\tconst addText =\n\t\t' 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️';\n\tconst { start, text } = value;\n\n\tif ( start < searchText.length ) {\n\t\treturn value;\n\t}\n\n\tconst charactersBefore = text.slice( start - searchText.length, start );\n\n\tif ( charactersBefore.toLowerCase() !== searchText ) {\n\t\treturn value;\n\t}\n\n\treturn insert( value, addText );\n}\n"]}
@@ -1,34 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useSelect } from '@wordpress/data';
5
- import { hasBlockSupport } from '@wordpress/blocks';
6
- /**
7
- * Internal dependencies
8
- */
9
-
10
- import { useBlockEditContext } from '../block-edit/context';
11
- import { store as blockEditorStore } from '../../store';
12
- export default function useDisplayBlockControls() {
13
- const {
14
- isSelected,
15
- clientId,
16
- name
17
- } = useBlockEditContext();
18
- return useSelect(select => {
19
- const {
20
- getBlockName,
21
- getBlockRootClientId
22
- } = select(blockEditorStore);
23
- const parentId = getBlockRootClientId(clientId);
24
- const parentBlockName = getBlockName(parentId);
25
- const hideControls = hasBlockSupport(parentBlockName, '__experimentalHideChildBlockControls', false);
26
-
27
- if (!hideControls && isSelected) {
28
- return true;
29
- }
30
-
31
- return false;
32
- }, [clientId, isSelected, name]);
33
- }
34
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-display-block-controls/index.native.js"],"names":["useSelect","hasBlockSupport","useBlockEditContext","store","blockEditorStore","useDisplayBlockControls","isSelected","clientId","name","select","getBlockName","getBlockRootClientId","parentId","parentBlockName","hideControls"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA,eAAe,SAASC,uBAAT,GAAmC;AACjD,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,QAAd;AAAwBC,IAAAA;AAAxB,MAAiCN,mBAAmB,EAA1D;AACA,SAAOF,SAAS,CACbS,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,YAAF;AAAgBC,MAAAA;AAAhB,QAAyCF,MAAM,CACpDL,gBADoD,CAArD;AAIA,UAAMQ,QAAQ,GAAGD,oBAAoB,CAAEJ,QAAF,CAArC;AACA,UAAMM,eAAe,GAAGH,YAAY,CAAEE,QAAF,CAApC;AAEA,UAAME,YAAY,GAAGb,eAAe,CACnCY,eADmC,EAEnC,sCAFmC,EAGnC,KAHmC,CAApC;;AAMA,QAAK,CAAEC,YAAF,IAAkBR,UAAvB,EAAoC;AACnC,aAAO,IAAP;AACA;;AAED,WAAO,KAAP;AACA,GApBc,EAqBf,CAAEC,QAAF,EAAYD,UAAZ,EAAwBE,IAAxB,CArBe,CAAhB;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function useDisplayBlockControls() {\n\tconst { isSelected, clientId, name } = useBlockEditContext();\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockName, getBlockRootClientId } = select(\n\t\t\t\tblockEditorStore\n\t\t\t);\n\n\t\t\tconst parentId = getBlockRootClientId( clientId );\n\t\t\tconst parentBlockName = getBlockName( parentId );\n\n\t\t\tconst hideControls = hasBlockSupport(\n\t\t\t\tparentBlockName,\n\t\t\t\t'__experimentalHideChildBlockControls',\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tif ( ! hideControls && isSelected ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t},\n\t\t[ clientId, isSelected, name ]\n\t);\n}\n"]}
@@ -1,49 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { noop } from 'lodash';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
- import { MenuItem, __experimentalText as Text } from '@wordpress/components';
10
- import { check } from '@wordpress/icons';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import useStylesForBlocks from './use-styles-for-block';
16
-
17
- export default function BlockStylesMenuItems( { clientId, onSwitch = noop } ) {
18
- const { onSelect, stylesToRender, activeStyle } = useStylesForBlocks( {
19
- clientId,
20
- onSwitch,
21
- } );
22
-
23
- if ( ! stylesToRender || stylesToRender.length === 0 ) {
24
- return null;
25
- }
26
- return (
27
- <>
28
- { stylesToRender.map( ( style ) => {
29
- const menuItemText = style.label || style.name;
30
- return (
31
- <MenuItem
32
- key={ style.name }
33
- icon={ activeStyle.name === style.name ? check : null }
34
- onClick={ () => onSelect( style ) }
35
- >
36
- <Text
37
- as="span"
38
- limit={ 18 }
39
- ellipsizeMode="tail"
40
- truncate
41
- >
42
- { menuItemText }
43
- </Text>
44
- </MenuItem>
45
- );
46
- } ) }
47
- </>
48
- );
49
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useMemo } from '@wordpress/element';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import InserterPreviewPanel from '../inserter/preview-panel';
10
- import { replaceActiveStyle } from './utils';
11
-
12
- export default function BlockStylesPreviewPanel( {
13
- genericPreviewBlock,
14
- style,
15
- className,
16
- activeStyle,
17
- } ) {
18
- const styleClassName = replaceActiveStyle( className, activeStyle, style );
19
- const previewBlocks = useMemo( () => {
20
- return {
21
- ...genericPreviewBlock,
22
- title: style.label || style.name,
23
- description: style.description,
24
- initialAttributes: {
25
- ...genericPreviewBlock.attributes,
26
- className:
27
- styleClassName +
28
- ' block-editor-block-styles__block-preview-container',
29
- },
30
- };
31
- }, [ genericPreviewBlock, styleClassName ] );
32
-
33
- return (
34
- <InserterPreviewPanel item={ previewBlocks } isStylePreview={ true } />
35
- );
36
- }
@@ -1,99 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useDispatch, useSelect } from '@wordpress/data';
5
- import {
6
- cloneBlock,
7
- getBlockType,
8
- getBlockFromExample,
9
- store as blocksStore,
10
- } from '@wordpress/blocks';
11
- import { useMemo } from '@wordpress/element';
12
-
13
- /**
14
- * Internal dependencies
15
- */
16
- import { getActiveStyle, getRenderedStyles, replaceActiveStyle } from './utils';
17
- import { store as blockEditorStore } from '../../store';
18
-
19
- /**
20
- *
21
- * @param {WPBlock} block Block object.
22
- * @param {WPBlockType} type Block type settings.
23
- * @return {WPBlock} A generic block ready for styles preview.
24
- */
25
- function useGenericPreviewBlock( block, type ) {
26
- return useMemo( () => {
27
- const example = type?.example;
28
- const blockName = type?.name;
29
-
30
- if ( example && blockName ) {
31
- return getBlockFromExample( blockName, {
32
- attributes: example.attributes,
33
- innerBlocks: example.innerBlocks,
34
- } );
35
- }
36
-
37
- if ( block ) {
38
- return cloneBlock( block );
39
- }
40
- }, [ type?.example ? block?.name : block, type ] );
41
- }
42
-
43
- /**
44
- * @typedef useStylesForBlocksArguments
45
- * @property {string} clientId Block client ID.
46
- * @property {() => void} onSwitch Block style switch callback function.
47
- */
48
-
49
- /**
50
- *
51
- * @param {useStylesForBlocksArguments} useStylesForBlocks arguments.
52
- * @return {Object} Results of the select methods.
53
- */
54
- export default function useStylesForBlocks( { clientId, onSwitch } ) {
55
- const selector = ( select ) => {
56
- const { getBlock } = select( blockEditorStore );
57
- const block = getBlock( clientId );
58
-
59
- if ( ! block ) {
60
- return {};
61
- }
62
- const blockType = getBlockType( block.name );
63
- const { getBlockStyles } = select( blocksStore );
64
-
65
- return {
66
- block,
67
- blockType,
68
- styles: getBlockStyles( block.name ),
69
- className: block.attributes.className || '',
70
- };
71
- };
72
- const { styles, block, blockType, className } = useSelect( selector, [
73
- clientId,
74
- ] );
75
- const { updateBlockAttributes } = useDispatch( blockEditorStore );
76
- const stylesToRender = getRenderedStyles( styles );
77
- const activeStyle = getActiveStyle( stylesToRender, className );
78
- const genericPreviewBlock = useGenericPreviewBlock( block, blockType );
79
-
80
- const onSelect = ( style ) => {
81
- const styleClassName = replaceActiveStyle(
82
- className,
83
- activeStyle,
84
- style
85
- );
86
- updateBlockAttributes( clientId, {
87
- className: styleClassName,
88
- } );
89
- onSwitch();
90
- };
91
-
92
- return {
93
- onSelect,
94
- stylesToRender,
95
- activeStyle,
96
- genericPreviewBlock,
97
- className,
98
- };
99
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { insert } from '@wordpress/rich-text';
5
-
6
- export function preventEventDiscovery( value ) {
7
- const searchText = 'tales of gutenberg';
8
- const addText =
9
- ' 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️';
10
- const { start, text } = value;
11
-
12
- if ( start < searchText.length ) {
13
- return value;
14
- }
15
-
16
- const charactersBefore = text.slice( start - searchText.length, start );
17
-
18
- if ( charactersBefore.toLowerCase() !== searchText ) {
19
- return value;
20
- }
21
-
22
- return insert( value, addText );
23
- }
@@ -1,38 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useSelect } from '@wordpress/data';
5
- import { hasBlockSupport } from '@wordpress/blocks';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
- import { useBlockEditContext } from '../block-edit/context';
11
- import { store as blockEditorStore } from '../../store';
12
-
13
- export default function useDisplayBlockControls() {
14
- const { isSelected, clientId, name } = useBlockEditContext();
15
- return useSelect(
16
- ( select ) => {
17
- const { getBlockName, getBlockRootClientId } = select(
18
- blockEditorStore
19
- );
20
-
21
- const parentId = getBlockRootClientId( clientId );
22
- const parentBlockName = getBlockName( parentId );
23
-
24
- const hideControls = hasBlockSupport(
25
- parentBlockName,
26
- '__experimentalHideChildBlockControls',
27
- false
28
- );
29
-
30
- if ( ! hideControls && isSelected ) {
31
- return true;
32
- }
33
-
34
- return false;
35
- },
36
- [ clientId, isSelected, name ]
37
- );
38
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { toggleRichText } from '../use-multi-selection';
5
-
6
- describe( 'toggleRichText', () => {
7
- function getContainer( isContentEditible ) {
8
- const container = document.createDocumentFragment();
9
- [
10
- 'rich-text',
11
- 'rich-text editor-post-title__input',
12
- 'some-other-class',
13
- ].forEach( ( className ) => {
14
- const element = document.createElement( 'div' );
15
- element.setAttribute( 'class', className );
16
- if ( isContentEditible ) {
17
- element.setAttribute( 'contenteditable', true );
18
- }
19
- container.appendChild( element );
20
- } );
21
- return container;
22
- }
23
-
24
- it( 'should set the `contenteditable` attribute on eligible rich text nodes', () => {
25
- const container = getContainer();
26
- toggleRichText( container, true );
27
- let nodes = container.querySelectorAll( '[contenteditable=true]' );
28
-
29
- expect( nodes ).toHaveLength( 1 );
30
- expect( nodes[ 0 ].className ).toBe( 'rich-text' );
31
-
32
- toggleRichText( container, false );
33
- nodes = container.querySelectorAll( '[contenteditable=true]' );
34
- expect( nodes ).toHaveLength( 0 );
35
- } );
36
- } );