@vectoriox/iox-builder 1.4.58 → 1.4.59

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.
@@ -318,6 +318,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
318
318
  class SymbolRegistryService {
319
319
  constructor() {
320
320
  this.symbols = new Map();
321
+ /** symbolIds that have a live reusable block in the DB — used to guard isDetachedSymbol. */
322
+ this.blockSymbolIds = new Set();
321
323
  }
322
324
  setSymbols(symbols) {
323
325
  this.symbols.clear();
@@ -337,6 +339,18 @@ class SymbolRegistryService {
337
339
  remove(id) {
338
340
  this.symbols.delete(id);
339
341
  }
342
+ /** Set the symbolIds that have a live reusable block. Called on page load. */
343
+ setBlockSymbolIds(ids) {
344
+ this.blockSymbolIds = new Set(ids);
345
+ }
346
+ /** Returns true only when the symbol has a live backing reusable block. */
347
+ isBlockSymbol(id) {
348
+ return this.blockSymbolIds.has(id);
349
+ }
350
+ /** Remove a symbolId from the block-backed set (called when a block is deleted). */
351
+ removeBlockSymbolId(id) {
352
+ this.blockSymbolIds.delete(id);
353
+ }
340
354
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: SymbolRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
341
355
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: SymbolRegistryService }); }
342
356
  }
@@ -2953,7 +2967,11 @@ class OverlayComponent {
2953
2967
  return !!this.selectEntry?.node?.symbolId;
2954
2968
  }
2955
2969
  get isDetachedSymbol() {
2956
- return !this.selectEntry?.node?.symbolId && !!this.selectEntry?.node?.detachedSymbolId;
2970
+ const node = this.selectEntry?.node;
2971
+ if (!node || node.symbolId || !node.detachedSymbolId)
2972
+ return false;
2973
+ // Only show the re-link button when the backing block still exists.
2974
+ return this.symbolRegistry.isBlockSymbol(node.detachedSymbolId);
2957
2975
  }
2958
2976
  get linkedSymbolName() {
2959
2977
  const id = this.selectEntry?.node?.symbolId;