@wordpress/edit-site 6.31.1-next.f56bd8138.0 → 6.32.1-next.47f435fc9.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 (994) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +153 -141
  3. package/build/components/add-new-pattern/index.js.map +7 -1
  4. package/build/components/add-new-post/index.js +114 -89
  5. package/build/components/add-new-post/index.js.map +7 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +80 -60
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +7 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +284 -207
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +7 -1
  10. package/build/components/add-new-template/index.js +309 -248
  11. package/build/components/add-new-template/index.js.map +7 -1
  12. package/build/components/add-new-template/utils.js +459 -446
  13. package/build/components/add-new-template/utils.js.map +7 -1
  14. package/build/components/app/index.js +72 -63
  15. package/build/components/app/index.js.map +7 -1
  16. package/build/components/block-editor/use-editor-iframe-props.js +63 -66
  17. package/build/components/block-editor/use-editor-iframe-props.js.map +7 -1
  18. package/build/components/block-editor/use-navigate-to-entity-record.js +34 -22
  19. package/build/components/block-editor/use-navigate-to-entity-record.js.map +7 -1
  20. package/build/components/block-editor/use-site-editor-settings.js +64 -51
  21. package/build/components/block-editor/use-site-editor-settings.js.map +7 -1
  22. package/build/components/canvas-loader/index.js +41 -56
  23. package/build/components/canvas-loader/index.js.map +7 -1
  24. package/build/components/dataviews-actions/index.js +96 -83
  25. package/build/components/dataviews-actions/index.js.map +7 -1
  26. package/build/components/editor/index.js +288 -235
  27. package/build/components/editor/index.js.map +7 -1
  28. package/build/components/editor/site-preview.js +55 -42
  29. package/build/components/editor/site-preview.js.map +7 -1
  30. package/build/components/editor/use-adapt-editor-to-canvas.js +49 -31
  31. package/build/components/editor/use-adapt-editor-to-canvas.js.map +7 -1
  32. package/build/components/editor/use-editor-title.js +79 -61
  33. package/build/components/editor/use-editor-title.js.map +7 -1
  34. package/build/components/editor/use-resolve-edited-entity.js +112 -140
  35. package/build/components/editor/use-resolve-edited-entity.js.map +7 -1
  36. package/build/components/editor-canvas-container/index.js +101 -91
  37. package/build/components/editor-canvas-container/index.js.map +7 -1
  38. package/build/components/global-styles/background-panel.js +46 -39
  39. package/build/components/global-styles/background-panel.js.map +7 -1
  40. package/build/components/global-styles/block-preview-panel.js +58 -52
  41. package/build/components/global-styles/block-preview-panel.js.map +7 -1
  42. package/build/components/global-styles/color-indicator-wrapper.js +47 -26
  43. package/build/components/global-styles/color-indicator-wrapper.js.map +7 -1
  44. package/build/components/global-styles/color-palette-panel.js +130 -81
  45. package/build/components/global-styles/color-palette-panel.js.map +7 -1
  46. package/build/components/global-styles/confirm-reset-shadow-dialog.js +38 -22
  47. package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +7 -1
  48. package/build/components/global-styles/dimensions-panel.js +46 -41
  49. package/build/components/global-styles/dimensions-panel.js.map +7 -1
  50. package/build/components/global-styles/font-families.js +106 -102
  51. package/build/components/global-styles/font-families.js.map +7 -1
  52. package/build/components/global-styles/font-family-item.js +41 -43
  53. package/build/components/global-styles/font-family-item.js.map +7 -1
  54. package/build/components/global-styles/font-library-modal/collection-font-variant.js +55 -39
  55. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +7 -1
  56. package/build/components/global-styles/font-library-modal/context.js +228 -243
  57. package/build/components/global-styles/font-library-modal/context.js.map +7 -1
  58. package/build/components/global-styles/font-library-modal/font-card.js +70 -59
  59. package/build/components/global-styles/font-library-modal/font-card.js.map +7 -1
  60. package/build/components/global-styles/font-library-modal/font-collection.js +407 -321
  61. package/build/components/global-styles/font-library-modal/font-collection.js.map +7 -1
  62. package/build/components/global-styles/font-library-modal/font-demo.js +54 -50
  63. package/build/components/global-styles/font-library-modal/font-demo.js.map +7 -1
  64. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +52 -44
  65. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +7 -1
  66. package/build/components/global-styles/font-library-modal/index.js +90 -87
  67. package/build/components/global-styles/font-library-modal/index.js.map +7 -1
  68. package/build/components/global-styles/font-library-modal/installed-fonts.js +369 -255
  69. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +7 -1
  70. package/build/components/global-styles/font-library-modal/library-font-details.js +60 -42
  71. package/build/components/global-styles/font-library-modal/library-font-details.js.map +7 -1
  72. package/build/components/global-styles/font-library-modal/library-font-variant.js +64 -49
  73. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +7 -1
  74. package/build/components/global-styles/font-library-modal/resolvers.js +64 -31
  75. package/build/components/global-styles/font-library-modal/resolvers.js.map +7 -1
  76. package/build/components/global-styles/font-library-modal/upload-fonts.js +133 -145
  77. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +7 -1
  78. package/build/components/global-styles/font-library-modal/utils/constants.js +45 -24
  79. package/build/components/global-styles/font-library-modal/utils/constants.js.map +7 -1
  80. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +30 -27
  81. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +7 -1
  82. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +41 -13
  83. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +7 -1
  84. package/build/components/global-styles/font-library-modal/utils/index.js +127 -161
  85. package/build/components/global-styles/font-library-modal/utils/index.js.map +7 -1
  86. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +25 -18
  87. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +7 -1
  88. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +55 -74
  89. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +7 -1
  90. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +32 -16
  91. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +7 -1
  92. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +43 -72
  93. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +7 -1
  94. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +44 -23
  95. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +7 -1
  96. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +38 -22
  97. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -1
  98. package/build/components/global-styles/font-sizes/font-size-preview.js +42 -35
  99. package/build/components/global-styles/font-sizes/font-size-preview.js.map +7 -1
  100. package/build/components/global-styles/font-sizes/font-size.js +207 -170
  101. package/build/components/global-styles/font-sizes/font-size.js.map +7 -1
  102. package/build/components/global-styles/font-sizes/font-sizes-count.js +46 -45
  103. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +7 -1
  104. package/build/components/global-styles/font-sizes/font-sizes.js +199 -136
  105. package/build/components/global-styles/font-sizes/font-sizes.js.map +7 -1
  106. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +81 -58
  107. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +7 -1
  108. package/build/components/global-styles/gradients-palette-panel.js +140 -85
  109. package/build/components/global-styles/gradients-palette-panel.js.map +7 -1
  110. package/build/components/global-styles/header.js +51 -48
  111. package/build/components/global-styles/header.js.map +7 -1
  112. package/build/components/global-styles/highlighted-colors.js +48 -40
  113. package/build/components/global-styles/highlighted-colors.js.map +7 -1
  114. package/build/components/global-styles/hooks.js +89 -68
  115. package/build/components/global-styles/hooks.js.map +7 -1
  116. package/build/components/global-styles/icon-with-current-color.js +50 -25
  117. package/build/components/global-styles/icon-with-current-color.js.map +7 -1
  118. package/build/components/global-styles/index.js +36 -11
  119. package/build/components/global-styles/index.js.map +7 -1
  120. package/build/components/global-styles/navigation-button.js +41 -42
  121. package/build/components/global-styles/navigation-button.js.map +7 -1
  122. package/build/components/global-styles/palette.js +82 -73
  123. package/build/components/global-styles/palette.js.map +7 -1
  124. package/build/components/global-styles/preset-colors.js +36 -24
  125. package/build/components/global-styles/preset-colors.js.map +7 -1
  126. package/build/components/global-styles/preview-colors.js +68 -46
  127. package/build/components/global-styles/preview-colors.js.map +7 -1
  128. package/build/components/global-styles/preview-styles.js +182 -136
  129. package/build/components/global-styles/preview-styles.js.map +7 -1
  130. package/build/components/global-styles/preview-typography.js +65 -44
  131. package/build/components/global-styles/preview-typography.js.map +7 -1
  132. package/build/components/global-styles/preview-wrapper.js +70 -85
  133. package/build/components/global-styles/preview-wrapper.js.map +7 -1
  134. package/build/components/global-styles/root-menu.js +53 -52
  135. package/build/components/global-styles/root-menu.js.map +7 -1
  136. package/build/components/global-styles/screen-background.js +54 -35
  137. package/build/components/global-styles/screen-background.js.map +7 -1
  138. package/build/components/global-styles/screen-block-list.js +129 -118
  139. package/build/components/global-styles/screen-block-list.js.map +7 -1
  140. package/build/components/global-styles/screen-block.js +185 -182
  141. package/build/components/global-styles/screen-block.js.map +7 -1
  142. package/build/components/global-styles/screen-color-palette.js +61 -56
  143. package/build/components/global-styles/screen-color-palette.js.map +7 -1
  144. package/build/components/global-styles/screen-colors.js +64 -40
  145. package/build/components/global-styles/screen-colors.js.map +7 -1
  146. package/build/components/global-styles/screen-css.js +80 -50
  147. package/build/components/global-styles/screen-css.js.map +7 -1
  148. package/build/components/global-styles/screen-layout.js +45 -32
  149. package/build/components/global-styles/screen-layout.js.map +7 -1
  150. package/build/components/global-styles/screen-revisions/index.js +144 -116
  151. package/build/components/global-styles/screen-revisions/index.js.map +7 -1
  152. package/build/components/global-styles/screen-revisions/revisions-buttons.js +165 -166
  153. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +7 -1
  154. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +93 -81
  155. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +7 -1
  156. package/build/components/global-styles/screen-root.js +93 -84
  157. package/build/components/global-styles/screen-root.js.map +7 -1
  158. package/build/components/global-styles/screen-shadows.js +43 -16
  159. package/build/components/global-styles/screen-shadows.js.map +7 -1
  160. package/build/components/global-styles/screen-style-variations.js +64 -44
  161. package/build/components/global-styles/screen-style-variations.js.map +7 -1
  162. package/build/components/global-styles/screen-typography-element.js +146 -93
  163. package/build/components/global-styles/screen-typography-element.js.map +7 -1
  164. package/build/components/global-styles/screen-typography.js +64 -40
  165. package/build/components/global-styles/screen-typography.js.map +7 -1
  166. package/build/components/global-styles/shadow-utils.js +75 -180
  167. package/build/components/global-styles/shadow-utils.js.map +7 -1
  168. package/build/components/global-styles/shadows-edit-panel.js +433 -358
  169. package/build/components/global-styles/shadows-edit-panel.js.map +7 -1
  170. package/build/components/global-styles/shadows-panel.js +178 -131
  171. package/build/components/global-styles/shadows-panel.js.map +7 -1
  172. package/build/components/global-styles/size-control/index.js +66 -76
  173. package/build/components/global-styles/size-control/index.js.map +7 -1
  174. package/build/components/global-styles/style-variations-container.js +114 -102
  175. package/build/components/global-styles/style-variations-container.js.map +7 -1
  176. package/build/components/global-styles/subtitle.js +34 -21
  177. package/build/components/global-styles/subtitle.js.map +7 -1
  178. package/build/components/global-styles/typeset.js +73 -75
  179. package/build/components/global-styles/typeset.js.map +7 -1
  180. package/build/components/global-styles/typography-elements.js +109 -86
  181. package/build/components/global-styles/typography-elements.js.map +7 -1
  182. package/build/components/global-styles/typography-example.js +66 -65
  183. package/build/components/global-styles/typography-example.js.map +7 -1
  184. package/build/components/global-styles/typography-panel.js +57 -39
  185. package/build/components/global-styles/typography-panel.js.map +7 -1
  186. package/build/components/global-styles/typography-preview.js +73 -53
  187. package/build/components/global-styles/typography-preview.js.map +7 -1
  188. package/build/components/global-styles/ui.js +282 -314
  189. package/build/components/global-styles/ui.js.map +7 -1
  190. package/build/components/global-styles/utils.js +45 -31
  191. package/build/components/global-styles/utils.js.map +7 -1
  192. package/build/components/global-styles/variations/variation.js +90 -74
  193. package/build/components/global-styles/variations/variation.js.map +7 -1
  194. package/build/components/global-styles/variations/variations-color.js +52 -41
  195. package/build/components/global-styles/variations/variations-color.js.map +7 -1
  196. package/build/components/global-styles/variations/variations-panel.js +61 -51
  197. package/build/components/global-styles/variations/variations-panel.js.map +7 -1
  198. package/build/components/global-styles/variations/variations-typography.js +69 -49
  199. package/build/components/global-styles/variations/variations-typography.js.map +7 -1
  200. package/build/components/global-styles-renderer/index.js +39 -33
  201. package/build/components/global-styles-renderer/index.js.map +7 -1
  202. package/build/components/global-styles-sidebar/default-sidebar.js +53 -40
  203. package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -1
  204. package/build/components/global-styles-sidebar/index.js +164 -141
  205. package/build/components/global-styles-sidebar/index.js.map +7 -1
  206. package/build/components/layout/animation.js +53 -78
  207. package/build/components/layout/animation.js.map +7 -1
  208. package/build/components/layout/hooks.js +40 -35
  209. package/build/components/layout/hooks.js.map +7 -1
  210. package/build/components/layout/index.js +220 -199
  211. package/build/components/layout/index.js.map +7 -1
  212. package/build/components/media/index.js +31 -26
  213. package/build/components/media/index.js.map +7 -1
  214. package/build/components/more-menu/index.js +45 -28
  215. package/build/components/more-menu/index.js.map +7 -1
  216. package/build/components/more-menu/site-export.js +69 -44
  217. package/build/components/more-menu/site-export.js.map +7 -1
  218. package/build/components/more-menu/welcome-guide-menu-item.js +29 -21
  219. package/build/components/more-menu/welcome-guide-menu-item.js.map +7 -1
  220. package/build/components/page-patterns/actions.js +82 -0
  221. package/build/components/page-patterns/actions.js.map +7 -0
  222. package/build/components/page-patterns/delete-category-menu-item.js +94 -82
  223. package/build/components/page-patterns/delete-category-menu-item.js.map +7 -1
  224. package/build/components/page-patterns/fields.js +135 -123
  225. package/build/components/page-patterns/fields.js.map +7 -1
  226. package/build/components/page-patterns/index.js +182 -148
  227. package/build/components/page-patterns/index.js.map +7 -1
  228. package/build/components/page-patterns/rename-category-menu-item.js +67 -62
  229. package/build/components/page-patterns/rename-category-menu-item.js.map +7 -1
  230. package/build/components/page-patterns/search-items.js +65 -89
  231. package/build/components/page-patterns/search-items.js.map +7 -1
  232. package/build/components/page-patterns/use-pattern-settings.js +45 -35
  233. package/build/components/page-patterns/use-pattern-settings.js.map +7 -1
  234. package/build/components/page-patterns/use-patterns.js +266 -200
  235. package/build/components/page-patterns/use-patterns.js.map +7 -1
  236. package/build/components/page-patterns/utils.js +27 -7
  237. package/build/components/page-patterns/utils.js.map +7 -1
  238. package/build/components/page-templates/fields.js +165 -159
  239. package/build/components/page-templates/fields.js.map +7 -1
  240. package/build/components/page-templates/hooks.js +66 -64
  241. package/build/components/page-templates/hooks.js.map +7 -1
  242. package/build/components/page-templates/index.js +211 -207
  243. package/build/components/page-templates/index.js.map +7 -1
  244. package/build/components/page-templates/view-utils.js +67 -0
  245. package/build/components/page-templates/view-utils.js.map +7 -0
  246. package/build/components/pagination/index.js +119 -82
  247. package/build/components/pagination/index.js.map +7 -1
  248. package/build/components/plugin-template-setting-panel/index.js +49 -56
  249. package/build/components/plugin-template-setting-panel/index.js.map +7 -1
  250. package/build/components/post-edit/index.js +171 -144
  251. package/build/components/post-edit/index.js.map +7 -1
  252. package/build/components/post-list/index.js +230 -301
  253. package/build/components/post-list/index.js.map +7 -1
  254. package/build/components/post-list/view-utils.js +167 -0
  255. package/build/components/post-list/view-utils.js.map +7 -0
  256. package/build/components/posts-app/index.js +44 -32
  257. package/build/components/posts-app/index.js.map +7 -1
  258. package/build/components/posts-app-routes/index.js +36 -25
  259. package/build/components/posts-app-routes/index.js.map +7 -1
  260. package/build/components/posts-app-routes/post-item.js +54 -35
  261. package/build/components/posts-app-routes/post-item.js.map +7 -1
  262. package/build/components/posts-app-routes/posts.js +91 -76
  263. package/build/components/posts-app-routes/posts.js.map +7 -1
  264. package/build/components/resizable-frame/index.js +200 -224
  265. package/build/components/resizable-frame/index.js.map +7 -1
  266. package/build/components/revisions/index.js +102 -71
  267. package/build/components/revisions/index.js.map +7 -1
  268. package/build/components/routes/use-title.js +45 -35
  269. package/build/components/routes/use-title.js.map +7 -1
  270. package/build/components/save-button/index.js +113 -111
  271. package/build/components/save-button/index.js.map +7 -1
  272. package/build/components/save-hub/index.js +52 -40
  273. package/build/components/save-hub/index.js.map +7 -1
  274. package/build/components/save-keyboard-shortcut/index.js +46 -52
  275. package/build/components/save-keyboard-shortcut/index.js.map +7 -1
  276. package/build/components/save-panel/index.js +155 -136
  277. package/build/components/save-panel/index.js.map +7 -1
  278. package/build/components/sidebar/index.js +81 -79
  279. package/build/components/sidebar/index.js.map +7 -1
  280. package/build/components/sidebar-button/index.js +43 -22
  281. package/build/components/sidebar-button/index.js.map +7 -1
  282. package/build/components/sidebar-dataviews/dataview-item.js +68 -55
  283. package/build/components/sidebar-dataviews/dataview-item.js.map +7 -1
  284. package/build/components/sidebar-dataviews/index.js +68 -54
  285. package/build/components/sidebar-dataviews/index.js.map +7 -1
  286. package/build/components/sidebar-global-styles-wrapper/index.js +125 -111
  287. package/build/components/sidebar-global-styles-wrapper/index.js.map +7 -1
  288. package/build/components/sidebar-navigation-item/index.js +79 -62
  289. package/build/components/sidebar-navigation-item/index.js.map +7 -1
  290. package/build/components/sidebar-navigation-screen/index.js +129 -104
  291. package/build/components/sidebar-navigation-screen/index.js.map +7 -1
  292. package/build/components/sidebar-navigation-screen-details-footer/index.js +63 -53
  293. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +7 -1
  294. package/build/components/sidebar-navigation-screen-global-styles/content.js +50 -33
  295. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +7 -1
  296. package/build/components/sidebar-navigation-screen-global-styles/index.js +94 -81
  297. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +7 -1
  298. package/build/components/sidebar-navigation-screen-main/index.js +141 -90
  299. package/build/components/sidebar-navigation-screen-main/index.js.map +7 -1
  300. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +40 -29
  301. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +7 -1
  302. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +124 -91
  303. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +7 -1
  304. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +116 -83
  305. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +7 -1
  306. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +57 -48
  307. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +7 -1
  308. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +80 -66
  309. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +7 -1
  310. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +64 -38
  311. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +7 -1
  312. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +125 -96
  313. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +7 -1
  314. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +33 -19
  315. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +7 -1
  316. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +30 -16
  317. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +7 -1
  318. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +119 -105
  319. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +7 -1
  320. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +130 -121
  321. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +7 -1
  322. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +106 -88
  323. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +7 -1
  324. package/build/components/sidebar-navigation-screen-patterns/category-item.js +44 -21
  325. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +7 -1
  326. package/build/components/sidebar-navigation-screen-patterns/index.js +129 -106
  327. package/build/components/sidebar-navigation-screen-patterns/index.js.map +7 -1
  328. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +36 -25
  329. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +7 -1
  330. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +81 -70
  331. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +7 -1
  332. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +42 -32
  333. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +7 -1
  334. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +41 -28
  335. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +7 -1
  336. package/build/components/sidebar-navigation-screen-templates-browse/content.js +95 -76
  337. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +7 -1
  338. package/build/components/sidebar-navigation-screen-templates-browse/index.js +48 -27
  339. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +7 -1
  340. package/build/components/sidebar-navigation-screen-unsupported/index.js +28 -20
  341. package/build/components/sidebar-navigation-screen-unsupported/index.js.map +7 -1
  342. package/build/components/site-editor-routes/home.js +50 -32
  343. package/build/components/site-editor-routes/home.js.map +7 -1
  344. package/build/components/site-editor-routes/index.js +62 -36
  345. package/build/components/site-editor-routes/index.js.map +7 -1
  346. package/build/components/site-editor-routes/navigation-item.js +55 -49
  347. package/build/components/site-editor-routes/navigation-item.js.map +7 -1
  348. package/build/components/site-editor-routes/navigation.js +55 -49
  349. package/build/components/site-editor-routes/navigation.js.map +7 -1
  350. package/build/components/site-editor-routes/notfound.js +54 -34
  351. package/build/components/site-editor-routes/notfound.js.map +7 -1
  352. package/build/components/site-editor-routes/page-item.js +58 -41
  353. package/build/components/site-editor-routes/page-item.js.map +7 -1
  354. package/build/components/site-editor-routes/pages.js +96 -86
  355. package/build/components/site-editor-routes/pages.js.map +7 -1
  356. package/build/components/site-editor-routes/pattern-item.js +48 -26
  357. package/build/components/site-editor-routes/pattern-item.js.map +7 -1
  358. package/build/components/site-editor-routes/patterns.js +51 -36
  359. package/build/components/site-editor-routes/patterns.js.map +7 -1
  360. package/build/components/site-editor-routes/stylebook.js +60 -43
  361. package/build/components/site-editor-routes/stylebook.js.map +7 -1
  362. package/build/components/site-editor-routes/styles.js +58 -46
  363. package/build/components/site-editor-routes/styles.js.map +7 -1
  364. package/build/components/site-editor-routes/template-item.js +54 -34
  365. package/build/components/site-editor-routes/template-item.js.map +7 -1
  366. package/build/components/site-editor-routes/template-part-item.js +45 -21
  367. package/build/components/site-editor-routes/template-part-item.js.map +7 -1
  368. package/build/components/site-editor-routes/templates.js +69 -44
  369. package/build/components/site-editor-routes/templates.js.map +7 -1
  370. package/build/components/site-editor-routes/utils.js +27 -13
  371. package/build/components/site-editor-routes/utils.js.map +7 -1
  372. package/build/components/site-hub/index.js +233 -222
  373. package/build/components/site-hub/index.js.map +7 -1
  374. package/build/components/site-icon/index.js +61 -49
  375. package/build/components/site-icon/index.js.map +7 -1
  376. package/build/components/style-book/categories.js +61 -52
  377. package/build/components/style-book/categories.js.map +7 -1
  378. package/build/components/style-book/color-examples.js +54 -40
  379. package/build/components/style-book/color-examples.js.map +7 -1
  380. package/build/components/style-book/constants.js +218 -144
  381. package/build/components/style-book/constants.js.map +7 -1
  382. package/build/components/style-book/duotone-examples.js +54 -40
  383. package/build/components/style-book/duotone-examples.js.map +7 -1
  384. package/build/components/style-book/examples.js +145 -120
  385. package/build/components/style-book/examples.js.map +7 -1
  386. package/build/components/style-book/index.js +454 -409
  387. package/build/components/style-book/index.js.map +7 -1
  388. package/build/components/style-book/types.js +16 -5
  389. package/build/components/style-book/types.js.map +7 -1
  390. package/build/components/welcome-guide/editor.js +87 -60
  391. package/build/components/welcome-guide/editor.js.map +7 -1
  392. package/build/components/welcome-guide/image.js +34 -22
  393. package/build/components/welcome-guide/image.js.map +7 -1
  394. package/build/components/welcome-guide/index.js +44 -21
  395. package/build/components/welcome-guide/index.js.map +7 -1
  396. package/build/components/welcome-guide/page.js +76 -52
  397. package/build/components/welcome-guide/page.js.map +7 -1
  398. package/build/components/welcome-guide/styles.js +135 -102
  399. package/build/components/welcome-guide/styles.js.map +7 -1
  400. package/build/components/welcome-guide/template.js +71 -59
  401. package/build/components/welcome-guide/template.js.map +7 -1
  402. package/build/deprecated.js +56 -46
  403. package/build/deprecated.js.map +7 -1
  404. package/build/hooks/commands/use-common-commands.js +117 -119
  405. package/build/hooks/commands/use-common-commands.js.map +7 -1
  406. package/build/hooks/commands/use-set-command-context.js +40 -50
  407. package/build/hooks/commands/use-set-command-context.js.map +7 -1
  408. package/build/hooks/index.js +2 -3
  409. package/build/hooks/index.js.map +7 -1
  410. package/build/hooks/push-changes-to-global-styles/index.js +236 -251
  411. package/build/hooks/push-changes-to-global-styles/index.js.map +7 -1
  412. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +78 -111
  413. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +7 -1
  414. package/build/index.js +87 -112
  415. package/build/index.js.map +7 -1
  416. package/build/lock-unlock.js +31 -14
  417. package/build/lock-unlock.js.map +7 -1
  418. package/build/posts.js +67 -63
  419. package/build/posts.js.map +7 -1
  420. package/build/store/actions.js +199 -365
  421. package/build/store/actions.js.map +7 -1
  422. package/build/store/constants.js +27 -11
  423. package/build/store/constants.js.map +7 -1
  424. package/build/store/index.js +52 -30
  425. package/build/store/index.js.map +7 -1
  426. package/build/store/private-actions.js +34 -19
  427. package/build/store/private-actions.js.map +7 -1
  428. package/build/store/private-selectors.js +28 -13
  429. package/build/store/private-selectors.js.map +7 -1
  430. package/build/store/reducer.js +42 -57
  431. package/build/store/reducer.js.map +7 -1
  432. package/build/store/selectors.js +205 -301
  433. package/build/store/selectors.js.map +7 -1
  434. package/build/utils/constants.js +94 -53
  435. package/build/utils/constants.js.map +7 -1
  436. package/build/utils/get-filtered-template-parts.js +36 -42
  437. package/build/utils/get-filtered-template-parts.js.map +7 -1
  438. package/build/utils/is-previewing-theme.js +31 -13
  439. package/build/utils/is-previewing-theme.js.map +7 -1
  440. package/build/utils/is-template-removable.js +24 -17
  441. package/build/utils/is-template-removable.js.map +7 -1
  442. package/build/utils/is-template-revertable.js +24 -19
  443. package/build/utils/is-template-revertable.js.map +7 -1
  444. package/build/utils/set-nested-value.js +24 -25
  445. package/build/utils/set-nested-value.js.map +7 -1
  446. package/build/utils/template-part-create.js +1 -1
  447. package/build/utils/template-part-create.js.map +7 -1
  448. package/build/utils/use-activate-theme.js +40 -45
  449. package/build/utils/use-activate-theme.js.map +7 -1
  450. package/build/utils/use-actual-current-theme.js +47 -25
  451. package/build/utils/use-actual-current-theme.js.map +7 -1
  452. package/build-module/components/add-new-pattern/index.js +133 -127
  453. package/build-module/components/add-new-pattern/index.js.map +7 -1
  454. package/build-module/components/add-new-post/index.js +100 -82
  455. package/build-module/components/add-new-post/index.js.map +7 -1
  456. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +63 -51
  457. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +7 -1
  458. package/build-module/components/add-new-template/add-custom-template-modal-content.js +269 -196
  459. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +7 -1
  460. package/build-module/components/add-new-template/index.js +289 -219
  461. package/build-module/components/add-new-template/index.js.map +7 -1
  462. package/build-module/components/add-new-template/utils.js +430 -432
  463. package/build-module/components/add-new-template/utils.js.map +7 -1
  464. package/build-module/components/app/index.js +41 -51
  465. package/build-module/components/app/index.js.map +7 -1
  466. package/build-module/components/block-editor/use-editor-iframe-props.js +33 -58
  467. package/build-module/components/block-editor/use-editor-iframe-props.js.map +7 -1
  468. package/build-module/components/block-editor/use-navigate-to-entity-record.js +17 -18
  469. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +7 -1
  470. package/build-module/components/block-editor/use-site-editor-settings.js +28 -41
  471. package/build-module/components/block-editor/use-site-editor-settings.js.map +7 -1
  472. package/build-module/components/canvas-loader/index.js +25 -50
  473. package/build-module/components/canvas-loader/index.js.map +7 -1
  474. package/build-module/components/dataviews-actions/index.js +75 -78
  475. package/build-module/components/dataviews-actions/index.js.map +7 -1
  476. package/build-module/components/editor/index.js +261 -220
  477. package/build-module/components/editor/index.js.map +7 -1
  478. package/build-module/components/editor/site-preview.js +38 -38
  479. package/build-module/components/editor/site-preview.js.map +7 -1
  480. package/build-module/components/editor/use-adapt-editor-to-canvas.js +25 -24
  481. package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +7 -1
  482. package/build-module/components/editor/use-editor-title.js +49 -53
  483. package/build-module/components/editor/use-editor-title.js.map +7 -1
  484. package/build-module/components/editor/use-resolve-edited-entity.js +89 -129
  485. package/build-module/components/editor/use-resolve-edited-entity.js.map +7 -1
  486. package/build-module/components/editor-canvas-container/index.js +79 -80
  487. package/build-module/components/editor-canvas-container/index.js.map +7 -1
  488. package/build-module/components/global-styles/background-panel.js +25 -35
  489. package/build-module/components/global-styles/background-panel.js.map +7 -1
  490. package/build-module/components/global-styles/block-preview-panel.js +36 -43
  491. package/build-module/components/global-styles/block-preview-panel.js.map +7 -1
  492. package/build-module/components/global-styles/color-indicator-wrapper.js +19 -20
  493. package/build-module/components/global-styles/color-indicator-wrapper.js.map +7 -1
  494. package/build-module/components/global-styles/color-palette-panel.js +105 -74
  495. package/build-module/components/global-styles/color-palette-panel.js.map +7 -1
  496. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +20 -17
  497. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +7 -1
  498. package/build-module/components/global-styles/dimensions-panel.js +26 -34
  499. package/build-module/components/global-styles/dimensions-panel.js.map +7 -1
  500. package/build-module/components/global-styles/font-families.js +86 -93
  501. package/build-module/components/global-styles/font-families.js.map +7 -1
  502. package/build-module/components/global-styles/font-family-item.js +26 -37
  503. package/build-module/components/global-styles/font-family-item.js.map +7 -1
  504. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +26 -32
  505. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +7 -1
  506. package/build-module/components/global-styles/font-library-modal/context.js +203 -224
  507. package/build-module/components/global-styles/font-library-modal/context.js.map +7 -1
  508. package/build-module/components/global-styles/font-library-modal/font-card.js +48 -52
  509. package/build-module/components/global-styles/font-library-modal/font-card.js.map +7 -1
  510. package/build-module/components/global-styles/font-library-modal/font-collection.js +397 -302
  511. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +7 -1
  512. package/build-module/components/global-styles/font-library-modal/font-demo.js +32 -38
  513. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +7 -1
  514. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +41 -39
  515. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +7 -1
  516. package/build-module/components/global-styles/font-library-modal/index.js +65 -81
  517. package/build-module/components/global-styles/font-library-modal/index.js.map +7 -1
  518. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +354 -243
  519. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +7 -1
  520. package/build-module/components/global-styles/font-library-modal/library-font-details.js +35 -36
  521. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +7 -1
  522. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +35 -42
  523. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +7 -1
  524. package/build-module/components/global-styles/font-library-modal/resolvers.js +27 -20
  525. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +7 -1
  526. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +111 -135
  527. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +7 -1
  528. package/build-module/components/global-styles/font-library-modal/utils/constants.js +21 -19
  529. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +7 -1
  530. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +13 -24
  531. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +7 -1
  532. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +20 -10
  533. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +7 -1
  534. package/build-module/components/global-styles/font-library-modal/utils/index.js +102 -154
  535. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +7 -1
  536. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +8 -14
  537. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +7 -1
  538. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +34 -71
  539. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +7 -1
  540. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +11 -13
  541. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +7 -1
  542. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +22 -69
  543. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +7 -1
  544. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +26 -18
  545. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +7 -1
  546. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +20 -17
  547. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -1
  548. package/build-module/components/global-styles/font-sizes/font-size-preview.js +26 -29
  549. package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +7 -1
  550. package/build-module/components/global-styles/font-sizes/font-size.js +185 -160
  551. package/build-module/components/global-styles/font-sizes/font-size.js.map +7 -1
  552. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +23 -39
  553. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +7 -1
  554. package/build-module/components/global-styles/font-sizes/font-sizes.js +184 -128
  555. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +7 -1
  556. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +68 -52
  557. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +7 -1
  558. package/build-module/components/global-styles/gradients-palette-panel.js +117 -79
  559. package/build-module/components/global-styles/gradients-palette-panel.js.map +7 -1
  560. package/build-module/components/global-styles/header.js +40 -43
  561. package/build-module/components/global-styles/header.js.map +7 -1
  562. package/build-module/components/global-styles/highlighted-colors.js +31 -36
  563. package/build-module/components/global-styles/highlighted-colors.js.map +7 -1
  564. package/build-module/components/global-styles/hooks.js +56 -61
  565. package/build-module/components/global-styles/hooks.js.map +7 -1
  566. package/build-module/components/global-styles/icon-with-current-color.js +18 -19
  567. package/build-module/components/global-styles/icon-with-current-color.js.map +7 -1
  568. package/build-module/components/global-styles/index.js +5 -2
  569. package/build-module/components/global-styles/index.js.map +7 -1
  570. package/build-module/components/global-styles/navigation-button.js +23 -37
  571. package/build-module/components/global-styles/navigation-button.js.map +7 -1
  572. package/build-module/components/global-styles/palette.js +61 -67
  573. package/build-module/components/global-styles/palette.js.map +7 -1
  574. package/build-module/components/global-styles/preset-colors.js +19 -20
  575. package/build-module/components/global-styles/preset-colors.js.map +7 -1
  576. package/build-module/components/global-styles/preview-colors.js +43 -40
  577. package/build-module/components/global-styles/preview-colors.js.map +7 -1
  578. package/build-module/components/global-styles/preview-styles.js +158 -130
  579. package/build-module/components/global-styles/preview-styles.js.map +7 -1
  580. package/build-module/components/global-styles/preview-typography.js +37 -38
  581. package/build-module/components/global-styles/preview-typography.js.map +7 -1
  582. package/build-module/components/global-styles/preview-wrapper.js +51 -75
  583. package/build-module/components/global-styles/preview-wrapper.js.map +7 -1
  584. package/build-module/components/global-styles/root-menu.js +38 -44
  585. package/build-module/components/global-styles/root-menu.js.map +7 -1
  586. package/build-module/components/global-styles/screen-background.js +26 -29
  587. package/build-module/components/global-styles/screen-background.js.map +7 -1
  588. package/build-module/components/global-styles/screen-block-list.js +105 -105
  589. package/build-module/components/global-styles/screen-block-list.js.map +7 -1
  590. package/build-module/components/global-styles/screen-block.js +156 -169
  591. package/build-module/components/global-styles/screen-block.js.map +7 -1
  592. package/build-module/components/global-styles/screen-color-palette.js +33 -50
  593. package/build-module/components/global-styles/screen-color-palette.js.map +7 -1
  594. package/build-module/components/global-styles/screen-colors.js +35 -33
  595. package/build-module/components/global-styles/screen-colors.js.map +7 -1
  596. package/build-module/components/global-styles/screen-css.js +52 -44
  597. package/build-module/components/global-styles/screen-css.js.map +7 -1
  598. package/build-module/components/global-styles/screen-layout.js +17 -26
  599. package/build-module/components/global-styles/screen-layout.js.map +7 -1
  600. package/build-module/components/global-styles/screen-revisions/index.js +117 -105
  601. package/build-module/components/global-styles/screen-revisions/index.js.map +7 -1
  602. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +145 -158
  603. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +7 -1
  604. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +74 -75
  605. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +7 -1
  606. package/build-module/components/global-styles/screen-root.js +74 -77
  607. package/build-module/components/global-styles/screen-root.js.map +7 -1
  608. package/build-module/components/global-styles/screen-shadows.js +12 -11
  609. package/build-module/components/global-styles/screen-shadows.js.map +7 -1
  610. package/build-module/components/global-styles/screen-style-variations.js +38 -37
  611. package/build-module/components/global-styles/screen-style-variations.js.map +7 -1
  612. package/build-module/components/global-styles/screen-typography-element.js +122 -87
  613. package/build-module/components/global-styles/screen-typography-element.js.map +7 -1
  614. package/build-module/components/global-styles/screen-typography.js +36 -34
  615. package/build-module/components/global-styles/screen-typography.js.map +7 -1
  616. package/build-module/components/global-styles/shadow-utils.js +53 -176
  617. package/build-module/components/global-styles/shadow-utils.js.map +7 -1
  618. package/build-module/components/global-styles/shadows-edit-panel.js +426 -344
  619. package/build-module/components/global-styles/shadows-edit-panel.js.map +7 -1
  620. package/build-module/components/global-styles/shadows-panel.js +159 -124
  621. package/build-module/components/global-styles/shadows-panel.js.map +7 -1
  622. package/build-module/components/global-styles/size-control/index.js +57 -70
  623. package/build-module/components/global-styles/size-control/index.js.map +7 -1
  624. package/build-module/components/global-styles/style-variations-container.js +85 -95
  625. package/build-module/components/global-styles/style-variations-container.js.map +7 -1
  626. package/build-module/components/global-styles/subtitle.js +16 -16
  627. package/build-module/components/global-styles/subtitle.js.map +7 -1
  628. package/build-module/components/global-styles/typeset.js +50 -65
  629. package/build-module/components/global-styles/typeset.js.map +7 -1
  630. package/build-module/components/global-styles/typography-elements.js +86 -80
  631. package/build-module/components/global-styles/typography-elements.js.map +7 -1
  632. package/build-module/components/global-styles/typography-example.js +45 -57
  633. package/build-module/components/global-styles/typography-example.js.map +7 -1
  634. package/build-module/components/global-styles/typography-panel.js +38 -33
  635. package/build-module/components/global-styles/typography-panel.js.map +7 -1
  636. package/build-module/components/global-styles/typography-preview.js +55 -48
  637. package/build-module/components/global-styles/typography-preview.js.map +7 -1
  638. package/build-module/components/global-styles/ui.js +252 -295
  639. package/build-module/components/global-styles/ui.js.map +7 -1
  640. package/build-module/components/global-styles/utils.js +24 -28
  641. package/build-module/components/global-styles/utils.js.map +7 -1
  642. package/build-module/components/global-styles/variations/variation.js +59 -65
  643. package/build-module/components/global-styles/variations/variation.js.map +7 -1
  644. package/build-module/components/global-styles/variations/variations-color.js +26 -34
  645. package/build-module/components/global-styles/variations/variations-color.js.map +7 -1
  646. package/build-module/components/global-styles/variations/variations-panel.js +39 -46
  647. package/build-module/components/global-styles/variations/variations-panel.js.map +7 -1
  648. package/build-module/components/global-styles/variations/variations-typography.js +43 -42
  649. package/build-module/components/global-styles/variations/variations-typography.js.map +7 -1
  650. package/build-module/components/global-styles-renderer/index.js +16 -27
  651. package/build-module/components/global-styles-renderer/index.js.map +7 -1
  652. package/build-module/components/global-styles-sidebar/default-sidebar.js +36 -36
  653. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -1
  654. package/build-module/components/global-styles-sidebar/index.js +137 -133
  655. package/build-module/components/global-styles-sidebar/index.js.map +7 -1
  656. package/build-module/components/layout/animation.js +31 -69
  657. package/build-module/components/layout/animation.js.map +7 -1
  658. package/build-module/components/layout/hooks.js +16 -28
  659. package/build-module/components/layout/hooks.js.map +7 -1
  660. package/build-module/components/layout/index.js +199 -183
  661. package/build-module/components/layout/index.js.map +7 -1
  662. package/build-module/components/media/index.js +13 -21
  663. package/build-module/components/media/index.js.map +7 -1
  664. package/build-module/components/more-menu/index.js +18 -23
  665. package/build-module/components/more-menu/index.js.map +7 -1
  666. package/build-module/components/more-menu/site-export.js +41 -38
  667. package/build-module/components/more-menu/site-export.js.map +7 -1
  668. package/build-module/components/more-menu/welcome-guide-menu-item.js +12 -17
  669. package/build-module/components/more-menu/welcome-guide-menu-item.js.map +7 -1
  670. package/build-module/components/page-patterns/actions.js +52 -0
  671. package/build-module/components/page-patterns/actions.js.map +7 -0
  672. package/build-module/components/page-patterns/delete-category-menu-item.js +78 -76
  673. package/build-module/components/page-patterns/delete-category-menu-item.js.map +7 -1
  674. package/build-module/components/page-patterns/fields.js +103 -112
  675. package/build-module/components/page-patterns/fields.js.map +7 -1
  676. package/build-module/components/page-patterns/index.js +144 -120
  677. package/build-module/components/page-patterns/index.js.map +7 -1
  678. package/build-module/components/page-patterns/rename-category-menu-item.js +37 -53
  679. package/build-module/components/page-patterns/rename-category-menu-item.js.map +7 -1
  680. package/build-module/components/page-patterns/search-items.js +43 -77
  681. package/build-module/components/page-patterns/search-items.js.map +7 -1
  682. package/build-module/components/page-patterns/use-pattern-settings.js +27 -30
  683. package/build-module/components/page-patterns/use-pattern-settings.js.map +7 -1
  684. package/build-module/components/page-patterns/use-patterns.js +249 -192
  685. package/build-module/components/page-patterns/use-patterns.js.map +7 -1
  686. package/build-module/components/page-patterns/utils.js +5 -2
  687. package/build-module/components/page-patterns/utils.js.map +7 -1
  688. package/build-module/components/page-templates/fields.js +132 -147
  689. package/build-module/components/page-templates/fields.js.map +7 -1
  690. package/build-module/components/page-templates/hooks.js +44 -55
  691. package/build-module/components/page-templates/hooks.js.map +7 -1
  692. package/build-module/components/page-templates/index.js +189 -194
  693. package/build-module/components/page-templates/index.js.map +7 -1
  694. package/build-module/components/page-templates/view-utils.js +42 -0
  695. package/build-module/components/page-templates/view-utils.js.map +7 -0
  696. package/build-module/components/pagination/index.js +96 -77
  697. package/build-module/components/pagination/index.js.map +7 -1
  698. package/build-module/components/plugin-template-setting-panel/index.js +21 -50
  699. package/build-module/components/plugin-template-setting-panel/index.js.map +7 -1
  700. package/build-module/components/post-edit/index.js +136 -135
  701. package/build-module/components/post-edit/index.js.map +7 -1
  702. package/build-module/components/post-list/index.js +205 -291
  703. package/build-module/components/post-list/index.js.map +7 -1
  704. package/build-module/components/post-list/view-utils.js +149 -0
  705. package/build-module/components/post-list/view-utils.js.map +7 -0
  706. package/build-module/components/posts-app/index.js +15 -25
  707. package/build-module/components/posts-app/index.js.map +7 -1
  708. package/build-module/components/posts-app-routes/index.js +12 -18
  709. package/build-module/components/posts-app-routes/index.js.map +7 -1
  710. package/build-module/components/posts-app-routes/post-item.js +22 -29
  711. package/build-module/components/posts-app-routes/post-item.js.map +7 -1
  712. package/build-module/components/posts-app-routes/posts.js +59 -70
  713. package/build-module/components/posts-app-routes/posts.js.map +7 -1
  714. package/build-module/components/resizable-frame/index.js +169 -211
  715. package/build-module/components/resizable-frame/index.js.map +7 -1
  716. package/build-module/components/revisions/index.js +78 -64
  717. package/build-module/components/revisions/index.js.map +7 -1
  718. package/build-module/components/routes/use-title.js +25 -28
  719. package/build-module/components/routes/use-title.js.map +7 -1
  720. package/build-module/components/save-button/index.js +99 -104
  721. package/build-module/components/save-button/index.js.map +7 -1
  722. package/build-module/components/save-hub/index.js +23 -33
  723. package/build-module/components/save-hub/index.js.map +7 -1
  724. package/build-module/components/save-keyboard-shortcut/index.js +31 -47
  725. package/build-module/components/save-keyboard-shortcut/index.js.map +7 -1
  726. package/build-module/components/save-panel/index.js +125 -124
  727. package/build-module/components/save-panel/index.js.map +7 -1
  728. package/build-module/components/sidebar/index.js +47 -65
  729. package/build-module/components/sidebar/index.js.map +7 -1
  730. package/build-module/components/sidebar-button/index.js +16 -17
  731. package/build-module/components/sidebar-button/index.js.map +7 -1
  732. package/build-module/components/sidebar-dataviews/dataview-item.js +41 -50
  733. package/build-module/components/sidebar-dataviews/dataview-item.js.map +7 -1
  734. package/build-module/components/sidebar-dataviews/index.js +40 -48
  735. package/build-module/components/sidebar-dataviews/index.js.map +7 -1
  736. package/build-module/components/sidebar-global-styles-wrapper/index.js +100 -104
  737. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +7 -1
  738. package/build-module/components/sidebar-navigation-item/index.js +56 -57
  739. package/build-module/components/sidebar-navigation-item/index.js.map +7 -1
  740. package/build-module/components/sidebar-navigation-screen/index.js +108 -98
  741. package/build-module/components/sidebar-navigation-screen/index.js.map +7 -1
  742. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +36 -48
  743. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +7 -1
  744. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +23 -28
  745. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +7 -1
  746. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +61 -73
  747. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +7 -1
  748. package/build-module/components/sidebar-navigation-screen-main/index.js +108 -82
  749. package/build-module/components/sidebar-navigation-screen-main/index.js.map +7 -1
  750. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +22 -24
  751. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +7 -1
  752. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +92 -84
  753. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +7 -1
  754. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +87 -76
  755. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +7 -1
  756. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +28 -41
  757. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +7 -1
  758. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +67 -60
  759. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +7 -1
  760. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +37 -32
  761. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +7 -1
  762. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +107 -91
  763. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +7 -1
  764. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +14 -14
  765. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +7 -1
  766. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +8 -12
  767. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +7 -1
  768. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +89 -98
  769. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +7 -1
  770. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +113 -117
  771. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +7 -1
  772. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +82 -82
  773. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +7 -1
  774. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +17 -16
  775. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +7 -1
  776. package/build-module/components/sidebar-navigation-screen-patterns/index.js +108 -99
  777. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +7 -1
  778. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +19 -21
  779. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +7 -1
  780. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +53 -59
  781. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +7 -1
  782. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +27 -27
  783. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +7 -1
  784. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +24 -24
  785. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +7 -1
  786. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +67 -70
  787. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +7 -1
  788. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +20 -21
  789. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +7 -1
  790. package/build-module/components/sidebar-navigation-screen-unsupported/index.js +11 -16
  791. package/build-module/components/sidebar-navigation-screen-unsupported/index.js.map +7 -1
  792. package/build-module/components/site-editor-routes/home.js +18 -26
  793. package/build-module/components/site-editor-routes/home.js.map +7 -1
  794. package/build-module/components/site-editor-routes/index.js +39 -30
  795. package/build-module/components/site-editor-routes/index.js.map +7 -1
  796. package/build-module/components/site-editor-routes/navigation-item.js +23 -43
  797. package/build-module/components/site-editor-routes/navigation-item.js.map +7 -1
  798. package/build-module/components/site-editor-routes/navigation.js +23 -43
  799. package/build-module/components/site-editor-routes/navigation.js.map +7 -1
  800. package/build-module/components/site-editor-routes/notfound.js +22 -28
  801. package/build-module/components/site-editor-routes/notfound.js.map +7 -1
  802. package/build-module/components/site-editor-routes/page-item.js +26 -35
  803. package/build-module/components/site-editor-routes/page-item.js.map +7 -1
  804. package/build-module/components/site-editor-routes/pages.js +64 -80
  805. package/build-module/components/site-editor-routes/pages.js.map +7 -1
  806. package/build-module/components/site-editor-routes/pattern-item.js +16 -20
  807. package/build-module/components/site-editor-routes/pattern-item.js.map +7 -1
  808. package/build-module/components/site-editor-routes/patterns.js +19 -30
  809. package/build-module/components/site-editor-routes/patterns.js.map +7 -1
  810. package/build-module/components/site-editor-routes/stylebook.js +28 -37
  811. package/build-module/components/site-editor-routes/stylebook.js.map +7 -1
  812. package/build-module/components/site-editor-routes/styles.js +26 -40
  813. package/build-module/components/site-editor-routes/styles.js.map +7 -1
  814. package/build-module/components/site-editor-routes/template-item.js +21 -28
  815. package/build-module/components/site-editor-routes/template-item.js.map +7 -1
  816. package/build-module/components/site-editor-routes/template-part-item.js +13 -15
  817. package/build-module/components/site-editor-routes/template-part-item.js.map +7 -1
  818. package/build-module/components/site-editor-routes/templates.js +37 -38
  819. package/build-module/components/site-editor-routes/templates.js.map +7 -1
  820. package/build-module/components/site-editor-routes/utils.js +6 -10
  821. package/build-module/components/site-editor-routes/utils.js.map +7 -1
  822. package/build-module/components/site-hub/index.js +204 -215
  823. package/build-module/components/site-hub/index.js.map +7 -1
  824. package/build-module/components/site-icon/index.js +33 -43
  825. package/build-module/components/site-icon/index.js.map +7 -1
  826. package/build-module/components/style-book/categories.js +41 -48
  827. package/build-module/components/style-book/categories.js.map +7 -1
  828. package/build-module/components/style-book/color-examples.js +29 -37
  829. package/build-module/components/style-book/color-examples.js.map +7 -1
  830. package/build-module/components/style-book/constants.js +191 -140
  831. package/build-module/components/style-book/constants.js.map +7 -1
  832. package/build-module/components/style-book/duotone-examples.js +36 -35
  833. package/build-module/components/style-book/duotone-examples.js.map +7 -1
  834. package/build-module/components/style-book/examples.js +114 -116
  835. package/build-module/components/style-book/examples.js.map +7 -1
  836. package/build-module/components/style-book/index.js +431 -384
  837. package/build-module/components/style-book/index.js.map +7 -1
  838. package/build-module/components/style-book/types.js +1 -2
  839. package/build-module/components/style-book/types.js.map +7 -1
  840. package/build-module/components/welcome-guide/editor.js +59 -54
  841. package/build-module/components/welcome-guide/editor.js.map +7 -1
  842. package/build-module/components/welcome-guide/image.js +16 -18
  843. package/build-module/components/welcome-guide/image.js.map +7 -1
  844. package/build-module/components/welcome-guide/index.js +16 -15
  845. package/build-module/components/welcome-guide/index.js.map +7 -1
  846. package/build-module/components/welcome-guide/page.js +59 -48
  847. package/build-module/components/welcome-guide/page.js.map +7 -1
  848. package/build-module/components/welcome-guide/styles.js +108 -97
  849. package/build-module/components/welcome-guide/styles.js.map +7 -1
  850. package/build-module/components/welcome-guide/template.js +54 -55
  851. package/build-module/components/welcome-guide/template.js.map +7 -1
  852. package/build-module/deprecated.js +28 -40
  853. package/build-module/deprecated.js.map +7 -1
  854. package/build-module/hooks/commands/use-common-commands.js +89 -108
  855. package/build-module/hooks/commands/use-common-commands.js.map +7 -1
  856. package/build-module/hooks/commands/use-set-command-context.js +21 -44
  857. package/build-module/hooks/commands/use-set-command-context.js.map +7 -1
  858. package/build-module/hooks/index.js +2 -5
  859. package/build-module/hooks/index.js.map +7 -1
  860. package/build-module/hooks/push-changes-to-global-styles/index.js +218 -243
  861. package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -1
  862. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +56 -105
  863. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +7 -1
  864. package/build-module/index.js +55 -69
  865. package/build-module/index.js.map +7 -1
  866. package/build-module/lock-unlock.js +8 -7
  867. package/build-module/lock-unlock.js.map +7 -1
  868. package/build-module/posts.js +38 -54
  869. package/build-module/posts.js.map +7 -1
  870. package/build-module/store/actions.js +140 -320
  871. package/build-module/store/actions.js.map +7 -1
  872. package/build-module/store/constants.js +5 -7
  873. package/build-module/store/constants.js.map +7 -1
  874. package/build-module/store/index.js +15 -18
  875. package/build-module/store/index.js.map +7 -1
  876. package/build-module/store/private-actions.js +12 -14
  877. package/build-module/store/private-actions.js.map +7 -1
  878. package/build-module/store/private-selectors.js +7 -10
  879. package/build-module/store/private-selectors.js.map +7 -1
  880. package/build-module/store/reducer.js +21 -53
  881. package/build-module/store/reducer.js.map +7 -1
  882. package/build-module/store/selectors.js +151 -278
  883. package/build-module/store/selectors.js.map +7 -1
  884. package/build-module/utils/constants.js +53 -44
  885. package/build-module/utils/constants.js.map +7 -1
  886. package/build-module/utils/get-filtered-template-parts.js +18 -37
  887. package/build-module/utils/get-filtered-template-parts.js.map +7 -1
  888. package/build-module/utils/is-previewing-theme.js +10 -9
  889. package/build-module/utils/is-previewing-theme.js.map +7 -1
  890. package/build-module/utils/is-template-removable.js +6 -13
  891. package/build-module/utils/is-template-removable.js.map +7 -1
  892. package/build-module/utils/is-template-revertable.js +6 -15
  893. package/build-module/utils/is-template-revertable.js.map +7 -1
  894. package/build-module/utils/set-nested-value.js +7 -22
  895. package/build-module/utils/set-nested-value.js.map +7 -1
  896. package/build-module/utils/template-part-create.js +1 -2
  897. package/build-module/utils/template-part-create.js.map +7 -1
  898. package/build-module/utils/use-activate-theme.js +21 -40
  899. package/build-module/utils/use-activate-theme.js.map +7 -1
  900. package/build-module/utils/use-actual-current-theme.js +13 -17
  901. package/build-module/utils/use-actual-current-theme.js.map +7 -1
  902. package/build-style/posts-rtl.css +484 -214
  903. package/build-style/posts.css +484 -214
  904. package/build-style/style-rtl.css +629 -271
  905. package/build-style/style.css +629 -271
  906. package/package.json +52 -42
  907. package/src/components/add-new-post/index.js +2 -1
  908. package/src/components/add-new-template/index.js +7 -4
  909. package/src/components/add-new-template/style.scss +4 -0
  910. package/src/components/dataviews-actions/index.js +16 -9
  911. package/src/components/editor/index.js +1 -1
  912. package/src/components/editor/style.scss +3 -0
  913. package/src/components/editor/use-resolve-edited-entity.js +4 -18
  914. package/src/components/editor-canvas-container/style.scss +4 -1
  915. package/src/components/global-styles/font-library-modal/style.scss +4 -0
  916. package/src/components/global-styles/screen-revisions/style.scss +4 -0
  917. package/src/components/global-styles/style.scss +3 -0
  918. package/src/components/global-styles/variations/style.scss +3 -0
  919. package/src/components/global-styles-sidebar/style.scss +3 -0
  920. package/src/components/layout/index.js +2 -1
  921. package/src/components/layout/style.scss +5 -0
  922. package/src/components/page-patterns/actions.js +54 -0
  923. package/src/components/page-patterns/index.js +79 -32
  924. package/src/components/page-patterns/style.scss +4 -0
  925. package/src/components/page-templates/fields.js +22 -1
  926. package/src/components/page-templates/index.js +71 -104
  927. package/src/components/page-templates/style.scss +4 -0
  928. package/src/components/page-templates/view-utils.js +41 -0
  929. package/src/components/pagination/style.scss +2 -0
  930. package/src/components/post-edit/index.js +10 -4
  931. package/src/components/post-edit/style.scss +3 -6
  932. package/src/components/post-list/index.js +76 -188
  933. package/src/components/post-list/style.scss +3 -0
  934. package/src/components/post-list/view-utils.js +155 -0
  935. package/src/components/posts-app-routes/posts.js +29 -16
  936. package/src/components/resizable-frame/style.scss +3 -0
  937. package/src/components/save-hub/style.scss +3 -0
  938. package/src/components/save-panel/index.js +2 -2
  939. package/src/components/save-panel/style.scss +2 -0
  940. package/src/components/sidebar/style.scss +4 -0
  941. package/src/components/sidebar-button/style.scss +2 -0
  942. package/src/components/sidebar-dataviews/dataview-item.js +5 -11
  943. package/src/components/sidebar-dataviews/index.js +17 -17
  944. package/src/components/sidebar-dataviews/style.scss +2 -16
  945. package/src/components/sidebar-global-styles-wrapper/index.js +16 -21
  946. package/src/components/sidebar-global-styles-wrapper/style.scss +4 -30
  947. package/src/components/sidebar-navigation-item/style.scss +3 -0
  948. package/src/components/sidebar-navigation-screen/style.scss +5 -0
  949. package/src/components/sidebar-navigation-screen-main/style.scss +2 -0
  950. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -0
  951. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +3 -0
  952. package/src/components/sidebar-navigation-screen-patterns/style.scss +3 -0
  953. package/src/components/sidebar-navigation-screen-templates-browse/style.scss +2 -0
  954. package/src/components/site-editor-routes/pages.js +29 -16
  955. package/src/components/site-editor-routes/templates.js +21 -4
  956. package/src/components/site-hub/style.scss +3 -0
  957. package/src/components/site-icon/style.scss +3 -0
  958. package/src/components/style-book/style.scss +3 -0
  959. package/src/components/welcome-guide/style.scss +2 -0
  960. package/src/posts.scss +14 -11
  961. package/src/style.scss +42 -39
  962. package/tsconfig.json +2 -0
  963. package/tsconfig.tsbuildinfo +1 -1
  964. package/build/components/page/header.js +0 -45
  965. package/build/components/page/header.js.map +0 -1
  966. package/build/components/page/index.js +0 -50
  967. package/build/components/page/index.js.map +0 -1
  968. package/build/components/page-patterns/header.js +0 -96
  969. package/build/components/page-patterns/header.js.map +0 -1
  970. package/build/components/sidebar-dataviews/add-new-view.js +0 -137
  971. package/build/components/sidebar-dataviews/add-new-view.js.map +0 -1
  972. package/build/components/sidebar-dataviews/custom-dataviews-list.js +0 -211
  973. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +0 -1
  974. package/build/components/sidebar-dataviews/default-views.js +0 -141
  975. package/build/components/sidebar-dataviews/default-views.js.map +0 -1
  976. package/build-module/components/page/header.js +0 -40
  977. package/build-module/components/page/header.js.map +0 -1
  978. package/build-module/components/page/index.js +0 -42
  979. package/build-module/components/page/index.js.map +0 -1
  980. package/build-module/components/page-patterns/header.js +0 -88
  981. package/build-module/components/page-patterns/header.js.map +0 -1
  982. package/build-module/components/sidebar-dataviews/add-new-view.js +0 -129
  983. package/build-module/components/sidebar-dataviews/add-new-view.js.map +0 -1
  984. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +0 -202
  985. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +0 -1
  986. package/build-module/components/sidebar-dataviews/default-views.js +0 -133
  987. package/build-module/components/sidebar-dataviews/default-views.js.map +0 -1
  988. package/src/components/page/header.js +0 -44
  989. package/src/components/page/index.js +0 -43
  990. package/src/components/page/style.scss +0 -56
  991. package/src/components/page-patterns/header.js +0 -120
  992. package/src/components/sidebar-dataviews/add-new-view.js +0 -143
  993. package/src/components/sidebar-dataviews/custom-dataviews-list.js +0 -233
  994. package/src/components/sidebar-dataviews/default-views.js +0 -168
@@ -1,17 +1,14 @@
1
1
  function findNearest(input, numbers) {
2
- // If the numbers array is empty, return null
3
2
  if (numbers.length === 0) {
4
3
  return null;
5
4
  }
6
- // Sort the array based on the absolute difference with the input
7
5
  numbers.sort((a, b) => Math.abs(input - a) - Math.abs(input - b));
8
- // Return the first element (which will be the nearest) from the sorted array
9
6
  return numbers[0];
10
7
  }
11
8
  function extractFontWeights(fontFaces) {
12
9
  const result = [];
13
- fontFaces.forEach(face => {
14
- const weights = String(face.fontWeight).split(' ');
10
+ fontFaces.forEach((face) => {
11
+ const weights = String(face.fontWeight).split(" ");
15
12
  if (weights.length === 2) {
16
13
  const start = parseInt(weights[0]);
17
14
  const end = parseInt(weights[1]);
@@ -24,104 +21,70 @@ function extractFontWeights(fontFaces) {
24
21
  });
25
22
  return result;
26
23
  }
27
-
28
- /*
29
- * Format the font family to use in the CSS font-family property of a CSS rule.
30
- *
31
- * The input can be a string with the font family name or a string with multiple font family names separated by commas.
32
- * It follows the recommendations from the CSS Fonts Module Level 4.
33
- * https://www.w3.org/TR/css-fonts-4/#font-family-prop
34
- *
35
- * @param {string} input - The font family.
36
- * @return {string} The formatted font family.
37
- *
38
- * Example:
39
- * formatFontFamily( "Open Sans, Font+Name, sans-serif" ) => '"Open Sans", "Font+Name", sans-serif'
40
- * formatFontFamily( "'Open Sans', generic(kai), sans-serif" ) => '"Open Sans", sans-serif'
41
- * formatFontFamily( "DotGothic16, Slabo 27px, serif" ) => '"DotGothic16","Slabo 27px",serif'
42
- * formatFontFamily( "Mine's, Moe's Typography" ) => `"mine's","Moe's Typography"`
43
- */
44
- export function formatFontFamily(input) {
45
- // Matches strings that are not exclusively alphabetic characters or hyphens, and do not exactly follow the pattern generic(alphabetic characters or hyphens).
24
+ function formatFontFamily(input) {
46
25
  const regex = /^(?!generic\([ a-zA-Z\-]+\)$)(?!^[a-zA-Z\-]+$).+/;
47
26
  const output = input.trim();
48
- const formatItem = item => {
27
+ const formatItem = (item) => {
49
28
  item = item.trim();
50
29
  if (item.match(regex)) {
51
- // removes leading and trailing quotes.
52
- item = item.replace(/^["']|["']$/g, '');
30
+ item = item.replace(/^["']|["']$/g, "");
53
31
  return `"${item}"`;
54
32
  }
55
33
  return item;
56
34
  };
57
- if (output.includes(',')) {
58
- return output.split(',').map(formatItem).filter(item => item !== '').join(', ');
35
+ if (output.includes(",")) {
36
+ return output.split(",").map(formatItem).filter((item) => item !== "").join(", ");
59
37
  }
60
38
  return formatItem(output);
61
39
  }
62
-
63
- /*
64
- * Format the font face name to use in the font-family property of a font face.
65
- *
66
- * The input can be a string with the font face name or a string with multiple font face names separated by commas.
67
- * It removes the leading and trailing quotes from the font face name.
68
- *
69
- * @param {string} input - The font face name.
70
- * @return {string} The formatted font face name.
71
- *
72
- * Example:
73
- * formatFontFaceName("Open Sans") => "Open Sans"
74
- * formatFontFaceName("'Open Sans', sans-serif") => "Open Sans"
75
- * formatFontFaceName(", 'Open Sans', 'Helvetica Neue', sans-serif") => "Open Sans"
76
- */
77
- export function formatFontFaceName(input) {
40
+ function formatFontFaceName(input) {
78
41
  if (!input) {
79
- return '';
42
+ return "";
80
43
  }
81
44
  let output = input.trim();
82
- if (output.includes(',')) {
83
- output = output.split(',')
84
- // finds the first item that is not an empty string.
85
- .find(item => item.trim() !== '').trim();
45
+ if (output.includes(",")) {
46
+ output = output.split(",").find((item) => item.trim() !== "").trim();
86
47
  }
87
- // removes leading and trailing quotes.
88
- output = output.replace(/^["']|["']$/g, '');
89
-
90
- // Firefox needs the font name to be wrapped in double quotes meanwhile other browsers don't.
91
- if (window.navigator.userAgent.toLowerCase().includes('firefox')) {
48
+ output = output.replace(/^["']|["']$/g, "");
49
+ if (window.navigator.userAgent.toLowerCase().includes("firefox")) {
92
50
  output = `"${output}"`;
93
51
  }
94
52
  return output;
95
53
  }
96
- export function getFamilyPreviewStyle(family) {
97
- const style = {
98
- fontFamily: formatFontFamily(family.fontFamily)
99
- };
54
+ function getFamilyPreviewStyle(family) {
55
+ const style = { fontFamily: formatFontFamily(family.fontFamily) };
100
56
  if (!Array.isArray(family.fontFace)) {
101
- style.fontWeight = '400';
102
- style.fontStyle = 'normal';
57
+ style.fontWeight = "400";
58
+ style.fontStyle = "normal";
103
59
  return style;
104
60
  }
105
61
  if (family.fontFace) {
106
- //get all the font faces with normal style
107
- const normalFaces = family.fontFace.filter(face => face?.fontStyle && face.fontStyle.toLowerCase() === 'normal');
62
+ const normalFaces = family.fontFace.filter(
63
+ (face) => face?.fontStyle && face.fontStyle.toLowerCase() === "normal"
64
+ );
108
65
  if (normalFaces.length > 0) {
109
- style.fontStyle = 'normal';
66
+ style.fontStyle = "normal";
110
67
  const normalWeights = extractFontWeights(normalFaces);
111
68
  const nearestWeight = findNearest(400, normalWeights);
112
- style.fontWeight = String(nearestWeight) || '400';
69
+ style.fontWeight = String(nearestWeight) || "400";
113
70
  } else {
114
- style.fontStyle = family.fontFace.length && family.fontFace[0].fontStyle || 'normal';
115
- style.fontWeight = family.fontFace.length && String(family.fontFace[0].fontWeight) || '400';
71
+ style.fontStyle = family.fontFace.length && family.fontFace[0].fontStyle || "normal";
72
+ style.fontWeight = family.fontFace.length && String(family.fontFace[0].fontWeight) || "400";
116
73
  }
117
74
  }
118
75
  return style;
119
76
  }
120
- export function getFacePreviewStyle(face) {
77
+ function getFacePreviewStyle(face) {
121
78
  return {
122
79
  fontFamily: formatFontFamily(face.fontFamily),
123
- fontStyle: face.fontStyle || 'normal',
124
- fontWeight: face.fontWeight || '400'
80
+ fontStyle: face.fontStyle || "normal",
81
+ fontWeight: face.fontWeight || "400"
125
82
  };
126
83
  }
127
- //# sourceMappingURL=preview-styles.js.map
84
+ export {
85
+ formatFontFaceName,
86
+ formatFontFamily,
87
+ getFacePreviewStyle,
88
+ getFamilyPreviewStyle
89
+ };
90
+ //# sourceMappingURL=preview-styles.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["findNearest","input","numbers","length","sort","a","b","Math","abs","extractFontWeights","fontFaces","result","forEach","face","weights","String","fontWeight","split","start","parseInt","end","i","push","formatFontFamily","regex","output","trim","formatItem","item","match","replace","includes","map","filter","join","formatFontFaceName","find","window","navigator","userAgent","toLowerCase","getFamilyPreviewStyle","family","style","fontFamily","Array","isArray","fontFace","fontStyle","normalFaces","normalWeights","nearestWeight","getFacePreviewStyle"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/utils/preview-styles.js"],"sourcesContent":["function findNearest( input, numbers ) {\n\t// If the numbers array is empty, return null\n\tif ( numbers.length === 0 ) {\n\t\treturn null;\n\t}\n\t// Sort the array based on the absolute difference with the input\n\tnumbers.sort( ( a, b ) => Math.abs( input - a ) - Math.abs( input - b ) );\n\t// Return the first element (which will be the nearest) from the sorted array\n\treturn numbers[ 0 ];\n}\n\nfunction extractFontWeights( fontFaces ) {\n\tconst result = [];\n\n\tfontFaces.forEach( ( face ) => {\n\t\tconst weights = String( face.fontWeight ).split( ' ' );\n\n\t\tif ( weights.length === 2 ) {\n\t\t\tconst start = parseInt( weights[ 0 ] );\n\t\t\tconst end = parseInt( weights[ 1 ] );\n\n\t\t\tfor ( let i = start; i <= end; i += 100 ) {\n\t\t\t\tresult.push( i );\n\t\t\t}\n\t\t} else if ( weights.length === 1 ) {\n\t\t\tresult.push( parseInt( weights[ 0 ] ) );\n\t\t}\n\t} );\n\n\treturn result;\n}\n\n/*\n * Format the font family to use in the CSS font-family property of a CSS rule.\n *\n * The input can be a string with the font family name or a string with multiple font family names separated by commas.\n * It follows the recommendations from the CSS Fonts Module Level 4.\n * https://www.w3.org/TR/css-fonts-4/#font-family-prop\n *\n * @param {string} input - The font family.\n * @return {string} The formatted font family.\n *\n * Example:\n * formatFontFamily( \"Open Sans, Font+Name, sans-serif\" ) => '\"Open Sans\", \"Font+Name\", sans-serif'\n * formatFontFamily( \"'Open Sans', generic(kai), sans-serif\" ) => '\"Open Sans\", sans-serif'\n * formatFontFamily( \"DotGothic16, Slabo 27px, serif\" ) => '\"DotGothic16\",\"Slabo 27px\",serif'\n * formatFontFamily( \"Mine's, Moe's Typography\" ) => `\"mine's\",\"Moe's Typography\"`\n */\nexport function formatFontFamily( input ) {\n\t// Matches strings that are not exclusively alphabetic characters or hyphens, and do not exactly follow the pattern generic(alphabetic characters or hyphens).\n\tconst regex = /^(?!generic\\([ a-zA-Z\\-]+\\)$)(?!^[a-zA-Z\\-]+$).+/;\n\tconst output = input.trim();\n\n\tconst formatItem = ( item ) => {\n\t\titem = item.trim();\n\t\tif ( item.match( regex ) ) {\n\t\t\t// removes leading and trailing quotes.\n\t\t\titem = item.replace( /^[\"']|[\"']$/g, '' );\n\t\t\treturn `\"${ item }\"`;\n\t\t}\n\t\treturn item;\n\t};\n\n\tif ( output.includes( ',' ) ) {\n\t\treturn output\n\t\t\t.split( ',' )\n\t\t\t.map( formatItem )\n\t\t\t.filter( ( item ) => item !== '' )\n\t\t\t.join( ', ' );\n\t}\n\n\treturn formatItem( output );\n}\n\n/*\n * Format the font face name to use in the font-family property of a font face.\n *\n * The input can be a string with the font face name or a string with multiple font face names separated by commas.\n * It removes the leading and trailing quotes from the font face name.\n *\n * @param {string} input - The font face name.\n * @return {string} The formatted font face name.\n *\n * Example:\n * formatFontFaceName(\"Open Sans\") => \"Open Sans\"\n * formatFontFaceName(\"'Open Sans', sans-serif\") => \"Open Sans\"\n * formatFontFaceName(\", 'Open Sans', 'Helvetica Neue', sans-serif\") => \"Open Sans\"\n */\nexport function formatFontFaceName( input ) {\n\tif ( ! input ) {\n\t\treturn '';\n\t}\n\n\tlet output = input.trim();\n\tif ( output.includes( ',' ) ) {\n\t\toutput = output\n\t\t\t.split( ',' )\n\t\t\t// finds the first item that is not an empty string.\n\t\t\t.find( ( item ) => item.trim() !== '' )\n\t\t\t.trim();\n\t}\n\t// removes leading and trailing quotes.\n\toutput = output.replace( /^[\"']|[\"']$/g, '' );\n\n\t// Firefox needs the font name to be wrapped in double quotes meanwhile other browsers don't.\n\tif ( window.navigator.userAgent.toLowerCase().includes( 'firefox' ) ) {\n\t\toutput = `\"${ output }\"`;\n\t}\n\treturn output;\n}\n\nexport function getFamilyPreviewStyle( family ) {\n\tconst style = { fontFamily: formatFontFamily( family.fontFamily ) };\n\n\tif ( ! Array.isArray( family.fontFace ) ) {\n\t\tstyle.fontWeight = '400';\n\t\tstyle.fontStyle = 'normal';\n\t\treturn style;\n\t}\n\n\tif ( family.fontFace ) {\n\t\t//get all the font faces with normal style\n\t\tconst normalFaces = family.fontFace.filter(\n\t\t\t( face ) =>\n\t\t\t\tface?.fontStyle && face.fontStyle.toLowerCase() === 'normal'\n\t\t);\n\t\tif ( normalFaces.length > 0 ) {\n\t\t\tstyle.fontStyle = 'normal';\n\t\t\tconst normalWeights = extractFontWeights( normalFaces );\n\t\t\tconst nearestWeight = findNearest( 400, normalWeights );\n\t\t\tstyle.fontWeight = String( nearestWeight ) || '400';\n\t\t} else {\n\t\t\tstyle.fontStyle =\n\t\t\t\t( family.fontFace.length && family.fontFace[ 0 ].fontStyle ) ||\n\t\t\t\t'normal';\n\t\t\tstyle.fontWeight =\n\t\t\t\t( family.fontFace.length &&\n\t\t\t\t\tString( family.fontFace[ 0 ].fontWeight ) ) ||\n\t\t\t\t'400';\n\t\t}\n\t}\n\n\treturn style;\n}\n\nexport function getFacePreviewStyle( face ) {\n\treturn {\n\t\tfontFamily: formatFontFamily( face.fontFamily ),\n\t\tfontStyle: face.fontStyle || 'normal',\n\t\tfontWeight: face.fontWeight || '400',\n\t};\n}\n"],"mappings":"AAAA,SAASA,WAAWA,CAAEC,KAAK,EAAEC,OAAO,EAAG;EACtC;EACA,IAAKA,OAAO,CAACC,MAAM,KAAK,CAAC,EAAG;IAC3B,OAAO,IAAI;EACZ;EACA;EACAD,OAAO,CAACE,IAAI,CAAE,CAAEC,CAAC,EAAEC,CAAC,KAAMC,IAAI,CAACC,GAAG,CAAEP,KAAK,GAAGI,CAAE,CAAC,GAAGE,IAAI,CAACC,GAAG,CAAEP,KAAK,GAAGK,CAAE,CAAE,CAAC;EACzE;EACA,OAAOJ,OAAO,CAAE,CAAC,CAAE;AACpB;AAEA,SAASO,kBAAkBA,CAAEC,SAAS,EAAG;EACxC,MAAMC,MAAM,GAAG,EAAE;EAEjBD,SAAS,CAACE,OAAO,CAAIC,IAAI,IAAM;IAC9B,MAAMC,OAAO,GAAGC,MAAM,CAAEF,IAAI,CAACG,UAAW,CAAC,CAACC,KAAK,CAAE,GAAI,CAAC;IAEtD,IAAKH,OAAO,CAACX,MAAM,KAAK,CAAC,EAAG;MAC3B,MAAMe,KAAK,GAAGC,QAAQ,CAAEL,OAAO,CAAE,CAAC,CAAG,CAAC;MACtC,MAAMM,GAAG,GAAGD,QAAQ,CAAEL,OAAO,CAAE,CAAC,CAAG,CAAC;MAEpC,KAAM,IAAIO,CAAC,GAAGH,KAAK,EAAEG,CAAC,IAAID,GAAG,EAAEC,CAAC,IAAI,GAAG,EAAG;QACzCV,MAAM,CAACW,IAAI,CAAED,CAAE,CAAC;MACjB;IACD,CAAC,MAAM,IAAKP,OAAO,CAACX,MAAM,KAAK,CAAC,EAAG;MAClCQ,MAAM,CAACW,IAAI,CAAEH,QAAQ,CAAEL,OAAO,CAAE,CAAC,CAAG,CAAE,CAAC;IACxC;EACD,CAAE,CAAC;EAEH,OAAOH,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASY,gBAAgBA,CAAEtB,KAAK,EAAG;EACzC;EACA,MAAMuB,KAAK,GAAG,kDAAkD;EAChE,MAAMC,MAAM,GAAGxB,KAAK,CAACyB,IAAI,CAAC,CAAC;EAE3B,MAAMC,UAAU,GAAKC,IAAI,IAAM;IAC9BA,IAAI,GAAGA,IAAI,CAACF,IAAI,CAAC,CAAC;IAClB,IAAKE,IAAI,CAACC,KAAK,CAAEL,KAAM,CAAC,EAAG;MAC1B;MACAI,IAAI,GAAGA,IAAI,CAACE,OAAO,CAAE,cAAc,EAAE,EAAG,CAAC;MACzC,OAAO,IAAKF,IAAI,GAAI;IACrB;IACA,OAAOA,IAAI;EACZ,CAAC;EAED,IAAKH,MAAM,CAACM,QAAQ,CAAE,GAAI,CAAC,EAAG;IAC7B,OAAON,MAAM,CACXR,KAAK,CAAE,GAAI,CAAC,CACZe,GAAG,CAAEL,UAAW,CAAC,CACjBM,MAAM,CAAIL,IAAI,IAAMA,IAAI,KAAK,EAAG,CAAC,CACjCM,IAAI,CAAE,IAAK,CAAC;EACf;EAEA,OAAOP,UAAU,CAAEF,MAAO,CAAC;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,kBAAkBA,CAAElC,KAAK,EAAG;EAC3C,IAAK,CAAEA,KAAK,EAAG;IACd,OAAO,EAAE;EACV;EAEA,IAAIwB,MAAM,GAAGxB,KAAK,CAACyB,IAAI,CAAC,CAAC;EACzB,IAAKD,MAAM,CAACM,QAAQ,CAAE,GAAI,CAAC,EAAG;IAC7BN,MAAM,GAAGA,MAAM,CACbR,KAAK,CAAE,GAAI;IACZ;IAAA,CACCmB,IAAI,CAAIR,IAAI,IAAMA,IAAI,CAACF,IAAI,CAAC,CAAC,KAAK,EAAG,CAAC,CACtCA,IAAI,CAAC,CAAC;EACT;EACA;EACAD,MAAM,GAAGA,MAAM,CAACK,OAAO,CAAE,cAAc,EAAE,EAAG,CAAC;;EAE7C;EACA,IAAKO,MAAM,CAACC,SAAS,CAACC,SAAS,CAACC,WAAW,CAAC,CAAC,CAACT,QAAQ,CAAE,SAAU,CAAC,EAAG;IACrEN,MAAM,GAAG,IAAKA,MAAM,GAAI;EACzB;EACA,OAAOA,MAAM;AACd;AAEA,OAAO,SAASgB,qBAAqBA,CAAEC,MAAM,EAAG;EAC/C,MAAMC,KAAK,GAAG;IAAEC,UAAU,EAAErB,gBAAgB,CAAEmB,MAAM,CAACE,UAAW;EAAE,CAAC;EAEnE,IAAK,CAAEC,KAAK,CAACC,OAAO,CAAEJ,MAAM,CAACK,QAAS,CAAC,EAAG;IACzCJ,KAAK,CAAC3B,UAAU,GAAG,KAAK;IACxB2B,KAAK,CAACK,SAAS,GAAG,QAAQ;IAC1B,OAAOL,KAAK;EACb;EAEA,IAAKD,MAAM,CAACK,QAAQ,EAAG;IACtB;IACA,MAAME,WAAW,GAAGP,MAAM,CAACK,QAAQ,CAACd,MAAM,CACvCpB,IAAI,IACLA,IAAI,EAAEmC,SAAS,IAAInC,IAAI,CAACmC,SAAS,CAACR,WAAW,CAAC,CAAC,KAAK,QACtD,CAAC;IACD,IAAKS,WAAW,CAAC9C,MAAM,GAAG,CAAC,EAAG;MAC7BwC,KAAK,CAACK,SAAS,GAAG,QAAQ;MAC1B,MAAME,aAAa,GAAGzC,kBAAkB,CAAEwC,WAAY,CAAC;MACvD,MAAME,aAAa,GAAGnD,WAAW,CAAE,GAAG,EAAEkD,aAAc,CAAC;MACvDP,KAAK,CAAC3B,UAAU,GAAGD,MAAM,CAAEoC,aAAc,CAAC,IAAI,KAAK;IACpD,CAAC,MAAM;MACNR,KAAK,CAACK,SAAS,GACZN,MAAM,CAACK,QAAQ,CAAC5C,MAAM,IAAIuC,MAAM,CAACK,QAAQ,CAAE,CAAC,CAAE,CAACC,SAAS,IAC1D,QAAQ;MACTL,KAAK,CAAC3B,UAAU,GACb0B,MAAM,CAACK,QAAQ,CAAC5C,MAAM,IACvBY,MAAM,CAAE2B,MAAM,CAACK,QAAQ,CAAE,CAAC,CAAE,CAAC/B,UAAW,CAAC,IAC1C,KAAK;IACP;EACD;EAEA,OAAO2B,KAAK;AACb;AAEA,OAAO,SAASS,mBAAmBA,CAAEvC,IAAI,EAAG;EAC3C,OAAO;IACN+B,UAAU,EAAErB,gBAAgB,CAAEV,IAAI,CAAC+B,UAAW,CAAC;IAC/CI,SAAS,EAAEnC,IAAI,CAACmC,SAAS,IAAI,QAAQ;IACrChC,UAAU,EAAEH,IAAI,CAACG,UAAU,IAAI;EAChC,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/global-styles/font-library-modal/utils/preview-styles.js"],
4
+ "sourcesContent": ["function findNearest( input, numbers ) {\n\t// If the numbers array is empty, return null\n\tif ( numbers.length === 0 ) {\n\t\treturn null;\n\t}\n\t// Sort the array based on the absolute difference with the input\n\tnumbers.sort( ( a, b ) => Math.abs( input - a ) - Math.abs( input - b ) );\n\t// Return the first element (which will be the nearest) from the sorted array\n\treturn numbers[ 0 ];\n}\n\nfunction extractFontWeights( fontFaces ) {\n\tconst result = [];\n\n\tfontFaces.forEach( ( face ) => {\n\t\tconst weights = String( face.fontWeight ).split( ' ' );\n\n\t\tif ( weights.length === 2 ) {\n\t\t\tconst start = parseInt( weights[ 0 ] );\n\t\t\tconst end = parseInt( weights[ 1 ] );\n\n\t\t\tfor ( let i = start; i <= end; i += 100 ) {\n\t\t\t\tresult.push( i );\n\t\t\t}\n\t\t} else if ( weights.length === 1 ) {\n\t\t\tresult.push( parseInt( weights[ 0 ] ) );\n\t\t}\n\t} );\n\n\treturn result;\n}\n\n/*\n * Format the font family to use in the CSS font-family property of a CSS rule.\n *\n * The input can be a string with the font family name or a string with multiple font family names separated by commas.\n * It follows the recommendations from the CSS Fonts Module Level 4.\n * https://www.w3.org/TR/css-fonts-4/#font-family-prop\n *\n * @param {string} input - The font family.\n * @return {string} The formatted font family.\n *\n * Example:\n * formatFontFamily( \"Open Sans, Font+Name, sans-serif\" ) => '\"Open Sans\", \"Font+Name\", sans-serif'\n * formatFontFamily( \"'Open Sans', generic(kai), sans-serif\" ) => '\"Open Sans\", sans-serif'\n * formatFontFamily( \"DotGothic16, Slabo 27px, serif\" ) => '\"DotGothic16\",\"Slabo 27px\",serif'\n * formatFontFamily( \"Mine's, Moe's Typography\" ) => `\"mine's\",\"Moe's Typography\"`\n */\nexport function formatFontFamily( input ) {\n\t// Matches strings that are not exclusively alphabetic characters or hyphens, and do not exactly follow the pattern generic(alphabetic characters or hyphens).\n\tconst regex = /^(?!generic\\([ a-zA-Z\\-]+\\)$)(?!^[a-zA-Z\\-]+$).+/;\n\tconst output = input.trim();\n\n\tconst formatItem = ( item ) => {\n\t\titem = item.trim();\n\t\tif ( item.match( regex ) ) {\n\t\t\t// removes leading and trailing quotes.\n\t\t\titem = item.replace( /^[\"']|[\"']$/g, '' );\n\t\t\treturn `\"${ item }\"`;\n\t\t}\n\t\treturn item;\n\t};\n\n\tif ( output.includes( ',' ) ) {\n\t\treturn output\n\t\t\t.split( ',' )\n\t\t\t.map( formatItem )\n\t\t\t.filter( ( item ) => item !== '' )\n\t\t\t.join( ', ' );\n\t}\n\n\treturn formatItem( output );\n}\n\n/*\n * Format the font face name to use in the font-family property of a font face.\n *\n * The input can be a string with the font face name or a string with multiple font face names separated by commas.\n * It removes the leading and trailing quotes from the font face name.\n *\n * @param {string} input - The font face name.\n * @return {string} The formatted font face name.\n *\n * Example:\n * formatFontFaceName(\"Open Sans\") => \"Open Sans\"\n * formatFontFaceName(\"'Open Sans', sans-serif\") => \"Open Sans\"\n * formatFontFaceName(\", 'Open Sans', 'Helvetica Neue', sans-serif\") => \"Open Sans\"\n */\nexport function formatFontFaceName( input ) {\n\tif ( ! input ) {\n\t\treturn '';\n\t}\n\n\tlet output = input.trim();\n\tif ( output.includes( ',' ) ) {\n\t\toutput = output\n\t\t\t.split( ',' )\n\t\t\t// finds the first item that is not an empty string.\n\t\t\t.find( ( item ) => item.trim() !== '' )\n\t\t\t.trim();\n\t}\n\t// removes leading and trailing quotes.\n\toutput = output.replace( /^[\"']|[\"']$/g, '' );\n\n\t// Firefox needs the font name to be wrapped in double quotes meanwhile other browsers don't.\n\tif ( window.navigator.userAgent.toLowerCase().includes( 'firefox' ) ) {\n\t\toutput = `\"${ output }\"`;\n\t}\n\treturn output;\n}\n\nexport function getFamilyPreviewStyle( family ) {\n\tconst style = { fontFamily: formatFontFamily( family.fontFamily ) };\n\n\tif ( ! Array.isArray( family.fontFace ) ) {\n\t\tstyle.fontWeight = '400';\n\t\tstyle.fontStyle = 'normal';\n\t\treturn style;\n\t}\n\n\tif ( family.fontFace ) {\n\t\t//get all the font faces with normal style\n\t\tconst normalFaces = family.fontFace.filter(\n\t\t\t( face ) =>\n\t\t\t\tface?.fontStyle && face.fontStyle.toLowerCase() === 'normal'\n\t\t);\n\t\tif ( normalFaces.length > 0 ) {\n\t\t\tstyle.fontStyle = 'normal';\n\t\t\tconst normalWeights = extractFontWeights( normalFaces );\n\t\t\tconst nearestWeight = findNearest( 400, normalWeights );\n\t\t\tstyle.fontWeight = String( nearestWeight ) || '400';\n\t\t} else {\n\t\t\tstyle.fontStyle =\n\t\t\t\t( family.fontFace.length && family.fontFace[ 0 ].fontStyle ) ||\n\t\t\t\t'normal';\n\t\t\tstyle.fontWeight =\n\t\t\t\t( family.fontFace.length &&\n\t\t\t\t\tString( family.fontFace[ 0 ].fontWeight ) ) ||\n\t\t\t\t'400';\n\t\t}\n\t}\n\n\treturn style;\n}\n\nexport function getFacePreviewStyle( face ) {\n\treturn {\n\t\tfontFamily: formatFontFamily( face.fontFamily ),\n\t\tfontStyle: face.fontStyle || 'normal',\n\t\tfontWeight: face.fontWeight || '400',\n\t};\n}\n"],
5
+ "mappings": "AAAA,SAAS,YAAa,OAAO,SAAU;AAEtC,MAAK,QAAQ,WAAW,GAAI;AAC3B,WAAO;AAAA,EACR;AAEA,UAAQ,KAAM,CAAE,GAAG,MAAO,KAAK,IAAK,QAAQ,CAAE,IAAI,KAAK,IAAK,QAAQ,CAAE,CAAE;AAExE,SAAO,QAAS,CAAE;AACnB;AAEA,SAAS,mBAAoB,WAAY;AACxC,QAAM,SAAS,CAAC;AAEhB,YAAU,QAAS,CAAE,SAAU;AAC9B,UAAM,UAAU,OAAQ,KAAK,UAAW,EAAE,MAAO,GAAI;AAErD,QAAK,QAAQ,WAAW,GAAI;AAC3B,YAAM,QAAQ,SAAU,QAAS,CAAE,CAAE;AACrC,YAAM,MAAM,SAAU,QAAS,CAAE,CAAE;AAEnC,eAAU,IAAI,OAAO,KAAK,KAAK,KAAK,KAAM;AACzC,eAAO,KAAM,CAAE;AAAA,MAChB;AAAA,IACD,WAAY,QAAQ,WAAW,GAAI;AAClC,aAAO,KAAM,SAAU,QAAS,CAAE,CAAE,CAAE;AAAA,IACvC;AAAA,EACD,CAAE;AAEF,SAAO;AACR;AAkBO,SAAS,iBAAkB,OAAQ;AAEzC,QAAM,QAAQ;AACd,QAAM,SAAS,MAAM,KAAK;AAE1B,QAAM,aAAa,CAAE,SAAU;AAC9B,WAAO,KAAK,KAAK;AACjB,QAAK,KAAK,MAAO,KAAM,GAAI;AAE1B,aAAO,KAAK,QAAS,gBAAgB,EAAG;AACxC,aAAO,IAAK,IAAK;AAAA,IAClB;AACA,WAAO;AAAA,EACR;AAEA,MAAK,OAAO,SAAU,GAAI,GAAI;AAC7B,WAAO,OACL,MAAO,GAAI,EACX,IAAK,UAAW,EAChB,OAAQ,CAAE,SAAU,SAAS,EAAG,EAChC,KAAM,IAAK;AAAA,EACd;AAEA,SAAO,WAAY,MAAO;AAC3B;AAgBO,SAAS,mBAAoB,OAAQ;AAC3C,MAAK,CAAE,OAAQ;AACd,WAAO;AAAA,EACR;AAEA,MAAI,SAAS,MAAM,KAAK;AACxB,MAAK,OAAO,SAAU,GAAI,GAAI;AAC7B,aAAS,OACP,MAAO,GAAI,EAEX,KAAM,CAAE,SAAU,KAAK,KAAK,MAAM,EAAG,EACrC,KAAK;AAAA,EACR;AAEA,WAAS,OAAO,QAAS,gBAAgB,EAAG;AAG5C,MAAK,OAAO,UAAU,UAAU,YAAY,EAAE,SAAU,SAAU,GAAI;AACrE,aAAS,IAAK,MAAO;AAAA,EACtB;AACA,SAAO;AACR;AAEO,SAAS,sBAAuB,QAAS;AAC/C,QAAM,QAAQ,EAAE,YAAY,iBAAkB,OAAO,UAAW,EAAE;AAElE,MAAK,CAAE,MAAM,QAAS,OAAO,QAAS,GAAI;AACzC,UAAM,aAAa;AACnB,UAAM,YAAY;AAClB,WAAO;AAAA,EACR;AAEA,MAAK,OAAO,UAAW;AAEtB,UAAM,cAAc,OAAO,SAAS;AAAA,MACnC,CAAE,SACD,MAAM,aAAa,KAAK,UAAU,YAAY,MAAM;AAAA,IACtD;AACA,QAAK,YAAY,SAAS,GAAI;AAC7B,YAAM,YAAY;AAClB,YAAM,gBAAgB,mBAAoB,WAAY;AACtD,YAAM,gBAAgB,YAAa,KAAK,aAAc;AACtD,YAAM,aAAa,OAAQ,aAAc,KAAK;AAAA,IAC/C,OAAO;AACN,YAAM,YACH,OAAO,SAAS,UAAU,OAAO,SAAU,CAAE,EAAE,aACjD;AACD,YAAM,aACH,OAAO,SAAS,UACjB,OAAQ,OAAO,SAAU,CAAE,EAAE,UAAW,KACzC;AAAA,IACF;AAAA,EACD;AAEA,SAAO;AACR;AAEO,SAAS,oBAAqB,MAAO;AAC3C,SAAO;AAAA,IACN,YAAY,iBAAkB,KAAK,UAAW;AAAA,IAC9C,WAAW,KAAK,aAAa;AAAA,IAC7B,YAAY,KAAK,cAAc;AAAA,EAChC;AACD;",
6
+ "names": []
7
+ }
@@ -1,34 +1,32 @@
1
1
  function getNumericFontWeight(value) {
2
2
  switch (value) {
3
- case 'normal':
3
+ case "normal":
4
4
  return 400;
5
- case 'bold':
5
+ case "bold":
6
6
  return 700;
7
- case 'bolder':
7
+ case "bolder":
8
8
  return 500;
9
- case 'lighter':
9
+ case "lighter":
10
10
  return 300;
11
11
  default:
12
12
  return parseInt(value, 10);
13
13
  }
14
14
  }
15
- export function sortFontFaces(faces) {
15
+ function sortFontFaces(faces) {
16
16
  return faces.sort((a, b) => {
17
- // Ensure 'normal' fontStyle is always first
18
- if (a.fontStyle === 'normal' && b.fontStyle !== 'normal') {
17
+ if (a.fontStyle === "normal" && b.fontStyle !== "normal") {
19
18
  return -1;
20
19
  }
21
- if (b.fontStyle === 'normal' && a.fontStyle !== 'normal') {
20
+ if (b.fontStyle === "normal" && a.fontStyle !== "normal") {
22
21
  return 1;
23
22
  }
24
-
25
- // If both fontStyles are the same, sort by fontWeight
26
23
  if (a.fontStyle === b.fontStyle) {
27
24
  return getNumericFontWeight(a.fontWeight) - getNumericFontWeight(b.fontWeight);
28
25
  }
29
-
30
- // Sort other fontStyles alphabetically
31
26
  return a.fontStyle.localeCompare(b.fontStyle);
32
27
  });
33
28
  }
34
- //# sourceMappingURL=sort-font-faces.js.map
29
+ export {
30
+ sortFontFaces
31
+ };
32
+ //# sourceMappingURL=sort-font-faces.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["getNumericFontWeight","value","parseInt","sortFontFaces","faces","sort","a","b","fontStyle","fontWeight","localeCompare"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/utils/sort-font-faces.js"],"sourcesContent":["function getNumericFontWeight( value ) {\n\tswitch ( value ) {\n\t\tcase 'normal':\n\t\t\treturn 400;\n\t\tcase 'bold':\n\t\t\treturn 700;\n\t\tcase 'bolder':\n\t\t\treturn 500;\n\t\tcase 'lighter':\n\t\t\treturn 300;\n\t\tdefault:\n\t\t\treturn parseInt( value, 10 );\n\t}\n}\n\nexport function sortFontFaces( faces ) {\n\treturn faces.sort( ( a, b ) => {\n\t\t// Ensure 'normal' fontStyle is always first\n\t\tif ( a.fontStyle === 'normal' && b.fontStyle !== 'normal' ) {\n\t\t\treturn -1;\n\t\t}\n\t\tif ( b.fontStyle === 'normal' && a.fontStyle !== 'normal' ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// If both fontStyles are the same, sort by fontWeight\n\t\tif ( a.fontStyle === b.fontStyle ) {\n\t\t\treturn (\n\t\t\t\tgetNumericFontWeight( a.fontWeight ) -\n\t\t\t\tgetNumericFontWeight( b.fontWeight )\n\t\t\t);\n\t\t}\n\n\t\t// Sort other fontStyles alphabetically\n\t\treturn a.fontStyle.localeCompare( b.fontStyle );\n\t} );\n}\n"],"mappings":"AAAA,SAASA,oBAAoBA,CAAEC,KAAK,EAAG;EACtC,QAASA,KAAK;IACb,KAAK,QAAQ;MACZ,OAAO,GAAG;IACX,KAAK,MAAM;MACV,OAAO,GAAG;IACX,KAAK,QAAQ;MACZ,OAAO,GAAG;IACX,KAAK,SAAS;MACb,OAAO,GAAG;IACX;MACC,OAAOC,QAAQ,CAAED,KAAK,EAAE,EAAG,CAAC;EAC9B;AACD;AAEA,OAAO,SAASE,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,IAAI,CAAE,CAAEC,CAAC,EAAEC,CAAC,KAAM;IAC9B;IACA,IAAKD,CAAC,CAACE,SAAS,KAAK,QAAQ,IAAID,CAAC,CAACC,SAAS,KAAK,QAAQ,EAAG;MAC3D,OAAO,CAAC,CAAC;IACV;IACA,IAAKD,CAAC,CAACC,SAAS,KAAK,QAAQ,IAAIF,CAAC,CAACE,SAAS,KAAK,QAAQ,EAAG;MAC3D,OAAO,CAAC;IACT;;IAEA;IACA,IAAKF,CAAC,CAACE,SAAS,KAAKD,CAAC,CAACC,SAAS,EAAG;MAClC,OACCR,oBAAoB,CAAEM,CAAC,CAACG,UAAW,CAAC,GACpCT,oBAAoB,CAAEO,CAAC,CAACE,UAAW,CAAC;IAEtC;;IAEA;IACA,OAAOH,CAAC,CAACE,SAAS,CAACE,aAAa,CAAEH,CAAC,CAACC,SAAU,CAAC;EAChD,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/global-styles/font-library-modal/utils/sort-font-faces.js"],
4
+ "sourcesContent": ["function getNumericFontWeight( value ) {\n\tswitch ( value ) {\n\t\tcase 'normal':\n\t\t\treturn 400;\n\t\tcase 'bold':\n\t\t\treturn 700;\n\t\tcase 'bolder':\n\t\t\treturn 500;\n\t\tcase 'lighter':\n\t\t\treturn 300;\n\t\tdefault:\n\t\t\treturn parseInt( value, 10 );\n\t}\n}\n\nexport function sortFontFaces( faces ) {\n\treturn faces.sort( ( a, b ) => {\n\t\t// Ensure 'normal' fontStyle is always first\n\t\tif ( a.fontStyle === 'normal' && b.fontStyle !== 'normal' ) {\n\t\t\treturn -1;\n\t\t}\n\t\tif ( b.fontStyle === 'normal' && a.fontStyle !== 'normal' ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// If both fontStyles are the same, sort by fontWeight\n\t\tif ( a.fontStyle === b.fontStyle ) {\n\t\t\treturn (\n\t\t\t\tgetNumericFontWeight( a.fontWeight ) -\n\t\t\t\tgetNumericFontWeight( b.fontWeight )\n\t\t\t);\n\t\t}\n\n\t\t// Sort other fontStyles alphabetically\n\t\treturn a.fontStyle.localeCompare( b.fontStyle );\n\t} );\n}\n"],
5
+ "mappings": "AAAA,SAAS,qBAAsB,OAAQ;AACtC,UAAS,OAAQ;AAAA,IAChB,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR;AACC,aAAO,SAAU,OAAO,EAAG;AAAA,EAC7B;AACD;AAEO,SAAS,cAAe,OAAQ;AACtC,SAAO,MAAM,KAAM,CAAE,GAAG,MAAO;AAE9B,QAAK,EAAE,cAAc,YAAY,EAAE,cAAc,UAAW;AAC3D,aAAO;AAAA,IACR;AACA,QAAK,EAAE,cAAc,YAAY,EAAE,cAAc,UAAW;AAC3D,aAAO;AAAA,IACR;AAGA,QAAK,EAAE,cAAc,EAAE,WAAY;AAClC,aACC,qBAAsB,EAAE,UAAW,IACnC,qBAAsB,EAAE,UAAW;AAAA,IAErC;AAGA,WAAO,EAAE,UAAU,cAAe,EAAE,SAAU;AAAA,EAC/C,CAAE;AACH;",
6
+ "names": []
7
+ }
@@ -1,81 +1,31 @@
1
- /**
2
- * Toggles the activation of a given font or font variant within a list of custom fonts.
3
- *
4
- * - If only the font is provided (without face), the entire font family's activation is toggled.
5
- * - If both font and face are provided, the activation of the specific font variant is toggled.
6
- *
7
- * @param {Object} font - The font to be toggled.
8
- * @param {string} font.slug - The unique identifier for the font.
9
- * @param {Array} [font.fontFace] - The list of font variants (faces) associated with the font.
10
- *
11
- * @param {Object} [face] - The specific font variant to be toggled.
12
- * @param {string} face.fontWeight - The weight of the font variant.
13
- * @param {string} face.fontStyle - The style of the font variant.
14
- *
15
- * @param {Array} initialfonts - The initial list of custom fonts.
16
- *
17
- * @return {Array} - The updated list of custom fonts with the font/font variant toggled.
18
- *
19
- * @example
20
- * const customFonts = [
21
- * { slug: 'roboto', fontFace: [{ fontWeight: '400', fontStyle: 'normal' }] }
22
- * ];
23
- *
24
- * toggleFont({ slug: 'roboto' }, null, customFonts);
25
- * // This will remove 'roboto' from customFonts
26
- *
27
- * toggleFont({ slug: 'roboto' }, { fontWeight: '400', fontStyle: 'normal' }, customFonts);
28
- * // This will remove the specified face from 'roboto' in customFonts
29
- *
30
- * toggleFont({ slug: 'roboto' }, { fontWeight: '500', fontStyle: 'normal' }, customFonts);
31
- * // This will add the specified face to 'roboto' in customFonts
32
- */
33
- export function toggleFont(font, face, initialfonts) {
34
- // Helper to check if a font is activated based on its slug
35
- const isFontActivated = f => f.slug === font.slug;
36
-
37
- // Helper to get the activated font from a list of fonts
38
- const getActivatedFont = fonts => fonts.find(isFontActivated);
39
-
40
- // Toggle the activation status of an entire font family
41
- const toggleEntireFontFamily = activatedFont => {
42
- if (!activatedFont) {
43
- // If the font is not active, activate the entire font family
1
+ function toggleFont(font, face, initialfonts) {
2
+ const isFontActivated = (f) => f.slug === font.slug;
3
+ const getActivatedFont = (fonts) => fonts.find(isFontActivated);
4
+ const toggleEntireFontFamily = (activatedFont2) => {
5
+ if (!activatedFont2) {
44
6
  return [...initialfonts, font];
45
7
  }
46
- // If the font is already active, deactivate the entire font family
47
- return initialfonts.filter(f => !isFontActivated(f));
8
+ return initialfonts.filter((f) => !isFontActivated(f));
48
9
  };
49
-
50
- // Toggle the activation status of a specific font variant
51
- const toggleFontVariant = activatedFont => {
52
- const isFaceActivated = f => f.fontWeight === face.fontWeight && f.fontStyle === face.fontStyle;
53
- if (!activatedFont) {
54
- // If the font family is not active, activate the font family with the font variant
55
- return [...initialfonts, {
56
- ...font,
57
- fontFace: [face]
58
- }];
10
+ const toggleFontVariant = (activatedFont2) => {
11
+ const isFaceActivated = (f) => f.fontWeight === face.fontWeight && f.fontStyle === face.fontStyle;
12
+ if (!activatedFont2) {
13
+ return [...initialfonts, { ...font, fontFace: [face] }];
59
14
  }
60
- let newFontFaces = activatedFont.fontFace || [];
15
+ let newFontFaces = activatedFont2.fontFace || [];
61
16
  if (newFontFaces.find(isFaceActivated)) {
62
- // If the font variant is active, deactivate it
63
- newFontFaces = newFontFaces.filter(f => !isFaceActivated(f));
17
+ newFontFaces = newFontFaces.filter(
18
+ (f) => !isFaceActivated(f)
19
+ );
64
20
  } else {
65
- // If the font variant is not active, activate it
66
21
  newFontFaces = [...newFontFaces, face];
67
22
  }
68
-
69
- // If there are no more font faces, deactivate the font family
70
23
  if (newFontFaces.length === 0) {
71
- return initialfonts.filter(f => !isFontActivated(f));
24
+ return initialfonts.filter((f) => !isFontActivated(f));
72
25
  }
73
-
74
- // Return updated fonts list with toggled font variant
75
- return initialfonts.map(f => isFontActivated(f) ? {
76
- ...f,
77
- fontFace: newFontFaces
78
- } : f);
26
+ return initialfonts.map(
27
+ (f) => isFontActivated(f) ? { ...f, fontFace: newFontFaces } : f
28
+ );
79
29
  };
80
30
  const activatedFont = getActivatedFont(initialfonts);
81
31
  if (!face) {
@@ -83,4 +33,7 @@ export function toggleFont(font, face, initialfonts) {
83
33
  }
84
34
  return toggleFontVariant(activatedFont);
85
35
  }
86
- //# sourceMappingURL=toggleFont.js.map
36
+ export {
37
+ toggleFont
38
+ };
39
+ //# sourceMappingURL=toggleFont.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["toggleFont","font","face","initialfonts","isFontActivated","f","slug","getActivatedFont","fonts","find","toggleEntireFontFamily","activatedFont","filter","toggleFontVariant","isFaceActivated","fontWeight","fontStyle","fontFace","newFontFaces","length","map"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/utils/toggleFont.js"],"sourcesContent":["/**\n * Toggles the activation of a given font or font variant within a list of custom fonts.\n *\n * - If only the font is provided (without face), the entire font family's activation is toggled.\n * - If both font and face are provided, the activation of the specific font variant is toggled.\n *\n * @param {Object} font - The font to be toggled.\n * @param {string} font.slug - The unique identifier for the font.\n * @param {Array} [font.fontFace] - The list of font variants (faces) associated with the font.\n *\n * @param {Object} [face] - The specific font variant to be toggled.\n * @param {string} face.fontWeight - The weight of the font variant.\n * @param {string} face.fontStyle - The style of the font variant.\n *\n * @param {Array} initialfonts - The initial list of custom fonts.\n *\n * @return {Array} - The updated list of custom fonts with the font/font variant toggled.\n *\n * @example\n * const customFonts = [\n * { slug: 'roboto', fontFace: [{ fontWeight: '400', fontStyle: 'normal' }] }\n * ];\n *\n * toggleFont({ slug: 'roboto' }, null, customFonts);\n * // This will remove 'roboto' from customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '400', fontStyle: 'normal' }, customFonts);\n * // This will remove the specified face from 'roboto' in customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '500', fontStyle: 'normal' }, customFonts);\n * // This will add the specified face to 'roboto' in customFonts\n */\nexport function toggleFont( font, face, initialfonts ) {\n\t// Helper to check if a font is activated based on its slug\n\tconst isFontActivated = ( f ) => f.slug === font.slug;\n\n\t// Helper to get the activated font from a list of fonts\n\tconst getActivatedFont = ( fonts ) => fonts.find( isFontActivated );\n\n\t// Toggle the activation status of an entire font family\n\tconst toggleEntireFontFamily = ( activatedFont ) => {\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font is not active, activate the entire font family\n\t\t\treturn [ ...initialfonts, font ];\n\t\t}\n\t\t// If the font is already active, deactivate the entire font family\n\t\treturn initialfonts.filter( ( f ) => ! isFontActivated( f ) );\n\t};\n\n\t// Toggle the activation status of a specific font variant\n\tconst toggleFontVariant = ( activatedFont ) => {\n\t\tconst isFaceActivated = ( f ) =>\n\t\t\tf.fontWeight === face.fontWeight && f.fontStyle === face.fontStyle;\n\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font family is not active, activate the font family with the font variant\n\t\t\treturn [ ...initialfonts, { ...font, fontFace: [ face ] } ];\n\t\t}\n\n\t\tlet newFontFaces = activatedFont.fontFace || [];\n\n\t\tif ( newFontFaces.find( isFaceActivated ) ) {\n\t\t\t// If the font variant is active, deactivate it\n\t\t\tnewFontFaces = newFontFaces.filter(\n\t\t\t\t( f ) => ! isFaceActivated( f )\n\t\t\t);\n\t\t} else {\n\t\t\t// If the font variant is not active, activate it\n\t\t\tnewFontFaces = [ ...newFontFaces, face ];\n\t\t}\n\n\t\t// If there are no more font faces, deactivate the font family\n\t\tif ( newFontFaces.length === 0 ) {\n\t\t\treturn initialfonts.filter( ( f ) => ! isFontActivated( f ) );\n\t\t}\n\n\t\t// Return updated fonts list with toggled font variant\n\t\treturn initialfonts.map( ( f ) =>\n\t\t\tisFontActivated( f ) ? { ...f, fontFace: newFontFaces } : f\n\t\t);\n\t};\n\n\tconst activatedFont = getActivatedFont( initialfonts );\n\n\tif ( ! face ) {\n\t\treturn toggleEntireFontFamily( activatedFont );\n\t}\n\n\treturn toggleFontVariant( activatedFont );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,UAAUA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,YAAY,EAAG;EACtD;EACA,MAAMC,eAAe,GAAKC,CAAC,IAAMA,CAAC,CAACC,IAAI,KAAKL,IAAI,CAACK,IAAI;;EAErD;EACA,MAAMC,gBAAgB,GAAKC,KAAK,IAAMA,KAAK,CAACC,IAAI,CAAEL,eAAgB,CAAC;;EAEnE;EACA,MAAMM,sBAAsB,GAAKC,aAAa,IAAM;IACnD,IAAK,CAAEA,aAAa,EAAG;MACtB;MACA,OAAO,CAAE,GAAGR,YAAY,EAAEF,IAAI,CAAE;IACjC;IACA;IACA,OAAOE,YAAY,CAACS,MAAM,CAAIP,CAAC,IAAM,CAAED,eAAe,CAAEC,CAAE,CAAE,CAAC;EAC9D,CAAC;;EAED;EACA,MAAMQ,iBAAiB,GAAKF,aAAa,IAAM;IAC9C,MAAMG,eAAe,GAAKT,CAAC,IAC1BA,CAAC,CAACU,UAAU,KAAKb,IAAI,CAACa,UAAU,IAAIV,CAAC,CAACW,SAAS,KAAKd,IAAI,CAACc,SAAS;IAEnE,IAAK,CAAEL,aAAa,EAAG;MACtB;MACA,OAAO,CAAE,GAAGR,YAAY,EAAE;QAAE,GAAGF,IAAI;QAAEgB,QAAQ,EAAE,CAAEf,IAAI;MAAG,CAAC,CAAE;IAC5D;IAEA,IAAIgB,YAAY,GAAGP,aAAa,CAACM,QAAQ,IAAI,EAAE;IAE/C,IAAKC,YAAY,CAACT,IAAI,CAAEK,eAAgB,CAAC,EAAG;MAC3C;MACAI,YAAY,GAAGA,YAAY,CAACN,MAAM,CAC/BP,CAAC,IAAM,CAAES,eAAe,CAAET,CAAE,CAC/B,CAAC;IACF,CAAC,MAAM;MACN;MACAa,YAAY,GAAG,CAAE,GAAGA,YAAY,EAAEhB,IAAI,CAAE;IACzC;;IAEA;IACA,IAAKgB,YAAY,CAACC,MAAM,KAAK,CAAC,EAAG;MAChC,OAAOhB,YAAY,CAACS,MAAM,CAAIP,CAAC,IAAM,CAAED,eAAe,CAAEC,CAAE,CAAE,CAAC;IAC9D;;IAEA;IACA,OAAOF,YAAY,CAACiB,GAAG,CAAIf,CAAC,IAC3BD,eAAe,CAAEC,CAAE,CAAC,GAAG;MAAE,GAAGA,CAAC;MAAEY,QAAQ,EAAEC;IAAa,CAAC,GAAGb,CAC3D,CAAC;EACF,CAAC;EAED,MAAMM,aAAa,GAAGJ,gBAAgB,CAAEJ,YAAa,CAAC;EAEtD,IAAK,CAAED,IAAI,EAAG;IACb,OAAOQ,sBAAsB,CAAEC,aAAc,CAAC;EAC/C;EAEA,OAAOE,iBAAiB,CAAEF,aAAc,CAAC;AAC1C","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/global-styles/font-library-modal/utils/toggleFont.js"],
4
+ "sourcesContent": ["/**\n * Toggles the activation of a given font or font variant within a list of custom fonts.\n *\n * - If only the font is provided (without face), the entire font family's activation is toggled.\n * - If both font and face are provided, the activation of the specific font variant is toggled.\n *\n * @param {Object} font - The font to be toggled.\n * @param {string} font.slug - The unique identifier for the font.\n * @param {Array} [font.fontFace] - The list of font variants (faces) associated with the font.\n *\n * @param {Object} [face] - The specific font variant to be toggled.\n * @param {string} face.fontWeight - The weight of the font variant.\n * @param {string} face.fontStyle - The style of the font variant.\n *\n * @param {Array} initialfonts - The initial list of custom fonts.\n *\n * @return {Array} - The updated list of custom fonts with the font/font variant toggled.\n *\n * @example\n * const customFonts = [\n * { slug: 'roboto', fontFace: [{ fontWeight: '400', fontStyle: 'normal' }] }\n * ];\n *\n * toggleFont({ slug: 'roboto' }, null, customFonts);\n * // This will remove 'roboto' from customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '400', fontStyle: 'normal' }, customFonts);\n * // This will remove the specified face from 'roboto' in customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '500', fontStyle: 'normal' }, customFonts);\n * // This will add the specified face to 'roboto' in customFonts\n */\nexport function toggleFont( font, face, initialfonts ) {\n\t// Helper to check if a font is activated based on its slug\n\tconst isFontActivated = ( f ) => f.slug === font.slug;\n\n\t// Helper to get the activated font from a list of fonts\n\tconst getActivatedFont = ( fonts ) => fonts.find( isFontActivated );\n\n\t// Toggle the activation status of an entire font family\n\tconst toggleEntireFontFamily = ( activatedFont ) => {\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font is not active, activate the entire font family\n\t\t\treturn [ ...initialfonts, font ];\n\t\t}\n\t\t// If the font is already active, deactivate the entire font family\n\t\treturn initialfonts.filter( ( f ) => ! isFontActivated( f ) );\n\t};\n\n\t// Toggle the activation status of a specific font variant\n\tconst toggleFontVariant = ( activatedFont ) => {\n\t\tconst isFaceActivated = ( f ) =>\n\t\t\tf.fontWeight === face.fontWeight && f.fontStyle === face.fontStyle;\n\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font family is not active, activate the font family with the font variant\n\t\t\treturn [ ...initialfonts, { ...font, fontFace: [ face ] } ];\n\t\t}\n\n\t\tlet newFontFaces = activatedFont.fontFace || [];\n\n\t\tif ( newFontFaces.find( isFaceActivated ) ) {\n\t\t\t// If the font variant is active, deactivate it\n\t\t\tnewFontFaces = newFontFaces.filter(\n\t\t\t\t( f ) => ! isFaceActivated( f )\n\t\t\t);\n\t\t} else {\n\t\t\t// If the font variant is not active, activate it\n\t\t\tnewFontFaces = [ ...newFontFaces, face ];\n\t\t}\n\n\t\t// If there are no more font faces, deactivate the font family\n\t\tif ( newFontFaces.length === 0 ) {\n\t\t\treturn initialfonts.filter( ( f ) => ! isFontActivated( f ) );\n\t\t}\n\n\t\t// Return updated fonts list with toggled font variant\n\t\treturn initialfonts.map( ( f ) =>\n\t\t\tisFontActivated( f ) ? { ...f, fontFace: newFontFaces } : f\n\t\t);\n\t};\n\n\tconst activatedFont = getActivatedFont( initialfonts );\n\n\tif ( ! face ) {\n\t\treturn toggleEntireFontFamily( activatedFont );\n\t}\n\n\treturn toggleFontVariant( activatedFont );\n}\n"],
5
+ "mappings": "AAgCO,SAAS,WAAY,MAAM,MAAM,cAAe;AAEtD,QAAM,kBAAkB,CAAE,MAAO,EAAE,SAAS,KAAK;AAGjD,QAAM,mBAAmB,CAAE,UAAW,MAAM,KAAM,eAAgB;AAGlE,QAAM,yBAAyB,CAAEA,mBAAmB;AACnD,QAAK,CAAEA,gBAAgB;AAEtB,aAAO,CAAE,GAAG,cAAc,IAAK;AAAA,IAChC;AAEA,WAAO,aAAa,OAAQ,CAAE,MAAO,CAAE,gBAAiB,CAAE,CAAE;AAAA,EAC7D;AAGA,QAAM,oBAAoB,CAAEA,mBAAmB;AAC9C,UAAM,kBAAkB,CAAE,MACzB,EAAE,eAAe,KAAK,cAAc,EAAE,cAAc,KAAK;AAE1D,QAAK,CAAEA,gBAAgB;AAEtB,aAAO,CAAE,GAAG,cAAc,EAAE,GAAG,MAAM,UAAU,CAAE,IAAK,EAAE,CAAE;AAAA,IAC3D;AAEA,QAAI,eAAeA,eAAc,YAAY,CAAC;AAE9C,QAAK,aAAa,KAAM,eAAgB,GAAI;AAE3C,qBAAe,aAAa;AAAA,QAC3B,CAAE,MAAO,CAAE,gBAAiB,CAAE;AAAA,MAC/B;AAAA,IACD,OAAO;AAEN,qBAAe,CAAE,GAAG,cAAc,IAAK;AAAA,IACxC;AAGA,QAAK,aAAa,WAAW,GAAI;AAChC,aAAO,aAAa,OAAQ,CAAE,MAAO,CAAE,gBAAiB,CAAE,CAAE;AAAA,IAC7D;AAGA,WAAO,aAAa;AAAA,MAAK,CAAE,MAC1B,gBAAiB,CAAE,IAAI,EAAE,GAAG,GAAG,UAAU,aAAa,IAAI;AAAA,IAC3D;AAAA,EACD;AAEA,QAAM,gBAAgB,iBAAkB,YAAa;AAErD,MAAK,CAAE,MAAO;AACb,WAAO,uBAAwB,aAAc;AAAA,EAC9C;AAEA,SAAO,kBAAmB,aAAc;AACzC;",
6
+ "names": ["activatedFont"]
7
+ }
@@ -1,9 +1,6 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
5
- import { __, sprintf } from '@wordpress/i18n';
6
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { __experimentalConfirmDialog as ConfirmDialog } from "@wordpress/components";
3
+ import { __, sprintf } from "@wordpress/i18n";
7
4
  function ConfirmDeleteFontSizeDialog({
8
5
  fontSize,
9
6
  isOpen,
@@ -17,16 +14,27 @@ function ConfirmDeleteFontSizeDialog({
17
14
  const handleCancel = () => {
18
15
  toggleOpen();
19
16
  };
20
- return /*#__PURE__*/_jsx(ConfirmDialog, {
21
- isOpen: isOpen,
22
- cancelButtonText: __('Cancel'),
23
- confirmButtonText: __('Delete'),
24
- onCancel: handleCancel,
25
- onConfirm: handleConfirm,
26
- size: "medium",
27
- children: fontSize && sprintf(/* translators: %s: Name of the font size preset. */
28
- __('Are you sure you want to delete "%s" font size preset?'), fontSize.name)
29
- });
17
+ return /* @__PURE__ */ jsx(
18
+ ConfirmDialog,
19
+ {
20
+ isOpen,
21
+ cancelButtonText: __("Cancel"),
22
+ confirmButtonText: __("Delete"),
23
+ onCancel: handleCancel,
24
+ onConfirm: handleConfirm,
25
+ size: "medium",
26
+ children: fontSize && sprintf(
27
+ /* translators: %s: Name of the font size preset. */
28
+ __(
29
+ 'Are you sure you want to delete "%s" font size preset?'
30
+ ),
31
+ fontSize.name
32
+ )
33
+ }
34
+ );
30
35
  }
31
- export default ConfirmDeleteFontSizeDialog;
32
- //# sourceMappingURL=confirm-delete-font-size-dialog.js.map
36
+ var confirm_delete_font_size_dialog_default = ConfirmDeleteFontSizeDialog;
37
+ export {
38
+ confirm_delete_font_size_dialog_default as default
39
+ };
40
+ //# sourceMappingURL=confirm-delete-font-size-dialog.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__experimentalConfirmDialog","ConfirmDialog","__","sprintf","jsx","_jsx","ConfirmDeleteFontSizeDialog","fontSize","isOpen","toggleOpen","handleRemoveFontSize","handleConfirm","handleCancel","cancelButtonText","confirmButtonText","onCancel","onConfirm","size","children","name"],"sources":["@wordpress/edit-site/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\nfunction ConfirmDeleteFontSizeDialog( {\n\tfontSize,\n\tisOpen,\n\ttoggleOpen,\n\thandleRemoveFontSize,\n} ) {\n\tconst handleConfirm = async () => {\n\t\ttoggleOpen();\n\t\thandleRemoveFontSize( fontSize );\n\t};\n\n\tconst handleCancel = () => {\n\t\ttoggleOpen();\n\t};\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isOpen }\n\t\t\tcancelButtonText={ __( 'Cancel' ) }\n\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t\tonCancel={ handleCancel }\n\t\t\tonConfirm={ handleConfirm }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ fontSize &&\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Name of the font size preset. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Are you sure you want to delete \"%s\" font size preset?'\n\t\t\t\t\t),\n\t\t\t\t\tfontSize.name\n\t\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n\nexport default ConfirmDeleteFontSizeDialog;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9C,SAASC,2BAA2BA,CAAE;EACrCC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,MAAMC,aAAa,GAAG,MAAAA,CAAA,KAAY;IACjCF,UAAU,CAAC,CAAC;IACZC,oBAAoB,CAAEH,QAAS,CAAC;EACjC,CAAC;EAED,MAAMK,YAAY,GAAGA,CAAA,KAAM;IAC1BH,UAAU,CAAC,CAAC;EACb,CAAC;EAED,oBACCJ,IAAA,CAACJ,aAAa;IACbO,MAAM,EAAGA,MAAQ;IACjBK,gBAAgB,EAAGX,EAAE,CAAE,QAAS,CAAG;IACnCY,iBAAiB,EAAGZ,EAAE,CAAE,QAAS,CAAG;IACpCa,QAAQ,EAAGH,YAAc;IACzBI,SAAS,EAAGL,aAAe;IAC3BM,IAAI,EAAC,QAAQ;IAAAC,QAAA,EAEXX,QAAQ,IACTJ,OAAO,CACN;IACAD,EAAE,CACD,wDACD,CAAC,EACDK,QAAQ,CAACY,IACV;EAAC,CACY,CAAC;AAElB;AAEA,eAAeb,2BAA2B","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\nfunction ConfirmDeleteFontSizeDialog( {\n\tfontSize,\n\tisOpen,\n\ttoggleOpen,\n\thandleRemoveFontSize,\n} ) {\n\tconst handleConfirm = async () => {\n\t\ttoggleOpen();\n\t\thandleRemoveFontSize( fontSize );\n\t};\n\n\tconst handleCancel = () => {\n\t\ttoggleOpen();\n\t};\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isOpen }\n\t\t\tcancelButtonText={ __( 'Cancel' ) }\n\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t\tonCancel={ handleCancel }\n\t\t\tonConfirm={ handleConfirm }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ fontSize &&\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Name of the font size preset. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Are you sure you want to delete \"%s\" font size preset?'\n\t\t\t\t\t),\n\t\t\t\t\tfontSize.name\n\t\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n\nexport default ConfirmDeleteFontSizeDialog;\n"],
5
+ "mappings": "AAsBE;AAnBF,SAAS,+BAA+B,qBAAqB;AAC7D,SAAS,IAAI,eAAe;AAE5B,SAAS,4BAA6B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,gBAAgB,YAAY;AACjC,eAAW;AACX,yBAAsB,QAAS;AAAA,EAChC;AAEA,QAAM,eAAe,MAAM;AAC1B,eAAW;AAAA,EACZ;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,kBAAmB,GAAI,QAAS;AAAA,MAChC,mBAAoB,GAAI,QAAS;AAAA,MACjC,UAAW;AAAA,MACX,WAAY;AAAA,MACZ,MAAK;AAAA,MAEH,sBACD;AAAA;AAAA,QAEC;AAAA,UACC;AAAA,QACD;AAAA,QACA,SAAS;AAAA,MACV;AAAA;AAAA,EACF;AAEF;AAEA,IAAO,0CAAQ;",
6
+ "names": []
7
+ }
@@ -1,9 +1,6 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
5
- import { __ } from '@wordpress/i18n';
6
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { __experimentalConfirmDialog as ConfirmDialog } from "@wordpress/components";
3
+ import { __ } from "@wordpress/i18n";
7
4
  function ConfirmResetFontSizesDialog({
8
5
  text,
9
6
  confirmButtonText,
@@ -18,15 +15,21 @@ function ConfirmResetFontSizesDialog({
18
15
  const handleCancel = () => {
19
16
  toggleOpen();
20
17
  };
21
- return /*#__PURE__*/_jsx(ConfirmDialog, {
22
- isOpen: isOpen,
23
- cancelButtonText: __('Cancel'),
24
- confirmButtonText: confirmButtonText,
25
- onCancel: handleCancel,
26
- onConfirm: handleConfirm,
27
- size: "medium",
28
- children: text
29
- });
18
+ return /* @__PURE__ */ jsx(
19
+ ConfirmDialog,
20
+ {
21
+ isOpen,
22
+ cancelButtonText: __("Cancel"),
23
+ confirmButtonText,
24
+ onCancel: handleCancel,
25
+ onConfirm: handleConfirm,
26
+ size: "medium",
27
+ children: text
28
+ }
29
+ );
30
30
  }
31
- export default ConfirmResetFontSizesDialog;
32
- //# sourceMappingURL=confirm-reset-font-sizes-dialog.js.map
31
+ var confirm_reset_font_sizes_dialog_default = ConfirmResetFontSizesDialog;
32
+ export {
33
+ confirm_reset_font_sizes_dialog_default as default
34
+ };
35
+ //# sourceMappingURL=confirm-reset-font-sizes-dialog.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__experimentalConfirmDialog","ConfirmDialog","__","jsx","_jsx","ConfirmResetFontSizesDialog","text","confirmButtonText","isOpen","toggleOpen","onConfirm","handleConfirm","handleCancel","cancelButtonText","onCancel","size","children"],"sources":["@wordpress/edit-site/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nfunction ConfirmResetFontSizesDialog( {\n\ttext,\n\tconfirmButtonText,\n\tisOpen,\n\ttoggleOpen,\n\tonConfirm,\n} ) {\n\tconst handleConfirm = async () => {\n\t\ttoggleOpen();\n\t\tonConfirm();\n\t};\n\n\tconst handleCancel = () => {\n\t\ttoggleOpen();\n\t};\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isOpen }\n\t\t\tcancelButtonText={ __( 'Cancel' ) }\n\t\t\tconfirmButtonText={ confirmButtonText }\n\t\t\tonCancel={ handleCancel }\n\t\t\tonConfirm={ handleConfirm }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ text }\n\t\t</ConfirmDialog>\n\t);\n}\n\nexport default ConfirmResetFontSizesDialog;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,SAASC,2BAA2BA,CAAE;EACrCC,IAAI;EACJC,iBAAiB;EACjBC,MAAM;EACNC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,MAAMC,aAAa,GAAG,MAAAA,CAAA,KAAY;IACjCF,UAAU,CAAC,CAAC;IACZC,SAAS,CAAC,CAAC;EACZ,CAAC;EAED,MAAME,YAAY,GAAGA,CAAA,KAAM;IAC1BH,UAAU,CAAC,CAAC;EACb,CAAC;EAED,oBACCL,IAAA,CAACH,aAAa;IACbO,MAAM,EAAGA,MAAQ;IACjBK,gBAAgB,EAAGX,EAAE,CAAE,QAAS,CAAG;IACnCK,iBAAiB,EAAGA,iBAAmB;IACvCO,QAAQ,EAAGF,YAAc;IACzBF,SAAS,EAAGC,aAAe;IAC3BI,IAAI,EAAC,QAAQ;IAAAC,QAAA,EAEXV;EAAI,CACQ,CAAC;AAElB;AAEA,eAAeD,2BAA2B","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nfunction ConfirmResetFontSizesDialog( {\n\ttext,\n\tconfirmButtonText,\n\tisOpen,\n\ttoggleOpen,\n\tonConfirm,\n} ) {\n\tconst handleConfirm = async () => {\n\t\ttoggleOpen();\n\t\tonConfirm();\n\t};\n\n\tconst handleCancel = () => {\n\t\ttoggleOpen();\n\t};\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isOpen }\n\t\t\tcancelButtonText={ __( 'Cancel' ) }\n\t\t\tconfirmButtonText={ confirmButtonText }\n\t\t\tonCancel={ handleCancel }\n\t\t\tonConfirm={ handleConfirm }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ text }\n\t\t</ConfirmDialog>\n\t);\n}\n\nexport default ConfirmResetFontSizesDialog;\n"],
5
+ "mappings": "AAuBE;AApBF,SAAS,+BAA+B,qBAAqB;AAC7D,SAAS,UAAU;AAEnB,SAAS,4BAA6B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,gBAAgB,YAAY;AACjC,eAAW;AACX,cAAU;AAAA,EACX;AAEA,QAAM,eAAe,MAAM;AAC1B,eAAW;AAAA,EACZ;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,kBAAmB,GAAI,QAAS;AAAA,MAChC;AAAA,MACA,UAAW;AAAA,MACX,WAAY;AAAA,MACZ,MAAK;AAAA,MAEH;AAAA;AAAA,EACH;AAEF;AAEA,IAAO,0CAAQ;",
6
+ "names": []
7
+ }
@@ -1,22 +1,13 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { getComputedFluidTypographyValue, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
- import { __ } from '@wordpress/i18n';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
- import { unlock } from '../../../lock-unlock';
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- const {
13
- useGlobalStyle
14
- } = unlock(blockEditorPrivateApis);
15
- function FontSizePreview({
16
- fontSize
17
- }) {
18
- var _font$fontFamily;
19
- const [font] = useGlobalStyle('typography');
1
+ import { jsx } from "react/jsx-runtime";
2
+ import {
3
+ getComputedFluidTypographyValue,
4
+ privateApis as blockEditorPrivateApis
5
+ } from "@wordpress/block-editor";
6
+ import { __ } from "@wordpress/i18n";
7
+ import { unlock } from "../../../lock-unlock";
8
+ const { useGlobalStyle } = unlock(blockEditorPrivateApis);
9
+ function FontSizePreview({ fontSize }) {
10
+ const [font] = useGlobalStyle("typography");
20
11
  const input = fontSize?.fluid?.min && fontSize?.fluid?.max ? {
21
12
  minimumFontSize: fontSize.fluid.min,
22
13
  maximumFontSize: fontSize.fluid.max
@@ -24,14 +15,20 @@ function FontSizePreview({
24
15
  fontSize: fontSize.size
25
16
  };
26
17
  const computedFontSize = getComputedFluidTypographyValue(input);
27
- return /*#__PURE__*/_jsx("div", {
28
- className: "edit-site-typography-preview",
29
- style: {
30
- fontSize: computedFontSize,
31
- fontFamily: (_font$fontFamily = font?.fontFamily) !== null && _font$fontFamily !== void 0 ? _font$fontFamily : 'serif'
32
- },
33
- children: __('Aa')
34
- });
18
+ return /* @__PURE__ */ jsx(
19
+ "div",
20
+ {
21
+ className: "edit-site-typography-preview",
22
+ style: {
23
+ fontSize: computedFontSize,
24
+ fontFamily: font?.fontFamily ?? "serif"
25
+ },
26
+ children: __("Aa")
27
+ }
28
+ );
35
29
  }
36
- export default FontSizePreview;
37
- //# sourceMappingURL=font-size-preview.js.map
30
+ var font_size_preview_default = FontSizePreview;
31
+ export {
32
+ font_size_preview_default as default
33
+ };
34
+ //# sourceMappingURL=font-size-preview.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["getComputedFluidTypographyValue","privateApis","blockEditorPrivateApis","__","unlock","jsx","_jsx","useGlobalStyle","FontSizePreview","fontSize","_font$fontFamily","font","input","fluid","min","max","minimumFontSize","maximumFontSize","size","computedFontSize","className","style","fontFamily","children"],"sources":["@wordpress/edit-site/src/components/global-styles/font-sizes/font-size-preview.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tgetComputedFluidTypographyValue,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction FontSizePreview( { fontSize } ) {\n\tconst [ font ] = useGlobalStyle( 'typography' );\n\n\tconst input =\n\t\tfontSize?.fluid?.min && fontSize?.fluid?.max\n\t\t\t? {\n\t\t\t\t\tminimumFontSize: fontSize.fluid.min,\n\t\t\t\t\tmaximumFontSize: fontSize.fluid.max,\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tfontSize: fontSize.size,\n\t\t\t };\n\n\tconst computedFontSize = getComputedFluidTypographyValue( input );\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontSize: computedFontSize,\n\t\t\t\tfontFamily: font?.fontFamily ?? 'serif',\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Aa' ) }\n\t\t</div>\n\t);\n}\n\nexport default FontSizePreview;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,+BAA+B,EAC/BC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAC9C,MAAM;EAAEC;AAAe,CAAC,GAAGH,MAAM,CAAEF,sBAAuB,CAAC;AAE3D,SAASM,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAAA,IAAAC,gBAAA;EACxC,MAAM,CAAEC,IAAI,CAAE,GAAGJ,cAAc,CAAE,YAAa,CAAC;EAE/C,MAAMK,KAAK,GACVH,QAAQ,EAAEI,KAAK,EAAEC,GAAG,IAAIL,QAAQ,EAAEI,KAAK,EAAEE,GAAG,GACzC;IACAC,eAAe,EAAEP,QAAQ,CAACI,KAAK,CAACC,GAAG;IACnCG,eAAe,EAAER,QAAQ,CAACI,KAAK,CAACE;EAChC,CAAC,GACD;IACAN,QAAQ,EAAEA,QAAQ,CAACS;EACnB,CAAC;EAEL,MAAMC,gBAAgB,GAAGnB,+BAA+B,CAAEY,KAAM,CAAC;EACjE,oBACCN,IAAA;IACCc,SAAS,EAAC,8BAA8B;IACxCC,KAAK,EAAG;MACPZ,QAAQ,EAAEU,gBAAgB;MAC1BG,UAAU,GAAAZ,gBAAA,GAAEC,IAAI,EAAEW,UAAU,cAAAZ,gBAAA,cAAAA,gBAAA,GAAI;IACjC,CAAG;IAAAa,QAAA,EAEDpB,EAAE,CAAE,IAAK;EAAC,CACR,CAAC;AAER;AAEA,eAAeK,eAAe","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/global-styles/font-sizes/font-size-preview.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tgetComputedFluidTypographyValue,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction FontSizePreview( { fontSize } ) {\n\tconst [ font ] = useGlobalStyle( 'typography' );\n\n\tconst input =\n\t\tfontSize?.fluid?.min && fontSize?.fluid?.max\n\t\t\t? {\n\t\t\t\t\tminimumFontSize: fontSize.fluid.min,\n\t\t\t\t\tmaximumFontSize: fontSize.fluid.max,\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tfontSize: fontSize.size,\n\t\t\t };\n\n\tconst computedFontSize = getComputedFluidTypographyValue( input );\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontSize: computedFontSize,\n\t\t\t\tfontFamily: font?.fontFamily ?? 'serif',\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Aa' ) }\n\t\t</div>\n\t);\n}\n\nexport default FontSizePreview;\n"],
5
+ "mappings": "AA8BE;AA3BF;AAAA,EACC;AAAA,EACA,eAAe;AAAA,OACT;AACP,SAAS,UAAU;AAKnB,SAAS,cAAc;AACvB,MAAM,EAAE,eAAe,IAAI,OAAQ,sBAAuB;AAE1D,SAAS,gBAAiB,EAAE,SAAS,GAAI;AACxC,QAAM,CAAE,IAAK,IAAI,eAAgB,YAAa;AAE9C,QAAM,QACL,UAAU,OAAO,OAAO,UAAU,OAAO,MACtC;AAAA,IACA,iBAAiB,SAAS,MAAM;AAAA,IAChC,iBAAiB,SAAS,MAAM;AAAA,EAChC,IACA;AAAA,IACA,UAAU,SAAS;AAAA,EACnB;AAEJ,QAAM,mBAAmB,gCAAiC,KAAM;AAChE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAQ;AAAA,QACP,UAAU;AAAA,QACV,YAAY,MAAM,cAAc;AAAA,MACjC;AAAA,MAEE,aAAI,IAAK;AAAA;AAAA,EACZ;AAEF;AAEA,IAAO,4BAAQ;",
6
+ "names": []
7
+ }