camox 0.41.1 → 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 (93) 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 +52 -49
  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 +19 -4
  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/editing/createEditableBlock.d.ts +8 -1
  16. package/dist/core/editing/createEditableBlock.js +636 -459
  17. package/dist/core/hooks/useOverlayState.js +11 -0
  18. package/dist/core/lib/fieldTypes.js +5 -5
  19. package/dist/core/lib/lexicalReact.js +4 -4
  20. package/dist/core/lib/lexicalState.js +20 -4
  21. package/dist/core/lib/modifierFormats.js +1 -1
  22. package/dist/core/lib/textLinks.js +5 -2
  23. package/dist/core/lib/textStyles.d.ts +2 -2
  24. package/dist/core/lib/textStyles.js +6 -11
  25. package/dist/core/pageDestinations.js +37 -0
  26. package/dist/features/og/imageResponse.node.js +11 -9
  27. package/dist/features/preview/CamoxPreview.js +108 -124
  28. package/dist/features/preview/commentsEnabled.js +8 -0
  29. package/dist/features/preview/components/AddBlockSidebar.js +80 -90
  30. package/dist/features/preview/components/AssetLightbox.js +4 -11
  31. package/dist/features/preview/components/AttachedComments.js +194 -0
  32. package/dist/features/preview/components/BlockActionsPopover.js +14 -65
  33. package/dist/features/preview/components/CommentHeader.js +122 -0
  34. package/dist/features/preview/components/CommentSidebar.js +29 -0
  35. package/dist/features/preview/components/CommentTargetQuote.js +166 -0
  36. package/dist/features/preview/components/CreatePageModal.js +4 -10
  37. package/dist/features/preview/components/DerivedLayoutSidebar.js +45 -26
  38. package/dist/features/preview/components/DerivedPageInfoSidebar.js +38 -26
  39. package/dist/features/preview/components/FieldToolbar.js +7 -7
  40. package/dist/features/preview/components/ItemFieldsEditor.js +275 -204
  41. package/dist/features/preview/components/LeftSidebar.js +18 -18
  42. package/dist/features/preview/components/LinkFieldEditor.js +212 -209
  43. package/dist/features/preview/components/OverlayTracker.js +14 -20
  44. package/dist/features/preview/components/Overlays.js +26 -35
  45. package/dist/features/preview/components/PageEditorSidebar.js +90 -91
  46. package/dist/features/preview/components/PageInfoSidebar.js +128 -159
  47. package/dist/features/preview/components/PagePicker.js +29 -24
  48. package/dist/features/preview/components/PageTree.js +159 -157
  49. package/dist/features/preview/components/PreviewComments.js +56 -0
  50. package/dist/features/preview/components/PreviewPanel.js +122 -78
  51. package/dist/features/preview/components/PreviewToolbar.js +280 -231
  52. package/dist/features/preview/components/PublicationRow.js +8 -11
  53. package/dist/features/preview/components/RightSidebar.js +14 -11
  54. package/dist/features/preview/components/SidebarSection.js +121 -0
  55. package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
  56. package/dist/features/preview/previewCommentsStore.js +115 -0
  57. package/dist/features/preview/previewSelection.js +75 -0
  58. package/dist/features/preview/previewStore.js +19 -39
  59. package/dist/features/preview/publication.js +10 -0
  60. package/dist/features/provider/AuthenticatedCamoxProvider.js +46 -34
  61. package/dist/features/provider/CoreCamoxProvider.js +1 -1
  62. package/dist/features/provider/components/CommandPalette.js +142 -58
  63. package/dist/features/provider/useAdminShortcuts.js +19 -8
  64. package/dist/features/routes/pageRuntime.js +0 -6
  65. package/dist/features/runtime/RuntimeChrome.js +40 -37
  66. package/dist/features/runtime/runtime.js +20 -21
  67. package/dist/features/studio/CamoxStudio.js +30 -50
  68. package/dist/features/studio/components/EnvironmentMenu.js +3 -2
  69. package/dist/features/studio/components/Navbar.js +53 -80
  70. package/dist/features/vite/layoutGeneration.js +7 -3
  71. package/dist/features/vite/runtimeDev.js +4 -1
  72. package/dist/features/vite/vite.d.ts +3 -2
  73. package/dist/features/vite/vite.js +14 -6
  74. package/dist/hooks/use-file-upload.js +0 -2
  75. package/dist/hooks/use-page-destinations.js +53 -0
  76. package/dist/lib/auth.js +11 -14
  77. package/dist/lib/server-auth-cookie.js +21 -0
  78. package/dist/studio.css +1 -1
  79. package/package.json +9 -7
  80. package/skills/camox/SKILL.md +32 -9
  81. package/skills/camox/references/block-definitions.md +84 -290
  82. package/skills/camox/references/cli-common.md +2 -4
  83. package/skills/camox/references/cli-content.md +147 -0
  84. package/skills/camox/references/cli-environments.md +1 -1
  85. package/skills/camox/references/dom-integrations.md +93 -0
  86. package/skills/camox/references/field-styling.md +50 -0
  87. package/skills/camox/references/layout-definitions.md +33 -147
  88. package/skills/camox/references/routed-layouts.md +71 -0
  89. package/skills/camoxify/SKILL.md +52 -0
  90. package/dist/lib/telemetry-client.js +0 -66
  91. package/dist/lib/telemetry.js +0 -26
  92. package/skills/camox/references/cli-blocks.md +0 -78
  93. package/skills/camox/references/cli-pages.md +0 -53
@@ -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);