camox 0.14.2 → 0.16.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 (75) hide show
  1. package/dist/components/AuthGate.js +6 -0
  2. package/dist/core/components/AddBlockControlBar.js +30 -26
  3. package/dist/core/components/lexical/InlineContentEditable.js +19 -15
  4. package/dist/core/components/lexical/InlineLexicalEditor.js +62 -42
  5. package/dist/core/components/lexical/SelectionBroadcaster.js +25 -21
  6. package/dist/core/components/lexical/SidebarLexicalEditor.js +33 -21
  7. package/dist/core/createBlock.js +524 -488
  8. package/dist/core/createLayout.js +40 -28
  9. package/dist/core/hooks/useFieldSelection.js +12 -8
  10. package/dist/core/hooks/useIsEditable.js +6 -0
  11. package/dist/core/hooks/useOverlayMessage.js +19 -15
  12. package/dist/core/lib/contentType.d.ts +8 -8
  13. package/dist/core/lib/contentType.js +63 -0
  14. package/dist/features/content/CamoxContent.js +92 -88
  15. package/dist/features/content/components/AssetCard.js +46 -42
  16. package/dist/features/content/components/AssetCardSkeleton.js +8 -4
  17. package/dist/features/content/components/ContentSidebar.js +8 -4
  18. package/dist/features/content/components/UploadDropZone.js +31 -27
  19. package/dist/features/content/components/UploadProgressDrawer.js +98 -90
  20. package/dist/features/preview/CamoxPreview.js +162 -146
  21. package/dist/features/preview/components/AddBlockSheet.js +105 -101
  22. package/dist/features/preview/components/AgentChatSheet.js +74 -21
  23. package/dist/features/preview/components/AssetFieldEditor.js +98 -90
  24. package/dist/features/preview/components/AssetLightbox.js +21 -17
  25. package/dist/features/preview/components/AssetPickerGrid.js +84 -80
  26. package/dist/features/preview/components/BlockActionsPopover.js +35 -31
  27. package/dist/features/preview/components/BlockErrorBoundary.js +12 -8
  28. package/dist/features/preview/components/CreatePageModal.js +1 -1
  29. package/dist/features/preview/components/DebouncedFieldEditor.js +41 -37
  30. package/dist/features/preview/components/EditPageModal.js +114 -98
  31. package/dist/features/preview/components/FieldOverlayStyles.js +8 -4
  32. package/dist/features/preview/components/FieldToolbar.js +95 -54
  33. package/dist/features/preview/components/Frame.js +50 -46
  34. package/dist/features/preview/components/ItemFieldsEditor.js +81 -79
  35. package/dist/features/preview/components/LinkFieldEditor.js +138 -134
  36. package/dist/features/preview/components/MultipleAssetFieldEditor.js +105 -97
  37. package/dist/features/preview/components/OverlayTracker.js +19 -15
  38. package/dist/features/preview/components/Overlays.js +27 -23
  39. package/dist/features/preview/components/PageContentSheet.js +54 -4
  40. package/dist/features/preview/components/PageLocationFieldset.js +113 -109
  41. package/dist/features/preview/components/PagePicker.js +1 -1
  42. package/dist/features/preview/components/PageTree.js +443 -399
  43. package/dist/features/preview/components/PeekedBlock.js +69 -65
  44. package/dist/features/preview/components/PreviewPanel.js +64 -52
  45. package/dist/features/preview/components/PreviewSideSheet.js +25 -16
  46. package/dist/features/preview/components/PreviewToolbar.js +127 -123
  47. package/dist/features/preview/components/RepeatableItemsList.js +176 -171
  48. package/dist/features/preview/components/ShikiMarkdown.js +18 -14
  49. package/dist/features/preview/components/UnlinkAssetButton.js +74 -70
  50. package/dist/features/preview/components/useRepeatableItemActions.js +266 -0
  51. package/dist/features/preview/components/useUpdateBlockPosition.js +13 -9
  52. package/dist/features/provider/CamoxProvider.js +60 -52
  53. package/dist/features/provider/components/CamoxAppContext.js +10 -6
  54. package/dist/features/provider/components/CommandPalette.js +77 -69
  55. package/dist/features/provider/useAdminShortcuts.js +11 -7
  56. package/dist/features/routes/pageRoute.js +8 -4
  57. package/dist/features/studio/CamoxStudio.js +23 -19
  58. package/dist/features/studio/components/EnvironmentMenu.js +32 -28
  59. package/dist/features/studio/components/Navbar.js +62 -54
  60. package/dist/features/studio/components/ProjectMenu.js +131 -123
  61. package/dist/features/studio/components/UserButton.js +15 -11
  62. package/dist/features/studio/useTheme.js +82 -42
  63. package/dist/features/vite/definitionsSync.js +5 -5
  64. package/dist/features/vite/skillGeneration.js +43 -8
  65. package/dist/features/vite/vite.d.ts +1 -1
  66. package/dist/features/vite/vite.js +20 -2
  67. package/dist/hooks/use-marquee-selection.js +36 -32
  68. package/dist/lib/auth.js +49 -22
  69. package/dist/lib/normalized-data.js +55 -47
  70. package/dist/lib/use-project-room.js +22 -18
  71. package/dist/studio.css +1 -1
  72. package/package.json +10 -11
  73. package/skills/camox-block/SKILL.md +4 -0
  74. package/skills/camox-cli/SKILL.md +142 -0
  75. package/skills/camox-layout/SKILL.md +4 -0
@@ -106,7 +106,7 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
106
106
  open,
107
107
  onOpenChange,
108
108
  children: [/* @__PURE__ */ jsx(PopoverTrigger, { render: children }), block && /* @__PURE__ */ jsx(PopoverContent, {
109
- className: "w-[300px] p-0",
109
+ className: "w-75 p-0",
110
110
  align,
111
111
  children: /* @__PURE__ */ jsxs(Command, { children: [/* @__PURE__ */ jsx(CommandInput, { placeholder: "Search actions..." }), /* @__PURE__ */ jsxs(CommandList, {
112
112
  className: "max-h-[350px]",
@@ -273,38 +273,42 @@ function isLayoutBlockId(page, blockId) {
273
273
  return new Set([...page.layout.beforeBlockIds, ...page.layout.afterBlockIds]).has(blockId);
274
274
  }
275
275
  function useBlockActionsShortcuts() {
276
- const $ = c(17);
276
+ const $ = c(18);
277
+ if ($[0] !== "edee2d7123f81b464c0b1cec28a52c9aa9b1c4261474768afd9814e2b358f423") {
278
+ for (let $i = 0; $i < 18; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
279
+ $[0] = "edee2d7123f81b464c0b1cec28a52c9aa9b1c4261474768afd9814e2b358f423";
280
+ }
277
281
  const camoxApp = useCamoxApp();
278
282
  const page = usePreviewedPage();
279
283
  const { pageBlocks } = usePageBlocks(page);
280
284
  const selection = useSelector(previewStore, _temp);
281
285
  let t0;
282
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
286
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
283
287
  t0 = blockMutations.delete();
284
- $[0] = t0;
285
- } else t0 = $[0];
288
+ $[1] = t0;
289
+ } else t0 = $[1];
286
290
  const deleteBlockMutation = useMutation(t0);
287
291
  let t1;
288
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
292
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
289
293
  t1 = blockMutations.duplicate();
290
- $[1] = t1;
291
- } else t1 = $[1];
294
+ $[2] = t1;
295
+ } else t1 = $[2];
292
296
  const duplicateBlockMutation = useMutation(t1);
293
297
  const updatePositionMutation = useUpdateBlockPosition();
294
298
  let t2;
295
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
299
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
296
300
  t2 = repeatableItemMutations.delete();
297
- $[2] = t2;
298
- } else t2 = $[2];
301
+ $[3] = t2;
302
+ } else t2 = $[3];
299
303
  const deleteRepeatableItem = useMutation(t2);
300
304
  let t3;
301
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
305
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
302
306
  t3 = repeatableItemMutations.duplicate();
303
- $[3] = t3;
304
- } else t3 = $[3];
307
+ $[4] = t3;
308
+ } else t3 = $[4];
305
309
  const duplicateRepeatableItem = useMutation(t3);
306
310
  let t4;
307
- if ($[4] !== deleteBlockMutation || $[5] !== deleteRepeatableItem || $[6] !== duplicateBlockMutation || $[7] !== duplicateRepeatableItem || $[8] !== page || $[9] !== pageBlocks || $[10] !== updatePositionMutation) {
311
+ if ($[5] !== deleteBlockMutation || $[6] !== deleteRepeatableItem || $[7] !== duplicateBlockMutation || $[8] !== duplicateRepeatableItem || $[9] !== page || $[10] !== pageBlocks || $[11] !== updatePositionMutation) {
308
312
  t4 = () => {
309
313
  const actions = [
310
314
  {
@@ -487,29 +491,29 @@ function useBlockActionsShortcuts() {
487
491
  });
488
492
  };
489
493
  };
490
- $[4] = deleteBlockMutation;
491
- $[5] = deleteRepeatableItem;
492
- $[6] = duplicateBlockMutation;
493
- $[7] = duplicateRepeatableItem;
494
- $[8] = page;
495
- $[9] = pageBlocks;
496
- $[10] = updatePositionMutation;
497
- $[11] = t4;
498
- } else t4 = $[11];
494
+ $[5] = deleteBlockMutation;
495
+ $[6] = deleteRepeatableItem;
496
+ $[7] = duplicateBlockMutation;
497
+ $[8] = duplicateRepeatableItem;
498
+ $[9] = page;
499
+ $[10] = pageBlocks;
500
+ $[11] = updatePositionMutation;
501
+ $[12] = t4;
502
+ } else t4 = $[12];
499
503
  let t5;
500
- if ($[12] !== camoxApp || $[13] !== page || $[14] !== pageBlocks || $[15] !== selection) {
504
+ if ($[13] !== camoxApp || $[14] !== page || $[15] !== pageBlocks || $[16] !== selection) {
501
505
  t5 = [
502
506
  selection,
503
507
  page,
504
508
  pageBlocks,
505
509
  camoxApp
506
510
  ];
507
- $[12] = camoxApp;
508
- $[13] = page;
509
- $[14] = pageBlocks;
510
- $[15] = selection;
511
- $[16] = t5;
512
- } else t5 = $[16];
511
+ $[13] = camoxApp;
512
+ $[14] = page;
513
+ $[15] = pageBlocks;
514
+ $[16] = selection;
515
+ $[17] = t5;
516
+ } else t5 = $[17];
513
517
  React.useEffect(t4, t5);
514
518
  }
515
519
  function _temp12(a) {
@@ -35,23 +35,27 @@ var BlockErrorBoundaryInner = class extends React.Component {
35
35
  }
36
36
  };
37
37
  const BlockErrorBoundary = (t0) => {
38
- const $ = c(5);
38
+ const $ = c(6);
39
+ if ($[0] !== "46b0d65b4c2052002160e1a82931512b726f6f897f121eb303d9f5030172ca60") {
40
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
41
+ $[0] = "46b0d65b4c2052002160e1a82931512b726f6f897f121eb303d9f5030172ca60";
42
+ }
39
43
  const { blockId, blockType, children } = t0;
40
44
  const isAuthenticated = useIsAuthenticated();
41
45
  let t1;
42
- if ($[0] !== blockId || $[1] !== blockType || $[2] !== children || $[3] !== isAuthenticated) {
46
+ if ($[1] !== blockId || $[2] !== blockType || $[3] !== children || $[4] !== isAuthenticated) {
43
47
  t1 = /* @__PURE__ */ jsx(BlockErrorBoundaryInner, {
44
48
  blockId,
45
49
  blockType,
46
50
  isAuthenticated,
47
51
  children
48
52
  });
49
- $[0] = blockId;
50
- $[1] = blockType;
51
- $[2] = children;
52
- $[3] = isAuthenticated;
53
- $[4] = t1;
54
- } else t1 = $[4];
53
+ $[1] = blockId;
54
+ $[2] = blockType;
55
+ $[3] = children;
56
+ $[4] = isAuthenticated;
57
+ $[5] = t1;
58
+ } else t1 = $[5];
55
59
  return t1;
56
60
  };
57
61
 
@@ -69,7 +69,7 @@ const CreatePageModal = () => {
69
69
  previewStore.send({ type: "closeCreatePageModal" });
70
70
  form.reset();
71
71
  await new Promise((resolve) => setTimeout(resolve, 50));
72
- navigate({ to: fullPath });
72
+ await navigate({ to: fullPath });
73
73
  } catch (error) {
74
74
  console.error("Failed to create page:", error);
75
75
  toast.error("Could not create page");
@@ -7,28 +7,32 @@ import { Textarea } from "@camox/ui/textarea";
7
7
 
8
8
  //#region src/features/preview/components/DebouncedFieldEditor.tsx
9
9
  const DebouncedFieldEditor = (t0) => {
10
- const $ = c(22);
10
+ const $ = c(23);
11
+ if ($[0] !== "b4acdbdf8d2c83fc60b024b0d396faa1ca600b59ef52a07c5cbc6cb95d6648a6") {
12
+ for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
13
+ $[0] = "b4acdbdf8d2c83fc60b024b0d396faa1ca600b59ef52a07c5cbc6cb95d6648a6";
14
+ }
11
15
  const { label, placeholder, initialValue, onSave, disabled, rows } = t0;
12
16
  const [value, setValue] = React.useState(initialValue);
13
17
  const timerRef = React.useRef(null);
14
18
  const inputId = React.useId();
15
19
  let t1;
16
20
  let t2;
17
- if ($[0] !== initialValue) {
21
+ if ($[1] !== initialValue) {
18
22
  t1 = () => {
19
23
  setValue(initialValue);
20
24
  };
21
25
  t2 = [initialValue];
22
- $[0] = initialValue;
23
- $[1] = t1;
24
- $[2] = t2;
26
+ $[1] = initialValue;
27
+ $[2] = t1;
28
+ $[3] = t2;
25
29
  } else {
26
- t1 = $[1];
27
- t2 = $[2];
30
+ t1 = $[2];
31
+ t2 = $[3];
28
32
  }
29
33
  React.useEffect(t1, t2);
30
34
  let t3;
31
- if ($[3] !== disabled || $[4] !== onSave || $[5] !== rows) {
35
+ if ($[4] !== disabled || $[5] !== onSave || $[6] !== rows) {
32
36
  t3 = (newValue) => {
33
37
  if (disabled) return;
34
38
  if (rows) newValue = newValue.replace(/\n/g, " ");
@@ -38,38 +42,38 @@ const DebouncedFieldEditor = (t0) => {
38
42
  onSave(newValue);
39
43
  }, 500);
40
44
  };
41
- $[3] = disabled;
42
- $[4] = onSave;
43
- $[5] = rows;
44
- $[6] = t3;
45
- } else t3 = $[6];
45
+ $[4] = disabled;
46
+ $[5] = onSave;
47
+ $[6] = rows;
48
+ $[7] = t3;
49
+ } else t3 = $[7];
46
50
  const handleChange = t3;
47
51
  let t4;
48
52
  let t5;
49
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
53
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
50
54
  t4 = () => () => {
51
55
  if (timerRef.current) clearTimeout(timerRef.current);
52
56
  };
53
57
  t5 = [];
54
- $[7] = t4;
55
- $[8] = t5;
58
+ $[8] = t4;
59
+ $[9] = t5;
56
60
  } else {
57
- t4 = $[7];
58
- t5 = $[8];
61
+ t4 = $[8];
62
+ t5 = $[9];
59
63
  }
60
64
  React.useEffect(t4, t5);
61
65
  let t6;
62
- if ($[9] !== inputId || $[10] !== label) {
66
+ if ($[10] !== inputId || $[11] !== label) {
63
67
  t6 = /* @__PURE__ */ jsx(Label, {
64
68
  htmlFor: inputId,
65
69
  children: label
66
70
  });
67
- $[9] = inputId;
68
- $[10] = label;
69
- $[11] = t6;
70
- } else t6 = $[11];
71
+ $[10] = inputId;
72
+ $[11] = label;
73
+ $[12] = t6;
74
+ } else t6 = $[12];
71
75
  let t7;
72
- if ($[12] !== disabled || $[13] !== handleChange || $[14] !== inputId || $[15] !== placeholder || $[16] !== rows || $[17] !== value) {
76
+ if ($[13] !== disabled || $[14] !== handleChange || $[15] !== inputId || $[16] !== placeholder || $[17] !== rows || $[18] !== value) {
73
77
  t7 = rows ? /* @__PURE__ */ jsx(Textarea, {
74
78
  id: inputId,
75
79
  value,
@@ -85,24 +89,24 @@ const DebouncedFieldEditor = (t0) => {
85
89
  placeholder,
86
90
  disabled
87
91
  });
88
- $[12] = disabled;
89
- $[13] = handleChange;
90
- $[14] = inputId;
91
- $[15] = placeholder;
92
- $[16] = rows;
93
- $[17] = value;
94
- $[18] = t7;
95
- } else t7 = $[18];
92
+ $[13] = disabled;
93
+ $[14] = handleChange;
94
+ $[15] = inputId;
95
+ $[16] = placeholder;
96
+ $[17] = rows;
97
+ $[18] = value;
98
+ $[19] = t7;
99
+ } else t7 = $[19];
96
100
  let t8;
97
- if ($[19] !== t6 || $[20] !== t7) {
101
+ if ($[20] !== t6 || $[21] !== t7) {
98
102
  t8 = /* @__PURE__ */ jsxs("div", {
99
103
  className: "space-y-2",
100
104
  children: [t6, t7]
101
105
  });
102
- $[19] = t6;
103
- $[20] = t7;
104
- $[21] = t8;
105
- } else t8 = $[21];
106
+ $[20] = t6;
107
+ $[21] = t7;
108
+ $[22] = t8;
109
+ } else t8 = $[22];
106
110
  return t8;
107
111
  };
108
112
 
@@ -18,23 +18,27 @@ import { jsx, jsxs } from "react/jsx-runtime";
18
18
  import { Button } from "@camox/ui/button";
19
19
  import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
20
20
  import { Globe, Info } from "lucide-react";
21
+ import { Alert, AlertDescription, AlertTitle } from "@camox/ui/alert";
21
22
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@camox/ui/dialog";
22
23
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
23
24
  import { Spinner } from "@camox/ui/spinner";
24
25
  import { useForm } from "@tanstack/react-form";
25
- import { Alert, AlertDescription, AlertTitle } from "@camox/ui/alert";
26
26
  import { Switch } from "@camox/ui/switch";
27
27
 
28
28
  //#region src/features/preview/components/EditPageModal.tsx
29
29
  const EditPageModal = () => {
30
- const $ = c(2);
30
+ const $ = c(3);
31
+ if ($[0] !== "69956dc2b232fcf36a8d4353e168ac320ab4c391d3537ad8e7c23206d94a345a") {
32
+ for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
33
+ $[0] = "69956dc2b232fcf36a8d4353e168ac320ab4c391d3537ad8e7c23206d94a345a";
34
+ }
31
35
  const editingPageId = useSelector(previewStore, _temp);
32
36
  let t0;
33
- if ($[0] !== editingPageId) {
37
+ if ($[1] !== editingPageId) {
34
38
  t0 = /* @__PURE__ */ jsx(EditPageModalContent, { pageId: editingPageId });
35
- $[0] = editingPageId;
36
- $[1] = t0;
37
- } else t0 = $[1];
39
+ $[1] = editingPageId;
40
+ $[2] = t0;
41
+ } else t0 = $[2];
38
42
  return t0;
39
43
  };
40
44
  const EditPageModalContent = ({ pageId }) => {
@@ -89,7 +93,7 @@ const EditPageModalContent = ({ pageId }) => {
89
93
  toast.success(`Updated ${displayName} page`);
90
94
  previewStore.send({ type: "closeEditPageModal" });
91
95
  form.reset();
92
- navigate({ to: fullPath });
96
+ await navigate({ to: fullPath });
93
97
  } catch (error) {
94
98
  console.error("Failed to update page:", error);
95
99
  toast.error("Could not update page");
@@ -290,16 +294,20 @@ function truncateText(text, maxLen) {
290
294
  return text.slice(0, maxLen) + "...";
291
295
  }
292
296
  const SearchEnginePreview = (t0) => {
293
- const $ = c(16);
297
+ const $ = c(17);
298
+ if ($[0] !== "69956dc2b232fcf36a8d4353e168ac320ab4c391d3537ad8e7c23206d94a345a") {
299
+ for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
300
+ $[0] = "69956dc2b232fcf36a8d4353e168ac320ab4c391d3537ad8e7c23206d94a345a";
301
+ }
294
302
  const { page, metaTitle, metaDescription } = t0;
295
303
  const url = `${typeof window !== "undefined" ? window.location.origin : ""}${page.fullPath}`;
296
304
  let t1;
297
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
305
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
298
306
  t1 = /* @__PURE__ */ jsx(Label, { children: "Search engine preview" });
299
- $[0] = t1;
300
- } else t1 = $[0];
307
+ $[1] = t1;
308
+ } else t1 = $[1];
301
309
  let t2;
302
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
310
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
303
311
  t2 = /* @__PURE__ */ jsxs("div", {
304
312
  className: "flex items-center gap-1.5",
305
313
  children: [t1, /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
@@ -307,51 +315,51 @@ const SearchEnginePreview = (t0) => {
307
315
  render: /* @__PURE__ */ jsx(Info, { className: "text-muted-foreground size-3.5" })
308
316
  }), /* @__PURE__ */ jsx(TooltipContent, { children: "Titles are cropped after 60 characters and descriptions after 155, like on Google Search results." })] })]
309
317
  });
310
- $[1] = t2;
311
- } else t2 = $[1];
318
+ $[2] = t2;
319
+ } else t2 = $[2];
312
320
  let t3;
313
- if ($[2] !== url) {
321
+ if ($[3] !== url) {
314
322
  t3 = /* @__PURE__ */ jsx("p", {
315
323
  className: "text-muted-foreground truncate text-xs",
316
324
  children: url
317
325
  });
318
- $[2] = url;
319
- $[3] = t3;
320
- } else t3 = $[3];
326
+ $[3] = url;
327
+ $[4] = t3;
328
+ } else t3 = $[4];
321
329
  const t4 = metaTitle || "Untitled";
322
330
  let t5;
323
- if ($[4] !== t4) {
331
+ if ($[5] !== t4) {
324
332
  t5 = truncateText(t4, 60);
325
- $[4] = t4;
326
- $[5] = t5;
327
- } else t5 = $[5];
333
+ $[5] = t4;
334
+ $[6] = t5;
335
+ } else t5 = $[6];
328
336
  let t6;
329
- if ($[6] !== t5) {
337
+ if ($[7] !== t5) {
330
338
  t6 = /* @__PURE__ */ jsx("p", {
331
339
  className: "text-base font-medium text-blue-600 dark:text-blue-400",
332
340
  children: t5
333
341
  });
334
- $[6] = t5;
335
- $[7] = t6;
336
- } else t6 = $[7];
342
+ $[7] = t5;
343
+ $[8] = t6;
344
+ } else t6 = $[8];
337
345
  const t7 = metaDescription || "No description";
338
346
  let t8;
339
- if ($[8] !== t7) {
347
+ if ($[9] !== t7) {
340
348
  t8 = truncateText(t7, 155);
341
- $[8] = t7;
342
- $[9] = t8;
343
- } else t8 = $[9];
349
+ $[9] = t7;
350
+ $[10] = t8;
351
+ } else t8 = $[10];
344
352
  let t9;
345
- if ($[10] !== t8) {
353
+ if ($[11] !== t8) {
346
354
  t9 = /* @__PURE__ */ jsx("p", {
347
355
  className: "text-muted-foreground line-clamp-2 text-xs",
348
356
  children: t8
349
357
  });
350
- $[10] = t8;
351
- $[11] = t9;
352
- } else t9 = $[11];
358
+ $[11] = t8;
359
+ $[12] = t9;
360
+ } else t9 = $[12];
353
361
  let t10;
354
- if ($[12] !== t3 || $[13] !== t6 || $[14] !== t9) {
362
+ if ($[13] !== t3 || $[14] !== t6 || $[15] !== t9) {
355
363
  t10 = /* @__PURE__ */ jsxs("div", {
356
364
  className: "space-y-1 pt-2",
357
365
  children: [t2, /* @__PURE__ */ jsxs("div", {
@@ -363,40 +371,44 @@ const SearchEnginePreview = (t0) => {
363
371
  ]
364
372
  })]
365
373
  });
366
- $[12] = t3;
367
- $[13] = t6;
368
- $[14] = t9;
369
- $[15] = t10;
370
- } else t10 = $[15];
374
+ $[13] = t3;
375
+ $[14] = t6;
376
+ $[15] = t9;
377
+ $[16] = t10;
378
+ } else t10 = $[16];
371
379
  return t10;
372
380
  };
373
381
  const SocialPreviewSection = (t0) => {
374
- const $ = c(22);
382
+ const $ = c(23);
383
+ if ($[0] !== "69956dc2b232fcf36a8d4353e168ac320ab4c391d3537ad8e7c23206d94a345a") {
384
+ for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
385
+ $[0] = "69956dc2b232fcf36a8d4353e168ac320ab4c391d3537ad8e7c23206d94a345a";
386
+ }
375
387
  const { page, metaTitle, metaDescription, layoutId, projectName } = t0;
376
388
  const pageMetaTitle = page.metaTitle ?? page.pathSegment;
377
389
  let t1;
378
- if ($[0] !== layoutId || $[1] !== page.metaDescription || $[2] !== pageMetaTitle || $[3] !== projectName) {
390
+ if ($[1] !== layoutId || $[2] !== page.metaDescription || $[3] !== pageMetaTitle || $[4] !== projectName) {
379
391
  t1 = new URLSearchParams({
380
392
  ...layoutId && { layoutId },
381
393
  title: pageMetaTitle,
382
394
  ...page.metaDescription && { description: page.metaDescription },
383
395
  ...projectName && { projectName }
384
396
  }).toString();
385
- $[0] = layoutId;
386
- $[1] = page.metaDescription;
387
- $[2] = pageMetaTitle;
388
- $[3] = projectName;
389
- $[4] = t1;
390
- } else t1 = $[4];
397
+ $[1] = layoutId;
398
+ $[2] = page.metaDescription;
399
+ $[3] = pageMetaTitle;
400
+ $[4] = projectName;
401
+ $[5] = t1;
402
+ } else t1 = $[5];
391
403
  const ogImage = `/og?${t1}`;
392
404
  const url = `${typeof window !== "undefined" ? window.location.origin : ""}${page.fullPath}`;
393
405
  let t2;
394
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
406
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
395
407
  t2 = /* @__PURE__ */ jsx(Label, { children: "Social preview" });
396
- $[5] = t2;
397
- } else t2 = $[5];
408
+ $[6] = t2;
409
+ } else t2 = $[6];
398
410
  let t3;
399
- if ($[6] !== ogImage) {
411
+ if ($[7] !== ogImage) {
400
412
  t3 = ogImage ? /* @__PURE__ */ jsx("img", {
401
413
  src: ogImage,
402
414
  alt: "",
@@ -406,36 +418,36 @@ const SocialPreviewSection = (t0) => {
406
418
  className: "bg-muted w-full",
407
419
  style: { aspectRatio: "1200 / 630" }
408
420
  });
409
- $[6] = ogImage;
410
- $[7] = t3;
411
- } else t3 = $[7];
421
+ $[7] = ogImage;
422
+ $[8] = t3;
423
+ } else t3 = $[8];
412
424
  const t4 = metaTitle || "Untitled";
413
425
  let t5;
414
- if ($[8] !== t4) {
426
+ if ($[9] !== t4) {
415
427
  t5 = /* @__PURE__ */ jsx("p", {
416
428
  className: "text-foreground truncate text-sm font-semibold",
417
429
  children: t4
418
430
  });
419
- $[8] = t4;
420
- $[9] = t5;
421
- } else t5 = $[9];
431
+ $[9] = t4;
432
+ $[10] = t5;
433
+ } else t5 = $[10];
422
434
  const t6 = metaDescription || "No description";
423
435
  let t7;
424
- if ($[10] !== t6) {
436
+ if ($[11] !== t6) {
425
437
  t7 = /* @__PURE__ */ jsx("p", {
426
438
  className: "text-muted-foreground line-clamp-2 text-xs",
427
439
  children: t6
428
440
  });
429
- $[10] = t6;
430
- $[11] = t7;
431
- } else t7 = $[11];
441
+ $[11] = t6;
442
+ $[12] = t7;
443
+ } else t7 = $[12];
432
444
  let t8;
433
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
445
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
434
446
  t8 = /* @__PURE__ */ jsx(Globe, { className: "size-3 shrink-0" });
435
- $[12] = t8;
436
- } else t8 = $[12];
447
+ $[13] = t8;
448
+ } else t8 = $[13];
437
449
  let t9;
438
- if ($[13] !== url) {
450
+ if ($[14] !== url) {
439
451
  t9 = /* @__PURE__ */ jsx("div", {
440
452
  className: "pt-1.5",
441
453
  children: /* @__PURE__ */ jsxs("p", {
@@ -446,11 +458,11 @@ const SocialPreviewSection = (t0) => {
446
458
  })]
447
459
  })
448
460
  });
449
- $[13] = url;
450
- $[14] = t9;
451
- } else t9 = $[14];
461
+ $[14] = url;
462
+ $[15] = t9;
463
+ } else t9 = $[15];
452
464
  let t10;
453
- if ($[15] !== t5 || $[16] !== t7 || $[17] !== t9) {
465
+ if ($[16] !== t5 || $[17] !== t7 || $[18] !== t9) {
454
466
  t10 = /* @__PURE__ */ jsxs("div", {
455
467
  className: "space-y-1.5 border-t px-3 py-2.5",
456
468
  children: [
@@ -459,13 +471,13 @@ const SocialPreviewSection = (t0) => {
459
471
  t9
460
472
  ]
461
473
  });
462
- $[15] = t5;
463
- $[16] = t7;
464
- $[17] = t9;
465
- $[18] = t10;
466
- } else t10 = $[18];
474
+ $[16] = t5;
475
+ $[17] = t7;
476
+ $[18] = t9;
477
+ $[19] = t10;
478
+ } else t10 = $[19];
467
479
  let t11;
468
- if ($[19] !== t10 || $[20] !== t3) {
480
+ if ($[20] !== t10 || $[21] !== t3) {
469
481
  t11 = /* @__PURE__ */ jsxs("div", {
470
482
  className: "space-y-2 pt-2",
471
483
  children: [t2, /* @__PURE__ */ jsxs("div", {
@@ -473,54 +485,58 @@ const SocialPreviewSection = (t0) => {
473
485
  children: [t3, t10]
474
486
  })]
475
487
  });
476
- $[19] = t10;
477
- $[20] = t3;
478
- $[21] = t11;
479
- } else t11 = $[21];
488
+ $[20] = t10;
489
+ $[21] = t3;
490
+ $[22] = t11;
491
+ } else t11 = $[22];
480
492
  return t11;
481
493
  };
482
494
  const PageMarkdownPreview = (t0) => {
483
- const $ = c(8);
495
+ const $ = c(9);
496
+ if ($[0] !== "69956dc2b232fcf36a8d4353e168ac320ab4c391d3537ad8e7c23206d94a345a") {
497
+ for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
498
+ $[0] = "69956dc2b232fcf36a8d4353e168ac320ab4c391d3537ad8e7c23206d94a345a";
499
+ }
484
500
  const { pageId, metaTitle, metaDescription } = t0;
485
501
  let t1;
486
- if ($[0] !== pageId) {
502
+ if ($[1] !== pageId) {
487
503
  t1 = blockQueries.getPageMarkdown(pageId);
488
- $[0] = pageId;
489
- $[1] = t1;
490
- } else t1 = $[1];
504
+ $[1] = pageId;
505
+ $[2] = t1;
506
+ } else t1 = $[2];
491
507
  const { data: markdown } = useQuery(t1);
492
508
  if (markdown === void 0) {
493
509
  let t2;
494
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
510
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
495
511
  t2 = /* @__PURE__ */ jsxs("div", {
496
512
  className: "text-muted-foreground flex items-center gap-2 py-2 text-sm",
497
513
  children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), "Loading..."]
498
514
  });
499
- $[2] = t2;
500
- } else t2 = $[2];
515
+ $[3] = t2;
516
+ } else t2 = $[3];
501
517
  return t2;
502
518
  }
503
519
  const t2 = `title: "${metaTitle}"`;
504
520
  const t3 = `description: "${metaDescription}"`;
505
521
  let frontmatterLines;
506
- if ($[3] !== t2 || $[4] !== t3) {
522
+ if ($[4] !== t2 || $[5] !== t3) {
507
523
  frontmatterLines = [
508
524
  "---",
509
525
  t2,
510
526
  t3
511
527
  ];
512
528
  frontmatterLines.push("---");
513
- $[3] = t2;
514
- $[4] = t3;
515
- $[5] = frontmatterLines;
516
- } else frontmatterLines = $[5];
529
+ $[4] = t2;
530
+ $[5] = t3;
531
+ $[6] = frontmatterLines;
532
+ } else frontmatterLines = $[6];
517
533
  const fullMarkdown = frontmatterLines.join("\n") + "\n\n" + (markdown ?? "");
518
534
  let t4;
519
- if ($[6] !== fullMarkdown) {
535
+ if ($[7] !== fullMarkdown) {
520
536
  t4 = /* @__PURE__ */ jsx(ShikiMarkdown, { code: fullMarkdown });
521
- $[6] = fullMarkdown;
522
- $[7] = t4;
523
- } else t4 = $[7];
537
+ $[7] = fullMarkdown;
538
+ $[8] = t4;
539
+ } else t4 = $[8];
524
540
  return t4;
525
541
  };
526
542
  function _temp(state) {