camox 0.40.0 → 0.41.1

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 (108) hide show
  1. package/dist/components/PlatformLabel.js +62 -0
  2. package/dist/core/components/lexical/GradientNode.js +126 -0
  3. package/dist/core/components/lexical/InlineLexicalEditor.js +37 -56
  4. package/dist/core/components/lexical/InlineStylesPlugin.js +183 -0
  5. package/dist/core/components/lexical/SelectionBroadcaster.js +49 -46
  6. package/dist/core/components/lexical/SidebarLexicalEditor.js +197 -151
  7. package/dist/core/components/lexical/editorConfig.js +25 -7
  8. package/dist/core/components/lexical/selectTextLink.js +21 -0
  9. package/dist/core/createApp.d.ts +30 -17
  10. package/dist/core/createApp.js +14 -3
  11. package/dist/core/createBlock.d.ts +2 -2
  12. package/dist/core/createBlock.js +17 -28
  13. package/dist/core/createLayout.d.ts +48 -4
  14. package/dist/core/createLayout.js +51 -23
  15. package/dist/core/derivedRoutes.js +36 -0
  16. package/dist/core/editing/BlockEditingRuntime.js +4 -4
  17. package/dist/core/editing/CompleteBlockEditingRuntime.js +5 -5
  18. package/dist/core/editing/createEditableBlock.d.ts +9 -8
  19. package/dist/core/editing/createEditableBlock.js +265 -403
  20. package/dist/core/hooks/useIsEditable.js +4 -7
  21. package/dist/core/hooks/useRequireDraftSource.js +7 -11
  22. package/dist/core/lib/lexicalReact.d.ts +1 -26
  23. package/dist/core/lib/lexicalReact.js +46 -60
  24. package/dist/core/lib/lexicalState.js +164 -81
  25. package/dist/core/lib/modifierFormats.js +4 -15
  26. package/dist/core/lib/textStyles.d.ts +27 -0
  27. package/dist/core/lib/textStyles.js +47 -0
  28. package/dist/features/navigation/navigation.d.ts +2 -0
  29. package/dist/features/navigation/navigation.js +51 -46
  30. package/dist/features/page/DerivedPageContent.js +61 -0
  31. package/dist/features/page/PublishedPageContent.js +52 -83
  32. package/dist/features/page/SharedLayoutContent.js +66 -0
  33. package/dist/features/preview/CamoxPreview.d.ts +16 -1
  34. package/dist/features/preview/CamoxPreview.js +246 -290
  35. package/dist/features/preview/DerivedPreview.js +134 -0
  36. package/dist/features/preview/EditablePageExperience.js +25 -8
  37. package/dist/features/preview/components/AddBlockSidebar.js +43 -33
  38. package/dist/features/preview/components/AssetLightbox.js +1 -1
  39. package/dist/features/preview/components/BlockActionsPopover.js +8 -8
  40. package/dist/features/preview/components/BlockThumbnail.js +192 -0
  41. package/dist/features/preview/components/CreatePageModal.js +123 -115
  42. package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
  43. package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
  44. package/dist/features/preview/components/DerivedLayoutSidebar.js +160 -0
  45. package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
  46. package/dist/features/preview/components/FieldToolbar.js +42 -20
  47. package/dist/features/preview/components/Frame.js +133 -140
  48. package/dist/features/preview/components/LeftSidebar.js +42 -38
  49. package/dist/features/preview/components/LinkFieldEditor.js +3 -4
  50. package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
  51. package/dist/features/preview/components/Overlays.js +59 -47
  52. package/dist/features/preview/components/PageEditorSidebar.js +194 -203
  53. package/dist/features/preview/components/PageInfoSidebar.js +63 -55
  54. package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
  55. package/dist/features/preview/components/PagePicker.js +205 -153
  56. package/dist/features/preview/components/PageTree.js +366 -340
  57. package/dist/features/preview/components/PreviewActivation.js +78 -0
  58. package/dist/features/preview/components/PreviewPanel.js +98 -68
  59. package/dist/features/preview/components/PreviewToolbar.js +224 -241
  60. package/dist/features/preview/components/PreviewToolbarSpacer.js +43 -0
  61. package/dist/features/preview/components/PublicationRow.js +425 -0
  62. package/dist/features/preview/components/PublishDialog.js +180 -97
  63. package/dist/features/preview/components/RightSidebar.js +19 -34
  64. package/dist/features/preview/components/previewStyles.js +8 -0
  65. package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
  66. package/dist/features/preview/previewConstants.js +8 -0
  67. package/dist/features/preview/previewStore.js +18 -39
  68. package/dist/features/preview/publication.js +71 -0
  69. package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
  70. package/dist/features/provider/CoreCamoxProvider.js +11 -2
  71. package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
  72. package/dist/features/provider/useAdminShortcuts.js +5 -4
  73. package/dist/features/routes/pageRuntime.d.ts +10 -0
  74. package/dist/features/routes/pageRuntime.js +7 -9
  75. package/dist/features/runtime/PreviewDocumentContext.js +7 -0
  76. package/dist/features/runtime/RuntimeChrome.js +149 -0
  77. package/dist/features/runtime/SharedChromeContext.js +7 -0
  78. package/dist/features/runtime/navigationRequest.js +21 -0
  79. package/dist/features/runtime/navigationTarget.js +23 -0
  80. package/dist/features/runtime/pageApp.js +196 -121
  81. package/dist/features/runtime/pageNavigation.js +79 -130
  82. package/dist/features/runtime/runtime.d.ts +11 -0
  83. package/dist/features/runtime/runtime.js +183 -47
  84. package/dist/features/runtime/studioApp.d.ts +2 -11
  85. package/dist/features/runtime/studioApp.js +14 -177
  86. package/dist/features/studio/CamoxStudio.js +27 -13
  87. package/dist/features/studio/components/Navbar.js +80 -74
  88. package/dist/features/studio/components/UserButton.js +4 -4
  89. package/dist/features/studio/studioTheme.js +25 -0
  90. package/dist/features/studio/useTheme.js +94 -109
  91. package/dist/features/vite/appGeneration.js +12 -3
  92. package/dist/features/vite/definitionsSync.js +4 -2
  93. package/dist/features/vite/layoutGeneration.js +38 -0
  94. package/dist/features/vite/runtimeDev.js +3 -1
  95. package/dist/lib/auth.js +15 -13
  96. package/dist/lib/normalized-data.js +4 -4
  97. package/dist/lib/platform.js +13 -0
  98. package/dist/lib/utils.js +90 -38
  99. package/dist/studio-overlays.css +5 -40
  100. package/dist/studio.css +1 -1
  101. package/package.json +8 -4
  102. package/skills/camox/SKILL.md +2 -0
  103. package/skills/camox/references/block-definitions.md +31 -12
  104. package/skills/camox/references/layout-definitions.md +2 -0
  105. package/dist/core/lib/modifiers.js +0 -24
  106. package/dist/features/preview/components/DraftSwitchDialog.js +0 -66
  107. package/dist/features/preview/previewQueryFns.js +0 -23
  108. 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
- if (!currentPage) return skeleton;
58
- const peekedFullPath = peekedPagePathname ?? currentPage.fullPath;
59
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Popover, {
60
- open,
61
- onOpenChange: (value) => {
62
- if (!value) {
63
- closePopover();
64
- return;
65
- }
66
- setOpen(value);
67
- },
68
- children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
69
- render: /* @__PURE__ */ jsx(Button, {
70
- variant: "outline",
71
- role: "combobox",
72
- className: "min-w-0 flex-1 justify-between"
73
- }),
74
- children: [/* @__PURE__ */ jsxs("div", {
75
- className: "flex min-w-0 flex-1 items-center gap-2",
76
- children: [/* @__PURE__ */ jsx("span", {
77
- className: "truncate",
78
- children: currentPage.nickname
79
- }), /* @__PURE__ */ jsx(PageStatusBadge, {
80
- size: "sm",
81
- status: currentPage.status,
82
- modifiedReason: currentPage.modifiedReason
83
- })]
84
- }), /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
85
- }), /* @__PURE__ */ jsx(PopoverContent, {
86
- className: "flex h-[300px] w-[400px] flex-col p-0",
87
- align: "start",
88
- side: "bottom",
89
- children: /* @__PURE__ */ jsxs(Command, {
90
- value: peekedFullPath,
91
- onValueChange: (value_0) => {
92
- if (value_0 === CREATE_PAGE_VALUE) {
93
- previewStore.send({ type: "clearPeekedPage" });
94
- return;
95
- }
96
- previewStore.send({
97
- type: "setPeekedPage",
98
- pathname: value_0
99
- });
100
- },
101
- className: "flex flex-1 flex-col overflow-hidden",
102
- children: [
103
- /* @__PURE__ */ jsx(CommandInput, {
104
- placeholder: "Search page...",
105
- className: "h-9"
106
- }),
107
- /* @__PURE__ */ jsxs(CommandList, {
108
- className: "flex-1 overflow-y-auto",
109
- children: [/* @__PURE__ */ jsx(CommandEmpty, { children: "No page found." }), /* @__PURE__ */ jsx(CommandGroup, { children: pages.map((page_1) => /* @__PURE__ */ jsxs(CommandItem, {
110
- value: page_1.fullPath,
111
- className: "group/item justify-between",
112
- hideCheck: true,
113
- onSelect: () => {
114
- navigate({ to: page_1.fullPath });
115
- closePopover();
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-center gap-1.5",
123
- children: [/* @__PURE__ */ jsx("p", {
124
- className: "truncate",
125
- children: page_1.nickname
126
- }), /* @__PURE__ */ jsx(PageStatusBadge, {
127
- size: "sm",
128
- status: page_1.status,
129
- modifiedReason: page_1.modifiedReason
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
- }), /* @__PURE__ */ jsxs("div", {
137
- className: "hidden gap-1 group-data-[selected=true]/item:flex",
138
- children: [/* @__PURE__ */ jsx(Button, {
139
- variant: "ghost",
140
- size: "icon-sm",
141
- onClick: (e) => {
142
- e.stopPropagation();
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
- children: /* @__PURE__ */ jsx(Pencil, { className: "size-4" })
161
- }), page_1.fullPath !== "/" && /* @__PURE__ */ jsx(Button, {
162
- variant: "ghost",
163
- size: "icon-sm",
164
- onClick: (e_1) => {
165
- e_1.stopPropagation();
166
- setPageToDelete(page_1);
167
- },
168
- onKeyDown: (e_2) => {
169
- if (e_2.key === "Enter" || e_2.key === " ") {
170
- e_2.preventDefault();
171
- e_2.stopPropagation();
172
- setPageToDelete(page_1);
173
- }
174
- },
175
- children: /* @__PURE__ */ jsx(Trash2, { className: "size-4" })
176
- })]
177
- })]
178
- }, page_1.id)) })]
179
- }),
180
- /* @__PURE__ */ jsx(CommandSeparator, {}),
181
- /* @__PURE__ */ jsx(CommandGroup, { children: /* @__PURE__ */ jsxs(CommandItem, {
182
- onSelect: () => {
183
- closePopover();
184
- previewStore.send({ type: "openCreatePageModal" });
185
- },
186
- value: CREATE_PAGE_VALUE,
187
- children: [/* @__PURE__ */ jsx(Plus, { className: "size-4" }), "Create page"]
188
- }) })
189
- ]
190
- })
191
- })]
192
- }), /* @__PURE__ */ jsx(AlertDialog, {
193
- open: !!pageToDelete,
194
- onOpenChange: (open_0) => !open_0 && setPageToDelete(null),
195
- children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Delete page" }), /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
196
- "Are you sure you want to delete",
197
- " ",
198
- /* @__PURE__ */ jsx("strong", { children: pageToDelete ? pageToDelete.nickname : "" }),
199
- "? This action cannot be undone."
200
- ] })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
201
- variant: "outline",
202
- size: "default",
203
- children: "Cancel"
204
- }), /* @__PURE__ */ jsx(AlertDialogAction, {
205
- variant: "destructive",
206
- onClick: () => pageToDelete && handleDeletePage(pageToDelete),
207
- children: "Delete"
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