qrdx 0.0.2-beta.1 → 0.0.4
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/cli.js +4225 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/src/api.d.ts.map +1 -1
- package/dist/src/constants.d.ts +1 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/corner-dot.d.ts.map +1 -1
- package/dist/src/corner-eye.d.ts +1 -1
- package/dist/src/corner-eye.d.ts.map +1 -1
- package/dist/src/detection.d.ts.map +1 -1
- package/dist/src/download.d.ts +1 -1
- package/dist/src/download.d.ts.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/utils/color.d.ts +12 -0
- package/dist/src/utils/color.d.ts.map +1 -0
- package/dist/src/utils.d.ts +1 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/types/color.d.ts +92 -0
- package/dist/types/color.d.ts.map +1 -0
- package/dist/types/corner-dot.d.ts +9 -2
- package/dist/types/corner-dot.d.ts.map +1 -1
- package/dist/types/corner-eye.d.ts +7 -2
- package/dist/types/corner-eye.d.ts.map +1 -1
- package/dist/types/image-pattern.d.ts +4 -3
- package/dist/types/image-pattern.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/qr.d.ts +90 -12
- package/dist/types/qr.d.ts.map +1 -1
- package/package.json +13 -8
- package/src/api.tsx +7 -2
- package/src/constants.ts +1 -1
- package/src/corner-dot.tsx +83 -2
- package/src/corner-eye.ts +98 -5
- package/src/detection.ts +0 -3
- package/src/download.tsx +102 -2
- package/src/index.tsx +95 -29
- package/src/utils/color.ts +34 -0
- package/src/utils.tsx +550 -57
- package/types/color.ts +133 -0
- package/types/corner-dot.ts +8 -1
- package/types/corner-eye.ts +5 -0
- package/types/image-pattern.ts +2 -1
- package/types/index.ts +23 -5
- package/types/qr.ts +9 -8
package/dist/src/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAa3C,wBAAsB,UAAU,CAAC,KAAK,EAAE,UAAU,wCA4EjD"}
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -46,5 +46,5 @@ export declare const DEFAULT_IMG_SCALE = 0.1;
|
|
|
46
46
|
/**
|
|
47
47
|
* Default logo URL for QR codes
|
|
48
48
|
*/
|
|
49
|
-
export declare const FLAM_QR_LOGO = "https://
|
|
49
|
+
export declare const FLAM_QR_LOGO = "https://qrdx.dev/logo.png";
|
|
50
50
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,CAKpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,UAAgB,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,UAAU,EAAkC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,CAKpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,UAAgB,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,UAAU,EAAkC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,YAAY,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../src/corner-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAA8B,GACtC,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../src/corner-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAA8B,GACtC,GAAG,CAAC,OAAO,CAiIb"}
|
package/dist/src/corner-eye.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ import type { CornerEyePattern } from "../types/corner-eye";
|
|
|
7
7
|
* @param pattern - Pattern type for the corner eye
|
|
8
8
|
* @returns SVG path string for the pattern
|
|
9
9
|
*/
|
|
10
|
-
export declare function generateCornerSquarePath(offsetX: number, offsetY: number, size: number, pattern
|
|
10
|
+
export declare function generateCornerSquarePath(offsetX: number, offsetY: number, size: number, pattern: CornerEyePattern): string;
|
|
11
11
|
//# sourceMappingURL=corner-eye.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../src/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../src/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA6J5D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,GACxB,MAAM,CAqBR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/detection.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,WAAW,SAAS,EACpB,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/detection.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,WAAW,SAAS,EACpB,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,UAAU,MAAM,SA2BjB,CAAC;AAsHF,eAAO,MAAM,eAAe,GAC1B,eAAe,gBAAgB,EAC/B,OAAO,MAAM,EACb,wBAAsB,iBA2CvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,gBAAgB,EAC5B,WAAW,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EACvC,QAAQ,EAAE,MAAM,QAsDjB"}
|
package/dist/src/download.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/download.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/download.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAOrD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CA0BA;AAiID;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAyCf;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,MAAM,CAAC,CA6BjB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE,YAA4D,GACjE,OAAO,CAAC,IAAI,CAAC,CA2Cf;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAGpE"}
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,iEAAiE;AACjE,qEAAqE;AACrE,qFAAqF;AACrF,qEAAqE;AACrE,sFAAsF;AAEtF;;;;GAIG;AACH,OAAO,EAAE,KAAK,GAAG,EAA+B,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,iEAAiE;AACjE,qEAAqE;AACrE,qFAAqF;AACrF,qEAAqE;AACrE,sFAAsF;AAEtF;;;;GAIG;AACH,OAAO,EAAE,KAAK,GAAG,EAA+B,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkBvD,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAExB,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,eAuIhD;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,OAAO,mBA+CrD;AA6DD,wBAAsB,aAAa,CACjC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,iBAAiB,GAAG,MAAM,CAAC,CAiFrC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ColorConfig } from "../../types/color";
|
|
2
|
+
/**
|
|
3
|
+
* Get solid color representation from ColorConfig
|
|
4
|
+
* For gradients, returns the first stop color as representative
|
|
5
|
+
* This is useful for cases where you need a single color value (e.g., CSS backgrounds, color displays)
|
|
6
|
+
*
|
|
7
|
+
* @param colorConfig - The color configuration (can be string, solid, linear, or radial gradient)
|
|
8
|
+
* @param fallback - Fallback color if colorConfig is undefined or invalid
|
|
9
|
+
* @returns A solid color hex string
|
|
10
|
+
*/
|
|
11
|
+
export declare function getSolidColor(colorConfig: ColorConfig | undefined, fallback?: string): string;
|
|
12
|
+
//# sourceMappingURL=color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/utils/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,QAAQ,SAAY,GACnB,MAAM,CAmBR"}
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { JSX } from "react";
|
|
|
2
2
|
import type { Excavation, ImageSettings, Modules, QRPropsSVG } from "../types";
|
|
3
3
|
export declare function excavateModules(modules: Modules, excavation: Excavation): Modules;
|
|
4
4
|
export declare function generatePath(modules: Modules, margin?: number): string;
|
|
5
|
+
export { getSolidColor } from "./utils/color";
|
|
5
6
|
export declare function getImageSettings(cells: Modules, size: number, _margin: number, imageSettings?: ImageSettings): null | {
|
|
6
7
|
x: number;
|
|
7
8
|
y: number;
|
package/dist/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,KAAK,EAGV,UAAU,EACV,aAAa,EAEb,OAAO,EACP,UAAU,EAEX,MAAM,UAAU,CAAC;AAmBlB,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,GACrB,OAAO,CAYT;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAI,GAAG,MAAM,CA0CjE;AA+cD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,GAAG;IACR,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B,CA2BA;AAED,wBAAgB,4BAA4B,CAC1C,uBAAuB,EAAE;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B,EACD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM;;;;;EASf;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,eAsiB1C;AAOD,eAAO,MAAM,eAAe,SAOxB,CAAC;AAGL,eAAO,MAAM,QAAQ,GACnB,KAAK,MAAM,KACV;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IASxC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAM9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,KAAG,MAejE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,OAAO,MAAM,KACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAmBpD,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Color type discriminator
|
|
4
|
+
*/
|
|
5
|
+
export declare const colorTypeSchema: z.ZodEnum<{
|
|
6
|
+
solid: "solid";
|
|
7
|
+
linear: "linear";
|
|
8
|
+
radial: "radial";
|
|
9
|
+
}>;
|
|
10
|
+
export type ColorType = z.infer<typeof colorTypeSchema>;
|
|
11
|
+
/**
|
|
12
|
+
* Solid color configuration
|
|
13
|
+
*/
|
|
14
|
+
export declare const solidColorSchema: z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"solid">;
|
|
16
|
+
color: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type SolidColor = z.infer<typeof solidColorSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Gradient stop configuration
|
|
21
|
+
*/
|
|
22
|
+
export declare const gradientStopSchema: z.ZodObject<{
|
|
23
|
+
color: z.ZodString;
|
|
24
|
+
offset: z.ZodNumber;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type GradientStop = z.infer<typeof gradientStopSchema>;
|
|
27
|
+
/**
|
|
28
|
+
* Linear gradient configuration
|
|
29
|
+
*/
|
|
30
|
+
export declare const linearGradientSchema: z.ZodObject<{
|
|
31
|
+
type: z.ZodLiteral<"linear">;
|
|
32
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
33
|
+
color: z.ZodString;
|
|
34
|
+
offset: z.ZodNumber;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type LinearGradient = z.infer<typeof linearGradientSchema>;
|
|
39
|
+
/**
|
|
40
|
+
* Radial gradient configuration
|
|
41
|
+
* Note: cx, cy, r, fx, fy are calculated automatically based on QR size
|
|
42
|
+
* They use userSpaceOnUse units (absolute pixels)
|
|
43
|
+
*/
|
|
44
|
+
export declare const radialGradientSchema: z.ZodObject<{
|
|
45
|
+
type: z.ZodLiteral<"radial">;
|
|
46
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
47
|
+
color: z.ZodString;
|
|
48
|
+
offset: z.ZodNumber;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type RadialGradient = z.infer<typeof radialGradientSchema>;
|
|
52
|
+
/**
|
|
53
|
+
* Union type for color configuration
|
|
54
|
+
* Supports:
|
|
55
|
+
* - string: backward compatible solid color
|
|
56
|
+
* - SolidColor: explicit solid color object
|
|
57
|
+
* - LinearGradient: linear gradient with start/end colors and angle
|
|
58
|
+
* - RadialGradient: radial gradient with start/end colors and positioning
|
|
59
|
+
*/
|
|
60
|
+
export declare const colorConfigSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"solid">;
|
|
62
|
+
color: z.ZodString;
|
|
63
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<"linear">;
|
|
65
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
66
|
+
color: z.ZodString;
|
|
67
|
+
offset: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
70
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"radial">;
|
|
72
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
73
|
+
color: z.ZodString;
|
|
74
|
+
offset: z.ZodNumber;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
}, z.core.$strip>]>;
|
|
77
|
+
export type ColorConfig = z.infer<typeof colorConfigSchema>;
|
|
78
|
+
/**
|
|
79
|
+
* Helper to normalize color config to object format
|
|
80
|
+
*/
|
|
81
|
+
export declare function normalizeColorConfig(color: ColorConfig | undefined, fallback?: string): SolidColor | LinearGradient | RadialGradient;
|
|
82
|
+
/**
|
|
83
|
+
* Helper to check if color is gradient
|
|
84
|
+
*/
|
|
85
|
+
export declare function isGradient(color: ColorConfig | undefined): color is LinearGradient | RadialGradient;
|
|
86
|
+
/**
|
|
87
|
+
* Helper to get a solid color string from any ColorConfig
|
|
88
|
+
* For gradients, returns the first stop color
|
|
89
|
+
*/
|
|
90
|
+
export declare function getColorString(color: ColorConfig | undefined, fallback?: string): string;
|
|
91
|
+
export declare function getNormalizedColor(color: ColorConfig | string | undefined): string;
|
|
92
|
+
//# sourceMappingURL=color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../types/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,eAAe;;;;EAAwC,CAAC;AACrE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;iBAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;iBAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;mBAK5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,QAAQ,SAAY,GACnB,UAAU,GAAG,cAAc,GAAG,cAAc,CAQ9C;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,WAAW,GAAG,SAAS,GAC7B,KAAK,IAAI,cAAc,GAAG,cAAc,CAK1C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,QAAQ,SAAY,GACnB,MAAM,CAMR;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GACtC,MAAM,CAwBR"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const CORNER_EYE_DOT_PATTERNS: readonly ["square", "rounded
|
|
2
|
+
export declare const CORNER_EYE_DOT_PATTERNS: readonly ["square", "rounded", "circle", "diamond", "message", "message-reverse", "diya", "diya-reverse", "rounded-triangle", "star", "banner"];
|
|
3
3
|
export declare const cornerEyeDotPatternSchema: z.ZodEnum<{
|
|
4
|
+
message: "message";
|
|
4
5
|
square: "square";
|
|
5
|
-
|
|
6
|
+
rounded: "rounded";
|
|
6
7
|
circle: "circle";
|
|
7
8
|
diamond: "diamond";
|
|
9
|
+
"message-reverse": "message-reverse";
|
|
10
|
+
diya: "diya";
|
|
11
|
+
"diya-reverse": "diya-reverse";
|
|
12
|
+
"rounded-triangle": "rounded-triangle";
|
|
13
|
+
star: "star";
|
|
14
|
+
banner: "banner";
|
|
8
15
|
}>;
|
|
9
16
|
export type CornerEyeDotPattern = z.infer<typeof cornerEyeDotPatternSchema>;
|
|
10
17
|
//# sourceMappingURL=corner-dot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../types/corner-dot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../types/corner-dot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,iJAY1B,CAAC;AAGX,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAAkC,CAAC;AAGzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const CORNER_EYE_PATTERNS: readonly ["square", "rounded", "gear", "circle"];
|
|
2
|
+
export declare const CORNER_EYE_PATTERNS: readonly ["square", "rounded", "gear", "circle", "diya", "extra-rounded", "message", "pointy", "curly"];
|
|
3
3
|
export declare const cornerEyePatternSchema: z.ZodEnum<{
|
|
4
|
+
message: "message";
|
|
4
5
|
square: "square";
|
|
5
|
-
circle: "circle";
|
|
6
6
|
rounded: "rounded";
|
|
7
|
+
circle: "circle";
|
|
8
|
+
diya: "diya";
|
|
7
9
|
gear: "gear";
|
|
10
|
+
"extra-rounded": "extra-rounded";
|
|
11
|
+
pointy: "pointy";
|
|
12
|
+
curly: "curly";
|
|
8
13
|
}>;
|
|
9
14
|
export type CornerEyePattern = z.infer<typeof cornerEyePatternSchema>;
|
|
10
15
|
//# sourceMappingURL=corner-eye.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../types/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../types/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,yGAUtB,CAAC;AAGX,eAAO,MAAM,sBAAsB;;;;;;;;;;EAA8B,CAAC;AAGlE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const BODY_PATTERN: readonly ["circle", "circle-large", "square", "diamond", "circle-mixed", "pacman", "rounded", "
|
|
2
|
+
export declare const BODY_PATTERN: readonly ["circle", "circle-large", "square", "diamond", "circle-mixed", "pacman", "rounded", "small-square", "vertical-line"];
|
|
3
3
|
export declare const bodyPatternSchema: z.ZodEnum<{
|
|
4
4
|
square: "square";
|
|
5
|
+
rounded: "rounded";
|
|
5
6
|
circle: "circle";
|
|
6
7
|
diamond: "diamond";
|
|
7
|
-
rounded: "rounded";
|
|
8
8
|
"circle-large": "circle-large";
|
|
9
9
|
"circle-mixed": "circle-mixed";
|
|
10
10
|
pacman: "pacman";
|
|
11
|
-
"
|
|
11
|
+
"small-square": "small-square";
|
|
12
|
+
"vertical-line": "vertical-line";
|
|
12
13
|
}>;
|
|
13
14
|
export type BodyPattern = z.infer<typeof bodyPatternSchema>;
|
|
14
15
|
//# sourceMappingURL=image-pattern.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-pattern.d.ts","sourceRoot":"","sources":["../../types/image-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"image-pattern.d.ts","sourceRoot":"","sources":["../../types/image-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY,gIAUf,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;;;;;;EAAuB,CAAC;AAGtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { getSolidColor } from "../src/utils/color";
|
|
2
|
+
export type { ColorConfig, ColorType, GradientStop, LinearGradient, RadialGradient, SolidColor, } from "./color";
|
|
3
|
+
export { colorConfigSchema, colorTypeSchema, getColorString, getNormalizedColor, gradientStopSchema, isGradient, linearGradientSchema, normalizeColorConfig, radialGradientSchema, solidColorSchema, } from "./color";
|
|
1
4
|
export type { Excavation, Modules } from "./common";
|
|
2
5
|
export { excavationSchema } from "./common";
|
|
3
6
|
export type { CornerEyeDotPattern } from "./corner-dot";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClE,YAAY,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,aAAa,EACb,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,GACd,MAAM,MAAM,CAAC;AACd,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,YAAY,CAAC"}
|
package/dist/types/qr.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { type ColorConfig } from "./color";
|
|
3
4
|
import { type CornerEyeDotPattern } from "./corner-dot";
|
|
4
5
|
import { type CornerEyePattern } from "./corner-eye";
|
|
5
6
|
import { type BodyPattern } from "./image-pattern";
|
|
@@ -27,31 +28,108 @@ export declare const qrPropsSchema: z.ZodObject<{
|
|
|
27
28
|
Q: "Q";
|
|
28
29
|
H: "H";
|
|
29
30
|
}>>;
|
|
30
|
-
bgColor: z.ZodOptional<z.ZodString
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
bgColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"solid">;
|
|
33
|
+
color: z.ZodString;
|
|
34
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"linear">;
|
|
36
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
37
|
+
color: z.ZodString;
|
|
38
|
+
offset: z.ZodNumber;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
41
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
42
|
+
type: z.ZodLiteral<"radial">;
|
|
43
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
44
|
+
color: z.ZodString;
|
|
45
|
+
offset: z.ZodNumber;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>]>>;
|
|
48
|
+
fgColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"solid">;
|
|
50
|
+
color: z.ZodString;
|
|
51
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
+
type: z.ZodLiteral<"linear">;
|
|
53
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
54
|
+
color: z.ZodString;
|
|
55
|
+
offset: z.ZodNumber;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"radial">;
|
|
60
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
61
|
+
color: z.ZodString;
|
|
62
|
+
offset: z.ZodNumber;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
}, z.core.$strip>]>>;
|
|
65
|
+
eyeColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
66
|
+
type: z.ZodLiteral<"solid">;
|
|
67
|
+
color: z.ZodString;
|
|
68
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
+
type: z.ZodLiteral<"linear">;
|
|
70
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
71
|
+
color: z.ZodString;
|
|
72
|
+
offset: z.ZodNumber;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
75
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
+
type: z.ZodLiteral<"radial">;
|
|
77
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
78
|
+
color: z.ZodString;
|
|
79
|
+
offset: z.ZodNumber;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
}, z.core.$strip>]>>;
|
|
82
|
+
dotColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"solid">;
|
|
84
|
+
color: z.ZodString;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
type: z.ZodLiteral<"linear">;
|
|
87
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
88
|
+
color: z.ZodString;
|
|
89
|
+
offset: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
angle: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
type: z.ZodLiteral<"radial">;
|
|
94
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
95
|
+
color: z.ZodString;
|
|
96
|
+
offset: z.ZodNumber;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
}, z.core.$strip>]>>;
|
|
34
99
|
bodyPattern: z.ZodOptional<z.ZodEnum<{
|
|
35
100
|
square: "square";
|
|
101
|
+
rounded: "rounded";
|
|
36
102
|
circle: "circle";
|
|
37
103
|
diamond: "diamond";
|
|
38
|
-
rounded: "rounded";
|
|
39
104
|
"circle-large": "circle-large";
|
|
40
105
|
"circle-mixed": "circle-mixed";
|
|
41
106
|
pacman: "pacman";
|
|
42
|
-
"
|
|
107
|
+
"small-square": "small-square";
|
|
108
|
+
"vertical-line": "vertical-line";
|
|
43
109
|
}>>;
|
|
44
110
|
cornerEyePattern: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
message: "message";
|
|
45
112
|
square: "square";
|
|
46
|
-
circle: "circle";
|
|
47
113
|
rounded: "rounded";
|
|
114
|
+
circle: "circle";
|
|
115
|
+
diya: "diya";
|
|
48
116
|
gear: "gear";
|
|
117
|
+
"extra-rounded": "extra-rounded";
|
|
118
|
+
pointy: "pointy";
|
|
119
|
+
curly: "curly";
|
|
49
120
|
}>>;
|
|
50
121
|
cornerEyeDotPattern: z.ZodOptional<z.ZodEnum<{
|
|
122
|
+
message: "message";
|
|
51
123
|
square: "square";
|
|
52
|
-
|
|
124
|
+
rounded: "rounded";
|
|
53
125
|
circle: "circle";
|
|
54
126
|
diamond: "diamond";
|
|
127
|
+
"message-reverse": "message-reverse";
|
|
128
|
+
diya: "diya";
|
|
129
|
+
"diya-reverse": "diya-reverse";
|
|
130
|
+
"rounded-triangle": "rounded-triangle";
|
|
131
|
+
star: "star";
|
|
132
|
+
banner: "banner";
|
|
55
133
|
}>>;
|
|
56
134
|
margin: z.ZodOptional<z.ZodNumber>;
|
|
57
135
|
imageSettings: z.ZodOptional<z.ZodObject<{
|
|
@@ -72,10 +150,10 @@ export type QRProps = {
|
|
|
72
150
|
value: string;
|
|
73
151
|
size?: number;
|
|
74
152
|
level?: ErrorLevel;
|
|
75
|
-
bgColor?:
|
|
76
|
-
fgColor?:
|
|
77
|
-
eyeColor?:
|
|
78
|
-
dotColor?:
|
|
153
|
+
bgColor?: ColorConfig;
|
|
154
|
+
fgColor?: ColorConfig;
|
|
155
|
+
eyeColor?: ColorConfig;
|
|
156
|
+
dotColor?: ColorConfig;
|
|
79
157
|
bodyPattern?: BodyPattern;
|
|
80
158
|
cornerEyePattern?: CornerEyePattern;
|
|
81
159
|
cornerEyeDotPattern?: CornerEyeDotPattern;
|
package/dist/types/qr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qr.d.ts","sourceRoot":"","sources":["../../types/qr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGrD,eAAO,MAAM,mBAAmB;;;;;;;iBAO9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;EAA+B,CAAC;AAE7D,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"qr.d.ts","sourceRoot":"","sources":["../../types/qr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,SAAS,CAAC;AAC9D,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGrD,eAAO,MAAM,mBAAmB;;;;;;;iBAO9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;EAA+B,CAAC;AAE7D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgBxB,CAAC;AAGH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,cAAc,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAGzC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,GACjC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qrdx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"require": "./types/index.ts"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"qrdx": "./dist/cli.js"
|
|
26
|
+
},
|
|
24
27
|
"files": [
|
|
25
28
|
"dist",
|
|
26
29
|
"types",
|
|
@@ -33,17 +36,19 @@
|
|
|
33
36
|
"typecheck": "tsc --noEmit"
|
|
34
37
|
},
|
|
35
38
|
"dependencies": {
|
|
39
|
+
"jspdf": "^3.0.4",
|
|
36
40
|
"jsqr": "^1.4.0",
|
|
37
|
-
"react": "19.2.
|
|
38
|
-
"
|
|
41
|
+
"react": "19.2.3",
|
|
42
|
+
"sharp": "^0.34.2",
|
|
43
|
+
"zod": "^4.3.5"
|
|
39
44
|
},
|
|
40
45
|
"devDependencies": {
|
|
41
46
|
"@repo/typescript-config": "workspace:*",
|
|
42
|
-
"@types/node": "
|
|
43
|
-
"@types/react": "19.2.
|
|
44
|
-
"@types/react-dom": "19.2.
|
|
45
|
-
"next": "16.
|
|
46
|
-
"tsup": "^8.
|
|
47
|
+
"@types/node": "25.1.0",
|
|
48
|
+
"@types/react": "19.2.7",
|
|
49
|
+
"@types/react-dom": "19.2.3",
|
|
50
|
+
"next": "16.1.1",
|
|
51
|
+
"tsup": "^8.5.1",
|
|
47
52
|
"typescript": "5.9.3"
|
|
48
53
|
},
|
|
49
54
|
"peerDependencies": {
|
package/src/api.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
ERROR_LEVEL_MAP,
|
|
10
10
|
} from "./constants";
|
|
11
11
|
import { excavateModules, generatePath, getImageSettings } from "./utils";
|
|
12
|
+
import { getSolidColor } from "./utils/color";
|
|
12
13
|
|
|
13
14
|
export async function getQRAsSVG(props: QRPropsSVG) {
|
|
14
15
|
const {
|
|
@@ -75,10 +76,14 @@ export async function getQRAsSVG(props: QRPropsSVG) {
|
|
|
75
76
|
>
|
|
76
77
|
<path
|
|
77
78
|
d={`M0,0 h${numCells}v${numCells}H0z`}
|
|
78
|
-
fill={bgColor}
|
|
79
|
+
fill={getSolidColor(bgColor, DEFAULT_BGCOLOR)}
|
|
80
|
+
shapeRendering="crispEdges"
|
|
81
|
+
/>
|
|
82
|
+
<path
|
|
83
|
+
d={fgPath}
|
|
84
|
+
fill={getSolidColor(fgColor, DEFAULT_FGCOLOR)}
|
|
79
85
|
shapeRendering="crispEdges"
|
|
80
86
|
/>
|
|
81
|
-
<path d={fgPath} fill={fgColor} shapeRendering="crispEdges" />
|
|
82
87
|
{image}
|
|
83
88
|
</svg>
|
|
84
89
|
);
|
package/src/constants.ts
CHANGED