@descope/flow-components 3.14.9 → 3.15.0

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.
@@ -5,7 +5,7 @@
5
5
  "name": "flowComponents",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "3.14.9",
8
+ "buildVersion": "3.15.0",
9
9
  "buildName": "@descope/flow-components"
10
10
  },
11
11
  "remoteEntry": {
@@ -5,7 +5,7 @@
5
5
  "name": "flowComponents",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "3.14.9",
8
+ "buildVersion": "3.15.0",
9
9
  "buildName": "@descope/flow-components"
10
10
  },
11
11
  "remoteEntry": {
package/dist/index.cjs.js CHANGED
@@ -102572,6 +102572,10 @@ descope-enriched-text {
102572
102572
  return this.getAttribute('opened') === 'true';
102573
102573
  }
102574
102574
 
102575
+ get closeOnOutsideClick() {
102576
+ return this.getAttribute('close-on-outside-click') === 'true';
102577
+ }
102578
+
102575
102579
  handleOpened() {
102576
102580
  if (this.opened) {
102577
102581
  this.style.display = '';
@@ -102637,6 +102641,28 @@ descope-enriched-text {
102637
102641
  overlay._enterModalState = () => {};
102638
102642
 
102639
102643
  overlay.close = () => false;
102644
+
102645
+ // close the modal when the user clicks/taps the backdrop (outside the modal
102646
+ // box). Vaadin's own outside-click does not fire here because we keep the
102647
+ // overlay in the shadow DOM (see _attachOverlay above), which leaves it out
102648
+ // of Vaadin's overlay stack, so we detect the backdrop click ourselves.
102649
+ // the listener is always attached and reads `closeOnOutsideClick` at click
102650
+ // time, so toggling the attribute after init is respected.
102651
+ overlay.addEventListener('click', (event) => {
102652
+ if (!this.closeOnOutsideClick || !this.opened) return;
102653
+
102654
+ // the visible modal box; clicks inside it (content + its padding) keep
102655
+ // the modal open, only clicks on the dimmed backdrop close it. if we
102656
+ // can't find the box, don't close - safer than closing on an inside click
102657
+ const overlayPart = overlay.shadowRoot?.querySelector('[part="overlay"]');
102658
+ if (!overlayPart || event.composedPath().includes(overlayPart)) {
102659
+ return;
102660
+ }
102661
+
102662
+ // just close ourselves; consumers that need to react (e.g. ModalDriver
102663
+ // resetting the content) observe the `opened` attribute
102664
+ this.removeAttribute('opened');
102665
+ });
102640
102666
  }
102641
102667
  };
102642
102668
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/flow-components",
3
- "version": "3.14.9",
3
+ "version": "3.15.0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -97,7 +97,7 @@
97
97
  "webpack-subresource-integrity": "5.2.0-rc.1"
98
98
  },
99
99
  "dependencies": {
100
- "@descope/web-components-ui": "3.14.9"
100
+ "@descope/web-components-ui": "3.15.0"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "react": ">= 18"