camox 0.58.0 → 0.59.0
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/core/createApp.d.ts +2 -2
- package/dist/core/createBlock.js +1 -1
- package/dist/core/createLayout.d.ts +1 -1
- package/dist/core/editing/createEditableBlock.d.ts +1 -1
- package/dist/core/editing/createEditableBlock.js +1 -1
- package/dist/core/lib/recordScope.js +1 -1
- package/dist/features/canvas/CamoxCanvas.js +2 -2
- package/dist/features/canvas/CanvasOverlays.js +1 -1
- package/dist/features/canvas/sidebar/LayoutPageSeo.js +1 -1
- package/dist/features/canvas/sidebar/PageInspector.js +1 -1
- package/dist/features/content/CamoxContent.js +1 -1
- package/dist/features/content/components/MissingFromLocale.js +1 -1
- package/dist/features/page/CuratedPageContent.js +1 -1
- package/dist/features/preview/CamoxPreview.js +3 -3
- package/dist/features/preview/components/AddBlockSheet.js +1 -1
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +1 -1
- package/dist/features/preview/components/CreatePageModal.js +2 -2
- package/dist/features/preview/components/FieldOverlayStyles.js +1 -1
- package/dist/features/preview/components/MobilePreviewDrawer.js +1 -1
- package/dist/features/preview/components/Overlays.js +1 -1
- package/dist/features/preview/components/PageInfo.js +1 -1
- package/dist/features/preview/components/PagePicker.js +1 -1
- package/dist/features/preview/components/PageTree.js +1 -1
- package/dist/features/preview/components/PreviewPanel.js +1 -1
- package/dist/features/preview/components/PreviewToolbar.js +1 -1
- package/dist/features/preview/components/SelectionEditor.js +1 -1
- package/dist/features/preview/components/StudioEditingFallback.js +1 -1
- package/dist/features/provider/AuthenticatedCamoxProvider.js +1 -1
- package/dist/features/provider/CamoxProvider.js +1 -1
- package/dist/features/provider/CoreCamoxProvider.js +3 -3
- package/dist/features/provider/components/CommandPalette.js +1 -1
- package/dist/features/renderer/rendererHost.js +3 -7
- package/dist/features/routes/pageRuntime.d.ts +2 -5
- package/dist/features/routes/pageRuntime.js +1 -2
- package/dist/features/runtime/RuntimeChrome.js +1 -1
- package/dist/features/runtime/navigationTarget.js +1 -2
- package/dist/features/runtime/pageApp.js +1 -1
- package/dist/features/runtime/rendererClient.js +1 -1
- package/dist/features/runtime/runtime.d.ts +0 -5
- package/dist/features/runtime/runtime.js +28 -32
- package/dist/features/runtime/worker.js +3 -3
- package/dist/features/settings/FaviconSettings.js +1 -1
- package/dist/features/studio/CamoxStudio.js +1 -1
- package/dist/features/studio/FollowAgentProvider.js +1 -1
- package/dist/features/studio/components/ChatWidget.js +1 -1
- package/dist/features/studio/components/DraftsControl.js +232 -201
- package/dist/features/studio/components/LocalePicker.js +2 -2
- package/dist/features/studio/components/Navbar.js +3 -3
- package/dist/features/studio/components/Patrol.js +1 -1
- package/dist/features/studio/components/ProjectMenu.js +2 -2
- package/dist/features/studio/components/ReviewDraftSheet.js +9 -15
- package/dist/features/studio/components/ThreadMessages.js +103 -21
- package/dist/features/studio/components/UserButton.js +2 -2
- package/dist/features/studio/draftLabel.js +1 -2
- package/dist/features/studio/draftNotice.js +0 -1
- package/dist/features/studio/showInCanvas.js +1 -1
- package/dist/features/vite/definitionsSync.js +14 -60
- package/dist/features/vite/devSignIn.js +1 -1
- package/dist/features/vite/runtimeDev.js +0 -1
- package/dist/features/vite/vite.d.ts +8 -5
- package/dist/features/vite/vite.js +34 -25
- package/dist/lib/api-client-server.js +25 -8
- package/dist/lib/api-client.js +2 -6
- package/dist/lib/auth.js +1 -1
- package/dist/lib/draft-scope.js +5 -25
- package/dist/lib/preview-handoff.js +1 -1
- package/dist/lib/server-auth-cookie.js +12 -10
- package/dist/lib/studio-reads.js +1 -1
- package/dist/lib/use-thread.js +31 -35
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/skills/camox/references/block-definitions.md +1 -1
- package/dist/features/vite/publishSeededContent.js +0 -30
- package/skills/camox-cli/SKILL.md +0 -15
- package/skills/camox-cli/references/cli-common.md +0 -58
- package/skills/camox-cli/references/cli-content.md +0 -181
- package/skills/camox-cli/references/cli-publishing.md +0 -26
package/dist/core/createApp.d.ts
CHANGED
|
@@ -416,7 +416,7 @@ export declare function createApp({ blocks, lazyBlocks, layouts, collections, do
|
|
|
416
416
|
Component: ({ blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition }: BlockComponentProps<{
|
|
417
417
|
[x: string]: unknown;
|
|
418
418
|
}>) => import("react").JSX.Element;
|
|
419
|
-
LayoutItem: ({ collectionId, collection, properties, record, children, fallback }: LayoutItemProps) => string | number | bigint | boolean |
|
|
419
|
+
LayoutItem: ({ collectionId, collection, properties, record, children, fallback }: LayoutItemProps) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
420
420
|
id: string;
|
|
421
421
|
title: string;
|
|
422
422
|
description: string;
|
|
@@ -858,7 +858,7 @@ export declare function createApp({ blocks, lazyBlocks, layouts, collections, do
|
|
|
858
858
|
Component: ({ blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition }: BlockComponentProps<{
|
|
859
859
|
[x: string]: unknown;
|
|
860
860
|
}>) => import("react").JSX.Element;
|
|
861
|
-
LayoutItem: ({ collectionId, collection, properties, record, children, fallback }: LayoutItemProps) => string | number | bigint | boolean |
|
|
861
|
+
LayoutItem: ({ collectionId, collection, properties, record, children, fallback }: LayoutItemProps) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
862
862
|
id: string;
|
|
863
863
|
title: string;
|
|
864
864
|
description: string;
|
package/dist/core/createBlock.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { artifactFrameProps, artifactStandInProps, isArtifactSource, isArtifactSourceReference } from "./lib/artifact.js";
|
|
2
2
|
import { artifactData } from "./lib/artifactData.js";
|
|
3
3
|
import { resolveBlockFields, resolveToMarkdown, resolveToStructuredData, resolveToTitle } from "./lib/contentType.js";
|
|
4
|
-
import { useProjectUuid } from "../lib/auth.js";
|
|
5
4
|
import { useLocation, useNavigate } from "../features/navigation/navigation.js";
|
|
6
5
|
import { useOptionalCamoxApp } from "../features/provider/components/CamoxAppContext.js";
|
|
6
|
+
import { useProjectUuid } from "../lib/auth.js";
|
|
7
7
|
import { isItemMarker, queryResultIds, resolveAssetValue, useNormalizedData } from "../lib/normalized-data.js";
|
|
8
8
|
import { useLinkPages } from "../lib/link-pages.js";
|
|
9
9
|
import { useBlockEditingRuntime } from "./editing/BlockEditingRuntime.js";
|
|
@@ -236,7 +236,7 @@ declare function createLayoutDefinition(options: AnyLayoutOptions): {
|
|
|
236
236
|
Item: {
|
|
237
237
|
({ children }: {
|
|
238
238
|
children: (item: any) => React.ReactNode;
|
|
239
|
-
}): string | number | bigint | boolean |
|
|
239
|
+
}): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
240
240
|
displayName: string;
|
|
241
241
|
};
|
|
242
242
|
useData(): unknown;
|
|
@@ -1694,7 +1694,7 @@ export declare function createEditableBlock<TSchemaShape extends Record<string,
|
|
|
1694
1694
|
params: unknown[] & [];
|
|
1695
1695
|
})["static"]; }, Exclude<keyof TSchemaShape, { [K_1 in keyof TSchemaShape]: TSchemaShape[K_1] extends import("@sinclair/typebox").TReadonly<TSchema> ? TSchemaShape[K_1] extends import("@sinclair/typebox").TOptional<TSchemaShape[K_1]> ? K_1 : never : never; }[keyof TSchemaShape] | { [K_2 in keyof TSchemaShape]: TSchemaShape[K_2] extends import("@sinclair/typebox").TReadonly<TSchema> ? TSchemaShape[K_2] extends import("@sinclair/typebox").TOptional<TSchemaShape[K_2]> ? never : K_2 : never; }[keyof TSchemaShape] | { [K_3 in keyof TSchemaShape]: TSchemaShape[K_3] extends import("@sinclair/typebox").TOptional<TSchema> ? TSchemaShape[K_3] extends import("@sinclair/typebox").TReadonly<TSchemaShape[K_3]> ? never : K_3 : never; }[keyof TSchemaShape]>>>>>) => React.JSX.Element;
|
|
1696
1696
|
/** Renders a record page's record; see `BlockEditingRuntime.renderLayoutItem`. */
|
|
1697
|
-
LayoutItem: ({ collectionId, collection, properties, record, children, fallback }: LayoutItemProps) => string | number | bigint | boolean |
|
|
1697
|
+
LayoutItem: ({ collectionId, collection, properties, record, children, fallback }: LayoutItemProps) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
1698
1698
|
id: string;
|
|
1699
1699
|
title: string;
|
|
1700
1700
|
description: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { artifactFrameProps, artifactPlaceholderProps, artifactStandInProps, isArtifactSource } from "../lib/artifact.js";
|
|
2
2
|
import { artifactData } from "../lib/artifactData.js";
|
|
3
3
|
import { resolveBlockFields, resolveToMarkdown, resolveToStructuredData, resolveToTitle } from "../lib/contentType.js";
|
|
4
|
-
import { useProjectUuid } from "../../lib/auth.js";
|
|
5
4
|
import { useLocation, useNavigate } from "../../features/navigation/navigation.js";
|
|
6
5
|
import { useOptionalCamoxApp } from "../../features/provider/components/CamoxAppContext.js";
|
|
6
|
+
import { useProjectUuid } from "../../lib/auth.js";
|
|
7
7
|
import { LinkedRecordsProvider, isItemMarker, queryResultIds, resolveAssetValue, useNormalizedData } from "../../lib/normalized-data.js";
|
|
8
8
|
import { useLinkPages } from "../../lib/link-pages.js";
|
|
9
9
|
import { ArtifactsRunContext, useArtifactHost, useInitialArtifactData } from "../hooks/useArtifactHost.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../lib/auth.js";
|
|
2
1
|
import { useLocation } from "../../features/navigation/navigation.js";
|
|
2
|
+
import { useProjectUuid } from "../../lib/auth.js";
|
|
3
3
|
import { resolveAssetValue, useNormalizedData } from "../../lib/normalized-data.js";
|
|
4
4
|
import { useLinkPages } from "../../lib/link-pages.js";
|
|
5
5
|
import { renderImagePlaceholder } from "./imagePlaceholder.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useAuthContext, useProjectUuid } from "../../lib/auth.js";
|
|
2
1
|
import { parseLocalePath } from "../../lib/locale-path.js";
|
|
3
2
|
import { useOptionalDraftScope } from "../../lib/draft-scope.js";
|
|
4
3
|
import { useViewLocale } from "../../lib/view-locale-context.js";
|
|
5
4
|
import { NavigationProvider, useLocation, useNavigate } from "../navigation/navigation.js";
|
|
5
|
+
import { useAuthContext, useProjectUuid } from "../../lib/auth.js";
|
|
6
6
|
import { reads, useReadQuery, useStudioCache } from "../../lib/studio-reads.js";
|
|
7
7
|
import { pageMutations } from "../../lib/queries.js";
|
|
8
8
|
import { useRoutableLayouts } from "../../lib/studio-definitions.js";
|
|
@@ -35,8 +35,8 @@ import { useCanvasNearness } from "./useCanvasNearness.js";
|
|
|
35
35
|
import { useDiscoveredPreviewPaths } from "./useDiscoveredPreviewPaths.js";
|
|
36
36
|
import { c } from "react/compiler-runtime";
|
|
37
37
|
import * as React from "react";
|
|
38
|
-
import { useSelector } from "@xstate/store-react";
|
|
39
38
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
39
|
+
import { useSelector } from "@xstate/store-react";
|
|
40
40
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
41
41
|
import { createStore as createStore$1 } from "@xstate/store";
|
|
42
42
|
|
|
@@ -6,8 +6,8 @@ import { canvasInsertionSeams } from "./canvasInsertionSeams.js";
|
|
|
6
6
|
import { observeCanvasOverlays } from "./canvasOverlayGeometry.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import { useSelector } from "@xstate/store-react";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { useSelector } from "@xstate/store-react";
|
|
11
11
|
import { Button } from "@camox/ui/button";
|
|
12
12
|
import { PlusIcon } from "lucide-react";
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../../lib/auth.js";
|
|
2
1
|
import { useOptionalDraftScope } from "../../../lib/draft-scope.js";
|
|
3
2
|
import { useLocation } from "../../navigation/navigation.js";
|
|
3
|
+
import { useProjectUuid } from "../../../lib/auth.js";
|
|
4
4
|
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
5
5
|
import { pageImageUrl } from "../../og/pageImage.js";
|
|
6
6
|
import { ShikiMarkdown } from "../../preview/components/ShikiMarkdown.js";
|
|
@@ -9,8 +9,8 @@ import { DerivedPageInspector } from "./DerivedPageInspector.js";
|
|
|
9
9
|
import { SingletonPageInspector } from "./SingletonPageInspector.js";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
11
|
import * as React from "react";
|
|
12
|
-
import { useSelector } from "@xstate/store-react";
|
|
13
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useSelector } from "@xstate/store-react";
|
|
14
14
|
import { File } from "lucide-react";
|
|
15
15
|
|
|
16
16
|
//#region src/features/canvas/sidebar/PageInspector.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../lib/auth.js";
|
|
2
1
|
import { Navigate, useNavigate } from "../navigation/navigation.js";
|
|
2
|
+
import { useProjectUuid } from "../../lib/auth.js";
|
|
3
3
|
import { reads, useReadQuery } from "../../lib/studio-reads.js";
|
|
4
4
|
import { CollectionItemSheetProvider } from "./CollectionItemSheetContext.js";
|
|
5
5
|
import { ContentCollection, ContentCollectionItemSheet } from "./ContentCollection.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../../lib/auth.js";
|
|
2
1
|
import { useViewLocale } from "../../../lib/view-locale-context.js";
|
|
2
|
+
import { useProjectUuid } from "../../../lib/auth.js";
|
|
3
3
|
import { reads, useReadQuery, useStudioCache } from "../../../lib/studio-reads.js";
|
|
4
4
|
import { localeMutations } from "../../../lib/queries.js";
|
|
5
5
|
import { ContentSidebarGroup } from "./ContentSidebarGroup.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../lib/auth.js";
|
|
2
1
|
import { useViewLocale } from "../../lib/view-locale-context.js";
|
|
3
2
|
import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
|
|
3
|
+
import { useProjectUuid } from "../../lib/auth.js";
|
|
4
4
|
import { NormalizedDataProvider, usePageBlocks } from "../../lib/normalized-data.js";
|
|
5
5
|
import { reads, useRead } from "../../lib/studio-reads.js";
|
|
6
6
|
import { BlockErrorBoundary } from "../preview/components/BlockErrorBoundary.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { actionsStore } from "../provider/actionsStore.js";
|
|
2
|
-
import { useIsAuthenticated, useProjectUuid } from "../../lib/auth.js";
|
|
3
1
|
import { parseLocalePath } from "../../lib/locale-path.js";
|
|
4
2
|
import { useCurrentDraftId, withoutDraft } from "../../lib/draft-scope.js";
|
|
5
3
|
import { useViewLocale } from "../../lib/view-locale-context.js";
|
|
6
4
|
import { useLocation, useNavigate } from "../navigation/navigation.js";
|
|
5
|
+
import { actionsStore } from "../provider/actionsStore.js";
|
|
6
|
+
import { useIsAuthenticated, useProjectUuid } from "../../lib/auth.js";
|
|
7
7
|
import { reads, useRead, useStudioCache } from "../../lib/studio-reads.js";
|
|
8
8
|
import { CollectionItemSheetProvider } from "../content/CollectionItemSheetContext.js";
|
|
9
9
|
import { cn } from "../../lib/utils.js";
|
|
@@ -29,8 +29,8 @@ import { PAGE_LOADING_LABEL } from "./components/StudioEditingFallback.js";
|
|
|
29
29
|
import { usePreviewViewportActions } from "./usePreviewViewportActions.js";
|
|
30
30
|
import { c } from "react/compiler-runtime";
|
|
31
31
|
import * as React from "react";
|
|
32
|
-
import { useSelector } from "@xstate/store-react";
|
|
33
32
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
import { useSelector } from "@xstate/store-react";
|
|
34
34
|
import { useQueryClient } from "@tanstack/react-query";
|
|
35
35
|
|
|
36
36
|
//#region src/features/preview/CamoxPreview.tsx
|
|
@@ -12,8 +12,8 @@ import { usePreviewedPage } from "../CamoxPreview.js";
|
|
|
12
12
|
import * as React from "react";
|
|
13
13
|
import { generateUuidv7 } from "@camox/api-contract/ids";
|
|
14
14
|
import { generateKeyBetween } from "fractional-indexing";
|
|
15
|
-
import { useSelector } from "@xstate/store-react";
|
|
16
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { useSelector } from "@xstate/store-react";
|
|
17
17
|
import { useMutation } from "@tanstack/react-query";
|
|
18
18
|
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "@camox/ui/sheet";
|
|
19
19
|
import { Badge } from "@camox/ui/badge";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getAuthCookieHeader, getAuthRequestCredentials } from "../../../lib/auth.js";
|
|
2
|
-
import { getApiUrl, getContentWriteHeaders } from "../../../lib/api-client.js";
|
|
3
2
|
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
4
3
|
import { isRasterImage, transformImageUrl } from "../../../core/lib/imageTransform.js";
|
|
5
4
|
import { UploadDropZone } from "../../content/components/UploadDropZone.js";
|
|
5
|
+
import { getApiUrl, getContentWriteHeaders } from "../../../lib/api-client.js";
|
|
6
6
|
import { fileMutations } from "../../../lib/queries.js";
|
|
7
7
|
import { DebouncedFieldEditor } from "./DebouncedFieldEditor.js";
|
|
8
8
|
import { Metadata, MetadataRow, formatRelativeTime } from "./Metadata.js";
|
|
@@ -8,8 +8,8 @@ import { useUpdateBlockPosition } from "./useUpdateBlockPosition.js";
|
|
|
8
8
|
import { usePreviewedPage } from "../CamoxPreview.js";
|
|
9
9
|
import { c } from "react/compiler-runtime";
|
|
10
10
|
import * as React from "react";
|
|
11
|
-
import { useSelector } from "@xstate/store-react";
|
|
12
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { useSelector } from "@xstate/store-react";
|
|
13
13
|
import { useMutation } from "@tanstack/react-query";
|
|
14
14
|
import { Copy, Trash2 } from "lucide-react";
|
|
15
15
|
import { toast } from "@camox/ui/toaster";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../../lib/auth.js";
|
|
2
1
|
import { useNavigate } from "../../navigation/navigation.js";
|
|
2
|
+
import { useProjectUuid } from "../../../lib/auth.js";
|
|
3
3
|
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
4
4
|
import { pageMutations } from "../../../lib/queries.js";
|
|
5
5
|
import { useLayoutDefinitions } from "../../../lib/studio-definitions.js";
|
|
@@ -9,8 +9,8 @@ import { PageLocationFieldset } from "./PageLocationFieldset.js";
|
|
|
9
9
|
import { PageNicknameField } from "./PageNicknameField.js";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
11
|
import { useEffect } from "react";
|
|
12
|
-
import { useSelector } from "@xstate/store-react";
|
|
13
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useSelector } from "@xstate/store-react";
|
|
14
14
|
import { useMutation } from "@tanstack/react-query";
|
|
15
15
|
import { Button } from "@camox/ui/button";
|
|
16
16
|
import { Label } from "@camox/ui/label";
|
|
@@ -2,8 +2,8 @@ import { previewStore, selectIsCanvasShown } from "../previewStore.js";
|
|
|
2
2
|
import { useFrame } from "./Frame.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useLayoutEffect } from "react";
|
|
5
|
-
import { useSelector } from "@xstate/store-react";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { useSelector } from "@xstate/store-react";
|
|
7
7
|
import overlayStyles from "virtual:camox-overlay-css";
|
|
8
8
|
|
|
9
9
|
//#region src/features/preview/components/FieldOverlayStyles.tsx
|
|
@@ -10,8 +10,8 @@ import { PageTree } from "./PageTree.js";
|
|
|
10
10
|
import { SelectionEditor } from "./SelectionEditor.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
12
|
import * as React from "react";
|
|
13
|
-
import { useSelector } from "@xstate/store-react";
|
|
14
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { useSelector } from "@xstate/store-react";
|
|
15
15
|
import { ArrowLeft, FileText, Info, Layers, Search, Settings } from "lucide-react";
|
|
16
16
|
|
|
17
17
|
//#region src/features/preview/components/MobilePreviewDrawer.tsx
|
|
@@ -5,8 +5,8 @@ import { isOverlayMessage, overlayFieldId, recordFieldId } from "../overlayMessa
|
|
|
5
5
|
import { usePreviewedPage } from "../CamoxPreview.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
7
|
import * as React from "react";
|
|
8
|
-
import { useSelector } from "@xstate/store-react";
|
|
9
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { useSelector } from "@xstate/store-react";
|
|
10
10
|
|
|
11
11
|
//#region src/features/preview/components/Overlays.tsx
|
|
12
12
|
function CuratedAddBlockListener(t0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../../lib/auth.js";
|
|
2
1
|
import { useOptionalDraftScope } from "../../../lib/draft-scope.js";
|
|
3
2
|
import { useViewLocale } from "../../../lib/view-locale-context.js";
|
|
4
3
|
import { useNavigate } from "../../navigation/navigation.js";
|
|
4
|
+
import { useProjectUuid } from "../../../lib/auth.js";
|
|
5
5
|
import { reads, useReadQuery, useStudioCache } from "../../../lib/studio-reads.js";
|
|
6
6
|
import { cn } from "../../../lib/utils.js";
|
|
7
7
|
import { UploadDropZone } from "../../content/components/UploadDropZone.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useProjectUuid } from "../../../lib/auth.js";
|
|
2
1
|
import { useNavigate } from "../../navigation/navigation.js";
|
|
2
|
+
import { useProjectUuid } from "../../../lib/auth.js";
|
|
3
3
|
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
4
4
|
import { cn } from "../../../lib/utils.js";
|
|
5
5
|
import { pageMutations } from "../../../lib/queries.js";
|
|
@@ -10,8 +10,8 @@ import { BlockActionsPopover } from "./BlockActionsPopover.js";
|
|
|
10
10
|
import { usePreviewedPage } from "../CamoxPreview.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
12
|
import * as React from "react";
|
|
13
|
-
import { useSelector } from "@xstate/store-react";
|
|
14
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { useSelector } from "@xstate/store-react";
|
|
15
15
|
import { Button } from "@camox/ui/button";
|
|
16
16
|
import { Label } from "@camox/ui/label";
|
|
17
17
|
import { ChevronsUpDown, Ellipsis, GripVertical, LayoutTemplate, Plus } from "lucide-react";
|
|
@@ -18,8 +18,8 @@ import { Overlays } from "./Overlays.js";
|
|
|
18
18
|
import { OverlayTracker } from "./OverlayTracker.js";
|
|
19
19
|
import { c } from "react/compiler-runtime";
|
|
20
20
|
import * as React from "react";
|
|
21
|
-
import { useSelector } from "@xstate/store-react";
|
|
22
21
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { useSelector } from "@xstate/store-react";
|
|
23
23
|
import { PanelContent } from "@camox/ui/panel";
|
|
24
24
|
import { flushSync } from "react-dom";
|
|
25
25
|
|
|
@@ -4,8 +4,8 @@ import { TOGGLE_CANVAS_SHORTCUT } from "../previewConstants.js";
|
|
|
4
4
|
import { prefetchCanvas } from "./CanvasPreview.js";
|
|
5
5
|
import { DeviceSelector } from "../../../components/DeviceSelector.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
|
-
import { useSelector } from "@xstate/store-react";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useSelector } from "@xstate/store-react";
|
|
9
9
|
import { Button } from "@camox/ui/button";
|
|
10
10
|
import { Label } from "@camox/ui/label";
|
|
11
11
|
import { Switch } from "@camox/ui/switch";
|
|
@@ -21,8 +21,8 @@ import { useFieldWriter } from "./useFieldWriter.js";
|
|
|
21
21
|
import { useRecordView } from "./useRecordView.js";
|
|
22
22
|
import { c } from "react/compiler-runtime";
|
|
23
23
|
import * as React from "react";
|
|
24
|
-
import { useSelector } from "@xstate/store-react";
|
|
25
24
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
import { useSelector } from "@xstate/store-react";
|
|
26
26
|
import { useMutation } from "@tanstack/react-query";
|
|
27
27
|
import { Button } from "@camox/ui/button";
|
|
28
28
|
import { Label } from "@camox/ui/label";
|
|
@@ -2,8 +2,8 @@ import { CanvasLoadingScreen } from "../../canvas/CanvasLoadingScreen.js";
|
|
|
2
2
|
import { previewStore, selectIsCanvasShown } from "../previewStore.js";
|
|
3
3
|
import { ContentSidebarSkeleton } from "../../canvas/sidebar/ContentSidebarSkeleton.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
|
-
import { useSelector } from "@xstate/store-react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useSelector } from "@xstate/store-react";
|
|
7
7
|
|
|
8
8
|
//#region src/features/preview/components/StudioEditingFallback.tsx
|
|
9
9
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AuthContext, useAuthActions } from "../../lib/auth.js";
|
|
2
1
|
import { useDraftScope } from "../../lib/draft-scope.js";
|
|
2
|
+
import { AuthContext, useAuthActions } from "../../lib/auth.js";
|
|
3
3
|
import { reads, useReadQuery, useStudioCache } from "../../lib/studio-reads.js";
|
|
4
4
|
import { RevisionsContext, createRevisions } from "../../lib/revisions.js";
|
|
5
5
|
import { useAdminShortcuts } from "./useAdminShortcuts.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSignInRedirect } from "../../lib/auth.js";
|
|
2
1
|
import { useLocation } from "../navigation/navigation.js";
|
|
2
|
+
import { useSignInRedirect } from "../../lib/auth.js";
|
|
3
3
|
import { useSignInShortcut } from "./signInShortcut.js";
|
|
4
4
|
import { STUDIO_BASE_PATH } from "../studio/routes.js";
|
|
5
5
|
import { AuthGate } from "../../components/AuthGate.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AuthContext, createCamoxAuthClient, useProcessOtt } from "../../lib/auth.js";
|
|
2
|
-
import { getDraftReadClient, initApiClient } from "../../lib/api-client.js";
|
|
3
1
|
import { DraftScopeContext, createDraftScope, followUrl } from "../../lib/draft-scope.js";
|
|
4
2
|
import { CamoxAppProvider } from "./components/CamoxAppContext.js";
|
|
3
|
+
import { AuthContext, createCamoxAuthClient, useProcessOtt } from "../../lib/auth.js";
|
|
5
4
|
import { StudioCacheContext, createStudioCache, reads } from "../../lib/studio-reads.js";
|
|
5
|
+
import { getDraftReadClient, initApiClient } from "../../lib/api-client.js";
|
|
6
6
|
import { PreviewSignInPage } from "./PreviewSignInPage.js";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -63,7 +63,7 @@ function CoreCamoxProvider({ apiUrl, authenticationUrl, camoxApp, children, proj
|
|
|
63
63
|
}, []);
|
|
64
64
|
if (error) return /* @__PURE__ */ jsx(PreviewSignInPage, { error });
|
|
65
65
|
if (isPreviewHandoff && !ready) return /* @__PURE__ */ jsx(PreviewSignInPage, {});
|
|
66
|
-
if (isPreviewHandoff && !initialAuthenticated) return /* @__PURE__ */ jsx(PreviewSignInPage, { error: "
|
|
66
|
+
if (isPreviewHandoff && !initialAuthenticated) return /* @__PURE__ */ jsx(PreviewSignInPage, { error: "This sign-in link didn't sign you in. Restart the dev server for a fresh link." });
|
|
67
67
|
return /* @__PURE__ */ jsx(DraftScopeContext.Provider, {
|
|
68
68
|
value: draftScope,
|
|
69
69
|
children: /* @__PURE__ */ jsx(StudioCacheContext.Provider, {
|
|
@@ -3,8 +3,8 @@ import { formatShortcut } from "../../../lib/shortcuts.js";
|
|
|
3
3
|
import { studioStore } from "../../studio/studioStore.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import * as React from "react";
|
|
6
|
-
import { useSelector } from "@xstate/store-react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useSelector } from "@xstate/store-react";
|
|
8
8
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandShortcut } from "@camox/ui/command";
|
|
9
9
|
|
|
10
10
|
//#region src/features/provider/components/CommandPalette.tsx
|
|
@@ -54,20 +54,16 @@ function createRendererHost({ studioCache, draftScope, queryClient, notify } = {
|
|
|
54
54
|
const shownScope = () => draftScope?.current() ?? LIVE_KEY_SCOPE;
|
|
55
55
|
const shown = (queryKey) => scopeOfKey(queryKey) === shownScope();
|
|
56
56
|
/** Whether a project room invalidation reaches the reads of the draft the renderer shows. */
|
|
57
|
-
const reaches =
|
|
58
|
-
if (message.draftId === null) return true;
|
|
59
|
-
if (!draftScope) return false;
|
|
60
|
-
return await draftScope.keyScopeOfDraft(message.draftId, projectId) === shownScope();
|
|
61
|
-
};
|
|
57
|
+
const reaches = (message) => message.draftId === null || !!draftScope && message.draftId === shownScope();
|
|
62
58
|
const relayChange = (change) => {
|
|
63
59
|
switch (change.type) {
|
|
64
60
|
case "received": {
|
|
65
61
|
const { message, projectId } = change;
|
|
66
|
-
reaches(message
|
|
62
|
+
if (reaches(message)) post({
|
|
67
63
|
type: "invalidate",
|
|
68
64
|
message,
|
|
69
65
|
projectId
|
|
70
|
-
})
|
|
66
|
+
});
|
|
71
67
|
return;
|
|
72
68
|
}
|
|
73
69
|
case "wrote":
|
|
@@ -22,14 +22,11 @@ export type PageStructure = {
|
|
|
22
22
|
recordStructuredData?: PageWithBlocks["recordStructuredData"];
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
* Why a member can't see the draft a URL names: it doesn't exist, it'
|
|
26
|
-
*
|
|
27
|
-
* own development draft doesn't exist until the dev server's first sync creates it.
|
|
25
|
+
* Why a member can't see the draft a URL names: it doesn't exist, it isn't open to them, or it
|
|
26
|
+
* was published or deleted (ADR 0011).
|
|
28
27
|
*/
|
|
29
28
|
export type DraftNotice = {
|
|
30
29
|
reason: "missing";
|
|
31
|
-
} | {
|
|
32
|
-
reason: "noDevelopmentDraft";
|
|
33
30
|
} | {
|
|
34
31
|
reason: "forbidden";
|
|
35
32
|
} | ({
|
|
@@ -6,7 +6,7 @@ import { PAGE_IMAGE_SIZE, pageImageUrl } from "../og/pageImage.js";
|
|
|
6
6
|
import { curatedLayoutContext } from "../../core/layoutContext.js";
|
|
7
7
|
import { isArticle } from "../../core/structuredData.js";
|
|
8
8
|
import { publishingDraft } from "../runtime/publishingDraft.js";
|
|
9
|
-
import { DRAFT_ENDED_ERROR_CODE, DRAFT_HEADER,
|
|
9
|
+
import { DRAFT_ENDED_ERROR_CODE, DRAFT_HEADER, PUBLISHING_DRAFT_HEADER } from "@camox/api-contract/drafts";
|
|
10
10
|
import { createORPCClient } from "@orpc/client";
|
|
11
11
|
import { RPCLink } from "@orpc/client/fetch";
|
|
12
12
|
|
|
@@ -83,7 +83,6 @@ function draftRefusalNotice(error, draftId) {
|
|
|
83
83
|
reason: "ended",
|
|
84
84
|
...data
|
|
85
85
|
};
|
|
86
|
-
if (code === NO_DEVELOPMENT_DRAFT_ERROR) return { reason: "noDevelopmentDraft" };
|
|
87
86
|
if (isNotFoundError(error) && data?.draftId === draftId) return { reason: "missing" };
|
|
88
87
|
if (code === "FORBIDDEN" || status === 403) return { reason: "forbidden" };
|
|
89
88
|
if (code === "UNAUTHORIZED" || status === 401) return null;
|
|
@@ -7,8 +7,8 @@ import { PreviewToolbar } from "../preview/components/PreviewToolbar.js";
|
|
|
7
7
|
import { AgentSidebar } from "../studio/components/AgentSidebar.js";
|
|
8
8
|
import { FollowAgentProvider } from "../studio/FollowAgentProvider.js";
|
|
9
9
|
import { c } from "react/compiler-runtime";
|
|
10
|
-
import { useSelector } from "@xstate/store-react";
|
|
11
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { useSelector } from "@xstate/store-react";
|
|
12
12
|
import studioCssUrl from "virtual:camox-studio-css";
|
|
13
13
|
|
|
14
14
|
//#region src/features/runtime/RuntimeChrome.tsx
|
|
@@ -9,8 +9,7 @@ function runtimePath(pathname, basePath) {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Requests one of the runtime's JSON endpoints (`/_camox/data`, `/_camox/routes`) as the editor,
|
|
12
|
-
* reading `draft` (null for Live) in `locale` (the default locale without it).
|
|
13
|
-
* always reads the development draft. A path the endpoint takes names its own locale by its
|
|
12
|
+
* reading `draft` (null for Live) in `locale` (the default locale without it). A path the endpoint takes names its own locale by its
|
|
14
13
|
* prefix; route discovery, which takes none, reads the locale the request names.
|
|
15
14
|
*/
|
|
16
15
|
function fetchRuntimeJson(draftScope, endpoint, runtimeBasePath, params, draft, signal, locale) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAuthState, useSignInRedirect } from "../../lib/auth.js";
|
|
2
1
|
import { DraftScopeContext } from "../../lib/draft-scope.js";
|
|
2
|
+
import { useAuthState, useSignInRedirect } from "../../lib/auth.js";
|
|
3
3
|
import { useSignInShortcut } from "../provider/signInShortcut.js";
|
|
4
4
|
import { PreviewDocumentContext } from "./PreviewDocumentContext.js";
|
|
5
5
|
import { PreviewActivation } from "../preview/components/PreviewActivation.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getDraftReadClient } from "../../lib/api-client.js";
|
|
2
1
|
import { DraftScopeContext, createDraftScope, followUrl } from "../../lib/draft-scope.js";
|
|
3
2
|
import { StudioCacheContext, createStudioCache } from "../../lib/studio-reads.js";
|
|
3
|
+
import { getDraftReadClient } from "../../lib/api-client.js";
|
|
4
4
|
import { STUDIO_HANDLE_KEY } from "../renderer/protocol.js";
|
|
5
5
|
import { CoreCamoxProvider } from "../provider/CoreCamoxProvider.js";
|
|
6
6
|
import { readHydrationData } from "./hydrationData.js";
|
|
@@ -82,11 +82,6 @@ export interface RuntimeOptions {
|
|
|
82
82
|
/** The built chunks each block module needs, by module path. `null` in dev. */
|
|
83
83
|
chunks: Record<string, string[]> | null;
|
|
84
84
|
};
|
|
85
|
-
/**
|
|
86
|
-
* Dev mode: every render reads the caller's development draft and ignores the URL's draft
|
|
87
|
-
* (ADR 0006).
|
|
88
|
-
*/
|
|
89
|
-
developmentDraft?: boolean;
|
|
90
85
|
pageClientEntryUrl?: string;
|
|
91
86
|
studioClientEntryUrl?: string;
|
|
92
87
|
/** The renderer frame's client entry, which renders the studio's pages (ADR 0023). */
|