@firecms/core 3.0.0-canary.279 → 3.0.0-canary.280

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 (46) hide show
  1. package/dist/components/UserDisplay.d.ts +7 -0
  2. package/dist/components/VirtualTable/fields/VirtualTableUserSelect.d.ts +12 -0
  3. package/dist/contexts/InternalUserManagementContext.d.ts +3 -0
  4. package/dist/core/FireCMS.d.ts +0 -1
  5. package/dist/core/field_configs.d.ts +1 -1
  6. package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +12 -0
  7. package/dist/hooks/index.d.ts +1 -0
  8. package/dist/hooks/useInternalUserManagementController.d.ts +12 -0
  9. package/dist/index.es.js +474 -84
  10. package/dist/index.es.js.map +1 -1
  11. package/dist/index.umd.js +473 -83
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/preview/components/UserPreview.d.ts +8 -0
  14. package/dist/preview/index.d.ts +1 -0
  15. package/dist/types/firecms.d.ts +15 -0
  16. package/dist/types/firecms_context.d.ts +16 -0
  17. package/dist/types/index.d.ts +1 -0
  18. package/dist/types/internal_user_management.d.ts +20 -0
  19. package/dist/types/plugins.d.ts +2 -0
  20. package/dist/types/properties.d.ts +9 -0
  21. package/dist/types/property_config.d.ts +1 -1
  22. package/dist/types/user.d.ts +1 -1
  23. package/package.json +5 -5
  24. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +12 -0
  25. package/src/components/UserDisplay.tsx +54 -0
  26. package/src/components/VirtualTable/fields/VirtualTableUserSelect.tsx +99 -0
  27. package/src/contexts/InternalUserManagementContext.tsx +4 -0
  28. package/src/core/FireCMS.tsx +22 -13
  29. package/src/core/field_configs.tsx +15 -1
  30. package/src/form/field_bindings/UserSelectFieldBinding.tsx +94 -0
  31. package/src/hooks/index.tsx +2 -0
  32. package/src/hooks/useFireCMSContext.tsx +6 -2
  33. package/src/hooks/useInternalUserManagementController.tsx +16 -0
  34. package/src/preview/PropertyPreview.tsx +8 -0
  35. package/src/preview/components/UserPreview.tsx +22 -0
  36. package/src/preview/index.ts +1 -0
  37. package/src/types/firecms.tsx +16 -0
  38. package/src/types/firecms_context.tsx +17 -0
  39. package/src/types/index.ts +1 -0
  40. package/src/types/internal_user_management.ts +24 -0
  41. package/src/types/plugins.tsx +3 -0
  42. package/src/types/properties.ts +10 -0
  43. package/src/types/property_config.tsx +1 -0
  44. package/src/types/user.ts +1 -1
  45. package/src/util/entities.ts +1 -1
  46. package/src/util/entity_cache.ts +2 -2
package/dist/index.es.js CHANGED
@@ -2,7 +2,7 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import * as React from "react";
4
4
  import React__default, { useRef, useEffect, useContext, useCallback, useMemo, useState, createElement, createRef, createContext, forwardRef, useLayoutEffect, useDeferredValue } from "react";
5
- import { getColorSchemeForSeed, CHIP_COLORS, FunctionsIcon, CircleIcon, iconKeys, coolIconKeys, Icon, Tooltip, ErrorIcon, Typography, IconButton, ContentCopyIcon, OpenInNewIcon, DescriptionIcon, cls, Skeleton, Chip, defaultBorderMixin, KeyboardTabIcon, Checkbox, Markdown, TextareaAutosize, focusedDisabled, MultiSelect, MultiSelectItem, Select, SelectItem, BooleanSwitch, DateTimeField, paperMixin, EditIcon, DoNotDisturbOnIcon, Menu, MenuItem, MoreVertIcon, CircularProgress, SearchBar, Badge, ArrowUpwardIcon, Popover, FilterListIcon, Button, CenteredView, AssignmentIcon, Label, CloseIcon, TextField, BooleanSwitchWithLabel, useOutsideAlerter, Dialog, DialogTitle, DialogContent, DialogActions, FileCopyIcon, DeleteIcon, AddIcon, StarIcon, Collapse, ExpandablePanel, ArrowForwardIcon, Card, cardMixin, cardClickableMixin, Container, LoadingButton, Alert, CheckIcon, NotesIcon, InfoIcon, fieldBackgroundMixin, RemoveIcon, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, ArrowDropDownIcon, FilterListOffIcon, SearchIcon, Avatar, DarkModeIcon, LightModeIcon, BrightnessMediumIcon, LogoutIcon, HandleIcon, KeyboardArrowUpIcon, KeyboardArrowDownIcon, debounce, Sheet, Tab, Tabs, CodeIcon, OpenInFullIcon, ViewStreamIcon, RepeatIcon, BallotIcon, ScheduleIcon, AddLinkIcon, LinkIcon, DriveFolderUploadIcon, UploadFileIcon, FormatListNumberedIcon, NumbersIcon, ListAltIcon, ListIcon, FlagIcon, MailIcon, HttpIcon, FormatQuoteIcon, SubjectIcon, ShortTextIcon, MenuIcon, ChevronLeftIcon } from "@firecms/ui";
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, Menu, MenuItem, MoreVertIcon, CircularProgress, SearchBar, Badge, ArrowUpwardIcon, Popover, FilterListIcon, Button, CenteredView, AssignmentIcon, Label, CloseIcon, TextField, BooleanSwitchWithLabel, useOutsideAlerter, Dialog, DialogTitle, DialogContent, DialogActions, FileCopyIcon, DeleteIcon, AddIcon, StarIcon, Collapse, ExpandablePanel, ArrowForwardIcon, Card, cardMixin, cardClickableMixin, Container, LoadingButton, Alert, CheckIcon, NotesIcon, InfoIcon, fieldBackgroundMixin, RemoveIcon, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, ArrowDropDownIcon, FilterListOffIcon, SearchIcon, Avatar, DarkModeIcon, LightModeIcon, BrightnessMediumIcon, LogoutIcon, HandleIcon, KeyboardArrowUpIcon, KeyboardArrowDownIcon, debounce, Sheet, Tab, Tabs, CodeIcon, OpenInFullIcon, ViewStreamIcon, RepeatIcon, BallotIcon, ScheduleIcon, AddLinkIcon, LinkIcon, DriveFolderUploadIcon, UploadFileIcon, FormatListNumberedIcon, NumbersIcon, PersonIcon, ListAltIcon, ListIcon, FlagIcon, MailIcon, HttpIcon, FormatQuoteIcon, SubjectIcon, ShortTextIcon, MenuIcon, ChevronLeftIcon } from "@firecms/ui";
6
6
  import { SnackbarProvider as SnackbarProvider$1, useSnackbar } from "notistack";
7
7
  import hash from "object-hash";
8
8
  import { getIn, useFormex, setIn, useCreateFormex, Formex, Field } from "@firecms/formex";
@@ -522,7 +522,7 @@ function sanitizeData(values, properties) {
522
522
  return result;
523
523
  }
524
524
  function getReferenceFrom(entity) {
525
- return new EntityReference(entity.id, entity.path);
525
+ return new EntityReference(entity.id, entity.path, entity.databaseId);
526
526
  }
527
527
  function traverseValuesProperties(inputValues, properties, operation) {
528
528
  const updatedValues = Object.entries(properties).map(([key, property]) => {
@@ -4073,6 +4073,10 @@ const AnalyticsContext = React__default.createContext({});
4073
4073
  const useAnalyticsController = () => {
4074
4074
  return useContext(AnalyticsContext);
4075
4075
  };
4076
+ const InternalUserManagementContext = React__default.createContext({});
4077
+ const useInternalUserManagementController = () => {
4078
+ return useContext(InternalUserManagementContext);
4079
+ };
4076
4080
  const useFireCMSContext = () => {
4077
4081
  const authController = useAuthController();
4078
4082
  const sideDialogsController = useSideDialogsController();
@@ -4085,6 +4089,7 @@ const useFireCMSContext = () => {
4085
4089
  const dialogsController = useDialogsController();
4086
4090
  const customizationController = useCustomizationController();
4087
4091
  const analyticsController = useAnalyticsController();
4092
+ const userManagement = useInternalUserManagementController();
4088
4093
  const fireCMSContextRef = React__default.useRef({
4089
4094
  authController,
4090
4095
  sideDialogsController,
@@ -4096,7 +4101,8 @@ const useFireCMSContext = () => {
4096
4101
  userConfigPersistence,
4097
4102
  dialogsController,
4098
4103
  customizationController,
4099
- analyticsController
4104
+ analyticsController,
4105
+ userManagement
4100
4106
  });
4101
4107
  useEffect(() => {
4102
4108
  fireCMSContextRef.current = {
@@ -4110,7 +4116,8 @@ const useFireCMSContext = () => {
4110
4116
  userConfigPersistence,
4111
4117
  dialogsController,
4112
4118
  customizationController,
4113
- analyticsController
4119
+ analyticsController,
4120
+ userManagement
4114
4121
  };
4115
4122
  }, [authController, dialogsController, navigation, sideDialogsController]);
4116
4123
  return fireCMSContextRef.current;
@@ -4171,7 +4178,7 @@ function useCollectionFetch(t0) {
4171
4178
  }
4172
4179
  setDataLoading(false);
4173
4180
  setDataLoadingError(void 0);
4174
- setData(entities.map(_temp$r));
4181
+ setData(entities.map(_temp$t));
4175
4182
  setNoMoreToLoad(!itemCount || entities.length < itemCount);
4176
4183
  };
4177
4184
  const onError = (error) => {
@@ -4204,7 +4211,7 @@ function useCollectionFetch(t0) {
4204
4211
  orderBy: sortByProperty,
4205
4212
  order: currentSort
4206
4213
  }).then(onEntitiesUpdate).catch(onError);
4207
- return _temp2$d;
4214
+ return _temp2$e;
4208
4215
  }
4209
4216
  };
4210
4217
  $[4] = collection;
@@ -4252,9 +4259,9 @@ function useCollectionFetch(t0) {
4252
4259
  }
4253
4260
  return t5;
4254
4261
  }
4255
- function _temp2$d() {
4262
+ function _temp2$e() {
4256
4263
  }
4257
- function _temp$r(e_0) {
4264
+ function _temp$t(e_0) {
4258
4265
  return {
4259
4266
  ...e_0
4260
4267
  };
@@ -4319,7 +4326,7 @@ function useEntityFetch(t0) {
4319
4326
  setEntity(CACHE[`${path}/${entityId}`]);
4320
4327
  setDataLoading(false);
4321
4328
  setDataLoadingError(void 0);
4322
- return _temp$q;
4329
+ return _temp$s;
4323
4330
  } else {
4324
4331
  if (entityId && path && collection) {
4325
4332
  if (dataSource.listenEntity) {
@@ -4338,7 +4345,7 @@ function useEntityFetch(t0) {
4338
4345
  databaseId,
4339
4346
  collection
4340
4347
  }).then(onEntityUpdate).catch(onError);
4341
- return _temp2$c;
4348
+ return _temp2$d;
4342
4349
  }
4343
4350
  } else {
4344
4351
  onEntityUpdate(void 0);
@@ -4385,9 +4392,9 @@ function useEntityFetch(t0) {
4385
4392
  }
4386
4393
  function _temp3$4() {
4387
4394
  }
4388
- function _temp2$c() {
4395
+ function _temp2$d() {
4389
4396
  }
4390
- function _temp$q() {
4397
+ function _temp$s() {
4391
4398
  }
4392
4399
  async function saveEntityWithCallbacks({
4393
4400
  collection,
@@ -5014,7 +5021,7 @@ function ImagePreview(t0) {
5014
5021
  }
5015
5022
  let t9;
5016
5023
  if ($[16] !== url) {
5017
- t9 = /* @__PURE__ */ jsx(Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsx(IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "smallest", onClick: _temp$p, children: t8 }) });
5024
+ t9 = /* @__PURE__ */ jsx(Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsx(IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "smallest", onClick: _temp$r, children: t8 }) });
5018
5025
  $[16] = url;
5019
5026
  $[17] = t9;
5020
5027
  } else {
@@ -5048,7 +5055,7 @@ function ImagePreview(t0) {
5048
5055
  }
5049
5056
  return t11;
5050
5057
  }
5051
- function _temp$p(e_0) {
5058
+ function _temp$r(e_0) {
5052
5059
  return e_0.stopPropagation();
5053
5060
  }
5054
5061
  function UrlComponentPreview(t0) {
@@ -5081,7 +5088,7 @@ function UrlComponentPreview(t0) {
5081
5088
  }
5082
5089
  let t3;
5083
5090
  if ($[2] !== url) {
5084
- t3 = /* @__PURE__ */ jsxs("a", { className: "flex gap-4 break-words items-center font-medium text-primary visited:text-primary dark:visited:text-primary dark:text-primary", href: url, rel: "noopener noreferrer", onMouseDown: _temp$o, target: "_blank", children: [
5091
+ t3 = /* @__PURE__ */ jsxs("a", { className: "flex gap-4 break-words items-center font-medium text-primary visited:text-primary dark:visited:text-primary dark:text-primary", href: url, rel: "noopener noreferrer", onMouseDown: _temp$q, target: "_blank", children: [
5085
5092
  t2,
5086
5093
  url
5087
5094
  ] });
@@ -5184,7 +5191,7 @@ function UrlComponentPreview(t0) {
5184
5191
  }
5185
5192
  let t7;
5186
5193
  if ($[24] !== t4 || $[25] !== t6 || $[26] !== url) {
5187
- t7 = /* @__PURE__ */ jsxs("a", { href: url, rel: "noopener noreferrer", target: "_blank", onClick: _temp2$b, className: "flex flex-col items-center justify-center", style: t4, children: [
5194
+ t7 = /* @__PURE__ */ jsxs("a", { href: url, rel: "noopener noreferrer", target: "_blank", onClick: _temp2$c, className: "flex flex-col items-center justify-center", style: t4, children: [
5188
5195
  t5,
5189
5196
  t6
5190
5197
  ] });
@@ -5209,10 +5216,10 @@ function UrlComponentPreview(t0) {
5209
5216
  }
5210
5217
  }
5211
5218
  }
5212
- function _temp2$b(e_0) {
5219
+ function _temp2$c(e_0) {
5213
5220
  return e_0.stopPropagation();
5214
5221
  }
5215
- function _temp$o(e) {
5222
+ function _temp$q(e) {
5216
5223
  e.preventDefault();
5217
5224
  }
5218
5225
  function VideoPreview(t0) {
@@ -5346,7 +5353,7 @@ function SkeletonPropertyComponent(t0) {
5346
5353
  if (Array.isArray(arrayProperty.of)) {
5347
5354
  let t1;
5348
5355
  if ($[6] !== arrayProperty.of) {
5349
- t1 = arrayProperty.of.map(_temp$n);
5356
+ t1 = arrayProperty.of.map(_temp$p);
5350
5357
  $[6] = arrayProperty.of;
5351
5358
  $[7] = t1;
5352
5359
  } else {
@@ -5484,7 +5491,7 @@ function SkeletonPropertyComponent(t0) {
5484
5491
  }
5485
5492
  return content || null;
5486
5493
  }
5487
- function _temp$n(p, i) {
5494
+ function _temp$p(p, i) {
5488
5495
  return renderGenericArrayCell(p, i);
5489
5496
  }
5490
5497
  function renderMap(property, size) {
@@ -6667,7 +6674,7 @@ function KeyValuePreview(t0) {
6667
6674
  }
6668
6675
  let t1;
6669
6676
  if ($[1] !== value) {
6670
- t1 = Object.entries(value).map(_temp$m);
6677
+ t1 = Object.entries(value).map(_temp$o);
6671
6678
  $[1] = value;
6672
6679
  $[2] = t1;
6673
6680
  } else {
@@ -6683,7 +6690,7 @@ function KeyValuePreview(t0) {
6683
6690
  }
6684
6691
  return t2;
6685
6692
  }
6686
- function _temp$m(t0) {
6693
+ function _temp$o(t0) {
6687
6694
  const [key, childValue] = t0;
6688
6695
  return /* @__PURE__ */ jsxs("div", { className: cls(defaultBorderMixin, "last:border-b-0 border-b"), children: [
6689
6696
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row pt-0.5 pb-0.5 gap-2", children: [
@@ -6816,6 +6823,120 @@ function NumberPropertyPreview(t0) {
6816
6823
  return t1;
6817
6824
  }
6818
6825
  }
6826
+ function UserDisplay(t0) {
6827
+ const $ = c(18);
6828
+ const {
6829
+ user
6830
+ } = t0;
6831
+ if (!user) {
6832
+ let t12;
6833
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
6834
+ t12 = /* @__PURE__ */ jsx("span", { className: "text-text-secondary dark:text-text-secondary-dark", children: "Select a user" });
6835
+ $[0] = t12;
6836
+ } else {
6837
+ t12 = $[0];
6838
+ }
6839
+ return t12;
6840
+ }
6841
+ let t1;
6842
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
6843
+ t1 = cls("inline-flex items-center gap-4 px-2 py-1 rounded-xl", "bg-surface-accent-100 dark:bg-surface-accent-800", "border", defaultBorderMixin);
6844
+ $[1] = t1;
6845
+ } else {
6846
+ t1 = $[1];
6847
+ }
6848
+ let t2;
6849
+ if ($[2] !== user.displayName || $[3] !== user.email || $[4] !== user.photoURL) {
6850
+ t2 = user.photoURL ? /* @__PURE__ */ jsx("img", { src: user.photoURL, alt: user.displayName || user.email || "User", className: cls("rounded-full object-cover", "w-6 h-6") }) : /* @__PURE__ */ jsx(AccountCircleIcon, { className: cls("text-text-secondary dark:text-text-secondary-dark", "w-6 h-6") });
6851
+ $[2] = user.displayName;
6852
+ $[3] = user.email;
6853
+ $[4] = user.photoURL;
6854
+ $[5] = t2;
6855
+ } else {
6856
+ t2 = $[5];
6857
+ }
6858
+ let t3;
6859
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
6860
+ t3 = cls("font-regular truncate", "text-sm");
6861
+ $[6] = t3;
6862
+ } else {
6863
+ t3 = $[6];
6864
+ }
6865
+ const t4 = user.displayName || user.email || "-";
6866
+ let t5;
6867
+ if ($[7] !== t4) {
6868
+ t5 = /* @__PURE__ */ jsx("span", { className: t3, children: t4 });
6869
+ $[7] = t4;
6870
+ $[8] = t5;
6871
+ } else {
6872
+ t5 = $[8];
6873
+ }
6874
+ let t6;
6875
+ if ($[9] !== user.displayName || $[10] !== user.email) {
6876
+ t6 = user.displayName && user.email && /* @__PURE__ */ jsx("span", { className: cls("text-text-secondary dark:text-text-secondary-dark truncate", "text-xs"), children: user.email });
6877
+ $[9] = user.displayName;
6878
+ $[10] = user.email;
6879
+ $[11] = t6;
6880
+ } else {
6881
+ t6 = $[11];
6882
+ }
6883
+ let t7;
6884
+ if ($[12] !== t5 || $[13] !== t6) {
6885
+ t7 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
6886
+ t5,
6887
+ t6
6888
+ ] });
6889
+ $[12] = t5;
6890
+ $[13] = t6;
6891
+ $[14] = t7;
6892
+ } else {
6893
+ t7 = $[14];
6894
+ }
6895
+ let t8;
6896
+ if ($[15] !== t2 || $[16] !== t7) {
6897
+ t8 = /* @__PURE__ */ jsxs("div", { className: t1, children: [
6898
+ t2,
6899
+ t7
6900
+ ] });
6901
+ $[15] = t2;
6902
+ $[16] = t7;
6903
+ $[17] = t8;
6904
+ } else {
6905
+ t8 = $[17];
6906
+ }
6907
+ return t8;
6908
+ }
6909
+ function UserPreview(t0) {
6910
+ const $ = c(5);
6911
+ const {
6912
+ value
6913
+ } = t0;
6914
+ const {
6915
+ getUser
6916
+ } = useInternalUserManagementController();
6917
+ if (!value) {
6918
+ return null;
6919
+ }
6920
+ let t1;
6921
+ if ($[0] !== getUser || $[1] !== value) {
6922
+ t1 = getUser(value);
6923
+ $[0] = getUser;
6924
+ $[1] = value;
6925
+ $[2] = t1;
6926
+ } else {
6927
+ t1 = $[2];
6928
+ }
6929
+ const user = t1;
6930
+ let t2;
6931
+ if ($[3] !== user) {
6932
+ t2 = /* @__PURE__ */ jsx(UserDisplay, { user });
6933
+ $[3] = user;
6934
+ $[4] = t2;
6935
+ } else {
6936
+ t2 = $[4];
6937
+ }
6938
+ return t2;
6939
+ }
6819
6940
  const PropertyPreview = React__default.memo(function PropertyPreview2(props) {
6820
6941
  const $ = c(31);
6821
6942
  const authController = useAuthController();
@@ -6916,21 +7037,25 @@ const PropertyPreview = React__default.memo(function PropertyPreview2(props) {
6916
7037
  }
6917
7038
  content = t02;
6918
7039
  } else {
6919
- if (stringProperty.reference) {
6920
- if (typeof stringProperty.reference.path === "string") {
6921
- content = /* @__PURE__ */ jsx(ReferencePreview, { disabled: !stringProperty.reference.path, previewProperties: stringProperty.reference.previewProperties, includeId: stringProperty.reference.includeId, includeEntityLink: stringProperty.reference.includeEntityLink, size: props.size, reference: new EntityReference(value, stringProperty.reference.path) });
6922
- } else {
6923
- let t02;
6924
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
6925
- t02 = /* @__PURE__ */ jsx(EmptyValue, {});
6926
- $[23] = t02;
7040
+ if (stringProperty.userSelect) {
7041
+ content = /* @__PURE__ */ jsx(UserPreview, { value, property: stringProperty, propertyKey, size: props.size });
7042
+ } else {
7043
+ if (stringProperty.reference) {
7044
+ if (typeof stringProperty.reference.path === "string") {
7045
+ content = /* @__PURE__ */ jsx(ReferencePreview, { disabled: !stringProperty.reference.path, previewProperties: stringProperty.reference.previewProperties, includeId: stringProperty.reference.includeId, includeEntityLink: stringProperty.reference.includeEntityLink, size: props.size, reference: new EntityReference(value, stringProperty.reference.path) });
6927
7046
  } else {
6928
- t02 = $[23];
7047
+ let t02;
7048
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
7049
+ t02 = /* @__PURE__ */ jsx(EmptyValue, {});
7050
+ $[23] = t02;
7051
+ } else {
7052
+ t02 = $[23];
7053
+ }
7054
+ content = t02;
6929
7055
  }
6930
- content = t02;
7056
+ } else {
7057
+ content = /* @__PURE__ */ jsx(StringPropertyPreview, { ...props, property: stringProperty, value });
6931
7058
  }
6932
- } else {
6933
- content = /* @__PURE__ */ jsx(StringPropertyPreview, { ...props, property: stringProperty, value });
6934
7059
  }
6935
7060
  }
6936
7061
  }
@@ -7451,7 +7576,7 @@ function VirtualTableSelect(props) {
7451
7576
  console.trace("onChange");
7452
7577
  if (valueType === "number") {
7453
7578
  if (multiple) {
7454
- const newValue = updatedValue.map(_temp$l);
7579
+ const newValue = updatedValue.map(_temp$n);
7455
7580
  updateValue(newValue);
7456
7581
  } else {
7457
7582
  updateValue(parseFloat(updatedValue));
@@ -7488,7 +7613,7 @@ function VirtualTableSelect(props) {
7488
7613
  const renderValue = t3;
7489
7614
  let t4;
7490
7615
  if ($[10] !== disabled || $[11] !== enumValues || $[12] !== internalValue || $[13] !== multiple || $[14] !== onChange || $[15] !== renderValue || $[16] !== small || $[17] !== validValue) {
7491
- t4 = multiple ? /* @__PURE__ */ jsx(MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue.map(_temp2$a) : [], onValueChange: onChange, children: enumValues?.map((enumConfig) => /* @__PURE__ */ jsx(MultiSelectItem, { value: String(enumConfig.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: enumConfig.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig.id)) }) : /* @__PURE__ */ jsx(Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue?.toString() : "", onValueChange: onChange, renderValue, children: enumValues?.map((enumConfig_0) => /* @__PURE__ */ jsx(SelectItem, { value: String(enumConfig_0.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: enumConfig_0.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig_0.id)) });
7616
+ t4 = multiple ? /* @__PURE__ */ jsx(MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue.map(_temp2$b) : [], onValueChange: onChange, children: enumValues?.map((enumConfig) => /* @__PURE__ */ jsx(MultiSelectItem, { value: String(enumConfig.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: enumConfig.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig.id)) }) : /* @__PURE__ */ jsx(Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue?.toString() : "", onValueChange: onChange, renderValue, children: enumValues?.map((enumConfig_0) => /* @__PURE__ */ jsx(SelectItem, { value: String(enumConfig_0.id), children: /* @__PURE__ */ jsx(EnumValuesChip, { enumKey: enumConfig_0.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig_0.id)) });
7492
7617
  $[10] = disabled;
7493
7618
  $[11] = enumValues;
7494
7619
  $[12] = internalValue;
@@ -7503,10 +7628,10 @@ function VirtualTableSelect(props) {
7503
7628
  }
7504
7629
  return t4;
7505
7630
  }
7506
- function _temp2$a(v_0) {
7631
+ function _temp2$b(v_0) {
7507
7632
  return v_0.toString();
7508
7633
  }
7509
- function _temp$l(v) {
7634
+ function _temp$n(v) {
7510
7635
  return parseFloat(v);
7511
7636
  }
7512
7637
  function VirtualTableNumberInput(props) {
@@ -7637,6 +7762,89 @@ function VirtualTableDateField(props) {
7637
7762
  }
7638
7763
  return t4;
7639
7764
  }
7765
+ function VirtualTableUserSelect(props) {
7766
+ const $ = c(15);
7767
+ const {
7768
+ internalValue,
7769
+ disabled,
7770
+ focused,
7771
+ updateValue,
7772
+ multiple
7773
+ } = props;
7774
+ const {
7775
+ users,
7776
+ getUser
7777
+ } = useInternalUserManagementController();
7778
+ const validValue = Array.isArray(internalValue) && multiple || !Array.isArray(internalValue) && !multiple;
7779
+ const ref = React__default.useRef(null);
7780
+ let t0;
7781
+ let t1;
7782
+ if ($[0] !== focused) {
7783
+ t0 = () => {
7784
+ if (ref.current && focused) {
7785
+ ref.current?.focus({
7786
+ preventScroll: true
7787
+ });
7788
+ }
7789
+ };
7790
+ t1 = [focused, ref];
7791
+ $[0] = focused;
7792
+ $[1] = t0;
7793
+ $[2] = t1;
7794
+ } else {
7795
+ t0 = $[1];
7796
+ t1 = $[2];
7797
+ }
7798
+ useEffect(t0, t1);
7799
+ let t2;
7800
+ if ($[3] !== updateValue) {
7801
+ t2 = (updatedValue) => {
7802
+ if (!updatedValue) {
7803
+ updateValue(null);
7804
+ } else {
7805
+ updateValue(updatedValue);
7806
+ }
7807
+ };
7808
+ $[3] = updateValue;
7809
+ $[4] = t2;
7810
+ } else {
7811
+ t2 = $[4];
7812
+ }
7813
+ const onChange = t2;
7814
+ let t3;
7815
+ if ($[5] !== getUser) {
7816
+ t3 = (userId) => {
7817
+ const user = getUser(userId);
7818
+ return /* @__PURE__ */ jsx(UserDisplay, { user });
7819
+ };
7820
+ $[5] = getUser;
7821
+ $[6] = t3;
7822
+ } else {
7823
+ t3 = $[6];
7824
+ }
7825
+ const renderValue = t3;
7826
+ let t4;
7827
+ if ($[7] !== disabled || $[8] !== internalValue || $[9] !== multiple || $[10] !== onChange || $[11] !== renderValue || $[12] !== users || $[13] !== validValue) {
7828
+ t4 = multiple ? /* @__PURE__ */ jsx(MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue : [], onValueChange: onChange, children: users?.map(_temp$m) }) : /* @__PURE__ */ jsx(Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue : "", onValueChange: onChange, renderValue, children: users?.map(_temp2$a) });
7829
+ $[7] = disabled;
7830
+ $[8] = internalValue;
7831
+ $[9] = multiple;
7832
+ $[10] = onChange;
7833
+ $[11] = renderValue;
7834
+ $[12] = users;
7835
+ $[13] = validValue;
7836
+ $[14] = t4;
7837
+ } else {
7838
+ t4 = $[14];
7839
+ }
7840
+ return t4;
7841
+ }
7842
+ function _temp2$a(user_1) {
7843
+ return /* @__PURE__ */ jsx(SelectItem, { value: user_1.uid, children: /* @__PURE__ */ jsx(UserDisplay, { user: user_1 }) }, user_1.uid);
7844
+ }
7845
+ function _temp$m(user_0) {
7846
+ return /* @__PURE__ */ jsx(MultiSelectItem, { value: user_0.uid, children: /* @__PURE__ */ jsx(UserDisplay, { user: user_0 }) }, user_0.uid);
7847
+ }
7640
7848
  class ErrorBoundary extends React__default.Component {
7641
7849
  constructor(props) {
7642
7850
  super(props);
@@ -8065,7 +8273,7 @@ function StorageUpload$1(t0) {
8065
8273
  const snackbarContext = useSnackbarController();
8066
8274
  let t1;
8067
8275
  if ($[0] !== storage.acceptedFiles) {
8068
- t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$k).reduce(_temp2$9, {}) : void 0;
8276
+ t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$l).reduce(_temp2$9, {}) : void 0;
8069
8277
  $[0] = storage.acceptedFiles;
8070
8278
  $[1] = t1;
8071
8279
  } else {
@@ -8294,7 +8502,7 @@ function _temp2$9(a, b) {
8294
8502
  ...b
8295
8503
  };
8296
8504
  }
8297
- function _temp$k(e) {
8505
+ function _temp$l(e) {
8298
8506
  return {
8299
8507
  [e]: []
8300
8508
  };
@@ -8401,7 +8609,7 @@ const TableReferenceFieldInternal = React__default.memo(function TableReferenceF
8401
8609
  let t1;
8402
8610
  if ($[2] !== updateValue) {
8403
8611
  t1 = (entities) => {
8404
- updateValue(entities.map(_temp$j));
8612
+ updateValue(entities.map(_temp$k));
8405
8613
  };
8406
8614
  $[2] = updateValue;
8407
8615
  $[3] = t1;
@@ -8562,7 +8770,7 @@ const TableReferenceFieldInternal = React__default.memo(function TableReferenceF
8562
8770
  }
8563
8771
  return t10;
8564
8772
  }, equal);
8565
- function _temp$j(e) {
8773
+ function _temp$k(e) {
8566
8774
  return getReferenceFrom(e);
8567
8775
  }
8568
8776
  function _temp2$8(ref) {
@@ -9424,6 +9632,9 @@ const PropertyTableCell = React__default.memo(function PropertyTableCell2({
9424
9632
  if (stringProperty_0.enumValues) {
9425
9633
  innerComponent = /* @__PURE__ */ jsx(VirtualTableSelect, { name: propertyKey, multiple: false, focused: selected, disabled, valueType: "string", small: getPreviewSizeFrom(size) !== "medium", enumValues: stringProperty_0.enumValues, error: validationError ?? error, internalValue, updateValue });
9426
9634
  fullHeight = true;
9635
+ } else if (stringProperty_0.userSelect) {
9636
+ innerComponent = /* @__PURE__ */ jsx(VirtualTableUserSelect, { name: propertyKey, multiple: false, focused: selected, disabled, small: getPreviewSizeFrom(size) !== "medium", error: validationError ?? error, internalValue, updateValue });
9637
+ fullHeight = true;
9427
9638
  } else if (stringProperty_0.markdown || !stringProperty_0.storage || !stringProperty_0.reference) {
9428
9639
  const multiline = Boolean(stringProperty_0.multiline) || Boolean(stringProperty_0.markdown);
9429
9640
  innerComponent = /* @__PURE__ */ jsx(VirtualTableInput, { error: validationError ?? error, disabled, multiline, focused: selected, value: internalValue, updateValue });
@@ -9488,7 +9699,8 @@ function customReplacer(key) {
9488
9699
  return {
9489
9700
  __type: "EntityReference",
9490
9701
  id: value.id,
9491
- path: value.path
9702
+ path: value.path,
9703
+ databaseId: value.databaseId
9492
9704
  };
9493
9705
  }
9494
9706
  if (value instanceof GeoPoint) {
@@ -9512,7 +9724,7 @@ function customReviver(key, value) {
9512
9724
  case "Date":
9513
9725
  return new Date(value.value);
9514
9726
  case "EntityReference":
9515
- return new EntityReference(value.id, value.path);
9727
+ return new EntityReference(value.id, value.path, value.databaseId);
9516
9728
  case "GeoPoint":
9517
9729
  return new GeoPoint(value.latitude, value.longitude);
9518
9730
  case "Vector":
@@ -9724,7 +9936,7 @@ function CollectionTableToolbar(t0) {
9724
9936
  }
9725
9937
  let t6;
9726
9938
  if ($[6] !== t3 || $[7] !== t4) {
9727
- t6 = /* @__PURE__ */ jsx(Tooltip, { title: "Table row size", side: "right", sideOffset: 4, children: /* @__PURE__ */ jsx(Select, { value: t3, className: "w-16 ml-2", size: "small", onValueChange: t4, renderValue: _temp$i, children: t5 }) });
9939
+ t6 = /* @__PURE__ */ jsx(Tooltip, { title: "Table row size", side: "right", sideOffset: 4, children: /* @__PURE__ */ jsx(Select, { value: t3, className: "w-16 ml-2", size: "small", onValueChange: t4, renderValue: _temp$j, children: t5 }) });
9728
9940
  $[6] = t3;
9729
9941
  $[7] = t4;
9730
9942
  $[8] = t6;
@@ -9811,7 +10023,7 @@ function CollectionTableToolbar(t0) {
9811
10023
  function _temp2$7(size_0) {
9812
10024
  return /* @__PURE__ */ jsx(SelectItem, { value: size_0, className: "w-12 font-medium text-center", children: size_0.toUpperCase() }, size_0);
9813
10025
  }
9814
- function _temp$i(v_0) {
10026
+ function _temp$j(v_0) {
9815
10027
  return /* @__PURE__ */ jsx("div", { className: "font-medium", children: v_0.toUpperCase() });
9816
10028
  }
9817
10029
  function getTableCellAlignment(property) {
@@ -10925,7 +11137,7 @@ const SafeLinkRenderer = (t0) => {
10925
11137
  let t1;
10926
11138
  if ($[0] !== text) {
10927
11139
  const urlRegex = /https?:\/\/[^\s]+/g;
10928
- t1 = text.replace(urlRegex, _temp$h);
11140
+ t1 = text.replace(urlRegex, _temp$i);
10929
11141
  $[0] = text;
10930
11142
  $[1] = t1;
10931
11143
  } else {
@@ -10944,7 +11156,7 @@ const SafeLinkRenderer = (t0) => {
10944
11156
  }
10945
11157
  return t2;
10946
11158
  };
10947
- function _temp$h(url) {
11159
+ function _temp$i(url) {
10948
11160
  return `<a href="${url}" class="underline" target="_blank">Link</a><br/>`;
10949
11161
  }
10950
11162
  const operationLabels$2 = {
@@ -11152,7 +11364,7 @@ function StringNumberFilterField(t0) {
11152
11364
  }
11153
11365
  let t6;
11154
11366
  if ($[16] !== operation || $[17] !== t4 || $[18] !== t5) {
11155
- t6 = /* @__PURE__ */ jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsx(Select, { value: operation, fullWidth: true, position: "item-aligned", onValueChange: t4, renderValue: _temp$g, children: t5 }) });
11367
+ t6 = /* @__PURE__ */ jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsx(Select, { value: operation, fullWidth: true, position: "item-aligned", onValueChange: t4, renderValue: _temp$h, children: t5 }) });
11156
11368
  $[16] = operation;
11157
11369
  $[17] = t4;
11158
11370
  $[18] = t5;
@@ -11276,7 +11488,7 @@ function _temp3$3(e_1) {
11276
11488
  function _temp2$6(op_1) {
11277
11489
  return /* @__PURE__ */ jsx(SelectItem, { value: op_1, children: operationLabels$1[op_1] }, op_1);
11278
11490
  }
11279
- function _temp$g(op_0) {
11491
+ function _temp$h(op_0) {
11280
11492
  return operationLabels$1[op_0];
11281
11493
  }
11282
11494
  function BooleanFilterField(t0) {
@@ -11415,7 +11627,7 @@ function DateTimeFilterField(t0) {
11415
11627
  }
11416
11628
  let t6;
11417
11629
  if ($[13] !== operation || $[14] !== t4 || $[15] !== t5) {
11418
- t6 = /* @__PURE__ */ jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "large", fullWidth: true, onValueChange: t4, renderValue: _temp$f, children: t5 }) });
11630
+ t6 = /* @__PURE__ */ jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsx(Select, { value: operation, size: "large", fullWidth: true, onValueChange: t4, renderValue: _temp$g, children: t5 }) });
11419
11631
  $[13] = operation;
11420
11632
  $[14] = t4;
11421
11633
  $[15] = t5;
@@ -11504,7 +11716,7 @@ function DateTimeFilterField(t0) {
11504
11716
  function _temp2$5(op_1) {
11505
11717
  return /* @__PURE__ */ jsx(SelectItem, { value: op_1, children: operationLabels[op_1] }, op_1);
11506
11718
  }
11507
- function _temp$f(op_0) {
11719
+ function _temp$g(op_0) {
11508
11720
  return operationLabels[op_0];
11509
11721
  }
11510
11722
  const SelectableTable = function SelectableTable2({
@@ -12208,7 +12420,7 @@ function useTableSearchHelper(t0) {
12208
12420
  const searchBlocked = t12;
12209
12421
  let t2;
12210
12422
  if ($[15] !== customizationController.plugins || $[16] !== dataSource?.initTextSearch) {
12211
- t2 = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$e);
12423
+ t2 = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$f);
12212
12424
  $[15] = customizationController.plugins;
12213
12425
  $[16] = dataSource?.initTextSearch;
12214
12426
  $[17] = t2;
@@ -12300,7 +12512,7 @@ function useTableSearchHelper(t0) {
12300
12512
  }
12301
12513
  return t1;
12302
12514
  }
12303
- function _temp$e(p_0) {
12515
+ function _temp$f(p_0) {
12304
12516
  return Boolean(p_0.collectionView?.onTextSearchClick);
12305
12517
  }
12306
12518
  function DeleteEntityDialog({
@@ -12893,7 +13105,7 @@ function FavouritesView(t0) {
12893
13105
  T0 = Collapse;
12894
13106
  t4 = favouriteCollections.length > 0;
12895
13107
  t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
12896
- t3 = favouriteCollections.map(_temp$d);
13108
+ t3 = favouriteCollections.map(_temp$e);
12897
13109
  $[2] = navigationController;
12898
13110
  $[3] = t1;
12899
13111
  $[4] = T0;
@@ -12927,7 +13139,7 @@ function FavouritesView(t0) {
12927
13139
  }
12928
13140
  return t6;
12929
13141
  }
12930
- function _temp$d(entry_0) {
13142
+ function _temp$e(entry_0) {
12931
13143
  return /* @__PURE__ */ jsx(NavigationChip, { entry: entry_0 }, entry_0.path);
12932
13144
  }
12933
13145
  const scrollsMap = {};
@@ -13144,7 +13356,7 @@ const NavigationCard = React__default.memo(function NavigationCard2(t0) {
13144
13356
  }
13145
13357
  let t4;
13146
13358
  if ($[4] !== actions) {
13147
- t4 = /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", onClick: _temp$c, children: actions });
13359
+ t4 = /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", onClick: _temp$d, children: actions });
13148
13360
  $[4] = actions;
13149
13361
  $[5] = t4;
13150
13362
  } else {
@@ -13231,7 +13443,7 @@ const NavigationCard = React__default.memo(function NavigationCard2(t0) {
13231
13443
  }
13232
13444
  return t12;
13233
13445
  });
13234
- function _temp$c(event) {
13446
+ function _temp$d(event) {
13235
13447
  event.preventDefault();
13236
13448
  event.stopPropagation();
13237
13449
  }
@@ -16105,7 +16317,7 @@ function StorageItemPreview(t0) {
16105
16317
  }
16106
16318
  let t5;
16107
16319
  if ($[14] !== placeholder) {
16108
- t5 = placeholder && /* @__PURE__ */ jsx("div", { onClick: _temp$b, className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ jsx(DescriptionIcon, { className: "text-surface-700 dark:text-surface-300" }) });
16320
+ t5 = placeholder && /* @__PURE__ */ jsx("div", { onClick: _temp$c, className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ jsx(DescriptionIcon, { className: "text-surface-700 dark:text-surface-300" }) });
16109
16321
  $[14] = placeholder;
16110
16322
  $[15] = t5;
16111
16323
  } else {
@@ -16128,7 +16340,7 @@ function StorageItemPreview(t0) {
16128
16340
  }
16129
16341
  return t6;
16130
16342
  }
16131
- function _temp$b(e) {
16343
+ function _temp$c(e) {
16132
16344
  return e.stopPropagation();
16133
16345
  }
16134
16346
  const dropZoneClasses = "box-border relative pt-[2px] items-center border border-transparent min-h-[254px] outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid";
@@ -16346,7 +16558,7 @@ function SortableStorageItem(t0) {
16346
16558
  t4 = $[7];
16347
16559
  }
16348
16560
  const style = t4;
16349
- const getImageSizeNumber = _temp$a;
16561
+ const getImageSizeNumber = _temp$b;
16350
16562
  let child;
16351
16563
  if (entry.storagePathOrDownloadUrl) {
16352
16564
  const t52 = `storage_preview_${entry.storagePathOrDownloadUrl}`;
@@ -16421,7 +16633,7 @@ function SortableStorageItem(t0) {
16421
16633
  }
16422
16634
  return t6;
16423
16635
  }
16424
- function _temp$a(previewSize) {
16636
+ function _temp$b(previewSize) {
16425
16637
  switch (previewSize) {
16426
16638
  case "small": {
16427
16639
  return 40;
@@ -17877,7 +18089,7 @@ function MapFieldBinding(t0) {
17877
18089
  } else {
17878
18090
  t42 = $[20];
17879
18091
  }
17880
- t3 = Object.entries(mapProperties).filter(_temp$9).map(t42);
18092
+ t3 = Object.entries(mapProperties).filter(_temp$a).map(t42);
17881
18093
  $[6] = autoFocus;
17882
18094
  $[7] = context;
17883
18095
  $[8] = disabled;
@@ -17947,7 +18159,7 @@ function MapFieldBinding(t0) {
17947
18159
  }
17948
18160
  return t10;
17949
18161
  }
17950
- function _temp$9(t0) {
18162
+ function _temp$a(t0) {
17951
18163
  const [, property_0] = t0;
17952
18164
  return !isHidden(property_0);
17953
18165
  }
@@ -19017,7 +19229,7 @@ function BlockEntry(t0) {
19017
19229
  const property = t4;
19018
19230
  let t5;
19019
19231
  if ($[9] !== properties) {
19020
- t5 = Object.entries(properties).map(_temp$8);
19232
+ t5 = Object.entries(properties).map(_temp$9);
19021
19233
  $[9] = properties;
19022
19234
  $[10] = t5;
19023
19235
  } else {
@@ -19108,7 +19320,7 @@ function BlockEntry(t0) {
19108
19320
  }
19109
19321
  return t11;
19110
19322
  }
19111
- function _temp$8(t0) {
19323
+ function _temp$9(t0) {
19112
19324
  const [key, property_0] = t0;
19113
19325
  return {
19114
19326
  id: key,
@@ -20765,7 +20977,7 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
20765
20977
  }
20766
20978
  let t7;
20767
20979
  if ($[18] !== breadcrumbs.breadcrumbs) {
20768
- t7 = (breadcrumbs.breadcrumbs ?? []).length > 0 && /* @__PURE__ */ jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row gap-2", children: breadcrumbs.breadcrumbs.map(_temp$7) }) });
20980
+ t7 = (breadcrumbs.breadcrumbs ?? []).length > 0 && /* @__PURE__ */ jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row gap-2", children: breadcrumbs.breadcrumbs.map(_temp$8) }) });
20769
20981
  $[18] = breadcrumbs.breadcrumbs;
20770
20982
  $[19] = t7;
20771
20983
  } else {
@@ -20877,7 +21089,7 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
20877
21089
  }
20878
21090
  return t14;
20879
21091
  };
20880
- function _temp$7(breadcrumb, index) {
21092
+ function _temp$8(breadcrumb, index) {
20881
21093
  return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
20882
21094
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "/" }),
20883
21095
  /* @__PURE__ */ jsx(Link, { className: "visited:text-inherit visited:dark:text-inherit block", to: breadcrumb.url, children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: breadcrumb.title }) }, index)
@@ -21311,7 +21523,7 @@ function SearchIconsView(t0) {
21311
21523
  } else {
21312
21524
  const searchResult = iconsSearch.search(value);
21313
21525
  const limited = searchResult.slice(0, 50);
21314
- setKeys(limited.map(_temp$6));
21526
+ setKeys(limited.map(_temp$7));
21315
21527
  }
21316
21528
  }, UPDATE_SEARCH_INDEX_WAIT_MS);
21317
21529
  $[0] = t3;
@@ -21378,7 +21590,7 @@ function SearchIconsView(t0) {
21378
21590
  }
21379
21591
  return t8;
21380
21592
  }
21381
- function _temp$6(e) {
21593
+ function _temp$7(e) {
21382
21594
  return e.item.key;
21383
21595
  }
21384
21596
  function FieldCaption(t0) {
@@ -22004,7 +22216,7 @@ function useBuildLocalConfigurationPersistence() {
22004
22216
  t0 = $[0];
22005
22217
  }
22006
22218
  const configCache = useRef(t0);
22007
- const getCollectionFromStorage = _temp$5;
22219
+ const getCollectionFromStorage = _temp$6;
22008
22220
  let t1;
22009
22221
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
22010
22222
  t1 = (path) => {
@@ -22127,7 +22339,7 @@ function useBuildLocalConfigurationPersistence() {
22127
22339
  }
22128
22340
  return t11;
22129
22341
  }
22130
- function _temp$5(storageKey) {
22342
+ function _temp$6(storageKey) {
22131
22343
  const item = localStorage.getItem(storageKey);
22132
22344
  return item ? JSON.parse(item) : {};
22133
22345
  }
@@ -23462,7 +23674,7 @@ function useBuildSideDialogsController() {
23462
23674
  t3 = () => {
23463
23675
  const state = location.state;
23464
23676
  const panelKeys = state?.panels ?? [];
23465
- const newPanels_0 = panelKeys.map((key) => routesStore.current[key]).filter(_temp$4);
23677
+ const newPanels_0 = panelKeys.map((key) => routesStore.current[key]).filter(_temp$5);
23466
23678
  if (!equal(sidePanelsRef.current.map(_temp2$3), newPanels_0.map(_temp3$1))) {
23467
23679
  updateSidePanels(newPanels_0);
23468
23680
  }
@@ -23610,7 +23822,7 @@ function _temp3$1(p_1) {
23610
23822
  function _temp2$3(p_0) {
23611
23823
  return p_0.key;
23612
23824
  }
23613
- function _temp$4(p) {
23825
+ function _temp$5(p) {
23614
23826
  return Boolean(p);
23615
23827
  }
23616
23828
  function useBuildDataSource({
@@ -23905,7 +24117,7 @@ function useProjectLog(t0) {
23905
24117
  const dataSourceKey = dataSourceDelegate.key;
23906
24118
  let t1;
23907
24119
  if ($[0] !== plugins) {
23908
- t1 = plugins?.map(_temp$3);
24120
+ t1 = plugins?.map(_temp$4);
23909
24121
  $[0] = plugins;
23910
24122
  $[1] = t1;
23911
24123
  } else {
@@ -23941,7 +24153,7 @@ function useProjectLog(t0) {
23941
24153
  useEffect(t2, t3);
23942
24154
  return accessResponse;
23943
24155
  }
23944
- function _temp$3(plugin) {
24156
+ function _temp$4(plugin) {
23945
24157
  return plugin.key;
23946
24158
  }
23947
24159
  function FireCMS(props) {
@@ -23954,22 +24166,27 @@ function FireCMS(props) {
23954
24166
  authController,
23955
24167
  storageSource,
23956
24168
  dataSourceDelegate,
23957
- plugins: pluginsProp,
24169
+ plugins: _pluginsProp,
23958
24170
  onAnalyticsEvent,
23959
24171
  propertyConfigs,
23960
24172
  entityViews,
23961
24173
  entityActions,
23962
24174
  components,
23963
24175
  navigationController,
23964
- apiKey
24176
+ apiKey,
24177
+ userManagement: _userManagement
23965
24178
  } = props;
23966
- if (pluginsProp) {
24179
+ if (_pluginsProp) {
23967
24180
  console.warn("The `plugins` prop is deprecated in the FireCMS component. You should pass your plugins to `useBuildNavigationController` instead.");
23968
24181
  }
23969
- const plugins = navigationController.plugins ?? pluginsProp;
24182
+ const plugins = navigationController.plugins ?? _pluginsProp;
24183
+ const userManagement = plugins?.find((p) => p.userManagement)?.userManagement ?? _userManagement ?? {
24184
+ users: [],
24185
+ getUser: (uid) => null
24186
+ };
23970
24187
  const sideDialogsController = useBuildSideDialogsController();
23971
24188
  const sideEntityController = useBuildSideEntityController(navigationController, sideDialogsController, authController);
23972
- const pluginsLoading = plugins?.some((p) => p.loading) ?? false;
24189
+ const pluginsLoading = plugins?.some((p_0) => p_0.loading) ?? false;
23973
24190
  const loading = authController.initialLoading || navigationController.loading || pluginsLoading;
23974
24191
  const customizationController = {
23975
24192
  dateTimeFormat,
@@ -24016,7 +24233,7 @@ function FireCMS(props) {
24016
24233
  accessResponse?.message && /* @__PURE__ */ jsx(Typography, { children: accessResponse?.message })
24017
24234
  ] });
24018
24235
  }
24019
- return /* @__PURE__ */ jsx(AnalyticsContext.Provider, { value: analyticsController, children: /* @__PURE__ */ jsx(CustomizationControllerContext.Provider, { value: customizationController, children: /* @__PURE__ */ jsx(UserConfigurationPersistenceContext.Provider, { value: userConfigPersistence, children: /* @__PURE__ */ jsx(StorageSourceContext.Provider, { value: storageSource, children: /* @__PURE__ */ jsx(DataSourceContext.Provider, { value: dataSource, children: /* @__PURE__ */ jsx(AuthControllerContext.Provider, { value: authController, children: /* @__PURE__ */ jsx(SideDialogsControllerContext.Provider, { value: sideDialogsController, children: /* @__PURE__ */ jsx(SideEntityControllerContext.Provider, { value: sideEntityController, children: /* @__PURE__ */ jsx(NavigationContext.Provider, { value: navigationController, children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(BreadcrumbsProvider, { children: /* @__PURE__ */ jsx(FireCMSInternal, { loading, children }) }) }) }) }) }) }) }) }) }) }) });
24236
+ return /* @__PURE__ */ jsx(AnalyticsContext.Provider, { value: analyticsController, children: /* @__PURE__ */ jsx(CustomizationControllerContext.Provider, { value: customizationController, children: /* @__PURE__ */ jsx(UserConfigurationPersistenceContext.Provider, { value: userConfigPersistence, children: /* @__PURE__ */ jsx(StorageSourceContext.Provider, { value: storageSource, children: /* @__PURE__ */ jsx(DataSourceContext.Provider, { value: dataSource, children: /* @__PURE__ */ jsx(AuthControllerContext.Provider, { value: authController, children: /* @__PURE__ */ jsx(SideDialogsControllerContext.Provider, { value: sideDialogsController, children: /* @__PURE__ */ jsx(SideEntityControllerContext.Provider, { value: sideEntityController, children: /* @__PURE__ */ jsx(NavigationContext.Provider, { value: navigationController, children: /* @__PURE__ */ jsx(InternalUserManagementContext.Provider, { value: userManagement, children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(BreadcrumbsProvider, { children: /* @__PURE__ */ jsx(FireCMSInternal, { loading, children }) }) }) }) }) }) }) }) }) }) }) }) });
24020
24237
  }
24021
24238
  function FireCMSInternal(t0) {
24022
24239
  const $ = c(7);
@@ -24186,7 +24403,7 @@ function DefaultDrawer(t0) {
24186
24403
  } = navigation.topLevelNavigation;
24187
24404
  let t1;
24188
24405
  if ($[0] !== adminMenuOpen || $[1] !== analyticsController || $[2] !== className || $[3] !== closeDrawer || $[4] !== drawerOpen || $[5] !== groups || $[6] !== largeLayout || $[7] !== logo || $[8] !== navigate || $[9] !== navigationEntries || $[10] !== style || $[11] !== tooltipsOpen) {
24189
- const adminViews = navigationEntries.filter(_temp$2) ?? [];
24406
+ const adminViews = navigationEntries.filter(_temp$3) ?? [];
24190
24407
  let t2;
24191
24408
  let t3;
24192
24409
  let t4;
@@ -24339,7 +24556,7 @@ function DefaultDrawer(t0) {
24339
24556
  function _temp2$2(g) {
24340
24557
  return g !== "Admin";
24341
24558
  }
24342
- function _temp$2(e) {
24559
+ function _temp$3(e) {
24343
24560
  return e.type === "admin";
24344
24561
  }
24345
24562
  function DrawerLogo(t0) {
@@ -24399,6 +24616,165 @@ function DrawerLogo(t0) {
24399
24616
  }
24400
24617
  return t6;
24401
24618
  }
24619
+ function UserSelectFieldBinding(t0) {
24620
+ const $ = c(43);
24621
+ const {
24622
+ propertyKey,
24623
+ value,
24624
+ setValue,
24625
+ error,
24626
+ showError,
24627
+ disabled,
24628
+ property,
24629
+ includeDescription,
24630
+ size: t1
24631
+ } = t0;
24632
+ const size = t1 === void 0 ? "large" : t1;
24633
+ const {
24634
+ users,
24635
+ getUser
24636
+ } = useInternalUserManagementController();
24637
+ let t2;
24638
+ if ($[0] !== setValue) {
24639
+ t2 = (e) => {
24640
+ e.stopPropagation();
24641
+ e.preventDefault();
24642
+ setValue(null);
24643
+ };
24644
+ $[0] = setValue;
24645
+ $[1] = t2;
24646
+ } else {
24647
+ t2 = $[1];
24648
+ }
24649
+ const handleClearClick = t2;
24650
+ let t3;
24651
+ if ($[2] !== value) {
24652
+ t3 = value !== void 0 && value != null ? value.toString() : "";
24653
+ $[2] = value;
24654
+ $[3] = t3;
24655
+ } else {
24656
+ t3 = $[3];
24657
+ }
24658
+ let t4;
24659
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
24660
+ t4 = cls("w-full");
24661
+ $[4] = t4;
24662
+ } else {
24663
+ t4 = $[4];
24664
+ }
24665
+ let t5;
24666
+ if ($[5] !== property) {
24667
+ t5 = getIconForProperty(property, "small");
24668
+ $[5] = property;
24669
+ $[6] = t5;
24670
+ } else {
24671
+ t5 = $[6];
24672
+ }
24673
+ const t6 = property.validation?.required;
24674
+ let t7;
24675
+ if ($[7] !== property.name || $[8] !== t5 || $[9] !== t6) {
24676
+ t7 = /* @__PURE__ */ jsx(LabelWithIcon, { icon: t5, required: t6, title: property.name, className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5 my-0" });
24677
+ $[7] = property.name;
24678
+ $[8] = t5;
24679
+ $[9] = t6;
24680
+ $[10] = t7;
24681
+ } else {
24682
+ t7 = $[10];
24683
+ }
24684
+ let t8;
24685
+ if ($[11] !== propertyKey || $[12] !== t7) {
24686
+ t8 = /* @__PURE__ */ jsx(PropertyIdCopyTooltip, { propertyKey, children: t7 });
24687
+ $[11] = propertyKey;
24688
+ $[12] = t7;
24689
+ $[13] = t8;
24690
+ } else {
24691
+ t8 = $[13];
24692
+ }
24693
+ let t9;
24694
+ if ($[14] !== disabled || $[15] !== handleClearClick || $[16] !== property.clearable || $[17] !== value) {
24695
+ t9 = property.clearable && !disabled && value && /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: handleClearClick, children: /* @__PURE__ */ jsx(CloseIcon, { size: "small" }) });
24696
+ $[14] = disabled;
24697
+ $[15] = handleClearClick;
24698
+ $[16] = property.clearable;
24699
+ $[17] = value;
24700
+ $[18] = t9;
24701
+ } else {
24702
+ t9 = $[18];
24703
+ }
24704
+ let t10;
24705
+ if ($[19] !== setValue) {
24706
+ t10 = (updatedValue) => {
24707
+ const newValue = updatedValue || null;
24708
+ return setValue(newValue);
24709
+ };
24710
+ $[19] = setValue;
24711
+ $[20] = t10;
24712
+ } else {
24713
+ t10 = $[20];
24714
+ }
24715
+ let t11;
24716
+ if ($[21] !== getUser) {
24717
+ t11 = (userId) => {
24718
+ const user = getUser(userId);
24719
+ return /* @__PURE__ */ jsx(UserDisplay, { user });
24720
+ };
24721
+ $[21] = getUser;
24722
+ $[22] = t11;
24723
+ } else {
24724
+ t11 = $[22];
24725
+ }
24726
+ let t12;
24727
+ if ($[23] !== users) {
24728
+ t12 = users && users.map(_temp$2);
24729
+ $[23] = users;
24730
+ $[24] = t12;
24731
+ } else {
24732
+ t12 = $[24];
24733
+ }
24734
+ let t13;
24735
+ if ($[25] !== disabled || $[26] !== size || $[27] !== t10 || $[28] !== t11 || $[29] !== t12 || $[30] !== t3 || $[31] !== t8 || $[32] !== t9) {
24736
+ t13 = /* @__PURE__ */ jsx(Select, { value: t3, disabled, size, fullWidth: true, position: "item-aligned", inputClassName: t4, label: t8, endAdornment: t9, onValueChange: t10, renderValue: t11, children: t12 });
24737
+ $[25] = disabled;
24738
+ $[26] = size;
24739
+ $[27] = t10;
24740
+ $[28] = t11;
24741
+ $[29] = t12;
24742
+ $[30] = t3;
24743
+ $[31] = t8;
24744
+ $[32] = t9;
24745
+ $[33] = t13;
24746
+ } else {
24747
+ t13 = $[33];
24748
+ }
24749
+ let t14;
24750
+ if ($[34] !== disabled || $[35] !== error || $[36] !== includeDescription || $[37] !== property || $[38] !== showError) {
24751
+ t14 = /* @__PURE__ */ jsx(FieldHelperText, { includeDescription, showError, error, disabled, property });
24752
+ $[34] = disabled;
24753
+ $[35] = error;
24754
+ $[36] = includeDescription;
24755
+ $[37] = property;
24756
+ $[38] = showError;
24757
+ $[39] = t14;
24758
+ } else {
24759
+ t14 = $[39];
24760
+ }
24761
+ let t15;
24762
+ if ($[40] !== t13 || $[41] !== t14) {
24763
+ t15 = /* @__PURE__ */ jsxs(Fragment, { children: [
24764
+ t13,
24765
+ t14
24766
+ ] });
24767
+ $[40] = t13;
24768
+ $[41] = t14;
24769
+ $[42] = t15;
24770
+ } else {
24771
+ t15 = $[42];
24772
+ }
24773
+ return t15;
24774
+ }
24775
+ function _temp$2(user_0) {
24776
+ return /* @__PURE__ */ jsx(SelectItem, { value: user_0.uid, children: /* @__PURE__ */ jsx(UserDisplay, { user: user_0 }) }, user_0.uid);
24777
+ }
24402
24778
  function isDefaultFieldConfigId(id) {
24403
24779
  return Object.keys(DEFAULT_FIELD_CONFIGS).includes(id);
24404
24780
  }
@@ -24500,6 +24876,16 @@ const DEFAULT_FIELD_CONFIGS = {
24500
24876
  Field: MultiSelectFieldBinding
24501
24877
  }
24502
24878
  },
24879
+ user_select: {
24880
+ key: "user_select",
24881
+ name: "User select",
24882
+ description: "Select a user from the user management system. Store the user ID.",
24883
+ Icon: PersonIcon,
24884
+ property: {
24885
+ dataType: "string",
24886
+ Field: UserSelectFieldBinding
24887
+ }
24888
+ },
24503
24889
  number_input: {
24504
24890
  key: "number_input",
24505
24891
  name: "Number input",
@@ -24714,6 +25100,8 @@ function getDefaultFieldId(property) {
24714
25100
  return "email";
24715
25101
  } else if (property.enumValues) {
24716
25102
  return "select";
25103
+ } else if (property.userSelect) {
25104
+ return "user_select";
24717
25105
  } else if (property.reference) {
24718
25106
  return "reference_as_string";
24719
25107
  } else {
@@ -25753,6 +26141,7 @@ export {
25753
26141
  SwitchFieldBinding,
25754
26142
  TextFieldBinding,
25755
26143
  UrlComponentPreview,
26144
+ UserPreview,
25756
26145
  Vector,
25757
26146
  VirtualTable,
25758
26147
  addInitialSlash,
@@ -25898,6 +26287,7 @@ export {
25898
26287
  useDialogsController,
25899
26288
  useEntityFetch,
25900
26289
  useFireCMSContext,
26290
+ useInternalUserManagementController,
25901
26291
  useLargeLayout,
25902
26292
  useModeController,
25903
26293
  useNavigationController,