camox 0.38.0 → 0.40.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.
@@ -1,6 +1,7 @@
1
1
  import { useNavigate } from "../../navigation/navigation.js";
2
2
  import { useProjectSlug } from "../../../lib/auth.js";
3
3
  import { blockQueries, layoutQueries, pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
4
+ import { cn } from "../../../lib/utils.js";
4
5
  import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
5
6
  import { trackClientEvent } from "../../../lib/telemetry-client.js";
6
7
  import { PageLocationFieldset } from "./PageLocationFieldset.js";
@@ -31,9 +32,9 @@ import { Switch } from "@camox/ui/switch";
31
32
  //#region src/features/preview/components/PageInfoSidebar.tsx
32
33
  const usePageMetadataData = (pageId) => {
33
34
  const $ = c(29);
34
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
35
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
35
36
  for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
36
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
37
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
37
38
  }
38
39
  const projectSlug = useProjectSlug();
39
40
  const camoxApp = useCamoxApp();
@@ -131,303 +132,293 @@ const usePageMetadataData = (pageId) => {
131
132
  return t9;
132
133
  };
133
134
  const PageInfoSidebar = (t0) => {
134
- const $ = c(64);
135
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
136
- for (let $i = 0; $i < 64; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
137
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
135
+ const $ = c(66);
136
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
137
+ for (let $i = 0; $i < 66; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
138
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
138
139
  }
139
- const { pageId } = t0;
140
+ const { pageId, scrollable: t1, aboutOnly: t2 } = t0;
141
+ const scrollable = t1 === void 0 ? true : t1;
142
+ const aboutOnly = t2 === void 0 ? false : t2;
140
143
  const data = usePageMetadataData(pageId);
141
144
  const { page, metaTitle } = data;
142
145
  const [isStructureModalOpen, setIsStructureModalOpen] = React.useState(false);
143
146
  const [isSeoModalOpen, setIsSeoModalOpen] = React.useState(false);
144
147
  const [isMarkdownModalOpen, setIsMarkdownModalOpen] = React.useState(false);
145
148
  if (!page) {
146
- let t1;
149
+ let t3;
147
150
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
148
- t1 = /* @__PURE__ */ jsxs("div", {
151
+ t3 = /* @__PURE__ */ jsxs("div", {
149
152
  className: "text-muted-foreground flex flex-1 items-center justify-center px-2 text-sm",
150
153
  children: [/* @__PURE__ */ jsx(Spinner, { className: "mr-2 size-3.5" }), " Loading page info..."]
151
154
  });
152
- $[1] = t1;
153
- } else t1 = $[1];
154
- return t1;
155
+ $[1] = t3;
156
+ } else t3 = $[1];
157
+ return t3;
155
158
  }
156
- let t1;
157
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
158
- t1 = /* @__PURE__ */ jsx("p", {
159
+ const t3 = scrollable && "flex-1 overflow-auto";
160
+ let t4;
161
+ if ($[2] !== t3) {
162
+ t4 = cn("space-y-4 p-2 pt-4", t3);
163
+ $[2] = t3;
164
+ $[3] = t4;
165
+ } else t4 = $[3];
166
+ let t5;
167
+ if ($[4] !== aboutOnly) {
168
+ t5 = !aboutOnly && /* @__PURE__ */ jsx("p", {
159
169
  className: "text-base font-semibold",
160
170
  children: "About this page"
161
171
  });
162
- $[2] = t1;
163
- } else t1 = $[2];
164
- let t2;
165
- if ($[3] !== data) {
166
- t2 = /* @__PURE__ */ jsx(PageNicknameSidebarEditor, { data });
167
- $[3] = data;
168
- $[4] = t2;
169
- } else t2 = $[4];
170
- let t3;
171
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
172
- t3 = /* @__PURE__ */ jsx(Label, { children: "Page path" });
173
- $[5] = t3;
174
- } else t3 = $[5];
175
- let t4;
176
- if ($[6] !== page.fullPath) {
177
- t4 = /* @__PURE__ */ jsx(InputGroupText, {
172
+ $[4] = aboutOnly;
173
+ $[5] = t5;
174
+ } else t5 = $[5];
175
+ let t6;
176
+ if ($[6] !== data) {
177
+ t6 = /* @__PURE__ */ jsx(PageNicknameSidebarEditor, { data });
178
+ $[6] = data;
179
+ $[7] = t6;
180
+ } else t6 = $[7];
181
+ let t7;
182
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
183
+ t7 = /* @__PURE__ */ jsx(Label, { children: "Page path" });
184
+ $[8] = t7;
185
+ } else t7 = $[8];
186
+ let t8;
187
+ if ($[9] !== page.fullPath) {
188
+ t8 = /* @__PURE__ */ jsx(InputGroupText, {
178
189
  className: "min-w-0 flex-1 px-2 py-1.5 font-mono font-normal break-all",
179
190
  children: page.fullPath
180
191
  });
181
- $[6] = page.fullPath;
182
- $[7] = t4;
183
- } else t4 = $[7];
184
- let t5;
185
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
186
- t5 = () => setIsStructureModalOpen(true);
187
- $[8] = t5;
188
- } else t5 = $[8];
189
- let t6;
190
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
191
- t6 = /* @__PURE__ */ jsx(InputGroupAddon, {
192
+ $[9] = page.fullPath;
193
+ $[10] = t8;
194
+ } else t8 = $[10];
195
+ let t9;
196
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
197
+ t9 = () => setIsStructureModalOpen(true);
198
+ $[11] = t9;
199
+ } else t9 = $[11];
200
+ let t10;
201
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
202
+ t10 = /* @__PURE__ */ jsx(InputGroupAddon, {
192
203
  align: "inline-end",
193
204
  children: /* @__PURE__ */ jsx(InputGroupButton, {
194
205
  type: "button",
195
206
  variant: "ghost",
196
207
  size: "icon-xs",
197
- onClick: t5,
208
+ onClick: t9,
198
209
  "aria-label": "Edit page structure",
199
210
  children: /* @__PURE__ */ jsx(Pencil, { className: "size-4" })
200
211
  })
201
212
  });
202
- $[9] = t6;
203
- } else t6 = $[9];
204
- let t7;
205
- if ($[10] !== t4) {
206
- t7 = /* @__PURE__ */ jsxs("div", {
213
+ $[12] = t10;
214
+ } else t10 = $[12];
215
+ let t11;
216
+ if ($[13] !== t8) {
217
+ t11 = /* @__PURE__ */ jsxs("div", {
207
218
  className: "space-y-2",
208
- children: [t3, /* @__PURE__ */ jsxs(InputGroup, {
219
+ children: [t7, /* @__PURE__ */ jsxs(InputGroup, {
209
220
  className: "h-auto min-h-9 px-1",
210
- children: [t4, t6]
221
+ children: [t8, t10]
211
222
  })]
212
223
  });
213
- $[10] = t4;
214
- $[11] = t7;
215
- } else t7 = $[11];
216
- let t8;
217
- if ($[12] !== data) {
218
- t8 = /* @__PURE__ */ jsx(PageLayoutSidebarSelect, { data });
219
- $[12] = data;
220
224
  $[13] = t8;
221
- } else t8 = $[13];
222
- let t9;
223
- if ($[14] !== t2 || $[15] !== t7 || $[16] !== t8) {
224
- t9 = /* @__PURE__ */ jsxs("section", {
225
+ $[14] = t11;
226
+ } else t11 = $[14];
227
+ let t12;
228
+ if ($[15] !== data) {
229
+ t12 = /* @__PURE__ */ jsx(PageLayoutSidebarSelect, { data });
230
+ $[15] = data;
231
+ $[16] = t12;
232
+ } else t12 = $[16];
233
+ let t13;
234
+ if ($[17] !== t11 || $[18] !== t12 || $[19] !== t5 || $[20] !== t6) {
235
+ t13 = /* @__PURE__ */ jsxs("section", {
225
236
  className: "space-y-4",
226
237
  children: [
227
- t1,
228
- t2,
229
- t7,
230
- t8
238
+ t5,
239
+ t6,
240
+ t11,
241
+ t12
231
242
  ]
232
243
  });
233
- $[14] = t2;
234
- $[15] = t7;
235
- $[16] = t8;
236
- $[17] = t9;
237
- } else t9 = $[17];
238
- let t10;
239
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
240
- t10 = /* @__PURE__ */ jsx(Label, { children: "SEO" });
241
- $[18] = t10;
242
- } else t10 = $[18];
243
- let t11;
244
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
245
- t11 = /* @__PURE__ */ jsxs("div", {
244
+ $[17] = t11;
245
+ $[18] = t12;
246
+ $[19] = t5;
247
+ $[20] = t6;
248
+ $[21] = t13;
249
+ } else t13 = $[21];
250
+ let t14;
251
+ if ($[22] !== aboutOnly) {
252
+ t14 = !aboutOnly && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
246
253
  className: "space-y-2",
247
- children: [t10, /* @__PURE__ */ jsx(Button, {
254
+ children: [/* @__PURE__ */ jsx(Label, { children: "SEO" }), /* @__PURE__ */ jsx(Button, {
248
255
  type: "button",
249
256
  variant: "outline",
250
257
  className: "w-full",
251
258
  onClick: () => setIsSeoModalOpen(true),
252
259
  children: "Manage SEO metadata"
253
260
  })]
254
- });
255
- $[19] = t11;
256
- } else t11 = $[19];
257
- let t12;
258
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
259
- t12 = /* @__PURE__ */ jsx(Label, { children: "Markdown" });
260
- $[20] = t12;
261
- } else t12 = $[20];
262
- let t13;
263
- if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
264
- t13 = /* @__PURE__ */ jsxs("div", {
261
+ }), /* @__PURE__ */ jsxs("div", {
265
262
  className: "space-y-2",
266
- children: [t12, /* @__PURE__ */ jsx(Button, {
263
+ children: [/* @__PURE__ */ jsx(Label, { children: "Markdown" }), /* @__PURE__ */ jsx(Button, {
267
264
  type: "button",
268
265
  variant: "outline",
269
266
  className: "w-full",
270
267
  onClick: () => setIsMarkdownModalOpen(true),
271
268
  children: "View page markdown"
272
269
  })]
273
- });
274
- $[21] = t13;
275
- } else t13 = $[21];
276
- let t14;
277
- if ($[22] !== page.createdAt) {
278
- t14 = formatRelativeTime(page.createdAt);
279
- $[22] = page.createdAt;
270
+ })] });
271
+ $[22] = aboutOnly;
280
272
  $[23] = t14;
281
273
  } else t14 = $[23];
282
274
  let t15;
283
- if ($[24] !== t14) {
284
- t15 = /* @__PURE__ */ jsx(MetadataRow, {
285
- label: "Created",
286
- children: t14
287
- });
288
- $[24] = t14;
275
+ if ($[24] !== page.createdAt) {
276
+ t15 = formatRelativeTime(page.createdAt);
277
+ $[24] = page.createdAt;
289
278
  $[25] = t15;
290
279
  } else t15 = $[25];
291
- const t16 = page.createdBy ?? "Unknown";
292
- let t17;
293
- if ($[26] !== t16) {
294
- t17 = /* @__PURE__ */ jsx(MetadataRow, {
295
- label: "Created by",
296
- children: t16
280
+ let t16;
281
+ if ($[26] !== t15) {
282
+ t16 = /* @__PURE__ */ jsx(MetadataRow, {
283
+ label: "Created",
284
+ children: t15
297
285
  });
298
- $[26] = t16;
299
- $[27] = t17;
300
- } else t17 = $[27];
286
+ $[26] = t15;
287
+ $[27] = t16;
288
+ } else t16 = $[27];
289
+ const t17 = page.createdBy ?? "Unknown";
301
290
  let t18;
302
- if ($[28] !== page.updatedAt) {
303
- t18 = formatRelativeTime(page.updatedAt);
304
- $[28] = page.updatedAt;
291
+ if ($[28] !== t17) {
292
+ t18 = /* @__PURE__ */ jsx(MetadataRow, {
293
+ label: "Created by",
294
+ children: t17
295
+ });
296
+ $[28] = t17;
305
297
  $[29] = t18;
306
298
  } else t18 = $[29];
307
299
  let t19;
308
- if ($[30] !== t18) {
309
- t19 = /* @__PURE__ */ jsx(MetadataRow, {
310
- label: "Updated",
311
- children: t18
312
- });
313
- $[30] = t18;
300
+ if ($[30] !== page.updatedAt) {
301
+ t19 = formatRelativeTime(page.updatedAt);
302
+ $[30] = page.updatedAt;
314
303
  $[31] = t19;
315
304
  } else t19 = $[31];
316
305
  let t20;
317
- if ($[32] !== page.publishedAt) {
318
- t20 = page.publishedAt == null ? "Never" : formatRelativeTime(page.publishedAt);
319
- $[32] = page.publishedAt;
306
+ if ($[32] !== t19) {
307
+ t20 = /* @__PURE__ */ jsx(MetadataRow, {
308
+ label: "Updated",
309
+ children: t19
310
+ });
311
+ $[32] = t19;
320
312
  $[33] = t20;
321
313
  } else t20 = $[33];
322
314
  let t21;
323
- if ($[34] !== t20) {
324
- t21 = /* @__PURE__ */ jsx(MetadataRow, {
325
- label: "Published",
326
- children: t20
327
- });
328
- $[34] = t20;
315
+ if ($[34] !== page.publishedAt) {
316
+ t21 = page.publishedAt == null ? "Never" : formatRelativeTime(page.publishedAt);
317
+ $[34] = page.publishedAt;
329
318
  $[35] = t21;
330
319
  } else t21 = $[35];
331
320
  let t22;
332
- if ($[36] !== page.publishedAt || $[37] !== page.publishedBy) {
333
- t22 = page.publishedAt != null && /* @__PURE__ */ jsx(MetadataRow, {
321
+ if ($[36] !== t21) {
322
+ t22 = /* @__PURE__ */ jsx(MetadataRow, {
323
+ label: "Published",
324
+ children: t21
325
+ });
326
+ $[36] = t21;
327
+ $[37] = t22;
328
+ } else t22 = $[37];
329
+ let t23;
330
+ if ($[38] !== page.publishedAt || $[39] !== page.publishedBy) {
331
+ t23 = page.publishedAt != null && /* @__PURE__ */ jsx(MetadataRow, {
334
332
  label: "Published by",
335
333
  children: page.publishedBy ?? "Unknown"
336
334
  });
337
- $[36] = page.publishedAt;
338
- $[37] = page.publishedBy;
339
- $[38] = t22;
340
- } else t22 = $[38];
341
- let t23;
342
- if ($[39] !== t15 || $[40] !== t17 || $[41] !== t19 || $[42] !== t21 || $[43] !== t22) {
343
- t23 = /* @__PURE__ */ jsxs(Metadata, { children: [
344
- t15,
345
- t17,
346
- t19,
347
- t21,
348
- t22
349
- ] });
350
- $[39] = t15;
351
- $[40] = t17;
352
- $[41] = t19;
353
- $[42] = t21;
354
- $[43] = t22;
355
- $[44] = t23;
356
- } else t23 = $[44];
335
+ $[38] = page.publishedAt;
336
+ $[39] = page.publishedBy;
337
+ $[40] = t23;
338
+ } else t23 = $[40];
357
339
  let t24;
358
- if ($[45] !== t23 || $[46] !== t9) {
359
- t24 = /* @__PURE__ */ jsxs("div", {
360
- className: "flex-1 space-y-4 overflow-auto p-2 pt-4",
340
+ if ($[41] !== t16 || $[42] !== t18 || $[43] !== t20 || $[44] !== t22 || $[45] !== t23) {
341
+ t24 = /* @__PURE__ */ jsxs(Metadata, { children: [
342
+ t16,
343
+ t18,
344
+ t20,
345
+ t22,
346
+ t23
347
+ ] });
348
+ $[41] = t16;
349
+ $[42] = t18;
350
+ $[43] = t20;
351
+ $[44] = t22;
352
+ $[45] = t23;
353
+ $[46] = t24;
354
+ } else t24 = $[46];
355
+ let t25;
356
+ if ($[47] !== t13 || $[48] !== t14 || $[49] !== t24 || $[50] !== t4) {
357
+ t25 = /* @__PURE__ */ jsxs("div", {
358
+ className: t4,
361
359
  children: [
362
- t9,
363
- t11,
364
360
  t13,
365
- t23
361
+ t14,
362
+ t24
366
363
  ]
367
364
  });
368
- $[45] = t23;
369
- $[46] = t9;
370
- $[47] = t24;
371
- } else t24 = $[47];
372
- let t25;
373
- if ($[48] !== isStructureModalOpen || $[49] !== page.id) {
374
- t25 = /* @__PURE__ */ jsx(PageStructureModal, {
365
+ $[47] = t13;
366
+ $[48] = t14;
367
+ $[49] = t24;
368
+ $[50] = t4;
369
+ $[51] = t25;
370
+ } else t25 = $[51];
371
+ let t26;
372
+ if ($[52] !== isStructureModalOpen || $[53] !== page.id) {
373
+ t26 = /* @__PURE__ */ jsx(PageStructureModal, {
375
374
  open: isStructureModalOpen,
376
375
  onOpenChange: setIsStructureModalOpen,
377
376
  pageId: page.id
378
377
  });
379
- $[48] = isStructureModalOpen;
380
- $[49] = page.id;
381
- $[50] = t25;
382
- } else t25 = $[50];
383
- let t26;
384
- if ($[51] !== isSeoModalOpen || $[52] !== page.id) {
385
- t26 = /* @__PURE__ */ jsx(PageSeoModal, {
378
+ $[52] = isStructureModalOpen;
379
+ $[53] = page.id;
380
+ $[54] = t26;
381
+ } else t26 = $[54];
382
+ let t27;
383
+ if ($[55] !== aboutOnly || $[56] !== isMarkdownModalOpen || $[57] !== isSeoModalOpen || $[58] !== metaTitle || $[59] !== page.id || $[60] !== page.metaDescription) {
384
+ t27 = !aboutOnly && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PageSeoModal, {
386
385
  open: isSeoModalOpen,
387
386
  onOpenChange: setIsSeoModalOpen,
388
387
  pageId: page.id
389
- });
390
- $[51] = isSeoModalOpen;
391
- $[52] = page.id;
392
- $[53] = t26;
393
- } else t26 = $[53];
394
- const t27 = page.metaDescription ?? "";
395
- let t28;
396
- if ($[54] !== isMarkdownModalOpen || $[55] !== metaTitle || $[56] !== page.id || $[57] !== t27) {
397
- t28 = /* @__PURE__ */ jsx(PageMarkdownModal, {
388
+ }), /* @__PURE__ */ jsx(PageMarkdownModal, {
398
389
  open: isMarkdownModalOpen,
399
390
  onOpenChange: setIsMarkdownModalOpen,
400
391
  pageId: page.id,
401
392
  metaTitle,
402
- metaDescription: t27
403
- });
404
- $[54] = isMarkdownModalOpen;
405
- $[55] = metaTitle;
406
- $[56] = page.id;
407
- $[57] = t27;
408
- $[58] = t28;
409
- } else t28 = $[58];
410
- let t29;
411
- if ($[59] !== t24 || $[60] !== t25 || $[61] !== t26 || $[62] !== t28) {
412
- t29 = /* @__PURE__ */ jsxs(Fragment, { children: [
413
- t24,
393
+ metaDescription: page.metaDescription ?? ""
394
+ })] });
395
+ $[55] = aboutOnly;
396
+ $[56] = isMarkdownModalOpen;
397
+ $[57] = isSeoModalOpen;
398
+ $[58] = metaTitle;
399
+ $[59] = page.id;
400
+ $[60] = page.metaDescription;
401
+ $[61] = t27;
402
+ } else t27 = $[61];
403
+ let t28;
404
+ if ($[62] !== t25 || $[63] !== t26 || $[64] !== t27) {
405
+ t28 = /* @__PURE__ */ jsxs(Fragment, { children: [
414
406
  t25,
415
407
  t26,
416
- t28
408
+ t27
417
409
  ] });
418
- $[59] = t24;
419
- $[60] = t25;
420
- $[61] = t26;
421
- $[62] = t28;
422
- $[63] = t29;
423
- } else t29 = $[63];
424
- return t29;
410
+ $[62] = t25;
411
+ $[63] = t26;
412
+ $[64] = t27;
413
+ $[65] = t28;
414
+ } else t28 = $[65];
415
+ return t28;
425
416
  };
426
417
  const PageNicknameSidebarEditor = (t0) => {
427
418
  const $ = c(21);
428
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
419
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
429
420
  for (let $i = 0; $i < 21; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
430
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
421
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
431
422
  }
432
423
  const { data } = t0;
433
424
  const { page } = data;
@@ -536,9 +527,9 @@ const PageNicknameSidebarEditor = (t0) => {
536
527
  };
537
528
  const PageLayoutSidebarSelect = (t0) => {
538
529
  const $ = c(30);
539
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
530
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
540
531
  for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
541
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
532
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
542
533
  }
543
534
  const { data } = t0;
544
535
  const { page, layouts, camoxApp } = data;
@@ -670,9 +661,9 @@ const PageLayoutSidebarSelect = (t0) => {
670
661
  };
671
662
  const PageStructureModal = (t0) => {
672
663
  const $ = c(10);
673
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
664
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
674
665
  for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
675
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
666
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
676
667
  }
677
668
  const { open, onOpenChange, pageId } = t0;
678
669
  const data = usePageMetadataData(pageId);
@@ -845,57 +836,72 @@ const PageStructureEditor = ({ data, includeNickname = true, includeLayout = tru
845
836
  });
846
837
  };
847
838
  const PageSeoModal = (t0) => {
848
- const $ = c(11);
849
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
850
- for (let $i = 0; $i < 11; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
851
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
839
+ const $ = c(8);
840
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
841
+ for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
842
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
852
843
  }
853
844
  const { open, onOpenChange, pageId } = t0;
854
- const { page, metaTitle, pageLayoutRecord, project } = usePageMetadataData(pageId);
855
845
  let t1;
856
846
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
857
847
  t1 = /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "SEO metadata" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Control how this page appears in search and social previews." })] });
858
848
  $[1] = t1;
859
849
  } else t1 = $[1];
860
850
  let t2;
861
- if ($[2] !== metaTitle || $[3] !== page || $[4] !== pageLayoutRecord?.layoutId || $[5] !== project?.name) {
851
+ if ($[2] !== pageId) {
862
852
  t2 = /* @__PURE__ */ jsxs(DialogContent, {
863
853
  className: "max-h-[90vh] overflow-y-auto sm:max-w-3xl",
864
- children: [t1, page ? /* @__PURE__ */ jsx(PageSeoEditor, {
865
- page,
866
- metaTitle,
867
- layoutId: pageLayoutRecord?.layoutId,
868
- projectName: project?.name
869
- }) : /* @__PURE__ */ jsxs("div", {
870
- className: "text-muted-foreground flex items-center gap-2 py-6 text-sm",
871
- children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), " Loading..."]
872
- })]
854
+ children: [t1, /* @__PURE__ */ jsx(PageSeoContent, { pageId })]
873
855
  });
874
- $[2] = metaTitle;
875
- $[3] = page;
876
- $[4] = pageLayoutRecord?.layoutId;
877
- $[5] = project?.name;
878
- $[6] = t2;
879
- } else t2 = $[6];
856
+ $[2] = pageId;
857
+ $[3] = t2;
858
+ } else t2 = $[3];
880
859
  let t3;
881
- if ($[7] !== onOpenChange || $[8] !== open || $[9] !== t2) {
860
+ if ($[4] !== onOpenChange || $[5] !== open || $[6] !== t2) {
882
861
  t3 = /* @__PURE__ */ jsx(Dialog, {
883
862
  open,
884
863
  onOpenChange,
885
864
  children: t2
886
865
  });
887
- $[7] = onOpenChange;
888
- $[8] = open;
889
- $[9] = t2;
890
- $[10] = t3;
891
- } else t3 = $[10];
866
+ $[4] = onOpenChange;
867
+ $[5] = open;
868
+ $[6] = t2;
869
+ $[7] = t3;
870
+ } else t3 = $[7];
892
871
  return t3;
893
872
  };
873
+ const PageSeoContent = (t0) => {
874
+ const $ = c(6);
875
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
876
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
877
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
878
+ }
879
+ const { pageId } = t0;
880
+ const { page, metaTitle, pageLayoutRecord, project } = usePageMetadataData(pageId);
881
+ let t1;
882
+ if ($[1] !== metaTitle || $[2] !== page || $[3] !== pageLayoutRecord?.layoutId || $[4] !== project?.name) {
883
+ t1 = page ? /* @__PURE__ */ jsx(PageSeoEditor, {
884
+ page,
885
+ metaTitle,
886
+ layoutId: pageLayoutRecord?.layoutId,
887
+ projectName: project?.name
888
+ }) : /* @__PURE__ */ jsxs("div", {
889
+ className: "text-muted-foreground flex items-center gap-2 py-6 text-sm",
890
+ children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), " Loading..."]
891
+ });
892
+ $[1] = metaTitle;
893
+ $[2] = page;
894
+ $[3] = pageLayoutRecord?.layoutId;
895
+ $[4] = project?.name;
896
+ $[5] = t1;
897
+ } else t1 = $[5];
898
+ return t1;
899
+ };
894
900
  const PageSeoEditor = (t0) => {
895
901
  const $ = c(43);
896
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
902
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
897
903
  for (let $i = 0; $i < 43; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
898
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
904
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
899
905
  }
900
906
  const { page, metaTitle, layoutId, projectName } = t0;
901
907
  let t1;
@@ -1068,9 +1074,9 @@ const PageSeoEditor = (t0) => {
1068
1074
  };
1069
1075
  const PageMarkdownModal = (t0) => {
1070
1076
  const $ = c(10);
1071
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
1077
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
1072
1078
  for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1073
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
1079
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
1074
1080
  }
1075
1081
  const { open, onOpenChange, pageId, metaTitle, metaDescription } = t0;
1076
1082
  let t1;
@@ -1107,15 +1113,46 @@ const PageMarkdownModal = (t0) => {
1107
1113
  } else t3 = $[9];
1108
1114
  return t3;
1109
1115
  };
1116
+ const PageMarkdownContent = (t0) => {
1117
+ const $ = c(6);
1118
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
1119
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1120
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
1121
+ }
1122
+ const { pageId } = t0;
1123
+ const { page, metaTitle } = usePageMetadataData(pageId);
1124
+ if (!page) {
1125
+ let t1;
1126
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1127
+ t1 = /* @__PURE__ */ jsx(Spinner, { className: "size-4" });
1128
+ $[1] = t1;
1129
+ } else t1 = $[1];
1130
+ return t1;
1131
+ }
1132
+ const t1 = page.metaDescription ?? "";
1133
+ let t2;
1134
+ if ($[2] !== metaTitle || $[3] !== pageId || $[4] !== t1) {
1135
+ t2 = /* @__PURE__ */ jsx(PageMarkdownPreview, {
1136
+ pageId,
1137
+ metaTitle,
1138
+ metaDescription: t1
1139
+ });
1140
+ $[2] = metaTitle;
1141
+ $[3] = pageId;
1142
+ $[4] = t1;
1143
+ $[5] = t2;
1144
+ } else t2 = $[5];
1145
+ return t2;
1146
+ };
1110
1147
  function truncateText(text, maxLen) {
1111
1148
  if (text.length <= maxLen) return text;
1112
1149
  return text.slice(0, maxLen) + "...";
1113
1150
  }
1114
1151
  const SearchEnginePreview = (t0) => {
1115
1152
  const $ = c(17);
1116
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
1153
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
1117
1154
  for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1118
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
1155
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
1119
1156
  }
1120
1157
  const { page, metaTitle, metaDescription } = t0;
1121
1158
  const url = `${typeof window !== "undefined" ? window.location.origin : ""}${page.fullPath}`;
@@ -1198,9 +1235,9 @@ const SearchEnginePreview = (t0) => {
1198
1235
  };
1199
1236
  const SocialPreviewSection = (t0) => {
1200
1237
  const $ = c(60);
1201
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
1238
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
1202
1239
  for (let $i = 0; $i < 60; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1203
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
1240
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
1204
1241
  }
1205
1242
  const { page, metaTitle, metaDescription, layoutId, projectName } = t0;
1206
1243
  const pageMetaTitle = page.metaTitle ?? page.pathSegment;
@@ -1474,9 +1511,9 @@ const SocialPreviewSection = (t0) => {
1474
1511
  };
1475
1512
  const PageMarkdownPreview = (t0) => {
1476
1513
  const $ = c(9);
1477
- if ($[0] !== "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0") {
1514
+ if ($[0] !== "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9") {
1478
1515
  for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1479
- $[0] = "f125b22ca9b1cdd5f8ebaad664afb96f1358e712b847c82ca5543019e76a82a0";
1516
+ $[0] = "6429fc16e5e144c75214ac94981064682ca467e61e74e9280c01a2159d34fef9";
1480
1517
  }
1481
1518
  const { pageId, metaTitle, metaDescription } = t0;
1482
1519
  let t1;
@@ -1534,4 +1571,4 @@ function _temp7() {
1534
1571
  }
1535
1572
 
1536
1573
  //#endregion
1537
- export { PageInfoSidebar };
1574
+ export { PageInfoSidebar, PageMarkdownContent, PageSeoContent };