@lowdefy/docs 3.23.2 → 4.0.0-alpha.10

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 (274) hide show
  1. package/dist/operators/client/filter_default_value.js +55 -0
  2. package/{public/modules/connectDocsearch.js → dist/operatorsClient.js} +2 -20
  3. package/{templates/blocks/schemaTransformer.js → dist/types.js} +6 -11
  4. package/package.json +23 -8
  5. package/404.yaml +0 -26
  6. package/CHANGELOG.md +0 -659
  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 -802
  24. package/blocks/container/Affix.yaml +0 -26
  25. package/blocks/container/Badge.yaml +0 -27
  26. package/blocks/container/Box.yaml +0 -27
  27. package/blocks/container/Card.yaml +0 -29
  28. package/blocks/container/Collapse.yaml +0 -38
  29. package/blocks/container/Comment.yaml +0 -43
  30. package/blocks/container/ConfirmModal.yaml +0 -36
  31. package/blocks/container/Drawer.yaml +0 -45
  32. package/blocks/container/Label.yaml +0 -29
  33. package/blocks/container/Modal.yaml +0 -46
  34. package/blocks/container/Result.yaml +0 -34
  35. package/blocks/container/Span.yaml +0 -27
  36. package/blocks/container/Spin.yaml +0 -27
  37. package/blocks/container/Tabs.yaml +0 -41
  38. package/blocks/container/Tooltip.yaml +0 -38
  39. package/blocks/context/Context.yaml +0 -27
  40. package/blocks/context/PageHCF.yaml +0 -28
  41. package/blocks/context/PageHCSF.yaml +0 -29
  42. package/blocks/context/PageHSCF.yaml +0 -29
  43. package/blocks/context/PageHeaderMenu.yaml +0 -52
  44. package/blocks/context/PageSHCF.yaml +0 -29
  45. package/blocks/context/PageSiderMenu.yaml +0 -53
  46. package/blocks/display/Alert.yaml +0 -26
  47. package/blocks/display/Anchor.yaml +0 -26
  48. package/blocks/display/Avatar.yaml +0 -24
  49. package/blocks/display/Breadcrumb.yaml +0 -29
  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/Descriptions.yaml +0 -49
  54. package/blocks/display/Divider.yaml +0 -25
  55. package/blocks/display/EChart.yaml +0 -53
  56. package/blocks/display/Html.yaml +0 -50
  57. package/blocks/display/Icon.yaml +0 -25
  58. package/blocks/display/Img.yaml +0 -40
  59. package/blocks/display/Markdown.yaml +0 -32
  60. package/blocks/display/MarkdownWithCode.yaml +0 -48
  61. package/blocks/display/Menu.yaml +0 -48
  62. package/blocks/display/Message.yaml +0 -34
  63. package/blocks/display/MobileMenu.yaml +0 -48
  64. package/blocks/display/Notification.yaml +0 -34
  65. package/blocks/display/Paragraph.yaml +0 -32
  66. package/blocks/display/Progress.yaml +0 -53
  67. package/blocks/display/Skeleton.yaml +0 -28
  68. package/blocks/display/Statistic.yaml +0 -37
  69. package/blocks/display/Title.yaml +0 -32
  70. package/blocks/input/AutoComplete.yaml +0 -31
  71. package/blocks/input/ButtonSelector.yaml +0 -37
  72. package/blocks/input/CheckboxSelector.yaml +0 -37
  73. package/blocks/input/CheckboxSwitch.yaml +0 -56
  74. package/blocks/input/ChromeColorSelector.yaml +0 -25
  75. package/blocks/input/CircleColorSelector.yaml +0 -25
  76. package/blocks/input/ColorSelector.yaml +0 -25
  77. package/blocks/input/CompactColorSelector.yaml +0 -25
  78. package/blocks/input/DateRangeSelector.yaml +0 -27
  79. package/blocks/input/DateSelector.yaml +0 -27
  80. package/blocks/input/DateTimeSelector.yaml +0 -29
  81. package/blocks/input/GithubColorSelector.yaml +0 -25
  82. package/blocks/input/MonthSelector.yaml +0 -27
  83. package/blocks/input/MultipleSelector.yaml +0 -117
  84. package/blocks/input/NumberInput.yaml +0 -24
  85. package/blocks/input/Pagination.yaml +0 -33
  86. package/blocks/input/ParagraphInput.yaml +0 -32
  87. package/blocks/input/PasswordInput.yaml +0 -48
  88. package/blocks/input/RadioSelector.yaml +0 -36
  89. package/blocks/input/RatingSlider.yaml +0 -24
  90. package/blocks/input/S3UploadButton.yaml +0 -28
  91. package/blocks/input/Selector.yaml +0 -98
  92. package/blocks/input/SliderColorSelector.yaml +0 -24
  93. package/blocks/input/SwatchesColorSelector.yaml +0 -24
  94. package/blocks/input/Switch.yaml +0 -24
  95. package/blocks/input/TextArea.yaml +0 -28
  96. package/blocks/input/TextInput.yaml +0 -59
  97. package/blocks/input/TitleInput.yaml +0 -32
  98. package/blocks/input/TwitterColorSelector.yaml +0 -24
  99. package/blocks/input/WeekSelector.yaml +0 -26
  100. package/blocks/list/ControlledList.yaml +0 -191
  101. package/blocks/list/List.yaml +0 -158
  102. package/blocks/list/TimelineList.yaml +0 -135
  103. package/body.html +0 -1
  104. package/concepts/blocks.yaml +0 -249
  105. package/concepts/cli.yaml +0 -173
  106. package/concepts/connections-and-requests.yaml +0 -114
  107. package/concepts/context-and-state.yaml +0 -82
  108. package/concepts/custom-blocks.yaml +0 -176
  109. package/concepts/custom-code.yaml +0 -196
  110. package/concepts/events-and-actions.yaml +0 -224
  111. package/concepts/hosting-files.yaml +0 -50
  112. package/concepts/layout.yaml +0 -1464
  113. package/concepts/lists.yaml +0 -162
  114. package/concepts/lowdefy-schema.yaml +0 -244
  115. package/concepts/operators.yaml +0 -66
  116. package/concepts/overview.yaml +0 -48
  117. package/concepts/secrets.yaml +0 -56
  118. package/connections/AWSS3.yaml +0 -228
  119. package/connections/AmazonRedshift.yaml +0 -75
  120. package/connections/AxiosHttp.yaml +0 -194
  121. package/connections/Elasticsearch.yaml +0 -378
  122. package/connections/GoogleSheet.yaml +0 -332
  123. package/connections/Knex.yaml +0 -181
  124. package/connections/KnexRequests.md +0 -121
  125. package/connections/MSSQL.yaml +0 -90
  126. package/connections/MariaDB.yaml +0 -77
  127. package/connections/MongoDB.yaml +0 -452
  128. package/connections/MySQL.yaml +0 -92
  129. package/connections/OracleDB.yaml +0 -73
  130. package/connections/PostgreSQL.yaml +0 -99
  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 -251
  140. package/howto/generate-pdf.yaml.njk +0 -651
  141. package/howto/generateCsv/lowdefy.yaml +0 -63
  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 -116
  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/introduction.yaml +0 -100
  151. package/lowdefy.yaml +0 -66
  152. package/menus.yaml +0 -841
  153. package/operators/_actions.yaml +0 -123
  154. package/operators/_and.yaml +0 -90
  155. package/operators/_args.yaml +0 -79
  156. package/operators/_array.yaml +0 -326
  157. package/operators/_base64.yaml +0 -56
  158. package/operators/_change_case.yaml +0 -347
  159. package/operators/_date.yaml +0 -71
  160. package/operators/_diff.yaml +0 -76
  161. package/operators/_divide.yaml +0 -46
  162. package/operators/_eq.yaml +0 -67
  163. package/operators/_event.yaml +0 -102
  164. package/operators/_format.yaml +0 -209
  165. package/operators/_function.yaml +0 -66
  166. package/operators/_get.yaml +0 -108
  167. package/operators/_global.yaml +0 -106
  168. package/operators/_gt.yaml +0 -65
  169. package/operators/_gte.yaml +0 -65
  170. package/operators/_hash.yaml +0 -109
  171. package/operators/_if.yaml +0 -44
  172. package/operators/_if_none.yaml +0 -61
  173. package/operators/_index.yaml +0 -64
  174. package/operators/_input.yaml +0 -113
  175. package/operators/_js.yaml +0 -189
  176. package/operators/_json.yaml +0 -128
  177. package/operators/_list_contexts.yaml +0 -37
  178. package/operators/_location.yaml +0 -59
  179. package/operators/_log.yaml +0 -36
  180. package/operators/_lt.yaml +0 -65
  181. package/operators/_lte.yaml +0 -65
  182. package/operators/_math.yaml +0 -374
  183. package/operators/_media.yaml +0 -86
  184. package/operators/_menu.yaml +0 -81
  185. package/operators/_mql.yaml +0 -101
  186. package/operators/_ne.yaml +0 -77
  187. package/operators/_not.yaml +0 -47
  188. package/operators/_number.yaml +0 -157
  189. package/operators/_nunjucks.yaml +0 -73
  190. package/operators/_object.yaml +0 -193
  191. package/operators/_operator.yaml +0 -47
  192. package/operators/_or.yaml +0 -81
  193. package/operators/_product.yaml +0 -59
  194. package/operators/_random.yaml +0 -104
  195. package/operators/_ref.yaml +0 -232
  196. package/operators/_regex.yaml +0 -83
  197. package/operators/_request.yaml +0 -50
  198. package/operators/_secret.yaml +0 -74
  199. package/operators/_state.yaml +0 -113
  200. package/operators/_string.yaml +0 -283
  201. package/operators/_subtract.yaml +0 -38
  202. package/operators/_sum.yaml +0 -59
  203. package/operators/_switch.yaml +0 -51
  204. package/operators/_type.yaml +0 -92
  205. package/operators/_uri.yaml +0 -56
  206. package/operators/_url_query.yaml +0 -119
  207. package/operators/_user.yaml +0 -107
  208. package/operators/_uuid.yaml +0 -114
  209. package/operators/_var.yaml +0 -105
  210. package/operators/_yaml.yaml +0 -83
  211. package/pages.yaml +0 -228
  212. package/public/images/authors/gervwyk.jpeg +0 -0
  213. package/public/images/authors/sandile.jpeg +0 -0
  214. package/public/images/howto/header_generate_csv.jpg +0 -0
  215. package/public/images/howto/header_generate_pdf.jpg +0 -0
  216. package/public/logo_example.png +0 -0
  217. package/public/lowdefy_app_schema.png +0 -0
  218. package/public/modules/csvMake.js +0 -27
  219. package/public/modules/filterDefaultValue.js +0 -48
  220. package/public/modules/importUmd.js +0 -7
  221. package/public/modules/index.js +0 -5
  222. package/public/modules/pdfMake.js +0 -7
  223. package/public/modules/test/filterDefaultValue.test.js +0 -91
  224. package/public/modules/vfs_fonts.js +0 -12
  225. package/public/sitemap.xml +0 -1024
  226. package/templates/actions.yaml.njk +0 -68
  227. package/templates/blocks/defaultValueTransformer.js +0 -51
  228. package/templates/blocks/exampleTransformer.js +0 -81
  229. package/templates/blocks/layout.yaml +0 -114
  230. package/templates/blocks/propertiesFormTransformer.js +0 -419
  231. package/templates/blocks/propertiesGetterTransformer.js +0 -132
  232. package/templates/blocks/schema.yaml.njk +0 -42
  233. package/templates/blocks/style.yaml +0 -26
  234. package/templates/blocks/template.yaml.njk +0 -496
  235. package/templates/blog.yaml.njk +0 -221
  236. package/templates/cli_command.yaml.njk +0 -37
  237. package/templates/footer.yaml.njk +0 -604
  238. package/templates/general.yaml.njk +0 -124
  239. package/templates/generateSitemap.js +0 -42
  240. package/templates/header.yaml +0 -138
  241. package/templates/navigation_buttons.yaml +0 -68
  242. package/templates/operators.yaml.njk +0 -82
  243. package/templates/operatorsMethodTransformer.js +0 -119
  244. package/templates/test/array.test.js +0 -1355
  245. package/templates/test/boolean.test.js +0 -102
  246. package/templates/test/button.test.js +0 -170
  247. package/templates/test/color.test.js +0 -128
  248. package/templates/test/enum.test.js +0 -109
  249. package/templates/test/icon.test.js +0 -113
  250. package/templates/test/integer.test.js +0 -103
  251. package/templates/test/manual.test.js +0 -246
  252. package/templates/test/number.test.js +0 -103
  253. package/templates/test/object.test.js +0 -442
  254. package/templates/test/oneOf.test.js +0 -806
  255. package/templates/test/string.test.js +0 -102
  256. package/templates/test/yaml.test.js +0 -621
  257. package/tutorial/next-steps.yaml +0 -83
  258. package/tutorial/tutorial-actions-operators-config.yaml +0 -142
  259. package/tutorial/tutorial-actions-operators.yaml +0 -436
  260. package/tutorial/tutorial-add-blocks-config.yaml +0 -109
  261. package/tutorial/tutorial-add-blocks.yaml +0 -195
  262. package/tutorial/tutorial-create-page-config.yaml +0 -77
  263. package/tutorial/tutorial-create-page.yaml +0 -196
  264. package/tutorial/tutorial-deploy.yaml +0 -146
  265. package/tutorial/tutorial-requests-config.yaml +0 -186
  266. package/tutorial/tutorial-requests.yaml +0 -338
  267. package/tutorial/tutorial-start.yaml +0 -282
  268. package/users/login-and-logout.yaml +0 -164
  269. package/users/openid-connect.yaml +0 -84
  270. package/users/protected-pages.yaml +0 -67
  271. package/users/roles.yaml +0 -70
  272. package/users/user-object.yaml +0 -73
  273. package/users/users-introduction.yaml +0 -80
  274. package/version.yaml +0 -1
@@ -1,102 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */
16
-
17
- import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
18
- import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
19
- import defaultValueTransformer from '../blocks/defaultValueTransformer';
20
-
21
- const schema = {
22
- schema: {
23
- properties: {
24
- type: 'object',
25
- additionalProperties: false,
26
- properties: {
27
- str: {
28
- type: 'string',
29
- description: 'String description.',
30
- },
31
- },
32
- },
33
- },
34
- };
35
-
36
- test('string propertiesFormTransformer', () => {
37
- expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
38
- Array [
39
- Object {
40
- "id": "block.properties.str",
41
- "layout": Object {
42
- "_global": "settings_input_layout",
43
- },
44
- "properties": Object {
45
- "label": Object {
46
- "align": "right",
47
- "extra": "String description.",
48
- "span": 8,
49
- },
50
- "size": "small",
51
- "title": "str",
52
- },
53
- "required": false,
54
- "type": "TextInput",
55
- },
56
- ]
57
- `);
58
- });
59
-
60
- test('string propertiesGetterTransformer', () => {
61
- expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
62
- Object {
63
- "_object.assign": Array [
64
- Object {
65
- "_state": Object {
66
- "contextId": "Block:Block:{}",
67
- "default": Object {},
68
- "key": "block.properties",
69
- },
70
- },
71
- ],
72
- }
73
- `);
74
- });
75
-
76
- test('string defaultValueTransformer', () => {
77
- expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`
78
- Object {
79
- "str": null,
80
- }
81
- `);
82
- const schemaDV = {
83
- schema: {
84
- properties: {
85
- type: 'object',
86
- additionalProperties: false,
87
- properties: {
88
- str: {
89
- type: 'string',
90
- default: 'str_default',
91
- description: 'String description.',
92
- },
93
- },
94
- },
95
- },
96
- };
97
- expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
98
- Object {
99
- "str": "str_default",
100
- }
101
- `);
102
- });
@@ -1,621 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */
16
-
17
- import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
18
- import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
19
- import defaultValueTransformer from '../blocks/defaultValueTransformer';
20
-
21
- const schema = {
22
- schema: {
23
- properties: {
24
- type: 'object',
25
- additionalProperties: false,
26
- properties: {
27
- field: {
28
- type: 'object',
29
- description: 'description',
30
- docs: {
31
- displayType: 'yaml',
32
- },
33
- },
34
- },
35
- },
36
- },
37
- };
38
-
39
- test('yaml propertiesFormTransformer', () => {
40
- expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
41
- Array [
42
- Object {
43
- "id": "block.properties.field",
44
- "layout": Object {
45
- "_global": "settings_input_layout",
46
- },
47
- "properties": Object {
48
- "autoSize": Object {
49
- "minRows": 2,
50
- },
51
- "label": Object {
52
- "align": "right",
53
- "extra": "description",
54
- "span": 8,
55
- },
56
- "placeholder": "Type YAML here",
57
- "size": "small",
58
- "title": "field",
59
- },
60
- "required": false,
61
- "type": "TextArea",
62
- },
63
- ]
64
- `);
65
- });
66
-
67
- test('yaml propertiesGetterTransformer', () => {
68
- expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
69
- Object {
70
- "_object.assign": Array [
71
- Object {
72
- "_state": Object {
73
- "contextId": "Block:Block:{}",
74
- "default": Object {},
75
- "key": "block.properties",
76
- },
77
- },
78
- Object {
79
- "field": Object {
80
- "_yaml.parse": Object {
81
- "_if_none": Array [
82
- Object {
83
- "_state": Object {
84
- "contextId": "Block:Block:{}",
85
- "key": "block.properties.field",
86
- },
87
- },
88
- "",
89
- ],
90
- },
91
- },
92
- },
93
- ],
94
- }
95
- `);
96
- });
97
-
98
- test('yaml defaultValueTransformer', () => {
99
- expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`Object {}`);
100
- const schemaDV = {
101
- schema: {
102
- properties: {
103
- type: 'object',
104
- additionalProperties: false,
105
- properties: {
106
- field: {
107
- type: 'object',
108
- default: 'value',
109
- description: 'description',
110
- docs: {
111
- displayType: 'yaml',
112
- },
113
- },
114
- },
115
- },
116
- },
117
- };
118
- expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
119
- Object {
120
- "field": "value",
121
- }
122
- `);
123
- });
124
-
125
- const schemaNested = {
126
- schema: {
127
- properties: {
128
- type: 'object',
129
- additionalProperties: false,
130
- properties: {
131
- obj: {
132
- type: 'object',
133
- description: 'obj description',
134
- properties: {
135
- field: {
136
- type: 'object',
137
- description: 'field description',
138
- docs: {
139
- displayType: 'yaml',
140
- },
141
- },
142
- },
143
- },
144
- },
145
- },
146
- },
147
- };
148
-
149
- test('yaml schemaNested propertiesFormTransformer', () => {
150
- expect(propertiesFormTransformer(schemaNested)).toMatchInlineSnapshot(`
151
- Array [
152
- Object {
153
- "blocks": Array [
154
- Object {
155
- "id": "block.properties.obj.field",
156
- "layout": Object {
157
- "_global": "settings_input_layout",
158
- },
159
- "properties": Object {
160
- "autoSize": Object {
161
- "minRows": 2,
162
- },
163
- "label": Object {
164
- "align": "right",
165
- "extra": "field description",
166
- "span": 8,
167
- },
168
- "placeholder": "Type YAML here",
169
- "size": "small",
170
- "title": "field",
171
- },
172
- "required": false,
173
- "type": "TextArea",
174
- },
175
- ],
176
- "id": "block.properties.obj",
177
- "layout": Object {
178
- "contentGutter": 0,
179
- },
180
- "properties": Object {
181
- "bodyStyle": Object {
182
- "padding": 0,
183
- },
184
- "size": "small",
185
- "title": "obj:",
186
- },
187
- "type": "Card",
188
- },
189
- ]
190
- `);
191
- });
192
-
193
- test('yaml schemaNested propertiesGetterTransformer', () => {
194
- expect(propertiesGetterTransformer(schemaNested, { block_type: 'Block' })).toMatchInlineSnapshot(`
195
- Object {
196
- "_object.assign": Array [
197
- Object {
198
- "_state": Object {
199
- "contextId": "Block:Block:{}",
200
- "default": Object {},
201
- "key": "block.properties",
202
- },
203
- },
204
- Object {
205
- "obj": Object {
206
- "_object.assign": Array [
207
- Object {
208
- "_state": Object {
209
- "contextId": "Block:Block:{}",
210
- "default": Object {},
211
- "key": "block.properties.obj",
212
- },
213
- },
214
- Object {
215
- "field": Object {
216
- "_yaml.parse": Object {
217
- "_if_none": Array [
218
- Object {
219
- "_state": Object {
220
- "contextId": "Block:Block:{}",
221
- "key": "block.properties.obj.field",
222
- },
223
- },
224
- "",
225
- ],
226
- },
227
- },
228
- },
229
- ],
230
- },
231
- },
232
- ],
233
- }
234
- `);
235
- });
236
-
237
- test('yaml schemaNested defaultValueTransformer', () => {
238
- expect(defaultValueTransformer(schemaNested)).toMatchInlineSnapshot(`Object {}`);
239
- const schemaDV = {
240
- schema: {
241
- properties: {
242
- type: 'object',
243
- additionalProperties: false,
244
- properties: {
245
- obj: {
246
- type: 'object',
247
- description: 'obj description',
248
- properties: {
249
- field: {
250
- type: 'object',
251
- default: { a: 1 },
252
- description: 'field description',
253
- docs: {
254
- displayType: 'yaml',
255
- },
256
- },
257
- },
258
- },
259
- },
260
- },
261
- },
262
- };
263
- expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
264
- Object {
265
- "obj": Object {
266
- "field": Object {
267
- "a": 1,
268
- },
269
- },
270
- }
271
- `);
272
- });
273
-
274
- const schemaYamlInArray = {
275
- schema: {
276
- properties: {
277
- type: 'object',
278
- additionalProperties: false,
279
- properties: {
280
- arr: {
281
- type: 'array',
282
- description: 'arr description',
283
- items: {
284
- type: 'object',
285
- description: 'yaml description',
286
- docs: {
287
- displayType: 'yaml',
288
- },
289
- },
290
- },
291
- },
292
- },
293
- },
294
- };
295
-
296
- test('yaml schemaYamlInArray propertiesFormTransformer', () => {
297
- expect(propertiesFormTransformer(schemaYamlInArray)).toMatchInlineSnapshot(`
298
- Array [
299
- Object {
300
- "blocks": Array [
301
- Object {
302
- "id": "block.properties.arr.$",
303
- "layout": Object {
304
- "_global": "settings_input_layout",
305
- },
306
- "properties": Object {
307
- "autoSize": Object {
308
- "minRows": 2,
309
- },
310
- "label": Object {
311
- "disabled": true,
312
- },
313
- "placeholder": "Type YAML here",
314
- "size": "small",
315
- "title": "$",
316
- },
317
- "required": false,
318
- "type": "TextArea",
319
- },
320
- ],
321
- "id": "block.properties.arr",
322
- "layout": Object {
323
- "contentGutter": 0,
324
- },
325
- "properties": Object {
326
- "itemStyle": Object {
327
- "padding": 0,
328
- },
329
- "size": "small",
330
- "title": "arr:",
331
- },
332
- "type": "ControlledList",
333
- },
334
- ]
335
- `);
336
- });
337
-
338
- test('yaml schemaYamlInArray propertiesGetterTransformer', () => {
339
- expect(propertiesGetterTransformer(schemaYamlInArray, { block_type: 'Block' }))
340
- .toMatchInlineSnapshot(`
341
- Object {
342
- "_object.assign": Array [
343
- Object {
344
- "_state": Object {
345
- "contextId": "Block:Block:{}",
346
- "default": Object {},
347
- "key": "block.properties",
348
- },
349
- },
350
- Object {
351
- "arr": Object {
352
- "_array.map": Object {
353
- "callback": Object {
354
- "_function": Object {
355
- "__yaml.parse": Object {
356
- "__if_none": Array [
357
- Object {
358
- "__args": Object {
359
- "contextId": undefined,
360
- "key": "0",
361
- },
362
- },
363
- "",
364
- ],
365
- },
366
- },
367
- },
368
- "on": Object {
369
- "_if_none": Array [
370
- Object {
371
- "_state": Object {
372
- "contextId": "Block:Block:{}",
373
- "key": "block.properties.arr",
374
- },
375
- },
376
- Array [],
377
- ],
378
- },
379
- },
380
- },
381
- },
382
- ],
383
- }
384
- `);
385
- });
386
-
387
- test('yaml schemaYamlInArray defaultValueTransformer', () => {
388
- expect(defaultValueTransformer(schemaYamlInArray)).toMatchInlineSnapshot(`
389
- Object {
390
- "arr": Array [],
391
- }
392
- `);
393
- const schemaYamlInArrayDV = {
394
- schema: {
395
- properties: {
396
- type: 'object',
397
- additionalProperties: false,
398
- properties: {
399
- arr: {
400
- type: 'array',
401
- default: [{ a: 1 }],
402
- description: 'arr description',
403
- items: {
404
- type: 'object',
405
- description: 'yaml description',
406
- docs: {
407
- displayType: 'yaml',
408
- },
409
- },
410
- },
411
- },
412
- },
413
- },
414
- };
415
- expect(defaultValueTransformer(schemaYamlInArrayDV)).toMatchInlineSnapshot(`
416
- Object {
417
- "arr": Array [
418
- Object {
419
- "a": 1,
420
- },
421
- ],
422
- }
423
- `);
424
- });
425
-
426
- const schemaYamlInObjectInArray = {
427
- schema: {
428
- properties: {
429
- type: 'object',
430
- additionalProperties: false,
431
- properties: {
432
- arr: {
433
- type: 'array',
434
- description: 'arr description',
435
- items: {
436
- type: 'object',
437
- description: 'obj description',
438
- properties: {
439
- yaml: {
440
- type: 'object',
441
- description: 'yaml description',
442
- docs: {
443
- displayType: 'yaml',
444
- },
445
- },
446
- },
447
- },
448
- },
449
- },
450
- },
451
- },
452
- };
453
-
454
- test('yaml schemaYamlInObjectInArray propertiesFormTransformer', () => {
455
- expect(propertiesFormTransformer(schemaYamlInObjectInArray)).toMatchInlineSnapshot(`
456
- Array [
457
- Object {
458
- "blocks": Array [
459
- Object {
460
- "blocks": Array [
461
- Object {
462
- "id": "block.properties.arr.$.yaml",
463
- "layout": Object {
464
- "_global": "settings_input_layout",
465
- },
466
- "properties": Object {
467
- "autoSize": Object {
468
- "minRows": 2,
469
- },
470
- "label": Object {
471
- "align": "right",
472
- "extra": "yaml description",
473
- "span": 8,
474
- },
475
- "placeholder": "Type YAML here",
476
- "size": "small",
477
- "title": "yaml",
478
- },
479
- "required": false,
480
- "type": "TextArea",
481
- },
482
- ],
483
- "id": "block.properties.arr.$",
484
- "layout": Object {
485
- "contentGutter": 0,
486
- },
487
- "properties": Object {
488
- "bodyStyle": Object {
489
- "padding": 0,
490
- },
491
- "size": "small",
492
- "title": false,
493
- },
494
- "type": "Card",
495
- },
496
- ],
497
- "id": "block.properties.arr",
498
- "layout": Object {
499
- "contentGutter": 0,
500
- },
501
- "properties": Object {
502
- "itemStyle": Object {
503
- "padding": 0,
504
- },
505
- "size": "small",
506
- "title": "arr:",
507
- },
508
- "type": "ControlledList",
509
- },
510
- ]
511
- `);
512
- });
513
-
514
- test('yaml schemaYamlInObjectInArray propertiesGetterTransformer', () => {
515
- expect(propertiesGetterTransformer(schemaYamlInObjectInArray, { block_type: 'Block' }))
516
- .toMatchInlineSnapshot(`
517
- Object {
518
- "_object.assign": Array [
519
- Object {
520
- "_state": Object {
521
- "contextId": "Block:Block:{}",
522
- "default": Object {},
523
- "key": "block.properties",
524
- },
525
- },
526
- Object {
527
- "arr": Object {
528
- "_array.map": Object {
529
- "callback": Object {
530
- "_function": Object {
531
- "__object.assign": Array [
532
- Object {
533
- "__args": Object {
534
- "contextId": undefined,
535
- "default": Object {},
536
- "key": "0",
537
- },
538
- },
539
- Object {
540
- "yaml": Object {
541
- "__yaml.parse": Object {
542
- "__if_none": Array [
543
- Object {
544
- "__args": Object {
545
- "contextId": undefined,
546
- "key": "0.yaml",
547
- },
548
- },
549
- "",
550
- ],
551
- },
552
- },
553
- },
554
- ],
555
- },
556
- },
557
- "on": Object {
558
- "_if_none": Array [
559
- Object {
560
- "_state": Object {
561
- "contextId": "Block:Block:{}",
562
- "key": "block.properties.arr",
563
- },
564
- },
565
- Array [],
566
- ],
567
- },
568
- },
569
- },
570
- },
571
- ],
572
- }
573
- `);
574
- });
575
-
576
- test('yaml schemaYamlInObjectInArray defaultValueTransformer', () => {
577
- expect(defaultValueTransformer(schemaYamlInObjectInArray)).toMatchInlineSnapshot(`
578
- Object {
579
- "arr": Array [],
580
- }
581
- `);
582
- const schemaYamlInObjectInArrayDV = {
583
- schema: {
584
- properties: {
585
- type: 'object',
586
- additionalProperties: false,
587
- properties: {
588
- arr: {
589
- type: 'array',
590
- description: 'arr description',
591
- default: [{ yaml: { b: 1 } }],
592
- items: {
593
- type: 'object',
594
- description: 'obj description',
595
- properties: {
596
- yaml: {
597
- type: 'object',
598
- description: 'yaml description',
599
- docs: {
600
- displayType: 'yaml',
601
- },
602
- },
603
- },
604
- },
605
- },
606
- },
607
- },
608
- },
609
- };
610
- expect(defaultValueTransformer(schemaYamlInObjectInArrayDV)).toMatchInlineSnapshot(`
611
- Object {
612
- "arr": Array [
613
- Object {
614
- "yaml": Object {
615
- "b": 1,
616
- },
617
- },
618
- ],
619
- }
620
- `);
621
- });