@lowdefy/docs-content 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/README.md +1 -0
- package/content/actions/downloadcsv.md +1 -1
- package/content/actions/emailotpsend.md +58 -0
- package/content/actions/emailotpverify.md +79 -0
- package/content/actions/getlocalstorage.md +43 -0
- package/content/actions/link.md +47 -1
- package/content/actions/login.md +25 -5
- package/content/actions/logout.md +7 -5
- package/content/actions/magiclinkverify.md +117 -0
- package/content/actions/pdfmake.md +2 -2
- package/content/actions/posthogalias.md +29 -0
- package/content/actions/posthogcapture.md +49 -0
- package/content/actions/posthogcapturepageleave.md +38 -0
- package/content/actions/posthogfeatureflag.md +50 -0
- package/content/actions/posthoggroup.md +37 -0
- package/content/actions/posthogidentify.md +54 -0
- package/content/actions/posthoginit.md +96 -0
- package/content/actions/posthogoptin.md +29 -0
- package/content/actions/posthogoptout.md +29 -0
- package/content/actions/posthogpageview.md +37 -0
- package/content/actions/posthogreloadfeatureflags.md +47 -0
- package/content/actions/posthogreset.md +28 -0
- package/content/actions/posthogsetpersonproperties.md +36 -0
- package/content/actions/removelocalstorage.md +28 -0
- package/content/actions/resetvalidation.md +5 -3
- package/content/actions/setdarkmode.md +3 -3
- package/content/actions/setglobal.md +2 -0
- package/content/actions/setlocale.md +1 -1
- package/content/actions/setlocalstorage.md +34 -0
- package/content/actions/setstate.md +2 -0
- package/content/actions/validate.md +7 -4
- package/content/adapter-reference/mongodbauthadapter.md +46 -0
- package/content/agents/agent-endpoint-tools.md +24 -0
- package/content/agents/agent-properties.md +13 -3
- package/content/agents/agent-server-hooks.md +1 -1
- package/content/agents/agentchat.md +41 -4
- package/content/agents/agentconversations.md +42 -8
- package/content/agents/agents-introduction.md +107 -0
- package/content/callback-reference/auth0logoutcallback.md +54 -0
- package/content/concepts/ai-agent-docs.md +455 -106
- package/content/concepts/blocks.md +150 -0
- package/content/concepts/connections-and-requests.md +402 -0
- package/content/concepts/custom-html.md +42 -0
- package/content/concepts/custom-styling.md +50 -5
- package/content/concepts/dynamic-page-content.md +309 -0
- package/content/concepts/events-and-actions.md +185 -2
- package/content/concepts/four-primitives.md +31 -0
- package/content/concepts/html-attributes.md +293 -0
- package/content/concepts/i18n.md +12 -3
- package/content/concepts/keyboard-shortcuts.md +2 -2
- package/content/concepts/layout-overview.md +1 -1
- package/content/concepts/logger.md +99 -0
- package/content/concepts/lowdefy-api.md +1319 -0
- package/content/concepts/lowdefy-schema.md +144 -3
- package/content/concepts/menus.md +8 -7
- package/content/concepts/module-authoring.md +76 -5
- package/content/concepts/modules.md +3 -1
- package/content/concepts/notifications.md +180 -0
- package/content/concepts/operators.md +7 -0
- package/content/concepts/page-and-app-state.md +252 -0
- package/content/concepts/page-paths.md +209 -0
- package/content/concepts/theming.md +582 -0
- package/content/connections/aigateway.md +375 -0
- package/content/connections/anthropic.md +169 -2
- package/content/connections/awss3.md +178 -2
- package/content/connections/axioshttp.md +181 -0
- package/content/connections/google.md +169 -2
- package/content/connections/mongodb.md +1014 -3
- package/content/connections/openai-connection.md +169 -2
- package/content/connections/sendgridmail.md +3 -0
- package/content/connections/smtp.md +16 -0
- package/content/connections/treg.md +329 -0
- package/content/container-blocks/affix.md +47 -7
- package/content/container-blocks/alert.md +76 -24
- package/content/container-blocks/badge.md +100 -24
- package/content/container-blocks/box.md +9 -9
- package/content/container-blocks/card.md +132 -27
- package/content/container-blocks/carousel.md +60 -7
- package/content/container-blocks/collapse.md +153 -9
- package/content/container-blocks/configprovider.md +35 -13
- package/content/container-blocks/confirmmodal.md +69 -23
- package/content/container-blocks/content.md +62 -98
- package/content/container-blocks/descriptions.md +45 -4
- package/content/container-blocks/drawer.md +139 -28
- package/content/container-blocks/dropdownmenu.md +119 -31
- package/content/container-blocks/flex.md +40 -62
- package/content/container-blocks/footer.md +15 -11
- package/content/container-blocks/googlemapsheatmap.md +1 -1
- package/content/container-blocks/googlemapsscript.md +2 -2
- package/content/container-blocks/header.md +71 -36
- package/content/container-blocks/label.md +34 -7
- package/content/container-blocks/layout.md +52 -34
- package/content/container-blocks/masonry.md +17 -71
- package/content/container-blocks/mobilemenu.md +131 -88
- package/content/container-blocks/modal.md +161 -26
- package/content/container-blocks/pageheadermenu.md +138 -31
- package/content/container-blocks/pagesidebarlayout.md +230 -27
- package/content/container-blocks/pagesidermenu.md +153 -43
- package/content/container-blocks/popover.md +34 -31
- package/content/container-blocks/result.md +32 -21
- package/content/container-blocks/sider.md +85 -122
- package/content/container-blocks/span.md +7 -7
- package/content/container-blocks/spinner.md +3 -3
- package/content/container-blocks/splitter.md +150 -68
- package/content/container-blocks/tabs.md +64 -12
- package/content/container-blocks/tooltip.md +22 -46
- package/content/container-blocks/watermark.md +22 -4
- package/content/controls/parallel_for.md +21 -2
- package/content/controls/reject.md +26 -3
- package/content/controls/return.md +17 -1
- package/content/controls/throw.md +30 -2
- package/content/controls/try.md +24 -2
- package/content/controls/while.md +46 -0
- package/content/deployment/deployment-environments.md +146 -0
- package/content/deployment/docker.md +23 -7
- package/content/deployment/node-server.md +4 -0
- package/content/deployment/vercel.md +25 -19
- package/content/display-blocks/aggrid.md +33 -16
- package/content/display-blocks/anchor.md +16 -15
- package/content/display-blocks/avatar.md +57 -37
- package/content/display-blocks/breadcrumb.md +70 -21
- package/content/display-blocks/button.md +93 -19
- package/content/display-blocks/calendar.md +12 -0
- package/content/display-blocks/clickablehtml.md +239 -0
- 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 +64 -3
- package/content/display-blocks/dropdownbutton.md +81 -30
- package/content/display-blocks/echart.md +35 -1
- package/content/display-blocks/eventlog.md +363 -0
- package/content/display-blocks/floatbutton.md +129 -42
- package/content/display-blocks/html.md +61 -1
- package/content/display-blocks/icon.md +250 -67
- package/content/display-blocks/img.md +2 -2
- package/content/display-blocks/menu.md +146 -73
- package/content/display-blocks/message.md +38 -124
- package/content/display-blocks/notification.md +94 -222
- package/content/display-blocks/paragraph.md +59 -9
- package/content/display-blocks/pollingtimer.md +263 -0
- package/content/display-blocks/progress.md +96 -17
- package/content/display-blocks/qrcode.md +19 -4
- package/content/display-blocks/s3download.md +1 -1
- package/content/display-blocks/search.md +19 -9
- package/content/display-blocks/skeletonbutton.md +1 -0
- package/content/display-blocks/skeletoninput.md +1 -0
- package/content/display-blocks/statistic.md +75 -17
- package/content/display-blocks/steps.md +58 -25
- package/content/display-blocks/table.md +2527 -0
- package/content/display-blocks/tablelight.md +621 -0
- package/content/display-blocks/tag.md +102 -17
- package/content/display-blocks/title.md +50 -11
- package/content/display-blocks/tour.md +33 -23
- package/content/input-blocks/autocomplete.md +81 -9
- package/content/input-blocks/buttonselector.md +45 -8
- package/content/input-blocks/captcha.md +40 -0
- package/content/input-blocks/checkboxselector.md +97 -7
- package/content/input-blocks/checkboxswitch.md +33 -3
- package/content/input-blocks/colorselector.md +63 -14
- package/content/input-blocks/daterangeselector.md +165 -45
- package/content/input-blocks/dateselector.md +139 -41
- package/content/input-blocks/datetimeselector.md +158 -49
- package/content/input-blocks/inputgallery.md +3 -3
- package/content/input-blocks/intentinput.md +207 -0
- package/content/input-blocks/monthselector.md +120 -52
- package/content/input-blocks/multipleselector.md +150 -39
- package/content/input-blocks/numberinput.md +98 -12
- package/content/input-blocks/pagination.md +70 -14
- package/content/input-blocks/paragraphinput.md +51 -37
- package/content/input-blocks/passwordinput.md +60 -6
- package/content/input-blocks/phonenumberinput.md +59 -26
- package/content/input-blocks/placesautocomplete.md +319 -0
- package/content/input-blocks/radioselector.md +83 -7
- package/content/input-blocks/ratingslider.md +57 -26
- 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 +72 -32
- package/content/input-blocks/selector.md +109 -21
- package/content/input-blocks/switch.md +65 -17
- package/content/input-blocks/tableinput.md +445 -0
- package/content/input-blocks/tagmultipleselector.md +114 -0
- package/content/input-blocks/tagselector.md +114 -0
- package/content/input-blocks/textarea.md +32 -3
- package/content/input-blocks/textinput.md +70 -29
- package/content/input-blocks/tiptapinput.md +1 -1
- package/content/input-blocks/tiptapmentioninput.md +2 -2
- package/content/input-blocks/titleinput.md +39 -12
- package/content/input-blocks/treeinput.md +49 -25
- package/content/input-blocks/treemultipleselector.md +127 -10
- package/content/input-blocks/treeselector.md +97 -9
- package/content/input-blocks/upload.md +64 -15
- package/content/input-blocks/uploaddragger.md +17 -1
- package/content/input-blocks/uploadphoto.md +18 -1
- package/content/input-blocks/weekselector.md +120 -55
- package/content/learn/introduction.md +27 -0
- package/content/learn/quickstart.md +53 -0
- package/content/learn/showcase.md +8 -0
- package/content/list-blocks/controlledlist.md +24 -15
- package/content/list-blocks/list.md +11 -11
- package/content/list-blocks/masonrylist.md +7 -34
- package/content/migration/auth-upgrade.md +337 -0
- package/content/migration/upgrade-guide.md +1 -0
- package/content/migration/v3-to-v4.md +417 -0
- package/content/migration/v6-to-v7.md +620 -0
- package/content/operators/_agent.md +155 -0
- package/content/operators/_app.md +2 -1
- package/content/operators/_array.md +122 -1
- package/content/operators/_build.md +1 -0
- package/content/operators/_credential.md +57 -0
- package/content/operators/_cron.md +292 -0
- package/content/operators/_date.md +2 -0
- package/content/operators/_error.md +196 -0
- package/content/operators/_get.md +6 -6
- package/content/operators/_hmac.md +78 -0
- package/content/operators/_js.md +2 -1
- package/content/operators/_location.md +1 -1
- package/content/operators/_media.md +13 -0
- package/content/operators/_module.md +56 -2
- package/content/operators/_operator.md +17 -3
- package/content/operators/_path_params.md +82 -0
- package/content/operators/_ref.md +258 -0
- package/content/operators/_request.md +1 -1
- package/content/operators/_request_details.md +6 -0
- package/content/operators/_type.md +14 -3
- package/content/operators/_url_query.md +2 -0
- package/content/operators/_user.md +3 -3
- package/content/plugins/plugins-actions.md +10 -0
- package/content/plugins/plugins-connections.md +25 -0
- package/content/plugins/plugins-dev.md +66 -0
- package/content/plugins/plugins-icon-sets.md +267 -0
- package/content/plugins/plugins-introduction.md +27 -1
- package/content/plugins/plugins.md +19 -0
- package/content/plugins/posthog.md +359 -0
- package/content/provider-reference/auth-js-providers.md +107 -0
- package/content/provider-reference/openidconnectprovider.md +44 -0
- package/content/recipes/recipes.md +16 -0
- package/content/reference/actions-reference.md +31 -0
- package/content/reference/blocks-reference.md +35 -0
- package/content/reference/cli.md +403 -0
- package/content/reference/connections-reference.md +23 -0
- package/content/reference/operators-reference.md +47 -0
- package/content/reference/reference.md +16 -0
- package/content/reference/schema-reference.md +12 -0
- package/content/testing/config-tests.md +677 -0
- package/content/testing/e2e-configuration.md +31 -1
- package/content/testing/e2e-getting-started.md +1 -1
- package/content/testing/e2e-introduction.md +1 -1
- package/content/testing/e2e-writing-tests.md +12 -1
- package/content/testing/explore-pull-request.md +136 -0
- package/content/testing/journey-data-sets.md +326 -0
- 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 +48 -2
- package/content/tutorial/tutorial-display-data-page.md +3 -3
- package/content/tutorial/tutorial-requests-api.md +155 -0
- package/content/tutorial/tutorial-requests-sql.md +153 -0
- package/content/tutorial/tutorial-start.md +66 -1
- package/content/user-authentication/auth-configuration.md +267 -0
- package/content/user-authentication/auth-providers.md +24 -0
- package/content/user-authentication/auth-steps.md +141 -0
- package/content/user-authentication/login-and-logout.md +160 -8
- package/content/user-authentication/mcp-oauth.md +424 -0
- package/content/user-authentication/organizations.md +246 -0
- package/content/user-authentication/protected-pages-apis.md +97 -0
- package/content/user-authentication/roles.md +49 -0
- package/content/user-authentication/two-factor.md +229 -0
- package/content/user-authentication/user-object.md +58 -0
- package/content/user-authentication/users-introduction.md +8 -0
- package/content/websockets/websocket-publish.md +105 -0
- package/content/websockets/websocket-subscriptions.md +136 -0
- package/content/websockets/websockets-introduction.md +101 -0
- package/hazards.json +56 -0
- package/index.json +3472 -14
- package/package.json +10 -1
- package/scripts/extractAgentDocs.js +41 -30
- package/scripts/hashDocSources.js +38 -0
- package/scripts/isRedirectPage.js +26 -0
- package/scripts/recordSourceHashes.js +97 -0
- package/scripts/resolvePageSections.js +42 -0
- package/scripts/sectionKind.js +27 -0
- package/content/concepts/cli.md +0 -223
- package/content/other/introduction.md +0 -39
- package/content/other/next-auth-providers.md +0 -3
- /package/content/{other → actions}/updatesession.md +0 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# Icon Sets
|
|
2
|
+
|
|
3
|
+
Lowdefy draws icons with [Lucide](https://lucide.dev). An icon-set plugin adds icons as data: a whole set such as Tabler, a few icons of your own, or replacements for Lucide icons. Blocks, Ant Design components and HTML `data-icon` all draw set icons the same way as Lucide icons, with the app's `size`, `strokeWidth` and colour.
|
|
4
|
+
|
|
5
|
+
An icon set holds no React code. Each icon is a plain object that describes its SVG, and the build writes only the icons an app uses into the app bundle.
|
|
6
|
+
|
|
7
|
+
## Declare a set
|
|
8
|
+
|
|
9
|
+
A set has an id in lowercase kebab-case, such as `tabler`. The id is a namespace, so a plugin's `typePrefix` does not change it. Declare it in `types.js` under `iconSets`:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
// src/types.js
|
|
13
|
+
export default {
|
|
14
|
+
iconSets: ['tabler'],
|
|
15
|
+
};
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Export the set from a `./iconSets` entry point:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"name": "@my-app/icons-tabler",
|
|
23
|
+
"version": "1.0.0",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"exports": {
|
|
26
|
+
"./iconSets": "./src/iconSets.js",
|
|
27
|
+
"./types": "./src/types.js"
|
|
28
|
+
},
|
|
29
|
+
"files": ["src/*"]
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The `./iconSets` module runs only in Node, during the build and in the dev server. It exports an object with one entry per set id:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
// src/iconSets.js
|
|
37
|
+
export default {
|
|
38
|
+
tabler: {
|
|
39
|
+
attrs: undefined,
|
|
40
|
+
semantic: { edit: 'Pencil', delete: 'Trash' },
|
|
41
|
+
listIcons: async () => ['Pencil', 'Trash' /* ... */],
|
|
42
|
+
loadIcons: async ({ names }) => ({
|
|
43
|
+
Pencil: {
|
|
44
|
+
node: [
|
|
45
|
+
/* ... */
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
| Key | Required | Description |
|
|
54
|
+
| ----------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| `listIcons` | Yes | An async function that returns every icon name in the set. Search (`lowdefy_search_icons`) and the build's "did you mean" suggestions use it. |
|
|
56
|
+
| `loadIcons` | Yes | An async function that takes `{ names }` and returns `{ [name]: IconData }` for the names it has. Leave out names it does not have. |
|
|
57
|
+
| `attrs` | No | Root SVG attributes added to every icon of this set, such as `{ fill: 'currentColor', stroke: 'none' }` for a fill-based set. |
|
|
58
|
+
| `semantic` | No | A map from semantic names to icon names in this set. It applies when this set is the app's default set (`theme.icons.set`). |
|
|
59
|
+
|
|
60
|
+
The build calls `loadIcons` only with names the app uses, so a large set costs nothing until an app draws one of its icons.
|
|
61
|
+
|
|
62
|
+
Install the plugin like any other plugin. A set in the same pnpm workspace uses `workspace:*`:
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
plugins:
|
|
66
|
+
- name: '@my-app/icons-tabler'
|
|
67
|
+
version: 'workspace:*'
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Restart the dev server after you add an icon-set plugin.
|
|
71
|
+
|
|
72
|
+
## Icon names
|
|
73
|
+
|
|
74
|
+
Icon names in a set are PascalCase: `Pencil`, `ArrowLeftRight`. Convert kebab-case file names when you build the set. An app writes a set icon in one of two ways:
|
|
75
|
+
|
|
76
|
+
- `tabler:Pencil` — a qualified name. It resolves only in the `tabler` set.
|
|
77
|
+
- `Pencil` — a set name. It resolves in the app's default set (`theme.icons.set`, which is `lucide` unless the app changes it), then in Lucide.
|
|
78
|
+
|
|
79
|
+
## IconData
|
|
80
|
+
|
|
81
|
+
`loadIcons` returns each icon as `IconData`:
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
{
|
|
85
|
+
node: [
|
|
86
|
+
['path', { d: 'M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4' }],
|
|
87
|
+
['path', { d: 'M13.5 6.5l4 4' }],
|
|
88
|
+
],
|
|
89
|
+
size: 24,
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
| Key | Description |
|
|
94
|
+
| ----------------- | -------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `node` | Required. An array of `[tag, attrs, children?]`. `children` is another node array, so groups nest. |
|
|
96
|
+
| `size` | The viewBox size of a square icon: `size: 24` gives `viewBox="0 0 24 24"`. Defaults to 24. |
|
|
97
|
+
| `width`, `height` | Use these instead of `size` for an icon that is not square. |
|
|
98
|
+
| `attrs` | Root SVG attributes for this icon. |
|
|
99
|
+
|
|
100
|
+
Rules for the data:
|
|
101
|
+
|
|
102
|
+
- Attribute names are React names: `strokeWidth`, `fillRule`, `clipRule`, `className`, not `stroke-width` or `class`.
|
|
103
|
+
- The viewBox always starts at `0 0`. For a source with an offset viewBox such as `-2 -2 24 24`, wrap the nodes in `['g', { transform: 'translate(2 2)' }, nodes]`.
|
|
104
|
+
- Root `attrs` never set `strokeWidth`. Stroke width is an app setting (`theme.icons.strokeWidth`), so every set follows it. A set drawn at 1.5, such as Heroicons, should tell apps to set `theme.icons.strokeWidth: 1.5`. A `strokeWidth` on a single node inside `node` is fine.
|
|
105
|
+
- Leave out `key` attributes.
|
|
106
|
+
|
|
107
|
+
Every icon starts from Lucide's root attributes: `fill="none"`, `stroke="currentColor"`, round line caps and joins, and the app's stroke width. Stroke sets on a 24px grid, such as Tabler outline and `@lucide/lab`, need no `attrs`. A fill-based set sets `attrs: { fill: 'currentColor', stroke: 'none' }`. Draw with `currentColor`, so the icon's `color` works.
|
|
108
|
+
|
|
109
|
+
## Layers: the last plugin wins
|
|
110
|
+
|
|
111
|
+
Several plugins can declare the same set id. Each one adds a layer to the set, in `plugins` order. For `lucide`, Lowdefy's built-in Lucide data is the bottom layer.
|
|
112
|
+
|
|
113
|
+
- **Per icon name, the topmost layer that has it wins.** A layer can be partial. A name it lacks falls through to the layers below it.
|
|
114
|
+
- **`semantic` maps layer the same way.** From lowest to highest precedence: the built-in semantic names, then the `semantic` maps of the default set's layers in plugin order, then the app's `theme.icons.aliases`.
|
|
115
|
+
- **Qualified names stay in their set.** `tabler:Pencil` resolves through the `tabler` layers only. If no layer has it, it is unresolved, and the build fails at an icon property. It does not fall back to Lucide.
|
|
116
|
+
|
|
117
|
+
### Add one icon to Lucide
|
|
118
|
+
|
|
119
|
+
A plugin that declares `lucide` and has one icon makes that name work like any Lucide name, without a set prefix:
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
// types.js
|
|
123
|
+
export default { iconSets: ['lucide'] };
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
// iconSets.js
|
|
128
|
+
const Invoice = {
|
|
129
|
+
node: [
|
|
130
|
+
['path', { d: 'M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z' }],
|
|
131
|
+
['path', { d: 'M8 8h8' }],
|
|
132
|
+
['path', { d: 'M8 12h8' }],
|
|
133
|
+
['path', { d: 'M8 16h5' }],
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export default {
|
|
138
|
+
lucide: {
|
|
139
|
+
listIcons: async () => ['Invoice'],
|
|
140
|
+
loadIcons: async ({ names }) => (names.includes('Invoice') ? { Invoice } : {}),
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```yaml
|
|
146
|
+
- id: invoice_button
|
|
147
|
+
type: Button
|
|
148
|
+
properties:
|
|
149
|
+
title: Invoices
|
|
150
|
+
icon: Invoice
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Replace an icon
|
|
154
|
+
|
|
155
|
+
A layer that defines a name Lucide already has replaces it everywhere. If the layer above defines `Pencil`, every `Pencil` in the app draws the new glyph, and so do the semantic `edit` and every block that uses `edit`.
|
|
156
|
+
|
|
157
|
+
## Select a set
|
|
158
|
+
|
|
159
|
+
`theme.icons.set` makes a set the app's default set:
|
|
160
|
+
|
|
161
|
+
```yaml
|
|
162
|
+
theme:
|
|
163
|
+
icons:
|
|
164
|
+
set: tabler
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
- PascalCase names resolve in the Tabler layers first, then in Lucide. Every Lucide name keeps working.
|
|
168
|
+
- The Tabler layers' `semantic` maps override the built-in semantic names. So the set re-skins block icons and Ant Design icons (close buttons, alert status icons, select arrows) as far as its map covers them. Semantic names it leaves out keep their Lucide icons.
|
|
169
|
+
- The app's `theme.icons.aliases` still win over both.
|
|
170
|
+
|
|
171
|
+
`theme.icons.set` must name the built-in `lucide` set or an installed set, or the build fails.
|
|
172
|
+
|
|
173
|
+
## Example: Tabler outline icons
|
|
174
|
+
|
|
175
|
+
[Tabler](https://tabler.io/icons) outline icons use the same 24px grid and stroke attributes as Lucide. The `@tabler/icons` package ships them as node arrays in `tabler-nodes-outline.json`, keyed by kebab-case name. Convert them once, when you build the plugin package, and read the JSON in `iconSets.js`.
|
|
176
|
+
|
|
177
|
+
```js
|
|
178
|
+
// scripts/convertIcons.js - run with `node scripts/convertIcons.js`
|
|
179
|
+
import fs from 'fs';
|
|
180
|
+
|
|
181
|
+
const source = new URL('../node_modules/@tabler/icons/tabler-nodes-outline.json', import.meta.url);
|
|
182
|
+
const target = new URL('../src/tablerOutline.json', import.meta.url);
|
|
183
|
+
|
|
184
|
+
function toPascalCase(name) {
|
|
185
|
+
return name
|
|
186
|
+
.split('-')
|
|
187
|
+
.map((part) => part[0].toUpperCase() + part.slice(1))
|
|
188
|
+
.join('');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const nodes = JSON.parse(fs.readFileSync(source, 'utf8'));
|
|
192
|
+
const icons = {};
|
|
193
|
+
Object.entries(nodes).forEach(([name, node]) => {
|
|
194
|
+
icons[toPascalCase(name)] = { node };
|
|
195
|
+
});
|
|
196
|
+
fs.writeFileSync(target, JSON.stringify(icons));
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
`pencil` becomes `Pencil`, and `arrow-left-right` becomes `ArrowLeftRight`. The file already leaves out Tabler's invisible bounding-box path, and its attributes are React names, so it needs no other changes.
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
// src/iconSets.js
|
|
203
|
+
import { readFile } from 'fs/promises';
|
|
204
|
+
|
|
205
|
+
let iconsPromise;
|
|
206
|
+
|
|
207
|
+
function readIcons() {
|
|
208
|
+
iconsPromise ??= readFile(new URL('./tablerOutline.json', import.meta.url), 'utf8').then(
|
|
209
|
+
JSON.parse
|
|
210
|
+
);
|
|
211
|
+
return iconsPromise;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async function listIcons() {
|
|
215
|
+
return Object.keys(await readIcons());
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async function loadIcons({ names }) {
|
|
219
|
+
const icons = await readIcons();
|
|
220
|
+
const found = {};
|
|
221
|
+
names.forEach((name) => {
|
|
222
|
+
if (icons[name]) found[name] = icons[name];
|
|
223
|
+
});
|
|
224
|
+
return found;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export default {
|
|
228
|
+
tabler: {
|
|
229
|
+
semantic: {
|
|
230
|
+
add: 'Plus',
|
|
231
|
+
close: 'X',
|
|
232
|
+
delete: 'Trash',
|
|
233
|
+
edit: 'Pencil',
|
|
234
|
+
search: 'Search',
|
|
235
|
+
settings: 'Settings',
|
|
236
|
+
},
|
|
237
|
+
listIcons,
|
|
238
|
+
loadIcons,
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
```js
|
|
244
|
+
// src/types.js
|
|
245
|
+
export default { iconSets: ['tabler'] };
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
An app can now use `tabler:Pencil` anywhere, or set `theme.icons.set: tabler` to draw Tabler icons by default.
|
|
249
|
+
|
|
250
|
+
## The react-icons compatibility set
|
|
251
|
+
|
|
252
|
+
Lowdefy 6 and earlier used [react-icons](https://react-icons.github.io/react-icons/) names such as `AiOutlineUser`. `@lowdefy/icons-react-icons` is an icon set, `react-icons`, that holds every react-icons 5.6.0 icon under its old name. Use it when names come from data the build cannot rewrite, such as icon names stored in a database, or for brand icons that Lucide does not have.
|
|
253
|
+
|
|
254
|
+
```yaml
|
|
255
|
+
plugins:
|
|
256
|
+
- name: '@lowdefy/icons-react-icons'
|
|
257
|
+
version: '^7'
|
|
258
|
+
theme:
|
|
259
|
+
icons:
|
|
260
|
+
set: react-icons
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
- Old names such as `AiOutlineUser` resolve in the compatibility set. Lucide names and semantic names still work.
|
|
264
|
+
- The set has no `semantic` map, so block icons and Ant Design icons are Lucide either way.
|
|
265
|
+
- Without `set: react-icons`, reach an old name with its qualified name: `react-icons:FaWhatsapp`.
|
|
266
|
+
|
|
267
|
+
The compatibility set is a migration aid. [V6 to V7](/v6-to-v7) shows how to move an app to Lucide names.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Lowdefy plugins provides an interface to extend the platform functionality with custom javascript code. Plugins are installed into the Lowdefy app during the Lowdefy build process, and as a result are included as part of the Vite client build output. This enables plugin developers to use any npm packages when building Lowdefy plugins.
|
|
4
4
|
|
|
5
|
-
Lowdefy plugins can be used to create custom blocks, connections, requests, action, operators and auth providers, adapters, callbacks and events. These plugins are written as standard [npm modules](https://docs.npmjs.com/about-packages-and-modules#about-modules), so community plugins can be published to npm, and the workspace and git protocols can be used for project specific or private plugins. Since plugins are npm packages most Javascript features and third-party npm packages can be used in plugins.
|
|
5
|
+
Lowdefy plugins can be used to create custom blocks, connections, requests, action, operators and auth providers, adapters, callbacks and events. [Icon-set plugins](/plugins-icon-sets) add icons as data. These plugins are written as standard [npm modules](https://docs.npmjs.com/about-packages-and-modules#about-modules), so community plugins can be published to npm, and the workspace and git protocols can be used for project specific or private plugins. Since plugins are npm packages most Javascript features and third-party npm packages can be used in plugins.
|
|
6
6
|
|
|
7
7
|
## Using a plugin
|
|
8
8
|
|
|
@@ -27,3 +27,29 @@ plugins:
|
|
|
27
27
|
version: 1.0.0
|
|
28
28
|
typePrefix: Other
|
|
29
29
|
```
|
|
30
|
+
|
|
31
|
+
## Plugin meta
|
|
32
|
+
|
|
33
|
+
Every plugin type can describe itself to the build and to AI coding agents through a `meta` object. For blocks it is the `meta.js` next to the block (`category`, `valueType`, `initValue`, `cssKeys`, `events`, `properties`, ...), for requests it is the `meta` property on the request function (`checkRead`, `checkWrite`), and for operators a package may export a `./metas` module with one object per operator, mirroring `./schemas`.
|
|
34
|
+
|
|
35
|
+
All three accept `meta.hazards`: a list of behaviours of the type that its schema cannot express, which the dev server's docs and MCP endpoint return to agents alongside the schema (see [AI agent docs](/ai-agent-docs)). Each hazard is:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
hazards:
|
|
39
|
+
- id: html-style-stripped # kebab-case, unique within the type
|
|
40
|
+
message: Content is sanitised with DOMPurify, so <style>, <script> and inline event handlers are removed. Use DangerousHtml for a trusted <style> block.
|
|
41
|
+
see: display-blocks/html # a docs slug, or null
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The `message` is one or two plain sentences saying what happens and what to do instead. Only add a hazard for a behaviour that is verified in the plugin's code — an agent will rely on it.
|
|
45
|
+
|
|
46
|
+
A block marks each property that holds a URL with `urlKind` in its `properties` schema: `url` for a link the engine opens (a colon-less value is read as `https://`), `href` for a link the browser opens, `src` for a resource the block loads, and `srcSet` for a list of sources. A [dynamic blocks policy](/dynamic-page-content#dynamic-blocks-policies) checks marked properties against its pages and origins whatever they are called. Every other property is judged by its name (`url`, `href`, `src`, `image`, ...), so a property whose name looks like a URL key but holds something else, such as a field name, is marked `urlKind: false`.
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
properties: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {
|
|
52
|
+
indexUrl: { type: 'string', urlKind: 'src', description: 'URL of the search index.' },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Plugins
|
|
2
|
+
|
|
3
|
+
Everything in Lowdefy is a plugin — every block, operator, action, and connection
|
|
4
|
+
is an npm package, and your app can install more. A browsable catalog of official
|
|
5
|
+
and community plugins is coming; until then, the
|
|
6
|
+
[community plugins repository](https://github.com/lowdefy/community-plugins) lists
|
|
7
|
+
what the community has published.
|
|
8
|
+
|
|
9
|
+
## Build a plugin
|
|
10
|
+
|
|
11
|
+
How the plugin system works and what a plugin package contains.
|
|
12
|
+
|
|
13
|
+
Set up a workspace and develop plugins against a local app.
|
|
14
|
+
|
|
15
|
+
Write a custom action.
|
|
16
|
+
|
|
17
|
+
Write a custom connection and requests.
|
|
18
|
+
|
|
19
|
+
Write a custom operator.
|