@lowdefy/blocks-basic 3.23.3 → 4.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/Anchor/Anchor.js +66 -0
- package/dist/blocks/Anchor/schema.json +96 -0
- package/dist/blocks/Box/Box.js +39 -0
- package/dist/blocks/Box/schema.json +30 -0
- package/dist/blocks/DangerousHtml/DangerousHtml.js +56 -0
- package/dist/blocks/DangerousHtml/schema.json +30 -0
- package/dist/blocks/Html/Html.js +31 -0
- package/dist/blocks/Html/schema.json +23 -0
- package/dist/blocks/Icon/Icon.js +39 -0
- package/dist/blocks/Icon/schema.json +63 -0
- package/dist/blocks/Img/Img.js +55 -0
- package/dist/blocks/Img/schema.json +59 -0
- package/dist/blocks/List/List.js +54 -0
- package/dist/blocks/List/schema.json +40 -0
- package/dist/blocks/Span/Span.js +39 -0
- package/dist/blocks/Span/schema.json +30 -0
- package/dist/blocks.js +22 -0
- package/dist/types.js +32 -0
- package/package.json +34 -36
- package/dist/14.js +0 -2
- package/dist/14.js.LICENSE.txt +0 -43
- package/dist/203.js +0 -1
- package/dist/22.js +0 -1
- package/dist/261.js +0 -1
- package/dist/328.js +0 -2
- package/dist/328.js.LICENSE.txt +0 -1
- package/dist/330.js +0 -1
- package/dist/397.js +0 -1
- package/dist/52.js +0 -1
- package/dist/700.js +0 -1
- package/dist/757.js +0 -2
- package/dist/757.js.LICENSE.txt +0 -14
- package/dist/93.js +0 -1
- package/dist/941.js +0 -1
- package/dist/964.js +0 -1
- package/dist/main.js +0 -1
- package/dist/meta/Box.json +0 -1
- package/dist/meta/Context.json +0 -1
- package/dist/meta/DangerousHtml.json +0 -1
- package/dist/meta/Html.json +0 -1
- package/dist/meta/Img.json +0 -1
- package/dist/meta/List.json +0 -1
- package/dist/meta/Span.json +0 -1
- package/dist/remoteEntry.js +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"direction": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"enum": ["row", "column", "row-reverse", "column-reverse"],
|
|
10
|
+
"description": "List content along a 'row' or down a 'column'. Applies the 'flex-direction' css property to the List block."
|
|
11
|
+
},
|
|
12
|
+
"wrap": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": ["wrap", "nowrap", "wrap-reverse"],
|
|
15
|
+
"description": "Specifies wrapping style to be applied to List block as 'wrap', 'nowrap' or 'wrap-reverse'. Applies the 'flex-wrap' css property to the List block - defaults to 'wrap', requires List direction to be set."
|
|
16
|
+
},
|
|
17
|
+
"scroll": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "Specifies whether scrolling should be applied to the List, can be true or false. Applies the 'overflow' css property to the List block - defaults to 'visible', requires List direction to be set."
|
|
20
|
+
},
|
|
21
|
+
"style": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"description": "Css style object to apply to List block.",
|
|
24
|
+
"docs": {
|
|
25
|
+
"displayType": "yaml"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"events": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"properties": {
|
|
34
|
+
"onClick": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"description": "Trigger actions when the List is clicked."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
|
+
const Span = ({ blockId , content , events , methods , properties })=>/*#__PURE__*/ React.createElement("span", {
|
|
18
|
+
id: blockId,
|
|
19
|
+
"data-testid": blockId,
|
|
20
|
+
onClick: ()=>methods.triggerEvent({
|
|
21
|
+
name: 'onClick'
|
|
22
|
+
})
|
|
23
|
+
,
|
|
24
|
+
className: methods.makeCssClass([
|
|
25
|
+
{
|
|
26
|
+
outline: 'none',
|
|
27
|
+
cursor: events.onClick && 'pointer'
|
|
28
|
+
},
|
|
29
|
+
properties.style,
|
|
30
|
+
])
|
|
31
|
+
}, properties.content || content.content && content.content())
|
|
32
|
+
;
|
|
33
|
+
Span.defaultProps = blockDefaultProps;
|
|
34
|
+
Span.meta = {
|
|
35
|
+
category: 'container',
|
|
36
|
+
icons: [],
|
|
37
|
+
styles: []
|
|
38
|
+
};
|
|
39
|
+
export default Span;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"content": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Span content string. Overrides the \"content\" content area."
|
|
10
|
+
},
|
|
11
|
+
"style": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"description": "Css style object to apply to Span div.",
|
|
14
|
+
"docs": {
|
|
15
|
+
"displayType": "yaml"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"events": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"properties": {
|
|
24
|
+
"onClick": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"description": "Trigger actions when the Span is clicked."
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
package/dist/blocks.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export { default as Anchor } from './blocks/Anchor/Anchor.js';
|
|
16
|
+
export { default as Box } from './blocks/Box/Box.js';
|
|
17
|
+
export { default as DangerousHtml } from './blocks/DangerousHtml/DangerousHtml.js';
|
|
18
|
+
export { default as Html } from './blocks/Html/Html.js';
|
|
19
|
+
export { default as Icon } from './blocks/Icon/Icon.js';
|
|
20
|
+
export { default as Img } from './blocks/Img/Img.js';
|
|
21
|
+
export { default as List } from './blocks/List/List.js';
|
|
22
|
+
export { default as Span } from './blocks/Span/Span.js';
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* eslint-disable import/namespace */ /*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import * as blocks from './blocks.js';
|
|
16
|
+
const icons = {};
|
|
17
|
+
const styles = {};
|
|
18
|
+
Object.keys(blocks).forEach((block)=>{
|
|
19
|
+
icons[block] = blocks[block].meta.icons || [];
|
|
20
|
+
styles[block] = blocks[block].meta.styles || [];
|
|
21
|
+
});
|
|
22
|
+
export default {
|
|
23
|
+
blocks: Object.keys(blocks),
|
|
24
|
+
icons,
|
|
25
|
+
styles: {
|
|
26
|
+
default: [],
|
|
27
|
+
...styles
|
|
28
|
+
}
|
|
29
|
+
}; // export default {
|
|
30
|
+
// blocks: ['Anchor', 'Box', 'DangerousHtml', 'Html', 'Icon', 'Img', 'List', 'Span'],
|
|
31
|
+
// styles: { default: ['style.less'], Anchor: ['blocks/Anchor/style.less'] },
|
|
32
|
+
// };
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/blocks-basic",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.11",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Basic html Lowdefy blocks.",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"lowdefy",
|
|
9
|
-
"lowdefy blocks"
|
|
9
|
+
"lowdefy blocks",
|
|
10
|
+
"lowdefy plugin"
|
|
10
11
|
],
|
|
11
12
|
"bugs": {
|
|
12
13
|
"url": "https://github.com/lowdefy/lowdefy/issues"
|
|
@@ -19,60 +20,57 @@
|
|
|
19
20
|
{
|
|
20
21
|
"name": "Gerrie van Wyk",
|
|
21
22
|
"url": "https://github.com/Gervwyk"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "Sandile Memela",
|
|
26
|
+
"url": "https://github.com/sah-memela"
|
|
22
27
|
}
|
|
23
28
|
],
|
|
24
29
|
"repository": {
|
|
25
30
|
"type": "git",
|
|
26
31
|
"url": "https://github.com/lowdefy/lowdefy.git"
|
|
27
32
|
},
|
|
28
|
-
"
|
|
33
|
+
"type": "module",
|
|
34
|
+
"exports": {
|
|
35
|
+
"./*": "./dist/*",
|
|
36
|
+
"./blocks": "./dist/blocks.js",
|
|
37
|
+
"./types": "./dist/types.js"
|
|
38
|
+
},
|
|
29
39
|
"files": [
|
|
30
40
|
"dist/*"
|
|
31
41
|
],
|
|
32
42
|
"scripts": {
|
|
33
|
-
"build": "
|
|
43
|
+
"build": "yarn swc",
|
|
34
44
|
"clean": "rm -rf dist",
|
|
45
|
+
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
|
|
35
46
|
"prepare": "yarn build",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"test": "jest --coverage
|
|
47
|
+
"swc": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && yarn copyfiles",
|
|
48
|
+
"test:watch": "jest --coverage --watch",
|
|
49
|
+
"test": "jest --coverage"
|
|
39
50
|
},
|
|
40
51
|
"dependencies": {
|
|
41
|
-
"@lowdefy/block-
|
|
42
|
-
"
|
|
52
|
+
"@lowdefy/block-utils": "4.0.0-alpha.11",
|
|
53
|
+
"@lowdefy/helpers": "4.0.0-alpha.11",
|
|
54
|
+
"dompurify": "2.3.5",
|
|
43
55
|
"react": "17.0.2",
|
|
44
56
|
"react-dom": "17.0.2"
|
|
45
57
|
},
|
|
46
58
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"enzyme": "3.11.0",
|
|
60
|
-
"html-webpack-plugin": "5.3.1",
|
|
61
|
-
"identity-obj-proxy": "3.0.0",
|
|
62
|
-
"jest": "26.6.3",
|
|
63
|
-
"js-yaml": "4.1.0",
|
|
64
|
-
"react-markdown": "5.0.3",
|
|
65
|
-
"react-syntax-highlighter": "15.4.3",
|
|
66
|
-
"style-loader": "2.0.0",
|
|
67
|
-
"webpack": "5.38.1",
|
|
68
|
-
"webpack-cli": "4.7.0",
|
|
69
|
-
"webpack-dev-server": "3.11.2",
|
|
70
|
-
"webpack-merge": "5.7.3",
|
|
71
|
-
"yaml-jest": "1.0.5",
|
|
72
|
-
"yaml-loader": "0.6.0"
|
|
59
|
+
"@emotion/jest": "11.7.1",
|
|
60
|
+
"@lowdefy/block-dev": "4.0.0-alpha.11",
|
|
61
|
+
"@swc/cli": "0.1.55",
|
|
62
|
+
"@swc/core": "1.2.135",
|
|
63
|
+
"@swc/jest": "0.2.17",
|
|
64
|
+
"@testing-library/dom": "8.11.3",
|
|
65
|
+
"@testing-library/react": "13.0.0-alpha.4",
|
|
66
|
+
"@testing-library/user-event": "14.0.0-alpha.14",
|
|
67
|
+
"copyfiles": "2.4.1",
|
|
68
|
+
"jest": "27.5.1",
|
|
69
|
+
"jest-serializer-html": "7.1.0",
|
|
70
|
+
"jest-transform-yaml": "1.0.0"
|
|
73
71
|
},
|
|
74
72
|
"publishConfig": {
|
|
75
73
|
"access": "public"
|
|
76
74
|
},
|
|
77
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "810fb2d8cb9ee8b0586b55fbbf26a5a5a0da3b2a"
|
|
78
76
|
}
|