@descope/web-components-ui 3.13.1 → 3.13.2

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.
@@ -10550,6 +10550,11 @@ class RawTooltip extends createBaseClass$1({
10550
10550
  componentName: componentName$_,
10551
10551
  baseSelector: 'vaadin-tooltip',
10552
10552
  }) {
10553
+ // Observes the inner descope-anchored's `class` attribute so runtime updates
10554
+ // (e.g. real-time conditional components toggling `.hidden`) keep this
10555
+ // tooltip's class in sync. Set up in connectedCallback so reconnects work.
10556
+ #anchoredClassObserver = null;
10557
+
10553
10558
  constructor() {
10554
10559
  super();
10555
10560
 
@@ -10665,9 +10670,31 @@ class RawTooltip extends createBaseClass$1({
10665
10670
  );
10666
10671
  this.#setTooltipTarget();
10667
10672
 
10673
+ setTimeout(() => this.#onOverlayReady());
10674
+ }
10675
+
10676
+ #observeAnchored() {
10677
+ this.#anchoredClassObserver?.disconnect();
10678
+ if (this.anchored) {
10679
+ this.#anchoredClassObserver = observeAttributes(
10680
+ this.anchored,
10681
+ () => this.#syncComponentState(),
10682
+ { includeAttrs: ['class'] },
10683
+ );
10684
+ }
10685
+ }
10686
+
10687
+ // createBaseClass gates init() to first-connect, so observing here is
10688
+ // required for the detach/reattach cycle to keep working.
10689
+ connectedCallback() {
10690
+ super.connectedCallback?.();
10668
10691
  this.#syncComponentState();
10692
+ this.#observeAnchored();
10693
+ }
10669
10694
 
10670
- setTimeout(() => this.#onOverlayReady());
10695
+ disconnectedCallback() {
10696
+ super.disconnectedCallback?.();
10697
+ this.#anchoredClassObserver?.disconnect();
10671
10698
  }
10672
10699
 
10673
10700
  #setTooltipTarget() {
@@ -11959,6 +11986,12 @@ class RawAttachment extends createBaseClass$1({
11959
11986
  componentName: componentName$X,
11960
11987
  baseSelector: 'descope-anchored',
11961
11988
  }) {
11989
+ // Observes the inner descope-anchored's `class` attribute so runtime
11990
+ // updates (e.g. real-time conditional components toggling `.hidden`) keep
11991
+ // this attachment host's class in sync. Set up in connectedCallback so
11992
+ // reconnects work (createBaseClass gates init() to first connect only).
11993
+ #anchoredClassObserver = null;
11994
+
11962
11995
  constructor() {
11963
11996
  super();
11964
11997
 
@@ -11997,8 +12030,6 @@ class RawAttachment extends createBaseClass$1({
11997
12030
  init() {
11998
12031
  super.init?.();
11999
12032
 
12000
- this.#syncComponentState();
12001
-
12002
12033
  injectStyle(
12003
12034
  `
12004
12035
  :host {
@@ -12049,6 +12080,30 @@ class RawAttachment extends createBaseClass$1({
12049
12080
  this.classList.toggle('hidden', hasHidden);
12050
12081
  }
12051
12082
 
12083
+ #observeAnchored() {
12084
+ this.#anchoredClassObserver?.disconnect();
12085
+ if (this.anchored) {
12086
+ this.#anchoredClassObserver = observeAttributes(
12087
+ this.anchored,
12088
+ () => this.#syncComponentState(),
12089
+ { includeAttrs: ['class'] },
12090
+ );
12091
+ }
12092
+ }
12093
+
12094
+ // createBaseClass gates init() to first-connect, so observing here is
12095
+ // required for the detach/reattach cycle to keep working.
12096
+ connectedCallback() {
12097
+ super.connectedCallback?.();
12098
+ this.#syncComponentState();
12099
+ this.#observeAnchored();
12100
+ }
12101
+
12102
+ disconnectedCallback() {
12103
+ super.disconnectedCallback?.();
12104
+ this.#anchoredClassObserver?.disconnect();
12105
+ }
12106
+
12052
12107
  #syncAvailableSizeAttr() {
12053
12108
  const anchor = this.defaultSlot?.assignedElements()?.[0];
12054
12109
 
@@ -29396,6 +29451,11 @@ class RawAnchored extends createBaseClass$1({
29396
29451
 
29397
29452
  #hostStretchSheet = null;
29398
29453
 
29454
+ // Observes the anchor's `class` attribute so runtime updates by the SDK
29455
+ // (e.g. real-time conditional components toggling `.hidden`) propagate to
29456
+ // this element. Without this, only the initial slotchange would sync.
29457
+ #anchorClassObserver = null;
29458
+
29399
29459
  get #anchor() {
29400
29460
  return this.defaultSlot.assignedElements({ flatten: true })[0];
29401
29461
  }
@@ -29498,6 +29558,28 @@ class RawAnchored extends createBaseClass$1({
29498
29558
  this.#anchored,
29499
29559
  'st-host-direction',
29500
29560
  );
29561
+
29562
+ this.#observeAnchorClass();
29563
+ }
29564
+
29565
+ #observeAnchorClass() {
29566
+ this.#anchorClassObserver?.disconnect();
29567
+ if (this.#anchor) {
29568
+ this.#anchorClassObserver = observeAttributes(
29569
+ this.#anchor,
29570
+ () => this.#syncComponentState(),
29571
+ { includeAttrs: ['class'] },
29572
+ );
29573
+ }
29574
+ }
29575
+
29576
+ // createBaseClass gates init() to first-connect (#isInit). Without
29577
+ // re-observing here, runtime `.hidden` toggles stop syncing after a
29578
+ // detach/reattach cycle.
29579
+ connectedCallback() {
29580
+ super.connectedCallback?.();
29581
+ this.#observeAnchorClass();
29582
+ this.#syncComponentState();
29501
29583
  }
29502
29584
 
29503
29585
  // Injects [stretch] layout rules into the containing component's shadow root (e.g. descope-attachment)
@@ -29539,6 +29621,7 @@ class RawAnchored extends createBaseClass$1({
29539
29621
  super.disconnectedCallback?.();
29540
29622
  this.#stretchObserver?.disconnect();
29541
29623
  this.#directionObserver?.disconnect();
29624
+ this.#anchorClassObserver?.disconnect();
29542
29625
  }
29543
29626
 
29544
29627
  // Track whether anything is slotted, so the host display rule can hide an