@ibyar/elements 2.0.2 → 2.1.1

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.
@@ -48,6 +48,12 @@ export declare class DirectiveRegistry {
48
48
  * @override
49
49
  */
50
50
  register(directiveName: string, options?: DirectiveNodeOptions): void;
51
+ /**
52
+ * update registry with a new value of directive
53
+ * @param directiveName
54
+ * @param options
55
+ */
56
+ update(directiveName: string, options?: DirectiveNodeOptions): void;
51
57
  /**
52
58
  * replace the current options with a new one.
53
59
  *
@@ -1 +1 @@
1
- {"version":3,"file":"register-directive.d.ts","sourceRoot":"","sources":["../../../src/elements/directives/register-directive.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IAEpC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,cAAM,iBAAiB;IACV,OAAO,CAAC,MAAM,CAAC;IAAY,OAAO,CAAC,OAAO,CAAC;IAAY,OAAO,CAAC,SAAS,CAAC;gBAAjE,MAAM,CAAC,EAAE,MAAM,EAAE,YAAA,EAAU,OAAO,CAAC,EAAE,MAAM,EAAE,YAAA,EAAU,SAAS,CAAC,EAAE,MAAM,YAAA;IAE7F,aAAa,IAAI,OAAO;IAIxB,SAAS,IAAI,OAAO;IAIpB,UAAU,IAAI,OAAO;IAIrB,aAAa,IAAI,OAAO;IAIxB,aAAa,IAAI,MAAM,EAAE,GAAG,SAAS;IAWrC,SAAS,IAAI,MAAM,EAAE,GAAG,SAAS;IAIjC,UAAU,IAAI,MAAM,EAAE,GAAG,SAAS;IAIlC,YAAY,IAAI,MAAM,GAAG,SAAS;IAIlC,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAI5C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IA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AI3D;;;;;OAKG;IACH,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO;IAInE;;;;;OAKG;IACH,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAI7D,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;CAIhD;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
@@ -74,6 +74,15 @@ export class DirectiveRegistry {
74
74
  this.directives.set(directiveName, info);
75
75
  }
76
76
  }
77
+ /**
78
+ * update registry with a new value of directive
79
+ * @param directiveName
80
+ * @param options
81
+ */
82
+ update(directiveName, options) {
83
+ const info = new DirectiveNodeInfo(options?.inputs, options?.outputs, options?.successor);
84
+ this.directives.set(directiveName, info);
85
+ }
77
86
  /**
78
87
  * replace the current options with a new one.
79
88
  *
@@ -1 +1 @@
1
- {"version":3,"file":"register-directive.js","sourceRoot":"","sources":["../../../src/elements/directives/register-directive.ts"],"names":[],"mappings":"AAsBA,MAAM,iBAAiB;IACF;IAA2B;IAA4B;IAA3E,YAAoB,MAAiB,EAAU,OAAkB,EAAU,SAAkB;QAAzE,WAAM,GAAN,MAAM,CAAW;QAAU,YAAO,GAAP,OAAO,CAAW;QAAU,cAAS,GAAT,SAAS,CAAS;IAAI,CAAC;IAElG,aAAa;QACZ,OAAO,IAAI,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;IAC9C,CAAC;IAED,SAAS;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,UAAU;QACT,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IAED,aAAa;QACZ,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,MAAM,I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AAS,CAAC,aAAqB,EAAE,UAAkB;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;IAC3E,CAAC;IAED,gBAAgB,CAAC,UAAoB;QACpC,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;CAED;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC","sourcesContent":["\n\nexport interface DirectiveNodeOptions {\n\n\t/**\n\t * list of inputs view name\n\t */\n\tinputs?: string[];\n\n\t/**\n\t * list of outputs view name\n\t */\n\toutputs?: string[];\n\n\t/**\n\t * successors block/scope for a directive \n\t * \n\t * ex: [`@if`/`@else`] & [`@for`/`@empty`]\n\t */\n\tsuccessor?: string;\n}\n\nclass DirectiveNodeInfo {\n\tconstructor(private inputs?: string[], private outputs?: string[], private successor?: string) { }\n\n\thasAttributes(): boolean {\n\t\treturn this.hasInputs() || this.hasOutputs();\n\t}\n\n\thasInputs(): boolean {\n\t\treturn (this.inputs?.length ?? 0) > 0;\n\t}\n\n\thasOutputs(): boolean {\n\t\treturn (this.outputs?.length ?? 0) > 0;\n\t}\n\n\thasSuccessors(): boolean {\n\t\treturn (this.successor?.trim().length ?? 0) > 0;\n\t}\n\n\tgetAttributes(): string[] | undefined {\n\t\tif (this.inputs && this.outputs) {\n\t\t\treturn this.inputs.concat(this.outputs);\n\t\t} else if (this.inputs) {\n\t\t\treturn this.inputs;\n\t\t} else if (this.outputs) {\n\t\t\treturn this.outputs;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tgetInputs(): string[] | undefined {\n\t\treturn this.inputs;\n\t}\n\n\tgetOutputs(): string[] | undefined {\n\t\treturn this.outputs;\n\t}\n\n\tgetSuccessor(): string | undefined {\n\t\treturn this.successor;\n\t}\n\n\thasAttribute(attributeName: string): boolean {\n\t\treturn this.hasInput(attributeName) || this.hasOutput(attributeName);\n\t}\n\n\thasInput(inputName: string): boolean {\n\t\treturn this.inputs?.includes(inputName) || false;\n\t}\n\n\thasOutput(outputName: string): boolean {\n\t\treturn this.outputs?.includes(outputName) || false;\n\t}\n\n\thasSuccessor(successor: string): boolean {\n\t\treturn this.successor == successor;\n\t}\n\n}\n\nexport class DirectiveRegistry {\n\n\t/**\n\t * store options info about directives\n\t */\n\tprivate directives = new Map<string, DirectiveNodeInfo>();\n\n\t/**\n\t * register a directive with a name,\n\t * \n\t * the directive could be a structural directive or an attribute directive.\n\t * \n\t * if the directive name exists, will not replace the old directive options.\n\t * @param directiveName \n\t * @param options contain the attributes of the registered directive name\n\t * @override\n\t */\n\tregister(directiveName: string, options?: DirectiveNodeOptions): void {\n\t\tif (!this.directives.has(directiveName)) {\n\t\t\tconst info = new DirectiveNodeInfo(options?.inputs, options?.outputs, options?.successor);\n\t\t\tthis.directives.set(directiveName, info);\n\t\t}\n\t}\n\n\t/**\n\t * replace the current options with a new one.\n\t * \n\t * the directive could be a structural directive or an attribute directive.\n\t * \n\t * if the directive name not exists, no set options will be done\n\t * @param directiveName \n\t * @param options to be replaced\n\t */\n\treplace(directiveName: string, options: DirectiveNodeOptions): void {\n\t\tif (this.directives.has(directiveName)) {\n\t\t\tconst info = new DirectiveNodeInfo(options?.inputs, options?.outputs);\n\t\t\tthis.directives.set(directiveName, info);\n\t\t}\n\t}\n\n\t/**\n\t * check if directive name is registered\n\t * @param directiveName \n\t * @returns `boolean`\n\t */\n\thas(attributeName: string): boolean {\n\t\treturn this.directives.has(attributeName);\n\t}\n\n\t/**\n\t * get the DirectiveOptions for a directive name\n\t * @param directiveName \n\t * @returns `DirectiveOptions` if the name has been registered, otherwise `undefined`\n\t */\n\tget(directiveName: string): DirectiveNodeInfo | undefined {\n\t\treturn this.directives.get(directiveName);\n\t}\n\n\t/**\n\t * check if the options registered with a `directiveName` has attributes array\n\t * @param directiveName \n\t * @returns `boolean`\n\t */\n\thasAttributes(directiveName: string): boolean {\n\t\treturn this.hasInputs(directiveName) || this.hasOutputs(directiveName);\n\t}\n\n\thasInputs(directiveName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasInputs() || false;\n\t}\n\n\thasOutputs(directiveName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasOutputs() || false;\n\t}\n\n\thasSuccessors(directiveName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasSuccessors() || false;\n\t}\n\n\t/**\n\t * get the value of the registered inputs and outputs by directive name\n\t * @param directiveName \n\t * @returns array of strings if found, otherwise `undefined`\n\t */\n\tgetAttributes(directiveName: string): string[] | undefined {\n\t\treturn this.directives.get(directiveName)?.getAttributes();\n\t}\n\n\t/**\n\t * get the value of the registered inputs by directive name\n\t * @param directiveName \n\t * @returns array of strings if found, otherwise `undefined`\n\t */\n\tgetInputs(directiveName: string): string[] | undefined {\n\t\treturn this.directives.get(directiveName)?.getInputs();\n\t}\n\n\t/**\n\t * get the value of the registered outputs by directive name\n\t * @param directiveName \n\t * @returns array of strings if found, otherwise `undefined`\n\t */\n\tgetOutputs(directiveName: string): string[] | undefined {\n\t\treturn this.directives.get(directiveName)?.getOutputs();\n\t}\n\n\t/**\n\t * get the value of the registered successors by directive name\n\t * @param directiveName \n\t * @returns \n\t */\n\tgetSuccessor(directiveName: string): string | undefined {\n\t\treturn this.directives.get(directiveName)?.getSuccessor();\n\t}\n\n\t/**\n\t * check if a directive has a attribute\n\t * @param directiveName \n\t * @param attributeName \n\t * @returns \n\t */\n\thasAttribute(directiveName: string, attributeName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasAttribute(attributeName) || false;\n\t}\n\n\t/**\n\t * check if has input\n\t * @param directiveName \n\t * @param inputName \n\t * @returns \n\t */\n\thasInput(directiveName: string, inputName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasInput(inputName) || false;\n\t}\n\n\t/**\n\t * check if has successor\n\t * @param directiveName \n\t * @param successorName \n\t * @returns \n\t */\n\thasSuccessor(directiveName: string, successorName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasSuccessor(successorName) || false;\n\t}\n\n\t/**\n\t * check if has output\n\t * @param directiveName \n\t * @param outputName \n\t * @returns \n\t */\n\thasOutput(directiveName: string, outputName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasOutput(outputName) || false;\n\t}\n\n\tfilterDirectives(attributes: string[]): string[] {\n\t\treturn attributes.filter(name => this.has(name));\n\t}\n\n}\n\nexport const directiveRegistry = new DirectiveRegistry();\n"]}
1
+ {"version":3,"file":"register-directive.js","sourceRoot":"","sources":["../../../src/elements/directives/register-directive.ts"],"names":[],"mappings":"AAsBA,MAAM,iBAAiB;IACF;IAA2B;IAA4B;IAA3E,YAAoB,MAAiB,EAAU,OAAkB,EAAU,SAAkB;QAAzE,WAAM,GAAN,MAAM,CAAW;QAAU,YAAO,GAAP,OAAO,CAAW;QAAU,cAAS,GAAT,SAAS,CAAS;IAAI,CAAC;IAElG,aAAa;QACZ,OAAO,IAAI,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;IAC9C,CAAC;IAED,SAAS;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,UAAU;QACT,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IAED,aAAa;QACZ,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC;IAED,aAAa;QACZ,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzC,C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C,IAAI,KAAK,CAAC;IACjF,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,aAAqB,EAAE,UAAkB;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;IAC3E,CAAC;IAED,gBAAgB,CAAC,UAAoB;QACpC,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;CAED;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC","sourcesContent":["\n\nexport interface DirectiveNodeOptions {\n\n\t/**\n\t * list of inputs view name\n\t */\n\tinputs?: string[];\n\n\t/**\n\t * list of outputs view name\n\t */\n\toutputs?: string[];\n\n\t/**\n\t * successors block/scope for a directive \n\t * \n\t * ex: [`@if`/`@else`] & [`@for`/`@empty`]\n\t */\n\tsuccessor?: string;\n}\n\nclass DirectiveNodeInfo {\n\tconstructor(private inputs?: string[], private outputs?: string[], private successor?: string) { }\n\n\thasAttributes(): boolean {\n\t\treturn this.hasInputs() || this.hasOutputs();\n\t}\n\n\thasInputs(): boolean {\n\t\treturn (this.inputs?.length ?? 0) > 0;\n\t}\n\n\thasOutputs(): boolean {\n\t\treturn (this.outputs?.length ?? 0) > 0;\n\t}\n\n\thasSuccessors(): boolean {\n\t\treturn (this.successor?.trim().length ?? 0) > 0;\n\t}\n\n\tgetAttributes(): string[] | undefined {\n\t\tif (this.inputs && this.outputs) {\n\t\t\treturn this.inputs.concat(this.outputs);\n\t\t} else if (this.inputs) {\n\t\t\treturn this.inputs;\n\t\t} else if (this.outputs) {\n\t\t\treturn this.outputs;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tgetInputs(): string[] | undefined {\n\t\treturn this.inputs;\n\t}\n\n\tgetOutputs(): string[] | undefined {\n\t\treturn this.outputs;\n\t}\n\n\tgetSuccessor(): string | undefined {\n\t\treturn this.successor;\n\t}\n\n\thasAttribute(attributeName: string): boolean {\n\t\treturn this.hasInput(attributeName) || this.hasOutput(attributeName);\n\t}\n\n\thasInput(inputName: string): boolean {\n\t\treturn this.inputs?.includes(inputName) || false;\n\t}\n\n\thasOutput(outputName: string): boolean {\n\t\treturn this.outputs?.includes(outputName) || false;\n\t}\n\n\thasSuccessor(successor: string): boolean {\n\t\treturn this.successor == successor;\n\t}\n\n}\n\nexport class DirectiveRegistry {\n\n\t/**\n\t * store options info about directives\n\t */\n\tprivate directives = new Map<string, DirectiveNodeInfo>();\n\n\t/**\n\t * register a directive with a name,\n\t * \n\t * the directive could be a structural directive or an attribute directive.\n\t * \n\t * if the directive name exists, will not replace the old directive options.\n\t * @param directiveName \n\t * @param options contain the attributes of the registered directive name\n\t * @override\n\t */\n\tregister(directiveName: string, options?: DirectiveNodeOptions): void {\n\t\tif (!this.directives.has(directiveName)) {\n\t\t\tconst info = new DirectiveNodeInfo(options?.inputs, options?.outputs, options?.successor);\n\t\t\tthis.directives.set(directiveName, info);\n\t\t}\n\t}\n\n\t/**\n\t * update registry with a new value of directive\n\t * @param directiveName \n\t * @param options \n\t */\n\n\tupdate(directiveName: string, options?: DirectiveNodeOptions): void {\n\t\tconst info = new DirectiveNodeInfo(options?.inputs, options?.outputs, options?.successor);\n\t\tthis.directives.set(directiveName, info);\n\t}\n\n\t/**\n\t * replace the current options with a new one.\n\t * \n\t * the directive could be a structural directive or an attribute directive.\n\t * \n\t * if the directive name not exists, no set options will be done\n\t * @param directiveName \n\t * @param options to be replaced\n\t */\n\treplace(directiveName: string, options: DirectiveNodeOptions): void {\n\t\tif (this.directives.has(directiveName)) {\n\t\t\tconst info = new DirectiveNodeInfo(options?.inputs, options?.outputs);\n\t\t\tthis.directives.set(directiveName, info);\n\t\t}\n\t}\n\n\t/**\n\t * check if directive name is registered\n\t * @param directiveName \n\t * @returns `boolean`\n\t */\n\thas(attributeName: string): boolean {\n\t\treturn this.directives.has(attributeName);\n\t}\n\n\t/**\n\t * get the DirectiveOptions for a directive name\n\t * @param directiveName \n\t * @returns `DirectiveOptions` if the name has been registered, otherwise `undefined`\n\t */\n\tget(directiveName: string): DirectiveNodeInfo | undefined {\n\t\treturn this.directives.get(directiveName);\n\t}\n\n\t/**\n\t * check if the options registered with a `directiveName` has attributes array\n\t * @param directiveName \n\t * @returns `boolean`\n\t */\n\thasAttributes(directiveName: string): boolean {\n\t\treturn this.hasInputs(directiveName) || this.hasOutputs(directiveName);\n\t}\n\n\thasInputs(directiveName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasInputs() || false;\n\t}\n\n\thasOutputs(directiveName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasOutputs() || false;\n\t}\n\n\thasSuccessors(directiveName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasSuccessors() || false;\n\t}\n\n\t/**\n\t * get the value of the registered inputs and outputs by directive name\n\t * @param directiveName \n\t * @returns array of strings if found, otherwise `undefined`\n\t */\n\tgetAttributes(directiveName: string): string[] | undefined {\n\t\treturn this.directives.get(directiveName)?.getAttributes();\n\t}\n\n\t/**\n\t * get the value of the registered inputs by directive name\n\t * @param directiveName \n\t * @returns array of strings if found, otherwise `undefined`\n\t */\n\tgetInputs(directiveName: string): string[] | undefined {\n\t\treturn this.directives.get(directiveName)?.getInputs();\n\t}\n\n\t/**\n\t * get the value of the registered outputs by directive name\n\t * @param directiveName \n\t * @returns array of strings if found, otherwise `undefined`\n\t */\n\tgetOutputs(directiveName: string): string[] | undefined {\n\t\treturn this.directives.get(directiveName)?.getOutputs();\n\t}\n\n\t/**\n\t * get the value of the registered successors by directive name\n\t * @param directiveName \n\t * @returns \n\t */\n\tgetSuccessor(directiveName: string): string | undefined {\n\t\treturn this.directives.get(directiveName)?.getSuccessor();\n\t}\n\n\t/**\n\t * check if a directive has a attribute\n\t * @param directiveName \n\t * @param attributeName \n\t * @returns \n\t */\n\thasAttribute(directiveName: string, attributeName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasAttribute(attributeName) || false;\n\t}\n\n\t/**\n\t * check if has input\n\t * @param directiveName \n\t * @param inputName \n\t * @returns \n\t */\n\thasInput(directiveName: string, inputName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasInput(inputName) || false;\n\t}\n\n\t/**\n\t * check if has successor\n\t * @param directiveName \n\t * @param successorName \n\t * @returns \n\t */\n\thasSuccessor(directiveName: string, successorName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasSuccessor(successorName) || false;\n\t}\n\n\t/**\n\t * check if has output\n\t * @param directiveName \n\t * @param outputName \n\t * @returns \n\t */\n\thasOutput(directiveName: string, outputName: string): boolean {\n\t\treturn this.directives.get(directiveName)?.hasOutput(outputName) || false;\n\t}\n\n\tfilterDirectives(attributes: string[]): string[] {\n\t\treturn attributes.filter(name => this.has(name));\n\t}\n\n}\n\nexport const directiveRegistry = new DirectiveRegistry();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"html-parser.d.ts","sourceRoot":"","sources":["../../../src/elements/node/html-parser.ts"],"names":[],"mappings":"AACA,OAAO,EACN,cAAc,EAEd,0BAA0B,EAAE,OAAO,EAAE,QAAQ,EAC3B,SAAS,EAAE,QAAQ,EAGrC,MAAM,eAAe,CAAC;AAOvB,qBAAa,mBAAmB;IAC/B,MAAM,CAAC,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAO1C;IACF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;;IAOhB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAM9B;AAED,qBAAa,gBAAgB;IAE5B,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,GAAG,0BAA0B;IA0GtF,SAAS,CAAC,kCAAkC,CAAC,aAAa,EAAE,M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,cAAc;IAStB,OAAO,CAAC,2BAA2B;IAMnC,OAAO,CAAC,UAAU;IAiClB,OAAO,CAAC,8BAA8B;CAgBtC;AAiBD,qBAAa,UAAU;IAEtB,UAAU,aAAoB;IAE9B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE;IAI/B,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAWpC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE;IA8D3B,qBAAqB,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;IAuBpD,mBAAmB,CAAC,IAAI,EAAE,QAAQ;IAQlC,eAAe,CAAC,IAAI,EAAE,OAAO;CA4C7B;AAMD,eAAO,MAAM,UAAU,YAAmB,CAAC"}
@@ -216,7 +216,7 @@ export class NodeParser extends NodeParserHelper {
216
216
  parseText(token) {
217
217
  if (token === '<' || token === '@') {
218
218
  if (token === '@' && this.tempText.at(-1) === '\\') {
219
- this.tempText = this.tempText.replace(/.$/, token);
219
+ this.tempText = this.tempText.substring(0, this.tempText.length - 2) + token;
220
220
  return this.parseText;
221
221
  }
222
222
  else {
@@ -769,7 +769,9 @@ export class HTMLParser {
769
769
  break;
770
770
  case 'DomStructuralDirectiveNode':
771
771
  inherit(node, DomStructuralDirectiveNode);
772
+ this.deserializeBaseNode(node);
772
773
  this.deserializeNode(node.node);
774
+ node.successor && this.deserializeNode(node.successor);
773
775
  break;
774
776
  case 'StructuralDirectiveSuccessorNode':
775
777
  inherit(node, DomStructuralDirectiveSuccessorNode);
@@ -1 +1 @@
1
- {"version":3,"file":"html-parser.js","sourceRoot":"","sources":["../../../src/elements/node/html-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACN,cAAc,EAAE,WAAW,EAAE,cAAc,EAC3C,WAAW,EAAE,eAAe,EAAE,eAAe,EAC7C,0BAA0B,EAC1B,gBAAgB,EAAE,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EAAE,IAAiC;IAC9D,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","sourcesContent":["import { isEmptyElement } from '../attributes/common.js';\nimport {\n\tDomElementNode, CommentNode, parseTextChild,\n\tTextContent, LiveTextContent, DomFragmentNode,\n\tDomStructuralDirectiveNode, DomNode, DomChild,\n\tElementAttribute, Attribute, BaseNode, LiveAttribute,\n\tDomParentNode, DomAttributeDirectiveNode,\n\tDomStructuralDirectiveSuccessorNode,\n} from '../ast/dom.js';\nimport { directiveRegistry } from '../directives/register-directive.js';\n\ntype Token = (token: string) => Token;\n\ntype ChildNode = DomElementNode | DomStructuralDirectiveNode | CommentNode | string;\n\nexport class EscapeHTMLCharacter {\n\tstatic ESCAPE_MAP: { [key: string]: string } = {\n\t\t'&amp;': '&',\n\t\t'&lt;': '<',\n\t\t'&gt;': '>',\n\t\t'&quot;': '\"',\n\t\t'&#x27;': \"'\",\n\t\t'&#x60;': '`'\n\t};\n\ttest: RegExp;\n\treplace: RegExp;\n\tconstructor() {\n\t\tconst escapeRegexSource = '(?:' + Object.keys(EscapeHTMLCharacter.ESCAPE_MAP).join('|') + ')';\n\t\tthis.test = new RegExp(escapeRegexSource);\n\t\tthis.replace = new RegExp(escapeRegexSource, 'g');\n\t}\n\n\tescaper(match: string): string {\n\t\treturn EscapeHTMLCharacter.ESCAPE_MAP[match];\n\t}\n\n\tunescape(text: string): string {\n\t\tif (!text) {\n\t\t\treturn text;\n\t\t}\n\t\treturn this.test.test(text) ? text.replace(this.replace, this.escaper) : text;\n\t}\n}\n\nexport class NodeParserHelper {\n\n\tprotected checkNode(node: DomElementNode): DomElementNode | DomStructuralDirectiveNode {\n\t\tif (node instanceof DomStructuralDirectiveNode) {\n\t\t\treturn node;\n\t\t}\n\t\tconst attributes = node.attributes;\n\t\tif (attributes) {\n\t\t\tlet temp: ElementAttribute<string, any> | ElementAttribute<string, any>[] | undefined;\n\n\t\t\ttemp = attributes.find(attr => attr.name === 'is');\n\t\t\tif (temp) {\n\t\t\t\tattributes.splice(attributes.indexOf(temp), 1);\n\t\t\t\tnode.is = temp.value as string;\n\t\t\t}\n\t\t\ttemp = attributes.filter(attr => {\n\t\t\t\treturn typeof attr.value === 'string' && (/\\{\\{(.+)\\}\\}/g).test(attr.value);\n\t\t\t});\n\t\t\tif (temp?.length) {\n\t\t\t\ttemp.forEach(templateAttrs => {\n\t\t\t\t\tattributes.splice(attributes.indexOf(templateAttrs), 1);\n\t\t\t\t\tnode.addTemplateAttr(templateAttrs.name, templateAttrs.value as string);\n\t\t\t\t});\n\t\t\t}\n\t\t\ttemp = attributes.filter(attr => attr.name.startsWith('on'));\n\t\t\tif (temp?.length) {\n\t\t\t\ttemp.forEach(templateAttrs => {\n\t\t\t\t\tattributes.splice(attributes.indexOf(templateAttrs), 1);\n\t\t\t\t\tnode.addOutput(templateAttrs.name.substring(2), templateAttrs.value as string);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst directiveNames = this.extractDirectiveNames(node);\n\t\tlet sdName: string | undefined;\n\t\tif (directiveNames.length) {\n\t\t\tconst directives: DomAttributeDirectiveNode[] = [];\n\t\t\tdirectiveNames.forEach(attributeName => {\n\t\t\t\tif (attributeName.startsWith('*')) {\n\t\t\t\t\tif (sdName) {\n\t\t\t\t\t\tconsole.error(`Only one Structural Directive is allowed on an element [${sdName}, ${attributeName}]`);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsdName = attributeName;\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst directive = new DomAttributeDirectiveNode(attributeName);\n\t\t\t\tif (directiveRegistry.get(attributeName)!.hasAttributes()) {\n\t\t\t\t\tthis.extractDirectiveAttributesFromNode(attributeName, directive, node);\n\t\t\t\t}\n\t\t\t\tdirectives.push(directive);\n\t\t\t});\n\t\t\tif (directives.length) {\n\t\t\t\tnode.attributeDirectives = directives;\n\t\t\t}\n\t\t}\n\t\tif (sdName) {\n\t\t\t// <div *for [forOf]=\"array\" let-item [trackBy]=\"method\" let-i=\"index\" > {{item}} </div>\n\t\t\t// <div *for=\"let item of array; let i = index; trackBy=method;\" > {{item}} </div>\n\t\t\t// <template #refName *if=\"isActive; else disabled\" > ... </template>\n\t\t\t// <template #disabled > ... </template>\n\n\t\t\tconst temp = node.attributes!.find(attr => attr.name == sdName)!;\n\t\t\tnode.attributes!.splice(node.attributes!.indexOf(temp), 1);\n\t\t\tconst isTemplate = node.tagName === 'template';\n\n\t\t\tconst directiveNode = isTemplate ? new DomFragmentNode(node.children) : node;\n\t\t\tconst directive = new DomStructuralDirectiveNode(\n\t\t\t\ttemp.name,\n\t\t\t\tdirectiveNode,\n\t\t\t\t(typeof temp?.value === 'boolean') ? undefined : String(temp.value)\n\t\t\t);\n\t\t\tconst directiveName = temp.name.substring(1);\n\t\t\tif (isTemplate) {\n\t\t\t\tdirective.inputs = node.inputs;\n\t\t\t\tdirective.outputs = node.outputs;\n\t\t\t\tdirective.attributes = node.attributes;\n\t\t\t\tdirective.templateAttrs = node.templateAttrs;\n\t\t\t\tdirective.attributeDirectives = node.attributeDirectives;\n\t\t\t} else if (directiveRegistry.hasAttributes(directiveName)) {\n\t\t\t\tthis.extractDirectiveAttributesFromNode(directiveName, directive, node);\n\t\t\t\tdirective.attributeDirectives = node.attributeDirectives;\n\t\t\t}\n\t\t\tif (isTemplate && node.templateRefName) {\n\t\t\t\tnode.children = [directive];\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\treturn directive;\n\t\t}\n\n\t\t// <for let-user [of]=\"users\"></for>\n\t\t// @for (item of items; track item.id) {\n\t\t// \t{ { item.name } }\n\t\t// }\n\t\tif (directiveRegistry.has('*' + node.tagName)) {\n\t\t\tconst children = new DomFragmentNode(node.children);\n\t\t\tconst directive = new DomStructuralDirectiveNode('*' + node.tagName, children);\n\t\t\tdirective.inputs = node.inputs;\n\t\t\tdirective.outputs = node.outputs;\n\t\t\tdirective.attributes = node.attributes;\n\t\t\tdirective.templateAttrs = node.templateAttrs;\n\t\t\tdirective.attributeDirectives = node.attributeDirectives;\n\t\t\treturn directive;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tprotected extractDirectiveAttributesFromNode(directiveName: string, directive: BaseNode, node: DomElementNode): void {\n\t\tconst attributes = directiveRegistry.getAttributes(directiveName);\n\t\tif (!attributes) {\n\t\t\treturn;\n\t\t}\n\t\tconst filterByAttrName = createFilterByAttrName(attributes);\n\t\tdirective.attributes = node.attributes?.filter(filterByAttrName);\n\t\tdirective.inputs = node.inputs?.filter(filterByAttrName);\n\t\tdirective.outputs = node.outputs?.filter(filterByAttrName);\n\t\tdirective.twoWayBinding = node.twoWayBinding?.filter(filterByAttrName);\n\t\tdirective.templateAttrs = node.templateAttrs?.filter(filterByAttrName);\n\n\t\tnode.inputs && directive.inputs?.forEach(createArrayCleaner(node.inputs));\n\t\tnode.outputs && directive.outputs?.forEach(createArrayCleaner(node.outputs));\n\t\tnode.twoWayBinding && directive.twoWayBinding?.forEach(createArrayCleaner(node.twoWayBinding));\n\t\tnode.attributes && directive.attributes?.forEach(createArrayCleaner(node.attributes));\n\t\tnode.templateAttrs && directive.templateAttrs?.forEach(createArrayCleaner(node.templateAttrs));\n\t}\n\n\tprotected extractDirectiveNames(node: BaseNode): string[] {\n\t\tconst names: string[] = [];\n\t\tif (node.attributes?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.attributes).filter(name => name.startsWith('*')));\n\t\t}\n\t\tif (node.inputs?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.inputs));\n\t\t}\n\t\tif (node.twoWayBinding?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.twoWayBinding));\n\t\t}\n\t\tif (node.templateAttrs?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.templateAttrs));\n\t\t}\n\t\tif (node.outputs?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.outputs));\n\t\t}\n\t\treturn [...new Set(names)];\n\t}\n\n\tprotected getAttributeDirectives(attributes: Attribute<string, any>[]): string[] {\n\t\treturn directiveRegistry.filterDirectives(attributes.map(attr => attr.name.split('.')[0]));\n\t}\n\n}\n\nexport class NodeParser extends NodeParserHelper {\n\n\tprivate index: number;\n\tprivate stateFn: Token;\n\n\tprivate tagNameRegExp = /[\\-\\.0-9_a-z\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u203F\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|[\\uD800-\\uDB7F][\\uDC00-\\uDFFF]/;\n\n\tprivate childStack: DomChild[];\n\tprivate stackTrace: ChildNode[];\n\n\tprivate get currentNode(): DomElementNode {\n\t\treturn this.stackTrace[this.stackTrace.length - 1] as DomElementNode;\n\t}\n\n\tprivate commentOpenCount = 0;\n\tprivate commentCloseCount = 0;\n\n\tprivate tempText: string;\n\n\tprivate propertyName: string;\n\tprivate propertyValue: string;\n\tprivate propType: 'attr' | 'ref-name' | 'input' | 'output' | 'two-way';\n\n\tprivate escaper = new EscapeHTMLCharacter();\n\n\tprivate skipCount = 0;\n\tprivate flowScopeCount = 0;\n\tprivate flowChainCount = 0;\n\tprivate interpolationCount = 0;\n\n\tparse(html: string)/*: DomNode*/ {\n\t\tthis.reset();\n\t\tfor (; this.index < html.length; this.index++) {\n\t\t\tthis.stateFn = this.stateFn(html[this.index]);\n\t\t}\n\t\tthis.checkTextChild();\n\t\tthis.popStructuralDirectiveNodes();\n\t\tif (this.stackTrace.length > 0) {\n\t\t\tconsole.error(this.stackTrace);\n\t\t\tthrow new Error(`error parsing html, had ${this.stackTrace.length} element, [${(this.stackTrace as DomElementNode[]).map(dom => dom.tagName).join(', ')}], with no closing tag`);\n\t\t}\n\t\tlet stack = this.childStack;\n\t\tthis.reset();\n\t\treturn stack;\n\t}\n\n\tprivate reset() {\n\t\tthis.index = 0;\n\t\tthis.childStack = [];\n\t\tthis.stackTrace = [];\n\t\tthis.propType = 'attr';\n\t\tthis.commentOpenCount = 0;\n\t\tthis.commentCloseCount = 0;\n\t\tthis.skipCount = 0;\n\t\tthis.flowScopeCount = 0;\n\t\tthis.flowChainCount = 0;\n\t\tthis.interpolationCount = 0;\n\t\tthis.stateFn = this.parseText;\n\t\tthis.propertyName = this.propertyValue = this.tempText = '';\n\t}\n\n\tprivate parseText(token: string) {\n\t\tif (token === '<' || token === '@') {\n\t\t\tif (token === '@' && this.tempText.at(-1) === '\\\\') {\n\t\t\t\tthis.tempText = this.tempText.replace(/.$/, token);\n\t\t\t\treturn this.parseText;\n\t\t\t} else {\n\t\t\t\tthis.checkTextChild();\n\t\t\t\treturn token === '<' ? this.parseTag : this.parseControlFlow;\n\t\t\t}\n\t\t}\n\t\telse if (this.interpolationCount === 0 && this.flowScopeCount > 0 && token === '}') {\n\t\t\tthis.checkTextChild();\n\t\t\tthis.tempText = '';\n\t\t\tthis.flowScopeCount--;\n\t\t\tconst directive = this.getLastStructuralDirectiveNode();\n\t\t\tif (directive) {\n\t\t\t\tconst lastDirective = chainSuccessor(directive);\n\t\t\t\tif ((lastDirective.successor?.children.length ?? 0) === 0 && directiveRegistry.hasSuccessors(lastDirective.name)) {\n\t\t\t\t\tthis.flowChainCount++;\n\t\t\t\t\treturn this.parsePossibleSuccessorsControlFlow;\n\t\t\t\t}\n\t\t\t\tdo {\n\t\t\t\t\tthis.flowChainCount--;\n\t\t\t\t\tthis.popElement();\n\t\t\t\t} while (this.flowChainCount > 0);\n\t\t\t}\n\t\t\treturn this.parseText;\n\t\t} else if (token === '{') {\n\t\t\tthis.interpolationCount++;\n\t\t} else if (token === '}') {\n\t\t\tthis.interpolationCount--;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseText;\n\t}\n\n\tprivate parseTag(token: string) {\n\t\tif (token === '/') {\n\t\t\treturn this.parseCloseTag;\n\t\t}\n\t\tif (token === '!') {\n\t\t\tthis.commentOpenCount = 0;\n\t\t\tthis.commentCloseCount = 0;\n\t\t\treturn this.parseComment;\n\t\t}\n\t\tthis.index--;\n\t\treturn this.parseOpenTag;\n\t}\n\n\tprivate parseComment(token: string) {\n\t\tif (token === '-') {\n\t\t\tif (this.commentOpenCount < 2) {\n\t\t\t\tthis.commentOpenCount++;\n\t\t\t} else {\n\t\t\t\tthis.commentCloseCount++;\n\t\t\t}\n\t\t\treturn this.parseComment;\n\t\t}\n\t\telse if (token === '>' && this.commentCloseCount === 2) {\n\t\t\tthis.tempText = this.escaper.unescape(this.tempText);\n\t\t\tthis.stackTrace.push(new CommentNode(this.tempText.trim()));\n\t\t\tthis.popElement();\n\t\t\tthis.tempText = '';\n\t\t\tthis.commentOpenCount = 0;\n\t\t\tthis.commentCloseCount = 0;\n\t\t\treturn this.parseText;\n\t\t}\n\t\telse if (token === '>' && this.commentCloseCount === 0) {\n\t\t\tconst temp = this.tempText.toLowerCase();\n\t\t\tif ('doctype html' === temp) {\n\t\t\t\tthis.tempText = '';\n\t\t\t\treturn this.parseText;\n\t\t\t}\n\t\t}\n\t\tif (this.commentCloseCount > 0) {\n\t\t\tfor (let i = 0; i < this.commentCloseCount; i++) {\n\t\t\t\tthis.tempText += '-';\n\t\t\t}\n\t\t\tthis.commentCloseCount = 0;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseComment;\n\t}\n\n\tprivate parseCloseTag(token: string) {\n\t\tif (token === '>') {\n\t\t\tif (!isEmptyElement(this.currentNode.tagName)\n\t\t\t\t&& this.currentNode.tagName.trim().toLowerCase() !== this.tempText.trim().toLowerCase()\n\t\t\t) {\n\t\t\t\tthrow new Error(`Wrong closed tag at char ${this.index}, tag name: ${this.currentNode.tagName}`);\n\t\t\t}\n\t\t\tthis.popElement();\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parseText;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseCloseTag;\n\t}\n\n\tprivate parseOpenTag(token: string) {\n\t\tif (token === '>') {\n\t\t\tthis.stackTrace.push(new DomElementNode(this.tempText));\n\t\t\tif (isEmptyElement(this.tempText)) {\n\t\t\t\tthis.popElement();\n\t\t\t}\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parseText;\n\t\t}\n\t\telse if (this.tagNameRegExp.test(token)) {\n\t\t\tthis.tempText += token;\n\t\t\treturn this.parseOpenTag;\n\t\t}\n\t\telse if (/\\s/.test(token)) {\n\t\t\tthis.stackTrace.push(new DomElementNode(this.tempText));\n\t\t\tthis.tempText = '';\n\t\t\tthis.propType = 'attr';\n\t\t\treturn this.parsePropertyName;\n\t\t}\n\t\tthrow new SyntaxError('Error while parsing open tag');\n\t}\n\n\tprivate parsePropertyName(token: string) {\n\t\tif (token === '>') {\n\t\t\tif (this.tempText.trim()) {\n\t\t\t\tthis.propertyName = this.tempText;\n\t\t\t\tthis.currentNode.addAttribute(this.propertyName, true);\n\t\t\t\tthis.propertyName = this.propertyValue = this.tempText = '';\n\t\t\t}\n\t\t\tif (isEmptyElement(this.currentNode.tagName)) {\n\t\t\t\tthis.popElement();\n\t\t\t}\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parseText;\n\t\t}\n\t\telse if (token === '/') {\n\t\t\treturn this.parsePropertyName;\n\t\t}\n\t\telse if (/\\[/.test(token)) {\n\t\t\tthis.propType = 'input';\n\t\t\treturn this.parseInputOutput;\n\t\t}\n\t\telse if (/\\(|@/.test(token)) {\n\t\t\tthis.propType = 'output';\n\t\t\treturn this.parseInputOutput;\n\t\t}\n\t\telse if (/#/.test(token)) {\n\t\t\tthis.propType = 'ref-name';\n\t\t\treturn this.parseRefName;\n\t\t}\n\t\telse if (/=/.test(token)) {\n\t\t\tthis.propertyName = this.tempText;\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parsePropertyName;\n\t\t} else if (/\"/.test(token)) {\n\t\t\treturn this.parsePropertyValue;\n\t\t} else if (/\\d/.test(token)) {\n\t\t\tthis.tempText += token;\n\t\t\treturn this.parsePropertyValue;\n\t\t}\n\t\telse if (/\\s/.test(token)) {\n\t\t\tif (this.tempText.trim()) {\n\t\t\t\tthis.propertyName = this.tempText;\n\t\t\t\tthis.currentNode.addAttribute(this.propertyName, true);\n\t\t\t\tthis.propertyName, this.propertyValue = this.tempText = '';\n\t\t\t}\n\t\t\treturn this.parsePropertyName;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parsePropertyName;\n\t}\n\n\tprivate parseRefName(token: string) {\n\t\tif (/=/.test(token)) {\n\t\t\treturn this.parseRefName;\n\t\t}\n\t\telse if (/\"/.test(token)) {\n\t\t\tthis.propertyName = this.tempText;\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parsePropertyValue;\n\t\t} else if (/\\s/.test(token)) {\n\t\t\tthis.currentNode.setTemplateRefName(this.tempText, '');\n\t\t\tthis.propertyName = this.tempText = '';\n\t\t\tthis.propType = 'attr';\n\t\t\treturn this.parsePropertyName;\n\t\t} else if (/>/.test(token)) {\n\t\t\tthis.currentNode.setTemplateRefName(this.tempText, '');\n\t\t\tthis.propertyName = this.tempText = '';\n\t\t\tthis.propType = 'attr';\n\t\t\treturn this.parseText;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseRefName;\n\t}\n\n\tprivate parseInputOutput(token: string) {\n\t\tif (/\\(/.test(token)) {\n\t\t\tthis.propType = 'two-way';\n\t\t\treturn this.parseInputOutput;\n\t\t}\n\t\telse if (/\\)|\\]|=/.test(token)) {\n\t\t\treturn this.parseInputOutput;\n\t\t}\n\t\telse if (/\"/.test(token)) {\n\t\t\tthis.propertyName = this.tempText;\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parsePropertyValue;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseInputOutput;\n\t}\n\n\tprivate parseControlFlow(token: string) {\n\t\tif (token === '(') {\n\t\t\tconst flowName = '*' + this.tempText.trim();\n\t\t\tthis.stackTrace.push(new DomStructuralDirectiveNode(flowName, new DomFragmentNode()));\n\t\t\tthis.tempText = '';\n\t\t\tthis.skipCount = 1;\n\t\t\treturn this.parseControlFlowExpression;\n\t\t} else if (token === '{') {\n\t\t\tif (this.tempText.trim()) {\n\t\t\t\tconst flowName = '*' + this.tempText.trim();\n\t\t\t\tthis.stackTrace.push(new DomStructuralDirectiveNode(flowName, new DomFragmentNode()));\n\t\t\t}\n\t\t\tthis.skipCount = 0;\n\t\t\tthis.tempText = '';\n\t\t\tthis.flowScopeCount++;\n\t\t\treturn this.parseText;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseControlFlow;\n\t}\n\n\tprivate parseControlFlowExpression(token: string) {\n\t\tif (token === ')') {\n\t\t\tthis.skipCount--;\n\t\t\tif (this.skipCount == 0 && this.currentNode instanceof DomStructuralDirectiveNode) {\n\t\t\t\tthis.currentNode.value = this.tempText;\n\t\t\t\tthis.tempText = '';\n\t\t\t\treturn this.parseControlFlow;\n\t\t\t}\n\t\t\tthrow new SyntaxError(`Control Flow Expression Syntax Error`);\n\t\t} else if (token === '(') {\n\t\t\tthis.skipCount++;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseControlFlowExpression;\n\t}\n\n\tprivate parsePossibleSuccessorsControlFlow(token: string) {\n\t\tif (/\\s/.test(token)) {\n\t\t\tthis.tempText += token;\n\t\t\treturn this.parsePossibleSuccessorsControlFlow;\n\t\t}\n\t\tif (token === '@') {\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parsePossibleSuccessorsControlFlowName;\n\t\t}\n\t\tdo {\n\t\t\tthis.flowChainCount--;\n\t\t\tthis.popElement();\n\t\t} while (this.flowChainCount > 0);\n\t\tthis.index--;\n\t\treturn this.parseText;\n\t}\n\n\tprivate parsePossibleSuccessorsControlFlowName(token: string) {\n\t\tif (/\\s/.test(token) || token === '{') {\n\t\t\tconst successorFlowName = '*' + this.tempText.trim();\n\t\t\tconst directive = this.getLastStructuralDirectiveNode();\n\t\t\tif (directive) {\n\t\t\t\tconst isSuccessor = directiveRegistry.hasSuccessor(directive.name, successorFlowName);\n\t\t\t\tif (isSuccessor) {\n\t\t\t\t\tdirective.successor = new DomStructuralDirectiveSuccessorNode(successorFlowName);\n\t\t\t\t\tthis.tempText = '';\n\t\t\t\t\tthis.index--;\n\t\t\t\t\treturn this.parseSuccessorsControlFlowName;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.tempText += token;\n\t\t\treturn this.parseText;\n\t\t} else if (token === '(') {\n\t\t\tthis.popStructuralDirectiveNodes();\n\t\t\tthis.index--;\n\t\t\treturn this.parseControlFlow;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parsePossibleSuccessorsControlFlowName;\n\t}\n\n\tprivate parseSuccessorsControlFlowName(token: string) {\n\t\tif (token === '(' || token === '{') {\n\t\t\tthis.index--;\n\t\t\treturn this.parseControlFlow;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseSuccessorsControlFlowName;\n\t}\n\n\tprivate parsePropertyValue(token: string) {\n\t\tif (/\"/.test(token)) {\n\t\t\tthis.propertyValue = this.tempText;\n\t\t\tswitch (this.propType) {\n\t\t\t\tcase 'input':\n\t\t\t\t\tthis.currentNode.addInput(this.propertyName, this.propertyValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'output':\n\t\t\t\t\tthis.currentNode.addOutput(this.propertyName, this.propertyValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'two-way':\n\t\t\t\t\tthis.currentNode.addTwoWayBinding(this.propertyName, this.propertyValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ref-name':\n\t\t\t\t\tthis.currentNode.setTemplateRefName(this.propertyName, this.propertyValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'attr':\n\t\t\t\tdefault:\n\t\t\t\t\tif (/^([-+]?\\d*\\.?\\d+)(?:[eE]([-+]?\\d+))?$/.test(this.propertyValue.trim())) {\n\t\t\t\t\t\tthis.currentNode.addAttribute(this.propertyName, +this.propertyValue.trim());\n\t\t\t\t\t} else if (/^(true|false)$/.test(this.propertyValue.trim().toLowerCase())) {\n\t\t\t\t\t\tif (this.propertyValue.trim().toLowerCase() === 'true') {\n\t\t\t\t\t\t\tthis.currentNode.addAttribute(this.propertyName, true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.currentNode.addAttribute(this.propertyName, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.currentNode.addAttribute(this.propertyName, this.propertyValue);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tthis.propertyName, this.propertyValue = this.tempText = '';\n\t\t\tthis.propType = 'attr';\n\t\t\treturn this.parsePropertyName;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parsePropertyValue;\n\t}\n\n\tprivate checkTextChild() {\n\t\tif (this.tempText) {\n\t\t\tthis.tempText = this.escaper.unescape(this.tempText);\n\t\t\tthis.stackTrace.push(this.tempText);\n\t\t\tthis.popElement();\n\t\t\tthis.tempText = '';\n\t\t}\n\t}\n\n\tprivate popStructuralDirectiveNodes() {\n\t\twhile (this.currentNode instanceof DomStructuralDirectiveNode) {\n\t\t\tthis.popElement();\n\t\t}\n\t}\n\n\tprivate popElement() {\n\t\tconst element = this.stackTrace.pop();\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\t\tlet parent: ChildNode | DomFragmentNode | undefined = this.stackTrace.pop();\n\t\tlet directive: DomStructuralDirectiveNode | undefined;\n\t\tif (parent instanceof DomStructuralDirectiveNode && parent.node instanceof DomFragmentNode) {\n\t\t\tdirective = parent;\n\t\t\tparent = parent.successor ?? parent.node ?? parent;\n\t\t}\n\t\tif (parent instanceof DomParentNode) {\n\t\t\tif (typeof element === 'string') {\n\t\t\t\tparent.addTextChild(element);\n\t\t\t} else if (element instanceof DomElementNode) {\n\t\t\t\tparent.addChild(this.checkNode(element));\n\t\t\t} else {\n\t\t\t\tparent.addChild(element)\n\t\t\t}\n\t\t\tthis.stackTrace.push(directive ?? parent as ChildNode);\n\t\t} else {\n\t\t\tif (typeof element === 'string') {\n\t\t\t\tparseTextChild(element).forEach(text => this.childStack.push(text));\n\t\t\t} else if (element instanceof DomElementNode) {\n\t\t\t\tconst child = this.checkNode(element);\n\t\t\t\tthis.childStack.push(child);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.childStack.push(element);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getLastStructuralDirectiveNode() {\n\t\tfor (let i = this.stackTrace.length - 1; i >= 0; i--) {\n\t\t\tconst el = this.stackTrace[i];\n\t\t\tif (el instanceof DomStructuralDirectiveNode) {\n\t\t\t\treturn el;\n\t\t\t}\n\t\t}\n\t\tfor (let i = this.childStack.length - 1; i >= 0; i--) {\n\t\t\tconst el = this.childStack[i];\n\t\t\tif (el instanceof DomStructuralDirectiveNode) {\n\t\t\t\treturn el;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n}\n\nfunction chainSuccessor(directive: DomStructuralDirectiveNode): DomStructuralDirectiveNode {\n\tif (directive.successor instanceof DomStructuralDirectiveSuccessorNode && directive.successor.children[0] instanceof DomStructuralDirectiveNode) {\n\t\treturn chainSuccessor(directive.successor.children[0]);\n\t}\n\treturn directive;\n}\n\nfunction createFilterByAttrName(attributes: string[]) {\n\treturn (attr: Attribute<string, any>) => attributes.includes(attr.name.split('.')[0]);\n}\n\nfunction createArrayCleaner(attributes: Attribute<string, any>[]) {\n\treturn (attr: Attribute<string, any>) => attributes.splice(attributes.indexOf(attr), 1);\n}\n\nexport class HTMLParser {\n\n\tnodeParser = new NodeParser();\n\n\tparse(html: string): DomChild[] {\n\t\treturn this.nodeParser.parse(html);\n\t}\n\n\ttoDomRootNode(html: string): DomNode {\n\t\tlet stack = this.nodeParser.parse(html);\n\t\tif (!stack || stack.length === 0) {\n\t\t\treturn new DomFragmentNode([new TextContent('')]);\n\t\t} else if (stack?.length === 1) {\n\t\t\treturn stack[0];\n\t\t} else {\n\t\t\treturn new DomFragmentNode(stack);\n\t\t}\n\t}\n\n\tstringify(stack?: DomNode[]) {\n\t\tlet html = '';\n\t\tstack?.forEach(node => {\n\t\t\tif (node instanceof TextContent) {\n\t\t\t\thtml += node.value;\n\t\t\t} else if (node instanceof LiveTextContent) {\n\t\t\t\thtml += `{{${node.value}}}`;\n\t\t\t} else if (node instanceof CommentNode) {\n\t\t\t\thtml += `<!-- ${node.comment} -->`;\n\t\t\t} else if (node instanceof DomFragmentNode) {\n\t\t\t\thtml += this.stringify(node.children);\n\t\t\t} else if (node instanceof DomStructuralDirectiveNode) {\n\t\t\t\thtml += `@${node.name}${node.value ? ` (${node.value})` : ''} {${this.stringify([node.node])}}${node.successor ? this.stringify([node.successor]) : ''}`;\n\t\t\t\thtml += this.stringify([node.node]);\n\t\t\t} else if (node instanceof DomStructuralDirectiveSuccessorNode) {\n\t\t\t\thtml += `@${node.name}`;\n\t\t\t\tif (node.children.length === 1 && node.children[0] instanceof DomStructuralDirectiveNode) {\n\t\t\t\t\thtml += this.stringify(node.children).substring(1);\n\t\t\t\t} else {\n\t\t\t\t\thtml += this.stringify(node.children);\n\t\t\t\t}\n\t\t\t} else if (node instanceof DomElementNode) {\n\t\t\t\tlet attrs = '';\n\t\t\t\tif (node.attributes) {\n\t\t\t\t\tattrs += node.attributes.map(attr => `${attr.name}=\"${attr.value}\"`).join(' ') + ' ';\n\t\t\t\t}\n\t\t\t\tif (node.twoWayBinding) {\n\t\t\t\t\tattrs += node.twoWayBinding.map(attr => `[(${attr.name})]=\"${attr.value}\"`).join(' ').concat(' ');\n\t\t\t\t}\n\t\t\t\tif (node.inputs) {\n\t\t\t\t\tattrs += node.inputs.map(attr => `[${attr.name}]=\"${attr.value}\"`).join(' ').concat(' ');\n\t\t\t\t}\n\t\t\t\tif (node.outputs) {\n\t\t\t\t\tattrs += node.outputs.map(attr => `(${attr.name})=\"${attr.value}\"`).join(' ').concat(' ');\n\t\t\t\t}\n\t\t\t\tif (node.templateAttrs) {\n\t\t\t\t\tattrs += node.templateAttrs.map(attr => `${attr.name}=\"${attr.value}\"`).join(' ').concat(' ');\n\t\t\t\t}\n\t\t\t\tif (isEmptyElement(node.tagName)) {\n\t\t\t\t\tif (attrs) {\n\t\t\t\t\t\thtml += `<${node.tagName} ${attrs}/>`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\thtml += `<${node.tagName} />`;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet children = this.stringify(node.children);\n\t\t\t\t\tif (attrs && children) {\n\t\t\t\t\t\thtml += `<${node.tagName} ${attrs}>${children}</${node.tagName}>`;\n\t\t\t\t\t}\n\t\t\t\t\telse if (attrs) {\n\t\t\t\t\t\thtml += `<${node.tagName} ${attrs}></${node.tagName}>`;\n\t\t\t\t\t} else if (children) {\n\t\t\t\t\t\thtml += `<${node.tagName}>${children}<</${node.tagName}>`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\thtml += `<${node.tagName}></${node.tagName}>`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn html;\n\t}\n\n\tdeserializeAttributes(attribute: Attribute<any, any>) {\n\t\tconst type = (attribute as Attribute<any, any> & { type: string }).type;\n\t\tswitch (type) {\n\t\t\tcase 'Attribute':\n\t\t\t\tinherit(attribute, Attribute);\n\t\t\t\tbreak;\n\t\t\tcase 'ElementAttribute':\n\t\t\t\tinherit(attribute, ElementAttribute);\n\t\t\t\tbreak;\n\t\t\tcase 'LiveAttribute':\n\t\t\t\tinherit(attribute, LiveAttribute);\n\t\t\t\tbreak;\n\t\t\tcase 'TextContent':\n\t\t\t\tinherit(attribute, TextContent);\n\t\t\t\tbreak;\n\t\t\tcase 'LiveTextContent':\n\t\t\t\tinherit(attribute, LiveTextContent);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tdeserializeBaseNode(node: BaseNode) {\n\t\tnode.attributes?.forEach(attr => this.deserializeAttributes(attr));\n\t\tnode.inputs?.forEach(attr => this.deserializeAttributes(attr));\n\t\tnode.outputs?.forEach(attr => this.deserializeAttributes(attr));\n\t\tnode.templateAttrs?.forEach(attr => this.deserializeAttributes(attr));\n\t\tnode.attributeDirectives?.forEach(attr => this.deserializeNode(attr as any));\n\t}\n\n\tdeserializeNode(node: DomNode) {\n\t\tconst type = (node as DomNode & { type: string }).type;\n\t\tswitch (type) {\n\t\t\tcase 'TextContent':\n\t\t\t\tinherit(node, TextContent);\n\t\t\t\tbreak;\n\t\t\tcase 'LiveTextContent':\n\t\t\t\tinherit(node, LiveTextContent);\n\t\t\t\tbreak;\n\t\t\tcase 'CommentNode':\n\t\t\t\tinherit(node, CommentNode);\n\t\t\t\tbreak;\n\t\t\tcase 'DomFragmentNode':\n\t\t\t\tinherit(node, DomFragmentNode);\n\t\t\t\t(node as DomFragmentNode).children?.forEach(child => this.deserializeNode(child));\n\t\t\t\tbreak;\n\t\t\tcase 'DomElementNode':\n\t\t\t\tinherit(node, DomElementNode);\n\t\t\t\tif ((node as DomElementNode).templateRefName) {\n\t\t\t\t\tthis.deserializeAttributes((node as DomElementNode).templateRefName!);\n\t\t\t\t}\n\t\t\t\tthis.deserializeBaseNode(node as DomElementNode);\n\t\t\t\t(node as DomElementNode).children?.forEach(child => this.deserializeNode(child));\n\t\t\t\tbreak;\n\t\t\tcase 'DomStructuralDirectiveNode':\n\t\t\t\tinherit(node, DomStructuralDirectiveNode);\n\t\t\t\tthis.deserializeNode((node as DomStructuralDirectiveNode).node);\n\t\t\t\tbreak;\n\t\t\tcase 'StructuralDirectiveSuccessorNode':\n\t\t\t\tinherit(node, DomStructuralDirectiveSuccessorNode);\n\t\t\t\t(node as DomStructuralDirectiveSuccessorNode).children?.forEach(child => this.deserializeNode(child));\n\t\t\t\tbreak;\n\t\t\tcase 'DomAttributeDirectiveNode':\n\t\t\t\tinherit(node, DomAttributeDirectiveNode);\n\t\t\t\tthis.deserializeBaseNode(node as DomAttributeDirectiveNode);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\treturn node;\n\t}\n\n}\n\nfunction inherit(object: any, type: { new(...args: any[]): {} }) {\n\tobject.__proto__ = type.prototype;\n}\n\nexport const htmlParser = new HTMLParser();\n\n"]}
1
+ {"version":3,"file":"html-parser.js","sourceRoot":"","sources":["../../../src/elements/node/html-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACN,cAAc,EAAE,WAAW,EAAE,cAAc,EAC3C,WAAW,EAAE,eAAe,EAAE,eAAe,EAC7C,0BAA0B,EAC1B,gBAAgB,EAAE,SAAS,EAAY,aAAa,EACpD,aAAa,EAAE,yBAAyB,EACxC,mCAAmC,GACnC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAMxE,MAAM,OAAO,mBAAmB;IAC/B,MAAM,CAAC,UAAU,GAA8B;QAC9C,OAAO,EAAE,GAAG;QACZ,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,GAAG;QACX,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,GAAG;KACb,CAAC;IACF,IAAI,CAAS;IACb,OAAO,CAAS;IAChB;QACC,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QAC9F,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,KAAa;QACpB,OAAO,mBAAmB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ,CAAC,IAAY;QACpB,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AC,CAAC;gBAC7D,IAAI,CAAC,eAAe,CAAE,IAAmC,CAAC,IAAI,CAAC,CAAC;gBAC/D,IAAmC,CAAC,SAAS,IAAI,IAAI,CAAC,eAAe,CAAE,IAAmC,CAAC,SAAU,CAAC,CAAC;gBACxH,MAAM;YACP,KAAK,kCAAkC;gBACtC,OAAO,CAAC,IAAI,EAAE,mCAAmC,CAAC,CAAC;gBAClD,IAA4C,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;gBACtG,MAAM;YACP,KAAK,2BAA2B;gBAC/B,OAAO,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;gBACzC,IAAI,CAAC,mBAAmB,CAAC,IAAiC,CAAC,CAAC;gBAC5D,MAAM;YACP;gBACC,MAAM;QACR,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CAED;AAED,SAAS,OAAO,CAAC,MAAW,EAAE,IAAiC;IAC9D,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","sourcesContent":["import { isEmptyElement } from '../attributes/common.js';\nimport {\n\tDomElementNode, CommentNode, parseTextChild,\n\tTextContent, LiveTextContent, DomFragmentNode,\n\tDomStructuralDirectiveNode, DomNode, DomChild,\n\tElementAttribute, Attribute, BaseNode, LiveAttribute,\n\tDomParentNode, DomAttributeDirectiveNode,\n\tDomStructuralDirectiveSuccessorNode,\n} from '../ast/dom.js';\nimport { directiveRegistry } from '../directives/register-directive.js';\n\ntype Token = (token: string) => Token;\n\ntype ChildNode = DomElementNode | DomStructuralDirectiveNode | CommentNode | string;\n\nexport class EscapeHTMLCharacter {\n\tstatic ESCAPE_MAP: { [key: string]: string } = {\n\t\t'&amp;': '&',\n\t\t'&lt;': '<',\n\t\t'&gt;': '>',\n\t\t'&quot;': '\"',\n\t\t'&#x27;': \"'\",\n\t\t'&#x60;': '`'\n\t};\n\ttest: RegExp;\n\treplace: RegExp;\n\tconstructor() {\n\t\tconst escapeRegexSource = '(?:' + Object.keys(EscapeHTMLCharacter.ESCAPE_MAP).join('|') + ')';\n\t\tthis.test = new RegExp(escapeRegexSource);\n\t\tthis.replace = new RegExp(escapeRegexSource, 'g');\n\t}\n\n\tescaper(match: string): string {\n\t\treturn EscapeHTMLCharacter.ESCAPE_MAP[match];\n\t}\n\n\tunescape(text: string): string {\n\t\tif (!text) {\n\t\t\treturn text;\n\t\t}\n\t\treturn this.test.test(text) ? text.replace(this.replace, this.escaper) : text;\n\t}\n}\n\nexport class NodeParserHelper {\n\n\tprotected checkNode(node: DomElementNode): DomElementNode | DomStructuralDirectiveNode {\n\t\tif (node instanceof DomStructuralDirectiveNode) {\n\t\t\treturn node;\n\t\t}\n\t\tconst attributes = node.attributes;\n\t\tif (attributes) {\n\t\t\tlet temp: ElementAttribute<string, any> | ElementAttribute<string, any>[] | undefined;\n\n\t\t\ttemp = attributes.find(attr => attr.name === 'is');\n\t\t\tif (temp) {\n\t\t\t\tattributes.splice(attributes.indexOf(temp), 1);\n\t\t\t\tnode.is = temp.value as string;\n\t\t\t}\n\t\t\ttemp = attributes.filter(attr => {\n\t\t\t\treturn typeof attr.value === 'string' && (/\\{\\{(.+)\\}\\}/g).test(attr.value);\n\t\t\t});\n\t\t\tif (temp?.length) {\n\t\t\t\ttemp.forEach(templateAttrs => {\n\t\t\t\t\tattributes.splice(attributes.indexOf(templateAttrs), 1);\n\t\t\t\t\tnode.addTemplateAttr(templateAttrs.name, templateAttrs.value as string);\n\t\t\t\t});\n\t\t\t}\n\t\t\ttemp = attributes.filter(attr => attr.name.startsWith('on'));\n\t\t\tif (temp?.length) {\n\t\t\t\ttemp.forEach(templateAttrs => {\n\t\t\t\t\tattributes.splice(attributes.indexOf(templateAttrs), 1);\n\t\t\t\t\tnode.addOutput(templateAttrs.name.substring(2), templateAttrs.value as string);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst directiveNames = this.extractDirectiveNames(node);\n\t\tlet sdName: string | undefined;\n\t\tif (directiveNames.length) {\n\t\t\tconst directives: DomAttributeDirectiveNode[] = [];\n\t\t\tdirectiveNames.forEach(attributeName => {\n\t\t\t\tif (attributeName.startsWith('*')) {\n\t\t\t\t\tif (sdName) {\n\t\t\t\t\t\tconsole.error(`Only one Structural Directive is allowed on an element [${sdName}, ${attributeName}]`);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsdName = attributeName;\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst directive = new DomAttributeDirectiveNode(attributeName);\n\t\t\t\tif (directiveRegistry.get(attributeName)!.hasAttributes()) {\n\t\t\t\t\tthis.extractDirectiveAttributesFromNode(attributeName, directive, node);\n\t\t\t\t}\n\t\t\t\tdirectives.push(directive);\n\t\t\t});\n\t\t\tif (directives.length) {\n\t\t\t\tnode.attributeDirectives = directives;\n\t\t\t}\n\t\t}\n\t\tif (sdName) {\n\t\t\t// <div *for [forOf]=\"array\" let-item [trackBy]=\"method\" let-i=\"index\" > {{item}} </div>\n\t\t\t// <div *for=\"let item of array; let i = index; trackBy=method;\" > {{item}} </div>\n\t\t\t// <template #refName *if=\"isActive; else disabled\" > ... </template>\n\t\t\t// <template #disabled > ... </template>\n\n\t\t\tconst temp = node.attributes!.find(attr => attr.name == sdName)!;\n\t\t\tnode.attributes!.splice(node.attributes!.indexOf(temp), 1);\n\t\t\tconst isTemplate = node.tagName === 'template';\n\n\t\t\tconst directiveNode = isTemplate ? new DomFragmentNode(node.children) : node;\n\t\t\tconst directive = new DomStructuralDirectiveNode(\n\t\t\t\ttemp.name,\n\t\t\t\tdirectiveNode,\n\t\t\t\t(typeof temp?.value === 'boolean') ? undefined : String(temp.value)\n\t\t\t);\n\t\t\tconst directiveName = temp.name.substring(1);\n\t\t\tif (isTemplate) {\n\t\t\t\tdirective.inputs = node.inputs;\n\t\t\t\tdirective.outputs = node.outputs;\n\t\t\t\tdirective.attributes = node.attributes;\n\t\t\t\tdirective.templateAttrs = node.templateAttrs;\n\t\t\t\tdirective.attributeDirectives = node.attributeDirectives;\n\t\t\t} else if (directiveRegistry.hasAttributes(directiveName)) {\n\t\t\t\tthis.extractDirectiveAttributesFromNode(directiveName, directive, node);\n\t\t\t\tdirective.attributeDirectives = node.attributeDirectives;\n\t\t\t}\n\t\t\tif (isTemplate && node.templateRefName) {\n\t\t\t\tnode.children = [directive];\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\treturn directive;\n\t\t}\n\n\t\t// <for let-user [of]=\"users\"></for>\n\t\t// @for (item of items; track item.id) {\n\t\t// \t{ { item.name } }\n\t\t// }\n\t\tif (directiveRegistry.has('*' + node.tagName)) {\n\t\t\tconst children = new DomFragmentNode(node.children);\n\t\t\tconst directive = new DomStructuralDirectiveNode('*' + node.tagName, children);\n\t\t\tdirective.inputs = node.inputs;\n\t\t\tdirective.outputs = node.outputs;\n\t\t\tdirective.attributes = node.attributes;\n\t\t\tdirective.templateAttrs = node.templateAttrs;\n\t\t\tdirective.attributeDirectives = node.attributeDirectives;\n\t\t\treturn directive;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tprotected extractDirectiveAttributesFromNode(directiveName: string, directive: BaseNode, node: DomElementNode): void {\n\t\tconst attributes = directiveRegistry.getAttributes(directiveName);\n\t\tif (!attributes) {\n\t\t\treturn;\n\t\t}\n\t\tconst filterByAttrName = createFilterByAttrName(attributes);\n\t\tdirective.attributes = node.attributes?.filter(filterByAttrName);\n\t\tdirective.inputs = node.inputs?.filter(filterByAttrName);\n\t\tdirective.outputs = node.outputs?.filter(filterByAttrName);\n\t\tdirective.twoWayBinding = node.twoWayBinding?.filter(filterByAttrName);\n\t\tdirective.templateAttrs = node.templateAttrs?.filter(filterByAttrName);\n\n\t\tnode.inputs && directive.inputs?.forEach(createArrayCleaner(node.inputs));\n\t\tnode.outputs && directive.outputs?.forEach(createArrayCleaner(node.outputs));\n\t\tnode.twoWayBinding && directive.twoWayBinding?.forEach(createArrayCleaner(node.twoWayBinding));\n\t\tnode.attributes && directive.attributes?.forEach(createArrayCleaner(node.attributes));\n\t\tnode.templateAttrs && directive.templateAttrs?.forEach(createArrayCleaner(node.templateAttrs));\n\t}\n\n\tprotected extractDirectiveNames(node: BaseNode): string[] {\n\t\tconst names: string[] = [];\n\t\tif (node.attributes?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.attributes).filter(name => name.startsWith('*')));\n\t\t}\n\t\tif (node.inputs?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.inputs));\n\t\t}\n\t\tif (node.twoWayBinding?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.twoWayBinding));\n\t\t}\n\t\tif (node.templateAttrs?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.templateAttrs));\n\t\t}\n\t\tif (node.outputs?.length) {\n\t\t\tnames.push(...this.getAttributeDirectives(node.outputs));\n\t\t}\n\t\treturn [...new Set(names)];\n\t}\n\n\tprotected getAttributeDirectives(attributes: Attribute<string, any>[]): string[] {\n\t\treturn directiveRegistry.filterDirectives(attributes.map(attr => attr.name.split('.')[0]));\n\t}\n\n}\n\nexport class NodeParser extends NodeParserHelper {\n\n\tprivate index: number;\n\tprivate stateFn: Token;\n\n\tprivate tagNameRegExp = /[\\-\\.0-9_a-z\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u203F\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|[\\uD800-\\uDB7F][\\uDC00-\\uDFFF]/;\n\n\tprivate childStack: DomChild[];\n\tprivate stackTrace: ChildNode[];\n\n\tprivate get currentNode(): DomElementNode {\n\t\treturn this.stackTrace[this.stackTrace.length - 1] as DomElementNode;\n\t}\n\n\tprivate commentOpenCount = 0;\n\tprivate commentCloseCount = 0;\n\n\tprivate tempText: string;\n\n\tprivate propertyName: string;\n\tprivate propertyValue: string;\n\tprivate propType: 'attr' | 'ref-name' | 'input' | 'output' | 'two-way';\n\n\tprivate escaper = new EscapeHTMLCharacter();\n\n\tprivate skipCount = 0;\n\tprivate flowScopeCount = 0;\n\tprivate flowChainCount = 0;\n\tprivate interpolationCount = 0;\n\n\tparse(html: string)/*: DomNode*/ {\n\t\tthis.reset();\n\t\tfor (; this.index < html.length; this.index++) {\n\t\t\tthis.stateFn = this.stateFn(html[this.index]);\n\t\t}\n\t\tthis.checkTextChild();\n\t\tthis.popStructuralDirectiveNodes();\n\t\tif (this.stackTrace.length > 0) {\n\t\t\tconsole.error(this.stackTrace);\n\t\t\tthrow new Error(`error parsing html, had ${this.stackTrace.length} element, [${(this.stackTrace as DomElementNode[]).map(dom => dom.tagName).join(', ')}], with no closing tag`);\n\t\t}\n\t\tlet stack = this.childStack;\n\t\tthis.reset();\n\t\treturn stack;\n\t}\n\n\tprivate reset() {\n\t\tthis.index = 0;\n\t\tthis.childStack = [];\n\t\tthis.stackTrace = [];\n\t\tthis.propType = 'attr';\n\t\tthis.commentOpenCount = 0;\n\t\tthis.commentCloseCount = 0;\n\t\tthis.skipCount = 0;\n\t\tthis.flowScopeCount = 0;\n\t\tthis.flowChainCount = 0;\n\t\tthis.interpolationCount = 0;\n\t\tthis.stateFn = this.parseText;\n\t\tthis.propertyName = this.propertyValue = this.tempText = '';\n\t}\n\n\tprivate parseText(token: string) {\n\t\tif (token === '<' || token === '@') {\n\t\t\tif (token === '@' && this.tempText.at(-1) === '\\\\') {\n\t\t\t\tthis.tempText = this.tempText.substring(0, this.tempText.length - 2) + token;\n\t\t\t\treturn this.parseText;\n\t\t\t} else {\n\t\t\t\tthis.checkTextChild();\n\t\t\t\treturn token === '<' ? this.parseTag : this.parseControlFlow;\n\t\t\t}\n\t\t}\n\t\telse if (this.interpolationCount === 0 && this.flowScopeCount > 0 && token === '}') {\n\t\t\tthis.checkTextChild();\n\t\t\tthis.tempText = '';\n\t\t\tthis.flowScopeCount--;\n\t\t\tconst directive = this.getLastStructuralDirectiveNode();\n\t\t\tif (directive) {\n\t\t\t\tconst lastDirective = chainSuccessor(directive);\n\t\t\t\tif ((lastDirective.successor?.children.length ?? 0) === 0 && directiveRegistry.hasSuccessors(lastDirective.name)) {\n\t\t\t\t\tthis.flowChainCount++;\n\t\t\t\t\treturn this.parsePossibleSuccessorsControlFlow;\n\t\t\t\t}\n\t\t\t\tdo {\n\t\t\t\t\tthis.flowChainCount--;\n\t\t\t\t\tthis.popElement();\n\t\t\t\t} while (this.flowChainCount > 0);\n\t\t\t}\n\t\t\treturn this.parseText;\n\t\t} else if (token === '{') {\n\t\t\tthis.interpolationCount++;\n\t\t} else if (token === '}') {\n\t\t\tthis.interpolationCount--;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseText;\n\t}\n\n\tprivate parseTag(token: string) {\n\t\tif (token === '/') {\n\t\t\treturn this.parseCloseTag;\n\t\t}\n\t\tif (token === '!') {\n\t\t\tthis.commentOpenCount = 0;\n\t\t\tthis.commentCloseCount = 0;\n\t\t\treturn this.parseComment;\n\t\t}\n\t\tthis.index--;\n\t\treturn this.parseOpenTag;\n\t}\n\n\tprivate parseComment(token: string) {\n\t\tif (token === '-') {\n\t\t\tif (this.commentOpenCount < 2) {\n\t\t\t\tthis.commentOpenCount++;\n\t\t\t} else {\n\t\t\t\tthis.commentCloseCount++;\n\t\t\t}\n\t\t\treturn this.parseComment;\n\t\t}\n\t\telse if (token === '>' && this.commentCloseCount === 2) {\n\t\t\tthis.tempText = this.escaper.unescape(this.tempText);\n\t\t\tthis.stackTrace.push(new CommentNode(this.tempText.trim()));\n\t\t\tthis.popElement();\n\t\t\tthis.tempText = '';\n\t\t\tthis.commentOpenCount = 0;\n\t\t\tthis.commentCloseCount = 0;\n\t\t\treturn this.parseText;\n\t\t}\n\t\telse if (token === '>' && this.commentCloseCount === 0) {\n\t\t\tconst temp = this.tempText.toLowerCase();\n\t\t\tif ('doctype html' === temp) {\n\t\t\t\tthis.tempText = '';\n\t\t\t\treturn this.parseText;\n\t\t\t}\n\t\t}\n\t\tif (this.commentCloseCount > 0) {\n\t\t\tfor (let i = 0; i < this.commentCloseCount; i++) {\n\t\t\t\tthis.tempText += '-';\n\t\t\t}\n\t\t\tthis.commentCloseCount = 0;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseComment;\n\t}\n\n\tprivate parseCloseTag(token: string) {\n\t\tif (token === '>') {\n\t\t\tif (!isEmptyElement(this.currentNode.tagName)\n\t\t\t\t&& this.currentNode.tagName.trim().toLowerCase() !== this.tempText.trim().toLowerCase()\n\t\t\t) {\n\t\t\t\tthrow new Error(`Wrong closed tag at char ${this.index}, tag name: ${this.currentNode.tagName}`);\n\t\t\t}\n\t\t\tthis.popElement();\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parseText;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseCloseTag;\n\t}\n\n\tprivate parseOpenTag(token: string) {\n\t\tif (token === '>') {\n\t\t\tthis.stackTrace.push(new DomElementNode(this.tempText));\n\t\t\tif (isEmptyElement(this.tempText)) {\n\t\t\t\tthis.popElement();\n\t\t\t}\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parseText;\n\t\t}\n\t\telse if (this.tagNameRegExp.test(token)) {\n\t\t\tthis.tempText += token;\n\t\t\treturn this.parseOpenTag;\n\t\t}\n\t\telse if (/\\s/.test(token)) {\n\t\t\tthis.stackTrace.push(new DomElementNode(this.tempText));\n\t\t\tthis.tempText = '';\n\t\t\tthis.propType = 'attr';\n\t\t\treturn this.parsePropertyName;\n\t\t}\n\t\tthrow new SyntaxError('Error while parsing open tag');\n\t}\n\n\tprivate parsePropertyName(token: string) {\n\t\tif (token === '>') {\n\t\t\tif (this.tempText.trim()) {\n\t\t\t\tthis.propertyName = this.tempText;\n\t\t\t\tthis.currentNode.addAttribute(this.propertyName, true);\n\t\t\t\tthis.propertyName = this.propertyValue = this.tempText = '';\n\t\t\t}\n\t\t\tif (isEmptyElement(this.currentNode.tagName)) {\n\t\t\t\tthis.popElement();\n\t\t\t}\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parseText;\n\t\t}\n\t\telse if (token === '/') {\n\t\t\treturn this.parsePropertyName;\n\t\t}\n\t\telse if (/\\[/.test(token)) {\n\t\t\tthis.propType = 'input';\n\t\t\treturn this.parseInputOutput;\n\t\t}\n\t\telse if (/\\(|@/.test(token)) {\n\t\t\tthis.propType = 'output';\n\t\t\treturn this.parseInputOutput;\n\t\t}\n\t\telse if (/#/.test(token)) {\n\t\t\tthis.propType = 'ref-name';\n\t\t\treturn this.parseRefName;\n\t\t}\n\t\telse if (/=/.test(token)) {\n\t\t\tthis.propertyName = this.tempText;\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parsePropertyName;\n\t\t} else if (/\"/.test(token)) {\n\t\t\treturn this.parsePropertyValue;\n\t\t} else if (/\\d/.test(token)) {\n\t\t\tthis.tempText += token;\n\t\t\treturn this.parsePropertyValue;\n\t\t}\n\t\telse if (/\\s/.test(token)) {\n\t\t\tif (this.tempText.trim()) {\n\t\t\t\tthis.propertyName = this.tempText;\n\t\t\t\tthis.currentNode.addAttribute(this.propertyName, true);\n\t\t\t\tthis.propertyName, this.propertyValue = this.tempText = '';\n\t\t\t}\n\t\t\treturn this.parsePropertyName;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parsePropertyName;\n\t}\n\n\tprivate parseRefName(token: string) {\n\t\tif (/=/.test(token)) {\n\t\t\treturn this.parseRefName;\n\t\t}\n\t\telse if (/\"/.test(token)) {\n\t\t\tthis.propertyName = this.tempText;\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parsePropertyValue;\n\t\t} else if (/\\s/.test(token)) {\n\t\t\tthis.currentNode.setTemplateRefName(this.tempText, '');\n\t\t\tthis.propertyName = this.tempText = '';\n\t\t\tthis.propType = 'attr';\n\t\t\treturn this.parsePropertyName;\n\t\t} else if (/>/.test(token)) {\n\t\t\tthis.currentNode.setTemplateRefName(this.tempText, '');\n\t\t\tthis.propertyName = this.tempText = '';\n\t\t\tthis.propType = 'attr';\n\t\t\treturn this.parseText;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseRefName;\n\t}\n\n\tprivate parseInputOutput(token: string) {\n\t\tif (/\\(/.test(token)) {\n\t\t\tthis.propType = 'two-way';\n\t\t\treturn this.parseInputOutput;\n\t\t}\n\t\telse if (/\\)|\\]|=/.test(token)) {\n\t\t\treturn this.parseInputOutput;\n\t\t}\n\t\telse if (/\"/.test(token)) {\n\t\t\tthis.propertyName = this.tempText;\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parsePropertyValue;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseInputOutput;\n\t}\n\n\tprivate parseControlFlow(token: string) {\n\t\tif (token === '(') {\n\t\t\tconst flowName = '*' + this.tempText.trim();\n\t\t\tthis.stackTrace.push(new DomStructuralDirectiveNode(flowName, new DomFragmentNode()));\n\t\t\tthis.tempText = '';\n\t\t\tthis.skipCount = 1;\n\t\t\treturn this.parseControlFlowExpression;\n\t\t} else if (token === '{') {\n\t\t\tif (this.tempText.trim()) {\n\t\t\t\tconst flowName = '*' + this.tempText.trim();\n\t\t\t\tthis.stackTrace.push(new DomStructuralDirectiveNode(flowName, new DomFragmentNode()));\n\t\t\t}\n\t\t\tthis.skipCount = 0;\n\t\t\tthis.tempText = '';\n\t\t\tthis.flowScopeCount++;\n\t\t\treturn this.parseText;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseControlFlow;\n\t}\n\n\tprivate parseControlFlowExpression(token: string) {\n\t\tif (token === ')') {\n\t\t\tthis.skipCount--;\n\t\t\tif (this.skipCount == 0 && this.currentNode instanceof DomStructuralDirectiveNode) {\n\t\t\t\tthis.currentNode.value = this.tempText;\n\t\t\t\tthis.tempText = '';\n\t\t\t\treturn this.parseControlFlow;\n\t\t\t}\n\t\t\tthrow new SyntaxError(`Control Flow Expression Syntax Error`);\n\t\t} else if (token === '(') {\n\t\t\tthis.skipCount++;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseControlFlowExpression;\n\t}\n\n\tprivate parsePossibleSuccessorsControlFlow(token: string) {\n\t\tif (/\\s/.test(token)) {\n\t\t\tthis.tempText += token;\n\t\t\treturn this.parsePossibleSuccessorsControlFlow;\n\t\t}\n\t\tif (token === '@') {\n\t\t\tthis.tempText = '';\n\t\t\treturn this.parsePossibleSuccessorsControlFlowName;\n\t\t}\n\t\tdo {\n\t\t\tthis.flowChainCount--;\n\t\t\tthis.popElement();\n\t\t} while (this.flowChainCount > 0);\n\t\tthis.index--;\n\t\treturn this.parseText;\n\t}\n\n\tprivate parsePossibleSuccessorsControlFlowName(token: string) {\n\t\tif (/\\s/.test(token) || token === '{') {\n\t\t\tconst successorFlowName = '*' + this.tempText.trim();\n\t\t\tconst directive = this.getLastStructuralDirectiveNode();\n\t\t\tif (directive) {\n\t\t\t\tconst isSuccessor = directiveRegistry.hasSuccessor(directive.name, successorFlowName);\n\t\t\t\tif (isSuccessor) {\n\t\t\t\t\tdirective.successor = new DomStructuralDirectiveSuccessorNode(successorFlowName);\n\t\t\t\t\tthis.tempText = '';\n\t\t\t\t\tthis.index--;\n\t\t\t\t\treturn this.parseSuccessorsControlFlowName;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.tempText += token;\n\t\t\treturn this.parseText;\n\t\t} else if (token === '(') {\n\t\t\tthis.popStructuralDirectiveNodes();\n\t\t\tthis.index--;\n\t\t\treturn this.parseControlFlow;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parsePossibleSuccessorsControlFlowName;\n\t}\n\n\tprivate parseSuccessorsControlFlowName(token: string) {\n\t\tif (token === '(' || token === '{') {\n\t\t\tthis.index--;\n\t\t\treturn this.parseControlFlow;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parseSuccessorsControlFlowName;\n\t}\n\n\tprivate parsePropertyValue(token: string) {\n\t\tif (/\"/.test(token)) {\n\t\t\tthis.propertyValue = this.tempText;\n\t\t\tswitch (this.propType) {\n\t\t\t\tcase 'input':\n\t\t\t\t\tthis.currentNode.addInput(this.propertyName, this.propertyValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'output':\n\t\t\t\t\tthis.currentNode.addOutput(this.propertyName, this.propertyValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'two-way':\n\t\t\t\t\tthis.currentNode.addTwoWayBinding(this.propertyName, this.propertyValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ref-name':\n\t\t\t\t\tthis.currentNode.setTemplateRefName(this.propertyName, this.propertyValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'attr':\n\t\t\t\tdefault:\n\t\t\t\t\tif (/^([-+]?\\d*\\.?\\d+)(?:[eE]([-+]?\\d+))?$/.test(this.propertyValue.trim())) {\n\t\t\t\t\t\tthis.currentNode.addAttribute(this.propertyName, +this.propertyValue.trim());\n\t\t\t\t\t} else if (/^(true|false)$/.test(this.propertyValue.trim().toLowerCase())) {\n\t\t\t\t\t\tif (this.propertyValue.trim().toLowerCase() === 'true') {\n\t\t\t\t\t\t\tthis.currentNode.addAttribute(this.propertyName, true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.currentNode.addAttribute(this.propertyName, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.currentNode.addAttribute(this.propertyName, this.propertyValue);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tthis.propertyName, this.propertyValue = this.tempText = '';\n\t\t\tthis.propType = 'attr';\n\t\t\treturn this.parsePropertyName;\n\t\t}\n\t\tthis.tempText += token;\n\t\treturn this.parsePropertyValue;\n\t}\n\n\tprivate checkTextChild() {\n\t\tif (this.tempText) {\n\t\t\tthis.tempText = this.escaper.unescape(this.tempText);\n\t\t\tthis.stackTrace.push(this.tempText);\n\t\t\tthis.popElement();\n\t\t\tthis.tempText = '';\n\t\t}\n\t}\n\n\tprivate popStructuralDirectiveNodes() {\n\t\twhile (this.currentNode instanceof DomStructuralDirectiveNode) {\n\t\t\tthis.popElement();\n\t\t}\n\t}\n\n\tprivate popElement() {\n\t\tconst element = this.stackTrace.pop();\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\t\tlet parent: ChildNode | DomFragmentNode | undefined = this.stackTrace.pop();\n\t\tlet directive: DomStructuralDirectiveNode | undefined;\n\t\tif (parent instanceof DomStructuralDirectiveNode && parent.node instanceof DomFragmentNode) {\n\t\t\tdirective = parent;\n\t\t\tparent = parent.successor ?? parent.node ?? parent;\n\t\t}\n\t\tif (parent instanceof DomParentNode) {\n\t\t\tif (typeof element === 'string') {\n\t\t\t\tparent.addTextChild(element);\n\t\t\t} else if (element instanceof DomElementNode) {\n\t\t\t\tparent.addChild(this.checkNode(element));\n\t\t\t} else {\n\t\t\t\tparent.addChild(element)\n\t\t\t}\n\t\t\tthis.stackTrace.push(directive ?? parent as ChildNode);\n\t\t} else {\n\t\t\tif (typeof element === 'string') {\n\t\t\t\tparseTextChild(element).forEach(text => this.childStack.push(text));\n\t\t\t} else if (element instanceof DomElementNode) {\n\t\t\t\tconst child = this.checkNode(element);\n\t\t\t\tthis.childStack.push(child);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.childStack.push(element);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getLastStructuralDirectiveNode() {\n\t\tfor (let i = this.stackTrace.length - 1; i >= 0; i--) {\n\t\t\tconst el = this.stackTrace[i];\n\t\t\tif (el instanceof DomStructuralDirectiveNode) {\n\t\t\t\treturn el;\n\t\t\t}\n\t\t}\n\t\tfor (let i = this.childStack.length - 1; i >= 0; i--) {\n\t\t\tconst el = this.childStack[i];\n\t\t\tif (el instanceof DomStructuralDirectiveNode) {\n\t\t\t\treturn el;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n}\n\nfunction chainSuccessor(directive: DomStructuralDirectiveNode): DomStructuralDirectiveNode {\n\tif (directive.successor instanceof DomStructuralDirectiveSuccessorNode && directive.successor.children[0] instanceof DomStructuralDirectiveNode) {\n\t\treturn chainSuccessor(directive.successor.children[0]);\n\t}\n\treturn directive;\n}\n\nfunction createFilterByAttrName(attributes: string[]) {\n\treturn (attr: Attribute<string, any>) => attributes.includes(attr.name.split('.')[0]);\n}\n\nfunction createArrayCleaner(attributes: Attribute<string, any>[]) {\n\treturn (attr: Attribute<string, any>) => attributes.splice(attributes.indexOf(attr), 1);\n}\n\nexport class HTMLParser {\n\n\tnodeParser = new NodeParser();\n\n\tparse(html: string): DomChild[] {\n\t\treturn this.nodeParser.parse(html);\n\t}\n\n\ttoDomRootNode(html: string): DomNode {\n\t\tlet stack = this.nodeParser.parse(html);\n\t\tif (!stack || stack.length === 0) {\n\t\t\treturn new DomFragmentNode([new TextContent('')]);\n\t\t} else if (stack?.length === 1) {\n\t\t\treturn stack[0];\n\t\t} else {\n\t\t\treturn new DomFragmentNode(stack);\n\t\t}\n\t}\n\n\tstringify(stack?: DomNode[]) {\n\t\tlet html = '';\n\t\tstack?.forEach(node => {\n\t\t\tif (node instanceof TextContent) {\n\t\t\t\thtml += node.value;\n\t\t\t} else if (node instanceof LiveTextContent) {\n\t\t\t\thtml += `{{${node.value}}}`;\n\t\t\t} else if (node instanceof CommentNode) {\n\t\t\t\thtml += `<!-- ${node.comment} -->`;\n\t\t\t} else if (node instanceof DomFragmentNode) {\n\t\t\t\thtml += this.stringify(node.children);\n\t\t\t} else if (node instanceof DomStructuralDirectiveNode) {\n\t\t\t\thtml += `@${node.name}${node.value ? ` (${node.value})` : ''} {${this.stringify([node.node])}}${node.successor ? this.stringify([node.successor]) : ''}`;\n\t\t\t\thtml += this.stringify([node.node]);\n\t\t\t} else if (node instanceof DomStructuralDirectiveSuccessorNode) {\n\t\t\t\thtml += `@${node.name}`;\n\t\t\t\tif (node.children.length === 1 && node.children[0] instanceof DomStructuralDirectiveNode) {\n\t\t\t\t\thtml += this.stringify(node.children).substring(1);\n\t\t\t\t} else {\n\t\t\t\t\thtml += this.stringify(node.children);\n\t\t\t\t}\n\t\t\t} else if (node instanceof DomElementNode) {\n\t\t\t\tlet attrs = '';\n\t\t\t\tif (node.attributes) {\n\t\t\t\t\tattrs += node.attributes.map(attr => `${attr.name}=\"${attr.value}\"`).join(' ') + ' ';\n\t\t\t\t}\n\t\t\t\tif (node.twoWayBinding) {\n\t\t\t\t\tattrs += node.twoWayBinding.map(attr => `[(${attr.name})]=\"${attr.value}\"`).join(' ').concat(' ');\n\t\t\t\t}\n\t\t\t\tif (node.inputs) {\n\t\t\t\t\tattrs += node.inputs.map(attr => `[${attr.name}]=\"${attr.value}\"`).join(' ').concat(' ');\n\t\t\t\t}\n\t\t\t\tif (node.outputs) {\n\t\t\t\t\tattrs += node.outputs.map(attr => `(${attr.name})=\"${attr.value}\"`).join(' ').concat(' ');\n\t\t\t\t}\n\t\t\t\tif (node.templateAttrs) {\n\t\t\t\t\tattrs += node.templateAttrs.map(attr => `${attr.name}=\"${attr.value}\"`).join(' ').concat(' ');\n\t\t\t\t}\n\t\t\t\tif (isEmptyElement(node.tagName)) {\n\t\t\t\t\tif (attrs) {\n\t\t\t\t\t\thtml += `<${node.tagName} ${attrs}/>`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\thtml += `<${node.tagName} />`;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet children = this.stringify(node.children);\n\t\t\t\t\tif (attrs && children) {\n\t\t\t\t\t\thtml += `<${node.tagName} ${attrs}>${children}</${node.tagName}>`;\n\t\t\t\t\t}\n\t\t\t\t\telse if (attrs) {\n\t\t\t\t\t\thtml += `<${node.tagName} ${attrs}></${node.tagName}>`;\n\t\t\t\t\t} else if (children) {\n\t\t\t\t\t\thtml += `<${node.tagName}>${children}<</${node.tagName}>`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\thtml += `<${node.tagName}></${node.tagName}>`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn html;\n\t}\n\n\tdeserializeAttributes(attribute: Attribute<any, any>) {\n\t\tconst type = (attribute as Attribute<any, any> & { type: string }).type;\n\t\tswitch (type) {\n\t\t\tcase 'Attribute':\n\t\t\t\tinherit(attribute, Attribute);\n\t\t\t\tbreak;\n\t\t\tcase 'ElementAttribute':\n\t\t\t\tinherit(attribute, ElementAttribute);\n\t\t\t\tbreak;\n\t\t\tcase 'LiveAttribute':\n\t\t\t\tinherit(attribute, LiveAttribute);\n\t\t\t\tbreak;\n\t\t\tcase 'TextContent':\n\t\t\t\tinherit(attribute, TextContent);\n\t\t\t\tbreak;\n\t\t\tcase 'LiveTextContent':\n\t\t\t\tinherit(attribute, LiveTextContent);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tdeserializeBaseNode(node: BaseNode) {\n\t\tnode.attributes?.forEach(attr => this.deserializeAttributes(attr));\n\t\tnode.inputs?.forEach(attr => this.deserializeAttributes(attr));\n\t\tnode.outputs?.forEach(attr => this.deserializeAttributes(attr));\n\t\tnode.templateAttrs?.forEach(attr => this.deserializeAttributes(attr));\n\t\tnode.attributeDirectives?.forEach(attr => this.deserializeNode(attr as any));\n\t}\n\n\tdeserializeNode(node: DomNode) {\n\t\tconst type = (node as DomNode & { type: string }).type;\n\t\tswitch (type) {\n\t\t\tcase 'TextContent':\n\t\t\t\tinherit(node, TextContent);\n\t\t\t\tbreak;\n\t\t\tcase 'LiveTextContent':\n\t\t\t\tinherit(node, LiveTextContent);\n\t\t\t\tbreak;\n\t\t\tcase 'CommentNode':\n\t\t\t\tinherit(node, CommentNode);\n\t\t\t\tbreak;\n\t\t\tcase 'DomFragmentNode':\n\t\t\t\tinherit(node, DomFragmentNode);\n\t\t\t\t(node as DomFragmentNode).children?.forEach(child => this.deserializeNode(child));\n\t\t\t\tbreak;\n\t\t\tcase 'DomElementNode':\n\t\t\t\tinherit(node, DomElementNode);\n\t\t\t\tif ((node as DomElementNode).templateRefName) {\n\t\t\t\t\tthis.deserializeAttributes((node as DomElementNode).templateRefName!);\n\t\t\t\t}\n\t\t\t\tthis.deserializeBaseNode(node as DomElementNode);\n\t\t\t\t(node as DomElementNode).children?.forEach(child => this.deserializeNode(child));\n\t\t\t\tbreak;\n\t\t\tcase 'DomStructuralDirectiveNode':\n\t\t\t\tinherit(node, DomStructuralDirectiveNode);\n\t\t\t\tthis.deserializeBaseNode(node as DomStructuralDirectiveNode);\n\t\t\t\tthis.deserializeNode((node as DomStructuralDirectiveNode).node);\n\t\t\t\t(node as DomStructuralDirectiveNode).successor && this.deserializeNode((node as DomStructuralDirectiveNode).successor!);\n\t\t\t\tbreak;\n\t\t\tcase 'StructuralDirectiveSuccessorNode':\n\t\t\t\tinherit(node, DomStructuralDirectiveSuccessorNode);\n\t\t\t\t(node as DomStructuralDirectiveSuccessorNode).children?.forEach(child => this.deserializeNode(child));\n\t\t\t\tbreak;\n\t\t\tcase 'DomAttributeDirectiveNode':\n\t\t\t\tinherit(node, DomAttributeDirectiveNode);\n\t\t\t\tthis.deserializeBaseNode(node as DomAttributeDirectiveNode);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\treturn node;\n\t}\n\n}\n\nfunction inherit(object: any, type: { new(...args: any[]): {} }) {\n\tobject.__proto__ = type.prototype;\n}\n\nexport const htmlParser = new HTMLParser();\n\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibyar/elements",
3
- "version": "2.0.2",
3
+ "version": "2.1.1",
4
4
  "description": "Ibyar elements, hold info about HTMLElements class, attributes and tag name",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ibyar/aurora/tree/dev/packages/elements",
@@ -51,5 +51,5 @@
51
51
  "a11y",
52
52
  "front-end"
53
53
  ],
54
- "gitHead": "59201a2da8d5f72094275e23bf7377bbc664af78"
54
+ "gitHead": "fe5f9e549067991c34ef34d6f5aeac7ce1e8f253"
55
55
  }