qrdx 0.0.1 → 0.0.2-beta.1
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/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/constants.d.ts +40 -5
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/corner-dot.d.ts +8 -0
- package/dist/src/corner-dot.d.ts.map +1 -1
- package/dist/src/corner-eye.d.ts +8 -0
- package/dist/src/corner-eye.d.ts.map +1 -1
- package/dist/src/helpers.d.ts +7 -32
- package/dist/src/helpers.d.ts.map +1 -1
- package/dist/src/qr-code.d.ts +5 -16
- package/dist/src/qr-code.d.ts.map +1 -1
- package/dist/types/common.d.ts +8 -6
- package/dist/types/common.d.ts.map +1 -1
- 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 +9 -2
- package/dist/types/corner-eye.d.ts.map +1 -1
- package/dist/types/image-pattern.d.ts +12 -1
- package/dist/types/image-pattern.d.ts.map +1 -1
- package/dist/types/index.d.ts +8 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/qr.d.ts +69 -12
- package/dist/types/qr.d.ts.map +1 -1
- package/dist/types/template.d.ts +16 -8
- package/dist/types/template.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/constants.ts +46 -7
- package/src/corner-dot.tsx +9 -45
- package/src/corner-eye.ts +18 -84
- package/src/helpers.ts +15 -23
- package/src/qr-code.tsx +12 -28
- package/types/common.ts +12 -1
- package/types/corner-dot.ts +7 -6
- package/types/corner-eye.ts +7 -6
- package/types/image-pattern.ts +7 -1
- package/types/index.ts +28 -4
- package/types/qr.ts +41 -12
- package/types/template.ts +23 -9
package/dist/src/constants.d.ts
CHANGED
|
@@ -1,15 +1,50 @@
|
|
|
1
|
+
import type { ErrorLevel } from "../types";
|
|
1
2
|
import qrcodegen from "./codegen";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Mapping of error correction levels to qrcodegen.QrCode.Ecc values
|
|
5
|
+
*/
|
|
6
|
+
export declare const ERROR_LEVEL_MAP: Record<ErrorLevel, qrcodegen.QrCode.Ecc>;
|
|
7
|
+
/**
|
|
8
|
+
* Default QR code size in pixels
|
|
9
|
+
*/
|
|
5
10
|
export declare const DEFAULT_SIZE = 128;
|
|
6
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Default error correction level
|
|
13
|
+
*/
|
|
14
|
+
export declare const DEFAULT_LEVEL: ErrorLevel;
|
|
15
|
+
/**
|
|
16
|
+
* Default background color
|
|
17
|
+
*/
|
|
7
18
|
export declare const DEFAULT_BGCOLOR = "#FFFFFF";
|
|
19
|
+
/**
|
|
20
|
+
* Default foreground color
|
|
21
|
+
*/
|
|
8
22
|
export declare const DEFAULT_FGCOLOR = "#000000";
|
|
23
|
+
/**
|
|
24
|
+
* Default eye color
|
|
25
|
+
*/
|
|
9
26
|
export declare const DEFAULT_EYECOLOR = "#000000";
|
|
27
|
+
/**
|
|
28
|
+
* Default dot color
|
|
29
|
+
*/
|
|
10
30
|
export declare const DEFAULT_DOTCOLOR = "#000000";
|
|
31
|
+
/**
|
|
32
|
+
* Default margin around the QR code
|
|
33
|
+
*/
|
|
11
34
|
export declare const DEFAULT_MARGIN = 0;
|
|
12
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Available QR error correction levels
|
|
37
|
+
*/
|
|
38
|
+
export declare const QR_LEVELS: readonly ErrorLevel[];
|
|
39
|
+
/**
|
|
40
|
+
* This is *very* rough estimate of max amount of QRCode allowed to be covered.
|
|
41
|
+
* It is "wrong" in a lot of ways (area is a terrible way to estimate, it
|
|
42
|
+
* really should be number of modules covered), but if for some reason we don't
|
|
43
|
+
* get an explicit height or width, I'd rather default to something than throw.
|
|
44
|
+
*/
|
|
13
45
|
export declare const DEFAULT_IMG_SCALE = 0.1;
|
|
46
|
+
/**
|
|
47
|
+
* Default logo URL for QR codes
|
|
48
|
+
*/
|
|
14
49
|
export declare const FLAM_QR_LOGO = "https://instant.flamapp.ai/flogo-qr.svg";
|
|
15
50
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,eAAO,MAAM,eAAe,EAAE
|
|
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,4CAA4C,CAAC"}
|
package/dist/src/corner-dot.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { JSX } from "react";
|
|
2
2
|
import type { CornerEyeDotPattern } from "../types/corner-dot";
|
|
3
|
+
/**
|
|
4
|
+
* Generate corner dot pattern based on type
|
|
5
|
+
* @param cx - Center X coordinate
|
|
6
|
+
* @param cy - Center Y coordinate
|
|
7
|
+
* @param radius - Radius of the dot
|
|
8
|
+
* @param pattern - Pattern type for the corner dot
|
|
9
|
+
* @returns JSX element representing the pattern
|
|
10
|
+
*/
|
|
3
11
|
export declare function generateCornerDotPath(cx: number, cy: number, radius: number, pattern?: CornerEyeDotPattern): JSX.Element;
|
|
4
12
|
//# sourceMappingURL=corner-dot.d.ts.map
|
|
@@ -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;
|
|
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,CAgDb"}
|
package/dist/src/corner-eye.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import type { CornerEyePattern } from "../types/corner-eye";
|
|
2
|
+
/**
|
|
3
|
+
* Generate corner square path based on pattern type
|
|
4
|
+
* @param offsetX - X offset for the corner
|
|
5
|
+
* @param offsetY - Y offset for the corner
|
|
6
|
+
* @param size - Size of the corner pattern
|
|
7
|
+
* @param pattern - Pattern type for the corner eye
|
|
8
|
+
* @returns SVG path string for the pattern
|
|
9
|
+
*/
|
|
2
10
|
export declare function generateCornerSquarePath(offsetX: number, offsetY: number, size: number, pattern?: CornerEyePattern): string;
|
|
3
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;AAyE5D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,gBAAyB,GACjC,MAAM,CAYR"}
|
package/dist/src/helpers.d.ts
CHANGED
|
@@ -1,36 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
url: string;
|
|
4
|
-
fgColor?: string;
|
|
5
|
-
bgColor?: string;
|
|
6
|
-
eyeColor?: string;
|
|
7
|
-
dotColor?: string;
|
|
8
|
-
bodyPattern?: BodyPattern;
|
|
1
|
+
import type { QRProps } from "../types";
|
|
2
|
+
interface QRDataProps extends QRProps {
|
|
9
3
|
hideLogo?: boolean;
|
|
10
4
|
logo?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
cornerEyeDotPattern?: CornerEyeDotPattern;
|
|
14
|
-
level?: "L" | "M" | "Q" | "H";
|
|
15
|
-
templateId?: string;
|
|
16
|
-
}): {
|
|
17
|
-
imageSettings?: {
|
|
18
|
-
src: string;
|
|
19
|
-
height: number;
|
|
20
|
-
width: number;
|
|
21
|
-
excavate: boolean;
|
|
22
|
-
} | undefined;
|
|
23
|
-
value: string;
|
|
24
|
-
bgColor: string | undefined;
|
|
25
|
-
fgColor: string | undefined;
|
|
26
|
-
eyeColor: string | undefined;
|
|
27
|
-
dotColor: string | undefined;
|
|
28
|
-
bodyPattern: "square" | "rounded" | "circle" | "diamond" | "circle-large" | "circle-mixed" | "pacman" | "clean-square" | undefined;
|
|
29
|
-
cornerEyePattern: "square" | "rounded" | "rounded-inward" | "rounded-inward-flipped" | "gear" | "semi-round" | "rounded-extra" | "rounded-square" | "circle" | undefined;
|
|
30
|
-
cornerEyeDotPattern: "square" | "rounded-inward" | "rounded-inward-flipped" | "semi-round" | "rounded-square" | "circle" | "leaf" | "diamond" | "diamond-rounded" | undefined;
|
|
31
|
-
level: "L" | "M" | "Q" | "H" | undefined;
|
|
32
|
-
templateId: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
interface QRDataResult extends QRProps {
|
|
33
7
|
size: number;
|
|
34
|
-
|
|
35
|
-
};
|
|
8
|
+
}
|
|
9
|
+
export declare function getQRData({ value, size, fgColor, bgColor, eyeColor, dotColor, bodyPattern, hideLogo, logo, margin, cornerEyePattern, cornerEyeDotPattern, level, templateId, }: QRDataProps): QRDataResult;
|
|
10
|
+
export {};
|
|
36
11
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC,UAAU,WAAY,SAAQ,OAAO;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,YAAa,SAAQ,OAAO;IACpC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,IAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,EACL,UAAU,GACX,EAAE,WAAW,GAAG,YAAY,CAuB5B"}
|
package/dist/src/qr-code.d.ts
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
url: string;
|
|
4
|
-
fgColor?: string;
|
|
1
|
+
import type { QRProps } from "../types";
|
|
2
|
+
interface QRCodeProps extends QRProps {
|
|
5
3
|
hideLogo?: boolean;
|
|
6
4
|
logo?: string;
|
|
7
|
-
bgColor?: string;
|
|
8
|
-
eyeColor?: string;
|
|
9
|
-
dotColor?: string;
|
|
10
|
-
bodyPattern?: BodyPattern;
|
|
11
|
-
cornerEyePattern?: CornerEyePattern;
|
|
12
|
-
cornerEyeDotPattern?: CornerEyeDotPattern;
|
|
13
|
-
level?: "L" | "M" | "Q" | "H";
|
|
14
5
|
scale?: number;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
customProps?: Record<string, any>;
|
|
19
|
-
}) => import("react").JSX.Element>;
|
|
6
|
+
}
|
|
7
|
+
export declare const QRCode: import("react").MemoExoticComponent<({ value, fgColor, hideLogo, logo, bgColor, eyeColor, dotColor, bodyPattern, cornerEyePattern, cornerEyeDotPattern, level, scale, margin, templateId, customTemplate, customProps, }: QRCodeProps) => import("react").JSX.Element>;
|
|
8
|
+
export {};
|
|
20
9
|
//# sourceMappingURL=qr-code.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qr-code.d.ts","sourceRoot":"","sources":["../../src/qr-code.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"qr-code.d.ts","sourceRoot":"","sources":["../../src/qr-code.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAKxC,UAAU,WAAY,SAAQ,OAAO;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,MAAM,4NAkBd,WAAW,iCAiEf,CAAC"}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import type qrcodegen from "../src/codegen";
|
|
2
3
|
export type Modules = ReturnType<qrcodegen.QrCode["getModules"]>;
|
|
3
|
-
export
|
|
4
|
-
x:
|
|
5
|
-
y:
|
|
6
|
-
w:
|
|
7
|
-
h:
|
|
8
|
-
}
|
|
4
|
+
export declare const excavationSchema: z.ZodObject<{
|
|
5
|
+
x: z.ZodNumber;
|
|
6
|
+
y: z.ZodNumber;
|
|
7
|
+
w: z.ZodNumber;
|
|
8
|
+
h: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type Excavation = z.infer<typeof excavationSchema>;
|
|
9
11
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../types/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;AAGjE,eAAO,MAAM,gBAAgB;;;;;iBAK3B,CAAC;AAGH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CORNER_EYE_DOT_PATTERNS: readonly ["square", "rounded-square", "circle", "diamond"];
|
|
3
|
+
export declare const cornerEyeDotPatternSchema: z.ZodEnum<{
|
|
4
|
+
square: "square";
|
|
5
|
+
"rounded-square": "rounded-square";
|
|
6
|
+
circle: "circle";
|
|
7
|
+
diamond: "diamond";
|
|
8
|
+
}>;
|
|
9
|
+
export type CornerEyeDotPattern = z.infer<typeof cornerEyeDotPatternSchema>;
|
|
3
10
|
//# 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,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,4DAK1B,CAAC;AAGX,eAAO,MAAM,yBAAyB;;;;;EAAkC,CAAC;AAGzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CORNER_EYE_PATTERNS: readonly ["square", "rounded", "gear", "circle"];
|
|
3
|
+
export declare const cornerEyePatternSchema: z.ZodEnum<{
|
|
4
|
+
square: "square";
|
|
5
|
+
circle: "circle";
|
|
6
|
+
rounded: "rounded";
|
|
7
|
+
gear: "gear";
|
|
8
|
+
}>;
|
|
9
|
+
export type CornerEyePattern = z.infer<typeof cornerEyePatternSchema>;
|
|
3
10
|
//# 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,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,kDAKtB,CAAC;AAGX,eAAO,MAAM,sBAAsB;;;;;EAA8B,CAAC;AAGlE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
export declare const BODY_PATTERN: readonly ["circle", "circle-large", "square", "diamond", "circle-mixed", "pacman", "rounded", "clean-square"];
|
|
2
|
-
export
|
|
3
|
+
export declare const bodyPatternSchema: z.ZodEnum<{
|
|
4
|
+
square: "square";
|
|
5
|
+
circle: "circle";
|
|
6
|
+
diamond: "diamond";
|
|
7
|
+
rounded: "rounded";
|
|
8
|
+
"circle-large": "circle-large";
|
|
9
|
+
"circle-mixed": "circle-mixed";
|
|
10
|
+
pacman: "pacman";
|
|
11
|
+
"clean-square": "clean-square";
|
|
12
|
+
}>;
|
|
13
|
+
export type BodyPattern = z.infer<typeof bodyPatternSchema>;
|
|
3
14
|
//# 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,eAAO,MAAM,YAAY,+GASf,CAAC;
|
|
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,+GASf,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,10 +1,13 @@
|
|
|
1
1
|
export type { Excavation, Modules } from "./common";
|
|
2
|
+
export { excavationSchema } from "./common";
|
|
2
3
|
export type { CornerEyeDotPattern } from "./corner-dot";
|
|
3
|
-
export { CORNER_EYE_DOT_PATTERNS } from "./corner-dot";
|
|
4
|
+
export { CORNER_EYE_DOT_PATTERNS, cornerEyeDotPatternSchema, } from "./corner-dot";
|
|
4
5
|
export type { CornerEyePattern } from "./corner-eye";
|
|
5
|
-
export { CORNER_EYE_PATTERNS } from "./corner-eye";
|
|
6
|
+
export { CORNER_EYE_PATTERNS, cornerEyePatternSchema } from "./corner-eye";
|
|
6
7
|
export type { BodyPattern } from "./image-pattern";
|
|
7
|
-
export { BODY_PATTERN } from "./image-pattern";
|
|
8
|
-
export type { ImageSettings, QRProps, QRPropsCanvas, QRPropsSVG, } from "./qr";
|
|
9
|
-
export
|
|
8
|
+
export { BODY_PATTERN, bodyPatternSchema } from "./image-pattern";
|
|
9
|
+
export type { ErrorLevel, ImageSettings, QRProps, QRPropsCanvas, QRPropsSVG, } from "./qr";
|
|
10
|
+
export { errorLevelSchema, imageSettingsSchema, qrPropsSchema, } from "./qr";
|
|
11
|
+
export type { BaseTemplateProps, TemplateConfig, TemplateDefinition, } from "./template";
|
|
12
|
+
export { baseTemplatePropsSchema, templateConfigSchema, templateDefinitionBaseSchema, } from "./template";
|
|
10
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3E,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAElE,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;AAEd,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,20 +1,77 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
-
import
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type CornerEyeDotPattern } from "./corner-dot";
|
|
4
|
+
import { type CornerEyePattern } from "./corner-eye";
|
|
5
|
+
import { type BodyPattern } from "./image-pattern";
|
|
5
6
|
import type { TemplateDefinition } from "./template";
|
|
6
|
-
export
|
|
7
|
-
src:
|
|
8
|
-
height:
|
|
9
|
-
width:
|
|
10
|
-
excavate:
|
|
11
|
-
x
|
|
12
|
-
y
|
|
13
|
-
}
|
|
7
|
+
export declare const imageSettingsSchema: z.ZodObject<{
|
|
8
|
+
src: z.ZodString;
|
|
9
|
+
height: z.ZodNumber;
|
|
10
|
+
width: z.ZodNumber;
|
|
11
|
+
excavate: z.ZodBoolean;
|
|
12
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const errorLevelSchema: z.ZodEnum<{
|
|
16
|
+
L: "L";
|
|
17
|
+
M: "M";
|
|
18
|
+
Q: "Q";
|
|
19
|
+
H: "H";
|
|
20
|
+
}>;
|
|
21
|
+
export declare const qrPropsSchema: z.ZodObject<{
|
|
22
|
+
value: z.ZodString;
|
|
23
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
L: "L";
|
|
26
|
+
M: "M";
|
|
27
|
+
Q: "Q";
|
|
28
|
+
H: "H";
|
|
29
|
+
}>>;
|
|
30
|
+
bgColor: z.ZodOptional<z.ZodString>;
|
|
31
|
+
fgColor: z.ZodOptional<z.ZodString>;
|
|
32
|
+
eyeColor: z.ZodOptional<z.ZodString>;
|
|
33
|
+
dotColor: z.ZodOptional<z.ZodString>;
|
|
34
|
+
bodyPattern: z.ZodOptional<z.ZodEnum<{
|
|
35
|
+
square: "square";
|
|
36
|
+
circle: "circle";
|
|
37
|
+
diamond: "diamond";
|
|
38
|
+
rounded: "rounded";
|
|
39
|
+
"circle-large": "circle-large";
|
|
40
|
+
"circle-mixed": "circle-mixed";
|
|
41
|
+
pacman: "pacman";
|
|
42
|
+
"clean-square": "clean-square";
|
|
43
|
+
}>>;
|
|
44
|
+
cornerEyePattern: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
square: "square";
|
|
46
|
+
circle: "circle";
|
|
47
|
+
rounded: "rounded";
|
|
48
|
+
gear: "gear";
|
|
49
|
+
}>>;
|
|
50
|
+
cornerEyeDotPattern: z.ZodOptional<z.ZodEnum<{
|
|
51
|
+
square: "square";
|
|
52
|
+
"rounded-square": "rounded-square";
|
|
53
|
+
circle: "circle";
|
|
54
|
+
diamond: "diamond";
|
|
55
|
+
}>>;
|
|
56
|
+
margin: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
imageSettings: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
src: z.ZodString;
|
|
59
|
+
height: z.ZodNumber;
|
|
60
|
+
width: z.ZodNumber;
|
|
61
|
+
excavate: z.ZodBoolean;
|
|
62
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
isOGContext: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
+
templateId: z.ZodOptional<z.ZodString>;
|
|
67
|
+
customProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type ImageSettings = z.infer<typeof imageSettingsSchema>;
|
|
70
|
+
export type ErrorLevel = z.infer<typeof errorLevelSchema>;
|
|
14
71
|
export type QRProps = {
|
|
15
72
|
value: string;
|
|
16
73
|
size?: number;
|
|
17
|
-
level?:
|
|
74
|
+
level?: ErrorLevel;
|
|
18
75
|
bgColor?: string;
|
|
19
76
|
fgColor?: string;
|
|
20
77
|
eyeColor?: string;
|
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,
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,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/dist/types/template.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const baseTemplatePropsSchema: z.ZodObject<{
|
|
3
|
+
fgColor: z.ZodOptional<z.ZodString>;
|
|
4
|
+
bgColor: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
5
6
|
/**
|
|
6
7
|
* Configuration object passed to template wrappers containing all QR code metadata.
|
|
7
8
|
* All dimension values are in the template coordinate space (typically 300x300).
|
|
@@ -21,10 +22,17 @@ export type BaseTemplateProps = {
|
|
|
21
22
|
* }
|
|
22
23
|
* ```
|
|
23
24
|
*/
|
|
24
|
-
export
|
|
25
|
-
pixelSize:
|
|
26
|
-
url:
|
|
27
|
-
}
|
|
25
|
+
export declare const templateConfigSchema: z.ZodObject<{
|
|
26
|
+
pixelSize: z.ZodNumber;
|
|
27
|
+
url: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export declare const templateDefinitionBaseSchema: z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
description: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type BaseTemplateProps = z.infer<typeof baseTemplatePropsSchema>;
|
|
35
|
+
export type TemplateConfig = z.infer<typeof templateConfigSchema>;
|
|
28
36
|
export type TemplateDefinition<TCustomProps = Record<string, never>> = {
|
|
29
37
|
id: string;
|
|
30
38
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../types/template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../types/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAIH,eAAO,MAAM,4BAA4B;;;;iBAIvC,CAAC;AAGH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAGlE,MAAM,MAAM,kBAAkB,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI;IACrE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,CACP,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,KAAK,CAAC,EAAE,iBAAiB,GAAG,YAAY,EACxC,cAAc,CAAC,EAAE,cAAc,KAC5B,KAAK,CAAC,SAAS,CAAC;CACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qrdx",
|
|
3
|
-
"version": "0.0.1",
|
|
3
|
+
"version": "0.0.2-beta.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"jsqr": "^1.4.0",
|
|
37
|
-
"react": "19.2.0"
|
|
37
|
+
"react": "19.2.0",
|
|
38
|
+
"zod": "^4.1.12"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@repo/typescript-config": "workspace:*",
|
package/src/constants.ts
CHANGED
|
@@ -1,26 +1,65 @@
|
|
|
1
|
+
import type { ErrorLevel } from "../types";
|
|
1
2
|
import qrcodegen from "./codegen";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Mapping of error correction levels to qrcodegen.QrCode.Ecc values
|
|
6
|
+
*/
|
|
7
|
+
export const ERROR_LEVEL_MAP: Record<ErrorLevel, qrcodegen.QrCode.Ecc> = {
|
|
4
8
|
L: qrcodegen.QrCode.Ecc.LOW,
|
|
5
9
|
M: qrcodegen.QrCode.Ecc.MEDIUM,
|
|
6
10
|
Q: qrcodegen.QrCode.Ecc.QUARTILE,
|
|
7
11
|
H: qrcodegen.QrCode.Ecc.HIGH,
|
|
8
12
|
};
|
|
9
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Default QR code size in pixels
|
|
16
|
+
*/
|
|
10
17
|
export const DEFAULT_SIZE = 128;
|
|
11
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Default error correction level
|
|
21
|
+
*/
|
|
22
|
+
export const DEFAULT_LEVEL: ErrorLevel = "Q";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Default background color
|
|
26
|
+
*/
|
|
12
27
|
export const DEFAULT_BGCOLOR = "#FFFFFF";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Default foreground color
|
|
31
|
+
*/
|
|
13
32
|
export const DEFAULT_FGCOLOR = "#000000";
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Default eye color
|
|
36
|
+
*/
|
|
14
37
|
export const DEFAULT_EYECOLOR = "#000000";
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Default dot color
|
|
41
|
+
*/
|
|
15
42
|
export const DEFAULT_DOTCOLOR = "#000000";
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Default margin around the QR code
|
|
46
|
+
*/
|
|
16
47
|
export const DEFAULT_MARGIN = 0;
|
|
17
48
|
|
|
18
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Available QR error correction levels
|
|
51
|
+
*/
|
|
52
|
+
export const QR_LEVELS: readonly ErrorLevel[] = ["L", "M", "Q", "H"] as const;
|
|
19
53
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
54
|
+
/**
|
|
55
|
+
* This is *very* rough estimate of max amount of QRCode allowed to be covered.
|
|
56
|
+
* It is "wrong" in a lot of ways (area is a terrible way to estimate, it
|
|
57
|
+
* really should be number of modules covered), but if for some reason we don't
|
|
58
|
+
* get an explicit height or width, I'd rather default to something than throw.
|
|
59
|
+
*/
|
|
24
60
|
export const DEFAULT_IMG_SCALE = 0.1;
|
|
25
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Default logo URL for QR codes
|
|
64
|
+
*/
|
|
26
65
|
export const FLAM_QR_LOGO = "https://instant.flamapp.ai/flogo-qr.svg";
|
package/src/corner-dot.tsx
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { JSX } from "react";
|
|
2
2
|
import type { CornerEyeDotPattern } from "../types/corner-dot";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Generate corner dot pattern based on type
|
|
6
|
+
* @param cx - Center X coordinate
|
|
7
|
+
* @param cy - Center Y coordinate
|
|
8
|
+
* @param radius - Radius of the dot
|
|
9
|
+
* @param pattern - Pattern type for the corner dot
|
|
10
|
+
* @returns JSX element representing the pattern
|
|
11
|
+
*/
|
|
5
12
|
export function generateCornerDotPath(
|
|
6
13
|
cx: number,
|
|
7
14
|
cy: number,
|
|
@@ -36,42 +43,6 @@ export function generateCornerDotPath(
|
|
|
36
43
|
/>
|
|
37
44
|
);
|
|
38
45
|
|
|
39
|
-
case "rounded-inward":
|
|
40
|
-
return (
|
|
41
|
-
<path
|
|
42
|
-
clipRule="evenodd"
|
|
43
|
-
d={`M ${cx - halfSize} ${cy - halfSize * 0.428_571}v ${size * 0.285_714}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, ${size * 0.357_143} ${size * 0.357_143}h ${size * 0.642_857}v -${size * 0.642_857}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, -${size * 0.357_143} -${size * 0.357_143}h -${size * 0.285_714}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, -${size * 0.357_143} ${size * 0.357_143}`}
|
|
44
|
-
transform={`rotate(0,${cx},${cy})`}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
case "rounded-inward-flipped":
|
|
49
|
-
return (
|
|
50
|
-
<path
|
|
51
|
-
clipRule="evenodd"
|
|
52
|
-
d={`M ${cx - halfSize} ${cy - halfSize * 0.428_571}v ${size * 0.285_714}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, ${size * 0.357_143} ${size * 0.357_143}h ${size * 0.642_857}v -${size * 0.642_857}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, -${size * 0.357_143} -${size * 0.357_143}h -${size * 0.285_714}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, -${size * 0.357_143} ${size * 0.357_143}`}
|
|
53
|
-
transform={`rotate(-180,${cx},${cy})`}
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
case "semi-round":
|
|
58
|
-
return (
|
|
59
|
-
<path
|
|
60
|
-
clipRule="evenodd"
|
|
61
|
-
d={`M ${cx - halfSize} ${cy - halfSize * 0.428_571}v ${size * 0.285_714}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, ${size * 0.357_143} ${size * 0.357_143}h ${size * 0.642_857}v -${size * 0.642_857}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, -${size * 0.357_143} -${size * 0.357_143}h -${size * 0.285_714}H ${cx - halfSize}z`}
|
|
62
|
-
transform={`rotate(0,${cx},${cy})`}
|
|
63
|
-
/>
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
case "leaf":
|
|
67
|
-
return (
|
|
68
|
-
<path
|
|
69
|
-
clipRule="evenodd"
|
|
70
|
-
d={`M ${cx - halfSize} ${cy - halfSize * 0.428_571}v ${size * 0.642_857}h ${size * 0.642_857}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, ${size * 0.357_143} -${size * 0.357_143}v -${size * 0.642_857}h -${size * 0.642_857}a ${size * 0.357_143} ${size * 0.357_143}, 0, 0, 0, -${size * 0.357_143} ${size * 0.357_143}z`}
|
|
71
|
-
transform={`rotate(0,${cx},${cy})`}
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
74
|
-
|
|
75
46
|
case "diamond":
|
|
76
47
|
return (
|
|
77
48
|
<path
|
|
@@ -80,14 +51,7 @@ export function generateCornerDotPath(
|
|
|
80
51
|
/>
|
|
81
52
|
);
|
|
82
53
|
|
|
83
|
-
case "
|
|
84
|
-
return (
|
|
85
|
-
<path
|
|
86
|
-
d={`M ${cx - halfSize * 0.571_429} ${cy - halfSize * 0.714_286}h ${size * 0.428_571}c ${size * 0.142_857} 0 ${size * 0.142_857} ${size * 0.142_857} ${size * 0.142_857} ${size * 0.142_857}v ${size * 0.428_571}c 0 ${size * 0.142_857} -${size * 0.142_857} ${size * 0.142_857} -${size * 0.142_857} ${size * 0.142_857}h -${size * 0.428_571}c -${size * 0.142_857} 0 -${size * 0.142_857} -${size * 0.142_857} -${size * 0.142_857} -${size * 0.142_857}v -${size * 0.428_571}c 0 -${size * 0.142_857} ${size * 0.142_857} -${size * 0.142_857} ${size * 0.142_857} -${size * 0.142_857}z`}
|
|
87
|
-
transform={`rotate(45,${cx},${cy})`}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
|
|
54
|
+
// case "circle":
|
|
91
55
|
default:
|
|
92
56
|
return (
|
|
93
57
|
<circle
|