camox 0.62.0 → 0.65.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.
- package/dist/core/createApp.d.ts +28 -28
- package/dist/core/createLayout.d.ts +1 -1
- package/dist/core/derivedRoutes.js +3 -30
- package/dist/core/editing/createEditableBlock.d.ts +604 -604
- package/dist/features/canvas/canvasCamera.js +11 -2
- package/dist/features/canvas/useCanvasCamera.js +14 -10
- package/dist/features/page/CuratedPageContent.js +2 -1
- package/dist/features/page/UnplacedBlockContent.js +52 -0
- package/dist/features/preview/components/PreviewPanel.js +40 -12
- package/dist/features/preview/components/SidebarStack.js +78 -9
- package/dist/features/preview/strayCaretGuard.js +34 -0
- package/dist/features/provider/CoreCamoxProvider.js +5 -3
- package/dist/features/routes/pageRuntime.d.ts +2 -0
- package/dist/features/routes/pageRuntime.js +8 -5
- package/dist/features/runtime/pageApp.js +111 -74
- package/dist/features/runtime/pageClient.js +22 -2
- package/dist/features/runtime/runtime.d.ts +10 -0
- package/dist/features/runtime/runtime.js +314 -4
- package/dist/features/runtime/runtimeRoutes.d.ts +5 -0
- package/dist/features/runtime/runtimeRoutes.js +5 -0
- package/dist/features/studio/components/ChatWidget.js +88 -62
- package/dist/features/studio/components/ConnectAgent.js +313 -0
- package/dist/features/studio/components/Patrol.js +455 -205
- package/dist/features/studio/components/ReviewDraftSheet.js +431 -334
- package/dist/features/studio/components/Squareling.js +74 -41
- package/dist/features/studio/components/ThreadComposer.js +130 -107
- package/dist/features/studio/components/ThreadMessages.js +136 -30
- package/dist/features/studio/components/clientLogoPaths.js +10 -0
- package/dist/features/studio/findingSentence.js +37 -0
- package/dist/features/studio/reportSentence.js +15 -0
- package/dist/features/studio/studioStore.js +23 -1
- package/dist/features/studio/workingSentence.js +8 -0
- package/dist/lib/api-client.d.ts +1 -0
- package/dist/lib/auth.js +34 -32
- package/dist/lib/locale-path.js +1 -7
- package/dist/lib/queries.js +9 -1
- package/dist/lib/server-auth-cookie.js +17 -4
- package/dist/lib/studio-reads.d.ts +1 -1
- package/dist/lib/studio-reads.js +5 -1
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +16 -5
|
@@ -2,19 +2,21 @@ import { useDraftScope } from "../../../lib/draft-scope.js";
|
|
|
2
2
|
import { reads, useReadQuery, useStudioCache } from "../../../lib/studio-reads.js";
|
|
3
3
|
import { cn } from "../../../lib/utils.js";
|
|
4
4
|
import { getDraftReadClient } from "../../../lib/api-client.js";
|
|
5
|
-
import { draftMutations } from "../../../lib/queries.js";
|
|
5
|
+
import { draftMutations, patrolMutations } from "../../../lib/queries.js";
|
|
6
6
|
import { previewStore } from "../../preview/previewStore.js";
|
|
7
|
+
import { studioStore } from "../studioStore.js";
|
|
7
8
|
import { localeLabel } from "../localeOptions.js";
|
|
8
9
|
import { draftLabel, plural, timeAgo } from "../draftLabel.js";
|
|
10
|
+
import { askAgentMessage, findingSentence, fixLabel } from "../findingSentence.js";
|
|
9
11
|
import { useShowInCanvas } from "../showInCanvas.js";
|
|
10
12
|
import { c } from "react/compiler-runtime";
|
|
11
13
|
import * as React from "react";
|
|
12
|
-
import { CONFLICTS_CHANGED_ERROR, REVISION_CHANGED_ERROR, TRANSLATIONS_PENDING_ERROR } from "@camox/api-contract/drafts";
|
|
14
|
+
import { CHECKS_RUNNING_ERROR, CONFLICTS_CHANGED_ERROR, FINDINGS_OPEN_ERROR, REVISION_CHANGED_ERROR, TRANSLATIONS_PENDING_ERROR } from "@camox/api-contract/drafts";
|
|
13
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
16
|
import { useMutation } from "@tanstack/react-query";
|
|
15
17
|
import { Button } from "@camox/ui/button";
|
|
16
18
|
import { Sheet, SheetContent, SheetDescription, SheetTitle } from "@camox/ui/sheet";
|
|
17
|
-
import { CircleCheck, OctagonX, Replace, Trash2, TriangleAlert, Unlink } from "lucide-react";
|
|
19
|
+
import { CircleAlert, CircleCheck, OctagonX, Replace, Trash2, TriangleAlert, Unlink } from "lucide-react";
|
|
18
20
|
import { toast } from "@camox/ui/toaster";
|
|
19
21
|
import { Skeleton } from "@camox/ui/skeleton";
|
|
20
22
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
|
|
@@ -77,7 +79,6 @@ function blockerActionLabel(problem) {
|
|
|
77
79
|
case "unacceptedFileType": return isImage(problem) ? "Choose another image" : "Choose another file";
|
|
78
80
|
case "emptyRequiredReference": return "Choose a record";
|
|
79
81
|
case "danglingReference": return "Choose another record";
|
|
80
|
-
case "danglingPageLink": return "Fix the link";
|
|
81
82
|
case "duplicatePath": return "Fix the path";
|
|
82
83
|
case "missingMetaTitle": return "Write a meta title";
|
|
83
84
|
default: return "Show in Canvas";
|
|
@@ -144,7 +145,7 @@ function Card(t0) {
|
|
|
144
145
|
} else t6 = $[8];
|
|
145
146
|
let t7;
|
|
146
147
|
if ($[9] !== children) {
|
|
147
|
-
t7 = /* @__PURE__ */ jsx("div", {
|
|
148
|
+
t7 = children && /* @__PURE__ */ jsx("div", {
|
|
148
149
|
className: "text-muted-foreground text-sm",
|
|
149
150
|
children
|
|
150
151
|
});
|
|
@@ -248,6 +249,138 @@ function ProblemCards({ problems, tone, icon, onShow, onOpenThread }) {
|
|
|
248
249
|
}, `shared:${message}`)];
|
|
249
250
|
});
|
|
250
251
|
}
|
|
252
|
+
/** Where the Canvas shows a finding: its block or item on its page. */
|
|
253
|
+
function findingTarget(finding) {
|
|
254
|
+
const { place } = finding;
|
|
255
|
+
if (place?.kind !== "page") return null;
|
|
256
|
+
return {
|
|
257
|
+
pageId: place.pageId,
|
|
258
|
+
locale: finding.locale,
|
|
259
|
+
blockId: place.blockId,
|
|
260
|
+
itemId: place.itemId,
|
|
261
|
+
field: place.blockId ? {
|
|
262
|
+
name: finding.field,
|
|
263
|
+
kind: null
|
|
264
|
+
} : null
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* One card per open finding of the draft, which holds its publish (ADR 0033), with the Patrol's
|
|
269
|
+
* actions: show it in the Canvas, apply its fix, or dismiss it.
|
|
270
|
+
*/
|
|
271
|
+
function FindingCards(t0) {
|
|
272
|
+
const $ = c(19);
|
|
273
|
+
const { projectId, findings, onChanged, onShow } = t0;
|
|
274
|
+
let t1;
|
|
275
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
276
|
+
t1 = patrolMutations.applyFix();
|
|
277
|
+
$[0] = t1;
|
|
278
|
+
} else t1 = $[0];
|
|
279
|
+
let t2;
|
|
280
|
+
if ($[1] !== onChanged) {
|
|
281
|
+
t2 = {
|
|
282
|
+
...t1,
|
|
283
|
+
onSuccess: (t3) => {
|
|
284
|
+
const { applied } = t3;
|
|
285
|
+
if (!applied) toast.info("The text changed since it was checked, so it's being checked again.");
|
|
286
|
+
onChanged();
|
|
287
|
+
},
|
|
288
|
+
onError: _temp
|
|
289
|
+
};
|
|
290
|
+
$[1] = onChanged;
|
|
291
|
+
$[2] = t2;
|
|
292
|
+
} else t2 = $[2];
|
|
293
|
+
const applyFix = useMutation(t2);
|
|
294
|
+
let t3;
|
|
295
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
296
|
+
t3 = patrolMutations.dismissFinding();
|
|
297
|
+
$[3] = t3;
|
|
298
|
+
} else t3 = $[3];
|
|
299
|
+
let t4;
|
|
300
|
+
if ($[4] !== onChanged) {
|
|
301
|
+
t4 = {
|
|
302
|
+
...t3,
|
|
303
|
+
onSuccess: onChanged,
|
|
304
|
+
onError: _temp2
|
|
305
|
+
};
|
|
306
|
+
$[4] = onChanged;
|
|
307
|
+
$[5] = t4;
|
|
308
|
+
} else t4 = $[5];
|
|
309
|
+
const dismiss = useMutation(t4);
|
|
310
|
+
const busy = applyFix.isPending || dismiss.isPending;
|
|
311
|
+
let t5;
|
|
312
|
+
if ($[6] !== applyFix || $[7] !== busy || $[8] !== dismiss || $[9] !== findings || $[10] !== onShow || $[11] !== projectId) {
|
|
313
|
+
let t6;
|
|
314
|
+
if ($[13] !== applyFix || $[14] !== busy || $[15] !== dismiss || $[16] !== onShow || $[17] !== projectId) {
|
|
315
|
+
t6 = (finding) => {
|
|
316
|
+
const target = findingTarget(finding);
|
|
317
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
318
|
+
tone: "danger",
|
|
319
|
+
icon: CircleAlert,
|
|
320
|
+
title: findingSentence(finding),
|
|
321
|
+
action: /* @__PURE__ */ jsxs("span", {
|
|
322
|
+
className: "flex flex-wrap gap-1",
|
|
323
|
+
children: [
|
|
324
|
+
target && /* @__PURE__ */ jsx(Button, {
|
|
325
|
+
variant: "outline",
|
|
326
|
+
size: "sm",
|
|
327
|
+
onClick: () => onShow(target),
|
|
328
|
+
children: "Show"
|
|
329
|
+
}),
|
|
330
|
+
finding.fix && /* @__PURE__ */ jsx(Button, {
|
|
331
|
+
variant: "outline",
|
|
332
|
+
size: "sm",
|
|
333
|
+
disabled: busy,
|
|
334
|
+
onClick: () => applyFix.mutate({
|
|
335
|
+
projectId,
|
|
336
|
+
findingId: finding.id
|
|
337
|
+
}),
|
|
338
|
+
children: fixLabel(finding.fix)
|
|
339
|
+
}),
|
|
340
|
+
/* @__PURE__ */ jsx(Button, {
|
|
341
|
+
variant: "outline",
|
|
342
|
+
size: "sm",
|
|
343
|
+
onClick: () => studioStore.trigger.askAgent({ text: askAgentMessage(finding, finding.patroller.role) }),
|
|
344
|
+
children: "Ask the agent"
|
|
345
|
+
}),
|
|
346
|
+
/* @__PURE__ */ jsx(Button, {
|
|
347
|
+
variant: "ghost",
|
|
348
|
+
size: "sm",
|
|
349
|
+
disabled: busy,
|
|
350
|
+
onClick: () => dismiss.mutate({
|
|
351
|
+
projectId,
|
|
352
|
+
findingId: finding.id
|
|
353
|
+
}),
|
|
354
|
+
children: "Dismiss"
|
|
355
|
+
})
|
|
356
|
+
]
|
|
357
|
+
})
|
|
358
|
+
}, finding.id);
|
|
359
|
+
};
|
|
360
|
+
$[13] = applyFix;
|
|
361
|
+
$[14] = busy;
|
|
362
|
+
$[15] = dismiss;
|
|
363
|
+
$[16] = onShow;
|
|
364
|
+
$[17] = projectId;
|
|
365
|
+
$[18] = t6;
|
|
366
|
+
} else t6 = $[18];
|
|
367
|
+
t5 = findings.map(t6);
|
|
368
|
+
$[6] = applyFix;
|
|
369
|
+
$[7] = busy;
|
|
370
|
+
$[8] = dismiss;
|
|
371
|
+
$[9] = findings;
|
|
372
|
+
$[10] = onShow;
|
|
373
|
+
$[11] = projectId;
|
|
374
|
+
$[12] = t5;
|
|
375
|
+
} else t5 = $[12];
|
|
376
|
+
return t5;
|
|
377
|
+
}
|
|
378
|
+
function _temp2(error_0) {
|
|
379
|
+
return toast.error(error_0.message || "Could not dismiss it");
|
|
380
|
+
}
|
|
381
|
+
function _temp(error) {
|
|
382
|
+
return toast.error(error.message || "Could not apply the fix");
|
|
383
|
+
}
|
|
251
384
|
/** Who made Live's version of a conflict, as a sentence's subject: a member, a release, or none. */
|
|
252
385
|
function whoChanged(conflict) {
|
|
253
386
|
if (conflict.release) return "A release";
|
|
@@ -450,9 +583,9 @@ function UseLiveVersionButton(t0) {
|
|
|
450
583
|
* then lost changes: one card each, with no section heading.
|
|
451
584
|
*/
|
|
452
585
|
function Cards(t0) {
|
|
453
|
-
const $ = c(
|
|
586
|
+
const $ = c(39);
|
|
454
587
|
const { projectId, preview, onChanged, onShow, onOpenThread } = t0;
|
|
455
|
-
const { blockers, conflicts, lost, changes, defaultLocale } = preview;
|
|
588
|
+
const { blockers, findings, conflicts, lost, changes, defaultLocale } = preview;
|
|
456
589
|
let t1;
|
|
457
590
|
if ($[0] !== preview.warnings) {
|
|
458
591
|
t1 = preview.warnings.filter(isShownWarning);
|
|
@@ -460,10 +593,10 @@ function Cards(t0) {
|
|
|
460
593
|
$[1] = t1;
|
|
461
594
|
} else t1 = $[1];
|
|
462
595
|
const warnings = t1;
|
|
463
|
-
if (blockers.length + warnings.length + conflicts.length + lost.length === 0) return null;
|
|
596
|
+
if (blockers.length + findings.length + warnings.length + conflicts.length + lost.length === 0) return null;
|
|
464
597
|
let t2;
|
|
465
598
|
if ($[2] !== changes) {
|
|
466
|
-
t2 = new Set(changes.filter(
|
|
599
|
+
t2 = new Set(changes.filter(_temp3).map(_temp4));
|
|
467
600
|
$[2] = changes;
|
|
468
601
|
$[3] = t2;
|
|
469
602
|
} else t2 = $[3];
|
|
@@ -483,24 +616,38 @@ function Cards(t0) {
|
|
|
483
616
|
$[7] = t3;
|
|
484
617
|
} else t3 = $[7];
|
|
485
618
|
let t4;
|
|
486
|
-
if ($[8] !==
|
|
487
|
-
t4 = /* @__PURE__ */ jsx(
|
|
619
|
+
if ($[8] !== findings || $[9] !== onChanged || $[10] !== onShow || $[11] !== projectId) {
|
|
620
|
+
t4 = /* @__PURE__ */ jsx(FindingCards, {
|
|
621
|
+
projectId,
|
|
622
|
+
findings,
|
|
623
|
+
onChanged,
|
|
624
|
+
onShow
|
|
625
|
+
});
|
|
626
|
+
$[8] = findings;
|
|
627
|
+
$[9] = onChanged;
|
|
628
|
+
$[10] = onShow;
|
|
629
|
+
$[11] = projectId;
|
|
630
|
+
$[12] = t4;
|
|
631
|
+
} else t4 = $[12];
|
|
632
|
+
let t5;
|
|
633
|
+
if ($[13] !== onOpenThread || $[14] !== onShow || $[15] !== warnings) {
|
|
634
|
+
t5 = /* @__PURE__ */ jsx(ProblemCards, {
|
|
488
635
|
problems: warnings,
|
|
489
636
|
tone: "warning",
|
|
490
637
|
icon: TriangleAlert,
|
|
491
638
|
onShow,
|
|
492
639
|
onOpenThread
|
|
493
640
|
});
|
|
494
|
-
$[
|
|
495
|
-
$[
|
|
496
|
-
$[
|
|
497
|
-
$[
|
|
498
|
-
} else
|
|
499
|
-
let
|
|
500
|
-
if ($[
|
|
501
|
-
let
|
|
502
|
-
if ($[
|
|
503
|
-
|
|
641
|
+
$[13] = onOpenThread;
|
|
642
|
+
$[14] = onShow;
|
|
643
|
+
$[15] = warnings;
|
|
644
|
+
$[16] = t5;
|
|
645
|
+
} else t5 = $[16];
|
|
646
|
+
let t6;
|
|
647
|
+
if ($[17] !== conflicts || $[18] !== defaultLocale || $[19] !== deleted || $[20] !== onChanged || $[21] !== projectId) {
|
|
648
|
+
let t7;
|
|
649
|
+
if ($[23] !== defaultLocale || $[24] !== deleted || $[25] !== onChanged || $[26] !== projectId) {
|
|
650
|
+
t7 = (conflict) => /* @__PURE__ */ jsxs(Card, {
|
|
504
651
|
tone: "warning",
|
|
505
652
|
icon: Replace,
|
|
506
653
|
title: conflictTitle(conflict),
|
|
@@ -519,25 +666,25 @@ function Cards(t0) {
|
|
|
519
666
|
})
|
|
520
667
|
]
|
|
521
668
|
}, conflictKey(conflict));
|
|
522
|
-
$[
|
|
523
|
-
$[
|
|
524
|
-
$[
|
|
525
|
-
$[
|
|
526
|
-
$[
|
|
527
|
-
} else
|
|
528
|
-
|
|
529
|
-
$[
|
|
530
|
-
$[
|
|
531
|
-
$[
|
|
532
|
-
$[
|
|
533
|
-
$[
|
|
534
|
-
$[
|
|
535
|
-
} else
|
|
536
|
-
let
|
|
537
|
-
if ($[
|
|
538
|
-
let
|
|
539
|
-
if ($[
|
|
540
|
-
|
|
669
|
+
$[23] = defaultLocale;
|
|
670
|
+
$[24] = deleted;
|
|
671
|
+
$[25] = onChanged;
|
|
672
|
+
$[26] = projectId;
|
|
673
|
+
$[27] = t7;
|
|
674
|
+
} else t7 = $[27];
|
|
675
|
+
t6 = conflicts.map(t7);
|
|
676
|
+
$[17] = conflicts;
|
|
677
|
+
$[18] = defaultLocale;
|
|
678
|
+
$[19] = deleted;
|
|
679
|
+
$[20] = onChanged;
|
|
680
|
+
$[21] = projectId;
|
|
681
|
+
$[22] = t6;
|
|
682
|
+
} else t6 = $[22];
|
|
683
|
+
let t7;
|
|
684
|
+
if ($[28] !== defaultLocale || $[29] !== lost) {
|
|
685
|
+
let t8;
|
|
686
|
+
if ($[31] !== defaultLocale) {
|
|
687
|
+
t8 = (change_1) => /* @__PURE__ */ jsxs(Card, {
|
|
541
688
|
tone: "warning",
|
|
542
689
|
icon: Unlink,
|
|
543
690
|
title: change_1.reason === "writtenAfterDeletion" ? change_1.label : `Loses the change to the ${change_1.label}`,
|
|
@@ -547,41 +694,43 @@ function Cards(t0) {
|
|
|
547
694
|
change_1.id,
|
|
548
695
|
change_1.locale
|
|
549
696
|
]));
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
} else
|
|
553
|
-
|
|
554
|
-
$[
|
|
555
|
-
$[
|
|
556
|
-
$[
|
|
557
|
-
} else
|
|
558
|
-
let
|
|
559
|
-
if ($[
|
|
560
|
-
|
|
697
|
+
$[31] = defaultLocale;
|
|
698
|
+
$[32] = t8;
|
|
699
|
+
} else t8 = $[32];
|
|
700
|
+
t7 = lost.map(t8);
|
|
701
|
+
$[28] = defaultLocale;
|
|
702
|
+
$[29] = lost;
|
|
703
|
+
$[30] = t7;
|
|
704
|
+
} else t7 = $[30];
|
|
705
|
+
let t8;
|
|
706
|
+
if ($[33] !== t3 || $[34] !== t4 || $[35] !== t5 || $[36] !== t6 || $[37] !== t7) {
|
|
707
|
+
t8 = /* @__PURE__ */ jsxs("ul", {
|
|
561
708
|
className: "flex flex-col gap-2",
|
|
562
709
|
children: [
|
|
563
710
|
t3,
|
|
564
711
|
t4,
|
|
565
712
|
t5,
|
|
566
|
-
t6
|
|
713
|
+
t6,
|
|
714
|
+
t7
|
|
567
715
|
]
|
|
568
716
|
});
|
|
569
|
-
$[
|
|
570
|
-
$[
|
|
571
|
-
$[
|
|
572
|
-
$[
|
|
573
|
-
$[
|
|
574
|
-
|
|
575
|
-
|
|
717
|
+
$[33] = t3;
|
|
718
|
+
$[34] = t4;
|
|
719
|
+
$[35] = t5;
|
|
720
|
+
$[36] = t6;
|
|
721
|
+
$[37] = t7;
|
|
722
|
+
$[38] = t8;
|
|
723
|
+
} else t8 = $[38];
|
|
724
|
+
return t8;
|
|
576
725
|
}
|
|
577
|
-
function
|
|
726
|
+
function _temp4(change_0) {
|
|
578
727
|
return JSON.stringify([
|
|
579
728
|
change_0.entity,
|
|
580
729
|
change_0.id,
|
|
581
730
|
change_0.locale
|
|
582
731
|
]);
|
|
583
732
|
}
|
|
584
|
-
function
|
|
733
|
+
function _temp3(change) {
|
|
585
734
|
return change.change === "deleted";
|
|
586
735
|
}
|
|
587
736
|
/** A quiet line saying something is done, with a check, or still running, with a spinner. */
|
|
@@ -617,11 +766,10 @@ function StatusLine(t0) {
|
|
|
617
766
|
return t3;
|
|
618
767
|
}
|
|
619
768
|
/** What Publish sends: the review's token, and the revision a draft with code shows. */
|
|
620
|
-
const publishInput = (projectId, shown
|
|
769
|
+
const publishInput = (projectId, shown) => ({
|
|
621
770
|
projectId,
|
|
622
771
|
token: shown.token,
|
|
623
|
-
...shown.code?.revision && { revision: shown.code.revision }
|
|
624
|
-
...publishAnyway && { publishAnyway }
|
|
772
|
+
...shown.code?.revision && { revision: shown.code.revision }
|
|
625
773
|
});
|
|
626
774
|
/** Why a publish with code went back to the review, as the review says it. */
|
|
627
775
|
const PUBLISH_ABORTED = {
|
|
@@ -632,14 +780,19 @@ const PUBLISH_ABORTED = {
|
|
|
632
780
|
liveCodeMoved: "Live's code changed while publishing, and the draft took too long to take it in, so the publish stopped. Try again.",
|
|
633
781
|
failed: "The publish couldn't finish on Camox's side, and Live is as it was. Try again."
|
|
634
782
|
};
|
|
783
|
+
/** The patrollers still checking the draft: "The Link checker is checking the draft." */
|
|
784
|
+
function checkingSentence(roles) {
|
|
785
|
+
const who = listFormat.format(roles.map((role) => `the ${role}`));
|
|
786
|
+
return `${who[0].toUpperCase()}${who.slice(1)} ${roles.length > 1 ? "are" : "is"} checking the draft.`;
|
|
787
|
+
}
|
|
635
788
|
/**
|
|
636
789
|
* What's fine or still running: the draft is up to date with Live, its latest code changes
|
|
637
|
-
* building, its translations, and the page SEO being written.
|
|
790
|
+
* building, its translations, its patrollers' checks, and the page SEO being written.
|
|
638
791
|
*/
|
|
639
792
|
function StatusLines(t0) {
|
|
640
|
-
const $ = c(
|
|
641
|
-
const { preview, locales
|
|
642
|
-
const { conflicts, translating, warnings, code } = preview;
|
|
793
|
+
const $ = c(36);
|
|
794
|
+
const { preview, locales } = t0;
|
|
795
|
+
const { conflicts, translating, checking, warnings, code } = preview;
|
|
643
796
|
let seoPages;
|
|
644
797
|
let t1;
|
|
645
798
|
let t2;
|
|
@@ -647,58 +800,56 @@ function StatusLines(t0) {
|
|
|
647
800
|
let t4;
|
|
648
801
|
let t5;
|
|
649
802
|
let t6;
|
|
650
|
-
if ($[0] !== code || $[1] !== conflicts.length || $[2] !== locales || $[3] !== translating || $[4] !==
|
|
651
|
-
const translations = locales.filter(
|
|
803
|
+
if ($[0] !== code || $[1] !== conflicts.length || $[2] !== locales || $[3] !== translating || $[4] !== warnings) {
|
|
804
|
+
const translations = locales.filter(_temp5).map(_temp6);
|
|
652
805
|
let t7;
|
|
653
|
-
if ($[
|
|
654
|
-
t7 = new Set(warnings.filter(
|
|
655
|
-
$[
|
|
656
|
-
$[
|
|
657
|
-
} else t7 = $[
|
|
806
|
+
if ($[12] !== warnings) {
|
|
807
|
+
t7 = new Set(warnings.filter(_temp7).map(_temp8));
|
|
808
|
+
$[12] = warnings;
|
|
809
|
+
$[13] = t7;
|
|
810
|
+
} else t7 = $[13];
|
|
658
811
|
seoPages = t7.size;
|
|
659
812
|
const aborted = code?.publishAborted && !code.publishing ? code.publishAborted : null;
|
|
660
813
|
t1 = "flex flex-col gap-1.5";
|
|
661
|
-
if ($[
|
|
814
|
+
if ($[14] !== aborted) {
|
|
662
815
|
t2 = aborted && /* @__PURE__ */ jsx("li", {
|
|
663
816
|
className: "text-sm text-amber-700 dark:text-amber-400",
|
|
664
817
|
children: PUBLISH_ABORTED[aborted] ?? PUBLISH_ABORTED.failed
|
|
665
818
|
});
|
|
666
|
-
$[
|
|
667
|
-
$[
|
|
668
|
-
} else t2 = $[
|
|
669
|
-
if ($[
|
|
819
|
+
$[14] = aborted;
|
|
820
|
+
$[15] = t2;
|
|
821
|
+
} else t2 = $[15];
|
|
822
|
+
if ($[16] !== code?.includesLive || $[17] !== conflicts.length) {
|
|
670
823
|
t3 = conflicts.length === 0 && (code?.includesLive ?? true) && /* @__PURE__ */ jsx(StatusLine, {
|
|
671
824
|
done: true,
|
|
672
825
|
children: "Includes everything published to Live since this draft started"
|
|
673
826
|
});
|
|
674
|
-
$[
|
|
675
|
-
$[
|
|
676
|
-
$[
|
|
677
|
-
} else t3 = $[
|
|
678
|
-
if ($[
|
|
827
|
+
$[16] = code?.includesLive;
|
|
828
|
+
$[17] = conflicts.length;
|
|
829
|
+
$[18] = t3;
|
|
830
|
+
} else t3 = $[18];
|
|
831
|
+
if ($[19] !== code?.building) {
|
|
679
832
|
t4 = code?.building && /* @__PURE__ */ jsx(StatusLine, {
|
|
680
833
|
done: false,
|
|
681
834
|
children: "Building the latest changes…"
|
|
682
835
|
});
|
|
683
|
-
$[
|
|
684
|
-
$[
|
|
685
|
-
} else t4 = $[
|
|
686
|
-
if ($[
|
|
836
|
+
$[19] = code?.building;
|
|
837
|
+
$[20] = t4;
|
|
838
|
+
} else t4 = $[20];
|
|
839
|
+
if ($[21] !== code?.publishing) {
|
|
687
840
|
t5 = code?.publishing && /* @__PURE__ */ jsx(StatusLine, {
|
|
688
841
|
done: false,
|
|
689
842
|
children: "Publishing the new code and content…"
|
|
690
843
|
});
|
|
691
|
-
$[
|
|
692
|
-
$[
|
|
693
|
-
} else t5 = $[
|
|
844
|
+
$[21] = code?.publishing;
|
|
845
|
+
$[22] = t5;
|
|
846
|
+
} else t5 = $[22];
|
|
694
847
|
t6 = translating.length > 0 ? /* @__PURE__ */ jsxs(StatusLine, {
|
|
695
848
|
done: false,
|
|
696
849
|
children: [
|
|
697
850
|
"Translating into ",
|
|
698
851
|
listFormat.format(translating.map(localeLabel)),
|
|
699
|
-
"."
|
|
700
|
-
" ",
|
|
701
|
-
waiting ? "Publishing once translated." : "Publishing waits for it."
|
|
852
|
+
". Publishing waits for it."
|
|
702
853
|
]
|
|
703
854
|
}) : translations.length > 0 && /* @__PURE__ */ jsxs(StatusLine, {
|
|
704
855
|
done: true,
|
|
@@ -708,27 +859,41 @@ function StatusLines(t0) {
|
|
|
708
859
|
$[1] = conflicts.length;
|
|
709
860
|
$[2] = locales;
|
|
710
861
|
$[3] = translating;
|
|
711
|
-
$[4] =
|
|
712
|
-
$[5] =
|
|
713
|
-
$[6] =
|
|
714
|
-
$[7] =
|
|
715
|
-
$[8] =
|
|
716
|
-
$[9] =
|
|
717
|
-
$[10] =
|
|
718
|
-
$[11] =
|
|
719
|
-
$[12] = t6;
|
|
862
|
+
$[4] = warnings;
|
|
863
|
+
$[5] = seoPages;
|
|
864
|
+
$[6] = t1;
|
|
865
|
+
$[7] = t2;
|
|
866
|
+
$[8] = t3;
|
|
867
|
+
$[9] = t4;
|
|
868
|
+
$[10] = t5;
|
|
869
|
+
$[11] = t6;
|
|
720
870
|
} else {
|
|
721
|
-
seoPages = $[
|
|
722
|
-
t1 = $[
|
|
723
|
-
t2 = $[
|
|
724
|
-
t3 = $[
|
|
725
|
-
t4 = $[
|
|
726
|
-
t5 = $[
|
|
727
|
-
t6 = $[
|
|
871
|
+
seoPages = $[5];
|
|
872
|
+
t1 = $[6];
|
|
873
|
+
t2 = $[7];
|
|
874
|
+
t3 = $[8];
|
|
875
|
+
t4 = $[9];
|
|
876
|
+
t5 = $[10];
|
|
877
|
+
t6 = $[11];
|
|
728
878
|
}
|
|
729
879
|
let t7;
|
|
730
|
-
if ($[
|
|
731
|
-
t7 =
|
|
880
|
+
if ($[23] !== checking) {
|
|
881
|
+
t7 = checking.length > 0 && /* @__PURE__ */ jsxs(StatusLine, {
|
|
882
|
+
done: false,
|
|
883
|
+
children: [
|
|
884
|
+
checkingSentence(checking.map(_temp9)),
|
|
885
|
+
" Publishing waits for",
|
|
886
|
+
" ",
|
|
887
|
+
checking.length > 1 ? "them" : "it",
|
|
888
|
+
"."
|
|
889
|
+
]
|
|
890
|
+
});
|
|
891
|
+
$[23] = checking;
|
|
892
|
+
$[24] = t7;
|
|
893
|
+
} else t7 = $[24];
|
|
894
|
+
let t8;
|
|
895
|
+
if ($[25] !== seoPages) {
|
|
896
|
+
t8 = seoPages > 0 && /* @__PURE__ */ jsxs(StatusLine, {
|
|
732
897
|
done: false,
|
|
733
898
|
children: [
|
|
734
899
|
"Writing SEO for ",
|
|
@@ -736,12 +901,12 @@ function StatusLines(t0) {
|
|
|
736
901
|
"…"
|
|
737
902
|
]
|
|
738
903
|
});
|
|
739
|
-
$[
|
|
740
|
-
$[
|
|
741
|
-
} else
|
|
742
|
-
let
|
|
743
|
-
if ($[
|
|
744
|
-
|
|
904
|
+
$[25] = seoPages;
|
|
905
|
+
$[26] = t8;
|
|
906
|
+
} else t8 = $[26];
|
|
907
|
+
let t9;
|
|
908
|
+
if ($[27] !== t1 || $[28] !== t2 || $[29] !== t3 || $[30] !== t4 || $[31] !== t5 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8) {
|
|
909
|
+
t9 = /* @__PURE__ */ jsxs("ul", {
|
|
745
910
|
className: t1,
|
|
746
911
|
children: [
|
|
747
912
|
t2,
|
|
@@ -749,30 +914,36 @@ function StatusLines(t0) {
|
|
|
749
914
|
t4,
|
|
750
915
|
t5,
|
|
751
916
|
t6,
|
|
752
|
-
t7
|
|
917
|
+
t7,
|
|
918
|
+
t8
|
|
753
919
|
]
|
|
754
920
|
});
|
|
755
|
-
$[
|
|
756
|
-
$[
|
|
757
|
-
$[
|
|
758
|
-
$[
|
|
759
|
-
$[
|
|
760
|
-
$[
|
|
761
|
-
$[
|
|
762
|
-
$[
|
|
763
|
-
|
|
764
|
-
|
|
921
|
+
$[27] = t1;
|
|
922
|
+
$[28] = t2;
|
|
923
|
+
$[29] = t3;
|
|
924
|
+
$[30] = t4;
|
|
925
|
+
$[31] = t5;
|
|
926
|
+
$[32] = t6;
|
|
927
|
+
$[33] = t7;
|
|
928
|
+
$[34] = t8;
|
|
929
|
+
$[35] = t9;
|
|
930
|
+
} else t9 = $[35];
|
|
931
|
+
return t9;
|
|
932
|
+
}
|
|
933
|
+
function _temp9(t0) {
|
|
934
|
+
const { role } = t0;
|
|
935
|
+
return role;
|
|
765
936
|
}
|
|
766
|
-
function
|
|
937
|
+
function _temp8(warning_0) {
|
|
767
938
|
return warning_0.id;
|
|
768
939
|
}
|
|
769
|
-
function
|
|
940
|
+
function _temp7(warning) {
|
|
770
941
|
return warning.code === "metaTitlePending";
|
|
771
942
|
}
|
|
772
|
-
function
|
|
943
|
+
function _temp6(locale_0) {
|
|
773
944
|
return locale_0.tag;
|
|
774
945
|
}
|
|
775
|
-
function
|
|
946
|
+
function _temp5(locale) {
|
|
776
947
|
return !locale.isDefault;
|
|
777
948
|
}
|
|
778
949
|
/**
|
|
@@ -790,7 +961,7 @@ function DraftOverview(t0) {
|
|
|
790
961
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
791
962
|
t1 = {
|
|
792
963
|
...draftMutations.retryOverview(),
|
|
793
|
-
onError:
|
|
964
|
+
onError: _temp10
|
|
794
965
|
};
|
|
795
966
|
$[0] = t1;
|
|
796
967
|
} else t1 = $[0];
|
|
@@ -809,7 +980,7 @@ function DraftOverview(t0) {
|
|
|
809
980
|
if (overview.status === "ready") {
|
|
810
981
|
let t2;
|
|
811
982
|
if ($[2] !== overview.bullets) {
|
|
812
|
-
t2 = overview.bullets.map(
|
|
983
|
+
t2 = overview.bullets.map(_temp11);
|
|
813
984
|
$[2] = overview.bullets;
|
|
814
985
|
$[3] = t2;
|
|
815
986
|
} else t2 = $[3];
|
|
@@ -850,7 +1021,7 @@ function DraftOverview(t0) {
|
|
|
850
1021
|
if (overview.status === "failed") {
|
|
851
1022
|
let t2;
|
|
852
1023
|
if ($[11] !== changes) {
|
|
853
|
-
t2 = new Set(changes.map(
|
|
1024
|
+
t2 = new Set(changes.map(_temp12));
|
|
854
1025
|
$[11] = changes;
|
|
855
1026
|
$[12] = t2;
|
|
856
1027
|
} else t2 = $[12];
|
|
@@ -953,13 +1124,13 @@ function DraftOverview(t0) {
|
|
|
953
1124
|
} else t2 = $[33];
|
|
954
1125
|
return t2;
|
|
955
1126
|
}
|
|
956
|
-
function
|
|
1127
|
+
function _temp12(change) {
|
|
957
1128
|
return change.entity === "locale" ? "Languages" : ownerName(change.owner, change.entity);
|
|
958
1129
|
}
|
|
959
|
-
function
|
|
1130
|
+
function _temp11(bullet, index) {
|
|
960
1131
|
return /* @__PURE__ */ jsx("li", { children: bullet }, index);
|
|
961
1132
|
}
|
|
962
|
-
function
|
|
1133
|
+
function _temp10(error) {
|
|
963
1134
|
return toast.error(error.message || "Could not summarize the draft");
|
|
964
1135
|
}
|
|
965
1136
|
/** Switches the studio to Live once its draft ended here, replacing the draft's URL entry. */
|
|
@@ -1014,7 +1185,7 @@ function useRenameDraft(projectId) {
|
|
|
1014
1185
|
t2 = {
|
|
1015
1186
|
mutationFn: t0,
|
|
1016
1187
|
onSuccess: t1,
|
|
1017
|
-
onError:
|
|
1188
|
+
onError: _temp13
|
|
1018
1189
|
};
|
|
1019
1190
|
$[5] = t0;
|
|
1020
1191
|
$[6] = t1;
|
|
@@ -1022,7 +1193,7 @@ function useRenameDraft(projectId) {
|
|
|
1022
1193
|
} else t2 = $[7];
|
|
1023
1194
|
return useMutation(t2);
|
|
1024
1195
|
}
|
|
1025
|
-
function
|
|
1196
|
+
function _temp13(error) {
|
|
1026
1197
|
return toast.error(error.message || "Could not rename the draft");
|
|
1027
1198
|
}
|
|
1028
1199
|
/**
|
|
@@ -1127,7 +1298,7 @@ function DraftNameInput(t0) {
|
|
|
1127
1298
|
* preview is shown. Once the draft ends, the studio switches to Live.
|
|
1128
1299
|
*/
|
|
1129
1300
|
function ReviewDraftSheet(t0) {
|
|
1130
|
-
const $ = c(
|
|
1301
|
+
const $ = c(78);
|
|
1131
1302
|
const { projectId, draftId, open, startRenaming: t1, onOpenChange } = t0;
|
|
1132
1303
|
const startRenaming = t1 === void 0 ? false : t1;
|
|
1133
1304
|
const [confirmingDelete, setConfirmingDelete] = React.useState(false);
|
|
@@ -1267,7 +1438,13 @@ function ReviewDraftSheet(t0) {
|
|
|
1267
1438
|
return;
|
|
1268
1439
|
}
|
|
1269
1440
|
if (error.code === TRANSLATIONS_PENDING_ERROR) {
|
|
1270
|
-
toast.info("Translations are still running.
|
|
1441
|
+
toast.info("Translations are still running. Publishing waits for them.");
|
|
1442
|
+
preview.refetch();
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
const code = error.code;
|
|
1446
|
+
if (code === FINDINGS_OPEN_ERROR || code === CHECKS_RUNNING_ERROR) {
|
|
1447
|
+
toast.info(error.message);
|
|
1271
1448
|
preview.refetch();
|
|
1272
1449
|
return;
|
|
1273
1450
|
}
|
|
@@ -1292,66 +1469,10 @@ function ReviewDraftSheet(t0) {
|
|
|
1292
1469
|
const data = preview.data;
|
|
1293
1470
|
const headline = data?.overview.status === "ready" ? data.overview.headline : null;
|
|
1294
1471
|
const busy = publish.isPending;
|
|
1295
|
-
const ready = !!data && data.blockers.length === 0 && !data.code?.building && !data.code?.publishing && !busy && !preview.isFetching;
|
|
1472
|
+
const ready = !!data && data.blockers.length === 0 && data.translating.length === 0 && data.findings.length === 0 && data.checking.length === 0 && !data.code?.building && !data.code?.publishing && !busy && !preview.isFetching;
|
|
1296
1473
|
let t17;
|
|
1297
|
-
if ($[34] !== data
|
|
1298
|
-
t17 =
|
|
1299
|
-
$[34] = data?.translating;
|
|
1300
|
-
$[35] = t17;
|
|
1301
|
-
} else t17 = $[35];
|
|
1302
|
-
const translating = t17;
|
|
1303
|
-
const [waiting, setWaiting] = React.useState(null);
|
|
1304
|
-
const translated = !!data && !preview.isFetching && data.translating.length === 0;
|
|
1305
|
-
if (waiting && translated) {
|
|
1306
|
-
const appeared = data.conflicts.some((conflict) => !waiting.conflicts.has(conflictKey(conflict)));
|
|
1307
|
-
if (data.blockers.length > 0 || appeared) setWaiting(null);
|
|
1308
|
-
}
|
|
1309
|
-
const { mutate } = publish;
|
|
1310
|
-
let t18;
|
|
1311
|
-
let t19;
|
|
1312
|
-
if ($[36] !== busy || $[37] !== data || $[38] !== mutate || $[39] !== projectId || $[40] !== translated || $[41] !== waiting) {
|
|
1313
|
-
t18 = () => {
|
|
1314
|
-
if (!waiting || !translated || !data || busy) return;
|
|
1315
|
-
mutate(publishInput(projectId, data), { onSettled: () => setWaiting(null) });
|
|
1316
|
-
};
|
|
1317
|
-
t19 = [
|
|
1318
|
-
waiting,
|
|
1319
|
-
translated,
|
|
1320
|
-
data,
|
|
1321
|
-
busy,
|
|
1322
|
-
mutate,
|
|
1323
|
-
projectId
|
|
1324
|
-
];
|
|
1325
|
-
$[36] = busy;
|
|
1326
|
-
$[37] = data;
|
|
1327
|
-
$[38] = mutate;
|
|
1328
|
-
$[39] = projectId;
|
|
1329
|
-
$[40] = translated;
|
|
1330
|
-
$[41] = waiting;
|
|
1331
|
-
$[42] = t18;
|
|
1332
|
-
$[43] = t19;
|
|
1333
|
-
} else {
|
|
1334
|
-
t18 = $[42];
|
|
1335
|
-
t19 = $[43];
|
|
1336
|
-
}
|
|
1337
|
-
React.useEffect(t18, t19);
|
|
1338
|
-
let t20;
|
|
1339
|
-
if ($[44] !== data || $[45] !== projectId || $[46] !== publish || $[47] !== translating.length) {
|
|
1340
|
-
t20 = () => {
|
|
1341
|
-
if (!data) return;
|
|
1342
|
-
if (translating.length === 0) return publish.mutate(publishInput(projectId, data));
|
|
1343
|
-
setWaiting({ conflicts: new Set(data.conflicts.map(conflictKey)) });
|
|
1344
|
-
};
|
|
1345
|
-
$[44] = data;
|
|
1346
|
-
$[45] = projectId;
|
|
1347
|
-
$[46] = publish;
|
|
1348
|
-
$[47] = translating.length;
|
|
1349
|
-
$[48] = t20;
|
|
1350
|
-
} else t20 = $[48];
|
|
1351
|
-
const publishWhole = t20;
|
|
1352
|
-
let t21;
|
|
1353
|
-
if ($[49] !== draft.data || $[50] !== headline || $[51] !== projectId) {
|
|
1354
|
-
t21 = /* @__PURE__ */ jsx("div", {
|
|
1474
|
+
if ($[34] !== draft.data || $[35] !== headline || $[36] !== projectId) {
|
|
1475
|
+
t17 = /* @__PURE__ */ jsx("div", {
|
|
1355
1476
|
className: "flex flex-col gap-1 border-b p-4 pr-12",
|
|
1356
1477
|
children: headline ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(SheetDescription, {
|
|
1357
1478
|
className: "flex min-w-0 items-center gap-1",
|
|
@@ -1384,14 +1505,14 @@ function ReviewDraftSheet(t0) {
|
|
|
1384
1505
|
children: "Draft"
|
|
1385
1506
|
}), /* @__PURE__ */ jsx(SheetDescription, { children: draft.data ? `${draft.data.createdBy.name} · started ${timeAgo(draft.data.createdAt)}` : "Publishing applies this whole draft to Live." })] })
|
|
1386
1507
|
});
|
|
1387
|
-
$[
|
|
1388
|
-
$[
|
|
1389
|
-
$[
|
|
1390
|
-
$[
|
|
1391
|
-
} else
|
|
1392
|
-
let
|
|
1393
|
-
if ($[
|
|
1394
|
-
|
|
1508
|
+
$[34] = draft.data;
|
|
1509
|
+
$[35] = headline;
|
|
1510
|
+
$[36] = projectId;
|
|
1511
|
+
$[37] = t17;
|
|
1512
|
+
} else t17 = $[37];
|
|
1513
|
+
let t18;
|
|
1514
|
+
if ($[38] !== data || $[39] !== locales || $[40] !== onOpenChange || $[41] !== preview || $[42] !== projectId || $[43] !== showInCanvas) {
|
|
1515
|
+
t18 = data ? /* @__PURE__ */ jsxs("div", {
|
|
1395
1516
|
className: "flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto p-4",
|
|
1396
1517
|
children: [
|
|
1397
1518
|
/* @__PURE__ */ jsx(DraftOverview, {
|
|
@@ -1413,161 +1534,137 @@ function ReviewDraftSheet(t0) {
|
|
|
1413
1534
|
}),
|
|
1414
1535
|
/* @__PURE__ */ jsx(StatusLines, {
|
|
1415
1536
|
preview: data,
|
|
1416
|
-
locales: locales.data ?? []
|
|
1417
|
-
waiting: !!waiting
|
|
1537
|
+
locales: locales.data ?? []
|
|
1418
1538
|
})
|
|
1419
1539
|
]
|
|
1420
1540
|
}) : /* @__PURE__ */ jsx("div", {
|
|
1421
1541
|
className: "flex flex-1 items-center justify-center",
|
|
1422
1542
|
children: /* @__PURE__ */ jsx(Spinner, { className: "text-muted-foreground" })
|
|
1423
1543
|
});
|
|
1424
|
-
$[
|
|
1425
|
-
$[
|
|
1426
|
-
$[
|
|
1427
|
-
$[
|
|
1428
|
-
$[
|
|
1429
|
-
$[
|
|
1430
|
-
$[
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
let
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
$[
|
|
1439
|
-
$[62] = t24;
|
|
1544
|
+
$[38] = data;
|
|
1545
|
+
$[39] = locales;
|
|
1546
|
+
$[40] = onOpenChange;
|
|
1547
|
+
$[41] = preview;
|
|
1548
|
+
$[42] = projectId;
|
|
1549
|
+
$[43] = showInCanvas;
|
|
1550
|
+
$[44] = t18;
|
|
1551
|
+
} else t18 = $[44];
|
|
1552
|
+
let t19;
|
|
1553
|
+
let t20;
|
|
1554
|
+
if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1555
|
+
t19 = () => setConfirmingDelete(true);
|
|
1556
|
+
t20 = /* @__PURE__ */ jsx(Trash2, {});
|
|
1557
|
+
$[45] = t19;
|
|
1558
|
+
$[46] = t20;
|
|
1440
1559
|
} else {
|
|
1441
|
-
|
|
1442
|
-
|
|
1560
|
+
t19 = $[45];
|
|
1561
|
+
t20 = $[46];
|
|
1443
1562
|
}
|
|
1444
|
-
let
|
|
1445
|
-
if ($[
|
|
1446
|
-
|
|
1563
|
+
let t21;
|
|
1564
|
+
if ($[47] !== busy) {
|
|
1565
|
+
t21 = /* @__PURE__ */ jsxs(Button, {
|
|
1447
1566
|
variant: "ghost",
|
|
1448
1567
|
className: "text-destructive",
|
|
1449
1568
|
disabled: busy,
|
|
1450
|
-
onClick:
|
|
1451
|
-
children: [
|
|
1569
|
+
onClick: t19,
|
|
1570
|
+
children: [t20, "Delete draft"]
|
|
1452
1571
|
});
|
|
1453
|
-
$[
|
|
1454
|
-
$[
|
|
1455
|
-
} else
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1572
|
+
$[47] = busy;
|
|
1573
|
+
$[48] = t21;
|
|
1574
|
+
} else t21 = $[48];
|
|
1575
|
+
const t22 = !ready;
|
|
1576
|
+
let t23;
|
|
1577
|
+
if ($[49] !== data || $[50] !== projectId || $[51] !== publish) {
|
|
1578
|
+
t23 = () => data && publish.mutate(publishInput(projectId, data));
|
|
1579
|
+
$[49] = data;
|
|
1580
|
+
$[50] = projectId;
|
|
1581
|
+
$[51] = publish;
|
|
1582
|
+
$[52] = t23;
|
|
1583
|
+
} else t23 = $[52];
|
|
1584
|
+
let t24;
|
|
1585
|
+
if ($[53] !== publish.isPending) {
|
|
1586
|
+
t24 = publish.isPending ? /* @__PURE__ */ jsx(Spinner, {}) : null;
|
|
1587
|
+
$[53] = publish.isPending;
|
|
1588
|
+
$[54] = t24;
|
|
1589
|
+
} else t24 = $[54];
|
|
1590
|
+
let t25;
|
|
1591
|
+
if ($[55] !== t22 || $[56] !== t23 || $[57] !== t24) {
|
|
1592
|
+
t25 = /* @__PURE__ */ jsxs(Button, {
|
|
1460
1593
|
className: "ml-auto",
|
|
1461
|
-
disabled:
|
|
1462
|
-
onClick:
|
|
1463
|
-
children: "Publish
|
|
1464
|
-
});
|
|
1465
|
-
$[65] = data;
|
|
1466
|
-
$[66] = projectId;
|
|
1467
|
-
$[67] = publish;
|
|
1468
|
-
$[68] = ready;
|
|
1469
|
-
$[69] = translating.length;
|
|
1470
|
-
$[70] = t26;
|
|
1471
|
-
} else t26 = $[70];
|
|
1472
|
-
const t27 = translating.length === 0 && "ml-auto";
|
|
1473
|
-
let t28;
|
|
1474
|
-
if ($[71] !== t27) {
|
|
1475
|
-
t28 = cn(t27);
|
|
1476
|
-
$[71] = t27;
|
|
1477
|
-
$[72] = t28;
|
|
1478
|
-
} else t28 = $[72];
|
|
1479
|
-
const t29 = !ready || !!waiting;
|
|
1480
|
-
let t30;
|
|
1481
|
-
if ($[73] !== publish.isPending || $[74] !== waiting) {
|
|
1482
|
-
t30 = publish.isPending || waiting ? /* @__PURE__ */ jsx(Spinner, {}) : null;
|
|
1483
|
-
$[73] = publish.isPending;
|
|
1484
|
-
$[74] = waiting;
|
|
1485
|
-
$[75] = t30;
|
|
1486
|
-
} else t30 = $[75];
|
|
1487
|
-
let t31;
|
|
1488
|
-
if ($[76] !== publishWhole || $[77] !== t28 || $[78] !== t29 || $[79] !== t30) {
|
|
1489
|
-
t31 = /* @__PURE__ */ jsxs(Button, {
|
|
1490
|
-
className: t28,
|
|
1491
|
-
disabled: t29,
|
|
1492
|
-
onClick: publishWhole,
|
|
1493
|
-
children: [t30, "Publish"]
|
|
1594
|
+
disabled: t22,
|
|
1595
|
+
onClick: t23,
|
|
1596
|
+
children: [t24, "Publish"]
|
|
1494
1597
|
});
|
|
1495
|
-
$[
|
|
1496
|
-
$[
|
|
1497
|
-
$[
|
|
1498
|
-
$[
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
t32 = /* @__PURE__ */ jsx("div", {
|
|
1598
|
+
$[55] = t22;
|
|
1599
|
+
$[56] = t23;
|
|
1600
|
+
$[57] = t24;
|
|
1601
|
+
$[58] = t25;
|
|
1602
|
+
} else t25 = $[58];
|
|
1603
|
+
let t26;
|
|
1604
|
+
if ($[59] !== t21 || $[60] !== t25) {
|
|
1605
|
+
t26 = /* @__PURE__ */ jsx("div", {
|
|
1504
1606
|
className: "flex flex-col gap-3 border-t p-4",
|
|
1505
1607
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1506
1608
|
className: "flex items-center gap-2",
|
|
1507
|
-
children: [
|
|
1508
|
-
t25,
|
|
1509
|
-
t26,
|
|
1510
|
-
t31
|
|
1511
|
-
]
|
|
1609
|
+
children: [t21, t25]
|
|
1512
1610
|
})
|
|
1513
1611
|
});
|
|
1514
|
-
$[
|
|
1515
|
-
$[
|
|
1516
|
-
$[
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
t33 = /* @__PURE__ */ jsxs(SheetContent, {
|
|
1612
|
+
$[59] = t21;
|
|
1613
|
+
$[60] = t25;
|
|
1614
|
+
$[61] = t26;
|
|
1615
|
+
} else t26 = $[61];
|
|
1616
|
+
let t27;
|
|
1617
|
+
if ($[62] !== initialFocus || $[63] !== t17 || $[64] !== t18 || $[65] !== t26) {
|
|
1618
|
+
t27 = /* @__PURE__ */ jsxs(SheetContent, {
|
|
1522
1619
|
ref: popup,
|
|
1523
1620
|
initialFocus,
|
|
1524
1621
|
side: "right",
|
|
1525
1622
|
className: "w-full gap-0 data-[side=right]:sm:max-w-lg",
|
|
1526
1623
|
children: [
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1624
|
+
t17,
|
|
1625
|
+
t18,
|
|
1626
|
+
t26
|
|
1530
1627
|
]
|
|
1531
1628
|
});
|
|
1532
|
-
$[
|
|
1533
|
-
$[
|
|
1534
|
-
$[
|
|
1535
|
-
$[
|
|
1536
|
-
$[
|
|
1537
|
-
} else
|
|
1538
|
-
let
|
|
1539
|
-
if ($[
|
|
1540
|
-
|
|
1629
|
+
$[62] = initialFocus;
|
|
1630
|
+
$[63] = t17;
|
|
1631
|
+
$[64] = t18;
|
|
1632
|
+
$[65] = t26;
|
|
1633
|
+
$[66] = t27;
|
|
1634
|
+
} else t27 = $[66];
|
|
1635
|
+
let t28;
|
|
1636
|
+
if ($[67] !== onOpenChange || $[68] !== open || $[69] !== t27) {
|
|
1637
|
+
t28 = /* @__PURE__ */ jsx(Sheet, {
|
|
1541
1638
|
open,
|
|
1542
1639
|
onOpenChange,
|
|
1543
|
-
children:
|
|
1640
|
+
children: t27
|
|
1544
1641
|
});
|
|
1545
|
-
$[
|
|
1546
|
-
$[
|
|
1547
|
-
$[
|
|
1548
|
-
$[
|
|
1549
|
-
} else
|
|
1550
|
-
let
|
|
1551
|
-
if ($[
|
|
1552
|
-
|
|
1642
|
+
$[67] = onOpenChange;
|
|
1643
|
+
$[68] = open;
|
|
1644
|
+
$[69] = t27;
|
|
1645
|
+
$[70] = t28;
|
|
1646
|
+
} else t28 = $[70];
|
|
1647
|
+
let t29;
|
|
1648
|
+
if ($[71] !== confirmingDelete || $[72] !== leave || $[73] !== projectId) {
|
|
1649
|
+
t29 = /* @__PURE__ */ jsx(DeleteDraftDialog, {
|
|
1553
1650
|
projectId,
|
|
1554
1651
|
open: confirmingDelete,
|
|
1555
1652
|
onOpenChange: setConfirmingDelete,
|
|
1556
1653
|
onDeleted: leave
|
|
1557
1654
|
});
|
|
1558
|
-
$[
|
|
1559
|
-
$[
|
|
1560
|
-
$[
|
|
1561
|
-
$[
|
|
1562
|
-
} else
|
|
1563
|
-
let
|
|
1564
|
-
if ($[
|
|
1565
|
-
|
|
1566
|
-
$[
|
|
1567
|
-
$[
|
|
1568
|
-
$[
|
|
1569
|
-
} else
|
|
1570
|
-
return
|
|
1655
|
+
$[71] = confirmingDelete;
|
|
1656
|
+
$[72] = leave;
|
|
1657
|
+
$[73] = projectId;
|
|
1658
|
+
$[74] = t29;
|
|
1659
|
+
} else t29 = $[74];
|
|
1660
|
+
let t30;
|
|
1661
|
+
if ($[75] !== t28 || $[76] !== t29) {
|
|
1662
|
+
t30 = /* @__PURE__ */ jsxs(Fragment, { children: [t28, t29] });
|
|
1663
|
+
$[75] = t28;
|
|
1664
|
+
$[76] = t29;
|
|
1665
|
+
$[77] = t30;
|
|
1666
|
+
} else t30 = $[77];
|
|
1667
|
+
return t30;
|
|
1571
1668
|
}
|
|
1572
1669
|
/** Asks before deleting the draft the studio is in, then deletes it. */
|
|
1573
1670
|
function DeleteDraftDialog(t0) {
|
|
@@ -1587,7 +1684,7 @@ function DeleteDraftDialog(t0) {
|
|
|
1587
1684
|
onOpenChange(false);
|
|
1588
1685
|
onDeleted(ended);
|
|
1589
1686
|
},
|
|
1590
|
-
onError:
|
|
1687
|
+
onError: _temp14
|
|
1591
1688
|
};
|
|
1592
1689
|
$[1] = onDeleted;
|
|
1593
1690
|
$[2] = onOpenChange;
|
|
@@ -1666,7 +1763,7 @@ function DeleteDraftDialog(t0) {
|
|
|
1666
1763
|
} else t10 = $[25];
|
|
1667
1764
|
return t10;
|
|
1668
1765
|
}
|
|
1669
|
-
function
|
|
1766
|
+
function _temp14(error) {
|
|
1670
1767
|
return toast.error(error.message || "Could not delete the draft");
|
|
1671
1768
|
}
|
|
1672
1769
|
|