@drawnagency/primitives 0.1.86 → 0.1.88

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 (60) hide show
  1. package/dist/{chunk-YKOLOZB2.js → chunk-DRCPDOW3.js} +14 -0
  2. package/dist/{chunk-MBJUWOM2.js → chunk-EO7K45GV.js} +1 -1
  3. package/dist/{chunk-2CVP2AGK.js → chunk-H2FENAQH.js} +6 -6
  4. package/dist/{chunk-DKXISNJ2.js → chunk-NEDOJHHR.js} +2 -2
  5. package/dist/{chunk-DO3ZENLN.js → chunk-OEL57NYV.js} +1 -1
  6. package/dist/{chunk-FDBZZ4AT.js → chunk-PTVY3Q7P.js} +1 -1
  7. package/dist/{chunk-665DW3HR.js → chunk-SK6GGTTO.js} +220 -207
  8. package/dist/{chunk-EP3LVOXZ.js → chunk-WA3HFN54.js} +1 -1
  9. package/dist/{chunk-YAPG44NS.js → chunk-XDG2K6UT.js} +1 -1
  10. package/dist/{chunk-E3MTIMOG.js → chunk-XPUBUR64.js} +10 -0
  11. package/dist/components/brandguide/Colors.d.ts.map +1 -1
  12. package/dist/components/brandguide/ColorsEditable.d.ts +20 -0
  13. package/dist/components/brandguide/ColorsEditable.d.ts.map +1 -0
  14. package/dist/components/brandguide/ColorsView.d.ts +9 -0
  15. package/dist/components/brandguide/ColorsView.d.ts.map +1 -0
  16. package/dist/components/brandguide/colors-shared.d.ts +4 -0
  17. package/dist/components/brandguide/colors-shared.d.ts.map +1 -0
  18. package/dist/components/editor/index.js +4 -4
  19. package/dist/components/primitives/index.js +5 -5
  20. package/dist/components/sections/Colors/index.d.ts.map +1 -1
  21. package/dist/components/sections/SectionIsland.d.ts +8 -0
  22. package/dist/components/sections/SectionIsland.d.ts.map +1 -0
  23. package/dist/components/sections/brand-guide.js +5 -5
  24. package/dist/components/sections/register-schemas.js +8 -8
  25. package/dist/components/sections/register.js +8 -8
  26. package/dist/components/shared/Navigation.d.ts +6 -1
  27. package/dist/components/shared/Navigation.d.ts.map +1 -1
  28. package/dist/components/shell/EditorShell.d.ts.map +1 -1
  29. package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
  30. package/dist/hooks/useCollabSession.d.ts.map +1 -1
  31. package/dist/hooks/useMediaPipeline.d.ts +2 -1
  32. package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
  33. package/dist/index.js +6 -4
  34. package/dist/lib/image-refs.d.ts +9 -0
  35. package/dist/lib/image-refs.d.ts.map +1 -1
  36. package/dist/lib/index.js +2 -2
  37. package/dist/lib/registry.d.ts +7 -0
  38. package/dist/lib/registry.d.ts.map +1 -1
  39. package/dist/media/index.js +4 -2
  40. package/dist/media/resolve.d.ts +25 -0
  41. package/dist/media/resolve.d.ts.map +1 -1
  42. package/dist/schemas/index.js +2 -2
  43. package/dist/schemas/site-config.d.ts +10 -0
  44. package/dist/schemas/site-config.d.ts.map +1 -1
  45. package/package.json +1 -1
  46. package/src/components/brandguide/Colors.tsx +2 -275
  47. package/src/components/brandguide/ColorsEditable.tsx +155 -0
  48. package/src/components/brandguide/ColorsView.tsx +100 -0
  49. package/src/components/brandguide/colors-shared.ts +17 -0
  50. package/src/components/sections/Colors/index.tsx +1 -0
  51. package/src/components/sections/SectionIsland.tsx +21 -0
  52. package/src/components/shared/Navigation.tsx +20 -2
  53. package/src/components/shell/EditorShell.tsx +4 -0
  54. package/src/components/shell/SiteSettingsDisplay.tsx +106 -0
  55. package/src/hooks/useCollabSession.ts +27 -0
  56. package/src/hooks/useMediaPipeline.ts +16 -3
  57. package/src/lib/image-refs.ts +19 -0
  58. package/src/lib/registry.ts +7 -0
  59. package/src/media/resolve.ts +34 -0
  60. package/src/schemas/site-config.ts +13 -0
@@ -229,6 +229,19 @@ function rebindImageRef(ref, imageId) {
229
229
  for (const key of BAKED_MEDIA_KEYS) delete fresh[key];
230
230
  return fresh;
231
231
  }
232
+ function resolveLogo(logo, manifest, provider) {
233
+ if (!logo) return null;
234
+ const light = resolveMedia({ imageId: logo.light.imageId }, manifest, [1], provider);
235
+ if (!light?.src || light.tag === "video") return null;
236
+ const dark = logo.dark ? resolveMedia({ imageId: logo.dark.imageId }, manifest, [1], provider) : null;
237
+ const darkUrl = dark && dark.tag !== "video" ? dark.src : null;
238
+ return {
239
+ lightUrl: light.src,
240
+ darkUrl,
241
+ invertInDark: logo.invertInDark,
242
+ showInNav: logo.showInNav
243
+ };
244
+ }
232
245
 
233
246
  // src/media/videoPoster.ts
234
247
  function generateVideoPoster(blob, quality) {
@@ -324,6 +337,7 @@ export {
324
337
  resolveManifestReferences,
325
338
  BAKED_MEDIA_KEYS,
326
339
  rebindImageRef,
340
+ resolveLogo,
327
341
  generateVideoPoster,
328
342
  setMediaProvider,
329
343
  getMediaProvider
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getMediaProvider
3
- } from "./chunk-YKOLOZB2.js";
3
+ } from "./chunk-DRCPDOW3.js";
4
4
  import {
5
5
  cn
6
6
  } from "./chunk-7EOSDFS3.js";
@@ -3,7 +3,7 @@ import {
3
3
  pluralize,
4
4
  stripHtmlToPlainText,
5
5
  truncate
6
- } from "./chunk-665DW3HR.js";
6
+ } from "./chunk-SK6GGTTO.js";
7
7
  import {
8
8
  DeleteButton,
9
9
  DragHandle,
@@ -15,11 +15,11 @@ import {
15
15
  buildBlockDropData,
16
16
  canDropBlock,
17
17
  isBlockDragData
18
- } from "./chunk-YAPG44NS.js";
18
+ } from "./chunk-XDG2K6UT.js";
19
19
  import {
20
20
  EditableRichText,
21
21
  defineHeadingSection
22
- } from "./chunk-FDBZZ4AT.js";
22
+ } from "./chunk-PTVY3Q7P.js";
23
23
  import {
24
24
  EditablePlainText,
25
25
  ImageDropZone,
@@ -28,11 +28,11 @@ import {
28
28
  colSpanClass,
29
29
  containerGridClass,
30
30
  spacerHiddenClass
31
- } from "./chunk-DKXISNJ2.js";
31
+ } from "./chunk-NEDOJHHR.js";
32
32
  import {
33
33
  useMediaLibrary,
34
34
  useResolvedMedia
35
- } from "./chunk-MBJUWOM2.js";
35
+ } from "./chunk-EO7K45GV.js";
36
36
  import {
37
37
  embedUrl
38
38
  } from "./chunk-Y4JQGO6G.js";
@@ -51,7 +51,7 @@ import {
51
51
  } from "./chunk-TZQPOR5A.js";
52
52
  import {
53
53
  SingleMediaReferenceSchema
54
- } from "./chunk-E3MTIMOG.js";
54
+ } from "./chunk-XPUBUR64.js";
55
55
  import {
56
56
  defineSection,
57
57
  getSection
@@ -6,10 +6,10 @@ import {
6
6
  SettingsIcon,
7
7
  useMediaLibrary,
8
8
  useResolvedMedia
9
- } from "./chunk-MBJUWOM2.js";
9
+ } from "./chunk-EO7K45GV.js";
10
10
  import {
11
11
  rebindImageRef
12
- } from "./chunk-YKOLOZB2.js";
12
+ } from "./chunk-DRCPDOW3.js";
13
13
  import {
14
14
  cn
15
15
  } from "./chunk-7EOSDFS3.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-TZQPOR5A.js";
10
10
  import {
11
11
  IndexSchema
12
- } from "./chunk-E3MTIMOG.js";
12
+ } from "./chunk-XPUBUR64.js";
13
13
  import {
14
14
  getAllSchemas
15
15
  } from "./chunk-VKAGMEKE.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EditablePlainText
3
- } from "./chunk-DKXISNJ2.js";
3
+ } from "./chunk-NEDOJHHR.js";
4
4
  import {
5
5
  Button,
6
6
  usePages