@conloca/cms-spa 0.1.15 → 0.2.0

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 (767) hide show
  1. package/README.md +1 -1
  2. package/dist/spa/main.css +4078 -3571
  3. package/dist/ts/App.d.ts +35 -0
  4. package/dist/ts/App.d.ts.map +1 -0
  5. package/dist/ts/App.js +53 -0
  6. package/dist/ts/App.js.map +1 -0
  7. package/dist/ts/CmsSpaApp.d.ts +13 -0
  8. package/dist/ts/CmsSpaApp.d.ts.map +1 -0
  9. package/dist/ts/CmsSpaApp.js +50 -0
  10. package/dist/ts/CmsSpaApp.js.map +1 -0
  11. package/dist/ts/components/CMSDashboard.d.ts +2 -0
  12. package/dist/ts/components/CMSDashboard.d.ts.map +1 -0
  13. package/dist/ts/components/CMSDashboard.js +21 -0
  14. package/dist/ts/components/CMSDashboard.js.map +1 -0
  15. package/dist/ts/components/CMSLayout.d.ts +2 -0
  16. package/dist/ts/components/CMSLayout.d.ts.map +1 -0
  17. package/dist/ts/components/CMSLayout.js +15 -0
  18. package/dist/ts/components/CMSLayout.js.map +1 -0
  19. package/dist/ts/components/ConlocaLogo.d.ts +2 -0
  20. package/dist/ts/components/ConlocaLogo.d.ts.map +1 -0
  21. package/dist/ts/components/ConlocaLogo.js +5 -0
  22. package/dist/ts/components/ConlocaLogo.js.map +1 -0
  23. package/dist/ts/components/GitStatusPanel.d.ts +21 -0
  24. package/dist/ts/components/GitStatusPanel.d.ts.map +1 -0
  25. package/dist/ts/components/GitStatusPanel.js +74 -0
  26. package/dist/ts/components/GitStatusPanel.js.map +1 -0
  27. package/dist/ts/components/MobileTopBar.d.ts +6 -0
  28. package/dist/ts/components/MobileTopBar.d.ts.map +1 -0
  29. package/dist/ts/components/MobileTopBar.js +7 -0
  30. package/dist/ts/components/MobileTopBar.js.map +1 -0
  31. package/dist/ts/components/Sidebar.d.ts +8 -0
  32. package/dist/ts/components/Sidebar.d.ts.map +1 -0
  33. package/dist/ts/components/Sidebar.js +41 -0
  34. package/dist/ts/components/Sidebar.js.map +1 -0
  35. package/dist/ts/components/UserAvatar.d.ts +2 -0
  36. package/dist/ts/components/UserAvatar.d.ts.map +1 -0
  37. package/dist/ts/components/UserAvatar.js +15 -0
  38. package/dist/ts/components/UserAvatar.js.map +1 -0
  39. package/dist/ts/components/cards/DataEntryCard.d.ts +14 -0
  40. package/dist/ts/components/cards/DataEntryCard.d.ts.map +1 -0
  41. package/dist/ts/components/cards/DataEntryCard.js +39 -0
  42. package/dist/ts/components/cards/DataEntryCard.js.map +1 -0
  43. package/dist/ts/components/cards/SectionCard.d.ts +15 -0
  44. package/dist/ts/components/cards/SectionCard.d.ts.map +1 -0
  45. package/dist/ts/components/cards/SectionCard.js +11 -0
  46. package/dist/ts/components/cards/SectionCard.js.map +1 -0
  47. package/dist/ts/components/cards/index.d.ts +2 -0
  48. package/dist/ts/components/cards/index.d.ts.map +1 -0
  49. package/dist/ts/components/cards/index.js +2 -0
  50. package/dist/ts/components/cards/index.js.map +1 -0
  51. package/dist/ts/components/dashboard/RecentActivity.d.ts +2 -0
  52. package/dist/ts/components/dashboard/RecentActivity.d.ts.map +1 -0
  53. package/dist/ts/components/dashboard/RecentActivity.js +58 -0
  54. package/dist/ts/components/dashboard/RecentActivity.js.map +1 -0
  55. package/dist/ts/components/dialog.d.ts +53 -0
  56. package/dist/ts/components/dialog.d.ts.map +1 -0
  57. package/dist/ts/components/dialog.js +57 -0
  58. package/dist/ts/components/dialog.js.map +1 -0
  59. package/dist/ts/components/dialogs/ConflictDialog.d.ts +10 -0
  60. package/dist/ts/components/dialogs/ConflictDialog.d.ts.map +1 -0
  61. package/dist/ts/components/dialogs/ConflictDialog.js +28 -0
  62. package/dist/ts/components/dialogs/ConflictDialog.js.map +1 -0
  63. package/dist/ts/components/dialogs/CreateDataDialog.d.ts +9 -0
  64. package/dist/ts/components/dialogs/CreateDataDialog.d.ts.map +1 -0
  65. package/dist/ts/components/dialogs/CreateDataDialog.js +21 -0
  66. package/dist/ts/components/dialogs/CreateDataDialog.js.map +1 -0
  67. package/dist/ts/components/dialogs/CreateFolderDialog.d.ts +11 -0
  68. package/dist/ts/components/dialogs/CreateFolderDialog.d.ts.map +1 -0
  69. package/dist/ts/components/dialogs/CreateFolderDialog.js +39 -0
  70. package/dist/ts/components/dialogs/CreateFolderDialog.js.map +1 -0
  71. package/dist/ts/components/dialogs/CreatePageDialog.d.ts +11 -0
  72. package/dist/ts/components/dialogs/CreatePageDialog.d.ts.map +1 -0
  73. package/dist/ts/components/dialogs/CreatePageDialog.js +237 -0
  74. package/dist/ts/components/dialogs/CreatePageDialog.js.map +1 -0
  75. package/dist/ts/components/dialogs/DataPropertiesDialog.d.ts +10 -0
  76. package/dist/ts/components/dialogs/DataPropertiesDialog.d.ts.map +1 -0
  77. package/dist/ts/components/dialogs/DataPropertiesDialog.js +39 -0
  78. package/dist/ts/components/dialogs/DataPropertiesDialog.js.map +1 -0
  79. package/dist/ts/components/dialogs/DeleteConfirmDialog.d.ts +12 -0
  80. package/dist/ts/components/dialogs/DeleteConfirmDialog.d.ts.map +1 -0
  81. package/dist/ts/components/dialogs/DeleteConfirmDialog.js +8 -0
  82. package/dist/ts/components/dialogs/DeleteConfirmDialog.js.map +1 -0
  83. package/dist/ts/components/dialogs/ErrorModal.d.ts +14 -0
  84. package/dist/ts/components/dialogs/ErrorModal.d.ts.map +1 -0
  85. package/dist/ts/components/dialogs/ErrorModal.js +43 -0
  86. package/dist/ts/components/dialogs/ErrorModal.js.map +1 -0
  87. package/dist/ts/components/dialogs/FragmentPropertiesDialog.d.ts +12 -0
  88. package/dist/ts/components/dialogs/FragmentPropertiesDialog.d.ts.map +1 -0
  89. package/dist/ts/components/dialogs/FragmentPropertiesDialog.js +43 -0
  90. package/dist/ts/components/dialogs/FragmentPropertiesDialog.js.map +1 -0
  91. package/dist/ts/components/dialogs/MoveFolderDialog.d.ts +12 -0
  92. package/dist/ts/components/dialogs/MoveFolderDialog.d.ts.map +1 -0
  93. package/dist/ts/components/dialogs/MoveFolderDialog.js +69 -0
  94. package/dist/ts/components/dialogs/MoveFolderDialog.js.map +1 -0
  95. package/dist/ts/components/dialogs/PageMetadataDialog.d.ts +31 -0
  96. package/dist/ts/components/dialogs/PageMetadataDialog.d.ts.map +1 -0
  97. package/dist/ts/components/dialogs/PageMetadataDialog.js +154 -0
  98. package/dist/ts/components/dialogs/PageMetadataDialog.js.map +1 -0
  99. package/dist/ts/components/dialogs/UnsavedChangesDialog.d.ts +8 -0
  100. package/dist/ts/components/dialogs/UnsavedChangesDialog.d.ts.map +1 -0
  101. package/dist/ts/components/dialogs/UnsavedChangesDialog.js +7 -0
  102. package/dist/ts/components/dialogs/UnsavedChangesDialog.js.map +1 -0
  103. package/dist/ts/components/dialogs/index.d.ts +9 -0
  104. package/dist/ts/components/dialogs/index.d.ts.map +1 -0
  105. package/dist/ts/components/dialogs/index.js +9 -0
  106. package/dist/ts/components/dialogs/index.js.map +1 -0
  107. package/dist/ts/components/editor/CMSMDXEditor.d.ts +14 -0
  108. package/dist/ts/components/editor/CMSMDXEditor.d.ts.map +1 -0
  109. package/dist/ts/components/editor/CMSMDXEditor.js +209 -0
  110. package/dist/ts/components/editor/CMSMDXEditor.js.map +1 -0
  111. package/dist/ts/components/editor/ContentDiff.d.ts +10 -0
  112. package/dist/ts/components/editor/ContentDiff.d.ts.map +1 -0
  113. package/dist/ts/components/editor/ContentDiff.js +52 -0
  114. package/dist/ts/components/editor/ContentDiff.js.map +1 -0
  115. package/dist/ts/components/editor/CreateFragmentDialog.d.ts +26 -0
  116. package/dist/ts/components/editor/CreateFragmentDialog.d.ts.map +1 -0
  117. package/dist/ts/components/editor/CreateFragmentDialog.js +159 -0
  118. package/dist/ts/components/editor/CreateFragmentDialog.js.map +1 -0
  119. package/dist/ts/components/editor/DrawerItemOverride.d.ts +8 -0
  120. package/dist/ts/components/editor/DrawerItemOverride.d.ts.map +1 -0
  121. package/dist/ts/components/editor/DrawerItemOverride.js +37 -0
  122. package/dist/ts/components/editor/DrawerItemOverride.js.map +1 -0
  123. package/dist/ts/components/editor/EditorChromeToggles.d.ts +16 -0
  124. package/dist/ts/components/editor/EditorChromeToggles.d.ts.map +1 -0
  125. package/dist/ts/components/editor/EditorChromeToggles.js +17 -0
  126. package/dist/ts/components/editor/EditorChromeToggles.js.map +1 -0
  127. package/dist/ts/components/editor/FragmentEditor.d.ts +15 -0
  128. package/dist/ts/components/editor/FragmentEditor.d.ts.map +1 -0
  129. package/dist/ts/components/editor/FragmentEditor.js +322 -0
  130. package/dist/ts/components/editor/FragmentEditor.js.map +1 -0
  131. package/dist/ts/components/editor/FragmentWrappers.d.ts +20 -0
  132. package/dist/ts/components/editor/FragmentWrappers.d.ts.map +1 -0
  133. package/dist/ts/components/editor/FragmentWrappers.js +44 -0
  134. package/dist/ts/components/editor/FragmentWrappers.js.map +1 -0
  135. package/dist/ts/components/editor/GenericBlock.d.ts +3 -0
  136. package/dist/ts/components/editor/GenericBlock.d.ts.map +1 -0
  137. package/dist/ts/components/editor/GenericBlock.js +1124 -0
  138. package/dist/ts/components/editor/GenericBlock.js.map +1 -0
  139. package/dist/ts/components/editor/ImagePickerDialog.d.ts +6 -0
  140. package/dist/ts/components/editor/ImagePickerDialog.d.ts.map +1 -0
  141. package/dist/ts/components/editor/ImagePickerDialog.js +23 -0
  142. package/dist/ts/components/editor/ImagePickerDialog.js.map +1 -0
  143. package/dist/ts/components/editor/JsxPropsPanel.d.ts +16 -0
  144. package/dist/ts/components/editor/JsxPropsPanel.d.ts.map +1 -0
  145. package/dist/ts/components/editor/JsxPropsPanel.js +146 -0
  146. package/dist/ts/components/editor/JsxPropsPanel.js.map +1 -0
  147. package/dist/ts/components/editor/LocaleSelector.d.ts +9 -0
  148. package/dist/ts/components/editor/LocaleSelector.d.ts.map +1 -0
  149. package/dist/ts/components/editor/LocaleSelector.js +14 -0
  150. package/dist/ts/components/editor/LocaleSelector.js.map +1 -0
  151. package/dist/ts/components/editor/MDXLivePreview.d.ts +15 -0
  152. package/dist/ts/components/editor/MDXLivePreview.d.ts.map +1 -0
  153. package/dist/ts/components/editor/MDXLivePreview.js +111 -0
  154. package/dist/ts/components/editor/MDXLivePreview.js.map +1 -0
  155. package/dist/ts/components/editor/MdxPageEditor.d.ts +10 -0
  156. package/dist/ts/components/editor/MdxPageEditor.d.ts.map +1 -0
  157. package/dist/ts/components/editor/MdxPageEditor.js +353 -0
  158. package/dist/ts/components/editor/MdxPageEditor.js.map +1 -0
  159. package/dist/ts/components/editor/PageEditor.d.ts +54 -0
  160. package/dist/ts/components/editor/PageEditor.d.ts.map +1 -0
  161. package/dist/ts/components/editor/PageEditor.js +399 -0
  162. package/dist/ts/components/editor/PageEditor.js.map +1 -0
  163. package/dist/ts/components/editor/PageEditorHeaderActions.d.ts +22 -0
  164. package/dist/ts/components/editor/PageEditorHeaderActions.d.ts.map +1 -0
  165. package/dist/ts/components/editor/PageEditorHeaderActions.js +24 -0
  166. package/dist/ts/components/editor/PageEditorHeaderActions.js.map +1 -0
  167. package/dist/ts/components/editor/PageEditorWrapper.d.ts +38 -0
  168. package/dist/ts/components/editor/PageEditorWrapper.d.ts.map +1 -0
  169. package/dist/ts/components/editor/PageEditorWrapper.js +360 -0
  170. package/dist/ts/components/editor/PageEditorWrapper.js.map +1 -0
  171. package/dist/ts/components/editor/PuckWithUntouchedMetadata.d.ts +5 -0
  172. package/dist/ts/components/editor/PuckWithUntouchedMetadata.d.ts.map +1 -0
  173. package/dist/ts/components/editor/PuckWithUntouchedMetadata.js +53 -0
  174. package/dist/ts/components/editor/PuckWithUntouchedMetadata.js.map +1 -0
  175. package/dist/ts/components/editor/SearchableSelect.d.ts +34 -0
  176. package/dist/ts/components/editor/SearchableSelect.d.ts.map +1 -0
  177. package/dist/ts/components/editor/SearchableSelect.js +116 -0
  178. package/dist/ts/components/editor/SearchableSelect.js.map +1 -0
  179. package/dist/ts/components/editor/host-wrapper-plugin.d.ts +51 -0
  180. package/dist/ts/components/editor/host-wrapper-plugin.d.ts.map +1 -0
  181. package/dist/ts/components/editor/host-wrapper-plugin.js +38 -0
  182. package/dist/ts/components/editor/host-wrapper-plugin.js.map +1 -0
  183. package/dist/ts/components/editor/index.d.ts +9 -0
  184. package/dist/ts/components/editor/index.d.ts.map +1 -0
  185. package/dist/ts/components/editor/index.js +8 -0
  186. package/dist/ts/components/editor/index.js.map +1 -0
  187. package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.d.ts +15 -0
  188. package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.d.ts.map +1 -0
  189. package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.js +91 -0
  190. package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.js.map +1 -0
  191. package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.d.ts +12 -0
  192. package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.d.ts.map +1 -0
  193. package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.js +107 -0
  194. package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.js.map +1 -0
  195. package/dist/ts/components/editor/insert-menu/insert-payload.d.ts +76 -0
  196. package/dist/ts/components/editor/insert-menu/insert-payload.d.ts.map +1 -0
  197. package/dist/ts/components/editor/insert-menu/insert-payload.js +95 -0
  198. package/dist/ts/components/editor/insert-menu/insert-payload.js.map +1 -0
  199. package/dist/ts/components/editor/insert-menu/mdx-components-plugin.d.ts +8 -0
  200. package/dist/ts/components/editor/insert-menu/mdx-components-plugin.d.ts.map +1 -0
  201. package/dist/ts/components/editor/insert-menu/mdx-components-plugin.js +14 -0
  202. package/dist/ts/components/editor/insert-menu/mdx-components-plugin.js.map +1 -0
  203. package/dist/ts/components/editor/page-setting-targets.d.ts +24 -0
  204. package/dist/ts/components/editor/page-setting-targets.d.ts.map +1 -0
  205. package/dist/ts/components/editor/page-setting-targets.js +124 -0
  206. package/dist/ts/components/editor/page-setting-targets.js.map +1 -0
  207. package/dist/ts/components/editor/preview-availability.d.ts +18 -0
  208. package/dist/ts/components/editor/preview-availability.d.ts.map +1 -0
  209. package/dist/ts/components/editor/preview-availability.js +18 -0
  210. package/dist/ts/components/editor/preview-availability.js.map +1 -0
  211. package/dist/ts/components/editors/DataEditor.d.ts +18 -0
  212. package/dist/ts/components/editors/DataEditor.d.ts.map +1 -0
  213. package/dist/ts/components/editors/DataEditor.js +140 -0
  214. package/dist/ts/components/editors/DataEditor.js.map +1 -0
  215. package/dist/ts/components/fields/ContentFragmentSelectorField.d.ts +14 -0
  216. package/dist/ts/components/fields/ContentFragmentSelectorField.d.ts.map +1 -0
  217. package/dist/ts/components/fields/ContentFragmentSelectorField.js +108 -0
  218. package/dist/ts/components/fields/ContentFragmentSelectorField.js.map +1 -0
  219. package/dist/ts/components/fields/ImageField.d.ts +17 -0
  220. package/dist/ts/components/fields/ImageField.d.ts.map +1 -0
  221. package/dist/ts/components/fields/ImageField.js +39 -0
  222. package/dist/ts/components/fields/ImageField.js.map +1 -0
  223. package/dist/ts/components/fields/MDXEditField.d.ts +17 -0
  224. package/dist/ts/components/fields/MDXEditField.d.ts.map +1 -0
  225. package/dist/ts/components/fields/MDXEditField.js +29 -0
  226. package/dist/ts/components/fields/MDXEditField.js.map +1 -0
  227. package/dist/ts/components/forms/ChipArrayField.d.ts +12 -0
  228. package/dist/ts/components/forms/ChipArrayField.d.ts.map +1 -0
  229. package/dist/ts/components/forms/ChipArrayField.js +39 -0
  230. package/dist/ts/components/forms/ChipArrayField.js.map +1 -0
  231. package/dist/ts/components/forms/HintForm.d.ts +22 -0
  232. package/dist/ts/components/forms/HintForm.d.ts.map +1 -0
  233. package/dist/ts/components/forms/HintForm.js +195 -0
  234. package/dist/ts/components/forms/HintForm.js.map +1 -0
  235. package/dist/ts/components/forms/SchemaForm.d.ts +15 -0
  236. package/dist/ts/components/forms/SchemaForm.d.ts.map +1 -0
  237. package/dist/ts/components/forms/SchemaForm.js +103 -0
  238. package/dist/ts/components/forms/SchemaForm.js.map +1 -0
  239. package/dist/ts/components/index.d.ts +8 -0
  240. package/dist/ts/components/index.d.ts.map +1 -0
  241. package/dist/ts/components/index.js +14 -0
  242. package/dist/ts/components/index.js.map +1 -0
  243. package/dist/ts/components/media/AssetCard.d.ts +14 -0
  244. package/dist/ts/components/media/AssetCard.d.ts.map +1 -0
  245. package/dist/ts/components/media/AssetCard.js +26 -0
  246. package/dist/ts/components/media/AssetCard.js.map +1 -0
  247. package/dist/ts/components/media/AssetDetailSidebar.d.ts +15 -0
  248. package/dist/ts/components/media/AssetDetailSidebar.d.ts.map +1 -0
  249. package/dist/ts/components/media/AssetDetailSidebar.js +122 -0
  250. package/dist/ts/components/media/AssetDetailSidebar.js.map +1 -0
  251. package/dist/ts/components/media/BulkActionBar.d.ts +9 -0
  252. package/dist/ts/components/media/BulkActionBar.d.ts.map +1 -0
  253. package/dist/ts/components/media/BulkActionBar.js +9 -0
  254. package/dist/ts/components/media/BulkActionBar.js.map +1 -0
  255. package/dist/ts/components/media/FolderNav.d.ts +7 -0
  256. package/dist/ts/components/media/FolderNav.d.ts.map +1 -0
  257. package/dist/ts/components/media/FolderNav.js +13 -0
  258. package/dist/ts/components/media/FolderNav.js.map +1 -0
  259. package/dist/ts/components/media/FolderTreeSidebar.d.ts +9 -0
  260. package/dist/ts/components/media/FolderTreeSidebar.d.ts.map +1 -0
  261. package/dist/ts/components/media/FolderTreeSidebar.js +46 -0
  262. package/dist/ts/components/media/FolderTreeSidebar.js.map +1 -0
  263. package/dist/ts/components/media/ImagePicker.d.ts +14 -0
  264. package/dist/ts/components/media/ImagePicker.d.ts.map +1 -0
  265. package/dist/ts/components/media/ImagePicker.js +44 -0
  266. package/dist/ts/components/media/ImagePicker.js.map +1 -0
  267. package/dist/ts/components/media/MediaLibrary.d.ts +31 -0
  268. package/dist/ts/components/media/MediaLibrary.d.ts.map +1 -0
  269. package/dist/ts/components/media/MediaLibrary.js +87 -0
  270. package/dist/ts/components/media/MediaLibrary.js.map +1 -0
  271. package/dist/ts/components/media/MediaToolbar.d.ts +21 -0
  272. package/dist/ts/components/media/MediaToolbar.d.ts.map +1 -0
  273. package/dist/ts/components/media/MediaToolbar.js +7 -0
  274. package/dist/ts/components/media/MediaToolbar.js.map +1 -0
  275. package/dist/ts/components/media/UploadModal.d.ts +9 -0
  276. package/dist/ts/components/media/UploadModal.d.ts.map +1 -0
  277. package/dist/ts/components/media/UploadModal.js +36 -0
  278. package/dist/ts/components/media/UploadModal.js.map +1 -0
  279. package/dist/ts/components/media/index.d.ts +10 -0
  280. package/dist/ts/components/media/index.d.ts.map +1 -0
  281. package/dist/ts/components/media/index.js +10 -0
  282. package/dist/ts/components/media/index.js.map +1 -0
  283. package/dist/ts/components/pages/DataList.d.ts +7 -0
  284. package/dist/ts/components/pages/DataList.d.ts.map +1 -0
  285. package/dist/ts/components/pages/DataList.js +267 -0
  286. package/dist/ts/components/pages/DataList.js.map +1 -0
  287. package/dist/ts/components/pages/FragmentList.d.ts +2 -0
  288. package/dist/ts/components/pages/FragmentList.d.ts.map +1 -0
  289. package/dist/ts/components/pages/FragmentList.js +281 -0
  290. package/dist/ts/components/pages/FragmentList.js.map +1 -0
  291. package/dist/ts/components/pages/MediaPage.d.ts +8 -0
  292. package/dist/ts/components/pages/MediaPage.d.ts.map +1 -0
  293. package/dist/ts/components/pages/MediaPage.js +146 -0
  294. package/dist/ts/components/pages/MediaPage.js.map +1 -0
  295. package/dist/ts/components/pages/PageList.d.ts +7 -0
  296. package/dist/ts/components/pages/PageList.d.ts.map +1 -0
  297. package/dist/ts/components/pages/PageList.js +299 -0
  298. package/dist/ts/components/pages/PageList.js.map +1 -0
  299. package/dist/ts/components/pages/index.d.ts +3 -0
  300. package/dist/ts/components/pages/index.d.ts.map +1 -0
  301. package/dist/ts/components/pages/index.js +3 -0
  302. package/dist/ts/components/pages/index.js.map +1 -0
  303. package/dist/ts/components/puck/MDXContent.d.ts +19 -0
  304. package/dist/ts/components/puck/MDXContent.d.ts.map +1 -0
  305. package/dist/ts/components/puck/MDXContent.js +110 -0
  306. package/dist/ts/components/puck/MDXContent.js.map +1 -0
  307. package/dist/ts/components/puck/index.d.ts +2 -0
  308. package/dist/ts/components/puck/index.d.ts.map +1 -0
  309. package/dist/ts/components/puck/index.js +2 -0
  310. package/dist/ts/components/puck/index.js.map +1 -0
  311. package/dist/ts/components/sandbox/ContentSandbox.d.ts +31 -0
  312. package/dist/ts/components/sandbox/ContentSandbox.d.ts.map +1 -0
  313. package/dist/ts/components/sandbox/ContentSandbox.js +148 -0
  314. package/dist/ts/components/sandbox/ContentSandbox.js.map +1 -0
  315. package/dist/ts/components/sandbox/frame-runtime.d.ts +7 -0
  316. package/dist/ts/components/sandbox/frame-runtime.d.ts.map +1 -0
  317. package/dist/ts/components/sandbox/frame-runtime.js +7 -0
  318. package/dist/ts/components/sandbox/frame-runtime.js.map +1 -0
  319. package/dist/ts/components/toast.d.ts +44 -0
  320. package/dist/ts/components/toast.d.ts.map +1 -0
  321. package/dist/ts/components/toast.js +8 -0
  322. package/dist/ts/components/toast.js.map +1 -0
  323. package/dist/ts/components/ui/Banner.d.ts +76 -0
  324. package/dist/ts/components/ui/Banner.d.ts.map +1 -0
  325. package/dist/ts/components/ui/Banner.js +50 -0
  326. package/dist/ts/components/ui/Banner.js.map +1 -0
  327. package/dist/ts/components/ui/Button.d.ts +25 -0
  328. package/dist/ts/components/ui/Button.d.ts.map +1 -0
  329. package/dist/ts/components/ui/Button.js +34 -0
  330. package/dist/ts/components/ui/Button.js.map +1 -0
  331. package/dist/ts/components/ui/Card.d.ts +72 -0
  332. package/dist/ts/components/ui/Card.d.ts.map +1 -0
  333. package/dist/ts/components/ui/Card.js +50 -0
  334. package/dist/ts/components/ui/Card.js.map +1 -0
  335. package/dist/ts/components/ui/FieldError.d.ts +24 -0
  336. package/dist/ts/components/ui/FieldError.d.ts.map +1 -0
  337. package/dist/ts/components/ui/FieldError.js +18 -0
  338. package/dist/ts/components/ui/FieldError.js.map +1 -0
  339. package/dist/ts/components/ui/IconButton.d.ts +13 -0
  340. package/dist/ts/components/ui/IconButton.d.ts.map +1 -0
  341. package/dist/ts/components/ui/IconButton.js +11 -0
  342. package/dist/ts/components/ui/IconButton.js.map +1 -0
  343. package/dist/ts/components/ui/Input.d.ts +37 -0
  344. package/dist/ts/components/ui/Input.d.ts.map +1 -0
  345. package/dist/ts/components/ui/Input.js +10 -0
  346. package/dist/ts/components/ui/Input.js.map +1 -0
  347. package/dist/ts/components/ui/SaveIndicator.d.ts +8 -0
  348. package/dist/ts/components/ui/SaveIndicator.d.ts.map +1 -0
  349. package/dist/ts/components/ui/SaveIndicator.js +33 -0
  350. package/dist/ts/components/ui/SaveIndicator.js.map +1 -0
  351. package/dist/ts/components/ui/Select.d.ts +8 -0
  352. package/dist/ts/components/ui/Select.d.ts.map +1 -0
  353. package/dist/ts/components/ui/Select.js +10 -0
  354. package/dist/ts/components/ui/Select.js.map +1 -0
  355. package/dist/ts/components/ui/Separator.d.ts +7 -0
  356. package/dist/ts/components/ui/Separator.d.ts.map +1 -0
  357. package/dist/ts/components/ui/Separator.js +9 -0
  358. package/dist/ts/components/ui/Separator.js.map +1 -0
  359. package/dist/ts/components/ui/Textarea.d.ts +8 -0
  360. package/dist/ts/components/ui/Textarea.d.ts.map +1 -0
  361. package/dist/ts/components/ui/Textarea.js +6 -0
  362. package/dist/ts/components/ui/Textarea.js.map +1 -0
  363. package/dist/ts/components/ui/Tooltip.d.ts +9 -0
  364. package/dist/ts/components/ui/Tooltip.d.ts.map +1 -0
  365. package/dist/ts/components/ui/Tooltip.js +6 -0
  366. package/dist/ts/components/ui/Tooltip.js.map +1 -0
  367. package/dist/ts/components/ui/index.d.ts +14 -0
  368. package/dist/ts/components/ui/index.d.ts.map +1 -0
  369. package/dist/ts/components/ui/index.js +18 -0
  370. package/dist/ts/components/ui/index.js.map +1 -0
  371. package/dist/ts/data-schemas.d.ts +36 -0
  372. package/dist/ts/data-schemas.d.ts.map +1 -0
  373. package/dist/ts/data-schemas.js +52 -0
  374. package/dist/ts/data-schemas.js.map +1 -0
  375. package/dist/ts/dev-entry.d.ts +2 -0
  376. package/dist/ts/dev-entry.d.ts.map +1 -0
  377. package/dist/ts/dev-entry.js +23 -0
  378. package/dist/ts/dev-entry.js.map +1 -0
  379. package/dist/ts/editor-flush.d.ts +26 -0
  380. package/dist/ts/editor-flush.d.ts.map +1 -0
  381. package/dist/ts/editor-flush.js +40 -0
  382. package/dist/ts/editor-flush.js.map +1 -0
  383. package/dist/ts/hooks/index.d.ts +10 -0
  384. package/dist/ts/hooks/index.d.ts.map +1 -0
  385. package/dist/ts/hooks/index.js +8 -0
  386. package/dist/ts/hooks/index.js.map +1 -0
  387. package/dist/ts/hooks/useCanvasTheme.d.ts +12 -0
  388. package/dist/ts/hooks/useCanvasTheme.d.ts.map +1 -0
  389. package/dist/ts/hooks/useCanvasTheme.js +34 -0
  390. package/dist/ts/hooks/useCanvasTheme.js.map +1 -0
  391. package/dist/ts/hooks/useClickOutside.d.ts +7 -0
  392. package/dist/ts/hooks/useClickOutside.d.ts.map +1 -0
  393. package/dist/ts/hooks/useClickOutside.js +19 -0
  394. package/dist/ts/hooks/useClickOutside.js.map +1 -0
  395. package/dist/ts/hooks/useDialogState.d.ts +23 -0
  396. package/dist/ts/hooks/useDialogState.d.ts.map +1 -0
  397. package/dist/ts/hooks/useDialogState.js +32 -0
  398. package/dist/ts/hooks/useDialogState.js.map +1 -0
  399. package/dist/ts/hooks/useEditorPref.d.ts +2 -0
  400. package/dist/ts/hooks/useEditorPref.d.ts.map +1 -0
  401. package/dist/ts/hooks/useEditorPref.js +50 -0
  402. package/dist/ts/hooks/useEditorPref.js.map +1 -0
  403. package/dist/ts/hooks/useErrorModal.d.ts +15 -0
  404. package/dist/ts/hooks/useErrorModal.d.ts.map +1 -0
  405. package/dist/ts/hooks/useErrorModal.js +36 -0
  406. package/dist/ts/hooks/useErrorModal.js.map +1 -0
  407. package/dist/ts/hooks/useSiteBaseUrl.d.ts +10 -0
  408. package/dist/ts/hooks/useSiteBaseUrl.d.ts.map +1 -0
  409. package/dist/ts/hooks/useSiteBaseUrl.js +15 -0
  410. package/dist/ts/hooks/useSiteBaseUrl.js.map +1 -0
  411. package/dist/ts/hooks/useTheme.d.ts +12 -0
  412. package/dist/ts/hooks/useTheme.d.ts.map +1 -0
  413. package/dist/ts/hooks/useTheme.js +55 -0
  414. package/dist/ts/hooks/useTheme.js.map +1 -0
  415. package/dist/ts/hooks/useUnsavedChangesGuard.d.ts +16 -0
  416. package/dist/ts/hooks/useUnsavedChangesGuard.d.ts.map +1 -0
  417. package/dist/ts/hooks/useUnsavedChangesGuard.js +30 -0
  418. package/dist/ts/hooks/useUnsavedChangesGuard.js.map +1 -0
  419. package/dist/ts/hooks/useUpload.d.ts +5 -0
  420. package/dist/ts/hooks/useUpload.d.ts.map +1 -0
  421. package/dist/ts/hooks/useUpload.js +15 -0
  422. package/dist/ts/hooks/useUpload.js.map +1 -0
  423. package/dist/ts/hooks/useUploadFlow.d.ts +47 -0
  424. package/dist/ts/hooks/useUploadFlow.d.ts.map +1 -0
  425. package/dist/ts/hooks/useUploadFlow.js +154 -0
  426. package/dist/ts/hooks/useUploadFlow.js.map +1 -0
  427. package/dist/ts/host-discovery.d.ts +40 -0
  428. package/dist/ts/host-discovery.d.ts.map +1 -0
  429. package/dist/ts/host-discovery.js +39 -0
  430. package/dist/ts/host-discovery.js.map +1 -0
  431. package/dist/ts/host-style-probe.d.ts +81 -0
  432. package/dist/ts/host-style-probe.d.ts.map +1 -0
  433. package/dist/ts/host-style-probe.js +638 -0
  434. package/dist/ts/host-style-probe.js.map +1 -0
  435. package/dist/ts/index.d.ts +13 -0
  436. package/dist/ts/index.d.ts.map +1 -0
  437. package/dist/ts/index.js +17 -0
  438. package/dist/ts/index.js.map +1 -0
  439. package/dist/ts/lib/utils.d.ts +13 -0
  440. package/dist/ts/lib/utils.d.ts.map +1 -0
  441. package/dist/ts/lib/utils.js +48 -0
  442. package/dist/ts/lib/utils.js.map +1 -0
  443. package/dist/ts/main-spa.d.ts +8 -0
  444. package/dist/ts/main-spa.d.ts.map +1 -0
  445. package/dist/ts/main-spa.js +58 -0
  446. package/dist/ts/main-spa.js.map +1 -0
  447. package/dist/ts/main.d.ts +2 -0
  448. package/dist/ts/main.d.ts.map +1 -0
  449. package/dist/ts/main.js +16 -0
  450. package/dist/ts/main.js.map +1 -0
  451. package/dist/ts/mdx-components-define.d.ts +185 -0
  452. package/dist/ts/mdx-components-define.d.ts.map +1 -0
  453. package/dist/ts/mdx-components-define.js +140 -0
  454. package/dist/ts/mdx-components-define.js.map +1 -0
  455. package/dist/ts/mdx-components.d.ts +63 -0
  456. package/dist/ts/mdx-components.d.ts.map +1 -0
  457. package/dist/ts/mdx-components.js +129 -0
  458. package/dist/ts/mdx-components.js.map +1 -0
  459. package/dist/ts/media/AssetScopePill.d.ts +30 -0
  460. package/dist/ts/media/AssetScopePill.d.ts.map +1 -0
  461. package/dist/ts/media/AssetScopePill.js +31 -0
  462. package/dist/ts/media/AssetScopePill.js.map +1 -0
  463. package/dist/ts/media/MediaIssueBadge.d.ts +33 -0
  464. package/dist/ts/media/MediaIssueBadge.d.ts.map +1 -0
  465. package/dist/ts/media/MediaIssueBadge.js +55 -0
  466. package/dist/ts/media/MediaIssueBadge.js.map +1 -0
  467. package/dist/ts/media/types.d.ts +108 -0
  468. package/dist/ts/media/types.d.ts.map +1 -0
  469. package/dist/ts/media/types.js +2 -0
  470. package/dist/ts/media/types.js.map +1 -0
  471. package/dist/ts/media/use-asset-scope.d.ts +24 -0
  472. package/dist/ts/media/use-asset-scope.d.ts.map +1 -0
  473. package/dist/ts/media/use-asset-scope.js +57 -0
  474. package/dist/ts/media/use-asset-scope.js.map +1 -0
  475. package/dist/ts/media/use-media-issue.d.ts +24 -0
  476. package/dist/ts/media/use-media-issue.d.ts.map +1 -0
  477. package/dist/ts/media/use-media-issue.js +52 -0
  478. package/dist/ts/media/use-media-issue.js.map +1 -0
  479. package/dist/ts/merge-default-props.d.ts +23 -0
  480. package/dist/ts/merge-default-props.d.ts.map +1 -0
  481. package/dist/ts/merge-default-props.js +51 -0
  482. package/dist/ts/merge-default-props.js.map +1 -0
  483. package/dist/ts/mock-puck-config.d.ts +21 -0
  484. package/dist/ts/mock-puck-config.d.ts.map +1 -0
  485. package/dist/ts/mock-puck-config.js +74 -0
  486. package/dist/ts/mock-puck-config.js.map +1 -0
  487. package/dist/ts/page-schema-define.d.ts +134 -0
  488. package/dist/ts/page-schema-define.d.ts.map +1 -0
  489. package/dist/ts/page-schema-define.js +60 -0
  490. package/dist/ts/page-schema-define.js.map +1 -0
  491. package/dist/ts/page-schemas.d.ts +31 -0
  492. package/dist/ts/page-schemas.d.ts.map +1 -0
  493. package/dist/ts/page-schemas.js +56 -0
  494. package/dist/ts/page-schemas.js.map +1 -0
  495. package/dist/ts/page-setting-attributes.d.ts +27 -0
  496. package/dist/ts/page-setting-attributes.d.ts.map +1 -0
  497. package/dist/ts/page-setting-attributes.js +11 -0
  498. package/dist/ts/page-setting-attributes.js.map +1 -0
  499. package/dist/ts/prose-surface-css.d.ts +92 -0
  500. package/dist/ts/prose-surface-css.d.ts.map +1 -0
  501. package/dist/ts/prose-surface-css.js +349 -0
  502. package/dist/ts/prose-surface-css.js.map +1 -0
  503. package/dist/{puck-config.d.mts → ts/puck-config.d.ts} +11 -14
  504. package/dist/ts/puck-config.d.ts.map +1 -0
  505. package/dist/ts/puck-config.js +51 -0
  506. package/dist/ts/puck-config.js.map +1 -0
  507. package/dist/ts/sandbox-preview-styles.d.ts +63 -0
  508. package/dist/ts/sandbox-preview-styles.d.ts.map +1 -0
  509. package/dist/ts/sandbox-preview-styles.js +169 -0
  510. package/dist/ts/sandbox-preview-styles.js.map +1 -0
  511. package/dist/ts/selected-block.d.ts +61 -0
  512. package/dist/ts/selected-block.d.ts.map +1 -0
  513. package/dist/ts/selected-block.js +65 -0
  514. package/dist/ts/selected-block.js.map +1 -0
  515. package/dist/ts/site-css-layer.d.ts +40 -0
  516. package/dist/ts/site-css-layer.d.ts.map +1 -0
  517. package/dist/ts/site-css-layer.js +110 -0
  518. package/dist/ts/site-css-layer.js.map +1 -0
  519. package/dist/ts/site-styles.d.ts +141 -0
  520. package/dist/ts/site-styles.d.ts.map +1 -0
  521. package/dist/ts/site-styles.js +426 -0
  522. package/dist/ts/site-styles.js.map +1 -0
  523. package/dist/ts/theme.d.ts +46 -0
  524. package/dist/ts/theme.d.ts.map +1 -0
  525. package/dist/ts/theme.js +96 -0
  526. package/dist/ts/theme.js.map +1 -0
  527. package/dist/ts/types.d.ts +58 -0
  528. package/dist/ts/types.d.ts.map +1 -0
  529. package/dist/ts/types.js +2 -0
  530. package/dist/ts/types.js.map +1 -0
  531. package/dist/ts/ui-config.d.ts +249 -0
  532. package/dist/ts/ui-config.d.ts.map +1 -0
  533. package/dist/ts/ui-config.js +142 -0
  534. package/dist/ts/ui-config.js.map +1 -0
  535. package/dist/ts/utils/asset-url.d.ts +9 -0
  536. package/dist/ts/utils/asset-url.d.ts.map +1 -0
  537. package/dist/ts/utils/asset-url.js +19 -0
  538. package/dist/ts/utils/asset-url.js.map +1 -0
  539. package/dist/ts/utils/cn.d.ts +3 -0
  540. package/dist/ts/utils/cn.d.ts.map +1 -0
  541. package/dist/ts/utils/cn.js +6 -0
  542. package/dist/ts/utils/cn.js.map +1 -0
  543. package/dist/ts/utils/content-failure.d.ts +32 -0
  544. package/dist/ts/utils/content-failure.d.ts.map +1 -0
  545. package/dist/ts/utils/content-failure.js +67 -0
  546. package/dist/ts/utils/content-failure.js.map +1 -0
  547. package/dist/ts/utils/entry-meta.d.ts +29 -0
  548. package/dist/ts/utils/entry-meta.d.ts.map +1 -0
  549. package/dist/ts/utils/entry-meta.js +38 -0
  550. package/dist/ts/utils/entry-meta.js.map +1 -0
  551. package/dist/ts/utils/entry-name.d.ts +11 -0
  552. package/dist/ts/utils/entry-name.d.ts.map +1 -0
  553. package/dist/ts/utils/entry-name.js +19 -0
  554. package/dist/ts/utils/entry-name.js.map +1 -0
  555. package/dist/ts/utils/format-date.d.ts +15 -0
  556. package/dist/ts/utils/format-date.d.ts.map +1 -0
  557. package/dist/ts/utils/format-date.js +38 -0
  558. package/dist/ts/utils/format-date.js.map +1 -0
  559. package/dist/ts/utils/mdast-to-html.d.ts +55 -0
  560. package/dist/ts/utils/mdast-to-html.d.ts.map +1 -0
  561. package/dist/ts/utils/mdast-to-html.js +235 -0
  562. package/dist/ts/utils/mdast-to-html.js.map +1 -0
  563. package/dist/ts/utils/mdast-tree.d.ts +104 -0
  564. package/dist/ts/utils/mdast-tree.d.ts.map +1 -0
  565. package/dist/ts/utils/mdast-tree.js +286 -0
  566. package/dist/ts/utils/mdast-tree.js.map +1 -0
  567. package/dist/ts/utils/menu-placement.d.ts +8 -0
  568. package/dist/ts/utils/menu-placement.d.ts.map +1 -0
  569. package/dist/ts/utils/menu-placement.js +10 -0
  570. package/dist/ts/utils/menu-placement.js.map +1 -0
  571. package/dist/ts/utils/pageMetadata.d.ts +80 -0
  572. package/dist/ts/utils/pageMetadata.d.ts.map +1 -0
  573. package/dist/ts/utils/pageMetadata.js +249 -0
  574. package/dist/ts/utils/pageMetadata.js.map +1 -0
  575. package/dist/ts/utils/sanitize-html.d.ts +31 -0
  576. package/dist/ts/utils/sanitize-html.d.ts.map +1 -0
  577. package/dist/ts/utils/sanitize-html.js +84 -0
  578. package/dist/ts/utils/sanitize-html.js.map +1 -0
  579. package/dist/ts/utils/slugify.d.ts +14 -0
  580. package/dist/ts/utils/slugify.d.ts.map +1 -0
  581. package/dist/ts/utils/slugify.js +22 -0
  582. package/dist/ts/utils/slugify.js.map +1 -0
  583. package/dist/ts/utils/zodIntrospect.d.ts +19 -0
  584. package/dist/ts/utils/zodIntrospect.d.ts.map +1 -0
  585. package/dist/ts/utils/zodIntrospect.js +95 -0
  586. package/dist/ts/utils/zodIntrospect.js.map +1 -0
  587. package/dist/ts/write-access.d.ts +48 -0
  588. package/dist/ts/write-access.d.ts.map +1 -0
  589. package/dist/ts/write-access.js +140 -0
  590. package/dist/ts/write-access.js.map +1 -0
  591. package/package.json +217 -57
  592. package/src/App.tsx +78 -0
  593. package/src/CmsSpaApp.tsx +63 -0
  594. package/src/components/CMSDashboard.tsx +118 -0
  595. package/src/components/CMSLayout.tsx +25 -0
  596. package/src/components/ConlocaLogo.tsx +10 -0
  597. package/src/components/GitStatusPanel.tsx +188 -0
  598. package/src/components/MobileTopBar.tsx +22 -0
  599. package/src/components/Sidebar.tsx +146 -0
  600. package/src/components/UserAvatar.tsx +28 -0
  601. package/src/components/cards/DataEntryCard.tsx +163 -0
  602. package/src/components/cards/SectionCard.tsx +103 -0
  603. package/src/components/cards/index.ts +1 -0
  604. package/src/components/dashboard/RecentActivity.tsx +114 -0
  605. package/src/components/dialog.tsx +78 -0
  606. package/src/components/dialogs/ConflictDialog.tsx +139 -0
  607. package/src/components/dialogs/CreateDataDialog.tsx +70 -0
  608. package/src/components/dialogs/CreateFolderDialog.tsx +94 -0
  609. package/src/components/dialogs/CreatePageDialog.tsx +465 -0
  610. package/src/components/dialogs/DataPropertiesDialog.tsx +84 -0
  611. package/src/components/dialogs/DeleteConfirmDialog.tsx +61 -0
  612. package/src/components/dialogs/ErrorModal.tsx +109 -0
  613. package/src/components/dialogs/FragmentPropertiesDialog.tsx +97 -0
  614. package/src/components/dialogs/MoveFolderDialog.tsx +205 -0
  615. package/src/components/dialogs/PageMetadataDialog.tsx +311 -0
  616. package/src/components/dialogs/UnsavedChangesDialog.tsx +43 -0
  617. package/src/components/dialogs/index.ts +8 -0
  618. package/src/components/editor/CMSMDXEditor.tsx +281 -0
  619. package/src/components/editor/ContentDiff.tsx +251 -0
  620. package/src/components/editor/CreateFragmentDialog.tsx +227 -0
  621. package/src/components/editor/DrawerItemOverride.tsx +62 -0
  622. package/src/components/editor/EditorChromeToggles.tsx +35 -0
  623. package/src/components/editor/FragmentEditor.tsx +506 -0
  624. package/src/components/editor/FragmentWrappers.tsx +72 -0
  625. package/src/components/editor/GenericBlock.tsx +1361 -0
  626. package/src/components/editor/ImagePickerDialog.tsx +25 -0
  627. package/src/components/editor/JsxPropsPanel.tsx +293 -0
  628. package/src/components/editor/LocaleSelector.tsx +60 -0
  629. package/src/components/editor/MDXLivePreview.tsx +179 -0
  630. package/src/components/editor/MdxPageEditor.tsx +546 -0
  631. package/src/components/editor/PageEditor.tsx +529 -0
  632. package/src/components/editor/PageEditorHeaderActions.tsx +160 -0
  633. package/src/components/editor/PageEditorWrapper.tsx +502 -0
  634. package/src/components/editor/PuckWithUntouchedMetadata.tsx +65 -0
  635. package/src/components/editor/SearchableSelect.tsx +186 -0
  636. package/src/components/editor/host-wrapper-plugin.ts +91 -0
  637. package/src/components/editor/index.ts +8 -0
  638. package/src/components/editor/insert-menu/InsertMdxComponentButton.tsx +149 -0
  639. package/src/components/editor/insert-menu/SlashMenuPlugin.tsx +152 -0
  640. package/src/components/editor/insert-menu/insert-payload.ts +150 -0
  641. package/src/components/editor/insert-menu/mdx-components-plugin.ts +14 -0
  642. package/src/components/editor/page-setting-targets.tsx +154 -0
  643. package/src/components/editor/preview-availability.ts +20 -0
  644. package/src/components/editors/DataEditor.tsx +270 -0
  645. package/src/components/fields/ContentFragmentSelectorField.tsx +290 -0
  646. package/src/components/fields/ImageField.tsx +75 -0
  647. package/src/components/fields/MDXEditField.tsx +54 -0
  648. package/src/components/forms/ChipArrayField.tsx +81 -0
  649. package/src/components/forms/HintForm.tsx +437 -0
  650. package/src/components/forms/SchemaForm.tsx +307 -0
  651. package/src/components/index.ts +14 -0
  652. package/src/components/media/AssetCard.tsx +84 -0
  653. package/src/components/media/AssetDetailSidebar.tsx +335 -0
  654. package/src/components/media/BulkActionBar.tsx +33 -0
  655. package/src/components/media/FolderNav.tsx +44 -0
  656. package/src/components/media/FolderTreeSidebar.tsx +171 -0
  657. package/src/components/media/ImagePicker.tsx +102 -0
  658. package/src/components/media/MediaLibrary.tsx +183 -0
  659. package/src/components/media/MediaToolbar.tsx +100 -0
  660. package/src/components/media/UploadModal.tsx +266 -0
  661. package/src/components/media/index.ts +9 -0
  662. package/src/components/pages/DataList.tsx +496 -0
  663. package/src/components/pages/FragmentList.tsx +592 -0
  664. package/src/components/pages/MediaPage.tsx +284 -0
  665. package/src/components/pages/PageList.tsx +683 -0
  666. package/src/components/pages/index.ts +2 -0
  667. package/src/components/puck/MDXContent.tsx +199 -0
  668. package/src/components/puck/index.ts +1 -0
  669. package/src/components/sandbox/ContentSandbox.tsx +191 -0
  670. package/src/components/sandbox/frame-runtime.ts +15 -0
  671. package/src/components/toast.tsx +48 -0
  672. package/src/components/ui/Banner.tsx +108 -0
  673. package/src/components/ui/Button.tsx +51 -0
  674. package/src/components/ui/Card.tsx +124 -0
  675. package/src/components/ui/FieldError.tsx +37 -0
  676. package/src/components/ui/IconButton.tsx +40 -0
  677. package/src/components/ui/Input.tsx +66 -0
  678. package/src/components/ui/SaveIndicator.tsx +44 -0
  679. package/src/components/ui/Select.tsx +29 -0
  680. package/src/components/ui/Separator.tsx +14 -0
  681. package/src/components/ui/Textarea.tsx +22 -0
  682. package/src/components/ui/Tooltip.tsx +25 -0
  683. package/src/components/ui/index.ts +18 -0
  684. package/src/data-schemas.ts +82 -0
  685. package/src/dev-entry.tsx +25 -0
  686. package/src/dev.html +36 -0
  687. package/src/editor-flush.ts +47 -0
  688. package/src/hooks/index.ts +22 -0
  689. package/src/hooks/useCanvasTheme.tsx +52 -0
  690. package/src/hooks/useClickOutside.ts +24 -0
  691. package/src/hooks/useDialogState.ts +40 -0
  692. package/src/hooks/useEditorPref.ts +58 -0
  693. package/src/hooks/useErrorModal.tsx +63 -0
  694. package/src/hooks/useSiteBaseUrl.ts +16 -0
  695. package/src/hooks/useTheme.tsx +76 -0
  696. package/src/hooks/useUnsavedChangesGuard.ts +32 -0
  697. package/src/hooks/useUpload.ts +19 -0
  698. package/src/hooks/useUploadFlow.ts +227 -0
  699. package/src/host-discovery.ts +77 -0
  700. package/src/host-style-probe.ts +684 -0
  701. package/src/index.ts +42 -0
  702. package/src/lib/utils.ts +56 -0
  703. package/src/main-spa.tsx +69 -0
  704. package/src/main.css +1095 -0
  705. package/src/main.html +43 -0
  706. package/src/main.tsx +16 -0
  707. package/src/mdx-components-define.ts +296 -0
  708. package/src/mdx-components.ts +154 -0
  709. package/src/media/AssetScopePill.tsx +56 -0
  710. package/src/media/MediaIssueBadge.tsx +86 -0
  711. package/src/media/types.ts +96 -0
  712. package/src/media/use-asset-scope.ts +58 -0
  713. package/src/media/use-media-issue.ts +53 -0
  714. package/src/merge-default-props.ts +58 -0
  715. package/src/mock-puck-config.tsx +115 -0
  716. package/src/page-schema-define.ts +176 -0
  717. package/src/page-schemas.ts +80 -0
  718. package/src/page-setting-attributes.ts +40 -0
  719. package/src/prose-surface-css.ts +359 -0
  720. package/src/puck-config.ts +77 -0
  721. package/src/sandbox-preview-styles.ts +166 -0
  722. package/src/selected-block.ts +121 -0
  723. package/src/site-css-layer.ts +109 -0
  724. package/src/site-styles.ts +524 -0
  725. package/src/theme.ts +102 -0
  726. package/src/types.ts +63 -0
  727. package/src/ui-config.ts +334 -0
  728. package/src/utils/asset-url.ts +22 -0
  729. package/src/utils/cn.ts +6 -0
  730. package/src/utils/content-failure.ts +74 -0
  731. package/src/utils/entry-meta.ts +47 -0
  732. package/src/utils/entry-name.ts +21 -0
  733. package/src/utils/format-date.ts +34 -0
  734. package/src/utils/mdast-to-html.ts +247 -0
  735. package/src/utils/mdast-tree.ts +292 -0
  736. package/src/utils/menu-placement.ts +13 -0
  737. package/src/utils/pageMetadata.ts +285 -0
  738. package/src/utils/sanitize-html.ts +84 -0
  739. package/src/utils/slugify.ts +21 -0
  740. package/src/utils/zodIntrospect.ts +136 -0
  741. package/src/vite-env.d.ts +10 -0
  742. package/src/write-access.ts +147 -0
  743. package/styles/stylesheet.d.ts +6 -0
  744. package/styles/tailwind-theme.css +128 -0
  745. package/dist/data-schemas.d.mts +0 -26
  746. package/dist/data-schemas.d.mts.map +0 -1
  747. package/dist/data-schemas.mjs +0 -52
  748. package/dist/data-schemas.mjs.map +0 -1
  749. package/dist/index.d.mts +0 -125
  750. package/dist/index.d.mts.map +0 -1
  751. package/dist/index.mjs +0 -4
  752. package/dist/main.d.mts +0 -1
  753. package/dist/main.mjs +0 -5687
  754. package/dist/main.mjs.map +0 -1
  755. package/dist/page-schemas.d.mts +0 -26
  756. package/dist/page-schemas.d.mts.map +0 -1
  757. package/dist/page-schemas.mjs +0 -52
  758. package/dist/page-schemas.mjs.map +0 -1
  759. package/dist/puck-C9_F3_cJ.mjs +0 -1589
  760. package/dist/puck-C9_F3_cJ.mjs.map +0 -1
  761. package/dist/puck-config.d.mts.map +0 -1
  762. package/dist/puck-config.mjs +0 -51
  763. package/dist/puck-config.mjs.map +0 -1
  764. package/dist/site-styles.d.mts +0 -41
  765. package/dist/site-styles.d.mts.map +0 -1
  766. package/dist/site-styles.mjs +0 -52
  767. package/dist/site-styles.mjs.map +0 -1
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Lifecycle scope of a media asset when a host app works on
3
+ * branches. cms-spa's renderer-neutral `AssetEntry` (in
4
+ * `content-api/asset-types.ts`) doesn't model this — branch vs
5
+ * published is meaningful only when an asset lives in a working
6
+ * tree separate from the published default branch.
7
+ *
8
+ * A host app surfaces the distinction through
9
+ * `UIConfig.mediaBridge.getAssetScope`. cms-spa's media surfaces
10
+ * (AssetCard, AssetDetailSidebar) paint a "Branch only" /
11
+ * "Published" pill based on the bridge's reply. When no bridge is
12
+ * installed (local Astro dev, astro-cms standalone), the pill is
13
+ * hidden — surfaces render exactly as they did before.
14
+ *
15
+ * - `branch` — exists only on this branch's working tree. The
16
+ * published site cannot see it until it is published.
17
+ * - `published` — on the site's default branch and visible from
18
+ * every branch.
19
+ */
20
+ export type AssetScope = 'branch' | 'published';
21
+
22
+ /**
23
+ * Standing media issue a host app reports alongside the
24
+ * `AssetScope` pill. Distinct from the outcome of a single call:
25
+ * an issue here is a property OF the asset that persists until
26
+ * the user resolves it.
27
+ *
28
+ * cms-spa's renderer-neutral asset model doesn't carry these
29
+ * fields because astro-cms on its own has no notion of them —
30
+ * they're host state a host app exposes through
31
+ * `UIConfig.mediaBridge.getMediaIssue`.
32
+ *
33
+ * - `oversized` — the host says the file is over its size limit.
34
+ * The asset is still served. Surface paints an amber warning.
35
+ * - `blocked` — the host is holding the content back, for the
36
+ * given `reason`. Surface paints a red error with that reason.
37
+ *
38
+ * Both variants carry `filename` so flat lists are self-joinable
39
+ * to the user's dirty page set without a second lookup.
40
+ */
41
+ export type MediaIssue =
42
+ | { kind: 'oversized'; filename: string; sizeBytes: number; limitBytes: number }
43
+ | { kind: 'blocked'; filename: string; reason: string };
44
+
45
+ /**
46
+ * Bridge cms-spa uses to read host-supplied metadata about media
47
+ * assets that cms-spa's renderer-neutral model doesn't carry.
48
+ * Installed by a host app via `UIConfig.mediaBridge` before
49
+ * rendering `<CmsSpaApp />`; cms-spa never reaches into the host
50
+ * app's own client directly.
51
+ *
52
+ * The bridge is optional in `UIConfig` — absence means "no host
53
+ * wiring," in which case cms-spa surfaces degrade cleanly (no
54
+ * scope pill, no host-side hooks fire).
55
+ */
56
+ export interface MediaBridge {
57
+ /**
58
+ * Resolve the lifecycle scope of a single asset. Called by
59
+ * AssetCard / AssetDetailSidebar whenever they need to render
60
+ * the scope pill. Returns `null` when the host has no opinion
61
+ * (asset unknown to the host, pre-bootstrap state, or no host
62
+ * app at all); the surface treats `null` the same as
63
+ * "no bridge" — pill hidden.
64
+ *
65
+ * `folder` tells same-named assets in different folders apart, so
66
+ * a subfolder asset never borrows a root asset's scope. Optional
67
+ * for backward compatibility (absent ⇒ root); consumers pass the
68
+ * asset's own folder.
69
+ *
70
+ * The host is responsible for caching: cms-spa calls this
71
+ * synchronously-from-the-surface's-POV via TanStack so
72
+ * repeated renders don't refetch. A host app typically wraps
73
+ * its own lookup in a cached query so the resolved scope is
74
+ * memoised.
75
+ */
76
+ getAssetScope(input: { filename: string; folder?: string }): Promise<AssetScope | null>;
77
+ /**
78
+ * Resolve the standing media issue for a single asset, or `null`
79
+ * when the asset is healthy. Called by AssetCard /
80
+ * AssetDetailSidebar whenever they paint the per-asset
81
+ * error/warning badge.
82
+ *
83
+ * `folder` tells same-named assets apart the same way
84
+ * `getAssetScope` does, so an issue with `uploads/hero.jpg`
85
+ * never badges a root `hero.jpg`. Optional (absent ⇒ root).
86
+ *
87
+ * Returns `null` for the same reasons as `getAssetScope`: host
88
+ * has no opinion (asset unknown, pre-bootstrap state, no host
89
+ * app). Surfaces treat `null` the same as "no bridge" — badge
90
+ * hidden, `AssetEntry` rendered unchanged.
91
+ *
92
+ * The host caches the lookup so cms-spa's `useMediaIssue` wrapper
93
+ * doesn't have to think about per-asset cache windows.
94
+ */
95
+ getMediaIssue(input: { filename: string; folder?: string }): Promise<MediaIssue | null>;
96
+ }
@@ -0,0 +1,58 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { getUIConfig } from '../ui-config.js';
3
+ import type { AssetScope } from './types.js';
4
+
5
+ /**
6
+ * Cache-key namespace for per-asset scope lookups. Keyed by
7
+ * filename — the host app owns the branch scoping behind the
8
+ * bridge, so cms-spa sees a flat "which filename?" surface and the
9
+ * bridge resolves it for the current site and branch.
10
+ *
11
+ * When the user switches branches, the host app invalidates this
12
+ * whole prefix (`['asset-scope']`) so stale scope answers don't
13
+ * leak across the boundary.
14
+ */
15
+ const ASSET_SCOPE_QUERY_KEY_PREFIX = ['asset-scope'] as const;
16
+
17
+ /**
18
+ * Resolve the host-supplied lifecycle scope of a single asset.
19
+ *
20
+ * Returns `null` when:
21
+ *
22
+ * - No `mediaBridge` is configured (cms-spa running standalone /
23
+ * astro-cms / local dev) — the surface knows "the host has no
24
+ * opinion" and hides the scope pill.
25
+ * - The bridge resolves to `null` (asset unknown to the host or
26
+ * pre-bootstrap state).
27
+ *
28
+ * The pill is only rendered when this returns `'branch'` or
29
+ * `'published'`. Loading state is also treated as `null` for the
30
+ * caller's purposes — a flashing pill on first paint reads worse
31
+ * than no pill, and the scope is metadata, not primary content.
32
+ *
33
+ * A host app's bridge typically wraps its own lookup so the actual
34
+ * fetch is cached one level deeper. From cms-spa's POV this is just
35
+ * a lookup; the TanStack wrapper here is so repeat AssetCard renders
36
+ * don't re-call the bridge for the same filename.
37
+ */
38
+ export function useAssetScope(filename: string | undefined, folder?: string): AssetScope | null {
39
+ const query = useQuery<AssetScope | null>({
40
+ // Folder is part of the key so same-named assets in different folders
41
+ // cache (and invalidate) independently; the `['asset-scope']` prefix
42
+ // invalidation still catches every entry.
43
+ queryKey: [...ASSET_SCOPE_QUERY_KEY_PREFIX, filename ?? '', folder ?? ''],
44
+ queryFn: async () => {
45
+ const bridge = getUIConfig().mediaBridge;
46
+ if (!bridge || !filename) return null;
47
+ return bridge.getAssetScope({ filename, folder });
48
+ },
49
+ // Per-filename scope is stable for the lifetime of a branch
50
+ // session — only publishing the asset changes it, and the host
51
+ // app invalidates the prefix when that succeeds. 5 minutes
52
+ // matches the cms-spa default staleTime so the surface doesn't
53
+ // have to think about cache windows.
54
+ staleTime: 1000 * 60 * 5,
55
+ enabled: Boolean(filename),
56
+ });
57
+ return query.data ?? null;
58
+ }
@@ -0,0 +1,53 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { getUIConfig } from '../ui-config.js';
3
+ import type { MediaIssue } from './types.js';
4
+
5
+ /**
6
+ * Cache-key namespace for per-asset issue lookups. Mirrors the
7
+ * `['asset-scope']` prefix used by `useAssetScope` — a host app
8
+ * invalidates this whole prefix when the site or branch changes and
9
+ * after it publishes assets, so stale entries don't leak.
10
+ */
11
+ const MEDIA_ISSUE_QUERY_KEY_PREFIX = ['media-issue'] as const;
12
+
13
+ /**
14
+ * Resolve the host-supplied standing media issue for a single asset.
15
+ *
16
+ * Returns `null` when:
17
+ *
18
+ * - No `mediaBridge` is configured (cms-spa standalone, astro-cms,
19
+ * local dev) — the surface knows "the host has no opinion" and
20
+ * hides the issue badge.
21
+ * - The bridge resolves to `null` (asset healthy, unknown to the
22
+ * host, or pre-bootstrap state).
23
+ *
24
+ * The badge is only rendered when this returns a real issue. Loading
25
+ * state is treated as `null` for the caller's purposes — a flashing
26
+ * badge on first paint reads worse than no badge, and issue state is
27
+ * metadata, not primary content.
28
+ *
29
+ * Mirrors the `useAssetScope` discipline: cms-spa stays a thin
30
+ * consumer of `getUIConfig().mediaBridge`; a host app's bridge
31
+ * typically wraps its own lookup in a cached query so the cache is
32
+ * hit one level deeper.
33
+ */
34
+ export function useMediaIssue(filename: string | undefined, folder?: string): MediaIssue | null {
35
+ const query = useQuery<MediaIssue | null>({
36
+ // Folder is part of the key so a block on one folder's asset never shows
37
+ // on a same-named asset elsewhere; the `['media-issue']` prefix
38
+ // invalidation still catches every entry.
39
+ queryKey: [...MEDIA_ISSUE_QUERY_KEY_PREFIX, filename ?? '', folder ?? ''],
40
+ queryFn: async () => {
41
+ const bridge = getUIConfig().mediaBridge;
42
+ if (!bridge || !filename) return null;
43
+ return bridge.getMediaIssue({ filename, folder });
44
+ },
45
+ // Per-filename issues are stable for the lifetime of a branch
46
+ // session — only a change on the host's side moves them, and the
47
+ // host invalidates the prefix when it does. 5 minutes matches the
48
+ // cms-spa default staleTime, same as `useAssetScope`.
49
+ staleTime: 1000 * 60 * 5,
50
+ enabled: Boolean(filename),
51
+ });
52
+ return query.data ?? null;
53
+ }
@@ -0,0 +1,58 @@
1
+ import type { ComponentData, ComponentDataOptionalId, Config, Data } from '@puckeditor/core';
2
+
3
+ /**
4
+ * Layer each block's `defaultProps` under the sparse props Puck stored, so a
5
+ * page reads the same in the editor and on the published page. Puck saves only
6
+ * the props an author changed and its published render applies no defaults;
7
+ * without this, a field added to a block after a page was saved renders
8
+ * undefined, and a select or radio field shows its first option instead of
9
+ * the real default.
10
+ *
11
+ * Blocks inside a slot are merged too, top-down, and a slot the page never
12
+ * stored is seeded from its block's defaults, so a block whose default slot
13
+ * holds child blocks shows them before the page is first saved. A slot child
14
+ * without an id gets one made from its parent's id, the slot name and its
15
+ * position: stable, so every read of the same page agrees, and free of ':',
16
+ * which Puck splits zone keys on.
17
+ *
18
+ * Like Puck's own slot defaults, only a block's top-level slot fields are
19
+ * walked. The merge is shallow, so a field added inside an array item type
20
+ * (e.g. `linkTarget` on a card list) is not backfilled into saved items —
21
+ * renders must handle `undefined` for any array item field older content lacks.
22
+ */
23
+ export function mergeDefaultProps(data: Data, config: Config): Data {
24
+ if (!data?.content || !config?.components) return data;
25
+
26
+ const mergeComponentProps = (item: ComponentData): ComponentData => {
27
+ const componentConfig = config.components[item.type];
28
+ if (!componentConfig) return item;
29
+
30
+ const props = { ...componentConfig.defaultProps, ...item.props };
31
+ for (const [slotName, field] of Object.entries(componentConfig.fields ?? {})) {
32
+ const children: unknown = props[slotName];
33
+ if (field.type !== 'slot' || !Array.isArray(children)) continue;
34
+
35
+ props[slotName] = children.map((child: ComponentDataOptionalId, index) =>
36
+ mergeComponentProps({ ...child, props: { id: `${props.id}-${slotName}-${index}`, ...child.props } }),
37
+ );
38
+ }
39
+
40
+ return { ...item, props };
41
+ };
42
+
43
+ const mergedContent = data.content.map(mergeComponentProps);
44
+
45
+ let mergedZones = data.zones;
46
+ if (data.zones) {
47
+ mergedZones = {};
48
+ for (const [zoneKey, zoneContent] of Object.entries(data.zones)) {
49
+ mergedZones[zoneKey] = zoneContent.map(mergeComponentProps);
50
+ }
51
+ }
52
+
53
+ return {
54
+ ...data,
55
+ content: mergedContent,
56
+ ...(mergedZones && { zones: mergedZones }),
57
+ };
58
+ }
@@ -0,0 +1,115 @@
1
+ import type { Config } from '@puckeditor/core';
2
+
3
+ // Define component props types for mock components
4
+ type MockComponents = {
5
+ Hero: {
6
+ title: string;
7
+ subtitle: string;
8
+ backgroundImage?: string;
9
+ ctaText: string;
10
+ ctaLink: string;
11
+ };
12
+ Text: {
13
+ text: string;
14
+ align: 'left' | 'center' | 'right';
15
+ };
16
+ Button: {
17
+ text: string;
18
+ href: string;
19
+ };
20
+ };
21
+
22
+ export const mockPuckConfig: Config<MockComponents> = {
23
+ components: {
24
+ Hero: {
25
+ fields: {
26
+ title: { type: 'text' },
27
+ subtitle: { type: 'text' },
28
+ backgroundImage: { type: 'text', label: 'Background Image URL' },
29
+ ctaText: { type: 'text', label: 'CTA Button Text' },
30
+ ctaLink: { type: 'text', label: 'CTA Button Link' },
31
+ },
32
+ defaultProps: {
33
+ title: 'Welcome to Our Site',
34
+ subtitle: 'Build amazing experiences',
35
+ ctaText: 'Get Started',
36
+ ctaLink: '/signup',
37
+ },
38
+ render: ({ title, subtitle, backgroundImage, ctaText, ctaLink }) => (
39
+ <div
40
+ style={{
41
+ padding: '80px 20px',
42
+ textAlign: 'center',
43
+ background: backgroundImage
44
+ ? `url(${backgroundImage}) center/cover`
45
+ : 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
46
+ color: 'white',
47
+ }}
48
+ >
49
+ <h1 style={{ fontSize: '3rem', marginBottom: '1rem' }}>{title}</h1>
50
+ <p style={{ fontSize: '1.5rem', marginBottom: '2rem' }}>{subtitle}</p>
51
+ <a
52
+ href={ctaLink}
53
+ style={{
54
+ display: 'inline-block',
55
+ padding: '12px 24px',
56
+ background: 'white',
57
+ color: '#667eea',
58
+ borderRadius: '6px',
59
+ textDecoration: 'none',
60
+ fontWeight: 'bold',
61
+ }}
62
+ >
63
+ {ctaText}
64
+ </a>
65
+ </div>
66
+ ),
67
+ },
68
+
69
+ Text: {
70
+ fields: {
71
+ text: { type: 'textarea' },
72
+ align: {
73
+ type: 'select',
74
+ options: [
75
+ { label: 'Left', value: 'left' },
76
+ { label: 'Center', value: 'center' },
77
+ { label: 'Right', value: 'right' },
78
+ ],
79
+ },
80
+ },
81
+ defaultProps: {
82
+ text: 'Enter your text here',
83
+ align: 'left',
84
+ },
85
+ render: ({ text, align }) => <p style={{ textAlign: align }}>{text}</p>,
86
+ },
87
+
88
+ Button: {
89
+ fields: {
90
+ text: { type: 'text' },
91
+ href: { type: 'text', label: 'Link URL' },
92
+ },
93
+ defaultProps: {
94
+ text: 'Click me',
95
+ href: '#',
96
+ },
97
+ render: ({ text, href }) => (
98
+ <a
99
+ href={href}
100
+ style={{
101
+ display: 'inline-block',
102
+ padding: '12px 24px',
103
+ background: '#3b82f6',
104
+ color: 'white',
105
+ borderRadius: '6px',
106
+ textDecoration: 'none',
107
+ fontWeight: 'bold',
108
+ }}
109
+ >
110
+ {text}
111
+ </a>
112
+ ),
113
+ },
114
+ },
115
+ };
@@ -0,0 +1,176 @@
1
+ import type { z } from 'zod';
2
+
3
+ /**
4
+ * Form-UI hint vocabulary for page metadata fields.
5
+ *
6
+ * Hosts attach a hint to each field they want surfaced in the page-settings
7
+ * dialog. The hint drives form rendering — control type, grouping, helper
8
+ * text, etc. — independently of the Zod schema, which still owns validation.
9
+ *
10
+ * Dotted keys ('sidebar.label') are supported in the hint record; on save
11
+ * they materialize into nested objects in YAML frontmatter, and on load
12
+ * they flatten back to dotted keys for the form.
13
+ */
14
+ export type FieldHintCommon = {
15
+ label?: string;
16
+ help?: string;
17
+ /** Refs a `groups[].id` to bucket fields into sections in the dialog. */
18
+ group?: string;
19
+ required?: boolean;
20
+ hidden?: boolean | ((doc: Record<string, unknown>) => boolean);
21
+ defaultValue?: unknown;
22
+ };
23
+
24
+ export type FieldHintVariant = {
25
+ id: string;
26
+ label: string;
27
+ /** Concrete value written when this variant is selected (for literal variants). */
28
+ value?: unknown;
29
+ } & Partial<FieldHint>;
30
+
31
+ export type FieldHint = FieldHintCommon &
32
+ (
33
+ | {
34
+ control: 'text' | 'textarea' | 'url' | 'email' | 'number' | 'switch' | 'date' | 'image' | 'markdown' | 'code';
35
+ }
36
+ | { control: 'select'; options: ReadonlyArray<{ value: string; label: string }> }
37
+ | { control: 'chips' }
38
+ | { control: 'object'; fields: Record<string, FieldHint> }
39
+ | { control: 'array'; of: FieldHint }
40
+ | { control: 'variant'; variants: ReadonlyArray<FieldHintVariant> }
41
+ );
42
+
43
+ export type FieldHints = Record<string, FieldHint>;
44
+
45
+ export type PageSchemaGroup = {
46
+ id: string;
47
+ label: string;
48
+ description?: string;
49
+ };
50
+
51
+ /**
52
+ * Which conloca-managed sections to render alongside the host schema.
53
+ *
54
+ * - `'full'` (default): show the title and pathname fields +
55
+ * host fields + `seoPublishingSchema` (description/robots/canonical/
56
+ * publishAt/unpublishAt). Backwards-compatible with existing dialogs.
57
+ * - `'minimal'`: show pathname only + host fields + publishAt/unpublishAt.
58
+ * Use when the host owns title/description in its own schema.
59
+ * - `'none'`: host fields only. Host must declare `title` in its schema
60
+ * (validated at registration; ContentMeta.title is required at the
61
+ * content-api level).
62
+ */
63
+ export type CoreFieldsMode = 'full' | 'minimal' | 'none';
64
+
65
+ export interface PageSchemaDescriptor<S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>> {
66
+ /** Human-readable label shown in the dialog header. */
67
+ label?: string;
68
+ /** Zod schema used for validation and field-shape introspection. */
69
+ schema: S;
70
+ /** Form-UI hints keyed by field name (dotted keys allowed for nested fields). */
71
+ ui?: FieldHints;
72
+ /** Section definitions; `FieldHint.group` references `id`. */
73
+ groups?: ReadonlyArray<PageSchemaGroup>;
74
+ /** Which conloca core fields to render alongside the host schema. */
75
+ coreFields?: { mode: CoreFieldsMode };
76
+ }
77
+
78
+ /**
79
+ * Identity helper that gives `pageSchemas` entries a typed shape.
80
+ *
81
+ * Mirrors Astro's `defineConfig` — purely for editor inference. The schema's
82
+ * concrete type is carried through the descriptor (not widened), so a host
83
+ * can recover its metadata type from `z.infer<typeof descriptor.schema>`.
84
+ *
85
+ * Import this from `@conloca/astro-cms/page-schemas` in a content config so
86
+ * the MDX editor / React registry is not pulled into Astro's content layer.
87
+ */
88
+ export function definePageSchema<S extends z.ZodObject<z.ZodRawShape>>(
89
+ descriptor: PageSchemaDescriptor<S>,
90
+ ): PageSchemaDescriptor<S> {
91
+ if (descriptor.coreFields?.mode === 'none' && !('title' in descriptor.schema.shape)) {
92
+ throw new Error(
93
+ "definePageSchema: coreFields.mode 'none' requires the schema to declare a `title` field " +
94
+ '(ContentMeta.title is required by the content-api).',
95
+ );
96
+ }
97
+ return descriptor;
98
+ }
99
+
100
+ /**
101
+ * Registry entry value: either a bare Zod object (legacy — wrapped as a
102
+ * descriptor with `coreFields.mode: 'full'`) or an explicit descriptor.
103
+ */
104
+ export type PageSchemaEntry = z.ZodObject<z.ZodRawShape> | PageSchemaDescriptor;
105
+
106
+ /**
107
+ * Page-schema registry keyed by match expression.
108
+ *
109
+ * Match key forms (resolved in order):
110
+ * - `collection:<name>` — matches when the loaded entry's collection equals `<name>`.
111
+ * - `type:<puck|mdx>` — matches all pages of the given content type.
112
+ * - pathname prefix (must start with `/`) — longest-prefix-match against the page's pathname.
113
+ */
114
+ export type PageSchemas = Record<string, PageSchemaEntry>;
115
+
116
+ /**
117
+ * Normalize an entry to a descriptor. Bare Zod objects (legacy) get wrapped
118
+ * with default `coreFields.mode: 'full'` so the dialog can render today's
119
+ * three-section layout unchanged.
120
+ */
121
+ export function toPageSchemaDescriptor(entry: PageSchemaEntry): PageSchemaDescriptor {
122
+ if (isPageSchemaDescriptor(entry)) return entry;
123
+ return { schema: entry, coreFields: { mode: 'full' } };
124
+ }
125
+
126
+ function isPageSchemaDescriptor(value: PageSchemaEntry): value is PageSchemaDescriptor {
127
+ return typeof value === 'object' && value !== null && 'schema' in value && !('shape' in value);
128
+ }
129
+
130
+ /**
131
+ * Context the resolver needs to pick the right schema.
132
+ *
133
+ * - `collection` and `type` come from the loaded entry's `ContentIdentity`.
134
+ * - `pathname` comes from the page's `LocaleVersion`.
135
+ */
136
+ export interface ResolveSchemaContext {
137
+ pathname: string;
138
+ collection?: string;
139
+ type?: 'puck' | 'mdx';
140
+ }
141
+
142
+ /**
143
+ * Resolve the best-matching descriptor for a page.
144
+ *
145
+ * Resolution order: `collection:<name>` > `type:<puck|mdx>` >
146
+ * pathname-prefix (longest match wins). Returns `null` if no key matches.
147
+ */
148
+ export function resolvePageSchemaEntry(
149
+ schemas: PageSchemas,
150
+ context: ResolveSchemaContext,
151
+ ): { key: string; descriptor: PageSchemaDescriptor } | null {
152
+ if (context.collection) {
153
+ const key = `collection:${context.collection}`;
154
+ if (key in schemas) return { key, descriptor: toPageSchemaDescriptor(schemas[key]) };
155
+ }
156
+
157
+ if (context.type) {
158
+ const key = `type:${context.type}`;
159
+ if (key in schemas) return { key, descriptor: toPageSchemaDescriptor(schemas[key]) };
160
+ }
161
+
162
+ let bestPrefix: string | null = null;
163
+ for (const key of Object.keys(schemas)) {
164
+ if (!key.startsWith('/')) continue;
165
+ if (context.pathname.startsWith(key) && (!bestPrefix || key.length > bestPrefix.length)) {
166
+ bestPrefix = key;
167
+ }
168
+ }
169
+ if (bestPrefix) return { key: bestPrefix, descriptor: toPageSchemaDescriptor(schemas[bestPrefix]) };
170
+
171
+ return null;
172
+ }
173
+
174
+ // The data-collection registry type, re-exported so content configs can
175
+ // reference it without touching the runtime data-schemas module.
176
+ export type { DataSchemas } from './data-schemas.js';
@@ -0,0 +1,80 @@
1
+ import { useEffect, useState } from 'react';
2
+ import type { PageSchemas } from './page-schema-define.js';
3
+
4
+ // The declaration surface (types, definePageSchema, the resolver) lives in
5
+ // page-schema-define — editor-free so content configs and bare test runners
6
+ // can evaluate it. Re-exported here so existing importers keep working.
7
+ export * from './page-schema-define.js';
8
+
9
+ /**
10
+ * Shared state for page schemas across module instances.
11
+ * Uses window to ensure virtual modules and bundled code share the same state.
12
+ */
13
+ interface SharedPageSchemaState {
14
+ schemas: PageSchemas;
15
+ subscribers: Set<(schemas: PageSchemas) => void>;
16
+ }
17
+
18
+ declare global {
19
+ interface Window {
20
+ __PAGE_SCHEMAS_STATE__?: SharedPageSchemaState;
21
+ }
22
+ }
23
+
24
+ const getSharedState = (): SharedPageSchemaState => {
25
+ if (typeof window !== 'undefined') {
26
+ if (!window.__PAGE_SCHEMAS_STATE__) {
27
+ window.__PAGE_SCHEMAS_STATE__ = {
28
+ schemas: {},
29
+ subscribers: new Set(),
30
+ };
31
+ }
32
+ return window.__PAGE_SCHEMAS_STATE__;
33
+ }
34
+ // SSR fallback
35
+ return { schemas: {}, subscribers: new Set() };
36
+ };
37
+
38
+ /**
39
+ * Set the page schemas for all match keys.
40
+ * Called by the virtual module that loads user's schema definitions.
41
+ * Notifies all subscribers of the change (enables HMR).
42
+ */
43
+ export function setPageSchemas(schemas: PageSchemas): void {
44
+ const state = getSharedState();
45
+ state.schemas = schemas;
46
+ state.subscribers.forEach((fn) => {
47
+ fn(schemas);
48
+ });
49
+ }
50
+
51
+ /**
52
+ * Get the current page schemas synchronously.
53
+ */
54
+ export function getPageSchemas(): PageSchemas {
55
+ return getSharedState().schemas;
56
+ }
57
+
58
+ /**
59
+ * React hook to subscribe to page schema changes.
60
+ * Returns the current schemas and updates when they change (HMR support).
61
+ */
62
+ export function usePageSchemas(): PageSchemas {
63
+ const [schemas, setSchemas] = useState(() => getSharedState().schemas);
64
+
65
+ useEffect(() => {
66
+ const state = getSharedState();
67
+
68
+ // Update immediately in case schemas changed between render and effect
69
+ if (state.schemas !== schemas) {
70
+ setSchemas(state.schemas);
71
+ }
72
+
73
+ state.subscribers.add(setSchemas);
74
+ return () => {
75
+ state.subscribers.delete(setSchemas);
76
+ };
77
+ }, [schemas]);
78
+
79
+ return schemas;
80
+ }
@@ -0,0 +1,40 @@
1
+ import type { HostPageMeta } from '@conloca/content-api-client';
2
+
3
+ /** Marks an element on the editor canvas as showing one of the page's settings. */
4
+ export const PAGE_SETTING_ATTRIBUTE = 'data-conloca-page-setting';
5
+
6
+ /**
7
+ * The fields Page settings renders for every page, whatever the site declares.
8
+ * PageMetadataDialog proves at compile time that this is exactly its core fields.
9
+ */
10
+ export type CorePageSettingName =
11
+ | 'canonical'
12
+ | 'description'
13
+ | 'pathname'
14
+ | 'publishAt'
15
+ | 'robots'
16
+ | 'title'
17
+ | 'unpublishAt';
18
+
19
+ /** The keys a type declares, without a catch-all index signature. */
20
+ type DeclaredKeys<T> = keyof { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K] };
21
+
22
+ /** A page setting a block can show: a core field, or one the site declares on `HostPageMeta` through its page schemas. */
23
+ // oxlint-disable-next-line typescript/no-redundant-type-constituents -- HostPageMeta is deliberately empty here; downstream sites add keys through module augmentation.
24
+ export type PageSettingName = CorePageSettingName | Extract<DeclaredKeys<HostPageMeta>, string>;
25
+
26
+ export interface PageSettingAttributes {
27
+ readonly 'data-conloca-page-setting'?: PageSettingName;
28
+ }
29
+
30
+ /**
31
+ * Attributes for an element a block renders from one of the page's settings rather than its own props.
32
+ * On the editor canvas they mark the element, so a click opens Page settings at that field; everywhere
33
+ * else (the published page, a preview, a hydrated block without `puck`) they are empty, so the markup is unchanged.
34
+ */
35
+ export function pageSettingAttributes(
36
+ puck: { readonly isEditing: boolean } | undefined,
37
+ name: PageSettingName,
38
+ ): PageSettingAttributes {
39
+ return puck?.isEditing ? { [PAGE_SETTING_ATTRIBUTE]: name } : {};
40
+ }