@firecms/collection_editor 3.0.0-canary.247 → 3.0.0-canary.249

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/index.es.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
- import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, ArrayContainer, serializeRegExp, useSnackbarController, resolveEnumValues, isPropertyBuilder, useCustomizationController, getFieldConfig, ErrorBoundary, PropertyConfigBadge, unslugify, useNavigationController, mergeDeep, DEFAULT_FIELD_CONFIGS, getFieldId, isValidRegExp, ConfirmationDialog, isEmptyObject, useLargeLayout, makePropertiesEditable, resolveEntityView, useAuthController, useSelectionController, CircularProgressCenter, EntityCollectionTable, slugify, randomString, removeUndefined, ErrorView, removeInitialAndTrailingSlashes, getDefaultPropertiesOrder, joinCollectionLists } from "@firecms/core";
3
+ import { SearchIconsView, toSnakeCase, singular, IconForView, FieldCaption, ArrayContainer, serializeRegExp, useSnackbarController, resolveEnumValues, isPropertyBuilder, useCustomizationController, getFieldConfig, ErrorBoundary, PropertyConfigBadge, unslugify, useNavigationController, mergeDeep, DEFAULT_FIELD_CONFIGS, getFieldId, isValidRegExp, ConfirmationDialog, isEmptyObject, useLargeLayout, makePropertiesEditable, resolveEntityView, useAuthController, useSelectionController, CircularProgressCenter, EntityCollectionTable, slugify, randomString, removeUndefined, ErrorView, removeInitialAndTrailingSlashes, getDefaultPropertiesOrder, joinCollectionLists } from "@firecms/core";
4
4
  import * as React from "react";
5
5
  import React__default, { useContext, useState, useEffect, useMemo, useRef, useDeferredValue } from "react";
6
6
  import equal from "react-fast-compare";
7
- import { cls, Typography, VerticalSplitIcon, Tooltip, Card, SquareIcon, useAutoComplete, Chip, TextField, Autocomplete, AutocompleteItem, SelectItem, Container, IconButton, DebouncedTextField, BooleanSwitchWithLabel, SettingsIcon, CloseIcon, Select, ExpandablePanel, Dialog, Badge, AutorenewIcon, ListIcon, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, DragHandleIcon, defaultBorderMixin, RemoveIcon, AddIcon, SelectGroup, DeleteIcon, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, Tabs, Tab, ArrowBackIcon, LoadingButton, CheckIcon, Menu, MoreVertIcon, MenuItem, UndoIcon, SaveIcon } from "@firecms/ui";
7
+ import { cls, Typography, VerticalSplitIcon, Tooltip, Card, SquareIcon, useAutoComplete, Chip, SelectItem, IconButton, TextField, DebouncedTextField, BooleanSwitchWithLabel, SettingsIcon, CloseIcon, Select, ExpandablePanel, Dialog, Container, Badge, AutorenewIcon, ListIcon, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, DragHandleIcon, defaultBorderMixin, RemoveIcon, AddIcon, SelectGroup, DeleteIcon, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, Tabs, Tab, ArrowBackIcon, LoadingButton, CheckIcon, Menu, MoreVertIcon, MenuItem, UndoIcon, SaveIcon } from "@firecms/ui";
8
8
  import * as Yup from "yup";
9
9
  import { useFormex, getIn, Field, useCreateFormex, Formex, clone } from "@firecms/formex";
10
10
  import { extractEnumFromValues, buildPropertyFromData, buildEntityPropertiesFromData } from "@firecms/schema_inference";
@@ -165,7 +165,7 @@ function LayoutModeSwitch(t0) {
165
165
  return t18;
166
166
  }
167
167
  function CollectionDetailsForm(t0) {
168
- const $ = c(196);
168
+ const $ = c(192);
169
169
  const {
170
170
  isNewCollection,
171
171
  reservedGroups,
@@ -181,7 +181,6 @@ function CollectionDetailsForm(t0) {
181
181
  touched,
182
182
  errors,
183
183
  setFieldTouched,
184
- isSubmitting,
185
184
  submitCount
186
185
  } = useFormex();
187
186
  useCollectionEditorController();
@@ -249,7 +248,7 @@ function CollectionDetailsForm(t0) {
249
248
  t5 = $[10];
250
249
  }
251
250
  const collectionIcon = t5;
252
- const groupOptions = groups?.filter((group) => !reservedGroups?.includes(group));
251
+ groups?.filter((group) => !reservedGroups?.includes(group));
253
252
  let t6;
254
253
  if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
255
254
  t6 = {
@@ -259,10 +258,7 @@ function CollectionDetailsForm(t0) {
259
258
  } else {
260
259
  t6 = $[11];
261
260
  }
262
- const {
263
- autoCompleteOpen,
264
- setAutoCompleteOpen
265
- } = useAutoComplete(t6);
261
+ useAutoComplete(t6);
266
262
  const isSubcollection = !!parentCollection;
267
263
  let customIdValue;
268
264
  if (typeof values.customId === "object") {
@@ -281,333 +277,317 @@ function CollectionDetailsForm(t0) {
281
277
  }
282
278
  }
283
279
  const showErrors = submitCount > 0;
284
- const t7 = "overflow-auto my-auto";
285
- const T0 = Container;
286
- const t8 = "4xl";
287
- const t9 = "flex flex-col gap-4 p-8 m-auto";
288
- const t10 = !isNewCollection ? "h5" : "h4";
289
- const t11 = isNewCollection ? "New collection" : `${values?.name} collection`;
290
- let t12;
291
- if ($[12] !== t10 || $[13] !== t11) {
292
- t12 = /* @__PURE__ */ jsx(Typography, { variant: t10, className: "flex-grow", children: t11 });
293
- $[12] = t10;
294
- $[13] = t11;
295
- $[14] = t12;
280
+ const t7 = !isNewCollection ? "h5" : "h4";
281
+ const t8 = isNewCollection ? "New collection" : `${values?.name} collection`;
282
+ let t9;
283
+ if ($[12] !== t7 || $[13] !== t8) {
284
+ t9 = /* @__PURE__ */ jsx(Typography, { variant: t7, className: "flex-grow", children: t8 });
285
+ $[12] = t7;
286
+ $[13] = t8;
287
+ $[14] = t9;
296
288
  } else {
297
- t12 = $[14];
289
+ t9 = $[14];
298
290
  }
299
- let t13;
291
+ let t10;
300
292
  if ($[15] !== updateDatabaseId || $[16] !== values.databaseId) {
301
- t13 = /* @__PURE__ */ jsx(DefaultDatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
293
+ t10 = /* @__PURE__ */ jsx(DefaultDatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
302
294
  $[15] = updateDatabaseId;
303
295
  $[16] = values.databaseId;
304
- $[17] = t13;
296
+ $[17] = t10;
305
297
  } else {
306
- t13 = $[17];
298
+ t10 = $[17];
307
299
  }
308
- let t14;
300
+ let t11;
309
301
  if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
310
- t14 = () => setIconDialogOpen(true);
311
- $[18] = t14;
302
+ t11 = () => setIconDialogOpen(true);
303
+ $[18] = t11;
312
304
  } else {
313
- t14 = $[18];
305
+ t11 = $[18];
314
306
  }
315
- let t15;
307
+ let t12;
316
308
  if ($[19] !== collectionIcon) {
317
- t15 = /* @__PURE__ */ jsx(Tooltip, { title: "Change icon", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { shape: "square", onClick: t14, children: collectionIcon }) });
309
+ t12 = /* @__PURE__ */ jsx(Tooltip, { title: "Change icon", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { shape: "square", onClick: t11, children: collectionIcon }) });
318
310
  $[19] = collectionIcon;
319
- $[20] = t15;
311
+ $[20] = t12;
320
312
  } else {
321
- t15 = $[20];
313
+ t12 = $[20];
322
314
  }
323
- let t16;
324
- if ($[21] !== t12 || $[22] !== t13 || $[23] !== t15) {
325
- t16 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-2 py-2 pt-3 items-center", children: [
326
- t12,
327
- t13,
328
- t15
315
+ let t13;
316
+ if ($[21] !== t10 || $[22] !== t12 || $[23] !== t9) {
317
+ t13 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-2 py-2 pt-3 items-center", children: [
318
+ t9,
319
+ t10,
320
+ t12
329
321
  ] });
330
- $[21] = t12;
331
- $[22] = t13;
332
- $[23] = t15;
333
- $[24] = t16;
322
+ $[21] = t10;
323
+ $[22] = t12;
324
+ $[23] = t9;
325
+ $[24] = t13;
334
326
  } else {
335
- t16 = $[24];
327
+ t13 = $[24];
336
328
  }
337
- let t17;
329
+ let t14;
338
330
  if ($[25] !== parentCollection) {
339
- t17 = parentCollection && /* @__PURE__ */ jsx(Chip, { colorScheme: "tealDarker", children: /* @__PURE__ */ jsxs(Typography, { variant: "caption", children: [
331
+ t14 = parentCollection && /* @__PURE__ */ jsx(Chip, { colorScheme: "tealDarker", children: /* @__PURE__ */ jsxs(Typography, { variant: "caption", children: [
340
332
  "This is a subcollection of ",
341
333
  /* @__PURE__ */ jsx("b", { children: parentCollection.name })
342
334
  ] }) });
343
335
  $[25] = parentCollection;
344
- $[26] = t17;
336
+ $[26] = t14;
345
337
  } else {
346
- t17 = $[26];
338
+ t14 = $[26];
347
339
  }
348
- let t18;
349
- if ($[27] !== t16 || $[28] !== t17) {
350
- t18 = /* @__PURE__ */ jsxs("div", { children: [
351
- t16,
352
- t17
340
+ let t15;
341
+ if ($[27] !== t13 || $[28] !== t14) {
342
+ t15 = /* @__PURE__ */ jsxs("div", { children: [
343
+ t13,
344
+ t14
353
345
  ] });
354
- $[27] = t16;
355
- $[28] = t17;
356
- $[29] = t18;
346
+ $[27] = t13;
347
+ $[28] = t14;
348
+ $[29] = t15;
357
349
  } else {
358
- t18 = $[29];
350
+ t15 = $[29];
359
351
  }
360
- const t19 = "grid grid-cols-12 gap-4";
361
- const t20 = values.name ?? "";
362
- let t21;
352
+ const t16 = values.name ?? "";
353
+ let t17;
363
354
  if ($[30] !== updateName) {
364
- t21 = (e) => updateName(e.target.value);
355
+ t17 = (e) => updateName(e.target.value);
365
356
  $[30] = updateName;
366
- $[31] = t21;
357
+ $[31] = t17;
367
358
  } else {
368
- t21 = $[31];
359
+ t17 = $[31];
360
+ }
361
+ const t18 = showErrors && Boolean(errors.name);
362
+ let t19;
363
+ if ($[32] !== t16 || $[33] !== t17 || $[34] !== t18) {
364
+ t19 = /* @__PURE__ */ jsx(TextField, { value: t16, onChange: t17, label: "Name", autoFocus: true, required: true, error: t18 });
365
+ $[32] = t16;
366
+ $[33] = t17;
367
+ $[34] = t18;
368
+ $[35] = t19;
369
+ } else {
370
+ t19 = $[35];
371
+ }
372
+ const t20 = touched.name && Boolean(errors.name);
373
+ const t21 = touched.name && Boolean(errors.name) ? errors.name : "Name of this collection, usually a plural name (e.g. Products)";
374
+ let t22;
375
+ if ($[36] !== t20 || $[37] !== t21) {
376
+ t22 = /* @__PURE__ */ jsx(FieldCaption, { error: t20, children: t21 });
377
+ $[36] = t20;
378
+ $[37] = t21;
379
+ $[38] = t22;
380
+ } else {
381
+ t22 = $[38];
369
382
  }
370
- const t22 = showErrors && Boolean(errors.name);
371
383
  let t23;
372
- if ($[32] !== t20 || $[33] !== t21 || $[34] !== t22) {
373
- t23 = /* @__PURE__ */ jsx(TextField, { value: t20, onChange: t21, label: "Name", autoFocus: true, required: true, error: t22 });
374
- $[32] = t20;
375
- $[33] = t21;
376
- $[34] = t22;
377
- $[35] = t23;
384
+ if ($[39] !== t19 || $[40] !== t22) {
385
+ t23 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
386
+ t19,
387
+ t22
388
+ ] });
389
+ $[39] = t19;
390
+ $[40] = t22;
391
+ $[41] = t23;
378
392
  } else {
379
- t23 = $[35];
393
+ t23 = $[41];
380
394
  }
381
- const t24 = touched.name && Boolean(errors.name);
382
- const t25 = touched.name && Boolean(errors.name) ? errors.name : "Name of this collection, usually a plural name (e.g. Products)";
383
- let t26;
384
- if ($[36] !== t24 || $[37] !== t25) {
385
- t26 = /* @__PURE__ */ jsx(FieldCaption, { error: t24, children: t25 });
386
- $[36] = t24;
387
- $[37] = t25;
388
- $[38] = t26;
395
+ let t24;
396
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
397
+ t24 = cls("col-span-12 ");
398
+ $[42] = t24;
389
399
  } else {
390
- t26 = $[38];
400
+ t24 = $[42];
391
401
  }
402
+ const t25 = !isNewCollection;
403
+ const t26 = showErrors && Boolean(errors.path);
392
404
  let t27;
393
- if ($[39] !== t23 || $[40] !== t26) {
394
- t27 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
395
- t23,
396
- t26
397
- ] });
398
- $[39] = t23;
399
- $[40] = t26;
400
- $[41] = t27;
405
+ if ($[43] !== t25 || $[44] !== t26) {
406
+ t27 = /* @__PURE__ */ jsx(Field, { name: "path", as: DebouncedTextField, label: "Path", disabled: t25, required: true, error: t26 });
407
+ $[43] = t25;
408
+ $[44] = t26;
409
+ $[45] = t27;
401
410
  } else {
402
- t27 = $[41];
411
+ t27 = $[45];
403
412
  }
404
- const t28 = isSubcollection ? "" : "sm:col-span-8";
405
- let t29;
406
- if ($[42] !== t28) {
407
- t29 = cls("col-span-12 ", t28);
408
- $[42] = t28;
409
- $[43] = t29;
410
- } else {
411
- t29 = $[43];
412
- }
413
- const t30 = !isNewCollection;
414
- const t31 = showErrors && Boolean(errors.path);
415
- let t32;
416
- if ($[44] !== t30 || $[45] !== t31) {
417
- t32 = /* @__PURE__ */ jsx(Field, { name: "path", as: DebouncedTextField, label: "Path", disabled: t30, required: true, error: t31 });
418
- $[44] = t30;
419
- $[45] = t31;
420
- $[46] = t32;
421
- } else {
422
- t32 = $[46];
423
- }
424
- const t33 = touched.path && Boolean(errors.path);
425
- const t34 = touched.path && Boolean(errors.path) ? errors.path : isSubcollection ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database";
426
- let t35;
427
- if ($[47] !== t33 || $[48] !== t34) {
428
- t35 = /* @__PURE__ */ jsx(FieldCaption, { error: t33, children: t34 });
429
- $[47] = t33;
430
- $[48] = t34;
431
- $[49] = t35;
432
- } else {
433
- t35 = $[49];
413
+ const t28 = touched.path && Boolean(errors.path);
414
+ const t29 = touched.path && Boolean(errors.path) ? errors.path : isSubcollection ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database";
415
+ let t30;
416
+ if ($[46] !== t28 || $[47] !== t29) {
417
+ t30 = /* @__PURE__ */ jsx(FieldCaption, { error: t28, children: t29 });
418
+ $[46] = t28;
419
+ $[47] = t29;
420
+ $[48] = t30;
421
+ } else {
422
+ t30 = $[48];
434
423
  }
435
- let t36;
436
- if ($[50] !== t29 || $[51] !== t32 || $[52] !== t35) {
437
- t36 = /* @__PURE__ */ jsxs("div", { className: t29, children: [
438
- t32,
439
- t35
424
+ let t31;
425
+ if ($[49] !== t27 || $[50] !== t30) {
426
+ t31 = /* @__PURE__ */ jsxs("div", { className: t24, children: [
427
+ t27,
428
+ t30
440
429
  ] });
441
- $[50] = t29;
442
- $[51] = t32;
443
- $[52] = t35;
444
- $[53] = t36;
445
- } else {
446
- t36 = $[53];
447
- }
448
- const t37 = !isSubcollection && /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-4 relative", children: [
449
- /* @__PURE__ */ jsx(TextField, { error: showErrors && Boolean(errors.group), disabled: isSubmitting, value: values.group ?? "", autoComplete: "off", onChange: (event) => setFieldValue("group", event.target.value), name: "group", inputRef: groupRef, label: "Group" }),
450
- /* @__PURE__ */ jsx(Autocomplete, { open: autoCompleteOpen && (groupOptions ?? []).length > 0, setOpen: setAutoCompleteOpen, children: groupOptions?.map((group_0, index) => /* @__PURE__ */ jsx(AutocompleteItem, { className: "pr-6 pl-14", onClick: () => {
451
- setAutoCompleteOpen(false);
452
- setFieldValue("group", group_0 ?? null);
453
- }, children: /* @__PURE__ */ jsx("div", { className: "flex-grow", children: group_0 }) }, index + "_" + group_0)) }),
454
- /* @__PURE__ */ jsx(FieldCaption, { children: showErrors && Boolean(errors.group) ? errors.group : "Group in the home page" })
455
- ] });
456
- const t38 = values.openEntityMode ?? "side_panel";
457
- let t39;
458
- if ($[54] !== setFieldValue) {
459
- t39 = (value) => setFieldValue("openEntityMode", value);
460
- $[54] = setFieldValue;
461
- $[55] = t39;
430
+ $[49] = t27;
431
+ $[50] = t30;
432
+ $[51] = t31;
462
433
  } else {
463
- t39 = $[55];
434
+ t31 = $[51];
464
435
  }
465
- let t40;
466
- if ($[56] !== t38 || $[57] !== t39) {
467
- t40 = /* @__PURE__ */ jsx(LayoutModeSwitch, { className: "col-span-12", value: t38, onChange: t39 });
468
- $[56] = t38;
469
- $[57] = t39;
470
- $[58] = t40;
436
+ const t32 = values.openEntityMode ?? "side_panel";
437
+ let t33;
438
+ if ($[52] !== setFieldValue) {
439
+ t33 = (value) => setFieldValue("openEntityMode", value);
440
+ $[52] = setFieldValue;
441
+ $[53] = t33;
471
442
  } else {
472
- t40 = $[58];
443
+ t33 = $[53];
473
444
  }
474
- const t41 = values.history === null || values.history === void 0 ? "Document history revisions enabled if enabled globally" : values.history ? "Document history revisions ENABLED" : "Document history revisions NOT enabled";
475
- let t42;
476
- if ($[59] !== setFieldValue) {
477
- t42 = (v) => setFieldValue("history", v);
478
- $[59] = setFieldValue;
479
- $[60] = t42;
445
+ let t34;
446
+ if ($[54] !== t32 || $[55] !== t33) {
447
+ t34 = /* @__PURE__ */ jsx(LayoutModeSwitch, { className: "col-span-12", value: t32, onChange: t33 });
448
+ $[54] = t32;
449
+ $[55] = t33;
450
+ $[56] = t34;
480
451
  } else {
481
- t42 = $[60];
452
+ t34 = $[56];
482
453
  }
483
- const t43 = values.history === void 0 ? null : values.history;
484
- let t44;
485
- if ($[61] !== t41 || $[62] !== t42 || $[63] !== t43) {
486
- t44 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", allowIndeterminate: true, label: t41, onValueChange: t42, value: t43 });
487
- $[61] = t41;
488
- $[62] = t42;
489
- $[63] = t43;
490
- $[64] = t44;
491
- } else {
492
- t44 = $[64];
493
- }
494
- let t45;
495
- if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
496
- t45 = /* @__PURE__ */ jsxs(FieldCaption, { children: [
454
+ const t35 = values.history === null || values.history === void 0 ? "Document history revisions enabled if enabled globally" : values.history ? "Document history revisions ENABLED" : "Document history revisions NOT enabled";
455
+ let t36;
456
+ if ($[57] !== setFieldValue) {
457
+ t36 = (v) => setFieldValue("history", v);
458
+ $[57] = setFieldValue;
459
+ $[58] = t36;
460
+ } else {
461
+ t36 = $[58];
462
+ }
463
+ const t37 = values.history === void 0 ? null : values.history;
464
+ let t38;
465
+ if ($[59] !== t35 || $[60] !== t36 || $[61] !== t37) {
466
+ t38 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", allowIndeterminate: true, label: t35, onValueChange: t36, value: t37 });
467
+ $[59] = t35;
468
+ $[60] = t36;
469
+ $[61] = t37;
470
+ $[62] = t38;
471
+ } else {
472
+ t38 = $[62];
473
+ }
474
+ let t39;
475
+ if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
476
+ t39 = /* @__PURE__ */ jsxs(FieldCaption, { children: [
497
477
  "When enabled, each document in this collection will have a history of changes. This is useful for auditing purposes. The data is stored in a subcollection of the document in your database, called ",
498
478
  /* @__PURE__ */ jsx("b", { children: "__history" }),
499
479
  "."
500
480
  ] });
501
- $[65] = t45;
481
+ $[63] = t39;
502
482
  } else {
503
- t45 = $[65];
483
+ t39 = $[63];
504
484
  }
505
- let t46;
506
- if ($[66] !== t44) {
507
- t46 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
508
- t44,
509
- t45
485
+ let t40;
486
+ if ($[64] !== t38) {
487
+ t40 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
488
+ t38,
489
+ t39
510
490
  ] });
511
- $[66] = t44;
512
- $[67] = t46;
491
+ $[64] = t38;
492
+ $[65] = t40;
513
493
  } else {
514
- t46 = $[67];
494
+ t40 = $[65];
515
495
  }
516
- let t47;
517
- if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
518
- t47 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
496
+ let t41;
497
+ if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
498
+ t41 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
519
499
  /* @__PURE__ */ jsx(SettingsIcon, {}),
520
500
  /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-2", children: "Advanced" })
521
501
  ] });
522
- $[68] = t47;
502
+ $[66] = t41;
523
503
  } else {
524
- t47 = $[68];
504
+ t41 = $[66];
525
505
  }
526
- const t48 = !isNewCollection;
527
- const t49 = showErrors && Boolean(errors.id);
528
- let t50;
529
- if ($[69] !== t48 || $[70] !== t49) {
530
- t50 = /* @__PURE__ */ jsx(Field, { name: "id", as: DebouncedTextField, disabled: t48, label: "Collection id", error: t49 });
531
- $[69] = t48;
532
- $[70] = t49;
533
- $[71] = t50;
534
- } else {
535
- t50 = $[71];
536
- }
537
- const t51 = touched.id && Boolean(errors.id);
538
- const t52 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
539
- let t53;
540
- if ($[72] !== t51 || $[73] !== t52) {
541
- t53 = /* @__PURE__ */ jsx(FieldCaption, { error: t51, children: t52 });
542
- $[72] = t51;
543
- $[73] = t52;
544
- $[74] = t53;
545
- } else {
546
- t53 = $[74];
547
- }
548
- let t54;
549
- if ($[75] !== t50 || $[76] !== t53) {
550
- t54 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
551
- t50,
552
- t53
553
- ] });
554
- $[75] = t50;
555
- $[76] = t53;
556
- $[77] = t54;
506
+ const t42 = !isNewCollection;
507
+ const t43 = showErrors && Boolean(errors.id);
508
+ let t44;
509
+ if ($[67] !== t42 || $[68] !== t43) {
510
+ t44 = /* @__PURE__ */ jsx(Field, { name: "id", as: DebouncedTextField, disabled: t42, label: "Collection id", error: t43 });
511
+ $[67] = t42;
512
+ $[68] = t43;
513
+ $[69] = t44;
557
514
  } else {
558
- t54 = $[77];
515
+ t44 = $[69];
559
516
  }
560
- const t55 = showErrors && Boolean(errors.singularName);
561
- let t56;
562
- if ($[78] !== handleChange || $[79] !== setFieldTouched) {
563
- t56 = (e_0) => {
564
- setFieldTouched("singularName", true);
565
- return handleChange(e_0);
566
- };
567
- $[78] = handleChange;
568
- $[79] = setFieldTouched;
569
- $[80] = t56;
517
+ const t45 = touched.id && Boolean(errors.id);
518
+ const t46 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
519
+ let t47;
520
+ if ($[70] !== t45 || $[71] !== t46) {
521
+ t47 = /* @__PURE__ */ jsx(FieldCaption, { error: t45, children: t46 });
522
+ $[70] = t45;
523
+ $[71] = t46;
524
+ $[72] = t47;
570
525
  } else {
571
- t56 = $[80];
526
+ t47 = $[72];
572
527
  }
573
- const t57 = values.singularName ?? "";
574
- let t58;
575
- if ($[81] !== t55 || $[82] !== t56 || $[83] !== t57) {
576
- t58 = /* @__PURE__ */ jsx(TextField, { error: t55, name: "singularName", "aria-describedby": "singularName-helper", onChange: t56, value: t57, label: "Singular name" });
577
- $[81] = t55;
578
- $[82] = t56;
579
- $[83] = t57;
580
- $[84] = t58;
528
+ let t48;
529
+ if ($[73] !== t44 || $[74] !== t47) {
530
+ t48 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
531
+ t44,
532
+ t47
533
+ ] });
534
+ $[73] = t44;
535
+ $[74] = t47;
536
+ $[75] = t48;
581
537
  } else {
582
- t58 = $[84];
538
+ t48 = $[75];
583
539
  }
584
- const t59 = showErrors && Boolean(errors.singularName);
585
- const t60 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
586
- let t61;
587
- if ($[85] !== t59 || $[86] !== t60) {
588
- t61 = /* @__PURE__ */ jsx(FieldCaption, { error: t59, children: t60 });
589
- $[85] = t59;
590
- $[86] = t60;
591
- $[87] = t61;
592
- } else {
593
- t61 = $[87];
540
+ const t49 = showErrors && Boolean(errors.singularName);
541
+ let t50;
542
+ if ($[76] !== handleChange || $[77] !== setFieldTouched) {
543
+ t50 = (e_0) => {
544
+ setFieldTouched("singularName", true);
545
+ return handleChange(e_0);
546
+ };
547
+ $[76] = handleChange;
548
+ $[77] = setFieldTouched;
549
+ $[78] = t50;
550
+ } else {
551
+ t50 = $[78];
552
+ }
553
+ const t51 = values.singularName ?? "";
554
+ let t52;
555
+ if ($[79] !== t49 || $[80] !== t50 || $[81] !== t51) {
556
+ t52 = /* @__PURE__ */ jsx(TextField, { error: t49, name: "singularName", "aria-describedby": "singularName-helper", onChange: t50, value: t51, label: "Singular name" });
557
+ $[79] = t49;
558
+ $[80] = t50;
559
+ $[81] = t51;
560
+ $[82] = t52;
561
+ } else {
562
+ t52 = $[82];
563
+ }
564
+ const t53 = showErrors && Boolean(errors.singularName);
565
+ const t54 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
566
+ let t55;
567
+ if ($[83] !== t53 || $[84] !== t54) {
568
+ t55 = /* @__PURE__ */ jsx(FieldCaption, { error: t53, children: t54 });
569
+ $[83] = t53;
570
+ $[84] = t54;
571
+ $[85] = t55;
572
+ } else {
573
+ t55 = $[85];
594
574
  }
595
- let t62;
596
- if ($[88] !== t58 || $[89] !== t61) {
597
- t62 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
598
- t58,
599
- t61
575
+ let t56;
576
+ if ($[86] !== t52 || $[87] !== t55) {
577
+ t56 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
578
+ t52,
579
+ t55
600
580
  ] });
601
- $[88] = t58;
602
- $[89] = t61;
603
- $[90] = t62;
581
+ $[86] = t52;
582
+ $[87] = t55;
583
+ $[88] = t56;
604
584
  } else {
605
- t62 = $[90];
585
+ t56 = $[88];
606
586
  }
607
- const t63 = showErrors && Boolean(errors.sideDialogWidth);
608
- let t64;
609
- if ($[91] !== setFieldTouched || $[92] !== setFieldValue) {
610
- t64 = (e_1) => {
587
+ const t57 = showErrors && Boolean(errors.sideDialogWidth);
588
+ let t58;
589
+ if ($[89] !== setFieldTouched || $[90] !== setFieldValue) {
590
+ t58 = (e_1) => {
611
591
  setFieldTouched("sideDialogWidth", true);
612
592
  const value_0 = e_1.target.value;
613
593
  if (!value_0) {
@@ -618,402 +598,399 @@ function CollectionDetailsForm(t0) {
618
598
  }
619
599
  }
620
600
  };
621
- $[91] = setFieldTouched;
622
- $[92] = setFieldValue;
623
- $[93] = t64;
601
+ $[89] = setFieldTouched;
602
+ $[90] = setFieldValue;
603
+ $[91] = t58;
624
604
  } else {
625
- t64 = $[93];
605
+ t58 = $[91];
626
606
  }
627
- let t65;
628
- if ($[94] !== setFieldValue) {
629
- t65 = () => {
607
+ let t59;
608
+ if ($[92] !== setFieldValue) {
609
+ t59 = () => {
630
610
  setFieldValue("sideDialogWidth", null);
631
611
  };
632
- $[94] = setFieldValue;
633
- $[95] = t65;
612
+ $[92] = setFieldValue;
613
+ $[93] = t59;
634
614
  } else {
635
- t65 = $[95];
615
+ t59 = $[93];
636
616
  }
637
- const t66 = !values.sideDialogWidth;
638
- let t67;
639
- if ($[96] === Symbol.for("react.memo_cache_sentinel")) {
640
- t67 = /* @__PURE__ */ jsx(CloseIcon, { size: "small" });
641
- $[96] = t67;
617
+ const t60 = !values.sideDialogWidth;
618
+ let t61;
619
+ if ($[94] === Symbol.for("react.memo_cache_sentinel")) {
620
+ t61 = /* @__PURE__ */ jsx(CloseIcon, { size: "small" });
621
+ $[94] = t61;
642
622
  } else {
643
- t67 = $[96];
623
+ t61 = $[94];
644
624
  }
645
- let t68;
646
- if ($[97] !== t65 || $[98] !== t66) {
647
- t68 = /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: t65, disabled: t66, children: t67 });
648
- $[97] = t65;
649
- $[98] = t66;
650
- $[99] = t68;
651
- } else {
652
- t68 = $[99];
653
- }
654
- const t69 = values.sideDialogWidth ?? "";
655
- let t70;
656
- if ($[100] !== t63 || $[101] !== t64 || $[102] !== t68 || $[103] !== t69) {
657
- t70 = /* @__PURE__ */ jsx(TextField, { error: t63, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t64, endAdornment: t68, value: t69, label: "Side dialog width" });
658
- $[100] = t63;
659
- $[101] = t64;
660
- $[102] = t68;
661
- $[103] = t69;
662
- $[104] = t70;
663
- } else {
664
- t70 = $[104];
665
- }
666
- const t71 = showErrors && Boolean(errors.singularName);
667
- const t72 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
668
- let t73;
669
- if ($[105] !== t71 || $[106] !== t72) {
670
- t73 = /* @__PURE__ */ jsx(FieldCaption, { error: t71, children: t72 });
671
- $[105] = t71;
672
- $[106] = t72;
673
- $[107] = t73;
674
- } else {
675
- t73 = $[107];
676
- }
677
- let t74;
678
- if ($[108] !== t70 || $[109] !== t73) {
679
- t74 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
680
- t70,
681
- t73
682
- ] });
683
- $[108] = t70;
684
- $[109] = t73;
685
- $[110] = t74;
625
+ let t62;
626
+ if ($[95] !== t59 || $[96] !== t60) {
627
+ t62 = /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: t59, disabled: t60, children: t61 });
628
+ $[95] = t59;
629
+ $[96] = t60;
630
+ $[97] = t62;
686
631
  } else {
687
- t74 = $[110];
632
+ t62 = $[97];
688
633
  }
689
- const t75 = showErrors && Boolean(errors.description);
690
- const t76 = values.description ?? "";
691
- let t77;
692
- if ($[111] !== handleChange || $[112] !== t75 || $[113] !== t76) {
693
- t77 = /* @__PURE__ */ jsx(TextField, { error: t75, name: "description", value: t76, onChange: handleChange, multiline: true, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
694
- $[111] = handleChange;
695
- $[112] = t75;
696
- $[113] = t76;
697
- $[114] = t77;
634
+ const t63 = values.sideDialogWidth ?? "";
635
+ let t64;
636
+ if ($[98] !== t57 || $[99] !== t58 || $[100] !== t62 || $[101] !== t63) {
637
+ t64 = /* @__PURE__ */ jsx(TextField, { error: t57, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t58, endAdornment: t62, value: t63, label: "Side dialog width" });
638
+ $[98] = t57;
639
+ $[99] = t58;
640
+ $[100] = t62;
641
+ $[101] = t63;
642
+ $[102] = t64;
643
+ } else {
644
+ t64 = $[102];
645
+ }
646
+ const t65 = showErrors && Boolean(errors.singularName);
647
+ const t66 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
648
+ let t67;
649
+ if ($[103] !== t65 || $[104] !== t66) {
650
+ t67 = /* @__PURE__ */ jsx(FieldCaption, { error: t65, children: t66 });
651
+ $[103] = t65;
652
+ $[104] = t66;
653
+ $[105] = t67;
698
654
  } else {
699
- t77 = $[114];
655
+ t67 = $[105];
700
656
  }
701
- const t78 = showErrors && Boolean(errors.description);
702
- const t79 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
703
- let t80;
704
- if ($[115] !== t78 || $[116] !== t79) {
705
- t80 = /* @__PURE__ */ jsx(FieldCaption, { error: t78, children: t79 });
706
- $[115] = t78;
707
- $[116] = t79;
708
- $[117] = t80;
709
- } else {
710
- t80 = $[117];
711
- }
712
- let t81;
713
- if ($[118] !== t77 || $[119] !== t80) {
714
- t81 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
715
- t77,
716
- t80
657
+ let t68;
658
+ if ($[106] !== t64 || $[107] !== t67) {
659
+ t68 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
660
+ t64,
661
+ t67
717
662
  ] });
718
- $[118] = t77;
719
- $[119] = t80;
720
- $[120] = t81;
663
+ $[106] = t64;
664
+ $[107] = t67;
665
+ $[108] = t68;
666
+ } else {
667
+ t68 = $[108];
668
+ }
669
+ const t69 = showErrors && Boolean(errors.description);
670
+ const t70 = values.description ?? "";
671
+ let t71;
672
+ if ($[109] !== handleChange || $[110] !== t69 || $[111] !== t70) {
673
+ t71 = /* @__PURE__ */ jsx(TextField, { error: t69, name: "description", value: t70, onChange: handleChange, multiline: true, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
674
+ $[109] = handleChange;
675
+ $[110] = t69;
676
+ $[111] = t70;
677
+ $[112] = t71;
678
+ } else {
679
+ t71 = $[112];
680
+ }
681
+ const t72 = showErrors && Boolean(errors.description);
682
+ const t73 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
683
+ let t74;
684
+ if ($[113] !== t72 || $[114] !== t73) {
685
+ t74 = /* @__PURE__ */ jsx(FieldCaption, { error: t72, children: t73 });
686
+ $[113] = t72;
687
+ $[114] = t73;
688
+ $[115] = t74;
689
+ } else {
690
+ t74 = $[115];
691
+ }
692
+ let t75;
693
+ if ($[116] !== t71 || $[117] !== t74) {
694
+ t75 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
695
+ t71,
696
+ t74
697
+ ] });
698
+ $[116] = t71;
699
+ $[117] = t74;
700
+ $[118] = t75;
721
701
  } else {
722
- t81 = $[120];
702
+ t75 = $[118];
723
703
  }
724
- const t82 = values.defaultSize ?? "";
725
- let t83;
726
- if ($[121] === Symbol.for("react.memo_cache_sentinel")) {
727
- t83 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
728
- $[121] = t83;
704
+ const t76 = values.defaultSize ?? "";
705
+ let t77;
706
+ if ($[119] === Symbol.for("react.memo_cache_sentinel")) {
707
+ t77 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
708
+ $[119] = t77;
729
709
  } else {
730
- t83 = $[121];
710
+ t77 = $[119];
731
711
  }
732
- let t84;
733
- if ($[122] !== handleChange || $[123] !== t82) {
734
- t84 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t82, renderValue: _temp$b, children: t83 }) });
735
- $[122] = handleChange;
736
- $[123] = t82;
737
- $[124] = t84;
712
+ let t78;
713
+ if ($[120] !== handleChange || $[121] !== t76) {
714
+ t78 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t76, renderValue: _temp$b, children: t77 }) });
715
+ $[120] = handleChange;
716
+ $[121] = t76;
717
+ $[122] = t78;
738
718
  } else {
739
- t84 = $[124];
719
+ t78 = $[122];
740
720
  }
741
- const t85 = values.includeJsonView === void 0 || values.includeJsonView ? "Include JSON view" : "Do not include JSON view";
742
- let t86;
743
- if ($[125] !== setFieldValue) {
744
- t86 = (v_0) => setFieldValue("includeJsonView", v_0);
745
- $[125] = setFieldValue;
746
- $[126] = t86;
721
+ const t79 = values.includeJsonView === void 0 || values.includeJsonView ? "Include JSON view" : "Do not include JSON view";
722
+ let t80;
723
+ if ($[123] !== setFieldValue) {
724
+ t80 = (v_0) => setFieldValue("includeJsonView", v_0);
725
+ $[123] = setFieldValue;
726
+ $[124] = t80;
747
727
  } else {
748
- t86 = $[126];
728
+ t80 = $[124];
749
729
  }
750
- const t87 = values.includeJsonView === void 0 ? true : values.includeJsonView;
751
- let t88;
752
- if ($[127] !== t85 || $[128] !== t86 || $[129] !== t87) {
753
- t88 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: t85, onValueChange: t86, value: t87 });
754
- $[127] = t85;
755
- $[128] = t86;
756
- $[129] = t87;
757
- $[130] = t88;
730
+ const t81 = values.includeJsonView === void 0 ? true : values.includeJsonView;
731
+ let t82;
732
+ if ($[125] !== t79 || $[126] !== t80 || $[127] !== t81) {
733
+ t82 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: t79, onValueChange: t80, value: t81 });
734
+ $[125] = t79;
735
+ $[126] = t80;
736
+ $[127] = t81;
737
+ $[128] = t82;
758
738
  } else {
759
- t88 = $[130];
739
+ t82 = $[128];
760
740
  }
761
- let t89;
762
- if ($[131] === Symbol.for("react.memo_cache_sentinel")) {
763
- t89 = /* @__PURE__ */ jsx(FieldCaption, { children: "Include the JSON representation of the document." });
764
- $[131] = t89;
741
+ let t83;
742
+ if ($[129] === Symbol.for("react.memo_cache_sentinel")) {
743
+ t83 = /* @__PURE__ */ jsx(FieldCaption, { children: "Include the JSON representation of the document." });
744
+ $[129] = t83;
765
745
  } else {
766
- t89 = $[131];
746
+ t83 = $[129];
767
747
  }
768
- let t90;
769
- if ($[132] !== t88) {
770
- t90 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
771
- t88,
772
- t89
748
+ let t84;
749
+ if ($[130] !== t82) {
750
+ t84 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
751
+ t82,
752
+ t83
773
753
  ] });
774
- $[132] = t88;
775
- $[133] = t90;
754
+ $[130] = t82;
755
+ $[131] = t84;
776
756
  } else {
777
- t90 = $[133];
757
+ t84 = $[131];
778
758
  }
779
- const t91 = customIdValue === "code_defined";
780
- let t92;
781
- if ($[134] !== setFieldValue) {
782
- t92 = (v_1) => {
759
+ const t85 = customIdValue === "code_defined";
760
+ let t86;
761
+ if ($[132] !== setFieldValue) {
762
+ t86 = (v_1) => {
783
763
  if (v_1 === "code_defined") {
784
764
  throw new Error("This should not happen");
785
765
  }
786
766
  setFieldValue("customId", v_1);
787
767
  };
788
- $[134] = setFieldValue;
789
- $[135] = t92;
768
+ $[132] = setFieldValue;
769
+ $[133] = t86;
790
770
  } else {
791
- t92 = $[135];
792
- }
793
- const t93 = customIdValue ?? "";
794
- let t94;
795
- let t95;
796
- let t96;
797
- if ($[136] === Symbol.for("react.memo_cache_sentinel")) {
798
- t94 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
799
- t95 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
800
- t96 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
801
- $[136] = t94;
802
- $[137] = t95;
803
- $[138] = t96;
804
- } else {
805
- t94 = $[136];
806
- t95 = $[137];
807
- t96 = $[138];
771
+ t86 = $[133];
808
772
  }
809
- let t97;
810
- if ($[139] !== t91 || $[140] !== t92 || $[141] !== t93) {
811
- t97 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t91, onValueChange: t92, value: t93, renderValue: _temp3$4, children: [
812
- t94,
813
- t95,
814
- t96
773
+ const t87 = customIdValue ?? "";
774
+ let t88;
775
+ let t89;
776
+ let t90;
777
+ if ($[134] === Symbol.for("react.memo_cache_sentinel")) {
778
+ t88 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
779
+ t89 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
780
+ t90 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
781
+ $[134] = t88;
782
+ $[135] = t89;
783
+ $[136] = t90;
784
+ } else {
785
+ t88 = $[134];
786
+ t89 = $[135];
787
+ t90 = $[136];
788
+ }
789
+ let t91;
790
+ if ($[137] !== t85 || $[138] !== t86 || $[139] !== t87) {
791
+ t91 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t85, onValueChange: t86, value: t87, renderValue: _temp3$4, children: [
792
+ t88,
793
+ t89,
794
+ t90
815
795
  ] }) });
816
- $[139] = t91;
817
- $[140] = t92;
818
- $[141] = t93;
819
- $[142] = t97;
796
+ $[137] = t85;
797
+ $[138] = t86;
798
+ $[139] = t87;
799
+ $[140] = t91;
820
800
  } else {
821
- t97 = $[142];
801
+ t91 = $[140];
822
802
  }
823
- let t98;
824
- if ($[143] !== setFieldValue) {
825
- t98 = (v_2) => setFieldValue("collectionGroup", v_2);
826
- $[143] = setFieldValue;
827
- $[144] = t98;
803
+ let t92;
804
+ if ($[141] !== setFieldValue) {
805
+ t92 = (v_2) => setFieldValue("collectionGroup", v_2);
806
+ $[141] = setFieldValue;
807
+ $[142] = t92;
828
808
  } else {
829
- t98 = $[144];
809
+ t92 = $[142];
830
810
  }
831
- const t99 = values.collectionGroup ?? false;
832
- let t100;
833
- if ($[145] !== t98 || $[146] !== t99) {
834
- t100 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t98, value: t99 });
835
- $[145] = t98;
836
- $[146] = t99;
837
- $[147] = t100;
811
+ const t93 = values.collectionGroup ?? false;
812
+ let t94;
813
+ if ($[143] !== t92 || $[144] !== t93) {
814
+ t94 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t92, value: t93 });
815
+ $[143] = t92;
816
+ $[144] = t93;
817
+ $[145] = t94;
838
818
  } else {
839
- t100 = $[147];
819
+ t94 = $[145];
840
820
  }
841
- let t101;
842
- if ($[148] === Symbol.for("react.memo_cache_sentinel")) {
843
- t101 = /* @__PURE__ */ jsx(FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
844
- $[148] = t101;
821
+ let t95;
822
+ if ($[146] === Symbol.for("react.memo_cache_sentinel")) {
823
+ t95 = /* @__PURE__ */ jsx(FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
824
+ $[146] = t95;
845
825
  } else {
846
- t101 = $[148];
826
+ t95 = $[146];
847
827
  }
848
- let t102;
849
- if ($[149] !== t100) {
850
- t102 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
851
- t100,
852
- t101
828
+ let t96;
829
+ if ($[147] !== t94) {
830
+ t96 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
831
+ t94,
832
+ t95
853
833
  ] });
854
- $[149] = t100;
855
- $[150] = t102;
834
+ $[147] = t94;
835
+ $[148] = t96;
856
836
  } else {
857
- t102 = $[150];
837
+ t96 = $[148];
858
838
  }
859
- let t103;
860
- if ($[151] !== setFieldValue) {
861
- t103 = (v_3) => setFieldValue("textSearchEnabled", v_3);
862
- $[151] = setFieldValue;
863
- $[152] = t103;
839
+ let t97;
840
+ if ($[149] !== setFieldValue) {
841
+ t97 = (v_3) => setFieldValue("textSearchEnabled", v_3);
842
+ $[149] = setFieldValue;
843
+ $[150] = t97;
864
844
  } else {
865
- t103 = $[152];
845
+ t97 = $[150];
866
846
  }
867
- const t104 = values.textSearchEnabled ?? false;
868
- let t105;
869
- if ($[153] !== t103 || $[154] !== t104) {
870
- t105 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t103, value: t104 });
871
- $[153] = t103;
872
- $[154] = t104;
873
- $[155] = t105;
847
+ const t98 = values.textSearchEnabled ?? false;
848
+ let t99;
849
+ if ($[151] !== t97 || $[152] !== t98) {
850
+ t99 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t97, value: t98 });
851
+ $[151] = t97;
852
+ $[152] = t98;
853
+ $[153] = t99;
874
854
  } else {
875
- t105 = $[155];
855
+ t99 = $[153];
876
856
  }
877
- let t106;
878
- if ($[156] === Symbol.for("react.memo_cache_sentinel")) {
879
- t106 = /* @__PURE__ */ jsx(FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
880
- $[156] = t106;
857
+ let t100;
858
+ if ($[154] === Symbol.for("react.memo_cache_sentinel")) {
859
+ t100 = /* @__PURE__ */ jsx(FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
860
+ $[154] = t100;
881
861
  } else {
882
- t106 = $[156];
862
+ t100 = $[154];
883
863
  }
884
- let t107;
885
- if ($[157] !== t105) {
886
- t107 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
887
- t105,
888
- t106
864
+ let t101;
865
+ if ($[155] !== t99) {
866
+ t101 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
867
+ t99,
868
+ t100
889
869
  ] });
890
- $[157] = t105;
891
- $[158] = t107;
870
+ $[155] = t99;
871
+ $[156] = t101;
892
872
  } else {
893
- t107 = $[158];
873
+ t101 = $[156];
894
874
  }
895
- let t108;
896
- if ($[159] !== t102 || $[160] !== t107 || $[161] !== t54 || $[162] !== t62 || $[163] !== t74 || $[164] !== t81 || $[165] !== t84 || $[166] !== t90 || $[167] !== t97) {
897
- t108 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
898
- t54,
899
- t62,
900
- t74,
901
- t81,
875
+ let t102;
876
+ if ($[157] !== t101 || $[158] !== t48 || $[159] !== t56 || $[160] !== t68 || $[161] !== t75 || $[162] !== t78 || $[163] !== t84 || $[164] !== t91 || $[165] !== t96) {
877
+ t102 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
878
+ t48,
879
+ t56,
880
+ t68,
881
+ t75,
882
+ t78,
902
883
  t84,
903
- t90,
904
- t97,
905
- t102,
906
- t107
884
+ t91,
885
+ t96,
886
+ t101
907
887
  ] });
908
- $[159] = t102;
909
- $[160] = t107;
910
- $[161] = t54;
911
- $[162] = t62;
912
- $[163] = t74;
913
- $[164] = t81;
914
- $[165] = t84;
915
- $[166] = t90;
916
- $[167] = t97;
917
- $[168] = t108;
918
- } else {
919
- t108 = $[168];
920
- }
921
- let t109;
922
- if ($[169] !== advancedPanelExpanded || $[170] !== t108) {
923
- t109 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t47, initiallyExpanded: false, children: t108 });
924
- $[169] = advancedPanelExpanded;
925
- $[170] = t108;
926
- $[171] = t109;
927
- } else {
928
- t109 = $[171];
888
+ $[157] = t101;
889
+ $[158] = t48;
890
+ $[159] = t56;
891
+ $[160] = t68;
892
+ $[161] = t75;
893
+ $[162] = t78;
894
+ $[163] = t84;
895
+ $[164] = t91;
896
+ $[165] = t96;
897
+ $[166] = t102;
898
+ } else {
899
+ t102 = $[166];
929
900
  }
930
- let t110;
931
- if ($[172] !== children || $[173] !== t109) {
932
- t110 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
933
- t109,
901
+ let t103;
902
+ if ($[167] !== advancedPanelExpanded || $[168] !== t102) {
903
+ t103 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t102 });
904
+ $[167] = advancedPanelExpanded;
905
+ $[168] = t102;
906
+ $[169] = t103;
907
+ } else {
908
+ t103 = $[169];
909
+ }
910
+ let t104;
911
+ if ($[170] !== children || $[171] !== t103) {
912
+ t104 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
913
+ t103,
934
914
  children
935
915
  ] });
936
- $[172] = children;
937
- $[173] = t109;
938
- $[174] = t110;
916
+ $[170] = children;
917
+ $[171] = t103;
918
+ $[172] = t104;
939
919
  } else {
940
- t110 = $[174];
920
+ t104 = $[172];
941
921
  }
942
- let t111;
943
- if ($[175] !== t110 || $[176] !== t27 || $[177] !== t36 || $[178] !== t37 || $[179] !== t40 || $[180] !== t46) {
944
- t111 = /* @__PURE__ */ jsxs("div", { className: t19, children: [
945
- t27,
946
- t36,
947
- t37,
922
+ let t105;
923
+ if ($[173] !== t104 || $[174] !== t23 || $[175] !== t31 || $[176] !== t34 || $[177] !== t40) {
924
+ t105 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4", children: [
925
+ t23,
926
+ t31,
927
+ t34,
948
928
  t40,
949
- t46,
950
- t110
929
+ t104
951
930
  ] });
952
- $[175] = t110;
953
- $[176] = t27;
954
- $[177] = t36;
955
- $[178] = t37;
956
- $[179] = t40;
957
- $[180] = t46;
958
- $[181] = t111;
959
- } else {
960
- t111 = $[181];
961
- }
962
- let t112;
963
- if ($[182] === Symbol.for("react.memo_cache_sentinel")) {
964
- t112 = /* @__PURE__ */ jsx("div", { style: {
931
+ $[173] = t104;
932
+ $[174] = t23;
933
+ $[175] = t31;
934
+ $[176] = t34;
935
+ $[177] = t40;
936
+ $[178] = t105;
937
+ } else {
938
+ t105 = $[178];
939
+ }
940
+ let t106;
941
+ if ($[179] === Symbol.for("react.memo_cache_sentinel")) {
942
+ t106 = /* @__PURE__ */ jsx("div", { style: {
965
943
  height: "52px"
966
944
  } });
967
- $[182] = t112;
945
+ $[179] = t106;
968
946
  } else {
969
- t112 = $[182];
947
+ t106 = $[179];
970
948
  }
971
- let t113;
972
- if ($[183] !== setFieldValue) {
973
- t113 = (icon) => {
949
+ let t107;
950
+ if ($[180] !== setFieldValue) {
951
+ t107 = (icon) => {
974
952
  setIconDialogOpen(false);
975
953
  setFieldValue("icon", icon);
976
954
  };
977
- $[183] = setFieldValue;
978
- $[184] = t113;
955
+ $[180] = setFieldValue;
956
+ $[181] = t107;
979
957
  } else {
980
- t113 = $[184];
958
+ t107 = $[181];
981
959
  }
982
- let t114;
983
- if ($[185] !== t113 || $[186] !== values.icon) {
984
- t114 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t113 }) });
985
- $[185] = t113;
986
- $[186] = values.icon;
987
- $[187] = t114;
960
+ let t108;
961
+ if ($[182] !== t107 || $[183] !== values.icon) {
962
+ t108 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t107 }) });
963
+ $[182] = t107;
964
+ $[183] = values.icon;
965
+ $[184] = t108;
988
966
  } else {
989
- t114 = $[187];
967
+ t108 = $[184];
990
968
  }
991
- let t115;
992
- if ($[188] !== iconDialogOpen || $[189] !== t114) {
993
- t115 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t114 });
994
- $[188] = iconDialogOpen;
995
- $[189] = t114;
996
- $[190] = t115;
969
+ let t109;
970
+ if ($[185] !== iconDialogOpen || $[186] !== t108) {
971
+ t109 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t108 });
972
+ $[185] = iconDialogOpen;
973
+ $[186] = t108;
974
+ $[187] = t109;
997
975
  } else {
998
- t115 = $[190];
976
+ t109 = $[187];
999
977
  }
1000
- let t116;
1001
- if ($[191] !== T0 || $[192] !== t111 || $[193] !== t115 || $[194] !== t18) {
1002
- t116 = /* @__PURE__ */ jsx("div", { className: t7, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t8, className: t9, children: [
1003
- t18,
1004
- t111,
1005
- t112,
1006
- t115
978
+ let t110;
979
+ if ($[188] !== t105 || $[189] !== t109 || $[190] !== t15) {
980
+ t110 = /* @__PURE__ */ jsx("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ jsxs(Container, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
981
+ t15,
982
+ t105,
983
+ t106,
984
+ t109
1007
985
  ] }) });
1008
- $[191] = T0;
1009
- $[192] = t111;
1010
- $[193] = t115;
1011
- $[194] = t18;
1012
- $[195] = t116;
986
+ $[188] = t105;
987
+ $[189] = t109;
988
+ $[190] = t15;
989
+ $[191] = t110;
1013
990
  } else {
1014
- t116 = $[195];
991
+ t110 = $[191];
1015
992
  }
1016
- return t116;
993
+ return t110;
1017
994
  }
1018
995
  function _temp3$4(value_3) {
1019
996
  if (value_3 === "code_defined") {
@@ -2514,7 +2491,7 @@ function PropertyFieldPreview(t0) {
2514
2491
  const t4 = selected ? cardSelectedMixin : "";
2515
2492
  let t5;
2516
2493
  if ($[5] !== borderColorClass || $[6] !== t3 || $[7] !== t4) {
2517
- t5 = cls("border", "pl-2 w-full flex flex-row gap-4 items-center", cardMixin, t3, t4, "flex-grow p-4 border transition-colors duration-200", borderColorClass);
2494
+ t5 = cls("m-1", "border", "pl-2 w-full flex flex-row gap-4 items-center", cardMixin, t3, t4, "flex-grow p-4 border transition-colors duration-200", borderColorClass);
2518
2495
  $[5] = borderColorClass;
2519
2496
  $[6] = t3;
2520
2497
  $[7] = t4;
@@ -4408,7 +4385,8 @@ function ReferencePropertyField(t0) {
4408
4385
  existing,
4409
4386
  multiple,
4410
4387
  disabled,
4411
- showErrors
4388
+ showErrors,
4389
+ asString
4412
4390
  } = t0;
4413
4391
  const {
4414
4392
  values,
@@ -4426,7 +4404,7 @@ function ReferencePropertyField(t0) {
4426
4404
  }
4427
4405
  return t12;
4428
4406
  }
4429
- const pathPath = multiple ? "of.path" : "path";
4407
+ const pathPath = asString ? "reference.path" : multiple ? "of.path" : "path";
4430
4408
  let t1;
4431
4409
  if ($[1] !== pathPath || $[2] !== values) {
4432
4410
  t1 = getIn(values, pathPath);
@@ -5035,6 +5013,12 @@ function updatePropertyFromWidget(propertyData, selectedWidgetId, propertyConfig
5035
5013
  propertyConfig: "reference",
5036
5014
  editable: propertyData.editable !== void 0 ? propertyData.editable : true
5037
5015
  });
5016
+ } else if (selectedWidgetId === "reference_as_string") {
5017
+ updatedProperty = mergeDeep(propertyData, {
5018
+ dataType: "string",
5019
+ propertyConfig: "reference_as_string",
5020
+ editable: propertyData.editable !== void 0 ? propertyData.editable : true
5021
+ });
5038
5022
  } else if (selectedWidgetId === "multi_references") {
5039
5023
  updatedProperty = mergeDeep(propertyData, {
5040
5024
  dataType: "array",
@@ -5217,7 +5201,7 @@ function _temp$6(value_0) {
5217
5201
  }
5218
5202
  }
5219
5203
  }
5220
- const supportedFieldsIds = ["text_field", "multiline", "markdown", "url", "email", "select", "multi_select", "number_input", "number_select", "multi_number_select", "file_upload", "multi_file_upload", "reference", "multi_references", "switch", "date_time", "group", "key_value", "repeat", "block"];
5204
+ const supportedFieldsIds = ["text_field", "multiline", "markdown", "url", "email", "select", "multi_select", "number_input", "number_select", "multi_number_select", "file_upload", "multi_file_upload", "reference", "reference_as_string", "multi_references", "switch", "date_time", "group", "key_value", "repeat", "block"];
5221
5205
  const supportedFields = Object.entries(DEFAULT_FIELD_CONFIGS).filter(([id]) => supportedFieldsIds.includes(id)).map(([id, config]) => ({
5222
5206
  [id]: config
5223
5207
  })).reduce((a, b) => ({
@@ -5893,7 +5877,7 @@ function PropertyFormDialog(t0) {
5893
5877
  return t11;
5894
5878
  }
5895
5879
  function PropertyEditFormFields(t0) {
5896
- const $ = c(142);
5880
+ const $ = c(146);
5897
5881
  const {
5898
5882
  values,
5899
5883
  errors,
@@ -6182,59 +6166,73 @@ function PropertyEditFormFields(t0) {
6182
6166
  }
6183
6167
  childComponent = t102;
6184
6168
  } else {
6185
- if (selectedFieldConfigId === "date_time") {
6169
+ if (selectedFieldConfigId === "reference_as_string") {
6186
6170
  let t102;
6187
- if ($[75] !== disabled) {
6188
- t102 = /* @__PURE__ */ jsx(DateTimePropertyField, { disabled });
6171
+ if ($[75] !== disabled || $[76] !== existing || $[77] !== showErrors) {
6172
+ t102 = /* @__PURE__ */ jsx(ReferencePropertyField, { showErrors, existing, asString: true, multiple: false, disabled });
6189
6173
  $[75] = disabled;
6190
- $[76] = t102;
6174
+ $[76] = existing;
6175
+ $[77] = showErrors;
6176
+ $[78] = t102;
6191
6177
  } else {
6192
- t102 = $[76];
6178
+ t102 = $[78];
6193
6179
  }
6194
6180
  childComponent = t102;
6195
6181
  } else {
6196
- if (selectedFieldConfigId === "multi_references") {
6182
+ if (selectedFieldConfigId === "date_time") {
6197
6183
  let t102;
6198
- if ($[77] !== disabled || $[78] !== existing || $[79] !== showErrors) {
6199
- t102 = /* @__PURE__ */ jsx(ReferencePropertyField, { showErrors, existing, multiple: true, disabled });
6200
- $[77] = disabled;
6201
- $[78] = existing;
6202
- $[79] = showErrors;
6184
+ if ($[79] !== disabled) {
6185
+ t102 = /* @__PURE__ */ jsx(DateTimePropertyField, { disabled });
6186
+ $[79] = disabled;
6203
6187
  $[80] = t102;
6204
6188
  } else {
6205
6189
  t102 = $[80];
6206
6190
  }
6207
6191
  childComponent = t102;
6208
6192
  } else {
6209
- if (selectedFieldConfigId === "repeat") {
6193
+ if (selectedFieldConfigId === "multi_references") {
6210
6194
  let t102;
6211
- if ($[81] !== allowDataInference || $[82] !== collectionEditable || $[83] !== disabled || $[84] !== existing || $[85] !== getData || $[86] !== propertyConfigs || $[87] !== showErrors) {
6212
- t102 = /* @__PURE__ */ jsx(RepeatPropertyField, { showErrors, existing, getData, allowDataInference, disabled, collectionEditable, propertyConfigs });
6213
- $[81] = allowDataInference;
6214
- $[82] = collectionEditable;
6215
- $[83] = disabled;
6216
- $[84] = existing;
6217
- $[85] = getData;
6218
- $[86] = propertyConfigs;
6219
- $[87] = showErrors;
6220
- $[88] = t102;
6195
+ if ($[81] !== disabled || $[82] !== existing || $[83] !== showErrors) {
6196
+ t102 = /* @__PURE__ */ jsx(ReferencePropertyField, { showErrors, existing, multiple: true, disabled });
6197
+ $[81] = disabled;
6198
+ $[82] = existing;
6199
+ $[83] = showErrors;
6200
+ $[84] = t102;
6221
6201
  } else {
6222
- t102 = $[88];
6202
+ t102 = $[84];
6223
6203
  }
6224
6204
  childComponent = t102;
6225
6205
  } else {
6226
- if (selectedFieldConfigId === "key_value") {
6206
+ if (selectedFieldConfigId === "repeat") {
6227
6207
  let t102;
6228
- if ($[89] !== disabled) {
6229
- t102 = /* @__PURE__ */ jsx(KeyValuePropertyField, { disabled });
6230
- $[89] = disabled;
6231
- $[90] = t102;
6208
+ if ($[85] !== allowDataInference || $[86] !== collectionEditable || $[87] !== disabled || $[88] !== existing || $[89] !== getData || $[90] !== propertyConfigs || $[91] !== showErrors) {
6209
+ t102 = /* @__PURE__ */ jsx(RepeatPropertyField, { showErrors, existing, getData, allowDataInference, disabled, collectionEditable, propertyConfigs });
6210
+ $[85] = allowDataInference;
6211
+ $[86] = collectionEditable;
6212
+ $[87] = disabled;
6213
+ $[88] = existing;
6214
+ $[89] = getData;
6215
+ $[90] = propertyConfigs;
6216
+ $[91] = showErrors;
6217
+ $[92] = t102;
6232
6218
  } else {
6233
- t102 = $[90];
6219
+ t102 = $[92];
6234
6220
  }
6235
6221
  childComponent = t102;
6236
6222
  } else {
6237
- childComponent = null;
6223
+ if (selectedFieldConfigId === "key_value") {
6224
+ let t102;
6225
+ if ($[93] !== disabled) {
6226
+ t102 = /* @__PURE__ */ jsx(KeyValuePropertyField, { disabled });
6227
+ $[93] = disabled;
6228
+ $[94] = t102;
6229
+ } else {
6230
+ t102 = $[94];
6231
+ }
6232
+ childComponent = t102;
6233
+ } else {
6234
+ childComponent = null;
6235
+ }
6238
6236
  }
6239
6237
  }
6240
6238
  }
@@ -6252,7 +6250,7 @@ function PropertyEditFormFields(t0) {
6252
6250
  }
6253
6251
  }
6254
6252
  let t10;
6255
- if ($[91] !== disabled) {
6253
+ if ($[95] !== disabled) {
6256
6254
  t10 = disabled && /* @__PURE__ */ jsxs(InfoLabel, { mode: "warn", children: [
6257
6255
  /* @__PURE__ */ jsx(Typography, { children: "This property can't be edited" }),
6258
6256
  /* @__PURE__ */ jsxs(Typography, { variant: "caption", children: [
@@ -6261,157 +6259,157 @@ function PropertyEditFormFields(t0) {
6261
6259
  " flag"
6262
6260
  ] })
6263
6261
  ] });
6264
- $[91] = disabled;
6265
- $[92] = t10;
6262
+ $[95] = disabled;
6263
+ $[96] = t10;
6266
6264
  } else {
6267
- t10 = $[92];
6265
+ t10 = $[96];
6268
6266
  }
6269
6267
  const t11 = selectedFieldConfigId;
6270
6268
  let t12;
6271
- if ($[93] !== onWidgetSelectChanged) {
6269
+ if ($[97] !== onWidgetSelectChanged) {
6272
6270
  t12 = (value) => onWidgetSelectChanged(value);
6273
- $[93] = onWidgetSelectChanged;
6274
- $[94] = t12;
6271
+ $[97] = onWidgetSelectChanged;
6272
+ $[98] = t12;
6275
6273
  } else {
6276
- t12 = $[94];
6274
+ t12 = $[98];
6277
6275
  }
6278
6276
  let t13;
6279
- if ($[95] !== onDismiss) {
6277
+ if ($[99] !== onDismiss) {
6280
6278
  t13 = (open, hasValue) => {
6281
6279
  if (!hasValue) {
6282
6280
  onDismiss?.();
6283
6281
  }
6284
6282
  setSelectOpen(open);
6285
6283
  };
6286
- $[95] = onDismiss;
6287
- $[96] = t13;
6284
+ $[99] = onDismiss;
6285
+ $[100] = t13;
6288
6286
  } else {
6289
- t13 = $[96];
6287
+ t13 = $[100];
6290
6288
  }
6291
6289
  const t14 = Boolean(selectedWidgetError);
6292
6290
  let t15;
6293
- if ($[97] !== disabled || $[98] !== existing || $[99] !== inArray || $[100] !== propertyConfigs || $[101] !== selectOpen || $[102] !== t11 || $[103] !== t12 || $[104] !== t13 || $[105] !== t14 || $[106] !== values) {
6291
+ if ($[101] !== disabled || $[102] !== existing || $[103] !== inArray || $[104] !== propertyConfigs || $[105] !== selectOpen || $[106] !== t11 || $[107] !== t12 || $[108] !== t13 || $[109] !== t14 || $[110] !== values) {
6294
6292
  t15 = /* @__PURE__ */ jsx(WidgetSelectView, { initialProperty: values, value: t11, onValueChange: t12, open: selectOpen, onOpenChange: t13, disabled, showError: t14, existing, propertyConfigs, inArray });
6295
- $[97] = disabled;
6296
- $[98] = existing;
6297
- $[99] = inArray;
6298
- $[100] = propertyConfigs;
6299
- $[101] = selectOpen;
6300
- $[102] = t11;
6301
- $[103] = t12;
6302
- $[104] = t13;
6303
- $[105] = t14;
6304
- $[106] = values;
6305
- $[107] = t15;
6306
- } else {
6307
- t15 = $[107];
6293
+ $[101] = disabled;
6294
+ $[102] = existing;
6295
+ $[103] = inArray;
6296
+ $[104] = propertyConfigs;
6297
+ $[105] = selectOpen;
6298
+ $[106] = t11;
6299
+ $[107] = t12;
6300
+ $[108] = t13;
6301
+ $[109] = t14;
6302
+ $[110] = values;
6303
+ $[111] = t15;
6304
+ } else {
6305
+ t15 = $[111];
6308
6306
  }
6309
6307
  let t16;
6310
- if ($[108] !== selectedWidgetError) {
6308
+ if ($[112] !== selectedWidgetError) {
6311
6309
  t16 = selectedWidgetError && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "ml-3.5", color: "error", children: "Required" });
6312
- $[108] = selectedWidgetError;
6313
- $[109] = t16;
6310
+ $[112] = selectedWidgetError;
6311
+ $[113] = t16;
6314
6312
  } else {
6315
- t16 = $[109];
6313
+ t16 = $[113];
6316
6314
  }
6317
6315
  let t17;
6318
- if ($[110] !== t15 || $[111] !== t16) {
6316
+ if ($[114] !== t15 || $[115] !== t16) {
6319
6317
  t17 = /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col gap-2", children: [
6320
6318
  t15,
6321
6319
  t16
6322
6320
  ] });
6323
- $[110] = t15;
6324
- $[111] = t16;
6325
- $[112] = t17;
6321
+ $[114] = t15;
6322
+ $[115] = t16;
6323
+ $[116] = t17;
6326
6324
  } else {
6327
- t17 = $[112];
6325
+ t17 = $[116];
6328
6326
  }
6329
6327
  let t18;
6330
- if ($[113] !== disabled || $[114] !== onDelete || $[115] !== values?.id) {
6328
+ if ($[117] !== disabled || $[118] !== onDelete || $[119] !== values?.id) {
6331
6329
  t18 = onDelete && values?.id && /* @__PURE__ */ jsx(IconButton, { variant: "ghost", className: "m-4", disabled, onClick: () => setDeleteDialogOpen(true), children: /* @__PURE__ */ jsx(DeleteIcon, {}) });
6332
- $[113] = disabled;
6333
- $[114] = onDelete;
6334
- $[115] = values?.id;
6335
- $[116] = t18;
6330
+ $[117] = disabled;
6331
+ $[118] = onDelete;
6332
+ $[119] = values?.id;
6333
+ $[120] = t18;
6336
6334
  } else {
6337
- t18 = $[116];
6335
+ t18 = $[120];
6338
6336
  }
6339
6337
  let t19;
6340
- if ($[117] !== t17 || $[118] !== t18) {
6338
+ if ($[121] !== t17 || $[122] !== t18) {
6341
6339
  t19 = /* @__PURE__ */ jsxs("div", { className: "flex mt-2 justify-between", children: [
6342
6340
  t17,
6343
6341
  t18
6344
6342
  ] });
6345
- $[117] = t17;
6346
- $[118] = t18;
6347
- $[119] = t19;
6343
+ $[121] = t17;
6344
+ $[122] = t18;
6345
+ $[123] = t19;
6348
6346
  } else {
6349
- t19 = $[119];
6347
+ t19 = $[123];
6350
6348
  }
6351
6349
  let t20;
6352
- if ($[120] !== autoUpdateId || $[121] !== disabled || $[122] !== existing || $[123] !== includeIdAndTitle || $[124] !== showErrors) {
6350
+ if ($[124] !== autoUpdateId || $[125] !== disabled || $[126] !== existing || $[127] !== includeIdAndTitle || $[128] !== showErrors) {
6353
6351
  t20 = includeIdAndTitle && /* @__PURE__ */ jsx(CommonPropertyFields, { showErrors, disabledId: existing, isNewProperty: !existing, disabled, autoUpdateId, ref: nameFieldRef });
6354
- $[120] = autoUpdateId;
6355
- $[121] = disabled;
6356
- $[122] = existing;
6357
- $[123] = includeIdAndTitle;
6358
- $[124] = showErrors;
6359
- $[125] = t20;
6352
+ $[124] = autoUpdateId;
6353
+ $[125] = disabled;
6354
+ $[126] = existing;
6355
+ $[127] = includeIdAndTitle;
6356
+ $[128] = showErrors;
6357
+ $[129] = t20;
6360
6358
  } else {
6361
- t20 = $[125];
6359
+ t20 = $[129];
6362
6360
  }
6363
6361
  let t21;
6364
- if ($[126] !== disabled) {
6362
+ if ($[130] !== disabled) {
6365
6363
  t21 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(AdvancedPropertyValidation, { disabled }) });
6366
- $[126] = disabled;
6367
- $[127] = t21;
6364
+ $[130] = disabled;
6365
+ $[131] = t21;
6368
6366
  } else {
6369
- t21 = $[127];
6367
+ t21 = $[131];
6370
6368
  }
6371
6369
  let t22;
6372
- if ($[128] !== childComponent || $[129] !== t20 || $[130] !== t21) {
6370
+ if ($[132] !== childComponent || $[133] !== t20 || $[134] !== t21) {
6373
6371
  t22 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
6374
6372
  t20,
6375
6373
  childComponent,
6376
6374
  t21
6377
6375
  ] });
6378
- $[128] = childComponent;
6379
- $[129] = t20;
6380
- $[130] = t21;
6381
- $[131] = t22;
6376
+ $[132] = childComponent;
6377
+ $[133] = t20;
6378
+ $[134] = t21;
6379
+ $[135] = t22;
6382
6380
  } else {
6383
- t22 = $[131];
6381
+ t22 = $[135];
6384
6382
  }
6385
6383
  let t23;
6386
- if ($[132] !== deleteDialogOpen || $[133] !== onDelete || $[134] !== propertyNamespace || $[135] !== values?.id) {
6384
+ if ($[136] !== deleteDialogOpen || $[137] !== onDelete || $[138] !== propertyNamespace || $[139] !== values?.id) {
6387
6385
  t23 = onDelete && /* @__PURE__ */ jsx(ConfirmationDialog, { open: deleteDialogOpen, onAccept: () => onDelete(values?.id, propertyNamespace), onCancel: () => setDeleteDialogOpen(false), title: /* @__PURE__ */ jsx("div", { children: "Delete this property?" }), body: /* @__PURE__ */ jsxs("div", { children: [
6388
6386
  " This will ",
6389
6387
  /* @__PURE__ */ jsx("b", { children: "not delete any data" }),
6390
6388
  ", only modify the collection."
6391
6389
  ] }) });
6392
- $[132] = deleteDialogOpen;
6393
- $[133] = onDelete;
6394
- $[134] = propertyNamespace;
6395
- $[135] = values?.id;
6396
- $[136] = t23;
6390
+ $[136] = deleteDialogOpen;
6391
+ $[137] = onDelete;
6392
+ $[138] = propertyNamespace;
6393
+ $[139] = values?.id;
6394
+ $[140] = t23;
6397
6395
  } else {
6398
- t23 = $[136];
6396
+ t23 = $[140];
6399
6397
  }
6400
6398
  let t24;
6401
- if ($[137] !== t10 || $[138] !== t19 || $[139] !== t22 || $[140] !== t23) {
6399
+ if ($[141] !== t10 || $[142] !== t19 || $[143] !== t22 || $[144] !== t23) {
6402
6400
  t24 = /* @__PURE__ */ jsxs(Fragment, { children: [
6403
6401
  t10,
6404
6402
  t19,
6405
6403
  t22,
6406
6404
  t23
6407
6405
  ] });
6408
- $[137] = t10;
6409
- $[138] = t19;
6410
- $[139] = t22;
6411
- $[140] = t23;
6412
- $[141] = t24;
6406
+ $[141] = t10;
6407
+ $[142] = t19;
6408
+ $[143] = t22;
6409
+ $[144] = t23;
6410
+ $[145] = t24;
6413
6411
  } else {
6414
- t24 = $[141];
6412
+ t24 = $[145];
6415
6413
  }
6416
6414
  return t24;
6417
6415
  }
@@ -6451,6 +6449,7 @@ const WIDGET_TYPE_MAP = {
6451
6449
  file_upload: "File",
6452
6450
  multi_file_upload: "File",
6453
6451
  reference: "Reference",
6452
+ reference_as_string: "Text",
6454
6453
  multi_references: "Reference",
6455
6454
  date_time: "Date",
6456
6455
  group: "Group",
@@ -6770,7 +6769,7 @@ function WidgetSelectViewItem(t0) {
6770
6769
  }
6771
6770
  let t10;
6772
6771
  if ($[20] !== onClick || $[21] !== t9) {
6773
- t10 = /* @__PURE__ */ jsx(Card, { onClick, className: "flex flex-row items-center px-4 py-2", children: t9 });
6772
+ t10 = /* @__PURE__ */ jsx(Card, { onClick, className: "flex flex-row items-center px-4 py-2 m-1", children: t9 });
6774
6773
  $[20] = onClick;
6775
6774
  $[21] = t9;
6776
6775
  $[22] = t10;
@@ -10667,7 +10666,7 @@ function NewCollectionCard(t0) {
10667
10666
  return t8;
10668
10667
  }
10669
10668
  function useCollectionEditorPlugin(t0) {
10670
- const $ = c(19);
10669
+ const $ = c(21);
10671
10670
  const {
10672
10671
  collectionConfigController,
10673
10672
  configPermissions,
@@ -10723,32 +10722,37 @@ function useCollectionEditorPlugin(t0) {
10723
10722
  t4 = $[11];
10724
10723
  }
10725
10724
  let t5;
10726
- if ($[12] !== t4) {
10725
+ if ($[12] !== collectionConfigController.navigationEntries || $[13] !== collectionConfigController.saveNavigationEntries || $[14] !== t4) {
10727
10726
  t5 = {
10728
10727
  additionalActions: t3,
10729
10728
  additionalChildrenStart: t4,
10730
10729
  CollectionActions: HomePageEditorCollectionAction,
10731
- AdditionalCards: NewCollectionCard
10730
+ AdditionalCards: NewCollectionCard,
10731
+ allowDragAndDrop: true,
10732
+ navigationEntries: collectionConfigController.navigationEntries,
10733
+ onNavigationEntriesUpdate: collectionConfigController.saveNavigationEntries
10732
10734
  };
10733
- $[12] = t4;
10734
- $[13] = t5;
10735
+ $[12] = collectionConfigController.navigationEntries;
10736
+ $[13] = collectionConfigController.saveNavigationEntries;
10737
+ $[14] = t4;
10738
+ $[15] = t5;
10735
10739
  } else {
10736
- t5 = $[13];
10740
+ t5 = $[15];
10737
10741
  }
10738
10742
  let t6;
10739
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
10743
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
10740
10744
  t6 = {
10741
10745
  CollectionActionsStart: EditorCollectionActionStart,
10742
10746
  CollectionActions: EditorCollectionAction,
10743
10747
  HeaderAction: CollectionViewHeaderAction,
10744
10748
  AddColumnComponent: PropertyAddColumnComponent
10745
10749
  };
10746
- $[14] = t6;
10750
+ $[16] = t6;
10747
10751
  } else {
10748
- t6 = $[14];
10752
+ t6 = $[16];
10749
10753
  }
10750
10754
  let t7;
10751
- if ($[15] !== collectionConfigController.loading || $[16] !== t2 || $[17] !== t5) {
10755
+ if ($[17] !== collectionConfigController.loading || $[18] !== t2 || $[19] !== t5) {
10752
10756
  t7 = {
10753
10757
  key: "collection_editor",
10754
10758
  loading: collectionConfigController.loading,
@@ -10756,12 +10760,12 @@ function useCollectionEditorPlugin(t0) {
10756
10760
  homePage: t5,
10757
10761
  collectionView: t6
10758
10762
  };
10759
- $[15] = collectionConfigController.loading;
10760
- $[16] = t2;
10761
- $[17] = t5;
10762
- $[18] = t7;
10763
+ $[17] = collectionConfigController.loading;
10764
+ $[18] = t2;
10765
+ $[19] = t5;
10766
+ $[20] = t7;
10763
10767
  } else {
10764
- t7 = $[18];
10768
+ t7 = $[20];
10765
10769
  }
10766
10770
  return t7;
10767
10771
  }