elit 3.5.6 → 3.5.8

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 (128) 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/dist/build.d.ts +1 -1
  26. package/dist/cli.cjs +16 -2
  27. package/dist/cli.mjs +16 -2
  28. package/dist/config.d.ts +1 -1
  29. package/dist/coverage.d.ts +1 -1
  30. package/dist/desktop-auto-render.cjs +2370 -0
  31. package/dist/desktop-auto-render.d.ts +13 -0
  32. package/dist/desktop-auto-render.js +2341 -0
  33. package/dist/desktop-auto-render.mjs +2344 -0
  34. package/dist/render-context.cjs +118 -0
  35. package/dist/render-context.d.ts +39 -0
  36. package/dist/render-context.js +77 -0
  37. package/dist/render-context.mjs +87 -0
  38. package/dist/{server-CNgDUgSZ.d.ts → server-FCdUqabc.d.ts} +1 -1
  39. package/dist/server.d.ts +1 -1
  40. package/package.json +26 -3
  41. package/dist/build.d.mts +0 -20
  42. package/dist/chokidar.d.mts +0 -134
  43. package/dist/cli.d.mts +0 -81
  44. package/dist/config.d.mts +0 -254
  45. package/dist/coverage.d.mts +0 -85
  46. package/dist/database.d.mts +0 -52
  47. package/dist/desktop.d.mts +0 -68
  48. package/dist/dom.d.mts +0 -87
  49. package/dist/el.d.mts +0 -208
  50. package/dist/fs.d.mts +0 -255
  51. package/dist/hmr.d.mts +0 -38
  52. package/dist/http.d.mts +0 -169
  53. package/dist/https.d.mts +0 -108
  54. package/dist/index.d.mts +0 -13
  55. package/dist/mime-types.d.mts +0 -48
  56. package/dist/native.d.mts +0 -136
  57. package/dist/path.d.mts +0 -163
  58. package/dist/router.d.mts +0 -49
  59. package/dist/runtime.d.mts +0 -97
  60. package/dist/server-D0Dp4R5z.d.mts +0 -449
  61. package/dist/server.d.mts +0 -7
  62. package/dist/state.d.mts +0 -117
  63. package/dist/style.d.mts +0 -232
  64. package/dist/test-reporter.d.mts +0 -77
  65. package/dist/test-runtime.d.mts +0 -122
  66. package/dist/test.d.mts +0 -39
  67. package/dist/types.d.mts +0 -586
  68. package/dist/universal.d.mts +0 -21
  69. package/dist/ws.d.mts +0 -200
  70. package/dist/wss.d.mts +0 -108
  71. package/src/build.ts +0 -362
  72. package/src/chokidar.ts +0 -427
  73. package/src/cli.ts +0 -1162
  74. package/src/config.ts +0 -509
  75. package/src/coverage.ts +0 -1479
  76. package/src/database.ts +0 -1410
  77. package/src/desktop-auto-render.ts +0 -317
  78. package/src/desktop-cli.ts +0 -1533
  79. package/src/desktop.ts +0 -99
  80. package/src/dev-build.ts +0 -340
  81. package/src/dom.ts +0 -901
  82. package/src/el.ts +0 -183
  83. package/src/fs.ts +0 -609
  84. package/src/hmr.ts +0 -149
  85. package/src/http.ts +0 -856
  86. package/src/https.ts +0 -411
  87. package/src/index.ts +0 -16
  88. package/src/mime-types.ts +0 -222
  89. package/src/mobile-cli.ts +0 -2313
  90. package/src/native-background.ts +0 -444
  91. package/src/native-border.ts +0 -343
  92. package/src/native-canvas.ts +0 -260
  93. package/src/native-cli.ts +0 -414
  94. package/src/native-color.ts +0 -904
  95. package/src/native-estimation.ts +0 -194
  96. package/src/native-grid.ts +0 -590
  97. package/src/native-interaction.ts +0 -1289
  98. package/src/native-layout.ts +0 -568
  99. package/src/native-link.ts +0 -76
  100. package/src/native-render-support.ts +0 -361
  101. package/src/native-spacing.ts +0 -231
  102. package/src/native-state.ts +0 -318
  103. package/src/native-strings.ts +0 -46
  104. package/src/native-transform.ts +0 -120
  105. package/src/native-types.ts +0 -439
  106. package/src/native-typography.ts +0 -254
  107. package/src/native-units.ts +0 -441
  108. package/src/native-vector.ts +0 -910
  109. package/src/native.ts +0 -5606
  110. package/src/path.ts +0 -493
  111. package/src/pm-cli.ts +0 -2498
  112. package/src/preview-build.ts +0 -294
  113. package/src/render-context.ts +0 -138
  114. package/src/router.ts +0 -260
  115. package/src/runtime.ts +0 -97
  116. package/src/server.ts +0 -2294
  117. package/src/state.ts +0 -556
  118. package/src/style.ts +0 -1790
  119. package/src/test-globals.d.ts +0 -184
  120. package/src/test-reporter.ts +0 -609
  121. package/src/test-runtime.ts +0 -1359
  122. package/src/test.ts +0 -368
  123. package/src/types.ts +0 -381
  124. package/src/universal.ts +0 -81
  125. package/src/wapk-cli.ts +0 -3213
  126. package/src/workspace-package.ts +0 -102
  127. package/src/ws.ts +0 -648
  128. package/src/wss.ts +0 -241
package/src/el.ts DELETED
@@ -1,183 +0,0 @@
1
- /**
2
- * Elit - Element Factories
3
- */
4
-
5
- import type { VNode, Child, Props, ElementFactory } from './types';
6
-
7
- /**
8
- * Helper: Check if document is available (eliminates duplication in document checks)
9
- */
10
- const hasDocument = typeof document !== 'undefined';
11
-
12
- /**
13
- * Helper: Capitalize first letter (eliminates duplication in tag name processing)
14
- */
15
- function capitalize(str: string): string {
16
- return str.charAt(0).toUpperCase() + str.slice(1);
17
- }
18
-
19
- /**
20
- * Helper: Bind document method safely (eliminates duplication in document method binding)
21
- */
22
- function bindDocMethod<T extends Function>(method: T | undefined): T | undefined {
23
- return hasDocument && method ? method.bind(doc) : undefined as any;
24
- }
25
-
26
- /**
27
- * Helper: Create prefixed element factories (eliminates duplication in factory creation)
28
- */
29
- function createPrefixedFactories(tags: readonly string[], prefix: string, elements: any): void {
30
- tags.forEach(tag => {
31
- const name = prefix + capitalize(tag);
32
- elements[name] = createElementFactory(tag);
33
- });
34
- }
35
-
36
- export const createElementFactory = (tag: string): ElementFactory => {
37
- return function(props?: Props | Child | null, ...rest: Child[]): VNode {
38
- if (!arguments.length) return { tagName: tag, props: {}, children: [] };
39
-
40
- const isState = props && typeof props === 'object' && 'value' in props && 'subscribe' in props;
41
- const isVNode = props && typeof props === 'object' && 'tagName' in props;
42
- const isChild = typeof props !== 'object' || Array.isArray(props) || props === null || isState || isVNode;
43
-
44
- const actualProps: Props = isChild ? {} : props as Props;
45
- const args: Child[] = isChild ? [props as Child, ...rest] : rest;
46
-
47
- if (!args.length) return { tagName: tag, props: actualProps, children: [] };
48
-
49
- const flatChildren: Child[] = [];
50
- for (let i = 0, len = args.length; i < len; i++) {
51
- const child = args[i];
52
- if (child == null || child === false) continue;
53
-
54
- if (Array.isArray(child)) {
55
- for (let j = 0, cLen = child.length; j < cLen; j++) {
56
- const c = child[j];
57
- c != null && c !== false && flatChildren.push(c);
58
- }
59
- } else {
60
- flatChildren.push(child);
61
- }
62
- }
63
-
64
- return { tagName: tag, props: actualProps, children: flatChildren };
65
- } as ElementFactory;
66
- };
67
-
68
- // HTML Tags
69
- const tags = [
70
- 'html', 'head', 'body', 'title', 'base', 'link', 'meta', 'style',
71
- 'address', 'article', 'aside', 'footer', 'header', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'main', 'nav', 'section',
72
- 'blockquote', 'dd', 'div', 'dl', 'dt', 'figcaption', 'figure', 'hr', 'li', 'ol', 'p', 'pre', 'ul',
73
- 'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'code', 'data', 'dfn', 'em', 'i', 'kbd', 'mark', 'q',
74
- 'rp', 'rt', 'ruby', 's', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'time', 'u', 'wbr',
75
- 'area', 'audio', 'img', 'map', 'track', 'video',
76
- 'embed', 'iframe', 'object', 'param', 'picture', 'portal', 'source',
77
- 'canvas', 'noscript', 'script',
78
- 'del', 'ins',
79
- 'caption', 'col', 'colgroup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr',
80
- 'button', 'datalist', 'fieldset', 'form', 'input', 'label', 'legend', 'meter',
81
- 'optgroup', 'option', 'output', 'progress', 'select', 'textarea',
82
- 'details', 'dialog', 'menu', 'summary',
83
- 'slot', 'template'
84
- ] as const;
85
-
86
- // SVG Tags
87
- const svgTags = [
88
- 'svg', 'circle', 'rect', 'path', 'line', 'polyline', 'polygon', 'ellipse', 'g', 'text', 'tspan',
89
- 'defs', 'linearGradient', 'radialGradient', 'stop', 'pattern', 'mask', 'clipPath', 'use', 'symbol',
90
- 'marker', 'image', 'foreignObject', 'animate', 'animateTransform', 'animateMotion', 'set', 'filter',
91
- 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting',
92
- 'feDisplacementMap', 'feFlood', 'feGaussianBlur', 'feMorphology', 'feOffset', 'feSpecularLighting',
93
- 'feTile', 'feTurbulence'
94
- ] as const;
95
-
96
- // MathML Tags
97
- const mathTags = [
98
- 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'mrow', 'mfrac', 'msqrt', 'mroot', 'msub', 'msup'
99
- ] as const;
100
-
101
- type Elements = {
102
- [K in typeof tags[number]]: ElementFactory;
103
- } & {
104
- [K in typeof svgTags[number] as `svg${Capitalize<K>}`]: ElementFactory;
105
- } & {
106
- [K in typeof mathTags[number] as `math${Capitalize<K>}`]: ElementFactory;
107
- } & {
108
- varElement: ElementFactory;
109
- };
110
-
111
- const elements: Partial<Elements> = {};
112
-
113
- tags.forEach(tag => {
114
- (elements as any)[tag] = createElementFactory(tag);
115
- });
116
-
117
- createPrefixedFactories(svgTags, 'svg', elements);
118
- createPrefixedFactories(mathTags, 'math', elements);
119
-
120
- (elements as any).varElement = createElementFactory('var');
121
-
122
- // Export all element factories
123
- export const {
124
- html, head, body, title, base, link, meta, style,
125
- address, article, aside, footer, header, h1, h2, h3, h4, h5, h6, main, nav, section,
126
- blockquote, dd, div, dl, dt, figcaption, figure, hr, li, ol, p, pre, ul,
127
- a, abbr, b, bdi, bdo, br, cite, code, data, dfn, em, i, kbd, mark, q,
128
- rp, rt, ruby, s, samp, small, span, strong, sub, sup, time, u, wbr,
129
- area, audio, img, map, track, video,
130
- embed, iframe, object, param, picture, portal, source,
131
- canvas, noscript, script,
132
- del, ins,
133
- caption, col, colgroup, table, tbody, td, tfoot, th, thead, tr,
134
- button, datalist, fieldset, form, input, label, legend, meter,
135
- optgroup, option, output, progress, select, textarea,
136
- details, dialog, menu, summary,
137
- slot, template,
138
- svgSvg, svgCircle, svgRect, svgPath, svgLine, svgPolyline, svgPolygon, svgEllipse, svgG, svgText, svgTspan,
139
- svgDefs, svgLinearGradient, svgRadialGradient, svgStop, svgPattern, svgMask, svgClipPath, svgUse, svgSymbol,
140
- svgMarker, svgImage, svgForeignObject, svgAnimate, svgAnimateTransform, svgAnimateMotion, svgSet, svgFilter,
141
- svgFeBlend, svgFeColorMatrix, svgFeComponentTransfer, svgFeComposite, svgFeConvolveMatrix, svgFeDiffuseLighting,
142
- svgFeDisplacementMap, svgFeFlood, svgFeGaussianBlur, svgFeMorphology, svgFeOffset, svgFeSpecularLighting,
143
- svgFeTile, svgFeTurbulence,
144
- mathMath, mathMi, mathMn, mathMo, mathMs, mathMtext, mathMrow, mathMfrac, mathMsqrt, mathMroot, mathMsub, mathMsup,
145
- varElement
146
- } = elements as Elements;
147
- export const el = elements;
148
- // Export elements object for dynamic access
149
- export { elements };
150
- // Fragment element factory - groups children without a wrapper element
151
- // Similar to React's Fragment: <><div>1</div><div>2</div></>
152
- export const frag: ElementFactory = function(...children: Child[]): VNode {
153
- const flatChildren: Child[] = [];
154
- for (let i = 0, len = children.length; i < len; i++) {
155
- const child = children[i];
156
- if (child == null || child === false) continue;
157
-
158
- if (Array.isArray(child)) {
159
- for (let j = 0, cLen = child.length; j < cLen; j++) {
160
- const c = child[j];
161
- c != null && c !== false && flatChildren.push(c);
162
- }
163
- } else {
164
- flatChildren.push(child);
165
- }
166
- }
167
- return { tagName: '', props: {}, children: flatChildren };
168
- } as ElementFactory;
169
-
170
- // DOM utility functions - Shorthand helpers for common document operations
171
- export const doc = hasDocument ? document : undefined as any;
172
- export const getEl = bindDocMethod(doc?.querySelector);
173
- export const getEls = bindDocMethod(doc?.querySelectorAll);
174
- export const createEl = bindDocMethod(doc?.createElement);
175
- export const createSvgEl = hasDocument ? doc.createElementNS.bind(doc, 'http://www.w3.org/2000/svg') : undefined as any;
176
- export const createMathEl = hasDocument ? doc.createElementNS.bind(doc, 'http://www.w3.org/1998/Math/MathML') : undefined as any;
177
- export const fragment = bindDocMethod(doc?.createDocumentFragment);
178
- export const textNode = bindDocMethod(doc?.createTextNode);
179
- export const commentNode = bindDocMethod(doc?.createComment);
180
- export const getElId = bindDocMethod(doc?.getElementById);
181
- export const getElClass = bindDocMethod(doc?.getElementsByClassName);
182
- export const getElTag = bindDocMethod(doc?.getElementsByTagName);
183
- export const getElName = bindDocMethod(doc?.getElementsByName);