@react-scad/core 0.1.3
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/LICENSE +21 -0
- package/README.md +91 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/primitives/circle.d.ts +14 -0
- package/dist/primitives/circle.d.ts.map +1 -0
- package/dist/primitives/circle.js +12 -0
- package/dist/primitives/cube.d.ts +13 -0
- package/dist/primitives/cube.d.ts.map +1 -0
- package/dist/primitives/cube.js +13 -0
- package/dist/primitives/cylinder.d.ts +16 -0
- package/dist/primitives/cylinder.d.ts.map +1 -0
- package/dist/primitives/cylinder.js +10 -0
- package/dist/primitives/difference.d.ts +11 -0
- package/dist/primitives/difference.d.ts.map +1 -0
- package/dist/primitives/difference.js +9 -0
- package/dist/primitives/group.d.ts +11 -0
- package/dist/primitives/group.d.ts.map +1 -0
- package/dist/primitives/group.js +9 -0
- package/dist/primitives/import.d.ts +14 -0
- package/dist/primitives/import.d.ts.map +1 -0
- package/dist/primitives/import.js +15 -0
- package/dist/primitives/index.d.ts +41 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +20 -0
- package/dist/primitives/intersection.d.ts +11 -0
- package/dist/primitives/intersection.d.ts.map +1 -0
- package/dist/primitives/intersection.js +9 -0
- package/dist/primitives/linear-extrude.d.ts +18 -0
- package/dist/primitives/linear-extrude.d.ts.map +1 -0
- package/dist/primitives/linear-extrude.js +31 -0
- package/dist/primitives/polygon.d.ts +14 -0
- package/dist/primitives/polygon.d.ts.map +1 -0
- package/dist/primitives/polygon.js +14 -0
- package/dist/primitives/polyhedron.d.ts +14 -0
- package/dist/primitives/polyhedron.d.ts.map +1 -0
- package/dist/primitives/polyhedron.js +11 -0
- package/dist/primitives/primitive.d.ts +7 -0
- package/dist/primitives/primitive.d.ts.map +1 -0
- package/dist/primitives/primitive.js +5 -0
- package/dist/primitives/raw.d.ts +12 -0
- package/dist/primitives/raw.d.ts.map +1 -0
- package/dist/primitives/raw.js +12 -0
- package/dist/primitives/rotate-extrude.d.ts +14 -0
- package/dist/primitives/rotate-extrude.d.ts.map +1 -0
- package/dist/primitives/rotate-extrude.js +19 -0
- package/dist/primitives/rotate.d.ts +13 -0
- package/dist/primitives/rotate.d.ts.map +1 -0
- package/dist/primitives/rotate.js +11 -0
- package/dist/primitives/scale.d.ts +12 -0
- package/dist/primitives/scale.d.ts.map +1 -0
- package/dist/primitives/scale.js +10 -0
- package/dist/primitives/sphere.d.ts +14 -0
- package/dist/primitives/sphere.d.ts.map +1 -0
- package/dist/primitives/sphere.js +12 -0
- package/dist/primitives/square.d.ts +13 -0
- package/dist/primitives/square.d.ts.map +1 -0
- package/dist/primitives/square.js +13 -0
- package/dist/primitives/surface.d.ts +15 -0
- package/dist/primitives/surface.d.ts.map +1 -0
- package/dist/primitives/surface.js +17 -0
- package/dist/primitives/text.d.ts +20 -0
- package/dist/primitives/text.d.ts.map +1 -0
- package/dist/primitives/text.js +27 -0
- package/dist/primitives/translate.d.ts +12 -0
- package/dist/primitives/translate.d.ts.map +1 -0
- package/dist/primitives/translate.js +10 -0
- package/dist/primitives/union.d.ts +11 -0
- package/dist/primitives/union.d.ts.map +1 -0
- package/dist/primitives/union.js +9 -0
- package/dist/runtime/index.d.ts +62 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +147 -0
- package/dist/runtime/node-ops.d.ts +6 -0
- package/dist/runtime/node-ops.d.ts.map +1 -0
- package/dist/runtime/node-ops.js +517 -0
- package/dist/runtime/reconciler.d.ts +5 -0
- package/dist/runtime/reconciler.d.ts.map +1 -0
- package/dist/runtime/reconciler.js +10 -0
- package/dist/runtime/root.d.ts +13 -0
- package/dist/runtime/root.d.ts.map +1 -0
- package/dist/runtime/root.js +26 -0
- package/dist/serialize/index.d.ts +5 -0
- package/dist/serialize/index.d.ts.map +1 -0
- package/dist/serialize/index.js +81 -0
- package/dist/types.d.ts +149 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +19 -0
- package/package.json +44 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Primitive } from "./primitive.js";
|
|
3
|
+
export const RotateExtrude = (props) => React.createElement(Primitive, { ...props, type: "rotate_extrude" });
|
|
4
|
+
RotateExtrude.displayName = "RotateExtrude";
|
|
5
|
+
export function serialize(node, indent, ctx) {
|
|
6
|
+
const parts = [];
|
|
7
|
+
if (node.angle != null)
|
|
8
|
+
parts.push(`angle = ${String(node.angle)}`);
|
|
9
|
+
if (node.convexity != null)
|
|
10
|
+
parts.push(`convexity = ${node.convexity}`);
|
|
11
|
+
if (node.$fn != null)
|
|
12
|
+
parts.push(`$fn = ${node.$fn}`);
|
|
13
|
+
const nextIndent = `${indent} `;
|
|
14
|
+
const inner = node.children.map((c) => nextIndent + ctx.serializeNode(c, nextIndent)).join("\n");
|
|
15
|
+
const args = parts.length > 0 ? parts.join(", ") : "";
|
|
16
|
+
return args
|
|
17
|
+
? `rotate_extrude(${args}) {\n${inner}\n${indent}}`
|
|
18
|
+
: `rotate_extrude() {\n${inner}\n${indent}}`;
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { RotateNode, SerializeContext, Vec3 } from "../types.js";
|
|
4
|
+
export interface RotateProps extends PropsWithChildren {
|
|
5
|
+
a: Vec3;
|
|
6
|
+
v?: Vec3;
|
|
7
|
+
}
|
|
8
|
+
export declare const Rotate: {
|
|
9
|
+
(props: RotateProps): React.FunctionComponentElement<import("./primitive.js").PrimitivePropsBase>;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function serialize(node: RotateNode, indent: string, ctx: SerializeContext): string;
|
|
13
|
+
//# sourceMappingURL=rotate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/primitives/rotate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAItE,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACrD,CAAC,EAAE,IAAI,CAAC;IACR,CAAC,CAAC,EAAE,IAAI,CAAC;CACT;AAED,eAAO,MAAM,MAAM;YAAW,WAAW;;CACoB,CAAC;AAG9D,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAKzF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { formatVec3 } from "../utils.js";
|
|
3
|
+
import { Primitive } from "./primitive.js";
|
|
4
|
+
export const Rotate = (props) => React.createElement(Primitive, { ...props, type: "rotate" });
|
|
5
|
+
Rotate.displayName = "Rotate";
|
|
6
|
+
export function serialize(node, indent, ctx) {
|
|
7
|
+
const nextIndent = `${indent} `;
|
|
8
|
+
const inner = node.children.map((c) => nextIndent + ctx.serializeNode(c, nextIndent)).join("\n");
|
|
9
|
+
const args = node.v != null ? `${formatVec3(node.a)}, ${formatVec3(node.v)}` : formatVec3(node.a);
|
|
10
|
+
return `rotate(${args}) {\n${inner}\n${indent}}`;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { ScaleNode, SerializeContext, Vec3 } from "../types.js";
|
|
4
|
+
export interface ScaleProps extends PropsWithChildren {
|
|
5
|
+
v: Vec3;
|
|
6
|
+
}
|
|
7
|
+
export declare const Scale: {
|
|
8
|
+
(props: ScaleProps): React.FunctionComponentElement<import("./primitive.js").PrimitivePropsBase>;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function serialize(node: ScaleNode, indent: string, ctx: SerializeContext): string;
|
|
12
|
+
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/primitives/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAIrE,MAAM,WAAW,UAAW,SAAQ,iBAAiB;IACpD,CAAC,EAAE,IAAI,CAAC;CACR;AAED,eAAO,MAAM,KAAK;YAAW,UAAU;;CACqB,CAAC;AAG7D,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAIxF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { formatVec3 } from "../utils.js";
|
|
3
|
+
import { Primitive } from "./primitive.js";
|
|
4
|
+
export const Scale = (props) => React.createElement(Primitive, { ...props, type: "scale" });
|
|
5
|
+
Scale.displayName = "Scale";
|
|
6
|
+
export function serialize(node, indent, ctx) {
|
|
7
|
+
const nextIndent = `${indent} `;
|
|
8
|
+
const inner = node.children.map((c) => nextIndent + ctx.serializeNode(c, nextIndent)).join("\n");
|
|
9
|
+
return `scale(${formatVec3(node.v)}) {\n${inner}\n${indent}}`;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { SerializeContext, SphereNode } from "../types.js";
|
|
4
|
+
export interface SphereProps extends PropsWithChildren {
|
|
5
|
+
r?: number;
|
|
6
|
+
d?: number;
|
|
7
|
+
$fn?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const Sphere: {
|
|
10
|
+
(props: SphereProps): React.FunctionComponentElement<import("./primitive.js").PrimitivePropsBase>;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function serialize(node: SphereNode, _indent: string, _ctx: SerializeContext): string;
|
|
14
|
+
//# sourceMappingURL=sphere.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sphere.d.ts","sourceRoot":"","sources":["../../src/primitives/sphere.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGhE,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACrD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,MAAM;YAAW,WAAW;;CACoB,CAAC;AAG9D,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAM3F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Primitive } from "./primitive.js";
|
|
3
|
+
export const Sphere = (props) => React.createElement(Primitive, { ...props, type: "sphere" });
|
|
4
|
+
Sphere.displayName = "Sphere";
|
|
5
|
+
export function serialize(node, _indent, _ctx) {
|
|
6
|
+
const rVal = node.r ?? 1;
|
|
7
|
+
const dVal = node.d;
|
|
8
|
+
let args = dVal != null ? `d = ${String(dVal)}` : `r = ${String(rVal)}`;
|
|
9
|
+
if (node.$fn != null)
|
|
10
|
+
args += `, $fn = ${node.$fn}`;
|
|
11
|
+
return `sphere(${args});`;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { SerializeContext, SquareNode, Vec2 } from "../types.js";
|
|
4
|
+
export interface SquareProps extends PropsWithChildren {
|
|
5
|
+
size?: Vec2;
|
|
6
|
+
center?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Square: {
|
|
9
|
+
(props: SquareProps): React.FunctionComponentElement<import("./primitive.js").PrimitivePropsBase>;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function serialize(node: SquareNode, _indent: string, _ctx: SerializeContext): string;
|
|
13
|
+
//# sourceMappingURL=square.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"square.d.ts","sourceRoot":"","sources":["../../src/primitives/square.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAItE,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACrD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,MAAM;YAAW,WAAW;;CACoB,CAAC;AAG9D,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAQ3F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { formatVec2 } from "../utils.js";
|
|
3
|
+
import { Primitive } from "./primitive.js";
|
|
4
|
+
export const Square = (props) => React.createElement(Primitive, { ...props, type: "square" });
|
|
5
|
+
Square.displayName = "Square";
|
|
6
|
+
export function serialize(node, _indent, _ctx) {
|
|
7
|
+
const s = typeof node.size === "number"
|
|
8
|
+
? String(node.size)
|
|
9
|
+
: typeof node.size === "string"
|
|
10
|
+
? node.size
|
|
11
|
+
: formatVec2(node.size);
|
|
12
|
+
return `square(size = ${s}, center = ${node.center});`;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { SerializeContext, SurfaceNode } from "../types.js";
|
|
4
|
+
export interface SurfaceProps extends PropsWithChildren {
|
|
5
|
+
file: string;
|
|
6
|
+
center?: boolean;
|
|
7
|
+
invert?: boolean;
|
|
8
|
+
convexity?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const Surface: {
|
|
11
|
+
(props: SurfaceProps): React.FunctionComponentElement<import("./primitive.js").PrimitivePropsBase>;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function serialize(node: SurfaceNode, _indent: string, _ctx: SerializeContext): string;
|
|
15
|
+
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/primitives/surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGjE,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,OAAO;YAAW,YAAY;;CACmB,CAAC;AAO/D,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAM5F"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Primitive } from "./primitive.js";
|
|
3
|
+
export const Surface = (props) => React.createElement(Primitive, { ...props, type: "surface" });
|
|
4
|
+
Surface.displayName = "Surface";
|
|
5
|
+
function escapePath(s) {
|
|
6
|
+
return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
7
|
+
}
|
|
8
|
+
export function serialize(node, _indent, _ctx) {
|
|
9
|
+
const parts = [`file = "${escapePath(node.file)}"`];
|
|
10
|
+
if (node.center === true)
|
|
11
|
+
parts.push("center = true");
|
|
12
|
+
if (node.invert === true)
|
|
13
|
+
parts.push("invert = true");
|
|
14
|
+
if (node.convexity != null)
|
|
15
|
+
parts.push(`convexity = ${node.convexity}`);
|
|
16
|
+
return `surface(${parts.join(", ")});`;
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { SerializeContext, TextNode } from "../types.js";
|
|
4
|
+
export interface TextProps extends PropsWithChildren {
|
|
5
|
+
text: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
font?: string;
|
|
8
|
+
halign?: "left" | "center" | "right";
|
|
9
|
+
valign?: "top" | "center" | "baseline" | "bottom";
|
|
10
|
+
direction?: "ltr" | "rtl" | "ttb" | "btt";
|
|
11
|
+
language?: string;
|
|
12
|
+
script?: string;
|
|
13
|
+
spacing?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const Text: {
|
|
16
|
+
(props: TextProps): React.FunctionComponentElement<import("./primitive.js").PrimitivePropsBase>;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function serialize(node: TextNode, _indent: string, _ctx: SerializeContext): string;
|
|
20
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/primitives/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG9D,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;IAClD,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,IAAI;YAAW,SAAS;;CACsB,CAAC;AAO5D,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAWzF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Primitive } from "./primitive.js";
|
|
3
|
+
export const Text = (props) => React.createElement(Primitive, { ...props, type: "text" });
|
|
4
|
+
Text.displayName = "Text";
|
|
5
|
+
function escapeString(s) {
|
|
6
|
+
return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
7
|
+
}
|
|
8
|
+
export function serialize(node, _indent, _ctx) {
|
|
9
|
+
const parts = [`text = "${escapeString(node.text)}"`];
|
|
10
|
+
if (node.size != null)
|
|
11
|
+
parts.push(`size = ${node.size}`);
|
|
12
|
+
if (node.font != null)
|
|
13
|
+
parts.push(`font = "${escapeString(node.font)}"`);
|
|
14
|
+
if (node.halign != null)
|
|
15
|
+
parts.push(`halign = "${node.halign}"`);
|
|
16
|
+
if (node.valign != null)
|
|
17
|
+
parts.push(`valign = "${node.valign}"`);
|
|
18
|
+
if (node.direction != null)
|
|
19
|
+
parts.push(`direction = "${node.direction}"`);
|
|
20
|
+
if (node.language != null)
|
|
21
|
+
parts.push(`language = "${escapeString(node.language)}"`);
|
|
22
|
+
if (node.script != null)
|
|
23
|
+
parts.push(`script = "${escapeString(node.script)}"`);
|
|
24
|
+
if (node.spacing != null)
|
|
25
|
+
parts.push(`spacing = ${node.spacing}`);
|
|
26
|
+
return `text(${parts.join(", ")});`;
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { SerializeContext, TranslateNode, Vec3 } from "../types.js";
|
|
4
|
+
export interface TranslateProps extends PropsWithChildren {
|
|
5
|
+
v: Vec3;
|
|
6
|
+
}
|
|
7
|
+
export declare const Translate: {
|
|
8
|
+
(props: TranslateProps): React.FunctionComponentElement<import("./primitive.js").PrimitivePropsBase>;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function serialize(node: TranslateNode, indent: string, ctx: SerializeContext): string;
|
|
12
|
+
//# sourceMappingURL=translate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/primitives/translate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAIzE,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACxD,CAAC,EAAE,IAAI,CAAC;CACR;AAED,eAAO,MAAM,SAAS;YAAW,cAAc;;CACiB,CAAC;AAGjE,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAI5F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { formatVec3 } from "../utils.js";
|
|
3
|
+
import { Primitive } from "./primitive.js";
|
|
4
|
+
export const Translate = (props) => React.createElement(Primitive, { ...props, type: "translate" });
|
|
5
|
+
Translate.displayName = "Translate";
|
|
6
|
+
export function serialize(node, indent, ctx) {
|
|
7
|
+
const nextIndent = `${indent} `;
|
|
8
|
+
const inner = node.children.map((c) => nextIndent + ctx.serializeNode(c, nextIndent)).join("\n");
|
|
9
|
+
return `translate(${formatVec3(node.v)}) {\n${inner}\n${indent}}`;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PropsWithChildren } from "react";
|
|
3
|
+
import type { SerializeContext, UnionNode } from "../types.js";
|
|
4
|
+
export interface UnionProps extends PropsWithChildren {
|
|
5
|
+
}
|
|
6
|
+
export declare const Union: {
|
|
7
|
+
(props: UnionProps): React.FunctionComponentElement<import("./primitive.js").PrimitivePropsBase>;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function serialize(node: UnionNode, indent: string, ctx: SerializeContext): string;
|
|
11
|
+
//# sourceMappingURL=union.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../src/primitives/union.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG/D,MAAM,WAAW,UAAW,SAAQ,iBAAiB;CAAG;AAExD,eAAO,MAAM,KAAK;YAAW,UAAU;;CACqB,CAAC;AAG7D,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAIxF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Primitive } from "./primitive.js";
|
|
3
|
+
export const Union = (props) => React.createElement(Primitive, { ...props, type: "union" });
|
|
4
|
+
Union.displayName = "Union";
|
|
5
|
+
export function serialize(node, indent, ctx) {
|
|
6
|
+
const nextIndent = `${indent} `;
|
|
7
|
+
const inner = node.children.map((c) => nextIndent + ctx.serializeNode(c, nextIndent)).join("\n");
|
|
8
|
+
return inner ? `union() {\n${inner}\n${indent}}` : "union() {}";
|
|
9
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ScadContainer, ScadNode } from "../types.js";
|
|
2
|
+
export type { ScadContainer, ScadNode };
|
|
3
|
+
export declare const rendererVersion = "0.1.0";
|
|
4
|
+
export declare const rendererPackageName = "react-scad";
|
|
5
|
+
export declare const extraDevToolsConfig: null;
|
|
6
|
+
export declare function getRootHostContext(): null;
|
|
7
|
+
export declare function getChildHostContext(_parentHostContext: null, _type: string, _rootContainer: ScadContainer): null;
|
|
8
|
+
export declare function prepareForCommit(_containerInfo: ScadContainer): null;
|
|
9
|
+
export declare function resetAfterCommit(_containerInfo: ScadContainer): void;
|
|
10
|
+
export declare function createInstance(type: string, props: Record<string, unknown>, _rootContainer: ScadContainer, _hostContext: null, _internalHandle: unknown): ScadNode;
|
|
11
|
+
export declare function cloneMutableInstance(instance: ScadNode, keepChildren: boolean): ScadNode;
|
|
12
|
+
export declare function appendInitialChild(parentInstance: ScadNode, child: ScadNode): void;
|
|
13
|
+
export declare function finalizeInitialChildren(_instance: ScadNode, _type: string, _props: Record<string, unknown>, _rootContainer: ScadContainer, _hostContext: null): boolean;
|
|
14
|
+
export declare function prepareUpdate(_instance: ScadNode, _type: string, oldProps: Record<string, unknown>, newProps: Record<string, unknown>, _rootContainer: ScadContainer, _hostContext: null): Record<string, unknown> | null;
|
|
15
|
+
export declare function shouldSetTextContent(_type: string, _props: Record<string, unknown>): boolean;
|
|
16
|
+
export declare function createTextInstance(_text: string, _rootContainer: ScadContainer, _hostContext: null, _internalHandle: unknown): never;
|
|
17
|
+
export declare function cloneMutableTextInstance(_textInstance: string): string;
|
|
18
|
+
export declare const scheduleTimeout: typeof setTimeout;
|
|
19
|
+
export declare const cancelTimeout: typeof clearTimeout;
|
|
20
|
+
export declare const noTimeout = -1;
|
|
21
|
+
export declare function getPublicInstance(instance: ScadNode): ScadNode;
|
|
22
|
+
export declare const isPrimaryRenderer = false;
|
|
23
|
+
export declare const warnsIfNotActing = false;
|
|
24
|
+
export declare const supportsMutation = true;
|
|
25
|
+
export declare function appendChild(parentInstance: ScadNode, child: ScadNode): void;
|
|
26
|
+
export declare function appendChildToContainer(container: ScadContainer, child: ScadNode): void;
|
|
27
|
+
export declare function insertBefore(parentInstance: ScadNode, child: ScadNode, beforeChild: ScadNode): void;
|
|
28
|
+
export declare function insertInContainerBefore(container: ScadContainer, child: ScadNode, beforeChild: ScadNode): void;
|
|
29
|
+
export declare function removeChild(parentInstance: ScadNode, child: ScadNode): void;
|
|
30
|
+
export declare function removeChildFromContainer(container: ScadContainer, child: ScadNode): void;
|
|
31
|
+
export declare function resetTextContent(_instance: ScadNode): void;
|
|
32
|
+
export declare function commitTextUpdate(_textInstance: unknown, _oldText: string, _newText: string): void;
|
|
33
|
+
export declare function commitMount(_instance: ScadNode, _type: string, _props: Record<string, unknown>, _internalHandle: unknown): void;
|
|
34
|
+
export declare function commitUpdate(instance: ScadNode, updatePayload: Record<string, unknown> | null, _type: string, _prevProps: Record<string, unknown>, _nextProps: Record<string, unknown>, _internalHandle: unknown): void;
|
|
35
|
+
export declare function hideInstance(_instance: ScadNode): void;
|
|
36
|
+
export declare function hideTextInstance(_textInstance: unknown): void;
|
|
37
|
+
export declare function unhideInstance(_instance: ScadNode, _props: Record<string, unknown>): void;
|
|
38
|
+
export declare function unhideTextInstance(_textInstance: unknown, _text: string): void;
|
|
39
|
+
export declare function clearContainer(container: ScadContainer): void;
|
|
40
|
+
export declare function preparePortalMount(_containerInfo: ScadContainer): void;
|
|
41
|
+
export declare function getInstanceFromNode(_node: unknown): null;
|
|
42
|
+
export declare function beforeActiveInstanceBlur(_instance: unknown): void;
|
|
43
|
+
export declare function afterActiveInstanceBlur(): void;
|
|
44
|
+
export declare function detachDeletedInstance(_node: ScadNode): void;
|
|
45
|
+
export declare function requestPostPaintCallback(_callback: (time: number) => void): void;
|
|
46
|
+
export declare function maySuspendCommit(_type: string, _props: unknown): false;
|
|
47
|
+
export declare function maySuspendCommitOnUpdate(_type: string, _oldProps: unknown, _newProps: unknown): false;
|
|
48
|
+
export declare function maySuspendCommitInSyncRender(_type: string, _props: unknown): false;
|
|
49
|
+
export declare function preloadInstance(_type: string, _props: unknown): boolean;
|
|
50
|
+
export declare function startSuspendingCommit(): null;
|
|
51
|
+
export declare function suspendInstance(_state: unknown, _instance: unknown, _type: string, _props: unknown): void;
|
|
52
|
+
export declare function waitForCommitToBeReady(): null;
|
|
53
|
+
export declare function getSuspendedCommitReason(_state: unknown, _root: ScadContainer): null;
|
|
54
|
+
export declare function setCurrentUpdatePriority(newPriority: number): void;
|
|
55
|
+
export declare function getCurrentUpdatePriority(): number;
|
|
56
|
+
export declare function getCurrentEventPriority(): number;
|
|
57
|
+
export declare function resolveUpdatePriority(): number;
|
|
58
|
+
export declare function trackSchedulerEvent(): void;
|
|
59
|
+
export declare function resolveEventType(): null;
|
|
60
|
+
export declare function resolveEventTimeStamp(): number;
|
|
61
|
+
export declare function shouldAttemptEagerTransition(): false;
|
|
62
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG3D,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AAIxC,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAChD,eAAO,MAAM,mBAAmB,MAAO,CAAC;AAExC,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,wBAAgB,mBAAmB,CAClC,kBAAkB,EAAE,IAAI,EACxB,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,aAAa,GAC3B,IAAI,CAEN;AAED,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,aAAa,GAAG,IAAI,CAEpE;AAED,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,aAAa,GAAG,IAAI,CAAG;AAExE,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,cAAc,EAAE,aAAa,EAC7B,YAAY,EAAE,IAAI,EAClB,eAAe,EAAE,OAAO,GACtB,QAAQ,CAGV;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,GAAG,QAAQ,CAExF;AAED,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,GAAG,IAAI,CAElF;AAED,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,QAAQ,EACnB,KAAK,EAAE,MAAM,EACb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AAE,aAAa,GAAG,IAAI,CAEpF;AAKD,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAElE;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAAG;AAC9C,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AACD,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AACD,wBAAgB,4BAA4B,IAAI,KAAK,CAEpD"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { cloneScadNode, createScadNode, updateScadNode } from "./node-ops.js";
|
|
2
|
+
const NO_CONTEXT = null;
|
|
3
|
+
export const rendererVersion = "0.1.0";
|
|
4
|
+
export const rendererPackageName = "react-scad";
|
|
5
|
+
export const extraDevToolsConfig = null;
|
|
6
|
+
export function getRootHostContext() {
|
|
7
|
+
return NO_CONTEXT;
|
|
8
|
+
}
|
|
9
|
+
export function getChildHostContext(_parentHostContext, _type, _rootContainer) {
|
|
10
|
+
return NO_CONTEXT;
|
|
11
|
+
}
|
|
12
|
+
export function prepareForCommit(_containerInfo) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
export function resetAfterCommit(_containerInfo) { }
|
|
16
|
+
export function createInstance(type, props, _rootContainer, _hostContext, _internalHandle) {
|
|
17
|
+
const node = createScadNode(type, { ...props });
|
|
18
|
+
return node;
|
|
19
|
+
}
|
|
20
|
+
export function cloneMutableInstance(instance, keepChildren) {
|
|
21
|
+
return cloneScadNode(instance, keepChildren);
|
|
22
|
+
}
|
|
23
|
+
export function appendInitialChild(parentInstance, child) {
|
|
24
|
+
parentInstance.children.push(child);
|
|
25
|
+
}
|
|
26
|
+
export function finalizeInitialChildren(_instance, _type, _props, _rootContainer, _hostContext) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
export function prepareUpdate(_instance, _type, oldProps, newProps, _rootContainer, _hostContext) {
|
|
30
|
+
return newProps;
|
|
31
|
+
}
|
|
32
|
+
export function shouldSetTextContent(_type, _props) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
export function createTextInstance(_text, _rootContainer, _hostContext, _internalHandle) {
|
|
36
|
+
throw new Error("react-scad: Text nodes are not supported. Use only SCAD primitives.");
|
|
37
|
+
}
|
|
38
|
+
export function cloneMutableTextInstance(_textInstance) {
|
|
39
|
+
throw new Error("react-scad: Text nodes are not supported.");
|
|
40
|
+
}
|
|
41
|
+
export const scheduleTimeout = globalThis.setTimeout;
|
|
42
|
+
export const cancelTimeout = globalThis.clearTimeout;
|
|
43
|
+
export const noTimeout = -1;
|
|
44
|
+
export function getPublicInstance(instance) {
|
|
45
|
+
return instance;
|
|
46
|
+
}
|
|
47
|
+
export const isPrimaryRenderer = false;
|
|
48
|
+
export const warnsIfNotActing = false;
|
|
49
|
+
export const supportsMutation = true;
|
|
50
|
+
export function appendChild(parentInstance, child) {
|
|
51
|
+
parentInstance.children.push(child);
|
|
52
|
+
}
|
|
53
|
+
export function appendChildToContainer(container, child) {
|
|
54
|
+
container.children.push(child);
|
|
55
|
+
}
|
|
56
|
+
export function insertBefore(parentInstance, child, beforeChild) {
|
|
57
|
+
const i = parentInstance.children.indexOf(beforeChild);
|
|
58
|
+
if (i === -1)
|
|
59
|
+
parentInstance.children.push(child);
|
|
60
|
+
else
|
|
61
|
+
parentInstance.children.splice(i, 0, child);
|
|
62
|
+
}
|
|
63
|
+
export function insertInContainerBefore(container, child, beforeChild) {
|
|
64
|
+
const i = container.children.indexOf(beforeChild);
|
|
65
|
+
if (i === -1)
|
|
66
|
+
container.children.push(child);
|
|
67
|
+
else
|
|
68
|
+
container.children.splice(i, 0, child);
|
|
69
|
+
}
|
|
70
|
+
export function removeChild(parentInstance, child) {
|
|
71
|
+
const i = parentInstance.children.indexOf(child);
|
|
72
|
+
if (i !== -1)
|
|
73
|
+
parentInstance.children.splice(i, 1);
|
|
74
|
+
}
|
|
75
|
+
export function removeChildFromContainer(container, child) {
|
|
76
|
+
const i = container.children.indexOf(child);
|
|
77
|
+
if (i !== -1)
|
|
78
|
+
container.children.splice(i, 1);
|
|
79
|
+
}
|
|
80
|
+
export function resetTextContent(_instance) { }
|
|
81
|
+
export function commitTextUpdate(_textInstance, _oldText, _newText) { }
|
|
82
|
+
export function commitMount(_instance, _type, _props, _internalHandle) { }
|
|
83
|
+
export function commitUpdate(instance, updatePayload, _type, _prevProps, _nextProps, _internalHandle) {
|
|
84
|
+
if (updatePayload)
|
|
85
|
+
updateScadNode(instance, updatePayload);
|
|
86
|
+
}
|
|
87
|
+
export function hideInstance(_instance) { }
|
|
88
|
+
export function hideTextInstance(_textInstance) { }
|
|
89
|
+
export function unhideInstance(_instance, _props) { }
|
|
90
|
+
export function unhideTextInstance(_textInstance, _text) { }
|
|
91
|
+
export function clearContainer(container) {
|
|
92
|
+
container.children.length = 0;
|
|
93
|
+
}
|
|
94
|
+
export function preparePortalMount(_containerInfo) { }
|
|
95
|
+
export function getInstanceFromNode(_node) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
export function beforeActiveInstanceBlur(_instance) { }
|
|
99
|
+
export function afterActiveInstanceBlur() { }
|
|
100
|
+
export function detachDeletedInstance(_node) { }
|
|
101
|
+
export function requestPostPaintCallback(_callback) { }
|
|
102
|
+
export function maySuspendCommit(_type, _props) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
export function maySuspendCommitOnUpdate(_type, _oldProps, _newProps) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
export function maySuspendCommitInSyncRender(_type, _props) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
export function preloadInstance(_type, _props) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
export function startSuspendingCommit() {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
export function suspendInstance(_state, _instance, _type, _props) { }
|
|
118
|
+
export function waitForCommitToBeReady() {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
export function getSuspendedCommitReason(_state, _root) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
const DefaultEventPriority = 0;
|
|
125
|
+
let currentUpdatePriority = DefaultEventPriority;
|
|
126
|
+
export function setCurrentUpdatePriority(newPriority) {
|
|
127
|
+
currentUpdatePriority = newPriority;
|
|
128
|
+
}
|
|
129
|
+
export function getCurrentUpdatePriority() {
|
|
130
|
+
return currentUpdatePriority;
|
|
131
|
+
}
|
|
132
|
+
export function getCurrentEventPriority() {
|
|
133
|
+
return DefaultEventPriority;
|
|
134
|
+
}
|
|
135
|
+
export function resolveUpdatePriority() {
|
|
136
|
+
return currentUpdatePriority;
|
|
137
|
+
}
|
|
138
|
+
export function trackSchedulerEvent() { }
|
|
139
|
+
export function resolveEventType() {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
export function resolveEventTimeStamp() {
|
|
143
|
+
return -1;
|
|
144
|
+
}
|
|
145
|
+
export function shouldAttemptEagerTransition() {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ScadContainer, ScadNode } from "../types.js";
|
|
2
|
+
export declare function createScadNode(type: string, props: Record<string, unknown>): ScadNode;
|
|
3
|
+
export declare function updateScadNode(node: ScadNode, nextProps: Record<string, unknown>): void;
|
|
4
|
+
export declare function cloneScadNode(node: ScadNode, keepChildren: boolean): ScadNode;
|
|
5
|
+
export declare function createScadContainer(): ScadContainer;
|
|
6
|
+
//# sourceMappingURL=node-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-ops.d.ts","sourceRoot":"","sources":["../../src/runtime/node-ops.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAC;AAgEvE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAyLrF;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAgHvF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,GAAG,QAAQ,CA+G7E;AAED,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD"}
|