camox 0.42.0 → 0.43.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/components/lexical/{GradientNode.js → HighlightNode.js} +34 -34
- package/dist/core/components/lexical/InlineLexicalEditor.js +14 -14
- package/dist/core/components/lexical/InlineStylesPlugin.js +6 -6
- package/dist/core/components/lexical/SelectionBroadcaster.js +5 -5
- package/dist/core/components/lexical/SidebarLexicalEditor.js +20 -20
- package/dist/core/components/lexical/TextLinkPopover.js +191 -208
- package/dist/core/components/lexical/editorConfig.js +2 -2
- package/dist/core/createApp.d.ts +3 -2
- package/dist/core/createApp.js +2 -1
- package/dist/core/createLayout.d.ts +16 -3
- package/dist/core/createLayout.js +15 -15
- package/dist/core/derivedRoutes.js +1 -1
- package/dist/core/dom.d.ts +17 -0
- package/dist/core/dom.js +22 -0
- package/dist/core/lib/lexicalReact.js +4 -4
- package/dist/core/lib/lexicalState.js +3 -3
- package/dist/core/lib/modifierFormats.js +1 -1
- package/dist/core/lib/textLinks.js +5 -2
- package/dist/core/lib/textStyles.d.ts +2 -2
- package/dist/core/lib/textStyles.js +6 -11
- package/dist/core/pageDestinations.js +37 -0
- package/dist/features/og/imageResponse.node.js +11 -9
- package/dist/features/preview/CamoxPreview.js +42 -65
- package/dist/features/preview/components/AddBlockSidebar.js +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +1 -1
- package/dist/features/preview/components/CreatePageModal.js +4 -4
- package/dist/features/preview/components/DerivedLayoutSidebar.js +45 -26
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +38 -26
- package/dist/features/preview/components/FieldToolbar.js +7 -7
- package/dist/features/preview/components/LinkFieldEditor.js +212 -209
- package/dist/features/preview/components/PageEditorSidebar.js +1 -1
- package/dist/features/preview/components/PageInfoSidebar.js +28 -28
- package/dist/features/preview/components/PagePicker.js +16 -16
- package/dist/features/preview/components/PageTree.js +1 -1
- package/dist/features/preview/components/PublicationRow.js +8 -4
- package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
- package/dist/features/preview/publication.js +10 -0
- package/dist/features/provider/CoreCamoxProvider.js +1 -1
- package/dist/features/runtime/runtime.js +20 -21
- package/dist/features/studio/components/EnvironmentMenu.js +3 -2
- package/dist/features/studio/components/Navbar.js +53 -80
- package/dist/features/vite/layoutGeneration.js +7 -3
- package/dist/features/vite/vite.js +5 -1
- package/dist/hooks/use-page-destinations.js +53 -0
- package/dist/lib/auth.js +11 -14
- package/dist/lib/server-auth-cookie.js +21 -0
- package/dist/studio.css +1 -1
- package/package.json +8 -4
- package/skills/camox/SKILL.md +32 -9
- package/skills/camox/references/block-definitions.md +84 -290
- package/skills/camox/references/cli-common.md +2 -4
- package/skills/camox/references/cli-content.md +147 -0
- package/skills/camox/references/cli-environments.md +1 -1
- package/skills/camox/references/dom-integrations.md +93 -0
- package/skills/camox/references/field-styling.md +50 -0
- package/skills/camox/references/layout-definitions.md +33 -147
- package/skills/camox/references/routed-layouts.md +71 -0
- package/skills/camoxify/SKILL.md +52 -0
- package/skills/camox/references/cli-blocks.md +0 -78
- package/skills/camox/references/cli-pages.md +0 -53
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useProjectSlug } from "../../../lib/auth.js";
|
|
2
2
|
import { usePageBlocks } from "../../../lib/normalized-data.js";
|
|
3
|
-
import { layoutQueries, projectQueries } from "../../../lib/queries.js";
|
|
4
3
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
4
|
+
import { layoutQueries, projectQueries } from "../../../lib/queries.js";
|
|
5
5
|
import { previewStore, selectPreviewSource } from "../previewStore.js";
|
|
6
6
|
import { PagePicker } from "./PagePicker.js";
|
|
7
7
|
import { LayoutBlockItem } from "./PageTree.js";
|
|
@@ -16,10 +16,10 @@ import { PanelContent, PanelHeader } from "@camox/ui/panel";
|
|
|
16
16
|
//#region src/features/preview/components/DerivedLayoutSidebar.tsx
|
|
17
17
|
const EMPTY_PAGE = { blockIds: [] };
|
|
18
18
|
function DerivedLayoutSidebar(t0) {
|
|
19
|
-
const $ = c(
|
|
20
|
-
if ($[0] !== "
|
|
21
|
-
for (let $i = 0; $i <
|
|
22
|
-
$[0] = "
|
|
19
|
+
const $ = c(39);
|
|
20
|
+
if ($[0] !== "c2b47a0ded5e80952966193136846d2771f48746af4a761ba4e0ef778f954b27") {
|
|
21
|
+
for (let $i = 0; $i < 39; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
22
|
+
$[0] = "c2b47a0ded5e80952966193136846d2771f48746af4a761ba4e0ef778f954b27";
|
|
23
23
|
}
|
|
24
24
|
const { layout } = t0;
|
|
25
25
|
const source = useSelector(previewStore, selectPreviewSource);
|
|
@@ -36,12 +36,14 @@ function DerivedLayoutSidebar(t0) {
|
|
|
36
36
|
const app = useCamoxApp();
|
|
37
37
|
let t2;
|
|
38
38
|
if ($[3] !== app || $[4] !== layout.layoutId) {
|
|
39
|
-
t2 = app.getLayoutById(layout.layoutId)
|
|
39
|
+
t2 = app.getLayoutById(layout.layoutId);
|
|
40
40
|
$[3] = app;
|
|
41
41
|
$[4] = layout.layoutId;
|
|
42
42
|
$[5] = t2;
|
|
43
43
|
} else t2 = $[5];
|
|
44
|
-
const
|
|
44
|
+
const definition = t2;
|
|
45
|
+
const layoutName = definition?._internal.title ?? layout.layoutId;
|
|
46
|
+
const singleton = definition?._internal.kind === "singleton";
|
|
45
47
|
const projectSlug = useProjectSlug();
|
|
46
48
|
let t3;
|
|
47
49
|
if ($[6] !== projectSlug) {
|
|
@@ -132,28 +134,45 @@ function DerivedLayoutSidebar(t0) {
|
|
|
132
134
|
$[24] = layoutName;
|
|
133
135
|
$[25] = t11;
|
|
134
136
|
} else t11 = $[25];
|
|
135
|
-
|
|
136
|
-
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
137
|
-
t12 = /* @__PURE__ */ jsxs(Alert, { children: [/* @__PURE__ */ jsx(AlertTitle, { children: "Shared layout blocks" }), /* @__PURE__ */ jsx(AlertDescription, { children: "Changes apply to every page using this layout. The generated page content is managed outside the studio." })] });
|
|
138
|
-
$[26] = t12;
|
|
139
|
-
} else t12 = $[26];
|
|
137
|
+
const t12 = singleton ? "Code-owned page" : "Shared layout blocks";
|
|
140
138
|
let t13;
|
|
141
|
-
if ($[
|
|
142
|
-
t13 = /* @__PURE__ */
|
|
139
|
+
if ($[26] !== t12) {
|
|
140
|
+
t13 = /* @__PURE__ */ jsx(AlertTitle, { children: t12 });
|
|
141
|
+
$[26] = t12;
|
|
142
|
+
$[27] = t13;
|
|
143
|
+
} else t13 = $[27];
|
|
144
|
+
const t14 = singleton ? "Edit and publish this page’s blocks here. Its URL and structure are defined in code. Synced blocks share content with their other instances." : "Changes apply to every page using this layout. The generated page content is managed outside the studio.";
|
|
145
|
+
let t15;
|
|
146
|
+
if ($[28] !== t14) {
|
|
147
|
+
t15 = /* @__PURE__ */ jsx(AlertDescription, { children: t14 });
|
|
148
|
+
$[28] = t14;
|
|
149
|
+
$[29] = t15;
|
|
150
|
+
} else t15 = $[29];
|
|
151
|
+
let t16;
|
|
152
|
+
if ($[30] !== t13 || $[31] !== t15) {
|
|
153
|
+
t16 = /* @__PURE__ */ jsxs(Alert, { children: [t13, t15] });
|
|
154
|
+
$[30] = t13;
|
|
155
|
+
$[31] = t15;
|
|
156
|
+
$[32] = t16;
|
|
157
|
+
} else t16 = $[32];
|
|
158
|
+
let t17;
|
|
159
|
+
if ($[33] !== t11 || $[34] !== t16) {
|
|
160
|
+
t17 = /* @__PURE__ */ jsxs(PanelContent, {
|
|
143
161
|
className: "flex grow basis-0 flex-col gap-4 overflow-auto p-2",
|
|
144
|
-
children: [t11,
|
|
162
|
+
children: [t11, t16]
|
|
145
163
|
});
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
|
|
156
|
-
|
|
164
|
+
$[33] = t11;
|
|
165
|
+
$[34] = t16;
|
|
166
|
+
$[35] = t17;
|
|
167
|
+
} else t17 = $[35];
|
|
168
|
+
let t18;
|
|
169
|
+
if ($[36] !== t10 || $[37] !== t17) {
|
|
170
|
+
t18 = /* @__PURE__ */ jsxs(Fragment, { children: [t10, t17] });
|
|
171
|
+
$[36] = t10;
|
|
172
|
+
$[37] = t17;
|
|
173
|
+
$[38] = t18;
|
|
174
|
+
} else t18 = $[38];
|
|
175
|
+
return t18;
|
|
157
176
|
}
|
|
158
177
|
|
|
159
178
|
//#endregion
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Alert, AlertDescription, AlertTitle } from "@camox/ui/alert";
|
|
5
5
|
|
|
6
6
|
//#region src/features/preview/components/DerivedPageInfoSidebar.tsx
|
|
7
7
|
function DerivedPageInfoSidebar(t0) {
|
|
8
|
-
const $ = c(
|
|
9
|
-
if ($[0] !== "
|
|
10
|
-
for (let $i = 0; $i <
|
|
11
|
-
$[0] = "
|
|
8
|
+
const $ = c(13);
|
|
9
|
+
if ($[0] !== "4055e1683cf89ee8b21c17d486a36f5d2dcf14d6cea02195afa4565d830e71cf") {
|
|
10
|
+
for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
11
|
+
$[0] = "4055e1683cf89ee8b21c17d486a36f5d2dcf14d6cea02195afa4565d830e71cf";
|
|
12
12
|
}
|
|
13
13
|
const { layoutId } = t0;
|
|
14
14
|
const camoxApp = useCamoxApp();
|
|
@@ -19,7 +19,9 @@ function DerivedPageInfoSidebar(t0) {
|
|
|
19
19
|
$[2] = layoutId;
|
|
20
20
|
$[3] = t1;
|
|
21
21
|
} else t1 = $[3];
|
|
22
|
-
const
|
|
22
|
+
const layout = t1;
|
|
23
|
+
const layoutName = layout?._internal.title ?? layoutId;
|
|
24
|
+
const singleton = layout?._internal.kind === "singleton";
|
|
23
25
|
let t2;
|
|
24
26
|
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
27
|
t2 = /* @__PURE__ */ jsx("p", {
|
|
@@ -28,29 +30,39 @@ function DerivedPageInfoSidebar(t0) {
|
|
|
28
30
|
});
|
|
29
31
|
$[4] = t2;
|
|
30
32
|
} else t2 = $[4];
|
|
31
|
-
|
|
32
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
33
|
-
t3 = /* @__PURE__ */ jsx(AlertTitle, { children: "Derived page" });
|
|
34
|
-
$[5] = t3;
|
|
35
|
-
} else t3 = $[5];
|
|
33
|
+
const t3 = singleton ? "Singleton page" : "Derived page";
|
|
36
34
|
let t4;
|
|
37
|
-
if ($[
|
|
38
|
-
t4 = /* @__PURE__ */
|
|
35
|
+
if ($[5] !== t3) {
|
|
36
|
+
t4 = /* @__PURE__ */ jsx(AlertTitle, { children: t3 });
|
|
37
|
+
$[5] = t3;
|
|
38
|
+
$[6] = t4;
|
|
39
|
+
} else t4 = $[6];
|
|
40
|
+
let t5;
|
|
41
|
+
if ($[7] !== layoutName || $[8] !== singleton) {
|
|
42
|
+
t5 = /* @__PURE__ */ jsx(AlertDescription, { children: singleton ? /* @__PURE__ */ jsx(Fragment, { children: "This page and its URL are defined in code. Select a block in the preview to edit its content. The page cannot be deleted or moved in Studio." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
"This page is generated using the",
|
|
44
|
+
" ",
|
|
45
|
+
/* @__PURE__ */ jsx("strong", {
|
|
46
|
+
className: "font-semibold italic",
|
|
47
|
+
children: layoutName
|
|
48
|
+
}),
|
|
49
|
+
" layout. Select a shared block in the preview to edit it."
|
|
50
|
+
] }) });
|
|
51
|
+
$[7] = layoutName;
|
|
52
|
+
$[8] = singleton;
|
|
53
|
+
$[9] = t5;
|
|
54
|
+
} else t5 = $[9];
|
|
55
|
+
let t6;
|
|
56
|
+
if ($[10] !== t4 || $[11] !== t5) {
|
|
57
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
39
58
|
className: "flex-1 space-y-4 p-2 pt-4",
|
|
40
|
-
children: [t2, /* @__PURE__ */ jsxs(Alert, { children: [
|
|
41
|
-
"This page is generated using the",
|
|
42
|
-
" ",
|
|
43
|
-
/* @__PURE__ */ jsx("strong", {
|
|
44
|
-
className: "font-semibold italic",
|
|
45
|
-
children: layoutName
|
|
46
|
-
}),
|
|
47
|
-
" layout. Select a shared block in the preview to edit it."
|
|
48
|
-
] })] })]
|
|
59
|
+
children: [t2, /* @__PURE__ */ jsxs(Alert, { children: [t4, t5] })]
|
|
49
60
|
});
|
|
50
|
-
$[
|
|
51
|
-
$[
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
$[10] = t4;
|
|
62
|
+
$[11] = t5;
|
|
63
|
+
$[12] = t6;
|
|
64
|
+
} else t6 = $[12];
|
|
65
|
+
return t6;
|
|
54
66
|
}
|
|
55
67
|
|
|
56
68
|
//#endregion
|
|
@@ -9,7 +9,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
import { useSelector } from "@xstate/store-react";
|
|
10
10
|
import { Kbd } from "@camox/ui/kbd";
|
|
11
11
|
import { Button } from "@camox/ui/button";
|
|
12
|
-
import {
|
|
12
|
+
import { Bold, Highlighter, Italic, Underline } from "lucide-react";
|
|
13
13
|
import * as Tooltip$1 from "@camox/ui/tooltip";
|
|
14
14
|
import { ButtonGroup } from "@camox/ui/button-group";
|
|
15
15
|
import { FloatingToolbar } from "@camox/ui/floating-toolbar";
|
|
@@ -39,18 +39,18 @@ const FORMAT_BUTTONS = [
|
|
|
39
39
|
shortcut: "⌘ U"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
key: "
|
|
43
|
-
flag: FORMAT_FLAGS.
|
|
44
|
-
icon:
|
|
45
|
-
label: "
|
|
42
|
+
key: "highlight",
|
|
43
|
+
flag: FORMAT_FLAGS.highlight,
|
|
44
|
+
icon: Highlighter,
|
|
45
|
+
label: "Highlight",
|
|
46
46
|
shortcut: null
|
|
47
47
|
}
|
|
48
48
|
];
|
|
49
49
|
const FieldToolbar = () => {
|
|
50
50
|
const $ = c(28);
|
|
51
|
-
if ($[0] !== "
|
|
51
|
+
if ($[0] !== "cb7cd90f7cc268633db3dcbb4458cac864e661f9d57f1cb6764d8a2f3e167b39") {
|
|
52
52
|
for (let $i = 0; $i < 28; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
53
|
-
$[0] = "
|
|
53
|
+
$[0] = "cb7cd90f7cc268633db3dcbb4458cac864e661f9d57f1cb6764d8a2f3e167b39";
|
|
54
54
|
}
|
|
55
55
|
const iframeElement = useSelector(previewStore, _temp);
|
|
56
56
|
const [hasSelection, setHasSelection] = React.useState(false);
|