@vectoriox/iox-builder 9.11.2 → 9.11.3

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.
@@ -4421,6 +4421,8 @@ function sameSet(a, b) {
4421
4421
  function designIdOf(node) {
4422
4422
  return node.__previewClone ? (node.styleId ?? node.id) : node.id;
4423
4423
  }
4424
+ /** How long after a press inside a Tabs the selection it causes is the click's, not a tree / crumb selection. */
4425
+ const PRESS_SELECTION_MS = 600;
4424
4426
  /**
4425
4427
  * The composites' runtimes ON THE CANVAS (CC2, CC4a) — the canvas is a live runtime, so an Accordion (and a Disclosure,
4426
4428
  * CC2.1) opens and closes, and Tabs switch, on the canvas exactly as on the site: the SAME composite-core runtimes the
@@ -4465,7 +4467,11 @@ class CompositeCanvasService {
4465
4467
  onChange: key => { if (!node.__previewClone && node.id)
4466
4468
  this.designState?.setShownItem(node.id, key); },
4467
4469
  }));
4468
- this.exclusive.set(node.id, { node, runtime, selected: new Set() });
4470
+ const entry = { node, runtime, selected: new Set(), pressedAt: 0, release: () => undefined };
4471
+ const press = () => { entry.pressedAt = Date.now(); };
4472
+ element.addEventListener('pointerdown', press, true);
4473
+ entry.release = () => element.removeEventListener('pointerdown', press, true);
4474
+ this.exclusive.set(node.id, entry);
4469
4475
  const shown = this.designState?.shownItem(designIdOf(node));
4470
4476
  if (shown)
4471
4477
  runtime.activate(shown);
@@ -4486,7 +4492,9 @@ class CompositeCanvasService {
4486
4492
  return;
4487
4493
  this.attached.get(nodeId)?.runtime.destroy();
4488
4494
  this.attached.delete(nodeId);
4489
- this.exclusive.get(nodeId)?.runtime.destroy();
4495
+ const tabs = this.exclusive.get(nodeId);
4496
+ tabs?.runtime.destroy();
4497
+ tabs?.release();
4490
4498
  this.exclusive.delete(nodeId);
4491
4499
  }
4492
4500
  /** The root's behaviour changed in its panel (Allow several open, Open by default; Activate on, Orientation). */
@@ -4523,7 +4531,7 @@ class CompositeCanvasService {
4523
4531
  if (!state)
4524
4532
  return;
4525
4533
  const selected = state.snapshot.selectedTriggers;
4526
- const fresh = [...selected].filter(id => !entry.selected.has(id));
4534
+ const fresh = Date.now() - entry.pressedAt < PRESS_SELECTION_MS ? [] : [...selected].filter(id => !entry.selected.has(id));
4527
4535
  entry.selected = new Set(selected);
4528
4536
  for (const id of fresh) {
4529
4537
  const key = entry.runtime.keyAt(entry.runtime.root.querySelector(`.iox-node-${CSS.escape(id)}`));