@lowdefy/blocks-basic 4.0.0-rc.0 → 4.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/Anchor/Anchor.js +8 -21
- package/dist/blocks/Anchor/schema.json +4 -0
- package/dist/blocks/Box/Box.js +3 -3
- package/dist/blocks/DangerousHtml/DangerousHtml.js +2 -2
- package/dist/blocks/Html/Html.js +2 -2
- package/dist/blocks/Icon/Icon.js +2 -16
- package/dist/blocks/Img/Img.js +7 -20
- package/dist/blocks/List/List.js +2 -2
- package/dist/blocks/Span/Span.js +3 -3
- package/dist/blocks.js +1 -1
- package/dist/types.js +1 -1
- package/package.json +17 -18
|
@@ -1,19 +1,5 @@
|
|
|
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
|
-
}
|
|
15
1
|
/*
|
|
16
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
17
3
|
|
|
18
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
19
5
|
you may not use this file except in compliance with the License.
|
|
@@ -29,23 +15,24 @@ function _extends() {
|
|
|
29
15
|
*/ import React from 'react';
|
|
30
16
|
import { get } from '@lowdefy/helpers';
|
|
31
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
32
|
-
const AnchorBlock = ({ blockId
|
|
18
|
+
const AnchorBlock = ({ blockId, events, components: { Icon, Link }, methods, properties })=>{
|
|
33
19
|
const disabled = properties.disabled || get(events, 'onClick.loading');
|
|
34
|
-
const { icon
|
|
35
|
-
return /*#__PURE__*/ React.createElement(Link,
|
|
20
|
+
const { icon, title, ...linkProperties } = properties;
|
|
21
|
+
return /*#__PURE__*/ React.createElement(Link, {
|
|
36
22
|
id: blockId,
|
|
37
23
|
className: methods.makeCssClass([
|
|
38
24
|
properties.style,
|
|
39
25
|
disabled && {
|
|
40
26
|
color: '#BEBEBE',
|
|
41
27
|
cursor: 'not-allowed'
|
|
42
|
-
}
|
|
28
|
+
}
|
|
43
29
|
]),
|
|
44
30
|
disabled: disabled,
|
|
45
31
|
onClick: ()=>methods.triggerEvent({
|
|
46
32
|
name: 'onClick'
|
|
47
|
-
})
|
|
48
|
-
|
|
33
|
+
}),
|
|
34
|
+
...linkProperties
|
|
35
|
+
}, (defaultTitle)=>/*#__PURE__*/ React.createElement(React.Fragment, null, icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
49
36
|
blockId: `${blockId}_icon`,
|
|
50
37
|
events: events,
|
|
51
38
|
properties: get(events, 'onClick.loading') ? {
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"type": "string",
|
|
47
47
|
"description": "When the link is clicked, route to the provided Lowdefy page."
|
|
48
48
|
},
|
|
49
|
+
"href": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "The href to link to when the anchor link is clicked."
|
|
52
|
+
},
|
|
49
53
|
"url": {
|
|
50
54
|
"type": "string",
|
|
51
55
|
"description": "External url to link to when the anchor link is clicked."
|
package/dist/blocks/Box/Box.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
|
-
const Box = ({ blockId
|
|
17
|
+
const Box = ({ blockId, content, events, methods, properties })=>/*#__PURE__*/ React.createElement("div", {
|
|
18
18
|
id: blockId,
|
|
19
19
|
"data-testid": blockId,
|
|
20
20
|
onClick: ()=>methods.triggerEvent({
|
|
@@ -25,7 +25,7 @@ const Box = ({ blockId , content , events , methods , properties })=>/*#__PURE_
|
|
|
25
25
|
outline: 'none',
|
|
26
26
|
cursor: events.onClick && 'pointer'
|
|
27
27
|
},
|
|
28
|
-
properties.style
|
|
28
|
+
properties.style
|
|
29
29
|
])
|
|
30
30
|
}, properties.content || content.content && content.content());
|
|
31
31
|
Box.defaultProps = blockDefaultProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -26,7 +26,7 @@ let DangerousHtml = class DangerousHtml extends React.Component {
|
|
|
26
26
|
this.div.innerHTML = DOMPurify.sanitize(htmlString, this.DOMPurifyOptions);
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
const { blockId
|
|
29
|
+
const { blockId, properties, methods } = this.props;
|
|
30
30
|
return /*#__PURE__*/ React.createElement("div", {
|
|
31
31
|
id: blockId,
|
|
32
32
|
"data-testid": blockId,
|
package/dist/blocks/Html/Html.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { blockDefaultProps, HtmlComponent } from '@lowdefy/block-utils';
|
|
17
|
-
const HtmlBlock = ({ blockId
|
|
17
|
+
const HtmlBlock = ({ blockId, properties, methods })=>/*#__PURE__*/ React.createElement(HtmlComponent, {
|
|
18
18
|
div: true,
|
|
19
19
|
html: properties.html,
|
|
20
20
|
id: blockId,
|
package/dist/blocks/Icon/Icon.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
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
|
-
}
|
|
15
1
|
/*
|
|
16
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
17
3
|
|
|
18
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
19
5
|
you may not use this file except in compliance with the License.
|
|
@@ -28,7 +14,7 @@ function _extends() {
|
|
|
28
14
|
limitations under the License.
|
|
29
15
|
*/ import React from 'react';
|
|
30
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
31
|
-
const IconBlock = ({ components: { Icon
|
|
17
|
+
const IconBlock = ({ components: { Icon }, ...props })=>/*#__PURE__*/ React.createElement(Icon, props);
|
|
32
18
|
IconBlock.defaultProps = blockDefaultProps;
|
|
33
19
|
IconBlock.meta = {
|
|
34
20
|
category: 'display',
|
package/dist/blocks/Img/Img.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
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
|
-
}
|
|
15
1
|
/*
|
|
16
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
17
3
|
|
|
18
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
19
5
|
you may not use this file except in compliance with the License.
|
|
@@ -28,9 +14,10 @@ function _extends() {
|
|
|
28
14
|
limitations under the License.
|
|
29
15
|
*/ import React from 'react';
|
|
30
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
31
|
-
const ImgBlock = ({ blockId
|
|
32
|
-
const { style
|
|
33
|
-
return /*#__PURE__*/ React.createElement("img",
|
|
17
|
+
const ImgBlock = ({ blockId, events, properties, methods })=>{
|
|
18
|
+
const { style, ...allProps } = properties;
|
|
19
|
+
return /*#__PURE__*/ React.createElement("img", {
|
|
20
|
+
...allProps,
|
|
34
21
|
id: blockId,
|
|
35
22
|
"data-testid": blockId,
|
|
36
23
|
onClick: ()=>methods.triggerEvent({
|
|
@@ -41,9 +28,9 @@ const ImgBlock = ({ blockId , events , properties , methods })=>{
|
|
|
41
28
|
outline: 'none',
|
|
42
29
|
cursor: events.onClick && 'pointer'
|
|
43
30
|
},
|
|
44
|
-
style
|
|
31
|
+
style
|
|
45
32
|
])
|
|
46
|
-
})
|
|
33
|
+
});
|
|
47
34
|
};
|
|
48
35
|
ImgBlock.defaultProps = blockDefaultProps;
|
|
49
36
|
ImgBlock.meta = {
|
package/dist/blocks/List/List.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import React, { useEffect } from 'react';
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
17
|
import Box from '../Box/Box.js';
|
|
18
|
-
const List = ({ blockId
|
|
18
|
+
const List = ({ blockId, events, list, methods, properties })=>{
|
|
19
19
|
useEffect(()=>{
|
|
20
20
|
methods.registerMethod('pushItem', methods.pushItem);
|
|
21
21
|
methods.registerMethod('unshiftItem', methods.unshiftItem);
|
package/dist/blocks/Span/Span.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
|
-
const Span = ({ blockId
|
|
17
|
+
const Span = ({ blockId, content, events, methods, properties })=>/*#__PURE__*/ React.createElement("span", {
|
|
18
18
|
id: blockId,
|
|
19
19
|
"data-testid": blockId,
|
|
20
20
|
onClick: ()=>methods.triggerEvent({
|
|
@@ -25,7 +25,7 @@ const Span = ({ blockId , content , events , methods , properties })=>/*#__PURE
|
|
|
25
25
|
outline: 'none',
|
|
26
26
|
cursor: events.onClick && 'pointer'
|
|
27
27
|
},
|
|
28
|
-
properties.style
|
|
28
|
+
properties.style
|
|
29
29
|
])
|
|
30
30
|
}, properties.content || content.content && content.content());
|
|
31
31
|
Span.defaultProps = blockDefaultProps;
|
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-rc.
|
|
3
|
+
"version": "4.0.0-rc.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Basic html Lowdefy blocks.",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -44,33 +44,32 @@
|
|
|
44
44
|
"clean": "rm -rf dist",
|
|
45
45
|
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
|
|
46
46
|
"prepublishOnly": "pnpm build",
|
|
47
|
-
"test
|
|
48
|
-
"test": "jest --coverage"
|
|
47
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
49
48
|
},
|
|
50
49
|
"dependencies": {
|
|
51
|
-
"@lowdefy/block-utils": "4.0.0-rc.
|
|
52
|
-
"@lowdefy/helpers": "4.0.0-rc.
|
|
53
|
-
"dompurify": "2.
|
|
50
|
+
"@lowdefy/block-utils": "4.0.0-rc.10",
|
|
51
|
+
"@lowdefy/helpers": "4.0.0-rc.10",
|
|
52
|
+
"dompurify": "2.4.7",
|
|
54
53
|
"react": "18.2.0",
|
|
55
54
|
"react-dom": "18.2.0"
|
|
56
55
|
},
|
|
57
56
|
"devDependencies": {
|
|
58
|
-
"@emotion/jest": "11.
|
|
59
|
-
"@lowdefy/block-dev": "4.0.0-rc.
|
|
60
|
-
"@lowdefy/jest-yaml-transform": "4.0.0-rc.
|
|
61
|
-
"@swc/cli": "0.1.
|
|
62
|
-
"@swc/core": "1.
|
|
63
|
-
"@swc/jest": "0.2.
|
|
64
|
-
"@testing-library/dom": "8.
|
|
65
|
-
"@testing-library/react": "13.
|
|
66
|
-
"@testing-library/user-event": "14.
|
|
57
|
+
"@emotion/jest": "11.10.5",
|
|
58
|
+
"@lowdefy/block-dev": "4.0.0-rc.10",
|
|
59
|
+
"@lowdefy/jest-yaml-transform": "4.0.0-rc.10",
|
|
60
|
+
"@swc/cli": "0.1.62",
|
|
61
|
+
"@swc/core": "1.3.70",
|
|
62
|
+
"@swc/jest": "0.2.27",
|
|
63
|
+
"@testing-library/dom": "8.19.1",
|
|
64
|
+
"@testing-library/react": "13.4.0",
|
|
65
|
+
"@testing-library/user-event": "14.4.3",
|
|
67
66
|
"copyfiles": "2.4.1",
|
|
68
|
-
"jest": "28.1.
|
|
69
|
-
"jest-environment-jsdom": "28.1.
|
|
67
|
+
"jest": "28.1.3",
|
|
68
|
+
"jest-environment-jsdom": "28.1.3",
|
|
70
69
|
"jest-serializer-html": "7.1.0"
|
|
71
70
|
},
|
|
72
71
|
"publishConfig": {
|
|
73
72
|
"access": "public"
|
|
74
73
|
},
|
|
75
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "537af074f27770e32da9da8d48490f2eda94b406"
|
|
76
75
|
}
|