@lvce-editor/preview-sandbox-worker 1.8.0 → 1.10.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/previewSandBoxWorkerMain.js +10 -11
- package/package.json +1 -1
|
@@ -1589,7 +1589,7 @@ const handleClickLocal = (uid, hdId, clientX, clientY) => {
|
|
|
1589
1589
|
if (!happyDomInstance) {
|
|
1590
1590
|
return;
|
|
1591
1591
|
}
|
|
1592
|
-
const element = happyDomInstance.elementMap
|
|
1592
|
+
const element = happyDomInstance.elementMap[hdId];
|
|
1593
1593
|
if (!element) {
|
|
1594
1594
|
return;
|
|
1595
1595
|
}
|
|
@@ -1617,7 +1617,7 @@ const handleInputLocal = (uid, hdId, value) => {
|
|
|
1617
1617
|
if (!happyDomInstance) {
|
|
1618
1618
|
return;
|
|
1619
1619
|
}
|
|
1620
|
-
const element = happyDomInstance.elementMap
|
|
1620
|
+
const element = happyDomInstance.elementMap[hdId];
|
|
1621
1621
|
if (!element) {
|
|
1622
1622
|
return;
|
|
1623
1623
|
}
|
|
@@ -1648,7 +1648,7 @@ const handleKeydownLocal = (uid, hdId, key, code) => {
|
|
|
1648
1648
|
if (!happyDomInstance) {
|
|
1649
1649
|
return;
|
|
1650
1650
|
}
|
|
1651
|
-
const element = hdId ? happyDomInstance.elementMap
|
|
1651
|
+
const element = hdId ? happyDomInstance.elementMap[hdId] : happyDomInstance.document;
|
|
1652
1652
|
if (!element) {
|
|
1653
1653
|
return;
|
|
1654
1654
|
}
|
|
@@ -1678,7 +1678,7 @@ const handleKeyupLocal = (uid, hdId, key, code) => {
|
|
|
1678
1678
|
if (!happyDomInstance) {
|
|
1679
1679
|
return;
|
|
1680
1680
|
}
|
|
1681
|
-
const element = hdId ? happyDomInstance.elementMap
|
|
1681
|
+
const element = hdId ? happyDomInstance.elementMap[hdId] : happyDomInstance.document;
|
|
1682
1682
|
if (!element) {
|
|
1683
1683
|
return;
|
|
1684
1684
|
}
|
|
@@ -1716,7 +1716,7 @@ const handleMousedownLocal = (uid, hdId, clientX, clientY) => {
|
|
|
1716
1716
|
if (!happyDomInstance) {
|
|
1717
1717
|
return;
|
|
1718
1718
|
}
|
|
1719
|
-
const element = happyDomInstance.elementMap
|
|
1719
|
+
const element = happyDomInstance.elementMap[hdId];
|
|
1720
1720
|
if (!element) {
|
|
1721
1721
|
return;
|
|
1722
1722
|
}
|
|
@@ -1748,7 +1748,7 @@ const handleMousemoveLocal = (uid, hdId, clientX, clientY, x, y) => {
|
|
|
1748
1748
|
if (!happyDomInstance) {
|
|
1749
1749
|
return;
|
|
1750
1750
|
}
|
|
1751
|
-
const element = happyDomInstance.elementMap
|
|
1751
|
+
const element = happyDomInstance.elementMap[hdId];
|
|
1752
1752
|
if (!element) {
|
|
1753
1753
|
return;
|
|
1754
1754
|
}
|
|
@@ -1780,7 +1780,7 @@ const handleMouseupLocal = (uid, hdId, clientX, clientY) => {
|
|
|
1780
1780
|
if (!happyDomInstance) {
|
|
1781
1781
|
return;
|
|
1782
1782
|
}
|
|
1783
|
-
const element = happyDomInstance.elementMap
|
|
1783
|
+
const element = happyDomInstance.elementMap[hdId];
|
|
1784
1784
|
if (!element) {
|
|
1785
1785
|
return;
|
|
1786
1786
|
}
|
|
@@ -89679,11 +89679,10 @@ const handleMutations = async uid => {
|
|
|
89679
89679
|
const parsedDom = serialized.dom;
|
|
89680
89680
|
// @ts-ignore
|
|
89681
89681
|
getParsedNodesChildNodeCount(parsedDom);
|
|
89682
|
-
|
|
89683
|
-
// TODO notify
|
|
89684
89682
|
try {
|
|
89685
|
-
await invoke$1('Preview.
|
|
89686
|
-
} catch {
|
|
89683
|
+
await invoke$1('Preview.handleMutation', uid);
|
|
89684
|
+
} catch (error) {
|
|
89685
|
+
console.error(error);
|
|
89687
89686
|
// ignore
|
|
89688
89687
|
}
|
|
89689
89688
|
};
|