@webspatial/core-sdk 0.0.1-alpha → 0.0.2
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 +13 -0
- package/LICENSE +21 -0
- package/dist/core/SpatialSession.d.ts.map +1 -1
- package/dist/core/SpatialSession.js +5 -1
- package/dist/core/component/SpatialModel3DComponent.d.ts +4 -4
- package/dist/core/component/SpatialModel3DComponent.d.ts.map +1 -1
- package/dist/core/component/index.d.ts +1 -1
- package/dist/core/component/index.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/core/SpatialSession.ts +7 -1
- package/src/core/component/SpatialModel3DComponent.ts +7 -7
- package/src/core/component/index.ts +1 -1
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Spatial Web
|
|
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.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpatialSession.d.ts","sourceRoot":"","sources":["../../src/core/SpatialSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAMjE,OAAO,EACL,iBAAiB,EACjB,cAAc,EAEd,WAAW,EACZ,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,mBAAmB,EACnB,sCAAsC,EACvC,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,aAAa,CAAA;AAGpB;;GAEG;AACH,KAAK,YAAY,GAAG,CAAC,IAAI,EAAE,mBAAmB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;AA4B/D;;GAEG;AACH,qBAAa,cAAc;IACzB,cAAc;IACd,sBAAsB,iBAAwB;IAC9C,cAAc;IACd,iBAAiB,UAAQ;IAEzB;;;OAGG;IACH,8BAA8B,CAAC,QAAQ,EAAE,YAAY;IAerD;;;OAGG;IACG,YAAY;IASlB;;;;OAIG;IACG,qBAAqB,CAAC,OAAO,CAAC,EAAE;QACpC,eAAe,CAAC,EAAE,sBAAsB,CAAA;KACzC;IAWD;;;OAGG;IACG,mBAAmB,CAAC,OAAO,CAAC,EAAE;QAClC,eAAe,CAAC,EAAE,sBAAsB,CAAA;KACzC;IAWD;;;OAGG;IACG,oBAAoB,CAAC,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE;IAcpD;;;OAGG;IACG,sBAAsB,CAAC,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE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eAAe,GAAE,MAA2C;IAI3E;;OAEG;IACG,2BAA2B;IAIjC,gCAAgC;IAC1B,kBAAkB;IAIxB,iCAAiC;IAC3B,qBAAqB;IAI3B,OAAO,CAAC,MAAM,CAAC,yBAAyB,CACD;IACvC;;;OAGG;IACG,2BAA2B;IAYjC,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAwC;IAE9E;;;;OAIG;IACH,yBAAyB;IAWzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,EAAE,QAAQ;IAMxB;;;OAGG;IACG,mBAAmB;IAgCzB,cAAc;IACR,UAAU,CAAC,EAAE,EAAE,MAAM;IAoB3B,cAAc;IACR,UAAU,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,MAAM;CAG3D"}
|
|
@@ -174,7 +174,11 @@ export class SpatialSession {
|
|
|
174
174
|
* @param msg mesage to log
|
|
175
175
|
*/
|
|
176
176
|
async log(...msg) {
|
|
177
|
-
await WebSpatial.sendCommand(new RemoteCommand('log', {
|
|
177
|
+
await WebSpatial.sendCommand(new RemoteCommand('log', {
|
|
178
|
+
logString: msg.map(x => {
|
|
179
|
+
return JSON.stringify(x);
|
|
180
|
+
}),
|
|
181
|
+
}));
|
|
178
182
|
}
|
|
179
183
|
/**
|
|
180
184
|
* @hidden
|
|
@@ -3,7 +3,7 @@ import { Vec3 } from '../SpatialTransform';
|
|
|
3
3
|
/**
|
|
4
4
|
* Translate event, matching similar behavior to https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/drag_event
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type SpatialModelDragEvent = {
|
|
7
7
|
eventType: 'dragstart' | 'dragend' | 'drag';
|
|
8
8
|
translation3D: Vec3;
|
|
9
9
|
startLocation3D: Vec3;
|
|
@@ -57,19 +57,19 @@ export declare class SpatialModel3DComponent extends EventSpatialComponent {
|
|
|
57
57
|
* @param dragEvent
|
|
58
58
|
*/
|
|
59
59
|
private _onDragStart?;
|
|
60
|
-
set onDragStart(callback: ((dragEvent:
|
|
60
|
+
set onDragStart(callback: ((dragEvent: SpatialModelDragEvent) => void) | undefined);
|
|
61
61
|
/**
|
|
62
62
|
* Callback fired when model was dragged
|
|
63
63
|
* @param dragEvent
|
|
64
64
|
*/
|
|
65
65
|
private _onDrag?;
|
|
66
|
-
set onDrag(callback: ((dragEvent:
|
|
66
|
+
set onDrag(callback: ((dragEvent: SpatialModelDragEvent) => void) | undefined);
|
|
67
67
|
/**
|
|
68
68
|
* Callback fired when model was dragged at the ending
|
|
69
69
|
* @param dragEvent
|
|
70
70
|
*/
|
|
71
71
|
private _onDragEnd?;
|
|
72
|
-
set onDragEnd(callback: ((dragEvent:
|
|
72
|
+
set onDragEnd(callback: ((dragEvent: SpatialModelDragEvent) => void) | undefined);
|
|
73
73
|
private get enableDragEvent();
|
|
74
74
|
/**
|
|
75
75
|
* Callback fired when model was tapped
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpatialModel3DComponent.d.ts","sourceRoot":"","sources":["../../../src/core/component/SpatialModel3DComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAE1C;;GAEG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"SpatialModel3DComponent.d.ts","sourceRoot":"","sources":["../../../src/core/component/SpatialModel3DComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAE1C;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAAA;IAC3C,aAAa,EAAE,IAAI,CAAA;IACnB,eAAe,EAAE,IAAI,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG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EAOlD;IAED,kDAAkD;IAClD,OAAO,CAAC,YAAY,CAAC,CAAY;IACjC,IAAW,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,EAOxD;IAED,iDAAiD;IACjD,OAAO,CAAC,YAAY,CAAC,CAAY;IACjC,IAAW,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,EAOxD;CACF"}
|
|
@@ -3,5 +3,5 @@ export { SpatialWindowComponent, type BackgroundMaterialType, type StyleParam, t
|
|
|
3
3
|
export { SpatialInputComponent } from './SpatialInputComponent';
|
|
4
4
|
export { SpatialModelComponent } from './SpatialModelComponent';
|
|
5
5
|
export { SpatialViewComponent } from './SpatialViewComponent';
|
|
6
|
-
export { SpatialModel3DComponent, type
|
|
6
|
+
export { SpatialModel3DComponent, type SpatialModelDragEvent, } from './SpatialModel3DComponent';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EACL,uBAAuB,EACvB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EACL,uBAAuB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webspatial/core-sdk",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "this is runtime for webspatial",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"sideEffects": false,
|
|
9
|
-
"scripts": {
|
|
10
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
-
"build": "tsc",
|
|
12
|
-
"start": "tsc --watch",
|
|
13
|
-
"buildIife": "esbuild dist/index.js --outdir=dist/iife --minify --bundle --format=iife --global-name=webspatialRuntime",
|
|
14
|
-
"format": "npx prettier --write 'src/**/*.ts' 'src/**/*.tsx' || true",
|
|
15
|
-
"genDocs": "typedoc --plugin typedoc-plugin-markdown src/core/index.ts"
|
|
16
|
-
},
|
|
17
9
|
"repository": {
|
|
18
10
|
"type": "git",
|
|
19
11
|
"url": "git+https://github.com/webspatial/webspatial-sdk.git"
|
|
@@ -31,5 +23,13 @@
|
|
|
31
23
|
},
|
|
32
24
|
"dependencies": {
|
|
33
25
|
"loglevel": "^1.9.2"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"test": "tsc -p ./tsconfig.json",
|
|
29
|
+
"build": "tsc",
|
|
30
|
+
"start": "tsc --watch",
|
|
31
|
+
"buildIife": "esbuild dist/index.js --outdir=dist/iife --minify --bundle --format=iife --global-name=webspatialRuntime",
|
|
32
|
+
"format": "npx prettier --write 'src/**/*.ts' 'src/**/*.tsx' || true",
|
|
33
|
+
"genDocs": "typedoc --plugin typedoc-plugin-markdown src/core/index.ts"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -279,7 +279,13 @@ export class SpatialSession {
|
|
|
279
279
|
* @param msg mesage to log
|
|
280
280
|
*/
|
|
281
281
|
async log(...msg: any[]) {
|
|
282
|
-
await WebSpatial.sendCommand(
|
|
282
|
+
await WebSpatial.sendCommand(
|
|
283
|
+
new RemoteCommand('log', {
|
|
284
|
+
logString: msg.map(x => {
|
|
285
|
+
return JSON.stringify(x)
|
|
286
|
+
}),
|
|
287
|
+
}),
|
|
288
|
+
)
|
|
283
289
|
}
|
|
284
290
|
|
|
285
291
|
/**
|
|
@@ -5,7 +5,7 @@ import { Vec3 } from '../SpatialTransform'
|
|
|
5
5
|
/**
|
|
6
6
|
* Translate event, matching similar behavior to https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/drag_event
|
|
7
7
|
*/
|
|
8
|
-
export type
|
|
8
|
+
export type SpatialModelDragEvent = {
|
|
9
9
|
eventType: 'dragstart' | 'dragend' | 'drag'
|
|
10
10
|
translation3D: Vec3
|
|
11
11
|
startLocation3D: Vec3
|
|
@@ -124,9 +124,9 @@ export class SpatialModel3DComponent extends EventSpatialComponent {
|
|
|
124
124
|
* Callback fired when model was dragged at the beginning
|
|
125
125
|
* @param dragEvent
|
|
126
126
|
*/
|
|
127
|
-
private _onDragStart?: (dragEvent:
|
|
127
|
+
private _onDragStart?: (dragEvent: SpatialModelDragEvent) => void
|
|
128
128
|
public set onDragStart(
|
|
129
|
-
callback: ((dragEvent:
|
|
129
|
+
callback: ((dragEvent: SpatialModelDragEvent) => void) | undefined,
|
|
130
130
|
) {
|
|
131
131
|
if (this._onDragStart !== callback) {
|
|
132
132
|
this._onDragStart = callback
|
|
@@ -140,9 +140,9 @@ export class SpatialModel3DComponent extends EventSpatialComponent {
|
|
|
140
140
|
* Callback fired when model was dragged
|
|
141
141
|
* @param dragEvent
|
|
142
142
|
*/
|
|
143
|
-
private _onDrag?: (dragEvent:
|
|
143
|
+
private _onDrag?: (dragEvent: SpatialModelDragEvent) => void
|
|
144
144
|
public set onDrag(
|
|
145
|
-
callback: ((dragEvent:
|
|
145
|
+
callback: ((dragEvent: SpatialModelDragEvent) => void) | undefined,
|
|
146
146
|
) {
|
|
147
147
|
if (this._onDrag !== callback) {
|
|
148
148
|
this._onDrag = callback
|
|
@@ -156,9 +156,9 @@ export class SpatialModel3DComponent extends EventSpatialComponent {
|
|
|
156
156
|
* Callback fired when model was dragged at the ending
|
|
157
157
|
* @param dragEvent
|
|
158
158
|
*/
|
|
159
|
-
private _onDragEnd?: (dragEvent:
|
|
159
|
+
private _onDragEnd?: (dragEvent: SpatialModelDragEvent) => void
|
|
160
160
|
public set onDragEnd(
|
|
161
|
-
callback: ((dragEvent:
|
|
161
|
+
callback: ((dragEvent: SpatialModelDragEvent) => void) | undefined,
|
|
162
162
|
) {
|
|
163
163
|
if (this._onDragEnd !== callback) {
|
|
164
164
|
this._onDragEnd = callback
|