UNPKG

@chief-editor/flow

Version:

Old核心数据流

1 lines 1.03 kB
import{NodeType}from"@chief-editor/base";import{NestWatcher}from"@co-hooks/nest-watcher";export function getRelativeKeys(e){return e.getPathKeys((function(e){var t=e.getValue();return t.type===NodeType.BRICK||t.type===NodeType.VIRTUAL?t.field?t.field:null:t.type===NodeType.REPEAT?e.parentNode?String(e.parentNode.getIndex(e)):t.field:null}))}export function getRelativeKey(e){return NestWatcher.combineKeys(getRelativeKeys(e.getNode()))}export function getAbsoluteKeys(e){return e.getPathKeys((function(e){var t=e.getValue();return(t.type===NodeType.BRICK||t.type===NodeType.VIRTUAL||t.type===NodeType.REPEAT)&&t.field?t.field:null}))}export function getAbsoluteKey(e){return NestWatcher.combineKeys(getAbsoluteKeys(e.getNode()))}export function getWatchableKeys(e){var t=[];return e.getPathKeys((function(e){var o=e.getValue();return o.type===NodeType.VIRTUAL&&o.field?(t=[],null):(o.type===NodeType.BRICK&&o.field&&t.unshift(o.field),null)})),t}export function getWatchableKey(e){return NestWatcher.combineKeys(getWatchableKeys(e))}