@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,109 +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: tutorial-add-blocks-config
19
- pageTitle: Making a booking form config
20
- section: Tutorial
21
- filePath: tutorial/tutorial-add-blocks-config.yaml
22
- content:
23
- - id: body_config
24
- type: MarkdownWithCode
25
- properties:
26
- content: |
27
- ##### `lowdefy.yaml`
28
- ```yaml
29
- name: lowdefy-project-template
30
- lowdefy: CURRENT_LOWDEFY_VERSION # e.g. 3.4.0
31
-
32
- menus:
33
- - id: default
34
- links:
35
- - id: new-ticket
36
- type: MenuLink
37
- properties:
38
- icon: AiOutlinedAlert
39
- title: New ticket
40
- pageId: new-ticket
41
- - id: welcome
42
- type: MenuLink
43
- properties:
44
- icon: AiOutlinedHome
45
- title: Home
46
- pageId: welcome
47
-
48
- pages:
49
- - _ref: new-ticket.yaml
50
- - id: welcome
51
- type: PageHeaderMenu
52
- #...
53
- ```
54
-
55
- ##### `new-ticket.yaml`
56
- ```yaml
57
- id: new-ticket
58
- type: PageHeaderMenu
59
- properties:
60
- title: New ticket # The title in the browser tab.
61
- layout:
62
- contentJustify: center # Center the contents of the page
63
- blocks:
64
- - id: content_card
65
- type: Card
66
- layout:
67
- size: 800 # Set the size of the card so it does not fill the full screen
68
- contentGutter: 16 # Make a 16px gap between all blocks in this card
69
- blocks:
70
- - id: page_heading
71
- type: Title
72
- properties:
73
- content: Log a ticket # Change the title on the page.
74
- level: 3 # Make the title a little smaller (an html `<h3>`).
75
- - id: ticket_title
76
- type: TextInput
77
- properties:
78
- title: Title
79
- - id: ticket_type
80
- type: ButtonSelector
81
- properties:
82
- title: Ticket type
83
- options: # Set the allowed options
84
- - Feature request
85
- - Bug report
86
- - Question
87
- - id: ticket_description
88
- type: TextArea
89
- properties:
90
- title: Description
91
- - id: reset_button
92
- type: Button
93
- layout:
94
- span: 12 # Set the size of the button (span 12 of 24 columns)
95
- properties:
96
- title: Reset
97
- block: true # Make the button fill all the space available to it
98
- type: default # Make the button a plain button
99
- icon: AiOutlinedClear
100
- - id: submit_button
101
- type: Button
102
- layout:
103
- span: 12
104
- properties:
105
- title: Submit
106
- block: true
107
- type: primary # Make the button a primary button with color
108
- icon: AiOutlinedSave
109
- ```
@@ -1,195 +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: tutorial-add-blocks
19
- pageTitle: 3. Adding blocks
20
- section: Tutorial
21
- filePath: tutorial/tutorial-add-blocks.yaml
22
- prefetchPages:
23
- - tutorial-actions-operators
24
- content:
25
- - id: tutorial_video
26
- type: DangerousMarkdown
27
- properties:
28
- DOMPurifyOptions:
29
- ADD_TAGS:
30
- - iframe
31
- ADD_ATTR:
32
- - allowfullscreen
33
- - allow
34
- - frameborder
35
- content: |
36
- <iframe
37
- width="800"
38
- height="470"
39
- src="https://www.youtube.com/embed/YHeMlW9y6V0" frameborder="0"
40
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
41
- </iframe>
42
- - id: body_add_blocks
43
- type: MarkdownWithCode
44
- properties:
45
- content: |
46
- We would like to add an input form with the following fields:
47
-
48
- - A title for the ticket.
49
- - The type of ticket. This should be a selection from a list of types.
50
- - A description of the ticket.
51
-
52
- There should also be submit and reset buttons at the bottom of the page.
53
-
54
- #### Step 3.1 - Add some input blocks
55
-
56
- Copy the following blocks and add them in the card's blocks array.
57
-
58
- ###### `new-ticket.yaml`
59
- ```yaml
60
- id: new-ticket
61
- # ...
62
- blocks:
63
- - id: content_card
64
- # ...
65
- blocks:
66
- - id: page_heading
67
- type: Title
68
- properties:
69
- content: Log a ticket # Change the title on the page.
70
- level: 3 # Make the title a little smaller (an html `<h3>`).
71
- ################ ------- Copy from here -------- ################
72
- - id: ticket_title
73
- type: TextInput
74
- properties:
75
- title: Title
76
- - id: ticket_type
77
- type: ButtonSelector
78
- properties:
79
- title: Ticket type
80
- options: # Set the allowed options
81
- - Feature request
82
- - Bug report
83
- - Question
84
- - id: ticket_description
85
- type: TextArea
86
- properties:
87
- title: Description
88
- - id: reset_button
89
- type: Button
90
- layout:
91
- span: 12 # Set the size of the button (span 12 of 24 columns)
92
- properties:
93
- title: Reset
94
- block: true # Make the button fill all the space available to it
95
- type: default # Make the button a plain button
96
- icon: AiOutlinedClear
97
- - id: submit_button
98
- type: Button
99
- layout:
100
- span: 12
101
- properties:
102
- title: Submit
103
- block: true
104
- type: primary # Make the button a primary button with color
105
- icon: AiOutlinedSave
106
- ################ -------- Copy to here ---------- ################
107
- ```
108
-
109
- > If you would like to see how your config should look at this point, you can find it [here](/tutorial-add-blocks-config).
110
-
111
- Your booking page should something like this:
112
- - id: example1
113
- type: PageHeaderMenu
114
- layout:
115
- contentJustify: center
116
- properties:
117
- style:
118
- minHeight: 300px
119
- menu:
120
- links: []
121
- blocks:
122
- - id: content_card
123
- type: Card
124
- layout:
125
- contentGutter: 16
126
- size: 600
127
- blocks:
128
- - id: page_heading
129
- type: Title
130
- properties:
131
- content: Log a ticket
132
- level: 3
133
- - id: ticket_title
134
- type: TextInput
135
- properties:
136
- title: Title
137
- - id: ticket_type
138
- type: ButtonSelector
139
- properties:
140
- title: Ticket type
141
- options:
142
- - Feature request
143
- - Bug report
144
- - Question
145
- - id: ticket_description
146
- type: TextArea
147
- properties:
148
- title: Description
149
- - id: reset_button
150
- type: Button
151
- layout:
152
- span: 12
153
- properties:
154
- title: Reset
155
- block: true
156
- type: default
157
- icon: AiOutlinedClear
158
- - id: submit_button
159
- type: Button
160
- layout:
161
- span: 12
162
- properties:
163
- title: Submit
164
- block: true
165
- type: primary
166
- icon: AiOutlinedSave
167
- - id: body_what_happened
168
- type: MarkdownWithCode
169
- properties:
170
- content: |
171
- ### What happened
172
-
173
- We added 3 form input blocks to the page. For each of those blocks, we set the `title` property, and for the ticket type selector we set a list of ticket types to the `options` property.
174
-
175
- We also added reset button and submit button. We set a few more properties on the buttons to set their layout and appearance.
176
-
177
- ### How it works
178
-
179
- Lowdefy apps are made from blocks. These blocks can be the page layout with header and menu, a piece of text, a chart or table, tabs or even a popup message or icon. You specify which block is rendered with the `type` field. There are 5 block categories, namely display, input, container, list, and context.
180
-
181
- The first block on a page needs to be a [context](/context-and-state) block. For now, it is enough to understand that this context allows the Lowdefy magic to happen.
182
-
183
- All blocks need to have an `id` that identifies the block. This id should be unique in that block's context.
184
-
185
- ### Up next
186
-
187
- Currently our form doesn't do very much. In the next section we will use [actions](/events-and-actions) and [operators](/operators) to make it more interactive.
188
-
189
- - _ref:
190
- path: templates/navigation_buttons.yaml
191
- vars:
192
- previous_page_title: Creating a page
193
- previous_page_id: tutorial-create-page
194
- next_page_title: Interactive pages
195
- next_page_id: tutorial-actions-operators
@@ -1,77 +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: tutorial-create-page-config
19
- pageTitle: Creating a page config
20
- section: Tutorial
21
- filePath: tutorial/tutorial-create-page-config.yaml
22
- content:
23
- - id: body_config
24
- type: MarkdownWithCode
25
- properties:
26
- content: |
27
- ##### `lowdefy.yaml`
28
-
29
- ```yaml
30
- name: lowdefy-project-template
31
- version: CURRENT_LOWDEFY_VERSION
32
-
33
- menus:
34
- - id: default
35
- links:
36
- - id: new-ticket
37
- type: MenuLink
38
- properties:
39
- icon: AiOutlinedAlert
40
- title: New ticket
41
- pageId: new-ticket
42
- - id: welcome
43
- type: MenuLink
44
- properties:
45
- icon: AiOutlinedHome
46
- title: Home
47
- pageId: welcome
48
-
49
- pages:
50
- - _ref: new-ticket.yaml
51
- - id: welcome
52
- type: PageHeaderMenu
53
- #...
54
- ```
55
-
56
- ##### `new-ticket.yaml`
57
-
58
- ```yaml
59
- id: new-ticket
60
- type: PageHeaderMenu
61
- properties:
62
- title: New ticket # The title in the browser tab.
63
- layout:
64
- contentJustify: center # Center the contents of the page.
65
- blocks:
66
- - id: content_card
67
- type: Card
68
- layout:
69
- size: 800 # Set the size of the card so it does not fill the full screen.
70
- contentGutter: 16 # Make a 16px gap between all blocks in this card.
71
- blocks:
72
- - id: page_heading
73
- type: Title
74
- properties:
75
- content: Log a ticket # The content text of the title block.
76
- level: 3 # Make the title a little smaller (an html `<h3>`).
77
- ```
@@ -1,196 +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: tutorial-create-page
19
- pageTitle: 2. Creating a page
20
- section: Tutorial
21
- filePath: tutorial/tutorial-create-page.yaml
22
- prefetchPages:
23
- - tutorial-add-blocks
24
- content:
25
- - id: tutorial_video
26
- type: DangerousMarkdown
27
- properties:
28
- DOMPurifyOptions:
29
- ADD_TAGS:
30
- - iframe
31
- ADD_ATTR:
32
- - allowfullscreen
33
- - allow
34
- - frameborder
35
- content: |
36
- <iframe
37
- width="800"
38
- height="470"
39
- src="https://www.youtube.com/embed/U5TDhz3x7Tk" frameborder="0"
40
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
41
- </iframe>
42
- - id: body_create_page
43
- type: MarkdownWithCode
44
- properties:
45
- content: |
46
- Let's create a page for a web form where users can log a new ticket.
47
-
48
- #### Step 2.1 - Create `new-ticket.yaml`
49
-
50
- Create a new YAML file in the project directory (the same directory as the `lowdefy.yaml` file) called `new-ticket.yaml`, with the following content:
51
-
52
- ```yaml
53
- id: new-ticket
54
- type: PageHeaderMenu
55
- properties:
56
- title: New ticket # The title in the browser tab.
57
- layout:
58
- contentJustify: center # Center the contents of the page.
59
- blocks:
60
- - id: content_card
61
- type: Card
62
- layout:
63
- size: 800 # Set the size of the card so it does not fill the full screen.
64
- contentGutter: 16 # Make a 16px gap between all blocks in this card.
65
- blocks:
66
- - id: page_heading
67
- type: Title
68
- properties:
69
- content: Log a ticket # Change the title on the page.
70
- level: 3 # Make the title a little smaller (an html `<h3>`).
71
- ```
72
-
73
- #### Step 2.2 - Update `lowdefy.yaml`
74
-
75
- Change the `lowdefy.yaml` to look like this:
76
-
77
- ```yaml
78
- name: lowdefy-project-template
79
- lowdefy: 3.23.2
80
-
81
- pages:
82
- ################ -------- Copy from here -------- ################
83
- - _ref: new-ticket.yaml
84
- ################ -------- Copy to here ---------- ################
85
- - id: welcome
86
- type: PageHeaderMenu
87
- properties:
88
- title: Welcome
89
- # ...
90
- ```
91
-
92
- - id: warning_indent
93
- type: Alert
94
- properties:
95
- type: warning
96
- icon: AiFilledWarning
97
- message: Indentation is important
98
- description: YAML files use indentation to determine the data structure represented. If you are having any problems, make sure the indentation is the same as in the instructions.
99
-
100
- - id: body_view_in_browser
101
- type: Markdown
102
- properties:
103
- content: |
104
- #### Step 2.3 - Navigate to the new page
105
-
106
- Your browser should reload, and you should see a link in the header menu to the booking page. If you click on that link it should take you to a page that looks like this:
107
-
108
- - id: example1
109
- type: PageHeaderMenu
110
- layout:
111
- contentJustify: center
112
- properties:
113
- style:
114
- minHeight: 300px
115
- menu:
116
- links:
117
- - id: new-ticket
118
- properties:
119
- title: new-ticket
120
- type: MenuLink
121
- - id: welcome
122
- type: MenuLink
123
- properties:
124
- title: welcome
125
-
126
- blocks:
127
- - id: content_card
128
- type: Card
129
- layout:
130
- size: 600
131
- blocks:
132
- - id: page_heading
133
- type: Title
134
- properties:
135
- content: Log a ticket
136
- level: 3
137
-
138
- - id: body_menus
139
- type: MarkdownWithCode
140
- properties:
141
- content: |
142
- If you click on the link in the menu, you should see that your browser path (the part after `localhost:3000` or `example.com`) changes from `welcome` to `new-ticket`.
143
-
144
- ### What happened
145
-
146
- - We created a new page with id `new-ticket`.
147
- - We used a `_ref` operator to reference configuration in another file.
148
- - That page can now be found at the `/new-ticket` route.
149
- - A link to that page was created in the menu. These links are in the order of the pages.
150
-
151
- ## Menus
152
-
153
- A menu is created by default from all the pages in your app, in the order that they appear in the pages array. Often more control is needed over the menu. You might want to group menu items into different groups, change the title, exclude a page or add an icon. To do this, we can define a menu in the `menus` section of the `lowdefy.yaml` file.
154
-
155
- #### Step 2.4 - Add the menu configuration
156
-
157
- Copy the following and add it to your `lowdefy.yaml` file just before the pages section:
158
-
159
- ```yaml
160
- ################ -------- Copy from here -------- ################
161
- menus:
162
- - id: default
163
- links:
164
- - id: new-ticket
165
- type: MenuLink
166
- properties:
167
- icon: AiOutlinedAlert
168
- title: New ticket
169
- pageId: new-ticket
170
- - id: welcome
171
- type: MenuLink
172
- properties:
173
- icon: AiOutlinedHome
174
- title: Home
175
- pageId: welcome
176
- ################ -------- Copy to here ---------- ################
177
- pages:
178
- - _ref: new-ticket.yaml
179
- # ...
180
- ```
181
-
182
- The menu links will now have icons and titles.
183
-
184
- > If you would like to see how your config should look at this point, you can find it [here](tutorial-create-page-config).
185
-
186
- ### Up next
187
-
188
- In the next section we will add some more blocks to our page to create a form to capture the ticket data.
189
-
190
- - _ref:
191
- path: templates/navigation_buttons.yaml
192
- vars:
193
- previous_page_title: Getting started
194
- previous_page_id: tutorial-start
195
- next_page_title: Adding blocks
196
- next_page_id: tutorial-add-blocks