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.
- package/dist/core/components/lexical/{GradientNode.js → HighlightNode.js} +34 -34
- package/dist/core/components/lexical/InlineLexicalEditor.js +14 -14
- package/dist/core/components/lexical/InlineStylesPlugin.js +6 -6
- package/dist/core/components/lexical/SelectionBroadcaster.js +5 -5
- package/dist/core/components/lexical/SidebarLexicalEditor.js +52 -49
- package/dist/core/components/lexical/TextLinkPopover.js +191 -208
- package/dist/core/components/lexical/editorConfig.js +2 -2
- package/dist/core/createApp.d.ts +19 -4
- package/dist/core/createApp.js +2 -1
- package/dist/core/createLayout.d.ts +16 -3
- package/dist/core/createLayout.js +15 -15
- package/dist/core/derivedRoutes.js +1 -1
- package/dist/core/dom.d.ts +17 -0
- package/dist/core/dom.js +22 -0
- package/dist/core/editing/createEditableBlock.d.ts +8 -1
- package/dist/core/editing/createEditableBlock.js +636 -459
- package/dist/core/hooks/useOverlayState.js +11 -0
- package/dist/core/lib/fieldTypes.js +5 -5
- package/dist/core/lib/lexicalReact.js +4 -4
- package/dist/core/lib/lexicalState.js +20 -4
- package/dist/core/lib/modifierFormats.js +1 -1
- package/dist/core/lib/textLinks.js +5 -2
- package/dist/core/lib/textStyles.d.ts +2 -2
- package/dist/core/lib/textStyles.js +6 -11
- package/dist/core/pageDestinations.js +37 -0
- package/dist/features/og/imageResponse.node.js +11 -9
- package/dist/features/preview/CamoxPreview.js +108 -124
- package/dist/features/preview/commentsEnabled.js +8 -0
- package/dist/features/preview/components/AddBlockSidebar.js +80 -90
- package/dist/features/preview/components/AssetLightbox.js +4 -11
- package/dist/features/preview/components/AttachedComments.js +194 -0
- package/dist/features/preview/components/BlockActionsPopover.js +14 -65
- package/dist/features/preview/components/CommentHeader.js +122 -0
- package/dist/features/preview/components/CommentSidebar.js +29 -0
- package/dist/features/preview/components/CommentTargetQuote.js +166 -0
- package/dist/features/preview/components/CreatePageModal.js +4 -10
- package/dist/features/preview/components/DerivedLayoutSidebar.js +45 -26
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +38 -26
- package/dist/features/preview/components/FieldToolbar.js +7 -7
- package/dist/features/preview/components/ItemFieldsEditor.js +275 -204
- package/dist/features/preview/components/LeftSidebar.js +18 -18
- package/dist/features/preview/components/LinkFieldEditor.js +212 -209
- package/dist/features/preview/components/OverlayTracker.js +14 -20
- package/dist/features/preview/components/Overlays.js +26 -35
- package/dist/features/preview/components/PageEditorSidebar.js +90 -91
- package/dist/features/preview/components/PageInfoSidebar.js +128 -159
- package/dist/features/preview/components/PagePicker.js +29 -24
- package/dist/features/preview/components/PageTree.js +159 -157
- package/dist/features/preview/components/PreviewComments.js +56 -0
- package/dist/features/preview/components/PreviewPanel.js +122 -78
- package/dist/features/preview/components/PreviewToolbar.js +280 -231
- package/dist/features/preview/components/PublicationRow.js +8 -11
- package/dist/features/preview/components/RightSidebar.js +14 -11
- package/dist/features/preview/components/SidebarSection.js +121 -0
- package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
- package/dist/features/preview/previewCommentsStore.js +115 -0
- package/dist/features/preview/previewSelection.js +75 -0
- package/dist/features/preview/previewStore.js +19 -39
- package/dist/features/preview/publication.js +10 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +46 -34
- package/dist/features/provider/CoreCamoxProvider.js +1 -1
- package/dist/features/provider/components/CommandPalette.js +142 -58
- package/dist/features/provider/useAdminShortcuts.js +19 -8
- package/dist/features/routes/pageRuntime.js +0 -6
- package/dist/features/runtime/RuntimeChrome.js +40 -37
- package/dist/features/runtime/runtime.js +20 -21
- package/dist/features/studio/CamoxStudio.js +30 -50
- package/dist/features/studio/components/EnvironmentMenu.js +3 -2
- package/dist/features/studio/components/Navbar.js +53 -80
- package/dist/features/vite/layoutGeneration.js +7 -3
- package/dist/features/vite/runtimeDev.js +4 -1
- package/dist/features/vite/vite.d.ts +3 -2
- package/dist/features/vite/vite.js +14 -6
- package/dist/hooks/use-file-upload.js +0 -2
- package/dist/hooks/use-page-destinations.js +53 -0
- package/dist/lib/auth.js +11 -14
- package/dist/lib/server-auth-cookie.js +21 -0
- package/dist/studio.css +1 -1
- package/package.json +9 -7
- package/skills/camox/SKILL.md +32 -9
- package/skills/camox/references/block-definitions.md +84 -290
- package/skills/camox/references/cli-common.md +2 -4
- package/skills/camox/references/cli-content.md +147 -0
- package/skills/camox/references/cli-environments.md +1 -1
- package/skills/camox/references/dom-integrations.md +93 -0
- package/skills/camox/references/field-styling.md +50 -0
- package/skills/camox/references/layout-definitions.md +33 -147
- package/skills/camox/references/routed-layouts.md +71 -0
- package/skills/camoxify/SKILL.md +52 -0
- package/dist/lib/telemetry-client.js +0 -66
- package/dist/lib/telemetry.js +0 -26
- package/skills/camox/references/cli-blocks.md +0 -78
- package/skills/camox/references/cli-pages.md +0 -53
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { useNavigate } from "../../navigation/navigation.js";
|
|
2
2
|
import { useProjectSlug } from "../../../lib/auth.js";
|
|
3
|
+
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
3
4
|
import { blockQueries, layoutQueries, pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
|
|
4
5
|
import { cn } from "../../../lib/utils.js";
|
|
5
|
-
import {
|
|
6
|
-
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
6
|
+
import { areCommentsEnabled } from "../commentsEnabled.js";
|
|
7
7
|
import { PageLocationFieldset } from "./PageLocationFieldset.js";
|
|
8
8
|
import { PageNicknameField } from "./PageNicknameField.js";
|
|
9
9
|
import { UploadDropZone } from "../../content/components/UploadDropZone.js";
|
|
10
10
|
import { useDebouncedField } from "../../../hooks/use-debounced-field.js";
|
|
11
11
|
import { DebouncedFieldEditor } from "./DebouncedFieldEditor.js";
|
|
12
12
|
import { Metadata, MetadataRow, formatRelativeTime } from "./Metadata.js";
|
|
13
|
+
import { AttachedComments } from "./AttachedComments.js";
|
|
13
14
|
import { ShikiMarkdown } from "./ShikiMarkdown.js";
|
|
14
15
|
import { c } from "react/compiler-runtime";
|
|
15
16
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
@@ -32,9 +33,9 @@ import { Switch } from "@camox/ui/switch";
|
|
|
32
33
|
//#region src/features/preview/components/PageInfoSidebar.tsx
|
|
33
34
|
const usePageMetadataData = (pageId) => {
|
|
34
35
|
const $ = c(32);
|
|
35
|
-
if ($[0] !== "
|
|
36
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
36
37
|
for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
37
|
-
$[0] = "
|
|
38
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
38
39
|
}
|
|
39
40
|
const projectSlug = useProjectSlug();
|
|
40
41
|
const camoxApp = useCamoxApp();
|
|
@@ -90,7 +91,7 @@ const usePageMetadataData = (pageId) => {
|
|
|
90
91
|
const { data: allLayouts } = useQuery(t7);
|
|
91
92
|
let t8;
|
|
92
93
|
if ($[15] !== allLayouts || $[16] !== camoxApp) {
|
|
93
|
-
t8 = allLayouts?.filter((layout) => camoxApp.getLayoutById(layout.layoutId)?._internal.kind
|
|
94
|
+
t8 = allLayouts?.filter((layout) => camoxApp.getLayoutById(layout.layoutId)?._internal.kind === "curated");
|
|
94
95
|
$[15] = allLayouts;
|
|
95
96
|
$[16] = camoxApp;
|
|
96
97
|
$[17] = t8;
|
|
@@ -140,10 +141,10 @@ const usePageMetadataData = (pageId) => {
|
|
|
140
141
|
return t10;
|
|
141
142
|
};
|
|
142
143
|
const PageInfoSidebar = (t0) => {
|
|
143
|
-
const $ = c(
|
|
144
|
-
if ($[0] !== "
|
|
145
|
-
for (let $i = 0; $i <
|
|
146
|
-
$[0] = "
|
|
144
|
+
const $ = c(69);
|
|
145
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
146
|
+
for (let $i = 0; $i < 69; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
147
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
147
148
|
}
|
|
148
149
|
const { pageId, scrollable: t1, aboutOnly: t2 } = t0;
|
|
149
150
|
const scrollable = t1 === void 0 ? true : t1;
|
|
@@ -215,7 +216,7 @@ const PageInfoSidebar = (t0) => {
|
|
|
215
216
|
size: "icon-xs",
|
|
216
217
|
onClick: t9,
|
|
217
218
|
"aria-label": "Edit page structure",
|
|
218
|
-
children: /* @__PURE__ */ jsx(Pencil, {
|
|
219
|
+
children: /* @__PURE__ */ jsx(Pencil, {})
|
|
219
220
|
})
|
|
220
221
|
});
|
|
221
222
|
$[12] = t10;
|
|
@@ -225,7 +226,7 @@ const PageInfoSidebar = (t0) => {
|
|
|
225
226
|
t11 = /* @__PURE__ */ jsxs("div", {
|
|
226
227
|
className: "space-y-2",
|
|
227
228
|
children: [t7, /* @__PURE__ */ jsxs(InputGroup, {
|
|
228
|
-
className: "
|
|
229
|
+
className: "px-1",
|
|
229
230
|
children: [t8, t10]
|
|
230
231
|
})]
|
|
231
232
|
});
|
|
@@ -361,35 +362,46 @@ const PageInfoSidebar = (t0) => {
|
|
|
361
362
|
$[46] = t24;
|
|
362
363
|
} else t24 = $[46];
|
|
363
364
|
let t25;
|
|
364
|
-
if ($[47] !==
|
|
365
|
-
t25 = /* @__PURE__ */
|
|
365
|
+
if ($[47] !== pageId) {
|
|
366
|
+
t25 = areCommentsEnabled() && /* @__PURE__ */ jsx("div", {
|
|
367
|
+
className: "-mx-2",
|
|
368
|
+
children: /* @__PURE__ */ jsx(AttachedComments, { pageId })
|
|
369
|
+
});
|
|
370
|
+
$[47] = pageId;
|
|
371
|
+
$[48] = t25;
|
|
372
|
+
} else t25 = $[48];
|
|
373
|
+
let t26;
|
|
374
|
+
if ($[49] !== t13 || $[50] !== t14 || $[51] !== t24 || $[52] !== t25 || $[53] !== t4) {
|
|
375
|
+
t26 = /* @__PURE__ */ jsxs("div", {
|
|
366
376
|
className: t4,
|
|
367
377
|
children: [
|
|
368
378
|
t13,
|
|
369
379
|
t14,
|
|
370
|
-
t24
|
|
380
|
+
t24,
|
|
381
|
+
t25
|
|
371
382
|
]
|
|
372
383
|
});
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
384
|
+
$[49] = t13;
|
|
385
|
+
$[50] = t14;
|
|
386
|
+
$[51] = t24;
|
|
387
|
+
$[52] = t25;
|
|
388
|
+
$[53] = t4;
|
|
389
|
+
$[54] = t26;
|
|
390
|
+
} else t26 = $[54];
|
|
391
|
+
let t27;
|
|
392
|
+
if ($[55] !== isStructureModalOpen || $[56] !== page.id) {
|
|
393
|
+
t27 = /* @__PURE__ */ jsx(PageStructureModal, {
|
|
382
394
|
open: isStructureModalOpen,
|
|
383
395
|
onOpenChange: setIsStructureModalOpen,
|
|
384
396
|
pageId: page.id
|
|
385
397
|
});
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
} else
|
|
390
|
-
let
|
|
391
|
-
if ($[
|
|
392
|
-
|
|
398
|
+
$[55] = isStructureModalOpen;
|
|
399
|
+
$[56] = page.id;
|
|
400
|
+
$[57] = t27;
|
|
401
|
+
} else t27 = $[57];
|
|
402
|
+
let t28;
|
|
403
|
+
if ($[58] !== aboutOnly || $[59] !== isMarkdownModalOpen || $[60] !== isSeoModalOpen || $[61] !== metaTitle || $[62] !== page.id || $[63] !== page.metaDescription) {
|
|
404
|
+
t28 = !aboutOnly && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PageSeoModal, {
|
|
393
405
|
open: isSeoModalOpen,
|
|
394
406
|
onOpenChange: setIsSeoModalOpen,
|
|
395
407
|
pageId: page.id
|
|
@@ -400,33 +412,33 @@ const PageInfoSidebar = (t0) => {
|
|
|
400
412
|
metaTitle,
|
|
401
413
|
metaDescription: page.metaDescription ?? ""
|
|
402
414
|
})] });
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
} else
|
|
411
|
-
let
|
|
412
|
-
if ($[
|
|
413
|
-
|
|
414
|
-
t25,
|
|
415
|
+
$[58] = aboutOnly;
|
|
416
|
+
$[59] = isMarkdownModalOpen;
|
|
417
|
+
$[60] = isSeoModalOpen;
|
|
418
|
+
$[61] = metaTitle;
|
|
419
|
+
$[62] = page.id;
|
|
420
|
+
$[63] = page.metaDescription;
|
|
421
|
+
$[64] = t28;
|
|
422
|
+
} else t28 = $[64];
|
|
423
|
+
let t29;
|
|
424
|
+
if ($[65] !== t26 || $[66] !== t27 || $[67] !== t28) {
|
|
425
|
+
t29 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
415
426
|
t26,
|
|
416
|
-
t27
|
|
427
|
+
t27,
|
|
428
|
+
t28
|
|
417
429
|
] });
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
} else
|
|
423
|
-
return
|
|
430
|
+
$[65] = t26;
|
|
431
|
+
$[66] = t27;
|
|
432
|
+
$[67] = t28;
|
|
433
|
+
$[68] = t29;
|
|
434
|
+
} else t29 = $[68];
|
|
435
|
+
return t29;
|
|
424
436
|
};
|
|
425
437
|
const PageNicknameSidebarEditor = (t0) => {
|
|
426
438
|
const $ = c(21);
|
|
427
|
-
if ($[0] !== "
|
|
439
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
428
440
|
for (let $i = 0; $i < 21; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
429
|
-
$[0] = "
|
|
441
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
430
442
|
}
|
|
431
443
|
const { data } = t0;
|
|
432
444
|
const { page } = data;
|
|
@@ -452,20 +464,7 @@ const PageNicknameSidebarEditor = (t0) => {
|
|
|
452
464
|
nickname,
|
|
453
465
|
pathSegment: page.pathSegment,
|
|
454
466
|
parentPageId: page.parentPageId
|
|
455
|
-
}, {
|
|
456
|
-
onSuccess: () => {
|
|
457
|
-
trackClientEvent("page_updated", {
|
|
458
|
-
projectId: page.projectId,
|
|
459
|
-
changes: {
|
|
460
|
-
nickname: true,
|
|
461
|
-
path: false,
|
|
462
|
-
layout: false,
|
|
463
|
-
parent: false
|
|
464
|
-
}
|
|
465
|
-
});
|
|
466
|
-
},
|
|
467
|
-
onError: _temp
|
|
468
|
-
});
|
|
467
|
+
}, { onError: _temp });
|
|
469
468
|
};
|
|
470
469
|
$[2] = page;
|
|
471
470
|
$[3] = updatePage;
|
|
@@ -534,10 +533,10 @@ const PageNicknameSidebarEditor = (t0) => {
|
|
|
534
533
|
return t8;
|
|
535
534
|
};
|
|
536
535
|
const PageLayoutSidebarSelect = (t0) => {
|
|
537
|
-
const $ = c(
|
|
538
|
-
if ($[0] !== "
|
|
539
|
-
for (let $i = 0; $i <
|
|
540
|
-
$[0] = "
|
|
536
|
+
const $ = c(29);
|
|
537
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
538
|
+
for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
539
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
541
540
|
}
|
|
542
541
|
const { data } = t0;
|
|
543
542
|
const { page, layouts, camoxApp } = data;
|
|
@@ -566,89 +565,75 @@ const PageLayoutSidebarSelect = (t0) => {
|
|
|
566
565
|
} else t3 = $[3];
|
|
567
566
|
const t4 = page.layoutId ? String(page.layoutId) : "";
|
|
568
567
|
let t5;
|
|
569
|
-
if ($[4] !== page.id || $[5] !== page.layoutId || $[6] !==
|
|
568
|
+
if ($[4] !== page.id || $[5] !== page.layoutId || $[6] !== setLayout) {
|
|
570
569
|
t5 = (value) => {
|
|
571
570
|
const layoutId = Number(value);
|
|
572
571
|
if (layoutId === page.layoutId) return;
|
|
573
572
|
setLayout.mutate({
|
|
574
573
|
id: page.id,
|
|
575
574
|
layoutId
|
|
576
|
-
}, {
|
|
577
|
-
onSuccess: () => {
|
|
578
|
-
trackClientEvent("page_updated", {
|
|
579
|
-
projectId: page.projectId,
|
|
580
|
-
changes: {
|
|
581
|
-
nickname: false,
|
|
582
|
-
path: false,
|
|
583
|
-
layout: true,
|
|
584
|
-
parent: false
|
|
585
|
-
}
|
|
586
|
-
});
|
|
587
|
-
},
|
|
588
|
-
onError: _temp2
|
|
589
|
-
});
|
|
575
|
+
}, { onError: _temp2 });
|
|
590
576
|
};
|
|
591
577
|
$[4] = page.id;
|
|
592
578
|
$[5] = page.layoutId;
|
|
593
|
-
$[6] =
|
|
594
|
-
$[7] =
|
|
595
|
-
|
|
596
|
-
} else t5 = $[8];
|
|
579
|
+
$[6] = setLayout;
|
|
580
|
+
$[7] = t5;
|
|
581
|
+
} else t5 = $[7];
|
|
597
582
|
let t6;
|
|
598
|
-
if ($[
|
|
583
|
+
if ($[8] !== camoxApp || $[9] !== layouts) {
|
|
599
584
|
let t7;
|
|
600
|
-
if ($[
|
|
585
|
+
if ($[11] !== camoxApp) {
|
|
601
586
|
t7 = (t) => ({
|
|
602
587
|
value: String(t.id),
|
|
603
588
|
label: camoxApp.getLayoutById(t.layoutId)?._internal.title ?? t.layoutId
|
|
604
589
|
});
|
|
605
|
-
$[
|
|
606
|
-
$[
|
|
607
|
-
} else t7 = $[
|
|
590
|
+
$[11] = camoxApp;
|
|
591
|
+
$[12] = t7;
|
|
592
|
+
} else t7 = $[12];
|
|
608
593
|
t6 = layouts.map(t7);
|
|
609
|
-
$[
|
|
610
|
-
$[
|
|
611
|
-
$[
|
|
612
|
-
} else t6 = $[
|
|
594
|
+
$[8] = camoxApp;
|
|
595
|
+
$[9] = layouts;
|
|
596
|
+
$[10] = t6;
|
|
597
|
+
} else t6 = $[10];
|
|
613
598
|
let t7;
|
|
614
|
-
if ($[
|
|
599
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
615
600
|
t7 = /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a layout" });
|
|
616
|
-
$[
|
|
617
|
-
} else t7 = $[
|
|
601
|
+
$[13] = t7;
|
|
602
|
+
} else t7 = $[13];
|
|
618
603
|
let t8;
|
|
619
|
-
if ($[
|
|
604
|
+
if ($[14] !== setLayout.isPending) {
|
|
620
605
|
t8 = /* @__PURE__ */ jsx(SelectTrigger, {
|
|
621
606
|
disabled: setLayout.isPending,
|
|
622
607
|
className: "w-full",
|
|
623
608
|
children: t7
|
|
624
609
|
});
|
|
625
|
-
$[
|
|
626
|
-
$[
|
|
627
|
-
} else t8 = $[
|
|
610
|
+
$[14] = setLayout.isPending;
|
|
611
|
+
$[15] = t8;
|
|
612
|
+
} else t8 = $[15];
|
|
628
613
|
let t9;
|
|
629
|
-
if ($[
|
|
614
|
+
if ($[16] !== camoxApp || $[17] !== layouts) {
|
|
630
615
|
let t10;
|
|
631
|
-
if ($[
|
|
616
|
+
if ($[19] !== camoxApp) {
|
|
632
617
|
t10 = (t_0) => /* @__PURE__ */ jsx(SelectItem, {
|
|
633
618
|
value: String(t_0.id),
|
|
634
619
|
children: camoxApp.getLayoutById(t_0.layoutId)?._internal.title ?? t_0.layoutId
|
|
635
620
|
}, t_0.id);
|
|
636
|
-
$[
|
|
637
|
-
$[
|
|
638
|
-
} else t10 = $[
|
|
621
|
+
$[19] = camoxApp;
|
|
622
|
+
$[20] = t10;
|
|
623
|
+
} else t10 = $[20];
|
|
639
624
|
t9 = layouts.map(t10);
|
|
640
|
-
$[
|
|
641
|
-
$[
|
|
642
|
-
$[
|
|
643
|
-
} else t9 = $[
|
|
625
|
+
$[16] = camoxApp;
|
|
626
|
+
$[17] = layouts;
|
|
627
|
+
$[18] = t9;
|
|
628
|
+
} else t9 = $[18];
|
|
644
629
|
let t10;
|
|
645
|
-
if ($[
|
|
630
|
+
if ($[21] !== t9) {
|
|
646
631
|
t10 = /* @__PURE__ */ jsx(SelectContent, { children: t9 });
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
649
|
-
} else t10 = $[
|
|
632
|
+
$[21] = t9;
|
|
633
|
+
$[22] = t10;
|
|
634
|
+
} else t10 = $[22];
|
|
650
635
|
let t11;
|
|
651
|
-
if ($[
|
|
636
|
+
if ($[23] !== t10 || $[24] !== t4 || $[25] !== t5 || $[26] !== t6 || $[27] !== t8) {
|
|
652
637
|
t11 = /* @__PURE__ */ jsxs("div", {
|
|
653
638
|
className: "space-y-2",
|
|
654
639
|
children: [t3, /* @__PURE__ */ jsxs(Select, {
|
|
@@ -658,20 +643,20 @@ const PageLayoutSidebarSelect = (t0) => {
|
|
|
658
643
|
children: [t8, t10]
|
|
659
644
|
})]
|
|
660
645
|
});
|
|
661
|
-
$[
|
|
662
|
-
$[
|
|
663
|
-
$[
|
|
664
|
-
$[
|
|
665
|
-
$[
|
|
666
|
-
$[
|
|
667
|
-
} else t11 = $[
|
|
646
|
+
$[23] = t10;
|
|
647
|
+
$[24] = t4;
|
|
648
|
+
$[25] = t5;
|
|
649
|
+
$[26] = t6;
|
|
650
|
+
$[27] = t8;
|
|
651
|
+
$[28] = t11;
|
|
652
|
+
} else t11 = $[28];
|
|
668
653
|
return t11;
|
|
669
654
|
};
|
|
670
655
|
const PageStructureModal = (t0) => {
|
|
671
656
|
const $ = c(10);
|
|
672
|
-
if ($[0] !== "
|
|
657
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
673
658
|
for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
674
|
-
$[0] = "
|
|
659
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
675
660
|
}
|
|
676
661
|
const { open, onOpenChange, pageId } = t0;
|
|
677
662
|
const data = usePageMetadataData(pageId);
|
|
@@ -744,15 +729,6 @@ const PageStructureEditor = ({ data, includeNickname = true, includeLayout = tru
|
|
|
744
729
|
id: page.id,
|
|
745
730
|
layoutId: values.value.layoutId
|
|
746
731
|
});
|
|
747
|
-
trackClientEvent("page_updated", {
|
|
748
|
-
projectId: page.projectId,
|
|
749
|
-
changes: {
|
|
750
|
-
nickname: nickname !== page.nickname,
|
|
751
|
-
path: values.value.pathSegment !== page.pathSegment,
|
|
752
|
-
layout: includeLayout && values.value.layoutId !== page.layoutId,
|
|
753
|
-
parent: values.value.parentPageId !== page.parentPageId
|
|
754
|
-
}
|
|
755
|
-
});
|
|
756
732
|
toast.success(`Updated ${nickname} page`);
|
|
757
733
|
form.reset();
|
|
758
734
|
onSaved?.();
|
|
@@ -845,9 +821,9 @@ const PageStructureEditor = ({ data, includeNickname = true, includeLayout = tru
|
|
|
845
821
|
};
|
|
846
822
|
const PageSeoModal = (t0) => {
|
|
847
823
|
const $ = c(8);
|
|
848
|
-
if ($[0] !== "
|
|
824
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
849
825
|
for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
850
|
-
$[0] = "
|
|
826
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
851
827
|
}
|
|
852
828
|
const { open, onOpenChange, pageId } = t0;
|
|
853
829
|
let t1;
|
|
@@ -880,9 +856,9 @@ const PageSeoModal = (t0) => {
|
|
|
880
856
|
};
|
|
881
857
|
const PageSeoContent = (t0) => {
|
|
882
858
|
const $ = c(6);
|
|
883
|
-
if ($[0] !== "
|
|
859
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
884
860
|
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
885
|
-
$[0] = "
|
|
861
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
886
862
|
}
|
|
887
863
|
const { pageId } = t0;
|
|
888
864
|
const { page, metaTitle, pageLayoutRecord, project } = usePageMetadataData(pageId);
|
|
@@ -907,9 +883,9 @@ const PageSeoContent = (t0) => {
|
|
|
907
883
|
};
|
|
908
884
|
const PageSeoEditor = (t0) => {
|
|
909
885
|
const $ = c(43);
|
|
910
|
-
if ($[0] !== "
|
|
886
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
911
887
|
for (let $i = 0; $i < 43; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
912
|
-
$[0] = "
|
|
888
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
913
889
|
}
|
|
914
890
|
const { page, metaTitle, layoutId, projectName } = t0;
|
|
915
891
|
let t1;
|
|
@@ -938,11 +914,6 @@ const PageSeoEditor = (t0) => {
|
|
|
938
914
|
id: page.id,
|
|
939
915
|
enabled: checked
|
|
940
916
|
});
|
|
941
|
-
trackClientEvent("ai_metadata_toggled", {
|
|
942
|
-
target: "page",
|
|
943
|
-
enabled: checked,
|
|
944
|
-
pageId: page.id
|
|
945
|
-
});
|
|
946
917
|
};
|
|
947
918
|
$[4] = page.id;
|
|
948
919
|
$[5] = setAiSeo;
|
|
@@ -1082,9 +1053,9 @@ const PageSeoEditor = (t0) => {
|
|
|
1082
1053
|
};
|
|
1083
1054
|
const PageMarkdownModal = (t0) => {
|
|
1084
1055
|
const $ = c(10);
|
|
1085
|
-
if ($[0] !== "
|
|
1056
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
1086
1057
|
for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1087
|
-
$[0] = "
|
|
1058
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
1088
1059
|
}
|
|
1089
1060
|
const { open, onOpenChange, pageId, metaTitle, metaDescription } = t0;
|
|
1090
1061
|
let t1;
|
|
@@ -1123,9 +1094,9 @@ const PageMarkdownModal = (t0) => {
|
|
|
1123
1094
|
};
|
|
1124
1095
|
const PageMarkdownContent = (t0) => {
|
|
1125
1096
|
const $ = c(6);
|
|
1126
|
-
if ($[0] !== "
|
|
1097
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
1127
1098
|
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1128
|
-
$[0] = "
|
|
1099
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
1129
1100
|
}
|
|
1130
1101
|
const { pageId } = t0;
|
|
1131
1102
|
const { page, metaTitle } = usePageMetadataData(pageId);
|
|
@@ -1158,9 +1129,9 @@ function truncateText(text, maxLen) {
|
|
|
1158
1129
|
}
|
|
1159
1130
|
const SearchEnginePreview = (t0) => {
|
|
1160
1131
|
const $ = c(17);
|
|
1161
|
-
if ($[0] !== "
|
|
1132
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
1162
1133
|
for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1163
|
-
$[0] = "
|
|
1134
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
1164
1135
|
}
|
|
1165
1136
|
const { page, metaTitle, metaDescription } = t0;
|
|
1166
1137
|
const url = `${typeof window !== "undefined" ? window.location.origin : ""}${page.fullPath}`;
|
|
@@ -1243,9 +1214,9 @@ const SearchEnginePreview = (t0) => {
|
|
|
1243
1214
|
};
|
|
1244
1215
|
const SocialPreviewSection = (t0) => {
|
|
1245
1216
|
const $ = c(60);
|
|
1246
|
-
if ($[0] !== "
|
|
1217
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
1247
1218
|
for (let $i = 0; $i < 60; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1248
|
-
$[0] = "
|
|
1219
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
1249
1220
|
}
|
|
1250
1221
|
const { page, metaTitle, metaDescription, layoutId, projectName } = t0;
|
|
1251
1222
|
const pageMetaTitle = page.metaTitle ?? page.pathSegment;
|
|
@@ -1279,7 +1250,6 @@ const SocialPreviewSection = (t0) => {
|
|
|
1279
1250
|
...t2,
|
|
1280
1251
|
onSuccess: () => {
|
|
1281
1252
|
queryClient.invalidateQueries({ queryKey: pageQueries.getById(page.id).queryKey });
|
|
1282
|
-
trackClientEvent("page_custom_og_image_uploaded", { pageId: page.id });
|
|
1283
1253
|
},
|
|
1284
1254
|
onError: _temp6
|
|
1285
1255
|
};
|
|
@@ -1299,7 +1269,6 @@ const SocialPreviewSection = (t0) => {
|
|
|
1299
1269
|
...t4,
|
|
1300
1270
|
onSuccess: () => {
|
|
1301
1271
|
queryClient.invalidateQueries({ queryKey: pageQueries.getById(page.id).queryKey });
|
|
1302
|
-
trackClientEvent("page_custom_og_image_removed", { pageId: page.id });
|
|
1303
1272
|
},
|
|
1304
1273
|
onError: _temp7
|
|
1305
1274
|
};
|
|
@@ -1519,9 +1488,9 @@ const SocialPreviewSection = (t0) => {
|
|
|
1519
1488
|
};
|
|
1520
1489
|
const PageMarkdownPreview = (t0) => {
|
|
1521
1490
|
const $ = c(9);
|
|
1522
|
-
if ($[0] !== "
|
|
1491
|
+
if ($[0] !== "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4") {
|
|
1523
1492
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1524
|
-
$[0] = "
|
|
1493
|
+
$[0] = "dedb426819c8cdba3ad2706e62e75231e53c7e782fd82aca9849a8543054a0e4";
|
|
1525
1494
|
}
|
|
1526
1495
|
const { pageId, metaTitle, metaDescription } = t0;
|
|
1527
1496
|
let t1;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useLocation, useNavigate } from "../../navigation/navigation.js";
|
|
2
2
|
import { useProjectSlug } from "../../../lib/auth.js";
|
|
3
|
+
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
3
4
|
import { layoutQueries, pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
|
|
4
5
|
import { cn } from "../../../lib/utils.js";
|
|
5
|
-
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
6
6
|
import { previewStore } from "../previewStore.js";
|
|
7
7
|
import { matchDerivedLayout, routeSegments } from "../../../core/derivedRoutes.js";
|
|
8
8
|
import { DerivedLayoutDialog } from "./DerivedLayoutDialog.js";
|
|
@@ -23,7 +23,7 @@ const CREATE_PAGE_VALUE = "__create_page__";
|
|
|
23
23
|
const DERIVED_LAYOUT_PREFIX = "__derived_layout__:";
|
|
24
24
|
const PagePicker = () => {
|
|
25
25
|
const [open, setOpen] = React.useState(false);
|
|
26
|
-
const derivedLayouts = useCamoxApp().getLayouts().filter((layout) => layout._internal.kind
|
|
26
|
+
const derivedLayouts = useCamoxApp().getLayouts().filter((layout) => layout._internal.kind !== "curated");
|
|
27
27
|
const [layoutToPreview, setLayoutToPreview] = React.useState(null);
|
|
28
28
|
const [pageToDelete, setPageToDelete] = React.useState(null);
|
|
29
29
|
const projectSlug = useProjectSlug();
|
|
@@ -183,53 +183,58 @@ const PagePicker = () => {
|
|
|
183
183
|
})]
|
|
184
184
|
})]
|
|
185
185
|
}, page_1.id)) }),
|
|
186
|
-
|
|
187
|
-
heading: "Derived pages",
|
|
188
|
-
children: derivedLayouts.
|
|
189
|
-
value: `${DERIVED_LAYOUT_PREFIX}${
|
|
190
|
-
keywords: [
|
|
186
|
+
["singleton", "derived"].map((kind) => /* @__PURE__ */ jsx(CommandGroup, {
|
|
187
|
+
heading: kind === "singleton" ? "Singleton pages" : "Derived pages",
|
|
188
|
+
children: derivedLayouts.filter((layout_1) => layout_1._internal.kind === kind).map((layout_2) => /* @__PURE__ */ jsx(CommandItem, {
|
|
189
|
+
value: `${DERIVED_LAYOUT_PREFIX}${layout_2._internal.id}`,
|
|
190
|
+
keywords: [layout_2._internal.title],
|
|
191
191
|
hideCheck: true,
|
|
192
192
|
onSelect: () => {
|
|
193
193
|
closePopover();
|
|
194
|
-
const segments = routeSegments(
|
|
194
|
+
const segments = routeSegments(layout_2._internal.id);
|
|
195
195
|
if (!segments.some((segment) => segment.startsWith("$"))) {
|
|
196
196
|
navigate({ to: `/${segments.map(encodeURIComponent).join("/")}` });
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
setLayoutToPreview(
|
|
199
|
+
setLayoutToPreview(layout_2);
|
|
200
200
|
},
|
|
201
201
|
children: /* @__PURE__ */ jsxs("div", {
|
|
202
202
|
className: "flex min-w-0 flex-1 items-start gap-2",
|
|
203
|
-
children: [/* @__PURE__ */ jsx(Check, { className: cn("size-4 mt-0.5 shrink-0", currentDerived?.layout._internal.id !==
|
|
203
|
+
children: [/* @__PURE__ */ jsx(Check, { className: cn("size-4 mt-0.5 shrink-0", currentDerived?.layout._internal.id !== layout_2._internal.id && "invisible") }), /* @__PURE__ */ jsxs("div", {
|
|
204
204
|
className: "flex min-w-0 flex-col",
|
|
205
205
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
206
206
|
className: "flex min-w-0 items-center gap-1.5",
|
|
207
207
|
children: [/* @__PURE__ */ jsx("p", {
|
|
208
208
|
className: "truncate",
|
|
209
|
-
children:
|
|
210
|
-
}), layoutStatusById.has(
|
|
209
|
+
children: layout_2._internal.title
|
|
210
|
+
}), layoutStatusById.has(layout_2._internal.id) && /* @__PURE__ */ jsx(PageStatusBadge, {
|
|
211
211
|
size: "sm",
|
|
212
|
-
status: layoutStatusById.get(
|
|
212
|
+
status: layoutStatusById.get(layout_2._internal.id)
|
|
213
213
|
})]
|
|
214
214
|
}), /* @__PURE__ */ jsxs("p", {
|
|
215
215
|
className: "text-muted-foreground truncate font-mono text-xs",
|
|
216
|
-
children: ["/", routeSegments(
|
|
216
|
+
children: ["/", routeSegments(layout_2._internal.id).join("/")]
|
|
217
217
|
})]
|
|
218
218
|
})]
|
|
219
219
|
})
|
|
220
|
-
},
|
|
221
|
-
})
|
|
220
|
+
}, layout_2._internal.id))
|
|
221
|
+
}, kind))
|
|
222
222
|
]
|
|
223
223
|
}),
|
|
224
224
|
/* @__PURE__ */ jsx(CommandSeparator, {}),
|
|
225
|
-
/* @__PURE__ */ jsx(CommandGroup, {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
225
|
+
/* @__PURE__ */ jsx(CommandGroup, {
|
|
226
|
+
className: "shrink-0 pt-2",
|
|
227
|
+
children: /* @__PURE__ */ jsxs(CommandItem, {
|
|
228
|
+
className: "h-9 gap-2 px-2 py-0",
|
|
229
|
+
hideCheck: true,
|
|
230
|
+
onSelect: () => {
|
|
231
|
+
closePopover();
|
|
232
|
+
previewStore.send({ type: "openCreatePageModal" });
|
|
233
|
+
},
|
|
234
|
+
value: CREATE_PAGE_VALUE,
|
|
235
|
+
children: [/* @__PURE__ */ jsx(Plus, { className: "size-4 shrink-0" }), /* @__PURE__ */ jsx("span", { children: "Create page" })]
|
|
236
|
+
})
|
|
237
|
+
})
|
|
233
238
|
]
|
|
234
239
|
})
|
|
235
240
|
})]
|