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.
- package/dist/components/AuthGate.js +3 -1
- package/dist/core/components/AddBlockControlBar.js +4 -2
- package/dist/core/components/lexical/InlineContentEditable.js +4 -2
- package/dist/core/components/lexical/InlineLexicalEditor.js +3 -1
- package/dist/core/components/lexical/InlineParagraphNode.js +3 -1
- package/dist/core/components/lexical/SelectionBroadcaster.js +3 -1
- package/dist/core/components/lexical/SidebarLexicalEditor.js +3 -1
- package/dist/core/components/lexical/editorConfig.js +3 -1
- package/dist/core/createApp.d.ts +760 -691
- package/dist/core/createApp.js +2 -1
- package/dist/core/createBlock.d.ts +1027 -1001
- package/dist/core/createBlock.js +6 -4
- package/dist/core/createLayout.d.ts +111 -105
- package/dist/core/createLayout.js +3 -1
- package/dist/core/hooks/useFieldSelection.js +3 -1
- package/dist/core/hooks/useIsEditable.js +3 -1
- package/dist/core/hooks/useOverlayMessage.js +3 -1
- package/dist/core/lib/contentType.d.ts +141 -138
- package/dist/core/lib/contentType.js +4 -2
- package/dist/core/lib/fieldTypes.js +4 -2
- package/dist/core/lib/lexicalReact.js +3 -1
- package/dist/core/lib/lexicalState.js +3 -1
- package/dist/core/lib/modifierFormats.js +4 -3
- package/dist/core/lib/modifiers.js +5 -3
- package/dist/features/content/CamoxContent.d.ts +6 -2
- package/dist/features/content/CamoxContent.js +4 -2
- package/dist/features/content/components/AssetCard.js +4 -2
- package/dist/features/content/components/AssetCardSkeleton.js +4 -2
- package/dist/features/content/components/ContentSidebar.js +4 -2
- package/dist/features/content/components/UploadDropZone.js +3 -1
- package/dist/features/content/components/UploadProgressDrawer.js +3 -1
- package/dist/features/metadata/sitemap.d.ts +7 -5
- package/dist/features/metadata/sitemap.js +3 -1
- package/dist/features/preview/CamoxPreview.d.ts +35 -29
- package/dist/features/preview/CamoxPreview.js +7 -5
- package/dist/features/preview/components/AddBlockSheet.js +5 -3
- package/dist/features/preview/components/AgentChatSheet.js +4 -2
- package/dist/features/preview/components/AssetFieldEditor.js +5 -3
- package/dist/features/preview/components/AssetLightbox.js +4 -2
- package/dist/features/preview/components/AssetPickerGrid.js +4 -2
- package/dist/features/preview/components/BlockActionsPopover.js +4 -2
- package/dist/features/preview/components/CreatePageSheet.js +4 -2
- package/dist/features/preview/components/DebouncedFieldEditor.js +4 -2
- package/dist/features/preview/components/EditPageSheet.js +8 -6
- package/dist/features/preview/components/FieldOverlayStyles.js +6 -4
- package/dist/features/preview/components/Frame.js +5 -3
- package/dist/features/preview/components/ItemFieldsEditor.js +6 -4
- package/dist/features/preview/components/LinkFieldEditor.js +5 -3
- package/dist/features/preview/components/MultipleAssetFieldEditor.js +5 -3
- package/dist/features/preview/components/OverlayTracker.js +4 -2
- package/dist/features/preview/components/Overlays.js +4 -2
- package/dist/features/preview/components/PageContentSheet.js +7 -5
- package/dist/features/preview/components/PageLocationFieldset.js +5 -3
- package/dist/features/preview/components/PagePicker.js +5 -3
- package/dist/features/preview/components/PageTree.js +13 -11
- package/dist/features/preview/components/PeekedBlock.js +4 -2
- package/dist/features/preview/components/PreviewPanel.js +6 -4
- package/dist/features/preview/components/PreviewSideSheet.js +4 -2
- package/dist/features/preview/components/PreviewToolbar.js +4 -2
- package/dist/features/preview/components/RepeatableItemsList.js +5 -3
- package/dist/features/preview/components/ShikiMarkdown.js +5 -3
- package/dist/features/preview/components/TextFormatToolbar.js +5 -3
- package/dist/features/preview/components/UnlinkAssetButton.js +4 -2
- package/dist/features/preview/components/useUpdateBlockPosition.js +4 -2
- package/dist/features/preview/overlayMessages.js +2 -1
- package/dist/features/preview/previewStore.js +4 -2
- package/dist/features/provider/CamoxProvider.d.ts +20 -10
- package/dist/features/provider/CamoxProvider.js +5 -3
- package/dist/features/provider/actionsStore.js +4 -2
- package/dist/features/provider/components/CamoxAppContext.js +5 -3
- package/dist/features/provider/components/CommandPalette.js +3 -1
- package/dist/features/provider/useAdminShortcuts.js +3 -1
- package/dist/features/routes/ogRoute.d.ts +11 -6
- package/dist/features/routes/ogRoute.js +2 -1
- package/dist/features/routes/pageRoute.d.ts +56 -46
- package/dist/features/routes/pageRoute.js +6 -4
- package/dist/features/studio/CamoxStudio.d.ts +10 -5
- package/dist/features/studio/CamoxStudio.js +4 -2
- package/dist/features/studio/components/EnvironmentMenu.js +4 -2
- package/dist/features/studio/components/Navbar.js +5 -3
- package/dist/features/studio/components/ProjectMenu.js +5 -3
- package/dist/features/studio/components/UserButton.js +4 -2
- package/dist/features/studio/studioStore.js +4 -2
- package/dist/features/studio/useTheme.js +3 -1
- package/dist/features/vite/appGeneration.js +4 -2
- package/dist/features/vite/blockBoilerplate.js +4 -2
- package/dist/features/vite/definitionsSync.js +5 -3
- package/dist/features/vite/routeGeneration.js +4 -2
- package/dist/features/vite/skillGeneration.js +5 -3
- package/dist/features/vite/utils.js +3 -1
- package/dist/features/vite/vite.d.ts +20 -21
- package/dist/features/vite/vite.js +26 -16
- package/dist/hooks/use-file-upload.js +4 -1
- package/dist/hooks/use-marquee-selection.js +4 -2
- package/dist/lib/analytics-client.js +5 -3
- package/dist/lib/analytics.js +4 -3
- package/dist/lib/api-client-server.js +3 -1
- package/dist/lib/api-client.d.ts +7 -1198
- package/dist/lib/api-client.js +7 -5
- package/dist/lib/auth.js +4 -2
- package/dist/lib/normalized-data.js +7 -5
- package/dist/lib/queries.d.ts +9 -791
- package/dist/lib/queries.js +13 -11
- package/dist/lib/use-project-room.js +4 -2
- package/dist/lib/utils.js +3 -1
- package/package.json +10 -11
- package/dist/components/AuthGate.d.ts +0 -7
- package/dist/components/AuthGate.d.ts.map +0 -1
- package/dist/core/components/AddBlockControlBar.d.ts +0 -9
- package/dist/core/components/AddBlockControlBar.d.ts.map +0 -1
- package/dist/core/components/lexical/InlineContentEditable.d.ts +0 -7
- package/dist/core/components/lexical/InlineContentEditable.d.ts.map +0 -1
- package/dist/core/components/lexical/InlineLexicalEditor.d.ts +0 -10
- package/dist/core/components/lexical/InlineLexicalEditor.d.ts.map +0 -1
- package/dist/core/components/lexical/InlineParagraphNode.d.ts +0 -10
- package/dist/core/components/lexical/InlineParagraphNode.d.ts.map +0 -1
- package/dist/core/components/lexical/SelectionBroadcaster.d.ts +0 -6
- package/dist/core/components/lexical/SelectionBroadcaster.d.ts.map +0 -1
- package/dist/core/components/lexical/SidebarLexicalEditor.d.ts +0 -9
- package/dist/core/components/lexical/SidebarLexicalEditor.d.ts.map +0 -1
- package/dist/core/components/lexical/editorConfig.d.ts +0 -4
- package/dist/core/components/lexical/editorConfig.d.ts.map +0 -1
- package/dist/core/createApp.d.ts.map +0 -1
- package/dist/core/createBlock.d.ts.map +0 -1
- package/dist/core/createLayout.d.ts.map +0 -1
- package/dist/core/hooks/useFieldSelection.d.ts +0 -8
- package/dist/core/hooks/useFieldSelection.d.ts.map +0 -1
- package/dist/core/hooks/useIsEditable.d.ts +0 -2
- package/dist/core/hooks/useIsEditable.d.ts.map +0 -1
- package/dist/core/hooks/useOverlayMessage.d.ts +0 -10
- package/dist/core/hooks/useOverlayMessage.d.ts.map +0 -1
- package/dist/core/lib/contentType.d.ts.map +0 -1
- package/dist/core/lib/fieldTypes.d.ts +0 -92
- package/dist/core/lib/fieldTypes.d.ts.map +0 -1
- package/dist/core/lib/lexicalReact.d.ts +0 -7
- package/dist/core/lib/lexicalReact.d.ts.map +0 -1
- package/dist/core/lib/lexicalState.d.ts +0 -10
- package/dist/core/lib/lexicalState.d.ts.map +0 -1
- package/dist/core/lib/modifierFormats.d.ts +0 -9
- package/dist/core/lib/modifierFormats.d.ts.map +0 -1
- package/dist/core/lib/modifiers.d.ts +0 -12
- package/dist/core/lib/modifiers.d.ts.map +0 -1
- package/dist/features/content/CamoxContent.d.ts.map +0 -1
- package/dist/features/content/components/AssetCard.d.ts +0 -10
- package/dist/features/content/components/AssetCard.d.ts.map +0 -1
- package/dist/features/content/components/AssetCardSkeleton.d.ts +0 -2
- package/dist/features/content/components/AssetCardSkeleton.d.ts.map +0 -1
- package/dist/features/content/components/ContentSidebar.d.ts +0 -2
- package/dist/features/content/components/ContentSidebar.d.ts.map +0 -1
- package/dist/features/content/components/UploadDropZone.d.ts +0 -9
- package/dist/features/content/components/UploadDropZone.d.ts.map +0 -1
- package/dist/features/content/components/UploadProgressDrawer.d.ts +0 -11
- package/dist/features/content/components/UploadProgressDrawer.d.ts.map +0 -1
- package/dist/features/metadata/sitemap.d.ts.map +0 -1
- package/dist/features/preview/CamoxPreview.d.ts.map +0 -1
- package/dist/features/preview/components/AddBlockSheet.d.ts +0 -3
- package/dist/features/preview/components/AddBlockSheet.d.ts.map +0 -1
- package/dist/features/preview/components/AgentChatSheet.d.ts +0 -3
- package/dist/features/preview/components/AgentChatSheet.d.ts.map +0 -1
- package/dist/features/preview/components/AssetFieldEditor.d.ts +0 -18
- package/dist/features/preview/components/AssetFieldEditor.d.ts.map +0 -1
- package/dist/features/preview/components/AssetLightbox.d.ts +0 -8
- package/dist/features/preview/components/AssetLightbox.d.ts.map +0 -1
- package/dist/features/preview/components/AssetPickerGrid.d.ts +0 -11
- package/dist/features/preview/components/AssetPickerGrid.d.ts.map +0 -1
- package/dist/features/preview/components/BlockActionsPopover.d.ts +0 -15
- package/dist/features/preview/components/BlockActionsPopover.d.ts.map +0 -1
- package/dist/features/preview/components/CreatePageSheet.d.ts +0 -3
- package/dist/features/preview/components/CreatePageSheet.d.ts.map +0 -1
- package/dist/features/preview/components/DebouncedFieldEditor.d.ts +0 -10
- package/dist/features/preview/components/DebouncedFieldEditor.d.ts.map +0 -1
- package/dist/features/preview/components/EditPageSheet.d.ts +0 -3
- package/dist/features/preview/components/EditPageSheet.d.ts.map +0 -1
- package/dist/features/preview/components/FieldOverlayStyles.d.ts +0 -2
- package/dist/features/preview/components/FieldOverlayStyles.d.ts.map +0 -1
- package/dist/features/preview/components/Frame.d.ts +0 -20
- package/dist/features/preview/components/Frame.d.ts.map +0 -1
- package/dist/features/preview/components/ItemFieldsEditor.d.ts +0 -28
- package/dist/features/preview/components/ItemFieldsEditor.d.ts.map +0 -1
- package/dist/features/preview/components/LinkFieldEditor.d.ts +0 -8
- package/dist/features/preview/components/LinkFieldEditor.d.ts.map +0 -1
- package/dist/features/preview/components/MultipleAssetFieldEditor.d.ts +0 -9
- package/dist/features/preview/components/MultipleAssetFieldEditor.d.ts.map +0 -1
- package/dist/features/preview/components/OverlayTracker.d.ts +0 -6
- package/dist/features/preview/components/OverlayTracker.d.ts.map +0 -1
- package/dist/features/preview/components/Overlays.d.ts +0 -6
- package/dist/features/preview/components/Overlays.d.ts.map +0 -1
- package/dist/features/preview/components/PageContentSheet.d.ts +0 -3
- package/dist/features/preview/components/PageContentSheet.d.ts.map +0 -1
- package/dist/features/preview/components/PageLocationFieldset.d.ts +0 -14
- package/dist/features/preview/components/PageLocationFieldset.d.ts.map +0 -1
- package/dist/features/preview/components/PagePicker.d.ts +0 -3
- package/dist/features/preview/components/PagePicker.d.ts.map +0 -1
- package/dist/features/preview/components/PageTree.d.ts +0 -3
- package/dist/features/preview/components/PageTree.d.ts.map +0 -1
- package/dist/features/preview/components/PeekedBlock.d.ts +0 -6
- package/dist/features/preview/components/PeekedBlock.d.ts.map +0 -1
- package/dist/features/preview/components/PreviewPanel.d.ts +0 -12
- package/dist/features/preview/components/PreviewPanel.d.ts.map +0 -1
- package/dist/features/preview/components/PreviewSideSheet.d.ts +0 -13
- package/dist/features/preview/components/PreviewSideSheet.d.ts.map +0 -1
- package/dist/features/preview/components/PreviewToolbar.d.ts +0 -2
- package/dist/features/preview/components/PreviewToolbar.d.ts.map +0 -1
- package/dist/features/preview/components/RepeatableItemsList.d.ts +0 -17
- package/dist/features/preview/components/RepeatableItemsList.d.ts.map +0 -1
- package/dist/features/preview/components/ShikiMarkdown.d.ts +0 -4
- package/dist/features/preview/components/ShikiMarkdown.d.ts.map +0 -1
- package/dist/features/preview/components/TextFormatToolbar.d.ts +0 -2
- package/dist/features/preview/components/TextFormatToolbar.d.ts.map +0 -1
- package/dist/features/preview/components/UnlinkAssetButton.d.ts +0 -8
- package/dist/features/preview/components/UnlinkAssetButton.d.ts.map +0 -1
- package/dist/features/preview/components/useUpdateBlockPosition.d.ts +0 -67
- package/dist/features/preview/components/useUpdateBlockPosition.d.ts.map +0 -1
- package/dist/features/preview/overlayMessages.d.ts +0 -62
- package/dist/features/preview/overlayMessages.d.ts.map +0 -1
- package/dist/features/preview/previewConstants.d.ts +0 -2
- package/dist/features/preview/previewConstants.d.ts.map +0 -1
- package/dist/features/preview/previewStore.d.ts +0 -123
- package/dist/features/preview/previewStore.d.ts.map +0 -1
- package/dist/features/preview/studio-overlays.css?inline.js +0 -4
- package/dist/features/provider/CamoxProvider.d.ts.map +0 -1
- package/dist/features/provider/actionsStore.d.ts +0 -35
- package/dist/features/provider/actionsStore.d.ts.map +0 -1
- package/dist/features/provider/components/CamoxAppContext.d.ts +0 -771
- package/dist/features/provider/components/CamoxAppContext.d.ts.map +0 -1
- package/dist/features/provider/components/CommandPalette.d.ts +0 -3
- package/dist/features/provider/components/CommandPalette.d.ts.map +0 -1
- package/dist/features/provider/useAdminShortcuts.d.ts +0 -5
- package/dist/features/provider/useAdminShortcuts.d.ts.map +0 -1
- package/dist/features/routes/ogRoute.d.ts.map +0 -1
- package/dist/features/routes/pageRoute.d.ts.map +0 -1
- package/dist/features/studio/CamoxStudio.d.ts.map +0 -1
- package/dist/features/studio/components/EnvironmentMenu.d.ts +0 -2
- package/dist/features/studio/components/EnvironmentMenu.d.ts.map +0 -1
- package/dist/features/studio/components/Navbar.d.ts +0 -4
- package/dist/features/studio/components/Navbar.d.ts.map +0 -1
- package/dist/features/studio/components/ProjectMenu.d.ts +0 -2
- package/dist/features/studio/components/ProjectMenu.d.ts.map +0 -1
- package/dist/features/studio/components/UserButton.d.ts +0 -2
- package/dist/features/studio/components/UserButton.d.ts.map +0 -1
- package/dist/features/studio/studioStore.d.ts +0 -17
- package/dist/features/studio/studioStore.d.ts.map +0 -1
- package/dist/features/studio/useTheme.d.ts +0 -9
- package/dist/features/studio/useTheme.d.ts.map +0 -1
- package/dist/features/vite/appGeneration.d.ts +0 -4
- package/dist/features/vite/appGeneration.d.ts.map +0 -1
- package/dist/features/vite/blockBoilerplate.d.ts +0 -3
- package/dist/features/vite/blockBoilerplate.d.ts.map +0 -1
- package/dist/features/vite/definitionsSync.d.ts +0 -19
- package/dist/features/vite/definitionsSync.d.ts.map +0 -1
- package/dist/features/vite/routeGeneration.d.ts +0 -14
- package/dist/features/vite/routeGeneration.d.ts.map +0 -1
- package/dist/features/vite/skillGeneration.d.ts +0 -4
- package/dist/features/vite/skillGeneration.d.ts.map +0 -1
- package/dist/features/vite/utils.d.ts +0 -2
- package/dist/features/vite/utils.d.ts.map +0 -1
- package/dist/features/vite/vite.d.ts.map +0 -1
- package/dist/hooks/use-file-upload.d.ts +0 -23
- package/dist/hooks/use-file-upload.d.ts.map +0 -1
- package/dist/hooks/use-marquee-selection.d.ts +0 -17
- package/dist/hooks/use-marquee-selection.d.ts.map +0 -1
- package/dist/lib/analytics-client.d.ts +0 -3
- package/dist/lib/analytics-client.d.ts.map +0 -1
- package/dist/lib/analytics.d.ts +0 -3
- package/dist/lib/analytics.d.ts.map +0 -1
- package/dist/lib/api-client-server.d.ts +0 -5
- package/dist/lib/api-client-server.d.ts.map +0 -1
- package/dist/lib/api-client.d.ts.map +0 -1
- package/dist/lib/normalized-data.d.ts +0 -96
- package/dist/lib/normalized-data.d.ts.map +0 -1
- package/dist/lib/queries.d.ts.map +0 -1
- package/dist/lib/use-project-room.d.ts +0 -2
- package/dist/lib/use-project-room.d.ts.map +0 -1
- package/dist/lib/utils.d.ts +0 -40
- package/dist/lib/utils.d.ts.map +0 -1
package/dist/core/createBlock.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
6
|
-
|
|
8
|
+
type EmbedURL = string & {
|
|
9
|
+
readonly [EmbedURLBrand]: true;
|
|
7
10
|
};
|
|
8
11
|
declare const LinkBrand: unique symbol;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
type LinkValue = ({
|
|
13
|
+
type: "external";
|
|
14
|
+
href: string;
|
|
12
15
|
} | {
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
type: "page";
|
|
17
|
+
pageId: string;
|
|
15
18
|
}) & {
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
text: string;
|
|
20
|
+
newTab: boolean;
|
|
18
21
|
} & {
|
|
19
|
-
|
|
22
|
+
readonly [LinkBrand]: true;
|
|
20
23
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
type ImageValue = {
|
|
25
|
+
url: string;
|
|
26
|
+
alt: string;
|
|
27
|
+
filename: string;
|
|
28
|
+
mimeType: string;
|
|
29
|
+
_fileId?: string;
|
|
27
30
|
} & {
|
|
28
|
-
|
|
31
|
+
readonly __brand: "ImageValue";
|
|
29
32
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
type FileValue = {
|
|
34
|
+
url: string;
|
|
35
|
+
alt: string;
|
|
36
|
+
filename: string;
|
|
37
|
+
mimeType: string;
|
|
38
|
+
_fileId?: string;
|
|
36
39
|
} & {
|
|
37
|
-
|
|
40
|
+
readonly __brand: "FileValue";
|
|
38
41
|
};
|
|
39
42
|
declare function _imageType(options: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
title?: string;
|
|
44
|
+
multiple: true;
|
|
45
|
+
defaultItems: number;
|
|
43
46
|
}): TArray<TObject<{
|
|
44
|
-
|
|
47
|
+
image: TUnsafe<ImageValue>;
|
|
45
48
|
}>>;
|
|
46
49
|
declare function _imageType(options: {
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
title?: string;
|
|
51
|
+
multiple?: false;
|
|
49
52
|
}): TUnsafe<ImageValue>;
|
|
50
53
|
declare function _fileType(options: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
accept: string[];
|
|
55
|
+
title?: string;
|
|
56
|
+
multiple: true;
|
|
57
|
+
defaultItems: number;
|
|
55
58
|
}): TArray<TObject<{
|
|
56
|
-
|
|
59
|
+
file: TUnsafe<FileValue>;
|
|
57
60
|
}>>;
|
|
58
61
|
declare function _fileType(options: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
164
|
-
|
|
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
|
-
|
|
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 };
|