camox 0.34.0 → 0.35.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 (73) hide show
  1. package/dist/core/components/lexical/InlineLexicalEditor.js +1 -1
  2. package/dist/core/components/lexical/SidebarLexicalEditor.js +7 -7
  3. package/dist/core/components/lexical/TextLinkPopover.js +4 -4
  4. package/dist/core/createApp.d.ts +2 -1
  5. package/dist/core/createBlock.d.ts +5 -1451
  6. package/dist/core/createBlock.js +449 -1602
  7. package/dist/core/editing/BlockEditingRuntime.js +36 -0
  8. package/dist/core/editing/CompleteBlockEditingRuntime.js +76 -0
  9. package/dist/core/editing/createEditableBlock.d.ts +1455 -0
  10. package/dist/core/editing/createEditableBlock.js +1751 -0
  11. package/dist/core/lib/lexicalState.js +1 -1
  12. package/dist/features/agent-chat/components/AgentChatSidebar.js +1 -1
  13. package/dist/features/content/components/AssetCard.js +1 -1
  14. package/dist/features/page/PublishedPageContent.js +236 -0
  15. package/dist/features/page/PublishedPageExperience.js +23 -0
  16. package/dist/features/preview/CamoxPreview.d.ts +1 -0
  17. package/dist/features/preview/CamoxPreview.js +4 -4
  18. package/dist/features/preview/EditablePageContent.js +3 -0
  19. package/dist/features/preview/EditablePageExperience.js +24 -0
  20. package/dist/features/preview/components/AddBlockSidebar.js +3 -3
  21. package/dist/features/preview/components/AssetFieldEditor.js +1 -1
  22. package/dist/features/preview/components/AssetLightbox.js +46 -110
  23. package/dist/features/preview/components/BlockActionsPopover.js +6 -6
  24. package/dist/features/preview/components/CreatePageModal.js +4 -4
  25. package/dist/features/preview/components/DebouncedFieldEditor.js +2 -2
  26. package/dist/features/preview/components/DraftSwitchDialog.js +1 -1
  27. package/dist/features/preview/components/FieldToolbar.js +3 -3
  28. package/dist/features/preview/components/Frame.js +1 -1
  29. package/dist/features/preview/components/ItemFieldsEditor.js +3 -3
  30. package/dist/features/preview/components/LeftSidebar.js +1 -1
  31. package/dist/features/preview/components/LinkFieldEditor.js +3 -3
  32. package/dist/features/preview/components/Metadata.js +87 -0
  33. package/dist/features/preview/components/MultipleAssetFieldEditor.js +1 -1
  34. package/dist/features/preview/components/OverlayTracker.js +3 -3
  35. package/dist/features/preview/components/Overlays.js +3 -3
  36. package/dist/features/preview/components/PageEditorSidebar.js +5 -5
  37. package/dist/features/preview/components/PageInfoSidebar.js +157 -73
  38. package/dist/features/preview/components/PageLocationFieldset.js +1 -1
  39. package/dist/features/preview/components/PageNavigatorSidebar.js +4 -4
  40. package/dist/features/preview/components/PageNicknameField.js +2 -2
  41. package/dist/features/preview/components/PagePicker.js +3 -3
  42. package/dist/features/preview/components/PageTree.js +3 -3
  43. package/dist/features/preview/components/PeekedBlock.js +2 -2
  44. package/dist/features/preview/components/PreviewPanel.js +2 -2
  45. package/dist/features/preview/components/PreviewToolbar.js +2 -2
  46. package/dist/features/preview/components/PublishDialog.js +2 -2
  47. package/dist/features/preview/components/RepeatableItemsList.js +1 -1
  48. package/dist/features/preview/components/RightSidebar.js +1 -1
  49. package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
  50. package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
  51. package/dist/features/provider/AuthenticatedCamoxProvider.js +63 -0
  52. package/dist/features/provider/CamoxProvider.d.ts +5 -12
  53. package/dist/features/provider/CamoxProvider.js +80 -338
  54. package/dist/features/provider/CoreCamoxProvider.js +37 -0
  55. package/dist/features/provider/LocalhostPreviewProvider.js +159 -0
  56. package/dist/features/provider/components/CommandPalette.js +1 -1
  57. package/dist/features/provider/useAdminShortcuts.js +1 -1
  58. package/dist/features/runtime/hydrationData.js +9 -0
  59. package/dist/features/runtime/pageApp.js +148 -35
  60. package/dist/features/runtime/pageClient.d.ts +1 -2
  61. package/dist/features/runtime/pageClient.js +3 -20
  62. package/dist/features/runtime/runtime.d.ts +1 -0
  63. package/dist/features/runtime/studioApp.js +76 -8
  64. package/dist/features/runtime/studioClient.d.ts +6 -0
  65. package/dist/features/runtime/studioClient.js +20 -0
  66. package/dist/features/studio/CamoxStudio.js +1 -1
  67. package/dist/features/studio/components/EnvironmentMenu.js +2 -2
  68. package/dist/features/studio/useTheme.js +1 -22
  69. package/dist/features/vite/runtimeDev.js +24 -3
  70. package/dist/features/vite/vite.js +7 -1
  71. package/dist/lib/normalized-data.js +6 -6
  72. package/dist/lib/view-queries.js +28 -0
  73. package/package.json +9 -4
@@ -1,7 +1,7 @@
1
1
  import { previewStore } from "../previewStore.js";
2
2
  import { c } from "react/compiler-runtime";
3
- import { useSelector } from "@xstate/store-react";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useSelector } from "@xstate/store-react";
5
5
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
6
6
 
7
7
  //#region src/features/preview/components/DraftSwitchDialog.tsx
@@ -1,12 +1,12 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
- import { isOverlayMessage } from "../overlayMessages.js";
3
2
  import { previewStore } from "../previewStore.js";
4
- import { FORMAT_FLAGS } from "../../../core/lib/modifierFormats.js";
5
3
  import { TextLinkPopover } from "../../../core/components/lexical/TextLinkPopover.js";
4
+ import { FORMAT_FLAGS } from "../../../core/lib/modifierFormats.js";
5
+ import { isOverlayMessage } from "../overlayMessages.js";
6
6
  import { c } from "react/compiler-runtime";
7
- import { useSelector } from "@xstate/store-react";
8
7
  import * as React from "react";
9
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { useSelector } from "@xstate/store-react";
10
10
  import { Kbd } from "@camox/ui/kbd";
11
11
  import { Button } from "@camox/ui/button";
12
12
  import { Bold, Italic } from "lucide-react";
@@ -1,8 +1,8 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import * as React from "react";
4
- import { createPortal } from "react-dom";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { createPortal } from "react-dom";
6
6
 
7
7
  //#region src/features/preview/components/Frame.tsx
8
8
  const FrameContext = React.createContext({
@@ -1,14 +1,14 @@
1
- import { previewStore } from "../previewStore.js";
2
1
  import { isFileMarker, isItemMarker, resolveFileMarker } from "../../../lib/normalized-data.js";
2
+ import { previewStore } from "../previewStore.js";
3
3
  import { SidebarLexicalEditor } from "../../../core/components/lexical/SidebarLexicalEditor.js";
4
4
  import { RepeatableItemsList } from "./RepeatableItemsList.js";
5
5
  import { c } from "react/compiler-runtime";
6
- import { Input } from "@camox/ui/input";
7
- import { Label } from "@camox/ui/label";
8
6
  import * as React from "react";
9
7
  import { jsx, jsxs } from "react/jsx-runtime";
10
8
  import { FileIcon, ImageIcon, Images, Link2 } from "lucide-react";
9
+ import { Label } from "@camox/ui/label";
11
10
  import { useForm } from "@tanstack/react-form";
11
+ import { Input } from "@camox/ui/input";
12
12
 
13
13
  //#region src/features/preview/components/ItemFieldsEditor.tsx
14
14
  const formatFieldName = (fieldName) => {
@@ -2,8 +2,8 @@ import { previewStore } from "../previewStore.js";
2
2
  import { AddBlockSidebar } from "./AddBlockSidebar.js";
3
3
  import { PageNavigatorSidebar } from "./PageNavigatorSidebar.js";
4
4
  import { c } from "react/compiler-runtime";
5
- import { useSelector } from "@xstate/store-react";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { useSelector } from "@xstate/store-react";
7
7
 
8
8
  //#region src/features/preview/components/LeftSidebar.tsx
9
9
  const getLeftSidebarRoute = ({ isAddBlockSidebarOpen }) => {
@@ -3,14 +3,14 @@ import { pageQueries, projectQueries } from "../../../lib/queries.js";
3
3
  import { cn } from "../../../lib/utils.js";
4
4
  import { useDebouncedField } from "../../../hooks/use-debounced-field.js";
5
5
  import { c } from "react/compiler-runtime";
6
- import { Input } from "@camox/ui/input";
7
- import { Label } from "@camox/ui/label";
8
- import { Popover, PopoverContent, PopoverTrigger } from "@camox/ui/popover";
9
6
  import { useQuery } from "@tanstack/react-query";
10
7
  import * as React from "react";
11
8
  import { jsx, jsxs } from "react/jsx-runtime";
12
9
  import { Button } from "@camox/ui/button";
13
10
  import { Check, ChevronsUpDown } from "lucide-react";
11
+ import { Popover, PopoverContent, PopoverTrigger } from "@camox/ui/popover";
12
+ import { Label } from "@camox/ui/label";
13
+ import { Input } from "@camox/ui/input";
14
14
  import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@camox/ui/command";
15
15
  import { Switch } from "@camox/ui/switch";
16
16
  import { Tabs, TabsList, TabsTrigger } from "@camox/ui/tabs";
@@ -0,0 +1,87 @@
1
+ import { c } from "react/compiler-runtime";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+
4
+ //#region src/features/preview/components/Metadata.tsx
5
+ function Metadata(t0) {
6
+ const $ = c(3);
7
+ if ($[0] !== "0cab1dfcfdb2036df169f46d25dd9f41685cc99f911ce3094b6e2273b2fb83fa") {
8
+ for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
9
+ $[0] = "0cab1dfcfdb2036df169f46d25dd9f41685cc99f911ce3094b6e2273b2fb83fa";
10
+ }
11
+ const { children } = t0;
12
+ let t1;
13
+ if ($[1] !== children) {
14
+ t1 = /* @__PURE__ */ jsx("div", {
15
+ className: "text-muted-foreground space-y-1 text-sm",
16
+ children
17
+ });
18
+ $[1] = children;
19
+ $[2] = t1;
20
+ } else t1 = $[2];
21
+ return t1;
22
+ }
23
+ function MetadataRow(t0) {
24
+ const $ = c(9);
25
+ if ($[0] !== "0cab1dfcfdb2036df169f46d25dd9f41685cc99f911ce3094b6e2273b2fb83fa") {
26
+ for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
27
+ $[0] = "0cab1dfcfdb2036df169f46d25dd9f41685cc99f911ce3094b6e2273b2fb83fa";
28
+ }
29
+ const { label, children } = t0;
30
+ let t1;
31
+ if ($[1] !== label) {
32
+ t1 = /* @__PURE__ */ jsx("span", {
33
+ className: "shrink-0",
34
+ children: label
35
+ });
36
+ $[1] = label;
37
+ $[2] = t1;
38
+ } else t1 = $[2];
39
+ let t2;
40
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
41
+ t2 = /* @__PURE__ */ jsx("span", { className: "border-border min-w-0 flex-1 border-b" });
42
+ $[3] = t2;
43
+ } else t2 = $[3];
44
+ let t3;
45
+ if ($[4] !== children) {
46
+ t3 = /* @__PURE__ */ jsx("span", {
47
+ className: "text-foreground min-w-0 truncate",
48
+ children
49
+ });
50
+ $[4] = children;
51
+ $[5] = t3;
52
+ } else t3 = $[5];
53
+ let t4;
54
+ if ($[6] !== t1 || $[7] !== t3) {
55
+ t4 = /* @__PURE__ */ jsxs("div", {
56
+ className: "flex items-baseline gap-2",
57
+ children: [
58
+ t1,
59
+ t2,
60
+ t3
61
+ ]
62
+ });
63
+ $[6] = t1;
64
+ $[7] = t3;
65
+ $[8] = t4;
66
+ } else t4 = $[8];
67
+ return t4;
68
+ }
69
+ function formatRelativeTime(epochMs) {
70
+ const now = Temporal.Now.instant();
71
+ const then = Temporal.Instant.fromEpochMilliseconds(epochMs);
72
+ const totalSeconds = now.since(then).total("seconds");
73
+ const rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
74
+ if (totalSeconds < 60) return rtf.format(-Math.floor(totalSeconds), "second");
75
+ const totalMinutes = Math.floor(totalSeconds / 60);
76
+ if (totalMinutes < 60) return rtf.format(-totalMinutes, "minute");
77
+ const totalHours = Math.floor(totalMinutes / 60);
78
+ if (totalHours < 24) return rtf.format(-totalHours, "hour");
79
+ const totalDays = Math.floor(totalHours / 24);
80
+ if (totalDays < 30) return rtf.format(-totalDays, "day");
81
+ const totalMonths = Math.floor(totalDays / 30);
82
+ if (totalMonths < 12) return rtf.format(-totalMonths, "month");
83
+ return rtf.format(-Math.floor(totalDays / 365), "year");
84
+ }
85
+
86
+ //#endregion
87
+ export { Metadata, MetadataRow, formatRelativeTime };
@@ -1,7 +1,7 @@
1
1
  import { useProjectSlug } from "../../../lib/auth.js";
2
+ import { transformImageUrl } from "../../../core/lib/imageTransform.js";
2
3
  import { projectQueries } from "../../../lib/queries.js";
3
4
  import { cn } from "../../../lib/utils.js";
4
- import { transformImageUrl } from "../../../core/lib/imageTransform.js";
5
5
  import { UploadDropZone } from "../../content/components/UploadDropZone.js";
6
6
  import { useFileUpload } from "../../../hooks/use-file-upload.js";
7
7
  import { AssetLightbox } from "./AssetLightbox.js";
@@ -1,9 +1,9 @@
1
- import { useFrame } from "./Frame.js";
2
- import { isOverlayMessage } from "../overlayMessages.js";
3
1
  import { previewStore } from "../previewStore.js";
2
+ import { isOverlayMessage } from "../overlayMessages.js";
3
+ import { useFrame } from "./Frame.js";
4
4
  import { c } from "react/compiler-runtime";
5
- import { useSelector } from "@xstate/store-react";
6
5
  import * as React from "react";
6
+ import { useSelector } from "@xstate/store-react";
7
7
 
8
8
  //#region src/features/preview/components/OverlayTracker.tsx
9
9
  /**
@@ -1,10 +1,10 @@
1
- import { isOverlayMessage } from "../overlayMessages.js";
2
- import { previewStore } from "../previewStore.js";
3
1
  import { usePageBlocks } from "../../../lib/normalized-data.js";
2
+ import { previewStore } from "../previewStore.js";
3
+ import { isOverlayMessage } from "../overlayMessages.js";
4
4
  import { usePreviewedPage } from "../CamoxPreview.js";
5
5
  import { c } from "react/compiler-runtime";
6
- import { useSelector } from "@xstate/store-react";
7
6
  import * as React from "react";
7
+ import { useSelector } from "@xstate/store-react";
8
8
 
9
9
  //#region src/features/preview/components/Overlays.tsx
10
10
  const Overlays = (t0) => {
@@ -1,9 +1,9 @@
1
+ import { isFileMarker } from "../../../lib/normalized-data.js";
1
2
  import { blockMutations, blockQueries, fileQueries, repeatableItemMutations } from "../../../lib/queries.js";
2
- import { trackClientEvent } from "../../../lib/telemetry-client.js";
3
3
  import { cn } from "../../../lib/utils.js";
4
- import { previewStore, selectionBlockId, selectionField, selectionItemId } from "../previewStore.js";
5
- import { isFileMarker } from "../../../lib/normalized-data.js";
6
4
  import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
5
+ import { trackClientEvent } from "../../../lib/telemetry-client.js";
6
+ import { previewStore, selectionBlockId, selectionField, selectionItemId } from "../previewStore.js";
7
7
  import { useRequireDraftSource } from "../../../core/hooks/useRequireDraftSource.js";
8
8
  import { fieldTypesDictionary } from "../../../core/lib/fieldTypes.js";
9
9
  import { SingleAssetFieldEditor } from "./AssetFieldEditor.js";
@@ -11,14 +11,14 @@ import { useRepeatableItemActions } from "./useRepeatableItemActions.js";
11
11
  import { ItemFieldsEditor, formatFieldName } from "./ItemFieldsEditor.js";
12
12
  import { LinkFieldEditor } from "./LinkFieldEditor.js";
13
13
  import { MultipleAssetFieldEditor } from "./MultipleAssetFieldEditor.js";
14
- import { Label } from "@camox/ui/label";
15
14
  import { useMutation, useQueries, useQuery } from "@tanstack/react-query";
16
- import { useSelector } from "@xstate/store-react";
17
15
  import * as React from "react";
18
16
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
+ import { useSelector } from "@xstate/store-react";
19
18
  import { Button } from "@camox/ui/button";
20
19
  import { CircleMinus, CirclePlus, CornerLeftUp } from "lucide-react";
21
20
  import { Spinner } from "@camox/ui/spinner";
21
+ import { Label } from "@camox/ui/label";
22
22
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
23
23
  import { Switch } from "@camox/ui/switch";
24
24
 
@@ -1,38 +1,39 @@
1
1
  import { useNavigate } from "../../navigation/navigation.js";
2
2
  import { useProjectSlug } from "../../../lib/auth.js";
3
3
  import { blockQueries, layoutQueries, pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
4
- import { trackClientEvent } from "../../../lib/telemetry-client.js";
5
4
  import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
5
+ import { trackClientEvent } from "../../../lib/telemetry-client.js";
6
6
  import { PageLocationFieldset } from "./PageLocationFieldset.js";
7
7
  import { PageNicknameField } from "./PageNicknameField.js";
8
8
  import { UploadDropZone } from "../../content/components/UploadDropZone.js";
9
9
  import { useDebouncedField } from "../../../hooks/use-debounced-field.js";
10
10
  import { DebouncedFieldEditor } from "./DebouncedFieldEditor.js";
11
+ import { Metadata, MetadataRow, formatRelativeTime } from "./Metadata.js";
11
12
  import { ShikiMarkdown } from "./ShikiMarkdown.js";
12
13
  import { c } from "react/compiler-runtime";
13
- import { Input } from "@camox/ui/input";
14
- import { Label } from "@camox/ui/label";
15
14
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
16
15
  import * as React from "react";
17
16
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
18
- import { toast } from "@camox/ui/toaster";
19
17
  import { Button } from "@camox/ui/button";
20
18
  import { Globe, Info, Pencil, Trash2, Upload } from "lucide-react";
21
19
  import { Alert, AlertDescription, AlertTitle } from "@camox/ui/alert";
22
20
  import { Spinner } from "@camox/ui/spinner";
21
+ import { toast } from "@camox/ui/toaster";
23
22
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@camox/ui/dialog";
23
+ import { Label } from "@camox/ui/label";
24
24
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
25
25
  import { useForm } from "@tanstack/react-form";
26
26
  import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText } from "@camox/ui/input-group";
27
+ import { Input } from "@camox/ui/input";
27
28
  import { Switch } from "@camox/ui/switch";
28
29
  import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
29
30
 
30
31
  //#region src/features/preview/components/PageInfoSidebar.tsx
31
32
  const usePageMetadataData = (pageId) => {
32
33
  const $ = c(29);
33
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
34
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
34
35
  for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
35
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
36
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
36
37
  }
37
38
  const projectSlug = useProjectSlug();
38
39
  const camoxApp = useCamoxApp();
@@ -130,10 +131,10 @@ const usePageMetadataData = (pageId) => {
130
131
  return t9;
131
132
  };
132
133
  const PageInfoSidebar = (t0) => {
133
- const $ = c(40);
134
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
135
- for (let $i = 0; $i < 40; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
136
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
134
+ const $ = c(64);
135
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
136
+ for (let $i = 0; $i < 64; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
137
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
137
138
  }
138
139
  const { pageId } = t0;
139
140
  const data = usePageMetadataData(pageId);
@@ -273,77 +274,160 @@ const PageInfoSidebar = (t0) => {
273
274
  $[21] = t13;
274
275
  } else t13 = $[21];
275
276
  let t14;
276
- if ($[22] !== t9) {
277
- t14 = /* @__PURE__ */ jsxs("div", {
277
+ if ($[22] !== page.createdAt) {
278
+ t14 = formatRelativeTime(page.createdAt);
279
+ $[22] = page.createdAt;
280
+ $[23] = t14;
281
+ } else t14 = $[23];
282
+ let t15;
283
+ if ($[24] !== t14) {
284
+ t15 = /* @__PURE__ */ jsx(MetadataRow, {
285
+ label: "Created",
286
+ children: t14
287
+ });
288
+ $[24] = t14;
289
+ $[25] = t15;
290
+ } else t15 = $[25];
291
+ const t16 = page.createdBy ?? "Unknown";
292
+ let t17;
293
+ if ($[26] !== t16) {
294
+ t17 = /* @__PURE__ */ jsx(MetadataRow, {
295
+ label: "Created by",
296
+ children: t16
297
+ });
298
+ $[26] = t16;
299
+ $[27] = t17;
300
+ } else t17 = $[27];
301
+ let t18;
302
+ if ($[28] !== page.updatedAt) {
303
+ t18 = formatRelativeTime(page.updatedAt);
304
+ $[28] = page.updatedAt;
305
+ $[29] = t18;
306
+ } else t18 = $[29];
307
+ let t19;
308
+ if ($[30] !== t18) {
309
+ t19 = /* @__PURE__ */ jsx(MetadataRow, {
310
+ label: "Updated",
311
+ children: t18
312
+ });
313
+ $[30] = t18;
314
+ $[31] = t19;
315
+ } else t19 = $[31];
316
+ let t20;
317
+ if ($[32] !== page.publishedAt) {
318
+ t20 = page.publishedAt == null ? "Never" : formatRelativeTime(page.publishedAt);
319
+ $[32] = page.publishedAt;
320
+ $[33] = t20;
321
+ } else t20 = $[33];
322
+ let t21;
323
+ if ($[34] !== t20) {
324
+ t21 = /* @__PURE__ */ jsx(MetadataRow, {
325
+ label: "Published",
326
+ children: t20
327
+ });
328
+ $[34] = t20;
329
+ $[35] = t21;
330
+ } else t21 = $[35];
331
+ let t22;
332
+ if ($[36] !== page.publishedAt || $[37] !== page.publishedBy) {
333
+ t22 = page.publishedAt != null && /* @__PURE__ */ jsx(MetadataRow, {
334
+ label: "Published by",
335
+ children: page.publishedBy ?? "Unknown"
336
+ });
337
+ $[36] = page.publishedAt;
338
+ $[37] = page.publishedBy;
339
+ $[38] = t22;
340
+ } else t22 = $[38];
341
+ let t23;
342
+ if ($[39] !== t15 || $[40] !== t17 || $[41] !== t19 || $[42] !== t21 || $[43] !== t22) {
343
+ t23 = /* @__PURE__ */ jsxs(Metadata, { children: [
344
+ t15,
345
+ t17,
346
+ t19,
347
+ t21,
348
+ t22
349
+ ] });
350
+ $[39] = t15;
351
+ $[40] = t17;
352
+ $[41] = t19;
353
+ $[42] = t21;
354
+ $[43] = t22;
355
+ $[44] = t23;
356
+ } else t23 = $[44];
357
+ let t24;
358
+ if ($[45] !== t23 || $[46] !== t9) {
359
+ t24 = /* @__PURE__ */ jsxs("div", {
278
360
  className: "flex-1 space-y-4 overflow-auto p-2 pt-4",
279
361
  children: [
280
362
  t9,
281
363
  t11,
282
- t13
364
+ t13,
365
+ t23
283
366
  ]
284
367
  });
285
- $[22] = t9;
286
- $[23] = t14;
287
- } else t14 = $[23];
288
- let t15;
289
- if ($[24] !== isStructureModalOpen || $[25] !== page.id) {
290
- t15 = /* @__PURE__ */ jsx(PageStructureModal, {
368
+ $[45] = t23;
369
+ $[46] = t9;
370
+ $[47] = t24;
371
+ } else t24 = $[47];
372
+ let t25;
373
+ if ($[48] !== isStructureModalOpen || $[49] !== page.id) {
374
+ t25 = /* @__PURE__ */ jsx(PageStructureModal, {
291
375
  open: isStructureModalOpen,
292
376
  onOpenChange: setIsStructureModalOpen,
293
377
  pageId: page.id
294
378
  });
295
- $[24] = isStructureModalOpen;
296
- $[25] = page.id;
297
- $[26] = t15;
298
- } else t15 = $[26];
299
- let t16;
300
- if ($[27] !== isSeoModalOpen || $[28] !== page.id) {
301
- t16 = /* @__PURE__ */ jsx(PageSeoModal, {
379
+ $[48] = isStructureModalOpen;
380
+ $[49] = page.id;
381
+ $[50] = t25;
382
+ } else t25 = $[50];
383
+ let t26;
384
+ if ($[51] !== isSeoModalOpen || $[52] !== page.id) {
385
+ t26 = /* @__PURE__ */ jsx(PageSeoModal, {
302
386
  open: isSeoModalOpen,
303
387
  onOpenChange: setIsSeoModalOpen,
304
388
  pageId: page.id
305
389
  });
306
- $[27] = isSeoModalOpen;
307
- $[28] = page.id;
308
- $[29] = t16;
309
- } else t16 = $[29];
310
- const t17 = page.metaDescription ?? "";
311
- let t18;
312
- if ($[30] !== isMarkdownModalOpen || $[31] !== metaTitle || $[32] !== page.id || $[33] !== t17) {
313
- t18 = /* @__PURE__ */ jsx(PageMarkdownModal, {
390
+ $[51] = isSeoModalOpen;
391
+ $[52] = page.id;
392
+ $[53] = t26;
393
+ } else t26 = $[53];
394
+ const t27 = page.metaDescription ?? "";
395
+ let t28;
396
+ if ($[54] !== isMarkdownModalOpen || $[55] !== metaTitle || $[56] !== page.id || $[57] !== t27) {
397
+ t28 = /* @__PURE__ */ jsx(PageMarkdownModal, {
314
398
  open: isMarkdownModalOpen,
315
399
  onOpenChange: setIsMarkdownModalOpen,
316
400
  pageId: page.id,
317
401
  metaTitle,
318
- metaDescription: t17
402
+ metaDescription: t27
319
403
  });
320
- $[30] = isMarkdownModalOpen;
321
- $[31] = metaTitle;
322
- $[32] = page.id;
323
- $[33] = t17;
324
- $[34] = t18;
325
- } else t18 = $[34];
326
- let t19;
327
- if ($[35] !== t14 || $[36] !== t15 || $[37] !== t16 || $[38] !== t18) {
328
- t19 = /* @__PURE__ */ jsxs(Fragment, { children: [
329
- t14,
330
- t15,
331
- t16,
332
- t18
404
+ $[54] = isMarkdownModalOpen;
405
+ $[55] = metaTitle;
406
+ $[56] = page.id;
407
+ $[57] = t27;
408
+ $[58] = t28;
409
+ } else t28 = $[58];
410
+ let t29;
411
+ if ($[59] !== t24 || $[60] !== t25 || $[61] !== t26 || $[62] !== t28) {
412
+ t29 = /* @__PURE__ */ jsxs(Fragment, { children: [
413
+ t24,
414
+ t25,
415
+ t26,
416
+ t28
333
417
  ] });
334
- $[35] = t14;
335
- $[36] = t15;
336
- $[37] = t16;
337
- $[38] = t18;
338
- $[39] = t19;
339
- } else t19 = $[39];
340
- return t19;
418
+ $[59] = t24;
419
+ $[60] = t25;
420
+ $[61] = t26;
421
+ $[62] = t28;
422
+ $[63] = t29;
423
+ } else t29 = $[63];
424
+ return t29;
341
425
  };
342
426
  const PageNicknameSidebarEditor = (t0) => {
343
427
  const $ = c(21);
344
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
428
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
345
429
  for (let $i = 0; $i < 21; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
346
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
430
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
347
431
  }
348
432
  const { data } = t0;
349
433
  const { page } = data;
@@ -452,9 +536,9 @@ const PageNicknameSidebarEditor = (t0) => {
452
536
  };
453
537
  const PageLayoutSidebarSelect = (t0) => {
454
538
  const $ = c(30);
455
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
539
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
456
540
  for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
457
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
541
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
458
542
  }
459
543
  const { data } = t0;
460
544
  const { page, layouts, camoxApp } = data;
@@ -586,9 +670,9 @@ const PageLayoutSidebarSelect = (t0) => {
586
670
  };
587
671
  const PageStructureModal = (t0) => {
588
672
  const $ = c(10);
589
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
673
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
590
674
  for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
591
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
675
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
592
676
  }
593
677
  const { open, onOpenChange, pageId } = t0;
594
678
  const data = usePageMetadataData(pageId);
@@ -762,9 +846,9 @@ const PageStructureEditor = ({ data, includeNickname = true, includeLayout = tru
762
846
  };
763
847
  const PageSeoModal = (t0) => {
764
848
  const $ = c(11);
765
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
849
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
766
850
  for (let $i = 0; $i < 11; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
767
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
851
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
768
852
  }
769
853
  const { open, onOpenChange, pageId } = t0;
770
854
  const { page, metaTitle, pageLayoutRecord, project } = usePageMetadataData(pageId);
@@ -809,9 +893,9 @@ const PageSeoModal = (t0) => {
809
893
  };
810
894
  const PageSeoEditor = (t0) => {
811
895
  const $ = c(43);
812
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
896
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
813
897
  for (let $i = 0; $i < 43; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
814
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
898
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
815
899
  }
816
900
  const { page, metaTitle, layoutId, projectName } = t0;
817
901
  let t1;
@@ -984,9 +1068,9 @@ const PageSeoEditor = (t0) => {
984
1068
  };
985
1069
  const PageMarkdownModal = (t0) => {
986
1070
  const $ = c(10);
987
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
1071
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
988
1072
  for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
989
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
1073
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
990
1074
  }
991
1075
  const { open, onOpenChange, pageId, metaTitle, metaDescription } = t0;
992
1076
  let t1;
@@ -1029,9 +1113,9 @@ function truncateText(text, maxLen) {
1029
1113
  }
1030
1114
  const SearchEnginePreview = (t0) => {
1031
1115
  const $ = c(17);
1032
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
1116
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
1033
1117
  for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1034
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
1118
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
1035
1119
  }
1036
1120
  const { page, metaTitle, metaDescription } = t0;
1037
1121
  const url = `${typeof window !== "undefined" ? window.location.origin : ""}${page.fullPath}`;
@@ -1114,9 +1198,9 @@ const SearchEnginePreview = (t0) => {
1114
1198
  };
1115
1199
  const SocialPreviewSection = (t0) => {
1116
1200
  const $ = c(60);
1117
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
1201
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
1118
1202
  for (let $i = 0; $i < 60; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1119
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
1203
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
1120
1204
  }
1121
1205
  const { page, metaTitle, metaDescription, layoutId, projectName } = t0;
1122
1206
  const pageMetaTitle = page.metaTitle ?? page.pathSegment;
@@ -1390,9 +1474,9 @@ const SocialPreviewSection = (t0) => {
1390
1474
  };
1391
1475
  const PageMarkdownPreview = (t0) => {
1392
1476
  const $ = c(9);
1393
- if ($[0] !== "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a") {
1477
+ if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
1394
1478
  for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1395
- $[0] = "c39febcc5c5794903cee3680a6ac31c541b522c2ffa947517d81cc13746b8b7a";
1479
+ $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
1396
1480
  }
1397
1481
  const { pageId, metaTitle, metaDescription } = t0;
1398
1482
  let t1;
@@ -1,6 +1,6 @@
1
1
  import { c } from "react/compiler-runtime";
2
- import { Label } from "@camox/ui/label";
3
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { Label } from "@camox/ui/label";
4
4
  import { Select, SelectContent, SelectItem, SelectSeparator, SelectTrigger, SelectValue } from "@camox/ui/select";
5
5
  import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from "@camox/ui/input-group";
6
6
 
@@ -2,25 +2,25 @@ import { useLocation } from "../../navigation/navigation.js";
2
2
  import { actionsStore } from "../../provider/actionsStore.js";
3
3
  import { useProjectSlug } from "../../../lib/auth.js";
4
4
  import { pageMutations } from "../../../lib/queries.js";
5
- import { trackClientEvent } from "../../../lib/telemetry-client.js";
6
5
  import { cn } from "../../../lib/utils.js";
6
+ import { trackClientEvent } from "../../../lib/telemetry-client.js";
7
7
  import { previewStore } from "../previewStore.js";
8
8
  import { pageFullQueryFn } from "../previewQueryFns.js";
9
9
  import { PagePicker } from "./PagePicker.js";
10
10
  import { PageTree } from "./PageTree.js";
11
11
  import { PublishDialog } from "./PublishDialog.js";
12
12
  import { c } from "react/compiler-runtime";
13
- import { Label } from "@camox/ui/label";
14
13
  import { useMutation, useQueryClient } from "@tanstack/react-query";
15
- import { useSelector } from "@xstate/store-react";
16
14
  import * as React from "react";
17
15
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
16
+ import { useSelector } from "@xstate/store-react";
18
17
  import { queryKeys } from "@camox/api-contract/query-keys";
19
- import { toast } from "@camox/ui/toaster";
20
18
  import { Button } from "@camox/ui/button";
21
19
  import { MoreHorizontal } from "lucide-react";
22
20
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
21
+ import { toast } from "@camox/ui/toaster";
23
22
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
23
+ import { Label } from "@camox/ui/label";
24
24
  import { PanelContent, PanelHeader } from "@camox/ui/panel";
25
25
  import { ButtonGroup } from "@camox/ui/button-group";
26
26
  import { Switch } from "@camox/ui/switch";
@@ -1,7 +1,7 @@
1
1
  import { c } from "react/compiler-runtime";
2
- import { Input } from "@camox/ui/input";
3
- import { Label } from "@camox/ui/label";
4
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Label } from "@camox/ui/label";
4
+ import { Input } from "@camox/ui/input";
5
5
 
6
6
  //#region src/features/preview/components/PageNicknameField.tsx
7
7
  const PAGE_NICKNAME_MAX_LENGTH = 80;