@perkyzz/emvb 1.2.0 → 1.4.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 (150) hide show
  1. package/README.md +2 -2
  2. package/THIRD_PARTY_NOTICES.md +2 -2
  3. package/package.json +4 -4
  4. package/src/admin/bulk-api.ts +5 -1
  5. package/src/admin/editor/A11yCopilot.tsx +3 -1
  6. package/src/admin/editor/Editor.tsx +22 -2
  7. package/src/admin/editor/Timeline.tsx +1 -8
  8. package/src/admin/editor/canvas/DeviceBar.tsx +7 -2
  9. package/src/admin/editor/canvas/EmptyCanvas.tsx +11 -2
  10. package/src/admin/editor/canvas/use-canvas-dnd.ts +1 -20
  11. package/src/admin/editor/canvas/vnode-react.tsx +5 -0
  12. package/src/admin/editor/co-design.ts +36 -1
  13. package/src/admin/editor/dnd/dragged-source.ts +22 -0
  14. package/src/admin/editor/dnd/layer-drop.ts +141 -0
  15. package/src/admin/editor/dnd/new-element.ts +76 -0
  16. package/src/admin/editor/editor-css.ts +9 -1
  17. package/src/admin/editor/element-chrome.ts +34 -0
  18. package/src/admin/editor/feature-css.ts +22 -0
  19. package/src/admin/editor/inert-links.ts +8 -0
  20. package/src/admin/editor/panels/ColorControl.tsx +2 -2
  21. package/src/admin/editor/panels/FontFaces.tsx +342 -0
  22. package/src/admin/editor/panels/LayersPanel.tsx +56 -6
  23. package/src/admin/editor/panels/LeftPanel.tsx +153 -29
  24. package/src/admin/editor/panels/SettingsPanel.tsx +1 -0
  25. package/src/admin/editor/panels/SiteStylesDrawer.tsx +5 -0
  26. package/src/admin/editor/panels/TemplatesPanel.tsx +205 -0
  27. package/src/admin/editor/panels/TokenScales.tsx +2 -0
  28. package/src/admin/editor/panels/TriggersEditor.tsx +203 -9
  29. package/src/admin/editor/panels/VariableSection.tsx +111 -7
  30. package/src/admin/editor/panels/color-space.ts +71 -6
  31. package/src/admin/editor/panels/settings/AudienceEditor.tsx +3 -0
  32. package/src/admin/editor/panels/settings/FieldControl.tsx +18 -0
  33. package/src/admin/editor/panels/settings/ItemList.tsx +33 -0
  34. package/src/admin/editor/panels/settings/LoopItemBindControl.tsx +9 -3
  35. package/src/admin/editor/panels/settings/StickyControl.tsx +97 -0
  36. package/src/admin/editor/panels/settings/StyleRow.tsx +14 -0
  37. package/src/admin/editor/panels/settings/style-sections.ts +19 -2
  38. package/src/admin/editor/panels/url-rules.ts +43 -0
  39. package/src/admin/editor/panels/use-layers-drop.ts +232 -0
  40. package/src/admin/editor/store.ts +4 -2
  41. package/src/admin/editor/useExtensions.ts +3 -1
  42. package/src/admin/editor/useNodeActions.ts +74 -1
  43. package/src/admin/editor/useSave.ts +116 -85
  44. package/src/admin/export-api.ts +25 -2
  45. package/src/admin/extension-outputs.ts +179 -0
  46. package/src/admin/font-files-api.ts +38 -0
  47. package/src/admin/pages/ImportButton.tsx +15 -4
  48. package/src/admin/pages/ImportElementorDialog.tsx +22 -188
  49. package/src/admin/pages/ImportHtmlDialog.tsx +209 -0
  50. package/src/admin/pages/ImportImageCopies.tsx +167 -0
  51. package/src/admin/pages/ImportReport.tsx +63 -0
  52. package/src/admin/pages/NewPageDialog.tsx +54 -32
  53. package/src/admin/pages/PageList.tsx +9 -0
  54. package/src/admin/pages/ThemePartList.tsx +9 -0
  55. package/src/astro/EmVBPage.astro +5 -2
  56. package/src/astro/extension-styles.ts +35 -0
  57. package/src/astro/forms/EmVBFormsClient.astro +3 -0
  58. package/src/astro/forms/enhance.ts +107 -0
  59. package/src/astro/popups/runtime.ts +47 -2
  60. package/src/astro/render.ts +19 -4
  61. package/src/astro/request-data.ts +6 -0
  62. package/src/astro/resolve-theme.ts +11 -4
  63. package/src/astro/resolve.ts +9 -0
  64. package/src/astro/widgets/EmVBCountdownRuntime.astro +8 -0
  65. package/src/astro/widgets/EmVBCounterRuntime.astro +8 -0
  66. package/src/astro/widgets/EmVBHeadlineRuntime.astro +9 -0
  67. package/src/astro/widgets/EmVBMapRuntime.astro +8 -0
  68. package/src/astro/widgets/EmVBShareRuntime.astro +9 -0
  69. package/src/astro/widgets/EmVBStickyRuntime.astro +9 -0
  70. package/src/astro/widgets/EmVBThemeRuntime.astro +9 -0
  71. package/src/astro/widgets/EmVBWidgetRuntimes.astro +22 -0
  72. package/src/astro/widgets/alerts.ts +16 -2
  73. package/src/astro/widgets/carousel.ts +65 -24
  74. package/src/astro/widgets/countdown.ts +91 -0
  75. package/src/astro/widgets/counter.ts +98 -0
  76. package/src/astro/widgets/extension-runtimes.ts +27 -0
  77. package/src/astro/widgets/headline.ts +99 -0
  78. package/src/astro/widgets/map.ts +37 -0
  79. package/src/astro/widgets/share.ts +21 -0
  80. package/src/astro/widgets/sticky.ts +87 -0
  81. package/src/astro/widgets/theme.ts +52 -0
  82. package/src/constants.ts +1 -1
  83. package/src/core/a11y/audit.ts +177 -6
  84. package/src/core/arrange.ts +71 -1
  85. package/src/core/canvas-collections.ts +28 -0
  86. package/src/core/css/font-face.ts +72 -0
  87. package/src/core/css/generate.ts +35 -1
  88. package/src/core/elements/counter-format.ts +15 -0
  89. package/src/core/elements/form-elements.ts +119 -9
  90. package/src/core/elements/icon-svg.ts +14 -0
  91. package/src/core/elements/index.ts +54 -4
  92. package/src/core/elements/input-limits.ts +44 -0
  93. package/src/core/elements/marketing.ts +1490 -0
  94. package/src/core/elements/menu.ts +109 -47
  95. package/src/core/elements/site.ts +108 -0
  96. package/src/core/elements/widgets.ts +40 -5
  97. package/src/core/export/runtimes.generated.ts +10 -3
  98. package/src/core/export/site.ts +55 -4
  99. package/src/core/extensions/classes.ts +114 -0
  100. package/src/core/extensions/index.ts +17 -2
  101. package/src/core/extensions/normalize.ts +13 -0
  102. package/src/core/extensions/registry.ts +134 -10
  103. package/src/core/extensions/render-ext.ts +66 -21
  104. package/src/core/extensions/safe-nodes.ts +67 -11
  105. package/src/core/extensions/types.ts +48 -1
  106. package/src/core/fonts/files.ts +74 -0
  107. package/src/core/fonts/google.ts +112 -0
  108. package/src/core/fonts/test-font.ts +9 -0
  109. package/src/core/import/elementor/context.ts +13 -4
  110. package/src/core/import/elementor/index.ts +32 -21
  111. package/src/core/import/elementor/widgets.ts +532 -293
  112. package/src/core/import/html/blocks.ts +602 -0
  113. package/src/core/import/html/index.ts +155 -0
  114. package/src/core/import/html/map.ts +958 -0
  115. package/src/core/import/html/parse.ts +430 -0
  116. package/src/core/index.ts +45 -0
  117. package/src/core/limits.ts +6 -0
  118. package/src/core/migrate/v18.ts +3 -0
  119. package/src/core/public-attributes.ts +17 -0
  120. package/src/core/render/extras.ts +31 -7
  121. package/src/core/render/form.ts +103 -10
  122. package/src/core/render/index.ts +172 -16
  123. package/src/core/render/section.ts +31 -1
  124. package/src/core/render/spacer-basis.ts +102 -0
  125. package/src/core/render/theme-boot.ts +16 -0
  126. package/src/core/render/vnode.ts +1 -1
  127. package/src/core/sanitize/css.ts +68 -3
  128. package/src/core/sanitize/motion.ts +12 -0
  129. package/src/core/schema/design.ts +40 -0
  130. package/src/core/schema/layout.ts +534 -22
  131. package/src/core/schema/style.ts +28 -0
  132. package/src/core/templates/index.ts +218 -0
  133. package/src/core/templates/pages.ts +29 -0
  134. package/src/core/templates/sections.ts +794 -0
  135. package/src/core/templates/types.ts +9 -0
  136. package/src/core/theme/dynamic.ts +11 -6
  137. package/src/core/theme/popup-markup.ts +21 -2
  138. package/src/core/theme/popup-rules.ts +36 -0
  139. package/src/core/theme/triggers.ts +64 -5
  140. package/src/core/translatable.ts +5 -2
  141. package/src/extension-build.ts +331 -0
  142. package/src/index.ts +25 -3
  143. package/src/mcp/brief.ts +191 -0
  144. package/src/mcp/prompts.ts +33 -0
  145. package/src/mcp/read.ts +29 -1
  146. package/src/mcp/tools.ts +40 -1
  147. package/src/mcp/write.ts +41 -1
  148. package/src/server/extension-routes.ts +73 -0
  149. package/src/server/font-routes.ts +301 -0
  150. package/src/server/plugin.ts +11 -1
@@ -0,0 +1,16 @@
1
+ import type { DesignSystem } from "../schema/design.ts";
2
+
3
+ /** W-1067: where a Theme toggle keeps the visitor's light or dark choice in this browser. */
4
+ export const THEME_STORAGE_KEY = "emvb-theme";
5
+
6
+ /**
7
+ * W-1067: puts back a saved light or dark choice before the page is drawn. The opt-in Theme
8
+ * toggle script runs after the first paint and only on pages with a toggle, so a saved choice
9
+ * flashed the system's look first and was ignored on pages without one. Inline and constant, so
10
+ * a site with a Content Security Policy can allow it by its hash (docs/guides/widgets.md).
11
+ */
12
+ export const THEME_BOOT_SCRIPT = `<script>try{var t=localStorage.getItem("${THEME_STORAGE_KEY}");if(t==="light"||t==="dark")document.documentElement.setAttribute("data-emvb-theme",t)}catch(e){}</script>`;
13
+
14
+ /** Whether the design has any dark colour value, and so a light or dark choice to put back. */
15
+ export const designHasDark = (design: DesignSystem): boolean =>
16
+ (design.variables?.colors ?? []).some((color) => typeof color.dark === "string");
@@ -78,7 +78,7 @@ const TAGS = new Set([
78
78
  const VOID = new Set(["hr", "img", "input", "br"]);
79
79
  // iframe/video are not void — they need closing tags.
80
80
  const ATTR_NAME =
81
- /^(?:class|id|href|src|srcset|sizes|alt|width|height|loading|decoding|fetchpriority|dir|lang|hreflang|role|type|checked|target|rel|aria-[a-z][a-z0-9-]*|title|allow|referrerpolicy|preload|controls|allowfullscreen|sandbox|xmlns|viewBox|fill|stroke|stroke-width|stroke-linecap|stroke-linejoin|stroke-dasharray|stroke-opacity|fill-opacity|opacity|transform|focusable|d|cx|cy|r|x|y|x1|y1|x2|y2|points|rx|ry|xlink:href|preserveAspectRatio|gradientUnits|gradientTransform|offset|stop-color|stop-opacity|clipPathUnits|maskUnits|maskContentUnits|patternUnits|patternContentUnits|patternTransform|markerUnits|markerWidth|markerHeight|refX|refY|orient|font-size|font-family|font-weight|text-anchor|dominant-baseline|dx|dy|clip-path|mask|method|action|name|value|placeholder|for|tabindex|autocomplete|open|datetime|muted|loop|playsinline|autoplay|required|novalidate|minlength|maxlength|min|max|pattern|step|start|data-[a-z][a-z0-9-]*)$/;
81
+ /^(?:class|id|href|src|srcset|sizes|alt|width|height|loading|decoding|fetchpriority|dir|lang|hreflang|role|type|checked|target|rel|aria-[a-z][a-z0-9-]*|title|allow|referrerpolicy|preload|controls|allowfullscreen|sandbox|xmlns|viewBox|fill|stroke|stroke-width|stroke-linecap|stroke-linejoin|stroke-dasharray|stroke-opacity|fill-opacity|opacity|transform|focusable|d|cx|cy|r|x|y|x1|y1|x2|y2|points|rx|ry|xlink:href|preserveAspectRatio|gradientUnits|gradientTransform|offset|stop-color|stop-opacity|clipPathUnits|maskUnits|maskContentUnits|patternUnits|patternContentUnits|patternTransform|markerUnits|markerWidth|markerHeight|refX|refY|orient|font-size|font-family|font-weight|text-anchor|dominant-baseline|dx|dy|clip-path|mask|method|action|name|value|placeholder|for|tabindex|autocomplete|open|popover|popovertarget|popovertargetaction|datetime|muted|loop|playsinline|autoplay|required|novalidate|hidden|minlength|maxlength|min|max|pattern|step|start|data-[a-z][a-z0-9-]*)$/;
82
82
 
83
83
  export const isAllowedTag = (tag: string) => TAGS.has(tag);
84
84
  export const isAllowedAttr = (name: string) => ATTR_NAME.test(name);
@@ -733,6 +733,8 @@ const PROPERTY_MAP: {
733
733
  scrollMotion: { css: "animation", toValue: () => undefined },
734
734
  // W-938: written by `loopDeclarations` in `styleDeclarations`; this entry only names it.
735
735
  loopMotion: { css: "animation", toValue: () => undefined },
736
+ // W-1070: written by `stickyDeclarations` in `styleDeclarations`; this entry only names it.
737
+ stickyMotion: { css: "animation", toValue: () => undefined },
736
738
  iconRotate: { css: "--emvb-icon-rotate", toValue: cssIconRotate },
737
739
  iconFlip: { css: "--emvb-icon-flip", toValue: cssIconFlip },
738
740
  iconScale: { css: "scale", toValue: cssIconScale },
@@ -811,6 +813,46 @@ function withViewportUnits(declarations: Declaration[], units: unknown): void {
811
813
  }
812
814
  }
813
815
 
816
+ /**
817
+ * Declarations for a `stickyMotion` value (W-1070): one page-scroll animation per effect over
818
+ * 0 to `distance` px, and the values the keyframes read. Undefined for a bad value; `{ type:
819
+ * "none" }` is `animation: none`. `hide` writes no CSS here: the element gets an attribute.
820
+ */
821
+ function stickyDeclarations(value: unknown): Declaration[] | undefined {
822
+ if (typeof value !== "object" || value === null) return undefined;
823
+ const record = value as Record<string, unknown>;
824
+ if (record["type"] === "none" && Object.keys(record).length === 1) {
825
+ return [{ property: "animation", value: "none" }];
826
+ }
827
+ const allowed = new Set(["distance", "background", "shadow", "padding", "hide"]);
828
+ if (Object.keys(record).some((key) => !allowed.has(key))) return undefined;
829
+ const { distance, background, shadow, padding, hide } = record;
830
+ if (
831
+ distance !== undefined &&
832
+ (!Number.isInteger(distance) || (distance as number) < 10 || (distance as number) > 2000)
833
+ )
834
+ return undefined;
835
+ if (shadow !== undefined && typeof shadow !== "boolean") return undefined;
836
+ if (hide !== undefined && typeof hide !== "boolean") return undefined;
837
+ const color = background === undefined ? undefined : cssColor(background);
838
+ const pad = padding === undefined ? undefined : cssLength(padding);
839
+ if ((background !== undefined && !color) || (padding !== undefined && !pad)) return undefined;
840
+ const names = [
841
+ ...(color ? ["emvb-sticky-bg"] : []),
842
+ ...(shadow ? ["emvb-sticky-shadow"] : []),
843
+ ...(pad ? ["emvb-sticky-pad"] : []),
844
+ ];
845
+ if (names.length === 0) return hide ? [] : undefined;
846
+ const range = `0px ${(distance as number | undefined) ?? 120}px`;
847
+ return [
848
+ { property: "animation", value: names.map((n) => `${n} linear both`).join(", ") },
849
+ { property: "animation-timeline", value: names.map(() => "scroll(root)").join(", ") },
850
+ { property: "animation-range", value: names.map(() => range).join(", ") },
851
+ ...(color ? [{ property: "--emvb-sticky-bg", value: color }] : []),
852
+ ...(pad ? [{ property: "--emvb-sticky-pad", value: pad }] : []),
853
+ ];
854
+ }
855
+
814
856
  export function styleDeclarations(style: unknown): {
815
857
  declarations: Declaration[];
816
858
  rejected: string[];
@@ -821,6 +863,7 @@ export function styleDeclarations(style: unknown): {
821
863
  const record = style as Record<string, unknown>;
822
864
  let motion: Declaration[] = [];
823
865
  let loop: Declaration[] = [];
866
+ let sticky: Declaration[] = [];
824
867
  for (const [key, raw] of shorthandsFirst(record)) {
825
868
  if (BACKGROUND_KEYS.has(key)) continue;
826
869
  if (
@@ -838,6 +881,19 @@ export function styleDeclarations(style: unknown): {
838
881
  else rejected.push(key);
839
882
  continue;
840
883
  }
884
+ if (key === "stickyMotion") {
885
+ const found = stickyDeclarations(raw);
886
+ if (found && found.every((d) => isSafeCssValue(d.value))) {
887
+ sticky = found;
888
+ // W-1070: whether "Hide while scrolling down" is on at this width, for the sticky script.
889
+ // Unset keeps a wider device's choice; `{ type: "none" }` turns it off.
890
+ const { hide, type } = raw as { hide?: unknown; type?: unknown };
891
+ if (typeof hide === "boolean" || type === "none") {
892
+ declarations.push({ property: "--emvb-sticky-hide", value: hide === true ? "1" : "0" });
893
+ }
894
+ } else rejected.push(key);
895
+ continue;
896
+ }
841
897
  if (key === "transform") {
842
898
  const found = transformDeclarations(raw);
843
899
  if (found) declarations.push(...found);
@@ -888,11 +944,19 @@ export function styleDeclarations(style: unknown): {
888
944
  if (column.badSpan) rejected.push("gridColumnSpan");
889
945
  if (row.badStart) rejected.push("gridRowStart");
890
946
  if (row.badSpan) rejected.push("gridRowSpan");
891
- return { declarations: withLoop(withMotion(declarations, motion), loop), rejected };
947
+ // W-1070: sticky effects join the same animation list, last (withLoop appends any animation).
948
+ const animated = withLoop(withLoop(withMotion(declarations, motion), loop), sticky);
949
+ return { declarations: animated, rejected };
892
950
  }
893
951
 
894
952
  /** Normal only (W-089, W-237): a state's `transition` and `iconAnimation` are dropped and reported. */
895
- const NORMAL_ONLY = ["transition", "iconAnimation", "scrollMotion", "loopMotion"] as const;
953
+ const NORMAL_ONLY = [
954
+ "transition",
955
+ "iconAnimation",
956
+ "scrollMotion",
957
+ "loopMotion",
958
+ "stickyMotion",
959
+ ] as const;
896
960
  const withoutTransition = (style: unknown): unknown => {
897
961
  if (typeof style !== "object" || style === null) return style;
898
962
  if (!NORMAL_ONLY.some((key) => key in style)) return style;
@@ -901,6 +965,7 @@ const withoutTransition = (style: unknown): unknown => {
901
965
  iconAnimation: _loop,
902
966
  scrollMotion: _scroll,
903
967
  loopMotion: _loopMotion,
968
+ stickyMotion: _sticky,
904
969
  ...rest
905
970
  } = style as Record<string, unknown>;
906
971
  return rest;
@@ -951,7 +1016,7 @@ const BACKGROUND_LAYER_KEYS = [
951
1016
  * gradient) are filled in from `inherited` here. Otherwise they vanish on that device.
952
1017
  */
953
1018
  /** Both write `animation` (W-319), so one set alone would drop the other it inherits. */
954
- const ANIMATION_KEYS = ["entrance", "scrollMotion", "loopMotion"] as const;
1019
+ const ANIMATION_KEYS = ["entrance", "scrollMotion", "loopMotion", "stickyMotion"] as const;
955
1020
 
956
1021
  /**
957
1022
  * A style that sets an entrance or scroll motion keeps the other one it inherits from a wider
@@ -243,3 +243,15 @@ export function withLoop(declarations: Declaration[], loop: Declaration[]): Decl
243
243
  ...vars,
244
244
  ];
245
245
  }
246
+
247
+ /**
248
+ * W-1070: keyframes for a sticky element's look once the page has scrolled: they exist only
249
+ * where scroll-driven animations do; padding also waits for no reduced-motion preference.
250
+ */
251
+ export const STICKY_KEYFRAMES =
252
+ "@supports (animation-timeline: scroll()){@keyframes emvb-sticky-bg{to{background-color:var(--emvb-sticky-bg)}}@keyframes emvb-sticky-shadow{to{box-shadow:0 2px 12px rgb(0 0 0 / 15%)}}}" +
253
+ "@media (prefers-reduced-motion: no-preference){@supports (animation-timeline: scroll()){@keyframes emvb-sticky-pad{to{padding-top:var(--emvb-sticky-pad);padding-bottom:var(--emvb-sticky-pad)}}}}";
254
+
255
+ /** W-1070: whether declarations play a sticky effect, so the page sends STICKY_KEYFRAMES. */
256
+ export const usesSticky = (declarations: readonly Declaration[]) =>
257
+ declarations.some((d) => d.property === "animation" && d.value.includes("emvb-sticky-"));
@@ -25,6 +25,37 @@ export const ColorVariable = z.strictObject({
25
25
  id: VariableId,
26
26
  name: z.string().min(1).max(60),
27
27
  value: z.string().regex(HEX_COLOR, "Use a hex color such as #1a2b3c"),
28
+ /**
29
+ * W-1067: the colour in dark mode: when the visitor's system prefers dark, unless a Theme
30
+ * toggle chose light; and whenever it chose dark. Unset keeps `value`.
31
+ */
32
+ dark: z.string().regex(HEX_COLOR, "Use a hex color such as #1a2b3c").optional(),
33
+ });
34
+
35
+ /**
36
+ * W-1072: a family name a custom font is declared under. The same characters as a quoted name in
37
+ * a font stack (letters, digits, spaces, `_`, `.`, `-`), so it can never close a CSS string.
38
+ */
39
+ export const FONT_FAMILY_NAME = /^[\p{L}\p{N}](?:[\p{L}\p{N} _.-]{0,58}[\p{L}\p{N}_.-])?$/u;
40
+
41
+ /** W-1072: one `unicode-range` list, such as `U+0000-00FF, U+0131`. */
42
+ export const UNICODE_RANGE =
43
+ /^U\+[0-9A-Fa-f?]{1,6}(?:-[0-9A-Fa-f]{1,6})?(?:, ?U\+[0-9A-Fa-f?]{1,6}(?:-[0-9A-Fa-f]{1,6})?)*$/;
44
+
45
+ /**
46
+ * W-1072: one file of a custom font (a WOFF2), emitted as an `@font-face` rule when a page uses
47
+ * the variable. `src` is a path on the site (EmVB's font route for uploads and Google fonts), so a
48
+ * page never asks another host for a font.
49
+ */
50
+ const FontFace = z.strictObject({
51
+ weight: z.number().int().min(1).max(1000),
52
+ style: z.enum(["normal", "italic"]),
53
+ src: z
54
+ .string()
55
+ .min(1)
56
+ .max(500)
57
+ .regex(/^\/(?!\/)/, "Use a font file on this site (a path starting with /)"),
58
+ unicodeRange: z.string().max(1000).regex(UNICODE_RANGE, "Use a unicode-range list").optional(),
28
59
  });
29
60
 
30
61
  /** Font stack string — commas and quoted family names allowed; `generateCss` drops an unsafe one. */
@@ -32,6 +63,14 @@ export const FontVariable = z.strictObject({
32
63
  id: VariableId,
33
64
  name: z.string().min(1).max(60),
34
65
  value: z.string().min(1).max(200),
66
+ /**
67
+ * W-1072: the family the custom `faces` are declared under; `value` names it first. Both or
68
+ * neither: faces without a family are not emitted.
69
+ */
70
+ family: z.string().regex(FONT_FAMILY_NAME, "Use letters, digits, spaces, _ . or -").optional(),
71
+ faces: boundedArray(FontFace, 60).optional(),
72
+ /** W-1072: where the faces came from, for the editor. Unset: uploaded files. */
73
+ source: z.enum(["upload", "google"]).optional(),
35
74
  });
36
75
 
37
76
  /**
@@ -106,6 +145,7 @@ export const DesignSystem = z.strictObject({
106
145
 
107
146
  export type ColorVariable = z.infer<typeof ColorVariable>;
108
147
  export type FontVariable = z.infer<typeof FontVariable>;
148
+ export type FontFace = z.infer<typeof FontFace>;
109
149
  export type LengthVariable = z.infer<typeof LengthVariable>;
110
150
  export type DesignSystem = z.infer<typeof DesignSystem>;
111
151