lecodes-cli 0.1.5 → 0.1.7

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.
Files changed (81) hide show
  1. package/dist/index.js +300 -149
  2. package/package.json +5 -3
  3. package/runtime/sdk/animate/animate.ts +238 -0
  4. package/runtime/sdk/animate/bezier.ts +138 -0
  5. package/runtime/sdk/animate/easings.ts +126 -0
  6. package/runtime/sdk/core/color.ts +66 -0
  7. package/runtime/sdk/core/events.ts +38 -0
  8. package/runtime/sdk/core/registry.ts +23 -0
  9. package/runtime/sdk/g2/Camera2D.ts +73 -0
  10. package/runtime/sdk/g2/Node2D.ts +104 -0
  11. package/runtime/sdk/g2/Scene2D.ts +73 -0
  12. package/runtime/sdk/g2/Sprite.ts +164 -0
  13. package/runtime/sdk/g2/Texture2D.ts +37 -0
  14. package/runtime/sdk/g2/Tilemap.ts +41 -0
  15. package/runtime/sdk/g2/loop.ts +22 -0
  16. package/runtime/sdk/gl/Body.ts +101 -0
  17. package/runtime/sdk/gl/Camera.ts +40 -0
  18. package/runtime/sdk/gl/Geometry.ts +218 -0
  19. package/runtime/sdk/gl/Light.ts +37 -0
  20. package/runtime/sdk/gl/Material.ts +124 -0
  21. package/runtime/sdk/gl/Mesh.ts +123 -0
  22. package/runtime/sdk/gl/Node.ts +307 -0
  23. package/runtime/sdk/gl/Noise.ts +30 -0
  24. package/runtime/sdk/gl/Particles.ts +185 -0
  25. package/runtime/sdk/gl/Plane.ts +53 -0
  26. package/runtime/sdk/gl/Ray.ts +16 -0
  27. package/runtime/sdk/gl/Scene.ts +179 -0
  28. package/runtime/sdk/gl/Texture.ts +35 -0
  29. package/runtime/sdk/gl/controls.ts +95 -0
  30. package/runtime/sdk/gl/state.ts +6 -0
  31. package/runtime/sdk/gl/touch.ts +56 -0
  32. package/runtime/sdk/inject.ts +72 -0
  33. package/runtime/sdk/math/Mathf.ts +118 -0
  34. package/runtime/sdk/math/mat4.ts +278 -0
  35. package/runtime/sdk/math/quat.ts +232 -0
  36. package/runtime/sdk/math/vec.ts +255 -0
  37. package/runtime/sdk/plugins/qr.ts +36 -0
  38. package/runtime/sdk/runtime/device.ts +33 -0
  39. package/runtime/sdk/runtime/fetch.ts +71 -0
  40. package/runtime/sdk/runtime/files.ts +23 -0
  41. package/runtime/sdk/runtime/input.ts +12 -0
  42. package/runtime/sdk/runtime/media.ts +111 -0
  43. package/runtime/sdk/runtime/misc.ts +12 -0
  44. package/runtime/sdk/runtime/net.ts +36 -0
  45. package/runtime/sdk/runtime/storage.ts +13 -0
  46. package/runtime/sdk/runtime/touch.ts +44 -0
  47. package/runtime/sdk/ui/UI.ts +19 -0
  48. package/runtime/sdk/ui/UIButton.ts +84 -0
  49. package/runtime/sdk/ui/UIContainer.ts +100 -0
  50. package/runtime/sdk/ui/UIImage.ts +68 -0
  51. package/runtime/sdk/ui/UIInput.ts +78 -0
  52. package/runtime/sdk/ui/UINode.ts +342 -0
  53. package/runtime/sdk/ui/UIScreen.ts +122 -0
  54. package/runtime/sdk/ui/UIScrollable.ts +70 -0
  55. package/runtime/sdk/ui/UISpacer.ts +14 -0
  56. package/runtime/sdk/ui/UIText.ts +40 -0
  57. package/runtime/sdk/ui/UIVideo.ts +38 -0
  58. package/runtime/sdk/ui/UIVirtualizedList.ts +222 -0
  59. package/runtime/sdk/ui/UIWidget.ts +97 -0
  60. package/runtime/sdk/ui/fonts.ts +10 -0
  61. package/runtime/sdk/ui/router.ts +73 -0
  62. package/runtime/gl-matrix/common.js +0 -54
  63. package/runtime/gl-matrix/header.js +0 -12
  64. package/runtime/gl-matrix/index.js +0 -11
  65. package/runtime/gl-matrix/mat2.js +0 -425
  66. package/runtime/gl-matrix/mat2d.js +0 -476
  67. package/runtime/gl-matrix/mat3.js +0 -765
  68. package/runtime/gl-matrix/mat4.js +0 -1947
  69. package/runtime/gl-matrix/quat.js +0 -737
  70. package/runtime/gl-matrix/quat2.js +0 -822
  71. package/runtime/gl-matrix/vec2.js +0 -620
  72. package/runtime/gl-matrix/vec3.js +0 -791
  73. package/runtime/gl-matrix/vec4.js +0 -652
  74. package/runtime/worker/animate.js +0 -304
  75. package/runtime/worker/chunk-4ZN32GYS.js +0 -34
  76. package/runtime/worker/chunk-G5ZA3LKB.js +0 -52
  77. package/runtime/worker/chunk-MI3UXE5H.js +0 -1395
  78. package/runtime/worker/creator.js +0 -930
  79. package/runtime/worker/globals.js +0 -208
  80. package/runtime/worker/ui.js +0 -763
  81. 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
- };