@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
package/content/concepts/cli.md
CHANGED
|
@@ -53,14 +53,12 @@ The `dev` command starts a Lowdefy development server, running locally. It can b
|
|
|
53
53
|
- `--log-level <level>`: The minimum severity of logs to show in the CLI output. Options are `debug`, `info`, `warn` or `error`. The default is `info`.
|
|
54
54
|
- `--mock-user [user]`: Start the dev server authenticated as a mock user, bypassing the login flow. Pass a JSON user object to set the identity and roles (e.g. `--mock-user '{"sub":"dev","roles":["admin"]}'`), or use the bare flag for a default user with no roles. This is the same mechanism as `auth.dev.mockUser`. Dev server only. See [Auth Configuration](/auth-configuration#mock-user-for-testing-dev-server-only).
|
|
55
55
|
- `--no-open`: Do not open a new tab in the default browser.
|
|
56
|
-
- `--port <port>`: Change the port the server is hosted at. The default is `3000`.
|
|
56
|
+
- `--port <port>`: Change the port the server is hosted at. The default is `3000`.
|
|
57
57
|
- `--ref-resolver <ref-resolver-function-path>`: Path to a JavaScript file containing a `_ref` resolver function to be used as the app default `_ref` resolver.
|
|
58
58
|
- `--watch <paths...>`: A list of paths to files or directories that should be watched for changes. Globs are supported. Specify each path to watch separated by spaces.
|
|
59
59
|
- `--watch-ignore <patterns...>`: A list of paths to files or directories that should be ignored by the file watcher. Globs are supported. Specify each path to watch separated by spaces.
|
|
60
60
|
- `--skip-codemod-check`: Suppress warnings about pending codemod upgrades.
|
|
61
61
|
|
|
62
|
-
One app runs one dev server. The running server records itself in `.lowdefy/instance.json` (its pid, port, URL, state and whether a person or the [Lowdefy hub](#hub) started it), and a second `lowdefy dev` for the same app exits before touching anything, naming the server already running. A record copied from another checkout (for example into a git worktree) is ignored.
|
|
63
|
-
|
|
64
62
|
## emails
|
|
65
63
|
|
|
66
64
|
The `emails` command previews the [notification](/notifications) emails your app renders, using [React Email](https://react.email/)'s preview server. It builds the app, renders each notification from its `testData`, and opens the preview so you can iterate on templates without sending real mail. It warns when a template renders a data key your `testData` is missing (which would show as an empty section), and errors if the app has no `notifications:` section.
|
|
@@ -76,27 +74,12 @@ The preview tooling (`react-email`) is installed just-in-time by this command
|
|
|
76
74
|
|
|
77
75
|
## agent-setup
|
|
78
76
|
|
|
79
|
-
The `agent-setup` command sets up a project for AI coding agents. It writes `.mcp.json` registering the [`lowdefy-docs` MCP
|
|
77
|
+
The `agent-setup` command sets up a project for AI coding agents. It writes `.mcp.json` registering the dev server's [`lowdefy-docs` MCP endpoint](/ai-agent-docs), a Claude Code skill at `.claude/skills/lowdefy-config/SKILL.md`, and a `## Lowdefy` section in `AGENTS.md`. Existing files are merged, not overwritten.
|
|
80
78
|
|
|
81
79
|
- `--config-directory <config-directory>`: Change the config directory. The default is the current working directory.
|
|
82
80
|
- `--disable-telemetry`: Disable telemetry.
|
|
83
81
|
- `--log-level <level>`: The minimum severity of logs to show in the CLI output. Options are `debug`, `info`, `warn` or `error`. The default is `info`.
|
|
84
|
-
- `--
|
|
85
|
-
|
|
86
|
-
## mcp
|
|
87
|
-
|
|
88
|
-
The `mcp` command runs the Lowdefy MCP server for coding agents over stdio. Agent clients start it themselves from `.mcp.json` (see `agent-setup`), one per session — you do not run it by hand. It routes every tool call to the dev server of the app and git checkout the agent is working in, and starts that server through the [hub](#hub) when it is not running. See [AI agent docs](/ai-agent-docs).
|
|
89
|
-
|
|
90
|
-
## hub
|
|
91
|
-
|
|
92
|
-
The Lowdefy hub is a small per-user background process that runs dev servers for coding agents. `lowdefy mcp` starts it when an agent first needs a dev server, and it exits on its own after ten idle minutes. It gives each app its own port (from 4100 up, kept across restarts), runs the app's own dev script, and stops a server when no agent session has used it for 30 minutes and no browser tab has it open, or when its directory is removed. It only ever stops servers it started: a `lowdefy dev` you run in a terminal is used by agents but never stopped by them.
|
|
93
|
-
|
|
94
|
-
- `lowdefy hub status`: List the dev servers the hub runs.
|
|
95
|
-
- `lowdefy hub start [directory] [--restart] [--clean]`: Start (or return) an app's dev server through the hub. `--clean` deletes the build directory first.
|
|
96
|
-
- `lowdefy hub stop [directory] [--all]`: Stop a dev server the hub runs, or all of them.
|
|
97
|
-
- `lowdefy hub logs [directory] [--lines <n>] [--grep <text>]`: Print the recent output of a dev server the hub runs.
|
|
98
|
-
|
|
99
|
-
The hub keeps its state in `~/.lowdefy/hub` (set `LOWDEFY_HOME` to move it). It starts servers with the script `cli.devScript` names, or the one `package.json` script that runs `lowdefy dev`, so wrappers such as a secrets manager apply to agent-started servers too.
|
|
82
|
+
- `--port <port>`: The port your dev server runs on, used in the generated URLs. The default is `3000`.
|
|
100
83
|
|
|
101
84
|
## init
|
|
102
85
|
|
|
@@ -130,19 +113,6 @@ The `init-vercel` command initializes the installation scripts needed to deploy
|
|
|
130
113
|
- `--disable-telemetry`: Disable telemetry.
|
|
131
114
|
- `--log-level <level>`: The minimum severity of logs to show in the CLI output. Options are `debug`, `info`, `warn` or `error`. The default is `info`.
|
|
132
115
|
|
|
133
|
-
## test
|
|
134
|
-
|
|
135
|
-
The `test` command runs the app's config tests — the journeys in `tests/journeys/*.yaml`. It starts the development server headless on a free port, runs every journey through the dev server's journey route, prints `PASS`/`FAIL` per journey with the failing step, stops the server, and exits with code `1` if any journey failed. See [Config Tests](/config-tests).
|
|
136
|
-
|
|
137
|
-
- `--config-directory <config-directory>`: Change the config directory. The default is the current working directory.
|
|
138
|
-
- `--dev-directory <dev-directory>`: Change the dev directory, the directory in which the development server is placed. The default is `<config-directory>/.lowdefy/dev`.
|
|
139
|
-
- `--disable-telemetry`: Disable telemetry.
|
|
140
|
-
- `--filter <name>`: Only run journeys whose `name` contains this string (case-insensitive). Exits with code `1` if no journey matches.
|
|
141
|
-
- `--log-level <level>`: The minimum severity of logs to show in the CLI output. Options are `debug`, `info`, `warn` or `error`. The default is `info`.
|
|
142
|
-
- `--port <port>`: The port to start the development server on. If it is in use, the next free port is used. The default is `3000`.
|
|
143
|
-
- `--ref-resolver <ref-resolver-function-path>`: Path to a JavaScript file containing a `_ref` resolver function to be used as the app default `_ref` resolver.
|
|
144
|
-
- `--url <url>`: Run the journeys against an already running development server (for example `--url http://localhost:3000` while `lowdefy dev` is running) instead of starting one.
|
|
145
|
-
|
|
146
116
|
## upgrade
|
|
147
117
|
|
|
148
118
|
The `upgrade` command upgrades a Lowdefy app to a newer version by walking you through migration prompts that handle breaking changes.
|
|
@@ -217,7 +187,6 @@ All the CLI options can either be set as command line options, or the `cli` conf
|
|
|
217
187
|
|
|
218
188
|
Options set in the `lowdefy.yaml` should be defined in camelCase. The options that can be set are:
|
|
219
189
|
- `devDirectory: string`: Change the dev directory, the directory in which the development server is placed. The default is `<config-directory>/.lowdefy/dev`.
|
|
220
|
-
- `devScript: string`: The `package.json` script the [hub](#hub) runs to start this app's dev server for coding agents. Required when several scripts run `lowdefy dev`.
|
|
221
190
|
- `disableTelemetry: boolean`: Disable telemetry.
|
|
222
191
|
- `logLevel: enum`: The minimum severity of logs to show in the CLI output. Options are `debug`, `info`, `warn` or `error`. The default is `info`.
|
|
223
192
|
- `noOpen`: Do not open a new tab in the default browser.
|
|
@@ -4,406 +4,4 @@ In a Lowdefy app you can integrate with other services like API's or databases u
|
|
|
4
4
|
|
|
5
5
|
> Sensitive information like passwords or API keys are often required to use external services. The <a href = "./_secret">_secret</a> operator should be used to reference these secrets, they should never be coded directly in your app, or committed to source control.
|
|
6
6
|
|
|
7
|
-
To implement requests, the following steps are required:
|
|
8
|
-
- Define a connection.
|
|
9
|
-
- Define a request.
|
|
10
|
-
- Call the request using a [Request](/Request) action.
|
|
11
|
-
- Use returned data by making use of the [_request](/_request) operator.
|
|
12
|
-
|
|
13
|
-
## Connections
|
|
14
|
-
|
|
15
|
-
Connections are defined at the root of your Lowdefy configuration, in the `connections` array. Each connection must have an `id`, a `type`, and `properties` defining the connection. Operators in connection properties are evaluated every time a request is called.
|
|
16
|
-
|
|
17
|
-
The schema for a Lowdefy connection is:
|
|
18
|
-
|
|
19
|
-
- `id: string`: __Required__ - A unique identifier for the connection. This is used by requests to specify which connection to use.
|
|
20
|
-
- `type: string`: __Required__ - The connection type to be used.
|
|
21
|
-
- `properties: object`: The settings passed to the connection. __Operators are evaluated__.
|
|
22
|
-
|
|
23
|
-
###### Connections definition example:
|
|
24
|
-
```yaml
|
|
25
|
-
lowdefy: 6.0.0
|
|
26
|
-
connections:
|
|
27
|
-
- id: connection1
|
|
28
|
-
type: ConnectionType1
|
|
29
|
-
properties:
|
|
30
|
-
# ...
|
|
31
|
-
- id: connection2
|
|
32
|
-
type: ConnectionType2
|
|
33
|
-
properties:
|
|
34
|
-
# ...
|
|
35
|
-
pages:
|
|
36
|
-
# ...
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Our goal is to make connections for everything. As the Lowdefy community grows, we will continue to develop the most requested connections. If the connection you require is not supported yet, please head over to our [new connections voting board](https://github.com/lowdefy/lowdefy/discussions/309) to request and vote for new connections.
|
|
40
|
-
|
|
41
|
-
## Requests
|
|
42
|
-
|
|
43
|
-
Requests can be defined on any block, and the results of the request can be access using the `_request` operator anywhere on the same page. Requests must have an `id`, `type`, `connectionId` field specifying the connection to use, and `properties` defining the request settings. Requests can be called using the [`Request`](/Request) action.
|
|
44
|
-
|
|
45
|
-
Data that should be passed to the request from the client can be defined in the `payload` field. Operators can be used to create the payload. An example of this would be to use the `_state` operator to include the value of an input block in the payload. The data in the payload can be accessed in the request by making use of the [`_payload`](/_payload) operator in the `properties` field. The operators defined in the properties field are evaluated on the server, while those defined in the payload field are evaluated on the client. Operators in the request are evaluated every time a request is called.
|
|
46
|
-
|
|
47
7
|
> The <code>_user</code> operator should be used under <code>properties</code> and not <code>payload</code>. This is important since operators under <code>payload</code> are evaluated on the client, and are therefore vulnerable to users with malicious intent.
|
|
48
|
-
|
|
49
|
-
The schema for a Lowdefy request is:
|
|
50
|
-
|
|
51
|
-
- `id: string`: __Required__ - A identifier for the request. It must be unique within the page the request is defined in.
|
|
52
|
-
- `type: string`: __Required__ - The request type to be used. It must be a type supported by the connection type.
|
|
53
|
-
- `payload: object`: The operators to be used inside of the request. __Operators are evaluated on the client__.
|
|
54
|
-
- `connectionId: string`: __Required__ - The `id` of the connection that should be used.
|
|
55
|
-
- `properties: object`: The settings passed to the request. Make use of [`_payload`](/_payload) operator to use operators that were evaluated in `payload` mentioned above. __Operators are evaluated on the server__.
|
|
56
|
-
|
|
57
|
-
###### Requests definition example:
|
|
58
|
-
```yaml
|
|
59
|
-
id: block_with_requests
|
|
60
|
-
type: BlockType
|
|
61
|
-
requests:
|
|
62
|
-
- id: request1
|
|
63
|
-
type: RequestType1
|
|
64
|
-
connectionId: connectionId1 # Connection with id: connectionId1 must be defined
|
|
65
|
-
payload:
|
|
66
|
-
field:
|
|
67
|
-
_state: field
|
|
68
|
-
properties:
|
|
69
|
-
# ...
|
|
70
|
-
- id: request2
|
|
71
|
-
type: RequestType2
|
|
72
|
-
connectionId: connectionId2 # Connection with id: connectionId2 must be defined
|
|
73
|
-
properties:
|
|
74
|
-
# ...
|
|
75
|
-
properties:
|
|
76
|
-
# ...
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Request Action
|
|
80
|
-
|
|
81
|
-
The `Request` action calls a request, or if used during an `onInit` event, calls those requests while a page loads. Read more about the `Request` action [here](/Request).
|
|
82
|
-
|
|
83
|
-
###### Call a single request:
|
|
84
|
-
```yaml
|
|
85
|
-
- id: call_one_request
|
|
86
|
-
type: Request
|
|
87
|
-
params: request1
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## _request operator
|
|
91
|
-
|
|
92
|
-
The `_request` operator returns the response value of a request. If the request has not yet been called, or is still executing, the returned value is `null`. Read more about the `_request` operator [here](/_request). For more detailed information about a request, the [_request_details](/_request_details) operator can be used.
|
|
93
|
-
|
|
94
|
-
###### Using a request response:
|
|
95
|
-
```yaml
|
|
96
|
-
_request: my_request
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## General Example
|
|
100
|
-
|
|
101
|
-
###### lowdefy.yaml
|
|
102
|
-
```yaml
|
|
103
|
-
lowdefy: 6.0.0
|
|
104
|
-
|
|
105
|
-
connections:
|
|
106
|
-
- id: connection1
|
|
107
|
-
type: ConnectionType1
|
|
108
|
-
properties:
|
|
109
|
-
# ...
|
|
110
|
-
|
|
111
|
-
pages:
|
|
112
|
-
- id: page1
|
|
113
|
-
type: PageHeaderMenu
|
|
114
|
-
properties:
|
|
115
|
-
title: Page 1
|
|
116
|
-
requests:
|
|
117
|
-
- id: request1
|
|
118
|
-
type: RequestType1
|
|
119
|
-
connectionId: connection1
|
|
120
|
-
properties:
|
|
121
|
-
# ...
|
|
122
|
-
events:
|
|
123
|
-
onInit:
|
|
124
|
-
- id: call_request
|
|
125
|
-
type: Request
|
|
126
|
-
params: request1
|
|
127
|
-
blocks:
|
|
128
|
-
- id: content_card
|
|
129
|
-
type: Card
|
|
130
|
-
blocks:
|
|
131
|
-
- id: paragraph
|
|
132
|
-
type: Paragraph
|
|
133
|
-
properties:
|
|
134
|
-
content:
|
|
135
|
-
_request: request1
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Working Example
|
|
139
|
-
|
|
140
|
-
For this example, a connection to [{JSON}Placeholder](https://jsonplaceholder.typicode.com/) will be used.
|
|
141
|
-
To create this `connection`, define the connection as follows in the `lowdefy.yaml` file:
|
|
142
|
-
|
|
143
|
-
###### lowdefy.yaml
|
|
144
|
-
```yaml
|
|
145
|
-
lowdefy: 6.0.0
|
|
146
|
-
|
|
147
|
-
connections:
|
|
148
|
-
- id: my_api
|
|
149
|
-
type: AxiosHttp
|
|
150
|
-
properties:
|
|
151
|
-
baseURL: https://jsonplaceholder.typicode.com
|
|
152
|
-
|
|
153
|
-
pages:
|
|
154
|
-
- id: home
|
|
155
|
-
type: PageHeaderMenu
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
To use this connection, a `request` must be defined, which references the corresponding `connectionId`. A request to get the list of users can be added to the home page as follows:
|
|
159
|
-
|
|
160
|
-
###### lowdefy.yaml
|
|
161
|
-
```yaml
|
|
162
|
-
lowdefy: 6.0.0
|
|
163
|
-
|
|
164
|
-
connections:
|
|
165
|
-
- id: my_api
|
|
166
|
-
type: AxiosHttp
|
|
167
|
-
properties:
|
|
168
|
-
baseURL: https://jsonplaceholder.typicode.com
|
|
169
|
-
|
|
170
|
-
pages:
|
|
171
|
-
- id: home
|
|
172
|
-
type: PageHeaderMenu
|
|
173
|
-
|
|
174
|
-
requests:
|
|
175
|
-
- id: get_users
|
|
176
|
-
type: AxiosHttp
|
|
177
|
-
connectionId: my_api
|
|
178
|
-
properties:
|
|
179
|
-
url: /users
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
This request should be called when the page is mounted. To do this, the [`Request`](/Request) action will be used during the `onMount` event of the home page[`PageHeaderMenu`](/PageHeaderMenu) block.
|
|
183
|
-
|
|
184
|
-
###### lowdefy.yaml
|
|
185
|
-
```yaml
|
|
186
|
-
lowdefy: 6.0.0
|
|
187
|
-
|
|
188
|
-
connections:
|
|
189
|
-
- id: my_api
|
|
190
|
-
type: AxiosHttp
|
|
191
|
-
properties:
|
|
192
|
-
baseURL: https://jsonplaceholder.typicode.com
|
|
193
|
-
|
|
194
|
-
pages:
|
|
195
|
-
- id: home
|
|
196
|
-
type: PageHeaderMenu
|
|
197
|
-
|
|
198
|
-
requests:
|
|
199
|
-
- id: get_users
|
|
200
|
-
type: AxiosHttp
|
|
201
|
-
connectionId: my_api
|
|
202
|
-
properties:
|
|
203
|
-
url: /users
|
|
204
|
-
|
|
205
|
-
events:
|
|
206
|
-
onMount:
|
|
207
|
-
- id: fetch_get_users
|
|
208
|
-
type: Request
|
|
209
|
-
params: get_users
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
A block can be added to the page, that can use or display the data returned by this request. The [`_request`](/_request) operator is used to get the the results of the request.
|
|
213
|
-
In this example, a [`Selector`](/Selector) block will be added. The [`_array.map`](/_array) operator is used to get the data in a form that can be used by the Selector.
|
|
214
|
-
|
|
215
|
-
###### lowdefy.yaml
|
|
216
|
-
```yaml
|
|
217
|
-
lowdefy: 6.0.0
|
|
218
|
-
|
|
219
|
-
connections:
|
|
220
|
-
- id: my_api
|
|
221
|
-
type: AxiosHttp
|
|
222
|
-
properties:
|
|
223
|
-
baseURL: https://jsonplaceholder.typicode.com
|
|
224
|
-
|
|
225
|
-
pages:
|
|
226
|
-
- id: home
|
|
227
|
-
type: PageHeaderMenu
|
|
228
|
-
|
|
229
|
-
requests:
|
|
230
|
-
- id: get_users
|
|
231
|
-
type: AxiosHttp
|
|
232
|
-
connectionId: my_api
|
|
233
|
-
properties:
|
|
234
|
-
url: /users
|
|
235
|
-
|
|
236
|
-
events:
|
|
237
|
-
onMount:
|
|
238
|
-
- id: fetch_get_users
|
|
239
|
-
type: Request
|
|
240
|
-
params: get_users
|
|
241
|
-
|
|
242
|
-
blocks:
|
|
243
|
-
- id: user_id
|
|
244
|
-
type: Selector
|
|
245
|
-
properties:
|
|
246
|
-
title: Select a User
|
|
247
|
-
options:
|
|
248
|
-
_array.map:
|
|
249
|
-
- _request: get_users.data
|
|
250
|
-
- _function:
|
|
251
|
-
label:
|
|
252
|
-
__args: 0.name
|
|
253
|
-
value:
|
|
254
|
-
__args: 0.id
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
To get the posts made by the selected user, a new request should be created and called once the value of the Selector changes.
|
|
258
|
-
To do this, create a new request that will make use of a `payload` to get the posts with the selected user id. Add an `onChange` event on the `Selector` block, during which the new request is called.
|
|
259
|
-
|
|
260
|
-
###### lowdefy.yaml
|
|
261
|
-
```yaml
|
|
262
|
-
lowdefy: 6.0.0
|
|
263
|
-
|
|
264
|
-
connections:
|
|
265
|
-
- id: my_api
|
|
266
|
-
type: AxiosHttp
|
|
267
|
-
properties:
|
|
268
|
-
baseURL: https://jsonplaceholder.typicode.com
|
|
269
|
-
|
|
270
|
-
pages:
|
|
271
|
-
- id: home
|
|
272
|
-
type: PageHeaderMenu
|
|
273
|
-
|
|
274
|
-
requests:
|
|
275
|
-
- id: get_users
|
|
276
|
-
type: AxiosHttp
|
|
277
|
-
connectionId: my_api
|
|
278
|
-
properties:
|
|
279
|
-
url: /users
|
|
280
|
-
- id: get_posts
|
|
281
|
-
type: AxiosHttp
|
|
282
|
-
connectionId: my_api
|
|
283
|
-
payload:
|
|
284
|
-
id:
|
|
285
|
-
_state: user_id
|
|
286
|
-
properties:
|
|
287
|
-
url:
|
|
288
|
-
_string.concat:
|
|
289
|
-
- /users/
|
|
290
|
-
- _payload: id
|
|
291
|
-
- /posts
|
|
292
|
-
|
|
293
|
-
events:
|
|
294
|
-
onMount:
|
|
295
|
-
- id: fetch_get_users
|
|
296
|
-
type: Request
|
|
297
|
-
params: get_users
|
|
298
|
-
|
|
299
|
-
blocks:
|
|
300
|
-
- id: user_id
|
|
301
|
-
type: Selector
|
|
302
|
-
properties:
|
|
303
|
-
title: Select a User
|
|
304
|
-
options:
|
|
305
|
-
_array.map:
|
|
306
|
-
- _request: get_users.data
|
|
307
|
-
- _function:
|
|
308
|
-
label:
|
|
309
|
-
__args: 0.name
|
|
310
|
-
value:
|
|
311
|
-
__args: 0.id
|
|
312
|
-
events:
|
|
313
|
-
onChange:
|
|
314
|
-
- id: fetch_get_posts
|
|
315
|
-
type: Request
|
|
316
|
-
params: get_posts
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
Set the data from the result of this request in state by using the [`SetState`](/SetState) action. To display the posts, make use of a [`List`](/List) block. In this `List` block, display the data returned of each post in a [`Markdown`](/Markdown) block.
|
|
320
|
-
This is done as follows:
|
|
321
|
-
|
|
322
|
-
###### lowdefy.yaml
|
|
323
|
-
```yaml
|
|
324
|
-
lowdefy: 6.0.0
|
|
325
|
-
|
|
326
|
-
connections:
|
|
327
|
-
- id: my_api
|
|
328
|
-
type: AxiosHttp
|
|
329
|
-
properties:
|
|
330
|
-
baseURL: https://jsonplaceholder.typicode.com
|
|
331
|
-
|
|
332
|
-
pages:
|
|
333
|
-
- id: home
|
|
334
|
-
type: PageHeaderMenu
|
|
335
|
-
|
|
336
|
-
requests:
|
|
337
|
-
- id: get_users
|
|
338
|
-
type: AxiosHttp
|
|
339
|
-
connectionId: my_api
|
|
340
|
-
properties:
|
|
341
|
-
url: /users
|
|
342
|
-
|
|
343
|
-
- id: get_posts
|
|
344
|
-
type: AxiosHttp
|
|
345
|
-
connectionId: my_api
|
|
346
|
-
payload:
|
|
347
|
-
id:
|
|
348
|
-
_state: user_id
|
|
349
|
-
properties:
|
|
350
|
-
url:
|
|
351
|
-
_string.concat:
|
|
352
|
-
- /users/
|
|
353
|
-
- _payload: id
|
|
354
|
-
- /posts
|
|
355
|
-
|
|
356
|
-
events:
|
|
357
|
-
onMount:
|
|
358
|
-
- id: fetch_get_users
|
|
359
|
-
type: Request
|
|
360
|
-
params: get_users
|
|
361
|
-
|
|
362
|
-
blocks:
|
|
363
|
-
- id: user_id
|
|
364
|
-
type: Selector
|
|
365
|
-
properties:
|
|
366
|
-
title: Select a User
|
|
367
|
-
options:
|
|
368
|
-
_array.map:
|
|
369
|
-
- _request: get_users.data
|
|
370
|
-
- _function:
|
|
371
|
-
label:
|
|
372
|
-
__args: 0.name
|
|
373
|
-
value:
|
|
374
|
-
__args: 0.id
|
|
375
|
-
events:
|
|
376
|
-
onChange:
|
|
377
|
-
- id: fetch_get_posts
|
|
378
|
-
type: Request
|
|
379
|
-
params: get_posts
|
|
380
|
-
- id: set_posts
|
|
381
|
-
type: SetState
|
|
382
|
-
params:
|
|
383
|
-
posts:
|
|
384
|
-
_request: get_posts.data
|
|
385
|
-
|
|
386
|
-
- id: posts
|
|
387
|
-
type: List
|
|
388
|
-
blocks:
|
|
389
|
-
- id: posts.$
|
|
390
|
-
type: Markdown
|
|
391
|
-
style:
|
|
392
|
-
padding: 10
|
|
393
|
-
properties:
|
|
394
|
-
content:
|
|
395
|
-
_string.concat:
|
|
396
|
-
- |
|
|
397
|
-
```yaml
|
|
398
|
-
- _custom_yaml_stringify:
|
|
399
|
-
- _state: posts.$
|
|
400
|
-
- |
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
### TLDR
|
|
406
|
-
- `connections` define links to other services, like connecting to a database. They are defined at the root of the lowdefy configuration.
|
|
407
|
-
- `requests` use connections to make a call to the connected external services.
|
|
408
|
-
- Use the `payload` object on a request to pass data such as state values from the app client to the server as required.
|
|
409
|
-
- Use the [`_secret`](/_secret) operator to reference API keys or other secrets as required - do not code secrets into your config or commit secrets to your config source control.
|
|
@@ -1,43 +1,3 @@
|
|
|
1
1
|
# Custom HTML
|
|
2
2
|
|
|
3
3
|
> SECURITY WARNING: Custom HTML can execute JavaScript inside your Lowdefy app. Insecure code can expose your app or data. Since Lowdefy doesn't validate your custom code, make sure that you only load trusted code.
|
|
4
|
-
|
|
5
|
-
It is possible to extend the functionality of a Lowdefy app by loading custom code (HTML, CSS and JavaScript) into the HTML `head` and `body` of all pages. This can be useful for executing third party code such as Google Analytics, Intercom, etc. However, if the goal is to extend the functionality of your Lowdefy app with custom blocks, operators, actions or requests, use [plugins](/plugins).
|
|
6
|
-
|
|
7
|
-
The content loaded into the `head` and `body` tag can be any valid HTML. Be sure to only load trusted code into your app, as this code will be able to execute JavaScript on all pages of your Lowdefy app, which could expose you app or data to security vulnerabilities. Your own code can also be hosted from the [Lowdefy public folder](/hosting-files).
|
|
8
|
-
|
|
9
|
-
## Schema to load custom code
|
|
10
|
-
|
|
11
|
-
- `app.html.appendHead: string`: Any valid HTML content can be loaded just before the `</head>` tag of the page.
|
|
12
|
-
- `app.html.appendBody: string`: Any valid HTML content can be loaded just before the `</body>` tag of the page.
|
|
13
|
-
|
|
14
|
-
Most often it is convenient to abstract this HTML out to a separate file using the [`_ref`](/_ref) operator.
|
|
15
|
-
|
|
16
|
-
> __Warning__: Code imported using `appendHead` or `appendBody` will be loaded, and can execute JavaScript on every page of your Lowdefy app.
|
|
17
|
-
|
|
18
|
-
#### Examples
|
|
19
|
-
|
|
20
|
-
###### Loading third party code snippet like Google Analytics:
|
|
21
|
-
|
|
22
|
-
To add [Google Analytics](/https://developers.google.com/analytics/devguides/collection/analyticsjs) to a Lowdefy app, the `lowdefy.yaml` can be setup with:
|
|
23
|
-
|
|
24
|
-
```yaml
|
|
25
|
-
name: google-analytics-example
|
|
26
|
-
lowdefy: 6.0.0
|
|
27
|
-
# ...
|
|
28
|
-
app:
|
|
29
|
-
html:
|
|
30
|
-
appendHead: |
|
|
31
|
-
<!-- Google Analytics -->
|
|
32
|
-
<script>
|
|
33
|
-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
34
|
-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
35
|
-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
36
|
-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
|
37
|
-
|
|
38
|
-
ga('create', 'UA-XXXXX-Y', 'auto');
|
|
39
|
-
ga('send', 'pageview');
|
|
40
|
-
</script>
|
|
41
|
-
<!-- End Google Analytics -->
|
|
42
|
-
# ...
|
|
43
|
-
```
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Lowdefy provides several ways to style blocks and customize the look of your app:
|
|
4
4
|
|
|
5
5
|
- **`class`** — Apply CSS class names (including Tailwind CSS utility classes) to blocks.
|
|
6
|
-
- **`style`** — Apply inline CSS styles to blocks. Use
|
|
6
|
+
- **`style`** — Apply inline CSS styles to blocks. Use `--`-prefixed keys to target specific parts (CSS slots).
|
|
7
7
|
- **`properties.theme`** — Override antd design tokens per block. See [Theming](/theming) for details.
|
|
8
8
|
- **`public/styles.css`** — A global CSS file for custom styles.
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ Lowdefy provides several ways to style blocks and customize the look of your app
|
|
|
11
11
|
|
|
12
12
|
The `class` property applies CSS class names to a block. [Tailwind CSS](https://tailwindcss.com/) is always available in Lowdefy apps, so you can use any Tailwind utility classes directly.
|
|
13
13
|
|
|
14
|
-
`class` can be a string, an array of strings, an object keyed by the block's CSS keys
|
|
14
|
+
`class` can be a string, an array of strings, or an object keyed by the block's CSS keys:
|
|
15
15
|
|
|
16
16
|
```yaml
|
|
17
17
|
# String — applied to the block wrapper
|
|
@@ -27,60 +27,15 @@ The `class` property applies CSS class names to a block. [Tailwind CSS](https://
|
|
|
27
27
|
- shadow-lg
|
|
28
28
|
- rounded-xl
|
|
29
29
|
|
|
30
|
-
# Object — target specific parts of the block using CSS keys (
|
|
30
|
+
# Object — target specific parts of the block using CSS keys (-- prefix)
|
|
31
31
|
- id: my_card
|
|
32
32
|
type: Card
|
|
33
33
|
class:
|
|
34
34
|
.element: "shadow-lg"
|
|
35
35
|
.header: "bg-gray-100"
|
|
36
36
|
.body: "p-8"
|
|
37
|
-
|
|
38
|
-
# Operator — the block's classes are computed at runtime
|
|
39
|
-
- id: status_badge
|
|
40
|
-
type: Box
|
|
41
|
-
class:
|
|
42
|
-
_if:
|
|
43
|
-
test:
|
|
44
|
-
_eq:
|
|
45
|
-
- _state: status
|
|
46
|
-
- error
|
|
47
|
-
then: bg-red-100 text-red-700
|
|
48
|
-
else: bg-green-100 text-green-700
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
An operator's result may be a string, an array of strings, or an object of `{ class: boolean }` where each class with a truthy value is applied:
|
|
52
|
-
|
|
53
|
-
```yaml
|
|
54
|
-
- id: status_badge
|
|
55
|
-
type: Box
|
|
56
|
-
class:
|
|
57
|
-
_if:
|
|
58
|
-
test:
|
|
59
|
-
_eq:
|
|
60
|
-
- _state: status
|
|
61
|
-
- error
|
|
62
|
-
then:
|
|
63
|
-
bg-red-100: true
|
|
64
|
-
text-red-700: true
|
|
65
|
-
else: bg-green-100
|
|
66
37
|
```
|
|
67
38
|
|
|
68
|
-
An operator at the root of `class` computes the classes of the block wrapper. To compute a specific part's classes, place the operator under that CSS key:
|
|
69
|
-
|
|
70
|
-
```yaml
|
|
71
|
-
- id: my_card
|
|
72
|
-
type: Card
|
|
73
|
-
class:
|
|
74
|
-
.header:
|
|
75
|
-
_if:
|
|
76
|
-
test:
|
|
77
|
-
_state: highlighted
|
|
78
|
-
then: bg-yellow-100
|
|
79
|
-
else: bg-gray-100
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
> **Note:** An operator's result is never expanded into a map of CSS keys — a root operator always sets the block wrapper's classes. A result with dot-prefixed keys (`{ .element: p-4 }`) is reported as a config error, and those keys are not applied as classes.
|
|
83
|
-
|
|
84
39
|
Tailwind responsive prefixes work as expected:
|
|
85
40
|
|
|
86
41
|
```yaml
|
|
@@ -103,7 +58,7 @@ See [Theming](/theming) for the full list of bridged tokens and how to add custo
|
|
|
103
58
|
|
|
104
59
|
## The `style` property
|
|
105
60
|
|
|
106
|
-
The `style` property applies inline CSS styles to a block. When used with flat CSS properties (no
|
|
61
|
+
The `style` property applies inline CSS styles to a block. When used with flat CSS properties (no `--` prefix), it targets the block's layout wrapper:
|
|
107
62
|
|
|
108
63
|
```yaml
|
|
109
64
|
- id: my_block
|
|
@@ -148,7 +103,7 @@ Each block's documentation page lists its supported CSS keys.
|
|
|
148
103
|
|
|
149
104
|
Each block declares named style targets in its `meta.cssKeys`. For example, the [Card](/Card) block supports: `element`, `header`, `body`, `cover`, `actions`, `extra`.
|
|
150
105
|
|
|
151
|
-
Both `class` (object form) and `style` use
|
|
106
|
+
Both `class` (object form) and `style` use `--`-prefixed versions of these keys to target specific parts of a block. The `--` prefix mirrors CSS custom property convention and avoids confusion with CSS property names.
|
|
152
107
|
|
|
153
108
|
To find the CSS keys for a block, check the block's documentation page.
|
|
154
109
|
|