camox 0.52.3 → 0.54.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/editing/createEditableBlock.js +1 -1
- package/dist/features/canvas/CamoxCanvas.js +103 -83
- package/dist/features/canvas/CanvasPageFrame.js +1 -1
- package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -1
- package/dist/features/canvas/canvasCamera.js +3 -3
- package/dist/features/canvas/sidebar/CanvasInspector.js +4 -159
- package/dist/features/canvas/sidebar/CanvasNavigator.js +41 -85
- package/dist/features/canvas/sidebar/CanvasSidebar.js +54 -32
- package/dist/features/canvas/sidebar/CanvasSidebarFrame.js +4 -3
- package/dist/features/canvas/sidebar/CanvasSidebarSkeleton.js +14 -6
- package/dist/features/canvas/sidebar/CanvasViewHeader.js +50 -0
- package/dist/features/canvas/sidebar/DerivedPageInspector.js +30 -18
- package/dist/features/canvas/sidebar/LayoutPageOverview.js +28 -11
- package/dist/features/canvas/sidebar/LayoutPageSeo.js +356 -0
- package/dist/features/canvas/sidebar/PageInspector.js +118 -80
- package/dist/features/canvas/sidebar/PageOverview.js +6 -1
- package/dist/features/canvas/sidebar/SingletonPageInspector.js +22 -14
- package/dist/features/canvas/useCanvasCamera.js +36 -39
- package/dist/features/og/documentFonts.js +49 -0
- package/dist/features/og/imageResponse.d.ts +14 -5
- package/dist/features/og/imageResponse.js +20 -21
- package/dist/features/og/pageImage.js +7 -4
- package/dist/features/preview/CamoxPreview.js +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +2 -2
- package/dist/features/preview/components/BlockThumbnail.js +1 -1
- package/dist/features/preview/components/CanvasPreview.js +1 -1
- package/dist/features/preview/components/CreatePageModal.js +1 -1
- package/dist/features/preview/components/IconFieldEditor.js +1 -1
- package/dist/features/preview/components/ItemFieldsEditor.js +1 -1
- package/dist/features/preview/components/LinkFieldEditor.js +1 -1
- package/dist/features/preview/components/OverlayTracker.js +1 -1
- package/dist/features/preview/components/PageInfo.js +345 -228
- package/dist/features/preview/components/PagePicker.js +1 -1
- package/dist/features/preview/components/PageTree.js +1 -1
- package/dist/features/preview/components/PreviewPanel.js +1 -1
- package/dist/features/preview/components/PreviewToolbar.js +2 -2
- package/dist/features/preview/components/RepeatableItemsList.js +1 -1
- package/dist/features/preview/components/SelectionEditor.js +668 -652
- package/dist/features/preview/components/SidebarStack.js +582 -0
- package/dist/features/preview/components/StudioEditingFallback.js +2 -2
- package/dist/features/renderer/RendererFrames.js +34 -27
- package/dist/features/runtime/RuntimeChrome.js +1 -1
- package/dist/features/runtime/runtime.d.ts +5 -0
- package/dist/features/runtime/runtime.js +99 -30
- package/dist/features/studio/components/ChatSidebar.js +76 -86
- package/dist/features/studio/components/Navbar.js +1 -1
- package/dist/features/studio/components/Squareling.js +114 -0
- package/dist/features/studio/components/ThreadMessages.js +128 -126
- package/dist/features/studio/components/UserButton.js +1 -1
- package/dist/features/vite/bundlerLogs.js +1 -0
- package/dist/features/vite/runtimeDev.js +11 -0
- package/dist/features/vite/vite.js +3 -1
- package/dist/lib/studio-reads.js +18 -0
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +5 -5
- package/skills/camox/references/layout-definitions.md +11 -16
- package/dist/features/og/defaultFonts.js +0 -31
- package/dist/features/og/geist-variable-ttf-base64.js +0 -21
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { isFileMarker } from "../../../lib/normalized-data.js";
|
|
2
2
|
import { reads, useReadQueries, useReadQuery } from "../../../lib/studio-reads.js";
|
|
3
|
-
import { cn } from "../../../lib/utils.js";
|
|
4
3
|
import { blockMutations, repeatableItemMutations } from "../../../lib/queries.js";
|
|
5
4
|
import { SingleAssetFieldEditor } from "./AssetFieldEditor.js";
|
|
6
5
|
import { MultipleAssetFieldEditor } from "./MultipleAssetFieldEditor.js";
|
|
7
6
|
import { useBlockDefinition } from "../../../lib/studio-definitions.js";
|
|
8
7
|
import { editorAssetField } from "../../content/collection-form.js";
|
|
9
8
|
import { isBlockPlacement, previewStore, recordPlacement, selectionBlockId, selectionField, selectionForOwner, selectionItemId } from "../previewStore.js";
|
|
10
|
-
import { PreviewEditingOwnerContext } from "../previewSelection.js";
|
|
11
9
|
import { useEditingFrame } from "../editingFrame.js";
|
|
10
|
+
import { SelectionViewCount, SidebarStackHeader, SidebarStackView } from "./SidebarStack.js";
|
|
11
|
+
import { PreviewEditingOwnerContext } from "../previewSelection.js";
|
|
12
12
|
import { entityName } from "../entityName.js";
|
|
13
13
|
import { fieldTypesDictionary } from "../../../core/lib/fieldTypes.js";
|
|
14
|
-
import { selectionHoverMessage } from "../overlayMessages.js";
|
|
15
14
|
import { usePageRecordPlacer } from "../pageRecord.js";
|
|
16
15
|
import { contentFieldSchema } from "./contentFieldSchema.js";
|
|
17
16
|
import { useRepeatableItemActions } from "./useRepeatableItemActions.js";
|
|
@@ -28,13 +27,33 @@ import { useMutation } from "@tanstack/react-query";
|
|
|
28
27
|
import { Button } from "@camox/ui/button";
|
|
29
28
|
import { Label } from "@camox/ui/label";
|
|
30
29
|
import { Switch } from "@camox/ui/switch";
|
|
31
|
-
import { CirclePlus, Trash2 } from "lucide-react";
|
|
30
|
+
import { CirclePlus, Ellipsis, Trash2 } from "lucide-react";
|
|
32
31
|
import { ButtonGroup } from "@camox/ui/button-group";
|
|
33
32
|
import { Spinner } from "@camox/ui/spinner";
|
|
34
33
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
|
|
35
34
|
|
|
36
35
|
//#region src/features/preview/components/SelectionEditor.tsx
|
|
37
36
|
const EMPTY_CONTENT = {};
|
|
37
|
+
/**
|
|
38
|
+
* The path's headers. The `kept` first steps, the selection and its parent always show; two or
|
|
39
|
+
* more steps between them collapse into one header, which lists them.
|
|
40
|
+
*/
|
|
41
|
+
function stackRows(items, kept) {
|
|
42
|
+
const rows = items.map((item, index) => ({
|
|
43
|
+
index,
|
|
44
|
+
item
|
|
45
|
+
}));
|
|
46
|
+
const between = items.slice(kept, -2);
|
|
47
|
+
if (between.length < 2) return rows;
|
|
48
|
+
return [
|
|
49
|
+
...rows.slice(0, kept),
|
|
50
|
+
{
|
|
51
|
+
index: kept,
|
|
52
|
+
collapsed: between
|
|
53
|
+
},
|
|
54
|
+
...rows.slice(kept + between.length)
|
|
55
|
+
];
|
|
56
|
+
}
|
|
38
57
|
const getSettingsFields = (schema) => {
|
|
39
58
|
const properties = schema?.properties;
|
|
40
59
|
if (!properties) return [];
|
|
@@ -101,21 +120,27 @@ const buildAncestorChain = (itemId, itemsMap) => {
|
|
|
101
120
|
}
|
|
102
121
|
return chain;
|
|
103
122
|
};
|
|
104
|
-
const SelectionEditor = () => {
|
|
105
|
-
const $ = c(
|
|
123
|
+
const SelectionEditor = (t0) => {
|
|
124
|
+
const $ = c(3);
|
|
125
|
+
const { pageCrumb: t1 } = t0;
|
|
126
|
+
const pageCrumb = t1 === void 0 ? true : t1;
|
|
106
127
|
const owner = React.useContext(PreviewEditingOwnerContext);
|
|
107
128
|
if (owner == null) return null;
|
|
108
|
-
let
|
|
109
|
-
if ($[0] !== owner) {
|
|
110
|
-
|
|
129
|
+
let t2;
|
|
130
|
+
if ($[0] !== owner || $[1] !== pageCrumb) {
|
|
131
|
+
t2 = /* @__PURE__ */ jsx(SelectionEditorContent, {
|
|
132
|
+
owner,
|
|
133
|
+
pageCrumb
|
|
134
|
+
});
|
|
111
135
|
$[0] = owner;
|
|
112
|
-
$[1] =
|
|
113
|
-
|
|
114
|
-
|
|
136
|
+
$[1] = pageCrumb;
|
|
137
|
+
$[2] = t2;
|
|
138
|
+
} else t2 = $[2];
|
|
139
|
+
return t2;
|
|
115
140
|
};
|
|
116
141
|
const SelectionEditorContent = (t0) => {
|
|
117
|
-
const $ = c(
|
|
118
|
-
const { owner } = t0;
|
|
142
|
+
const $ = c(131);
|
|
143
|
+
const { owner, pageCrumb } = t0;
|
|
119
144
|
let t1;
|
|
120
145
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
121
146
|
t1 = blockMutations.updateSettings();
|
|
@@ -136,308 +161,284 @@ const SelectionEditorContent = (t0) => {
|
|
|
136
161
|
} else t3 = $[3];
|
|
137
162
|
const selection = useSelector(previewStore, t3);
|
|
138
163
|
const { send } = useEditingFrame();
|
|
139
|
-
|
|
164
|
+
let blockId;
|
|
165
|
+
let currentItemId;
|
|
140
166
|
let t4;
|
|
141
167
|
let t5;
|
|
142
|
-
if ($[4] !==
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
send,
|
|
151
|
-
selection
|
|
152
|
-
];
|
|
153
|
-
$[4] = hoveredBreadcrumb;
|
|
154
|
-
$[5] = selection;
|
|
155
|
-
$[6] = send;
|
|
168
|
+
if ($[4] !== selection) {
|
|
169
|
+
blockId = selectionBlockId(selection);
|
|
170
|
+
currentItemId = selectionItemId(selection);
|
|
171
|
+
t4 = useReadQuery;
|
|
172
|
+
t5 = reads.blockBundle(blockId);
|
|
173
|
+
$[4] = selection;
|
|
174
|
+
$[5] = blockId;
|
|
175
|
+
$[6] = currentItemId;
|
|
156
176
|
$[7] = t4;
|
|
157
177
|
$[8] = t5;
|
|
158
178
|
} else {
|
|
179
|
+
blockId = $[5];
|
|
180
|
+
currentItemId = $[6];
|
|
159
181
|
t4 = $[7];
|
|
160
182
|
t5 = $[8];
|
|
161
183
|
}
|
|
162
|
-
|
|
163
|
-
let blockId;
|
|
164
|
-
let currentItemId;
|
|
165
|
-
let t6;
|
|
184
|
+
const t6 = blockId != null;
|
|
166
185
|
let t7;
|
|
167
|
-
if ($[9] !==
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
$[10] = blockId;
|
|
174
|
-
$[11] = currentItemId;
|
|
175
|
-
$[12] = t6;
|
|
176
|
-
$[13] = t7;
|
|
177
|
-
} else {
|
|
178
|
-
blockId = $[10];
|
|
179
|
-
currentItemId = $[11];
|
|
180
|
-
t6 = $[12];
|
|
181
|
-
t7 = $[13];
|
|
182
|
-
}
|
|
183
|
-
const t8 = blockId != null;
|
|
184
|
-
let t9;
|
|
185
|
-
if ($[14] !== t8) {
|
|
186
|
-
t9 = { enabled: t8 };
|
|
187
|
-
$[14] = t8;
|
|
188
|
-
$[15] = t9;
|
|
189
|
-
} else t9 = $[15];
|
|
190
|
-
const { data: blockBundle } = t6(t7, t9);
|
|
186
|
+
if ($[9] !== t6) {
|
|
187
|
+
t7 = { enabled: t6 };
|
|
188
|
+
$[9] = t6;
|
|
189
|
+
$[10] = t7;
|
|
190
|
+
} else t7 = $[10];
|
|
191
|
+
const { data: blockBundle } = t4(t5, t7);
|
|
191
192
|
const block = blockBundle?.block ?? null;
|
|
192
193
|
blockBundle?.repeatableItems;
|
|
194
|
+
let t8;
|
|
195
|
+
if ($[11] !== blockBundle?.repeatableItems) {
|
|
196
|
+
t8 = blockBundle?.repeatableItems ?? [];
|
|
197
|
+
$[11] = blockBundle?.repeatableItems;
|
|
198
|
+
$[12] = t8;
|
|
199
|
+
} else t8 = $[12];
|
|
200
|
+
let t9;
|
|
201
|
+
if ($[13] !== t8) {
|
|
202
|
+
t9 = new Map(t8.map(_temp));
|
|
203
|
+
$[13] = t8;
|
|
204
|
+
$[14] = t9;
|
|
205
|
+
} else t9 = $[14];
|
|
206
|
+
const itemsMap = t9;
|
|
193
207
|
let t10;
|
|
194
|
-
if ($[
|
|
195
|
-
t10 = blockBundle?.
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
} else t10 = $[
|
|
208
|
+
if ($[15] !== blockBundle?.files) {
|
|
209
|
+
t10 = () => (blockBundle?.files ?? []).map(_temp2);
|
|
210
|
+
$[15] = blockBundle?.files;
|
|
211
|
+
$[16] = t10;
|
|
212
|
+
} else t10 = $[16];
|
|
213
|
+
blockBundle?.files;
|
|
199
214
|
let t11;
|
|
200
|
-
if ($[
|
|
201
|
-
t11 =
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
} else t11 = $[
|
|
205
|
-
const
|
|
215
|
+
if ($[17] !== t10) {
|
|
216
|
+
t11 = t10();
|
|
217
|
+
$[17] = t10;
|
|
218
|
+
$[18] = t11;
|
|
219
|
+
} else t11 = $[18];
|
|
220
|
+
const fileIds = t11;
|
|
206
221
|
let t12;
|
|
207
|
-
if ($[
|
|
208
|
-
t12 =
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
} else t12 = $[
|
|
222
|
+
if ($[19] !== fileIds) {
|
|
223
|
+
t12 = fileIds.map(_temp3);
|
|
224
|
+
$[19] = fileIds;
|
|
225
|
+
$[20] = t12;
|
|
226
|
+
} else t12 = $[20];
|
|
227
|
+
const fileResults = useReadQueries(t12);
|
|
212
228
|
blockBundle?.files;
|
|
213
229
|
let t13;
|
|
214
|
-
if ($[
|
|
215
|
-
t13 =
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
} else t13 = $[
|
|
219
|
-
const fileIds = t13;
|
|
220
|
-
let t14;
|
|
221
|
-
if ($[24] !== fileIds) {
|
|
222
|
-
t14 = fileIds.map(_temp3);
|
|
223
|
-
$[24] = fileIds;
|
|
224
|
-
$[25] = t14;
|
|
225
|
-
} else t14 = $[25];
|
|
226
|
-
const fileResults = useReadQueries(t14);
|
|
227
|
-
blockBundle?.files;
|
|
228
|
-
let t15;
|
|
229
|
-
if ($[26] !== blockBundle?.files) {
|
|
230
|
-
t15 = blockBundle?.files ?? [];
|
|
231
|
-
$[26] = blockBundle?.files;
|
|
232
|
-
$[27] = t15;
|
|
233
|
-
} else t15 = $[27];
|
|
230
|
+
if ($[21] !== blockBundle?.files) {
|
|
231
|
+
t13 = blockBundle?.files ?? [];
|
|
232
|
+
$[21] = blockBundle?.files;
|
|
233
|
+
$[22] = t13;
|
|
234
|
+
} else t13 = $[22];
|
|
234
235
|
let map;
|
|
235
|
-
if ($[
|
|
236
|
-
map = new Map(
|
|
236
|
+
if ($[23] !== fileIds.length || $[24] !== fileResults || $[25] !== t13) {
|
|
237
|
+
map = new Map(t13.map(_temp4));
|
|
237
238
|
for (let i_0 = 0; i_0 < fileIds.length; i_0++) {
|
|
238
239
|
const data = fileResults[i_0]?.data;
|
|
239
240
|
if (data) map.set(data.id, data);
|
|
240
241
|
}
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
} else map = $[
|
|
242
|
+
$[23] = fileIds.length;
|
|
243
|
+
$[24] = fileResults;
|
|
244
|
+
$[25] = t13;
|
|
245
|
+
$[26] = map;
|
|
246
|
+
} else map = $[26];
|
|
246
247
|
const filesMap = map;
|
|
247
248
|
const blockDef = useBlockDefinition(block?.type) ?? null;
|
|
248
249
|
const pagePlacer = usePageRecordPlacer();
|
|
249
250
|
const layoutRecordSelected = (selection?.type === "record" || selection?.type === "record-field") && !isBlockPlacement(selection);
|
|
250
|
-
let
|
|
251
|
-
if ($[
|
|
252
|
-
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
} else
|
|
257
|
-
const placerItem =
|
|
258
|
-
let
|
|
251
|
+
let t14;
|
|
252
|
+
if ($[27] !== currentItemId || $[28] !== itemsMap) {
|
|
253
|
+
t14 = currentItemId != null ? itemsMap.get(currentItemId) : void 0;
|
|
254
|
+
$[27] = currentItemId;
|
|
255
|
+
$[28] = itemsMap;
|
|
256
|
+
$[29] = t14;
|
|
257
|
+
} else t14 = $[29];
|
|
258
|
+
const placerItem = t14;
|
|
259
|
+
let t15;
|
|
259
260
|
bb0: {
|
|
260
261
|
if (!block || !blockDef) {
|
|
261
|
-
|
|
262
|
+
t15 = null;
|
|
262
263
|
break bb0;
|
|
263
264
|
}
|
|
264
265
|
if (currentItemId == null) {
|
|
265
|
-
let
|
|
266
|
-
if ($[
|
|
267
|
-
|
|
266
|
+
let t16;
|
|
267
|
+
if ($[30] !== block || $[31] !== blockDef.contentSchema) {
|
|
268
|
+
t16 = {
|
|
268
269
|
...block,
|
|
269
270
|
contentSchema: blockDef.contentSchema
|
|
270
271
|
};
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
} else
|
|
275
|
-
|
|
272
|
+
$[30] = block;
|
|
273
|
+
$[31] = blockDef.contentSchema;
|
|
274
|
+
$[32] = t16;
|
|
275
|
+
} else t16 = $[32];
|
|
276
|
+
t15 = t16;
|
|
276
277
|
break bb0;
|
|
277
278
|
}
|
|
278
279
|
if (!placerItem) {
|
|
279
|
-
|
|
280
|
+
t15 = null;
|
|
280
281
|
break bb0;
|
|
281
282
|
}
|
|
282
|
-
let
|
|
283
|
-
if ($[
|
|
284
|
-
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
} else
|
|
290
|
-
let
|
|
291
|
-
if ($[
|
|
292
|
-
|
|
283
|
+
let t16;
|
|
284
|
+
if ($[33] !== blockDef.contentSchema || $[34] !== currentItemId || $[35] !== itemsMap) {
|
|
285
|
+
t16 = getSchemaForItem(blockDef.contentSchema, currentItemId, itemsMap);
|
|
286
|
+
$[33] = blockDef.contentSchema;
|
|
287
|
+
$[34] = currentItemId;
|
|
288
|
+
$[35] = itemsMap;
|
|
289
|
+
$[36] = t16;
|
|
290
|
+
} else t16 = $[36];
|
|
291
|
+
let t17;
|
|
292
|
+
if ($[37] !== placerItem || $[38] !== t16) {
|
|
293
|
+
t17 = {
|
|
293
294
|
...placerItem,
|
|
294
|
-
contentSchema:
|
|
295
|
+
contentSchema: t16
|
|
295
296
|
};
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
} else
|
|
300
|
-
|
|
297
|
+
$[37] = placerItem;
|
|
298
|
+
$[38] = t16;
|
|
299
|
+
$[39] = t17;
|
|
300
|
+
} else t17 = $[39];
|
|
301
|
+
t15 = t17;
|
|
301
302
|
}
|
|
302
|
-
const
|
|
303
|
-
let
|
|
304
|
-
if ($[
|
|
305
|
-
|
|
303
|
+
const t16 = layoutRecordSelected ? pagePlacer : t15;
|
|
304
|
+
let t17;
|
|
305
|
+
if ($[40] !== owner || $[41] !== selection || $[42] !== t16) {
|
|
306
|
+
t17 = {
|
|
306
307
|
owner,
|
|
307
308
|
selection,
|
|
308
|
-
placer:
|
|
309
|
+
placer: t16
|
|
309
310
|
};
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
} else
|
|
315
|
-
const { recordView, viewSelection, recordCrumbs } = useRecordView(
|
|
311
|
+
$[40] = owner;
|
|
312
|
+
$[41] = selection;
|
|
313
|
+
$[42] = t16;
|
|
314
|
+
$[43] = t17;
|
|
315
|
+
} else t17 = $[43];
|
|
316
|
+
const { recordView, viewSelection, recordCrumbs } = useRecordView(t17);
|
|
316
317
|
const selectedField = recordView?.selection.type === "record-field" ? {
|
|
317
318
|
fieldName: recordView.selection.recordFieldName,
|
|
318
319
|
fieldType: recordView.selection.recordFieldType
|
|
319
320
|
} : selectionField(viewSelection);
|
|
320
|
-
let
|
|
321
|
-
if ($[
|
|
322
|
-
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
325
|
-
} else
|
|
326
|
-
const settingsFields =
|
|
327
|
-
let
|
|
321
|
+
let t18;
|
|
322
|
+
if ($[44] !== blockDef) {
|
|
323
|
+
t18 = blockDef ? getSettingsFields(blockDef.settingsSchema) : [];
|
|
324
|
+
$[44] = blockDef;
|
|
325
|
+
$[45] = t18;
|
|
326
|
+
} else t18 = $[45];
|
|
327
|
+
const settingsFields = t18;
|
|
328
|
+
let t19;
|
|
328
329
|
bb1: {
|
|
329
330
|
if (!blockDef || currentItemId == null) {
|
|
330
|
-
|
|
331
|
+
t19 = null;
|
|
331
332
|
break bb1;
|
|
332
333
|
}
|
|
333
|
-
let
|
|
334
|
-
if ($[
|
|
335
|
-
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
} else
|
|
341
|
-
|
|
334
|
+
let t20;
|
|
335
|
+
if ($[46] !== blockDef.contentSchema || $[47] !== currentItemId || $[48] !== itemsMap) {
|
|
336
|
+
t20 = getArraySchemaForItem(blockDef.contentSchema, currentItemId, itemsMap);
|
|
337
|
+
$[46] = blockDef.contentSchema;
|
|
338
|
+
$[47] = currentItemId;
|
|
339
|
+
$[48] = itemsMap;
|
|
340
|
+
$[49] = t20;
|
|
341
|
+
} else t20 = $[49];
|
|
342
|
+
t19 = t20;
|
|
342
343
|
}
|
|
343
|
-
const itemArraySchema =
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
if ($[
|
|
347
|
-
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
} else
|
|
351
|
-
const itemSettingsFields =
|
|
344
|
+
const itemArraySchema = t19;
|
|
345
|
+
const t20 = itemArraySchema?.itemSettingsSchema;
|
|
346
|
+
let t21;
|
|
347
|
+
if ($[50] !== t20) {
|
|
348
|
+
t21 = getSettingsFields(t20);
|
|
349
|
+
$[50] = t20;
|
|
350
|
+
$[51] = t21;
|
|
351
|
+
} else t21 = $[51];
|
|
352
|
+
const itemSettingsFields = t21;
|
|
352
353
|
const recordSchema = recordView?.collection.contentSchema;
|
|
353
354
|
const recordInList = recordView?.inList === true;
|
|
354
|
-
let
|
|
355
|
+
let t22;
|
|
355
356
|
bb2: {
|
|
356
357
|
if (recordSchema) {
|
|
357
|
-
|
|
358
|
+
t22 = recordSchema;
|
|
358
359
|
break bb2;
|
|
359
360
|
}
|
|
360
361
|
if (!blockDef) {
|
|
361
|
-
|
|
362
|
+
t22 = null;
|
|
362
363
|
break bb2;
|
|
363
364
|
}
|
|
364
365
|
if (currentItemId == null) {
|
|
365
|
-
|
|
366
|
+
t22 = blockDef.contentSchema;
|
|
366
367
|
break bb2;
|
|
367
368
|
}
|
|
368
|
-
let
|
|
369
|
-
if ($[
|
|
370
|
-
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
} else
|
|
376
|
-
|
|
369
|
+
let t23;
|
|
370
|
+
if ($[52] !== blockDef.contentSchema || $[53] !== currentItemId || $[54] !== itemsMap) {
|
|
371
|
+
t23 = getSchemaForItem(blockDef.contentSchema, currentItemId, itemsMap);
|
|
372
|
+
$[52] = blockDef.contentSchema;
|
|
373
|
+
$[53] = currentItemId;
|
|
374
|
+
$[54] = itemsMap;
|
|
375
|
+
$[55] = t23;
|
|
376
|
+
} else t23 = $[55];
|
|
377
|
+
t22 = t23;
|
|
377
378
|
}
|
|
378
|
-
const currentSchema =
|
|
379
|
-
let
|
|
380
|
-
if ($[
|
|
381
|
-
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
} else
|
|
386
|
-
const currentItem =
|
|
379
|
+
const currentSchema = t22;
|
|
380
|
+
let t23;
|
|
381
|
+
if ($[56] !== currentItemId || $[57] !== itemsMap) {
|
|
382
|
+
t23 = currentItemId != null ? itemsMap.get(currentItemId) : null;
|
|
383
|
+
$[56] = currentItemId;
|
|
384
|
+
$[57] = itemsMap;
|
|
385
|
+
$[58] = t23;
|
|
386
|
+
} else t23 = $[58];
|
|
387
|
+
const currentItem = t23;
|
|
387
388
|
const isItemLoading = currentItemId != null && !currentItem;
|
|
388
|
-
let
|
|
389
|
+
let t24;
|
|
389
390
|
bb3: {
|
|
390
391
|
if (!currentItem) {
|
|
391
|
-
|
|
392
|
+
t24 = 0;
|
|
392
393
|
break bb3;
|
|
393
394
|
}
|
|
394
395
|
let count = 0;
|
|
395
396
|
for (const it of itemsMap.values()) if (it.fieldName === currentItem.fieldName && it.parentItemId === currentItem.parentItemId) count++;
|
|
396
|
-
|
|
397
|
+
t24 = count;
|
|
397
398
|
}
|
|
398
|
-
const siblingCount =
|
|
399
|
-
const
|
|
400
|
-
const
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
let
|
|
404
|
-
if ($[
|
|
405
|
-
|
|
406
|
-
blockId:
|
|
407
|
-
fieldName:
|
|
408
|
-
parentItemId:
|
|
409
|
-
arraySchema:
|
|
399
|
+
const siblingCount = t24;
|
|
400
|
+
const t25 = block?.id ?? "";
|
|
401
|
+
const t26 = currentItem?.fieldName ?? "";
|
|
402
|
+
const t27 = currentItem?.parentItemId ?? null;
|
|
403
|
+
const t28 = itemArraySchema;
|
|
404
|
+
let t29;
|
|
405
|
+
if ($[59] !== siblingCount || $[60] !== t25 || $[61] !== t26 || $[62] !== t27 || $[63] !== t28) {
|
|
406
|
+
t29 = {
|
|
407
|
+
blockId: t25,
|
|
408
|
+
fieldName: t26,
|
|
409
|
+
parentItemId: t27,
|
|
410
|
+
arraySchema: t28,
|
|
410
411
|
siblingCount
|
|
411
412
|
};
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
418
|
-
} else
|
|
419
|
-
const { canAdd: canAddSibling, addItem: addSibling, canRemove: canRemoveCurrent, removeItem: removeCurrent } = useRepeatableItemActions(
|
|
413
|
+
$[59] = siblingCount;
|
|
414
|
+
$[60] = t25;
|
|
415
|
+
$[61] = t26;
|
|
416
|
+
$[62] = t27;
|
|
417
|
+
$[63] = t28;
|
|
418
|
+
$[64] = t29;
|
|
419
|
+
} else t29 = $[64];
|
|
420
|
+
const { canAdd: canAddSibling, addItem: addSibling, canRemove: canRemoveCurrent, removeItem: removeCurrent } = useRepeatableItemActions(t29);
|
|
420
421
|
const recordContent = recordView?.record.content;
|
|
421
422
|
const rawCurrentData = currentItem ? currentItem.content : block?.content ?? EMPTY_CONTENT;
|
|
422
|
-
let
|
|
423
|
+
let t30;
|
|
423
424
|
bb4: {
|
|
424
425
|
if (recordContent) {
|
|
425
|
-
let
|
|
426
|
-
if ($[
|
|
427
|
-
|
|
428
|
-
const [key, value] =
|
|
426
|
+
let t31;
|
|
427
|
+
if ($[65] !== recordContent || $[66] !== recordSchema) {
|
|
428
|
+
t31 = Object.fromEntries(Object.entries(recordContent).map((t32) => {
|
|
429
|
+
const [key, value] = t32;
|
|
429
430
|
return [key, editorAssetField(contentFieldSchema(recordSchema, key)?.fieldType, value)];
|
|
430
431
|
}));
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
} else
|
|
435
|
-
|
|
432
|
+
$[65] = recordContent;
|
|
433
|
+
$[66] = recordSchema;
|
|
434
|
+
$[67] = t31;
|
|
435
|
+
} else t31 = $[67];
|
|
436
|
+
t30 = t31;
|
|
436
437
|
break bb4;
|
|
437
438
|
}
|
|
438
|
-
let
|
|
439
|
-
if ($[
|
|
440
|
-
|
|
439
|
+
let t31;
|
|
440
|
+
if ($[68] !== filesMap) {
|
|
441
|
+
t31 = (marker) => {
|
|
441
442
|
const file = filesMap.get(marker._fileId);
|
|
442
443
|
return file ? {
|
|
443
444
|
url: file.url,
|
|
@@ -452,12 +453,12 @@ const SelectionEditorContent = (t0) => {
|
|
|
452
453
|
mimeType: ""
|
|
453
454
|
};
|
|
454
455
|
};
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
} else
|
|
458
|
-
const resolveFile =
|
|
456
|
+
$[68] = filesMap;
|
|
457
|
+
$[69] = t31;
|
|
458
|
+
} else t31 = $[69];
|
|
459
|
+
const resolveFile = t31;
|
|
459
460
|
let resolved_0;
|
|
460
|
-
if ($[
|
|
461
|
+
if ($[70] !== rawCurrentData || $[71] !== resolveFile) {
|
|
461
462
|
const resolveValue = (value_0) => {
|
|
462
463
|
if (isFileMarker(value_0)) return resolveFile(value_0);
|
|
463
464
|
if (Array.isArray(value_0)) return value_0.map(resolveValue);
|
|
@@ -471,13 +472,13 @@ const SelectionEditorContent = (t0) => {
|
|
|
471
472
|
};
|
|
472
473
|
resolved_0 = {};
|
|
473
474
|
for (const [key_0, value_1] of Object.entries(rawCurrentData)) resolved_0[key_0] = resolveValue(value_1);
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
} else resolved_0 = $[
|
|
478
|
-
|
|
475
|
+
$[70] = rawCurrentData;
|
|
476
|
+
$[71] = resolveFile;
|
|
477
|
+
$[72] = resolved_0;
|
|
478
|
+
} else resolved_0 = $[72];
|
|
479
|
+
t30 = resolved_0;
|
|
479
480
|
}
|
|
480
|
-
const currentData =
|
|
481
|
+
const currentData = t30;
|
|
481
482
|
const fieldInfo = selectedField ? {
|
|
482
483
|
...selectedField,
|
|
483
484
|
fieldType: contentFieldSchema(currentSchema, selectedField.fieldName)?.fieldType ?? selectedField.fieldType
|
|
@@ -498,120 +499,138 @@ const SelectionEditorContent = (t0) => {
|
|
|
498
499
|
const fieldIdPrefix = React.useId();
|
|
499
500
|
const blockIdForWrites = block?.id;
|
|
500
501
|
const recordForWrites = recordView?.record;
|
|
501
|
-
let
|
|
502
|
+
let t31;
|
|
502
503
|
bb5: {
|
|
503
504
|
if (recordForWrites) {
|
|
504
|
-
let
|
|
505
|
-
if ($[
|
|
506
|
-
|
|
505
|
+
let t32;
|
|
506
|
+
if ($[73] !== recordForWrites) {
|
|
507
|
+
t32 = {
|
|
507
508
|
kind: "record",
|
|
508
509
|
record: recordForWrites
|
|
509
510
|
};
|
|
510
|
-
$[
|
|
511
|
-
$[
|
|
512
|
-
} else
|
|
513
|
-
|
|
511
|
+
$[73] = recordForWrites;
|
|
512
|
+
$[74] = t32;
|
|
513
|
+
} else t32 = $[74];
|
|
514
|
+
t31 = t32;
|
|
514
515
|
break bb5;
|
|
515
516
|
}
|
|
516
517
|
if (blockIdForWrites == null) {
|
|
517
|
-
|
|
518
|
+
t31 = null;
|
|
518
519
|
break bb5;
|
|
519
520
|
}
|
|
520
521
|
if (currentItemId == null) {
|
|
521
|
-
let
|
|
522
|
-
if ($[
|
|
523
|
-
|
|
522
|
+
let t32;
|
|
523
|
+
if ($[75] !== blockIdForWrites) {
|
|
524
|
+
t32 = {
|
|
524
525
|
kind: "block",
|
|
525
526
|
blockId: blockIdForWrites
|
|
526
527
|
};
|
|
527
|
-
$[
|
|
528
|
-
$[
|
|
529
|
-
} else
|
|
530
|
-
|
|
528
|
+
$[75] = blockIdForWrites;
|
|
529
|
+
$[76] = t32;
|
|
530
|
+
} else t32 = $[76];
|
|
531
|
+
t31 = t32;
|
|
531
532
|
break bb5;
|
|
532
533
|
}
|
|
533
|
-
let
|
|
534
|
-
if ($[
|
|
535
|
-
|
|
534
|
+
let t32;
|
|
535
|
+
if ($[77] !== blockIdForWrites || $[78] !== currentItemId) {
|
|
536
|
+
t32 = {
|
|
536
537
|
kind: "item",
|
|
537
538
|
blockId: blockIdForWrites,
|
|
538
539
|
itemId: currentItemId
|
|
539
540
|
};
|
|
540
|
-
$[
|
|
541
|
-
$[
|
|
542
|
-
$[
|
|
543
|
-
} else
|
|
544
|
-
|
|
541
|
+
$[77] = blockIdForWrites;
|
|
542
|
+
$[78] = currentItemId;
|
|
543
|
+
$[79] = t32;
|
|
544
|
+
} else t32 = $[79];
|
|
545
|
+
t31 = t32;
|
|
545
546
|
}
|
|
546
|
-
const writeField = useFieldWriter(
|
|
547
|
-
|
|
547
|
+
const writeField = useFieldWriter(t31, currentSchema);
|
|
548
|
+
let t32;
|
|
549
|
+
if ($[80] !== currentItemId || $[81] !== itemsMap) {
|
|
550
|
+
t32 = currentItemId != null ? buildAncestorChain(currentItemId, itemsMap) : [];
|
|
551
|
+
$[80] = currentItemId;
|
|
552
|
+
$[81] = itemsMap;
|
|
553
|
+
$[82] = t32;
|
|
554
|
+
} else t32 = $[82];
|
|
555
|
+
const ancestorChain = t32;
|
|
548
556
|
if (!currentSchema || !recordView && (!block || !blockDef)) {
|
|
549
|
-
let
|
|
550
|
-
if ($[
|
|
551
|
-
|
|
557
|
+
let t33;
|
|
558
|
+
if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
|
|
559
|
+
t33 = /* @__PURE__ */ jsxs("div", {
|
|
552
560
|
className: "text-muted-foreground flex flex-1 items-center justify-center px-2 text-sm",
|
|
553
561
|
children: [/* @__PURE__ */ jsx(Spinner, { className: "mr-2 size-3.5" }), " Loading block..."]
|
|
554
562
|
});
|
|
555
|
-
$[
|
|
556
|
-
} else
|
|
557
|
-
return
|
|
563
|
+
$[83] = t33;
|
|
564
|
+
} else t33 = $[83];
|
|
565
|
+
return t33;
|
|
558
566
|
}
|
|
559
567
|
const fieldHasOwnView = fieldInfo ? fieldTypesDictionary[fieldInfo.fieldType].hasOwnView : false;
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
fieldName: ancestor.fieldName,
|
|
581
|
-
fieldType: "Repeater"
|
|
582
|
-
},
|
|
583
|
-
onClick: () => previewStore.send({
|
|
584
|
-
type: "selectTarget",
|
|
585
|
-
...owner,
|
|
586
|
-
selection: ancestor.parentItemId == null ? {
|
|
568
|
+
let t33;
|
|
569
|
+
if ($[84] !== ancestorChain || $[85] !== currentItemId || $[86] !== fieldHasOwnView || $[87] !== itemsMap || $[88] !== owner || $[89] !== recordView) {
|
|
570
|
+
t33 = (block_0, blockDef_0) => [{
|
|
571
|
+
key: "block",
|
|
572
|
+
label: blockDef_0.title,
|
|
573
|
+
isCurrent: ancestorChain.length === 0 && !fieldHasOwnView && !recordView,
|
|
574
|
+
onClick: () => previewStore.send({
|
|
575
|
+
type: "setFocusedBlock",
|
|
576
|
+
...owner,
|
|
577
|
+
blockId: block_0.id
|
|
578
|
+
}),
|
|
579
|
+
hoverTarget: {
|
|
580
|
+
type: "block",
|
|
581
|
+
blockId: block_0.id
|
|
582
|
+
}
|
|
583
|
+
}, ...ancestorChain.flatMap((ancestor) => [{
|
|
584
|
+
key: `repeater-${ancestor.id}`,
|
|
585
|
+
label: getArraySchemaForItem(blockDef_0.contentSchema, ancestor.id, itemsMap)?.title ?? formatFieldName(ancestor.fieldName),
|
|
586
|
+
isCurrent: false,
|
|
587
|
+
hoverTarget: {
|
|
587
588
|
type: "block-field",
|
|
588
589
|
blockId: block_0.id,
|
|
589
590
|
fieldName: ancestor.fieldName,
|
|
590
591
|
fieldType: "Repeater"
|
|
591
|
-
}
|
|
592
|
-
|
|
592
|
+
},
|
|
593
|
+
onClick: () => previewStore.send({
|
|
594
|
+
type: "selectTarget",
|
|
595
|
+
...owner,
|
|
596
|
+
selection: ancestor.parentItemId == null ? {
|
|
597
|
+
type: "block-field",
|
|
598
|
+
blockId: block_0.id,
|
|
599
|
+
fieldName: ancestor.fieldName,
|
|
600
|
+
fieldType: "Repeater"
|
|
601
|
+
} : {
|
|
602
|
+
type: "item-field",
|
|
603
|
+
blockId: block_0.id,
|
|
604
|
+
itemId: ancestor.parentItemId,
|
|
605
|
+
fieldName: ancestor.fieldName,
|
|
606
|
+
fieldType: "Repeater"
|
|
607
|
+
}
|
|
608
|
+
})
|
|
609
|
+
}, {
|
|
610
|
+
key: `item-${ancestor.id}`,
|
|
611
|
+
label: entityName(ancestor, "Item"),
|
|
612
|
+
hoverTarget: {
|
|
613
|
+
type: "item",
|
|
593
614
|
blockId: block_0.id,
|
|
594
|
-
itemId: ancestor.
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
})
|
|
614
|
-
}])];
|
|
615
|
+
itemId: ancestor.id
|
|
616
|
+
},
|
|
617
|
+
isCurrent: ancestor.id === currentItemId && !fieldHasOwnView && !recordView && ancestor.id === ancestorChain[ancestorChain.length - 1]?.id,
|
|
618
|
+
onClick: () => previewStore.send({
|
|
619
|
+
type: "selectItem",
|
|
620
|
+
...owner,
|
|
621
|
+
blockId: block_0.id,
|
|
622
|
+
itemId: ancestor.id
|
|
623
|
+
})
|
|
624
|
+
}])];
|
|
625
|
+
$[84] = ancestorChain;
|
|
626
|
+
$[85] = currentItemId;
|
|
627
|
+
$[86] = fieldHasOwnView;
|
|
628
|
+
$[87] = itemsMap;
|
|
629
|
+
$[88] = owner;
|
|
630
|
+
$[89] = recordView;
|
|
631
|
+
$[90] = t33;
|
|
632
|
+
} else t33 = $[90];
|
|
633
|
+
const blockCrumbs = t33;
|
|
615
634
|
const navigationItems = [
|
|
616
635
|
{
|
|
617
636
|
key: "page",
|
|
@@ -630,341 +649,327 @@ const SelectionEditorContent = (t0) => {
|
|
|
630
649
|
hoverTarget: selection ?? void 0
|
|
631
650
|
}] : []
|
|
632
651
|
];
|
|
633
|
-
const
|
|
634
|
-
const
|
|
635
|
-
const
|
|
636
|
-
const
|
|
637
|
-
const
|
|
638
|
-
const
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
]
|
|
679
|
-
}), item.onClick ? /* @__PURE__ */ jsx("button", {
|
|
680
|
-
type: "button",
|
|
681
|
-
className: cn("hover:text-foreground block h-7 max-w-full cursor-pointer truncate text-left leading-7 transition-colors", item.isCurrent && "text-foreground font-medium"),
|
|
682
|
-
onClick: item.onClick,
|
|
683
|
-
children: item.label
|
|
684
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
685
|
-
className: "text-foreground block h-7 min-w-0 truncate leading-7 font-medium",
|
|
686
|
-
children: item.label
|
|
687
|
-
})]
|
|
688
|
-
}, item.key);
|
|
652
|
+
const stackedItems = pageCrumb ? navigationItems : navigationItems.slice(1);
|
|
653
|
+
const firstDepth = pageCrumb ? 1 : 2;
|
|
654
|
+
const front = stackedItems[stackedItems.length - 1];
|
|
655
|
+
const rows = stackRows(stackedItems, pageCrumb ? 1 : 0);
|
|
656
|
+
const t34 = "Selection path";
|
|
657
|
+
const t35 = "shrink-0";
|
|
658
|
+
const t36 = "flex flex-col";
|
|
659
|
+
const t37 = rows.map((row, index) => {
|
|
660
|
+
const distance = rows.length - 1 - index;
|
|
661
|
+
const covered = distance > 0;
|
|
662
|
+
const depth = firstDepth + row.index;
|
|
663
|
+
if (row.collapsed) return /* @__PURE__ */ jsx("li", {
|
|
664
|
+
className: "relative flex flex-col",
|
|
665
|
+
children: /* @__PURE__ */ jsx(SidebarStackHeader, {
|
|
666
|
+
depth,
|
|
667
|
+
distance,
|
|
668
|
+
popover: /* @__PURE__ */ jsx("ol", {
|
|
669
|
+
"aria-label": "Collapsed parents",
|
|
670
|
+
className: "flex flex-col",
|
|
671
|
+
children: row.collapsed.map(_temp6)
|
|
672
|
+
}),
|
|
673
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
674
|
+
className: "flex min-w-0 items-center gap-1.5",
|
|
675
|
+
children: [/* @__PURE__ */ jsx(Ellipsis, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ jsxs("span", {
|
|
676
|
+
className: "truncate",
|
|
677
|
+
children: [row.collapsed.length, " parents"]
|
|
678
|
+
})]
|
|
679
|
+
})
|
|
680
|
+
})
|
|
681
|
+
}, "collapsed-parents");
|
|
682
|
+
const { item: item_0 } = row;
|
|
683
|
+
return /* @__PURE__ */ jsx("li", {
|
|
684
|
+
className: "relative flex flex-col",
|
|
685
|
+
children: /* @__PURE__ */ jsx(SidebarStackHeader, {
|
|
686
|
+
depth,
|
|
687
|
+
distance,
|
|
688
|
+
first: pageCrumb && row.index === 0,
|
|
689
|
+
onSelect: item_0.onClick,
|
|
690
|
+
hoverTarget: item_0.hoverTarget,
|
|
691
|
+
children: covered ? item_0.label : /* @__PURE__ */ jsx("span", {
|
|
692
|
+
className: "truncate font-medium",
|
|
693
|
+
children: item_0.label
|
|
694
|
+
})
|
|
695
|
+
})
|
|
696
|
+
}, item_0.key);
|
|
689
697
|
});
|
|
690
|
-
let
|
|
691
|
-
if ($[
|
|
692
|
-
|
|
693
|
-
"aria-label":
|
|
694
|
-
className:
|
|
698
|
+
let t38;
|
|
699
|
+
if ($[91] !== t37) {
|
|
700
|
+
t38 = /* @__PURE__ */ jsx("nav", {
|
|
701
|
+
"aria-label": t34,
|
|
702
|
+
className: t35,
|
|
695
703
|
children: /* @__PURE__ */ jsx("ol", {
|
|
696
|
-
className:
|
|
697
|
-
children:
|
|
704
|
+
className: t36,
|
|
705
|
+
children: t37
|
|
698
706
|
})
|
|
699
707
|
});
|
|
700
|
-
$[
|
|
701
|
-
$[
|
|
702
|
-
} else
|
|
708
|
+
$[91] = t37;
|
|
709
|
+
$[92] = t38;
|
|
710
|
+
} else t38 = $[92];
|
|
711
|
+
const t39 = `${block?.id ?? "layout"}:${front?.key}`;
|
|
712
|
+
const t40 = firstDepth + stackedItems.length - 1;
|
|
703
713
|
let t41;
|
|
704
|
-
if ($[
|
|
705
|
-
t41 = /* @__PURE__ */ jsx(
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
} else t41 = $[90];
|
|
714
|
-
let t42;
|
|
715
|
-
if ($[91] !== addSibling || $[92] !== assetAccept || $[93] !== assetFieldName || $[94] !== assetType || $[95] !== block || $[96] !== blockDef || $[97] !== canAddSibling || $[98] !== canRemoveCurrent || $[99] !== currentData || $[100] !== currentItem || $[101] !== currentItemId || $[102] !== currentSchema || $[103] !== fieldHasOwnView || $[104] !== fieldIdPrefix || $[105] !== fieldInfo?.fieldName || $[106] !== filesMap || $[107] !== isItemLoading || $[108] !== isMultipleAsset || $[109] !== isViewingAsset || $[110] !== isViewingLink || $[111] !== itemArraySchema || $[112] !== itemSettingsFields || $[113] !== itemsMap || $[114] !== linkFieldName || $[115] !== owner || $[116] !== recordInList || $[117] !== recordView || $[118] !== removeCurrent || $[119] !== send || $[120] !== settingsFields || $[121] !== updateRepeatableSettings || $[122] !== updateSettings || $[123] !== writeField) {
|
|
716
|
-
t42 = /* @__PURE__ */ jsx("div", {
|
|
717
|
-
className: "relative min-w-0 flex-1 overflow-x-hidden overflow-y-auto",
|
|
718
|
-
children: /* @__PURE__ */ jsx("div", { children: isItemLoading ? /* @__PURE__ */ jsx("div", {
|
|
719
|
-
className: "flex h-full items-center justify-center py-12",
|
|
720
|
-
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
721
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
722
|
-
!fieldHasOwnView && !recordView && currentItemId != null && currentItem && /* @__PURE__ */ jsxs(SidebarSection, {
|
|
723
|
-
divider: "bottom",
|
|
714
|
+
if ($[93] !== addSibling || $[94] !== assetAccept || $[95] !== assetFieldName || $[96] !== assetType || $[97] !== block || $[98] !== blockDef || $[99] !== canAddSibling || $[100] !== canRemoveCurrent || $[101] !== currentData || $[102] !== currentItem || $[103] !== currentItemId || $[104] !== currentSchema || $[105] !== fieldHasOwnView || $[106] !== fieldIdPrefix || $[107] !== fieldInfo?.fieldName || $[108] !== filesMap || $[109] !== isItemLoading || $[110] !== isMultipleAsset || $[111] !== isViewingAsset || $[112] !== isViewingLink || $[113] !== itemArraySchema || $[114] !== itemSettingsFields || $[115] !== itemsMap || $[116] !== linkFieldName || $[117] !== owner || $[118] !== recordInList || $[119] !== recordView || $[120] !== removeCurrent || $[121] !== send || $[122] !== settingsFields || $[123] !== updateRepeatableSettings || $[124] !== updateSettings || $[125] !== writeField) {
|
|
715
|
+
t41 = /* @__PURE__ */ jsx("div", { children: isItemLoading ? /* @__PURE__ */ jsx("div", {
|
|
716
|
+
className: "flex h-full items-center justify-center py-12",
|
|
717
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
718
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
719
|
+
!fieldHasOwnView && !recordView && currentItemId != null && currentItem && /* @__PURE__ */ jsxs(SidebarSection, {
|
|
720
|
+
divider: "bottom",
|
|
721
|
+
"aria-label": "List actions",
|
|
722
|
+
children: [/* @__PURE__ */ jsx(SidebarSectionHeader, { children: "List actions" }), /* @__PURE__ */ jsx(SidebarSectionContent, { children: /* @__PURE__ */ jsxs(ButtonGroup, {
|
|
724
723
|
"aria-label": "List actions",
|
|
725
|
-
children: [/* @__PURE__ */
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
"
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
className: "
|
|
760
|
-
children: [
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
children:
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
},
|
|
790
|
-
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
791
|
-
id: `setting-${field.name}`,
|
|
792
|
-
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
793
|
-
}), /* @__PURE__ */ jsx(SelectContent, { children: field.enumValues?.map((enumValue) => /* @__PURE__ */ jsx(SelectItem, {
|
|
794
|
-
value: enumValue,
|
|
795
|
-
children: field.enumLabels?.[enumValue] ?? enumValue
|
|
796
|
-
}, enumValue)) })]
|
|
797
|
-
})]
|
|
798
|
-
}, field.name);
|
|
799
|
-
}
|
|
800
|
-
if (field.fieldType === "Boolean") {
|
|
801
|
-
const checked = settingsValues[field.name] ?? (blockDef.settingsSchema?.properties?.[field.name])?.default ?? false;
|
|
802
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
803
|
-
className: "flex items-center justify-between",
|
|
804
|
-
children: [/* @__PURE__ */ jsx(Label, {
|
|
805
|
-
htmlFor: `setting-${field.name}`,
|
|
806
|
-
children: label
|
|
807
|
-
}), /* @__PURE__ */ jsx(Switch, {
|
|
724
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
725
|
+
type: "button",
|
|
726
|
+
variant: "outline",
|
|
727
|
+
size: "sm",
|
|
728
|
+
disabled: !canAddSibling,
|
|
729
|
+
onClick: () => {
|
|
730
|
+
if (!canAddSibling) return;
|
|
731
|
+
addSibling({ afterPosition: currentItem.position });
|
|
732
|
+
},
|
|
733
|
+
children: [/* @__PURE__ */ jsx(CirclePlus, { className: "text-muted-foreground h-4 w-4" }), "Add sibling"]
|
|
734
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
735
|
+
type: "button",
|
|
736
|
+
variant: "outline",
|
|
737
|
+
size: "sm",
|
|
738
|
+
disabled: !canRemoveCurrent,
|
|
739
|
+
onClick: () => {
|
|
740
|
+
if (!canRemoveCurrent) return;
|
|
741
|
+
removeCurrent(currentItemId, { onSuccess: () => {
|
|
742
|
+
const selected = selectionForOwner(previewStore.getSnapshot().context, owner);
|
|
743
|
+
if (selectionItemId(selected) !== currentItemId) return;
|
|
744
|
+
previewStore.send({ type: "selectParent" });
|
|
745
|
+
} });
|
|
746
|
+
},
|
|
747
|
+
children: [/* @__PURE__ */ jsx(Trash2, { className: "text-muted-foreground h-4 w-4" }), "Delete"]
|
|
748
|
+
})]
|
|
749
|
+
}) })]
|
|
750
|
+
}),
|
|
751
|
+
recordView && !fieldHasOwnView && recordInList && /* @__PURE__ */ jsx(SidebarSection, {
|
|
752
|
+
divider: "bottom",
|
|
753
|
+
"aria-label": "Shared record",
|
|
754
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
755
|
+
"data-shared-record": true,
|
|
756
|
+
className: "space-y-1 px-2 py-3",
|
|
757
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
758
|
+
className: "min-w-0 truncate text-sm font-medium",
|
|
759
|
+
children: ["Shared · ", recordView.collection.title]
|
|
760
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
761
|
+
className: "text-muted-foreground text-xs",
|
|
762
|
+
children: "Edits apply everywhere this record is used."
|
|
763
|
+
})]
|
|
764
|
+
})
|
|
765
|
+
}),
|
|
766
|
+
block && blockDef && currentItemId == null && !recordView && !fieldHasOwnView && settingsFields.length > 0 && /* @__PURE__ */ jsxs(SidebarSection, {
|
|
767
|
+
divider: "bottom",
|
|
768
|
+
"aria-label": "Block settings",
|
|
769
|
+
children: [/* @__PURE__ */ jsx(SidebarSectionHeader, { children: "Settings" }), /* @__PURE__ */ jsx(SidebarSectionContent, { children: settingsFields.map((field) => {
|
|
770
|
+
const label = field.label ?? formatFieldName(field.name);
|
|
771
|
+
const settingsValues = block.settings ?? {};
|
|
772
|
+
if (field.fieldType === "Enum") {
|
|
773
|
+
const value_2 = settingsValues[field.name] ?? (blockDef.settingsSchema?.properties?.[field.name])?.default ?? "";
|
|
774
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
775
|
+
className: "space-y-2",
|
|
776
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
777
|
+
htmlFor: `setting-${field.name}`,
|
|
778
|
+
children: label
|
|
779
|
+
}), /* @__PURE__ */ jsxs(Select, {
|
|
780
|
+
value: value_2,
|
|
781
|
+
onValueChange: (newValue) => {
|
|
782
|
+
updateSettings.mutate({
|
|
783
|
+
id: block.id,
|
|
784
|
+
settings: { [field.name]: newValue }
|
|
785
|
+
});
|
|
786
|
+
},
|
|
787
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
808
788
|
id: `setting-${field.name}`,
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
return
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
789
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
790
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: field.enumValues?.map((enumValue) => /* @__PURE__ */ jsx(SelectItem, {
|
|
791
|
+
value: enumValue,
|
|
792
|
+
children: field.enumLabels?.[enumValue] ?? enumValue
|
|
793
|
+
}, enumValue)) })]
|
|
794
|
+
})]
|
|
795
|
+
}, field.name);
|
|
796
|
+
}
|
|
797
|
+
if (field.fieldType === "Boolean") {
|
|
798
|
+
const checked = settingsValues[field.name] ?? (blockDef.settingsSchema?.properties?.[field.name])?.default ?? false;
|
|
799
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
800
|
+
className: "flex items-center justify-between",
|
|
801
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
802
|
+
htmlFor: `setting-${field.name}`,
|
|
803
|
+
children: label
|
|
804
|
+
}), /* @__PURE__ */ jsx(Switch, {
|
|
805
|
+
id: `setting-${field.name}`,
|
|
806
|
+
checked,
|
|
807
|
+
onCheckedChange: (newValue_0) => {
|
|
808
|
+
updateSettings.mutate({
|
|
809
|
+
id: block.id,
|
|
810
|
+
settings: { [field.name]: newValue_0 }
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
})]
|
|
814
|
+
}, field.name);
|
|
815
|
+
}
|
|
816
|
+
return null;
|
|
817
|
+
}) })]
|
|
818
|
+
}),
|
|
819
|
+
currentItemId != null && !recordView && !fieldHasOwnView && itemSettingsFields.length > 0 && /* @__PURE__ */ jsxs(SidebarSection, {
|
|
820
|
+
divider: "bottom",
|
|
821
|
+
"aria-label": "Item settings",
|
|
822
|
+
children: [/* @__PURE__ */ jsx(SidebarSectionHeader, { children: "Settings" }), /* @__PURE__ */ jsx(SidebarSectionContent, { children: itemSettingsFields.map((field_0) => {
|
|
823
|
+
const label_0 = field_0.label ?? formatFieldName(field_0.name);
|
|
824
|
+
const itemSettingsValues = currentItem?.settings ?? {};
|
|
825
|
+
const itemSettingsSchemaProps = itemArraySchema?.itemSettingsSchema?.properties;
|
|
826
|
+
if (field_0.fieldType === "Enum") {
|
|
827
|
+
const value_3 = itemSettingsValues[field_0.name] ?? itemSettingsSchemaProps?.[field_0.name]?.default ?? "";
|
|
828
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
829
|
+
className: "space-y-2",
|
|
830
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
831
|
+
htmlFor: `item-setting-${field_0.name}`,
|
|
832
|
+
children: label_0
|
|
833
|
+
}), /* @__PURE__ */ jsxs(Select, {
|
|
834
|
+
value: value_3,
|
|
835
|
+
onValueChange: (newValue_1) => {
|
|
836
|
+
updateRepeatableSettings.mutate({
|
|
837
|
+
id: currentItemId,
|
|
838
|
+
settings: { [field_0.name]: newValue_1 }
|
|
839
|
+
});
|
|
840
|
+
},
|
|
841
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
862
842
|
id: `item-setting-${field_0.name}`,
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
return
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
$[
|
|
942
|
-
$[
|
|
943
|
-
$[
|
|
944
|
-
$[
|
|
945
|
-
$[
|
|
946
|
-
$[
|
|
947
|
-
$[
|
|
948
|
-
$[
|
|
949
|
-
$[
|
|
950
|
-
$[
|
|
951
|
-
$[
|
|
952
|
-
$[
|
|
953
|
-
$[
|
|
954
|
-
$[
|
|
955
|
-
$[
|
|
956
|
-
$[
|
|
957
|
-
$[
|
|
958
|
-
$[
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
$[
|
|
964
|
-
$[
|
|
965
|
-
$[
|
|
966
|
-
|
|
967
|
-
|
|
843
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
844
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: field_0.enumValues?.map((enumValue_0) => /* @__PURE__ */ jsx(SelectItem, {
|
|
845
|
+
value: enumValue_0,
|
|
846
|
+
children: field_0.enumLabels?.[enumValue_0] ?? enumValue_0
|
|
847
|
+
}, enumValue_0)) })]
|
|
848
|
+
})]
|
|
849
|
+
}, field_0.name);
|
|
850
|
+
}
|
|
851
|
+
if (field_0.fieldType === "Boolean") {
|
|
852
|
+
const checked_0 = itemSettingsValues[field_0.name] ?? itemSettingsSchemaProps?.[field_0.name]?.default ?? false;
|
|
853
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
854
|
+
className: "flex items-center justify-between",
|
|
855
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
856
|
+
htmlFor: `item-setting-${field_0.name}`,
|
|
857
|
+
children: label_0
|
|
858
|
+
}), /* @__PURE__ */ jsx(Switch, {
|
|
859
|
+
id: `item-setting-${field_0.name}`,
|
|
860
|
+
checked: checked_0,
|
|
861
|
+
onCheckedChange: (newValue_2) => {
|
|
862
|
+
updateRepeatableSettings.mutate({
|
|
863
|
+
id: currentItemId,
|
|
864
|
+
settings: { [field_0.name]: newValue_2 }
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
})]
|
|
868
|
+
}, field_0.name);
|
|
869
|
+
}
|
|
870
|
+
return null;
|
|
871
|
+
}) })]
|
|
872
|
+
}),
|
|
873
|
+
isViewingAsset && assetFieldName && isMultipleAsset && /* @__PURE__ */ jsx(MultipleAssetFieldEditor, {
|
|
874
|
+
fieldName: assetFieldName,
|
|
875
|
+
assetType,
|
|
876
|
+
currentData,
|
|
877
|
+
onFieldChange: writeField,
|
|
878
|
+
resolveLocally: recordView != null,
|
|
879
|
+
offerDelete: recordView == null,
|
|
880
|
+
accept: assetAccept
|
|
881
|
+
}),
|
|
882
|
+
isViewingAsset && assetFieldName && !isMultipleAsset && /* @__PURE__ */ jsx(SingleAssetFieldEditor, {
|
|
883
|
+
fieldName: assetFieldName,
|
|
884
|
+
assetType,
|
|
885
|
+
currentData,
|
|
886
|
+
onFieldChange: writeField,
|
|
887
|
+
resolveLocally: recordView != null,
|
|
888
|
+
offerDelete: recordView == null,
|
|
889
|
+
accept: assetAccept
|
|
890
|
+
}),
|
|
891
|
+
!isViewingAsset && isViewingLink && linkFieldName && /* @__PURE__ */ jsx("div", {
|
|
892
|
+
className: "px-2 py-4",
|
|
893
|
+
children: /* @__PURE__ */ jsx(LinkFieldEditor, {
|
|
894
|
+
fieldName: linkFieldName,
|
|
895
|
+
linkValue: currentData[linkFieldName] ?? {
|
|
896
|
+
type: "external",
|
|
897
|
+
text: "",
|
|
898
|
+
href: "",
|
|
899
|
+
newTab: false
|
|
900
|
+
},
|
|
901
|
+
onSave: (fieldName, value_4) => {
|
|
902
|
+
writeField(fieldName, value_4);
|
|
903
|
+
}
|
|
904
|
+
})
|
|
905
|
+
}),
|
|
906
|
+
!isViewingAsset && !isViewingLink && (currentItemId == null || currentItem) && /* @__PURE__ */ jsx(ItemFieldsEditor, {
|
|
907
|
+
selectedFieldName: fieldInfo?.fieldName,
|
|
908
|
+
schema: currentSchema,
|
|
909
|
+
data: currentData,
|
|
910
|
+
blockId: block?.id ?? "",
|
|
911
|
+
itemId: currentItemId ?? void 0,
|
|
912
|
+
onFieldChange: writeField,
|
|
913
|
+
postToIframe: send,
|
|
914
|
+
filesMap,
|
|
915
|
+
itemsMap,
|
|
916
|
+
references: recordView ? recordView.record.references : (currentItem ?? block)?.references,
|
|
917
|
+
placement: recordView ? recordPlacement(recordView.selection) : void 0,
|
|
918
|
+
fieldIdPrefix
|
|
919
|
+
}, `${block?.id ?? "layout"}-${recordView ? `record-${recordView.record.id}` : currentItemId ?? "block"}-${fieldInfo?.fieldName ?? "fields"}`)
|
|
920
|
+
] }) });
|
|
921
|
+
$[93] = addSibling;
|
|
922
|
+
$[94] = assetAccept;
|
|
923
|
+
$[95] = assetFieldName;
|
|
924
|
+
$[96] = assetType;
|
|
925
|
+
$[97] = block;
|
|
926
|
+
$[98] = blockDef;
|
|
927
|
+
$[99] = canAddSibling;
|
|
928
|
+
$[100] = canRemoveCurrent;
|
|
929
|
+
$[101] = currentData;
|
|
930
|
+
$[102] = currentItem;
|
|
931
|
+
$[103] = currentItemId;
|
|
932
|
+
$[104] = currentSchema;
|
|
933
|
+
$[105] = fieldHasOwnView;
|
|
934
|
+
$[106] = fieldIdPrefix;
|
|
935
|
+
$[107] = fieldInfo?.fieldName;
|
|
936
|
+
$[108] = filesMap;
|
|
937
|
+
$[109] = isItemLoading;
|
|
938
|
+
$[110] = isMultipleAsset;
|
|
939
|
+
$[111] = isViewingAsset;
|
|
940
|
+
$[112] = isViewingLink;
|
|
941
|
+
$[113] = itemArraySchema;
|
|
942
|
+
$[114] = itemSettingsFields;
|
|
943
|
+
$[115] = itemsMap;
|
|
944
|
+
$[116] = linkFieldName;
|
|
945
|
+
$[117] = owner;
|
|
946
|
+
$[118] = recordInList;
|
|
947
|
+
$[119] = recordView;
|
|
948
|
+
$[120] = removeCurrent;
|
|
949
|
+
$[121] = send;
|
|
950
|
+
$[122] = settingsFields;
|
|
951
|
+
$[123] = updateRepeatableSettings;
|
|
952
|
+
$[124] = updateSettings;
|
|
953
|
+
$[125] = writeField;
|
|
954
|
+
$[126] = t41;
|
|
955
|
+
} else t41 = $[126];
|
|
956
|
+
let t42;
|
|
957
|
+
if ($[127] !== t39 || $[128] !== t40 || $[129] !== t41) {
|
|
958
|
+
t42 = /* @__PURE__ */ jsx(SidebarStackView, {
|
|
959
|
+
depth: t40,
|
|
960
|
+
className: "relative min-w-0 overflow-x-hidden overflow-y-auto",
|
|
961
|
+
children: t41
|
|
962
|
+
}, t39);
|
|
963
|
+
$[127] = t39;
|
|
964
|
+
$[128] = t40;
|
|
965
|
+
$[129] = t41;
|
|
966
|
+
$[130] = t42;
|
|
967
|
+
} else t42 = $[130];
|
|
968
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
969
|
+
/* @__PURE__ */ jsx(SelectionViewCount, { count: rows.length }),
|
|
970
|
+
t38,
|
|
971
|
+
t42
|
|
972
|
+
] });
|
|
968
973
|
};
|
|
969
974
|
function _temp(i) {
|
|
970
975
|
return [i.id, i];
|
|
@@ -981,6 +986,17 @@ function _temp4(f_0) {
|
|
|
981
986
|
function _temp5() {
|
|
982
987
|
return previewStore.send({ type: "clearSelection" });
|
|
983
988
|
}
|
|
989
|
+
function _temp6(item) {
|
|
990
|
+
return /* @__PURE__ */ jsx("li", {
|
|
991
|
+
className: "flex",
|
|
992
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
993
|
+
type: "button",
|
|
994
|
+
className: "hover:bg-accent hover:text-accent-foreground min-w-0 flex-1 cursor-pointer truncate rounded-sm px-2 py-1.5 text-left text-sm",
|
|
995
|
+
onClick: item.onClick,
|
|
996
|
+
children: item.label
|
|
997
|
+
})
|
|
998
|
+
}, item.key);
|
|
999
|
+
}
|
|
984
1000
|
|
|
985
1001
|
//#endregion
|
|
986
1002
|
export { SelectionEditor };
|