@conloca/cms-spa 0.1.15 → 0.1.16

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 (438) hide show
  1. package/dist/App-Bk1LNxbS.mjs +10851 -0
  2. package/dist/App-Bk1LNxbS.mjs.map +1 -0
  3. package/dist/App.d.ts +35 -0
  4. package/dist/App.d.ts.map +1 -0
  5. package/dist/App.js +52 -0
  6. package/dist/CmsSpaApp.d.ts +13 -0
  7. package/dist/CmsSpaApp.d.ts.map +1 -0
  8. package/dist/CmsSpaApp.js +33 -0
  9. package/dist/cn-dlASUkDY.mjs +10 -0
  10. package/dist/cn-dlASUkDY.mjs.map +1 -0
  11. package/dist/components/CMSDashboard.d.ts +2 -0
  12. package/dist/components/CMSDashboard.d.ts.map +1 -0
  13. package/dist/components/CMSDashboard.js +20 -0
  14. package/dist/components/CMSLayout.d.ts +2 -0
  15. package/dist/components/CMSLayout.d.ts.map +1 -0
  16. package/dist/components/CMSLayout.js +15 -0
  17. package/dist/components/ConlocaLogo.d.ts +2 -0
  18. package/dist/components/ConlocaLogo.d.ts.map +1 -0
  19. package/dist/components/ConlocaLogo.js +4 -0
  20. package/dist/components/GitStatusPanel.d.ts +25 -0
  21. package/dist/components/GitStatusPanel.d.ts.map +1 -0
  22. package/dist/components/GitStatusPanel.js +77 -0
  23. package/dist/components/MobileTopBar.d.ts +6 -0
  24. package/dist/components/MobileTopBar.d.ts.map +1 -0
  25. package/dist/components/MobileTopBar.js +6 -0
  26. package/dist/components/Sidebar.d.ts +8 -0
  27. package/dist/components/Sidebar.d.ts.map +1 -0
  28. package/dist/components/Sidebar.js +40 -0
  29. package/dist/components/UserAvatar.d.ts +2 -0
  30. package/dist/components/UserAvatar.d.ts.map +1 -0
  31. package/dist/components/UserAvatar.js +14 -0
  32. package/dist/components/cards/DataEntryCard.d.ts +14 -0
  33. package/dist/components/cards/DataEntryCard.d.ts.map +1 -0
  34. package/dist/components/cards/DataEntryCard.js +32 -0
  35. package/dist/components/cards/SectionCard.d.ts +15 -0
  36. package/dist/components/cards/SectionCard.d.ts.map +1 -0
  37. package/dist/components/cards/SectionCard.js +10 -0
  38. package/dist/components/cards/index.d.ts +2 -0
  39. package/dist/components/cards/index.d.ts.map +1 -0
  40. package/dist/components/cards/index.js +1 -0
  41. package/dist/components/dashboard/RecentActivity.d.ts +2 -0
  42. package/dist/components/dashboard/RecentActivity.d.ts.map +1 -0
  43. package/dist/components/dashboard/RecentActivity.js +58 -0
  44. package/dist/components/dialog.d.ts +53 -0
  45. package/dist/components/dialog.d.ts.map +1 -0
  46. package/dist/components/dialog.js +56 -0
  47. package/dist/components/dialogs/BlockPropertiesDialog.d.ts +12 -0
  48. package/dist/components/dialogs/BlockPropertiesDialog.d.ts.map +1 -0
  49. package/dist/components/dialogs/BlockPropertiesDialog.js +42 -0
  50. package/dist/components/dialogs/ConflictDialog.d.ts +10 -0
  51. package/dist/components/dialogs/ConflictDialog.d.ts.map +1 -0
  52. package/dist/components/dialogs/ConflictDialog.js +29 -0
  53. package/dist/components/dialogs/CreateDataDialog.d.ts +9 -0
  54. package/dist/components/dialogs/CreateDataDialog.d.ts.map +1 -0
  55. package/dist/components/dialogs/CreateDataDialog.js +20 -0
  56. package/dist/components/dialogs/CreateFolderDialog.d.ts +9 -0
  57. package/dist/components/dialogs/CreateFolderDialog.d.ts.map +1 -0
  58. package/dist/components/dialogs/CreateFolderDialog.js +33 -0
  59. package/dist/components/dialogs/CreatePageDialog.d.ts +10 -0
  60. package/dist/components/dialogs/CreatePageDialog.d.ts.map +1 -0
  61. package/dist/components/dialogs/CreatePageDialog.js +155 -0
  62. package/dist/components/dialogs/DataPropertiesDialog.d.ts +10 -0
  63. package/dist/components/dialogs/DataPropertiesDialog.d.ts.map +1 -0
  64. package/dist/components/dialogs/DataPropertiesDialog.js +38 -0
  65. package/dist/components/dialogs/DeleteConfirmDialog.d.ts +12 -0
  66. package/dist/components/dialogs/DeleteConfirmDialog.d.ts.map +1 -0
  67. package/dist/components/dialogs/DeleteConfirmDialog.js +7 -0
  68. package/dist/components/dialogs/ErrorModal.d.ts +14 -0
  69. package/dist/components/dialogs/ErrorModal.d.ts.map +1 -0
  70. package/dist/components/dialogs/ErrorModal.js +38 -0
  71. package/dist/components/dialogs/MoveFolderDialog.d.ts +11 -0
  72. package/dist/components/dialogs/MoveFolderDialog.d.ts.map +1 -0
  73. package/dist/components/dialogs/MoveFolderDialog.js +45 -0
  74. package/dist/components/dialogs/PageMetadataDialog.d.ts +10 -0
  75. package/dist/components/dialogs/PageMetadataDialog.d.ts.map +1 -0
  76. package/dist/components/dialogs/PageMetadataDialog.js +85 -0
  77. package/dist/components/dialogs/UnsavedChangesDialog.d.ts +8 -0
  78. package/dist/components/dialogs/UnsavedChangesDialog.d.ts.map +1 -0
  79. package/dist/components/dialogs/UnsavedChangesDialog.js +6 -0
  80. package/dist/components/dialogs/index.d.ts +9 -0
  81. package/dist/components/dialogs/index.d.ts.map +1 -0
  82. package/dist/components/dialogs/index.js +8 -0
  83. package/dist/components/editor/BlockEditor.d.ts +8 -0
  84. package/dist/components/editor/BlockEditor.d.ts.map +1 -0
  85. package/dist/components/editor/BlockEditor.js +262 -0
  86. package/dist/components/editor/BlockWrappers.d.ts +15 -0
  87. package/dist/components/editor/BlockWrappers.d.ts.map +1 -0
  88. package/dist/components/editor/BlockWrappers.js +29 -0
  89. package/dist/components/editor/CMSMDXEditor.d.ts +13 -0
  90. package/dist/components/editor/CMSMDXEditor.d.ts.map +1 -0
  91. package/dist/components/editor/CMSMDXEditor.js +123 -0
  92. package/dist/components/editor/ContentDiff.d.ts +10 -0
  93. package/dist/components/editor/ContentDiff.d.ts.map +1 -0
  94. package/dist/components/editor/ContentDiff.js +51 -0
  95. package/dist/components/editor/CreateBlockDialog.d.ts +26 -0
  96. package/dist/components/editor/CreateBlockDialog.d.ts.map +1 -0
  97. package/dist/components/editor/CreateBlockDialog.js +131 -0
  98. package/dist/components/editor/DrawerItemOverride.d.ts +8 -0
  99. package/dist/components/editor/DrawerItemOverride.d.ts.map +1 -0
  100. package/dist/components/editor/DrawerItemOverride.js +41 -0
  101. package/dist/components/editor/EditorChromeToggles.d.ts +16 -0
  102. package/dist/components/editor/EditorChromeToggles.d.ts.map +1 -0
  103. package/dist/components/editor/EditorChromeToggles.js +16 -0
  104. package/dist/components/editor/GenericBlock.d.ts +3 -0
  105. package/dist/components/editor/GenericBlock.d.ts.map +1 -0
  106. package/dist/components/editor/GenericBlock.js +1067 -0
  107. package/dist/components/editor/ImagePickerDialog.d.ts +6 -0
  108. package/dist/components/editor/ImagePickerDialog.d.ts.map +1 -0
  109. package/dist/components/editor/ImagePickerDialog.js +24 -0
  110. package/dist/components/editor/JsxPropsPanel.d.ts +16 -0
  111. package/dist/components/editor/JsxPropsPanel.d.ts.map +1 -0
  112. package/dist/components/editor/JsxPropsPanel.js +145 -0
  113. package/dist/components/editor/LocaleSelector.d.ts +9 -0
  114. package/dist/components/editor/LocaleSelector.d.ts.map +1 -0
  115. package/dist/components/editor/LocaleSelector.js +13 -0
  116. package/dist/components/editor/MDXLivePreview.d.ts +14 -0
  117. package/dist/components/editor/MDXLivePreview.d.ts.map +1 -0
  118. package/dist/components/editor/MDXLivePreview.js +103 -0
  119. package/dist/components/editor/MdxPageEditor.d.ts +10 -0
  120. package/dist/components/editor/MdxPageEditor.d.ts.map +1 -0
  121. package/dist/components/editor/MdxPageEditor.js +297 -0
  122. package/dist/components/editor/PageEditor.d.ts +18 -0
  123. package/dist/components/editor/PageEditor.d.ts.map +1 -0
  124. package/dist/components/editor/PageEditor.js +288 -0
  125. package/dist/components/editor/PageEditorHeaderActions.d.ts +16 -0
  126. package/dist/components/editor/PageEditorHeaderActions.d.ts.map +1 -0
  127. package/dist/components/editor/PageEditorHeaderActions.js +19 -0
  128. package/dist/components/editor/PageEditorWrapper.d.ts +7 -0
  129. package/dist/components/editor/PageEditorWrapper.d.ts.map +1 -0
  130. package/dist/components/editor/PageEditorWrapper.js +319 -0
  131. package/dist/components/editor/SearchableSelect.d.ts +34 -0
  132. package/dist/components/editor/SearchableSelect.d.ts.map +1 -0
  133. package/dist/components/editor/SearchableSelect.js +116 -0
  134. package/dist/components/editor/host-wrapper-plugin.d.ts +51 -0
  135. package/dist/components/editor/host-wrapper-plugin.d.ts.map +1 -0
  136. package/dist/components/editor/host-wrapper-plugin.js +37 -0
  137. package/dist/components/editor/index.d.ts +9 -0
  138. package/dist/components/editor/index.d.ts.map +1 -0
  139. package/dist/components/editor/index.js +7 -0
  140. package/dist/components/editor/insert-menu/InsertMdxComponentButton.d.ts +15 -0
  141. package/dist/components/editor/insert-menu/InsertMdxComponentButton.d.ts.map +1 -0
  142. package/dist/components/editor/insert-menu/InsertMdxComponentButton.js +90 -0
  143. package/dist/components/editor/insert-menu/SlashMenuPlugin.d.ts +12 -0
  144. package/dist/components/editor/insert-menu/SlashMenuPlugin.d.ts.map +1 -0
  145. package/dist/components/editor/insert-menu/SlashMenuPlugin.js +106 -0
  146. package/dist/components/editor/insert-menu/insert-payload.d.ts +76 -0
  147. package/dist/components/editor/insert-menu/insert-payload.d.ts.map +1 -0
  148. package/dist/components/editor/insert-menu/insert-payload.js +94 -0
  149. package/dist/components/editor/insert-menu/mdx-components-plugin.d.ts +8 -0
  150. package/dist/components/editor/insert-menu/mdx-components-plugin.d.ts.map +1 -0
  151. package/dist/components/editor/insert-menu/mdx-components-plugin.js +13 -0
  152. package/dist/components/editors/DataEditor.d.ts +19 -0
  153. package/dist/components/editors/DataEditor.d.ts.map +1 -0
  154. package/dist/components/editors/DataEditor.js +139 -0
  155. package/dist/components/fields/ContentBlockSelectorField.d.ts +14 -0
  156. package/dist/components/fields/ContentBlockSelectorField.d.ts.map +1 -0
  157. package/dist/components/fields/ContentBlockSelectorField.js +105 -0
  158. package/dist/components/fields/ImageField.d.ts +16 -0
  159. package/dist/components/fields/ImageField.d.ts.map +1 -0
  160. package/dist/components/fields/ImageField.js +39 -0
  161. package/dist/components/fields/MDXEditField.d.ts +17 -0
  162. package/dist/components/fields/MDXEditField.d.ts.map +1 -0
  163. package/dist/components/fields/MDXEditField.js +28 -0
  164. package/dist/components/forms/ChipArrayField.d.ts +12 -0
  165. package/dist/components/forms/ChipArrayField.d.ts.map +1 -0
  166. package/dist/components/forms/ChipArrayField.js +40 -0
  167. package/dist/components/forms/HintForm.d.ts +22 -0
  168. package/dist/components/forms/HintForm.d.ts.map +1 -0
  169. package/dist/components/forms/HintForm.js +162 -0
  170. package/dist/components/forms/SchemaForm.d.ts +15 -0
  171. package/dist/components/forms/SchemaForm.d.ts.map +1 -0
  172. package/dist/components/forms/SchemaForm.js +106 -0
  173. package/dist/components/index.d.ts +8 -0
  174. package/dist/components/index.d.ts.map +1 -0
  175. package/dist/components/index.js +13 -0
  176. package/dist/components/media/AssetCard.d.ts +14 -0
  177. package/dist/components/media/AssetCard.d.ts.map +1 -0
  178. package/dist/components/media/AssetCard.js +31 -0
  179. package/dist/components/media/AssetDetailSidebar.d.ts +11 -0
  180. package/dist/components/media/AssetDetailSidebar.d.ts.map +1 -0
  181. package/dist/components/media/AssetDetailSidebar.js +101 -0
  182. package/dist/components/media/BulkActionBar.d.ts +9 -0
  183. package/dist/components/media/BulkActionBar.d.ts.map +1 -0
  184. package/dist/components/media/BulkActionBar.js +8 -0
  185. package/dist/components/media/FolderNav.d.ts +7 -0
  186. package/dist/components/media/FolderNav.d.ts.map +1 -0
  187. package/dist/components/media/FolderNav.js +12 -0
  188. package/dist/components/media/FolderTreeSidebar.d.ts +9 -0
  189. package/dist/components/media/FolderTreeSidebar.d.ts.map +1 -0
  190. package/dist/components/media/FolderTreeSidebar.js +41 -0
  191. package/dist/components/media/ImagePicker.d.ts +14 -0
  192. package/dist/components/media/ImagePicker.d.ts.map +1 -0
  193. package/dist/components/media/ImagePicker.js +45 -0
  194. package/dist/components/media/MediaLibrary.d.ts +35 -0
  195. package/dist/components/media/MediaLibrary.d.ts.map +1 -0
  196. package/dist/components/media/MediaLibrary.js +100 -0
  197. package/dist/components/media/MediaToolbar.d.ts +21 -0
  198. package/dist/components/media/MediaToolbar.d.ts.map +1 -0
  199. package/dist/components/media/MediaToolbar.js +6 -0
  200. package/dist/components/media/UploadModal.d.ts +9 -0
  201. package/dist/components/media/UploadModal.d.ts.map +1 -0
  202. package/dist/components/media/UploadModal.js +42 -0
  203. package/dist/components/media/UploadZone.d.ts +8 -0
  204. package/dist/components/media/UploadZone.d.ts.map +1 -0
  205. package/dist/components/media/UploadZone.js +22 -0
  206. package/dist/components/media/index.d.ts +11 -0
  207. package/dist/components/media/index.d.ts.map +1 -0
  208. package/dist/components/media/index.js +10 -0
  209. package/dist/components/pages/BlockList.d.ts +2 -0
  210. package/dist/components/pages/BlockList.d.ts.map +1 -0
  211. package/dist/components/pages/BlockList.js +280 -0
  212. package/dist/components/pages/DataList.d.ts +7 -0
  213. package/dist/components/pages/DataList.d.ts.map +1 -0
  214. package/dist/components/pages/DataList.js +244 -0
  215. package/dist/components/pages/MediaPage.d.ts +8 -0
  216. package/dist/components/pages/MediaPage.d.ts.map +1 -0
  217. package/dist/components/pages/MediaPage.js +107 -0
  218. package/dist/components/pages/PageList.d.ts +7 -0
  219. package/dist/components/pages/PageList.d.ts.map +1 -0
  220. package/dist/components/pages/PageList.js +308 -0
  221. package/dist/components/pages/index.d.ts +3 -0
  222. package/dist/components/pages/index.d.ts.map +1 -0
  223. package/dist/components/pages/index.js +2 -0
  224. package/dist/components/puck/MDXContent.d.ts +10 -0
  225. package/dist/components/puck/MDXContent.d.ts.map +1 -0
  226. package/dist/components/puck/MDXContent.js +80 -0
  227. package/dist/components/puck/index.d.ts +2 -0
  228. package/dist/components/puck/index.d.ts.map +1 -0
  229. package/dist/components/puck/index.js +1 -0
  230. package/dist/components/toast.d.ts +44 -0
  231. package/dist/components/toast.d.ts.map +1 -0
  232. package/dist/components/toast.js +7 -0
  233. package/dist/components/ui/Banner.d.ts +76 -0
  234. package/dist/components/ui/Banner.d.ts.map +1 -0
  235. package/dist/components/ui/Banner.js +49 -0
  236. package/dist/components/ui/Button.d.ts +25 -0
  237. package/dist/components/ui/Button.d.ts.map +1 -0
  238. package/dist/components/ui/Button.js +33 -0
  239. package/dist/components/ui/Card.d.ts +72 -0
  240. package/dist/components/ui/Card.d.ts.map +1 -0
  241. package/dist/components/ui/Card.js +49 -0
  242. package/dist/components/ui/FieldError.d.ts +24 -0
  243. package/dist/components/ui/FieldError.d.ts.map +1 -0
  244. package/dist/components/ui/FieldError.js +17 -0
  245. package/dist/components/ui/IconButton.d.ts +13 -0
  246. package/dist/components/ui/IconButton.d.ts.map +1 -0
  247. package/dist/components/ui/IconButton.js +10 -0
  248. package/dist/components/ui/Input.d.ts +37 -0
  249. package/dist/components/ui/Input.d.ts.map +1 -0
  250. package/dist/components/ui/Input.js +9 -0
  251. package/dist/components/ui/SaveIndicator.d.ts +8 -0
  252. package/dist/components/ui/SaveIndicator.d.ts.map +1 -0
  253. package/dist/components/ui/SaveIndicator.js +32 -0
  254. package/dist/components/ui/Select.d.ts +8 -0
  255. package/dist/components/ui/Select.d.ts.map +1 -0
  256. package/dist/components/ui/Select.js +9 -0
  257. package/dist/components/ui/Separator.d.ts +7 -0
  258. package/dist/components/ui/Separator.d.ts.map +1 -0
  259. package/dist/components/ui/Separator.js +8 -0
  260. package/dist/components/ui/Textarea.d.ts +8 -0
  261. package/dist/components/ui/Textarea.d.ts.map +1 -0
  262. package/dist/components/ui/Textarea.js +5 -0
  263. package/dist/components/ui/Tooltip.d.ts +9 -0
  264. package/dist/components/ui/Tooltip.d.ts.map +1 -0
  265. package/dist/components/ui/Tooltip.js +7 -0
  266. package/dist/components/ui/index.d.ts +14 -0
  267. package/dist/components/ui/index.d.ts.map +1 -0
  268. package/dist/components/ui/index.js +17 -0
  269. package/dist/data-schemas.d.mts +0 -1
  270. package/dist/data-schemas.d.mts.map +1 -1
  271. package/dist/data-schemas.d.ts +22 -0
  272. package/dist/data-schemas.d.ts.map +1 -0
  273. package/dist/data-schemas.js +51 -0
  274. package/dist/data-schemas.mjs +3 -4
  275. package/dist/data-schemas.mjs.map +1 -1
  276. package/dist/dev-entry.d.ts +2 -0
  277. package/dist/dev-entry.d.ts.map +1 -0
  278. package/dist/dev-entry.js +19 -0
  279. package/dist/dialog.d.mts +56 -0
  280. package/dist/dialog.d.mts.map +1 -0
  281. package/dist/dialog.mjs +67 -0
  282. package/dist/dialog.mjs.map +1 -0
  283. package/dist/hooks/index.d.ts +10 -0
  284. package/dist/hooks/index.d.ts.map +1 -0
  285. package/dist/hooks/index.js +7 -0
  286. package/dist/hooks/useCanvasTheme.d.ts +12 -0
  287. package/dist/hooks/useCanvasTheme.d.ts.map +1 -0
  288. package/dist/hooks/useCanvasTheme.js +33 -0
  289. package/dist/hooks/useClickOutside.d.ts +7 -0
  290. package/dist/hooks/useClickOutside.d.ts.map +1 -0
  291. package/dist/hooks/useClickOutside.js +18 -0
  292. package/dist/hooks/useDialogState.d.ts +23 -0
  293. package/dist/hooks/useDialogState.d.ts.map +1 -0
  294. package/dist/hooks/useDialogState.js +31 -0
  295. package/dist/hooks/useEditorPref.d.ts +2 -0
  296. package/dist/hooks/useEditorPref.d.ts.map +1 -0
  297. package/dist/hooks/useEditorPref.js +49 -0
  298. package/dist/hooks/useErrorModal.d.ts +15 -0
  299. package/dist/hooks/useErrorModal.d.ts.map +1 -0
  300. package/dist/hooks/useErrorModal.js +35 -0
  301. package/dist/hooks/useSiteBaseUrl.d.ts +10 -0
  302. package/dist/hooks/useSiteBaseUrl.d.ts.map +1 -0
  303. package/dist/hooks/useSiteBaseUrl.js +14 -0
  304. package/dist/hooks/useTheme.d.ts +13 -0
  305. package/dist/hooks/useTheme.d.ts.map +1 -0
  306. package/dist/hooks/useTheme.js +69 -0
  307. package/dist/hooks/useUnsavedChangesGuard.d.ts +16 -0
  308. package/dist/hooks/useUnsavedChangesGuard.d.ts.map +1 -0
  309. package/dist/hooks/useUnsavedChangesGuard.js +29 -0
  310. package/dist/hooks/useUpload.d.ts +10 -0
  311. package/dist/hooks/useUpload.d.ts.map +1 -0
  312. package/dist/hooks/useUpload.js +42 -0
  313. package/dist/hooks/useUploadFlow.d.ts +42 -0
  314. package/dist/hooks/useUploadFlow.d.ts.map +1 -0
  315. package/dist/hooks/useUploadFlow.js +148 -0
  316. package/dist/host-style-probe.d.ts +22 -0
  317. package/dist/host-style-probe.d.ts.map +1 -0
  318. package/dist/host-style-probe.js +508 -0
  319. package/dist/index.d.mts +167 -39
  320. package/dist/index.d.mts.map +1 -1
  321. package/dist/index.d.ts +10 -0
  322. package/dist/index.d.ts.map +1 -0
  323. package/dist/index.js +12 -0
  324. package/dist/index.mjs +36 -2
  325. package/dist/index.mjs.map +1 -0
  326. package/dist/lib/utils.d.ts +13 -0
  327. package/dist/lib/utils.d.ts.map +1 -0
  328. package/dist/lib/utils.js +47 -0
  329. package/dist/main-spa-781YUplS.mjs +46 -0
  330. package/dist/main-spa-781YUplS.mjs.map +1 -0
  331. package/dist/main-spa.d.ts +8 -0
  332. package/dist/main-spa.d.ts.map +1 -0
  333. package/dist/main-spa.js +61 -0
  334. package/dist/main.d.mts +1 -1
  335. package/dist/main.d.ts +2 -0
  336. package/dist/main.d.ts.map +1 -0
  337. package/dist/main.js +13 -0
  338. package/dist/main.mjs +11 -5681
  339. package/dist/main.mjs.map +1 -1
  340. package/dist/mdx-components.d.mts +207 -0
  341. package/dist/mdx-components.d.mts.map +1 -0
  342. package/dist/mdx-components.d.ts +204 -0
  343. package/dist/mdx-components.d.ts.map +1 -0
  344. package/dist/mdx-components.js +217 -0
  345. package/dist/mdx-components.mjs +208 -0
  346. package/dist/mdx-components.mjs.map +1 -0
  347. package/dist/media/AssetScopePill.d.ts +30 -0
  348. package/dist/media/AssetScopePill.d.ts.map +1 -0
  349. package/dist/media/AssetScopePill.js +30 -0
  350. package/dist/media/MediaIssueBadge.d.ts +33 -0
  351. package/dist/media/MediaIssueBadge.d.ts.map +1 -0
  352. package/dist/media/MediaIssueBadge.js +54 -0
  353. package/dist/media/types.d.ts +101 -0
  354. package/dist/media/types.d.ts.map +1 -0
  355. package/dist/media/types.js +1 -0
  356. package/dist/media/use-asset-scope.d.ts +25 -0
  357. package/dist/media/use-asset-scope.d.ts.map +1 -0
  358. package/dist/media/use-asset-scope.js +54 -0
  359. package/dist/media/use-media-issue.d.ts +24 -0
  360. package/dist/media/use-media-issue.d.ts.map +1 -0
  361. package/dist/media/use-media-issue.js +49 -0
  362. package/dist/mock-puck-config.d.mts +23 -0
  363. package/dist/mock-puck-config.d.mts.map +1 -0
  364. package/dist/mock-puck-config.d.ts +21 -0
  365. package/dist/mock-puck-config.d.ts.map +1 -0
  366. package/dist/mock-puck-config.js +73 -0
  367. package/dist/mock-puck-config.mjs +125 -0
  368. package/dist/mock-puck-config.mjs.map +1 -0
  369. package/dist/page-schemas.d.mts +139 -6
  370. package/dist/page-schemas.d.mts.map +1 -1
  371. package/dist/page-schemas.d.ts +156 -0
  372. package/dist/page-schemas.d.ts.map +1 -0
  373. package/dist/page-schemas.js +118 -0
  374. package/dist/page-schemas.mjs +74 -6
  375. package/dist/page-schemas.mjs.map +1 -1
  376. package/dist/puck-config.d.mts +0 -1
  377. package/dist/puck-config.d.mts.map +1 -1
  378. package/dist/puck-config.d.ts +31 -0
  379. package/dist/puck-config.d.ts.map +1 -0
  380. package/dist/puck-config.js +50 -0
  381. package/dist/puck-config.mjs +3 -4
  382. package/dist/puck-config.mjs.map +1 -1
  383. package/dist/selected-block.d.ts +61 -0
  384. package/dist/selected-block.d.ts.map +1 -0
  385. package/dist/selected-block.js +64 -0
  386. package/dist/site-styles.d.mts +90 -8
  387. package/dist/site-styles.d.mts.map +1 -1
  388. package/dist/site-styles.d.ts +121 -0
  389. package/dist/site-styles.d.ts.map +1 -0
  390. package/dist/site-styles.js +253 -0
  391. package/dist/site-styles.mjs +187 -5
  392. package/dist/site-styles.mjs.map +1 -1
  393. package/dist/spa/main.css +690 -127
  394. package/dist/toast.d.mts +7 -0
  395. package/dist/toast.d.mts.map +1 -0
  396. package/dist/toast.mjs +16 -0
  397. package/dist/toast.mjs.map +1 -0
  398. package/dist/types.d.ts +57 -0
  399. package/dist/types.d.ts.map +1 -0
  400. package/dist/types.js +1 -0
  401. package/dist/ui-CIacC6Mv.mjs +318 -0
  402. package/dist/ui-CIacC6Mv.mjs.map +1 -0
  403. package/dist/ui-config.d.ts +70 -0
  404. package/dist/ui-config.d.ts.map +1 -0
  405. package/dist/ui-config.js +44 -0
  406. package/dist/ui.d.mts +290 -0
  407. package/dist/ui.d.mts.map +1 -0
  408. package/dist/ui.mjs +2 -0
  409. package/dist/utils/asset-url.d.ts +3 -0
  410. package/dist/utils/asset-url.d.ts.map +1 -0
  411. package/dist/utils/asset-url.js +7 -0
  412. package/dist/utils/cn.d.ts +3 -0
  413. package/dist/utils/cn.d.ts.map +1 -0
  414. package/dist/utils/cn.js +5 -0
  415. package/dist/utils/format-date.d.ts +15 -0
  416. package/dist/utils/format-date.d.ts.map +1 -0
  417. package/dist/utils/format-date.js +37 -0
  418. package/dist/utils/mdast-to-html.d.ts +55 -0
  419. package/dist/utils/mdast-to-html.d.ts.map +1 -0
  420. package/dist/utils/mdast-to-html.js +206 -0
  421. package/dist/utils/mdast-tree.d.ts +104 -0
  422. package/dist/utils/mdast-tree.d.ts.map +1 -0
  423. package/dist/utils/mdast-tree.js +285 -0
  424. package/dist/utils/pageMetadata.d.ts +67 -0
  425. package/dist/utils/pageMetadata.d.ts.map +1 -0
  426. package/dist/utils/pageMetadata.js +161 -0
  427. package/dist/utils/slugify.d.ts +12 -0
  428. package/dist/utils/slugify.d.ts.map +1 -0
  429. package/dist/utils/slugify.js +17 -0
  430. package/dist/utils/zodIntrospect.d.ts +24 -0
  431. package/dist/utils/zodIntrospect.d.ts.map +1 -0
  432. package/dist/utils/zodIntrospect.js +88 -0
  433. package/package.json +148 -35
  434. package/styles/styles.css.d.ts +2 -0
  435. package/styles/tailwind-theme.css +126 -0
  436. package/styles/tailwind-theme.css.d.ts +2 -0
  437. package/dist/puck-C9_F3_cJ.mjs +0 -1589
  438. package/dist/puck-C9_F3_cJ.mjs.map +0 -1
@@ -0,0 +1,13 @@
1
+ import { type BaseMDXEditorProps } from '@conloca/mdx';
2
+ import type { MDXEditorMethods } from '@mdxeditor/editor';
3
+ export interface CMSMDXEditorProps extends Omit<BaseMDXEditorProps, 'disableImageSettingsButton' | 'extraPlugins' | 'extraToolbarItems' | 'imageButtonRef' | 'imageDialog' | 'imageUploadHandler' | 'jsxComponentDescriptors' | 'onImageShortcut'> {
4
+ /**
5
+ * Route URL whose styles should be applied in the editor (eg `/getting-started/`).
6
+ * When set, the editor fetches the host's real CSS for that route from
7
+ * the CMS integration's `/api/styles` endpoint and injects it. Falls back
8
+ * to the static `editorStyles` registry if unset or the fetch fails.
9
+ */
10
+ previewRouteUrl?: string;
11
+ }
12
+ export declare const CMSMDXEditor: import("react").ForwardRefExoticComponent<CMSMDXEditorProps & import("react").RefAttributes<MDXEditorMethods>>;
13
+ //# sourceMappingURL=CMSMDXEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CMSMDXEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editor/CMSMDXEditor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAA0B,gBAAgB,EAAe,MAAM,mBAAmB,CAAC;AAmB/F,MAAM,WAAW,iBACf,SAAQ,IAAI,CACV,kBAAkB,EAChB,4BAA4B,GAC5B,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,GACb,oBAAoB,GACpB,yBAAyB,GACzB,iBAAiB,CACpB;IACD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,YAAY,gHAuIvB,CAAC"}
@@ -0,0 +1,123 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useUploadAsset } from '@conloca/content-api-client';
3
+ import { BaseMDXEditor } from '@conloca/mdx';
4
+ import { forwardRef, useCallback, useMemo, useRef } from 'react';
5
+ import { useTheme } from '../../hooks/useTheme';
6
+ import { buildUploadFormData } from '../../hooks/useUpload';
7
+ import { useProbedHostStyles } from '../../host-style-probe';
8
+ import { isJsxDescriptor, toJsxComponentDescriptor, useMdxComponents } from '../../mdx-components';
9
+ import { useEditorStyles, useFetchedHostWrappers, useFetchedSiteStyles, useInjectHostStyles, } from '../../site-styles';
10
+ import { GenericBlock } from './GenericBlock';
11
+ import { hostWrapperPlugin } from './host-wrapper-plugin';
12
+ import { ImagePickerDialog } from './ImagePickerDialog';
13
+ import { InsertMdxComponentButton } from './insert-menu/InsertMdxComponentButton';
14
+ import { mdxComponentsPlugin } from './insert-menu/mdx-components-plugin';
15
+ export const CMSMDXEditor = forwardRef(({ previewRouteUrl, ...props }, ref) => {
16
+ const insertImageRef = useRef(null);
17
+ const uploadAsset = useUploadAsset();
18
+ const registeredMdxComponents = useMdxComponents();
19
+ // Style injection has two paths:
20
+ //
21
+ // 1. `useFetchedSiteStyles(previewRouteUrl)` — auto-discovery. When a
22
+ // route URL is provided, ask the integration for that route's full
23
+ // effective CSS (Tailwind, theme, scoped styles) so the editor
24
+ // matches the published page without the host curating a list.
25
+ // 2. `useEditorStyles()` — the original, manually-configured narrow path.
26
+ // Fallback when no route URL is available or the fetch fails.
27
+ //
28
+ // Both inject into the `conloca-host-preview` layer (declared in
29
+ // main.css after `cms-admin`) so host rules sit at a predictable spot
30
+ // in the cascade — admin chrome wins on collisions via layer order.
31
+ const fetchedStyles = useFetchedSiteStyles(previewRouteUrl);
32
+ const staticEditorStyles = useEditorStyles();
33
+ const activeStyles = fetchedStyles.length > 0 ? fetchedStyles : staticEditorStyles;
34
+ // The editor mounts directly in the parent SPA's React tree (the
35
+ // EditorFrame iframe was removed). Host CSS is injected globally
36
+ // into the page document; chrome that visibly collides with the
37
+ // host's Tailwind utilities uses the cms-admin semantic palette
38
+ // (`bg-panel`, `text-foreground`, `border-line`, etc.) whose class
39
+ // names the host's Tailwind can't generate. See main.css's `@theme`
40
+ // and `@utility` blocks for the chrome token definitions.
41
+ //
42
+ // The host can also append raw CSS via the integration's `editorCSS`
43
+ // option (see `ConlocaCMSOptions`) — concatenated AFTER auto-
44
+ // discovered styles so it sits later in the same cascade layer and
45
+ // wins on tie-breaks. Empty string when the host didn't set it; no
46
+ // marker `<style>` is emitted for the no-op case.
47
+ const editorCSS = import.meta.env.CONLOCA_EDITOR_CSS || '';
48
+ const styleStack = useMemo(() => (editorCSS ? [...activeStyles, editorCSS] : activeStyles), [activeStyles]);
49
+ useInjectHostStyles('conloca-host-preview', styleStack);
50
+ // Probe the host's computed styles for each prose tag from the
51
+ // actual live page and synthesize a stylesheet scoped to the
52
+ // editor's contenteditable. This catches what the wrapper auto-
53
+ // copy misses: utility-class-styled elements (Tailwind utility-
54
+ // first), inline `style` attributes, and any other styling that
55
+ // resolves to computed values but isn't reachable via a wrapper-
56
+ // and-descendant cascade. See `host-style-probe.ts` for the
57
+ // walk-the-iframe approach. Empty string when the probe hasn't
58
+ // resolved yet or the page had nothing to probe.
59
+ // Discover the host page's content-root shape (eg `<article class="card">`
60
+ // on Starlight) AND its code-block chrome wrapper (eg `<div class=
61
+ // "expressive-code">`). The editor wraps its contenteditable in a clone
62
+ // of `content` via `hostWrapperPlugin`, so host CSS paints the prose
63
+ // surface naturally. It also threads `codeBlock` through to the
64
+ // code-block frame component (in @conloca/mdx) so it can carry the host's
65
+ // code-block classes and inherit the host's code-block CSS the same way.
66
+ const hostWrappers = useFetchedHostWrappers(previewRouteUrl);
67
+ // Probe the host's computed styles for each prose tag from the
68
+ // actual live page and synthesize a stylesheet scoped to the
69
+ // editor's contenteditable. This catches what the wrapper auto-
70
+ // copy misses: utility-class-styled elements (Tailwind utility-
71
+ // first), inline `style` attributes, and any other styling that
72
+ // resolves to computed values but isn't reachable via a wrapper-
73
+ // and-descendant cascade. The probe takes the discovered wrapper
74
+ // class so it queries the same element inside the iframe — avoids
75
+ // duplicate find-wrapper logic. Empty string while the probe is in
76
+ // flight or when the page has nothing probable.
77
+ // Editor and published page maintain independent theme preferences
78
+ // (CMS SPA → `conloca-theme`; Starlight → `starlight-theme`). The
79
+ // probe needs to capture styles in the EDITOR's current scheme, not
80
+ // the published page's, so we pass our resolved theme through. When
81
+ // the user toggles theme inside the editor, the hook's dep on
82
+ // `theme` re-runs the probe and the new computed values land.
83
+ const { resolvedTheme } = useTheme();
84
+ const probedStyles = useProbedHostStyles(previewRouteUrl, hostWrappers.content?.className ?? null, {
85
+ theme: resolvedTheme,
86
+ });
87
+ const probedStack = useMemo(() => (probedStyles ? [probedStyles] : []), [probedStyles]);
88
+ useInjectHostStyles('conloca-host-defaults', probedStack);
89
+ // Recompose the plugins list whenever the wrappers change so the plugin
90
+ // re-runs its `update` and the wrapper component refreshes inside the
91
+ // editor. The hostWrapperPlugin's renderers read reactively from their
92
+ // own Cells, so we DON'T need to remount the entire editor for this.
93
+ const extraPlugins = useMemo(() => [
94
+ mdxComponentsPlugin(),
95
+ hostWrapperPlugin({ wrapper: hostWrappers.content, codeBlockWrapper: hostWrappers.codeBlock }),
96
+ ], [hostWrappers]);
97
+ const jsxComponentDescriptors = useMemo(
98
+ // Filter to JSX flavors before translating — snippets live in the same
99
+ // registry but aren't valid input for @mdxeditor/editor's jsxPlugin, and
100
+ // toJsxComponentDescriptor throws if handed one to surface the misuse.
101
+ () => registeredMdxComponents
102
+ .filter(isJsxDescriptor)
103
+ .map((descriptor) => toJsxComponentDescriptor(descriptor, GenericBlock)), [registeredMdxComponents]);
104
+ // Wire paste/drop image uploads to the same backend mutation that powers
105
+ // the asset library's UploadModal. The library expects a Promise<string>
106
+ // resolving to the image src; we hand back the canonical
107
+ // `/assets/{folder}/{filename}` path so it round-trips identically to a
108
+ // path picked from the asset browser.
109
+ const imageUploadHandler = useCallback(async (file) => {
110
+ const formData = await buildUploadFormData(file, undefined, '/');
111
+ const asset = await uploadAsset.mutateAsync(formData);
112
+ const folder = asset.folder && asset.folder !== '/' ? asset.folder : '';
113
+ return `/assets${folder}/${asset.filename}`;
114
+ }, [uploadAsset]);
115
+ return (_jsx(BaseMDXEditor, { ref: ref, ...props, imageDialog: ImagePickerDialog, disableImageSettingsButton: true, imageButtonRef: insertImageRef, imageUploadHandler: imageUploadHandler, jsxComponentDescriptors: jsxComponentDescriptors, extraPlugins: extraPlugins, extraToolbarItems: _jsx(InsertMdxComponentButton, {}), onImageShortcut: () => {
116
+ if (insertImageRef.current) {
117
+ insertImageRef.current.click();
118
+ return;
119
+ }
120
+ console.warn('[CMSMDXEditor] InsertImage ref not attached - toolbar may not be rendered');
121
+ } }));
122
+ });
123
+ CMSMDXEditor.displayName = 'CMSMDXEditor';
@@ -0,0 +1,10 @@
1
+ import type { ContentData } from '@conloca/content-api-client';
2
+ interface ContentDiffProps {
3
+ localContent: ContentData;
4
+ serverContent: ContentData;
5
+ onResolve?: (resolvedContent: ContentData) => void;
6
+ editable?: boolean;
7
+ }
8
+ export declare function ContentDiff({ localContent, serverContent, onResolve, editable }: ContentDiffProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=ContentDiff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentDiff.d.ts","sourceRoot":"","sources":["../../../src/components/editor/ContentDiff.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D,UAAU,gBAAgB;IACxB,YAAY,EAAE,WAAW,CAAC;IAC1B,aAAa,EAAE,WAAW,CAAC;IAC3B,SAAS,CAAC,EAAE,CAAC,eAAe,EAAE,WAAW,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,QAAgB,EAAE,EAAE,gBAAgB,2CA0BzG"}
@@ -0,0 +1,51 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Textarea } from '../ui';
4
+ export function ContentDiff({ localContent, serverContent, onResolve, editable = false }) {
5
+ // Determine content type
6
+ const isMDX = localContent.mdx !== undefined || serverContent.mdx !== undefined;
7
+ const isPuck = localContent.puckData !== undefined || serverContent.puckData !== undefined;
8
+ if (isMDX) {
9
+ return (_jsx(MDXDiff, { localMdx: localContent.mdx || '', serverMdx: serverContent.mdx || '', onResolve: editable ? (resolved) => onResolve?.({ mdx: resolved }) : undefined }));
10
+ }
11
+ if (isPuck) {
12
+ return (_jsx(PuckDiff, { localPuck: localContent.puckData, serverPuck: serverContent.puckData, onResolve: editable ? (resolved) => onResolve?.({ puckData: resolved }) : undefined }));
13
+ }
14
+ return _jsx("div", { className: "text-grey-05 dark:text-grey-06", children: "No content to diff" });
15
+ }
16
+ function MDXDiff({ localMdx, serverMdx, onResolve }) {
17
+ const [editableContent, setEditableContent] = useState(null);
18
+ // Create git-style conflict markers
19
+ const conflictContent = createMDXConflictMarkers(localMdx, serverMdx);
20
+ const displayContent = editableContent ?? conflictContent;
21
+ const isEditing = editableContent !== null;
22
+ return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("h3", { className: "font-semibold", children: "MDX Content Conflict" }), _jsxs("div", { className: "flex gap-2", children: [!isEditing && onResolve && (_jsx("button", { type: "button", onClick: () => setEditableContent(conflictContent), className: "px-3 py-1 text-sm bg-azure-04 text-white rounded-md hover:bg-azure-03", children: "Edit to Resolve" })), isEditing && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: () => {
23
+ onResolve?.(displayContent);
24
+ setEditableContent(null);
25
+ }, className: "px-3 py-1 text-sm bg-green-05 text-white rounded-md hover:bg-green-04", children: "Accept Resolution" }), _jsx("button", { type: "button", onClick: () => setEditableContent(null), className: "px-3 py-1 text-sm bg-grey-05 text-white rounded-md hover:bg-grey-04", children: "Cancel" })] }))] })] }), isEditing ? (_jsx(Textarea, { value: displayContent, onChange: (e) => setEditableContent(e.target.value), className: "h-96 p-4 font-mono text-sm", placeholder: "Resolve the conflict by editing the content..." })) : (_jsx("pre", { className: "p-4 bg-grey-12 dark:bg-grey-02 rounded-md border overflow-x-auto text-sm font-mono whitespace-pre-wrap", children: displayContent })), _jsxs("div", { className: "text-sm text-grey-04 dark:text-grey-07", children: [_jsxs("p", { children: [_jsx("strong", { children: "Instructions:" }), " Resolve conflicts by:"] }), _jsxs("ul", { className: "list-disc list-inside space-y-1", children: [_jsxs("li", { children: ["Remove the conflict markers (", _jsx("code", { children: "<<<<<<<" }), ", ", _jsx("code", { children: "=======" }), ",", ' ', _jsx("code", { children: ">>>>>>>" }), ")"] }), _jsx("li", { children: "Keep the content you want from either version" }), _jsx("li", { children: "Edit as needed to create the final version" })] })] })] }));
26
+ }
27
+ function PuckDiff({ localPuck, serverPuck, onResolve }) {
28
+ const [selectedVersion, setSelectedVersion] = useState(null);
29
+ return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("h3", { className: "font-semibold", children: "Puck Content Conflict" }), onResolve && selectedVersion && (_jsxs("button", { type: "button", onClick: () => onResolve(selectedVersion === 'local' ? localPuck : serverPuck), className: "px-3 py-1 text-sm bg-green-05 text-white rounded-md hover:bg-green-04", children: ["Use ", selectedVersion === 'local' ? 'Your' : 'Server', " Version"] }))] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: `p-4 rounded-md border-2 cursor-pointer transition-colors ${selectedVersion === 'local'
30
+ ? 'border-green-05 bg-green-11 dark:bg-green-02'
31
+ : 'border-line bg-grey-12 dark:bg-grey-02 hover:border-grey-08 dark:hover:border-grey-06'}`, onClick: () => setSelectedVersion('local'), children: [_jsxs("h4", { className: "font-semibold mb-2 flex items-center gap-2", children: [_jsx("input", { type: "radio", checked: selectedVersion === 'local', onChange: () => setSelectedVersion('local') }), _jsx("span", { "data-testid": "conflict-comparison-yours", children: "Your Version" })] }), _jsx("div", { className: "text-sm", children: _jsx(ComponentStructure, { data: localPuck }) })] }), _jsxs("div", { className: `p-4 rounded-md border-2 cursor-pointer transition-colors ${selectedVersion === 'server'
32
+ ? 'border-red-04 bg-red-11 dark:bg-red-02'
33
+ : 'border-line bg-grey-12 dark:bg-grey-02 hover:border-grey-08 dark:hover:border-grey-06'}`, onClick: () => setSelectedVersion('server'), children: [_jsxs("h4", { className: "font-semibold mb-2 flex items-center gap-2", children: [_jsx("input", { type: "radio", checked: selectedVersion === 'server', onChange: () => setSelectedVersion('server') }), _jsx("span", { "data-testid": "conflict-comparison-server", children: "Server Version" })] }), _jsx("div", { className: "text-sm", children: _jsx(ComponentStructure, { data: serverPuck }) })] })] }), _jsx("div", { className: "text-sm text-grey-04 dark:text-grey-07", children: _jsxs("p", { children: [_jsx("strong", { children: "Instructions:" }), " Select the version you want to keep. For Puck content, you typically need to choose one complete version rather than merging."] }) })] }));
34
+ }
35
+ // Helper component to show Puck component structure
36
+ function ComponentStructure({ data }) {
37
+ if (!data?.content) {
38
+ return _jsx("div", { className: "text-grey-06 dark:text-grey-05", children: "No content" });
39
+ }
40
+ const componentCount = data.content?.length || 0;
41
+ const rootProps = data.root || {};
42
+ return (_jsxs("div", { className: "space-y-2", children: [_jsxs("div", { children: [_jsx("strong", { children: "Components:" }), " ", componentCount] }), data.root?.title && (_jsxs("div", { children: [_jsx("strong", { children: "Page Title:" }), " ", data.root.title] })), Object.keys(rootProps).length > 0 && (_jsxs("details", { className: "cursor-pointer", children: [_jsx("summary", { className: "font-medium", children: "Root Properties" }), _jsx("pre", { className: "mt-1 text-xs overflow-x-auto", children: JSON.stringify(rootProps, null, 2) })] })), componentCount > 0 && (_jsxs("details", { className: "cursor-pointer", children: [_jsx("summary", { className: "font-medium", children: "Components" }), _jsx("div", { className: "mt-1 space-y-1", children: data.content.map((component, i) => (_jsxs("div", { className: "text-xs p-2 bg-white dark:bg-grey-02 rounded-md", children: [_jsx("strong", { children: component.type || 'Unknown' }), component.props?.title && ` - ${component.props.title}`] }, i))) })] }))] }));
43
+ }
44
+ // Create git-style conflict markers for MDX content
45
+ function createMDXConflictMarkers(localMdx, serverMdx) {
46
+ // For now, if content differs, show full conflict
47
+ if (localMdx.trim() === serverMdx.trim()) {
48
+ return localMdx; // No conflict
49
+ }
50
+ return ['<<<<<<< Your changes', localMdx, '=======', serverMdx, '>>>>>>> Server changes'].join('\n');
51
+ }
@@ -0,0 +1,26 @@
1
+ interface CreateBlockDialogProps {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ /**
5
+ * Called with the new block's id (and etag, if returned) after the server
6
+ * confirms creation. Consumers typically navigate to `/blocks/:id` or wire
7
+ * the id back into a parent field (Puck `onChange`).
8
+ */
9
+ onCreated: (result: {
10
+ id: string;
11
+ etag?: string;
12
+ }) => void;
13
+ }
14
+ /**
15
+ * Metadata-first "new block" dialog. Asks for a title, then creates the
16
+ * entity server-side with a one-line MDX scaffold (`# <title>` plus a
17
+ * blank-line prompt) and hands the new id back to the parent.
18
+ *
19
+ * Replaces the old "metadata dialog → fullscreen MDX modal" two-step. The
20
+ * page-route editor (`/blocks/:id`) takes over after creation, giving the
21
+ * user the full unsaved-changes guard, conflict recovery, and locale
22
+ * switching that the modal lacked.
23
+ */
24
+ export declare function CreateBlockDialog({ isOpen, onClose, onCreated }: CreateBlockDialogProps): import("react/jsx-runtime").JSX.Element | null;
25
+ export {};
26
+ //# sourceMappingURL=CreateBlockDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateBlockDialog.d.ts","sourceRoot":"","sources":["../../../src/components/editor/CreateBlockDialog.tsx"],"names":[],"mappings":"AA6CA,UAAU,sBAAsB;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,sBAAsB,kDAiIvF"}
@@ -0,0 +1,131 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { APIClientError, ErrorCodes, useCreateContent } from '@conloca/content-api-client';
3
+ import { useEffect, useState } from 'react';
4
+ import { slugify } from '../../utils/slugify';
5
+ import { Button, Input } from '../ui';
6
+ // Friendly inline copy for the typed failures the server can return when
7
+ // creating a block. The dialog renders the result under the title field and
8
+ // stays open so the user can rename and retry. Returns undefined for codes
9
+ // we don't have a tailored message for, letting the caller fall back to the
10
+ // raw error.message.
11
+ function mapCreateErrorCode(code) {
12
+ switch (code) {
13
+ case ErrorCodes.NAME_TAKEN:
14
+ case ErrorCodes.ALREADY_EXISTS:
15
+ return 'A block with this name already exists. Please choose a different title.';
16
+ case ErrorCodes.PATHNAME_TAKEN:
17
+ return 'A page with that pathname already exists. Please choose a different title.';
18
+ case ErrorCodes.INVALID_REQUEST:
19
+ return 'The block name is invalid. Use letters, numbers, or hyphens.';
20
+ case ErrorCodes.METADATA_TOO_LARGE:
21
+ return 'The metadata is too large. Please shorten the title or description.';
22
+ default:
23
+ return undefined;
24
+ }
25
+ }
26
+ // Same mapping, keyed by the structural `reason` field from CreateResult.
27
+ // Defensive — the API currently always returns non-2xx for failures, so we
28
+ // usually go through the APIClientError path above.
29
+ function mapCreateErrorReason(reason) {
30
+ switch (reason) {
31
+ case 'name_taken':
32
+ case 'already_exists':
33
+ return 'A block with this name already exists. Please choose a different title.';
34
+ case 'pathname_taken':
35
+ return 'A page with that pathname already exists. Please choose a different title.';
36
+ case 'invalid_name':
37
+ return 'The block name is invalid. Use letters, numbers, or hyphens.';
38
+ case 'metadata_too_large':
39
+ return 'The metadata is too large. Please shorten the title or description.';
40
+ default:
41
+ return undefined;
42
+ }
43
+ }
44
+ /**
45
+ * Metadata-first "new block" dialog. Asks for a title, then creates the
46
+ * entity server-side with a one-line MDX scaffold (`# <title>` plus a
47
+ * blank-line prompt) and hands the new id back to the parent.
48
+ *
49
+ * Replaces the old "metadata dialog → fullscreen MDX modal" two-step. The
50
+ * page-route editor (`/blocks/:id`) takes over after creation, giving the
51
+ * user the full unsaved-changes guard, conflict recovery, and locale
52
+ * switching that the modal lacked.
53
+ */
54
+ export function CreateBlockDialog({ isOpen, onClose, onCreated }) {
55
+ const createContent = useCreateContent();
56
+ const [titleInput, setTitleInput] = useState('');
57
+ const [error, setError] = useState(null);
58
+ // Reset transient state every time the dialog re-opens so a previously
59
+ // dismissed error / typed title doesn't leak into a fresh create flow.
60
+ useEffect(() => {
61
+ if (isOpen) {
62
+ setTitleInput('');
63
+ setError(null);
64
+ }
65
+ }, [isOpen]);
66
+ if (!isOpen) {
67
+ return null;
68
+ }
69
+ const isPending = createContent.isPending;
70
+ const canSubmit = !!titleInput.trim() && !isPending;
71
+ const handleSubmit = async () => {
72
+ const title = titleInput.trim();
73
+ if (!title) {
74
+ setError('Enter a block title before continuing.');
75
+ return;
76
+ }
77
+ setError(null);
78
+ const initialContent = `# ${title}\n\nWrite your content here.\n`;
79
+ try {
80
+ const result = await createContent.mutateAsync({
81
+ kind: 'block',
82
+ collection: 'blocks',
83
+ type: 'mdx',
84
+ name: slugify(title) || 'untitled',
85
+ meta: { title },
86
+ locales: {
87
+ en: {
88
+ meta: { title },
89
+ content: {
90
+ mdx: initialContent,
91
+ },
92
+ },
93
+ },
94
+ });
95
+ if (result.success && result.id) {
96
+ onCreated({ id: result.id, etag: result.etag });
97
+ return;
98
+ }
99
+ // Defensive: if the API ever decides to return success: false in a
100
+ // 2xx body (it currently does not), fall back to result.reason.
101
+ setError(mapCreateErrorReason(result.reason) || result.error?.message || 'Failed to create block.');
102
+ }
103
+ catch (err) {
104
+ // The server-side createContent surfaces typed failures as non-2xx
105
+ // responses (409 name_taken, 400 invalid_name, etc.) which the API
106
+ // client converts into APIClientError with an `error.code`. Map
107
+ // those codes onto friendly inline copy. Unknown errors fall back
108
+ // to the raw message.
109
+ if (err instanceof APIClientError) {
110
+ setError(mapCreateErrorCode(err.code) || err.message || 'Failed to create block.');
111
+ return;
112
+ }
113
+ console.error('Failed to create block:', err);
114
+ setError(err instanceof Error ? err.message : 'Failed to create block. Please try again.');
115
+ }
116
+ };
117
+ return (_jsx("div", { className: "fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50", role: "dialog", "aria-modal": "true", "aria-labelledby": "create-block-dialog-title", children: _jsxs("div", { className: "bg-overlay rounded-lg p-6 w-full max-w-md", "data-testid": "create-block-dialog", children: [_jsx("h2", { id: "create-block-dialog-title", className: "text-xl font-semibold text-grey-01 dark:text-grey-12 mb-4", children: "Create New Block" }), _jsxs("div", { className: "mb-4", children: [_jsx("label", { htmlFor: "block-title", className: "block text-sm font-medium mb-2 text-grey-01 dark:text-grey-12", children: "Block Title" }), _jsx(Input, { id: "block-title", type: "text", value: titleInput, onChange: (e) => {
118
+ setTitleInput(e.target.value);
119
+ // Clear stale error as soon as the user edits the field —
120
+ // otherwise the "name taken" message lingers even after the
121
+ // user has typed a different title.
122
+ if (error)
123
+ setError(null);
124
+ }, onKeyDown: (e) => {
125
+ if (e.key === 'Enter') {
126
+ e.preventDefault();
127
+ if (canSubmit)
128
+ void handleSubmit();
129
+ }
130
+ }, placeholder: "Enter block title...", autoFocus: true, error: !!error, "data-testid": "block-title-input", disabled: isPending }), _jsx("p", { className: "mt-2 text-sm text-grey-04 dark:text-grey-07", children: "This will be used as the display name for your block" })] }), error ? (_jsx("p", { className: "mb-4 text-sm text-red-04", role: "alert", "data-testid": "create-block-error", children: error })) : null, _jsxs("div", { className: "flex justify-end gap-3", children: [_jsx(Button, { variant: "outline", onClick: onClose, disabled: isPending, children: "Cancel" }), _jsx(Button, { variant: "primary", onClick: handleSubmit, disabled: !canSubmit, "data-testid": "create-block-submit", children: isPending ? 'Creating...' : 'Create' })] })] }) }));
131
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ interface DrawerItemOverrideProps {
3
+ children: ReactNode;
4
+ name: string;
5
+ }
6
+ export declare function DrawerItemOverride({ children, name }: DrawerItemOverrideProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=DrawerItemOverride.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawerItemOverride.d.ts","sourceRoot":"","sources":["../../../src/components/editor/DrawerItemOverride.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAMD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,uBAAuB,2CAkD7E"}
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useGetPuck } from '@puckeditor/core';
3
+ function generateId(componentType) {
4
+ return `${componentType}-${crypto.randomUUID()}`;
5
+ }
6
+ export function DrawerItemOverride({ children, name }) {
7
+ const getPuck = useGetPuck();
8
+ const handleDoubleClick = () => {
9
+ const puck = getPuck();
10
+ if (!puck?.dispatch)
11
+ return;
12
+ // Use setData action to add a new component to the root content
13
+ const currentData = puck.appState.data;
14
+ const id = generateId(name);
15
+ // Merge defaultProps from the component config so the new component renders correctly.
16
+ // Puck's native drag-drop insert action does this automatically, but setData bypasses it.
17
+ const componentConfig = puck.config?.components?.[name];
18
+ const defaultProps = componentConfig?.defaultProps ?? {};
19
+ const newComponent = {
20
+ type: name,
21
+ props: { ...defaultProps, id },
22
+ };
23
+ puck.dispatch({
24
+ type: 'setData',
25
+ data: {
26
+ ...currentData,
27
+ content: [...(currentData.content || []), newComponent],
28
+ },
29
+ });
30
+ };
31
+ const handleKeyDown = (e) => {
32
+ if (e.key === 'Enter') {
33
+ handleDoubleClick();
34
+ }
35
+ else if (e.key === ' ') {
36
+ e.preventDefault();
37
+ handleDoubleClick();
38
+ }
39
+ };
40
+ return (_jsx("div", { role: "button", tabIndex: 0, onDoubleClick: handleDoubleClick, onKeyDown: handleKeyDown, "data-testid": `drawer-item-${name}`, children: children }));
41
+ }
@@ -0,0 +1,16 @@
1
+ interface EditorChromeTogglesProps {
2
+ /** Omit (or pass `false`) on surfaces where live preview isn't supported,
3
+ * e.g. the page editor whose `import`-ed JSX components the in-browser
4
+ * MDX compiler can't resolve. */
5
+ previewOpen?: boolean;
6
+ onTogglePreview?: () => void;
7
+ }
8
+ /**
9
+ * Compact row of editor-level toggles rendered in the header next to the
10
+ * save button. The chrome toggles operate on the editor *view*, not the
11
+ * content — they belong with Cancel/Save, not with the content-insertion
12
+ * tools (which now live entirely in the editor toolbar).
13
+ */
14
+ export declare function EditorChromeToggles({ previewOpen, onTogglePreview }: EditorChromeTogglesProps): import("react/jsx-runtime").JSX.Element | null;
15
+ export {};
16
+ //# sourceMappingURL=EditorChromeToggles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorChromeToggles.d.ts","sourceRoot":"","sources":["../../../src/components/editor/EditorChromeToggles.tsx"],"names":[],"mappings":"AAEA,UAAU,wBAAwB;IAChC;;sCAEkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,EAAE,wBAAwB,kDAkB7F"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Eye, EyeOff } from 'lucide-react';
3
+ /**
4
+ * Compact row of editor-level toggles rendered in the header next to the
5
+ * save button. The chrome toggles operate on the editor *view*, not the
6
+ * content — they belong with Cancel/Save, not with the content-insertion
7
+ * tools (which now live entirely in the editor toolbar).
8
+ */
9
+ export function EditorChromeToggles({ previewOpen, onTogglePreview }) {
10
+ const showPreviewToggle = previewOpen !== undefined && onTogglePreview !== undefined;
11
+ if (!showPreviewToggle)
12
+ return null;
13
+ const previewLabel = previewOpen ? 'Hide live preview' : 'Show live preview';
14
+ const PreviewIcon = previewOpen ? EyeOff : Eye;
15
+ return (_jsx("button", { type: "button", onClick: onTogglePreview, "aria-pressed": previewOpen, "aria-label": previewLabel, title: previewLabel, className: `p-2 rounded text-muted hover:bg-hover ${previewOpen ? 'bg-hover text-foreground' : ''}`, children: _jsx(PreviewIcon, { size: 16, "aria-hidden": true }) }));
16
+ }
@@ -0,0 +1,3 @@
1
+ import type { JsxEditorProps } from '@mdxeditor/editor';
2
+ export declare function GenericBlock({ mdastNode }: JsxEditorProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=GenericBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericBlock.d.ts","sourceRoot":"","sources":["../../../src/components/editor/GenericBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAmyBxD,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE,cAAc,2CA0ezD"}