@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.
@@ -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(/*#__PURE__*/ React.createElement(Link, _extends({
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 = {
@@ -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(/*#__PURE__*/ React.createElement("div", {
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);
@@ -20,8 +20,7 @@ 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',
@@ -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
- 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
- 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',
@@ -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(/*#__PURE__*/ React.createElement("img", _extends({}, allProps, {
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 = {
@@ -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(/*#__PURE__*/ React.createElement(Box, {
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 = {
@@ -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-alpha.9",
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": "yarn swc",
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
- "prepare": "yarn build",
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-alpha.9",
53
- "@lowdefy/helpers": "4.0.0-alpha.9",
54
- "dompurify": "2.3.5",
55
- "react": "17.0.2",
56
- "react-dom": "17.0.2"
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.7.1",
60
- "@lowdefy/block-dev": "4.0.0-alpha.9",
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",
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": "27.5.1",
69
- "jest-serializer-html": "7.1.0",
70
- "jest-transform-yaml": "1.0.0"
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": "98b544eca231bdcfca6c3a8601a891835d5ce571"
75
+ "gitHead": "f6872d7ff6da421710096536fce7b2016ef8f35c"
76
76
  }