@ibyar/elements 0.8.3 → 0.8.4
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/accessibility/drag-and-drop.d.ts +2 -2
- package/accessibility/region.d.ts +4 -4
- package/accessibility/relationship.d.ts +23 -23
- package/accessibility/widget.d.ts +23 -23
- package/ast/dom.d.ts +3 -3
- package/attributes/tags.d.ts +1 -1
- package/node/html-parser.js +4 -4
- package/node/html-parser.js.map +1 -1
- package/package.json +13 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type AriaDropEffect = 'copy' | 'execute' | 'link' | 'move' | 'none' | 'popup';
|
|
2
|
+
export type AriaGrabbed = boolean | undefined;
|
|
3
3
|
export interface DragAndDropModel {
|
|
4
4
|
ariaDropEffect: AriaDropEffect;
|
|
5
5
|
ariaGrabbed: AriaGrabbed;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export type AriaBusy = boolean;
|
|
2
|
+
export type AriaLive = 'assertive' | 'off' | 'polite';
|
|
3
|
+
export type AriaRelevant = 'additions' | 'removals' | 'text' | 'additions text' | 'all';
|
|
4
|
+
export type AriaAtomic = boolean;
|
|
5
5
|
export interface LiveRegionModel {
|
|
6
6
|
ariaBusy: AriaBusy;
|
|
7
7
|
ariaLive: AriaLive;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* element id attribute
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
4
|
+
export type ElementID = string;
|
|
5
|
+
export type AriaActiveDescendantElement = ElementID;
|
|
6
|
+
export type AriaActiveDescendantElementRole = 'application' | 'combobox' | 'composite' | 'group' | 'textbox';
|
|
7
|
+
export type AriaColCount = number;
|
|
8
|
+
export type AriaColCountRole = 'table' | 'grid' | 'treegrid';
|
|
9
|
+
export type AriaColIndex = number;
|
|
10
|
+
export type AriaColIndexRole = 'cell' | 'row' | 'columnheader' | 'gridcell' | 'rowheader';
|
|
11
|
+
export type AriaColSpan = number;
|
|
12
|
+
export type AriaColSpanRole = 'cell' | 'columnheader' | 'rowheader';
|
|
13
|
+
export type AriaControlsElements = ElementID | ElementID[];
|
|
14
|
+
export type AriaDescribedByElements = ElementID | ElementID[];
|
|
15
|
+
export type AriaDetailsElements = ElementID | ElementID[];
|
|
16
|
+
export type AriaDescription = string;
|
|
17
|
+
export type AriaErrorMessageElement = ElementID;
|
|
18
|
+
export type AriaErrorMessageElementRole = 'application' | 'checkbox' | 'combobox' | 'gridcell' | 'listbox' | 'radiogroup' | 'slider' | 'spinbutton' | 'textbox' | 'tree' | 'columnheader' | 'rowheader' | 'searchbox' | 'switch' | 'treegrid';
|
|
19
|
+
export type AriaFlowToElements = ElementID | ElementID[];
|
|
20
|
+
export type AriaLabelledByElements = ElementID | ElementID[];
|
|
21
|
+
export type AriaOwnsElements = ElementID | ElementID[];
|
|
22
|
+
export type AriaPosInSet = number;
|
|
23
23
|
/**
|
|
24
24
|
* The number of rows in the full table or -1 is the table size is not known.
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type AriaRowCount = number;
|
|
27
27
|
/**
|
|
28
28
|
* An integer greater than or equal to 1, greater than the aria-rowindex of the previous row, if any, and less than or equal to the value of aria-rowcount.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type AriaRowIndex = number;
|
|
31
31
|
/**
|
|
32
32
|
* An integer greater than or equal to 0 and less than would cause a cell to overlap the next cell in the same column.
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type AriaRowSpan = number;
|
|
35
35
|
/**
|
|
36
36
|
* The number of items in the full set or -1 is the set size is unknown.
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type AriaSetSize = number;
|
|
39
39
|
export interface RelationshipModel {
|
|
40
40
|
ariaActiveDescendantElement: AriaActiveDescendantElement;
|
|
41
41
|
ariaColCount: AriaColCount;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { AriaErrorMessageElement } from './relationship.js';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
2
|
+
export type AriaAutocomplete = 'none' | 'inline' | 'list' | 'booth';
|
|
3
|
+
export type AriaChecked = true | false | undefined | 'mixed';
|
|
4
|
+
export type AriaDisabled = boolean;
|
|
5
|
+
export type AriaExpanded = boolean | undefined;
|
|
6
|
+
export type AriaHasPopup = boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
7
|
+
export type AriaHidden = boolean | undefined;
|
|
8
|
+
export type AriaInvalid = 'grammar' | 'spelling' | boolean;
|
|
9
|
+
export type AriaLabel = string;
|
|
10
|
+
export type AriaLevel = number;
|
|
11
|
+
export type AriaModal = boolean;
|
|
12
|
+
export type AriaMultiline = boolean;
|
|
13
|
+
export type AriaMultiSelectable = boolean;
|
|
14
|
+
export type AriaOrientation = 'horizontal' | 'vertical';
|
|
15
|
+
export type AriaPlaceholder = string;
|
|
16
|
+
export type AriaPressed = boolean | 'mixed' | undefined;
|
|
17
|
+
export type AriaReadonly = boolean;
|
|
18
|
+
export type AriaRequired = boolean;
|
|
19
|
+
export type AriaSelected = boolean | undefined;
|
|
20
|
+
export type AriaSort = 'ascending' | 'descending' | 'none' | 'other';
|
|
21
|
+
export type AriaValueMax = number;
|
|
22
|
+
export type AriaValueMin = number;
|
|
23
|
+
export type AriaValueNow = number;
|
|
24
|
+
export type AriaValueText = string;
|
|
25
25
|
export interface WidgetModel {
|
|
26
26
|
ariaAutocomplete: AriaAutocomplete;
|
|
27
27
|
ariaChecked: AriaChecked;
|
package/ast/dom.d.ts
CHANGED
|
@@ -168,8 +168,8 @@ export declare class DomStructuralDirectiveNode extends BaseNode {
|
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
export declare function isDOMDirectiveNode(node: object): node is DomStructuralDirectiveNode;
|
|
171
|
-
export
|
|
172
|
-
export
|
|
173
|
-
export
|
|
171
|
+
export type DomChild = DomElementNode | DomStructuralDirectiveNode | CommentNode | TextContent | LiveTextContent;
|
|
172
|
+
export type DomNode = DomFragmentNode | DomElementNode | DomStructuralDirectiveNode | CommentNode | TextContent | LiveTextContent;
|
|
173
|
+
export type DomRenderNode<T> = (model: T) => DomNode;
|
|
174
174
|
export declare function parseTextChild(text: string): Array<TextContent | LiveTextContent>;
|
|
175
175
|
export declare function parseStringTemplate(text: string): string;
|
package/attributes/tags.d.ts
CHANGED
package/node/html-parser.js
CHANGED
|
@@ -138,7 +138,7 @@ export class NodeParserHelper {
|
|
|
138
138
|
extractDirectiveNames(node) {
|
|
139
139
|
const names = [];
|
|
140
140
|
if (node.attributes?.length) {
|
|
141
|
-
names.push(...this.getAttributeDirectives(node.attributes));
|
|
141
|
+
names.push(...this.getAttributeDirectives(node.attributes).filter(name => name.startsWith('*')));
|
|
142
142
|
}
|
|
143
143
|
if (node.inputs?.length) {
|
|
144
144
|
names.push(...this.getAttributeDirectives(node.inputs));
|
|
@@ -152,10 +152,10 @@ export class NodeParserHelper {
|
|
|
152
152
|
if (node.outputs?.length) {
|
|
153
153
|
names.push(...this.getAttributeDirectives(node.outputs));
|
|
154
154
|
}
|
|
155
|
-
return names;
|
|
155
|
+
return [...new Set(names)];
|
|
156
156
|
}
|
|
157
157
|
getAttributeDirectives(attributes) {
|
|
158
|
-
return directiveRegistry.filterDirectives(attributes.map(attr => attr.name));
|
|
158
|
+
return directiveRegistry.filterDirectives(attributes.map(attr => attr.name.split('.')[0]));
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
export class NodeParser extends NodeParserHelper {
|
|
@@ -451,7 +451,7 @@ export class NodeParser extends NodeParserHelper {
|
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
function createFilterByAttrName(attributes) {
|
|
454
|
-
return (attr) => attributes.includes(attr.name);
|
|
454
|
+
return (attr) => attributes.includes(attr.name.split('.')[0]);
|
|
455
455
|
}
|
|
456
456
|
function createArrayCleaner(attributes) {
|
|
457
457
|
return (attr) => attributes.splice(attributes.indexOf(attr), 1);
|
package/node/html-parser.js.map
CHANGED
|
@@ -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,SAAS,EAAE,yBAAyB,EAC5C,aAAa,EACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAMxE,MAAM,OAAO,mBAAmB;IAW/B;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,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CAAC;gBAChE,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;SACP;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, DomAttributeDirectiveNode,\n\tBaseNode, LiveAttribute\n} from '../ast/dom.js';\nimport { directiveRegistry } from '../directives/register-directive.js';\n\ntype Token = (token: string) => Token;\n\ntype ChildNode = DomElementNode | CommentNode | string;\n\nexport class EscapeHTMLCharacter {\n\tstatic ESCAPE_MAP: { [key: string]: string } = {\n\t\t'&': '&',\n\t\t'<': '<',\n\t\t'>': '>',\n\t\t'"': '\"',\n\t\t''': \"'\",\n\t\t'`': '`'\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\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!.filter(attr => attr.name == sdName)[0];\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 = (typeof temp?.value === 'boolean')\n\t\t\t\t? new DomStructuralDirectiveNode(temp.name, directiveNode)\n\t\t\t\t: new DomStructuralDirectiveNode(temp.name, directiveNode, String(temp.value));\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\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\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\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));\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 names;\n\t}\n\tprotected getAttributeDirectives(attributes: Attribute<string, any>[]): string[] {\n\t\treturn directiveRegistry.filterDirectives(attributes.map(attr => attr.name));\n\t}\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\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\tif (this.tempText && this.stateFn === this.parseText) {\n\t\t\tthis.stateFn('<');\n\t\t}\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.stateFn = this.parseText;\n\t\tthis.propertyName = this.propertyValue = this.tempText = '';\n\t}\n\n\tprivate parseText(token: string) {\n\t\tif (token === '<') {\n\t\t\tif (this.tempText) {\n\t\t\t\tthis.tempText = this.escaper.unescape(this.tempText);\n\t\t\t\tthis.stackTrace.push(this.tempText);\n\t\t\t\tthis.popElement();\n\t\t\t\tthis.tempText = '';\n\t\t\t}\n\t\t\treturn this.parseTag;\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\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 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\n\tprivate popElement() {\n\t\tconst element = this.stackTrace.pop();\n\t\tif (element) {\n\t\t\tconst parent = this.stackTrace.pop();\n\t\t\tif (parent && parent instanceof DomElementNode) {\n\t\t\t\tif (typeof element === 'string') {\n\t\t\t\t\tparent.addTextChild(element);\n\t\t\t\t} else if (element instanceof DomElementNode) {\n\t\t\t\t\tparent.addChild(this.checkNode(element));\n\t\t\t\t} else {\n\t\t\t\t\tparent.addChild(element);\n\t\t\t\t}\n\t\t\t\tthis.stackTrace.push(parent);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (typeof element === 'string') {\n\t\t\t\t\tparseTextChild(element).forEach(text => this.childStack.push(text));\n\t\t\t\t} else if (element instanceof DomElementNode) {\n\t\t\t\t\tthis.childStack.push(this.checkNode(element));\n\t\t\t\t} else {\n\t\t\t\t\tthis.childStack.push(element);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n}\n\nfunction createFilterByAttrName(attributes: string[]) {\n\treturn (attr: Attribute<string, any>) => attributes.includes(attr.name);\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 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 '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,EAAE,yBAAyB,EAC5C,aAAa,EACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAMxE,M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,CAAC,eAAe,EAAE;oBAC7C,IAAI,CAAC,qBAAqB,CAAE,IAAuB,CAAC,eAAgB,CAAC,CAAC;iBACtE;gBACD,IAAI,CAAC,mBAAmB,CAAC,IAAsB,CAAC,CAAC;gBAChD,IAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;gBACjF,MAAM;YACP,KAAK,4BAA4B;gBAChC,OAAO,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAAC;gBAC1C,IAAI,CAAC,eAAe,CAAE,IAAmC,CAAC,IAAI,CAAC,CAAC;gBAChE,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;SACP;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, DomAttributeDirectiveNode,\n\tBaseNode, LiveAttribute\n} from '../ast/dom.js';\nimport { directiveRegistry } from '../directives/register-directive.js';\n\ntype Token = (token: string) => Token;\n\ntype ChildNode = DomElementNode | CommentNode | string;\n\nexport class EscapeHTMLCharacter {\n\tstatic ESCAPE_MAP: { [key: string]: string } = {\n\t\t'&': '&',\n\t\t'<': '<',\n\t\t'>': '>',\n\t\t'"': '\"',\n\t\t''': \"'\",\n\t\t'`': '`'\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\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!.filter(attr => attr.name == sdName)[0];\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 = (typeof temp?.value === 'boolean')\n\t\t\t\t? new DomStructuralDirectiveNode(temp.name, directiveNode)\n\t\t\t\t: new DomStructuralDirectiveNode(temp.name, directiveNode, String(temp.value));\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\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\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\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\tprotected getAttributeDirectives(attributes: Attribute<string, any>[]): string[] {\n\t\treturn directiveRegistry.filterDirectives(attributes.map(attr => attr.name.split('.')[0]));\n\t}\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\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\tif (this.tempText && this.stateFn === this.parseText) {\n\t\t\tthis.stateFn('<');\n\t\t}\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.stateFn = this.parseText;\n\t\tthis.propertyName = this.propertyValue = this.tempText = '';\n\t}\n\n\tprivate parseText(token: string) {\n\t\tif (token === '<') {\n\t\t\tif (this.tempText) {\n\t\t\t\tthis.tempText = this.escaper.unescape(this.tempText);\n\t\t\t\tthis.stackTrace.push(this.tempText);\n\t\t\t\tthis.popElement();\n\t\t\t\tthis.tempText = '';\n\t\t\t}\n\t\t\treturn this.parseTag;\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\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 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\n\tprivate popElement() {\n\t\tconst element = this.stackTrace.pop();\n\t\tif (element) {\n\t\t\tconst parent = this.stackTrace.pop();\n\t\t\tif (parent && parent instanceof DomElementNode) {\n\t\t\t\tif (typeof element === 'string') {\n\t\t\t\t\tparent.addTextChild(element);\n\t\t\t\t} else if (element instanceof DomElementNode) {\n\t\t\t\t\tparent.addChild(this.checkNode(element));\n\t\t\t\t} else {\n\t\t\t\t\tparent.addChild(element);\n\t\t\t\t}\n\t\t\t\tthis.stackTrace.push(parent);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (typeof element === 'string') {\n\t\t\t\t\tparseTextChild(element).forEach(text => this.childStack.push(text));\n\t\t\t\t} else if (element instanceof DomElementNode) {\n\t\t\t\t\tthis.childStack.push(this.checkNode(element));\n\t\t\t\t} else {\n\t\t\t\t\tthis.childStack.push(element);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\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 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 '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": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
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",
|
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
"url": "https://github.com/ibyar/aurora.git",
|
|
10
10
|
"directory": "packages/elements"
|
|
11
11
|
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/ibyar/aurora/issues"
|
|
14
|
+
},
|
|
15
|
+
"author": "The Ibyar Authors (https://github.com/ibyar/aurora/graphs/contributors)",
|
|
16
|
+
"contributors": [
|
|
17
|
+
{
|
|
18
|
+
"name": "Muhammad Salem",
|
|
19
|
+
"email": "salem.ebo@gmail.com"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
12
22
|
"main": "./index.js",
|
|
13
23
|
"module": "./index.js",
|
|
14
24
|
"types": "./index.d.ts",
|
|
@@ -25,7 +35,7 @@
|
|
|
25
35
|
"access": "public"
|
|
26
36
|
},
|
|
27
37
|
"devDependencies": {
|
|
28
|
-
"typescript": "^4.
|
|
38
|
+
"typescript": "^4.9.4"
|
|
29
39
|
},
|
|
30
40
|
"scripts": {
|
|
31
41
|
"build": "tsc --build --verbose"
|
|
@@ -40,5 +50,5 @@
|
|
|
40
50
|
"a11y",
|
|
41
51
|
"front-end"
|
|
42
52
|
],
|
|
43
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "bb412fef645853fc2af3d86e14b633813a988a2b"
|
|
44
54
|
}
|