vasille-web 7.0.0-rc.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -16
- package/build/dev/communication.d.ts +9 -0
- package/build/dev/css-injector.d.ts +14 -0
- package/build/dev/css-injector.js +37 -0
- package/build/dev/css.d.ts +3 -0
- package/build/dev/css.js +32 -0
- package/build/dev/index.d.ts +55 -0
- package/build/dev/index.js +64 -0
- package/build/dev/inspector.d.ts +18 -0
- package/build/dev/inspector.js +226 -0
- package/build/dev/mount.d.ts +11 -0
- package/build/dev/mount.js +91 -0
- package/build/dev/router.d.ts +23 -0
- package/build/dev/router.js +67 -0
- package/build/dev/runner.d.ts +34 -0
- package/build/dev/runner.js +128 -0
- package/build/shadow/css.d.ts +23 -0
- package/build/shadow/css.js +77 -0
- package/build/shadow/index.d.ts +3 -0
- package/build/shadow/index.js +3 -0
- package/build/shadow/lib.d.ts +11 -0
- package/build/shadow/lib.js +145 -0
- package/build/shadow/types.d.ts +31 -0
- package/build/ssg/awaited.d.ts +3 -0
- package/build/ssg/awaited.js +24 -0
- package/build/ssg/css.d.ts +8 -0
- package/build/ssg/css.js +36 -0
- package/build/ssg/index.d.ts +21 -0
- package/build/ssg/index.js +37 -0
- package/build/ssg/router.d.ts +17 -0
- package/build/ssg/router.js +59 -0
- package/build/ssg/runner.d.ts +56 -0
- package/build/ssg/runner.js +337 -0
- package/build/types/index.d.ts +9 -0
- package/build/types/index.js +1 -0
- package/build/web/css/index.d.ts +21 -0
- package/build/web/css/index.js +53 -0
- package/build/web/css/lib.d.ts +10 -0
- package/build/web/css/lib.js +75 -0
- package/build/web/index.d.ts +6 -0
- package/build/web/index.js +6 -0
- package/{types → build/web/jsx}/jsx-runtime.d.ts +8 -7
- package/build/web/jsx/spec/css.d.ts +7 -0
- package/build/web/jsx/spec/css.js +1 -0
- package/{types → build/web/jsx}/spec/html.d.ts +2 -0
- package/build/web/jsx/spec/html.js +1 -0
- package/build/web/mount.d.ts +19 -0
- package/{lib/index.js → build/web/mount.js} +26 -21
- package/build/web/router/router.d.ts +45 -0
- package/build/web/router/router.js +131 -0
- package/build/web/runner/binding/attribute.d.ts +16 -0
- package/build/web/runner/binding/attribute.js +30 -0
- package/build/web/runner/binding/binding.d.ts +20 -0
- package/build/web/runner/binding/binding.js +28 -0
- package/build/web/runner/binding/class.d.ts +9 -0
- package/build/web/runner/binding/class.js +32 -0
- package/build/web/runner/binding/property.d.ts +16 -0
- package/build/web/runner/binding/property.js +20 -0
- package/build/web/runner/binding/style.d.ts +17 -0
- package/build/web/runner/binding/style.js +32 -0
- package/build/web/runner/runner.d.ts +45 -0
- package/build/web/runner/runner.js +176 -0
- package/coverage/clover.xml +754 -0
- package/coverage/coverage-final.json +20 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/dev/css-injector.ts.html +250 -0
- package/coverage/lcov-report/dev/css.ts.html +220 -0
- package/coverage/lcov-report/dev/index.html +131 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +221 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/shadow/css.ts.html +382 -0
- package/coverage/lcov-report/shadow/index.html +131 -0
- package/coverage/lcov-report/shadow/lib.ts.html +670 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/ssg/awaited.ts.html +169 -0
- package/coverage/lcov-report/ssg/css.ts.html +223 -0
- package/coverage/lcov-report/ssg/index.html +176 -0
- package/coverage/lcov-report/ssg/index.ts.html +370 -0
- package/coverage/lcov-report/ssg/router.ts.html +388 -0
- package/coverage/lcov-report/ssg/runner.ts.html +1405 -0
- package/coverage/lcov-report/web/css/index.html +131 -0
- package/coverage/lcov-report/web/css/index.ts.html +313 -0
- package/coverage/lcov-report/web/css/lib.ts.html +352 -0
- package/coverage/lcov-report/web/index.html +116 -0
- package/coverage/lcov-report/web/index.ts.html +574 -0
- package/coverage/lcov-report/web/mount.ts.html +454 -0
- package/coverage/lcov-report/web/router/index.html +116 -0
- package/coverage/lcov-report/web/router/router.ts.html +784 -0
- package/coverage/lcov-report/web/runner/binding/attribute.ts.html +190 -0
- package/coverage/lcov-report/web/runner/binding/binding.ts.html +193 -0
- package/coverage/lcov-report/web/runner/binding/class.ts.html +199 -0
- package/coverage/lcov-report/web/runner/binding/index.html +176 -0
- package/coverage/lcov-report/web/runner/binding/property.ts.html +154 -0
- package/coverage/lcov-report/web/runner/binding/style.ts.html +205 -0
- package/coverage/lcov-report/web/runner/index.html +116 -0
- package/coverage/lcov-report/web/runner/runner.ts.html +835 -0
- package/coverage/lcov.info +1554 -0
- package/jest.config.cjs +37 -0
- package/package.json +91 -60
- package/test/api/dev.test.ts +5 -0
- package/test/api/import-list.ts +106 -0
- package/test/api/shadow.test.ts +5 -0
- package/test/api/ssg.test.ts +5 -0
- package/test/api/web.test.ts +5 -0
- package/test/css/css-dev.test.ts +103 -0
- package/test/css/css.test.ts +27 -0
- package/test/mount/exported-web-router.test.ts +63 -0
- package/test/mount/modal-no-ctx.test.ts +14 -0
- package/test/mount/modal-which-throws.test.ts +33 -0
- package/test/mount/modal-with-slot.test.ts +39 -0
- package/test/mount/modal.test.ts +34 -0
- package/test/mount/prompt-error.test.ts +44 -0
- package/test/mount/prompt-timeout.test.ts +53 -0
- package/test/mount/prompt-which-trows.test.ts +33 -0
- package/test/mount/prompt.test.ts +44 -0
- package/test/page.ts +16 -0
- package/test/router/empty-router.test.ts +21 -0
- package/test/router/page.ts +19 -0
- package/test/router/router.test.ts +774 -0
- package/test/router/v7.test.ts +129 -0
- package/test/runner/destruction.test.ts +113 -0
- package/test/runner/runner.test.ts +403 -0
- package/test/shadow/components/Component.ts +72 -0
- package/test/shadow/css.test.ts +68 -0
- package/test/shadow/page.ts +21 -0
- package/test/shadow/shadow.test.ts +71 -0
- package/test/ssg/awaited/awaited.test.ts +11 -0
- package/test/ssg/awaited/element.test.ts +6 -0
- package/test/ssg/awaited/element.tsx +10 -0
- package/test/ssg/awaited/element.tsx.html +12 -0
- package/test/ssg/awaited/embed.test.ts +6 -0
- package/test/ssg/awaited/embed.tsx +14 -0
- package/test/ssg/awaited/embed.tsx.html +16 -0
- package/test/ssg/awaited/text.test.ts +6 -0
- package/test/ssg/awaited/text.tsx +8 -0
- package/test/ssg/awaited/text.tsx.html +7 -0
- package/test/ssg/awaited/throw-sync.tsx +10 -0
- package/test/ssg/awaited/throw-sync.tsx.html +7 -0
- package/test/ssg/awaited/throw.tsx +13 -0
- package/test/ssg/awaited/throw.tsx.html +7 -0
- package/test/ssg/compose/compose.test.ts +25 -0
- package/test/ssg/compose/modal.tsx +29 -0
- package/test/ssg/compose/modal.tsx.html +16 -0
- package/test/ssg/compose/view.tsx +35 -0
- package/test/ssg/compose/view.tsx.html +12 -0
- package/test/ssg/core/core.test.ts +31 -0
- package/test/ssg/core/div-embed.tsx +7 -0
- package/test/ssg/core/div-embed.tsx.html +9 -0
- package/test/ssg/core/div-with-class.tsx +5 -0
- package/test/ssg/core/div-with-class.tsx.html +9 -0
- package/test/ssg/core/div-with-text.tsx +5 -0
- package/test/ssg/core/div-with-text.tsx.html +9 -0
- package/test/ssg/core/div.tsx +5 -0
- package/test/ssg/core/div.tsx.html +7 -0
- package/test/ssg/core/text-join.tsx +9 -0
- package/test/ssg/core/text-join.tsx.html +10 -0
- package/test/ssg/core/text.tsx +5 -0
- package/test/ssg/core/text.tsx.html +7 -0
- package/test/ssg/css/css.test.ts +6 -0
- package/test/ssg/css/css.tsx +34 -0
- package/test/ssg/css/css.tsx.html +28 -0
- package/test/ssg/extra-tags/body.tsx +6 -0
- package/test/ssg/extra-tags/body.tsx.html +7 -0
- package/test/ssg/extra-tags/extra-tags.test.ts +11 -0
- package/test/ssg/extra-tags/head.tsx +9 -0
- package/test/ssg/extra-tags/head.tsx.html +12 -0
- package/test/ssg/markdown/blocks.tsx +12 -0
- package/test/ssg/markdown/blocks.tsx.md +12 -0
- package/test/ssg/markdown/css.tsx +11 -0
- package/test/ssg/markdown/css.tsx.md +1 -0
- package/test/ssg/markdown/external.tsx +7 -0
- package/test/ssg/markdown/external.tsx.md +3 -0
- package/test/ssg/markdown/heading.tsx +12 -0
- package/test/ssg/markdown/heading.tsx.md +13 -0
- package/test/ssg/markdown/hybrid.tsx +15 -0
- package/test/ssg/markdown/hybrid.tsx.md +11 -0
- package/test/ssg/markdown/lists.tsx +26 -0
- package/test/ssg/markdown/lists.tsx.md +16 -0
- package/test/ssg/markdown/markdown.test.ts +41 -0
- package/test/ssg/markdown/stylish.tsx +19 -0
- package/test/ssg/markdown/stylish.tsx.md +15 -0
- package/test/ssg/markdown/table.tsx +32 -0
- package/test/ssg/markdown/table.tsx.md +11 -0
- package/test/ssg/router/embed.html +7 -0
- package/test/ssg/router/embed.tsx +5 -0
- package/test/ssg/router/file-html.tsx +5 -0
- package/test/ssg/router/file.html +7 -0
- package/test/ssg/router/index.html +7 -0
- package/test/ssg/router/index.tsx +5 -0
- package/test/ssg/router/router.test.ts +26 -0
- package/test/ssg/run-test.ts +33 -0
- package/test/ssg/runner/attr.tsx +7 -0
- package/test/ssg/runner/attr.tsx.html +7 -0
- package/test/ssg/runner/class.tsx +8 -0
- package/test/ssg/runner/class.tsx.html +7 -0
- package/test/ssg/runner/runner.test.ts +16 -0
- package/test/ssg/runner/style.tsx +19 -0
- package/test/ssg/runner/style.tsx.html +7 -0
- package/test/tsconfig.json +20 -0
- package/lib/dev.js +0 -109
- package/types/dev.d.ts +0 -10
- package/types/index.d.ts +0 -21
- package/types/spec/css.d.ts +0 -7
- /package/{lib/spec/css.js → build/dev/communication.js} +0 -0
- /package/{lib/spec/html.js → build/shadow/types.js} +0 -0
- /package/{lib → build/web/jsx}/jsx-runtime.js +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Binding } from "./binding.js";
|
|
2
|
+
export function stringifyStyleValue(value) {
|
|
3
|
+
if (value instanceof Array) {
|
|
4
|
+
return value.map(item => `${item}px`).join(" ");
|
|
5
|
+
}
|
|
6
|
+
if (typeof value === "number") {
|
|
7
|
+
return `${value}px`;
|
|
8
|
+
}
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Describes a style attribute binding
|
|
13
|
+
* @class StyleBinding
|
|
14
|
+
* @extends Binding
|
|
15
|
+
*/
|
|
16
|
+
export class StyleBinding extends Binding {
|
|
17
|
+
/**
|
|
18
|
+
* Constructs a style binding attribute
|
|
19
|
+
* @param node {Tag} the vasille node
|
|
20
|
+
* @param name {string} the name of style property
|
|
21
|
+
* @param value {IValue} the value to bind
|
|
22
|
+
*/
|
|
23
|
+
constructor(node, name, value) {
|
|
24
|
+
super(value);
|
|
25
|
+
this.init(value => {
|
|
26
|
+
/* istanbul ignore else */
|
|
27
|
+
if (node.node instanceof HTMLElement && (value || value === 0)) {
|
|
28
|
+
node.node.style.setProperty(name, stringifyStyleValue(value));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IRunner, IValue, Tag, TextNode } from "vasille";
|
|
2
|
+
import { CssStyleInjector } from "../css/index.js";
|
|
3
|
+
export type AttrType<T> = IValue<T | string | null, unknown> | T | string | null | undefined;
|
|
4
|
+
export type StyleType<T> = T | number | number[] | IValue<string | number | number[] | undefined, unknown> | undefined;
|
|
5
|
+
export interface WebTagOptions {
|
|
6
|
+
/** attributes */
|
|
7
|
+
a?: Record<string, AttrType<number | boolean>>;
|
|
8
|
+
/** classes */
|
|
9
|
+
c?: (string | CssStyleInjector | IValue<string | CssStyleInjector | false | null | undefined, unknown> | null | undefined)[];
|
|
10
|
+
/** style */
|
|
11
|
+
s?: Record<string, StyleType<string>>;
|
|
12
|
+
/** events */
|
|
13
|
+
e?: Record<string, ((...args: unknown[]) => unknown) | [(...args: unknown[]) => unknown, object | boolean]>;
|
|
14
|
+
/** bindings */
|
|
15
|
+
b?: Record<string, any>;
|
|
16
|
+
/** slot */
|
|
17
|
+
l?: (ctx: WebTag<typeof this, WebRunner<typeof this>>) => void;
|
|
18
|
+
/** callback */
|
|
19
|
+
k?: (node: Element) => void | Element | (() => void);
|
|
20
|
+
/** run on destroy */
|
|
21
|
+
d?: () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare class WebTextNode<Options extends WebTagOptions, RunnerT extends WebRunner<Options>> extends TextNode<Node, Element, Options, RunnerT> {
|
|
24
|
+
protected node: Text;
|
|
25
|
+
compose(): void;
|
|
26
|
+
destroy(deep: number, keepNodes?: boolean): void;
|
|
27
|
+
unmount(): void;
|
|
28
|
+
remount(): void;
|
|
29
|
+
protected findFirstChild(): Node;
|
|
30
|
+
}
|
|
31
|
+
export declare class WebTag<Options extends WebTagOptions, RunnerT extends WebRunner<Options>> extends Tag<Node, Element, Options, RunnerT> {
|
|
32
|
+
compose(): void;
|
|
33
|
+
destroy(deep: number, keepNodes?: boolean): void;
|
|
34
|
+
unmount(): void;
|
|
35
|
+
remount(): void;
|
|
36
|
+
protected applyOptions(options: WebTagOptions): void;
|
|
37
|
+
}
|
|
38
|
+
export declare class WebRunner<Options extends WebTagOptions> implements IRunner<Node, Element, Options> {
|
|
39
|
+
readonly document: Document;
|
|
40
|
+
constructor(document: Document);
|
|
41
|
+
insertBefore(node: Node, before: Element | Node): void;
|
|
42
|
+
appendChild(node: Element, child: Element | Node): void;
|
|
43
|
+
textNode(deep: number, text: unknown): TextNode<Node, Element, Options>;
|
|
44
|
+
tag(deep: number, tagName: string, input: Options, cb?: ((ctx: Tag<Node, Element, Options>) => void) | undefined): Tag<Node, Element, Options>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { AttributeBinding } from "./binding/attribute.js";
|
|
2
|
+
import { addClass, DynamicalClassBinding } from "./binding/class.js";
|
|
3
|
+
import { PropertyBinding } from "./binding/property.js";
|
|
4
|
+
import { stringifyStyleValue, StyleBinding } from "./binding/style.js";
|
|
5
|
+
import { internalError, IValue, safe, Tag, TextNode } from "vasille";
|
|
6
|
+
import { CssStyleInjector } from "../css/index.js";
|
|
7
|
+
export class WebTextNode extends TextNode {
|
|
8
|
+
compose() {
|
|
9
|
+
const text = this.data;
|
|
10
|
+
this.node = this.runner.document.createTextNode((text instanceof IValue ? text.V : text)?.toString() ?? "");
|
|
11
|
+
if (text instanceof IValue) {
|
|
12
|
+
this.handler = (v) => {
|
|
13
|
+
this.node.replaceData(0, -1, v?.toString() ?? "");
|
|
14
|
+
};
|
|
15
|
+
text.on(this.handler);
|
|
16
|
+
}
|
|
17
|
+
this.parent.appendNode(this.node);
|
|
18
|
+
}
|
|
19
|
+
destroy(deep, keepNodes) {
|
|
20
|
+
/* istanbul ignore else */
|
|
21
|
+
if (!keepNodes) {
|
|
22
|
+
this.node.remove();
|
|
23
|
+
}
|
|
24
|
+
super.destroy(deep, keepNodes);
|
|
25
|
+
}
|
|
26
|
+
unmount() {
|
|
27
|
+
this.node.remove();
|
|
28
|
+
}
|
|
29
|
+
remount() {
|
|
30
|
+
if (this.next) {
|
|
31
|
+
this.next.insertAdjacent(this.node);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.parent.appendNode(this.node);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
findFirstChild() {
|
|
38
|
+
return this.node;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export class WebTag extends Tag {
|
|
42
|
+
compose() {
|
|
43
|
+
const name = this.name;
|
|
44
|
+
if (!name) {
|
|
45
|
+
throw internalError("wrong Tag constructor call");
|
|
46
|
+
}
|
|
47
|
+
const node = this.runner.document.createElement(name);
|
|
48
|
+
const options = this.options;
|
|
49
|
+
this.node = node;
|
|
50
|
+
this.applyOptions(options);
|
|
51
|
+
this.parent.appendNode(node);
|
|
52
|
+
options.l?.(this);
|
|
53
|
+
const destructor = options.k?.(node);
|
|
54
|
+
if (typeof destructor === "function") {
|
|
55
|
+
this.runOnDestroy(destructor);
|
|
56
|
+
}
|
|
57
|
+
if (options.d) {
|
|
58
|
+
this.runOnDestroy(options.d);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
destroy(deep, keepNodes) {
|
|
62
|
+
super.destroy(deep, true);
|
|
63
|
+
/* istanbul ignore else */
|
|
64
|
+
if (!keepNodes) {
|
|
65
|
+
this.node?.remove();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
unmount() {
|
|
69
|
+
this.node?.remove();
|
|
70
|
+
}
|
|
71
|
+
remount() {
|
|
72
|
+
const { node } = this;
|
|
73
|
+
/* istanbul ignore else */
|
|
74
|
+
if (node) {
|
|
75
|
+
if (this.next) {
|
|
76
|
+
this.next.insertAdjacent(node);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.parent.appendNode(node);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
applyOptions(options) {
|
|
84
|
+
const { node } = this;
|
|
85
|
+
if (options.a && node) {
|
|
86
|
+
for (const name in options.a) {
|
|
87
|
+
const value = options.a[name];
|
|
88
|
+
if (value instanceof IValue) {
|
|
89
|
+
this.bind(new AttributeBinding(this, name, value));
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
/* istanbul ignore else */
|
|
93
|
+
if (typeof value === "boolean") {
|
|
94
|
+
/* istanbul ignore else */
|
|
95
|
+
if (value) {
|
|
96
|
+
node.setAttribute(name, "");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else if (value !== null && value !== undefined) {
|
|
100
|
+
node.setAttribute(name, `${value}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (options.c) {
|
|
106
|
+
options.c.forEach(item => {
|
|
107
|
+
if (item instanceof IValue) {
|
|
108
|
+
this.bind(new DynamicalClassBinding(this, item));
|
|
109
|
+
}
|
|
110
|
+
else if (typeof item == "string") {
|
|
111
|
+
addClass(this, item);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
/* istanbul ignore else */
|
|
115
|
+
if (item instanceof CssStyleInjector) {
|
|
116
|
+
addClass(this, item.inject());
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (options.s && node instanceof HTMLElement) {
|
|
122
|
+
for (const name in options.s) {
|
|
123
|
+
const value = options.s[name];
|
|
124
|
+
if (value instanceof IValue) {
|
|
125
|
+
this.bind(new StyleBinding(this, name, value));
|
|
126
|
+
}
|
|
127
|
+
else if (value) {
|
|
128
|
+
node.style.setProperty(name, stringifyStyleValue(value));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (options.e && node) {
|
|
133
|
+
for (const name in options.e) {
|
|
134
|
+
const event = options.e[name];
|
|
135
|
+
const handler = event instanceof Array ? event : [event, {}];
|
|
136
|
+
node.addEventListener(name, safe(ev => handler[0](ev, node)), handler[1]);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (options.b) {
|
|
140
|
+
for (const k in options.b) {
|
|
141
|
+
const value = options.b[k];
|
|
142
|
+
if (!(value instanceof IValue)) {
|
|
143
|
+
node[k] = value;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
node[k] = value.V;
|
|
147
|
+
this.bind(new PropertyBinding(this, k, value));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export class WebRunner {
|
|
154
|
+
constructor(document) {
|
|
155
|
+
this.document = document;
|
|
156
|
+
}
|
|
157
|
+
insertBefore(node, before) {
|
|
158
|
+
const parent = before.parentElement;
|
|
159
|
+
/* istanbul ignore else */
|
|
160
|
+
if (parent) {
|
|
161
|
+
parent.insertBefore(node, before);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
appendChild(node, child) {
|
|
165
|
+
node.appendChild(child);
|
|
166
|
+
}
|
|
167
|
+
textNode(deep, text) {
|
|
168
|
+
return new WebTextNode({ text }, this, deep);
|
|
169
|
+
}
|
|
170
|
+
tag(deep, tagName, input, cb) {
|
|
171
|
+
if (cb) {
|
|
172
|
+
input.l = cb;
|
|
173
|
+
}
|
|
174
|
+
return new WebTag(input, this, tagName, deep);
|
|
175
|
+
}
|
|
176
|
+
}
|