ziex 0.1.0-dev.1458 → 0.1.0-dev.1466
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/index.js +13 -5
- package/package.json +2 -2
- package/platforms/cloudflare/index.js +415 -361
- package/runtime/kv.d.ts +1 -0
- package/runtime/kv.js +2 -1
- package/wasm/constants.d.ts +33 -0
- package/wasm/core.d.ts +7 -19
- package/wasm/dom_cmd.d.ts +15 -0
- package/wasm/generated/event_bits.d.ts +2 -0
- package/wasm/generated/events.d.ts +1 -0
- package/wasm/generated/tag_indices.d.ts +2 -0
- package/wasm/generated/tags.d.ts +1 -0
- package/wasm/index.d.ts +3 -2
- package/wasm/index.js +646 -602
- package/wasm/init.dev.js +409 -357
- package/wasm/init.js +3 -3
|
@@ -12,12 +12,35 @@ __export(runtime_exports, {
|
|
|
12
12
|
run: () => run
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
+
// src/wasm/constants.ts
|
|
16
|
+
var DOM_CMD_HEADER_SIZE = 8;
|
|
17
|
+
var DOM_CMD_RECORD_SIZE = 24;
|
|
18
|
+
var DomOp_CreateElement = 1;
|
|
19
|
+
var DomOp_CreateText = 2;
|
|
20
|
+
var DomOp_HydrateInsert = 3;
|
|
21
|
+
var DomOp_SetAttr = 4;
|
|
22
|
+
var DomOp_SetProp = 5;
|
|
23
|
+
var DomOp_RemoveAttr = 6;
|
|
24
|
+
var DomOp_SetNodeValue = 7;
|
|
25
|
+
var DomOp_SetInnerHtml = 8;
|
|
26
|
+
var DomOp_AppendChild = 9;
|
|
27
|
+
var DomOp_InsertBefore = 10;
|
|
28
|
+
var DomOp_RemoveChild = 11;
|
|
29
|
+
var DomOp_ReplaceChild = 12;
|
|
30
|
+
var CallbackType_FetchSuccess = 1;
|
|
31
|
+
var CallbackType_FetchError = 2;
|
|
32
|
+
var CallbackType_Timeout = 3;
|
|
33
|
+
var CallbackType_Interval = 4;
|
|
34
|
+
var CallbackType_WebSocketOpen = 5;
|
|
35
|
+
var CallbackType_WebSocketMessage = 6;
|
|
36
|
+
var CallbackType_WebSocketError = 7;
|
|
37
|
+
var CallbackType_WebSocketClose = 8;
|
|
38
|
+
|
|
15
39
|
// src/wasm/wasi.ts
|
|
16
40
|
var decoder = new TextDecoder();
|
|
17
41
|
var encoder = new TextEncoder();
|
|
18
42
|
var ZxWasiBridge = class {
|
|
19
43
|
#alloc;
|
|
20
|
-
#fetchCompleteHandler;
|
|
21
44
|
#memory;
|
|
22
45
|
#cb;
|
|
23
46
|
#intervals = /* @__PURE__ */ new Map();
|
|
@@ -27,7 +50,6 @@ var ZxWasiBridge = class {
|
|
|
27
50
|
constructor(exports) {
|
|
28
51
|
this.#memory = exports.memory;
|
|
29
52
|
this.#alloc = exports.__zx_alloc;
|
|
30
|
-
this.#fetchCompleteHandler = exports.__zx_fetch_complete;
|
|
31
53
|
this.#cb = exports.__zx_cb;
|
|
32
54
|
}
|
|
33
55
|
#view() {
|
|
@@ -52,6 +74,9 @@ var ZxWasiBridge = class {
|
|
|
52
74
|
if (start + data.length > view.byteLength) return;
|
|
53
75
|
view.set(data, start);
|
|
54
76
|
}
|
|
77
|
+
#invoke(type, id, a = 0n, b = 0n, c = 0n) {
|
|
78
|
+
this.#cb?.(type, id, a, b, c);
|
|
79
|
+
}
|
|
55
80
|
log(level, ptr, len) {
|
|
56
81
|
const msg = decoder.decode(this.#view().subarray(ptr, ptr + len));
|
|
57
82
|
switch (level) {
|
|
@@ -104,13 +129,14 @@ var ZxWasiBridge = class {
|
|
|
104
129
|
const encoded = typeof body === "string" ? encoder.encode(body) : body;
|
|
105
130
|
const ptr = this.#alloc(encoded.length);
|
|
106
131
|
this.#writeBytes(ptr, encoded);
|
|
107
|
-
|
|
132
|
+
const type = isError ? CallbackType_FetchError : CallbackType_FetchSuccess;
|
|
133
|
+
this.#invoke(type, fetchId, BigInt(status), BigInt(ptr), BigInt(encoded.length));
|
|
108
134
|
}
|
|
109
135
|
setTimeout(callbackId, delayMs) {
|
|
110
|
-
setTimeout(() => this.#
|
|
136
|
+
setTimeout(() => this.#invoke(CallbackType_Timeout, callbackId), delayMs);
|
|
111
137
|
}
|
|
112
138
|
setInterval(callbackId, intervalMs) {
|
|
113
|
-
const handle = setInterval(() => this.#
|
|
139
|
+
const handle = setInterval(() => this.#invoke(CallbackType_Interval, callbackId), intervalMs);
|
|
114
140
|
this.#intervals.set(callbackId, handle);
|
|
115
141
|
}
|
|
116
142
|
clearInterval(callbackId) {
|
|
@@ -544,30 +570,26 @@ function invokeWasmExport(fn, ...args) {
|
|
|
544
570
|
var ZxBridgeCore = class _ZxBridgeCore {
|
|
545
571
|
#intervals = /* @__PURE__ */ new Map();
|
|
546
572
|
#handler;
|
|
547
|
-
#fetchCompleteHandler;
|
|
548
573
|
constructor(exports) {
|
|
549
574
|
this._alloc = exports.__zx_alloc;
|
|
550
575
|
this.#handler = wrapPromisingExport(exports.__zx_cb);
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
throw new Error("__zx_fetch_complete not exported from WASM");
|
|
576
|
+
if (!this.#handler) {
|
|
577
|
+
console.warn("__zx_cb not exported from WASM");
|
|
554
578
|
}
|
|
555
|
-
this.#fetchCompleteHandler = fetchCompleteHandler;
|
|
556
579
|
if (exports.memory) jsz.memory = exports.memory;
|
|
557
580
|
}
|
|
558
581
|
/** Invoke the unified callback handler */
|
|
559
|
-
|
|
582
|
+
_invoke(type, id, a = 0n, b = 0n, c = 0n) {
|
|
560
583
|
const handler = this.#handler;
|
|
561
584
|
if (!handler) {
|
|
562
585
|
console.warn("__zx_cb not exported from WASM");
|
|
563
586
|
return;
|
|
564
587
|
}
|
|
565
|
-
|
|
566
|
-
invokeWasmExport(handler, type, id, dataRef);
|
|
588
|
+
invokeWasmExport(handler, type, id, a, b, c);
|
|
567
589
|
}
|
|
568
590
|
/**
|
|
569
591
|
* Async fetch with full options support.
|
|
570
|
-
*
|
|
592
|
+
* Completes via `__zx_cb(fetch_success|fetch_error, ...)`.
|
|
571
593
|
*/
|
|
572
594
|
fetchAsync(urlPtr, urlLen, methodPtr, methodLen, headersPtr, headersLen, bodyPtr, bodyLen, timeoutMs, fetchId) {
|
|
573
595
|
const url = readString(urlPtr, urlLen);
|
|
@@ -606,23 +628,23 @@ var ZxBridgeCore = class _ZxBridgeCore {
|
|
|
606
628
|
}
|
|
607
629
|
/** Notify WASM that a fetch completed. `body` is raw bytes on success, text on error. */
|
|
608
630
|
_notifyFetchComplete(fetchId, statusCode, body, isError) {
|
|
609
|
-
const handler = this.#fetchCompleteHandler;
|
|
610
631
|
const encoded = typeof body === "string" ? textEncoder.encode(body) : body;
|
|
611
632
|
const ptr = this._alloc(encoded.length) >>> 0;
|
|
612
633
|
if (!ptr && encoded.length > 0) return;
|
|
613
634
|
writeBytes(ptr, encoded);
|
|
614
|
-
|
|
635
|
+
const type = isError ? CallbackType_FetchError : CallbackType_FetchSuccess;
|
|
636
|
+
this._invoke(type, fetchId, BigInt(statusCode), BigInt(ptr), BigInt(encoded.length));
|
|
615
637
|
}
|
|
616
638
|
/** Set a timeout and callback when it fires */
|
|
617
639
|
setTimeout(callbackId, delayMs) {
|
|
618
640
|
setTimeout(() => {
|
|
619
|
-
this
|
|
641
|
+
this._invoke(CallbackType_Timeout, callbackId);
|
|
620
642
|
}, delayMs);
|
|
621
643
|
}
|
|
622
644
|
/** Set an interval and callback each time it fires */
|
|
623
645
|
setInterval(callbackId, intervalMs) {
|
|
624
646
|
const handle = setInterval(() => {
|
|
625
|
-
this
|
|
647
|
+
this._invoke(CallbackType_Interval, callbackId);
|
|
626
648
|
}, intervalMs);
|
|
627
649
|
this.#intervals.set(callbackId, handle);
|
|
628
650
|
}
|
|
@@ -1433,8 +1455,9 @@ function hasJSPI() {
|
|
|
1433
1455
|
}
|
|
1434
1456
|
function createBrowserKVBindings(options = {}) {
|
|
1435
1457
|
const namespace = options.namespace ?? "default";
|
|
1458
|
+
const isIndexedDb = hasJSPI() && !options.forceLocalStorage;
|
|
1436
1459
|
return {
|
|
1437
|
-
[namespace]:
|
|
1460
|
+
[namespace]: isIndexedDb ? createIndexedDbKV(options) : createLocalStorageKV(options)
|
|
1438
1461
|
};
|
|
1439
1462
|
}
|
|
1440
1463
|
|
|
@@ -1737,21 +1760,367 @@ var Ziex = class {
|
|
|
1737
1760
|
}
|
|
1738
1761
|
};
|
|
1739
1762
|
|
|
1763
|
+
// src/wasm/generated/tags.ts
|
|
1764
|
+
var TAG_NAMES = [
|
|
1765
|
+
"aside",
|
|
1766
|
+
"fragment",
|
|
1767
|
+
"iframe",
|
|
1768
|
+
"slot",
|
|
1769
|
+
"img",
|
|
1770
|
+
"html",
|
|
1771
|
+
"base",
|
|
1772
|
+
"head",
|
|
1773
|
+
"link",
|
|
1774
|
+
"meta",
|
|
1775
|
+
"script",
|
|
1776
|
+
"style",
|
|
1777
|
+
"title",
|
|
1778
|
+
"address",
|
|
1779
|
+
"article",
|
|
1780
|
+
"body",
|
|
1781
|
+
"h1",
|
|
1782
|
+
"h6",
|
|
1783
|
+
"footer",
|
|
1784
|
+
"header",
|
|
1785
|
+
"h2",
|
|
1786
|
+
"h3",
|
|
1787
|
+
"h4",
|
|
1788
|
+
"h5",
|
|
1789
|
+
"hgroup",
|
|
1790
|
+
"nav",
|
|
1791
|
+
"section",
|
|
1792
|
+
"dd",
|
|
1793
|
+
"dl",
|
|
1794
|
+
"dt",
|
|
1795
|
+
"div",
|
|
1796
|
+
"figcaption",
|
|
1797
|
+
"figure",
|
|
1798
|
+
"hr",
|
|
1799
|
+
"li",
|
|
1800
|
+
"ol",
|
|
1801
|
+
"ul",
|
|
1802
|
+
"menu",
|
|
1803
|
+
"main",
|
|
1804
|
+
"p",
|
|
1805
|
+
"picture",
|
|
1806
|
+
"pre",
|
|
1807
|
+
"a",
|
|
1808
|
+
"abbr",
|
|
1809
|
+
"b",
|
|
1810
|
+
"bdi",
|
|
1811
|
+
"bdo",
|
|
1812
|
+
"br",
|
|
1813
|
+
"cite",
|
|
1814
|
+
"code",
|
|
1815
|
+
"data",
|
|
1816
|
+
"time",
|
|
1817
|
+
"dfn",
|
|
1818
|
+
"em",
|
|
1819
|
+
"i",
|
|
1820
|
+
"kbd",
|
|
1821
|
+
"mark",
|
|
1822
|
+
"q",
|
|
1823
|
+
"blockquote",
|
|
1824
|
+
"rp",
|
|
1825
|
+
"ruby",
|
|
1826
|
+
"rt",
|
|
1827
|
+
"rtc",
|
|
1828
|
+
"rb",
|
|
1829
|
+
"s",
|
|
1830
|
+
"del",
|
|
1831
|
+
"ins",
|
|
1832
|
+
"samp",
|
|
1833
|
+
"small",
|
|
1834
|
+
"span",
|
|
1835
|
+
"strong",
|
|
1836
|
+
"sub",
|
|
1837
|
+
"sup",
|
|
1838
|
+
"u",
|
|
1839
|
+
"var",
|
|
1840
|
+
"wbr",
|
|
1841
|
+
"area",
|
|
1842
|
+
"map",
|
|
1843
|
+
"audio",
|
|
1844
|
+
"source",
|
|
1845
|
+
"track",
|
|
1846
|
+
"video",
|
|
1847
|
+
"embed",
|
|
1848
|
+
"object",
|
|
1849
|
+
"param",
|
|
1850
|
+
"canvas",
|
|
1851
|
+
"noscript",
|
|
1852
|
+
"caption",
|
|
1853
|
+
"table",
|
|
1854
|
+
"col",
|
|
1855
|
+
"colgroup",
|
|
1856
|
+
"tbody",
|
|
1857
|
+
"tr",
|
|
1858
|
+
"thead",
|
|
1859
|
+
"tfoot",
|
|
1860
|
+
"td",
|
|
1861
|
+
"th",
|
|
1862
|
+
"button",
|
|
1863
|
+
"datalist",
|
|
1864
|
+
"option",
|
|
1865
|
+
"fieldset",
|
|
1866
|
+
"label",
|
|
1867
|
+
"form",
|
|
1868
|
+
"input",
|
|
1869
|
+
"keygen",
|
|
1870
|
+
"legend",
|
|
1871
|
+
"meter",
|
|
1872
|
+
"optgroup",
|
|
1873
|
+
"select",
|
|
1874
|
+
"output",
|
|
1875
|
+
"progress",
|
|
1876
|
+
"textarea",
|
|
1877
|
+
"details",
|
|
1878
|
+
"dialog",
|
|
1879
|
+
"menuitem",
|
|
1880
|
+
"summary",
|
|
1881
|
+
"content",
|
|
1882
|
+
"element",
|
|
1883
|
+
"shadow",
|
|
1884
|
+
"template",
|
|
1885
|
+
"acronym",
|
|
1886
|
+
"applet",
|
|
1887
|
+
"basefont",
|
|
1888
|
+
"font",
|
|
1889
|
+
"big",
|
|
1890
|
+
"blink",
|
|
1891
|
+
"center",
|
|
1892
|
+
"command",
|
|
1893
|
+
"dir",
|
|
1894
|
+
"frame",
|
|
1895
|
+
"frameset",
|
|
1896
|
+
"isindex",
|
|
1897
|
+
"listing",
|
|
1898
|
+
"marquee",
|
|
1899
|
+
"noembed",
|
|
1900
|
+
"plaintext",
|
|
1901
|
+
"spacer",
|
|
1902
|
+
"strike",
|
|
1903
|
+
"tt",
|
|
1904
|
+
"xmp",
|
|
1905
|
+
"animate",
|
|
1906
|
+
"animateMotion",
|
|
1907
|
+
"animateTransform",
|
|
1908
|
+
"circle",
|
|
1909
|
+
"clipPath",
|
|
1910
|
+
"defs",
|
|
1911
|
+
"desc",
|
|
1912
|
+
"ellipse",
|
|
1913
|
+
"feBlend",
|
|
1914
|
+
"feColorMatrix",
|
|
1915
|
+
"feComponentTransfer",
|
|
1916
|
+
"feComposite",
|
|
1917
|
+
"feConvolveMatrix",
|
|
1918
|
+
"feDiffuseLighting",
|
|
1919
|
+
"feDisplacementMap",
|
|
1920
|
+
"feDistantLight",
|
|
1921
|
+
"feDropShadow",
|
|
1922
|
+
"feFlood",
|
|
1923
|
+
"feFuncA",
|
|
1924
|
+
"feFuncB",
|
|
1925
|
+
"feFuncG",
|
|
1926
|
+
"feFuncR",
|
|
1927
|
+
"feGaussianBlur",
|
|
1928
|
+
"feImage",
|
|
1929
|
+
"feMerge",
|
|
1930
|
+
"feMergeNode",
|
|
1931
|
+
"feMorphology",
|
|
1932
|
+
"feOffset",
|
|
1933
|
+
"fePointLight",
|
|
1934
|
+
"feSpecularLighting",
|
|
1935
|
+
"feSpotLight",
|
|
1936
|
+
"feTile",
|
|
1937
|
+
"feTurbulence",
|
|
1938
|
+
"filter",
|
|
1939
|
+
"foreignObject",
|
|
1940
|
+
"g",
|
|
1941
|
+
"image",
|
|
1942
|
+
"line",
|
|
1943
|
+
"linearGradient",
|
|
1944
|
+
"marker",
|
|
1945
|
+
"mask",
|
|
1946
|
+
"metadata",
|
|
1947
|
+
"mpath",
|
|
1948
|
+
"path",
|
|
1949
|
+
"pattern",
|
|
1950
|
+
"polygon",
|
|
1951
|
+
"polyline",
|
|
1952
|
+
"radialGradient",
|
|
1953
|
+
"rect",
|
|
1954
|
+
"set",
|
|
1955
|
+
"stop",
|
|
1956
|
+
"svg",
|
|
1957
|
+
"switch",
|
|
1958
|
+
"symbol",
|
|
1959
|
+
"text",
|
|
1960
|
+
"textPath",
|
|
1961
|
+
"tspan",
|
|
1962
|
+
"use",
|
|
1963
|
+
"view",
|
|
1964
|
+
"custom"
|
|
1965
|
+
];
|
|
1966
|
+
|
|
1967
|
+
// src/wasm/generated/tag_indices.ts
|
|
1968
|
+
var SVG_TAG_START_INDEX = 140;
|
|
1969
|
+
var CUSTOM_TAG_INDEX = 199;
|
|
1970
|
+
|
|
1971
|
+
// src/wasm/dom_cmd.ts
|
|
1972
|
+
function flushDomCmds(ptr, len, ctx) {
|
|
1973
|
+
const start = ptr >>> 0;
|
|
1974
|
+
const length = len >>> 0;
|
|
1975
|
+
if (length < DOM_CMD_HEADER_SIZE) return;
|
|
1976
|
+
const mem = getMemoryView();
|
|
1977
|
+
if (start + length > mem.byteLength) return;
|
|
1978
|
+
const view = new DataView(mem.buffer, mem.byteOffset + start, length);
|
|
1979
|
+
const count = view.getUint32(0, true);
|
|
1980
|
+
const recordsBytes = count * DOM_CMD_RECORD_SIZE;
|
|
1981
|
+
if (DOM_CMD_HEADER_SIZE + recordsBytes > length) return;
|
|
1982
|
+
const { domNodes: domNodes2, cleanupDomNodes: cleanupDomNodes2 } = ctx;
|
|
1983
|
+
for (let i = 0; i < count; i++) {
|
|
1984
|
+
const off = DOM_CMD_HEADER_SIZE + i * DOM_CMD_RECORD_SIZE;
|
|
1985
|
+
const op = view.getUint8(off);
|
|
1986
|
+
const p0 = view.getUint32(off + 4, true);
|
|
1987
|
+
const p1 = view.getUint32(off + 8, true);
|
|
1988
|
+
const p2 = view.getUint32(off + 12, true);
|
|
1989
|
+
const p3 = view.getUint32(off + 16, true);
|
|
1990
|
+
const p4 = view.getUint32(off + 20, true);
|
|
1991
|
+
switch (op) {
|
|
1992
|
+
case DomOp_CreateElement: {
|
|
1993
|
+
const isCustom = p0 === CUSTOM_TAG_INDEX;
|
|
1994
|
+
const tagName = isCustom ? readString(p2, p3) : TAG_NAMES[p0];
|
|
1995
|
+
const el = !isCustom && p0 >= SVG_TAG_START_INDEX ? document.createElementNS("http://www.w3.org/2000/svg", tagName) : document.createElement(tagName);
|
|
1996
|
+
el.__zx_ref = p1;
|
|
1997
|
+
domNodes2.set(p1, el);
|
|
1998
|
+
break;
|
|
1999
|
+
}
|
|
2000
|
+
case DomOp_CreateText: {
|
|
2001
|
+
const node = document.createTextNode(readString(p0, p1));
|
|
2002
|
+
node.__zx_ref = p2;
|
|
2003
|
+
domNodes2.set(p2, node);
|
|
2004
|
+
break;
|
|
2005
|
+
}
|
|
2006
|
+
case DomOp_HydrateInsert: {
|
|
2007
|
+
const child = domNodes2.get(p0);
|
|
2008
|
+
const ref = BigInt(p1) | BigInt(p2) << 32n;
|
|
2009
|
+
const end = loadValueFromRef(ref);
|
|
2010
|
+
if (!child || !end?.parentNode) break;
|
|
2011
|
+
end.parentNode.insertBefore(child, end);
|
|
2012
|
+
break;
|
|
2013
|
+
}
|
|
2014
|
+
case DomOp_SetAttr: {
|
|
2015
|
+
domNodes2.get(p0)?.setAttribute(readString(p1, p2), readString(p3, p4));
|
|
2016
|
+
break;
|
|
2017
|
+
}
|
|
2018
|
+
case DomOp_SetProp: {
|
|
2019
|
+
const el = domNodes2.get(p0);
|
|
2020
|
+
if (el) {
|
|
2021
|
+
const name = readString(p1, p2);
|
|
2022
|
+
const val = readString(p3, p4);
|
|
2023
|
+
if (name === "checked" || name === "selected" || name === "muted") {
|
|
2024
|
+
el[name] = val !== "false";
|
|
2025
|
+
} else {
|
|
2026
|
+
el[name] = val;
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
break;
|
|
2030
|
+
}
|
|
2031
|
+
case DomOp_RemoveAttr: {
|
|
2032
|
+
domNodes2.get(p0)?.removeAttribute(readString(p1, p2));
|
|
2033
|
+
break;
|
|
2034
|
+
}
|
|
2035
|
+
case DomOp_SetNodeValue: {
|
|
2036
|
+
const node = domNodes2.get(p0);
|
|
2037
|
+
if (node) node.nodeValue = readString(p1, p2);
|
|
2038
|
+
break;
|
|
2039
|
+
}
|
|
2040
|
+
case DomOp_SetInnerHtml: {
|
|
2041
|
+
const el = domNodes2.get(p0);
|
|
2042
|
+
if (el) el.innerHTML = readString(p1, p2);
|
|
2043
|
+
break;
|
|
2044
|
+
}
|
|
2045
|
+
case DomOp_AppendChild: {
|
|
2046
|
+
const parent = domNodes2.get(p0);
|
|
2047
|
+
const child = domNodes2.get(p1);
|
|
2048
|
+
if (parent && child) parent.appendChild(child);
|
|
2049
|
+
break;
|
|
2050
|
+
}
|
|
2051
|
+
case DomOp_InsertBefore: {
|
|
2052
|
+
const parent = domNodes2.get(p0);
|
|
2053
|
+
const child = domNodes2.get(p1);
|
|
2054
|
+
const refNode = domNodes2.get(p2) ?? null;
|
|
2055
|
+
if (parent && child) parent.insertBefore(child, refNode);
|
|
2056
|
+
break;
|
|
2057
|
+
}
|
|
2058
|
+
case DomOp_RemoveChild: {
|
|
2059
|
+
const parent = domNodes2.get(p0);
|
|
2060
|
+
const child = domNodes2.get(p1);
|
|
2061
|
+
if (parent && child) {
|
|
2062
|
+
parent.removeChild(child);
|
|
2063
|
+
cleanupDomNodes2(child);
|
|
2064
|
+
}
|
|
2065
|
+
break;
|
|
2066
|
+
}
|
|
2067
|
+
case DomOp_ReplaceChild: {
|
|
2068
|
+
const parent = domNodes2.get(p0);
|
|
2069
|
+
const newChild = domNodes2.get(p1);
|
|
2070
|
+
const oldChild = domNodes2.get(p2);
|
|
2071
|
+
if (parent && newChild && oldChild) {
|
|
2072
|
+
parent.replaceChild(newChild, oldChild);
|
|
2073
|
+
cleanupDomNodes2(oldChild);
|
|
2074
|
+
}
|
|
2075
|
+
break;
|
|
2076
|
+
}
|
|
2077
|
+
default:
|
|
2078
|
+
break;
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
// src/wasm/generated/events.ts
|
|
2084
|
+
var DELEGATED_EVENTS = [
|
|
2085
|
+
"click",
|
|
2086
|
+
"dblclick",
|
|
2087
|
+
"input",
|
|
2088
|
+
"change",
|
|
2089
|
+
"submit",
|
|
2090
|
+
"focusin",
|
|
2091
|
+
"focusout",
|
|
2092
|
+
"keydown",
|
|
2093
|
+
"keyup",
|
|
2094
|
+
"keypress",
|
|
2095
|
+
"mouseenter",
|
|
2096
|
+
"mouseleave",
|
|
2097
|
+
"mousedown",
|
|
2098
|
+
"mouseup",
|
|
2099
|
+
"mousemove",
|
|
2100
|
+
"touchstart",
|
|
2101
|
+
"touchend",
|
|
2102
|
+
"touchmove",
|
|
2103
|
+
"scroll",
|
|
2104
|
+
"wheel",
|
|
2105
|
+
"pointerdown",
|
|
2106
|
+
"pointermove",
|
|
2107
|
+
"pointerup",
|
|
2108
|
+
"pointercancel",
|
|
2109
|
+
"pointerenter",
|
|
2110
|
+
"pointerleave",
|
|
2111
|
+
"lostpointercapture"
|
|
2112
|
+
];
|
|
2113
|
+
|
|
2114
|
+
// src/wasm/generated/event_bits.ts
|
|
2115
|
+
var HIGH_FREQ_EVENT_BITS = 3031040;
|
|
2116
|
+
|
|
1740
2117
|
// src/wasm/index.ts
|
|
1741
2118
|
var ZxBridge = class extends ZxBridgeCore {
|
|
1742
2119
|
#websockets = /* @__PURE__ */ new Map();
|
|
1743
|
-
#wsOnOpenHandler;
|
|
1744
|
-
#wsOnMessageHandler;
|
|
1745
|
-
#wsOnErrorHandler;
|
|
1746
|
-
#wsOnCloseHandler;
|
|
1747
2120
|
#eventbridge;
|
|
1748
2121
|
#eventbridgeAsync;
|
|
1749
2122
|
constructor(exports) {
|
|
1750
2123
|
super(exports);
|
|
1751
|
-
this.#wsOnOpenHandler = wrapPromisingExport(exports.__zx_ws_onopen);
|
|
1752
|
-
this.#wsOnMessageHandler = wrapPromisingExport(exports.__zx_ws_onmessage);
|
|
1753
|
-
this.#wsOnErrorHandler = wrapPromisingExport(exports.__zx_ws_onerror);
|
|
1754
|
-
this.#wsOnCloseHandler = wrapPromisingExport(exports.__zx_ws_onclose);
|
|
1755
2124
|
this.#eventbridge = exports.__zx_eventbridge;
|
|
1756
2125
|
this.#eventbridgeAsync = wrapPromisingExport(
|
|
1757
2126
|
exports.__zx_eventbridge_async ?? exports.__zx_eventbridge
|
|
@@ -1777,8 +2146,8 @@ var ZxBridge = class extends ZxBridgeCore {
|
|
|
1777
2146
|
const present = eventHandlersPresent.get(velementId) ?? 0;
|
|
1778
2147
|
eventHandlersPresent.delete(velementId);
|
|
1779
2148
|
eventHandlersSuspend.delete(velementId);
|
|
1780
|
-
for (
|
|
1781
|
-
|
|
2149
|
+
for (let bits = present & HIGH_FREQ_EVENT_BITS; bits !== 0; bits &= bits - 1) {
|
|
2150
|
+
maybeRemoveHighFreqListener(31 - Math.clz32(bits));
|
|
1782
2151
|
}
|
|
1783
2152
|
}
|
|
1784
2153
|
/** Submit a form action with bound-state round-trip. */
|
|
@@ -1800,7 +2169,7 @@ var ZxBridge = class extends ZxBridgeCore {
|
|
|
1800
2169
|
}
|
|
1801
2170
|
/**
|
|
1802
2171
|
* Create and connect a WebSocket.
|
|
1803
|
-
*
|
|
2172
|
+
* Completes via `__zx_cb(ws_open|ws_message|ws_error|ws_close, ...)`.
|
|
1804
2173
|
*/
|
|
1805
2174
|
wsConnect(wsId, urlPtr, urlLen, protocolsPtr, protocolsLen) {
|
|
1806
2175
|
const url = readString(urlPtr, urlLen);
|
|
@@ -1810,42 +2179,32 @@ var ZxBridge = class extends ZxBridgeCore {
|
|
|
1810
2179
|
const ws = protocols && protocols.length > 0 ? new WebSocket(url, protocols) : new WebSocket(url);
|
|
1811
2180
|
ws.binaryType = "arraybuffer";
|
|
1812
2181
|
ws.onopen = () => {
|
|
1813
|
-
const handler = this.#wsOnOpenHandler;
|
|
1814
|
-
if (!handler) return;
|
|
1815
2182
|
const protocol = ws.protocol || "";
|
|
1816
2183
|
const [ptr, len] = this._writeStringToWasm(protocol);
|
|
1817
|
-
|
|
2184
|
+
this._invoke(CallbackType_WebSocketOpen, wsId, BigInt(ptr), BigInt(len));
|
|
1818
2185
|
};
|
|
1819
2186
|
ws.onmessage = (event) => {
|
|
1820
|
-
const handler = this.#wsOnMessageHandler;
|
|
1821
|
-
if (!handler) return;
|
|
1822
2187
|
const isBinary = event.data instanceof ArrayBuffer;
|
|
1823
2188
|
const data = isBinary ? new Uint8Array(event.data) : textEncoder.encode(event.data);
|
|
1824
2189
|
const [ptr, len] = this.writeBytesToWasm(data);
|
|
1825
|
-
|
|
2190
|
+
this._invoke(CallbackType_WebSocketMessage, wsId, BigInt(ptr), BigInt(len), BigInt(isBinary ? 1 : 0));
|
|
1826
2191
|
};
|
|
1827
2192
|
ws.onerror = (_event) => {
|
|
1828
|
-
const handler = this.#wsOnErrorHandler;
|
|
1829
|
-
if (!handler) return;
|
|
1830
2193
|
const [ptr, len] = this._writeStringToWasm("WebSocket error");
|
|
1831
|
-
|
|
2194
|
+
this._invoke(CallbackType_WebSocketError, wsId, BigInt(ptr), BigInt(len));
|
|
1832
2195
|
};
|
|
1833
2196
|
ws.onclose = (event) => {
|
|
1834
|
-
const handler = this.#wsOnCloseHandler;
|
|
1835
|
-
if (!handler) return;
|
|
1836
2197
|
const reason = event.reason || "";
|
|
1837
2198
|
const [ptr, len] = this._writeStringToWasm(reason);
|
|
1838
|
-
|
|
2199
|
+
const c = BigInt(len) | BigInt(event.wasClean ? 1 : 0) << 32n;
|
|
2200
|
+
this._invoke(CallbackType_WebSocketClose, wsId, BigInt(event.code), BigInt(ptr), c);
|
|
1839
2201
|
this.#websockets.delete(wsId);
|
|
1840
2202
|
};
|
|
1841
2203
|
this.#websockets.set(wsId, ws);
|
|
1842
2204
|
} catch (error) {
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
const [ptr, len] = this._writeStringToWasm(msg);
|
|
1847
|
-
invokeWasmExport(handler, wsId, ptr, len);
|
|
1848
|
-
}
|
|
2205
|
+
const msg = error instanceof Error ? error.message : "WebSocket connection failed";
|
|
2206
|
+
const [ptr, len] = this._writeStringToWasm(msg);
|
|
2207
|
+
this._invoke(CallbackType_WebSocketError, wsId, BigInt(ptr), BigInt(len));
|
|
1849
2208
|
}
|
|
1850
2209
|
}
|
|
1851
2210
|
/** Send data over WebSocket */
|
|
@@ -1946,79 +2305,11 @@ var ZxBridge = class extends ZxBridgeCore {
|
|
|
1946
2305
|
_wsClose: (wsId, code, reasonPtr, reasonLen) => {
|
|
1947
2306
|
bridgeRef[0]?.wsClose(wsId, code, reasonPtr, reasonLen);
|
|
1948
2307
|
},
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
domNodes.set(nid, el);
|
|
1955
|
-
},
|
|
1956
|
-
_ct: (ptr, len, vnodeId) => {
|
|
1957
|
-
const nid = Number(vnodeId);
|
|
1958
|
-
const node = document.createTextNode(readString(ptr, len));
|
|
1959
|
-
node.__zx_ref = nid;
|
|
1960
|
-
domNodes.set(nid, node);
|
|
1961
|
-
},
|
|
1962
|
-
/** Insert vnode before a jsz-held end comment (hydration). */
|
|
1963
|
-
_ih: (vnodeId, endCommentRef) => {
|
|
1964
|
-
const child = domNodes.get(Number(vnodeId));
|
|
1965
|
-
const end = loadValueFromRef(endCommentRef);
|
|
1966
|
-
if (!child || !end?.parentNode) return;
|
|
1967
|
-
end.parentNode.insertBefore(child, end);
|
|
1968
|
-
},
|
|
1969
|
-
_sa: (vnodeId, namePtr, nameLen, valPtr, valLen) => {
|
|
1970
|
-
domNodes.get(Number(vnodeId))?.setAttribute(readString(namePtr, nameLen), readString(valPtr, valLen));
|
|
1971
|
-
},
|
|
1972
|
-
_sp: (vnodeId, namePtr, nameLen, valPtr, valLen) => {
|
|
1973
|
-
const el = domNodes.get(Number(vnodeId));
|
|
1974
|
-
if (el) {
|
|
1975
|
-
const name = readString(namePtr, nameLen);
|
|
1976
|
-
const val = readString(valPtr, valLen);
|
|
1977
|
-
if (name === "checked" || name === "selected" || name === "muted") {
|
|
1978
|
-
el[name] = val !== "false";
|
|
1979
|
-
} else {
|
|
1980
|
-
el[name] = val;
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
},
|
|
1984
|
-
_ra: (vnodeId, namePtr, nameLen) => {
|
|
1985
|
-
domNodes.get(Number(vnodeId))?.removeAttribute(readString(namePtr, nameLen));
|
|
1986
|
-
},
|
|
1987
|
-
_snv: (vnodeId, ptr, len) => {
|
|
1988
|
-
const node = domNodes.get(Number(vnodeId));
|
|
1989
|
-
if (node) node.nodeValue = readString(ptr, len);
|
|
1990
|
-
},
|
|
1991
|
-
_srh: (vnodeId, ptr, len) => {
|
|
1992
|
-
const el = domNodes.get(Number(vnodeId));
|
|
1993
|
-
if (el) el.innerHTML = readString(ptr, len);
|
|
1994
|
-
},
|
|
1995
|
-
_ac: (parentId, childId) => {
|
|
1996
|
-
const parent = domNodes.get(Number(parentId));
|
|
1997
|
-
const child = domNodes.get(Number(childId));
|
|
1998
|
-
if (parent && child) parent.appendChild(child);
|
|
1999
|
-
},
|
|
2000
|
-
_ib: (parentId, childId, refId) => {
|
|
2001
|
-
const parent = domNodes.get(Number(parentId));
|
|
2002
|
-
const child = domNodes.get(Number(childId));
|
|
2003
|
-
const ref = domNodes.get(Number(refId)) ?? null;
|
|
2004
|
-
if (parent && child) parent.insertBefore(child, ref);
|
|
2005
|
-
},
|
|
2006
|
-
_rc: (parentId, childId) => {
|
|
2007
|
-
const parent = domNodes.get(Number(parentId));
|
|
2008
|
-
const child = domNodes.get(Number(childId));
|
|
2009
|
-
if (parent && child) {
|
|
2010
|
-
parent.removeChild(child);
|
|
2011
|
-
cleanupDomNodes(child);
|
|
2012
|
-
}
|
|
2013
|
-
},
|
|
2014
|
-
_rpc: (parentId, newId, oldId) => {
|
|
2015
|
-
const parent = domNodes.get(Number(parentId));
|
|
2016
|
-
const newChild = domNodes.get(Number(newId));
|
|
2017
|
-
const oldChild = domNodes.get(Number(oldId));
|
|
2018
|
-
if (parent && newChild && oldChild) {
|
|
2019
|
-
parent.replaceChild(newChild, oldChild);
|
|
2020
|
-
cleanupDomNodes(oldChild);
|
|
2021
|
-
}
|
|
2308
|
+
_flush: (ptr, len) => {
|
|
2309
|
+
flushDomCmds(ptr, len, {
|
|
2310
|
+
domNodes,
|
|
2311
|
+
cleanupDomNodes
|
|
2312
|
+
});
|
|
2022
2313
|
},
|
|
2023
2314
|
_getLocationHref: (bufPtr, bufLen) => {
|
|
2024
2315
|
const bytes = textEncoder.encode(window.location.href);
|
|
@@ -2083,247 +2374,10 @@ function cleanupDomNodes(node) {
|
|
|
2083
2374
|
const children = n.childNodes;
|
|
2084
2375
|
for (let i = 0; i < children.length; i++) stack.push(children[i]);
|
|
2085
2376
|
}
|
|
2086
|
-
for (
|
|
2087
|
-
|
|
2377
|
+
for (let bits = highFreqBits & HIGH_FREQ_EVENT_BITS; bits !== 0; bits &= bits - 1) {
|
|
2378
|
+
maybeRemoveHighFreqListener(31 - Math.clz32(bits));
|
|
2088
2379
|
}
|
|
2089
2380
|
}
|
|
2090
|
-
var SVG_TAG_START_INDEX = 140;
|
|
2091
|
-
var TAG_NAMES = [
|
|
2092
|
-
"aside",
|
|
2093
|
-
"fragment",
|
|
2094
|
-
"iframe",
|
|
2095
|
-
"slot",
|
|
2096
|
-
"img",
|
|
2097
|
-
"html",
|
|
2098
|
-
"base",
|
|
2099
|
-
"head",
|
|
2100
|
-
"link",
|
|
2101
|
-
"meta",
|
|
2102
|
-
"script",
|
|
2103
|
-
"style",
|
|
2104
|
-
"title",
|
|
2105
|
-
"address",
|
|
2106
|
-
"article",
|
|
2107
|
-
"body",
|
|
2108
|
-
"h1",
|
|
2109
|
-
"h6",
|
|
2110
|
-
"footer",
|
|
2111
|
-
"header",
|
|
2112
|
-
"h2",
|
|
2113
|
-
"h3",
|
|
2114
|
-
"h4",
|
|
2115
|
-
"h5",
|
|
2116
|
-
"hgroup",
|
|
2117
|
-
"nav",
|
|
2118
|
-
"section",
|
|
2119
|
-
"dd",
|
|
2120
|
-
"dl",
|
|
2121
|
-
"dt",
|
|
2122
|
-
"div",
|
|
2123
|
-
"figcaption",
|
|
2124
|
-
"figure",
|
|
2125
|
-
"hr",
|
|
2126
|
-
"li",
|
|
2127
|
-
"ol",
|
|
2128
|
-
"ul",
|
|
2129
|
-
"menu",
|
|
2130
|
-
"main",
|
|
2131
|
-
"p",
|
|
2132
|
-
"picture",
|
|
2133
|
-
"pre",
|
|
2134
|
-
"a",
|
|
2135
|
-
"abbr",
|
|
2136
|
-
"b",
|
|
2137
|
-
"bdi",
|
|
2138
|
-
"bdo",
|
|
2139
|
-
"br",
|
|
2140
|
-
"cite",
|
|
2141
|
-
"code",
|
|
2142
|
-
"data",
|
|
2143
|
-
"time",
|
|
2144
|
-
"dfn",
|
|
2145
|
-
"em",
|
|
2146
|
-
"i",
|
|
2147
|
-
"kbd",
|
|
2148
|
-
"mark",
|
|
2149
|
-
"q",
|
|
2150
|
-
"blockquote",
|
|
2151
|
-
"rp",
|
|
2152
|
-
"ruby",
|
|
2153
|
-
"rt",
|
|
2154
|
-
"rtc",
|
|
2155
|
-
"rb",
|
|
2156
|
-
"s",
|
|
2157
|
-
"del",
|
|
2158
|
-
"ins",
|
|
2159
|
-
"samp",
|
|
2160
|
-
"small",
|
|
2161
|
-
"span",
|
|
2162
|
-
"strong",
|
|
2163
|
-
"sub",
|
|
2164
|
-
"sup",
|
|
2165
|
-
"u",
|
|
2166
|
-
"var",
|
|
2167
|
-
"wbr",
|
|
2168
|
-
"area",
|
|
2169
|
-
"map",
|
|
2170
|
-
"audio",
|
|
2171
|
-
"source",
|
|
2172
|
-
"track",
|
|
2173
|
-
"video",
|
|
2174
|
-
"embed",
|
|
2175
|
-
"object",
|
|
2176
|
-
"param",
|
|
2177
|
-
"canvas",
|
|
2178
|
-
"noscript",
|
|
2179
|
-
"caption",
|
|
2180
|
-
"table",
|
|
2181
|
-
"col",
|
|
2182
|
-
"colgroup",
|
|
2183
|
-
"tbody",
|
|
2184
|
-
"tr",
|
|
2185
|
-
"thead",
|
|
2186
|
-
"tfoot",
|
|
2187
|
-
"td",
|
|
2188
|
-
"th",
|
|
2189
|
-
"button",
|
|
2190
|
-
"datalist",
|
|
2191
|
-
"option",
|
|
2192
|
-
"fieldset",
|
|
2193
|
-
"label",
|
|
2194
|
-
"form",
|
|
2195
|
-
"input",
|
|
2196
|
-
"keygen",
|
|
2197
|
-
"legend",
|
|
2198
|
-
"meter",
|
|
2199
|
-
"optgroup",
|
|
2200
|
-
"select",
|
|
2201
|
-
"output",
|
|
2202
|
-
"progress",
|
|
2203
|
-
"textarea",
|
|
2204
|
-
"details",
|
|
2205
|
-
"dialog",
|
|
2206
|
-
"menuitem",
|
|
2207
|
-
"summary",
|
|
2208
|
-
"content",
|
|
2209
|
-
"element",
|
|
2210
|
-
"shadow",
|
|
2211
|
-
"template",
|
|
2212
|
-
"acronym",
|
|
2213
|
-
"applet",
|
|
2214
|
-
"basefont",
|
|
2215
|
-
"font",
|
|
2216
|
-
"big",
|
|
2217
|
-
"blink",
|
|
2218
|
-
"center",
|
|
2219
|
-
"command",
|
|
2220
|
-
"dir",
|
|
2221
|
-
"frame",
|
|
2222
|
-
"frameset",
|
|
2223
|
-
"isindex",
|
|
2224
|
-
"listing",
|
|
2225
|
-
"marquee",
|
|
2226
|
-
"noembed",
|
|
2227
|
-
"plaintext",
|
|
2228
|
-
"spacer",
|
|
2229
|
-
"strike",
|
|
2230
|
-
"tt",
|
|
2231
|
-
"xmp",
|
|
2232
|
-
// SVG Tags
|
|
2233
|
-
"animate",
|
|
2234
|
-
"animateMotion",
|
|
2235
|
-
"animateTransform",
|
|
2236
|
-
"circle",
|
|
2237
|
-
"clipPath",
|
|
2238
|
-
"defs",
|
|
2239
|
-
"desc",
|
|
2240
|
-
"ellipse",
|
|
2241
|
-
"feBlend",
|
|
2242
|
-
"feColorMatrix",
|
|
2243
|
-
"feComponentTransfer",
|
|
2244
|
-
"feComposite",
|
|
2245
|
-
"feConvolveMatrix",
|
|
2246
|
-
"feDiffuseLighting",
|
|
2247
|
-
"feDisplacementMap",
|
|
2248
|
-
"feDistantLight",
|
|
2249
|
-
"feDropShadow",
|
|
2250
|
-
"feFlood",
|
|
2251
|
-
"feFuncA",
|
|
2252
|
-
"feFuncB",
|
|
2253
|
-
"feFuncG",
|
|
2254
|
-
"feFuncR",
|
|
2255
|
-
"feGaussianBlur",
|
|
2256
|
-
"feImage",
|
|
2257
|
-
"feMerge",
|
|
2258
|
-
"feMergeNode",
|
|
2259
|
-
"feMorphology",
|
|
2260
|
-
"feOffset",
|
|
2261
|
-
"fePointLight",
|
|
2262
|
-
"feSpecularLighting",
|
|
2263
|
-
"feSpotLight",
|
|
2264
|
-
"feTile",
|
|
2265
|
-
"feTurbulence",
|
|
2266
|
-
"filter",
|
|
2267
|
-
"foreignObject",
|
|
2268
|
-
"g",
|
|
2269
|
-
"image",
|
|
2270
|
-
"line",
|
|
2271
|
-
"linearGradient",
|
|
2272
|
-
"marker",
|
|
2273
|
-
"mask",
|
|
2274
|
-
"metadata",
|
|
2275
|
-
"mpath",
|
|
2276
|
-
"path",
|
|
2277
|
-
"pattern",
|
|
2278
|
-
"polygon",
|
|
2279
|
-
"polyline",
|
|
2280
|
-
"radialGradient",
|
|
2281
|
-
"rect",
|
|
2282
|
-
"set",
|
|
2283
|
-
"stop",
|
|
2284
|
-
"svg",
|
|
2285
|
-
"switch",
|
|
2286
|
-
"symbol",
|
|
2287
|
-
"text",
|
|
2288
|
-
"textPath",
|
|
2289
|
-
"tspan",
|
|
2290
|
-
"use",
|
|
2291
|
-
"view"
|
|
2292
|
-
];
|
|
2293
|
-
var DELEGATED_EVENTS = [
|
|
2294
|
-
"click",
|
|
2295
|
-
"dblclick",
|
|
2296
|
-
"input",
|
|
2297
|
-
"change",
|
|
2298
|
-
"submit",
|
|
2299
|
-
// focus/blur do not bubble - listen to focusin/focusout instead.
|
|
2300
|
-
"focusin",
|
|
2301
|
-
"focusout",
|
|
2302
|
-
"keydown",
|
|
2303
|
-
"keyup",
|
|
2304
|
-
"keypress",
|
|
2305
|
-
"mouseenter",
|
|
2306
|
-
"mouseleave",
|
|
2307
|
-
"mousedown",
|
|
2308
|
-
"mouseup",
|
|
2309
|
-
"mousemove",
|
|
2310
|
-
"touchstart",
|
|
2311
|
-
"touchend",
|
|
2312
|
-
"touchmove",
|
|
2313
|
-
"scroll",
|
|
2314
|
-
"wheel",
|
|
2315
|
-
"pointerdown",
|
|
2316
|
-
"pointermove",
|
|
2317
|
-
"pointerup",
|
|
2318
|
-
"pointercancel"
|
|
2319
|
-
];
|
|
2320
|
-
var HIGH_FREQ_EVENT_IDS = new Set([
|
|
2321
|
-
DELEGATED_EVENTS.indexOf("mousemove"),
|
|
2322
|
-
DELEGATED_EVENTS.indexOf("pointermove"),
|
|
2323
|
-
DELEGATED_EVENTS.indexOf("wheel"),
|
|
2324
|
-
DELEGATED_EVENTS.indexOf("scroll"),
|
|
2325
|
-
DELEGATED_EVENTS.indexOf("touchmove")
|
|
2326
|
-
].filter((id) => id >= 0));
|
|
2327
2381
|
var delegationState = null;
|
|
2328
2382
|
function makeDelegatedListener(bridge, eventTypeId) {
|
|
2329
2383
|
return (event) => {
|
|
@@ -2371,7 +2425,7 @@ function anyHandlerForType(eventTypeId) {
|
|
|
2371
2425
|
return false;
|
|
2372
2426
|
}
|
|
2373
2427
|
function maybeRemoveHighFreqListener(eventTypeId) {
|
|
2374
|
-
if (
|
|
2428
|
+
if ((HIGH_FREQ_EVENT_BITS & 1 << eventTypeId) === 0) return;
|
|
2375
2429
|
if (anyHandlerForType(eventTypeId)) return;
|
|
2376
2430
|
const state = delegationState;
|
|
2377
2431
|
if (!state) return;
|