camox 0.77.0 → 0.79.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 +187 -197
- package/dist/features/canvas/canvasCameraController.js +1 -1
- package/dist/features/canvas/canvasItems.js +40 -9
- package/dist/features/canvas/sidebar/ContentSidebarFrame.js +15 -11
- package/dist/features/canvas/useCanvasLayout.js +34 -0
- package/dist/features/memory/CamoxMemory.js +756 -0
- package/dist/features/memory/VoiceGroup.js +350 -0
- package/dist/features/preview/EditablePageExperience.js +2 -0
- package/dist/features/runtime/publicCache.d.ts +2 -0
- package/dist/features/runtime/publicCache.js +27 -4
- package/dist/features/runtime/runtime.d.ts +1 -1
- package/dist/features/runtime/runtime.js +34 -15
- package/dist/features/studio/FollowAgentProvider.js +1 -1
- package/dist/features/studio/components/AgentSidebar.js +22 -16
- package/dist/features/studio/components/DraftBar.js +167 -103
- package/dist/features/studio/components/{ReviewDraftDialog.js → DraftReview.js} +214 -218
- package/dist/features/studio/components/DraftsControl.js +174 -202
- package/dist/features/studio/components/DraftsSheet.js +102 -94
- package/dist/features/studio/components/Navbar.js +121 -84
- package/dist/features/studio/components/PublishedTab.js +21 -20
- package/dist/features/studio/routes.js +3 -1
- package/dist/features/studio/studioStore.js +12 -9
- package/dist/features/studio/usePublishDraft.js +116 -0
- package/dist/features/studio/viewSwitch.js +10 -7
- package/dist/features/vite/vite.js +1 -0
- package/dist/lib/queries.js +11 -1
- package/dist/lib/studio-reads.d.ts +1 -0
- package/dist/lib/studio-reads.js +12 -0
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +5 -5
- package/LICENSE.md +0 -21
|
@@ -9,7 +9,6 @@ import { useSwitchView } from "../viewSwitch.js";
|
|
|
9
9
|
import { draftLabel, plural, timeAgo } from "../draftLabel.js";
|
|
10
10
|
import { useArchiveDraft } from "../useArchiveDraft.js";
|
|
11
11
|
import { DraftsSheet } from "./DraftsSheet.js";
|
|
12
|
-
import { ReviewDraftDialog } from "./ReviewDraftDialog.js";
|
|
13
12
|
import { c } from "react/compiler-runtime";
|
|
14
13
|
import * as React from "react";
|
|
15
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -95,58 +94,50 @@ function useDrafts() {
|
|
|
95
94
|
}
|
|
96
95
|
/**
|
|
97
96
|
* Picks what the studio is viewing, Live or a draft (#203). Live is read-only; the first edit
|
|
98
|
-
* starts a draft. The command palette offers the same actions,
|
|
99
|
-
*
|
|
100
|
-
* itself. A `disabled` picker still names what the studio is viewing.
|
|
97
|
+
* starts a draft. The command palette offers the same actions, and the picker hosts the sheet
|
|
98
|
+
* of archived drafts it opens itself. A `disabled` picker still names what the studio is viewing.
|
|
101
99
|
*/
|
|
102
100
|
function DraftPicker(t0) {
|
|
103
|
-
const $ = c(
|
|
101
|
+
const $ = c(68);
|
|
104
102
|
const { disabled: t1 } = t0;
|
|
105
103
|
const disabled = t1 === void 0 ? false : t1;
|
|
106
104
|
const { draftScope, draftId, projectId, list, current } = useDrafts();
|
|
107
105
|
const navigate = useNavigate();
|
|
108
106
|
const switchView = useSwitchView();
|
|
109
107
|
const { archive } = useArchiveDraft(projectId);
|
|
110
|
-
const
|
|
108
|
+
const sheetOpen = useSelector(studioStore, _temp);
|
|
109
|
+
const sheetPublication = useSelector(studioStore, _temp2);
|
|
111
110
|
let t2;
|
|
112
|
-
if ($[0] !== draftId) {
|
|
113
|
-
t2 = (state_0) => !!draftId && state_0.context.agentWorkingIn === draftId;
|
|
114
|
-
$[0] = draftId;
|
|
115
|
-
$[1] = t2;
|
|
116
|
-
} else t2 = $[1];
|
|
117
|
-
const working = useSelector(studioStore, t2);
|
|
118
|
-
const sheetOpen = useSelector(studioStore, _temp2);
|
|
119
111
|
let t3;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
t3 =
|
|
123
|
-
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[4] = t4;
|
|
112
|
+
if ($[0] !== draftScope) {
|
|
113
|
+
t2 = () => draftScope.subscribe(_temp3);
|
|
114
|
+
t3 = [draftScope];
|
|
115
|
+
$[0] = draftScope;
|
|
116
|
+
$[1] = t2;
|
|
117
|
+
$[2] = t3;
|
|
127
118
|
} else {
|
|
128
|
-
|
|
129
|
-
|
|
119
|
+
t2 = $[1];
|
|
120
|
+
t3 = $[2];
|
|
130
121
|
}
|
|
131
|
-
React.useEffect(
|
|
122
|
+
React.useEffect(t2, t3);
|
|
123
|
+
let t4;
|
|
124
|
+
if ($[3] !== draftId) {
|
|
125
|
+
t4 = [draftId];
|
|
126
|
+
$[3] = draftId;
|
|
127
|
+
$[4] = t4;
|
|
128
|
+
} else t4 = $[4];
|
|
129
|
+
React.useEffect(_temp5, t4);
|
|
130
|
+
const listed = list?.drafts;
|
|
132
131
|
let t5;
|
|
133
|
-
if ($[5] !==
|
|
134
|
-
t5 = [
|
|
135
|
-
$[5] =
|
|
132
|
+
if ($[5] !== listed) {
|
|
133
|
+
t5 = listed ?? [];
|
|
134
|
+
$[5] = listed;
|
|
136
135
|
$[6] = t5;
|
|
137
136
|
} else t5 = $[6];
|
|
138
|
-
|
|
139
|
-
const listed = list?.drafts;
|
|
137
|
+
const drafts = t5;
|
|
140
138
|
let t6;
|
|
141
|
-
if ($[7] !==
|
|
142
|
-
t6 =
|
|
143
|
-
$[7] = listed;
|
|
144
|
-
$[8] = t6;
|
|
145
|
-
} else t6 = $[8];
|
|
146
|
-
const drafts = t6;
|
|
147
|
-
let t7;
|
|
148
|
-
if ($[9] !== draftId || $[10] !== drafts || $[11] !== navigate || $[12] !== switchView) {
|
|
149
|
-
t7 = (next) => {
|
|
139
|
+
if ($[7] !== draftId || $[8] !== drafts || $[9] !== navigate || $[10] !== switchView) {
|
|
140
|
+
t6 = (next) => {
|
|
150
141
|
if (next === draftId) return;
|
|
151
142
|
const target = next ? drafts.find((draft) => draft.id === next) : void 0;
|
|
152
143
|
const label = next ? target ? draftLabel(target) : "the draft" : "Live";
|
|
@@ -158,85 +149,86 @@ function DraftPicker(t0) {
|
|
|
158
149
|
success: `You're now viewing ${label}.`
|
|
159
150
|
});
|
|
160
151
|
};
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
} else
|
|
167
|
-
const switchTo =
|
|
168
|
-
const
|
|
152
|
+
$[7] = draftId;
|
|
153
|
+
$[8] = drafts;
|
|
154
|
+
$[9] = navigate;
|
|
155
|
+
$[10] = switchView;
|
|
156
|
+
$[11] = t6;
|
|
157
|
+
} else t6 = $[11];
|
|
158
|
+
const switchTo = t6;
|
|
159
|
+
const t7 = !!projectId;
|
|
160
|
+
const t8 = !!current && current.changeCount > 0;
|
|
169
161
|
const t9 = current && !current.catchUp ? archive : void 0;
|
|
170
162
|
let t10;
|
|
171
|
-
if ($[
|
|
163
|
+
if ($[12] !== draftId || $[13] !== drafts || $[14] !== switchTo || $[15] !== t7 || $[16] !== t8 || $[17] !== t9) {
|
|
172
164
|
t10 = {
|
|
173
|
-
enabled:
|
|
165
|
+
enabled: t7,
|
|
174
166
|
draftId,
|
|
175
167
|
drafts,
|
|
176
168
|
switchTo,
|
|
177
|
-
|
|
169
|
+
hasChanges: t8,
|
|
178
170
|
archive: t9
|
|
179
171
|
};
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
} else t10 = $[
|
|
172
|
+
$[12] = draftId;
|
|
173
|
+
$[13] = drafts;
|
|
174
|
+
$[14] = switchTo;
|
|
175
|
+
$[15] = t7;
|
|
176
|
+
$[16] = t8;
|
|
177
|
+
$[17] = t9;
|
|
178
|
+
$[18] = t10;
|
|
179
|
+
} else t10 = $[18];
|
|
188
180
|
useDraftsActions(t10);
|
|
189
181
|
if (draftId && !current) return null;
|
|
190
182
|
let t11;
|
|
191
|
-
if ($[
|
|
183
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
192
184
|
t11 = /* @__PURE__ */ jsx(Button, {
|
|
193
185
|
type: "button",
|
|
194
186
|
variant: "ghost"
|
|
195
187
|
});
|
|
196
|
-
$[
|
|
197
|
-
} else t11 = $[
|
|
188
|
+
$[19] = t11;
|
|
189
|
+
} else t11 = $[19];
|
|
198
190
|
const t12 = draftId ? "bg-blue-500" : "bg-emerald-500";
|
|
199
191
|
let t13;
|
|
200
|
-
if ($[
|
|
192
|
+
if ($[20] !== t12) {
|
|
201
193
|
t13 = cn("size-2 shrink-0 rounded-full", t12);
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
} else t13 = $[
|
|
194
|
+
$[20] = t12;
|
|
195
|
+
$[21] = t13;
|
|
196
|
+
} else t13 = $[21];
|
|
205
197
|
let t14;
|
|
206
|
-
if ($[
|
|
198
|
+
if ($[22] !== t13) {
|
|
207
199
|
t14 = /* @__PURE__ */ jsx("span", {
|
|
208
200
|
"aria-hidden": true,
|
|
209
201
|
className: t13
|
|
210
202
|
});
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
} else t14 = $[
|
|
203
|
+
$[22] = t13;
|
|
204
|
+
$[23] = t14;
|
|
205
|
+
} else t14 = $[23];
|
|
214
206
|
let t15;
|
|
215
|
-
if ($[
|
|
207
|
+
if ($[24] !== current || $[25] !== draftId) {
|
|
216
208
|
t15 = draftId ? draftLabel(current) : "Live";
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
} else t15 = $[
|
|
209
|
+
$[24] = current;
|
|
210
|
+
$[25] = draftId;
|
|
211
|
+
$[26] = t15;
|
|
212
|
+
} else t15 = $[26];
|
|
221
213
|
let t16;
|
|
222
|
-
if ($[
|
|
214
|
+
if ($[27] !== t15) {
|
|
223
215
|
t16 = /* @__PURE__ */ jsx("span", {
|
|
224
216
|
className: "max-w-48 truncate",
|
|
225
217
|
children: t15
|
|
226
218
|
});
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
} else t16 = $[
|
|
219
|
+
$[27] = t15;
|
|
220
|
+
$[28] = t16;
|
|
221
|
+
} else t16 = $[28];
|
|
230
222
|
let t17;
|
|
231
|
-
if ($[
|
|
223
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
232
224
|
t17 = /* @__PURE__ */ jsx(ChevronsUpDown, {
|
|
233
225
|
"aria-hidden": true,
|
|
234
226
|
className: "size-4 opacity-50"
|
|
235
227
|
});
|
|
236
|
-
$[
|
|
237
|
-
} else t17 = $[
|
|
228
|
+
$[29] = t17;
|
|
229
|
+
} else t17 = $[29];
|
|
238
230
|
let t18;
|
|
239
|
-
if ($[
|
|
231
|
+
if ($[30] !== disabled || $[31] !== t14 || $[32] !== t16) {
|
|
240
232
|
t18 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
241
233
|
disabled,
|
|
242
234
|
render: t11,
|
|
@@ -246,48 +238,48 @@ function DraftPicker(t0) {
|
|
|
246
238
|
t17
|
|
247
239
|
]
|
|
248
240
|
});
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
} else t18 = $[
|
|
241
|
+
$[30] = disabled;
|
|
242
|
+
$[31] = t14;
|
|
243
|
+
$[32] = t16;
|
|
244
|
+
$[33] = t18;
|
|
245
|
+
} else t18 = $[33];
|
|
254
246
|
let t19;
|
|
255
|
-
if ($[
|
|
247
|
+
if ($[34] !== draftId) {
|
|
256
248
|
t19 = !draftId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
|
|
257
249
|
className: "text-muted-foreground font-normal",
|
|
258
250
|
children: "Live is read-only. Your first edit starts a new draft."
|
|
259
251
|
}) }), /* @__PURE__ */ jsx(DropdownMenuSeparator, {})] });
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
} else t19 = $[
|
|
252
|
+
$[34] = draftId;
|
|
253
|
+
$[35] = t19;
|
|
254
|
+
} else t19 = $[35];
|
|
263
255
|
const t20 = draftId ?? LIVE;
|
|
264
256
|
let t21;
|
|
265
|
-
if ($[
|
|
257
|
+
if ($[36] !== switchTo) {
|
|
266
258
|
t21 = (value) => switchTo(value === LIVE ? null : String(value));
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
} else t21 = $[
|
|
259
|
+
$[36] = switchTo;
|
|
260
|
+
$[37] = t21;
|
|
261
|
+
} else t21 = $[37];
|
|
270
262
|
let t22;
|
|
271
|
-
if ($[
|
|
263
|
+
if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
|
|
272
264
|
t22 = /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Switch to" });
|
|
273
|
-
$[
|
|
274
|
-
} else t22 = $[
|
|
265
|
+
$[38] = t22;
|
|
266
|
+
} else t22 = $[38];
|
|
275
267
|
let t23;
|
|
276
|
-
if ($[
|
|
268
|
+
if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
277
269
|
t23 = /* @__PURE__ */ jsx("span", { children: "Live" });
|
|
278
|
-
$[
|
|
279
|
-
} else t23 = $[
|
|
270
|
+
$[39] = t23;
|
|
271
|
+
} else t23 = $[39];
|
|
280
272
|
let t24;
|
|
281
|
-
if ($[
|
|
273
|
+
if ($[40] !== list) {
|
|
282
274
|
t24 = list && /* @__PURE__ */ jsx("span", {
|
|
283
275
|
className: "text-muted-foreground text-xs",
|
|
284
276
|
children: liveLine(list.live)
|
|
285
277
|
});
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
} else t24 = $[
|
|
278
|
+
$[40] = list;
|
|
279
|
+
$[41] = t24;
|
|
280
|
+
} else t24 = $[41];
|
|
289
281
|
let t25;
|
|
290
|
-
if ($[
|
|
282
|
+
if ($[42] !== t24) {
|
|
291
283
|
t25 = /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
|
|
292
284
|
value: LIVE,
|
|
293
285
|
closeOnClick: true,
|
|
@@ -296,45 +288,45 @@ function DraftPicker(t0) {
|
|
|
296
288
|
children: [t23, t24]
|
|
297
289
|
})
|
|
298
290
|
});
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
} else t25 = $[
|
|
291
|
+
$[42] = t24;
|
|
292
|
+
$[43] = t25;
|
|
293
|
+
} else t25 = $[43];
|
|
302
294
|
let t26;
|
|
303
|
-
if ($[
|
|
295
|
+
if ($[44] !== drafts) {
|
|
304
296
|
t26 = drafts.map(_temp6);
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
} else t26 = $[
|
|
297
|
+
$[44] = drafts;
|
|
298
|
+
$[45] = t26;
|
|
299
|
+
} else t26 = $[45];
|
|
308
300
|
let t27;
|
|
309
|
-
if ($[
|
|
301
|
+
if ($[46] !== t25 || $[47] !== t26) {
|
|
310
302
|
t27 = /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
311
303
|
t22,
|
|
312
304
|
t25,
|
|
313
305
|
t26
|
|
314
306
|
] });
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
} else t27 = $[
|
|
307
|
+
$[46] = t25;
|
|
308
|
+
$[47] = t26;
|
|
309
|
+
$[48] = t27;
|
|
310
|
+
} else t27 = $[48];
|
|
319
311
|
let t28;
|
|
320
|
-
if ($[
|
|
312
|
+
if ($[49] !== t20 || $[50] !== t21 || $[51] !== t27) {
|
|
321
313
|
t28 = /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
322
314
|
value: t20,
|
|
323
315
|
onValueChange: t21,
|
|
324
316
|
children: t27
|
|
325
317
|
});
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
330
|
-
} else t28 = $[
|
|
318
|
+
$[49] = t20;
|
|
319
|
+
$[50] = t21;
|
|
320
|
+
$[51] = t27;
|
|
321
|
+
$[52] = t28;
|
|
322
|
+
} else t28 = $[52];
|
|
331
323
|
let t29;
|
|
332
|
-
if ($[
|
|
324
|
+
if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
|
|
333
325
|
t29 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
|
|
334
|
-
$[
|
|
335
|
-
} else t29 = $[
|
|
326
|
+
$[53] = t29;
|
|
327
|
+
} else t29 = $[53];
|
|
336
328
|
let t30;
|
|
337
|
-
if ($[
|
|
329
|
+
if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
|
|
338
330
|
t30 = /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
339
331
|
onClick: _temp7,
|
|
340
332
|
children: [/* @__PURE__ */ jsx(Archive, {
|
|
@@ -342,10 +334,10 @@ function DraftPicker(t0) {
|
|
|
342
334
|
className: "size-4"
|
|
343
335
|
}), "Archived and published…"]
|
|
344
336
|
}) });
|
|
345
|
-
$[
|
|
346
|
-
} else t30 = $[
|
|
337
|
+
$[54] = t30;
|
|
338
|
+
} else t30 = $[54];
|
|
347
339
|
let t31;
|
|
348
|
-
if ($[
|
|
340
|
+
if ($[55] !== t19 || $[56] !== t28) {
|
|
349
341
|
t31 = /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
350
342
|
className: "w-80",
|
|
351
343
|
align: "start",
|
|
@@ -356,60 +348,41 @@ function DraftPicker(t0) {
|
|
|
356
348
|
t30
|
|
357
349
|
] })
|
|
358
350
|
});
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
} else t31 = $[
|
|
351
|
+
$[55] = t19;
|
|
352
|
+
$[56] = t28;
|
|
353
|
+
$[57] = t31;
|
|
354
|
+
} else t31 = $[57];
|
|
363
355
|
let t32;
|
|
364
|
-
if ($[
|
|
356
|
+
if ($[58] !== t18 || $[59] !== t31) {
|
|
365
357
|
t32 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t18, t31] });
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
} else t32 = $[
|
|
358
|
+
$[58] = t18;
|
|
359
|
+
$[59] = t31;
|
|
360
|
+
$[60] = t32;
|
|
361
|
+
} else t32 = $[60];
|
|
370
362
|
let t33;
|
|
371
|
-
if ($[
|
|
372
|
-
t33 =
|
|
363
|
+
if ($[61] !== projectId || $[62] !== sheetOpen || $[63] !== sheetPublication) {
|
|
364
|
+
t33 = projectId && /* @__PURE__ */ jsx(DraftsSheet, {
|
|
373
365
|
projectId,
|
|
374
|
-
|
|
375
|
-
|
|
366
|
+
open: sheetOpen,
|
|
367
|
+
publicationId: sheetPublication,
|
|
376
368
|
onOpenChange: _temp8
|
|
377
369
|
});
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
} else t33 = $[
|
|
370
|
+
$[61] = projectId;
|
|
371
|
+
$[62] = sheetOpen;
|
|
372
|
+
$[63] = sheetPublication;
|
|
373
|
+
$[64] = t33;
|
|
374
|
+
} else t33 = $[64];
|
|
383
375
|
let t34;
|
|
384
|
-
if ($[
|
|
385
|
-
t34 =
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
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;
|
|
407
|
-
}
|
|
408
|
-
function _temp9(open_0) {
|
|
409
|
-
if (!open_0) studioStore.send({ type: "closeDraftsSheet" });
|
|
376
|
+
if ($[65] !== t32 || $[66] !== t33) {
|
|
377
|
+
t34 = /* @__PURE__ */ jsxs(Fragment, { children: [t32, t33] });
|
|
378
|
+
$[65] = t32;
|
|
379
|
+
$[66] = t33;
|
|
380
|
+
$[67] = t34;
|
|
381
|
+
} else t34 = $[67];
|
|
382
|
+
return t34;
|
|
410
383
|
}
|
|
411
384
|
function _temp8(open) {
|
|
412
|
-
if (!open) studioStore.send({ type: "
|
|
385
|
+
if (!open) studioStore.send({ type: "closeDraftsSheet" });
|
|
413
386
|
}
|
|
414
387
|
function _temp7() {
|
|
415
388
|
return studioStore.send({ type: "openDraftsSheet" });
|
|
@@ -421,47 +394,46 @@ function _temp5() {
|
|
|
421
394
|
return _temp4;
|
|
422
395
|
}
|
|
423
396
|
function _temp4() {
|
|
424
|
-
return studioStore.send({ type: "
|
|
397
|
+
return studioStore.send({ type: "closeDraftReview" });
|
|
425
398
|
}
|
|
426
399
|
function _temp3(t0) {
|
|
427
400
|
const { move } = t0;
|
|
428
401
|
if (move === "started") toast.success("Started a new draft");
|
|
429
402
|
}
|
|
430
|
-
function _temp2(
|
|
431
|
-
return
|
|
403
|
+
function _temp2(state_0) {
|
|
404
|
+
return state_0.context.draftsSheetPublication;
|
|
432
405
|
}
|
|
433
406
|
function _temp(state) {
|
|
434
|
-
return state.context.
|
|
407
|
+
return state.context.isDraftsSheetOpen;
|
|
435
408
|
}
|
|
436
409
|
/**
|
|
437
410
|
* The drafts controls' actions in the command palette, offered where the controls offer them. The
|
|
438
|
-
* palette opens the review, never publishing
|
|
439
|
-
*
|
|
440
|
-
* Camox's agent is mid-turn in the draft (`working`).
|
|
411
|
+
* palette opens the review of a draft's pending changes, never publishing, which only the Draft
|
|
412
|
+
* Bar does, and archives the draft as its bar does, except Camox's Catch-up Draft.
|
|
441
413
|
*/
|
|
442
414
|
function useDraftsActions(t0) {
|
|
443
415
|
const $ = c(8);
|
|
444
|
-
const { enabled, draftId, drafts, switchTo,
|
|
416
|
+
const { enabled, draftId, drafts, switchTo, hasChanges, archive } = t0;
|
|
445
417
|
let t1;
|
|
446
418
|
let t2;
|
|
447
|
-
if ($[0] !== archive || $[1] !== draftId || $[2] !== drafts || $[3] !== enabled || $[4] !==
|
|
419
|
+
if ($[0] !== archive || $[1] !== draftId || $[2] !== drafts || $[3] !== enabled || $[4] !== hasChanges || $[5] !== switchTo) {
|
|
448
420
|
t1 = () => {
|
|
449
421
|
const inDraft = enabled && !!draftId;
|
|
450
422
|
const others = drafts.filter((listed) => listed.id !== draftId);
|
|
451
423
|
const actions = [
|
|
452
424
|
{
|
|
453
425
|
id: "review-draft",
|
|
454
|
-
label: "Review
|
|
426
|
+
label: "Review pending changes",
|
|
455
427
|
aliases: [
|
|
456
|
-
"
|
|
457
|
-
"
|
|
458
|
-
"
|
|
459
|
-
"
|
|
460
|
-
"
|
|
428
|
+
"Changes",
|
|
429
|
+
"What changed",
|
|
430
|
+
"Summary",
|
|
431
|
+
"Overview",
|
|
432
|
+
"Blockers"
|
|
461
433
|
],
|
|
462
434
|
groupLabel: "Drafts",
|
|
463
|
-
checkIfAvailable: () => inDraft &&
|
|
464
|
-
execute:
|
|
435
|
+
checkIfAvailable: () => inDraft && hasChanges,
|
|
436
|
+
execute: _temp9
|
|
465
437
|
},
|
|
466
438
|
{
|
|
467
439
|
id: "archive-draft",
|
|
@@ -500,7 +472,7 @@ function useDraftsActions(t0) {
|
|
|
500
472
|
groupLabel: "Drafts",
|
|
501
473
|
checkIfAvailable: () => others.length > 0,
|
|
502
474
|
hasChildren: true,
|
|
503
|
-
execute:
|
|
475
|
+
execute: _temp10
|
|
504
476
|
},
|
|
505
477
|
...others.map((other) => ({
|
|
506
478
|
id: `${SWITCH_TO_DRAFT_ID}-${other.id}`,
|
|
@@ -508,7 +480,7 @@ function useDraftsActions(t0) {
|
|
|
508
480
|
label: `Switch to "${draftLabel(other)}"`,
|
|
509
481
|
aliases: [other.createdBy.name],
|
|
510
482
|
groupLabel: "Drafts",
|
|
511
|
-
checkIfAvailable:
|
|
483
|
+
checkIfAvailable: _temp11,
|
|
512
484
|
execute: () => switchTo(other.id)
|
|
513
485
|
}))
|
|
514
486
|
];
|
|
@@ -519,7 +491,7 @@ function useDraftsActions(t0) {
|
|
|
519
491
|
return () => {
|
|
520
492
|
actionsStore.send({
|
|
521
493
|
type: "unregisterManyActions",
|
|
522
|
-
ids: actions.map(
|
|
494
|
+
ids: actions.map(_temp12)
|
|
523
495
|
});
|
|
524
496
|
};
|
|
525
497
|
};
|
|
@@ -528,15 +500,15 @@ function useDraftsActions(t0) {
|
|
|
528
500
|
draftId,
|
|
529
501
|
drafts,
|
|
530
502
|
switchTo,
|
|
531
|
-
|
|
503
|
+
hasChanges,
|
|
532
504
|
archive
|
|
533
505
|
];
|
|
534
506
|
$[0] = archive;
|
|
535
507
|
$[1] = draftId;
|
|
536
508
|
$[2] = drafts;
|
|
537
509
|
$[3] = enabled;
|
|
538
|
-
$[4] =
|
|
539
|
-
$[5] =
|
|
510
|
+
$[4] = hasChanges;
|
|
511
|
+
$[5] = switchTo;
|
|
540
512
|
$[6] = t1;
|
|
541
513
|
$[7] = t2;
|
|
542
514
|
} else {
|
|
@@ -545,15 +517,15 @@ function useDraftsActions(t0) {
|
|
|
545
517
|
}
|
|
546
518
|
React.useEffect(t1, t2);
|
|
547
519
|
}
|
|
548
|
-
function
|
|
520
|
+
function _temp12(a) {
|
|
549
521
|
return a.id;
|
|
550
522
|
}
|
|
551
|
-
function
|
|
523
|
+
function _temp11() {
|
|
552
524
|
return true;
|
|
553
525
|
}
|
|
554
|
-
function
|
|
555
|
-
function
|
|
556
|
-
return studioStore.send({ type: "
|
|
526
|
+
function _temp10() {}
|
|
527
|
+
function _temp9() {
|
|
528
|
+
return studioStore.send({ type: "openDraftReview" });
|
|
557
529
|
}
|
|
558
530
|
/** Who published Live last and when: a member, a release, or nobody yet. */
|
|
559
531
|
function liveLine(live) {
|