@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.
@@ -1271,20 +1271,24 @@ var SheetController = class {
1271
1271
  this.clearInert();
1272
1272
  for (const child of Array.from(body.children)) {
1273
1273
  if (!(child instanceof HTMLElement)) continue;
1274
+ this.inertedElements.set(child, { inert: child.inert, ariaHidden: child.getAttribute("aria-hidden") });
1274
1275
  const isAllowed = Array.from(allowed).some((element) => child === element || child.contains(element));
1275
- if (isAllowed) continue;
1276
- this.inertedElements.set(child, child.getAttribute("aria-hidden"));
1276
+ if (isAllowed) {
1277
+ child.inert = false;
1278
+ child.removeAttribute("aria-hidden");
1279
+ continue;
1280
+ }
1277
1281
  child.inert = true;
1278
1282
  child.setAttribute("aria-hidden", "true");
1279
1283
  }
1280
1284
  }
1281
1285
  clearInert() {
1282
- for (const [element, ariaHidden] of this.inertedElements) {
1283
- element.inert = false;
1284
- if (ariaHidden === null) {
1286
+ for (const [element, state] of this.inertedElements) {
1287
+ element.inert = state.inert;
1288
+ if (state.ariaHidden === null) {
1285
1289
  element.removeAttribute("aria-hidden");
1286
1290
  } else {
1287
- element.setAttribute("aria-hidden", ariaHidden);
1291
+ element.setAttribute("aria-hidden", state.ariaHidden);
1288
1292
  }
1289
1293
  }
1290
1294
  this.inertedElements.clear();
@@ -1449,9 +1453,9 @@ var CapSheet = class extends HTMLElement {
1449
1453
  disconnectedCallback() {
1450
1454
  this.controller.disconnect();
1451
1455
  }
1452
- attributeChangedCallback() {
1456
+ attributeChangedCallback(name) {
1453
1457
  if (this.syncingAttribute) return;
1454
- this.controller.configure({});
1458
+ this.controller.configure(readChangedOptionsFromElement(this, name));
1455
1459
  if (this.isConnected) {
1456
1460
  if (this.hasAttribute("presented") && !this.controller.presented) {
1457
1461
  void this.present({ source: "programmatic" });
@@ -1529,6 +1533,38 @@ function isCapSheetElement(element) {
1529
1533
  const candidate = element;
1530
1534
  return typeof candidate.present === "function" && typeof candidate.dismiss === "function";
1531
1535
  }
1536
+ function readChangedOptionsFromElement(element, name) {
1537
+ const options = readOptionsFromElement(element);
1538
+ const keysByAttribute = {
1539
+ "active-detent": ["activeDetent"],
1540
+ "close-on-escape": ["closeOnEscape"],
1541
+ "close-on-outside-click": ["closeOnOutsideClick"],
1542
+ "content-placement": ["contentPlacement", "tracks"],
1543
+ "default-active-detent": ["defaultActiveDetent"],
1544
+ "default-presented": ["defaultPresented"],
1545
+ detents: ["detents"],
1546
+ "focus-trap": ["focusTrap"],
1547
+ "inert-outside": ["inertOutside"],
1548
+ "native-edge-swipe-prevention": ["nativeEdgeSwipePrevention"],
1549
+ "native-focus-scroll-prevention": ["nativeFocusScrollPrevention"],
1550
+ presented: ["presented"],
1551
+ "restore-focus": ["restoreFocus"],
1552
+ "safe-area": ["safeArea"],
1553
+ "sheet-role": ["sheetRole"],
1554
+ stack: ["stack"],
1555
+ swipe: ["swipe"],
1556
+ "swipe-dismissal": ["swipeDismissal"],
1557
+ "swipe-overshoot": ["swipeOvershoot"],
1558
+ "swipe-trap": ["swipeTrap"],
1559
+ "theme-color-dimming": ["themeColorDimming"],
1560
+ tracks: ["tracks"]
1561
+ };
1562
+ const changed = {};
1563
+ for (const key of keysByAttribute[name] || []) {
1564
+ changed[key] = options[key];
1565
+ }
1566
+ return changed;
1567
+ }
1532
1568
  function applySheetOptions(element, options) {
1533
1569
  if (options.contentPlacement) element.setAttribute("content-placement", options.contentPlacement);
1534
1570
  if (options.detents !== void 0) {