camox 0.75.0 → 0.76.1
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/editing/createEditableBlock.js +1077 -1681
- package/dist/core/editing/fieldSlot.js +251 -0
- package/dist/core/editing/useFieldSlot.js +159 -0
- package/dist/core/layoutContext.d.ts +2 -0
- package/dist/core/layoutContext.js +27 -1
- package/dist/features/canvas/CanvasPageFrame.js +2 -2
- package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -1
- package/dist/features/canvas/canvasCameraController.js +595 -0
- package/dist/features/canvas/useCanvasCamera.js +141 -587
- package/dist/features/canvas/useCanvasFrame.js +1 -1
- package/dist/features/page/DerivedPageContent.js +4 -8
- package/dist/features/preview/components/AssetLightbox.js +6 -65
- package/dist/features/preview/components/CanvasPreview.js +2 -2
- package/dist/features/preview/components/Frame.js +3 -3
- package/dist/features/preview/components/ItemFieldsEditor.js +376 -460
- package/dist/features/preview/components/Overlays.js +4 -9
- package/dist/features/preview/components/PreviewPanel.js +3 -3
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +2 -2
- package/dist/features/preview/components/SelectionEditor.js +285 -339
- package/dist/features/preview/components/ZoomableImage.js +105 -0
- package/dist/features/preview/components/contentFieldSchema.js +3 -1
- package/dist/features/preview/components/useFieldWriter.js +30 -51
- package/dist/features/preview/components/useRecordView.js +3 -3
- package/dist/features/preview/overlayMessages.js +20 -58
- package/dist/features/preview/previewStore.js +6 -123
- package/dist/features/preview/repeatableItemPath.js +47 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +75 -63
- package/dist/features/renderer/RendererApp.js +6 -6
- package/dist/features/renderer/RendererFrames.js +2 -2
- package/dist/features/renderer/rendererHost.js +1 -1
- package/dist/features/routes/pageRuntime.d.ts +8 -12
- package/dist/features/routes/pageRuntime.js +26 -106
- package/dist/features/runtime/pageApp.js +1 -1
- package/dist/features/runtime/pageRead.js +105 -0
- package/dist/features/runtime/reader.d.ts +25 -0
- package/dist/features/runtime/reader.js +142 -0
- package/dist/features/runtime/runtime.d.ts +9 -3
- package/dist/features/runtime/runtime.js +608 -776
- package/dist/features/sdkBundle/buildSdkBundle.d.ts +5 -0
- package/dist/features/sdkBundle/buildSdkBundle.js +9 -3
- package/dist/features/studio/components/ChatWidget.js +137 -121
- package/dist/features/studio/components/ClearThread.js +121 -0
- package/dist/features/studio/components/DeleteDraftDialog.js +67 -65
- package/dist/features/studio/components/DraftBar.js +60 -49
- package/dist/features/studio/components/DraftNotices.js +149 -0
- package/dist/features/studio/components/DraftsControl.js +217 -180
- package/dist/features/studio/components/DraftsSheet.js +446 -0
- package/dist/features/studio/components/PublishedTab.js +511 -0
- package/dist/features/studio/components/ReviewDraftDialog.js +104 -89
- package/dist/features/studio/components/SheetTable.js +46 -0
- package/dist/features/studio/components/Specialists.js +1 -1
- package/dist/features/studio/components/ThreadMessages.js +227 -176
- package/dist/features/studio/draftLabel.js +15 -1
- package/dist/features/studio/draftNotice.js +1 -0
- package/dist/features/studio/showInCanvas.js +9 -19
- package/dist/features/studio/studioStore.js +5 -5
- package/dist/features/studio/useArchiveDraft.js +60 -0
- package/dist/features/studio/useEditorSelection.js +8 -19
- package/dist/features/studio/useRestoreDraft.js +70 -0
- package/dist/features/studio/viewSwitch.js +19 -11
- package/dist/lib/draft-scope.d.ts +1 -1
- package/dist/lib/draft-scope.js +6 -3
- package/dist/lib/queries.js +12 -1
- package/dist/lib/studio-reads.js +22 -0
- package/dist/lib/use-project-room.js +19 -13
- package/dist/lib/use-thread.js +1 -1
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/core/hooks/useFieldSelection.js +0 -67
- package/dist/core/hooks/useIsEditable.js +0 -21
- package/dist/core/hooks/useOverlayMessage.js +0 -70
|
@@ -1,20 +1,15 @@
|
|
|
1
|
+
import { slotId, slotOf } from "../../../core/editing/fieldSlot.js";
|
|
1
2
|
import { previewStore, selectionForOwner } from "../previewStore.js";
|
|
2
3
|
import { useEditingFrame } from "../editingFrame.js";
|
|
3
|
-
import { overlayFieldId, recordFieldId } from "../overlayMessages.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { useSelector } from "@xstate/store-react";
|
|
7
7
|
|
|
8
8
|
//#region src/features/preview/components/Overlays.tsx
|
|
9
|
-
/** The
|
|
9
|
+
/** The overlay id of a selected String field; only those are focused in the page. */
|
|
10
10
|
function stringFieldId(selection) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
case "block-field": return selection.fieldType === "String" ? overlayFieldId(selection.blockId, selection.fieldName) : null;
|
|
14
|
-
case "item-field": return selection.fieldType === "String" ? overlayFieldId(selection.blockId, selection.fieldName, { itemId: selection.itemId }) : null;
|
|
15
|
-
case "record-field": return selection.recordFieldType === "String" ? recordFieldId(selection, selection.recordFieldName) : null;
|
|
16
|
-
default: return null;
|
|
17
|
-
}
|
|
11
|
+
const slot = slotOf(selection);
|
|
12
|
+
return slot?.type === "String" ? slotId(slot) : null;
|
|
18
13
|
}
|
|
19
14
|
const Overlays = (t0) => {
|
|
20
15
|
const $ = c(7);
|
|
@@ -3,16 +3,16 @@ import { ArtifactStudioContext } from "../../../core/hooks/useArtifactHost.js";
|
|
|
3
3
|
import { cn } from "../../../lib/utils.js";
|
|
4
4
|
import { previewStore } from "../previewStore.js";
|
|
5
5
|
import { useEditingFrameClaim, useEditingOwner } from "../editingFrame.js";
|
|
6
|
-
import {
|
|
7
|
-
import { CanvasWorkspaceContext } from "../../canvas/canvasZoom.js";
|
|
6
|
+
import { Frame, useFrame } from "./Frame.js";
|
|
8
7
|
import { PreviewEditingOwnerContext } from "../previewSelection.js";
|
|
8
|
+
import { EditableSurfaceContext } from "../../../core/editing/useFieldSlot.js";
|
|
9
|
+
import { CanvasWorkspaceContext } from "../../canvas/canvasZoom.js";
|
|
9
10
|
import { previewPageIframeProps, usePreviewPageFrame } from "../previewPageFrame.js";
|
|
10
11
|
import { adoptCanvasDocument, pauseCanvasDocument } from "../../canvas/canvasFrameDocument.js";
|
|
11
12
|
import { forwardCanvasWheel, useCanvasFrameInput } from "../../canvas/useCanvasFrameInput.js";
|
|
12
13
|
import { useActionShortcuts } from "../../provider/useAdminShortcuts.js";
|
|
13
14
|
import { guardStrayCaret } from "../strayCaretGuard.js";
|
|
14
15
|
import { useBlockActionsShortcuts } from "./BlockActionsPopover.js";
|
|
15
|
-
import { Frame, useFrame } from "./Frame.js";
|
|
16
16
|
import { FieldOverlayStyles } from "./FieldOverlayStyles.js";
|
|
17
17
|
import { MobilePreviewDrawer } from "./MobilePreviewDrawer.js";
|
|
18
18
|
import { Overlays } from "./Overlays.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useIsEditable } from "../../../core/hooks/useIsEditable.js";
|
|
2
|
-
import { useStudioNotice } from "../studioNotice.js";
|
|
3
1
|
import { useApplyContentEdit } from "../../../core/editing/contentEdits.js";
|
|
2
|
+
import { useIsEditable } from "../../../core/editing/useFieldSlot.js";
|
|
3
|
+
import { useStudioNotice } from "../studioNotice.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Button } from "@camox/ui/button";
|