camox 0.14.2 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/components/AuthGate.js +6 -0
  2. package/dist/core/components/AddBlockControlBar.js +30 -26
  3. package/dist/core/components/lexical/InlineContentEditable.js +19 -15
  4. package/dist/core/components/lexical/InlineLexicalEditor.js +62 -42
  5. package/dist/core/components/lexical/SelectionBroadcaster.js +25 -21
  6. package/dist/core/components/lexical/SidebarLexicalEditor.js +33 -21
  7. package/dist/core/createBlock.js +524 -488
  8. package/dist/core/createLayout.js +40 -28
  9. package/dist/core/hooks/useFieldSelection.js +12 -8
  10. package/dist/core/hooks/useIsEditable.js +6 -0
  11. package/dist/core/hooks/useOverlayMessage.js +19 -15
  12. package/dist/core/lib/contentType.d.ts +8 -8
  13. package/dist/core/lib/contentType.js +63 -0
  14. package/dist/features/content/CamoxContent.js +92 -88
  15. package/dist/features/content/components/AssetCard.js +46 -42
  16. package/dist/features/content/components/AssetCardSkeleton.js +8 -4
  17. package/dist/features/content/components/ContentSidebar.js +8 -4
  18. package/dist/features/content/components/UploadDropZone.js +31 -27
  19. package/dist/features/content/components/UploadProgressDrawer.js +98 -90
  20. package/dist/features/preview/CamoxPreview.js +162 -146
  21. package/dist/features/preview/components/AddBlockSheet.js +105 -101
  22. package/dist/features/preview/components/AgentChatSheet.js +74 -21
  23. package/dist/features/preview/components/AssetFieldEditor.js +98 -90
  24. package/dist/features/preview/components/AssetLightbox.js +21 -17
  25. package/dist/features/preview/components/AssetPickerGrid.js +84 -80
  26. package/dist/features/preview/components/BlockActionsPopover.js +35 -31
  27. package/dist/features/preview/components/BlockErrorBoundary.js +12 -8
  28. package/dist/features/preview/components/CreatePageModal.js +1 -1
  29. package/dist/features/preview/components/DebouncedFieldEditor.js +41 -37
  30. package/dist/features/preview/components/EditPageModal.js +114 -98
  31. package/dist/features/preview/components/FieldOverlayStyles.js +8 -4
  32. package/dist/features/preview/components/FieldToolbar.js +95 -54
  33. package/dist/features/preview/components/Frame.js +50 -46
  34. package/dist/features/preview/components/ItemFieldsEditor.js +81 -79
  35. package/dist/features/preview/components/LinkFieldEditor.js +138 -134
  36. package/dist/features/preview/components/MultipleAssetFieldEditor.js +105 -97
  37. package/dist/features/preview/components/OverlayTracker.js +19 -15
  38. package/dist/features/preview/components/Overlays.js +27 -23
  39. package/dist/features/preview/components/PageContentSheet.js +54 -4
  40. package/dist/features/preview/components/PageLocationFieldset.js +113 -109
  41. package/dist/features/preview/components/PagePicker.js +1 -1
  42. package/dist/features/preview/components/PageTree.js +443 -399
  43. package/dist/features/preview/components/PeekedBlock.js +69 -65
  44. package/dist/features/preview/components/PreviewPanel.js +64 -52
  45. package/dist/features/preview/components/PreviewSideSheet.js +25 -16
  46. package/dist/features/preview/components/PreviewToolbar.js +127 -123
  47. package/dist/features/preview/components/RepeatableItemsList.js +176 -171
  48. package/dist/features/preview/components/ShikiMarkdown.js +18 -14
  49. package/dist/features/preview/components/UnlinkAssetButton.js +74 -70
  50. package/dist/features/preview/components/useRepeatableItemActions.js +266 -0
  51. package/dist/features/preview/components/useUpdateBlockPosition.js +13 -9
  52. package/dist/features/provider/CamoxProvider.js +60 -52
  53. package/dist/features/provider/components/CamoxAppContext.js +10 -6
  54. package/dist/features/provider/components/CommandPalette.js +77 -69
  55. package/dist/features/provider/useAdminShortcuts.js +11 -7
  56. package/dist/features/routes/pageRoute.js +8 -4
  57. package/dist/features/studio/CamoxStudio.js +23 -19
  58. package/dist/features/studio/components/EnvironmentMenu.js +32 -28
  59. package/dist/features/studio/components/Navbar.js +62 -54
  60. package/dist/features/studio/components/ProjectMenu.js +131 -123
  61. package/dist/features/studio/components/UserButton.js +15 -11
  62. package/dist/features/studio/useTheme.js +82 -42
  63. package/dist/features/vite/definitionsSync.js +5 -5
  64. package/dist/features/vite/skillGeneration.js +43 -8
  65. package/dist/features/vite/vite.d.ts +1 -1
  66. package/dist/features/vite/vite.js +20 -2
  67. package/dist/hooks/use-marquee-selection.js +36 -32
  68. package/dist/lib/auth.js +49 -22
  69. package/dist/lib/normalized-data.js +55 -47
  70. package/dist/lib/use-project-room.js +22 -18
  71. package/dist/studio.css +1 -1
  72. package/package.json +10 -11
  73. package/skills/camox-block/SKILL.md +4 -0
  74. package/skills/camox-cli/SKILL.md +142 -0
  75. package/skills/camox-layout/SKILL.md +4 -0
@@ -67,7 +67,11 @@ function pageFullQueryFn(queryClient, path, projectSlug) {
67
67
  };
68
68
  }
69
69
  function usePreviewedPage() {
70
- const $ = c(21);
70
+ const $ = c(22);
71
+ if ($[0] !== "b803e8bbb91b7986d49da585480a8df1d0a53a974dfaa5c596024b3634d8a3fa") {
72
+ for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
73
+ $[0] = "b803e8bbb91b7986d49da585480a8df1d0a53a974dfaa5c596024b3634d8a3fa";
74
+ }
71
75
  const { pathname } = useLocation();
72
76
  const queryClient = useQueryClient();
73
77
  const projectSlug = useProjectSlug();
@@ -75,7 +79,7 @@ function usePreviewedPage() {
75
79
  const prevPathnameRef = React.useRef(pathname);
76
80
  let t0;
77
81
  let t1;
78
- if ($[0] !== pathname) {
82
+ if ($[1] !== pathname) {
79
83
  t0 = () => {
80
84
  if (prevPathnameRef.current !== pathname) {
81
85
  prevPathnameRef.current = pathname;
@@ -83,58 +87,58 @@ function usePreviewedPage() {
83
87
  }
84
88
  };
85
89
  t1 = [pathname];
86
- $[0] = pathname;
87
- $[1] = t0;
88
- $[2] = t1;
90
+ $[1] = pathname;
91
+ $[2] = t0;
92
+ $[3] = t1;
89
93
  } else {
90
- t0 = $[1];
91
- t1 = $[2];
94
+ t0 = $[2];
95
+ t1 = $[3];
92
96
  }
93
97
  React.useEffect(t0, t1);
94
98
  let t2;
95
- if ($[3] !== pathname) {
99
+ if ($[4] !== pathname) {
96
100
  t2 = queryKeys.pages.getByPath(pathname);
97
- $[3] = pathname;
98
- $[4] = t2;
99
- } else t2 = $[4];
101
+ $[4] = pathname;
102
+ $[5] = t2;
103
+ } else t2 = $[5];
100
104
  let t3;
101
- if ($[5] !== pathname || $[6] !== projectSlug) {
105
+ if ($[6] !== pathname || $[7] !== projectSlug) {
102
106
  t3 = pageStructureQueryFn(pathname, projectSlug);
103
- $[5] = pathname;
104
- $[6] = projectSlug;
105
- $[7] = t3;
106
- } else t3 = $[7];
107
+ $[6] = pathname;
108
+ $[7] = projectSlug;
109
+ $[8] = t3;
110
+ } else t3 = $[8];
107
111
  let t4;
108
- if ($[8] !== t2 || $[9] !== t3) {
112
+ if ($[9] !== t2 || $[10] !== t3) {
109
113
  t4 = {
110
114
  queryKey: t2,
111
115
  queryFn: t3,
112
116
  staleTime: Infinity
113
117
  };
114
- $[8] = t2;
115
- $[9] = t3;
116
- $[10] = t4;
117
- } else t4 = $[10];
118
+ $[9] = t2;
119
+ $[10] = t3;
120
+ $[11] = t4;
121
+ } else t4 = $[11];
118
122
  const { data: currentPage } = useSuspenseQuery(t4);
119
123
  const isAuthenticated = useIsAuthenticated();
120
124
  let t5;
121
- if ($[11] !== peekedPagePathname) {
125
+ if ($[12] !== peekedPagePathname) {
122
126
  t5 = queryKeys.pages.getByPath(peekedPagePathname ?? "");
123
- $[11] = peekedPagePathname;
124
- $[12] = t5;
125
- } else t5 = $[12];
127
+ $[12] = peekedPagePathname;
128
+ $[13] = t5;
129
+ } else t5 = $[13];
126
130
  const t6 = peekedPagePathname ?? "";
127
131
  let t7;
128
- if ($[13] !== projectSlug || $[14] !== queryClient || $[15] !== t6) {
132
+ if ($[14] !== projectSlug || $[15] !== queryClient || $[16] !== t6) {
129
133
  t7 = pageFullQueryFn(queryClient, t6, projectSlug);
130
- $[13] = projectSlug;
131
- $[14] = queryClient;
132
- $[15] = t6;
133
- $[16] = t7;
134
- } else t7 = $[16];
134
+ $[14] = projectSlug;
135
+ $[15] = queryClient;
136
+ $[16] = t6;
137
+ $[17] = t7;
138
+ } else t7 = $[17];
135
139
  const t8 = isAuthenticated && !!peekedPagePathname;
136
140
  let t9;
137
- if ($[17] !== t5 || $[18] !== t7 || $[19] !== t8) {
141
+ if ($[18] !== t5 || $[19] !== t7 || $[20] !== t8) {
138
142
  t9 = {
139
143
  queryKey: t5,
140
144
  queryFn: t7,
@@ -142,11 +146,11 @@ function usePreviewedPage() {
142
146
  placeholderData: keepPreviousData,
143
147
  staleTime: Infinity
144
148
  };
145
- $[17] = t5;
146
- $[18] = t7;
147
- $[19] = t8;
148
- $[20] = t9;
149
- } else t9 = $[20];
149
+ $[18] = t5;
150
+ $[19] = t7;
151
+ $[20] = t8;
152
+ $[21] = t9;
153
+ } else t9 = $[21];
150
154
  const { data: peekedPage } = useQuery(t9);
151
155
  return peekedPagePathname ? peekedPage ?? currentPage : currentPage;
152
156
  }
@@ -154,23 +158,27 @@ function _temp(state) {
154
158
  return state.context.peekedPagePathname;
155
159
  }
156
160
  const BlockRenderer = (t0) => {
157
- const $ = c(21);
161
+ const $ = c(22);
162
+ if ($[0] !== "b803e8bbb91b7986d49da585480a8df1d0a53a974dfaa5c596024b3634d8a3fa") {
163
+ for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
164
+ $[0] = "b803e8bbb91b7986d49da585480a8df1d0a53a974dfaa5c596024b3634d8a3fa";
165
+ }
158
166
  const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
159
167
  let t1;
160
- if ($[0] !== blockId) {
168
+ if ($[1] !== blockId) {
161
169
  t1 = blockQueries.get(blockId);
162
- $[0] = blockId;
163
- $[1] = t1;
164
- } else t1 = $[1];
170
+ $[1] = blockId;
171
+ $[2] = t1;
172
+ } else t1 = $[2];
165
173
  const { data } = useSuspenseQuery(t1);
166
174
  const camoxApp = useCamoxApp();
167
175
  let t2;
168
- if ($[2] !== camoxApp || $[3] !== data.block.type) {
176
+ if ($[3] !== camoxApp || $[4] !== data.block.type) {
169
177
  t2 = camoxApp.getBlockById(data.block.type);
170
- $[2] = camoxApp;
171
- $[3] = data.block.type;
172
- $[4] = t2;
173
- } else t2 = $[4];
178
+ $[3] = camoxApp;
179
+ $[4] = data.block.type;
180
+ $[5] = t2;
181
+ } else t2 = $[5];
174
182
  const blockDef = t2;
175
183
  if (!blockDef) return null;
176
184
  const t3 = data.files;
@@ -182,7 +190,7 @@ const BlockRenderer = (t0) => {
182
190
  const t8 = data.block.settings;
183
191
  const t9 = String(data.block.position);
184
192
  let t10;
185
- if ($[5] !== data.block.id || $[6] !== data.block.type || $[7] !== t7 || $[8] !== t8 || $[9] !== t9) {
193
+ if ($[6] !== data.block.id || $[7] !== data.block.type || $[8] !== t7 || $[9] !== t8 || $[10] !== t9) {
186
194
  t10 = {
187
195
  _id: t5,
188
196
  type: t6,
@@ -190,40 +198,40 @@ const BlockRenderer = (t0) => {
190
198
  settings: t8,
191
199
  position: t9
192
200
  };
193
- $[5] = data.block.id;
194
- $[6] = data.block.type;
195
- $[7] = t7;
196
- $[8] = t8;
197
- $[9] = t9;
198
- $[10] = t10;
199
- } else t10 = $[10];
201
+ $[6] = data.block.id;
202
+ $[7] = data.block.type;
203
+ $[8] = t7;
204
+ $[9] = t8;
205
+ $[10] = t9;
206
+ $[11] = t10;
207
+ } else t10 = $[11];
200
208
  let t11;
201
- if ($[11] !== blockDef._internal.Component || $[12] !== mode || $[13] !== showAddBlockBottom || $[14] !== showAddBlockTop || $[15] !== t10) {
209
+ if ($[12] !== blockDef._internal.Component || $[13] !== mode || $[14] !== showAddBlockBottom || $[15] !== showAddBlockTop || $[16] !== t10) {
202
210
  t11 = /* @__PURE__ */ jsx(T0, {
203
211
  blockData: t10,
204
212
  mode,
205
213
  showAddBlockTop,
206
214
  showAddBlockBottom
207
215
  });
208
- $[11] = blockDef._internal.Component;
209
- $[12] = mode;
210
- $[13] = showAddBlockBottom;
211
- $[14] = showAddBlockTop;
212
- $[15] = t10;
213
- $[16] = t11;
214
- } else t11 = $[16];
216
+ $[12] = blockDef._internal.Component;
217
+ $[13] = mode;
218
+ $[14] = showAddBlockBottom;
219
+ $[15] = showAddBlockTop;
220
+ $[16] = t10;
221
+ $[17] = t11;
222
+ } else t11 = $[17];
215
223
  let t12;
216
- if ($[17] !== data.files || $[18] !== data.repeatableItems || $[19] !== t11) {
224
+ if ($[18] !== data.files || $[19] !== data.repeatableItems || $[20] !== t11) {
217
225
  t12 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
218
226
  files: t3,
219
227
  repeatableItems: t4,
220
228
  children: t11
221
229
  });
222
- $[17] = data.files;
223
- $[18] = data.repeatableItems;
224
- $[19] = t11;
225
- $[20] = t12;
226
- } else t12 = $[20];
230
+ $[18] = data.files;
231
+ $[19] = data.repeatableItems;
232
+ $[20] = t11;
233
+ $[21] = t12;
234
+ } else t12 = $[21];
227
235
  return t12;
228
236
  };
229
237
  const PageContent = () => {
@@ -293,7 +301,11 @@ const PageContent = () => {
293
301
  });
294
302
  };
295
303
  const CamoxPreview = (t0) => {
296
- const $ = c(28);
304
+ const $ = c(29);
305
+ if ($[0] !== "b803e8bbb91b7986d49da585480a8df1d0a53a974dfaa5c596024b3634d8a3fa") {
306
+ for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
307
+ $[0] = "b803e8bbb91b7986d49da585480a8df1d0a53a974dfaa5c596024b3634d8a3fa";
308
+ }
297
309
  const { children } = t0;
298
310
  const isAuthenticated = useIsAuthenticated();
299
311
  const isPresentationMode = useSelector(previewStore, _temp2);
@@ -301,7 +313,7 @@ const CamoxPreview = (t0) => {
301
313
  const pageData = usePreviewedPage();
302
314
  let t1;
303
315
  let t2;
304
- if ($[0] !== isAuthenticated || $[1] !== isPresentationMode) {
316
+ if ($[1] !== isAuthenticated || $[2] !== isPresentationMode) {
305
317
  t1 = () => {
306
318
  const actions = [
307
319
  {
@@ -317,7 +329,7 @@ const CamoxPreview = (t0) => {
317
329
  },
318
330
  {
319
331
  id: "exit-presentation-mode",
320
- label: "",
332
+ label: "Show Camox Studio",
321
333
  groupLabel: "Preview",
322
334
  checkIfAvailable: () => isAuthenticated && isPresentationMode,
323
335
  execute: _temp5,
@@ -347,43 +359,43 @@ const CamoxPreview = (t0) => {
347
359
  };
348
360
  };
349
361
  t2 = [isPresentationMode, isAuthenticated];
350
- $[0] = isAuthenticated;
351
- $[1] = isPresentationMode;
352
- $[2] = t1;
353
- $[3] = t2;
362
+ $[1] = isAuthenticated;
363
+ $[2] = isPresentationMode;
364
+ $[3] = t1;
365
+ $[4] = t2;
354
366
  } else {
355
- t1 = $[2];
356
- t2 = $[3];
367
+ t1 = $[3];
368
+ t2 = $[4];
357
369
  }
358
370
  React.useEffect(t1, t2);
359
371
  if (isPresentationMode) {
360
372
  let t3;
361
- if ($[4] !== children) {
373
+ if ($[5] !== children) {
362
374
  t3 = /* @__PURE__ */ jsx(PreviewFrame, {
363
375
  className: "h-screen w-full",
364
376
  children
365
377
  });
366
- $[4] = children;
367
- $[5] = t3;
368
- } else t3 = $[5];
378
+ $[5] = children;
379
+ $[6] = t3;
380
+ } else t3 = $[6];
369
381
  return t3;
370
382
  }
371
383
  if (!isAuthenticated) {
372
384
  let t3;
373
- if ($[6] !== children) {
385
+ if ($[7] !== children) {
374
386
  t3 = /* @__PURE__ */ jsx(Fragment, { children });
375
- $[6] = children;
376
- $[7] = t3;
377
- } else t3 = $[7];
387
+ $[7] = children;
388
+ $[8] = t3;
389
+ } else t3 = $[8];
378
390
  return t3;
379
391
  }
380
392
  let t3;
381
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
393
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
382
394
  t3 = /* @__PURE__ */ jsx(Navbar, {});
383
- $[8] = t3;
384
- } else t3 = $[8];
395
+ $[9] = t3;
396
+ } else t3 = $[9];
385
397
  let t4;
386
- if ($[9] !== isSidebarOpen || $[10] !== pageData) {
398
+ if ($[10] !== isSidebarOpen || $[11] !== pageData) {
387
399
  t4 = isSidebarOpen && /* @__PURE__ */ jsxs("div", {
388
400
  className: "flex w-[300px] flex-col border-r-2",
389
401
  children: [/* @__PURE__ */ jsxs(PanelHeader, {
@@ -405,62 +417,62 @@ const CamoxPreview = (t0) => {
405
417
  children: /* @__PURE__ */ jsx(PageTree, {})
406
418
  })]
407
419
  });
408
- $[9] = isSidebarOpen;
409
- $[10] = pageData;
410
- $[11] = t4;
411
- } else t4 = $[11];
420
+ $[10] = isSidebarOpen;
421
+ $[11] = pageData;
422
+ $[12] = t4;
423
+ } else t4 = $[12];
412
424
  let t5;
413
- if ($[12] !== isAuthenticated || $[13] !== isPresentationMode) {
425
+ if ($[13] !== isAuthenticated || $[14] !== isPresentationMode) {
414
426
  t5 = !isPresentationMode && isAuthenticated && /* @__PURE__ */ jsx("div", { style: {
415
427
  height: "80px",
416
428
  background: "transparent"
417
429
  } });
418
- $[12] = isAuthenticated;
419
- $[13] = isPresentationMode;
420
- $[14] = t5;
421
- } else t5 = $[14];
430
+ $[13] = isAuthenticated;
431
+ $[14] = isPresentationMode;
432
+ $[15] = t5;
433
+ } else t5 = $[15];
422
434
  let t6;
423
- if ($[15] !== children || $[16] !== t5) {
435
+ if ($[16] !== children || $[17] !== t5) {
424
436
  t6 = /* @__PURE__ */ jsxs(PreviewPanel, { children: [children, t5] });
425
- $[15] = children;
426
- $[16] = t5;
427
- $[17] = t6;
428
- } else t6 = $[17];
437
+ $[16] = children;
438
+ $[17] = t5;
439
+ $[18] = t6;
440
+ } else t6 = $[18];
429
441
  let t7;
430
- if ($[18] !== t4 || $[19] !== t6) {
442
+ if ($[19] !== t4 || $[20] !== t6) {
431
443
  t7 = /* @__PURE__ */ jsxs("div", {
432
444
  className: "flex h-full flex-row items-stretch",
433
445
  children: [t4, t6]
434
446
  });
435
- $[18] = t4;
436
- $[19] = t6;
437
- $[20] = t7;
438
- } else t7 = $[20];
447
+ $[19] = t4;
448
+ $[20] = t6;
449
+ $[21] = t7;
450
+ } else t7 = $[21];
439
451
  let t10;
440
452
  let t11;
441
453
  let t12;
442
454
  let t8;
443
455
  let t9;
444
- if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
456
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
445
457
  t8 = /* @__PURE__ */ jsx(PageContentSheet, {});
446
458
  t9 = /* @__PURE__ */ jsx(AddBlockSheet, {});
447
459
  t10 = /* @__PURE__ */ jsx(AgentChatSheet, {});
448
460
  t11 = /* @__PURE__ */ jsx(CreatePageModal, {});
449
461
  t12 = /* @__PURE__ */ jsx(EditPageModal, {});
450
- $[21] = t10;
451
- $[22] = t11;
452
- $[23] = t12;
453
- $[24] = t8;
454
- $[25] = t9;
462
+ $[22] = t10;
463
+ $[23] = t11;
464
+ $[24] = t12;
465
+ $[25] = t8;
466
+ $[26] = t9;
455
467
  } else {
456
- t10 = $[21];
457
- t11 = $[22];
458
- t12 = $[23];
459
- t8 = $[24];
460
- t9 = $[25];
468
+ t10 = $[22];
469
+ t11 = $[23];
470
+ t12 = $[24];
471
+ t8 = $[25];
472
+ t9 = $[26];
461
473
  }
462
474
  let t13;
463
- if ($[26] !== t7) {
475
+ if ($[27] !== t7) {
464
476
  t13 = /* @__PURE__ */ jsxs("div", {
465
477
  className: "bg-background flex h-screen flex-col overflow-hidden",
466
478
  children: [
@@ -473,44 +485,48 @@ const CamoxPreview = (t0) => {
473
485
  t12
474
486
  ]
475
487
  });
476
- $[26] = t7;
477
- $[27] = t13;
478
- } else t13 = $[27];
488
+ $[27] = t7;
489
+ $[28] = t13;
490
+ } else t13 = $[28];
479
491
  return t13;
480
492
  };
481
493
  function usePreviewPagesActions() {
482
- const $ = c(12);
494
+ const $ = c(13);
495
+ if ($[0] !== "b803e8bbb91b7986d49da585480a8df1d0a53a974dfaa5c596024b3634d8a3fa") {
496
+ for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
497
+ $[0] = "b803e8bbb91b7986d49da585480a8df1d0a53a974dfaa5c596024b3634d8a3fa";
498
+ }
483
499
  const navigate = useNavigate();
484
500
  const { pathname } = useLocation();
485
501
  const projectSlug = useProjectSlug();
486
502
  let t0;
487
- if ($[0] !== projectSlug) {
503
+ if ($[1] !== projectSlug) {
488
504
  t0 = projectQueries.getBySlug(projectSlug);
489
- $[0] = projectSlug;
490
- $[1] = t0;
491
- } else t0 = $[1];
505
+ $[1] = projectSlug;
506
+ $[2] = t0;
507
+ } else t0 = $[2];
492
508
  const { data: project } = useQuery(t0);
493
509
  let t1;
494
- if ($[2] !== project?.id) {
510
+ if ($[3] !== project?.id) {
495
511
  t1 = pageQueries.list(project?.id ?? 0);
496
- $[2] = project?.id;
497
- $[3] = t1;
498
- } else t1 = $[3];
512
+ $[3] = project?.id;
513
+ $[4] = t1;
514
+ } else t1 = $[4];
499
515
  const t2 = !!project;
500
516
  let t3;
501
- if ($[4] !== t1 || $[5] !== t2) {
517
+ if ($[5] !== t1 || $[6] !== t2) {
502
518
  t3 = {
503
519
  ...t1,
504
520
  enabled: t2
505
521
  };
506
- $[4] = t1;
507
- $[5] = t2;
508
- $[6] = t3;
509
- } else t3 = $[6];
522
+ $[5] = t1;
523
+ $[6] = t2;
524
+ $[7] = t3;
525
+ } else t3 = $[7];
510
526
  const { data: pages } = useQuery(t3);
511
527
  let t4;
512
528
  let t5;
513
- if ($[7] !== navigate || $[8] !== pages || $[9] !== pathname) {
529
+ if ($[8] !== navigate || $[9] !== pages || $[10] !== pathname) {
514
530
  t4 = () => {
515
531
  const currentPage = pages?.find((p) => p.fullPath === pathname);
516
532
  const actions = [
@@ -567,14 +583,14 @@ function usePreviewPagesActions() {
567
583
  pages,
568
584
  pathname
569
585
  ];
570
- $[7] = navigate;
571
- $[8] = pages;
572
- $[9] = pathname;
573
- $[10] = t4;
574
- $[11] = t5;
586
+ $[8] = navigate;
587
+ $[9] = pages;
588
+ $[10] = pathname;
589
+ $[11] = t4;
590
+ $[12] = t5;
575
591
  } else {
576
- t4 = $[10];
577
- t5 = $[11];
592
+ t4 = $[11];
593
+ t5 = $[12];
578
594
  }
579
595
  React.useEffect(t4, t5);
580
596
  }