@wordpress/edit-site 6.33.3 → 6.34.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 (654) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-editor/use-site-editor-settings.js +14 -2
  3. package/build/components/block-editor/use-site-editor-settings.js.map +3 -3
  4. package/build/components/canvas-loader/index.js +5 -8
  5. package/build/components/canvas-loader/index.js.map +3 -3
  6. package/build/components/editor/index.js +2 -40
  7. package/build/components/editor/index.js.map +3 -3
  8. package/build/components/layout/index.js +5 -7
  9. package/build/components/layout/index.js.map +3 -3
  10. package/build/components/page-patterns/fields.js +4 -3
  11. package/build/components/page-patterns/fields.js.map +3 -3
  12. package/build/components/page-templates/fields.js +2 -2
  13. package/build/components/page-templates/fields.js.map +3 -3
  14. package/build/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +22 -46
  15. package/build/components/sidebar-global-styles/index.js.map +7 -0
  16. package/build/components/sidebar-navigation-screen-global-styles/content.js +38 -16
  17. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +3 -3
  18. package/build/components/sidebar-navigation-screen-global-styles/index.js +6 -7
  19. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +3 -3
  20. package/build/components/sidebar-navigation-screen-main/index.js +0 -9
  21. package/build/components/sidebar-navigation-screen-main/index.js.map +3 -3
  22. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  23. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
  24. package/build/components/site-editor-routes/stylebook.js +5 -3
  25. package/build/components/site-editor-routes/stylebook.js.map +3 -3
  26. package/build/components/site-editor-routes/styles.js +33 -11
  27. package/build/components/site-editor-routes/styles.js.map +3 -3
  28. package/build/components/welcome-guide/index.js +0 -2
  29. package/build/components/welcome-guide/index.js.map +3 -3
  30. package/build/hooks/commands/use-common-commands.js +10 -12
  31. package/build/hooks/commands/use-common-commands.js.map +3 -3
  32. package/build/hooks/commands/use-set-command-context.js +0 -5
  33. package/build/hooks/commands/use-set-command-context.js.map +2 -2
  34. package/build/index.js +0 -1
  35. package/build/index.js.map +2 -2
  36. package/build/posts.js +0 -1
  37. package/build/posts.js.map +2 -2
  38. package/build/store/private-actions.js +0 -8
  39. package/build/store/private-actions.js.map +2 -2
  40. package/build/store/private-selectors.js +0 -5
  41. package/build/store/private-selectors.js.map +2 -2
  42. package/build/store/reducer.js +0 -8
  43. package/build/store/reducer.js.map +2 -2
  44. package/build-module/components/block-editor/use-site-editor-settings.js +14 -2
  45. package/build-module/components/block-editor/use-site-editor-settings.js.map +2 -2
  46. package/build-module/components/canvas-loader/index.js +5 -8
  47. package/build-module/components/canvas-loader/index.js.map +2 -2
  48. package/build-module/components/editor/index.js +4 -46
  49. package/build-module/components/editor/index.js.map +2 -2
  50. package/build-module/components/layout/index.js +5 -7
  51. package/build-module/components/layout/index.js.map +2 -2
  52. package/build-module/components/page-patterns/fields.js +5 -7
  53. package/build-module/components/page-patterns/fields.js.map +2 -2
  54. package/build-module/components/page-templates/fields.js +6 -6
  55. package/build-module/components/page-templates/fields.js.map +2 -2
  56. package/build-module/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +21 -41
  57. package/build-module/components/sidebar-global-styles/index.js.map +7 -0
  58. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +42 -6
  59. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +2 -2
  60. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -6
  61. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +2 -2
  62. package/build-module/components/sidebar-navigation-screen-main/index.js +1 -10
  63. package/build-module/components/sidebar-navigation-screen-main/index.js.map +2 -2
  64. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  65. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
  66. package/build-module/components/site-editor-routes/stylebook.js +3 -1
  67. package/build-module/components/site-editor-routes/stylebook.js.map +2 -2
  68. package/build-module/components/site-editor-routes/styles.js +31 -9
  69. package/build-module/components/site-editor-routes/styles.js.map +2 -2
  70. package/build-module/components/welcome-guide/index.js +0 -2
  71. package/build-module/components/welcome-guide/index.js.map +2 -2
  72. package/build-module/hooks/commands/use-common-commands.js +13 -12
  73. package/build-module/hooks/commands/use-common-commands.js.map +2 -2
  74. package/build-module/hooks/commands/use-set-command-context.js +0 -5
  75. package/build-module/hooks/commands/use-set-command-context.js.map +2 -2
  76. package/build-module/index.js +0 -1
  77. package/build-module/index.js.map +2 -2
  78. package/build-module/posts.js +0 -1
  79. package/build-module/posts.js.map +2 -2
  80. package/build-module/store/private-actions.js +0 -7
  81. package/build-module/store/private-actions.js.map +2 -2
  82. package/build-module/store/private-selectors.js +0 -4
  83. package/build-module/store/private-selectors.js.map +2 -2
  84. package/build-module/store/reducer.js +0 -8
  85. package/build-module/store/reducer.js.map +2 -2
  86. package/build-style/posts-rtl.css +13 -50
  87. package/build-style/posts.css +13 -50
  88. package/build-style/style-rtl.css +722 -726
  89. package/build-style/style.css +722 -726
  90. package/package.json +49 -44
  91. package/src/components/block-editor/use-site-editor-settings.js +21 -2
  92. package/src/components/canvas-loader/index.js +5 -9
  93. package/src/components/editor/index.js +2 -50
  94. package/src/components/layout/index.js +6 -10
  95. package/src/components/page-patterns/fields.js +5 -7
  96. package/src/components/page-templates/fields.js +6 -6
  97. package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +16 -48
  98. package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/style.scss +3 -3
  99. package/src/components/sidebar-navigation-screen/style.scss +5 -12
  100. package/src/components/sidebar-navigation-screen-global-styles/content.js +34 -6
  101. package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -9
  102. package/src/components/sidebar-navigation-screen-main/index.js +1 -12
  103. package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
  104. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  105. package/src/components/site-editor-routes/stylebook.js +4 -1
  106. package/src/components/site-editor-routes/styles.js +35 -9
  107. package/src/components/site-hub/style.scss +1 -1
  108. package/src/components/welcome-guide/index.js +0 -2
  109. package/src/components/welcome-guide/style.scss +1 -2
  110. package/src/hooks/commands/use-common-commands.js +19 -12
  111. package/src/hooks/commands/use-set-command-context.js +0 -11
  112. package/src/index.js +0 -1
  113. package/src/posts.js +0 -1
  114. package/src/posts.scss +0 -1
  115. package/src/store/private-actions.js +0 -14
  116. package/src/store/private-selectors.js +0 -11
  117. package/src/store/reducer.js +0 -18
  118. package/src/style.scss +2 -9
  119. package/tsconfig.json +3 -11
  120. package/build/components/editor-canvas-container/index.js +0 -139
  121. package/build/components/editor-canvas-container/index.js.map +0 -7
  122. package/build/components/global-styles/background-panel.js +0 -62
  123. package/build/components/global-styles/background-panel.js.map +0 -7
  124. package/build/components/global-styles/block-preview-panel.js +0 -87
  125. package/build/components/global-styles/block-preview-panel.js.map +0 -7
  126. package/build/components/global-styles/color-indicator-wrapper.js +0 -50
  127. package/build/components/global-styles/color-indicator-wrapper.js.map +0 -7
  128. package/build/components/global-styles/color-palette-panel.js +0 -133
  129. package/build/components/global-styles/color-palette-panel.js.map +0 -7
  130. package/build/components/global-styles/confirm-reset-shadow-dialog.js +0 -55
  131. package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
  132. package/build/components/global-styles/dimensions-panel.js +0 -92
  133. package/build/components/global-styles/dimensions-panel.js.map +0 -7
  134. package/build/components/global-styles/font-families.js +0 -114
  135. package/build/components/global-styles/font-families.js.map +0 -7
  136. package/build/components/global-styles/font-family-item.js +0 -48
  137. package/build/components/global-styles/font-family-item.js.map +0 -7
  138. package/build/components/global-styles/font-library-modal/collection-font-variant.js +0 -75
  139. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
  140. package/build/components/global-styles/font-library-modal/context.js +0 -386
  141. package/build/components/global-styles/font-library-modal/context.js.map +0 -7
  142. package/build/components/global-styles/font-library-modal/font-card.js +0 -76
  143. package/build/components/global-styles/font-library-modal/font-card.js.map +0 -7
  144. package/build/components/global-styles/font-library-modal/font-collection.js +0 -504
  145. package/build/components/global-styles/font-library-modal/font-collection.js.map +0 -7
  146. package/build/components/global-styles/font-library-modal/font-demo.js +0 -108
  147. package/build/components/global-styles/font-library-modal/font-demo.js.map +0 -7
  148. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -58
  149. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
  150. package/build/components/global-styles/font-library-modal/index.js +0 -110
  151. package/build/components/global-styles/font-library-modal/index.js.map +0 -7
  152. package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -455
  153. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
  154. package/build/components/global-styles/font-library-modal/library-font-details.js +0 -63
  155. package/build/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
  156. package/build/components/global-styles/font-library-modal/library-font-variant.js +0 -78
  157. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
  158. package/build/components/global-styles/font-library-modal/resolvers.js +0 -115
  159. package/build/components/global-styles/font-library-modal/resolvers.js.map +0 -7
  160. package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -205
  161. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
  162. package/build/components/global-styles/font-library-modal/utils/constants.js +0 -49
  163. package/build/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
  164. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -39
  165. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
  166. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -51
  167. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
  168. package/build/components/global-styles/font-library-modal/utils/index.js +0 -277
  169. package/build/components/global-styles/font-library-modal/utils/index.js.map +0 -7
  170. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -42
  171. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
  172. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +0 -117
  173. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
  174. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -56
  175. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
  176. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +0 -63
  177. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
  178. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -60
  179. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
  180. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -55
  181. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
  182. package/build/components/global-styles/font-sizes/font-size-preview.js +0 -51
  183. package/build/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
  184. package/build/components/global-styles/font-sizes/font-size.js +0 -260
  185. package/build/components/global-styles/font-sizes/font-size.js.map +0 -7
  186. package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -50
  187. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
  188. package/build/components/global-styles/font-sizes/font-sizes.js +0 -220
  189. package/build/components/global-styles/font-sizes/font-sizes.js.map +0 -7
  190. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -90
  191. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
  192. package/build/components/global-styles/gradients-palette-panel.js +0 -144
  193. package/build/components/global-styles/gradients-palette-panel.js.map +0 -7
  194. package/build/components/global-styles/header.js +0 -54
  195. package/build/components/global-styles/header.js.map +0 -7
  196. package/build/components/global-styles/highlighted-colors.js +0 -57
  197. package/build/components/global-styles/highlighted-colors.js.map +0 -7
  198. package/build/components/global-styles/hooks.js +0 -113
  199. package/build/components/global-styles/hooks.js.map +0 -7
  200. package/build/components/global-styles/icon-with-current-color.js +0 -53
  201. package/build/components/global-styles/icon-with-current-color.js.map +0 -7
  202. package/build/components/global-styles/index.js +0 -39
  203. package/build/components/global-styles/index.js.map +0 -7
  204. package/build/components/global-styles/navigation-button.js +0 -48
  205. package/build/components/global-styles/navigation-button.js.map +0 -7
  206. package/build/components/global-styles/palette.js +0 -86
  207. package/build/components/global-styles/palette.js.map +0 -7
  208. package/build/components/global-styles/preset-colors.js +0 -40
  209. package/build/components/global-styles/preset-colors.js.map +0 -7
  210. package/build/components/global-styles/preview-colors.js +0 -82
  211. package/build/components/global-styles/preview-colors.js.map +0 -7
  212. package/build/components/global-styles/preview-styles.js +0 -214
  213. package/build/components/global-styles/preview-styles.js.map +0 -7
  214. package/build/components/global-styles/preview-typography.js +0 -68
  215. package/build/components/global-styles/preview-typography.js.map +0 -7
  216. package/build/components/global-styles/preview-wrapper.js +0 -101
  217. package/build/components/global-styles/preview-wrapper.js.map +0 -7
  218. package/build/components/global-styles/root-menu.js +0 -72
  219. package/build/components/global-styles/root-menu.js.map +0 -7
  220. package/build/components/global-styles/screen-background.js +0 -59
  221. package/build/components/global-styles/screen-background.js.map +0 -7
  222. package/build/components/global-styles/screen-block-list.js +0 -170
  223. package/build/components/global-styles/screen-block-list.js.map +0 -7
  224. package/build/components/global-styles/screen-block.js +0 -316
  225. package/build/components/global-styles/screen-block.js.map +0 -7
  226. package/build/components/global-styles/screen-color-palette.js +0 -64
  227. package/build/components/global-styles/screen-color-palette.js.map +0 -7
  228. package/build/components/global-styles/screen-colors.js +0 -81
  229. package/build/components/global-styles/screen-colors.js.map +0 -7
  230. package/build/components/global-styles/screen-css.js +0 -92
  231. package/build/components/global-styles/screen-css.js.map +0 -7
  232. package/build/components/global-styles/screen-layout.js +0 -51
  233. package/build/components/global-styles/screen-layout.js.map +0 -7
  234. package/build/components/global-styles/screen-revisions/index.js +0 -179
  235. package/build/components/global-styles/screen-revisions/index.js.map +0 -7
  236. package/build/components/global-styles/screen-revisions/revisions-buttons.js +0 -192
  237. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
  238. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -148
  239. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
  240. package/build/components/global-styles/screen-root.js +0 -99
  241. package/build/components/global-styles/screen-root.js.map +0 -7
  242. package/build/components/global-styles/screen-shadows.js +0 -49
  243. package/build/components/global-styles/screen-shadows.js.map +0 -7
  244. package/build/components/global-styles/screen-style-variations.js +0 -70
  245. package/build/components/global-styles/screen-style-variations.js.map +0 -7
  246. package/build/components/global-styles/screen-typography-element.js +0 -167
  247. package/build/components/global-styles/screen-typography-element.js.map +0 -7
  248. package/build/components/global-styles/screen-typography.js +0 -68
  249. package/build/components/global-styles/screen-typography.js.map +0 -7
  250. package/build/components/global-styles/shadow-utils.js +0 -125
  251. package/build/components/global-styles/shadow-utils.js.map +0 -7
  252. package/build/components/global-styles/shadows-edit-panel.js +0 -501
  253. package/build/components/global-styles/shadows-edit-panel.js.map +0 -7
  254. package/build/components/global-styles/shadows-panel.js +0 -206
  255. package/build/components/global-styles/shadows-panel.js.map +0 -7
  256. package/build/components/global-styles/size-control/index.js +0 -80
  257. package/build/components/global-styles/size-control/index.js.map +0 -7
  258. package/build/components/global-styles/style-variations-container.js +0 -124
  259. package/build/components/global-styles/style-variations-container.js.map +0 -7
  260. package/build/components/global-styles/subtitle.js +0 -37
  261. package/build/components/global-styles/subtitle.js.map +0 -7
  262. package/build/components/global-styles/typeset.js +0 -78
  263. package/build/components/global-styles/typeset.js.map +0 -7
  264. package/build/components/global-styles/typography-elements.js +0 -123
  265. package/build/components/global-styles/typography-elements.js.map +0 -7
  266. package/build/components/global-styles/typography-example.js +0 -81
  267. package/build/components/global-styles/typography-example.js.map +0 -7
  268. package/build/components/global-styles/typography-panel.js +0 -69
  269. package/build/components/global-styles/typography-panel.js.map +0 -7
  270. package/build/components/global-styles/typography-preview.js +0 -80
  271. package/build/components/global-styles/typography-preview.js.map +0 -7
  272. package/build/components/global-styles/ui.js +0 -355
  273. package/build/components/global-styles/ui.js.map +0 -7
  274. package/build/components/global-styles/utils.js +0 -92
  275. package/build/components/global-styles/utils.js.map +0 -7
  276. package/build/components/global-styles/variations/variation.js +0 -118
  277. package/build/components/global-styles/variations/variation.js.map +0 -7
  278. package/build/components/global-styles/variations/variations-color.js +0 -61
  279. package/build/components/global-styles/variations/variations-color.js.map +0 -7
  280. package/build/components/global-styles/variations/variations-panel.js +0 -71
  281. package/build/components/global-styles/variations/variations-panel.js.map +0 -7
  282. package/build/components/global-styles/variations/variations-typography.js +0 -75
  283. package/build/components/global-styles/variations/variations-typography.js.map +0 -7
  284. package/build/components/global-styles-renderer/index.js +0 -57
  285. package/build/components/global-styles-renderer/index.js.map +0 -7
  286. package/build/components/global-styles-sidebar/default-sidebar.js +0 -68
  287. package/build/components/global-styles-sidebar/default-sidebar.js.map +0 -7
  288. package/build/components/global-styles-sidebar/index.js +0 -202
  289. package/build/components/global-styles-sidebar/index.js.map +0 -7
  290. package/build/components/revisions/index.js +0 -120
  291. package/build/components/revisions/index.js.map +0 -7
  292. package/build/components/sidebar-global-styles-wrapper/index.js.map +0 -7
  293. package/build/components/style-book/categories.js +0 -86
  294. package/build/components/style-book/categories.js.map +0 -7
  295. package/build/components/style-book/color-examples.js +0 -65
  296. package/build/components/style-book/color-examples.js.map +0 -7
  297. package/build/components/style-book/constants.js +0 -319
  298. package/build/components/style-book/constants.js.map +0 -7
  299. package/build/components/style-book/duotone-examples.js +0 -69
  300. package/build/components/style-book/duotone-examples.js.map +0 -7
  301. package/build/components/style-book/examples.js +0 -237
  302. package/build/components/style-book/examples.js.map +0 -7
  303. package/build/components/style-book/index.js +0 -644
  304. package/build/components/style-book/index.js.map +0 -7
  305. package/build/components/style-book/types.js +0 -17
  306. package/build/components/style-book/types.js.map +0 -7
  307. package/build/components/welcome-guide/styles.js +0 -145
  308. package/build/components/welcome-guide/styles.js.map +0 -7
  309. package/build/hooks/index.js +0 -3
  310. package/build/hooks/index.js.map +0 -7
  311. package/build/hooks/push-changes-to-global-styles/index.js +0 -319
  312. package/build/hooks/push-changes-to-global-styles/index.js.map +0 -7
  313. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -126
  314. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
  315. package/build/utils/set-nested-value.js +0 -43
  316. package/build/utils/set-nested-value.js.map +0 -7
  317. package/build-module/components/editor-canvas-container/index.js +0 -120
  318. package/build-module/components/editor-canvas-container/index.js.map +0 -7
  319. package/build-module/components/global-styles/background-panel.js +0 -38
  320. package/build-module/components/global-styles/background-panel.js.map +0 -7
  321. package/build-module/components/global-styles/block-preview-panel.js +0 -67
  322. package/build-module/components/global-styles/block-preview-panel.js.map +0 -7
  323. package/build-module/components/global-styles/color-indicator-wrapper.js +0 -20
  324. package/build-module/components/global-styles/color-indicator-wrapper.js.map +0 -7
  325. package/build-module/components/global-styles/color-palette-panel.js +0 -107
  326. package/build-module/components/global-styles/color-palette-panel.js.map +0 -7
  327. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +0 -35
  328. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
  329. package/build-module/components/global-styles/dimensions-panel.js +0 -72
  330. package/build-module/components/global-styles/dimensions-panel.js.map +0 -7
  331. package/build-module/components/global-styles/font-families.js +0 -92
  332. package/build-module/components/global-styles/font-families.js.map +0 -7
  333. package/build-module/components/global-styles/font-family-item.js +0 -32
  334. package/build-module/components/global-styles/font-family-item.js.map +0 -7
  335. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +0 -45
  336. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
  337. package/build-module/components/global-styles/font-library-modal/context.js +0 -372
  338. package/build-module/components/global-styles/font-library-modal/context.js.map +0 -7
  339. package/build-module/components/global-styles/font-library-modal/font-card.js +0 -53
  340. package/build-module/components/global-styles/font-library-modal/font-card.js.map +0 -7
  341. package/build-module/components/global-styles/font-library-modal/font-collection.js +0 -505
  342. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +0 -7
  343. package/build-module/components/global-styles/font-library-modal/font-demo.js +0 -91
  344. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +0 -7
  345. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -45
  346. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
  347. package/build-module/components/global-styles/font-library-modal/index.js +0 -83
  348. package/build-module/components/global-styles/font-library-modal/index.js.map +0 -7
  349. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -444
  350. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
  351. package/build-module/components/global-styles/font-library-modal/library-font-details.js +0 -36
  352. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
  353. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +0 -48
  354. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
  355. package/build-module/components/global-styles/font-library-modal/resolvers.js +0 -76
  356. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +0 -7
  357. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -185
  358. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
  359. package/build-module/components/global-styles/font-library-modal/utils/constants.js +0 -23
  360. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
  361. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -19
  362. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
  363. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -26
  364. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
  365. package/build-module/components/global-styles/font-library-modal/utils/index.js +0 -241
  366. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +0 -7
  367. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -22
  368. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
  369. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +0 -90
  370. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
  371. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -32
  372. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
  373. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +0 -39
  374. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
  375. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -40
  376. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
  377. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -35
  378. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
  379. package/build-module/components/global-styles/font-sizes/font-size-preview.js +0 -34
  380. package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
  381. package/build-module/components/global-styles/font-sizes/font-size.js +0 -240
  382. package/build-module/components/global-styles/font-sizes/font-size.js.map +0 -7
  383. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -25
  384. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
  385. package/build-module/components/global-styles/font-sizes/font-sizes.js +0 -205
  386. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +0 -7
  387. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -76
  388. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
  389. package/build-module/components/global-styles/gradients-palette-panel.js +0 -119
  390. package/build-module/components/global-styles/gradients-palette-panel.js.map +0 -7
  391. package/build-module/components/global-styles/header.js +0 -41
  392. package/build-module/components/global-styles/header.js.map +0 -7
  393. package/build-module/components/global-styles/highlighted-colors.js +0 -37
  394. package/build-module/components/global-styles/highlighted-colors.js.map +0 -7
  395. package/build-module/components/global-styles/hooks.js +0 -77
  396. package/build-module/components/global-styles/hooks.js.map +0 -7
  397. package/build-module/components/global-styles/icon-with-current-color.js +0 -19
  398. package/build-module/components/global-styles/icon-with-current-color.js.map +0 -7
  399. package/build-module/components/global-styles/index.js +0 -5
  400. package/build-module/components/global-styles/index.js.map +0 -7
  401. package/build-module/components/global-styles/navigation-button.js +0 -28
  402. package/build-module/components/global-styles/navigation-button.js.map +0 -7
  403. package/build-module/components/global-styles/palette.js +0 -63
  404. package/build-module/components/global-styles/palette.js.map +0 -7
  405. package/build-module/components/global-styles/preset-colors.js +0 -20
  406. package/build-module/components/global-styles/preset-colors.js.map +0 -7
  407. package/build-module/components/global-styles/preview-colors.js +0 -55
  408. package/build-module/components/global-styles/preview-colors.js.map +0 -7
  409. package/build-module/components/global-styles/preview-styles.js +0 -188
  410. package/build-module/components/global-styles/preview-styles.js.map +0 -7
  411. package/build-module/components/global-styles/preview-typography.js +0 -38
  412. package/build-module/components/global-styles/preview-typography.js.map +0 -7
  413. package/build-module/components/global-styles/preview-wrapper.js +0 -85
  414. package/build-module/components/global-styles/preview-wrapper.js.map +0 -7
  415. package/build-module/components/global-styles/root-menu.js +0 -58
  416. package/build-module/components/global-styles/root-menu.js.map +0 -7
  417. package/build-module/components/global-styles/screen-background.js +0 -29
  418. package/build-module/components/global-styles/screen-background.js.map +0 -7
  419. package/build-module/components/global-styles/screen-block-list.js +0 -150
  420. package/build-module/components/global-styles/screen-block-list.js.map +0 -7
  421. package/build-module/components/global-styles/screen-block.js +0 -293
  422. package/build-module/components/global-styles/screen-block.js.map +0 -7
  423. package/build-module/components/global-styles/screen-color-palette.js +0 -34
  424. package/build-module/components/global-styles/screen-color-palette.js.map +0 -7
  425. package/build-module/components/global-styles/screen-colors.js +0 -51
  426. package/build-module/components/global-styles/screen-colors.js.map +0 -7
  427. package/build-module/components/global-styles/screen-css.js +0 -62
  428. package/build-module/components/global-styles/screen-css.js.map +0 -7
  429. package/build-module/components/global-styles/screen-layout.js +0 -21
  430. package/build-module/components/global-styles/screen-layout.js.map +0 -7
  431. package/build-module/components/global-styles/screen-revisions/index.js +0 -155
  432. package/build-module/components/global-styles/screen-revisions/index.js.map +0 -7
  433. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +0 -172
  434. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
  435. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -128
  436. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
  437. package/build-module/components/global-styles/screen-root.js +0 -79
  438. package/build-module/components/global-styles/screen-root.js.map +0 -7
  439. package/build-module/components/global-styles/screen-shadows.js +0 -14
  440. package/build-module/components/global-styles/screen-shadows.js.map +0 -7
  441. package/build-module/components/global-styles/screen-style-variations.js +0 -43
  442. package/build-module/components/global-styles/screen-style-variations.js.map +0 -7
  443. package/build-module/components/global-styles/screen-typography-element.js +0 -141
  444. package/build-module/components/global-styles/screen-typography-element.js.map +0 -7
  445. package/build-module/components/global-styles/screen-typography.js +0 -38
  446. package/build-module/components/global-styles/screen-typography.js.map +0 -7
  447. package/build-module/components/global-styles/shadow-utils.js +0 -98
  448. package/build-module/components/global-styles/shadow-utils.js.map +0 -7
  449. package/build-module/components/global-styles/shadows-edit-panel.js +0 -500
  450. package/build-module/components/global-styles/shadows-edit-panel.js.map +0 -7
  451. package/build-module/components/global-styles/shadows-panel.js +0 -185
  452. package/build-module/components/global-styles/shadows-panel.js.map +0 -7
  453. package/build-module/components/global-styles/size-control/index.js +0 -70
  454. package/build-module/components/global-styles/size-control/index.js.map +0 -7
  455. package/build-module/components/global-styles/style-variations-container.js +0 -94
  456. package/build-module/components/global-styles/style-variations-container.js.map +0 -7
  457. package/build-module/components/global-styles/subtitle.js +0 -17
  458. package/build-module/components/global-styles/subtitle.js.map +0 -7
  459. package/build-module/components/global-styles/typeset.js +0 -54
  460. package/build-module/components/global-styles/typeset.js.map +0 -7
  461. package/build-module/components/global-styles/typography-elements.js +0 -98
  462. package/build-module/components/global-styles/typography-elements.js.map +0 -7
  463. package/build-module/components/global-styles/typography-example.js +0 -61
  464. package/build-module/components/global-styles/typography-example.js.map +0 -7
  465. package/build-module/components/global-styles/typography-panel.js +0 -49
  466. package/build-module/components/global-styles/typography-panel.js.map +0 -7
  467. package/build-module/components/global-styles/typography-preview.js +0 -60
  468. package/build-module/components/global-styles/typography-preview.js.map +0 -7
  469. package/build-module/components/global-styles/ui.js +0 -334
  470. package/build-module/components/global-styles/ui.js.map +0 -7
  471. package/build-module/components/global-styles/utils.js +0 -66
  472. package/build-module/components/global-styles/utils.js.map +0 -7
  473. package/build-module/components/global-styles/variations/variation.js +0 -88
  474. package/build-module/components/global-styles/variations/variation.js.map +0 -7
  475. package/build-module/components/global-styles/variations/variations-color.js +0 -34
  476. package/build-module/components/global-styles/variations/variations-color.js.map +0 -7
  477. package/build-module/components/global-styles/variations/variations-panel.js +0 -46
  478. package/build-module/components/global-styles/variations/variations-panel.js.map +0 -7
  479. package/build-module/components/global-styles/variations/variations-typography.js +0 -48
  480. package/build-module/components/global-styles/variations/variations-typography.js.map +0 -7
  481. package/build-module/components/global-styles-renderer/index.js +0 -33
  482. package/build-module/components/global-styles-renderer/index.js.map +0 -7
  483. package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -48
  484. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +0 -7
  485. package/build-module/components/global-styles-sidebar/index.js +0 -175
  486. package/build-module/components/global-styles-sidebar/index.js.map +0 -7
  487. package/build-module/components/revisions/index.js +0 -96
  488. package/build-module/components/revisions/index.js.map +0 -7
  489. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +0 -7
  490. package/build-module/components/style-book/categories.js +0 -64
  491. package/build-module/components/style-book/categories.js.map +0 -7
  492. package/build-module/components/style-book/color-examples.js +0 -38
  493. package/build-module/components/style-book/color-examples.js.map +0 -7
  494. package/build-module/components/style-book/constants.js +0 -290
  495. package/build-module/components/style-book/constants.js.map +0 -7
  496. package/build-module/components/style-book/duotone-examples.js +0 -49
  497. package/build-module/components/style-book/duotone-examples.js.map +0 -7
  498. package/build-module/components/style-book/examples.js +0 -208
  499. package/build-module/components/style-book/examples.js.map +0 -7
  500. package/build-module/components/style-book/index.js +0 -635
  501. package/build-module/components/style-book/index.js.map +0 -7
  502. package/build-module/components/style-book/types.js +0 -1
  503. package/build-module/components/style-book/types.js.map +0 -7
  504. package/build-module/components/welcome-guide/styles.js +0 -115
  505. package/build-module/components/welcome-guide/styles.js.map +0 -7
  506. package/build-module/hooks/index.js +0 -2
  507. package/build-module/hooks/index.js.map +0 -7
  508. package/build-module/hooks/push-changes-to-global-styles/index.js +0 -305
  509. package/build-module/hooks/push-changes-to-global-styles/index.js.map +0 -7
  510. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -99
  511. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
  512. package/build-module/utils/set-nested-value.js +0 -23
  513. package/build-module/utils/set-nested-value.js.map +0 -7
  514. package/build-types/components/style-book/categories.d.ts +0 -18
  515. package/build-types/components/style-book/categories.d.ts.map +0 -1
  516. package/build-types/components/style-book/color-examples.d.ts +0 -7
  517. package/build-types/components/style-book/color-examples.d.ts.map +0 -1
  518. package/build-types/components/style-book/constants.d.ts +0 -11
  519. package/build-types/components/style-book/constants.d.ts.map +0 -1
  520. package/build-types/components/style-book/duotone-examples.d.ts +0 -9
  521. package/build-types/components/style-book/duotone-examples.d.ts.map +0 -1
  522. package/build-types/components/style-book/examples.d.ts +0 -12
  523. package/build-types/components/style-book/examples.d.ts.map +0 -1
  524. package/build-types/components/style-book/types.d.ts +0 -72
  525. package/build-types/components/style-book/types.d.ts.map +0 -1
  526. package/lib/inflate.js +0 -3333
  527. package/lib/lib-font.browser.js +0 -3861
  528. package/lib/unbrotli.js +0 -2039
  529. package/src/components/editor-canvas-container/index.js +0 -149
  530. package/src/components/editor-canvas-container/style.scss +0 -43
  531. package/src/components/global-styles/README.md +0 -17
  532. package/src/components/global-styles/background-panel.js +0 -55
  533. package/src/components/global-styles/block-preview-panel.js +0 -81
  534. package/src/components/global-styles/color-indicator-wrapper.js +0 -23
  535. package/src/components/global-styles/color-palette-panel.js +0 -110
  536. package/src/components/global-styles/confirm-reset-shadow-dialog.js +0 -37
  537. package/src/components/global-styles/dimensions-panel.js +0 -86
  538. package/src/components/global-styles/font-families.js +0 -128
  539. package/src/components/global-styles/font-family-item.js +0 -47
  540. package/src/components/global-styles/font-library-modal/collection-font-variant.js +0 -51
  541. package/src/components/global-styles/font-library-modal/context.js +0 -540
  542. package/src/components/global-styles/font-library-modal/font-card.js +0 -67
  543. package/src/components/global-styles/font-library-modal/font-collection.js +0 -575
  544. package/src/components/global-styles/font-library-modal/font-demo.js +0 -116
  545. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -57
  546. package/src/components/global-styles/font-library-modal/index.js +0 -106
  547. package/src/components/global-styles/font-library-modal/installed-fonts.js +0 -518
  548. package/src/components/global-styles/font-library-modal/library-font-details.js +0 -45
  549. package/src/components/global-styles/font-library-modal/library-font-variant.js +0 -60
  550. package/src/components/global-styles/font-library-modal/resolvers.js +0 -78
  551. package/src/components/global-styles/font-library-modal/style.scss +0 -220
  552. package/src/components/global-styles/font-library-modal/upload-fonts.js +0 -253
  553. package/src/components/global-styles/font-library-modal/utils/constants.js +0 -23
  554. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -35
  555. package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -22
  556. package/src/components/global-styles/font-library-modal/utils/index.js +0 -333
  557. package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -27
  558. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +0 -152
  559. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -37
  560. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +0 -99
  561. package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +0 -109
  562. package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +0 -42
  563. package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +0 -30
  564. package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +0 -31
  565. package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +0 -57
  566. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +0 -56
  567. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +0 -108
  568. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +0 -216
  569. package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +0 -41
  570. package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +0 -74
  571. package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +0 -141
  572. package/src/components/global-styles/font-library-modal/utils/toggleFont.js +0 -90
  573. package/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -43
  574. package/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -37
  575. package/src/components/global-styles/font-sizes/font-size-preview.js +0 -43
  576. package/src/components/global-styles/font-sizes/font-size.js +0 -265
  577. package/src/components/global-styles/font-sizes/font-sizes-count.js +0 -37
  578. package/src/components/global-styles/font-sizes/font-sizes.js +0 -261
  579. package/src/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -70
  580. package/src/components/global-styles/gradients-palette-panel.js +0 -123
  581. package/src/components/global-styles/header.js +0 -48
  582. package/src/components/global-styles/highlighted-colors.js +0 -39
  583. package/src/components/global-styles/hooks.js +0 -111
  584. package/src/components/global-styles/icon-with-current-color.js +0 -21
  585. package/src/components/global-styles/index.js +0 -1
  586. package/src/components/global-styles/navigation-button.js +0 -38
  587. package/src/components/global-styles/palette.js +0 -90
  588. package/src/components/global-styles/preset-colors.js +0 -18
  589. package/src/components/global-styles/preview-colors.js +0 -58
  590. package/src/components/global-styles/preview-styles.js +0 -185
  591. package/src/components/global-styles/preview-typography.js +0 -39
  592. package/src/components/global-styles/preview-wrapper.js +0 -126
  593. package/src/components/global-styles/root-menu.js +0 -84
  594. package/src/components/global-styles/screen-background.js +0 -37
  595. package/src/components/global-styles/screen-block-list.js +0 -187
  596. package/src/components/global-styles/screen-block.js +0 -358
  597. package/src/components/global-styles/screen-color-palette.js +0 -42
  598. package/src/components/global-styles/screen-colors.js +0 -55
  599. package/src/components/global-styles/screen-css.js +0 -67
  600. package/src/components/global-styles/screen-layout.js +0 -30
  601. package/src/components/global-styles/screen-revisions/index.js +0 -202
  602. package/src/components/global-styles/screen-revisions/revisions-buttons.js +0 -238
  603. package/src/components/global-styles/screen-revisions/style.scss +0 -194
  604. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +0 -228
  605. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -159
  606. package/src/components/global-styles/screen-root.js +0 -102
  607. package/src/components/global-styles/screen-shadows.js +0 -13
  608. package/src/components/global-styles/screen-style-variations.js +0 -52
  609. package/src/components/global-styles/screen-typography-element.js +0 -121
  610. package/src/components/global-styles/screen-typography.js +0 -45
  611. package/src/components/global-styles/shadow-utils.js +0 -158
  612. package/src/components/global-styles/shadows-edit-panel.js +0 -525
  613. package/src/components/global-styles/shadows-panel.js +0 -196
  614. package/src/components/global-styles/size-control/index.js +0 -89
  615. package/src/components/global-styles/stories/index.story.js +0 -427
  616. package/src/components/global-styles/style-variations-container.js +0 -132
  617. package/src/components/global-styles/style.scss +0 -265
  618. package/src/components/global-styles/subtitle.js +0 -17
  619. package/src/components/global-styles/test/shadow-utils.spec.js +0 -251
  620. package/src/components/global-styles/test/utils.spec.js +0 -59
  621. package/src/components/global-styles/typeset.js +0 -73
  622. package/src/components/global-styles/typography-elements.js +0 -102
  623. package/src/components/global-styles/typography-example.js +0 -76
  624. package/src/components/global-styles/typography-panel.js +0 -54
  625. package/src/components/global-styles/typography-preview.js +0 -70
  626. package/src/components/global-styles/ui.js +0 -448
  627. package/src/components/global-styles/utils.js +0 -88
  628. package/src/components/global-styles/variations/style.scss +0 -43
  629. package/src/components/global-styles/variations/variation.js +0 -108
  630. package/src/components/global-styles/variations/variations-color.js +0 -45
  631. package/src/components/global-styles/variations/variations-panel.js +0 -65
  632. package/src/components/global-styles/variations/variations-typography.js +0 -54
  633. package/src/components/global-styles-renderer/index.js +0 -42
  634. package/src/components/global-styles-sidebar/default-sidebar.js +0 -51
  635. package/src/components/global-styles-sidebar/index.js +0 -206
  636. package/src/components/global-styles-sidebar/style.scss +0 -80
  637. package/src/components/revisions/index.js +0 -109
  638. package/src/components/style-book/categories.ts +0 -97
  639. package/src/components/style-book/color-examples.tsx +0 -57
  640. package/src/components/style-book/constants.ts +0 -308
  641. package/src/components/style-book/duotone-examples.tsx +0 -57
  642. package/src/components/style-book/examples.tsx +0 -273
  643. package/src/components/style-book/index.js +0 -804
  644. package/src/components/style-book/style.scss +0 -44
  645. package/src/components/style-book/test/categories.js +0 -166
  646. package/src/components/style-book/types.ts +0 -80
  647. package/src/components/welcome-guide/styles.js +0 -139
  648. package/src/hooks/index.js +0 -4
  649. package/src/hooks/push-changes-to-global-styles/index.js +0 -388
  650. package/src/hooks/push-changes-to-global-styles/style.scss +0 -4
  651. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +0 -271
  652. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -175
  653. package/src/utils/set-nested-value.js +0 -39
  654. package/tsconfig.tsbuildinfo +0 -1
@@ -1,109 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { getFontsOutline, isFontFontFaceInOutline } from '../fonts-outline';
5
-
6
- describe( 'getFontsOutline', () => {
7
- test( 'should return an empty object for an empty fonts array', () => {
8
- const fonts = [];
9
- const result = getFontsOutline( fonts );
10
- expect( result ).toEqual( {} );
11
- } );
12
-
13
- test( 'should handle fonts with no fontFace property', () => {
14
- const fonts = [
15
- { slug: 'font1' },
16
- {
17
- slug: 'font2',
18
- fontFace: [ { fontStyle: 'normal', fontWeight: '400' } ],
19
- },
20
- ];
21
- const result = getFontsOutline( fonts );
22
- expect( result ).toEqual( {
23
- font1: {},
24
- font2: { 'normal-400': true },
25
- } );
26
- } );
27
-
28
- test( 'should handle fonts with an empty fontFace array', () => {
29
- const fonts = [ { slug: 'font1', fontFace: [] } ];
30
- const result = getFontsOutline( fonts );
31
- expect( result ).toEqual( {
32
- font1: {},
33
- } );
34
- } );
35
-
36
- test( 'should handle fonts with multiple font faces', () => {
37
- const fonts = [
38
- {
39
- slug: 'font1',
40
- fontFace: [
41
- { fontStyle: 'normal', fontWeight: '400' },
42
- { fontStyle: 'italic', fontWeight: '700' },
43
- ],
44
- },
45
- ];
46
- const result = getFontsOutline( fonts );
47
- expect( result ).toEqual( {
48
- font1: {
49
- 'normal-400': true,
50
- 'italic-700': true,
51
- },
52
- } );
53
- } );
54
- } );
55
-
56
- describe( 'isFontFontFaceInOutline', () => {
57
- test( 'should return false for an empty outline', () => {
58
- const slug = 'font1';
59
- const face = { fontStyle: 'normal', fontWeight: '400' };
60
- const outline = {};
61
-
62
- const result = isFontFontFaceInOutline( slug, face, outline );
63
-
64
- expect( result ).toBe( false );
65
- } );
66
-
67
- test( 'should return false when outline has the slug but no matching fontStyle-fontWeight', () => {
68
- const slug = 'font1';
69
- const face = { fontStyle: 'normal', fontWeight: '400' };
70
- const outline = {
71
- font1: {
72
- 'italic-700': true,
73
- },
74
- };
75
-
76
- const result = isFontFontFaceInOutline( slug, face, outline );
77
-
78
- expect( result ).toBe( false );
79
- } );
80
-
81
- test( 'should return false when outline does not have the slug', () => {
82
- const slug = 'font1';
83
- const face = { fontStyle: 'normal', fontWeight: '400' };
84
- const outline = {
85
- font2: {
86
- 'normal-400': true,
87
- },
88
- };
89
-
90
- const result = isFontFontFaceInOutline( slug, face, outline );
91
-
92
- expect( result ).toBe( false );
93
- } );
94
-
95
- test( 'should return true when outline has the slug and the matching fontStyle-fontWeight', () => {
96
- const slug = 'font1';
97
- const face = { fontStyle: 'normal', fontWeight: '400' };
98
- const outline = {
99
- font1: {
100
- 'normal-400': true,
101
- 'italic-700': true,
102
- },
103
- };
104
-
105
- const result = isFontFontFaceInOutline( slug, face, outline );
106
-
107
- expect( result ).toBe( true );
108
- } );
109
- } );
@@ -1,42 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { getDisplaySrcFromFontFace } from '../index';
5
-
6
- describe( 'getDisplaySrcFromFontFace', () => {
7
- it( 'returns the first item when input is an array', () => {
8
- const input = [
9
- 'http://example.com/font-asset-1.ttf',
10
- 'http://example.com/font-asset-2.ttf',
11
- ];
12
- expect( getDisplaySrcFromFontFace( input ) ).toBe(
13
- 'http://example.com/font-asset-1.ttf'
14
- );
15
- } );
16
-
17
- it( 'returns the input when it is a string', () => {
18
- const input = 'http://example.com/font-asset-1.ttf';
19
- expect( getDisplaySrcFromFontFace( input ) ).toBe(
20
- 'http://example.com/font-asset-1.ttf'
21
- );
22
- } );
23
-
24
- it( 'return undefined when the url starts with file:', () => {
25
- const input = 'file:./theme/assets/font1.ttf';
26
- expect( getDisplaySrcFromFontFace( input ) ).toBe( undefined );
27
- } );
28
-
29
- it( 'encodes the URL if it is not encoded', () => {
30
- const input = 'https://example.org/font one with spaces.ttf';
31
- expect( getDisplaySrcFromFontFace( input ) ).toBe(
32
- 'https://example.org/font%20one%20with%20spaces.ttf'
33
- );
34
- } );
35
-
36
- it( 'does not encode the URL if it is already encoded', () => {
37
- const input = 'https://example.org/fonts/font%20one.ttf';
38
- expect( getDisplaySrcFromFontFace( input ) ).toBe(
39
- 'https://example.org/fonts/font%20one.ttf'
40
- );
41
- } );
42
- } );
@@ -1,30 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { getFontFaceVariantName } from '../index';
5
-
6
- describe( 'getFontFaceVariantName', () => {
7
- it( 'should return "Normal" for fontWeight 400 and fontStyle "normal"', () => {
8
- const face = { fontWeight: 400, fontStyle: 'normal' };
9
- const result = getFontFaceVariantName( face );
10
- expect( result ).toBe( 'Normal ' );
11
- } );
12
-
13
- it( 'should return "Bold Italic" for fontWeight 700 and fontStyle "italic"', () => {
14
- const face = { fontWeight: 700, fontStyle: 'italic' };
15
- const result = getFontFaceVariantName( face );
16
- expect( result ).toBe( 'Bold Italic' );
17
- } );
18
-
19
- it( 'should return the numerical weight when fontWeight is not recognized', () => {
20
- const face = { fontWeight: 150, fontStyle: 'normal' };
21
- const result = getFontFaceVariantName( face );
22
- expect( result ).toBe( '150 ' );
23
- } );
24
-
25
- it( 'should return the raw style when fontStyle is not recognized', () => {
26
- const face = { fontWeight: 400, fontStyle: 'oblique' };
27
- const result = getFontFaceVariantName( face );
28
- expect( result ).toBe( 'Normal oblique' );
29
- } );
30
- } );
@@ -1,31 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { isUrlEncoded } from '../index';
5
-
6
- describe( 'isUrlEncoded', () => {
7
- // Test when input is not a string
8
- it( 'should return false if the input is not a string', () => {
9
- expect( isUrlEncoded( 123 ) ).toBe( false );
10
- expect( isUrlEncoded( null ) ).toBe( false );
11
- expect( isUrlEncoded( undefined ) ).toBe( false );
12
- expect( isUrlEncoded( {} ) ).toBe( false );
13
- expect( isUrlEncoded( [] ) ).toBe( false );
14
- } );
15
-
16
- // Test when URL is not encoded
17
- it( 'should return false for non-encoded URLs', () => {
18
- expect( isUrlEncoded( 'http://example.com' ) ).toBe( false );
19
- expect( isUrlEncoded( 'https://www.google.com' ) ).toBe( false );
20
- expect( isUrlEncoded( '/path/to/resource' ) ).toBe( false );
21
- expect( isUrlEncoded( '' ) ).toBe( false );
22
- } );
23
-
24
- // Test when URL is encoded
25
- it( 'should return true for encoded URLs', () => {
26
- expect( isUrlEncoded( 'http%3A%2F%2Fexample.com' ) ).toBe( true );
27
- expect( isUrlEncoded( 'https%3A%2F%2Fwww.google.com' ) ).toBe( true );
28
- expect( isUrlEncoded( '%2Fpath%2Fto%2Fresource' ) ).toBe( true );
29
- expect( isUrlEncoded( '%20' ) ).toBe( true );
30
- } );
31
- } );
@@ -1,57 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import makeFamiliesFromFaces from '../make-families-from-faces';
5
-
6
- describe( 'makeFamiliesFromFaces', () => {
7
- it( 'handles empty fontFaces list', () => {
8
- const result = makeFamiliesFromFaces( [] );
9
- expect( result ).toEqual( [] );
10
- } );
11
-
12
- it( 'groups fontFaces by fontFamily', () => {
13
- const fontFaces = [
14
- { fontFamily: 'Lobster' },
15
- {
16
- fontFamily: 'Piazzolla',
17
- file: { name: 'piazzolla.ttf' },
18
- },
19
- { fontFamily: 'Lobster', file: { name: 'piazzolla.ttf' } },
20
- ];
21
-
22
- const result = makeFamiliesFromFaces( fontFaces );
23
-
24
- expect( result ).toHaveLength( 2 );
25
- expect(
26
- result.find( ( family ) => family.name === 'Lobster' ).fontFace
27
- ).toHaveLength( 2 );
28
- expect(
29
- result.find( ( family ) => family.name === 'Piazzolla' ).fontFace
30
- ).toHaveLength( 1 );
31
- } );
32
-
33
- it( 'generates correct name for fontFamily names', () => {
34
- const fontFaces = [
35
- {
36
- fontFamily: 'Piazzolla',
37
- file: { name: 'piazzolla.ttf' },
38
- },
39
- ];
40
-
41
- const result = makeFamiliesFromFaces( fontFaces );
42
- expect( result[ 0 ].name ).toBe( 'Piazzolla' );
43
- } );
44
-
45
- it( 'generates correct slug for fontFamily names', () => {
46
- const fontFaces = [
47
- {
48
- fontFamily: 'Times New Roman',
49
- file: { name: 'times.ttf' },
50
- },
51
- ];
52
-
53
- const result = makeFamiliesFromFaces( fontFaces );
54
-
55
- expect( result[ 0 ].slug ).toBe( 'times-new-roman' );
56
- } );
57
- } );
@@ -1,56 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { mergeFontFaces } from '../index';
5
-
6
- describe( 'mergeFontFaces', () => {
7
- it( 'should return an empty array when both existing and incoming arrays are empty', () => {
8
- expect( mergeFontFaces() ).toEqual( [] );
9
- } );
10
-
11
- it( 'should return the existing array when the incoming array is empty', () => {
12
- const existing = [ { fontWeight: 'normal', fontStyle: 'italic' } ];
13
- expect( mergeFontFaces( existing, [] ) ).toEqual( existing );
14
- } );
15
-
16
- it( 'should return the incoming array when the existing array is empty', () => {
17
- const incoming = [ { fontWeight: 'bold', fontStyle: 'normal' } ];
18
- expect( mergeFontFaces( [], incoming ) ).toEqual( incoming );
19
- } );
20
-
21
- it( 'should merge non-overlapping existing and incoming arrays', () => {
22
- const existing = [ { fontWeight: 'normal', fontStyle: 'italic' } ];
23
- const incoming = [ { fontWeight: 'bold', fontStyle: 'normal' } ];
24
- expect( mergeFontFaces( existing, incoming ) ).toEqual( [
25
- ...existing,
26
- ...incoming,
27
- ] );
28
- } );
29
-
30
- it( 'should overwrite duplicates with the incoming array', () => {
31
- const existing = [
32
- { fontWeight: 'normal', fontStyle: 'italic', src: 'old-src' },
33
- ];
34
- const incoming = [
35
- { fontWeight: 'normal', fontStyle: 'italic', src: 'new-src' },
36
- ];
37
- expect( mergeFontFaces( existing, incoming ) ).toEqual( incoming );
38
- } );
39
-
40
- it( 'should handle multiple elements in both existing and incoming arrays', () => {
41
- const existing = [
42
- { fontWeight: 'normal', fontStyle: 'italic', src: 'old-1' },
43
- { fontWeight: 'bold', fontStyle: 'normal', src: 'old-2' },
44
- ];
45
- const incoming = [
46
- { fontWeight: 'normal', fontStyle: 'italic', src: 'new-1' },
47
- { fontWeight: 'bold', fontStyle: 'oblique', src: 'new-2' },
48
- ];
49
- const expected = [
50
- { fontWeight: 'normal', fontStyle: 'italic', src: 'new-1' },
51
- { fontWeight: 'bold', fontStyle: 'normal', src: 'old-2' },
52
- { fontWeight: 'bold', fontStyle: 'oblique', src: 'new-2' },
53
- ];
54
- expect( mergeFontFaces( existing, incoming ) ).toEqual( expected );
55
- } );
56
- } );
@@ -1,108 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { mergeFontFamilies } from '../index';
5
-
6
- describe( 'mergeFontFamilies', () => {
7
- it( 'should return an empty array when both inputs are empty', () => {
8
- const result = mergeFontFamilies( [], [] );
9
- expect( result ).toEqual( [] );
10
- } );
11
-
12
- it( 'should return the existing array when incoming array is empty', () => {
13
- const existing = [
14
- { slug: 'lobster', name: 'Lobster', fontFamily: 'Lobster' },
15
- ];
16
- const result = mergeFontFamilies( existing, [] );
17
- expect( result ).toEqual( existing );
18
- } );
19
-
20
- it( 'should concar non-conflicting arrays', () => {
21
- const existing = [
22
- { slug: 'lobster', name: 'Lobster', fontFamily: 'Lobster' },
23
- ];
24
- const incoming = [
25
- { slug: 'piazzola', name: 'Piazzolla', fontFamily: 'Piazzolla' },
26
- ];
27
- const result = mergeFontFamilies( existing, incoming );
28
- expect( result ).toEqual( [ ...existing, ...incoming ] );
29
- } );
30
-
31
- it( 'should merge non-conflicting arrays', () => {
32
- const existing = [
33
- { slug: 'lobster', name: 'Lobster', fontFamily: 'Lobster' },
34
- { slug: 'piazzola', name: 'Piazzolla', fontFamily: 'Piazzolla' },
35
- ];
36
- const incoming = [
37
- { slug: 'piazzola', name: 'Piazzolla', fontFamily: 'Piazzolla' },
38
- ];
39
- const result = mergeFontFamilies( existing, incoming );
40
- expect( result ).toHaveLength( 2 );
41
- } );
42
-
43
- it( 'should overwrite existing font family data with incoming data', () => {
44
- const existing = [
45
- { slug: 'lobster', name: 'Lobster', fontFamily: 'Lobster' },
46
- { slug: 'piazzola', name: 'Piazzolla', fontFamily: 'Piazzolla' },
47
- ];
48
- const incoming = [
49
- {
50
- slug: 'piazzola',
51
- name: 'Piazzolla',
52
- fontFamily: 'Piazzolla, serif',
53
- },
54
- ];
55
- const result = mergeFontFamilies( existing, incoming );
56
- expect( result[ 1 ].fontFamily ).toBe( 'Piazzolla, serif' );
57
- } );
58
-
59
- it( 'should merge fontFaces from incoming array', () => {
60
- const existing = [
61
- {
62
- slug: 'lobster',
63
- name: 'Lobster',
64
- fontFamily: 'Lobster',
65
- },
66
- {
67
- slug: 'piazzola',
68
- name: 'Piazzolla',
69
- fontFamily: 'Piazzolla',
70
- fontFace: [
71
- { fontWeight: 400, fontStyle: 'normal', src: 'url' },
72
- { fontWeight: 500, fontStyle: 'normal', src: 'url' },
73
- ],
74
- },
75
- ];
76
- const incoming = [
77
- {
78
- slug: 'piazzola',
79
- name: 'Piazzolla',
80
- fontFamily: 'Piazzolla, serif',
81
- fontFace: [
82
- { fontWeight: 800, fontStyle: 'normal', src: 'url' },
83
- { fontWeight: 400, fontStyle: 'normal', src: 'url' },
84
- ],
85
- },
86
- ];
87
- const expected = [
88
- {
89
- slug: 'lobster',
90
- name: 'Lobster',
91
- fontFamily: 'Lobster',
92
- },
93
- {
94
- slug: 'piazzola',
95
- name: 'Piazzolla',
96
- fontFamily: 'Piazzolla, serif',
97
- fontFace: [
98
- { fontWeight: 400, fontStyle: 'normal', src: 'url' },
99
- { fontWeight: 500, fontStyle: 'normal', src: 'url' },
100
- { fontWeight: 800, fontStyle: 'normal', src: 'url' },
101
- ],
102
- },
103
- ];
104
-
105
- const result = mergeFontFamilies( existing, incoming );
106
- expect( result ).toEqual( expected );
107
- } );
108
- } );
@@ -1,216 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import {
5
- getFamilyPreviewStyle,
6
- formatFontFamily,
7
- formatFontFaceName,
8
- } from '../preview-styles';
9
-
10
- describe( 'getFamilyPreviewStyle', () => {
11
- it( 'should return default fontStyle and fontWeight if fontFace is not provided', () => {
12
- const family = { fontFamily: 'Rosario' };
13
- const result = getFamilyPreviewStyle( family );
14
- const expected = {
15
- fontFamily: 'Rosario',
16
- fontWeight: '400',
17
- fontStyle: 'normal',
18
- };
19
- expect( result ).toEqual( expected );
20
- } );
21
-
22
- it( 'should return fontStyle as "normal" if fontFace contains "normal" style', () => {
23
- const family = {
24
- fontFamily: 'Rosario',
25
- fontFace: [
26
- { fontStyle: 'italic', fontWeight: '500' },
27
- { fontStyle: 'normal', fontWeight: '600' },
28
- ],
29
- };
30
- const result = getFamilyPreviewStyle( family );
31
- const expected = {
32
- fontFamily: 'Rosario',
33
- fontStyle: 'normal',
34
- fontWeight: '600',
35
- };
36
- expect( result ).toEqual( expected );
37
- } );
38
-
39
- it( 'should return fontStyle as "itaic" if fontFace does not contain "normal" style', () => {
40
- const family = {
41
- fontFamily: 'Rosario',
42
- fontFace: [
43
- { fontStyle: 'italic', fontWeight: '500' },
44
- { fontStyle: 'italic', fontWeight: '600' },
45
- ],
46
- };
47
- const result = getFamilyPreviewStyle( family );
48
- const expected = {
49
- fontFamily: 'Rosario',
50
- fontStyle: 'italic',
51
- fontWeight: '500',
52
- };
53
- expect( result ).toEqual( expected );
54
- } );
55
-
56
- it( 'should return fontWeight as string', () => {
57
- const family = {
58
- fontFamily: 'Rosario',
59
- fontFace: [
60
- { fontStyle: 'italic', fontWeight: '500' },
61
- { fontStyle: 'normal', fontWeight: '700' },
62
- ],
63
- };
64
- const result = getFamilyPreviewStyle( family );
65
- const expected = {
66
- fontFamily: 'Rosario',
67
- fontStyle: 'normal',
68
- fontWeight: '700',
69
- };
70
- expect( result ).toEqual( expected );
71
- } );
72
-
73
- it( 'should return fontWeight as "400" if fontFace contains "normal" style with "400" weight', () => {
74
- const family = {
75
- fontFamily: 'Rosario',
76
- fontFace: [
77
- { fontStyle: 'italic', fontWeight: '500' },
78
- { fontStyle: 'normal', fontWeight: '400' },
79
- ],
80
- };
81
- const result = getFamilyPreviewStyle( family );
82
- const expected = {
83
- fontFamily: 'Rosario',
84
- fontStyle: 'normal',
85
- fontWeight: '400',
86
- };
87
- expect( result ).toEqual( expected );
88
- } );
89
-
90
- it( 'should return the fontWeight of the nearest "normal" style if no "400" weight is found', () => {
91
- const family = {
92
- fontFamily: 'Rosario',
93
- fontFace: [
94
- { fontStyle: 'normal', fontWeight: '800' },
95
- { fontStyle: 'italic', fontWeight: '500' },
96
- { fontStyle: 'normal', fontWeight: '600' },
97
- ],
98
- };
99
- const result = getFamilyPreviewStyle( family );
100
- const expected = {
101
- fontFamily: 'Rosario',
102
- fontStyle: 'normal',
103
- fontWeight: '600',
104
- };
105
- expect( result ).toEqual( expected );
106
- } );
107
-
108
- it( 'should return 400 or the the nearest "normal" style if it using a variable weight font', () => {
109
- const family = {
110
- fontFamily: 'Rosario',
111
- fontFace: [
112
- { fontStyle: 'normal', fontWeight: '100' },
113
- { fontStyle: 'normal', fontWeight: '200 900' },
114
- { fontStyle: 'italic', fontWeight: '200 900' },
115
- ],
116
- };
117
- const result = getFamilyPreviewStyle( family );
118
- const expected = {
119
- fontFamily: 'Rosario',
120
- fontStyle: 'normal',
121
- fontWeight: '400',
122
- };
123
- expect( result ).toEqual( expected );
124
- } );
125
- } );
126
-
127
- describe( 'formatFontFamily', () => {
128
- it( 'should transform "Baloo 2, system-ui" correctly', () => {
129
- expect( formatFontFamily( 'Baloo 2, system-ui' ) ).toBe(
130
- '"Baloo 2", system-ui'
131
- );
132
- } );
133
-
134
- it( 'should ignore extra spaces', () => {
135
- expect( formatFontFamily( ' Baloo 2 , system-ui' ) ).toBe(
136
- '"Baloo 2", system-ui'
137
- );
138
- } );
139
-
140
- it( 'should keep quoted strings unchanged', () => {
141
- expect(
142
- formatFontFamily(
143
- "Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif"
144
- )
145
- ).toBe(
146
- 'Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif'
147
- );
148
- } );
149
-
150
- it( 'should wrap single font name with spaces in quotes', () => {
151
- expect( formatFontFamily( 'Baloo 2' ) ).toBe( '"Baloo 2"' );
152
- } );
153
-
154
- it( 'should wrap multiple font names with spaces in quotes', () => {
155
- expect( formatFontFamily( 'Baloo Bhai 2, Baloo 2' ) ).toBe(
156
- '"Baloo Bhai 2", "Baloo 2"'
157
- );
158
- } );
159
-
160
- it( 'should wrap names with special characters in quotes', () => {
161
- expect(
162
- formatFontFamily(
163
- 'Font+Name, Font*Name, _Font_Name_, generic(kai), sans-serif'
164
- )
165
- ).toBe(
166
- '"Font+Name", "Font*Name", "_Font_Name_", generic(kai), sans-serif'
167
- );
168
- } );
169
-
170
- it( 'should fix empty wrong formatted font family', () => {
171
- expect( formatFontFamily( ', Abril Fatface,Times,serif' ) ).toBe(
172
- '"Abril Fatface", Times, serif'
173
- );
174
- } );
175
-
176
- it( 'should not add quotes to generic names', () => {
177
- expect(
178
- formatFontFamily(
179
- 'Paren(thesis)Font, generic(kai), generic(fasongsong), generic( abc ), Helvetica Neue'
180
- )
181
- ).toBe(
182
- '"Paren(thesis)Font", generic(kai), generic(fasongsong), generic( abc ), "Helvetica Neue"'
183
- );
184
- } );
185
- } );
186
-
187
- describe( 'formatFontFaceName', () => {
188
- it( 'should remove leading and trailing quotes', () => {
189
- expect( formatFontFaceName( '"Open Sans"' ) ).toBe( 'Open Sans' );
190
- } );
191
-
192
- it( 'should remove leading and trailing quotes from multiple font face names', () => {
193
- expect(
194
- formatFontFaceName( "'Open Sans', 'Helvetica Neue', sans-serif" )
195
- ).toBe( 'Open Sans' );
196
- } );
197
-
198
- it( 'should remove leading and trailing quotes even from names with spaces and special characters', () => {
199
- expect( formatFontFaceName( "'Font+Name 24', sans-serif" ) ).toBe(
200
- 'Font+Name 24'
201
- );
202
- } );
203
-
204
- it( 'should output the font face name with quotes on Firefox', () => {
205
- const mockUserAgent =
206
- 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0';
207
-
208
- // Mock the userAgent for this test
209
- Object.defineProperty( window.navigator, 'userAgent', {
210
- value: mockUserAgent,
211
- configurable: true,
212
- } );
213
-
214
- expect( formatFontFaceName( 'Open Sans' ) ).toBe( '"Open Sans"' );
215
- } );
216
- } );
@@ -1,41 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { setUIValuesNeeded } from '../index';
5
-
6
- describe( 'setUIValuesNeeded function', () => {
7
- test( 'Should set name from fontFamily if name is missing', () => {
8
- const font = { fontFamily: 'Arial' };
9
- const result = setUIValuesNeeded( font );
10
- expect( result.name ).toBe( 'Arial' );
11
- } );
12
-
13
- test( 'Should set name from slug if name and fontFamily are missing', () => {
14
- const font = { slug: 'arial-slug' };
15
- const result = setUIValuesNeeded( font );
16
- expect( result.name ).toBe( 'arial-slug' );
17
- } );
18
-
19
- test( 'Should not overwrite name if it exists', () => {
20
- const font = { name: 'ExistingName', fontFamily: 'Arial' };
21
- const result = setUIValuesNeeded( font );
22
- expect( result.name ).toBe( 'ExistingName' );
23
- } );
24
-
25
- test( 'Should merge extra values', () => {
26
- const font = { name: 'Arial', slug: 'arial' };
27
- const extraValues = { source: 'custom' };
28
- const result = setUIValuesNeeded( font, extraValues );
29
- expect( result ).toEqual( {
30
- name: 'Arial',
31
- slug: 'arial',
32
- source: 'custom',
33
- } );
34
- } );
35
-
36
- test( 'Should return the same object if no conditions met', () => {
37
- const font = { randomProperty: 'randomValue' };
38
- const result = setUIValuesNeeded( font );
39
- expect( result ).toEqual( font );
40
- } );
41
- } );