camox 0.7.0 → 0.7.2

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 (275) hide show
  1. package/dist/components/AuthGate.js +3 -1
  2. package/dist/core/components/AddBlockControlBar.js +4 -2
  3. package/dist/core/components/lexical/InlineContentEditable.js +4 -2
  4. package/dist/core/components/lexical/InlineLexicalEditor.js +3 -1
  5. package/dist/core/components/lexical/InlineParagraphNode.js +3 -1
  6. package/dist/core/components/lexical/SelectionBroadcaster.js +3 -1
  7. package/dist/core/components/lexical/SidebarLexicalEditor.js +3 -1
  8. package/dist/core/components/lexical/editorConfig.js +3 -1
  9. package/dist/core/createApp.d.ts +760 -691
  10. package/dist/core/createApp.js +2 -1
  11. package/dist/core/createBlock.d.ts +1027 -1001
  12. package/dist/core/createBlock.js +6 -4
  13. package/dist/core/createLayout.d.ts +111 -105
  14. package/dist/core/createLayout.js +3 -1
  15. package/dist/core/hooks/useFieldSelection.js +3 -1
  16. package/dist/core/hooks/useIsEditable.js +3 -1
  17. package/dist/core/hooks/useOverlayMessage.js +3 -1
  18. package/dist/core/lib/contentType.d.ts +141 -138
  19. package/dist/core/lib/contentType.js +4 -2
  20. package/dist/core/lib/fieldTypes.js +4 -2
  21. package/dist/core/lib/lexicalReact.js +3 -1
  22. package/dist/core/lib/lexicalState.js +3 -1
  23. package/dist/core/lib/modifierFormats.js +4 -3
  24. package/dist/core/lib/modifiers.js +5 -3
  25. package/dist/features/content/CamoxContent.d.ts +6 -2
  26. package/dist/features/content/CamoxContent.js +4 -2
  27. package/dist/features/content/components/AssetCard.js +4 -2
  28. package/dist/features/content/components/AssetCardSkeleton.js +4 -2
  29. package/dist/features/content/components/ContentSidebar.js +4 -2
  30. package/dist/features/content/components/UploadDropZone.js +3 -1
  31. package/dist/features/content/components/UploadProgressDrawer.js +3 -1
  32. package/dist/features/metadata/sitemap.d.ts +7 -5
  33. package/dist/features/metadata/sitemap.js +3 -1
  34. package/dist/features/preview/CamoxPreview.d.ts +35 -29
  35. package/dist/features/preview/CamoxPreview.js +7 -5
  36. package/dist/features/preview/components/AddBlockSheet.js +5 -3
  37. package/dist/features/preview/components/AgentChatSheet.js +4 -2
  38. package/dist/features/preview/components/AssetFieldEditor.js +5 -3
  39. package/dist/features/preview/components/AssetLightbox.js +4 -2
  40. package/dist/features/preview/components/AssetPickerGrid.js +4 -2
  41. package/dist/features/preview/components/BlockActionsPopover.js +4 -2
  42. package/dist/features/preview/components/CreatePageSheet.js +4 -2
  43. package/dist/features/preview/components/DebouncedFieldEditor.js +4 -2
  44. package/dist/features/preview/components/EditPageSheet.js +8 -6
  45. package/dist/features/preview/components/FieldOverlayStyles.js +6 -4
  46. package/dist/features/preview/components/Frame.js +5 -3
  47. package/dist/features/preview/components/ItemFieldsEditor.js +6 -4
  48. package/dist/features/preview/components/LinkFieldEditor.js +5 -3
  49. package/dist/features/preview/components/MultipleAssetFieldEditor.js +5 -3
  50. package/dist/features/preview/components/OverlayTracker.js +4 -2
  51. package/dist/features/preview/components/Overlays.js +4 -2
  52. package/dist/features/preview/components/PageContentSheet.js +7 -5
  53. package/dist/features/preview/components/PageLocationFieldset.js +5 -3
  54. package/dist/features/preview/components/PagePicker.js +5 -3
  55. package/dist/features/preview/components/PageTree.js +13 -11
  56. package/dist/features/preview/components/PeekedBlock.js +4 -2
  57. package/dist/features/preview/components/PreviewPanel.js +6 -4
  58. package/dist/features/preview/components/PreviewSideSheet.js +4 -2
  59. package/dist/features/preview/components/PreviewToolbar.js +4 -2
  60. package/dist/features/preview/components/RepeatableItemsList.js +5 -3
  61. package/dist/features/preview/components/ShikiMarkdown.js +5 -3
  62. package/dist/features/preview/components/TextFormatToolbar.js +5 -3
  63. package/dist/features/preview/components/UnlinkAssetButton.js +4 -2
  64. package/dist/features/preview/components/useUpdateBlockPosition.js +4 -2
  65. package/dist/features/preview/overlayMessages.js +2 -1
  66. package/dist/features/preview/previewStore.js +4 -2
  67. package/dist/features/provider/CamoxProvider.d.ts +20 -10
  68. package/dist/features/provider/CamoxProvider.js +5 -3
  69. package/dist/features/provider/actionsStore.js +4 -2
  70. package/dist/features/provider/components/CamoxAppContext.js +5 -3
  71. package/dist/features/provider/components/CommandPalette.js +3 -1
  72. package/dist/features/provider/useAdminShortcuts.js +3 -1
  73. package/dist/features/routes/ogRoute.d.ts +11 -6
  74. package/dist/features/routes/ogRoute.js +2 -1
  75. package/dist/features/routes/pageRoute.d.ts +56 -46
  76. package/dist/features/routes/pageRoute.js +6 -4
  77. package/dist/features/studio/CamoxStudio.d.ts +10 -5
  78. package/dist/features/studio/CamoxStudio.js +4 -2
  79. package/dist/features/studio/components/EnvironmentMenu.js +4 -2
  80. package/dist/features/studio/components/Navbar.js +5 -3
  81. package/dist/features/studio/components/ProjectMenu.js +5 -3
  82. package/dist/features/studio/components/UserButton.js +4 -2
  83. package/dist/features/studio/studioStore.js +4 -2
  84. package/dist/features/studio/useTheme.js +3 -1
  85. package/dist/features/vite/appGeneration.js +4 -2
  86. package/dist/features/vite/blockBoilerplate.js +4 -2
  87. package/dist/features/vite/definitionsSync.js +5 -3
  88. package/dist/features/vite/routeGeneration.js +4 -2
  89. package/dist/features/vite/skillGeneration.js +5 -3
  90. package/dist/features/vite/utils.js +3 -1
  91. package/dist/features/vite/vite.d.ts +20 -21
  92. package/dist/features/vite/vite.js +26 -16
  93. package/dist/hooks/use-file-upload.js +4 -1
  94. package/dist/hooks/use-marquee-selection.js +4 -2
  95. package/dist/lib/analytics-client.js +5 -3
  96. package/dist/lib/analytics.js +4 -3
  97. package/dist/lib/api-client-server.js +3 -1
  98. package/dist/lib/api-client.d.ts +7 -1198
  99. package/dist/lib/api-client.js +7 -5
  100. package/dist/lib/auth.js +4 -2
  101. package/dist/lib/normalized-data.js +7 -5
  102. package/dist/lib/queries.d.ts +9 -791
  103. package/dist/lib/queries.js +13 -11
  104. package/dist/lib/use-project-room.js +4 -2
  105. package/dist/lib/utils.js +3 -1
  106. package/package.json +10 -11
  107. package/dist/components/AuthGate.d.ts +0 -7
  108. package/dist/components/AuthGate.d.ts.map +0 -1
  109. package/dist/core/components/AddBlockControlBar.d.ts +0 -9
  110. package/dist/core/components/AddBlockControlBar.d.ts.map +0 -1
  111. package/dist/core/components/lexical/InlineContentEditable.d.ts +0 -7
  112. package/dist/core/components/lexical/InlineContentEditable.d.ts.map +0 -1
  113. package/dist/core/components/lexical/InlineLexicalEditor.d.ts +0 -10
  114. package/dist/core/components/lexical/InlineLexicalEditor.d.ts.map +0 -1
  115. package/dist/core/components/lexical/InlineParagraphNode.d.ts +0 -10
  116. package/dist/core/components/lexical/InlineParagraphNode.d.ts.map +0 -1
  117. package/dist/core/components/lexical/SelectionBroadcaster.d.ts +0 -6
  118. package/dist/core/components/lexical/SelectionBroadcaster.d.ts.map +0 -1
  119. package/dist/core/components/lexical/SidebarLexicalEditor.d.ts +0 -9
  120. package/dist/core/components/lexical/SidebarLexicalEditor.d.ts.map +0 -1
  121. package/dist/core/components/lexical/editorConfig.d.ts +0 -4
  122. package/dist/core/components/lexical/editorConfig.d.ts.map +0 -1
  123. package/dist/core/createApp.d.ts.map +0 -1
  124. package/dist/core/createBlock.d.ts.map +0 -1
  125. package/dist/core/createLayout.d.ts.map +0 -1
  126. package/dist/core/hooks/useFieldSelection.d.ts +0 -8
  127. package/dist/core/hooks/useFieldSelection.d.ts.map +0 -1
  128. package/dist/core/hooks/useIsEditable.d.ts +0 -2
  129. package/dist/core/hooks/useIsEditable.d.ts.map +0 -1
  130. package/dist/core/hooks/useOverlayMessage.d.ts +0 -10
  131. package/dist/core/hooks/useOverlayMessage.d.ts.map +0 -1
  132. package/dist/core/lib/contentType.d.ts.map +0 -1
  133. package/dist/core/lib/fieldTypes.d.ts +0 -92
  134. package/dist/core/lib/fieldTypes.d.ts.map +0 -1
  135. package/dist/core/lib/lexicalReact.d.ts +0 -7
  136. package/dist/core/lib/lexicalReact.d.ts.map +0 -1
  137. package/dist/core/lib/lexicalState.d.ts +0 -10
  138. package/dist/core/lib/lexicalState.d.ts.map +0 -1
  139. package/dist/core/lib/modifierFormats.d.ts +0 -9
  140. package/dist/core/lib/modifierFormats.d.ts.map +0 -1
  141. package/dist/core/lib/modifiers.d.ts +0 -12
  142. package/dist/core/lib/modifiers.d.ts.map +0 -1
  143. package/dist/features/content/CamoxContent.d.ts.map +0 -1
  144. package/dist/features/content/components/AssetCard.d.ts +0 -10
  145. package/dist/features/content/components/AssetCard.d.ts.map +0 -1
  146. package/dist/features/content/components/AssetCardSkeleton.d.ts +0 -2
  147. package/dist/features/content/components/AssetCardSkeleton.d.ts.map +0 -1
  148. package/dist/features/content/components/ContentSidebar.d.ts +0 -2
  149. package/dist/features/content/components/ContentSidebar.d.ts.map +0 -1
  150. package/dist/features/content/components/UploadDropZone.d.ts +0 -9
  151. package/dist/features/content/components/UploadDropZone.d.ts.map +0 -1
  152. package/dist/features/content/components/UploadProgressDrawer.d.ts +0 -11
  153. package/dist/features/content/components/UploadProgressDrawer.d.ts.map +0 -1
  154. package/dist/features/metadata/sitemap.d.ts.map +0 -1
  155. package/dist/features/preview/CamoxPreview.d.ts.map +0 -1
  156. package/dist/features/preview/components/AddBlockSheet.d.ts +0 -3
  157. package/dist/features/preview/components/AddBlockSheet.d.ts.map +0 -1
  158. package/dist/features/preview/components/AgentChatSheet.d.ts +0 -3
  159. package/dist/features/preview/components/AgentChatSheet.d.ts.map +0 -1
  160. package/dist/features/preview/components/AssetFieldEditor.d.ts +0 -18
  161. package/dist/features/preview/components/AssetFieldEditor.d.ts.map +0 -1
  162. package/dist/features/preview/components/AssetLightbox.d.ts +0 -8
  163. package/dist/features/preview/components/AssetLightbox.d.ts.map +0 -1
  164. package/dist/features/preview/components/AssetPickerGrid.d.ts +0 -11
  165. package/dist/features/preview/components/AssetPickerGrid.d.ts.map +0 -1
  166. package/dist/features/preview/components/BlockActionsPopover.d.ts +0 -15
  167. package/dist/features/preview/components/BlockActionsPopover.d.ts.map +0 -1
  168. package/dist/features/preview/components/CreatePageSheet.d.ts +0 -3
  169. package/dist/features/preview/components/CreatePageSheet.d.ts.map +0 -1
  170. package/dist/features/preview/components/DebouncedFieldEditor.d.ts +0 -10
  171. package/dist/features/preview/components/DebouncedFieldEditor.d.ts.map +0 -1
  172. package/dist/features/preview/components/EditPageSheet.d.ts +0 -3
  173. package/dist/features/preview/components/EditPageSheet.d.ts.map +0 -1
  174. package/dist/features/preview/components/FieldOverlayStyles.d.ts +0 -2
  175. package/dist/features/preview/components/FieldOverlayStyles.d.ts.map +0 -1
  176. package/dist/features/preview/components/Frame.d.ts +0 -20
  177. package/dist/features/preview/components/Frame.d.ts.map +0 -1
  178. package/dist/features/preview/components/ItemFieldsEditor.d.ts +0 -28
  179. package/dist/features/preview/components/ItemFieldsEditor.d.ts.map +0 -1
  180. package/dist/features/preview/components/LinkFieldEditor.d.ts +0 -8
  181. package/dist/features/preview/components/LinkFieldEditor.d.ts.map +0 -1
  182. package/dist/features/preview/components/MultipleAssetFieldEditor.d.ts +0 -9
  183. package/dist/features/preview/components/MultipleAssetFieldEditor.d.ts.map +0 -1
  184. package/dist/features/preview/components/OverlayTracker.d.ts +0 -6
  185. package/dist/features/preview/components/OverlayTracker.d.ts.map +0 -1
  186. package/dist/features/preview/components/Overlays.d.ts +0 -6
  187. package/dist/features/preview/components/Overlays.d.ts.map +0 -1
  188. package/dist/features/preview/components/PageContentSheet.d.ts +0 -3
  189. package/dist/features/preview/components/PageContentSheet.d.ts.map +0 -1
  190. package/dist/features/preview/components/PageLocationFieldset.d.ts +0 -14
  191. package/dist/features/preview/components/PageLocationFieldset.d.ts.map +0 -1
  192. package/dist/features/preview/components/PagePicker.d.ts +0 -3
  193. package/dist/features/preview/components/PagePicker.d.ts.map +0 -1
  194. package/dist/features/preview/components/PageTree.d.ts +0 -3
  195. package/dist/features/preview/components/PageTree.d.ts.map +0 -1
  196. package/dist/features/preview/components/PeekedBlock.d.ts +0 -6
  197. package/dist/features/preview/components/PeekedBlock.d.ts.map +0 -1
  198. package/dist/features/preview/components/PreviewPanel.d.ts +0 -12
  199. package/dist/features/preview/components/PreviewPanel.d.ts.map +0 -1
  200. package/dist/features/preview/components/PreviewSideSheet.d.ts +0 -13
  201. package/dist/features/preview/components/PreviewSideSheet.d.ts.map +0 -1
  202. package/dist/features/preview/components/PreviewToolbar.d.ts +0 -2
  203. package/dist/features/preview/components/PreviewToolbar.d.ts.map +0 -1
  204. package/dist/features/preview/components/RepeatableItemsList.d.ts +0 -17
  205. package/dist/features/preview/components/RepeatableItemsList.d.ts.map +0 -1
  206. package/dist/features/preview/components/ShikiMarkdown.d.ts +0 -4
  207. package/dist/features/preview/components/ShikiMarkdown.d.ts.map +0 -1
  208. package/dist/features/preview/components/TextFormatToolbar.d.ts +0 -2
  209. package/dist/features/preview/components/TextFormatToolbar.d.ts.map +0 -1
  210. package/dist/features/preview/components/UnlinkAssetButton.d.ts +0 -8
  211. package/dist/features/preview/components/UnlinkAssetButton.d.ts.map +0 -1
  212. package/dist/features/preview/components/useUpdateBlockPosition.d.ts +0 -67
  213. package/dist/features/preview/components/useUpdateBlockPosition.d.ts.map +0 -1
  214. package/dist/features/preview/overlayMessages.d.ts +0 -62
  215. package/dist/features/preview/overlayMessages.d.ts.map +0 -1
  216. package/dist/features/preview/previewConstants.d.ts +0 -2
  217. package/dist/features/preview/previewConstants.d.ts.map +0 -1
  218. package/dist/features/preview/previewStore.d.ts +0 -123
  219. package/dist/features/preview/previewStore.d.ts.map +0 -1
  220. package/dist/features/preview/studio-overlays.css?inline.js +0 -4
  221. package/dist/features/provider/CamoxProvider.d.ts.map +0 -1
  222. package/dist/features/provider/actionsStore.d.ts +0 -35
  223. package/dist/features/provider/actionsStore.d.ts.map +0 -1
  224. package/dist/features/provider/components/CamoxAppContext.d.ts +0 -771
  225. package/dist/features/provider/components/CamoxAppContext.d.ts.map +0 -1
  226. package/dist/features/provider/components/CommandPalette.d.ts +0 -3
  227. package/dist/features/provider/components/CommandPalette.d.ts.map +0 -1
  228. package/dist/features/provider/useAdminShortcuts.d.ts +0 -5
  229. package/dist/features/provider/useAdminShortcuts.d.ts.map +0 -1
  230. package/dist/features/routes/ogRoute.d.ts.map +0 -1
  231. package/dist/features/routes/pageRoute.d.ts.map +0 -1
  232. package/dist/features/studio/CamoxStudio.d.ts.map +0 -1
  233. package/dist/features/studio/components/EnvironmentMenu.d.ts +0 -2
  234. package/dist/features/studio/components/EnvironmentMenu.d.ts.map +0 -1
  235. package/dist/features/studio/components/Navbar.d.ts +0 -4
  236. package/dist/features/studio/components/Navbar.d.ts.map +0 -1
  237. package/dist/features/studio/components/ProjectMenu.d.ts +0 -2
  238. package/dist/features/studio/components/ProjectMenu.d.ts.map +0 -1
  239. package/dist/features/studio/components/UserButton.d.ts +0 -2
  240. package/dist/features/studio/components/UserButton.d.ts.map +0 -1
  241. package/dist/features/studio/studioStore.d.ts +0 -17
  242. package/dist/features/studio/studioStore.d.ts.map +0 -1
  243. package/dist/features/studio/useTheme.d.ts +0 -9
  244. package/dist/features/studio/useTheme.d.ts.map +0 -1
  245. package/dist/features/vite/appGeneration.d.ts +0 -4
  246. package/dist/features/vite/appGeneration.d.ts.map +0 -1
  247. package/dist/features/vite/blockBoilerplate.d.ts +0 -3
  248. package/dist/features/vite/blockBoilerplate.d.ts.map +0 -1
  249. package/dist/features/vite/definitionsSync.d.ts +0 -19
  250. package/dist/features/vite/definitionsSync.d.ts.map +0 -1
  251. package/dist/features/vite/routeGeneration.d.ts +0 -14
  252. package/dist/features/vite/routeGeneration.d.ts.map +0 -1
  253. package/dist/features/vite/skillGeneration.d.ts +0 -4
  254. package/dist/features/vite/skillGeneration.d.ts.map +0 -1
  255. package/dist/features/vite/utils.d.ts +0 -2
  256. package/dist/features/vite/utils.d.ts.map +0 -1
  257. package/dist/features/vite/vite.d.ts.map +0 -1
  258. package/dist/hooks/use-file-upload.d.ts +0 -23
  259. package/dist/hooks/use-file-upload.d.ts.map +0 -1
  260. package/dist/hooks/use-marquee-selection.d.ts +0 -17
  261. package/dist/hooks/use-marquee-selection.d.ts.map +0 -1
  262. package/dist/lib/analytics-client.d.ts +0 -3
  263. package/dist/lib/analytics-client.d.ts.map +0 -1
  264. package/dist/lib/analytics.d.ts +0 -3
  265. package/dist/lib/analytics.d.ts.map +0 -1
  266. package/dist/lib/api-client-server.d.ts +0 -5
  267. package/dist/lib/api-client-server.d.ts.map +0 -1
  268. package/dist/lib/api-client.d.ts.map +0 -1
  269. package/dist/lib/normalized-data.d.ts +0 -96
  270. package/dist/lib/normalized-data.d.ts.map +0 -1
  271. package/dist/lib/queries.d.ts.map +0 -1
  272. package/dist/lib/use-project-room.d.ts +0 -2
  273. package/dist/lib/use-project-room.d.ts.map +0 -1
  274. package/dist/lib/utils.d.ts +0 -40
  275. package/dist/lib/utils.d.ts.map +0 -1
@@ -25,9 +25,10 @@ import { generateKeyBetween } from "fractional-indexing";
25
25
  import * as React from "react";
26
26
  import { createPortal } from "react-dom";
27
27
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
28
+
28
29
  //#region src/core/createBlock.tsx
29
30
  /** Normalize legacy links (no `type` field) to the new union shape */
30
- var normalizeLinkValue = (value) => {
31
+ const normalizeLinkValue = (value) => {
31
32
  if (!value.type) return {
32
33
  type: "external",
33
34
  ...value
@@ -35,11 +36,11 @@ var normalizeLinkValue = (value) => {
35
36
  return value;
36
37
  };
37
38
  /** Resolve a LinkValue to an href string */
38
- var resolveLinkHref = (link, pages) => {
39
+ const resolveLinkHref = (link, pages) => {
39
40
  if (link.type === "page") return (pages?.find((p) => String(p.id) === link.pageId))?.fullPath ?? "#";
40
41
  return link.href;
41
42
  };
42
- var hasShownEmbedLockToast = false;
43
+ let hasShownEmbedLockToast = false;
43
44
  /**
44
45
  * Recursively walks schema properties to generate RepeatableItemSeed objects.
45
46
  * Sets `_itemId` placeholder markers on `content` for each repeatable field,
@@ -1563,5 +1564,6 @@ function _temp0(state_0) {
1563
1564
  function _temp1(state_1) {
1564
1565
  return state_1.context.isPageContentSheetOpen;
1565
1566
  }
1567
+
1566
1568
  //#endregion
1567
- export { Type, createBlock };
1569
+ export { Type, createBlock };
@@ -1,115 +1,121 @@
1
1
  import * as React from "react";
2
- export interface OgImageParams {
3
- title: string;
4
- description: string;
5
- projectName: string;
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/core/createLayout.d.ts
5
+ interface OgImageParams {
6
+ title: string;
7
+ description: string;
8
+ projectName: string;
6
9
  }
7
- export interface LayoutBlockData {
8
- _id: string;
9
- type: string;
10
- content: Record<string, unknown>;
11
- settings?: Record<string, unknown>;
12
- position: string;
10
+ interface LayoutBlockData {
11
+ _id: string;
12
+ type: string;
13
+ content: Record<string, unknown>;
14
+ settings?: Record<string, unknown>;
15
+ position: string;
13
16
  }
14
17
  /** Minimal block interface — avoids importing the full generic Block type. */
15
18
  interface LayoutBlock {
16
- id: string;
17
- Component: React.ComponentType<{
18
- blockData: any;
19
- mode: "site" | "peek" | "layout";
20
- isFirstBlock?: boolean;
21
- showAddBlockTop?: boolean;
22
- showAddBlockBottom?: boolean;
23
- addBlockAfterPosition?: string | null;
19
+ id: string;
20
+ Component: React.ComponentType<{
21
+ blockData: any;
22
+ mode: "site" | "peek" | "layout";
23
+ isFirstBlock?: boolean;
24
+ showAddBlockTop?: boolean;
25
+ showAddBlockBottom?: boolean;
26
+ addBlockAfterPosition?: string | null;
27
+ }>;
28
+ getInitialBundle: () => {
29
+ content: Record<string, unknown>;
30
+ settings: Record<string, unknown>;
31
+ repeatableItems: Array<{
32
+ tempId: string;
33
+ parentTempId: string | null;
34
+ fieldName: string;
35
+ content: Record<string, unknown>;
36
+ position: string;
24
37
  }>;
25
- getInitialBundle: () => {
26
- content: Record<string, unknown>;
27
- settings: Record<string, unknown>;
28
- repeatableItems: Array<{
29
- tempId: string;
30
- parentTempId: string | null;
31
- fieldName: string;
32
- content: Record<string, unknown>;
33
- position: string;
34
- }>;
35
- };
38
+ };
36
39
  }
37
40
  interface CreateLayoutOptions {
38
- id: string;
39
- title: string;
40
- description: string;
41
- blocks: {
42
- before: LayoutBlock[];
43
- after: LayoutBlock[];
44
- };
45
- /** Ordered list of blocks to create on the initial page when a project is first set up. */
46
- initialBlocks?: LayoutBlock[];
47
- component: React.ComponentType<{
48
- children: React.ReactNode;
49
- }>;
50
- buildMetaTitle: (params: {
51
- pageMetaTitle: string;
52
- projectName: string;
53
- pageFullPath: string;
54
- }) => string;
55
- buildOgImage?: (params: OgImageParams) => React.ReactElement;
41
+ id: string;
42
+ title: string;
43
+ description: string;
44
+ blocks: {
45
+ before: LayoutBlock[];
46
+ after: LayoutBlock[];
47
+ };
48
+ /** Ordered list of blocks to create on the initial page when a project is first set up. */
49
+ initialBlocks?: LayoutBlock[];
50
+ component: React.ComponentType<{
51
+ children: React.ReactNode;
52
+ }>;
53
+ buildMetaTitle: (params: {
54
+ pageMetaTitle: string;
55
+ projectName: string;
56
+ pageFullPath: string;
57
+ }) => string;
58
+ buildOgImage?: (params: OgImageParams) => React.ReactElement;
56
59
  }
57
- export declare function createLayout(options: CreateLayoutOptions): {
58
- id: string;
59
- title: string;
60
- description: string;
61
- buildMetaTitle: (params: {
62
- pageMetaTitle: string;
63
- projectName: string;
64
- pageFullPath: string;
65
- }) => string;
66
- buildOgImage: ((params: OgImageParams) => Promise<Response>) | undefined;
67
- blockDefinitions: ({
68
- type: string;
69
- content: Record<string, unknown>;
70
- settings: Record<string, unknown>;
71
- repeatableItems: {
72
- tempId: string;
73
- parentTempId: string | null;
74
- fieldName: string;
75
- content: Record<string, unknown>;
76
- position: string;
77
- }[];
78
- placement: "before";
79
- } | {
80
- type: string;
81
- content: Record<string, unknown>;
82
- settings: Record<string, unknown>;
83
- repeatableItems: {
84
- tempId: string;
85
- parentTempId: string | null;
86
- fieldName: string;
87
- content: Record<string, unknown>;
88
- position: string;
89
- }[];
90
- placement: "after";
91
- })[];
92
- initialBlockBundles: {
93
- type: string;
94
- content: Record<string, unknown>;
95
- settings: Record<string, unknown>;
96
- repeatableItems: {
97
- tempId: string;
98
- parentTempId: string | null;
99
- fieldName: string;
100
- content: Record<string, unknown>;
101
- position: string;
102
- }[];
103
- }[] | undefined;
104
- component: React.ComponentType<{
105
- children: React.ReactNode;
106
- }>;
107
- Provider: ({ layoutBlocks, children, }: {
108
- layoutBlocks: Record<string, LayoutBlockData>;
109
- children: React.ReactNode;
110
- }) => import("react/jsx-runtime").JSX.Element;
111
- blocks: Record<string, React.ComponentType>;
60
+ declare function createLayout(options: CreateLayoutOptions): {
61
+ id: string;
62
+ title: string;
63
+ description: string;
64
+ buildMetaTitle: (params: {
65
+ pageMetaTitle: string;
66
+ projectName: string;
67
+ pageFullPath: string;
68
+ }) => string;
69
+ buildOgImage: ((params: OgImageParams) => Promise<Response>) | undefined;
70
+ blockDefinitions: ({
71
+ type: string;
72
+ content: Record<string, unknown>;
73
+ settings: Record<string, unknown>;
74
+ repeatableItems: {
75
+ tempId: string;
76
+ parentTempId: string | null;
77
+ fieldName: string;
78
+ content: Record<string, unknown>;
79
+ position: string;
80
+ }[];
81
+ placement: "before";
82
+ } | {
83
+ type: string;
84
+ content: Record<string, unknown>;
85
+ settings: Record<string, unknown>;
86
+ repeatableItems: {
87
+ tempId: string;
88
+ parentTempId: string | null;
89
+ fieldName: string;
90
+ content: Record<string, unknown>;
91
+ position: string;
92
+ }[];
93
+ placement: "after";
94
+ })[];
95
+ initialBlockBundles: {
96
+ type: string;
97
+ content: Record<string, unknown>;
98
+ settings: Record<string, unknown>;
99
+ repeatableItems: {
100
+ tempId: string;
101
+ parentTempId: string | null;
102
+ fieldName: string;
103
+ content: Record<string, unknown>;
104
+ position: string;
105
+ }[];
106
+ }[] | undefined;
107
+ component: React.ComponentType<{
108
+ children: React.ReactNode;
109
+ }>;
110
+ Provider: ({
111
+ layoutBlocks,
112
+ children
113
+ }: {
114
+ layoutBlocks: Record<string, LayoutBlockData>;
115
+ children: React.ReactNode;
116
+ }) => _$react_jsx_runtime0.JSX.Element;
117
+ blocks: Record<string, React.ComponentType>;
112
118
  };
113
- export type Layout = ReturnType<typeof createLayout>;
114
- export {};
115
- //# sourceMappingURL=createLayout.d.ts.map
119
+ type Layout = ReturnType<typeof createLayout>;
120
+ //#endregion
121
+ export { Layout, LayoutBlockData, OgImageParams, createLayout };
@@ -1,6 +1,7 @@
1
1
  import { c } from "react/compiler-runtime";
2
2
  import * as React from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
+
4
5
  //#region src/core/createLayout.tsx
5
6
  function toPascalCase(str) {
6
7
  return str.split(/[-_\s]+/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
@@ -119,5 +120,6 @@ function createLayout(options) {
119
120
  blocks: slotComponents
120
121
  };
121
122
  }
123
+
122
124
  //#endregion
123
- export { createLayout };
125
+ export { createLayout };
@@ -1,6 +1,7 @@
1
1
  import { previewStore } from "../../features/preview/previewStore.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { useSelector } from "@xstate/store/react";
4
+
4
5
  //#region src/core/hooks/useFieldSelection.ts
5
6
  /**
6
7
  * Returns whether the given field is currently selected based on the normalized selection state.
@@ -32,5 +33,6 @@ function useFieldSelection(blockId, fieldName, fieldType, repeaterItemId) {
32
33
  } else t0 = $[4];
33
34
  return useSelector(previewStore, t0);
34
35
  }
36
+
35
37
  //#endregion
36
- export { useFieldSelection };
38
+ export { useFieldSelection };
@@ -1,6 +1,7 @@
1
1
  import { previewStore } from "../../features/preview/previewStore.js";
2
2
  import { useIsAuthenticated } from "../../lib/auth.js";
3
3
  import { useSelector } from "@xstate/store/react";
4
+
4
5
  //#region src/core/hooks/useIsEditable.ts
5
6
  function useIsEditable(mode) {
6
7
  const isAuthenticated = useIsAuthenticated();
@@ -14,5 +15,6 @@ function _temp2(state_0) {
14
15
  function _temp(state) {
15
16
  return state.context.isPresentationMode;
16
17
  }
18
+
17
19
  //#endregion
18
- export { useIsEditable };
20
+ export { useIsEditable };
@@ -1,6 +1,7 @@
1
1
  import { isOverlayMessage } from "../../features/preview/overlayMessages.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import * as React from "react";
4
+
4
5
  //#region src/core/hooks/useOverlayMessage.ts
5
6
  /**
6
7
  * Listens for a pair of overlay start/end messages on the iframe window and
@@ -64,5 +65,6 @@ function _temp(t0) {
64
65
  const [, v] = t0;
65
66
  return v === void 0;
66
67
  }
68
+
67
69
  //#endregion
68
- export { useOverlayMessage };
70
+ export { useOverlayMessage };
@@ -1,164 +1,167 @@
1
- import { TSchema, TUnsafe, TArray, TObject } from '@sinclair/typebox';
2
- export type ExtractPlaceholders<S extends string> = S extends `${string}{{${infer Key}}}${infer Rest}` ? Key | ExtractPlaceholders<Rest> : never;
3
- export type ExtractAllPlaceholders<T extends readonly string[]> = ExtractPlaceholders<T[number]>;
1
+ import * as _$_sinclair_typebox0 from "@sinclair/typebox";
2
+ import { TArray, TObject, TSchema, TUnsafe } from "@sinclair/typebox";
3
+
4
+ //#region src/core/lib/contentType.d.ts
5
+ type ExtractPlaceholders<S extends string> = S extends `${string}{{${infer Key}}}${infer Rest}` ? Key | ExtractPlaceholders<Rest> : never;
6
+ type ExtractAllPlaceholders<T extends readonly string[]> = ExtractPlaceholders<T[number]>;
4
7
  declare const EmbedURLBrand: unique symbol;
5
- export type EmbedURL = string & {
6
- readonly [EmbedURLBrand]: true;
8
+ type EmbedURL = string & {
9
+ readonly [EmbedURLBrand]: true;
7
10
  };
8
11
  declare const LinkBrand: unique symbol;
9
- export type LinkValue = ({
10
- type: "external";
11
- href: string;
12
+ type LinkValue = ({
13
+ type: "external";
14
+ href: string;
12
15
  } | {
13
- type: "page";
14
- pageId: string;
16
+ type: "page";
17
+ pageId: string;
15
18
  }) & {
16
- text: string;
17
- newTab: boolean;
19
+ text: string;
20
+ newTab: boolean;
18
21
  } & {
19
- readonly [LinkBrand]: true;
22
+ readonly [LinkBrand]: true;
20
23
  };
21
- export type ImageValue = {
22
- url: string;
23
- alt: string;
24
- filename: string;
25
- mimeType: string;
26
- _fileId?: string;
24
+ type ImageValue = {
25
+ url: string;
26
+ alt: string;
27
+ filename: string;
28
+ mimeType: string;
29
+ _fileId?: string;
27
30
  } & {
28
- readonly __brand: "ImageValue";
31
+ readonly __brand: "ImageValue";
29
32
  };
30
- export type FileValue = {
31
- url: string;
32
- alt: string;
33
- filename: string;
34
- mimeType: string;
35
- _fileId?: string;
33
+ type FileValue = {
34
+ url: string;
35
+ alt: string;
36
+ filename: string;
37
+ mimeType: string;
38
+ _fileId?: string;
36
39
  } & {
37
- readonly __brand: "FileValue";
40
+ readonly __brand: "FileValue";
38
41
  };
39
42
  declare function _imageType(options: {
40
- title?: string;
41
- multiple: true;
42
- defaultItems: number;
43
+ title?: string;
44
+ multiple: true;
45
+ defaultItems: number;
43
46
  }): TArray<TObject<{
44
- image: TUnsafe<ImageValue>;
47
+ image: TUnsafe<ImageValue>;
45
48
  }>>;
46
49
  declare function _imageType(options: {
47
- title?: string;
48
- multiple?: false;
50
+ title?: string;
51
+ multiple?: false;
49
52
  }): TUnsafe<ImageValue>;
50
53
  declare function _fileType(options: {
51
- accept: string[];
52
- title?: string;
53
- multiple: true;
54
- defaultItems: number;
54
+ accept: string[];
55
+ title?: string;
56
+ multiple: true;
57
+ defaultItems: number;
55
58
  }): TArray<TObject<{
56
- file: TUnsafe<FileValue>;
59
+ file: TUnsafe<FileValue>;
57
60
  }>>;
58
61
  declare function _fileType(options: {
59
- accept: string[];
60
- title?: string;
61
- multiple?: false;
62
+ accept: string[];
63
+ title?: string;
64
+ multiple?: false;
62
65
  }): TUnsafe<FileValue>;
63
66
  /**
64
67
  * Type builders for createBlock content schemas.
65
68
  * All fields must have default values.
66
69
  */
67
- export declare const Type: {
68
- /**
69
- * Creates a string field with a required default value.
70
- *
71
- * @example
72
- * Type.String({ default: 'Hello' })
73
- * Type.String({ default: 'Hello', maxLength: 100, title: 'Title' })
74
- */
75
- String: (options: {
76
- default: string;
77
- title?: string;
78
- maxLength?: number;
79
- minLength?: number;
80
- pattern?: string;
81
- }) => TUnsafe<string>;
82
- /**
83
- * Creates a repeatable array of object items.
84
- * The default array is auto-generated based on minItems.
85
- *
86
- * @example
87
- * Type.RepeatableItem({
88
- * title: Type.String({ default: 'Item' }),
89
- * description: Type.String({ default: 'Description' })
90
- * }, {
91
- * minItems: 1,
92
- * maxItems: 10,
93
- * title: 'Items'
94
- * })
95
- */
96
- RepeatableItem: <T extends Record<string, TSchema>, const TMarkdown extends readonly string[] = readonly string[]>(shape: T, options: {
97
- minItems: number;
98
- maxItems: number;
99
- title?: string;
100
- } & ([ExtractAllPlaceholders<TMarkdown>] extends [Extract<keyof T, string>] ? {
101
- toMarkdown?: TMarkdown;
102
- } : {
103
- toMarkdown?: readonly [`Invalid toMarkdown placeholder: "{{${Exclude<ExtractAllPlaceholders<TMarkdown>, Extract<keyof T, string>>}}}"`];
104
- })) => TArray<TObject<T>>;
105
- /**
106
- * Creates an enum field with a set of predefined options.
107
- *
108
- * @example
109
- * Type.Enum({
110
- * default: 'left',
111
- * options: { left: 'Left', center: 'Center', right: 'Right' },
112
- * title: 'Alignment'
113
- * })
114
- */
115
- Enum: (options: {
116
- default: string;
117
- options: Record<string, string>;
118
- title?: string;
119
- }) => TUnsafe<string>;
120
- /**
121
- * Creates a boolean toggle field.
122
- *
123
- * @example
124
- * Type.Boolean({ default: false, title: 'Show background' })
125
- */
126
- Boolean: (options: {
127
- default: boolean;
128
- title?: string;
129
- }) => import('@sinclair/typebox').TBoolean;
130
- /**
131
- * Creates an embed field for URLs matching a specific pattern.
132
- *
133
- * @example
134
- * Type.Embed({
135
- * pattern: 'https:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=.+',
136
- * default: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
137
- * title: 'YouTube URL'
138
- * })
139
- */
140
- Embed: (options: {
141
- pattern: string;
142
- default: string;
143
- title?: string;
144
- }) => TUnsafe<EmbedURL>;
145
- /**
146
- * Creates a link field with text, href/pageId, and newTab properties.
147
- * Supports both external URLs and internal page links.
148
- *
149
- * @example
150
- * Type.Link({ default: { text: 'Learn more', href: '/', newTab: false }, title: 'CTA' })
151
- */
152
- Link: (options: {
153
- default: {
154
- text: string;
155
- href: string;
156
- newTab: boolean;
157
- };
158
- title?: string;
159
- }) => TUnsafe<LinkValue>;
160
- Image: typeof _imageType;
161
- File: typeof _fileType;
70
+ declare const Type$1: {
71
+ /**
72
+ * Creates a string field with a required default value.
73
+ *
74
+ * @example
75
+ * Type.String({ default: 'Hello' })
76
+ * Type.String({ default: 'Hello', maxLength: 100, title: 'Title' })
77
+ */
78
+ String: (options: {
79
+ default: string;
80
+ title?: string;
81
+ maxLength?: number;
82
+ minLength?: number;
83
+ pattern?: string;
84
+ }) => TUnsafe<string>;
85
+ /**
86
+ * Creates a repeatable array of object items.
87
+ * The default array is auto-generated based on minItems.
88
+ *
89
+ * @example
90
+ * Type.RepeatableItem({
91
+ * title: Type.String({ default: 'Item' }),
92
+ * description: Type.String({ default: 'Description' })
93
+ * }, {
94
+ * minItems: 1,
95
+ * maxItems: 10,
96
+ * title: 'Items'
97
+ * })
98
+ */
99
+ RepeatableItem: <T extends Record<string, TSchema>, const TMarkdown extends readonly string[] = readonly string[]>(shape: T, options: {
100
+ minItems: number;
101
+ maxItems: number;
102
+ title?: string;
103
+ } & ([ExtractAllPlaceholders<TMarkdown>] extends [Extract<keyof T, string>] ? {
104
+ toMarkdown?: TMarkdown;
105
+ } : {
106
+ toMarkdown?: readonly [`Invalid toMarkdown placeholder: "{{${Exclude<ExtractAllPlaceholders<TMarkdown>, Extract<keyof T, string>>}}}"`];
107
+ })) => TArray<TObject<T>>;
108
+ /**
109
+ * Creates an enum field with a set of predefined options.
110
+ *
111
+ * @example
112
+ * Type.Enum({
113
+ * default: 'left',
114
+ * options: { left: 'Left', center: 'Center', right: 'Right' },
115
+ * title: 'Alignment'
116
+ * })
117
+ */
118
+ Enum: (options: {
119
+ default: string;
120
+ options: Record<string, string>;
121
+ title?: string;
122
+ }) => TUnsafe<string>;
123
+ /**
124
+ * Creates a boolean toggle field.
125
+ *
126
+ * @example
127
+ * Type.Boolean({ default: false, title: 'Show background' })
128
+ */
129
+ Boolean: (options: {
130
+ default: boolean;
131
+ title?: string;
132
+ }) => _$_sinclair_typebox0.TBoolean;
133
+ /**
134
+ * Creates an embed field for URLs matching a specific pattern.
135
+ *
136
+ * @example
137
+ * Type.Embed({
138
+ * pattern: 'https:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=.+',
139
+ * default: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
140
+ * title: 'YouTube URL'
141
+ * })
142
+ */
143
+ Embed: (options: {
144
+ pattern: string;
145
+ default: string;
146
+ title?: string;
147
+ }) => TUnsafe<EmbedURL>;
148
+ /**
149
+ * Creates a link field with text, href/pageId, and newTab properties.
150
+ * Supports both external URLs and internal page links.
151
+ *
152
+ * @example
153
+ * Type.Link({ default: { text: 'Learn more', href: '/', newTab: false }, title: 'CTA' })
154
+ */
155
+ Link: (options: {
156
+ default: {
157
+ text: string;
158
+ href: string;
159
+ newTab: boolean;
160
+ };
161
+ title?: string;
162
+ }) => TUnsafe<LinkValue>;
163
+ Image: typeof _imageType;
164
+ File: typeof _fileType;
162
165
  };
163
- export {};
164
- //# sourceMappingURL=contentType.d.ts.map
166
+ //#endregion
167
+ export { EmbedURL, ExtractAllPlaceholders, FileValue, ImageValue, LinkValue, Type$1 as Type };
@@ -1,4 +1,5 @@
1
1
  import { Type } from "@sinclair/typebox";
2
+
2
3
  //#region src/core/lib/contentType.ts
3
4
  function _imageType(options) {
4
5
  const imageDefault = {
@@ -69,7 +70,7 @@ function _fileType(options) {
69
70
  * Type builders for createBlock content schemas.
70
71
  * All fields must have default values.
71
72
  */
72
- var Type$1 = {
73
+ const Type$1 = {
73
74
  String: (options) => {
74
75
  return Type.Unsafe({
75
76
  type: "string",
@@ -145,5 +146,6 @@ var Type$1 = {
145
146
  Image: _imageType,
146
147
  File: _fileType
147
148
  };
149
+
148
150
  //#endregion
149
- export { Type$1 as Type };
151
+ export { Type$1 as Type };