@lowdefy/blocks-files 5.3.0 → 6.0.0
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/Download/gallery.yaml +38 -0
- package/dist/blocks/Download/tests/Download.e2e.yaml +77 -0
- package/dist/blocks/Upload/gallery.yaml +113 -0
- package/dist/blocks/Upload/tests/Upload.e2e.yaml +112 -0
- package/dist/blocks/UploadDragger/gallery.yaml +54 -0
- package/dist/blocks/UploadDragger/tests/UploadDragger.e2e.yaml +74 -0
- package/dist/blocks/UploadPhoto/gallery.yaml +54 -0
- package/dist/blocks/UploadPhoto/tests/UploadPhoto.e2e.yaml +74 -0
- package/package.json +8 -8
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
- title: Basic
|
|
16
|
+
blocks:
|
|
17
|
+
- id: basic_default
|
|
18
|
+
type: Download
|
|
19
|
+
properties:
|
|
20
|
+
downloadPolicyRequestId: download_policy_request
|
|
21
|
+
fileList:
|
|
22
|
+
- key: reports/report.pdf
|
|
23
|
+
name: report.pdf
|
|
24
|
+
size: 1024
|
|
25
|
+
type: application/pdf
|
|
26
|
+
|
|
27
|
+
- title: Removable Files
|
|
28
|
+
blocks:
|
|
29
|
+
- id: removable
|
|
30
|
+
type: Download
|
|
31
|
+
properties:
|
|
32
|
+
downloadPolicyRequestId: download_policy_request
|
|
33
|
+
showRemoveIcon: true
|
|
34
|
+
fileList:
|
|
35
|
+
- key: reports/report.pdf
|
|
36
|
+
name: report.pdf
|
|
37
|
+
- key: reports/summary.xlsx
|
|
38
|
+
name: summary.xlsx
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
id: download
|
|
16
|
+
type: Box
|
|
17
|
+
|
|
18
|
+
blocks:
|
|
19
|
+
# ============================================
|
|
20
|
+
# BASIC RENDERING
|
|
21
|
+
# ============================================
|
|
22
|
+
|
|
23
|
+
- id: download_basic
|
|
24
|
+
type: Download
|
|
25
|
+
properties:
|
|
26
|
+
downloadPolicyRequestId: download_policy_request
|
|
27
|
+
fileList:
|
|
28
|
+
- key: reports/report.pdf
|
|
29
|
+
name: report.pdf
|
|
30
|
+
size: 1024
|
|
31
|
+
type: application/pdf
|
|
32
|
+
status: done
|
|
33
|
+
- key: reports/summary.xlsx
|
|
34
|
+
name: summary.xlsx
|
|
35
|
+
size: 2048
|
|
36
|
+
status: done
|
|
37
|
+
|
|
38
|
+
- id: download_empty
|
|
39
|
+
type: Download
|
|
40
|
+
properties:
|
|
41
|
+
downloadPolicyRequestId: download_policy_request
|
|
42
|
+
|
|
43
|
+
# ============================================
|
|
44
|
+
# REMOVE ICON + EVENT
|
|
45
|
+
# ============================================
|
|
46
|
+
|
|
47
|
+
- id: download_remove
|
|
48
|
+
type: Download
|
|
49
|
+
properties:
|
|
50
|
+
downloadPolicyRequestId: download_policy_request
|
|
51
|
+
showRemoveIcon: true
|
|
52
|
+
fileList:
|
|
53
|
+
- key: reports/removable.pdf
|
|
54
|
+
name: removable.pdf
|
|
55
|
+
status: done
|
|
56
|
+
events:
|
|
57
|
+
onRemove:
|
|
58
|
+
- id: set_removed_file
|
|
59
|
+
type: SetState
|
|
60
|
+
params:
|
|
61
|
+
removed_file:
|
|
62
|
+
_event: file.name
|
|
63
|
+
|
|
64
|
+
- id: remove_display
|
|
65
|
+
type: Span
|
|
66
|
+
properties:
|
|
67
|
+
content:
|
|
68
|
+
_if:
|
|
69
|
+
test:
|
|
70
|
+
_ne:
|
|
71
|
+
- _state: removed_file
|
|
72
|
+
- null
|
|
73
|
+
then:
|
|
74
|
+
_string.concat:
|
|
75
|
+
- 'Removed: '
|
|
76
|
+
- _state: removed_file
|
|
77
|
+
else: ''
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
- title: Basic
|
|
16
|
+
blocks:
|
|
17
|
+
- id: basic_default
|
|
18
|
+
type: Upload
|
|
19
|
+
properties:
|
|
20
|
+
uploadPolicyRequestId: upload_policy_request
|
|
21
|
+
- id: basic_custom_title
|
|
22
|
+
type: Upload
|
|
23
|
+
properties:
|
|
24
|
+
uploadPolicyRequestId: upload_policy_request
|
|
25
|
+
button:
|
|
26
|
+
icon: UploadOutlined
|
|
27
|
+
title: Choose File
|
|
28
|
+
type: default
|
|
29
|
+
- id: basic_custom_icon
|
|
30
|
+
type: Upload
|
|
31
|
+
properties:
|
|
32
|
+
uploadPolicyRequestId: upload_policy_request
|
|
33
|
+
button:
|
|
34
|
+
icon: AiOutlineCloudUpload
|
|
35
|
+
title: Upload to Cloud
|
|
36
|
+
type: default
|
|
37
|
+
|
|
38
|
+
- title: File Type Restrictions
|
|
39
|
+
blocks:
|
|
40
|
+
- id: accept_images
|
|
41
|
+
type: Upload
|
|
42
|
+
properties:
|
|
43
|
+
uploadPolicyRequestId: upload_policy_request
|
|
44
|
+
accept: 'image/*'
|
|
45
|
+
button:
|
|
46
|
+
icon: AiOutlinePicture
|
|
47
|
+
title: Upload Image
|
|
48
|
+
type: default
|
|
49
|
+
- id: accept_pdf
|
|
50
|
+
type: Upload
|
|
51
|
+
properties:
|
|
52
|
+
uploadPolicyRequestId: upload_policy_request
|
|
53
|
+
accept: '.pdf'
|
|
54
|
+
button:
|
|
55
|
+
icon: AiOutlineFilePdf
|
|
56
|
+
title: Upload PDF
|
|
57
|
+
type: default
|
|
58
|
+
|
|
59
|
+
- title: Upload Limits
|
|
60
|
+
blocks:
|
|
61
|
+
- id: limit_single
|
|
62
|
+
type: Upload
|
|
63
|
+
properties:
|
|
64
|
+
uploadPolicyRequestId: upload_policy_request
|
|
65
|
+
singleFile: true
|
|
66
|
+
button:
|
|
67
|
+
icon: UploadOutlined
|
|
68
|
+
title: Upload Single File
|
|
69
|
+
type: default
|
|
70
|
+
- id: limit_max_three
|
|
71
|
+
type: Upload
|
|
72
|
+
properties:
|
|
73
|
+
uploadPolicyRequestId: upload_policy_request
|
|
74
|
+
maxCount: 3
|
|
75
|
+
button:
|
|
76
|
+
icon: UploadOutlined
|
|
77
|
+
title: Upload (Max 3)
|
|
78
|
+
type: default
|
|
79
|
+
|
|
80
|
+
- title: Emit File Content
|
|
81
|
+
blocks:
|
|
82
|
+
- id: emit_file_content
|
|
83
|
+
type: Upload
|
|
84
|
+
properties:
|
|
85
|
+
emitFileContent: true
|
|
86
|
+
singleFile: true
|
|
87
|
+
button:
|
|
88
|
+
icon: UploadOutlined
|
|
89
|
+
title: Attach File
|
|
90
|
+
type: default
|
|
91
|
+
|
|
92
|
+
- title: Disabled State
|
|
93
|
+
blocks:
|
|
94
|
+
- id: disabled_default
|
|
95
|
+
type: Upload
|
|
96
|
+
properties:
|
|
97
|
+
uploadPolicyRequestId: upload_policy_request
|
|
98
|
+
disabled: true
|
|
99
|
+
|
|
100
|
+
- title: Label Options
|
|
101
|
+
blocks:
|
|
102
|
+
- id: label_default
|
|
103
|
+
type: Upload
|
|
104
|
+
properties:
|
|
105
|
+
title: Upload Attachment
|
|
106
|
+
uploadPolicyRequestId: upload_policy_request
|
|
107
|
+
- id: label_extra
|
|
108
|
+
type: Upload
|
|
109
|
+
properties:
|
|
110
|
+
title: Upload Document
|
|
111
|
+
uploadPolicyRequestId: upload_policy_request
|
|
112
|
+
label:
|
|
113
|
+
extra: Accepted formats are PDF, DOCX, and PNG. Max size 10MB.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
id: upload
|
|
16
|
+
type: Box
|
|
17
|
+
|
|
18
|
+
blocks:
|
|
19
|
+
# ============================================
|
|
20
|
+
# BASIC RENDERING
|
|
21
|
+
# ============================================
|
|
22
|
+
|
|
23
|
+
- id: upload_basic
|
|
24
|
+
type: Upload
|
|
25
|
+
properties:
|
|
26
|
+
uploadPolicyRequestId: upload_policy_request
|
|
27
|
+
|
|
28
|
+
- id: upload_custom_button
|
|
29
|
+
type: Upload
|
|
30
|
+
properties:
|
|
31
|
+
uploadPolicyRequestId: upload_policy_request
|
|
32
|
+
button:
|
|
33
|
+
title: Choose File
|
|
34
|
+
type: primary
|
|
35
|
+
|
|
36
|
+
# ============================================
|
|
37
|
+
# PROPERTY TESTS
|
|
38
|
+
# ============================================
|
|
39
|
+
|
|
40
|
+
- id: upload_disabled
|
|
41
|
+
type: Upload
|
|
42
|
+
properties:
|
|
43
|
+
uploadPolicyRequestId: upload_policy_request
|
|
44
|
+
disabled: true
|
|
45
|
+
|
|
46
|
+
- id: upload_accept
|
|
47
|
+
type: Upload
|
|
48
|
+
properties:
|
|
49
|
+
uploadPolicyRequestId: upload_policy_request
|
|
50
|
+
accept: '.pdf'
|
|
51
|
+
|
|
52
|
+
# ============================================
|
|
53
|
+
# EMIT FILE CONTENT
|
|
54
|
+
# ============================================
|
|
55
|
+
|
|
56
|
+
- id: upload_emit
|
|
57
|
+
type: Upload
|
|
58
|
+
properties:
|
|
59
|
+
emitFileContent: true
|
|
60
|
+
singleFile: true
|
|
61
|
+
events:
|
|
62
|
+
onChange:
|
|
63
|
+
- id: set_emitted_file
|
|
64
|
+
type: SetState
|
|
65
|
+
params:
|
|
66
|
+
emitted_file:
|
|
67
|
+
_event: file
|
|
68
|
+
|
|
69
|
+
- id: emit_name_display
|
|
70
|
+
type: Span
|
|
71
|
+
properties:
|
|
72
|
+
content:
|
|
73
|
+
_if:
|
|
74
|
+
test:
|
|
75
|
+
_ne:
|
|
76
|
+
- _state: emitted_file.name
|
|
77
|
+
- null
|
|
78
|
+
then:
|
|
79
|
+
_string.concat:
|
|
80
|
+
- 'Name: '
|
|
81
|
+
- _state: emitted_file.name
|
|
82
|
+
else: ''
|
|
83
|
+
|
|
84
|
+
- id: emit_content_display
|
|
85
|
+
type: Span
|
|
86
|
+
properties:
|
|
87
|
+
content:
|
|
88
|
+
_if:
|
|
89
|
+
test:
|
|
90
|
+
_ne:
|
|
91
|
+
- _state: emitted_file.content
|
|
92
|
+
- null
|
|
93
|
+
then:
|
|
94
|
+
_string.concat:
|
|
95
|
+
- 'Content: '
|
|
96
|
+
- _state: emitted_file.content
|
|
97
|
+
else: ''
|
|
98
|
+
|
|
99
|
+
- id: emit_type_display
|
|
100
|
+
type: Span
|
|
101
|
+
properties:
|
|
102
|
+
content:
|
|
103
|
+
_if:
|
|
104
|
+
test:
|
|
105
|
+
_ne:
|
|
106
|
+
- _state: emitted_file.type
|
|
107
|
+
- null
|
|
108
|
+
then:
|
|
109
|
+
_string.concat:
|
|
110
|
+
- 'Type: '
|
|
111
|
+
- _state: emitted_file.type
|
|
112
|
+
else: ''
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
- title: Basic
|
|
16
|
+
blocks:
|
|
17
|
+
- id: basic_default
|
|
18
|
+
type: UploadDragger
|
|
19
|
+
properties:
|
|
20
|
+
uploadPolicyRequestId: upload_policy_request
|
|
21
|
+
- id: basic_custom_title
|
|
22
|
+
type: UploadDragger
|
|
23
|
+
properties:
|
|
24
|
+
uploadPolicyRequestId: upload_policy_request
|
|
25
|
+
title: Drop your files here
|
|
26
|
+
|
|
27
|
+
- title: Height
|
|
28
|
+
blocks:
|
|
29
|
+
- id: height_number
|
|
30
|
+
type: UploadDragger
|
|
31
|
+
properties:
|
|
32
|
+
uploadPolicyRequestId: upload_policy_request
|
|
33
|
+
height: 200
|
|
34
|
+
- id: height_string
|
|
35
|
+
type: UploadDragger
|
|
36
|
+
properties:
|
|
37
|
+
uploadPolicyRequestId: upload_policy_request
|
|
38
|
+
height: 30vh
|
|
39
|
+
|
|
40
|
+
- title: Emit File Content
|
|
41
|
+
blocks:
|
|
42
|
+
- id: emit_file_content
|
|
43
|
+
type: UploadDragger
|
|
44
|
+
properties:
|
|
45
|
+
emitFileContent: true
|
|
46
|
+
singleFile: true
|
|
47
|
+
|
|
48
|
+
- title: Disabled State
|
|
49
|
+
blocks:
|
|
50
|
+
- id: disabled_default
|
|
51
|
+
type: UploadDragger
|
|
52
|
+
properties:
|
|
53
|
+
uploadPolicyRequestId: upload_policy_request
|
|
54
|
+
disabled: true
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
id: uploaddragger
|
|
16
|
+
type: Box
|
|
17
|
+
|
|
18
|
+
blocks:
|
|
19
|
+
# ============================================
|
|
20
|
+
# BASIC RENDERING
|
|
21
|
+
# ============================================
|
|
22
|
+
|
|
23
|
+
- id: uploaddragger_basic
|
|
24
|
+
type: UploadDragger
|
|
25
|
+
properties:
|
|
26
|
+
uploadPolicyRequestId: upload_policy_request
|
|
27
|
+
|
|
28
|
+
- id: uploaddragger_custom_title
|
|
29
|
+
type: UploadDragger
|
|
30
|
+
properties:
|
|
31
|
+
uploadPolicyRequestId: upload_policy_request
|
|
32
|
+
title: Drop your files here
|
|
33
|
+
|
|
34
|
+
# ============================================
|
|
35
|
+
# PROPERTY TESTS
|
|
36
|
+
# ============================================
|
|
37
|
+
|
|
38
|
+
- id: uploaddragger_disabled
|
|
39
|
+
type: UploadDragger
|
|
40
|
+
properties:
|
|
41
|
+
uploadPolicyRequestId: upload_policy_request
|
|
42
|
+
disabled: true
|
|
43
|
+
|
|
44
|
+
# ============================================
|
|
45
|
+
# EMIT FILE CONTENT
|
|
46
|
+
# ============================================
|
|
47
|
+
|
|
48
|
+
- id: uploaddragger_emit
|
|
49
|
+
type: UploadDragger
|
|
50
|
+
properties:
|
|
51
|
+
emitFileContent: true
|
|
52
|
+
singleFile: true
|
|
53
|
+
events:
|
|
54
|
+
onChange:
|
|
55
|
+
- id: set_emitted_drop
|
|
56
|
+
type: SetState
|
|
57
|
+
params:
|
|
58
|
+
emitted_drop:
|
|
59
|
+
_event: file
|
|
60
|
+
|
|
61
|
+
- id: emit_drop_display
|
|
62
|
+
type: Span
|
|
63
|
+
properties:
|
|
64
|
+
content:
|
|
65
|
+
_if:
|
|
66
|
+
test:
|
|
67
|
+
_ne:
|
|
68
|
+
- _state: emitted_drop.name
|
|
69
|
+
- null
|
|
70
|
+
then:
|
|
71
|
+
_string.concat:
|
|
72
|
+
- 'Name: '
|
|
73
|
+
- _state: emitted_drop.name
|
|
74
|
+
else: ''
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
- title: Basic
|
|
16
|
+
blocks:
|
|
17
|
+
- id: basic_default
|
|
18
|
+
type: UploadPhoto
|
|
19
|
+
properties:
|
|
20
|
+
uploadPolicyRequestId: upload_policy_request
|
|
21
|
+
- id: basic_custom_title
|
|
22
|
+
type: UploadPhoto
|
|
23
|
+
properties:
|
|
24
|
+
uploadPolicyRequestId: upload_policy_request
|
|
25
|
+
title: Add Photo
|
|
26
|
+
|
|
27
|
+
- title: Upload Limits
|
|
28
|
+
blocks:
|
|
29
|
+
- id: limit_single
|
|
30
|
+
type: UploadPhoto
|
|
31
|
+
properties:
|
|
32
|
+
uploadPolicyRequestId: upload_policy_request
|
|
33
|
+
singleFile: true
|
|
34
|
+
- id: limit_max_three
|
|
35
|
+
type: UploadPhoto
|
|
36
|
+
properties:
|
|
37
|
+
uploadPolicyRequestId: upload_policy_request
|
|
38
|
+
maxCount: 3
|
|
39
|
+
|
|
40
|
+
- title: Emit File Content
|
|
41
|
+
blocks:
|
|
42
|
+
- id: emit_file_content
|
|
43
|
+
type: UploadPhoto
|
|
44
|
+
properties:
|
|
45
|
+
emitFileContent: true
|
|
46
|
+
singleFile: true
|
|
47
|
+
|
|
48
|
+
- title: Disabled State
|
|
49
|
+
blocks:
|
|
50
|
+
- id: disabled_default
|
|
51
|
+
type: UploadPhoto
|
|
52
|
+
properties:
|
|
53
|
+
uploadPolicyRequestId: upload_policy_request
|
|
54
|
+
disabled: true
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
id: uploadphoto
|
|
16
|
+
type: Box
|
|
17
|
+
|
|
18
|
+
blocks:
|
|
19
|
+
# ============================================
|
|
20
|
+
# BASIC RENDERING
|
|
21
|
+
# ============================================
|
|
22
|
+
|
|
23
|
+
- id: uploadphoto_basic
|
|
24
|
+
type: UploadPhoto
|
|
25
|
+
properties:
|
|
26
|
+
uploadPolicyRequestId: upload_policy_request
|
|
27
|
+
|
|
28
|
+
- id: uploadphoto_custom_title
|
|
29
|
+
type: UploadPhoto
|
|
30
|
+
properties:
|
|
31
|
+
uploadPolicyRequestId: upload_policy_request
|
|
32
|
+
title: Add Photo
|
|
33
|
+
|
|
34
|
+
# ============================================
|
|
35
|
+
# PROPERTY TESTS
|
|
36
|
+
# ============================================
|
|
37
|
+
|
|
38
|
+
- id: uploadphoto_disabled
|
|
39
|
+
type: UploadPhoto
|
|
40
|
+
properties:
|
|
41
|
+
uploadPolicyRequestId: upload_policy_request
|
|
42
|
+
disabled: true
|
|
43
|
+
|
|
44
|
+
# ============================================
|
|
45
|
+
# EMIT FILE CONTENT
|
|
46
|
+
# ============================================
|
|
47
|
+
|
|
48
|
+
- id: uploadphoto_emit
|
|
49
|
+
type: UploadPhoto
|
|
50
|
+
properties:
|
|
51
|
+
emitFileContent: true
|
|
52
|
+
singleFile: true
|
|
53
|
+
events:
|
|
54
|
+
onChange:
|
|
55
|
+
- id: set_emitted_photo
|
|
56
|
+
type: SetState
|
|
57
|
+
params:
|
|
58
|
+
emitted_photo:
|
|
59
|
+
_event: file
|
|
60
|
+
|
|
61
|
+
- id: emit_photo_display
|
|
62
|
+
type: Span
|
|
63
|
+
properties:
|
|
64
|
+
content:
|
|
65
|
+
_if:
|
|
66
|
+
test:
|
|
67
|
+
_ne:
|
|
68
|
+
- _state: emitted_photo.name
|
|
69
|
+
- null
|
|
70
|
+
then:
|
|
71
|
+
_string.concat:
|
|
72
|
+
- 'Name: '
|
|
73
|
+
- _state: emitted_photo.name
|
|
74
|
+
else: ''
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/blocks-files",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lowdefy provider-neutral file upload and download blocks.",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"dist/*"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@lowdefy/block-utils": "
|
|
43
|
-
"@lowdefy/blocks-antd": "
|
|
44
|
-
"@lowdefy/errors": "
|
|
45
|
-
"@lowdefy/helpers": "
|
|
42
|
+
"@lowdefy/block-utils": "6.0.0",
|
|
43
|
+
"@lowdefy/blocks-antd": "6.0.0",
|
|
44
|
+
"@lowdefy/errors": "6.0.0",
|
|
45
|
+
"@lowdefy/helpers": "6.0.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"antd": ">=6",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"react-dom": ">=18"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@lowdefy/block-dev-e2e": "
|
|
54
|
-
"@lowdefy/e2e-utils": "
|
|
53
|
+
"@lowdefy/block-dev-e2e": "6.0.0",
|
|
54
|
+
"@lowdefy/e2e-utils": "6.0.0",
|
|
55
55
|
"@playwright/test": "1.59.1",
|
|
56
56
|
"@swc/cli": "0.8.1",
|
|
57
57
|
"@swc/core": "1.15.32",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --cli-config-file ../../../../.swc-cli.json && pnpm copyfiles",
|
|
65
65
|
"clean": "rm -rf dist",
|
|
66
|
-
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.
|
|
66
|
+
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.snap\"",
|
|
67
67
|
"e2e": "playwright test --config e2e/playwright.config.js",
|
|
68
68
|
"e2e:ui": "playwright test --config e2e/playwright.config.js --ui"
|
|
69
69
|
}
|