@firecms/core 3.0.0-canary.165 → 3.0.0-canary.166
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/components/common/default_entity_actions.d.ts +0 -2
- package/dist/components/common/useColumnsIds.d.ts +1 -0
- package/dist/index.es.js +36 -37
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +35 -36
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collections.d.ts +1 -1
- package/dist/types/entity_actions.d.ts +9 -0
- package/dist/util/entity_actions.d.ts +2 -0
- package/dist/util/index.d.ts +1 -0
- package/package.json +5 -5
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +5 -4
- package/src/components/common/default_entity_actions.tsx +3 -28
- package/src/components/common/useColumnsIds.tsx +1 -1
- package/src/core/EntityEditView.tsx +2 -1
- package/src/preview/PropertyPreview.tsx +2 -2
- package/src/types/collections.ts +1 -1
- package/src/types/entity_actions.tsx +10 -0
- package/src/util/entity_actions.ts +28 -0
- package/src/util/index.ts +1 -0
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;
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
11525
|
+
if (customEntityActions) return mergeEntityActions(actions, customEntityActions);
|
|
11526
11526
|
return actions;
|
|
11527
11527
|
}, [authController, inputCollection, path]);
|
|
11528
11528
|
const modified = formex$1.dirty;
|
|
@@ -12130,7 +12130,6 @@
|
|
|
12130
12130
|
}
|
|
12131
12131
|
return t5;
|
|
12132
12132
|
}
|
|
12133
|
-
const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent";
|
|
12134
12133
|
const EntityCollectionView = React.memo(function EntityCollectionView2({
|
|
12135
12134
|
fullPath: fullPathProp,
|
|
12136
12135
|
parentCollectionIds,
|
|
@@ -12380,7 +12379,7 @@
|
|
|
12380
12379
|
const actions = [editEntityAction];
|
|
12381
12380
|
if (createEnabled) actions.push(copyEntityAction);
|
|
12382
12381
|
if (deleteEnabled) actions.push(deleteEntityAction);
|
|
12383
|
-
if (customEntityActions) actions
|
|
12382
|
+
if (customEntityActions) return mergeEntityActions(actions, customEntityActions);
|
|
12384
12383
|
return actions;
|
|
12385
12384
|
};
|
|
12386
12385
|
const getIdColumnWidth = () => {
|
|
@@ -16020,7 +16019,7 @@
|
|
|
16020
16019
|
propertyOrBuilder: inputProperty,
|
|
16021
16020
|
propertyConfigs: customizationController.propertyConfigs
|
|
16022
16021
|
});
|
|
16023
|
-
if (
|
|
16022
|
+
if (property === null) {
|
|
16024
16023
|
let t02;
|
|
16025
16024
|
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
16026
16025
|
t02 = /* @__PURE__ */ jsxRuntime.jsx(EmptyValue, {});
|
|
@@ -16041,7 +16040,7 @@
|
|
|
16041
16040
|
customProps: property.customProps
|
|
16042
16041
|
});
|
|
16043
16042
|
} else {
|
|
16044
|
-
if (value === null) {
|
|
16043
|
+
if (value === void 0 || value === null) {
|
|
16045
16044
|
let t02;
|
|
16046
16045
|
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
16047
16046
|
t02 = /* @__PURE__ */ jsxRuntime.jsx(EmptyValue, {});
|
|
@@ -22537,6 +22536,7 @@
|
|
|
22537
22536
|
exports2.AuthControllerContext = AuthControllerContext;
|
|
22538
22537
|
exports2.BlockFieldBinding = BlockFieldBinding;
|
|
22539
22538
|
exports2.BooleanPreview = BooleanPreview;
|
|
22539
|
+
exports2.COLLECTION_GROUP_PARENT_ID = COLLECTION_GROUP_PARENT_ID;
|
|
22540
22540
|
exports2.COLLECTION_PATH_SEPARATOR = COLLECTION_PATH_SEPARATOR;
|
|
22541
22541
|
exports2.CircularProgressCenter = CircularProgressCenter;
|
|
22542
22542
|
exports2.ConfirmationDialog = ConfirmationDialog;
|
|
@@ -22615,7 +22615,6 @@
|
|
|
22615
22615
|
exports2.VirtualTable = VirtualTable;
|
|
22616
22616
|
exports2.addInitialSlash = addInitialSlash;
|
|
22617
22617
|
exports2.applyPermissionsFunctionIfEmpty = applyPermissionsFunctionIfEmpty;
|
|
22618
|
-
exports2.archiveEntityAction = archiveEntityAction;
|
|
22619
22618
|
exports2.buildAdditionalFieldDelegate = buildAdditionalFieldDelegate;
|
|
22620
22619
|
exports2.buildCollection = buildCollection;
|
|
22621
22620
|
exports2.buildEntityCallbacks = buildEntityCallbacks;
|
|
@@ -22689,7 +22688,7 @@
|
|
|
22689
22688
|
exports2.makePropertiesNonEditable = makePropertiesNonEditable;
|
|
22690
22689
|
exports2.mergeCollection = mergeCollection;
|
|
22691
22690
|
exports2.mergeDeep = mergeDeep;
|
|
22692
|
-
exports2.
|
|
22691
|
+
exports2.mergeEntityActions = mergeEntityActions;
|
|
22693
22692
|
exports2.pick = pick;
|
|
22694
22693
|
exports2.plural = plural;
|
|
22695
22694
|
exports2.printChanged = printChanged;
|