@flowgram.ai/document 0.2.8 → 0.2.9
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/esm/index.js +10 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -12
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/esm/index.js
CHANGED
|
@@ -1794,7 +1794,7 @@ var FlowDocument = class {
|
|
|
1794
1794
|
* @param data
|
|
1795
1795
|
* @param addedNodes
|
|
1796
1796
|
*/
|
|
1797
|
-
addNode(data, addedNodes
|
|
1797
|
+
addNode(data, addedNodes) {
|
|
1798
1798
|
const { id, type = "block", originParent, parent, meta, hidden, index } = data;
|
|
1799
1799
|
let node = this.getNode(id);
|
|
1800
1800
|
let isNew = false;
|
|
@@ -1836,23 +1836,21 @@ var FlowDocument = class {
|
|
|
1836
1836
|
if (extendNodes && addedNodes) {
|
|
1837
1837
|
addedNodes.push(...extendNodes);
|
|
1838
1838
|
}
|
|
1839
|
-
} else if (data.blocks && data.blocks.length > 0
|
|
1839
|
+
} else if (data.blocks && data.blocks.length > 0) {
|
|
1840
1840
|
if (!data.blocks[0].type) {
|
|
1841
1841
|
this.addInlineBlocks(node, data.blocks, addedNodes);
|
|
1842
1842
|
} else {
|
|
1843
1843
|
this.addBlocksAsChildren(node, data.blocks, addedNodes);
|
|
1844
1844
|
}
|
|
1845
1845
|
}
|
|
1846
|
-
if (
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
this.onNodeUpdateEmitter.fire({ node, data, json: data });
|
|
1855
|
-
}
|
|
1846
|
+
if (isNew) {
|
|
1847
|
+
this.onNodeCreateEmitter.fire({
|
|
1848
|
+
node,
|
|
1849
|
+
data,
|
|
1850
|
+
json: data
|
|
1851
|
+
});
|
|
1852
|
+
} else {
|
|
1853
|
+
this.onNodeUpdateEmitter.fire({ node, data, json: data });
|
|
1856
1854
|
}
|
|
1857
1855
|
return node;
|
|
1858
1856
|
}
|