camox 0.65.1 → 0.67.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.
- package/dist/features/canvas/CamoxCanvas.js +195 -173
- package/dist/features/canvas/canvasFrameCapture.js +5 -12
- package/dist/features/canvas/canvasFrameDocument.js +90 -29
- package/dist/features/canvas/canvasItems.js +22 -6
- package/dist/features/canvas/sidebar/ContentSidebar.js +19 -21
- package/dist/features/canvas/sidebar/LayoutPageOverview.js +22 -49
- package/dist/features/canvas/sidebar/LayoutPageSeo.js +73 -76
- package/dist/features/canvas/sidebar/PageInspector.js +61 -50
- package/dist/features/canvas/sidebar/PageInspectorSkeleton.js +4 -4
- package/dist/features/canvas/useCanvasCamera.js +22 -5
- package/dist/features/content/components/MissingFromLocale.js +1 -1
- package/dist/features/page/UnplacedLayoutContent.js +141 -0
- package/dist/features/preview/components/ItemFieldsEditor.js +50 -44
- package/dist/features/preview/components/PageInfo.js +103 -100
- package/dist/features/preview/components/SelectionEditor.js +284 -231
- package/dist/features/preview/components/contentFieldSchema.js +5 -1
- package/dist/features/runtime/RuntimeChrome.js +66 -40
- package/dist/features/runtime/pageApp.js +24 -10
- package/dist/features/runtime/runtime.d.ts +13 -0
- package/dist/features/runtime/runtime.js +58 -2
- package/dist/features/studio/components/AgentSidebar.js +3 -3
- package/dist/features/studio/components/ChatWidget.js +34 -29
- package/dist/features/studio/components/ContentFindings.js +397 -0
- package/dist/features/studio/components/DraftsControl.js +172 -159
- package/dist/features/studio/components/Patrol.js +449 -426
- package/dist/features/studio/components/ReviewDraftSheet.js +231 -192
- package/dist/features/studio/components/Squareling.js +0 -9
- package/dist/features/studio/components/ThreadComposer.js +183 -121
- package/dist/features/studio/components/ThreadMessages.js +19 -11
- package/dist/features/studio/components/UnnamedDraftBar.js +349 -0
- package/dist/features/studio/findingSentence.js +3 -5
- package/dist/features/studio/patrollerBio.js +39 -0
- package/dist/features/studio/reportSentence.js +0 -5
- package/dist/features/studio/studioStore.js +13 -0
- package/dist/features/studio/workingSentence.js +2 -11
- package/dist/lib/revisions.js +25 -3
- package/dist/lib/use-thread.js +1 -1
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/features/canvas/sidebar/DerivedPageInspector.js +0 -49
- package/dist/features/canvas/sidebar/SingletonPageInspector.js +0 -39
|
@@ -6,9 +6,9 @@ import { draftMutations, patrolMutations } from "../../../lib/queries.js";
|
|
|
6
6
|
import { previewStore } from "../../preview/previewStore.js";
|
|
7
7
|
import { studioStore } from "../studioStore.js";
|
|
8
8
|
import { localeLabel } from "../localeOptions.js";
|
|
9
|
-
import { draftLabel, plural, timeAgo } from "../draftLabel.js";
|
|
10
9
|
import { askAgentMessage, findingSentence, fixLabel } from "../findingSentence.js";
|
|
11
10
|
import { useShowInCanvas } from "../showInCanvas.js";
|
|
11
|
+
import { draftLabel, plural, timeAgo } from "../draftLabel.js";
|
|
12
12
|
import { c } from "react/compiler-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { CHECKS_RUNNING_ERROR, CONFLICTS_CHANGED_ERROR, FINDINGS_OPEN_ERROR, REVISION_CHANGED_ERROR, TRANSLATIONS_PENDING_ERROR } from "@camox/api-contract/drafts";
|
|
@@ -249,7 +249,7 @@ function ProblemCards({ problems, tone, icon, onShow, onOpenThread }) {
|
|
|
249
249
|
}, `shared:${message}`)];
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
/** Where the Canvas shows a finding: its block or item on its page. */
|
|
252
|
+
/** Where the Canvas shows a finding: its field, in its block or item on its page. */
|
|
253
253
|
function findingTarget(finding) {
|
|
254
254
|
const { place } = finding;
|
|
255
255
|
if (place?.kind !== "page") return null;
|
|
@@ -260,7 +260,7 @@ function findingTarget(finding) {
|
|
|
260
260
|
itemId: place.itemId,
|
|
261
261
|
field: place.blockId ? {
|
|
262
262
|
name: finding.field,
|
|
263
|
-
kind:
|
|
263
|
+
kind: finding.fieldKind
|
|
264
264
|
} : null
|
|
265
265
|
};
|
|
266
266
|
}
|
|
@@ -282,7 +282,7 @@ function FindingCards(t0) {
|
|
|
282
282
|
...t1,
|
|
283
283
|
onSuccess: (t3) => {
|
|
284
284
|
const { applied } = t3;
|
|
285
|
-
if (!applied) toast.info("The
|
|
285
|
+
if (!applied) toast.info("The link changed since it was checked, so it's being checked again.");
|
|
286
286
|
onChanged();
|
|
287
287
|
},
|
|
288
288
|
onError: _temp
|
|
@@ -1139,9 +1139,13 @@ function useLeaveDraft() {
|
|
|
1139
1139
|
const draftScope = useDraftScope();
|
|
1140
1140
|
let t0;
|
|
1141
1141
|
if ($[0] !== draftScope) {
|
|
1142
|
-
t0 = (ended) => {
|
|
1142
|
+
t0 = (ended, t1) => {
|
|
1143
|
+
const { discarded: t2 } = t1 === void 0 ? {} : t1;
|
|
1144
|
+
const discarded = t2 === void 0 ? false : t2;
|
|
1143
1145
|
draftScope.leave(ended);
|
|
1144
|
-
if (ended)
|
|
1146
|
+
if (!ended) return;
|
|
1147
|
+
const what = discarded ? "Changes discarded" : `Draft ${ended.outcome}`;
|
|
1148
|
+
toast.success(`${what}. You're now viewing Live.`);
|
|
1145
1149
|
};
|
|
1146
1150
|
$[0] = draftScope;
|
|
1147
1151
|
$[1] = t0;
|
|
@@ -1298,7 +1302,7 @@ function DraftNameInput(t0) {
|
|
|
1298
1302
|
* preview is shown. Once the draft ends, the studio switches to Live.
|
|
1299
1303
|
*/
|
|
1300
1304
|
function ReviewDraftSheet(t0) {
|
|
1301
|
-
const $ = c(
|
|
1305
|
+
const $ = c(81);
|
|
1302
1306
|
const { projectId, draftId, open, startRenaming: t1, onOpenChange } = t0;
|
|
1303
1307
|
const startRenaming = t1 === void 0 ? false : t1;
|
|
1304
1308
|
const [confirmingDelete, setConfirmingDelete] = React.useState(false);
|
|
@@ -1392,24 +1396,26 @@ function ReviewDraftSheet(t0) {
|
|
|
1392
1396
|
t11 = $[21];
|
|
1393
1397
|
}
|
|
1394
1398
|
React.useEffect(t10, t11);
|
|
1399
|
+
const discard = draft.data?.name === null;
|
|
1395
1400
|
let t12;
|
|
1396
|
-
if ($[22] !==
|
|
1401
|
+
if ($[22] !== discard || $[23] !== leaveDraft || $[24] !== onOpenChange) {
|
|
1397
1402
|
t12 = (ended) => {
|
|
1398
1403
|
onOpenChange(false);
|
|
1399
|
-
leaveDraft(ended);
|
|
1404
|
+
leaveDraft(ended, { discarded: discard });
|
|
1400
1405
|
};
|
|
1401
|
-
$[22] =
|
|
1402
|
-
$[23] =
|
|
1403
|
-
$[24] =
|
|
1404
|
-
|
|
1406
|
+
$[22] = discard;
|
|
1407
|
+
$[23] = leaveDraft;
|
|
1408
|
+
$[24] = onOpenChange;
|
|
1409
|
+
$[25] = t12;
|
|
1410
|
+
} else t12 = $[25];
|
|
1405
1411
|
const leave = t12;
|
|
1406
1412
|
let t13;
|
|
1407
|
-
if ($[
|
|
1413
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1408
1414
|
t13 = draftMutations.publish();
|
|
1409
|
-
$[
|
|
1410
|
-
} else t13 = $[
|
|
1415
|
+
$[26] = t13;
|
|
1416
|
+
} else t13 = $[26];
|
|
1411
1417
|
let t14;
|
|
1412
|
-
if ($[
|
|
1418
|
+
if ($[27] !== leave || $[28] !== preview) {
|
|
1413
1419
|
t14 = (result) => {
|
|
1414
1420
|
if ("publishing" in result && result.publishing) {
|
|
1415
1421
|
preview.refetch();
|
|
@@ -1420,12 +1426,12 @@ function ReviewDraftSheet(t0) {
|
|
|
1420
1426
|
toast.info("This draft has no changes, so there is nothing to publish.");
|
|
1421
1427
|
preview.refetch();
|
|
1422
1428
|
};
|
|
1423
|
-
$[
|
|
1424
|
-
$[
|
|
1425
|
-
$[
|
|
1426
|
-
} else t14 = $[
|
|
1429
|
+
$[27] = leave;
|
|
1430
|
+
$[28] = preview;
|
|
1431
|
+
$[29] = t14;
|
|
1432
|
+
} else t14 = $[29];
|
|
1427
1433
|
let t15;
|
|
1428
|
-
if ($[
|
|
1434
|
+
if ($[30] !== preview) {
|
|
1429
1435
|
t15 = (error) => {
|
|
1430
1436
|
if (error.code === CONFLICTS_CHANGED_ERROR) {
|
|
1431
1437
|
toast.error("Live changed since you opened this review. Check the new list.");
|
|
@@ -1451,27 +1457,27 @@ function ReviewDraftSheet(t0) {
|
|
|
1451
1457
|
toast.error(error.message || "Could not publish the draft");
|
|
1452
1458
|
preview.refetch();
|
|
1453
1459
|
};
|
|
1454
|
-
$[
|
|
1455
|
-
$[
|
|
1456
|
-
} else t15 = $[
|
|
1460
|
+
$[30] = preview;
|
|
1461
|
+
$[31] = t15;
|
|
1462
|
+
} else t15 = $[31];
|
|
1457
1463
|
let t16;
|
|
1458
|
-
if ($[
|
|
1464
|
+
if ($[32] !== t14 || $[33] !== t15) {
|
|
1459
1465
|
t16 = {
|
|
1460
1466
|
...t13,
|
|
1461
1467
|
onSuccess: t14,
|
|
1462
1468
|
onError: t15
|
|
1463
1469
|
};
|
|
1464
|
-
$[
|
|
1465
|
-
$[
|
|
1466
|
-
$[
|
|
1467
|
-
} else t16 = $[
|
|
1470
|
+
$[32] = t14;
|
|
1471
|
+
$[33] = t15;
|
|
1472
|
+
$[34] = t16;
|
|
1473
|
+
} else t16 = $[34];
|
|
1468
1474
|
const publish = useMutation(t16);
|
|
1469
1475
|
const data = preview.data;
|
|
1470
1476
|
const headline = data?.overview.status === "ready" ? data.overview.headline : null;
|
|
1471
1477
|
const busy = publish.isPending;
|
|
1472
1478
|
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;
|
|
1473
1479
|
let t17;
|
|
1474
|
-
if ($[
|
|
1480
|
+
if ($[35] !== draft.data || $[36] !== headline || $[37] !== projectId) {
|
|
1475
1481
|
t17 = /* @__PURE__ */ jsx("div", {
|
|
1476
1482
|
className: "flex flex-col gap-1 border-b p-4 pr-12",
|
|
1477
1483
|
children: headline ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(SheetDescription, {
|
|
@@ -1505,13 +1511,13 @@ function ReviewDraftSheet(t0) {
|
|
|
1505
1511
|
children: "Draft"
|
|
1506
1512
|
}), /* @__PURE__ */ jsx(SheetDescription, { children: draft.data ? `${draft.data.createdBy.name} · started ${timeAgo(draft.data.createdAt)}` : "Publishing applies this whole draft to Live." })] })
|
|
1507
1513
|
});
|
|
1508
|
-
$[
|
|
1509
|
-
$[
|
|
1510
|
-
$[
|
|
1511
|
-
$[
|
|
1512
|
-
} else t17 = $[
|
|
1514
|
+
$[35] = draft.data;
|
|
1515
|
+
$[36] = headline;
|
|
1516
|
+
$[37] = projectId;
|
|
1517
|
+
$[38] = t17;
|
|
1518
|
+
} else t17 = $[38];
|
|
1513
1519
|
let t18;
|
|
1514
|
-
if ($[
|
|
1520
|
+
if ($[39] !== data || $[40] !== locales || $[41] !== onOpenChange || $[42] !== preview || $[43] !== projectId || $[44] !== showInCanvas) {
|
|
1515
1521
|
t18 = data ? /* @__PURE__ */ jsxs("div", {
|
|
1516
1522
|
className: "flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto p-4",
|
|
1517
1523
|
children: [
|
|
@@ -1541,81 +1547,83 @@ function ReviewDraftSheet(t0) {
|
|
|
1541
1547
|
className: "flex flex-1 items-center justify-center",
|
|
1542
1548
|
children: /* @__PURE__ */ jsx(Spinner, { className: "text-muted-foreground" })
|
|
1543
1549
|
});
|
|
1544
|
-
$[
|
|
1545
|
-
$[
|
|
1546
|
-
$[
|
|
1547
|
-
$[
|
|
1548
|
-
$[
|
|
1549
|
-
$[
|
|
1550
|
-
$[
|
|
1551
|
-
} else t18 = $[
|
|
1550
|
+
$[39] = data;
|
|
1551
|
+
$[40] = locales;
|
|
1552
|
+
$[41] = onOpenChange;
|
|
1553
|
+
$[42] = preview;
|
|
1554
|
+
$[43] = projectId;
|
|
1555
|
+
$[44] = showInCanvas;
|
|
1556
|
+
$[45] = t18;
|
|
1557
|
+
} else t18 = $[45];
|
|
1552
1558
|
let t19;
|
|
1553
1559
|
let t20;
|
|
1554
|
-
if ($[
|
|
1560
|
+
if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1555
1561
|
t19 = () => setConfirmingDelete(true);
|
|
1556
1562
|
t20 = /* @__PURE__ */ jsx(Trash2, {});
|
|
1557
|
-
$[
|
|
1558
|
-
$[
|
|
1563
|
+
$[46] = t19;
|
|
1564
|
+
$[47] = t20;
|
|
1559
1565
|
} else {
|
|
1560
|
-
t19 = $[
|
|
1561
|
-
t20 = $[
|
|
1566
|
+
t19 = $[46];
|
|
1567
|
+
t20 = $[47];
|
|
1562
1568
|
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1569
|
+
const t21 = discard ? "Discard changes" : "Delete draft";
|
|
1570
|
+
let t22;
|
|
1571
|
+
if ($[48] !== busy || $[49] !== t21) {
|
|
1572
|
+
t22 = /* @__PURE__ */ jsxs(Button, {
|
|
1566
1573
|
variant: "ghost",
|
|
1567
1574
|
className: "text-destructive",
|
|
1568
1575
|
disabled: busy,
|
|
1569
1576
|
onClick: t19,
|
|
1570
|
-
children: [t20,
|
|
1577
|
+
children: [t20, t21]
|
|
1571
1578
|
});
|
|
1572
|
-
$[
|
|
1573
|
-
$[
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
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];
|
|
1579
|
+
$[48] = busy;
|
|
1580
|
+
$[49] = t21;
|
|
1581
|
+
$[50] = t22;
|
|
1582
|
+
} else t22 = $[50];
|
|
1583
|
+
const t23 = !ready;
|
|
1584
1584
|
let t24;
|
|
1585
|
-
if ($[53] !== publish
|
|
1586
|
-
t24 =
|
|
1587
|
-
$[
|
|
1585
|
+
if ($[51] !== data || $[52] !== projectId || $[53] !== publish) {
|
|
1586
|
+
t24 = () => data && publish.mutate(publishInput(projectId, data));
|
|
1587
|
+
$[51] = data;
|
|
1588
|
+
$[52] = projectId;
|
|
1589
|
+
$[53] = publish;
|
|
1588
1590
|
$[54] = t24;
|
|
1589
1591
|
} else t24 = $[54];
|
|
1590
1592
|
let t25;
|
|
1591
|
-
if ($[55] !==
|
|
1592
|
-
t25 = /* @__PURE__ */
|
|
1593
|
+
if ($[55] !== publish.isPending) {
|
|
1594
|
+
t25 = publish.isPending ? /* @__PURE__ */ jsx(Spinner, {}) : null;
|
|
1595
|
+
$[55] = publish.isPending;
|
|
1596
|
+
$[56] = t25;
|
|
1597
|
+
} else t25 = $[56];
|
|
1598
|
+
let t26;
|
|
1599
|
+
if ($[57] !== t23 || $[58] !== t24 || $[59] !== t25) {
|
|
1600
|
+
t26 = /* @__PURE__ */ jsxs(Button, {
|
|
1593
1601
|
className: "ml-auto",
|
|
1594
|
-
disabled:
|
|
1595
|
-
onClick:
|
|
1596
|
-
children: [
|
|
1602
|
+
disabled: t23,
|
|
1603
|
+
onClick: t24,
|
|
1604
|
+
children: [t25, "Publish"]
|
|
1597
1605
|
});
|
|
1598
|
-
$[
|
|
1599
|
-
$[
|
|
1600
|
-
$[
|
|
1601
|
-
$[
|
|
1602
|
-
} else
|
|
1603
|
-
let
|
|
1604
|
-
if ($[
|
|
1605
|
-
|
|
1606
|
+
$[57] = t23;
|
|
1607
|
+
$[58] = t24;
|
|
1608
|
+
$[59] = t25;
|
|
1609
|
+
$[60] = t26;
|
|
1610
|
+
} else t26 = $[60];
|
|
1611
|
+
let t27;
|
|
1612
|
+
if ($[61] !== t22 || $[62] !== t26) {
|
|
1613
|
+
t27 = /* @__PURE__ */ jsx("div", {
|
|
1606
1614
|
className: "flex flex-col gap-3 border-t p-4",
|
|
1607
1615
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1608
1616
|
className: "flex items-center gap-2",
|
|
1609
|
-
children: [
|
|
1617
|
+
children: [t22, t26]
|
|
1610
1618
|
})
|
|
1611
1619
|
});
|
|
1612
|
-
$[
|
|
1613
|
-
$[
|
|
1614
|
-
$[
|
|
1615
|
-
} else
|
|
1616
|
-
let
|
|
1617
|
-
if ($[
|
|
1618
|
-
|
|
1620
|
+
$[61] = t22;
|
|
1621
|
+
$[62] = t26;
|
|
1622
|
+
$[63] = t27;
|
|
1623
|
+
} else t27 = $[63];
|
|
1624
|
+
let t28;
|
|
1625
|
+
if ($[64] !== initialFocus || $[65] !== t17 || $[66] !== t18 || $[67] !== t27) {
|
|
1626
|
+
t28 = /* @__PURE__ */ jsxs(SheetContent, {
|
|
1619
1627
|
ref: popup,
|
|
1620
1628
|
initialFocus,
|
|
1621
1629
|
side: "right",
|
|
@@ -1623,64 +1631,70 @@ function ReviewDraftSheet(t0) {
|
|
|
1623
1631
|
children: [
|
|
1624
1632
|
t17,
|
|
1625
1633
|
t18,
|
|
1626
|
-
|
|
1634
|
+
t27
|
|
1627
1635
|
]
|
|
1628
1636
|
});
|
|
1629
|
-
$[
|
|
1630
|
-
$[
|
|
1631
|
-
$[
|
|
1632
|
-
$[
|
|
1633
|
-
$[
|
|
1634
|
-
} else
|
|
1635
|
-
let
|
|
1636
|
-
if ($[
|
|
1637
|
-
|
|
1637
|
+
$[64] = initialFocus;
|
|
1638
|
+
$[65] = t17;
|
|
1639
|
+
$[66] = t18;
|
|
1640
|
+
$[67] = t27;
|
|
1641
|
+
$[68] = t28;
|
|
1642
|
+
} else t28 = $[68];
|
|
1643
|
+
let t29;
|
|
1644
|
+
if ($[69] !== onOpenChange || $[70] !== open || $[71] !== t28) {
|
|
1645
|
+
t29 = /* @__PURE__ */ jsx(Sheet, {
|
|
1638
1646
|
open,
|
|
1639
1647
|
onOpenChange,
|
|
1640
|
-
children:
|
|
1648
|
+
children: t28
|
|
1641
1649
|
});
|
|
1642
|
-
$[
|
|
1643
|
-
$[
|
|
1644
|
-
$[
|
|
1645
|
-
$[
|
|
1646
|
-
} else
|
|
1647
|
-
let
|
|
1648
|
-
if ($[
|
|
1649
|
-
|
|
1650
|
+
$[69] = onOpenChange;
|
|
1651
|
+
$[70] = open;
|
|
1652
|
+
$[71] = t28;
|
|
1653
|
+
$[72] = t29;
|
|
1654
|
+
} else t29 = $[72];
|
|
1655
|
+
let t30;
|
|
1656
|
+
if ($[73] !== confirmingDelete || $[74] !== discard || $[75] !== leave || $[76] !== projectId) {
|
|
1657
|
+
t30 = /* @__PURE__ */ jsx(DeleteDraftDialog, {
|
|
1650
1658
|
projectId,
|
|
1651
1659
|
open: confirmingDelete,
|
|
1660
|
+
discard,
|
|
1652
1661
|
onOpenChange: setConfirmingDelete,
|
|
1653
1662
|
onDeleted: leave
|
|
1654
1663
|
});
|
|
1655
|
-
$[
|
|
1656
|
-
$[
|
|
1657
|
-
$[
|
|
1658
|
-
$[
|
|
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;
|
|
1664
|
+
$[73] = confirmingDelete;
|
|
1665
|
+
$[74] = discard;
|
|
1666
|
+
$[75] = leave;
|
|
1667
|
+
$[76] = projectId;
|
|
1665
1668
|
$[77] = t30;
|
|
1666
1669
|
} else t30 = $[77];
|
|
1667
|
-
|
|
1670
|
+
let t31;
|
|
1671
|
+
if ($[78] !== t29 || $[79] !== t30) {
|
|
1672
|
+
t31 = /* @__PURE__ */ jsxs(Fragment, { children: [t29, t30] });
|
|
1673
|
+
$[78] = t29;
|
|
1674
|
+
$[79] = t30;
|
|
1675
|
+
$[80] = t31;
|
|
1676
|
+
} else t31 = $[80];
|
|
1677
|
+
return t31;
|
|
1668
1678
|
}
|
|
1669
|
-
/**
|
|
1679
|
+
/**
|
|
1680
|
+
* Asks before deleting the draft the studio is in, then deletes it. Deleting an unnamed draft
|
|
1681
|
+
* is discarding its changes: nobody kept them as a draft yet.
|
|
1682
|
+
*/
|
|
1670
1683
|
function DeleteDraftDialog(t0) {
|
|
1671
|
-
const $ = c(
|
|
1672
|
-
const { projectId, open, onOpenChange, onDeleted } = t0;
|
|
1673
|
-
|
|
1674
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1675
|
-
t1 = draftMutations.delete();
|
|
1676
|
-
$[0] = t1;
|
|
1677
|
-
} else t1 = $[0];
|
|
1684
|
+
const $ = c(36);
|
|
1685
|
+
const { projectId, open, discard: t1, onOpenChange, onDeleted } = t0;
|
|
1686
|
+
const discard = t1 === void 0 ? false : t1;
|
|
1678
1687
|
let t2;
|
|
1688
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1689
|
+
t2 = draftMutations.delete();
|
|
1690
|
+
$[0] = t2;
|
|
1691
|
+
} else t2 = $[0];
|
|
1692
|
+
let t3;
|
|
1679
1693
|
if ($[1] !== onDeleted || $[2] !== onOpenChange) {
|
|
1680
|
-
|
|
1681
|
-
...
|
|
1682
|
-
onSuccess: (
|
|
1683
|
-
const { ended } =
|
|
1694
|
+
t3 = {
|
|
1695
|
+
...t2,
|
|
1696
|
+
onSuccess: (t4) => {
|
|
1697
|
+
const { ended } = t4;
|
|
1684
1698
|
onOpenChange(false);
|
|
1685
1699
|
onDeleted(ended);
|
|
1686
1700
|
},
|
|
@@ -1688,84 +1702,109 @@ function DeleteDraftDialog(t0) {
|
|
|
1688
1702
|
};
|
|
1689
1703
|
$[1] = onDeleted;
|
|
1690
1704
|
$[2] = onOpenChange;
|
|
1691
|
-
$[3] =
|
|
1692
|
-
} else
|
|
1693
|
-
const deleteDraft = useMutation(
|
|
1694
|
-
let
|
|
1705
|
+
$[3] = t3;
|
|
1706
|
+
} else t3 = $[3];
|
|
1707
|
+
const deleteDraft = useMutation(t3);
|
|
1708
|
+
let t4;
|
|
1695
1709
|
if ($[4] !== deleteDraft.isPending || $[5] !== onOpenChange) {
|
|
1696
|
-
|
|
1710
|
+
t4 = (next) => {
|
|
1697
1711
|
if (!deleteDraft.isPending) onOpenChange(next);
|
|
1698
1712
|
};
|
|
1699
1713
|
$[4] = deleteDraft.isPending;
|
|
1700
1714
|
$[5] = onOpenChange;
|
|
1701
|
-
$[6] =
|
|
1702
|
-
} else
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1715
|
+
$[6] = t4;
|
|
1716
|
+
} else t4 = $[6];
|
|
1717
|
+
const t5 = discard ? "Discard these changes?" : "Delete this draft?";
|
|
1718
|
+
let t6;
|
|
1719
|
+
if ($[7] !== t5) {
|
|
1720
|
+
t6 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: t5 });
|
|
1721
|
+
$[7] = t5;
|
|
1722
|
+
$[8] = t6;
|
|
1723
|
+
} else t6 = $[8];
|
|
1724
|
+
const t7 = discard ? "These changes are" : "Every change in this draft is";
|
|
1725
|
+
let t8;
|
|
1726
|
+
if ($[9] !== t7) {
|
|
1727
|
+
t8 = /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [t7, " deleted for everyone. Live stays as it is. This can't be undone."] });
|
|
1728
|
+
$[9] = t7;
|
|
1729
|
+
$[10] = t8;
|
|
1730
|
+
} else t8 = $[10];
|
|
1731
|
+
let t9;
|
|
1732
|
+
if ($[11] !== t6 || $[12] !== t8) {
|
|
1733
|
+
t9 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t6, t8] });
|
|
1734
|
+
$[11] = t6;
|
|
1735
|
+
$[12] = t8;
|
|
1736
|
+
$[13] = t9;
|
|
1737
|
+
} else t9 = $[13];
|
|
1738
|
+
let t10;
|
|
1739
|
+
if ($[14] !== deleteDraft.isPending) {
|
|
1740
|
+
t10 = /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
1711
1741
|
variant: "outline",
|
|
1712
1742
|
size: "default",
|
|
1713
1743
|
disabled: deleteDraft.isPending,
|
|
1714
1744
|
children: "Cancel"
|
|
1715
1745
|
});
|
|
1716
|
-
$[
|
|
1717
|
-
$[
|
|
1718
|
-
} else
|
|
1719
|
-
let
|
|
1720
|
-
if ($[
|
|
1721
|
-
|
|
1722
|
-
$[
|
|
1723
|
-
$[
|
|
1724
|
-
$[
|
|
1725
|
-
} else
|
|
1726
|
-
let
|
|
1727
|
-
if ($[
|
|
1728
|
-
|
|
1729
|
-
$[
|
|
1730
|
-
$[
|
|
1731
|
-
} else
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1746
|
+
$[14] = deleteDraft.isPending;
|
|
1747
|
+
$[15] = t10;
|
|
1748
|
+
} else t10 = $[15];
|
|
1749
|
+
let t11;
|
|
1750
|
+
if ($[16] !== deleteDraft || $[17] !== projectId) {
|
|
1751
|
+
t11 = () => deleteDraft.mutate({ projectId });
|
|
1752
|
+
$[16] = deleteDraft;
|
|
1753
|
+
$[17] = projectId;
|
|
1754
|
+
$[18] = t11;
|
|
1755
|
+
} else t11 = $[18];
|
|
1756
|
+
let t12;
|
|
1757
|
+
if ($[19] !== deleteDraft.isPending) {
|
|
1758
|
+
t12 = deleteDraft.isPending ? /* @__PURE__ */ jsx(Spinner, {}) : null;
|
|
1759
|
+
$[19] = deleteDraft.isPending;
|
|
1760
|
+
$[20] = t12;
|
|
1761
|
+
} else t12 = $[20];
|
|
1762
|
+
const t13 = discard ? "Discard changes" : "Delete draft";
|
|
1763
|
+
let t14;
|
|
1764
|
+
if ($[21] !== deleteDraft.isPending || $[22] !== t11 || $[23] !== t12 || $[24] !== t13) {
|
|
1765
|
+
t14 = /* @__PURE__ */ jsxs(AlertDialogAction, {
|
|
1735
1766
|
variant: "destructive",
|
|
1736
1767
|
disabled: deleteDraft.isPending,
|
|
1737
|
-
onClick:
|
|
1738
|
-
children: [
|
|
1768
|
+
onClick: t11,
|
|
1769
|
+
children: [t12, t13]
|
|
1739
1770
|
});
|
|
1740
|
-
$[
|
|
1741
|
-
$[
|
|
1742
|
-
$[
|
|
1743
|
-
$[
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
$[
|
|
1750
|
-
$[
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1771
|
+
$[21] = deleteDraft.isPending;
|
|
1772
|
+
$[22] = t11;
|
|
1773
|
+
$[23] = t12;
|
|
1774
|
+
$[24] = t13;
|
|
1775
|
+
$[25] = t14;
|
|
1776
|
+
} else t14 = $[25];
|
|
1777
|
+
let t15;
|
|
1778
|
+
if ($[26] !== t10 || $[27] !== t14) {
|
|
1779
|
+
t15 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t10, t14] });
|
|
1780
|
+
$[26] = t10;
|
|
1781
|
+
$[27] = t14;
|
|
1782
|
+
$[28] = t15;
|
|
1783
|
+
} else t15 = $[28];
|
|
1784
|
+
let t16;
|
|
1785
|
+
if ($[29] !== t15 || $[30] !== t9) {
|
|
1786
|
+
t16 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t9, t15] });
|
|
1787
|
+
$[29] = t15;
|
|
1788
|
+
$[30] = t9;
|
|
1789
|
+
$[31] = t16;
|
|
1790
|
+
} else t16 = $[31];
|
|
1791
|
+
let t17;
|
|
1792
|
+
if ($[32] !== open || $[33] !== t16 || $[34] !== t4) {
|
|
1793
|
+
t17 = /* @__PURE__ */ jsx(AlertDialog, {
|
|
1755
1794
|
open,
|
|
1756
|
-
onOpenChange:
|
|
1757
|
-
children:
|
|
1795
|
+
onOpenChange: t4,
|
|
1796
|
+
children: t16
|
|
1758
1797
|
});
|
|
1759
|
-
$[
|
|
1760
|
-
$[
|
|
1761
|
-
$[
|
|
1762
|
-
$[
|
|
1763
|
-
} else
|
|
1764
|
-
return
|
|
1798
|
+
$[32] = open;
|
|
1799
|
+
$[33] = t16;
|
|
1800
|
+
$[34] = t4;
|
|
1801
|
+
$[35] = t17;
|
|
1802
|
+
} else t17 = $[35];
|
|
1803
|
+
return t17;
|
|
1765
1804
|
}
|
|
1766
1805
|
function _temp14(error) {
|
|
1767
1806
|
return toast.error(error.message || "Could not delete the draft");
|
|
1768
1807
|
}
|
|
1769
1808
|
|
|
1770
1809
|
//#endregion
|
|
1771
|
-
export { DeleteDraftDialog, ReviewDraftSheet, useLeaveDraft };
|
|
1810
|
+
export { DeleteDraftDialog, ReviewDraftSheet, useLeaveDraft, useRenameDraft };
|
|
@@ -195,15 +195,6 @@ const LOOKS = {
|
|
|
195
195
|
x: [40, 59],
|
|
196
196
|
y: 32
|
|
197
197
|
}
|
|
198
|
-
},
|
|
199
|
-
proofreader: {
|
|
200
|
-
body: "M20 10H64L88 34V82Q88 90 80 90H20Q12 90 12 82V18Q12 10 20 10Z",
|
|
201
|
-
middle: 50,
|
|
202
|
-
fill: "fill-rose-500",
|
|
203
|
-
eyes: {
|
|
204
|
-
x: [34, 53],
|
|
205
|
-
y: 38
|
|
206
|
-
}
|
|
207
198
|
}
|
|
208
199
|
};
|
|
209
200
|
const EYE_WIDTH = 11;
|