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.
Files changed (60) hide show
  1. package/dist/core/components/lexical/{GradientNode.js → HighlightNode.js} +34 -34
  2. package/dist/core/components/lexical/InlineLexicalEditor.js +14 -14
  3. package/dist/core/components/lexical/InlineStylesPlugin.js +6 -6
  4. package/dist/core/components/lexical/SelectionBroadcaster.js +5 -5
  5. package/dist/core/components/lexical/SidebarLexicalEditor.js +20 -20
  6. package/dist/core/components/lexical/TextLinkPopover.js +191 -208
  7. package/dist/core/components/lexical/editorConfig.js +2 -2
  8. package/dist/core/createApp.d.ts +3 -2
  9. package/dist/core/createApp.js +2 -1
  10. package/dist/core/createLayout.d.ts +16 -3
  11. package/dist/core/createLayout.js +15 -15
  12. package/dist/core/derivedRoutes.js +1 -1
  13. package/dist/core/dom.d.ts +17 -0
  14. package/dist/core/dom.js +22 -0
  15. package/dist/core/lib/lexicalReact.js +4 -4
  16. package/dist/core/lib/lexicalState.js +3 -3
  17. package/dist/core/lib/modifierFormats.js +1 -1
  18. package/dist/core/lib/textLinks.js +5 -2
  19. package/dist/core/lib/textStyles.d.ts +2 -2
  20. package/dist/core/lib/textStyles.js +6 -11
  21. package/dist/core/pageDestinations.js +37 -0
  22. package/dist/features/og/imageResponse.node.js +11 -9
  23. package/dist/features/preview/CamoxPreview.js +42 -65
  24. package/dist/features/preview/components/AddBlockSidebar.js +1 -1
  25. package/dist/features/preview/components/BlockActionsPopover.js +1 -1
  26. package/dist/features/preview/components/CreatePageModal.js +4 -4
  27. package/dist/features/preview/components/DerivedLayoutSidebar.js +45 -26
  28. package/dist/features/preview/components/DerivedPageInfoSidebar.js +38 -26
  29. package/dist/features/preview/components/FieldToolbar.js +7 -7
  30. package/dist/features/preview/components/LinkFieldEditor.js +212 -209
  31. package/dist/features/preview/components/PageEditorSidebar.js +1 -1
  32. package/dist/features/preview/components/PageInfoSidebar.js +28 -28
  33. package/dist/features/preview/components/PagePicker.js +16 -16
  34. package/dist/features/preview/components/PageTree.js +1 -1
  35. package/dist/features/preview/components/PublicationRow.js +8 -4
  36. package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
  37. package/dist/features/preview/publication.js +10 -0
  38. package/dist/features/provider/CoreCamoxProvider.js +1 -1
  39. package/dist/features/runtime/runtime.js +20 -21
  40. package/dist/features/studio/components/EnvironmentMenu.js +3 -2
  41. package/dist/features/studio/components/Navbar.js +53 -80
  42. package/dist/features/vite/layoutGeneration.js +7 -3
  43. package/dist/features/vite/vite.js +5 -1
  44. package/dist/hooks/use-page-destinations.js +53 -0
  45. package/dist/lib/auth.js +11 -14
  46. package/dist/lib/server-auth-cookie.js +21 -0
  47. package/dist/studio.css +1 -1
  48. package/package.json +8 -4
  49. package/skills/camox/SKILL.md +32 -9
  50. package/skills/camox/references/block-definitions.md +84 -290
  51. package/skills/camox/references/cli-common.md +2 -4
  52. package/skills/camox/references/cli-content.md +147 -0
  53. package/skills/camox/references/cli-environments.md +1 -1
  54. package/skills/camox/references/dom-integrations.md +93 -0
  55. package/skills/camox/references/field-styling.md +50 -0
  56. package/skills/camox/references/layout-definitions.md +33 -147
  57. package/skills/camox/references/routed-layouts.md +71 -0
  58. package/skills/camoxify/SKILL.md +52 -0
  59. package/skills/camox/references/cli-blocks.md +0 -78
  60. 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(32);
20
- if ($[0] !== "2c7da8bd37fd1558e1c31149d4435d439cdd1425cb374116d681960617531266") {
21
- for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
22
- $[0] = "2c7da8bd37fd1558e1c31149d4435d439cdd1425cb374116d681960617531266";
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)?._internal.title ?? 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 layoutName = t2;
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
- let t12;
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 ($[27] !== t11) {
142
- t13 = /* @__PURE__ */ jsxs(PanelContent, {
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, t12]
162
+ children: [t11, t16]
145
163
  });
146
- $[27] = t11;
147
- $[28] = t13;
148
- } else t13 = $[28];
149
- let t14;
150
- if ($[29] !== t10 || $[30] !== t13) {
151
- t14 = /* @__PURE__ */ jsxs(Fragment, { children: [t10, t13] });
152
- $[29] = t10;
153
- $[30] = t13;
154
- $[31] = t14;
155
- } else t14 = $[31];
156
- return t14;
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(8);
9
- if ($[0] !== "188f548de856db3a863c0d74a6e937ddbe5a25be65cd852330ec33162eb56ebf") {
10
- for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
11
- $[0] = "188f548de856db3a863c0d74a6e937ddbe5a25be65cd852330ec33162eb56ebf";
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 layoutName = t1?._internal.title ?? layoutId;
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
- let t3;
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 ($[6] !== layoutName) {
38
- t4 = /* @__PURE__ */ jsxs("div", {
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: [t3, /* @__PURE__ */ jsxs(AlertDescription, { 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
- $[6] = layoutName;
51
- $[7] = t4;
52
- } else t4 = $[7];
53
- return t4;
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 { Blend, Bold, Italic, Underline } from "lucide-react";
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: "gradient",
43
- flag: FORMAT_FLAGS.gradient,
44
- icon: Blend,
45
- label: "Gradient",
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] !== "62fc88dbf76bce176e1b9d35a550f78886d467e61d1692885683da9874bf34dd") {
51
+ if ($[0] !== "cb7cd90f7cc268633db3dcbb4458cac864e661f9d57f1cb6764d8a2f3e167b39") {
52
52
  for (let $i = 0; $i < 28; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
53
- $[0] = "62fc88dbf76bce176e1b9d35a550f78886d467e61d1692885683da9874bf34dd";
53
+ $[0] = "cb7cd90f7cc268633db3dcbb4458cac864e661f9d57f1cb6764d8a2f3e167b39";
54
54
  }
55
55
  const iframeElement = useSelector(previewStore, _temp);
56
56
  const [hasSelection, setHasSelection] = React.useState(false);