@splinetool/loader 2.0.78 → 2.0.80
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/build/SplineLoader.cjs +47 -47
- package/build/SplineLoader.js +44 -44
- package/build/hana-ui.js +99 -38
- package/build/hana-ui.wasm +0 -0
- package/package.json +1 -1
package/build/hana-ui.js
CHANGED
|
@@ -132,6 +132,68 @@ export class Engine {
|
|
|
132
132
|
}
|
|
133
133
|
if (Symbol.dispose) Engine.prototype[Symbol.dispose] = Engine.prototype.free;
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* The editor's engine without a renderer: the scene, its layout, text and
|
|
137
|
+
* path geometry, with no canvas, GPU or surface. The headless 2D editor
|
|
138
|
+
* (`packages/editor-headless`) holds one per document in Node, where the
|
|
139
|
+
* editor's commands and reactions drive it exactly as they drive `Engine`
|
|
140
|
+
* in a tab, minus drawing.
|
|
141
|
+
*
|
|
142
|
+
* Laid out like `Engine` (`#[repr(C)]`, the scene controller first), so the
|
|
143
|
+
* editor's `.scene` getter (`apps/editor/EditorEngine.ts`), which reads a
|
|
144
|
+
* `SceneController` at the engine's own pointer, works on it unchanged.
|
|
145
|
+
*
|
|
146
|
+
* Never call `SceneController.onFrame` on it, nor play mode: their clock
|
|
147
|
+
* (`wasm_timer::Instant`) needs a browser window. Layout is flushed on
|
|
148
|
+
* demand (`flushLayout`), not per frame.
|
|
149
|
+
*/
|
|
150
|
+
export class HeadlessEngine {
|
|
151
|
+
static __wrap(ptr) {
|
|
152
|
+
const obj = Object.create(HeadlessEngine.prototype);
|
|
153
|
+
obj.__wbg_ptr = ptr;
|
|
154
|
+
HeadlessEngineFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
155
|
+
return obj;
|
|
156
|
+
}
|
|
157
|
+
__destroy_into_raw() {
|
|
158
|
+
const ptr = this.__wbg_ptr;
|
|
159
|
+
this.__wbg_ptr = 0;
|
|
160
|
+
HeadlessEngineFinalization.unregister(this);
|
|
161
|
+
return ptr;
|
|
162
|
+
}
|
|
163
|
+
free() {
|
|
164
|
+
const ptr = this.__destroy_into_raw();
|
|
165
|
+
wasm.__wbg_headlessengine_free(ptr, 0);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* `logical_size`: the viewport the editor would have, in CSS pixels
|
|
169
|
+
* (the camera's size, for screen/world conversions).
|
|
170
|
+
* @param {DocumentData} document_data
|
|
171
|
+
* @param {UInt2} logical_size
|
|
172
|
+
* @returns {HeadlessEngine}
|
|
173
|
+
*/
|
|
174
|
+
static create(document_data, logical_size) {
|
|
175
|
+
const ret = wasm.headlessengine_create(addHeapObject(document_data), addHeapObject(logical_size));
|
|
176
|
+
return HeadlessEngine.__wrap(ret);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Rebuild the scene from `document_data`, keeping the camera (as
|
|
180
|
+
* `Engine.reset` does).
|
|
181
|
+
* @param {DocumentData} document_data
|
|
182
|
+
*/
|
|
183
|
+
reset(document_data) {
|
|
184
|
+
wasm.headlessengine_reset(this.__wbg_ptr, addHeapObject(document_data));
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* `Engine.resize` without a surface: only the camera's size changes.
|
|
188
|
+
* @param {UInt2} logical_size
|
|
189
|
+
* @param {number} _scale_factor
|
|
190
|
+
*/
|
|
191
|
+
resize(logical_size, _scale_factor) {
|
|
192
|
+
wasm.headlessengine_resize(this.__wbg_ptr, addHeapObject(logical_size), _scale_factor);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (Symbol.dispose) HeadlessEngine.prototype[Symbol.dispose] = HeadlessEngine.prototype.free;
|
|
196
|
+
|
|
135
197
|
export class PixelReadPromise {
|
|
136
198
|
static __wrap(ptr) {
|
|
137
199
|
const obj = Object.create(PixelReadPromise.prototype);
|
|
@@ -1923,10 +1985,10 @@ function __wbg_get_imports() {
|
|
|
1923
1985
|
const ret = getObject(arg0).features;
|
|
1924
1986
|
return addHeapObject(ret);
|
|
1925
1987
|
},
|
|
1926
|
-
|
|
1927
|
-
const ret =
|
|
1988
|
+
__wbg_fetch_aee1ab744a69f263: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1989
|
+
const ret = fetch(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
1928
1990
|
return addHeapObject(ret);
|
|
1929
|
-
},
|
|
1991
|
+
}, arguments); },
|
|
1930
1992
|
__wbg_finish_4d91de5e927dd13f: function(arg0, arg1) {
|
|
1931
1993
|
const ret = getObject(arg0).finish(getObject(arg1));
|
|
1932
1994
|
return addHeapObject(ret);
|
|
@@ -2485,7 +2547,7 @@ function __wbg_get_imports() {
|
|
|
2485
2547
|
const a = state0.a;
|
|
2486
2548
|
state0.a = 0;
|
|
2487
2549
|
try {
|
|
2488
|
-
return
|
|
2550
|
+
return __wasm_bindgen_func_elem_14167(a, state0.b, arg0, arg1);
|
|
2489
2551
|
} finally {
|
|
2490
2552
|
state0.a = a;
|
|
2491
2553
|
}
|
|
@@ -2531,7 +2593,7 @@ function __wbg_get_imports() {
|
|
|
2531
2593
|
const a = state0.a;
|
|
2532
2594
|
state0.a = 0;
|
|
2533
2595
|
try {
|
|
2534
|
-
return
|
|
2596
|
+
return __wasm_bindgen_func_elem_14167(a, state0.b, arg0, arg1);
|
|
2535
2597
|
} finally {
|
|
2536
2598
|
state0.a = a;
|
|
2537
2599
|
}
|
|
@@ -2554,10 +2616,6 @@ function __wbg_get_imports() {
|
|
|
2554
2616
|
const ret = new Float64Array(arg0 >>> 0);
|
|
2555
2617
|
return addHeapObject(ret);
|
|
2556
2618
|
},
|
|
2557
|
-
__wbg_new_with_str_and_init_bcd02b79a793d27f: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2558
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
2559
|
-
return addHeapObject(ret);
|
|
2560
|
-
}, arguments); },
|
|
2561
2619
|
__wbg_next_9e03acdf51c4960d: function(arg0) {
|
|
2562
2620
|
const ret = getObject(arg0).next;
|
|
2563
2621
|
return addHeapObject(ret);
|
|
@@ -3647,47 +3705,47 @@ function __wbg_get_imports() {
|
|
|
3647
3705
|
}, arguments); },
|
|
3648
3706
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
3649
3707
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1041, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3650
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3708
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_14165);
|
|
3651
3709
|
return addHeapObject(ret);
|
|
3652
3710
|
},
|
|
3653
3711
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
3654
3712
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 34, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3655
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3713
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_5131);
|
|
3656
3714
|
return addHeapObject(ret);
|
|
3657
3715
|
},
|
|
3658
3716
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
3659
3717
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUComputePipeline")], shim_idx: 929, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3660
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3718
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11165);
|
|
3661
3719
|
return addHeapObject(ret);
|
|
3662
3720
|
},
|
|
3663
3721
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
3664
3722
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 929, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3665
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3723
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11165_3);
|
|
3666
3724
|
return addHeapObject(ret);
|
|
3667
3725
|
},
|
|
3668
3726
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
3669
3727
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 930, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3670
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3728
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11166);
|
|
3671
3729
|
return addHeapObject(ret);
|
|
3672
3730
|
},
|
|
3673
3731
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
3674
3732
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPURenderPipeline")], shim_idx: 929, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3675
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3733
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11165_5);
|
|
3676
3734
|
return addHeapObject(ret);
|
|
3677
3735
|
},
|
|
3678
3736
|
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
3679
3737
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 929, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3680
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3738
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11165_6);
|
|
3681
3739
|
return addHeapObject(ret);
|
|
3682
3740
|
},
|
|
3683
3741
|
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
3684
3742
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 929, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3685
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3743
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_11165_7);
|
|
3686
3744
|
return addHeapObject(ret);
|
|
3687
3745
|
},
|
|
3688
3746
|
__wbindgen_cast_0000000000000009: function(arg0, arg1) {
|
|
3689
3747
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1024, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3690
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3748
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12530);
|
|
3691
3749
|
return addHeapObject(ret);
|
|
3692
3750
|
},
|
|
3693
3751
|
__wbindgen_cast_000000000000000a: function(arg0) {
|
|
@@ -3761,22 +3819,22 @@ function __wbg_get_imports() {
|
|
|
3761
3819
|
};
|
|
3762
3820
|
}
|
|
3763
3821
|
|
|
3764
|
-
function
|
|
3765
|
-
wasm.
|
|
3822
|
+
function __wasm_bindgen_func_elem_12530(arg0, arg1) {
|
|
3823
|
+
wasm.__wasm_bindgen_func_elem_12530(arg0, arg1);
|
|
3766
3824
|
}
|
|
3767
3825
|
|
|
3768
|
-
function
|
|
3769
|
-
wasm.
|
|
3826
|
+
function __wasm_bindgen_func_elem_5131(arg0, arg1, arg2) {
|
|
3827
|
+
wasm.__wasm_bindgen_func_elem_5131(arg0, arg1, addHeapObject(arg2));
|
|
3770
3828
|
}
|
|
3771
3829
|
|
|
3772
|
-
function
|
|
3773
|
-
wasm.
|
|
3830
|
+
function __wasm_bindgen_func_elem_11166(arg0, arg1, arg2) {
|
|
3831
|
+
wasm.__wasm_bindgen_func_elem_11166(arg0, arg1, addHeapObject(arg2));
|
|
3774
3832
|
}
|
|
3775
3833
|
|
|
3776
|
-
function
|
|
3834
|
+
function __wasm_bindgen_func_elem_14165(arg0, arg1, arg2) {
|
|
3777
3835
|
try {
|
|
3778
3836
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3779
|
-
wasm.
|
|
3837
|
+
wasm.__wasm_bindgen_func_elem_14165(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3780
3838
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3781
3839
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3782
3840
|
if (r1) {
|
|
@@ -3787,10 +3845,10 @@ function __wasm_bindgen_func_elem_14149(arg0, arg1, arg2) {
|
|
|
3787
3845
|
}
|
|
3788
3846
|
}
|
|
3789
3847
|
|
|
3790
|
-
function
|
|
3848
|
+
function __wasm_bindgen_func_elem_11165(arg0, arg1, arg2) {
|
|
3791
3849
|
try {
|
|
3792
3850
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3793
|
-
wasm.
|
|
3851
|
+
wasm.__wasm_bindgen_func_elem_11165(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3794
3852
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3795
3853
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3796
3854
|
if (r1) {
|
|
@@ -3801,10 +3859,10 @@ function __wasm_bindgen_func_elem_11147(arg0, arg1, arg2) {
|
|
|
3801
3859
|
}
|
|
3802
3860
|
}
|
|
3803
3861
|
|
|
3804
|
-
function
|
|
3862
|
+
function __wasm_bindgen_func_elem_11165_3(arg0, arg1, arg2) {
|
|
3805
3863
|
try {
|
|
3806
3864
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3807
|
-
wasm.
|
|
3865
|
+
wasm.__wasm_bindgen_func_elem_11165_3(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3808
3866
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3809
3867
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3810
3868
|
if (r1) {
|
|
@@ -3815,10 +3873,10 @@ function __wasm_bindgen_func_elem_11147_3(arg0, arg1, arg2) {
|
|
|
3815
3873
|
}
|
|
3816
3874
|
}
|
|
3817
3875
|
|
|
3818
|
-
function
|
|
3876
|
+
function __wasm_bindgen_func_elem_11165_5(arg0, arg1, arg2) {
|
|
3819
3877
|
try {
|
|
3820
3878
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3821
|
-
wasm.
|
|
3879
|
+
wasm.__wasm_bindgen_func_elem_11165_5(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3822
3880
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3823
3881
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3824
3882
|
if (r1) {
|
|
@@ -3829,10 +3887,10 @@ function __wasm_bindgen_func_elem_11147_5(arg0, arg1, arg2) {
|
|
|
3829
3887
|
}
|
|
3830
3888
|
}
|
|
3831
3889
|
|
|
3832
|
-
function
|
|
3890
|
+
function __wasm_bindgen_func_elem_11165_6(arg0, arg1, arg2) {
|
|
3833
3891
|
try {
|
|
3834
3892
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3835
|
-
wasm.
|
|
3893
|
+
wasm.__wasm_bindgen_func_elem_11165_6(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3836
3894
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3837
3895
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3838
3896
|
if (r1) {
|
|
@@ -3843,10 +3901,10 @@ function __wasm_bindgen_func_elem_11147_6(arg0, arg1, arg2) {
|
|
|
3843
3901
|
}
|
|
3844
3902
|
}
|
|
3845
3903
|
|
|
3846
|
-
function
|
|
3904
|
+
function __wasm_bindgen_func_elem_11165_7(arg0, arg1, arg2) {
|
|
3847
3905
|
try {
|
|
3848
3906
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3849
|
-
wasm.
|
|
3907
|
+
wasm.__wasm_bindgen_func_elem_11165_7(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3850
3908
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3851
3909
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3852
3910
|
if (r1) {
|
|
@@ -3857,8 +3915,8 @@ function __wasm_bindgen_func_elem_11147_7(arg0, arg1, arg2) {
|
|
|
3857
3915
|
}
|
|
3858
3916
|
}
|
|
3859
3917
|
|
|
3860
|
-
function
|
|
3861
|
-
wasm.
|
|
3918
|
+
function __wasm_bindgen_func_elem_14167(arg0, arg1, arg2, arg3) {
|
|
3919
|
+
wasm.__wasm_bindgen_func_elem_14167(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
3862
3920
|
}
|
|
3863
3921
|
|
|
3864
3922
|
|
|
@@ -3959,6 +4017,9 @@ const DeviceLostPromiseFinalization = (typeof FinalizationRegistry === 'undefine
|
|
|
3959
4017
|
const EngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3960
4018
|
? { register: () => {}, unregister: () => {} }
|
|
3961
4019
|
: new FinalizationRegistry(ptr => wasm.__wbg_engine_free(ptr, 1));
|
|
4020
|
+
const HeadlessEngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4021
|
+
? { register: () => {}, unregister: () => {} }
|
|
4022
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_headlessengine_free(ptr, 1));
|
|
3962
4023
|
const PixelReadPromiseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3963
4024
|
? { register: () => {}, unregister: () => {} }
|
|
3964
4025
|
: new FinalizationRegistry(ptr => wasm.__wbg_pixelreadpromise_free(ptr, 1));
|
package/build/hana-ui.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED