@firecms/core 3.0.0-canary.179 → 3.0.0-canary.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -11699,7 +11699,6 @@ function EntityEditViewInner({
11699
11699
  }
11700
11700
  }, [authController, usedEntity, status]);
11701
11701
  const readOnly = !canEdit;
11702
- console.log("readOnly", readOnly);
11703
11702
  const onPreSaveHookError = useCallback((e) => {
11704
11703
  setSaving(false);
11705
11704
  snackbarController.open({
@@ -18208,7 +18207,7 @@ const SwitchFieldBinding = function SwitchFieldBinding2(t0) {
18208
18207
  return t11;
18209
18208
  };
18210
18209
  function DateTimeFieldBinding(t0) {
18211
- const $ = c(33);
18210
+ const $ = c(34);
18212
18211
  const {
18213
18212
  propertyKey,
18214
18213
  value,
@@ -18270,51 +18269,52 @@ function DateTimeFieldBinding(t0) {
18270
18269
  t8 = $[12];
18271
18270
  }
18272
18271
  let t9;
18273
- if ($[13] !== internalValue || $[14] !== locale || $[15] !== property.clearable || $[16] !== property.mode || $[17] !== showError || $[18] !== t2 || $[19] !== t8) {
18274
- t9 = /* @__PURE__ */ jsx(DateTimeField, { value: internalValue, onChange: t2, size: "large", mode: t3, clearable: t4, locale, error: showError, label: t8 });
18275
- $[13] = internalValue;
18276
- $[14] = locale;
18277
- $[15] = property.clearable;
18278
- $[16] = property.mode;
18279
- $[17] = showError;
18280
- $[18] = t2;
18281
- $[19] = t8;
18282
- $[20] = t9;
18272
+ if ($[13] !== disabled || $[14] !== internalValue || $[15] !== locale || $[16] !== property.clearable || $[17] !== property.mode || $[18] !== showError || $[19] !== t2 || $[20] !== t8) {
18273
+ t9 = /* @__PURE__ */ jsx(DateTimeField, { value: internalValue, onChange: t2, size: "large", mode: t3, clearable: t4, locale, error: showError, disabled, label: t8 });
18274
+ $[13] = disabled;
18275
+ $[14] = internalValue;
18276
+ $[15] = locale;
18277
+ $[16] = property.clearable;
18278
+ $[17] = property.mode;
18279
+ $[18] = showError;
18280
+ $[19] = t2;
18281
+ $[20] = t8;
18282
+ $[21] = t9;
18283
18283
  } else {
18284
- t9 = $[20];
18284
+ t9 = $[21];
18285
18285
  }
18286
18286
  let t10;
18287
- if ($[21] !== propertyKey || $[22] !== t9) {
18287
+ if ($[22] !== propertyKey || $[23] !== t9) {
18288
18288
  t10 = /* @__PURE__ */ jsx(PropertyIdCopyTooltip, { propertyKey, children: t9 });
18289
- $[21] = propertyKey;
18290
- $[22] = t9;
18291
- $[23] = t10;
18289
+ $[22] = propertyKey;
18290
+ $[23] = t9;
18291
+ $[24] = t10;
18292
18292
  } else {
18293
- t10 = $[23];
18293
+ t10 = $[24];
18294
18294
  }
18295
18295
  let t11;
18296
- if ($[24] !== disabled || $[25] !== error || $[26] !== includeDescription || $[27] !== property || $[28] !== showError) {
18296
+ if ($[25] !== disabled || $[26] !== error || $[27] !== includeDescription || $[28] !== property || $[29] !== showError) {
18297
18297
  t11 = /* @__PURE__ */ jsx(FieldHelperText, { includeDescription, showError, error, disabled, property });
18298
- $[24] = disabled;
18299
- $[25] = error;
18300
- $[26] = includeDescription;
18301
- $[27] = property;
18302
- $[28] = showError;
18303
- $[29] = t11;
18298
+ $[25] = disabled;
18299
+ $[26] = error;
18300
+ $[27] = includeDescription;
18301
+ $[28] = property;
18302
+ $[29] = showError;
18303
+ $[30] = t11;
18304
18304
  } else {
18305
- t11 = $[29];
18305
+ t11 = $[30];
18306
18306
  }
18307
18307
  let t12;
18308
- if ($[30] !== t10 || $[31] !== t11) {
18308
+ if ($[31] !== t10 || $[32] !== t11) {
18309
18309
  t12 = /* @__PURE__ */ jsxs(Fragment, { children: [
18310
18310
  t10,
18311
18311
  t11
18312
18312
  ] });
18313
- $[30] = t10;
18314
- $[31] = t11;
18315
- $[32] = t12;
18313
+ $[31] = t10;
18314
+ $[32] = t11;
18315
+ $[33] = t12;
18316
18316
  } else {
18317
- t12 = $[32];
18317
+ t12 = $[33];
18318
18318
  }
18319
18319
  return t12;
18320
18320
  }
@@ -18723,7 +18723,7 @@ function useWrappedComponent({
18723
18723
  return wrapperRef.current;
18724
18724
  }
18725
18725
  function MapFieldBinding(t0) {
18726
- const $ = c(40);
18726
+ const $ = c(43);
18727
18727
  const {
18728
18728
  propertyKey,
18729
18729
  value,
@@ -18770,12 +18770,21 @@ function MapFieldBinding(t0) {
18770
18770
  } else {
18771
18771
  mapProperties = property.properties;
18772
18772
  }
18773
- let t1;
18774
- if ($[4] !== autoFocus || $[5] !== context || $[6] !== disabled || $[7] !== includeDescription || $[8] !== mapProperties || $[9] !== onPropertyChange || $[10] !== propertyKey || $[11] !== underlyingValueHasChanged) {
18775
- let t22;
18776
- if ($[13] !== autoFocus || $[14] !== context || $[15] !== disabled || $[16] !== includeDescription || $[17] !== onPropertyChange || $[18] !== propertyKey || $[19] !== underlyingValueHasChanged) {
18777
- t22 = (t32, index) => {
18778
- const [entryKey, childProperty] = t32;
18773
+ const t1 = minimalistView && property.widthPercentage !== void 0 ? "mt-8" : void 0;
18774
+ let t2;
18775
+ if ($[4] !== t1) {
18776
+ t2 = cls("py-1 flex flex-col space-y-2", t1);
18777
+ $[4] = t1;
18778
+ $[5] = t2;
18779
+ } else {
18780
+ t2 = $[5];
18781
+ }
18782
+ let t3;
18783
+ if ($[6] !== autoFocus || $[7] !== context || $[8] !== disabled || $[9] !== includeDescription || $[10] !== mapProperties || $[11] !== onPropertyChange || $[12] !== propertyKey || $[13] !== underlyingValueHasChanged) {
18784
+ let t42;
18785
+ if ($[15] !== autoFocus || $[16] !== context || $[17] !== disabled || $[18] !== includeDescription || $[19] !== onPropertyChange || $[20] !== propertyKey || $[21] !== underlyingValueHasChanged) {
18786
+ t42 = (t52, index) => {
18787
+ const [entryKey, childProperty] = t52;
18779
18788
  const thisDisabled = isReadOnly(childProperty) || Boolean(childProperty.disabled);
18780
18789
  const fieldBindingProps = {
18781
18790
  propertyKey: `${propertyKey}.${entryKey}`,
@@ -18797,86 +18806,87 @@ function MapFieldBinding(t0) {
18797
18806
  };
18798
18807
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyFieldBinding, { ...fieldBindingProps }) }) }, `map-${propertyKey}-${index}`);
18799
18808
  };
18800
- $[13] = autoFocus;
18801
- $[14] = context;
18802
- $[15] = disabled;
18803
- $[16] = includeDescription;
18804
- $[17] = onPropertyChange;
18805
- $[18] = propertyKey;
18806
- $[19] = underlyingValueHasChanged;
18807
- $[20] = t22;
18809
+ $[15] = autoFocus;
18810
+ $[16] = context;
18811
+ $[17] = disabled;
18812
+ $[18] = includeDescription;
18813
+ $[19] = onPropertyChange;
18814
+ $[20] = propertyKey;
18815
+ $[21] = underlyingValueHasChanged;
18816
+ $[22] = t42;
18808
18817
  } else {
18809
- t22 = $[20];
18810
- }
18811
- t1 = Object.entries(mapProperties).filter(_temp$7).map(t22);
18812
- $[4] = autoFocus;
18813
- $[5] = context;
18814
- $[6] = disabled;
18815
- $[7] = includeDescription;
18816
- $[8] = mapProperties;
18817
- $[9] = onPropertyChange;
18818
- $[10] = propertyKey;
18819
- $[11] = underlyingValueHasChanged;
18820
- $[12] = t1;
18818
+ t42 = $[22];
18819
+ }
18820
+ t3 = Object.entries(mapProperties).filter(_temp$7).map(t42);
18821
+ $[6] = autoFocus;
18822
+ $[7] = context;
18823
+ $[8] = disabled;
18824
+ $[9] = includeDescription;
18825
+ $[10] = mapProperties;
18826
+ $[11] = onPropertyChange;
18827
+ $[12] = propertyKey;
18828
+ $[13] = underlyingValueHasChanged;
18829
+ $[14] = t3;
18821
18830
  } else {
18822
- t1 = $[12];
18831
+ t3 = $[14];
18823
18832
  }
18824
- let t2;
18825
- if ($[21] !== t1) {
18826
- t2 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "py-1 flex flex-col space-y-2", children: t1 }) });
18827
- $[21] = t1;
18828
- $[22] = t2;
18833
+ let t4;
18834
+ if ($[23] !== t2 || $[24] !== t3) {
18835
+ t4 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: t2, children: t3 }) });
18836
+ $[23] = t2;
18837
+ $[24] = t3;
18838
+ $[25] = t4;
18829
18839
  } else {
18830
- t2 = $[22];
18840
+ t4 = $[25];
18831
18841
  }
18832
- const mapFormView = t2;
18833
- let t3;
18834
- if ($[23] !== expanded || $[24] !== mapFormView || $[25] !== minimalistView || $[26] !== onPropertyChange || $[27] !== property || $[28] !== propertyKey) {
18835
- t3 = !minimalistView && /* @__PURE__ */ jsx(ExpandablePanel, { initiallyExpanded: expanded, onExpandedChange: (expanded_0) => {
18842
+ const mapFormView = t4;
18843
+ let t5;
18844
+ if ($[26] !== expanded || $[27] !== mapFormView || $[28] !== minimalistView || $[29] !== onPropertyChange || $[30] !== property || $[31] !== propertyKey) {
18845
+ t5 = !minimalistView && /* @__PURE__ */ jsx(ExpandablePanel, { initiallyExpanded: expanded, onExpandedChange: (expanded_0) => {
18836
18846
  onPropertyChange?.({
18837
18847
  expanded: expanded_0
18838
18848
  });
18839
18849
  }, className: property.widthPercentage !== void 0 ? "mt-8" : void 0, innerClassName: "px-2 md:px-4 pb-2 md:pb-4 pt-1 md:pt-2 bg-white dark:bg-surface-900", title: /* @__PURE__ */ jsx(LabelWithIconAndTooltip, { propertyKey, icon: getIconForProperty(property, "small"), required: property.validation?.required, title: property.name, className: "text-text-secondary dark:text-text-secondary-dark" }), children: mapFormView });
18840
- $[23] = expanded;
18841
- $[24] = mapFormView;
18842
- $[25] = minimalistView;
18843
- $[26] = onPropertyChange;
18844
- $[27] = property;
18845
- $[28] = propertyKey;
18846
- $[29] = t3;
18847
- } else {
18848
- t3 = $[29];
18849
- }
18850
- const t4 = minimalistView && mapFormView;
18851
- const t5 = showError ?? false;
18852
- const t6 = error ? typeof error === "string" ? error : "A property of this map has an error" : void 0;
18853
- let t7;
18854
- if ($[30] !== disabled || $[31] !== includeDescription || $[32] !== property || $[33] !== t5 || $[34] !== t6) {
18855
- t7 = /* @__PURE__ */ jsx(FieldHelperText, { includeDescription, showError: t5, error: t6, disabled, property });
18856
- $[30] = disabled;
18857
- $[31] = includeDescription;
18858
- $[32] = property;
18859
- $[33] = t5;
18860
- $[34] = t6;
18861
- $[35] = t7;
18850
+ $[26] = expanded;
18851
+ $[27] = mapFormView;
18852
+ $[28] = minimalistView;
18853
+ $[29] = onPropertyChange;
18854
+ $[30] = property;
18855
+ $[31] = propertyKey;
18856
+ $[32] = t5;
18857
+ } else {
18858
+ t5 = $[32];
18859
+ }
18860
+ const t6 = minimalistView && mapFormView;
18861
+ const t7 = showError ?? false;
18862
+ const t8 = error ? typeof error === "string" ? error : "A property of this map has an error" : void 0;
18863
+ let t9;
18864
+ if ($[33] !== disabled || $[34] !== includeDescription || $[35] !== property || $[36] !== t7 || $[37] !== t8) {
18865
+ t9 = /* @__PURE__ */ jsx(FieldHelperText, { includeDescription, showError: t7, error: t8, disabled, property });
18866
+ $[33] = disabled;
18867
+ $[34] = includeDescription;
18868
+ $[35] = property;
18869
+ $[36] = t7;
18870
+ $[37] = t8;
18871
+ $[38] = t9;
18862
18872
  } else {
18863
- t7 = $[35];
18873
+ t9 = $[38];
18864
18874
  }
18865
- let t8;
18866
- if ($[36] !== t3 || $[37] !== t4 || $[38] !== t7) {
18867
- t8 = /* @__PURE__ */ jsxs(ErrorBoundary, { children: [
18868
- t3,
18869
- t4,
18870
- t7
18875
+ let t10;
18876
+ if ($[39] !== t5 || $[40] !== t6 || $[41] !== t9) {
18877
+ t10 = /* @__PURE__ */ jsxs(ErrorBoundary, { children: [
18878
+ t5,
18879
+ t6,
18880
+ t9
18871
18881
  ] });
18872
- $[36] = t3;
18873
- $[37] = t4;
18874
- $[38] = t7;
18875
- $[39] = t8;
18882
+ $[39] = t5;
18883
+ $[40] = t6;
18884
+ $[41] = t9;
18885
+ $[42] = t10;
18876
18886
  } else {
18877
- t8 = $[39];
18887
+ t10 = $[42];
18878
18888
  }
18879
- return t8;
18889
+ return t10;
18880
18890
  }
18881
18891
  function _temp$7(t0) {
18882
18892
  const [, property_0] = t0;
@@ -21525,18 +21535,16 @@ function EntitySidePanel(props) {
21525
21535
  return navigationController.getParentCollectionIds(props.path);
21526
21536
  }, [navigationController, props.path]);
21527
21537
  const collection = useMemo(() => {
21528
- if (!props) return void 0;
21529
- let usedCollection = props.collection;
21538
+ if (props.collection) {
21539
+ return props.collection;
21540
+ }
21530
21541
  const registryCollection = navigationController.getCollection(props.path);
21531
21542
  if (registryCollection) {
21532
- usedCollection = registryCollection;
21533
- }
21534
- if (!usedCollection) {
21535
- console.error("ERROR: No collection found in path `", props.path, "`. Entity id: ", props.entityId);
21536
- throw Error("ERROR: No collection found in path `" + props.path + "`. Make sure you have defined a collection for this path in the root navigation.");
21543
+ return registryCollection;
21537
21544
  }
21538
- return usedCollection;
21539
- }, [navigationController, props]);
21545
+ console.error("ERROR: No collection found in path `", props.path, "`. Entity id: ", props.entityId);
21546
+ throw Error("ERROR: No collection found in path `" + props.path + "`. Make sure you have defined a collection for this path in the root navigation.");
21547
+ }, [navigationController, props.collection]);
21540
21548
  useEffect(() => {
21541
21549
  function beforeunload(e) {
21542
21550
  if (blocked && collection) {