@lowdefy/blocks-basic 4.0.0-alpha.7 → 4.0.0-alpha.8

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,4 +1,3 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
1
  /*
3
2
  Copyright 2020-2021 Lowdefy, Inc
4
3
 
@@ -16,10 +15,24 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
16
15
  */ import React from 'react';
17
16
  import { get } from '@lowdefy/helpers';
18
17
  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
+ }
19
32
  const AnchorBlock = ({ blockId , events , components: { Icon , Link } , loading , methods , properties , })=>{
20
33
  const showLoading = get(events, 'onClick.loading') || loading;
21
34
  const disabled = properties.disabled || showLoading;
22
- return(/*#__PURE__*/ _jsx(Link, {
35
+ return(/*#__PURE__*/ React.createElement(Link, _extends({
23
36
  id: blockId,
24
37
  className: methods.makeCssClass([
25
38
  properties.style,
@@ -32,22 +45,15 @@ const AnchorBlock = ({ blockId , events , components: { Icon , Link } , loading
32
45
  onClick: ()=>methods.triggerEvent({
33
46
  name: 'onClick'
34
47
  })
35
- ,
36
- ...properties,
37
- children: (defaultTitle)=>/*#__PURE__*/ _jsxs(_Fragment, {
38
- children: [
39
- properties.icon && /*#__PURE__*/ _jsx(Icon, {
40
- blockId: `${blockId}_icon`,
41
- events: events,
42
- properties: showLoading ? {
43
- name: 'LoadingOutlined',
44
- spin: true
45
- } : properties.icon
46
- }) + ` `,
47
- properties.title || defaultTitle
48
- ]
49
- })
50
- }));
48
+ }, properties), (defaultTitle)=>/*#__PURE__*/ React.createElement(React.Fragment, null, properties.icon && /*#__PURE__*/ React.createElement(Icon, {
49
+ blockId: `${blockId}_icon`,
50
+ events: events,
51
+ properties: showLoading ? {
52
+ name: 'LoadingOutlined',
53
+ spin: true
54
+ } : properties.icon
55
+ }) + ` `, properties.title || defaultTitle)
56
+ ));
51
57
  };
52
58
  AnchorBlock.defaultProps = blockDefaultProps;
53
59
  AnchorBlock.meta = {
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
2
  Copyright 2020-2021 Lowdefy, Inc
4
3
 
@@ -15,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
15
14
  limitations under the License.
16
15
  */ import React from 'react';
17
16
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
- const Box = ({ blockId , content , events , methods , properties })=>/*#__PURE__*/ _jsx("div", {
17
+ const Box = ({ blockId , content , events , methods , properties })=>/*#__PURE__*/ React.createElement("div", {
19
18
  id: blockId,
20
19
  "data-testid": blockId,
21
20
  onClick: ()=>methods.triggerEvent({
@@ -28,9 +27,8 @@ const Box = ({ blockId , content , events , methods , properties })=>/*#__PURE_
28
27
  cursor: events.onClick && 'pointer'
29
28
  },
30
29
  properties.style,
31
- ]),
32
- children: properties.content || content.content && content.content()
33
- })
30
+ ])
31
+ }, properties.content || content.content && content.content())
34
32
  ;
35
33
  Box.defaultProps = blockDefaultProps;
36
34
  Box.meta = {
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
2
  Copyright 2020-2021 Lowdefy, Inc
4
3
 
@@ -28,7 +27,7 @@ let DangerousHtml = class DangerousHtml extends React.Component {
28
27
  }
29
28
  render() {
30
29
  const { blockId , properties , methods } = this.props;
31
- return(/*#__PURE__*/ _jsx("div", {
30
+ return(/*#__PURE__*/ React.createElement("div", {
32
31
  id: blockId,
33
32
  "data-testid": blockId,
34
33
  ref: (el)=>{
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
2
  Copyright 2020-2021 Lowdefy, Inc
4
3
 
@@ -15,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
15
14
  limitations under the License.
16
15
  */ import React from 'react';
17
16
  import { blockDefaultProps, HtmlComponent } from '@lowdefy/block-utils';
18
- const HtmlBlock = ({ blockId , properties , methods })=>/*#__PURE__*/ _jsx(HtmlComponent, {
17
+ const HtmlBlock = ({ blockId , properties , methods })=>/*#__PURE__*/ React.createElement(HtmlComponent, {
19
18
  div: true,
20
19
  html: properties.html,
21
20
  id: blockId,
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
2
  Copyright 2020-2021 Lowdefy, Inc
4
3
 
@@ -15,9 +14,21 @@ import { jsx as _jsx } from "react/jsx-runtime";
15
14
  limitations under the License.
16
15
  */ import React from 'react';
17
16
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
- const IconBlock = ({ components: { Icon } , ...props })=>/*#__PURE__*/ _jsx(Icon, {
19
- ...props
20
- })
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))
21
32
  ;
22
33
  IconBlock.defaultProps = blockDefaultProps;
23
34
  IconBlock.meta = {
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
2
  Copyright 2020-2021 Lowdefy, Inc
4
3
 
@@ -15,10 +14,23 @@ import { jsx as _jsx } from "react/jsx-runtime";
15
14
  limitations under the License.
16
15
  */ import React from 'react';
17
16
  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
+ }
18
31
  const ImgBlock = ({ blockId , events , properties , methods })=>{
19
32
  const { style , ...allProps } = properties;
20
- return(/*#__PURE__*/ _jsx("img", {
21
- ...allProps,
33
+ return(/*#__PURE__*/ React.createElement("img", _extends({}, allProps, {
22
34
  id: blockId,
23
35
  "data-testid": blockId,
24
36
  onClick: ()=>methods.triggerEvent({
@@ -32,7 +44,7 @@ const ImgBlock = ({ blockId , events , properties , methods })=>{
32
44
  },
33
45
  style,
34
46
  ])
35
- }));
47
+ })));
36
48
  };
37
49
  ImgBlock.defaultProps = blockDefaultProps;
38
50
  ImgBlock.meta = {
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
2
  Copyright 2020-2021 Lowdefy, Inc
4
3
 
@@ -24,7 +23,7 @@ const List = ({ blockId , events , list , methods , properties })=>{
24
23
  methods.registerMethod('moveItemDown', methods.moveItemDown);
25
24
  methods.registerMethod('moveItemUp', methods.moveItemUp);
26
25
  }, []);
27
- return(/*#__PURE__*/ _jsx(Box, {
26
+ return(/*#__PURE__*/ React.createElement(Box, {
28
27
  blockId: blockId,
29
28
  events: events,
30
29
  properties: {
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
2
  Copyright 2020-2021 Lowdefy, Inc
4
3
 
@@ -15,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
15
14
  limitations under the License.
16
15
  */ import React from 'react';
17
16
  import { blockDefaultProps } from '@lowdefy/block-utils';
18
- const Span = ({ blockId , content , events , methods , properties })=>/*#__PURE__*/ _jsx("span", {
17
+ const Span = ({ blockId , content , events , methods , properties })=>/*#__PURE__*/ React.createElement("span", {
19
18
  id: blockId,
20
19
  "data-testid": blockId,
21
20
  onClick: ()=>methods.triggerEvent({
@@ -28,9 +27,8 @@ const Span = ({ blockId , content , events , methods , properties })=>/*#__PURE
28
27
  cursor: events.onClick && 'pointer'
29
28
  },
30
29
  properties.style,
31
- ]),
32
- children: properties.content || content.content && content.content()
33
- })
30
+ ])
31
+ }, properties.content || content.content && content.content())
34
32
  ;
35
33
  Span.defaultProps = blockDefaultProps;
36
34
  Span.meta = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/blocks-basic",
3
- "version": "4.0.0-alpha.7",
3
+ "version": "4.0.0-alpha.8",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Basic html Lowdefy blocks.",
6
6
  "homepage": "https://lowdefy.com",
@@ -49,15 +49,15 @@
49
49
  "test": "jest --coverage"
50
50
  },
51
51
  "dependencies": {
52
- "@lowdefy/block-utils": "4.0.0-alpha.7",
53
- "@lowdefy/helpers": "4.0.0-alpha.7",
52
+ "@lowdefy/block-utils": "4.0.0-alpha.8",
53
+ "@lowdefy/helpers": "4.0.0-alpha.8",
54
54
  "dompurify": "2.3.5",
55
- "react": "18.0.0-rc.0",
56
- "react-dom": "18.0.0-rc.0"
55
+ "react": "17.0.2",
56
+ "react-dom": "17.0.2"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@emotion/jest": "11.7.1",
60
- "@lowdefy/block-dev": "4.0.0-alpha.7",
60
+ "@lowdefy/block-dev": "4.0.0-alpha.8",
61
61
  "@swc/cli": "0.1.55",
62
62
  "@swc/core": "1.2.135",
63
63
  "@swc/jest": "0.2.17",
@@ -72,5 +72,5 @@
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "52ec14639d00de910cf9b8ab25bf933ca891cff5"
75
+ "gitHead": "9d56b83cf45e868afe3a1eeba750fe826eb74c8c"
76
76
  }