@blocksuite/block-std
Advanced tools
Comparing version 0.0.0-20230807164933-9f6fb698-nightly to 0.0.0-20230808052934-e80a740d-nightly
@@ -112,10 +112,10 @@ import { assertExists } from '@blocksuite/global/utils'; | ||
assertExists(tree, `Invalid path to get node in view: ${path}`); | ||
const iterate = (node, index) => { | ||
const result = fn(node, index, tree); | ||
const iterate = (parent) => (node, index) => { | ||
const result = fn(node, index, parent); | ||
if (result === true) { | ||
return; | ||
} | ||
node.children.forEach(iterate); | ||
node.children.forEach(iterate(node)); | ||
}; | ||
tree.children.forEach(iterate); | ||
tree.children.forEach(iterate(tree)); | ||
}; | ||
@@ -122,0 +122,0 @@ this.getParent = (path) => { |
{ | ||
"name": "@blocksuite/block-std", | ||
"version": "0.0.0-20230807164933-9f6fb698-nightly", | ||
"version": "0.0.0-20230808052934-e80a740d-nightly", | ||
"description": "Std for blocksuite blocks", | ||
@@ -12,10 +12,10 @@ "main": "dist/index.js", | ||
"peerDependencies": { | ||
"@blocksuite/store": "0.0.0-20230807164933-9f6fb698-nightly" | ||
"@blocksuite/store": "0.0.0-20230808052934-e80a740d-nightly" | ||
}, | ||
"dependencies": { | ||
"w3c-keyname": "^2.2.8", | ||
"@blocksuite/global": "0.0.0-20230807164933-9f6fb698-nightly" | ||
"@blocksuite/global": "0.0.0-20230808052934-e80a740d-nightly" | ||
}, | ||
"devDependencies": { | ||
"@blocksuite/store": "0.0.0-20230807164933-9f6fb698-nightly" | ||
"@blocksuite/store": "0.0.0-20230808052934-e80a740d-nightly" | ||
}, | ||
@@ -22,0 +22,0 @@ "exports": { |
@@ -174,11 +174,13 @@ import { assertExists } from '@blocksuite/global/utils'; | ||
const iterate = (node: NodeViewTree<NodeViewType>, index: number) => { | ||
const result = fn(node, index, tree); | ||
if (result === true) { | ||
return; | ||
} | ||
node.children.forEach(iterate); | ||
}; | ||
const iterate = | ||
(parent: NodeViewTree<NodeViewType>) => | ||
(node: NodeViewTree<NodeViewType>, index: number) => { | ||
const result = fn(node, index, parent); | ||
if (result === true) { | ||
return; | ||
} | ||
node.children.forEach(iterate(node)); | ||
}; | ||
tree.children.forEach(iterate); | ||
tree.children.forEach(iterate(tree)); | ||
}; | ||
@@ -185,0 +187,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
424118
3425
+ Added@blocksuite/global@0.0.0-20230808052934-e80a740d-nightly(transitive)
+ Added@blocksuite/store@0.0.0-20230808052934-e80a740d-nightly(transitive)
+ Added@blocksuite/virgo@0.0.0-20230808052934-e80a740d-nightly(transitive)
- Removed@blocksuite/global@0.0.0-20230807164933-9f6fb698-nightly(transitive)
- Removed@blocksuite/store@0.0.0-20230807164933-9f6fb698-nightly(transitive)
- Removed@blocksuite/virgo@0.0.0-20230807164933-9f6fb698-nightly(transitive)
Updated@blocksuite/global@0.0.0-20230808052934-e80a740d-nightly