elit 3.5.6 → 3.5.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 (113) hide show
  1. package/Cargo.toml +1 -1
  2. package/README.md +1 -1
  3. package/desktop/build.rs +83 -0
  4. package/desktop/icon.rs +106 -0
  5. package/desktop/lib.rs +2 -0
  6. package/desktop/main.rs +235 -0
  7. package/desktop/native_main.rs +128 -0
  8. package/desktop/native_renderer/action_widgets.rs +184 -0
  9. package/desktop/native_renderer/app_models.rs +171 -0
  10. package/desktop/native_renderer/app_runtime.rs +140 -0
  11. package/desktop/native_renderer/container_rendering.rs +610 -0
  12. package/desktop/native_renderer/content_widgets.rs +634 -0
  13. package/desktop/native_renderer/css_models.rs +371 -0
  14. package/desktop/native_renderer/embedded_surfaces.rs +414 -0
  15. package/desktop/native_renderer/form_controls.rs +516 -0
  16. package/desktop/native_renderer/interaction_dispatch.rs +89 -0
  17. package/desktop/native_renderer/runtime_support.rs +135 -0
  18. package/desktop/native_renderer/utilities.rs +495 -0
  19. package/desktop/native_renderer/vector_drawing.rs +491 -0
  20. package/desktop/native_renderer.rs +4122 -0
  21. package/desktop/runtime/external.rs +422 -0
  22. package/desktop/runtime/mod.rs +67 -0
  23. package/desktop/runtime/quickjs.rs +106 -0
  24. package/desktop/window.rs +383 -0
  25. package/package.json +6 -3
  26. package/dist/build.d.mts +0 -20
  27. package/dist/chokidar.d.mts +0 -134
  28. package/dist/cli.d.mts +0 -81
  29. package/dist/config.d.mts +0 -254
  30. package/dist/coverage.d.mts +0 -85
  31. package/dist/database.d.mts +0 -52
  32. package/dist/desktop.d.mts +0 -68
  33. package/dist/dom.d.mts +0 -87
  34. package/dist/el.d.mts +0 -208
  35. package/dist/fs.d.mts +0 -255
  36. package/dist/hmr.d.mts +0 -38
  37. package/dist/http.d.mts +0 -169
  38. package/dist/https.d.mts +0 -108
  39. package/dist/index.d.mts +0 -13
  40. package/dist/mime-types.d.mts +0 -48
  41. package/dist/native.d.mts +0 -136
  42. package/dist/path.d.mts +0 -163
  43. package/dist/router.d.mts +0 -49
  44. package/dist/runtime.d.mts +0 -97
  45. package/dist/server-D0Dp4R5z.d.mts +0 -449
  46. package/dist/server.d.mts +0 -7
  47. package/dist/state.d.mts +0 -117
  48. package/dist/style.d.mts +0 -232
  49. package/dist/test-reporter.d.mts +0 -77
  50. package/dist/test-runtime.d.mts +0 -122
  51. package/dist/test.d.mts +0 -39
  52. package/dist/types.d.mts +0 -586
  53. package/dist/universal.d.mts +0 -21
  54. package/dist/ws.d.mts +0 -200
  55. package/dist/wss.d.mts +0 -108
  56. package/src/build.ts +0 -362
  57. package/src/chokidar.ts +0 -427
  58. package/src/cli.ts +0 -1162
  59. package/src/config.ts +0 -509
  60. package/src/coverage.ts +0 -1479
  61. package/src/database.ts +0 -1410
  62. package/src/desktop-auto-render.ts +0 -317
  63. package/src/desktop-cli.ts +0 -1533
  64. package/src/desktop.ts +0 -99
  65. package/src/dev-build.ts +0 -340
  66. package/src/dom.ts +0 -901
  67. package/src/el.ts +0 -183
  68. package/src/fs.ts +0 -609
  69. package/src/hmr.ts +0 -149
  70. package/src/http.ts +0 -856
  71. package/src/https.ts +0 -411
  72. package/src/index.ts +0 -16
  73. package/src/mime-types.ts +0 -222
  74. package/src/mobile-cli.ts +0 -2313
  75. package/src/native-background.ts +0 -444
  76. package/src/native-border.ts +0 -343
  77. package/src/native-canvas.ts +0 -260
  78. package/src/native-cli.ts +0 -414
  79. package/src/native-color.ts +0 -904
  80. package/src/native-estimation.ts +0 -194
  81. package/src/native-grid.ts +0 -590
  82. package/src/native-interaction.ts +0 -1289
  83. package/src/native-layout.ts +0 -568
  84. package/src/native-link.ts +0 -76
  85. package/src/native-render-support.ts +0 -361
  86. package/src/native-spacing.ts +0 -231
  87. package/src/native-state.ts +0 -318
  88. package/src/native-strings.ts +0 -46
  89. package/src/native-transform.ts +0 -120
  90. package/src/native-types.ts +0 -439
  91. package/src/native-typography.ts +0 -254
  92. package/src/native-units.ts +0 -441
  93. package/src/native-vector.ts +0 -910
  94. package/src/native.ts +0 -5606
  95. package/src/path.ts +0 -493
  96. package/src/pm-cli.ts +0 -2498
  97. package/src/preview-build.ts +0 -294
  98. package/src/render-context.ts +0 -138
  99. package/src/router.ts +0 -260
  100. package/src/runtime.ts +0 -97
  101. package/src/server.ts +0 -2294
  102. package/src/state.ts +0 -556
  103. package/src/style.ts +0 -1790
  104. package/src/test-globals.d.ts +0 -184
  105. package/src/test-reporter.ts +0 -609
  106. package/src/test-runtime.ts +0 -1359
  107. package/src/test.ts +0 -368
  108. package/src/types.ts +0 -381
  109. package/src/universal.ts +0 -81
  110. package/src/wapk-cli.ts +0 -3213
  111. package/src/workspace-package.ts +0 -102
  112. package/src/ws.ts +0 -648
  113. package/src/wss.ts +0 -241
package/src/path.ts DELETED
@@ -1,493 +0,0 @@
1
- /**
2
- * Path module with unified API across runtimes
3
- * Pure implementation without external dependencies
4
- * Compatible with Node.js 'path' module API
5
- * Works on Node.js, Bun, and Deno
6
- */
7
-
8
- import { isBun, isDeno, isNode, runtime } from './runtime';
9
-
10
- /**
11
- * Helper: Get path separator for platform (eliminates duplication in separator logic)
12
- */
13
- function getSeparator(isWin: boolean): string {
14
- return isWin ? '\\' : '/';
15
- }
16
-
17
- /**
18
- * Helper: Get current working directory (eliminates duplication in resolvePaths)
19
- */
20
- function getCwd(): string {
21
- if (isNode || isBun) {
22
- return process.cwd();
23
- } else if (isDeno) {
24
- // @ts-ignore
25
- return Deno.cwd();
26
- }
27
- return '/';
28
- }
29
-
30
- /**
31
- * Helper: Find last separator index (eliminates duplication in getExtname and getBasename)
32
- */
33
- function findLastSeparator(path: string): number {
34
- return Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\'));
35
- }
36
-
37
- /**
38
- * Helper: Create path operation object (eliminates duplication in posix and win32)
39
- */
40
- function createPathOps(isWin: boolean) {
41
- return {
42
- sep: getSeparator(isWin),
43
- delimiter: isWin ? ';' : ':',
44
- normalize: (path: string) => normalizePath(path, isWin),
45
- join: (...paths: string[]) => joinPaths(paths, isWin),
46
- resolve: (...paths: string[]) => resolvePaths(paths, isWin),
47
- isAbsolute: (path: string) => isWin ? isAbsoluteWin(path) : isAbsolutePosix(path),
48
- relative: (from: string, to: string) => relativePath(from, to, isWin),
49
- dirname: (path: string) => getDirname(path, isWin),
50
- basename: (path: string, ext?: string) => getBasename(path, ext, isWin),
51
- extname: (path: string) => getExtname(path),
52
- parse: (path: string) => parsePath(path, isWin),
53
- format: (pathObject: FormatInputPathObject) => formatPath(pathObject, isWin)
54
- };
55
- }
56
-
57
- /**
58
- * Helper: Check if path is absolute (POSIX)
59
- */
60
- function isAbsolutePosix(path: string): boolean {
61
- return path.length > 0 && path[0] === '/';
62
- }
63
-
64
- /**
65
- * Helper: Check if path is absolute (Windows)
66
- */
67
- function isAbsoluteWin(path: string): boolean {
68
- const len = path.length;
69
- if (len === 0) return false;
70
-
71
- const code = path.charCodeAt(0);
72
- if (code === 47 /* / */ || code === 92 /* \ */) {
73
- return true;
74
- }
75
-
76
- // Check for drive letter
77
- if ((code >= 65 && code <= 90) || (code >= 97 && code <= 122)) {
78
- if (len > 2 && path.charCodeAt(1) === 58 /* : */) {
79
- const code2 = path.charCodeAt(2);
80
- if (code2 === 47 /* / */ || code2 === 92 /* \ */) {
81
- return true;
82
- }
83
- }
84
- }
85
-
86
- return false;
87
- }
88
-
89
- /**
90
- * Platform detection
91
- */
92
- const isWindows = (() => {
93
- if (isNode) {
94
- return process.platform === 'win32';
95
- } else if (isDeno) {
96
- // @ts-ignore
97
- return Deno.build.os === 'windows';
98
- }
99
- // Bun uses process.platform like Node
100
- return typeof process !== 'undefined' && process.platform === 'win32';
101
- })();
102
-
103
- /**
104
- * Path separator
105
- */
106
- export const sep = isWindows ? '\\' : '/';
107
-
108
- /**
109
- * Path delimiter
110
- */
111
- export const delimiter = isWindows ? ';' : ':';
112
-
113
- /**
114
- * POSIX path operations
115
- */
116
- const posix = createPathOps(false);
117
-
118
- /**
119
- * Windows path operations
120
- */
121
- const win32 = createPathOps(true);
122
-
123
- /**
124
- * Path object interface
125
- */
126
- export interface ParsedPath {
127
- root: string;
128
- dir: string;
129
- base: string;
130
- ext: string;
131
- name: string;
132
- }
133
-
134
- export interface FormatInputPathObject {
135
- root?: string;
136
- dir?: string;
137
- base?: string;
138
- ext?: string;
139
- name?: string;
140
- }
141
-
142
- /**
143
- * Normalize a path
144
- */
145
- function normalizePath(path: string, isWin: boolean): string {
146
- if (path.length === 0) return '.';
147
-
148
- const separator = getSeparator(isWin);
149
- const isAbsolute = isWin ? isAbsoluteWin(path) : isAbsolutePosix(path);
150
- const trailingSeparator = path[path.length - 1] === separator || (isWin && path[path.length - 1] === '/');
151
-
152
- // Normalize slashes
153
- let normalized = path.replace(isWin ? /[\/\\]+/g : /\/+/g, separator);
154
-
155
- // Split path
156
- const parts = normalized.split(separator);
157
- const result: string[] = [];
158
-
159
- for (let i = 0; i < parts.length; i++) {
160
- const part = parts[i];
161
-
162
- if (part === '' || part === '.') {
163
- if (i === 0 && isAbsolute) result.push('');
164
- continue;
165
- }
166
-
167
- if (part === '..') {
168
- if (result.length > 0 && result[result.length - 1] !== '..') {
169
- if (!(result.length === 1 && result[0] === '')) {
170
- result.pop();
171
- }
172
- } else if (!isAbsolute) {
173
- result.push('..');
174
- }
175
- } else {
176
- result.push(part);
177
- }
178
- }
179
-
180
- let final = result.join(separator);
181
-
182
- if (final.length === 0) {
183
- return isAbsolute ? separator : '.';
184
- }
185
-
186
- if (trailingSeparator && final[final.length - 1] !== separator) {
187
- final += separator;
188
- }
189
-
190
- return final;
191
- }
192
-
193
- /**
194
- * Join paths
195
- */
196
- function joinPaths(paths: string[], isWin: boolean): string {
197
- if (paths.length === 0) return '.';
198
-
199
- const separator = getSeparator(isWin);
200
- let joined = '';
201
- for (let i = 0; i < paths.length; i++) {
202
- const path = paths[i];
203
- if (path && path.length > 0) {
204
- if (joined.length === 0) {
205
- joined = path;
206
- } else {
207
- joined += separator + path;
208
- }
209
- }
210
- }
211
-
212
- if (joined.length === 0) return '.';
213
-
214
- return normalizePath(joined, isWin);
215
- }
216
-
217
- /**
218
- * Resolve paths to absolute path
219
- */
220
- function resolvePaths(paths: string[], isWin: boolean): string {
221
- const separator = getSeparator(isWin);
222
- let resolved = '';
223
- let isAbsolute = false;
224
-
225
- for (let i = paths.length - 1; i >= 0 && !isAbsolute; i--) {
226
- const path = paths[i];
227
- if (path && path.length > 0) {
228
- resolved = path + (resolved.length > 0 ? separator + resolved : '');
229
- isAbsolute = isWin ? isAbsoluteWin(resolved) : isAbsolutePosix(resolved);
230
- }
231
- }
232
-
233
- if (!isAbsolute) {
234
- const cwd = getCwd();
235
- resolved = cwd + (resolved.length > 0 ? separator + resolved : '');
236
- }
237
-
238
- return normalizePath(resolved, isWin);
239
- }
240
-
241
- /**
242
- * Get relative path
243
- */
244
- function relativePath(from: string, to: string, isWin: boolean): string {
245
- from = resolvePaths([from], isWin);
246
- to = resolvePaths([to], isWin);
247
-
248
- if (from === to) return '';
249
-
250
- const separator = getSeparator(isWin);
251
- const fromParts = from.split(separator).filter(p => p.length > 0);
252
- const toParts = to.split(separator).filter(p => p.length > 0);
253
-
254
- let commonLength = 0;
255
- const minLength = Math.min(fromParts.length, toParts.length);
256
-
257
- for (let i = 0; i < minLength; i++) {
258
- if (fromParts[i] === toParts[i]) {
259
- commonLength++;
260
- } else {
261
- break;
262
- }
263
- }
264
-
265
- const upCount = fromParts.length - commonLength;
266
- const result: string[] = [];
267
-
268
- for (let i = 0; i < upCount; i++) {
269
- result.push('..');
270
- }
271
-
272
- for (let i = commonLength; i < toParts.length; i++) {
273
- result.push(toParts[i]);
274
- }
275
-
276
- return result.join(separator) || '.';
277
- }
278
-
279
- /**
280
- * Get directory name
281
- */
282
- function getDirname(path: string, isWin: boolean): string {
283
- if (path.length === 0) return '.';
284
-
285
- const separator = getSeparator(isWin);
286
- const normalized = normalizePath(path, isWin);
287
- const lastSepIndex = normalized.lastIndexOf(separator);
288
-
289
- if (lastSepIndex === -1) return '.';
290
- if (lastSepIndex === 0) return separator;
291
-
292
- return normalized.slice(0, lastSepIndex);
293
- }
294
-
295
- /**
296
- * Get base name
297
- */
298
- function getBasename(path: string, ext?: string, isWin?: boolean): string {
299
- if (path.length === 0) return '';
300
-
301
- const lastSepIndex = isWin ? findLastSeparator(path) : path.lastIndexOf('/');
302
- let base = lastSepIndex === -1 ? path : path.slice(lastSepIndex + 1);
303
-
304
- if (ext && base.endsWith(ext)) {
305
- base = base.slice(0, base.length - ext.length);
306
- }
307
-
308
- return base;
309
- }
310
-
311
- /**
312
- * Get extension name
313
- */
314
- function getExtname(path: string): string {
315
- const lastDotIndex = path.lastIndexOf('.');
316
- const lastSepIndex = findLastSeparator(path);
317
-
318
- if (lastDotIndex === -1 || lastDotIndex < lastSepIndex || lastDotIndex === path.length - 1) {
319
- return '';
320
- }
321
-
322
- return path.slice(lastDotIndex);
323
- }
324
-
325
- /**
326
- * Parse path into components
327
- */
328
- function parsePath(path: string, isWin: boolean): ParsedPath {
329
- let root = '';
330
- if (isWin) {
331
- // Check for Windows drive letter
332
- if (path.length >= 2 && path[1] === ':') {
333
- root = path.slice(0, 2);
334
- if (path.length > 2 && (path[2] === '\\' || path[2] === '/')) {
335
- root += '\\';
336
- }
337
- } else if (path[0] === '\\' || path[0] === '/') {
338
- root = '\\';
339
- }
340
- } else {
341
- if (path[0] === '/') {
342
- root = '/';
343
- }
344
- }
345
-
346
- const dir = getDirname(path, isWin);
347
- const base = getBasename(path, undefined, isWin);
348
- const ext = getExtname(path);
349
- const name = ext ? base.slice(0, base.length - ext.length) : base;
350
-
351
- return { root, dir, base, ext, name };
352
- }
353
-
354
- /**
355
- * Format path from components
356
- */
357
- function formatPath(pathObject: FormatInputPathObject, isWin: boolean): string {
358
- const separator = getSeparator(isWin);
359
- const dir = pathObject.dir || pathObject.root || '';
360
- const base = pathObject.base || ((pathObject.name || '') + (pathObject.ext || ''));
361
-
362
- if (!dir) return base;
363
- if (dir === pathObject.root) return dir + base;
364
-
365
- return dir + separator + base;
366
- }
367
-
368
- /**
369
- * Normalize a path (platform-specific)
370
- */
371
- export function normalize(path: string): string {
372
- return normalizePath(path, isWindows);
373
- }
374
-
375
- /**
376
- * Join paths (platform-specific)
377
- */
378
- export function join(...paths: string[]): string {
379
- return joinPaths(paths, isWindows);
380
- }
381
-
382
- /**
383
- * Resolve paths to absolute path (platform-specific)
384
- */
385
- export function resolve(...paths: string[]): string {
386
- return resolvePaths(paths, isWindows);
387
- }
388
-
389
- /**
390
- * Check if path is absolute (platform-specific)
391
- */
392
- export function isAbsolute(path: string): boolean {
393
- return isWindows ? win32.isAbsolute(path) : posix.isAbsolute(path);
394
- }
395
-
396
- /**
397
- * Get relative path (platform-specific)
398
- */
399
- export function relative(from: string, to: string): string {
400
- return relativePath(from, to, isWindows);
401
- }
402
-
403
- /**
404
- * Get directory name (platform-specific)
405
- */
406
- export function dirname(path: string): string {
407
- return getDirname(path, isWindows);
408
- }
409
-
410
- /**
411
- * Get base name (platform-specific)
412
- */
413
- export function basename(path: string, ext?: string): string {
414
- return getBasename(path, ext, isWindows);
415
- }
416
-
417
- /**
418
- * Get extension name
419
- */
420
- export function extname(path: string): string {
421
- return getExtname(path);
422
- }
423
-
424
- /**
425
- * Parse path into components (platform-specific)
426
- */
427
- export function parse(path: string): ParsedPath {
428
- return parsePath(path, isWindows);
429
- }
430
-
431
- /**
432
- * Format path from components (platform-specific)
433
- */
434
- export function format(pathObject: FormatInputPathObject): string {
435
- return formatPath(pathObject, isWindows);
436
- }
437
-
438
- /**
439
- * Convert to namespaced path (Windows only)
440
- */
441
- export function toNamespacedPath(path: string): string {
442
- if (!isWindows || path.length === 0) return path;
443
-
444
- const resolved = resolve(path);
445
-
446
- if (resolved.length >= 3) {
447
- if (resolved[0] === '\\') {
448
- // UNC path
449
- if (resolved[1] === '\\' && resolved[2] !== '?') {
450
- return '\\\\?\\UNC\\' + resolved.slice(2);
451
- }
452
- } else if (resolved[1] === ':' && resolved[2] === '\\') {
453
- // Drive letter
454
- return '\\\\?\\' + resolved;
455
- }
456
- }
457
-
458
- return path;
459
- }
460
-
461
- /**
462
- * Get current runtime
463
- */
464
- export function getRuntime(): 'node' | 'bun' | 'deno' {
465
- return runtime;
466
- }
467
-
468
- /**
469
- * Export POSIX and Win32 implementations
470
- */
471
- export { posix, win32 };
472
-
473
- /**
474
- * Default export
475
- */
476
- export default {
477
- sep,
478
- delimiter,
479
- normalize,
480
- join,
481
- resolve,
482
- isAbsolute,
483
- relative,
484
- dirname,
485
- basename,
486
- extname,
487
- parse,
488
- format,
489
- toNamespacedPath,
490
- posix,
491
- win32,
492
- getRuntime,
493
- };