@drawnagency/primitives 0.1.113 → 0.1.114

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 (483) 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-GPPVYLEI.js → chunk-45FA7Z55.js} +1 -1
  6. package/dist/{chunk-REDDTTGJ.js → chunk-4Y2JQQZL.js} +19 -1
  7. package/dist/chunk-5GFACGSN.js +6 -0
  8. package/dist/chunk-5KSAS4VY.js +275 -0
  9. package/dist/{chunk-Z7W3DQTR.js → chunk-7SAAJVDE.js} +408 -28
  10. package/dist/{chunk-S2L3BPLS.js → chunk-7SX42OP4.js} +1 -1
  11. package/dist/{chunk-GGXZZ77Z.js → chunk-AASEGXNT.js} +18 -1
  12. package/dist/{chunk-WKZ7OENC.js → chunk-BQ5TZZUE.js} +5 -1
  13. package/dist/chunk-DIMDRBFK.js +11 -0
  14. package/dist/{chunk-WUJ3XNFI.js → chunk-GGYY3JQJ.js} +19 -24
  15. package/dist/{chunk-NHN2LSIU.js → chunk-IP2SEBAJ.js} +5 -1
  16. package/dist/{chunk-IINIZBQB.js → chunk-JCDZAFX2.js} +30 -10
  17. package/dist/chunk-JR24U7FJ.js +120 -0
  18. package/dist/{chunk-SW6PCQQD.js → chunk-KQA772WQ.js} +2 -1
  19. package/dist/{chunk-KR2MHTNJ.js → chunk-N3G7DOU3.js} +609 -61
  20. package/dist/chunk-OAGJBCSH.js +67 -0
  21. package/dist/{chunk-6BZ2KNTP.js → chunk-PLANHXS7.js} +191 -61
  22. package/dist/{chunk-VWWY5TL5.js → chunk-PNSCDBU7.js} +38 -56
  23. package/dist/{chunk-AHALSCQH.js → chunk-PTY2RG2K.js} +1 -1
  24. package/dist/{chunk-BDFTMGCL.js → chunk-PZPGJZRG.js} +9 -8
  25. package/dist/{chunk-FRE2CCLV.js → chunk-QHMKIODQ.js} +17 -4
  26. package/dist/{chunk-HBULBDGP.js → chunk-S37DZPHW.js} +1 -1
  27. package/dist/{chunk-4I5OO5UB.js → chunk-TEOAKGZA.js} +0 -1
  28. package/dist/chunk-VUYCRBJK.js +174 -0
  29. package/dist/{chunk-4RNF2DRG.js → chunk-XDEPXTBY.js} +0 -2
  30. package/dist/{chunk-DS4GCYV2.js → chunk-Y5QECJX7.js} +223 -16
  31. package/dist/collab/rebase.d.ts +2 -1
  32. package/dist/collab/rebase.d.ts.map +1 -1
  33. package/dist/collab/rebase.js +20 -5
  34. package/dist/components/brandguide/ColorsEditable.d.ts.map +1 -1
  35. package/dist/components/chat/ChatPanel.d.ts.map +1 -1
  36. package/dist/components/chat/ChatWidget.d.ts.map +1 -1
  37. package/dist/components/docfile/DocFilePane.d.ts.map +1 -1
  38. package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -1
  39. package/dist/components/editor/ConflictDialog.d.ts.map +1 -1
  40. package/dist/components/editor/DragHandle.d.ts +12 -2
  41. package/dist/components/editor/DragHandle.d.ts.map +1 -1
  42. package/dist/components/editor/DropEdgeIndicator.d.ts +15 -6
  43. package/dist/components/editor/DropEdgeIndicator.d.ts.map +1 -1
  44. package/dist/components/editor/NavGroupRow.d.ts +4 -1
  45. package/dist/components/editor/NavGroupRow.d.ts.map +1 -1
  46. package/dist/components/editor/PagesModal.d.ts.map +1 -1
  47. package/dist/components/editor/SectionWrapper.d.ts +1 -1
  48. package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
  49. package/dist/components/editor/SettingsForm.d.ts.map +1 -1
  50. package/dist/components/editor/TagIndicator.d.ts +15 -0
  51. package/dist/components/editor/TagIndicator.d.ts.map +1 -0
  52. package/dist/components/editor/index.js +148 -77
  53. package/dist/components/primitives/DocumentDropZone.d.ts +1 -1
  54. package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
  55. package/dist/components/primitives/EditableList.d.ts.map +1 -1
  56. package/dist/components/primitives/HeadingSection.d.ts +4 -1
  57. package/dist/components/primitives/HeadingSection.d.ts.map +1 -1
  58. package/dist/components/primitives/ResolvedMedia.d.ts +5 -1
  59. package/dist/components/primitives/ResolvedMedia.d.ts.map +1 -1
  60. package/dist/components/primitives/{defineHeadingSection.d.ts → define-heading-section.d.ts} +1 -1
  61. package/dist/components/primitives/define-heading-section.d.ts.map +1 -0
  62. package/dist/components/primitives/{gridDrop.d.ts → grid-drop.d.ts} +1 -1
  63. package/dist/components/primitives/grid-drop.d.ts.map +1 -0
  64. package/dist/components/primitives/index.d.ts +1 -1
  65. package/dist/components/primitives/index.d.ts.map +1 -1
  66. package/dist/components/primitives/index.js +17 -154
  67. package/dist/components/sections/Button/CTAButton.d.ts.map +1 -1
  68. package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts +2 -6
  69. package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts.map +1 -1
  70. package/dist/components/sections/DoDontMedia/index.d.ts +8 -0
  71. package/dist/components/sections/DoDontMedia/index.d.ts.map +1 -1
  72. package/dist/components/sections/IconList/IconList.d.ts +2 -1
  73. package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
  74. package/dist/components/sections/IconList/IconListSettings.d.ts +2 -1
  75. package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -1
  76. package/dist/components/sections/IconList/index.d.ts +1 -0
  77. package/dist/components/sections/IconList/index.d.ts.map +1 -1
  78. package/dist/components/sections/Media/MediaBlock.d.ts +2 -1
  79. package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -1
  80. package/dist/components/sections/Media/index.d.ts +8 -0
  81. package/dist/components/sections/Media/index.d.ts.map +1 -1
  82. package/dist/components/sections/Reference/ReferenceList.d.ts +35 -0
  83. package/dist/components/sections/Reference/ReferenceList.d.ts.map +1 -0
  84. package/dist/components/sections/Reference/ReferenceSettings.d.ts +12 -0
  85. package/dist/components/sections/Reference/ReferenceSettings.d.ts.map +1 -0
  86. package/dist/components/sections/Reference/index.d.ts +9 -0
  87. package/dist/components/sections/Reference/index.d.ts.map +1 -0
  88. package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts +38 -0
  89. package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts.map +1 -0
  90. package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts +20 -0
  91. package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts.map +1 -0
  92. package/dist/components/sections/SectionSummary/index.d.ts +33 -0
  93. package/dist/components/sections/SectionSummary/index.d.ts.map +1 -0
  94. package/dist/components/sections/all-sections.d.ts +53 -0
  95. package/dist/components/sections/all-sections.d.ts.map +1 -1
  96. package/dist/components/sections/brand-guide.d.ts +41 -2
  97. package/dist/components/sections/brand-guide.d.ts.map +1 -1
  98. package/dist/components/sections/brand-guide.js +12 -10
  99. package/dist/components/sections/core-sections.d.ts +14 -0
  100. package/dist/components/sections/core-sections.d.ts.map +1 -1
  101. package/dist/components/sections/register-schemas.js +19 -17
  102. package/dist/components/sections/register.js +19 -17
  103. package/dist/components/shared/BrandSwatchesContext.d.ts +9 -0
  104. package/dist/components/shared/BrandSwatchesContext.d.ts.map +1 -0
  105. package/dist/components/shared/Button.d.ts +11 -3
  106. package/dist/components/shared/Button.d.ts.map +1 -1
  107. package/dist/components/shared/Checkbox.d.ts +6 -0
  108. package/dist/components/shared/Checkbox.d.ts.map +1 -1
  109. package/dist/components/shared/ConfirmDialog.d.ts +25 -0
  110. package/dist/components/shared/ConfirmDialog.d.ts.map +1 -0
  111. package/dist/components/shared/ConfirmInline.d.ts +25 -0
  112. package/dist/components/shared/ConfirmInline.d.ts.map +1 -0
  113. package/dist/components/shared/ErrorBoundary.d.ts.map +1 -1
  114. package/dist/components/shared/Fab.d.ts +11 -2
  115. package/dist/components/shared/Fab.d.ts.map +1 -1
  116. package/dist/components/shared/FabStack.d.ts +22 -0
  117. package/dist/components/shared/FabStack.d.ts.map +1 -0
  118. package/dist/components/shared/HistoryChangesModal.d.ts.map +1 -1
  119. package/dist/components/shared/HistoryPopover.d.ts.map +1 -1
  120. package/dist/components/shared/ImageBackgroundField.d.ts +9 -0
  121. package/dist/components/shared/ImageBackgroundField.d.ts.map +1 -0
  122. package/dist/components/shared/{UploadRejectionAlert.d.ts → InlineAlert.d.ts} +4 -2
  123. package/dist/components/shared/InlineAlert.d.ts.map +1 -0
  124. package/dist/components/shared/Input.d.ts +10 -0
  125. package/dist/components/shared/Input.d.ts.map +1 -1
  126. package/dist/components/shared/Navigation.d.ts.map +1 -1
  127. package/dist/components/shared/Notice.d.ts +10 -0
  128. package/dist/components/shared/Notice.d.ts.map +1 -0
  129. package/dist/components/shared/Popover.d.ts.map +1 -1
  130. package/dist/components/shared/ReferenceSourcesContext.d.ts +25 -0
  131. package/dist/components/shared/ReferenceSourcesContext.d.ts.map +1 -0
  132. package/dist/components/shared/Select.d.ts +3 -2
  133. package/dist/components/shared/Select.d.ts.map +1 -1
  134. package/dist/components/shared/SplitButton.d.ts.map +1 -1
  135. package/dist/components/shared/SummaryAnchorsContext.d.ts +10 -0
  136. package/dist/components/shared/SummaryAnchorsContext.d.ts.map +1 -0
  137. package/dist/components/shared/Textarea.d.ts +7 -0
  138. package/dist/components/shared/Textarea.d.ts.map +1 -1
  139. package/dist/components/shared/ToolbarFrame.d.ts +17 -0
  140. package/dist/components/shared/ToolbarFrame.d.ts.map +1 -0
  141. package/dist/components/shared/copy.d.ts +13 -0
  142. package/dist/components/shared/copy.d.ts.map +1 -0
  143. package/dist/components/shared/icons.d.ts +0 -12
  144. package/dist/components/shared/icons.d.ts.map +1 -1
  145. package/dist/components/shell/AudienceDetailsPanel.d.ts +7 -1
  146. package/dist/components/shell/AudienceDetailsPanel.d.ts.map +1 -1
  147. package/dist/components/shell/AudienceRow.d.ts.map +1 -1
  148. package/dist/components/shell/BugReportFAB.d.ts +7 -1
  149. package/dist/components/shell/BugReportFAB.d.ts.map +1 -1
  150. package/dist/components/shell/CredentialList.d.ts.map +1 -1
  151. package/dist/components/shell/DocInspector.d.ts.map +1 -1
  152. package/dist/components/shell/DocumentEditorOverlay.d.ts.map +1 -1
  153. package/dist/components/shell/EditorContext.d.ts +4 -0
  154. package/dist/components/shell/EditorContext.d.ts.map +1 -1
  155. package/dist/components/shell/EditorLoginForm.d.ts.map +1 -1
  156. package/dist/components/shell/EditorModal.d.ts.map +1 -1
  157. package/dist/components/shell/EditorShell.d.ts.map +1 -1
  158. package/dist/components/shell/HistoryToolbar.d.ts.map +1 -1
  159. package/dist/components/shell/MediaFolderTile.d.ts +4 -1
  160. package/dist/components/shell/MediaFolderTile.d.ts.map +1 -1
  161. package/dist/components/shell/MediaLibraryModal.d.ts.map +1 -1
  162. package/dist/components/shell/RestoreModal.d.ts.map +1 -1
  163. package/dist/components/shell/SiteSettingsChatbot.d.ts.map +1 -1
  164. package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
  165. package/dist/components/shell/SiteSettingsModal.d.ts +3 -1
  166. package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
  167. package/dist/components/shell/SiteSettingsTags.d.ts +13 -0
  168. package/dist/components/shell/SiteSettingsTags.d.ts.map +1 -0
  169. package/dist/components/shell/SiteSettingsUsers.d.ts.map +1 -1
  170. package/dist/components/shell/ViewerLoginForm.d.ts.map +1 -1
  171. package/dist/components/shell/{blockMoveDispatch.d.ts → block-move-dispatch.d.ts} +1 -1
  172. package/dist/components/shell/block-move-dispatch.d.ts.map +1 -0
  173. package/dist/components/shell/reference-sources.d.ts +22 -0
  174. package/dist/components/shell/reference-sources.d.ts.map +1 -0
  175. package/dist/deck/index.d.ts +2 -2
  176. package/dist/deck/index.d.ts.map +1 -1
  177. package/dist/deck/index.js +1 -3
  178. package/dist/deck-builder/index.js +11 -18
  179. package/dist/document/index.d.ts +2 -2
  180. package/dist/document/index.d.ts.map +1 -1
  181. package/dist/hooks/useBlockDnd.d.ts +11 -0
  182. package/dist/hooks/useBlockDnd.d.ts.map +1 -1
  183. package/dist/hooks/useBuildStatus.d.ts +1 -1
  184. package/dist/hooks/useBuildStatus.d.ts.map +1 -1
  185. package/dist/hooks/useDocumentUploads.d.ts +1 -1
  186. package/dist/hooks/useDocumentUploads.d.ts.map +1 -1
  187. package/dist/hooks/useEditorPersistence.d.ts +5 -1
  188. package/dist/hooks/useEditorPersistence.d.ts.map +1 -1
  189. package/dist/hooks/useEditorPublish.d.ts +2 -2
  190. package/dist/hooks/useEditorPublish.d.ts.map +1 -1
  191. package/dist/hooks/useNotice.d.ts +19 -0
  192. package/dist/hooks/useNotice.d.ts.map +1 -0
  193. package/dist/hooks/useSortableNavRow.d.ts +11 -0
  194. package/dist/hooks/useSortableNavRow.d.ts.map +1 -1
  195. package/dist/hooks/useSortableRow.d.ts +11 -0
  196. package/dist/hooks/useSortableRow.d.ts.map +1 -1
  197. package/dist/hooks/useStackedEscape.d.ts +32 -0
  198. package/dist/hooks/useStackedEscape.d.ts.map +1 -0
  199. package/dist/index.js +67 -49
  200. package/dist/lib/audience-secret.js +2 -2
  201. package/dist/lib/block-dnd.d.ts +5 -0
  202. package/dist/lib/block-dnd.d.ts.map +1 -1
  203. package/dist/lib/block-move.d.ts.map +1 -1
  204. package/dist/lib/brand-swatches.d.ts +12 -0
  205. package/dist/lib/brand-swatches.d.ts.map +1 -0
  206. package/dist/lib/container-ops.d.ts +3 -2
  207. package/dist/lib/container-ops.d.ts.map +1 -1
  208. package/dist/lib/dexie.d.ts.map +1 -1
  209. package/dist/lib/dexie.js +9 -1
  210. package/dist/lib/env.d.ts +4 -0
  211. package/dist/lib/env.d.ts.map +1 -1
  212. package/dist/lib/env.js +5 -3
  213. package/dist/lib/events.d.ts +1 -2
  214. package/dist/lib/events.d.ts.map +1 -1
  215. package/dist/lib/image-background.d.ts +8 -0
  216. package/dist/lib/image-background.d.ts.map +1 -0
  217. package/dist/lib/index-ops.js +3 -3
  218. package/dist/lib/index.d.ts +6 -4
  219. package/dist/lib/index.d.ts.map +1 -1
  220. package/dist/lib/index.js +29 -21
  221. package/dist/lib/loader.d.ts +21 -7
  222. package/dist/lib/loader.d.ts.map +1 -1
  223. package/dist/lib/nav-tree.d.ts +1 -0
  224. package/dist/lib/nav-tree.d.ts.map +1 -1
  225. package/dist/lib/nav.d.ts +38 -0
  226. package/dist/lib/nav.d.ts.map +1 -1
  227. package/dist/lib/platform-broker.d.ts +4 -2
  228. package/dist/lib/platform-broker.d.ts.map +1 -1
  229. package/dist/lib/platform-broker.js +21 -13
  230. package/dist/lib/reference-type.d.ts +2 -0
  231. package/dist/lib/reference-type.d.ts.map +1 -0
  232. package/dist/lib/reference-validation.d.ts +31 -0
  233. package/dist/lib/reference-validation.d.ts.map +1 -0
  234. package/dist/lib/reference-validation.js +39 -0
  235. package/dist/lib/references.d.ts +74 -0
  236. package/dist/lib/references.d.ts.map +1 -0
  237. package/dist/lib/registry.d.ts +35 -0
  238. package/dist/lib/registry.d.ts.map +1 -1
  239. package/dist/lib/{safeRedirect.d.ts → safe-redirect.d.ts} +1 -1
  240. package/dist/lib/safe-redirect.d.ts.map +1 -0
  241. package/dist/lib/tags.d.ts +58 -0
  242. package/dist/lib/tags.d.ts.map +1 -0
  243. package/dist/lib/theme-vars.d.ts +9 -0
  244. package/dist/lib/theme-vars.d.ts.map +1 -1
  245. package/dist/media/index.d.ts +1 -1
  246. package/dist/media/index.d.ts.map +1 -1
  247. package/dist/media/index.js +8 -4
  248. package/dist/media/utils.d.ts +2 -0
  249. package/dist/media/utils.d.ts.map +1 -1
  250. package/dist/media/{videoPoster.d.ts → video-poster.d.ts} +1 -1
  251. package/dist/media/video-poster.d.ts.map +1 -0
  252. package/dist/schemas/audience.js +2 -2
  253. package/dist/schemas/index.d.ts +1 -0
  254. package/dist/schemas/index.d.ts.map +1 -1
  255. package/dist/schemas/index.js +14 -8
  256. package/dist/schemas/shared.d.ts +26 -0
  257. package/dist/schemas/shared.d.ts.map +1 -1
  258. package/dist/schemas/site-config.d.ts +6 -0
  259. package/dist/schemas/site-config.d.ts.map +1 -1
  260. package/dist/schemas/tags.d.ts +27 -0
  261. package/dist/schemas/tags.d.ts.map +1 -0
  262. package/dist/storage/index.js +1 -1
  263. package/dist/types/database.d.ts.map +1 -1
  264. package/package.json +6 -1
  265. package/src/auth/cookies.ts +111 -0
  266. package/src/collab/rebase.ts +26 -2
  267. package/src/components/brandguide/ColorSwatchSettings.tsx +1 -1
  268. package/src/components/brandguide/ColorsEditable.tsx +1 -0
  269. package/src/components/chat/ChatPanel.tsx +2 -3
  270. package/src/components/chat/ChatWidget.tsx +2 -3
  271. package/src/components/docfile/DocFilePane.tsx +4 -12
  272. package/src/components/editor/ChildBlockWrapper.tsx +13 -19
  273. package/src/components/editor/ConflictDialog.tsx +27 -35
  274. package/src/components/editor/DeleteButton.tsx +2 -2
  275. package/src/components/editor/DragHandle.tsx +16 -3
  276. package/src/components/editor/DropEdgeIndicator.tsx +36 -10
  277. package/src/components/editor/InsertButton.tsx +2 -2
  278. package/src/components/editor/NavGroupRow.tsx +43 -14
  279. package/src/components/editor/PagesModal.tsx +99 -26
  280. package/src/components/editor/SectionWrapper.tsx +64 -23
  281. package/src/components/editor/SettingsButton.tsx +2 -2
  282. package/src/components/editor/SettingsForm.tsx +19 -2
  283. package/src/components/editor/StatusIndicator.tsx +4 -4
  284. package/src/components/editor/TagIndicator.tsx +80 -0
  285. package/src/components/primitives/DocumentDropZone.tsx +1 -1
  286. package/src/components/primitives/EditableGrid.tsx +15 -14
  287. package/src/components/primitives/EditableList.tsx +27 -74
  288. package/src/components/primitives/HeadingSection.tsx +5 -2
  289. package/src/components/primitives/ResolvedMedia.tsx +13 -0
  290. package/src/components/primitives/{defineHeadingSection.tsx → define-heading-section.tsx} +1 -0
  291. package/src/components/primitives/index.ts +1 -1
  292. package/src/components/primitives/useEditablePlainText.ts +5 -5
  293. package/src/components/sections/Button/CTAButton.tsx +3 -1
  294. package/src/components/sections/DoDontMedia/DoDontMediaBlock.tsx +4 -4
  295. package/src/components/sections/DoDontMedia/index.tsx +12 -3
  296. package/src/components/sections/IconList/DoDontToggle.tsx +2 -2
  297. package/src/components/sections/IconList/IconList.tsx +70 -37
  298. package/src/components/sections/IconList/IconListSettings.tsx +55 -17
  299. package/src/components/sections/IconList/index.tsx +10 -3
  300. package/src/components/sections/LinkHeading/index.tsx +1 -1
  301. package/src/components/sections/Media/MediaBlock.tsx +13 -2
  302. package/src/components/sections/Media/index.tsx +12 -4
  303. package/src/components/sections/Reference/ReferenceList.tsx +214 -0
  304. package/src/components/sections/Reference/ReferenceSettings.tsx +159 -0
  305. package/src/components/sections/Reference/index.tsx +47 -0
  306. package/src/components/sections/SectionSummary/SectionSummaryBlock.tsx +476 -0
  307. package/src/components/sections/SectionSummary/SectionSummarySettings.tsx +126 -0
  308. package/src/components/sections/SectionSummary/index.tsx +149 -0
  309. package/src/components/sections/SubHeading/index.tsx +1 -1
  310. package/src/components/sections/SubSubHeading/index.tsx +1 -1
  311. package/src/components/sections/brand-guide.ts +4 -3
  312. package/src/components/sections/core-sections.ts +2 -0
  313. package/src/components/shared/BrandSwatchesContext.ts +13 -0
  314. package/src/components/shared/Button.tsx +47 -34
  315. package/src/components/shared/Checkbox.tsx +21 -12
  316. package/src/components/shared/ConfirmDialog.tsx +87 -0
  317. package/src/components/shared/ConfirmInline.tsx +90 -0
  318. package/src/components/shared/ErrorBoundary.tsx +6 -18
  319. package/src/components/shared/Fab.tsx +15 -5
  320. package/src/components/shared/FabStack.tsx +28 -0
  321. package/src/components/shared/HistoryChangesModal.tsx +43 -41
  322. package/src/components/shared/HistoryPopover.tsx +7 -20
  323. package/src/components/shared/ImageBackgroundField.tsx +92 -0
  324. package/src/components/shared/{UploadRejectionAlert.tsx → InlineAlert.tsx} +21 -5
  325. package/src/components/shared/Input.tsx +23 -7
  326. package/src/components/shared/Navigation.tsx +22 -17
  327. package/src/components/shared/Notice.tsx +59 -0
  328. package/src/components/shared/Popover.tsx +7 -11
  329. package/src/components/shared/ReferenceSourcesContext.ts +27 -0
  330. package/src/components/shared/Select.tsx +5 -2
  331. package/src/components/shared/SplitButton.tsx +11 -17
  332. package/src/components/shared/SummaryAnchorsContext.ts +11 -0
  333. package/src/components/shared/Textarea.tsx +17 -2
  334. package/src/components/shared/ToolbarFrame.tsx +28 -0
  335. package/src/components/shared/VideoSourceField.tsx +1 -1
  336. package/src/components/shared/copy.ts +18 -0
  337. package/src/components/shared/icons.tsx +1 -17
  338. package/src/components/shell/AudienceAddForm.tsx +2 -2
  339. package/src/components/shell/AudienceDetailsPanel.tsx +23 -5
  340. package/src/components/shell/AudienceRow.tsx +22 -15
  341. package/src/components/shell/BugReportFAB.tsx +50 -40
  342. package/src/components/shell/CredentialList.tsx +33 -13
  343. package/src/components/shell/DocInspector.tsx +3 -12
  344. package/src/components/shell/DocumentEditorOverlay.tsx +33 -23
  345. package/src/components/shell/EditorContext.tsx +7 -0
  346. package/src/components/shell/EditorLoginForm.tsx +26 -36
  347. package/src/components/shell/EditorModal.tsx +8 -10
  348. package/src/components/shell/EditorShell.tsx +499 -339
  349. package/src/components/shell/HistoryToolbar.tsx +24 -26
  350. package/src/components/shell/MediaFolderTile.tsx +8 -3
  351. package/src/components/shell/MediaLibraryModal.tsx +59 -60
  352. package/src/components/shell/ProcessingIndicator.tsx +2 -2
  353. package/src/components/shell/RestoreModal.tsx +17 -16
  354. package/src/components/shell/SetPasswordForm.tsx +3 -3
  355. package/src/components/shell/SiteSettingsChatbot.tsx +61 -42
  356. package/src/components/shell/SiteSettingsDisplay.tsx +10 -20
  357. package/src/components/shell/SiteSettingsModal.tsx +24 -2
  358. package/src/components/shell/SiteSettingsTags.tsx +143 -0
  359. package/src/components/shell/SiteSettingsUsers.tsx +36 -26
  360. package/src/components/shell/SiteSettingsViewerAccess.tsx +2 -2
  361. package/src/components/shell/ViewerLoginForm.tsx +5 -4
  362. package/src/components/shell/reference-sources.ts +36 -0
  363. package/src/deck/index.ts +2 -2
  364. package/src/document/index.ts +2 -2
  365. package/src/hooks/useBlockDnd.ts +11 -0
  366. package/src/hooks/useBuildStatus.ts +53 -6
  367. package/src/hooks/useDocumentUploads.ts +1 -1
  368. package/src/hooks/useEditorPersistence.ts +141 -35
  369. package/src/hooks/useEditorPublish.ts +18 -27
  370. package/src/hooks/useMediaPipeline.ts +1 -1
  371. package/src/hooks/useNotice.ts +45 -0
  372. package/src/hooks/useSortableNavRow.ts +11 -0
  373. package/src/hooks/useSortableRow.ts +22 -2
  374. package/src/hooks/useStackedEscape.ts +62 -0
  375. package/src/lib/block-dnd.ts +6 -1
  376. package/src/lib/block-move.ts +3 -0
  377. package/src/lib/brand-swatches.ts +32 -0
  378. package/src/lib/container-ops.ts +5 -3
  379. package/src/lib/dexie.ts +15 -1
  380. package/src/lib/env.ts +9 -0
  381. package/src/lib/events.ts +1 -2
  382. package/src/lib/image-background.ts +31 -0
  383. package/src/lib/index.ts +5 -4
  384. package/src/lib/loader.ts +54 -55
  385. package/src/lib/nav-tree.ts +71 -0
  386. package/src/lib/nav.ts +196 -36
  387. package/src/lib/platform-broker.ts +32 -14
  388. package/src/lib/reference-type.ts +3 -0
  389. package/src/lib/reference-validation.ts +69 -0
  390. package/src/lib/references.ts +130 -0
  391. package/src/lib/registry.ts +37 -0
  392. package/src/lib/tags.ts +148 -0
  393. package/src/lib/theme-vars.ts +23 -0
  394. package/src/media/index.ts +1 -1
  395. package/src/media/utils.ts +18 -0
  396. package/src/media/{videoPoster.ts → video-poster.ts} +2 -2
  397. package/src/schemas/index.ts +1 -0
  398. package/src/schemas/shared.ts +24 -1
  399. package/src/schemas/site-config.ts +6 -1
  400. package/src/schemas/tags.ts +33 -0
  401. package/src/storage/types.ts +1 -1
  402. package/src/types/database.ts +2 -0
  403. package/dist/chunk-DNY72JZN.js +0 -86
  404. package/dist/chunk-F2LYQPXV.js +0 -77
  405. package/dist/chunk-JH762VUH.js +0 -128
  406. package/dist/chunk-K7DYZXVU.js +0 -138
  407. package/dist/components/primitives/defineHeadingSection.d.ts.map +0 -1
  408. package/dist/components/primitives/gridDrop.d.ts.map +0 -1
  409. package/dist/components/shared/UploadRejectionAlert.d.ts.map +0 -1
  410. package/dist/components/shell/BuildStatusIndicator.d.ts +0 -7
  411. package/dist/components/shell/BuildStatusIndicator.d.ts.map +0 -1
  412. package/dist/components/shell/blockMoveDispatch.d.ts.map +0 -1
  413. package/dist/hooks/index.d.ts +0 -9
  414. package/dist/hooks/index.d.ts.map +0 -1
  415. package/dist/lib/grid.d.ts +0 -2
  416. package/dist/lib/grid.d.ts.map +0 -1
  417. package/dist/lib/safeRedirect.d.ts.map +0 -1
  418. package/dist/media/videoPoster.d.ts.map +0 -1
  419. package/src/components/brandguide/ColorSwatchSettings.d.ts.map +0 -1
  420. package/src/components/brandguide/Colors.d.ts.map +0 -1
  421. package/src/components/primitives/CustomParagraph.d.ts.map +0 -1
  422. package/src/components/primitives/EditableGrid.d.ts.map +0 -1
  423. package/src/components/primitives/EditablePlainText.d.ts.map +0 -1
  424. package/src/components/primitives/EditableRichText.d.ts.map +0 -1
  425. package/src/components/primitives/HeadingSection.d.ts.map +0 -1
  426. package/src/components/primitives/IconPicker.d.ts.map +0 -1
  427. package/src/components/primitives/LinkPopover.d.ts.map +0 -1
  428. package/src/components/primitives/MediaSettingsForms.d.ts.map +0 -1
  429. package/src/components/primitives/ResolvedMedia.d.ts.map +0 -1
  430. package/src/components/primitives/RichTextToolbar.d.ts.map +0 -1
  431. package/src/components/primitives/tiptap-presets.d.ts.map +0 -1
  432. package/src/components/primitives/useEditableCollection.d.ts.map +0 -1
  433. package/src/components/primitives/useEditablePlainText.d.ts.map +0 -1
  434. package/src/components/primitives/useEditableRichText.d.ts.map +0 -1
  435. package/src/components/sections/Button/CTAButton.d.ts.map +0 -1
  436. package/src/components/sections/Button/index.d.ts.map +0 -1
  437. package/src/components/sections/Colors/index.d.ts.map +0 -1
  438. package/src/components/sections/IconList/IconList.d.ts.map +0 -1
  439. package/src/components/sections/IconList/IconListSettings.d.ts.map +0 -1
  440. package/src/components/sections/IconList/index.d.ts.map +0 -1
  441. package/src/components/sections/LinkHeading/index.d.ts.map +0 -1
  442. package/src/components/sections/Prose/Prose.d.ts.map +0 -1
  443. package/src/components/sections/Prose/index.d.ts.map +0 -1
  444. package/src/components/sections/SubHeading/index.d.ts.map +0 -1
  445. package/src/components/sections/SubSubHeading/index.d.ts.map +0 -1
  446. package/src/components/sections/register-schemas.d.ts.map +0 -1
  447. package/src/components/shared/Button.d.ts.map +0 -1
  448. package/src/components/shared/Checkbox.d.ts.map +0 -1
  449. package/src/components/shared/FormLabel.d.ts.map +0 -1
  450. package/src/components/shared/IconButton.d.ts.map +0 -1
  451. package/src/components/shared/Input.d.ts.map +0 -1
  452. package/src/components/shared/Select.d.ts.map +0 -1
  453. package/src/components/shared/icons.d.ts.map +0 -1
  454. package/src/components/shell/BuildStatusIndicator.tsx +0 -59
  455. package/src/components/shell/MediaLibraryContext.d.ts.map +0 -1
  456. package/src/hooks/index.ts +0 -8
  457. package/src/hooks/useResolvedMedia.d.ts.map +0 -1
  458. package/src/lib/cn.d.ts.map +0 -1
  459. package/src/lib/grid.d.ts.map +0 -1
  460. package/src/lib/grid.ts +0 -7
  461. package/src/lib/icons.d.ts.map +0 -1
  462. package/src/lib/loader.d.ts.map +0 -1
  463. package/src/lib/nav.d.ts.map +0 -1
  464. package/src/lib/registry.d.ts.map +0 -1
  465. package/src/lib/sanitize.d.ts.map +0 -1
  466. package/src/media/github.d.ts.map +0 -1
  467. package/src/media/index.d.ts.map +0 -1
  468. package/src/media/queue.d.ts.map +0 -1
  469. package/src/media/resolve.d.ts.map +0 -1
  470. package/src/media/types.d.ts.map +0 -1
  471. package/src/media/utils.d.ts.map +0 -1
  472. package/src/media/videoPoster.d.ts.map +0 -1
  473. package/src/schemas/auth.d.ts.map +0 -1
  474. package/src/schemas/media-grid-options.d.ts.map +0 -1
  475. package/src/schemas/media.d.ts.map +0 -1
  476. package/src/schemas/sections.d.ts.map +0 -1
  477. package/src/schemas/shared.d.ts.map +0 -1
  478. package/src/schemas/site-config.d.ts.map +0 -1
  479. /package/dist/{chunk-B7VBSE5X.js → chunk-3JDTXOIG.js} +0 -0
  480. /package/dist/{chunk-CXZ5YJG4.js → chunk-L45X7DKX.js} +0 -0
  481. /package/src/components/primitives/{gridDrop.ts → grid-drop.ts} +0 -0
  482. /package/src/components/shell/{blockMoveDispatch.ts → block-move-dispatch.ts} +0 -0
  483. /package/src/lib/{safeRedirect.ts → safe-redirect.ts} +0 -0
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  EditablePlainText
3
- } from "./chunk-DS4GCYV2.js";
3
+ } from "./chunk-Y5QECJX7.js";
4
4
  import {
5
5
  usePages
6
- } from "./chunk-K7DYZXVU.js";
6
+ } from "./chunk-5KSAS4VY.js";
7
7
  import {
8
8
  Button
9
- } from "./chunk-WUJ3XNFI.js";
9
+ } from "./chunk-GGYY3JQJ.js";
10
10
  import {
11
11
  toSectionId
12
- } from "./chunk-DNY72JZN.js";
12
+ } from "./chunk-VUYCRBJK.js";
13
13
  import {
14
14
  ensureSanitizer,
15
15
  isSanitizerReady,
@@ -22,12 +22,12 @@ import {
22
22
  defineSection
23
23
  } from "./chunk-FTPETWXE.js";
24
24
 
25
- // src/components/primitives/defineHeadingSection.tsx
25
+ // src/components/primitives/define-heading-section.tsx
26
26
  import { z } from "zod";
27
27
 
28
28
  // src/components/primitives/HeadingSection.tsx
29
29
  import { jsx } from "react/jsx-runtime";
30
- function HeadingSection({ heading, tag, placeholder, className, onChange }) {
30
+ function HeadingSection({ heading, tag, placeholder, className, anchor, onChange }) {
31
31
  return /* @__PURE__ */ jsx(
32
32
  EditablePlainText,
33
33
  {
@@ -37,13 +37,13 @@ function HeadingSection({ heading, tag, placeholder, className, onChange }) {
37
37
  }),
38
38
  isEditMode: !!onChange,
39
39
  placeholder,
40
- id: toSectionId(heading),
40
+ id: anchor ?? toSectionId(heading),
41
41
  className: cn("scroll-mt-20", className)
42
42
  }
43
43
  );
44
44
  }
45
45
 
46
- // src/components/primitives/defineHeadingSection.tsx
46
+ // src/components/primitives/define-heading-section.tsx
47
47
  import { jsx as jsx2 } from "react/jsx-runtime";
48
48
  function defineHeadingSection(config) {
49
49
  const heading = z.string().describe(
@@ -69,6 +69,7 @@ function defineHeadingSection(config) {
69
69
  heading: content2.content.heading,
70
70
  tag: config.tag,
71
71
  placeholder: config.placeholder,
72
+ anchor: content2.navAnchor,
72
73
  onChange: onChange ? (heading2) => onChange({ ...content2, content: { ...content2.content, heading: heading2 } }) : void 0
73
74
  }
74
75
  ),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  slugifyPageSlug
3
- } from "./chunk-NHN2LSIU.js";
3
+ } from "./chunk-IP2SEBAJ.js";
4
4
 
5
5
  // src/media/utils.ts
6
6
  async function hashFileBuffer(buffer) {
@@ -44,6 +44,17 @@ var EXT_TO_MIME = {
44
44
  function mimeToExt(mime) {
45
45
  return MIME_TO_EXT[mime] ?? "bin";
46
46
  }
47
+ function mediaThumbnailUrl(item) {
48
+ if (item.mimeType === "image/svg+xml" || item.kind !== "image") {
49
+ return `/api/media/${item.id}/original.${mimeToExt(item.mimeType)}`;
50
+ }
51
+ if (item.variants.length === 0) return null;
52
+ const smallest = item.variants.reduce((a, b) => a.width < b.width ? a : b);
53
+ return `/api/media/${item.id}/${smallest.width}.webp`;
54
+ }
55
+ function imageThumbnailUrl(item) {
56
+ return item?.kind === "image" ? mediaThumbnailUrl(item) : null;
57
+ }
47
58
  function displayFilenameExt(mime) {
48
59
  const ext = MIME_TO_EXT[mime];
49
60
  return ext ? `.${ext}` : "";
@@ -253,7 +264,7 @@ function resolveLogo(logo, manifest, provider) {
253
264
  };
254
265
  }
255
266
 
256
- // src/media/videoPoster.ts
267
+ // src/media/video-poster.ts
257
268
  function generateVideoPoster(blob, quality) {
258
269
  return new Promise((resolve, reject) => {
259
270
  const video = document.createElement("video");
@@ -275,7 +286,7 @@ function generateVideoPoster(blob, quality) {
275
286
  safeReject(new Error("Video poster generation timed out"));
276
287
  }, 1e4);
277
288
  video.addEventListener("error", () => {
278
- safeReject(new Error("Failed to load video for poster generation"));
289
+ safeReject(new Error("Couldn't load video for poster generation"));
279
290
  }, { once: true });
280
291
  video.muted = true;
281
292
  video.preload = "auto";
@@ -301,7 +312,7 @@ function generateVideoPoster(blob, quality) {
301
312
  settled = true;
302
313
  cleanup();
303
314
  if (!posterBlob) {
304
- reject(new Error("Failed to create poster blob"));
315
+ reject(new Error("Couldn't create poster blob"));
305
316
  return;
306
317
  }
307
318
  resolve({ posterBlob, width: w, height: h, duration: video.duration });
@@ -426,6 +437,8 @@ export {
426
437
  MIME_TO_EXT,
427
438
  EXT_TO_MIME,
428
439
  mimeToExt,
440
+ mediaThumbnailUrl,
441
+ imageThumbnailUrl,
429
442
  displayFilenameExt,
430
443
  displayFilename,
431
444
  formatFileSize,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HexColorSchema
3
- } from "./chunk-GGXZZ77Z.js";
3
+ } from "./chunk-AASEGXNT.js";
4
4
 
5
5
  // src/schemas/audience.ts
6
6
  import { z } from "zod";
@@ -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,
@@ -0,0 +1,174 @@
1
+ import {
2
+ getContainerChildren
3
+ } from "./chunk-L45X7DKX.js";
4
+ import {
5
+ siteTags
6
+ } from "./chunk-OAGJBCSH.js";
7
+ import {
8
+ audiencePasses,
9
+ pagesInNavOrder
10
+ } from "./chunk-IP2SEBAJ.js";
11
+ import {
12
+ REFERENCE_TYPE
13
+ } from "./chunk-5GFACGSN.js";
14
+ import {
15
+ getSection
16
+ } from "./chunk-FTPETWXE.js";
17
+
18
+ // src/lib/references.ts
19
+ function referenceItems(opts) {
20
+ const { referenceId, content, index, allSections, audiences } = opts;
21
+ const wanted = new Set(content.sectionIds);
22
+ const tagIds = new Set(content.tagIds);
23
+ for (const tag of siteTags(index)) {
24
+ if (tagIds.has(tag.id)) for (const id of tag.sectionIds) wanted.add(id);
25
+ }
26
+ wanted.delete(referenceId);
27
+ if (wanted.size === 0) return [];
28
+ const byId = new Map(allSections.map((s) => [s.section.id, s]));
29
+ const item = (sectionId, page) => {
30
+ const source = byId.get(sectionId) ?? null;
31
+ const excluded = !source || !page ? "missing" : source.section.type === REFERENCE_TYPE ? "reference" : page.status !== "live" ? "archived-page" : source.meta.status !== "live" ? "not-live" : null;
32
+ const hiddenFrom = excluded || !source || !page ? [] : audiences.filter(
33
+ (a) => !audiencePasses(page.access, a) || !audiencePasses(source.meta.access, a)
34
+ );
35
+ return { sectionId, page, source, excluded, hiddenFrom };
36
+ };
37
+ const items = [];
38
+ const placed = /* @__PURE__ */ new Set();
39
+ for (const page of pagesInNavOrder(index)) {
40
+ for (const id of page.order) {
41
+ if (!wanted.has(id)) continue;
42
+ items.push(item(id, page));
43
+ placed.add(id);
44
+ }
45
+ }
46
+ for (const id of wanted) if (!placed.has(id)) items.push(item(id, null));
47
+ return items;
48
+ }
49
+ function resolveReference(opts) {
50
+ const { audience, ...rest } = opts;
51
+ return referenceItems({ ...rest, audiences: audience === null ? [] : [audience] }).flatMap(
52
+ (i) => i.source && !i.excluded && i.hiddenFrom.length === 0 ? [{ ...i.source, referencedBy: opts.referenceId }] : []
53
+ );
54
+ }
55
+
56
+ // src/lib/nav.ts
57
+ function toSectionId(text) {
58
+ const slug = text.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/^-+|-+$/g, "");
59
+ if (slug) return slug;
60
+ let hash = 0;
61
+ for (let i = 0; i < text.length; i++) {
62
+ hash = (hash << 5) - hash + text.charCodeAt(i) | 0;
63
+ }
64
+ return `section-${Math.abs(hash).toString(36)}`;
65
+ }
66
+ function flattenForNav(sections) {
67
+ const flat = [];
68
+ const walk = (loaded) => {
69
+ flat.push(loaded);
70
+ for (const child of getContainerChildren(loaded.section)) {
71
+ walk({ section: child, meta: loaded.meta, referencedBy: loaded.referencedBy });
72
+ }
73
+ };
74
+ sections.forEach(walk);
75
+ return flat;
76
+ }
77
+ var SUMMARY_TYPE = "section_summary";
78
+ function summaryNav(section) {
79
+ if (section.type !== SUMMARY_TYPE) return null;
80
+ const options = "options" in section ? section.options : void 0;
81
+ const label = options?.navLabel?.trim() ?? "";
82
+ if (!label || options?.nav !== "heading" && options?.nav !== "subheading") return null;
83
+ return { role: options.nav === "heading" ? "h1" : "h2", label };
84
+ }
85
+ function roleLookup(registry) {
86
+ return (type) => (registry ? registry.getSection(type) : getSection(type))?.navRole;
87
+ }
88
+ function assignAnchors(flat, lookupRole) {
89
+ const anchors = new Array(flat.length);
90
+ const taken = /* @__PURE__ */ new Set();
91
+ const claim = (i, base) => {
92
+ let anchor = base;
93
+ for (let n = 2; taken.has(anchor); n++) anchor = `${base}-${n}`;
94
+ taken.add(anchor);
95
+ anchors[i] = anchor;
96
+ };
97
+ const headingOf = (section) => {
98
+ const heading = section.content.heading;
99
+ return heading && lookupRole(section.type) ? heading : void 0;
100
+ };
101
+ flat.forEach(({ section, referencedBy }, i) => {
102
+ const heading = headingOf(section);
103
+ if (referencedBy || !heading) return;
104
+ anchors[i] = toSectionId(heading);
105
+ taken.add(anchors[i]);
106
+ });
107
+ flat.forEach(({ section, referencedBy }, i) => {
108
+ const entry = summaryNav(section);
109
+ if (!referencedBy && entry) claim(i, toSectionId(entry.label));
110
+ });
111
+ flat.forEach(({ section, referencedBy }, i) => {
112
+ const text = summaryNav(section)?.label ?? headingOf(section);
113
+ if (referencedBy && text) claim(i, `${toSectionId(text)}-${toSectionId(referencedBy)}`);
114
+ });
115
+ return anchors;
116
+ }
117
+ function buildNavLinks(flat, lookupRole, anchors) {
118
+ const nav = [];
119
+ let currentParent = null;
120
+ let currentChild = null;
121
+ for (const [i, { section, meta }] of flat.entries()) {
122
+ let role;
123
+ let label;
124
+ let excluded = false;
125
+ const summary = summaryNav(section);
126
+ if (summary) {
127
+ role = summary.role;
128
+ label = summary.label;
129
+ } else {
130
+ const content = section.content;
131
+ if (!content.heading) continue;
132
+ role = lookupRole(section.type);
133
+ label = content.heading;
134
+ excluded = !!content.excludeFromNav;
135
+ }
136
+ const anchor = anchors[i];
137
+ if (!role || !anchor) continue;
138
+ if (role === "h1") {
139
+ if (excluded) {
140
+ currentParent = null;
141
+ currentChild = null;
142
+ continue;
143
+ }
144
+ currentParent = { href: `#${anchor}`, label, status: meta.status, children: [] };
145
+ currentChild = null;
146
+ nav.push(currentParent);
147
+ } else if (role === "h2") {
148
+ if (excluded) {
149
+ currentChild = null;
150
+ continue;
151
+ }
152
+ if (!currentParent) continue;
153
+ currentChild = { href: `#${anchor}`, label, status: meta.status, children: [] };
154
+ currentParent.children.push(currentChild);
155
+ } else if (role === "h3") {
156
+ if (excluded) continue;
157
+ if (!currentChild) continue;
158
+ currentChild.children.push({ href: `#${anchor}`, label, status: meta.status, children: [] });
159
+ }
160
+ }
161
+ return nav;
162
+ }
163
+ function generateNavLinks(sections, registry) {
164
+ const flat = flattenForNav(sections);
165
+ const lookupRole = roleLookup(registry);
166
+ return buildNavLinks(flat, lookupRole, assignAnchors(flat, lookupRole));
167
+ }
168
+
169
+ export {
170
+ referenceItems,
171
+ resolveReference,
172
+ toSectionId,
173
+ generateNavLinks
174
+ };
@@ -12,7 +12,6 @@ function createEvent(name) {
12
12
  };
13
13
  }
14
14
  var editModeEvent = createEvent("editmodechange");
15
- var navChangeEvent = createEvent("sitenavchange");
16
15
  var darkModeEvent = createEvent("sitedarkmode");
17
16
  var siteNameChangeEvent = createEvent("sitenamechange");
18
17
  var historySelectEvent = createEvent("history-select");
@@ -26,6 +25,5 @@ var audienceDetailsEvent = createEvent("audiencedetailsopen");
26
25
  export {
27
26
  createEvent,
28
27
  editModeEvent,
29
- navChangeEvent,
30
28
  darkModeEvent
31
29
  };
@@ -1,17 +1,18 @@
1
1
  import {
2
- AddIcon,
3
- DeleteIcon,
4
2
  DragHandle,
5
- SettingsIcon,
3
+ DropEdgeIndicator,
6
4
  useMediaLibrary,
7
5
  useResolvedMedia
8
- } from "./chunk-JH762VUH.js";
6
+ } from "./chunk-5KSAS4VY.js";
7
+ import {
8
+ computeReorderTarget
9
+ } from "./chunk-DIMDRBFK.js";
9
10
  import {
10
11
  IconButton
11
12
  } from "./chunk-IIDKW7AV.js";
12
13
  import {
13
14
  rebindImageRef
14
- } from "./chunk-FRE2CCLV.js";
15
+ } from "./chunk-QHMKIODQ.js";
15
16
  import {
16
17
  cn
17
18
  } from "./chunk-7EOSDFS3.js";
@@ -152,7 +153,8 @@ function ResolvedMedia({
152
153
  height: propHeight,
153
154
  className,
154
155
  imgClassName,
155
- invertFrom
156
+ invertFrom,
157
+ backdrop
156
158
  }) {
157
159
  const resolved = useResolvedMedia(imageId);
158
160
  const hasResolved = !!resolved.src;
@@ -178,6 +180,15 @@ function ResolvedMedia({
178
180
  )
179
181
  }
180
182
  ),
183
+ backdrop && /* @__PURE__ */ jsx(
184
+ "div",
185
+ {
186
+ "aria-hidden": "true",
187
+ "data-testid": "media-backdrop",
188
+ className: cn("pointer-events-none absolute inset-0", backdrop.className),
189
+ style: backdrop.style
190
+ }
191
+ ),
181
192
  kind === "video" ? /* @__PURE__ */ jsx(
182
193
  "video",
183
194
  {
@@ -268,6 +279,25 @@ function ImageDropZone({ onImageSelected, className, children }) {
268
279
  );
269
280
  }
270
281
 
282
+ // src/lib/image-background.ts
283
+ var LIGHT_MODE = {
284
+ none: void 0,
285
+ light: "bg-surface-light",
286
+ dark: "bg-surface-dark"
287
+ };
288
+ var DARK_MODE = {
289
+ none: "dark:bg-transparent",
290
+ light: "dark:bg-surface-light",
291
+ dark: "dark:bg-surface-dark"
292
+ };
293
+ function imageBackdrop(bg) {
294
+ if (!bg) return void 0;
295
+ if (bg.mode === "custom") return { style: { backgroundColor: bg.color } };
296
+ const light = LIGHT_MODE[bg.light];
297
+ if (!light && bg.dark === "none") return void 0;
298
+ return { className: [light, DARK_MODE[bg.dark]].filter(Boolean).join(" ") };
299
+ }
300
+
271
301
  // src/components/sections/Media/MediaBlock.tsx
272
302
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
273
303
  function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
@@ -275,6 +305,7 @@ function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
275
305
  const fit = refValue.objectFit ?? options.objectFit;
276
306
  const fitClass = fit === "cover" ? "object-cover" : "object-contain";
277
307
  const showBorder = refValue.border ?? options.border;
308
+ const backdrop = refValue.type === "video" ? void 0 : imageBackdrop(options.background);
278
309
  const captionStr = refValue.caption ? Array.isArray(refValue.caption) ? refValue.caption.join("\n") : refValue.caption : "";
279
310
  const replace = onRefChange ? (imageId) => onRefChange(rebindImageRef(refValue, imageId)) : void 0;
280
311
  const baked = refValue;
@@ -292,7 +323,8 @@ function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
292
323
  height: bakedHeight,
293
324
  className: "h-full w-full",
294
325
  imgClassName: fitClass,
295
- invertFrom: refValue.invertFrom
326
+ invertFrom: refValue.invertFrom,
327
+ backdrop
296
328
  }
297
329
  );
298
330
  let media = isEditMode && replace ? /* @__PURE__ */ jsx3(ImageDropZone, { onImageSelected: replace, className: "h-full w-full", children: resolved }) : resolved;
@@ -333,7 +365,7 @@ function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
333
365
 
334
366
  // src/components/primitives/EditableGrid.tsx
335
367
  import { useRef as useRef4, useEffect as useEffect4, useState as useState5, useId } from "react";
336
- import { ImageIcon as ImageIcon2 } from "lucide-react";
368
+ import { ImageIcon as ImageIcon2, Plus, Trash2, Settings } from "lucide-react";
337
369
 
338
370
  // src/lib/container-grid.ts
339
371
  var MAX_CONTAINER_COLUMNS = 6;
@@ -457,7 +489,7 @@ function useEditableCollection({
457
489
  return { wrappedItems, onReorder, onAdd, onInsert, onInsertItem, onRemove };
458
490
  }
459
491
 
460
- // src/components/primitives/gridDrop.ts
492
+ // src/components/primitives/grid-drop.ts
461
493
  function resolveDropIndex({
462
494
  fromIndex,
463
495
  targetIndex,
@@ -568,7 +600,7 @@ function EditableGrid({
568
600
  /* @__PURE__ */ jsx4(
569
601
  IconButton,
570
602
  {
571
- icon: /* @__PURE__ */ jsx4(AddIcon, { size: 16 }),
603
+ icon: /* @__PURE__ */ jsx4(Plus, { size: 16 }),
572
604
  label: "Add item",
573
605
  size: "lg",
574
606
  intent: "primary",
@@ -660,12 +692,17 @@ function GridCell({
660
692
  isCellDragging && "opacity-50"
661
693
  ),
662
694
  children: [
663
- showLeftEdge && /* @__PURE__ */ jsx4("div", { className: "absolute top-0 bottom-0 left-0 z-10 w-0.5 -translate-x-2 bg-primary" }),
664
- showRightEdge && /* @__PURE__ */ jsx4("div", { className: "absolute top-0 right-0 bottom-0 z-10 w-0.5 translate-x-2 bg-primary" }),
695
+ /* @__PURE__ */ jsx4(
696
+ DropEdgeIndicator,
697
+ {
698
+ edge: showLeftEdge ? "left" : showRightEdge ? "right" : null,
699
+ style: { transform: showLeftEdge ? "translateX(-0.5rem)" : "translateX(0.5rem)" }
700
+ }
701
+ ),
665
702
  !isDragging && !isLast && /* @__PURE__ */ jsx4(
666
703
  IconButton,
667
704
  {
668
- icon: /* @__PURE__ */ jsx4(AddIcon, { size: 12 }),
705
+ icon: /* @__PURE__ */ jsx4(Plus, { size: 12 }),
669
706
  label: "Insert item",
670
707
  size: "sm",
671
708
  intent: "primary",
@@ -696,7 +733,7 @@ function GridCell({
696
733
  onSettings && /* @__PURE__ */ jsx4(
697
734
  IconButton,
698
735
  {
699
- icon: /* @__PURE__ */ jsx4(SettingsIcon, { size: 16 }),
736
+ icon: /* @__PURE__ */ jsx4(Settings, { size: 16 }),
700
737
  label: "Item settings",
701
738
  onClick: onSettings,
702
739
  className: "bg-base/80 shadow-sm"
@@ -705,7 +742,7 @@ function GridCell({
705
742
  /* @__PURE__ */ jsx4(
706
743
  IconButton,
707
744
  {
708
- icon: /* @__PURE__ */ jsx4(DeleteIcon, { size: 16 }),
745
+ icon: /* @__PURE__ */ jsx4(Trash2, { size: 16 }),
709
746
  label: "Delete item",
710
747
  intent: "destructive",
711
748
  onClick: () => onRemove(id),
@@ -719,6 +756,175 @@ function GridCell({
719
756
  );
720
757
  }
721
758
 
759
+ // src/components/primitives/EditableList.tsx
760
+ import { useId as useId2 } from "react";
761
+ import { Trash2 as Trash22 } from "lucide-react";
762
+
763
+ // src/hooks/useSortableRow.ts
764
+ import { useEffect as useEffect5, useRef as useRef5, useState as useState6 } from "react";
765
+ function useSortableRow({
766
+ index,
767
+ dragType,
768
+ onReorder,
769
+ enabled = true
770
+ }) {
771
+ const rowRef = useRef5(null);
772
+ const handleRef = useRef5(null);
773
+ const [isDragging, setIsDragging] = useState6(false);
774
+ const [closestEdge, setClosestEdge] = useState6(null);
775
+ const onReorderRef = useRef5(onReorder);
776
+ onReorderRef.current = onReorder;
777
+ useEffect5(() => {
778
+ if (!enabled) return;
779
+ const row = rowRef.current;
780
+ const handle = handleRef.current;
781
+ if (!row || !handle) return;
782
+ let cleanup;
783
+ let cancelled = false;
784
+ Promise.all([
785
+ import("./adapter-HH47ZPGM.js"),
786
+ import("./closest-edge-EBOXL3YW.js")
787
+ ]).then(([{ draggable, dropTargetForElements }, { attachClosestEdge, extractClosestEdge }]) => {
788
+ if (cancelled) return;
789
+ const cleanupDraggable = draggable({
790
+ element: row,
791
+ dragHandle: handle,
792
+ getInitialData: () => ({ dragType, index }),
793
+ onGenerateDragPreview: () => {
794
+ row.style.opacity = "0.4";
795
+ requestAnimationFrame(() => {
796
+ row.style.opacity = "";
797
+ });
798
+ },
799
+ onDragStart: () => setIsDragging(true),
800
+ onDrop: () => setIsDragging(false)
801
+ });
802
+ const cleanupDropTarget = dropTargetForElements({
803
+ element: row,
804
+ canDrop: ({ source }) => source.data.dragType === dragType,
805
+ getData: ({ input, element }) => attachClosestEdge({ index }, { input, element, allowedEdges: ["top", "bottom"] }),
806
+ onDragEnter: ({ self }) => {
807
+ const edge = extractClosestEdge(self.data);
808
+ setClosestEdge(edge === "top" || edge === "bottom" ? edge : null);
809
+ },
810
+ onDrag: ({ self }) => {
811
+ const edge = extractClosestEdge(self.data);
812
+ setClosestEdge(edge === "top" || edge === "bottom" ? edge : null);
813
+ },
814
+ onDragLeave: () => setClosestEdge(null),
815
+ onDrop: ({ source, self }) => {
816
+ setClosestEdge(null);
817
+ const fromIndex = source.data.index;
818
+ const rawEdge = extractClosestEdge(self.data);
819
+ const edge = rawEdge === "top" || rawEdge === "bottom" ? rawEdge : null;
820
+ const toIndex = computeReorderTarget(fromIndex, index, edge);
821
+ if (toIndex !== null) onReorderRef.current(fromIndex, toIndex);
822
+ }
823
+ });
824
+ cleanup = () => {
825
+ cleanupDraggable();
826
+ cleanupDropTarget();
827
+ };
828
+ });
829
+ return () => {
830
+ cancelled = true;
831
+ cleanup?.();
832
+ };
833
+ }, [index, dragType, enabled]);
834
+ return { rowRef, handleRef, isDragging, closestEdge };
835
+ }
836
+
837
+ // src/components/primitives/EditableList.tsx
838
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
839
+ function EditableList({
840
+ items,
841
+ onChange,
842
+ createItem,
843
+ isEditMode,
844
+ renderItem,
845
+ className
846
+ }) {
847
+ const { wrappedItems, onReorder, onAdd, onRemove } = useEditableCollection({
848
+ items,
849
+ onChange,
850
+ createItem
851
+ });
852
+ const listId = useId2();
853
+ const dragType = `list-row-${listId}`;
854
+ if (!isEditMode) {
855
+ return /* @__PURE__ */ jsx5("div", { className: cn("flex flex-col gap-2", className), children: wrappedItems.map((wrapped, index) => /* @__PURE__ */ jsx5("div", { children: renderItem(wrapped.data, { isEditMode: false, index }) }, wrapped.id)) });
856
+ }
857
+ return /* @__PURE__ */ jsxs5("div", { className: cn("flex flex-col gap-2", className), children: [
858
+ wrappedItems.map((wrapped, index) => /* @__PURE__ */ jsx5(
859
+ ListRow,
860
+ {
861
+ id: wrapped.id,
862
+ index,
863
+ dragType,
864
+ onReorder,
865
+ onRemove,
866
+ children: renderItem(wrapped.data, { isEditMode: true, index })
867
+ },
868
+ wrapped.id
869
+ )),
870
+ /* @__PURE__ */ jsx5(
871
+ "button",
872
+ {
873
+ onClick: onAdd,
874
+ className: "cursor-pointer rounded border-2 border-dashed border-base-200 px-3 py-2 text-sm text-base-contrast-light hover:border-primary hover:text-primary",
875
+ children: "Add row"
876
+ }
877
+ )
878
+ ] });
879
+ }
880
+ function ListRow({
881
+ id,
882
+ index,
883
+ dragType,
884
+ onReorder,
885
+ onRemove,
886
+ children
887
+ }) {
888
+ const { rowRef, handleRef, isDragging, closestEdge } = useSortableRow({
889
+ index,
890
+ dragType,
891
+ onReorder
892
+ });
893
+ return /* @__PURE__ */ jsxs5(
894
+ "div",
895
+ {
896
+ ref: rowRef,
897
+ className: cn("group/row relative flex items-center gap-2", isDragging && "opacity-50"),
898
+ children: [
899
+ /* @__PURE__ */ jsx5(DropEdgeIndicator, { edge: closestEdge }),
900
+ /* @__PURE__ */ jsx5(
901
+ IconButton,
902
+ {
903
+ ref: handleRef,
904
+ icon: /* @__PURE__ */ jsx5(DragHandle, { size: 14 }),
905
+ label: "Drag to reorder",
906
+ size: "sm",
907
+ className: "shrink-0 cursor-grab opacity-0 group-hover/row:opacity-100 no-hover:opacity-100",
908
+ tabIndex: -1
909
+ }
910
+ ),
911
+ /* @__PURE__ */ jsx5("div", { className: "min-w-0 flex-1", children }),
912
+ /* @__PURE__ */ jsx5(
913
+ IconButton,
914
+ {
915
+ icon: /* @__PURE__ */ jsx5(Trash22, { size: 14 }),
916
+ label: "Delete item",
917
+ size: "sm",
918
+ intent: "destructive",
919
+ onClick: () => onRemove(id),
920
+ className: "shrink-0 opacity-0 group-hover/row:opacity-100 no-hover:opacity-100"
921
+ }
922
+ )
923
+ ]
924
+ }
925
+ );
926
+ }
927
+
722
928
  export {
723
929
  EditablePlainText,
724
930
  ResolvedMedia,
@@ -730,5 +936,6 @@ export {
730
936
  masonryColumnsClass,
731
937
  spacerHiddenClass,
732
938
  useEditableCollection,
733
- EditableGrid
939
+ EditableGrid,
940
+ EditableList
734
941
  };
@@ -80,7 +80,8 @@ export declare function reconcileRemoteIndex(remoteIndex: SiteIndex, localIndex:
80
80
  * never touches, so the peer's nav transfers whole; readers go through
81
81
  * `navEntries()` → `reconcileNav`, which repairs any drift against the
82
82
  * resulting page set. A peer that sends no nav (an older client) leaves ours
83
- * intact rather than flattening it. */
83
+ * intact rather than flattening it. The `tags` sidecar is lifted the same way,
84
+ * for the same reason. */
84
85
  export declare function applyRemoteIndexUpdate(rawRemoteIndex: unknown, localIndex: SiteIndex): SiteIndex | null;
85
86
  export declare function rebaseContent(args: RebaseArgs): RebaseResult;
86
87
  //# sourceMappingURL=rebase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rebase.d.ts","sourceRoot":"","sources":["../../src/collab/rebase.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,UAAU,EAAE,SAAS,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B;;;;;+EAK2E;IAC3E,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B;;;;gFAI4E;IAC5E,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC;IAKvB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IAIjB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;;;;;;;qEAUqE;AACrE;;;;;;;;;;;;;;;;;;;;;oEAqBoE;AACpE,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,GAAG,SAAS,CAS7F;AAED;;;;;;;;;;;;;;;;;;wCAkBwC;AACxC,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CAYvG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CA6H5D"}
1
+ {"version":3,"file":"rebase.d.ts","sourceRoot":"","sources":["../../src/collab/rebase.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMxD,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,UAAU,EAAE,SAAS,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B;;;;;+EAK2E;IAC3E,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B;;;;gFAI4E;IAC5E,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC;IAKvB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IAIjB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;;;;;;;qEAUqE;AACrE;;;;;;;;;;;;;;;;;;;;;oEAqBoE;AACpE,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,GAAG,SAAS,CAS7F;AAED;;;;;;;;;;;;;;;;;;;2BAmB2B;AAC3B,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CAqBvG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAyI5D"}