@caelo-cms/shared 0.10.57 → 0.10.59

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 (64) hide show
  1. package/dist/ai-tools.d.ts +30 -0
  2. package/dist/ai-tools.d.ts.map +1 -1
  3. package/dist/ai-tools.js +26 -9
  4. package/dist/ai-tools.js.map +1 -1
  5. package/dist/bug-intake.d.ts +176 -0
  6. package/dist/bug-intake.d.ts.map +1 -0
  7. package/dist/bug-intake.js +200 -0
  8. package/dist/bug-intake.js.map +1 -0
  9. package/dist/content.js +7 -7
  10. package/dist/edit-markers.d.ts +49 -0
  11. package/dist/edit-markers.d.ts.map +1 -0
  12. package/dist/edit-markers.js +225 -0
  13. package/dist/edit-markers.js.map +1 -0
  14. package/dist/google-oauth.d.ts +22 -0
  15. package/dist/google-oauth.d.ts.map +1 -0
  16. package/dist/google-oauth.js +25 -0
  17. package/dist/google-oauth.js.map +1 -0
  18. package/dist/index.d.ts +4 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +4 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/link-canonicalise.d.ts +109 -0
  23. package/dist/link-canonicalise.d.ts.map +1 -0
  24. package/dist/link-canonicalise.js +471 -0
  25. package/dist/link-canonicalise.js.map +1 -0
  26. package/dist/link-refs.d.ts +63 -8
  27. package/dist/link-refs.d.ts.map +1 -1
  28. package/dist/link-refs.js +80 -14
  29. package/dist/link-refs.js.map +1 -1
  30. package/dist/media.d.ts.map +1 -1
  31. package/dist/media.js +15 -0
  32. package/dist/media.js.map +1 -1
  33. package/dist/nested-module-render.d.ts +17 -0
  34. package/dist/nested-module-render.d.ts.map +1 -1
  35. package/dist/nested-module-render.js +45 -6
  36. package/dist/nested-module-render.js.map +1 -1
  37. package/dist/page-log.d.ts +1 -1
  38. package/dist/preview-compose.d.ts.map +1 -1
  39. package/dist/preview-compose.js +12 -2
  40. package/dist/preview-compose.js.map +1 -1
  41. package/dist/theme-normalize.d.ts.map +1 -1
  42. package/dist/theme-normalize.js +17 -2
  43. package/dist/theme-normalize.js.map +1 -1
  44. package/dist/version.d.ts +2 -2
  45. package/dist/version.js +1 -1
  46. package/package.json +1 -1
  47. package/src/ai-tools.ts +29 -11
  48. package/src/bug-intake.test.ts +154 -0
  49. package/src/bug-intake.ts +256 -0
  50. package/src/content.ts +7 -7
  51. package/src/edit-markers.test.ts +111 -0
  52. package/src/edit-markers.ts +244 -0
  53. package/src/google-oauth.ts +27 -0
  54. package/src/index.ts +4 -0
  55. package/src/link-canonicalise.test.ts +387 -0
  56. package/src/link-canonicalise.ts +598 -0
  57. package/src/link-refs.test.ts +206 -0
  58. package/src/link-refs.ts +119 -21
  59. package/src/media.ts +16 -0
  60. package/src/nested-module-render.ts +59 -4
  61. package/src/preview-compose.ts +11 -2
  62. package/src/theme-normalize-typography-subfields.test.ts +54 -0
  63. package/src/theme-normalize.ts +19 -2
  64. package/src/version.ts +1 -1
@@ -284,8 +284,14 @@ export function normalizeTokens(input: Record<string, unknown>): NormalizeResult
284
284
  // resulting document validates. applyDtcgWrites merges this into
285
285
  // any existing typography composite at the path so partial updates
286
286
  // don't erase sibling sub-fields.
287
+ // Numbers wrap too: the admin form coerces `.lineHeight` / `.fontWeight`
288
+ // to numbers, and an unwrapped `1.6` would replace the whole composite.
287
289
  let storedValue: unknown = rawValue;
288
- if (resolved.compositeWrap && typeof rawValue === "string" && !ALIAS_REGEX.test(rawValue)) {
290
+ if (
291
+ resolved.compositeWrap &&
292
+ (typeof rawValue === "number" ||
293
+ (typeof rawValue === "string" && !ALIAS_REGEX.test(rawValue)))
294
+ ) {
289
295
  storedValue = { [resolved.compositeWrap]: rawValue };
290
296
  } else if (
291
297
  resolved.inferredType === "gradient" &&
@@ -303,10 +309,17 @@ export function normalizeTokens(input: Record<string, unknown>): NormalizeResult
303
309
  // rather than us silently inventing a gradient (CLAUDE.md §2).
304
310
  storedValue = gradientObjectToCss(rawValue as Record<string, unknown>) ?? rawValue;
305
311
  }
312
+ // Several sub-field inputs (`typography.body.fontSize` +
313
+ // `typography.body.lineHeight`) collapse onto the same composite
314
+ // path; merge them so the last one doesn't silently drop the others.
315
+ const prior = set[resolved.path];
316
+ if (resolved.compositeWrap && isPlainObject(prior) && isPlainObject(storedValue)) {
317
+ storedValue = { ...prior, ...storedValue };
318
+ }
306
319
  set[resolved.path] = storedValue;
307
320
  types[resolved.path] = resolved.inferredType;
308
321
  if (envelopeDescription !== undefined) descriptions[resolved.path] = envelopeDescription;
309
- paths.push(resolved.path);
322
+ if (!paths.includes(resolved.path)) paths.push(resolved.path);
310
323
  }
311
324
 
312
325
  return { set, types, descriptions, canonicalPaths: paths };
@@ -721,3 +734,7 @@ function similarity(a: string, b: string): number {
721
734
  function tokenise(s: string): string[] {
722
735
  return s.split(/[.\-_]/).filter((p) => p.length > 0);
723
736
  }
737
+
738
+ function isPlainObject(v: unknown): v is Record<string, unknown> {
739
+ return v !== null && typeof v === "object" && !Array.isArray(v);
740
+ }
package/src/version.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  * follow standard SemVer.
23
23
  */
24
24
 
25
- export const CAELO_VERSION = "0.10.57";
25
+ export const CAELO_VERSION = "0.10.59";
26
26
 
27
27
  /**
28
28
  * Deprecated alias for back-compat — early P17 work spelled this