@lowdefy/blocks-basic 4.0.0-rc.1 → 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.
@@ -12,27 +12,13 @@
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
- */ function _extends() {
16
- _extends = Object.assign || function(target) {
17
- for(var i = 1; i < arguments.length; i++){
18
- var source = arguments[i];
19
- for(var key in source){
20
- if (Object.prototype.hasOwnProperty.call(source, key)) {
21
- target[key] = source[key];
22
- }
23
- }
24
- }
25
- return target;
26
- };
27
- return _extends.apply(this, arguments);
28
- }
29
- import React from 'react';
15
+ */ import React from 'react';
30
16
  import { get } from '@lowdefy/helpers';
31
17
  import { blockDefaultProps } from '@lowdefy/block-utils';
32
- const AnchorBlock = ({ blockId , events , components: { Icon , Link } , methods , properties })=>{
18
+ const AnchorBlock = ({ blockId, events, components: { Icon, Link }, methods, properties })=>{
33
19
  const disabled = properties.disabled || get(events, 'onClick.loading');
34
- const { icon , title , ...linkProperties } = properties;
35
- return /*#__PURE__*/ React.createElement(Link, _extends({
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,
@@ -44,8 +30,9 @@ const AnchorBlock = ({ blockId , events , components: { Icon , Link } , methods
44
30
  disabled: disabled,
45
31
  onClick: ()=>methods.triggerEvent({
46
32
  name: 'onClick'
47
- })
48
- }, linkProperties), (defaultTitle)=>/*#__PURE__*/ React.createElement(React.Fragment, null, icon && /*#__PURE__*/ React.createElement(Icon, {
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') ? {
@@ -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 , content , events , methods , properties })=>/*#__PURE__*/ React.createElement("div", {
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({
@@ -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 , properties , methods } = this.props;
29
+ const { blockId, properties, methods } = this.props;
30
30
  return /*#__PURE__*/ React.createElement("div", {
31
31
  id: blockId,
32
32
  "data-testid": blockId,
@@ -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 , properties , methods })=>/*#__PURE__*/ React.createElement(HtmlComponent, {
17
+ const HtmlBlock = ({ blockId, properties, methods })=>/*#__PURE__*/ React.createElement(HtmlComponent, {
18
18
  div: true,
19
19
  html: properties.html,
20
20
  id: blockId,
@@ -12,23 +12,9 @@
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
- */ function _extends() {
16
- _extends = Object.assign || function(target) {
17
- for(var i = 1; i < arguments.length; i++){
18
- var source = arguments[i];
19
- for(var key in source){
20
- if (Object.prototype.hasOwnProperty.call(source, key)) {
21
- target[key] = source[key];
22
- }
23
- }
24
- }
25
- return target;
26
- };
27
- return _extends.apply(this, arguments);
28
- }
29
- import React from 'react';
15
+ */ import React from 'react';
30
16
  import { blockDefaultProps } from '@lowdefy/block-utils';
31
- const IconBlock = ({ components: { Icon } , ...props })=>/*#__PURE__*/ React.createElement(Icon, _extends({}, props));
17
+ const IconBlock = ({ components: { Icon }, ...props })=>/*#__PURE__*/ React.createElement(Icon, props);
32
18
  IconBlock.defaultProps = blockDefaultProps;
33
19
  IconBlock.meta = {
34
20
  category: 'display',
@@ -12,25 +12,12 @@
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
- */ function _extends() {
16
- _extends = Object.assign || function(target) {
17
- for(var i = 1; i < arguments.length; i++){
18
- var source = arguments[i];
19
- for(var key in source){
20
- if (Object.prototype.hasOwnProperty.call(source, key)) {
21
- target[key] = source[key];
22
- }
23
- }
24
- }
25
- return target;
26
- };
27
- return _extends.apply(this, arguments);
28
- }
29
- import React from 'react';
15
+ */ import React from 'react';
30
16
  import { blockDefaultProps } from '@lowdefy/block-utils';
31
- const ImgBlock = ({ blockId , events , properties , methods })=>{
32
- const { style , ...allProps } = properties;
33
- return /*#__PURE__*/ React.createElement("img", _extends({}, allProps, {
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({
@@ -43,7 +30,7 @@ const ImgBlock = ({ blockId , events , properties , methods })=>{
43
30
  },
44
31
  style
45
32
  ])
46
- }));
33
+ });
47
34
  };
48
35
  ImgBlock.defaultProps = blockDefaultProps;
49
36
  ImgBlock.meta = {
@@ -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 , events , list , methods , properties })=>{
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);
@@ -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 , content , events , methods , properties })=>/*#__PURE__*/ React.createElement("span", {
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({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/blocks-basic",
3
- "version": "4.0.0-rc.1",
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",
@@ -47,29 +47,29 @@
47
47
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
48
48
  },
49
49
  "dependencies": {
50
- "@lowdefy/block-utils": "4.0.0-rc.1",
51
- "@lowdefy/helpers": "4.0.0-rc.1",
52
- "dompurify": "2.4.1",
50
+ "@lowdefy/block-utils": "4.0.0-rc.10",
51
+ "@lowdefy/helpers": "4.0.0-rc.10",
52
+ "dompurify": "2.4.7",
53
53
  "react": "18.2.0",
54
54
  "react-dom": "18.2.0"
55
55
  },
56
56
  "devDependencies": {
57
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",
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
63
  "@testing-library/dom": "8.19.1",
64
64
  "@testing-library/react": "13.4.0",
65
65
  "@testing-library/user-event": "14.4.3",
66
66
  "copyfiles": "2.4.1",
67
- "jest": "28.1.0",
68
- "jest-environment-jsdom": "28.1.0",
67
+ "jest": "28.1.3",
68
+ "jest-environment-jsdom": "28.1.3",
69
69
  "jest-serializer-html": "7.1.0"
70
70
  },
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "ecc4f16c19eede929eda177db524cf13a8053379"
74
+ "gitHead": "537af074f27770e32da9da8d48490f2eda94b406"
75
75
  }