@lvce-editor/renderer-process 30.60.2 → 30.61.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/dist/rendererProcessMain.js +332 -128
- package/package.json +1 -1
|
@@ -1556,7 +1556,7 @@ const launchRendererWorker = async () => {
|
|
|
1556
1556
|
};
|
|
1557
1557
|
|
|
1558
1558
|
const selector = 'script.RendererWorkerTrace';
|
|
1559
|
-
const state$
|
|
1559
|
+
const state$j = {
|
|
1560
1560
|
enabled: false,
|
|
1561
1561
|
entries: []
|
|
1562
1562
|
};
|
|
@@ -1606,14 +1606,14 @@ const isCommand = value => {
|
|
|
1606
1606
|
};
|
|
1607
1607
|
const initialize = search => {
|
|
1608
1608
|
const searchParams = new URLSearchParams(search);
|
|
1609
|
-
state$
|
|
1610
|
-
state$
|
|
1609
|
+
state$j.enabled = searchParams.has('traceRendererWorker');
|
|
1610
|
+
state$j.entries = [];
|
|
1611
1611
|
};
|
|
1612
1612
|
const record = (direction, method, params) => {
|
|
1613
|
-
if (!state$
|
|
1613
|
+
if (!state$j.enabled) {
|
|
1614
1614
|
return;
|
|
1615
1615
|
}
|
|
1616
|
-
state$
|
|
1616
|
+
state$j.entries.push({
|
|
1617
1617
|
direction,
|
|
1618
1618
|
method,
|
|
1619
1619
|
params: serialize(params),
|
|
@@ -1621,7 +1621,7 @@ const record = (direction, method, params) => {
|
|
|
1621
1621
|
});
|
|
1622
1622
|
};
|
|
1623
1623
|
const listen$1 = rpc => {
|
|
1624
|
-
if (!state$
|
|
1624
|
+
if (!state$j.enabled) {
|
|
1625
1625
|
return;
|
|
1626
1626
|
}
|
|
1627
1627
|
const ipc = rpc.ipc;
|
|
@@ -1636,7 +1636,7 @@ const listen$1 = rpc => {
|
|
|
1636
1636
|
});
|
|
1637
1637
|
};
|
|
1638
1638
|
const exportToDom = () => {
|
|
1639
|
-
if (!state$
|
|
1639
|
+
if (!state$j.enabled) {
|
|
1640
1640
|
return;
|
|
1641
1641
|
}
|
|
1642
1642
|
const existing = document.querySelector(selector);
|
|
@@ -1644,7 +1644,7 @@ const exportToDom = () => {
|
|
|
1644
1644
|
script.className = 'RendererWorkerTrace';
|
|
1645
1645
|
script.type = 'application/json';
|
|
1646
1646
|
script.textContent = JSON.stringify({
|
|
1647
|
-
entries: state$
|
|
1647
|
+
entries: state$j.entries,
|
|
1648
1648
|
version: 1
|
|
1649
1649
|
});
|
|
1650
1650
|
if (!existing) {
|
|
@@ -1652,42 +1652,42 @@ const exportToDom = () => {
|
|
|
1652
1652
|
}
|
|
1653
1653
|
};
|
|
1654
1654
|
const scheduleExport = () => {
|
|
1655
|
-
if (!state$
|
|
1655
|
+
if (!state$j.enabled) {
|
|
1656
1656
|
return;
|
|
1657
1657
|
}
|
|
1658
1658
|
queueMicrotask(exportToDom);
|
|
1659
1659
|
};
|
|
1660
1660
|
|
|
1661
|
-
const state$
|
|
1661
|
+
const state$i = {
|
|
1662
1662
|
rpc: undefined
|
|
1663
1663
|
};
|
|
1664
1664
|
const hydrate$4 = async () => {
|
|
1665
1665
|
const result = await launchRendererWorker();
|
|
1666
1666
|
if (isError(result)) {
|
|
1667
|
-
state$
|
|
1667
|
+
state$i.rpc = undefined;
|
|
1668
1668
|
return result;
|
|
1669
1669
|
}
|
|
1670
|
-
state$
|
|
1670
|
+
state$i.rpc = result.value;
|
|
1671
1671
|
listen$1(result.value);
|
|
1672
1672
|
return success(undefined);
|
|
1673
1673
|
};
|
|
1674
1674
|
const send$1 = (method, ...params) => {
|
|
1675
1675
|
record('sent', method, params);
|
|
1676
1676
|
// @ts-ignore
|
|
1677
|
-
state$
|
|
1677
|
+
state$i.rpc.send(method, ...params);
|
|
1678
1678
|
};
|
|
1679
1679
|
const invoke$1 = (method, ...params) => {
|
|
1680
1680
|
record('sent', method, params);
|
|
1681
1681
|
// @ts-ignore
|
|
1682
|
-
return state$
|
|
1682
|
+
return state$i.rpc.invoke(method, ...params);
|
|
1683
1683
|
};
|
|
1684
1684
|
const invokeAndTransfer = (method, ...params) => {
|
|
1685
1685
|
record('sent', method, params);
|
|
1686
1686
|
// @ts-ignore
|
|
1687
|
-
return state$
|
|
1687
|
+
return state$i.rpc.invokeAndTransfer(method, ...params);
|
|
1688
1688
|
};
|
|
1689
1689
|
|
|
1690
|
-
const state$
|
|
1690
|
+
const state$h = {
|
|
1691
1691
|
client: undefined,
|
|
1692
1692
|
enabled: false,
|
|
1693
1693
|
lastError: '',
|
|
@@ -1697,38 +1697,38 @@ const state$g = {
|
|
|
1697
1697
|
const workerUrl = new URL('sessionReplayWorkerMain.js', import.meta.url);
|
|
1698
1698
|
const reloadMessage = 'Reload the window to start session replay with the complete DOM command history';
|
|
1699
1699
|
const report = error => {
|
|
1700
|
-
state$
|
|
1701
|
-
state$
|
|
1702
|
-
state$
|
|
1703
|
-
console.warn(`Session replay: ${state$
|
|
1700
|
+
state$h.lastError = error instanceof Error ? error.message : String(error);
|
|
1701
|
+
state$h.stopObserving?.();
|
|
1702
|
+
state$h.stopObserving = undefined;
|
|
1703
|
+
console.warn(`Session replay: ${state$h.lastError}`);
|
|
1704
1704
|
};
|
|
1705
1705
|
|
|
1706
1706
|
// Retain snapshot recording for older renderer workers during dependency rollout.
|
|
1707
|
-
const configure = async options => {
|
|
1708
|
-
state$
|
|
1709
|
-
state$
|
|
1710
|
-
state$
|
|
1711
|
-
if (state$
|
|
1707
|
+
const configure$1 = async options => {
|
|
1708
|
+
state$h.stopObserving?.();
|
|
1709
|
+
state$h.stopObserving = undefined;
|
|
1710
|
+
state$h.enabled = false;
|
|
1711
|
+
if (state$h.client) {
|
|
1712
1712
|
try {
|
|
1713
|
-
await state$
|
|
1713
|
+
await state$h.client.invoke('stop');
|
|
1714
1714
|
} catch (error) {
|
|
1715
1715
|
report(error);
|
|
1716
1716
|
}
|
|
1717
1717
|
// Live channels still need their proxy after capture stops.
|
|
1718
|
-
if (!state$
|
|
1719
|
-
state$
|
|
1720
|
-
state$
|
|
1718
|
+
if (!state$h.proxy) {
|
|
1719
|
+
state$h.client.dispose();
|
|
1720
|
+
state$h.client = undefined;
|
|
1721
1721
|
}
|
|
1722
1722
|
}
|
|
1723
1723
|
if (!options.local && !options.upload) return '';
|
|
1724
|
-
if (state$
|
|
1725
|
-
state$
|
|
1724
|
+
if (state$h.proxy) throw new Error(reloadMessage);
|
|
1725
|
+
state$h.lastError = '';
|
|
1726
1726
|
const client = createClient(workerUrl);
|
|
1727
1727
|
try {
|
|
1728
1728
|
const id = await client.invoke('start', options);
|
|
1729
|
-
state$
|
|
1730
|
-
state$
|
|
1731
|
-
state$
|
|
1729
|
+
state$h.stopObserving = observe(document, (type, data) => client.invoke('record', type, data), report);
|
|
1730
|
+
state$h.client = client;
|
|
1731
|
+
state$h.enabled = true;
|
|
1732
1732
|
return id;
|
|
1733
1733
|
} catch (error) {
|
|
1734
1734
|
client.dispose();
|
|
@@ -1736,7 +1736,7 @@ const configure = async options => {
|
|
|
1736
1736
|
}
|
|
1737
1737
|
};
|
|
1738
1738
|
const configureProxy = async (options, port) => {
|
|
1739
|
-
if (state$
|
|
1739
|
+
if (state$h.client || !options.local && !options.upload) {
|
|
1740
1740
|
port.close();
|
|
1741
1741
|
throw new Error(reloadMessage);
|
|
1742
1742
|
}
|
|
@@ -1749,25 +1749,25 @@ const configureProxy = async (options, port) => {
|
|
|
1749
1749
|
commandMap: commandMapRef,
|
|
1750
1750
|
messagePort: proxyPort
|
|
1751
1751
|
});
|
|
1752
|
-
const original = state$
|
|
1753
|
-
state$
|
|
1752
|
+
const original = state$i.rpc;
|
|
1753
|
+
state$i.rpc = {
|
|
1754
1754
|
...rpc,
|
|
1755
1755
|
async dispose() {
|
|
1756
1756
|
try {
|
|
1757
1757
|
await rpc.dispose();
|
|
1758
1758
|
} finally {
|
|
1759
1759
|
client.dispose();
|
|
1760
|
-
state$
|
|
1761
|
-
state$
|
|
1762
|
-
state$
|
|
1760
|
+
state$h.client = undefined;
|
|
1761
|
+
state$h.enabled = false;
|
|
1762
|
+
state$h.proxy = false;
|
|
1763
1763
|
await original?.dispose();
|
|
1764
1764
|
}
|
|
1765
1765
|
}
|
|
1766
1766
|
};
|
|
1767
|
-
state$
|
|
1768
|
-
state$
|
|
1769
|
-
state$
|
|
1770
|
-
state$
|
|
1767
|
+
state$h.client = client;
|
|
1768
|
+
state$h.enabled = true;
|
|
1769
|
+
state$h.proxy = true;
|
|
1770
|
+
state$h.lastError = '';
|
|
1771
1771
|
return id;
|
|
1772
1772
|
} catch (error) {
|
|
1773
1773
|
proxyPort?.close();
|
|
@@ -1777,21 +1777,21 @@ const configureProxy = async (options, port) => {
|
|
|
1777
1777
|
}
|
|
1778
1778
|
};
|
|
1779
1779
|
const getSession = async () => {
|
|
1780
|
-
if (!state$
|
|
1781
|
-
return state$
|
|
1780
|
+
if (!state$h.enabled || !state$h.client) throw new Error('Session replay is disabled in settings');
|
|
1781
|
+
return state$h.client.invoke('export');
|
|
1782
1782
|
};
|
|
1783
1783
|
const getStatus = async () => {
|
|
1784
|
-
if (!state$
|
|
1784
|
+
if (!state$h.client) return {
|
|
1785
1785
|
enabled: false,
|
|
1786
|
-
error: state$
|
|
1786
|
+
error: state$h.lastError
|
|
1787
1787
|
};
|
|
1788
1788
|
return {
|
|
1789
|
-
enabled: state$
|
|
1790
|
-
...(await state$
|
|
1791
|
-
captureError: state$
|
|
1789
|
+
enabled: state$h.enabled,
|
|
1790
|
+
...(await state$h.client.invoke('status')),
|
|
1791
|
+
captureError: state$h.lastError
|
|
1792
1792
|
};
|
|
1793
1793
|
};
|
|
1794
|
-
const flush = async () => state$
|
|
1794
|
+
const flush = async () => state$h.client?.invoke('flush');
|
|
1795
1795
|
const openLocalFile = async () => {
|
|
1796
1796
|
const input = document.createElement('input');
|
|
1797
1797
|
input.type = 'file';
|
|
@@ -1802,7 +1802,7 @@ const openLocalFile = async () => {
|
|
|
1802
1802
|
try {
|
|
1803
1803
|
if (file.size > 64 * 1024 * 1024) throw new Error('Session replay file is too large');
|
|
1804
1804
|
const session = JSON.parse(await file.text());
|
|
1805
|
-
await configure({
|
|
1805
|
+
await configure$1({
|
|
1806
1806
|
endpoint: '',
|
|
1807
1807
|
local: false,
|
|
1808
1808
|
upload: false
|
|
@@ -1911,25 +1911,25 @@ const confirm = message => {
|
|
|
1911
1911
|
return window.confirm(message);
|
|
1912
1912
|
};
|
|
1913
1913
|
|
|
1914
|
-
const state$
|
|
1914
|
+
const state$g = {
|
|
1915
1915
|
styleSheets: Object.create(null),
|
|
1916
1916
|
texts: Object.create(null)
|
|
1917
1917
|
};
|
|
1918
1918
|
const set$b = (id, sheet) => {
|
|
1919
|
-
state$
|
|
1919
|
+
state$g.styleSheets[id] = sheet;
|
|
1920
1920
|
};
|
|
1921
1921
|
const get$a = id => {
|
|
1922
|
-
return state$
|
|
1922
|
+
return state$g.styleSheets[id];
|
|
1923
1923
|
};
|
|
1924
1924
|
const setText$2 = (id, text) => {
|
|
1925
|
-
state$
|
|
1925
|
+
state$g.texts[id] = text;
|
|
1926
1926
|
};
|
|
1927
1927
|
const getText = id => {
|
|
1928
|
-
return state$
|
|
1928
|
+
return state$g.texts[id];
|
|
1929
1929
|
};
|
|
1930
1930
|
const remove$4 = id => {
|
|
1931
|
-
delete state$
|
|
1932
|
-
delete state$
|
|
1931
|
+
delete state$g.styleSheets[id];
|
|
1932
|
+
delete state$g.texts[id];
|
|
1933
1933
|
};
|
|
1934
1934
|
|
|
1935
1935
|
const addCssStyleSheet = (id, text) => {
|
|
@@ -2124,7 +2124,7 @@ const createIdGenerator = () => {
|
|
|
2124
2124
|
};
|
|
2125
2125
|
const create$A = createIdGenerator();
|
|
2126
2126
|
|
|
2127
|
-
const state$
|
|
2127
|
+
const state$f = Object.create(null);
|
|
2128
2128
|
const retainString = (item, index) => {
|
|
2129
2129
|
const value = new Promise(resolve => {
|
|
2130
2130
|
item.getAsString(resolve);
|
|
@@ -2175,25 +2175,25 @@ const retainItems = dataTransfer => {
|
|
|
2175
2175
|
};
|
|
2176
2176
|
const addItems = items => {
|
|
2177
2177
|
const id = create$A();
|
|
2178
|
-
state$
|
|
2178
|
+
state$f[id] = items;
|
|
2179
2179
|
return id;
|
|
2180
2180
|
};
|
|
2181
2181
|
const add$2 = dataTransfer => {
|
|
2182
2182
|
return addItems(retainItems(dataTransfer));
|
|
2183
2183
|
};
|
|
2184
2184
|
const acquire$2 = id => {
|
|
2185
|
-
const items = state$
|
|
2185
|
+
const items = state$f[id];
|
|
2186
2186
|
if (!items) {
|
|
2187
2187
|
throw new Error(`Drop data not found: ${id}`);
|
|
2188
2188
|
}
|
|
2189
|
-
delete state$
|
|
2189
|
+
delete state$f[id];
|
|
2190
2190
|
return items;
|
|
2191
2191
|
};
|
|
2192
2192
|
|
|
2193
|
-
const state$
|
|
2193
|
+
const state$e = Object.create(null);
|
|
2194
2194
|
const acquire$1 = id => {
|
|
2195
|
-
const promise = state$
|
|
2196
|
-
delete state$
|
|
2195
|
+
const promise = state$e[id];
|
|
2196
|
+
delete state$e[id];
|
|
2197
2197
|
return promise;
|
|
2198
2198
|
};
|
|
2199
2199
|
const getFileHandles = async ids => {
|
|
@@ -2203,7 +2203,7 @@ const getFileHandles = async ids => {
|
|
|
2203
2203
|
};
|
|
2204
2204
|
const add$1 = promise => {
|
|
2205
2205
|
const id = create$A();
|
|
2206
|
-
state$
|
|
2206
|
+
state$e[id] = promise;
|
|
2207
2207
|
return id;
|
|
2208
2208
|
};
|
|
2209
2209
|
const addFileHandle$1 = fileHandle => {
|
|
@@ -2394,14 +2394,14 @@ const getEventListenerArgs = (params, event) => {
|
|
|
2394
2394
|
return serialized;
|
|
2395
2395
|
};
|
|
2396
2396
|
|
|
2397
|
-
const state$
|
|
2397
|
+
const state$d = {
|
|
2398
2398
|
ipc: undefined
|
|
2399
2399
|
};
|
|
2400
2400
|
const getIpc = () => {
|
|
2401
|
-
return state$
|
|
2401
|
+
return state$d.ipc;
|
|
2402
2402
|
};
|
|
2403
2403
|
const setIpc = value => {
|
|
2404
|
-
state$
|
|
2404
|
+
state$d.ipc = value;
|
|
2405
2405
|
};
|
|
2406
2406
|
|
|
2407
2407
|
const nameAnonymousFunction$1 = (fn, name) => {
|
|
@@ -2592,7 +2592,7 @@ const Span = 8;
|
|
|
2592
2592
|
const Table = 9;
|
|
2593
2593
|
const TBody = 10;
|
|
2594
2594
|
const Td = 11;
|
|
2595
|
-
const Text$
|
|
2595
|
+
const Text$3 = 12;
|
|
2596
2596
|
const Th = 13;
|
|
2597
2597
|
const THead = 14;
|
|
2598
2598
|
const Tr = 15;
|
|
@@ -2733,7 +2733,7 @@ const VirtualDomElements = {
|
|
|
2733
2733
|
THead,
|
|
2734
2734
|
Table,
|
|
2735
2735
|
Td,
|
|
2736
|
-
Text: Text$
|
|
2736
|
+
Text: Text$3,
|
|
2737
2737
|
TextArea,
|
|
2738
2738
|
Tfoot,
|
|
2739
2739
|
Th,
|
|
@@ -3241,6 +3241,19 @@ const detachEvent = ($Node, key) => {
|
|
|
3241
3241
|
$Node.removeEventListener(keyLower, previous.listener, previous.options);
|
|
3242
3242
|
listenersByEvent?.delete(keyLower);
|
|
3243
3243
|
};
|
|
3244
|
+
const detachAll = $Node => {
|
|
3245
|
+
const listeners = attachedListeners.get($Node);
|
|
3246
|
+
if (!listeners) {
|
|
3247
|
+
return;
|
|
3248
|
+
}
|
|
3249
|
+
for (const [name, {
|
|
3250
|
+
listener,
|
|
3251
|
+
options
|
|
3252
|
+
}] of listeners) {
|
|
3253
|
+
$Node.removeEventListener(name, listener, options);
|
|
3254
|
+
}
|
|
3255
|
+
attachedListeners.delete($Node);
|
|
3256
|
+
};
|
|
3244
3257
|
|
|
3245
3258
|
const toCamelCase = key => {
|
|
3246
3259
|
let camelCaseKey = '';
|
|
@@ -3440,7 +3453,7 @@ const {
|
|
|
3440
3453
|
Polyline,
|
|
3441
3454
|
Rect,
|
|
3442
3455
|
Svg,
|
|
3443
|
-
Text: Text$
|
|
3456
|
+
Text: Text$2,
|
|
3444
3457
|
Use,
|
|
3445
3458
|
Reference} = VirtualDomElements;
|
|
3446
3459
|
|
|
@@ -3465,18 +3478,18 @@ const renderReferenceNode = (element, eventMap, newEventMap) => {
|
|
|
3465
3478
|
setProps($Node, props, eventMap, newEventMap);
|
|
3466
3479
|
return $Node;
|
|
3467
3480
|
};
|
|
3468
|
-
const render$
|
|
3481
|
+
const render$2 = (element, eventMap, newEventMap) => {
|
|
3469
3482
|
switch (element.type) {
|
|
3470
3483
|
case Reference:
|
|
3471
3484
|
return renderReferenceNode(element, eventMap, newEventMap);
|
|
3472
|
-
case Text$
|
|
3485
|
+
case Text$2:
|
|
3473
3486
|
return renderDomTextNode(element);
|
|
3474
3487
|
default:
|
|
3475
3488
|
return renderDomElement(element, eventMap, newEventMap);
|
|
3476
3489
|
}
|
|
3477
3490
|
};
|
|
3478
3491
|
|
|
3479
|
-
const renderInternal = ($Parent, elements, eventMap, newEventMap, renderElement = render$
|
|
3492
|
+
const renderInternal = ($Parent, elements, eventMap, newEventMap, renderElement = render$2) => {
|
|
3480
3493
|
const max = elements.length - 1;
|
|
3481
3494
|
let stack = [];
|
|
3482
3495
|
for (let i = max; i >= 0; i--) {
|
|
@@ -3492,7 +3505,7 @@ const renderInternal = ($Parent, elements, eventMap, newEventMap, renderElement
|
|
|
3492
3505
|
$Parent.append(...stack);
|
|
3493
3506
|
};
|
|
3494
3507
|
|
|
3495
|
-
const renderInto = ($Parent, dom, eventMap = {}) => {
|
|
3508
|
+
const renderInto$1 = ($Parent, dom, eventMap = {}) => {
|
|
3496
3509
|
clearNode($Parent);
|
|
3497
3510
|
renderInternal($Parent, dom, eventMap);
|
|
3498
3511
|
};
|
|
@@ -3501,7 +3514,7 @@ const renderInto = ($Parent, dom, eventMap = {}) => {
|
|
|
3501
3514
|
* @param {any[]} elements
|
|
3502
3515
|
* @returns
|
|
3503
3516
|
*/
|
|
3504
|
-
const render = (elements, eventMap = {}, newEventMap = {}) => {
|
|
3517
|
+
const render$1 = (elements, eventMap = {}, newEventMap = {}) => {
|
|
3505
3518
|
const $Root = document.createElement('div');
|
|
3506
3519
|
renderInternal($Root, elements, eventMap, newEventMap);
|
|
3507
3520
|
return $Root;
|
|
@@ -3516,13 +3529,13 @@ const removeChild = ($Element, index) => {
|
|
|
3516
3529
|
$Child.remove();
|
|
3517
3530
|
}
|
|
3518
3531
|
};
|
|
3519
|
-
const add = ($Element, nodes, eventMap = {}) => {
|
|
3520
|
-
renderInternal($Element, nodes, eventMap, eventMap);
|
|
3532
|
+
const add = ($Element, nodes, eventMap = {}, renderElement) => {
|
|
3533
|
+
renderInternal($Element, nodes, eventMap, eventMap, renderElement);
|
|
3521
3534
|
};
|
|
3522
|
-
const replace = ($Element, nodes, eventMap = {}) => {
|
|
3535
|
+
const replace = ($Element, nodes, eventMap = {}, renderElement) => {
|
|
3523
3536
|
// Create a temporary container to render the new nodes
|
|
3524
3537
|
const $Temp = document.createElement('div');
|
|
3525
|
-
renderInternal($Temp, nodes, eventMap, eventMap);
|
|
3538
|
+
renderInternal($Temp, nodes, eventMap, eventMap, renderElement);
|
|
3526
3539
|
// Replace the current element with the new node(s)
|
|
3527
3540
|
const $NewNode = $Temp.firstChild;
|
|
3528
3541
|
if (!$NewNode) {
|
|
@@ -3626,7 +3639,7 @@ const handleMultiNavigation = (state, navigations, nextPatchType, $Element, patc
|
|
|
3626
3639
|
}
|
|
3627
3640
|
return true;
|
|
3628
3641
|
};
|
|
3629
|
-
const handleSetReferenceNodeUid = (state, patch) => {
|
|
3642
|
+
const handleSetReferenceNodeUid = (state, patch, options) => {
|
|
3630
3643
|
const instance = get$9(patch.uid);
|
|
3631
3644
|
if (!instance || !instance.state) {
|
|
3632
3645
|
console.error('Cannot set reference node uid: instance not found', {
|
|
@@ -3635,6 +3648,7 @@ const handleSetReferenceNodeUid = (state, patch) => {
|
|
|
3635
3648
|
return false;
|
|
3636
3649
|
}
|
|
3637
3650
|
const $NewNode = instance.state.$Viewlet;
|
|
3651
|
+
options.onRemove?.(state.current);
|
|
3638
3652
|
// @ts-ignore
|
|
3639
3653
|
state.current.replaceWith($NewNode);
|
|
3640
3654
|
state.current = $NewNode;
|
|
@@ -3655,10 +3669,10 @@ const handleNavigationPatch = (state, patch, patches, patchIndex, $Element) => {
|
|
|
3655
3669
|
return true;
|
|
3656
3670
|
}
|
|
3657
3671
|
};
|
|
3658
|
-
const applyMutationPatch = (state, patch, events) => {
|
|
3672
|
+
const applyMutationPatch = (state, patch, events, options) => {
|
|
3659
3673
|
switch (patch.type) {
|
|
3660
3674
|
case Add:
|
|
3661
|
-
add(state.current, patch.nodes, events);
|
|
3675
|
+
add(state.current, patch.nodes, events, options.renderElement);
|
|
3662
3676
|
state.hasAppliedMutation = true;
|
|
3663
3677
|
break;
|
|
3664
3678
|
case RemoveAttribute:
|
|
@@ -3666,11 +3680,13 @@ const applyMutationPatch = (state, patch, events) => {
|
|
|
3666
3680
|
state.hasAppliedMutation = true;
|
|
3667
3681
|
break;
|
|
3668
3682
|
case RemoveChild:
|
|
3683
|
+
options.onRemove?.(state.current.childNodes[patch.index]);
|
|
3669
3684
|
removeChild(state.current, patch.index);
|
|
3670
3685
|
state.hasAppliedMutation = true;
|
|
3671
3686
|
break;
|
|
3672
3687
|
case Replace:
|
|
3673
|
-
|
|
3688
|
+
options.onRemove?.(state.current);
|
|
3689
|
+
state.current = replace(state.current, patch.nodes, events, options.renderElement);
|
|
3674
3690
|
state.hasAppliedMutation = true;
|
|
3675
3691
|
break;
|
|
3676
3692
|
case SetAttribute:
|
|
@@ -3683,7 +3699,7 @@ const applyMutationPatch = (state, patch, events) => {
|
|
|
3683
3699
|
break;
|
|
3684
3700
|
}
|
|
3685
3701
|
};
|
|
3686
|
-
const applyPatch = ($Element, patches, eventMap = {}, id = 0) => {
|
|
3702
|
+
const applyPatch$2 = ($Element, patches, eventMap = {}, id = 0, options = {}) => {
|
|
3687
3703
|
const events = getEventListenerMap(id) || eventMap;
|
|
3688
3704
|
const state = {
|
|
3689
3705
|
current: $Element,
|
|
@@ -3696,12 +3712,12 @@ const applyPatch = ($Element, patches, eventMap = {}, id = 0) => {
|
|
|
3696
3712
|
return;
|
|
3697
3713
|
}
|
|
3698
3714
|
if (patch.type === SetReferenceNodeUid) {
|
|
3699
|
-
if (!handleSetReferenceNodeUid(state, patch)) {
|
|
3715
|
+
if (!handleSetReferenceNodeUid(state, patch, options)) {
|
|
3700
3716
|
return;
|
|
3701
3717
|
}
|
|
3702
3718
|
continue;
|
|
3703
3719
|
}
|
|
3704
|
-
applyMutationPatch(state, patch, events);
|
|
3720
|
+
applyMutationPatch(state, patch, events, options);
|
|
3705
3721
|
} catch (error) {
|
|
3706
3722
|
console.error('Error applying patch at index ' + patchIndex, patch, error);
|
|
3707
3723
|
throw error;
|
|
@@ -3782,7 +3798,7 @@ const restoreFocusedElement = ($Hidden, $New, focused) => {
|
|
|
3782
3798
|
};
|
|
3783
3799
|
const renderWithUid = ($Viewlet, dom, eventMap, uid, inputMap, focused, activeElement) => {
|
|
3784
3800
|
const newEventMap = getEventListenerMap(uid);
|
|
3785
|
-
const $New = render(dom, eventMap, newEventMap).firstChild;
|
|
3801
|
+
const $New = render$1(dom, eventMap, newEventMap).firstChild;
|
|
3786
3802
|
// A referenced pane can be temporarily absent from the new layout. Leave its
|
|
3787
3803
|
// focused input in that pane unless there is a replacement to transfer it to.
|
|
3788
3804
|
const hasReplacement = focused && $New.querySelector(`[name="${CSS.escape(focused)}"]`);
|
|
@@ -3841,7 +3857,7 @@ const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
|
3841
3857
|
}
|
|
3842
3858
|
if (!uid) {
|
|
3843
3859
|
const $Hidden = createHiddenContainer(activeElement, focused);
|
|
3844
|
-
renderInto($Viewlet, dom, eventMap);
|
|
3860
|
+
renderInto$1($Viewlet, dom, eventMap);
|
|
3845
3861
|
$Hidden.remove();
|
|
3846
3862
|
}
|
|
3847
3863
|
restoreFocus($Viewlet, isRootTree, isTreeFocused, focused);
|
|
@@ -3855,6 +3871,156 @@ const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
|
3855
3871
|
}
|
|
3856
3872
|
};
|
|
3857
3873
|
|
|
3874
|
+
const safeTags = new Set(['div', 'span', 'p', 'section', 'header', 'footer', 'main', 'nav']);
|
|
3875
|
+
const safeProps = new Set(['type', 'childCount', 'id', 'className', 'title', 'role', 'style']);
|
|
3876
|
+
const validateLimit = limit => {
|
|
3877
|
+
if (!Number.isSafeInteger(limit) || limit < 0) {
|
|
3878
|
+
throw new RangeError('Cache limits must be nonnegative safe integers');
|
|
3879
|
+
}
|
|
3880
|
+
return limit;
|
|
3881
|
+
};
|
|
3882
|
+
const createRenderer = (options = {}) => {
|
|
3883
|
+
const domLimit = validateLimit(options.cache?.dom ?? 0);
|
|
3884
|
+
const textLimit = validateLimit(options.cache?.text ?? 0);
|
|
3885
|
+
const elements = [];
|
|
3886
|
+
const texts = [];
|
|
3887
|
+
const owned = new WeakSet();
|
|
3888
|
+
const recyclable = new WeakSet();
|
|
3889
|
+
const rootNodes = new Map();
|
|
3890
|
+
const rootByNode = new WeakMap();
|
|
3891
|
+
const parentRoots = new WeakMap();
|
|
3892
|
+
let activeRoot;
|
|
3893
|
+
const rememberNode = node => {
|
|
3894
|
+
owned.add(node);
|
|
3895
|
+
if (activeRoot) {
|
|
3896
|
+
rootNodes.get(activeRoot)?.add(node);
|
|
3897
|
+
rootByNode.set(node, activeRoot);
|
|
3898
|
+
}
|
|
3899
|
+
};
|
|
3900
|
+
const renderElement = (node, eventMap, newEventMap) => {
|
|
3901
|
+
if (node.type === Reference) {
|
|
3902
|
+
return render$2(node, eventMap, newEventMap);
|
|
3903
|
+
}
|
|
3904
|
+
let result;
|
|
3905
|
+
if (node.type === Text$2) {
|
|
3906
|
+
const text = texts.pop() || document.createTextNode('');
|
|
3907
|
+
text.data = node.text;
|
|
3908
|
+
result = text;
|
|
3909
|
+
} else {
|
|
3910
|
+
const tag = getElementTag(node.type);
|
|
3911
|
+
const index = elements.findIndex(element => element.localName === tag && element.ownerDocument === document);
|
|
3912
|
+
if (index === -1) {
|
|
3913
|
+
result = render$2(node, eventMap, newEventMap);
|
|
3914
|
+
} else {
|
|
3915
|
+
const element = elements.splice(index, 1)[0];
|
|
3916
|
+
setProps(element, node, eventMap, newEventMap);
|
|
3917
|
+
result = element;
|
|
3918
|
+
}
|
|
3919
|
+
recyclable.delete(result);
|
|
3920
|
+
if (safeTags.has(tag) && Object.keys(node).every(key => safeProps.has(key) || key.startsWith('aria-') || key.startsWith('data-') || key.startsWith('on'))) {
|
|
3921
|
+
recyclable.add(result);
|
|
3922
|
+
}
|
|
3923
|
+
}
|
|
3924
|
+
rememberNode(result);
|
|
3925
|
+
return result;
|
|
3926
|
+
};
|
|
3927
|
+
const collect = node => {
|
|
3928
|
+
if (!node || !owned.has(node)) {
|
|
3929
|
+
return;
|
|
3930
|
+
}
|
|
3931
|
+
owned.delete(node);
|
|
3932
|
+
rootByNode.delete(node);
|
|
3933
|
+
for (const child of node.childNodes) {
|
|
3934
|
+
collect(child);
|
|
3935
|
+
}
|
|
3936
|
+
if (node instanceof Text) {
|
|
3937
|
+
node.data = '';
|
|
3938
|
+
if (texts.length < textLimit) {
|
|
3939
|
+
texts.push(node);
|
|
3940
|
+
}
|
|
3941
|
+
} else if (node instanceof Element) {
|
|
3942
|
+
detachAll(node);
|
|
3943
|
+
node.replaceChildren();
|
|
3944
|
+
if (node instanceof HTMLElement && recyclable.has(node) && Object.getOwnPropertyNames(node).length === 0) {
|
|
3945
|
+
for (const name of node.getAttributeNames()) {
|
|
3946
|
+
node.removeAttribute(name);
|
|
3947
|
+
}
|
|
3948
|
+
node.scrollTop = 0;
|
|
3949
|
+
node.scrollLeft = 0;
|
|
3950
|
+
if (elements.length < domLimit) {
|
|
3951
|
+
elements.push(node);
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
};
|
|
3956
|
+
const dispose = root => {
|
|
3957
|
+
const trackedRoot = rootNodes.has(root) ? root : parentRoots.get(root);
|
|
3958
|
+
if (!trackedRoot) {
|
|
3959
|
+
return;
|
|
3960
|
+
}
|
|
3961
|
+
const nodes = rootNodes.get(trackedRoot);
|
|
3962
|
+
rootNodes.delete(trackedRoot);
|
|
3963
|
+
trackedRoot.remove();
|
|
3964
|
+
const nodesToCollect = nodes || [];
|
|
3965
|
+
for (const node of nodesToCollect) {
|
|
3966
|
+
collect(node);
|
|
3967
|
+
}
|
|
3968
|
+
trackedRoot.replaceChildren();
|
|
3969
|
+
};
|
|
3970
|
+
const render = (nodes, eventMap = {}, newEventMap = {}) => {
|
|
3971
|
+
const root = document.createElement('div');
|
|
3972
|
+
rootNodes.set(root, new Set());
|
|
3973
|
+
activeRoot = root;
|
|
3974
|
+
try {
|
|
3975
|
+
renderInternal(root, nodes, eventMap, newEventMap, renderElement);
|
|
3976
|
+
} finally {
|
|
3977
|
+
activeRoot = undefined;
|
|
3978
|
+
}
|
|
3979
|
+
return root;
|
|
3980
|
+
};
|
|
3981
|
+
const renderInto = (parent, nodes, eventMap = {}, newEventMap = {}) => {
|
|
3982
|
+
dispose(parent);
|
|
3983
|
+
const root = render(nodes, eventMap, newEventMap);
|
|
3984
|
+
parent.replaceChildren(...root.childNodes);
|
|
3985
|
+
parentRoots.set(parent, root);
|
|
3986
|
+
};
|
|
3987
|
+
const getRoot = node => {
|
|
3988
|
+
let current = node;
|
|
3989
|
+
while (current) {
|
|
3990
|
+
const root = rootByNode.get(current);
|
|
3991
|
+
if (root) {
|
|
3992
|
+
return root;
|
|
3993
|
+
}
|
|
3994
|
+
current = current.parentNode;
|
|
3995
|
+
}
|
|
3996
|
+
return undefined;
|
|
3997
|
+
};
|
|
3998
|
+
const applyPatch = (element, patches, eventMap = {}, id = 0) => {
|
|
3999
|
+
const root = getRoot(element);
|
|
4000
|
+
activeRoot = root;
|
|
4001
|
+
try {
|
|
4002
|
+
const options = {
|
|
4003
|
+
onRemove: collect,
|
|
4004
|
+
renderElement
|
|
4005
|
+
};
|
|
4006
|
+
applyPatch$2(element, patches, eventMap, id, options);
|
|
4007
|
+
} finally {
|
|
4008
|
+
activeRoot = undefined;
|
|
4009
|
+
}
|
|
4010
|
+
};
|
|
4011
|
+
const clearCache = () => {
|
|
4012
|
+
elements.length = 0;
|
|
4013
|
+
texts.length = 0;
|
|
4014
|
+
};
|
|
4015
|
+
return {
|
|
4016
|
+
applyPatch,
|
|
4017
|
+
render,
|
|
4018
|
+
renderInto,
|
|
4019
|
+
dispose,
|
|
4020
|
+
clearCache
|
|
4021
|
+
};
|
|
4022
|
+
};
|
|
4023
|
+
|
|
3858
4024
|
const set$8 = setComponentUid;
|
|
3859
4025
|
const get$7 = getComponentUid;
|
|
3860
4026
|
const fromEvent = getComponentUidFromEvent;
|
|
@@ -3931,26 +4097,26 @@ const launchDragAndDropWorker = async () => {
|
|
|
3931
4097
|
}
|
|
3932
4098
|
};
|
|
3933
4099
|
|
|
3934
|
-
const state$
|
|
4100
|
+
const state$c = {
|
|
3935
4101
|
rpc: undefined
|
|
3936
4102
|
};
|
|
3937
4103
|
const hydrate$3 = async () => {
|
|
3938
4104
|
const result = await launchDragAndDropWorker();
|
|
3939
4105
|
if (isError(result)) {
|
|
3940
|
-
state$
|
|
4106
|
+
state$c.rpc = undefined;
|
|
3941
4107
|
return result;
|
|
3942
4108
|
}
|
|
3943
|
-
state$
|
|
4109
|
+
state$c.rpc = result.value;
|
|
3944
4110
|
return success(undefined);
|
|
3945
4111
|
};
|
|
3946
4112
|
const handleMessagePort$1 = async port => {
|
|
3947
|
-
if (!state$
|
|
4113
|
+
if (!state$c.rpc) {
|
|
3948
4114
|
const result = await hydrate$3();
|
|
3949
4115
|
if (isError(result)) {
|
|
3950
4116
|
throw result.error;
|
|
3951
4117
|
}
|
|
3952
4118
|
}
|
|
3953
|
-
const rpc = state$
|
|
4119
|
+
const rpc = state$c.rpc;
|
|
3954
4120
|
if (!rpc) {
|
|
3955
4121
|
throw new Error('Drag And Drop Worker failed to initialize');
|
|
3956
4122
|
}
|
|
@@ -4553,7 +4719,7 @@ const create$u = async ({
|
|
|
4553
4719
|
// @ts-ignore
|
|
4554
4720
|
return module.create(options);
|
|
4555
4721
|
};
|
|
4556
|
-
const dispose$
|
|
4722
|
+
const dispose$j = id => {
|
|
4557
4723
|
const worker = remove$3(id);
|
|
4558
4724
|
worker?.terminate();
|
|
4559
4725
|
};
|
|
@@ -4651,7 +4817,7 @@ const create$Button = (label, icon) => {
|
|
|
4651
4817
|
};
|
|
4652
4818
|
|
|
4653
4819
|
// TODO this file is not needed when all elements are position fixed
|
|
4654
|
-
const state$
|
|
4820
|
+
const state$b = {
|
|
4655
4821
|
$Widgets: undefined,
|
|
4656
4822
|
widgetSet: new Set()
|
|
4657
4823
|
};
|
|
@@ -4663,20 +4829,20 @@ const create$Widgets = () => {
|
|
|
4663
4829
|
};
|
|
4664
4830
|
const append$1 = $Element => {
|
|
4665
4831
|
// TODO should not call append in the first place if it is already in DOM
|
|
4666
|
-
if (state$
|
|
4832
|
+
if (state$b.widgetSet.has($Element)) {
|
|
4667
4833
|
return;
|
|
4668
4834
|
}
|
|
4669
|
-
state$
|
|
4670
|
-
if (state$
|
|
4835
|
+
state$b.widgetSet.add($Element);
|
|
4836
|
+
if (state$b.$Widgets) {
|
|
4671
4837
|
// @ts-expect-error
|
|
4672
|
-
state$
|
|
4838
|
+
state$b.$Widgets.append($Element);
|
|
4673
4839
|
} else {
|
|
4674
4840
|
// @ts-expect-error
|
|
4675
|
-
state$
|
|
4841
|
+
state$b.$Widgets = create$Widgets();
|
|
4676
4842
|
// @ts-expect-error
|
|
4677
|
-
state$
|
|
4843
|
+
state$b.$Widgets.append($Element);
|
|
4678
4844
|
// @ts-expect-error
|
|
4679
|
-
document.body.append(state$
|
|
4845
|
+
document.body.append(state$b.$Widgets);
|
|
4680
4846
|
}
|
|
4681
4847
|
};
|
|
4682
4848
|
const remove$1 = $Element => {
|
|
@@ -4684,17 +4850,17 @@ const remove$1 = $Element => {
|
|
|
4684
4850
|
// TODO $Element should always be defined
|
|
4685
4851
|
return;
|
|
4686
4852
|
}
|
|
4687
|
-
state$
|
|
4853
|
+
state$b.widgetSet.delete($Element);
|
|
4688
4854
|
$Element.remove();
|
|
4689
4855
|
// TODO state.$Widgets should always be defined at this point
|
|
4690
|
-
if (state$
|
|
4856
|
+
if (state$b.widgetSet.size === 0 && state$b.$Widgets) {
|
|
4691
4857
|
// @ts-expect-error
|
|
4692
|
-
state$
|
|
4693
|
-
state$
|
|
4858
|
+
state$b.$Widgets.remove();
|
|
4859
|
+
state$b.$Widgets = undefined;
|
|
4694
4860
|
}
|
|
4695
4861
|
};
|
|
4696
4862
|
|
|
4697
|
-
const state$
|
|
4863
|
+
const state$a = {
|
|
4698
4864
|
nextNotificationId: 0
|
|
4699
4865
|
};
|
|
4700
4866
|
const handleCloseClick = event => {
|
|
@@ -4717,7 +4883,7 @@ const create$Notification = message => {
|
|
|
4717
4883
|
const $NotificationMessage = create$NotificationMessage(message);
|
|
4718
4884
|
const $CloseButton = create$CloseButton();
|
|
4719
4885
|
const $Notification = document.createElement('div');
|
|
4720
|
-
$Notification.id = `Notification-${++state$
|
|
4886
|
+
$Notification.id = `Notification-${++state$a.nextNotificationId}`;
|
|
4721
4887
|
$Notification.className = 'Notification';
|
|
4722
4888
|
$Notification.append($NotificationMessage, $CloseButton);
|
|
4723
4889
|
return $Notification;
|
|
@@ -4766,7 +4932,7 @@ const create$NotificationWithOptions = (message, options) => {
|
|
|
4766
4932
|
$NotificationOptions.append($NotificationOption);
|
|
4767
4933
|
}
|
|
4768
4934
|
const $Notification = document.createElement('div');
|
|
4769
|
-
$Notification.id = `Notification-${++state$
|
|
4935
|
+
$Notification.id = `Notification-${++state$a.nextNotificationId}`;
|
|
4770
4936
|
$Notification.className = 'Notification';
|
|
4771
4937
|
$Notification.append($NotificationMessage, $CloseButton, $NotificationOptions);
|
|
4772
4938
|
$Notification.onclick = handleNotificationClick;
|
|
@@ -4777,7 +4943,7 @@ const createWithOptions = (type, message, options) => {
|
|
|
4777
4943
|
append$1($Notification);
|
|
4778
4944
|
return $Notification.id;
|
|
4779
4945
|
};
|
|
4780
|
-
const dispose$
|
|
4946
|
+
const dispose$i = id => {
|
|
4781
4947
|
const $Notification = document.getElementById(id);
|
|
4782
4948
|
if ($Notification?.classList.contains('Notification')) {
|
|
4783
4949
|
remove$1($Notification);
|
|
@@ -4791,11 +4957,11 @@ const revokeObjectUrl = url => {
|
|
|
4791
4957
|
URL.revokeObjectURL(url);
|
|
4792
4958
|
};
|
|
4793
4959
|
|
|
4794
|
-
const state$
|
|
4960
|
+
const state$9 = {
|
|
4795
4961
|
canvasObjects: Object.create(null)
|
|
4796
4962
|
};
|
|
4797
4963
|
const set$5 = (canvasId, canvas) => {
|
|
4798
|
-
state$
|
|
4964
|
+
state$9.canvasObjects[canvasId] = canvas;
|
|
4799
4965
|
};
|
|
4800
4966
|
|
|
4801
4967
|
const create$r = async (canvasId, objectId) => {
|
|
@@ -4894,16 +5060,16 @@ const findIndex = ($Container, $Target) => {
|
|
|
4894
5060
|
return -1;
|
|
4895
5061
|
};
|
|
4896
5062
|
|
|
4897
|
-
const state$
|
|
5063
|
+
const state$8 = {
|
|
4898
5064
|
/**
|
|
4899
5065
|
* @type {HTMLElement|undefined}
|
|
4900
5066
|
*/
|
|
4901
5067
|
$PreviousFocusElement: undefined};
|
|
4902
5068
|
const setElement = $Element => {
|
|
4903
|
-
state$
|
|
5069
|
+
state$8.$PreviousFocusElement = $Element;
|
|
4904
5070
|
};
|
|
4905
5071
|
const getElement = () => {
|
|
4906
|
-
return state$
|
|
5072
|
+
return state$8.$PreviousFocusElement;
|
|
4907
5073
|
};
|
|
4908
5074
|
|
|
4909
5075
|
const focus$e = $Element => {
|
|
@@ -4960,6 +5126,34 @@ const setHeight = ($Element, height) => {
|
|
|
4960
5126
|
$Element.style.height = `${height}px`;
|
|
4961
5127
|
};
|
|
4962
5128
|
|
|
5129
|
+
const state$7 = {
|
|
5130
|
+
renderer: undefined
|
|
5131
|
+
};
|
|
5132
|
+
const configure = options => {
|
|
5133
|
+
const cache = options?.cache;
|
|
5134
|
+
state$7.renderer = cache?.dom > 0 || cache?.text > 0 ? createRenderer(options) : undefined;
|
|
5135
|
+
};
|
|
5136
|
+
const render = (nodes, eventMap = {}, newEventMap = {}) => {
|
|
5137
|
+
return state$7.renderer?.render(nodes, eventMap, newEventMap) || render$1(nodes, eventMap, newEventMap);
|
|
5138
|
+
};
|
|
5139
|
+
const renderInto = (parent, nodes, eventMap = {}, newEventMap = {}) => {
|
|
5140
|
+
if (state$7.renderer) {
|
|
5141
|
+
state$7.renderer.renderInto(parent, nodes, eventMap, newEventMap);
|
|
5142
|
+
return;
|
|
5143
|
+
}
|
|
5144
|
+
renderInto$1(parent, nodes, eventMap);
|
|
5145
|
+
};
|
|
5146
|
+
const applyPatch$1 = (element, patches, eventMap = {}, id = 0) => {
|
|
5147
|
+
if (state$7.renderer) {
|
|
5148
|
+
state$7.renderer.applyPatch(element, patches, eventMap, id);
|
|
5149
|
+
return;
|
|
5150
|
+
}
|
|
5151
|
+
applyPatch$2(element, patches, eventMap, id);
|
|
5152
|
+
};
|
|
5153
|
+
const dispose$h = root => {
|
|
5154
|
+
state$7.renderer?.dispose(root);
|
|
5155
|
+
};
|
|
5156
|
+
|
|
4963
5157
|
const FocusLocationList = 17;
|
|
4964
5158
|
const FocusMenu = 18;
|
|
4965
5159
|
const FocusSimpleBrowserInput = 23;
|
|
@@ -5495,7 +5689,7 @@ const ElementActions = {
|
|
|
5495
5689
|
};
|
|
5496
5690
|
|
|
5497
5691
|
const Css = 1;
|
|
5498
|
-
const Text = 2;
|
|
5692
|
+
const Text$1 = 2;
|
|
5499
5693
|
const HasText = 3;
|
|
5500
5694
|
const Nth = 4;
|
|
5501
5695
|
|
|
@@ -5533,7 +5727,7 @@ const selectorToString = parsedSelector => {
|
|
|
5533
5727
|
result += ` >> ${part.selector}`;
|
|
5534
5728
|
continue;
|
|
5535
5729
|
}
|
|
5536
|
-
if (part.type === Text || part.type === 'text') {
|
|
5730
|
+
if (part.type === Text$1 || part.type === 'text') {
|
|
5537
5731
|
if (!result) {
|
|
5538
5732
|
result = `text=${part.text}`;
|
|
5539
5733
|
continue;
|
|
@@ -5557,7 +5751,7 @@ const querySelector = parsedSelector => {
|
|
|
5557
5751
|
}
|
|
5558
5752
|
let elements = [document.body];
|
|
5559
5753
|
for (const part of parsedSelector) {
|
|
5560
|
-
if (part.type === Text || part.type === 'text') {
|
|
5754
|
+
if (part.type === Text$1 || part.type === 'text') {
|
|
5561
5755
|
elements = elements.flatMap(element => {
|
|
5562
5756
|
return querySelectorByText(element, part.text);
|
|
5563
5757
|
});
|
|
@@ -6140,6 +6334,10 @@ const transferToWebView = objectId => {
|
|
|
6140
6334
|
}, targetOrigin, [port]);
|
|
6141
6335
|
};
|
|
6142
6336
|
|
|
6337
|
+
const applyPatch = (element, patches, eventMap = {}, id = 0) => {
|
|
6338
|
+
applyPatch$1(element, patches, eventMap, id);
|
|
6339
|
+
};
|
|
6340
|
+
|
|
6143
6341
|
const attachEvents$7 = ($Node, eventMap) => {
|
|
6144
6342
|
for (const [key, value] of Object.entries(eventMap)) {
|
|
6145
6343
|
$Node.addEventListener(key, value);
|
|
@@ -7353,7 +7551,6 @@ const setDom$8 = (state, dom) => {
|
|
|
7353
7551
|
$Viewlet
|
|
7354
7552
|
} = state;
|
|
7355
7553
|
const $Root = render(dom);
|
|
7356
|
-
// @ts-expect-error
|
|
7357
7554
|
$ListItems.replaceChildren(...$Root.firstChild.childNodes);
|
|
7358
7555
|
append$1($Viewlet);
|
|
7359
7556
|
// TODO recycle nodes
|
|
@@ -7429,7 +7626,6 @@ const setDom$7 = (state, dom) => {
|
|
|
7429
7626
|
$Viewlet
|
|
7430
7627
|
} = state;
|
|
7431
7628
|
const $Root = render(dom);
|
|
7432
|
-
// @ts-expect-error
|
|
7433
7629
|
$Viewlet.replaceChildren(...$Root.firstChild.childNodes);
|
|
7434
7630
|
append$1($Viewlet);
|
|
7435
7631
|
};
|
|
@@ -10443,6 +10639,7 @@ const dispose$3 = id => {
|
|
|
10443
10639
|
if (instance.factory.dispose) {
|
|
10444
10640
|
instance.factory.dispose(instance.state);
|
|
10445
10641
|
}
|
|
10642
|
+
dispose$h(instance.state.$Viewlet);
|
|
10446
10643
|
if (instance.state.$Viewlet?.isConnected) {
|
|
10447
10644
|
instance.state.$Viewlet.remove();
|
|
10448
10645
|
}
|
|
@@ -10807,7 +11004,13 @@ const handleFullScreenChange = isFullScreen => {
|
|
|
10807
11004
|
send$1('Layout.handleFullScreenChange', isFullScreen);
|
|
10808
11005
|
};
|
|
10809
11006
|
const handleDocumentFullScreenChange = () => {
|
|
10810
|
-
|
|
11007
|
+
const {
|
|
11008
|
+
fullscreenElement
|
|
11009
|
+
} = document;
|
|
11010
|
+
if (fullscreenElement && fullscreenElement !== document.documentElement) {
|
|
11011
|
+
return;
|
|
11012
|
+
}
|
|
11013
|
+
handleFullScreenChange(Boolean(fullscreenElement));
|
|
10811
11014
|
};
|
|
10812
11015
|
const sendVisibilityChangeHint = () => {
|
|
10813
11016
|
send$1(/* SaveState.handleVisibilityChange */'SaveState.handleVisibilityChange', /* visibilityState */'hidden');
|
|
@@ -11218,7 +11421,7 @@ const commandMap = {
|
|
|
11218
11421
|
'HandleMessagePort.handleMessagePort': handleMessagePort,
|
|
11219
11422
|
'InitData.getInitData': getInitData,
|
|
11220
11423
|
'IpcParent.create': create$u,
|
|
11221
|
-
'IpcParent.dispose': dispose$
|
|
11424
|
+
'IpcParent.dispose': dispose$j,
|
|
11222
11425
|
'KeyBindings.setIdentifiers': setIdentifiers,
|
|
11223
11426
|
'Layout.getBounds': getBounds,
|
|
11224
11427
|
'Location.getHref': getHref,
|
|
@@ -11236,7 +11439,7 @@ const commandMap = {
|
|
|
11236
11439
|
'Meta.setThemeColor': setThemeColor,
|
|
11237
11440
|
'Notification.create': create$s,
|
|
11238
11441
|
'Notification.createWithOptions': createWithOptions,
|
|
11239
|
-
'Notification.dispose': dispose$
|
|
11442
|
+
'Notification.dispose': dispose$i,
|
|
11240
11443
|
'ObjectUrl.create': createObjectUrl,
|
|
11241
11444
|
'ObjectUrl.revoke': revokeObjectUrl,
|
|
11242
11445
|
'OffscreenCanvas.create': create$r,
|
|
@@ -11250,7 +11453,7 @@ const commandMap = {
|
|
|
11250
11453
|
'PointerCapture.unmock': unmock,
|
|
11251
11454
|
'Prompt.prompt': prompt,
|
|
11252
11455
|
'ScreenCapture.start': start,
|
|
11253
|
-
'SessionReplay.configure': configure,
|
|
11456
|
+
'SessionReplay.configure': configure$1,
|
|
11254
11457
|
'SessionReplay.configureProxy': configureProxy,
|
|
11255
11458
|
'SessionReplay.flush': flush,
|
|
11256
11459
|
'SessionReplay.getSession': getSession,
|
|
@@ -11291,6 +11494,7 @@ const commandMap = {
|
|
|
11291
11494
|
'Viewlet.setBounds': setBounds$1,
|
|
11292
11495
|
'Viewlet.setComponentDom': setComponentDom,
|
|
11293
11496
|
'Viewlet.show': show,
|
|
11497
|
+
'VirtualDom.configure': configure,
|
|
11294
11498
|
'WebRtc.readMicLevels': readMicLevels,
|
|
11295
11499
|
'WebRtc.setRemoteDescription': setRemoteDescription,
|
|
11296
11500
|
'WebRtc.startWebRtcAudioStream': startWebRtcAudioStream,
|