camox 0.24.0 → 0.25.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/hooks/useRequireDraftSource.js +27 -0
- package/dist/features/preview/CamoxPreview.d.ts +4 -0
- package/dist/features/preview/CamoxPreview.js +454 -181
- package/dist/features/preview/components/AddBlockSheet.js +79 -75
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +39 -22
- package/dist/features/preview/components/DraftSwitchDialog.js +66 -0
- package/dist/features/preview/components/EditPageModal.js +9 -9
- package/dist/features/preview/components/LinkFieldEditor.js +1 -1
- package/dist/features/preview/components/Overlays.js +6 -2
- package/dist/features/preview/components/PageContentSheet.js +222 -190
- package/dist/features/preview/components/PagePicker.js +81 -3
- package/dist/features/preview/components/PageTree.js +418 -327
- package/dist/features/preview/components/PreviewToolbar.js +172 -158
- package/dist/features/preview/components/PublishDialog.js +111 -0
- package/dist/features/preview/components/useRepeatableItemActions.js +26 -20
- package/dist/features/preview/components/useUpdateBlockPosition.js +10 -9
- package/dist/features/preview/previewStore.js +38 -1
- package/dist/features/provider/useAdminShortcuts.js +7 -2
- package/dist/features/routes/pageRoute.d.ts +6 -2
- package/dist/features/routes/pageRoute.js +10 -6
- package/dist/features/vite/vite.js +6 -5
- package/dist/lib/normalized-data.js +87 -88
- package/dist/lib/queries.js +12 -6
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/skills/camox-cli/SKILL.md +23 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { previewStore } from "../../features/preview/previewStore.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/core/hooks/useRequireDraftSource.ts
|
|
5
|
+
/**
|
|
6
|
+
* Gate any edit attempt on the current preview source. If the studio is
|
|
7
|
+
* previewing 'draft', `requireDraft()` returns true and the caller proceeds.
|
|
8
|
+
* Otherwise it opens the "Switch to draft to edit?" dialog and returns false
|
|
9
|
+
* so the caller aborts. The dialog's CTA only switches the source — it does
|
|
10
|
+
* not retry the original attempt; the user re-issues the edit themselves.
|
|
11
|
+
*/
|
|
12
|
+
function useRequireDraftSource() {
|
|
13
|
+
const $ = c(1);
|
|
14
|
+
if ($[0] !== "0362e577777f438ffefe38cac1aa50ad433841f5f7cbde91e17cf0313273dbef") {
|
|
15
|
+
for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
16
|
+
$[0] = "0362e577777f438ffefe38cac1aa50ad433841f5f7cbde91e17cf0313273dbef";
|
|
17
|
+
}
|
|
18
|
+
return _temp;
|
|
19
|
+
}
|
|
20
|
+
function _temp() {
|
|
21
|
+
if (previewStore.getSnapshot().context.previewSource === "draft") return true;
|
|
22
|
+
previewStore.send({ type: "requestDraftSwitch" });
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { useRequireDraftSource };
|
|
@@ -4,6 +4,8 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
4
4
|
//#region src/features/preview/CamoxPreview.d.ts
|
|
5
5
|
declare function usePreviewedPage(): {
|
|
6
6
|
page: {
|
|
7
|
+
status: undefined;
|
|
8
|
+
modifiedReason: undefined | null;
|
|
7
9
|
blockIds: number[];
|
|
8
10
|
id: number;
|
|
9
11
|
projectId: number;
|
|
@@ -17,6 +19,8 @@ declare function usePreviewedPage(): {
|
|
|
17
19
|
aiSeoEnabled: boolean | null;
|
|
18
20
|
customOgImageBlobId: string | null;
|
|
19
21
|
customOgImageUrl: string | null;
|
|
22
|
+
livePublishedCheckpointId: number | null;
|
|
23
|
+
contentUpdatedAt: number;
|
|
20
24
|
createdAt: number;
|
|
21
25
|
updatedAt: number;
|
|
22
26
|
};
|