@erkamyaman/capacitor-foldable 8.3.2 → 8.3.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.
package/README.md CHANGED
@@ -572,9 +572,10 @@ Only fires on iOS 27.1 or later.
572
572
 
573
573
  #### BarPlacement
574
574
 
575
- | Prop | Type | Description | Since |
576
- | --------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
577
- | **`verticalBarEdge`** | <code>'leading' \| 'trailing' \| null</code> | The edge iPhone Duo moves tab bars and toolbars to when it lays them out vertically: `'leading'` or `'trailing'` in the reading direction, so `'leading'` is the left edge in left-to-right languages. `null` when bars stay horizontal, and always on Android, web and iOS before 27.1. An app built with an older Xcode still gets the edge: it is inferred from the safe-area inset the bar leaves, since the trait that names it is missing. | 7.0.0 |
575
+ | Prop | Type | Description | Since |
576
+ | --------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
577
+ | **`verticalBarEdge`** | <code>'leading' \| 'trailing' \| null</code> | The edge iPhone Duo moves tab bars and toolbars to when it lays them out vertically: `'leading'` or `'trailing'` in the reading direction, so `'leading'` is the left edge in left-to-right languages. `null` when bars stay horizontal, and always on Android, web and iOS before 27.1. An app built with an older Xcode still gets the edge: it is inferred from the safe-area inset the bar leaves, since the trait that names it is missing. | 7.0.0 |
578
+ | **`inset`** | <code>number</code> | How much room the vertical bar takes on its edge, in points, rounded to whole points. It is the same value the web view reports as a safe-area inset, so `env(safe-area-inset-*)` already covers simple layouts. Read it when you place your own chrome and need the number itself, and do not assume it stays at 84: it differs when the bar is disabled, and Apple can change it. `0` when no vertical bar is reported, and always on Android and web. | 8.3.3 |
578
579
 
579
580
 
580
581
  #### PluginListenerHandle
@@ -169,7 +169,7 @@ class FoldablePlugin : Plugin() {
169
169
 
170
170
  @PluginMethod
171
171
  fun getBarPlacement(call: PluginCall) {
172
- call.resolve(JSObject().put("verticalBarEdge", JSONObject.NULL))
172
+ call.resolve(JSObject().put("verticalBarEdge", JSONObject.NULL).put("inset", 0))
173
173
  }
174
174
 
175
175
  @PluginMethod
package/dist/docs.json CHANGED
@@ -687,6 +687,18 @@
687
687
  "docs": "The edge iPhone Duo moves tab bars and toolbars to when it lays them out\nvertically: `'leading'` or `'trailing'` in the reading direction, so\n`'leading'` is the left edge in left-to-right languages. `null` when bars\nstay horizontal, and always on Android, web and iOS before 27.1. An app\nbuilt with an older Xcode still gets the edge: it is inferred from the\nsafe-area inset the bar leaves, since the trait that names it is missing.",
688
688
  "complexTypes": [],
689
689
  "type": "'leading' | 'trailing' | null"
690
+ },
691
+ {
692
+ "name": "inset",
693
+ "tags": [
694
+ {
695
+ "text": "8.3.3",
696
+ "name": "since"
697
+ }
698
+ ],
699
+ "docs": "How much room the vertical bar takes on its edge, in points, rounded to\nwhole points. It is the same value the web view reports as a safe-area\ninset, so `env(safe-area-inset-*)` already covers simple layouts. Read it\nwhen you place your own chrome and need the number itself, and do not\nassume it stays at 84: it differs when the bar is disabled, and Apple can\nchange it. `0` when no vertical bar is reported, and always on Android and\nweb.",
700
+ "complexTypes": [],
701
+ "type": "number"
690
702
  }
691
703
  ]
692
704
  },
@@ -190,6 +190,18 @@ export interface BarPlacement {
190
190
  * @since 7.0.0
191
191
  */
192
192
  verticalBarEdge: 'leading' | 'trailing' | null;
193
+ /**
194
+ * How much room the vertical bar takes on its edge, in points, rounded to
195
+ * whole points. It is the same value the web view reports as a safe-area
196
+ * inset, so `env(safe-area-inset-*)` already covers simple layouts. Read it
197
+ * when you place your own chrome and need the number itself, and do not
198
+ * assume it stays at 84: it differs when the bar is disabled, and Apple can
199
+ * change it. `0` when no vertical bar is reported, and always on Android and
200
+ * web.
201
+ *
202
+ * @since 8.3.3
203
+ */
204
+ inset: number;
193
205
  }
194
206
  export interface FoldablePolyfillOptions {
195
207
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface FoldState {\n /**\n * Posture of the fold. `'closed'` is never reported today: a device shut on\n * its cover display reports `'flat'`.\n *\n * @since 7.0.0\n */\n state: 'flat' | 'half-opened' | 'closed';\n\n /**\n * Whether the fold splits the web view into two areas: `true` when\n * half-opened, or when the hinge has a physical gap.\n *\n * @since 7.0.0\n */\n isSeparating: boolean;\n\n /**\n * How the device is held: `'tabletop'` when half-opened with a horizontal\n * hinge, like a laptop, `'book'` when half-opened with a vertical hinge, and\n * `'flat'` otherwise.\n *\n * @since 7.0.0\n */\n posture: 'flat' | 'tabletop' | 'book';\n\n /**\n * Direction of the hinge relative to the window, so it flips when the device\n * rotates. Omitted when there is no fold.\n *\n * @since 7.0.0\n */\n hingeOrientation?: 'horizontal' | 'vertical';\n\n /**\n * Position of the fold in CSS pixels, relative to the web view. Zero wide (or\n * zero tall) on a seamless fold. Omitted when there is no fold.\n *\n * @since 7.0.0\n */\n hingeBounds?: { x: number; y: number; width: number; height: number };\n\n /**\n * Area of the web view the hinge covers, in CSS pixels. Only present on\n * devices with a physical gap.\n *\n * @since 7.0.0\n */\n occludedBounds?: { x: number; y: number; width: number; height: number };\n\n /**\n * Which display is showing the app, on a device with an inner and an outer\n * display such as iPhone Duo. Reported on iPhone Duo (iOS 27.1 or later) and\n * omitted elsewhere.\n *\n * @since 7.0.0\n */\n activeDisplay?: 'inner' | 'outer';\n\n /**\n * Areas of the web view something covers, in CSS pixels. On Android these are\n * the display cutouts. On iPhone Duo these are the active occlusion regions:\n * the camera in use, and the strip the system keeps for the vertical status\n * bar. Use `getReservedRegions()` when you need to tell them apart. Omitted\n * when there are none.\n *\n * @since 7.0.0\n */\n cameraBounds?: { x: number; y: number; width: number; height: number }[];\n\n /**\n * Space the system asks you to keep clear around the fold, in CSS pixels.\n * `hingeBounds` covers the crease plus these margins, so the crease itself is\n * `hingeBounds` shrunk by them. iPhone Duo reports 20 on each side of a\n * vertical fold. Omitted on Android and where there is no fold.\n *\n * @since 8.2.0\n */\n hingeMargins?: { top: number; right: number; bottom: number; left: number };\n}\n\nexport interface ReservedRegion {\n /**\n * `'division'` is the fold itself. `'occlusion'` is something covering the\n * display, such as a camera or the vertical status bar area.\n *\n * @since 8.2.0\n */\n kind: 'division' | 'occlusion';\n\n /**\n * Whether the region applies right now. An inactive division is a flat fold,\n * and an inactive occlusion is a camera that is not in use.\n *\n * @since 8.2.0\n */\n isActive: boolean;\n\n x: number;\n y: number;\n width: number;\n height: number;\n\n /**\n * Space to keep clear around the region, in CSS pixels.\n *\n * @since 8.2.0\n */\n margins: { top: number; right: number; bottom: number; left: number };\n}\n\n/**\n * How far open the hinge is, as the system sees it. Note that it can lag the\n * angle: iOS keeps reporting `'closed'` for a moment after the phone opens.\n *\n * @since 8.2.0\n */\nexport type HingeStatus = 'closed' | 'partiallyOpen' | 'fullyOpen';\n\nexport interface SizeClass {\n /**\n * Width size class of the window: `'compact'` on a phone and on the outer\n * display of a foldable, `'regular'` on the inner display, tablets and wide\n * windows. On Android and web `'regular'` starts at 600 CSS pixels.\n *\n * @since 7.0.0\n */\n horizontal: 'compact' | 'regular';\n\n /**\n * Height size class of the window: `'compact'` on a phone in landscape. On\n * Android and web `'regular'` starts at 480 CSS pixels.\n *\n * @since 7.0.0\n */\n vertical: 'compact' | 'regular';\n\n /**\n * Material window width class, from the window width in CSS pixels:\n * `'compact'` below 600, `'medium'` below 840, `'expanded'` below 1200,\n * `'large'` below 1600 and `'extraLarge'` from 1600.\n *\n * @since 7.0.0\n */\n widthClass: 'compact' | 'medium' | 'expanded' | 'large' | 'extraLarge';\n\n /**\n * Material window height class, from the window height in CSS pixels:\n * `'compact'` below 480, `'medium'` below 900 and `'expanded'` from 900.\n *\n * @since 7.0.0\n */\n heightClass: 'compact' | 'medium' | 'expanded';\n}\n\nexport type DisplayModeStatus = 'unsupported' | 'unavailable' | 'available' | 'active';\n\nexport interface DisplayModes {\n /**\n * Rear display mode moves the app to the outer display, so people can frame a\n * photo with the rear cameras. Only on Android foldables that offer it.\n *\n * @since 7.0.0\n */\n rearDisplay: DisplayModeStatus;\n\n /**\n * Dual-screen mode shows a second page on the outer display while the app\n * stays on the inner one. Only on Android foldables that offer it.\n *\n * @since 7.0.0\n */\n dualScreen: DisplayModeStatus;\n}\n\nexport interface BarPlacement {\n /**\n * The edge iPhone Duo moves tab bars and toolbars to when it lays them out\n * vertically: `'leading'` or `'trailing'` in the reading direction, so\n * `'leading'` is the left edge in left-to-right languages. `null` when bars\n * stay horizontal, and always on Android, web and iOS before 27.1. An app\n * built with an older Xcode still gets the edge: it is inferred from the\n * safe-area inset the bar leaves, since the trait that names it is missing.\n *\n * @since 7.0.0\n */\n verticalBarEdge: 'leading' | 'trailing' | null;\n}\n\nexport interface FoldablePolyfillOptions {\n /**\n * Take over hiding Ionic's tab bar while the keyboard is open. iPhone Duo\n * reports a keyboard on every fold, and Ionic waits for the window to return\n * to the height it had when the keyboard first opened, so its tab bar can\n * disappear until the device is folded back. With this on, the keyboard events\n * never reach Ionic, and a `foldable-keyboard-open` class on `<html>` marks\n * when a text field really has the keyboard. `ionic-tabs.css` hides the tab\n * bar with it.\n *\n * @default false\n * @since 8.0.2\n */\n ionicKeyboard?: boolean;\n}\n\nexport interface FoldablePlugin {\n /**\n * Whether the device has a fold at all, and whether it can be propped half\n * open like a laptop. Both `false` on web, and on iOS except on iPhone Duo\n * (iOS 27.1 or later).\n *\n * @since 7.0.0\n */\n isDeviceFoldable(): Promise<{ foldable: boolean; supportsTabletop: boolean }>;\n\n /**\n * Read the current fold state. Resolves to\n * `{ state: 'flat', isSeparating: false, posture: 'flat' }` when there is no\n * fold information.\n *\n * @since 7.0.0\n */\n getFoldState(): Promise<FoldState>;\n\n /**\n * Read the angle between the two halves of the device, in degrees: `0` when\n * closed, `180` when flat. Resolves to `{ angle: null }` on devices without a\n * hinge angle sensor, on web, and on iOS before 27.1.\n *\n * @since 7.0.0\n */\n getHingeAngle(): Promise<{ angle: number | null; status: HingeStatus | null }>;\n\n /**\n * Read every region the system reserves on this display: the fold and\n * anything covering the screen, active or not. iPhone Duo reports the fold,\n * the vertical status bar area and the under-display camera. Resolves to an\n * empty list on Android, on web and on iOS before 27.1.\n *\n * @since 8.2.0\n */\n getReservedRegions(): Promise<{ regions: ReservedRegion[] }>;\n\n /**\n * Choose whether iPhone Duo may move this app's bars to the side of the\n * display. `'disabled'` keeps everything horizontal, including the status\n * bar. Resolves to `{ applied: false }` when the app does not use\n * `FoldableBridgeViewController`, on Android, on web and on iOS before 27.1.\n * See the iPhone Duo guide for the one-line storyboard change.\n *\n * @since 8.2.0\n */\n setVerticalBarBehavior(options: { behavior: 'automatic' | 'disabled' }): Promise<{ applied: boolean }>;\n\n /**\n * Read the window's size classes: Apple's compact and regular, the signal its\n * iPhone Duo guidelines recommend for telling the outer display from the inner\n * one, and Material's width and height classes. On iOS `horizontal` and\n * `vertical` are UIKit's size classes; everything else comes from the window\n * size.\n *\n * @since 7.0.0\n */\n getSizeClass(): Promise<SizeClass>;\n\n /**\n * Read which of the foldable display modes the device offers right now. Both\n * are `'unsupported'` on iOS and web.\n *\n * @since 7.0.0\n */\n getDisplayModes(): Promise<DisplayModes>;\n\n /**\n * Read where native bars go. Native tab bars and toolbars move to the side of\n * the display on iPhone Duo, but HTML ones stay put, so use this to move your\n * own tab bar too.\n *\n * @since 7.0.0\n */\n getBarPlacement(): Promise<BarPlacement>;\n\n /**\n * Move the app to the outer display. Android asks the user to confirm first,\n * and the promise resolves once the app has moved. Rejects when rear display\n * mode is not `'available'`. Only on Android.\n *\n * @since 7.0.0\n */\n startRearDisplay(): Promise<void>;\n\n /**\n * Move the app back to the inner display.\n *\n * @since 7.0.0\n */\n stopRearDisplay(): Promise<void>;\n\n /**\n * Show a page on the outer display while the app stays on the inner one. A\n * relative `url` resolves against the app's own URL, so `'cover.html'` loads a\n * page bundled with the app. The page runs in its own web view without access\n * to Capacitor plugins. Calling this again while dual-screen mode is active\n * replaces the page. Only on Android.\n *\n * @since 7.0.0\n */\n startDualScreen(options: { url: string }): Promise<void>;\n\n /**\n * Close the page on the outer display.\n *\n * @since 7.0.0\n */\n stopDualScreen(): Promise<void>;\n\n /**\n * Listen for fold state changes. On a foldable this also fires when the\n * device rotates, because `hingeOrientation` and `hingeBounds` rotate with\n * the window.\n *\n * @since 7.0.0\n */\n addListener(eventName: 'foldStateChange', listenerFunc: (state: FoldState) => void): Promise<PluginListenerHandle>;\n\n /**\n * Listen for hinge angle changes. On Android the hinge sensor only runs while\n * at least one of these listeners is registered. On iOS it fires on iPhone\n * Duo (iOS 27.1 or later). Never fires on web.\n *\n * @since 7.0.0\n */\n addListener(\n eventName: 'hingeAngleChange',\n listenerFunc: (event: { angle: number }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for size class changes, such as unfolding the device, rotating it or\n * resizing the window. On iOS this fires when UIKit's size classes change\n * (iOS 17 or later) or the device rotates, so a resize that keeps the same\n * size classes may not update `widthClass` and `heightClass` until then.\n *\n * @since 7.0.0\n */\n addListener(\n eventName: 'sizeClassChange',\n listenerFunc: (sizeClass: SizeClass) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for changes to the display modes, including a mode ending because\n * the user folded or unfolded the device. Never fires on iOS and web.\n *\n * @since 7.0.0\n */\n addListener(\n eventName: 'displayModeChange',\n listenerFunc: (modes: DisplayModes) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for the device being folded or unfolded. `folding` turns `true` as\n * soon as the hinge starts moving and `false` about half a second after it\n * stops, so an app can pause animations or heavy work while the screen is in\n * motion. Only fires where a hinge angle is available: Android foldables with\n * a hinge sensor, and iPhone Duo on iOS 27.1 or later.\n *\n * @since 8.2.0\n */\n addListener(\n eventName: 'foldingChange',\n listenerFunc: (event: { folding: boolean }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for bar placement changes, such as opening or rotating iPhone Duo.\n * Only fires on iOS 27.1 or later.\n *\n * @since 7.0.0\n */\n addListener(\n eventName: 'barPlacementChange',\n listenerFunc: (placement: BarPlacement) => void,\n ): Promise<PluginListenerHandle>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface FoldState {\n /**\n * Posture of the fold. `'closed'` is never reported today: a device shut on\n * its cover display reports `'flat'`.\n *\n * @since 7.0.0\n */\n state: 'flat' | 'half-opened' | 'closed';\n\n /**\n * Whether the fold splits the web view into two areas: `true` when\n * half-opened, or when the hinge has a physical gap.\n *\n * @since 7.0.0\n */\n isSeparating: boolean;\n\n /**\n * How the device is held: `'tabletop'` when half-opened with a horizontal\n * hinge, like a laptop, `'book'` when half-opened with a vertical hinge, and\n * `'flat'` otherwise.\n *\n * @since 7.0.0\n */\n posture: 'flat' | 'tabletop' | 'book';\n\n /**\n * Direction of the hinge relative to the window, so it flips when the device\n * rotates. Omitted when there is no fold.\n *\n * @since 7.0.0\n */\n hingeOrientation?: 'horizontal' | 'vertical';\n\n /**\n * Position of the fold in CSS pixels, relative to the web view. Zero wide (or\n * zero tall) on a seamless fold. Omitted when there is no fold.\n *\n * @since 7.0.0\n */\n hingeBounds?: { x: number; y: number; width: number; height: number };\n\n /**\n * Area of the web view the hinge covers, in CSS pixels. Only present on\n * devices with a physical gap.\n *\n * @since 7.0.0\n */\n occludedBounds?: { x: number; y: number; width: number; height: number };\n\n /**\n * Which display is showing the app, on a device with an inner and an outer\n * display such as iPhone Duo. Reported on iPhone Duo (iOS 27.1 or later) and\n * omitted elsewhere.\n *\n * @since 7.0.0\n */\n activeDisplay?: 'inner' | 'outer';\n\n /**\n * Areas of the web view something covers, in CSS pixels. On Android these are\n * the display cutouts. On iPhone Duo these are the active occlusion regions:\n * the camera in use, and the strip the system keeps for the vertical status\n * bar. Use `getReservedRegions()` when you need to tell them apart. Omitted\n * when there are none.\n *\n * @since 7.0.0\n */\n cameraBounds?: { x: number; y: number; width: number; height: number }[];\n\n /**\n * Space the system asks you to keep clear around the fold, in CSS pixels.\n * `hingeBounds` covers the crease plus these margins, so the crease itself is\n * `hingeBounds` shrunk by them. iPhone Duo reports 20 on each side of a\n * vertical fold. Omitted on Android and where there is no fold.\n *\n * @since 8.2.0\n */\n hingeMargins?: { top: number; right: number; bottom: number; left: number };\n}\n\nexport interface ReservedRegion {\n /**\n * `'division'` is the fold itself. `'occlusion'` is something covering the\n * display, such as a camera or the vertical status bar area.\n *\n * @since 8.2.0\n */\n kind: 'division' | 'occlusion';\n\n /**\n * Whether the region applies right now. An inactive division is a flat fold,\n * and an inactive occlusion is a camera that is not in use.\n *\n * @since 8.2.0\n */\n isActive: boolean;\n\n x: number;\n y: number;\n width: number;\n height: number;\n\n /**\n * Space to keep clear around the region, in CSS pixels.\n *\n * @since 8.2.0\n */\n margins: { top: number; right: number; bottom: number; left: number };\n}\n\n/**\n * How far open the hinge is, as the system sees it. Note that it can lag the\n * angle: iOS keeps reporting `'closed'` for a moment after the phone opens.\n *\n * @since 8.2.0\n */\nexport type HingeStatus = 'closed' | 'partiallyOpen' | 'fullyOpen';\n\nexport interface SizeClass {\n /**\n * Width size class of the window: `'compact'` on a phone and on the outer\n * display of a foldable, `'regular'` on the inner display, tablets and wide\n * windows. On Android and web `'regular'` starts at 600 CSS pixels.\n *\n * @since 7.0.0\n */\n horizontal: 'compact' | 'regular';\n\n /**\n * Height size class of the window: `'compact'` on a phone in landscape. On\n * Android and web `'regular'` starts at 480 CSS pixels.\n *\n * @since 7.0.0\n */\n vertical: 'compact' | 'regular';\n\n /**\n * Material window width class, from the window width in CSS pixels:\n * `'compact'` below 600, `'medium'` below 840, `'expanded'` below 1200,\n * `'large'` below 1600 and `'extraLarge'` from 1600.\n *\n * @since 7.0.0\n */\n widthClass: 'compact' | 'medium' | 'expanded' | 'large' | 'extraLarge';\n\n /**\n * Material window height class, from the window height in CSS pixels:\n * `'compact'` below 480, `'medium'` below 900 and `'expanded'` from 900.\n *\n * @since 7.0.0\n */\n heightClass: 'compact' | 'medium' | 'expanded';\n}\n\nexport type DisplayModeStatus = 'unsupported' | 'unavailable' | 'available' | 'active';\n\nexport interface DisplayModes {\n /**\n * Rear display mode moves the app to the outer display, so people can frame a\n * photo with the rear cameras. Only on Android foldables that offer it.\n *\n * @since 7.0.0\n */\n rearDisplay: DisplayModeStatus;\n\n /**\n * Dual-screen mode shows a second page on the outer display while the app\n * stays on the inner one. Only on Android foldables that offer it.\n *\n * @since 7.0.0\n */\n dualScreen: DisplayModeStatus;\n}\n\nexport interface BarPlacement {\n /**\n * The edge iPhone Duo moves tab bars and toolbars to when it lays them out\n * vertically: `'leading'` or `'trailing'` in the reading direction, so\n * `'leading'` is the left edge in left-to-right languages. `null` when bars\n * stay horizontal, and always on Android, web and iOS before 27.1. An app\n * built with an older Xcode still gets the edge: it is inferred from the\n * safe-area inset the bar leaves, since the trait that names it is missing.\n *\n * @since 7.0.0\n */\n verticalBarEdge: 'leading' | 'trailing' | null;\n\n /**\n * How much room the vertical bar takes on its edge, in points, rounded to\n * whole points. It is the same value the web view reports as a safe-area\n * inset, so `env(safe-area-inset-*)` already covers simple layouts. Read it\n * when you place your own chrome and need the number itself, and do not\n * assume it stays at 84: it differs when the bar is disabled, and Apple can\n * change it. `0` when no vertical bar is reported, and always on Android and\n * web.\n *\n * @since 8.3.3\n */\n inset: number;\n}\n\nexport interface FoldablePolyfillOptions {\n /**\n * Take over hiding Ionic's tab bar while the keyboard is open. iPhone Duo\n * reports a keyboard on every fold, and Ionic waits for the window to return\n * to the height it had when the keyboard first opened, so its tab bar can\n * disappear until the device is folded back. With this on, the keyboard events\n * never reach Ionic, and a `foldable-keyboard-open` class on `<html>` marks\n * when a text field really has the keyboard. `ionic-tabs.css` hides the tab\n * bar with it.\n *\n * @default false\n * @since 8.0.2\n */\n ionicKeyboard?: boolean;\n}\n\nexport interface FoldablePlugin {\n /**\n * Whether the device has a fold at all, and whether it can be propped half\n * open like a laptop. Both `false` on web, and on iOS except on iPhone Duo\n * (iOS 27.1 or later).\n *\n * @since 7.0.0\n */\n isDeviceFoldable(): Promise<{ foldable: boolean; supportsTabletop: boolean }>;\n\n /**\n * Read the current fold state. Resolves to\n * `{ state: 'flat', isSeparating: false, posture: 'flat' }` when there is no\n * fold information.\n *\n * @since 7.0.0\n */\n getFoldState(): Promise<FoldState>;\n\n /**\n * Read the angle between the two halves of the device, in degrees: `0` when\n * closed, `180` when flat. Resolves to `{ angle: null }` on devices without a\n * hinge angle sensor, on web, and on iOS before 27.1.\n *\n * @since 7.0.0\n */\n getHingeAngle(): Promise<{ angle: number | null; status: HingeStatus | null }>;\n\n /**\n * Read every region the system reserves on this display: the fold and\n * anything covering the screen, active or not. iPhone Duo reports the fold,\n * the vertical status bar area and the under-display camera. Resolves to an\n * empty list on Android, on web and on iOS before 27.1.\n *\n * @since 8.2.0\n */\n getReservedRegions(): Promise<{ regions: ReservedRegion[] }>;\n\n /**\n * Choose whether iPhone Duo may move this app's bars to the side of the\n * display. `'disabled'` keeps everything horizontal, including the status\n * bar. Resolves to `{ applied: false }` when the app does not use\n * `FoldableBridgeViewController`, on Android, on web and on iOS before 27.1.\n * See the iPhone Duo guide for the one-line storyboard change.\n *\n * @since 8.2.0\n */\n setVerticalBarBehavior(options: { behavior: 'automatic' | 'disabled' }): Promise<{ applied: boolean }>;\n\n /**\n * Read the window's size classes: Apple's compact and regular, the signal its\n * iPhone Duo guidelines recommend for telling the outer display from the inner\n * one, and Material's width and height classes. On iOS `horizontal` and\n * `vertical` are UIKit's size classes; everything else comes from the window\n * size.\n *\n * @since 7.0.0\n */\n getSizeClass(): Promise<SizeClass>;\n\n /**\n * Read which of the foldable display modes the device offers right now. Both\n * are `'unsupported'` on iOS and web.\n *\n * @since 7.0.0\n */\n getDisplayModes(): Promise<DisplayModes>;\n\n /**\n * Read where native bars go. Native tab bars and toolbars move to the side of\n * the display on iPhone Duo, but HTML ones stay put, so use this to move your\n * own tab bar too.\n *\n * @since 7.0.0\n */\n getBarPlacement(): Promise<BarPlacement>;\n\n /**\n * Move the app to the outer display. Android asks the user to confirm first,\n * and the promise resolves once the app has moved. Rejects when rear display\n * mode is not `'available'`. Only on Android.\n *\n * @since 7.0.0\n */\n startRearDisplay(): Promise<void>;\n\n /**\n * Move the app back to the inner display.\n *\n * @since 7.0.0\n */\n stopRearDisplay(): Promise<void>;\n\n /**\n * Show a page on the outer display while the app stays on the inner one. A\n * relative `url` resolves against the app's own URL, so `'cover.html'` loads a\n * page bundled with the app. The page runs in its own web view without access\n * to Capacitor plugins. Calling this again while dual-screen mode is active\n * replaces the page. Only on Android.\n *\n * @since 7.0.0\n */\n startDualScreen(options: { url: string }): Promise<void>;\n\n /**\n * Close the page on the outer display.\n *\n * @since 7.0.0\n */\n stopDualScreen(): Promise<void>;\n\n /**\n * Listen for fold state changes. On a foldable this also fires when the\n * device rotates, because `hingeOrientation` and `hingeBounds` rotate with\n * the window.\n *\n * @since 7.0.0\n */\n addListener(eventName: 'foldStateChange', listenerFunc: (state: FoldState) => void): Promise<PluginListenerHandle>;\n\n /**\n * Listen for hinge angle changes. On Android the hinge sensor only runs while\n * at least one of these listeners is registered. On iOS it fires on iPhone\n * Duo (iOS 27.1 or later). Never fires on web.\n *\n * @since 7.0.0\n */\n addListener(\n eventName: 'hingeAngleChange',\n listenerFunc: (event: { angle: number }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for size class changes, such as unfolding the device, rotating it or\n * resizing the window. On iOS this fires when UIKit's size classes change\n * (iOS 17 or later) or the device rotates, so a resize that keeps the same\n * size classes may not update `widthClass` and `heightClass` until then.\n *\n * @since 7.0.0\n */\n addListener(\n eventName: 'sizeClassChange',\n listenerFunc: (sizeClass: SizeClass) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for changes to the display modes, including a mode ending because\n * the user folded or unfolded the device. Never fires on iOS and web.\n *\n * @since 7.0.0\n */\n addListener(\n eventName: 'displayModeChange',\n listenerFunc: (modes: DisplayModes) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for the device being folded or unfolded. `folding` turns `true` as\n * soon as the hinge starts moving and `false` about half a second after it\n * stops, so an app can pause animations or heavy work while the screen is in\n * motion. Only fires where a hinge angle is available: Android foldables with\n * a hinge sensor, and iPhone Duo on iOS 27.1 or later.\n *\n * @since 8.2.0\n */\n addListener(\n eventName: 'foldingChange',\n listenerFunc: (event: { folding: boolean }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for bar placement changes, such as opening or rotating iPhone Duo.\n * Only fires on iOS 27.1 or later.\n *\n * @since 7.0.0\n */\n addListener(\n eventName: 'barPlacementChange',\n listenerFunc: (placement: BarPlacement) => void,\n ): Promise<PluginListenerHandle>;\n}\n"]}
package/dist/esm/web.js CHANGED
@@ -34,7 +34,7 @@ export class FoldableWeb extends WebPlugin {
34
34
  return { rearDisplay: 'unsupported', dualScreen: 'unsupported' };
35
35
  }
36
36
  async getBarPlacement() {
37
- return { verticalBarEdge: null };
37
+ return { verticalBarEdge: null, inset: 0 };
38
38
  }
39
39
  async startRearDisplay() {
40
40
  throw this.unavailable('Rear display mode is only available on Android.');
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,OAAO,WAAY,SAAQ,SAAS;IAGxC;QACE,KAAK,EAAE,CAAC;QAHF,cAAS,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAIrE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;YACrC,MAAM,I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CAAC,CAAC;IAC5E,CAAC;IAED,eAAe;QACb,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,IAAI,CAAC,WAAW,CAAC,gDAAgD,CAAC,CAAC;IAC3E,CAAC;IAED,cAAc;QACZ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { BarPlacement, DisplayModes, FoldablePlugin, FoldState, SizeClass } from './definitions';\nimport { sizeClassOf } from './size-class';\n\nexport class FoldableWeb extends WebPlugin implements FoldablePlugin {\n private sizeClass = sizeClassOf(window.innerWidth, window.innerHeight);\n\n constructor() {\n super();\n window.addEventListener('resize', () => {\n const next = sizeClassOf(window.innerWidth, window.innerHeight);\n if (JSON.stringify(next) === JSON.stringify(this.sizeClass)) return;\n\n this.sizeClass = next;\n this.notifyListeners('sizeClassChange', next);\n });\n }\n\n async isDeviceFoldable(): Promise<{ foldable: boolean; supportsTabletop: boolean }> {\n return { foldable: false, supportsTabletop: false };\n }\n\n async getFoldState(): Promise<FoldState> {\n return { state: 'flat', isSeparating: false, posture: 'flat' };\n }\n\n async setVerticalBarBehavior(): Promise<{ applied: boolean }> {\n return { applied: false };\n }\n\n async getReservedRegions(): Promise<{ regions: [] }> {\n return { regions: [] };\n }\n\n async getHingeAngle(): Promise<{ angle: number | null; status: null }> {\n return { angle: null, status: null };\n }\n\n async getSizeClass(): Promise<SizeClass> {\n return sizeClassOf(window.innerWidth, window.innerHeight);\n }\n\n async getDisplayModes(): Promise<DisplayModes> {\n return { rearDisplay: 'unsupported', dualScreen: 'unsupported' };\n }\n\n async getBarPlacement(): Promise<BarPlacement> {\n return { verticalBarEdge: null };\n }\n\n async startRearDisplay(): Promise<void> {\n throw this.unavailable('Rear display mode is only available on Android.');\n }\n\n stopRearDisplay(): Promise<void> {\n return Promise.resolve();\n }\n\n async startDualScreen(): Promise<void> {\n throw this.unavailable('Dual-screen mode is only available on Android.');\n }\n\n stopDualScreen(): Promise<void> {\n return Promise.resolve();\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,OAAO,WAAY,SAAQ,SAAS;IAGxC;QACE,KAAK,EAAE,CAAC;QAHF,cAAS,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAIrE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;YACrC,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;YAChE,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;gBAAE,OAAO;YAEpE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,WAAW,CAAC,iDAAiD,CAAC,CAAC;IAC5E,CAAC;IAED,eAAe;QACb,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,IAAI,CAAC,WAAW,CAAC,gDAAgD,CAAC,CAAC;IAC3E,CAAC;IAED,cAAc;QACZ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { BarPlacement, DisplayModes, FoldablePlugin, FoldState, SizeClass } from './definitions';\nimport { sizeClassOf } from './size-class';\n\nexport class FoldableWeb extends WebPlugin implements FoldablePlugin {\n private sizeClass = sizeClassOf(window.innerWidth, window.innerHeight);\n\n constructor() {\n super();\n window.addEventListener('resize', () => {\n const next = sizeClassOf(window.innerWidth, window.innerHeight);\n if (JSON.stringify(next) === JSON.stringify(this.sizeClass)) return;\n\n this.sizeClass = next;\n this.notifyListeners('sizeClassChange', next);\n });\n }\n\n async isDeviceFoldable(): Promise<{ foldable: boolean; supportsTabletop: boolean }> {\n return { foldable: false, supportsTabletop: false };\n }\n\n async getFoldState(): Promise<FoldState> {\n return { state: 'flat', isSeparating: false, posture: 'flat' };\n }\n\n async setVerticalBarBehavior(): Promise<{ applied: boolean }> {\n return { applied: false };\n }\n\n async getReservedRegions(): Promise<{ regions: [] }> {\n return { regions: [] };\n }\n\n async getHingeAngle(): Promise<{ angle: number | null; status: null }> {\n return { angle: null, status: null };\n }\n\n async getSizeClass(): Promise<SizeClass> {\n return sizeClassOf(window.innerWidth, window.innerHeight);\n }\n\n async getDisplayModes(): Promise<DisplayModes> {\n return { rearDisplay: 'unsupported', dualScreen: 'unsupported' };\n }\n\n async getBarPlacement(): Promise<BarPlacement> {\n return { verticalBarEdge: null, inset: 0 };\n }\n\n async startRearDisplay(): Promise<void> {\n throw this.unavailable('Rear display mode is only available on Android.');\n }\n\n stopRearDisplay(): Promise<void> {\n return Promise.resolve();\n }\n\n async startDualScreen(): Promise<void> {\n throw this.unavailable('Dual-screen mode is only available on Android.');\n }\n\n stopDualScreen(): Promise<void> {\n return Promise.resolve();\n }\n}\n"]}
@@ -274,7 +274,7 @@ class FoldableWeb extends core.WebPlugin {
274
274
  return { rearDisplay: 'unsupported', dualScreen: 'unsupported' };
275
275
  }
276
276
  async getBarPlacement() {
277
- return { verticalBarEdge: null };
277
+ return { verticalBarEdge: null, inset: 0 };
278
278
  }
279
279
  async startRearDisplay() {
280
280
  throw this.unavailable('Rear display mode is only available on Android.');
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/css.js","esm/keyboard.js","esm/segments.js","esm/polyfill.js","esm/index.js","esm/size-class.js","esm/web.js"],"sourcesContent":["export const CSS_CLASSES = [\n 'horizontal-viewport-segments-2',\n 'vertical-viewport-segments-2',\n 'device-posture-continuous',\n 'device-posture-folded',\n];\nexport const BAR_CLASSES = ['vertical-bars-leading', 'vertical-bars-trailing'];\nexport const FOLD_CLASSES = ['fold-vertical', 'fold-horizontal'];\nexport const FOLD_VARIABLES = [\n '--fold-left',\n '--fold-top',\n '--fold-width',\n '--fold-height',\n '--fold-margin-top',\n '--fold-margin-right',\n '--fold-margin-bottom',\n '--fold-margin-left',\n];\nexport function foldCssFor(hingeBounds, hingeOrientation, hingeMargins) {\n if (!hingeBounds || !hingeOrientation)\n return { variables: {}, className: null };\n const margins = hingeMargins !== null && hingeMargins !== void 0 ? hingeMargins : { top: 0, right: 0, bottom: 0, left: 0 };\n return {\n variables: {\n '--fold-left': `${hingeBounds.x}px`,\n '--fold-top': `${hingeBounds.y}px`,\n '--fold-width': `${hingeBounds.width}px`,\n '--fold-height': `${hingeBounds.height}px`,\n '--fold-margin-top': `${margins.top}px`,\n '--fold-margin-right': `${margins.right}px`,\n '--fold-margin-bottom': `${margins.bottom}px`,\n '--fold-margin-left': `${margins.left}px`,\n },\n className: `fold-${hingeOrientation}`,\n };\n}\nexport function barClassFor(edge) {\n return edge ? `vertical-bars-${edge}` : null;\n}\nconst TAB_BAR_MARGIN = 24;\nconst CAMERA_GAP = 15;\nexport function verticalTabBarBottom(cameras, viewportHeight) {\n const below = cameras.filter((camera) => camera.y > viewportHeight / 2);\n const camera = below.sort((a, b) => a.width * a.height - b.width * b.height)[0];\n if (!camera)\n return TAB_BAR_MARGIN;\n return Math.max(TAB_BAR_MARGIN, Math.round(viewportHeight - camera.y + CAMERA_GAP));\n}\nexport function cssFor(segments, posture) {\n const stacked = segments.length > 1 && segments[1].y > segments[0].y;\n const variables = {};\n segments.forEach((segment, index) => {\n const suffix = stacked ? `0-${index}` : `${index}-0`;\n variables[`--viewport-segment-top-${suffix}`] = `${segment.y}px`;\n variables[`--viewport-segment-left-${suffix}`] = `${segment.x}px`;\n variables[`--viewport-segment-bottom-${suffix}`] = `${segment.y + segment.height}px`;\n variables[`--viewport-segment-right-${suffix}`] = `${segment.x + segment.width}px`;\n variables[`--viewport-segment-width-${suffix}`] = `${segment.width}px`;\n variables[`--viewport-segment-height-${suffix}`] = `${segment.height}px`;\n });\n const classes = [`device-posture-${posture}`];\n if (segments.length > 1) {\n classes.push(stacked ? 'vertical-viewport-segments-2' : 'horizontal-viewport-segments-2');\n }\n return { variables, classes };\n}\n//# sourceMappingURL=css.js.map","export const KEYBOARD_CLASS = 'foldable-keyboard-open';\nconst SHOW_EVENTS = ['keyboardWillShow', 'keyboardDidShow', 'ionKeyboardDidShow'];\nconst isEditing = (element) => !!element &&\n (element.isContentEditable || ['INPUT', 'TEXTAREA', 'SELECT'].includes(element.tagName));\nexport function takeOverKeyboard(target, doc) {\n const classes = doc.documentElement.classList;\n for (const name of SHOW_EVENTS) {\n target.addEventListener(name, (event) => {\n event.stopImmediatePropagation();\n if (isEditing(doc.activeElement))\n classes.add(KEYBOARD_CLASS);\n }, true);\n }\n target.addEventListener('keyboardWillHide', () => classes.remove(KEYBOARD_CLASS), true);\n}\n//# sourceMappingURL=keyboard.js.map","const EDGE_TOLERANCE = 1;\nexport function splitViewport(fold, width, height) {\n const whole = [{ x: 0, y: 0, width, height }];\n const hinge = fold === null || fold === void 0 ? void 0 : fold.hingeBounds;\n if (!(fold === null || fold === void 0 ? void 0 : fold.isSeparating) || !hinge)\n return whole;\n if (fold.hingeOrientation === 'vertical') {\n const right = hinge.x + hinge.width;\n const spansHeight = hinge.y <= EDGE_TOLERANCE && hinge.y + hinge.height >= height - EDGE_TOLERANCE;\n if (!spansHeight || hinge.x <= 0 || right >= width)\n return whole;\n return [\n { x: 0, y: 0, width: hinge.x, height },\n { x: right, y: 0, width: width - right, height },\n ];\n }\n const bottom = hinge.y + hinge.height;\n const spansWidth = hinge.x <= EDGE_TOLERANCE && hinge.x + hinge.width >= width - EDGE_TOLERANCE;\n if (!spansWidth || hinge.y <= 0 || bottom >= height)\n return whole;\n return [\n { x: 0, y: 0, width, height: hinge.y },\n { x: 0, y: bottom, width, height: height - bottom },\n ];\n}\n//# sourceMappingURL=segments.js.map","import { Capacitor } from '@capacitor/core';\nimport { BAR_CLASSES, barClassFor, CSS_CLASSES, cssFor, FOLD_CLASSES, FOLD_VARIABLES, foldCssFor, verticalTabBarBottom, } from './css';\nimport { takeOverKeyboard } from './keyboard';\nimport { splitViewport } from './segments';\nclass DevicePosturePolyfill extends EventTarget {\n constructor() {\n super(...arguments);\n this.onchange = null;\n this.current = 'continuous';\n }\n get type() {\n return this.current;\n }\n update(type) {\n var _a;\n if (type === this.current)\n return;\n this.current = type;\n const event = new Event('change');\n (_a = this.onchange) === null || _a === void 0 ? void 0 : _a.call(this, event);\n this.dispatchEvent(event);\n }\n}\nconst postureOf = (fold) => (fold === null || fold === void 0 ? void 0 : fold.state) === 'half-opened' ? 'folded' : 'continuous';\nlet installation = null;\nexport function install(plugin, options = {}) {\n if (!Capacitor.isNativePlatform())\n return Promise.resolve();\n installation !== null && installation !== void 0 ? installation : (installation = run(plugin, options));\n return installation;\n}\nasync function run(plugin, options) {\n if (options.ionicKeyboard)\n takeOverKeyboard(window, document);\n let fold = null;\n const currentSegments = () => splitViewport(fold, window.innerWidth, window.innerHeight);\n if (!('Viewport' in window)) {\n Object.defineProperty(window, 'viewport', {\n configurable: true,\n value: {\n get segments() {\n return Object.freeze(currentSegments().map((rect) => new DOMRect(rect.x, rect.y, rect.width, rect.height)));\n },\n },\n });\n }\n const posture = 'DevicePosture' in window ? null : new DevicePosturePolyfill();\n if (posture) {\n Object.defineProperty(navigator, 'devicePosture', { configurable: true, value: posture });\n }\n const root = document.documentElement;\n let variables = [];\n const applyCss = () => {\n var _a;\n const css = cssFor(currentSegments(), postureOf(fold));\n for (const name of variables)\n root.style.removeProperty(name);\n variables = Object.keys(css.variables);\n for (const name of variables)\n root.style.setProperty(name, css.variables[name]);\n for (const name of CSS_CLASSES)\n root.classList.toggle(name, css.classes.includes(name));\n const foldCss = foldCssFor(fold === null || fold === void 0 ? void 0 : fold.hingeBounds, fold === null || fold === void 0 ? void 0 : fold.hingeOrientation, fold === null || fold === void 0 ? void 0 : fold.hingeMargins);\n for (const name of FOLD_VARIABLES) {\n if (foldCss.variables[name])\n root.style.setProperty(name, foldCss.variables[name]);\n else\n root.style.removeProperty(name);\n }\n for (const name of FOLD_CLASSES)\n root.classList.toggle(name, name === foldCss.className);\n root.style.setProperty('--vertical-tab-bar-bottom', `${verticalTabBarBottom((_a = fold === null || fold === void 0 ? void 0 : fold.cameraBounds) !== null && _a !== void 0 ? _a : [], window.innerHeight)}px`);\n };\n const apply = (next) => {\n fold = next;\n posture === null || posture === void 0 ? void 0 : posture.update(postureOf(next));\n applyCss();\n // The web view can report the previous window size for a moment after the\n // app moves between displays, so measure again once it has settled.\n requestAnimationFrame(applyCss);\n setTimeout(applyCss, 300);\n };\n const applyBars = ({ verticalBarEdge }) => {\n const active = barClassFor(verticalBarEdge);\n for (const name of BAR_CLASSES)\n root.classList.toggle(name, name === active);\n };\n await plugin.addListener('foldingChange', ({ folding }) => root.classList.toggle('folding', folding));\n window.addEventListener('resize', applyCss);\n await plugin.addListener('foldStateChange', apply);\n await plugin.addListener('barPlacementChange', applyBars);\n apply(await plugin.getFoldState());\n applyBars(await plugin.getBarPlacement());\n}\n//# sourceMappingURL=polyfill.js.map","import { registerPlugin } from '@capacitor/core';\nimport { install } from './polyfill';\nconst Foldable = registerPlugin('Foldable', {\n web: () => import('./web').then((m) => new m.FoldableWeb()),\n});\nconst installFoldablePolyfill = (options) => install(Foldable, options);\nexport * from './definitions';\nexport { Foldable, installFoldablePolyfill };\n//# sourceMappingURL=index.js.map","const MEDIUM_WIDTH = 600;\nconst EXPANDED_WIDTH = 840;\nconst LARGE_WIDTH = 1200;\nconst EXTRA_LARGE_WIDTH = 1600;\nconst MEDIUM_HEIGHT = 480;\nconst EXPANDED_HEIGHT = 900;\nfunction widthClassOf(width) {\n if (width >= EXTRA_LARGE_WIDTH)\n return 'extraLarge';\n if (width >= LARGE_WIDTH)\n return 'large';\n if (width >= EXPANDED_WIDTH)\n return 'expanded';\n if (width >= MEDIUM_WIDTH)\n return 'medium';\n return 'compact';\n}\nfunction heightClassOf(height) {\n if (height >= EXPANDED_HEIGHT)\n return 'expanded';\n if (height >= MEDIUM_HEIGHT)\n return 'medium';\n return 'compact';\n}\nexport function sizeClassOf(width, height) {\n return {\n horizontal: width >= MEDIUM_WIDTH ? 'regular' : 'compact',\n vertical: height >= MEDIUM_HEIGHT ? 'regular' : 'compact',\n widthClass: widthClassOf(width),\n heightClass: heightClassOf(height),\n };\n}\n//# sourceMappingURL=size-class.js.map","import { WebPlugin } from '@capacitor/core';\nimport { sizeClassOf } from './size-class';\nexport class FoldableWeb extends WebPlugin {\n constructor() {\n super();\n this.sizeClass = sizeClassOf(window.innerWidth, window.innerHeight);\n window.addEventListener('resize', () => {\n const next = sizeClassOf(window.innerWidth, window.innerHeight);\n if (JSON.stringify(next) === JSON.stringify(this.sizeClass))\n return;\n this.sizeClass = next;\n this.notifyListeners('sizeClassChange', next);\n });\n }\n async isDeviceFoldable() {\n return { foldable: false, supportsTabletop: false };\n }\n async getFoldState() {\n return { state: 'flat', isSeparating: false, posture: 'flat' };\n }\n async setVerticalBarBehavior() {\n return { applied: false };\n }\n async getReservedRegions() {\n return { regions: [] };\n }\n async getHingeAngle() {\n return { angle: null, status: null };\n }\n async getSizeClass() {\n return sizeClassOf(window.innerWidth, window.innerHeight);\n }\n async getDisplayModes() {\n return { rearDisplay: 'unsupported', dualScreen: 'unsupported' };\n }\n async getBarPlacement() {\n return { verticalBarEdge: null };\n }\n async startRearDisplay() {\n throw this.unavailable('Rear display mode is only available on Android.');\n }\n stopRearDisplay() {\n return Promise.resolve();\n }\n async startDualScreen() {\n throw this.unavailable('Dual-screen mode is only available on Android.');\n }\n stopDualScreen() {\n return Promise.resolve();\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["Capacitor","registerPlugin","WebPlugin"],"mappings":";;;;AAAO,MAAM,WAAW,GAAG;AAC3B,IAAI,gCAAgC;AACpC,IAAI,8BAA8B;AAClC,IAAI,2BAA2B;AAC/B,IAAI,uBAAuB;AAC3B,CAAC;AACM,MAAM,WAAW,GAAG,CAAC,uBAAuB,EAAE,wBAAwB,CAAC;AACvE,MAAM,YAAY,GAAG,CAAC,eAAe,EAAE,iBAAiB,CAAC;AACzD,MAA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;AAC9B,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;AAC5C,IAAI;AACJ,IAAI,MAAM,YAAY,GAAG;AACzB,QAAQ,OAAO,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC;AACjE,IAAI;AACJ,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE;AACxE,IAAI;AACJ,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE;AACxC,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,iDAAiD,CAAC;AACjF,IAAI;AACJ,IAAI,eAAe,GAAG;AACtB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC,IAAI;AACJ,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,gDAAgD,CAAC;AAChF,IAAI;AACJ,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC,IAAI;AACJ;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/css.js","esm/keyboard.js","esm/segments.js","esm/polyfill.js","esm/index.js","esm/size-class.js","esm/web.js"],"sourcesContent":["export const CSS_CLASSES = [\n 'horizontal-viewport-segments-2',\n 'vertical-viewport-segments-2',\n 'device-posture-continuous',\n 'device-posture-folded',\n];\nexport const BAR_CLASSES = ['vertical-bars-leading', 'vertical-bars-trailing'];\nexport const FOLD_CLASSES = ['fold-vertical', 'fold-horizontal'];\nexport const FOLD_VARIABLES = [\n '--fold-left',\n '--fold-top',\n '--fold-width',\n '--fold-height',\n '--fold-margin-top',\n '--fold-margin-right',\n '--fold-margin-bottom',\n '--fold-margin-left',\n];\nexport function foldCssFor(hingeBounds, hingeOrientation, hingeMargins) {\n if (!hingeBounds || !hingeOrientation)\n return { variables: {}, className: null };\n const margins = hingeMargins !== null && hingeMargins !== void 0 ? hingeMargins : { top: 0, right: 0, bottom: 0, left: 0 };\n return {\n variables: {\n '--fold-left': `${hingeBounds.x}px`,\n '--fold-top': `${hingeBounds.y}px`,\n '--fold-width': `${hingeBounds.width}px`,\n '--fold-height': `${hingeBounds.height}px`,\n '--fold-margin-top': `${margins.top}px`,\n '--fold-margin-right': `${margins.right}px`,\n '--fold-margin-bottom': `${margins.bottom}px`,\n '--fold-margin-left': `${margins.left}px`,\n },\n className: `fold-${hingeOrientation}`,\n };\n}\nexport function barClassFor(edge) {\n return edge ? `vertical-bars-${edge}` : null;\n}\nconst TAB_BAR_MARGIN = 24;\nconst CAMERA_GAP = 15;\nexport function verticalTabBarBottom(cameras, viewportHeight) {\n const below = cameras.filter((camera) => camera.y > viewportHeight / 2);\n const camera = below.sort((a, b) => a.width * a.height - b.width * b.height)[0];\n if (!camera)\n return TAB_BAR_MARGIN;\n return Math.max(TAB_BAR_MARGIN, Math.round(viewportHeight - camera.y + CAMERA_GAP));\n}\nexport function cssFor(segments, posture) {\n const stacked = segments.length > 1 && segments[1].y > segments[0].y;\n const variables = {};\n segments.forEach((segment, index) => {\n const suffix = stacked ? `0-${index}` : `${index}-0`;\n variables[`--viewport-segment-top-${suffix}`] = `${segment.y}px`;\n variables[`--viewport-segment-left-${suffix}`] = `${segment.x}px`;\n variables[`--viewport-segment-bottom-${suffix}`] = `${segment.y + segment.height}px`;\n variables[`--viewport-segment-right-${suffix}`] = `${segment.x + segment.width}px`;\n variables[`--viewport-segment-width-${suffix}`] = `${segment.width}px`;\n variables[`--viewport-segment-height-${suffix}`] = `${segment.height}px`;\n });\n const classes = [`device-posture-${posture}`];\n if (segments.length > 1) {\n classes.push(stacked ? 'vertical-viewport-segments-2' : 'horizontal-viewport-segments-2');\n }\n return { variables, classes };\n}\n//# sourceMappingURL=css.js.map","export const KEYBOARD_CLASS = 'foldable-keyboard-open';\nconst SHOW_EVENTS = ['keyboardWillShow', 'keyboardDidShow', 'ionKeyboardDidShow'];\nconst isEditing = (element) => !!element &&\n (element.isContentEditable || ['INPUT', 'TEXTAREA', 'SELECT'].includes(element.tagName));\nexport function takeOverKeyboard(target, doc) {\n const classes = doc.documentElement.classList;\n for (const name of SHOW_EVENTS) {\n target.addEventListener(name, (event) => {\n event.stopImmediatePropagation();\n if (isEditing(doc.activeElement))\n classes.add(KEYBOARD_CLASS);\n }, true);\n }\n target.addEventListener('keyboardWillHide', () => classes.remove(KEYBOARD_CLASS), true);\n}\n//# sourceMappingURL=keyboard.js.map","const EDGE_TOLERANCE = 1;\nexport function splitViewport(fold, width, height) {\n const whole = [{ x: 0, y: 0, width, height }];\n const hinge = fold === null || fold === void 0 ? void 0 : fold.hingeBounds;\n if (!(fold === null || fold === void 0 ? void 0 : fold.isSeparating) || !hinge)\n return whole;\n if (fold.hingeOrientation === 'vertical') {\n const right = hinge.x + hinge.width;\n const spansHeight = hinge.y <= EDGE_TOLERANCE && hinge.y + hinge.height >= height - EDGE_TOLERANCE;\n if (!spansHeight || hinge.x <= 0 || right >= width)\n return whole;\n return [\n { x: 0, y: 0, width: hinge.x, height },\n { x: right, y: 0, width: width - right, height },\n ];\n }\n const bottom = hinge.y + hinge.height;\n const spansWidth = hinge.x <= EDGE_TOLERANCE && hinge.x + hinge.width >= width - EDGE_TOLERANCE;\n if (!spansWidth || hinge.y <= 0 || bottom >= height)\n return whole;\n return [\n { x: 0, y: 0, width, height: hinge.y },\n { x: 0, y: bottom, width, height: height - bottom },\n ];\n}\n//# sourceMappingURL=segments.js.map","import { Capacitor } from '@capacitor/core';\nimport { BAR_CLASSES, barClassFor, CSS_CLASSES, cssFor, FOLD_CLASSES, FOLD_VARIABLES, foldCssFor, verticalTabBarBottom, } from './css';\nimport { takeOverKeyboard } from './keyboard';\nimport { splitViewport } from './segments';\nclass DevicePosturePolyfill extends EventTarget {\n constructor() {\n super(...arguments);\n this.onchange = null;\n this.current = 'continuous';\n }\n get type() {\n return this.current;\n }\n update(type) {\n var _a;\n if (type === this.current)\n return;\n this.current = type;\n const event = new Event('change');\n (_a = this.onchange) === null || _a === void 0 ? void 0 : _a.call(this, event);\n this.dispatchEvent(event);\n }\n}\nconst postureOf = (fold) => (fold === null || fold === void 0 ? void 0 : fold.state) === 'half-opened' ? 'folded' : 'continuous';\nlet installation = null;\nexport function install(plugin, options = {}) {\n if (!Capacitor.isNativePlatform())\n return Promise.resolve();\n installation !== null && installation !== void 0 ? installation : (installation = run(plugin, options));\n return installation;\n}\nasync function run(plugin, options) {\n if (options.ionicKeyboard)\n takeOverKeyboard(window, document);\n let fold = null;\n const currentSegments = () => splitViewport(fold, window.innerWidth, window.innerHeight);\n if (!('Viewport' in window)) {\n Object.defineProperty(window, 'viewport', {\n configurable: true,\n value: {\n get segments() {\n return Object.freeze(currentSegments().map((rect) => new DOMRect(rect.x, rect.y, rect.width, rect.height)));\n },\n },\n });\n }\n const posture = 'DevicePosture' in window ? null : new DevicePosturePolyfill();\n if (posture) {\n Object.defineProperty(navigator, 'devicePosture', { configurable: true, value: posture });\n }\n const root = document.documentElement;\n let variables = [];\n const applyCss = () => {\n var _a;\n const css = cssFor(currentSegments(), postureOf(fold));\n for (const name of variables)\n root.style.removeProperty(name);\n variables = Object.keys(css.variables);\n for (const name of variables)\n root.style.setProperty(name, css.variables[name]);\n for (const name of CSS_CLASSES)\n root.classList.toggle(name, css.classes.includes(name));\n const foldCss = foldCssFor(fold === null || fold === void 0 ? void 0 : fold.hingeBounds, fold === null || fold === void 0 ? void 0 : fold.hingeOrientation, fold === null || fold === void 0 ? void 0 : fold.hingeMargins);\n for (const name of FOLD_VARIABLES) {\n if (foldCss.variables[name])\n root.style.setProperty(name, foldCss.variables[name]);\n else\n root.style.removeProperty(name);\n }\n for (const name of FOLD_CLASSES)\n root.classList.toggle(name, name === foldCss.className);\n root.style.setProperty('--vertical-tab-bar-bottom', `${verticalTabBarBottom((_a = fold === null || fold === void 0 ? void 0 : fold.cameraBounds) !== null && _a !== void 0 ? _a : [], window.innerHeight)}px`);\n };\n const apply = (next) => {\n fold = next;\n posture === null || posture === void 0 ? void 0 : posture.update(postureOf(next));\n applyCss();\n // The web view can report the previous window size for a moment after the\n // app moves between displays, so measure again once it has settled.\n requestAnimationFrame(applyCss);\n setTimeout(applyCss, 300);\n };\n const applyBars = ({ verticalBarEdge }) => {\n const active = barClassFor(verticalBarEdge);\n for (const name of BAR_CLASSES)\n root.classList.toggle(name, name === active);\n };\n await plugin.addListener('foldingChange', ({ folding }) => root.classList.toggle('folding', folding));\n window.addEventListener('resize', applyCss);\n await plugin.addListener('foldStateChange', apply);\n await plugin.addListener('barPlacementChange', applyBars);\n apply(await plugin.getFoldState());\n applyBars(await plugin.getBarPlacement());\n}\n//# sourceMappingURL=polyfill.js.map","import { registerPlugin } from '@capacitor/core';\nimport { install } from './polyfill';\nconst Foldable = registerPlugin('Foldable', {\n web: () => import('./web').then((m) => new m.FoldableWeb()),\n});\nconst installFoldablePolyfill = (options) => install(Foldable, options);\nexport * from './definitions';\nexport { Foldable, installFoldablePolyfill };\n//# sourceMappingURL=index.js.map","const MEDIUM_WIDTH = 600;\nconst EXPANDED_WIDTH = 840;\nconst LARGE_WIDTH = 1200;\nconst EXTRA_LARGE_WIDTH = 1600;\nconst MEDIUM_HEIGHT = 480;\nconst EXPANDED_HEIGHT = 900;\nfunction widthClassOf(width) {\n if (width >= EXTRA_LARGE_WIDTH)\n return 'extraLarge';\n if (width >= LARGE_WIDTH)\n return 'large';\n if (width >= EXPANDED_WIDTH)\n return 'expanded';\n if (width >= MEDIUM_WIDTH)\n return 'medium';\n return 'compact';\n}\nfunction heightClassOf(height) {\n if (height >= EXPANDED_HEIGHT)\n return 'expanded';\n if (height >= MEDIUM_HEIGHT)\n return 'medium';\n return 'compact';\n}\nexport function sizeClassOf(width, height) {\n return {\n horizontal: width >= MEDIUM_WIDTH ? 'regular' : 'compact',\n vertical: height >= MEDIUM_HEIGHT ? 'regular' : 'compact',\n widthClass: widthClassOf(width),\n heightClass: heightClassOf(height),\n };\n}\n//# sourceMappingURL=size-class.js.map","import { WebPlugin } from '@capacitor/core';\nimport { sizeClassOf } from './size-class';\nexport class FoldableWeb extends WebPlugin {\n constructor() {\n super();\n this.sizeClass = sizeClassOf(window.innerWidth, window.innerHeight);\n window.addEventListener('resize', () => {\n const next = sizeClassOf(window.innerWidth, window.innerHeight);\n if (JSON.stringify(next) === JSON.stringify(this.sizeClass))\n return;\n this.sizeClass = next;\n this.notifyListeners('sizeClassChange', next);\n });\n }\n async isDeviceFoldable() {\n return { foldable: false, supportsTabletop: false };\n }\n async getFoldState() {\n return { state: 'flat', isSeparating: false, posture: 'flat' };\n }\n async setVerticalBarBehavior() {\n return { applied: false };\n }\n async getReservedRegions() {\n return { regions: [] };\n }\n async getHingeAngle() {\n return { angle: null, status: null };\n }\n async getSizeClass() {\n return sizeClassOf(window.innerWidth, window.innerHeight);\n }\n async getDisplayModes() {\n return { rearDisplay: 'unsupported', dualScreen: 'unsupported' };\n }\n async getBarPlacement() {\n return { verticalBarEdge: null, inset: 0 };\n }\n async startRearDisplay() {\n throw this.unavailable('Rear display mode is only available on Android.');\n }\n stopRearDisplay() {\n return Promise.resolve();\n }\n async startDualScreen() {\n throw this.unavailable('Dual-screen mode is only available on Android.');\n }\n stopDualScreen() {\n return Promise.resolve();\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["Capacitor","registerPlugin","WebPlugin"],"mappings":";;;;AAAO,MAAM,WAAW,GAAG;AAC3B,IAAI,gCAAgC;AACpC,IAAI,8BAA8B;AAClC,IAAI,2BAA2B;AAC/B,IAAI,uBAAuB;AAC3B,CAAC;AACM,MAAM,WAAW,GAAG,CAAC,uBAAuB,EAAE,wBAAwB,CAAC;AACvE,MAAM,YAAY,GAAG,CAAC,eAAe,EAAE,iBA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AO,EAAE,EAAE,EAAE;AAC9B,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;AAC5C,IAAI;AACJ,IAAI,MAAM,YAAY,GAAG;AACzB,QAAQ,OAAO,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC;AACjE,IAAI;AACJ,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE;AACxE,IAAI;AACJ,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE;AAClD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,iDAAiD,CAAC;AACjF,IAAI;AACJ,IAAI,eAAe,GAAG;AACtB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC,IAAI;AACJ,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,gDAAgD,CAAC;AAChF,IAAI;AACJ,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC,IAAI;AACJ;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -273,7 +273,7 @@ var capacitorFoldable = (function (exports, core) {
273
273
  return { rearDisplay: 'unsupported', dualScreen: 'unsupported' };
274
274
  }
275
275
  async getBarPlacement() {
276
- return { verticalBarEdge: null };
276
+ return { verticalBarEdge: null, inset: 0 };
277
277
  }
278
278
  async startRearDisplay() {
279
279
  throw this.unavailable('Rear display mode is only available on Android.');
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/css.js","esm/keyboard.js","esm/segments.js","esm/polyfill.js","esm/index.js","esm/size-class.js","esm/web.js"],"sourcesContent":["export const CSS_CLASSES = [\n 'horizontal-viewport-segments-2',\n 'vertical-viewport-segments-2',\n 'device-posture-continuous',\n 'device-posture-folded',\n];\nexport const BAR_CLASSES = ['vertical-bars-leading', 'vertical-bars-trailing'];\nexport const FOLD_CLASSES = ['fold-vertical', 'fold-horizontal'];\nexport const FOLD_VARIABLES = [\n '--fold-left',\n '--fold-top',\n '--fold-width',\n '--fold-height',\n '--fold-margin-top',\n '--fold-margin-right',\n '--fold-margin-bottom',\n '--fold-margin-left',\n];\nexport function foldCssFor(hingeBounds, hingeOrientation, hingeMargins) {\n if (!hingeBounds || !hingeOrientation)\n return { variables: {}, className: null };\n const margins = hingeMargins !== null && hingeMargins !== void 0 ? hingeMargins : { top: 0, right: 0, bottom: 0, left: 0 };\n return {\n variables: {\n '--fold-left': `${hingeBounds.x}px`,\n '--fold-top': `${hingeBounds.y}px`,\n '--fold-width': `${hingeBounds.width}px`,\n '--fold-height': `${hingeBounds.height}px`,\n '--fold-margin-top': `${margins.top}px`,\n '--fold-margin-right': `${margins.right}px`,\n '--fold-margin-bottom': `${margins.bottom}px`,\n '--fold-margin-left': `${margins.left}px`,\n },\n className: `fold-${hingeOrientation}`,\n };\n}\nexport function barClassFor(edge) {\n return edge ? `vertical-bars-${edge}` : null;\n}\nconst TAB_BAR_MARGIN = 24;\nconst CAMERA_GAP = 15;\nexport function verticalTabBarBottom(cameras, viewportHeight) {\n const below = cameras.filter((camera) => camera.y > viewportHeight / 2);\n const camera = below.sort((a, b) => a.width * a.height - b.width * b.height)[0];\n if (!camera)\n return TAB_BAR_MARGIN;\n return Math.max(TAB_BAR_MARGIN, Math.round(viewportHeight - camera.y + CAMERA_GAP));\n}\nexport function cssFor(segments, posture) {\n const stacked = segments.length > 1 && segments[1].y > segments[0].y;\n const variables = {};\n segments.forEach((segment, index) => {\n const suffix = stacked ? `0-${index}` : `${index}-0`;\n variables[`--viewport-segment-top-${suffix}`] = `${segment.y}px`;\n variables[`--viewport-segment-left-${suffix}`] = `${segment.x}px`;\n variables[`--viewport-segment-bottom-${suffix}`] = `${segment.y + segment.height}px`;\n variables[`--viewport-segment-right-${suffix}`] = `${segment.x + segment.width}px`;\n variables[`--viewport-segment-width-${suffix}`] = `${segment.width}px`;\n variables[`--viewport-segment-height-${suffix}`] = `${segment.height}px`;\n });\n const classes = [`device-posture-${posture}`];\n if (segments.length > 1) {\n classes.push(stacked ? 'vertical-viewport-segments-2' : 'horizontal-viewport-segments-2');\n }\n return { variables, classes };\n}\n//# sourceMappingURL=css.js.map","export const KEYBOARD_CLASS = 'foldable-keyboard-open';\nconst SHOW_EVENTS = ['keyboardWillShow', 'keyboardDidShow', 'ionKeyboardDidShow'];\nconst isEditing = (element) => !!element &&\n (element.isContentEditable || ['INPUT', 'TEXTAREA', 'SELECT'].includes(element.tagName));\nexport function takeOverKeyboard(target, doc) {\n const classes = doc.documentElement.classList;\n for (const name of SHOW_EVENTS) {\n target.addEventListener(name, (event) => {\n event.stopImmediatePropagation();\n if (isEditing(doc.activeElement))\n classes.add(KEYBOARD_CLASS);\n }, true);\n }\n target.addEventListener('keyboardWillHide', () => classes.remove(KEYBOARD_CLASS), true);\n}\n//# sourceMappingURL=keyboard.js.map","const EDGE_TOLERANCE = 1;\nexport function splitViewport(fold, width, height) {\n const whole = [{ x: 0, y: 0, width, height }];\n const hinge = fold === null || fold === void 0 ? void 0 : fold.hingeBounds;\n if (!(fold === null || fold === void 0 ? void 0 : fold.isSeparating) || !hinge)\n return whole;\n if (fold.hingeOrientation === 'vertical') {\n const right = hinge.x + hinge.width;\n const spansHeight = hinge.y <= EDGE_TOLERANCE && hinge.y + hinge.height >= height - EDGE_TOLERANCE;\n if (!spansHeight || hinge.x <= 0 || right >= width)\n return whole;\n return [\n { x: 0, y: 0, width: hinge.x, height },\n { x: right, y: 0, width: width - right, height },\n ];\n }\n const bottom = hinge.y + hinge.height;\n const spansWidth = hinge.x <= EDGE_TOLERANCE && hinge.x + hinge.width >= width - EDGE_TOLERANCE;\n if (!spansWidth || hinge.y <= 0 || bottom >= height)\n return whole;\n return [\n { x: 0, y: 0, width, height: hinge.y },\n { x: 0, y: bottom, width, height: height - bottom },\n ];\n}\n//# sourceMappingURL=segments.js.map","import { Capacitor } from '@capacitor/core';\nimport { BAR_CLASSES, barClassFor, CSS_CLASSES, cssFor, FOLD_CLASSES, FOLD_VARIABLES, foldCssFor, verticalTabBarBottom, } from './css';\nimport { takeOverKeyboard } from './keyboard';\nimport { splitViewport } from './segments';\nclass DevicePosturePolyfill extends EventTarget {\n constructor() {\n super(...arguments);\n this.onchange = null;\n this.current = 'continuous';\n }\n get type() {\n return this.current;\n }\n update(type) {\n var _a;\n if (type === this.current)\n return;\n this.current = type;\n const event = new Event('change');\n (_a = this.onchange) === null || _a === void 0 ? void 0 : _a.call(this, event);\n this.dispatchEvent(event);\n }\n}\nconst postureOf = (fold) => (fold === null || fold === void 0 ? void 0 : fold.state) === 'half-opened' ? 'folded' : 'continuous';\nlet installation = null;\nexport function install(plugin, options = {}) {\n if (!Capacitor.isNativePlatform())\n return Promise.resolve();\n installation !== null && installation !== void 0 ? installation : (installation = run(plugin, options));\n return installation;\n}\nasync function run(plugin, options) {\n if (options.ionicKeyboard)\n takeOverKeyboard(window, document);\n let fold = null;\n const currentSegments = () => splitViewport(fold, window.innerWidth, window.innerHeight);\n if (!('Viewport' in window)) {\n Object.defineProperty(window, 'viewport', {\n configurable: true,\n value: {\n get segments() {\n return Object.freeze(currentSegments().map((rect) => new DOMRect(rect.x, rect.y, rect.width, rect.height)));\n },\n },\n });\n }\n const posture = 'DevicePosture' in window ? null : new DevicePosturePolyfill();\n if (posture) {\n Object.defineProperty(navigator, 'devicePosture', { configurable: true, value: posture });\n }\n const root = document.documentElement;\n let variables = [];\n const applyCss = () => {\n var _a;\n const css = cssFor(currentSegments(), postureOf(fold));\n for (const name of variables)\n root.style.removeProperty(name);\n variables = Object.keys(css.variables);\n for (const name of variables)\n root.style.setProperty(name, css.variables[name]);\n for (const name of CSS_CLASSES)\n root.classList.toggle(name, css.classes.includes(name));\n const foldCss = foldCssFor(fold === null || fold === void 0 ? void 0 : fold.hingeBounds, fold === null || fold === void 0 ? void 0 : fold.hingeOrientation, fold === null || fold === void 0 ? void 0 : fold.hingeMargins);\n for (const name of FOLD_VARIABLES) {\n if (foldCss.variables[name])\n root.style.setProperty(name, foldCss.variables[name]);\n else\n root.style.removeProperty(name);\n }\n for (const name of FOLD_CLASSES)\n root.classList.toggle(name, name === foldCss.className);\n root.style.setProperty('--vertical-tab-bar-bottom', `${verticalTabBarBottom((_a = fold === null || fold === void 0 ? void 0 : fold.cameraBounds) !== null && _a !== void 0 ? _a : [], window.innerHeight)}px`);\n };\n const apply = (next) => {\n fold = next;\n posture === null || posture === void 0 ? void 0 : posture.update(postureOf(next));\n applyCss();\n // The web view can report the previous window size for a moment after the\n // app moves between displays, so measure again once it has settled.\n requestAnimationFrame(applyCss);\n setTimeout(applyCss, 300);\n };\n const applyBars = ({ verticalBarEdge }) => {\n const active = barClassFor(verticalBarEdge);\n for (const name of BAR_CLASSES)\n root.classList.toggle(name, name === active);\n };\n await plugin.addListener('foldingChange', ({ folding }) => root.classList.toggle('folding', folding));\n window.addEventListener('resize', applyCss);\n await plugin.addListener('foldStateChange', apply);\n await plugin.addListener('barPlacementChange', applyBars);\n apply(await plugin.getFoldState());\n applyBars(await plugin.getBarPlacement());\n}\n//# sourceMappingURL=polyfill.js.map","import { registerPlugin } from '@capacitor/core';\nimport { install } from './polyfill';\nconst Foldable = registerPlugin('Foldable', {\n web: () => import('./web').then((m) => new m.FoldableWeb()),\n});\nconst installFoldablePolyfill = (options) => install(Foldable, options);\nexport * from './definitions';\nexport { Foldable, installFoldablePolyfill };\n//# sourceMappingURL=index.js.map","const MEDIUM_WIDTH = 600;\nconst EXPANDED_WIDTH = 840;\nconst LARGE_WIDTH = 1200;\nconst EXTRA_LARGE_WIDTH = 1600;\nconst MEDIUM_HEIGHT = 480;\nconst EXPANDED_HEIGHT = 900;\nfunction widthClassOf(width) {\n if (width >= EXTRA_LARGE_WIDTH)\n return 'extraLarge';\n if (width >= LARGE_WIDTH)\n return 'large';\n if (width >= EXPANDED_WIDTH)\n return 'expanded';\n if (width >= MEDIUM_WIDTH)\n return 'medium';\n return 'compact';\n}\nfunction heightClassOf(height) {\n if (height >= EXPANDED_HEIGHT)\n return 'expanded';\n if (height >= MEDIUM_HEIGHT)\n return 'medium';\n return 'compact';\n}\nexport function sizeClassOf(width, height) {\n return {\n horizontal: width >= MEDIUM_WIDTH ? 'regular' : 'compact',\n vertical: height >= MEDIUM_HEIGHT ? 'regular' : 'compact',\n widthClass: widthClassOf(width),\n heightClass: heightClassOf(height),\n };\n}\n//# sourceMappingURL=size-class.js.map","import { WebPlugin } from '@capacitor/core';\nimport { sizeClassOf } from './size-class';\nexport class FoldableWeb extends WebPlugin {\n constructor() {\n super();\n this.sizeClass = sizeClassOf(window.innerWidth, window.innerHeight);\n window.addEventListener('resize', () => {\n const next = sizeClassOf(window.innerWidth, window.innerHeight);\n if (JSON.stringify(next) === JSON.stringify(this.sizeClass))\n return;\n this.sizeClass = next;\n this.notifyListeners('sizeClassChange', next);\n });\n }\n async isDeviceFoldable() {\n return { foldable: false, supportsTabletop: false };\n }\n async getFoldState() {\n return { state: 'flat', isSeparating: false, posture: 'flat' };\n }\n async setVerticalBarBehavior() {\n return { applied: false };\n }\n async getReservedRegions() {\n return { regions: [] };\n }\n async getHingeAngle() {\n return { angle: null, status: null };\n }\n async getSizeClass() {\n return sizeClassOf(window.innerWidth, window.innerHeight);\n }\n async getDisplayModes() {\n return { rearDisplay: 'unsupported', dualScreen: 'unsupported' };\n }\n async getBarPlacement() {\n return { verticalBarEdge: null };\n }\n async startRearDisplay() {\n throw this.unavailable('Rear display mode is only available on Android.');\n }\n stopRearDisplay() {\n return Promise.resolve();\n }\n async startDualScreen() {\n throw this.unavailable('Dual-screen mode is only available on Android.');\n }\n stopDualScreen() {\n return Promise.resolve();\n }\n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m/index.js","esm/size-class.js","esm/web.js"],"sourcesContent":["export const CSS_CLASSES = [\n 'horizontal-viewport-segments-2',\n 'vertical-viewport-segments-2',\n 'device-posture-continuous',\n 'device-posture-folded',\n];\nexport const BAR_CLASSES = ['vertical-bars-leading', 'vertical-bars-trailing'];\nexport const FOLD_CLASSES = ['fold-vertical', 'fold-horizontal'];\nexport const FOLD_VARIABLES = [\n '--fold-left',\n '--fold-top',\n '--fold-width',\n '--fold-height',\n '--fold-margin-top',\n '--fold-margin-right',\n '--fold-margin-bottom',\n '--fold-margin-left',\n];\nexport function foldCssFor(hingeBounds, hingeOrientation, hingeMargins) {\n if (!hingeBounds || !hingeOrientation)\n return { variables: {}, className: null };\n const margins = hingeMargins !== null && hingeMargins !== void 0 ? hingeMargins : { top: 0, right: 0, bottom: 0, left: 0 };\n return {\n variables: {\n '--fold-left': `${hingeBounds.x}px`,\n '--fold-top': `${hingeBounds.y}px`,\n '--fold-width': `${hingeBounds.width}px`,\n '--fold-height': `${hingeBounds.height}px`,\n '--fold-margin-top': `${margins.top}px`,\n '--fold-margin-right': `${margins.right}px`,\n '--fold-margin-bottom': `${margins.bottom}px`,\n '--fold-margin-left': `${margins.left}px`,\n },\n className: `fold-${hingeOrientation}`,\n };\n}\nexport function barClassFor(edge) {\n return edge ? `vertical-bars-${edge}` : null;\n}\nconst TAB_BAR_MARGIN = 24;\nconst CAMERA_GAP = 15;\nexport function verticalTabBarBottom(cameras, viewportHeight) {\n const below = cameras.filter((camera) => camera.y > viewportHeight / 2);\n const camera = below.sort((a, b) => a.width * a.height - b.width * b.height)[0];\n if (!camera)\n return TAB_BAR_MARGIN;\n return Math.max(TAB_BAR_MARGIN, Math.round(viewportHeight - camera.y + CAMERA_GAP));\n}\nexport function cssFor(segments, posture) {\n const stacked = segments.length > 1 && segments[1].y > segments[0].y;\n const variables = {};\n segments.forEach((segment, index) => {\n const suffix = stacked ? `0-${index}` : `${index}-0`;\n variables[`--viewport-segment-top-${suffix}`] = `${segment.y}px`;\n variables[`--viewport-segment-left-${suffix}`] = `${segment.x}px`;\n variables[`--viewport-segment-bottom-${suffix}`] = `${segment.y + segment.height}px`;\n variables[`--viewport-segment-right-${suffix}`] = `${segment.x + segment.width}px`;\n variables[`--viewport-segment-width-${suffix}`] = `${segment.width}px`;\n variables[`--viewport-segment-height-${suffix}`] = `${segment.height}px`;\n });\n const classes = [`device-posture-${posture}`];\n if (segments.length > 1) {\n classes.push(stacked ? 'vertical-viewport-segments-2' : 'horizontal-viewport-segments-2');\n }\n return { variables, classes };\n}\n//# sourceMappingURL=css.js.map","export const KEYBOARD_CLASS = 'foldable-keyboard-open';\nconst SHOW_EVENTS = ['keyboardWillShow', 'keyboardDidShow', 'ionKeyboardDidShow'];\nconst isEditing = (element) => !!element &&\n (element.isContentEditable || ['INPUT', 'TEXTAREA', 'SELECT'].includes(element.tagName));\nexport function takeOverKeyboard(target, doc) {\n const classes = doc.documentElement.classList;\n for (const name of SHOW_EVENTS) {\n target.addEventListener(name, (event) => {\n event.stopImmediatePropagation();\n if (isEditing(doc.activeElement))\n classes.add(KEYBOARD_CLASS);\n }, true);\n }\n target.addEventListener('keyboardWillHide', () => classes.remove(KEYBOARD_CLASS), true);\n}\n//# sourceMappingURL=keyboard.js.map","const EDGE_TOLERANCE = 1;\nexport function splitViewport(fold, width, height) {\n const whole = [{ x: 0, y: 0, width, height }];\n const hinge = fold === null || fold === void 0 ? void 0 : fold.hingeBounds;\n if (!(fold === null || fold === void 0 ? void 0 : fold.isSeparating) || !hinge)\n return whole;\n if (fold.hingeOrientation === 'vertical') {\n const right = hinge.x + hinge.width;\n const spansHeight = hinge.y <= EDGE_TOLERANCE && hinge.y + hinge.height >= height - EDGE_TOLERANCE;\n if (!spansHeight || hinge.x <= 0 || right >= width)\n return whole;\n return [\n { x: 0, y: 0, width: hinge.x, height },\n { x: right, y: 0, width: width - right, height },\n ];\n }\n const bottom = hinge.y + hinge.height;\n const spansWidth = hinge.x <= EDGE_TOLERANCE && hinge.x + hinge.width >= width - EDGE_TOLERANCE;\n if (!spansWidth || hinge.y <= 0 || bottom >= height)\n return whole;\n return [\n { x: 0, y: 0, width, height: hinge.y },\n { x: 0, y: bottom, width, height: height - bottom },\n ];\n}\n//# sourceMappingURL=segments.js.map","import { Capacitor } from '@capacitor/core';\nimport { BAR_CLASSES, barClassFor, CSS_CLASSES, cssFor, FOLD_CLASSES, FOLD_VARIABLES, foldCssFor, verticalTabBarBottom, } from './css';\nimport { takeOverKeyboard } from './keyboard';\nimport { splitViewport } from './segments';\nclass DevicePosturePolyfill extends EventTarget {\n constructor() {\n super(...arguments);\n this.onchange = null;\n this.current = 'continuous';\n }\n get type() {\n return this.current;\n }\n update(type) {\n var _a;\n if (type === this.current)\n return;\n this.current = type;\n const event = new Event('change');\n (_a = this.onchange) === null || _a === void 0 ? void 0 : _a.call(this, event);\n this.dispatchEvent(event);\n }\n}\nconst postureOf = (fold) => (fold === null || fold === void 0 ? void 0 : fold.state) === 'half-opened' ? 'folded' : 'continuous';\nlet installation = null;\nexport function install(plugin, options = {}) {\n if (!Capacitor.isNativePlatform())\n return Promise.resolve();\n installation !== null && installation !== void 0 ? installation : (installation = run(plugin, options));\n return installation;\n}\nasync function run(plugin, options) {\n if (options.ionicKeyboard)\n takeOverKeyboard(window, document);\n let fold = null;\n const currentSegments = () => splitViewport(fold, window.innerWidth, window.innerHeight);\n if (!('Viewport' in window)) {\n Object.defineProperty(window, 'viewport', {\n configurable: true,\n value: {\n get segments() {\n return Object.freeze(currentSegments().map((rect) => new DOMRect(rect.x, rect.y, rect.width, rect.height)));\n },\n },\n });\n }\n const posture = 'DevicePosture' in window ? null : new DevicePosturePolyfill();\n if (posture) {\n Object.defineProperty(navigator, 'devicePosture', { configurable: true, value: posture });\n }\n const root = document.documentElement;\n let variables = [];\n const applyCss = () => {\n var _a;\n const css = cssFor(currentSegments(), postureOf(fold));\n for (const name of variables)\n root.style.removeProperty(name);\n variables = Object.keys(css.variables);\n for (const name of variables)\n root.style.setProperty(name, css.variables[name]);\n for (const name of CSS_CLASSES)\n root.classList.toggle(name, css.classes.includes(name));\n const foldCss = foldCssFor(fold === null || fold === void 0 ? void 0 : fold.hingeBounds, fold === null || fold === void 0 ? void 0 : fold.hingeOrientation, fold === null || fold === void 0 ? void 0 : fold.hingeMargins);\n for (const name of FOLD_VARIABLES) {\n if (foldCss.variables[name])\n root.style.setProperty(name, foldCss.variables[name]);\n else\n root.style.removeProperty(name);\n }\n for (const name of FOLD_CLASSES)\n root.classList.toggle(name, name === foldCss.className);\n root.style.setProperty('--vertical-tab-bar-bottom', `${verticalTabBarBottom((_a = fold === null || fold === void 0 ? void 0 : fold.cameraBounds) !== null && _a !== void 0 ? _a : [], window.innerHeight)}px`);\n };\n const apply = (next) => {\n fold = next;\n posture === null || posture === void 0 ? void 0 : posture.update(postureOf(next));\n applyCss();\n // The web view can report the previous window size for a moment after the\n // app moves between displays, so measure again once it has settled.\n requestAnimationFrame(applyCss);\n setTimeout(applyCss, 300);\n };\n const applyBars = ({ verticalBarEdge }) => {\n const active = barClassFor(verticalBarEdge);\n for (const name of BAR_CLASSES)\n root.classList.toggle(name, name === active);\n };\n await plugin.addListener('foldingChange', ({ folding }) => root.classList.toggle('folding', folding));\n window.addEventListener('resize', applyCss);\n await plugin.addListener('foldStateChange', apply);\n await plugin.addListener('barPlacementChange', applyBars);\n apply(await plugin.getFoldState());\n applyBars(await plugin.getBarPlacement());\n}\n//# sourceMappingURL=polyfill.js.map","import { registerPlugin } from '@capacitor/core';\nimport { install } from './polyfill';\nconst Foldable = registerPlugin('Foldable', {\n web: () => import('./web').then((m) => new m.FoldableWeb()),\n});\nconst installFoldablePolyfill = (options) => install(Foldable, options);\nexport * from './definitions';\nexport { Foldable, installFoldablePolyfill };\n//# sourceMappingURL=index.js.map","const MEDIUM_WIDTH = 600;\nconst EXPANDED_WIDTH = 840;\nconst LARGE_WIDTH = 1200;\nconst EXTRA_LARGE_WIDTH = 1600;\nconst MEDIUM_HEIGHT = 480;\nconst EXPANDED_HEIGHT = 900;\nfunction widthClassOf(width) {\n if (width >= EXTRA_LARGE_WIDTH)\n return 'extraLarge';\n if (width >= LARGE_WIDTH)\n return 'large';\n if (width >= EXPANDED_WIDTH)\n return 'expanded';\n if (width >= MEDIUM_WIDTH)\n return 'medium';\n return 'compact';\n}\nfunction heightClassOf(height) {\n if (height >= EXPANDED_HEIGHT)\n return 'expanded';\n if (height >= MEDIUM_HEIGHT)\n return 'medium';\n return 'compact';\n}\nexport function sizeClassOf(width, height) {\n return {\n horizontal: width >= MEDIUM_WIDTH ? 'regular' : 'compact',\n vertical: height >= MEDIUM_HEIGHT ? 'regular' : 'compact',\n widthClass: widthClassOf(width),\n heightClass: heightClassOf(height),\n };\n}\n//# sourceMappingURL=size-class.js.map","import { WebPlugin } from '@capacitor/core';\nimport { sizeClassOf } from './size-class';\nexport class FoldableWeb extends WebPlugin {\n constructor() {\n super();\n this.sizeClass = sizeClassOf(window.innerWidth, window.innerHeight);\n window.addEventListener('resize', () => {\n const next = sizeClassOf(window.innerWidth, window.innerHeight);\n if (JSON.stringify(next) === JSON.stringify(this.sizeClass))\n return;\n this.sizeClass = next;\n this.notifyListeners('sizeClassChange', next);\n });\n }\n async isDeviceFoldable() {\n return { foldable: false, supportsTabletop: false };\n }\n async getFoldState() {\n return { state: 'flat', isSeparating: false, posture: 'flat' };\n }\n async setVerticalBarBehavior() {\n return { applied: false };\n }\n async getReservedRegions() {\n return { regions: [] };\n }\n async getHingeAngle() {\n return { angle: null, status: null };\n }\n async getSizeClass() {\n return sizeClassOf(window.innerWidth, window.innerHeight);\n }\n async getDisplayModes() {\n return { rearDisplay: 'unsupported', dualScreen: 'unsupported' };\n }\n async getBarPlacement() {\n return { verticalBarEdge: null, inset: 0 };\n }\n async startRearDisplay() {\n throw this.unavailable('Rear display mode is only available on Android.');\n }\n stopRearDisplay() {\n return Promise.resolve();\n }\n async startDualScreen() {\n throw this.unavailable('Dual-screen mode is only available on Android.');\n }\n stopDualScreen() {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FoldProvider: FoldProvider {
129
129
 
130
130
  @objc public func barPlacement(in traits: UITraitCollection, view: UIView? = nil) -> [String: Any] {
131
131
  let edge = verticalBarEdge(of: traits) ?? view.flatMap(verticalBarEdge(inferredFrom:))
132
- return ["verticalBarEdge": edge.map { $0 as Any } ?? NSNull()]
132
+ let inset = view.map { barInset(of: edge, in: $0) } ?? 0
133
+ return [
134
+ "verticalBarEdge": edge.map { $0 as Any } ?? NSNull(),
135
+ "inset": inset
136
+ ]
137
+ }
138
+
139
+ private func barInset(of edge: String?, in view: UIView) -> Double {
140
+ guard let edge else { return 0 }
141
+
142
+ view.layoutIfNeeded()
143
+ let rightToLeft = view.effectiveUserInterfaceLayoutDirection == .rightToLeft
144
+ let onRight = (edge == "trailing") != rightToLeft
145
+ return Double((onRight ? view.safeAreaInsets.right : view.safeAreaInsets.left).rounded())
133
146
  }
134
147
 
135
148
  private func verticalBarEdge(of traits: UITraitCollection) -> String? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erkamyaman/capacitor-foldable",
3
- "version": "8.3.2",
3
+ "version": "8.3.3",
4
4
  "description": "Fold-state and dual-display APIs for foldable devices in Capacitor apps",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -72,10 +72,11 @@ Apple's compact and regular plus Material's window classes. On iOS the first pai
72
72
  ## Where the system put its bars
73
73
 
74
74
  ```typescript
75
- const { verticalBarEdge } = await Foldable.getBarPlacement(); // 'leading' | 'trailing' | null
75
+ const { verticalBarEdge, inset } = await Foldable.getBarPlacement();
76
+ // verticalBarEdge: 'leading' | 'trailing' | null, inset: points the bar takes
76
77
  ```
77
78
 
78
- `null` means no vertical bar edge is reported: bars are horizontal, or the platform cannot say, which is always the case on Android, web and iOS before 27.1. An app built with an Xcode older than 27.1 cannot read the trait that names the edge, so the plugin infers it from the safe-area inset the bar leaves. On iPhone Duo the bar also arrives as a safe-area inset, so simple layouts need nothing beyond `env(safe-area-inset-*)`. Use this when positioning your own chrome to match. `barPlacementChange` fires when it moves.
79
+ `null` means no vertical bar edge is reported: bars are horizontal, or the platform cannot say, which is always the case on Android, web and iOS before 27.1. An app built with an Xcode older than 27.1 cannot read the trait that names the edge, so the plugin infers it from the safe-area inset the bar leaves. On iPhone Duo the bar also arrives as a safe-area inset, so simple layouts need nothing beyond `env(safe-area-inset-*)`. Use this when positioning your own chrome to match. `inset` is how many points the bar takes on its edge, measured rather than assumed, and `0` when no bar is reported: read it instead of hard-coding a width, since it differs when the bar is disabled and Apple can change it. `barPlacementChange` fires when either one moves.
79
80
 
80
81
  ```typescript
81
82
  await Foldable.setVerticalBarBehavior({ behavior: 'disabled' }); // everything horizontal