(node: DocNode, prop: string)
| 2 | import { isJSExpression } from '@alilc/lowcode-utils'; |
| 3 | |
| 4 | function getText(node: DocNode, prop: string) { |
| 5 | const p = node.getProp(prop, false); |
| 6 | if (!p || p.isUnset()) { |
| 7 | return null; |
| 8 | } |
| 9 | let v = p.getValue(); |
| 10 | if (isJSExpression(v)) { |
| 11 | v = v.mock; |
| 12 | } |
| 13 | if (v == null) { |
| 14 | return null; |
| 15 | } |
| 16 | if (p.type === 'literal') { |
| 17 | return v; |
| 18 | } |
| 19 | return Symbol.for('not-literal'); |
| 20 | } |
| 21 | |
| 22 | export function liveEditingRule(target: EditingTarget) { |
| 23 | // for vision components specific |
no test coverage detected
searching dependent graphs…