@drawnagency/primitives 0.1.113 → 0.1.115

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 (534) hide show
  1. package/README.md +1 -1
  2. package/dist/auth/cookies.d.ts +39 -0
  3. package/dist/auth/cookies.d.ts.map +1 -1
  4. package/dist/auth/index.js +3 -3
  5. package/dist/chunk-4WQ36ZP7.js +83 -0
  6. package/dist/{chunk-REDDTTGJ.js → chunk-4Y2JQQZL.js} +19 -1
  7. package/dist/chunk-5GFACGSN.js +6 -0
  8. package/dist/{chunk-AHALSCQH.js → chunk-67P34WNW.js} +76 -131
  9. package/dist/{chunk-S2L3BPLS.js → chunk-7SX42OP4.js} +1 -1
  10. package/dist/{chunk-GGXZZ77Z.js → chunk-AASEGXNT.js} +18 -1
  11. package/dist/chunk-APIJPTFG.js +64 -0
  12. package/dist/{chunk-WKZ7OENC.js → chunk-BQ5TZZUE.js} +5 -1
  13. package/dist/chunk-CDBURDPX.js +90 -0
  14. package/dist/chunk-DFKTF3CH.js +0 -0
  15. package/dist/chunk-DIMDRBFK.js +11 -0
  16. package/dist/chunk-DJABADOO.js +131 -0
  17. package/dist/{chunk-NHN2LSIU.js → chunk-DJOGPSRU.js} +31 -68
  18. package/dist/{chunk-KR2MHTNJ.js → chunk-FHTKSELX.js} +610 -62
  19. package/dist/{chunk-WUJ3XNFI.js → chunk-GGYY3JQJ.js} +19 -24
  20. package/dist/chunk-GNF6KFQ7.js +18 -0
  21. package/dist/{chunk-FRE2CCLV.js → chunk-HHNPSKPT.js} +5 -79
  22. package/dist/{chunk-IINIZBQB.js → chunk-JCDZAFX2.js} +30 -10
  23. package/dist/chunk-JR24U7FJ.js +120 -0
  24. package/dist/{chunk-BDFTMGCL.js → chunk-JXATNKLV.js} +11 -10
  25. package/dist/{chunk-SW6PCQQD.js → chunk-KQA772WQ.js} +2 -1
  26. package/dist/{chunk-6BZ2KNTP.js → chunk-NX7TFHA4.js} +195 -65
  27. package/dist/{chunk-VWWY5TL5.js → chunk-O37AV27P.js} +14 -75
  28. package/dist/chunk-RIITGTV3.js +275 -0
  29. package/dist/{chunk-HBULBDGP.js → chunk-S37DZPHW.js} +1 -1
  30. package/dist/chunk-S7QRHUWO.js +8 -0
  31. package/dist/{chunk-Z7W3DQTR.js → chunk-T26HAKW3.js} +424 -42
  32. package/dist/{chunk-4I5OO5UB.js → chunk-TEOAKGZA.js} +0 -1
  33. package/dist/{chunk-GPPVYLEI.js → chunk-UUUSJDIG.js} +1 -1
  34. package/dist/chunk-VY3IFGE3.js +70 -0
  35. package/dist/chunk-WYOFQHKI.js +176 -0
  36. package/dist/{chunk-4RNF2DRG.js → chunk-XDEPXTBY.js} +0 -2
  37. package/dist/{chunk-DS4GCYV2.js → chunk-YV3YSZEB.js} +223 -16
  38. package/dist/collab/rebase.d.ts +2 -1
  39. package/dist/collab/rebase.d.ts.map +1 -1
  40. package/dist/collab/rebase.js +24 -9
  41. package/dist/components/brandguide/ColorsEditable.d.ts.map +1 -1
  42. package/dist/components/chat/ChatPanel.d.ts.map +1 -1
  43. package/dist/components/chat/ChatWidget.d.ts.map +1 -1
  44. package/dist/components/docfile/DocFilePane.d.ts.map +1 -1
  45. package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -1
  46. package/dist/components/editor/ConflictDialog.d.ts.map +1 -1
  47. package/dist/components/editor/DragHandle.d.ts +12 -2
  48. package/dist/components/editor/DragHandle.d.ts.map +1 -1
  49. package/dist/components/editor/DropEdgeIndicator.d.ts +15 -6
  50. package/dist/components/editor/DropEdgeIndicator.d.ts.map +1 -1
  51. package/dist/components/editor/NavGroupRow.d.ts +4 -1
  52. package/dist/components/editor/NavGroupRow.d.ts.map +1 -1
  53. package/dist/components/editor/PagesModal.d.ts.map +1 -1
  54. package/dist/components/editor/SectionWrapper.d.ts +1 -1
  55. package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
  56. package/dist/components/editor/SettingsForm.d.ts.map +1 -1
  57. package/dist/components/editor/TagIndicator.d.ts +15 -0
  58. package/dist/components/editor/TagIndicator.d.ts.map +1 -0
  59. package/dist/components/editor/index.js +150 -79
  60. package/dist/components/primitives/DocumentDropZone.d.ts +1 -1
  61. package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
  62. package/dist/components/primitives/EditableList.d.ts.map +1 -1
  63. package/dist/components/primitives/HeadingSection.d.ts +4 -1
  64. package/dist/components/primitives/HeadingSection.d.ts.map +1 -1
  65. package/dist/components/primitives/ResolvedMedia.d.ts +5 -1
  66. package/dist/components/primitives/ResolvedMedia.d.ts.map +1 -1
  67. package/dist/components/primitives/{defineHeadingSection.d.ts → define-heading-section.d.ts} +1 -1
  68. package/dist/components/primitives/define-heading-section.d.ts.map +1 -0
  69. package/dist/components/primitives/{gridDrop.d.ts → grid-drop.d.ts} +1 -1
  70. package/dist/components/primitives/grid-drop.d.ts.map +1 -0
  71. package/dist/components/primitives/index.d.ts +1 -1
  72. package/dist/components/primitives/index.d.ts.map +1 -1
  73. package/dist/components/primitives/index.js +22 -154
  74. package/dist/components/sections/Button/CTAButton.d.ts.map +1 -1
  75. package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts +2 -6
  76. package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts.map +1 -1
  77. package/dist/components/sections/DoDontMedia/index.d.ts +8 -0
  78. package/dist/components/sections/DoDontMedia/index.d.ts.map +1 -1
  79. package/dist/components/sections/IconList/IconList.d.ts +2 -1
  80. package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
  81. package/dist/components/sections/IconList/IconListSettings.d.ts +2 -1
  82. package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -1
  83. package/dist/components/sections/IconList/index.d.ts +1 -0
  84. package/dist/components/sections/IconList/index.d.ts.map +1 -1
  85. package/dist/components/sections/Media/MediaBlock.d.ts +2 -1
  86. package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -1
  87. package/dist/components/sections/Media/index.d.ts +8 -0
  88. package/dist/components/sections/Media/index.d.ts.map +1 -1
  89. package/dist/components/sections/Reference/ReferenceList.d.ts +35 -0
  90. package/dist/components/sections/Reference/ReferenceList.d.ts.map +1 -0
  91. package/dist/components/sections/Reference/ReferenceSettings.d.ts +12 -0
  92. package/dist/components/sections/Reference/ReferenceSettings.d.ts.map +1 -0
  93. package/dist/components/sections/Reference/index.d.ts +9 -0
  94. package/dist/components/sections/Reference/index.d.ts.map +1 -0
  95. package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts +38 -0
  96. package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts.map +1 -0
  97. package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts +20 -0
  98. package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts.map +1 -0
  99. package/dist/components/sections/SectionSummary/index.d.ts +33 -0
  100. package/dist/components/sections/SectionSummary/index.d.ts.map +1 -0
  101. package/dist/components/sections/all-sections.d.ts +53 -0
  102. package/dist/components/sections/all-sections.d.ts.map +1 -1
  103. package/dist/components/sections/brand-guide.d.ts +41 -2
  104. package/dist/components/sections/brand-guide.d.ts.map +1 -1
  105. package/dist/components/sections/brand-guide.js +17 -10
  106. package/dist/components/sections/core-sections.d.ts +14 -0
  107. package/dist/components/sections/core-sections.d.ts.map +1 -1
  108. package/dist/components/sections/register-schemas.js +25 -18
  109. package/dist/components/sections/register.js +25 -18
  110. package/dist/components/shared/BrandSwatchesContext.d.ts +9 -0
  111. package/dist/components/shared/BrandSwatchesContext.d.ts.map +1 -0
  112. package/dist/components/shared/Button.d.ts +11 -3
  113. package/dist/components/shared/Button.d.ts.map +1 -1
  114. package/dist/components/shared/Checkbox.d.ts +6 -0
  115. package/dist/components/shared/Checkbox.d.ts.map +1 -1
  116. package/dist/components/shared/ConfirmDialog.d.ts +25 -0
  117. package/dist/components/shared/ConfirmDialog.d.ts.map +1 -0
  118. package/dist/components/shared/ConfirmInline.d.ts +25 -0
  119. package/dist/components/shared/ConfirmInline.d.ts.map +1 -0
  120. package/dist/components/shared/ErrorBoundary.d.ts.map +1 -1
  121. package/dist/components/shared/Fab.d.ts +11 -2
  122. package/dist/components/shared/Fab.d.ts.map +1 -1
  123. package/dist/components/shared/FabStack.d.ts +22 -0
  124. package/dist/components/shared/FabStack.d.ts.map +1 -0
  125. package/dist/components/shared/HistoryChangesModal.d.ts.map +1 -1
  126. package/dist/components/shared/HistoryPopover.d.ts.map +1 -1
  127. package/dist/components/shared/ImageBackgroundField.d.ts +9 -0
  128. package/dist/components/shared/ImageBackgroundField.d.ts.map +1 -0
  129. package/dist/components/shared/{UploadRejectionAlert.d.ts → InlineAlert.d.ts} +4 -2
  130. package/dist/components/shared/InlineAlert.d.ts.map +1 -0
  131. package/dist/components/shared/Input.d.ts +10 -0
  132. package/dist/components/shared/Input.d.ts.map +1 -1
  133. package/dist/components/shared/Navigation.d.ts.map +1 -1
  134. package/dist/components/shared/Notice.d.ts +10 -0
  135. package/dist/components/shared/Notice.d.ts.map +1 -0
  136. package/dist/components/shared/Popover.d.ts.map +1 -1
  137. package/dist/components/shared/ReferenceSourcesContext.d.ts +25 -0
  138. package/dist/components/shared/ReferenceSourcesContext.d.ts.map +1 -0
  139. package/dist/components/shared/Select.d.ts +3 -2
  140. package/dist/components/shared/Select.d.ts.map +1 -1
  141. package/dist/components/shared/SplitButton.d.ts.map +1 -1
  142. package/dist/components/shared/SummaryAnchorsContext.d.ts +10 -0
  143. package/dist/components/shared/SummaryAnchorsContext.d.ts.map +1 -0
  144. package/dist/components/shared/Textarea.d.ts +7 -0
  145. package/dist/components/shared/Textarea.d.ts.map +1 -1
  146. package/dist/components/shared/ToolbarFrame.d.ts +17 -0
  147. package/dist/components/shared/ToolbarFrame.d.ts.map +1 -0
  148. package/dist/components/shared/copy.d.ts +13 -0
  149. package/dist/components/shared/copy.d.ts.map +1 -0
  150. package/dist/components/shared/icons.d.ts +0 -12
  151. package/dist/components/shared/icons.d.ts.map +1 -1
  152. package/dist/components/shell/AudienceDetailsPanel.d.ts +7 -1
  153. package/dist/components/shell/AudienceDetailsPanel.d.ts.map +1 -1
  154. package/dist/components/shell/AudienceRow.d.ts.map +1 -1
  155. package/dist/components/shell/BugReportFAB.d.ts +7 -1
  156. package/dist/components/shell/BugReportFAB.d.ts.map +1 -1
  157. package/dist/components/shell/CredentialList.d.ts.map +1 -1
  158. package/dist/components/shell/DocInspector.d.ts.map +1 -1
  159. package/dist/components/shell/DocumentEditorOverlay.d.ts.map +1 -1
  160. package/dist/components/shell/EditorContext.d.ts +4 -0
  161. package/dist/components/shell/EditorContext.d.ts.map +1 -1
  162. package/dist/components/shell/EditorLoginForm.d.ts.map +1 -1
  163. package/dist/components/shell/EditorModal.d.ts.map +1 -1
  164. package/dist/components/shell/EditorShell.d.ts.map +1 -1
  165. package/dist/components/shell/HistoryToolbar.d.ts.map +1 -1
  166. package/dist/components/shell/MediaFolderTile.d.ts +4 -1
  167. package/dist/components/shell/MediaFolderTile.d.ts.map +1 -1
  168. package/dist/components/shell/MediaLibraryModal.d.ts.map +1 -1
  169. package/dist/components/shell/RestoreModal.d.ts.map +1 -1
  170. package/dist/components/shell/SiteSettingsChatbot.d.ts.map +1 -1
  171. package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
  172. package/dist/components/shell/SiteSettingsModal.d.ts +3 -1
  173. package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
  174. package/dist/components/shell/SiteSettingsTags.d.ts +13 -0
  175. package/dist/components/shell/SiteSettingsTags.d.ts.map +1 -0
  176. package/dist/components/shell/SiteSettingsUsers.d.ts.map +1 -1
  177. package/dist/components/shell/ViewerLoginForm.d.ts.map +1 -1
  178. package/dist/components/shell/{blockMoveDispatch.d.ts → block-move-dispatch.d.ts} +1 -1
  179. package/dist/components/shell/block-move-dispatch.d.ts.map +1 -0
  180. package/dist/components/shell/reference-sources.d.ts +22 -0
  181. package/dist/components/shell/reference-sources.d.ts.map +1 -0
  182. package/dist/deck/index.d.ts +2 -2
  183. package/dist/deck/index.d.ts.map +1 -1
  184. package/dist/deck/index.js +1 -3
  185. package/dist/deck-builder/index.js +10 -17
  186. package/dist/document/index.d.ts +2 -2
  187. package/dist/document/index.d.ts.map +1 -1
  188. package/dist/hooks/useBlockDnd.d.ts +11 -0
  189. package/dist/hooks/useBlockDnd.d.ts.map +1 -1
  190. package/dist/hooks/useBuildStatus.d.ts +1 -1
  191. package/dist/hooks/useBuildStatus.d.ts.map +1 -1
  192. package/dist/hooks/useDocumentUploads.d.ts +1 -1
  193. package/dist/hooks/useDocumentUploads.d.ts.map +1 -1
  194. package/dist/hooks/useEditorPersistence.d.ts +5 -1
  195. package/dist/hooks/useEditorPersistence.d.ts.map +1 -1
  196. package/dist/hooks/useEditorPublish.d.ts +6 -3
  197. package/dist/hooks/useEditorPublish.d.ts.map +1 -1
  198. package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
  199. package/dist/hooks/useNotice.d.ts +19 -0
  200. package/dist/hooks/useNotice.d.ts.map +1 -0
  201. package/dist/hooks/useSortableNavRow.d.ts +11 -0
  202. package/dist/hooks/useSortableNavRow.d.ts.map +1 -1
  203. package/dist/hooks/useSortableRow.d.ts +11 -0
  204. package/dist/hooks/useSortableRow.d.ts.map +1 -1
  205. package/dist/hooks/useStackedEscape.d.ts +32 -0
  206. package/dist/hooks/useStackedEscape.d.ts.map +1 -0
  207. package/dist/index.js +95 -48
  208. package/dist/lib/audience-secret.js +2 -2
  209. package/dist/lib/block-dnd.d.ts +5 -0
  210. package/dist/lib/block-dnd.d.ts.map +1 -1
  211. package/dist/lib/block-move.d.ts.map +1 -1
  212. package/dist/lib/brand-swatches.d.ts +12 -0
  213. package/dist/lib/brand-swatches.d.ts.map +1 -0
  214. package/dist/lib/container-ops.d.ts +3 -2
  215. package/dist/lib/container-ops.d.ts.map +1 -1
  216. package/dist/lib/dexie.d.ts +7 -1
  217. package/dist/lib/dexie.d.ts.map +1 -1
  218. package/dist/lib/dexie.js +12 -3
  219. package/dist/lib/env.d.ts +4 -0
  220. package/dist/lib/env.d.ts.map +1 -1
  221. package/dist/lib/env.js +5 -3
  222. package/dist/lib/events.d.ts +1 -2
  223. package/dist/lib/events.d.ts.map +1 -1
  224. package/dist/lib/image-background.d.ts +8 -0
  225. package/dist/lib/image-background.d.ts.map +1 -0
  226. package/dist/lib/image-variant-plan.d.ts +42 -0
  227. package/dist/lib/image-variant-plan.d.ts.map +1 -0
  228. package/dist/lib/image-variant-plan.js +53 -0
  229. package/dist/lib/index-ops.d.ts.map +1 -1
  230. package/dist/lib/index-ops.js +21 -17
  231. package/dist/lib/index.d.ts +7 -4
  232. package/dist/lib/index.d.ts.map +1 -1
  233. package/dist/lib/index.js +55 -26
  234. package/dist/lib/loader.d.ts +25 -12
  235. package/dist/lib/loader.d.ts.map +1 -1
  236. package/dist/lib/media-ops.d.ts +73 -0
  237. package/dist/lib/media-ops.d.ts.map +1 -0
  238. package/dist/lib/media-ops.js +60 -0
  239. package/dist/lib/nav-tree.d.ts +7 -0
  240. package/dist/lib/nav-tree.d.ts.map +1 -1
  241. package/dist/lib/nav.d.ts +38 -0
  242. package/dist/lib/nav.d.ts.map +1 -1
  243. package/dist/lib/pages.d.ts +2 -1
  244. package/dist/lib/pages.d.ts.map +1 -1
  245. package/dist/lib/platform-broker.d.ts +4 -2
  246. package/dist/lib/platform-broker.d.ts.map +1 -1
  247. package/dist/lib/platform-broker.js +21 -13
  248. package/dist/lib/reference-type.d.ts +2 -0
  249. package/dist/lib/reference-type.d.ts.map +1 -0
  250. package/dist/lib/reference-validation.d.ts +31 -0
  251. package/dist/lib/reference-validation.d.ts.map +1 -0
  252. package/dist/lib/reference-validation.js +39 -0
  253. package/dist/lib/references.d.ts +74 -0
  254. package/dist/lib/references.d.ts.map +1 -0
  255. package/dist/lib/registry.d.ts +35 -0
  256. package/dist/lib/registry.d.ts.map +1 -1
  257. package/dist/lib/{safeRedirect.d.ts → safe-redirect.d.ts} +1 -1
  258. package/dist/lib/safe-redirect.d.ts.map +1 -0
  259. package/dist/lib/sidecar-diagnostics.d.ts +20 -0
  260. package/dist/lib/sidecar-diagnostics.d.ts.map +1 -0
  261. package/dist/lib/sidecars.d.ts +118 -0
  262. package/dist/lib/sidecars.d.ts.map +1 -0
  263. package/dist/lib/sidecars.js +23 -0
  264. package/dist/lib/slug.d.ts +2 -0
  265. package/dist/lib/slug.d.ts.map +1 -0
  266. package/dist/lib/storage-tier.d.ts +17 -0
  267. package/dist/lib/storage-tier.d.ts.map +1 -0
  268. package/dist/lib/storage-tier.js +29 -0
  269. package/dist/lib/tags.d.ts +64 -0
  270. package/dist/lib/tags.d.ts.map +1 -0
  271. package/dist/lib/theme-vars.d.ts +9 -0
  272. package/dist/lib/theme-vars.d.ts.map +1 -1
  273. package/dist/media/index.d.ts +1 -1
  274. package/dist/media/index.d.ts.map +1 -1
  275. package/dist/media/index.js +18 -14
  276. package/dist/media/queue.d.ts +2 -0
  277. package/dist/media/queue.d.ts.map +1 -1
  278. package/dist/media/utils.d.ts +2 -0
  279. package/dist/media/utils.d.ts.map +1 -1
  280. package/dist/media/{videoPoster.d.ts → video-poster.d.ts} +1 -1
  281. package/dist/media/video-poster.d.ts.map +1 -0
  282. package/dist/media/worker.d.ts +1 -35
  283. package/dist/media/worker.d.ts.map +1 -1
  284. package/dist/schemas/audience.js +2 -2
  285. package/dist/schemas/index.d.ts +1 -0
  286. package/dist/schemas/index.d.ts.map +1 -1
  287. package/dist/schemas/index.js +25 -13
  288. package/dist/schemas/media.d.ts +4 -0
  289. package/dist/schemas/media.d.ts.map +1 -1
  290. package/dist/schemas/shared.d.ts +26 -0
  291. package/dist/schemas/shared.d.ts.map +1 -1
  292. package/dist/schemas/site-config.d.ts +6 -0
  293. package/dist/schemas/site-config.d.ts.map +1 -1
  294. package/dist/schemas/tags.d.ts +27 -0
  295. package/dist/schemas/tags.d.ts.map +1 -0
  296. package/dist/storage/index.js +2 -1
  297. package/dist/storage/memory.d.ts +21 -0
  298. package/dist/storage/memory.d.ts.map +1 -0
  299. package/dist/storage/memory.js +129 -0
  300. package/dist/storage/types.d.ts +9 -0
  301. package/dist/storage/types.d.ts.map +1 -1
  302. package/dist/types/database.d.ts.map +1 -1
  303. package/package.json +26 -1
  304. package/src/auth/cookies.ts +111 -0
  305. package/src/collab/rebase.ts +29 -9
  306. package/src/components/brandguide/ColorSwatchSettings.tsx +1 -1
  307. package/src/components/brandguide/ColorsEditable.tsx +1 -0
  308. package/src/components/chat/ChatPanel.tsx +2 -3
  309. package/src/components/chat/ChatWidget.tsx +2 -3
  310. package/src/components/docfile/DocFilePane.tsx +4 -12
  311. package/src/components/editor/ChildBlockWrapper.tsx +13 -19
  312. package/src/components/editor/ConflictDialog.tsx +27 -35
  313. package/src/components/editor/DeleteButton.tsx +2 -2
  314. package/src/components/editor/DragHandle.tsx +16 -3
  315. package/src/components/editor/DropEdgeIndicator.tsx +36 -10
  316. package/src/components/editor/InsertButton.tsx +2 -2
  317. package/src/components/editor/NavGroupRow.tsx +43 -14
  318. package/src/components/editor/PagesModal.tsx +99 -26
  319. package/src/components/editor/SectionWrapper.tsx +64 -23
  320. package/src/components/editor/SettingsButton.tsx +2 -2
  321. package/src/components/editor/SettingsForm.tsx +19 -2
  322. package/src/components/editor/StatusIndicator.tsx +4 -4
  323. package/src/components/editor/TagIndicator.tsx +80 -0
  324. package/src/components/primitives/DocumentDropZone.tsx +1 -1
  325. package/src/components/primitives/EditableGrid.tsx +15 -14
  326. package/src/components/primitives/EditableList.tsx +27 -74
  327. package/src/components/primitives/HeadingSection.tsx +5 -2
  328. package/src/components/primitives/ResolvedMedia.tsx +13 -0
  329. package/src/components/primitives/{defineHeadingSection.tsx → define-heading-section.tsx} +1 -0
  330. package/src/components/primitives/index.ts +1 -1
  331. package/src/components/primitives/useEditablePlainText.ts +5 -5
  332. package/src/components/sections/Button/CTAButton.tsx +3 -1
  333. package/src/components/sections/DoDontMedia/DoDontMediaBlock.tsx +4 -4
  334. package/src/components/sections/DoDontMedia/index.tsx +12 -3
  335. package/src/components/sections/IconList/DoDontToggle.tsx +2 -2
  336. package/src/components/sections/IconList/IconList.tsx +70 -37
  337. package/src/components/sections/IconList/IconListSettings.tsx +55 -17
  338. package/src/components/sections/IconList/index.tsx +10 -3
  339. package/src/components/sections/LinkHeading/index.tsx +1 -1
  340. package/src/components/sections/Media/MediaBlock.tsx +13 -2
  341. package/src/components/sections/Media/index.tsx +12 -4
  342. package/src/components/sections/Reference/ReferenceList.tsx +214 -0
  343. package/src/components/sections/Reference/ReferenceSettings.tsx +159 -0
  344. package/src/components/sections/Reference/index.tsx +47 -0
  345. package/src/components/sections/SectionSummary/SectionSummaryBlock.tsx +476 -0
  346. package/src/components/sections/SectionSummary/SectionSummarySettings.tsx +126 -0
  347. package/src/components/sections/SectionSummary/index.tsx +149 -0
  348. package/src/components/sections/SubHeading/index.tsx +1 -1
  349. package/src/components/sections/SubSubHeading/index.tsx +1 -1
  350. package/src/components/sections/brand-guide.ts +4 -3
  351. package/src/components/sections/core-sections.ts +2 -0
  352. package/src/components/shared/BrandSwatchesContext.ts +13 -0
  353. package/src/components/shared/Button.tsx +47 -34
  354. package/src/components/shared/Checkbox.tsx +21 -12
  355. package/src/components/shared/ConfirmDialog.tsx +87 -0
  356. package/src/components/shared/ConfirmInline.tsx +90 -0
  357. package/src/components/shared/ErrorBoundary.tsx +6 -18
  358. package/src/components/shared/Fab.tsx +15 -5
  359. package/src/components/shared/FabStack.tsx +28 -0
  360. package/src/components/shared/HistoryChangesModal.tsx +43 -41
  361. package/src/components/shared/HistoryPopover.tsx +7 -20
  362. package/src/components/shared/ImageBackgroundField.tsx +92 -0
  363. package/src/components/shared/{UploadRejectionAlert.tsx → InlineAlert.tsx} +21 -5
  364. package/src/components/shared/Input.tsx +23 -7
  365. package/src/components/shared/Navigation.tsx +22 -17
  366. package/src/components/shared/Notice.tsx +59 -0
  367. package/src/components/shared/Popover.tsx +7 -11
  368. package/src/components/shared/ReferenceSourcesContext.ts +27 -0
  369. package/src/components/shared/Select.tsx +5 -2
  370. package/src/components/shared/SplitButton.tsx +11 -17
  371. package/src/components/shared/SummaryAnchorsContext.ts +11 -0
  372. package/src/components/shared/Textarea.tsx +17 -2
  373. package/src/components/shared/ToolbarFrame.tsx +28 -0
  374. package/src/components/shared/VideoSourceField.tsx +1 -1
  375. package/src/components/shared/copy.ts +18 -0
  376. package/src/components/shared/icons.tsx +1 -17
  377. package/src/components/shell/AudienceAddForm.tsx +2 -2
  378. package/src/components/shell/AudienceDetailsPanel.tsx +23 -5
  379. package/src/components/shell/AudienceRow.tsx +22 -15
  380. package/src/components/shell/BugReportFAB.tsx +50 -40
  381. package/src/components/shell/CredentialList.tsx +33 -13
  382. package/src/components/shell/DocInspector.tsx +3 -12
  383. package/src/components/shell/DocumentEditorOverlay.tsx +33 -23
  384. package/src/components/shell/EditorContext.tsx +7 -0
  385. package/src/components/shell/EditorLoginForm.tsx +26 -36
  386. package/src/components/shell/EditorModal.tsx +8 -10
  387. package/src/components/shell/EditorShell.tsx +501 -338
  388. package/src/components/shell/HistoryToolbar.tsx +24 -26
  389. package/src/components/shell/MediaFolderTile.tsx +8 -3
  390. package/src/components/shell/MediaLibraryModal.tsx +59 -60
  391. package/src/components/shell/ProcessingIndicator.tsx +2 -2
  392. package/src/components/shell/RestoreModal.tsx +17 -16
  393. package/src/components/shell/SetPasswordForm.tsx +3 -3
  394. package/src/components/shell/SiteSettingsChatbot.tsx +61 -42
  395. package/src/components/shell/SiteSettingsDisplay.tsx +10 -20
  396. package/src/components/shell/SiteSettingsModal.tsx +24 -2
  397. package/src/components/shell/SiteSettingsTags.tsx +143 -0
  398. package/src/components/shell/SiteSettingsUsers.tsx +36 -26
  399. package/src/components/shell/SiteSettingsViewerAccess.tsx +2 -2
  400. package/src/components/shell/ViewerLoginForm.tsx +5 -4
  401. package/src/components/shell/reference-sources.ts +36 -0
  402. package/src/deck/index.ts +2 -2
  403. package/src/document/index.ts +2 -2
  404. package/src/hooks/useBlockDnd.ts +11 -0
  405. package/src/hooks/useBuildStatus.ts +53 -6
  406. package/src/hooks/useDocumentUploads.ts +1 -1
  407. package/src/hooks/useEditorPersistence.ts +141 -35
  408. package/src/hooks/useEditorPublish.ts +27 -31
  409. package/src/hooks/useMediaPipeline.ts +30 -24
  410. package/src/hooks/useNotice.ts +45 -0
  411. package/src/hooks/useSortableNavRow.ts +11 -0
  412. package/src/hooks/useSortableRow.ts +22 -2
  413. package/src/hooks/useStackedEscape.ts +62 -0
  414. package/src/lib/block-dnd.ts +6 -1
  415. package/src/lib/block-move.ts +3 -0
  416. package/src/lib/brand-swatches.ts +32 -0
  417. package/src/lib/container-ops.ts +5 -3
  418. package/src/lib/dexie.ts +24 -2
  419. package/src/lib/env.ts +9 -0
  420. package/src/lib/events.ts +1 -2
  421. package/src/lib/image-background.ts +31 -0
  422. package/src/lib/image-variant-plan.ts +92 -0
  423. package/src/lib/index-ops.ts +9 -18
  424. package/src/lib/index.ts +20 -4
  425. package/src/lib/loader.ts +28 -88
  426. package/src/lib/media-ops.ts +112 -0
  427. package/src/lib/nav-tree.ts +104 -4
  428. package/src/lib/nav.ts +196 -36
  429. package/src/lib/pages.ts +2 -3
  430. package/src/lib/platform-broker.ts +32 -14
  431. package/src/lib/reference-type.ts +3 -0
  432. package/src/lib/reference-validation.ts +69 -0
  433. package/src/lib/references.ts +130 -0
  434. package/src/lib/registry.ts +37 -0
  435. package/src/lib/sidecar-diagnostics.ts +29 -0
  436. package/src/lib/sidecars.ts +221 -0
  437. package/src/lib/slug.ts +6 -0
  438. package/src/lib/storage-tier.ts +38 -0
  439. package/src/lib/tags.ts +165 -0
  440. package/src/lib/theme-vars.ts +23 -0
  441. package/src/media/index.ts +1 -1
  442. package/src/media/queue.ts +3 -0
  443. package/src/media/utils.ts +19 -1
  444. package/src/media/{videoPoster.ts → video-poster.ts} +2 -2
  445. package/src/media/worker.ts +17 -8
  446. package/src/schemas/index.ts +1 -0
  447. package/src/schemas/media.ts +7 -2
  448. package/src/schemas/shared.ts +24 -1
  449. package/src/schemas/site-config.ts +6 -1
  450. package/src/schemas/tags.ts +33 -0
  451. package/src/storage/memory.ts +178 -0
  452. package/src/storage/types.ts +16 -3
  453. package/src/types/database.ts +2 -0
  454. package/dist/chunk-DNY72JZN.js +0 -86
  455. package/dist/chunk-F2LYQPXV.js +0 -77
  456. package/dist/chunk-JH762VUH.js +0 -128
  457. package/dist/chunk-K7DYZXVU.js +0 -138
  458. package/dist/components/primitives/defineHeadingSection.d.ts.map +0 -1
  459. package/dist/components/primitives/gridDrop.d.ts.map +0 -1
  460. package/dist/components/shared/UploadRejectionAlert.d.ts.map +0 -1
  461. package/dist/components/shell/BuildStatusIndicator.d.ts +0 -7
  462. package/dist/components/shell/BuildStatusIndicator.d.ts.map +0 -1
  463. package/dist/components/shell/blockMoveDispatch.d.ts.map +0 -1
  464. package/dist/hooks/index.d.ts +0 -9
  465. package/dist/hooks/index.d.ts.map +0 -1
  466. package/dist/lib/grid.d.ts +0 -2
  467. package/dist/lib/grid.d.ts.map +0 -1
  468. package/dist/lib/safeRedirect.d.ts.map +0 -1
  469. package/dist/media/videoPoster.d.ts.map +0 -1
  470. package/src/components/brandguide/ColorSwatchSettings.d.ts.map +0 -1
  471. package/src/components/brandguide/Colors.d.ts.map +0 -1
  472. package/src/components/primitives/CustomParagraph.d.ts.map +0 -1
  473. package/src/components/primitives/EditableGrid.d.ts.map +0 -1
  474. package/src/components/primitives/EditablePlainText.d.ts.map +0 -1
  475. package/src/components/primitives/EditableRichText.d.ts.map +0 -1
  476. package/src/components/primitives/HeadingSection.d.ts.map +0 -1
  477. package/src/components/primitives/IconPicker.d.ts.map +0 -1
  478. package/src/components/primitives/LinkPopover.d.ts.map +0 -1
  479. package/src/components/primitives/MediaSettingsForms.d.ts.map +0 -1
  480. package/src/components/primitives/ResolvedMedia.d.ts.map +0 -1
  481. package/src/components/primitives/RichTextToolbar.d.ts.map +0 -1
  482. package/src/components/primitives/tiptap-presets.d.ts.map +0 -1
  483. package/src/components/primitives/useEditableCollection.d.ts.map +0 -1
  484. package/src/components/primitives/useEditablePlainText.d.ts.map +0 -1
  485. package/src/components/primitives/useEditableRichText.d.ts.map +0 -1
  486. package/src/components/sections/Button/CTAButton.d.ts.map +0 -1
  487. package/src/components/sections/Button/index.d.ts.map +0 -1
  488. package/src/components/sections/Colors/index.d.ts.map +0 -1
  489. package/src/components/sections/IconList/IconList.d.ts.map +0 -1
  490. package/src/components/sections/IconList/IconListSettings.d.ts.map +0 -1
  491. package/src/components/sections/IconList/index.d.ts.map +0 -1
  492. package/src/components/sections/LinkHeading/index.d.ts.map +0 -1
  493. package/src/components/sections/Prose/Prose.d.ts.map +0 -1
  494. package/src/components/sections/Prose/index.d.ts.map +0 -1
  495. package/src/components/sections/SubHeading/index.d.ts.map +0 -1
  496. package/src/components/sections/SubSubHeading/index.d.ts.map +0 -1
  497. package/src/components/sections/register-schemas.d.ts.map +0 -1
  498. package/src/components/shared/Button.d.ts.map +0 -1
  499. package/src/components/shared/Checkbox.d.ts.map +0 -1
  500. package/src/components/shared/FormLabel.d.ts.map +0 -1
  501. package/src/components/shared/IconButton.d.ts.map +0 -1
  502. package/src/components/shared/Input.d.ts.map +0 -1
  503. package/src/components/shared/Select.d.ts.map +0 -1
  504. package/src/components/shared/icons.d.ts.map +0 -1
  505. package/src/components/shell/BuildStatusIndicator.tsx +0 -59
  506. package/src/components/shell/MediaLibraryContext.d.ts.map +0 -1
  507. package/src/hooks/index.ts +0 -8
  508. package/src/hooks/useResolvedMedia.d.ts.map +0 -1
  509. package/src/lib/cn.d.ts.map +0 -1
  510. package/src/lib/grid.d.ts.map +0 -1
  511. package/src/lib/grid.ts +0 -7
  512. package/src/lib/icons.d.ts.map +0 -1
  513. package/src/lib/loader.d.ts.map +0 -1
  514. package/src/lib/nav.d.ts.map +0 -1
  515. package/src/lib/registry.d.ts.map +0 -1
  516. package/src/lib/sanitize.d.ts.map +0 -1
  517. package/src/media/github.d.ts.map +0 -1
  518. package/src/media/index.d.ts.map +0 -1
  519. package/src/media/queue.d.ts.map +0 -1
  520. package/src/media/resolve.d.ts.map +0 -1
  521. package/src/media/types.d.ts.map +0 -1
  522. package/src/media/utils.d.ts.map +0 -1
  523. package/src/media/videoPoster.d.ts.map +0 -1
  524. package/src/schemas/auth.d.ts.map +0 -1
  525. package/src/schemas/media-grid-options.d.ts.map +0 -1
  526. package/src/schemas/media.d.ts.map +0 -1
  527. package/src/schemas/sections.d.ts.map +0 -1
  528. package/src/schemas/shared.d.ts.map +0 -1
  529. package/src/schemas/site-config.d.ts.map +0 -1
  530. /package/dist/{chunk-B7VBSE5X.js → chunk-3JDTXOIG.js} +0 -0
  531. /package/dist/{chunk-CXZ5YJG4.js → chunk-L45X7DKX.js} +0 -0
  532. /package/src/components/primitives/{gridDrop.ts → grid-drop.ts} +0 -0
  533. /package/src/components/shell/{blockMoveDispatch.ts → block-move-dispatch.ts} +0 -0
  534. /package/src/lib/{safeRedirect.ts → safe-redirect.ts} +0 -0
@@ -1,24 +1,15 @@
1
1
  import {
2
+ EditableRichText,
3
+ defineHeadingSection,
4
+ useSanitizedHtml
5
+ } from "./chunk-JXATNKLV.js";
6
+ import {
7
+ SummaryAnchorsContext,
2
8
  brandGuideSectionDefs,
3
9
  pluralize,
4
10
  stripHtmlToPlainText,
5
11
  truncate
6
- } from "./chunk-KR2MHTNJ.js";
7
- import {
8
- DeleteButton,
9
- DragHandle,
10
- SettingsButton,
11
- SettingsForm,
12
- buildBlockDragData,
13
- buildBlockDropData,
14
- canDropBlock,
15
- isBlockDragData
16
- } from "./chunk-6BZ2KNTP.js";
17
- import {
18
- EditableRichText,
19
- defineHeadingSection,
20
- useSanitizedHtml
21
- } from "./chunk-BDFTMGCL.js";
12
+ } from "./chunk-FHTKSELX.js";
22
13
  import {
23
14
  EditablePlainText,
24
15
  ImageDropZone,
@@ -28,20 +19,46 @@ import {
28
19
  containerGridClass,
29
20
  masonryColumnsClass,
30
21
  spacerHiddenClass
31
- } from "./chunk-DS4GCYV2.js";
22
+ } from "./chunk-YV3YSZEB.js";
32
23
  import {
33
- useMediaLibrary,
34
- useResolvedMedia
35
- } from "./chunk-JH762VUH.js";
24
+ DeleteButton,
25
+ DragHandle,
26
+ SettingsButton,
27
+ SettingsForm,
28
+ buildBlockDragData,
29
+ buildBlockDropData,
30
+ canDropBlock,
31
+ isBlockDragData,
32
+ useOptionalEditorContext
33
+ } from "./chunk-NX7TFHA4.js";
36
34
  import {
37
35
  Kbd,
38
36
  Popover,
39
37
  PopoverItem,
40
38
  Tooltip
41
- } from "./chunk-IINIZBQB.js";
39
+ } from "./chunk-JCDZAFX2.js";
40
+ import {
41
+ Button
42
+ } from "./chunk-GGYY3JQJ.js";
43
+ import {
44
+ Checkbox,
45
+ CheckboxBox,
46
+ Tabs
47
+ } from "./chunk-JR24U7FJ.js";
48
+ import {
49
+ DropEdgeIndicator,
50
+ useMediaLibrary,
51
+ useResolvedMedia
52
+ } from "./chunk-RIITGTV3.js";
42
53
  import {
43
54
  embedUrl
44
55
  } from "./chunk-Y4JQGO6G.js";
56
+ import {
57
+ getMediaProvider
58
+ } from "./chunk-HHNPSKPT.js";
59
+ import {
60
+ referenceItems
61
+ } from "./chunk-WYOFQHKI.js";
45
62
  import {
46
63
  duplicateChildAt,
47
64
  isSpacer,
@@ -49,10 +66,24 @@ import {
49
66
  removeChildAt,
50
67
  setChildColSpan,
51
68
  trimTrailingSpacers
52
- } from "./chunk-CXZ5YJG4.js";
69
+ } from "./chunk-L45X7DKX.js";
53
70
  import {
54
71
  cn
55
72
  } from "./chunk-7EOSDFS3.js";
73
+ import {
74
+ audiencePasses,
75
+ pageDisplayTitle
76
+ } from "./chunk-VY3IFGE3.js";
77
+ import {
78
+ pagesInNavOrder
79
+ } from "./chunk-DJOGPSRU.js";
80
+ import {
81
+ siteTags,
82
+ tagDisplayLabel
83
+ } from "./chunk-4WQ36ZP7.js";
84
+ import {
85
+ REFERENCE_TYPE
86
+ } from "./chunk-5GFACGSN.js";
56
87
  import {
57
88
  getSectionSchema
58
89
  } from "./chunk-DMCGN5AS.js";
@@ -61,8 +92,9 @@ import {
61
92
  getSection
62
93
  } from "./chunk-FTPETWXE.js";
63
94
  import {
95
+ ImageBackgroundSchema,
64
96
  SingleMediaReferenceSchema
65
- } from "./chunk-GGXZZ77Z.js";
97
+ } from "./chunk-AASEGXNT.js";
66
98
  import {
67
99
  DEFAULT_LINK,
68
100
  LinkValueSchema
@@ -181,7 +213,10 @@ var schema2 = z2.object({
181
213
  square: z2.boolean().describe("When true, crop the media to a 1:1 square aspect ratio.").optional(),
182
214
  showCaption: z2.boolean().describe("When true, render the asset's caption beneath it.").optional(),
183
215
  border: z2.boolean().describe("When true, draw a border around the media.").optional(),
184
- objectFit: z2.enum(["cover", "contain"]).describe("How the image fills its box: 'contain' (fit whole image) or 'cover' (fill and crop).").optional()
216
+ objectFit: z2.enum(["cover", "contain"]).describe("How the image fills its box: 'contain' (fit whole image) or 'cover' (fill and crop).").optional(),
217
+ background: ImageBackgroundSchema.describe(
218
+ "Optional backdrop filling the image box, for images that need contrast (e.g. a white transparent logo). 'theme' picks the site's light or dark surface separately for light and dark mode; 'custom' uses one hex for both. Images only \u2014 ignored for video. Omit for none."
219
+ ).optional()
185
220
  }).default({})
186
221
  });
187
222
  var Media_default = defineSection({
@@ -220,11 +255,16 @@ var Media_default = defineSection({
220
255
  { label: "Cover", value: "cover" }
221
256
  ]
222
257
  },
258
+ background: {
259
+ type: "image-background",
260
+ label: "Image background",
261
+ hidden: (values) => values.ref?.type === "video"
262
+ },
223
263
  link: { type: "link", label: "Link", default: DEFAULT_LINK, target: "content" }
224
264
  },
225
265
  inheritableSettings: ["square", "showCaption", "border", "objectFit"],
226
266
  settingsTabs: [
227
- { label: "Display", fields: ["square", "showCaption", "border", "objectFit"] },
267
+ { label: "Display", fields: ["square", "showCaption", "border", "objectFit", "background"] },
228
268
  { label: "Link", fields: ["link"] }
229
269
  ]
230
270
  });
@@ -408,7 +448,7 @@ import { RectangleHorizontal } from "lucide-react";
408
448
  // src/components/sections/Button/CTAButton.tsx
409
449
  import { Download } from "lucide-react";
410
450
  import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
411
- function Button({ text, link, download, onChange }) {
451
+ function Button2({ text, link, download, onChange }) {
412
452
  const base = "inline-block rounded-outer px-6 py-3 font-bold transition-colors";
413
453
  const variant = "border-2 border-primary text-primary hover:bg-primary hover:text-primary-contrast";
414
454
  if (onChange) {
@@ -443,7 +483,7 @@ function Button({ text, link, download, onChange }) {
443
483
  }
444
484
  );
445
485
  }
446
- return /* @__PURE__ */ jsx9("button", { className: cn("cursor-pointer", base, variant), children: text });
486
+ return /* @__PURE__ */ jsx9("span", { className: cn(base, variant), children: text });
447
487
  }
448
488
 
449
489
  // src/components/sections/Button/index.tsx
@@ -465,7 +505,7 @@ var Button_default = defineSection({
465
505
  schema: schema4,
466
506
  authoringNote: "A call-to-action button linking to an internal page or external URL, optionally as a file download. Use for a single prominent action.",
467
507
  component: ({ content, onChange }) => /* @__PURE__ */ jsx10(
468
- Button,
508
+ Button2,
469
509
  {
470
510
  text: content.content.text,
471
511
  link: content.content.link,
@@ -600,22 +640,13 @@ var ChildBlockWrapper = forwardRef(
600
640
  ]
601
641
  }
602
642
  ),
603
- closestEdge === "left" && /* @__PURE__ */ jsx12(
604
- "div",
643
+ /* @__PURE__ */ jsx12(
644
+ DropEdgeIndicator,
605
645
  {
606
- "data-drop-edge": "left",
607
- className: "absolute bottom-0 left-0 top-0 z-10 w-0.5 -translate-x-1 bg-primary"
646
+ edge: closestEdge,
647
+ style: closestEdge === "top" ? { transform: "translateY(-0.25rem)" } : closestEdge === "bottom" ? { transform: "translateY(0.25rem)" } : void 0
608
648
  }
609
649
  ),
610
- closestEdge === "right" && /* @__PURE__ */ jsx12(
611
- "div",
612
- {
613
- "data-drop-edge": "right",
614
- className: "absolute bottom-0 right-0 top-0 z-10 w-0.5 translate-x-1 bg-primary"
615
- }
616
- ),
617
- closestEdge === "top" && /* @__PURE__ */ jsx12("div", { "data-drop-edge": "top", className: "absolute left-0 right-0 top-0 z-10 h-0.5 -translate-y-1 bg-primary" }),
618
- closestEdge === "bottom" && /* @__PURE__ */ jsx12("div", { "data-drop-edge": "bottom", className: "absolute left-0 right-0 bottom-0 z-10 h-0.5 translate-y-1 bg-primary" }),
619
650
  children
620
651
  ]
621
652
  }
@@ -1261,6 +1292,356 @@ var Spacer_default = defineSection({
1261
1292
  defaults: () => ({ type: "spacer", content: {} })
1262
1293
  });
1263
1294
 
1295
+ // src/components/sections/Reference/index.tsx
1296
+ import { z as z7 } from "zod";
1297
+ import { Copy } from "lucide-react";
1298
+
1299
+ // src/components/sections/Reference/ReferenceList.tsx
1300
+ import { useContext, useMemo } from "react";
1301
+ import { ArrowUpRight } from "lucide-react";
1302
+
1303
+ // src/components/shared/ReferenceSourcesContext.ts
1304
+ import { createContext } from "react";
1305
+ var ReferenceSourcesContext = createContext(null);
1306
+
1307
+ // src/components/sections/Reference/ReferenceList.tsx
1308
+ import { jsx as jsx18, jsxs as jsxs7 } from "react/jsx-runtime";
1309
+ var EXCLUSIONS = {
1310
+ missing: {
1311
+ reason: (i) => `Not found \u2014 deleted, unreadable, or not a top-level section (${i.sectionId})`,
1312
+ renders: false,
1313
+ inPreview: () => false
1314
+ },
1315
+ reference: { reason: () => "Another Reference \u2014 never shown", renders: false, inPreview: () => false },
1316
+ "archived-page": { reason: () => "On an archived page", renders: true, inPreview: () => false },
1317
+ "not-live": {
1318
+ reason: (i) => i.source?.meta.status === "archived" ? "Archived section" : "Draft \u2014 publish it to show it here",
1319
+ renders: true,
1320
+ // The Unpublished preview dims drafts and hides archived sections.
1321
+ inPreview: (i, viewBranch) => viewBranch === "saved" && i.source?.meta.status === "draft"
1322
+ }
1323
+ };
1324
+ var shownInPreview = (item, viewBranch) => item.excluded === null || EXCLUSIONS[item.excluded].inPreview(item, viewBranch);
1325
+ var NO_SUMMARY_ANCHORS = {};
1326
+ function ReferenceList({ referenceId, content, isEditMode }) {
1327
+ const sources = useContext(ReferenceSourcesContext);
1328
+ const editor = useOptionalEditorContext();
1329
+ const viewBranch = editor?.viewBranch ?? "saved";
1330
+ const previewAudience = editor?.previewAudience ?? null;
1331
+ const model = useMemo(() => {
1332
+ if (!sources) return null;
1333
+ const { index, sections, audiences } = sources;
1334
+ const page = index.pages.find((p) => p.order.includes(referenceId));
1335
+ const access = index.sections[referenceId]?.access ?? [];
1336
+ const viewers = audiences.filter((a) => audiencePasses(page?.access ?? [], a.name) && audiencePasses(access, a.name));
1337
+ const items = referenceItems({
1338
+ referenceId,
1339
+ content,
1340
+ index,
1341
+ allSections: sections,
1342
+ audiences: viewers.map((a) => a.name)
1343
+ });
1344
+ return {
1345
+ items,
1346
+ // Copies carry the page-wide anchors the editor nav links to, so no
1347
+ // heading here duplicates its source's DOM id or another Reference's.
1348
+ copyById: sources.copies[referenceId] ?? {},
1349
+ displayName: new Map(viewers.map((a) => [a.name, a.displayName])),
1350
+ viewerCount: viewers.length,
1351
+ // The site has audiences, yet none passes both the page's access and the
1352
+ // Reference's own: no one can ever see a copy here. (Empty access is
1353
+ // "everyone", so an unrestricted page or Reference never lands here.)
1354
+ noViewers: audiences.length > 0 && viewers.length === 0,
1355
+ // Absent `tags` is "not loaded": tagged sections can't be listed yet.
1356
+ tagsUnloaded: index.tags === void 0 && content.tagIds.length > 0
1357
+ };
1358
+ }, [sources, referenceId, content]);
1359
+ if (!sources || !model) {
1360
+ return isEditMode ? /* @__PURE__ */ jsx18(Placeholder, { children: "Reference: shown as live copies on the published site." }) : null;
1361
+ }
1362
+ const shown = isEditMode ? model.items : model.items.filter((item) => shownInPreview(item, viewBranch));
1363
+ const notes = [
1364
+ model.tagsUnloaded && "Tags haven't loaded, so tagged sections aren't listed yet.",
1365
+ model.noViewers && "No audience can see this Reference on this page"
1366
+ ].filter((n) => !!n);
1367
+ if (shown.length === 0) {
1368
+ if (!isEditMode) return null;
1369
+ if (notes.length === 0) return /* @__PURE__ */ jsx18(Placeholder, { children: "Reference: no tags or sections chosen yet." });
1370
+ return /* @__PURE__ */ jsx18(Placeholder, { children: ["Reference: nothing to show.", ...notes].join(" ") });
1371
+ }
1372
+ return (
1373
+ // The page's summary anchors are keyed by section id, so a copy of a
1374
+ // summary also on this page would take its native anchor; emptying the
1375
+ // context leaves every copy on the anchor stamped for it.
1376
+ /* @__PURE__ */ jsx18(SummaryAnchorsContext.Provider, { value: NO_SUMMARY_ANCHORS, children: shown.map((item, n) => {
1377
+ const { source } = item;
1378
+ const exclusion = item.excluded ? EXCLUSIONS[item.excluded] : null;
1379
+ const drawn = source && (!exclusion || exclusion.renders) ? source : null;
1380
+ const definition = source ? getSection(source.section.type) : void 0;
1381
+ const copy = drawn ? model.copyById[item.sectionId] ?? drawn.section : null;
1382
+ const Component = definition?.component;
1383
+ const reason = exclusion?.reason(item) ?? null;
1384
+ const hiddenForAll = model.noViewers || model.viewerCount > 0 && item.hiddenFrom.length === model.viewerCount;
1385
+ const previewHidden = previewAudience !== null && !!source && (!audiencePasses(item.page?.access ?? [], previewAudience) || !audiencePasses(source.meta.access, previewAudience));
1386
+ const typeLabel = definition?.label ?? source?.section.type ?? "Section";
1387
+ const label = source && definition?.getLabel?.(source.section) || typeLabel;
1388
+ return /* @__PURE__ */ jsx18("div", { className: cn(n > 0 && "pt-9"), children: /* @__PURE__ */ jsxs7(
1389
+ "div",
1390
+ {
1391
+ "data-reference-item": item.sectionId,
1392
+ className: cn(
1393
+ // `group` mirrors the viewer's per-section wrapper for the copy's
1394
+ // own hover styles; `group/copy` scopes Edit source to this copy,
1395
+ // since the Reference's wrapper is a `group` too.
1396
+ "group group/copy relative",
1397
+ isEditMode && "rounded-outer hover:outline hover:outline-1 hover:outline-dashed hover:outline-primary/40",
1398
+ previewHidden ? "opacity-15 transition-opacity duration-200 hover:opacity-100" : (isEditMode ? reason || hiddenForAll : item.excluded) && "opacity-50"
1399
+ ),
1400
+ children: [
1401
+ /* @__PURE__ */ jsxs7("div", { inert: isEditMode, children: [
1402
+ !copy && /* @__PURE__ */ jsx18("div", { className: "min-h-20 rounded-md border-2 border-dashed" }),
1403
+ copy && Component && /* @__PURE__ */ jsx18(
1404
+ Component,
1405
+ {
1406
+ content: copy,
1407
+ options: "options" in copy ? copy.options : void 0,
1408
+ isEditMode: false
1409
+ }
1410
+ )
1411
+ ] }),
1412
+ isEditMode && /* @__PURE__ */ jsxs7("div", { className: "absolute right-2 top-2 z-20 flex max-w-[calc(100%-1rem)] flex-wrap items-center justify-end gap-1", children: [
1413
+ n === 0 && notes.map((note) => /* @__PURE__ */ jsx18(Badge, { children: note }, note)),
1414
+ reason && /* @__PURE__ */ jsx18(Badge, { children: reason }),
1415
+ !reason && hiddenForAll && !model.noViewers && /* @__PURE__ */ jsx18(Badge, { children: "Hidden for all of this page's audiences" }),
1416
+ !reason && !hiddenForAll && item.hiddenFrom.length > 0 && /* @__PURE__ */ jsx18(Badge, { children: `Hidden from ${item.hiddenFrom.map((a) => model.displayName.get(a) ?? a).join(", ")}` }),
1417
+ source && /* @__PURE__ */ jsxs7("span", { className: "flex items-center gap-2 rounded-full border border-base-200 bg-base px-2 py-0.5 text-xs opacity-0 shadow-sm transition-opacity focus-within:opacity-100 group-hover/copy:opacity-100", children: [
1418
+ /* @__PURE__ */ jsxs7("span", { className: "max-w-56 truncate text-base-contrast-light", children: [
1419
+ item.page ? `${pageDisplayTitle(item.page.title)} \xB7 ` : "",
1420
+ label
1421
+ ] }),
1422
+ /* @__PURE__ */ jsxs7(Button, { variant: "ghost", className: "inline-flex items-center gap-0.5", onClick: () => sources.jumpToSection(item.sectionId), children: [
1423
+ "Edit source ",
1424
+ /* @__PURE__ */ jsx18(ArrowUpRight, { size: 12, "aria-hidden": "true" })
1425
+ ] })
1426
+ ] })
1427
+ ] })
1428
+ ]
1429
+ }
1430
+ ) }, item.sectionId);
1431
+ }) })
1432
+ );
1433
+ }
1434
+ function Badge({ children }) {
1435
+ return /* @__PURE__ */ jsx18("span", { className: "rounded-full border border-warning bg-warning-bg px-2 py-0.5 text-xs text-warning shadow-sm", children });
1436
+ }
1437
+ function Placeholder({ children }) {
1438
+ return /* @__PURE__ */ jsx18("div", { className: "flex min-h-20 items-center justify-center rounded-md border-2 border-dashed px-4 text-center text-xs text-base-contrast-light/50", children });
1439
+ }
1440
+
1441
+ // src/components/sections/Reference/ReferenceSettings.tsx
1442
+ import { useContext as useContext2, useState as useState4 } from "react";
1443
+
1444
+ // src/lib/thumb-views.ts
1445
+ function resolveThumbnailSrc(thumb, manifest) {
1446
+ const item = manifest.images[thumb.src];
1447
+ if (!item) return null;
1448
+ const resolved = getMediaProvider().resolve(item, [200]);
1449
+ if (!resolved) return null;
1450
+ return resolved.tag === "img" || resolved.tag === "video" ? resolved.src : null;
1451
+ }
1452
+ function toThumbViews(thumbnails, manifest) {
1453
+ return thumbnails.map(
1454
+ (thumb) => thumb.type === "color" ? { kind: "color", value: thumb.value } : { kind: "image", src: resolveThumbnailSrc(thumb, manifest), alt: thumb.alt ?? "" }
1455
+ );
1456
+ }
1457
+
1458
+ // src/components/shared/SectionSummaryRow.tsx
1459
+ import { jsx as jsx19, jsxs as jsxs8 } from "react/jsx-runtime";
1460
+ var MAX_THUMBS = 3;
1461
+ function SectionSummaryRow({ label, typeLabel, thumbnails, muted, trailing, className }) {
1462
+ const shown = thumbnails.slice(0, MAX_THUMBS);
1463
+ const remaining = Math.max(0, thumbnails.length - MAX_THUMBS);
1464
+ return /* @__PURE__ */ jsxs8("div", { className: cn(
1465
+ "flex min-w-0 flex-1 items-center gap-3 rounded-md border border-base-200 bg-base px-3 py-2",
1466
+ muted && "opacity-50",
1467
+ className
1468
+ ), children: [
1469
+ /* @__PURE__ */ jsxs8("div", { className: "min-w-0 flex-1", children: [
1470
+ /* @__PURE__ */ jsx19("div", { className: "text-xs text-base-contrast-light", children: typeLabel }),
1471
+ /* @__PURE__ */ jsx19("div", { className: "truncate text-sm font-medium text-base-contrast", children: label })
1472
+ ] }),
1473
+ trailing,
1474
+ shown.length > 0 && /* @__PURE__ */ jsxs8("div", { className: "flex items-center -space-x-2", children: [
1475
+ shown.map(
1476
+ (thumb, i) => thumb.kind === "color" ? /* @__PURE__ */ jsx19(
1477
+ "div",
1478
+ {
1479
+ className: "h-8 w-8 rounded border-2 border-base",
1480
+ style: { backgroundColor: thumb.value }
1481
+ },
1482
+ i
1483
+ ) : thumb.src ? /* @__PURE__ */ jsx19(
1484
+ "img",
1485
+ {
1486
+ src: thumb.src,
1487
+ alt: thumb.alt,
1488
+ className: "h-8 w-8 rounded border-2 border-base object-cover"
1489
+ },
1490
+ i
1491
+ ) : /* @__PURE__ */ jsx19("div", { className: "h-8 w-8 rounded border-2 border-base bg-base-accent" }, i)
1492
+ ),
1493
+ remaining > 0 && /* @__PURE__ */ jsxs8("div", { className: "ml-1 flex h-8 w-8 items-center justify-center rounded border-2 border-base bg-base-accent text-xs text-base-contrast-light", children: [
1494
+ "+",
1495
+ remaining
1496
+ ] })
1497
+ ] })
1498
+ ] });
1499
+ }
1500
+
1501
+ // src/components/sections/Reference/ReferenceSettings.tsx
1502
+ import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
1503
+ var panel = "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-px";
1504
+ function ReferenceSettings({
1505
+ tagIds = [],
1506
+ sectionIds = [],
1507
+ onChange
1508
+ }) {
1509
+ const sources = useContext2(ReferenceSourcesContext);
1510
+ const [v, setV] = useState4({ tagIds, sectionIds });
1511
+ const update = (next) => {
1512
+ setV(next);
1513
+ onChange({ content: next });
1514
+ };
1515
+ const toggle = (list, id, on) => on ? [...list, id] : list.filter((x) => x !== id);
1516
+ if (!sources) return null;
1517
+ const { index, sections, mediaManifest } = sources;
1518
+ const tagsLoaded = index.tags !== void 0;
1519
+ const tags = siteTags(index);
1520
+ const deletedTagIds = tagsLoaded ? v.tagIds.filter((id) => !tags.some((t) => t.id === id)) : [];
1521
+ const byId = new Map(sections.map((s) => [s.section.id, s]));
1522
+ const pageGroups = pagesInNavOrder(index).map((page) => ({
1523
+ page,
1524
+ rows: page.order.flatMap((id) => {
1525
+ const s = byId.get(id);
1526
+ return s && (s.section.type !== REFERENCE_TYPE || v.sectionIds.includes(id)) ? [s] : [];
1527
+ })
1528
+ })).filter((g) => g.rows.length > 0);
1529
+ const onAPage = new Set(pageGroups.flatMap((g) => g.rows.map((s) => s.section.id)));
1530
+ const deletedSectionIds = v.sectionIds.filter((id) => !onAPage.has(id));
1531
+ const tagsTab = /* @__PURE__ */ jsxs9("div", { className: panel, children: [
1532
+ !tagsLoaded && /* @__PURE__ */ jsx20("p", { className: "text-sm text-base-contrast-light", children: "Tags haven't loaded, so they can't be changed right now." }),
1533
+ tagsLoaded && tags.length === 0 && deletedTagIds.length === 0 && /* @__PURE__ */ jsx20("p", { className: "text-sm text-base-contrast-light", children: "No tags yet. Add them from a section's Tags pill or under Site settings \u2192 Tags." }),
1534
+ tags.map((t) => /* @__PURE__ */ jsx20(
1535
+ Checkbox,
1536
+ {
1537
+ label: tagDisplayLabel(t.label),
1538
+ description: pluralize(t.sectionIds.length, "section"),
1539
+ checked: v.tagIds.includes(t.id),
1540
+ onChange: (on) => update({ ...v, tagIds: toggle(v.tagIds, t.id, on) })
1541
+ },
1542
+ t.id
1543
+ )),
1544
+ deletedTagIds.map((id) => /* @__PURE__ */ jsx20(
1545
+ Checkbox,
1546
+ {
1547
+ label: "Deleted tag",
1548
+ description: "Shows nothing. Untick to remove it.",
1549
+ checked: true,
1550
+ onChange: () => update({ ...v, tagIds: toggle(v.tagIds, id, false) })
1551
+ },
1552
+ id
1553
+ ))
1554
+ ] });
1555
+ const sectionRow = (id, label, typeLabel, thumbs, status) => {
1556
+ const checked = v.sectionIds.includes(id);
1557
+ return /* @__PURE__ */ jsx20(
1558
+ "button",
1559
+ {
1560
+ type: "button",
1561
+ role: "checkbox",
1562
+ "aria-checked": checked,
1563
+ "aria-label": `${typeLabel}: ${label}`,
1564
+ onClick: () => update({ ...v, sectionIds: toggle(v.sectionIds, id, !checked) }),
1565
+ className: "flex w-full cursor-pointer text-left",
1566
+ children: /* @__PURE__ */ jsx20(
1567
+ SectionSummaryRow,
1568
+ {
1569
+ label,
1570
+ typeLabel,
1571
+ thumbnails: thumbs,
1572
+ className: cn(checked && "border-primary"),
1573
+ trailing: /* @__PURE__ */ jsxs9(Fragment3, { children: [
1574
+ status && status !== "live" && /* @__PURE__ */ jsx20("span", { className: "text-xs capitalize text-base-contrast-light", children: status }),
1575
+ /* @__PURE__ */ jsx20(CheckboxBox, { checked })
1576
+ ] })
1577
+ }
1578
+ )
1579
+ },
1580
+ id
1581
+ );
1582
+ };
1583
+ const sectionsTab = /* @__PURE__ */ jsxs9("div", { className: panel, children: [
1584
+ pageGroups.map(({ page, rows }) => /* @__PURE__ */ jsxs9("section", { className: "flex flex-col gap-2", children: [
1585
+ /* @__PURE__ */ jsxs9("h3", { className: "text-xs font-medium uppercase tracking-wide text-base-contrast-light", children: [
1586
+ pageDisplayTitle(page.title),
1587
+ page.status === "archived" && " (archived)"
1588
+ ] }),
1589
+ rows.map((s) => {
1590
+ const def = getSection(s.section.type);
1591
+ const typeLabel = def?.label ?? s.section.type;
1592
+ return sectionRow(
1593
+ s.section.id,
1594
+ def?.getLabel?.(s.section) ?? typeLabel,
1595
+ typeLabel,
1596
+ toThumbViews(def?.getThumbnails?.(s.section) ?? [], mediaManifest),
1597
+ s.meta.status
1598
+ );
1599
+ })
1600
+ ] }, page.id)),
1601
+ deletedSectionIds.length > 0 && /* @__PURE__ */ jsxs9("section", { className: "flex flex-col gap-2", children: [
1602
+ /* @__PURE__ */ jsx20("h3", { className: "text-xs font-medium uppercase tracking-wide text-base-contrast-light", children: "Not found" }),
1603
+ deletedSectionIds.map((id) => sectionRow(id, "Section not found", "Deleted or can't be read", []))
1604
+ ] })
1605
+ ] });
1606
+ return /* @__PURE__ */ jsx20(
1607
+ Tabs,
1608
+ {
1609
+ fullBleedTabBar: true,
1610
+ tabs: [
1611
+ { id: "tags", label: `Tags${v.tagIds.length ? ` (${v.tagIds.length})` : ""}`, content: tagsTab },
1612
+ { id: "sections", label: `Sections${v.sectionIds.length ? ` (${v.sectionIds.length})` : ""}`, content: sectionsTab }
1613
+ ]
1614
+ }
1615
+ );
1616
+ }
1617
+
1618
+ // src/components/sections/Reference/index.tsx
1619
+ import { jsx as jsx21 } from "react/jsx-runtime";
1620
+ var schema7 = z7.object({
1621
+ type: z7.literal(REFERENCE_TYPE),
1622
+ content: z7.object({
1623
+ tagIds: z7.array(z7.string()).default([]).describe("Ids of tags from the site's tag registry (tags.json); every section carrying one of them is shown."),
1624
+ sectionIds: z7.array(z7.string()).default([]).describe("Ids of individually picked sections to show, from any page. Combined with the tagged sections as a union.")
1625
+ })
1626
+ });
1627
+ var Reference_default = defineSection({
1628
+ type: REFERENCE_TYPE,
1629
+ label: "Reference",
1630
+ icon: /* @__PURE__ */ jsx21(Copy, { size: 18 }),
1631
+ schema: schema7,
1632
+ authoringNote: "Shows read-only, live copies of other sections: every section carrying one of tagIds, plus every id in sectionIds (overlaps listed once). Resolved at render time from the published site, so edits to a source show up wherever it is referenced \u2014 never copy content to reuse it. Items are listed in site order (pages in nav order, then position on the page), whatever order the ids are stored in. Only live sections on live pages appear (hidden pages count, archived pages do not); a viewer sees an item only if they could see it on its own page, so a Reference never widens who sees what. References in the source set are skipped, itself included; containers come whole. Headings inside the copies join this page's nav, anchored <heading>-<this Reference's id>. Unknown ids and deleted tags drop silently on the viewer, but the MCP connector rejects them on save \u2014 create a tag (save_sections `tags`) before naming it. Top level only \u2014 not inside a container.",
1633
+ // Viewer paths never render this component: buildViewerPage replaces a
1634
+ // Reference with the sections it resolves to. The editor canvas renders the
1635
+ // same copies here, in edit mode and preview alike.
1636
+ component: ({ content, isEditMode }) => {
1637
+ const id = content.id ?? "";
1638
+ return /* @__PURE__ */ jsx21(ReferenceList, { referenceId: id, content: content.content, isEditMode });
1639
+ },
1640
+ settingsForm: ReferenceSettings,
1641
+ defaults: () => ({ type: REFERENCE_TYPE, content: { tagIds: [], sectionIds: [] } }),
1642
+ getLabel: () => "Reference"
1643
+ });
1644
+
1264
1645
  // src/components/sections/core-sections.ts
1265
1646
  var coreSectionDefs = [
1266
1647
  LinkHeading_default,
@@ -1271,7 +1652,8 @@ var coreSectionDefs = [
1271
1652
  Video_default,
1272
1653
  Button_default,
1273
1654
  Container_default,
1274
- Spacer_default
1655
+ Spacer_default,
1656
+ Reference_default
1275
1657
  ];
1276
1658
 
1277
1659
  // src/components/sections/all-sections.ts
@@ -772,7 +772,6 @@ export {
772
772
  DeckImage,
773
773
  DeckImageGrid,
774
774
  DeckTextEditProvider,
775
- useDeckTextEditor,
776
775
  EditableText,
777
776
  DeckRichText,
778
777
  DeckVideo,
@@ -15,7 +15,7 @@ var NothingToPublishError = class extends Error {
15
15
  };
16
16
  var IdempotencyLookupUnavailableError = class extends Error {
17
17
  constructor(cause) {
18
- super("Could not search draft history for the idempotency key");
18
+ super("Couldn't search draft history for the idempotency key");
19
19
  this.cause = cause;
20
20
  this.name = "IdempotencyLookupUnavailableError";
21
21
  }
@@ -0,0 +1,70 @@
1
+ import {
2
+ navEntries
3
+ } from "./chunk-DJOGPSRU.js";
4
+ import {
5
+ RESERVED_SLUGS
6
+ } from "./chunk-67P34WNW.js";
7
+
8
+ // src/lib/pages.ts
9
+ function pageDisplayTitle(title) {
10
+ return title || "Untitled";
11
+ }
12
+ function uniquePageSlug(base, existing) {
13
+ const taken = new Set(existing);
14
+ const reserved = new Set(RESERVED_SLUGS);
15
+ let candidate = base || "page";
16
+ if (!taken.has(candidate) && !reserved.has(candidate)) return candidate;
17
+ let n = 2;
18
+ while (taken.has(`${candidate}-${n}`) || reserved.has(`${candidate}-${n}`)) n++;
19
+ return `${candidate}-${n}`;
20
+ }
21
+ function pageById(index, id) {
22
+ return index.pages.find((p) => p.id === id);
23
+ }
24
+ function audiencePasses(access, audience) {
25
+ if (access.length === 0) return true;
26
+ if (!audience) return true;
27
+ return access.includes(audience);
28
+ }
29
+ function addPage(index, id) {
30
+ const slug = uniquePageSlug("new-page", index.pages.map((p) => p.slug));
31
+ const page = {
32
+ id,
33
+ title: "",
34
+ slug,
35
+ isHome: false,
36
+ showInNav: true,
37
+ status: "live",
38
+ access: [],
39
+ order: []
40
+ };
41
+ return {
42
+ ...index,
43
+ pages: [...index.pages, page],
44
+ nav: [...navEntries(index), { kind: "page", pageId: id }]
45
+ };
46
+ }
47
+ function deletePage(index, pageId) {
48
+ const page = pageById(index, pageId);
49
+ if (!page || page.isHome) return { index, removedSectionIds: [] };
50
+ const removedSectionIds = [...page.order];
51
+ const nextSections = { ...index.sections };
52
+ for (const id of removedSectionIds) delete nextSections[id];
53
+ return {
54
+ index: {
55
+ ...index,
56
+ pages: index.pages.filter((p) => p.id !== pageId),
57
+ sections: nextSections,
58
+ nav: navEntries(index).filter((e) => !(e.kind === "page" && e.pageId === pageId)).map((e) => e.kind === "group" ? { ...e, pageIds: e.pageIds.filter((id) => id !== pageId) } : e)
59
+ },
60
+ removedSectionIds
61
+ };
62
+ }
63
+
64
+ export {
65
+ pageDisplayTitle,
66
+ uniquePageSlug,
67
+ audiencePasses,
68
+ addPage,
69
+ deletePage
70
+ };