camox 0.40.0 → 0.41.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/PlatformLabel.js +62 -0
- package/dist/core/components/lexical/GradientNode.js +126 -0
- package/dist/core/components/lexical/InlineLexicalEditor.js +37 -56
- package/dist/core/components/lexical/InlineStylesPlugin.js +183 -0
- package/dist/core/components/lexical/SelectionBroadcaster.js +49 -46
- package/dist/core/components/lexical/SidebarLexicalEditor.js +197 -151
- package/dist/core/components/lexical/editorConfig.js +25 -7
- package/dist/core/components/lexical/selectTextLink.js +21 -0
- package/dist/core/createApp.d.ts +30 -17
- package/dist/core/createApp.js +14 -3
- package/dist/core/createBlock.d.ts +2 -2
- package/dist/core/createBlock.js +18 -15
- package/dist/core/createLayout.d.ts +48 -4
- package/dist/core/createLayout.js +51 -23
- package/dist/core/derivedRoutes.js +36 -0
- package/dist/core/editing/createEditableBlock.d.ts +9 -8
- package/dist/core/editing/createEditableBlock.js +167 -168
- package/dist/core/lib/lexicalReact.d.ts +1 -26
- package/dist/core/lib/lexicalReact.js +46 -60
- package/dist/core/lib/lexicalState.js +164 -81
- package/dist/core/lib/modifierFormats.js +4 -15
- package/dist/core/lib/textStyles.d.ts +27 -0
- package/dist/core/lib/textStyles.js +47 -0
- package/dist/features/navigation/navigation.d.ts +2 -0
- package/dist/features/navigation/navigation.js +51 -46
- package/dist/features/page/DerivedPageContent.js +61 -0
- package/dist/features/page/PublishedPageContent.js +52 -83
- package/dist/features/page/SharedLayoutContent.js +66 -0
- package/dist/features/preview/CamoxPreview.d.ts +16 -1
- package/dist/features/preview/CamoxPreview.js +242 -265
- package/dist/features/preview/DerivedPreview.js +137 -0
- package/dist/features/preview/EditablePageExperience.js +25 -8
- package/dist/features/preview/components/AddBlockSidebar.js +43 -33
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/BlockThumbnail.js +192 -0
- package/dist/features/preview/components/CreatePageModal.js +123 -115
- package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.js +163 -0
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
- package/dist/features/preview/components/FieldToolbar.js +42 -20
- package/dist/features/preview/components/Frame.js +133 -140
- package/dist/features/preview/components/LeftSidebar.js +42 -38
- package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
- package/dist/features/preview/components/Overlays.js +57 -42
- package/dist/features/preview/components/PageInfoSidebar.js +63 -55
- package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
- package/dist/features/preview/components/PagePicker.js +205 -153
- package/dist/features/preview/components/PageTree.js +298 -206
- package/dist/features/preview/components/PreviewActivation.js +78 -0
- package/dist/features/preview/components/PreviewPanel.js +67 -35
- package/dist/features/preview/components/PreviewToolbar.js +218 -232
- package/dist/features/preview/components/PublicationRow.js +431 -0
- package/dist/features/preview/components/PublishDialog.js +180 -97
- package/dist/features/preview/components/RightSidebar.js +19 -34
- package/dist/features/preview/components/previewStyles.js +8 -0
- package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
- package/dist/features/preview/previewConstants.js +8 -0
- package/dist/features/preview/previewStore.js +0 -10
- package/dist/features/preview/publication.js +71 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
- package/dist/features/provider/CoreCamoxProvider.js +11 -2
- package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
- package/dist/features/routes/pageRuntime.d.ts +10 -0
- package/dist/features/routes/pageRuntime.js +7 -9
- package/dist/features/runtime/PreviewDocumentContext.js +7 -0
- package/dist/features/runtime/RuntimeChrome.js +137 -0
- package/dist/features/runtime/SharedChromeContext.js +7 -0
- package/dist/features/runtime/navigationRequest.js +21 -0
- package/dist/features/runtime/navigationTarget.js +23 -0
- package/dist/features/runtime/pageApp.js +196 -121
- package/dist/features/runtime/pageNavigation.js +79 -130
- package/dist/features/runtime/runtime.d.ts +11 -0
- package/dist/features/runtime/runtime.js +183 -47
- package/dist/features/runtime/studioApp.d.ts +2 -11
- package/dist/features/runtime/studioApp.js +14 -177
- package/dist/features/studio/CamoxStudio.js +27 -13
- package/dist/features/studio/components/Navbar.js +80 -74
- package/dist/features/studio/studioTheme.js +25 -0
- package/dist/features/studio/useTheme.js +94 -109
- package/dist/features/vite/appGeneration.js +12 -3
- package/dist/features/vite/definitionsSync.js +4 -2
- package/dist/features/vite/layoutGeneration.js +38 -0
- package/dist/features/vite/runtimeDev.js +3 -1
- package/dist/lib/auth.js +15 -13
- package/dist/lib/normalized-data.js +4 -4
- package/dist/lib/platform.js +13 -0
- package/dist/lib/utils.js +90 -38
- package/dist/studio-overlays.css +5 -40
- package/dist/studio.css +1 -1
- package/package.json +8 -4
- package/skills/camox/SKILL.md +2 -0
- package/skills/camox/references/block-definitions.md +31 -12
- package/skills/camox/references/layout-definitions.md +2 -0
- package/dist/core/lib/modifiers.js +0 -24
- package/dist/features/preview/previewQueryFns.js +0 -23
- package/dist/features/runtime/studioNavigation.js +0 -120
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { useLocation, useNavigate } from "../../navigation/navigation.js";
|
|
2
2
|
import { useProjectSlug } from "../../../lib/auth.js";
|
|
3
|
-
import { pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
|
|
3
|
+
import { layoutQueries, pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
|
|
4
4
|
import { cn } from "../../../lib/utils.js";
|
|
5
|
+
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
5
6
|
import { previewStore } from "../previewStore.js";
|
|
7
|
+
import { matchDerivedLayout, routeSegments } from "../../../core/derivedRoutes.js";
|
|
8
|
+
import { DerivedLayoutDialog } from "./DerivedLayoutDialog.js";
|
|
6
9
|
import { PageStatusBadge } from "./PageStatusBadge.js";
|
|
7
10
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
8
11
|
import * as React from "react";
|
|
9
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { useSelector } from "@xstate/store-react";
|
|
11
13
|
import { Button } from "@camox/ui/button";
|
|
12
14
|
import { Check, ChevronsUpDown, Pencil, Plus, Trash2 } from "lucide-react";
|
|
13
15
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
|
|
@@ -18,12 +20,19 @@ import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, Command
|
|
|
18
20
|
|
|
19
21
|
//#region src/features/preview/components/PagePicker.tsx
|
|
20
22
|
const CREATE_PAGE_VALUE = "__create_page__";
|
|
23
|
+
const DERIVED_LAYOUT_PREFIX = "__derived_layout__:";
|
|
21
24
|
const PagePicker = () => {
|
|
22
25
|
const [open, setOpen] = React.useState(false);
|
|
26
|
+
const derivedLayouts = useCamoxApp().getLayouts().filter((layout) => layout._internal.kind === "derived");
|
|
27
|
+
const [layoutToPreview, setLayoutToPreview] = React.useState(null);
|
|
23
28
|
const [pageToDelete, setPageToDelete] = React.useState(null);
|
|
24
|
-
const peekedPagePathname = useSelector(previewStore, (state) => state.context.peekedPagePathname);
|
|
25
29
|
const projectSlug = useProjectSlug();
|
|
26
30
|
const { data: project } = useQuery(projectQueries.getBySlug(projectSlug));
|
|
31
|
+
const { data: layoutRecords } = useQuery({
|
|
32
|
+
...layoutQueries.list(project?.id ?? 0),
|
|
33
|
+
enabled: !!project
|
|
34
|
+
});
|
|
35
|
+
const layoutStatusById = new Map(layoutRecords?.map((layout_0) => [layout_0.layoutId, layout_0.status]));
|
|
27
36
|
const deletePage = useMutation(pageMutations.delete());
|
|
28
37
|
const { data: pages } = useQuery({
|
|
29
38
|
...pageQueries.list(project?.id ?? 0),
|
|
@@ -32,7 +41,6 @@ const PagePicker = () => {
|
|
|
32
41
|
const { pathname } = useLocation();
|
|
33
42
|
const navigate = useNavigate();
|
|
34
43
|
const closePopover = () => {
|
|
35
|
-
previewStore.send({ type: "clearPeekedPage" });
|
|
36
44
|
setOpen(false);
|
|
37
45
|
};
|
|
38
46
|
const handleDeletePage = async (page) => {
|
|
@@ -54,159 +62,203 @@ const PagePicker = () => {
|
|
|
54
62
|
});
|
|
55
63
|
if (!pages) return skeleton;
|
|
56
64
|
const currentPage = pages.find((page_0) => page_0.fullPath === pathname);
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
118
|
-
className: "flex min-w-0 flex-1 items-start gap-2",
|
|
119
|
-
children: [/* @__PURE__ */ jsx(Check, { className: cn("size-4 mt-0.5 shrink-0", currentPage.fullPath !== page_1.fullPath && "invisible") }), /* @__PURE__ */ jsxs("div", {
|
|
120
|
-
className: "flex min-w-0 flex-col",
|
|
65
|
+
const currentDerived = currentPage ? null : matchDerivedLayout(derivedLayouts, pathname);
|
|
66
|
+
const currentLayoutStatus = currentDerived ? layoutStatusById.get(currentDerived.layout._internal.id) : void 0;
|
|
67
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsxs(Popover, {
|
|
69
|
+
open,
|
|
70
|
+
onOpenChange: (value) => {
|
|
71
|
+
if (!value) {
|
|
72
|
+
closePopover();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
setOpen(value);
|
|
76
|
+
},
|
|
77
|
+
children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
78
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
79
|
+
variant: "outline",
|
|
80
|
+
role: "combobox",
|
|
81
|
+
className: "min-w-0 flex-1 justify-between"
|
|
82
|
+
}),
|
|
83
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
84
|
+
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx("span", {
|
|
87
|
+
className: "truncate",
|
|
88
|
+
children: currentPage?.nickname ?? currentDerived?.layout._internal.title ?? "Select page"
|
|
89
|
+
}),
|
|
90
|
+
currentPage && /* @__PURE__ */ jsx(PageStatusBadge, {
|
|
91
|
+
size: "sm",
|
|
92
|
+
status: currentPage.status,
|
|
93
|
+
modifiedReason: currentPage.modifiedReason
|
|
94
|
+
}),
|
|
95
|
+
currentLayoutStatus && /* @__PURE__ */ jsx(PageStatusBadge, {
|
|
96
|
+
size: "sm",
|
|
97
|
+
status: currentLayoutStatus
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
}), /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
|
|
101
|
+
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
102
|
+
className: "flex h-[300px] w-[400px] flex-col p-0",
|
|
103
|
+
align: "start",
|
|
104
|
+
side: "bottom",
|
|
105
|
+
children: /* @__PURE__ */ jsxs(Command, {
|
|
106
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx(CommandInput, {
|
|
109
|
+
placeholder: "Search page...",
|
|
110
|
+
className: "h-9"
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ jsxs(CommandList, {
|
|
113
|
+
className: "flex-1 overflow-y-auto",
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: "No page found." }),
|
|
116
|
+
/* @__PURE__ */ jsx(CommandGroup, { children: pages.map((page_1) => /* @__PURE__ */ jsxs(CommandItem, {
|
|
117
|
+
value: page_1.fullPath,
|
|
118
|
+
className: "group/item justify-between",
|
|
119
|
+
hideCheck: true,
|
|
120
|
+
onSelect: () => {
|
|
121
|
+
navigate({ to: page_1.fullPath });
|
|
122
|
+
closePopover();
|
|
123
|
+
},
|
|
121
124
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
122
|
-
className: "flex min-w-0 items-
|
|
123
|
-
children: [/* @__PURE__ */ jsx("
|
|
124
|
-
className: "
|
|
125
|
-
children:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
className: "flex min-w-0 flex-1 items-start gap-2",
|
|
126
|
+
children: [/* @__PURE__ */ jsx(Check, { className: cn("size-4 mt-0.5 shrink-0", currentPage?.fullPath !== page_1.fullPath && "invisible") }), /* @__PURE__ */ jsxs("div", {
|
|
127
|
+
className: "flex min-w-0 flex-col",
|
|
128
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
129
|
+
className: "flex min-w-0 items-center gap-1.5",
|
|
130
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
131
|
+
className: "truncate",
|
|
132
|
+
children: page_1.nickname
|
|
133
|
+
}), /* @__PURE__ */ jsx(PageStatusBadge, {
|
|
134
|
+
size: "sm",
|
|
135
|
+
status: page_1.status,
|
|
136
|
+
modifiedReason: page_1.modifiedReason
|
|
137
|
+
})]
|
|
138
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
139
|
+
className: "text-muted-foreground truncate font-mono text-xs",
|
|
140
|
+
children: page_1.fullPath
|
|
141
|
+
})]
|
|
142
|
+
})]
|
|
143
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
144
|
+
className: "hidden gap-1 group-data-[selected=true]/item:flex",
|
|
145
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
146
|
+
variant: "ghost",
|
|
147
|
+
size: "icon-sm",
|
|
148
|
+
onClick: (e) => {
|
|
149
|
+
e.stopPropagation();
|
|
150
|
+
previewStore.send({
|
|
151
|
+
type: "openEditPageModal",
|
|
152
|
+
pageId: page_1.id
|
|
153
|
+
});
|
|
154
|
+
closePopover();
|
|
155
|
+
},
|
|
156
|
+
onKeyDown: (e_0) => {
|
|
157
|
+
if (e_0.key === "Enter" || e_0.key === " ") {
|
|
158
|
+
e_0.preventDefault();
|
|
159
|
+
e_0.stopPropagation();
|
|
160
|
+
previewStore.send({
|
|
161
|
+
type: "openEditPageModal",
|
|
162
|
+
pageId: page_1.id
|
|
163
|
+
});
|
|
164
|
+
closePopover();
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
children: /* @__PURE__ */ jsx(Pencil, { className: "size-4" })
|
|
168
|
+
}), page_1.fullPath !== "/" && /* @__PURE__ */ jsx(Button, {
|
|
169
|
+
variant: "ghost",
|
|
170
|
+
size: "icon-sm",
|
|
171
|
+
onClick: (e_1) => {
|
|
172
|
+
e_1.stopPropagation();
|
|
173
|
+
setPageToDelete(page_1);
|
|
174
|
+
},
|
|
175
|
+
onKeyDown: (e_2) => {
|
|
176
|
+
if (e_2.key === "Enter" || e_2.key === " ") {
|
|
177
|
+
e_2.preventDefault();
|
|
178
|
+
e_2.stopPropagation();
|
|
179
|
+
setPageToDelete(page_1);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "size-4" })
|
|
130
183
|
})]
|
|
131
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
132
|
-
className: "text-muted-foreground truncate font-mono text-xs",
|
|
133
|
-
children: page_1.fullPath
|
|
134
184
|
})]
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
previewStore.send({
|
|
144
|
-
type: "openEditPageModal",
|
|
145
|
-
pageId: page_1.id
|
|
146
|
-
});
|
|
147
|
-
closePopover();
|
|
148
|
-
},
|
|
149
|
-
onKeyDown: (e_0) => {
|
|
150
|
-
if (e_0.key === "Enter" || e_0.key === " ") {
|
|
151
|
-
e_0.preventDefault();
|
|
152
|
-
e_0.stopPropagation();
|
|
153
|
-
previewStore.send({
|
|
154
|
-
type: "openEditPageModal",
|
|
155
|
-
pageId: page_1.id
|
|
156
|
-
});
|
|
185
|
+
}, page_1.id)) }),
|
|
186
|
+
derivedLayouts.length > 0 && /* @__PURE__ */ jsx(CommandGroup, {
|
|
187
|
+
heading: "Derived pages",
|
|
188
|
+
children: derivedLayouts.map((layout_1) => /* @__PURE__ */ jsx(CommandItem, {
|
|
189
|
+
value: `${DERIVED_LAYOUT_PREFIX}${layout_1._internal.id}`,
|
|
190
|
+
keywords: [layout_1._internal.title],
|
|
191
|
+
hideCheck: true,
|
|
192
|
+
onSelect: () => {
|
|
157
193
|
closePopover();
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
194
|
+
const segments = routeSegments(layout_1._internal.id);
|
|
195
|
+
if (!segments.some((segment) => segment.startsWith("$"))) {
|
|
196
|
+
navigate({ to: `/${segments.map(encodeURIComponent).join("/")}` });
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
setLayoutToPreview(layout_1);
|
|
200
|
+
},
|
|
201
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
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 !== layout_1._internal.id && "invisible") }), /* @__PURE__ */ jsxs("div", {
|
|
204
|
+
className: "flex min-w-0 flex-col",
|
|
205
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
206
|
+
className: "flex min-w-0 items-center gap-1.5",
|
|
207
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
208
|
+
className: "truncate",
|
|
209
|
+
children: layout_1._internal.title
|
|
210
|
+
}), layoutStatusById.has(layout_1._internal.id) && /* @__PURE__ */ jsx(PageStatusBadge, {
|
|
211
|
+
size: "sm",
|
|
212
|
+
status: layoutStatusById.get(layout_1._internal.id)
|
|
213
|
+
})]
|
|
214
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
215
|
+
className: "text-muted-foreground truncate font-mono text-xs",
|
|
216
|
+
children: ["/", routeSegments(layout_1._internal.id).join("/")]
|
|
217
|
+
})]
|
|
218
|
+
})]
|
|
219
|
+
})
|
|
220
|
+
}, layout_1._internal.id))
|
|
221
|
+
})
|
|
222
|
+
]
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsx(CommandSeparator, {}),
|
|
225
|
+
/* @__PURE__ */ jsx(CommandGroup, { children: /* @__PURE__ */ jsxs(CommandItem, {
|
|
226
|
+
onSelect: () => {
|
|
227
|
+
closePopover();
|
|
228
|
+
previewStore.send({ type: "openCreatePageModal" });
|
|
229
|
+
},
|
|
230
|
+
value: CREATE_PAGE_VALUE,
|
|
231
|
+
children: [/* @__PURE__ */ jsx(Plus, { className: "size-4" }), "Create page"]
|
|
232
|
+
}) })
|
|
233
|
+
]
|
|
234
|
+
})
|
|
235
|
+
})]
|
|
236
|
+
}),
|
|
237
|
+
layoutToPreview && /* @__PURE__ */ jsx(DerivedLayoutDialog, {
|
|
238
|
+
layout: layoutToPreview,
|
|
239
|
+
projectSlug,
|
|
240
|
+
currentParams: currentDerived?.layout._internal.id === layoutToPreview._internal.id ? currentDerived.params : void 0,
|
|
241
|
+
onClose: () => setLayoutToPreview(null)
|
|
242
|
+
}, layoutToPreview._internal.id),
|
|
243
|
+
/* @__PURE__ */ jsx(AlertDialog, {
|
|
244
|
+
open: !!pageToDelete,
|
|
245
|
+
onOpenChange: (open_0) => !open_0 && setPageToDelete(null),
|
|
246
|
+
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Delete page" }), /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
|
|
247
|
+
"Are you sure you want to delete",
|
|
248
|
+
" ",
|
|
249
|
+
/* @__PURE__ */ jsx("strong", { children: pageToDelete ? pageToDelete.nickname : "" }),
|
|
250
|
+
"? This action cannot be undone."
|
|
251
|
+
] })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
252
|
+
variant: "outline",
|
|
253
|
+
size: "default",
|
|
254
|
+
children: "Cancel"
|
|
255
|
+
}), /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
256
|
+
variant: "destructive",
|
|
257
|
+
onClick: () => pageToDelete && handleDeletePage(pageToDelete),
|
|
258
|
+
children: "Delete"
|
|
259
|
+
})] })] })
|
|
260
|
+
})
|
|
261
|
+
] });
|
|
210
262
|
};
|
|
211
263
|
|
|
212
264
|
//#endregion
|