@lowdefy/blocks-basic 0.0.0-experimental-20260311134230 → 0.0.0-experimental-20260318092212
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.
- package/dist/blocks/Anchor/Anchor.js +22 -18
- package/dist/blocks/Anchor/e2e.js +2 -2
- package/dist/blocks/Anchor/{schema.js → meta.js} +12 -18
- package/dist/blocks/Box/Box.js +9 -16
- package/dist/blocks/Box/e2e.js +2 -2
- package/dist/blocks/Box/{schema.js → meta.js} +10 -22
- package/dist/blocks/DangerousHtml/DangerousHtml.js +5 -10
- package/dist/blocks/DangerousHtml/e2e.js +2 -2
- package/dist/blocks/DangerousHtml/{schema.js → meta.js} +6 -8
- package/dist/blocks/Html/Html.js +5 -10
- package/dist/blocks/Html/e2e.js +2 -2
- package/dist/blocks/Html/{schema.js → meta.js} +9 -18
- package/dist/blocks/Icon/Icon.js +2 -8
- package/dist/blocks/Icon/e2e.js +2 -2
- package/dist/blocks/Icon/{schema.js → meta.js} +9 -18
- package/dist/blocks/Img/Img.js +10 -18
- package/dist/blocks/Img/e2e.js +2 -2
- package/dist/blocks/Img/{schema.js → meta.js} +6 -8
- package/dist/blocks/List/List.js +8 -13
- package/dist/blocks/List/e2e.js +2 -2
- package/dist/blocks/List/{schema.js → meta.js} +9 -18
- package/dist/blocks/Span/Span.js +9 -16
- package/dist/blocks/Span/e2e.js +2 -2
- package/dist/blocks/Span/{schema.js → meta.js} +9 -18
- package/dist/blocks/Throw/Throw.js +2 -8
- package/dist/blocks/Throw/e2e.js +2 -2
- package/dist/blocks/Throw/{schema.js → meta.js} +3 -6
- package/dist/{schemas.js → metas.js} +9 -9
- package/dist/types.js +4 -19
- package/package.json +9 -9
- package/dist/blocks/Anchor/schema.json +0 -100
- package/dist/blocks/Box/schema.json +0 -34
- package/dist/blocks/DangerousHtml/schema.json +0 -30
- package/dist/blocks/Html/schema.json +0 -33
- package/dist/blocks/Icon/schema.json +0 -63
- package/dist/blocks/Img/schema.json +0 -59
- package/dist/blocks/List/schema.json +0 -40
- package/dist/blocks/Span/schema.json +0 -30
- package/dist/blocks/Throw/schema.json +0 -19
|
@@ -14,19 +14,20 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { get } from '@lowdefy/helpers';
|
|
17
|
-
import {
|
|
18
|
-
const AnchorBlock = ({ blockId, events, components: { Icon, Link }, methods, properties })=>{
|
|
17
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
18
|
+
const AnchorBlock = ({ blockId, classNames, events, components: { Icon, Link, ShortcutBadge }, methods, properties, styles })=>{
|
|
19
19
|
const disabled = properties.disabled || get(events, 'onClick.loading');
|
|
20
20
|
const { icon, title, ...linkProperties } = properties;
|
|
21
21
|
return /*#__PURE__*/ React.createElement(Link, {
|
|
22
22
|
id: blockId,
|
|
23
|
-
className:
|
|
24
|
-
|
|
25
|
-
disabled
|
|
23
|
+
className: classNames?.element,
|
|
24
|
+
style: {
|
|
25
|
+
...disabled ? {
|
|
26
26
|
color: '#BEBEBE',
|
|
27
27
|
cursor: 'not-allowed'
|
|
28
|
-
}
|
|
29
|
-
|
|
28
|
+
} : {},
|
|
29
|
+
...styles?.element
|
|
30
|
+
},
|
|
30
31
|
disabled: disabled,
|
|
31
32
|
onClick: ()=>methods.triggerEvent({
|
|
32
33
|
name: 'onClick'
|
|
@@ -34,19 +35,22 @@ const AnchorBlock = ({ blockId, events, components: { Icon, Link }, methods, pro
|
|
|
34
35
|
...linkProperties
|
|
35
36
|
}, (defaultTitle)=>/*#__PURE__*/ React.createElement(React.Fragment, null, icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
36
37
|
blockId: `${blockId}_icon`,
|
|
38
|
+
classNames: {
|
|
39
|
+
element: classNames?.icon
|
|
40
|
+
},
|
|
37
41
|
events: events,
|
|
38
42
|
properties: get(events, 'onClick.loading') ? {
|
|
39
43
|
name: 'AiOutlineLoading3Quarters',
|
|
40
44
|
spin: true
|
|
41
|
-
} : icon
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
} : icon,
|
|
46
|
+
styles: {
|
|
47
|
+
element: {
|
|
48
|
+
marginRight: 4,
|
|
49
|
+
...styles?.icon
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}), title || defaultTitle, /*#__PURE__*/ React.createElement(ShortcutBadge, {
|
|
53
|
+
shortcut: events.onClick?.shortcut
|
|
54
|
+
})));
|
|
51
55
|
};
|
|
52
|
-
export default AnchorBlock;
|
|
56
|
+
export default withBlockDefaults(AnchorBlock);
|
|
@@ -12,9 +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
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -13,7 +13,18 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ export default {
|
|
16
|
-
|
|
16
|
+
category: 'display',
|
|
17
|
+
icons: [
|
|
18
|
+
'AiOutlineLoading3Quarters'
|
|
19
|
+
],
|
|
20
|
+
valueType: null,
|
|
21
|
+
cssKeys: {
|
|
22
|
+
element: 'The anchor element.',
|
|
23
|
+
icon: 'The icon in the Anchor.'
|
|
24
|
+
},
|
|
25
|
+
events: {
|
|
26
|
+
onClick: 'Called when Anchor is clicked.'
|
|
27
|
+
},
|
|
17
28
|
properties: {
|
|
18
29
|
type: 'object',
|
|
19
30
|
additionalProperties: false,
|
|
@@ -91,27 +102,10 @@
|
|
|
91
102
|
default: false,
|
|
92
103
|
description: 'Disable scrolling to the top of the page after page transition. Can only be used with pageId link and newTab false.'
|
|
93
104
|
},
|
|
94
|
-
style: {
|
|
95
|
-
type: 'object',
|
|
96
|
-
description: 'Css style object to applied to anchor.',
|
|
97
|
-
docs: {
|
|
98
|
-
displayType: 'yaml'
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
105
|
title: {
|
|
102
106
|
type: 'string',
|
|
103
107
|
description: 'Text to display in the anchor.'
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
|
-
},
|
|
107
|
-
events: {
|
|
108
|
-
type: 'object',
|
|
109
|
-
additionalProperties: false,
|
|
110
|
-
properties: {
|
|
111
|
-
onClick: {
|
|
112
|
-
type: 'array',
|
|
113
|
-
description: 'Called when Anchor is clicked.'
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
110
|
}
|
|
117
111
|
};
|
package/dist/blocks/Box/Box.js
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
|
-
import {
|
|
17
|
-
const Box = ({ blockId, content, events, methods, properties })=>{
|
|
16
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
17
|
+
const Box = ({ blockId, classNames, content, events, methods, properties, styles })=>{
|
|
18
18
|
return /*#__PURE__*/ React.createElement("div", {
|
|
19
19
|
id: blockId,
|
|
20
20
|
"data-testid": blockId,
|
|
@@ -24,19 +24,12 @@ const Box = ({ blockId, content, events, methods, properties })=>{
|
|
|
24
24
|
onPaste: ()=>methods.triggerEvent({
|
|
25
25
|
name: 'onPaste'
|
|
26
26
|
}),
|
|
27
|
-
className:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
])
|
|
27
|
+
className: classNames?.element,
|
|
28
|
+
style: {
|
|
29
|
+
outline: 'none',
|
|
30
|
+
cursor: events.onClick && 'pointer',
|
|
31
|
+
...styles?.element
|
|
32
|
+
}
|
|
34
33
|
}, properties.content || content.content && content.content());
|
|
35
34
|
};
|
|
36
|
-
|
|
37
|
-
Box.meta = {
|
|
38
|
-
category: 'container',
|
|
39
|
-
icons: [],
|
|
40
|
-
styles: []
|
|
41
|
-
};
|
|
42
|
-
export default Box;
|
|
35
|
+
export default withBlockDefaults(Box);
|
package/dist/blocks/Box/e2e.js
CHANGED
|
@@ -12,9 +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
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -13,7 +13,16 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ export default {
|
|
16
|
-
|
|
16
|
+
category: 'container',
|
|
17
|
+
icons: [],
|
|
18
|
+
valueType: null,
|
|
19
|
+
cssKeys: {
|
|
20
|
+
element: 'The Box element.'
|
|
21
|
+
},
|
|
22
|
+
events: {
|
|
23
|
+
onClick: 'Trigger actions when the Box is clicked.',
|
|
24
|
+
onPaste: 'Trigger actions when the element is focused and a paste event is triggered.'
|
|
25
|
+
},
|
|
17
26
|
properties: {
|
|
18
27
|
type: 'object',
|
|
19
28
|
additionalProperties: false,
|
|
@@ -21,27 +30,6 @@
|
|
|
21
30
|
content: {
|
|
22
31
|
type: 'string',
|
|
23
32
|
description: 'Box content string. Overrides the "content" content area.'
|
|
24
|
-
},
|
|
25
|
-
style: {
|
|
26
|
-
type: 'object',
|
|
27
|
-
description: 'Css style object to apply to Box div.',
|
|
28
|
-
docs: {
|
|
29
|
-
displayType: 'yaml'
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
events: {
|
|
35
|
-
type: 'object',
|
|
36
|
-
additionalProperties: false,
|
|
37
|
-
properties: {
|
|
38
|
-
onClick: {
|
|
39
|
-
type: 'array',
|
|
40
|
-
description: 'Trigger actions when the Box is clicked.'
|
|
41
|
-
},
|
|
42
|
-
onPaste: {
|
|
43
|
-
type: 'array',
|
|
44
|
-
description: 'Trigger actions when the element is focused and a paste event is triggered.'
|
|
45
33
|
}
|
|
46
34
|
}
|
|
47
35
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import DOMPurify from 'dompurify';
|
|
17
|
-
import {
|
|
17
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
18
18
|
import { type } from '@lowdefy/helpers';
|
|
19
19
|
let DangerousHtml = class DangerousHtml extends React.Component {
|
|
20
20
|
componentDidMount() {
|
|
@@ -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,
|
|
29
|
+
const { blockId, classNames, styles } = this.props;
|
|
30
30
|
return /*#__PURE__*/ React.createElement("div", {
|
|
31
31
|
id: blockId,
|
|
32
32
|
"data-testid": blockId,
|
|
@@ -35,7 +35,8 @@ let DangerousHtml = class DangerousHtml extends React.Component {
|
|
|
35
35
|
this.div = el;
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
className:
|
|
38
|
+
className: classNames?.element,
|
|
39
|
+
style: styles?.element
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
constructor(props){
|
|
@@ -47,10 +48,4 @@ let DangerousHtml = class DangerousHtml extends React.Component {
|
|
|
47
48
|
this.DOMPurifyOptions = props.properties.DOMPurifyOptions;
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
-
DangerousHtml.meta = {
|
|
52
|
-
category: 'display',
|
|
53
|
-
icons: [],
|
|
54
|
-
styles: []
|
|
55
|
-
};
|
|
56
|
-
export default DangerousHtml;
|
|
51
|
+
export default withBlockDefaults(DangerousHtml);
|
|
@@ -12,9 +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
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -13,7 +13,12 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ export default {
|
|
16
|
-
|
|
16
|
+
category: 'display',
|
|
17
|
+
icons: [],
|
|
18
|
+
valueType: null,
|
|
19
|
+
cssKeys: {
|
|
20
|
+
element: 'The DangerousHtml element.'
|
|
21
|
+
},
|
|
17
22
|
properties: {
|
|
18
23
|
type: 'object',
|
|
19
24
|
additionalProperties: false,
|
|
@@ -31,13 +36,6 @@
|
|
|
31
36
|
docs: {
|
|
32
37
|
displayType: 'yaml'
|
|
33
38
|
}
|
|
34
|
-
},
|
|
35
|
-
style: {
|
|
36
|
-
type: 'object',
|
|
37
|
-
description: 'Css style object to apply to Html div.',
|
|
38
|
-
docs: {
|
|
39
|
-
displayType: 'yaml'
|
|
40
|
-
}
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
}
|
package/dist/blocks/Html/Html.js
CHANGED
|
@@ -13,19 +13,14 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
|
-
import {
|
|
17
|
-
const HtmlBlock = ({ blockId, events, properties, methods })=>/*#__PURE__*/ React.createElement(HtmlComponent, {
|
|
16
|
+
import { withBlockDefaults, HtmlComponent } from '@lowdefy/block-utils';
|
|
17
|
+
const HtmlBlock = ({ blockId, classNames, events, properties, methods, styles })=>/*#__PURE__*/ React.createElement(HtmlComponent, {
|
|
18
18
|
div: true,
|
|
19
19
|
events: events,
|
|
20
20
|
html: properties.html,
|
|
21
21
|
id: blockId,
|
|
22
22
|
methods: methods,
|
|
23
|
-
|
|
23
|
+
className: classNames?.element,
|
|
24
|
+
style: styles?.element
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
-
HtmlBlock.meta = {
|
|
27
|
-
category: 'display',
|
|
28
|
-
icons: [],
|
|
29
|
-
styles: []
|
|
30
|
-
};
|
|
31
|
-
export default HtmlBlock;
|
|
26
|
+
export default withBlockDefaults(HtmlBlock);
|
package/dist/blocks/Html/e2e.js
CHANGED
|
@@ -12,9 +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
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -13,7 +13,15 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ export default {
|
|
16
|
-
|
|
16
|
+
category: 'display',
|
|
17
|
+
icons: [],
|
|
18
|
+
valueType: null,
|
|
19
|
+
cssKeys: {
|
|
20
|
+
element: 'The Html element.'
|
|
21
|
+
},
|
|
22
|
+
events: {
|
|
23
|
+
onTextSelection: 'Trigger action when text is selected and pass selected text to the event object.'
|
|
24
|
+
},
|
|
17
25
|
properties: {
|
|
18
26
|
type: 'object',
|
|
19
27
|
additionalProperties: false,
|
|
@@ -24,23 +32,6 @@
|
|
|
24
32
|
docs: {
|
|
25
33
|
displayType: 'text-area'
|
|
26
34
|
}
|
|
27
|
-
},
|
|
28
|
-
style: {
|
|
29
|
-
type: 'object',
|
|
30
|
-
description: 'Css style object to apply to Html div.',
|
|
31
|
-
docs: {
|
|
32
|
-
displayType: 'yaml'
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
events: {
|
|
38
|
-
type: 'object',
|
|
39
|
-
additionalProperties: false,
|
|
40
|
-
properties: {
|
|
41
|
-
onTextSelection: {
|
|
42
|
-
type: 'array',
|
|
43
|
-
description: 'Trigger action when text is selected and pass selected text to the event object.'
|
|
44
35
|
}
|
|
45
36
|
}
|
|
46
37
|
}
|
package/dist/blocks/Icon/Icon.js
CHANGED
|
@@ -13,12 +13,6 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
|
-
import {
|
|
16
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
17
17
|
const IconBlock = ({ components: { Icon }, ...props })=>/*#__PURE__*/ React.createElement(Icon, props);
|
|
18
|
-
|
|
19
|
-
IconBlock.meta = {
|
|
20
|
-
category: 'display',
|
|
21
|
-
icons: [],
|
|
22
|
-
styles: []
|
|
23
|
-
};
|
|
24
|
-
export default IconBlock;
|
|
18
|
+
export default withBlockDefaults(IconBlock);
|
package/dist/blocks/Icon/e2e.js
CHANGED
|
@@ -12,9 +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
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
// Icon renders an SVG without a blockId on the root element — use the block wrapper.
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -13,7 +13,15 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ export default {
|
|
16
|
-
|
|
16
|
+
category: 'display',
|
|
17
|
+
icons: [],
|
|
18
|
+
valueType: null,
|
|
19
|
+
cssKeys: {
|
|
20
|
+
element: 'The Icon element.'
|
|
21
|
+
},
|
|
22
|
+
events: {
|
|
23
|
+
onClick: 'Trigger actions when icon is clicked.'
|
|
24
|
+
},
|
|
17
25
|
properties: {
|
|
18
26
|
type: 'object',
|
|
19
27
|
additionalProperties: false,
|
|
@@ -53,28 +61,11 @@
|
|
|
53
61
|
type: 'string',
|
|
54
62
|
description: 'Icon hover title for accessibility.'
|
|
55
63
|
},
|
|
56
|
-
style: {
|
|
57
|
-
type: 'object',
|
|
58
|
-
description: 'CSS style object.',
|
|
59
|
-
docs: {
|
|
60
|
-
displayType: 'yaml'
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
64
|
disableLoadingIcon: {
|
|
64
65
|
type: 'boolean',
|
|
65
66
|
default: false,
|
|
66
67
|
description: "While loading after the icon has been clicked, don't render the loading icon."
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
},
|
|
70
|
-
events: {
|
|
71
|
-
type: 'object',
|
|
72
|
-
additionalProperties: false,
|
|
73
|
-
properties: {
|
|
74
|
-
onClick: {
|
|
75
|
-
type: 'array',
|
|
76
|
-
description: 'Trigger actions when icon is clicked.'
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
70
|
}
|
|
80
71
|
};
|
package/dist/blocks/Img/Img.js
CHANGED
|
@@ -13,29 +13,21 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
|
-
import {
|
|
17
|
-
const ImgBlock = ({ blockId, events, properties, methods })=>{
|
|
18
|
-
const { style, ...allProps } = properties;
|
|
16
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
17
|
+
const ImgBlock = ({ blockId, classNames, events, properties, methods, styles })=>{
|
|
19
18
|
return /*#__PURE__*/ React.createElement("img", {
|
|
20
|
-
...
|
|
19
|
+
...properties,
|
|
21
20
|
id: blockId,
|
|
22
21
|
"data-testid": blockId,
|
|
23
22
|
onClick: ()=>methods.triggerEvent({
|
|
24
23
|
name: 'onClick'
|
|
25
24
|
}),
|
|
26
|
-
className:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
])
|
|
25
|
+
className: classNames?.element,
|
|
26
|
+
style: {
|
|
27
|
+
outline: 'none',
|
|
28
|
+
cursor: events.onClick && 'pointer',
|
|
29
|
+
...styles?.element
|
|
30
|
+
}
|
|
33
31
|
});
|
|
34
32
|
};
|
|
35
|
-
|
|
36
|
-
ImgBlock.meta = {
|
|
37
|
-
category: 'display',
|
|
38
|
-
icons: [],
|
|
39
|
-
styles: []
|
|
40
|
-
};
|
|
41
|
-
export default ImgBlock;
|
|
33
|
+
export default withBlockDefaults(ImgBlock);
|
package/dist/blocks/Img/e2e.js
CHANGED
|
@@ -12,9 +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
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -13,7 +13,12 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ export default {
|
|
16
|
-
|
|
16
|
+
category: 'display',
|
|
17
|
+
icons: [],
|
|
18
|
+
valueType: null,
|
|
19
|
+
cssKeys: {
|
|
20
|
+
element: 'The Img element.'
|
|
21
|
+
},
|
|
17
22
|
properties: {
|
|
18
23
|
type: 'object',
|
|
19
24
|
additionalProperties: false,
|
|
@@ -69,13 +74,6 @@
|
|
|
69
74
|
displayType: 'text-area'
|
|
70
75
|
}
|
|
71
76
|
},
|
|
72
|
-
style: {
|
|
73
|
-
type: 'object',
|
|
74
|
-
description: 'Css style object to applied to the image.',
|
|
75
|
-
docs: {
|
|
76
|
-
displayType: 'yaml'
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
77
|
width: {
|
|
80
78
|
type: 'number',
|
|
81
79
|
description: 'Width of the image.'
|
package/dist/blocks/List/List.js
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React, { useEffect } from 'react';
|
|
16
|
-
import {
|
|
16
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
17
17
|
import Box from '../Box/Box.js';
|
|
18
|
-
const List = ({ blockId, events, list, methods, properties })=>{
|
|
18
|
+
const List = ({ blockId, classNames, events, list, methods, properties, styles })=>{
|
|
19
19
|
useEffect(()=>{
|
|
20
20
|
methods.registerMethod('pushItem', methods.pushItem);
|
|
21
21
|
methods.registerMethod('unshiftItem', methods.unshiftItem);
|
|
@@ -26,15 +26,17 @@ const List = ({ blockId, events, list, methods, properties })=>{
|
|
|
26
26
|
return /*#__PURE__*/ React.createElement(Box, {
|
|
27
27
|
blockId: blockId,
|
|
28
28
|
events: events,
|
|
29
|
-
properties: {
|
|
30
|
-
|
|
29
|
+
properties: {},
|
|
30
|
+
classNames: classNames,
|
|
31
|
+
styles: {
|
|
32
|
+
element: {
|
|
31
33
|
...properties.direction ? {
|
|
32
34
|
display: 'flex',
|
|
33
35
|
flexDirection: properties.direction,
|
|
34
36
|
flexWrap: properties.wrap ? properties.wrap : 'wrap',
|
|
35
37
|
overflow: properties.scroll ? 'auto' : 'visible'
|
|
36
38
|
} : {},
|
|
37
|
-
...
|
|
39
|
+
...styles?.element
|
|
38
40
|
}
|
|
39
41
|
},
|
|
40
42
|
methods: methods,
|
|
@@ -43,11 +45,4 @@ const List = ({ blockId, events, list, methods, properties })=>{
|
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
};
|
|
46
|
-
|
|
47
|
-
List.meta = {
|
|
48
|
-
category: 'list',
|
|
49
|
-
valueType: 'array',
|
|
50
|
-
icons: [],
|
|
51
|
-
styles: []
|
|
52
|
-
};
|
|
53
|
-
export default List;
|
|
48
|
+
export default withBlockDefaults(List);
|
package/dist/blocks/List/e2e.js
CHANGED
|
@@ -12,9 +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
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -13,7 +13,15 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ export default {
|
|
16
|
-
|
|
16
|
+
category: 'list',
|
|
17
|
+
icons: [],
|
|
18
|
+
valueType: 'array',
|
|
19
|
+
cssKeys: {
|
|
20
|
+
element: 'The List element.'
|
|
21
|
+
},
|
|
22
|
+
events: {
|
|
23
|
+
onClick: 'Trigger actions when the List is clicked.'
|
|
24
|
+
},
|
|
17
25
|
properties: {
|
|
18
26
|
type: 'object',
|
|
19
27
|
additionalProperties: false,
|
|
@@ -40,23 +48,6 @@
|
|
|
40
48
|
scroll: {
|
|
41
49
|
type: 'boolean',
|
|
42
50
|
description: "Specifies whether scrolling should be applied to the List, can be true or false. Applies the 'overflow' css property to the List block - defaults to 'visible', requires List direction to be set."
|
|
43
|
-
},
|
|
44
|
-
style: {
|
|
45
|
-
type: 'object',
|
|
46
|
-
description: 'Css style object to apply to List block.',
|
|
47
|
-
docs: {
|
|
48
|
-
displayType: 'yaml'
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
events: {
|
|
54
|
-
type: 'object',
|
|
55
|
-
additionalProperties: false,
|
|
56
|
-
properties: {
|
|
57
|
-
onClick: {
|
|
58
|
-
type: 'array',
|
|
59
|
-
description: 'Trigger actions when the List is clicked.'
|
|
60
51
|
}
|
|
61
52
|
}
|
|
62
53
|
}
|