@lowdefy/docs-content 0.0.0-experimental-20260928120643 → 6.1.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/README.md +0 -1
- package/content/actions/link.md +0 -17
- package/content/actions/login.md +5 -23
- package/content/actions/logout.md +5 -5
- package/content/actions/pdfmake.md +2 -2
- package/content/actions/setdarkmode.md +2 -2
- package/content/agents/agent-properties.md +2 -4
- package/content/agents/agentchat.md +6 -21
- package/content/agents/agentconversations.md +2 -2
- package/content/concepts/ai-agent-docs.md +101 -313
- package/content/concepts/cli.md +3 -34
- package/content/concepts/connections-and-requests.md +0 -402
- package/content/concepts/custom-html.md +0 -40
- package/content/concepts/custom-styling.md +5 -50
- package/content/concepts/events-and-actions.md +2 -64
- package/content/concepts/i18n.md +2 -7
- package/content/concepts/keyboard-shortcuts.md +2 -2
- package/content/concepts/layout-overview.md +1 -1
- package/content/concepts/logger.md +0 -81
- package/content/concepts/lowdefy-schema.md +1 -4
- package/content/concepts/menus.md +7 -7
- package/content/concepts/module-authoring.md +2 -2
- package/content/connections/anthropic.md +2 -162
- package/content/connections/awss3.md +0 -54
- package/content/connections/google.md +2 -162
- package/content/connections/mongodb.md +3 -121
- package/content/connections/openai-connection.md +2 -162
- package/content/container-blocks/affix.md +7 -47
- package/content/container-blocks/alert.md +24 -76
- package/content/container-blocks/badge.md +24 -100
- package/content/container-blocks/box.md +9 -9
- package/content/container-blocks/card.md +25 -80
- package/content/container-blocks/carousel.md +7 -60
- package/content/container-blocks/collapse.md +9 -87
- package/content/container-blocks/configprovider.md +13 -35
- package/content/container-blocks/confirmmodal.md +23 -69
- package/content/container-blocks/content.md +98 -62
- package/content/container-blocks/descriptions.md +4 -45
- package/content/container-blocks/drawer.md +28 -92
- package/content/container-blocks/dropdownmenu.md +31 -119
- package/content/container-blocks/flex.md +62 -40
- package/content/container-blocks/footer.md +11 -15
- package/content/container-blocks/googlemapsheatmap.md +1 -1
- package/content/container-blocks/googlemapsscript.md +2 -2
- package/content/container-blocks/header.md +36 -71
- package/content/container-blocks/label.md +7 -34
- package/content/container-blocks/layout.md +34 -52
- package/content/container-blocks/masonry.md +71 -17
- package/content/container-blocks/mobilemenu.md +88 -131
- package/content/container-blocks/modal.md +26 -114
- package/content/container-blocks/pageheadermenu.md +31 -81
- package/content/container-blocks/pagesidebarlayout.md +26 -169
- package/content/container-blocks/pagesidermenu.md +42 -95
- package/content/container-blocks/popover.md +31 -34
- package/content/container-blocks/result.md +21 -32
- package/content/container-blocks/sider.md +122 -85
- package/content/container-blocks/span.md +7 -7
- package/content/container-blocks/spinner.md +3 -3
- package/content/container-blocks/splitter.md +68 -150
- package/content/container-blocks/tabs.md +12 -64
- package/content/container-blocks/tooltip.md +46 -22
- package/content/container-blocks/watermark.md +4 -22
- package/content/controls/reject.md +2 -4
- package/content/controls/throw.md +0 -1
- package/content/controls/try.md +2 -3
- package/content/deployment/deployment-environments.md +6 -8
- package/content/deployment/docker.md +7 -22
- package/content/deployment/node-server.md +0 -4
- package/content/deployment/vercel.md +6 -13
- package/content/display-blocks/aggrid.md +11 -26
- package/content/display-blocks/anchor.md +15 -15
- package/content/display-blocks/avatar.md +37 -57
- package/content/display-blocks/breadcrumb.md +21 -70
- package/content/display-blocks/button.md +18 -92
- package/content/display-blocks/calendar.md +0 -12
- package/content/display-blocks/dangeroushtml.md +1 -1
- package/content/display-blocks/difflist.md +1 -1
- package/content/display-blocks/difftimeline.md +1 -1
- package/content/display-blocks/divider.md +3 -64
- package/content/display-blocks/dropdownbutton.md +28 -79
- package/content/display-blocks/echart.md +1 -35
- package/content/display-blocks/floatbutton.md +42 -129
- package/content/display-blocks/html.md +1 -61
- package/content/display-blocks/icon.md +67 -250
- package/content/display-blocks/menu.md +73 -145
- package/content/display-blocks/message.md +124 -38
- package/content/display-blocks/notification.md +222 -94
- package/content/display-blocks/paragraph.md +9 -59
- package/content/display-blocks/progress.md +17 -96
- package/content/display-blocks/qrcode.md +4 -19
- package/content/display-blocks/s3download.md +1 -1
- package/content/display-blocks/search.md +7 -17
- package/content/display-blocks/skeletonbutton.md +0 -1
- package/content/display-blocks/skeletoninput.md +0 -1
- package/content/display-blocks/statistic.md +17 -75
- package/content/display-blocks/steps.md +25 -58
- package/content/display-blocks/tag.md +17 -102
- package/content/display-blocks/title.md +11 -50
- package/content/display-blocks/tour.md +23 -33
- package/content/input-blocks/autocomplete.md +9 -81
- package/content/input-blocks/buttonselector.md +8 -45
- package/content/input-blocks/checkboxselector.md +7 -97
- package/content/input-blocks/checkboxswitch.md +3 -33
- package/content/input-blocks/colorselector.md +14 -63
- package/content/input-blocks/daterangeselector.md +45 -165
- package/content/input-blocks/dateselector.md +41 -139
- package/content/input-blocks/datetimeselector.md +49 -158
- package/content/input-blocks/inputgallery.md +3 -3
- package/content/input-blocks/monthselector.md +52 -120
- package/content/input-blocks/multipleselector.md +39 -150
- package/content/input-blocks/numberinput.md +12 -98
- package/content/input-blocks/pagination.md +14 -70
- package/content/input-blocks/paragraphinput.md +37 -51
- package/content/input-blocks/passwordinput.md +6 -60
- package/content/input-blocks/phonenumberinput.md +26 -59
- package/content/input-blocks/radioselector.md +7 -83
- package/content/input-blocks/ratingslider.md +26 -57
- package/content/input-blocks/s3uploadbutton.md +24 -24
- package/content/input-blocks/s3uploaddragger.md +3 -3
- package/content/input-blocks/s3uploadphoto.md +5 -5
- package/content/input-blocks/segmentedselector.md +32 -72
- package/content/input-blocks/selector.md +21 -109
- package/content/input-blocks/switch.md +17 -65
- package/content/input-blocks/textarea.md +3 -32
- package/content/input-blocks/textinput.md +28 -69
- package/content/input-blocks/tiptapmentioninput.md +1 -1
- package/content/input-blocks/titleinput.md +12 -39
- package/content/input-blocks/treeinput.md +25 -49
- package/content/input-blocks/treemultipleselector.md +10 -127
- package/content/input-blocks/treeselector.md +9 -97
- package/content/input-blocks/upload.md +15 -64
- package/content/input-blocks/uploaddragger.md +1 -17
- package/content/input-blocks/uploadphoto.md +1 -18
- package/content/input-blocks/weekselector.md +55 -120
- package/content/list-blocks/controlledlist.md +15 -24
- package/content/list-blocks/list.md +11 -11
- package/content/list-blocks/masonrylist.md +34 -7
- package/content/migration/upgrade-guide.md +0 -1
- package/content/operators/_app.md +1 -2
- package/content/operators/_error.md +1 -23
- package/content/operators/_get.md +6 -6
- package/content/operators/_operator.md +3 -17
- package/content/operators/_ref.md +0 -258
- package/content/operators/_type.md +3 -14
- package/content/operators/_user.md +3 -3
- package/content/other/introduction.md +1 -1
- package/content/plugins/plugins-dev.md +0 -66
- package/content/plugins/plugins-introduction.md +1 -27
- package/content/testing/e2e-configuration.md +1 -8
- package/content/testing/e2e-getting-started.md +1 -1
- package/content/testing/e2e-introduction.md +1 -1
- package/content/tutorial/tutorial-actions-operators.md +2 -2
- package/content/tutorial/tutorial-add-blocks.md +2 -2
- package/content/tutorial/tutorial-create-page.md +2 -48
- package/content/tutorial/tutorial-display-data-page.md +3 -3
- package/content/tutorial/tutorial-requests-sql.md +0 -153
- package/content/tutorial/tutorial-start.md +1 -66
- package/content/user-authentication/login-and-logout.md +8 -158
- package/content/user-authentication/users-introduction.md +0 -8
- package/index.json +2 -6065
- package/package.json +1 -7
- package/scripts/extractAgentDocs.js +4 -36
- package/content/actions/emailotpsend.md +0 -58
- package/content/actions/emailotpverify.md +0 -77
- package/content/actions/getlocalstorage.md +0 -41
- package/content/actions/magiclinkverify.md +0 -113
- package/content/actions/posthogalias.md +0 -29
- package/content/actions/posthogcapture.md +0 -49
- package/content/actions/posthogcapturepageleave.md +0 -38
- package/content/actions/posthogfeatureflag.md +0 -50
- package/content/actions/posthoggroup.md +0 -37
- package/content/actions/posthogidentify.md +0 -54
- package/content/actions/posthoginit.md +0 -66
- package/content/actions/posthogoptin.md +0 -29
- package/content/actions/posthogoptout.md +0 -29
- package/content/actions/posthogpageview.md +0 -37
- package/content/actions/posthogreloadfeatureflags.md +0 -47
- package/content/actions/posthogreset.md +0 -28
- package/content/actions/posthogsetpersonproperties.md +0 -36
- package/content/actions/removelocalstorage.md +0 -26
- package/content/actions/setlocalstorage.md +0 -32
- package/content/adapter-reference/mongodbauthadapter.md +0 -46
- package/content/agents/agents-introduction.md +0 -107
- package/content/callback-reference/auth0logoutcallback.md +0 -54
- package/content/concepts/blocks.md +0 -150
- package/content/concepts/dynamic-page-content.md +0 -304
- package/content/concepts/html-attributes.md +0 -285
- package/content/concepts/lowdefy-api.md +0 -1110
- package/content/concepts/notifications.md +0 -155
- package/content/concepts/page-and-app-state.md +0 -244
- package/content/concepts/theming.md +0 -582
- package/content/connections/aigateway.md +0 -368
- package/content/connections/axioshttp.md +0 -181
- package/content/controls/while.md +0 -46
- package/content/display-blocks/clickablehtml.md +0 -239
- package/content/display-blocks/eventlog.md +0 -363
- package/content/display-blocks/pollingtimer.md +0 -263
- package/content/input-blocks/captcha.md +0 -40
- package/content/input-blocks/placesautocomplete.md +0 -319
- package/content/input-blocks/tagmultipleselector.md +0 -114
- package/content/input-blocks/tagselector.md +0 -114
- package/content/migration/auth-upgrade.md +0 -327
- package/content/migration/v3-to-v4.md +0 -417
- package/content/migration/v6-to-v7.md +0 -222
- package/content/operators/_cron.md +0 -292
- package/content/other/mongodbadapter.md +0 -3
- package/content/plugins/plugins-icon-sets.md +0 -267
- package/content/plugins/posthog.md +0 -275
- package/content/provider-reference/auth-js-providers.md +0 -107
- package/content/provider-reference/openidconnectprovider.md +0 -44
- package/content/testing/config-tests.md +0 -278
- package/content/tutorial/tutorial-requests-api.md +0 -155
- package/content/user-authentication/auth-configuration.md +0 -266
- package/content/user-authentication/auth-steps.md +0 -138
- package/content/user-authentication/mcp-oauth.md +0 -292
- package/content/user-authentication/organizations.md +0 -221
- package/content/user-authentication/protected-pages-apis.md +0 -97
- package/content/user-authentication/roles.md +0 -49
- package/content/user-authentication/two-factor.md +0 -229
- package/content/user-authentication/user-object.md +0 -58
- package/content/websockets/websocket-publish.md +0 -108
- package/content/websockets/websocket-subscriptions.md +0 -100
- package/content/websockets/websockets-introduction.md +0 -97
- package/hazards.json +0 -44
- package/scripts/hashDocSources.js +0 -38
- package/scripts/recordSourceHashes.js +0 -88
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
# PollingTimer
|
|
2
|
-
|
|
3
|
-
A headless timer that renders nothing and triggers its `onTick` event every `interval` milliseconds while it is running. Use it to poll a request until a background job completes, or to refresh a page on a schedule. Start and stop it with the `start`, `stop` and `toggle` methods, or set `autoStart` to start it on mount. The timer always stops when the block unmounts.
|
|
4
|
-
|
|
5
|
-
## Poll a request until a job is done
|
|
6
|
-
|
|
7
|
-
Start the timer when a background job is kicked off, fetch the job status on every tick, and stop the timer with the `stop` method once the job reports it is done:
|
|
8
|
-
|
|
9
|
-
```yaml
|
|
10
|
-
requests:
|
|
11
|
-
- id: create_job
|
|
12
|
-
type: MongoDBInsertOne
|
|
13
|
-
connectionId: jobs
|
|
14
|
-
properties:
|
|
15
|
-
doc:
|
|
16
|
-
status: queued
|
|
17
|
-
- id: get_job
|
|
18
|
-
type: MongoDBFindOne
|
|
19
|
-
connectionId: jobs
|
|
20
|
-
payload:
|
|
21
|
-
job_id:
|
|
22
|
-
_state: job_id
|
|
23
|
-
properties:
|
|
24
|
-
query:
|
|
25
|
-
_id:
|
|
26
|
-
_payload: job_id
|
|
27
|
-
blocks:
|
|
28
|
-
- id: job_poller
|
|
29
|
-
type: PollingTimer
|
|
30
|
-
properties:
|
|
31
|
-
interval: 3000
|
|
32
|
-
events:
|
|
33
|
-
onTick:
|
|
34
|
-
- id: fetch_job
|
|
35
|
-
type: Request
|
|
36
|
-
params: get_job
|
|
37
|
-
- id: stop_when_done
|
|
38
|
-
type: CallMethod
|
|
39
|
-
skip:
|
|
40
|
-
_ne:
|
|
41
|
-
- _request: get_job.status
|
|
42
|
-
- done
|
|
43
|
-
params:
|
|
44
|
-
blockId: job_poller
|
|
45
|
-
method: stop
|
|
46
|
-
- id: start_job
|
|
47
|
-
type: Button
|
|
48
|
-
properties:
|
|
49
|
-
title: Start job
|
|
50
|
-
events:
|
|
51
|
-
onClick:
|
|
52
|
-
- id: create_job
|
|
53
|
-
type: Request
|
|
54
|
-
params: create_job
|
|
55
|
-
- id: set_job_id
|
|
56
|
-
type: SetState
|
|
57
|
-
params:
|
|
58
|
-
job_id:
|
|
59
|
-
_request: create_job.insertedId
|
|
60
|
-
- id: start_polling
|
|
61
|
-
type: CallMethod
|
|
62
|
-
params:
|
|
63
|
-
blockId: job_poller
|
|
64
|
-
method: start
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Timing
|
|
68
|
-
|
|
69
|
-
The next tick is scheduled `interval` ms after the `onTick` actions finish, so a slow request never causes ticks to overlap or pile up. Stopping the timer while `onTick` actions are running lets them finish, but no further tick is scheduled.
|
|
70
|
-
|
|
71
|
-
`pauseWhenHidden` pauses the timer while `document.visibilityState` is `hidden`, so a visible browser window that has lost focus keeps ticking. The page `onVisible` and `onHidden` events also fire when the window gains or loses focus, so use them instead when you want to react to focus changes, for example to refresh data once when the user returns.
|
|
72
|
-
|
|
73
|
-
The engine keeps a history of every event it runs, so each tick adds an `onTick` entry. For a timer that runs for a long time, prefer a longer `interval` or a `maxTicks` limit.
|
|
74
|
-
|
|
75
|
-
```yaml
|
|
76
|
-
- id: job_timer
|
|
77
|
-
type: PollingTimer
|
|
78
|
-
properties:
|
|
79
|
-
interval: 1000
|
|
80
|
-
events:
|
|
81
|
-
onTick:
|
|
82
|
-
- id: job_timer_set_status
|
|
83
|
-
type: SetState
|
|
84
|
-
params:
|
|
85
|
-
job_status:
|
|
86
|
-
_if:
|
|
87
|
-
test:
|
|
88
|
-
_gte:
|
|
89
|
-
- _event: tick
|
|
90
|
-
- 5
|
|
91
|
-
then: done
|
|
92
|
-
else: running
|
|
93
|
-
- id: job_timer_stop_when_done
|
|
94
|
-
type: CallMethod
|
|
95
|
-
skip:
|
|
96
|
-
_ne:
|
|
97
|
-
- _state: job_status
|
|
98
|
-
- done
|
|
99
|
-
params:
|
|
100
|
-
blockId: job_timer
|
|
101
|
-
method: stop
|
|
102
|
-
- id: job_timer_controls
|
|
103
|
-
type: Box
|
|
104
|
-
layout:
|
|
105
|
-
gap: 8
|
|
106
|
-
blocks:
|
|
107
|
-
- id: job_timer_start
|
|
108
|
-
type: Button
|
|
109
|
-
properties:
|
|
110
|
-
title: Start Job
|
|
111
|
-
icon: CirclePlay
|
|
112
|
-
events:
|
|
113
|
-
onClick:
|
|
114
|
-
- id: job_timer_set_running
|
|
115
|
-
type: SetState
|
|
116
|
-
params:
|
|
117
|
-
job_status: running
|
|
118
|
-
- id: job_timer_call_start
|
|
119
|
-
type: CallMethod
|
|
120
|
-
params:
|
|
121
|
-
blockId: job_timer
|
|
122
|
-
method: start
|
|
123
|
-
- id: job_timer_status
|
|
124
|
-
type: Span
|
|
125
|
-
properties:
|
|
126
|
-
content:
|
|
127
|
-
_nunjucks:
|
|
128
|
-
template: "Job status: {{ status }}"
|
|
129
|
-
on:
|
|
130
|
-
status:
|
|
131
|
-
_if_none:
|
|
132
|
-
- _state: job_status
|
|
133
|
-
- not started
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
```yaml
|
|
137
|
-
- id: manual_timer
|
|
138
|
-
type: PollingTimer
|
|
139
|
-
properties:
|
|
140
|
-
interval: 1000
|
|
141
|
-
events:
|
|
142
|
-
onTick:
|
|
143
|
-
- id: manual_timer_set_tick
|
|
144
|
-
type: SetState
|
|
145
|
-
params:
|
|
146
|
-
manual_ticks:
|
|
147
|
-
_event: tick
|
|
148
|
-
- id: manual_timer_controls
|
|
149
|
-
type: Box
|
|
150
|
-
layout:
|
|
151
|
-
gap: 8
|
|
152
|
-
blocks:
|
|
153
|
-
- id: manual_timer_start
|
|
154
|
-
type: Button
|
|
155
|
-
properties:
|
|
156
|
-
title: Start
|
|
157
|
-
icon: CirclePlay
|
|
158
|
-
events:
|
|
159
|
-
onClick:
|
|
160
|
-
- id: manual_timer_call_start
|
|
161
|
-
type: CallMethod
|
|
162
|
-
params:
|
|
163
|
-
blockId: manual_timer
|
|
164
|
-
method: start
|
|
165
|
-
- id: manual_timer_stop
|
|
166
|
-
type: Button
|
|
167
|
-
properties:
|
|
168
|
-
title: Stop
|
|
169
|
-
icon: CirclePause
|
|
170
|
-
events:
|
|
171
|
-
onClick:
|
|
172
|
-
- id: manual_timer_call_stop
|
|
173
|
-
type: CallMethod
|
|
174
|
-
params:
|
|
175
|
-
blockId: manual_timer
|
|
176
|
-
method: stop
|
|
177
|
-
- id: manual_timer_toggle
|
|
178
|
-
type: Button
|
|
179
|
-
properties:
|
|
180
|
-
title: Toggle
|
|
181
|
-
icon: ArrowRightLeft
|
|
182
|
-
events:
|
|
183
|
-
onClick:
|
|
184
|
-
- id: manual_timer_call_toggle
|
|
185
|
-
type: CallMethod
|
|
186
|
-
params:
|
|
187
|
-
blockId: manual_timer
|
|
188
|
-
method: toggle
|
|
189
|
-
- id: manual_timer_ticks
|
|
190
|
-
type: Span
|
|
191
|
-
properties:
|
|
192
|
-
content:
|
|
193
|
-
_nunjucks:
|
|
194
|
-
template: "Ticks: {{ ticks }}"
|
|
195
|
-
on:
|
|
196
|
-
ticks:
|
|
197
|
-
_state: manual_ticks
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
```yaml
|
|
201
|
-
- id: limited_timer
|
|
202
|
-
type: PollingTimer
|
|
203
|
-
properties:
|
|
204
|
-
interval: 1000
|
|
205
|
-
autoStart: true
|
|
206
|
-
maxTicks: 5
|
|
207
|
-
events:
|
|
208
|
-
onTick:
|
|
209
|
-
- id: limited_timer_set_tick
|
|
210
|
-
type: SetState
|
|
211
|
-
params:
|
|
212
|
-
limited_ticks:
|
|
213
|
-
_event: tick
|
|
214
|
-
- id: limited_timer_ticks
|
|
215
|
-
type: Span
|
|
216
|
-
properties:
|
|
217
|
-
content:
|
|
218
|
-
_nunjucks:
|
|
219
|
-
template: "Ticks: {{ ticks }} of 5"
|
|
220
|
-
on:
|
|
221
|
-
ticks:
|
|
222
|
-
_state: limited_ticks
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
```yaml
|
|
226
|
-
- id: background_timer
|
|
227
|
-
type: PollingTimer
|
|
228
|
-
properties:
|
|
229
|
-
interval: 2000
|
|
230
|
-
autoStart: true
|
|
231
|
-
pauseWhenHidden: false
|
|
232
|
-
events:
|
|
233
|
-
onTick:
|
|
234
|
-
- id: background_timer_set_tick
|
|
235
|
-
type: SetState
|
|
236
|
-
params:
|
|
237
|
-
background_ticks:
|
|
238
|
-
_event: tick
|
|
239
|
-
- id: background_timer_ticks
|
|
240
|
-
type: Span
|
|
241
|
-
properties:
|
|
242
|
-
content:
|
|
243
|
-
_nunjucks:
|
|
244
|
-
template: "Ticks while this tab was open or hidden: {{ ticks }}"
|
|
245
|
-
on:
|
|
246
|
-
ticks:
|
|
247
|
-
_state: background_ticks
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
| Property | Type | Default | Description |
|
|
251
|
-
| --- | --- | --- | --- |
|
|
252
|
-
| `interval` | integer | - | Milliseconds to wait after the `onTick` actions of one tick finish before the next tick fires. Changing it while the timer is waiting restarts the wait. |
|
|
253
|
-
| `autoStart` | boolean | `false` | Start ticking when the block mounts. Off by default, so the timer is started with the `start` method. |
|
|
254
|
-
| `maxTicks` | integer | - | Stop the timer after this many ticks. The `onTick` event of the last tick is still triggered. Unlimited by default. |
|
|
255
|
-
| `pauseWhenHidden` | boolean | `true` | Pause ticking while the browser tab is hidden (`document.visibilityState`), and resume when it becomes visible again. Ticks missed while hidden are not fired on resume; the next tick fires `interval` ms after the tab is visible. |
|
|
256
|
-
|
|
257
|
-
| Event | Event Data | Description |
|
|
258
|
-
| --- | --- | --- |
|
|
259
|
-
| `onTick` | `{ tick }` | Trigger actions on every tick while the timer is running. The next tick is scheduled `interval` ms after the `onTick` actions finish, so ticks never overlap. |
|
|
260
|
-
|
|
261
|
-
No CSS keys defined.
|
|
262
|
-
|
|
263
|
-
No slots defined.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Captcha
|
|
2
|
-
|
|
3
|
-
Renders a captcha widget (Cloudflare Turnstile) and writes the minted token into state under its blockId. Configure `provider` and `siteKey` from the `_build.authConfig` projection when `auth.captcha` is enabled. The `reset` method clears the value and mints a fresh token; expiry clears the value automatically.
|
|
4
|
-
|
|
5
|
-
> The widget script loads from the provider's CDN at render - apps behind a strict CSP should allowlist challenges.cloudflare.com. Tokens are single-use and short-lived: pass the block value as the `captchaToken` param of auth actions, and call the block's `reset` method from the action's `onError` chain to mint a fresh token for retries.
|
|
6
|
-
|
|
7
|
-
```yaml
|
|
8
|
-
- id: captcha_basic
|
|
9
|
-
type: Captcha
|
|
10
|
-
properties:
|
|
11
|
-
provider: cloudflare-turnstile
|
|
12
|
-
siteKey: 1x00000000000000000000AA
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
```yaml
|
|
16
|
-
- id: captcha_compact
|
|
17
|
-
type: Captcha
|
|
18
|
-
properties:
|
|
19
|
-
provider: cloudflare-turnstile
|
|
20
|
-
siteKey: 1x00000000000000000000AA
|
|
21
|
-
theme: light
|
|
22
|
-
size: compact
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
| Property | Type | Default | Description |
|
|
26
|
-
| --- | --- | --- | --- |
|
|
27
|
-
| `provider` | string | `"cloudflare-turnstile"` | Captcha provider to render. Normally fed from the auth config projection: { _build.authConfig: captcha.provider }. Enum: `cloudflare-turnstile`. |
|
|
28
|
-
| `siteKey` | string | - | The provider site key - public, rendered into the page. Normally fed from the auth config projection: { _build.authConfig: captcha.siteKey }. |
|
|
29
|
-
| `theme` | string | `"auto"` | Widget theme. Enum: `auto`, `light`, `dark`. |
|
|
30
|
-
| `size` | string | `"normal"` | Widget size. Enum: `normal`, `compact`, `flexible`. |
|
|
31
|
-
|
|
32
|
-
| Event | Event Data | Description |
|
|
33
|
-
| --- | --- | --- |
|
|
34
|
-
| `onSuccess` | \- | Trigger actions when the captcha challenge succeeds and a token is minted. |
|
|
35
|
-
| `onExpire` | \- | Trigger actions when the minted token expires - the block value is cleared so a late submit fails with a clear missing-token error. |
|
|
36
|
-
| `onError` | \- | Trigger actions when the captcha provider reports an error. |
|
|
37
|
-
|
|
38
|
-
No CSS keys defined.
|
|
39
|
-
|
|
40
|
-
No slots defined.
|
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
# PlacesAutocomplete
|
|
2
|
-
|
|
3
|
-
Address input with place suggestions from the Google Places Autocomplete Data API. Must be wrapped in a `GoogleMapsScript` block. The block value is an object: selecting a suggestion fetches the configured place fields, renames them through `resultMapping` and writes them to the value, while typing writes the free text to `labelField` so a form always holds a usable address. Typing, selecting or clearing first removes the keys the previous place wrote, so typed text never keeps another place's coordinates; sibling keys written by other blocks are preserved, and the value becomes null when none remain. `onPlaceChanged` receives the mapped place, `onChange` the new value, and `onError` fires when the Places API request fails.
|
|
4
|
-
|
|
5
|
-
> The PlacesAutocomplete block must be wrapped in a GoogleMapsScript block, with a valid Google Maps API key that has the Places API (New) enabled. Load the places library on the script, `libraries: [places]`, so it is ready on first render; when it is not listed the block imports it on demand through `google.maps.importLibrary`. Outside a GoogleMapsScript, or when the places library cannot be loaded, the block is a plain text input that still writes the label field. Suggestions are requested `debounce` milliseconds (default 250) after the last keystroke. The examples on this page require a configured API key to return suggestions.
|
|
6
|
-
|
|
7
|
-
```yaml
|
|
8
|
-
- id: pa_default
|
|
9
|
-
type: PlacesAutocomplete
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
```yaml
|
|
13
|
-
- id: pa_title
|
|
14
|
-
type: PlacesAutocomplete
|
|
15
|
-
properties:
|
|
16
|
-
title: Delivery address
|
|
17
|
-
placeholder: Search for an address
|
|
18
|
-
- id: pa_label_extra
|
|
19
|
-
type: PlacesAutocomplete
|
|
20
|
-
properties:
|
|
21
|
-
title: Site address
|
|
22
|
-
label:
|
|
23
|
-
extra: Start typing, then pick a suggestion to capture the full address.
|
|
24
|
-
tooltip: Addresses are verified against Google Places.
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
```yaml
|
|
28
|
-
- id: pa_fetch_fields
|
|
29
|
-
type: PlacesAutocomplete
|
|
30
|
-
properties:
|
|
31
|
-
title: Address
|
|
32
|
-
fetchFields:
|
|
33
|
-
- addressComponents
|
|
34
|
-
- location
|
|
35
|
-
- id
|
|
36
|
-
- displayName
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
```yaml
|
|
40
|
-
- id: pa_result_mapping
|
|
41
|
-
type: PlacesAutocomplete
|
|
42
|
-
properties:
|
|
43
|
-
title: Address
|
|
44
|
-
fetchFields:
|
|
45
|
-
- location
|
|
46
|
-
- addressComponents
|
|
47
|
-
resultMapping:
|
|
48
|
-
formattedAddress: address.line1
|
|
49
|
-
location: address.coordinates
|
|
50
|
-
addressComponents: address.components
|
|
51
|
-
labelField: address.line1
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
```yaml
|
|
55
|
-
- id: pa_region_codes
|
|
56
|
-
type: PlacesAutocomplete
|
|
57
|
-
properties:
|
|
58
|
-
title: Address in the United Kingdom
|
|
59
|
-
requestOptions:
|
|
60
|
-
includedRegionCodes:
|
|
61
|
-
- gb
|
|
62
|
-
- id: pa_location_bias
|
|
63
|
-
type: PlacesAutocomplete
|
|
64
|
-
properties:
|
|
65
|
-
title: Near central London
|
|
66
|
-
requestOptions:
|
|
67
|
-
includedPrimaryTypes:
|
|
68
|
-
- street_address
|
|
69
|
-
locationBias:
|
|
70
|
-
center:
|
|
71
|
-
lat: 51.5074
|
|
72
|
-
lng: -0.1278
|
|
73
|
-
radius: 20000
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
```yaml
|
|
77
|
-
- id: pa_size_small
|
|
78
|
-
type: PlacesAutocomplete
|
|
79
|
-
properties:
|
|
80
|
-
title: Small
|
|
81
|
-
size: small
|
|
82
|
-
- id: pa_size_middle
|
|
83
|
-
type: PlacesAutocomplete
|
|
84
|
-
properties:
|
|
85
|
-
title: Middle
|
|
86
|
-
size: middle
|
|
87
|
-
- id: pa_size_large
|
|
88
|
-
type: PlacesAutocomplete
|
|
89
|
-
properties:
|
|
90
|
-
title: Large
|
|
91
|
-
size: large
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
```yaml
|
|
95
|
-
- id: pa_variant_filled
|
|
96
|
-
type: PlacesAutocomplete
|
|
97
|
-
properties:
|
|
98
|
-
title: Filled
|
|
99
|
-
variant: filled
|
|
100
|
-
- id: pa_variant_borderless
|
|
101
|
-
type: PlacesAutocomplete
|
|
102
|
-
properties:
|
|
103
|
-
title: Borderless
|
|
104
|
-
variant: borderless
|
|
105
|
-
- id: pa_variant_underlined
|
|
106
|
-
type: PlacesAutocomplete
|
|
107
|
-
properties:
|
|
108
|
-
title: Underlined
|
|
109
|
-
variant: underlined
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
```yaml
|
|
113
|
-
- id: pa_disabled
|
|
114
|
-
type: PlacesAutocomplete
|
|
115
|
-
properties:
|
|
116
|
-
title: Disabled
|
|
117
|
-
disabled: true
|
|
118
|
-
- id: pa_no_clear
|
|
119
|
-
type: PlacesAutocomplete
|
|
120
|
-
properties:
|
|
121
|
-
title: Clear button hidden
|
|
122
|
-
allowClear: false
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
```yaml
|
|
126
|
-
- id: pa_custom_icon
|
|
127
|
-
type: PlacesAutocomplete
|
|
128
|
-
properties:
|
|
129
|
-
title: Address
|
|
130
|
-
optionsIcon:
|
|
131
|
-
name: home
|
|
132
|
-
color: "#1890ff"
|
|
133
|
-
loadingPlaceholder: Searching addresses...
|
|
134
|
-
notFoundContent: No matching address
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
```yaml
|
|
138
|
-
- id: pa_required
|
|
139
|
-
type: PlacesAutocomplete
|
|
140
|
-
required: true
|
|
141
|
-
properties:
|
|
142
|
-
title: Address
|
|
143
|
-
validate:
|
|
144
|
-
- message: An address must be selected.
|
|
145
|
-
status: error
|
|
146
|
-
pass:
|
|
147
|
-
_if_none:
|
|
148
|
-
- _state: pa_required.formattedAddress
|
|
149
|
-
- false
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
```yaml
|
|
153
|
-
- id: pa_events
|
|
154
|
-
type: PlacesAutocomplete
|
|
155
|
-
properties:
|
|
156
|
-
title: Address
|
|
157
|
-
fetchFields:
|
|
158
|
-
- location
|
|
159
|
-
events:
|
|
160
|
-
onPlaceChanged:
|
|
161
|
-
- id: pa_place_changed_message
|
|
162
|
-
type: DisplayMessage
|
|
163
|
-
params:
|
|
164
|
-
content:
|
|
165
|
-
_string.concat:
|
|
166
|
-
- "Selected: "
|
|
167
|
-
- _event: place.formattedAddress
|
|
168
|
-
duration: 2
|
|
169
|
-
onError:
|
|
170
|
-
- id: pa_error_message
|
|
171
|
-
type: DisplayMessage
|
|
172
|
-
params:
|
|
173
|
-
status: error
|
|
174
|
-
content:
|
|
175
|
-
_event: message
|
|
176
|
-
onSearch:
|
|
177
|
-
- id: pa_search_state
|
|
178
|
-
type: SetState
|
|
179
|
-
params:
|
|
180
|
-
pa_last_search:
|
|
181
|
-
_event: value
|
|
182
|
-
onClear:
|
|
183
|
-
- id: pa_clear_state
|
|
184
|
-
type: SetState
|
|
185
|
-
params:
|
|
186
|
-
pa_last_search: null
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
Delivery details
|
|
190
|
-
|
|
191
|
-
```yaml
|
|
192
|
-
- id: pa_form_title
|
|
193
|
-
type: Title
|
|
194
|
-
properties:
|
|
195
|
-
content: Delivery details
|
|
196
|
-
level: 4
|
|
197
|
-
- id: pa_form_address
|
|
198
|
-
type: PlacesAutocomplete
|
|
199
|
-
properties:
|
|
200
|
-
title: Street address
|
|
201
|
-
placeholder: Search for a delivery address
|
|
202
|
-
fetchFields:
|
|
203
|
-
- addressComponents
|
|
204
|
-
- location
|
|
205
|
-
label:
|
|
206
|
-
extra: Pick a suggestion to capture the coordinates for the driver.
|
|
207
|
-
- id: pa_form_instructions
|
|
208
|
-
type: TextArea
|
|
209
|
-
properties:
|
|
210
|
-
title: Delivery instructions
|
|
211
|
-
placeholder: Gate code, buzzer, where to leave the parcel
|
|
212
|
-
- id: pa_form_submit
|
|
213
|
-
type: Button
|
|
214
|
-
properties:
|
|
215
|
-
title: Save address
|
|
216
|
-
icon: save
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
| Property | Type | Default | Description |
|
|
220
|
-
| --- | --- | --- | --- |
|
|
221
|
-
| `allowClear` | boolean | `true` | Allow the user to clear the input. Clearing removes the place keys from the block value, and sets the value to null when no sibling keys remain. |
|
|
222
|
-
| `autoFocus` | boolean | `false` | Autofocus to the block on page load. |
|
|
223
|
-
| `backfill` | boolean | `false` | Backfill the highlighted suggestion into the input when using the keyboard. |
|
|
224
|
-
| `bordered` | boolean | `true` | Whether or not the input has a border style. Deprecated, use variant instead. |
|
|
225
|
-
| `debounce` | number | `250` | Milliseconds to wait after the last keystroke before requesting suggestions from the Places API. |
|
|
226
|
-
| `defaultOpen` | boolean | `false` | Initial open state of the suggestions dropdown. |
|
|
227
|
-
| `disabled` | boolean | `false` | Disable the block if true. |
|
|
228
|
-
| `fetchFields` | array | - | Place fields to fetch when a suggestion is selected, in camelCase, for example `addressComponents`, `location` or `viewport`. `formattedAddress` is always fetched. See [Place fields](https://developers.google.com/maps/documentation/javascript/reference/place#Place). |
|
|
229
|
-
| `label` | object | - | Label properties. |
|
|
230
|
-
| `label.align` | string | `"left"` | Align label left or right when inline. Enum: `left`, `right`. |
|
|
231
|
-
| `label.colon` | boolean | `true` | Append label with colon. |
|
|
232
|
-
| `label.disabled` | boolean | `false` | Hide input label. |
|
|
233
|
-
| `label.extra` | string | - | Extra text to display beneath the content - supports html. |
|
|
234
|
-
| `label.hasFeedback` | boolean | `true` | Display feedback extra from validation, this does not disable validation. |
|
|
235
|
-
| `label.inline` | boolean | `false` | Render input and label inline. |
|
|
236
|
-
| `label.span` | number | - | Label inline span. |
|
|
237
|
-
| `label.title` | string | - | Label title - supports html. |
|
|
238
|
-
| `label.tooltip` | string \| object | - | Help tooltip shown via an icon beside the label. A string sets the tooltip text (supports html), or an object to also customize the icon and color. Use the block's onTooltipClick event to respond to clicks on the icon. |
|
|
239
|
-
| `label.tooltip.title` | string | - | Tooltip text shown on hover - supports html. |
|
|
240
|
-
| `label.tooltip.icon` | string | `"help"` | Icon name to show beside the label: a semantic name like `help`, a Lucide icon name like `CircleQuestionMark`, or a set-qualified name like `tabler:HelpCircle`. |
|
|
241
|
-
| `label.tooltip.color` | string | - | Color of the tooltip icon. |
|
|
242
|
-
| `labelField` | string | `"formattedAddress"` | The key in the block value, after `resultMapping` is applied, that is displayed in the input and written when the user types free text. Typing removes the keys the previous place wrote (the mapped `input`, `id`, `formattedAddress` and `fetchFields` keys), so typed text never carries another place's fields. |
|
|
243
|
-
| `loadingPlaceholder` | string | `"Loading..."` | Text displayed in the dropdown while suggestions are being fetched. |
|
|
244
|
-
| `notFoundContent` | string | `"No results found"` | Text displayed in the dropdown when the search returns no suggestions. |
|
|
245
|
-
| `optionsIcon` | string \| object | `"location"` | Icon displayed before each suggestion in the dropdown: a semantic name like `location`, a Lucide icon name like `MapPin`, or a set-qualified name like `tabler:MapPin`, or properties of an Icon block. |
|
|
246
|
-
| `placeholder` | string | `"Start typing to search"` | Placeholder text inside the block before the user types input. |
|
|
247
|
-
| `requestOptions` | object | - | Additional options passed to the autocomplete request. See [AutocompleteRequest](https://developers.google.com/maps/documentation/javascript/reference/autocomplete-data#AutocompleteRequest). |
|
|
248
|
-
| `requestOptions.includedPrimaryTypes` | array | - | Restrict suggestions to these place types, for example `street_address` or `locality`. |
|
|
249
|
-
| `requestOptions.includedRegionCodes` | array | - | Restrict suggestions to these regions, as up to 15 CLDR two character region codes, for example `["us", "gb"]`. |
|
|
250
|
-
| `requestOptions.language` | string | - | The language in which to return the suggestions. |
|
|
251
|
-
| `requestOptions.locationBias` | object | - | Bias suggestions towards an area, as a circle or a rectangle. Cannot be used with locationRestriction. |
|
|
252
|
-
| `requestOptions.locationRestriction` | object | - | Restrict suggestions to an area, as a circle or a rectangle. Cannot be used with locationBias. |
|
|
253
|
-
| `requestOptions.origin` | object | - | The origin from which the distance to a suggestion is calculated, as a lat and lng object. |
|
|
254
|
-
| `requestOptions.origin.lat` | number | - | Lateral coordinate. |
|
|
255
|
-
| `requestOptions.origin.lng` | number | - | Longitudinal coordinate. |
|
|
256
|
-
| `requestOptions.region` | string | - | The region code used to format the suggestions. |
|
|
257
|
-
| `resultMapping` | object | - | Rename the fetched place fields before they are written to the block value. Dotted target paths are nested, for example `{ formattedAddress: address.line1, location: geometry.location }`. |
|
|
258
|
-
| `size` | string | `"middle"` | Size of the block. Enum: `small`, `middle`, `large`. |
|
|
259
|
-
| `theme` | object | - | Antd design token overrides for this block. See [antd design tokens](https://ant.design/components/overview#design-token). See [Ant Design select tokens](https://ant.design/components/select#design-token). |
|
|
260
|
-
| `theme.borderRadius` | number | `6` | Border radius of the input. |
|
|
261
|
-
| `theme.borderRadiusLG` | number | `8` | Border radius for large size. |
|
|
262
|
-
| `theme.borderRadiusSM` | number | `4` | Border radius for small size. |
|
|
263
|
-
| `theme.controlHeight` | number | `32` | Height of the input. |
|
|
264
|
-
| `theme.controlHeightLG` | number | `40` | Height for large size. |
|
|
265
|
-
| `theme.controlHeightSM` | number | `24` | Height for small size. |
|
|
266
|
-
| `theme.fontSize` | number | `14` | Font size of the input text. |
|
|
267
|
-
| `theme.fontSizeLG` | number | `16` | Font size for large size. |
|
|
268
|
-
| `theme.fontSizeSM` | number | `14` | Font size for small size. |
|
|
269
|
-
| `theme.colorPrimary` | string | - | Primary color, used for focus border and active state. |
|
|
270
|
-
| `theme.colorPrimaryHover` | string | - | Primary hover color, used for hover border state. |
|
|
271
|
-
| `theme.colorBgContainer` | string | `"#ffffff"` | Background color of the selector. |
|
|
272
|
-
| `theme.colorBgElevated` | string | `"#ffffff"` | Background color of the dropdown. |
|
|
273
|
-
| `theme.colorText` | string | - | Text color of the input. |
|
|
274
|
-
| `theme.colorTextPlaceholder` | string | - | Placeholder text color. |
|
|
275
|
-
| `theme.colorTextDisabled` | string | - | Text color when disabled. |
|
|
276
|
-
| `theme.colorBorder` | string | - | Border color of the input. |
|
|
277
|
-
| `theme.hoverBorderColor` | string | - | Border color when hovered. |
|
|
278
|
-
| `theme.activeBorderColor` | string | - | Border color when focused/active. |
|
|
279
|
-
| `theme.activeOutlineColor` | string | - | Outline color when focused. |
|
|
280
|
-
| `theme.clearBg` | string | `"#ffffff"` | Background color of the clear button. |
|
|
281
|
-
| `theme.optionSelectedBg` | string | `"#e6f4ff"` | Background color of the selected option. |
|
|
282
|
-
| `theme.optionSelectedColor` | string | `"rgba(0, 0, 0, 0.88)"` | Text color of the selected option. |
|
|
283
|
-
| `theme.optionSelectedFontWeight` | number | `600` | Font weight of the selected option. |
|
|
284
|
-
| `theme.optionActiveBg` | string | `"rgba(0, 0, 0, 0.04)"` | Background color of the active (hovered) option. |
|
|
285
|
-
| `theme.optionFontSize` | number | `14` | Font size of dropdown option text. |
|
|
286
|
-
| `theme.optionHeight` | number | `32` | Height of each dropdown option. |
|
|
287
|
-
| `theme.optionLineHeight` | number | - | Line height of dropdown option text. |
|
|
288
|
-
| `theme.optionPadding` | string \| number | `"5px 12px"` | Padding of each dropdown option. |
|
|
289
|
-
| `theme.selectorBg` | string | `"#ffffff"` | Background color of the selector input. |
|
|
290
|
-
| `theme.zIndexPopup` | number | `1050` | Z-index of the dropdown popup. |
|
|
291
|
-
| `theme.showArrowPaddingInlineEnd` | number | `18` | Right padding when the arrow icon is shown. |
|
|
292
|
-
| `theme.lineWidth` | number | `1` | Border width of the input. |
|
|
293
|
-
| `theme.paddingInline` | number | `11` | Horizontal padding of the input. |
|
|
294
|
-
| `title` | string | - | Title to describe the input component, if no title is specified the block id is displayed - supports html. |
|
|
295
|
-
| `variant` | string | `"outlined"` | Input visual variant. When set, takes precedence over bordered. Enum: `outlined`, `filled`, `borderless`, `underlined`. |
|
|
296
|
-
|
|
297
|
-
| Event | Event Data | Description |
|
|
298
|
-
| --- | --- | --- |
|
|
299
|
-
| `onBlur` | \- | Trigger actions when the input loses focus. |
|
|
300
|
-
| `onChange` | `{ value }` | Trigger actions after the block value changes, by typing, by selecting a suggestion or by clearing the input. |
|
|
301
|
-
| `onClear` | \- | Trigger actions when the input is cleared. |
|
|
302
|
-
| `onError` | `{ message }` | Trigger actions when fetching suggestions or place fields fails, for example when the Places API is not enabled on the API key. When fetching place fields fails, the typed text stays in the block value and onPlaceChanged is not triggered. |
|
|
303
|
-
| `onFocus` | \- | Trigger actions when the input gains focus. |
|
|
304
|
-
| `onPlaceChanged` | `{ place, value }` | Trigger actions after a suggestion is selected and its place fields have been fetched and written to the block value. |
|
|
305
|
-
| `onSearch` | `{ value }` | Trigger actions when the search text changes. |
|
|
306
|
-
| `onTooltipClick` | \- | Trigger actions when the tooltip icon is clicked. |
|
|
307
|
-
|
|
308
|
-
| Key | Target |
|
|
309
|
-
| --- | --- |
|
|
310
|
-
| `/block` | Outer block wrapper (always available). |
|
|
311
|
-
| `/element` | The PlacesAutocomplete input element. |
|
|
312
|
-
| `/selector` | The inner value container of the input (antd `content` semantic slot). |
|
|
313
|
-
| `/label` | The PlacesAutocomplete label. |
|
|
314
|
-
| `/extra` | The PlacesAutocomplete extra content. |
|
|
315
|
-
| `/feedback` | The PlacesAutocomplete validation feedback. |
|
|
316
|
-
| `/options` | Each suggestion in the dropdown. |
|
|
317
|
-
| `/popup` | The suggestions dropdown. |
|
|
318
|
-
|
|
319
|
-
No slots defined.
|