@firecms/core 3.0.0-canary.165 → 3.0.0-canary.167

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
@@ -877,6 +877,28 @@
877
877
  const simpleRegexp = input.match(/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)/);
878
878
  return !!simpleRegexp;
879
879
  }
880
+ const reservedKeys = ["edit", "copy", "delete"];
881
+ function mergeEntityActions(currentActions, newActions) {
882
+ const updatedActions = [];
883
+ currentActions.forEach((action) => {
884
+ const newAction = newActions.find((a) => a.key === action.key);
885
+ if (newAction) {
886
+ const mergedAction = {
887
+ ...action,
888
+ ...newAction
889
+ };
890
+ updatedActions.push(mergedAction);
891
+ } else {
892
+ updatedActions.push(action);
893
+ }
894
+ });
895
+ newActions.forEach((action) => {
896
+ if (!currentActions.find((a) => a.key === action.key) && (!action.key || !reservedKeys.includes(action.key))) {
897
+ updatedActions.push(action);
898
+ }
899
+ });
900
+ return updatedActions;
901
+ }
880
902
  function useDebouncedCallback(value, callback, immediate, t0) {
881
903
  const $ = reactCompilerRuntime.c(9);
882
904
  const timeoutMs = t0 === void 0 ? 300 : t0;
@@ -3648,7 +3670,7 @@
3648
3670
  if ($[7] !== close || $[8] !== dialogEntries) {
3649
3671
  let t72;
3650
3672
  if ($[10] !== close) {
3651
- t72 = (entry, i) => /* @__PURE__ */ jsxRuntime.jsx(entry.Component, { open: true, closeDialog: close }, `dialog_${i}`);
3673
+ t72 = (entry, i) => /* @__PURE__ */ jsxRuntime.jsx(entry.Component, { open: true, closeDialog: close, ...entry.props }, `dialog_${i}`);
3652
3674
  $[10] = close;
3653
3675
  $[11] = t72;
3654
3676
  } else {
@@ -7110,7 +7132,7 @@
7110
7132
  function getSubcollectionColumnId(collection) {
7111
7133
  return `subcollection:${collection.id ?? collection.path}`;
7112
7134
  }
7113
- const COLLECTION_GROUP_PARENT_ID$1 = "collectionGroupParent";
7135
+ const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent";
7114
7136
  function useColumnIds(collection, includeSubcollections) {
7115
7137
  const $ = reactCompilerRuntime.c(5);
7116
7138
  let t0;
@@ -7121,7 +7143,7 @@
7121
7143
  propertyColumnConfigs = hideAndExpandKeys(collection, collection.propertiesOrder);
7122
7144
  if (collection.collectionGroup) {
7123
7145
  propertyColumnConfigs.push({
7124
- key: COLLECTION_GROUP_PARENT_ID$1,
7146
+ key: COLLECTION_GROUP_PARENT_ID,
7125
7147
  disabled: true
7126
7148
  });
7127
7149
  }
@@ -7176,7 +7198,7 @@
7176
7198
  }];
7177
7199
  }
7178
7200
  }
7179
- if (collection.collectionGroup && key === COLLECTION_GROUP_PARENT_ID$1) {
7201
+ if (collection.collectionGroup && key === COLLECTION_GROUP_PARENT_ID) {
7180
7202
  return [{
7181
7203
  key,
7182
7204
  disabled: true
@@ -7195,7 +7217,7 @@
7195
7217
  columnIds.push(...subCollectionIds.filter((subColId) => !columnIds.includes(subColId)));
7196
7218
  }
7197
7219
  if (collection.collectionGroup) {
7198
- columnIds.push(COLLECTION_GROUP_PARENT_ID$1);
7220
+ columnIds.push(COLLECTION_GROUP_PARENT_ID);
7199
7221
  }
7200
7222
  return hideAndExpandKeys(collection, columnIds);
7201
7223
  }
@@ -9473,6 +9495,7 @@
9473
9495
  }
9474
9496
  const editEntityAction = {
9475
9497
  icon: /* @__PURE__ */ jsxRuntime.jsx(ui.EditIcon, {}),
9498
+ key: "edit",
9476
9499
  name: "Edit",
9477
9500
  collapsed: false,
9478
9501
  onClick({
@@ -9505,6 +9528,7 @@
9505
9528
  const copyEntityAction = {
9506
9529
  icon: /* @__PURE__ */ jsxRuntime.jsx(ui.FileCopyIcon, {}),
9507
9530
  name: "Copy",
9531
+ key: "copy",
9508
9532
  onClick({
9509
9533
  entity,
9510
9534
  collection,
@@ -9528,34 +9552,10 @@
9528
9552
  return Promise.resolve(void 0);
9529
9553
  }
9530
9554
  };
9531
- const archiveEntityAction = {
9532
- icon: /* @__PURE__ */ jsxRuntime.jsx(ui.ArchiveIcon, {}),
9533
- name: "Archive",
9534
- onClick({
9535
- entity,
9536
- collection,
9537
- context: {
9538
- dataSource
9539
- }
9540
- }) {
9541
- return Promise.resolve(void 0);
9542
- }
9543
- };
9544
- const openWebsiteAction = {
9545
- icon: /* @__PURE__ */ jsxRuntime.jsx(ui.OpenInNewIcon, {}),
9546
- name: "See in website",
9547
- onClick({
9548
- entity,
9549
- collection,
9550
- context
9551
- }) {
9552
- window.open(`https://example.com/${entity.id}`, "_blank");
9553
- return Promise.resolve(void 0);
9554
- }
9555
- };
9556
9555
  const deleteEntityAction = {
9557
9556
  icon: /* @__PURE__ */ jsxRuntime.jsx(ui.DeleteIcon, {}),
9558
9557
  name: "Delete",
9558
+ key: "delete",
9559
9559
  onClick({
9560
9560
  entity,
9561
9561
  fullPath,
@@ -11522,7 +11522,7 @@
11522
11522
  const actions = [];
11523
11523
  if (createEnabled) actions.push(copyEntityAction);
11524
11524
  if (deleteEnabled) actions.push(deleteEntityAction);
11525
- if (customEntityActions) actions.push(...customEntityActions);
11525
+ if (customEntityActions) return mergeEntityActions(actions, customEntityActions);
11526
11526
  return actions;
11527
11527
  }, [authController, inputCollection, path]);
11528
11528
  const modified = formex$1.dirty;
@@ -11600,7 +11600,8 @@
11600
11600
  fullPath: resolvedCollection.path,
11601
11601
  collection: resolvedCollection,
11602
11602
  context,
11603
- sideEntityController
11603
+ sideEntityController,
11604
+ formContext
11604
11605
  });
11605
11606
  }, children: action.icon }, action.name)) }),
11606
11607
  formex$1.isSubmitting && /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "small" }),
@@ -12130,7 +12131,6 @@
12130
12131
  }
12131
12132
  return t5;
12132
12133
  }
12133
- const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent";
12134
12134
  const EntityCollectionView = React.memo(function EntityCollectionView2({
12135
12135
  fullPath: fullPathProp,
12136
12136
  parentCollectionIds,
@@ -12380,7 +12380,7 @@
12380
12380
  const actions = [editEntityAction];
12381
12381
  if (createEnabled) actions.push(copyEntityAction);
12382
12382
  if (deleteEnabled) actions.push(deleteEntityAction);
12383
- if (customEntityActions) actions.push(...customEntityActions);
12383
+ if (customEntityActions) return mergeEntityActions(actions, customEntityActions);
12384
12384
  return actions;
12385
12385
  };
12386
12386
  const getIdColumnWidth = () => {
@@ -16020,7 +16020,7 @@
16020
16020
  propertyOrBuilder: inputProperty,
16021
16021
  propertyConfigs: customizationController.propertyConfigs
16022
16022
  });
16023
- if (value === void 0 || property === null) {
16023
+ if (property === null) {
16024
16024
  let t02;
16025
16025
  if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
16026
16026
  t02 = /* @__PURE__ */ jsxRuntime.jsx(EmptyValue, {});
@@ -16041,7 +16041,7 @@
16041
16041
  customProps: property.customProps
16042
16042
  });
16043
16043
  } else {
16044
- if (value === null) {
16044
+ if (value === void 0 || value === null) {
16045
16045
  let t02;
16046
16046
  if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
16047
16047
  t02 = /* @__PURE__ */ jsxRuntime.jsx(EmptyValue, {});
@@ -22537,6 +22537,7 @@
22537
22537
  exports2.AuthControllerContext = AuthControllerContext;
22538
22538
  exports2.BlockFieldBinding = BlockFieldBinding;
22539
22539
  exports2.BooleanPreview = BooleanPreview;
22540
+ exports2.COLLECTION_GROUP_PARENT_ID = COLLECTION_GROUP_PARENT_ID;
22540
22541
  exports2.COLLECTION_PATH_SEPARATOR = COLLECTION_PATH_SEPARATOR;
22541
22542
  exports2.CircularProgressCenter = CircularProgressCenter;
22542
22543
  exports2.ConfirmationDialog = ConfirmationDialog;
@@ -22615,7 +22616,6 @@
22615
22616
  exports2.VirtualTable = VirtualTable;
22616
22617
  exports2.addInitialSlash = addInitialSlash;
22617
22618
  exports2.applyPermissionsFunctionIfEmpty = applyPermissionsFunctionIfEmpty;
22618
- exports2.archiveEntityAction = archiveEntityAction;
22619
22619
  exports2.buildAdditionalFieldDelegate = buildAdditionalFieldDelegate;
22620
22620
  exports2.buildCollection = buildCollection;
22621
22621
  exports2.buildEntityCallbacks = buildEntityCallbacks;
@@ -22689,7 +22689,7 @@
22689
22689
  exports2.makePropertiesNonEditable = makePropertiesNonEditable;
22690
22690
  exports2.mergeCollection = mergeCollection;
22691
22691
  exports2.mergeDeep = mergeDeep;
22692
- exports2.openWebsiteAction = openWebsiteAction;
22692
+ exports2.mergeEntityActions = mergeEntityActions;
22693
22693
  exports2.pick = pick;
22694
22694
  exports2.plural = plural;
22695
22695
  exports2.printChanged = printChanged;