@destyler/qr-code 0.1.0 → 0.2.0-beta.5
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.
|
@@ -40,8 +40,7 @@ function connect(state, send, normalize) {
|
|
|
40
40
|
});
|
|
41
41
|
},
|
|
42
42
|
getDataUrl(type, quality) {
|
|
43
|
-
|
|
44
|
-
return getDataUrl(svgEl, {
|
|
43
|
+
return getDataUrl(dom.getFrameEl(state.context), {
|
|
45
44
|
type,
|
|
46
45
|
quality
|
|
47
46
|
});
|
|
@@ -107,28 +106,27 @@ const set = { value(ctx, value) {
|
|
|
107
106
|
ctx.onValueChange?.({ value });
|
|
108
107
|
} };
|
|
109
108
|
function machine(userContext) {
|
|
110
|
-
const ctx = compact(userContext);
|
|
111
109
|
return createMachine({
|
|
112
110
|
id: "qr-code",
|
|
113
111
|
initial: "idle",
|
|
114
112
|
context: {
|
|
115
113
|
value: "",
|
|
116
|
-
...
|
|
114
|
+
...compact(userContext),
|
|
117
115
|
pixelSize: 10
|
|
118
116
|
},
|
|
119
|
-
computed: { encoded: memoize((ctx
|
|
117
|
+
computed: { encoded: memoize((ctx) => encode(ctx.value, ctx.encoding)) },
|
|
120
118
|
on: {
|
|
121
119
|
"VALUE.SET": { actions: ["setValue"] },
|
|
122
120
|
"DOWNLOAD_TRIGGER.CLICK": { actions: ["downloadQrCode"] }
|
|
123
121
|
}
|
|
124
122
|
}, { actions: {
|
|
125
|
-
setValue(ctx
|
|
126
|
-
set.value(ctx
|
|
123
|
+
setValue(ctx, evt) {
|
|
124
|
+
set.value(ctx, evt.value);
|
|
127
125
|
},
|
|
128
|
-
downloadQrCode(ctx
|
|
126
|
+
downloadQrCode(ctx, evt) {
|
|
129
127
|
const { mimeType, quality, fileName } = evt;
|
|
130
|
-
const svgEl = dom.getFrameEl(ctx
|
|
131
|
-
const doc = dom.getDoc(ctx
|
|
128
|
+
const svgEl = dom.getFrameEl(ctx);
|
|
129
|
+
const doc = dom.getDoc(ctx);
|
|
132
130
|
getDataUrl(svgEl, {
|
|
133
131
|
type: mimeType,
|
|
134
132
|
quality
|
package/package.json
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@destyler/qr-code",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0-beta.5",
|
|
5
5
|
"description": "a component that generates a QR code based on the provided data.",
|
|
6
6
|
"author": "Elone Hoo <elonehoo@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/destyler/destyler",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/destyler/destyler.git",
|
|
12
|
+
"directory": "packages/components/qr-code"
|
|
13
|
+
},
|
|
8
14
|
"exports": {
|
|
9
|
-
".": "./dist/index.
|
|
15
|
+
".": "./dist/index.mjs"
|
|
10
16
|
},
|
|
11
|
-
"main": "dist/index.
|
|
12
|
-
"module": "dist/index.
|
|
13
|
-
"types": "dist/index.d.
|
|
17
|
+
"main": "dist/index.mjs",
|
|
18
|
+
"module": "dist/index.mjs",
|
|
19
|
+
"types": "dist/index.d.mts",
|
|
14
20
|
"files": [
|
|
15
21
|
"*.d.ts",
|
|
16
22
|
"dist"
|
|
@@ -18,11 +24,14 @@
|
|
|
18
24
|
"dependencies": {
|
|
19
25
|
"proxy-memoize": "^3.0.1",
|
|
20
26
|
"uqr": "^0.1.2",
|
|
21
|
-
"@destyler/anatomy": "0.
|
|
22
|
-
"@destyler/
|
|
23
|
-
"@destyler/dom": "0.
|
|
24
|
-
"@destyler/
|
|
25
|
-
"@destyler/utils": "0.
|
|
27
|
+
"@destyler/anatomy": "0.2.0-beta.5",
|
|
28
|
+
"@destyler/types": "0.2.0-beta.5",
|
|
29
|
+
"@destyler/dom": "0.2.0-beta.5",
|
|
30
|
+
"@destyler/xstate": "0.2.0-beta.5",
|
|
31
|
+
"@destyler/utils": "0.2.0-beta.5"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
26
35
|
},
|
|
27
36
|
"scripts": {
|
|
28
37
|
"clear": "rimraf ./dist",
|
|
File without changes
|