camox 0.74.1 → 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/core/lib/artifactRuntime.js +4 -2
  2. package/dist/features/provider/AuthenticatedCamoxProvider.js +75 -63
  3. package/dist/features/renderer/RendererFrames.js +47 -41
  4. package/dist/features/routes/pageRuntime.d.ts +6 -4
  5. package/dist/features/routes/pageRuntime.js +5 -1
  6. package/dist/features/studio/components/ChatWidget.js +137 -121
  7. package/dist/features/studio/components/ClearThread.js +121 -0
  8. package/dist/features/studio/components/DeleteDraftDialog.js +67 -65
  9. package/dist/features/studio/components/DraftBar.js +60 -49
  10. package/dist/features/studio/components/DraftNotices.js +149 -0
  11. package/dist/features/studio/components/DraftsControl.js +217 -180
  12. package/dist/features/studio/components/DraftsSheet.js +387 -0
  13. package/dist/features/studio/components/PublishedTab.js +511 -0
  14. package/dist/features/studio/components/ReviewDraftDialog.js +104 -89
  15. package/dist/features/studio/components/SheetTable.js +46 -0
  16. package/dist/features/studio/components/Specialists.js +1 -1
  17. package/dist/features/studio/components/ThreadMessages.js +376 -171
  18. package/dist/features/studio/draftLabel.js +15 -1
  19. package/dist/features/studio/draftNotice.js +1 -0
  20. package/dist/features/studio/studioStore.js +5 -5
  21. package/dist/features/studio/useArchiveDraft.js +60 -0
  22. package/dist/features/studio/useRestoreDraft.js +70 -0
  23. package/dist/features/studio/viewSwitch.js +19 -11
  24. package/dist/lib/draft-scope.d.ts +1 -1
  25. package/dist/lib/draft-scope.js +6 -3
  26. package/dist/lib/queries.js +12 -1
  27. package/dist/lib/studio-reads.js +22 -0
  28. package/dist/lib/use-project-room.js +19 -13
  29. package/dist/lib/use-thread.js +1 -1
  30. package/dist/package.js +1 -1
  31. package/dist/studio.css +1 -1
  32. package/package.json +4 -4
@@ -5,18 +5,19 @@ import { AuthContext } from "../../../lib/auth.js";
5
5
  import { reads, useReadQuery } from "../../../lib/studio-reads.js";
6
6
  import { cn } from "../../../lib/utils.js";
7
7
  import { studioStore } from "../studioStore.js";
8
+ import { useSwitchView } from "../viewSwitch.js";
8
9
  import { draftLabel, plural, timeAgo } from "../draftLabel.js";
9
- import { useLeaveDraft, useSwitchView } from "../viewSwitch.js";
10
- import { DeleteDraftDialog } from "./DeleteDraftDialog.js";
10
+ import { useArchiveDraft } from "../useArchiveDraft.js";
11
+ import { DraftsSheet } from "./DraftsSheet.js";
11
12
  import { ReviewDraftDialog } from "./ReviewDraftDialog.js";
12
13
  import { c } from "react/compiler-runtime";
13
14
  import * as React from "react";
14
15
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
16
  import { useSelector } from "@xstate/store-react";
16
17
  import { Button } from "@camox/ui/button";
17
- import { ChevronsUpDown } from "lucide-react";
18
+ import { Archive, ChevronsUpDown } from "lucide-react";
18
19
  import { toast } from "@camox/ui/toaster";
19
- import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
20
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
20
21
 
21
22
  //#region src/features/studio/components/DraftsControl.tsx
22
23
  const LIVE = "live";
@@ -95,17 +96,17 @@ function useDrafts() {
95
96
  /**
96
97
  * Picks what the studio is viewing, Live or a draft (#203). Live is read-only; the first edit
97
98
  * starts a draft. The command palette offers the same actions,
98
- * and the picker hosts the draft's review and delete confirmation they open. A `disabled` picker
99
- * still names what the studio is viewing.
99
+ * and the picker hosts the draft's review they open, and the sheet of archived drafts it opens
100
+ * itself. A `disabled` picker still names what the studio is viewing.
100
101
  */
101
102
  function DraftPicker(t0) {
102
- const $ = c(69);
103
+ const $ = c(74);
103
104
  const { disabled: t1 } = t0;
104
105
  const disabled = t1 === void 0 ? false : t1;
105
106
  const { draftScope, draftId, projectId, list, current } = useDrafts();
106
107
  const navigate = useNavigate();
107
- const leaveDraft = useLeaveDraft();
108
108
  const switchView = useSwitchView();
109
+ const { archive } = useArchiveDraft(projectId);
109
110
  const reviewing = useSelector(studioStore, _temp);
110
111
  let t2;
111
112
  if ($[0] !== draftId) {
@@ -114,7 +115,7 @@ function DraftPicker(t0) {
114
115
  $[1] = t2;
115
116
  } else t2 = $[1];
116
117
  const working = useSelector(studioStore, t2);
117
- const deleting = useSelector(studioStore, _temp2);
118
+ const sheetOpen = useSelector(studioStore, _temp2);
118
119
  let t3;
119
120
  let t4;
120
121
  if ($[2] !== draftScope) {
@@ -165,218 +166,254 @@ function DraftPicker(t0) {
165
166
  } else t7 = $[13];
166
167
  const switchTo = t7;
167
168
  const t8 = !!projectId;
168
- let t9;
169
- if ($[14] !== draftId || $[15] !== drafts || $[16] !== switchTo || $[17] !== t8 || $[18] !== working) {
170
- t9 = {
169
+ const t9 = current && !current.catchUp ? archive : void 0;
170
+ let t10;
171
+ if ($[14] !== draftId || $[15] !== drafts || $[16] !== switchTo || $[17] !== t8 || $[18] !== t9 || $[19] !== working) {
172
+ t10 = {
171
173
  enabled: t8,
172
174
  draftId,
173
175
  drafts,
174
176
  switchTo,
175
- working
177
+ working,
178
+ archive: t9
176
179
  };
177
180
  $[14] = draftId;
178
181
  $[15] = drafts;
179
182
  $[16] = switchTo;
180
183
  $[17] = t8;
181
- $[18] = working;
182
- $[19] = t9;
183
- } else t9 = $[19];
184
- useDraftsActions(t9);
184
+ $[18] = t9;
185
+ $[19] = working;
186
+ $[20] = t10;
187
+ } else t10 = $[20];
188
+ useDraftsActions(t10);
185
189
  if (draftId && !current) return null;
186
- let t10;
187
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
188
- t10 = /* @__PURE__ */ jsx(Button, {
190
+ let t11;
191
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
192
+ t11 = /* @__PURE__ */ jsx(Button, {
189
193
  type: "button",
190
194
  variant: "ghost"
191
195
  });
192
- $[20] = t10;
193
- } else t10 = $[20];
194
- const t11 = draftId ? "bg-blue-500" : "bg-emerald-500";
195
- let t12;
196
- if ($[21] !== t11) {
197
- t12 = cn("size-2 shrink-0 rounded-full", t11);
198
196
  $[21] = t11;
199
- $[22] = t12;
200
- } else t12 = $[22];
197
+ } else t11 = $[21];
198
+ const t12 = draftId ? "bg-blue-500" : "bg-emerald-500";
201
199
  let t13;
202
- if ($[23] !== t12) {
203
- t13 = /* @__PURE__ */ jsx("span", {
200
+ if ($[22] !== t12) {
201
+ t13 = cn("size-2 shrink-0 rounded-full", t12);
202
+ $[22] = t12;
203
+ $[23] = t13;
204
+ } else t13 = $[23];
205
+ let t14;
206
+ if ($[24] !== t13) {
207
+ t14 = /* @__PURE__ */ jsx("span", {
204
208
  "aria-hidden": true,
205
- className: t12
209
+ className: t13
206
210
  });
207
- $[23] = t12;
208
211
  $[24] = t13;
209
- } else t13 = $[24];
210
- let t14;
211
- if ($[25] !== current || $[26] !== draftId) {
212
- t14 = draftId ? draftLabel(current) : "Live";
213
- $[25] = current;
214
- $[26] = draftId;
215
- $[27] = t14;
216
- } else t14 = $[27];
212
+ $[25] = t14;
213
+ } else t14 = $[25];
217
214
  let t15;
218
- if ($[28] !== t14) {
219
- t15 = /* @__PURE__ */ jsx("span", {
215
+ if ($[26] !== current || $[27] !== draftId) {
216
+ t15 = draftId ? draftLabel(current) : "Live";
217
+ $[26] = current;
218
+ $[27] = draftId;
219
+ $[28] = t15;
220
+ } else t15 = $[28];
221
+ let t16;
222
+ if ($[29] !== t15) {
223
+ t16 = /* @__PURE__ */ jsx("span", {
220
224
  className: "max-w-48 truncate",
221
- children: t14
225
+ children: t15
222
226
  });
223
- $[28] = t14;
224
227
  $[29] = t15;
225
- } else t15 = $[29];
226
- let t16;
227
- if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
228
- t16 = /* @__PURE__ */ jsx(ChevronsUpDown, {
229
- "aria-hidden": true,
230
- className: "size-4 opacity-50"
231
- });
232
228
  $[30] = t16;
233
229
  } else t16 = $[30];
234
230
  let t17;
235
- if ($[31] !== disabled || $[32] !== t13 || $[33] !== t15) {
236
- t17 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
231
+ if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
232
+ t17 = /* @__PURE__ */ jsx(ChevronsUpDown, {
233
+ "aria-hidden": true,
234
+ className: "size-4 opacity-50"
235
+ });
236
+ $[31] = t17;
237
+ } else t17 = $[31];
238
+ let t18;
239
+ if ($[32] !== disabled || $[33] !== t14 || $[34] !== t16) {
240
+ t18 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
237
241
  disabled,
238
- render: t10,
242
+ render: t11,
239
243
  children: [
240
- t13,
241
- t15,
242
- t16
244
+ t14,
245
+ t16,
246
+ t17
243
247
  ]
244
248
  });
245
- $[31] = disabled;
246
- $[32] = t13;
247
- $[33] = t15;
248
- $[34] = t17;
249
- } else t17 = $[34];
250
- let t18;
251
- if ($[35] !== draftId) {
252
- t18 = !draftId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
249
+ $[32] = disabled;
250
+ $[33] = t14;
251
+ $[34] = t16;
252
+ $[35] = t18;
253
+ } else t18 = $[35];
254
+ let t19;
255
+ if ($[36] !== draftId) {
256
+ t19 = !draftId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
253
257
  className: "text-muted-foreground font-normal",
254
258
  children: "Live is read-only. Your first edit starts a new draft."
255
259
  }) }), /* @__PURE__ */ jsx(DropdownMenuSeparator, {})] });
256
- $[35] = draftId;
257
- $[36] = t18;
258
- } else t18 = $[36];
259
- const t19 = draftId ?? LIVE;
260
- let t20;
261
- if ($[37] !== switchTo) {
262
- t20 = (value) => switchTo(value === LIVE ? null : String(value));
263
- $[37] = switchTo;
264
- $[38] = t20;
265
- } else t20 = $[38];
260
+ $[36] = draftId;
261
+ $[37] = t19;
262
+ } else t19 = $[37];
263
+ const t20 = draftId ?? LIVE;
266
264
  let t21;
267
- if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
268
- t21 = /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Switch to" });
265
+ if ($[38] !== switchTo) {
266
+ t21 = (value) => switchTo(value === LIVE ? null : String(value));
267
+ $[38] = switchTo;
269
268
  $[39] = t21;
270
269
  } else t21 = $[39];
271
270
  let t22;
272
271
  if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
273
- t22 = /* @__PURE__ */ jsx("span", { children: "Live" });
272
+ t22 = /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Switch to" });
274
273
  $[40] = t22;
275
274
  } else t22 = $[40];
276
275
  let t23;
277
- if ($[41] !== list) {
278
- t23 = list && /* @__PURE__ */ jsx("span", {
276
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
277
+ t23 = /* @__PURE__ */ jsx("span", { children: "Live" });
278
+ $[41] = t23;
279
+ } else t23 = $[41];
280
+ let t24;
281
+ if ($[42] !== list) {
282
+ t24 = list && /* @__PURE__ */ jsx("span", {
279
283
  className: "text-muted-foreground text-xs",
280
284
  children: liveLine(list.live)
281
285
  });
282
- $[41] = list;
283
- $[42] = t23;
284
- } else t23 = $[42];
285
- let t24;
286
- if ($[43] !== t23) {
287
- t24 = /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
286
+ $[42] = list;
287
+ $[43] = t24;
288
+ } else t24 = $[43];
289
+ let t25;
290
+ if ($[44] !== t24) {
291
+ t25 = /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
288
292
  value: LIVE,
289
293
  closeOnClick: true,
290
294
  children: /* @__PURE__ */ jsxs("div", {
291
295
  className: "flex flex-col",
292
- children: [t22, t23]
296
+ children: [t23, t24]
293
297
  })
294
298
  });
295
- $[43] = t23;
296
299
  $[44] = t24;
297
- } else t24 = $[44];
298
- let t25;
299
- if ($[45] !== drafts) {
300
- t25 = drafts.map(_temp6);
301
- $[45] = drafts;
302
- $[46] = t25;
303
- } else t25 = $[46];
300
+ $[45] = t25;
301
+ } else t25 = $[45];
304
302
  let t26;
305
- if ($[47] !== t24 || $[48] !== t25) {
306
- t26 = /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
307
- t21,
308
- t24,
309
- t25
303
+ if ($[46] !== drafts) {
304
+ t26 = drafts.map(_temp6);
305
+ $[46] = drafts;
306
+ $[47] = t26;
307
+ } else t26 = $[47];
308
+ let t27;
309
+ if ($[48] !== t25 || $[49] !== t26) {
310
+ t27 = /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
311
+ t22,
312
+ t25,
313
+ t26
310
314
  ] });
311
- $[47] = t24;
312
315
  $[48] = t25;
313
316
  $[49] = t26;
314
- } else t26 = $[49];
315
- let t27;
316
- if ($[50] !== t19 || $[51] !== t20 || $[52] !== t26) {
317
- t27 = /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
318
- value: t19,
319
- onValueChange: t20,
320
- children: t26
317
+ $[50] = t27;
318
+ } else t27 = $[50];
319
+ let t28;
320
+ if ($[51] !== t20 || $[52] !== t21 || $[53] !== t27) {
321
+ t28 = /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
322
+ value: t20,
323
+ onValueChange: t21,
324
+ children: t27
321
325
  });
322
- $[50] = t19;
323
326
  $[51] = t20;
324
- $[52] = t26;
327
+ $[52] = t21;
325
328
  $[53] = t27;
326
- } else t27 = $[53];
327
- let t28;
328
- if ($[54] !== t18 || $[55] !== t27) {
329
- t28 = /* @__PURE__ */ jsx(DropdownMenuContent, {
329
+ $[54] = t28;
330
+ } else t28 = $[54];
331
+ let t29;
332
+ if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
333
+ t29 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
334
+ $[55] = t29;
335
+ } else t29 = $[55];
336
+ let t30;
337
+ if ($[56] === Symbol.for("react.memo_cache_sentinel")) {
338
+ t30 = /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
339
+ onClick: _temp7,
340
+ children: [/* @__PURE__ */ jsx(Archive, {
341
+ "aria-hidden": true,
342
+ className: "size-4"
343
+ }), "Archived and published…"]
344
+ }) });
345
+ $[56] = t30;
346
+ } else t30 = $[56];
347
+ let t31;
348
+ if ($[57] !== t19 || $[58] !== t28) {
349
+ t31 = /* @__PURE__ */ jsx(DropdownMenuContent, {
330
350
  className: "w-80",
331
351
  align: "start",
332
- children: /* @__PURE__ */ jsxs(Fragment, { children: [t18, t27] })
352
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
353
+ t19,
354
+ t28,
355
+ t29,
356
+ t30
357
+ ] })
333
358
  });
334
- $[54] = t18;
335
- $[55] = t27;
336
- $[56] = t28;
337
- } else t28 = $[56];
338
- let t29;
339
- if ($[57] !== t17 || $[58] !== t28) {
340
- t29 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t17, t28] });
341
- $[57] = t17;
359
+ $[57] = t19;
342
360
  $[58] = t28;
343
- $[59] = t29;
344
- } else t29 = $[59];
345
- let t30;
346
- if ($[60] !== deleting || $[61] !== draftId || $[62] !== leaveDraft || $[63] !== projectId || $[64] !== reviewing) {
347
- t30 = draftId && projectId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ReviewDraftDialog, {
361
+ $[59] = t31;
362
+ } else t31 = $[59];
363
+ let t32;
364
+ if ($[60] !== t18 || $[61] !== t31) {
365
+ t32 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t18, t31] });
366
+ $[60] = t18;
367
+ $[61] = t31;
368
+ $[62] = t32;
369
+ } else t32 = $[62];
370
+ let t33;
371
+ if ($[63] !== draftId || $[64] !== projectId || $[65] !== reviewing) {
372
+ t33 = draftId && projectId && /* @__PURE__ */ jsx(ReviewDraftDialog, {
348
373
  projectId,
349
374
  draftId,
350
375
  open: reviewing,
351
- onOpenChange: _temp7
352
- }), /* @__PURE__ */ jsx(DeleteDraftDialog, {
376
+ onOpenChange: _temp8
377
+ });
378
+ $[63] = draftId;
379
+ $[64] = projectId;
380
+ $[65] = reviewing;
381
+ $[66] = t33;
382
+ } else t33 = $[66];
383
+ let t34;
384
+ if ($[67] !== projectId || $[68] !== sheetOpen) {
385
+ t34 = projectId && /* @__PURE__ */ jsx(DraftsSheet, {
353
386
  projectId,
354
- open: deleting,
355
- onOpenChange: _temp8,
356
- onDeleted: leaveDraft
357
- })] });
358
- $[60] = deleting;
359
- $[61] = draftId;
360
- $[62] = leaveDraft;
361
- $[63] = projectId;
362
- $[64] = reviewing;
363
- $[65] = t30;
364
- } else t30 = $[65];
365
- let t31;
366
- if ($[66] !== t29 || $[67] !== t30) {
367
- t31 = /* @__PURE__ */ jsxs(Fragment, { children: [t29, t30] });
368
- $[66] = t29;
369
- $[67] = t30;
370
- $[68] = t31;
371
- } else t31 = $[68];
372
- return t31;
387
+ open: sheetOpen,
388
+ onOpenChange: _temp9
389
+ });
390
+ $[67] = projectId;
391
+ $[68] = sheetOpen;
392
+ $[69] = t34;
393
+ } else t34 = $[69];
394
+ let t35;
395
+ if ($[70] !== t32 || $[71] !== t33 || $[72] !== t34) {
396
+ t35 = /* @__PURE__ */ jsxs(Fragment, { children: [
397
+ t32,
398
+ t33,
399
+ t34
400
+ ] });
401
+ $[70] = t32;
402
+ $[71] = t33;
403
+ $[72] = t34;
404
+ $[73] = t35;
405
+ } else t35 = $[73];
406
+ return t35;
373
407
  }
374
- function _temp8(open_0) {
375
- if (!open_0) studioStore.send({ type: "closeDeleteDraftDialog" });
408
+ function _temp9(open_0) {
409
+ if (!open_0) studioStore.send({ type: "closeDraftsSheet" });
376
410
  }
377
- function _temp7(open) {
411
+ function _temp8(open) {
378
412
  if (!open) studioStore.send({ type: "closeReviewDraftDialog" });
379
413
  }
414
+ function _temp7() {
415
+ return studioStore.send({ type: "openDraftsSheet" });
416
+ }
380
417
  function _temp6(draft_0) {
381
418
  return /* @__PURE__ */ jsx(DraftItem, { draft: draft_0 }, draft_0.id);
382
419
  }
@@ -384,30 +421,30 @@ function _temp5() {
384
421
  return _temp4;
385
422
  }
386
423
  function _temp4() {
387
- studioStore.send({ type: "closeReviewDraftDialog" });
388
- studioStore.send({ type: "closeDeleteDraftDialog" });
424
+ return studioStore.send({ type: "closeReviewDraftDialog" });
389
425
  }
390
426
  function _temp3(t0) {
391
427
  const { move } = t0;
392
428
  if (move === "started") toast.success("Started a new draft");
393
429
  }
394
430
  function _temp2(state_1) {
395
- return state_1.context.isDeleteDraftDialogOpen;
431
+ return state_1.context.isDraftsSheetOpen;
396
432
  }
397
433
  function _temp(state) {
398
434
  return state.context.isReviewDraftDialogOpen;
399
435
  }
400
436
  /**
401
- * The drafts controls' actions in the command palette, offered where the controls offer them. The palette only opens the review and the delete confirmation; it never publishes or
402
- * deletes by itself. Like the Publish… button, it doesn't offer the review while Camox's agent is
403
- * mid-turn in the draft (`working`).
437
+ * The drafts controls' actions in the command palette, offered where the controls offer them. The
438
+ * palette opens the review, never publishing by itself, and archives the draft as its bar does,
439
+ * except Camox's Catch-up Draft. Like the Publish… button, it doesn't offer the review while
440
+ * Camox's agent is mid-turn in the draft (`working`).
404
441
  */
405
442
  function useDraftsActions(t0) {
406
- const $ = c(7);
407
- const { enabled, draftId, drafts, switchTo, working } = t0;
443
+ const $ = c(8);
444
+ const { enabled, draftId, drafts, switchTo, working, archive } = t0;
408
445
  let t1;
409
446
  let t2;
410
- if ($[0] !== draftId || $[1] !== drafts || $[2] !== enabled || $[3] !== switchTo || $[4] !== working) {
447
+ if ($[0] !== archive || $[1] !== draftId || $[2] !== drafts || $[3] !== enabled || $[4] !== switchTo || $[5] !== working) {
411
448
  t1 = () => {
412
449
  const inDraft = enabled && !!draftId;
413
450
  const others = drafts.filter((listed) => listed.id !== draftId);
@@ -424,19 +461,20 @@ function useDraftsActions(t0) {
424
461
  ],
425
462
  groupLabel: "Drafts",
426
463
  checkIfAvailable: () => inDraft && !working,
427
- execute: _temp9
464
+ execute: _temp10
428
465
  },
429
466
  {
430
- id: "delete-draft",
431
- label: "Delete draft…",
467
+ id: "archive-draft",
468
+ label: "Archive draft",
432
469
  aliases: [
470
+ "Delete draft",
433
471
  "Discard changes",
434
472
  "Throw away changes",
435
- "Revert changes"
473
+ "Set aside"
436
474
  ],
437
475
  groupLabel: "Drafts",
438
- checkIfAvailable: () => inDraft,
439
- execute: _temp10
476
+ checkIfAvailable: () => inDraft && !!archive,
477
+ execute: () => archive?.()
440
478
  },
441
479
  {
442
480
  id: "switch-to-live",
@@ -490,18 +528,20 @@ function useDraftsActions(t0) {
490
528
  draftId,
491
529
  drafts,
492
530
  switchTo,
493
- working
531
+ working,
532
+ archive
494
533
  ];
495
- $[0] = draftId;
496
- $[1] = drafts;
497
- $[2] = enabled;
498
- $[3] = switchTo;
499
- $[4] = working;
500
- $[5] = t1;
501
- $[6] = t2;
534
+ $[0] = archive;
535
+ $[1] = draftId;
536
+ $[2] = drafts;
537
+ $[3] = enabled;
538
+ $[4] = switchTo;
539
+ $[5] = working;
540
+ $[6] = t1;
541
+ $[7] = t2;
502
542
  } else {
503
- t1 = $[5];
504
- t2 = $[6];
543
+ t1 = $[6];
544
+ t2 = $[7];
505
545
  }
506
546
  React.useEffect(t1, t2);
507
547
  }
@@ -513,9 +553,6 @@ function _temp12() {
513
553
  }
514
554
  function _temp11() {}
515
555
  function _temp10() {
516
- return studioStore.send({ type: "openDeleteDraftDialog" });
517
- }
518
- function _temp9() {
519
556
  return studioStore.send({ type: "openReviewDraftDialog" });
520
557
  }
521
558
  /** Who published Live last and when: a member, a release, or nobody yet. */