@lowdefy/plugin-aws 0.0.0-experimental-20260401123321 → 0.0.0-experimental-20260401143739

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.
@@ -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.',
@@ -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.',
@@ -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-20260401123321",
3
+ "version": "0.0.0-experimental-20260401143739",
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-20260401123321",
45
- "@lowdefy/blocks-antd": "0.0.0-experimental-20260401123321",
46
- "@lowdefy/helpers": "0.0.0-experimental-20260401123321",
44
+ "@lowdefy/block-utils": "0.0.0-experimental-20260401143739",
45
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20260401143739",
46
+ "@lowdefy/helpers": "0.0.0-experimental-20260401143739",
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-20260401123321",
56
- "@lowdefy/block-dev": "0.0.0-experimental-20260401123321",
57
- "@lowdefy/jest-yaml-transform": "0.0.0-experimental-20260401123321",
55
+ "@lowdefy/ajv": "0.0.0-experimental-20260401143739",
56
+ "@lowdefy/block-dev": "0.0.0-experimental-20260401143739",
57
+ "@lowdefy/jest-yaml-transform": "0.0.0-experimental-20260401143739",
58
58
  "@swc/cli": "0.8.0",
59
59
  "@swc/core": "1.15.18",
60
60
  "@swc/jest": "0.2.39",