@firecms/core 3.4.0-canary.8635253 → 3.4.0-canary.d20cc85

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.
Files changed (87) hide show
  1. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +6 -1
  2. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +3 -1
  3. package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +3 -1
  4. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +7 -0
  5. package/dist/components/EntityCollectionView/useBoardDataController.d.ts +3 -1
  6. package/dist/components/ReferenceTable/ReferenceSelectionTable.d.ts +10 -1
  7. package/dist/components/SelectableTable/filters/filter_text_input.d.ts +30 -0
  8. package/dist/components/SelectableTable/filters/filter_text_input.test.d.ts +1 -0
  9. package/dist/components/common/table_url_params.d.ts +24 -0
  10. package/dist/components/common/useDataSourceTableController.d.ts +7 -1
  11. package/dist/components/common/useTableSearchHelper.d.ts +7 -1
  12. package/dist/core/EntityEditView.d.ts +7 -1
  13. package/dist/form/EntityForm.d.ts +6 -1
  14. package/dist/hooks/data/save.d.ts +1 -1
  15. package/dist/hooks/data/useCollectionFetch.d.ts +7 -1
  16. package/dist/hooks/data/useEntityFetch.d.ts +6 -1
  17. package/dist/index.es.js +949 -622
  18. package/dist/index.es.js.map +1 -1
  19. package/dist/index.umd.js +948 -621
  20. package/dist/index.umd.js.map +1 -1
  21. package/dist/types/collections.d.ts +7 -0
  22. package/dist/types/datasource.d.ts +59 -4
  23. package/dist/types/entities.d.ts +21 -1
  24. package/dist/types/properties.d.ts +17 -1
  25. package/dist/types/side_entity_controller.d.ts +6 -0
  26. package/dist/types/translations.d.ts +6 -0
  27. package/dist/util/__tests__/collections.test.d.ts +1 -0
  28. package/dist/util/__tests__/urls.test.d.ts +1 -0
  29. package/dist/util/collections.d.ts +1 -1
  30. package/dist/util/index.d.ts +1 -0
  31. package/dist/util/navigation_from_path.d.ts +7 -0
  32. package/dist/util/navigation_utils.d.ts +3 -1
  33. package/dist/util/parent_references_from_path.d.ts +1 -0
  34. package/dist/util/urls.d.ts +22 -0
  35. package/package.json +4 -4
  36. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +1 -0
  37. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +7 -0
  38. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +5 -1
  39. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +4 -0
  40. package/src/components/EntityCollectionView/EntityCollectionView.tsx +29 -3
  41. package/src/components/EntityCollectionView/useBoardDataController.tsx +11 -0
  42. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +11 -0
  43. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +33 -7
  44. package/src/components/SelectableTable/filters/filter_text_input.test.ts +184 -0
  45. package/src/components/SelectableTable/filters/filter_text_input.ts +71 -0
  46. package/src/components/common/table_url_params.ts +172 -0
  47. package/src/components/common/useDataSourceTableController.tsx +64 -175
  48. package/src/components/common/useTableSearchHelper.ts +21 -2
  49. package/src/contexts/SnackbarProvider.tsx +14 -1
  50. package/src/core/EntityEditView.tsx +21 -0
  51. package/src/core/EntitySidePanel.tsx +2 -0
  52. package/src/form/EntityForm.tsx +9 -3
  53. package/src/hooks/data/delete.ts +2 -0
  54. package/src/hooks/data/save.ts +2 -0
  55. package/src/hooks/data/useCollectionFetch.tsx +13 -0
  56. package/src/hooks/data/useEntityFetch.tsx +18 -0
  57. package/src/hooks/useResolvedNavigationFrom.tsx +2 -0
  58. package/src/hooks/useValidateAuthenticator.tsx +4 -0
  59. package/src/internal/useBuildDataSource.ts +25 -4
  60. package/src/internal/useBuildSideEntityController.tsx +6 -0
  61. package/src/locales/de.ts +5 -0
  62. package/src/locales/en.ts +5 -0
  63. package/src/locales/es.ts +5 -0
  64. package/src/locales/fr.ts +5 -0
  65. package/src/locales/hi.ts +5 -0
  66. package/src/locales/it.ts +5 -0
  67. package/src/locales/pl.ts +5 -0
  68. package/src/locales/pt.ts +5 -0
  69. package/src/preview/components/StorageThumbnail.tsx +24 -2
  70. package/src/routes/FireCMSRoute.tsx +3 -0
  71. package/src/types/collections.ts +8 -0
  72. package/src/types/datasource.ts +59 -4
  73. package/src/types/entities.ts +24 -1
  74. package/src/types/properties.ts +17 -0
  75. package/src/types/side_entity_controller.tsx +6 -0
  76. package/src/types/translations.ts +6 -0
  77. package/src/util/__tests__/collections.test.ts +32 -0
  78. package/src/util/__tests__/urls.test.ts +131 -0
  79. package/src/util/collections.ts +1 -1
  80. package/src/util/entities.ts +3 -1
  81. package/src/util/index.ts +1 -0
  82. package/src/util/navigation_from_path.ts +19 -1
  83. package/src/util/navigation_utils.ts +4 -0
  84. package/src/util/parent_references_from_path.ts +10 -2
  85. package/src/util/previews.ts +8 -1
  86. package/src/util/resolutions.ts +8 -0
  87. package/src/util/urls.ts +52 -0
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import * as React from "react";
4
- import React__default, { useState, useRef, useEffect, useContext, useCallback, useMemo, createElement, forwardRef, createRef, createContext, memo, useLayoutEffect } from "react";
4
+ import React__default, { useState, useEffect, useRef, useContext, useCallback, useMemo, createElement, forwardRef, createRef, createContext, memo, useLayoutEffect } from "react";
5
5
  import { getColorSchemeForSeed, CHIP_COLORS, FunctionsIcon, CircleIcon, iconKeys, coolIconKeys, Icon, Tooltip, ErrorIcon, Typography, IconButton, ContentCopyIcon, OpenInNewIcon, DescriptionIcon, cls, Skeleton, Chip, defaultBorderMixin, KeyboardTabIcon, Checkbox, AccountCircleIcon, Markdown, TextareaAutosize, focusedDisabled, MultiSelect, MultiSelectItem, Select, SelectItem, BooleanSwitch, DateTimeField, paperMixin, EditIcon, DoNotDisturbOnIcon, InfoIcon, CloseIcon, Button, ExpandablePanel, fieldBackgroundMixin, RemoveIcon, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, TextField, Collapse, BooleanSwitchWithLabel, AddIcon, ArrowDropDownIcon, MenuItem, Menu, CircularProgress, DialogActions, LoadingButton, WarningIcon, KeyboardArrowDownIcon, VisibilityIcon, CheckIcon, CancelIcon, DialogTitle, DialogContent, Dialog, Alert, NotesIcon, MoreVertIcon, Badge, SearchBar, ArrowUpwardIcon, Popover, FilterListIcon, CenteredView, AssignmentIcon, Label, useOutsideAlerter, FileCopyIcon, DeleteIcon, StarIcon, ArrowForwardIcon, Card, cardMixin, cardClickableMixin, Container, getColorSchemeForKey, RefreshIcon, ListIcon, AppsIcon, ViewKanbanIcon, ToggleButtonGroup, ViewColumnIcon, FilterListOffIcon, SearchIcon, DarkModeIcon, LightModeIcon, BrightnessMediumIcon, LogoutIcon, Avatar, HandleIcon, KeyboardArrowUpIcon, debounce, AutoAwesomeIcon, TranslateIcon, OpenInFullIcon, Sheet, Tab, ExpandMoreIcon, Tabs, CodeIcon, KeyboardDoubleArrowLeftIcon, KeyboardDoubleArrowRightIcon, ViewStreamIcon, RepeatIcon, BallotIcon, LocationOnIcon, ScheduleIcon, AddLinkIcon, LinkIcon, DriveFolderUploadIcon, UploadFileIcon, FormatListNumberedIcon, NumbersIcon, PersonIcon, ListAltIcon, FlagIcon, MailIcon, HttpIcon, FormatQuoteIcon, SubjectIcon, ShortTextIcon, MenuIcon, TextFieldsIcon, CheckBoxIcon, LooksOneIcon, LooksTwoIcon, Looks3Icon, FormatListBulletedIcon, ImageIcon, TableChartIcon, AutoFixHighIcon, FormatBoldIcon, FormatItalicIcon, FormatUnderlinedIcon, FormatStrikethroughIcon, useInjectStyles, Separator } from "@firecms/ui";
6
6
  import { SnackbarProvider as SnackbarProvider$1, useSnackbar } from "notistack";
7
7
  import hash from "object-hash";
@@ -46,19 +46,35 @@ import { gapCursor } from "prosemirror-gapcursor";
46
46
  import { inputRules, smartQuotes, ellipsis, emDash, InputRule, wrappingInputRule, textblockTypeInputRule } from "prosemirror-inputrules";
47
47
  import { createRoot } from "react-dom/client";
48
48
  const SnackbarProvider = (t0) => {
49
- const $ = c(2);
49
+ const $ = c(5);
50
50
  const {
51
51
  children
52
52
  } = t0;
53
+ const [domRoot, setDomRoot] = useState(void 0);
53
54
  let t1;
54
- if ($[0] !== children) {
55
- t1 = /* @__PURE__ */ jsx(SnackbarProvider$1, { maxSnack: 3, autoHideDuration: 3500, children });
56
- $[0] = children;
57
- $[1] = t1;
55
+ let t2;
56
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
57
+ t1 = () => {
58
+ setDomRoot(document.body);
59
+ };
60
+ t2 = [];
61
+ $[0] = t1;
62
+ $[1] = t2;
58
63
  } else {
59
- t1 = $[1];
64
+ t1 = $[0];
65
+ t2 = $[1];
60
66
  }
61
- return t1;
67
+ useEffect(t1, t2);
68
+ let t3;
69
+ if ($[2] !== children || $[3] !== domRoot) {
70
+ t3 = /* @__PURE__ */ jsx(SnackbarProvider$1, { maxSnack: 3, domRoot, autoHideDuration: 3500, children });
71
+ $[2] = children;
72
+ $[3] = domRoot;
73
+ $[4] = t3;
74
+ } else {
75
+ t3 = $[4];
76
+ }
77
+ return t3;
62
78
  };
63
79
  const DEFAULT_MODE_STATE = {
64
80
  mode: "light",
@@ -307,6 +323,7 @@ function navigateToEntity({
307
323
  copy,
308
324
  path,
309
325
  fullIdPath,
326
+ pathSegments,
310
327
  selectedTab,
311
328
  sideEntityController,
312
329
  onClose,
@@ -317,6 +334,7 @@ function navigateToEntity({
317
334
  entityId,
318
335
  path,
319
336
  fullIdPath,
337
+ pathSegments,
320
338
  copy,
321
339
  selectedTab,
322
340
  collection,
@@ -351,10 +369,21 @@ class EntityReference {
351
369
  * Optional database ID where the entity is stored (if multiple databases are used)
352
370
  */
353
371
  databaseId;
354
- constructor(id, path, databaseId) {
372
+ /**
373
+ * `path` split at its real segment boundaries, e.g. `["nodes", "node/42", "edges"]`.
374
+ *
375
+ * `path` is a single flattened string, so a parent entity id containing "/" cannot be
376
+ * recovered from it. This keeps each segment whole.
377
+ *
378
+ * Optional, and never derived by splitting `path` — a guess would be wrong in exactly
379
+ * the case the field exists for. Absent means "not known here", not "no slashes".
380
+ */
381
+ pathSegments;
382
+ constructor(id, path, databaseId, pathSegments) {
355
383
  this.id = id;
356
384
  this.path = path;
357
385
  this.databaseId = databaseId;
386
+ this.pathSegments = pathSegments;
358
387
  }
359
388
  get pathWithId() {
360
389
  return `${this.path}/${this.id}`;
@@ -725,7 +754,7 @@ function getReferenceFrom(entity) {
725
754
  if (!entity) {
726
755
  throw new Error("getReferenceFrom: entity is null or undefined");
727
756
  }
728
- return new EntityReference(entity.id, entity.path, entity.databaseId);
757
+ return new EntityReference(entity.id, entity.path, entity.databaseId, entity.pathSegments);
729
758
  }
730
759
  function traverseValuesProperties(inputValues, properties, operation) {
731
760
  const safeInputValues = inputValues ?? {};
@@ -1021,6 +1050,7 @@ function resolveArrayProperty({
1021
1050
  ...props
1022
1051
  });
1023
1052
  const ofProperty = resolveProperty({
1053
+ propertyKey,
1024
1054
  propertyOrBuilder: of,
1025
1055
  ignoreMissingFields,
1026
1056
  ...props
@@ -1149,7 +1179,8 @@ function getNavigationEntriesFromPath(props) {
1149
1179
  collections = [],
1150
1180
  currentFullPath,
1151
1181
  currentFullIdPath,
1152
- currentFullUrlPath
1182
+ currentFullUrlPath,
1183
+ currentPathSegments = []
1153
1184
  } = props;
1154
1185
  const subpaths = removeInitialAndTrailingSlashes(path).split("/");
1155
1186
  const subpathCombinations = getCollectionPathsCombinations(subpaths);
@@ -1165,12 +1196,14 @@ function getNavigationEntriesFromPath(props) {
1165
1196
  const collectionPath = currentFullPath && currentFullPath.length > 0 ? currentFullPath + "/" + collection.path : collection.path;
1166
1197
  const collectionUrlPath = currentFullUrlPath && currentFullUrlPath.length > 0 ? currentFullUrlPath + "/" + collection.path : collection.path;
1167
1198
  const fullIdPath = currentFullIdPath && currentFullIdPath.length > 0 ? currentFullIdPath + "/" + collection.id : collection.id;
1199
+ const collectionSegments = [...currentPathSegments, ...collection.path.split("/")];
1168
1200
  result.push({
1169
1201
  type: "collection",
1170
1202
  id: collection.id,
1171
1203
  path: collectionPath,
1172
1204
  fullPath: collectionUrlPath,
1173
1205
  fullIdPath,
1206
+ pathSegments: collectionSegments,
1174
1207
  collection
1175
1208
  });
1176
1209
  const restOfThePath = removeInitialAndTrailingSlashes(removeInitialAndTrailingSlashes(path).replace(subpathCombination, ""));
@@ -1180,12 +1213,14 @@ function getNavigationEntriesFromPath(props) {
1180
1213
  const entityId = decodeEntityId(encodedEntityId);
1181
1214
  const fullPath = collectionPath + "/" + entityId;
1182
1215
  const fullUrlPath = collectionUrlPath + "/" + encodedEntityId;
1216
+ const entitySegments = [...collectionSegments, entityId];
1183
1217
  result.push({
1184
1218
  type: "entity",
1185
1219
  entityId,
1186
1220
  path: collectionPath,
1187
1221
  fullIdPath,
1188
1222
  fullPath: fullUrlPath,
1223
+ pathSegments: collectionSegments,
1189
1224
  parentCollection: collection
1190
1225
  });
1191
1226
  if (nextSegments.length > 1) {
@@ -1202,6 +1237,7 @@ function getNavigationEntriesFromPath(props) {
1202
1237
  entityId,
1203
1238
  fullIdPath,
1204
1239
  fullPath: fullUrlPath + "/" + customView.key,
1240
+ pathSegments: collectionSegments,
1205
1241
  view: customView
1206
1242
  });
1207
1243
  } else if (collection.subcollections) {
@@ -1211,6 +1247,7 @@ function getNavigationEntriesFromPath(props) {
1211
1247
  currentFullPath: fullPath,
1212
1248
  currentFullIdPath: fullIdPath,
1213
1249
  currentFullUrlPath: fullUrlPath,
1250
+ currentPathSegments: entitySegments,
1214
1251
  contextEntityViews: props.contextEntityViews
1215
1252
  }));
1216
1253
  }
@@ -1314,7 +1351,7 @@ const applyPermissionsFunctionIfEmpty = (collections, permissionsBuilder) => {
1314
1351
  });
1315
1352
  };
1316
1353
  function getLocalChangesBackup(collection) {
1317
- if (!collection.localChangesBackup) {
1354
+ if (collection.localChangesBackup === void 0) {
1318
1355
  return "manual_apply";
1319
1356
  }
1320
1357
  return collection.localChangesBackup;
@@ -1401,6 +1438,31 @@ function isValidRegExp(input) {
1401
1438
  const simpleRegexp = input.match(/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)/);
1402
1439
  return !!simpleRegexp;
1403
1440
  }
1441
+ const ABSOLUTE_HTTP_URL_REGEX = /^https?:\/\//i;
1442
+ const IMAGE_EXTENSIONS = ["jpg", "jpeg", "png", "gif", "webp", "avif", "bmp", "svg", "ico", "tif", "tiff", "heic", "heif"];
1443
+ const VIDEO_EXTENSIONS = ["mp4", "webm", "ogv", "mov", "m4v", "avi", "mkv", "mpeg", "mpg", "3gp"];
1444
+ const AUDIO_EXTENSIONS = ["mp3", "wav", "ogg", "oga", "m4a", "aac", "flac", "weba", "opus", "mid", "midi"];
1445
+ function isAbsoluteHttpUrl(value) {
1446
+ if (!value) return false;
1447
+ return ABSOLUTE_HTTP_URL_REGEX.test(value);
1448
+ }
1449
+ function getFileExtensionFromUrl(urlOrPath) {
1450
+ if (!urlOrPath) return void 0;
1451
+ const withoutQuery = urlOrPath.split(/[?#]/)[0];
1452
+ const lastSegment = withoutQuery.split("/").pop();
1453
+ if (!lastSegment) return void 0;
1454
+ const lastDot = lastSegment.lastIndexOf(".");
1455
+ if (lastDot <= 0 || lastDot === lastSegment.length - 1) return void 0;
1456
+ return lastSegment.substring(lastDot + 1).toLowerCase();
1457
+ }
1458
+ function getPreviewTypeFromUrl(urlOrPath) {
1459
+ const extension = getFileExtensionFromUrl(urlOrPath);
1460
+ if (!extension) return void 0;
1461
+ if (IMAGE_EXTENSIONS.includes(extension)) return "image";
1462
+ if (VIDEO_EXTENSIONS.includes(extension)) return "video";
1463
+ if (AUDIO_EXTENSIONS.includes(extension)) return "audio";
1464
+ return void 0;
1465
+ }
1404
1466
  const reservedKeys = ["edit", "copy", "delete"];
1405
1467
  function mergeEntityActions(currentActions, newActions) {
1406
1468
  const updatedActions = [];
@@ -3811,6 +3873,12 @@ function getEntityTitlePropertyKey(collection, propertyConfigs) {
3811
3873
  return void 0;
3812
3874
  }
3813
3875
  function getEntityImagePreviewPropertyKey(collection) {
3876
+ if (collection.imageProperty) {
3877
+ const imagePropertyKey = collection.imageProperty;
3878
+ if (collection.properties[imagePropertyKey]) {
3879
+ return collection.imageProperty;
3880
+ }
3881
+ }
3814
3882
  for (const key in collection.properties) {
3815
3883
  const property = collection.properties[key];
3816
3884
  if (property.dataType === "string" && property.storage?.acceptedFiles?.includes("image/*")) {
@@ -4579,9 +4647,10 @@ const useFireCMSContext = () => {
4579
4647
  return fireCMSContextRef.current;
4580
4648
  };
4581
4649
  function useCollectionFetch(t0) {
4582
- const $ = c(26);
4650
+ const $ = c(27);
4583
4651
  const {
4584
4652
  path: inputPath,
4653
+ pathSegments,
4585
4654
  collection,
4586
4655
  filterValues,
4587
4656
  sortBy,
@@ -4615,10 +4684,16 @@ function useCollectionFetch(t0) {
4615
4684
  const [dataLoadingError, setDataLoadingError] = useState();
4616
4685
  const [noMoreToLoad, setNoMoreToLoad] = useState(false);
4617
4686
  let t3;
4618
- if ($[4] !== collection || $[5] !== context || $[6] !== currentSort || $[7] !== dataSource || $[8] !== filterValues || $[9] !== itemCount || $[10] !== path || $[11] !== searchString || $[12] !== sortByProperty) {
4687
+ if ($[4] !== collection || $[5] !== context || $[6] !== currentSort || $[7] !== dataSource || $[8] !== filterValues || $[9] !== itemCount || $[10] !== path || $[11] !== pathSegments || $[12] !== searchString || $[13] !== sortByProperty) {
4619
4688
  t3 = () => {
4620
4689
  setDataLoading(true);
4621
4690
  const onEntitiesUpdate = async (entities) => {
4691
+ if (pathSegments) {
4692
+ entities = entities.map((e) => e.pathSegments ? e : {
4693
+ ...e,
4694
+ pathSegments
4695
+ });
4696
+ }
4622
4697
  if (collection.callbacks?.onFetch) {
4623
4698
  try {
4624
4699
  entities = await Promise.all(entities.map((entity) => collection.callbacks.onFetch({
@@ -4628,8 +4703,8 @@ function useCollectionFetch(t0) {
4628
4703
  context
4629
4704
  })));
4630
4705
  } catch (t42) {
4631
- const e = t42;
4632
- console.error(e);
4706
+ const e_0 = t42;
4707
+ console.error(e_0);
4633
4708
  }
4634
4709
  }
4635
4710
  setDataLoading(false);
@@ -4646,6 +4721,7 @@ function useCollectionFetch(t0) {
4646
4721
  if (dataSource.listenCollection) {
4647
4722
  return dataSource.listenCollection({
4648
4723
  path,
4724
+ pathSegments,
4649
4725
  collection,
4650
4726
  onUpdate: onEntitiesUpdate,
4651
4727
  onError,
@@ -4659,6 +4735,7 @@ function useCollectionFetch(t0) {
4659
4735
  } else {
4660
4736
  dataSource.fetchCollection({
4661
4737
  path,
4738
+ pathSegments,
4662
4739
  collection,
4663
4740
  searchString,
4664
4741
  filter: filterValues,
@@ -4677,56 +4754,58 @@ function useCollectionFetch(t0) {
4677
4754
  $[8] = filterValues;
4678
4755
  $[9] = itemCount;
4679
4756
  $[10] = path;
4680
- $[11] = searchString;
4681
- $[12] = sortByProperty;
4682
- $[13] = t3;
4757
+ $[11] = pathSegments;
4758
+ $[12] = searchString;
4759
+ $[13] = sortByProperty;
4760
+ $[14] = t3;
4683
4761
  } else {
4684
- t3 = $[13];
4762
+ t3 = $[14];
4685
4763
  }
4686
4764
  let t4;
4687
- if ($[14] !== currentSort || $[15] !== filterValues || $[16] !== itemCount || $[17] !== path || $[18] !== searchString || $[19] !== sortByProperty) {
4765
+ if ($[15] !== currentSort || $[16] !== filterValues || $[17] !== itemCount || $[18] !== path || $[19] !== searchString || $[20] !== sortByProperty) {
4688
4766
  t4 = [path, itemCount, currentSort, sortByProperty, filterValues, searchString];
4689
- $[14] = currentSort;
4690
- $[15] = filterValues;
4691
- $[16] = itemCount;
4692
- $[17] = path;
4693
- $[18] = searchString;
4694
- $[19] = sortByProperty;
4695
- $[20] = t4;
4767
+ $[15] = currentSort;
4768
+ $[16] = filterValues;
4769
+ $[17] = itemCount;
4770
+ $[18] = path;
4771
+ $[19] = searchString;
4772
+ $[20] = sortByProperty;
4773
+ $[21] = t4;
4696
4774
  } else {
4697
- t4 = $[20];
4775
+ t4 = $[21];
4698
4776
  }
4699
4777
  useEffect(t3, t4);
4700
4778
  let t5;
4701
- if ($[21] !== data || $[22] !== dataLoading || $[23] !== dataLoadingError || $[24] !== noMoreToLoad) {
4779
+ if ($[22] !== data || $[23] !== dataLoading || $[24] !== dataLoadingError || $[25] !== noMoreToLoad) {
4702
4780
  t5 = {
4703
4781
  data,
4704
4782
  dataLoading,
4705
4783
  dataLoadingError,
4706
4784
  noMoreToLoad
4707
4785
  };
4708
- $[21] = data;
4709
- $[22] = dataLoading;
4710
- $[23] = dataLoadingError;
4711
- $[24] = noMoreToLoad;
4712
- $[25] = t5;
4786
+ $[22] = data;
4787
+ $[23] = dataLoading;
4788
+ $[24] = dataLoadingError;
4789
+ $[25] = noMoreToLoad;
4790
+ $[26] = t5;
4713
4791
  } else {
4714
- t5 = $[25];
4792
+ t5 = $[26];
4715
4793
  }
4716
4794
  return t5;
4717
4795
  }
4718
4796
  function _temp2$f() {
4719
4797
  }
4720
- function _temp$D(e_0) {
4798
+ function _temp$D(e_1) {
4721
4799
  return {
4722
- ...e_0
4800
+ ...e_1
4723
4801
  };
4724
4802
  }
4725
4803
  const CACHE = {};
4726
4804
  function useEntityFetch(t0) {
4727
- const $ = c(18);
4805
+ const $ = c(19);
4728
4806
  const {
4729
4807
  path: inputPath,
4808
+ pathSegments: inputPathSegments,
4730
4809
  entityId,
4731
4810
  collection,
4732
4811
  databaseId,
@@ -4745,15 +4824,22 @@ function useEntityFetch(t0) {
4745
4824
  t2 = $[2];
4746
4825
  }
4747
4826
  const path = t2;
4827
+ const pathSegments = inputPathSegments;
4748
4828
  const context = useFireCMSContext();
4749
4829
  const [entity, setEntity] = useState();
4750
4830
  const [dataLoading, setDataLoading] = useState(true);
4751
4831
  const [dataLoadingError, setDataLoadingError] = useState();
4752
4832
  let t3;
4753
- if ($[3] !== collection || $[4] !== context || $[5] !== dataSource || $[6] !== databaseId || $[7] !== entityId || $[8] !== path || $[9] !== useCache) {
4833
+ if ($[3] !== collection || $[4] !== context || $[5] !== dataSource || $[6] !== databaseId || $[7] !== entityId || $[8] !== path || $[9] !== pathSegments || $[10] !== useCache) {
4754
4834
  t3 = () => {
4755
4835
  setDataLoading(true);
4756
4836
  const onEntityUpdate = async (updatedEntity) => {
4837
+ if (updatedEntity && pathSegments && !updatedEntity.pathSegments) {
4838
+ updatedEntity = {
4839
+ ...updatedEntity,
4840
+ pathSegments
4841
+ };
4842
+ }
4757
4843
  if (collection.callbacks?.onFetch && updatedEntity) {
4758
4844
  try {
4759
4845
  updatedEntity = await collection.callbacks.onFetch({
@@ -4788,6 +4874,7 @@ function useEntityFetch(t0) {
4788
4874
  if (dataSource.listenEntity) {
4789
4875
  return dataSource.listenEntity({
4790
4876
  path,
4877
+ pathSegments,
4791
4878
  entityId,
4792
4879
  databaseId,
4793
4880
  collection,
@@ -4797,6 +4884,7 @@ function useEntityFetch(t0) {
4797
4884
  } else {
4798
4885
  dataSource.fetchEntity({
4799
4886
  path,
4887
+ pathSegments,
4800
4888
  entityId,
4801
4889
  databaseId,
4802
4890
  collection
@@ -4815,34 +4903,35 @@ function useEntityFetch(t0) {
4815
4903
  $[6] = databaseId;
4816
4904
  $[7] = entityId;
4817
4905
  $[8] = path;
4818
- $[9] = useCache;
4819
- $[10] = t3;
4906
+ $[9] = pathSegments;
4907
+ $[10] = useCache;
4908
+ $[11] = t3;
4820
4909
  } else {
4821
- t3 = $[10];
4910
+ t3 = $[11];
4822
4911
  }
4823
4912
  let t4;
4824
- if ($[11] !== entityId || $[12] !== path) {
4913
+ if ($[12] !== entityId || $[13] !== path) {
4825
4914
  t4 = [entityId, path];
4826
- $[11] = entityId;
4827
- $[12] = path;
4828
- $[13] = t4;
4915
+ $[12] = entityId;
4916
+ $[13] = path;
4917
+ $[14] = t4;
4829
4918
  } else {
4830
- t4 = $[13];
4919
+ t4 = $[14];
4831
4920
  }
4832
4921
  useEffect(t3, t4);
4833
4922
  let t5;
4834
- if ($[14] !== dataLoading || $[15] !== dataLoadingError || $[16] !== entity) {
4923
+ if ($[15] !== dataLoading || $[16] !== dataLoadingError || $[17] !== entity) {
4835
4924
  t5 = {
4836
4925
  entity,
4837
4926
  dataLoading,
4838
4927
  dataLoadingError
4839
4928
  };
4840
- $[14] = dataLoading;
4841
- $[15] = dataLoadingError;
4842
- $[16] = entity;
4843
- $[17] = t5;
4929
+ $[15] = dataLoading;
4930
+ $[16] = dataLoadingError;
4931
+ $[17] = entity;
4932
+ $[18] = t5;
4844
4933
  } else {
4845
- t5 = $[17];
4934
+ t5 = $[18];
4846
4935
  }
4847
4936
  return t5;
4848
4937
  }
@@ -4855,6 +4944,7 @@ function _temp$C() {
4855
4944
  async function saveEntityWithCallbacks({
4856
4945
  collection,
4857
4946
  path,
4947
+ pathSegments,
4858
4948
  entityId,
4859
4949
  values,
4860
4950
  previousValues,
@@ -4904,6 +4994,7 @@ async function saveEntityWithCallbacks({
4904
4994
  return dataSource.saveEntity({
4905
4995
  collection,
4906
4996
  path: resolvedPath,
4997
+ pathSegments,
4907
4998
  entityId,
4908
4999
  values: updatedValues,
4909
5000
  previousValues,
@@ -4987,6 +5078,8 @@ async function deleteEntityWithCallbacks({
4987
5078
  }
4988
5079
  }
4989
5080
  return dataSource.deleteEntity({
5081
+ // Carried by the entity from the fetch that produced it; undefined if unknown.
5082
+ pathSegments: entity.pathSegments,
4990
5083
  entity,
4991
5084
  collection
4992
5085
  }).then(() => {
@@ -5028,6 +5121,8 @@ function resolveNavigationFrom({
5028
5121
  }
5029
5122
  return dataSource.fetchEntity({
5030
5123
  path: entry.path,
5124
+ // The navigation entry already knows the real segment boundaries.
5125
+ pathSegments: entry.pathSegments,
5031
5126
  entityId: entry.entityId,
5032
5127
  collection
5033
5128
  }).then((entity) => {
@@ -6080,8 +6175,9 @@ function areEqual$1(prevProps, nextProps) {
6080
6175
  }
6081
6176
  const URL_CACHE = {};
6082
6177
  function StorageThumbnailInternal(t0) {
6083
- const $ = c(13);
6178
+ const $ = c(26);
6084
6179
  const {
6180
+ storeUrl,
6085
6181
  interactive,
6086
6182
  storagePathOrDownloadUrl,
6087
6183
  size,
@@ -6089,11 +6185,21 @@ function StorageThumbnailInternal(t0) {
6089
6185
  } = t0;
6090
6186
  const [, setError] = React__default.useState(void 0);
6091
6187
  const storage = useStorageSource();
6092
- const [downloadConfig, setDownloadConfig] = React__default.useState(URL_CACHE[storagePathOrDownloadUrl]);
6093
6188
  let t1;
6094
- if ($[0] !== storage || $[1] !== storagePathOrDownloadUrl) {
6095
- t1 = () => {
6096
- if (!storagePathOrDownloadUrl) {
6189
+ if ($[0] !== storagePathOrDownloadUrl || $[1] !== storeUrl) {
6190
+ t1 = storeUrl || isAbsoluteHttpUrl(storagePathOrDownloadUrl);
6191
+ $[0] = storagePathOrDownloadUrl;
6192
+ $[1] = storeUrl;
6193
+ $[2] = t1;
6194
+ } else {
6195
+ t1 = $[2];
6196
+ }
6197
+ const valueIsUrl = t1;
6198
+ const [downloadConfig, setDownloadConfig] = React__default.useState(URL_CACHE[storagePathOrDownloadUrl]);
6199
+ let t2;
6200
+ if ($[3] !== storage || $[4] !== storagePathOrDownloadUrl || $[5] !== valueIsUrl) {
6201
+ t2 = () => {
6202
+ if (!storagePathOrDownloadUrl || valueIsUrl) {
6097
6203
  return;
6098
6204
  }
6099
6205
  let unmounted;
@@ -6108,50 +6214,75 @@ function StorageThumbnailInternal(t0) {
6108
6214
  unmounted = true;
6109
6215
  };
6110
6216
  };
6111
- $[0] = storage;
6112
- $[1] = storagePathOrDownloadUrl;
6113
- $[2] = t1;
6217
+ $[3] = storage;
6218
+ $[4] = storagePathOrDownloadUrl;
6219
+ $[5] = valueIsUrl;
6220
+ $[6] = t2;
6114
6221
  } else {
6115
- t1 = $[2];
6222
+ t2 = $[6];
6116
6223
  }
6117
- let t2;
6118
- if ($[3] !== storagePathOrDownloadUrl) {
6119
- t2 = [storagePathOrDownloadUrl];
6120
- $[3] = storagePathOrDownloadUrl;
6121
- $[4] = t2;
6224
+ let t3;
6225
+ if ($[7] !== storagePathOrDownloadUrl || $[8] !== valueIsUrl) {
6226
+ t3 = [storagePathOrDownloadUrl, valueIsUrl];
6227
+ $[7] = storagePathOrDownloadUrl;
6228
+ $[8] = valueIsUrl;
6229
+ $[9] = t3;
6122
6230
  } else {
6123
- t2 = $[4];
6231
+ t3 = $[9];
6124
6232
  }
6125
- useEffect(t1, t2);
6233
+ useEffect(t2, t3);
6126
6234
  if (!storagePathOrDownloadUrl) {
6127
6235
  return null;
6128
6236
  }
6237
+ if (valueIsUrl) {
6238
+ let t42;
6239
+ if ($[10] !== storagePathOrDownloadUrl) {
6240
+ t42 = getPreviewTypeFromUrl(storagePathOrDownloadUrl) ?? "file";
6241
+ $[10] = storagePathOrDownloadUrl;
6242
+ $[11] = t42;
6243
+ } else {
6244
+ t42 = $[11];
6245
+ }
6246
+ let t5;
6247
+ if ($[12] !== fill || $[13] !== interactive || $[14] !== size || $[15] !== storagePathOrDownloadUrl || $[16] !== t42) {
6248
+ t5 = /* @__PURE__ */ jsx(UrlComponentPreview, { previewType: t42, url: storagePathOrDownloadUrl, interactive, size, fill, hint: storagePathOrDownloadUrl });
6249
+ $[12] = fill;
6250
+ $[13] = interactive;
6251
+ $[14] = size;
6252
+ $[15] = storagePathOrDownloadUrl;
6253
+ $[16] = t42;
6254
+ $[17] = t5;
6255
+ } else {
6256
+ t5 = $[17];
6257
+ }
6258
+ return t5;
6259
+ }
6129
6260
  const filetype = downloadConfig?.metadata ? getFiletype(downloadConfig?.metadata.contentType) : void 0;
6130
6261
  const previewType = filetype?.startsWith("image") ? "image" : filetype?.startsWith("video") ? "video" : filetype?.startsWith("audio") ? "audio" : "file";
6131
6262
  if (downloadConfig?.fileNotFound) {
6132
- let t32;
6133
- if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6134
- t32 = /* @__PURE__ */ jsx(ErrorView, { error: "File not found" });
6135
- $[5] = t32;
6263
+ let t42;
6264
+ if ($[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6265
+ t42 = /* @__PURE__ */ jsx(ErrorView, { error: "File not found" });
6266
+ $[18] = t42;
6136
6267
  } else {
6137
- t32 = $[5];
6268
+ t42 = $[18];
6138
6269
  }
6139
- return t32;
6270
+ return t42;
6140
6271
  }
6141
- let t3;
6142
- if ($[6] !== downloadConfig || $[7] !== fill || $[8] !== interactive || $[9] !== previewType || $[10] !== size || $[11] !== storagePathOrDownloadUrl) {
6143
- t3 = downloadConfig?.url ? /* @__PURE__ */ jsx(UrlComponentPreview, { previewType, url: downloadConfig.url, interactive, size, fill, hint: storagePathOrDownloadUrl }) : renderSkeletonImageThumbnail(size, fill);
6144
- $[6] = downloadConfig;
6145
- $[7] = fill;
6146
- $[8] = interactive;
6147
- $[9] = previewType;
6148
- $[10] = size;
6149
- $[11] = storagePathOrDownloadUrl;
6150
- $[12] = t3;
6272
+ let t4;
6273
+ if ($[19] !== downloadConfig || $[20] !== fill || $[21] !== interactive || $[22] !== previewType || $[23] !== size || $[24] !== storagePathOrDownloadUrl) {
6274
+ t4 = downloadConfig?.url ? /* @__PURE__ */ jsx(UrlComponentPreview, { previewType, url: downloadConfig.url, interactive, size, fill, hint: storagePathOrDownloadUrl }) : renderSkeletonImageThumbnail(size, fill);
6275
+ $[19] = downloadConfig;
6276
+ $[20] = fill;
6277
+ $[21] = interactive;
6278
+ $[22] = previewType;
6279
+ $[23] = size;
6280
+ $[24] = storagePathOrDownloadUrl;
6281
+ $[25] = t4;
6151
6282
  } else {
6152
- t3 = $[12];
6283
+ t4 = $[25];
6153
6284
  }
6154
- return t3;
6285
+ return t4;
6155
6286
  }
6156
6287
  function getFiletype(input) {
6157
6288
  if (input.startsWith("image")) return "image/*";
@@ -16638,6 +16769,7 @@ function getChanges(source, comparison) {
16638
16769
  }
16639
16770
  function EntityForm({
16640
16771
  path,
16772
+ pathSegments,
16641
16773
  fullIdPath,
16642
16774
  entityId: entityIdProp,
16643
16775
  collection,
@@ -16704,7 +16836,7 @@ function EntityForm({
16704
16836
  if (mustSetCustomId) {
16705
16837
  return void 0;
16706
16838
  } else {
16707
- return dataSource.generateEntityId(path, collection);
16839
+ return dataSource.generateEntityId(path, collection, pathSegments);
16708
16840
  }
16709
16841
  } else {
16710
16842
  return entityIdProp;
@@ -16778,7 +16910,7 @@ function EntityForm({
16778
16910
  },
16779
16911
  onValuesChangeDeferred: (values_0, controller) => {
16780
16912
  const key = status === "new" || status === "copy" ? path + "#new" : path + "/" + entityId;
16781
- if (controller.dirty) {
16913
+ if (controller.dirty && localChangesBackup !== false) {
16782
16914
  const touchedValues = removeEmptyContainers(extractTouchedValues(values_0, controller.touched));
16783
16915
  if (touchedValues && Object.keys(touchedValues).length > 0) {
16784
16916
  saveEntityToCache(key, touchedValues);
@@ -17017,7 +17149,7 @@ function EntityForm({
17017
17149
  const uniqueFieldValidator = useCallback(({
17018
17150
  name,
17019
17151
  value
17020
- }) => dataSource.checkUniqueField(path, name, value, entityId, collection), [dataSource, path, entityId]);
17152
+ }) => dataSource.checkUniqueField(path, name, value, entityId, collection, pathSegments), [dataSource, path, entityId]);
17021
17153
  const validationSchema = useMemo(() => entityId ? getYupEntitySchema(entityId, resolvedCollection.properties, uniqueFieldValidator) : void 0, [entityId, resolvedCollection.properties, uniqueFieldValidator]);
17022
17154
  useOnAutoSave(autoSave, formex, lastSavedValues, save);
17023
17155
  const prevEntityValuesRef = useRef(entity?.values);
@@ -17293,7 +17425,7 @@ const EntityCollectionRowActions = function EntityCollectionRowActions2({
17293
17425
  return content;
17294
17426
  };
17295
17427
  function CollectionTableToolbar(t0) {
17296
- const $ = c(25);
17428
+ const $ = c(26);
17297
17429
  const {
17298
17430
  actions,
17299
17431
  actionsStart,
@@ -17301,6 +17433,7 @@ function CollectionTableToolbar(t0) {
17301
17433
  onTextSearch,
17302
17434
  onTextSearchClick,
17303
17435
  textSearchLoading,
17436
+ initialSearchString,
17304
17437
  title,
17305
17438
  viewModeToggle
17306
17439
  } = t0;
@@ -17367,41 +17500,42 @@ function CollectionTableToolbar(t0) {
17367
17500
  t6 = $[12];
17368
17501
  }
17369
17502
  let t7;
17370
- if ($[13] !== onTextSearch || $[14] !== onTextSearchClick || $[15] !== t || $[16] !== textSearchLoading) {
17371
- t7 = (onTextSearch || onTextSearchClick) && /* @__PURE__ */ jsx(SearchBar, { size: "small", inputRef: searchInputRef, loading: textSearchLoading, disabled: Boolean(onTextSearchClick), onClick: onTextSearchClick, onTextSearch: onTextSearchClick ? void 0 : onTextSearch, placeholder: t("search"), expandable: true }, "search-bar");
17372
- $[13] = onTextSearch;
17373
- $[14] = onTextSearchClick;
17374
- $[15] = t;
17375
- $[16] = textSearchLoading;
17376
- $[17] = t7;
17503
+ if ($[13] !== initialSearchString || $[14] !== onTextSearch || $[15] !== onTextSearchClick || $[16] !== t || $[17] !== textSearchLoading) {
17504
+ t7 = (onTextSearch || onTextSearchClick) && /* @__PURE__ */ jsx(SearchBar, { size: "small", inputRef: searchInputRef, loading: textSearchLoading, disabled: Boolean(onTextSearchClick), onClick: onTextSearchClick, onTextSearch: onTextSearchClick ? void 0 : onTextSearch, initialValue: initialSearchString, placeholder: t("search"), expandable: true }, "search-bar");
17505
+ $[13] = initialSearchString;
17506
+ $[14] = onTextSearch;
17507
+ $[15] = onTextSearchClick;
17508
+ $[16] = t;
17509
+ $[17] = textSearchLoading;
17510
+ $[18] = t7;
17377
17511
  } else {
17378
- t7 = $[17];
17512
+ t7 = $[18];
17379
17513
  }
17380
17514
  let t8;
17381
- if ($[18] !== actions || $[19] !== t6 || $[20] !== t7) {
17515
+ if ($[19] !== actions || $[20] !== t6 || $[21] !== t7) {
17382
17516
  t8 = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
17383
17517
  t6,
17384
17518
  t7,
17385
17519
  actions
17386
17520
  ] });
17387
- $[18] = actions;
17388
- $[19] = t6;
17389
- $[20] = t7;
17390
- $[21] = t8;
17521
+ $[19] = actions;
17522
+ $[20] = t6;
17523
+ $[21] = t7;
17524
+ $[22] = t8;
17391
17525
  } else {
17392
- t8 = $[21];
17526
+ t8 = $[22];
17393
17527
  }
17394
17528
  let t9;
17395
- if ($[22] !== t5 || $[23] !== t8) {
17529
+ if ($[23] !== t5 || $[24] !== t8) {
17396
17530
  t9 = /* @__PURE__ */ jsxs("div", { className: t3, children: [
17397
17531
  t5,
17398
17532
  t8
17399
17533
  ] });
17400
- $[22] = t5;
17401
- $[23] = t8;
17402
- $[24] = t9;
17534
+ $[23] = t5;
17535
+ $[24] = t8;
17536
+ $[25] = t9;
17403
17537
  } else {
17404
- t9 = $[24];
17538
+ t9 = $[25];
17405
17539
  }
17406
17540
  return t9;
17407
17541
  }
@@ -18981,6 +19115,33 @@ function ReferenceFilterField({
18981
19115
  ] })
18982
19116
  ] });
18983
19117
  }
19118
+ const completeNumberRegex = /^[+-]?(?:\d+|\d*\.\d+)(?:[eE][+-]?\d+)?$/;
19119
+ function parseFilterTextInput(text, dataType) {
19120
+ if (dataType !== "number") return {
19121
+ updateValue: true,
19122
+ value: text
19123
+ };
19124
+ const trimmedText = text.trim();
19125
+ if (trimmedText === "") return {
19126
+ updateValue: true,
19127
+ value: void 0
19128
+ };
19129
+ if (!completeNumberRegex.test(trimmedText)) return {
19130
+ updateValue: false
19131
+ };
19132
+ const parsedValue = Number(trimmedText);
19133
+ if (!isFinite(parsedValue)) return {
19134
+ updateValue: false
19135
+ };
19136
+ return {
19137
+ updateValue: true,
19138
+ value: parsedValue
19139
+ };
19140
+ }
19141
+ function filterValueToText(value) {
19142
+ if (value === void 0 || value === null) return "";
19143
+ return String(value);
19144
+ }
18984
19145
  const operationLabels$1 = {
18985
19146
  "==": "==",
18986
19147
  "!=": "!=",
@@ -18996,7 +19157,7 @@ const operationLabels$1 = {
18996
19157
  };
18997
19158
  const multipleSelectOperations$1 = ["array-contains-any", "in", "not-in"];
18998
19159
  function StringNumberFilterField(t0) {
18999
- const $ = c(56);
19160
+ const $ = c(63);
19000
19161
  const {
19001
19162
  name,
19002
19163
  value,
@@ -19030,9 +19191,20 @@ function StringNumberFilterField(t0) {
19030
19191
  const [operation, setOperation] = useState(fieldOperation === "==" && fieldValue === null ? "is-null" : fieldOperation);
19031
19192
  const [internalValue, setInternalValue] = useState(fieldValue);
19032
19193
  let t2;
19194
+ if ($[6] !== fieldValue) {
19195
+ t2 = filterValueToText(fieldValue);
19196
+ $[6] = fieldValue;
19197
+ $[7] = t2;
19198
+ } else {
19199
+ t2 = $[7];
19200
+ }
19201
+ const [inputText, setInputText] = useState(t2);
19202
+ const syncedValueRef = React__default.useRef(fieldValue);
19033
19203
  let t3;
19034
- if ($[6] !== possibleOperations[0] || $[7] !== value) {
19035
- t2 = () => {
19204
+ let t4;
19205
+ if ($[8] !== possibleOperations[0] || $[9] !== value) {
19206
+ t3 = () => {
19207
+ const newValue = value ? value[1] : void 0;
19036
19208
  if (value) {
19037
19209
  const [op, val] = value;
19038
19210
  setOperation(op === "==" && val === null ? "is-null" : op);
@@ -19041,109 +19213,140 @@ function StringNumberFilterField(t0) {
19041
19213
  setOperation(possibleOperations[0]);
19042
19214
  setInternalValue(void 0);
19043
19215
  }
19216
+ if (syncedValueRef.current !== newValue) {
19217
+ syncedValueRef.current = newValue;
19218
+ setInputText(filterValueToText(newValue));
19219
+ }
19044
19220
  };
19045
- t3 = [value, possibleOperations[0]];
19046
- $[6] = possibleOperations[0];
19047
- $[7] = value;
19048
- $[8] = t2;
19049
- $[9] = t3;
19221
+ t4 = [value, possibleOperations[0]];
19222
+ $[8] = possibleOperations[0];
19223
+ $[9] = value;
19224
+ $[10] = t3;
19225
+ $[11] = t4;
19050
19226
  } else {
19051
- t2 = $[8];
19052
- t3 = $[9];
19227
+ t3 = $[10];
19228
+ t4 = $[11];
19053
19229
  }
19054
- React__default.useEffect(t2, t3);
19230
+ React__default.useEffect(t3, t4);
19055
19231
  const isNullOperation = operation === "is-null";
19056
- let t4;
19057
- if ($[10] !== operation || $[11] !== setValue) {
19058
- t4 = function updateFilter2(op_0, val_0) {
19232
+ let t5;
19233
+ if ($[12] !== operation || $[13] !== setValue) {
19234
+ t5 = function updateFilter2(op_0, val_0, t62) {
19235
+ const keepInputText = t62 === void 0 ? false : t62;
19059
19236
  if (op_0 === "is-null") {
19060
19237
  setOperation(op_0);
19061
19238
  setInternalValue(null);
19239
+ syncedValueRef.current = null;
19240
+ setInputText("");
19062
19241
  setValue(["==", null]);
19063
19242
  return;
19064
19243
  }
19065
- let newValue = val_0;
19244
+ let newValue_0 = val_0;
19066
19245
  const prevOpIsArray = multipleSelectOperations$1.includes(operation);
19067
19246
  const newOpIsArray = multipleSelectOperations$1.includes(op_0);
19068
19247
  if (prevOpIsArray !== newOpIsArray) {
19069
- newValue = newOpIsArray ? typeof val_0 === "string" || typeof val_0 === "number" ? [val_0] : [] : void 0;
19248
+ newValue_0 = newOpIsArray ? typeof val_0 === "string" || typeof val_0 === "number" ? [val_0] : [] : void 0;
19070
19249
  }
19071
- if (typeof newValue === "number" && isNaN(newValue)) {
19072
- newValue = void 0;
19250
+ if (typeof newValue_0 === "number" && isNaN(newValue_0)) {
19251
+ newValue_0 = void 0;
19073
19252
  }
19074
19253
  setOperation(op_0);
19075
- setInternalValue(newValue);
19076
- const hasNewValue = newValue !== null && Array.isArray(newValue) ? newValue.length > 0 : newValue !== void 0;
19254
+ setInternalValue(newValue_0);
19255
+ syncedValueRef.current = newValue_0;
19256
+ if (!keepInputText) {
19257
+ setInputText(filterValueToText(newValue_0));
19258
+ }
19259
+ const hasNewValue = newValue_0 !== null && Array.isArray(newValue_0) ? newValue_0.length > 0 : newValue_0 !== void 0;
19077
19260
  if (op_0 && hasNewValue) {
19078
- setValue([op_0, newValue]);
19261
+ setValue([op_0, newValue_0]);
19079
19262
  } else {
19080
19263
  setValue(void 0);
19081
19264
  }
19082
19265
  };
19083
- $[10] = operation;
19084
- $[11] = setValue;
19085
- $[12] = t4;
19086
- } else {
19087
- t4 = $[12];
19088
- }
19089
- const updateFilter = t4;
19090
- let t5;
19091
- if ($[13] !== operation) {
19092
- t5 = multipleSelectOperations$1.includes(operation);
19093
- $[13] = operation;
19266
+ $[12] = operation;
19267
+ $[13] = setValue;
19094
19268
  $[14] = t5;
19095
19269
  } else {
19096
19270
  t5 = $[14];
19097
19271
  }
19098
- const multiple = t5;
19272
+ const updateFilter = t5;
19099
19273
  let t6;
19100
- if ($[15] !== internalValue || $[16] !== updateFilter) {
19101
- t6 = (value_0) => {
19102
- updateFilter(value_0, internalValue);
19274
+ if ($[15] !== dataType || $[16] !== operation || $[17] !== updateFilter) {
19275
+ t6 = function updateFilterFromText2(text) {
19276
+ setInputText(text);
19277
+ const {
19278
+ updateValue,
19279
+ value: parsedValue
19280
+ } = parseFilterTextInput(text, dataType);
19281
+ if (updateValue) {
19282
+ updateFilter(operation, parsedValue, true);
19283
+ }
19103
19284
  };
19104
- $[15] = internalValue;
19105
- $[16] = updateFilter;
19106
- $[17] = t6;
19285
+ $[15] = dataType;
19286
+ $[16] = operation;
19287
+ $[17] = updateFilter;
19288
+ $[18] = t6;
19107
19289
  } else {
19108
- t6 = $[17];
19290
+ t6 = $[18];
19109
19291
  }
19292
+ const updateFilterFromText = t6;
19110
19293
  let t7;
19111
- if ($[18] !== possibleOperations) {
19112
- t7 = possibleOperations.map(_temp2$6);
19113
- $[18] = possibleOperations;
19114
- $[19] = t7;
19294
+ if ($[19] !== operation) {
19295
+ t7 = multipleSelectOperations$1.includes(operation);
19296
+ $[19] = operation;
19297
+ $[20] = t7;
19115
19298
  } else {
19116
- t7 = $[19];
19299
+ t7 = $[20];
19117
19300
  }
19301
+ const multiple = t7;
19118
19302
  let t8;
19119
- if ($[20] !== operation || $[21] !== t6 || $[22] !== t7) {
19120
- t8 = /* @__PURE__ */ jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "medium", fullWidth: true, position: "item-aligned", onValueChange: t6, renderValue: _temp$m, children: t7 }) });
19121
- $[20] = operation;
19122
- $[21] = t6;
19123
- $[22] = t7;
19303
+ if ($[21] !== internalValue || $[22] !== updateFilter) {
19304
+ t8 = (value_0) => {
19305
+ updateFilter(value_0, internalValue);
19306
+ };
19307
+ $[21] = internalValue;
19308
+ $[22] = updateFilter;
19124
19309
  $[23] = t8;
19125
19310
  } else {
19126
19311
  t8 = $[23];
19127
19312
  }
19128
19313
  let t9;
19129
- if ($[24] !== dataType || $[25] !== enumValues || $[26] !== internalValue || $[27] !== isNullOperation || $[28] !== operation || $[29] !== updateFilter) {
19130
- t9 = !enumValues && /* @__PURE__ */ jsx(TextField, { size: "medium", type: dataType === "number" ? "number" : void 0, value: internalValue !== void 0 && internalValue != null ? String(internalValue) : "", disabled: isNullOperation, placeholder: isNullOperation ? "null" : void 0, onChange: (evt) => {
19131
- const val_1 = dataType === "number" ? parseFloat(evt.target.value) : evt.target.value;
19132
- updateFilter(operation, val_1);
19133
- }, endAdornment: internalValue !== void 0 && internalValue != null && /* @__PURE__ */ jsx(IconButton, { onClick: (e) => updateFilter(operation, void 0), children: /* @__PURE__ */ jsx(CloseIcon, {}) }) });
19134
- $[24] = dataType;
19135
- $[25] = enumValues;
19136
- $[26] = internalValue;
19137
- $[27] = isNullOperation;
19138
- $[28] = operation;
19139
- $[29] = updateFilter;
19140
- $[30] = t9;
19314
+ if ($[24] !== possibleOperations) {
19315
+ t9 = possibleOperations.map(_temp2$6);
19316
+ $[24] = possibleOperations;
19317
+ $[25] = t9;
19141
19318
  } else {
19142
- t9 = $[30];
19319
+ t9 = $[25];
19143
19320
  }
19144
19321
  let t10;
19145
- if ($[31] !== dataType || $[32] !== enumValues || $[33] !== internalValue || $[34] !== isNullOperation || $[35] !== multiple || $[36] !== name || $[37] !== operation || $[38] !== updateFilter) {
19146
- t10 = enumValues && !multiple && /* @__PURE__ */ jsx(Select, { size: "medium", position: "item-aligned", fullWidth: true, disabled: isNullOperation, value: typeof internalValue === "string" ? internalValue : "", onValueChange: (value_1) => {
19322
+ if ($[26] !== operation || $[27] !== t8 || $[28] !== t9) {
19323
+ t10 = /* @__PURE__ */ jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "medium", fullWidth: true, position: "item-aligned", onValueChange: t8, renderValue: _temp$m, children: t9 }) });
19324
+ $[26] = operation;
19325
+ $[27] = t8;
19326
+ $[28] = t9;
19327
+ $[29] = t10;
19328
+ } else {
19329
+ t10 = $[29];
19330
+ }
19331
+ let t11;
19332
+ if ($[30] !== dataType || $[31] !== enumValues || $[32] !== inputText || $[33] !== isNullOperation || $[34] !== operation || $[35] !== updateFilter || $[36] !== updateFilterFromText) {
19333
+ t11 = !enumValues && /* @__PURE__ */ jsx(TextField, { size: "medium", type: dataType === "number" ? "number" : void 0, value: inputText, disabled: isNullOperation, placeholder: isNullOperation ? "null" : void 0, onChange: (evt) => {
19334
+ updateFilterFromText(evt.target.value);
19335
+ }, endAdornment: inputText !== "" && /* @__PURE__ */ jsx(IconButton, { onClick: (e) => updateFilter(operation, void 0), children: /* @__PURE__ */ jsx(CloseIcon, {}) }) });
19336
+ $[30] = dataType;
19337
+ $[31] = enumValues;
19338
+ $[32] = inputText;
19339
+ $[33] = isNullOperation;
19340
+ $[34] = operation;
19341
+ $[35] = updateFilter;
19342
+ $[36] = updateFilterFromText;
19343
+ $[37] = t11;
19344
+ } else {
19345
+ t11 = $[37];
19346
+ }
19347
+ let t12;
19348
+ if ($[38] !== dataType || $[39] !== enumValues || $[40] !== internalValue || $[41] !== isNullOperation || $[42] !== multiple || $[43] !== name || $[44] !== operation || $[45] !== updateFilter) {
19349
+ t12 = enumValues && !multiple && /* @__PURE__ */ jsx(Select, { size: "medium", position: "item-aligned", fullWidth: true, disabled: isNullOperation, value: typeof internalValue === "string" ? internalValue : "", onValueChange: (value_1) => {
19147
19350
  if (value_1 !== "") {
19148
19351
  updateFilter(operation, dataType === "number" ? parseInt(value_1) : value_1);
19149
19352
  }
@@ -19156,62 +19359,62 @@ function StringNumberFilterField(t0) {
19156
19359
  }
19157
19360
  return /* @__PURE__ */ jsx(EnumValuesChip, { enumKey, enumValues, size: "small" }, `select_value_${name}_${enumKey}`);
19158
19361
  }, children: enumValues.map((enumConfig) => /* @__PURE__ */ jsx(SelectItem, { value: String(enumConfig.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: String(enumConfig.id), enumValues, size: "small" }) }, `select_item_${name}_${enumConfig.id}`)) });
19159
- $[31] = dataType;
19160
- $[32] = enumValues;
19161
- $[33] = internalValue;
19162
- $[34] = isNullOperation;
19163
- $[35] = multiple;
19164
- $[36] = name;
19165
- $[37] = operation;
19166
- $[38] = updateFilter;
19167
- $[39] = t10;
19168
- } else {
19169
- t10 = $[39];
19362
+ $[38] = dataType;
19363
+ $[39] = enumValues;
19364
+ $[40] = internalValue;
19365
+ $[41] = isNullOperation;
19366
+ $[42] = multiple;
19367
+ $[43] = name;
19368
+ $[44] = operation;
19369
+ $[45] = updateFilter;
19370
+ $[46] = t12;
19371
+ } else {
19372
+ t12 = $[46];
19170
19373
  }
19171
- let t11;
19172
- if ($[40] !== dataType || $[41] !== enumValues || $[42] !== internalValue || $[43] !== isNullOperation || $[44] !== multiple || $[45] !== name || $[46] !== operation || $[47] !== updateFilter) {
19173
- t11 = enumValues && multiple && /* @__PURE__ */ jsx(MultiSelect, { size: "medium", position: "item-aligned", value: Array.isArray(internalValue) ? internalValue.map(_temp3$3) : [], disabled: isNullOperation, onValueChange: (value_2) => {
19374
+ let t13;
19375
+ if ($[47] !== dataType || $[48] !== enumValues || $[49] !== internalValue || $[50] !== isNullOperation || $[51] !== multiple || $[52] !== name || $[53] !== operation || $[54] !== updateFilter) {
19376
+ t13 = enumValues && multiple && /* @__PURE__ */ jsx(MultiSelect, { size: "medium", position: "item-aligned", value: Array.isArray(internalValue) ? internalValue.map(_temp3$3) : [], disabled: isNullOperation, onValueChange: (value_2) => {
19174
19377
  updateFilter(operation, dataType === "number" ? value_2.map(_temp4$3) : value_2);
19175
19378
  }, multiple, endAdornment: internalValue && /* @__PURE__ */ jsx(IconButton, { className: "absolute right-2 top-3", onClick: (e_2) => updateFilter(operation, void 0), children: /* @__PURE__ */ jsx(CloseIcon, {}) }), children: enumValues.map((enumConfig_0) => /* @__PURE__ */ jsx(MultiSelectItem, { value: String(enumConfig_0.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: String(enumConfig_0.id), enumValues, size: "small" }) }, `select_value_${name}_${enumConfig_0.id}`)) });
19176
- $[40] = dataType;
19177
- $[41] = enumValues;
19178
- $[42] = internalValue;
19179
- $[43] = isNullOperation;
19180
- $[44] = multiple;
19181
- $[45] = name;
19182
- $[46] = operation;
19183
- $[47] = updateFilter;
19184
- $[48] = t11;
19379
+ $[47] = dataType;
19380
+ $[48] = enumValues;
19381
+ $[49] = internalValue;
19382
+ $[50] = isNullOperation;
19383
+ $[51] = multiple;
19384
+ $[52] = name;
19385
+ $[53] = operation;
19386
+ $[54] = updateFilter;
19387
+ $[55] = t13;
19185
19388
  } else {
19186
- t11 = $[48];
19389
+ t13 = $[55];
19187
19390
  }
19188
- let t12;
19189
- if ($[49] !== t10 || $[50] !== t11 || $[51] !== t9) {
19190
- t12 = /* @__PURE__ */ jsxs("div", { className: "flex-grow ml-2 flex flex-col gap-2", children: [
19191
- t9,
19192
- t10,
19193
- t11
19391
+ let t14;
19392
+ if ($[56] !== t11 || $[57] !== t12 || $[58] !== t13) {
19393
+ t14 = /* @__PURE__ */ jsxs("div", { className: "flex-grow ml-2 flex flex-col gap-2", children: [
19394
+ t11,
19395
+ t12,
19396
+ t13
19194
19397
  ] });
19195
- $[49] = t10;
19196
- $[50] = t11;
19197
- $[51] = t9;
19198
- $[52] = t12;
19398
+ $[56] = t11;
19399
+ $[57] = t12;
19400
+ $[58] = t13;
19401
+ $[59] = t14;
19199
19402
  } else {
19200
- t12 = $[52];
19403
+ t14 = $[59];
19201
19404
  }
19202
- let t13;
19203
- if ($[53] !== t12 || $[54] !== t8) {
19204
- t13 = /* @__PURE__ */ jsxs("div", { className: "flex w-full", children: [
19205
- t8,
19206
- t12
19405
+ let t15;
19406
+ if ($[60] !== t10 || $[61] !== t14) {
19407
+ t15 = /* @__PURE__ */ jsxs("div", { className: "flex w-full", children: [
19408
+ t10,
19409
+ t14
19207
19410
  ] });
19208
- $[53] = t12;
19209
- $[54] = t8;
19210
- $[55] = t13;
19411
+ $[60] = t10;
19412
+ $[61] = t14;
19413
+ $[62] = t15;
19211
19414
  } else {
19212
- t13 = $[55];
19415
+ t15 = $[62];
19213
19416
  }
19214
- return t13;
19417
+ return t15;
19215
19418
  }
19216
19419
  function _temp4$3(v) {
19217
19420
  return parseInt(v);
@@ -19746,7 +19949,7 @@ const EntityCollectionTable = function EntityCollectionTable2({
19746
19949
  }
19747
19950
  }, [tableRowActionsBuilder, additionalCellRenderer, propertyCellRenderer, size]);
19748
19951
  return /* @__PURE__ */ jsxs("div", { ref, style, className: cls("h-full w-full flex flex-col bg-white dark:bg-surface-950", className), children: [
19749
- !hideToolbar && /* @__PURE__ */ jsx(CollectionTableToolbar, { onTextSearch: textSearchEnabled ? onTextSearch : void 0, textSearchLoading, onTextSearchClick: textSearchEnabled ? onTextSearchClick : void 0, title, actionsStart, actions, viewModeToggle, loading: tableController.dataLoading }),
19952
+ !hideToolbar && /* @__PURE__ */ jsx(CollectionTableToolbar, { onTextSearch: textSearchEnabled ? onTextSearch : void 0, textSearchLoading, onTextSearchClick: textSearchEnabled ? onTextSearchClick : void 0, initialSearchString: tableController.searchString, title, actionsStart, actions, viewModeToggle, loading: tableController.dataLoading }),
19750
19953
  /* @__PURE__ */ jsx(SelectableTable, { columns, size, inlineEditing, cellRenderer, onEntityClick, highlightedRow: (entity_1) => Boolean(selectedEntities?.find((e_0) => e_0.id === entity_1.id && e_0.path === entity_1.path)), tableController, onValueChange, initialScroll, onScroll, onColumnResize, hoverRow, filterable, emptyComponent, endAdornment, AddColumnComponent, onColumnsOrderChange })
19751
19954
  ] });
19752
19955
  };
@@ -19785,9 +19988,119 @@ function useDebouncedData(data, deps, timeoutMs = 5e3) {
19785
19988
  }, [data, timeoutMs, deps, immediateUpdate]);
19786
19989
  return immediateUpdate ? data : deferredData;
19787
19990
  }
19991
+ function encodeFilterAndSort(filterValues, sortBy, searchString) {
19992
+ const entries = {};
19993
+ if (sortBy) {
19994
+ entries["__sort"] = encodeURIComponent(sortBy[0]);
19995
+ entries["__sort_order"] = encodeURIComponent(sortBy[1]);
19996
+ }
19997
+ if (filterValues) {
19998
+ Object.entries(filterValues).forEach(([key, value]) => {
19999
+ if (value) {
20000
+ const [op, val] = value;
20001
+ let encodedValue = val;
20002
+ try {
20003
+ if (typeof val === "object") {
20004
+ if (val instanceof Date) {
20005
+ encodedValue = val.toISOString();
20006
+ } else if (Array.isArray(val)) {
20007
+ encodedValue = JSON.stringify(val, (key2, value2) => {
20008
+ if (value2 instanceof EntityReference) {
20009
+ return encodeRef(value2);
20010
+ }
20011
+ return value2;
20012
+ });
20013
+ } else if (val instanceof EntityReference) {
20014
+ encodedValue = encodeRef(val);
20015
+ }
20016
+ } else if (typeof val === "string") {
20017
+ encodedValue = JSON.stringify(val);
20018
+ }
20019
+ } catch (e) {
20020
+ encodedValue = val;
20021
+ }
20022
+ if (encodedValue !== void 0) {
20023
+ entries[encodeURIComponent(`${key}_op`)] = encodeURIComponent(op);
20024
+ entries[encodeURIComponent(`${key}_value`)] = encodedValue !== null && encodedValue !== void 0 ? encodeURIComponent(encodedValue.toString()) : "null";
20025
+ }
20026
+ }
20027
+ });
20028
+ }
20029
+ if (searchString) {
20030
+ entries["search"] = encodeURIComponent(searchString);
20031
+ }
20032
+ if (!Object.keys(entries).length) {
20033
+ return "";
20034
+ }
20035
+ return Object.entries(entries).map(([key, value]) => `${key}=${value}`).join("&");
20036
+ }
20037
+ function parseFilterAndSort(search) {
20038
+ const entries = new URLSearchParams(search);
20039
+ const filterValues = {};
20040
+ let sortBy = void 0;
20041
+ entries.forEach((value, key) => {
20042
+ if (key === "__sort") {
20043
+ sortBy = [decodeURIComponent(value), entries.get("__sort_order")];
20044
+ } else if (key.endsWith("_op")) {
20045
+ const field = key.replace("_op", "");
20046
+ const filterOp = decodeURIComponent(value);
20047
+ const filterValStr = entries.get(`${field}_value`);
20048
+ if (filterValStr !== null) {
20049
+ filterValues[field] = [filterOp, decodeString(filterValStr)];
20050
+ }
20051
+ }
20052
+ });
20053
+ const searchString = entries.get("search") ?? void 0;
20054
+ return {
20055
+ filterValues: Object.keys(filterValues).length ? filterValues : void 0,
20056
+ sortBy,
20057
+ searchString: searchString ? searchString : void 0
20058
+ };
20059
+ }
20060
+ function isDate(dateString) {
20061
+ const regexPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
20062
+ if (!regexPattern.test(dateString)) {
20063
+ return false;
20064
+ }
20065
+ const date = new Date(dateString);
20066
+ return date.toISOString() === dateString;
20067
+ }
20068
+ function encodeRef(val) {
20069
+ return `ref::${val.path}/${encodeEntityId(val.id)}`;
20070
+ }
20071
+ function decodeRef(encoded) {
20072
+ const separatorIndex = encoded.lastIndexOf("/");
20073
+ if (separatorIndex < 0) return new EntityReference(encoded, "");
20074
+ return new EntityReference(decodeEntityId(encoded.substring(separatorIndex + 1)), encoded.substring(0, separatorIndex));
20075
+ }
20076
+ function decodeString(val) {
20077
+ let parsedFilterVal = val;
20078
+ if (isDate(val)) {
20079
+ try {
20080
+ parsedFilterVal = new Date(val);
20081
+ } catch (e) {
20082
+ }
20083
+ }
20084
+ if (typeof parsedFilterVal === "string") {
20085
+ try {
20086
+ parsedFilterVal = JSON.parse(parsedFilterVal, (key, value) => {
20087
+ if (typeof value === "string" && value.startsWith("ref::")) {
20088
+ return decodeRef(value.substring(5));
20089
+ }
20090
+ return value;
20091
+ });
20092
+ } catch (e) {
20093
+ }
20094
+ }
20095
+ if (typeof parsedFilterVal === "string" && parsedFilterVal.startsWith("ref::")) {
20096
+ return decodeRef(parsedFilterVal.substring(5));
20097
+ }
20098
+ return parsedFilterVal;
20099
+ }
19788
20100
  const DEFAULT_PAGE_SIZE$1 = 50;
19789
20101
  function useDataSourceTableController({
19790
20102
  fullPath,
20103
+ pathSegments,
19791
20104
  collection,
19792
20105
  scrollRestoration,
19793
20106
  entitiesDisplayedFirst,
@@ -19804,14 +20117,15 @@ function useDataSourceTableController({
19804
20117
  const navigation = useNavigationController();
19805
20118
  const dataSource = useDataSource();
19806
20119
  const resolvedPath = useMemo(() => navigation.resolveIdsFrom(fullPath), [fullPath, navigation.resolveIdsFrom]);
20120
+ const resolvedPathSegments = pathSegments;
19807
20121
  const forceFilter = forceFilterFromProps ?? forceFilterFromCollection;
19808
20122
  const paginationEnabled = collection.pagination === void 0 || Boolean(collection.pagination);
19809
20123
  const pageSize = typeof collection.pagination === "number" ? collection.pagination : DEFAULT_PAGE_SIZE$1;
19810
- const [searchString, setSearchString] = React__default.useState();
19811
20124
  const checkFilterCombination = useCallback((filterValues, sortBy) => {
19812
20125
  if (!dataSource.isFilterCombinationValid) return true;
19813
20126
  return dataSource.isFilterCombinationValid({
19814
20127
  path: resolvedPath,
20128
+ pathSegments: resolvedPathSegments,
19815
20129
  collection,
19816
20130
  filterValues,
19817
20131
  sortBy
@@ -19839,7 +20153,8 @@ function useDataSourceTableController({
19839
20153
  const location = useLocation();
19840
20154
  const {
19841
20155
  filterValues: initialFilterUrl,
19842
- sortBy: initialSortUrl
20156
+ sortBy: initialSortUrl,
20157
+ searchString: initialSearchUrl
19843
20158
  } = parseFilterAndSort(location.search);
19844
20159
  const availableFilterKeys = collection.allowedFilters ?? Object.keys(collection.properties);
19845
20160
  const forcedFilterKeys = collection.forceFilter ? Object.keys(collection.forceFilter) : [];
@@ -19862,6 +20177,7 @@ function useDataSourceTableController({
19862
20177
  const initFilters = forceFilter ?? (updateUrl ? initialFilterUrl : void 0) ?? initialFilter ?? void 0;
19863
20178
  const [filterValues_0, setFilterValues] = React__default.useState(removeUnallowedFilters(initFilters));
19864
20179
  const [sortBy_0, setSortBy] = React__default.useState((updateUrl ? initialSortUrl : void 0) ?? initialSortInternal);
20180
+ const [searchString, setSearchString] = React__default.useState(updateUrl ? initialSearchUrl : void 0);
19865
20181
  useUpdateUrl(filterValues_0, sortBy_0, searchString, updateUrl);
19866
20182
  const collectionScroll = scrollRestoration?.getCollectionScroll(fullPath, filterValues_0);
19867
20183
  const initialItemCount = collectionScroll?.data.length ?? pageSize;
@@ -19898,6 +20214,12 @@ function useDataSourceTableController({
19898
20214
  useEffect(() => {
19899
20215
  setDataLoading(true);
19900
20216
  const onEntitiesUpdate = async (entities) => {
20217
+ if (resolvedPathSegments) {
20218
+ entities = entities.map((e) => e.pathSegments ? e : {
20219
+ ...e,
20220
+ pathSegments: resolvedPathSegments
20221
+ });
20222
+ }
19901
20223
  if (collection.callbacks?.onFetch) {
19902
20224
  try {
19903
20225
  entities = await Promise.all(entities.map((entity) => collection.callbacks.onFetch({
@@ -19906,14 +20228,14 @@ function useDataSourceTableController({
19906
20228
  entity,
19907
20229
  context
19908
20230
  })));
19909
- } catch (e) {
19910
- console.error(e);
20231
+ } catch (e_0) {
20232
+ console.error(e_0);
19911
20233
  }
19912
20234
  }
19913
20235
  setDataLoading(false);
19914
20236
  setDataLoadingError(void 0);
19915
- setRawData(entities.map((e_0) => ({
19916
- ...e_0
20237
+ setRawData(entities.map((e_1) => ({
20238
+ ...e_1
19917
20239
  // values: sanitizeData(e.values, resolvedCollection.properties)
19918
20240
  })));
19919
20241
  setNoMoreToLoad(!itemCount || entities.length < itemCount);
@@ -19924,30 +20246,38 @@ function useDataSourceTableController({
19924
20246
  setRawData([]);
19925
20247
  setDataLoadingError(error);
19926
20248
  };
19927
- if (dataSource.listenCollection) {
19928
- return dataSource.listenCollection({
19929
- path: resolvedPath,
19930
- collection,
19931
- onUpdate: onEntitiesUpdate,
19932
- onError,
19933
- searchString,
19934
- filter: filterValues_0,
19935
- limit: itemCount,
19936
- startAfter: void 0,
19937
- orderBy: sortByProperty,
19938
- order: currentSort
19939
- });
19940
- } else {
19941
- dataSource.fetchCollection({
19942
- path: resolvedPath,
19943
- collection,
19944
- searchString,
19945
- filter: filterValues_0,
19946
- limit: itemCount,
19947
- startAfter: void 0,
19948
- orderBy: sortByProperty,
19949
- order: currentSort
19950
- }).then(onEntitiesUpdate).catch(onError);
20249
+ try {
20250
+ if (dataSource.listenCollection) {
20251
+ return dataSource.listenCollection({
20252
+ path: resolvedPath,
20253
+ pathSegments: resolvedPathSegments,
20254
+ collection,
20255
+ onUpdate: onEntitiesUpdate,
20256
+ onError,
20257
+ searchString,
20258
+ filter: filterValues_0,
20259
+ limit: itemCount,
20260
+ startAfter: void 0,
20261
+ orderBy: sortByProperty,
20262
+ order: currentSort
20263
+ });
20264
+ } else {
20265
+ dataSource.fetchCollection({
20266
+ path: resolvedPath,
20267
+ pathSegments: resolvedPathSegments,
20268
+ collection,
20269
+ searchString,
20270
+ filter: filterValues_0,
20271
+ limit: itemCount,
20272
+ startAfter: void 0,
20273
+ orderBy: sortByProperty,
20274
+ order: currentSort
20275
+ }).then(onEntitiesUpdate).catch(onError);
20276
+ return () => {
20277
+ };
20278
+ }
20279
+ } catch (e_2) {
20280
+ onError(e_2 instanceof Error ? e_2 : new Error(String(e_2)));
19951
20281
  return () => {
19952
20282
  };
19953
20283
  }
@@ -19994,9 +20324,7 @@ function useUpdateUrl(filterValues, sortBy, searchString, updateUrl) {
19994
20324
  if ($[0] !== filterValues || $[1] !== searchString || $[2] !== sortBy || $[3] !== updateUrl) {
19995
20325
  t0 = () => {
19996
20326
  if (updateUrl) {
19997
- const newUrl = encodeFilterAndSort(filterValues, sortBy);
19998
- const search = searchString ? `&search=${encodeURIComponent(searchString)}` : "";
19999
- const state = `${newUrl}${search}`;
20327
+ const state = encodeFilterAndSort(filterValues, sortBy, searchString);
20000
20328
  const hash2 = window.location.hash;
20001
20329
  if (state === "") {
20002
20330
  window.history.replaceState({}, "", `${window.location.pathname}${hash2}`);
@@ -20018,110 +20346,6 @@ function useUpdateUrl(filterValues, sortBy, searchString, updateUrl) {
20018
20346
  }
20019
20347
  useEffect(t0, t1);
20020
20348
  }
20021
- function encodeFilterAndSort(filterValues, sortBy) {
20022
- const entries = {};
20023
- if (sortBy) {
20024
- entries["__sort"] = encodeURIComponent(sortBy[0]);
20025
- entries["__sort_order"] = encodeURIComponent(sortBy[1]);
20026
- }
20027
- if (filterValues) {
20028
- Object.entries(filterValues).forEach(([key, value]) => {
20029
- if (value) {
20030
- const [op, val] = value;
20031
- let encodedValue = val;
20032
- try {
20033
- if (typeof val === "object") {
20034
- if (val instanceof Date) {
20035
- encodedValue = val.toISOString();
20036
- } else if (Array.isArray(val)) {
20037
- encodedValue = JSON.stringify(val, (key2, value2) => {
20038
- if (value2 instanceof EntityReference) {
20039
- return encodeRef(value2);
20040
- }
20041
- return value2;
20042
- });
20043
- } else if (val instanceof EntityReference) {
20044
- encodedValue = encodeRef(val);
20045
- }
20046
- } else if (typeof val === "string") {
20047
- encodedValue = JSON.stringify(val);
20048
- }
20049
- } catch (e) {
20050
- encodedValue = val;
20051
- }
20052
- if (encodedValue !== void 0) {
20053
- entries[encodeURIComponent(`${key}_op`)] = encodeURIComponent(op);
20054
- entries[encodeURIComponent(`${key}_value`)] = encodedValue !== null && encodedValue !== void 0 ? encodeURIComponent(encodedValue.toString()) : "null";
20055
- }
20056
- }
20057
- });
20058
- }
20059
- if (!Object.keys(entries).length) {
20060
- return "";
20061
- }
20062
- return Object.entries(entries).map(([key, value]) => `${key}=${value}`).join("&");
20063
- }
20064
- function parseFilterAndSort(search) {
20065
- const entries = new URLSearchParams(search);
20066
- const filterValues = {};
20067
- let sortBy = void 0;
20068
- entries.forEach((value, key) => {
20069
- if (key === "__sort") {
20070
- sortBy = [decodeURIComponent(value), entries.get("__sort_order")];
20071
- } else if (key.endsWith("_op")) {
20072
- const field = key.replace("_op", "");
20073
- const filterOp = decodeURIComponent(value);
20074
- const filterValStr = entries.get(`${field}_value`);
20075
- if (filterValStr !== null) {
20076
- filterValues[field] = [filterOp, decodeString(filterValStr)];
20077
- }
20078
- }
20079
- });
20080
- return {
20081
- filterValues: Object.keys(filterValues).length ? filterValues : void 0,
20082
- sortBy
20083
- };
20084
- }
20085
- function isDate(dateString) {
20086
- const regexPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
20087
- if (!regexPattern.test(dateString)) {
20088
- return false;
20089
- }
20090
- const date = new Date(dateString);
20091
- return date.toISOString() === dateString;
20092
- }
20093
- function encodeRef(val) {
20094
- return `ref::${val.path}/${encodeEntityId(val.id)}`;
20095
- }
20096
- function decodeRef(encoded) {
20097
- const separatorIndex = encoded.lastIndexOf("/");
20098
- if (separatorIndex < 0) return new EntityReference(encoded, "");
20099
- return new EntityReference(decodeEntityId(encoded.substring(separatorIndex + 1)), encoded.substring(0, separatorIndex));
20100
- }
20101
- function decodeString(val) {
20102
- let parsedFilterVal = val;
20103
- if (isDate(val)) {
20104
- try {
20105
- parsedFilterVal = new Date(val);
20106
- } catch (e) {
20107
- }
20108
- }
20109
- if (typeof parsedFilterVal === "string") {
20110
- try {
20111
- parsedFilterVal = JSON.parse(parsedFilterVal, (key, value) => {
20112
- if (typeof value === "string" && value.startsWith("ref::")) {
20113
- return decodeRef(value.substring(5));
20114
- }
20115
- return value;
20116
- });
20117
- } catch (e) {
20118
- }
20119
- }
20120
- if (typeof parsedFilterVal === "string" && parsedFilterVal.startsWith("ref::")) {
20121
- return decodeRef(parsedFilterVal.substring(5));
20122
- }
20123
- return parsedFilterVal;
20124
- }
20125
20349
  function useSelectionController(onSelectionChange) {
20126
20350
  const [selectedEntities, setSelectedEntities] = useState([]);
20127
20351
  const toggleEntitySelection = useCallback((entity, newSelectedState) => {
@@ -20157,95 +20381,57 @@ function useSelectionController(onSelectionChange) {
20157
20381
  };
20158
20382
  }
20159
20383
  function useTableSearchHelper(t0) {
20160
- const $ = c(33);
20384
+ const $ = c(18);
20161
20385
  const {
20162
20386
  collection,
20163
20387
  fullPath,
20164
- parentCollectionIds
20388
+ parentCollectionIds,
20389
+ initialSearchString
20165
20390
  } = t0;
20166
20391
  const context = useFireCMSContext();
20167
20392
  const customizationController = useCustomizationController();
20168
20393
  const dataSource = useDataSource();
20169
20394
  const [textSearchLoading, setTextSearchLoading] = useState(false);
20170
20395
  const [textSearchInitialised, setTextSearchInitialised] = useState(false);
20396
+ const autoInitialisedRef = useRef(false);
20171
20397
  let onTextSearchClick;
20172
20398
  let textSearchEnabled;
20173
20399
  if ($[0] !== collection || $[1] !== context || $[2] !== customizationController.plugins || $[3] !== dataSource || $[4] !== fullPath || $[5] !== parentCollectionIds) {
20174
20400
  textSearchEnabled = Boolean(collection.textSearchEnabled);
20175
- let props;
20176
- let t12;
20177
- if ($[8] !== collection || $[9] !== context || $[10] !== customizationController.plugins || $[11] !== fullPath || $[12] !== parentCollectionIds) {
20178
- props = {
20179
- context,
20180
- path: fullPath,
20181
- databaseId: collection.databaseId,
20182
- collection,
20183
- parentCollectionIds
20184
- };
20185
- t12 = customizationController.plugins?.find((p) => p.collectionView?.blockSearch?.(props));
20186
- $[8] = collection;
20187
- $[9] = context;
20188
- $[10] = customizationController.plugins;
20189
- $[11] = fullPath;
20190
- $[12] = parentCollectionIds;
20191
- $[13] = props;
20192
- $[14] = t12;
20193
- } else {
20194
- props = $[13];
20195
- t12 = $[14];
20196
- }
20197
- const searchBlocked = t12;
20198
- let t2;
20199
- if ($[15] !== customizationController.plugins || $[16] !== dataSource?.initTextSearch) {
20200
- t2 = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$k);
20201
- $[15] = customizationController.plugins;
20202
- $[16] = dataSource?.initTextSearch;
20203
- $[17] = t2;
20204
- } else {
20205
- t2 = $[17];
20206
- }
20207
- const addTextSearchClickListener = t2;
20401
+ const props = {
20402
+ context,
20403
+ path: fullPath,
20404
+ databaseId: collection.databaseId,
20405
+ collection,
20406
+ parentCollectionIds
20407
+ };
20408
+ const searchBlocked = customizationController.plugins?.find((p) => p.collectionView?.blockSearch?.(props));
20409
+ const addTextSearchClickListener = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$k);
20208
20410
  if (addTextSearchClickListener) {
20209
- let t3;
20210
- if ($[18] !== addTextSearchClickListener || $[19] !== collection || $[20] !== context || $[21] !== customizationController.plugins || $[22] !== dataSource || $[23] !== fullPath || $[24] !== parentCollectionIds || $[25] !== props || $[26] !== searchBlocked) {
20211
- t3 = addTextSearchClickListener ? () => {
20212
- setTextSearchLoading(true);
20213
- const promises = [];
20214
- if (dataSource?.initTextSearch && !searchBlocked) {
20215
- promises.push(dataSource.initTextSearch(props));
20216
- }
20217
- if (searchBlocked) {
20218
- customizationController.plugins?.forEach((p_1) => {
20219
- if (p_1.collectionView?.onTextSearchClick) {
20220
- promises.push(p_1.collectionView.onTextSearchClick({
20221
- context,
20222
- path: fullPath,
20223
- collection,
20224
- parentCollectionIds
20225
- }));
20226
- }
20227
- });
20228
- }
20229
- return Promise.all(promises).then((res) => {
20230
- if (res.every(Boolean)) {
20231
- setTextSearchInitialised(true);
20411
+ onTextSearchClick = addTextSearchClickListener ? () => {
20412
+ setTextSearchLoading(true);
20413
+ const promises = [];
20414
+ if (dataSource?.initTextSearch && !searchBlocked) {
20415
+ promises.push(dataSource.initTextSearch(props));
20416
+ }
20417
+ if (searchBlocked) {
20418
+ customizationController.plugins?.forEach((p_1) => {
20419
+ if (p_1.collectionView?.onTextSearchClick) {
20420
+ promises.push(p_1.collectionView.onTextSearchClick({
20421
+ context,
20422
+ path: fullPath,
20423
+ collection,
20424
+ parentCollectionIds
20425
+ }));
20232
20426
  }
20233
- }).finally(() => setTextSearchLoading(false));
20234
- } : void 0;
20235
- $[18] = addTextSearchClickListener;
20236
- $[19] = collection;
20237
- $[20] = context;
20238
- $[21] = customizationController.plugins;
20239
- $[22] = dataSource;
20240
- $[23] = fullPath;
20241
- $[24] = parentCollectionIds;
20242
- $[25] = props;
20243
- $[26] = searchBlocked;
20244
- $[27] = t3;
20245
- } else {
20246
- t3 = $[27];
20247
- }
20248
- onTextSearchClick = t3;
20427
+ });
20428
+ }
20429
+ return Promise.all(promises).then((res) => {
20430
+ if (res.every(Boolean)) {
20431
+ setTextSearchInitialised(true);
20432
+ }
20433
+ }).finally(() => setTextSearchLoading(false));
20434
+ } : void 0;
20249
20435
  customizationController.plugins?.forEach((p_2) => {
20250
20436
  if (!textSearchEnabled) {
20251
20437
  if (p_2.collectionView?.showTextSearchBar) {
@@ -20265,29 +20451,54 @@ function useTableSearchHelper(t0) {
20265
20451
  $[3] = dataSource;
20266
20452
  $[4] = fullPath;
20267
20453
  $[5] = parentCollectionIds;
20268
- $[6] = textSearchEnabled;
20269
- $[7] = onTextSearchClick;
20454
+ $[6] = onTextSearchClick;
20455
+ $[7] = textSearchEnabled;
20270
20456
  } else {
20271
- textSearchEnabled = $[6];
20272
- onTextSearchClick = $[7];
20457
+ onTextSearchClick = $[6];
20458
+ textSearchEnabled = $[7];
20273
20459
  }
20460
+ const shouldAutoInitialise = Boolean(initialSearchString) && textSearchEnabled && !textSearchInitialised && Boolean(onTextSearchClick);
20274
20461
  let t1;
20275
- if ($[28] !== onTextSearchClick || $[29] !== textSearchEnabled || $[30] !== textSearchInitialised || $[31] !== textSearchLoading) {
20276
- t1 = {
20462
+ if ($[8] !== onTextSearchClick || $[9] !== shouldAutoInitialise) {
20463
+ t1 = () => {
20464
+ if (autoInitialisedRef.current || !shouldAutoInitialise) {
20465
+ return;
20466
+ }
20467
+ autoInitialisedRef.current = true;
20468
+ onTextSearchClick?.();
20469
+ };
20470
+ $[8] = onTextSearchClick;
20471
+ $[9] = shouldAutoInitialise;
20472
+ $[10] = t1;
20473
+ } else {
20474
+ t1 = $[10];
20475
+ }
20476
+ let t2;
20477
+ if ($[11] !== shouldAutoInitialise) {
20478
+ t2 = [shouldAutoInitialise];
20479
+ $[11] = shouldAutoInitialise;
20480
+ $[12] = t2;
20481
+ } else {
20482
+ t2 = $[12];
20483
+ }
20484
+ useEffect(t1, t2);
20485
+ let t3;
20486
+ if ($[13] !== onTextSearchClick || $[14] !== textSearchEnabled || $[15] !== textSearchInitialised || $[16] !== textSearchLoading) {
20487
+ t3 = {
20277
20488
  textSearchLoading,
20278
20489
  textSearchInitialised,
20279
20490
  onTextSearchClick,
20280
20491
  textSearchEnabled
20281
20492
  };
20282
- $[28] = onTextSearchClick;
20283
- $[29] = textSearchEnabled;
20284
- $[30] = textSearchInitialised;
20285
- $[31] = textSearchLoading;
20286
- $[32] = t1;
20493
+ $[13] = onTextSearchClick;
20494
+ $[14] = textSearchEnabled;
20495
+ $[15] = textSearchInitialised;
20496
+ $[16] = textSearchLoading;
20497
+ $[17] = t3;
20287
20498
  } else {
20288
- t1 = $[32];
20499
+ t3 = $[17];
20289
20500
  }
20290
- return t1;
20501
+ return t3;
20291
20502
  }
20292
20503
  function _temp$k(p_0) {
20293
20504
  return Boolean(p_0.collectionView?.onTextSearchClick);
@@ -20578,6 +20789,7 @@ function ReferenceSelectionTable({
20578
20789
  multiselect,
20579
20790
  collection,
20580
20791
  path: pathInput,
20792
+ pathSegments,
20581
20793
  selectedEntityIds: selectedEntityIdsProp,
20582
20794
  description,
20583
20795
  forceFilter,
@@ -20620,6 +20832,7 @@ function ReferenceSelectionTable({
20620
20832
  if (selectedEntityIds && collection) {
20621
20833
  Promise.all(selectedEntityIds.map((entityId) => dataSource.fetchEntity({
20622
20834
  path: fullPath,
20835
+ pathSegments,
20623
20836
  entityId,
20624
20837
  collection
20625
20838
  }))).then((entities) => {
@@ -24218,6 +24431,7 @@ const EntityBoardCard = memo(EntityBoardCardInner);
24218
24431
  const DEFAULT_PAGE_SIZE = 20;
24219
24432
  function useBoardDataController({
24220
24433
  fullPath,
24434
+ pathSegments,
24221
24435
  collection,
24222
24436
  columnProperty,
24223
24437
  columns,
@@ -24230,6 +24444,7 @@ function useBoardDataController({
24230
24444
  const dataSource = useDataSource();
24231
24445
  const navigation = useNavigationController();
24232
24446
  const resolvedPath = useMemo(() => navigation.resolveIdsFrom(fullPath), [fullPath, navigation.resolveIdsFrom]);
24447
+ const resolvedPathSegments = pathSegments;
24233
24448
  const dataSourceRef = useRef(dataSource);
24234
24449
  const collectionRef = useRef(collection);
24235
24450
  const contextRef = useRef(context);
@@ -24241,11 +24456,13 @@ function useBoardDataController({
24241
24456
  const orderPropertyRef = useRef(orderProperty);
24242
24457
  const searchStringRef = useRef(searchString);
24243
24458
  const resolvedPathRef = useRef(resolvedPath);
24459
+ const resolvedPathSegmentsRef = useRef(resolvedPathSegments);
24244
24460
  filterValuesRef.current = filterValues;
24245
24461
  columnPropertyRef.current = columnProperty;
24246
24462
  orderPropertyRef.current = orderProperty;
24247
24463
  searchStringRef.current = searchString;
24248
24464
  resolvedPathRef.current = resolvedPath;
24465
+ resolvedPathSegmentsRef.current = resolvedPathSegments;
24249
24466
  const [columnItemCounts, setColumnItemCounts] = useState(() => {
24250
24467
  const initial = {};
24251
24468
  columns.forEach((col) => {
@@ -24292,6 +24509,7 @@ function useBoardDataController({
24292
24509
  const currentOrderProperty = orderPropertyRef.current;
24293
24510
  const currentSearchString = searchStringRef.current;
24294
24511
  const currentResolvedPath = resolvedPathRef.current;
24512
+ const currentPathSegments = resolvedPathSegmentsRef.current;
24295
24513
  const columnFilter = {
24296
24514
  ...currentFilterValues,
24297
24515
  [currentColumnProperty]: ["==", column]
@@ -24348,6 +24566,7 @@ function useBoardDataController({
24348
24566
  if (currentDataSource.listenCollection) {
24349
24567
  const unsubscribe = currentDataSource.listenCollection({
24350
24568
  path: currentResolvedPath,
24569
+ pathSegments: currentPathSegments,
24351
24570
  collection: currentCollection,
24352
24571
  onUpdate,
24353
24572
  onError,
@@ -24362,6 +24581,7 @@ function useBoardDataController({
24362
24581
  } else {
24363
24582
  currentDataSource.fetchCollection({
24364
24583
  path: currentResolvedPath,
24584
+ pathSegments: currentPathSegments,
24365
24585
  collection: currentCollection,
24366
24586
  searchString: currentSearchString,
24367
24587
  filter: columnFilter,
@@ -24390,6 +24610,7 @@ function useBoardDataController({
24390
24610
  const currentColumnProperty = columnPropertyRef.current;
24391
24611
  const currentSearchString = searchStringRef.current;
24392
24612
  const currentResolvedPath = resolvedPathRef.current;
24613
+ const currentPathSegments = resolvedPathSegmentsRef.current;
24393
24614
  const currentColumns = columns;
24394
24615
  const currentColumnItemCounts = columnItemCounts;
24395
24616
  const timeoutId = setTimeout(() => {
@@ -24404,6 +24625,7 @@ function useBoardDataController({
24404
24625
  };
24405
24626
  currentDataSource.countEntities({
24406
24627
  path: currentResolvedPath,
24628
+ pathSegments: currentPathSegments,
24407
24629
  collection: currentCollection,
24408
24630
  filter: columnFilter,
24409
24631
  searchString: currentSearchString
@@ -24648,6 +24870,7 @@ function EntityCollectionBoardView({
24648
24870
  collection,
24649
24871
  tableController,
24650
24872
  fullPath,
24873
+ pathSegments,
24651
24874
  parentCollectionIds = [],
24652
24875
  columnProperty,
24653
24876
  onEntityClick,
@@ -24741,6 +24964,7 @@ function EntityCollectionBoardView({
24741
24964
  const columns = localColumnsOrder;
24742
24965
  const boardDataController = useBoardDataController({
24743
24966
  fullPath,
24967
+ pathSegments,
24744
24968
  collection,
24745
24969
  columnProperty,
24746
24970
  columns,
@@ -25286,7 +25510,7 @@ function PopupFormField(props) {
25286
25510
  return t0;
25287
25511
  }
25288
25512
  function PopupFormFieldLoading(t0) {
25289
- const $ = c(21);
25513
+ const $ = c(22);
25290
25514
  const {
25291
25515
  tableKey,
25292
25516
  entityId,
@@ -25294,6 +25518,7 @@ function PopupFormFieldLoading(t0) {
25294
25518
  propertyKey,
25295
25519
  collection: inputCollection,
25296
25520
  path,
25521
+ pathSegments,
25297
25522
  cellRect,
25298
25523
  open,
25299
25524
  onClose,
@@ -25304,33 +25529,35 @@ function PopupFormFieldLoading(t0) {
25304
25529
  const [entity, setEntity] = useState(void 0);
25305
25530
  let t1;
25306
25531
  let t2;
25307
- if ($[0] !== dataSource || $[1] !== entityId || $[2] !== inputCollection || $[3] !== path) {
25532
+ if ($[0] !== dataSource || $[1] !== entityId || $[2] !== inputCollection || $[3] !== path || $[4] !== pathSegments) {
25308
25533
  t1 = () => {
25309
25534
  if (entityId && inputCollection) {
25310
25535
  dataSource.fetchEntity({
25311
25536
  path,
25537
+ pathSegments,
25312
25538
  entityId,
25313
25539
  collection: inputCollection
25314
25540
  }).then(setEntity);
25315
25541
  }
25316
25542
  };
25317
- t2 = [entityId, inputCollection, dataSource, path];
25543
+ t2 = [entityId, inputCollection, dataSource, path, pathSegments];
25318
25544
  $[0] = dataSource;
25319
25545
  $[1] = entityId;
25320
25546
  $[2] = inputCollection;
25321
25547
  $[3] = path;
25322
- $[4] = t1;
25323
- $[5] = t2;
25548
+ $[4] = pathSegments;
25549
+ $[5] = t1;
25550
+ $[6] = t2;
25324
25551
  } else {
25325
- t1 = $[4];
25326
- t2 = $[5];
25552
+ t1 = $[5];
25553
+ t2 = $[6];
25327
25554
  }
25328
25555
  useEffect(t1, t2);
25329
25556
  if (!entity) {
25330
25557
  return null;
25331
25558
  }
25332
25559
  let t3;
25333
- if ($[6] !== cellRect || $[7] !== container || $[8] !== customFieldValidator || $[9] !== entityId || $[10] !== inputCollection || $[11] !== onCellValueChange || $[12] !== onClose || $[13] !== open || $[14] !== path || $[15] !== propertyKey || $[16] !== tableKey) {
25560
+ if ($[7] !== cellRect || $[8] !== container || $[9] !== customFieldValidator || $[10] !== entityId || $[11] !== inputCollection || $[12] !== onCellValueChange || $[13] !== onClose || $[14] !== open || $[15] !== path || $[16] !== propertyKey || $[17] !== tableKey) {
25334
25561
  t3 = {
25335
25562
  tableKey,
25336
25563
  entityId,
@@ -25344,29 +25571,29 @@ function PopupFormFieldLoading(t0) {
25344
25571
  onCellValueChange,
25345
25572
  container
25346
25573
  };
25347
- $[6] = cellRect;
25348
- $[7] = container;
25349
- $[8] = customFieldValidator;
25350
- $[9] = entityId;
25351
- $[10] = inputCollection;
25352
- $[11] = onCellValueChange;
25353
- $[12] = onClose;
25354
- $[13] = open;
25355
- $[14] = path;
25356
- $[15] = propertyKey;
25357
- $[16] = tableKey;
25358
- $[17] = t3;
25574
+ $[7] = cellRect;
25575
+ $[8] = container;
25576
+ $[9] = customFieldValidator;
25577
+ $[10] = entityId;
25578
+ $[11] = inputCollection;
25579
+ $[12] = onCellValueChange;
25580
+ $[13] = onClose;
25581
+ $[14] = open;
25582
+ $[15] = path;
25583
+ $[16] = propertyKey;
25584
+ $[17] = tableKey;
25585
+ $[18] = t3;
25359
25586
  } else {
25360
- t3 = $[17];
25587
+ t3 = $[18];
25361
25588
  }
25362
25589
  let t4;
25363
- if ($[18] !== entity || $[19] !== t3) {
25590
+ if ($[19] !== entity || $[20] !== t3) {
25364
25591
  t4 = /* @__PURE__ */ jsx(PopupFormFieldInternal, { ...t3, entity });
25365
- $[18] = entity;
25366
- $[19] = t3;
25367
- $[20] = t4;
25592
+ $[19] = entity;
25593
+ $[20] = t3;
25594
+ $[21] = t4;
25368
25595
  } else {
25369
- t4 = $[20];
25596
+ t4 = $[21];
25370
25597
  }
25371
25598
  return t4;
25372
25599
  }
@@ -25938,6 +26165,7 @@ const DEFAULT_ENTITY_OPEN_MODE = "side_panel";
25938
26165
  const EntityCollectionView$1 = React__default.memo(function EntityCollectionView2({
25939
26166
  fullPath: fullPathProp,
25940
26167
  fullIdPath,
26168
+ pathSegments,
25941
26169
  parentCollectionIds,
25942
26170
  isSubCollection,
25943
26171
  className,
@@ -26060,6 +26288,7 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26060
26288
  } = usedSelectionController;
26061
26289
  const tableController = useDataSourceTableController({
26062
26290
  fullPath,
26291
+ pathSegments,
26063
26292
  collection,
26064
26293
  lastDeleteTimestamp,
26065
26294
  scrollRestoration,
@@ -26101,6 +26330,7 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26101
26330
  collection: collection_2,
26102
26331
  entityId: void 0,
26103
26332
  path: fullPath,
26333
+ pathSegments,
26104
26334
  fullIdPath,
26105
26335
  sideEntityController,
26106
26336
  navigation,
@@ -26159,6 +26389,7 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26159
26389
  const onViewModeChange = useCallback((mode) => {
26160
26390
  analyticsController.onAnalyticsEvent?.("view_mode_changed", {
26161
26391
  path: fullPath,
26392
+ pathSegments,
26162
26393
  from: viewMode,
26163
26394
  to: mode
26164
26395
  });
@@ -26273,6 +26504,7 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26273
26504
  const onKanbanPropertyChange = useCallback((property_1) => {
26274
26505
  analyticsController.onAnalyticsEvent?.("kanban_property_changed", {
26275
26506
  path: fullPath,
26507
+ pathSegments,
26276
26508
  property: property_1
26277
26509
  });
26278
26510
  setSelectedKanbanProperty(property_1);
@@ -26327,6 +26559,7 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26327
26559
  entityId: entity_3.id,
26328
26560
  selectedTab: subcollection.id ?? subcollection.path,
26329
26561
  path: fullPath,
26562
+ pathSegments,
26330
26563
  fullIdPath,
26331
26564
  navigation,
26332
26565
  sideEntityController
@@ -26400,7 +26633,7 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26400
26633
  breadcrumbs.updateCount(fullPath, docsCount);
26401
26634
  }
26402
26635
  }, [docsCount, fullPath, breadcrumbs.updateCount]);
26403
- const countFetcher = /* @__PURE__ */ jsx(EntitiesCount, { fullPath, collection, filter: tableController.filterValues, sortBy: tableController.sortBy, onCountChange: setDocsCount });
26636
+ const countFetcher = /* @__PURE__ */ jsx(EntitiesCount, { fullPath, pathSegments, collection, filter: tableController.filterValues, sortBy: tableController.sortBy, onCountChange: setDocsCount });
26404
26637
  const buildAdditionalHeaderWidget = useCallback(({
26405
26638
  property: property_2,
26406
26639
  propertyKey: propertyKey_1,
@@ -26425,7 +26658,11 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26425
26658
  } = useTableSearchHelper({
26426
26659
  collection,
26427
26660
  fullPath: resolvedFullPath,
26428
- parentCollectionIds
26661
+ parentCollectionIds,
26662
+ // When the search term comes from the URL instead of the search bar, text search
26663
+ // has never been initialised for this collection. Initialise it so the search bar
26664
+ // is usable (editable and clearable) right away.
26665
+ initialSearchString: tableController.searchString
26429
26666
  });
26430
26667
  const [viewModePopoverOpen, setViewModePopoverOpen] = useState(false);
26431
26668
  const viewModeToggleElement = /* @__PURE__ */ jsx(ViewModeToggle, { viewMode, onViewModeChange, enabledViews, size: viewMode === "table" ? tableSize : viewMode === "cards" ? cardSize : void 0, onSizeChanged: viewMode === "table" ? onTableSizeChanged : viewMode === "cards" ? setCardSize : void 0, open: viewModePopoverOpen, onOpenChange: setViewModePopoverOpen, kanbanPropertyOptions, selectedKanbanProperty, onKanbanPropertyChange });
@@ -26442,8 +26679,8 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26442
26679
  }, [tableController.dataLoadingError, customizationController.plugins, fullPath, collection, parentCollectionIds]);
26443
26680
  return /* @__PURE__ */ jsxs("div", { className: cls("overflow-hidden h-full w-full rounded-md flex flex-col", className), ref: containerRef, children: [
26444
26681
  countFetcher,
26445
- /* @__PURE__ */ jsx(CollectionTableToolbar, { loading: tableController.dataLoading, onTextSearch: textSearchEnabled && textSearchInitialised ? tableController.setSearchString : void 0, onTextSearchClick: textSearchEnabled && !textSearchInitialised ? onTextSearchClick : void 0, textSearchLoading, viewModeToggle: viewModeToggleElement, actionsStart: /* @__PURE__ */ jsx(EntityCollectionViewStartActions, { parentCollectionIds: parentCollectionIds ?? [], collection, tableController, path: fullPath, relativePath: collection.path, selectionController: usedSelectionController, collectionEntitiesCount: docsCount, resolvedProperties: resolvedCollection.properties }), actions: /* @__PURE__ */ jsx(EntityCollectionViewActions, { parentCollectionIds: parentCollectionIds ?? [], collection, tableController, onMultipleDeleteClick, onNewClick, path: fullPath, relativePath: collection.path, selectionController: usedSelectionController, selectionEnabled, collectionEntitiesCount: docsCount }) }),
26446
- tableController.dataLoadingError ? pluginErrorView ?? /* @__PURE__ */ jsx(CollectionDataErrorBanner, { error: tableController.dataLoadingError }) : viewMode === "kanban" && enabledViews.includes("kanban") ? /* @__PURE__ */ jsx(EntityCollectionBoardView, { collection, tableController, fullPath, parentCollectionIds, columnProperty: selectedKanbanProperty, onEntityClick, selectionController: usedSelectionController, selectionEnabled, highlightedEntities: highlightedEntity ? [highlightedEntity] : [], deletedEntities, emptyComponent: canCreateEntities && tableController.filterValues === void 0 && tableController.sortBy === void 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center", children: [
26682
+ /* @__PURE__ */ jsx(CollectionTableToolbar, { loading: tableController.dataLoading, onTextSearch: textSearchEnabled && textSearchInitialised ? tableController.setSearchString : void 0, onTextSearchClick: textSearchEnabled && !textSearchInitialised ? onTextSearchClick : void 0, initialSearchString: tableController.searchString, textSearchLoading, viewModeToggle: viewModeToggleElement, actionsStart: /* @__PURE__ */ jsx(EntityCollectionViewStartActions, { parentCollectionIds: parentCollectionIds ?? [], collection, tableController, path: fullPath, relativePath: collection.path, selectionController: usedSelectionController, collectionEntitiesCount: docsCount, resolvedProperties: resolvedCollection.properties }), actions: /* @__PURE__ */ jsx(EntityCollectionViewActions, { parentCollectionIds: parentCollectionIds ?? [], collection, tableController, onMultipleDeleteClick, onNewClick, path: fullPath, relativePath: collection.path, selectionController: usedSelectionController, selectionEnabled, collectionEntitiesCount: docsCount }) }),
26683
+ tableController.dataLoadingError ? pluginErrorView ?? /* @__PURE__ */ jsx(CollectionDataErrorBanner, { error: tableController.dataLoadingError }) : viewMode === "kanban" && enabledViews.includes("kanban") ? /* @__PURE__ */ jsx(EntityCollectionBoardView, { collection, tableController, fullPath, pathSegments, parentCollectionIds, columnProperty: selectedKanbanProperty, onEntityClick, selectionController: usedSelectionController, selectionEnabled, highlightedEntities: highlightedEntity ? [highlightedEntity] : [], deletedEntities, emptyComponent: canCreateEntities && tableController.filterValues === void 0 && tableController.sortBy === void 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center", children: [
26447
26684
  /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: t("so_empty") }),
26448
26685
  /* @__PURE__ */ jsxs(Button, { onClick: onNewClick, className: "mt-4", children: [
26449
26686
  /* @__PURE__ */ jsx(AddIcon, {}),
@@ -26480,7 +26717,7 @@ const EntityCollectionView$1 = React__default.memo(function EntityCollectionView
26480
26717
  });
26481
26718
  }
26482
26719
  } }, `collection_table_${fullPath}`),
26483
- popupCell && /* @__PURE__ */ jsx(PopupFormField, { open: Boolean(popupCell), onClose: onPopupClose, cellRect: popupCell?.cellRect, propertyKey: popupCell?.propertyKey, collection, entityId: popupCell.entityId, tableKey: tableKey.current, customFieldValidator: uniqueFieldValidator, path: resolvedFullPath, onCellValueChange: onValueChange, container: containerRef.current }, `popup_form_${popupCell?.propertyKey}_${popupCell?.entityId}`),
26720
+ popupCell && /* @__PURE__ */ jsx(PopupFormField, { pathSegments, open: Boolean(popupCell), onClose: onPopupClose, cellRect: popupCell?.cellRect, propertyKey: popupCell?.propertyKey, collection, entityId: popupCell.entityId, tableKey: tableKey.current, customFieldValidator: uniqueFieldValidator, path: resolvedFullPath, onCellValueChange: onValueChange, container: containerRef.current }, `popup_form_${popupCell?.propertyKey}_${popupCell?.entityId}`),
26484
26721
  deleteEntityClicked && /* @__PURE__ */ jsx(DeleteEntityDialog, { entityOrEntitiesToDelete: deleteEntityClicked, path: fullPath, collection, callbacks: collection.callbacks, open: Boolean(deleteEntityClicked), onEntityDelete: internalOnEntityDelete, onMultipleEntitiesDelete: internalOnMultipleEntitiesDelete, onClose: () => setDeleteEntityClicked(void 0) })
26485
26722
  ] });
26486
26723
  }, (a, b) => {
@@ -26491,7 +26728,8 @@ function EntitiesCount({
26491
26728
  collection,
26492
26729
  filter,
26493
26730
  sortBy,
26494
- onCountChange
26731
+ onCountChange,
26732
+ pathSegments
26495
26733
  }) {
26496
26734
  const dataSource = useDataSource();
26497
26735
  const navigation = useNavigationController();
@@ -26500,15 +26738,17 @@ function EntitiesCount({
26500
26738
  const sortByProperty = sortBy ? sortBy[0] : void 0;
26501
26739
  const currentSort = sortBy ? sortBy[1] : void 0;
26502
26740
  const resolvedPath = useMemo(() => navigation.resolveIdsFrom(fullPath), [fullPath, navigation.resolveIdsFrom]);
26741
+ const resolvedPathSegments = pathSegments;
26503
26742
  useEffect(() => {
26504
26743
  if (dataSource.countEntities) dataSource.countEntities({
26505
26744
  path: resolvedPath,
26745
+ pathSegments: resolvedPathSegments,
26506
26746
  collection,
26507
26747
  filter,
26508
26748
  orderBy: sortByProperty,
26509
26749
  order: currentSort
26510
26750
  }).then(setCount).catch(setError);
26511
- }, [fullPath, dataSource.countEntities, resolvedPath, collection, filter, sortByProperty, currentSort]);
26751
+ }, [fullPath, dataSource.countEntities, resolvedPath, resolvedPathSegments, collection, filter, sortByProperty, currentSort]);
26512
26752
  useEffect(() => {
26513
26753
  if (onCountChange && count !== void 0) {
26514
26754
  setError(void 0);
@@ -28296,7 +28536,8 @@ function getParentReferencesFromPath(props) {
28296
28536
  const {
28297
28537
  path,
28298
28538
  collections = [],
28299
- currentFullPath
28539
+ currentFullPath,
28540
+ currentPathSegments = []
28300
28541
  } = props;
28301
28542
  const subpaths = removeInitialAndTrailingSlashes(path).split("/");
28302
28543
  const subpathCombinations = getCollectionPathsCombinations(subpaths);
@@ -28306,12 +28547,14 @@ function getParentReferencesFromPath(props) {
28306
28547
  const collection = collections && collections.find((entry) => entry.id === subpathCombination || entry.path === subpathCombination);
28307
28548
  if (collection) {
28308
28549
  const collectionPath = currentFullPath && currentFullPath.length > 0 ? currentFullPath + "/" + collection.path : collection.path;
28550
+ const collectionSegments = [...currentPathSegments, ...collection.path.split("/")];
28309
28551
  const restOfThePath = removeInitialAndTrailingSlashes(removeInitialAndTrailingSlashes(path).replace(subpathCombination, ""));
28310
28552
  const nextSegments = restOfThePath.length > 0 ? restOfThePath.split("/") : [];
28311
28553
  if (nextSegments.length > 0) {
28312
28554
  const entityId = decodeEntityId(nextSegments[0]);
28313
28555
  const fullPath = collectionPath + "/" + entityId;
28314
- result.push(new EntityReference(entityId, collectionPath));
28556
+ const entitySegments = [...collectionSegments, entityId];
28557
+ result.push(new EntityReference(entityId, collectionPath, void 0, collectionSegments));
28315
28558
  if (nextSegments.length > 1) {
28316
28559
  const newPath = nextSegments.slice(1).join("/");
28317
28560
  if (!collection) {
@@ -28321,7 +28564,8 @@ function getParentReferencesFromPath(props) {
28321
28564
  result.push(...getParentReferencesFromPath({
28322
28565
  path: newPath,
28323
28566
  collections: collection.subcollections,
28324
- currentFullPath: fullPath
28567
+ currentFullPath: fullPath,
28568
+ currentPathSegments: entitySegments
28325
28569
  }));
28326
28570
  }
28327
28571
  }
@@ -29105,6 +29349,7 @@ function useValidateAuthenticator(t0) {
29105
29349
  const delegateUser = authController.user;
29106
29350
  if (authenticator instanceof Function && delegateUser && !equal(checkedUserRef.current?.uid, delegateUser.uid)) {
29107
29351
  setAuthLoading(true);
29352
+ setNotAllowedError(false);
29108
29353
  try {
29109
29354
  const allowed = await authenticator({
29110
29355
  user: delegateUser,
@@ -29384,6 +29629,7 @@ function EntitySidePanel(props) {
29384
29629
  path,
29385
29630
  entityId,
29386
29631
  fullIdPath,
29632
+ pathSegments,
29387
29633
  formProps
29388
29634
  } = props;
29389
29635
  const {
@@ -29451,7 +29697,7 @@ function EntitySidePanel(props) {
29451
29697
  if (!props || !collection) {
29452
29698
  return /* @__PURE__ */ jsx("div", { className: "w-full" });
29453
29699
  }
29454
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(EntityEditView$1, { ...props, fullIdPath, layout: "side_panel", collection, parentCollectionIds, onValuesModified, onSaved: onUpdate, barActions: ({
29700
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(EntityEditView$1, { ...props, fullIdPath, pathSegments, layout: "side_panel", collection, parentCollectionIds, onValuesModified, onSaved: onUpdate, barActions: ({
29455
29701
  status,
29456
29702
  values
29457
29703
  }) => /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -29957,6 +30203,7 @@ function EntityEditView$1({
29957
30203
  dataLoadingError
29958
30204
  } = useEntityFetch({
29959
30205
  path: props.path,
30206
+ pathSegments: props.pathSegments,
29960
30207
  entityId,
29961
30208
  collection: props.collection,
29962
30209
  databaseId: props.databaseId,
@@ -29984,6 +30231,7 @@ function EntityEditView$1({
29984
30231
  function EntityEditViewInner({
29985
30232
  path,
29986
30233
  fullIdPath,
30234
+ pathSegments,
29987
30235
  entityId,
29988
30236
  selectedTab: selectedTabProp,
29989
30237
  collection,
@@ -30117,10 +30365,11 @@ function EntityEditViewInner({
30117
30365
  const subcollectionId = subcollection.id ?? subcollection.path;
30118
30366
  const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection.path)}` : void 0;
30119
30367
  const newFullIdPath = fullIdPath && usedEntity ? `${fullIdPath}/${encodeEntityId(usedEntity.id)}/${removeInitialAndTrailingSlashes(subcollectionId)}` : void 0;
30368
+ const newPathSegments = usedEntity && pathSegments ? [...pathSegments, usedEntity.id, ...removeInitialAndTrailingSlashes(subcollection.path).split("/")] : void 0;
30120
30369
  if (selectedTab !== subcollectionId) return null;
30121
30370
  return /* @__PURE__ */ jsxs("div", { className: "relative flex-1 h-full overflow-auto w-full", role: "tabpanel", children: [
30122
30371
  globalLoading && /* @__PURE__ */ jsx(CircularProgressCenter, {}),
30123
- !globalLoading && (usedEntity && newFullPath ? /* @__PURE__ */ jsx(EntityCollectionView$1, { fullPath: newFullPath, fullIdPath: newFullIdPath, parentCollectionIds: [...parentCollectionIds, collection.id], isSubCollection: true, updateUrl: false, ...subcollection, openEntityMode: layout }) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-full h-full p-3", children: /* @__PURE__ */ jsx(Typography, { variant: "label", children: t("youd_need_to_save_before_additional_collections") }) }))
30372
+ !globalLoading && (usedEntity && newFullPath ? /* @__PURE__ */ jsx(EntityCollectionView$1, { fullPath: newFullPath, pathSegments: newPathSegments, fullIdPath: newFullIdPath, parentCollectionIds: [...parentCollectionIds, collection.id], isSubCollection: true, updateUrl: false, ...subcollection, openEntityMode: layout }) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-full h-full p-3", children: /* @__PURE__ */ jsx(Typography, { variant: "label", children: t("youd_need_to_save_before_additional_collections") }) }))
30124
30373
  ] }, `subcol_${subcollectionId}`);
30125
30374
  }).filter(Boolean);
30126
30375
  const onSideTabClick = (value_0) => {
@@ -30139,7 +30388,7 @@ function EntityEditViewInner({
30139
30388
  /* @__PURE__ */ jsx(EntityView, { className: "px-8 h-full overflow-auto", entity, path, collection }),
30140
30389
  /* @__PURE__ */ jsx("div", { className: "h-16" })
30141
30390
  ] }) }) : null;
30142
- const entityView = /* @__PURE__ */ jsx(EntityForm, { fullIdPath, collection, path, entityId: entityId ?? usedEntity?.id, onValuesModified, entity, initialDirtyValues, openEntityMode: layout, forceActionsAtTheBottom: actionsAtTheBottom, initialStatus: status, className: cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className), EntityFormActionsComponent: EntityEditViewFormActions, disabled: !canEdit, ...formProps, onEntityChange: (entity_0) => {
30391
+ const entityView = /* @__PURE__ */ jsx(EntityForm, { fullIdPath, collection, path, pathSegments, entityId: entityId ?? usedEntity?.id, onValuesModified, entity, initialDirtyValues, openEntityMode: layout, forceActionsAtTheBottom: actionsAtTheBottom, initialStatus: status, className: cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className), EntityFormActionsComponent: EntityEditViewFormActions, disabled: !canEdit, ...formProps, onEntityChange: (entity_0) => {
30143
30392
  setUsedEntity(entity_0);
30144
30393
  formProps?.onEntityChange?.(entity_0);
30145
30394
  }, onStatusChange: (status_0) => {
@@ -30369,17 +30618,20 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
30369
30618
  let sidePanel = void 0;
30370
30619
  let lastCollectionPath = "";
30371
30620
  let lastCollectionId = void 0;
30621
+ let lastCollectionSegments = void 0;
30372
30622
  for (let i = 0; i < navigationViewsForPath.length; i++) {
30373
30623
  const navigationEntry = navigationViewsForPath[i];
30374
30624
  if (navigationEntry.type === "collection") {
30375
30625
  lastCollectionPath = navigationEntry.path;
30376
30626
  lastCollectionId = navigationEntry.collection.id;
30627
+ lastCollectionSegments = navigationEntry.pathSegments;
30377
30628
  }
30378
30629
  const previousEntry = navigationViewsForPath[i - 1];
30379
30630
  if (navigationEntry.type === "entity") {
30380
30631
  sidePanel = {
30381
30632
  path: navigationEntry.path,
30382
30633
  fullIdPath: navigationEntry.fullIdPath,
30634
+ pathSegments: navigationEntry.pathSegments,
30383
30635
  entityId: navigationEntry.entityId,
30384
30636
  copy: false,
30385
30637
  width: navigationEntry.parentCollection?.sideDialogWidth
@@ -30398,6 +30650,9 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
30398
30650
  sidePanel = {
30399
30651
  path: lastCollectionPath,
30400
30652
  fullIdPath: lastCollectionId,
30653
+ // A new entity still needs unambiguous segments: it may be created inside a
30654
+ // subcollection whose parent id contains "/".
30655
+ pathSegments: lastCollectionSegments,
30401
30656
  copy: false
30402
30657
  };
30403
30658
  }
@@ -30634,6 +30889,7 @@ function useBuildDataSource({
30634
30889
  */
30635
30890
  fetchCollection: useCallback(({
30636
30891
  path,
30892
+ pathSegments,
30637
30893
  collection,
30638
30894
  filter,
30639
30895
  limit,
@@ -30645,6 +30901,7 @@ function useBuildDataSource({
30645
30901
  const usedDelegate = collection?.overrides?.dataSourceDelegate ?? delegate;
30646
30902
  return usedDelegate.fetchCollection({
30647
30903
  path,
30904
+ pathSegments,
30648
30905
  filter,
30649
30906
  limit,
30650
30907
  startAfter,
@@ -30672,6 +30929,7 @@ function useBuildDataSource({
30672
30929
  */
30673
30930
  listenCollection: delegate.listenCollection ? useCallback(({
30674
30931
  path: path_0,
30932
+ pathSegments: pathSegments_0,
30675
30933
  collection: collectionProp,
30676
30934
  filter: filter_0,
30677
30935
  limit: limit_0,
@@ -30687,6 +30945,7 @@ function useBuildDataSource({
30687
30945
  if (!usedDelegate_0.listenCollection) throw Error("useBuildDataSource delegate not initialised");
30688
30946
  return usedDelegate_0.listenCollection({
30689
30947
  path: path_0,
30948
+ pathSegments: pathSegments_0,
30690
30949
  filter: filter_0,
30691
30950
  limit: limit_0,
30692
30951
  startAfter: startAfter_0,
@@ -30707,12 +30966,14 @@ function useBuildDataSource({
30707
30966
  */
30708
30967
  fetchEntity: useCallback(({
30709
30968
  path: path_1,
30969
+ pathSegments: pathSegments_1,
30710
30970
  entityId,
30711
30971
  collection: collection_1
30712
30972
  }) => {
30713
30973
  const usedDelegate_1 = collection_1?.overrides?.dataSourceDelegate ?? delegate;
30714
30974
  return usedDelegate_1.fetchEntity({
30715
30975
  path: path_1,
30976
+ pathSegments: pathSegments_1,
30716
30977
  entityId,
30717
30978
  collection: collection_1
30718
30979
  });
@@ -30729,6 +30990,7 @@ function useBuildDataSource({
30729
30990
  */
30730
30991
  listenEntity: delegate.listenEntity ? useCallback(({
30731
30992
  path: path_2,
30993
+ pathSegments: pathSegments_2,
30732
30994
  entityId: entityId_0,
30733
30995
  collection: collection_2,
30734
30996
  onUpdate: onUpdate_0,
@@ -30738,6 +31000,7 @@ function useBuildDataSource({
30738
31000
  if (!usedDelegate_2.listenEntity) throw Error("useBuildDataSource delegate not initialised");
30739
31001
  return usedDelegate_2.listenEntity({
30740
31002
  path: path_2,
31003
+ pathSegments: pathSegments_2,
30741
31004
  entityId: entityId_0,
30742
31005
  onUpdate: onUpdate_0,
30743
31006
  onError: onError_0,
@@ -30757,6 +31020,7 @@ function useBuildDataSource({
30757
31020
  */
30758
31021
  saveEntity: useCallback(async ({
30759
31022
  path: path_3,
31023
+ pathSegments: pathSegments_3,
30760
31024
  entityId: entityId_1,
30761
31025
  values,
30762
31026
  collection: collectionProp_0,
@@ -30789,6 +31053,7 @@ function useBuildDataSource({
30789
31053
  try {
30790
31054
  const entities = await usedDelegate_3.fetchCollection({
30791
31055
  path: path_3,
31056
+ pathSegments: pathSegments_3,
30792
31057
  orderBy: orderProperty,
30793
31058
  order: "asc",
30794
31059
  limit: 1,
@@ -30811,6 +31076,7 @@ function useBuildDataSource({
30811
31076
  }
30812
31077
  return usedDelegate_3.saveEntity({
30813
31078
  path: path_3,
31079
+ pathSegments: pathSegments_3,
30814
31080
  collection: collection_3,
30815
31081
  entityId: entityId_1,
30816
31082
  values: finalValues,
@@ -30831,11 +31097,14 @@ function useBuildDataSource({
30831
31097
  */
30832
31098
  deleteEntity: useCallback(({
30833
31099
  entity,
31100
+ pathSegments: pathSegments_4,
30834
31101
  collection: collection_4
30835
31102
  }) => {
30836
31103
  const usedDelegate_4 = collection_4?.overrides?.dataSourceDelegate ?? delegate;
30837
31104
  return usedDelegate_4.deleteEntity({
30838
31105
  entity,
31106
+ // Falls back to what the entity carries from the fetch that produced it.
31107
+ pathSegments: pathSegments_4 ?? entity.pathSegments,
30839
31108
  collection: collection_4
30840
31109
  });
30841
31110
  }, [delegate.deleteEntity]),
@@ -30849,16 +31118,17 @@ function useBuildDataSource({
30849
31118
  * @return `true` if there are no other fields besides the given entity
30850
31119
  * @group Firestore
30851
31120
  */
30852
- checkUniqueField: useCallback((path_4, name, value, entityId_2, collection_5) => {
31121
+ checkUniqueField: useCallback((path_4, name, value, entityId_2, collection_5, pathSegments_5) => {
30853
31122
  const usedDelegate_5 = collection_5?.overrides?.dataSourceDelegate ?? delegate;
30854
- return usedDelegate_5.checkUniqueField(path_4, name, value, entityId_2, collection_5);
31123
+ return usedDelegate_5.checkUniqueField(path_4, name, value, entityId_2, collection_5, pathSegments_5);
30855
31124
  }, [delegate.checkUniqueField]),
30856
- generateEntityId: useCallback((path_5, collection_6) => {
31125
+ generateEntityId: useCallback((path_5, collection_6, pathSegments_6) => {
30857
31126
  const usedDelegate_6 = collection_6?.overrides?.dataSourceDelegate ?? delegate;
30858
- return usedDelegate_6.generateEntityId(path_5, collection_6);
31127
+ return usedDelegate_6.generateEntityId(path_5, collection_6, pathSegments_6);
30859
31128
  }, [delegate.generateEntityId]),
30860
31129
  countEntities: delegate.countEntities ? async ({
30861
31130
  path: path_6,
31131
+ pathSegments: pathSegments_7,
30862
31132
  collection: collection_7,
30863
31133
  filter: filter_1,
30864
31134
  order: order_1,
@@ -30867,6 +31137,7 @@ function useBuildDataSource({
30867
31137
  const usedDelegate_7 = collection_7?.overrides?.dataSourceDelegate ?? delegate;
30868
31138
  return usedDelegate_7.countEntities({
30869
31139
  path: path_6,
31140
+ pathSegments: pathSegments_7,
30870
31141
  filter: filter_1,
30871
31142
  orderBy: orderBy_1,
30872
31143
  order: order_1,
@@ -30875,6 +31146,7 @@ function useBuildDataSource({
30875
31146
  } : void 0,
30876
31147
  isFilterCombinationValid: useCallback(({
30877
31148
  path: path_7,
31149
+ pathSegments: pathSegments_8,
30878
31150
  databaseId,
30879
31151
  filterValues,
30880
31152
  sortBy
@@ -30882,6 +31154,7 @@ function useBuildDataSource({
30882
31154
  if (!delegate.isFilterCombinationValid) return true;
30883
31155
  return delegate.isFilterCombinationValid({
30884
31156
  path: path_7,
31157
+ pathSegments: pathSegments_8,
30885
31158
  databaseId,
30886
31159
  filterValues,
30887
31160
  sortBy
@@ -32244,7 +32517,7 @@ function shouldBlockEntityNavigation(params) {
32244
32517
  const EntityEditView = lazyEager(() => Promise.resolve().then(() => EntityEditView$2), "EntityEditView");
32245
32518
  const EntityCollectionView = lazyEager(() => Promise.resolve().then(() => EntityCollectionView$2), "EntityCollectionView");
32246
32519
  function FireCMSRoute() {
32247
- const $ = c(82);
32520
+ const $ = c(87);
32248
32521
  const location = useLocation$1();
32249
32522
  const navigation = useNavigationController();
32250
32523
  const breadcrumbs = useBreadcrumbsController();
@@ -32368,12 +32641,13 @@ function FireCMSRoute() {
32368
32641
  let t13;
32369
32642
  let t14;
32370
32643
  let t15;
32644
+ let t16;
32371
32645
  let t62;
32372
32646
  let t7;
32373
32647
  let t8;
32374
32648
  let t9;
32375
- if ($[18] !== navigation || $[19] !== navigationEntries[0].id || $[20] !== navigationEntries[0].path) {
32376
- t15 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
32649
+ if ($[18] !== navigation || $[19] !== navigationEntries[0].id || $[20] !== navigationEntries[0].path || $[21] !== navigationEntries[0].pathSegments) {
32650
+ t16 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
32377
32651
  bb0: {
32378
32652
  let collection;
32379
32653
  collection = navigation.getCollectionById(navigationEntries[0].id);
@@ -32381,85 +32655,90 @@ function FireCMSRoute() {
32381
32655
  collection = navigation.getCollection(navigationEntries[0].path);
32382
32656
  }
32383
32657
  if (!collection) {
32384
- t15 = null;
32658
+ t16 = null;
32385
32659
  break bb0;
32386
32660
  }
32387
32661
  T1 = React__default.Suspense;
32388
- t14 = null;
32662
+ t15 = null;
32389
32663
  T0 = EntityCollectionView;
32390
32664
  t62 = `collection_view_${collection.id ?? collection.path}`;
32391
32665
  t7 = false;
32392
- if ($[33] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
32666
+ if ($[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
32393
32667
  t8 = [];
32394
- $[33] = t8;
32668
+ $[35] = t8;
32395
32669
  } else {
32396
- t8 = $[33];
32670
+ t8 = $[35];
32397
32671
  }
32398
32672
  t9 = collection.path;
32399
- t10 = collection.id;
32400
- t11 = true;
32401
- t12 = collection;
32402
- t13 = toArray(collection.Actions);
32673
+ t10 = navigationEntries[0].pathSegments;
32674
+ t11 = collection.id;
32675
+ t12 = true;
32676
+ t13 = collection;
32677
+ t14 = toArray(collection.Actions);
32403
32678
  }
32404
32679
  $[18] = navigation;
32405
32680
  $[19] = navigationEntries[0].id;
32406
32681
  $[20] = navigationEntries[0].path;
32407
- $[21] = T0;
32408
- $[22] = T1;
32409
- $[23] = t10;
32410
- $[24] = t11;
32411
- $[25] = t12;
32412
- $[26] = t13;
32413
- $[27] = t14;
32414
- $[28] = t15;
32415
- $[29] = t62;
32416
- $[30] = t7;
32417
- $[31] = t8;
32418
- $[32] = t9;
32682
+ $[21] = navigationEntries[0].pathSegments;
32683
+ $[22] = T0;
32684
+ $[23] = T1;
32685
+ $[24] = t10;
32686
+ $[25] = t11;
32687
+ $[26] = t12;
32688
+ $[27] = t13;
32689
+ $[28] = t14;
32690
+ $[29] = t15;
32691
+ $[30] = t16;
32692
+ $[31] = t62;
32693
+ $[32] = t7;
32694
+ $[33] = t8;
32695
+ $[34] = t9;
32419
32696
  } else {
32420
- T0 = $[21];
32421
- T1 = $[22];
32422
- t10 = $[23];
32423
- t11 = $[24];
32424
- t12 = $[25];
32425
- t13 = $[26];
32426
- t14 = $[27];
32427
- t15 = $[28];
32428
- t62 = $[29];
32429
- t7 = $[30];
32430
- t8 = $[31];
32431
- t9 = $[32];
32432
- }
32433
- if (t15 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
32434
- return t15;
32697
+ T0 = $[22];
32698
+ T1 = $[23];
32699
+ t10 = $[24];
32700
+ t11 = $[25];
32701
+ t12 = $[26];
32702
+ t13 = $[27];
32703
+ t14 = $[28];
32704
+ t15 = $[29];
32705
+ t16 = $[30];
32706
+ t62 = $[31];
32707
+ t7 = $[32];
32708
+ t8 = $[33];
32709
+ t9 = $[34];
32435
32710
  }
32436
- let t16;
32437
- if ($[34] !== T0 || $[35] !== t10 || $[36] !== t11 || $[37] !== t12 || $[38] !== t13 || $[39] !== t62 || $[40] !== t7 || $[41] !== t8 || $[42] !== t9) {
32438
- t16 = /* @__PURE__ */ jsx(T0, { isSubCollection: t7, parentCollectionIds: t8, fullPath: t9, fullIdPath: t10, updateUrl: t11, ...t12, Actions: t13 }, t62);
32439
- $[34] = T0;
32440
- $[35] = t10;
32441
- $[36] = t11;
32442
- $[37] = t12;
32443
- $[38] = t13;
32444
- $[39] = t62;
32445
- $[40] = t7;
32446
- $[41] = t8;
32447
- $[42] = t9;
32448
- $[43] = t16;
32449
- } else {
32450
- t16 = $[43];
32711
+ if (t16 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
32712
+ return t16;
32451
32713
  }
32452
32714
  let t17;
32453
- if ($[44] !== T1 || $[45] !== t14 || $[46] !== t16) {
32454
- t17 = /* @__PURE__ */ jsx(T1, { fallback: t14, children: t16 });
32455
- $[44] = T1;
32456
- $[45] = t14;
32457
- $[46] = t16;
32458
- $[47] = t17;
32715
+ if ($[36] !== T0 || $[37] !== t10 || $[38] !== t11 || $[39] !== t12 || $[40] !== t13 || $[41] !== t14 || $[42] !== t62 || $[43] !== t7 || $[44] !== t8 || $[45] !== t9) {
32716
+ t17 = /* @__PURE__ */ jsx(T0, { isSubCollection: t7, parentCollectionIds: t8, fullPath: t9, pathSegments: t10, fullIdPath: t11, updateUrl: t12, ...t13, Actions: t14 }, t62);
32717
+ $[36] = T0;
32718
+ $[37] = t10;
32719
+ $[38] = t11;
32720
+ $[39] = t12;
32721
+ $[40] = t13;
32722
+ $[41] = t14;
32723
+ $[42] = t62;
32724
+ $[43] = t7;
32725
+ $[44] = t8;
32726
+ $[45] = t9;
32727
+ $[46] = t17;
32728
+ } else {
32729
+ t17 = $[46];
32730
+ }
32731
+ let t18;
32732
+ if ($[47] !== T1 || $[48] !== t15 || $[49] !== t17) {
32733
+ t18 = /* @__PURE__ */ jsx(T1, { fallback: t15, children: t17 });
32734
+ $[47] = T1;
32735
+ $[48] = t15;
32736
+ $[49] = t17;
32737
+ $[50] = t18;
32459
32738
  } else {
32460
- t17 = $[47];
32739
+ t18 = $[50];
32461
32740
  }
32462
- return t17;
32741
+ return t18;
32463
32742
  }
32464
32743
  if (isSidePanel) {
32465
32744
  const lastCollectionEntry = navigationEntries.findLast(_temp2$2);
@@ -32472,12 +32751,13 @@ function FireCMSRoute() {
32472
32751
  let t13;
32473
32752
  let t14;
32474
32753
  let t15;
32754
+ let t16;
32475
32755
  let t62;
32476
32756
  let t7;
32477
32757
  let t8;
32478
32758
  let t9;
32479
- if ($[48] !== navigation || $[49] !== navigationEntries[0]) {
32480
- t15 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
32759
+ if ($[51] !== navigation || $[52] !== navigationEntries[0]) {
32760
+ t16 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
32481
32761
  bb1: {
32482
32762
  let collection_0;
32483
32763
  const firstEntry = navigationEntries[0];
@@ -32486,96 +32766,100 @@ function FireCMSRoute() {
32486
32766
  collection_0 = navigation.getCollection(firstEntry.path);
32487
32767
  }
32488
32768
  if (!collection_0) {
32489
- t15 = null;
32769
+ t16 = null;
32490
32770
  break bb1;
32491
32771
  }
32492
32772
  T1 = React__default.Suspense;
32493
- t14 = null;
32773
+ t15 = null;
32494
32774
  T0 = EntityCollectionView;
32495
32775
  t62 = `collection_view_${collection_0.id ?? collection_0.path}`;
32496
32776
  t7 = collection_0.id;
32497
32777
  t8 = false;
32498
- if ($[62] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
32778
+ if ($[66] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
32499
32779
  t9 = [];
32500
- $[62] = t9;
32780
+ $[66] = t9;
32501
32781
  } else {
32502
- t9 = $[62];
32782
+ t9 = $[66];
32503
32783
  }
32504
32784
  t10 = collection_0.path;
32505
- t11 = true;
32506
- t12 = collection_0;
32507
- t13 = toArray(collection_0.Actions);
32785
+ t11 = firstEntry.pathSegments;
32786
+ t12 = true;
32787
+ t13 = collection_0;
32788
+ t14 = toArray(collection_0.Actions);
32508
32789
  }
32509
- $[48] = navigation;
32510
- $[49] = navigationEntries[0];
32511
- $[50] = T0;
32512
- $[51] = T1;
32513
- $[52] = t10;
32514
- $[53] = t11;
32515
- $[54] = t12;
32516
- $[55] = t13;
32517
- $[56] = t14;
32518
- $[57] = t15;
32519
- $[58] = t62;
32520
- $[59] = t7;
32521
- $[60] = t8;
32522
- $[61] = t9;
32790
+ $[51] = navigation;
32791
+ $[52] = navigationEntries[0];
32792
+ $[53] = T0;
32793
+ $[54] = T1;
32794
+ $[55] = t10;
32795
+ $[56] = t11;
32796
+ $[57] = t12;
32797
+ $[58] = t13;
32798
+ $[59] = t14;
32799
+ $[60] = t15;
32800
+ $[61] = t16;
32801
+ $[62] = t62;
32802
+ $[63] = t7;
32803
+ $[64] = t8;
32804
+ $[65] = t9;
32523
32805
  } else {
32524
- T0 = $[50];
32525
- T1 = $[51];
32526
- t10 = $[52];
32527
- t11 = $[53];
32528
- t12 = $[54];
32529
- t13 = $[55];
32530
- t14 = $[56];
32531
- t15 = $[57];
32532
- t62 = $[58];
32533
- t7 = $[59];
32534
- t8 = $[60];
32535
- t9 = $[61];
32536
- }
32537
- if (t15 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
32538
- return t15;
32539
- }
32540
- let t16;
32541
- if ($[63] !== T0 || $[64] !== t10 || $[65] !== t11 || $[66] !== t12 || $[67] !== t13 || $[68] !== t62 || $[69] !== t7 || $[70] !== t8 || $[71] !== t9) {
32542
- t16 = /* @__PURE__ */ jsx(T0, { fullIdPath: t7, isSubCollection: t8, parentCollectionIds: t9, fullPath: t10, updateUrl: t11, ...t12, Actions: t13 }, t62);
32543
- $[63] = T0;
32544
- $[64] = t10;
32545
- $[65] = t11;
32546
- $[66] = t12;
32547
- $[67] = t13;
32548
- $[68] = t62;
32549
- $[69] = t7;
32550
- $[70] = t8;
32551
- $[71] = t9;
32552
- $[72] = t16;
32553
- } else {
32554
- t16 = $[72];
32806
+ T0 = $[53];
32807
+ T1 = $[54];
32808
+ t10 = $[55];
32809
+ t11 = $[56];
32810
+ t12 = $[57];
32811
+ t13 = $[58];
32812
+ t14 = $[59];
32813
+ t15 = $[60];
32814
+ t16 = $[61];
32815
+ t62 = $[62];
32816
+ t7 = $[63];
32817
+ t8 = $[64];
32818
+ t9 = $[65];
32819
+ }
32820
+ if (t16 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
32821
+ return t16;
32555
32822
  }
32556
32823
  let t17;
32557
- if ($[73] !== T1 || $[74] !== t14 || $[75] !== t16) {
32558
- t17 = /* @__PURE__ */ jsx(T1, { fallback: t14, children: t16 });
32559
- $[73] = T1;
32560
- $[74] = t14;
32561
- $[75] = t16;
32562
- $[76] = t17;
32824
+ if ($[67] !== T0 || $[68] !== t10 || $[69] !== t11 || $[70] !== t12 || $[71] !== t13 || $[72] !== t14 || $[73] !== t62 || $[74] !== t7 || $[75] !== t8 || $[76] !== t9) {
32825
+ t17 = /* @__PURE__ */ jsx(T0, { fullIdPath: t7, isSubCollection: t8, parentCollectionIds: t9, fullPath: t10, pathSegments: t11, updateUrl: t12, ...t13, Actions: t14 }, t62);
32826
+ $[67] = T0;
32827
+ $[68] = t10;
32828
+ $[69] = t11;
32829
+ $[70] = t12;
32830
+ $[71] = t13;
32831
+ $[72] = t14;
32832
+ $[73] = t62;
32833
+ $[74] = t7;
32834
+ $[75] = t8;
32835
+ $[76] = t9;
32836
+ $[77] = t17;
32837
+ } else {
32838
+ t17 = $[77];
32839
+ }
32840
+ let t18;
32841
+ if ($[78] !== T1 || $[79] !== t15 || $[80] !== t17) {
32842
+ t18 = /* @__PURE__ */ jsx(T1, { fallback: t15, children: t17 });
32843
+ $[78] = T1;
32844
+ $[79] = t15;
32845
+ $[80] = t17;
32846
+ $[81] = t18;
32563
32847
  } else {
32564
- t17 = $[76];
32848
+ t18 = $[81];
32565
32849
  }
32566
- return t17;
32850
+ return t18;
32567
32851
  }
32568
32852
  }
32569
32853
  let t6;
32570
- if ($[77] !== isCopy || $[78] !== isNew || $[79] !== navigationEntries || $[80] !== pathname) {
32854
+ if ($[82] !== isCopy || $[83] !== isNew || $[84] !== navigationEntries || $[85] !== pathname) {
32571
32855
  t6 = /* @__PURE__ */ jsx(EntityFullScreenRoute, { pathname, navigationEntries, isNew, isCopy });
32572
- $[77] = isCopy;
32573
- $[78] = isNew;
32574
- $[79] = navigationEntries;
32575
- $[80] = pathname;
32576
- $[81] = t6;
32856
+ $[82] = isCopy;
32857
+ $[83] = isNew;
32858
+ $[84] = navigationEntries;
32859
+ $[85] = pathname;
32860
+ $[86] = t6;
32577
32861
  } else {
32578
- t6 = $[81];
32862
+ t6 = $[86];
32579
32863
  }
32580
32864
  return t6;
32581
32865
  }
@@ -32654,7 +32938,7 @@ function EntityFullScreenRoute({
32654
32938
  const fullIdPath = isNew ? lastCollectionEntry.fullPath : parentCollectionEntry?.fullPath ?? lastEntityEntry.fullPath;
32655
32939
  const collectionPath = navigation.resolveIdsFrom(isNew ? lastCollectionEntry.path : lastEntityEntry.path);
32656
32940
  return /* @__PURE__ */ jsxs(Fragment, { children: [
32657
- /* @__PURE__ */ jsx(React__default.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(EntityEditView, { entityId: isNew ? void 0 : entityId, fullIdPath, collection, layout: "full_screen", path: collectionPath, copy: isCopy, selectedTab: selectedTab ?? void 0, onValuesModified: (modified) => blocked.current = modified, onSaved: (params) => {
32941
+ /* @__PURE__ */ jsx(React__default.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(EntityEditView, { entityId: isNew ? void 0 : entityId, fullIdPath, pathSegments: isNew ? lastCollectionEntry.pathSegments : lastEntityEntry.pathSegments, collection, layout: "full_screen", path: collectionPath, copy: isCopy, selectedTab: selectedTab ?? void 0, onValuesModified: (modified) => blocked.current = modified, onSaved: (params) => {
32658
32942
  const newEntityId = params.entityId;
32659
32943
  if (!newEntityId) return;
32660
32944
  navigate(buildEntityUrl(newEntityId, params.selectedTab), {
@@ -33634,6 +33918,7 @@ const en = {
33634
33918
  download: "Download",
33635
33919
  large_number_of_documents: "This collections has a large number of documents ({{count}}).",
33636
33920
  include_undefined_values: "Include undefined values",
33921
+ export_apply_filter_sort: "Only export results matching the current filter/sort",
33637
33922
  submit: "Submit",
33638
33923
  no_filterable_properties: "No filterable properties available",
33639
33924
  apply_filters: "Apply filters",
@@ -33821,6 +34106,10 @@ const en = {
33821
34106
  order_property_not_found: 'Property "{{property}}" does not exist or is not a number property. Please select a valid property or clear the selection.',
33822
34107
  no_number_properties: "No number properties found. Add a number property to enable ordering.",
33823
34108
  order_property_description: "Select a number property to persist the order of items",
34109
+ image_property: "Image Property",
34110
+ image_property_not_found: 'Property "{{property}}" does not exist or is not an image property. Please select a valid property or clear the selection.',
34111
+ no_image_properties: "No image properties found. Add a storage or URL image property to use as a thumbnail.",
34112
+ image_property_description: "Select the property used as the thumbnail image in Cards and Kanban view modes. If not set, the first matching image property will be used automatically.",
33824
34113
  display_settings: "Display settings",
33825
34114
  default_row_size: "Default row size",
33826
34115
  side_dialog_width: "Side dialog width",
@@ -34313,6 +34602,7 @@ const es = {
34313
34602
  download: "Descargar",
34314
34603
  large_number_of_documents: "Esta colección posee un gran número de documentos ({{count}}).",
34315
34604
  include_undefined_values: "Incluir valores omitidos (undefined)",
34605
+ export_apply_filter_sort: "Exportar solo los resultados que coinciden con el filtro/orden actual",
34316
34606
  submit: "Enviar",
34317
34607
  no_filterable_properties: "No hay propiedades filtrables disponibles",
34318
34608
  apply_filters: "Aplicar filtros",
@@ -34500,6 +34790,10 @@ const es = {
34500
34790
  order_property_not_found: 'La propiedad "{{property}}" no existe o no es una propiedad numérica. Selecciona una propiedad válida o borra la selección.',
34501
34791
  no_number_properties: "No se encontraron propiedades numéricas. Agrega una propiedad numérica para habilitar el ordenamiento.",
34502
34792
  order_property_description: "Selecciona una propiedad numérica para mantener el orden de los elementos",
34793
+ image_property: "Propiedad de imagen",
34794
+ image_property_not_found: 'La propiedad "{{property}}" no existe o no es una propiedad de imagen. Selecciona una propiedad válida o borra la selección.',
34795
+ no_image_properties: "No se encontraron propiedades de imagen. Agrega una propiedad de almacenamiento o URL de imagen para usarla como miniatura.",
34796
+ image_property_description: "Selecciona la propiedad usada como miniatura en las vistas de Tarjetas y Kanban. Si no se establece, se usará automáticamente la primera propiedad de imagen que coincida.",
34503
34797
  display_settings: "Configuración de visualización",
34504
34798
  default_row_size: "Tamaño de fila predeterminado",
34505
34799
  side_dialog_width: "Ancho del diálogo lateral",
@@ -34992,6 +35286,7 @@ const de = {
34992
35286
  download: "Herunterladen",
34993
35287
  large_number_of_documents: "Diese Sammlung hat eine große Anzahl von Dokumenten ({{count}}).",
34994
35288
  include_undefined_values: "Undefinierte Werte einschließen",
35289
+ export_apply_filter_sort: "Nur Ergebnisse exportieren, die dem aktuellen Filter/der aktuellen Sortierung entsprechen",
34995
35290
  submit: "Einreichen",
34996
35291
  no_filterable_properties: "Keine filterbaren Eigenschaften verfügbar",
34997
35292
  apply_filters: "Filter anwenden",
@@ -35177,6 +35472,10 @@ const de = {
35177
35472
  order_property_not_found: 'Eigenschaft "{{property}}" existiert nicht oder ist keine Zahlen-Eigenschaft. Bitte wählen Sie eine gültige Eigenschaft oder löschen Sie die Auswahl.',
35178
35473
  no_number_properties: "Keine Zahlen-Eigenschaften gefunden. Fügen Sie eine Zahlen-Eigenschaft hinzu, um die Sortierung zu aktivieren.",
35179
35474
  order_property_description: "Wählen Sie eine Zahlen-Eigenschaft, um die Reihenfolge der Elemente beizubehalten",
35475
+ image_property: "Bild-Eigenschaft",
35476
+ image_property_not_found: 'Eigenschaft "{{property}}" existiert nicht oder ist keine Bild-Eigenschaft. Bitte wählen Sie eine gültige Eigenschaft oder löschen Sie die Auswahl.',
35477
+ no_image_properties: "Keine Bild-Eigenschaften gefunden. Fügen Sie eine Speicher- oder Bild-URL-Eigenschaft hinzu, um sie als Vorschaubild zu verwenden.",
35478
+ image_property_description: "Wählen Sie die Eigenschaft, die als Vorschaubild in den Ansichten Karten und Kanban verwendet wird. Wenn nicht festgelegt, wird automatisch die erste passende Bild-Eigenschaft verwendet.",
35180
35479
  display_settings: "Anzeigeeinstellungen",
35181
35480
  default_row_size: "Standard-Zeilengröße",
35182
35481
  side_dialog_width: "Seitendialog-Breite",
@@ -35669,6 +35968,7 @@ const fr = {
35669
35968
  download: "Télécharger",
35670
35969
  large_number_of_documents: "Cette collection contient un grand nombre de documents ({{count}}).",
35671
35970
  include_undefined_values: "Inclure les valeurs non définies",
35971
+ export_apply_filter_sort: "N'exporter que les résultats correspondant au filtre/tri actuel",
35672
35972
  submit: "Soumettre",
35673
35973
  no_filterable_properties: "Aucune propriété filtrable disponible",
35674
35974
  apply_filters: "Appliquer les filtres",
@@ -35854,6 +36154,10 @@ const fr = {
35854
36154
  order_property_not_found: `La propriété "{{property}}" n'existe pas ou n'est pas une propriété numérique. Veuillez sélectionner une propriété valide ou effacer la sélection.`,
35855
36155
  no_number_properties: "Aucune propriété numérique trouvée. Ajoutez une propriété numérique pour activer le tri.",
35856
36156
  order_property_description: "Sélectionnez une propriété numérique pour conserver l'ordre des éléments",
36157
+ image_property: "Propriété d'image",
36158
+ image_property_not_found: `La propriété "{{property}}" n'existe pas ou n'est pas une propriété d'image. Veuillez sélectionner une propriété valide ou effacer la sélection.`,
36159
+ no_image_properties: "Aucune propriété d'image trouvée. Ajoutez une propriété de stockage ou d'URL d'image à utiliser comme miniature.",
36160
+ image_property_description: "Sélectionnez la propriété utilisée comme miniature dans les vues Cartes et Kanban. Si elle n'est pas définie, la première propriété d'image correspondante sera utilisée automatiquement.",
35857
36161
  display_settings: "Paramètres d'affichage",
35858
36162
  default_row_size: "Taille de ligne par défaut",
35859
36163
  side_dialog_width: "Largeur du dialogue latéral",
@@ -36346,6 +36650,7 @@ const it = {
36346
36650
  download: "Scarica",
36347
36651
  large_number_of_documents: "Questa collezione contiene un numero elevato di documenti ({{count}})",
36348
36652
  include_undefined_values: "Includi valori non definiti",
36653
+ export_apply_filter_sort: "Esporta solo i risultati che corrispondono al filtro/ordinamento attuale",
36349
36654
  submit: "Invia",
36350
36655
  no_filterable_properties: "Nessuna proprietà filtrabile disponibile",
36351
36656
  apply_filters: "Applica filtri",
@@ -36531,6 +36836,10 @@ const it = {
36531
36836
  order_property_not_found: 'La proprietà "{{property}}" non esiste o non è una proprietà numerica. Seleziona una proprietà valida o cancella la selezione.',
36532
36837
  no_number_properties: "Nessuna proprietà numerica trovata. Aggiungi una proprietà numerica per abilitare l'ordinamento.",
36533
36838
  order_property_description: "Seleziona una proprietà numerica per mantenere l'ordine degli elementi",
36839
+ image_property: "Proprietà immagine",
36840
+ image_property_not_found: 'La proprietà "{{property}}" non esiste o non è una proprietà immagine. Seleziona una proprietà valida o cancella la selezione.',
36841
+ no_image_properties: "Nessuna proprietà immagine trovata. Aggiungi una proprietà di archiviazione o URL immagine da usare come miniatura.",
36842
+ image_property_description: "Seleziona la proprietà utilizzata come miniatura nelle viste Schede e Kanban. Se non impostata, verrà utilizzata automaticamente la prima proprietà immagine corrispondente.",
36534
36843
  display_settings: "Impostazioni di visualizzazione",
36535
36844
  default_row_size: "Dimensione riga predefinita",
36536
36845
  side_dialog_width: "Larghezza del dialogo laterale",
@@ -37023,6 +37332,7 @@ const hi = {
37023
37332
  download: "डाउनलोड",
37024
37333
  large_number_of_documents: "इस संग्रह में बड़ी संख्या में दस्तावेज़ हैं ({{count}})।",
37025
37334
  include_undefined_values: "अपरिभाषित (undefined) मान शामिल करें",
37335
+ export_apply_filter_sort: "केवल वर्तमान फ़िल्टर/सॉर्ट से मेल खाने वाले परिणाम निर्यात करें",
37026
37336
  submit: "सबमिट करें",
37027
37337
  no_filterable_properties: "कोई फ़िल्टर करने योग्य गुण उपलब्ध नहीं हैं",
37028
37338
  apply_filters: "फ़िल्टर लागू करें",
@@ -37208,6 +37518,10 @@ const hi = {
37208
37518
  order_property_not_found: 'प्रॉपर्टी "{{property}}" मौजूद नहीं है या एक संख्या प्रॉपर्टी नहीं है। कृपया एक वैध प्रॉपर्टी चुनें या चयन साफ़ करें।',
37209
37519
  no_number_properties: "कोई संख्या प्रॉपर्टी नहीं मिली। क्रम सक्षम करने के लिए एक संख्या प्रॉपर्टी जोड़ें।",
37210
37520
  order_property_description: "आइटम का क्रम बनाए रखने के लिए एक संख्या प्रॉपर्टी चुनें",
37521
+ image_property: "इमेज प्रॉपर्टी",
37522
+ image_property_not_found: 'प्रॉपर्टी "{{property}}" मौजूद नहीं है या एक इमेज प्रॉपर्टी नहीं है। कृपया एक वैध प्रॉपर्टी चुनें या चयन साफ़ करें।',
37523
+ no_image_properties: "कोई इमेज प्रॉपर्टी नहीं मिली। थंबनेल के रूप में उपयोग करने के लिए एक स्टोरेज या URL इमेज प्रॉपर्टी जोड़ें।",
37524
+ image_property_description: "कार्ड्स और कानबन व्यू मोड में थंबनेल इमेज के रूप में उपयोग की जाने वाली प्रॉपर्टी चुनें। यदि सेट नहीं किया गया है, तो पहली मिलान वाली इमेज प्रॉपर्टी स्वचालित रूप से उपयोग की जाएगी।",
37211
37525
  display_settings: "प्रदर्शन सेटिंग्स",
37212
37526
  default_row_size: "डिफ़ॉल्ट पंक्ति आकार",
37213
37527
  side_dialog_width: "साइड डायलॉग चौड़ाई",
@@ -37700,6 +38014,7 @@ const pt = {
37700
38014
  download: "Descarregar",
37701
38015
  large_number_of_documents: "Esta coleção tem um grande número de documentos ({{count}}).",
37702
38016
  include_undefined_values: "Incluir valores indefinidos",
38017
+ export_apply_filter_sort: "Exportar apenas os resultados que correspondem ao filtro/ordenação atual",
37703
38018
  submit: "Submeter",
37704
38019
  no_filterable_properties: "Não há propriedades filtráveis disponíveis",
37705
38020
  apply_filters: "Aplicar filtros",
@@ -37887,6 +38202,10 @@ const pt = {
37887
38202
  order_property_not_found: 'A propriedade "{{property}}" não existe ou não é uma propriedade numérica. Selecione uma propriedade válida ou limpe a seleção.',
37888
38203
  no_number_properties: "Nenhuma propriedade numérica encontrada. Adicione uma propriedade numérica para habilitar a ordenação.",
37889
38204
  order_property_description: "Selecione uma propriedade numérica para manter a ordem dos itens",
38205
+ image_property: "Propriedade de imagem",
38206
+ image_property_not_found: 'A propriedade "{{property}}" não existe ou não é uma propriedade de imagem. Selecione uma propriedade válida ou limpe a seleção.',
38207
+ no_image_properties: "Nenhuma propriedade de imagem encontrada. Adicione uma propriedade de armazenamento ou URL de imagem para usar como miniatura.",
38208
+ image_property_description: "Selecione a propriedade usada como miniatura nas visualizações de Cartões e Kanban. Se não for definida, a primeira propriedade de imagem correspondente será usada automaticamente.",
37890
38209
  display_settings: "Configurações de exibição",
37891
38210
  default_row_size: "Tamanho de linha padrão",
37892
38211
  side_dialog_width: "Largura do diálogo lateral",
@@ -38379,6 +38698,7 @@ const pl = {
38379
38698
  download: "Pobierz",
38380
38699
  large_number_of_documents: "Ta kolekcja zawiera dużą liczbę dokumentów ({{count}}).",
38381
38700
  include_undefined_values: "Uwzględnij niezdefiniowane wartości",
38701
+ export_apply_filter_sort: "Eksportuj tylko wyniki zgodne z aktualnym filtrem/sortowaniem",
38382
38702
  submit: "Wyślij",
38383
38703
  no_filterable_properties: "Brak dostępnych właściwości do filtrowania",
38384
38704
  apply_filters: "Zastosuj filtry",
@@ -38566,6 +38886,10 @@ const pl = {
38566
38886
  order_property_not_found: "Właściwość „{{property}}” nie istnieje lub nie jest właściwością liczbową. Wybierz prawidłową właściwość lub wyczyść wybór.",
38567
38887
  no_number_properties: "Nie znaleziono właściwości liczbowych. Dodaj właściwość liczbową, aby włączyć sortowanie.",
38568
38888
  order_property_description: "Wybierz właściwość liczbową, aby zachować kolejność elementów",
38889
+ image_property: "Właściwość obrazu",
38890
+ image_property_not_found: "Właściwość „{{property}}” nie istnieje lub nie jest właściwością obrazu. Wybierz prawidłową właściwość lub wyczyść wybór.",
38891
+ no_image_properties: "Nie znaleziono właściwości obrazu. Dodaj właściwość przechowywania lub adresu URL obrazu, aby użyć jej jako miniatury.",
38892
+ image_property_description: "Wybierz właściwość używaną jako miniatura w widokach Karty i Kanban. Jeśli nie zostanie ustawiona, automatycznie zostanie użyta pierwsza pasująca właściwość obrazu.",
38569
38893
  display_settings: "Ustawienia wyświetlania",
38570
38894
  default_row_size: "Domyślny rozmiar wiersza",
38571
38895
  side_dialog_width: "Szerokość okna bocznego",
@@ -43537,6 +43861,7 @@ export {
43537
43861
  getEntityTitlePropertyKey,
43538
43862
  getFieldConfig,
43539
43863
  getFieldId,
43864
+ getFileExtensionFromUrl,
43540
43865
  getFormFieldKeys,
43541
43866
  getGeoPointCoordinates,
43542
43867
  getHashValue,
@@ -43547,6 +43872,7 @@ export {
43547
43872
  getLabelOrConfigFrom,
43548
43873
  getLastSegment,
43549
43874
  getLocalChangesBackup,
43875
+ getPreviewTypeFromUrl,
43550
43876
  getPropertiesWithPropertiesOrder,
43551
43877
  getPropertyInPath,
43552
43878
  getRandomId,
@@ -43556,6 +43882,7 @@ export {
43556
43882
  hydrateRegExp,
43557
43883
  iconSynonyms,
43558
43884
  iconsSearch,
43885
+ isAbsoluteHttpUrl,
43559
43886
  isDataTypeFilterable,
43560
43887
  isDefaultFieldConfigId,
43561
43888
  isEmptyObject,