|
|
@ -109,6 +109,7 @@ import { |
|
|
isSymbolMain, |
|
|
isSymbolMain, |
|
|
isSymbolInstance, |
|
|
isSymbolInstance, |
|
|
detachSymbolInstance, |
|
|
detachSymbolInstance, |
|
|
|
|
|
isSymbolRoot, |
|
|
} from './model/SymbolUtils'; |
|
|
} from './model/SymbolUtils'; |
|
|
import { SymbolInfo } from './types'; |
|
|
import { SymbolInfo } from './types'; |
|
|
import Symbols from './model/Symbols'; |
|
|
import Symbols from './model/Symbols'; |
|
|
@ -710,6 +711,10 @@ export default class ComponentManager extends ItemManagerModule<DomComponentsCon |
|
|
* // cmp.getSymbolInfo(symbol).isSymbol === true;
|
|
|
* // cmp.getSymbolInfo(symbol).isSymbol === true;
|
|
|
*/ |
|
|
*/ |
|
|
addSymbol(component: Component) { |
|
|
addSymbol(component: Component) { |
|
|
|
|
|
if (isSymbol(component) && !isSymbolRoot(component)) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const symbol = component.clone({ symbol: true }); |
|
|
const symbol = component.clone({ symbol: true }); |
|
|
isSymbolMain(symbol) && this.symbols.add(symbol); |
|
|
isSymbolMain(symbol) && this.symbols.add(symbol); |
|
|
|
|
|
|
|
|
@ -760,11 +765,14 @@ export default class ComponentManager extends ItemManagerModule<DomComponentsCon |
|
|
const instances = (isMain ? getSymbolInstances(component) : getSymbolInstances(mainRef)) || []; |
|
|
const instances = (isMain ? getSymbolInstances(component) : getSymbolInstances(mainRef)) || []; |
|
|
const main = mainRef || (isMain ? component : undefined); |
|
|
const main = mainRef || (isMain ? component : undefined); |
|
|
const relatives = getSymbolsToUpdate(component, { changed: opts.withChanges }); |
|
|
const relatives = getSymbolsToUpdate(component, { changed: opts.withChanges }); |
|
|
|
|
|
const isSymbol = isMain || isInstance; |
|
|
|
|
|
const isRoot = isSymbol && isSymbolRoot(component); |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
isSymbol: isMain || isInstance, |
|
|
isSymbol, |
|
|
isMain, |
|
|
isMain, |
|
|
isInstance, |
|
|
isInstance, |
|
|
|
|
|
isRoot, |
|
|
main, |
|
|
main, |
|
|
instances: instances, |
|
|
instances: instances, |
|
|
relatives: relatives || [], |
|
|
relatives: relatives || [], |
|
|
|