@mateuszjs/magic-render 0.1.0-next.7 → 0.1.0-next.70
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/README.md +29 -0
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/types/WebGPU/TimingHelper.d.ts +14 -0
- package/lib/types/WebGPU/TimingHelper.d.ts.map +1 -0
- package/lib/types/WebGPU/canvasSizeObserver.d.ts.map +1 -0
- package/lib/types/WebGPU/device.d.ts +5 -0
- package/lib/types/WebGPU/device.d.ts.map +1 -0
- package/lib/types/WebGPU/generatePreview.d.ts +2 -0
- package/lib/types/WebGPU/generatePreview.d.ts.map +1 -0
- package/lib/types/WebGPU/getTexture/createCheckedImageData.d.ts.map +1 -0
- package/lib/types/WebGPU/getTexture/generateMimapsArray.d.ts.map +1 -0
- package/lib/types/WebGPU/getTexture/index.d.ts +14 -0
- package/lib/types/WebGPU/getTexture/index.d.ts.map +1 -0
- package/lib/types/WebGPU/m3.d.ts.map +1 -0
- package/lib/types/{src/WebGPU → WebGPU}/pick.d.ts +1 -2
- package/lib/types/WebGPU/pick.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/blur/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/blur/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/clearComputeDepth/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/clearComputeDepth/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/clearSdf/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/clearSdf/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/combineSdf/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/combineSdf/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/computeShape/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/computeShape/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/computeShape/workers-deprecated/createWorker.d.ts +4 -0
- package/lib/types/WebGPU/programs/computeShape/workers-deprecated/createWorker.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/computeShape/workers-deprecated/worker.d.ts +2 -0
- package/lib/types/WebGPU/programs/computeShape/workers-deprecated/worker.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/drawShape/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/drawShape/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/drawTexture/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/drawTexture/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/drawTriangle/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/drawTriangle/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/initPrograms.d.ts +32 -0
- package/lib/types/WebGPU/programs/initPrograms.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/pickShape/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/pickShape/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/pickTexture/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/pickTexture/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/programs/pickTriangle/getProgram.d.ts +2 -0
- package/lib/types/WebGPU/programs/pickTriangle/getProgram.d.ts.map +1 -0
- package/lib/types/WebGPU/textureCache.d.ts +4 -0
- package/lib/types/WebGPU/textureCache.d.ts.map +1 -0
- package/lib/types/consts.d.ts +2 -0
- package/lib/types/consts.d.ts.map +1 -0
- package/lib/types/customPrograms.d.ts +16 -0
- package/lib/types/customPrograms.d.ts.map +1 -0
- package/lib/types/fonts.d.ts +6 -0
- package/lib/types/fonts.d.ts.map +1 -0
- package/lib/types/getCanvasMatrix.d.ts +2 -0
- package/lib/types/getCanvasMatrix.d.ts.map +1 -0
- package/lib/types/{src/getCanvasRenderDescriptor.d.ts → getCanvasRenderDescriptor.d.ts} +1 -0
- package/lib/types/getCanvasRenderDescriptor.d.ts.map +1 -0
- package/lib/types/{src/getDepthTexture.d.ts → getDepthTexture.d.ts} +1 -0
- package/lib/types/getDepthTexture.d.ts.map +1 -0
- package/lib/types/getMultisampleTexture.d.ts +2 -0
- package/lib/types/getMultisampleTexture.d.ts.map +1 -0
- package/lib/types/getRenderDescriptor.d.ts.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/loadingTexture.d.ts +3 -0
- package/lib/types/loadingTexture.d.ts.map +1 -0
- package/lib/types/pointer.d.ts +17 -0
- package/lib/types/pointer.d.ts.map +1 -0
- package/lib/types/run.d.ts +6 -0
- package/lib/types/run.d.ts.map +1 -0
- package/lib/types/snapshots/convert.d.ts +8 -0
- package/lib/types/snapshots/convert.d.ts.map +1 -0
- package/lib/types/snapshots/fill.d.ts +4 -0
- package/lib/types/snapshots/fill.d.ts.map +1 -0
- package/lib/types/snapshots/snapshots.d.ts +6 -0
- package/lib/types/snapshots/snapshots.d.ts.map +1 -0
- package/lib/types/snapshots/toZigAsset.d.ts +3 -0
- package/lib/types/snapshots/toZigAsset.d.ts.map +1 -0
- package/lib/types/svgToShapes/addUiElement.d.ts +3 -0
- package/lib/types/svgToShapes/addUiElement.d.ts.map +1 -0
- package/lib/types/svgToShapes/arcToBezier.d.ts +11 -0
- package/lib/types/svgToShapes/arcToBezier.d.ts.map +1 -0
- package/lib/types/svgToShapes/boundingBox.d.ts +18 -0
- package/lib/types/svgToShapes/boundingBox.d.ts.map +1 -0
- package/lib/types/svgToShapes/collectShapesData.d.ts +12 -0
- package/lib/types/svgToShapes/collectShapesData.d.ts.map +1 -0
- package/lib/types/svgToShapes/const.d.ts +5 -0
- package/lib/types/svgToShapes/const.d.ts.map +1 -0
- package/lib/types/svgToShapes/definitions.d.ts +44 -0
- package/lib/types/svgToShapes/definitions.d.ts.map +1 -0
- package/lib/types/svgToShapes/getProps.d.ts +4 -0
- package/lib/types/svgToShapes/getProps.d.ts.map +1 -0
- package/lib/types/svgToShapes/getShapesAssets.d.ts +5 -0
- package/lib/types/svgToShapes/getShapesAssets.d.ts.map +1 -0
- package/lib/types/svgToShapes/parseEllipse.d.ts +3 -0
- package/lib/types/svgToShapes/parseEllipse.d.ts.map +1 -0
- package/lib/types/svgToShapes/parsePathData.d.ts +3 -0
- package/lib/types/svgToShapes/parsePathData.d.ts.map +1 -0
- package/lib/types/svgToShapes/parseRect.d.ts +3 -0
- package/lib/types/svgToShapes/parseRect.d.ts.map +1 -0
- package/lib/types/svgToShapes/radialGradient.d.ts +16 -0
- package/lib/types/svgToShapes/radialGradient.d.ts.map +1 -0
- package/lib/types/svgToShapes/utils.d.ts +10 -0
- package/lib/types/svgToShapes/utils.d.ts.map +1 -0
- package/lib/types/textures.d.ts +29 -0
- package/lib/types/textures.d.ts.map +1 -0
- package/lib/types/types.d.ts +181 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/typing.d.ts +7 -0
- package/lib/types/typing.d.ts.map +1 -0
- package/lib/types/utils/assertUnreachable.d.ts +2 -0
- package/lib/types/utils/assertUnreachable.d.ts.map +1 -0
- package/lib/types/utils/atNormIndex.d.ts.map +1 -0
- package/lib/types/utils/captureCanvasStream.d.ts.map +1 -0
- package/lib/types/utils/captureCanvasStreamWasm.d.ts.map +1 -0
- package/lib/types/utils/clamp.d.ts.map +1 -0
- package/lib/types/utils/debounce.d.ts +2 -0
- package/lib/types/utils/debounce.d.ts.map +1 -0
- package/lib/types/utils/decompressWoff2.d.mts +3 -0
- package/lib/types/utils/decompressWoff2.d.mts.map +1 -0
- package/lib/types/{src/utils → utils}/distancePointToLine.d.ts +1 -0
- package/lib/types/utils/distancePointToLine.d.ts.map +1 -0
- package/lib/types/utils/downloadCanvas.d.ts +2 -0
- package/lib/types/utils/downloadCanvas.d.ts.map +1 -0
- package/lib/types/utils/fitCurve.d.ts.map +1 -0
- package/lib/types/utils/getAngle.d.ts +3 -0
- package/lib/types/utils/getAngle.d.ts.map +1 -0
- package/lib/types/utils/getAngleDiff.d.ts.map +1 -0
- package/lib/types/{src/utils → utils}/getBezierPos.d.ts +1 -0
- package/lib/types/utils/getBezierPos.d.ts.map +1 -0
- package/lib/types/{src/utils → utils}/getBezierTan.d.ts +1 -0
- package/lib/types/utils/getBezierTan.d.ts.map +1 -0
- package/lib/types/{src/utils → utils}/getCurveLength.d.ts +1 -0
- package/lib/types/utils/getCurveLength.d.ts.map +1 -0
- package/lib/types/utils/getDefaultPoints.d.ts +3 -0
- package/lib/types/utils/getDefaultPoints.d.ts.map +1 -0
- package/lib/types/utils/getDistance.d.ts +3 -0
- package/lib/types/utils/getDistance.d.ts.map +1 -0
- package/lib/types/utils/mat4.d.ts.map +1 -0
- package/lib/types/utils/normalizeVec2.d.ts +3 -0
- package/lib/types/utils/normalizeVec2.d.ts.map +1 -0
- package/lib/types/utils/resizeArray.d.ts.map +1 -0
- package/lib/types/utils/setCamera.d.ts +2 -0
- package/lib/types/utils/setCamera.d.ts.map +1 -0
- package/lib/types/utils/throttle.d.ts +2 -0
- package/lib/types/utils/throttle.d.ts.map +1 -0
- package/lib/types/utils/vec3.d.ts.map +1 -0
- package/lib/types.mjs +2 -0
- package/lib/types.mjs.map +1 -0
- package/package.json +34 -15
- package/lib/e9072ac5eb734c67.png +0 -0
- package/lib/types/src/WebGPU/canvasSizeObserver.d.ts.map +0 -1
- package/lib/types/src/WebGPU/getDevice.d.ts +0 -2
- package/lib/types/src/WebGPU/getDevice.d.ts.map +0 -1
- package/lib/types/src/WebGPU/getTexture/createCheckedImageData.d.ts.map +0 -1
- package/lib/types/src/WebGPU/getTexture/generateMimapsArray.d.ts.map +0 -1
- package/lib/types/src/WebGPU/getTexture/index.d.ts +0 -17
- package/lib/types/src/WebGPU/getTexture/index.d.ts.map +0 -1
- package/lib/types/src/WebGPU/m3.d.ts.map +0 -1
- package/lib/types/src/WebGPU/pick.d.ts.map +0 -1
- package/lib/types/src/WebGPU/pointer.d.ts +0 -10
- package/lib/types/src/WebGPU/pointer.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/blur/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/blur/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/draw/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/draw/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/draw3dModel/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/draw3dModel/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/draw3dModelLight/getProgram.d.ts +0 -9
- package/lib/types/src/WebGPU/programs/draw3dModelLight/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/draw3dModelTexture/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/draw3dModelTexture/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/drawBezier/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/drawBezier/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/drawMSDF/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/drawMSDF/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/drawTexture/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/drawTexture/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/drawTriangle/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/drawTriangle/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/initPrograms.d.ts +0 -22
- package/lib/types/src/WebGPU/programs/initPrograms.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/pickTexture/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/pickTexture/getProgram.d.ts.map +0 -1
- package/lib/types/src/WebGPU/programs/pickTriangle/getProgram.d.ts +0 -2
- package/lib/types/src/WebGPU/programs/pickTriangle/getProgram.d.ts.map +0 -1
- package/lib/types/src/__test__/index.test.d.ts +0 -1
- package/lib/types/src/__test__/index.test.d.ts.map +0 -1
- package/lib/types/src/consts.d.ts +0 -16
- package/lib/types/src/consts.d.ts.map +0 -1
- package/lib/types/src/getCanvasMatrix.d.ts +0 -2
- package/lib/types/src/getCanvasMatrix.d.ts.map +0 -1
- package/lib/types/src/getCanvasRenderDescriptor.d.ts.map +0 -1
- package/lib/types/src/getDepthTexture.d.ts.map +0 -1
- package/lib/types/src/getMultisampleTexture.d.ts +0 -2
- package/lib/types/src/getMultisampleTexture.d.ts.map +0 -1
- package/lib/types/src/getRenderDescriptor.d.ts.map +0 -1
- package/lib/types/src/index.d.ts +0 -14
- package/lib/types/src/index.d.ts.map +0 -1
- package/lib/types/src/models/Video/MiniatureVideo.d.ts +0 -30
- package/lib/types/src/models/Video/MiniatureVideo.d.ts.map +0 -1
- package/lib/types/src/run.d.ts +0 -5
- package/lib/types/src/run.d.ts.map +0 -1
- package/lib/types/src/types.d.ts +0 -4
- package/lib/types/src/types.d.ts.map +0 -1
- package/lib/types/src/utils/atNormIndex.d.ts.map +0 -1
- package/lib/types/src/utils/captureCanvasStream.d.ts.map +0 -1
- package/lib/types/src/utils/captureCanvasStreamWasm.d.ts.map +0 -1
- package/lib/types/src/utils/clamp.d.ts.map +0 -1
- package/lib/types/src/utils/distancePointToLine.d.ts.map +0 -1
- package/lib/types/src/utils/fitCurve.d.ts.map +0 -1
- package/lib/types/src/utils/getAngle.d.ts +0 -2
- package/lib/types/src/utils/getAngle.d.ts.map +0 -1
- package/lib/types/src/utils/getAngleDiff.d.ts.map +0 -1
- package/lib/types/src/utils/getBezierPos.d.ts.map +0 -1
- package/lib/types/src/utils/getBezierTan.d.ts.map +0 -1
- package/lib/types/src/utils/getCurveLength.d.ts.map +0 -1
- package/lib/types/src/utils/getDefaultPoints.d.ts +0 -2
- package/lib/types/src/utils/getDefaultPoints.d.ts.map +0 -1
- package/lib/types/src/utils/getDistance.d.ts +0 -2
- package/lib/types/src/utils/getDistance.d.ts.map +0 -1
- package/lib/types/src/utils/getSvgSource.d.ts +0 -2
- package/lib/types/src/utils/getSvgSource.d.ts.map +0 -1
- package/lib/types/src/utils/mat4.d.ts.map +0 -1
- package/lib/types/src/utils/normalizeVec2.d.ts +0 -2
- package/lib/types/src/utils/normalizeVec2.d.ts.map +0 -1
- package/lib/types/src/utils/resizeArray.d.ts.map +0 -1
- package/lib/types/src/utils/vec3.d.ts.map +0 -1
- /package/lib/types/{src/WebGPU → WebGPU}/canvasSizeObserver.d.ts +0 -0
- /package/lib/types/{src/WebGPU → WebGPU}/getTexture/createCheckedImageData.d.ts +0 -0
- /package/lib/types/{src/WebGPU → WebGPU}/getTexture/generateMimapsArray.d.ts +0 -0
- /package/lib/types/{src/WebGPU → WebGPU}/m3.d.ts +0 -0
- /package/lib/types/{src/getRenderDescriptor.d.ts → getRenderDescriptor.d.ts} +0 -0
- /package/lib/types/{src/utils → utils}/atNormIndex.d.ts +0 -0
- /package/lib/types/{src/utils → utils}/captureCanvasStream.d.ts +0 -0
- /package/lib/types/{src/utils → utils}/captureCanvasStreamWasm.d.ts +0 -0
- /package/lib/types/{src/utils → utils}/clamp.d.ts +0 -0
- /package/lib/types/{src/utils → utils}/fitCurve.d.ts +0 -0
- /package/lib/types/{src/utils → utils}/getAngleDiff.d.ts +0 -0
- /package/lib/types/{src/utils → utils}/mat4.d.ts +0 -0
- /package/lib/types/{src/utils → utils}/resizeArray.d.ts +0 -0
- /package/lib/types/{src/utils → utils}/vec3.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseEllipse.d.ts","sourceRoot":"","sources":["../../../src/svgToShapes/parseEllipse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK,EAAE,CAyC5F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsePathData.d.ts","sourceRoot":"","sources":["../../../src/svgToShapes/parsePathData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAuT7B,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,EAAE,EAAE,CAKnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseRect.d.ts","sourceRoot":"","sources":["../../../src/svgToShapes/parseRect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAG7B,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAwB9F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Point } from 'types';
|
|
2
|
+
/**
|
|
3
|
+
* Get the distance and ratio between two points for radial gradient
|
|
4
|
+
* When shape's boundary has aspect ratio different than 1:1,
|
|
5
|
+
* then scale affect radial gradient angle calculations.
|
|
6
|
+
* Thats why this function exists to eliminate that effect.
|
|
7
|
+
* @param center center of the radius gradient
|
|
8
|
+
* @param vx horizontal radius - distance between center of the gradient and further point on horizontal line(after transforming by angle of radial gradient)
|
|
9
|
+
* @param vy vertical radius - distance between center of the gradient and further point on vertical line(after transforming by angle of radial gradient)
|
|
10
|
+
* @returns The horizontal destination point and the ratio to calculate vertical destination point
|
|
11
|
+
*/
|
|
12
|
+
export declare function getCorrectDestinationRatio(center: Point, vx: Point, vy: Point): {
|
|
13
|
+
destination: Point;
|
|
14
|
+
ratio: number;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=radialGradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radialGradient.d.ts","sourceRoot":"","sources":["../../../src/svgToShapes/radialGradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,KAAK,EACb,EAAE,EAAE,KAAK,EACT,EAAE,EAAE,KAAK,GACR;IACD,WAAW,EAAE,KAAK,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd,CA2DA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ElementNode, Node } from 'svg-parser';
|
|
2
|
+
import { AttrValue } from './definitions';
|
|
3
|
+
import { Color, Point } from 'types';
|
|
4
|
+
export declare function isStraightHandle(p: Point): boolean;
|
|
5
|
+
export declare function parseColor(cssColor: string, overrideAlpha?: number): Color;
|
|
6
|
+
export declare function getNum(x: AttrValue, fallback?: number): number;
|
|
7
|
+
export declare function isElementNode(node: string | Node): node is ElementNode;
|
|
8
|
+
export declare const IDENTITY_MATRIX: number[];
|
|
9
|
+
export declare function parseTransform(str: string | undefined, initialMatrix?: number[]): number[];
|
|
10
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/svgToShapes/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAIpC,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,WAExC;AAGD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,SAAI,GAAG,KAAK,CAoBrE;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,GAAE,MAAU,GAAG,MAAM,CAKjE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,IAAI,WAAW,CAEtE;AAED,eAAO,MAAM,eAAe,UAAqB,CAAA;AAgBjD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,aAAa,GAAE,MAAM,EAAoB,GACxC,MAAM,EAAE,CAkDV"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Asset } from 'types';
|
|
2
|
+
export declare function init(_updateProcessing: (loadingTextures: number) => void): void;
|
|
3
|
+
export interface TextureSource {
|
|
4
|
+
url: string;
|
|
5
|
+
texture?: GPUTexture;
|
|
6
|
+
hash?: string;
|
|
7
|
+
}
|
|
8
|
+
interface ImageExtractedData {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
isNewTexture?: boolean;
|
|
12
|
+
shapeAssets?: Asset[];
|
|
13
|
+
error?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export declare function add(url: string, onLoad?: (data: ImageExtractedData) => void): number;
|
|
16
|
+
export declare function getTexture(textureId: number): GPUTexture;
|
|
17
|
+
export declare function getTextureSafe(textureId: number): GPUTexture;
|
|
18
|
+
export declare function getOptionTexture(textureId: number): GPUTexture | undefined;
|
|
19
|
+
export declare function createCacheTexture(): number;
|
|
20
|
+
export declare function createDisposableComputeDepthTexture(width: number, height: number): number;
|
|
21
|
+
export declare function createSDF(): number;
|
|
22
|
+
export declare function emptySDF(textureId: number, width: number, height: number): void;
|
|
23
|
+
export declare function update(textureId: number, width: number, height: number): void;
|
|
24
|
+
export declare function setCacheTexture(id: number, texture: GPUTexture): void;
|
|
25
|
+
export declare function getTextureCache(id: number, expectWidth: number, expectHeight: number): GPUTexture;
|
|
26
|
+
export declare function getUrl(textureId: number): string;
|
|
27
|
+
export declare function updateTextureUrl(textureId: number, url: string): void;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=textures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|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MAAM,EAAE,MAAM,GAAG,IAAI,CAmB7E;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,QAM9D;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,UAAU,CAwBjG;AAED,wBAAgB,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEhD;AAqCD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,QAE9D"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export type HTMLInputEvent = Event & {
|
|
2
|
+
target: HTMLInputElement & EventTarget;
|
|
3
|
+
};
|
|
4
|
+
export type Point = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
export type PointUV = {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
u: number;
|
|
12
|
+
v: number;
|
|
13
|
+
};
|
|
14
|
+
export type BoundingBox = {
|
|
15
|
+
min_x: number;
|
|
16
|
+
min_y: number;
|
|
17
|
+
max_x: number;
|
|
18
|
+
max_y: number;
|
|
19
|
+
};
|
|
20
|
+
export type Color = [number, number, number, number];
|
|
21
|
+
export type Id = [number, number, number, number];
|
|
22
|
+
export type GradientStop = {
|
|
23
|
+
color: Color;
|
|
24
|
+
offset: number;
|
|
25
|
+
};
|
|
26
|
+
export type LinearGradient = {
|
|
27
|
+
start: Point;
|
|
28
|
+
end: Point;
|
|
29
|
+
stops: GradientStop[];
|
|
30
|
+
};
|
|
31
|
+
export type RadialGradient = LinearGradient & {
|
|
32
|
+
radius_ratio: number;
|
|
33
|
+
};
|
|
34
|
+
type Program = {
|
|
35
|
+
code: string;
|
|
36
|
+
id?: number;
|
|
37
|
+
errors?: CustomProgramError[];
|
|
38
|
+
};
|
|
39
|
+
export type Fill = {
|
|
40
|
+
linear: LinearGradient;
|
|
41
|
+
} | {
|
|
42
|
+
radial: RadialGradient;
|
|
43
|
+
} | {
|
|
44
|
+
solid: Color;
|
|
45
|
+
} | {
|
|
46
|
+
program: Program;
|
|
47
|
+
};
|
|
48
|
+
export type Effect = {
|
|
49
|
+
dist_start: number;
|
|
50
|
+
dist_end: number;
|
|
51
|
+
fill: Fill;
|
|
52
|
+
};
|
|
53
|
+
export type BasicProps = {
|
|
54
|
+
blur: Point | null;
|
|
55
|
+
opacity: number;
|
|
56
|
+
};
|
|
57
|
+
export type TypoProps = {
|
|
58
|
+
font_size: number;
|
|
59
|
+
font_family_id: number;
|
|
60
|
+
line_height: number;
|
|
61
|
+
};
|
|
62
|
+
export type Image = {
|
|
63
|
+
id?: number;
|
|
64
|
+
bounds?: PointUV[];
|
|
65
|
+
url: string;
|
|
66
|
+
texture_id?: number;
|
|
67
|
+
};
|
|
68
|
+
export type Shape = {
|
|
69
|
+
id?: number;
|
|
70
|
+
paths: Point[][];
|
|
71
|
+
bounds: PointUV[];
|
|
72
|
+
props: BasicProps;
|
|
73
|
+
effects: Effect[];
|
|
74
|
+
sdf_texture_id?: number;
|
|
75
|
+
cache_texture_id?: number | null;
|
|
76
|
+
};
|
|
77
|
+
export type Text = {
|
|
78
|
+
id?: number;
|
|
79
|
+
content: string;
|
|
80
|
+
bounds: PointUV[];
|
|
81
|
+
props: BasicProps;
|
|
82
|
+
effects: Effect[];
|
|
83
|
+
typo_props: TypoProps;
|
|
84
|
+
sdf_texture_id: number | null;
|
|
85
|
+
is_sdf_shared: boolean;
|
|
86
|
+
};
|
|
87
|
+
export type Asset = Image | Shape | Text;
|
|
88
|
+
export type ProjectSnapshot = {
|
|
89
|
+
width: number;
|
|
90
|
+
height: number;
|
|
91
|
+
assets: Asset[];
|
|
92
|
+
};
|
|
93
|
+
export declare enum CreatorTool {
|
|
94
|
+
SelectAsset = 0,
|
|
95
|
+
DrawBezierCurve = 1,
|
|
96
|
+
SelectNode = 2,
|
|
97
|
+
Text = 3
|
|
98
|
+
}
|
|
99
|
+
export type ZigFill = OneOf<{
|
|
100
|
+
solid: Color;
|
|
101
|
+
linear: LinearGradient;
|
|
102
|
+
radial: RadialGradient;
|
|
103
|
+
program_id: number;
|
|
104
|
+
}>;
|
|
105
|
+
export type ZigEffect = {
|
|
106
|
+
dist_start: number;
|
|
107
|
+
dist_end: number;
|
|
108
|
+
fill: ZigFill;
|
|
109
|
+
};
|
|
110
|
+
type ZigImage = {
|
|
111
|
+
id: number;
|
|
112
|
+
bounds: PointUV[];
|
|
113
|
+
texture_id: number;
|
|
114
|
+
};
|
|
115
|
+
type ZigShape = {
|
|
116
|
+
id: number;
|
|
117
|
+
paths: Point[][];
|
|
118
|
+
bounds: PointUV[];
|
|
119
|
+
props: BasicProps;
|
|
120
|
+
effects: ZigEffect[];
|
|
121
|
+
sdf_texture_id: number;
|
|
122
|
+
cache_texture_id: number | null;
|
|
123
|
+
};
|
|
124
|
+
type ZigText = {
|
|
125
|
+
id: number;
|
|
126
|
+
content: string | null;
|
|
127
|
+
bounds: PointUV[];
|
|
128
|
+
props: BasicProps;
|
|
129
|
+
effects: ZigEffect[];
|
|
130
|
+
typo_props: TypoProps;
|
|
131
|
+
sdf_texture_id: number | null;
|
|
132
|
+
is_sdf_shared: boolean;
|
|
133
|
+
};
|
|
134
|
+
export type ZigAsset = {
|
|
135
|
+
img: ZigImage;
|
|
136
|
+
} | {
|
|
137
|
+
shape: ZigShape;
|
|
138
|
+
} | {
|
|
139
|
+
text: ZigText;
|
|
140
|
+
};
|
|
141
|
+
export type ZigProjectSnapshot = {
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
assets: ZigAsset[];
|
|
145
|
+
};
|
|
146
|
+
export type CustomProgramError = {
|
|
147
|
+
length: number;
|
|
148
|
+
lineNum: number;
|
|
149
|
+
linePos: number;
|
|
150
|
+
message: string;
|
|
151
|
+
offset: number;
|
|
152
|
+
};
|
|
153
|
+
export type CreatorProps = {
|
|
154
|
+
initialProjectWidth: number;
|
|
155
|
+
initialProjectHeight: number;
|
|
156
|
+
canvas: HTMLCanvasElement;
|
|
157
|
+
uploadTexture: (url: string, onNewUrl: (newUrl: string) => void) => void;
|
|
158
|
+
onSnapshotUpdate: (snapshot: ProjectSnapshot, commit: boolean) => void;
|
|
159
|
+
onAssetSelect: (assetId: Id) => void;
|
|
160
|
+
onIsProcessingFlagUpdate: (inProgress: boolean) => void;
|
|
161
|
+
onPreviewUpdate: (canvas: HTMLCanvasElement) => void;
|
|
162
|
+
onUpdateTool: (tool: CreatorTool) => void;
|
|
163
|
+
getFontUrl: (fontId: number) => string;
|
|
164
|
+
isTest: boolean;
|
|
165
|
+
};
|
|
166
|
+
export type CreatorAPI = {
|
|
167
|
+
addImages: (urls: string[]) => Promise<void>;
|
|
168
|
+
setSnapshot: (snapshot: ProjectSnapshot, withSnapshot: boolean) => Promise<void>;
|
|
169
|
+
removeAsset: VoidFunction;
|
|
170
|
+
destroy: VoidFunction;
|
|
171
|
+
setTool: (tool: CreatorTool) => void;
|
|
172
|
+
updateAssetTypoProps: (props: TypoProps, commit: boolean) => void;
|
|
173
|
+
updateAssetProps: (props: BasicProps, commit: boolean) => void;
|
|
174
|
+
updateAssetEffects: (effects: Effect[], commit: boolean) => void;
|
|
175
|
+
updateAssetBounds: (bounds: PointUV[], commit: boolean) => void;
|
|
176
|
+
download: VoidFunction;
|
|
177
|
+
INFINITE_DISTANCE_THRESHOLD: number;
|
|
178
|
+
INFINITE_DISTANCE: number;
|
|
179
|
+
};
|
|
180
|
+
export {};
|
|
181
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG;IACnC,MAAM,EAAE,gBAAgB,GAAG,WAAW,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IAClB,CAA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ACvB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,WAAW,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAChF,WAAW,EAAE,YAAY,CAAA;IACzB,OAAO,EAAE,YAAY,CAAA;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAA;IAEpC,oBAAoB,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IACjE,gBAAgB,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9D,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IAChE,iBAAiB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/D,QAAQ,EAAE,YAAY,CAAA;IACtB,2BAA2B,EAAE,MAAM,CAAA;IACnC,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function sanitizeContent(text: string | null): string;
|
|
2
|
+
export declare function isEnabled(): boolean;
|
|
3
|
+
export declare function updateContent(text: string): void;
|
|
4
|
+
export declare function updateSelection(start: number, end: number): void;
|
|
5
|
+
export declare function enable(text: string, canvas: HTMLCanvasElement): void;
|
|
6
|
+
export declare function disable(): void;
|
|
7
|
+
//# sourceMappingURL=typing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typing.d.ts","sourceRoot":"","sources":["../../src/typing.ts"],"names":[],"mappings":"AAQA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAG3D;AAED,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAmCD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAkBhD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAKhE;AA0BD,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAgCpE;AAED,wBAAgB,OAAO,IAAI,IAAI,CAO9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertUnreachable.d.ts","sourceRoot":"","sources":["../../../src/utils/assertUnreachable.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAEzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atNormIndex.d.ts","sourceRoot":"","sources":["../../../src/utils/atNormIndex.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,UAUnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captureCanvasStream.d.ts","sourceRoot":"","sources":["../../../src/utils/captureCanvasStream.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,UAAU,EAAE,iBAAiB,cAW5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captureCanvasStreamWasm.d.ts","sourceRoot":"","sources":["../../../src/utils/captureCanvasStreamWasm.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["../../../src/utils/clamp.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAEpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../src/utils/debounce.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,IAErD,GAAG,MAAM,OAAO,EAAE,UAM3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decompressWoff2.d.mts","sourceRoot":"","sources":["../../../src/utils/decompressWoff2.mjs"],"names":[],"mappings":";AAEA,wBAAwD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distancePointToLine.d.ts","sourceRoot":"","sources":["../../../src/utils/distancePointToLine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,UAKzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadCanvas.d.ts","sourceRoot":"","sources":["../../../src/utils/downloadCanvas.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,QAKvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fitCurve.d.ts","sourceRoot":"","sources":["../../../src/utils/fitCurve.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;GAMG;AAEH,yCALW,KAAK,CAAC,KAAK,QAAQ,CAAC,qBAElB,KAAK,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAmBvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAngle.d.ts","sourceRoot":"","sources":["../../../src/utils/getAngle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,UAEtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAngleDiff.d.ts","sourceRoot":"","sources":["../../../src/utils/getAngleDiff.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBezierPos.d.ts","sourceRoot":"","sources":["../../../src/utils/getBezierPos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK,CAkBjG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBezierTan.d.ts","sourceRoot":"","sources":["../../../src/utils/getBezierTan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAG7B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK,CASjG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCurveLength.d.ts","sourceRoot":"","sources":["../../../src/utils/getCurveLength.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAO7B,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,EAAE,EAAE,KAAK,EACT,EAAE,EAAE,KAAK,EACT,EAAE,EAAE,KAAK,EACT,EAAE,EAAE,KAAK,EACT,SAAS,EAAE,MAAM,GAChB,MAAM,EAAE,CAYV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDefaultPoints.d.ts","sourceRoot":"","sources":["../../../src/utils/getDefaultPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,GACpB,OAAO,EAAE,CAUX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDistance.d.ts","sourceRoot":"","sources":["../../../src/utils/getDistance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,UAEvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mat4.d.ts","sourceRoot":"","sources":["../../../src/utils/mat4.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,IAAI;sBACU,MAAM,UAAU,MAAM,SAAS,MAAM,OAAO,YAAY;uCAKvC,MAAM,UAAU,MAAM,SAAS,MAAM,QAAQ,MAAM;gBA2B1E,MAAM,SAAS,MAAM,UAAU,MAAM,OAAO,MAAM,QAAQ,MAAM,OAAO,MAAM;;gBAgC7E,YAAY,KAAK,YAAY;mBAyD1B,MAAM,EAAE,GAAG,YAAY,UAAU,MAAM,EAAE,MAAM,MAAM,EAAE;eAa3D,YAAY;iBAwFV,YAAY;aAShB,YAAY,GAAG,MAAM,EAAE,UAAU,MAAM,EAAE,MAAM,MAAM,EAAE;gBAapD,MAAM,EAAE,GAAG,YAAY,UAAU,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,YAAY;8BAI7D,MAAM,EAAE;8BAQR,MAAM;8BAUN,MAAM;8BAUN,MAAM;0BAUV,MAAM,EAAE;iBAQjB,YAAY,eAAe,MAAM,EAAE,QAAQ,YAAY;eAIzD,YAAY,kBAAkB,MAAM,QAAQ,YAAY;eAIxD,YAAY,kBAAkB,MAAM,QAAQ,YAAY;eAIxD,YAAY,kBAAkB,MAAM,QAAQ,YAAY;aAI1D,YAAY,SAAS,MAAM,EAAE,QAAQ,YAAY;CAG3D,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeVec2.d.ts","sourceRoot":"","sources":["../../../src/utils/normalizeVec2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,KAAK,CAMvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizeArray.d.ts","sourceRoot":"","sources":["../../../src/utils/resizeArray.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,YASnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setCamera.d.ts","sourceRoot":"","sources":["../../../src/utils/setCamera.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,KAAK,GAAG,MAAM,EACpB,MAAM,EAAE,iBAAiB,EACzB,OAAO,SAAI,QAWZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../src/utils/throttle.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,EACnE,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAmBlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vec3.d.ts","sourceRoot":"","sources":["../../../src/utils/vec3.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,IAAI;aACC,MAAM,EAAE,GAAG,YAAY,KAAK,MAAM,EAAE,GAAG,YAAY;gBAYhD,MAAM,EAAE,GAAG,YAAY,KAAK,MAAM,EAAE,GAAG,YAAY;iBAQjD,MAAM,EAAE,GAAG,YAAY;CAetC,CAAA;AAED,eAAe,IAAI,CAAA"}
|
package/lib/types.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e,t={d:(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},r={};t.d(r,{b:()=>e}),function(e){e[e.SelectAsset=0]="SelectAsset",e[e.DrawBezierCurve=1]="DrawBezierCurve",e[e.SelectNode=2]="SelectNode",e[e.Text=3]="Text"}(e||(e={}));const o=r.b;export{o as CreatorTool};
|
|
2
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","mappings":"AACA,IC6GYA,ED7GRC,EAAsB,CEA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,sBF8GlF,SAAYX,GACV,iCACA,yCACA,+BACA,kBACD,CALD,CAAYA,IAAAA,EAAW,K","sources":["webpack://@mateuszjs/magic-render/webpack/bootstrap","webpack://@mateuszjs/magic-render/./src/types.ts","webpack://@mateuszjs/magic-render/webpack/runtime/define property getters","webpack://@mateuszjs/magic-render/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","export type HTMLInputEvent = Event & {\n target: HTMLInputElement & EventTarget\n}\n\nexport type Point = {\n x: number\n y: number\n}\n\nexport type PointUV = {\n x: number\n y: number\n u: number\n v: number\n}\n\nexport type BoundingBox = {\n min_x: number\n min_y: number\n max_x: number\n max_y: number\n}\n\nexport type Color = [number, number, number, number]\nexport type Id = [number, number, number, number]\n\nexport type GradientStop = {\n color: Color\n offset: number // 0..1\n}\n\nexport type LinearGradient = {\n start: Point\n end: Point\n stops: GradientStop[]\n}\n\nexport type RadialGradient = LinearGradient & {\n radius_ratio: number\n}\n\ntype Program = {\n code: string\n id?: number\n errors?: CustomProgramError[]\n}\n\nexport type Fill =\n | { linear: LinearGradient }\n | { radial: RadialGradient }\n | { solid: Color }\n | { program: Program }\n\nexport type Effect = {\n dist_start: number\n dist_end: number\n fill: Fill\n}\n\n// Same for Zig and Api\nexport type BasicProps = {\n blur: Point | null\n opacity: number\n}\n\n// Same for Zig and API\nexport type TypoProps = {\n font_size: number\n font_family_id: number\n line_height: number\n}\n\n/* type WITHOUT prefix \"Zig\" are used in API */\n\nexport type Image = {\n id?: number // not needed while loading project but useful for undo/redo to maintain selection\n bounds?: PointUV[]\n url: string\n texture_id?: number\n}\n\nexport type Shape = {\n id?: number // not needed while loading project but useful for undo/redo to maintain selection\n paths: Point[][]\n bounds: PointUV[]\n props: BasicProps\n effects: Effect[]\n sdf_texture_id?: number\n cache_texture_id?: number | null\n}\n\nexport type Text = {\n id?: number // not needed while loading project but useful for undo/redo to maintain selection\n content: string\n bounds: PointUV[]\n props: BasicProps\n effects: Effect[]\n typo_props: TypoProps\n sdf_texture_id: number | null\n is_sdf_shared: boolean\n}\n\nexport type Asset = Image | Shape | Text\n\nexport type ProjectSnapshot = {\n width: number\n height: number\n assets: Asset[]\n}\n\nexport enum CreatorTool {\n SelectAsset = 0,\n DrawBezierCurve = 1,\n SelectNode = 2,\n Text = 3,\n}\n\n/* type with prefix \"Zig\" mirrors the data coming from/to the zig module */\n\nexport type ZigFill = OneOf<{\n solid: Color\n linear: LinearGradient\n radial: RadialGradient\n program_id: number\n}>\n\nexport type ZigEffect = {\n dist_start: number\n dist_end: number\n fill: ZigFill\n}\n\ntype ZigImage = {\n id: number\n bounds: PointUV[]\n texture_id: number\n}\n\ntype ZigShape = {\n id: number\n paths: Point[][]\n bounds: PointUV[]\n props: BasicProps\n effects: ZigEffect[]\n sdf_texture_id: number\n cache_texture_id: number | null\n}\n\ntype ZigText = {\n id: number\n content: string | null\n bounds: PointUV[]\n props: BasicProps\n effects: ZigEffect[]\n typo_props: TypoProps\n sdf_texture_id: number | null\n is_sdf_shared: boolean\n}\n\nexport type ZigAsset = { img: ZigImage } | { shape: ZigShape } | { text: ZigText }\n\nexport type ZigProjectSnapshot = {\n width: number\n height: number\n assets: ZigAsset[]\n}\n\nexport type CustomProgramError = {\n length: number\n lineNum: number\n linePos: number\n message: string\n offset: number\n}\n\nexport type CreatorProps = {\n initialProjectWidth: number\n initialProjectHeight: number\n canvas: HTMLCanvasElement\n uploadTexture: (url: string, onNewUrl: (newUrl: string) => void) => void\n onSnapshotUpdate: (snapshot: ProjectSnapshot, commit: boolean) => void\n onAssetSelect: (assetId: Id) => void\n onIsProcessingFlagUpdate: (inProgress: boolean) => void\n onPreviewUpdate: (canvas: HTMLCanvasElement) => void\n onUpdateTool: (tool: CreatorTool) => void\n getFontUrl: (fontId: number) => string\n isTest: boolean\n}\n\nexport type CreatorAPI = {\n addImages: (urls: string[]) => Promise<void>\n setSnapshot: (snapshot: ProjectSnapshot, withSnapshot: boolean) => Promise<void>\n removeAsset: VoidFunction\n destroy: VoidFunction\n setTool: (tool: CreatorTool) => void\n // we need to obtain live update!\n updateAssetTypoProps: (props: TypoProps, commit: boolean) => void // updates typography properties of selected asset\n updateAssetProps: (props: BasicProps, commit: boolean) => void // updates basic properties of selected asset\n updateAssetEffects: (effects: Effect[], commit: boolean) => void // updates only effects of selected asset\n updateAssetBounds: (bounds: PointUV[], commit: boolean) => void // updates bounds of selected asset\n download: VoidFunction // triggers download of the current canvas content as an image\n INFINITE_DISTANCE_THRESHOLD: number // threshold value for considering a distance as \"infinite\" in SDF fill effects\n INFINITE_DISTANCE: number // maximum f32 value, used for SDF fill effects\n}\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))"],"names":["CreatorTool","__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mateuszjs/magic-render",
|
|
3
3
|
"description": "Initial version of visual editor",
|
|
4
|
-
"version": "0.1.0-next.
|
|
4
|
+
"version": "0.1.0-next.70",
|
|
5
5
|
"author": "Mateusz Walendzik",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
7
|
+
"node": "^22.14.0 || >=24.10.0"
|
|
8
8
|
},
|
|
9
|
+
"sideEffects": false,
|
|
9
10
|
"publishConfig": {
|
|
10
11
|
"access": "public",
|
|
11
12
|
"provenance": true
|
|
@@ -21,29 +22,31 @@
|
|
|
21
22
|
},
|
|
22
23
|
"scripts": {
|
|
23
24
|
"start": "export NODE_ENV=development && webpack serve --mode development",
|
|
24
|
-
"build": "
|
|
25
|
+
"build": "rm -rf lib lib-test && export NODE_ENV=production && tsc --project tsconfig.build.json --emitDeclarationOnly && webpack",
|
|
25
26
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
26
27
|
"test-e2e": "npx playwright test",
|
|
27
|
-
"format": "eslint --fix \"src/**/*.{ts,js}\" \"integration-tests/**/*.{ts,js}\""
|
|
28
|
-
"generate-msdf": "node msdf/generate-msdf.js"
|
|
28
|
+
"format": "eslint --fix \"src/**/*.{ts,js}\" \"integration-tests/**/*.{ts,js}\""
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@eslint/eslintrc": "^3.3.1",
|
|
32
32
|
"@eslint/js": "^9.21.0",
|
|
33
|
-
"@playwright/test": "^1.
|
|
33
|
+
"@playwright/test": "^1.59.0",
|
|
34
34
|
"@stylistic/eslint-plugin-js": "^4.2.0",
|
|
35
35
|
"@tsconfig/recommended": "^1.0.8",
|
|
36
|
+
"@types/fontkit": "^2.0.8",
|
|
36
37
|
"@types/jest": "^29.5.14",
|
|
37
38
|
"@types/node": "^22.13.9",
|
|
38
|
-
"@
|
|
39
|
+
"@types/opentype.js": "^1.3.8",
|
|
40
|
+
"@types/paper": "^0.11.14",
|
|
41
|
+
"@types/svg-parser": "^2.0.6",
|
|
42
|
+
"@types/wawoff2": "^1.0.2",
|
|
43
|
+
"@webgpu/types": "^0.1.65",
|
|
39
44
|
"eslint": "^9.28.0",
|
|
40
45
|
"html-webpack-plugin": "^5.6.3",
|
|
46
|
+
"http-server": "^14.1.1",
|
|
41
47
|
"jest": "^29.7.0",
|
|
42
48
|
"jest-environment-jsdom": "^29.7.0",
|
|
43
|
-
"
|
|
44
|
-
"semantic-release": "^24.2.3",
|
|
45
|
-
"svg2ttf": "^6.0.3",
|
|
46
|
-
"svgicons2svgfont": "^15.0.1",
|
|
49
|
+
"semantic-release": "^25.0.3",
|
|
47
50
|
"ts-jest": "^29.2.6",
|
|
48
51
|
"ts-loader": "^9.5.2",
|
|
49
52
|
"ts-node": "^10.9.2",
|
|
@@ -53,10 +56,21 @@
|
|
|
53
56
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
54
57
|
"webpack-cli": "^6.0.1",
|
|
55
58
|
"webpack-dev-server": "^5.2.0",
|
|
56
|
-
"zigar-loader": "^0.14.
|
|
59
|
+
"zigar-loader": "^0.14.1"
|
|
60
|
+
},
|
|
61
|
+
"exports": {
|
|
62
|
+
"./package.json": "./package.json",
|
|
63
|
+
".": {
|
|
64
|
+
"types": "./lib/types/index.d.ts",
|
|
65
|
+
"import": "./lib/index.mjs",
|
|
66
|
+
"require": "./lib/index.mjs"
|
|
67
|
+
},
|
|
68
|
+
"./types": {
|
|
69
|
+
"types": "./lib/types/types.d.ts",
|
|
70
|
+
"import": "./lib/types.mjs",
|
|
71
|
+
"require": "./lib/types.mjs"
|
|
72
|
+
}
|
|
57
73
|
},
|
|
58
|
-
"types": "./lib/types/index.d.ts",
|
|
59
|
-
"main": "./lib/index.mjs",
|
|
60
74
|
"type": "module",
|
|
61
75
|
"repository": {
|
|
62
76
|
"type": "git",
|
|
@@ -69,5 +83,10 @@
|
|
|
69
83
|
"homepage": "https://github.com/mateuszJS/magic-render#readme",
|
|
70
84
|
"files": [
|
|
71
85
|
"lib/**/*"
|
|
72
|
-
]
|
|
86
|
+
],
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"opentype.js": "^1.3.4",
|
|
89
|
+
"paper": "^0.12.18",
|
|
90
|
+
"svg-parser": "^2.0.4"
|
|
91
|
+
}
|
|
73
92
|
}
|
package/lib/e9072ac5eb734c67.png
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canvasSizeObserver.d.ts","sourceRoot":"","sources":["../../../../src/WebGPU/canvasSizeObserver.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,YAAY,QAgBvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDevice.d.ts","sourceRoot":"","sources":["../../../../src/WebGPU/getDevice.ts"],"names":[],"mappings":"AAAA,wBAA8B,SAAS,uBAuBtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createCheckedImageData.d.ts","sourceRoot":"","sources":["../../../../../src/WebGPU/getTexture/createCheckedImageData.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAwBrF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateMimapsArray.d.ts","sourceRoot":"","sources":["../../../../../src/WebGPU/getTexture/generateMimapsArray.ts"],"names":[],"mappings":"AAIA,UAAU,cAAc;IACtB,cAAc,EAAE,oBAAoB,CAAC;IACrC,eAAe,EAAE,CAAC,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,UAAU,EACnB,cAAc,EAAE,cAAc,QAuH/B"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface Options {
|
|
2
|
-
mips?: boolean;
|
|
3
|
-
flipY?: boolean;
|
|
4
|
-
depthOrArrayLayers?: number;
|
|
5
|
-
}
|
|
6
|
-
type TextureSource = ImageBitmap | HTMLVideoElement | HTMLCanvasElement | HTMLImageElement | OffscreenCanvas;
|
|
7
|
-
export interface TextureSlice {
|
|
8
|
-
source: GPUCopyExternalImageSource;
|
|
9
|
-
fakeMipmaps: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function createTextureArray(device: GPUDevice, width: number, height: number, slices: number): GPUTexture;
|
|
12
|
-
export declare function attachSlice(device: GPUDevice, textue2dArray: GPUTexture, width: number, height: number, source: GPUCopyExternalImageSource, sliceIndex: number, options?: Options): void;
|
|
13
|
-
export declare function createTextureFromSource(device: GPUDevice, source: TextureSource, options?: Options): GPUTexture;
|
|
14
|
-
export declare function loadImageBitmap(url: string): Promise<ImageBitmap>;
|
|
15
|
-
export declare function createTextureFromImage(device: GPUDevice, url: string, options: Options): Promise<GPUTexture>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|