camox 0.48.0 → 0.52.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/createApp.d.ts +1 -0
- package/dist/core/createApp.js +1 -0
- package/dist/core/editing/contentEdits.js +78 -0
- package/dist/core/editing/createEditableBlock.js +277 -311
- package/dist/core/layoutContext.d.ts +1 -0
- package/dist/core/lib/contentType.js +2 -2
- package/dist/core/recordItem.js +3 -3
- package/dist/features/canvas/CamoxCanvas.js +15 -15
- package/dist/features/canvas/CanvasLoadingScreen.js +15 -11
- package/dist/features/canvas/CanvasPageFrame.js +81 -87
- package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -1
- package/dist/features/canvas/DerivedPagePathInput.js +12 -12
- package/dist/features/canvas/canvasOverlayGeometry.js +1 -1
- package/dist/features/canvas/canvasStore.js +2 -2
- package/dist/features/canvas/sidebar/CanvasInspector.js +1 -1
- package/dist/features/canvas/sidebar/CuratedPageInspector.js +1 -1
- package/dist/features/canvas/sidebar/LayoutPageBlocks.js +23 -31
- package/dist/features/canvas/useCanvasCamera.js +1 -1
- package/dist/features/canvas/useDiscoveredPreviewPaths.js +16 -9
- package/dist/features/content/ContentAssets.js +84 -88
- package/dist/features/page/CuratedPageContent.js +1 -1
- package/dist/features/preview/CamoxPreview.d.ts +8 -4
- package/dist/features/preview/CamoxPreview.js +258 -443
- package/dist/features/preview/EditablePageContent.js +244 -2
- package/dist/features/preview/EditablePageExperience.js +19 -13
- package/dist/features/preview/components/AddBlockSheet.js +55 -15
- package/dist/features/preview/components/BlockActionsPopover.js +23 -51
- package/dist/features/preview/components/BlockPeek.js +66 -0
- package/dist/features/preview/components/BlockThumbnail.js +134 -119
- package/dist/features/preview/components/CanvasPreview.js +1 -1
- package/dist/features/preview/components/CreatePageModal.js +150 -156
- package/dist/features/preview/components/FieldToolbar.js +1 -1
- package/dist/features/preview/components/Frame.js +27 -4
- package/dist/features/preview/components/MobilePreviewDrawer.js +6 -9
- package/dist/features/preview/components/PageInfo.js +161 -126
- package/dist/features/preview/components/PagePicker.js +2 -2
- package/dist/features/preview/components/PageTree.js +174 -190
- package/dist/features/preview/components/PreviewPanel.js +13 -67
- package/dist/features/preview/components/PreviewToolbar.js +1 -1
- package/dist/features/preview/components/ReferenceFieldEditor.js +4 -4
- package/dist/features/preview/components/ReferenceListFieldEditor.js +4 -4
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +37 -70
- package/dist/features/preview/components/RepeatableItemsList.js +1 -1
- package/dist/features/preview/components/SelectionEditor.js +248 -256
- package/dist/features/preview/components/StudioEditingFallback.js +22 -26
- package/dist/features/preview/components/useFieldWriter.js +19 -19
- package/dist/features/preview/components/useRecordView.js +105 -147
- package/dist/features/preview/components/useRepeatableItemActions.js +0 -2
- package/dist/features/preview/pageRecord.js +30 -24
- package/dist/features/preview/previewConstants.js +2 -8
- package/dist/features/preview/previewStore.js +2 -0
- package/dist/features/preview/studioNotice.js +20 -0
- package/dist/features/preview/usePreviewViewportActions.js +1 -1
- package/dist/features/provider/AuthenticatedCamoxProvider.js +47 -31
- package/dist/features/provider/components/CommandPalette.js +2 -5
- package/dist/features/provider/signInShortcut.js +1 -2
- package/dist/features/provider/useAdminShortcuts.js +47 -53
- package/dist/features/renderer/RendererApp.js +542 -0
- package/dist/features/renderer/RendererFrames.js +450 -0
- package/dist/features/renderer/definitionAnswers.js +26 -0
- package/dist/features/renderer/protocol.js +35 -0
- package/dist/features/renderer/rendererHost.js +249 -0
- package/dist/features/renderer/studioConnection.js +186 -0
- package/dist/features/routes/pageRuntime.d.ts +2 -1
- package/dist/features/routes/pageRuntime.js +34 -22
- package/dist/features/runtime/RuntimeChrome.js +2 -5
- package/dist/features/runtime/assetPrefix.js +14 -0
- package/dist/features/runtime/breadcrumbs.js +1 -1
- package/dist/features/runtime/editingFallback.js +4 -8
- package/dist/features/runtime/livePages.js +1 -1
- package/dist/features/runtime/pageApp.js +57 -83
- package/dist/features/runtime/pageClient.js +1 -1
- package/dist/features/runtime/pageNavigation.js +3 -2
- package/dist/features/runtime/publicCache.js +95 -0
- package/dist/features/runtime/publishingDraft.js +23 -0
- package/dist/features/runtime/rendererClient.d.ts +8 -0
- package/dist/features/runtime/rendererClient.js +77 -0
- package/dist/features/runtime/runtime.d.ts +22 -3
- package/dist/features/runtime/runtime.js +209 -96
- package/dist/features/runtime/runtimeRoutes.d.ts +2 -0
- package/dist/features/runtime/runtimeRoutes.js +2 -0
- package/dist/features/runtime/worker.d.ts +14 -1
- package/dist/features/runtime/worker.js +34 -4
- package/dist/features/settings/AnalyticsSettings.js +622 -0
- package/dist/features/settings/CamoxSettings.js +95 -0
- package/dist/features/settings/FaviconSettings.js +254 -0
- package/dist/features/settings/ProjectNameSettings.js +145 -0
- package/dist/features/settings/SettingsPart.js +73 -0
- package/dist/features/settings/SocialProfilesSettings.js +245 -0
- package/dist/features/settings/useProjectMutation.js +61 -0
- package/dist/features/studio/FollowAgentProvider.js +10 -10
- package/dist/features/studio/components/DraftsControl.js +136 -131
- package/dist/features/studio/components/LocalePicker.js +178 -174
- package/dist/features/studio/components/Navbar.js +107 -66
- package/dist/features/studio/components/ProjectMenu.js +119 -171
- package/dist/features/studio/components/ReviewDraftSheet.js +1151 -991
- package/dist/features/studio/components/ThreadMessages.js +100 -65
- package/dist/features/studio/components/UserButton.js +2 -2
- package/dist/features/studio/routes.js +3 -1
- package/dist/features/studio/showInCanvas.js +129 -0
- package/dist/features/vite/definitionsSync.js +5 -6
- package/dist/features/vite/hostedChecks.js +127 -0
- package/dist/features/vite/runtimeDev.js +58 -17
- package/dist/features/vite/staticAssetHeaders.js +52 -0
- package/dist/features/vite/vite.d.ts +1 -1
- package/dist/features/vite/vite.js +49 -9
- package/dist/hooks/use-page-destinations.js +10 -10
- package/dist/lib/api-client-server.d.ts +1 -1
- package/dist/lib/api-client.d.ts +2 -1
- package/dist/lib/draft-scope.d.ts +1 -0
- package/dist/lib/locale-path.d.ts +3 -11
- package/dist/lib/locale-path.js +3 -27
- package/dist/lib/queries.js +7 -1
- package/dist/lib/revisions.js +20 -0
- package/dist/lib/shortcuts.js +29 -0
- package/dist/lib/studio-definitions.js +160 -0
- package/dist/lib/studio-reads.d.ts +1 -0
- package/dist/lib/studio-reads.js +65 -21
- package/dist/lib/use-project-room.js +16 -10
- package/dist/lib/utils.js +1 -104
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +9 -4
- package/skills/camox/SKILL.md +4 -0
- package/skills/camox/references/artifacts.md +1 -1
- package/dist/features/studio/components/FaviconDialog.js +0 -318
- package/dist/features/studio/components/SocialProfilesDialog.js +0 -342
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { blockMutations } from "../../../lib/queries.js";
|
|
2
1
|
import { useIsEditable } from "../../../core/hooks/useIsEditable.js";
|
|
3
|
-
import {
|
|
2
|
+
import { useStudioNotice } from "../studioNotice.js";
|
|
3
|
+
import { useApplyContentEdit } from "../../../core/editing/contentEdits.js";
|
|
4
|
+
import * as React from "react";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
6
|
import { Button } from "@camox/ui/button";
|
|
7
7
|
import { Trash2 } from "lucide-react";
|
|
8
|
-
import { toast } from "@camox/ui/toaster";
|
|
9
8
|
|
|
10
9
|
//#region src/features/preview/components/RemovedBlockPlaceholder.tsx
|
|
11
10
|
/**
|
|
@@ -13,82 +12,50 @@ import { toast } from "@camox/ui/toaster";
|
|
|
13
12
|
* mode it shows this placeholder, whose only action is delete. Its content stays stored and
|
|
14
13
|
* comes back if the definition does.
|
|
15
14
|
*/
|
|
16
|
-
function RemovedBlockPlaceholder(
|
|
17
|
-
const $ = c(16);
|
|
18
|
-
const { blockId, type, mode } = t0;
|
|
15
|
+
function RemovedBlockPlaceholder({ blockId, type, mode }) {
|
|
19
16
|
const isEditable = useIsEditable(mode);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
$[0] = t1;
|
|
24
|
-
} else t1 = $[0];
|
|
25
|
-
const deleteBlock = useMutation(t1);
|
|
17
|
+
const applyEdit = useApplyContentEdit();
|
|
18
|
+
const notify = useStudioNotice();
|
|
19
|
+
const [deleting, setDeleting] = React.useState(false);
|
|
26
20
|
if (!isEditable) return null;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
21
|
+
const handleDelete = async () => {
|
|
22
|
+
setDeleting(true);
|
|
23
|
+
try {
|
|
24
|
+
await applyEdit({
|
|
25
|
+
type: "deleteBlock",
|
|
26
|
+
blockId
|
|
27
|
+
});
|
|
28
|
+
notify({
|
|
29
|
+
tone: "success",
|
|
30
|
+
message: `Deleted "${type}" block`
|
|
31
|
+
});
|
|
32
|
+
} catch (error) {
|
|
33
|
+
console.error("Failed to delete block:", error);
|
|
34
|
+
notify({
|
|
35
|
+
tone: "error",
|
|
36
|
+
message: "Could not delete block"
|
|
37
|
+
});
|
|
38
|
+
} finally {
|
|
39
|
+
setDeleting(false);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
className: "border-border text-muted-foreground mx-4 my-2 flex items-center justify-between gap-4 rounded-md border border-dashed p-4 text-sm",
|
|
44
|
+
children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
47
45
|
"The ",
|
|
48
46
|
/* @__PURE__ */ jsx("span", {
|
|
49
47
|
className: "text-foreground font-mono",
|
|
50
48
|
children: type
|
|
51
49
|
}),
|
|
52
50
|
" block definition was removed from code, so this block renders nothing."
|
|
53
|
-
] })
|
|
54
|
-
$[5] = type;
|
|
55
|
-
$[6] = t3;
|
|
56
|
-
} else t3 = $[6];
|
|
57
|
-
let t4;
|
|
58
|
-
if ($[7] !== handleDelete) {
|
|
59
|
-
t4 = () => void handleDelete();
|
|
60
|
-
$[7] = handleDelete;
|
|
61
|
-
$[8] = t4;
|
|
62
|
-
} else t4 = $[8];
|
|
63
|
-
let t5;
|
|
64
|
-
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
65
|
-
t5 = /* @__PURE__ */ jsx(Trash2, {});
|
|
66
|
-
$[9] = t5;
|
|
67
|
-
} else t5 = $[9];
|
|
68
|
-
let t6;
|
|
69
|
-
if ($[10] !== deleteBlock.isPending || $[11] !== t4) {
|
|
70
|
-
t6 = /* @__PURE__ */ jsxs(Button, {
|
|
51
|
+
] }), /* @__PURE__ */ jsxs(Button, {
|
|
71
52
|
variant: "outline",
|
|
72
53
|
size: "sm",
|
|
73
|
-
disabled:
|
|
74
|
-
onClick:
|
|
75
|
-
children: [
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
$[11] = t4;
|
|
79
|
-
$[12] = t6;
|
|
80
|
-
} else t6 = $[12];
|
|
81
|
-
let t7;
|
|
82
|
-
if ($[13] !== t3 || $[14] !== t6) {
|
|
83
|
-
t7 = /* @__PURE__ */ jsxs("div", {
|
|
84
|
-
className: "border-border text-muted-foreground mx-4 my-2 flex items-center justify-between gap-4 rounded-md border border-dashed p-4 text-sm",
|
|
85
|
-
children: [t3, t6]
|
|
86
|
-
});
|
|
87
|
-
$[13] = t3;
|
|
88
|
-
$[14] = t6;
|
|
89
|
-
$[15] = t7;
|
|
90
|
-
} else t7 = $[15];
|
|
91
|
-
return t7;
|
|
54
|
+
disabled: deleting,
|
|
55
|
+
onClick: () => void handleDelete(),
|
|
56
|
+
children: [/* @__PURE__ */ jsx(Trash2, {}), "Delete"]
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
92
59
|
}
|
|
93
60
|
|
|
94
61
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { repeatableItemMutations } from "../../../lib/queries.js";
|
|
3
3
|
import { previewStore, selectionItemId } from "../previewStore.js";
|
|
4
|
-
import { useEditingFrame } from "../editingFrame.js";
|
|
5
4
|
import { PreviewEditingOwnerContext, usePreviewTargetSelection } from "../previewSelection.js";
|
|
5
|
+
import { useEditingFrame } from "../editingFrame.js";
|
|
6
6
|
import { entityName } from "../entityName.js";
|
|
7
7
|
import { useRepeatableItemActions } from "./useRepeatableItemActions.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|