@number10/jsx-konva 5.0.0
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 +667 -0
- package/README.md +48 -0
- package/dist/appliers/konva-background.d.ts +14 -0
- package/dist/appliers/konva-background.d.ts.map +1 -0
- package/dist/appliers/konva-base.d.ts +10 -0
- package/dist/appliers/konva-base.d.ts.map +1 -0
- package/dist/appliers/konva-border-draw-context.d.ts +40 -0
- package/dist/appliers/konva-border-draw-context.d.ts.map +1 -0
- package/dist/appliers/konva-gesture.d.ts +21 -0
- package/dist/appliers/konva-gesture.d.ts.map +1 -0
- package/dist/appliers/konva-nineslice.d.ts +36 -0
- package/dist/appliers/konva-nineslice.d.ts.map +1 -0
- package/dist/appliers/konva-node.d.ts +66 -0
- package/dist/appliers/konva-node.d.ts.map +1 -0
- package/dist/appliers/konva-tooltip.d.ts +6 -0
- package/dist/appliers/konva-tooltip.d.ts.map +1 -0
- package/dist/appliers/konva-vector-draw.d.ts +11 -0
- package/dist/appliers/konva-vector-draw.d.ts.map +1 -0
- package/dist/index.cjs +8851 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8752 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-dev-runtime.cjs +9 -0
- package/dist/jsx-dev-runtime.d.ts +7 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +2 -0
- package/dist/jsx-runtime.cjs +21 -0
- package/dist/jsx-runtime.d.ts +7 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +2 -0
- package/dist/jsx-types.d.ts +12 -0
- package/dist/jsx-types.d.ts.map +1 -0
- package/dist/konva-debug-snapshot.d.ts +22 -0
- package/dist/konva-debug-snapshot.d.ts.map +1 -0
- package/dist/konva-effects-bridge.d.ts +2 -0
- package/dist/konva-effects-bridge.d.ts.map +1 -0
- package/dist/konva-gesture-manager.d.ts +65 -0
- package/dist/konva-gesture-manager.d.ts.map +1 -0
- package/dist/konva-host-adapter.d.ts +52 -0
- package/dist/konva-host-adapter.d.ts.map +1 -0
- package/dist/konva-layout-bridge.d.ts +8 -0
- package/dist/konva-layout-bridge.d.ts.map +1 -0
- package/dist/konva-scene-backgrounds.d.ts +57 -0
- package/dist/konva-scene-backgrounds.d.ts.map +1 -0
- package/dist/konva-scheduler.d.ts +18 -0
- package/dist/konva-scheduler.d.ts.map +1 -0
- package/dist/konva-surface-adapter.d.ts +29 -0
- package/dist/konva-surface-adapter.d.ts.map +1 -0
- package/dist/konva-vdom-runtime.d.ts +2 -0
- package/dist/konva-vdom-runtime.d.ts.map +1 -0
- package/dist/mount-konva.d.ts +21 -0
- package/dist/mount-konva.d.ts.map +1 -0
- package/dist/utils/konva-colors.d.ts +27 -0
- package/dist/utils/konva-colors.d.ts.map +1 -0
- package/dist/vector/KonvaVectorDrawContext.d.ts +51 -0
- package/dist/vector/KonvaVectorDrawContext.d.ts.map +1 -0
- package/dist/vector/index.d.ts +2 -0
- package/dist/vector/index.d.ts.map +1 -0
- package/package.json +97 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./index.cjs");
|
|
3
|
+
let _number10_jsx_core_jsx_dev_runtime = require("@number10/jsx-core/jsx-dev-runtime");
|
|
4
|
+
Object.defineProperty(exports, "jsxDEV", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return _number10_jsx_core_jsx_dev_runtime.jsxDEV;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./index.cjs");
|
|
3
|
+
let _number10_jsx_core_jsx_runtime = require("@number10/jsx-core/jsx-runtime");
|
|
4
|
+
Object.defineProperty(exports, "Fragment", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return _number10_jsx_core_jsx_runtime.Fragment;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(exports, "jsx", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return _number10_jsx_core_jsx_runtime.jsx;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "jsxs", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return _number10_jsx_core_jsx_runtime.jsxs;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSX intrinsic element declarations for @number10/jsx-konva.
|
|
3
|
+
* Register Konva-specific intrinsic elements here.
|
|
4
|
+
*/
|
|
5
|
+
declare global {
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=jsx-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-types.d.ts","sourceRoot":"","sources":["../src/jsx-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,GAAG,CAAC;QAEZ,UAAU,iBAAiB;SAE1B;KACF;CACF;AAED,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DebugSnapshot } from '@number10/jsx-components';
|
|
2
|
+
import { default as Konva } from 'konva';
|
|
3
|
+
/**
|
|
4
|
+
* Collect a one-shot Konva debug snapshot.
|
|
5
|
+
* Can be called directly (no hook needed).
|
|
6
|
+
*
|
|
7
|
+
* @param mountStats - Mount statistics from the VDOM runtime.
|
|
8
|
+
* @param stage - Optional Konva Stage for viewport info.
|
|
9
|
+
*/
|
|
10
|
+
export declare function collectKonvaSnapshot(stage?: Konva.Stage): DebugSnapshot;
|
|
11
|
+
/**
|
|
12
|
+
* Hook that collects Konva debug metrics on an interval and returns
|
|
13
|
+
* a {@link DebugSnapshot} suitable for the portable {@link DebugPanel}.
|
|
14
|
+
*
|
|
15
|
+
* Uses requestAnimationFrame for FPS estimation and the portable
|
|
16
|
+
* {@link getMountStats} from the Konva VDOM runtime for mount statistics.
|
|
17
|
+
*
|
|
18
|
+
* @param intervalMs - Refresh interval in milliseconds (default: 250)
|
|
19
|
+
* @returns Current debug snapshot, refreshed on the given interval
|
|
20
|
+
*/
|
|
21
|
+
export declare function useKonvaDebugSnapshot(intervalMs?: number): DebugSnapshot;
|
|
22
|
+
//# sourceMappingURL=konva-debug-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-debug-snapshot.d.ts","sourceRoot":"","sources":["../src/konva-debug-snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAG7D,OAAO,KAAK,MAAM,OAAO,CAAA;AAmDzB;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,GAAG,aAAa,CAqBvE;AAMD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,SAAM,GAAG,aAAa,CAerE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-effects-bridge.d.ts","sourceRoot":"","sources":["../src/konva-effects-bridge.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { GestureProps } from '@number10/jsx-core';
|
|
2
|
+
import { default as Konva } from 'konva';
|
|
3
|
+
export declare class KonvaGestureManager {
|
|
4
|
+
private entries;
|
|
5
|
+
private stage;
|
|
6
|
+
private isListening;
|
|
7
|
+
private lastMoveX;
|
|
8
|
+
private lastMoveY;
|
|
9
|
+
private activeMoveEntry;
|
|
10
|
+
private readonly onWheelDomEvent;
|
|
11
|
+
constructor(stage: Konva.Stage);
|
|
12
|
+
private getLayoutBox;
|
|
13
|
+
private isPointInRect;
|
|
14
|
+
private resolveContainerWorldRect;
|
|
15
|
+
private resolveLayoutWorldRect;
|
|
16
|
+
private resolveClipRect;
|
|
17
|
+
private intersectRects;
|
|
18
|
+
private resolveWorldHitArea;
|
|
19
|
+
private getPointerPos;
|
|
20
|
+
private resolveLocalPoint;
|
|
21
|
+
private resolveEntryMetrics;
|
|
22
|
+
private containsPoint;
|
|
23
|
+
registerContainer(group: Konva.Group, props: GestureProps<Konva.KonvaEventObject<PointerEvent>>): void;
|
|
24
|
+
hasContainer(group: Konva.Group): boolean;
|
|
25
|
+
unregisterContainer(group: Konva.Group): void;
|
|
26
|
+
/**
|
|
27
|
+
* Unregister all gesture entries for groups that are descendants of a
|
|
28
|
+
* given container. Used when destroying a surface/layer to prevent stale
|
|
29
|
+
* entries from intercepting events after the nodes are gone.
|
|
30
|
+
* @param container - Parent Konva node whose descendants should be cleaned up
|
|
31
|
+
*/
|
|
32
|
+
unregisterDescendantsOf(container: Konva.Group | Konva.Layer): void;
|
|
33
|
+
/**
|
|
34
|
+
* Check if a node is a descendant of a given container.
|
|
35
|
+
*/
|
|
36
|
+
private isDescendantOf;
|
|
37
|
+
updateContainer(group: Konva.Group, props: GestureProps<Konva.KonvaEventObject<PointerEvent>>): void;
|
|
38
|
+
updateHitArea(group: Konva.Group): void;
|
|
39
|
+
private ensureListening;
|
|
40
|
+
private stopListening;
|
|
41
|
+
private onPointerDown;
|
|
42
|
+
private onPointerMove;
|
|
43
|
+
private onPointerUp;
|
|
44
|
+
/**
|
|
45
|
+
* Document-level pointerup — fires for releases outside the stage.
|
|
46
|
+
* Only calls handlePointerUp when there was an active pointer down
|
|
47
|
+
* (but the stage's own pointerup didn't fire because the release
|
|
48
|
+
* happened outside the stage). The handlePointerUp method already
|
|
49
|
+
* correctly handles onTouchOutside for entries not in the hit list.
|
|
50
|
+
*/
|
|
51
|
+
private onDocumentPointerUp;
|
|
52
|
+
private onWheel;
|
|
53
|
+
private handlePointerUp;
|
|
54
|
+
private hitTest;
|
|
55
|
+
private getSurfaceZIndex;
|
|
56
|
+
private compareDisplayOrder;
|
|
57
|
+
private isGroupVisible;
|
|
58
|
+
private createEventData;
|
|
59
|
+
private createWheelEventData;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get or create the KonvaGestureManager singleton for a given stage.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getKonvaGestureManager(stage: Konva.Stage): KonvaGestureManager;
|
|
65
|
+
//# sourceMappingURL=konva-gesture-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-gesture-manager.d.ts","sourceRoot":"","sources":["../src/konva-gesture-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAEV,YAAY,EAGb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAA;AAwCzB,qBA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BrB,OAAO,CAAC,aAAa,CAgDpB;IAED,OAAO,CAAC,aAAa,CA0BpB;IAED,OAAO,CAAC,WAAW,CAKlB;IAED;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB,CAS1B;IAED,OAAO,CAAC,OAAO,CA2Bd;IAED,OAAO,CAAC,eAAe;IA8EvB,OAAO,CAAC,OAAO;IAoBf,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,mBAAmB;IAyC3B,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,eAAe;IAgCvB,OAAO,CAAC,oBAAoB;CAsC7B;AAQD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,mBAAmB,CAO9E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AtlasFrameInfo, FrameRect, HostAdapter, HostContext, HostNode, HostParent, NodeType, Props, Size, SurfaceContext, TextureResolver } from '@number10/jsx-core';
|
|
2
|
+
export declare class KonvaHostAdapter implements HostAdapter {
|
|
3
|
+
create(type: NodeType, props: Props, ctx: HostContext): HostNode;
|
|
4
|
+
patch(type: NodeType, node: HostNode, prev: Props, next: Props, ctx: HostContext): void;
|
|
5
|
+
append(parent: HostParent, child: HostNode, _ctx: HostContext): void;
|
|
6
|
+
insertBefore(parent: HostParent, child: HostNode, before: HostNode | null, _ctx: HostContext): void;
|
|
7
|
+
remove(_parent: HostParent, child: HostNode, _ctx: HostContext): void;
|
|
8
|
+
getChildren(parent: HostParent): readonly HostNode[];
|
|
9
|
+
isAlive(target: HostNode | HostParent): boolean;
|
|
10
|
+
setPosition(node: HostNode, x: number, y: number): void;
|
|
11
|
+
setSize(node: HostNode, width: number, height: number): void;
|
|
12
|
+
setDepth(node: HostNode, depth: number): void;
|
|
13
|
+
setVisible(node: HostNode, visible: boolean): void;
|
|
14
|
+
setAlpha(node: HostNode, alpha: number): void;
|
|
15
|
+
getSurfaceContext(target: HostNode | HostParent): SurfaceContext;
|
|
16
|
+
/**
|
|
17
|
+
* Get the Konva Stage from a node's surface context.
|
|
18
|
+
*/
|
|
19
|
+
private getKonvaStage;
|
|
20
|
+
}
|
|
21
|
+
type KonvaTextureSource = HTMLCanvasElement | HTMLImageElement;
|
|
22
|
+
interface KonvaTextureEntry {
|
|
23
|
+
source: KonvaTextureSource;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
}
|
|
27
|
+
export declare const konvaTextureCache: Map<string, KonvaTextureEntry>;
|
|
28
|
+
export declare function resolveKonvaRegion(key: string, frame?: string, sourceRect?: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
w: number;
|
|
32
|
+
h: number;
|
|
33
|
+
}): FrameRect | undefined;
|
|
34
|
+
export declare function resolveKonvaImage(key: string, frame?: string, sourceRect?: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
w: number;
|
|
38
|
+
h: number;
|
|
39
|
+
}, tint?: number): KonvaTextureEntry | undefined;
|
|
40
|
+
declare class KonvaTextureResolver implements TextureResolver {
|
|
41
|
+
load(key: string, url: string): Promise<void>;
|
|
42
|
+
loadAtlas(key: string, imageUrl: string, dataUrl: string): Promise<void>;
|
|
43
|
+
loadSVG(key: string, svg: string, width: number, height: number): Promise<void>;
|
|
44
|
+
isLoaded(key: string): boolean;
|
|
45
|
+
getFrameNames(key: string): string[];
|
|
46
|
+
getFrameRect(key: string, frame: string): FrameRect | undefined;
|
|
47
|
+
getFrameInfo(key: string, frame: string): AtlasFrameInfo | undefined;
|
|
48
|
+
getTextureSize(key: string): Size | undefined;
|
|
49
|
+
}
|
|
50
|
+
declare const konvaTextureResolver: KonvaTextureResolver;
|
|
51
|
+
export { konvaTextureResolver };
|
|
52
|
+
//# sourceMappingURL=konva-host-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-host-adapter.d.ts","sourceRoot":"","sources":["../src/konva-host-adapter.ts"],"names":[],"mappings":"AA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AC;IA2BxE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCrF,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI9B,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAIpC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI/D,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAcpE,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;CAK9C;AAED,QAAA,MAAM,oBAAoB,sBAA6B,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Konva layout bridge — wires renderer-specific callbacks into the core layout engine.
|
|
3
|
+
*
|
|
4
|
+
* Must be imported before any layout operations (usually in the package index).
|
|
5
|
+
* Mirrors @number10/jsx-pixi's pixi-layout-bridge.ts.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=konva-layout-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-layout-bridge.d.ts","sourceRoot":"","sources":["../src/konva-layout-bridge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as Konva } from 'konva';
|
|
2
|
+
/** Built-in decorative background variants. */
|
|
3
|
+
export type SceneBackgroundType = 'grid' | 'logo' | 'gradient' | 'particles' | 'none';
|
|
4
|
+
/** Optional animation applied to a scene background after it is created. */
|
|
5
|
+
export type BackgroundAnimation = 'lemniscate' | 'wave' | 'pulse' | 'rotate' | 'static';
|
|
6
|
+
/** Configuration for {@link addKonvaSceneBackground}. */
|
|
7
|
+
export interface BackgroundConfig {
|
|
8
|
+
/** Background variant to create. Use `'none'` to disable background creation. */
|
|
9
|
+
type: SceneBackgroundType;
|
|
10
|
+
/** Animation preset applied to the created background. */
|
|
11
|
+
animation?: BackgroundAnimation;
|
|
12
|
+
/** Background opacity, usually between `0` and `1`. */
|
|
13
|
+
opacity?: number;
|
|
14
|
+
/** Primary color as a numeric color, for example `0x4a9eff`. */
|
|
15
|
+
color?: number;
|
|
16
|
+
/** Secondary color used by gradient backgrounds. */
|
|
17
|
+
colorSecondary?: number;
|
|
18
|
+
/** zIndex for the background layer. Default -1 (behind VDOM). */
|
|
19
|
+
zIndex?: number;
|
|
20
|
+
}
|
|
21
|
+
/** Handle returned by {@link addKonvaSceneBackground}. */
|
|
22
|
+
export interface SceneBackgroundHandle {
|
|
23
|
+
/** Root layer for the background. */
|
|
24
|
+
layer: Konva.Layer;
|
|
25
|
+
/** Stops animations, destroys display objects, removes from stage. */
|
|
26
|
+
destroy: () => void;
|
|
27
|
+
/** Manually resize the background to match a viewport size. */
|
|
28
|
+
resize: (width: number, height: number) => void;
|
|
29
|
+
}
|
|
30
|
+
/** Default scene background used when no explicit config is provided. */
|
|
31
|
+
export declare const DEFAULT_BACKGROUND: BackgroundConfig;
|
|
32
|
+
/**
|
|
33
|
+
* Adds a decorative background layer to a Konva Stage.
|
|
34
|
+
*
|
|
35
|
+
* The background is added to its own layer at a configurable zIndex.
|
|
36
|
+
* All display objects and animations are owned by this helper and
|
|
37
|
+
* cleaned up on `destroy()`.
|
|
38
|
+
*
|
|
39
|
+
* @param stage - Konva.Stage that receives the background.
|
|
40
|
+
* @param config - Background type, colors, opacity, and animation.
|
|
41
|
+
* @returns A handle for manual resize and cleanup, or `null` when `config.type` is `'none'`.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const handle = addKonvaSceneBackground(stage, {
|
|
46
|
+
* type: 'grid',
|
|
47
|
+
* animation: 'wave',
|
|
48
|
+
* color: 0x4a9eff,
|
|
49
|
+
* opacity: 0.12,
|
|
50
|
+
* })
|
|
51
|
+
*
|
|
52
|
+
* // Later, if the background should be removed:
|
|
53
|
+
* handle?.destroy()
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function addKonvaSceneBackground(stage: Konva.Stage, config?: BackgroundConfig): SceneBackgroundHandle | null;
|
|
57
|
+
//# sourceMappingURL=konva-scene-backgrounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-scene-backgrounds.d.ts","sourceRoot":"","sources":["../src/konva-scene-backgrounds.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,+CAA+C;AAC/C,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAAA;AAErF,4EAA4E;AAC5E,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEvF,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,IAAI,EAAE,mBAAmB,CAAA;IAEzB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAE/B,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,0DAA0D;AAC1D,MAAM,WAAW,qBAAqB;IACpC,qCAAqC;IACrC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAA;IAElB,sEAAsE;IACtE,OAAO,EAAE,MAAM,IAAI,CAAA;IAEnB,+DAA+D;IAC/D,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAChD;AAMD,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,EAAE,gBAKhC,CAAA;AAkQD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,MAAM,GAAE,gBAAqC,GAC5C,qBAAqB,GAAG,IAAI,CA+H9B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Konva scheduler — provides frame/timer callbacks for the VDOM runtime.
|
|
3
|
+
*/
|
|
4
|
+
export declare function createKonvaScheduler(): {
|
|
5
|
+
requestAnimationFrame(callback: (dt: number) => void): {
|
|
6
|
+
cancel: () => void;
|
|
7
|
+
};
|
|
8
|
+
onFrame(callback: (dt: number) => void): {
|
|
9
|
+
cancel: () => void;
|
|
10
|
+
};
|
|
11
|
+
setTimeout(callback: () => void, delay: number): {
|
|
12
|
+
cancel: () => void;
|
|
13
|
+
};
|
|
14
|
+
setInterval(callback: () => void, interval: number): {
|
|
15
|
+
cancel: () => void;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=konva-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-scheduler.d.ts","sourceRoot":"","sources":["../src/konva-scheduler.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,oBAAoB;oCAYA,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;;;sBAQlC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;;;yBAkBjB,MAAM,IAAI,SAAS,MAAM;;;0BAIxB,MAAM,IAAI,YAAY,MAAM;;;EAKrD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CreateRootSurfaceOptions, RootSurface, SurfaceAdapter, SurfaceTarget, UpdateRootSurfaceOptions, VDOMOperations } from '@number10/jsx-core';
|
|
2
|
+
export declare class KonvaSurfaceAdapter implements SurfaceAdapter {
|
|
3
|
+
/** Map of surface id → root surface for lookup */
|
|
4
|
+
private roots;
|
|
5
|
+
/** Renderer-bound VDOM operations — set by the runtime after construction */
|
|
6
|
+
private vdom;
|
|
7
|
+
/**
|
|
8
|
+
* Set the renderer's VDOM operations.
|
|
9
|
+
* Called by the Konva VDOM runtime after construction to avoid circular imports.
|
|
10
|
+
*/
|
|
11
|
+
setVDOM(ops: VDOMOperations): void;
|
|
12
|
+
/**
|
|
13
|
+
* Position a layer within its stage sorted by __surfaceZIndex.
|
|
14
|
+
* Konva's zIndex() is the index in the parent's children array and rejects
|
|
15
|
+
* values >= children.length. This method finds the correct sorted position
|
|
16
|
+
* among all sibling layers so higher zIndex → rendered on top, without
|
|
17
|
+
* exceeding valid array bounds.
|
|
18
|
+
* @param layer - Layer to reposition
|
|
19
|
+
* @param stage - Stage containing the layer
|
|
20
|
+
*/
|
|
21
|
+
private positionLayerByZIndex;
|
|
22
|
+
createRoot(options: CreateRootSurfaceOptions): RootSurface;
|
|
23
|
+
updateRoot(surface: RootSurface, options: UpdateRootSurfaceOptions): void;
|
|
24
|
+
destroyRoot(surface: RootSurface): void;
|
|
25
|
+
isAlive(surface: RootSurface): boolean;
|
|
26
|
+
getRootByTarget(target: SurfaceTarget): RootSurface | undefined;
|
|
27
|
+
syncPortalEventBlocking(surface: RootSurface, blockEvents: boolean): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=konva-surface-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-surface-adapter.d.ts","sourceRoot":"","sources":["../src/konva-surface-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,wBAAwB,EAGxB,WAAW,EACX,cAAc,EAEd,aAAa,EACb,wBAAwB,EACxB,cAAc,EACf,MAAM,oBAAoB,CAAA;AAwB3B,qBAAa,mBAAoB,YAAW,cAAc;IACxD,kDAAkD;IAClD,OAAO,CAAC,KAAK,CAAsC;IAEnD,6EAA6E;IAC7E,OAAO,CAAC,IAAI,CAA4B;IAExC;;;OAGG;IACH,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAIlC;;;;;;;;OAQG;IACH,OAAO,CAAC,qBAAqB;IAsB7B,UAAU,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW;IA0E1D,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,wBAAwB,GAAG,IAAI;IAkBzE,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAkBvC,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAKtC,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,GAAG,SAAS;IAU/D,uBAAuB,CAAC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI;CAuE1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-vdom-runtime.d.ts","sourceRoot":"","sources":["../src/konva-vdom-runtime.ts"],"names":[],"mappings":"AAqEA,eAAO,MAAM,gBAAgB,0CA+E5B,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VNodeLike } from '@number10/jsx-core';
|
|
2
|
+
type InferComponentProps<C> = C extends (props: infer P) => VNodeLike ? P : never;
|
|
3
|
+
interface MountKonvaJSXBaseOptions {
|
|
4
|
+
target: HTMLElement;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface MountKonvaJSXOptions<P = Record<string, unknown>> {
|
|
9
|
+
component: (props: P) => VNodeLike;
|
|
10
|
+
target: MountKonvaJSXBaseOptions['target'];
|
|
11
|
+
width?: MountKonvaJSXBaseOptions['width'];
|
|
12
|
+
height?: MountKonvaJSXBaseOptions['height'];
|
|
13
|
+
/** Custom props passed to the component (merged with viewport dimensions) */
|
|
14
|
+
props?: P;
|
|
15
|
+
}
|
|
16
|
+
export declare function mountKonvaJSX<C extends (props: never) => VNodeLike>(options: MountKonvaJSXBaseOptions & {
|
|
17
|
+
component: C;
|
|
18
|
+
props?: InferComponentProps<C>;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=mount-konva.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount-konva.d.ts","sourceRoot":"","sources":["../src/mount-konva.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAInD,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,SAAS,GAAG,CAAC,GAAG,KAAK,CAAA;AAEjF,UAAU,wBAAwB;IAChC,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/D,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAA;IAClC,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAA;IAC1C,KAAK,CAAC,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAA;IAC3C,6EAA6E;IAC7E,KAAK,CAAC,EAAE,CAAC,CAAA;CACV;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,EACjE,OAAO,EAAE,wBAAwB,GAAG;IAClC,SAAS,EAAE,CAAC,CAAA;IACZ,KAAK,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;CAC/B,GACA,OAAO,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color utilities for Konva — converts between color formats.
|
|
3
|
+
* Konva expects hex strings (e.g. "#1a1a1a") while the PhaserJSX theme
|
|
4
|
+
* system uses numbers (e.g. 0x1a1a1a).
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Convert a color value to a Konva-compatible string.
|
|
8
|
+
* Accepts numbers (0x1a1a1a), hex strings ("#1a1a1a"), or rgba strings.
|
|
9
|
+
* Returns undefined for invalid/unrecognised values.
|
|
10
|
+
*/
|
|
11
|
+
export declare function toKonvaColor(color: unknown): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Convert a color value with optional alpha to a Konva-compatible string.
|
|
14
|
+
* Encodes alpha directly into the color (rgba) instead of relying on
|
|
15
|
+
* the node's opacity property. This allows fill and border to have
|
|
16
|
+
* independent alpha values.
|
|
17
|
+
*
|
|
18
|
+
* @param color - Color value (number 0xRRGGBB or string)
|
|
19
|
+
* @param alpha - Alpha value (0-1, defaults to 1)
|
|
20
|
+
*/
|
|
21
|
+
export declare function toKonvaColorWithAlpha(color: unknown, alpha?: number): string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Parse a font-size value to a number.
|
|
24
|
+
* Accepts numbers (16) and strings with units ("16px").
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseFontSize(value: unknown): number | undefined;
|
|
27
|
+
//# sourceMappingURL=konva-colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"konva-colors.d.ts","sourceRoot":"","sources":["../../src/utils/konva-colors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAiB/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA4BxF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAShE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { VectorDrawContext } from '@number10/jsx-core';
|
|
2
|
+
import { default as Konva } from 'konva';
|
|
3
|
+
export declare class KonvaVectorDrawContext implements VectorDrawContext {
|
|
4
|
+
readonly konvaImage: Konva.Image;
|
|
5
|
+
private static readonly AUTO_BOUNDS_CANVAS_SIZE;
|
|
6
|
+
private fill;
|
|
7
|
+
private stroke;
|
|
8
|
+
private canvas;
|
|
9
|
+
private ctx;
|
|
10
|
+
private deferFlush;
|
|
11
|
+
private autoBoundsOrigin;
|
|
12
|
+
constructor(konvaImage: Konva.Image, width: number, height: number);
|
|
13
|
+
resize(width: number, height: number): void;
|
|
14
|
+
prepareDraw(options?: {
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
autoBounds?: boolean;
|
|
18
|
+
}): void;
|
|
19
|
+
finishDraw(options?: {
|
|
20
|
+
autoBounds?: boolean;
|
|
21
|
+
}): void;
|
|
22
|
+
/** Convert a number color (0xRRGGBB) to a CSS string. */
|
|
23
|
+
private toColor;
|
|
24
|
+
/** Ensure the canvas bitmap is pushed to Konva's texture cache. */
|
|
25
|
+
private flush;
|
|
26
|
+
private finishAutoBoundsDraw;
|
|
27
|
+
clear(): this;
|
|
28
|
+
fillStyle(color: number, alpha?: number): this;
|
|
29
|
+
lineStyle(width: number, color: number, alpha?: number): this;
|
|
30
|
+
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): this;
|
|
31
|
+
fillCircle(x: number, y: number, radius: number): this;
|
|
32
|
+
strokeCircle(x: number, y: number, radius: number): this;
|
|
33
|
+
fillRect(x: number, y: number, width: number, height: number): this;
|
|
34
|
+
strokeRect(x: number, y: number, width: number, height: number): this;
|
|
35
|
+
fillRoundedRect(x: number, y: number, width: number, height: number, radius: number): this;
|
|
36
|
+
strokeRoundedRect(x: number, y: number, width: number, height: number, radius: number): this;
|
|
37
|
+
private roundRect;
|
|
38
|
+
beginPath(): this;
|
|
39
|
+
moveTo(x: number, y: number): this;
|
|
40
|
+
lineTo(x: number, y: number): this;
|
|
41
|
+
closePath(): this;
|
|
42
|
+
fillPath(): this;
|
|
43
|
+
strokePath(): this;
|
|
44
|
+
lineBetween(x1: number, y1: number, x2: number, y2: number): this;
|
|
45
|
+
setShadow(color: number, blur: number, offsetX: number, offsetY: number): this;
|
|
46
|
+
resetShadow(): this;
|
|
47
|
+
fillCircleStyled(x: number, y: number, radius: number, color: number, alpha: number): this;
|
|
48
|
+
strokeLine(x1: number, y1: number, x2: number, y2: number, width: number, color: number, alpha: number): this;
|
|
49
|
+
fillArc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, color: number, alpha: number): this;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=KonvaVectorDrawContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KonvaVectorDrawContext.d.ts","sourceRoot":"","sources":["../../src/vector/KonvaVectorDrawContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,qBAAa,sBAAuB,YAAW,iBAAiB;IAU5D,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK;IATlC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAO;IACtD,OAAO,CAAC,IAAI,CAA4C;IACxD,OAAO,CAAC,MAAM,CAAwD;IACtE,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,GAAG,CAA0B;IACrC,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,gBAAgB,CAAi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EAAE,MAAM,GACZ,IAAI;IAWP,OAAO,CACL,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,CAAC,EAAE,MAAM,EACT,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,IAAI;CAUR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@number10/jsx-konva",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Konva renderer adapter for @number10/jsx-core — full VDOM runtime, gestures, effects, backgrounds",
|
|
6
|
+
"author": "Michael Rieck (Michael--) <mr@number10.de>",
|
|
7
|
+
"license": "GPL-3.0-only",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"konva",
|
|
10
|
+
"konvajs",
|
|
11
|
+
"konva-js",
|
|
12
|
+
"canvas",
|
|
13
|
+
"canvas-2d",
|
|
14
|
+
"html5-canvas",
|
|
15
|
+
"jsx",
|
|
16
|
+
"tsx",
|
|
17
|
+
"typescript",
|
|
18
|
+
"vdom",
|
|
19
|
+
"hooks",
|
|
20
|
+
"components",
|
|
21
|
+
"renderer",
|
|
22
|
+
"game-development",
|
|
23
|
+
"game-ui",
|
|
24
|
+
"game-ui-framework",
|
|
25
|
+
"declarative",
|
|
26
|
+
"react-like",
|
|
27
|
+
"ui",
|
|
28
|
+
"ui-framework",
|
|
29
|
+
"diagram-editor",
|
|
30
|
+
"drawing-app"
|
|
31
|
+
],
|
|
32
|
+
"main": "./dist/index.cjs",
|
|
33
|
+
"module": "./dist/index.js",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"source": "./src/index.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"import": "./dist/index.js",
|
|
40
|
+
"require": "./dist/index.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./jsx-runtime": {
|
|
43
|
+
"types": "./dist/jsx-runtime.d.ts",
|
|
44
|
+
"source": "./src/jsx-runtime.ts",
|
|
45
|
+
"import": "./dist/jsx-runtime.js",
|
|
46
|
+
"require": "./dist/jsx-runtime.cjs"
|
|
47
|
+
},
|
|
48
|
+
"./jsx-dev-runtime": {
|
|
49
|
+
"types": "./dist/jsx-dev-runtime.d.ts",
|
|
50
|
+
"source": "./src/jsx-dev-runtime.ts",
|
|
51
|
+
"import": "./dist/jsx-dev-runtime.js",
|
|
52
|
+
"require": "./dist/jsx-dev-runtime.cjs"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"files": [
|
|
56
|
+
"dist",
|
|
57
|
+
"README.md"
|
|
58
|
+
],
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "git",
|
|
64
|
+
"url": "https://github.com/Michael--/phaserjsx",
|
|
65
|
+
"directory": "packages/konva"
|
|
66
|
+
},
|
|
67
|
+
"homepage": "https://phaserjsx.number10.de/",
|
|
68
|
+
"bugs": {
|
|
69
|
+
"url": "https://github.com/Michael--/phaserjsx/issues"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@preact/signals-core": "^1.14.2",
|
|
73
|
+
"@number10/jsx-components": "5.0.0",
|
|
74
|
+
"@number10/jsx-core": "5.0.0"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"konva": "^10.3.0"
|
|
78
|
+
},
|
|
79
|
+
"peerDependenciesMeta": {
|
|
80
|
+
"konva": {
|
|
81
|
+
"optional": false
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"konva": "^10.3.0",
|
|
86
|
+
"typescript": "^6.0.3",
|
|
87
|
+
"vite": "^8.0.13",
|
|
88
|
+
"vite-plugin-dts": "^5.0.2",
|
|
89
|
+
"vitest": "^4.1.6"
|
|
90
|
+
},
|
|
91
|
+
"scripts": {
|
|
92
|
+
"build": "vite build",
|
|
93
|
+
"typecheck": "tsc --noEmit",
|
|
94
|
+
"test": "vitest run",
|
|
95
|
+
"lint": "eslint src/"
|
|
96
|
+
}
|
|
97
|
+
}
|