camox 0.69.0 → 0.72.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/core/createApp.d.ts +4 -103
- package/dist/core/createApp.js +3 -24
- package/dist/core/createBlock.d.ts +2 -2
- package/dist/core/createBlock.js +55 -192
- package/dist/core/createLayout.d.ts +6 -77
- package/dist/core/createLayout.js +12 -50
- package/dist/core/editing/createEditableBlock.d.ts +9 -75
- package/dist/core/editing/createEditableBlock.js +258 -640
- package/dist/core/hooks/useArtifactHost.js +56 -46
- package/dist/core/hooks/useIsEditable.js +2 -2
- package/dist/core/lib/artifact.d.ts +4 -0
- package/dist/core/lib/artifactData.js +8 -3
- package/dist/core/lib/artifactHost.js +40 -0
- package/dist/core/lib/artifactRuntime.js +20 -1
- package/dist/core/lib/contentType.d.ts +23 -38
- package/dist/core/lib/contentType.js +34 -62
- package/dist/core/lib/iconTypes.d.ts +0 -3
- package/dist/core/lib/icons.js +63 -51
- package/dist/core/lib/recordScope.js +1 -1
- package/dist/features/canvas/CanvasOverlays.js +94 -176
- package/dist/features/canvas/CanvasPageFrame.js +62 -68
- package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -3
- package/dist/features/canvas/canvasOverlayGeometry.js +1 -7
- package/dist/features/canvas/sidebar/CuratedPageInspector.js +3 -21
- package/dist/features/canvas/sidebar/LayoutPageBlocks.js +1 -2
- package/dist/features/canvas/useCanvasCamera.js +1 -1
- package/dist/features/canvas/useCanvasFrame.js +1 -1
- package/dist/features/content/ContentCollection.js +2 -2
- package/dist/features/content/collection-form.js +6 -7
- package/dist/features/page/CuratedPageContent.js +15 -24
- package/dist/features/page/UnplacedBlockContent.js +1 -6
- package/dist/features/preview/CamoxPreview.js +30 -33
- package/dist/features/preview/EditablePageContent.js +131 -151
- package/dist/features/preview/components/BlockActionsPopover.js +43 -152
- package/dist/features/preview/components/CanvasPreview.js +2 -2
- package/dist/features/preview/components/Frame.js +3 -3
- package/dist/features/preview/components/IconFieldEditor.js +1 -1
- package/dist/features/preview/components/ItemFieldsEditor.js +1 -3
- package/dist/features/preview/components/Overlays.js +18 -84
- package/dist/features/preview/components/PageTree.js +57 -103
- package/dist/features/preview/components/PreviewPanel.js +8 -11
- package/dist/features/preview/components/RecordCombobox.js +65 -78
- package/dist/features/preview/components/ReferenceFieldEditor.js +1 -19
- package/dist/features/preview/components/ReferenceListFieldEditor.js +1 -19
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +2 -2
- package/dist/features/preview/components/SelectionEditor.js +5 -4
- package/dist/features/preview/components/useRepeatableItemActions.js +18 -24
- package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
- package/dist/features/preview/overlayMessages.js +1 -4
- package/dist/features/preview/previewStore.js +3 -23
- package/dist/features/renderer/RendererApp.js +17 -141
- package/dist/features/renderer/definitionAnswers.js +1 -8
- package/dist/features/renderer/rendererHost.js +1 -31
- package/dist/features/renderer/studioConnection.js +1 -25
- package/dist/features/runtime/pageApp.js +8 -4
- package/dist/features/runtime/runtime.js +3 -3
- package/dist/features/studio/agentRunToast.js +71 -0
- package/dist/features/studio/components/ChatWidget.js +2 -0
- package/dist/features/studio/components/DraftBar.js +2 -3
- package/dist/features/studio/components/DraftsControl.js +150 -176
- package/dist/features/studio/components/ReviewDraftSheet.js +344 -548
- package/dist/features/studio/components/ThreadMessages.js +89 -22
- package/dist/features/studio/draftLabel.js +1 -1
- package/dist/features/studio/studioStore.js +5 -17
- package/dist/features/studio/viewSwitch.js +2 -4
- package/dist/features/vite/blockBoilerplate.js +1 -1
- package/dist/features/vite/definitionsSync.js +1 -8
- package/dist/lib/queries.js +0 -1
- package/dist/lib/studio-definitions.js +0 -2
- package/dist/lib/studio-reads.js +0 -5
- package/dist/lib/use-thread.js +196 -138
- package/dist/package.js +1 -1
- package/dist/studio-overlays.css +0 -29
- package/dist/studio.css +1 -1
- package/package.json +6 -4
- package/skills/camox/SKILL.md +1 -1
- package/skills/camox/references/artifacts.md +89 -5
- package/skills/camox/references/block-definitions.md +21 -25
- package/skills/camox/references/dom-integrations.md +1 -1
- package/skills/camox/references/layout-definitions.md +3 -12
- package/skills/camox/references/routed-layouts.md +2 -2
- package/skills/camox-expand/SKILL.md +5 -5
- package/skills/camoxify/SKILL.md +4 -4
- package/dist/features/canvas/canvasInsertionSeams.js +0 -44
- package/dist/features/preview/components/AddBlockSheet.js +0 -314
- package/dist/features/preview/components/BlockPeek.js +0 -66
- package/dist/features/preview/components/BlockThumbnail.js +0 -281
- package/dist/features/preview/components/blockGridNavigation.js +0 -15
- package/dist/features/preview/referencePickerFocus.js +0 -29
|
@@ -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(
|
|
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
|
|
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
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
useDraftsActions(t9);
|
|
173
|
+
} else t8 = $[16];
|
|
174
|
+
useDraftsActions(t8);
|
|
178
175
|
if (draftId && !current) return null;
|
|
179
|
-
let
|
|
180
|
-
if ($[
|
|
181
|
-
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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:
|
|
195
|
+
className: t11
|
|
199
196
|
});
|
|
197
|
+
$[20] = t11;
|
|
200
198
|
$[21] = t12;
|
|
201
|
-
|
|
202
|
-
|
|
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 ($[
|
|
205
|
-
t14 =
|
|
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:
|
|
211
|
+
children: t13
|
|
215
212
|
});
|
|
213
|
+
$[25] = t13;
|
|
216
214
|
$[26] = t14;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
$[
|
|
226
|
-
} else
|
|
227
|
-
let
|
|
228
|
-
if ($[
|
|
229
|
-
|
|
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:
|
|
228
|
+
render: t9,
|
|
232
229
|
children: [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
230
|
+
t12,
|
|
231
|
+
t14,
|
|
232
|
+
t15
|
|
236
233
|
]
|
|
237
234
|
});
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
} else
|
|
243
|
-
let
|
|
244
|
-
if ($[
|
|
245
|
-
|
|
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
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
} else
|
|
252
|
-
const
|
|
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 ($[
|
|
255
|
-
t20 =
|
|
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(
|
|
263
|
+
t21 = /* @__PURE__ */ jsx("span", { children: "Live" });
|
|
262
264
|
$[37] = t21;
|
|
263
265
|
} else t21 = $[37];
|
|
264
266
|
let t22;
|
|
265
|
-
if ($[38]
|
|
266
|
-
t22 = /* @__PURE__ */ jsx("span", {
|
|
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
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
} else
|
|
278
|
-
let
|
|
279
|
-
if ($[
|
|
280
|
-
|
|
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: [
|
|
282
|
+
children: [t21, t22]
|
|
286
283
|
})
|
|
287
284
|
});
|
|
285
|
+
$[40] = t22;
|
|
288
286
|
$[41] = t23;
|
|
289
|
-
|
|
290
|
-
|
|
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 ($[
|
|
293
|
-
t25 =
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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] =
|
|
314
|
+
$[49] = t25;
|
|
317
315
|
$[50] = t26;
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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: [
|
|
322
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [t17, t26] })
|
|
326
323
|
});
|
|
327
|
-
$[
|
|
324
|
+
$[51] = t17;
|
|
325
|
+
$[52] = t26;
|
|
328
326
|
$[53] = t27;
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
$[55] =
|
|
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
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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:
|
|
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:
|
|
346
|
+
onDeleted: leaveDraft
|
|
352
347
|
})] });
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
|
|
367
|
-
|
|
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.
|
|
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(
|
|
402
|
-
const { enabled, draftId,
|
|
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
|
|
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:
|
|
427
|
-
aliases:
|
|
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:
|
|
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:
|
|
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(
|
|
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] =
|
|
507
|
-
$[5] =
|
|
508
|
-
$[6] = t2;
|
|
487
|
+
$[4] = t1;
|
|
488
|
+
$[5] = t2;
|
|
509
489
|
} else {
|
|
510
|
-
t1 = $[
|
|
511
|
-
t2 = $[
|
|
490
|
+
t1 = $[4];
|
|
491
|
+
t2 = $[5];
|
|
512
492
|
}
|
|
513
493
|
React.useEffect(t1, t2);
|
|
514
494
|
}
|
|
515
|
-
function
|
|
495
|
+
function _temp13(a) {
|
|
516
496
|
return a.id;
|
|
517
497
|
}
|
|
518
|
-
function
|
|
498
|
+
function _temp12() {
|
|
519
499
|
return true;
|
|
520
500
|
}
|
|
521
|
-
function
|
|
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
|
}
|