camox 0.69.0 → 0.71.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.
@@ -98,14 +98,14 @@ function useDrafts() {
98
98
  * still names what the studio is viewing.
99
99
  */
100
100
  function DraftPicker(t0) {
101
- const $ = c(68);
101
+ const $ = c(66);
102
102
  const { disabled: t1 } = t0;
103
103
  const disabled = t1 === void 0 ? false : t1;
104
104
  const { draftScope, draftId, projectId, list, current } = useDrafts();
105
105
  const navigate = useNavigate();
106
106
  const leaveDraft = useLeaveDraft();
107
107
  const switchView = useSwitchView();
108
- const review = useSelector(studioStore, _temp);
108
+ const reviewing = useSelector(studioStore, _temp);
109
109
  const deleting = useSelector(studioStore, _temp2);
110
110
  let t2;
111
111
  let t3;
@@ -157,13 +157,11 @@ function DraftPicker(t0) {
157
157
  } else t6 = $[11];
158
158
  const switchTo = t6;
159
159
  const t7 = !!projectId;
160
- const t8 = current?.name === null;
161
- let t9;
162
- if ($[12] !== draftId || $[13] !== drafts || $[14] !== switchTo || $[15] !== t7 || $[16] !== t8) {
163
- t9 = {
160
+ let t8;
161
+ if ($[12] !== draftId || $[13] !== drafts || $[14] !== switchTo || $[15] !== t7) {
162
+ t8 = {
164
163
  enabled: t7,
165
164
  draftId,
166
- unnamed: t8,
167
165
  drafts,
168
166
  switchTo
169
167
  };
@@ -172,200 +170,196 @@ function DraftPicker(t0) {
172
170
  $[14] = switchTo;
173
171
  $[15] = t7;
174
172
  $[16] = t8;
175
- $[17] = t9;
176
- } else t9 = $[17];
177
- useDraftsActions(t9);
173
+ } else t8 = $[16];
174
+ useDraftsActions(t8);
178
175
  if (draftId && !current) return null;
179
- let t10;
180
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
181
- t10 = /* @__PURE__ */ jsx(Button, {
176
+ let t9;
177
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
178
+ t9 = /* @__PURE__ */ jsx(Button, {
182
179
  type: "button",
183
180
  variant: "ghost"
184
181
  });
182
+ $[17] = t9;
183
+ } else t9 = $[17];
184
+ const t10 = draftId ? "bg-blue-500" : "bg-emerald-500";
185
+ let t11;
186
+ if ($[18] !== t10) {
187
+ t11 = cn("size-2 shrink-0 rounded-full", t10);
185
188
  $[18] = t10;
186
- } else t10 = $[18];
187
- const t11 = draftId ? "bg-blue-500" : "bg-emerald-500";
188
- let t12;
189
- if ($[19] !== t11) {
190
- t12 = cn("size-2 shrink-0 rounded-full", t11);
191
189
  $[19] = t11;
192
- $[20] = t12;
193
- } else t12 = $[20];
194
- let t13;
195
- if ($[21] !== t12) {
196
- t13 = /* @__PURE__ */ jsx("span", {
190
+ } else t11 = $[19];
191
+ let t12;
192
+ if ($[20] !== t11) {
193
+ t12 = /* @__PURE__ */ jsx("span", {
197
194
  "aria-hidden": true,
198
- className: t12
195
+ className: t11
199
196
  });
197
+ $[20] = t11;
200
198
  $[21] = t12;
201
- $[22] = t13;
202
- } else t13 = $[22];
199
+ } else t12 = $[21];
200
+ let t13;
201
+ if ($[22] !== current || $[23] !== draftId) {
202
+ t13 = draftId ? draftLabel(current) : "Live";
203
+ $[22] = current;
204
+ $[23] = draftId;
205
+ $[24] = t13;
206
+ } else t13 = $[24];
203
207
  let t14;
204
- if ($[23] !== current || $[24] !== draftId) {
205
- t14 = draftId ? draftLabel(current) : "Live";
206
- $[23] = current;
207
- $[24] = draftId;
208
- $[25] = t14;
209
- } else t14 = $[25];
210
- let t15;
211
- if ($[26] !== t14) {
212
- t15 = /* @__PURE__ */ jsx("span", {
208
+ if ($[25] !== t13) {
209
+ t14 = /* @__PURE__ */ jsx("span", {
213
210
  className: "max-w-48 truncate",
214
- children: t14
211
+ children: t13
215
212
  });
213
+ $[25] = t13;
216
214
  $[26] = t14;
217
- $[27] = t15;
218
- } else t15 = $[27];
219
- let t16;
220
- if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
221
- t16 = /* @__PURE__ */ jsx(ChevronsUpDown, {
215
+ } else t14 = $[26];
216
+ let t15;
217
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
218
+ t15 = /* @__PURE__ */ jsx(ChevronsUpDown, {
222
219
  "aria-hidden": true,
223
220
  className: "size-4 opacity-50"
224
221
  });
225
- $[28] = t16;
226
- } else t16 = $[28];
227
- let t17;
228
- if ($[29] !== disabled || $[30] !== t13 || $[31] !== t15) {
229
- t17 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
222
+ $[27] = t15;
223
+ } else t15 = $[27];
224
+ let t16;
225
+ if ($[28] !== disabled || $[29] !== t12 || $[30] !== t14) {
226
+ t16 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
230
227
  disabled,
231
- render: t10,
228
+ render: t9,
232
229
  children: [
233
- t13,
234
- t15,
235
- t16
230
+ t12,
231
+ t14,
232
+ t15
236
233
  ]
237
234
  });
238
- $[29] = disabled;
239
- $[30] = t13;
240
- $[31] = t15;
241
- $[32] = t17;
242
- } else t17 = $[32];
243
- let t18;
244
- if ($[33] !== draftId) {
245
- t18 = !draftId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
235
+ $[28] = disabled;
236
+ $[29] = t12;
237
+ $[30] = t14;
238
+ $[31] = t16;
239
+ } else t16 = $[31];
240
+ let t17;
241
+ if ($[32] !== draftId) {
242
+ t17 = !draftId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
246
243
  className: "text-muted-foreground font-normal",
247
244
  children: "Live is read-only. Your first edit starts a new draft."
248
245
  }) }), /* @__PURE__ */ jsx(DropdownMenuSeparator, {})] });
249
- $[33] = draftId;
250
- $[34] = t18;
251
- } else t18 = $[34];
252
- const t19 = draftId ?? LIVE;
246
+ $[32] = draftId;
247
+ $[33] = t17;
248
+ } else t17 = $[33];
249
+ const t18 = draftId ?? LIVE;
250
+ let t19;
251
+ if ($[34] !== switchTo) {
252
+ t19 = (value) => switchTo(value === LIVE ? null : String(value));
253
+ $[34] = switchTo;
254
+ $[35] = t19;
255
+ } else t19 = $[35];
253
256
  let t20;
254
- if ($[35] !== switchTo) {
255
- t20 = (value) => switchTo(value === LIVE ? null : String(value));
256
- $[35] = switchTo;
257
+ if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
258
+ t20 = /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Switch to" });
257
259
  $[36] = t20;
258
260
  } else t20 = $[36];
259
261
  let t21;
260
262
  if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
261
- t21 = /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Switch to" });
263
+ t21 = /* @__PURE__ */ jsx("span", { children: "Live" });
262
264
  $[37] = t21;
263
265
  } else t21 = $[37];
264
266
  let t22;
265
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
266
- t22 = /* @__PURE__ */ jsx("span", { children: "Live" });
267
- $[38] = t22;
268
- } else t22 = $[38];
269
- let t23;
270
- if ($[39] !== list) {
271
- t23 = list && /* @__PURE__ */ jsx("span", {
267
+ if ($[38] !== list) {
268
+ t22 = list && /* @__PURE__ */ jsx("span", {
272
269
  className: "text-muted-foreground text-xs",
273
270
  children: liveLine(list.live)
274
271
  });
275
- $[39] = list;
276
- $[40] = t23;
277
- } else t23 = $[40];
278
- let t24;
279
- if ($[41] !== t23) {
280
- t24 = /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
272
+ $[38] = list;
273
+ $[39] = t22;
274
+ } else t22 = $[39];
275
+ let t23;
276
+ if ($[40] !== t22) {
277
+ t23 = /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
281
278
  value: LIVE,
282
279
  closeOnClick: true,
283
280
  children: /* @__PURE__ */ jsxs("div", {
284
281
  className: "flex flex-col",
285
- children: [t22, t23]
282
+ children: [t21, t22]
286
283
  })
287
284
  });
285
+ $[40] = t22;
288
286
  $[41] = t23;
289
- $[42] = t24;
290
- } else t24 = $[42];
287
+ } else t23 = $[41];
288
+ let t24;
289
+ if ($[42] !== drafts) {
290
+ t24 = drafts.map(_temp6);
291
+ $[42] = drafts;
292
+ $[43] = t24;
293
+ } else t24 = $[43];
291
294
  let t25;
292
- if ($[43] !== drafts) {
293
- t25 = drafts.map(_temp6);
294
- $[43] = drafts;
295
- $[44] = t25;
296
- } else t25 = $[44];
297
- let t26;
298
- if ($[45] !== t24 || $[46] !== t25) {
299
- t26 = /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
300
- t21,
301
- t24,
302
- t25
295
+ if ($[44] !== t23 || $[45] !== t24) {
296
+ t25 = /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
297
+ t20,
298
+ t23,
299
+ t24
303
300
  ] });
301
+ $[44] = t23;
304
302
  $[45] = t24;
305
303
  $[46] = t25;
306
- $[47] = t26;
307
- } else t26 = $[47];
308
- let t27;
309
- if ($[48] !== t19 || $[49] !== t20 || $[50] !== t26) {
310
- t27 = /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
311
- value: t19,
312
- onValueChange: t20,
313
- children: t26
304
+ } else t25 = $[46];
305
+ let t26;
306
+ if ($[47] !== t18 || $[48] !== t19 || $[49] !== t25) {
307
+ t26 = /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
308
+ value: t18,
309
+ onValueChange: t19,
310
+ children: t25
314
311
  });
312
+ $[47] = t18;
315
313
  $[48] = t19;
316
- $[49] = t20;
314
+ $[49] = t25;
317
315
  $[50] = t26;
318
- $[51] = t27;
319
- } else t27 = $[51];
320
- let t28;
321
- if ($[52] !== t18 || $[53] !== t27) {
322
- t28 = /* @__PURE__ */ jsx(DropdownMenuContent, {
316
+ } else t26 = $[50];
317
+ let t27;
318
+ if ($[51] !== t17 || $[52] !== t26) {
319
+ t27 = /* @__PURE__ */ jsx(DropdownMenuContent, {
323
320
  className: "w-80",
324
321
  align: "start",
325
- children: /* @__PURE__ */ jsxs(Fragment, { children: [t18, t27] })
322
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [t17, t26] })
326
323
  });
327
- $[52] = t18;
324
+ $[51] = t17;
325
+ $[52] = t26;
328
326
  $[53] = t27;
329
- $[54] = t28;
330
- } else t28 = $[54];
331
- let t29;
332
- if ($[55] !== t17 || $[56] !== t28) {
333
- t29 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t17, t28] });
334
- $[55] = t17;
327
+ } else t27 = $[53];
328
+ let t28;
329
+ if ($[54] !== t16 || $[55] !== t27) {
330
+ t28 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t16, t27] });
331
+ $[54] = t16;
332
+ $[55] = t27;
335
333
  $[56] = t28;
336
- $[57] = t29;
337
- } else t29 = $[57];
338
- let t30;
339
- if ($[58] !== current?.name || $[59] !== deleting || $[60] !== draftId || $[61] !== leaveDraft || $[62] !== projectId || $[63] !== review) {
340
- t30 = draftId && projectId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ReviewDraftSheet, {
334
+ } else t28 = $[56];
335
+ let t29;
336
+ if ($[57] !== deleting || $[58] !== draftId || $[59] !== leaveDraft || $[60] !== projectId || $[61] !== reviewing) {
337
+ t29 = draftId && projectId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ReviewDraftSheet, {
341
338
  projectId,
342
339
  draftId,
343
- open: review.open,
344
- startRenaming: review.startRenaming,
340
+ open: reviewing,
345
341
  onOpenChange: _temp7
346
342
  }), /* @__PURE__ */ jsx(DeleteDraftDialog, {
347
343
  projectId,
348
344
  open: deleting,
349
- discard: current?.name === null,
350
345
  onOpenChange: _temp8,
351
- onDeleted: (ended) => leaveDraft(ended, { discarded: current?.name === null })
346
+ onDeleted: leaveDraft
352
347
  })] });
353
- $[58] = current?.name;
354
- $[59] = deleting;
355
- $[60] = draftId;
356
- $[61] = leaveDraft;
357
- $[62] = projectId;
358
- $[63] = review;
359
- $[64] = t30;
360
- } else t30 = $[64];
361
- let t31;
362
- if ($[65] !== t29 || $[66] !== t30) {
363
- t31 = /* @__PURE__ */ jsxs(Fragment, { children: [t29, t30] });
364
- $[65] = t29;
365
- $[66] = t30;
366
- $[67] = t31;
367
- } else t31 = $[67];
368
- return t31;
348
+ $[57] = deleting;
349
+ $[58] = draftId;
350
+ $[59] = leaveDraft;
351
+ $[60] = projectId;
352
+ $[61] = reviewing;
353
+ $[62] = t29;
354
+ } else t29 = $[62];
355
+ let t30;
356
+ if ($[63] !== t28 || $[64] !== t29) {
357
+ t30 = /* @__PURE__ */ jsxs(Fragment, { children: [t28, t29] });
358
+ $[63] = t28;
359
+ $[64] = t29;
360
+ $[65] = t30;
361
+ } else t30 = $[65];
362
+ return t30;
369
363
  }
370
364
  function _temp8(open_0) {
371
365
  if (!open_0) studioStore.send({ type: "closeDeleteDraftDialog" });
@@ -391,18 +385,18 @@ function _temp2(state_0) {
391
385
  return state_0.context.isDeleteDraftDialogOpen;
392
386
  }
393
387
  function _temp(state) {
394
- return state.context.reviewDraftSheet;
388
+ return state.context.isReviewDraftSheetOpen;
395
389
  }
396
390
  /**
397
391
  * 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
398
392
  * deletes by itself.
399
393
  */
400
394
  function useDraftsActions(t0) {
401
- const $ = c(7);
402
- const { enabled, draftId, unnamed, drafts, switchTo } = t0;
395
+ const $ = c(6);
396
+ const { enabled, draftId, drafts, switchTo } = t0;
403
397
  let t1;
404
398
  let t2;
405
- if ($[0] !== draftId || $[1] !== drafts || $[2] !== enabled || $[3] !== switchTo || $[4] !== unnamed) {
399
+ if ($[0] !== draftId || $[1] !== drafts || $[2] !== enabled || $[3] !== switchTo) {
406
400
  t1 = () => {
407
401
  const inDraft = enabled && !!draftId;
408
402
  const others = drafts.filter((listed) => listed.id !== draftId);
@@ -423,12 +417,8 @@ function useDraftsActions(t0) {
423
417
  },
424
418
  {
425
419
  id: "delete-draft",
426
- label: unnamed ? "Discard changes…" : "Delete draft…",
427
- aliases: unnamed ? [
428
- "Delete draft",
429
- "Throw away changes",
430
- "Revert changes"
431
- ] : [
420
+ label: "Delete draft…",
421
+ aliases: [
432
422
  "Discard changes",
433
423
  "Throw away changes",
434
424
  "Revert changes"
@@ -437,14 +427,6 @@ function useDraftsActions(t0) {
437
427
  checkIfAvailable: () => inDraft,
438
428
  execute: _temp10
439
429
  },
440
- {
441
- id: "rename-draft",
442
- label: unnamed ? "Name draft…" : "Rename draft…",
443
- aliases: unnamed ? ["Rename draft", "Save draft"] : ["Name draft"],
444
- groupLabel: "Drafts",
445
- checkIfAvailable: () => inDraft,
446
- execute: _temp11
447
- },
448
430
  {
449
431
  id: "switch-to-live",
450
432
  label: "Switch to Live",
@@ -469,7 +451,7 @@ function useDraftsActions(t0) {
469
451
  groupLabel: "Drafts",
470
452
  checkIfAvailable: () => others.length > 0,
471
453
  hasChildren: true,
472
- execute: _temp12
454
+ execute: _temp11
473
455
  },
474
456
  ...others.map((other) => ({
475
457
  id: `${SWITCH_TO_DRAFT_ID}-${other.id}`,
@@ -477,7 +459,7 @@ function useDraftsActions(t0) {
477
459
  label: `Switch to "${draftLabel(other)}"`,
478
460
  aliases: [other.createdBy.name],
479
461
  groupLabel: "Drafts",
480
- checkIfAvailable: _temp13,
462
+ checkIfAvailable: _temp12,
481
463
  execute: () => switchTo(other.id)
482
464
  }))
483
465
  ];
@@ -488,14 +470,13 @@ function useDraftsActions(t0) {
488
470
  return () => {
489
471
  actionsStore.send({
490
472
  type: "unregisterManyActions",
491
- ids: actions.map(_temp14)
473
+ ids: actions.map(_temp13)
492
474
  });
493
475
  };
494
476
  };
495
477
  t2 = [
496
478
  enabled,
497
479
  draftId,
498
- unnamed,
499
480
  drafts,
500
481
  switchTo
501
482
  ];
@@ -503,28 +484,21 @@ function useDraftsActions(t0) {
503
484
  $[1] = drafts;
504
485
  $[2] = enabled;
505
486
  $[3] = switchTo;
506
- $[4] = unnamed;
507
- $[5] = t1;
508
- $[6] = t2;
487
+ $[4] = t1;
488
+ $[5] = t2;
509
489
  } else {
510
- t1 = $[5];
511
- t2 = $[6];
490
+ t1 = $[4];
491
+ t2 = $[5];
512
492
  }
513
493
  React.useEffect(t1, t2);
514
494
  }
515
- function _temp14(a) {
495
+ function _temp13(a) {
516
496
  return a.id;
517
497
  }
518
- function _temp13() {
498
+ function _temp12() {
519
499
  return true;
520
500
  }
521
- function _temp12() {}
522
- function _temp11() {
523
- return studioStore.send({
524
- type: "openReviewDraftSheet",
525
- startRenaming: true
526
- });
527
- }
501
+ function _temp11() {}
528
502
  function _temp10() {
529
503
  return studioStore.send({ type: "openDeleteDraftDialog" });
530
504
  }