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
|
@@ -9,11 +9,12 @@ import * as React from "react";
|
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { FileIcon, ImageIcon, Images, Link2 } from "lucide-react";
|
|
11
11
|
import { useForm } from "@tanstack/react-form";
|
|
12
|
+
|
|
12
13
|
//#region src/features/preview/components/ItemFieldsEditor.tsx
|
|
13
|
-
|
|
14
|
+
const formatFieldName = (fieldName) => {
|
|
14
15
|
return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).trim();
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
+
const getSchemaFieldsInOrder = (schema) => {
|
|
17
18
|
const properties = schema?.properties;
|
|
18
19
|
if (!properties) return [];
|
|
19
20
|
return Object.keys(properties).map((fieldName) => {
|
|
@@ -28,7 +29,7 @@ var getSchemaFieldsInOrder = (schema) => {
|
|
|
28
29
|
};
|
|
29
30
|
});
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
+
const ItemFieldsEditor = (t0) => {
|
|
32
33
|
const $ = c(38);
|
|
33
34
|
const { schema, data, blockId, itemId, onFieldChange, postToIframe, filesMap, itemsMap } = t0;
|
|
34
35
|
let t1;
|
|
@@ -410,5 +411,6 @@ function _temp(f) {
|
|
|
410
411
|
function _temp2(f_0) {
|
|
411
412
|
return f_0.name;
|
|
412
413
|
}
|
|
414
|
+
|
|
413
415
|
//#endregion
|
|
414
|
-
export { ItemFieldsEditor, formatFieldName };
|
|
416
|
+
export { ItemFieldsEditor, formatFieldName };
|
|
@@ -13,16 +13,17 @@ import { Check, ChevronsUpDown } from "lucide-react";
|
|
|
13
13
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@camox/ui/command";
|
|
14
14
|
import { Switch } from "@camox/ui/switch";
|
|
15
15
|
import { Tabs, TabsList, TabsTrigger } from "@camox/ui/tabs";
|
|
16
|
+
|
|
16
17
|
//#region src/features/preview/components/LinkFieldEditor.tsx
|
|
17
18
|
/** Normalize legacy links (no `type` field) into the union shape */
|
|
18
|
-
|
|
19
|
+
const normalizeLinkValue = (value) => {
|
|
19
20
|
if (!value.type) return {
|
|
20
21
|
type: "external",
|
|
21
22
|
...value
|
|
22
23
|
};
|
|
23
24
|
return value;
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
const LinkFieldEditor = (t0) => {
|
|
26
27
|
const $ = c(70);
|
|
27
28
|
const { fieldName, linkValue: rawLinkValue, onSave } = t0;
|
|
28
29
|
let t1;
|
|
@@ -389,5 +390,6 @@ var LinkFieldEditor = (t0) => {
|
|
|
389
390
|
} else t37 = $[69];
|
|
390
391
|
return t37;
|
|
391
392
|
};
|
|
393
|
+
|
|
392
394
|
//#endregion
|
|
393
|
-
export { LinkFieldEditor };
|
|
395
|
+
export { LinkFieldEditor };
|
|
@@ -17,8 +17,9 @@ import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, us
|
|
|
17
17
|
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
18
18
|
import { SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
19
19
|
import { CSS } from "@dnd-kit/utilities";
|
|
20
|
+
|
|
20
21
|
//#region src/features/preview/components/MultipleAssetFieldEditor.tsx
|
|
21
|
-
|
|
22
|
+
const SortableAssetItem = (t0) => {
|
|
22
23
|
const $ = c(42);
|
|
23
24
|
const { asset, assetType, onRemove, onAssetOpen } = t0;
|
|
24
25
|
const t1 = String(asset._fileId);
|
|
@@ -167,7 +168,7 @@ var SortableAssetItem = (t0) => {
|
|
|
167
168
|
} else t17 = $[41];
|
|
168
169
|
return t17;
|
|
169
170
|
};
|
|
170
|
-
|
|
171
|
+
const MultipleAssetFieldEditor = (t0) => {
|
|
171
172
|
const $ = c(15);
|
|
172
173
|
const { fieldName, assetType, currentData, onFieldChange } = t0;
|
|
173
174
|
const contentKey = assetType === "Image" ? "image" : "file";
|
|
@@ -301,5 +302,6 @@ function _temp2() {}
|
|
|
301
302
|
function _temp3(a_4) {
|
|
302
303
|
return String(a_4._fileId);
|
|
303
304
|
}
|
|
305
|
+
|
|
304
306
|
//#endregion
|
|
305
|
-
export { MultipleAssetFieldEditor };
|
|
307
|
+
export { MultipleAssetFieldEditor };
|
|
@@ -4,12 +4,13 @@ import { isOverlayMessage } from "../overlayMessages.js";
|
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import { useSelector } from "@xstate/store/react";
|
|
6
6
|
import * as React from "react";
|
|
7
|
+
|
|
7
8
|
//#region src/features/preview/components/OverlayTracker.tsx
|
|
8
9
|
/**
|
|
9
10
|
* OverlayTracker runs inside the iframe and handles:
|
|
10
11
|
* Listening for focus commands from parent (for sidebar-triggered focus)
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
const OverlayTracker = () => {
|
|
13
14
|
const $ = c(8);
|
|
14
15
|
const { window: iframeWindow } = useFrame();
|
|
15
16
|
const isPageContentSheetOpen = useSelector(previewStore, _temp);
|
|
@@ -72,5 +73,6 @@ function _temp2(state_0) {
|
|
|
72
73
|
function _temp3() {
|
|
73
74
|
previewStore.send({ type: "exitPeekedBlock" });
|
|
74
75
|
}
|
|
76
|
+
|
|
75
77
|
//#endregion
|
|
76
|
-
export { OverlayTracker };
|
|
78
|
+
export { OverlayTracker };
|
|
@@ -5,8 +5,9 @@ import { usePreviewedPage } from "../CamoxPreview.js";
|
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { useSelector } from "@xstate/store/react";
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
|
|
8
9
|
//#region src/features/preview/components/Overlays.tsx
|
|
9
|
-
|
|
10
|
+
const Overlays = (t0) => {
|
|
10
11
|
const $ = c(14);
|
|
11
12
|
const { iframeElement } = t0;
|
|
12
13
|
const isPageContentSheetOpen = useSelector(previewStore, _temp);
|
|
@@ -97,5 +98,6 @@ function _temp2(state_0) {
|
|
|
97
98
|
function _temp3(state_1) {
|
|
98
99
|
return state_1.context.peekedBlock;
|
|
99
100
|
}
|
|
101
|
+
|
|
100
102
|
//#endregion
|
|
101
|
-
export { Overlays };
|
|
103
|
+
export { Overlays };
|
|
@@ -20,8 +20,9 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
|
|
|
20
20
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
|
|
21
21
|
import { Switch } from "@camox/ui/switch";
|
|
22
22
|
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "@camox/ui/breadcrumb";
|
|
23
|
+
|
|
23
24
|
//#region src/features/preview/components/PageContentSheet.tsx
|
|
24
|
-
|
|
25
|
+
const getSettingsFields = (schema) => {
|
|
25
26
|
const properties = schema?.properties;
|
|
26
27
|
if (!properties) return [];
|
|
27
28
|
return Object.keys(properties).map((fieldName) => {
|
|
@@ -40,7 +41,7 @@ var getSettingsFields = (schema) => {
|
|
|
40
41
|
* Builds the path of fieldNames from the block root to the given item,
|
|
41
42
|
* then walks the schema down that path to return the sub-schema for the item's fields.
|
|
42
43
|
*/
|
|
43
|
-
|
|
44
|
+
const getSchemaForItem = (contentSchema, itemId, itemsMap) => {
|
|
44
45
|
const path = [];
|
|
45
46
|
let current = itemsMap.get(itemId);
|
|
46
47
|
while (current) {
|
|
@@ -59,7 +60,7 @@ var getSchemaForItem = (contentSchema, itemId, itemsMap) => {
|
|
|
59
60
|
* Builds the ancestor chain from root to this item (inclusive).
|
|
60
61
|
* Returns items in order from root-most ancestor to the item itself.
|
|
61
62
|
*/
|
|
62
|
-
|
|
63
|
+
const buildAncestorChain = (itemId, itemsMap) => {
|
|
63
64
|
const chain = [];
|
|
64
65
|
let current = itemsMap.get(itemId);
|
|
65
66
|
while (current) {
|
|
@@ -68,7 +69,7 @@ var buildAncestorChain = (itemId, itemsMap) => {
|
|
|
68
69
|
}
|
|
69
70
|
return chain;
|
|
70
71
|
};
|
|
71
|
-
|
|
72
|
+
const PageContentSheet = () => {
|
|
72
73
|
const camoxApp = useCamoxApp();
|
|
73
74
|
const updateContent = useMutation(blockMutations.updateContent());
|
|
74
75
|
const updateSettings = useMutation(blockMutations.updateSettings());
|
|
@@ -417,5 +418,6 @@ var PageContentSheet = () => {
|
|
|
417
418
|
})]
|
|
418
419
|
});
|
|
419
420
|
};
|
|
421
|
+
|
|
420
422
|
//#endregion
|
|
421
|
-
export { PageContentSheet };
|
|
423
|
+
export { PageContentSheet };
|
|
@@ -4,9 +4,10 @@ import { Label } from "@camox/ui/label";
|
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Select, SelectContent, SelectItem, SelectSeparator, SelectTrigger, SelectValue } from "@camox/ui/select";
|
|
6
6
|
import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from "@camox/ui/input-group";
|
|
7
|
+
|
|
7
8
|
//#region src/features/preview/components/PageLocationFieldset.tsx
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const NO_PARENT_VALUE = "__no_parent__";
|
|
10
|
+
const PageLocationFieldset = (t0) => {
|
|
10
11
|
const $ = c(60);
|
|
11
12
|
const { parentPageId, onParentPageIdChange, pathSegment, onPathSegmentChange, disabled, pages, excludePageId } = t0;
|
|
12
13
|
let t1;
|
|
@@ -237,5 +238,6 @@ function _temp(page_1) {
|
|
|
237
238
|
})
|
|
238
239
|
}, page_1.id);
|
|
239
240
|
}
|
|
241
|
+
|
|
240
242
|
//#endregion
|
|
241
|
-
export { PageLocationFieldset };
|
|
243
|
+
export { PageLocationFieldset };
|
|
@@ -14,9 +14,10 @@ import { Check, ChevronsUpDown, Pencil, Plus, Trash2 } from "lucide-react";
|
|
|
14
14
|
import { Skeleton } from "@camox/ui/skeleton";
|
|
15
15
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "@camox/ui/command";
|
|
16
16
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
|
|
17
|
+
|
|
17
18
|
//#region src/features/preview/components/PagePicker.tsx
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const CREATE_PAGE_VALUE = "__create_page__";
|
|
20
|
+
const PagePicker = () => {
|
|
20
21
|
const [open, setOpen] = React.useState(false);
|
|
21
22
|
const [pageToDelete, setPageToDelete] = React.useState(null);
|
|
22
23
|
const peekedPagePathname = useSelector(previewStore, (state) => state.context.peekedPagePathname);
|
|
@@ -187,5 +188,6 @@ var PagePicker = () => {
|
|
|
187
188
|
})] })] })
|
|
188
189
|
})] });
|
|
189
190
|
};
|
|
191
|
+
|
|
190
192
|
//#endregion
|
|
191
|
-
export { PagePicker };
|
|
193
|
+
export { PagePicker };
|
|
@@ -18,6 +18,7 @@ import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
|
18
18
|
import { SortableContext, defaultAnimateLayoutChanges, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
19
19
|
import { CSS } from "@dnd-kit/utilities";
|
|
20
20
|
import { Accordion } from "@base-ui/react/accordion";
|
|
21
|
+
|
|
21
22
|
//#region src/features/preview/components/PageTree.tsx
|
|
22
23
|
function useEmbedTitle(url) {
|
|
23
24
|
const $ = c(3);
|
|
@@ -50,7 +51,7 @@ function _temp2() {}
|
|
|
50
51
|
function _temp(res) {
|
|
51
52
|
return res.text();
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
const FieldItem = (t0) => {
|
|
54
55
|
const $ = c(29);
|
|
55
56
|
const { fieldName, value, fieldType, schemaTitle, arrayItemType, isSelected, onFieldClick, onFieldDoubleClick, onMouseEnter, onMouseLeave } = t0;
|
|
56
57
|
const fetchedEmbedTitle = useEmbedTitle(fieldType === "Embed" ? value : null);
|
|
@@ -135,7 +136,7 @@ var FieldItem = (t0) => {
|
|
|
135
136
|
} else t9 = $[28];
|
|
136
137
|
return t9;
|
|
137
138
|
};
|
|
138
|
-
|
|
139
|
+
const BlockFields = (t0) => {
|
|
139
140
|
const $ = c(2);
|
|
140
141
|
const { block } = t0;
|
|
141
142
|
const schemaProperties = useCamoxApp().getBlockById(block.type)?.contentSchema.properties;
|
|
@@ -303,7 +304,7 @@ function _temp6(state_0) {
|
|
|
303
304
|
function _temp5(state) {
|
|
304
305
|
return state.context.selection;
|
|
305
306
|
}
|
|
306
|
-
|
|
307
|
+
const BlockTreeItemHeader = (t0) => {
|
|
307
308
|
const $ = c(18);
|
|
308
309
|
let children;
|
|
309
310
|
let className;
|
|
@@ -359,7 +360,7 @@ var BlockTreeItemHeader = (t0) => {
|
|
|
359
360
|
} else t5 = $[17];
|
|
360
361
|
return t5;
|
|
361
362
|
};
|
|
362
|
-
|
|
363
|
+
const BlockTreeItemTrigger = (t0) => {
|
|
363
364
|
const $ = c(4);
|
|
364
365
|
const { displayText, onClick } = t0;
|
|
365
366
|
let t1;
|
|
@@ -384,7 +385,7 @@ var BlockTreeItemTrigger = (t0) => {
|
|
|
384
385
|
} else t2 = $[3];
|
|
385
386
|
return t2;
|
|
386
387
|
};
|
|
387
|
-
|
|
388
|
+
const BlockTreeItemEllipsis = (t0) => {
|
|
388
389
|
const $ = c(11);
|
|
389
390
|
let className;
|
|
390
391
|
let open;
|
|
@@ -428,7 +429,7 @@ var BlockTreeItemEllipsis = (t0) => {
|
|
|
428
429
|
} else t4 = $[10];
|
|
429
430
|
return t4;
|
|
430
431
|
};
|
|
431
|
-
|
|
432
|
+
const BlockTreeItemContent = (t0) => {
|
|
432
433
|
const $ = c(2);
|
|
433
434
|
const { block } = t0;
|
|
434
435
|
let t1;
|
|
@@ -442,12 +443,12 @@ var BlockTreeItemContent = (t0) => {
|
|
|
442
443
|
} else t1 = $[1];
|
|
443
444
|
return t1;
|
|
444
445
|
};
|
|
445
|
-
|
|
446
|
+
const animateLayoutChanges = (args) => {
|
|
446
447
|
const { isSorting, wasDragging } = args;
|
|
447
448
|
if (isSorting || wasDragging) return false;
|
|
448
449
|
return defaultAnimateLayoutChanges(args);
|
|
449
450
|
};
|
|
450
|
-
|
|
451
|
+
const SortableBlock = (t0) => {
|
|
451
452
|
const $ = c(51);
|
|
452
453
|
const { block, isSelected } = t0;
|
|
453
454
|
const [gripPopoverOpen, setGripPopoverOpen] = React.useState(false);
|
|
@@ -629,7 +630,7 @@ var SortableBlock = (t0) => {
|
|
|
629
630
|
} else t20 = $[50];
|
|
630
631
|
return t20;
|
|
631
632
|
};
|
|
632
|
-
|
|
633
|
+
const LayoutBlockItem = (t0) => {
|
|
633
634
|
const $ = c(42);
|
|
634
635
|
const { block, isSelected, layoutName } = t0;
|
|
635
636
|
const camoxApp = useCamoxApp();
|
|
@@ -781,7 +782,7 @@ var LayoutBlockItem = (t0) => {
|
|
|
781
782
|
} else t16 = $[41];
|
|
782
783
|
return t16;
|
|
783
784
|
};
|
|
784
|
-
|
|
785
|
+
const PageTree = () => {
|
|
785
786
|
const $ = c(53);
|
|
786
787
|
const focusedBlockId = useSelector(previewStore, _temp7)?.blockId ?? null;
|
|
787
788
|
const page = usePreviewedPage();
|
|
@@ -1034,5 +1035,6 @@ function _temp8(block_2) {
|
|
|
1034
1035
|
function _temp9() {
|
|
1035
1036
|
return previewStore.send({ type: "openAddBlockSheet" });
|
|
1036
1037
|
}
|
|
1038
|
+
|
|
1037
1039
|
//#endregion
|
|
1038
|
-
export { PageTree };
|
|
1040
|
+
export { PageTree };
|
|
@@ -4,8 +4,9 @@ import { c } from "react/compiler-runtime";
|
|
|
4
4
|
import { useSelector } from "@xstate/store/react";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
7
8
|
//#region src/features/preview/components/PeekedBlock.tsx
|
|
8
|
-
|
|
9
|
+
const PeekedBlock = (t0) => {
|
|
9
10
|
const $ = c(34);
|
|
10
11
|
const { onExitComplete } = t0;
|
|
11
12
|
const peekedBlock = useSelector(previewStore, _temp);
|
|
@@ -195,5 +196,6 @@ function _temp(state) {
|
|
|
195
196
|
function _temp2(state_0) {
|
|
196
197
|
return state_0.context.skipPeekedBlockExitAnimation;
|
|
197
198
|
}
|
|
199
|
+
|
|
198
200
|
//#endregion
|
|
199
|
-
export { PeekedBlock };
|
|
201
|
+
export { PeekedBlock };
|
|
@@ -14,8 +14,9 @@ import { useSelector } from "@xstate/store/react";
|
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
import { PanelContent } from "@camox/ui/panel";
|
|
17
|
+
|
|
17
18
|
//#region src/features/preview/components/PreviewPanel.tsx
|
|
18
|
-
|
|
19
|
+
const PreviewFrame = (t0) => {
|
|
19
20
|
const $ = c(8);
|
|
20
21
|
const { children, style, className, onIframeReady } = t0;
|
|
21
22
|
let t1;
|
|
@@ -54,7 +55,7 @@ var PreviewFrame = (t0) => {
|
|
|
54
55
|
} else t4 = $[7];
|
|
55
56
|
return t4;
|
|
56
57
|
};
|
|
57
|
-
|
|
58
|
+
const KeyDownForwarder = () => {
|
|
58
59
|
const $ = c(4);
|
|
59
60
|
const { window: iframeWindow } = useFrame();
|
|
60
61
|
const actions = useSelector(actionsStore, _temp);
|
|
@@ -109,7 +110,7 @@ var KeyDownForwarder = () => {
|
|
|
109
110
|
React.useEffect(t0, t1);
|
|
110
111
|
return null;
|
|
111
112
|
};
|
|
112
|
-
|
|
113
|
+
const PreviewPanel = (t0) => {
|
|
113
114
|
const $ = c(15);
|
|
114
115
|
const { children } = t0;
|
|
115
116
|
useBlockActionsShortcuts();
|
|
@@ -313,5 +314,6 @@ function _temp10() {
|
|
|
313
314
|
function _temp11(a) {
|
|
314
315
|
return a.id;
|
|
315
316
|
}
|
|
317
|
+
|
|
316
318
|
//#endregion
|
|
317
|
-
export { PreviewFrame, PreviewPanel };
|
|
319
|
+
export { PreviewFrame, PreviewPanel };
|
|
@@ -4,8 +4,9 @@ import { useSelector } from "@xstate/store/react";
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import * as Sheet from "@camox/ui/sheet";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
7
8
|
//#region src/features/preview/components/PreviewSideSheet.tsx
|
|
8
|
-
|
|
9
|
+
const PreviewSideSheet = (t0) => {
|
|
9
10
|
const $ = c(12);
|
|
10
11
|
const { open, onOpenChange, onOpenAutoFocus, children, className } = t0;
|
|
11
12
|
const prevOpenRef = React.useRef(open);
|
|
@@ -73,5 +74,6 @@ function _temp2(state_0) {
|
|
|
73
74
|
function _temp(state) {
|
|
74
75
|
return state.context.isPageContentSheetOpen;
|
|
75
76
|
}
|
|
77
|
+
|
|
76
78
|
//#endregion
|
|
77
|
-
export { PreviewSideSheet, Sheet, useIsPreviewSheetOpen };
|
|
79
|
+
export { PreviewSideSheet, Sheet, useIsPreviewSheetOpen };
|
|
@@ -11,8 +11,9 @@ import { Lock, MonitorPlay, PanelRight, TabletSmartphone } from "lucide-react";
|
|
|
11
11
|
import { ButtonGroup } from "@camox/ui/button-group";
|
|
12
12
|
import { FloatingToolbar } from "@camox/ui/floating-toolbar";
|
|
13
13
|
import { Toggle } from "@camox/ui/toggle";
|
|
14
|
+
|
|
14
15
|
//#region src/features/preview/components/PreviewToolbar.tsx
|
|
15
|
-
|
|
16
|
+
const PreviewToolbar = () => {
|
|
16
17
|
const $ = c(64);
|
|
17
18
|
const isEditingLocked = useSelector(previewStore, _temp);
|
|
18
19
|
const isEditingPanelOpen = useSelector(previewStore, _temp2);
|
|
@@ -298,5 +299,6 @@ function _temp10() {
|
|
|
298
299
|
function _temp11() {
|
|
299
300
|
return previewStore.send({ type: "openAgentChatSheet" });
|
|
300
301
|
}
|
|
302
|
+
|
|
301
303
|
//#endregion
|
|
302
|
-
export { PreviewToolbar };
|
|
304
|
+
export { PreviewToolbar };
|
|
@@ -13,8 +13,9 @@ import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, us
|
|
|
13
13
|
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
14
14
|
import { SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
15
15
|
import { CSS } from "@dnd-kit/utilities";
|
|
16
|
+
|
|
16
17
|
//#region src/features/preview/components/RepeatableItemsList.tsx
|
|
17
|
-
|
|
18
|
+
const SortableRepeatableItem = (t0) => {
|
|
18
19
|
const $ = c(46);
|
|
19
20
|
const { item, fieldName, blockId, canRemove, onRemove } = t0;
|
|
20
21
|
const t1 = String(item.id);
|
|
@@ -198,7 +199,7 @@ var SortableRepeatableItem = (t0) => {
|
|
|
198
199
|
} else t18 = $[45];
|
|
199
200
|
return t18;
|
|
200
201
|
};
|
|
201
|
-
|
|
202
|
+
const RepeatableItemsList = ({ items, blockId, fieldName, minItems, maxItems, schema }) => {
|
|
202
203
|
const createRepeatableItem = useMutation(repeatableItemMutations.create());
|
|
203
204
|
const deleteRepeatableItem = useMutation(repeatableItemMutations.delete());
|
|
204
205
|
const updateRepeatablePosition = useMutation(repeatableItemMutations.updatePosition());
|
|
@@ -313,5 +314,6 @@ var RepeatableItemsList = ({ items, blockId, fieldName, minItems, maxItems, sche
|
|
|
313
314
|
function _temp(state_0) {
|
|
314
315
|
return state_0.context.iframeElement;
|
|
315
316
|
}
|
|
317
|
+
|
|
316
318
|
//#endregion
|
|
317
|
-
export { RepeatableItemsList };
|
|
319
|
+
export { RepeatableItemsList };
|
|
@@ -2,15 +2,16 @@ import { c } from "react/compiler-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { codeToHtml } from "shiki";
|
|
5
|
+
|
|
5
6
|
//#region src/features/preview/components/ShikiMarkdown.tsx
|
|
6
|
-
|
|
7
|
+
const css = `
|
|
7
8
|
.dark .shiki,
|
|
8
9
|
.dark .shiki span {
|
|
9
10
|
color: var(--shiki-dark) !important;
|
|
10
11
|
background-color: var(--shiki-dark-bg) !important;
|
|
11
12
|
}
|
|
12
13
|
`;
|
|
13
|
-
|
|
14
|
+
const ShikiMarkdown = (t0) => {
|
|
14
15
|
const $ = c(6);
|
|
15
16
|
const { code } = t0;
|
|
16
17
|
const [html, setHtml] = React.useState("");
|
|
@@ -59,5 +60,6 @@ var ShikiMarkdown = (t0) => {
|
|
|
59
60
|
} else t4 = $[5];
|
|
60
61
|
return t4;
|
|
61
62
|
};
|
|
63
|
+
|
|
62
64
|
//#endregion
|
|
63
|
-
export { ShikiMarkdown };
|
|
65
|
+
export { ShikiMarkdown };
|
|
@@ -13,8 +13,9 @@ import { Bold, Italic } from "lucide-react";
|
|
|
13
13
|
import { ButtonGroup } from "@camox/ui/button-group";
|
|
14
14
|
import { FloatingToolbar } from "@camox/ui/floating-toolbar";
|
|
15
15
|
import { Toggle } from "@camox/ui/toggle";
|
|
16
|
+
|
|
16
17
|
//#region src/features/preview/components/TextFormatToolbar.tsx
|
|
17
|
-
|
|
18
|
+
const FORMAT_BUTTONS = [{
|
|
18
19
|
key: "bold",
|
|
19
20
|
flag: FORMAT_FLAGS.bold,
|
|
20
21
|
icon: Bold,
|
|
@@ -27,7 +28,7 @@ var FORMAT_BUTTONS = [{
|
|
|
27
28
|
label: "Italic",
|
|
28
29
|
shortcut: "⌘ I"
|
|
29
30
|
}];
|
|
30
|
-
|
|
31
|
+
const TextFormatToolbar = () => {
|
|
31
32
|
const $ = c(15);
|
|
32
33
|
const iframeElement = useSelector(previewStore, _temp);
|
|
33
34
|
const isAnySideSheetOpen = useIsPreviewSheetOpen();
|
|
@@ -129,5 +130,6 @@ function _temp(state) {
|
|
|
129
130
|
function _temp2(e) {
|
|
130
131
|
return e.preventDefault();
|
|
131
132
|
}
|
|
133
|
+
|
|
132
134
|
//#endregion
|
|
133
|
-
export { TextFormatToolbar };
|
|
135
|
+
export { TextFormatToolbar };
|
|
@@ -8,8 +8,9 @@ import { Button } from "@camox/ui/button";
|
|
|
8
8
|
import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
|
|
9
9
|
import { X } from "lucide-react";
|
|
10
10
|
import { AlertDialog, AlertDialogAction, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
|
|
11
|
+
|
|
11
12
|
//#region src/features/preview/components/UnlinkAssetButton.tsx
|
|
12
|
-
|
|
13
|
+
const UnlinkAssetButton = (t0) => {
|
|
13
14
|
const $ = c(37);
|
|
14
15
|
const { fileId, onUnlink, className } = t0;
|
|
15
16
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
@@ -154,5 +155,6 @@ var UnlinkAssetButton = (t0) => {
|
|
|
154
155
|
} else t17 = $[36];
|
|
155
156
|
return t17;
|
|
156
157
|
};
|
|
158
|
+
|
|
157
159
|
//#endregion
|
|
158
|
-
export { UnlinkAssetButton };
|
|
160
|
+
export { UnlinkAssetButton };
|
|
@@ -4,8 +4,9 @@ import { c } from "react/compiler-runtime";
|
|
|
4
4
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
5
|
import { useSelector } from "@xstate/store/react";
|
|
6
6
|
import { generateKeyBetween } from "fractional-indexing";
|
|
7
|
-
import { queryKeys } from "@camox/api/query-keys";
|
|
7
|
+
import { queryKeys } from "@camox/api-contract/query-keys";
|
|
8
8
|
import { useLocation } from "@tanstack/react-router";
|
|
9
|
+
|
|
9
10
|
//#region src/features/preview/components/useUpdateBlockPosition.ts
|
|
10
11
|
function useUpdateBlockPosition() {
|
|
11
12
|
const $ = c(4);
|
|
@@ -76,5 +77,6 @@ function useUpdateBlockPosition() {
|
|
|
76
77
|
function _temp(state) {
|
|
77
78
|
return state.context.peekedPagePathname;
|
|
78
79
|
}
|
|
80
|
+
|
|
79
81
|
//#endregion
|
|
80
|
-
export { useUpdateBlockPosition };
|
|
82
|
+
export { useUpdateBlockPosition };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { toast } from "@camox/ui/toaster";
|
|
2
2
|
import { createStore } from "@xstate/store";
|
|
3
|
+
|
|
3
4
|
//#region src/features/preview/previewStore.ts
|
|
4
5
|
/** Extract the blockId from any selection variant. */
|
|
5
6
|
function selectionBlockId(sel) {
|
|
@@ -20,7 +21,7 @@ function selectionField(sel) {
|
|
|
20
21
|
};
|
|
21
22
|
return null;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
+
const previewStore = createStore({
|
|
24
25
|
context: {
|
|
25
26
|
isPresentationMode: false,
|
|
26
27
|
isSidebarOpen: true,
|
|
@@ -260,5 +261,6 @@ var previewStore = createStore({
|
|
|
260
261
|
})
|
|
261
262
|
}
|
|
262
263
|
});
|
|
264
|
+
|
|
263
265
|
//#endregion
|
|
264
|
-
export { previewStore, selectionBlockId, selectionField, selectionItemId };
|
|
266
|
+
export { previewStore, selectionBlockId, selectionField, selectionItemId };
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import { CamoxApp } from
|
|
1
|
+
import { CamoxApp } from "../../core/createApp.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/features/provider/CamoxProvider.d.ts
|
|
3
6
|
interface CamoxProviderProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
camoxApp: CamoxApp;
|
|
9
|
+
authenticationUrl: string;
|
|
10
|
+
apiUrl: string;
|
|
11
|
+
projectSlug: string;
|
|
12
|
+
environmentName?: string;
|
|
10
13
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
declare function CamoxProvider({
|
|
15
|
+
children,
|
|
16
|
+
camoxApp,
|
|
17
|
+
authenticationUrl,
|
|
18
|
+
apiUrl,
|
|
19
|
+
projectSlug,
|
|
20
|
+
environmentName
|
|
21
|
+
}: CamoxProviderProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { CamoxProvider };
|
|
@@ -16,8 +16,9 @@ import * as React from "react";
|
|
|
16
16
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
import { ReactQueryDevtools } from "@tanstack/react-query-devtools/production";
|
|
18
18
|
import studioCssUrl from "virtual:camox-studio-css";
|
|
19
|
+
|
|
19
20
|
//#region src/features/provider/CamoxProvider.tsx
|
|
20
|
-
|
|
21
|
+
const AuthenticatedCamoxProvider = (t0) => {
|
|
21
22
|
const $ = c(8);
|
|
22
23
|
const { children } = t0;
|
|
23
24
|
useAdminShortcuts();
|
|
@@ -60,7 +61,7 @@ var AuthenticatedCamoxProvider = (t0) => {
|
|
|
60
61
|
} else t4 = $[7];
|
|
61
62
|
return t4;
|
|
62
63
|
};
|
|
63
|
-
|
|
64
|
+
const UnauthenticatedCamoxProvider = (t0) => {
|
|
64
65
|
const $ = c(7);
|
|
65
66
|
const { children } = t0;
|
|
66
67
|
const signInRedirect = useSignInRedirect();
|
|
@@ -127,5 +128,6 @@ function CamoxProvider({ children, camoxApp, authenticationUrl, apiUrl, projectS
|
|
|
127
128
|
})
|
|
128
129
|
});
|
|
129
130
|
}
|
|
131
|
+
|
|
130
132
|
//#endregion
|
|
131
|
-
export { CamoxProvider };
|
|
133
|
+
export { CamoxProvider };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createStore } from "@xstate/store";
|
|
2
|
+
|
|
2
3
|
//#region src/features/provider/actionsStore.ts
|
|
3
|
-
|
|
4
|
+
const actionsStore = createStore({
|
|
4
5
|
context: { actions: [] },
|
|
5
6
|
on: {
|
|
6
7
|
registerAction: (context, event) => {
|
|
@@ -31,5 +32,6 @@ var actionsStore = createStore({
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
});
|
|
35
|
+
|
|
34
36
|
//#endregion
|
|
35
|
-
export { actionsStore };
|
|
37
|
+
export { actionsStore };
|