@fulate/core 1.0.8 → 1.0.10
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/index.js +8 -7
- package/dist/node/node.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -718,13 +718,14 @@ var Node = class extends EventEmitter {
|
|
|
718
718
|
installBatchChildren(children) {
|
|
719
719
|
this.installChildren(children);
|
|
720
720
|
}
|
|
721
|
-
/** @internal
|
|
722
|
-
|
|
721
|
+
/** @internal 按当前 parent 同步最终 lifecycle context。 */
|
|
722
|
+
syncPlacementLifecycle() {
|
|
723
723
|
const parent = this.parent;
|
|
724
724
|
const shouldBeActive = parent?.isActive === true;
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
725
|
+
if (this.isActive) {
|
|
726
|
+
const targetLayer = this.isLayerNode() ? this : parent?.inject("layer") ?? null;
|
|
727
|
+
if (!shouldBeActive || this.activeLayer !== targetLayer) this.transitionLifecycle(LifecycleState.Inactive);
|
|
728
|
+
}
|
|
728
729
|
if (shouldBeActive && !this.isActive) this.transitionLifecycle(LifecycleState.Active);
|
|
729
730
|
}
|
|
730
731
|
/** @internal tree 已完整安装后登记当前 owner 的 dirty path。 */
|
|
@@ -898,7 +899,7 @@ var Node = class extends EventEmitter {
|
|
|
898
899
|
this.onActivate(root, layer);
|
|
899
900
|
for (const child of this.children) {
|
|
900
901
|
if (child.parent !== this) continue;
|
|
901
|
-
child.
|
|
902
|
+
child.syncPlacementLifecycle();
|
|
902
903
|
}
|
|
903
904
|
} finally {
|
|
904
905
|
this.lifecycleCommand = null;
|
|
@@ -5740,7 +5741,7 @@ function installStructureLinks(batch) {
|
|
|
5740
5741
|
}
|
|
5741
5742
|
/** @internal 所有 fields/raw links 安装及 History 记录后同步局部 lifecycle。 */
|
|
5742
5743
|
function syncStructureLifecycles(nodes) {
|
|
5743
|
-
for (const node of nodes) node.
|
|
5744
|
+
for (const node of nodes) node.syncPlacementLifecycle();
|
|
5744
5745
|
}
|
|
5745
5746
|
//#endregion
|
|
5746
5747
|
//#region packages/core/src/mutation/change-batch.ts
|
package/dist/node/node.d.ts
CHANGED
|
@@ -87,8 +87,8 @@ export declare class Node<P extends NodeProperties = NodeProperties, Child exten
|
|
|
87
87
|
detachBatchParent(): void;
|
|
88
88
|
/** @internal 接收 trusted batch 转移所有权的最终 children 快照。 */
|
|
89
89
|
installBatchChildren(children: readonly Node[]): void;
|
|
90
|
-
/** @internal
|
|
91
|
-
|
|
90
|
+
/** @internal 按当前 parent 同步最终 lifecycle context。 */
|
|
91
|
+
syncPlacementLifecycle(): void;
|
|
92
92
|
/** @internal tree 已完整安装后登记当前 owner 的 dirty path。 */
|
|
93
93
|
publishBatchStructureDirty(): void;
|
|
94
94
|
/** @internal raw links 与 placement lifecycle 同步完成后运行结构 hook。 */
|