@miurajs/miura-render 0.1.0 → 0.2.0

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 (263) hide show
  1. package/README.md +6 -6
  2. package/dist/index.d.ts +14 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +13 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/src/binding-manager/binding-manager.d.ts +30 -0
  7. package/dist/src/binding-manager/binding-manager.d.ts.map +1 -0
  8. package/dist/src/binding-manager/binding-manager.js +245 -0
  9. package/dist/src/binding-manager/binding-manager.js.map +1 -0
  10. package/dist/src/binding-manager/binding-type.d.ts +24 -0
  11. package/dist/src/binding-manager/binding-type.d.ts.map +1 -0
  12. package/dist/src/binding-manager/binding-type.js +25 -0
  13. package/dist/src/binding-manager/binding-type.js.map +1 -0
  14. package/dist/src/binding-manager/bindings/async-binding.d.ts +23 -0
  15. package/dist/src/binding-manager/bindings/async-binding.d.ts.map +1 -0
  16. package/dist/src/binding-manager/bindings/async-binding.js +67 -0
  17. package/dist/src/binding-manager/bindings/async-binding.js.map +1 -0
  18. package/dist/src/binding-manager/bindings/attribute-binding.d.ts +41 -0
  19. package/dist/src/binding-manager/bindings/attribute-binding.d.ts.map +1 -0
  20. package/dist/src/binding-manager/bindings/attribute-binding.js +79 -0
  21. package/dist/src/binding-manager/bindings/attribute-binding.js.map +1 -0
  22. package/dist/src/binding-manager/bindings/bind-binding.d.ts +30 -0
  23. package/dist/src/binding-manager/bindings/bind-binding.d.ts.map +1 -0
  24. package/dist/src/binding-manager/bindings/bind-binding.js +81 -0
  25. package/dist/src/binding-manager/bindings/bind-binding.js.map +1 -0
  26. package/dist/src/binding-manager/bindings/binding.d.ts +6 -0
  27. package/dist/src/binding-manager/bindings/binding.d.ts.map +1 -0
  28. package/dist/src/binding-manager/bindings/binding.js +2 -0
  29. package/dist/src/binding-manager/bindings/binding.js.map +1 -0
  30. package/dist/src/binding-manager/bindings/boolean-binding.d.ts +18 -0
  31. package/dist/src/binding-manager/bindings/boolean-binding.d.ts.map +1 -0
  32. package/dist/src/binding-manager/bindings/boolean-binding.js +65 -0
  33. package/dist/src/binding-manager/bindings/boolean-binding.js.map +1 -0
  34. package/dist/src/binding-manager/bindings/class-binding.d.ts +10 -0
  35. package/dist/src/binding-manager/bindings/class-binding.d.ts.map +1 -0
  36. package/dist/src/binding-manager/bindings/class-binding.js +68 -0
  37. package/dist/src/binding-manager/bindings/class-binding.js.map +1 -0
  38. package/dist/src/binding-manager/bindings/directive-binding.d.ts +15 -0
  39. package/dist/src/binding-manager/bindings/directive-binding.d.ts.map +1 -0
  40. package/dist/src/binding-manager/bindings/directive-binding.js +70 -0
  41. package/dist/src/binding-manager/bindings/directive-binding.js.map +1 -0
  42. package/dist/src/binding-manager/bindings/event-binding.d.ts +14 -0
  43. package/dist/src/binding-manager/bindings/event-binding.d.ts.map +1 -0
  44. package/dist/src/binding-manager/bindings/event-binding.js +73 -0
  45. package/dist/src/binding-manager/bindings/event-binding.js.map +1 -0
  46. package/dist/src/binding-manager/bindings/node-binding.d.ts +36 -0
  47. package/dist/src/binding-manager/bindings/node-binding.d.ts.map +1 -0
  48. package/dist/src/binding-manager/bindings/node-binding.js +235 -0
  49. package/dist/src/binding-manager/bindings/node-binding.js.map +1 -0
  50. package/dist/src/binding-manager/bindings/object-class-binding.d.ts +16 -0
  51. package/dist/src/binding-manager/bindings/object-class-binding.d.ts.map +1 -0
  52. package/dist/src/binding-manager/bindings/object-class-binding.js +42 -0
  53. package/dist/src/binding-manager/bindings/object-class-binding.js.map +1 -0
  54. package/dist/src/binding-manager/bindings/object-style-binding.d.ts +16 -0
  55. package/dist/src/binding-manager/bindings/object-style-binding.d.ts.map +1 -0
  56. package/dist/src/binding-manager/bindings/object-style-binding.js +38 -0
  57. package/dist/src/binding-manager/bindings/object-style-binding.js.map +1 -0
  58. package/dist/src/binding-manager/bindings/property-binding.d.ts +12 -0
  59. package/dist/src/binding-manager/bindings/property-binding.d.ts.map +1 -0
  60. package/dist/src/binding-manager/bindings/property-binding.js +44 -0
  61. package/dist/src/binding-manager/bindings/property-binding.js.map +1 -0
  62. package/dist/src/binding-manager/bindings/reference-binding.d.ts +14 -0
  63. package/dist/src/binding-manager/bindings/reference-binding.d.ts.map +1 -0
  64. package/dist/src/binding-manager/bindings/reference-binding.js +44 -0
  65. package/dist/src/binding-manager/bindings/reference-binding.js.map +1 -0
  66. package/dist/src/binding-manager/bindings/spread-binding.d.ts +16 -0
  67. package/dist/src/binding-manager/bindings/spread-binding.d.ts.map +1 -0
  68. package/dist/src/binding-manager/bindings/spread-binding.js +40 -0
  69. package/dist/src/binding-manager/bindings/spread-binding.js.map +1 -0
  70. package/dist/src/binding-manager/bindings/style-binding.d.ts +10 -0
  71. package/dist/src/binding-manager/bindings/style-binding.d.ts.map +1 -0
  72. package/dist/src/binding-manager/bindings/style-binding.js +44 -0
  73. package/dist/src/binding-manager/bindings/style-binding.js.map +1 -0
  74. package/dist/src/compiler/code-factory.d.ts +45 -0
  75. package/dist/src/compiler/code-factory.d.ts.map +1 -0
  76. package/dist/src/compiler/code-factory.js +211 -0
  77. package/dist/src/compiler/code-factory.js.map +1 -0
  78. package/dist/src/compiler/compiler.d.ts +77 -0
  79. package/dist/src/compiler/compiler.d.ts.map +1 -0
  80. package/dist/src/compiler/compiler.js +77 -0
  81. package/dist/src/compiler/compiler.js.map +1 -0
  82. package/dist/src/compiler/constants.d.ts +5 -0
  83. package/dist/src/compiler/constants.d.ts.map +1 -0
  84. package/dist/src/compiler/constants.js +9 -0
  85. package/dist/src/compiler/constants.js.map +1 -0
  86. package/dist/src/css-result.d.ts +27 -0
  87. package/dist/src/css-result.d.ts.map +1 -0
  88. package/dist/src/css-result.js +56 -0
  89. package/dist/src/css-result.js.map +1 -0
  90. package/dist/src/css.d.ts +26 -0
  91. package/dist/src/css.d.ts.map +1 -0
  92. package/dist/src/css.js +62 -0
  93. package/dist/src/css.js.map +1 -0
  94. package/dist/src/directives/animate.directive.d.ts +42 -0
  95. package/dist/src/directives/animate.directive.d.ts.map +1 -0
  96. package/dist/src/directives/animate.directive.js +349 -0
  97. package/dist/src/directives/animate.directive.js.map +1 -0
  98. package/dist/src/directives/await.d.ts +68 -0
  99. package/dist/src/directives/await.d.ts.map +1 -0
  100. package/dist/src/directives/await.js +70 -0
  101. package/dist/src/directives/await.js.map +1 -0
  102. package/dist/src/directives/choose.d.ts +28 -0
  103. package/dist/src/directives/choose.d.ts.map +1 -0
  104. package/dist/src/directives/choose.js +30 -0
  105. package/dist/src/directives/choose.js.map +1 -0
  106. package/dist/src/directives/decorator-example.d.ts +8 -0
  107. package/dist/src/directives/decorator-example.d.ts.map +1 -0
  108. package/dist/src/directives/decorator-example.js +32 -0
  109. package/dist/src/directives/decorator-example.js.map +1 -0
  110. package/dist/src/directives/decorators.d.ts +3 -0
  111. package/dist/src/directives/decorators.d.ts.map +1 -0
  112. package/dist/src/directives/decorators.js +17 -0
  113. package/dist/src/directives/decorators.js.map +1 -0
  114. package/dist/src/directives/directive-manager.d.ts +26 -0
  115. package/dist/src/directives/directive-manager.d.ts.map +1 -0
  116. package/dist/src/directives/directive-manager.js +114 -0
  117. package/dist/src/directives/directive-manager.js.map +1 -0
  118. package/dist/src/directives/directive.d.ts +38 -0
  119. package/dist/src/directives/directive.d.ts.map +1 -0
  120. package/dist/src/directives/directive.js +18 -0
  121. package/dist/src/directives/directive.js.map +1 -0
  122. package/dist/src/directives/focus.directive.d.ts +16 -0
  123. package/dist/src/directives/focus.directive.d.ts.map +1 -0
  124. package/dist/src/directives/focus.directive.js +29 -0
  125. package/dist/src/directives/focus.directive.js.map +1 -0
  126. package/dist/src/directives/gesture.directive.d.ts +58 -0
  127. package/dist/src/directives/gesture.directive.d.ts.map +1 -0
  128. package/dist/src/directives/gesture.directive.js +331 -0
  129. package/dist/src/directives/gesture.directive.js.map +1 -0
  130. package/dist/src/directives/index.d.ts +34 -0
  131. package/dist/src/directives/index.d.ts.map +1 -0
  132. package/dist/src/directives/index.js +35 -0
  133. package/dist/src/directives/index.js.map +1 -0
  134. package/dist/src/directives/intersection.directive.d.ts +18 -0
  135. package/dist/src/directives/intersection.directive.d.ts.map +1 -0
  136. package/dist/src/directives/intersection.directive.js +50 -0
  137. package/dist/src/directives/intersection.directive.js.map +1 -0
  138. package/dist/src/directives/keyed-diff.d.ts +30 -0
  139. package/dist/src/directives/keyed-diff.d.ts.map +1 -0
  140. package/dist/src/directives/keyed-diff.js +185 -0
  141. package/dist/src/directives/keyed-diff.js.map +1 -0
  142. package/dist/src/directives/lazy-setup.d.ts +3 -0
  143. package/dist/src/directives/lazy-setup.d.ts.map +1 -0
  144. package/dist/src/directives/lazy-setup.js +55 -0
  145. package/dist/src/directives/lazy-setup.js.map +1 -0
  146. package/dist/src/directives/lazy.directive.d.ts +19 -0
  147. package/dist/src/directives/lazy.directive.d.ts.map +1 -0
  148. package/dist/src/directives/lazy.directive.js +73 -0
  149. package/dist/src/directives/lazy.directive.js.map +1 -0
  150. package/dist/src/directives/media.directive.d.ts +31 -0
  151. package/dist/src/directives/media.directive.d.ts.map +1 -0
  152. package/dist/src/directives/media.directive.js +105 -0
  153. package/dist/src/directives/media.directive.js.map +1 -0
  154. package/dist/src/directives/mutation.directive.d.ts +11 -0
  155. package/dist/src/directives/mutation.directive.d.ts.map +1 -0
  156. package/dist/src/directives/mutation.directive.js +56 -0
  157. package/dist/src/directives/mutation.directive.js.map +1 -0
  158. package/dist/src/directives/repeat.d.ts +50 -0
  159. package/dist/src/directives/repeat.d.ts.map +1 -0
  160. package/dist/src/directives/repeat.js +47 -0
  161. package/dist/src/directives/repeat.js.map +1 -0
  162. package/dist/src/directives/resize.directive.d.ts +14 -0
  163. package/dist/src/directives/resize.directive.d.ts.map +1 -0
  164. package/dist/src/directives/resize.directive.js +81 -0
  165. package/dist/src/directives/resize.directive.js.map +1 -0
  166. package/dist/src/directives/setup.d.ts +9 -0
  167. package/dist/src/directives/setup.d.ts.map +1 -0
  168. package/dist/src/directives/setup.js +9 -0
  169. package/dist/src/directives/setup.js.map +1 -0
  170. package/dist/src/directives/structural/async.directive.d.ts +39 -0
  171. package/dist/src/directives/structural/async.directive.d.ts.map +1 -0
  172. package/dist/src/directives/structural/async.directive.js +115 -0
  173. package/dist/src/directives/structural/async.directive.js.map +1 -0
  174. package/dist/src/directives/structural/for.directive.d.ts +37 -0
  175. package/dist/src/directives/structural/for.directive.d.ts.map +1 -0
  176. package/dist/src/directives/structural/for.directive.js +209 -0
  177. package/dist/src/directives/structural/for.directive.js.map +1 -0
  178. package/dist/src/directives/structural/if.directive.d.ts +54 -0
  179. package/dist/src/directives/structural/if.directive.d.ts.map +1 -0
  180. package/dist/src/directives/structural/if.directive.js +210 -0
  181. package/dist/src/directives/structural/if.directive.js.map +1 -0
  182. package/dist/src/directives/structural/structural.directive.d.ts +11 -0
  183. package/dist/src/directives/structural/structural.directive.d.ts.map +1 -0
  184. package/dist/src/directives/structural/structural.directive.js +29 -0
  185. package/dist/src/directives/structural/structural.directive.js.map +1 -0
  186. package/dist/src/directives/structural/switch.directive.d.ts +12 -0
  187. package/dist/src/directives/structural/switch.directive.d.ts.map +1 -0
  188. package/dist/src/directives/structural/switch.directive.js +69 -0
  189. package/dist/src/directives/structural/switch.directive.js.map +1 -0
  190. package/dist/src/directives/structural/virtual-scroll.directive.d.ts +50 -0
  191. package/dist/src/directives/structural/virtual-scroll.directive.d.ts.map +1 -0
  192. package/dist/src/directives/structural/virtual-scroll.directive.js +165 -0
  193. package/dist/src/directives/structural/virtual-scroll.directive.js.map +1 -0
  194. package/dist/src/directives/utils.d.ts +61 -0
  195. package/dist/src/directives/utils.d.ts.map +1 -0
  196. package/dist/src/directives/utils.js +121 -0
  197. package/dist/src/directives/utils.js.map +1 -0
  198. package/dist/src/directives/validate.directive.d.ts +41 -0
  199. package/dist/src/directives/validate.directive.d.ts.map +1 -0
  200. package/dist/src/directives/validate.directive.js +161 -0
  201. package/dist/src/directives/validate.directive.js.map +1 -0
  202. package/dist/src/directives/virtual-scroll.d.ts +91 -0
  203. package/dist/src/directives/virtual-scroll.d.ts.map +1 -0
  204. package/dist/src/directives/virtual-scroll.js +78 -0
  205. package/dist/src/directives/virtual-scroll.js.map +1 -0
  206. package/dist/src/directives/when.d.ts +24 -0
  207. package/dist/src/directives/when.d.ts.map +1 -0
  208. package/dist/src/directives/when.js +25 -0
  209. package/dist/src/directives/when.js.map +1 -0
  210. package/dist/src/html.d.ts +23 -0
  211. package/dist/src/html.d.ts.map +1 -0
  212. package/dist/src/html.js +37 -0
  213. package/dist/src/html.js.map +1 -0
  214. package/dist/src/modifiers/capture-modifier.d.ts +6 -0
  215. package/dist/src/modifiers/capture-modifier.d.ts.map +1 -0
  216. package/dist/src/modifiers/capture-modifier.js +14 -0
  217. package/dist/src/modifiers/capture-modifier.js.map +1 -0
  218. package/dist/src/modifiers/event-modifiers.d.ts +38 -0
  219. package/dist/src/modifiers/event-modifiers.d.ts.map +1 -0
  220. package/dist/src/modifiers/event-modifiers.js +90 -0
  221. package/dist/src/modifiers/event-modifiers.js.map +1 -0
  222. package/dist/src/modifiers/key-modifiers.d.ts +8 -0
  223. package/dist/src/modifiers/key-modifiers.d.ts.map +1 -0
  224. package/dist/src/modifiers/key-modifiers.js +29 -0
  225. package/dist/src/modifiers/key-modifiers.js.map +1 -0
  226. package/dist/src/modifiers/mouse-modifiers.d.ts +8 -0
  227. package/dist/src/modifiers/mouse-modifiers.d.ts.map +1 -0
  228. package/dist/src/modifiers/mouse-modifiers.js +15 -0
  229. package/dist/src/modifiers/mouse-modifiers.js.map +1 -0
  230. package/dist/src/modifiers/once-modifier.d.ts +6 -0
  231. package/dist/src/modifiers/once-modifier.d.ts.map +1 -0
  232. package/dist/src/modifiers/once-modifier.js +11 -0
  233. package/dist/src/modifiers/once-modifier.js.map +1 -0
  234. package/dist/src/modifiers/passive-modifier.d.ts +6 -0
  235. package/dist/src/modifiers/passive-modifier.d.ts.map +1 -0
  236. package/dist/src/modifiers/passive-modifier.js +14 -0
  237. package/dist/src/modifiers/passive-modifier.js.map +1 -0
  238. package/dist/src/processor/parser.d.ts +74 -0
  239. package/dist/src/processor/parser.d.ts.map +1 -0
  240. package/dist/src/processor/parser.js +345 -0
  241. package/dist/src/processor/parser.js.map +1 -0
  242. package/dist/src/processor/processor.d.ts +68 -0
  243. package/dist/src/processor/processor.d.ts.map +1 -0
  244. package/dist/src/processor/processor.js +138 -0
  245. package/dist/src/processor/processor.js.map +1 -0
  246. package/dist/src/processor/template-result.d.ts +74 -0
  247. package/dist/src/processor/template-result.d.ts.map +1 -0
  248. package/dist/src/processor/template-result.js +53 -0
  249. package/dist/src/processor/template-result.js.map +1 -0
  250. package/dist/src/processor/types.d.ts +16 -0
  251. package/dist/src/processor/types.d.ts.map +1 -0
  252. package/dist/src/processor/types.js +13 -0
  253. package/dist/src/processor/types.js.map +1 -0
  254. package/dist/src/utils/debug.d.ts +7 -0
  255. package/dist/src/utils/debug.d.ts.map +1 -0
  256. package/dist/src/utils/debug.js +7 -0
  257. package/dist/src/utils/debug.js.map +1 -0
  258. package/dist/src/utils/performance.d.ts +50 -0
  259. package/dist/src/utils/performance.d.ts.map +1 -0
  260. package/dist/src/utils/performance.js +51 -0
  261. package/dist/src/utils/performance.js.map +1 -0
  262. package/dist/tsconfig.tsbuildinfo +1 -0
  263. package/package.json +8 -10
@@ -0,0 +1,23 @@
1
+ import { TemplateResult } from './processor/template-result';
2
+ export interface HtmlOptions {
3
+ compiledMode?: boolean;
4
+ }
5
+ /**
6
+ * Get performance metrics for html function
7
+ */
8
+ export declare function getHtmlMetrics(): {
9
+ callCount: number;
10
+ totalTime: number;
11
+ };
12
+ /**
13
+ * Reset performance metrics for html function
14
+ */
15
+ export declare function resetHtmlMetrics(): void;
16
+ export declare function html(strings: TemplateStringsArray, ...values: any[]): TemplateResult;
17
+ export { TemplateResult };
18
+ export declare enum ElementNamespace {
19
+ HTML = "http://www.w3.org/1999/xhtml",
20
+ SVG = "http://www.w3.org/2000/svg",
21
+ MathML = "http://www.w3.org/1998/Math/MathML"
22
+ }
23
+ //# sourceMappingURL=html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/html.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAUD;;GAEG;AACH,wBAAgB,cAAc;;;EAE7B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,SAG/B;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,cAAc,CAQpF;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,oBAAY,gBAAgB;IACxB,IAAI,iCAAiC;IACrC,GAAG,+BAA+B;IAClC,MAAM,uCAAuC;CAEhD"}
@@ -0,0 +1,37 @@
1
+ import { TemplateResult } from './processor/template-result';
2
+ /**
3
+ * Performance tracking for html function
4
+ */
5
+ const htmlMetrics = {
6
+ callCount: 0,
7
+ totalTime: 0
8
+ };
9
+ /**
10
+ * Get performance metrics for html function
11
+ */
12
+ export function getHtmlMetrics() {
13
+ return { ...htmlMetrics };
14
+ }
15
+ /**
16
+ * Reset performance metrics for html function
17
+ */
18
+ export function resetHtmlMetrics() {
19
+ htmlMetrics.callCount = 0;
20
+ htmlMetrics.totalTime = 0;
21
+ }
22
+ export function html(strings, ...values) {
23
+ const startTime = performance.now();
24
+ htmlMetrics.callCount++;
25
+ const result = new TemplateResult(strings, values);
26
+ htmlMetrics.totalTime = performance.now() - startTime;
27
+ return result;
28
+ }
29
+ export { TemplateResult };
30
+ export var ElementNamespace;
31
+ (function (ElementNamespace) {
32
+ ElementNamespace["HTML"] = "http://www.w3.org/1999/xhtml";
33
+ ElementNamespace["SVG"] = "http://www.w3.org/2000/svg";
34
+ ElementNamespace["MathML"] = "http://www.w3.org/1998/Math/MathML";
35
+ // Add other namespaces as needed
36
+ })(ElementNamespace || (ElementNamespace = {}));
37
+ //# sourceMappingURL=html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/html.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAM7D;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,EAAE,GAAG,WAAW,EAAE,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,WAAW,CAAC,SAAS,GAAG,CAAC,CAAC;IAC1B,WAAW,CAAC,SAAS,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,OAA6B,EAAE,GAAG,MAAa;IAClE,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IACpC,WAAW,CAAC,SAAS,EAAE,CAAC;IAExB,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAEnD,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IACtD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IACxB,yDAAqC,CAAA;IACrC,sDAAkC,CAAA;IAClC,iEAA6C,CAAA;IAC7C,iCAAiC;AACrC,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B"}
@@ -0,0 +1,6 @@
1
+ import { EventModifier } from "./event-modifiers";
2
+ export declare class CaptureModifier implements EventModifier {
3
+ apply(event: Event): boolean;
4
+ wrap(handler: EventListener): EventListener;
5
+ }
6
+ //# sourceMappingURL=capture-modifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-modifier.d.ts","sourceRoot":"","sources":["../../../src/modifiers/capture-modifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,qBAAa,eAAgB,YAAW,aAAa;IACjD,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAI5B,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa;CAQ9C"}
@@ -0,0 +1,14 @@
1
+ export class CaptureModifier {
2
+ apply(event) {
3
+ return true;
4
+ }
5
+ wrap(handler) {
6
+ return (event) => {
7
+ // Add capture option to event listener
8
+ const options = { capture: true };
9
+ handler(event);
10
+ return options;
11
+ };
12
+ }
13
+ }
14
+ //# sourceMappingURL=capture-modifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-modifier.js","sourceRoot":"","sources":["../../../src/modifiers/capture-modifier.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAe;IACxB,KAAK,CAAC,KAAY;QACd,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,OAAsB;QACvB,OAAO,CAAC,KAAY,EAAE,EAAE;YACpB,uCAAuC;YACvC,MAAM,OAAO,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAClC,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,OAAO,OAAO,CAAC;QACnB,CAAC,CAAC;IACN,CAAC;CACJ"}
@@ -0,0 +1,38 @@
1
+ import { KeyModifier } from "./key-modifiers";
2
+ import { OnceModifier } from "./once-modifier";
3
+ import { PassiveModifier } from "./passive-modifier";
4
+ import { CaptureModifier } from "./capture-modifier";
5
+ export interface EventModifier {
6
+ apply(event: Event): boolean;
7
+ }
8
+ export declare class PreventModifier implements EventModifier {
9
+ apply(event: Event): boolean;
10
+ }
11
+ export declare class StopModifier implements EventModifier {
12
+ apply(event: Event): boolean;
13
+ }
14
+ export declare class DebounceModifier implements EventModifier {
15
+ private wait;
16
+ private timeout;
17
+ constructor(wait?: number);
18
+ apply(event: Event): boolean;
19
+ wrap(handler: EventListener): EventListener;
20
+ }
21
+ export declare class ThrottleModifier implements EventModifier {
22
+ private wait;
23
+ private lastRun;
24
+ constructor(wait?: number);
25
+ apply(event: Event): boolean;
26
+ wrap(handler: EventListener): EventListener;
27
+ }
28
+ export declare const EVENT_MODIFIERS: {
29
+ prevent: () => PreventModifier;
30
+ stop: () => StopModifier;
31
+ debounce: (wait?: number) => DebounceModifier;
32
+ throttle: (wait?: number) => ThrottleModifier;
33
+ key: (key: string) => KeyModifier;
34
+ once: () => OnceModifier;
35
+ passive: () => PassiveModifier;
36
+ capture: () => CaptureModifier;
37
+ };
38
+ //# sourceMappingURL=event-modifiers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-modifiers.d.ts","sourceRoot":"","sources":["../../../src/modifiers/event-modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,WAAW,aAAa;IAC1B,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;CAChC;AAaD,qBAAa,eAAgB,YAAW,aAAa;IACjD,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;CAI/B;AAED,qBAAa,YAAa,YAAW,aAAa;IAC9C,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;CAI/B;AAGD,qBAAa,gBAAiB,YAAW,aAAa;IAGtC,OAAO,CAAC,IAAI;IAFxB,OAAO,CAAC,OAAO,CAAuB;gBAElB,IAAI,GAAE,MAAY;IAEtC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAI5B,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa;CAuB9C;AAED,qBAAa,gBAAiB,YAAW,aAAa;IAGtC,OAAO,CAAC,IAAI;IAFxB,OAAO,CAAC,OAAO,CAAa;gBAER,IAAI,GAAE,MAAY;IAEtC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAI5B,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa;CAW9C;AAGD,eAAO,MAAM,eAAe;;;sBAGN,MAAM;sBACN,MAAM;eACb,MAAM;;;;CAIpB,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { KeyModifier } from "./key-modifiers";
2
+ import { OnceModifier } from "./once-modifier";
3
+ import { PassiveModifier } from "./passive-modifier";
4
+ import { CaptureModifier } from "./capture-modifier";
5
+ import { debugLog } from "../utils/debug";
6
+ // Add debug logging to each modifier
7
+ function logModifier(name, result, event) {
8
+ debugLog('modifier', `${name} modifier:`, {
9
+ result,
10
+ eventType: event.type,
11
+ event
12
+ });
13
+ return result;
14
+ }
15
+ // Basic modifiers
16
+ export class PreventModifier {
17
+ apply(event) {
18
+ event.preventDefault();
19
+ return true;
20
+ }
21
+ }
22
+ export class StopModifier {
23
+ apply(event) {
24
+ event.stopPropagation();
25
+ return true;
26
+ }
27
+ }
28
+ // Time-based modifiers
29
+ export class DebounceModifier {
30
+ wait;
31
+ timeout = null;
32
+ constructor(wait = 250) {
33
+ this.wait = wait;
34
+ }
35
+ apply(event) {
36
+ return true; // Let the wrapper handle it
37
+ }
38
+ wrap(handler) {
39
+ return (event) => {
40
+ // Preserve the event and its properties
41
+ const target = event.target;
42
+ const value = target.value;
43
+ if (this.timeout) {
44
+ clearTimeout(this.timeout);
45
+ }
46
+ this.timeout = window.setTimeout(() => {
47
+ // Create a new event with the preserved value
48
+ const newEvent = new Event(event.type, {
49
+ bubbles: event.bubbles,
50
+ cancelable: event.cancelable
51
+ });
52
+ Object.defineProperty(newEvent, 'target', { value: target });
53
+ handler(newEvent);
54
+ this.timeout = null;
55
+ }, this.wait);
56
+ };
57
+ }
58
+ }
59
+ export class ThrottleModifier {
60
+ wait;
61
+ lastRun = 0;
62
+ constructor(wait = 250) {
63
+ this.wait = wait;
64
+ }
65
+ apply(event) {
66
+ return true; // Let the wrapper handle it
67
+ }
68
+ wrap(handler) {
69
+ return (event) => {
70
+ const now = Date.now();
71
+ // If enough time has passed since last run
72
+ if (now - this.lastRun >= this.wait) {
73
+ handler(event);
74
+ this.lastRun = now;
75
+ }
76
+ };
77
+ }
78
+ }
79
+ // Collection of available modifiers
80
+ export const EVENT_MODIFIERS = {
81
+ prevent: () => new PreventModifier(),
82
+ stop: () => new StopModifier(),
83
+ debounce: (wait) => new DebounceModifier(wait),
84
+ throttle: (wait) => new ThrottleModifier(wait),
85
+ key: (key) => new KeyModifier(key),
86
+ once: () => new OnceModifier(),
87
+ passive: () => new PassiveModifier(),
88
+ capture: () => new CaptureModifier()
89
+ };
90
+ //# sourceMappingURL=event-modifiers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-modifiers.js","sourceRoot":"","sources":["../../../src/modifiers/event-modifiers.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,8 @@
1
+ import { EventModifier } from "./event-modifiers";
2
+ export declare class KeyModifier implements EventModifier {
3
+ private key;
4
+ private keyMap;
5
+ constructor(key: string);
6
+ apply(event: Event): boolean;
7
+ }
8
+ //# sourceMappingURL=key-modifiers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-modifiers.d.ts","sourceRoot":"","sources":["../../../src/modifiers/key-modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,qBAAa,WAAY,YAAW,aAAa;IAOjC,OAAO,CAAC,GAAG;IANvB,OAAO,CAAC,MAAM,CAIZ;gBAEkB,GAAG,EAAE,MAAM;IAO/B,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;CAgB/B"}
@@ -0,0 +1,29 @@
1
+ export class KeyModifier {
2
+ key;
3
+ keyMap = {
4
+ 'enter': 'Enter',
5
+ 'escape': 'Escape',
6
+ 'space': ' '
7
+ };
8
+ constructor(key) {
9
+ this.key = key;
10
+ if (!key) {
11
+ throw new Error('Key must be specified for KeyModifier');
12
+ }
13
+ console.log('KeyModifier created with key:', key);
14
+ }
15
+ apply(event) {
16
+ if (!(event instanceof KeyboardEvent)) {
17
+ return false;
18
+ }
19
+ const targetKey = this.keyMap[this.key.toLowerCase()] || this.key;
20
+ const eventKey = event.key;
21
+ console.log('KeyModifier check:', {
22
+ targetKey,
23
+ eventKey,
24
+ matches: eventKey === targetKey
25
+ });
26
+ return eventKey === targetKey;
27
+ }
28
+ }
29
+ //# sourceMappingURL=key-modifiers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-modifiers.js","sourceRoot":"","sources":["../../../src/modifiers/key-modifiers.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,WAAW;IAOA;IANZ,MAAM,GAA2B;QACrC,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,GAAG;KACf,CAAC;IAEF,YAAoB,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;QAC3B,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,GAAG,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,KAAY;QACd,IAAI,CAAC,CAAC,KAAK,YAAY,aAAa,CAAC,EAAE,CAAC;YACpC,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC;QAClE,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC;QAE3B,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE;YAC9B,SAAS;YACT,QAAQ;YACR,OAAO,EAAE,QAAQ,KAAK,SAAS;SAClC,CAAC,CAAC;QAEH,OAAO,QAAQ,KAAK,SAAS,CAAC;IAClC,CAAC;CACJ"}
@@ -0,0 +1,8 @@
1
+ import { EventModifier } from "./event-modifiers";
2
+ export declare class MouseButtonModifier implements EventModifier {
3
+ private button;
4
+ private buttonMap;
5
+ constructor(button: keyof typeof this.buttonMap);
6
+ apply(event: MouseEvent): boolean;
7
+ }
8
+ //# sourceMappingURL=mouse-modifiers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mouse-modifiers.d.ts","sourceRoot":"","sources":["../../../src/modifiers/mouse-modifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,qBAAa,mBAAoB,YAAW,aAAa;IAOzC,OAAO,CAAC,MAAM;IAN1B,OAAO,CAAC,SAAS,CAIf;gBAEkB,MAAM,EAAE,MAAM,OAAO,IAAI,CAAC,SAAS;IAEvD,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;CAGpC"}
@@ -0,0 +1,15 @@
1
+ export class MouseButtonModifier {
2
+ button;
3
+ buttonMap = {
4
+ 'left': 0,
5
+ 'middle': 1,
6
+ 'right': 2
7
+ };
8
+ constructor(button) {
9
+ this.button = button;
10
+ }
11
+ apply(event) {
12
+ return event.button === this.buttonMap[this.button];
13
+ }
14
+ }
15
+ //# sourceMappingURL=mouse-modifiers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mouse-modifiers.js","sourceRoot":"","sources":["../../../src/modifiers/mouse-modifiers.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,mBAAmB;IAOR;IANZ,SAAS,GAAG;QAChB,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;KACb,CAAC;IAEF,YAAoB,MAAmC;QAAnC,WAAM,GAAN,MAAM,CAA6B;IAAG,CAAC;IAE3D,KAAK,CAAC,KAAiB;QACnB,OAAO,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;CACJ"}
@@ -0,0 +1,6 @@
1
+ import { EventModifier } from "./event-modifiers";
2
+ export declare class OnceModifier implements EventModifier {
3
+ private hasRun;
4
+ apply(event: Event): boolean;
5
+ }
6
+ //# sourceMappingURL=once-modifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"once-modifier.d.ts","sourceRoot":"","sources":["../../../src/modifiers/once-modifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,qBAAa,YAAa,YAAW,aAAa;IAC9C,OAAO,CAAC,MAAM,CAAS;IAEvB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;CAM/B"}
@@ -0,0 +1,11 @@
1
+ export class OnceModifier {
2
+ hasRun = false;
3
+ apply(event) {
4
+ console.log('OnceModifier:', { hasRun: this.hasRun });
5
+ if (this.hasRun)
6
+ return false;
7
+ this.hasRun = true;
8
+ return true;
9
+ }
10
+ }
11
+ //# sourceMappingURL=once-modifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"once-modifier.js","sourceRoot":"","sources":["../../../src/modifiers/once-modifier.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,YAAY;IACb,MAAM,GAAG,KAAK,CAAC;IAEvB,KAAK,CAAC,KAAY;QACd,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACtD,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
@@ -0,0 +1,6 @@
1
+ import { EventModifier } from "./event-modifiers";
2
+ export declare class PassiveModifier implements EventModifier {
3
+ apply(event: Event): boolean;
4
+ wrap(handler: EventListener): EventListener;
5
+ }
6
+ //# sourceMappingURL=passive-modifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passive-modifier.d.ts","sourceRoot":"","sources":["../../../src/modifiers/passive-modifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,qBAAa,eAAgB,YAAW,aAAa;IACjD,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAI5B,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa;CAQ9C"}
@@ -0,0 +1,14 @@
1
+ export class PassiveModifier {
2
+ apply(event) {
3
+ return true;
4
+ }
5
+ wrap(handler) {
6
+ return (event) => {
7
+ // Add passive option to event listener
8
+ const options = { passive: true };
9
+ handler(event);
10
+ return options;
11
+ };
12
+ }
13
+ }
14
+ //# sourceMappingURL=passive-modifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passive-modifier.js","sourceRoot":"","sources":["../../../src/modifiers/passive-modifier.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAe;IACxB,KAAK,CAAC,KAAY;QACd,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,OAAsB;QACvB,OAAO,CAAC,KAAY,EAAE,EAAE;YACpB,uCAAuC;YACvC,MAAM,OAAO,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAClC,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,OAAO,OAAO,CAAC;QACnB,CAAC,CAAC;IACN,CAAC;CACJ"}
@@ -0,0 +1,74 @@
1
+ import { BindingType } from './template-result';
2
+ /**
3
+ * Represents a template binding.
4
+ * @interface TemplateBinding
5
+ */
6
+ export interface TemplateBinding {
7
+ /** The type of the binding */
8
+ type: BindingType;
9
+ /** The name of the binding (optional) */
10
+ name?: string;
11
+ /** The index of the binding */
12
+ index: number;
13
+ /** Event modifiers (optional) */
14
+ modifiers?: string[];
15
+ /** For multi-part attribute bindings: static string segments (N+1 entries for N values) */
16
+ strings?: string[];
17
+ /** For multi-part attribute bindings: which part this is (0-based) */
18
+ partIndex?: number;
19
+ /** For multi-part attribute bindings: index of the first binding in the group */
20
+ groupStart?: number;
21
+ }
22
+ /**
23
+ * Represents the result of parsing a template string.
24
+ * @interface ParsedTemplate
25
+ */
26
+ export interface ParsedTemplate {
27
+ /** The HTML string with binding markers */
28
+ html: string;
29
+ /** Array of template bindings found in the HTML */
30
+ bindings: TemplateBinding[];
31
+ }
32
+ /**
33
+ * Parser for HTML templates with binding markers.
34
+ * Uses a state machine to correctly handle expressions in any context:
35
+ * text content, single-expression attributes, and multi-expression attributes.
36
+ */
37
+ export declare class TemplateParser {
38
+ private static BINDING_MARKER;
39
+ private static ATTRIBUTE_PREFIX_REGEX;
40
+ /**
41
+ * Performance tracking
42
+ */
43
+ private metrics;
44
+ /**
45
+ * Get performance metrics
46
+ */
47
+ getPerformanceMetrics(): {
48
+ parseTime: number;
49
+ parseCount: number;
50
+ cacheHits: number;
51
+ cacheMisses: number;
52
+ };
53
+ /**
54
+ * Reset performance metrics
55
+ */
56
+ resetMetrics(): void;
57
+ /**
58
+ * Parses template strings and extracts bindings.
59
+ * Handles text/node bindings, single-expression attribute bindings,
60
+ * and multi-expression attribute bindings (e.g. style="color: ${a}; bg: ${b}").
61
+ */
62
+ parse(strings: TemplateStringsArray): ParsedTemplate;
63
+ /**
64
+ * After an attribute value closes, determine the final binding type(s) for the group.
65
+ * Single-expression attributes with special prefixes/names use specialized types.
66
+ * Multi-expression or plain attributes use BindingType.Attribute.
67
+ */
68
+ private finalizeAttrGroup;
69
+ /**
70
+ * Determine the specialized binding type for a single-expression attribute.
71
+ */
72
+ private getSpecializedType;
73
+ }
74
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/processor/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,8BAA8B;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC/B;AA6BD;;;;GAIG;AACH,qBAAa,cAAc;IACvB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAc;IAC3C,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAyB;IAE9D;;OAEG;IACH,OAAO,CAAC,OAAO,CAKb;IAEF;;OAEG;IACH,qBAAqB;;;;;;IAIrB;;OAEG;IACH,YAAY;IASZ;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,oBAAoB,GAAG,cAAc;IA6QpD;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAiBzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;CA8B7B"}