@descope/web-components-ui 3.9.0 → 3.9.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.
@@ -10456,6 +10456,15 @@ class RawTooltip extends createBaseClass$1({
10456
10456
 
10457
10457
  this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');
10458
10458
  this.tooltip = this.shadowRoot.querySelector('vaadin-tooltip');
10459
+
10460
+ this.anchored = this.shadowRoot.querySelector('descope-anchored');
10461
+ }
10462
+
10463
+ // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.
10464
+ // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.
10465
+ #syncComponentState() {
10466
+ const hasHidden = this.anchored?.classList?.contains('hidden');
10467
+ this.classList.toggle('hidden', hasHidden);
10459
10468
  }
10460
10469
 
10461
10470
  static get observedAttributes() {
@@ -10550,6 +10559,8 @@ class RawTooltip extends createBaseClass$1({
10550
10559
  );
10551
10560
  this.#setTooltipTarget();
10552
10561
 
10562
+ this.#syncComponentState();
10563
+
10553
10564
  setTimeout(() => this.#onOverlayReady());
10554
10565
  }
10555
10566
 
@@ -11858,6 +11869,8 @@ class RawAttachment extends createBaseClass$1({
11858
11869
  this.attachmentSlot = this.shadowRoot.querySelector(
11859
11870
  'slot[name="attachment"]',
11860
11871
  );
11872
+
11873
+ this.anchored = this.shadowRoot.querySelector('descope-anchored');
11861
11874
  }
11862
11875
 
11863
11876
  get #attachment() {
@@ -11878,6 +11891,8 @@ class RawAttachment extends createBaseClass$1({
11878
11891
  init() {
11879
11892
  super.init?.();
11880
11893
 
11894
+ this.#syncComponentState();
11895
+
11881
11896
  injectStyle(
11882
11897
  `
11883
11898
  :host {
@@ -11921,6 +11936,13 @@ class RawAttachment extends createBaseClass$1({
11921
11936
  window.requestAnimationFrame(() => this.#setVisibility());
11922
11937
  }
11923
11938
 
11939
+ // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.
11940
+ // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.
11941
+ #syncComponentState() {
11942
+ const hasHidden = this.anchored?.classList?.contains('hidden');
11943
+ this.classList.toggle('hidden', hasHidden);
11944
+ }
11945
+
11924
11946
  #syncAvailableSizeAttr() {
11925
11947
  const anchor = this.defaultSlot?.assignedElements()?.[0];
11926
11948
 
@@ -26884,6 +26906,8 @@ class RawAnchored extends createBaseClass$1({
26884
26906
  `;
26885
26907
 
26886
26908
  this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');
26909
+
26910
+ this.#syncComponentState();
26887
26911
  }
26888
26912
 
26889
26913
  init() {
@@ -26938,6 +26962,13 @@ class RawAnchored extends createBaseClass$1({
26938
26962
  this.#syncAnchor();
26939
26963
  }
26940
26964
 
26965
+ // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.
26966
+ // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.
26967
+ #syncComponentState() {
26968
+ const hasHidden = this.#anchor.classList.contains('hidden');
26969
+ this.classList.toggle('hidden', hasHidden);
26970
+ }
26971
+
26941
26972
  #syncAnchor() {
26942
26973
  this.#onAnchorChanged();
26943
26974