camox 0.75.0 → 0.76.1
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/editing/createEditableBlock.js +1077 -1681
- package/dist/core/editing/fieldSlot.js +251 -0
- package/dist/core/editing/useFieldSlot.js +159 -0
- package/dist/core/layoutContext.d.ts +2 -0
- package/dist/core/layoutContext.js +27 -1
- package/dist/features/canvas/CanvasPageFrame.js +2 -2
- package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -1
- package/dist/features/canvas/canvasCameraController.js +595 -0
- package/dist/features/canvas/useCanvasCamera.js +141 -587
- package/dist/features/canvas/useCanvasFrame.js +1 -1
- package/dist/features/page/DerivedPageContent.js +4 -8
- package/dist/features/preview/components/AssetLightbox.js +6 -65
- package/dist/features/preview/components/CanvasPreview.js +2 -2
- package/dist/features/preview/components/Frame.js +3 -3
- package/dist/features/preview/components/ItemFieldsEditor.js +376 -460
- package/dist/features/preview/components/Overlays.js +4 -9
- package/dist/features/preview/components/PreviewPanel.js +3 -3
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +2 -2
- package/dist/features/preview/components/SelectionEditor.js +285 -339
- package/dist/features/preview/components/ZoomableImage.js +105 -0
- package/dist/features/preview/components/contentFieldSchema.js +3 -1
- package/dist/features/preview/components/useFieldWriter.js +30 -51
- package/dist/features/preview/components/useRecordView.js +3 -3
- package/dist/features/preview/overlayMessages.js +20 -58
- package/dist/features/preview/previewStore.js +6 -123
- package/dist/features/preview/repeatableItemPath.js +47 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +75 -63
- package/dist/features/renderer/RendererApp.js +6 -6
- package/dist/features/renderer/RendererFrames.js +2 -2
- package/dist/features/renderer/rendererHost.js +1 -1
- package/dist/features/routes/pageRuntime.d.ts +8 -12
- package/dist/features/routes/pageRuntime.js +26 -106
- package/dist/features/runtime/pageApp.js +1 -1
- package/dist/features/runtime/pageRead.js +105 -0
- package/dist/features/runtime/reader.d.ts +25 -0
- package/dist/features/runtime/reader.js +142 -0
- package/dist/features/runtime/runtime.d.ts +9 -3
- package/dist/features/runtime/runtime.js +608 -776
- package/dist/features/sdkBundle/buildSdkBundle.d.ts +5 -0
- package/dist/features/sdkBundle/buildSdkBundle.js +9 -3
- package/dist/features/studio/components/ChatWidget.js +137 -121
- package/dist/features/studio/components/ClearThread.js +121 -0
- package/dist/features/studio/components/DeleteDraftDialog.js +67 -65
- package/dist/features/studio/components/DraftBar.js +60 -49
- package/dist/features/studio/components/DraftNotices.js +149 -0
- package/dist/features/studio/components/DraftsControl.js +217 -180
- package/dist/features/studio/components/DraftsSheet.js +446 -0
- package/dist/features/studio/components/PublishedTab.js +511 -0
- package/dist/features/studio/components/ReviewDraftDialog.js +104 -89
- package/dist/features/studio/components/SheetTable.js +46 -0
- package/dist/features/studio/components/Specialists.js +1 -1
- package/dist/features/studio/components/ThreadMessages.js +227 -176
- package/dist/features/studio/draftLabel.js +15 -1
- package/dist/features/studio/draftNotice.js +1 -0
- package/dist/features/studio/showInCanvas.js +9 -19
- package/dist/features/studio/studioStore.js +5 -5
- package/dist/features/studio/useArchiveDraft.js +60 -0
- package/dist/features/studio/useEditorSelection.js +8 -19
- package/dist/features/studio/useRestoreDraft.js +70 -0
- package/dist/features/studio/viewSwitch.js +19 -11
- package/dist/lib/draft-scope.d.ts +1 -1
- package/dist/lib/draft-scope.js +6 -3
- package/dist/lib/queries.js +12 -1
- package/dist/lib/studio-reads.js +22 -0
- package/dist/lib/use-project-room.js +19 -13
- 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/core/hooks/useFieldSelection.js +0 -67
- package/dist/core/hooks/useIsEditable.js +0 -21
- package/dist/core/hooks/useOverlayMessage.js +0 -70
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useProjectUuid } from "../../../lib/auth.js";
|
|
1
2
|
import { isFileMarker } from "../../../lib/normalized-data.js";
|
|
2
3
|
import { reads, useReadQueries, useReadQuery } from "../../../lib/studio-reads.js";
|
|
3
4
|
import { blockMutations, repeatableItemMutations } from "../../../lib/queries.js";
|
|
@@ -5,7 +6,8 @@ import { SingleAssetFieldEditor } from "./AssetFieldEditor.js";
|
|
|
5
6
|
import { MultipleAssetFieldEditor } from "./MultipleAssetFieldEditor.js";
|
|
6
7
|
import { useBlockDefinition } from "../../../lib/studio-definitions.js";
|
|
7
8
|
import { editorAssetField } from "../../content/collection-form.js";
|
|
8
|
-
import {
|
|
9
|
+
import { fieldOwner, isBlockPlacement, recordPlacement, slotOf, slotSelection } from "../../../core/editing/fieldSlot.js";
|
|
10
|
+
import { previewStore, selectionBlockId, selectionForOwner, selectionItemId } from "../previewStore.js";
|
|
9
11
|
import { useEditingFrame } from "../editingFrame.js";
|
|
10
12
|
import { SelectionViewCount, SidebarStackHeader, SidebarStackView } from "./SidebarStack.js";
|
|
11
13
|
import { PreviewEditingOwnerContext } from "../previewSelection.js";
|
|
@@ -13,9 +15,10 @@ import { entityName } from "../entityName.js";
|
|
|
13
15
|
import { ContentFindings, findingsHint, useContentFindings } from "../../studio/components/ContentFindings.js";
|
|
14
16
|
import { fieldTypesDictionary } from "../../../core/lib/fieldTypes.js";
|
|
15
17
|
import { usePageRecordPlacer } from "../pageRecord.js";
|
|
16
|
-
import {
|
|
18
|
+
import { itemContentSchema, itemPath, itemRepeaterSchema } from "../repeatableItemPath.js";
|
|
19
|
+
import { contentFieldNames, contentFieldSchema, formatFieldName } from "./contentFieldSchema.js";
|
|
17
20
|
import { useRepeatableItemActions } from "./useRepeatableItemActions.js";
|
|
18
|
-
import { ItemFieldsEditor
|
|
21
|
+
import { ItemFieldsEditor } from "./ItemFieldsEditor.js";
|
|
19
22
|
import { LinkFieldEditor } from "./LinkFieldEditor.js";
|
|
20
23
|
import { SidebarSection, SidebarSectionContent, SidebarSectionHeader } from "./SidebarSection.js";
|
|
21
24
|
import { useFieldWriter } from "./useFieldWriter.js";
|
|
@@ -70,58 +73,6 @@ const getSettingsFields = (schema) => {
|
|
|
70
73
|
};
|
|
71
74
|
});
|
|
72
75
|
};
|
|
73
|
-
/**
|
|
74
|
-
* Builds the path of fieldNames from the block root to the given item,
|
|
75
|
-
* then walks the schema down that path to return the sub-schema for the item's fields.
|
|
76
|
-
*/
|
|
77
|
-
const getSchemaForItem = (contentSchema, itemId, itemsMap) => {
|
|
78
|
-
const path = [];
|
|
79
|
-
let current = itemsMap.get(itemId);
|
|
80
|
-
while (current) {
|
|
81
|
-
path.unshift(current.fieldName);
|
|
82
|
-
current = current.parentItemId ? itemsMap.get(current.parentItemId) : void 0;
|
|
83
|
-
}
|
|
84
|
-
let schema = contentSchema;
|
|
85
|
-
for (const fieldName of path) {
|
|
86
|
-
const prop = schema?.properties?.[fieldName];
|
|
87
|
-
if (!prop?.items) return null;
|
|
88
|
-
schema = prop.items;
|
|
89
|
-
}
|
|
90
|
-
return schema;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* Like `getSchemaForItem` but returns the **array** schema (one level above
|
|
94
|
-
* the items schema), where per-item settings metadata lives.
|
|
95
|
-
*/
|
|
96
|
-
const getArraySchemaForItem = (contentSchema, itemId, itemsMap) => {
|
|
97
|
-
const path = [];
|
|
98
|
-
let current = itemsMap.get(itemId);
|
|
99
|
-
while (current) {
|
|
100
|
-
path.unshift(current.fieldName);
|
|
101
|
-
current = current.parentItemId ? itemsMap.get(current.parentItemId) : void 0;
|
|
102
|
-
}
|
|
103
|
-
let schema = contentSchema;
|
|
104
|
-
for (let i = 0; i < path.length; i++) {
|
|
105
|
-
const prop = schema?.properties?.[path[i]];
|
|
106
|
-
if (!prop?.items) return null;
|
|
107
|
-
if (i === path.length - 1) return prop;
|
|
108
|
-
schema = prop.items;
|
|
109
|
-
}
|
|
110
|
-
return null;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Builds the ancestor chain from root to this item (inclusive).
|
|
114
|
-
* Returns items in order from root-most ancestor to the item itself.
|
|
115
|
-
*/
|
|
116
|
-
const buildAncestorChain = (itemId, itemsMap) => {
|
|
117
|
-
const chain = [];
|
|
118
|
-
let current = itemsMap.get(itemId);
|
|
119
|
-
while (current) {
|
|
120
|
-
chain.unshift(current);
|
|
121
|
-
current = current.parentItemId ? itemsMap.get(current.parentItemId) : void 0;
|
|
122
|
-
}
|
|
123
|
-
return chain;
|
|
124
|
-
};
|
|
125
76
|
const SelectionEditor = (t0) => {
|
|
126
77
|
const $ = c(3);
|
|
127
78
|
const { pageCrumb: t1 } = t0;
|
|
@@ -141,8 +92,9 @@ const SelectionEditor = (t0) => {
|
|
|
141
92
|
return t2;
|
|
142
93
|
};
|
|
143
94
|
const SelectionEditorContent = (t0) => {
|
|
144
|
-
const $ = c(
|
|
95
|
+
const $ = c(135);
|
|
145
96
|
const { owner, pageCrumb } = t0;
|
|
97
|
+
const projectUuid = useProjectUuid();
|
|
146
98
|
let t1;
|
|
147
99
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
148
100
|
t1 = blockMutations.updateSettings();
|
|
@@ -252,236 +204,242 @@ const SelectionEditorContent = (t0) => {
|
|
|
252
204
|
const layoutRecordSelected = (selection?.type === "record" || selection?.type === "record-field") && !isBlockPlacement(selection);
|
|
253
205
|
let t14;
|
|
254
206
|
if ($[27] !== currentItemId || $[28] !== itemsMap) {
|
|
255
|
-
t14 = currentItemId
|
|
207
|
+
t14 = itemPath(currentItemId, itemsMap);
|
|
256
208
|
$[27] = currentItemId;
|
|
257
209
|
$[28] = itemsMap;
|
|
258
210
|
$[29] = t14;
|
|
259
211
|
} else t14 = $[29];
|
|
260
|
-
const
|
|
212
|
+
const path = t14;
|
|
261
213
|
let t15;
|
|
214
|
+
if ($[30] !== currentItemId || $[31] !== itemsMap) {
|
|
215
|
+
t15 = currentItemId != null ? itemsMap.get(currentItemId) : void 0;
|
|
216
|
+
$[30] = currentItemId;
|
|
217
|
+
$[31] = itemsMap;
|
|
218
|
+
$[32] = t15;
|
|
219
|
+
} else t15 = $[32];
|
|
220
|
+
const placerItem = t15;
|
|
221
|
+
let t16;
|
|
262
222
|
bb0: {
|
|
263
223
|
if (!block || !blockDef) {
|
|
264
|
-
|
|
224
|
+
t16 = null;
|
|
265
225
|
break bb0;
|
|
266
226
|
}
|
|
267
227
|
if (currentItemId == null) {
|
|
268
|
-
let
|
|
269
|
-
if ($[
|
|
270
|
-
|
|
228
|
+
let t17;
|
|
229
|
+
if ($[33] !== block || $[34] !== blockDef.contentSchema) {
|
|
230
|
+
t17 = {
|
|
271
231
|
...block,
|
|
272
232
|
contentSchema: blockDef.contentSchema
|
|
273
233
|
};
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
} else
|
|
278
|
-
|
|
234
|
+
$[33] = block;
|
|
235
|
+
$[34] = blockDef.contentSchema;
|
|
236
|
+
$[35] = t17;
|
|
237
|
+
} else t17 = $[35];
|
|
238
|
+
t16 = t17;
|
|
279
239
|
break bb0;
|
|
280
240
|
}
|
|
281
241
|
if (!placerItem) {
|
|
282
|
-
|
|
242
|
+
t16 = null;
|
|
283
243
|
break bb0;
|
|
284
244
|
}
|
|
285
|
-
let t16;
|
|
286
|
-
if ($[33] !== blockDef.contentSchema || $[34] !== currentItemId || $[35] !== itemsMap) {
|
|
287
|
-
t16 = getSchemaForItem(blockDef.contentSchema, currentItemId, itemsMap);
|
|
288
|
-
$[33] = blockDef.contentSchema;
|
|
289
|
-
$[34] = currentItemId;
|
|
290
|
-
$[35] = itemsMap;
|
|
291
|
-
$[36] = t16;
|
|
292
|
-
} else t16 = $[36];
|
|
293
245
|
let t17;
|
|
294
|
-
if ($[
|
|
295
|
-
t17 =
|
|
246
|
+
if ($[36] !== blockDef.contentSchema || $[37] !== path) {
|
|
247
|
+
t17 = itemContentSchema(blockDef.contentSchema, path);
|
|
248
|
+
$[36] = blockDef.contentSchema;
|
|
249
|
+
$[37] = path;
|
|
250
|
+
$[38] = t17;
|
|
251
|
+
} else t17 = $[38];
|
|
252
|
+
let t18;
|
|
253
|
+
if ($[39] !== placerItem || $[40] !== t17) {
|
|
254
|
+
t18 = {
|
|
296
255
|
...placerItem,
|
|
297
|
-
contentSchema:
|
|
256
|
+
contentSchema: t17
|
|
298
257
|
};
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
} else
|
|
303
|
-
|
|
258
|
+
$[39] = placerItem;
|
|
259
|
+
$[40] = t17;
|
|
260
|
+
$[41] = t18;
|
|
261
|
+
} else t18 = $[41];
|
|
262
|
+
t16 = t18;
|
|
304
263
|
}
|
|
305
|
-
const
|
|
306
|
-
let
|
|
307
|
-
if ($[
|
|
308
|
-
|
|
264
|
+
const t17 = layoutRecordSelected ? pagePlacer : t16;
|
|
265
|
+
let t18;
|
|
266
|
+
if ($[42] !== owner || $[43] !== selection || $[44] !== t17) {
|
|
267
|
+
t18 = {
|
|
309
268
|
owner,
|
|
310
269
|
selection,
|
|
311
|
-
placer:
|
|
270
|
+
placer: t17
|
|
312
271
|
};
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
} else
|
|
318
|
-
const { recordView, viewSelection, recordCrumbs } = useRecordView(
|
|
272
|
+
$[42] = owner;
|
|
273
|
+
$[43] = selection;
|
|
274
|
+
$[44] = t17;
|
|
275
|
+
$[45] = t18;
|
|
276
|
+
} else t18 = $[45];
|
|
277
|
+
const { recordView, viewSelection, recordCrumbs } = useRecordView(t18);
|
|
319
278
|
const recordId = recordView?.record.id;
|
|
320
|
-
let
|
|
279
|
+
let t19;
|
|
321
280
|
bb1: {
|
|
322
281
|
if (recordId !== void 0) {
|
|
323
|
-
let
|
|
324
|
-
if ($[
|
|
325
|
-
|
|
282
|
+
let t20;
|
|
283
|
+
if ($[46] !== recordId) {
|
|
284
|
+
t20 = {
|
|
326
285
|
entity: "record",
|
|
327
286
|
id: recordId
|
|
328
287
|
};
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
} else
|
|
332
|
-
|
|
288
|
+
$[46] = recordId;
|
|
289
|
+
$[47] = t20;
|
|
290
|
+
} else t20 = $[47];
|
|
291
|
+
t19 = t20;
|
|
333
292
|
break bb1;
|
|
334
293
|
}
|
|
335
294
|
if (currentItemId != null) {
|
|
336
|
-
let
|
|
337
|
-
if ($[
|
|
338
|
-
|
|
295
|
+
let t20;
|
|
296
|
+
if ($[48] !== currentItemId) {
|
|
297
|
+
t20 = {
|
|
339
298
|
entity: "repeatableItem",
|
|
340
299
|
id: currentItemId
|
|
341
300
|
};
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
} else
|
|
345
|
-
|
|
301
|
+
$[48] = currentItemId;
|
|
302
|
+
$[49] = t20;
|
|
303
|
+
} else t20 = $[49];
|
|
304
|
+
t19 = t20;
|
|
346
305
|
break bb1;
|
|
347
306
|
}
|
|
348
|
-
let
|
|
349
|
-
if ($[
|
|
350
|
-
|
|
307
|
+
let t20;
|
|
308
|
+
if ($[50] !== block) {
|
|
309
|
+
t20 = block ? {
|
|
351
310
|
entity: "block",
|
|
352
311
|
id: block.id
|
|
353
312
|
} : null;
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
} else
|
|
357
|
-
|
|
313
|
+
$[50] = block;
|
|
314
|
+
$[51] = t20;
|
|
315
|
+
} else t20 = $[51];
|
|
316
|
+
t19 = t20;
|
|
358
317
|
}
|
|
359
|
-
const findings = useContentFindings(
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
if ($[50] !== blockDef) {
|
|
366
|
-
t19 = blockDef ? getSettingsFields(blockDef.settingsSchema) : [];
|
|
367
|
-
$[50] = blockDef;
|
|
368
|
-
$[51] = t19;
|
|
369
|
-
} else t19 = $[51];
|
|
370
|
-
const settingsFields = t19;
|
|
318
|
+
const findings = useContentFindings(t19);
|
|
319
|
+
const selectedSlot = slotOf(recordView?.selection.type === "record-field" ? recordView.selection : viewSelection);
|
|
320
|
+
const selectedField = selectedSlot ? {
|
|
321
|
+
fieldName: selectedSlot.name,
|
|
322
|
+
fieldType: selectedSlot.type
|
|
323
|
+
} : null;
|
|
371
324
|
let t20;
|
|
325
|
+
if ($[52] !== blockDef) {
|
|
326
|
+
t20 = blockDef ? getSettingsFields(blockDef.settingsSchema) : [];
|
|
327
|
+
$[52] = blockDef;
|
|
328
|
+
$[53] = t20;
|
|
329
|
+
} else t20 = $[53];
|
|
330
|
+
const settingsFields = t20;
|
|
331
|
+
let t21;
|
|
372
332
|
bb2: {
|
|
373
333
|
if (!blockDef || currentItemId == null) {
|
|
374
|
-
|
|
334
|
+
t21 = null;
|
|
375
335
|
break bb2;
|
|
376
336
|
}
|
|
377
|
-
let
|
|
378
|
-
if ($[
|
|
379
|
-
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
t20 = t21;
|
|
337
|
+
let t22;
|
|
338
|
+
if ($[54] !== blockDef.contentSchema || $[55] !== path) {
|
|
339
|
+
t22 = itemRepeaterSchema(blockDef.contentSchema, path);
|
|
340
|
+
$[54] = blockDef.contentSchema;
|
|
341
|
+
$[55] = path;
|
|
342
|
+
$[56] = t22;
|
|
343
|
+
} else t22 = $[56];
|
|
344
|
+
t21 = t22;
|
|
386
345
|
}
|
|
387
|
-
const itemArraySchema =
|
|
388
|
-
const
|
|
389
|
-
let
|
|
390
|
-
if ($[
|
|
391
|
-
|
|
392
|
-
$[56] = t21;
|
|
346
|
+
const itemArraySchema = t21;
|
|
347
|
+
const t22 = itemArraySchema?.itemSettingsSchema;
|
|
348
|
+
let t23;
|
|
349
|
+
if ($[57] !== t22) {
|
|
350
|
+
t23 = getSettingsFields(t22);
|
|
393
351
|
$[57] = t22;
|
|
394
|
-
|
|
395
|
-
|
|
352
|
+
$[58] = t23;
|
|
353
|
+
} else t23 = $[58];
|
|
354
|
+
const itemSettingsFields = t23;
|
|
396
355
|
const recordSchema = recordView?.collection.contentSchema;
|
|
397
356
|
const recordInList = recordView?.inList === true;
|
|
398
|
-
let
|
|
357
|
+
let t24;
|
|
399
358
|
bb3: {
|
|
400
359
|
if (recordSchema) {
|
|
401
|
-
|
|
360
|
+
t24 = recordSchema;
|
|
402
361
|
break bb3;
|
|
403
362
|
}
|
|
404
363
|
if (!blockDef) {
|
|
405
|
-
|
|
364
|
+
t24 = null;
|
|
406
365
|
break bb3;
|
|
407
366
|
}
|
|
408
367
|
if (currentItemId == null) {
|
|
409
|
-
|
|
368
|
+
t24 = blockDef.contentSchema;
|
|
410
369
|
break bb3;
|
|
411
370
|
}
|
|
412
|
-
let
|
|
413
|
-
if ($[
|
|
414
|
-
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
t23 = t24;
|
|
371
|
+
let t25;
|
|
372
|
+
if ($[59] !== blockDef.contentSchema || $[60] !== path) {
|
|
373
|
+
t25 = itemContentSchema(blockDef.contentSchema, path);
|
|
374
|
+
$[59] = blockDef.contentSchema;
|
|
375
|
+
$[60] = path;
|
|
376
|
+
$[61] = t25;
|
|
377
|
+
} else t25 = $[61];
|
|
378
|
+
t24 = t25;
|
|
421
379
|
}
|
|
422
|
-
const currentSchema =
|
|
423
|
-
let
|
|
380
|
+
const currentSchema = t24;
|
|
381
|
+
let t25;
|
|
424
382
|
if ($[62] !== currentItemId || $[63] !== itemsMap) {
|
|
425
|
-
|
|
383
|
+
t25 = currentItemId != null ? itemsMap.get(currentItemId) : null;
|
|
426
384
|
$[62] = currentItemId;
|
|
427
385
|
$[63] = itemsMap;
|
|
428
|
-
$[64] =
|
|
429
|
-
} else
|
|
430
|
-
const currentItem =
|
|
386
|
+
$[64] = t25;
|
|
387
|
+
} else t25 = $[64];
|
|
388
|
+
const currentItem = t25;
|
|
431
389
|
const isItemLoading = currentItemId != null && !currentItem;
|
|
432
|
-
let
|
|
390
|
+
let t26;
|
|
433
391
|
bb4: {
|
|
434
392
|
if (!currentItem) {
|
|
435
|
-
|
|
393
|
+
t26 = 0;
|
|
436
394
|
break bb4;
|
|
437
395
|
}
|
|
438
396
|
let count = 0;
|
|
439
397
|
for (const it of itemsMap.values()) if (it.fieldName === currentItem.fieldName && it.parentItemId === currentItem.parentItemId) count++;
|
|
440
|
-
|
|
398
|
+
t26 = count;
|
|
441
399
|
}
|
|
442
|
-
const siblingCount =
|
|
443
|
-
const
|
|
444
|
-
const
|
|
445
|
-
const
|
|
446
|
-
const
|
|
447
|
-
let
|
|
448
|
-
if ($[65] !== siblingCount || $[66] !==
|
|
449
|
-
|
|
450
|
-
blockId:
|
|
451
|
-
fieldName:
|
|
452
|
-
parentItemId:
|
|
453
|
-
arraySchema:
|
|
400
|
+
const siblingCount = t26;
|
|
401
|
+
const t27 = block?.id ?? "";
|
|
402
|
+
const t28 = currentItem?.fieldName ?? "";
|
|
403
|
+
const t29 = currentItem?.parentItemId ?? null;
|
|
404
|
+
const t30 = itemArraySchema;
|
|
405
|
+
let t31;
|
|
406
|
+
if ($[65] !== siblingCount || $[66] !== t27 || $[67] !== t28 || $[68] !== t29 || $[69] !== t30) {
|
|
407
|
+
t31 = {
|
|
408
|
+
blockId: t27,
|
|
409
|
+
fieldName: t28,
|
|
410
|
+
parentItemId: t29,
|
|
411
|
+
arraySchema: t30,
|
|
454
412
|
siblingCount
|
|
455
413
|
};
|
|
456
414
|
$[65] = siblingCount;
|
|
457
|
-
$[66] =
|
|
458
|
-
$[67] =
|
|
459
|
-
$[68] =
|
|
460
|
-
$[69] =
|
|
461
|
-
$[70] =
|
|
462
|
-
} else
|
|
463
|
-
const { canAdd: canAddSibling, addItem: addSibling, canRemove: canRemoveCurrent, removeItem: removeCurrent } = useRepeatableItemActions(
|
|
415
|
+
$[66] = t27;
|
|
416
|
+
$[67] = t28;
|
|
417
|
+
$[68] = t29;
|
|
418
|
+
$[69] = t30;
|
|
419
|
+
$[70] = t31;
|
|
420
|
+
} else t31 = $[70];
|
|
421
|
+
const { canAdd: canAddSibling, addItem: addSibling, canRemove: canRemoveCurrent, removeItem: removeCurrent } = useRepeatableItemActions(t31);
|
|
464
422
|
const recordContent = recordView?.record.content;
|
|
465
423
|
const rawCurrentData = currentItem ? currentItem.content : block?.content ?? EMPTY_CONTENT;
|
|
466
|
-
let
|
|
424
|
+
let t32;
|
|
467
425
|
bb5: {
|
|
468
426
|
if (recordContent) {
|
|
469
|
-
let
|
|
427
|
+
let t33;
|
|
470
428
|
if ($[71] !== recordContent || $[72] !== recordSchema) {
|
|
471
|
-
|
|
472
|
-
const [key, value] =
|
|
429
|
+
t33 = Object.fromEntries(Object.entries(recordContent).map((t34) => {
|
|
430
|
+
const [key, value] = t34;
|
|
473
431
|
return [key, editorAssetField(contentFieldSchema(recordSchema, key)?.fieldType, value)];
|
|
474
432
|
}));
|
|
475
433
|
$[71] = recordContent;
|
|
476
434
|
$[72] = recordSchema;
|
|
477
|
-
$[73] =
|
|
478
|
-
} else
|
|
479
|
-
|
|
435
|
+
$[73] = t33;
|
|
436
|
+
} else t33 = $[73];
|
|
437
|
+
t32 = t33;
|
|
480
438
|
break bb5;
|
|
481
439
|
}
|
|
482
|
-
let
|
|
440
|
+
let t33;
|
|
483
441
|
if ($[74] !== filesMap) {
|
|
484
|
-
|
|
442
|
+
t33 = (marker) => {
|
|
485
443
|
const file = filesMap.get(marker._fileId);
|
|
486
444
|
return file ? {
|
|
487
445
|
url: file.url,
|
|
@@ -497,9 +455,9 @@ const SelectionEditorContent = (t0) => {
|
|
|
497
455
|
};
|
|
498
456
|
};
|
|
499
457
|
$[74] = filesMap;
|
|
500
|
-
$[75] =
|
|
501
|
-
} else
|
|
502
|
-
const resolveFile =
|
|
458
|
+
$[75] = t33;
|
|
459
|
+
} else t33 = $[75];
|
|
460
|
+
const resolveFile = t33;
|
|
503
461
|
let resolved_0;
|
|
504
462
|
if ($[76] !== rawCurrentData || $[77] !== resolveFile) {
|
|
505
463
|
const resolveValue = (value_0) => {
|
|
@@ -519,9 +477,9 @@ const SelectionEditorContent = (t0) => {
|
|
|
519
477
|
$[77] = resolveFile;
|
|
520
478
|
$[78] = resolved_0;
|
|
521
479
|
} else resolved_0 = $[78];
|
|
522
|
-
|
|
480
|
+
t32 = resolved_0;
|
|
523
481
|
}
|
|
524
|
-
const currentData =
|
|
482
|
+
const currentData = t32;
|
|
525
483
|
const fieldInfo = selectedField ? {
|
|
526
484
|
...selectedField,
|
|
527
485
|
fieldType: contentFieldSchema(currentSchema, selectedField.fieldName)?.fieldType ?? selectedField.fieldType
|
|
@@ -542,74 +500,69 @@ const SelectionEditorContent = (t0) => {
|
|
|
542
500
|
const fieldIdPrefix = React.useId();
|
|
543
501
|
const blockIdForWrites = block?.id;
|
|
544
502
|
const recordForWrites = recordView?.record;
|
|
545
|
-
let
|
|
503
|
+
let t33;
|
|
546
504
|
bb6: {
|
|
547
505
|
if (recordForWrites) {
|
|
548
|
-
let
|
|
549
|
-
if ($[79] !== recordForWrites) {
|
|
550
|
-
|
|
506
|
+
let t34;
|
|
507
|
+
if ($[79] !== projectUuid || $[80] !== recordForWrites) {
|
|
508
|
+
t34 = {
|
|
551
509
|
kind: "record",
|
|
552
|
-
record: recordForWrites
|
|
510
|
+
record: recordForWrites,
|
|
511
|
+
projectUuid
|
|
553
512
|
};
|
|
554
|
-
$[79] =
|
|
555
|
-
$[80] =
|
|
556
|
-
|
|
557
|
-
|
|
513
|
+
$[79] = projectUuid;
|
|
514
|
+
$[80] = recordForWrites;
|
|
515
|
+
$[81] = t34;
|
|
516
|
+
} else t34 = $[81];
|
|
517
|
+
t33 = t34;
|
|
558
518
|
break bb6;
|
|
559
519
|
}
|
|
560
520
|
if (blockIdForWrites == null) {
|
|
561
|
-
|
|
521
|
+
t33 = null;
|
|
562
522
|
break bb6;
|
|
563
523
|
}
|
|
564
524
|
if (currentItemId == null) {
|
|
565
|
-
let
|
|
566
|
-
if ($[
|
|
567
|
-
|
|
525
|
+
let t34;
|
|
526
|
+
if ($[82] !== blockIdForWrites) {
|
|
527
|
+
t34 = {
|
|
568
528
|
kind: "block",
|
|
569
529
|
blockId: blockIdForWrites
|
|
570
530
|
};
|
|
571
|
-
$[
|
|
572
|
-
$[
|
|
573
|
-
} else
|
|
574
|
-
|
|
531
|
+
$[82] = blockIdForWrites;
|
|
532
|
+
$[83] = t34;
|
|
533
|
+
} else t34 = $[83];
|
|
534
|
+
t33 = t34;
|
|
575
535
|
break bb6;
|
|
576
536
|
}
|
|
577
|
-
let
|
|
578
|
-
if ($[
|
|
579
|
-
|
|
537
|
+
let t34;
|
|
538
|
+
if ($[84] !== blockIdForWrites || $[85] !== currentItemId) {
|
|
539
|
+
t34 = {
|
|
580
540
|
kind: "item",
|
|
581
541
|
blockId: blockIdForWrites,
|
|
582
542
|
itemId: currentItemId
|
|
583
543
|
};
|
|
584
|
-
$[
|
|
585
|
-
$[
|
|
586
|
-
$[
|
|
587
|
-
} else
|
|
588
|
-
|
|
544
|
+
$[84] = blockIdForWrites;
|
|
545
|
+
$[85] = currentItemId;
|
|
546
|
+
$[86] = t34;
|
|
547
|
+
} else t34 = $[86];
|
|
548
|
+
t33 = t34;
|
|
589
549
|
}
|
|
590
|
-
const writeField = useFieldWriter(
|
|
591
|
-
|
|
592
|
-
if ($[86] !== currentItemId || $[87] !== itemsMap) {
|
|
593
|
-
t33 = currentItemId != null ? buildAncestorChain(currentItemId, itemsMap) : [];
|
|
594
|
-
$[86] = currentItemId;
|
|
595
|
-
$[87] = itemsMap;
|
|
596
|
-
$[88] = t33;
|
|
597
|
-
} else t33 = $[88];
|
|
598
|
-
const ancestorChain = t33;
|
|
550
|
+
const writeField = useFieldWriter(t33, currentSchema);
|
|
551
|
+
const ancestorChain = path;
|
|
599
552
|
if (!currentSchema || !recordView && (!block || !blockDef)) {
|
|
600
553
|
let t34;
|
|
601
|
-
if ($[
|
|
554
|
+
if ($[87] === Symbol.for("react.memo_cache_sentinel")) {
|
|
602
555
|
t34 = /* @__PURE__ */ jsxs("div", {
|
|
603
556
|
className: "text-muted-foreground flex flex-1 items-center justify-center px-2 text-sm",
|
|
604
557
|
children: [/* @__PURE__ */ jsx(Spinner, { className: "mr-2 size-3.5" }), " Loading block..."]
|
|
605
558
|
});
|
|
606
|
-
$[
|
|
607
|
-
} else t34 = $[
|
|
559
|
+
$[87] = t34;
|
|
560
|
+
} else t34 = $[87];
|
|
608
561
|
return t34;
|
|
609
562
|
}
|
|
610
563
|
const fieldHasOwnView = fieldInfo ? fieldTypesDictionary[fieldInfo.fieldType].hasOwnView : false;
|
|
611
564
|
let t34;
|
|
612
|
-
if ($[
|
|
565
|
+
if ($[88] !== ancestorChain || $[89] !== currentItemId || $[90] !== fieldHasOwnView || $[91] !== owner || $[92] !== recordView) {
|
|
613
566
|
t34 = (block_0, blockDef_0) => [{
|
|
614
567
|
key: "block",
|
|
615
568
|
label: blockDef_0.title,
|
|
@@ -623,56 +576,49 @@ const SelectionEditorContent = (t0) => {
|
|
|
623
576
|
type: "block",
|
|
624
577
|
blockId: block_0.id
|
|
625
578
|
}
|
|
626
|
-
}, ...ancestorChain.flatMap((ancestor) =>
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
isCurrent: false,
|
|
630
|
-
hoverTarget: {
|
|
631
|
-
type: "block-field",
|
|
632
|
-
blockId: block_0.id,
|
|
633
|
-
fieldName: ancestor.fieldName,
|
|
634
|
-
fieldType: "Repeater"
|
|
635
|
-
},
|
|
636
|
-
onClick: () => previewStore.send({
|
|
637
|
-
type: "selectTarget",
|
|
638
|
-
...owner,
|
|
639
|
-
selection: ancestor.parentItemId == null ? {
|
|
640
|
-
type: "block-field",
|
|
579
|
+
}, ...ancestorChain.flatMap((ancestor, depth) => {
|
|
580
|
+
const repeater = slotSelection({
|
|
581
|
+
owner: fieldOwner({
|
|
641
582
|
blockId: block_0.id,
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
583
|
+
itemId: ancestor.parentItemId
|
|
584
|
+
}),
|
|
585
|
+
name: ancestor.fieldName,
|
|
586
|
+
type: "Repeater"
|
|
587
|
+
});
|
|
588
|
+
return [{
|
|
589
|
+
key: `repeater-${ancestor.id}`,
|
|
590
|
+
label: itemRepeaterSchema(blockDef_0.contentSchema, ancestorChain.slice(0, depth + 1))?.title ?? formatFieldName(ancestor.fieldName),
|
|
591
|
+
isCurrent: false,
|
|
592
|
+
hoverTarget: repeater,
|
|
593
|
+
onClick: () => previewStore.send({
|
|
594
|
+
type: "selectTarget",
|
|
595
|
+
...owner,
|
|
596
|
+
selection: repeater
|
|
597
|
+
})
|
|
598
|
+
}, {
|
|
599
|
+
key: `item-${ancestor.id}`,
|
|
600
|
+
label: entityName(ancestor, "Item"),
|
|
601
|
+
hoverTarget: {
|
|
602
|
+
type: "item",
|
|
646
603
|
blockId: block_0.id,
|
|
647
|
-
itemId: ancestor.
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
itemId: ancestor.id
|
|
666
|
-
})
|
|
667
|
-
}])];
|
|
668
|
-
$[90] = ancestorChain;
|
|
669
|
-
$[91] = currentItemId;
|
|
670
|
-
$[92] = fieldHasOwnView;
|
|
671
|
-
$[93] = itemsMap;
|
|
672
|
-
$[94] = owner;
|
|
673
|
-
$[95] = recordView;
|
|
674
|
-
$[96] = t34;
|
|
675
|
-
} else t34 = $[96];
|
|
604
|
+
itemId: ancestor.id
|
|
605
|
+
},
|
|
606
|
+
isCurrent: ancestor.id === currentItemId && !fieldHasOwnView && !recordView && ancestor.id === ancestorChain[ancestorChain.length - 1]?.id,
|
|
607
|
+
onClick: () => previewStore.send({
|
|
608
|
+
type: "selectItem",
|
|
609
|
+
...owner,
|
|
610
|
+
blockId: block_0.id,
|
|
611
|
+
itemId: ancestor.id
|
|
612
|
+
})
|
|
613
|
+
}];
|
|
614
|
+
})];
|
|
615
|
+
$[88] = ancestorChain;
|
|
616
|
+
$[89] = currentItemId;
|
|
617
|
+
$[90] = fieldHasOwnView;
|
|
618
|
+
$[91] = owner;
|
|
619
|
+
$[92] = recordView;
|
|
620
|
+
$[93] = t34;
|
|
621
|
+
} else t34 = $[93];
|
|
676
622
|
const blockCrumbs = t34;
|
|
677
623
|
const navigationItems = [
|
|
678
624
|
{
|
|
@@ -702,11 +648,11 @@ const SelectionEditorContent = (t0) => {
|
|
|
702
648
|
const t38 = rows.map((row, index) => {
|
|
703
649
|
const distance = rows.length - 1 - index;
|
|
704
650
|
const covered = distance > 0;
|
|
705
|
-
const
|
|
651
|
+
const depth_0 = firstDepth + row.index;
|
|
706
652
|
if (row.collapsed) return /* @__PURE__ */ jsx("li", {
|
|
707
653
|
className: "relative flex flex-col",
|
|
708
654
|
children: /* @__PURE__ */ jsx(SidebarStackHeader, {
|
|
709
|
-
depth,
|
|
655
|
+
depth: depth_0,
|
|
710
656
|
distance,
|
|
711
657
|
popover: /* @__PURE__ */ jsx("ol", {
|
|
712
658
|
"aria-label": "Collapsed parents",
|
|
@@ -726,7 +672,7 @@ const SelectionEditorContent = (t0) => {
|
|
|
726
672
|
return /* @__PURE__ */ jsx("li", {
|
|
727
673
|
className: "relative flex flex-col",
|
|
728
674
|
children: /* @__PURE__ */ jsx(SidebarStackHeader, {
|
|
729
|
-
depth,
|
|
675
|
+
depth: depth_0,
|
|
730
676
|
distance,
|
|
731
677
|
first: pageCrumb && row.index === 0,
|
|
732
678
|
onSelect: item_0.onClick,
|
|
@@ -739,7 +685,7 @@ const SelectionEditorContent = (t0) => {
|
|
|
739
685
|
}, item_0.key);
|
|
740
686
|
});
|
|
741
687
|
let t39;
|
|
742
|
-
if ($[
|
|
688
|
+
if ($[94] !== t38) {
|
|
743
689
|
t39 = /* @__PURE__ */ jsx("nav", {
|
|
744
690
|
"aria-label": t35,
|
|
745
691
|
className: t36,
|
|
@@ -748,13 +694,13 @@ const SelectionEditorContent = (t0) => {
|
|
|
748
694
|
children: t38
|
|
749
695
|
})
|
|
750
696
|
});
|
|
751
|
-
$[
|
|
752
|
-
$[
|
|
753
|
-
} else t39 = $[
|
|
697
|
+
$[94] = t38;
|
|
698
|
+
$[95] = t39;
|
|
699
|
+
} else t39 = $[95];
|
|
754
700
|
const t40 = `${block?.id ?? "layout"}:${front?.key}`;
|
|
755
701
|
const t41 = firstDepth + stackedItems.length - 1;
|
|
756
702
|
let t42;
|
|
757
|
-
if ($[
|
|
703
|
+
if ($[96] !== addSibling || $[97] !== assetAccept || $[98] !== assetFieldName || $[99] !== assetType || $[100] !== block || $[101] !== blockDef || $[102] !== canAddSibling || $[103] !== canRemoveCurrent || $[104] !== currentData || $[105] !== currentItem || $[106] !== currentItemId || $[107] !== currentSchema || $[108] !== fieldHasOwnView || $[109] !== fieldIdPrefix || $[110] !== fieldInfo || $[111] !== filesMap || $[112] !== findings || $[113] !== isItemLoading || $[114] !== isMultipleAsset || $[115] !== isViewingAsset || $[116] !== isViewingLink || $[117] !== itemArraySchema || $[118] !== itemSettingsFields || $[119] !== itemsMap || $[120] !== linkFieldName || $[121] !== owner || $[122] !== recordInList || $[123] !== recordView || $[124] !== removeCurrent || $[125] !== send || $[126] !== settingsFields || $[127] !== updateRepeatableSettings || $[128] !== updateSettings || $[129] !== writeField) {
|
|
758
704
|
t42 = /* @__PURE__ */ jsx("div", { children: isItemLoading ? /* @__PURE__ */ jsx("div", {
|
|
759
705
|
className: "flex h-full items-center justify-center py-12",
|
|
760
706
|
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
@@ -971,54 +917,54 @@ const SelectionEditorContent = (t0) => {
|
|
|
971
917
|
field: fieldInfo.fieldName
|
|
972
918
|
})
|
|
973
919
|
] }) });
|
|
974
|
-
$[
|
|
975
|
-
$[
|
|
976
|
-
$[
|
|
977
|
-
$[
|
|
978
|
-
$[
|
|
979
|
-
$[
|
|
980
|
-
$[
|
|
981
|
-
$[
|
|
982
|
-
$[
|
|
983
|
-
$[
|
|
984
|
-
$[
|
|
985
|
-
$[
|
|
986
|
-
$[
|
|
987
|
-
$[
|
|
988
|
-
$[
|
|
989
|
-
$[
|
|
990
|
-
$[
|
|
991
|
-
$[
|
|
992
|
-
$[
|
|
993
|
-
$[
|
|
994
|
-
$[
|
|
995
|
-
$[
|
|
996
|
-
$[
|
|
997
|
-
$[
|
|
998
|
-
$[
|
|
999
|
-
$[
|
|
1000
|
-
$[
|
|
1001
|
-
$[
|
|
1002
|
-
$[
|
|
1003
|
-
$[
|
|
1004
|
-
$[
|
|
1005
|
-
$[
|
|
1006
|
-
$[
|
|
1007
|
-
$[
|
|
1008
|
-
$[
|
|
1009
|
-
} else t42 = $[
|
|
920
|
+
$[96] = addSibling;
|
|
921
|
+
$[97] = assetAccept;
|
|
922
|
+
$[98] = assetFieldName;
|
|
923
|
+
$[99] = assetType;
|
|
924
|
+
$[100] = block;
|
|
925
|
+
$[101] = blockDef;
|
|
926
|
+
$[102] = canAddSibling;
|
|
927
|
+
$[103] = canRemoveCurrent;
|
|
928
|
+
$[104] = currentData;
|
|
929
|
+
$[105] = currentItem;
|
|
930
|
+
$[106] = currentItemId;
|
|
931
|
+
$[107] = currentSchema;
|
|
932
|
+
$[108] = fieldHasOwnView;
|
|
933
|
+
$[109] = fieldIdPrefix;
|
|
934
|
+
$[110] = fieldInfo;
|
|
935
|
+
$[111] = filesMap;
|
|
936
|
+
$[112] = findings;
|
|
937
|
+
$[113] = isItemLoading;
|
|
938
|
+
$[114] = isMultipleAsset;
|
|
939
|
+
$[115] = isViewingAsset;
|
|
940
|
+
$[116] = isViewingLink;
|
|
941
|
+
$[117] = itemArraySchema;
|
|
942
|
+
$[118] = itemSettingsFields;
|
|
943
|
+
$[119] = itemsMap;
|
|
944
|
+
$[120] = linkFieldName;
|
|
945
|
+
$[121] = owner;
|
|
946
|
+
$[122] = recordInList;
|
|
947
|
+
$[123] = recordView;
|
|
948
|
+
$[124] = removeCurrent;
|
|
949
|
+
$[125] = send;
|
|
950
|
+
$[126] = settingsFields;
|
|
951
|
+
$[127] = updateRepeatableSettings;
|
|
952
|
+
$[128] = updateSettings;
|
|
953
|
+
$[129] = writeField;
|
|
954
|
+
$[130] = t42;
|
|
955
|
+
} else t42 = $[130];
|
|
1010
956
|
let t43;
|
|
1011
|
-
if ($[
|
|
957
|
+
if ($[131] !== t40 || $[132] !== t41 || $[133] !== t42) {
|
|
1012
958
|
t43 = /* @__PURE__ */ jsx(SidebarStackView, {
|
|
1013
959
|
depth: t41,
|
|
1014
960
|
className: "relative min-w-0 overflow-x-hidden overflow-y-auto",
|
|
1015
961
|
children: t42
|
|
1016
962
|
}, t40);
|
|
1017
|
-
$[
|
|
1018
|
-
$[
|
|
1019
|
-
$[
|
|
1020
|
-
$[
|
|
1021
|
-
} else t43 = $[
|
|
963
|
+
$[131] = t40;
|
|
964
|
+
$[132] = t41;
|
|
965
|
+
$[133] = t42;
|
|
966
|
+
$[134] = t43;
|
|
967
|
+
} else t43 = $[134];
|
|
1022
968
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1023
969
|
/* @__PURE__ */ jsx(SelectionViewCount, { count: rows.length }),
|
|
1024
970
|
t39,
|
|
@@ -1053,4 +999,4 @@ function _temp6(item) {
|
|
|
1053
999
|
}
|
|
1054
1000
|
|
|
1055
1001
|
//#endregion
|
|
1056
|
-
export { SelectionEditor
|
|
1002
|
+
export { SelectionEditor };
|