@lowdefy/blocks-basic 3.23.2 → 4.0.0-alpha.6

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.
Files changed (44) hide show
  1. package/dist/blocks/Anchor/Anchor.js +89 -0
  2. package/dist/blocks/Anchor/schema.json +61 -0
  3. package/dist/blocks/Box/Box.js +42 -0
  4. package/dist/blocks/Box/schema.json +30 -0
  5. package/dist/blocks/DangerousHtml/DangerousHtml.js +58 -0
  6. package/dist/blocks/DangerousHtml/schema.json +30 -0
  7. package/dist/blocks/Html/Html.js +33 -0
  8. package/dist/blocks/Html/schema.json +23 -0
  9. package/dist/blocks/Icon/Icon.js +29 -0
  10. package/dist/blocks/Icon/schema.json +63 -0
  11. package/dist/blocks/Img/Img.js +44 -0
  12. package/dist/blocks/Img/schema.json +59 -0
  13. package/dist/blocks/List/List.js +56 -0
  14. package/dist/blocks/List/schema.json +40 -0
  15. package/dist/blocks/Span/Span.js +42 -0
  16. package/dist/blocks/Span/schema.json +30 -0
  17. package/dist/blocks.js +22 -0
  18. package/dist/types.js +32 -0
  19. package/package.json +35 -37
  20. package/dist/14.js +0 -2
  21. package/dist/14.js.LICENSE.txt +0 -43
  22. package/dist/203.js +0 -1
  23. package/dist/22.js +0 -1
  24. package/dist/261.js +0 -1
  25. package/dist/328.js +0 -2
  26. package/dist/328.js.LICENSE.txt +0 -1
  27. package/dist/330.js +0 -1
  28. package/dist/397.js +0 -1
  29. package/dist/52.js +0 -1
  30. package/dist/700.js +0 -1
  31. package/dist/757.js +0 -2
  32. package/dist/757.js.LICENSE.txt +0 -14
  33. package/dist/93.js +0 -1
  34. package/dist/941.js +0 -1
  35. package/dist/964.js +0 -1
  36. package/dist/main.js +0 -1
  37. package/dist/meta/Box.json +0 -1
  38. package/dist/meta/Context.json +0 -1
  39. package/dist/meta/DangerousHtml.json +0 -1
  40. package/dist/meta/Html.json +0 -1
  41. package/dist/meta/Img.json +0 -1
  42. package/dist/meta/List.json +0 -1
  43. package/dist/meta/Span.json +0 -1
  44. package/dist/remoteEntry.js +0 -1
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /*
3
+ Copyright 2020-2021 Lowdefy, Inc
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ */ import React from 'react';
17
+ import { blockDefaultProps } from '@lowdefy/block-utils';
18
+ const Span = ({ blockId , content , events , methods , properties })=>/*#__PURE__*/ _jsx("span", {
19
+ id: blockId,
20
+ "data-testid": blockId,
21
+ onClick: ()=>methods.triggerEvent({
22
+ name: 'onClick'
23
+ })
24
+ ,
25
+ className: methods.makeCssClass([
26
+ {
27
+ outline: 'none',
28
+ cursor: events.onClick && 'pointer'
29
+ },
30
+ properties.style,
31
+ ]),
32
+ children: properties.content || content.content && content.content()
33
+ })
34
+ ;
35
+ Span.defaultProps = blockDefaultProps;
36
+ Span.meta = {
37
+ category: 'container',
38
+ loading: false,
39
+ icons: [],
40
+ styles: []
41
+ };
42
+ export default Span;
@@ -0,0 +1,30 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "properties": {
7
+ "content": {
8
+ "type": "string",
9
+ "description": "Span content string. Overrides the \"content\" content area."
10
+ },
11
+ "style": {
12
+ "type": "object",
13
+ "description": "Css style object to apply to Span div.",
14
+ "docs": {
15
+ "displayType": "yaml"
16
+ }
17
+ }
18
+ }
19
+ },
20
+ "events": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "properties": {
24
+ "onClick": {
25
+ "type": "array",
26
+ "description": "Trigger actions when the Span is clicked."
27
+ }
28
+ }
29
+ }
30
+ }
package/dist/blocks.js ADDED
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright 2020-2021 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 as Anchor } from './blocks/Anchor/Anchor.js';
16
+ export { default as Box } from './blocks/Box/Box.js';
17
+ export { default as DangerousHtml } from './blocks/DangerousHtml/DangerousHtml.js';
18
+ export { default as Html } from './blocks/Html/Html.js';
19
+ export { default as Icon } from './blocks/Icon/Icon.js';
20
+ export { default as Img } from './blocks/Img/Img.js';
21
+ export { default as List } from './blocks/List/List.js';
22
+ export { default as Span } from './blocks/Span/Span.js';
package/dist/types.js ADDED
@@ -0,0 +1,32 @@
1
+ /* eslint-disable import/namespace */ /*
2
+ Copyright 2020-2021 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 * as blocks from './blocks.js';
16
+ const icons = {};
17
+ const styles = {};
18
+ Object.keys(blocks).forEach((block)=>{
19
+ icons[block] = blocks[block].meta.icons || [];
20
+ styles[block] = blocks[block].meta.styles || [];
21
+ });
22
+ export default {
23
+ blocks: Object.keys(blocks),
24
+ icons,
25
+ styles: {
26
+ default: [],
27
+ ...styles
28
+ }
29
+ }; // export default {
30
+ // blocks: ['Anchor', 'Box', 'DangerousHtml', 'Html', 'Icon', 'Img', 'List', 'Span'],
31
+ // styles: { default: ['style.less'], Anchor: ['blocks/Anchor/style.less'] },
32
+ // };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/blocks-basic",
3
- "version": "3.23.2",
3
+ "version": "4.0.0-alpha.6",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Basic html Lowdefy blocks.",
6
6
  "homepage": "https://lowdefy.com",
@@ -19,60 +19,58 @@
19
19
  {
20
20
  "name": "Gerrie van Wyk",
21
21
  "url": "https://github.com/Gervwyk"
22
+ },
23
+ {
24
+ "name": "Sandile Memela",
25
+ "url": "https://github.com/sah-memela"
22
26
  }
23
27
  ],
24
28
  "repository": {
25
29
  "type": "git",
26
30
  "url": "https://github.com/lowdefy/lowdefy.git"
27
31
  },
28
- "browser": "dist/remoteEntry.js",
32
+ "type": "module",
33
+ "exports": {
34
+ "./*": "./dist/*",
35
+ "./blocks": "./dist/blocks.js",
36
+ "./types": "./dist/types.js"
37
+ },
29
38
  "files": [
30
39
  "dist/*"
31
40
  ],
32
41
  "scripts": {
33
- "build": "webpack --config webpack.prod.js",
42
+ "build": "yarn swc",
34
43
  "clean": "rm -rf dist",
44
+ "copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
35
45
  "prepare": "yarn build",
36
- "start": "webpack serve --config webpack.demo.js",
37
- "start:dev": "webpack serve --config webpack.dev.js",
38
- "test": "jest --coverage --config jest.config.js --no-cache"
46
+ "swc": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && yarn copyfiles",
47
+ "test:watch": "jest --coverage --watch",
48
+ "test": "jest --coverage"
39
49
  },
40
50
  "dependencies": {
41
- "@lowdefy/block-tools": "3.23.2",
42
- "dompurify": "2.2.8",
43
- "react": "17.0.2",
44
- "react-dom": "17.0.2"
51
+ "@lowdefy/block-utils": "4.0.0-alpha.6",
52
+ "@lowdefy/helpers": "4.0.0-alpha.6",
53
+ "dompurify": "2.3.3",
54
+ "react": "18.0.0-alpha-327d5c484-20211106",
55
+ "react-dom": "18.0.0-alpha-327d5c484-20211106"
45
56
  },
46
57
  "devDependencies": {
47
- "@babel/cli": "7.14.3",
48
- "@babel/core": "7.14.3",
49
- "@babel/preset-env": "7.14.4",
50
- "@babel/preset-react": "7.13.13",
51
- "@lowdefy/helpers": "3.23.2",
52
- "@wojtekmaj/enzyme-adapter-react-17": "0.6.1",
53
- "babel-jest": "26.6.3",
54
- "babel-loader": "8.2.2",
55
- "buffer": "6.0.3",
56
- "clean-webpack-plugin": "3.0.0",
57
- "copy-webpack-plugin": "9.0.0",
58
- "css-loader": "5.2.6",
59
- "enzyme": "3.11.0",
60
- "html-webpack-plugin": "5.3.1",
61
- "identity-obj-proxy": "3.0.0",
62
- "jest": "26.6.3",
63
- "js-yaml": "4.1.0",
64
- "react-markdown": "5.0.3",
65
- "react-syntax-highlighter": "15.4.3",
66
- "style-loader": "2.0.0",
67
- "webpack": "5.38.1",
68
- "webpack-cli": "4.7.0",
69
- "webpack-dev-server": "3.11.2",
70
- "webpack-merge": "5.7.3",
71
- "yaml-jest": "1.0.5",
72
- "yaml-loader": "0.6.0"
58
+ "@babel/preset-react": "7.16.0",
59
+ "@emotion/jest": "11.5.0",
60
+ "@lowdefy/block-dev": "4.0.0-alpha.6",
61
+ "@swc/cli": "0.1.55",
62
+ "@swc/core": "1.2.130",
63
+ "@swc/jest": "0.2.17",
64
+ "@testing-library/dom": "8.10.1",
65
+ "@testing-library/react": "13.0.0-alpha.4",
66
+ "@testing-library/user-event": "14.0.0-alpha.14",
67
+ "copyfiles": "2.4.1",
68
+ "jest": "27.3.1",
69
+ "jest-serializer-html": "7.1.0",
70
+ "jest-transform-yaml": "0.1.2"
73
71
  },
74
72
  "publishConfig": {
75
73
  "access": "public"
76
74
  },
77
- "gitHead": "4c30d3cdfa99ae4e90fc891825938c28bad45760"
75
+ "gitHead": "2530e31af795b6a3c75ac8f72c8dbe0ab5d1251b"
78
76
  }