@descope-ui/descope-attachment 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope-ui/descope-attachment",
3
- "version": "3.9.0",
3
+ "version": "3.9.2",
4
4
  "files": [
5
5
  "src",
6
6
  "stories"
@@ -18,14 +18,14 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@playwright/test": "1.58.2",
21
- "e2e-utils": "3.9.0",
22
- "test-assets": "3.9.0",
23
- "test-drivers": "3.9.0"
21
+ "e2e-utils": "3.9.2",
22
+ "test-assets": "3.9.2",
23
+ "test-drivers": "3.9.2"
24
24
  },
25
25
  "dependencies": {
26
- "@descope-ui/common": "3.9.0",
27
- "@descope-ui/theme-globals": "3.9.0",
28
- "@descope-ui/descope-anchored": "3.9.0"
26
+ "@descope-ui/common": "3.9.2",
27
+ "@descope-ui/theme-globals": "3.9.2",
28
+ "@descope-ui/descope-anchored": "3.9.2"
29
29
  },
30
30
  "publishConfig": {
31
31
  "link-workspace-packages": false
@@ -44,6 +44,8 @@ class RawAttachment extends createBaseClass({
44
44
  this.attachmentSlot = this.shadowRoot.querySelector(
45
45
  'slot[name="attachment"]',
46
46
  );
47
+
48
+ this.anchored = this.shadowRoot.querySelector('descope-anchored');
47
49
  }
48
50
 
49
51
  get #attachment() {
@@ -64,6 +66,8 @@ class RawAttachment extends createBaseClass({
64
66
  init() {
65
67
  super.init?.();
66
68
 
69
+ this.#syncComponentState();
70
+
67
71
  injectStyle(
68
72
  `
69
73
  :host {
@@ -107,6 +111,13 @@ class RawAttachment extends createBaseClass({
107
111
  window.requestAnimationFrame(() => this.#setVisibility());
108
112
  }
109
113
 
114
+ // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.
115
+ // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.
116
+ #syncComponentState() {
117
+ const hasHidden = this.anchored?.classList?.contains('hidden');
118
+ this.classList.toggle('hidden', hasHidden);
119
+ }
120
+
110
121
  #syncAvailableSizeAttr() {
111
122
  const anchor = this.defaultSlot?.assignedElements()?.[0];
112
123