@deneb-ui/core 2.0.30 → 2.0.32

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.
@@ -1,2 +1,2 @@
1
1
  export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
2
- export declare function deepMerge<T extends Record<string, unknown>>(base: T, patch: Record<string, unknown>): T;
2
+ export declare function deepMerge<T extends Record<string, unknown>>(base: T, patch: Record<string, unknown>, depth?: number, seen?: WeakSet<object>): T;
@@ -5,11 +5,16 @@ exports.deepMerge = deepMerge;
5
5
  function isPlainObject(value) {
6
6
  return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
7
7
  }
8
- function deepMerge(base, patch) {
8
+ function deepMerge(base, patch, depth = 0, seen = new WeakSet()) {
9
+ if (depth > 50)
10
+ return { ...base, ...patch };
11
+ if (seen.has(patch))
12
+ return patch;
13
+ seen.add(patch);
9
14
  const next = { ...base };
10
15
  for (const [key, value] of Object.entries(patch)) {
11
16
  if (isPlainObject(value) && isPlainObject(next[key])) {
12
- next[key] = deepMerge(next[key], value);
17
+ next[key] = deepMerge(next[key], value, depth + 1, seen);
13
18
  }
14
19
  else {
15
20
  next[key] = value;
@@ -32,7 +32,10 @@ function lookupFontDefinition(value) {
32
32
  const primary = value.split(',')[0]?.trim().replace(/^['"]|['"]$/g, '');
33
33
  if (primary) {
34
34
  const primarySlug = normalizeFontId(primary);
35
- return registry_1.DENEB_FONT_BY_ID.get(primarySlug) ?? lookupFontDefinition(primarySlug);
35
+ // Unknown ids used to recurse with the same slug (String.split stack overflow).
36
+ if (primarySlug && primarySlug !== slug) {
37
+ return lookupFontDefinition(primary);
38
+ }
36
39
  }
37
40
  return null;
38
41
  }
@@ -97,9 +100,13 @@ function collectFontIdsFromSiteData(siteData) {
97
100
  }
98
101
  }
99
102
  }
103
+ const seen = new WeakSet();
100
104
  const walkContent = (node) => {
101
105
  if (!node || typeof node !== 'object')
102
106
  return;
107
+ if (seen.has(node))
108
+ return;
109
+ seen.add(node);
103
110
  if (Array.isArray(node)) {
104
111
  node.forEach(walkContent);
105
112
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deneb-ui/core",
3
- "version": "2.0.30",
3
+ "version": "2.0.32",
4
4
  "description": "Headless style engine for real-time Fivora visual editing — CSS variables, DOM patcher, and preview protocol.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",