@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.
- package/README.md +6 -6
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/src/binding-manager/binding-manager.d.ts +30 -0
- package/dist/src/binding-manager/binding-manager.d.ts.map +1 -0
- package/dist/src/binding-manager/binding-manager.js +245 -0
- package/dist/src/binding-manager/binding-manager.js.map +1 -0
- package/dist/src/binding-manager/binding-type.d.ts +24 -0
- package/dist/src/binding-manager/binding-type.d.ts.map +1 -0
- package/dist/src/binding-manager/binding-type.js +25 -0
- package/dist/src/binding-manager/binding-type.js.map +1 -0
- package/dist/src/binding-manager/bindings/async-binding.d.ts +23 -0
- package/dist/src/binding-manager/bindings/async-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/async-binding.js +67 -0
- package/dist/src/binding-manager/bindings/async-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/attribute-binding.d.ts +41 -0
- package/dist/src/binding-manager/bindings/attribute-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/attribute-binding.js +79 -0
- package/dist/src/binding-manager/bindings/attribute-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/bind-binding.d.ts +30 -0
- package/dist/src/binding-manager/bindings/bind-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/bind-binding.js +81 -0
- package/dist/src/binding-manager/bindings/bind-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/binding.d.ts +6 -0
- package/dist/src/binding-manager/bindings/binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/binding.js +2 -0
- package/dist/src/binding-manager/bindings/binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/boolean-binding.d.ts +18 -0
- package/dist/src/binding-manager/bindings/boolean-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/boolean-binding.js +65 -0
- package/dist/src/binding-manager/bindings/boolean-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/class-binding.d.ts +10 -0
- package/dist/src/binding-manager/bindings/class-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/class-binding.js +68 -0
- package/dist/src/binding-manager/bindings/class-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/directive-binding.d.ts +15 -0
- package/dist/src/binding-manager/bindings/directive-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/directive-binding.js +70 -0
- package/dist/src/binding-manager/bindings/directive-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/event-binding.d.ts +14 -0
- package/dist/src/binding-manager/bindings/event-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/event-binding.js +73 -0
- package/dist/src/binding-manager/bindings/event-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/node-binding.d.ts +36 -0
- package/dist/src/binding-manager/bindings/node-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/node-binding.js +235 -0
- package/dist/src/binding-manager/bindings/node-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/object-class-binding.d.ts +16 -0
- package/dist/src/binding-manager/bindings/object-class-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/object-class-binding.js +42 -0
- package/dist/src/binding-manager/bindings/object-class-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/object-style-binding.d.ts +16 -0
- package/dist/src/binding-manager/bindings/object-style-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/object-style-binding.js +38 -0
- package/dist/src/binding-manager/bindings/object-style-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/property-binding.d.ts +12 -0
- package/dist/src/binding-manager/bindings/property-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/property-binding.js +44 -0
- package/dist/src/binding-manager/bindings/property-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/reference-binding.d.ts +14 -0
- package/dist/src/binding-manager/bindings/reference-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/reference-binding.js +44 -0
- package/dist/src/binding-manager/bindings/reference-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/spread-binding.d.ts +16 -0
- package/dist/src/binding-manager/bindings/spread-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/spread-binding.js +40 -0
- package/dist/src/binding-manager/bindings/spread-binding.js.map +1 -0
- package/dist/src/binding-manager/bindings/style-binding.d.ts +10 -0
- package/dist/src/binding-manager/bindings/style-binding.d.ts.map +1 -0
- package/dist/src/binding-manager/bindings/style-binding.js +44 -0
- package/dist/src/binding-manager/bindings/style-binding.js.map +1 -0
- package/dist/src/compiler/code-factory.d.ts +45 -0
- package/dist/src/compiler/code-factory.d.ts.map +1 -0
- package/dist/src/compiler/code-factory.js +211 -0
- package/dist/src/compiler/code-factory.js.map +1 -0
- package/dist/src/compiler/compiler.d.ts +77 -0
- package/dist/src/compiler/compiler.d.ts.map +1 -0
- package/dist/src/compiler/compiler.js +77 -0
- package/dist/src/compiler/compiler.js.map +1 -0
- package/dist/src/compiler/constants.d.ts +5 -0
- package/dist/src/compiler/constants.d.ts.map +1 -0
- package/dist/src/compiler/constants.js +9 -0
- package/dist/src/compiler/constants.js.map +1 -0
- package/dist/src/css-result.d.ts +27 -0
- package/dist/src/css-result.d.ts.map +1 -0
- package/dist/src/css-result.js +56 -0
- package/dist/src/css-result.js.map +1 -0
- package/dist/src/css.d.ts +26 -0
- package/dist/src/css.d.ts.map +1 -0
- package/dist/src/css.js +62 -0
- package/dist/src/css.js.map +1 -0
- package/dist/src/directives/animate.directive.d.ts +42 -0
- package/dist/src/directives/animate.directive.d.ts.map +1 -0
- package/dist/src/directives/animate.directive.js +349 -0
- package/dist/src/directives/animate.directive.js.map +1 -0
- package/dist/src/directives/await.d.ts +68 -0
- package/dist/src/directives/await.d.ts.map +1 -0
- package/dist/src/directives/await.js +70 -0
- package/dist/src/directives/await.js.map +1 -0
- package/dist/src/directives/choose.d.ts +28 -0
- package/dist/src/directives/choose.d.ts.map +1 -0
- package/dist/src/directives/choose.js +30 -0
- package/dist/src/directives/choose.js.map +1 -0
- package/dist/src/directives/decorator-example.d.ts +8 -0
- package/dist/src/directives/decorator-example.d.ts.map +1 -0
- package/dist/src/directives/decorator-example.js +32 -0
- package/dist/src/directives/decorator-example.js.map +1 -0
- package/dist/src/directives/decorators.d.ts +3 -0
- package/dist/src/directives/decorators.d.ts.map +1 -0
- package/dist/src/directives/decorators.js +17 -0
- package/dist/src/directives/decorators.js.map +1 -0
- package/dist/src/directives/directive-manager.d.ts +26 -0
- package/dist/src/directives/directive-manager.d.ts.map +1 -0
- package/dist/src/directives/directive-manager.js +114 -0
- package/dist/src/directives/directive-manager.js.map +1 -0
- package/dist/src/directives/directive.d.ts +38 -0
- package/dist/src/directives/directive.d.ts.map +1 -0
- package/dist/src/directives/directive.js +18 -0
- package/dist/src/directives/directive.js.map +1 -0
- package/dist/src/directives/focus.directive.d.ts +16 -0
- package/dist/src/directives/focus.directive.d.ts.map +1 -0
- package/dist/src/directives/focus.directive.js +29 -0
- package/dist/src/directives/focus.directive.js.map +1 -0
- package/dist/src/directives/gesture.directive.d.ts +58 -0
- package/dist/src/directives/gesture.directive.d.ts.map +1 -0
- package/dist/src/directives/gesture.directive.js +331 -0
- package/dist/src/directives/gesture.directive.js.map +1 -0
- package/dist/src/directives/index.d.ts +34 -0
- package/dist/src/directives/index.d.ts.map +1 -0
- package/dist/src/directives/index.js +35 -0
- package/dist/src/directives/index.js.map +1 -0
- package/dist/src/directives/intersection.directive.d.ts +18 -0
- package/dist/src/directives/intersection.directive.d.ts.map +1 -0
- package/dist/src/directives/intersection.directive.js +50 -0
- package/dist/src/directives/intersection.directive.js.map +1 -0
- package/dist/src/directives/keyed-diff.d.ts +30 -0
- package/dist/src/directives/keyed-diff.d.ts.map +1 -0
- package/dist/src/directives/keyed-diff.js +185 -0
- package/dist/src/directives/keyed-diff.js.map +1 -0
- package/dist/src/directives/lazy-setup.d.ts +3 -0
- package/dist/src/directives/lazy-setup.d.ts.map +1 -0
- package/dist/src/directives/lazy-setup.js +55 -0
- package/dist/src/directives/lazy-setup.js.map +1 -0
- package/dist/src/directives/lazy.directive.d.ts +19 -0
- package/dist/src/directives/lazy.directive.d.ts.map +1 -0
- package/dist/src/directives/lazy.directive.js +73 -0
- package/dist/src/directives/lazy.directive.js.map +1 -0
- package/dist/src/directives/media.directive.d.ts +31 -0
- package/dist/src/directives/media.directive.d.ts.map +1 -0
- package/dist/src/directives/media.directive.js +105 -0
- package/dist/src/directives/media.directive.js.map +1 -0
- package/dist/src/directives/mutation.directive.d.ts +11 -0
- package/dist/src/directives/mutation.directive.d.ts.map +1 -0
- package/dist/src/directives/mutation.directive.js +56 -0
- package/dist/src/directives/mutation.directive.js.map +1 -0
- package/dist/src/directives/repeat.d.ts +50 -0
- package/dist/src/directives/repeat.d.ts.map +1 -0
- package/dist/src/directives/repeat.js +47 -0
- package/dist/src/directives/repeat.js.map +1 -0
- package/dist/src/directives/resize.directive.d.ts +14 -0
- package/dist/src/directives/resize.directive.d.ts.map +1 -0
- package/dist/src/directives/resize.directive.js +81 -0
- package/dist/src/directives/resize.directive.js.map +1 -0
- package/dist/src/directives/setup.d.ts +9 -0
- package/dist/src/directives/setup.d.ts.map +1 -0
- package/dist/src/directives/setup.js +9 -0
- package/dist/src/directives/setup.js.map +1 -0
- package/dist/src/directives/structural/async.directive.d.ts +39 -0
- package/dist/src/directives/structural/async.directive.d.ts.map +1 -0
- package/dist/src/directives/structural/async.directive.js +115 -0
- package/dist/src/directives/structural/async.directive.js.map +1 -0
- package/dist/src/directives/structural/for.directive.d.ts +37 -0
- package/dist/src/directives/structural/for.directive.d.ts.map +1 -0
- package/dist/src/directives/structural/for.directive.js +209 -0
- package/dist/src/directives/structural/for.directive.js.map +1 -0
- package/dist/src/directives/structural/if.directive.d.ts +54 -0
- package/dist/src/directives/structural/if.directive.d.ts.map +1 -0
- package/dist/src/directives/structural/if.directive.js +210 -0
- package/dist/src/directives/structural/if.directive.js.map +1 -0
- package/dist/src/directives/structural/structural.directive.d.ts +11 -0
- package/dist/src/directives/structural/structural.directive.d.ts.map +1 -0
- package/dist/src/directives/structural/structural.directive.js +29 -0
- package/dist/src/directives/structural/structural.directive.js.map +1 -0
- package/dist/src/directives/structural/switch.directive.d.ts +12 -0
- package/dist/src/directives/structural/switch.directive.d.ts.map +1 -0
- package/dist/src/directives/structural/switch.directive.js +69 -0
- package/dist/src/directives/structural/switch.directive.js.map +1 -0
- package/dist/src/directives/structural/virtual-scroll.directive.d.ts +50 -0
- package/dist/src/directives/structural/virtual-scroll.directive.d.ts.map +1 -0
- package/dist/src/directives/structural/virtual-scroll.directive.js +165 -0
- package/dist/src/directives/structural/virtual-scroll.directive.js.map +1 -0
- package/dist/src/directives/utils.d.ts +61 -0
- package/dist/src/directives/utils.d.ts.map +1 -0
- package/dist/src/directives/utils.js +121 -0
- package/dist/src/directives/utils.js.map +1 -0
- package/dist/src/directives/validate.directive.d.ts +41 -0
- package/dist/src/directives/validate.directive.d.ts.map +1 -0
- package/dist/src/directives/validate.directive.js +161 -0
- package/dist/src/directives/validate.directive.js.map +1 -0
- package/dist/src/directives/virtual-scroll.d.ts +91 -0
- package/dist/src/directives/virtual-scroll.d.ts.map +1 -0
- package/dist/src/directives/virtual-scroll.js +78 -0
- package/dist/src/directives/virtual-scroll.js.map +1 -0
- package/dist/src/directives/when.d.ts +24 -0
- package/dist/src/directives/when.d.ts.map +1 -0
- package/dist/src/directives/when.js +25 -0
- package/dist/src/directives/when.js.map +1 -0
- package/dist/src/html.d.ts +23 -0
- package/dist/src/html.d.ts.map +1 -0
- package/dist/src/html.js +37 -0
- package/dist/src/html.js.map +1 -0
- package/dist/src/modifiers/capture-modifier.d.ts +6 -0
- package/dist/src/modifiers/capture-modifier.d.ts.map +1 -0
- package/dist/src/modifiers/capture-modifier.js +14 -0
- package/dist/src/modifiers/capture-modifier.js.map +1 -0
- package/dist/src/modifiers/event-modifiers.d.ts +38 -0
- package/dist/src/modifiers/event-modifiers.d.ts.map +1 -0
- package/dist/src/modifiers/event-modifiers.js +90 -0
- package/dist/src/modifiers/event-modifiers.js.map +1 -0
- package/dist/src/modifiers/key-modifiers.d.ts +8 -0
- package/dist/src/modifiers/key-modifiers.d.ts.map +1 -0
- package/dist/src/modifiers/key-modifiers.js +29 -0
- package/dist/src/modifiers/key-modifiers.js.map +1 -0
- package/dist/src/modifiers/mouse-modifiers.d.ts +8 -0
- package/dist/src/modifiers/mouse-modifiers.d.ts.map +1 -0
- package/dist/src/modifiers/mouse-modifiers.js +15 -0
- package/dist/src/modifiers/mouse-modifiers.js.map +1 -0
- package/dist/src/modifiers/once-modifier.d.ts +6 -0
- package/dist/src/modifiers/once-modifier.d.ts.map +1 -0
- package/dist/src/modifiers/once-modifier.js +11 -0
- package/dist/src/modifiers/once-modifier.js.map +1 -0
- package/dist/src/modifiers/passive-modifier.d.ts +6 -0
- package/dist/src/modifiers/passive-modifier.d.ts.map +1 -0
- package/dist/src/modifiers/passive-modifier.js +14 -0
- package/dist/src/modifiers/passive-modifier.js.map +1 -0
- package/dist/src/processor/parser.d.ts +74 -0
- package/dist/src/processor/parser.d.ts.map +1 -0
- package/dist/src/processor/parser.js +345 -0
- package/dist/src/processor/parser.js.map +1 -0
- package/dist/src/processor/processor.d.ts +68 -0
- package/dist/src/processor/processor.d.ts.map +1 -0
- package/dist/src/processor/processor.js +138 -0
- package/dist/src/processor/processor.js.map +1 -0
- package/dist/src/processor/template-result.d.ts +74 -0
- package/dist/src/processor/template-result.d.ts.map +1 -0
- package/dist/src/processor/template-result.js +53 -0
- package/dist/src/processor/template-result.js.map +1 -0
- package/dist/src/processor/types.d.ts +16 -0
- package/dist/src/processor/types.d.ts.map +1 -0
- package/dist/src/processor/types.js +13 -0
- package/dist/src/processor/types.js.map +1 -0
- package/dist/src/utils/debug.d.ts +7 -0
- package/dist/src/utils/debug.d.ts.map +1 -0
- package/dist/src/utils/debug.js +7 -0
- package/dist/src/utils/debug.js.map +1 -0
- package/dist/src/utils/performance.d.ts +50 -0
- package/dist/src/utils/performance.d.ts.map +1 -0
- package/dist/src/utils/performance.js +51 -0
- package/dist/src/utils/performance.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- 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"}
|
package/dist/src/html.js
ADDED
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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"}
|