@capgo/capacitor-sheets 8.0.2 → 8.0.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.
@@ -1297,20 +1297,24 @@ var SheetController = class {
1297
1297
  this.clearInert();
1298
1298
  for (const child of Array.from(body.children)) {
1299
1299
  if (!(child instanceof HTMLElement)) continue;
1300
+ this.inertedElements.set(child, { inert: child.inert, ariaHidden: child.getAttribute("aria-hidden") });
1300
1301
  const isAllowed = Array.from(allowed).some((element) => child === element || child.contains(element));
1301
- if (isAllowed) continue;
1302
- this.inertedElements.set(child, child.getAttribute("aria-hidden"));
1302
+ if (isAllowed) {
1303
+ child.inert = false;
1304
+ child.removeAttribute("aria-hidden");
1305
+ continue;
1306
+ }
1303
1307
  child.inert = true;
1304
1308
  child.setAttribute("aria-hidden", "true");
1305
1309
  }
1306
1310
  }
1307
1311
  clearInert() {
1308
- for (const [element, ariaHidden] of this.inertedElements) {
1309
- element.inert = false;
1310
- if (ariaHidden === null) {
1312
+ for (const [element, state] of this.inertedElements) {
1313
+ element.inert = state.inert;
1314
+ if (state.ariaHidden === null) {
1311
1315
  element.removeAttribute("aria-hidden");
1312
1316
  } else {
1313
- element.setAttribute("aria-hidden", ariaHidden);
1317
+ element.setAttribute("aria-hidden", state.ariaHidden);
1314
1318
  }
1315
1319
  }
1316
1320
  this.inertedElements.clear();
@@ -1475,9 +1479,9 @@ var CapSheet = class extends HTMLElement {
1475
1479
  disconnectedCallback() {
1476
1480
  this.controller.disconnect();
1477
1481
  }
1478
- attributeChangedCallback() {
1482
+ attributeChangedCallback(name) {
1479
1483
  if (this.syncingAttribute) return;
1480
- this.controller.configure({});
1484
+ this.controller.configure(readChangedOptionsFromElement(this, name));
1481
1485
  if (this.isConnected) {
1482
1486
  if (this.hasAttribute("presented") && !this.controller.presented) {
1483
1487
  void this.present({ source: "programmatic" });
@@ -1555,6 +1559,38 @@ function isCapSheetElement(element) {
1555
1559
  const candidate = element;
1556
1560
  return typeof candidate.present === "function" && typeof candidate.dismiss === "function";
1557
1561
  }
1562
+ function readChangedOptionsFromElement(element, name) {
1563
+ const options = readOptionsFromElement(element);
1564
+ const keysByAttribute = {
1565
+ "active-detent": ["activeDetent"],
1566
+ "close-on-escape": ["closeOnEscape"],
1567
+ "close-on-outside-click": ["closeOnOutsideClick"],
1568
+ "content-placement": ["contentPlacement", "tracks"],
1569
+ "default-active-detent": ["defaultActiveDetent"],
1570
+ "default-presented": ["defaultPresented"],
1571
+ detents: ["detents"],
1572
+ "focus-trap": ["focusTrap"],
1573
+ "inert-outside": ["inertOutside"],
1574
+ "native-edge-swipe-prevention": ["nativeEdgeSwipePrevention"],
1575
+ "native-focus-scroll-prevention": ["nativeFocusScrollPrevention"],
1576
+ presented: ["presented"],
1577
+ "restore-focus": ["restoreFocus"],
1578
+ "safe-area": ["safeArea"],
1579
+ "sheet-role": ["sheetRole"],
1580
+ stack: ["stack"],
1581
+ swipe: ["swipe"],
1582
+ "swipe-dismissal": ["swipeDismissal"],
1583
+ "swipe-overshoot": ["swipeOvershoot"],
1584
+ "swipe-trap": ["swipeTrap"],
1585
+ "theme-color-dimming": ["themeColorDimming"],
1586
+ tracks: ["tracks"]
1587
+ };
1588
+ const changed = {};
1589
+ for (const key of keysByAttribute[name] || []) {
1590
+ changed[key] = options[key];
1591
+ }
1592
+ return changed;
1593
+ }
1558
1594
  function applySheetOptions(element, options) {
1559
1595
  if (options.contentPlacement) element.setAttribute("content-placement", options.contentPlacement);
1560
1596
  if (options.detents !== void 0) {