verstak 0.23.120 → 0.23.122
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/build/dist/source/core/Interfaces.d.ts +46 -45
- package/build/dist/source/core/Interfaces.js +11 -11
- package/build/dist/source/core/Utils.d.ts +4 -4
- package/build/dist/source/core/Utils.js +4 -4
- package/build/dist/source/core/Verstak.d.ts +29 -29
- package/build/dist/source/core/Verstak.js +226 -222
- package/build/dist/source/html/Elements.d.ts +27 -0
- package/build/dist/source/html/{Blocks.js → Elements.js} +61 -61
- package/build/dist/source/html/HtmlDriver.d.ts +11 -11
- package/build/dist/source/html/HtmlDriver.js +42 -42
- package/build/dist/source/html/HtmlElements.d.ts +175 -0
- package/build/dist/source/html/{HtmlBlocks.js → HtmlElements.js} +175 -175
- package/build/dist/source/html/ReactingFocuser.js +3 -3
- package/build/dist/source/html/api.d.ts +2 -2
- package/build/dist/source/html/api.js +2 -2
- package/build/dist/source/html/sensors/ResizeSensor.d.ts +2 -2
- package/build/dist/source/html/sensors/ResizeSensor.js +3 -3
- package/package.json +1 -1
- package/build/dist/source/html/Blocks.d.ts +0 -27
- package/build/dist/source/html/HtmlBlocks.d.ts +0 -175
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { El, ElKind, ElBuilder, Align, ElCoords, ElArea } from "../core/api.js";
|
|
2
|
+
import { HtmlDriver } from "./HtmlDriver.js";
|
|
3
|
+
export declare function Section<M = unknown, R = void>(builder?: ElBuilder<HTMLElement, M, R>, base?: ElBuilder<HTMLElement, M, R>): El<HTMLElement, M, R>;
|
|
4
|
+
export declare function Table<M = unknown, R = void>(builder?: ElBuilder<HTMLElement, M, R>, base?: ElBuilder<HTMLElement, M, R>): El<HTMLElement, M, R>;
|
|
5
|
+
export declare function row<T = void>(builder?: (element: void) => T, shiftCursorDown?: number): void;
|
|
6
|
+
export declare function startNewRow(shiftCursorDown?: number): void;
|
|
7
|
+
export declare function cursor(areaParams: ElArea): void;
|
|
8
|
+
export declare function Note(content: string, builder?: ElBuilder<HTMLElement, void, void>): El<HTMLElement, void, void>;
|
|
9
|
+
export declare function HtmlNote(content: string, builder?: ElBuilder<HTMLElement, void, void>): El<HTMLElement, void, void>;
|
|
10
|
+
export declare function Group<M = unknown, R = void>(builder?: ElBuilder<HTMLElement, M, R>, base?: ElBuilder<HTMLElement, M, R>): El<HTMLElement, M, R>;
|
|
11
|
+
export declare function Fragment<M = unknown, R = void>(builder?: ElBuilder<void, M, R>, base?: ElBuilder<void, M, R>): El<void, M, R>;
|
|
12
|
+
export declare class VerstakHtmlDriver<T extends HTMLElement> extends HtmlDriver<T> {
|
|
13
|
+
applyKind(element: El<T, any, any>, value: ElKind): void;
|
|
14
|
+
applyCoords(element: El<T>, value: ElCoords | undefined): void;
|
|
15
|
+
applyWidthGrowth(element: El<T>, value: number): void;
|
|
16
|
+
applyMinWidth(element: El<T>, value: string): void;
|
|
17
|
+
applyMaxWidth(element: El<T>, value: string): void;
|
|
18
|
+
applyHeightGrowth(element: El<T>, value: number): void;
|
|
19
|
+
applyMinHeight(element: El<T>, value: string): void;
|
|
20
|
+
applyMaxHeight(element: El<T>, value: string): void;
|
|
21
|
+
applyContentAlignment(element: El<T>, value: Align): void;
|
|
22
|
+
applyElementAlignment(element: El<T>, value: Align): void;
|
|
23
|
+
applyContentWrapping(element: El<T>, value: boolean): void;
|
|
24
|
+
applyOverlayVisible(element: El<T>, value: boolean | undefined): void;
|
|
25
|
+
applyStyle(element: El<T, any, any>, secondary: boolean, styleName: string, enabled?: boolean): void;
|
|
26
|
+
update(element: El<T>): void | Promise<void>;
|
|
27
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Verstak,
|
|
1
|
+
import { Verstak, ElKind, Align, CursorCommandDriver, BaseDriver } from "../core/api.js";
|
|
2
2
|
import { HtmlDriver } from "./HtmlDriver.js";
|
|
3
3
|
export function Section(builder, base) {
|
|
4
4
|
return Verstak.claim(Drivers.section, builder, base);
|
|
@@ -15,21 +15,21 @@ export function startNewRow(shiftCursorDown) {
|
|
|
15
15
|
}
|
|
16
16
|
export function cursor(areaParams) {
|
|
17
17
|
Verstak.claim(Drivers.cursor, {
|
|
18
|
-
|
|
18
|
+
update(b) {
|
|
19
19
|
b.area = areaParams;
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
export function Note(content, builder) {
|
|
24
24
|
return Verstak.claim(Drivers.note, builder, {
|
|
25
|
-
|
|
25
|
+
update(b) {
|
|
26
26
|
b.native.innerText = content;
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
export function HtmlNote(content, builder) {
|
|
31
31
|
return Verstak.claim(Drivers.note, builder, {
|
|
32
|
-
|
|
32
|
+
update(b) {
|
|
33
33
|
b.native.innerHTML = content;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
@@ -41,14 +41,14 @@ export function Fragment(builder, base) {
|
|
|
41
41
|
return Verstak.claim(BaseDriver.fragment, builder, base);
|
|
42
42
|
}
|
|
43
43
|
export class VerstakHtmlDriver extends HtmlDriver {
|
|
44
|
-
applyKind(
|
|
44
|
+
applyKind(element, value) {
|
|
45
45
|
const kind = Constants.layouts[value];
|
|
46
|
-
kind &&
|
|
47
|
-
VerstakDriversByLayout[value](
|
|
48
|
-
super.applyKind(
|
|
46
|
+
kind && element.native.setAttribute(Constants.attribute, kind);
|
|
47
|
+
VerstakDriversByLayout[value](element);
|
|
48
|
+
super.applyKind(element, value);
|
|
49
49
|
}
|
|
50
|
-
applyCoords(
|
|
51
|
-
const s =
|
|
50
|
+
applyCoords(element, value) {
|
|
51
|
+
const s = element.native.style;
|
|
52
52
|
if (value) {
|
|
53
53
|
const x1 = value.x1 || 1;
|
|
54
54
|
const y1 = value.y1 || 1;
|
|
@@ -58,10 +58,10 @@ export class VerstakHtmlDriver extends HtmlDriver {
|
|
|
58
58
|
}
|
|
59
59
|
else
|
|
60
60
|
s.gridArea = "";
|
|
61
|
-
super.applyCoords(
|
|
61
|
+
super.applyCoords(element, value);
|
|
62
62
|
}
|
|
63
|
-
applyWidthGrowth(
|
|
64
|
-
const s =
|
|
63
|
+
applyWidthGrowth(element, value) {
|
|
64
|
+
const s = element.native.style;
|
|
65
65
|
if (value > 0) {
|
|
66
66
|
s.flexGrow = `${value}`;
|
|
67
67
|
s.flexBasis = "0";
|
|
@@ -71,17 +71,17 @@ export class VerstakHtmlDriver extends HtmlDriver {
|
|
|
71
71
|
s.flexBasis = "";
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
applyMinWidth(
|
|
75
|
-
|
|
74
|
+
applyMinWidth(element, value) {
|
|
75
|
+
element.native.style.minWidth = `${value}`;
|
|
76
76
|
}
|
|
77
|
-
applyMaxWidth(
|
|
78
|
-
|
|
77
|
+
applyMaxWidth(element, value) {
|
|
78
|
+
element.native.style.maxWidth = `${value}`;
|
|
79
79
|
}
|
|
80
|
-
applyHeightGrowth(
|
|
81
|
-
const bNode =
|
|
80
|
+
applyHeightGrowth(element, value) {
|
|
81
|
+
const bNode = element.node;
|
|
82
82
|
const driver = bNode.driver;
|
|
83
83
|
if (driver.isRow) {
|
|
84
|
-
const s =
|
|
84
|
+
const s = element.native.style;
|
|
85
85
|
if (value > 0)
|
|
86
86
|
s.flexGrow = `${value}`;
|
|
87
87
|
else
|
|
@@ -90,19 +90,19 @@ export class VerstakHtmlDriver extends HtmlDriver {
|
|
|
90
90
|
else {
|
|
91
91
|
const hostDriver = bNode.host.node.driver;
|
|
92
92
|
if (hostDriver.isRow) {
|
|
93
|
-
driver.
|
|
93
|
+
driver.applyElementAlignment(element, Align.ToBounds);
|
|
94
94
|
hostDriver.applyHeightGrowth(bNode.host, value);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
applyMinHeight(
|
|
99
|
-
|
|
98
|
+
applyMinHeight(element, value) {
|
|
99
|
+
element.native.style.minHeight = `${value}`;
|
|
100
100
|
}
|
|
101
|
-
applyMaxHeight(
|
|
102
|
-
|
|
101
|
+
applyMaxHeight(element, value) {
|
|
102
|
+
element.native.style.maxHeight = `${value}`;
|
|
103
103
|
}
|
|
104
|
-
applyContentAlignment(
|
|
105
|
-
const s =
|
|
104
|
+
applyContentAlignment(element, value) {
|
|
105
|
+
const s = element.native.style;
|
|
106
106
|
if ((value & Align.Default) === 0) {
|
|
107
107
|
const v = AlignToCss[(value >> 2) & 0b11];
|
|
108
108
|
const h = AlignToCss[value & 0b11];
|
|
@@ -114,8 +114,8 @@ export class VerstakHtmlDriver extends HtmlDriver {
|
|
|
114
114
|
else
|
|
115
115
|
s.justifyContent = s.alignContent = s.textAlign = "";
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
const s =
|
|
117
|
+
applyElementAlignment(element, value) {
|
|
118
|
+
const s = element.native.style;
|
|
119
119
|
if ((value & Align.Default) === 0) {
|
|
120
120
|
const v = AlignToCss[(value >> 2) & 0b11];
|
|
121
121
|
const h = AlignToCss[value & 0b11];
|
|
@@ -125,8 +125,8 @@ export class VerstakHtmlDriver extends HtmlDriver {
|
|
|
125
125
|
else
|
|
126
126
|
s.alignSelf = s.justifySelf = "";
|
|
127
127
|
}
|
|
128
|
-
applyContentWrapping(
|
|
129
|
-
const s =
|
|
128
|
+
applyContentWrapping(element, value) {
|
|
129
|
+
const s = element.native.style;
|
|
130
130
|
if (value) {
|
|
131
131
|
s.flexFlow = "wrap";
|
|
132
132
|
s.overflow = "";
|
|
@@ -140,10 +140,10 @@ export class VerstakHtmlDriver extends HtmlDriver {
|
|
|
140
140
|
s.whiteSpace = "nowrap";
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
applyOverlayVisible(
|
|
144
|
-
const e =
|
|
143
|
+
applyOverlayVisible(element, value) {
|
|
144
|
+
const e = element.native;
|
|
145
145
|
const s = e.style;
|
|
146
|
-
const host = HtmlDriver.
|
|
146
|
+
const host = HtmlDriver.findEffectiveHtmlElementHost(element).native;
|
|
147
147
|
if (value === true) {
|
|
148
148
|
const doc = document.body;
|
|
149
149
|
const rect = host.getBoundingClientRect();
|
|
@@ -169,66 +169,66 @@ export class VerstakHtmlDriver extends HtmlDriver {
|
|
|
169
169
|
s.position = s.display = s.left = s.right = s.top = s.bottom = "";
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
applyStyle(
|
|
173
|
-
const
|
|
172
|
+
applyStyle(element, secondary, styleName, enabled) {
|
|
173
|
+
const native = element.native;
|
|
174
174
|
enabled !== null && enabled !== void 0 ? enabled : (enabled = true);
|
|
175
175
|
if (secondary)
|
|
176
|
-
|
|
176
|
+
native.classList.toggle(styleName, enabled);
|
|
177
177
|
else
|
|
178
|
-
|
|
178
|
+
native.className = enabled ? styleName : "";
|
|
179
179
|
}
|
|
180
|
-
|
|
181
|
-
if (
|
|
180
|
+
update(element) {
|
|
181
|
+
if (element.kind <= ElKind.Table)
|
|
182
182
|
startNewRow();
|
|
183
|
-
return super.
|
|
183
|
+
return super.update(element);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
const Constants = {
|
|
187
|
-
|
|
187
|
+
el: "el",
|
|
188
188
|
row: "row",
|
|
189
189
|
layouts: ["section", "table", "note", "group", "", ""],
|
|
190
190
|
attribute: "kind",
|
|
191
191
|
};
|
|
192
192
|
const Drivers = {
|
|
193
|
-
section: new VerstakHtmlDriver(Constants.
|
|
194
|
-
table: new VerstakHtmlDriver(Constants.
|
|
195
|
-
note: new VerstakHtmlDriver(Constants.
|
|
196
|
-
group: new VerstakHtmlDriver(Constants.
|
|
197
|
-
row: new VerstakHtmlDriver(Constants.row, true,
|
|
193
|
+
section: new VerstakHtmlDriver(Constants.el, false, el => el.kind = ElKind.Section),
|
|
194
|
+
table: new VerstakHtmlDriver(Constants.el, false, el => el.kind = ElKind.Table),
|
|
195
|
+
note: new VerstakHtmlDriver(Constants.el, false, el => el.kind = ElKind.Note),
|
|
196
|
+
group: new VerstakHtmlDriver(Constants.el, false, el => el.kind = ElKind.Group),
|
|
197
|
+
row: new VerstakHtmlDriver(Constants.row, true, el => el.kind = ElKind.Row),
|
|
198
198
|
cursor: new CursorCommandDriver(),
|
|
199
199
|
};
|
|
200
200
|
const VerstakDriversByLayout = [
|
|
201
|
-
|
|
202
|
-
const s =
|
|
201
|
+
el => {
|
|
202
|
+
const s = el.native.style;
|
|
203
203
|
s.display = "flex";
|
|
204
204
|
s.flexDirection = "column";
|
|
205
|
-
s.alignSelf =
|
|
205
|
+
s.alignSelf = el.node.owner.isTable ? "stretch" : "center";
|
|
206
206
|
s.textAlign = "initial";
|
|
207
207
|
s.flexShrink = "1";
|
|
208
208
|
s.minWidth = "0";
|
|
209
209
|
},
|
|
210
|
-
|
|
211
|
-
const s =
|
|
212
|
-
s.alignSelf =
|
|
210
|
+
el => {
|
|
211
|
+
const s = el.native.style;
|
|
212
|
+
s.alignSelf = el.node.owner.isTable ? "stretch" : "center";
|
|
213
213
|
s.display = "grid";
|
|
214
214
|
s.flexBasis = "0";
|
|
215
215
|
s.gridAutoRows = "minmax(min-content, 1fr)";
|
|
216
216
|
s.gridAutoColumns = "minmax(min-content, 1fr)";
|
|
217
217
|
s.textAlign = "initial";
|
|
218
218
|
},
|
|
219
|
-
|
|
220
|
-
const s =
|
|
221
|
-
s.alignSelf =
|
|
219
|
+
el => {
|
|
220
|
+
const s = el.native.style;
|
|
221
|
+
s.alignSelf = el.node.owner.isTable ? "stretch" : "center";
|
|
222
222
|
s.display = "inline-grid";
|
|
223
223
|
s.flexShrink = "1";
|
|
224
224
|
},
|
|
225
|
-
|
|
226
|
-
const s =
|
|
225
|
+
el => {
|
|
226
|
+
const s = el.native.style;
|
|
227
227
|
s.display = "contents";
|
|
228
228
|
},
|
|
229
|
-
|
|
230
|
-
const s =
|
|
231
|
-
s.display =
|
|
229
|
+
el => {
|
|
230
|
+
const s = el.native.style;
|
|
231
|
+
s.display = el.node.owner.isTable ? "none" : "flex";
|
|
232
232
|
s.flexDirection = "row";
|
|
233
233
|
},
|
|
234
234
|
];
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { MergeItem } from "reactronic";
|
|
2
|
-
import {
|
|
2
|
+
import { El, BaseDriver } from "../core/api.js";
|
|
3
3
|
export declare abstract class BaseHtmlDriver<T extends Element, C = unknown> extends BaseDriver<T, C> {
|
|
4
|
-
create(
|
|
4
|
+
create(element: El<T, unknown, C, void>, result: {
|
|
5
5
|
native?: T;
|
|
6
6
|
controller?: C;
|
|
7
7
|
}): void;
|
|
8
|
-
initialize(
|
|
9
|
-
finalize(
|
|
10
|
-
mount(
|
|
11
|
-
relocate(
|
|
12
|
-
|
|
8
|
+
initialize(element: El<T, unknown, C, void>): void;
|
|
9
|
+
finalize(element: El<T, unknown, C>, isLeader: boolean): boolean;
|
|
10
|
+
mount(element: El<T, unknown, C>, nativeHost?: T): void;
|
|
11
|
+
relocate(element: El<T, unknown, C>): void;
|
|
12
|
+
update(element: El<T, unknown, C>): void | Promise<void>;
|
|
13
13
|
static get blinkingEffectMarker(): string | undefined;
|
|
14
14
|
static set blinkingEffectMarker(value: string | undefined);
|
|
15
|
-
static
|
|
16
|
-
static
|
|
15
|
+
static findEffectiveHtmlElementHost(element: El<any>): El<HTMLElement | SVGElement>;
|
|
16
|
+
static findPrevSiblingHtmlElement(ties: MergeItem<El<any>>): MergeItem<El<HTMLElement | SVGElement>> | undefined;
|
|
17
17
|
}
|
|
18
18
|
export declare class HtmlDriver<T extends HTMLElement, C = unknown> extends BaseHtmlDriver<T, C> {
|
|
19
|
-
create(
|
|
19
|
+
create(element: El<T, unknown, C, void>, result: {
|
|
20
20
|
native?: T | undefined;
|
|
21
21
|
controller?: C | undefined;
|
|
22
22
|
}): void;
|
|
23
23
|
}
|
|
24
24
|
export declare class SvgDriver<T extends SVGElement, C = unknown> extends BaseHtmlDriver<T, C> {
|
|
25
|
-
create(
|
|
25
|
+
create(element: El<T, unknown, C, void>, result: {
|
|
26
26
|
native?: T | undefined;
|
|
27
27
|
controller?: C | undefined;
|
|
28
28
|
}): void;
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import { Rx } from "reactronic";
|
|
2
2
|
import { Verstak, BaseDriver } from "../core/api.js";
|
|
3
3
|
export class BaseHtmlDriver extends BaseDriver {
|
|
4
|
-
create(
|
|
5
|
-
super.create(
|
|
4
|
+
create(element, result) {
|
|
5
|
+
super.create(element, result);
|
|
6
6
|
}
|
|
7
|
-
initialize(
|
|
8
|
-
if (Rx.isLogging && !
|
|
9
|
-
|
|
10
|
-
super.initialize(
|
|
7
|
+
initialize(element) {
|
|
8
|
+
if (Rx.isLogging && !element.node.driver.isRow)
|
|
9
|
+
element.native.setAttribute("key", element.node.key);
|
|
10
|
+
super.initialize(element);
|
|
11
11
|
}
|
|
12
|
-
finalize(
|
|
12
|
+
finalize(element, isLeader) {
|
|
13
13
|
var _a;
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
(_a =
|
|
14
|
+
const native = element.native;
|
|
15
|
+
if (native) {
|
|
16
|
+
(_a = native.resizeObserver) === null || _a === void 0 ? void 0 : _a.unobserve(native);
|
|
17
17
|
if (isLeader)
|
|
18
|
-
|
|
18
|
+
native.remove();
|
|
19
19
|
}
|
|
20
|
-
super.finalize(
|
|
20
|
+
super.finalize(element, isLeader);
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
|
-
mount(
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
const node =
|
|
23
|
+
mount(element, nativeHost) {
|
|
24
|
+
const native = element.native;
|
|
25
|
+
if (native) {
|
|
26
|
+
const node = element.node;
|
|
27
27
|
const sequential = node.owner.node.children.isStrict;
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
28
|
+
const automaticNativeHost = BaseHtmlDriver.findEffectiveHtmlElementHost(element).native;
|
|
29
|
+
if (automaticNativeHost) {
|
|
30
30
|
if (sequential && !node.driver.isRow) {
|
|
31
|
-
const after = BaseHtmlDriver.
|
|
31
|
+
const after = BaseHtmlDriver.findPrevSiblingHtmlElement(element.node.ties);
|
|
32
32
|
if (after === undefined || after.instance.node.driver.isRow) {
|
|
33
|
-
if (
|
|
34
|
-
|
|
33
|
+
if (automaticNativeHost !== native.parentNode || !native.previousSibling)
|
|
34
|
+
automaticNativeHost.prepend(native);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
37
|
const nativeAfter = after.instance.native;
|
|
38
38
|
if (nativeAfter instanceof Element) {
|
|
39
|
-
if (nativeAfter.nextSibling !==
|
|
40
|
-
|
|
39
|
+
if (nativeAfter.nextSibling !== native)
|
|
40
|
+
automaticNativeHost.insertBefore(native, nativeAfter.nextSibling);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
else
|
|
45
|
-
|
|
45
|
+
automaticNativeHost.appendChild(native);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
relocate(
|
|
49
|
+
relocate(element) {
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
const result = super.
|
|
51
|
+
update(element) {
|
|
52
|
+
const result = super.update(element);
|
|
53
53
|
if (gBlinkingEffectMarker)
|
|
54
|
-
blink(
|
|
54
|
+
blink(element.native, Verstak.currentUpdatePriority, element.node.stamp);
|
|
55
55
|
return result;
|
|
56
56
|
}
|
|
57
57
|
static get blinkingEffectMarker() {
|
|
@@ -60,14 +60,14 @@ export class BaseHtmlDriver extends BaseDriver {
|
|
|
60
60
|
static set blinkingEffectMarker(value) {
|
|
61
61
|
gBlinkingEffectMarker = value;
|
|
62
62
|
}
|
|
63
|
-
static
|
|
64
|
-
let p =
|
|
63
|
+
static findEffectiveHtmlElementHost(element) {
|
|
64
|
+
let p = element.node.host;
|
|
65
65
|
while (p.native instanceof HTMLElement === false &&
|
|
66
|
-
p.native instanceof SVGElement === false && p !==
|
|
66
|
+
p.native instanceof SVGElement === false && p !== element)
|
|
67
67
|
p = p.node.host;
|
|
68
68
|
return p;
|
|
69
69
|
}
|
|
70
|
-
static
|
|
70
|
+
static findPrevSiblingHtmlElement(ties) {
|
|
71
71
|
let p = ties.prev;
|
|
72
72
|
while (p && !(p.instance.native instanceof HTMLElement) && !(p.instance.native instanceof SVGElement))
|
|
73
73
|
p = p.prev;
|
|
@@ -75,24 +75,24 @@ export class BaseHtmlDriver extends BaseDriver {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
export class HtmlDriver extends BaseHtmlDriver {
|
|
78
|
-
create(
|
|
79
|
-
|
|
80
|
-
super.create(
|
|
78
|
+
create(element, result) {
|
|
79
|
+
result.native = document.createElement(element.node.driver.name);
|
|
80
|
+
super.create(element, result);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
export class SvgDriver extends BaseHtmlDriver {
|
|
84
|
-
create(
|
|
85
|
-
|
|
86
|
-
super.create(
|
|
84
|
+
create(element, result) {
|
|
85
|
+
result.native = document.createElementNS("http://www.w3.org/2000/svg", element.node.driver.name);
|
|
86
|
+
super.create(element, result);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
function blink(
|
|
90
|
-
if (
|
|
89
|
+
function blink(element, priority, revision) {
|
|
90
|
+
if (element !== undefined) {
|
|
91
91
|
const n1 = revision % 2;
|
|
92
92
|
const n2 = 1 >> n1;
|
|
93
93
|
const bem = gBlinkingEffectMarker;
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
element.classList.toggle(`${bem}${priority}${n1}`, true);
|
|
95
|
+
element.classList.toggle(`${bem}${priority}${n2}`, false);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
let gBlinkingEffectMarker = undefined;
|