camox 0.7.1 → 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 +6 -4
- package/dist/features/preview/components/AddBlockSheet.js +4 -2
- 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 +3 -1
- 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 +5 -3
- 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 +6 -4
- package/dist/lib/queries.d.ts +9 -791
- package/dist/lib/queries.js +12 -10
- 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
|
@@ -1,9 +1,10 @@
|
|
|
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/features/provider/components/CamoxAppContext.tsx
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
const CamoxAppContext = React.createContext(void 0);
|
|
7
|
+
const CamoxAppProvider = (t0) => {
|
|
7
8
|
const $ = c(3);
|
|
8
9
|
const { app, children } = t0;
|
|
9
10
|
let t1;
|
|
@@ -23,5 +24,6 @@ function useCamoxApp() {
|
|
|
23
24
|
if (!context) throw new Error("useCamoxApp must be used within a CamoxAppProvider");
|
|
24
25
|
return context;
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
//#endregion
|
|
27
|
-
export { CamoxAppProvider, useCamoxApp };
|
|
29
|
+
export { CamoxAppProvider, useCamoxApp };
|
|
@@ -6,6 +6,7 @@ import { useSelector } from "@xstate/store/react";
|
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandShortcut } from "@camox/ui/command";
|
|
9
|
+
|
|
9
10
|
//#region src/features/provider/components/CommandPalette.tsx
|
|
10
11
|
function CommandPalette() {
|
|
11
12
|
const $ = c(35);
|
|
@@ -230,5 +231,6 @@ function _temp5() {
|
|
|
230
231
|
function _temp4() {
|
|
231
232
|
return true;
|
|
232
233
|
}
|
|
234
|
+
|
|
233
235
|
//#endregion
|
|
234
|
-
export { CommandPalette, useCommandPaletteActions };
|
|
236
|
+
export { CommandPalette, useCommandPaletteActions };
|
|
@@ -4,6 +4,7 @@ import { checkIfInputFocused } from "../../lib/utils.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/provider/useAdminShortcuts.tsx
|
|
8
9
|
/**
|
|
9
10
|
* Hook that listens for global keyboard shortcuts defined in the actionsStore
|
|
@@ -95,5 +96,6 @@ function useAdminShortcuts() {
|
|
|
95
96
|
function _temp(state) {
|
|
96
97
|
return state.context.actions;
|
|
97
98
|
}
|
|
99
|
+
|
|
98
100
|
//#endregion
|
|
99
|
-
export { useAdminShortcuts };
|
|
101
|
+
export { useAdminShortcuts };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { CamoxApp } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { CamoxApp } from "../../core/createApp.js";
|
|
2
|
+
|
|
3
|
+
//#region src/features/routes/ogRoute.d.ts
|
|
4
|
+
declare function createOgHandler(camoxApp: CamoxApp): {
|
|
5
|
+
GET: ({
|
|
6
|
+
request
|
|
7
|
+
}: {
|
|
8
|
+
request: Request;
|
|
9
|
+
}) => Promise<Response>;
|
|
6
10
|
};
|
|
7
|
-
//#
|
|
11
|
+
//#endregion
|
|
12
|
+
export { createOgHandler };
|
|
@@ -1,53 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { CamoxApp } from "../../core/createApp.js";
|
|
2
|
+
import { PageStructure } from "../../lib/queries.js";
|
|
3
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
4
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
import * as _$_tanstack_react_start0 from "@tanstack/react-start";
|
|
6
|
+
|
|
7
|
+
//#region src/features/routes/pageRoute.d.ts
|
|
8
|
+
declare function parseQuality(part: string): number;
|
|
9
|
+
declare function prefersMarkdown(accept: string): boolean;
|
|
10
|
+
declare const getOrigin: _$_tanstack_react_start0.OptionalFetcher<undefined, undefined, Promise<string>>;
|
|
11
|
+
declare function createMarkdownMiddleware(apiUrl: string, projectSlug: string, environmentName?: string): _$_tanstack_react_start0.RequestMiddlewareAfterServer<{}, undefined, undefined>;
|
|
12
|
+
declare function createPageLoader(apiUrl: string, projectSlug: string, environmentName?: string): ({
|
|
13
|
+
location,
|
|
14
|
+
context
|
|
15
|
+
}: {
|
|
16
|
+
location: {
|
|
17
|
+
pathname: string;
|
|
18
|
+
};
|
|
19
|
+
context: {
|
|
20
|
+
queryClient: QueryClient;
|
|
21
|
+
};
|
|
15
22
|
}) => Promise<{
|
|
23
|
+
page: {
|
|
16
24
|
page: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
updatedAt: number;
|
|
31
|
-
};
|
|
32
|
-
layout: {
|
|
33
|
-
id: number;
|
|
34
|
-
layoutId: string;
|
|
35
|
-
beforeBlockIds: number[];
|
|
36
|
-
afterBlockIds: number[];
|
|
37
|
-
} | null;
|
|
38
|
-
projectName: string;
|
|
25
|
+
blockIds: number[];
|
|
26
|
+
id: number;
|
|
27
|
+
projectId: number;
|
|
28
|
+
environmentId: number;
|
|
29
|
+
pathSegment: string;
|
|
30
|
+
fullPath: string;
|
|
31
|
+
parentPageId: number | null;
|
|
32
|
+
layoutId: number;
|
|
33
|
+
metaTitle: string | null;
|
|
34
|
+
metaDescription: string | null;
|
|
35
|
+
aiSeoEnabled: boolean | null;
|
|
36
|
+
createdAt: number;
|
|
37
|
+
updatedAt: number;
|
|
39
38
|
};
|
|
40
|
-
|
|
39
|
+
layout: {
|
|
40
|
+
id: number;
|
|
41
|
+
layoutId: string;
|
|
42
|
+
beforeBlockIds: number[];
|
|
43
|
+
afterBlockIds: number[];
|
|
44
|
+
} | null;
|
|
45
|
+
projectName: string;
|
|
46
|
+
};
|
|
47
|
+
origin: string;
|
|
41
48
|
}>;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
declare function createPageHead(camoxApp: CamoxApp): ({
|
|
50
|
+
loaderData
|
|
51
|
+
}: {
|
|
52
|
+
loaderData?: {
|
|
53
|
+
page: PageStructure;
|
|
54
|
+
origin: string;
|
|
55
|
+
};
|
|
47
56
|
}) => {
|
|
48
|
-
|
|
57
|
+
meta?: undefined;
|
|
49
58
|
} | {
|
|
50
|
-
|
|
59
|
+
meta: Record<string, string>[];
|
|
51
60
|
};
|
|
52
|
-
|
|
53
|
-
//#
|
|
61
|
+
declare const PageRouteComponent: () => _$react_jsx_runtime0.JSX.Element;
|
|
62
|
+
//#endregion
|
|
63
|
+
export { PageRouteComponent, createMarkdownMiddleware, createPageHead, createPageLoader, getOrigin, parseQuality, prefersMarkdown };
|
|
@@ -9,6 +9,7 @@ import { RPCLink } from "@orpc/client/fetch";
|
|
|
9
9
|
import { notFound } from "@tanstack/react-router";
|
|
10
10
|
import { createMiddleware, createServerFn } from "@tanstack/react-start";
|
|
11
11
|
import { getRequest } from "@tanstack/react-start/server";
|
|
12
|
+
|
|
12
13
|
//#region src/features/routes/pageRoute.tsx
|
|
13
14
|
function parseQuality(part) {
|
|
14
15
|
const match = part.match(/;\s*q=([0-9.]+)/);
|
|
@@ -32,7 +33,7 @@ function createServerApiClient(apiUrl, environmentName) {
|
|
|
32
33
|
headers
|
|
33
34
|
}));
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
const getOrigin = createServerFn({ method: "GET" }).handler(async () => {
|
|
36
37
|
const request = getRequest();
|
|
37
38
|
return new URL(request.url).origin;
|
|
38
39
|
});
|
|
@@ -139,7 +140,7 @@ function createPageHead(camoxApp) {
|
|
|
139
140
|
return { meta };
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
|
-
|
|
143
|
+
const PageRouteComponent = () => {
|
|
143
144
|
const $ = c(1);
|
|
144
145
|
let t0;
|
|
145
146
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -148,5 +149,6 @@ var PageRouteComponent = () => {
|
|
|
148
149
|
} else t0 = $[0];
|
|
149
150
|
return t0;
|
|
150
151
|
};
|
|
152
|
+
|
|
151
153
|
//#endregion
|
|
152
|
-
export { PageRouteComponent, createMarkdownMiddleware, createPageHead, createPageLoader, getOrigin, parseQuality, prefersMarkdown };
|
|
154
|
+
export { PageRouteComponent, createMarkdownMiddleware, createPageHead, createPageLoader, getOrigin, parseQuality, prefersMarkdown };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/features/studio/CamoxStudio.d.ts
|
|
5
|
+
declare const CamoxStudio: ({
|
|
6
|
+
children
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => _$react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { CamoxStudio };
|
|
@@ -4,8 +4,9 @@ import { c } from "react/compiler-runtime";
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Navigate, useLocation } from "@tanstack/react-router";
|
|
7
|
+
|
|
7
8
|
//#region src/features/studio/CamoxStudio.tsx
|
|
8
|
-
|
|
9
|
+
const CamoxStudio = (t0) => {
|
|
9
10
|
const $ = c(11);
|
|
10
11
|
const { children } = t0;
|
|
11
12
|
const { isAuthenticated, isLoading: isLoadingAuth } = useAuthState();
|
|
@@ -53,5 +54,6 @@ var CamoxStudio = (t0) => {
|
|
|
53
54
|
} else t4 = $[10];
|
|
54
55
|
return t4;
|
|
55
56
|
};
|
|
57
|
+
|
|
56
58
|
//#endregion
|
|
57
|
-
export { CamoxStudio };
|
|
59
|
+
export { CamoxStudio };
|
|
@@ -6,8 +6,9 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { Button } from "@camox/ui/button";
|
|
7
7
|
import { ChevronsUpDown } from "lucide-react";
|
|
8
8
|
import { Badge } from "@camox/ui/badge";
|
|
9
|
+
|
|
9
10
|
//#region src/features/studio/components/EnvironmentMenu.tsx
|
|
10
|
-
|
|
11
|
+
const EnvironmentMenu = () => {
|
|
11
12
|
const $ = c(13);
|
|
12
13
|
const [open, setOpen] = React.useState(false);
|
|
13
14
|
const authCtx = React.useContext(AuthContext);
|
|
@@ -84,5 +85,6 @@ var EnvironmentMenu = () => {
|
|
|
84
85
|
} else t5 = $[12];
|
|
85
86
|
return t5;
|
|
86
87
|
};
|
|
88
|
+
|
|
87
89
|
//#endregion
|
|
88
|
-
export { EnvironmentMenu };
|
|
90
|
+
export { EnvironmentMenu };
|
|
@@ -15,8 +15,9 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
import { Button } from "@camox/ui/button";
|
|
16
16
|
import { Link, useLocation, useNavigate } from "@tanstack/react-router";
|
|
17
17
|
import { Database, Globe, SearchIcon } from "lucide-react";
|
|
18
|
+
|
|
18
19
|
//#region src/features/studio/components/Navbar.tsx
|
|
19
|
-
|
|
20
|
+
const links = [{
|
|
20
21
|
to: "/",
|
|
21
22
|
title: "Preview",
|
|
22
23
|
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Globe, { className: "h-4 w-4" }), "Preview"] }),
|
|
@@ -27,7 +28,7 @@ var links = [{
|
|
|
27
28
|
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Database, { className: "h-4 w-4" }), "Content"] }),
|
|
28
29
|
icon: "FileText"
|
|
29
30
|
}];
|
|
30
|
-
|
|
31
|
+
const Navbar = () => {
|
|
31
32
|
const $ = c(23);
|
|
32
33
|
const projectSlug = useProjectSlug();
|
|
33
34
|
let t0;
|
|
@@ -199,5 +200,6 @@ function _temp2() {
|
|
|
199
200
|
function _temp() {
|
|
200
201
|
return studioStore.send({ type: "openCommandPalette" });
|
|
201
202
|
}
|
|
203
|
+
|
|
202
204
|
//#endregion
|
|
203
|
-
export { Navbar, useNavbarActions };
|
|
205
|
+
export { Navbar, useNavbarActions };
|
|
@@ -9,8 +9,9 @@ import { Link } from "@tanstack/react-router";
|
|
|
9
9
|
import { ChevronDown, Globe, Info, Settings, Users } from "lucide-react";
|
|
10
10
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
11
11
|
import { Skeleton } from "@camox/ui/skeleton";
|
|
12
|
+
|
|
12
13
|
//#region src/features/studio/components/ProjectMenu.tsx
|
|
13
|
-
|
|
14
|
+
const Favicon = (t0) => {
|
|
14
15
|
const $ = c(18);
|
|
15
16
|
const { size: t1 } = t0;
|
|
16
17
|
const size = t1 === void 0 ? 16 : t1;
|
|
@@ -106,7 +107,7 @@ var Favicon = (t0) => {
|
|
|
106
107
|
} else t7 = $[17];
|
|
107
108
|
return t7;
|
|
108
109
|
};
|
|
109
|
-
|
|
110
|
+
const ProjectMenu = () => {
|
|
110
111
|
const $ = c(40);
|
|
111
112
|
const authCtx = React.useContext(AuthContext);
|
|
112
113
|
let t0;
|
|
@@ -318,5 +319,6 @@ function _temp() {
|
|
|
318
319
|
}
|
|
319
320
|
return null;
|
|
320
321
|
}
|
|
322
|
+
|
|
321
323
|
//#endregion
|
|
322
|
-
export { ProjectMenu };
|
|
324
|
+
export { ProjectMenu };
|
|
@@ -7,8 +7,9 @@ import { Button } from "@camox/ui/button";
|
|
|
7
7
|
import { LogOut, Monitor, Moon, Settings, Sun, User } from "lucide-react";
|
|
8
8
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
9
9
|
import { Avatar, AvatarFallback, AvatarImage } from "@camox/ui/avatar";
|
|
10
|
+
|
|
10
11
|
//#region src/features/studio/components/UserButton.tsx
|
|
11
|
-
|
|
12
|
+
const UserButton = () => {
|
|
12
13
|
const $ = c(3);
|
|
13
14
|
const { isAuthenticated, isLoading } = useAuthState();
|
|
14
15
|
const { setTheme } = useTheme();
|
|
@@ -105,5 +106,6 @@ function AuthenticatedUserButton({ setTheme }) {
|
|
|
105
106
|
]
|
|
106
107
|
})] });
|
|
107
108
|
}
|
|
109
|
+
|
|
108
110
|
//#endregion
|
|
109
|
-
export { UserButton };
|
|
111
|
+
export { UserButton };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createStore } from "@xstate/store";
|
|
2
|
+
|
|
2
3
|
//#region src/features/studio/studioStore.ts
|
|
3
|
-
|
|
4
|
+
const studioStore = createStore({
|
|
4
5
|
context: {
|
|
5
6
|
isCommandPaletteOpen: false,
|
|
6
7
|
commandPalettePages: []
|
|
@@ -40,5 +41,6 @@ var studioStore = createStore({
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
});
|
|
44
|
+
|
|
43
45
|
//#endregion
|
|
44
|
-
export { studioStore };
|
|
46
|
+
export { studioStore };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { actionsStore } from "../provider/actionsStore.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
|
|
4
5
|
//#region src/features/studio/useTheme.ts
|
|
5
6
|
function useTheme() {
|
|
6
7
|
const $ = c(8);
|
|
@@ -137,5 +138,6 @@ function _temp4() {}
|
|
|
137
138
|
function _temp3() {
|
|
138
139
|
return true;
|
|
139
140
|
}
|
|
141
|
+
|
|
140
142
|
//#endregion
|
|
141
|
-
export { useTheme, useThemeActions };
|
|
143
|
+
export { useTheme, useThemeActions };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { writeIfChanged } from "./utils.js";
|
|
2
2
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { relative, resolve } from "node:path";
|
|
4
|
+
|
|
4
5
|
//#region src/features/vite/appGeneration.ts
|
|
5
|
-
|
|
6
|
+
const HEADER = `/* ============================================================================
|
|
6
7
|
* AUTO-GENERATED BY CAMOX — DO NOT EDIT
|
|
7
8
|
*
|
|
8
9
|
* This file is managed by the Camox Vite plugin and should stay gitignored.
|
|
@@ -63,5 +64,6 @@ function watchAppFile(server, appRoot) {
|
|
|
63
64
|
writeFileSync(deletedPath, expected, "utf-8");
|
|
64
65
|
});
|
|
65
66
|
}
|
|
67
|
+
|
|
66
68
|
//#endregion
|
|
67
|
-
export { generateAppFile, watchAppFile };
|
|
69
|
+
export { generateAppFile, watchAppFile };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { basename, resolve } from "node:path";
|
|
3
|
+
|
|
3
4
|
//#region src/features/vite/blockBoilerplate.ts
|
|
4
|
-
|
|
5
|
+
const MAX_EMPTY_BLOCK_CHARACTER_COUNT = 50;
|
|
5
6
|
function kebabToCamel(str) {
|
|
6
7
|
return str.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
|
7
8
|
}
|
|
@@ -55,5 +56,6 @@ function watchNewBlockFiles(server) {
|
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
}
|
|
59
|
+
|
|
58
60
|
//#endregion
|
|
59
|
-
export { watchNewBlockFiles };
|
|
61
|
+
export { watchNewBlockFiles };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createServerApiClient } from "../../lib/api-client-server.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { createServer, isRunnableDevEnvironment } from "vite";
|
|
4
|
+
|
|
4
5
|
//#region src/features/vite/definitionsSync.ts
|
|
5
|
-
|
|
6
|
+
const SYNC_DEBOUNCE_DELAY_MS = 100;
|
|
6
7
|
/**
|
|
7
8
|
* Sync block and layout definitions to the API.
|
|
8
9
|
* This is the core sync logic, independent of ViteDevServer.
|
|
@@ -71,7 +72,7 @@ async function syncDefinitionsToApi(options) {
|
|
|
71
72
|
function getBlockIdFromFilePath(filePath) {
|
|
72
73
|
return path.basename(filePath, path.extname(filePath));
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
+
const CAMOX_APP_PATH = "./src/camox/app.ts";
|
|
75
76
|
/**
|
|
76
77
|
* Load a module using SSR. Uses the server's SSR environment runner if available,
|
|
77
78
|
* otherwise falls back to a temporary Vite server (needed when Nitro or other
|
|
@@ -217,5 +218,6 @@ async function syncDefinitions(server, options) {
|
|
|
217
218
|
server.watcher.on("add", handleLayoutFileChange);
|
|
218
219
|
server.watcher.on("unlink", handleBlockFileDelete);
|
|
219
220
|
}
|
|
221
|
+
|
|
220
222
|
//#endregion
|
|
221
|
-
export { syncDefinitions, syncDefinitionsToApi };
|
|
223
|
+
export { syncDefinitions, syncDefinitionsToApi };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { writeIfChanged } from "./utils.js";
|
|
2
2
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { relative, resolve } from "node:path";
|
|
4
|
+
|
|
4
5
|
//#region src/features/vite/routeGeneration.ts
|
|
5
|
-
|
|
6
|
+
const HEADER = `/* ============================================================================
|
|
6
7
|
* AUTO-GENERATED BY CAMOX — DO NOT EDIT
|
|
7
8
|
*
|
|
8
9
|
* This file is managed by the Camox Vite plugin and should stay gitignored.
|
|
@@ -190,5 +191,6 @@ function watchRouteFiles(options) {
|
|
|
190
191
|
writeFileSync(deletedPath, expected, "utf-8");
|
|
191
192
|
});
|
|
192
193
|
}
|
|
194
|
+
|
|
193
195
|
//#endregion
|
|
194
|
-
export { generateRouteFiles, watchRouteFiles };
|
|
196
|
+
export { generateRouteFiles, watchRouteFiles };
|
|
@@ -2,13 +2,14 @@ import { writeIfChanged } from "./utils.js";
|
|
|
2
2
|
import { lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dirname, join, relative, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
5
6
|
//#region src/features/vite/skillGeneration.ts
|
|
6
|
-
|
|
7
|
+
const HEADER = `<!-- AUTO-GENERATED BY CAMOX — DO NOT EDIT
|
|
7
8
|
This file is managed by the Camox Vite plugin.
|
|
8
9
|
Any manual edits will be automatically reverted by the dev server. -->
|
|
9
10
|
|
|
10
11
|
`;
|
|
11
|
-
|
|
12
|
+
const sdkRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../../..");
|
|
12
13
|
function getSkillNames() {
|
|
13
14
|
const skillsDir = resolve(sdkRoot, "skills");
|
|
14
15
|
return readdirSync(skillsDir).filter((name) => lstatSync(resolve(skillsDir, name)).isDirectory());
|
|
@@ -65,5 +66,6 @@ function watchSkillFiles(server, appRoot) {
|
|
|
65
66
|
writeFileSync(deletedPath, expected, "utf-8");
|
|
66
67
|
});
|
|
67
68
|
}
|
|
69
|
+
|
|
68
70
|
//#endregion
|
|
69
|
-
export { generateSkillFiles, watchSkillFiles };
|
|
71
|
+
export { generateSkillFiles, watchSkillFiles };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
|
|
2
3
|
//#region src/features/vite/utils.ts
|
|
3
4
|
function writeIfChanged(filePath, content) {
|
|
4
5
|
if (existsSync(filePath)) {
|
|
@@ -6,5 +7,6 @@ function writeIfChanged(filePath, content) {
|
|
|
6
7
|
}
|
|
7
8
|
writeFileSync(filePath, content, "utf-8");
|
|
8
9
|
}
|
|
10
|
+
|
|
9
11
|
//#endregion
|
|
10
|
-
export { writeIfChanged };
|
|
12
|
+
export { writeIfChanged };
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { Plugin } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
disableCodeGen?: boolean;
|
|
19
|
-
};
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
|
|
3
|
+
//#region src/features/vite/vite.d.ts
|
|
4
|
+
interface CamoxPluginOptions {
|
|
5
|
+
/** Stable, human-readable slug identifying this project (e.g. "prestigious-impala-84") */
|
|
6
|
+
projectSlug: string;
|
|
7
|
+
/** Secret used to authenticate definition sync requests with the API */
|
|
8
|
+
syncSecret: string;
|
|
9
|
+
/** Disable PostHog analytics collection (default: false) */
|
|
10
|
+
disableAnalytics?: boolean;
|
|
11
|
+
/** Internal options (intended for Camox contributors in development, not for public use) */
|
|
12
|
+
_internal?: {
|
|
13
|
+
/** URL of the Camox API backend, used for data fetching */apiUrl?: string; /** URL of the Camox authentication backend (default: https://camox.ai) */
|
|
14
|
+
authenticationUrl?: string; /** Show Tanstack query devtools (default: false) */
|
|
15
|
+
enableTanstackDevtools?: boolean; /** Disable automatic code generation (route files, app file, skill files) (default: false) */
|
|
16
|
+
disableCodeGen?: boolean;
|
|
17
|
+
};
|
|
20
18
|
}
|
|
21
|
-
|
|
22
|
-
//#
|
|
19
|
+
declare function camox(options: CamoxPluginOptions): Plugin;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { CamoxPluginOptions, camox };
|
|
@@ -8,13 +8,16 @@ import { homedir } from "node:os";
|
|
|
8
8
|
import { dirname, join, resolve } from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
import { createServer } from "vite";
|
|
11
|
+
|
|
11
12
|
//#region src/features/vite/vite.ts
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const sdkRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../../..");
|
|
14
|
+
const VIRTUAL_STUDIO_CSS = "virtual:camox-studio-css";
|
|
15
|
+
const RESOLVED_VIRTUAL_STUDIO_CSS = "\0" + VIRTUAL_STUDIO_CSS;
|
|
16
|
+
const VIRTUAL_OVERLAY_CSS = "virtual:camox-overlay-css";
|
|
17
|
+
const RESOLVED_VIRTUAL_OVERLAY_CSS = "\0" + VIRTUAL_OVERLAY_CSS;
|
|
18
|
+
const PRODUCTION_API_URL = "https://api.camox.ai";
|
|
16
19
|
/** Authentication URL to use for Camox authentication (production Camox web app) */
|
|
17
|
-
|
|
20
|
+
const DEFAULT_AUTHENTICATION_URL = "https://camox.ai";
|
|
18
21
|
function resolveEnvironmentName(isDev, authenticationUrl) {
|
|
19
22
|
if (!isDev) return "production";
|
|
20
23
|
const authFile = join(homedir(), ".camox", "auth.json");
|
|
@@ -40,19 +43,25 @@ function camox(options) {
|
|
|
40
43
|
name: "camox",
|
|
41
44
|
resolveId(id) {
|
|
42
45
|
if (id === VIRTUAL_STUDIO_CSS) return RESOLVED_VIRTUAL_STUDIO_CSS;
|
|
46
|
+
if (id === VIRTUAL_OVERLAY_CSS) return RESOLVED_VIRTUAL_OVERLAY_CSS;
|
|
43
47
|
},
|
|
44
48
|
load(id) {
|
|
45
|
-
if (id
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
if (id === RESOLVED_VIRTUAL_STUDIO_CSS) {
|
|
50
|
+
const cssPath = resolve(sdkRoot, "dist/studio.css");
|
|
51
|
+
if (isBuild) {
|
|
52
|
+
const css = readFileSync(cssPath, "utf-8");
|
|
53
|
+
return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({
|
|
54
|
+
type: "asset",
|
|
55
|
+
name: "studio.css",
|
|
56
|
+
source: css
|
|
57
|
+
})};`;
|
|
58
|
+
}
|
|
59
|
+
return `export default "/@fs/${cssPath}";`;
|
|
60
|
+
}
|
|
61
|
+
if (id === RESOLVED_VIRTUAL_OVERLAY_CSS) {
|
|
62
|
+
const css = readFileSync(resolve(sdkRoot, "src/features/preview/studio-overlays.css"), "utf-8");
|
|
63
|
+
return `export default ${JSON.stringify(css)};`;
|
|
54
64
|
}
|
|
55
|
-
return `export default "/@fs/${cssPath}";`;
|
|
56
65
|
},
|
|
57
66
|
config(_config, env) {
|
|
58
67
|
isBuild = env.command === "build";
|
|
@@ -134,5 +143,6 @@ function camox(options) {
|
|
|
134
143
|
}
|
|
135
144
|
};
|
|
136
145
|
}
|
|
146
|
+
|
|
137
147
|
//#endregion
|
|
138
|
-
export { camox };
|
|
148
|
+
export { camox };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
|
|
2
3
|
import { getAuthCookieHeader } from "../lib/auth.js";
|
|
3
4
|
import { getApiUrl, getEnvironmentName } from "../lib/api-client.js";
|
|
4
5
|
import { trackClientEvent } from "../lib/analytics-client.js";
|
|
5
6
|
import { useCallback, useRef, useState } from "react";
|
|
7
|
+
|
|
6
8
|
//#region src/hooks/use-file-upload.ts
|
|
7
9
|
function useFileUpload(options) {
|
|
8
10
|
const [uploads, setUploads] = useState([]);
|
|
@@ -84,5 +86,6 @@ function useFileUpload(options) {
|
|
|
84
86
|
}, [])
|
|
85
87
|
};
|
|
86
88
|
}
|
|
89
|
+
|
|
87
90
|
//#endregion
|
|
88
|
-
export { useFileUpload };
|
|
91
|
+
export { useFileUpload };
|