lecodes-cli 0.1.3 → 0.1.6
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.js +740 -267
- package/package.json +4 -3
- package/runtime/inject.js +4629 -0
- package/runtime/gl-matrix/common.js +0 -54
- package/runtime/gl-matrix/header.js +0 -12
- package/runtime/gl-matrix/index.js +0 -11
- package/runtime/gl-matrix/mat2.js +0 -425
- package/runtime/gl-matrix/mat2d.js +0 -476
- package/runtime/gl-matrix/mat3.js +0 -765
- package/runtime/gl-matrix/mat4.js +0 -1947
- package/runtime/gl-matrix/quat.js +0 -737
- package/runtime/gl-matrix/quat2.js +0 -822
- package/runtime/gl-matrix/vec2.js +0 -620
- package/runtime/gl-matrix/vec3.js +0 -791
- package/runtime/gl-matrix/vec4.js +0 -652
- package/runtime/worker/animate.js +0 -304
- package/runtime/worker/chunk-4ZN32GYS.js +0 -34
- package/runtime/worker/chunk-G5ZA3LKB.js +0 -52
- package/runtime/worker/chunk-MI3UXE5H.js +0 -1395
- package/runtime/worker/creator.js +0 -930
- package/runtime/worker/globals.js +0 -208
- package/runtime/worker/ui.js +0 -763
- package/runtime/worker/utils.js +0 -16
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ClickEvent,
|
|
3
|
-
TouchStartEvent
|
|
4
|
-
} from "./chunk-4ZN32GYS.js";
|
|
5
|
-
import "./chunk-G5ZA3LKB.js";
|
|
6
|
-
import {
|
|
7
|
-
File as File2,
|
|
8
|
-
FormData,
|
|
9
|
-
Texture,
|
|
10
|
-
addEventListener,
|
|
11
|
-
fetch,
|
|
12
|
-
fetchLocal,
|
|
13
|
-
removeEventListener
|
|
14
|
-
} from "./chunk-MI3UXE5H.js";
|
|
15
|
-
|
|
16
|
-
// ../worker/src/utils/openFilePicker.ts
|
|
17
|
-
function openFilePicker(options = {}) {
|
|
18
|
-
return new Promise((res, rej) => {
|
|
19
|
-
_creatorUtils.openFilePicker((resp) => {
|
|
20
|
-
if (!resp || resp.length === 0) {
|
|
21
|
-
if (options.multiple) {
|
|
22
|
-
res([]);
|
|
23
|
-
} else {
|
|
24
|
-
res(null);
|
|
25
|
-
}
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (options.multiple) {
|
|
29
|
-
res(resp.map((i) => new File(i[0], i[1], i[2])));
|
|
30
|
-
} else {
|
|
31
|
-
res(new File(resp[0][0], resp[0][1], resp[0][2]));
|
|
32
|
-
}
|
|
33
|
-
}, rej, !!options.multiple, options.accept);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// ../worker/src/WebSocket.ts
|
|
38
|
-
var WebSocket = class {
|
|
39
|
-
_id = null;
|
|
40
|
-
url;
|
|
41
|
-
constructor(url, headers) {
|
|
42
|
-
this.url = url;
|
|
43
|
-
this._id = _creatorUtils.websocketOpen(this.url, (channel, data) => this.onMessage(channel, data), headers);
|
|
44
|
-
}
|
|
45
|
-
close() {
|
|
46
|
-
if (this._id != null) {
|
|
47
|
-
_creatorUtils.websocketClose(this._id);
|
|
48
|
-
this._id = null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
send(message) {
|
|
52
|
-
if (this._id != null) {
|
|
53
|
-
_creatorUtils.websocketSend(this._id, message);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
onMessage(channel, data) {
|
|
57
|
-
const listeners = this._listeners[channel];
|
|
58
|
-
if (!listeners || listeners.length === 0) return;
|
|
59
|
-
if (data) {
|
|
60
|
-
for (let listener of listeners) {
|
|
61
|
-
listener(data);
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
for (let listener of listeners) {
|
|
65
|
-
listener();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
_listeners = {};
|
|
70
|
-
addEventListener(channel, callback) {
|
|
71
|
-
if (!this._listeners[channel]) {
|
|
72
|
-
this._listeners[channel] = [callback];
|
|
73
|
-
} else {
|
|
74
|
-
this._listeners[channel].push(callback);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
removeEventListener(channel, callback) {
|
|
78
|
-
if (!this._listeners[channel]) return;
|
|
79
|
-
const index = this._listeners[channel].indexOf(callback);
|
|
80
|
-
if (index >= 0) {
|
|
81
|
-
this._listeners[channel].splice(index, 1);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
// ../worker/src/MediaPlayer.ts
|
|
87
|
-
var MediaPlayer = class {
|
|
88
|
-
_id = -1;
|
|
89
|
-
_src = "";
|
|
90
|
-
_playing = false;
|
|
91
|
-
_loop = false;
|
|
92
|
-
_volume = 1;
|
|
93
|
-
_listeners = {};
|
|
94
|
-
addEventListener(channel, callback) {
|
|
95
|
-
if (!this._listeners[channel]) {
|
|
96
|
-
this._listeners[channel] = [callback];
|
|
97
|
-
} else {
|
|
98
|
-
this._listeners[channel].push(callback);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
removeEventListener(channel, callback) {
|
|
102
|
-
if (!this._listeners[channel]) return;
|
|
103
|
-
const index = this._listeners[channel].indexOf(callback);
|
|
104
|
-
if (index >= 0) {
|
|
105
|
-
this._listeners[channel].splice(index, 1);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
play() {
|
|
109
|
-
this.playing = true;
|
|
110
|
-
}
|
|
111
|
-
pause() {
|
|
112
|
-
this.playing = false;
|
|
113
|
-
}
|
|
114
|
-
get playing() {
|
|
115
|
-
return this._playing;
|
|
116
|
-
}
|
|
117
|
-
set playing(value) {
|
|
118
|
-
this._playing = value;
|
|
119
|
-
_creatorUtils.updateMediaPlayerPlaying(this._id, this._playing);
|
|
120
|
-
}
|
|
121
|
-
get volume() {
|
|
122
|
-
return this._volume;
|
|
123
|
-
}
|
|
124
|
-
set volume(value) {
|
|
125
|
-
this._volume = value;
|
|
126
|
-
_creatorUtils.updateMediaPlayerVolume(this._id, value);
|
|
127
|
-
}
|
|
128
|
-
get loop() {
|
|
129
|
-
return this._loop;
|
|
130
|
-
}
|
|
131
|
-
set loop(value) {
|
|
132
|
-
this._loop = value;
|
|
133
|
-
_creatorUtils.updateMediaPlayerLoop(this._id, value);
|
|
134
|
-
}
|
|
135
|
-
finished() {
|
|
136
|
-
const _listener = this._listeners["loopReached"];
|
|
137
|
-
if (!_listener) return;
|
|
138
|
-
for (let listener of _listener) {
|
|
139
|
-
listener();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
var AudioPlayer = class extends MediaPlayer {
|
|
144
|
-
constructor(src) {
|
|
145
|
-
super();
|
|
146
|
-
this._src = src ?? "";
|
|
147
|
-
this._id = _creatorUtils.createAudioPlayer(this._src);
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
var VideoPlayer = class extends MediaPlayer {
|
|
151
|
-
_muted = false;
|
|
152
|
-
constructor(src) {
|
|
153
|
-
super();
|
|
154
|
-
this._src = src ?? "";
|
|
155
|
-
this._id = _creatorUtils.createVideoPlayer(this._src);
|
|
156
|
-
}
|
|
157
|
-
textureCreated = false;
|
|
158
|
-
get texture() {
|
|
159
|
-
const textureId = _creator.createMediaPlayerTexture(this._id);
|
|
160
|
-
return new Texture(0, 0, textureId);
|
|
161
|
-
}
|
|
162
|
-
resetTexture() {
|
|
163
|
-
this.textureCreated = false;
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// ../worker/src/globals.ts
|
|
168
|
-
var localStorage = {
|
|
169
|
-
getItem(key) {
|
|
170
|
-
return _creatorUtils.localStorageGetValue(key);
|
|
171
|
-
},
|
|
172
|
-
setItem(key, value) {
|
|
173
|
-
return _creatorUtils.localStorageSetValue(key, value);
|
|
174
|
-
},
|
|
175
|
-
removeItem(key) {
|
|
176
|
-
return _creatorUtils.localStorageRemoveValue(key);
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
var SvgSource = (svgCode) => {
|
|
180
|
-
return { svg: svgCode, tintColor: null };
|
|
181
|
-
};
|
|
182
|
-
var toast = (msg) => _creatorUI.toast(msg);
|
|
183
|
-
var device = {
|
|
184
|
-
get platform() {
|
|
185
|
-
return _creatorUtils.platform;
|
|
186
|
-
},
|
|
187
|
-
get language() {
|
|
188
|
-
return _creatorUtils.language;
|
|
189
|
-
},
|
|
190
|
-
addEventListener,
|
|
191
|
-
removeEventListener
|
|
192
|
-
};
|
|
193
|
-
export {
|
|
194
|
-
AudioPlayer,
|
|
195
|
-
ClickEvent,
|
|
196
|
-
File2 as File,
|
|
197
|
-
FormData,
|
|
198
|
-
SvgSource,
|
|
199
|
-
TouchStartEvent,
|
|
200
|
-
VideoPlayer,
|
|
201
|
-
WebSocket,
|
|
202
|
-
device,
|
|
203
|
-
fetch,
|
|
204
|
-
fetchLocal,
|
|
205
|
-
localStorage,
|
|
206
|
-
openFilePicker,
|
|
207
|
-
toast
|
|
208
|
-
};
|