@lowdefy/blocks-basic 6.0.0 → 7.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/Anchor/Anchor.js +1 -1
- package/dist/blocks/Anchor/gallery.yaml +14 -14
- package/dist/blocks/Anchor/meta.js +11 -2
- package/dist/blocks/Anchor/tests/Anchor.e2e.yaml +10 -1
- package/dist/blocks/Anchor/tests/AnchorPathTarget.e2e.yaml +23 -0
- package/dist/blocks/Anchor/tests.yaml +6 -6
- package/dist/blocks/Box/Box.js +9 -5
- package/dist/blocks/Box/gallery.yaml +9 -9
- package/dist/blocks/Box/tests/Box.e2e.yaml +62 -0
- package/dist/blocks/Box/tests/BoxPageTitle.e2e.yaml +57 -0
- package/dist/blocks/ClickableHtml/ClickableHtml.js +34 -0
- package/dist/blocks/ClickableHtml/e2e.js +23 -0
- package/dist/blocks/ClickableHtml/gallery.yaml +199 -0
- package/dist/blocks/ClickableHtml/meta.js +96 -0
- package/dist/blocks/ClickableHtml/tests/ClickableHtml.e2e.yaml +188 -0
- package/dist/blocks/ClickableHtml/tests.yaml +48 -0
- package/dist/blocks/DangerousHtml/DangerousHtml.js +19 -19
- package/dist/blocks/DangerousHtml/meta.js +13 -1
- package/dist/blocks/Dynamic/Dynamic.js +5 -3
- package/dist/blocks/Dynamic/meta.js +4 -0
- package/dist/blocks/Html/gallery.yaml +28 -0
- package/dist/blocks/Html/meta.js +23 -1
- package/dist/blocks/Html/tests/Html.e2e.yaml +13 -0
- package/dist/blocks/Icon/Icon.js +21 -1
- package/dist/blocks/Icon/gallery.yaml +158 -64
- package/dist/blocks/Icon/meta.js +11 -4
- package/dist/blocks/Icon/tests/Icon.e2e.yaml +3 -3
- package/dist/blocks/Icon/tests.yaml +7 -7
- package/dist/blocks/Img/meta.js +12 -4
- package/dist/blocks/List/gallery.yaml +11 -11
- package/dist/blocks/PollingTimer/PollingTimer.js +120 -0
- package/dist/blocks/PollingTimer/e2e.js +21 -0
- package/dist/blocks/PollingTimer/gallery.yaml +190 -0
- package/dist/blocks/PollingTimer/meta.js +61 -0
- package/dist/blocks/PollingTimer/validateInterval.js +21 -0
- package/dist/blocks/Span/Span.js +5 -3
- package/dist/blocks/Span/gallery.yaml +7 -7
- package/dist/blocks.js +2 -0
- package/dist/e2e.js +2 -0
- package/dist/metas.js +2 -0
- package/package.json +9 -6
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
properties:
|
|
69
69
|
title: Link with Icon
|
|
70
70
|
url: https://lowdefy.com
|
|
71
|
-
icon:
|
|
71
|
+
icon: link
|
|
72
72
|
- id: icon_download
|
|
73
73
|
type: Anchor
|
|
74
74
|
layout:
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
properties:
|
|
77
77
|
title: Download
|
|
78
78
|
url: https://lowdefy.com
|
|
79
|
-
icon:
|
|
79
|
+
icon: download
|
|
80
80
|
- id: icon_external
|
|
81
81
|
type: Anchor
|
|
82
82
|
layout:
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
properties:
|
|
85
85
|
title: External Link
|
|
86
86
|
url: https://lowdefy.com
|
|
87
|
-
icon:
|
|
87
|
+
icon: SquareArrowOutUpRight
|
|
88
88
|
- id: icon_mail
|
|
89
89
|
type: Anchor
|
|
90
90
|
layout:
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
properties:
|
|
93
93
|
title: Send Email
|
|
94
94
|
url: https://lowdefy.com
|
|
95
|
-
icon:
|
|
95
|
+
icon: mail
|
|
96
96
|
- id: icon_github
|
|
97
97
|
type: Anchor
|
|
98
98
|
layout:
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
properties:
|
|
101
101
|
title: GitHub
|
|
102
102
|
url: https://github.com/lowdefy/lowdefy
|
|
103
|
-
icon:
|
|
103
|
+
icon: GitBranch
|
|
104
104
|
- id: icon_object
|
|
105
105
|
type: Anchor
|
|
106
106
|
layout:
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
title: Colored Icon
|
|
110
110
|
url: https://lowdefy.com
|
|
111
111
|
icon:
|
|
112
|
-
name:
|
|
112
|
+
name: heart
|
|
113
113
|
color: '#ff4d4f'
|
|
114
114
|
|
|
115
115
|
- title: New Tab
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
title: External Docs
|
|
131
131
|
url: https://docs.lowdefy.com
|
|
132
132
|
newTab: true
|
|
133
|
-
icon:
|
|
133
|
+
icon: SquareArrowOutUpRight
|
|
134
134
|
|
|
135
135
|
- title: Disabled
|
|
136
136
|
blocks:
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
title: Disabled with Icon
|
|
151
151
|
url: https://lowdefy.com
|
|
152
152
|
disabled: true
|
|
153
|
-
icon:
|
|
153
|
+
icon: lock
|
|
154
154
|
- id: enabled_link
|
|
155
155
|
type: Anchor
|
|
156
156
|
layout:
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
title: Enabled Link
|
|
160
160
|
url: https://lowdefy.com
|
|
161
161
|
disabled: false
|
|
162
|
-
icon:
|
|
162
|
+
icon: unlock
|
|
163
163
|
|
|
164
164
|
- title: Aria Label
|
|
165
165
|
blocks:
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
flex: 0 0 auto
|
|
178
178
|
properties:
|
|
179
179
|
url: https://lowdefy.com
|
|
180
|
-
icon:
|
|
180
|
+
icon: home
|
|
181
181
|
ariaLabel: Go to home page
|
|
182
182
|
|
|
183
183
|
- title: Rel Attribute
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
properties:
|
|
210
210
|
title: Go Back
|
|
211
211
|
back: true
|
|
212
|
-
icon:
|
|
212
|
+
icon: arrow-left
|
|
213
213
|
- id: nav_home
|
|
214
214
|
type: Anchor
|
|
215
215
|
layout:
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
properties:
|
|
218
218
|
title: Go Home
|
|
219
219
|
home: true
|
|
220
|
-
icon:
|
|
220
|
+
icon: home
|
|
221
221
|
|
|
222
222
|
- title: Keyboard Shortcuts
|
|
223
223
|
blocks:
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
properties:
|
|
229
229
|
title: Documentation
|
|
230
230
|
url: https://docs.lowdefy.com
|
|
231
|
-
icon:
|
|
231
|
+
icon: Book
|
|
232
232
|
events:
|
|
233
233
|
onClick:
|
|
234
234
|
shortcut: mod+shift+d
|
|
@@ -313,4 +313,4 @@
|
|
|
313
313
|
properties:
|
|
314
314
|
title: Large Red Link
|
|
315
315
|
url: https://lowdefy.com
|
|
316
|
-
icon:
|
|
316
|
+
icon: heart
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ export default {
|
|
16
16
|
category: 'display',
|
|
17
17
|
icons: [
|
|
18
|
-
'
|
|
18
|
+
'loading'
|
|
19
19
|
],
|
|
20
20
|
valueType: null,
|
|
21
21
|
cssKeys: {
|
|
@@ -55,6 +55,13 @@
|
|
|
55
55
|
displayType: 'yaml'
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
+
pathParams: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
description: "Values for the placeholders in the path of the page given by pageId, like `{ ticket_id: '1234' }` for `tickets/{ticket_id}`.",
|
|
61
|
+
docs: {
|
|
62
|
+
displayType: 'yaml'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
58
65
|
disabled: {
|
|
59
66
|
type: 'boolean',
|
|
60
67
|
default: false,
|
|
@@ -65,7 +72,7 @@
|
|
|
65
72
|
'string',
|
|
66
73
|
'object'
|
|
67
74
|
],
|
|
68
|
-
description:
|
|
75
|
+
description: 'Icon name (a semantic name like `edit`, a Lucide icon name like `Pencil`, or a set-qualified name like `tabler:Pencil`) or properties of an Icon block for anchor icon.',
|
|
69
76
|
docs: {
|
|
70
77
|
displayType: 'icon'
|
|
71
78
|
}
|
|
@@ -76,10 +83,12 @@
|
|
|
76
83
|
},
|
|
77
84
|
href: {
|
|
78
85
|
type: 'string',
|
|
86
|
+
urlKind: 'href',
|
|
79
87
|
description: 'The href to link to when the anchor link is clicked.'
|
|
80
88
|
},
|
|
81
89
|
url: {
|
|
82
90
|
type: 'string',
|
|
91
|
+
urlKind: 'url',
|
|
83
92
|
description: 'External url to link to when the anchor link is clicked.'
|
|
84
93
|
},
|
|
85
94
|
rel: {
|
|
@@ -25,7 +25,7 @@ blocks:
|
|
|
25
25
|
type: Anchor
|
|
26
26
|
properties:
|
|
27
27
|
title: With Icon
|
|
28
|
-
icon:
|
|
28
|
+
icon: link
|
|
29
29
|
|
|
30
30
|
- id: anchor_disabled
|
|
31
31
|
type: Anchor
|
|
@@ -46,6 +46,15 @@ blocks:
|
|
|
46
46
|
href: https://lowdefy.com
|
|
47
47
|
newTab: true
|
|
48
48
|
|
|
49
|
+
- id: anchor_path_params
|
|
50
|
+
type: Anchor
|
|
51
|
+
properties:
|
|
52
|
+
title: Ticket
|
|
53
|
+
pageId: anchor-path-target
|
|
54
|
+
pathParams:
|
|
55
|
+
space: support
|
|
56
|
+
ticket_id: 1234
|
|
57
|
+
|
|
49
58
|
- id: anchor_clickable
|
|
50
59
|
type: Anchor
|
|
51
60
|
properties:
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
# The page with a patterned path that the pathParams link tests open.
|
|
16
|
+
id: anchor-path-target
|
|
17
|
+
path: anchor-tickets/{space}/{ticket_id}
|
|
18
|
+
type: Box
|
|
19
|
+
blocks:
|
|
20
|
+
- id: anchor_path_target
|
|
21
|
+
type: Span
|
|
22
|
+
properties:
|
|
23
|
+
content: Path target
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
- id: properties.icon string
|
|
22
22
|
type: Anchor
|
|
23
23
|
properties:
|
|
24
|
-
icon:
|
|
24
|
+
icon: Flame
|
|
25
25
|
- id: properties.icon object
|
|
26
26
|
type: Anchor
|
|
27
27
|
properties:
|
|
28
28
|
title: Click here
|
|
29
29
|
icon:
|
|
30
30
|
color: red
|
|
31
|
-
name:
|
|
31
|
+
name: Rocket
|
|
32
32
|
- id: properties.icon and properties.title
|
|
33
33
|
type: Anchor
|
|
34
34
|
properties:
|
|
35
|
-
icon:
|
|
35
|
+
icon: link
|
|
36
36
|
title: This is the anchor title
|
|
37
37
|
- id: properties.disabled
|
|
38
38
|
type: Anchor
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
- id: properties.icon, properties.title and properties.disabled
|
|
43
43
|
type: Anchor
|
|
44
44
|
properties:
|
|
45
|
-
icon:
|
|
45
|
+
icon: link
|
|
46
46
|
title: This is the anchor title
|
|
47
47
|
disabled: true
|
|
48
48
|
- id: properties.url
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
type: Anchor
|
|
93
93
|
properties:
|
|
94
94
|
title: Click here
|
|
95
|
-
icon:
|
|
95
|
+
icon: link
|
|
96
96
|
style:
|
|
97
97
|
color: green !important
|
|
98
98
|
fontSize: 8
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
loading: true
|
|
104
104
|
properties:
|
|
105
105
|
title: Click here
|
|
106
|
-
icon:
|
|
106
|
+
icon: link
|
|
107
107
|
style:
|
|
108
108
|
color: green !important
|
|
109
109
|
fontSize: 8
|
package/dist/blocks/Box/Box.js
CHANGED
|
@@ -13,17 +13,21 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
|
-
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
16
|
+
import { isEventFromDomDescendant, withBlockDefaults } from '@lowdefy/block-utils';
|
|
17
17
|
const Box = ({ blockId, classNames, content, events, methods, properties, styles })=>{
|
|
18
18
|
return /*#__PURE__*/ React.createElement("div", {
|
|
19
19
|
id: blockId,
|
|
20
20
|
"data-testid": blockId,
|
|
21
|
-
onClick: ()=>
|
|
21
|
+
onClick: (event)=>{
|
|
22
|
+
if (isEventFromDomDescendant(event)) methods.triggerEvent({
|
|
22
23
|
name: 'onClick'
|
|
23
|
-
})
|
|
24
|
-
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
onPaste: (event)=>{
|
|
27
|
+
if (isEventFromDomDescendant(event)) methods.triggerEvent({
|
|
25
28
|
name: 'onPaste'
|
|
26
|
-
})
|
|
29
|
+
});
|
|
30
|
+
},
|
|
27
31
|
className: classNames?.element,
|
|
28
32
|
style: {
|
|
29
33
|
outline: 'none',
|
|
@@ -896,7 +896,7 @@
|
|
|
896
896
|
layout:
|
|
897
897
|
flex: 0 0 auto
|
|
898
898
|
properties:
|
|
899
|
-
name:
|
|
899
|
+
name: Rocket
|
|
900
900
|
size: 32
|
|
901
901
|
color: '#1677ff'
|
|
902
902
|
- id: box_feature_a_title
|
|
@@ -918,7 +918,7 @@
|
|
|
918
918
|
layout:
|
|
919
919
|
flex: 0 0 auto
|
|
920
920
|
properties:
|
|
921
|
-
name:
|
|
921
|
+
name: Shield
|
|
922
922
|
size: 32
|
|
923
923
|
color: '#52c41a'
|
|
924
924
|
- id: box_feature_b_title
|
|
@@ -940,7 +940,7 @@
|
|
|
940
940
|
layout:
|
|
941
941
|
flex: 0 0 auto
|
|
942
942
|
properties:
|
|
943
|
-
name:
|
|
943
|
+
name: Plug
|
|
944
944
|
size: 32
|
|
945
945
|
color: '#722ed1'
|
|
946
946
|
- id: box_feature_c_title
|
|
@@ -1110,7 +1110,7 @@
|
|
|
1110
1110
|
layout:
|
|
1111
1111
|
flex: 0 0 auto
|
|
1112
1112
|
properties:
|
|
1113
|
-
name:
|
|
1113
|
+
name: check-circle
|
|
1114
1114
|
size: 20
|
|
1115
1115
|
color: '#52c41a'
|
|
1116
1116
|
- id: box_inbox_item_1_body
|
|
@@ -1147,7 +1147,7 @@
|
|
|
1147
1147
|
layout:
|
|
1148
1148
|
flex: 0 0 auto
|
|
1149
1149
|
properties:
|
|
1150
|
-
name:
|
|
1150
|
+
name: UserPlus
|
|
1151
1151
|
size: 20
|
|
1152
1152
|
color: '#1677ff'
|
|
1153
1153
|
- id: box_inbox_item_2_body
|
|
@@ -1184,7 +1184,7 @@
|
|
|
1184
1184
|
layout:
|
|
1185
1185
|
flex: 0 0 auto
|
|
1186
1186
|
properties:
|
|
1187
|
-
name:
|
|
1187
|
+
name: warning
|
|
1188
1188
|
size: 20
|
|
1189
1189
|
color: '#faad14'
|
|
1190
1190
|
- id: box_inbox_item_3_body
|
|
@@ -1247,7 +1247,7 @@
|
|
|
1247
1247
|
layout:
|
|
1248
1248
|
flex: 0 0 auto
|
|
1249
1249
|
properties:
|
|
1250
|
-
name:
|
|
1250
|
+
name: Gauge
|
|
1251
1251
|
size: 16
|
|
1252
1252
|
color: '#1677ff'
|
|
1253
1253
|
- id: box_sidebar_text_dashboard
|
|
@@ -1274,7 +1274,7 @@
|
|
|
1274
1274
|
layout:
|
|
1275
1275
|
flex: 0 0 auto
|
|
1276
1276
|
properties:
|
|
1277
|
-
name:
|
|
1277
|
+
name: SquareKanban
|
|
1278
1278
|
size: 16
|
|
1279
1279
|
color: rgba(128, 128, 128, 0.7)
|
|
1280
1280
|
- id: box_sidebar_text_projects
|
|
@@ -1301,7 +1301,7 @@
|
|
|
1301
1301
|
layout:
|
|
1302
1302
|
flex: 0 0 auto
|
|
1303
1303
|
properties:
|
|
1304
|
-
name:
|
|
1304
|
+
name: settings
|
|
1305
1305
|
size: 16
|
|
1306
1306
|
color: rgba(128, 128, 128, 0.7)
|
|
1307
1307
|
- id: box_sidebar_text_settings
|
|
@@ -76,3 +76,65 @@ blocks:
|
|
|
76
76
|
type: SetState
|
|
77
77
|
params:
|
|
78
78
|
clicked: true
|
|
79
|
+
|
|
80
|
+
# Test 7: nested clickable Boxes. The inner Box handles the click, so the outer Box does not
|
|
81
|
+
# fire unless the inner event sets bubble: true.
|
|
82
|
+
- id: box_nested_outer
|
|
83
|
+
type: Box
|
|
84
|
+
style:
|
|
85
|
+
padding: 20px
|
|
86
|
+
events:
|
|
87
|
+
onClick:
|
|
88
|
+
- id: set_outer_clicked
|
|
89
|
+
type: SetState
|
|
90
|
+
params:
|
|
91
|
+
outer_clicks:
|
|
92
|
+
_sum:
|
|
93
|
+
- _if_none:
|
|
94
|
+
- _state: outer_clicks
|
|
95
|
+
- 0
|
|
96
|
+
- 1
|
|
97
|
+
blocks:
|
|
98
|
+
- id: box_nested_inner
|
|
99
|
+
type: Box
|
|
100
|
+
properties:
|
|
101
|
+
content: Inner
|
|
102
|
+
events:
|
|
103
|
+
onClick:
|
|
104
|
+
- id: set_inner_clicked
|
|
105
|
+
type: SetState
|
|
106
|
+
params:
|
|
107
|
+
inner_clicked: true
|
|
108
|
+
- id: box_nested_inner_bubble
|
|
109
|
+
type: Box
|
|
110
|
+
properties:
|
|
111
|
+
content: Inner bubble
|
|
112
|
+
events:
|
|
113
|
+
onClick:
|
|
114
|
+
bubble: true
|
|
115
|
+
try:
|
|
116
|
+
- id: set_inner_bubble_clicked
|
|
117
|
+
type: SetState
|
|
118
|
+
params:
|
|
119
|
+
inner_bubble_clicked: true
|
|
120
|
+
- id: box_nested_plain
|
|
121
|
+
type: Box
|
|
122
|
+
properties:
|
|
123
|
+
content: Plain child
|
|
124
|
+
- id: box_nested_display
|
|
125
|
+
type: Box
|
|
126
|
+
properties:
|
|
127
|
+
content:
|
|
128
|
+
_string.concat:
|
|
129
|
+
- 'outer='
|
|
130
|
+
- _if_none:
|
|
131
|
+
- _state: outer_clicks
|
|
132
|
+
- 0
|
|
133
|
+
- ' inner='
|
|
134
|
+
- _if_none:
|
|
135
|
+
- _state: inner_clicked
|
|
136
|
+
- false
|
|
137
|
+
- ' bubble='
|
|
138
|
+
- _if_none:
|
|
139
|
+
- _state: inner_bubble_clicked
|
|
140
|
+
- false
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
# A page whose title reads state that is set after mount, once per page instance.
|
|
16
|
+
id: box-page-title
|
|
17
|
+
path: box-page-title/{record}
|
|
18
|
+
type: Box
|
|
19
|
+
properties:
|
|
20
|
+
title:
|
|
21
|
+
_if_none:
|
|
22
|
+
- _state: record_title
|
|
23
|
+
- Record
|
|
24
|
+
events:
|
|
25
|
+
onMount:
|
|
26
|
+
- id: wait_before_title
|
|
27
|
+
type: Wait
|
|
28
|
+
params:
|
|
29
|
+
ms: 300
|
|
30
|
+
- id: set_record_title
|
|
31
|
+
type: SetState
|
|
32
|
+
params:
|
|
33
|
+
record_title:
|
|
34
|
+
_string.concat:
|
|
35
|
+
- 'Record '
|
|
36
|
+
- _path_params: record
|
|
37
|
+
blocks:
|
|
38
|
+
- id: rename_record
|
|
39
|
+
type: Anchor
|
|
40
|
+
properties:
|
|
41
|
+
title: Rename record
|
|
42
|
+
events:
|
|
43
|
+
onClick:
|
|
44
|
+
- id: set_renamed_title
|
|
45
|
+
type: SetState
|
|
46
|
+
params:
|
|
47
|
+
record_title:
|
|
48
|
+
_string.concat:
|
|
49
|
+
- 'Renamed '
|
|
50
|
+
- _path_params: record
|
|
51
|
+
- id: open_record_b
|
|
52
|
+
type: Anchor
|
|
53
|
+
properties:
|
|
54
|
+
title: Open record b
|
|
55
|
+
pageId: box-page-title
|
|
56
|
+
pathParams:
|
|
57
|
+
record: b
|
|
@@ -0,0 +1,34 @@
|
|
|
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, HtmlComponent } from '@lowdefy/block-utils';
|
|
17
|
+
// Each clickable element names the event it fires in its data-event attribute
|
|
18
|
+
// (data-event="onEditClick" → events.onEditClick), so every target in the
|
|
19
|
+
// markup has its own action chain. Its other data-* attributes are the event
|
|
20
|
+
// object. HtmlComponent finds the target, including inside data-popover
|
|
21
|
+
// content, and prevents the element's default action. Only the events listed
|
|
22
|
+
// in properties.dataEvents fire, since the markup can hold data.
|
|
23
|
+
const ClickableHtml = ({ blockId, classNames, events, properties, methods, styles })=>/*#__PURE__*/ React.createElement(HtmlComponent, {
|
|
24
|
+
dataEvents: properties.dataEvents,
|
|
25
|
+
div: true,
|
|
26
|
+
events: events,
|
|
27
|
+
html: properties.html,
|
|
28
|
+
id: blockId,
|
|
29
|
+
methods: methods,
|
|
30
|
+
className: classNames?.element,
|
|
31
|
+
style: styles?.element,
|
|
32
|
+
onDataEvent: methods.triggerEvent
|
|
33
|
+
});
|
|
34
|
+
export default withBlockDefaults(ClickableHtml);
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
import { expect } from '@playwright/test';
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
|
+
export default createBlockHelper({
|
|
19
|
+
locator,
|
|
20
|
+
expect: {
|
|
21
|
+
containsText: (page, blockId, text)=>expect(locator(page, blockId)).toContainText(text)
|
|
22
|
+
}
|
|
23
|
+
});
|