@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,129 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { isJsxDescriptor } from './mdx-components-define.js';
3
+ // The declaration surface (types, defineMdxComponents, the attribute
4
+ // helpers) lives in mdx-components-define — editor-free so content configs
5
+ // and bare test runners can evaluate it. Re-exported here so existing
6
+ // importers of this module keep working unchanged.
7
+ export * from './mdx-components-define.js';
8
+ /**
9
+ * Translate a JSX-flavored plugin descriptor to the upstream
10
+ * `JsxComponentDescriptor` shape that `@mdxeditor/editor` consumes.
11
+ * Booleans surface as expressions (`{true}`) because the upstream
12
+ * `JsxPropertyDescriptor.type` is `'string' | 'number' | 'expression'`.
13
+ *
14
+ * The fallback editor is injected by the CMS editor entrypoint. Keeping that
15
+ * dependency one-way prevents the registry module from importing GenericBlock,
16
+ * which itself consumes this registry.
17
+ *
18
+ * Snippet descriptors are not JSX — call sites filter them out before
19
+ * dispatching here. Passing one throws to surface the misuse loudly.
20
+ */
21
+ export function toJsxComponentDescriptor(d, fallbackEditor) {
22
+ if (!isJsxDescriptor(d)) {
23
+ throw new Error(`toJsxComponentDescriptor: '${d.name}' is a snippet, not a JSX component.`);
24
+ }
25
+ return {
26
+ name: d.name,
27
+ kind: d.kind,
28
+ props: (d.props ?? []).map((p) => ({
29
+ name: p.name,
30
+ type: p.type === 'boolean' ? 'expression' : p.type,
31
+ required: p.required,
32
+ })),
33
+ hasChildren: d.hasChildren,
34
+ Editor: d.Editor ?? fallbackEditor,
35
+ ...(d.import ? { source: d.import.from, defaultExport: d.import.default ?? false } : {}),
36
+ };
37
+ }
38
+ const getSharedState = () => {
39
+ if (typeof window !== 'undefined') {
40
+ const w = window;
41
+ if (!w.__MDX_COMPONENTS_STATE__) {
42
+ w.__MDX_COMPONENTS_STATE__ = {
43
+ components: [],
44
+ subscribers: new Set(),
45
+ };
46
+ }
47
+ return w.__MDX_COMPONENTS_STATE__;
48
+ }
49
+ return { components: [], subscribers: new Set() };
50
+ };
51
+ /**
52
+ * Replace the registered MDX components. Called by the virtual module that
53
+ * loads the host's `schemas.ts`. Notifies subscribers so the editor picks
54
+ * up HMR updates without remounting.
55
+ */
56
+ export function setMdxComponents(components) {
57
+ const state = getSharedState();
58
+ state.components = components;
59
+ state.subscribers.forEach((fn) => {
60
+ fn(components);
61
+ });
62
+ }
63
+ /** Read the current registry synchronously. */
64
+ export function getMdxComponents() {
65
+ return getSharedState().components;
66
+ }
67
+ /**
68
+ * Install the host-authored descriptor list (the schemas module's
69
+ * `mdxComponents` export) without disturbing auto-discovered entries.
70
+ *
71
+ * The dev SPA has two unordered producers: the schemas virtual module and
72
+ * the `/api/registry` fetch. A plain `setMdxComponents` from whichever
73
+ * settled last overwrote the other's entries — discovered components
74
+ * vanished whenever the fetch won the race. Each producer now writes its
75
+ * own remembered slot and the registry is recomputed as the merge of both,
76
+ * so settle order stops mattering. A host app that installs the full list
77
+ * with a single `setMdxComponents` call keeps doing so; these slots are
78
+ * dev-only plumbing.
79
+ */
80
+ export function installHostAuthoredMdxComponents(components) {
81
+ const state = getSharedState();
82
+ state.hostAuthored = components;
83
+ setMdxComponents(mergeDiscoveredMdxComponents(components, state.discovered ?? []));
84
+ }
85
+ /** Install the auto-discovered descriptor list — see `installHostAuthoredMdxComponents`. */
86
+ export function installDiscoveredMdxComponents(components) {
87
+ const state = getSharedState();
88
+ state.discovered = components;
89
+ setMdxComponents(mergeDiscoveredMdxComponents(state.hostAuthored ?? [], components));
90
+ }
91
+ /**
92
+ * Merge auto-discovered descriptors over host-authored ones.
93
+ *
94
+ * Discovered entries win on a name collision: they are derived from the
95
+ * source of truth (the MDX files and component folders themselves), while a
96
+ * hand-written list can lag. ONE rule for every caller — the dev SPA merges
97
+ * the `/api/registry` response over the `schemasPath` exports, and a host app
98
+ * merges the same two lists from what it supplies.
99
+ *
100
+ * Host survivors keep their relative order and discovered entries append
101
+ * after them, so a colliding entry surfaces at its discovered position, not
102
+ * its host slot. Inputs are assumed unique-by-name — that validation lives
103
+ * in `defineMdxComponents` and the discovery merge, not here.
104
+ */
105
+ export function mergeDiscoveredMdxComponents(hostAuthored, discovered) {
106
+ if (discovered.length === 0)
107
+ return hostAuthored;
108
+ const discoveredNames = new Set(discovered.map((descriptor) => descriptor.name));
109
+ return [...hostAuthored.filter((descriptor) => !discoveredNames.has(descriptor.name)), ...discovered];
110
+ }
111
+ /**
112
+ * React hook subscribing to registry changes. Returns the current array and
113
+ * updates on HMR.
114
+ */
115
+ export function useMdxComponents() {
116
+ const [components, setComponents] = useState(() => getSharedState().components);
117
+ useEffect(() => {
118
+ const state = getSharedState();
119
+ if (state.components !== components) {
120
+ setComponents(state.components);
121
+ }
122
+ state.subscribers.add(setComponents);
123
+ return () => {
124
+ state.subscribers.delete(setComponents);
125
+ };
126
+ }, [components]);
127
+ return components;
128
+ }
129
+ //# sourceMappingURL=mdx-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx-components.js","sourceRoot":"","sources":["../../src/mdx-components.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,eAAe,EAAmD,MAAM,4BAA4B,CAAC;AAE9G,qEAAqE;AACrE,2EAA2E;AAC3E,sEAAsE;AACtE,mDAAmD;AACnD,cAAc,4BAA4B,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB,CACtC,CAAyB,EACzB,cAA6C;IAE7C,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC,IAAI,sCAAsC,CAAC,CAAC;IAC9F,CAAC;IACD,OAAO;QACL,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjC,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,IAAI,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;YAClD,QAAQ,EAAE,CAAC,CAAC,QAAQ;SACrB,CAAC,CAAC;QACH,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,cAAc;QAClC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzF,CAAC;AACJ,CAAC;AAcD,MAAM,cAAc,GAAG,GAA6B,EAAE;IACpD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,MAAM,CAAC,GAAG,MAA4E,CAAC;QACvF,IAAI,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC;YAChC,CAAC,CAAC,wBAAwB,GAAG;gBAC3B,UAAU,EAAE,EAAE;gBACd,WAAW,EAAE,IAAI,GAAG,EAAE;aACvB,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,CAAC,wBAAwB,CAAC;IACpC,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AACpD,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAyB;IACxD,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;IAC/B,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QAC/B,EAAE,CAAC,UAAU,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,gBAAgB;IAC9B,OAAO,cAAc,EAAE,CAAC,UAAU,CAAC;AACrC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gCAAgC,CAAC,UAAyB;IACxE,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;IAC/B,KAAK,CAAC,YAAY,GAAG,UAAU,CAAC;IAChC,gBAAgB,CAAC,4BAA4B,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,8BAA8B,CAAC,UAAyB;IACtE,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;IAC/B,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,gBAAgB,CAAC,4BAA4B,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;AACvF,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,4BAA4B,CAAC,YAA2B,EAAE,UAAyB;IACjG,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,YAAY,CAAC;IACjD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACjF,OAAO,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC;AACxG,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,UAAU,CAAC,CAAC;IAEhF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;YACpC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACrC,OAAO,GAAG,EAAE;YACV,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC1C,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { AssetScope } from './types.js';
2
+ interface AssetScopePillProps {
3
+ scope: AssetScope | null;
4
+ /**
5
+ * Visual size variant. `sm` is the AssetCard corner badge;
6
+ * `md` is the AssetDetailSidebar inline label. Defaults to `sm`.
7
+ */
8
+ size?: 'sm' | 'md';
9
+ className?: string;
10
+ }
11
+ /**
12
+ * Pill rendering a host-supplied `AssetScope` ("Branch only" /
13
+ * "Published"). When `scope` is `null`, renders nothing — callers
14
+ * can safely render this unconditionally and let it disappear when
15
+ * no bridge is installed (the local-Astro case).
16
+ *
17
+ * Colour vocabulary mirrors the broader cms-spa palette:
18
+ *
19
+ * - `published` → green (matches the deploy "live" indicator —
20
+ * "this is what your site is serving").
21
+ * - `branch` → amber (matches the "work in flight" idiom from
22
+ * git-status / divergence banners — "yours alone for now,
23
+ * needs publishing before anyone else sees it").
24
+ *
25
+ * The pill itself is purely presentational; the bridge wiring and
26
+ * the publishing rules live in the host app.
27
+ */
28
+ export declare function AssetScopePill({ scope, size, className }: AssetScopePillProps): import("react").JSX.Element | null;
29
+ export {};
30
+ //# sourceMappingURL=AssetScopePill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetScopePill.d.ts","sourceRoot":"","sources":["../../../src/media/AssetScopePill.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,UAAU,mBAAmB;IAC3B,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,mBAAmB,sCAyBpF"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ /**
4
+ * Pill rendering a host-supplied `AssetScope` ("Branch only" /
5
+ * "Published"). When `scope` is `null`, renders nothing — callers
6
+ * can safely render this unconditionally and let it disappear when
7
+ * no bridge is installed (the local-Astro case).
8
+ *
9
+ * Colour vocabulary mirrors the broader cms-spa palette:
10
+ *
11
+ * - `published` → green (matches the deploy "live" indicator —
12
+ * "this is what your site is serving").
13
+ * - `branch` → amber (matches the "work in flight" idiom from
14
+ * git-status / divergence banners — "yours alone for now,
15
+ * needs publishing before anyone else sees it").
16
+ *
17
+ * The pill itself is purely presentational; the bridge wiring and
18
+ * the publishing rules live in the host app.
19
+ */
20
+ export function AssetScopePill({ scope, size = 'sm', className }) {
21
+ if (!scope)
22
+ return null;
23
+ const isBranch = scope === 'branch';
24
+ const label = isBranch ? 'Branch only' : 'Published';
25
+ const sizeClasses = size === 'sm' ? 'text-[10px] px-1.5 py-0.5 leading-tight' : 'text-xs px-2 py-0.5';
26
+ const variantClasses = isBranch
27
+ ? 'bg-yellow-11 dark:bg-yellow-02 text-yellow-04 dark:text-yellow-09 border-yellow-08 dark:border-yellow-03'
28
+ : 'bg-green-11 dark:bg-green-02 text-green-04 dark:text-green-08 border-green-08 dark:border-green-03';
29
+ return (_jsx("span", { role: "status", "aria-label": `Asset scope: ${label}`, className: cn('inline-flex items-center font-medium rounded border uppercase tracking-wide', sizeClasses, variantClasses, className), children: label }));
30
+ }
31
+ //# sourceMappingURL=AssetScopePill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetScopePill.js","sourceRoot":"","sources":["../../../src/media/AssetScopePill.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAapC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAuB;IACnF,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,QAAQ,GAAG,KAAK,KAAK,QAAQ,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;IACrD,MAAM,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC,qBAAqB,CAAC;IAEtG,MAAM,cAAc,GAAG,QAAQ;QAC7B,CAAC,CAAC,0GAA0G;QAC5G,CAAC,CAAC,oGAAoG,CAAC;IAEzG,OAAO,CACL,eACE,IAAI,EAAC,QAAQ,gBACD,gBAAgB,KAAK,EAAE,EACnC,SAAS,EAAE,EAAE,CACX,6EAA6E,EAC7E,WAAW,EACX,cAAc,EACd,SAAS,CACV,YAEA,KAAK,GACD,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { MediaIssue } from './types.js';
2
+ interface MediaIssueBadgeProps {
3
+ issue: MediaIssue | null;
4
+ /**
5
+ * Visual size variant. `sm` is the AssetCard corner badge;
6
+ * `md` is the AssetDetailSidebar inline block (with full reason
7
+ * text). Defaults to `sm`.
8
+ */
9
+ size?: 'sm' | 'md';
10
+ className?: string;
11
+ }
12
+ /**
13
+ * Badge rendering a host-supplied `MediaIssue` ("Oversized" /
14
+ * "Blocked"). When `issue` is `null`, renders nothing — callers
15
+ * can mount this unconditionally and let it disappear when the
16
+ * host has no bridge or the asset is healthy.
17
+ *
18
+ * Colour vocabulary:
19
+ *
20
+ * - `blocked` → red (matches the destructive / fail palette —
21
+ * "this cannot ship").
22
+ * - `oversized` → amber (matches the "work in flight / take
23
+ * action" idiom shared with `AssetScopePill`'s branch variant —
24
+ * "not blocked, but over the host's size limit").
25
+ *
26
+ * `sm` paints a compact one-word badge for the AssetCard corner
27
+ * (sits below the scope pill so the two stack cleanly). `md` paints
28
+ * a wider block with the full reason / size detail for the
29
+ * AssetDetailSidebar header.
30
+ */
31
+ export declare function MediaIssueBadge({ issue, size, className }: MediaIssueBadgeProps): import("react").JSX.Element | null;
32
+ export {};
33
+ //# sourceMappingURL=MediaIssueBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaIssueBadge.d.ts","sourceRoot":"","sources":["../../../src/media/MediaIssueBadge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,UAAU,oBAAoB;IAC5B,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,oBAAoB,sCAsCtF"}
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../utils/cn.js';
3
+ /**
4
+ * Format an oversized issue's size delta into user-facing copy
5
+ * for the `md` variant. `sm` only uses the short label so the corner
6
+ * badge stays scannable; this helper kicks in for the sidebar block.
7
+ *
8
+ * Rounds to one decimal MB for readability — promoting "5.4 MB"
9
+ * over "5,400,000 bytes" matches the rest of cms-spa's file-size
10
+ * vocabulary (`formatFileSize`).
11
+ */
12
+ function formatOversizedDetail(sizeBytes, limitBytes) {
13
+ const mb = (bytes) => `${(bytes / 1_000_000).toFixed(1).replace(/\.0$/, '')} MB`;
14
+ return `${mb(sizeBytes)} is over the ${mb(limitBytes)} size limit.`;
15
+ }
16
+ /**
17
+ * Badge rendering a host-supplied `MediaIssue` ("Oversized" /
18
+ * "Blocked"). When `issue` is `null`, renders nothing — callers
19
+ * can mount this unconditionally and let it disappear when the
20
+ * host has no bridge or the asset is healthy.
21
+ *
22
+ * Colour vocabulary:
23
+ *
24
+ * - `blocked` → red (matches the destructive / fail palette —
25
+ * "this cannot ship").
26
+ * - `oversized` → amber (matches the "work in flight / take
27
+ * action" idiom shared with `AssetScopePill`'s branch variant —
28
+ * "not blocked, but over the host's size limit").
29
+ *
30
+ * `sm` paints a compact one-word badge for the AssetCard corner
31
+ * (sits below the scope pill so the two stack cleanly). `md` paints
32
+ * a wider block with the full reason / size detail for the
33
+ * AssetDetailSidebar header.
34
+ */
35
+ export function MediaIssueBadge({ issue, size = 'sm', className }) {
36
+ if (!issue)
37
+ return null;
38
+ const isBlocked = issue.kind === 'blocked';
39
+ const shortLabel = isBlocked ? 'Blocked' : 'Oversized';
40
+ const sizeClasses = size === 'sm' ? 'text-[10px] px-1.5 py-0.5 leading-tight' : 'text-xs px-2 py-1';
41
+ const variantClasses = isBlocked
42
+ ? 'bg-red-11 dark:bg-red-02 text-red-04 dark:text-red-08 border-red-08 dark:border-red-03'
43
+ : 'bg-amber-11 dark:bg-amber-02 text-amber-04 dark:text-amber-08 border-amber-08 dark:border-amber-03';
44
+ // `md` paints the full reason / size delta so the sidebar
45
+ // surface reads as a self-contained explanation, not just a
46
+ // label. `sm` stays at the short label so the AssetCard corner
47
+ // doesn't get crowded.
48
+ const detail = size === 'md'
49
+ ? issue.kind === 'blocked'
50
+ ? issue.reason
51
+ : formatOversizedDetail(issue.sizeBytes, issue.limitBytes)
52
+ : null;
53
+ return (_jsxs("span", { role: "status", "aria-label": `Media issue: ${shortLabel}${detail ? ` — ${detail}` : ''}`, className: cn('inline-flex items-center font-medium rounded border', size === 'sm' ? 'uppercase tracking-wide' : 'gap-2', sizeClasses, variantClasses, className), children: [_jsx("span", { className: size === 'md' ? 'uppercase tracking-wide font-semibold' : undefined, children: shortLabel }), detail ? _jsx("span", { className: "font-normal normal-case tracking-normal", children: detail }) : null] }));
54
+ }
55
+ //# sourceMappingURL=MediaIssueBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaIssueBadge.js","sourceRoot":"","sources":["../../../src/media/MediaIssueBadge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAcpC;;;;;;;;GAQG;AACH,SAAS,qBAAqB,CAAC,SAAiB,EAAE,UAAkB;IAClE,MAAM,EAAE,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC;IACzF,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAwB;IACrF,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC;IAC3C,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;IACvD,MAAM,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAEpG,MAAM,cAAc,GAAG,SAAS;QAC9B,CAAC,CAAC,wFAAwF;QAC1F,CAAC,CAAC,oGAAoG,CAAC;IAEzG,0DAA0D;IAC1D,4DAA4D;IAC5D,+DAA+D;IAC/D,uBAAuB;IACvB,MAAM,MAAM,GACV,IAAI,KAAK,IAAI;QACX,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS;YACxB,CAAC,CAAC,KAAK,CAAC,MAAM;YACd,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC;QAC5D,CAAC,CAAC,IAAI,CAAC;IAEX,OAAO,CACL,gBACE,IAAI,EAAC,QAAQ,gBACD,gBAAgB,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EACvE,SAAS,EAAE,EAAE,CACX,qDAAqD,EACrD,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,OAAO,EACnD,WAAW,EACX,cAAc,EACd,SAAS,CACV,aAED,eAAM,SAAS,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC,CAAC,SAAS,YAAG,UAAU,GAAQ,EACxG,MAAM,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,yCAAyC,YAAE,MAAM,GAAQ,CAAC,CAAC,CAAC,IAAI,IACrF,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,108 @@
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
+ * Standing media issue a host app reports alongside the
23
+ * `AssetScope` pill. Distinct from the outcome of a single call:
24
+ * an issue here is a property OF the asset that persists until
25
+ * the user resolves it.
26
+ *
27
+ * cms-spa's renderer-neutral asset model doesn't carry these
28
+ * fields because astro-cms on its own has no notion of them —
29
+ * they're host state a host app exposes through
30
+ * `UIConfig.mediaBridge.getMediaIssue`.
31
+ *
32
+ * - `oversized` — the host says the file is over its size limit.
33
+ * The asset is still served. Surface paints an amber warning.
34
+ * - `blocked` — the host is holding the content back, for the
35
+ * given `reason`. Surface paints a red error with that reason.
36
+ *
37
+ * Both variants carry `filename` so flat lists are self-joinable
38
+ * to the user's dirty page set without a second lookup.
39
+ */
40
+ export type MediaIssue = {
41
+ kind: 'oversized';
42
+ filename: string;
43
+ sizeBytes: number;
44
+ limitBytes: number;
45
+ } | {
46
+ kind: 'blocked';
47
+ filename: string;
48
+ reason: string;
49
+ };
50
+ /**
51
+ * Bridge cms-spa uses to read host-supplied metadata about media
52
+ * assets that cms-spa's renderer-neutral model doesn't carry.
53
+ * Installed by a host app via `UIConfig.mediaBridge` before
54
+ * rendering `<CmsSpaApp />`; cms-spa never reaches into the host
55
+ * app's own client directly.
56
+ *
57
+ * The bridge is optional in `UIConfig` — absence means "no host
58
+ * wiring," in which case cms-spa surfaces degrade cleanly (no
59
+ * scope pill, no host-side hooks fire).
60
+ */
61
+ export interface MediaBridge {
62
+ /**
63
+ * Resolve the lifecycle scope of a single asset. Called by
64
+ * AssetCard / AssetDetailSidebar whenever they need to render
65
+ * the scope pill. Returns `null` when the host has no opinion
66
+ * (asset unknown to the host, pre-bootstrap state, or no host
67
+ * app at all); the surface treats `null` the same as
68
+ * "no bridge" — pill hidden.
69
+ *
70
+ * `folder` tells same-named assets in different folders apart, so
71
+ * a subfolder asset never borrows a root asset's scope. Optional
72
+ * for backward compatibility (absent ⇒ root); consumers pass the
73
+ * asset's own folder.
74
+ *
75
+ * The host is responsible for caching: cms-spa calls this
76
+ * synchronously-from-the-surface's-POV via TanStack so
77
+ * repeated renders don't refetch. A host app typically wraps
78
+ * its own lookup in a cached query so the resolved scope is
79
+ * memoised.
80
+ */
81
+ getAssetScope(input: {
82
+ filename: string;
83
+ folder?: string;
84
+ }): Promise<AssetScope | null>;
85
+ /**
86
+ * Resolve the standing media issue for a single asset, or `null`
87
+ * when the asset is healthy. Called by AssetCard /
88
+ * AssetDetailSidebar whenever they paint the per-asset
89
+ * error/warning badge.
90
+ *
91
+ * `folder` tells same-named assets apart the same way
92
+ * `getAssetScope` does, so an issue with `uploads/hero.jpg`
93
+ * never badges a root `hero.jpg`. Optional (absent ⇒ root).
94
+ *
95
+ * Returns `null` for the same reasons as `getAssetScope`: host
96
+ * has no opinion (asset unknown, pre-bootstrap state, no host
97
+ * app). Surfaces treat `null` the same as "no bridge" — badge
98
+ * hidden, `AssetEntry` rendered unchanged.
99
+ *
100
+ * The host caches the lookup so cms-spa's `useMediaIssue` wrapper
101
+ * doesn't have to think about per-asset cache windows.
102
+ */
103
+ getMediaIssue(input: {
104
+ filename: string;
105
+ folder?: string;
106
+ }): Promise<MediaIssue | null>;
107
+ }
108
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/media/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC9E;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACxF;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACzF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/media/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import type { AssetScope } from './types.js';
2
+ /**
3
+ * Resolve the host-supplied lifecycle scope of a single asset.
4
+ *
5
+ * Returns `null` when:
6
+ *
7
+ * - No `mediaBridge` is configured (cms-spa running standalone /
8
+ * astro-cms / local dev) — the surface knows "the host has no
9
+ * opinion" and hides the scope pill.
10
+ * - The bridge resolves to `null` (asset unknown to the host or
11
+ * pre-bootstrap state).
12
+ *
13
+ * The pill is only rendered when this returns `'branch'` or
14
+ * `'published'`. Loading state is also treated as `null` for the
15
+ * caller's purposes — a flashing pill on first paint reads worse
16
+ * than no pill, and the scope is metadata, not primary content.
17
+ *
18
+ * A host app's bridge typically wraps its own lookup so the actual
19
+ * fetch is cached one level deeper. From cms-spa's POV this is just
20
+ * a lookup; the TanStack wrapper here is so repeat AssetCard renders
21
+ * don't re-call the bridge for the same filename.
22
+ */
23
+ export declare function useAssetScope(filename: string | undefined, folder?: string): AssetScope | null;
24
+ //# sourceMappingURL=use-asset-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-asset-scope.d.ts","sourceRoot":"","sources":["../../../src/media/use-asset-scope.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAc7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAoB9F"}
@@ -0,0 +1,57 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { getUIConfig } from '../ui-config.js';
3
+ /**
4
+ * Cache-key namespace for per-asset scope lookups. Keyed by
5
+ * filename — the host app owns the branch scoping behind the
6
+ * bridge, so cms-spa sees a flat "which filename?" surface and the
7
+ * bridge resolves it for the current site and branch.
8
+ *
9
+ * When the user switches branches, the host app invalidates this
10
+ * whole prefix (`['asset-scope']`) so stale scope answers don't
11
+ * leak across the boundary.
12
+ */
13
+ const ASSET_SCOPE_QUERY_KEY_PREFIX = ['asset-scope'];
14
+ /**
15
+ * Resolve the host-supplied lifecycle scope of a single asset.
16
+ *
17
+ * Returns `null` when:
18
+ *
19
+ * - No `mediaBridge` is configured (cms-spa running standalone /
20
+ * astro-cms / local dev) — the surface knows "the host has no
21
+ * opinion" and hides the scope pill.
22
+ * - The bridge resolves to `null` (asset unknown to the host or
23
+ * pre-bootstrap state).
24
+ *
25
+ * The pill is only rendered when this returns `'branch'` or
26
+ * `'published'`. Loading state is also treated as `null` for the
27
+ * caller's purposes — a flashing pill on first paint reads worse
28
+ * than no pill, and the scope is metadata, not primary content.
29
+ *
30
+ * A host app's bridge typically wraps its own lookup so the actual
31
+ * fetch is cached one level deeper. From cms-spa's POV this is just
32
+ * a lookup; the TanStack wrapper here is so repeat AssetCard renders
33
+ * don't re-call the bridge for the same filename.
34
+ */
35
+ export function useAssetScope(filename, folder) {
36
+ const query = useQuery({
37
+ // Folder is part of the key so same-named assets in different folders
38
+ // cache (and invalidate) independently; the `['asset-scope']` prefix
39
+ // invalidation still catches every entry.
40
+ queryKey: [...ASSET_SCOPE_QUERY_KEY_PREFIX, filename ?? '', folder ?? ''],
41
+ queryFn: async () => {
42
+ const bridge = getUIConfig().mediaBridge;
43
+ if (!bridge || !filename)
44
+ return null;
45
+ return bridge.getAssetScope({ filename, folder });
46
+ },
47
+ // Per-filename scope is stable for the lifetime of a branch
48
+ // session — only publishing the asset changes it, and the host
49
+ // app invalidates the prefix when that succeeds. 5 minutes
50
+ // matches the cms-spa default staleTime so the surface doesn't
51
+ // have to think about cache windows.
52
+ staleTime: 1000 * 60 * 5,
53
+ enabled: Boolean(filename),
54
+ });
55
+ return query.data ?? null;
56
+ }
57
+ //# sourceMappingURL=use-asset-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-asset-scope.js","sourceRoot":"","sources":["../../../src/media/use-asset-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C;;;;;;;;;GASG;AACH,MAAM,4BAA4B,GAAG,CAAC,aAAa,CAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,aAAa,CAAC,QAA4B,EAAE,MAAe;IACzE,MAAM,KAAK,GAAG,QAAQ,CAAoB;QACxC,sEAAsE;QACtE,qEAAqE;QACrE,0CAA0C;QAC1C,QAAQ,EAAE,CAAC,GAAG,4BAA4B,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,EAAE,CAAC;QACzE,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC,WAAW,CAAC;YACzC,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ;gBAAE,OAAO,IAAI,CAAC;YACtC,OAAO,MAAM,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACpD,CAAC;QACD,4DAA4D;QAC5D,+DAA+D;QAC/D,2DAA2D;QAC3D,+DAA+D;QAC/D,qCAAqC;QACrC,SAAS,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC;KAC3B,CAAC,CAAC;IACH,OAAO,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { MediaIssue } from './types.js';
2
+ /**
3
+ * Resolve the host-supplied standing media issue for a single asset.
4
+ *
5
+ * Returns `null` when:
6
+ *
7
+ * - No `mediaBridge` is configured (cms-spa standalone, astro-cms,
8
+ * local dev) — the surface knows "the host has no opinion" and
9
+ * hides the issue badge.
10
+ * - The bridge resolves to `null` (asset healthy, unknown to the
11
+ * host, or pre-bootstrap state).
12
+ *
13
+ * The badge is only rendered when this returns a real issue. Loading
14
+ * state is treated as `null` for the caller's purposes — a flashing
15
+ * badge on first paint reads worse than no badge, and issue state is
16
+ * metadata, not primary content.
17
+ *
18
+ * Mirrors the `useAssetScope` discipline: cms-spa stays a thin
19
+ * consumer of `getUIConfig().mediaBridge`; a host app's bridge
20
+ * typically wraps its own lookup in a cached query so the cache is
21
+ * hit one level deeper.
22
+ */
23
+ export declare function useMediaIssue(filename: string | undefined, folder?: string): MediaIssue | null;
24
+ //# sourceMappingURL=use-media-issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-media-issue.d.ts","sourceRoot":"","sources":["../../../src/media/use-media-issue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAU7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAmB9F"}
@@ -0,0 +1,52 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { getUIConfig } from '../ui-config.js';
3
+ /**
4
+ * Cache-key namespace for per-asset issue lookups. Mirrors the
5
+ * `['asset-scope']` prefix used by `useAssetScope` — a host app
6
+ * invalidates this whole prefix when the site or branch changes and
7
+ * after it publishes assets, so stale entries don't leak.
8
+ */
9
+ const MEDIA_ISSUE_QUERY_KEY_PREFIX = ['media-issue'];
10
+ /**
11
+ * Resolve the host-supplied standing media issue for a single asset.
12
+ *
13
+ * Returns `null` when:
14
+ *
15
+ * - No `mediaBridge` is configured (cms-spa standalone, astro-cms,
16
+ * local dev) — the surface knows "the host has no opinion" and
17
+ * hides the issue badge.
18
+ * - The bridge resolves to `null` (asset healthy, unknown to the
19
+ * host, or pre-bootstrap state).
20
+ *
21
+ * The badge is only rendered when this returns a real issue. Loading
22
+ * state is treated as `null` for the caller's purposes — a flashing
23
+ * badge on first paint reads worse than no badge, and issue state is
24
+ * metadata, not primary content.
25
+ *
26
+ * Mirrors the `useAssetScope` discipline: cms-spa stays a thin
27
+ * consumer of `getUIConfig().mediaBridge`; a host app's bridge
28
+ * typically wraps its own lookup in a cached query so the cache is
29
+ * hit one level deeper.
30
+ */
31
+ export function useMediaIssue(filename, folder) {
32
+ const query = useQuery({
33
+ // Folder is part of the key so a block on one folder's asset never shows
34
+ // on a same-named asset elsewhere; the `['media-issue']` prefix
35
+ // invalidation still catches every entry.
36
+ queryKey: [...MEDIA_ISSUE_QUERY_KEY_PREFIX, filename ?? '', folder ?? ''],
37
+ queryFn: async () => {
38
+ const bridge = getUIConfig().mediaBridge;
39
+ if (!bridge || !filename)
40
+ return null;
41
+ return bridge.getMediaIssue({ filename, folder });
42
+ },
43
+ // Per-filename issues are stable for the lifetime of a branch
44
+ // session — only a change on the host's side moves them, and the
45
+ // host invalidates the prefix when it does. 5 minutes matches the
46
+ // cms-spa default staleTime, same as `useAssetScope`.
47
+ staleTime: 1000 * 60 * 5,
48
+ enabled: Boolean(filename),
49
+ });
50
+ return query.data ?? null;
51
+ }
52
+ //# sourceMappingURL=use-media-issue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-media-issue.js","sourceRoot":"","sources":["../../../src/media/use-media-issue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C;;;;;GAKG;AACH,MAAM,4BAA4B,GAAG,CAAC,aAAa,CAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,aAAa,CAAC,QAA4B,EAAE,MAAe;IACzE,MAAM,KAAK,GAAG,QAAQ,CAAoB;QACxC,yEAAyE;QACzE,gEAAgE;QAChE,0CAA0C;QAC1C,QAAQ,EAAE,CAAC,GAAG,4BAA4B,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,EAAE,CAAC;QACzE,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC,WAAW,CAAC;YACzC,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ;gBAAE,OAAO,IAAI,CAAC;YACtC,OAAO,MAAM,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACpD,CAAC;QACD,8DAA8D;QAC9D,iEAAiE;QACjE,kEAAkE;QAClE,sDAAsD;QACtD,SAAS,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC;KAC3B,CAAC,CAAC;IACH,OAAO,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { Config, Data } from '@puckeditor/core';
2
+ /**
3
+ * Layer each block's `defaultProps` under the sparse props Puck stored, so a
4
+ * page reads the same in the editor and on the published page. Puck saves only
5
+ * the props an author changed and its published render applies no defaults;
6
+ * without this, a field added to a block after a page was saved renders
7
+ * undefined, and a select or radio field shows its first option instead of
8
+ * the real default.
9
+ *
10
+ * Blocks inside a slot are merged too, top-down, and a slot the page never
11
+ * stored is seeded from its block's defaults, so a block whose default slot
12
+ * holds child blocks shows them before the page is first saved. A slot child
13
+ * without an id gets one made from its parent's id, the slot name and its
14
+ * position: stable, so every read of the same page agrees, and free of ':',
15
+ * which Puck splits zone keys on.
16
+ *
17
+ * Like Puck's own slot defaults, only a block's top-level slot fields are
18
+ * walked. The merge is shallow, so a field added inside an array item type
19
+ * (e.g. `linkTarget` on a card list) is not backfilled into saved items —
20
+ * renders must handle `undefined` for any array item field older content lacks.
21
+ */
22
+ export declare function mergeDefaultProps(data: Data, config: Config): Data;
23
+ //# sourceMappingURL=merge-default-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-default-props.d.ts","sourceRoot":"","sources":["../../src/merge-default-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0C,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAmClE"}