@lowdefy/blocks-basic 4.0.0-alpha.8 → 4.0.0-rc.0
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 +27 -32
- package/dist/blocks/Anchor/schema.json +1 -1
- package/dist/blocks/Box/Box.js +3 -6
- package/dist/blocks/DangerousHtml/DangerousHtml.js +3 -4
- package/dist/blocks/Html/Html.js +2 -4
- package/dist/blocks/Icon/Icon.js +16 -18
- package/dist/blocks/Icon/schema.json +1 -1
- package/dist/blocks/Img/Img.js +18 -20
- package/dist/blocks/List/List.js +4 -6
- package/dist/blocks/Span/Span.js +3 -6
- package/dist/blocks.js +1 -1
- package/dist/types.js +1 -1
- package/package.json +21 -21
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign || function(target) {
|
|
3
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for(var key in source){
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
1
15
|
/*
|
|
2
|
-
Copyright 2020-
|
|
16
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
4
18
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
19
|
you may not use this file except in compliance with the License.
|
|
@@ -15,24 +29,10 @@
|
|
|
15
29
|
*/ import React from 'react';
|
|
16
30
|
import { get } from '@lowdefy/helpers';
|
|
17
31
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
for(var key in source){
|
|
23
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
24
|
-
target[key] = source[key];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
};
|
|
30
|
-
return _extends.apply(this, arguments);
|
|
31
|
-
}
|
|
32
|
-
const AnchorBlock = ({ blockId , events , components: { Icon , Link } , loading , methods , properties , })=>{
|
|
33
|
-
const showLoading = get(events, 'onClick.loading') || loading;
|
|
34
|
-
const disabled = properties.disabled || showLoading;
|
|
35
|
-
return(/*#__PURE__*/ React.createElement(Link, _extends({
|
|
32
|
+
const AnchorBlock = ({ blockId , events , components: { Icon , Link } , methods , properties })=>{
|
|
33
|
+
const disabled = properties.disabled || get(events, 'onClick.loading');
|
|
34
|
+
const { icon , title , ...linkProperties } = properties;
|
|
35
|
+
return /*#__PURE__*/ React.createElement(Link, _extends({
|
|
36
36
|
id: blockId,
|
|
37
37
|
className: methods.makeCssClass([
|
|
38
38
|
properties.style,
|
|
@@ -45,26 +45,21 @@ const AnchorBlock = ({ blockId , events , components: { Icon , Link } , loading
|
|
|
45
45
|
onClick: ()=>methods.triggerEvent({
|
|
46
46
|
name: 'onClick'
|
|
47
47
|
})
|
|
48
|
-
},
|
|
48
|
+
}, linkProperties), (defaultTitle)=>/*#__PURE__*/ React.createElement(React.Fragment, null, icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
49
49
|
blockId: `${blockId}_icon`,
|
|
50
50
|
events: events,
|
|
51
|
-
properties:
|
|
52
|
-
name: '
|
|
51
|
+
properties: get(events, 'onClick.loading') ? {
|
|
52
|
+
name: 'AiOutlineLoading3Quarters',
|
|
53
53
|
spin: true
|
|
54
|
-
} :
|
|
55
|
-
})
|
|
56
|
-
));
|
|
54
|
+
} : icon
|
|
55
|
+
}), title || defaultTitle));
|
|
57
56
|
};
|
|
58
57
|
AnchorBlock.defaultProps = blockDefaultProps;
|
|
59
58
|
AnchorBlock.meta = {
|
|
60
59
|
category: 'display',
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
lines: 1
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
icons: [],
|
|
60
|
+
icons: [
|
|
61
|
+
'AiOutlineLoading3Quarters'
|
|
62
|
+
],
|
|
68
63
|
styles: []
|
|
69
64
|
};
|
|
70
65
|
export default AnchorBlock;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"icon": {
|
|
39
39
|
"type": ["string", "object"],
|
|
40
|
-
"description": "Name of an
|
|
40
|
+
"description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block for anchor icon.",
|
|
41
41
|
"docs": {
|
|
42
42
|
"displayType": "icon"
|
|
43
43
|
}
|
package/dist/blocks/Box/Box.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -19,8 +19,7 @@ const Box = ({ blockId , content , events , methods , properties })=>/*#__PURE_
|
|
|
19
19
|
"data-testid": blockId,
|
|
20
20
|
onClick: ()=>methods.triggerEvent({
|
|
21
21
|
name: 'onClick'
|
|
22
|
-
})
|
|
23
|
-
,
|
|
22
|
+
}),
|
|
24
23
|
className: methods.makeCssClass([
|
|
25
24
|
{
|
|
26
25
|
outline: 'none',
|
|
@@ -28,12 +27,10 @@ const Box = ({ blockId , content , events , methods , properties })=>/*#__PURE_
|
|
|
28
27
|
},
|
|
29
28
|
properties.style,
|
|
30
29
|
])
|
|
31
|
-
}, properties.content || content.content && content.content())
|
|
32
|
-
;
|
|
30
|
+
}, properties.content || content.content && content.content());
|
|
33
31
|
Box.defaultProps = blockDefaultProps;
|
|
34
32
|
Box.meta = {
|
|
35
33
|
category: 'container',
|
|
36
|
-
loading: false,
|
|
37
34
|
icons: [],
|
|
38
35
|
styles: []
|
|
39
36
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -27,7 +27,7 @@ let DangerousHtml = class DangerousHtml extends React.Component {
|
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
29
|
const { blockId , properties , methods } = this.props;
|
|
30
|
-
return
|
|
30
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
31
31
|
id: blockId,
|
|
32
32
|
"data-testid": blockId,
|
|
33
33
|
ref: (el)=>{
|
|
@@ -36,7 +36,7 @@ let DangerousHtml = class DangerousHtml extends React.Component {
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
className: methods.makeCssClass(properties.style)
|
|
39
|
-
})
|
|
39
|
+
});
|
|
40
40
|
}
|
|
41
41
|
constructor(props){
|
|
42
42
|
super(props);
|
|
@@ -50,7 +50,6 @@ let DangerousHtml = class DangerousHtml extends React.Component {
|
|
|
50
50
|
DangerousHtml.defaultProps = blockDefaultProps;
|
|
51
51
|
DangerousHtml.meta = {
|
|
52
52
|
category: 'display',
|
|
53
|
-
loading: false,
|
|
54
53
|
icons: [],
|
|
55
54
|
styles: []
|
|
56
55
|
};
|
package/dist/blocks/Html/Html.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -20,12 +20,10 @@ const HtmlBlock = ({ blockId , properties , methods })=>/*#__PURE__*/ React.cre
|
|
|
20
20
|
id: blockId,
|
|
21
21
|
methods: methods,
|
|
22
22
|
style: properties.style
|
|
23
|
-
})
|
|
24
|
-
;
|
|
23
|
+
});
|
|
25
24
|
HtmlBlock.defaultProps = blockDefaultProps;
|
|
26
25
|
HtmlBlock.meta = {
|
|
27
26
|
category: 'display',
|
|
28
|
-
loading: false,
|
|
29
27
|
icons: [],
|
|
30
28
|
styles: []
|
|
31
29
|
};
|
package/dist/blocks/Icon/Icon.js
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign || function(target) {
|
|
3
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for(var key in source){
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
1
15
|
/*
|
|
2
|
-
Copyright 2020-
|
|
16
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
4
18
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
19
|
you may not use this file except in compliance with the License.
|
|
@@ -14,26 +28,10 @@
|
|
|
14
28
|
limitations under the License.
|
|
15
29
|
*/ import React from 'react';
|
|
16
30
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
|
-
|
|
18
|
-
_extends = Object.assign || function(target) {
|
|
19
|
-
for(var i = 1; i < arguments.length; i++){
|
|
20
|
-
var source = arguments[i];
|
|
21
|
-
for(var key in source){
|
|
22
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
|
-
target[key] = source[key];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
};
|
|
29
|
-
return _extends.apply(this, arguments);
|
|
30
|
-
}
|
|
31
|
-
const IconBlock = ({ components: { Icon } , ...props })=>/*#__PURE__*/ React.createElement(Icon, _extends({}, props))
|
|
32
|
-
;
|
|
31
|
+
const IconBlock = ({ components: { Icon } , ...props })=>/*#__PURE__*/ React.createElement(Icon, _extends({}, props));
|
|
33
32
|
IconBlock.defaultProps = blockDefaultProps;
|
|
34
33
|
IconBlock.meta = {
|
|
35
34
|
category: 'display',
|
|
36
|
-
loading: false,
|
|
37
35
|
icons: [],
|
|
38
36
|
styles: []
|
|
39
37
|
};
|
package/dist/blocks/Img/Img.js
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign || function(target) {
|
|
3
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for(var key in source){
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
1
15
|
/*
|
|
2
|
-
Copyright 2020-
|
|
16
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
4
18
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
19
|
you may not use this file except in compliance with the License.
|
|
@@ -14,29 +28,14 @@
|
|
|
14
28
|
limitations under the License.
|
|
15
29
|
*/ import React from 'react';
|
|
16
30
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
|
-
function _extends() {
|
|
18
|
-
_extends = Object.assign || function(target) {
|
|
19
|
-
for(var i = 1; i < arguments.length; i++){
|
|
20
|
-
var source = arguments[i];
|
|
21
|
-
for(var key in source){
|
|
22
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
|
-
target[key] = source[key];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
};
|
|
29
|
-
return _extends.apply(this, arguments);
|
|
30
|
-
}
|
|
31
31
|
const ImgBlock = ({ blockId , events , properties , methods })=>{
|
|
32
32
|
const { style , ...allProps } = properties;
|
|
33
|
-
return
|
|
33
|
+
return /*#__PURE__*/ React.createElement("img", _extends({}, allProps, {
|
|
34
34
|
id: blockId,
|
|
35
35
|
"data-testid": blockId,
|
|
36
36
|
onClick: ()=>methods.triggerEvent({
|
|
37
37
|
name: 'onClick'
|
|
38
|
-
})
|
|
39
|
-
,
|
|
38
|
+
}),
|
|
40
39
|
className: methods.makeCssClass([
|
|
41
40
|
{
|
|
42
41
|
outline: 'none',
|
|
@@ -44,12 +43,11 @@ const ImgBlock = ({ blockId , events , properties , methods })=>{
|
|
|
44
43
|
},
|
|
45
44
|
style,
|
|
46
45
|
])
|
|
47
|
-
}))
|
|
46
|
+
}));
|
|
48
47
|
};
|
|
49
48
|
ImgBlock.defaultProps = blockDefaultProps;
|
|
50
49
|
ImgBlock.meta = {
|
|
51
50
|
category: 'display',
|
|
52
|
-
loading: false,
|
|
53
51
|
icons: [],
|
|
54
52
|
styles: []
|
|
55
53
|
};
|
package/dist/blocks/List/List.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -23,7 +23,7 @@ const List = ({ blockId , events , list , methods , properties })=>{
|
|
|
23
23
|
methods.registerMethod('moveItemDown', methods.moveItemDown);
|
|
24
24
|
methods.registerMethod('moveItemUp', methods.moveItemUp);
|
|
25
25
|
}, []);
|
|
26
|
-
return
|
|
26
|
+
return /*#__PURE__*/ React.createElement(Box, {
|
|
27
27
|
blockId: blockId,
|
|
28
28
|
events: events,
|
|
29
29
|
properties: {
|
|
@@ -39,16 +39,14 @@ const List = ({ blockId , events , list , methods , properties })=>{
|
|
|
39
39
|
},
|
|
40
40
|
methods: methods,
|
|
41
41
|
content: {
|
|
42
|
-
content: ()=>list.map((item)=>item.content()
|
|
43
|
-
)
|
|
42
|
+
content: ()=>list.map((item)=>item.content())
|
|
44
43
|
}
|
|
45
|
-
})
|
|
44
|
+
});
|
|
46
45
|
};
|
|
47
46
|
List.defaultProps = blockDefaultProps;
|
|
48
47
|
List.meta = {
|
|
49
48
|
category: 'list',
|
|
50
49
|
valueType: 'array',
|
|
51
|
-
loading: false,
|
|
52
50
|
icons: [],
|
|
53
51
|
styles: []
|
|
54
52
|
};
|
package/dist/blocks/Span/Span.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -19,8 +19,7 @@ const Span = ({ blockId , content , events , methods , properties })=>/*#__PURE
|
|
|
19
19
|
"data-testid": blockId,
|
|
20
20
|
onClick: ()=>methods.triggerEvent({
|
|
21
21
|
name: 'onClick'
|
|
22
|
-
})
|
|
23
|
-
,
|
|
22
|
+
}),
|
|
24
23
|
className: methods.makeCssClass([
|
|
25
24
|
{
|
|
26
25
|
outline: 'none',
|
|
@@ -28,12 +27,10 @@ const Span = ({ blockId , content , events , methods , properties })=>/*#__PURE
|
|
|
28
27
|
},
|
|
29
28
|
properties.style,
|
|
30
29
|
])
|
|
31
|
-
}, properties.content || content.content && content.content())
|
|
32
|
-
;
|
|
30
|
+
}, properties.content || content.content && content.content());
|
|
33
31
|
Span.defaultProps = blockDefaultProps;
|
|
34
32
|
Span.meta = {
|
|
35
33
|
category: 'container',
|
|
36
|
-
loading: false,
|
|
37
34
|
icons: [],
|
|
38
35
|
styles: []
|
|
39
36
|
};
|
package/dist/blocks.js
CHANGED
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/blocks-basic",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-rc.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Basic html Lowdefy blocks.",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -40,37 +40,37 @@
|
|
|
40
40
|
"dist/*"
|
|
41
41
|
],
|
|
42
42
|
"scripts": {
|
|
43
|
-
"build": "
|
|
43
|
+
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && pnpm copyfiles",
|
|
44
44
|
"clean": "rm -rf dist",
|
|
45
45
|
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
|
|
46
|
-
"
|
|
47
|
-
"swc": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && yarn copyfiles",
|
|
46
|
+
"prepublishOnly": "pnpm build",
|
|
48
47
|
"test:watch": "jest --coverage --watch",
|
|
49
48
|
"test": "jest --coverage"
|
|
50
49
|
},
|
|
51
50
|
"dependencies": {
|
|
52
|
-
"@lowdefy/block-utils": "4.0.0-
|
|
53
|
-
"@lowdefy/helpers": "4.0.0-
|
|
54
|
-
"dompurify": "2.3.
|
|
55
|
-
"react": "
|
|
56
|
-
"react-dom": "
|
|
51
|
+
"@lowdefy/block-utils": "4.0.0-rc.0",
|
|
52
|
+
"@lowdefy/helpers": "4.0.0-rc.0",
|
|
53
|
+
"dompurify": "2.3.8",
|
|
54
|
+
"react": "18.2.0",
|
|
55
|
+
"react-dom": "18.2.0"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
|
-
"@emotion/jest": "11.
|
|
60
|
-
"@lowdefy/block-dev": "4.0.0-
|
|
61
|
-
"@
|
|
62
|
-
"@swc/
|
|
63
|
-
"@swc/
|
|
64
|
-
"@
|
|
65
|
-
"@testing-library/
|
|
66
|
-
"@testing-library/
|
|
58
|
+
"@emotion/jest": "11.9.1",
|
|
59
|
+
"@lowdefy/block-dev": "4.0.0-rc.0",
|
|
60
|
+
"@lowdefy/jest-yaml-transform": "4.0.0-rc.0",
|
|
61
|
+
"@swc/cli": "0.1.57",
|
|
62
|
+
"@swc/core": "1.2.194",
|
|
63
|
+
"@swc/jest": "0.2.21",
|
|
64
|
+
"@testing-library/dom": "8.13.0",
|
|
65
|
+
"@testing-library/react": "13.3.0",
|
|
66
|
+
"@testing-library/user-event": "14.2.0",
|
|
67
67
|
"copyfiles": "2.4.1",
|
|
68
|
-
"jest": "
|
|
69
|
-
"jest-
|
|
70
|
-
"jest-
|
|
68
|
+
"jest": "28.1.0",
|
|
69
|
+
"jest-environment-jsdom": "28.1.0",
|
|
70
|
+
"jest-serializer-html": "7.1.0"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "f6872d7ff6da421710096536fce7b2016ef8f35c"
|
|
76
76
|
}
|