@vworlds/vecs-phaser 1.0.25
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/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/components/shapes.d.ts +84 -0
- package/dist/components/shapes.js +201 -0
- package/dist/components/shapes.js.map +1 -0
- package/dist/components/style.d.ts +12 -0
- package/dist/components/style.js +47 -0
- package/dist/components/style.js.map +1 -0
- package/dist/components/text.d.ts +23 -0
- package/dist/components/text.js +65 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/transform.d.ts +22 -0
- package/dist/components/transform.js +71 -0
- package/dist/components/transform.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@vworlds/vecs-phaser` will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Added wire-serializable Phaser render components for transforms, styling, shapes, and text: `Position`, `Rotation`, `Scale`, `Alpha`, `Depth`, `FillStyle`, `StrokeStyle`, `Arc`, `Ellipse`, `Rectangle`, `Polygon`, `Line`, `Triangle`, `Star`, `Text`, and `TextAlign`.
|
|
12
|
+
- Added `phaserNetworkComponents` and `phaserRenderableComponents` protocol arrays to keep render component serialization and renderable exclusivity order stable.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vworlds
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @vworlds/vecs-phaser
|
|
2
|
+
|
|
3
|
+
Data-only package providing wire-serializable Phaser render components (`Position`, `Arc`,
|
|
4
|
+
`Text`, …) and the `phaserNetworkComponents` protocol order. No `phaser` dependency.
|
|
5
|
+
|
|
6
|
+
Depends on `@vworlds/vecs` and `@vworlds/vecs-wire`.
|
|
7
|
+
|
|
8
|
+
See [`./architecture/README.md`](./architecture/README.md) for the full design and
|
|
9
|
+
[`./architecture/TICKETS.md`](./architecture/TICKETS.md) for the implementation plan.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arc shape. All dimensions in meters; angles in radians (CCW+).
|
|
3
|
+
* The full unit circle default (endAngle = 2π) renders a complete circle.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Arc {
|
|
6
|
+
/** Radius in meters. */
|
|
7
|
+
radius: number;
|
|
8
|
+
/** Start angle in radians (CCW+). */
|
|
9
|
+
startAngle: number;
|
|
10
|
+
/** End angle in radians (CCW+). Default is a full circle (2π). */
|
|
11
|
+
endAngle: number;
|
|
12
|
+
/** Whether the arc is drawn anticlockwise. */
|
|
13
|
+
anticlockwise: boolean;
|
|
14
|
+
/** Iteration step size for arc tessellation. */
|
|
15
|
+
iterations: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Ellipse shape. All dimensions in meters.
|
|
19
|
+
*/
|
|
20
|
+
export declare class Ellipse {
|
|
21
|
+
/** Width in meters. */
|
|
22
|
+
width: number;
|
|
23
|
+
/** Height in meters. */
|
|
24
|
+
height: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Rectangle shape. All dimensions in meters.
|
|
28
|
+
*/
|
|
29
|
+
export declare class Rectangle {
|
|
30
|
+
/** Width in meters. */
|
|
31
|
+
width: number;
|
|
32
|
+
/** Height in meters. */
|
|
33
|
+
height: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Polygon shape. Points are alternating x,y pairs in meters,
|
|
37
|
+
* relative to the entity's Position.
|
|
38
|
+
*/
|
|
39
|
+
export declare class Polygon {
|
|
40
|
+
/** Alternating x,y coordinates in meters, relative to entity Position. */
|
|
41
|
+
points: number[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Line shape. Endpoints are in meters, relative to the entity's Position.
|
|
45
|
+
*/
|
|
46
|
+
export declare class Line {
|
|
47
|
+
/** X coordinate of the first endpoint in meters (relative). */
|
|
48
|
+
x1: number;
|
|
49
|
+
/** Y coordinate of the first endpoint in meters (relative). */
|
|
50
|
+
y1: number;
|
|
51
|
+
/** X coordinate of the second endpoint in meters (relative). */
|
|
52
|
+
x2: number;
|
|
53
|
+
/** Y coordinate of the second endpoint in meters (relative). */
|
|
54
|
+
y2: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Triangle shape. Vertices are in meters, relative to the entity's Position.
|
|
58
|
+
* Default is an upward-pointing equilateral-ish triangle.
|
|
59
|
+
*/
|
|
60
|
+
export declare class Triangle {
|
|
61
|
+
/** X coordinate of vertex 1 in meters (relative). */
|
|
62
|
+
x1: number;
|
|
63
|
+
/** Y coordinate of vertex 1 in meters (relative). */
|
|
64
|
+
y1: number;
|
|
65
|
+
/** X coordinate of vertex 2 in meters (relative). */
|
|
66
|
+
x2: number;
|
|
67
|
+
/** Y coordinate of vertex 2 in meters (relative). */
|
|
68
|
+
y2: number;
|
|
69
|
+
/** X coordinate of vertex 3 in meters (relative). */
|
|
70
|
+
x3: number;
|
|
71
|
+
/** Y coordinate of vertex 3 in meters (relative). */
|
|
72
|
+
y3: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Star shape. Radii are in meters.
|
|
76
|
+
*/
|
|
77
|
+
export declare class Star {
|
|
78
|
+
/** Number of points on the star. */
|
|
79
|
+
points: number;
|
|
80
|
+
/** Inner radius in meters. */
|
|
81
|
+
innerRadius: number;
|
|
82
|
+
/** Outer radius in meters. */
|
|
83
|
+
outerRadius: number;
|
|
84
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { type as wireType } from "@vworlds/vecs-wire";
|
|
11
|
+
/**
|
|
12
|
+
* Arc shape. All dimensions in meters; angles in radians (CCW+).
|
|
13
|
+
* The full unit circle default (endAngle = 2π) renders a complete circle.
|
|
14
|
+
*/
|
|
15
|
+
export class Arc {
|
|
16
|
+
constructor() {
|
|
17
|
+
/** Radius in meters. */
|
|
18
|
+
this.radius = 0.5;
|
|
19
|
+
/** Start angle in radians (CCW+). */
|
|
20
|
+
this.startAngle = 0;
|
|
21
|
+
/** End angle in radians (CCW+). Default is a full circle (2π). */
|
|
22
|
+
this.endAngle = Math.PI * 2;
|
|
23
|
+
/** Whether the arc is drawn anticlockwise. */
|
|
24
|
+
this.anticlockwise = false;
|
|
25
|
+
/** Iteration step size for arc tessellation. */
|
|
26
|
+
this.iterations = 0.01;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
__decorate([
|
|
30
|
+
wireType("f32"),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], Arc.prototype, "radius", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
wireType("f32"),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], Arc.prototype, "startAngle", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
wireType("f32"),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], Arc.prototype, "endAngle", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
wireType("bool"),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], Arc.prototype, "anticlockwise", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
wireType("f32"),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], Arc.prototype, "iterations", void 0);
|
|
49
|
+
/**
|
|
50
|
+
* Ellipse shape. All dimensions in meters.
|
|
51
|
+
*/
|
|
52
|
+
export class Ellipse {
|
|
53
|
+
constructor() {
|
|
54
|
+
/** Width in meters. */
|
|
55
|
+
this.width = 2;
|
|
56
|
+
/** Height in meters. */
|
|
57
|
+
this.height = 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
__decorate([
|
|
61
|
+
wireType("f32"),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], Ellipse.prototype, "width", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
wireType("f32"),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], Ellipse.prototype, "height", void 0);
|
|
68
|
+
/**
|
|
69
|
+
* Rectangle shape. All dimensions in meters.
|
|
70
|
+
*/
|
|
71
|
+
export class Rectangle {
|
|
72
|
+
constructor() {
|
|
73
|
+
/** Width in meters. */
|
|
74
|
+
this.width = 2;
|
|
75
|
+
/** Height in meters. */
|
|
76
|
+
this.height = 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
__decorate([
|
|
80
|
+
wireType("f32"),
|
|
81
|
+
__metadata("design:type", Object)
|
|
82
|
+
], Rectangle.prototype, "width", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
wireType("f32"),
|
|
85
|
+
__metadata("design:type", Object)
|
|
86
|
+
], Rectangle.prototype, "height", void 0);
|
|
87
|
+
/**
|
|
88
|
+
* Polygon shape. Points are alternating x,y pairs in meters,
|
|
89
|
+
* relative to the entity's Position.
|
|
90
|
+
*/
|
|
91
|
+
export class Polygon {
|
|
92
|
+
constructor() {
|
|
93
|
+
/** Alternating x,y coordinates in meters, relative to entity Position. */
|
|
94
|
+
this.points = [];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
__decorate([
|
|
98
|
+
wireType(["f32"]),
|
|
99
|
+
__metadata("design:type", Array)
|
|
100
|
+
], Polygon.prototype, "points", void 0);
|
|
101
|
+
/**
|
|
102
|
+
* Line shape. Endpoints are in meters, relative to the entity's Position.
|
|
103
|
+
*/
|
|
104
|
+
export class Line {
|
|
105
|
+
constructor() {
|
|
106
|
+
/** X coordinate of the first endpoint in meters (relative). */
|
|
107
|
+
this.x1 = 0;
|
|
108
|
+
/** Y coordinate of the first endpoint in meters (relative). */
|
|
109
|
+
this.y1 = 0;
|
|
110
|
+
/** X coordinate of the second endpoint in meters (relative). */
|
|
111
|
+
this.x2 = 0;
|
|
112
|
+
/** Y coordinate of the second endpoint in meters (relative). */
|
|
113
|
+
this.y2 = 0;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
__decorate([
|
|
117
|
+
wireType("f32"),
|
|
118
|
+
__metadata("design:type", Object)
|
|
119
|
+
], Line.prototype, "x1", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
wireType("f32"),
|
|
122
|
+
__metadata("design:type", Object)
|
|
123
|
+
], Line.prototype, "y1", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
wireType("f32"),
|
|
126
|
+
__metadata("design:type", Object)
|
|
127
|
+
], Line.prototype, "x2", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
wireType("f32"),
|
|
130
|
+
__metadata("design:type", Object)
|
|
131
|
+
], Line.prototype, "y2", void 0);
|
|
132
|
+
/**
|
|
133
|
+
* Triangle shape. Vertices are in meters, relative to the entity's Position.
|
|
134
|
+
* Default is an upward-pointing equilateral-ish triangle.
|
|
135
|
+
*/
|
|
136
|
+
export class Triangle {
|
|
137
|
+
constructor() {
|
|
138
|
+
/** X coordinate of vertex 1 in meters (relative). */
|
|
139
|
+
this.x1 = 0;
|
|
140
|
+
/** Y coordinate of vertex 1 in meters (relative). */
|
|
141
|
+
this.y1 = 1;
|
|
142
|
+
/** X coordinate of vertex 2 in meters (relative). */
|
|
143
|
+
this.x2 = -1;
|
|
144
|
+
/** Y coordinate of vertex 2 in meters (relative). */
|
|
145
|
+
this.y2 = -1;
|
|
146
|
+
/** X coordinate of vertex 3 in meters (relative). */
|
|
147
|
+
this.x3 = 1;
|
|
148
|
+
/** Y coordinate of vertex 3 in meters (relative). */
|
|
149
|
+
this.y3 = -1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
__decorate([
|
|
153
|
+
wireType("f32"),
|
|
154
|
+
__metadata("design:type", Object)
|
|
155
|
+
], Triangle.prototype, "x1", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
wireType("f32"),
|
|
158
|
+
__metadata("design:type", Object)
|
|
159
|
+
], Triangle.prototype, "y1", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
wireType("f32"),
|
|
162
|
+
__metadata("design:type", Object)
|
|
163
|
+
], Triangle.prototype, "x2", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
wireType("f32"),
|
|
166
|
+
__metadata("design:type", Object)
|
|
167
|
+
], Triangle.prototype, "y2", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
wireType("f32"),
|
|
170
|
+
__metadata("design:type", Object)
|
|
171
|
+
], Triangle.prototype, "x3", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
wireType("f32"),
|
|
174
|
+
__metadata("design:type", Object)
|
|
175
|
+
], Triangle.prototype, "y3", void 0);
|
|
176
|
+
/**
|
|
177
|
+
* Star shape. Radii are in meters.
|
|
178
|
+
*/
|
|
179
|
+
export class Star {
|
|
180
|
+
constructor() {
|
|
181
|
+
/** Number of points on the star. */
|
|
182
|
+
this.points = 5;
|
|
183
|
+
/** Inner radius in meters. */
|
|
184
|
+
this.innerRadius = 0.5;
|
|
185
|
+
/** Outer radius in meters. */
|
|
186
|
+
this.outerRadius = 1;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
__decorate([
|
|
190
|
+
wireType("u8"),
|
|
191
|
+
__metadata("design:type", Object)
|
|
192
|
+
], Star.prototype, "points", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
wireType("f32"),
|
|
195
|
+
__metadata("design:type", Object)
|
|
196
|
+
], Star.prototype, "innerRadius", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
wireType("f32"),
|
|
199
|
+
__metadata("design:type", Object)
|
|
200
|
+
], Star.prototype, "outerRadius", void 0);
|
|
201
|
+
//# sourceMappingURL=shapes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shapes.js","sourceRoot":"","sources":["../../src/components/shapes.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Fill color (RGB integer, e.g. 0xff0000) and opacity 0..1. */
|
|
2
|
+
export declare class FillStyle {
|
|
3
|
+
color: number;
|
|
4
|
+
alpha: number;
|
|
5
|
+
}
|
|
6
|
+
/** Stroke color (RGB integer), opacity 0..1, and line width in screen pixels. */
|
|
7
|
+
export declare class StrokeStyle {
|
|
8
|
+
color: number;
|
|
9
|
+
alpha: number;
|
|
10
|
+
/** Line width in screen pixels. */
|
|
11
|
+
width: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { type as wireType } from "@vworlds/vecs-wire";
|
|
11
|
+
/** Fill color (RGB integer, e.g. 0xff0000) and opacity 0..1. */
|
|
12
|
+
export class FillStyle {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.color = 0xffffff;
|
|
15
|
+
this.alpha = 1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
wireType("u32"),
|
|
20
|
+
__metadata("design:type", Object)
|
|
21
|
+
], FillStyle.prototype, "color", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
wireType("f32"),
|
|
24
|
+
__metadata("design:type", Object)
|
|
25
|
+
], FillStyle.prototype, "alpha", void 0);
|
|
26
|
+
/** Stroke color (RGB integer), opacity 0..1, and line width in screen pixels. */
|
|
27
|
+
export class StrokeStyle {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.color = 0xffffff;
|
|
30
|
+
this.alpha = 1;
|
|
31
|
+
/** Line width in screen pixels. */
|
|
32
|
+
this.width = 1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
__decorate([
|
|
36
|
+
wireType("u32"),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], StrokeStyle.prototype, "color", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
wireType("f32"),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], StrokeStyle.prototype, "alpha", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
wireType("f32"),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], StrokeStyle.prototype, "width", void 0);
|
|
47
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/components/style.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEtD,gEAAgE;AAChE,MAAM,OAAO,SAAS;IAAtB;QAES,UAAK,GAAG,QAAQ,CAAC;QAGjB,UAAK,GAAG,CAAC,CAAC;IACnB,CAAC;CAAA;AAJQ;IADN,QAAQ,CAAC,KAAK,CAAC;;wCACQ;AAGjB;IADN,QAAQ,CAAC,KAAK,CAAC;;wCACC;AAGnB,iFAAiF;AACjF,MAAM,OAAO,WAAW;IAAxB;QAES,UAAK,GAAG,QAAQ,CAAC;QAGjB,UAAK,GAAG,CAAC,CAAC;QAEjB,mCAAmC;QAE5B,UAAK,GAAG,CAAC,CAAC;IACnB,CAAC;CAAA;AARQ;IADN,QAAQ,CAAC,KAAK,CAAC;;0CACQ;AAGjB;IADN,QAAQ,CAAC,KAAK,CAAC;;0CACC;AAIV;IADN,QAAQ,CAAC,KAAK,CAAC;;0CACC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Horizontal text alignment, maps to Phaser text align settings. */
|
|
2
|
+
export declare enum TextAlign {
|
|
3
|
+
Left = 0,
|
|
4
|
+
Center = 1,
|
|
5
|
+
Right = 2
|
|
6
|
+
}
|
|
7
|
+
/** Render a text string at the entity's Position (centered origin). */
|
|
8
|
+
export declare class Text {
|
|
9
|
+
/** The string to display. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** CSS font-family string. */
|
|
12
|
+
fontFamily: string;
|
|
13
|
+
/** Font size in screen pixels (not meters). */
|
|
14
|
+
fontSize: number;
|
|
15
|
+
/** Text fill color as an RGB integer. */
|
|
16
|
+
color: number;
|
|
17
|
+
/** Background rectangle color as an RGB integer. */
|
|
18
|
+
backgroundColor: number;
|
|
19
|
+
/** Background rectangle opacity (0 = transparent). */
|
|
20
|
+
backgroundAlpha: number;
|
|
21
|
+
/** Horizontal alignment; one of the TextAlign enum values. */
|
|
22
|
+
align: TextAlign;
|
|
23
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { type as wireType } from "@vworlds/vecs-wire";
|
|
11
|
+
/** Horizontal text alignment, maps to Phaser text align settings. */
|
|
12
|
+
export var TextAlign;
|
|
13
|
+
(function (TextAlign) {
|
|
14
|
+
TextAlign[TextAlign["Left"] = 0] = "Left";
|
|
15
|
+
TextAlign[TextAlign["Center"] = 1] = "Center";
|
|
16
|
+
TextAlign[TextAlign["Right"] = 2] = "Right";
|
|
17
|
+
})(TextAlign || (TextAlign = {}));
|
|
18
|
+
/** Render a text string at the entity's Position (centered origin). */
|
|
19
|
+
export class Text {
|
|
20
|
+
constructor() {
|
|
21
|
+
/** The string to display. */
|
|
22
|
+
this.value = "";
|
|
23
|
+
/** CSS font-family string. */
|
|
24
|
+
this.fontFamily = "sans-serif";
|
|
25
|
+
/** Font size in screen pixels (not meters). */
|
|
26
|
+
this.fontSize = 16;
|
|
27
|
+
/** Text fill color as an RGB integer. */
|
|
28
|
+
this.color = 0xffffff;
|
|
29
|
+
/** Background rectangle color as an RGB integer. */
|
|
30
|
+
this.backgroundColor = 0;
|
|
31
|
+
/** Background rectangle opacity (0 = transparent). */
|
|
32
|
+
this.backgroundAlpha = 0;
|
|
33
|
+
/** Horizontal alignment; one of the TextAlign enum values. */
|
|
34
|
+
this.align = TextAlign.Left;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
__decorate([
|
|
38
|
+
wireType("string"),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], Text.prototype, "value", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
wireType("string"),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], Text.prototype, "fontFamily", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
wireType("u16"),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], Text.prototype, "fontSize", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
wireType("u32"),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], Text.prototype, "color", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
wireType("u32"),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], Text.prototype, "backgroundColor", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
wireType("f32"),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], Text.prototype, "backgroundAlpha", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
wireType("u8"),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], Text.prototype, "align", void 0);
|
|
65
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/components/text.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qEAAqE;AACrE,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,yCAAQ,CAAA;IACR,6CAAU,CAAA;IACV,2CAAS,CAAA;AACX,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAED,uEAAuE;AACvE,MAAM,OAAO,IAAI;IAAjB;QACE,6BAA6B;QAEtB,UAAK,GAAG,EAAE,CAAC;QAElB,8BAA8B;QAEvB,eAAU,GAAG,YAAY,CAAC;QAEjC,+CAA+C;QAExC,aAAQ,GAAG,EAAE,CAAC;QAErB,yCAAyC;QAElC,UAAK,GAAG,QAAQ,CAAC;QAExB,oDAAoD;QAE7C,oBAAe,GAAG,CAAC,CAAC;QAE3B,sDAAsD;QAE/C,oBAAe,GAAG,CAAC,CAAC;QAE3B,8DAA8D;QAEvD,UAAK,GAAG,SAAS,CAAC,IAAI,CAAC;IAChC,CAAC;CAAA;AAzBQ;IADN,QAAQ,CAAC,QAAQ,CAAC;;mCACD;AAIX;IADN,QAAQ,CAAC,QAAQ,CAAC;;wCACc;AAI1B;IADN,QAAQ,CAAC,KAAK,CAAC;;sCACK;AAId;IADN,QAAQ,CAAC,KAAK,CAAC;;mCACQ;AAIjB;IADN,QAAQ,CAAC,KAAK,CAAC;;6CACW;AAIpB;IADN,QAAQ,CAAC,KAAK,CAAC;;6CACW;AAIpB;IADN,QAAQ,CAAC,IAAI,CAAC;;mCACe"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Entity position in meters, +y up (math convention). */
|
|
2
|
+
export declare class Position {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
/** Entity orientation in radians, counter-clockwise positive. */
|
|
7
|
+
export declare class Rotation {
|
|
8
|
+
angle: number;
|
|
9
|
+
}
|
|
10
|
+
/** Uniform scale multiplier (unitless). */
|
|
11
|
+
export declare class Scale {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
}
|
|
15
|
+
/** Opacity in the range 0..1. */
|
|
16
|
+
export declare class Alpha {
|
|
17
|
+
value: number;
|
|
18
|
+
}
|
|
19
|
+
/** Render order (unitless integer; higher values draw on top). */
|
|
20
|
+
export declare class Depth {
|
|
21
|
+
value: number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { type as wireType } from "@vworlds/vecs-wire";
|
|
11
|
+
/** Entity position in meters, +y up (math convention). */
|
|
12
|
+
export class Position {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.x = 0;
|
|
15
|
+
this.y = 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
wireType("f32"),
|
|
20
|
+
__metadata("design:type", Object)
|
|
21
|
+
], Position.prototype, "x", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
wireType("f32"),
|
|
24
|
+
__metadata("design:type", Object)
|
|
25
|
+
], Position.prototype, "y", void 0);
|
|
26
|
+
/** Entity orientation in radians, counter-clockwise positive. */
|
|
27
|
+
export class Rotation {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.angle = 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
__decorate([
|
|
33
|
+
wireType("f32"),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], Rotation.prototype, "angle", void 0);
|
|
36
|
+
/** Uniform scale multiplier (unitless). */
|
|
37
|
+
export class Scale {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.x = 1;
|
|
40
|
+
this.y = 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
__decorate([
|
|
44
|
+
wireType("f32"),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], Scale.prototype, "x", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
wireType("f32"),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], Scale.prototype, "y", void 0);
|
|
51
|
+
/** Opacity in the range 0..1. */
|
|
52
|
+
export class Alpha {
|
|
53
|
+
constructor() {
|
|
54
|
+
this.value = 1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
__decorate([
|
|
58
|
+
wireType("f32"),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], Alpha.prototype, "value", void 0);
|
|
61
|
+
/** Render order (unitless integer; higher values draw on top). */
|
|
62
|
+
export class Depth {
|
|
63
|
+
constructor() {
|
|
64
|
+
this.value = 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
__decorate([
|
|
68
|
+
wireType("i32"),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], Depth.prototype, "value", void 0);
|
|
71
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/components/transform.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEtD,0DAA0D;AAC1D,MAAM,OAAO,QAAQ;IAArB;QAES,MAAC,GAAG,CAAC,CAAC;QAGN,MAAC,GAAG,CAAC,CAAC;IACf,CAAC;CAAA;AAJQ;IADN,QAAQ,CAAC,KAAK,CAAC;;mCACH;AAGN;IADN,QAAQ,CAAC,KAAK,CAAC;;mCACH;AAGf,iEAAiE;AACjE,MAAM,OAAO,QAAQ;IAArB;QAES,UAAK,GAAG,CAAC,CAAC;IACnB,CAAC;CAAA;AADQ;IADN,QAAQ,CAAC,KAAK,CAAC;;uCACC;AAGnB,2CAA2C;AAC3C,MAAM,OAAO,KAAK;IAAlB;QAES,MAAC,GAAG,CAAC,CAAC;QAGN,MAAC,GAAG,CAAC,CAAC;IACf,CAAC;CAAA;AAJQ;IADN,QAAQ,CAAC,KAAK,CAAC;;gCACH;AAGN;IADN,QAAQ,CAAC,KAAK,CAAC;;gCACH;AAGf,iCAAiC;AACjC,MAAM,OAAO,KAAK;IAAlB;QAES,UAAK,GAAG,CAAC,CAAC;IACnB,CAAC;CAAA;AADQ;IADN,QAAQ,CAAC,KAAK,CAAC;;oCACC;AAGnB,kEAAkE;AAClE,MAAM,OAAO,KAAK;IAAlB;QAES,UAAK,GAAG,CAAC,CAAC;IACnB,CAAC;CAAA;AADQ;IADN,QAAQ,CAAC,KAAK,CAAC;;oCACC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { Alpha, Depth, Position, Rotation, Scale } from "./components/transform.js";
|
|
2
|
+
export { FillStyle, StrokeStyle } from "./components/style.js";
|
|
3
|
+
export { Arc, Ellipse, Line, Polygon, Rectangle, Star, Triangle } from "./components/shapes.js";
|
|
4
|
+
export { Text, TextAlign } from "./components/text.js";
|
|
5
|
+
import { Alpha, Depth, Position, Rotation, Scale } from "./components/transform.js";
|
|
6
|
+
import { FillStyle, StrokeStyle } from "./components/style.js";
|
|
7
|
+
import { Arc, Ellipse, Line, Polygon, Rectangle, Star, Triangle } from "./components/shapes.js";
|
|
8
|
+
import { Text } from "./components/text.js";
|
|
9
|
+
/**
|
|
10
|
+
* All components that participate in the network protocol, in registration order.
|
|
11
|
+
* ORDER IS THE PROTOCOL — type id = index + 1. Do not reorder without a protocol version bump.
|
|
12
|
+
*
|
|
13
|
+
* Type ids:
|
|
14
|
+
* 1 Position
|
|
15
|
+
* 2 Rotation
|
|
16
|
+
* 3 Scale
|
|
17
|
+
* 4 Alpha
|
|
18
|
+
* 5 Depth
|
|
19
|
+
* 6 FillStyle
|
|
20
|
+
* 7 StrokeStyle
|
|
21
|
+
* 8 Arc
|
|
22
|
+
* 9 Ellipse
|
|
23
|
+
* 10 Rectangle
|
|
24
|
+
* 11 Polygon
|
|
25
|
+
* 12 Line
|
|
26
|
+
* 13 Triangle
|
|
27
|
+
* 14 Star
|
|
28
|
+
* 15 Text
|
|
29
|
+
*/
|
|
30
|
+
export declare const phaserNetworkComponents: readonly [typeof Position, typeof Rotation, typeof Scale, typeof Alpha, typeof Depth, typeof FillStyle, typeof StrokeStyle, typeof Arc, typeof Ellipse, typeof Rectangle, typeof Polygon, typeof Line, typeof Triangle, typeof Star, typeof Text];
|
|
31
|
+
/**
|
|
32
|
+
* The subset of network components that represent renderable shapes.
|
|
33
|
+
* Exactly one of these should be present on each renderable entity.
|
|
34
|
+
* Order matches phaserNetworkComponents (shapes section).
|
|
35
|
+
*/
|
|
36
|
+
export declare const phaserRenderableComponents: readonly [typeof Arc, typeof Ellipse, typeof Rectangle, typeof Polygon, typeof Line, typeof Triangle, typeof Star, typeof Text];
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export { Alpha, Depth, Position, Rotation, Scale } from "./components/transform.js";
|
|
2
|
+
export { FillStyle, StrokeStyle } from "./components/style.js";
|
|
3
|
+
export { Arc, Ellipse, Line, Polygon, Rectangle, Star, Triangle } from "./components/shapes.js";
|
|
4
|
+
export { Text, TextAlign } from "./components/text.js";
|
|
5
|
+
import { Alpha, Depth, Position, Rotation, Scale } from "./components/transform.js";
|
|
6
|
+
import { FillStyle, StrokeStyle } from "./components/style.js";
|
|
7
|
+
import { Arc, Ellipse, Line, Polygon, Rectangle, Star, Triangle } from "./components/shapes.js";
|
|
8
|
+
import { Text } from "./components/text.js";
|
|
9
|
+
/**
|
|
10
|
+
* All components that participate in the network protocol, in registration order.
|
|
11
|
+
* ORDER IS THE PROTOCOL — type id = index + 1. Do not reorder without a protocol version bump.
|
|
12
|
+
*
|
|
13
|
+
* Type ids:
|
|
14
|
+
* 1 Position
|
|
15
|
+
* 2 Rotation
|
|
16
|
+
* 3 Scale
|
|
17
|
+
* 4 Alpha
|
|
18
|
+
* 5 Depth
|
|
19
|
+
* 6 FillStyle
|
|
20
|
+
* 7 StrokeStyle
|
|
21
|
+
* 8 Arc
|
|
22
|
+
* 9 Ellipse
|
|
23
|
+
* 10 Rectangle
|
|
24
|
+
* 11 Polygon
|
|
25
|
+
* 12 Line
|
|
26
|
+
* 13 Triangle
|
|
27
|
+
* 14 Star
|
|
28
|
+
* 15 Text
|
|
29
|
+
*/
|
|
30
|
+
export const phaserNetworkComponents = [
|
|
31
|
+
Position,
|
|
32
|
+
Rotation,
|
|
33
|
+
Scale,
|
|
34
|
+
Alpha,
|
|
35
|
+
Depth,
|
|
36
|
+
FillStyle,
|
|
37
|
+
StrokeStyle,
|
|
38
|
+
Arc,
|
|
39
|
+
Ellipse,
|
|
40
|
+
Rectangle,
|
|
41
|
+
Polygon,
|
|
42
|
+
Line,
|
|
43
|
+
Triangle,
|
|
44
|
+
Star,
|
|
45
|
+
Text,
|
|
46
|
+
];
|
|
47
|
+
/**
|
|
48
|
+
* The subset of network components that represent renderable shapes.
|
|
49
|
+
* Exactly one of these should be present on each renderable entity.
|
|
50
|
+
* Order matches phaserNetworkComponents (shapes section).
|
|
51
|
+
*/
|
|
52
|
+
export const phaserRenderableComponents = [
|
|
53
|
+
Arc,
|
|
54
|
+
Ellipse,
|
|
55
|
+
Rectangle,
|
|
56
|
+
Polygon,
|
|
57
|
+
Line,
|
|
58
|
+
Triangle,
|
|
59
|
+
Star,
|
|
60
|
+
Text,
|
|
61
|
+
];
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,KAAK;IACL,KAAK;IACL,SAAS;IACT,WAAW;IACX,GAAG;IACH,OAAO;IACP,SAAS;IACT,OAAO;IACP,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,IAAI;CACwC,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,GAAG;IACH,OAAO;IACP,SAAS;IACT,OAAO;IACP,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,IAAI;CACwC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vworlds/vecs-phaser",
|
|
3
|
+
"version": "1.0.25",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"CHANGELOG.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" --no-error-on-unmatched-pattern",
|
|
24
|
+
"test": "vitest run --passWithNoTests"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@vworlds/vecs": "1.0.25",
|
|
28
|
+
"@vworlds/vecs-wire": "1.0.25"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"license": "MIT"
|
|
34
|
+
}
|