@lowdefy/blocks-basic 0.0.0-experimental-20260720072521 → 0.0.0-experimental-20260720135014

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.
Files changed (33) hide show
  1. package/dist/blocks.js +0 -1
  2. package/dist/e2e.js +0 -1
  3. package/dist/metas.js +0 -1
  4. package/package.json +10 -10
  5. package/dist/blocks/Anchor/gallery.yaml +0 -316
  6. package/dist/blocks/Anchor/tests/Anchor.e2e.yaml +0 -78
  7. package/dist/blocks/Anchor/tests.yaml +0 -109
  8. package/dist/blocks/Box/gallery.yaml +0 -1369
  9. package/dist/blocks/Box/tests/Box.e2e.yaml +0 -78
  10. package/dist/blocks/Box/tests.yaml +0 -43
  11. package/dist/blocks/DangerousHtml/gallery.yaml +0 -182
  12. package/dist/blocks/DangerousHtml/tests/DangerousHtml.e2e.yaml +0 -33
  13. package/dist/blocks/DangerousHtml/tests.yaml +0 -83
  14. package/dist/blocks/Dynamic/Dynamic.js +0 -35
  15. package/dist/blocks/Dynamic/e2e.js +0 -16
  16. package/dist/blocks/Dynamic/meta.js +0 -76
  17. package/dist/blocks/Html/gallery.yaml +0 -239
  18. package/dist/blocks/Html/tests/Html.e2e.yaml +0 -56
  19. package/dist/blocks/Html/tests.yaml +0 -75
  20. package/dist/blocks/Icon/gallery.yaml +0 -702
  21. package/dist/blocks/Icon/tests/Icon.e2e.yaml +0 -43
  22. package/dist/blocks/Icon/tests.yaml +0 -54
  23. package/dist/blocks/Img/gallery.yaml +0 -446
  24. package/dist/blocks/Img/tests/Img.e2e.yaml +0 -61
  25. package/dist/blocks/Img/tests.yaml +0 -74
  26. package/dist/blocks/List/gallery.yaml +0 -523
  27. package/dist/blocks/List/tests/List.e2e.yaml +0 -199
  28. package/dist/blocks/List/tests.yaml +0 -471
  29. package/dist/blocks/Span/gallery.yaml +0 -664
  30. package/dist/blocks/Span/tests/Span.e2e.yaml +0 -59
  31. package/dist/blocks/Span/tests.yaml +0 -43
  32. package/dist/blocks/Throw/gallery.yaml +0 -40
  33. package/dist/blocks/Throw/tests.yaml +0 -20
@@ -1,78 +0,0 @@
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: box
16
- type: Box
17
- properties:
18
- style:
19
- padding: 20px
20
-
21
- blocks:
22
- # Test 1: Basic Box renders
23
- - id: box_basic
24
- type: Box
25
-
26
- # Test 2: Box with content property
27
- - id: box_content
28
- type: Box
29
- properties:
30
- content: Hello from Box
31
-
32
- # Test 3: Box with style property
33
- - id: box_styled
34
- type: Box
35
- properties:
36
- content: Styled Box
37
- style:
38
- backgroundColor: rgb(0, 128, 255)
39
- color: white
40
- padding: 10px
41
-
42
- # Test 4: Box with nested child block
43
- - id: box_with_children
44
- type: Box
45
- blocks:
46
- - id: child_span
47
- type: Span
48
- properties:
49
- content: Child content
50
-
51
- # Test 5: Box with dotted block ID (regression test for CSS selector escaping)
52
- - id: form.field.name
53
- type: Box
54
- properties:
55
- content: Dotted ID Box
56
-
57
- # Test 6: Box with onClick event using SetState
58
- - id: box_clickable
59
- type: Box
60
- properties:
61
- content:
62
- _if:
63
- test:
64
- _eq:
65
- - _state: clicked
66
- - true
67
- then: Clicked!
68
- else: Click me
69
- style:
70
- cursor: pointer
71
- padding: 10px
72
- border: 1px solid gray
73
- events:
74
- onClick:
75
- - id: set_clicked
76
- type: SetState
77
- params:
78
- clicked: true
@@ -1,43 +0,0 @@
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: default
16
- type: Box
17
- - id: properties.content
18
- type: Box
19
- properties:
20
- content: Foo
21
- - id: properties.style
22
- type: Box
23
- properties:
24
- style:
25
- border: '1px solid blue'
26
- - id: areas.content
27
- type: Box
28
- areas:
29
- content:
30
- blocks:
31
- - id: testArea
32
- type: Test
33
- - id: events.onClick
34
- type: Box
35
- areas:
36
- content:
37
- blocks:
38
- - id: testArea
39
- type: Test
40
- events:
41
- onClick:
42
- - id: testAction
43
- type: Text
@@ -1,182 +0,0 @@
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 HTML
16
- blocks:
17
- - id: basic_paragraph
18
- type: DangerousHtml
19
- properties:
20
- html: '<p>This is a basic paragraph rendered as HTML.</p>'
21
- - id: basic_heading
22
- type: DangerousHtml
23
- properties:
24
- html: '<h3>Heading rendered with DangerousHtml</h3>'
25
- - id: basic_link
26
- type: DangerousHtml
27
- properties:
28
- html: '<p>Visit <a href="https://lowdefy.com" target="_blank" rel="noopener noreferrer">Lowdefy</a> for more info.</p>'
29
- - id: basic_multiple_headings
30
- type: DangerousHtml
31
- properties:
32
- html: '<h4>Section Title</h4><p>Some paragraph text below the heading.</p><h5>Sub-section</h5><p>More text in the sub-section.</p>'
33
-
34
- - title: Styled HTML
35
- blocks:
36
- - id: styled_colored
37
- type: DangerousHtml
38
- properties:
39
- html: '<p style="color: var(--ant-color-primary); font-weight: bold; font-size: 18px;">Blue bold text with inline styles</p>'
40
- - id: styled_box_success
41
- type: DangerousHtml
42
- properties:
43
- html: '<div style="padding: 16px; background-color: var(--ant-color-success-bg); border: 1px solid var(--ant-color-success-border); border-radius: 6px;"><strong>Success:</strong> Your changes have been saved.</div>'
44
- - id: styled_box_warning
45
- type: DangerousHtml
46
- properties:
47
- html: '<div style="padding: 16px; background-color: var(--ant-color-warning-bg); border: 1px solid var(--ant-color-warning-border); border-radius: 6px;"><strong>Warning:</strong> Please review your settings before proceeding.</div>'
48
- - id: styled_box_error
49
- type: DangerousHtml
50
- properties:
51
- html: '<div style="padding: 16px; background-color: var(--ant-color-error-bg); border: 1px solid var(--ant-color-error-border); border-radius: 6px;"><strong>Error:</strong> Unable to complete the operation.</div>'
52
- - id: styled_box_info
53
- type: DangerousHtml
54
- properties:
55
- html: '<div style="padding: 16px; background-color: var(--ant-color-info-bg); border: 1px solid var(--ant-color-info-border); border-radius: 6px;"><strong>Info:</strong> The system will undergo maintenance at midnight.</div>'
56
-
57
- - title: Lists
58
- blocks:
59
- - id: list_unordered
60
- type: DangerousHtml
61
- properties:
62
- html: '<ul style="list-style-type: disc; padding-left: 20px;"><li>First item</li><li>Second item</li><li>Third item</li></ul>'
63
- - id: list_ordered
64
- type: DangerousHtml
65
- properties:
66
- html: '<ol style="padding-left: 20px;"><li>Step one</li><li>Step two</li><li>Step three</li></ol>'
67
- - id: list_colored
68
- type: DangerousHtml
69
- properties:
70
- html: '<ul style="list-style-type: disc; padding-left: 20px;"><li style="color: var(--ant-color-success);">Completed</li><li style="color: var(--ant-color-warning);">In Progress</li><li style="color: var(--ant-color-error);">Overdue</li></ul>'
71
- - id: list_nested
72
- type: DangerousHtml
73
- properties:
74
- html: '<ul style="padding-left: 20px;"><li>Parent item<ul style="padding-left: 20px;"><li>Child item 1</li><li>Child item 2</li></ul></li><li>Another parent item</li></ul>'
75
- - id: list_definition
76
- type: DangerousHtml
77
- properties:
78
- html: '<dl><dt style="font-weight: bold;">Term 1</dt><dd style="margin-left: 20px; color: var(--ant-color-text-secondary);">Definition of the first term.</dd><dt style="font-weight: bold;">Term 2</dt><dd style="margin-left: 20px; color: var(--ant-color-text-secondary);">Definition of the second term.</dd></dl>'
79
-
80
- - title: HTML Table
81
- blocks:
82
- - id: table_simple
83
- type: DangerousHtml
84
- properties:
85
- html: '<table style="width: 100%; border-collapse: collapse;"><thead><tr><th style="border: 1px solid var(--ant-color-border); padding: 8px; background: var(--ant-color-fill-quaternary); text-align: left;">Name</th><th style="border: 1px solid var(--ant-color-border); padding: 8px; background: var(--ant-color-fill-quaternary); text-align: left;">Role</th><th style="border: 1px solid var(--ant-color-border); padding: 8px; background: var(--ant-color-fill-quaternary); text-align: left;">Status</th></tr></thead><tbody><tr><td style="border: 1px solid var(--ant-color-border); padding: 8px;">Alice</td><td style="border: 1px solid var(--ant-color-border); padding: 8px;">Developer</td><td style="border: 1px solid var(--ant-color-border); padding: 8px;">Active</td></tr><tr><td style="border: 1px solid var(--ant-color-border); padding: 8px;">Bob</td><td style="border: 1px solid var(--ant-color-border); padding: 8px;">Designer</td><td style="border: 1px solid var(--ant-color-border); padding: 8px;">Active</td></tr><tr><td style="border: 1px solid var(--ant-color-border); padding: 8px;">Charlie</td><td style="border: 1px solid var(--ant-color-border); padding: 8px;">Manager</td><td style="border: 1px solid var(--ant-color-border); padding: 8px;">Away</td></tr></tbody></table>'
86
- - id: table_striped
87
- type: DangerousHtml
88
- properties:
89
- html: '<table style="width: 100%; border-collapse: collapse;"><thead><tr><th style="border: 1px solid var(--ant-color-border); padding: 10px; background: var(--ant-color-primary); color: white; text-align: left;">Product</th><th style="border: 1px solid var(--ant-color-border); padding: 10px; background: var(--ant-color-primary); color: white; text-align: right;">Price</th><th style="border: 1px solid var(--ant-color-border); padding: 10px; background: var(--ant-color-primary); color: white; text-align: center;">Stock</th></tr></thead><tbody><tr><td style="border: 1px solid var(--ant-color-border); padding: 10px;">Widget A</td><td style="border: 1px solid var(--ant-color-border); padding: 10px; text-align: right;">$29.99</td><td style="border: 1px solid var(--ant-color-border); padding: 10px; text-align: center;">150</td></tr><tr style="background: var(--ant-color-fill-quaternary);"><td style="border: 1px solid var(--ant-color-border); padding: 10px;">Widget B</td><td style="border: 1px solid var(--ant-color-border); padding: 10px; text-align: right;">$49.99</td><td style="border: 1px solid var(--ant-color-border); padding: 10px; text-align: center;">85</td></tr><tr><td style="border: 1px solid var(--ant-color-border); padding: 10px;">Widget C</td><td style="border: 1px solid var(--ant-color-border); padding: 10px; text-align: right;">$19.99</td><td style="border: 1px solid var(--ant-color-border); padding: 10px; text-align: center;">320</td></tr></tbody></table>'
90
-
91
- - title: Embedded Media Placeholders
92
- blocks:
93
- - id: media_video_placeholder
94
- type: DangerousHtml
95
- properties:
96
- html: '<div style="width: 100%; max-width: 560px; aspect-ratio: 16/9; background: var(--ant-color-fill-tertiary); border: 2px dashed var(--ant-color-border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--ant-color-text-tertiary); font-size: 16px;">Video Placeholder (16:9)</div>'
97
- - id: media_iframe_placeholder
98
- type: DangerousHtml
99
- properties:
100
- html: '<div style="width: 100%; max-width: 400px; height: 300px; background: var(--ant-color-fill-quaternary); border: 2px dashed var(--ant-color-border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--ant-color-text-tertiary);">Embedded Content Area</div>'
101
-
102
- - title: Complex Layout
103
- blocks:
104
- - id: layout_card
105
- type: DangerousHtml
106
- properties:
107
- html: '<div style="max-width: 400px; border: 1px solid var(--ant-color-border); border-radius: 8px; overflow: hidden;"><div style="padding: 16px; background: var(--ant-color-fill-quaternary); border-bottom: 1px solid var(--ant-color-border);"><h4 style="margin: 0;">Card Title</h4></div><div style="padding: 16px;"><p style="margin: 0 0 12px 0; color: var(--ant-color-text-secondary);">This is a card-like layout created purely with HTML and inline styles.</p><div style="display: flex; gap: 8px;"><span style="background: var(--ant-color-primary-bg); color: var(--ant-color-primary); padding: 2px 8px; border-radius: 4px; font-size: 12px;">Tag 1</span><span style="background: var(--ant-color-success-bg); color: var(--ant-color-success); padding: 2px 8px; border-radius: 4px; font-size: 12px;">Tag 2</span></div></div></div>'
108
- - id: layout_flex_row
109
- type: DangerousHtml
110
- properties:
111
- html: '<div style="display: flex; gap: 16px; flex-wrap: wrap;"><div style="flex: 1; min-width: 150px; padding: 16px; background: var(--ant-color-primary-bg); border-radius: 8px; text-align: center;"><div style="font-size: 24px; font-weight: bold; color: var(--ant-color-primary);">42</div><div style="color: var(--ant-color-text-secondary); font-size: 12px;">Active Users</div></div><div style="flex: 1; min-width: 150px; padding: 16px; background: var(--ant-color-success-bg); border-radius: 8px; text-align: center;"><div style="font-size: 24px; font-weight: bold; color: var(--ant-color-success);">128</div><div style="color: var(--ant-color-text-secondary); font-size: 12px;">Completed</div></div><div style="flex: 1; min-width: 150px; padding: 16px; background: var(--ant-color-warning-bg); border-radius: 8px; text-align: center;"><div style="font-size: 24px; font-weight: bold; color: var(--ant-color-warning);">7</div><div style="color: var(--ant-color-text-secondary); font-size: 12px;">Pending</div></div></div>'
112
- - id: layout_timeline
113
- type: DangerousHtml
114
- properties:
115
- html: '<div style="padding-left: 20px; border-left: 2px solid var(--ant-color-primary);"><div style="position: relative; padding-bottom: 16px;"><div style="position: absolute; left: -26px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ant-color-primary);"></div><div style="font-weight: bold;">Step 1: Setup</div><div style="color: var(--ant-color-text-secondary); font-size: 13px;">Configure your project settings.</div></div><div style="position: relative; padding-bottom: 16px;"><div style="position: absolute; left: -26px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ant-color-primary);"></div><div style="font-weight: bold;">Step 2: Build</div><div style="color: var(--ant-color-text-secondary); font-size: 13px;">Run the build pipeline.</div></div><div style="position: relative;"><div style="position: absolute; left: -26px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ant-color-border);"></div><div style="font-weight: bold; color: var(--ant-color-text-tertiary);">Step 3: Deploy</div><div style="color: var(--ant-color-text-quaternary); font-size: 13px;">Deploy to production.</div></div></div>'
116
-
117
- - title: DOMPurify Options
118
- blocks:
119
- - id: purify_default_label
120
- type: Markdown
121
- properties:
122
- content: '**Default (scripts and event handlers stripped):**'
123
- - id: purify_default
124
- type: DangerousHtml
125
- properties:
126
- html: '<p>Safe content rendered. <script>alert("removed")</script></p>'
127
- - id: purify_allow_target_label
128
- type: Markdown
129
- properties:
130
- content: '**With ADD_ATTR to allow target attribute:**'
131
- - id: purify_allow_target
132
- type: DangerousHtml
133
- properties:
134
- html: '<a href="https://lowdefy.com" target="_blank">Link with target=_blank allowed</a>'
135
- DOMPurifyOptions:
136
- ADD_ATTR:
137
- - target
138
-
139
- - title: Style Overrides
140
- blocks:
141
- - id: style_padded
142
- type: DangerousHtml
143
- style:
144
- .element:
145
- padding: 20
146
- background: var(--ant-color-fill-quaternary)
147
- borderRadius: 8
148
- border: 1px solid var(--ant-color-border)
149
- properties:
150
- html: '<p style="margin: 0;">Content inside a styled DangerousHtml container with padding and background.</p>'
151
- - id: style_max_width
152
- type: DangerousHtml
153
- style:
154
- .element:
155
- maxWidth: 400
156
- margin: 0 auto
157
- padding: 16
158
- background: var(--ant-color-primary-bg)
159
- borderRadius: 8
160
- textAlign: center
161
- properties:
162
- html: '<p style="margin: 0; color: var(--ant-color-primary); font-weight: bold;">Centered container with max-width constraint.</p>'
163
- - id: style_shadow
164
- type: DangerousHtml
165
- style:
166
- .element:
167
- padding: 20
168
- borderRadius: 12
169
- boxShadow: var(--ant-box-shadow)
170
- background: var(--ant-color-bg-container)
171
- properties:
172
- html: '<h4 style="margin: 0 0 8px 0;">Elevated Card</h4><p style="margin: 0; color: var(--ant-color-text-secondary);">A DangerousHtml block styled with a box shadow for an elevated card appearance.</p>'
173
- - id: style_border_left
174
- type: DangerousHtml
175
- style:
176
- .element:
177
- borderLeft: 4px solid var(--ant-color-primary)
178
- paddingLeft: 16
179
- paddingTop: 8
180
- paddingBottom: 8
181
- properties:
182
- html: '<p style="margin: 0; color: var(--ant-color-primary); font-weight: 500;">Highlighted with a primary color left border accent.</p>'
@@ -1,33 +0,0 @@
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: dangeroushtml
16
- type: Box
17
-
18
- blocks:
19
- - id: dangeroushtml_basic
20
- type: DangerousHtml
21
- properties:
22
- html: <p>Basic dangerous HTML content</p>
23
-
24
- - id: dangeroushtml_iframe
25
- type: DangerousHtml
26
- properties:
27
- html: <iframe src="about:blank" title="Test iframe"></iframe>
28
- DOMPurifyOptions:
29
- ADD_TAGS:
30
- - iframe
31
- ADD_ATTR:
32
- - src
33
- - title
@@ -1,83 +0,0 @@
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: default
16
- type: DangerousHtml
17
- - id: properties.html
18
- type: Html
19
- properties:
20
- html: |
21
- <div style="background: green; padding: 10px;">Content green background</div>
22
- - id: properties.style
23
- type: DangerousHtml
24
- properties:
25
- style:
26
- background: yellow
27
- padding: 10
28
- html: |
29
- <div>properties.style yellow background</div>
30
- - id: properties.html-styled
31
- type: DangerousHtml
32
- properties:
33
- style:
34
- background: yellow
35
- padding: 10
36
- html: |
37
- <div style="background: green; padding: 10px;">Content green background and properties.style yellow background</div>
38
- - id: properties.html-iframe
39
- type: DangerousHtml
40
- properties:
41
- html: |
42
- No additional ADD_TAGS:
43
- <iframe width="560" height="315" src="https://www.youtube.com/embed/7N7GWdlQJlU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
44
- - id: properties.html-DOMPurifyOptions.ADD_TAGS-iframe
45
- type: DangerousHtml
46
- properties:
47
- DOMPurifyOptions:
48
- ADD_TAGS:
49
- - iframe
50
- html: |
51
- With iframe ADD_TAGS:
52
- <iframe width="560" height="315" src="https://www.youtube.com/embed/7N7GWdlQJlU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
53
- - id: properties.html-bad-code
54
- type: DangerousHtml
55
- properties:
56
- html: |
57
- <h1>Link<h1>
58
-
59
- <a href="https://lowdefy.com">Lowdefy link</a>
60
-
61
- <font size="+10">Description</font>
62
-
63
- <h1>Bad HTML</h1>
64
-
65
- <div onmouseover="alert('alpha')">
66
- <a href="javascript:alert('bravo')">delta</a>
67
- <img src="x" onerror="alert('charlie')">
68
- <iframe src="javascript:alert('delta')"></iframe>
69
- <math>
70
- <mi xlink:href="data:x,<script>alert('echo')</script>"></mi>
71
- </math>
72
- </div>
73
- <script>
74
- alert('script tag');
75
- </script>
76
- - id: properties.html is number 0
77
- type: DangerousHtml
78
- properties:
79
- html: 0
80
- - id: properties.html is boolean false
81
- type: DangerousHtml
82
- properties:
83
- html: false
@@ -1,35 +0,0 @@
1
- /*
2
- Copyright 2020-2026 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ import React from 'react';
16
- import { withBlockDefaults } from '@lowdefy/block-utils';
17
- // Server-resolved container. The server fills the content slot at page get by
18
- // calling the configured api endpoint — by the time config reaches the client,
19
- // content holds the resolved blocks (or the fallback blocks on failure).
20
- const Dynamic = ({ blockId, classNames, content, events, methods, styles })=>{
21
- return /*#__PURE__*/ React.createElement("div", {
22
- id: blockId,
23
- "data-testid": blockId,
24
- onClick: ()=>methods.triggerEvent({
25
- name: 'onClick'
26
- }),
27
- className: classNames?.element,
28
- style: {
29
- outline: 'none',
30
- cursor: events.onClick && 'pointer',
31
- ...styles?.element
32
- }
33
- }, content.content && content.content());
34
- };
35
- export default withBlockDefaults(Dynamic);
@@ -1,16 +0,0 @@
1
- /*
2
- Copyright 2020-2026 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ // Dynamic renders a plain container div like Box — same e2e surface.
16
- export { default } from '../Box/e2e.js';
@@ -1,76 +0,0 @@
1
- /*
2
- Copyright 2020-2026 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- category: 'container',
17
- icons: [],
18
- valueType: null,
19
- slots: {
20
- content: 'Server-resolved blocks — filled at page get, do not define in config.',
21
- fallback: 'Blocks rendered when resolution fails and required is false.'
22
- },
23
- cssKeys: {
24
- element: 'The Dynamic element.'
25
- },
26
- events: {
27
- onClick: 'Trigger actions when the Dynamic container is clicked.'
28
- },
29
- properties: {
30
- type: 'object',
31
- additionalProperties: false,
32
- properties: {
33
- endpointId: {
34
- type: 'string',
35
- description: 'Required. The api endpoint that resolves this block content at page get. InternalApi endpoints are recommended.'
36
- },
37
- params: {
38
- type: 'object',
39
- description: 'Static values passed to the endpoint payload as params. Operators are not allowed — read runtime values in the endpoint routine with _payload, _user or _secret.'
40
- },
41
- required: {
42
- type: 'boolean',
43
- default: false,
44
- description: 'When true, a resolution failure fails the whole page request instead of rendering the fallback slot.'
45
- },
46
- types: {
47
- type: 'object',
48
- description: 'Extra block, action and operator types the endpoint may return, so build includes them in the client bundle.',
49
- additionalProperties: false,
50
- properties: {
51
- blocks: {
52
- type: 'array',
53
- items: {
54
- type: 'string'
55
- },
56
- description: 'Block types the endpoint may return.'
57
- },
58
- actions: {
59
- type: 'array',
60
- items: {
61
- type: 'string'
62
- },
63
- description: 'Action types the endpoint may return.'
64
- },
65
- operators: {
66
- type: 'array',
67
- items: {
68
- type: 'string'
69
- },
70
- description: 'Client operator types the endpoint may return.'
71
- }
72
- }
73
- }
74
- }
75
- }
76
- };