@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.
@@ -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-2021 Lowdefy, Inc
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
- 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
- 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
- }, properties), (defaultTitle)=>/*#__PURE__*/ React.createElement(React.Fragment, null, properties.icon && /*#__PURE__*/ React.createElement(Icon, {
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: showLoading ? {
52
- name: 'LoadingOutlined',
51
+ properties: get(events, 'onClick.loading') ? {
52
+ name: 'AiOutlineLoading3Quarters',
53
53
  spin: true
54
- } : properties.icon
55
- }) + ` `, properties.title || defaultTitle)
56
- ));
54
+ } : icon
55
+ }), title || defaultTitle));
57
56
  };
58
57
  AnchorBlock.defaultProps = blockDefaultProps;
59
58
  AnchorBlock.meta = {
60
59
  category: 'display',
61
- loading: {
62
- type: 'SkeletonParagraph',
63
- properties: {
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 Ant Design Icon or properties of an Icon block for anchor icon.",
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
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-2021 Lowdefy, Inc
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(/*#__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);
@@ -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
  };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
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
  };
@@ -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-2021 Lowdefy, Inc
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
- 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',
36
- loading: false,
37
35
  icons: [],
38
36
  styles: []
39
37
  };
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "name": {
15
15
  "type": "string",
16
- "default": "AiCloseCircleOutlined",
16
+ "default": "AiOutlineCloseCircle",
17
17
  "description": "Name of icon to be displayed."
18
18
  },
19
19
  "rotate": {
@@ -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-2021 Lowdefy, Inc
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(/*#__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,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
  };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
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(/*#__PURE__*/ React.createElement(Box, {
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
  };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
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
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
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.
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/namespace */ /*
2
- Copyright 2020-2021 Lowdefy, Inc
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/blocks-basic",
3
- "version": "4.0.0-alpha.8",
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.8",
53
- "@lowdefy/helpers": "4.0.0-alpha.8",
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.8",
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": "9d56b83cf45e868afe3a1eeba750fe826eb74c8c"
75
+ "gitHead": "f6872d7ff6da421710096536fce7b2016ef8f35c"
76
76
  }