@lowdefy/docs 4.0.0-alpha.7 → 4.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/dist/operators/client/filter_default_value.js +55 -0
  2. package/{public/modules/connectDocsearch.js → dist/operatorsClient.js} +1 -19
  3. package/{templates/blocks/schemaTransformer.js → dist/types.js} +5 -10
  4. package/package.json +19 -3
  5. package/404.yaml +0 -26
  6. package/CHANGELOG.md +0 -697
  7. package/actions/CallMethod.yaml +0 -57
  8. package/actions/JsAction.yaml +0 -281
  9. package/actions/Link.yaml +0 -120
  10. package/actions/Login.yaml +0 -123
  11. package/actions/Logout.yaml +0 -44
  12. package/actions/Message.yaml +0 -68
  13. package/actions/Notification.yaml +0 -84
  14. package/actions/Request.yaml +0 -70
  15. package/actions/Reset.yaml +0 -42
  16. package/actions/ResetValidation.yaml +0 -102
  17. package/actions/ScrollTo.yaml +0 -100
  18. package/actions/SetGlobal.yaml +0 -78
  19. package/actions/SetState.yaml +0 -85
  20. package/actions/Throw.yaml +0 -89
  21. package/actions/Validate.yaml +0 -104
  22. package/actions/Wait.yaml +0 -40
  23. package/blocks/all_icons.yaml +0 -803
  24. package/blocks/container/Affix.yaml +0 -26
  25. package/blocks/container/Alert.yaml +0 -27
  26. package/blocks/container/Badge.yaml +0 -27
  27. package/blocks/container/Box.yaml +0 -27
  28. package/blocks/container/Card.yaml +0 -29
  29. package/blocks/container/Collapse.yaml +0 -38
  30. package/blocks/container/Comment.yaml +0 -43
  31. package/blocks/container/ConfirmModal.yaml +0 -36
  32. package/blocks/container/Descriptions.yaml +0 -51
  33. package/blocks/container/Drawer.yaml +0 -46
  34. package/blocks/container/Label.yaml +0 -28
  35. package/blocks/container/Modal.yaml +0 -46
  36. package/blocks/container/PageHCF.yaml +0 -28
  37. package/blocks/container/PageHCSF.yaml +0 -29
  38. package/blocks/container/PageHSCF.yaml +0 -29
  39. package/blocks/container/PageHeaderMenu.yaml +0 -52
  40. package/blocks/container/PageSHCF.yaml +0 -29
  41. package/blocks/container/PageSiderMenu.yaml +0 -53
  42. package/blocks/container/Result.yaml +0 -34
  43. package/blocks/container/Span.yaml +0 -27
  44. package/blocks/container/Spin.yaml +0 -27
  45. package/blocks/container/Tabs.yaml +0 -41
  46. package/blocks/container/Tooltip.yaml +0 -38
  47. package/blocks/display/Anchor.yaml +0 -25
  48. package/blocks/display/Avatar.yaml +0 -23
  49. package/blocks/display/Breadcrumb.yaml +0 -28
  50. package/blocks/display/Button.yaml +0 -43
  51. package/blocks/display/DangerousHtml.yaml +0 -62
  52. package/blocks/display/DangerousMarkdown.yaml +0 -46
  53. package/blocks/display/Divider.yaml +0 -23
  54. package/blocks/display/EChart.yaml +0 -53
  55. package/blocks/display/Html.yaml +0 -50
  56. package/blocks/display/Icon.yaml +0 -23
  57. package/blocks/display/Img.yaml +0 -40
  58. package/blocks/display/Markdown.yaml +0 -31
  59. package/blocks/display/MarkdownWithCode.yaml +0 -46
  60. package/blocks/display/Menu.yaml +0 -48
  61. package/blocks/display/Message.yaml +0 -34
  62. package/blocks/display/MobileMenu.yaml +0 -47
  63. package/blocks/display/Notification.yaml +0 -34
  64. package/blocks/display/Paragraph.yaml +0 -30
  65. package/blocks/display/Progress.yaml +0 -52
  66. package/blocks/display/Skeleton.yaml +0 -27
  67. package/blocks/display/Statistic.yaml +0 -35
  68. package/blocks/display/Title.yaml +0 -32
  69. package/blocks/input/AutoComplete.yaml +0 -30
  70. package/blocks/input/ButtonSelector.yaml +0 -36
  71. package/blocks/input/CheckboxSelector.yaml +0 -36
  72. package/blocks/input/CheckboxSwitch.yaml +0 -56
  73. package/blocks/input/ChromeColorSelector.yaml +0 -24
  74. package/blocks/input/CircleColorSelector.yaml +0 -24
  75. package/blocks/input/ColorSelector.yaml +0 -24
  76. package/blocks/input/CompactColorSelector.yaml +0 -24
  77. package/blocks/input/DateRangeSelector.yaml +0 -26
  78. package/blocks/input/DateSelector.yaml +0 -26
  79. package/blocks/input/DateTimeSelector.yaml +0 -28
  80. package/blocks/input/GithubColorSelector.yaml +0 -24
  81. package/blocks/input/MonthSelector.yaml +0 -26
  82. package/blocks/input/MultipleSelector.yaml +0 -117
  83. package/blocks/input/NumberInput.yaml +0 -24
  84. package/blocks/input/Pagination.yaml +0 -33
  85. package/blocks/input/ParagraphInput.yaml +0 -32
  86. package/blocks/input/PasswordInput.yaml +0 -48
  87. package/blocks/input/RadioSelector.yaml +0 -36
  88. package/blocks/input/RatingSlider.yaml +0 -24
  89. package/blocks/input/S3UploadButton.yaml +0 -28
  90. package/blocks/input/Selector.yaml +0 -98
  91. package/blocks/input/SliderColorSelector.yaml +0 -24
  92. package/blocks/input/SwatchesColorSelector.yaml +0 -24
  93. package/blocks/input/Switch.yaml +0 -24
  94. package/blocks/input/TextArea.yaml +0 -27
  95. package/blocks/input/TextInput.yaml +0 -59
  96. package/blocks/input/TitleInput.yaml +0 -32
  97. package/blocks/input/TwitterColorSelector.yaml +0 -24
  98. package/blocks/input/WeekSelector.yaml +0 -26
  99. package/blocks/list/ControlledList.yaml +0 -191
  100. package/blocks/list/List.yaml +0 -157
  101. package/blocks/list/TimelineList.yaml +0 -136
  102. package/body.html +0 -1
  103. package/concepts/blocks.yaml +0 -249
  104. package/concepts/cli.yaml +0 -173
  105. package/concepts/connections-and-requests.yaml +0 -114
  106. package/concepts/context-and-state.yaml +0 -82
  107. package/concepts/custom-blocks.yaml +0 -190
  108. package/concepts/custom-code.yaml +0 -197
  109. package/concepts/events-and-actions.yaml +0 -224
  110. package/concepts/hosting-files.yaml +0 -50
  111. package/concepts/layout.yaml +0 -1464
  112. package/concepts/lists.yaml +0 -162
  113. package/concepts/lowdefy-schema.yaml +0 -245
  114. package/concepts/operators.yaml +0 -66
  115. package/concepts/overview.yaml +0 -48
  116. package/concepts/secrets.yaml +0 -56
  117. package/connections/AWSS3.yaml +0 -228
  118. package/connections/AmazonRedshift.yaml +0 -75
  119. package/connections/AxiosHttp.yaml +0 -194
  120. package/connections/Elasticsearch.yaml +0 -378
  121. package/connections/GoogleSheet.yaml +0 -332
  122. package/connections/Knex.yaml +0 -181
  123. package/connections/KnexRequests.md +0 -121
  124. package/connections/MSSQL.yaml +0 -90
  125. package/connections/MariaDB.yaml +0 -77
  126. package/connections/MongoDB.yaml +0 -581
  127. package/connections/MySQL.yaml +0 -92
  128. package/connections/OracleDB.yaml +0 -73
  129. package/connections/PostgreSQL.yaml +0 -99
  130. package/connections/Redis.yaml +0 -147
  131. package/connections/SQLite.yaml +0 -94
  132. package/connections/SendGridMail.yaml +0 -113
  133. package/connections/Stripe.yaml +0 -139
  134. package/deployment/aws-lambda.yaml +0 -128
  135. package/deployment/docker.yaml +0 -118
  136. package/deployment/netlify.yaml +0 -69
  137. package/deployment/node-server.yaml +0 -111
  138. package/head.html +0 -7
  139. package/howto/generate-csv.yaml.njk +0 -252
  140. package/howto/generate-pdf.yaml.njk +0 -651
  141. package/howto/generateCsv/lowdefy.yaml +0 -64
  142. package/howto/generateCsv/public/csvMake.js +0 -27
  143. package/howto/generatePdf/inv_template.yaml +0 -200
  144. package/howto/generatePdf/lowdefy.yaml +0 -117
  145. package/howto/generatePdf/my_header.html +0 -1
  146. package/howto/generatePdf/public/logo_example.png +0 -0
  147. package/howto/generatePdf/public/modules/importUmd.js +0 -7
  148. package/howto/generatePdf/public/modules/pdfMake.js +0 -7
  149. package/howto/generatePdf/public/modules/vfs_fonts.js +0 -12
  150. package/howto/use-refrences.md +0 -5
  151. package/introduction.yaml +0 -100
  152. package/lowdefy.yaml +0 -66
  153. package/menus.yaml +0 -832
  154. package/operators/_actions.yaml +0 -123
  155. package/operators/_and.yaml +0 -90
  156. package/operators/_args.yaml +0 -79
  157. package/operators/_array.yaml +0 -326
  158. package/operators/_base64.yaml +0 -56
  159. package/operators/_change_case.yaml +0 -347
  160. package/operators/_date.yaml +0 -71
  161. package/operators/_diff.yaml +0 -75
  162. package/operators/_divide.yaml +0 -46
  163. package/operators/_eq.yaml +0 -67
  164. package/operators/_event.yaml +0 -103
  165. package/operators/_format.yaml +0 -209
  166. package/operators/_function.yaml +0 -66
  167. package/operators/_get.yaml +0 -108
  168. package/operators/_global.yaml +0 -107
  169. package/operators/_gt.yaml +0 -65
  170. package/operators/_gte.yaml +0 -65
  171. package/operators/_hash.yaml +0 -109
  172. package/operators/_if.yaml +0 -44
  173. package/operators/_if_none.yaml +0 -61
  174. package/operators/_index.yaml +0 -65
  175. package/operators/_input.yaml +0 -114
  176. package/operators/_js.yaml +0 -189
  177. package/operators/_json.yaml +0 -128
  178. package/operators/_list_contexts.yaml +0 -37
  179. package/operators/_location.yaml +0 -59
  180. package/operators/_log.yaml +0 -36
  181. package/operators/_lt.yaml +0 -65
  182. package/operators/_lte.yaml +0 -65
  183. package/operators/_math.yaml +0 -374
  184. package/operators/_media.yaml +0 -86
  185. package/operators/_menu.yaml +0 -81
  186. package/operators/_mql.yaml +0 -101
  187. package/operators/_ne.yaml +0 -77
  188. package/operators/_not.yaml +0 -47
  189. package/operators/_number.yaml +0 -157
  190. package/operators/_nunjucks.yaml +0 -73
  191. package/operators/_object.yaml +0 -193
  192. package/operators/_operator.yaml +0 -47
  193. package/operators/_or.yaml +0 -81
  194. package/operators/_product.yaml +0 -59
  195. package/operators/_random.yaml +0 -104
  196. package/operators/_ref.yaml +0 -266
  197. package/operators/_regex.yaml +0 -83
  198. package/operators/_request.yaml +0 -50
  199. package/operators/_secret.yaml +0 -74
  200. package/operators/_state.yaml +0 -114
  201. package/operators/_string.yaml +0 -283
  202. package/operators/_subtract.yaml +0 -38
  203. package/operators/_sum.yaml +0 -59
  204. package/operators/_switch.yaml +0 -51
  205. package/operators/_type.yaml +0 -92
  206. package/operators/_uri.yaml +0 -56
  207. package/operators/_url_query.yaml +0 -120
  208. package/operators/_user.yaml +0 -107
  209. package/operators/_uuid.yaml +0 -114
  210. package/operators/_var.yaml +0 -105
  211. package/operators/_yaml.yaml +0 -107
  212. package/pages.yaml +0 -227
  213. package/public/images/authors/gervwyk.jpeg +0 -0
  214. package/public/images/authors/sandile.jpeg +0 -0
  215. package/public/images/howto/header_generate_csv.jpg +0 -0
  216. package/public/images/howto/header_generate_pdf.jpg +0 -0
  217. package/public/logo_example.png +0 -0
  218. package/public/lowdefy_app_schema.png +0 -0
  219. package/public/modules/csvMake.js +0 -27
  220. package/public/modules/filterDefaultValue.js +0 -48
  221. package/public/modules/importUmd.js +0 -7
  222. package/public/modules/index.js +0 -5
  223. package/public/modules/pdfMake.js +0 -7
  224. package/public/modules/test/filterDefaultValue.test.js +0 -91
  225. package/public/modules/vfs_fonts.js +0 -12
  226. package/public/sitemap.xml +0 -1024
  227. package/templates/actions.yaml.njk +0 -68
  228. package/templates/blocks/defaultValueTransformer.js +0 -53
  229. package/templates/blocks/exampleTransformer.js +0 -81
  230. package/templates/blocks/layout.yaml +0 -114
  231. package/templates/blocks/propertiesFormTransformer.js +0 -419
  232. package/templates/blocks/propertiesGetterTransformer.js +0 -132
  233. package/templates/blocks/schema.yaml.njk +0 -42
  234. package/templates/blocks/style.yaml +0 -26
  235. package/templates/blocks/template.yaml.njk +0 -495
  236. package/templates/blog.yaml.njk +0 -221
  237. package/templates/cli_command.yaml.njk +0 -37
  238. package/templates/footer.yaml.njk +0 -604
  239. package/templates/general.yaml.njk +0 -124
  240. package/templates/generateSitemap.js +0 -41
  241. package/templates/header.yaml +0 -138
  242. package/templates/navigation_buttons.yaml +0 -68
  243. package/templates/operators.yaml.njk +0 -82
  244. package/templates/operatorsMethodTransformer.js +0 -119
  245. package/templates/test/array.test.js +0 -1335
  246. package/templates/test/boolean.test.js +0 -98
  247. package/templates/test/button.test.js +0 -166
  248. package/templates/test/color.test.js +0 -126
  249. package/templates/test/enum.test.js +0 -105
  250. package/templates/test/icon.test.js +0 -109
  251. package/templates/test/integer.test.js +0 -99
  252. package/templates/test/manual.test.js +0 -238
  253. package/templates/test/number.test.js +0 -99
  254. package/templates/test/object.test.js +0 -434
  255. package/templates/test/oneOf.test.js +0 -794
  256. package/templates/test/string.test.js +0 -98
  257. package/templates/test/yaml.test.js +0 -605
  258. package/tutorial/next-steps.yaml +0 -83
  259. package/tutorial/tutorial-actions-operators-config.yaml +0 -142
  260. package/tutorial/tutorial-actions-operators.yaml +0 -436
  261. package/tutorial/tutorial-add-blocks-config.yaml +0 -109
  262. package/tutorial/tutorial-add-blocks.yaml +0 -195
  263. package/tutorial/tutorial-create-page-config.yaml +0 -77
  264. package/tutorial/tutorial-create-page.yaml +0 -196
  265. package/tutorial/tutorial-deploy.yaml +0 -146
  266. package/tutorial/tutorial-requests-config.yaml +0 -186
  267. package/tutorial/tutorial-requests.yaml +0 -338
  268. package/tutorial/tutorial-start.yaml +0 -282
  269. package/users/login-and-logout.yaml +0 -164
  270. package/users/openid-connect.yaml +0 -84
  271. package/users/protected-pages.yaml +0 -67
  272. package/users/roles.yaml +0 -70
  273. package/users/user-object.yaml +0 -73
  274. package/users/users-introduction.yaml +0 -80
  275. package/version.yaml +0 -1
@@ -1,162 +0,0 @@
1
- _ref:
2
- path: templates/general.yaml.njk
3
- vars:
4
- pageId: lists
5
- pageTitle: Lists
6
- section: Concepts
7
- filePath: concepts/lists.yaml
8
- content:
9
- - id: md1
10
- type: MarkdownWithCode
11
- properties:
12
- content: |
13
- List category blocks render multiple [`content areas`](/layout), based on data in the [`state`](/context-and-state) object.
14
-
15
- Since the content area might contain input blocks, the block has an array value in state, with it's `block id` as key. For each item in the array, an content area (or set of content areas is rendered). Multiple list blocks can be nested.
16
-
17
- ### List indices and block ids
18
-
19
- If a block is to be rendered in an list's content area, the block id should contain a list index placeholder (specified with the `$` symbol) for each list it is a part of. These placeholders will be populated with the blocks `list indices`. The `list indices` are a array of integers, indicating at which position in the list the block is, for each level of list blocks (zero indexed). The block id should be in valid dot-notation once the placeholders have been substituted.
20
-
21
- This can be made more clear with a example. Suppose we have a list block with id `contacts`. Inside this list we have a text input block for the contact name. We would like our state to look like:
22
- ```yaml
23
- contacts:
24
- - name: Name 1
25
- - name: Name 2
26
- ```
27
-
28
- The id for the text input block should be `contacts.$.name`. Each text input block will be given an indexed id based on it's position in the contacts list (`contacts.0.name`, `contacts.1.name`, etc.).
29
-
30
- Suppose we also want to add a emails array for each contact. To do this, we can add another list block in the `contacts` array, and add a text input inside the emails array. If we want the emails to be a array of strings, i.e. our `state` should look like:
31
-
32
- ```yaml
33
- contacts:
34
- - name: Name 1
35
- emails:
36
- - email1@example.com
37
- - email2@example.com
38
- - name: Name 2
39
- emails: []
40
- ```
41
-
42
- our config should look like:
43
- ```yaml
44
- id: contacts
45
- type: ControlledList
46
- properties:
47
- # ...
48
- blocks:
49
- - id: contacts.$.name
50
- type: TextInput
51
- properties:
52
- # ...
53
- - id: contacts.$.emails
54
- type: ControlledList
55
- properties:
56
- # ...
57
- blocks:
58
- - id: contacts.$.emails.$
59
- type: TextInput
60
- properties:
61
- # ...
62
- ```
63
-
64
- Note that the id of the emails list block is `contacts.$.emails` and that it has one `$` placeholder since it is inside the `contacts` list, and the id of the email text input is `contacts.$.emails.$`, which has two `$` placeholders since it is in both the `contacts` and `contacts.$.emails` lists.
65
-
66
- The ids of the `contacts.$.emails.$` text input blocks will look like `contacts.0.emails.3` or `contacts.2.emails.1`, and this will result in the `state` where the emails on a contact are an array of strings.
67
-
68
- ### List indices in operators
69
-
70
- List indices are also supported in "getter" operators like `_state`. If the operator is given a key that contains `$` placeholders, and the operator is called from a block with list indices, the placeholders will be populated with the blocks list indices. These indices are populated on `actions` called by the block, and are even populated in `connections` and `requests` if the block that triggered the `Request` action has list indices. This can be used to get values from the `state` array the block is a part of, or even values from another array at the same index.
71
-
72
- ### List block methods
73
-
74
- List blocks can provide methods to change their values. These are
75
-
76
- #### `pushItem`
77
- Add an item at the end of the list.
78
-
79
- #### `unshiftItem`
80
- Add an item at the start of the list.
81
-
82
- #### `removeItem`
83
- Remove an item at the specified index.
84
-
85
- #### `moveItemDown`
86
- Move the item at the specified index one position to the start of the list. If the item is at the start if the list, the item remains at position `0`.
87
-
88
- #### `moveItemUp`
89
- Move the item at the specified index one position to the end of the list. If the item is at the end if the list, the item remains at it's position.
90
-
91
- #### Example
92
- ```yaml
93
- id: page
94
- type: PageHeaderMenu
95
- blocks:
96
- - id: add_item_at_start
97
- type: Button
98
- events:
99
- onClick:
100
- - id: add_item_at_start
101
- type: CallMethod
102
- params:
103
- blockId: list
104
- method: unshiftItem
105
- - id: add_item_at_end
106
- type: Button
107
- events:
108
- onClick:
109
- - id: add_item_at_end
110
- type: CallMethod
111
- params:
112
- blockId: list
113
- method: pushItem
114
- - id: list
115
- type: List
116
- blocks:
117
- - id: list.$.move_item_down
118
- type: Button
119
- events:
120
- onClick:
121
- - id: move_item_down
122
- type: CallMethod
123
- params:
124
- blockId: list
125
- method: moveItemDown
126
- args:
127
- - _index: 0 # Get the first index in the indices array
128
- - id: list.$.move_item_up
129
- type: Button
130
- events:
131
- onClick:
132
- - id: move_item_up
133
- type: CallMethod
134
- params:
135
- blockId: list
136
- method: moveItemUp
137
- args:
138
- - _index: 0
139
- - id: list.$.remove_item
140
- type: Button
141
- events:
142
- onClick:
143
- - id: remove_item
144
- type: CallMethod
145
- params:
146
- blockId: list
147
- method: removeItem
148
- args:
149
- - _index: 0
150
- ```
151
-
152
- ### Lists and state
153
-
154
- List blocks create a content area for each item in `state`. If `state` is updated, the list block will also update, creating or destroying content areas as necessary. Thus list blocks can also be manipulated by setting `state` directly using the [`SetState`](/SetState) operator.
155
-
156
- - _ref:
157
- path: templates/navigation_buttons.yaml
158
- vars:
159
- previous_page_title: Secrets
160
- previous_page_id: secrets
161
- next_page_title: Hosting Files
162
- next_page_id: hosting-files
@@ -1,245 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/general.yaml.njk
17
- vars:
18
- pageId: lowdefy-schema
19
- pageTitle: Lowdefy App Schema
20
- section: Concepts
21
- filePath: concepts/lowdefy-schema.yaml
22
- content:
23
- - id: md1
24
- type: MarkdownWithCode
25
- properties:
26
- content: |
27
- A Lowdefy app is written as YAML files, which are combined together using the `_ref` operator when the app is built, into a configuration object that describes the entire app. This object has different sections that describes different parts of the app.
28
-
29
- The root schema for a Lowdefy app is:
30
- - `lowdefy: string`: __Required__ - The Lowdefy version number the app uses. This is required and cannot be a reference to another file.
31
- - `name: string`: A name for the application.
32
- - `licence: string`: A [SPDX licence ID](https://spdx.org/licenses/). You can use this to indicate the project's licence if you are licencing your project under a specific software licence. If you wish to indicate to others that you do not grant the right to use your project, you can optionally use `UNLICENSED` for this field. How you share your Lowdefy config is up to you.
33
- - `cli: object`: An object with configuration for the CLI.
34
- - `config: object`: An object with app configuration like the home page pageId.
35
- - `global: object`: A data object that can be accessed anywhere in the app using the [`_global`](/_global) operator.
36
- - `connections: object[]`: An array of [`connection`](/connections-and-requests) objects.
37
- - `types: object`: An object to customize and add block types.
38
- - `menus: object[]`: An array of menu objects.
39
- - `pages: object[]`: An array of page objects.
40
-
41
- # Config
42
-
43
- The config object has the following properties:
44
-
45
- - `basePath: string`: Set the base path to serve the Lowdefy application from. This will route all pages under `https://example.com/<base-path>/<page-id>` instead of the default `https://example.com/<page-id>`. The basePath value must start with "/".
46
- - `homePageId: string`: The pageId of the page that should be loaded when a user loads the app without a pageId in the url route. This is the page that is loaded when you navigate to `yourdomain.com`.
47
- - `experimental_initPageId: string`: The pageId of the page that should be loaded when app is initialized. User is then redirected to requeted page. You can use onInit/onInitAsync/onEnter/onEnterAsync events to fetch and prepare global variables for other parts of the app.
48
-
49
- - id: alert1
50
- type: Alert
51
- properties:
52
- type: warning
53
- showIcon: false
54
- message: Init page is an experimental feature, that may disappear in future releases as well as the flag itself can be changed. Use at your own risk.
55
-
56
- - id: md2
57
- type: MarkdownWithCode
58
- properties:
59
- content: |
60
- # Global
61
-
62
- Any data that you wish to use in your app can be stored in the __global__ object, and accessed using the [`_global`](/_global) operator. This is a good place to store data or configuration that is used throughout the app, for example the url of a logo or configuration of a page, since then these are only written once, and can be updated easily.
63
-
64
- The global object can also be modified using the [`SetGlobal`](/SetGlobal) action.
65
-
66
- # Menus
67
-
68
- Menu objects are an object with links to pages. The are used by blocks like `PageSiderMenu` to render the links in the menu. If no menus are provided, a default menu is created, with links to all of the defined pages, and with their pageIds as menu item titles.
69
-
70
- Blocks like like `PageSiderMenu` use the menu with `id: default` by default. This means that if you create a menu object with `id: default`, this will be used unless another menu is configured.
71
-
72
- More than one menu can be configured in an app. As an example, this can be used when two logically different sections in the app need different menus.
73
-
74
- If OpenID Connect authentication and role based authentication is configured, pages that the user is restricted from seeing are filtered from the menu object.
75
-
76
- The schema for a menu object is:
77
-
78
- - `id: string`: __Required__ - A identifier for the menu. If it is `default`, it will be used as default by pages.
79
- - `links: object[]`: An array of `MenuLink` or `MenuGroup` objects that form the links in the menu. `MenuGroups` can be two levels deep.
80
-
81
- The schema for a `MenuLink` is:
82
- - `id: string`: __Required__ - A identifier for the link unique to the menu.
83
- - `type: string`: __Required__ - The type should be `MenuLink`.
84
- - `pageId: string`: The id of the page to link to. Used as the title if no title is provided.
85
- - `url: string`: An external url to link to.
86
- - `properties: object`: The properties of the menu link. These are:
87
- - `title: string`: The title to display for the link.
88
- - `icon: string | object`: The name of an [Ant Design Icon](https://ant.design/components/icon/) or properties of an Icon block to use as the icon for the link. The icon is only shown if the link is at the top level of the menu (not in a menu group).
89
-
90
- The schema for a `MenuGroup` is:
91
- - `id: string`: __Required__ - A identifier for the group unique to the menu.
92
- - `type: string`: __Required__ - The type should be `MenuGroup`.
93
- - `properties: object`: The properties of the menu group. These are:
94
- - `title: string`: The title to display for the group.
95
- - `icon: string | object`: The name of an [Ant Design Icon](https://ant.design/components/icon/) or properties of an Icon block to use as the icon for the group. The icon is only shown if the group is at the top level of the menu (not in a menu group).
96
- - `links: object[]`: An array of `MenuLink` or `MenuGroup` objects that are should be grouped together in the group.
97
-
98
- ###### Menus example:
99
- ```yaml
100
- lowdefy: LOWDEFY_VERSION
101
- menus:
102
- - id: default
103
- links:
104
- - id: page1
105
- type: MenuLink
106
- pageId: page1
107
- properties:
108
- title: Page 1
109
- icon: AiOutlinedFile
110
- - id: top-group
111
- properties:
112
- title: Group
113
- icon: AiOutlinedGroup
114
- links:
115
- - id: page2
116
- type: MenuLink
117
- pageId: page2 # pageId will be used as link title
118
- - id: external
119
- type: MenuLink
120
- url: https://external.com
121
- properties:
122
- title: External site
123
- - id: nested-group
124
- type: MenuGroup
125
- properties:
126
- title: Nested Group
127
- links:
128
- - id: page3
129
- type: MenuLink
130
- pageId: page3
131
- properties:
132
- title: Page 3
133
- - id: page-1-and-3
134
- links:
135
- - id: page1
136
- type: MenuLink
137
- pageId: page1
138
- properties:
139
- title: Page 1
140
- icon: AiOutlinedFile
141
- - id: page3
142
- type: MenuLink
143
- pageId: page3
144
- properties:
145
- title: Page 3
146
- icon: AiOutlinedControl
147
- ```
148
-
149
- # Pages
150
-
151
- Pages in a Lowdefy app are actually just blocks, the building blocks of a Lowdefy app, with a few extra restrictions and features.
152
-
153
- Each page should have an `id` that is unique among all pages in the app. Each page is served with the `pageId` as the url route. That is, if you create a page with id `page1`, it will be served at `domain.com/page1`.
154
-
155
- Page blocks should be of category `context`, in order to create a context for the page. This means they always have the context initialization events like `onInit` to initialize the page.
156
-
157
- If `properties.title` is set on a page block, the title will be set as the page title (This is the title displayed on the tabs in your browser).
158
-
159
- # References and templates
160
-
161
- References are used to split the configuration of an app into logically distinct files, and to reuse configuration in the app. References can be used almost anywhere in the configuration, as long as the configuration remains valid YAML.
162
-
163
- References are made using the [`_ref`](/_ref) operator. If the referenced file has a `.yaml` or `.json` extension, the contents of the file will be parsed, else the file content is included as a string (this is useful for `.md` or `.html` files). As an example of splitting an app into logically distinct files, references can be used to write each page as a separate file:
164
-
165
- ###### lowdefy.yaml
166
- ```yaml
167
- lowdefy: LOWDEFY_VERSION
168
-
169
- pages:
170
- _ref: pages/page1.yaml # Path to the referenced file. Always from the root of the project.
171
- _ref: pages/page1.yaml
172
- ```
173
-
174
- The `_ref` operator can take an argument called `vars`. This can be any data, and is passed down to later be accessed with the [`_var`](/_var) operator. By using vars, the referenced file can become a template, using the given variables. For example, a standard page template might be used for multiple pages in an app:
175
-
176
- ###### pages/page1.yaml
177
- ```yaml
178
- _ref:
179
- path: templates/text_page.yaml
180
- vars:
181
- id: page1
182
- title: Page 1
183
- content: |
184
- Page content text.
185
- ```
186
-
187
- ###### templates/text_page.yaml
188
- ```yaml
189
- id:
190
- _var: id
191
- type: PageHeaderMenu
192
- properties:
193
- title:
194
- _var: title
195
- blocks:
196
- - id: content_card
197
- type: Card
198
- blocks:
199
- - id: title
200
- type: Title
201
- properties:
202
- content:
203
- _var: title
204
- - id: content
205
- type: Markdown
206
- properties:
207
- content:
208
- _var: content
209
- ```
210
-
211
- Templating can be taken further by referencing [Nunjucks](https://mozilla.github.io/nunjucks/) template files. If a file ends with the `.njk` file extension, the file will first be hydrated as a Nunjucks template, using the `vars` as template variables. If the file ends with `.yaml.njk` or `.json.njk`, the output of the template will then be parsed. Nunjucks templates are useful since the template file does not need to be valid yaml before it is hydrated, and features like for-loops and if-statements can be used.
212
-
213
- Templating is used extensively to create the Lowdefy docs (these docs are a Lowdefy app). You can look at how they are used [here](https://github.com/lowdefy/lowdefy/tree/main/packages/docs).
214
-
215
- The `_ref` operator can also be extended with custom JavaScript functions. A `resolver` function can be specified, which can overwrite the default way configuration files are read from the filesystem. A `transformer` function can be used to transform the value returned by the `_ref` operator.
216
-
217
- ## YAML file extensions
218
-
219
- Both files with the `.yaml` and `.yml` file extensions are supported as YAML files.
220
-
221
- ## JSON instead of YAML
222
-
223
- Since you can reference JSON files, you can build your app using JSON instead of YAML files. The `lowdefy.yaml` file needs to be a YAML file, but all other configuration can be in referenced JSON files. It also makes sense to use JSON instead of YAML if you are generating configuration using code.
224
-
225
- # Lowdefy versions and version updates
226
-
227
- Lowdefy is versioned using semantic versioning, with a three part version number, with the form `major.minor.patch`. Lowdefy is in the early stages of development and under active development, with new versions published on a regular basis.
228
-
229
- To update the version of your app, change the `lowdefy` version field in the `lowdefy.yaml` file, and redeploy the app. You might also need to make some changes to your app configuration to be compatible with the new version.
230
-
231
- Patch updates only contain fixes, and you should be safe to update to a patched version without any changes to your app. Since we are actively developing new features, most releases will be minor version updates, and patches won't be made to older versions.
232
-
233
- Minor version changes include new features. At this stage, since the project is still in early development, they might also have minor breaking changes to individual blocks, actions, operators or connections. Please check the [changelog](https://github.com/lowdefy/lowdefy/blob/main/CHANGELOG.md) to see if any configuration changes are needed before updating.
234
-
235
- Major version updates may include major breaking changes or architecture changes. You might need to make more changes to your configuration to be compatible with the new version. We don't intend to release major versions regularly, and try to minimize breaking changes.
236
-
237
- As the project grows, we will release a long term support (LTS) version, that will continue to receive patches, but won't have any breaking changes.
238
-
239
- - _ref:
240
- path: templates/navigation_buttons.yaml
241
- vars:
242
- previous_page_title: The CLI
243
- previous_page_id: cli
244
- next_page_title: Context and State
245
- next_page_id: context-and-state
@@ -1,66 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/general.yaml.njk
17
- vars:
18
- pageId: operators
19
- pageTitle: Operators
20
- section: Concepts
21
- filePath: concepts/operators.yaml
22
- content:
23
- - id: md1
24
- type: Markdown
25
- properties:
26
- content: |
27
- Operators are functions, that can be used to express logic. They are the reason why Lowdefy apps are not completely static, but can react to data and inputs. Operators can be used in `blocks`, `actions`, `requests`, and `connections`. See the specific documentation for more details.
28
-
29
- Each operators expects arguments with a specific structure. They can be the result of other operators, since operators are evaluated beginning with the most nested operators.
30
-
31
- If an operator errors while evaluating, it returns a `null` value, and logs the error to the console.
32
-
33
- ## Client or server operators
34
-
35
- Some operators are only available on either the client or the server. For example, the [`_menu`](/_menu) operator is only useful on the client and is thus not included in server requests. Likewise, the [`_secret`](/_secret) operator is only available on the server for security reasons.
36
-
37
- If a operator has special environment considerations, it is indicated on the individual operator documentation page. If no indication is made, the operator can be used under both environments.
38
-
39
- ##### Client only operators:
40
- - [_actions](/_actions)
41
- - [_format](/_format)
42
- - [_js](/_js)
43
- - [_list_contexts](/_list_contexts)
44
- - [_media](/_media)
45
- - [_menu](/_menu)
46
- - [_request](/_request)
47
-
48
- ##### Server only operators:
49
- - [_diff](/_diff)
50
- - [_secret](/_secret)
51
- - [_uuid](/_uuid)
52
-
53
- Operators that are client side only cannot be used in `Requests` and `Connections`, and operators which are server side only cannot be used in `Blocks` and `Actions`.
54
-
55
- ## Build time operators
56
-
57
- Besides the client and server environment, app build time is considered a third environment where special operator logic applies.
58
-
59
- The `_ref` and `_var` operators do not work like other operators. They are evaluated while an app is being built, and can thus be used anywhere in the app configuration. They are used to split a app into multiple files, and to reuse configuration. See [`_ref`](/_ref) for more details.
60
- - _ref:
61
- path: templates/navigation_buttons.yaml
62
- vars:
63
- previous_page_title: Events and Actions
64
- previous_page_id: events-and-actions
65
- next_page_title: Secrets
66
- next_page_id: secrets
@@ -1,48 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/general.yaml.njk
17
- vars:
18
- pageId: overview
19
- pageTitle: Overview
20
- section: Concepts
21
- filePath: concepts/overview.yaml
22
- content:
23
- - id: md1
24
- type: Markdown
25
- properties:
26
- content: |
27
- Lowdefy apps are written as YAML configuration files. These files can be managed in source control, and multiple apps can be deployed with the same configuration. To serve an app, the configuration first needs to be built using the Lowdefy CLI. A Lowdefy server can then serve the build artifacts.
28
-
29
- You need to host your own Lowdefy server. We want to enable you to host a Lowdefy anywhere and Lowdefy was designed to run in a serverless environment. Currently, you can host Lowdefy apps on Netlify, and as a Docker container.
30
-
31
- The diagram below provides an overview of the Lowdefy app schematic:
32
- ![Lowdefy App Diagram](https://deploy-preview-481--lowdefy-docs.netlify.app/public/lowdefy_app_schema.png "Lowdefy App Diagram")
33
-
34
- The Lowdefy server manages connections and executes requests, serves a web client, and serves the configuration for app pages to the client. The server does not have a data-store, but can connect to external data sources like APIs and databases.
35
-
36
- The Lowdefy web client manages the layout and loading of Lowdefy blocks. Blocks are loaded to the client using _webpack Module Federation_. This means that Lowdefy blocks are external to your apps and can be hosted separately on any static file server, which allows you to extend Lowdefy's capabilities with custom Lowdefy blocks.
37
-
38
- The client also manages each context in the app, executes actions that are triggered by events, and evaluates operators that allow for "live updates" to the UI.
39
-
40
- Authentication for private pages in Lowdefy apps is implemented by connecting to your preferred, external OpenID Connect provider.
41
-
42
- - _ref:
43
- path: templates/navigation_buttons.yaml
44
- vars:
45
- previous_page_title: Tutorial
46
- previous_page_id: tutorial-start
47
- next_page_title: The CLI
48
- next_page_id: cli
@@ -1,56 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/general.yaml.njk
17
- vars:
18
- pageId: secrets
19
- pageTitle: Secrets
20
- section: Concepts
21
- filePath: concepts/secrets.yaml
22
- content:
23
- - id: md1
24
- type: Markdown
25
- properties:
26
- content: |
27
- The `secrets` object is a object that can be used to securely store sensitive information like passwords and API keys. Secrets can be accessed using the [`_secret`](/_secret) operator.
28
-
29
- The secrets object only exists on the backend server, and therefore the `_secret` operator can only be used in `connections` and `requests`.
30
-
31
- We intend to support multiple secrets strategies in the future (for example AWS Secrets Manager or Docker secrets). Current secrets can only be set with environment variables.
32
-
33
- ## Environment variables strategy
34
-
35
- Secrets can be set by creating an environment variable prefixed with `LOWDEFY_SECRET_`. The secret will then be available in the secrets object with the remaining part ot the name as key.
36
-
37
- For example, if the environment variable `LOWDEFY_SECRET_MY_SECRET` is set to `supersecret`, then `_secret: MY_SECRET` will return `supersecret`.
38
-
39
- Only strings can be set as environment variables. To store a object as a secret, the object can be JSON stringified, and parsed using the `_json.parse` operator.
40
-
41
- To store secrets that contain newline characters, the secret can be base64 encoded, and decoded using the `_base64.decode` operator.
42
-
43
- To use secrets in the local development environment, environment variables can be set using a `.env` file. Create a file called `.env` at the root of the project directory. Then set environment variables as:
44
-
45
- ```
46
- # .env
47
- LOWDEFY_SECRET_MY_SECRET=supersecret
48
- ```
49
-
50
- - _ref:
51
- path: templates/navigation_buttons.yaml
52
- vars:
53
- previous_page_title: Operators
54
- previous_page_id: operators
55
- next_page_title: Lists
56
- next_page_id: lists