@firecms/core 3.0.0-canary.119 → 3.0.0-canary.120
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/form/useClearRestoreValue.d.ts +2 -2
- package/dist/index.es.js +35 -13
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +35 -13
- package/dist/index.umd.js.map +1 -1
- package/dist/types/fields.d.ts +2 -2
- package/dist/types/properties.d.ts +3 -3
- package/dist/util/entities.d.ts +1 -1
- package/dist/util/property_utils.d.ts +1 -1
- package/dist/util/useStorageUploadController.d.ts +2 -2
- package/package.json +5 -5
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +11 -4
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +18 -6
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +2 -2
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +14 -3
- package/src/form/useClearRestoreValue.tsx +2 -2
- package/src/types/fields.tsx +2 -2
- package/src/types/properties.ts +4 -4
- package/src/util/entities.ts +1 -1
- package/src/util/property_utils.tsx +1 -1
- package/src/util/storage.ts +5 -1
- package/src/util/useStorageUploadController.tsx +13 -5
package/dist/index.umd.js
CHANGED
|
@@ -6607,6 +6607,10 @@
|
|
|
6607
6607
|
setInternalValue(internalInitialValue);
|
|
6608
6608
|
}
|
|
6609
6609
|
}, [internalInitialValue, value, initialValue]);
|
|
6610
|
+
const resolvedProperty = resolveProperty({
|
|
6611
|
+
propertyOrBuilder: property,
|
|
6612
|
+
values: entityValues
|
|
6613
|
+
});
|
|
6610
6614
|
const fileNameBuilder = React.useCallback(async (file) => {
|
|
6611
6615
|
if (storage.fileName) {
|
|
6612
6616
|
const fileName = await resolveStorageFilenameString({
|
|
@@ -6615,7 +6619,7 @@
|
|
|
6615
6619
|
values: entityValues,
|
|
6616
6620
|
entityId,
|
|
6617
6621
|
path,
|
|
6618
|
-
property,
|
|
6622
|
+
property: resolvedProperty,
|
|
6619
6623
|
file,
|
|
6620
6624
|
propertyKey
|
|
6621
6625
|
});
|
|
@@ -6625,7 +6629,7 @@
|
|
|
6625
6629
|
return fileName;
|
|
6626
6630
|
}
|
|
6627
6631
|
return randomString() + "_" + file.name;
|
|
6628
|
-
}, [entityId, entityValues, path,
|
|
6632
|
+
}, [entityId, entityValues, path, resolvedProperty, propertyKey, storage]);
|
|
6629
6633
|
const storagePathBuilder = React.useCallback((file) => {
|
|
6630
6634
|
return resolveStoragePathString({
|
|
6631
6635
|
input: storage.storagePath,
|
|
@@ -6633,11 +6637,11 @@
|
|
|
6633
6637
|
values: entityValues,
|
|
6634
6638
|
entityId,
|
|
6635
6639
|
path,
|
|
6636
|
-
property,
|
|
6640
|
+
property: resolvedProperty,
|
|
6637
6641
|
file,
|
|
6638
6642
|
propertyKey
|
|
6639
6643
|
}) ?? "/";
|
|
6640
|
-
}, [entityId, entityValues, path,
|
|
6644
|
+
}, [entityId, entityValues, path, resolvedProperty, propertyKey, storage]);
|
|
6641
6645
|
const onFileUploadComplete = React.useCallback(async (uploadedPath, entry, metadata2) => {
|
|
6642
6646
|
console.debug("onFileUploadComplete", uploadedPath, entry);
|
|
6643
6647
|
let uploadPathOrDownloadUrl = uploadedPath;
|
|
@@ -13896,7 +13900,7 @@
|
|
|
13896
13900
|
includeDescription,
|
|
13897
13901
|
size = "medium"
|
|
13898
13902
|
}) {
|
|
13899
|
-
const enumValues = property.enumValues;
|
|
13903
|
+
const enumValues = resolveEnumValues(property.enumValues ?? []);
|
|
13900
13904
|
useClearRestoreValue({
|
|
13901
13905
|
property,
|
|
13902
13906
|
value,
|
|
@@ -14335,6 +14339,9 @@
|
|
|
14335
14339
|
value,
|
|
14336
14340
|
setValue
|
|
14337
14341
|
});
|
|
14342
|
+
const resolvedProperty = resolveProperty({
|
|
14343
|
+
propertyOrBuilder: property
|
|
14344
|
+
});
|
|
14338
14345
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14339
14346
|
!minimalistView && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14340
14347
|
LabelWithIconAndTooltip,
|
|
@@ -14353,7 +14360,7 @@
|
|
|
14353
14360
|
name: propertyKey,
|
|
14354
14361
|
disabled: disabled ?? false,
|
|
14355
14362
|
autoFocus: autoFocus ?? false,
|
|
14356
|
-
property,
|
|
14363
|
+
property: resolvedProperty,
|
|
14357
14364
|
onChange: setValue,
|
|
14358
14365
|
setInternalValue,
|
|
14359
14366
|
onFilesAdded,
|
|
@@ -15972,7 +15979,7 @@
|
|
|
15972
15979
|
}) {
|
|
15973
15980
|
if (!property.of)
|
|
15974
15981
|
throw Error("RepeatFieldBinding misconfiguration. Property `of` not set");
|
|
15975
|
-
let resolvedProperties = property.resolvedProperties;
|
|
15982
|
+
let resolvedProperties = "resolvedProperties" in property ? property.resolvedProperties : void 0;
|
|
15976
15983
|
if (!resolvedProperties) {
|
|
15977
15984
|
resolvedProperties = getArrayResolvedProperties({
|
|
15978
15985
|
propertyValue: value,
|
|
@@ -16286,6 +16293,10 @@
|
|
|
16286
16293
|
setFieldVersion(fieldVersion + 1);
|
|
16287
16294
|
}
|
|
16288
16295
|
}, [value]);
|
|
16296
|
+
const resolvedProperty = resolveProperty({
|
|
16297
|
+
propertyOrBuilder: property,
|
|
16298
|
+
values: entityValues
|
|
16299
|
+
});
|
|
16289
16300
|
const fileNameBuilder = React.useCallback(async (file) => {
|
|
16290
16301
|
if (storage?.fileName) {
|
|
16291
16302
|
const fileName = await resolveStorageFilenameString({
|
|
@@ -16294,7 +16305,7 @@
|
|
|
16294
16305
|
values: entityValues,
|
|
16295
16306
|
entityId,
|
|
16296
16307
|
path,
|
|
16297
|
-
property,
|
|
16308
|
+
property: resolvedProperty,
|
|
16298
16309
|
file,
|
|
16299
16310
|
propertyKey
|
|
16300
16311
|
});
|
|
@@ -16304,16 +16315,20 @@
|
|
|
16304
16315
|
return fileName;
|
|
16305
16316
|
}
|
|
16306
16317
|
return randomString() + "_" + file.name;
|
|
16307
|
-
}, [entityId, entityValues, path,
|
|
16318
|
+
}, [entityId, entityValues, path, resolvedProperty, propertyKey, storage]);
|
|
16308
16319
|
const storagePathBuilder = React.useCallback((file) => {
|
|
16309
16320
|
if (!storage) return "/";
|
|
16321
|
+
const resolvedProperty2 = resolveProperty({
|
|
16322
|
+
propertyOrBuilder: property,
|
|
16323
|
+
values: entityValues
|
|
16324
|
+
});
|
|
16310
16325
|
return resolveStoragePathString({
|
|
16311
16326
|
input: storage.storagePath,
|
|
16312
16327
|
storage,
|
|
16313
16328
|
values: entityValues,
|
|
16314
16329
|
entityId,
|
|
16315
16330
|
path,
|
|
16316
|
-
property,
|
|
16331
|
+
property: resolvedProperty2,
|
|
16317
16332
|
file,
|
|
16318
16333
|
propertyKey
|
|
16319
16334
|
}) ?? "/";
|
|
@@ -16382,8 +16397,15 @@
|
|
|
16382
16397
|
context,
|
|
16383
16398
|
disabled
|
|
16384
16399
|
}) {
|
|
16385
|
-
|
|
16386
|
-
|
|
16400
|
+
let resolvedProperties = "resolvedProperties" in property ? property.resolvedProperties : void 0;
|
|
16401
|
+
if (!resolvedProperties) {
|
|
16402
|
+
resolvedProperties = getArrayResolvedProperties({
|
|
16403
|
+
propertyValue: value,
|
|
16404
|
+
propertyKey,
|
|
16405
|
+
property,
|
|
16406
|
+
ignoreMissingFields: false
|
|
16407
|
+
});
|
|
16408
|
+
}
|
|
16387
16409
|
const expanded = property.expanded === void 0 ? true : property.expanded;
|
|
16388
16410
|
useClearRestoreValue({
|
|
16389
16411
|
property,
|
|
@@ -16407,7 +16429,7 @@
|
|
|
16407
16429
|
")"
|
|
16408
16430
|
] })
|
|
16409
16431
|
] });
|
|
16410
|
-
const body =
|
|
16432
|
+
const body = resolvedProperties.map((childProperty, index) => {
|
|
16411
16433
|
const fieldProps = {
|
|
16412
16434
|
propertyKey: `${propertyKey}[${index}]`,
|
|
16413
16435
|
disabled,
|