@lowdefy/blocks-basic 4.0.0-alpha.9 → 4.0.0-rc.1

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,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
@@ -12,10 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ import React from 'react';
16
- import { get } from '@lowdefy/helpers';
17
- import { blockDefaultProps } from '@lowdefy/block-utils';
18
- function _extends() {
15
+ */ function _extends() {
19
16
  _extends = Object.assign || function(target) {
20
17
  for(var i = 1; i < arguments.length; i++){
21
18
  var source = arguments[i];
@@ -29,17 +26,20 @@ function _extends() {
29
26
  };
30
27
  return _extends.apply(this, arguments);
31
28
  }
29
+ import React from 'react';
30
+ import { get } from '@lowdefy/helpers';
31
+ import { blockDefaultProps } from '@lowdefy/block-utils';
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,
39
39
  disabled && {
40
40
  color: '#BEBEBE',
41
41
  cursor: 'not-allowed'
42
- },
42
+ }
43
43
  ]),
44
44
  disabled: disabled,
45
45
  onClick: ()=>methods.triggerEvent({
@@ -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 = {
@@ -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."
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
@@ -19,17 +19,15 @@ 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',
27
26
  cursor: events.onClick && 'pointer'
28
27
  },
29
- properties.style,
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',
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
@@ -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);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
@@ -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,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
@@ -12,9 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ import React from 'react';
16
- import { blockDefaultProps } from '@lowdefy/block-utils';
17
- function _extends() {
15
+ */ function _extends() {
18
16
  _extends = Object.assign || function(target) {
19
17
  for(var i = 1; i < arguments.length; i++){
20
18
  var source = arguments[i];
@@ -28,8 +26,9 @@ function _extends() {
28
26
  };
29
27
  return _extends.apply(this, arguments);
30
28
  }
31
- const IconBlock = ({ components: { Icon } , ...props })=>/*#__PURE__*/ React.createElement(Icon, _extends({}, props))
32
- ;
29
+ import React from 'react';
30
+ import { blockDefaultProps } from '@lowdefy/block-utils';
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,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
@@ -12,9 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ import React from 'react';
16
- import { blockDefaultProps } from '@lowdefy/block-utils';
17
- function _extends() {
15
+ */ function _extends() {
18
16
  _extends = Object.assign || function(target) {
19
17
  for(var i = 1; i < arguments.length; i++){
20
18
  var source = arguments[i];
@@ -28,23 +26,24 @@ function _extends() {
28
26
  };
29
27
  return _extends.apply(this, arguments);
30
28
  }
29
+ import React from 'react';
30
+ import { blockDefaultProps } from '@lowdefy/block-utils';
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',
43
42
  cursor: events.onClick && 'pointer'
44
43
  },
45
- style,
44
+ style
46
45
  ])
47
- })));
46
+ }));
48
47
  };
49
48
  ImgBlock.defaultProps = blockDefaultProps;
50
49
  ImgBlock.meta = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
@@ -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 = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
@@ -19,17 +19,15 @@ 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',
27
26
  cursor: events.onClick && 'pointer'
28
27
  },
29
- properties.style,
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/dist/blocks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/namespace */ /*
2
- Copyright 2020-2022 Lowdefy, Inc
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.
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.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Basic html Lowdefy blocks.",
6
6
  "homepage": "https://lowdefy.com",
@@ -40,37 +40,36 @@
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",
48
- "test:watch": "jest --coverage --watch",
49
- "test": "jest --coverage"
46
+ "prepublishOnly": "pnpm build",
47
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
50
48
  },
51
49
  "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"
50
+ "@lowdefy/block-utils": "4.0.0-rc.1",
51
+ "@lowdefy/helpers": "4.0.0-rc.1",
52
+ "dompurify": "2.4.1",
53
+ "react": "18.2.0",
54
+ "react-dom": "18.2.0"
57
55
  },
58
56
  "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",
57
+ "@emotion/jest": "11.10.5",
58
+ "@lowdefy/block-dev": "4.0.0-rc.1",
59
+ "@lowdefy/jest-yaml-transform": "4.0.0-rc.1",
60
+ "@swc/cli": "0.1.59",
61
+ "@swc/core": "1.3.24",
62
+ "@swc/jest": "0.2.24",
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": "27.5.1",
69
- "jest-serializer-html": "7.1.0",
70
- "jest-transform-yaml": "1.0.0"
67
+ "jest": "28.1.0",
68
+ "jest-environment-jsdom": "28.1.0",
69
+ "jest-serializer-html": "7.1.0"
71
70
  },
72
71
  "publishConfig": {
73
72
  "access": "public"
74
73
  },
75
- "gitHead": "98b544eca231bdcfca6c3a8601a891835d5ce571"
74
+ "gitHead": "ecc4f16c19eede929eda177db524cf13a8053379"
76
75
  }