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.
- package/dist/components/AuthGate.js +6 -0
- package/dist/core/components/AddBlockControlBar.js +30 -26
- package/dist/core/components/lexical/InlineContentEditable.js +19 -15
- package/dist/core/components/lexical/InlineLexicalEditor.js +62 -42
- package/dist/core/components/lexical/SelectionBroadcaster.js +25 -21
- package/dist/core/components/lexical/SidebarLexicalEditor.js +33 -21
- package/dist/core/createBlock.js +524 -488
- package/dist/core/createLayout.js +40 -28
- package/dist/core/hooks/useFieldSelection.js +12 -8
- package/dist/core/hooks/useIsEditable.js +6 -0
- package/dist/core/hooks/useOverlayMessage.js +19 -15
- package/dist/core/lib/contentType.d.ts +8 -8
- package/dist/core/lib/contentType.js +63 -0
- package/dist/features/content/CamoxContent.js +92 -88
- package/dist/features/content/components/AssetCard.js +46 -42
- package/dist/features/content/components/AssetCardSkeleton.js +8 -4
- package/dist/features/content/components/ContentSidebar.js +8 -4
- package/dist/features/content/components/UploadDropZone.js +31 -27
- package/dist/features/content/components/UploadProgressDrawer.js +98 -90
- package/dist/features/preview/CamoxPreview.js +162 -146
- package/dist/features/preview/components/AddBlockSheet.js +105 -101
- package/dist/features/preview/components/AgentChatSheet.js +74 -21
- package/dist/features/preview/components/AssetFieldEditor.js +98 -90
- package/dist/features/preview/components/AssetLightbox.js +21 -17
- package/dist/features/preview/components/AssetPickerGrid.js +84 -80
- package/dist/features/preview/components/BlockActionsPopover.js +35 -31
- package/dist/features/preview/components/BlockErrorBoundary.js +12 -8
- package/dist/features/preview/components/CreatePageModal.js +1 -1
- package/dist/features/preview/components/DebouncedFieldEditor.js +41 -37
- package/dist/features/preview/components/EditPageModal.js +114 -98
- package/dist/features/preview/components/FieldOverlayStyles.js +8 -4
- package/dist/features/preview/components/FieldToolbar.js +95 -54
- package/dist/features/preview/components/Frame.js +50 -46
- package/dist/features/preview/components/ItemFieldsEditor.js +81 -79
- package/dist/features/preview/components/LinkFieldEditor.js +138 -134
- package/dist/features/preview/components/MultipleAssetFieldEditor.js +105 -97
- package/dist/features/preview/components/OverlayTracker.js +19 -15
- package/dist/features/preview/components/Overlays.js +27 -23
- package/dist/features/preview/components/PageContentSheet.js +54 -4
- package/dist/features/preview/components/PageLocationFieldset.js +113 -109
- package/dist/features/preview/components/PagePicker.js +1 -1
- package/dist/features/preview/components/PageTree.js +443 -399
- package/dist/features/preview/components/PeekedBlock.js +69 -65
- package/dist/features/preview/components/PreviewPanel.js +64 -52
- package/dist/features/preview/components/PreviewSideSheet.js +25 -16
- package/dist/features/preview/components/PreviewToolbar.js +127 -123
- package/dist/features/preview/components/RepeatableItemsList.js +176 -171
- package/dist/features/preview/components/ShikiMarkdown.js +18 -14
- package/dist/features/preview/components/UnlinkAssetButton.js +74 -70
- package/dist/features/preview/components/useRepeatableItemActions.js +266 -0
- package/dist/features/preview/components/useUpdateBlockPosition.js +13 -9
- package/dist/features/provider/CamoxProvider.js +60 -52
- package/dist/features/provider/components/CamoxAppContext.js +10 -6
- package/dist/features/provider/components/CommandPalette.js +77 -69
- package/dist/features/provider/useAdminShortcuts.js +11 -7
- package/dist/features/routes/pageRoute.js +8 -4
- package/dist/features/studio/CamoxStudio.js +23 -19
- package/dist/features/studio/components/EnvironmentMenu.js +32 -28
- package/dist/features/studio/components/Navbar.js +62 -54
- package/dist/features/studio/components/ProjectMenu.js +131 -123
- package/dist/features/studio/components/UserButton.js +15 -11
- package/dist/features/studio/useTheme.js +82 -42
- package/dist/features/vite/definitionsSync.js +5 -5
- package/dist/features/vite/skillGeneration.js +43 -8
- package/dist/features/vite/vite.d.ts +1 -1
- package/dist/features/vite/vite.js +20 -2
- package/dist/hooks/use-marquee-selection.js +36 -32
- package/dist/lib/auth.js +49 -22
- package/dist/lib/normalized-data.js +55 -47
- package/dist/lib/use-project-room.js +22 -18
- package/dist/studio.css +1 -1
- package/package.json +10 -11
- package/skills/camox-block/SKILL.md +4 -0
- package/skills/camox-cli/SKILL.md +142 -0
- 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-
|
|
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(
|
|
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 ($[
|
|
286
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
283
287
|
t0 = blockMutations.delete();
|
|
284
|
-
$[
|
|
285
|
-
} else t0 = $[
|
|
288
|
+
$[1] = t0;
|
|
289
|
+
} else t0 = $[1];
|
|
286
290
|
const deleteBlockMutation = useMutation(t0);
|
|
287
291
|
let t1;
|
|
288
|
-
if ($[
|
|
292
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
289
293
|
t1 = blockMutations.duplicate();
|
|
290
|
-
$[
|
|
291
|
-
} else t1 = $[
|
|
294
|
+
$[2] = t1;
|
|
295
|
+
} else t1 = $[2];
|
|
292
296
|
const duplicateBlockMutation = useMutation(t1);
|
|
293
297
|
const updatePositionMutation = useUpdateBlockPosition();
|
|
294
298
|
let t2;
|
|
295
|
-
if ($[
|
|
299
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
296
300
|
t2 = repeatableItemMutations.delete();
|
|
297
|
-
$[
|
|
298
|
-
} else t2 = $[
|
|
301
|
+
$[3] = t2;
|
|
302
|
+
} else t2 = $[3];
|
|
299
303
|
const deleteRepeatableItem = useMutation(t2);
|
|
300
304
|
let t3;
|
|
301
|
-
if ($[
|
|
305
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
302
306
|
t3 = repeatableItemMutations.duplicate();
|
|
303
|
-
$[
|
|
304
|
-
} else t3 = $[
|
|
307
|
+
$[4] = t3;
|
|
308
|
+
} else t3 = $[4];
|
|
305
309
|
const duplicateRepeatableItem = useMutation(t3);
|
|
306
310
|
let t4;
|
|
307
|
-
if ($[
|
|
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
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
$[
|
|
494
|
-
$[
|
|
495
|
-
$[
|
|
496
|
-
$[
|
|
497
|
-
$[
|
|
498
|
-
} else t4 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
508
|
-
$[
|
|
509
|
-
$[
|
|
510
|
-
$[
|
|
511
|
-
$[
|
|
512
|
-
} else t5 = $[
|
|
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(
|
|
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 ($[
|
|
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
|
-
$[
|
|
50
|
-
$[
|
|
51
|
-
$[
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
} else t1 = $[
|
|
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(
|
|
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 ($[
|
|
21
|
+
if ($[1] !== initialValue) {
|
|
18
22
|
t1 = () => {
|
|
19
23
|
setValue(initialValue);
|
|
20
24
|
};
|
|
21
25
|
t2 = [initialValue];
|
|
22
|
-
$[
|
|
23
|
-
$[
|
|
24
|
-
$[
|
|
26
|
+
$[1] = initialValue;
|
|
27
|
+
$[2] = t1;
|
|
28
|
+
$[3] = t2;
|
|
25
29
|
} else {
|
|
26
|
-
t1 = $[
|
|
27
|
-
t2 = $[
|
|
30
|
+
t1 = $[2];
|
|
31
|
+
t2 = $[3];
|
|
28
32
|
}
|
|
29
33
|
React.useEffect(t1, t2);
|
|
30
34
|
let t3;
|
|
31
|
-
if ($[
|
|
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
|
-
$[
|
|
42
|
-
$[
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
45
|
-
} else t3 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
55
|
-
$[
|
|
58
|
+
$[8] = t4;
|
|
59
|
+
$[9] = t5;
|
|
56
60
|
} else {
|
|
57
|
-
t4 = $[
|
|
58
|
-
t5 = $[
|
|
61
|
+
t4 = $[8];
|
|
62
|
+
t5 = $[9];
|
|
59
63
|
}
|
|
60
64
|
React.useEffect(t4, t5);
|
|
61
65
|
let t6;
|
|
62
|
-
if ($[
|
|
66
|
+
if ($[10] !== inputId || $[11] !== label) {
|
|
63
67
|
t6 = /* @__PURE__ */ jsx(Label, {
|
|
64
68
|
htmlFor: inputId,
|
|
65
69
|
children: label
|
|
66
70
|
});
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
70
|
-
} else t6 = $[
|
|
71
|
+
$[10] = inputId;
|
|
72
|
+
$[11] = label;
|
|
73
|
+
$[12] = t6;
|
|
74
|
+
} else t6 = $[12];
|
|
71
75
|
let t7;
|
|
72
|
-
if ($[
|
|
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
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
} else t7 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
} else t8 = $[
|
|
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(
|
|
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 ($[
|
|
37
|
+
if ($[1] !== editingPageId) {
|
|
34
38
|
t0 = /* @__PURE__ */ jsx(EditPageModalContent, { pageId: editingPageId });
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
37
|
-
} else t0 = $[
|
|
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(
|
|
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 ($[
|
|
305
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
298
306
|
t1 = /* @__PURE__ */ jsx(Label, { children: "Search engine preview" });
|
|
299
|
-
$[
|
|
300
|
-
} else t1 = $[
|
|
307
|
+
$[1] = t1;
|
|
308
|
+
} else t1 = $[1];
|
|
301
309
|
let t2;
|
|
302
|
-
if ($[
|
|
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
|
-
$[
|
|
311
|
-
} else t2 = $[
|
|
318
|
+
$[2] = t2;
|
|
319
|
+
} else t2 = $[2];
|
|
312
320
|
let t3;
|
|
313
|
-
if ($[
|
|
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
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
} else t3 = $[
|
|
326
|
+
$[3] = url;
|
|
327
|
+
$[4] = t3;
|
|
328
|
+
} else t3 = $[4];
|
|
321
329
|
const t4 = metaTitle || "Untitled";
|
|
322
330
|
let t5;
|
|
323
|
-
if ($[
|
|
331
|
+
if ($[5] !== t4) {
|
|
324
332
|
t5 = truncateText(t4, 60);
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
} else t5 = $[
|
|
333
|
+
$[5] = t4;
|
|
334
|
+
$[6] = t5;
|
|
335
|
+
} else t5 = $[6];
|
|
328
336
|
let t6;
|
|
329
|
-
if ($[
|
|
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
|
-
$[
|
|
335
|
-
$[
|
|
336
|
-
} else t6 = $[
|
|
342
|
+
$[7] = t5;
|
|
343
|
+
$[8] = t6;
|
|
344
|
+
} else t6 = $[8];
|
|
337
345
|
const t7 = metaDescription || "No description";
|
|
338
346
|
let t8;
|
|
339
|
-
if ($[
|
|
347
|
+
if ($[9] !== t7) {
|
|
340
348
|
t8 = truncateText(t7, 155);
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
} else t8 = $[
|
|
349
|
+
$[9] = t7;
|
|
350
|
+
$[10] = t8;
|
|
351
|
+
} else t8 = $[10];
|
|
344
352
|
let t9;
|
|
345
|
-
if ($[
|
|
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
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
} else t9 = $[
|
|
358
|
+
$[11] = t8;
|
|
359
|
+
$[12] = t9;
|
|
360
|
+
} else t9 = $[12];
|
|
353
361
|
let t10;
|
|
354
|
-
if ($[
|
|
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
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
} else t10 = $[
|
|
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(
|
|
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 ($[
|
|
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
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
} else t1 = $[
|
|
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 ($[
|
|
406
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
395
407
|
t2 = /* @__PURE__ */ jsx(Label, { children: "Social preview" });
|
|
396
|
-
$[
|
|
397
|
-
} else t2 = $[
|
|
408
|
+
$[6] = t2;
|
|
409
|
+
} else t2 = $[6];
|
|
398
410
|
let t3;
|
|
399
|
-
if ($[
|
|
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
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
} else t3 = $[
|
|
421
|
+
$[7] = ogImage;
|
|
422
|
+
$[8] = t3;
|
|
423
|
+
} else t3 = $[8];
|
|
412
424
|
const t4 = metaTitle || "Untitled";
|
|
413
425
|
let t5;
|
|
414
|
-
if ($[
|
|
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
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
} else t5 = $[
|
|
431
|
+
$[9] = t4;
|
|
432
|
+
$[10] = t5;
|
|
433
|
+
} else t5 = $[10];
|
|
422
434
|
const t6 = metaDescription || "No description";
|
|
423
435
|
let t7;
|
|
424
|
-
if ($[
|
|
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
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
} else t7 = $[
|
|
441
|
+
$[11] = t6;
|
|
442
|
+
$[12] = t7;
|
|
443
|
+
} else t7 = $[12];
|
|
432
444
|
let t8;
|
|
433
|
-
if ($[
|
|
445
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
434
446
|
t8 = /* @__PURE__ */ jsx(Globe, { className: "size-3 shrink-0" });
|
|
435
|
-
$[
|
|
436
|
-
} else t8 = $[
|
|
447
|
+
$[13] = t8;
|
|
448
|
+
} else t8 = $[13];
|
|
437
449
|
let t9;
|
|
438
|
-
if ($[
|
|
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
|
-
$[
|
|
450
|
-
$[
|
|
451
|
-
} else t9 = $[
|
|
461
|
+
$[14] = url;
|
|
462
|
+
$[15] = t9;
|
|
463
|
+
} else t9 = $[15];
|
|
452
464
|
let t10;
|
|
453
|
-
if ($[
|
|
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
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
} else t10 = $[
|
|
474
|
+
$[16] = t5;
|
|
475
|
+
$[17] = t7;
|
|
476
|
+
$[18] = t9;
|
|
477
|
+
$[19] = t10;
|
|
478
|
+
} else t10 = $[19];
|
|
467
479
|
let t11;
|
|
468
|
-
if ($[
|
|
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
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
} else t11 = $[
|
|
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(
|
|
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 ($[
|
|
502
|
+
if ($[1] !== pageId) {
|
|
487
503
|
t1 = blockQueries.getPageMarkdown(pageId);
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
} else t1 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
500
|
-
} else t2 = $[
|
|
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 ($[
|
|
522
|
+
if ($[4] !== t2 || $[5] !== t3) {
|
|
507
523
|
frontmatterLines = [
|
|
508
524
|
"---",
|
|
509
525
|
t2,
|
|
510
526
|
t3
|
|
511
527
|
];
|
|
512
528
|
frontmatterLines.push("---");
|
|
513
|
-
$[
|
|
514
|
-
$[
|
|
515
|
-
$[
|
|
516
|
-
} else frontmatterLines = $[
|
|
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 ($[
|
|
535
|
+
if ($[7] !== fullMarkdown) {
|
|
520
536
|
t4 = /* @__PURE__ */ jsx(ShikiMarkdown, { code: fullMarkdown });
|
|
521
|
-
$[
|
|
522
|
-
$[
|
|
523
|
-
} else t4 = $[
|
|
537
|
+
$[7] = fullMarkdown;
|
|
538
|
+
$[8] = t4;
|
|
539
|
+
} else t4 = $[8];
|
|
524
540
|
return t4;
|
|
525
541
|
};
|
|
526
542
|
function _temp(state) {
|