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.
Files changed (97) 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 +18 -15
  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/createEditableBlock.d.ts +9 -8
  17. package/dist/core/editing/createEditableBlock.js +167 -168
  18. package/dist/core/lib/lexicalReact.d.ts +1 -26
  19. package/dist/core/lib/lexicalReact.js +46 -60
  20. package/dist/core/lib/lexicalState.js +164 -81
  21. package/dist/core/lib/modifierFormats.js +4 -15
  22. package/dist/core/lib/textStyles.d.ts +27 -0
  23. package/dist/core/lib/textStyles.js +47 -0
  24. package/dist/features/navigation/navigation.d.ts +2 -0
  25. package/dist/features/navigation/navigation.js +51 -46
  26. package/dist/features/page/DerivedPageContent.js +61 -0
  27. package/dist/features/page/PublishedPageContent.js +52 -83
  28. package/dist/features/page/SharedLayoutContent.js +66 -0
  29. package/dist/features/preview/CamoxPreview.d.ts +16 -1
  30. package/dist/features/preview/CamoxPreview.js +242 -265
  31. package/dist/features/preview/DerivedPreview.js +137 -0
  32. package/dist/features/preview/EditablePageExperience.js +25 -8
  33. package/dist/features/preview/components/AddBlockSidebar.js +43 -33
  34. package/dist/features/preview/components/AssetLightbox.js +1 -1
  35. package/dist/features/preview/components/BlockThumbnail.js +192 -0
  36. package/dist/features/preview/components/CreatePageModal.js +123 -115
  37. package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
  38. package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
  39. package/dist/features/preview/components/DerivedLayoutSidebar.js +163 -0
  40. package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
  41. package/dist/features/preview/components/FieldToolbar.js +42 -20
  42. package/dist/features/preview/components/Frame.js +133 -140
  43. package/dist/features/preview/components/LeftSidebar.js +42 -38
  44. package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
  45. package/dist/features/preview/components/Overlays.js +57 -42
  46. package/dist/features/preview/components/PageInfoSidebar.js +63 -55
  47. package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
  48. package/dist/features/preview/components/PagePicker.js +205 -153
  49. package/dist/features/preview/components/PageTree.js +298 -206
  50. package/dist/features/preview/components/PreviewActivation.js +78 -0
  51. package/dist/features/preview/components/PreviewPanel.js +67 -35
  52. package/dist/features/preview/components/PreviewToolbar.js +218 -232
  53. package/dist/features/preview/components/PublicationRow.js +431 -0
  54. package/dist/features/preview/components/PublishDialog.js +180 -97
  55. package/dist/features/preview/components/RightSidebar.js +19 -34
  56. package/dist/features/preview/components/previewStyles.js +8 -0
  57. package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
  58. package/dist/features/preview/previewConstants.js +8 -0
  59. package/dist/features/preview/previewStore.js +0 -10
  60. package/dist/features/preview/publication.js +71 -0
  61. package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
  62. package/dist/features/provider/CoreCamoxProvider.js +11 -2
  63. package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
  64. package/dist/features/routes/pageRuntime.d.ts +10 -0
  65. package/dist/features/routes/pageRuntime.js +7 -9
  66. package/dist/features/runtime/PreviewDocumentContext.js +7 -0
  67. package/dist/features/runtime/RuntimeChrome.js +137 -0
  68. package/dist/features/runtime/SharedChromeContext.js +7 -0
  69. package/dist/features/runtime/navigationRequest.js +21 -0
  70. package/dist/features/runtime/navigationTarget.js +23 -0
  71. package/dist/features/runtime/pageApp.js +196 -121
  72. package/dist/features/runtime/pageNavigation.js +79 -130
  73. package/dist/features/runtime/runtime.d.ts +11 -0
  74. package/dist/features/runtime/runtime.js +183 -47
  75. package/dist/features/runtime/studioApp.d.ts +2 -11
  76. package/dist/features/runtime/studioApp.js +14 -177
  77. package/dist/features/studio/CamoxStudio.js +27 -13
  78. package/dist/features/studio/components/Navbar.js +80 -74
  79. package/dist/features/studio/studioTheme.js +25 -0
  80. package/dist/features/studio/useTheme.js +94 -109
  81. package/dist/features/vite/appGeneration.js +12 -3
  82. package/dist/features/vite/definitionsSync.js +4 -2
  83. package/dist/features/vite/layoutGeneration.js +38 -0
  84. package/dist/features/vite/runtimeDev.js +3 -1
  85. package/dist/lib/auth.js +15 -13
  86. package/dist/lib/normalized-data.js +4 -4
  87. package/dist/lib/platform.js +13 -0
  88. package/dist/lib/utils.js +90 -38
  89. package/dist/studio-overlays.css +5 -40
  90. package/dist/studio.css +1 -1
  91. package/package.json +8 -4
  92. package/skills/camox/SKILL.md +2 -0
  93. package/skills/camox/references/block-definitions.md +31 -12
  94. package/skills/camox/references/layout-definitions.md +2 -0
  95. package/dist/core/lib/modifiers.js +0 -24
  96. package/dist/features/preview/previewQueryFns.js +0 -23
  97. package/dist/features/runtime/studioNavigation.js +0 -120
@@ -1,460 +1,17 @@
1
- import { useLocation } from "../../navigation/navigation.js";
2
- import { actionsStore } from "../../provider/actionsStore.js";
3
- import { pageMutations } from "../../../lib/queries.js";
4
- import { trackClientEvent } from "../../../lib/telemetry-client.js";
5
- import { previewStore } from "../previewStore.js";
6
1
  import { PagePicker } from "./PagePicker.js";
7
2
  import { PageTree } from "./PageTree.js";
8
- import { PublishDialog } from "./PublishDialog.js";
3
+ import { PublicationRow } from "./PublicationRow.js";
9
4
  import { c } from "react/compiler-runtime";
10
- import { useMutation, useQueryClient } from "@tanstack/react-query";
11
- import * as React from "react";
12
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
- import { useSelector } from "@xstate/store-react";
14
- import { queryKeys } from "@camox/api-contract/query-keys";
15
- import { Button } from "@camox/ui/button";
16
- import { MoreHorizontal } from "lucide-react";
17
- import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
18
- import { toast } from "@camox/ui/toaster";
19
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
6
+ import { Alert, AlertDescription, AlertTitle } from "@camox/ui/alert";
20
7
  import { PanelContent, PanelHeader } from "@camox/ui/panel";
21
- import { ButtonGroup } from "@camox/ui/button-group";
22
8
 
23
9
  //#region src/features/preview/components/PageNavigatorSidebar.tsx
24
- const PageNavigatorPublishRow = (t0) => {
25
- const $ = c(86);
26
- if ($[0] !== "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863") {
27
- for (let $i = 0; $i < 86; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
28
- $[0] = "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863";
29
- }
30
- const { page } = t0;
31
- const previewSource = useSelector(previewStore, _temp);
32
- const queryClient = useQueryClient();
33
- const { pathname } = useLocation();
34
- const [isPublishDialogOpen, setIsPublishDialogOpen] = React.useState(false);
35
- const [isUnpublishDialogOpen, setIsUnpublishDialogOpen] = React.useState(false);
36
- const [isDiscardDialogOpen, setIsDiscardDialogOpen] = React.useState(false);
37
- let t1;
38
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
39
- t1 = pageMutations.unpublish();
40
- $[1] = t1;
41
- } else t1 = $[1];
42
- const unpublishPage = useMutation(t1);
43
- let t2;
44
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
45
- t2 = pageMutations.discardChanges();
46
- $[2] = t2;
47
- } else t2 = $[2];
48
- const discardChanges = useMutation(t2);
49
- const hasLiveCheckpoint = page.livePublishedCheckpointId != null;
50
- const isHomePage = page.fullPath === "/";
51
- const canPublish = (page.status === "draft" || page.status === "modified") && previewSource === "draft";
52
- const canDiscardChanges = page.status === "modified";
53
- let t3;
54
- if ($[3] !== page.modifiedReason) {
55
- t3 = page.modifiedReason && (page.modifiedReason.reason === "layout" || page.modifiedReason.reason === "both") ? {
56
- layoutHandle: page.modifiedReason.layoutHandle,
57
- affectedPagesCount: page.modifiedReason.affectedPagesCount
58
- } : null;
59
- $[3] = page.modifiedReason;
60
- $[4] = t3;
61
- } else t3 = $[4];
62
- const layoutCascade = t3;
63
- const publishLabel = page.status === "modified" ? "Publish changes" : "Publish page";
64
- let t4;
65
- let t5;
66
- if ($[5] !== canDiscardChanges || $[6] !== canPublish || $[7] !== discardChanges.isPending || $[8] !== hasLiveCheckpoint || $[9] !== isHomePage || $[10] !== publishLabel || $[11] !== unpublishPage.isPending) {
67
- t4 = () => {
68
- const actions = [
69
- {
70
- id: "publish-current-page",
71
- label: publishLabel,
72
- aliases: [
73
- "Publish",
74
- "Publish page",
75
- "Make live"
76
- ],
77
- groupLabel: "Preview",
78
- checkIfAvailable: () => canPublish,
79
- execute: () => setIsPublishDialogOpen(true)
80
- },
81
- {
82
- id: "unpublish-current-page",
83
- label: "Unpublish page",
84
- aliases: [
85
- "Take offline",
86
- "Remove from live",
87
- "Hide page"
88
- ],
89
- groupLabel: "Preview",
90
- checkIfAvailable: () => hasLiveCheckpoint && !isHomePage && !unpublishPage.isPending,
91
- execute: () => setIsUnpublishDialogOpen(true)
92
- },
93
- {
94
- id: "discard-current-page-changes",
95
- label: "Discard page changes",
96
- aliases: [
97
- "Revert page",
98
- "Reset page",
99
- "Discard draft"
100
- ],
101
- groupLabel: "Preview",
102
- checkIfAvailable: () => canDiscardChanges && !discardChanges.isPending,
103
- execute: () => setIsDiscardDialogOpen(true)
104
- }
105
- ];
106
- actionsStore.send({
107
- type: "registerManyActions",
108
- actions
109
- });
110
- return () => actionsStore.send({
111
- type: "unregisterManyActions",
112
- ids: actions.map(_temp2)
113
- });
114
- };
115
- t5 = [
116
- canDiscardChanges,
117
- canPublish,
118
- discardChanges.isPending,
119
- hasLiveCheckpoint,
120
- isHomePage,
121
- publishLabel,
122
- unpublishPage.isPending
123
- ];
124
- $[5] = canDiscardChanges;
125
- $[6] = canPublish;
126
- $[7] = discardChanges.isPending;
127
- $[8] = hasLiveCheckpoint;
128
- $[9] = isHomePage;
129
- $[10] = publishLabel;
130
- $[11] = unpublishPage.isPending;
131
- $[12] = t4;
132
- $[13] = t5;
133
- } else {
134
- t4 = $[12];
135
- t5 = $[13];
136
- }
137
- React.useEffect(t4, t5);
138
- let t6;
139
- if ($[14] !== isHomePage || $[15] !== page.id || $[16] !== pathname || $[17] !== queryClient || $[18] !== unpublishPage) {
140
- t6 = async () => {
141
- if (isHomePage) return;
142
- try {
143
- await unpublishPage.mutateAsync({ id: page.id });
144
- queryClient.setQueryData(queryKeys.pages.getByPath(pathname, "draft"), _temp3);
145
- queryClient.setQueryData(queryKeys.pages.list, (current_0) => current_0?.map((item) => item.id === page.id ? {
146
- ...item,
147
- livePublishedCheckpointId: null,
148
- status: "draft",
149
- modifiedReason: null
150
- } : item));
151
- previewStore.send({
152
- type: "setPreviewSource",
153
- source: "draft"
154
- });
155
- trackClientEvent("page_unpublished", { pageId: page.id });
156
- toast.success("Unpublished this page");
157
- setIsUnpublishDialogOpen(false);
158
- } catch (t7) {
159
- console.error("Failed to unpublish page:", t7);
160
- toast.error("Could not unpublish this page");
161
- }
162
- };
163
- $[14] = isHomePage;
164
- $[15] = page.id;
165
- $[16] = pathname;
166
- $[17] = queryClient;
167
- $[18] = unpublishPage;
168
- $[19] = t6;
169
- } else t6 = $[19];
170
- const handleUnpublish = t6;
171
- let t7;
172
- if ($[20] !== discardChanges || $[21] !== page.id) {
173
- t7 = async () => {
174
- try {
175
- await discardChanges.mutateAsync({ id: page.id });
176
- previewStore.send({
177
- type: "setPreviewSource",
178
- source: "draft"
179
- });
180
- trackClientEvent("page_changes_discarded", { pageId: page.id });
181
- toast.success("Discarded draft changes");
182
- setIsDiscardDialogOpen(false);
183
- } catch (t8) {
184
- console.error("Failed to discard page changes:", t8);
185
- toast.error("Could not discard draft changes");
186
- }
187
- };
188
- $[20] = discardChanges;
189
- $[21] = page.id;
190
- $[22] = t7;
191
- } else t7 = $[22];
192
- const handleDiscardChanges = t7;
193
- const t8 = !canPublish;
194
- let t9;
195
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
196
- t9 = () => setIsPublishDialogOpen(true);
197
- $[23] = t9;
198
- } else t9 = $[23];
199
- let t10;
200
- if ($[24] !== publishLabel || $[25] !== t8) {
201
- t10 = /* @__PURE__ */ jsx(Button, {
202
- variant: "outline",
203
- type: "button",
204
- disabled: t8,
205
- onClick: t9,
206
- className: "flex-1",
207
- children: publishLabel
208
- });
209
- $[24] = publishLabel;
210
- $[25] = t8;
211
- $[26] = t10;
212
- } else t10 = $[26];
213
- let t11;
214
- if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
215
- t11 = /* @__PURE__ */ jsx(DropdownMenuTrigger, {
216
- render: /* @__PURE__ */ jsx(Button, {
217
- type: "button",
218
- variant: "outline",
219
- size: "icon",
220
- "aria-label": "More publish actions"
221
- }),
222
- children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "text-muted-foreground" })
223
- });
224
- $[27] = t11;
225
- } else t11 = $[27];
226
- const t12 = !hasLiveCheckpoint || isHomePage || unpublishPage.isPending;
227
- let t13;
228
- if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
229
- t13 = () => setIsUnpublishDialogOpen(true);
230
- $[28] = t13;
231
- } else t13 = $[28];
232
- let t14;
233
- if ($[29] !== t12) {
234
- t14 = /* @__PURE__ */ jsx(DropdownMenuItem, {
235
- disabled: t12,
236
- onClick: t13,
237
- children: "Unpublish"
238
- });
239
- $[29] = t12;
240
- $[30] = t14;
241
- } else t14 = $[30];
242
- const t15 = !canDiscardChanges || discardChanges.isPending;
243
- let t16;
244
- if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
245
- t16 = () => setIsDiscardDialogOpen(true);
246
- $[31] = t16;
247
- } else t16 = $[31];
248
- let t17;
249
- if ($[32] !== t15) {
250
- t17 = /* @__PURE__ */ jsx(DropdownMenuItem, {
251
- disabled: t15,
252
- onClick: t16,
253
- children: "Discard changes"
254
- });
255
- $[32] = t15;
256
- $[33] = t17;
257
- } else t17 = $[33];
258
- let t18;
259
- if ($[34] !== t14 || $[35] !== t17) {
260
- t18 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t11, /* @__PURE__ */ jsxs(DropdownMenuContent, {
261
- align: "end",
262
- className: "w-42",
263
- children: [t14, t17]
264
- })] });
265
- $[34] = t14;
266
- $[35] = t17;
267
- $[36] = t18;
268
- } else t18 = $[36];
269
- let t19;
270
- if ($[37] !== t10 || $[38] !== t18) {
271
- t19 = /* @__PURE__ */ jsx("div", {
272
- className: "flex flex-col gap-2",
273
- children: /* @__PURE__ */ jsxs(ButtonGroup, {
274
- className: "w-full",
275
- children: [t10, t18]
276
- })
277
- });
278
- $[37] = t10;
279
- $[38] = t18;
280
- $[39] = t19;
281
- } else t19 = $[39];
282
- const t20 = isPublishDialogOpen ? page : null;
283
- let t21;
284
- if ($[40] !== isPublishDialogOpen || $[41] !== layoutCascade || $[42] !== page.status || $[43] !== t20) {
285
- t21 = /* @__PURE__ */ jsx(PublishDialog, {
286
- page: t20,
287
- pageStatus: page.status,
288
- alsoPublishLayout: layoutCascade,
289
- open: isPublishDialogOpen,
290
- onOpenChange: setIsPublishDialogOpen
291
- });
292
- $[40] = isPublishDialogOpen;
293
- $[41] = layoutCascade;
294
- $[42] = page.status;
295
- $[43] = t20;
296
- $[44] = t21;
297
- } else t21 = $[44];
298
- let t22;
299
- if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
300
- t22 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Unpublish page" });
301
- $[45] = t22;
302
- } else t22 = $[45];
303
- let t23;
304
- if ($[46] !== page.fullPath) {
305
- t23 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t22, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
306
- "Visitors at",
307
- " ",
308
- /* @__PURE__ */ jsx("code", {
309
- className: "bg-muted rounded px-1 py-0.5 font-mono text-xs",
310
- children: page.fullPath
311
- }),
312
- " ",
313
- "will get a 404. The draft stays available in Camox Studio."
314
- ] })] });
315
- $[46] = page.fullPath;
316
- $[47] = t23;
317
- } else t23 = $[47];
318
- let t24;
319
- if ($[48] !== unpublishPage.isPending) {
320
- t24 = /* @__PURE__ */ jsx(AlertDialogCancel, {
321
- variant: "outline",
322
- size: "default",
323
- disabled: unpublishPage.isPending,
324
- children: "Cancel"
325
- });
326
- $[48] = unpublishPage.isPending;
327
- $[49] = t24;
328
- } else t24 = $[49];
329
- const t25 = isHomePage || unpublishPage.isPending;
330
- const t26 = unpublishPage.isPending ? "Unpublishing…" : "Unpublish";
331
- let t27;
332
- if ($[50] !== handleUnpublish || $[51] !== t25 || $[52] !== t26) {
333
- t27 = /* @__PURE__ */ jsx(AlertDialogAction, {
334
- onClick: handleUnpublish,
335
- disabled: t25,
336
- children: t26
337
- });
338
- $[50] = handleUnpublish;
339
- $[51] = t25;
340
- $[52] = t26;
341
- $[53] = t27;
342
- } else t27 = $[53];
343
- let t28;
344
- if ($[54] !== t24 || $[55] !== t27) {
345
- t28 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t24, t27] });
346
- $[54] = t24;
347
- $[55] = t27;
348
- $[56] = t28;
349
- } else t28 = $[56];
350
- let t29;
351
- if ($[57] !== t23 || $[58] !== t28) {
352
- t29 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t23, t28] });
353
- $[57] = t23;
354
- $[58] = t28;
355
- $[59] = t29;
356
- } else t29 = $[59];
357
- let t30;
358
- if ($[60] !== isUnpublishDialogOpen || $[61] !== t29) {
359
- t30 = /* @__PURE__ */ jsx(AlertDialog, {
360
- open: isUnpublishDialogOpen,
361
- onOpenChange: setIsUnpublishDialogOpen,
362
- children: t29
363
- });
364
- $[60] = isUnpublishDialogOpen;
365
- $[61] = t29;
366
- $[62] = t30;
367
- } else t30 = $[62];
368
- let t31;
369
- if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
370
- t31 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Discard draft changes" });
371
- $[63] = t31;
372
- } else t31 = $[63];
373
- let t32;
374
- if ($[64] !== page.fullPath) {
375
- t32 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t31, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
376
- "The draft for",
377
- " ",
378
- /* @__PURE__ */ jsx("code", {
379
- className: "bg-muted rounded px-1 py-0.5 font-mono text-xs",
380
- children: page.fullPath
381
- }),
382
- " ",
383
- "will be reset to match the currently published version. This does not change what visitors see."
384
- ] })] });
385
- $[64] = page.fullPath;
386
- $[65] = t32;
387
- } else t32 = $[65];
388
- let t33;
389
- if ($[66] !== discardChanges.isPending) {
390
- t33 = /* @__PURE__ */ jsx(AlertDialogCancel, {
391
- variant: "outline",
392
- size: "default",
393
- disabled: discardChanges.isPending,
394
- children: "Cancel"
395
- });
396
- $[66] = discardChanges.isPending;
397
- $[67] = t33;
398
- } else t33 = $[67];
399
- const t34 = discardChanges.isPending ? "Discarding…" : "Discard changes";
400
- let t35;
401
- if ($[68] !== discardChanges.isPending || $[69] !== handleDiscardChanges || $[70] !== t34) {
402
- t35 = /* @__PURE__ */ jsx(AlertDialogAction, {
403
- onClick: handleDiscardChanges,
404
- disabled: discardChanges.isPending,
405
- children: t34
406
- });
407
- $[68] = discardChanges.isPending;
408
- $[69] = handleDiscardChanges;
409
- $[70] = t34;
410
- $[71] = t35;
411
- } else t35 = $[71];
412
- let t36;
413
- if ($[72] !== t33 || $[73] !== t35) {
414
- t36 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t33, t35] });
415
- $[72] = t33;
416
- $[73] = t35;
417
- $[74] = t36;
418
- } else t36 = $[74];
419
- let t37;
420
- if ($[75] !== t32 || $[76] !== t36) {
421
- t37 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t32, t36] });
422
- $[75] = t32;
423
- $[76] = t36;
424
- $[77] = t37;
425
- } else t37 = $[77];
426
- let t38;
427
- if ($[78] !== isDiscardDialogOpen || $[79] !== t37) {
428
- t38 = /* @__PURE__ */ jsx(AlertDialog, {
429
- open: isDiscardDialogOpen,
430
- onOpenChange: setIsDiscardDialogOpen,
431
- children: t37
432
- });
433
- $[78] = isDiscardDialogOpen;
434
- $[79] = t37;
435
- $[80] = t38;
436
- } else t38 = $[80];
437
- let t39;
438
- if ($[81] !== t19 || $[82] !== t21 || $[83] !== t30 || $[84] !== t38) {
439
- t39 = /* @__PURE__ */ jsxs(Fragment, { children: [
440
- t19,
441
- t21,
442
- t30,
443
- t38
444
- ] });
445
- $[81] = t19;
446
- $[82] = t21;
447
- $[83] = t30;
448
- $[84] = t38;
449
- $[85] = t39;
450
- } else t39 = $[85];
451
- return t39;
452
- };
453
10
  const PageNavigatorHeader = (t0) => {
454
- const $ = c(4);
455
- if ($[0] !== "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863") {
456
- for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
457
- $[0] = "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863";
11
+ const $ = c(6);
12
+ if ($[0] !== "c9e1cb06c4c83f6db81cab1bef09e7027f12e148a96509207d5fe9eb043f50eb") {
13
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
14
+ $[0] = "c9e1cb06c4c83f6db81cab1bef09e7027f12e148a96509207d5fe9eb043f50eb";
458
15
  }
459
16
  const { page } = t0;
460
17
  let t1;
@@ -467,20 +24,29 @@ const PageNavigatorHeader = (t0) => {
467
24
  } else t1 = $[1];
468
25
  let t2;
469
26
  if ($[2] !== page) {
470
- t2 = /* @__PURE__ */ jsxs(PanelHeader, {
471
- className: "flex flex-col gap-2 px-2 pt-2 pb-3",
472
- children: [t1, /* @__PURE__ */ jsx(PageNavigatorPublishRow, { page })]
473
- });
27
+ t2 = page && /* @__PURE__ */ jsx(PublicationRow, { target: {
28
+ kind: "page",
29
+ page
30
+ } });
474
31
  $[2] = page;
475
32
  $[3] = t2;
476
33
  } else t2 = $[3];
477
- return t2;
34
+ let t3;
35
+ if ($[4] !== t2) {
36
+ t3 = /* @__PURE__ */ jsxs(PanelHeader, {
37
+ className: "flex flex-col gap-2 p-2",
38
+ children: [t1, t2]
39
+ });
40
+ $[4] = t2;
41
+ $[5] = t3;
42
+ } else t3 = $[5];
43
+ return t3;
478
44
  };
479
45
  const PageNavigatorSidebar = (t0) => {
480
- const $ = c(6);
481
- if ($[0] !== "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863") {
482
- for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
483
- $[0] = "2915f869d656485105344add68411e21930be9804f68664ad81148c2ec2fd863";
46
+ const $ = c(8);
47
+ if ($[0] !== "c9e1cb06c4c83f6db81cab1bef09e7027f12e148a96509207d5fe9eb043f50eb") {
48
+ for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
49
+ $[0] = "c9e1cb06c4c83f6db81cab1bef09e7027f12e148a96509207d5fe9eb043f50eb";
484
50
  }
485
51
  const { page } = t0;
486
52
  let t1;
@@ -490,38 +56,23 @@ const PageNavigatorSidebar = (t0) => {
490
56
  $[2] = t1;
491
57
  } else t1 = $[2];
492
58
  let t2;
493
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
59
+ if ($[3] !== page) {
494
60
  t2 = /* @__PURE__ */ jsx(PanelContent, {
495
61
  className: "flex grow basis-0 flex-col gap-2 overflow-auto p-2",
496
- children: /* @__PURE__ */ jsx(PageTree, {})
62
+ children: page ? /* @__PURE__ */ jsx(PageTree, {}) : /* @__PURE__ */ jsxs(Alert, { children: [/* @__PURE__ */ jsx(AlertTitle, { children: "No page blocks" }), /* @__PURE__ */ jsx(AlertDescription, { children: "This page’s content is generated by its layout, rather than assembled from page blocks." })] })
497
63
  });
498
- $[3] = t2;
499
- } else t2 = $[3];
64
+ $[3] = page;
65
+ $[4] = t2;
66
+ } else t2 = $[4];
500
67
  let t3;
501
- if ($[4] !== t1) {
68
+ if ($[5] !== t1 || $[6] !== t2) {
502
69
  t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] });
503
- $[4] = t1;
504
- $[5] = t3;
505
- } else t3 = $[5];
70
+ $[5] = t1;
71
+ $[6] = t2;
72
+ $[7] = t3;
73
+ } else t3 = $[7];
506
74
  return t3;
507
75
  };
508
- function _temp(state) {
509
- return state.context.previewSource;
510
- }
511
- function _temp2(a) {
512
- return a.id;
513
- }
514
- function _temp3(current) {
515
- return current ? {
516
- ...current,
517
- page: {
518
- ...current.page,
519
- livePublishedCheckpointId: null,
520
- status: "draft",
521
- modifiedReason: null
522
- }
523
- } : current;
524
- }
525
76
 
526
77
  //#endregion
527
78
  export { PageNavigatorHeader, PageNavigatorSidebar };