@lowdefy/plugin-aws 0.0.0-experimental-20260401123321 → 0.0.0-experimental-20260408133530
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/blocks/S3UploadButton/meta.js +6 -0
- package/dist/blocks/S3UploadDragger/S3UploadDragger.js +1 -0
- package/dist/blocks/S3UploadDragger/meta.js +10 -0
- package/dist/blocks/S3UploadDragger/schema.js +4 -0
- package/dist/blocks/S3UploadPhoto/meta.js +6 -0
- package/dist/blocks/utils/useFileList.js +10 -1
- package/package.json +7 -7
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
element: 'The upload wrapper element.'
|
|
23
23
|
},
|
|
24
24
|
events: {
|
|
25
|
+
onBeforeUpload: {
|
|
26
|
+
description: 'Triggered before upload starts. If any action throws, the upload is cancelled.',
|
|
27
|
+
event: {
|
|
28
|
+
file: 'The raw File object selected by the user.'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
25
31
|
onChange: 'Triggered when the upload state is changing.',
|
|
26
32
|
onProgress: {
|
|
27
33
|
description: 'Triggered when the upload state is in progress.',
|
|
@@ -69,6 +69,7 @@ const S3UploadDragger = ({ blockId, classNames = {}, methods, properties, styles
|
|
|
69
69
|
beforeUpload: loadFileList,
|
|
70
70
|
className: classNames.element,
|
|
71
71
|
style: styles.element,
|
|
72
|
+
height: properties.height,
|
|
72
73
|
customRequest: s3UploadRequest,
|
|
73
74
|
disabled: properties.disabled,
|
|
74
75
|
fileList: state.fileList,
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
hint: 'The hint text inside the dragger.'
|
|
22
22
|
},
|
|
23
23
|
events: {
|
|
24
|
+
onBeforeUpload: {
|
|
25
|
+
description: 'Triggered before upload starts. If any action throws, the upload is cancelled.',
|
|
26
|
+
event: {
|
|
27
|
+
file: 'The raw File object selected by the user.'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
24
30
|
onChange: 'Triggered when the upload state is changing.',
|
|
25
31
|
onProgress: {
|
|
26
32
|
description: 'Triggered when the upload state is in progress.',
|
|
@@ -57,6 +63,10 @@
|
|
|
57
63
|
's3PostPolicyRequestId'
|
|
58
64
|
],
|
|
59
65
|
properties: {
|
|
66
|
+
height: {
|
|
67
|
+
type: 'number',
|
|
68
|
+
description: 'Height of the dragger area in pixels. Defaults to the antd control height. Overridden by style .element height if set.'
|
|
69
|
+
},
|
|
60
70
|
title: {
|
|
61
71
|
type: 'string',
|
|
62
72
|
description: 'Title of the file input to be displayed on the draggable area.'
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
's3PostPolicyRequestId'
|
|
21
21
|
],
|
|
22
22
|
properties: {
|
|
23
|
+
height: {
|
|
24
|
+
type: 'number',
|
|
25
|
+
description: 'Height of the dragger area in pixels. Defaults to the antd control height. Overridden by style .element height if set.'
|
|
26
|
+
},
|
|
23
27
|
title: {
|
|
24
28
|
type: 'string',
|
|
25
29
|
description: 'Title of the file input to be displayed on the draggable area.'
|
|
@@ -25,6 +25,12 @@
|
|
|
25
25
|
title: 'The upload title text.'
|
|
26
26
|
},
|
|
27
27
|
events: {
|
|
28
|
+
onBeforeUpload: {
|
|
29
|
+
description: 'Triggered before upload starts. If any action throws, the upload is cancelled.',
|
|
30
|
+
event: {
|
|
31
|
+
file: 'The raw File object selected by the user.'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
28
34
|
onChange: 'Triggered when the upload state is changing.',
|
|
29
35
|
onProgress: {
|
|
30
36
|
description: 'Triggered when the upload state is in progress.',
|
|
@@ -84,13 +84,22 @@ const useFileList = ({ properties, methods, value = {} })=>{
|
|
|
84
84
|
setValue(nextState);
|
|
85
85
|
methods.setValue(nextState);
|
|
86
86
|
};
|
|
87
|
-
const loadFileList = (file, nextFiles)=>{
|
|
87
|
+
const loadFileList = async (file, nextFiles)=>{
|
|
88
88
|
if (properties.singleFile === true && nextFiles.filter((f)=>type.isString(f.uid)).length > 1) {
|
|
89
89
|
return false;
|
|
90
90
|
}
|
|
91
91
|
if (type.isInt(properties.maxCount) && nextFiles.filter((f)=>type.isString(f.uid)).length > properties.maxCount) {
|
|
92
92
|
return false;
|
|
93
93
|
}
|
|
94
|
+
const result = await methods.triggerEvent({
|
|
95
|
+
name: 'onBeforeUpload',
|
|
96
|
+
event: {
|
|
97
|
+
file
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
if (result.success === false) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
94
103
|
setValue({
|
|
95
104
|
file,
|
|
96
105
|
fileList: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/plugin-aws",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260408133530",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"dist/*"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
45
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
46
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
44
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20260408133530",
|
|
45
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20260408133530",
|
|
46
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260408133530",
|
|
47
47
|
"antd": "6.3.1",
|
|
48
48
|
"@aws-sdk/client-s3": "3.797.0",
|
|
49
49
|
"@aws-sdk/s3-presigned-post": "3.797.0",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"react-dom": "18.2.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@lowdefy/ajv": "0.0.0-experimental-
|
|
56
|
-
"@lowdefy/block-dev": "0.0.0-experimental-
|
|
57
|
-
"@lowdefy/jest-yaml-transform": "0.0.0-experimental-
|
|
55
|
+
"@lowdefy/ajv": "0.0.0-experimental-20260408133530",
|
|
56
|
+
"@lowdefy/block-dev": "0.0.0-experimental-20260408133530",
|
|
57
|
+
"@lowdefy/jest-yaml-transform": "0.0.0-experimental-20260408133530",
|
|
58
58
|
"@swc/cli": "0.8.0",
|
|
59
59
|
"@swc/core": "1.15.18",
|
|
60
60
|
"@swc/jest": "0.2.39",
|