@lowdefy/blocks-qr 4.7.2 → 5.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.
|
@@ -13,7 +13,7 @@
|
|
|
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
|
import { Html5Qrcode } from 'html5-qrcode';
|
|
18
18
|
const codes = {
|
|
19
19
|
QR_CODE: 0,
|
|
@@ -75,12 +75,11 @@ let QRScanner = class QRScanner extends React.Component {
|
|
|
75
75
|
this.onStop();
|
|
76
76
|
}
|
|
77
77
|
render() {
|
|
78
|
-
const { blockId,
|
|
78
|
+
const { blockId, classNames, styles } = this.props;
|
|
79
79
|
return /*#__PURE__*/ React.createElement("div", {
|
|
80
80
|
id: blockId,
|
|
81
|
-
className:
|
|
82
|
-
|
|
83
|
-
])
|
|
81
|
+
className: classNames?.element,
|
|
82
|
+
style: styles?.element
|
|
84
83
|
});
|
|
85
84
|
}
|
|
86
85
|
constructor(props){
|
|
@@ -91,11 +90,4 @@ let QRScanner = class QRScanner extends React.Component {
|
|
|
91
90
|
this.scanning = false;
|
|
92
91
|
}
|
|
93
92
|
};
|
|
94
|
-
|
|
95
|
-
QRScanner.meta = {
|
|
96
|
-
valueType: 'object',
|
|
97
|
-
category: 'input',
|
|
98
|
-
icons: [],
|
|
99
|
-
styles: []
|
|
100
|
-
};
|
|
101
|
-
export default QRScanner;
|
|
93
|
+
export default withBlockDefaults(QRScanner);
|
|
@@ -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: 'input',
|
|
17
|
+
icons: [],
|
|
18
|
+
valueType: 'object',
|
|
19
|
+
cssKeys: {
|
|
20
|
+
element: 'The QRScanner element.'
|
|
21
|
+
},
|
|
22
|
+
events: {
|
|
23
|
+
onScan: 'Trigger actions when code is scanned.'
|
|
24
|
+
},
|
|
17
25
|
properties: {
|
|
18
26
|
type: 'object',
|
|
19
27
|
additionalProperties: false,
|
|
@@ -68,20 +76,6 @@
|
|
|
68
76
|
'UPC_EAN_EXTENSION'
|
|
69
77
|
]
|
|
70
78
|
}
|
|
71
|
-
},
|
|
72
|
-
style: {
|
|
73
|
-
type: 'object',
|
|
74
|
-
description: 'Custom css properties to apply to scanner block.'
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
events: {
|
|
79
|
-
type: 'object',
|
|
80
|
-
additionalProperties: false,
|
|
81
|
-
properties: {
|
|
82
|
-
onScan: {
|
|
83
|
-
type: 'array',
|
|
84
|
-
description: 'Trigger actions when code is scanned.'
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
81
|
}
|
|
@@ -12,4 +12,4 @@
|
|
|
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
|
-
*/ export { default as QRScanner } from './blocks/QRScanner/
|
|
15
|
+
*/ export { default as QRScanner } from './blocks/QRScanner/meta.js';
|
package/dist/types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
2
|
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -12,18 +12,6 @@
|
|
|
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
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
};
|
|
15
|
+
*/ import { extractBlockTypes } from '@lowdefy/block-utils';
|
|
16
|
+
import * as metas from './metas.js';
|
|
17
|
+
export default extractBlockTypes(metas);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/blocks-qr",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lowdefy qr blocks.",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -35,32 +35,34 @@
|
|
|
35
35
|
"exports": {
|
|
36
36
|
"./*": "./dist/*",
|
|
37
37
|
"./blocks": "./dist/blocks.js",
|
|
38
|
+
"./metas": "./dist/metas.js",
|
|
38
39
|
"./e2e": "./dist/e2e.js",
|
|
39
|
-
"./schemas": "./dist/schemas.js",
|
|
40
40
|
"./types": "./dist/types.js"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"dist/*"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@lowdefy/block-utils": "
|
|
47
|
-
"html5-qrcode": "2.3.8"
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
"@lowdefy/block-utils": "5.0.0",
|
|
47
|
+
"html5-qrcode": "2.3.8"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": ">=18",
|
|
51
|
+
"react-dom": ">=18"
|
|
50
52
|
},
|
|
51
53
|
"devDependencies": {
|
|
52
|
-
"@lowdefy/block-dev-e2e": "
|
|
53
|
-
"@lowdefy/e2e-utils": "
|
|
54
|
+
"@lowdefy/block-dev-e2e": "5.0.0",
|
|
55
|
+
"@lowdefy/e2e-utils": "5.0.0",
|
|
54
56
|
"@playwright/test": "1.50.1",
|
|
55
|
-
"@swc/cli": "0.
|
|
56
|
-
"@swc/core": "1.
|
|
57
|
+
"@swc/cli": "0.8.0",
|
|
58
|
+
"@swc/core": "1.15.18",
|
|
57
59
|
"copyfiles": "2.4.1"
|
|
58
60
|
},
|
|
59
61
|
"publishConfig": {
|
|
60
62
|
"access": "public"
|
|
61
63
|
},
|
|
62
64
|
"scripts": {
|
|
63
|
-
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --
|
|
65
|
+
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --cli-config-file ../../../../.swc-cli.json && pnpm copyfiles",
|
|
64
66
|
"clean": "rm -rf dist",
|
|
65
67
|
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
|
|
66
68
|
"e2e": "playwright test --config e2e/playwright.config.js",
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "object",
|
|
3
|
-
"properties": {
|
|
4
|
-
"type": "object",
|
|
5
|
-
"additionalProperties": false,
|
|
6
|
-
"properties": {
|
|
7
|
-
"fps": {
|
|
8
|
-
"type": "number",
|
|
9
|
-
"description": "Expected framerate of QR code scanning"
|
|
10
|
-
},
|
|
11
|
-
"qrbox": {
|
|
12
|
-
"type": ["number", "object"],
|
|
13
|
-
"description": "The dimensions for the QR scanning area. If not set, the entire area of the video stream will be used by the scanner."
|
|
14
|
-
},
|
|
15
|
-
"aspectRatio": {
|
|
16
|
-
"type": "float",
|
|
17
|
-
"default": 1,
|
|
18
|
-
"description": "The aspect ratio for the video."
|
|
19
|
-
},
|
|
20
|
-
"disableFlip": {
|
|
21
|
-
"type": "boolean",
|
|
22
|
-
"description": "Disable the ability to scan QR codes that have been flipped."
|
|
23
|
-
},
|
|
24
|
-
"inactiveByDefault": {
|
|
25
|
-
"type": "boolean",
|
|
26
|
-
"default": false,
|
|
27
|
-
"description": "Determines whether or not the scanner is started when it is mounted."
|
|
28
|
-
},
|
|
29
|
-
"formatsToSupport": {
|
|
30
|
-
"type": "array",
|
|
31
|
-
"description": "List of Html5QrcodeSupportedFormats to support. See <a href='https://github.com/mebjas/html5-qrcode#documentation:~:text=library.%0A%20*/%0Aenum-,Html5QrcodeSupportedFormats,-%7B%0A%20%20QR_CODE%20%3D'>more</a>.",
|
|
32
|
-
"items": {
|
|
33
|
-
"type": "string",
|
|
34
|
-
"enum": [
|
|
35
|
-
"QR_CODE",
|
|
36
|
-
"AZTEC",
|
|
37
|
-
"CODABAR",
|
|
38
|
-
"CODE_39",
|
|
39
|
-
"CODE_93",
|
|
40
|
-
"CODE_128",
|
|
41
|
-
"DATA_MATRIX",
|
|
42
|
-
"MAXICODE",
|
|
43
|
-
"ITF",
|
|
44
|
-
"EAN_13",
|
|
45
|
-
"EAN_8",
|
|
46
|
-
"PDF_417",
|
|
47
|
-
"RSS_14",
|
|
48
|
-
"RSS_EXPANDED",
|
|
49
|
-
"UPC_A",
|
|
50
|
-
"UPC_E",
|
|
51
|
-
"UPC_EAN_EXTENSION"
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"style": {
|
|
56
|
-
"type": "object",
|
|
57
|
-
"description": "Custom css properties to apply to scanner block."
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"events": {
|
|
62
|
-
"type": "object",
|
|
63
|
-
"additionalProperties": false,
|
|
64
|
-
"properties": {
|
|
65
|
-
"onScan": {
|
|
66
|
-
"type": "array",
|
|
67
|
-
"description": "Trigger actions when code is scanned."
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|