@lowdefy/blocks-loaders 4.0.0-rc.9 → 4.0.0
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/ProgressBar/ProgressBar.js +6 -6
- package/dist/blocks/Skeleton/Skeleton.js +4 -4
- package/dist/blocks/Skeleton/style.less +1 -1
- package/dist/blocks/SkeletonAvatar/SkeletonAvatar.js +3 -3
- package/dist/blocks/SkeletonAvatar/style.less +1 -1
- package/dist/blocks/SkeletonButton/SkeletonButton.js +4 -4
- package/dist/blocks/SkeletonButton/style.less +1 -1
- package/dist/blocks/SkeletonInput/SkeletonInput.js +6 -6
- package/dist/blocks/SkeletonInput/style.less +1 -1
- package/dist/blocks/SkeletonParagraph/SkeletonParagraph.js +4 -4
- package/dist/blocks/SkeletonParagraph/style.less +1 -1
- package/dist/blocks/Spinner/Spinner.js +3 -3
- package/dist/blocks/Spinner/style.less +1 -1
- package/dist/blocks.js +1 -1
- package/dist/types.js +3 -3
- package/package.json +17 -19
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
|
-
const ProgressBar = ({ blockId
|
|
18
|
-
const { progress =30
|
|
17
|
+
const ProgressBar = ({ blockId, methods, style, properties })=>{
|
|
18
|
+
const { progress = 30, height = 4, transitionTime = 1000, // loaderSpeed = 500,
|
|
19
19
|
// waitingTime = 1000,
|
|
20
|
-
shadow =true
|
|
20
|
+
shadow = true } = properties;
|
|
21
21
|
return /*#__PURE__*/ React.createElement("div", {
|
|
22
22
|
id: blockId,
|
|
23
23
|
className: methods.makeCssClass(style),
|
|
24
24
|
style: {
|
|
25
|
-
'--height': height
|
|
26
|
-
'--progress': progress
|
|
27
|
-
'--transition':
|
|
25
|
+
'--height': `${height}px`,
|
|
26
|
+
'--progress': `${progress}%`,
|
|
27
|
+
'--transition': `all ${transitionTime}ms ease`,
|
|
28
28
|
'--opacity': progress < 100 ? 1 : 0
|
|
29
29
|
}
|
|
30
30
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
|
-
const Skeleton = ({ properties
|
|
17
|
+
const Skeleton = ({ properties, methods })=>{
|
|
18
18
|
return /*#__PURE__*/ React.createElement("div", {
|
|
19
19
|
className: 'skeleton ' + methods.makeCssClass(properties.style),
|
|
20
20
|
style: {
|
|
21
|
-
width: properties.width
|
|
22
|
-
height: properties.height
|
|
21
|
+
width: properties.width ?? '100%',
|
|
22
|
+
height: properties.height ?? '100%'
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
import { type } from '@lowdefy/helpers';
|
|
17
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
18
|
import Skeleton from '../Skeleton/Skeleton.js';
|
|
19
|
-
const SkeletonAvatar = ({ properties
|
|
20
|
-
let size = properties.size
|
|
19
|
+
const SkeletonAvatar = ({ properties, methods })=>{
|
|
20
|
+
let size = properties.size ?? 32;
|
|
21
21
|
if (type.isString(size)) {
|
|
22
22
|
switch(properties.size){
|
|
23
23
|
case 'small':
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
17
|
import Skeleton from '../Skeleton/Skeleton.js';
|
|
18
|
-
const SkeletonButton = ({ properties
|
|
18
|
+
const SkeletonButton = ({ properties, methods })=>{
|
|
19
19
|
let height;
|
|
20
20
|
switch(properties.size){
|
|
21
21
|
case 'small':
|
|
@@ -36,8 +36,8 @@ const SkeletonButton = ({ properties , methods })=>{
|
|
|
36
36
|
},
|
|
37
37
|
...properties.style || {}
|
|
38
38
|
},
|
|
39
|
-
width: properties.width
|
|
40
|
-
height
|
|
39
|
+
width: properties.width ?? '100%',
|
|
40
|
+
height
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
17
|
import Skeleton from '../Skeleton/Skeleton.js';
|
|
18
|
-
const SkeletonInput = ({ properties
|
|
18
|
+
const SkeletonInput = ({ properties, methods })=>{
|
|
19
19
|
let inputHeight;
|
|
20
20
|
switch(properties.size){
|
|
21
21
|
case 'small':
|
|
@@ -30,8 +30,8 @@ const SkeletonInput = ({ properties , methods })=>{
|
|
|
30
30
|
return /*#__PURE__*/ React.createElement("div", null, properties.label !== false && /*#__PURE__*/ React.createElement(Skeleton, {
|
|
31
31
|
methods: methods,
|
|
32
32
|
properties: {
|
|
33
|
-
width: properties.labelWidth
|
|
34
|
-
height: properties.labelHeight
|
|
33
|
+
width: properties.labelWidth ?? properties.width ?? '30%',
|
|
34
|
+
height: properties.labelHeight ?? 20,
|
|
35
35
|
style: {
|
|
36
36
|
...{
|
|
37
37
|
marginBottom: 10
|
|
@@ -42,8 +42,8 @@ const SkeletonInput = ({ properties , methods })=>{
|
|
|
42
42
|
}), /*#__PURE__*/ React.createElement(Skeleton, {
|
|
43
43
|
methods: methods,
|
|
44
44
|
properties: {
|
|
45
|
-
width: properties.width
|
|
46
|
-
height: properties.inputHeight
|
|
45
|
+
width: properties.width ?? '100%',
|
|
46
|
+
height: properties.inputHeight ?? inputHeight,
|
|
47
47
|
style: properties.inputStyle || {}
|
|
48
48
|
}
|
|
49
49
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
17
|
import Skeleton from '../Skeleton/Skeleton.js';
|
|
18
|
-
const SkeletonParagraph = ({ properties
|
|
18
|
+
const SkeletonParagraph = ({ properties, methods })=>{
|
|
19
19
|
const lines = [
|
|
20
|
-
...Array(properties.lines
|
|
20
|
+
...Array(properties.lines ?? 4).keys()
|
|
21
21
|
];
|
|
22
22
|
return /*#__PURE__*/ React.createElement("div", {
|
|
23
23
|
style: {
|
|
24
|
-
width: properties.width
|
|
24
|
+
width: properties.width ?? '100%'
|
|
25
25
|
}
|
|
26
26
|
}, lines.map((key)=>/*#__PURE__*/ React.createElement(Skeleton, {
|
|
27
27
|
key: key,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { type } from '@lowdefy/helpers';
|
|
17
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
|
-
const Spinner = ({ properties
|
|
19
|
-
let size = properties.size
|
|
18
|
+
const Spinner = ({ properties, methods })=>{
|
|
19
|
+
let size = properties.size ?? 20;
|
|
20
20
|
if (type.isString(size)) {
|
|
21
21
|
switch(properties.size){
|
|
22
22
|
case 'small':
|
package/dist/blocks.js
CHANGED
package/dist/types.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/namespace */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
const icons = {};
|
|
17
17
|
const styles = {};
|
|
18
18
|
Object.keys(blocks).forEach((block)=>{
|
|
19
|
-
icons[block] = blocks[block].meta.icons
|
|
20
|
-
styles[block] = blocks[block].meta.styles
|
|
19
|
+
icons[block] = blocks[block].meta.icons ?? [];
|
|
20
|
+
styles[block] = blocks[block].meta.styles ?? [];
|
|
21
21
|
});
|
|
22
22
|
export default {
|
|
23
23
|
blocks: Object.keys(blocks),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/blocks-loaders",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lowdefy loader blocks.",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -39,36 +39,34 @@
|
|
|
39
39
|
"files": [
|
|
40
40
|
"dist/*"
|
|
41
41
|
],
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && pnpm copyfiles",
|
|
44
|
-
"clean": "rm -rf dist",
|
|
45
|
-
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
|
|
46
|
-
"prepublishOnly": "pnpm build",
|
|
47
|
-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
48
|
-
},
|
|
49
42
|
"dependencies": {
|
|
50
|
-
"@lowdefy/block-utils": "4.0.0
|
|
51
|
-
"@lowdefy/helpers": "4.0.0
|
|
43
|
+
"@lowdefy/block-utils": "4.0.0",
|
|
44
|
+
"@lowdefy/helpers": "4.0.0",
|
|
52
45
|
"react": "18.2.0",
|
|
53
46
|
"react-dom": "18.2.0"
|
|
54
47
|
},
|
|
55
48
|
"devDependencies": {
|
|
56
49
|
"@emotion/jest": "11.10.5",
|
|
57
|
-
"@lowdefy/block-dev": "4.0.0
|
|
58
|
-
"@lowdefy/jest-yaml-transform": "4.0.0
|
|
59
|
-
"@swc/cli": "0.1.
|
|
60
|
-
"@swc/core": "1.3.
|
|
61
|
-
"@swc/jest": "0.2.
|
|
50
|
+
"@lowdefy/block-dev": "4.0.0",
|
|
51
|
+
"@lowdefy/jest-yaml-transform": "4.0.0",
|
|
52
|
+
"@swc/cli": "0.1.63",
|
|
53
|
+
"@swc/core": "1.3.99",
|
|
54
|
+
"@swc/jest": "0.2.29",
|
|
62
55
|
"@testing-library/dom": "8.19.1",
|
|
63
56
|
"@testing-library/react": "13.4.0",
|
|
64
57
|
"@testing-library/user-event": "14.4.3",
|
|
65
58
|
"copyfiles": "2.4.1",
|
|
66
|
-
"jest": "28.1.
|
|
67
|
-
"jest-environment-jsdom": "28.1.
|
|
59
|
+
"jest": "28.1.3",
|
|
60
|
+
"jest-environment-jsdom": "28.1.3",
|
|
68
61
|
"jest-serializer-html": "7.1.0"
|
|
69
62
|
},
|
|
70
63
|
"publishConfig": {
|
|
71
64
|
"access": "public"
|
|
72
65
|
},
|
|
73
|
-
"
|
|
74
|
-
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && pnpm copyfiles",
|
|
68
|
+
"clean": "rm -rf dist",
|
|
69
|
+
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
|
|
70
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
71
|
+
}
|
|
72
|
+
}
|