@lowdefy/blocks-basic 0.0.0-experimental-20260703130251 → 0.0.0-experimental-20260706093008
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/Dynamic/Dynamic.js +35 -0
- package/dist/blocks/Dynamic/e2e.js +16 -0
- package/dist/blocks/Dynamic/meta.js +76 -0
- package/dist/blocks.js +1 -0
- package/dist/e2e.js +1 -0
- package/dist/metas.js +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
17
|
+
// Server-resolved container. The server fills the content slot at page get by
|
|
18
|
+
// calling the configured api endpoint — by the time config reaches the client,
|
|
19
|
+
// content holds the resolved blocks (or the fallback blocks on failure).
|
|
20
|
+
const Dynamic = ({ blockId, classNames, content, events, methods, styles })=>{
|
|
21
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
22
|
+
id: blockId,
|
|
23
|
+
"data-testid": blockId,
|
|
24
|
+
onClick: ()=>methods.triggerEvent({
|
|
25
|
+
name: 'onClick'
|
|
26
|
+
}),
|
|
27
|
+
className: classNames?.element,
|
|
28
|
+
style: {
|
|
29
|
+
outline: 'none',
|
|
30
|
+
cursor: events.onClick && 'pointer',
|
|
31
|
+
...styles?.element
|
|
32
|
+
}
|
|
33
|
+
}, content.content && content.content());
|
|
34
|
+
};
|
|
35
|
+
export default withBlockDefaults(Dynamic);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Dynamic renders a plain container div like Box — same e2e surface.
|
|
16
|
+
export { default } from '../Box/e2e.js';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
category: 'container',
|
|
17
|
+
icons: [],
|
|
18
|
+
valueType: null,
|
|
19
|
+
slots: {
|
|
20
|
+
content: 'Server-resolved blocks — filled at page get, do not define in config.',
|
|
21
|
+
fallback: 'Blocks rendered when resolution fails and required is false.'
|
|
22
|
+
},
|
|
23
|
+
cssKeys: {
|
|
24
|
+
element: 'The Dynamic element.'
|
|
25
|
+
},
|
|
26
|
+
events: {
|
|
27
|
+
onClick: 'Trigger actions when the Dynamic container is clicked.'
|
|
28
|
+
},
|
|
29
|
+
properties: {
|
|
30
|
+
type: 'object',
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
properties: {
|
|
33
|
+
endpointId: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'Required. The api endpoint that resolves this block content at page get. InternalApi endpoints are recommended.'
|
|
36
|
+
},
|
|
37
|
+
params: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
description: 'Static values passed to the endpoint payload as params. Operators are not allowed — read runtime values in the endpoint routine with _payload, _user or _secret.'
|
|
40
|
+
},
|
|
41
|
+
required: {
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
default: false,
|
|
44
|
+
description: 'When true, a resolution failure fails the whole page request instead of rendering the fallback slot.'
|
|
45
|
+
},
|
|
46
|
+
types: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
description: 'Extra block, action and operator types the endpoint may return, so build includes them in the client bundle.',
|
|
49
|
+
additionalProperties: false,
|
|
50
|
+
properties: {
|
|
51
|
+
blocks: {
|
|
52
|
+
type: 'array',
|
|
53
|
+
items: {
|
|
54
|
+
type: 'string'
|
|
55
|
+
},
|
|
56
|
+
description: 'Block types the endpoint may return.'
|
|
57
|
+
},
|
|
58
|
+
actions: {
|
|
59
|
+
type: 'array',
|
|
60
|
+
items: {
|
|
61
|
+
type: 'string'
|
|
62
|
+
},
|
|
63
|
+
description: 'Action types the endpoint may return.'
|
|
64
|
+
},
|
|
65
|
+
operators: {
|
|
66
|
+
type: 'array',
|
|
67
|
+
items: {
|
|
68
|
+
type: 'string'
|
|
69
|
+
},
|
|
70
|
+
description: 'Client operator types the endpoint may return.'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
package/dist/blocks.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/ export { default as Anchor } from './blocks/Anchor/Anchor.js';
|
|
16
16
|
export { default as Box } from './blocks/Box/Box.js';
|
|
17
17
|
export { default as DangerousHtml } from './blocks/DangerousHtml/DangerousHtml.js';
|
|
18
|
+
export { default as Dynamic } from './blocks/Dynamic/Dynamic.js';
|
|
18
19
|
export { default as Html } from './blocks/Html/Html.js';
|
|
19
20
|
export { default as Icon } from './blocks/Icon/Icon.js';
|
|
20
21
|
export { default as Img } from './blocks/Img/Img.js';
|
package/dist/e2e.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/ export { default as Anchor } from './blocks/Anchor/e2e.js';
|
|
16
16
|
export { default as Box } from './blocks/Box/e2e.js';
|
|
17
17
|
export { default as DangerousHtml } from './blocks/DangerousHtml/e2e.js';
|
|
18
|
+
export { default as Dynamic } from './blocks/Dynamic/e2e.js';
|
|
18
19
|
export { default as Html } from './blocks/Html/e2e.js';
|
|
19
20
|
export { default as Icon } from './blocks/Icon/e2e.js';
|
|
20
21
|
export { default as Img } from './blocks/Img/e2e.js';
|
package/dist/metas.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/ export { default as Anchor } from './blocks/Anchor/meta.js';
|
|
16
16
|
export { default as Box } from './blocks/Box/meta.js';
|
|
17
17
|
export { default as DangerousHtml } from './blocks/DangerousHtml/meta.js';
|
|
18
|
+
export { default as Dynamic } from './blocks/Dynamic/meta.js';
|
|
18
19
|
export { default as Html } from './blocks/Html/meta.js';
|
|
19
20
|
export { default as Icon } from './blocks/Icon/meta.js';
|
|
20
21
|
export { default as Img } from './blocks/Img/meta.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/blocks-basic",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260706093008",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Basic html Lowdefy blocks.",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
"dist/*"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
46
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
47
|
-
"dompurify": "3.2
|
|
45
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20260706093008",
|
|
46
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260706093008",
|
|
47
|
+
"dompurify": "3.4.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": ">=18",
|
|
51
51
|
"react-dom": ">=18"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@lowdefy/block-dev-e2e": "0.0.0-experimental-
|
|
55
|
-
"@lowdefy/e2e-utils": "0.0.0-experimental-
|
|
56
|
-
"@playwright/test": "1.
|
|
57
|
-
"@swc/cli": "0.8.
|
|
58
|
-
"@swc/core": "1.15.
|
|
54
|
+
"@lowdefy/block-dev-e2e": "0.0.0-experimental-20260706093008",
|
|
55
|
+
"@lowdefy/e2e-utils": "0.0.0-experimental-20260706093008",
|
|
56
|
+
"@playwright/test": "1.59.1",
|
|
57
|
+
"@swc/cli": "0.8.1",
|
|
58
|
+
"@swc/core": "1.15.32",
|
|
59
59
|
"copyfiles": "2.4.1"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|