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