@neatico/visual-core 0.14.71 → 0.14.72

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.
@@ -55,6 +55,10 @@ function validateStyleManifest(value) {
55
55
  if (!typography ||
56
56
  ["heading", "body", "code"].some((key) => typeof typography[key] !==
57
57
  "string") ||
58
+ ["quantity", "label"].some(key => {
59
+ const font = typography[key];
60
+ return font !== undefined && (typeof font !== "string" || !font.trim() || font.length > 100);
61
+ }) ||
58
62
  !Number.isInteger(typography.headingWeight) ||
59
63
  typography.headingWeight < 100 ||
60
64
  typography.headingWeight > 900)
@@ -69,7 +73,11 @@ function validateStyleManifest(value) {
69
73
  !["none", "hairline", "accent"].includes(geometry.rule))
70
74
  return fail();
71
75
  if (!manifest.fonts ||
72
- Object.keys(manifest.fonts).length !== 3 ||
76
+ Object.keys(manifest.fonts).some(key => !["heading", "body", "code", "quantity", "label"].includes(key)) ||
77
+ ["quantity", "label"].some(key => {
78
+ const font = manifest.fonts[key];
79
+ return font !== undefined && (typeof font !== "string" || !font.trim() || font.length > 100);
80
+ }) ||
73
81
  ["heading", "body", "code"].some((key) => {
74
82
  const font = manifest.fonts[key];
75
83
  return typeof font !== "string" || !font.trim() || font.length > 100;
@@ -97,6 +105,8 @@ function validateStyleManifest(value) {
97
105
  heading: manifest.fonts.heading,
98
106
  body: manifest.fonts.body,
99
107
  code: manifest.fonts.code,
108
+ ...(manifest.fonts.quantity ? { quantity: manifest.fonts.quantity } : {}),
109
+ ...(manifest.fonts.label ? { label: manifest.fonts.label } : {}),
100
110
  },
101
111
  imagery: {
102
112
  medium: manifest.imagery.medium,
@@ -13,6 +13,8 @@ export interface DesignTheme {
13
13
  heading: string;
14
14
  body: string;
15
15
  code: string;
16
+ quantity?: string;
17
+ label?: string;
16
18
  headingWeight: number;
17
19
  };
18
20
  geometry: {
@@ -9,6 +9,8 @@ export interface StyleManifest {
9
9
  heading: string;
10
10
  body: string;
11
11
  code: string;
12
+ quantity?: string;
13
+ label?: string;
12
14
  };
13
15
  imagery: {
14
16
  medium: "native" | "photography" | "illustration" | "3d";
@@ -51,6 +51,10 @@ export function validateStyleManifest(value) {
51
51
  if (!typography ||
52
52
  ["heading", "body", "code"].some((key) => typeof typography[key] !==
53
53
  "string") ||
54
+ ["quantity", "label"].some(key => {
55
+ const font = typography[key];
56
+ return font !== undefined && (typeof font !== "string" || !font.trim() || font.length > 100);
57
+ }) ||
54
58
  !Number.isInteger(typography.headingWeight) ||
55
59
  typography.headingWeight < 100 ||
56
60
  typography.headingWeight > 900)
@@ -65,7 +69,11 @@ export function validateStyleManifest(value) {
65
69
  !["none", "hairline", "accent"].includes(geometry.rule))
66
70
  return fail();
67
71
  if (!manifest.fonts ||
68
- Object.keys(manifest.fonts).length !== 3 ||
72
+ Object.keys(manifest.fonts).some(key => !["heading", "body", "code", "quantity", "label"].includes(key)) ||
73
+ ["quantity", "label"].some(key => {
74
+ const font = manifest.fonts[key];
75
+ return font !== undefined && (typeof font !== "string" || !font.trim() || font.length > 100);
76
+ }) ||
69
77
  ["heading", "body", "code"].some((key) => {
70
78
  const font = manifest.fonts[key];
71
79
  return typeof font !== "string" || !font.trim() || font.length > 100;
@@ -93,6 +101,8 @@ export function validateStyleManifest(value) {
93
101
  heading: manifest.fonts.heading,
94
102
  body: manifest.fonts.body,
95
103
  code: manifest.fonts.code,
104
+ ...(manifest.fonts.quantity ? { quantity: manifest.fonts.quantity } : {}),
105
+ ...(manifest.fonts.label ? { label: manifest.fonts.label } : {}),
96
106
  },
97
107
  imagery: {
98
108
  medium: manifest.imagery.medium,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neatico/visual-core",
3
- "version": "0.14.71",
3
+ "version": "0.14.72",
4
4
  "description": "Framework-independent geometry, measured text wrapping, and extensible scene registries for visual editors.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",