canvasengine 2.0.0-beta.1 → 2.0.0-beta.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/dist/index.d.ts +94 -19
- package/dist/index.js +89 -478
- package/dist/index.js.map +1 -1
- package/package.json +9 -53
- package/src/components/index.ts +2 -3
- package/src/components/types/DisplayObject.ts +1 -0
- package/src/directives/KeyboardControls.ts +1 -1
- package/src/directives/Scheduler.ts +0 -11
- package/src/index.ts +4 -4
- package/.cursorrules +0 -0
- package/README.md +0 -71
- package/dist/compiler/vite.js +0 -119
- package/dist/compiler/vite.js.map +0 -1
- package/logo.png +0 -0
- package/src/compiler/grammar.pegjs +0 -180
- package/src/compiler/vite.ts +0 -166
- package/src/components/DrawMap/index.ts +0 -65
- package/src/components/Tilemap/Tile.ts +0 -79
- package/src/components/Tilemap/TileGroup.ts +0 -207
- package/src/components/Tilemap/TileLayer.ts +0 -163
- package/src/components/Tilemap/TileSet.ts +0 -41
- package/src/components/Tilemap/index.ts +0 -80
- package/src/presets/Bar.ts +0 -89
- package/src/presets/Button.ts +0 -0
- package/src/presets/Joystick.ts +0 -286
- package/src/presets/NightAmbiant.ts +0 -122
- package/src/presets/Particle.ts +0 -53
- package/starter/assets/logo.png +0 -0
- package/starter/components/app.ce +0 -18
- package/starter/components/hello.ce +0 -34
- package/starter/index.html +0 -21
- package/starter/main.ts +0 -4
- package/starter/package.json +0 -16
- package/starter/vite.config.ts +0 -12
- package/tsconfig.json +0 -32
- package/tsconfig.node.json +0 -10
- package/tsup.config.ts +0 -28
- package/vitest.config.ts +0 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import * as _signe_reactive from '@signe/reactive';
|
|
1
2
|
import { WritableSignal, Signal, WritableArraySignal } from '@signe/reactive';
|
|
2
3
|
export * from '@signe/reactive';
|
|
3
4
|
import { Subscription, Subject, Observable } from 'rxjs';
|
|
4
|
-
export {
|
|
5
|
+
export { isObservable } from 'rxjs';
|
|
6
|
+
import { Node } from 'yoga-layout';
|
|
5
7
|
import * as PIXI from 'pixi.js';
|
|
6
|
-
import { Graphics as Graphics$1, TextStyle, Texture } from 'pixi.js';
|
|
8
|
+
import { ObservablePoint, Graphics as Graphics$1, TextStyle, Texture, Matrix } from 'pixi.js';
|
|
9
|
+
export { Howler } from 'howler';
|
|
7
10
|
import * as popmotion from 'popmotion';
|
|
8
11
|
|
|
9
12
|
interface AnimateOptions<T> {
|
|
@@ -47,6 +50,7 @@ type SignalOrPrimitive<T> = T | Signal<T> | AnimatedSignal<T>;
|
|
|
47
50
|
|
|
48
51
|
type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
49
52
|
type JustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';
|
|
53
|
+
type AlignContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';
|
|
50
54
|
type Size = number | `${number}%`;
|
|
51
55
|
type EdgeSize = SignalOrPrimitive<Size | [Size, Size] | [Size, Size, Size, Size]>;
|
|
52
56
|
interface DisplayObjectProps {
|
|
@@ -88,6 +92,7 @@ interface DisplayObjectProps {
|
|
|
88
92
|
}>;
|
|
89
93
|
filters?: any[];
|
|
90
94
|
blendMode?: SignalOrPrimitive<PIXI.BLEND_MODES>;
|
|
95
|
+
blur?: SignalOrPrimitive<number>;
|
|
91
96
|
click?: PIXI.FederatedEventHandler;
|
|
92
97
|
mousedown?: PIXI.FederatedEventHandler;
|
|
93
98
|
mouseenter?: PIXI.FederatedEventHandler;
|
|
@@ -130,6 +135,65 @@ interface ComponentInstance extends PixiMixins.ContainerOptions {
|
|
|
130
135
|
setWidth(width: number): void;
|
|
131
136
|
setHeight(height: number): void;
|
|
132
137
|
}
|
|
138
|
+
declare const EVENTS: string[];
|
|
139
|
+
declare function DisplayObject(extendClass: any): {
|
|
140
|
+
new (): {
|
|
141
|
+
[x: string]: any;
|
|
142
|
+
"__#1@#canvasContext": {
|
|
143
|
+
[key: string]: any;
|
|
144
|
+
} | null;
|
|
145
|
+
isFlex: boolean;
|
|
146
|
+
fullProps: Props;
|
|
147
|
+
isMounted: boolean;
|
|
148
|
+
_anchorPoints: ObservablePoint;
|
|
149
|
+
isCustomAnchor: boolean;
|
|
150
|
+
displayWidth: _signe_reactive.WritableSignal<number>;
|
|
151
|
+
displayHeight: _signe_reactive.WritableSignal<number>;
|
|
152
|
+
overrideProps: string[];
|
|
153
|
+
node: Node;
|
|
154
|
+
readonly yoga: any;
|
|
155
|
+
readonly deltaRatio: any;
|
|
156
|
+
onInit(props: any): void;
|
|
157
|
+
onMount({ parent, props }: Element</*elided*/ any>, index?: number): void;
|
|
158
|
+
effectSize(width: Size, height: Size): void;
|
|
159
|
+
"__#1@#applyFlexLayout"(): void;
|
|
160
|
+
"__#1@#flexRender"(props: any): void;
|
|
161
|
+
onUpdate(props: any): void;
|
|
162
|
+
onDestroy(): void;
|
|
163
|
+
getComputedLayout(): {
|
|
164
|
+
left: number;
|
|
165
|
+
right: number;
|
|
166
|
+
top: number;
|
|
167
|
+
bottom: number;
|
|
168
|
+
width: number;
|
|
169
|
+
height: number;
|
|
170
|
+
};
|
|
171
|
+
applyComputedLayout(): void;
|
|
172
|
+
calculateLayout(): void;
|
|
173
|
+
setFlexDirection(direction: FlexDirection): void;
|
|
174
|
+
setFlexWrap(wrap: "wrap" | "nowrap" | "wrap-reverse"): void;
|
|
175
|
+
"__#1@#setAlign"(methodName: string, align: AlignContent): void;
|
|
176
|
+
setAlignContent(align: AlignContent): void;
|
|
177
|
+
setAlignSelf(align: AlignContent): void;
|
|
178
|
+
setAlignItems(align: AlignContent): void;
|
|
179
|
+
setJustifyContent(justifyContent: "flex-start" | "flex-end" | "center" | "space-between" | "space-around"): void;
|
|
180
|
+
"__#1@#setEdgeSize"(methodName: string, size: EdgeSize): void;
|
|
181
|
+
setPosition(position: EdgeSize): void;
|
|
182
|
+
setX(x: number): void;
|
|
183
|
+
setY(y: number): void;
|
|
184
|
+
setPadding(padding: EdgeSize): void;
|
|
185
|
+
setMargin(margin: EdgeSize): void;
|
|
186
|
+
setGap(gap: EdgeSize): void;
|
|
187
|
+
setBorder(border: EdgeSize): void;
|
|
188
|
+
setPositionType(positionType: "relative" | "absolute"): void;
|
|
189
|
+
calculateBounds(): void;
|
|
190
|
+
setWidth(width: number): void;
|
|
191
|
+
setHeight(height: number): void;
|
|
192
|
+
getWidth(): number;
|
|
193
|
+
getHeight(): number;
|
|
194
|
+
};
|
|
195
|
+
[x: string]: any;
|
|
196
|
+
};
|
|
133
197
|
|
|
134
198
|
interface Props {
|
|
135
199
|
[key: string]: any;
|
|
@@ -704,8 +768,6 @@ interface TextProps extends DisplayObjectProps {
|
|
|
704
768
|
}
|
|
705
769
|
declare function Text(props: TextProps): Element<ComponentInstance>;
|
|
706
770
|
|
|
707
|
-
declare function TiledMap(props: any): any;
|
|
708
|
-
|
|
709
771
|
interface TilingSpriteProps extends DisplayObjectProps {
|
|
710
772
|
image?: string;
|
|
711
773
|
tileScale?: {
|
|
@@ -736,8 +798,6 @@ interface ViewportProps {
|
|
|
736
798
|
}
|
|
737
799
|
declare function Viewport(props: ViewportProps): Element<ComponentInstance>;
|
|
738
800
|
|
|
739
|
-
declare function ImageMap(props: any): Element<ComponentInstance> | Promise<Element<ComponentInstance>>;
|
|
740
|
-
|
|
741
801
|
interface NineSliceSpriteProps extends DisplayObjectProps {
|
|
742
802
|
image?: string;
|
|
743
803
|
texture?: Texture;
|
|
@@ -814,18 +874,6 @@ type PropSchema = {
|
|
|
814
874
|
*/
|
|
815
875
|
declare const useDefineProps: (props: any) => (schema?: PropSchema) => any;
|
|
816
876
|
|
|
817
|
-
interface BarProps {
|
|
818
|
-
backgroundColor?: string;
|
|
819
|
-
foregroundColor?: string;
|
|
820
|
-
value: number;
|
|
821
|
-
maxValue: number;
|
|
822
|
-
width: number;
|
|
823
|
-
height: number;
|
|
824
|
-
}
|
|
825
|
-
declare function Bar(opts: BarProps): Element<ComponentInstance>;
|
|
826
|
-
|
|
827
|
-
declare function Particle(options: any): Element<ComponentInstance> | Promise<Element<ComponentInstance>>;
|
|
828
|
-
|
|
829
877
|
declare const Easing: {
|
|
830
878
|
linear: popmotion.Easing;
|
|
831
879
|
easeIn: popmotion.Easing;
|
|
@@ -843,4 +891,31 @@ declare const Easing: {
|
|
|
843
891
|
bounceOut: (p: number) => number;
|
|
844
892
|
};
|
|
845
893
|
|
|
846
|
-
|
|
894
|
+
declare class RadialGradient {
|
|
895
|
+
private x0;
|
|
896
|
+
private y0;
|
|
897
|
+
private x1;
|
|
898
|
+
private y1;
|
|
899
|
+
private x2;
|
|
900
|
+
private y2;
|
|
901
|
+
private focalPoint;
|
|
902
|
+
private canvas;
|
|
903
|
+
private ctx;
|
|
904
|
+
private gradient;
|
|
905
|
+
private texture;
|
|
906
|
+
transform: Matrix;
|
|
907
|
+
size: number;
|
|
908
|
+
constructor(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, focalPoint?: number);
|
|
909
|
+
addColorStop(offset: number, color: string): void;
|
|
910
|
+
render({ translate }?: {
|
|
911
|
+
translate?: {
|
|
912
|
+
x: number;
|
|
913
|
+
y: number;
|
|
914
|
+
};
|
|
915
|
+
}): {
|
|
916
|
+
texture: Texture<PIXI.TextureSource<any>>;
|
|
917
|
+
matrix: Matrix;
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
export { type AnimatedSignal, type AnimatedState, type ArrayChange, Canvas, Circle, type ComponentFunction, type ComponentInstance, Container, DisplayObject, EVENTS, Easing, type Element, Ellipse, Graphics, NineSliceSprite, ParticlesEmitter, type Props, RadialGradient, Rect, Scene, Sprite, Text, TilingSprite, Triangle, Viewport, animatedSignal, bootstrapCanvas, cond, createComponent, currentSubscriptionsTracker, h, isAnimatedSignal, isElement, isPrimitive, isTrigger, loop, mount, mountTracker, on, registerComponent, Svg as svg, tick, trigger, useDefineProps, useProps };
|