@wordpress/edit-site 5.9.0 → 5.10.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 (426) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-template/add-custom-template-modal.js +21 -6
  3. package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
  4. package/build/components/add-new-template/new-template-part.js +8 -2
  5. package/build/components/add-new-template/new-template-part.js.map +1 -1
  6. package/build/components/add-new-template/new-template.js +6 -3
  7. package/build/components/add-new-template/new-template.js.map +1 -1
  8. package/build/components/app/index.js +8 -2
  9. package/build/components/app/index.js.map +1 -1
  10. package/build/components/block-editor/back-button.js +10 -3
  11. package/build/components/block-editor/back-button.js.map +1 -1
  12. package/build/components/block-editor/editor-canvas.js +39 -6
  13. package/build/components/block-editor/editor-canvas.js.map +1 -1
  14. package/build/components/editor/index.js +43 -9
  15. package/build/components/editor/index.js.map +1 -1
  16. package/build/components/editor-canvas-container/index.js +18 -4
  17. package/build/components/editor-canvas-container/index.js.map +1 -1
  18. package/build/components/global-styles/block-preview-panel.js +1 -1
  19. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  20. package/build/components/global-styles/border-panel.js +3 -1
  21. package/build/components/global-styles/border-panel.js.map +1 -1
  22. package/build/components/global-styles/color-palette-panel.js +14 -3
  23. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  24. package/build/components/global-styles/dimensions-panel.js +17 -18
  25. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  26. package/build/components/global-styles/gradients-palette-panel.js +14 -3
  27. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  28. package/build/components/global-styles/root-menu.js +61 -0
  29. package/build/components/global-styles/root-menu.js.map +1 -0
  30. package/build/components/global-styles/screen-block-list.js +3 -1
  31. package/build/components/global-styles/screen-block-list.js.map +1 -1
  32. package/build/components/global-styles/screen-block.js +158 -7
  33. package/build/components/global-styles/screen-block.js.map +1 -1
  34. package/build/components/global-styles/screen-colors.js +9 -26
  35. package/build/components/global-styles/screen-colors.js.map +1 -1
  36. package/build/components/global-styles/screen-css.js +20 -15
  37. package/build/components/global-styles/screen-css.js.map +1 -1
  38. package/build/components/global-styles/screen-layout.js +4 -17
  39. package/build/components/global-styles/screen-layout.js.map +1 -1
  40. package/build/components/global-styles/screen-revisions/index.js +148 -0
  41. package/build/components/global-styles/screen-revisions/index.js.map +1 -0
  42. package/build/components/global-styles/screen-revisions/revisions-buttons.js +132 -0
  43. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
  44. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +130 -0
  45. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
  46. package/build/components/global-styles/screen-root.js +2 -2
  47. package/build/components/global-styles/screen-root.js.map +1 -1
  48. package/build/components/global-styles/screen-typography-element.js +0 -3
  49. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  50. package/build/components/global-styles/screen-typography.js +11 -39
  51. package/build/components/global-styles/screen-typography.js.map +1 -1
  52. package/build/components/global-styles/style-variations-container.js +3 -8
  53. package/build/components/global-styles/style-variations-container.js.map +1 -1
  54. package/build/components/global-styles/typography-panel.js +7 -11
  55. package/build/components/global-styles/typography-panel.js.map +1 -1
  56. package/build/components/global-styles/ui.js +61 -108
  57. package/build/components/global-styles/ui.js.map +1 -1
  58. package/build/components/global-styles/variations-panel.js +4 -28
  59. package/build/components/global-styles/variations-panel.js.map +1 -1
  60. package/build/components/header-edit-mode/index.js +1 -1
  61. package/build/components/header-edit-mode/index.js.map +1 -1
  62. package/build/components/keyboard-shortcuts/register.js +1 -1
  63. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  64. package/build/components/layout/index.js +13 -7
  65. package/build/components/layout/index.js.map +1 -1
  66. package/build/components/list/index.js +9 -3
  67. package/build/components/list/index.js.map +1 -1
  68. package/build/components/list/table.js +1 -1
  69. package/build/components/list/table.js.map +1 -1
  70. package/build/components/plugin-template-setting-panel/index.js +44 -0
  71. package/build/components/plugin-template-setting-panel/index.js.map +1 -0
  72. package/build/components/revisions/index.js +95 -0
  73. package/build/components/revisions/index.js.map +1 -0
  74. package/build/components/routes/link.js +17 -2
  75. package/build/components/routes/link.js.map +1 -1
  76. package/build/components/routes/use-title.js +8 -2
  77. package/build/components/routes/use-title.js.map +1 -1
  78. package/build/components/save-button/index.js +31 -6
  79. package/build/components/save-button/index.js.map +1 -1
  80. package/build/components/save-hub/index.js +14 -31
  81. package/build/components/save-hub/index.js.map +1 -1
  82. package/build/components/save-panel/index.js +20 -7
  83. package/build/components/save-panel/index.js.map +1 -1
  84. package/build/components/secondary-sidebar/list-view-sidebar.js +2 -7
  85. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  86. package/build/components/sidebar/index.js +16 -2
  87. package/build/components/sidebar/index.js.map +1 -1
  88. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
  89. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  90. package/build/components/sidebar-edit-mode/index.js +9 -2
  91. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  92. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +40 -0
  93. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
  94. package/build/components/sidebar-edit-mode/template-card/index.js +1 -8
  95. package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  96. package/build/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -1
  97. package/build/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
  98. package/build/components/sidebar-navigation-item/index.js +5 -7
  99. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  100. package/build/components/sidebar-navigation-screen/index.js +14 -4
  101. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  102. package/build/components/sidebar-navigation-screen-main/index.js +24 -7
  103. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  104. package/build/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  105. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  106. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +17 -5
  107. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  108. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
  109. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  110. package/build/components/sidebar-navigation-screen-page/index.js +67 -0
  111. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -0
  112. package/build/components/sidebar-navigation-screen-pages/index.js +74 -0
  113. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -0
  114. package/build/components/sidebar-navigation-screen-templates/index.js +5 -3
  115. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  116. package/build/components/sidebar-navigation-subtitle/index.js +18 -0
  117. package/build/components/sidebar-navigation-subtitle/index.js.map +1 -0
  118. package/build/components/site-hub/index.js +36 -6
  119. package/build/components/site-hub/index.js.map +1 -1
  120. package/build/components/start-template-options/index.js +12 -16
  121. package/build/components/start-template-options/index.js.map +1 -1
  122. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
  123. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  124. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +9 -4
  125. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  126. package/build/components/sync-state-with-url/use-sync-path-with-url.js +17 -3
  127. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  128. package/build/components/template-details/template-areas.js +9 -3
  129. package/build/components/template-details/template-areas.js.map +1 -1
  130. package/build/hooks/template-part-edit.js +8 -2
  131. package/build/hooks/template-part-edit.js.map +1 -1
  132. package/build/index.js +8 -0
  133. package/build/index.js.map +1 -1
  134. package/build/utils/is-previewing-theme.js +27 -0
  135. package/build/utils/is-previewing-theme.js.map +1 -0
  136. package/build/utils/use-activate-theme.js +46 -0
  137. package/build/utils/use-activate-theme.js.map +1 -0
  138. package/build-module/components/add-new-template/add-custom-template-modal.js +21 -6
  139. package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
  140. package/build-module/components/add-new-template/new-template-part.js +5 -1
  141. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  142. package/build-module/components/add-new-template/new-template.js +4 -1
  143. package/build-module/components/add-new-template/new-template.js.map +1 -1
  144. package/build-module/components/app/index.js +6 -2
  145. package/build-module/components/app/index.js.map +1 -1
  146. package/build-module/components/block-editor/back-button.js +6 -1
  147. package/build-module/components/block-editor/back-button.js.map +1 -1
  148. package/build-module/components/block-editor/editor-canvas.js +37 -6
  149. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  150. package/build-module/components/editor/index.js +45 -11
  151. package/build-module/components/editor/index.js.map +1 -1
  152. package/build-module/components/editor-canvas-container/index.js +21 -6
  153. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  154. package/build-module/components/global-styles/block-preview-panel.js +1 -1
  155. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  156. package/build-module/components/global-styles/border-panel.js +3 -1
  157. package/build-module/components/global-styles/border-panel.js.map +1 -1
  158. package/build-module/components/global-styles/color-palette-panel.js +13 -3
  159. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  160. package/build-module/components/global-styles/dimensions-panel.js +17 -18
  161. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  162. package/build-module/components/global-styles/gradients-palette-panel.js +13 -3
  163. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  164. package/build-module/components/global-styles/root-menu.js +47 -0
  165. package/build-module/components/global-styles/root-menu.js.map +1 -0
  166. package/build-module/components/global-styles/screen-block-list.js +4 -2
  167. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  168. package/build-module/components/global-styles/screen-block.js +151 -7
  169. package/build-module/components/global-styles/screen-block.js.map +1 -1
  170. package/build-module/components/global-styles/screen-colors.js +9 -25
  171. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  172. package/build-module/components/global-styles/screen-css.js +20 -15
  173. package/build-module/components/global-styles/screen-css.js.map +1 -1
  174. package/build-module/components/global-styles/screen-layout.js +4 -16
  175. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  176. package/build-module/components/global-styles/screen-revisions/index.js +128 -0
  177. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -0
  178. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +121 -0
  179. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
  180. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +116 -0
  181. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
  182. package/build-module/components/global-styles/screen-root.js +2 -2
  183. package/build-module/components/global-styles/screen-root.js.map +1 -1
  184. package/build-module/components/global-styles/screen-typography-element.js +0 -3
  185. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  186. package/build-module/components/global-styles/screen-typography.js +11 -37
  187. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  188. package/build-module/components/global-styles/style-variations-container.js +3 -7
  189. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  190. package/build-module/components/global-styles/typography-panel.js +7 -11
  191. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  192. package/build-module/components/global-styles/ui.js +61 -105
  193. package/build-module/components/global-styles/ui.js.map +1 -1
  194. package/build-module/components/global-styles/variations-panel.js +3 -22
  195. package/build-module/components/global-styles/variations-panel.js.map +1 -1
  196. package/build-module/components/header-edit-mode/index.js +2 -2
  197. package/build-module/components/header-edit-mode/index.js.map +1 -1
  198. package/build-module/components/keyboard-shortcuts/register.js +1 -1
  199. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  200. package/build-module/components/layout/index.js +9 -3
  201. package/build-module/components/layout/index.js.map +1 -1
  202. package/build-module/components/list/index.js +5 -1
  203. package/build-module/components/list/index.js.map +1 -1
  204. package/build-module/components/list/table.js +1 -1
  205. package/build-module/components/list/table.js.map +1 -1
  206. package/build-module/components/plugin-template-setting-panel/index.js +35 -0
  207. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -0
  208. package/build-module/components/revisions/index.js +77 -0
  209. package/build-module/components/revisions/index.js.map +1 -0
  210. package/build-module/components/routes/link.js +13 -1
  211. package/build-module/components/routes/link.js.map +1 -1
  212. package/build-module/components/routes/use-title.js +5 -1
  213. package/build-module/components/routes/use-title.js.map +1 -1
  214. package/build-module/components/save-button/index.js +28 -6
  215. package/build-module/components/save-button/index.js.map +1 -1
  216. package/build-module/components/save-hub/index.js +13 -32
  217. package/build-module/components/save-hub/index.js.map +1 -1
  218. package/build-module/components/save-panel/index.js +19 -7
  219. package/build-module/components/save-panel/index.js.map +1 -1
  220. package/build-module/components/secondary-sidebar/list-view-sidebar.js +3 -8
  221. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  222. package/build-module/components/sidebar/index.js +11 -1
  223. package/build-module/components/sidebar/index.js.map +1 -1
  224. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
  225. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  226. package/build-module/components/sidebar-edit-mode/index.js +10 -5
  227. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  228. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +29 -0
  229. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
  230. package/build-module/components/sidebar-edit-mode/template-card/index.js +2 -7
  231. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  232. package/build-module/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -1
  233. package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
  234. package/build-module/components/sidebar-navigation-item/index.js +6 -8
  235. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  236. package/build-module/components/sidebar-navigation-screen/index.js +13 -5
  237. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  238. package/build-module/components/sidebar-navigation-screen-main/index.js +25 -8
  239. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  240. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  241. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  242. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +13 -3
  243. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  244. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
  245. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  246. package/build-module/components/sidebar-navigation-screen-page/index.js +48 -0
  247. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -0
  248. package/build-module/components/sidebar-navigation-screen-pages/index.js +57 -0
  249. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -0
  250. package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -3
  251. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  252. package/build-module/components/sidebar-navigation-subtitle/index.js +10 -0
  253. package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -0
  254. package/build-module/components/site-hub/index.js +34 -6
  255. package/build-module/components/site-hub/index.js.map +1 -1
  256. package/build-module/components/start-template-options/index.js +13 -17
  257. package/build-module/components/start-template-options/index.js.map +1 -1
  258. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -1
  259. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  260. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -1
  261. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  262. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +13 -1
  263. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  264. package/build-module/components/template-details/template-areas.js +5 -1
  265. package/build-module/components/template-details/template-areas.js.map +1 -1
  266. package/build-module/hooks/template-part-edit.js +5 -1
  267. package/build-module/hooks/template-part-edit.js.map +1 -1
  268. package/build-module/index.js +1 -0
  269. package/build-module/index.js.map +1 -1
  270. package/build-module/utils/is-previewing-theme.js +17 -0
  271. package/build-module/utils/is-previewing-theme.js.map +1 -0
  272. package/build-module/utils/use-activate-theme.js +36 -0
  273. package/build-module/utils/use-activate-theme.js.map +1 -0
  274. package/build-style/style-rtl.css +199 -78
  275. package/build-style/style.css +199 -78
  276. package/package.json +36 -34
  277. package/src/components/add-new-template/add-custom-template-modal.js +31 -8
  278. package/src/components/add-new-template/new-template-part.js +4 -1
  279. package/src/components/add-new-template/new-template.js +3 -1
  280. package/src/components/add-new-template/style.scss +52 -48
  281. package/src/components/app/index.js +6 -3
  282. package/src/components/block-editor/back-button.js +4 -1
  283. package/src/components/block-editor/editor-canvas.js +36 -8
  284. package/src/components/block-editor/style.scss +15 -8
  285. package/src/components/editor/index.js +48 -7
  286. package/src/components/editor-canvas-container/index.js +30 -17
  287. package/src/components/global-styles/block-preview-panel.js +1 -1
  288. package/src/components/global-styles/border-panel.js +3 -1
  289. package/src/components/global-styles/color-palette-panel.js +9 -0
  290. package/src/components/global-styles/dimensions-panel.js +15 -15
  291. package/src/components/global-styles/gradients-palette-panel.js +8 -0
  292. package/src/components/global-styles/root-menu.js +66 -0
  293. package/src/components/global-styles/screen-block-list.js +2 -2
  294. package/src/components/global-styles/screen-block.js +184 -7
  295. package/src/components/global-styles/screen-colors.js +9 -16
  296. package/src/components/global-styles/screen-css.js +21 -21
  297. package/src/components/global-styles/screen-layout.js +5 -9
  298. package/src/components/global-styles/screen-revisions/index.js +177 -0
  299. package/src/components/global-styles/screen-revisions/revisions-buttons.js +131 -0
  300. package/src/components/global-styles/screen-revisions/style.scss +99 -0
  301. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +125 -0
  302. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +103 -0
  303. package/src/components/global-styles/screen-root.js +2 -2
  304. package/src/components/global-styles/screen-typography-element.js +1 -3
  305. package/src/components/global-styles/screen-typography.js +44 -79
  306. package/src/components/global-styles/style-variations-container.js +4 -10
  307. package/src/components/global-styles/style.scss +1 -23
  308. package/src/components/global-styles/typography-panel.js +12 -13
  309. package/src/components/global-styles/ui.js +72 -101
  310. package/src/components/global-styles/variations-panel.js +3 -26
  311. package/src/components/header-edit-mode/index.js +5 -2
  312. package/src/components/keyboard-shortcuts/register.js +1 -1
  313. package/src/components/layout/index.js +7 -3
  314. package/src/components/layout/style.scss +2 -4
  315. package/src/components/list/index.js +4 -1
  316. package/src/components/list/style.scss +4 -0
  317. package/src/components/list/table.js +3 -1
  318. package/src/components/plugin-template-setting-panel/index.js +33 -0
  319. package/src/components/revisions/index.js +104 -0
  320. package/src/components/routes/link.js +16 -1
  321. package/src/components/routes/use-title.js +4 -1
  322. package/src/components/save-button/index.js +27 -6
  323. package/src/components/save-hub/index.js +17 -35
  324. package/src/components/save-panel/index.js +15 -3
  325. package/src/components/secondary-sidebar/list-view-sidebar.js +2 -6
  326. package/src/components/sidebar/index.js +12 -1
  327. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +9 -7
  328. package/src/components/sidebar-edit-mode/index.js +17 -6
  329. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +26 -0
  330. package/src/components/sidebar-edit-mode/style.scss +10 -0
  331. package/src/components/sidebar-edit-mode/template-card/index.js +1 -9
  332. package/src/components/sidebar-navigation-item/index.js +13 -14
  333. package/src/components/sidebar-navigation-item/style.scss +8 -1
  334. package/src/components/sidebar-navigation-screen/index.js +26 -5
  335. package/src/components/sidebar-navigation-screen-main/index.js +43 -22
  336. package/src/components/sidebar-navigation-screen-navigation-item/index.js +3 -9
  337. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +13 -1
  338. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
  339. package/src/components/sidebar-navigation-screen-page/index.js +59 -0
  340. package/src/components/sidebar-navigation-screen-pages/index.js +82 -0
  341. package/src/components/sidebar-navigation-screen-pages/style.scss +4 -0
  342. package/src/components/sidebar-navigation-screen-templates/index.js +5 -1
  343. package/src/components/sidebar-navigation-subtitle/index.js +5 -0
  344. package/src/components/sidebar-navigation-subtitle/style.scss +7 -0
  345. package/src/components/site-hub/index.js +89 -58
  346. package/src/components/site-hub/style.scss +8 -0
  347. package/src/components/start-template-options/index.js +19 -27
  348. package/src/components/start-template-options/style.scss +29 -21
  349. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
  350. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -1
  351. package/src/components/sync-state-with-url/use-sync-path-with-url.js +14 -1
  352. package/src/components/template-details/template-areas.js +4 -1
  353. package/src/hooks/template-part-edit.js +4 -1
  354. package/src/index.js +1 -0
  355. package/src/store/test/actions.js +6 -14
  356. package/src/style.scss +4 -1
  357. package/src/utils/is-previewing-theme.js +18 -0
  358. package/src/utils/use-activate-theme.js +38 -0
  359. package/build/components/global-styles/context-menu.js +0 -126
  360. package/build/components/global-styles/context-menu.js.map +0 -1
  361. package/build/components/global-styles/custom-css.js +0 -113
  362. package/build/components/global-styles/custom-css.js.map +0 -1
  363. package/build/components/global-styles/effects-panel.js +0 -53
  364. package/build/components/global-styles/effects-panel.js.map +0 -1
  365. package/build/components/global-styles/filters-panel.js +0 -50
  366. package/build/components/global-styles/filters-panel.js.map +0 -1
  367. package/build/components/global-styles/screen-border.js +0 -61
  368. package/build/components/global-styles/screen-border.js.map +0 -1
  369. package/build/components/global-styles/screen-effects.js +0 -61
  370. package/build/components/global-styles/screen-effects.js.map +0 -1
  371. package/build/components/global-styles/screen-filters.js +0 -46
  372. package/build/components/global-styles/screen-filters.js.map +0 -1
  373. package/build/components/global-styles/screen-variations.js +0 -71
  374. package/build/components/global-styles/screen-variations.js.map +0 -1
  375. package/build/components/routes/index.js +0 -60
  376. package/build/components/routes/index.js.map +0 -1
  377. package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
  378. package/build/hooks/commands/index.js +0 -19
  379. package/build/hooks/commands/index.js.map +0 -1
  380. package/build/hooks/commands/use-navigation-commands.js +0 -126
  381. package/build/hooks/commands/use-navigation-commands.js.map +0 -1
  382. package/build/hooks/commands/use-wp-admin-commands.js +0 -97
  383. package/build/hooks/commands/use-wp-admin-commands.js.map +0 -1
  384. package/build/utils/history.js +0 -41
  385. package/build/utils/history.js.map +0 -1
  386. package/build-module/components/global-styles/context-menu.js +0 -107
  387. package/build-module/components/global-styles/context-menu.js.map +0 -1
  388. package/build-module/components/global-styles/custom-css.js +0 -98
  389. package/build-module/components/global-styles/custom-css.js.map +0 -1
  390. package/build-module/components/global-styles/effects-panel.js +0 -43
  391. package/build-module/components/global-styles/effects-panel.js.map +0 -1
  392. package/build-module/components/global-styles/filters-panel.js +0 -40
  393. package/build-module/components/global-styles/filters-panel.js.map +0 -1
  394. package/build-module/components/global-styles/screen-border.js +0 -44
  395. package/build-module/components/global-styles/screen-border.js.map +0 -1
  396. package/build-module/components/global-styles/screen-effects.js +0 -44
  397. package/build-module/components/global-styles/screen-effects.js.map +0 -1
  398. package/build-module/components/global-styles/screen-filters.js +0 -33
  399. package/build-module/components/global-styles/screen-filters.js.map +0 -1
  400. package/build-module/components/global-styles/screen-variations.js +0 -54
  401. package/build-module/components/global-styles/screen-variations.js.map +0 -1
  402. package/build-module/components/routes/index.js +0 -47
  403. package/build-module/components/routes/index.js.map +0 -1
  404. package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
  405. package/build-module/hooks/commands/index.js +0 -10
  406. package/build-module/hooks/commands/index.js.map +0 -1
  407. package/build-module/hooks/commands/use-navigation-commands.js +0 -109
  408. package/build-module/hooks/commands/use-navigation-commands.js.map +0 -1
  409. package/build-module/hooks/commands/use-wp-admin-commands.js +0 -81
  410. package/build-module/hooks/commands/use-wp-admin-commands.js.map +0 -1
  411. package/build-module/utils/history.js +0 -31
  412. package/build-module/utils/history.js.map +0 -1
  413. package/src/components/global-styles/context-menu.js +0 -175
  414. package/src/components/global-styles/custom-css.js +0 -131
  415. package/src/components/global-styles/effects-panel.js +0 -40
  416. package/src/components/global-styles/filters-panel.js +0 -39
  417. package/src/components/global-styles/screen-border.js +0 -35
  418. package/src/components/global-styles/screen-effects.js +0 -35
  419. package/src/components/global-styles/screen-filters.js +0 -27
  420. package/src/components/global-styles/screen-variations.js +0 -46
  421. package/src/components/routes/index.js +0 -53
  422. package/src/hooks/commands/index.js +0 -10
  423. package/src/hooks/commands/use-navigation-commands.js +0 -112
  424. package/src/hooks/commands/use-wp-admin-commands.js +0 -79
  425. package/src/utils/history.js +0 -39
  426. /package/src/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +0 -0
@@ -1,97 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useWPAdminCommands = useWPAdminCommands;
7
-
8
- var _commands = require("@wordpress/commands");
9
-
10
- var _i18n = require("@wordpress/i18n");
11
-
12
- var _data = require("@wordpress/data");
13
-
14
- var _url = require("@wordpress/url");
15
-
16
- var _element = require("@wordpress/element");
17
-
18
- var _icons = require("@wordpress/icons");
19
-
20
- var _store = require("../../store");
21
-
22
- var _privateApis = require("../../private-apis");
23
-
24
- /**
25
- * WordPress dependencies
26
- */
27
-
28
- /**
29
- * Internal dependencies
30
- */
31
- const {
32
- useCommandLoader
33
- } = (0, _privateApis.unlock)(_commands.privateApis);
34
-
35
- const getWPAdminAddCommandLoader = postType => function useAddCommandLoader(_ref) {
36
- let {
37
- search
38
- } = _ref;
39
- let label;
40
-
41
- if (postType === 'post') {
42
- label = (0, _i18n.__)('Add a new post');
43
- } else if (postType === 'page') {
44
- label = (0, _i18n.__)('Add a new page');
45
- } else {
46
- throw 'unsupported post type ' + postType;
47
- }
48
-
49
- const hasRecordTitle = !!search && !label.toLowerCase().includes(search.toLowerCase());
50
-
51
- if (postType === 'post' && hasRecordTitle) {
52
- /* translators: %s: Post title placeholder */
53
- label = (0, _i18n.sprintf)((0, _i18n.__)('Add a new post "%s"'), search);
54
- } else if (postType === 'page' && hasRecordTitle) {
55
- /* translators: %s: Page title placeholder */
56
- label = (0, _i18n.sprintf)((0, _i18n.__)('Add a new page "%s"'), search);
57
- }
58
-
59
- const newPostLink = (0, _data.useSelect)(select => {
60
- var _getSettings$newPostL;
61
-
62
- const {
63
- getSettings
64
- } = (0, _privateApis.unlock)(select(_store.store));
65
- return (_getSettings$newPostL = getSettings().newPostLink) !== null && _getSettings$newPostL !== void 0 ? _getSettings$newPostL : 'post-new.php';
66
- }, []);
67
- const commands = (0, _element.useMemo)(() => [{
68
- name: 'core/wp-admin/add-' + postType + '-' + search,
69
- label,
70
- icon: _icons.plus,
71
- callback: () => {
72
- document.location.href = (0, _url.addQueryArgs)(newPostLink, {
73
- post_type: postType,
74
- post_title: hasRecordTitle ? search : undefined
75
- });
76
- }
77
- }], [newPostLink, hasRecordTitle, search, label]);
78
- return {
79
- isLoading: false,
80
- commands
81
- };
82
- };
83
-
84
- const useAddPostLoader = getWPAdminAddCommandLoader('post');
85
- const useAddPageLoader = getWPAdminAddCommandLoader('page');
86
-
87
- function useWPAdminCommands() {
88
- useCommandLoader({
89
- name: 'core/wp-admin/add-post-loader',
90
- hook: useAddPostLoader
91
- });
92
- useCommandLoader({
93
- name: 'core/wp-admin/add-page-loader',
94
- hook: useAddPageLoader
95
- });
96
- }
97
- //# sourceMappingURL=use-wp-admin-commands.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-wp-admin-commands.js"],"names":["useCommandLoader","privateApis","getWPAdminAddCommandLoader","postType","useAddCommandLoader","search","label","hasRecordTitle","toLowerCase","includes","newPostLink","select","getSettings","editSiteStore","commands","name","icon","plus","callback","document","location","href","post_type","post_title","undefined","isLoading","useAddPostLoader","useAddPageLoader","useWPAdminCommands","hook"],"mappings":";;;;;;;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kC,GAAlC,GAAwCE,MAD/C;AAECC,IAAAA,KAFD;AAGCU,IAAAA,IAAI,EAAEC,WAHP;AAICC,IAAAA,QAAQ,EAAE,MAAM;AACfC,MAAAA,QAAQ,CAACC,QAAT,CAAkBC,IAAlB,GAAyB,uBAAcX,WAAd,EAA2B;AACnDY,QAAAA,SAAS,EAAEnB,QADwC;AAEnDoB,QAAAA,UAAU,EAAEhB,cAAc,GAAGF,MAAH,GAAYmB;AAFa,OAA3B,CAAzB;AAIA;AATF,GADK,CADU,EAchB,CAAEd,WAAF,EAAeH,cAAf,EAA+BF,MAA/B,EAAuCC,KAAvC,CAdgB,CAAjB;AAiBA,SAAO;AACNmB,IAAAA,SAAS,EAAE,KADL;AAENX,IAAAA;AAFM,GAAP;AAIA,CA9CF;;AAgDA,MAAMY,gBAAgB,GAAGxB,0BAA0B,CAAE,MAAF,CAAnD;AACA,MAAMyB,gBAAgB,GAAGzB,0BAA0B,CAAE,MAAF,CAAnD;;AAEO,SAAS0B,kBAAT,GAA8B;AACpC5B,EAAAA,gBAAgB,CAAE;AACjBe,IAAAA,IAAI,EAAE,+BADW;AAEjBc,IAAAA,IAAI,EAAEH;AAFW,GAAF,CAAhB;AAIA1B,EAAAA,gBAAgB,CAAE;AACjBe,IAAAA,IAAI,EAAE,+BADW;AAEjBc,IAAAA,IAAI,EAAEF;AAFW,GAAF,CAAhB;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis } from '@wordpress/commands';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useMemo } from '@wordpress/element';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nconst { useCommandLoader } = unlock( privateApis );\n\nconst getWPAdminAddCommandLoader = ( postType ) =>\n\tfunction useAddCommandLoader( { search } ) {\n\t\tlet label;\n\t\tif ( postType === 'post' ) {\n\t\t\tlabel = __( 'Add a new post' );\n\t\t} else if ( postType === 'page' ) {\n\t\t\tlabel = __( 'Add a new page' );\n\t\t} else {\n\t\t\tthrow 'unsupported post type ' + postType;\n\t\t}\n\t\tconst hasRecordTitle =\n\t\t\t!! search && ! label.toLowerCase().includes( search.toLowerCase() );\n\t\tif ( postType === 'post' && hasRecordTitle ) {\n\t\t\t/* translators: %s: Post title placeholder */\n\t\t\tlabel = sprintf( __( 'Add a new post \"%s\"' ), search );\n\t\t} else if ( postType === 'page' && hasRecordTitle ) {\n\t\t\t/* translators: %s: Page title placeholder */\n\t\t\tlabel = sprintf( __( 'Add a new page \"%s\"' ), search );\n\t\t}\n\n\t\tconst newPostLink = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\treturn getSettings().newPostLink ?? 'post-new.php';\n\t\t}, [] );\n\n\t\tconst commands = useMemo(\n\t\t\t() => [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/wp-admin/add-' + postType + '-' + search,\n\t\t\t\t\tlabel,\n\t\t\t\t\ticon: plus,\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( newPostLink, {\n\t\t\t\t\t\t\tpost_type: postType,\n\t\t\t\t\t\t\tpost_title: hasRecordTitle ? search : undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t[ newPostLink, hasRecordTitle, search, label ]\n\t\t);\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst useAddPostLoader = getWPAdminAddCommandLoader( 'post' );\nconst useAddPageLoader = getWPAdminAddCommandLoader( 'page' );\n\nexport function useWPAdminCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/wp-admin/add-post-loader',\n\t\thook: useAddPostLoader,\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/wp-admin/add-page-loader',\n\t\thook: useAddPageLoader,\n\t} );\n}\n"]}
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _history = require("history");
9
-
10
- var _url = require("@wordpress/url");
11
-
12
- /**
13
- * External dependencies
14
- */
15
-
16
- /**
17
- * WordPress dependencies
18
- */
19
- const history = (0, _history.createBrowserHistory)();
20
- const originalHistoryPush = history.push;
21
- const originalHistoryReplace = history.replace;
22
-
23
- function push(params, state) {
24
- const currentArgs = (0, _url.getQueryArgs)(window.location.href);
25
- const currentUrlWithoutArgs = (0, _url.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
26
- const newUrl = (0, _url.addQueryArgs)(currentUrlWithoutArgs, params);
27
- return originalHistoryPush.call(history, newUrl, state);
28
- }
29
-
30
- function replace(params, state) {
31
- const currentArgs = (0, _url.getQueryArgs)(window.location.href);
32
- const currentUrlWithoutArgs = (0, _url.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
33
- const newUrl = (0, _url.addQueryArgs)(currentUrlWithoutArgs, params);
34
- return originalHistoryReplace.call(history, newUrl, state);
35
- }
36
-
37
- history.push = push;
38
- history.replace = replace;
39
- var _default = history;
40
- exports.default = _default;
41
- //# sourceMappingURL=history.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/utils/history.js"],"names":["history","originalHistoryPush","push","originalHistoryReplace","replace","params","state","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","newUrl","call"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,OAAO,GAAG,oCAAhB;AAEA,MAAMC,mBAAmB,GAAGD,OAAO,CAACE,IAApC;AACA,MAAMC,sBAAsB,GAAGH,OAAO,CAACI,OAAvC;;AAEA,SAASF,IAAT,CAAeG,MAAf,EAAuBC,KAAvB,EAA+B;AAC9B,QAAMC,WAAW,GAAG,uBAAcC,MAAM,CAACC,QAAP,CAAgBC,IAA9B,CAApB;AACA,QAAMC,qBAAqB,GAAG,0BAC7BH,MAAM,CAACC,QAAP,CAAgBC,IADa,EAE7B,GAAGE,MAAM,CAACC,IAAP,CAAaN,WAAb,CAF0B,CAA9B;AAIA,QAAMO,MAAM,GAAG,uBAAcH,qBAAd,EAAqCN,MAArC,CAAf;AACA,SAAOJ,mBAAmB,CAACc,IAApB,CAA0Bf,OAA1B,EAAmCc,MAAnC,EAA2CR,KAA3C,CAAP;AACA;;AAED,SAASF,OAAT,CAAkBC,MAAlB,EAA0BC,KAA1B,EAAkC;AACjC,QAAMC,WAAW,GAAG,uBAAcC,MAAM,CAACC,QAAP,CAAgBC,IAA9B,CAApB;AACA,QAAMC,qBAAqB,GAAG,0BAC7BH,MAAM,CAACC,QAAP,CAAgBC,IADa,EAE7B,GAAGE,MAAM,CAACC,IAAP,CAAaN,WAAb,CAF0B,CAA9B;AAIA,QAAMO,MAAM,GAAG,uBAAcH,qBAAd,EAAqCN,MAArC,CAAf;AACA,SAAOF,sBAAsB,CAACY,IAAvB,CAA6Bf,OAA7B,EAAsCc,MAAtC,EAA8CR,KAA9C,CAAP;AACA;;AAEDN,OAAO,CAACE,IAAR,GAAeA,IAAf;AACAF,OAAO,CAACI,OAAR,GAAkBA,OAAlB;eAEeJ,O","sourcesContent":["/**\n * External dependencies\n */\nimport { createBrowserHistory } from 'history';\n\n/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\n\nconst history = createBrowserHistory();\n\nconst originalHistoryPush = history.push;\nconst originalHistoryReplace = history.replace;\n\nfunction push( params, state ) {\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\treturn originalHistoryPush.call( history, newUrl, state );\n}\n\nfunction replace( params, state ) {\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\treturn originalHistoryReplace.call( history, newUrl, state );\n}\n\nhistory.push = push;\nhistory.replace = replace;\n\nexport default history;\n"]}
@@ -1,107 +0,0 @@
1
- import { createElement, Fragment } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { __experimentalItemGroup as ItemGroup, __experimentalHStack as HStack, __experimentalSpacer as Spacer, FlexItem, CardBody, CardDivider } from '@wordpress/components';
7
- import { typography, border, filter, shadow, color, layout, chevronLeft, chevronRight } from '@wordpress/icons';
8
- import { isRTL, __ } from '@wordpress/i18n';
9
- import { useSelect } from '@wordpress/data';
10
- import { store as coreStore } from '@wordpress/core-data';
11
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
12
- /**
13
- * Internal dependencies
14
- */
15
-
16
- import { useHasVariationsPanel } from './variations-panel';
17
- import { NavigationButtonAsItem } from './navigation-button';
18
- import { IconWithCurrentColor } from './icon-with-current-color';
19
- import { ScreenVariations } from './screen-variations';
20
- import { unlock } from '../../private-apis';
21
- const {
22
- useHasDimensionsPanel,
23
- useHasTypographyPanel,
24
- useHasBorderPanel,
25
- useHasColorPanel,
26
- useHasEffectsPanel,
27
- useHasFiltersPanel,
28
- useGlobalSetting,
29
- useSettingsForBlockElement
30
- } = unlock(blockEditorPrivateApis);
31
-
32
- function ContextMenu(_ref) {
33
- let {
34
- name,
35
- parentMenu = ''
36
- } = _ref;
37
- const [rawSettings] = useGlobalSetting('', name);
38
- const settings = useSettingsForBlockElement(rawSettings, name);
39
- const hasTypographyPanel = useHasTypographyPanel(settings);
40
- const hasColorPanel = useHasColorPanel(settings);
41
- const hasBorderPanel = useHasBorderPanel(settings);
42
- const hasEffectsPanel = useHasEffectsPanel(settings);
43
- const hasFilterPanel = useHasFiltersPanel(settings);
44
- const hasDimensionsPanel = useHasDimensionsPanel(settings);
45
- const hasLayoutPanel = hasDimensionsPanel;
46
- const hasVariationsPanel = useHasVariationsPanel(name, parentMenu);
47
- const {
48
- canEditCSS
49
- } = useSelect(select => {
50
- var _globalStyles$_links$, _globalStyles$_links;
51
-
52
- const {
53
- getEntityRecord,
54
- __experimentalGetCurrentGlobalStylesId
55
- } = select(coreStore);
56
-
57
- const globalStylesId = __experimentalGetCurrentGlobalStylesId();
58
-
59
- const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
60
- return {
61
- canEditCSS: (_globalStyles$_links$ = !!(globalStyles !== null && globalStyles !== void 0 && (_globalStyles$_links = globalStyles._links) !== null && _globalStyles$_links !== void 0 && _globalStyles$_links['wp:action-edit-css'])) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false
62
- };
63
- }, []);
64
- const isBlocksPanel = parentMenu.includes('blocks') && !parentMenu.includes('variations');
65
- return createElement(Fragment, null, createElement(ItemGroup, null, hasTypographyPanel && createElement(NavigationButtonAsItem, {
66
- icon: typography,
67
- path: parentMenu + '/typography',
68
- "aria-label": __('Typography styles')
69
- }, __('Typography')), hasColorPanel && createElement(NavigationButtonAsItem, {
70
- icon: color,
71
- path: parentMenu + '/colors',
72
- "aria-label": __('Colors styles')
73
- }, __('Colors')), hasBorderPanel && createElement(NavigationButtonAsItem, {
74
- icon: border,
75
- path: parentMenu + '/border',
76
- "aria-label": __('Border')
77
- }, __('Border')), hasEffectsPanel && createElement(NavigationButtonAsItem, {
78
- icon: shadow,
79
- path: parentMenu + '/effects',
80
- "aria-label": __('Effects')
81
- }, __('Effects')), hasFilterPanel && createElement(NavigationButtonAsItem, {
82
- icon: filter,
83
- path: parentMenu + '/filters',
84
- "aria-label": __('Filters styles')
85
- }, __('Filters')), hasLayoutPanel && createElement(NavigationButtonAsItem, {
86
- icon: layout,
87
- path: parentMenu + '/layout',
88
- "aria-label": __('Layout styles')
89
- }, __('Layout')), hasVariationsPanel && createElement(ScreenVariations, {
90
- name: name,
91
- path: parentMenu
92
- }), isBlocksPanel && canEditCSS && createElement(Fragment, null, createElement(CardDivider, null), createElement(CardBody, null, createElement(Spacer, {
93
- as: "p",
94
- paddingTop: 2,
95
- marginBottom: 4
96
- }, __('Add your own CSS to customize the block appearance.')), createElement(ItemGroup, null, createElement(NavigationButtonAsItem, {
97
- path: parentMenu + '/css',
98
- "aria-label": __('Additional block CSS')
99
- }, createElement(HStack, {
100
- justify: "space-between"
101
- }, createElement(FlexItem, null, __('Additional block CSS')), createElement(IconWithCurrentColor, {
102
- icon: isRTL() ? chevronLeft : chevronRight
103
- }))))), createElement(CardDivider, null))));
104
- }
105
-
106
- export default ContextMenu;
107
- //# sourceMappingURL=context-menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalSpacer","Spacer","FlexItem","CardBody","CardDivider","typography","border","filter","shadow","color","layout","chevronLeft","chevronRight","isRTL","__","useSelect","store","coreStore","privateApis","blockEditorPrivateApis","useHasVariationsPanel","NavigationButtonAsItem","IconWithCurrentColor","ScreenVariations","unlock","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useHasColorPanel","useHasEffectsPanel","useHasFiltersPanel","useGlobalSetting","useSettingsForBlockElement","ContextMenu","name","parentMenu","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasEffectsPanel","hasFilterPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","isBlocksPanel","includes"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,QAJD,EAKCC,QALD,EAMCC,WAND,QAOO,uBAPP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AAD;AACC,IAAA,IAAI,EACHD,KAAK,KACFF,WADE,GAEFC;AAJL,IAJD,CAJD,CADD,CAND,CAFD,EA4BC,cAAC,WAAD,OA5BD,CA3DF,CADD,CADD;AA+FA;;AAED,eAAeqB,WAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\tFlexItem,\n\tCardBody,\n\tCardDivider,\n} from '@wordpress/components';\nimport {\n\ttypography,\n\tborder,\n\tfilter,\n\tshadow,\n\tcolor,\n\tlayout,\n\tchevronLeft,\n\tchevronRight,\n} from '@wordpress/icons';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { useHasVariationsPanel } from './variations-panel';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { ScreenVariations } from './screen-variations';\nimport { unlock } from '../../private-apis';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseHasColorPanel,\n\tuseHasEffectsPanel,\n\tuseHasFiltersPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n} = unlock( blockEditorPrivateApis );\n\nfunction ContextMenu( { name, parentMenu = '' } ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasEffectsPanel = useHasEffectsPanel( settings );\n\tconst hasFilterPanel = useHasFiltersPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasDimensionsPanel;\n\tconst hasVariationsPanel = useHasVariationsPanel( name, parentMenu );\n\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\tconst isBlocksPanel =\n\t\tparentMenu.includes( 'blocks' ) &&\n\t\t! parentMenu.includes( 'variations' );\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ hasTypographyPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ typography }\n\t\t\t\t\t\tpath={ parentMenu + '/typography' }\n\t\t\t\t\t\taria-label={ __( 'Typography styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasColorPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ color }\n\t\t\t\t\t\tpath={ parentMenu + '/colors' }\n\t\t\t\t\t\taria-label={ __( 'Colors styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasBorderPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ border }\n\t\t\t\t\t\tpath={ parentMenu + '/border' }\n\t\t\t\t\t\taria-label={ __( 'Border' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Border' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasEffectsPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ shadow }\n\t\t\t\t\t\tpath={ parentMenu + '/effects' }\n\t\t\t\t\t\taria-label={ __( 'Effects' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Effects' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasFilterPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ filter }\n\t\t\t\t\t\tpath={ parentMenu + '/filters' }\n\t\t\t\t\t\taria-label={ __( 'Filters styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Filters' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasLayoutPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\tpath={ parentMenu + '/layout' }\n\t\t\t\t\t\taria-label={ __( 'Layout styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasVariationsPanel && (\n\t\t\t\t\t<ScreenVariations name={ name } path={ parentMenu } />\n\t\t\t\t) }\n\t\t\t\t{ isBlocksPanel && canEditCSS && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<CardDivider />\n\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t<Spacer as=\"p\" paddingTop={ 2 } marginBottom={ 4 }>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Add your own CSS to customize the block appearance.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\t\tpath={ parentMenu + '/css' }\n\t\t\t\t\t\t\t\t\taria-label={ __( 'Additional block CSS' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Additional block CSS' ) }\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronRight\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t</CardBody>\n\t\t\t\t\t\t<CardDivider />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default ContextMenu;\n"]}
@@ -1,98 +0,0 @@
1
- import { createElement, Fragment } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { useState } from '@wordpress/element';
7
- import { TextareaControl, Panel, PanelBody, __experimentalVStack as VStack, Tooltip, Icon } from '@wordpress/components';
8
- import { __ } from '@wordpress/i18n';
9
- import { privateApis as blockEditorPrivateApis, transformStyles } from '@wordpress/block-editor';
10
- import { info } from '@wordpress/icons';
11
- /**
12
- * Internal dependencies
13
- */
14
-
15
- import { unlock } from '../../private-apis';
16
- import Subtitle from './subtitle';
17
- const {
18
- useGlobalStyle
19
- } = unlock(blockEditorPrivateApis);
20
-
21
- function CustomCSSControl(_ref) {
22
- let {
23
- blockName
24
- } = _ref;
25
- // If blockName is defined, we are customizing CSS at the block level:
26
- // styles.blocks.blockName.css
27
- const block = !!blockName ? blockName : null;
28
- const [customCSS, setCustomCSS] = useGlobalStyle('css', block);
29
- const [themeCSS] = useGlobalStyle('css', block, 'base');
30
- const [cssError, setCSSError] = useState(null);
31
- const ignoreThemeCustomCSS = '/* IgnoreThemeCustomCSS */'; // If there is custom css from theme.json show it in the edit box
32
- // so the user can selectively overwrite it, rather than have the user CSS
33
- // completely overwrite the theme CSS by default.
34
-
35
- const themeCustomCSS = !customCSS && themeCSS ? `/* ${__('Theme Custom CSS start')} */\n${themeCSS}\n/* ${__('Theme Custom CSS end')} */` : undefined;
36
-
37
- function handleOnChange(value) {
38
- // If there is theme custom CSS, but the user clears the input box then save the
39
- // ignoreThemeCustomCSS string so that the theme custom CSS is not re-applied.
40
- if (themeCSS && value === '') {
41
- setCustomCSS(ignoreThemeCustomCSS);
42
- return;
43
- }
44
-
45
- setCustomCSS(value);
46
-
47
- if (cssError) {
48
- const [transformed] = transformStyles([{
49
- css: value
50
- }], '.editor-styles-wrapper');
51
-
52
- if (transformed) {
53
- setCSSError(null);
54
- }
55
- }
56
- }
57
-
58
- function handleOnBlur(event) {
59
- var _event$target;
60
-
61
- if (!(event !== null && event !== void 0 && (_event$target = event.target) !== null && _event$target !== void 0 && _event$target.value)) {
62
- setCSSError(null);
63
- return;
64
- }
65
-
66
- const [transformed] = transformStyles([{
67
- css: event.target.value
68
- }], '.editor-styles-wrapper');
69
- setCSSError(transformed === null ? __('There is an error with your CSS structure.') : null);
70
- }
71
-
72
- const originalThemeCustomCSS = themeCSS && customCSS && themeCustomCSS !== customCSS ? themeCSS : undefined;
73
- return createElement(Fragment, null, originalThemeCustomCSS && createElement(Panel, null, createElement(PanelBody, {
74
- title: __('Original Theme Custom CSS'),
75
- initialOpen: false
76
- }, createElement("pre", {
77
- className: "edit-site-global-styles__custom-css-theme-css"
78
- }, originalThemeCustomCSS))), createElement(VStack, {
79
- spacing: 3
80
- }, createElement(Subtitle, null, __('Additional CSS')), createElement(TextareaControl, {
81
- __nextHasNoMarginBottom: true,
82
- value: (customCSS === null || customCSS === void 0 ? void 0 : customCSS.replace(ignoreThemeCustomCSS, '')) || themeCustomCSS,
83
- onChange: value => handleOnChange(value),
84
- onBlur: handleOnBlur,
85
- className: "edit-site-global-styles__custom-css-input",
86
- spellCheck: false
87
- }), cssError && createElement(Tooltip, {
88
- text: cssError
89
- }, createElement("div", {
90
- className: "edit-site-global-styles__custom-css-validation-wrapper"
91
- }, createElement(Icon, {
92
- icon: info,
93
- className: "edit-site-global-styles__custom-css-validation-icon"
94
- })))));
95
- }
96
-
97
- export default CustomCSSControl;
98
- //# sourceMappingURL=custom-css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/custom-css.js"],"names":["useState","TextareaControl","Panel","PanelBody","__experimentalVStack","VStack","Tooltip","Icon","__","privateApis","blockEditorPrivateApis","transformStyles","info","unlock","Subtitle","useGlobalStyle","CustomCSSControl","blockName","block","customCSS","setCustomCSS","themeCSS","cssError","setCSSError","ignoreThemeCustomCSS","themeCustomCSS","undefined","handleOnChange","value","transformed","css","handleOnBlur","event","target","originalThemeCustomCSS","replace"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,oBAAzB;AACA,SACCC,eADD,EAECC,KAFD,EAGCC,SAHD,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,OALD,EAMCC,IAND,QAOO,uBAPP;AAQA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,WAAW,IAAIC,sBADhB,EAECC,eAFD,QAGO,yBAHP;AAIA,SAASC,IAAT,QAAqB,kBAArB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,QAAP,MAAqB,YAArB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAqBF,MAAM,CAAEH,sBAAF,CAAjC;;AACA,SAASM,gBAAT,OAA2C;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAC1C;AACA;AACA,QAAMC,KAAK,GAAG,CAAC,CAA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AAApB,KAAF,CADsC,EAEtC,wBAFsC,CAAvC;AAKAL,IAAAA,WAAW,CACVM,WAAW,KAAK,IAAhB,GACGrB,EAAE,CAAE,4CAAF,CADL,GAEG,IAHO,CAAX;AAKA;;AAED,QAAM0B,sBAAsB,GAC3Bb,QAAQ,IAAIF,SAAZ,IAAyBM,cAAc,KAAKN,SAA5C,GACGE,QADH,GAEGK,SAHJ;AAKA,SACC,8BACGQ,sBAAsB,IACvB,cAAC,KAAD,QACC,cAAC,SAAD;AACC,IAAA,KAAK,EAAG1B,EAAE,CAAE,2BAAF,CADX;AAEC,IAAA,WAAW,EAAG;AAFf,KAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG0B,sBADH,CAJD,CADD,CAFF,EAaC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,QAAD,QAAY1B,EAAE,CAAE,gBAAF,CAAd,CADD,EAEC,cAAC,eAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EACJ,CAAAW,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEgB,OAAX,CAAoBX,oBAApB,EAA0C,EAA1C,MACAC,cAJF;AAMC,IAAA,QAAQ,EAAKG,KAAF,IAAaD,cAAc,CAAEC,KAAF,CANvC;AAOC,IAAA,MAAM,EAAGG,YAPV;AAQC,IAAA,SAAS,EAAC,2CARX;AASC,IAAA,UAAU,EAAG;AATd,IAFD,EAaGT,QAAQ,IACT,cAAC,OAAD;AAAS,IAAA,IAAI,EAAGA;AAAhB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,IAAD;AACC,IAAA,IAAI,EAAGV,IADR;AAEC,IAAA,SAAS,EAAC;AAFX,IADD,CADD,CAdF,CAbD,CADD;AAwCA;;AAED,eAAeI,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\tTextareaControl,\n\tPanel,\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\tTooltip,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\ttransformStyles,\n} from '@wordpress/block-editor';\nimport { info } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport Subtitle from './subtitle';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\nfunction CustomCSSControl( { blockName } ) {\n\t// If blockName is defined, we are customizing CSS at the block level:\n\t// styles.blocks.blockName.css\n\tconst block = !! blockName ? blockName : null;\n\n\tconst [ customCSS, setCustomCSS ] = useGlobalStyle( 'css', block );\n\tconst [ themeCSS ] = useGlobalStyle( 'css', block, 'base' );\n\tconst [ cssError, setCSSError ] = useState( null );\n\tconst ignoreThemeCustomCSS = '/* IgnoreThemeCustomCSS */';\n\n\t// If there is custom css from theme.json show it in the edit box\n\t// so the user can selectively overwrite it, rather than have the user CSS\n\t// completely overwrite the theme CSS by default.\n\tconst themeCustomCSS =\n\t\t! customCSS && themeCSS\n\t\t\t? `/* ${ __(\n\t\t\t\t\t'Theme Custom CSS start'\n\t\t\t ) } */\\n${ themeCSS }\\n/* ${ __( 'Theme Custom CSS end' ) } */`\n\t\t\t: undefined;\n\n\tfunction handleOnChange( value ) {\n\t\t// If there is theme custom CSS, but the user clears the input box then save the\n\t\t// ignoreThemeCustomCSS string so that the theme custom CSS is not re-applied.\n\t\tif ( themeCSS && value === '' ) {\n\t\t\tsetCustomCSS( ignoreThemeCustomCSS );\n\t\t\treturn;\n\t\t}\n\t\tsetCustomCSS( value );\n\t\tif ( cssError ) {\n\t\t\tconst [ transformed ] = transformStyles(\n\t\t\t\t[ { css: value } ],\n\t\t\t\t'.editor-styles-wrapper'\n\t\t\t);\n\t\t\tif ( transformed ) {\n\t\t\t\tsetCSSError( null );\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction handleOnBlur( event ) {\n\t\tif ( ! event?.target?.value ) {\n\t\t\tsetCSSError( null );\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ transformed ] = transformStyles(\n\t\t\t[ { css: event.target.value } ],\n\t\t\t'.editor-styles-wrapper'\n\t\t);\n\n\t\tsetCSSError(\n\t\t\ttransformed === null\n\t\t\t\t? __( 'There is an error with your CSS structure.' )\n\t\t\t\t: null\n\t\t);\n\t}\n\n\tconst originalThemeCustomCSS =\n\t\tthemeCSS && customCSS && themeCustomCSS !== customCSS\n\t\t\t? themeCSS\n\t\t\t: undefined;\n\n\treturn (\n\t\t<>\n\t\t\t{ originalThemeCustomCSS && (\n\t\t\t\t<Panel>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\ttitle={ __( 'Original Theme Custom CSS' ) }\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<pre className=\"edit-site-global-styles__custom-css-theme-css\">\n\t\t\t\t\t\t\t{ originalThemeCustomCSS }\n\t\t\t\t\t\t</pre>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</Panel>\n\t\t\t) }\n\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t<Subtitle>{ __( 'Additional CSS' ) }</Subtitle>\n\t\t\t\t<TextareaControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tvalue={\n\t\t\t\t\t\tcustomCSS?.replace( ignoreThemeCustomCSS, '' ) ||\n\t\t\t\t\t\tthemeCustomCSS\n\t\t\t\t\t}\n\t\t\t\t\tonChange={ ( value ) => handleOnChange( value ) }\n\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\tclassName=\"edit-site-global-styles__custom-css-input\"\n\t\t\t\t\tspellCheck={ false }\n\t\t\t\t/>\n\t\t\t\t{ cssError && (\n\t\t\t\t\t<Tooltip text={ cssError }>\n\t\t\t\t\t\t<div className=\"edit-site-global-styles__custom-css-validation-wrapper\">\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ info }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles__custom-css-validation-icon\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default CustomCSSControl;\n"]}
@@ -1,43 +0,0 @@
1
- import { createElement } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
7
- /**
8
- * Internal dependencies
9
- */
10
-
11
- import { unlock } from '../../private-apis';
12
- const {
13
- useGlobalSetting,
14
- useGlobalStyle,
15
- EffectsPanel: StylesEffectsPanel,
16
- useSettingsForBlockElement
17
- } = unlock(blockEditorPrivateApis);
18
- export default function EffectsPanel(_ref) {
19
- let {
20
- name,
21
- variation = ''
22
- } = _ref;
23
- let prefixParts = [];
24
-
25
- if (variation) {
26
- prefixParts = ['variations', variation].concat(prefixParts);
27
- }
28
-
29
- const prefix = prefixParts.join('.');
30
- const [style] = useGlobalStyle(prefix, name, 'user', false);
31
- const [inheritedStyle, setStyle] = useGlobalStyle(prefix, name, 'all', {
32
- shouldDecodeEncode: false
33
- });
34
- const [rawSettings] = useGlobalSetting('', name);
35
- const settings = useSettingsForBlockElement(rawSettings, name);
36
- return createElement(StylesEffectsPanel, {
37
- inheritedValue: inheritedStyle,
38
- value: style,
39
- onChange: setStyle,
40
- settings: settings
41
- });
42
- }
43
- //# sourceMappingURL=effects-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/effects-panel.js"],"names":["privateApis","blockEditorPrivateApis","unlock","useGlobalSetting","useGlobalStyle","EffectsPanel","StylesEffectsPanel","useSettingsForBlockElement","name","variation","prefixParts","concat","prefix","join","style","inheritedStyle","setStyle","shouldDecodeEncode","rawSettings","settings"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AACLC,EAAAA,gBADK;AAELC,EAAAA,cAFK;AAGLC,EAAAA,YAAY,EAAEC,kBAHT;AAILC,EAAAA;AAJK,IAKFL,MAAM,CAAED,sBAAF,CALV;AAOA,eAAe,SAASI,YAAT,OAAkD;AAAA,MAA3B;AAAEG,IAAAA,IAAF;AAAQC,IAAAA,SAAS,GAAG;AAApB,GAA2B;AAChE,MAAIC,WAAW,GAAG,EAAlB;;AACA,MAAKD,SAAL,EAAiB;AAChBC,IAAAA,WAAW,GAAG,CAAE,YAAF,EAAgBD,SAAhB,EAA4BE,MAA5B,CAAoCD,WAApC,CAAd;AACA;;AACD,QAAME,MAAM,GAAGF,WAAW,CAACG,IAAZ,CAAkB,GAAlB,CAAf;AAEA,QAAM,CAAEC,KAAF,IAAYV,cAAc,CAAEQ,MAAF,EAAUJ,IAAV,EAAgB,MAAhB,EAAwB,KAAxB,CAAhC;AACA,QAAM,CAAEO,cAAF,EAAkBC,QAAlB,IAA+BZ,cAAc,CAAEQ,MAAF,EAAUJ,IAAV,EAAgB,KAAhB,EAAuB;AACzES,IAAAA,kBAAkB,EAAE;AADqD,GAAvB,CAAnD;AAGA,QAAM,CAAEC,WAAF,IAAkBf,gBAAgB,CAAE,EAAF,EAAMK,IAAN,CAAxC;AACA,QAAMW,QAAQ,GAAGZ,0BAA0B,CAAEW,WAAF,EAAeV,IAAf,CAA3C;AAEA,SACC,cAAC,kBAAD;AACC,IAAA,cAAc,EAAGO,cADlB;AAEC,IAAA,KAAK,EAAGD,KAFT;AAGC,IAAA,QAAQ,EAAGE,QAHZ;AAIC,IAAA,QAAQ,EAAGG;AAJZ,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst {\n\tuseGlobalSetting,\n\tuseGlobalStyle,\n\tEffectsPanel: StylesEffectsPanel,\n\tuseSettingsForBlockElement,\n} = unlock( blockEditorPrivateApis );\n\nexport default function EffectsPanel( { name, variation = '' } ) {\n\tlet prefixParts = [];\n\tif ( variation ) {\n\t\tprefixParts = [ 'variations', variation ].concat( prefixParts );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, name, 'user', false );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ rawSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\n\treturn (\n\t\t<StylesEffectsPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"]}
@@ -1,40 +0,0 @@
1
- import { createElement } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
7
- /**
8
- * Internal dependencies
9
- */
10
-
11
- import { unlock } from '../../private-apis';
12
- const {
13
- useGlobalStyle,
14
- useGlobalSetting,
15
- useSettingsForBlockElement,
16
- FiltersPanel: StylesFiltersPanel
17
- } = unlock(blockEditorPrivateApis);
18
- export default function FiltersPanel(_ref) {
19
- let {
20
- name
21
- } = _ref;
22
- const [style] = useGlobalStyle('', name, 'user', false);
23
- const [inheritedStyle, setStyle] = useGlobalStyle('', name, 'all', {
24
- shouldDecodeEncode: false
25
- });
26
- const [rawSettings] = useGlobalSetting('', name);
27
- const settings = useSettingsForBlockElement(rawSettings, name);
28
- return createElement(StylesFiltersPanel, {
29
- inheritedValue: inheritedStyle,
30
- value: style,
31
- onChange: setStyle,
32
- settings: { ...settings,
33
- color: { ...settings.color,
34
- customDuotone: false //TO FIX: Custom duotone only works on the block level right now
35
-
36
- }
37
- }
38
- });
39
- }
40
- //# sourceMappingURL=filters-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/filters-panel.js"],"names":["privateApis","blockEditorPrivateApis","unlock","useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","FiltersPanel","StylesFiltersPanel","name","style","inheritedStyle","setStyle","shouldDecodeEncode","rawSettings","settings","color","customDuotone"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,MAAM;AACLC,EAAAA,cADK;AAELC,EAAAA,gBAFK;AAGLC,EAAAA,0BAHK;AAILC,EAAAA,YAAY,EAAEC;AAJT,IAKFL,MAAM,CAAED,sBAAF,CALV;AAOA,eAAe,SAASK,YAAT,OAAkC;AAAA,MAAX;AAAEE,IAAAA;AAAF,GAAW;AAChD,QAAM,CAAEC,KAAF,IAAYN,cAAc,CAAE,EAAF,EAAMK,IAAN,EAAY,MAAZ,EAAoB,KAApB,CAAhC;AACA,QAAM,CAAEE,cAAF,EAAkBC,QAAlB,IAA+BR,cAAc,CAAE,EAAF,EAAMK,IAAN,EAAY,KAAZ,EAAmB;AACrEI,IAAAA,kBAAkB,EAAE;AADiD,GAAnB,CAAnD;AAGA,QAAM,CAAEC,WAAF,IAAkBT,gBAAgB,CAAE,EAAF,EAAMI,IAAN,CAAxC;AACA,QAAMM,QAAQ,GAAGT,0BAA0B,CAAEQ,WAAF,EAAeL,IAAf,CAA3C;AAEA,SACC,cAAC,kBAAD;AACC,IAAA,cAAc,EAAGE,cADlB;AAEC,IAAA,KAAK,EAAGD,KAFT;AAGC,IAAA,QAAQ,EAAGE,QAHZ;AAIC,IAAA,QAAQ,EAAG,EACV,GAAGG,QADO;AAEVC,MAAAA,KAAK,EAAE,EACN,GAAGD,QAAQ,CAACC,KADN;AAENC,QAAAA,aAAa,EAAE,KAFT,CAEgB;;AAFhB;AAFG;AAJZ,IADD;AAcA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tFiltersPanel: StylesFiltersPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function FiltersPanel( { name } ) {\n\tconst [ style ] = useGlobalStyle( '', name, 'user', false );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( '', name, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ rawSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\n\treturn (\n\t\t<StylesFiltersPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ {\n\t\t\t\t...settings,\n\t\t\t\tcolor: {\n\t\t\t\t\t...settings.color,\n\t\t\t\t\tcustomDuotone: false, //TO FIX: Custom duotone only works on the block level right now\n\t\t\t\t},\n\t\t\t} }\n\t\t/>\n\t);\n}\n"]}
@@ -1,44 +0,0 @@
1
- import { createElement, Fragment } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { __ } from '@wordpress/i18n';
7
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
8
- /**
9
- * Internal dependencies
10
- */
11
-
12
- import ScreenHeader from './header';
13
- import BorderPanel from './border-panel';
14
- import BlockPreviewPanel from './block-preview-panel';
15
- import { getVariationClassName } from './utils';
16
- import { unlock } from '../../private-apis';
17
- const {
18
- useHasBorderPanel,
19
- useGlobalSetting,
20
- useSettingsForBlockElement
21
- } = unlock(blockEditorPrivateApis);
22
-
23
- function ScreenBorder(_ref) {
24
- let {
25
- name,
26
- variation = ''
27
- } = _ref;
28
- const [rawSettings] = useGlobalSetting('', name);
29
- const settings = useSettingsForBlockElement(rawSettings, name);
30
- const hasBorderPanel = useHasBorderPanel(settings);
31
- const variationClassName = getVariationClassName(variation);
32
- return createElement(Fragment, null, createElement(ScreenHeader, {
33
- title: __('Border')
34
- }), createElement(BlockPreviewPanel, {
35
- name: name,
36
- variation: variationClassName
37
- }), hasBorderPanel && createElement(BorderPanel, {
38
- name: name,
39
- variation: variation
40
- }));
41
- }
42
-
43
- export default ScreenBorder;
44
- //# sourceMappingURL=screen-border.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-border.js"],"names":["__","privateApis","blockEditorPrivateApis","ScreenHeader","BorderPanel","BlockPreviewPanel","getVariationClassName","unlock","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","ScreenBorder","name","variation","rawSettings","settings","hasBorderPanel","variationClassName"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,qBAAT,QAAsC,SAAtC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA,iBAAF;AAAqBC,EAAAA,gBAArB;AAAuCC,EAAAA;AAAvC,IACLH,MAAM,CAAEL,sBAAF,CADP;;AAGA,SAASS,YAAT,OAAkD;AAAA,MAA3B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,SAAS,GAAG;AAApB,GAA2B;AACjD,QAAM,CAAEC,WAAF,IAAkBL,gBAAgB,CAAE,EAAF,EAAMG,IAAN,CAAxC;AACA,QAAMG,QAAQ,GAAGL,0BAA0B,CAAEI,WAAF,EAAeF,IAAf,CAA3C;AACA,QAAMI,cAAc,GAAGR,iBAAiB,CAAEO,QAAF,CAAxC;AACA,QAAME,kBAAkB,GAAGX,qBAAqB,CAAEO,SAAF,CAAhD;AACA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGb,EAAE,CAAE,QAAF;AAAxB,IADD,EAEC,cAAC,iBAAD;AAAmB,IAAA,IAAI,EAAGY,IAA1B;AAAiC,IAAA,SAAS,EAAGK;AAA7C,IAFD,EAGGD,cAAc,IACf,cAAC,WAAD;AAAa,IAAA,IAAI,EAAGJ,IAApB;AAA2B,IAAA,SAAS,EAAGC;AAAvC,IAJF,CADD;AASA;;AAED,eAAeF,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport BorderPanel from './border-panel';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { getVariationClassName } from './utils';\nimport { unlock } from '../../private-apis';\n\nconst { useHasBorderPanel, useGlobalSetting, useSettingsForBlockElement } =\n\tunlock( blockEditorPrivateApis );\n\nfunction ScreenBorder( { name, variation = '' } ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst variationClassName = getVariationClassName( variation );\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Border' ) } />\n\t\t\t<BlockPreviewPanel name={ name } variation={ variationClassName } />\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<BorderPanel name={ name } variation={ variation } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBorder;\n"]}
@@ -1,44 +0,0 @@
1
- import { createElement, Fragment } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { __ } from '@wordpress/i18n';
7
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
8
- /**
9
- * Internal dependencies
10
- */
11
-
12
- import ScreenHeader from './header';
13
- import BlockPreviewPanel from './block-preview-panel';
14
- import { getVariationClassName } from './utils';
15
- import { unlock } from '../../private-apis';
16
- import EffectsPanel from './effects-panel';
17
- const {
18
- useGlobalSetting,
19
- useSettingsForBlockElement,
20
- useHasEffectsPanel
21
- } = unlock(blockEditorPrivateApis);
22
-
23
- function ScreenEffects(_ref) {
24
- let {
25
- name,
26
- variation = ''
27
- } = _ref;
28
- const [rawSettings] = useGlobalSetting('', name);
29
- const settings = useSettingsForBlockElement(rawSettings, name);
30
- const variationClassName = getVariationClassName(variation);
31
- const hasEffectsPanel = useHasEffectsPanel(settings);
32
- return createElement(Fragment, null, createElement(ScreenHeader, {
33
- title: __('Effects')
34
- }), createElement(BlockPreviewPanel, {
35
- name: name,
36
- variation: variationClassName
37
- }), hasEffectsPanel && createElement(EffectsPanel, {
38
- name: name,
39
- variation: variation
40
- }));
41
- }
42
-
43
- export default ScreenEffects;
44
- //# sourceMappingURL=screen-effects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-effects.js"],"names":["__","privateApis","blockEditorPrivateApis","ScreenHeader","BlockPreviewPanel","getVariationClassName","unlock","EffectsPanel","useGlobalSetting","useSettingsForBlockElement","useHasEffectsPanel","ScreenEffects","name","variation","rawSettings","settings","variationClassName","hasEffectsPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,qBAAT,QAAsC,SAAtC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AAEA,MAAM;AAAEC,EAAAA,gBAAF;AAAoBC,EAAAA,0BAApB;AAAgDC,EAAAA;AAAhD,IACLJ,MAAM,CAAEJ,sBAAF,CADP;;AAGA,SAASS,aAAT,OAAmD;AAAA,MAA3B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,SAAS,GAAG;AAApB,GAA2B;AAClD,QAAM,CAAEC,WAAF,IAAkBN,gBAAgB,CAAE,EAAF,EAAMI,IAAN,CAAxC;AACA,QAAMG,QAAQ,GAAGN,0BAA0B,CAAEK,WAAF,EAAeF,IAAf,CAA3C;AACA,QAAMI,kBAAkB,GAAGX,qBAAqB,CAAEQ,SAAF,CAAhD;AACA,QAAMI,eAAe,GAAGP,kBAAkB,CAAEK,QAAF,CAA1C;AACA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGf,EAAE,CAAE,SAAF;AAAxB,IADD,EAEC,cAAC,iBAAD;AAAmB,IAAA,IAAI,EAAGY,IAA1B;AAAiC,IAAA,SAAS,EAAGI;AAA7C,IAFD,EAGGC,eAAe,IAChB,cAAC,YAAD;AAAc,IAAA,IAAI,EAAGL,IAArB;AAA4B,IAAA,SAAS,EAAGC;AAAxC,IAJF,CADD;AASA;;AAED,eAAeF,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { getVariationClassName } from './utils';\nimport { unlock } from '../../private-apis';\nimport EffectsPanel from './effects-panel';\n\nconst { useGlobalSetting, useSettingsForBlockElement, useHasEffectsPanel } =\n\tunlock( blockEditorPrivateApis );\n\nfunction ScreenEffects( { name, variation = '' } ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\tconst variationClassName = getVariationClassName( variation );\n\tconst hasEffectsPanel = useHasEffectsPanel( settings );\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Effects' ) } />\n\t\t\t<BlockPreviewPanel name={ name } variation={ variationClassName } />\n\t\t\t{ hasEffectsPanel && (\n\t\t\t\t<EffectsPanel name={ name } variation={ variation } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenEffects;\n"]}
@@ -1,33 +0,0 @@
1
- import { createElement, Fragment } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { __ } from '@wordpress/i18n';
7
- /**
8
- * Internal dependencies
9
- */
10
-
11
- import FiltersPanel from './filters-panel';
12
- import BlockPreviewPanel from './block-preview-panel';
13
- /**
14
- * Internal dependencies
15
- */
16
-
17
- import ScreenHeader from './header';
18
-
19
- function ScreenFilters(_ref) {
20
- let {
21
- name
22
- } = _ref;
23
- return createElement(Fragment, null, createElement(ScreenHeader, {
24
- title: __('Filters')
25
- }), createElement(BlockPreviewPanel, {
26
- name: name
27
- }), createElement(FiltersPanel, {
28
- name: name
29
- }));
30
- }
31
-
32
- export default ScreenFilters;
33
- //# sourceMappingURL=screen-filters.js.map