mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-17 14:30:34 +08:00
Merge remote-tracking branch 'origin/develop' into cli-output
This commit is contained in:
commit
1899b7e91d
19
.pnp.cjs
generated
19
.pnp.cjs
generated
@ -44,10 +44,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"name": "@lowdefy/engine",\
|
||||
"reference": "workspace:packages/engine"\
|
||||
},\
|
||||
{\
|
||||
"name": "@lowdefy/format",\
|
||||
"reference": "workspace:packages/format"\
|
||||
},\
|
||||
{\
|
||||
"name": "@lowdefy/layout",\
|
||||
"reference": "workspace:packages/layout"\
|
||||
@ -229,7 +225,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@lowdefy/connection-stripe", ["workspace:packages/plugins/connections/connection-stripe"]],\
|
||||
["@lowdefy/docs", ["workspace:packages/docs"]],\
|
||||
["@lowdefy/engine", ["workspace:packages/engine"]],\
|
||||
["@lowdefy/format", ["workspace:packages/format"]],\
|
||||
["@lowdefy/helpers", ["workspace:packages/utils/helpers"]],\
|
||||
["@lowdefy/jest-yaml-transform", ["workspace:packages/utils/jest-yaml-transform"]],\
|
||||
["@lowdefy/layout", ["workspace:packages/layout"]],\
|
||||
@ -3584,20 +3579,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "SOFT"\
|
||||
}]\
|
||||
]],\
|
||||
["@lowdefy/format", [\
|
||||
["workspace:packages/format", {\
|
||||
"packageLocation": "./packages/format/",\
|
||||
"packageDependencies": [\
|
||||
["@lowdefy/format", "workspace:packages/format"],\
|
||||
["@swc/cli", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:0.1.57"],\
|
||||
["@swc/core", "npm:1.2.194"],\
|
||||
["@swc/jest", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:0.2.21"],\
|
||||
["jest", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:28.1.0"],\
|
||||
["moment", "npm:2.29.4"]\
|
||||
],\
|
||||
"linkType": "SOFT"\
|
||||
}]\
|
||||
]],\
|
||||
["@lowdefy/helpers", [\
|
||||
["workspace:packages/utils/helpers", {\
|
||||
"packageLocation": "./packages/utils/helpers/",\
|
||||
|
11
CHANGELOG.md
11
CHANGELOG.md
@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **blocks-aggrid:** Fix typo 😱 ([21eef06](https://github.com/lowdefy/lowdefy/commit/21eef065d00eb1f7e7e9c2d0b180c49848dbec2e))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"packages": [
|
||||
"src/packages/*",
|
||||
"src/packages/blocks/*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/lowdefy",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"description": "Lowdefy monorepo",
|
||||
@ -35,7 +35,7 @@
|
||||
"lerna:version": "lerna version --no-git-tag-version",
|
||||
"prettier": "prettier --config .prettierrc --write **/*.js",
|
||||
"start": "yarn start:server:app",
|
||||
"test:ci": "yarn test --ignore='@lowdefy/format' --ignore='@lowdefy/blocks-*' --ignore='@lowdefy/plugin-aws'",
|
||||
"test:ci": "yarn test --ignore='@lowdefy/blocks-*' --ignore='@lowdefy/plugin-aws'",
|
||||
"test": "lerna run test",
|
||||
"app:cli:build": "yarn build:turbo && yarn workspace lowdefy start build --config-directory ../../app --server-directory ../server",
|
||||
"app:cli:dev": "yarn build:turbo && yarn workspace lowdefy start dev --config-directory ../../app --dev-directory ../server-dev",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/api
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/api
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/api",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -41,12 +41,12 @@
|
||||
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/ajv": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/node-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/nunjucks": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-js": "4.0.0-alpha.21"
|
||||
"@lowdefy/ajv": "4.0.0-alpha.22",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"@lowdefy/node-utils": "4.0.0-alpha.22",
|
||||
"@lowdefy/nunjucks": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-js": "4.0.0-alpha.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "28.1.0",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/build
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/build
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/build",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -52,14 +52,14 @@
|
||||
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/ajv": "4.0.0-alpha.21",
|
||||
"@lowdefy/blocks-basic": "4.0.0-alpha.21",
|
||||
"@lowdefy/blocks-loaders": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/node-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/nunjucks": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-js": "4.0.0-alpha.21",
|
||||
"@lowdefy/ajv": "4.0.0-alpha.22",
|
||||
"@lowdefy/blocks-basic": "4.0.0-alpha.22",
|
||||
"@lowdefy/blocks-loaders": "4.0.0-alpha.22",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"@lowdefy/node-utils": "4.0.0-alpha.22",
|
||||
"@lowdefy/nunjucks": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-js": "4.0.0-alpha.22",
|
||||
"ajv": "8.11.0",
|
||||
"json5": "2.2.1",
|
||||
"uuid": "8.3.2",
|
||||
@ -68,28 +68,28 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "28.1.0",
|
||||
"@lowdefy/actions-core": "4.0.0-alpha.21",
|
||||
"@lowdefy/blocks-aggrid": "4.0.0-alpha.21",
|
||||
"@lowdefy/blocks-antd": "4.0.0-alpha.21",
|
||||
"@lowdefy/blocks-color-selectors": "4.0.0-alpha.21",
|
||||
"@lowdefy/blocks-echarts": "4.0.0-alpha.21",
|
||||
"@lowdefy/blocks-google-maps": "4.0.0-alpha.21",
|
||||
"@lowdefy/blocks-markdown": "4.0.0-alpha.21",
|
||||
"@lowdefy/connection-axios-http": "4.0.0-alpha.21",
|
||||
"@lowdefy/connection-elasticsearch": "4.0.0-alpha.21",
|
||||
"@lowdefy/connection-google-sheets": "4.0.0-alpha.21",
|
||||
"@lowdefy/connection-knex": "4.0.0-alpha.21",
|
||||
"@lowdefy/connection-mongodb": "4.0.0-alpha.21",
|
||||
"@lowdefy/connection-redis": "4.0.0-alpha.21",
|
||||
"@lowdefy/connection-sendgrid": "4.0.0-alpha.21",
|
||||
"@lowdefy/connection-stripe": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-change-case": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-diff": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-mql": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-nunjucks": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-uuid": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-yaml": "4.0.0-alpha.21",
|
||||
"@lowdefy/plugin-next-auth": "4.0.0-alpha.21",
|
||||
"@lowdefy/actions-core": "4.0.0-alpha.22",
|
||||
"@lowdefy/blocks-aggrid": "4.0.0-alpha.22",
|
||||
"@lowdefy/blocks-antd": "4.0.0-alpha.22",
|
||||
"@lowdefy/blocks-color-selectors": "4.0.0-alpha.22",
|
||||
"@lowdefy/blocks-echarts": "4.0.0-alpha.22",
|
||||
"@lowdefy/blocks-google-maps": "4.0.0-alpha.22",
|
||||
"@lowdefy/blocks-markdown": "4.0.0-alpha.22",
|
||||
"@lowdefy/connection-axios-http": "4.0.0-alpha.22",
|
||||
"@lowdefy/connection-elasticsearch": "4.0.0-alpha.22",
|
||||
"@lowdefy/connection-google-sheets": "4.0.0-alpha.22",
|
||||
"@lowdefy/connection-knex": "4.0.0-alpha.22",
|
||||
"@lowdefy/connection-mongodb": "4.0.0-alpha.22",
|
||||
"@lowdefy/connection-redis": "4.0.0-alpha.22",
|
||||
"@lowdefy/connection-sendgrid": "4.0.0-alpha.22",
|
||||
"@lowdefy/connection-stripe": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-change-case": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-diff": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-mql": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-nunjucks": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-uuid": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-yaml": "4.0.0-alpha.22",
|
||||
"@lowdefy/plugin-next-auth": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -74,6 +74,9 @@ function buildEvents(block, pageContext) {
|
||||
}". Received ${JSON.stringify(block.events[key].try)}`
|
||||
);
|
||||
}
|
||||
if (type.isNone(block.events[key].catch)) {
|
||||
block.events[key].catch = [];
|
||||
}
|
||||
if (!type.isArray(block.events[key].catch)) {
|
||||
throw new Error(
|
||||
`Catch actions must be an array at "${block.blockId}" in event "${key}.catch" on page "${
|
||||
|
@ -146,14 +146,14 @@ test('block events actions as try array and catch not defined.', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
expect(() =>
|
||||
buildPages({
|
||||
components,
|
||||
context,
|
||||
})
|
||||
).toThrow(
|
||||
'Catch actions must be an array at "block_1" in event "onClick.catch" on page "page_1". Received undefined'
|
||||
);
|
||||
const res = buildPages({ components, context });
|
||||
expect(get(res, 'pages.0.areas.content.blocks.0.events.onClick.try')).toEqual([
|
||||
{
|
||||
id: 'action_1',
|
||||
type: 'Reset',
|
||||
},
|
||||
]);
|
||||
expect(get(res, 'pages.0.areas.content.blocks.0.events.onClick.catch')).toEqual([]);
|
||||
});
|
||||
|
||||
test('block events actions try not an array', () => {
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package lowdefy
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package lowdefy
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lowdefy",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Lowdefy CLI",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -40,8 +40,8 @@
|
||||
"test": "FORCE_COLOR=3 yarn node --experimental-vm-modules $(yarn bin jest)"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/node-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"@lowdefy/node-utils": "4.0.0-alpha.22",
|
||||
"axios": "0.27.2",
|
||||
"commander": "9.4.0",
|
||||
"decompress": "4.2.1",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/client
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/client",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Lowdefy Client",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -43,17 +43,17 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "4.7.0",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/engine": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/layout": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"@lowdefy/engine": "4.0.0-alpha.22",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"@lowdefy/layout": "4.0.0-alpha.22",
|
||||
"classnames": "2.3.1",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/docs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/docs
|
||||
|
@ -15,9 +15,9 @@
|
||||
_ref:
|
||||
path: templates/actions.yaml.njk
|
||||
vars:
|
||||
pageId: Throw
|
||||
pageTitle: Throw
|
||||
filePath: actions/Throw.yaml
|
||||
pageId: Break
|
||||
pageTitle: Break
|
||||
filePath: actions/Break.yaml
|
||||
types: |
|
||||
```
|
||||
(params: {
|
||||
@ -27,19 +27,21 @@ _ref:
|
||||
}): void
|
||||
```
|
||||
description: |
|
||||
The `Throw` action is used throw an error to the user and log to the console. If `throw: true`, the `Throw`
|
||||
action will throw an error, and this will stop the execution of actions that are defined after it. If the action does not thrown, the `Throw` action will do nothing and the actions defined after it will be executed.
|
||||
##### TODO: This page needs to be updated.
|
||||
|
||||
The `Break` action is used throw an error to the user and log to the console. If `throw: true`, the `Break`
|
||||
action will throw an error, and this will stop the execution of actions that are defined after it. If the action does not thrown, the `Break` action will do nothing and the actions defined after it will be executed.
|
||||
|
||||
params: |
|
||||
- `throw: boolean`: Throws an error and stops the action chain when `true` or continues the action chain when `false` or undefined.
|
||||
- `throw: boolean`: Breaks an error and stops the action chain when `true` or continues the action chain when `false` or undefined.
|
||||
- `message: string`: The error message to show to the user and log to the console if `throw: true`. This message can be overridden by setting the action's `messages.error`.
|
||||
- `metaData: any`: Data to log to the console if `throw: true`.
|
||||
|
||||
examples: |
|
||||
###### Throw with custom message:
|
||||
###### Break with custom message:
|
||||
```yaml
|
||||
- id: throw
|
||||
type: Throw
|
||||
type: Break
|
||||
params:
|
||||
throw:
|
||||
_eq:
|
||||
@ -48,10 +50,10 @@ _ref:
|
||||
message: Nooooooooooooooooo
|
||||
```
|
||||
|
||||
###### Throw with metaData:
|
||||
###### Break with metaData:
|
||||
```yaml
|
||||
- id: throw
|
||||
type: Throw
|
||||
type: Break
|
||||
params:
|
||||
throw:
|
||||
_eq:
|
||||
@ -64,7 +66,7 @@ _ref:
|
||||
###### Override custom message:
|
||||
```yaml
|
||||
- id: throw
|
||||
type: Throw
|
||||
type: Break
|
||||
messages:
|
||||
error: Meh.
|
||||
params:
|
||||
@ -77,7 +79,7 @@ _ref:
|
||||
###### Fail silently:
|
||||
```yaml
|
||||
- id: throw
|
||||
type: Throw
|
||||
type: Break
|
||||
messages:
|
||||
error: false
|
||||
params:
|
@ -15,9 +15,9 @@
|
||||
_ref:
|
||||
path: templates/actions.yaml.njk
|
||||
vars:
|
||||
pageId: MessageAction
|
||||
pageTitle: Message
|
||||
filePath: actions/Message.yaml
|
||||
pageId: DisplayMessage
|
||||
pageTitle: DisplayMessage
|
||||
filePath: actions/DisplayMessage.yaml
|
||||
types: |
|
||||
```
|
||||
(params: {
|
||||
@ -27,10 +27,10 @@ _ref:
|
||||
}): void
|
||||
```
|
||||
description: |
|
||||
The `Message` action is used to display a message to a user.
|
||||
The `DisplayMessage` action is used to display a message to a user.
|
||||
params: |
|
||||
###### object
|
||||
- `status: enum`: Message status type. Defaults to `success`. One of:
|
||||
- `status: enum`: DisplayMessage status type. Defaults to `success`. One of:
|
||||
- `success`
|
||||
- `error`
|
||||
- `info`
|
||||
@ -42,7 +42,7 @@ _ref:
|
||||
###### Display a success message:
|
||||
```yaml
|
||||
- id: success_message
|
||||
type: Message
|
||||
type: DisplayMessage
|
||||
params:
|
||||
content: Success
|
||||
```
|
||||
@ -50,7 +50,7 @@ _ref:
|
||||
###### Display an info message that remains visible for 10 seconds:
|
||||
```yaml
|
||||
- id: info_message
|
||||
type: Message
|
||||
type: DisplayMessage
|
||||
params:
|
||||
content: Something happened
|
||||
status: info
|
||||
@ -60,7 +60,7 @@ _ref:
|
||||
###### Display an error message that never disappears:
|
||||
```yaml
|
||||
- id: error_message
|
||||
type: Message
|
||||
type: DisplayMessage
|
||||
params:
|
||||
content: Something bad happened
|
||||
status: error
|
23
packages/docs/actions/Fetch.yaml
Normal file
23
packages/docs/actions/Fetch.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
# Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_ref:
|
||||
path: templates/actions.yaml.njk
|
||||
vars:
|
||||
pageId: Fetch
|
||||
pageTitle: Fetch
|
||||
filePath: actions/Fetch.yaml
|
||||
types: ''
|
||||
description: |
|
||||
##### TODO: This page needs to be updated.
|
@ -1,281 +0,0 @@
|
||||
# Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_ref:
|
||||
path: templates/actions.yaml.njk
|
||||
vars:
|
||||
pageId: JsAction
|
||||
pageTitle: JsAction
|
||||
filePath: actions/JsAction.yaml
|
||||
warning: |
|
||||
SECURITY WARNING: The JsAction executes JavaScript inside your Lowdefy app. Insecure code can expose your app or data. Since Lowdefy doesn't validate your JavaScript, make sure that you only load trusted code.
|
||||
types: |
|
||||
```
|
||||
(params: {
|
||||
name: string,
|
||||
args?: any[]
|
||||
}): void
|
||||
```
|
||||
description: |
|
||||
The `JsAction` action is used to call a custom JavaScript function which was loaded onto the page using the `window.lowdefy.registerJsAction()` method. This JavaScript function can be asynchronous. See [Custom Code](/custom-code) for more details on how to register a new JavaScript action.
|
||||
|
||||
The returned result of the JavaScript function is accessible through the [`_actions`](/_actions) operator for subsequent actions in the event action list.
|
||||
|
||||
#### JsAction function parameters
|
||||
|
||||
A `JsAction` function is called with a context object which includes all [`context` data objects](/context-and-state) as well as the list of `args` passed to the action.
|
||||
|
||||
```text
|
||||
(context: {
|
||||
actions: object,
|
||||
contextId: string,
|
||||
global: object,
|
||||
input: object,
|
||||
pageId: string,
|
||||
requests: object,
|
||||
state: object,
|
||||
urlQuery: object,
|
||||
user: object,
|
||||
},
|
||||
...args?: any[]): any
|
||||
```
|
||||
|
||||
#### Using Lowdefy actions in a JsAction
|
||||
|
||||
The context passed to the custom JsAction function contains an object called `actions`. This object contains all the Lowdefy action functions like `SetState`, `Request`, and `CallMethod`. The functions can be called using the same parameters as when they are used directly in the Lowdefy configuration. Operators in these parameters are not evaluated.
|
||||
|
||||
params: |
|
||||
###### object
|
||||
- `name: string`: __Required__ - The registered name of the JavaScript function to call when the action is triggered.
|
||||
- `args: any[]`: The array of positional arguments with which the JavaScript function should be called.
|
||||
|
||||
examples: |
|
||||
##### Set a [Intercom](https://www.intercom.com/) user when a page is initialized:
|
||||
|
||||
```yaml
|
||||
# lowdefy.yaml
|
||||
name: intercom-example
|
||||
lowdefy: '3.23.2'
|
||||
app:
|
||||
html:
|
||||
appendBody: |
|
||||
<script>
|
||||
function setIntercomUser(context) {
|
||||
window.intercomSettings = {
|
||||
app_id: "{{ your_intercom_app_id }}",
|
||||
name: context.user.name,
|
||||
email: context.user.email,
|
||||
};
|
||||
}
|
||||
window.lowdefy.registerJsAction('setIntercomUser', setIntercomUser);
|
||||
</script>
|
||||
<script>
|
||||
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');
|
||||
ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];
|
||||
i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');
|
||||
s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/{{ your_intercom_app_id }}';
|
||||
var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};
|
||||
if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
|
||||
</script>
|
||||
pages:
|
||||
- id: home
|
||||
type: PageHeaderMenu
|
||||
events:
|
||||
onInitAsync:
|
||||
- id: set_intercom_user
|
||||
type: JsAction # TODO:
|
||||
params:
|
||||
name: setIntercomUser
|
||||
blocks:
|
||||
# ...
|
||||
```
|
||||
|
||||
##### Highlight search term returned by [MongoDB Search Highlight](https://docs.atlas.mongodb.com/reference/atlas-search/highlighting/):
|
||||
Add a JavaScript file to highlight the search text by wapping the highlighted text with `<span style="background: yellow;">{{ value }}</span>`:
|
||||
```js
|
||||
// file: /public/highlightText.js
|
||||
function highlightText(context, data) {
|
||||
return data.map((item) => {
|
||||
item.highlights.forEach((light) => {
|
||||
const paths = light.path.split('.');
|
||||
const key = paths[paths.length - 1];
|
||||
paths.pop();
|
||||
let res = item;
|
||||
paths.forEach((key) => {
|
||||
res = res[key];
|
||||
});
|
||||
res[key] = light.texts.reduce((acc, obj) => {
|
||||
if (obj.type === 'hit') {
|
||||
return acc.concat('<span style="background: yellow;">', obj.value, '</span>');
|
||||
}
|
||||
return acc.concat(obj.value);
|
||||
}, '');
|
||||
});
|
||||
return item;
|
||||
});
|
||||
}
|
||||
export default highlightText;
|
||||
```
|
||||
Import custom JavaScript modules:
|
||||
```js
|
||||
// file: /public/modules.js
|
||||
import highlightText from './highlightText.js';
|
||||
window.lowdefy.registerJsAction('highlightText', highlightText);
|
||||
````
|
||||
Lowdefy setup:
|
||||
```yaml
|
||||
# file: lowdefy.yaml
|
||||
name: text-highlight-example
|
||||
lowdefy: '3.23.2'
|
||||
app:
|
||||
html:
|
||||
# Load the custom modules into the index.html head tag.
|
||||
appendHead: |
|
||||
<script type="module" src="/public/modules.js"></script>
|
||||
connections:
|
||||
- id: products
|
||||
type: MongoDBCollection
|
||||
properties:
|
||||
collection: products
|
||||
databaseUri:
|
||||
_secret: MDB_URI
|
||||
pages:
|
||||
- id: home
|
||||
type: PageHeaderMenu
|
||||
requests:
|
||||
- id: search_products
|
||||
type: MongoDBAggregation
|
||||
connectionId: products
|
||||
properties:
|
||||
pipeline:
|
||||
_array.concat:
|
||||
- - $search:
|
||||
compound:
|
||||
should:
|
||||
- text:
|
||||
query:
|
||||
_string.concat:
|
||||
- '*'
|
||||
- _state: search.input
|
||||
- '*'
|
||||
path:
|
||||
- title
|
||||
- description
|
||||
- wildcard:
|
||||
query:
|
||||
_string.concat:
|
||||
- '*'
|
||||
- _state: search.input
|
||||
- '*'
|
||||
path:
|
||||
- title
|
||||
- description
|
||||
allowAnalyzedField: true
|
||||
highlight:
|
||||
path:
|
||||
- title
|
||||
- description
|
||||
- $addFields:
|
||||
score:
|
||||
$meta: searchScore
|
||||
highlights:
|
||||
$meta: searchHighlights
|
||||
blocks:
|
||||
- id: search.input
|
||||
type: TextInput
|
||||
properties:
|
||||
title: Type to search products
|
||||
prefix: AiOutlineSearch
|
||||
events:
|
||||
onChange:
|
||||
- id: get_search # get search_products query for search.input
|
||||
type: Request
|
||||
params: search_products
|
||||
- id: apply_highlight # apply the highlight transformation to the request data.
|
||||
type: JsAction # TODO:
|
||||
params:
|
||||
name: highlightText
|
||||
args:
|
||||
- _request: search_products
|
||||
- id: set_state # set the response of the apply_highlight action to state
|
||||
type: SetState
|
||||
params:
|
||||
found_products:
|
||||
_actions: apply_highlight.response
|
||||
- id: product_results
|
||||
type: Html
|
||||
properties:
|
||||
html:
|
||||
_nunjucks:
|
||||
template: |
|
||||
<ul>
|
||||
{% for item in found_products %}
|
||||
<li>{{ item.title | safe }} - {{ item.description | safe}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
on:
|
||||
found_products:
|
||||
_state: found_products
|
||||
```
|
||||
NOTE: For this example to work, you will need a `products` collection in your MongoDB database, populated with `{title: '...', description: '...'}` data objects including the following search index on the `products` collection:
|
||||
```json
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic": true,
|
||||
"fields": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
##### Use Lowdefy SetState action:
|
||||
|
||||
```js
|
||||
// file: /public/theAnswer.js
|
||||
function theAnswer({actions}) {
|
||||
// Think for a while...
|
||||
return actions.SetState({ answer: 42 })
|
||||
}
|
||||
export default theAnswer;
|
||||
```
|
||||
|
||||
##### Use Lowdefy Request action to loop over a list of requests:
|
||||
```js
|
||||
// file: /public/loopRequests.js
|
||||
function loopRequests({ actions }, ...requestIds) {
|
||||
return Promise.all(requestIds.map((id) => actions.Request(id)));
|
||||
}
|
||||
export default loopRequests;
|
||||
```
|
||||
|
||||
```yaml
|
||||
id: call_all_requests
|
||||
type: Button
|
||||
events:
|
||||
onClick:
|
||||
- id: loop_requests
|
||||
type: JsAction # TODO:
|
||||
params:
|
||||
name: loopRequests
|
||||
args:
|
||||
- request_1
|
||||
- request_2
|
||||
- request_3
|
||||
```
|
@ -1,84 +0,0 @@
|
||||
# Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_ref:
|
||||
path: templates/actions.yaml.njk
|
||||
vars:
|
||||
pageId: NotificationAction
|
||||
pageTitle: Notification
|
||||
filePath: actions/Notification.yaml
|
||||
types: |
|
||||
```
|
||||
(params: {
|
||||
status?: enum,
|
||||
duration?: number,
|
||||
message?: string,
|
||||
description?: string,
|
||||
placement?: enum,
|
||||
bottom?: number,
|
||||
top?: number
|
||||
}): void
|
||||
```
|
||||
description: |
|
||||
The `Notification` action is used to display a notification message to a user.
|
||||
params: |
|
||||
###### object
|
||||
- `status: enum`: Message status type. Defaults to `success`. One of:
|
||||
- `success`
|
||||
- `error`
|
||||
- `info`
|
||||
- `warning`
|
||||
- `loading`.
|
||||
- `duration: number`: Time in seconds before the notification disappears. When set to 0 or null, it will never be closed automatically. The default is 5.
|
||||
- `message: string`: The title of notification. Default is "Success".
|
||||
- `description: sttring`: The content of the notification.
|
||||
- `placement: enum`: Position of the notification. Default is `bottomRight`. Can be one of:
|
||||
- `topLeft`
|
||||
- `topRight`
|
||||
- `bottomLeft`
|
||||
- `bottomRight`
|
||||
- `bottom: number`: Distance from the bottom of the viewport, when placement is `bottomRight`or `bottomLeft` in pixels. The default is 24.
|
||||
- `top: number`: Distance from the bottom of the viewport, when placement is `topRight`or `topLeft` in pixels. The default is 24.
|
||||
examples: |
|
||||
###### Display a success notification:
|
||||
```yaml
|
||||
- id: success
|
||||
type: Notification
|
||||
params:
|
||||
message: Hello
|
||||
```
|
||||
|
||||
###### Display an info notification with a description:
|
||||
```yaml
|
||||
- id: info
|
||||
type: Notification
|
||||
params:
|
||||
message: Something happened
|
||||
status: info
|
||||
description: This is a longer description of the thing that happened, so that you know why it happened.
|
||||
duration: 10
|
||||
placement: topRight
|
||||
```
|
||||
|
||||
###### Display an warning notification that does not disappear until closed:
|
||||
```yaml
|
||||
- id: warning
|
||||
type: Notification
|
||||
params:
|
||||
message: Something bad might happen.
|
||||
status: warning
|
||||
description: This is a longer description of the thing that happened, so that you know why it happened.
|
||||
duration: 0
|
||||
placement: topRight
|
||||
```
|
@ -18,7 +18,7 @@ _ref:
|
||||
block_type: ControlledList
|
||||
category: list
|
||||
schema: ../plugins/blocks/blocks-antd/src/blocks/ControlledList/schema.json
|
||||
filePath: blocks/ControlledList/ControlledList.yaml
|
||||
filePath: blocks/list/ControlledList.yaml
|
||||
description_content: |
|
||||
The ControlledList block renders a content area for all items in the array into the list card and provides easy UI elements to add or remove items in the list. All list blocks create a array in state at their block `id`. The list content areas are rendered for each index in the array. See the [List Concept](/lists) page for a detailed description on how to work with lists.
|
||||
areas:
|
||||
|
@ -24,56 +24,35 @@ _ref:
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
#### TLDR
|
||||
- All user interfaces in Lowdefy are assembled out of blocks.
|
||||
##### Block types
|
||||
- There a five block categories: `display`, `input`, `context`, `container` and `list`.
|
||||
- Operators re-evaluate on every [`state`](/context-and-state) update or as request calls complete. This allows blocks to _live update_.
|
||||
- Lowdefy has built in default block types, however this can be overwritten or extended with custom blocks by defining `types` on the Lowdefy config root.
|
||||
- `input` blocks maintain a value in `state` matching the block `id` key. _Dot notation_ applies to specify nested fields.
|
||||
##### Block validation
|
||||
- Field level input validation can be achieved by marking a `input` block as `required` or by specifying a list of `validate` tests.
|
||||
- Validation is invoked using the [`Validate`](/Validate) action.
|
||||
##### Block events
|
||||
- All blocks have`onMount` and `onMountAsync` events.
|
||||
- Each block implements it's own additional events such as `onClick` etc.
|
||||
##### Block loading
|
||||
- Some blocks gracefully handle a loading state while `onMount` events are being executed.
|
||||
- A block's default loading can be overwritten by defining custom `skeleton` settings on a block.
|
||||
|
||||
-------
|
||||
A Lowdefy page is compiled out of an arrangement of blocks. Every HTML element of this page is render as a result of a block placed and configured on the page. Blocks make it simple for Lowdefy developers to create apps since they only have to decide what block type to use, where in the layout the block should render, and what the block should do by defining the block's `properties`. How a block implements these `properties` is up to the specific block type selected.
|
||||
A Lowdefy page is compiled out of an arrangement of blocks. Every HTML element of this page is rendered as a result of a block placed and configured on the page. Blocks make it simple for Lowdefy developers to create apps since they only have to decide which block type to use, where in the layout the block should render, and what the block should do by defining the block's `properties`. How a block implements these `properties` is up to the specific block type selected.
|
||||
|
||||
Lowdefy offers a list of over 30 block types to cater for a wide range of use cases. All blocks are categorized according to their primary function:
|
||||
- `display` - Display page elements.
|
||||
- `input` - Modify a value in [`state`](/context-and-state).
|
||||
- `context` - Create a new [`context`](/context-and-state).
|
||||
- `container` - Render other blocks into [`content areas`](/layout).
|
||||
- `list` - Render `content areas` and blocks for each element in the data array.
|
||||
|
||||
When `state` updates or a requests call completes, the Lowdefy engine reevaluates all operators and rerenders blocks for which the operator evaluation is different from the previous render result. The result is _live updates_ to all blocks on a page. Operators can be used to build _live update_ logic into all block fields, except for the `id`, `type`, `areas`, `blocks` and `loading` fields.
|
||||
|
||||
# Block Schema
|
||||
When `state` updates or a requests call completes, the Lowdefy engine reevaluates all operators and rerenders blocks for which the operator evaluation is different from the previous render result. The result is _live updates_ to all blocks on a page. Operators can be used to build _live update_ logic into all block fields, except for the `id`, `type`, `areas`, `blocks` and `loading` fields.
|
||||
|
||||
The schema for a Lowdefy block is:
|
||||
|
||||
- `id: string`: __Required__ - A unique identifier for a block. For `Input` blocks the block `id` sets the field key which the block will modify in `state`. Field _dot-notation_ can be used to express fields which are nested in objects or arrays.
|
||||
- `type: string`: __Required__ - The is the block type identifier and defines what block to used. The block type used must either be a default block type or must defined in your app's `types` configuration.
|
||||
- `type: string`: __Required__ - The is the block type identifier and defines what block to used. The block type used must either be a default block type or must defined in your app's `plugins` configuration.
|
||||
- `properties: object`: All the settings passed to a block component. __Operators are evaluated__.
|
||||
- `areas: object`: Used to set the content areas and content layout settings for `container`, `context` and `list` blocks. See [layout](/layout) for more details on how to use `areas`.
|
||||
- `blocks: array`: A array of blocks to render to the default `content` area for `container`, `context` and `list` blocks. See [layout](/layout) for more details on how to use the `blocks` array.
|
||||
- `areas: object`: Used to set the content areas and content layout settings for `container` and `list` blocks. See [layout](/layout) for more details on how to use `areas`.
|
||||
- `blocks: array`: A array of blocks to render to the default `content` area for `container` and `list` blocks. See [layout](/layout) for more details on how to use the `blocks` array.
|
||||
- `events: object`: Used to defined [`actions`](/events-and-actions) that run when the block triggers an [`event`](/events-and-actions).
|
||||
- `layout: object`: Used to define the [layout](/layout) properties for a block. __Operators are evaluated__.
|
||||
- `skeleton: object`: Used to overwrite a block's default loading behavior by rendering a skeleton. Any block types from [`@lowdefy/blocks-basic`](https://www.npmjs.com/package/@lowdefy/blocks-basic) and [`@lowdefy/blocks-loaders`](https://www.npmjs.com/package/@lowdefy/blocks-loaders) can be used in the skeleton definition, including sub-blocks.
|
||||
- `loading: boolean`: When true, renders the block in loading. If a `skeleton` is defined, it will be rendered, else the block's default loading behavior will be rendered.
|
||||
- `required: boolean | string`: For `input` blocks, whether or not a value value is required in `state` when the [`Validate`](/Validate) action is called. Can be either a boolean or a string that is used as the validation error message . __Operators are evaluated__.
|
||||
- `required: boolean | string`: For `input` blocks, whether or not a value is required in `state` when the [`Validate`](/Validate) action is called. Can be either a boolean or a string that is used as the validation error message . __Operators are evaluated__.
|
||||
- `style: css object`: Used to apply css style settings to the block's top level `div` element. __Operators are evaluated__.
|
||||
- `validate: array`: A list of validation tests to pass when the [`Validate`](/Validate) action is called. __Operators are evaluated__.
|
||||
- `visible: boolean`: Controls whether or not to render a block. Operators are generally used here, and must evaluate to `false` to make the block invisible. Blocks with `visible: false` are excluded from `state`. __Operators are evaluated__.
|
||||
|
||||
# Block types
|
||||
## Block types
|
||||
|
||||
Lowdefy has list of default block types as defined in the Lowdefy docs. The default Lowdefy blocks aim to cover a very generic implementation of the [Ant Design](https://ant.design/components/overview/) react component library. To use all the default block types, you can simply use the block `type` key, like [`Button`](/Button), [`TextInput`](/TextInput), or [`Box`](/Box).
|
||||
Lowdefy has a list of default block types as defined in the Lowdefy docs. The default Lowdefy blocks aim to cover a very generic implementation of the [Ant Design](https://ant.design/components/overview/) react component library. To use all the default block types, you can simply use the block `type` key, such as [`Button`](/Button), [`TextInput`](/TextInput), or [`Box`](/Box).
|
||||
|
||||
###### Default block type config example:
|
||||
```yaml
|
||||
@ -88,36 +67,18 @@ _ref:
|
||||
# ... Button details
|
||||
```
|
||||
|
||||
However, the default types can overwritten or additional types can be define as required. For example, to set a `type` for a custom implementation of [AmCharts](https://www.amcharts.com/), we can do the following. We have created a custom [Lowdefy block for AmCharts v4](https://www.npmjs.com/package/@lowdefy/blocks-amcharts) that we can use.
|
||||
However, the default types can be overwritten or additional types can be defined as required. This is done by defining `plugins`.
|
||||
|
||||
###### Custom block type config example:
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
types:
|
||||
AmChartsXY:
|
||||
url: https://blocks-cdn.lowdefy.com/v3.10.1/blocks-amcharts/meta/AmChartsXY.json
|
||||
pages:
|
||||
- id: example_dashboard
|
||||
type: Box
|
||||
blocks:
|
||||
- id: basic_chart
|
||||
type: AmChartsXY
|
||||
properties:
|
||||
# ... AmCharts details
|
||||
```
|
||||
[TODO]: <> (# TODO: ADD PLUGIN EXAMPLE HERE)
|
||||
|
||||
More details on custom blocks can be found [here](/custom-blocks).
|
||||
|
||||
|
||||
# Input block validation
|
||||
## Input block validation
|
||||
|
||||
All `input` block types maintain a value in [`state`](/context-and-state). This value is set to the field name matching the block `id`. Nested fields can be created by using _dot notation_ in the `id` to specify the field path.
|
||||
|
||||
Client side field validation can be applied setting the `required` and / or `validate` block fields. The following schema applies to `required` and `validate`.
|
||||
Client side field validation can be applied setting the `required` and / or `validate` block fields. Field validation is first evaluated when the [`Validate`](/Validate) action is invoked on a page.
|
||||
|
||||
Field validation is first evaluated when the [`Validate`](/Validate) action is invoked on a page.
|
||||
##### required schema:
|
||||
|
||||
##### `required` schema:
|
||||
`required` can be a `boolean` or `string` type. When `required: true` the field label will indicate this with a red dot for user feedback, and a value will have to be supplied in to the field in order to pass validation. If `required` is set to a `string`, this string will be used as the feedback message when the validation fails.
|
||||
|
||||
```yaml
|
||||
@ -128,8 +89,9 @@ _ref:
|
||||
title: Name
|
||||
```
|
||||
|
||||
##### `validate` schema:
|
||||
The `validate` field takes a `array` of test `objects` to evaluate before passing the field validation. This list of tests are evaluated sequentially, so the test that fails first will be used as the feedback message to the user.
|
||||
##### validate schema:
|
||||
|
||||
The `validate` field takes an `array` of test `objects` to evaluate before passing the field validation. This list of tests are evaluated sequentially, so the test that fails first will be used as the feedback message to the user.
|
||||
|
||||
The schema for the validation test `objects`:
|
||||
- `pass: boolean`: __Required__ - The test that validates if this item passes or not. This is usually written as operators which evaluates to a `true` or `false`. __Operators are evaluated__.
|
||||
@ -155,19 +117,19 @@ _ref:
|
||||
title: Email
|
||||
```
|
||||
|
||||
# Block events
|
||||
## Block events
|
||||
|
||||
By default all blocks implements `onMount` and `onMountAsync` events. Both the `onMount` and `onMountAsync` events are triggered when the block is mounted. For the `onMount` event, the block only mounts when the event action chain is completed, however, for the `onMountAsync` event, the block will mount as soon as possible while the event actions completes execution.
|
||||
By default all blocks implement `onMount` and `onMountAsync` events. Both the `onMount` and `onMountAsync` events are triggered when the block is mounted. For the `onMount` event, the block only mounts when the event action chain is completed, however, for the `onMountAsync` event, the block will mount as soon as possible while the event actions complete execution.
|
||||
|
||||
Apart from the `onMount` and `onMountAsync` events, most blocks also implements their own block specific events such as `onOpen` for [Modal](/Modal) or `onClick` for [Button](/Button). See the events tab on each block's documentation for more details.
|
||||
Apart from the `onMount` and `onMountAsync` events, most blocks also implement their own block specific events such as `onOpen` for [Modal](/Modal) or `onClick` for [Button](/Button). See the events tab on each block's documentation for more details.
|
||||
|
||||
See [the events and actions page](/events-and-actions) for more details.
|
||||
|
||||
# Block loading
|
||||
## Block loading
|
||||
|
||||
Blocks will only start rendering when the `onInit` event has completed its actions. The `onMount` event on blocks will render blocks loading active. By default, some blocks will change behavior while it is in loading. For example, input blocks will be disabled during loading. The loading behavior of blocks can be controlled using the `loading` block property. Setting `loading` to `true` on a container and list block, will result in rendering all child blocks with loading active.
|
||||
Blocks will only start rendering when the `onInit` event has completed its actions. The `onMount` event on blocks will render blocks loading active. By default, some blocks will change behavior while it is in loading. For example, input blocks will be disabled during loading. The loading behavior of blocks can be controlled using the `loading` block property. Setting `loading` to `true` on a container or list block, will result in rendering all child blocks with loading active.
|
||||
|
||||
Often it is useful te render a skeleton of blocks instead of the blocks' default loading behavior. When block definitions are provided to the `skeleton` property on a block, this `skeleton` definition will be rendered when loading is active. Any block types from [`@lowdefy/blocks-basic`](https://www.npmjs.com/package/@lowdefy/blocks-basic) and [`@lowdefy/blocks-loaders`](https://www.npmjs.com/package/@lowdefy/blocks-loaders) can be used as the skeleton definition, including sub-blocks.
|
||||
Often it is useful to render a skeleton of blocks instead of the blocks' default loading behavior. When block definitions are provided to the `skeleton` property on a block, this `skeleton` definition will be rendered when loading is active. Any block types from [`@lowdefy/blocks-basic`](https://www.npmjs.com/package/@lowdefy/blocks-basic) and [`@lowdefy/blocks-loaders`](https://www.npmjs.com/package/@lowdefy/blocks-loaders) can be used as the skeleton definition, including sub-blocks.
|
||||
|
||||
##### Block `loading` and `skeleton` example:
|
||||
|
||||
@ -178,7 +140,7 @@ _ref:
|
||||
blocks:
|
||||
# ...
|
||||
- id: paragraph_one
|
||||
type: Title
|
||||
type: Paragraph
|
||||
loading:
|
||||
_eq:
|
||||
- _state: done
|
||||
@ -192,6 +154,23 @@ _ref:
|
||||
# ...
|
||||
```
|
||||
|
||||
## TLDR
|
||||
- All user interfaces in Lowdefy are assembled out of blocks.
|
||||
#### Block types
|
||||
- There are four block categories: `display`, `input`, `container` and `list`.
|
||||
- Operators re-evaluate on every [`state`](/context-and-state) update or as request calls complete. This allows blocks to _live update_.
|
||||
- Lowdefy has built in default block types, however this can be overwritten or extended with custom blocks by defining `plugins` on the Lowdefy config root.
|
||||
- `input` blocks maintain a value in `state` matching the block `id` key. _Dot notation_ applies to specify nested fields.
|
||||
#### Block validation
|
||||
- Field level input validation can be achieved by marking an `input` block as `required` or by specifying a list of `validate` tests.
|
||||
- Validation is invoked using the [`Validate`](/Validate) action.
|
||||
#### Block events
|
||||
- All blocks have`onMount` and `onMountAsync` events.
|
||||
- Each block implements it's own additional events such as `onClick` etc.
|
||||
#### Block loading
|
||||
- Some blocks gracefully handle a loading state while `onMount` events are being executed.
|
||||
- A block's default loading can be overwritten by defining custom `skeleton` settings on a block.
|
||||
|
||||
- _ref:
|
||||
path: templates/navigation_buttons.yaml
|
||||
vars:
|
||||
|
@ -24,6 +24,8 @@ _ref:
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
##### TODO: This page needs to be updated.
|
||||
|
||||
The Lowdefy CLI is used to develop a Lowdefy app locally, and to build Lowdefy apps for deployment.
|
||||
|
||||
We recommend running the CLI using `npx`, to always use the latest version:
|
||||
|
@ -24,31 +24,29 @@ _ref:
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
### TLDR
|
||||
- `connections` define links to other services, like connecting to a database. They are defined at the root of the lowdefy configuration.
|
||||
- `requests` use connections to make a call to the connected external services.
|
||||
- Use the [`_secret`](/_secret) operator to reference API keys or other secrets as required - do not code secrets into your config or commit secrets to your config source control.
|
||||
In a Lowdefy app you can integrate with other services like API's or databases using `connections` and `requests`. Connections configure the connection settings to the service, and often contain parameters like connection strings, urls and secrets like passwords or API keys. Requests are used to interact with the connection, such as inserting a data record, executing a query or calling an API end-point.
|
||||
|
||||
-----------
|
||||
In a Lowdefy app you can integrate with other services like API's or databases using `connections` and `requests`. Connections configure the connection settings to the service, and often contain parameters like connection strings, urls and secrets like passwords or API keys. Requests are used to interact with the connection, like inserting a data record, executing a query or calling a API end-point.
|
||||
|
||||
- id: alert2
|
||||
- id: secrets_alert
|
||||
type: Alert
|
||||
properties:
|
||||
type: warning
|
||||
showIcon: false
|
||||
message: Sensitive information like passwords or API keys are often required to use external services. The _secret operator should be used to reference these secrets, they should never be coded directly in your app, or committed to source control.
|
||||
message: Sensitive information like passwords or API keys are often required to use external services. The <a href = "./_secret">_secret</a> operator should be used to reference these secrets, they should never be coded directly in your app, or committed to source control.
|
||||
|
||||
- id: md2
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
# Connections
|
||||
To implement requests, the following steps are required:
|
||||
- define a connection.
|
||||
- define a request.
|
||||
- call the request using a [Request](/Request) action.
|
||||
- use returned data by making use of the [_request](/_request) operator.
|
||||
|
||||
## Connections
|
||||
|
||||
Connections are defined at the root of your Lowdefy configuration, in the `connections` array. Each connection must have an `id`, a `type`, and `properties` defining the connection. Operators in connection properties are evaluated every time a request is called.
|
||||
|
||||
# Connection Schema
|
||||
|
||||
The schema for a Lowdefy connection is:
|
||||
|
||||
- `id: string`: __Required__ - A unique identifier for the connection. This is used by requests to specify which connection to use.
|
||||
@ -73,18 +71,30 @@ _ref:
|
||||
|
||||
Our goal is to make connections for everything. As the Lowdefy community grows, we will continue to develop the most requested connections. If the connection you require is not supported yet, please head over to our [new connections voting board](https://github.com/lowdefy/lowdefy/discussions/309) to request and vote for new connections.
|
||||
|
||||
# Requests
|
||||
## Requests
|
||||
|
||||
Requests can be defined on any block, and the results of the request are available to any block in the same context. Requests must have an `id`, `type`, `connectionId` field specifying the connection to use, and `properties` defining the request settings. Requests can be called using the [`Request`](/Request) action. Operators in request properties are evaluated every time a request is called.
|
||||
Requests can be defined on any block, and the results of the request can be access using the `_request` operator anywhere on the same page. Requests must have an `id`, `type`, `connectionId` field specifying the connection to use, and `properties` defining the request settings. Requests can be called using the [`Request`](/Request) action.
|
||||
|
||||
# Request Schema
|
||||
The client operators to be used are defined in the `payload` field and are accessed by making use of the `_payload` operator in the `properties` field. These operators are evaluated on the client. Operators defined in `properties`, such as `_secret` and `_user`, are evaluated on the server. Operators in the request are evaluated every time a request is called.
|
||||
|
||||
- id: _users_alert
|
||||
type: Alert
|
||||
properties:
|
||||
type: warning
|
||||
showIcon: false
|
||||
message: The <code>_user</code> operator should be used under <code>properties</code> and not <code>payload</code>. This is important since operators under <code>payload</code> are evaluated on the client, and are therefore vulnerable to users with malicious intent.
|
||||
|
||||
- id: md3
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
The schema for a Lowdefy request is:
|
||||
|
||||
- `id: string`: __Required__ - A identifier for the request. It must be unique within the context the request is defined in.
|
||||
- `type: string`: __Required__ - The request type to be used. It must be a type supported by the connection type.
|
||||
- `payload: object`: The operators to be used inside of the request. __Operators are evaluated on the client__.
|
||||
- `connectionId: string`: __Required__ - The `id` of the connection that should be used.
|
||||
- `properties: object`: The settings passed to the request. __Operators are evaluated__.
|
||||
- `properties: object`: The settings passed to the request. Make use of `_payload` operator to use operators that were evaluated in `payload` mentioned above. __Operators are evaluated on the server__.
|
||||
|
||||
###### Requests definition example:
|
||||
```yaml
|
||||
@ -93,18 +103,85 @@ _ref:
|
||||
requests:
|
||||
- id: request1
|
||||
type: RequestType1
|
||||
connectionId: connectionId1
|
||||
connectionId: connectionId1 # NOTE: connection with id: connectionId1 must be defined
|
||||
payload:
|
||||
field:
|
||||
_state: field
|
||||
properties:
|
||||
# ...
|
||||
- id: request2
|
||||
type: RequestType2
|
||||
connectionId: connectionId2
|
||||
connectionId: connectionId2 # NOTE: connection with id: connectionId2 must be defined
|
||||
properties:
|
||||
# ...
|
||||
properties:
|
||||
# ...
|
||||
```
|
||||
|
||||
## Request Action
|
||||
|
||||
The `Request` action calls a request, or if used during an `onInit` event, calls those requests while a page loads. Read more about the `Request` action [here](/Request).
|
||||
|
||||
###### Call a single request:
|
||||
```yaml
|
||||
- id: call_one_request
|
||||
type: Request
|
||||
params: request1
|
||||
```
|
||||
|
||||
## _request operator
|
||||
|
||||
The `_request` operator returns the response value of a request. If the request has not yet been call, or is still executing, the returned value is `null`. Read more about the `_request` operator [here](/_request).
|
||||
|
||||
###### Using a request response:
|
||||
```yaml
|
||||
_request: my_request
|
||||
```
|
||||
|
||||
## General Example
|
||||
|
||||
###### lowdefy.yaml
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
|
||||
connections:
|
||||
- id: connection1
|
||||
type: ConnectionType1
|
||||
properties:
|
||||
# ...
|
||||
|
||||
pages:
|
||||
- id: page1
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
title: Page 1
|
||||
requests:
|
||||
- id: request1
|
||||
type: RequestType1
|
||||
connectionId: connection1
|
||||
properties:
|
||||
# ...
|
||||
events:
|
||||
onInit:
|
||||
- id: call_request
|
||||
type: Request
|
||||
params: request1
|
||||
blocks:
|
||||
- id: content_card
|
||||
type: Card
|
||||
blocks:
|
||||
- id: paragraph
|
||||
type: Paragraph
|
||||
properties:
|
||||
content:
|
||||
_request: request1
|
||||
```
|
||||
|
||||
### TLDR
|
||||
- `connections` define links to other services, like connecting to a database. They are defined at the root of the lowdefy configuration.
|
||||
- `requests` use connections to make a call to the connected external services.
|
||||
- Use the [`_secret`](/_secret) operator to reference API keys or other secrets as required - do not code secrets into your config or commit secrets to your config source control.
|
||||
|
||||
- _ref:
|
||||
path: templates/navigation_buttons.yaml
|
||||
vars:
|
||||
|
@ -24,6 +24,8 @@ _ref:
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
##### TODO: This page needs to be updated.
|
||||
|
||||
#### TLDR
|
||||
- The first block on a page must be a `context` category block.
|
||||
- A page can have multiple `context` blocks.
|
||||
|
@ -1,191 +0,0 @@
|
||||
# Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_ref:
|
||||
path: templates/general.yaml.njk
|
||||
vars:
|
||||
pageId: custom-blocks
|
||||
pageTitle: Custom Blocks
|
||||
section: Concepts
|
||||
filePath: concepts/custom-blocks.yaml
|
||||
content:
|
||||
- id: warning
|
||||
type: Alert
|
||||
properties:
|
||||
message: |
|
||||
SECURITY WARNING: Blocks execute JavaScript inside your Lowdefy app. Insecure code can expose your app or data. Make sure that you only load blocks from a trusted source.
|
||||
type: warning
|
||||
- id: md1
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
Blocks in Lowdefy are simple, most often state-less, [React components](https://reactjs.org/docs/components-and-props.html). Lowdefy uses [webpack module federation](https://webpack.js.org/concepts/module-federation/) to implement a micro front-end strategy. This means blocks are imported at load time, and not part of the Lowdefy app build.
|
||||
|
||||
The decoupling of blocks provides the considerable advantages:
|
||||
- Block developers can extend the UI capabilities of Lowdefy by building blocks for the community to utilize.
|
||||
- Lowdefy app developers can use community blocks to experiment and extend their apps.
|
||||
- Lowdefy blocks are simple, most often stateless React components, thus blocks can be developed quickly and can be used inside Lowdefy apps with ease.
|
||||
- The build process is simple and fast since you only build the code for your block, and not the entire application.
|
||||
- The Lowdefy engine takes care off the application state, the the block only has to concern itself with a easy application interface.
|
||||
|
||||
## Using Custom Blocks
|
||||
|
||||
To use a custom block type inside a Lowdefy app, configure the `types` object in the root of the Lowdefy config. For example to use a AmCharts block we can add a `AmChartsXY` type to the `types`.
|
||||
|
||||
```yaml
|
||||
name: dashboard-app
|
||||
lowdefy: 3.23.2
|
||||
types:
|
||||
AmChartsXY:
|
||||
url: https://blocks-cdn.lowdefy.com/v3.10.1/blocks-amcharts/meta/AmChartsXY.json
|
||||
# ...
|
||||
pages:
|
||||
- id: dashboard
|
||||
type: PageHeaderMenu
|
||||
blocks:
|
||||
- id: my_chart
|
||||
type: AmChartsXY
|
||||
properties:
|
||||
#...
|
||||
#...
|
||||
```
|
||||
|
||||
By default Lowdefy build apps with a set of pre-configured, default block types to make it easier to build apps, for example using [`Button`](/Button), [`TextInput`](/TextInput), [`Box`](/Box), etc. All the blocks documented in the Lowdefy docs are default types. We will continue to build out this list of default blocks to make it as easy as possible to build excellent feature rich apps.
|
||||
|
||||
It is possible to overwrite the default a block type by simply defining a url for the default type in the `types` object. This is especially useful when you need to use a older version of a block, or would like to do something unique.
|
||||
|
||||
#### Examples of Custom Blocks
|
||||
|
||||
##### AmCharts:
|
||||
|
||||
[AmCharts](https://www.amcharts.com/) enables you to render powerful javascript charts. We have created the [AmCharts Lowdefy blocks](https://github.com/lowdefy/blocks-amcharts) making it easy to use highly customizable charts in your apps.
|
||||
|
||||
##### Ag-Grid:
|
||||
|
||||
[Ag-Grid](https://www.ag-grid.com/) enables you to render feature rich tables. We have created the [AgGrid Lowdefy blocks](https://github.com/lowdefy/blocks-aggrid) making it easy to use advanced tables in your apps.
|
||||
|
||||
## Steps to develop a custom block
|
||||
|
||||
#### 1. Clone the blocks template repository
|
||||
|
||||
To develop a custom block, first clone the [Lowdefy blocks template repository](https://github.com/lowdefy/blocks-template). This template provides a project structure for building a custom block. This structure can be modified to your preferences with the following exceptions:
|
||||
- Keep the webpack configuration to ensure your custom block works with Lowdefy block module federation.
|
||||
- Blocks need meta data in the block schema format which Lowdefy uses to interpret how to render your block.
|
||||
|
||||
#### 2. Start your local block server
|
||||
|
||||
Once the repository is cloned, `yarn install` the block dependencies. Then start the local block server by running `yarn start`. The default is to start you block server on `http://localhost:3002`. Open `http://localhost:3002/meta/DisplayBlock.json` in your browser and confirm the the block meta data is served.
|
||||
|
||||
You can create multiple blocks in the same repository, or run multiple block servers from different block repositories. Use `yarn start --port {{ port_number }}` when you need to run multiple block servers.
|
||||
|
||||
#### 3. Configure your block types
|
||||
|
||||
In your `lowdefy.yaml` file, add your custom block type to the `types` object with the local path.
|
||||
|
||||
```yaml
|
||||
name: dashboard-app
|
||||
lowdefy: 3.23.2
|
||||
types:
|
||||
MyCustomBlock:
|
||||
url: http://localhost:3002/meta/MyCustomBlock.json
|
||||
# ...
|
||||
```
|
||||
|
||||
You can then test your block locally by running `npx lowdefy@latest dev` to develop your Lowdefy app together with your custom block.
|
||||
|
||||
#### 4. Code your Lowdefy block
|
||||
|
||||
A Lowdefy block consist of two files, your schema file and your React component. With Lowdefy we try to keep blocks stateless and let the Lowdefy engine mange application state.
|
||||
|
||||
For most applications this is fine and it simplifies the block logic, the result is "smaller" blocks and more flexibility to the Lowdefy app builder. It is up to the block developer to decide how to balance the trade off between configurability and complexity of the block. For example, it might be better for a UI elements like a Calender to be state-full and packaged as one piece, rather than to break the Calender up into various smaller blocks, that Lowdefy app developers need to piece together. With that said, it is worth mentioning that every time the block properties changes, Lowdefy will rerender the entire block, this can have a performance impact when blocks become large and complex.
|
||||
|
||||
### Block schema definition
|
||||
|
||||
- `category: enum`: How this block should be rendered in the Lowdefy app. Can be either `display`, `input`, `container`, `context` or `list`.
|
||||
- `valueType: enum`: For blocks of the `input` block category, Lowdefy enforces a value type in `state`. This can be either a `boolean`, `number`, `string`, `object` or `array`. Lowdefy provides a default value for the block. This is usually `null`, but is `false` for boolean blocks, and the empty array, `[]`, for array blocks.
|
||||
- `schema: object`: Provide a valid [JSON-Schema](https://json-schema.org/) definition for the block `properties` and `events`.
|
||||
# TODO: add icon.
|
||||
|
||||
### Block React Component Props
|
||||
|
||||
The React component will receive the following props:
|
||||
|
||||
- `basePath: string`: The base path setting for the application. This variable is used to prefix route paths for example `${basePath}/logo-square-light-theme.png`. The default base path is ''.
|
||||
- `blockId: string`: The block's id within the Lowdefy app, this is useful for setting a unique `id` on DOM elements.
|
||||
- `components: object`: Helper React components that are exposed to blocks to use internally.
|
||||
- `Icon`: component`: Lowdefy standard Icon React component to render build in icons.
|
||||
- `Link`: component`: Lowdefy standard Link React component used as links to pages or external urls. The following props apply:
|
||||
- `ariaLabel: string`: Arial-label to apply to link tag.
|
||||
- `back: boolean`: When the link is clicked, trigger the browser back.
|
||||
- `home: boolean`: When the link is clicked, route to the home page.
|
||||
- `input: object`: When the link is clicked, pass data as the input object to the next Lowdefy page. Can only be used with pageId link and newTab false. See [Input]( TODO: Link to input page? ).
|
||||
- `newTab: boolean`: When the link is clicked, open the page in a new browser tab.
|
||||
- `pageId: string`: When the link is clicked, route to the provided Lowdefy page.
|
||||
- `rel: string`: The relationship of the linked URL as space-separated link types.
|
||||
- `replace: boolean`: Prevent adding a new entry into browser history by replacing the url instead of pushing into history. Can only be used with pageId link and newTab false.
|
||||
- `scroll: boolean`: Disable scrolling to the top of the page after page transition. Can only be used with pageId link and newTab false.
|
||||
- `url: string`: When the link is clicked, route to an external url.
|
||||
- `urlQuery: object`: When the link is clicked, pass data as a url query to the next page. See [url query]( TODO: Link to url query page? ).
|
||||
- `content: object`: Passed to `container` and `context` block categories. The `content` object with methods to render sub blocks into content areas. The method name is the same as the area key, for example, 'content.content()` renders a blocks default `content` area.
|
||||
- `events: object`: All events defined on the block in the Lowdefy app config.
|
||||
- `[event_key]: object`: Event keys gives a handle name to the event details.
|
||||
- `loading: boolean`: True while the list of actions are being executed.
|
||||
- `actions: actionObjects[]`: The list of [Lowdefy action objects](https://docs.lowdefy.com/events-and-actions) which will be evaluated by the Lowdefy engine.
|
||||
- `history: object[]`: A list of objects logging the event calls and responses.
|
||||
- `blockId: string`: The block id from which the event was called.
|
||||
- `endTimestamp: datetime`: Timestamp for when the event was completed.
|
||||
- `event: object`: The event object passed to the event.
|
||||
- `eventName: string`: The event name which which triggerEvent was called.
|
||||
- `success: boolean`: True if all actions for the event executed without throwing any errors.
|
||||
- `startTimestamp: datetime`: Timestamp for when the event was started.
|
||||
- `responses: object`: The list of action responses, where the object key is equal to the action id.
|
||||
- `{{ key }}: string`:
|
||||
- `type: string`: The type of action called.
|
||||
- `error: Error`: If the action throw an error.
|
||||
- `index: number`: Index of the action in the event array.
|
||||
- `response: any`: The returned result of the action.
|
||||
- `skipped: boolean`: True if the action was skipped.
|
||||
- `loading: boolean`: True while loading is activated for the block.
|
||||
- `methods: object`: All application methods built into Lowdefy, available for the block.
|
||||
- `makeCssClass(cssObject | cssObject[]): string`: This methods creates a css class for the block to apply to DOM elements. Css classes are created using [Emotion](https://emotion.sh/docs/introduction). If a list of cssObject are given the cssObjects are shallow merged with the preceding objects properties being overwritten by the latter. Any valid css style object can be passed, including media queries. Default media queries are built in:
|
||||
- `xs?: object`: Css object applied for screen media with max width of 576px.
|
||||
- `sm?: object`: Css object applied for screen media with min width of 576px.
|
||||
- `md?: object`: Css object applied for screen media with min width of 768px.
|
||||
- `lg?: object`: Css object applied for screen media with min width of 992px.
|
||||
- `xl?: object`: Css object applied for screen media with min width of 1200px.
|
||||
- `xxl?: object`: Css object applied for screen media with min width of 1600px.
|
||||
- `registerEvent(event: { name: string, actions: actionObjects[] })`: This method can be used to register internal actions for the block to trigger, and overwrites the user config if user defined actions are provided for the same event name.
|
||||
- `registerMethod(methodName: string, fn(any))`: This method allows the block developed to expose a method to the Lowdefy app developer via the [`CallMethod`](https://docs.lowdefy.com/CallMethod) action. When the method name for the block id is triggered via a `CallMethod` action, `fn` is evaluated.
|
||||
- `triggerEvent({name: string, event?: any })`: This methods triggers a event when called, like `onClick` for when a button is clicked. Optionally, event data can be passed which will be available inside the event actions through the [`_event`](https://docs.lowdefy.com/_event) operator.
|
||||
- `properties: object`: The properties object provides all the block settings defined in the Lowdefy config, operators can be used when defining block properties and evaluated operators are passed to the block. When the evaluated result of these properties change, the block rerenders to display the updated block.
|
||||
- `required: boolean`: For blocks of the `input` category, whether or not a input value is required. Required can be defined by operators and the evaluated result is passed to the block. The [`Validate`](https://docs.lowdefy.com/Validate) action will check if the required values are present else raise `validation` errors and suspend further block actions in the event queue.
|
||||
- `validation: object`: For blocks of the `input` category, the validation property provides result of `Validate` relevant relevant to the specific block. See [block validation](/blocks) for more details.
|
||||
- `status: enum`: The validation status result. Can be `error`, `success` or `warning`. Only validation which results in an `error` status will suspend further block actions in the event queue.
|
||||
- `errors: string[]`: The list of error messaged raised whiled block validation was evaluated, for this block.
|
||||
- `warnings: string[]`: The list of warnings messaged raised whiled block validation was evaluated, for this block.
|
||||
|
||||
## Deploying Custom Blocks
|
||||
|
||||
Both the block metadata and block React component need to be built by webpack and hosted on a publicly accessible static file server. Any Lowdefy app can then load and use the block. You also need to set the `remoteEntryUrl` in `webpack.prod.js` in order to build the correct block meta data, make sure the URL is pointing to where your block is hosted.
|
||||
|
||||
The easiest way to host your custom block is the deploy the custom block to [npm](https://www.npmjs.com/) and [Unpkg](https://unpkg.com/) will automatically host your block for you on their CDN. Although this option is easy, the cache settings for Unpkg can result in longer load times in some cases which can result in a unreliable user experience. It is thus best to deploy you blocks to your own static file servers.
|
||||
|
||||
We are working on a Lowdefy blocks CDN to improve this developer experience in the future.
|
||||
- _ref:
|
||||
path: templates/navigation_buttons.yaml
|
||||
vars:
|
||||
previous_page_title: Custom Code
|
||||
previous_page_id: custom-code
|
||||
next_page_title: User authentication
|
||||
next_page_id: users-introduction
|
@ -29,11 +29,12 @@ _ref:
|
||||
- id: md1
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
# TODO: Remove JsAction reference.
|
||||
content: |
|
||||
##### TODO: This page needs to be updated.
|
||||
|
||||
Lowdefy runs as a single page web app (SPA). It is possible to extend the functionality of a Lowdefy app by loading custom code (HTML, CSS and JavaScript) into the HTML `head` and `body` to of the default `index.html` page.
|
||||
|
||||
The content loaded into the `head` and `body` tag can be any valid HTML, most often `script` tags are loaded to register a new [`JsAction`](/JsAction) or [`_js`](/_js) operator. However, third party code can also be imported, for example Google Analytics, Intercom, etc. Be sure to only load trusted code into your app, as this code will be able to execute JavaScript on all pages of your Lowdefy app, which could expose you app or data to security vulnerabilities. Your own code can easily be hosted from the [Lowdefy public folder](/hosting-files).
|
||||
The content loaded into the `head` and `body` tag can be any valid HTML. Third party code can be imported, for example Google Analytics, Intercom, etc. Be sure to only load trusted code into your app, as this code will be able to execute JavaScript on all pages of your Lowdefy app, which could expose you app or data to security vulnerabilities. Your own code can easily be hosted from the [Lowdefy public folder](/hosting-files).
|
||||
|
||||
> __Warning__: Lowdefy implements the [Ant design](https://ant.design/) UI component framework for app layout and most blocks, thus the default Ant Design CSS is loaded for all Lowdefy apps. Take caution not to unintentionally overwrite existing style settings and classes which can result in a degraded user experience.
|
||||
|
||||
@ -72,126 +73,8 @@ _ref:
|
||||
<!-- End Google Analytics -->
|
||||
# ...
|
||||
```
|
||||
|
||||
###### Load, register and trigger a custom `JsAction` from code in the app `public` folder:
|
||||
|
||||
This example fetches a list of Todos from [{JSON}placeholder](https://jsonplaceholder.typicode.com/), and updates [state](/context-and-state).
|
||||
|
||||
1) First, add the JavaScript code to the `public` folder and resister the `JsAction`:
|
||||
```js
|
||||
// /public/fetchTodos.js
|
||||
function async fetchTodos(context, numItems, skip) {
|
||||
const data = await fetch('https://jsonplaceholder.typicode.com/todos');
|
||||
const todos = await data.json();
|
||||
return todos.slice(skip, skip + numItems);
|
||||
}
|
||||
// Register the JsAction for the Lowdefy app to use.
|
||||
window.lowdefy.registerJsAction('fetchTodos', fetchTodos);
|
||||
```
|
||||
|
||||
2) Import the JavaScript as a module into the page:
|
||||
```html
|
||||
<!-- /header_modules.html -->
|
||||
<script type="module" src="/public/fetchTodos.js"></script>
|
||||
```
|
||||
|
||||
3) Set load the custom code into the app header and trigger the action on page load:
|
||||
```yaml
|
||||
# /lowdefy.yaml
|
||||
name: json-todos
|
||||
lowdefy: 3.23.2
|
||||
app:
|
||||
html:
|
||||
appendHead:
|
||||
_ref: header_modules.html # Load the custom HTML into the header.
|
||||
pages:
|
||||
- id: todos
|
||||
type: PageHeaderMenu
|
||||
events:
|
||||
onInit:
|
||||
- id: get_todos
|
||||
type: JsAction # TODO:
|
||||
params:
|
||||
name: fetchTodos # Trigger the custom JavaScript action.
|
||||
args:
|
||||
- 10 # numItems
|
||||
- 0 # skip
|
||||
- id: set_todos
|
||||
type: SetState
|
||||
params:
|
||||
todos:
|
||||
# Set the response of the get_todos action to state.
|
||||
_actions: get_todos.response
|
||||
# ...
|
||||
```
|
||||
|
||||
## Loading and registering a [`_js`](/_js) operator
|
||||
|
||||
Similar to the loading custom JavaScript actions, custom JavaScript operators can also be loaded. In order for the Lowdefy app engine to execute a custom JavaScript [operator](/operators), the JavaScript code for the operator must be loaded onto the page and registered using the `registerJsOperator` method available on the browser [`window`](https://developer.mozilla.org/en-US/docs/Web/API/window) object by calling `window.lowdefy.registerJsOperator(name: string, action: function)`.
|
||||
|
||||
All `_js` functions must be synchronous.
|
||||
|
||||
#### Examples
|
||||
|
||||
###### Load, register and use a custom `_js` operator from code in the app `public` folder:
|
||||
|
||||
This example uses a `_js` operator to remove all duplicates from a list of names.
|
||||
|
||||
1) First, add the JavaScript code to the `public` folder and resister the `_js` operator:
|
||||
```js
|
||||
// /public/foo_operators.js
|
||||
function removeDuplicates(items) {
|
||||
return [ ...new Set(items) ];
|
||||
}
|
||||
// Register the removeDuplicates function as a _js.deduplicate operator.
|
||||
window.lowdefy.registerJsOperator('deduplicate', removeDuplicates);
|
||||
```
|
||||
|
||||
2) Import the JavaScript as a module into the page:
|
||||
```html
|
||||
<!-- /header.html -->
|
||||
<script type="module" src="/public/foo_operators.js"></script>
|
||||
```
|
||||
|
||||
3) Set load the custom code into the app header and use the new operator on the page:
|
||||
```yaml
|
||||
# /lowdefy.yaml
|
||||
name: operator-example
|
||||
lowdefy: 3.23.2
|
||||
app:
|
||||
html:
|
||||
appendHead:
|
||||
_ref: header.html # Load the custom HTML into the header.
|
||||
pages:
|
||||
- id: some_names
|
||||
type: PageHeaderMenu
|
||||
blocks:
|
||||
- id: names
|
||||
type: ButtonSelector
|
||||
properties:
|
||||
title: Select your new friend
|
||||
options:
|
||||
# use the removeDuplicates function and pass a list of names as a function argument
|
||||
_js.deduplicate:
|
||||
- - Anne
|
||||
- Sam
|
||||
- Joe
|
||||
- Micheal
|
||||
- Sam
|
||||
- Steven
|
||||
- Anne
|
||||
- Pepper
|
||||
# ...
|
||||
```
|
||||
|
||||
------
|
||||
|
||||
Custom code provides an easy way to extent the logic functionality of Lowdefy apps. However, to extend the UI capabilities beyond the existing features provided by the default Lowdefy blocks, custom blocks can be loaded onto apps.
|
||||
|
||||
- _ref:
|
||||
path: templates/navigation_buttons.yaml
|
||||
vars:
|
||||
previous_page_title: Lists
|
||||
previous_page_id: lists
|
||||
next_page_title: Custom Blocks
|
||||
next_page_id: custom-blocks
|
||||
|
@ -24,41 +24,25 @@ _ref:
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
### TLDR
|
||||
- Events are triggered when something happens on a page, like clicking a button or loading a page.
|
||||
- A list of actions are executed sequentially by a triggered event.
|
||||
- If an action errors, the actions that follow are skipped.
|
||||
- Actions that are `async: true` will not executed sequentially nor stop the event if they error.
|
||||
- Action errors can be handled by providing a list of `try` and `catch` actions to the event.
|
||||
- Operators used in action `params` are evaluated right before the action is executed.
|
||||
- The [`_actions`](/_actions)) operator is available for sequential actions to use the values returned from preceding actions in the chain.
|
||||
- Actions have a `skip` field that can be used to skip action execution.
|
||||
- The `onInit` event is triggered the first time a context is mounted and keeps the page in loading until all actions have finished.
|
||||
- The `onInitAsync` event is triggered the first time a context is mounted and does not keep the page in loading.
|
||||
- The `onMount` events is triggered the every time a block is mounted and keeps the block in loading until all actions have finished.
|
||||
- The `onMountAsync` event is triggered the every time a block is mounted, after `onMount` has completed, and does not keep the block in loading.
|
||||
|
||||
-----------
|
||||
|
||||
Blocks can define _events_ which the block can trigger when something happens on the page, like a button being clicked, an input's value being modified or a page being loaded. Some examples are `onClick` on a [`Button`](/Button) or `onMount` on a [`PageHeaderMenu`](/PageHeaderMenu) block.
|
||||
|
||||
All blocks implements `onMount` and `onMountAsync` events. These are useful for triggering actions when a block is mounted. For the `onMount` event, the block only mounts when the event action chain is completed, however, for the `onMountAsync` event, the block will mount as soon as possible while the event actions completes execution.
|
||||
|
||||
_Actions_ are tasks that can be executed, like calling a request, linking to a new page or changing a value in state. An array of actions can be defined for a event on a block. If that event gets triggered, those actions will execute sequentially. If any actions error while executing, the actions that follow it won't be executed, however, `catch` actions chain can be defined on a event to trigger when an error in a chain of actions occurs.
|
||||
_Actions_ are tasks that can be executed, like calling a request, linking to a new page or changing a value in state. An array of actions can be defined for an event on a block. If that event gets triggered, those actions will execute sequentially. If any actions error while executing, the actions that follow it won't be executed, however, `catch` actions chain can be defined on an event to trigger when an error in a chain of actions occurs.
|
||||
|
||||
Actions which are `async: true` are an exception to the sequential rule of the actions chain. These actions will be executed asynchronously and the next actions in the chain will not wait for them to finish. If any `async: true` action throws an error, the chain will not be stopped and the event will still be completed successfully.
|
||||
|
||||
Each action has an `id`, unique to that action chain, and a `type` field which are required.
|
||||
|
||||
Actions can have a `params` field for specifying input parameters when executing the action. Operators used in action `params` will be evaluated right before the action is executed. Some events might have data relating to that event, like what the new value of an input is, or the row that was clicked in a table. The `event` object can be used in the action using the [`_event`](/_event) operator. Some actions also return values which can be passed to preceding actions in the same action chain using the [`_actions`](/_actions) operator.
|
||||
Actions can have a `params` field for specifying input parameters when executing the action. Operators used in action `params` will be evaluated right before the action is executed. Some events might have data relating to that event, such as what the new value of an input is, or the row that was clicked in a table. The `event` object can be used in the action using the [`_event`](/_event) operator. Some actions also return values which can be passed to preceding actions in the same action chain using the [`_actions`](/_actions) operator.
|
||||
|
||||
Actions can also have a `skip` field. Operators in the `skip` field will be evaluated before an action is executed, and if the evaluated result is `true`, that action is skipped and the next action is executed.
|
||||
|
||||
# Action Schema
|
||||
## Action Schema
|
||||
|
||||
The schema for a Lowdefy action is:
|
||||
|
||||
- `id: string`: __Required__ - A identifier for the action. It must be unique within the action chain it is defined in.
|
||||
- `id: string`: __Required__ - An identifier for the action. It must be unique within the action chain it is defined in.
|
||||
- `type: string`: __Required__ - The action type to be used. It must be a valid action type.
|
||||
- `skip: boolean`: The test that determines whether the action will be skipped or not. This is usually written as operators which evaluates to a `true` or `false`. __Operators are evaluated__.
|
||||
- `async: boolean`: This determines whether the action will be evaluated asynchronously. Operators are __not__ evaluated on `async`.
|
||||
@ -90,13 +74,13 @@ _ref:
|
||||
params:
|
||||
# ...
|
||||
```
|
||||
# The actions object
|
||||
## The actions object
|
||||
|
||||
When events are triggered, each completed action writes its response to the actions object under the action id object key. Thus all following actions in a event action list have access to the responses of all preceding actions in the same event list through the [`_actions`](/_actions) operator.
|
||||
|
||||
# The event object
|
||||
## The event object
|
||||
|
||||
When events are triggered, the can provide a data object describing the event (e.g. a description of the clicked item or uploaded file). This data object can be accessed using the [`_event`](/_event) operator in an action definition.
|
||||
When events are triggered, they can provide a data object describing the event (e.g. a description of the clicked item or uploaded file). This data object can be accessed using the [`_event`](/_event) operator in an action definition.
|
||||
|
||||
The schema for passing actions to Lowdefy events is:
|
||||
```
|
||||
@ -111,7 +95,7 @@ _ref:
|
||||
})
|
||||
```
|
||||
|
||||
# Catching action errors
|
||||
## Catching action errors
|
||||
|
||||
If one action in the chain of event actions fails by throwing an error, the actions in the list following the failed action will not be executed. To handle any errors thrown by an action, Lowdefy event actions can be provided as lists of `try` and `catch` actions.
|
||||
|
||||
@ -137,7 +121,7 @@ _ref:
|
||||
# ...
|
||||
```
|
||||
|
||||
# Debouncing events
|
||||
## Debouncing events
|
||||
|
||||
Event debouncing can be turned on by setting the `debounce` field on event objects. If `debounce.immediate` is `true`, leading edge debouncing or throttling will apply, else it will be debounced as trailing edge.
|
||||
|
||||
@ -182,7 +166,7 @@ _ref:
|
||||
type: ActionType2
|
||||
```
|
||||
|
||||
# Page initialization events
|
||||
## Page initialization events
|
||||
|
||||
The first blocks on a page, usually a [`container`](/container) type block, can define `onInit` and `onInitAsync` events. All blocks have `onMount` and `onMountAsync` events, that can be used to initialize the page or blocks.
|
||||
|
||||
@ -194,7 +178,7 @@ _ref:
|
||||
|
||||
The `onMountAsync` event is triggered every time a block is mounted, but does not render the block in loading.
|
||||
|
||||
# Action types
|
||||
## Action types
|
||||
|
||||
The following actions can be used:
|
||||
|
||||
@ -211,6 +195,21 @@ _ref:
|
||||
- [`Validate`](/Validate) - Validate the inputs on the page.
|
||||
|
||||
See additional action type available under the Actions tab in the menu.
|
||||
|
||||
## TLDR
|
||||
- Events are triggered when something happens on a page, like clicking a button or loading a page.
|
||||
- A list of actions are executed sequentially by a triggered event.
|
||||
- If an action errors, the actions that follow are skipped.
|
||||
- Actions that are `async: true` will not be executed sequentially nor stop the event if they error.
|
||||
- Action errors can be handled by providing a list of `try` and `catch` actions to the event.
|
||||
- Operators used in action `params` are evaluated right before the action is executed.
|
||||
- The [`_actions`](/_actions) operator is available for sequential actions to use the values returned from preceding actions in the chain.
|
||||
- Actions have a `skip` field that can be used to skip action execution.
|
||||
- The `onInit` event is triggered the first time a context is mounted and keeps the page in loading until all actions have finished.
|
||||
- The `onInitAsync` event is triggered the first time a context is mounted and does not keep the page in loading.
|
||||
- The `onMount` events is triggered the every time a block is mounted and keeps the block in loading until all actions have finished.
|
||||
- The `onMountAsync` event is triggered the every time a block is mounted, after `onMount` has completed, and does not keep the block in loading.
|
||||
|
||||
- _ref:
|
||||
path: templates/navigation_buttons.yaml
|
||||
vars:
|
||||
|
@ -24,204 +24,262 @@ _ref:
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
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.
|
||||
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 describe different parts of the app.
|
||||
|
||||
- id: yaml_understanding_alert
|
||||
type: Alert
|
||||
properties:
|
||||
type: warning
|
||||
showIcon: false
|
||||
message: |
|
||||
A good understanding of YAML is needed before starting with Lowdefy. If you don't have any experience using YAML, you can find a good introduction video <a href = "https://www.youtube.com/watch?v=cdLNKUoMc6c">here</a>.
|
||||
|
||||
- id: md2
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
The root schema for a Lowdefy app is:
|
||||
- `lowdefy: string`: __Required__ - The Lowdefy version number the app uses. This is required and cannot be a reference to another file.
|
||||
- `lowdefy: string`: __Required__ - The Lowdefy version number that the app uses. This is required and cannot be a reference to another file.
|
||||
- `name: string`: A name for the application.
|
||||
- `license: string`: A [SPDX license ID](https://spdx.org/licenses/). You can use this to indicate the project's license if you are licencing your project under a specific software license. 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.
|
||||
- `version: string`: The version number of the app that you are building. This is optional and allows you indicate the version of your app.
|
||||
- `license: string`: A [SPDX license ID](https://spdx.org/licenses/). You can use this to indicate the project's license if you are licensing your project under a specific software license. 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.
|
||||
- `cli: object`: An object with configuration for the CLI.
|
||||
- `config: object`: An object with app configuration like the home page pageId.
|
||||
- `auth: object` An object with auth configuration such as providers and an adapter.
|
||||
- `global: object`: A data object that can be accessed anywhere in the app using the [`_global`](/_global) operator.
|
||||
- `connections: object[]`: An array of [`connection`](/connections-and-requests) objects.
|
||||
- `types: object`: An object to customize and add block types.
|
||||
- `plugins: object[]`: An array of `plugin` objects to customize and add block types.
|
||||
- `menus: object[]`: An array of menu objects.
|
||||
- `pages: object[]`: An array of page objects.
|
||||
|
||||
# Config
|
||||
Pages are made up of blocks. Blocks have the following basic schema:
|
||||
- `id: string`: __Required__ - A unique identifier for a block.
|
||||
- `type: string`: __Required__ - This is the block type identifier and defines what block to used.
|
||||
- `properties: object`: All the settings passed to a block component.
|
||||
- `blocks: array`: An array of blocks to render within this block.
|
||||
|
||||
Find the more detailed block schema [here](/blocks).
|
||||
|
||||
- id: yaml_json_files_alert
|
||||
type: Alert
|
||||
properties:
|
||||
type: info
|
||||
showIcon: false
|
||||
message: |
|
||||
<h3> YAML file extensions </h3>
|
||||
<p> Both files with the <code>.yaml</code> and <code>.yml</code> file extensions are supported as YAML files. </p>
|
||||
<h3> JSON instead of YAML </h3>
|
||||
<p> Since you can reference JSON files, you can build your app using JSON instead of YAML files. The <code>lowdefy.yaml</code> 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. </p>
|
||||
|
||||
- id: md3
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
## Config
|
||||
|
||||
The config object has the following properties:
|
||||
|
||||
- `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 "/".
|
||||
- `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`.
|
||||
|
||||
- id: alert1
|
||||
type: Alert
|
||||
properties:
|
||||
type: warning
|
||||
showIcon: false
|
||||
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.
|
||||
## Auth
|
||||
|
||||
- id: md2
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
# Global
|
||||
[TODO]: <> (# TODO: Add auth things here)
|
||||
|
||||
## Global
|
||||
|
||||
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.
|
||||
|
||||
The global object can also be modified using the [`SetGlobal`](/SetGlobal) action.
|
||||
|
||||
# Menus
|
||||
## Connections
|
||||
|
||||
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.
|
||||
In a Lowdefy app you can integrate with other services like API's or databases using `connections` and `requests`. Connections configure the connection settings to the service, and often contain parameters like connection strings, urls and secrets such as passwords or API keys. Requests are used to interact with the connection, for example inserting a data record, executing a query or calling a API end-point.
|
||||
|
||||
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.
|
||||
See more about how `connections` and `requests` are used together [here](/connections-and-requests).
|
||||
|
||||
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.
|
||||
## Plugins
|
||||
|
||||
If OpenID Connect authentication and role based authentication is configured, pages that the user is restricted from seeing are filtered from the menu object.
|
||||
[TODO]: <> (# TODO: Add plugins things here)
|
||||
|
||||
The schema for a menu object is:
|
||||
## Menus
|
||||
|
||||
- `id: string`: __Required__ - A identifier for the menu. If it is `default`, it will be used as default by pages.
|
||||
- `links: object[]`: An array of `MenuLink` or `MenuGroup` objects that form the links in the menu. `MenuGroups` can be two levels deep.
|
||||
Menu objects are objects with links to pages. They are filtered to only show pages that the user is authorized to see and are used by blocks such as `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.
|
||||
|
||||
The schema for a `MenuLink` is:
|
||||
- `id: string`: __Required__ - A identifier for the link unique to the menu.
|
||||
- `type: string`: __Required__ - The type should be `MenuLink`.
|
||||
- `pageId: string`: The id of the page to link to. Used as the title if no title is provided.
|
||||
- `url: string`: An external url to link to.
|
||||
- `properties: object`: The properties of the menu link. These are:
|
||||
- `title: string`: The title to display for the link.
|
||||
- `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).
|
||||
See more about how menu objects are used and defined [here](/menus).
|
||||
|
||||
The schema for a `MenuGroup` is:
|
||||
- `id: string`: __Required__ - A identifier for the group unique to the menu.
|
||||
- `type: string`: __Required__ - The type should be `MenuGroup`.
|
||||
- `properties: object`: The properties of the menu group. These are:
|
||||
- `title: string`: The title to display for the group.
|
||||
- `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).
|
||||
- `links: object[]`: An array of `MenuLink` or `MenuGroup` objects that are should be grouped together in the group.
|
||||
|
||||
###### Menus example:
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
menus:
|
||||
- id: default
|
||||
links:
|
||||
- id: page1
|
||||
type: MenuLink
|
||||
pageId: page1
|
||||
properties:
|
||||
title: Page 1
|
||||
icon: AiOutlineFile
|
||||
- id: top-group
|
||||
properties:
|
||||
title: Group
|
||||
icon: AiOutlineGroup
|
||||
links:
|
||||
- id: page2
|
||||
type: MenuLink
|
||||
pageId: page2 # pageId will be used as link title
|
||||
- id: external
|
||||
type: MenuLink
|
||||
url: https://external.com
|
||||
properties:
|
||||
title: External site
|
||||
- id: nested-group
|
||||
type: MenuGroup
|
||||
properties:
|
||||
title: Nested Group
|
||||
links:
|
||||
- id: page3
|
||||
type: MenuLink
|
||||
pageId: page3
|
||||
properties:
|
||||
title: Page 3
|
||||
- id: page-1-and-3
|
||||
links:
|
||||
- id: page1
|
||||
type: MenuLink
|
||||
pageId: page1
|
||||
properties:
|
||||
title: Page 1
|
||||
icon: AiOutlineFile
|
||||
- id: page3
|
||||
type: MenuLink
|
||||
pageId: page3
|
||||
properties:
|
||||
title: Page 3
|
||||
icon: AiOutlineControl
|
||||
```
|
||||
|
||||
# Pages
|
||||
## Pages
|
||||
|
||||
Pages in a Lowdefy app are actually just blocks, the building blocks of a Lowdefy app, with a few extra restrictions and features.
|
||||
|
||||
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`.
|
||||
|
||||
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.
|
||||
[TODO]: <> (# TODO: Below will change once we add the head configuration option on pages. Discuss that here.)
|
||||
|
||||
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).
|
||||
|
||||
# References and templates
|
||||
|
||||
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.
|
||||
|
||||
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:
|
||||
Let's have a look at how to define a page and it's blocks. We can start with a simple page a card block on it. We can add a title block and a paragraph block to our card so that it won't be so empty.
|
||||
|
||||
###### lowdefy.yaml
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
|
||||
pages:
|
||||
_ref: pages/page1.yaml # Path to the referenced file. Always from the root of the project.
|
||||
_ref: pages/page1.yaml
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
###### pages/page1.yaml
|
||||
```yaml
|
||||
_ref:
|
||||
path: templates/text_page.yaml
|
||||
vars:
|
||||
id: page1
|
||||
title: Page 1
|
||||
content: |
|
||||
Page content text.
|
||||
```
|
||||
|
||||
###### templates/text_page.yaml
|
||||
```yaml
|
||||
id:
|
||||
_var: id
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
title:
|
||||
_var: title
|
||||
blocks:
|
||||
- id: content_card
|
||||
type: Card
|
||||
- id: page1
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
title: Page 1
|
||||
blocks:
|
||||
- id: title
|
||||
type: Title
|
||||
properties:
|
||||
content:
|
||||
_var: title
|
||||
- id: content
|
||||
type: Markdown
|
||||
properties:
|
||||
content:
|
||||
_var: content
|
||||
- id: content_card
|
||||
type: Card
|
||||
blocks:
|
||||
- id: title
|
||||
type: Title
|
||||
properties:
|
||||
content: Title
|
||||
- id: paragraph
|
||||
type: Paragraph
|
||||
properties:
|
||||
content: This is a paragraph on Page 1.
|
||||
```
|
||||
|
||||
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.
|
||||
Let's add another card to our page and give it some blocks which will allow us to get input from the user.
|
||||
|
||||
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).
|
||||
###### lowdefy.yaml
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
|
||||
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.
|
||||
pages:
|
||||
- id: page1
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
title: Page 1
|
||||
blocks:
|
||||
- id: content_card
|
||||
type: Card
|
||||
blocks:
|
||||
- id: title
|
||||
type: Title
|
||||
properties:
|
||||
content: Title
|
||||
- id: paragraph
|
||||
type: Paragraph
|
||||
properties:
|
||||
content: This is a paragraph on Page 1.
|
||||
- id: input_card
|
||||
type: Card
|
||||
blocks:
|
||||
- id: text_input
|
||||
type: TextInput
|
||||
properties:
|
||||
label:
|
||||
title: Please Enter Your Name
|
||||
- id: radio_selector
|
||||
type: RadioSelector
|
||||
properties:
|
||||
label:
|
||||
title: How Are You Feeling?
|
||||
colon: false
|
||||
options:
|
||||
- label: Meh
|
||||
value: 1
|
||||
disabled: false
|
||||
- label: Okay
|
||||
value: 2
|
||||
disabled: false
|
||||
- label: Good
|
||||
value: 3
|
||||
disabled: false
|
||||
- label: Great
|
||||
value: 4
|
||||
disabled: false
|
||||
- label: Amazing Now That I'm Using Lowdefy
|
||||
value: 5
|
||||
disabled: false
|
||||
```
|
||||
|
||||
## YAML file extensions
|
||||
In order to build our page further, we will need to add more blocks. Let's leave this page as is and add another page, with it's own card block containing a title block and a paragraph block.
|
||||
|
||||
Both files with the `.yaml` and `.yml` file extensions are supported as YAML files.
|
||||
###### lowdefy.yaml
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
|
||||
## JSON instead of YAML
|
||||
pages:
|
||||
- id: page1
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
title: Page 1
|
||||
blocks:
|
||||
- id: content_card
|
||||
type: Card
|
||||
blocks:
|
||||
- id: title
|
||||
type: Title
|
||||
properties:
|
||||
content: Title
|
||||
- id: paragraph
|
||||
type: Paragraph
|
||||
properties:
|
||||
content: This is a paragraph on Page 1.
|
||||
- id: input_card
|
||||
type: Card
|
||||
blocks:
|
||||
- id: text_input
|
||||
type: TextInput
|
||||
properties:
|
||||
label:
|
||||
title: Please Enter Your Name
|
||||
- id: radio_selector
|
||||
type: RadioSelector
|
||||
properties:
|
||||
label:
|
||||
title: How Are You Feeling?
|
||||
colon: false
|
||||
options:
|
||||
- label: Meh
|
||||
value: 1
|
||||
disabled: false
|
||||
- label: Okay
|
||||
value: 2
|
||||
disabled: false
|
||||
- label: Good
|
||||
value: 3
|
||||
disabled: false
|
||||
- label: Great
|
||||
value: 4
|
||||
disabled: false
|
||||
- label: Amazing Now That I'm Using Lowdefy
|
||||
value: 5
|
||||
disabled: false
|
||||
- id: page2
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
title: Page 2
|
||||
blocks:
|
||||
- id: content_card
|
||||
type: Card
|
||||
blocks:
|
||||
- id: title
|
||||
type: Title
|
||||
properties:
|
||||
content: Title
|
||||
- id: paragraph
|
||||
type: Paragraph
|
||||
properties:
|
||||
content: This is a paragraph on Page 2.
|
||||
```
|
||||
|
||||
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.
|
||||
In order to keep files neat and generally easier to read and understand, we suggest making use of references and templating.
|
||||
|
||||
# Lowdefy versions and version updates
|
||||
## References and templates
|
||||
|
||||
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.
|
||||
|
||||
Templating can be taken further by referencing [Nunjucks](https://mozilla.github.io/nunjucks/) template files. 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.
|
||||
|
||||
See more about references and templates [here](/references-and-templates).
|
||||
|
||||
## Lowdefy versions and version updates
|
||||
|
||||
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.
|
||||
|
||||
|
156
packages/docs/concepts/menus.yaml
Normal file
156
packages/docs/concepts/menus.yaml
Normal file
@ -0,0 +1,156 @@
|
||||
# Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_ref:
|
||||
path: templates/general.yaml.njk
|
||||
vars:
|
||||
pageId: menus
|
||||
pageTitle: Menus
|
||||
section: Concepts
|
||||
filePath: concepts/menus.yaml
|
||||
content:
|
||||
- id: menu_filter_alert
|
||||
type: Alert
|
||||
properties:
|
||||
type: info
|
||||
showIcon: false
|
||||
message: The menu items are filtered according to pages the user is authorized to see. This can be controlled by making pages public or private, or by assigning roles to authenticated users. See <a href = "./protected-pages">protected pages</a> and <a href = "./roles">roles</a> for more on how to set this up.
|
||||
|
||||
- id: md1
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
Menu objects are objects with links to pages. They are used by blocks such as `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.
|
||||
|
||||
Blocks 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.
|
||||
|
||||
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.
|
||||
|
||||
If OpenID Connect authentication and role based authentication is configured, pages that the user is restricted from seeing are filtered from the menu object.
|
||||
|
||||
The menu objects can be obtained by using the [`_menu`](/_menu) operator.
|
||||
|
||||
The schema for a menu object is:
|
||||
|
||||
- `id: string`: __Required__ - A identifier for the menu. If it is `default`, it will be used as default by pages.
|
||||
- `links: object[]`: An array of `MenuLink` or `MenuGroup` objects that form the links in the menu. `MenuGroups` can be two levels deep.
|
||||
|
||||
The schema for a `MenuLink` is:
|
||||
- `id: string`: __Required__ - A identifier for the link unique to the menu.
|
||||
- `type: string`: __Required__ - The type should be `MenuLink`.
|
||||
- `pageId: string`: The id of the page to link to. Used as the title if no title is provided.
|
||||
- `url: string`: An external url to link to.
|
||||
- `properties: object`: The properties of the menu link. These are:
|
||||
- `title: string`: The title to display for the link.
|
||||
- `icon: string | object`: The name of a [React Icon](https://react-icons.github.io/react-icons/search) 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).
|
||||
|
||||
The schema for a `MenuGroup` is:
|
||||
- `id: string`: __Required__ - A identifier for the group unique to the menu.
|
||||
- `type: string`: __Required__ - The type should be `MenuGroup`.
|
||||
- `properties: object`: The properties of the menu group. These are:
|
||||
- `title: string`: The title to display for the group.
|
||||
- `icon: string | object`: The name of a [React Icon](https://react-icons.github.io/react-icons/search) 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).
|
||||
- `links: object[]`: An array of `MenuLink` or `MenuGroup` objects that are should be grouped together in the group.
|
||||
|
||||
###### Menus example:
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
menus:
|
||||
- id: default
|
||||
links:
|
||||
- id: page1
|
||||
type: MenuLink
|
||||
pageId: page1
|
||||
properties:
|
||||
title: Page 1
|
||||
icon: AiOutlineFile
|
||||
- id: top-group
|
||||
properties:
|
||||
title: Group
|
||||
icon: AiOutlineGroup
|
||||
links:
|
||||
- id: page2
|
||||
type: MenuLink
|
||||
pageId: page2 # pageId will be used as link title
|
||||
- id: external
|
||||
type: MenuLink
|
||||
url: https://external.com
|
||||
properties:
|
||||
title: External site
|
||||
- id: nested-group
|
||||
type: MenuGroup
|
||||
properties:
|
||||
title: Nested Group
|
||||
links:
|
||||
- id: page3
|
||||
type: MenuLink
|
||||
pageId: page3
|
||||
properties:
|
||||
title: Page 3
|
||||
- id: page-1-and-3
|
||||
links:
|
||||
- id: page1
|
||||
type: MenuLink
|
||||
pageId: page1
|
||||
properties:
|
||||
title: Page 1
|
||||
icon: AiOutlineFile
|
||||
- id: page3
|
||||
type: MenuLink
|
||||
pageId: page3
|
||||
properties:
|
||||
title: Page 3
|
||||
icon: AiOutlineControl
|
||||
```
|
||||
|
||||
We can make use of [protected pages](/protected-pages) and [roles](/roles) to filter the menu items according to the pages that the user has access to.
|
||||
|
||||
###### lowdefy.yaml
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
|
||||
auth:
|
||||
# ...
|
||||
pages:
|
||||
protected: true
|
||||
public:
|
||||
- login
|
||||
- '404'
|
||||
roles:
|
||||
admin:
|
||||
- page2
|
||||
- page3
|
||||
user:
|
||||
- page1
|
||||
|
||||
menus:
|
||||
- id: default
|
||||
links:
|
||||
- id: page1
|
||||
type: MenuLink
|
||||
pageId: page1
|
||||
properties:
|
||||
title: Page 1
|
||||
icon: AiOutlineFile
|
||||
- id: page2
|
||||
type: MenuLink
|
||||
pageId: page2 # pageId will be used as link title
|
||||
- id: page3
|
||||
type: MenuLink
|
||||
pageId: page3
|
||||
properties:
|
||||
title: Page 3
|
||||
```
|
||||
|
||||
Public users can only view the `login` and `404` pages, all other pages require the user to be logged in. If the authorized user had been given only the `user` role, they will only be able to see `page1`. In order to see `page2` and `page3`, the authorized user will need to have the `admin` role assigned to them. The menu will be filtered accordingly and will only contain the menu items that the user has access to.
|
@ -24,6 +24,8 @@ _ref:
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
##### TODO: This page needs to be updated.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
224
packages/docs/concepts/references-and-templates.yaml
Normal file
224
packages/docs/concepts/references-and-templates.yaml
Normal file
@ -0,0 +1,224 @@
|
||||
# Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_ref:
|
||||
path: templates/general.yaml.njk
|
||||
vars:
|
||||
pageId: references-and-templates
|
||||
pageTitle: References and Templates
|
||||
section: Concepts
|
||||
filePath: concepts/references-and-templates.yaml
|
||||
content:
|
||||
- id: md1
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
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.
|
||||
|
||||
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:
|
||||
|
||||
###### lowdefy.yaml
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
|
||||
pages:
|
||||
_ref: pages/page1.yaml # Path to the referenced file. Always from the root of the project.
|
||||
_ref: pages/page1.yaml
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
###### pages/page1.yaml
|
||||
```yaml
|
||||
_ref:
|
||||
path: templates/text_page.yaml
|
||||
vars:
|
||||
id: page1
|
||||
title: Page 1
|
||||
content:
|
||||
_ref: markdowns/content.md
|
||||
```
|
||||
|
||||
###### markdowns/content.md
|
||||
```yaml
|
||||
Page content text.
|
||||
```
|
||||
|
||||
###### templates/text_page.yaml
|
||||
```yaml
|
||||
id:
|
||||
_var: id
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
title:
|
||||
_var: title
|
||||
blocks:
|
||||
- id: content_card
|
||||
type: Card
|
||||
blocks:
|
||||
- id: title
|
||||
type: Title
|
||||
properties:
|
||||
content:
|
||||
_var: title
|
||||
- id: content
|
||||
type: Markdown
|
||||
properties:
|
||||
content:
|
||||
_var: content
|
||||
```
|
||||
|
||||
## Nunjucks Templating
|
||||
|
||||
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.
|
||||
|
||||
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).
|
||||
|
||||
We can modify the example above to make use of nunjucks templating to allow us to add subsections to our page. This can be done as follows:
|
||||
|
||||
###### pages/page1.yaml
|
||||
```yaml
|
||||
_ref:
|
||||
path: templates/text_page.yaml.njk
|
||||
vars:
|
||||
id: page1
|
||||
title: Page 1
|
||||
content:
|
||||
_ref: markdowns/content.md
|
||||
subsections:
|
||||
- id: subsection1
|
||||
title: Subsection 1
|
||||
content: |
|
||||
Subsection 1 content text.
|
||||
- id: subsection2
|
||||
title: Subsection 2
|
||||
content: |
|
||||
Subsection 2 content text.
|
||||
```
|
||||
|
||||
###### markdowns/content.md
|
||||
```yaml
|
||||
Page content text.
|
||||
```
|
||||
|
||||
###### templates/text_page.yaml.njk
|
||||
```yaml
|
||||
id:
|
||||
_var: id
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
title:
|
||||
_var: title
|
||||
blocks:
|
||||
- id: content_card
|
||||
type: Card
|
||||
blocks:
|
||||
- id: title
|
||||
type: Title
|
||||
properties:
|
||||
content:
|
||||
_var: title
|
||||
- id: content
|
||||
type: Markdown
|
||||
properties:
|
||||
content:
|
||||
_var: content
|
||||
{% if subsections %}
|
||||
{% for subsection in subsections %}
|
||||
- id: {{ subsection.id }}_title
|
||||
type: Title
|
||||
properties:
|
||||
content: {{ subsection.title }}
|
||||
- id: {{ subsection.id }}_content
|
||||
type: Markdown
|
||||
properties:
|
||||
content: {{ subsection.content }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
```
|
||||
|
||||
## Custom JavaScript Functions
|
||||
|
||||
TODO: Test common js vs es module exports
|
||||
|
||||
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.
|
||||
|
||||
### Resolver
|
||||
|
||||
This resolver function will first look for the configuration file in the current working directory, but if the file is not found it will be read from an adjacent "shared" directory. This pattern can be used to build apps that mostly use a shared configuration, with a few components that are customised per app.
|
||||
|
||||
###### resolvers/useLocalOrSharedConfig.js
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { promisify } = require('util');
|
||||
|
||||
const readFilePromise = promisify(fs.readFile);
|
||||
|
||||
async function useLocalOrSharedConfig(refPath, vars, context) {
|
||||
let fileContent
|
||||
try {
|
||||
fileContent = await readFilePromise(path.resolve(refPath), 'utf8');
|
||||
return fileContent;
|
||||
} catch (error) {
|
||||
if (error.code === 'ENOENT') {
|
||||
fileContent = readFilePromise(path.resolve('../shared', refPath), 'utf8');
|
||||
return fileContent;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports = useLocalOrSharedConfig;
|
||||
```
|
||||
|
||||
###### lowdefy.yaml
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
|
||||
cli:
|
||||
refResolver: resolvers/useLocalOrSharedConfig.js
|
||||
|
||||
pages:
|
||||
- _ref: pages/local-page.yaml
|
||||
- _ref: pages/shared-page.yaml
|
||||
```
|
||||
|
||||
### Transformer
|
||||
|
||||
This transformer adds a standard footer to each page:
|
||||
|
||||
###### transformers/addFooter.js
|
||||
```js
|
||||
function addFooter(page, vars) {
|
||||
const footer = {
|
||||
// ...
|
||||
};
|
||||
page.areas.footer = footer;
|
||||
return page;
|
||||
}
|
||||
module.exports = addFooter;
|
||||
```
|
||||
|
||||
###### lowdefy.yaml
|
||||
```yaml
|
||||
lowdefy: LOWDEFY_VERSION
|
||||
|
||||
pages:
|
||||
- _ref:
|
||||
path: pages/page1.yaml
|
||||
transformer: transformers/addFooter.js
|
||||
```
|
@ -24,26 +24,22 @@ _ref:
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
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.
|
||||
The `secrets` object is an object that can be used to securely store sensitive information such as passwords and API keys. Secrets can be accessed using the [`_secret`](/_secret) operator.
|
||||
|
||||
The secrets object only exists on the backend server, and therefore the `_secret` operator can only be used in `connections` and `requests`.
|
||||
|
||||
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.
|
||||
|
||||
## Environment variables strategy
|
||||
|
||||
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.
|
||||
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 of the name as key.
|
||||
|
||||
For example, if the environment variable `LOWDEFY_SECRET_MY_SECRET` is set to `supersecret`, then `_secret: MY_SECRET` will return `supersecret`.
|
||||
|
||||
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.
|
||||
Only strings can be set as environment variables. To store an object as a secret, the object can be JSON stringified, and parsed using the `_json.parse` operator.
|
||||
|
||||
To store secrets that contain newline characters, the secret can be base64 encoded, and decoded using the `_base64.decode` operator.
|
||||
|
||||
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:
|
||||
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 follows:
|
||||
|
||||
###### .env
|
||||
```
|
||||
# .env
|
||||
LOWDEFY_SECRET_MY_SECRET=supersecret
|
||||
```
|
||||
|
||||
|
@ -30,7 +30,7 @@ _ref:
|
||||
|
||||
The same properties can be set on both connections and requests. The properties will be merged, with the request properties overwriting connection properties. This allows properties like authentication headers and the baseURL to be set on the connection, with request specific properties like the request.
|
||||
|
||||
>Secrets like authentication headers and API keys should be stored using the [`_secret`](operators/secret.md) operator.
|
||||
>Secrets like authentication headers and API keys should be stored using the [`_secret`](_secret) operator.
|
||||
|
||||
## Connections
|
||||
|
||||
|
@ -1,128 +0,0 @@
|
||||
# Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_ref:
|
||||
path: templates/general.yaml.njk
|
||||
vars:
|
||||
pageId: aws-lambda
|
||||
pageTitle: Deploy with AWS Lambda
|
||||
section: Deployment
|
||||
filePath: deployment/aws-lambda.yaml
|
||||
content:
|
||||
- id: md1
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
Lowdefy apps can be deployed to AWS Lambda serverless functions by using the [lowdefy/lowdefy-aws-lambda](https://hub.docker.com/repository/docker/lowdefy/lowdefy-aws-lambda) Docker images. These images contain a Lowdefy app server. To deploy to AWS Lambda a new image that contains the app configuration, based on the Lowdefy base image, should be built. This image should then be pushed to a private AWS ECR registry. From there it can be used to create a Lambda function.
|
||||
|
||||
The [serverless framework](https://www.serverless.com) can be used to simplify the deployment. The serverless framework create a ECR registry if it does not exist, build the Docker image, push to the registry and deploy an AWS Lambda function with a API Gateway HTTP api integration.
|
||||
|
||||
An example can be found in the [lowdefy-example-aws-lambda](https://github.com/lowdefy/lowdefy-example-aws-lambda) repository.
|
||||
|
||||
## Deploying to AWS Lambda
|
||||
|
||||
### Requirements
|
||||
|
||||
- The [AWS CLI](https://aws.amazon.com/cli/) should be installed and authenticated.
|
||||
- You should have [Docker](https://docs.docker.com/get-docker/) installed.
|
||||
|
||||
### Step 1 - Create a Dockerfile
|
||||
|
||||
Create a file called `Dockerfile` in your project repository:
|
||||
|
||||
```
|
||||
FROM node:14-buster AS build
|
||||
|
||||
# Set working directory and node user
|
||||
WORKDIR /home/node/lowdefy
|
||||
|
||||
RUN chown node:node /home/node/lowdefy
|
||||
|
||||
USER node
|
||||
|
||||
# Copy app config, and change ownership of files to "node" user
|
||||
COPY --chown=node:node . .
|
||||
|
||||
# Build the Lowdefy config using the Lowdefy CLI
|
||||
RUN npx lowdefy@3.23.2 build
|
||||
|
||||
# Use the correct Lowdefy base image
|
||||
FROM lowdefy/lowdefy-aws-lambda:3.23.2
|
||||
|
||||
# Copy build output from build stage
|
||||
COPY --from=build /home/node/lowdefy/.lowdefy/build ./build
|
||||
|
||||
# Copy contents of public directory into image
|
||||
COPY ./public ./public
|
||||
|
||||
# Lambda handler
|
||||
CMD [ "dist/server.handler"]
|
||||
```
|
||||
|
||||
- id: warning_update_dockerfile
|
||||
type: Alert
|
||||
properties:
|
||||
type: warning
|
||||
icon: AiFillWarning
|
||||
description: When updating your app to a new Lowdefy version, make sure to update the Lowdefy version in the Dockerfile
|
||||
|
||||
- id: md2
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
### Step 2 - Create a `.dockerignore` file
|
||||
|
||||
Create a file called `.dockerignore` in your project repository:
|
||||
|
||||
```
|
||||
.lowdefy/**
|
||||
.serverless/**
|
||||
.env
|
||||
```
|
||||
|
||||
### Step 3 - Create a serverless.yaml file
|
||||
|
||||
Create a file called `serverless.yaml` in your project repository:
|
||||
|
||||
```
|
||||
service: lowdefy-example-aws-lambda
|
||||
frameworkVersion: '2'
|
||||
provider:
|
||||
name: aws
|
||||
region: us-east-1
|
||||
ecr:
|
||||
images:
|
||||
lowdefy:
|
||||
path: .
|
||||
file: Dockerfile
|
||||
|
||||
functions:
|
||||
lowdefy-server:
|
||||
image: lowdefy
|
||||
name: lowdefy-example-aws-lambda-${opt:stage}
|
||||
# Set secrets as environment variables here
|
||||
# environment:
|
||||
# LOWDEFY_SECRET_MY_SECRET: ${env:LOWDEFY_SECRET_MY_SECRET}
|
||||
|
||||
events:
|
||||
- httpApi: '*'
|
||||
```
|
||||
|
||||
### Step 4 - Deploy to AWS
|
||||
|
||||
Deploy to AWS by running:
|
||||
|
||||
```
|
||||
npx serverless deploy --verbose --conceal --stage dev
|
||||
```
|
@ -24,95 +24,96 @@ _ref:
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
The [official Lowdefy Docker](https://hub.docker.com/repository/docker/lowdefy/lowdefy) images can be found on Docker Hub.
|
||||
##### TODO: This page needs to be updated.
|
||||
# The [official Lowdefy Docker](https://hub.docker.com/repository/docker/lowdefy/lowdefy) images can be found on Docker Hub.
|
||||
|
||||
Examples of Docker configuration can be found in the [example repository](https://github.com/lowdefy/lowdefy-example-docker).
|
||||
# Examples of Docker configuration can be found in the [example repository](https://github.com/lowdefy/lowdefy-example-docker).
|
||||
|
||||
The Lowdefy Docker images contain a Lowdefy server. The configuration of the Lowdefy app can either be built into a new image based on the Lowdefy image, or the configuration read from the file system, usually provided as a volume.
|
||||
# The Lowdefy Docker images contain a Lowdefy server. The configuration of the Lowdefy app can either be built into a new image based on the Lowdefy image, or the configuration read from the file system, usually provided as a volume.
|
||||
|
||||
The Lowdefy server can be configured using the following environment variables:
|
||||
# The Lowdefy server can be configured using the following environment variables:
|
||||
|
||||
- `LOWDEFY_BASE_PATH`: Set the base path to serve the Lowdefy application from. This will serve the application under `https://example.com/<base-path>`instead of `https://example.com`, and all pages under `https://example.com/<base-path>/<page-id>` instead of the default `https://example.com/<page-id>`.
|
||||
- `LOWDEFY_SERVER_BUILD_DIRECTORY`: The directory of the built Lowdefy configuration (The output of `lowdefy build`, usually found at `./.lowdefy/build` in your project repository). The default is `./build` (or `/home/node/lowdefy/build`).
|
||||
- `LOWDEFY_SERVER_PUBLIC_DIRECTORY`: The directory of the public assets to be served. The default is `./public` (or `/home/node/lowdefy/public`).
|
||||
- `LOWDEFY_SERVER_PORT`: The port (inside the container) at which to run the server. The default is `3000`.
|
||||
# - `LOWDEFY_BASE_PATH`: Set the base path to serve the Lowdefy application from. This will serve the application under `https://example.com/<base-path>`instead of `https://example.com`, and all pages under `https://example.com/<base-path>/<page-id>` instead of the default `https://example.com/<page-id>`.
|
||||
# - `LOWDEFY_SERVER_BUILD_DIRECTORY`: The directory of the built Lowdefy configuration (The output of `lowdefy build`, usually found at `./.lowdefy/build` in your project repository). The default is `./build` (or `/home/node/lowdefy/build`).
|
||||
# - `LOWDEFY_SERVER_PUBLIC_DIRECTORY`: The directory of the public assets to be served. The default is `./public` (or `/home/node/lowdefy/public`).
|
||||
# - `LOWDEFY_SERVER_PORT`: The port (inside the container) at which to run the server. The default is `3000`.
|
||||
|
||||
- id: warning_update_dockerfile
|
||||
type: Alert
|
||||
properties:
|
||||
type: warning
|
||||
icon: AiFillWarning
|
||||
description: When updating your app to a new Lowdefy version, make sure to update the Lowdefy version in the Dockerfile
|
||||
# - id: warning_update_dockerfile
|
||||
# type: Alert
|
||||
# properties:
|
||||
# type: warning
|
||||
# icon: AiFillWarning
|
||||
# description: When updating your app to a new Lowdefy version, make sure to update the Lowdefy version in the Dockerfile
|
||||
|
||||
- id: md2
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
# Building a Lowdefy app image
|
||||
# - id: md2
|
||||
# type: Markdown
|
||||
# properties:
|
||||
# content: |
|
||||
# # Building a Lowdefy app image
|
||||
|
||||
To build the configuration into an image, the following Dockerfile can be used:
|
||||
```text
|
||||
FROM node:14-buster AS build
|
||||
# To build the configuration into an image, the following Dockerfile can be used:
|
||||
# ```text
|
||||
# FROM node:14-buster AS build
|
||||
|
||||
# Set working directory and node user
|
||||
WORKDIR /home/node/lowdefy
|
||||
# # Set working directory and node user
|
||||
# WORKDIR /home/node/lowdefy
|
||||
|
||||
RUN chown node:node /home/node/lowdefy
|
||||
# RUN chown node:node /home/node/lowdefy
|
||||
|
||||
USER node
|
||||
# USER node
|
||||
|
||||
# Copy app config and change ownership of files to "node" user
|
||||
COPY --chown=node:node . .
|
||||
# # Copy app config and change ownership of files to "node" user
|
||||
# COPY --chown=node:node . .
|
||||
|
||||
# Build the Lowdefy config using the Lowdefy CLI
|
||||
RUN npx lowdefy@3.23.2 build
|
||||
# # Build the Lowdefy config using the Lowdefy CLI
|
||||
# RUN npx lowdefy@3.23.2 build
|
||||
|
||||
# Use the correct Lowdefy base image
|
||||
FROM lowdefy/lowdefy:3.23.2
|
||||
# # Use the correct Lowdefy base image
|
||||
# FROM lowdefy/lowdefy:3.23.2
|
||||
|
||||
# Copy build output from build stage
|
||||
COPY --from=build --chown=node:node /home/node/lowdefy/.lowdefy/build ./build
|
||||
# # Copy build output from build stage
|
||||
# COPY --from=build --chown=node:node /home/node/lowdefy/.lowdefy/build ./build
|
||||
|
||||
# Copy contents of public directory into image
|
||||
COPY --chown=node:node ./public ./public
|
||||
# # Copy contents of public directory into image
|
||||
# COPY --chown=node:node ./public ./public
|
||||
|
||||
# Run the server on start
|
||||
CMD ["node", "./dist/server.js"]
|
||||
```
|
||||
# # Run the server on start
|
||||
# CMD ["node", "./dist/server.js"]
|
||||
# ```
|
||||
|
||||
with a `.dockerignore` file:
|
||||
# with a `.dockerignore` file:
|
||||
|
||||
```
|
||||
.lowdefy/**
|
||||
.env
|
||||
```
|
||||
# ```
|
||||
# .lowdefy/**
|
||||
# .env
|
||||
# ```
|
||||
|
||||
An image can be built by running:
|
||||
```
|
||||
docker build -t <tag> .
|
||||
```
|
||||
# An image can be built by running:
|
||||
# ```
|
||||
# docker build -t <tag> .
|
||||
# ```
|
||||
|
||||
The container can be run by:
|
||||
```
|
||||
docker run -p 3000:3000 <tag>
|
||||
```
|
||||
# The container can be run by:
|
||||
# ```
|
||||
# docker run -p 3000:3000 <tag>
|
||||
# ```
|
||||
|
||||
Docker compose can also be used. Use a `docker-compose.yaml` file:
|
||||
```
|
||||
version: "3.8"
|
||||
services:
|
||||
lowdefy:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
```
|
||||
# Docker compose can also be used. Use a `docker-compose.yaml` file:
|
||||
# ```
|
||||
# version: "3.8"
|
||||
# services:
|
||||
# lowdefy:
|
||||
# build: .
|
||||
# ports:
|
||||
# - "3000:3000"
|
||||
# ```
|
||||
|
||||
To build the image, run:
|
||||
```
|
||||
docker compose build
|
||||
```
|
||||
# To build the image, run:
|
||||
# ```
|
||||
# docker compose build
|
||||
# ```
|
||||
|
||||
To run the app, run:
|
||||
```
|
||||
docker compose up
|
||||
```
|
||||
# To run the app, run:
|
||||
# ```
|
||||
# docker compose up
|
||||
# ```
|
||||
|
@ -1,69 +0,0 @@
|
||||
# Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_ref:
|
||||
path: templates/general.yaml.njk
|
||||
vars:
|
||||
pageId: netlify
|
||||
pageTitle: Deploy to Netlify
|
||||
section: Deployment
|
||||
filePath: deployment/netlify.yaml
|
||||
content:
|
||||
- id: md1
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
Lowdefy apps can be deployed to [Netlify](https://www.netlify.com). Netlify integrates with git providers to automatically deploy your app when you merge changes into the main branch of your repository and deploy previews of pull requests. On your Netlify deployment you can set environment variables, manage custom domains and more.
|
||||
|
||||
## How to Deploy to Netlify
|
||||
|
||||
#### Step 1
|
||||
|
||||
Your project will need to be hosted as a Github repository.
|
||||
|
||||
#### Step 2
|
||||
|
||||
Link your Github project to Netlify.
|
||||
|
||||
- Once logged in to Netlify, click the "New site from git" button.
|
||||
- Choose Github, and authorize Netlify to access your repositories.
|
||||
- Select your repository.
|
||||
|
||||
> If your repository isn't found, click "Configure Netlify on Github", and give Netlify access to your repository.
|
||||
|
||||
#### Step 3
|
||||
|
||||
Configure your Netlify deployment.
|
||||
|
||||
- Set your build command to `npx lowdefy@3 build-netlify`.
|
||||
- Set your publish directory to `.lowdefy/publish`.
|
||||
|
||||
#### Step 4
|
||||
|
||||
Configure the Lowdefy server.
|
||||
|
||||
- Click the "Advanced build settings" button.
|
||||
- Set the functions directory to `.lowdefy/functions`.
|
||||
|
||||
#### Step 5
|
||||
|
||||
Deploy your site.
|
||||
|
||||
- Click "Deploy site"
|
||||
|
||||
On the "Site overview" tab you will find your site url.
|
||||
|
||||
#### Step 6
|
||||
|
||||
To set Lowdefy secrets, go to "Site settings", then "Build and deploy" in the left menu. Scroll down and select "Edit variables" in the "Environment" section. Here you can set the `LOWDEFY_SECRET_` environment variables.
|
@ -24,88 +24,89 @@ _ref:
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
A production Lowdefy server that runs using Node.js is published on npm as [@lowdefy/server-node](https://www.npmjs.com/package/@lowdefy/server-node).
|
||||
##### TODO: This page needs to be updated.
|
||||
|
||||
## Running the server
|
||||
# A production Lowdefy server that runs using Node.js is published on npm as [@lowdefy/server-node](https://www.npmjs.com/package/@lowdefy/server-node).
|
||||
|
||||
### Step 1 - Create a `package.json` file
|
||||
# ## Running the server
|
||||
|
||||
To run the server in a Lowdefy project, first initialise a Node.js project by creating a `package.json` file in the root of your project. To do this, you can run
|
||||
# ### Step 1 - Create a `package.json` file
|
||||
|
||||
```
|
||||
npm init
|
||||
```
|
||||
# To run the server in a Lowdefy project, first initialise a Node.js project by creating a `package.json` file in the root of your project. To do this, you can run
|
||||
|
||||
### Step 2 - Add the `@lowdefy/server-node` package to your project as a dependency
|
||||
# ```
|
||||
# npm init
|
||||
# ```
|
||||
|
||||
To add the server as a dependency, run
|
||||
# ### Step 2 - Add the `@lowdefy/server-node` package to your project as a dependency
|
||||
|
||||
```
|
||||
npm install @lowdefy/server-node --save --save-exact
|
||||
```
|
||||
# To add the server as a dependency, run
|
||||
|
||||
### Step 3 - Add the Lowdefy CLI to you project as a dev dependency.
|
||||
# ```
|
||||
# npm install @lowdefy/server-node --save --save-exact
|
||||
# ```
|
||||
|
||||
To add the server as a dependency, run:
|
||||
# ### Step 3 - Add the Lowdefy CLI to you project as a dev dependency.
|
||||
|
||||
```
|
||||
npm install lowdefy --save-dev --save-exact
|
||||
```
|
||||
# To add the server as a dependency, run:
|
||||
|
||||
### Step 4 - Add the `build` and `start` scripts.
|
||||
# ```
|
||||
# npm install lowdefy --save-dev --save-exact
|
||||
# ```
|
||||
|
||||
Add the following to the `scripts` section in your `package.json` file:
|
||||
# ### Step 4 - Add the `build` and `start` scripts.
|
||||
|
||||
```json
|
||||
"scripts": {
|
||||
"init": "lowdefy init",
|
||||
"build": "lowdefy build",
|
||||
"start": "lowdefy-server"
|
||||
},
|
||||
```
|
||||
# Add the following to the `scripts` section in your `package.json` file:
|
||||
|
||||
### Step 5 - Init a Lowdefy project
|
||||
# ```json
|
||||
# "scripts": {
|
||||
# "init": "lowdefy init",
|
||||
# "build": "lowdefy build",
|
||||
# "start": "lowdefy-server"
|
||||
# },
|
||||
# ```
|
||||
|
||||
Run:
|
||||
# ### Step 5 - Init a Lowdefy project
|
||||
|
||||
```
|
||||
npm run init
|
||||
```
|
||||
# Run:
|
||||
|
||||
### Step 6 - Add the public files:
|
||||
# ```
|
||||
# npm run init
|
||||
# ```
|
||||
|
||||
Create a folder called `public` in your project directory and add the Lowdefy public files found [here](https://github.com/lowdefy/lowdefy/tree/main/packages/shell/src/public) (or add your own logos and files).
|
||||
# ### Step 6 - Add the public files:
|
||||
|
||||
### Step 7 - Build the Lowdefy project
|
||||
# Create a folder called `public` in your project directory and add the Lowdefy public files found [here](https://github.com/lowdefy/lowdefy/tree/main/packages/shell/src/public) (or add your own logos and files).
|
||||
|
||||
Build the Lowdefy configuration files in the project by running:
|
||||
# ### Step 7 - Build the Lowdefy project
|
||||
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
# Build the Lowdefy configuration files in the project by running:
|
||||
|
||||
### Step 8 - Start the server
|
||||
# ```
|
||||
# npm run build
|
||||
# ```
|
||||
|
||||
To start the server, run:
|
||||
# ### Step 8 - Start the server
|
||||
|
||||
```
|
||||
npm run start
|
||||
```
|
||||
# To start the server, run:
|
||||
|
||||
## Configuration
|
||||
# ```
|
||||
# npm run start
|
||||
# ```
|
||||
|
||||
The Lowdefy server can be configured using command-line arguments or environment variables. The command-line arguments take precedence over the environment variables.
|
||||
# ## Configuration
|
||||
|
||||
The following command-line arguments can be specified:
|
||||
# The Lowdefy server can be configured using command-line arguments or environment variables. The command-line arguments take precedence over the environment variables.
|
||||
|
||||
- `--build-directory`: The directory of the built Lowdefy configuration (The output of `lowdefy build`, usually found at `./.lowdefy/build` in your project repository). The default is `./.lowdefy/build`.
|
||||
- `--port`: The port at which to run the server. The default is `3000`.
|
||||
- `--public-directory`: The directory of the public assets to be served. The default is `./public`.
|
||||
# The following command-line arguments can be specified:
|
||||
|
||||
# - `--build-directory`: The directory of the built Lowdefy configuration (The output of `lowdefy build`, usually found at `./.lowdefy/build` in your project repository). The default is `./.lowdefy/build`.
|
||||
# - `--port`: The port at which to run the server. The default is `3000`.
|
||||
# - `--public-directory`: The directory of the public assets to be served. The default is `./public`.
|
||||
|
||||
The following environment variables can be specified:
|
||||
# The following environment variables can be specified:
|
||||
|
||||
- `LOWDEFY_BASE_PATH`: Set the base path to serve the Lowdefy application from. This will serve the application under `https://example.com/<base-path>`instead of `https://example.com`, and all pages under `https://example.com/<base-path>/<page-id>` instead of the default `https://example.com/<page-id>`.
|
||||
- `LOWDEFY_SERVER_BUILD_DIRECTORY`: The directory of the built Lowdefy configuration (The output of `lowdefy build`, usually found at `./.lowdefy/build` in your project repository). The default is `./.lowdefy/build`.
|
||||
- `LOWDEFY_SERVER_PORT`: The port at which to run the server. The default is `3000`.
|
||||
- `LOWDEFY_SERVER_PUBLIC_DIRECTORY`: The directory of the public assets to be served. The default is `./public`.
|
||||
# - `LOWDEFY_BASE_PATH`: Set the base path to serve the Lowdefy application from. This will serve the application under `https://example.com/<base-path>`instead of `https://example.com`, and all pages under `https://example.com/<base-path>/<page-id>` instead of the default `https://example.com/<page-id>`.
|
||||
# - `LOWDEFY_SERVER_BUILD_DIRECTORY`: The directory of the built Lowdefy configuration (The output of `lowdefy build`, usually found at `./.lowdefy/build` in your project repository). The default is `./.lowdefy/build`.
|
||||
# - `LOWDEFY_SERVER_PORT`: The port at which to run the server. The default is `3000`.
|
||||
# - `LOWDEFY_SERVER_PUBLIC_DIRECTORY`: The directory of the public assets to be served. The default is `./public`.
|
||||
|
@ -2,5 +2,3 @@
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/docsearch.js@2.6.3/dist/cdn/docsearch.min.css"
|
||||
/>
|
||||
<script defer type="module" src="/public/modules/pdfMake.js"></script>
|
||||
<script defer type="module" src="/public/modules/csvMake.js"></script>
|
||||
|
@ -25,11 +25,15 @@ _ref:
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
##### TODO: This page needs to be updated.
|
||||
|
||||
|
||||
Lowdefy simplifies creating software that helps manage internal data - think web apps, admin panels, BI dashboards, CRUD and workflow apps. Within most companies the need exists to connect to a variety of data sources and execute actions on such data. This must be done without compromising data security while respecting complex data integrity rules.
|
||||
|
||||
Lowdefy aims to enable companies to better control and monitor business data, by simplifying the process of creating internal tools. Lowdefy makes these tools easy to build, change and maintain, making it easier to evolve your internal tools with your business.
|
||||
|
||||
## Quickstart
|
||||
|
||||
- _ref:
|
||||
path: templates/cli_command.yaml.njk
|
||||
vars:
|
||||
@ -60,7 +64,7 @@ _ref:
|
||||
|
||||
Too often data is exported, duplicated and lost, creating additional risk. Lowdefy only runs your application config, and does not store any data, but rather connects to your data sources and APIs.
|
||||
|
||||
### Build future proof web applications on a open-source platform
|
||||
### Build future proof web applications on an open-source platform
|
||||
|
||||
Lowdefy is a open-source Apache-2 licensed project, free from vendor lock-in. Our business model is to build optional "nice-to-have" services best suited for Lowdefy applications, enriching the Lowdefy ecosystem.
|
||||
|
||||
@ -98,3 +102,12 @@ _ref:
|
||||
type: ScrollTo
|
||||
params:
|
||||
top: 0
|
||||
# Message was renamed to DisplayMessage
|
||||
|
||||
# The following actions need to be added:
|
||||
# Login
|
||||
# Logout
|
||||
# Fetch
|
||||
# ResetValidation
|
||||
# Break
|
||||
# Wait
|
||||
|
@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
name: '@lowdefy/docs'
|
||||
lowdefy: 4.0.0-alpha.17
|
||||
lowdefy: 4.0.0-alpha.22
|
||||
license: Apache-2.0
|
||||
|
||||
cli:
|
||||
@ -21,7 +21,7 @@ cli:
|
||||
|
||||
plugins:
|
||||
- name: '@lowdefy/docs'
|
||||
version: '4.0.0-alpha.10'
|
||||
version: '4.0.0-alpha.22'
|
||||
|
||||
global:
|
||||
all_icons:
|
||||
|
@ -17,52 +17,52 @@
|
||||
pageId: tutorial-start
|
||||
properties:
|
||||
title: Getting started
|
||||
- id: tutorial-create-page
|
||||
type: MenuLink
|
||||
pageId: tutorial-create-page
|
||||
properties:
|
||||
title: Creating a page
|
||||
- id: tutorial-add-blocks
|
||||
type: MenuLink
|
||||
pageId: tutorial-add-blocks
|
||||
properties:
|
||||
title: Adding blocks
|
||||
- id: tutorial-actions-operators
|
||||
type: MenuLink
|
||||
pageId: tutorial-actions-operators
|
||||
properties:
|
||||
title: Interactive pages
|
||||
- id: tutorial-requests
|
||||
type: MenuLink
|
||||
pageId: tutorial-requests
|
||||
properties:
|
||||
title: Requests
|
||||
- id: tutorial-deploy
|
||||
type: MenuLink
|
||||
pageId: tutorial-deploy
|
||||
properties:
|
||||
title: Deploy to Netlify
|
||||
- id: next-steps
|
||||
type: MenuLink
|
||||
pageId: next-steps
|
||||
properties:
|
||||
title: Next steps
|
||||
- id: howto
|
||||
type: MenuGroup
|
||||
properties:
|
||||
title: How To
|
||||
icon: AiOutlineQuestion
|
||||
links:
|
||||
- id: generate-csv
|
||||
type: MenuLink
|
||||
pageId: generate-csv-files-from-data
|
||||
properties:
|
||||
title: Generate CSVs
|
||||
- id: generate-pdf
|
||||
type: MenuLink
|
||||
pageId: generate-pdf-document-from-data
|
||||
properties:
|
||||
title: Generate PDFs
|
||||
# - id: tutorial-create-page
|
||||
# type: MenuLink
|
||||
# pageId: tutorial-create-page
|
||||
# properties:
|
||||
# title: Creating a page
|
||||
# - id: tutorial-add-blocks
|
||||
# type: MenuLink
|
||||
# pageId: tutorial-add-blocks
|
||||
# properties:
|
||||
# title: Adding blocks
|
||||
# - id: tutorial-actions-operators
|
||||
# type: MenuLink
|
||||
# pageId: tutorial-actions-operators
|
||||
# properties:
|
||||
# title: Interactive pages
|
||||
# - id: tutorial-requests
|
||||
# type: MenuLink
|
||||
# pageId: tutorial-requests
|
||||
# properties:
|
||||
# title: Requests
|
||||
# - id: tutorial-deploy
|
||||
# type: MenuLink
|
||||
# pageId: tutorial-deploy
|
||||
# properties:
|
||||
# title: Deploy to Netlify
|
||||
# - id: next-steps
|
||||
# type: MenuLink
|
||||
# pageId: next-steps
|
||||
# properties:
|
||||
# title: Next steps
|
||||
# - id: howto
|
||||
# type: MenuGroup
|
||||
# properties:
|
||||
# title: How To
|
||||
# icon: AiOutlineQuestion
|
||||
# links:
|
||||
# - id: generate-csv
|
||||
# type: MenuLink
|
||||
# pageId: generate-csv-files-from-data
|
||||
# properties:
|
||||
# title: Generate CSVs
|
||||
# - id: generate-pdf
|
||||
# type: MenuLink
|
||||
# pageId: generate-pdf-document-from-data
|
||||
# properties:
|
||||
# title: Generate PDFs
|
||||
- id: concepts
|
||||
type: MenuGroup
|
||||
properties:
|
||||
@ -84,6 +84,16 @@
|
||||
pageId: lowdefy-schema
|
||||
properties:
|
||||
title: Lowdefy App Schema
|
||||
- id: menus
|
||||
type: MenuLink
|
||||
pageId: menus
|
||||
properties:
|
||||
title: Menus
|
||||
- id: references-and-templates
|
||||
type: MenuLink
|
||||
pageId: references-and-templates
|
||||
properties:
|
||||
title: References and Templates
|
||||
- id: context-and-state
|
||||
type: MenuLink
|
||||
pageId: context-and-state
|
||||
@ -134,32 +144,17 @@
|
||||
pageId: custom-code
|
||||
properties:
|
||||
title: Custom Code
|
||||
- id: custom-blocks
|
||||
type: MenuLink
|
||||
pageId: custom-blocks
|
||||
properties:
|
||||
title: Custom Blocks
|
||||
- id: deployment
|
||||
type: MenuGroup
|
||||
properties:
|
||||
title: Deployment
|
||||
icon: AiOutlineCloudUpload
|
||||
links:
|
||||
- id: aws-lambda
|
||||
type: MenuLink
|
||||
pageId: aws-lambda
|
||||
properties:
|
||||
title: AWS Lambda
|
||||
- id: docker
|
||||
type: MenuLink
|
||||
pageId: docker
|
||||
properties:
|
||||
title: Docker
|
||||
- id: netlify
|
||||
type: MenuLink
|
||||
pageId: netlify
|
||||
properties:
|
||||
title: Netlify
|
||||
- id: node-server
|
||||
type: MenuLink
|
||||
pageId: node-server
|
||||
@ -176,31 +171,6 @@
|
||||
pageId: users-introduction
|
||||
properties:
|
||||
title: Introduction
|
||||
- id: openid-connect
|
||||
type: MenuLink
|
||||
pageId: openid-connect
|
||||
properties:
|
||||
title: OpenID Connect
|
||||
- id: login-and-logout
|
||||
type: MenuLink
|
||||
pageId: login-and-logout
|
||||
properties:
|
||||
title: Login and Logout
|
||||
- id: protected-pages
|
||||
type: MenuLink
|
||||
pageId: protected-pages
|
||||
properties:
|
||||
title: Protected pages
|
||||
- id: user-object
|
||||
type: MenuLink
|
||||
pageId: user-object
|
||||
properties:
|
||||
title: User object
|
||||
- id: roles
|
||||
type: MenuLink
|
||||
pageId: roles
|
||||
properties:
|
||||
title: Roles
|
||||
|
||||
- id: blocks_input
|
||||
type: MenuGroup
|
||||
@ -514,9 +484,18 @@
|
||||
title: Actions
|
||||
icon: AiOutlineThunderbolt
|
||||
links:
|
||||
- id: Break
|
||||
type: MenuLink
|
||||
pageId: Break
|
||||
- id: CallMethod
|
||||
type: MenuLink
|
||||
pageId: CallMethod
|
||||
- id: DisplayMessage
|
||||
type: MenuLink
|
||||
pageId: DisplayMessage
|
||||
- id: Fetch
|
||||
type: MenuLink
|
||||
pageId: Fetch
|
||||
- id: Link
|
||||
type: MenuLink
|
||||
pageId: Link
|
||||
@ -526,16 +505,6 @@
|
||||
- id: Logout
|
||||
type: MenuLink
|
||||
pageId: Logout
|
||||
- id: MessageAction
|
||||
type: MenuLink
|
||||
pageId: MessageAction # Clash with Message block
|
||||
properties:
|
||||
title: Message
|
||||
- id: NotificationAction
|
||||
type: MenuLink
|
||||
pageId: NotificationAction # Clash with Notification block
|
||||
properties:
|
||||
title: Notification
|
||||
- id: Request
|
||||
type: MenuLink
|
||||
pageId: Request
|
||||
@ -554,9 +523,6 @@
|
||||
- id: SetState
|
||||
type: MenuLink
|
||||
pageId: SetState
|
||||
- id: Throw
|
||||
type: MenuLink
|
||||
pageId: Throw
|
||||
- id: Validate
|
||||
type: MenuLink
|
||||
pageId: Validate
|
||||
@ -751,61 +717,6 @@
|
||||
links:
|
||||
- id: v3.23.2
|
||||
type: MenuLink
|
||||
url: https://docs.lowdefy.com
|
||||
url: https://628bccb1bb2d810008d517c8--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.23.2
|
||||
- id: v3.22.0
|
||||
type: MenuLink
|
||||
url: https://61519bcb8b8ed4412aae3057--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.22.0
|
||||
- id: v3.21.2
|
||||
type: MenuLink
|
||||
url: https://612e10d3dc02710008646251--lowdefy-docs.netlify.app/introduction
|
||||
properties:
|
||||
title: v3.21.2
|
||||
- id: v3.20.4
|
||||
type: MenuLink
|
||||
url: https://6121f02416ea332ef213ab7d--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.20.4
|
||||
- id: v3.19.0
|
||||
type: MenuLink
|
||||
url: https://60feb65b4a8d320008674f72--lowdefy-docs.netlify.app/introduction
|
||||
properties:
|
||||
title: v3.19.0
|
||||
- id: v3.18.1
|
||||
type: MenuLink
|
||||
url: https://60dc31741e179f0008eca44c--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.18.1
|
||||
- id: v3.17.2
|
||||
type: MenuLink
|
||||
url: https://60c74a306748be0007f7454a--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.17.2
|
||||
- id: v3.16.5
|
||||
type: MenuLink
|
||||
url: https://60b4bfc8f6822500088a1c45--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.16.5
|
||||
- id: v3.15.0
|
||||
type: MenuLink
|
||||
url: https://609a6df368df720007f2cc9c--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.15.0
|
||||
- id: v3.14.1
|
||||
type: MenuLink
|
||||
url: https://6089404fb5958f00070b8520--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.14.1
|
||||
- id: v3.13.0
|
||||
type: MenuLink
|
||||
url: https://607952a468b9200008ad4db0--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.13.0
|
||||
- id: v3.12.6
|
||||
type: MenuLink
|
||||
url: https://606c6baf132ad60007ef8f38--lowdefy-docs.netlify.app
|
||||
properties:
|
||||
title: v3.12.6
|
||||
title: Version 3
|
||||
|
@ -42,12 +42,12 @@ _ref:
|
||||
The index of the `menu` to return.
|
||||
|
||||
###### boolean
|
||||
If the `_media` operator is called with boolean argument `true`, the entire `menus` object is returned.
|
||||
If the `_menu` operator is called with boolean argument `true`, the entire `menus` object is returned.
|
||||
|
||||
###### object
|
||||
- `value: string`: The `menuId` of the `menu` to return.
|
||||
- `index: number`: The index of the `menu` to return.
|
||||
- `all: boolean`: If the `_media` operator is called with boolean argument `true`, the entire `menus` object is returned.
|
||||
- `all: boolean`: If the `_menu` operator is called with boolean argument `true`, the entire `menus` object is returned.
|
||||
|
||||
examples: |
|
||||
###### Get the `menus` object:
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/docs",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -43,7 +43,7 @@
|
||||
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21"
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "28.1.0",
|
||||
|
@ -1,30 +1,32 @@
|
||||
- _ref: introduction.yaml
|
||||
- _ref: tutorial/tutorial-start.yaml
|
||||
- _ref: tutorial/tutorial-create-page.yaml
|
||||
- _ref: tutorial/tutorial-create-page-config.yaml
|
||||
- _ref: tutorial/tutorial-add-blocks.yaml
|
||||
- _ref: tutorial/tutorial-add-blocks-config.yaml
|
||||
- _ref: tutorial/tutorial-actions-operators.yaml
|
||||
- _ref: tutorial/tutorial-actions-operators-config.yaml
|
||||
- _ref: tutorial/tutorial-requests.yaml
|
||||
- _ref: tutorial/tutorial-requests-config.yaml
|
||||
- _ref: tutorial/tutorial-deploy.yaml
|
||||
- _ref: tutorial/next-steps.yaml
|
||||
# - _ref: tutorial/tutorial-create-page.yaml
|
||||
# - _ref: tutorial/tutorial-create-page-config.yaml
|
||||
# - _ref: tutorial/tutorial-add-blocks.yaml
|
||||
# - _ref: tutorial/tutorial-add-blocks-config.yaml
|
||||
# - _ref: tutorial/tutorial-actions-operators.yaml
|
||||
# - _ref: tutorial/tutorial-actions-operators-config.yaml
|
||||
# - _ref: tutorial/tutorial-requests.yaml
|
||||
# - _ref: tutorial/tutorial-requests-config.yaml
|
||||
# - _ref: tutorial/tutorial-deploy.yaml
|
||||
# - _ref: tutorial/next-steps.yaml
|
||||
|
||||
- _ref:
|
||||
path: howto/generate-csv.yaml.njk
|
||||
vars:
|
||||
version:
|
||||
_ref: version.yaml
|
||||
- _ref:
|
||||
path: howto/generate-pdf.yaml.njk
|
||||
vars:
|
||||
version:
|
||||
_ref: version.yaml
|
||||
# - _ref:
|
||||
# path: howto/generate-csv.yaml.njk
|
||||
# vars:
|
||||
# version:
|
||||
# _ref: version.yaml
|
||||
# - _ref:
|
||||
# path: howto/generate-pdf.yaml.njk
|
||||
# vars:
|
||||
# version:
|
||||
# _ref: version.yaml
|
||||
|
||||
- _ref: concepts/overview.yaml
|
||||
- _ref: concepts/cli.yaml
|
||||
- _ref: concepts/lowdefy-schema.yaml
|
||||
- _ref: concepts/menus.yaml
|
||||
- _ref: concepts/references-and-templates.yaml
|
||||
- _ref: concepts/context-and-state.yaml
|
||||
- _ref: concepts/blocks.yaml
|
||||
- _ref: concepts/layout.yaml
|
||||
@ -35,19 +37,16 @@
|
||||
- _ref: concepts/lists.yaml
|
||||
- _ref: concepts/hosting-files.yaml
|
||||
- _ref: concepts/custom-code.yaml
|
||||
- _ref: concepts/custom-blocks.yaml
|
||||
|
||||
- _ref: deployment/aws-lambda.yaml
|
||||
- _ref: deployment/docker.yaml
|
||||
- _ref: deployment/netlify.yaml
|
||||
- _ref: deployment/node-server.yaml
|
||||
|
||||
- _ref: users/users-introduction.yaml
|
||||
- _ref: users/openid-connect.yaml
|
||||
- _ref: users/login-and-logout.yaml
|
||||
- _ref: users/protected-pages.yaml
|
||||
- _ref: users/user-object.yaml
|
||||
- _ref: users/roles.yaml
|
||||
# - _ref: users/openid-connect.yaml
|
||||
# - _ref: users/login-and-logout.yaml
|
||||
# - _ref: users/protected-pages.yaml
|
||||
# - _ref: users/user-object.yaml
|
||||
# - _ref: users/roles.yaml
|
||||
|
||||
- _ref: blocks/input/AutoComplete.yaml
|
||||
- _ref: blocks/input/ButtonSelector.yaml
|
||||
@ -65,7 +64,7 @@
|
||||
- _ref: blocks/input/PasswordInput.yaml
|
||||
- _ref: blocks/input/RadioSelector.yaml
|
||||
- _ref: blocks/input/RatingSlider.yaml
|
||||
# - _ref: blocks/input/S3UploadButton.yaml # TODO: Add with custom plugin
|
||||
# - _ref: blocks/input/S3UploadButton.yaml # TODO: Add with @lowdefy/plugin-aws
|
||||
- _ref: blocks/input/Selector.yaml
|
||||
- _ref: blocks/input/Switch.yaml
|
||||
- _ref: blocks/input/TextArea.yaml
|
||||
@ -141,20 +140,19 @@
|
||||
- _ref: connections/SQLite.yaml
|
||||
- _ref: connections/Stripe.yaml
|
||||
|
||||
- _ref: actions/Break.yaml
|
||||
- _ref: actions/CallMethod.yaml
|
||||
# - _ref: actions/JsAction.yaml
|
||||
- _ref: actions/DisplayMessage.yaml
|
||||
- _ref: actions/Fetch.yaml
|
||||
- _ref: actions/Link.yaml
|
||||
- _ref: actions/Login.yaml
|
||||
- _ref: actions/Logout.yaml
|
||||
- _ref: actions/Message.yaml
|
||||
- _ref: actions/Notification.yaml
|
||||
- _ref: actions/Request.yaml
|
||||
- _ref: actions/Reset.yaml
|
||||
- _ref: actions/ResetValidation.yaml
|
||||
- _ref: actions/ScrollTo.yaml
|
||||
- _ref: actions/SetGlobal.yaml
|
||||
- _ref: actions/SetState.yaml
|
||||
- _ref: actions/Throw.yaml
|
||||
- _ref: actions/Validate.yaml
|
||||
- _ref: actions/Wait.yaml
|
||||
|
||||
@ -169,7 +167,7 @@
|
||||
- _ref: operators/_divide.yaml
|
||||
- _ref: operators/_eq.yaml
|
||||
- _ref: operators/_event.yaml
|
||||
- _ref: operators/_format.yaml
|
||||
# - _ref: operators/_format.yaml
|
||||
- _ref: operators/_function.yaml
|
||||
- _ref: operators/_get.yaml
|
||||
- _ref: operators/_global.yaml
|
||||
|
17
packages/docs/templates/blocks/template.yaml.njk
vendored
17
packages/docs/templates/blocks/template.yaml.njk
vendored
@ -18,15 +18,18 @@ requests:
|
||||
- id: post_telemetry
|
||||
type: AxiosHttp
|
||||
connectionId: lowdefy_api_telemetry
|
||||
payload:
|
||||
session_id:
|
||||
_global: session_id
|
||||
page_id: {{ block_type }}
|
||||
url_query:
|
||||
_url_query: true
|
||||
input:
|
||||
_input: true
|
||||
properties:
|
||||
data:
|
||||
session_id:
|
||||
_global: session_id
|
||||
page_id: {{ block_type }}
|
||||
url_query:
|
||||
_url_query: true
|
||||
input:
|
||||
_input: true
|
||||
_payload: true
|
||||
|
||||
|
||||
events:
|
||||
onInit:
|
||||
|
18
packages/docs/templates/blog.yaml.njk
vendored
18
packages/docs/templates/blog.yaml.njk
vendored
@ -18,16 +18,18 @@ requests:
|
||||
- id: post_telemetry
|
||||
type: AxiosHttp
|
||||
connectionId: lowdefy_api_telemetry
|
||||
payload:
|
||||
session_id:
|
||||
_global: session_id
|
||||
page_id:
|
||||
_var: pageId
|
||||
url_query:
|
||||
_url_query: true
|
||||
input:
|
||||
_input: true
|
||||
properties:
|
||||
data:
|
||||
session_id:
|
||||
_global: session_id
|
||||
page_id:
|
||||
_var: pageId
|
||||
url_query:
|
||||
_url_query: true
|
||||
input:
|
||||
_input: true
|
||||
_payload: true
|
||||
|
||||
events:
|
||||
onInit:
|
||||
|
48
packages/docs/templates/footer.yaml.njk
vendored
48
packages/docs/templates/footer.yaml.njk
vendored
@ -187,28 +187,32 @@
|
||||
- id: lowdefy_api_feedback
|
||||
type: AxiosHttp
|
||||
connectionId: lowdefy_api_marketing
|
||||
payload:
|
||||
text:
|
||||
_state: feedback.text
|
||||
score:
|
||||
_state: feedback.score
|
||||
email:
|
||||
_state: feedback.email
|
||||
source: docs
|
||||
type: Docs feedback
|
||||
page_id:
|
||||
_var: pageId
|
||||
properties:
|
||||
data:
|
||||
text:
|
||||
_state: feedback.text
|
||||
score:
|
||||
_state: feedback.score
|
||||
email:
|
||||
_state: feedback.email
|
||||
source: docs
|
||||
type: Docs feedback
|
||||
page_id:
|
||||
_var: pageId
|
||||
_payload: true
|
||||
- id: discord_channel_feedback
|
||||
type: AxiosHttp
|
||||
connectionId: discord_channel
|
||||
payload:
|
||||
content:
|
||||
_nunjucks:
|
||||
template: 'Docs feedback: {{ text }}'
|
||||
on:
|
||||
_state: feedback
|
||||
properties:
|
||||
data:
|
||||
content:
|
||||
_nunjucks:
|
||||
template: 'Docs feedback: {{ text }}'
|
||||
on:
|
||||
_state: feedback
|
||||
_payload: true
|
||||
layout:
|
||||
size: auto
|
||||
properties:
|
||||
@ -422,14 +426,16 @@
|
||||
- id: lowdefy_api_subscribe
|
||||
type: AxiosHttp
|
||||
connectionId: lowdefy_api_marketing
|
||||
payload:
|
||||
type: Newsletter subscription
|
||||
email:
|
||||
_state: footer_cta_input
|
||||
source: docs
|
||||
page_id:
|
||||
_var: pageId
|
||||
properties:
|
||||
data:
|
||||
type: Newsletter subscription
|
||||
email:
|
||||
_state: footer_cta_input
|
||||
source: docs
|
||||
page_id:
|
||||
_var: pageId
|
||||
_payload: true
|
||||
- id: discord_channel_subscribe
|
||||
type: AxiosHttp
|
||||
connectionId: discord_channel
|
||||
|
19
packages/docs/templates/general.yaml.njk
vendored
19
packages/docs/templates/general.yaml.njk
vendored
@ -18,16 +18,18 @@ requests:
|
||||
- id: post_telemetry
|
||||
type: AxiosHttp
|
||||
connectionId: lowdefy_api_telemetry
|
||||
payload:
|
||||
session_id:
|
||||
_global: session_id
|
||||
page_id:
|
||||
_var: pageId
|
||||
url_query:
|
||||
_url_query: true
|
||||
input:
|
||||
_input: true
|
||||
properties:
|
||||
data:
|
||||
session_id:
|
||||
_global: session_id
|
||||
page_id:
|
||||
_var: pageId
|
||||
url_query:
|
||||
_url_query: true
|
||||
input:
|
||||
_input: true
|
||||
_payload: true
|
||||
|
||||
events:
|
||||
onInit:
|
||||
@ -54,6 +56,7 @@ events:
|
||||
error: false
|
||||
params: post_telemetry
|
||||
|
||||
|
||||
properties:
|
||||
title: {{ pageTitle }}
|
||||
header:
|
||||
|
@ -62,9 +62,9 @@ _ref:
|
||||
|
||||
Choose the following:
|
||||
- **Which API are you using?**: Google Sheets API
|
||||
- **Where will you be calling the API from?** : Web server (e.g. node.js, Tomcat)
|
||||
- **What data will you be accessing?**: Application data
|
||||
- **Are you planning to use this API with App Engine or Compute Engine?**: No, I'm not using them
|
||||
- **Where will you be calling the API from?** : Web server (e.g. node.js, Tomcat)
|
||||
|
||||
Then click "What credentials do I need?"
|
||||
|
||||
@ -72,7 +72,7 @@ _ref:
|
||||
|
||||
Choose the following:
|
||||
- Give the account a name.
|
||||
- Chose "Project > Editor" as the role.
|
||||
- Choose "Project > Editor" as the role.
|
||||
- Choose JSON as the key type.
|
||||
|
||||
Click continue.
|
||||
|
@ -22,261 +22,266 @@ _ref:
|
||||
prefetchPages:
|
||||
- tutorial-create-page
|
||||
content:
|
||||
- id: tutorial_video
|
||||
type: DangerousMarkdown
|
||||
properties:
|
||||
DOMPurifyOptions:
|
||||
ADD_TAGS:
|
||||
- iframe
|
||||
ADD_ATTR:
|
||||
- allowfullscreen
|
||||
- allow
|
||||
- frameborder
|
||||
content: |
|
||||
<iframe
|
||||
width="800"
|
||||
height="470"
|
||||
src="https://www.youtube.com/embed/Cd4Xxxisykg" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
|
||||
</iframe>
|
||||
- id: body_start
|
||||
- id: body_todo
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
In this tutorial, we will be creating a simple ticketing app, that allows users to file new tickets and see a list of outstanding tickets. The app will write the ticket data to Google Sheets, and we will deploy the app using [Netlify](https://www.netlify.com).
|
||||
##### TODO: The tutorial will be revised for Lowdefy v4.
|
||||
|
||||
### Requirements
|
||||
# - id: tutorial_video
|
||||
# type: DangerousMarkdown
|
||||
# properties:
|
||||
# DOMPurifyOptions:
|
||||
# ADD_TAGS:
|
||||
# - iframe
|
||||
# ADD_ATTR:
|
||||
# - allowfullscreen
|
||||
# - allow
|
||||
# - frameborder
|
||||
# content: |
|
||||
# <iframe
|
||||
# width="800"
|
||||
# height="470"
|
||||
# src="https://www.youtube.com/embed/Cd4Xxxisykg" frameborder="0"
|
||||
# allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
|
||||
# </iframe>
|
||||
# - id: body_start
|
||||
# type: MarkdownWithCode
|
||||
# properties:
|
||||
# content: |
|
||||
# In this tutorial, we will be creating a simple ticketing app, that allows users to file new tickets and see a list of outstanding tickets. The app will write the ticket data to Google Sheets, and we will deploy the app using [Netlify](https://www.netlify.com).
|
||||
|
||||
The Lowdefy CLI (Command Line Interface) is needed to run the development server. To run the Lowdefy CLI you need to install Node.js at version 12 or greater. If you don't have it installed, download Node.js from https://nodejs.org/en/download/, and follow the installation steps for your computer. All of the default settings given by the installer are fine for what we need. You will also need a text editor to modify the Lowdefy configuration files.
|
||||
# ### Requirements
|
||||
|
||||
#### Step 1.1 - Create a project directory
|
||||
# The Lowdefy CLI (Command Line Interface) is needed to run the development server. To run the Lowdefy CLI you need to install Node.js at version 12 or greater. If you don't have it installed, download Node.js from https://nodejs.org/en/download/, and follow the installation steps for your computer. All of the default settings given by the installer are fine for what we need. You will also need a text editor to modify the Lowdefy configuration files.
|
||||
|
||||
Create a directory (folder) on your computer where you would like to create the configuration files for your project. We will be referring to this directory as the project directory
|
||||
# #### Step 1.1 - Create a project directory
|
||||
|
||||
#### Step 1.2 - Open a command line interface
|
||||
# Create a directory (folder) on your computer where you would like to create the configuration files for your project. We will be referring to this directory as the project directory
|
||||
|
||||
Open your computer's command line interface (Windows CMD, Terminal on MacOS), and change directory (`cd`) to the project directory.
|
||||
# #### Step 1.2 - Open a command line interface
|
||||
|
||||
#### Step 1.3 - Initialize an app
|
||||
# Open your computer's command line interface (Windows CMD, Terminal on MacOS), and change directory (`cd`) to the project directory.
|
||||
|
||||
Use the Lowdefy CLI to initialize your project.
|
||||
# #### Step 1.3 - Initialize an app
|
||||
|
||||
Run the following in your terminal:
|
||||
# Use the Lowdefy CLI to initialize your project.
|
||||
|
||||
- _ref:
|
||||
path: templates/cli_command.yaml.njk
|
||||
vars:
|
||||
id: init
|
||||
command: 'npx lowdefy@latest init'
|
||||
# Run the following in your terminal:
|
||||
|
||||
- id: body_init
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
This will create two files in your current working directory. The first file, called `lowdefy.yaml` is the starting point of your app's configuration. The second, called `.gitignore`, is a hidden file that tells `git`, a version control tool, not to version or upload some specific files.
|
||||
# - _ref:
|
||||
# path: templates/cli_command.yaml.njk
|
||||
# vars:
|
||||
# id: init
|
||||
# command: 'npx lowdefy@latest init'
|
||||
|
||||
> We recommend using [`npx`](https://docs.npmjs.com/cli/v7/commands/npx) to run the Lowdefy CLI, since this ensures your are always running the latest version. You can also install the CLI globally or locally using `npm install lowdefy`
|
||||
# - id: body_init
|
||||
# type: MarkdownWithCode
|
||||
# properties:
|
||||
# content: |
|
||||
# This will create two files in your current working directory. The first file, called `lowdefy.yaml` is the starting point of your app's configuration. The second, called `.gitignore`, is a hidden file that tells `git`, a version control tool, not to version or upload some specific files.
|
||||
|
||||
- id: info_windows_paste
|
||||
type: Alert
|
||||
properties:
|
||||
type: info
|
||||
icon: AiFillInfoCircle
|
||||
description: To paste into the Windows Command Prompt, you can right-click and select paste.
|
||||
# > We recommend using [`npx`](https://docs.npmjs.com/cli/v7/commands/npx) to run the Lowdefy CLI, since this ensures your are always running the latest version. You can also install the CLI globally or locally using `npm install lowdefy`
|
||||
|
||||
- id: error_already_exists
|
||||
type: Alert
|
||||
properties:
|
||||
type: error
|
||||
icon: AiOutlineFire
|
||||
message: A "lowdefy.yaml" file already exists
|
||||
description: If you get a 'A "lowdefy.yaml" file already exists' error, delete the "lowdefy.yaml" file in your current working directory or run the command in a new directory.
|
||||
# - id: info_windows_paste
|
||||
# type: Alert
|
||||
# properties:
|
||||
# type: info
|
||||
# icon: AiFillInfoCircle
|
||||
# description: To paste into the Windows Command Prompt, you can right-click and select paste.
|
||||
|
||||
- id: body_start_dev
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
#### Step 1.4 - Start the development server.
|
||||
# - id: error_already_exists
|
||||
# type: Alert
|
||||
# properties:
|
||||
# type: error
|
||||
# icon: AiOutlineFire
|
||||
# message: A "lowdefy.yaml" file already exists
|
||||
# description: If you get a 'A "lowdefy.yaml" file already exists' error, delete the "lowdefy.yaml" file in your current working directory or run the command in a new directory.
|
||||
|
||||
Run:
|
||||
# - id: body_start_dev
|
||||
# type: MarkdownWithCode
|
||||
# properties:
|
||||
# content: |
|
||||
# #### Step 1.4 - Start the development server.
|
||||
|
||||
- _ref:
|
||||
path: templates/cli_command.yaml.njk
|
||||
vars:
|
||||
id: dev
|
||||
command: 'npx lowdefy@latest dev'
|
||||
# Run:
|
||||
|
||||
- id: body_open_browser
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
Your browser should open on http://localhost:3000, and you should see the following:
|
||||
# - _ref:
|
||||
# path: templates/cli_command.yaml.njk
|
||||
# vars:
|
||||
# id: dev
|
||||
# command: 'npx lowdefy@latest dev'
|
||||
|
||||
- id: example1
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
style:
|
||||
minHeight: 300px
|
||||
menu:
|
||||
links:
|
||||
- id: welcome
|
||||
type: MenuLink
|
||||
properties:
|
||||
title: welcome
|
||||
# - id: body_open_browser
|
||||
# type: MarkdownWithCode
|
||||
# properties:
|
||||
# content: |
|
||||
# Your browser should open on http://localhost:3000, and you should see the following:
|
||||
|
||||
blocks:
|
||||
- id: content_card
|
||||
type: Card
|
||||
areas:
|
||||
content:
|
||||
blocks:
|
||||
- id: content
|
||||
type: Result
|
||||
properties:
|
||||
title: Welcome to your Lowdefy app
|
||||
subTitle: We are excited to see what you are going to build
|
||||
status: success
|
||||
icon:
|
||||
name: AiOutlineHeart
|
||||
color: '#f00'
|
||||
areas:
|
||||
extra:
|
||||
blocks:
|
||||
- id: docs_button
|
||||
type: Button
|
||||
properties:
|
||||
size: large
|
||||
title: Let's build something
|
||||
events:
|
||||
onClick:
|
||||
- id: link_to_docs
|
||||
type: Link
|
||||
params:
|
||||
url: https://docs.lowdefy.com
|
||||
newTab: true
|
||||
footer:
|
||||
blocks:
|
||||
- id: footer
|
||||
type: Paragraph
|
||||
properties:
|
||||
type: secondary
|
||||
content: |
|
||||
Made by a Lowdefy 🤖
|
||||
# - id: example1
|
||||
# type: PageHeaderMenu
|
||||
# properties:
|
||||
# style:
|
||||
# minHeight: 300px
|
||||
# menu:
|
||||
# links:
|
||||
# - id: welcome
|
||||
# type: MenuLink
|
||||
# properties:
|
||||
# title: welcome
|
||||
|
||||
- id: error_could_not_find
|
||||
type: Alert
|
||||
properties:
|
||||
type: error
|
||||
icon: AiOutlineFire
|
||||
message: Could not find "lowdefy.yaml"
|
||||
description: If you get a 'Could not find "lowdefy.yaml"' error, make sure your current working directory contains the "lowdefy.yaml" file. You can verify this by running the "dir" (Windows) or "ls" (MacOS) command.
|
||||
# blocks:
|
||||
# - id: content_card
|
||||
# type: Card
|
||||
# areas:
|
||||
# content:
|
||||
# blocks:
|
||||
# - id: content
|
||||
# type: Result
|
||||
# properties:
|
||||
# title: Welcome to your Lowdefy app
|
||||
# subTitle: We are excited to see what you are going to build
|
||||
# status: success
|
||||
# icon:
|
||||
# name: AiOutlineHeart
|
||||
# color: '#f00'
|
||||
# areas:
|
||||
# extra:
|
||||
# blocks:
|
||||
# - id: docs_button
|
||||
# type: Button
|
||||
# properties:
|
||||
# size: large
|
||||
# title: Let's build something
|
||||
# events:
|
||||
# onClick:
|
||||
# - id: link_to_docs
|
||||
# type: Link
|
||||
# params:
|
||||
# url: https://docs.lowdefy.com
|
||||
# newTab: true
|
||||
# footer:
|
||||
# blocks:
|
||||
# - id: footer
|
||||
# type: Paragraph
|
||||
# properties:
|
||||
# type: secondary
|
||||
# content: |
|
||||
# Made by a Lowdefy 🤖
|
||||
|
||||
- id: body_edit
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
#### Step 1.5 - Open the configuration file
|
||||
# - id: error_could_not_find
|
||||
# type: Alert
|
||||
# properties:
|
||||
# type: error
|
||||
# icon: AiOutlineFire
|
||||
# message: Could not find "lowdefy.yaml"
|
||||
# description: If you get a 'Could not find "lowdefy.yaml"' error, make sure your current working directory contains the "lowdefy.yaml" file. You can verify this by running the "dir" (Windows) or "ls" (MacOS) command.
|
||||
|
||||
Open the `lowdefy.yaml` file using a text editor like [VS Code](https://code.visualstudio.com/download). The content of the file should look like this:
|
||||
# - id: body_edit
|
||||
# type: MarkdownWithCode
|
||||
# properties:
|
||||
# content: |
|
||||
# #### Step 1.5 - Open the configuration file
|
||||
|
||||
```yaml
|
||||
lowdefy: 3.23.2
|
||||
name: Lowdefy starter
|
||||
# Open the `lowdefy.yaml` file using a text editor like [VS Code](https://code.visualstudio.com/download). The content of the file should look like this:
|
||||
|
||||
pages:
|
||||
- id: welcome
|
||||
type: PageHeaderMenu
|
||||
properties:
|
||||
title: Welcome
|
||||
areas:
|
||||
content:
|
||||
justify: center
|
||||
blocks:
|
||||
- id: content_card
|
||||
type: Card
|
||||
style:
|
||||
maxWidth: 800
|
||||
blocks:
|
||||
- id: content
|
||||
type: Result
|
||||
properties:
|
||||
title: Welcome to your Lowdefy app
|
||||
subTitle: We are excited to see what you are going to build
|
||||
icon:
|
||||
name: AiOutlineHeart
|
||||
color: '#f00'
|
||||
areas:
|
||||
extra:
|
||||
blocks:
|
||||
- id: docs_button
|
||||
type: Button
|
||||
properties:
|
||||
size: large
|
||||
title: Let's build something
|
||||
color: '#1890ff'
|
||||
events:
|
||||
onClick:
|
||||
- id: link_to_docs
|
||||
type: Link
|
||||
params:
|
||||
url: https://docs.lowdefy.com
|
||||
newWindow: true
|
||||
footer:
|
||||
blocks:
|
||||
- id: footer
|
||||
type: Paragraph
|
||||
properties:
|
||||
type: secondary
|
||||
content: |
|
||||
Made by a Lowdefy 🤖
|
||||
```
|
||||
# ```yaml
|
||||
# lowdefy: 3.23.2
|
||||
# name: Lowdefy starter
|
||||
|
||||
This configuration completely describes the app you are running.
|
||||
# pages:
|
||||
# - id: welcome
|
||||
# type: PageHeaderMenu
|
||||
# properties:
|
||||
# title: Welcome
|
||||
# areas:
|
||||
# content:
|
||||
# justify: center
|
||||
# blocks:
|
||||
# - id: content_card
|
||||
# type: Card
|
||||
# style:
|
||||
# maxWidth: 800
|
||||
# blocks:
|
||||
# - id: content
|
||||
# type: Result
|
||||
# properties:
|
||||
# title: Welcome to your Lowdefy app
|
||||
# subTitle: We are excited to see what you are going to build
|
||||
# icon:
|
||||
# name: AiOutlineHeart
|
||||
# color: '#f00'
|
||||
# areas:
|
||||
# extra:
|
||||
# blocks:
|
||||
# - id: docs_button
|
||||
# type: Button
|
||||
# properties:
|
||||
# size: large
|
||||
# title: Let's build something
|
||||
# color: '#1890ff'
|
||||
# events:
|
||||
# onClick:
|
||||
# - id: link_to_docs
|
||||
# type: Link
|
||||
# params:
|
||||
# url: https://docs.lowdefy.com
|
||||
# newWindow: true
|
||||
# footer:
|
||||
# blocks:
|
||||
# - id: footer
|
||||
# type: Paragraph
|
||||
# properties:
|
||||
# type: secondary
|
||||
# content: |
|
||||
# Made by a Lowdefy 🤖
|
||||
# ```
|
||||
|
||||
# This configuration completely describes the app you are running.
|
||||
|
||||
#### Step 1.6 - Make some changes
|
||||
# #### Step 1.6 - Make some changes
|
||||
|
||||
Change some of the text in the app. Change the text `Welcome to your Lowdefy app` to `Hello __YOUR_NAME_HERE__` (filling in your own name). Save the file and browser should automatically refresh, and you should see your changes.
|
||||
# Change some of the text in the app. Change the text `Welcome to your Lowdefy app` to `Hello __YOUR_NAME_HERE__` (filling in your own name). Save the file and browser should automatically refresh, and you should see your changes.
|
||||
|
||||
### YAML Files
|
||||
# ### YAML Files
|
||||
|
||||
Lowdefy apps are written using YAML files. YAML files are useful for storing structured data, like the configuration of all of the elements of your app. YAML files focus on being easily readable by humans, this means they don't use lots of syntactic elements like brackets that make it difficult for humans to read, but instead use __indentation to indicate structure__. While this does make the file easier to read, this means care has to be taken that the data structure is as you intended. If you don't have any experience using YAML, this video is a good introduction.
|
||||
- id: body_yaml_vid
|
||||
type: DangerousMarkdown
|
||||
properties:
|
||||
DOMPurifyOptions:
|
||||
ADD_TAGS:
|
||||
- iframe
|
||||
ADD_ATTR:
|
||||
- allowfullscreen
|
||||
- allow
|
||||
- frameborder
|
||||
content: |
|
||||
<iframe
|
||||
id="ytplayer-yaml-video"
|
||||
type="text/html"
|
||||
width="800"
|
||||
height="470"
|
||||
src="https://www.youtube.com/embed/cdLNKUoMc6c?origin=https://docs.lowdefy.com"
|
||||
allowfullscreen="true"
|
||||
frameborder="0">
|
||||
</iframe>
|
||||
- id: body_what_happened
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
### What happened
|
||||
# Lowdefy apps are written using YAML files. YAML files are useful for storing structured data, like the configuration of all of the elements of your app. YAML files focus on being easily readable by humans, this means they don't use lots of syntactic elements like brackets that make it difficult for humans to read, but instead use __indentation to indicate structure__. While this does make the file easier to read, this means care has to be taken that the data structure is as you intended. If you don't have any experience using YAML, this video is a good introduction.
|
||||
# - id: body_yaml_vid
|
||||
# type: DangerousMarkdown
|
||||
# properties:
|
||||
# DOMPurifyOptions:
|
||||
# ADD_TAGS:
|
||||
# - iframe
|
||||
# ADD_ATTR:
|
||||
# - allowfullscreen
|
||||
# - allow
|
||||
# - frameborder
|
||||
# content: |
|
||||
# <iframe
|
||||
# id="ytplayer-yaml-video"
|
||||
# type="text/html"
|
||||
# width="800"
|
||||
# height="470"
|
||||
# src="https://www.youtube.com/embed/cdLNKUoMc6c?origin=https://docs.lowdefy.com"
|
||||
# allowfullscreen="true"
|
||||
# frameborder="0">
|
||||
# </iframe>
|
||||
# - id: body_what_happened
|
||||
# type: Markdown
|
||||
# properties:
|
||||
# content: |
|
||||
# ### What happened
|
||||
|
||||
The Lowdefy CLI helps you develop a Lowdefy app.
|
||||
# The Lowdefy CLI helps you develop a Lowdefy app.
|
||||
|
||||
We used the `npx lowdefy@latest init` command to initialize a new project. This created all the essential files.
|
||||
# We used the `npx lowdefy@latest init` command to initialize a new project. This created all the essential files.
|
||||
|
||||
We also used the `npx lowdefy@latest dev` command to start a development server. The development server runs a Lowdefy app locally on your computer, which can be accessed at http://localhost:3000. The development server watches your configuration files, and if any of them changes it "builds" (compiles the configuration together for the server to serve) the configuration again and refreshes the browser to show the changes.
|
||||
# We also used the `npx lowdefy@latest dev` command to start a development server. The development server runs a Lowdefy app locally on your computer, which can be accessed at http://localhost:3000. The development server watches your configuration files, and if any of them changes it "builds" (compiles the configuration together for the server to serve) the configuration again and refreshes the browser to show the changes.
|
||||
|
||||
- _ref:
|
||||
path: templates/navigation_buttons.yaml
|
||||
vars:
|
||||
previous_page_title: Introduction
|
||||
previous_page_id: introduction
|
||||
next_page_title: Creating a page
|
||||
next_page_id: tutorial-create-page
|
||||
# - _ref:
|
||||
# path: templates/navigation_buttons.yaml
|
||||
# vars:
|
||||
# previous_page_title: Introduction
|
||||
# previous_page_id: introduction
|
||||
# next_page_title: Creating a page
|
||||
# next_page_id: tutorial-create-page
|
||||
|
@ -24,57 +24,59 @@ _ref:
|
||||
type: Markdown
|
||||
properties:
|
||||
content: |
|
||||
To add user authentication and authorization to a Lowdefy app, you need to do the following:
|
||||
- Configure an OpenID Connect provider
|
||||
- Configure which pages should be public and protected (only available to logged in users).
|
||||
- Add the `Login` and `Logout` actions to your app, to allow users to log in and out.
|
||||
##### TODO: This page needs to be updated.
|
||||
|
||||
Optionally, you can also:
|
||||
- Use role based authorization to make certain pages available only to users with the correct roles.
|
||||
# To add user authentication and authorization to a Lowdefy app, you need to do the following:
|
||||
# - Configure an OpenID Connect provider
|
||||
# - Configure which pages should be public and protected (only available to logged in users).
|
||||
# - Add the `Login` and `Logout` actions to your app, to allow users to log in and out.
|
||||
|
||||
An example app implementing OpenID Connect can be found [here](https://github.com/lowdefy/lowdefy-example-openid-connect).
|
||||
# Optionally, you can also:
|
||||
# - Use role based authorization to make certain pages available only to users with the correct roles.
|
||||
|
||||
- id: jwt_session_warning
|
||||
type: Alert
|
||||
properties:
|
||||
type: warning
|
||||
icon: AiFillWarning
|
||||
message: Stateful JSON Web Tokens are used for authentication
|
||||
description: Lowdefy uses stateful JSON Web Tokens for user authentication, since the Lowdefy server is stateless and does not maintain a database of user sessions. This means that once a token is issued, it is valid until the token expires. Any changes to the user's access will only reflect after the token has expired, and the user obtains (or fails to obtain) a new token from the OpenID Connect provider. We recommend making sure tokens have a relatively short expiry time (the default is 4 hours), and evaluating if the security provided by this system is appropriate for your use case.
|
||||
# An example app implementing OpenID Connect can be found [here](https://github.com/lowdefy/lowdefy-example-openid-connect).
|
||||
|
||||
- id: auth_config
|
||||
type: MarkdownWithCode
|
||||
properties:
|
||||
content: |
|
||||
Most authorization and authentication settings are configured in the `config.auth` object in the Lowdefy configuration. The following config can be set:
|
||||
```yaml
|
||||
lowdefy: 3.23.2
|
||||
config:
|
||||
auth:
|
||||
openId:
|
||||
# The url the user should be redirected to after logout.
|
||||
logoutRedirectUri: [string]
|
||||
# Field in the user idToken that contains the roles array.
|
||||
rolesField: [string]
|
||||
# The OpenID Connect scope to request. The default is 'openid profile email'.
|
||||
scope: [string]
|
||||
jwt:
|
||||
# The length of time a user token should be valid.
|
||||
expiresIn: [string | number]
|
||||
pages:
|
||||
# Either set all pages as protected, or list specific protected pages.
|
||||
protected: [boolean | string[]]
|
||||
# Either set all pages as public, or list specific public pages.
|
||||
public: [boolean | string[]]
|
||||
roles:
|
||||
# Restrict pages to only users with a certain role.
|
||||
{roleName}: string[]
|
||||
```
|
||||
# - id: jwt_session_warning
|
||||
# type: Alert
|
||||
# properties:
|
||||
# type: warning
|
||||
# icon: AiFillWarning
|
||||
# message: Stateful JSON Web Tokens are used for authentication
|
||||
# description: Lowdefy uses stateful JSON Web Tokens for user authentication, since the Lowdefy server is stateless and does not maintain a database of user sessions. This means that once a token is issued, it is valid until the token expires. Any changes to the user's access will only reflect after the token has expired, and the user obtains (or fails to obtain) a new token from the OpenID Connect provider. We recommend making sure tokens have a relatively short expiry time (the default is 4 hours), and evaluating if the security provided by this system is appropriate for your use case.
|
||||
|
||||
- _ref:
|
||||
path: templates/navigation_buttons.yaml
|
||||
vars:
|
||||
previous_page_title: Overview
|
||||
previous_page_id: overview
|
||||
next_page_title: OpenID Connect
|
||||
next_page_id: openid-connect
|
||||
# - id: auth_config
|
||||
# type: MarkdownWithCode
|
||||
# properties:
|
||||
# content: |
|
||||
# Most authorization and authentication settings are configured in the `config.auth` object in the Lowdefy configuration. The following config can be set:
|
||||
# ```yaml
|
||||
# lowdefy: 3.23.2
|
||||
# config:
|
||||
# auth:
|
||||
# openId:
|
||||
# # The url the user should be redirected to after logout.
|
||||
# logoutRedirectUri: [string]
|
||||
# # Field in the user idToken that contains the roles array.
|
||||
# rolesField: [string]
|
||||
# # The OpenID Connect scope to request. The default is 'openid profile email'.
|
||||
# scope: [string]
|
||||
# jwt:
|
||||
# # The length of time a user token should be valid.
|
||||
# expiresIn: [string | number]
|
||||
# pages:
|
||||
# # Either set all pages as protected, or list specific protected pages.
|
||||
# protected: [boolean | string[]]
|
||||
# # Either set all pages as public, or list specific public pages.
|
||||
# public: [boolean | string[]]
|
||||
# roles:
|
||||
# # Restrict pages to only users with a certain role.
|
||||
# {roleName}: string[]
|
||||
# ```
|
||||
|
||||
# - _ref:
|
||||
# path: templates/navigation_buttons.yaml
|
||||
# vars:
|
||||
# previous_page_title: Overview
|
||||
# previous_page_id: overview
|
||||
# next_page_title: OpenID Connect
|
||||
# next_page_id: openid-connect
|
||||
|
@ -1 +1 @@
|
||||
v4.0.0-alpha.21
|
||||
v4.0.0-alpha.22
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/engine
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/engine",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -37,15 +37,15 @@
|
||||
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators": "4.0.0-alpha.21"
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators": "4.0.0-alpha.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "28.1.0",
|
||||
"@lowdefy/actions-core": "4.0.0-alpha.21",
|
||||
"@lowdefy/build": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-js": "4.0.0-alpha.21",
|
||||
"@lowdefy/operators-mql": "4.0.0-alpha.21",
|
||||
"@lowdefy/actions-core": "4.0.0-alpha.22",
|
||||
"@lowdefy/build": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-js": "4.0.0-alpha.22",
|
||||
"@lowdefy/operators-mql": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -1,707 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.20](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.19...v4.0.0-alpha.20) (2022-07-09)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.19](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.18...v4.0.0-alpha.19) (2022-07-06)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.18](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.17...v4.0.0-alpha.18) (2022-06-27)
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.16](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.15...v4.0.0-alpha.16) (2022-06-20)
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.15](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.14...v4.0.0-alpha.15) (2022-06-19)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.17](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.16...v4.0.0-alpha.17) (2022-06-24)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.16](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.15...v4.0.0-alpha.16) (2022-06-20)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.15](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.13...v4.0.0-alpha.15) (2022-06-19)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.14](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.13...v4.0.0-alpha.14) (2022-06-19)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.13](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.12...v4.0.0-alpha.13) (2022-06-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Package updates. ([e024181](https://github.com/lowdefy/lowdefy/commit/e0241813d1276316f0f04897b664c43e24b11d23))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.12](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.11...v4.0.0-alpha.12) (2022-05-23)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.11](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.10...v4.0.0-alpha.11) (2022-05-20)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.10](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.9...v4.0.0-alpha.10) (2022-05-06)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.9](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.8...v4.0.0-alpha.9) (2022-05-06)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.8](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.7...v4.0.0-alpha.8) (2022-03-16)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.7](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.6...v4.0.0-alpha.7) (2022-02-21)
|
||||
|
||||
|
||||
|
||||
## [3.23.2](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.5...v3.23.2) (2021-11-29)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.6](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.5...v4.0.0-alpha.6) (2022-01-20)
|
||||
## [3.23.2](https://github.com/lowdefy/lowdefy/compare/v3.23.1...v3.23.2) (2021-11-29)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.5](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.4...v4.0.0-alpha.5) (2021-11-27)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.4](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.3...v4.0.0-alpha.4) (2021-11-25)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.3](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.2...v4.0.0-alpha.3) (2021-11-25)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.2](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.1...v4.0.0-alpha.2) (2021-11-25)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.1](https://github.com/lowdefy/lowdefy/compare/v3.23.1...v4.0.0-alpha.1) (2021-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Replace all front end testing with @testing-library/react, jest and other updates. ([22ec295](https://github.com/lowdefy/lowdefy/commit/22ec2954047853096aabcddba7a2c509342f95f2))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.23.1](https://github.com/lowdefy/lowdefy/compare/v3.23.0...v3.23.1) (2021-11-20)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.23.0](https://github.com/lowdefy/lowdefy/compare/v3.23.0-alpha.0...v3.23.0) (2021-11-19)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.23.0-alpha.0](https://github.com/lowdefy/lowdefy/compare/v3.22.0...v3.23.0-alpha.0) (2021-11-09)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.22.0](https://github.com/lowdefy/lowdefy/compare/v3.22.0-alpha.1...v3.22.0) (2021-09-27)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.22.0-alpha.1](https://github.com/lowdefy/lowdefy/compare/v3.22.0-alpha.0...v3.22.0-alpha.1) (2021-09-20)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.22.0-alpha.0](https://github.com/lowdefy/lowdefy/compare/v3.21.2...v3.22.0-alpha.0) (2021-09-08)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.21.2](https://github.com/lowdefy/lowdefy/compare/v3.21.2-alpha.0...v3.21.2) (2021-08-31)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.21.2-alpha.0](https://github.com/lowdefy/lowdefy/compare/v3.21.1...v3.21.2-alpha.0) (2021-08-31)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.21.1](https://github.com/lowdefy/lowdefy/compare/v3.21.0...v3.21.1) (2021-08-26)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.21.0](https://github.com/lowdefy/lowdefy/compare/v3.20.4...v3.21.0) (2021-08-25)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.20.4](https://github.com/lowdefy/lowdefy/compare/v3.20.3...v3.20.4) (2021-08-21)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.20.3](https://github.com/lowdefy/lowdefy/compare/v3.20.1...v3.20.3) (2021-08-20)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.20.2](https://github.com/lowdefy/lowdefy/compare/v3.20.1...v3.20.2) (2021-08-20)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.20.1](https://github.com/lowdefy/lowdefy/compare/v3.20.0...v3.20.1) (2021-08-20)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.20.0](https://github.com/lowdefy/lowdefy/compare/v3.19.0...v3.20.0) (2021-08-20)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.19.0](https://github.com/lowdefy/lowdefy/compare/v3.18.1...v3.19.0) (2021-07-26)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.18.1](https://github.com/lowdefy/lowdefy/compare/v3.18.0...v3.18.1) (2021-06-30)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.18.0](https://github.com/lowdefy/lowdefy/compare/v3.17.2...v3.18.0) (2021-06-17)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.17.2](https://github.com/lowdefy/lowdefy/compare/v3.17.1...v3.17.2) (2021-06-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.17.1](https://github.com/lowdefy/lowdefy/compare/v3.17.0...v3.17.1) (2021-06-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.17.0](https://github.com/lowdefy/lowdefy/compare/v3.17.0-alpha.3...v3.17.0) (2021-06-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.17.0-alpha.3](https://github.com/lowdefy/lowdefy/compare/v3.17.0-alpha.2...v3.17.0-alpha.3) (2021-06-09)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.17.0-alpha.2](https://github.com/lowdefy/lowdefy/compare/v3.17.0-alpha.1...v3.17.0-alpha.2) (2021-06-09)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.17.0-alpha.1](https://github.com/lowdefy/lowdefy/compare/v3.17.0-alpha.0...v3.17.0-alpha.1) (2021-06-09)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.17.0-alpha.0](https://github.com/lowdefy/lowdefy/compare/v3.16.5...v3.17.0-alpha.0) (2021-06-09)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.16.5](https://github.com/lowdefy/lowdefy/compare/v3.16.4...v3.16.5) (2021-05-31)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.16.4](https://github.com/lowdefy/lowdefy/compare/v3.16.3...v3.16.4) (2021-05-28)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.16.3](https://github.com/lowdefy/lowdefy/compare/v3.16.2...v3.16.3) (2021-05-27)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.16.2](https://github.com/lowdefy/lowdefy/compare/v3.16.1...v3.16.2) (2021-05-26)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.16.1](https://github.com/lowdefy/lowdefy/compare/v3.16.0...v3.16.1) (2021-05-26)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.16.0](https://github.com/lowdefy/lowdefy/compare/v3.15.0...v3.16.0) (2021-05-26)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.15.0](https://github.com/lowdefy/lowdefy/compare/v3.14.1...v3.15.0) (2021-05-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.14.1](https://github.com/lowdefy/lowdefy/compare/v3.14.0...v3.14.1) (2021-04-28)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.14.0](https://github.com/lowdefy/lowdefy/compare/v3.13.0...v3.14.0) (2021-04-26)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.13.0](https://github.com/lowdefy/lowdefy/compare/v3.12.6...v3.13.0) (2021-04-16)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.12.6](https://github.com/lowdefy/lowdefy/compare/v3.12.5...v3.12.6) (2021-04-06)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.12.5](https://github.com/lowdefy/lowdefy/compare/v3.12.4...v3.12.5) (2021-03-31)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.12.4](https://github.com/lowdefy/lowdefy/compare/v3.12.3...v3.12.4) (2021-03-30)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.12.3](https://github.com/lowdefy/lowdefy/compare/v3.12.2...v3.12.3) (2021-03-26)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.12.2](https://github.com/lowdefy/lowdefy/compare/v3.12.1...v3.12.2) (2021-03-24)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.12.1](https://github.com/lowdefy/lowdefy/compare/v3.12.0...v3.12.1) (2021-03-24)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.12.0](https://github.com/lowdefy/lowdefy/compare/v3.11.4...v3.12.0) (2021-03-24)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.11.4](https://github.com/lowdefy/lowdefy/compare/v3.11.3...v3.11.4) (2021-03-19)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.11.3](https://github.com/lowdefy/lowdefy/compare/v3.11.2...v3.11.3) (2021-03-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.11.2](https://github.com/lowdefy/lowdefy/compare/v3.11.1...v3.11.2) (2021-03-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.11.1](https://github.com/lowdefy/lowdefy/compare/v3.11.0...v3.11.1) (2021-03-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.11.0](https://github.com/lowdefy/lowdefy/compare/v3.10.2...v3.11.0) (2021-03-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.10.2](https://github.com/lowdefy/lowdefy/compare/v3.10.1...v3.10.2) (2021-02-25)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.10.1](https://github.com/lowdefy/lowdefy/compare/v3.10.0...v3.10.1) (2021-02-19)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.10.0](https://github.com/lowdefy/lowdefy/compare/v3.9.0...v3.10.0) (2021-02-17)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.9.0](https://github.com/lowdefy/lowdefy/compare/v3.8.0...v3.9.0) (2021-02-16)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.8.0](https://github.com/lowdefy/lowdefy/compare/v3.7.2...v3.8.0) (2021-02-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **operators:** Add _format operator. ([44839da](https://github.com/lowdefy/lowdefy/commit/44839daf959253660b6d3c97204898cad0e464fb))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.7.2](https://github.com/lowdefy/lowdefy/compare/v3.7.1...v3.7.2) (2021-02-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix package lifecycle scripts. ([af7f3a8](https://github.com/lowdefy/lowdefy/commit/af7f3a8ea29763defb20cfb4f28afba3b56d981c))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.7.1](https://github.com/lowdefy/lowdefy/compare/v3.7.0...v3.7.1) (2021-02-09)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.7.0](https://github.com/lowdefy/lowdefy/compare/v3.6.0...v3.7.0) (2021-02-09)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.6.0](https://github.com/lowdefy/lowdefy/compare/v3.5.0...v3.6.0) (2021-02-05)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.5.0](https://github.com/lowdefy/lowdefy/compare/v3.4.0...v3.5.0) (2021-02-05)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.4.0](https://github.com/lowdefy/lowdefy/compare/v3.3.0...v3.4.0) (2021-01-20)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.3.0](https://github.com/lowdefy/lowdefy/compare/v3.1.1...v3.3.0) (2021-01-18)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.2.0](https://github.com/lowdefy/lowdefy/compare/v3.1.1...v3.2.0) (2021-01-18)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.2](https://github.com/lowdefy/lowdefy/compare/@lowdefy/format@1.1.0...@lowdefy/format@1.1.2) (2020-12-15)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.1](https://github.com/lowdefy/lowdefy/compare/@lowdefy/format@1.1.0...@lowdefy/format@1.1.1) (2020-12-15)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/format
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 1.1.0 (2020-12-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **format:** getFormatter test update ([235d501](https://github.com/lowdefy/lowdefy/commit/235d5010cdd2fdfad3e09f944c98e052fba38ddd))
|
||||
* **graphql:** fix readJsonFile for node 12 ([e43236b](https://github.com/lowdefy/lowdefy/commit/e43236bc1256a867247d8adb38d4d8ad7e700e33))
|
||||
* **tests:** remove full-icu, test on both node 12 and 14 ([cf67d39](https://github.com/lowdefy/lowdefy/commit/cf67d39992bbe9940fe7b95d9bfccd315ee1b42a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **format:** init @lowdefy/format package ([f121e43](https://github.com/lowdefy/lowdefy/commit/f121e43671d2d56c569d8f98da634110f28ab0ad))
|
@ -1,14 +0,0 @@
|
||||
export default {
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
coverageDirectory: 'coverage',
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/', '<rootDir>/src/index.js'],
|
||||
coverageReporters: [['lcov', { projectRoot: '../..' }], 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
transform: {
|
||||
'^.+\\.(t|j)sx?$': ['@swc/jest', { configFile: '../../.swcrc.test' }],
|
||||
},
|
||||
};
|
@ -1,53 +0,0 @@
|
||||
{
|
||||
"name": "@lowdefy/format",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
"keywords": [
|
||||
"lowdefy",
|
||||
"format",
|
||||
"formatter"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/lowdefy/lowdefy/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Sam Tolmay",
|
||||
"url": "https://github.com/SamTolmay"
|
||||
},
|
||||
{
|
||||
"name": "Gerrie van Wyk",
|
||||
"url": "https://github.com/Gervwyk"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/lowdefy/lowdefy.git"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./dist/index.js",
|
||||
"files": [
|
||||
"dist/*"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "yarn swc",
|
||||
"clean": "rm -rf dist",
|
||||
"prepare": "yarn build",
|
||||
"swc": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"moment": "2.29.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
"jest": "28.1.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import intlDateTimeFormat from './intlDateTimeFormat';
|
||||
import intlListFormat from './intlListFormat';
|
||||
import intlNumberFormat from './intlNumberFormat';
|
||||
import intlRelativeTimeFormat from './intlRelativeTimeFormat';
|
||||
import momentFormat from './momentFormat';
|
||||
import momentHumanizeDuration from './momentHumanizeDuration';
|
||||
|
||||
export {
|
||||
intlDateTimeFormat,
|
||||
intlListFormat,
|
||||
intlNumberFormat,
|
||||
intlRelativeTimeFormat,
|
||||
momentFormat,
|
||||
momentHumanizeDuration,
|
||||
};
|
||||
|
||||
export default {
|
||||
intlDateTimeFormat,
|
||||
intlListFormat,
|
||||
intlNumberFormat,
|
||||
intlRelativeTimeFormat,
|
||||
momentFormat,
|
||||
momentHumanizeDuration,
|
||||
};
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
function intlDateTimeFormat({ locale, options } = {}) {
|
||||
const formatter = new Intl.DateTimeFormat(locale, options);
|
||||
return (val) => formatter.format(val);
|
||||
}
|
||||
|
||||
export default intlDateTimeFormat;
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
function intlListFormat({ locale, options } = {}) {
|
||||
const formatter = new Intl.ListFormat(locale, options);
|
||||
return (val) => formatter.format(val);
|
||||
}
|
||||
|
||||
export default intlListFormat;
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
function intlNumberFormat({ locale, options } = {}) {
|
||||
const formatter = new Intl.NumberFormat(locale, options);
|
||||
return (val) => formatter.format(val);
|
||||
}
|
||||
|
||||
export default intlNumberFormat;
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
function intlRelativeTimeFormat({ locale, options, unit }) {
|
||||
const formatter = new Intl.RelativeTimeFormat(locale, options);
|
||||
return (val) => formatter.format(val, unit);
|
||||
}
|
||||
|
||||
export default intlRelativeTimeFormat;
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import moment from 'moment';
|
||||
|
||||
function momentFormat({ locale = 'en', format } = {}) {
|
||||
return (val) => moment(val).locale(locale).format(format);
|
||||
}
|
||||
|
||||
export default momentFormat;
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import moment from 'moment';
|
||||
|
||||
function momentHumanizeDuration({ locale = 'en', withSuffix = false, thresholds } = {}) {
|
||||
return (val) => moment.duration(val).locale(locale).humanize(withSuffix, thresholds);
|
||||
}
|
||||
|
||||
export default momentHumanizeDuration;
|
@ -1,117 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import formatters, {
|
||||
intlDateTimeFormat,
|
||||
intlListFormat,
|
||||
intlNumberFormat,
|
||||
intlRelativeTimeFormat,
|
||||
momentFormat,
|
||||
momentHumanizeDuration,
|
||||
} from '../src/index';
|
||||
|
||||
// test('default formatter', () => {
|
||||
// const formatter = getFormatter();
|
||||
// expect(formatter('string')).toEqual('string');
|
||||
// });
|
||||
|
||||
// test('Invalid formatter name', () => {
|
||||
// expect(() => {
|
||||
// getFormatter('invalid', {});
|
||||
// }).toThrow('Invalid Formatter: "invalid" does not exist');
|
||||
// });
|
||||
|
||||
test('intlDateTimeFormat', () => {
|
||||
let formatter = formatters.intlDateTimeFormat({
|
||||
locale: 'de',
|
||||
options: { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' },
|
||||
});
|
||||
expect(formatter(new Date(1560414023345))).toEqual('Donnerstag, 13. Juni 2019');
|
||||
formatter = intlDateTimeFormat({
|
||||
locale: 'de',
|
||||
options: { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' },
|
||||
});
|
||||
expect(formatter(new Date(1560414023345))).toEqual('Donnerstag, 13. Juni 2019');
|
||||
});
|
||||
|
||||
test('intlListFormat', () => {
|
||||
let formatter = formatters.intlListFormat({
|
||||
locale: 'de',
|
||||
options: { style: 'short', type: 'disjunction' },
|
||||
});
|
||||
expect(formatter(['Motorcycle', 'Bus', 'Car'])).toEqual('Motorcycle, Bus oder Car');
|
||||
formatter = intlListFormat({
|
||||
locale: 'de',
|
||||
options: { style: 'short', type: 'disjunction' },
|
||||
});
|
||||
expect(formatter(['Motorcycle', 'Bus', 'Car'])).toEqual('Motorcycle, Bus oder Car');
|
||||
});
|
||||
|
||||
test('intlNumberFormat', () => {
|
||||
let formatter = formatters.intlNumberFormat({
|
||||
locale: 'de',
|
||||
options: { style: 'currency', currency: 'EUR' },
|
||||
});
|
||||
expect(formatter(12364374.6)).toEqual('12.364.374,60 €');
|
||||
formatter = intlNumberFormat({
|
||||
locale: 'de',
|
||||
options: { style: 'currency', currency: 'EUR' },
|
||||
});
|
||||
expect(formatter(12364374.6)).toEqual('12.364.374,60 €');
|
||||
});
|
||||
|
||||
test('intlRelativeTimeFormat', () => {
|
||||
let formatter = formatters.intlRelativeTimeFormat({
|
||||
locale: 'de',
|
||||
unit: 'days',
|
||||
options: { numeric: 'auto' },
|
||||
});
|
||||
expect(formatter(1)).toEqual('morgen');
|
||||
formatter = intlRelativeTimeFormat({
|
||||
locale: 'de',
|
||||
unit: 'days',
|
||||
options: { numeric: 'auto' },
|
||||
});
|
||||
expect(formatter(1)).toEqual('morgen');
|
||||
});
|
||||
|
||||
test('momentFormat', () => {
|
||||
let formatter = formatters.momentFormat({
|
||||
locale: 'de',
|
||||
format: 'd MMM YYYY',
|
||||
});
|
||||
expect(formatter(new Date(1560414023345))).toEqual('4 Juni 2019');
|
||||
formatter = momentFormat({
|
||||
locale: 'de',
|
||||
format: 'd MMM YYYY',
|
||||
});
|
||||
expect(formatter(new Date(1560414023345))).toEqual('4 Juni 2019');
|
||||
});
|
||||
|
||||
test('momentHumanizeDuration', () => {
|
||||
let formatter = formatters.momentHumanizeDuration({
|
||||
locale: 'fr',
|
||||
withSuffix: true,
|
||||
thresholds: { d: 7, w: 4 },
|
||||
});
|
||||
expect(formatter(604800000)).toEqual('dans une semaine');
|
||||
formatter = formatters.momentHumanizeDuration({
|
||||
locale: 'fr',
|
||||
withSuffix: true,
|
||||
thresholds: { d: 7, w: 4 },
|
||||
});
|
||||
expect(formatter(604800000)).toEqual('dans une semaine');
|
||||
});
|
@ -1,50 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import intlDateTimeFormat from '../src/intlDateTimeFormat';
|
||||
|
||||
test('no options', () => {
|
||||
const formatter = intlDateTimeFormat();
|
||||
expect(formatter(new Date(1560414023345))).toEqual('6/13/2019');
|
||||
});
|
||||
|
||||
test('locales', () => {
|
||||
expect(intlDateTimeFormat({ locale: 'ar-EG' })(new Date(1560414023345))).toEqual('١٣/٦/٢٠١٩');
|
||||
expect(intlDateTimeFormat({ locale: 'ja-JP-u-ca-japanese' })(new Date(1560414023345))).toEqual(
|
||||
'R1/6/13'
|
||||
);
|
||||
});
|
||||
|
||||
test('options', () => {
|
||||
expect(
|
||||
intlDateTimeFormat({
|
||||
locale: 'en',
|
||||
options: { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' },
|
||||
})(new Date(1560414023345))
|
||||
).toEqual('Thursday, June 13, 2019');
|
||||
expect(
|
||||
intlDateTimeFormat({
|
||||
locale: 'en',
|
||||
options: {
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
timeZone: 'Australia/Sydney',
|
||||
timeZoneName: 'short',
|
||||
},
|
||||
})(new Date(1560414023345))
|
||||
).toEqual('6:20:23 PM GMT+10');
|
||||
});
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import intlListFormat from '../src/intlListFormat';
|
||||
|
||||
test('no options', () => {
|
||||
expect(intlListFormat()(['Motorcycle', 'Bus', 'Car'])).toEqual('Motorcycle, Bus, and Car');
|
||||
});
|
||||
|
||||
test('locales', () => {
|
||||
expect(intlListFormat({ locale: 'fr' })(['Motorcycle', 'Bus', 'Car'])).toEqual(
|
||||
'Motorcycle, Bus et Car'
|
||||
);
|
||||
expect(intlListFormat({ locale: 'de' })(['Motorcycle', 'Bus', 'Car'])).toEqual(
|
||||
'Motorcycle, Bus und Car'
|
||||
);
|
||||
expect(intlListFormat({ locale: 'ja' })(['Motorcycle', 'Bus', 'Car'])).toEqual(
|
||||
'Motorcycle、Bus、Car'
|
||||
);
|
||||
});
|
||||
|
||||
test('options', () => {
|
||||
expect(
|
||||
intlListFormat({
|
||||
locale: 'en',
|
||||
options: { style: 'long', type: 'conjunction' },
|
||||
})(['Motorcycle', 'Bus', 'Car'])
|
||||
).toEqual('Motorcycle, Bus, and Car');
|
||||
expect(
|
||||
intlListFormat({
|
||||
locale: 'de',
|
||||
options: { style: 'short', type: 'disjunction' },
|
||||
})(['Motorcycle', 'Bus', 'Car'])
|
||||
).toEqual('Motorcycle, Bus oder Car');
|
||||
expect(
|
||||
intlListFormat({
|
||||
locale: 'en',
|
||||
options: { style: 'narrow', type: 'unit' },
|
||||
})(['Motorcycle', 'Bus', 'Car'])
|
||||
).toEqual('Motorcycle Bus Car');
|
||||
});
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import intlNumberFormat from '../src/intlNumberFormat';
|
||||
|
||||
test('no options', () => {
|
||||
expect(intlNumberFormat()(1)).toEqual('1');
|
||||
expect(intlNumberFormat()(1.23)).toEqual('1.23');
|
||||
expect(intlNumberFormat()(1000000)).toEqual('1,000,000');
|
||||
expect(intlNumberFormat()(13182375813.47422)).toEqual('13,182,375,813.474');
|
||||
});
|
||||
|
||||
test('locales', () => {
|
||||
expect(intlNumberFormat({ locale: 'en-IN' })(13182375813.47422)).toEqual('13,18,23,75,813.474');
|
||||
expect(intlNumberFormat({ locale: 'de' })(13182375813.47422)).toEqual('13.182.375.813,474');
|
||||
expect(intlNumberFormat({ locale: 'ar-EG' })(13182375813.47422)).toEqual('١٣٬١٨٢٬٣٧٥٬٨١٣٫٤٧٤');
|
||||
});
|
||||
|
||||
test('options', () => {
|
||||
expect(
|
||||
intlNumberFormat({
|
||||
locale: 'ja-JP',
|
||||
options: { style: 'currency', currency: 'JPY' },
|
||||
})(12364374.6)
|
||||
).toEqual('¥12,364,375');
|
||||
expect(
|
||||
intlNumberFormat({
|
||||
locale: 'en-ZA',
|
||||
options: { style: 'currency', currency: 'ZAR' },
|
||||
})(12364374.6)
|
||||
).toEqual('R 12 364 374,60');
|
||||
expect(
|
||||
intlNumberFormat({
|
||||
locale: 'de-DE',
|
||||
options: { style: 'currency', currency: 'EUR' },
|
||||
})(12364374.6)
|
||||
).toEqual('12.364.374,60 €');
|
||||
expect(
|
||||
intlNumberFormat({
|
||||
locale: 'pt-PT',
|
||||
options: { style: 'unit', unit: 'mile-per-hour' },
|
||||
})(12364374.6)
|
||||
).toEqual('12 364 374,6 mi/h');
|
||||
expect(
|
||||
intlNumberFormat({
|
||||
locale: 'en-GB',
|
||||
options: {
|
||||
style: 'unit',
|
||||
unit: 'liter',
|
||||
unitDisplay: 'long',
|
||||
},
|
||||
})(12364374.6)
|
||||
).toEqual('12,364,374.6 litres');
|
||||
});
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import intlRelativeTimeFormat from '../src/intlRelativeTimeFormat';
|
||||
|
||||
test('only unit specified', () => {
|
||||
expect(intlRelativeTimeFormat({ unit: 'days' })(4)).toEqual('in 4 days');
|
||||
expect(intlRelativeTimeFormat({ unit: 'days' })(-4)).toEqual('4 days ago');
|
||||
});
|
||||
|
||||
test('locales', () => {
|
||||
expect(intlRelativeTimeFormat({ unit: 'days', locale: 'fr' })(4)).toEqual('dans 4 jours');
|
||||
});
|
||||
|
||||
test('options', () => {
|
||||
expect(intlRelativeTimeFormat({ unit: 'days', options: { numeric: 'auto' } })(1)).toEqual(
|
||||
'tomorrow'
|
||||
);
|
||||
});
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import momentFormat from '../src/momentFormat';
|
||||
|
||||
// FIXME: Fails if run in a different timezone/locale
|
||||
test('no options', () => {
|
||||
expect(momentFormat()(new Date(1560414023345))).toEqual('2019-06-13T10:20:23+02:00');
|
||||
expect(momentFormat({})(new Date(1560414023345))).toEqual('2019-06-13T10:20:23+02:00');
|
||||
});
|
||||
|
||||
test('locales', () => {
|
||||
expect(momentFormat({ locale: 'ar-EG' })(new Date(1560414023345))).toEqual(
|
||||
'٢٠١٩-٠٦-١٣T١٠:٢٠:٢٣+٠٢:٠٠'
|
||||
);
|
||||
});
|
||||
|
||||
test('specify format', () => {
|
||||
expect(
|
||||
momentFormat({
|
||||
format: 'd MMM YYYY',
|
||||
})(new Date(1560414023345))
|
||||
).toEqual('4 Jun 2019');
|
||||
});
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2022 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import momentHumanizeDuration from '../src/momentHumanizeDuration';
|
||||
|
||||
test('no options', () => {
|
||||
expect(momentHumanizeDuration()(245923000)).toEqual('3 days');
|
||||
expect(momentHumanizeDuration({})(245923000)).toEqual('3 days');
|
||||
});
|
||||
|
||||
test('locales', () => {
|
||||
expect(momentHumanizeDuration({ locale: 'ar-EG' })(245923000)).toEqual('٣ أيام');
|
||||
});
|
||||
|
||||
test('withSuffix', () => {
|
||||
expect(
|
||||
momentHumanizeDuration({
|
||||
withSuffix: true,
|
||||
})(245923000)
|
||||
).toEqual('in 3 days');
|
||||
expect(
|
||||
momentHumanizeDuration({
|
||||
withSuffix: true,
|
||||
})(-245923000)
|
||||
).toEqual('3 days ago');
|
||||
});
|
||||
|
||||
test('thresholds', () => {
|
||||
expect(momentHumanizeDuration({})(604800000)).toEqual('7 days');
|
||||
expect(
|
||||
momentHumanizeDuration({
|
||||
thresholds: { d: 7, w: 4 },
|
||||
})(604800000)
|
||||
).toEqual('a week');
|
||||
});
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/layout
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/layout
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/layout",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -42,16 +42,16 @@
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"antd": "4.20.7",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.22",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/operators
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/operators",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -42,7 +42,7 @@
|
||||
"test:watch": "jest --coverage --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21"
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@swc/cli": "0.1.57",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/actions-core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/actions-core
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/actions-core",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -46,7 +46,7 @@
|
||||
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21"
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "28.1.0",
|
||||
|
@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **blocks-aggrid:** Fix typo 😱 ([21eef06](https://github.com/lowdefy/lowdefy/commit/21eef065d00eb1f7e7e9c2d0b180c49848dbec2e))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/blocks-aggrid",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "AgGrid Blocks for Lowdefy.",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -54,15 +54,15 @@
|
||||
"@ag-grid-community/all-modules": "27.3.0",
|
||||
"@ag-grid-community/core": "27.3.0",
|
||||
"@ag-grid-community/react": "27.3.0",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.22",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-antd
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-antd
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/blocks-antd",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Lowdefy Ant Design Blocks",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -52,8 +52,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "4.7.0",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"antd": "4.20.7",
|
||||
"classnames": "2.3.1",
|
||||
"moment": "2.29.4",
|
||||
@ -64,9 +64,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/node-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.22",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@lowdefy/node-utils": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-basic
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-basic
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/blocks-basic",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Basic html Lowdefy blocks.",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -49,16 +49,16 @@
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"dompurify": "2.3.8",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.22",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-color-selectors
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-color-selectors
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/blocks-color-selectors",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "A Lowdefy color selector blocks based on react-color.",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -51,8 +51,8 @@
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/blocks-antd": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"@lowdefy/blocks-antd": "4.0.0-alpha.22",
|
||||
"classnames": "2.3.1",
|
||||
"react": "18.1.0",
|
||||
"react-colorful": "5.5.1",
|
||||
@ -60,8 +60,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.22",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-echarts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-echarts
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/blocks-echarts",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "ECharts Blocks for Lowdefy.",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -51,7 +51,7 @@
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"echarts": "5.3.2",
|
||||
"echarts-for-react": "3.0.2",
|
||||
"react": "18.1.0",
|
||||
@ -59,8 +59,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.22",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-google-maps
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-google-maps
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/blocks-google-maps",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Google Maps Blocks for Lowdefy.",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -43,15 +43,15 @@
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"@react-google-maps/api": "2.12.0",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.22",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-loaders
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-loaders
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/blocks-loaders",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Lowdefy loader blocks.",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -49,15 +49,15 @@
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.22",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/blocks-markdown
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/blocks-markdown",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Lowdefy markdown blocks.",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -47,7 +47,7 @@
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.22",
|
||||
"dompurify": "2.3.8",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0",
|
||||
@ -58,8 +58,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/jest": "11.9.1",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.21",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.21",
|
||||
"@lowdefy/block-dev": "4.0.0-alpha.22",
|
||||
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/connection-axios-http
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/connection-axios-http
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/connection-axios-http",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -42,11 +42,11 @@
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"axios": "0.27.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lowdefy/ajv": "4.0.0-alpha.21",
|
||||
"@lowdefy/ajv": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/connection-elasticsearch
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/connection-elasticsearch
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/connection-elasticsearch",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -43,10 +43,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@elastic/elasticsearch": "7.16.0",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21"
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lowdefy/ajv": "4.0.0-alpha.21",
|
||||
"@lowdefy/ajv": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [4.0.0-alpha.22](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2022-07-12)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/connection-google-sheets
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0-alpha.21](https://github.com/lowdefy/lowdefy/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2022-07-11)
|
||||
|
||||
**Note:** Version bump only for package @lowdefy/connection-google-sheets
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lowdefy/connection-google-sheets",
|
||||
"version": "4.0.0-alpha.21",
|
||||
"version": "4.0.0-alpha.22",
|
||||
"license": "Apache-2.0",
|
||||
"description": "",
|
||||
"homepage": "https://lowdefy.com",
|
||||
@ -42,13 +42,13 @@
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lowdefy/helpers": "4.0.0-alpha.21",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.22",
|
||||
"google-spreadsheet": "3.3.0",
|
||||
"mingo": "6.0.6",
|
||||
"moment": "2.29.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lowdefy/ajv": "4.0.0-alpha.21",
|
||||
"@lowdefy/ajv": "4.0.0-alpha.22",
|
||||
"@swc/cli": "0.1.57",
|
||||
"@swc/core": "1.2.194",
|
||||
"@swc/jest": "0.2.21",
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user