@lowdefy/blocks-basic 4.0.0-alpha.9 → 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 +16 -17
- package/dist/blocks/Box/Box.js +2 -4
- package/dist/blocks/DangerousHtml/DangerousHtml.js +2 -2
- package/dist/blocks/Html/Html.js +1 -2
- package/dist/blocks/Icon/Icon.js +15 -16
- package/dist/blocks/Img/Img.js +17 -18
- package/dist/blocks/List/List.js +3 -4
- package/dist/blocks/Span/Span.js +2 -4
- package/package.json +21 -21
|
@@ -1,3 +1,17 @@
|
|
|
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
16
|
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
@@ -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
|
-
function _extends() {
|
|
19
|
-
_extends = Object.assign || function(target) {
|
|
20
|
-
for(var i = 1; i < arguments.length; i++){
|
|
21
|
-
var source = arguments[i];
|
|
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
32
|
const AnchorBlock = ({ blockId , events , components: { Icon , Link } , methods , properties })=>{
|
|
33
33
|
const disabled = properties.disabled || get(events, 'onClick.loading');
|
|
34
34
|
const { icon , title , ...linkProperties } = properties;
|
|
35
|
-
return
|
|
35
|
+
return /*#__PURE__*/ React.createElement(Link, _extends({
|
|
36
36
|
id: blockId,
|
|
37
37
|
className: methods.makeCssClass([
|
|
38
38
|
properties.style,
|
|
@@ -52,8 +52,7 @@ const AnchorBlock = ({ blockId , events , components: { Icon , Link } , methods
|
|
|
52
52
|
name: 'AiOutlineLoading3Quarters',
|
|
53
53
|
spin: true
|
|
54
54
|
} : icon
|
|
55
|
-
}), title || defaultTitle)
|
|
56
|
-
));
|
|
55
|
+
}), title || defaultTitle));
|
|
57
56
|
};
|
|
58
57
|
AnchorBlock.defaultProps = blockDefaultProps;
|
|
59
58
|
AnchorBlock.meta = {
|
package/dist/blocks/Box/Box.js
CHANGED
|
@@ -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,8 +27,7 @@ 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',
|
|
@@ -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);
|
package/dist/blocks/Html/Html.js
CHANGED
package/dist/blocks/Icon/Icon.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
16
|
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
@@ -14,22 +28,7 @@
|
|
|
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',
|
package/dist/blocks/Img/Img.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
16
|
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
@@ -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,7 +43,7 @@ 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 = {
|
package/dist/blocks/List/List.js
CHANGED
|
@@ -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,10 +39,9 @@ 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 = {
|
package/dist/blocks/Span/Span.js
CHANGED
|
@@ -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,8 +27,7 @@ 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',
|
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
|
}
|