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