@rdlabo/ionic-theme-ios27 1.2.1-beta.pr275.shad339e7688db7 → 2.0.0-1

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.
Files changed (248) hide show
  1. package/README.md +24 -280
  2. package/dist/css/components/ion-toolbar.css +1 -1
  3. package/dist/css/ionic-theme-ios27.css +1 -1
  4. package/dist/css/vertical-bars.css +1 -1
  5. package/dist/index.d.ts +3 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +3 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/layout/index.d.ts +18 -0
  10. package/dist/layout/index.d.ts.map +1 -0
  11. package/dist/layout/index.js +26 -0
  12. package/dist/layout/index.js.map +1 -0
  13. package/dist/segment/index.js +3 -3
  14. package/dist/segment/index.js.map +1 -1
  15. package/dist/sheets-of-glass/index.js +7 -7
  16. package/dist/sheets-of-glass/index.js.map +1 -1
  17. package/dist/tab-bar-searchable/dismiss-button.js +53 -3
  18. package/dist/tab-bar-searchable/dismiss-button.js.map +1 -1
  19. package/dist/tab-bar-searchable/index.js +18 -3
  20. package/dist/tab-bar-searchable/index.js.map +1 -1
  21. package/dist/transition/ios.transition.d.ts.map +1 -1
  22. package/dist/transition/ios.transition.js +7 -4
  23. package/dist/transition/ios.transition.js.map +1 -1
  24. package/dist/transition/native-ui.d.ts +6 -0
  25. package/dist/transition/native-ui.d.ts.map +1 -0
  26. package/dist/{native-integration/index.js → transition/native-ui.js} +16 -30
  27. package/dist/transition/native-ui.js.map +1 -0
  28. package/docs/adaptive-themes.md +161 -0
  29. package/docs/add-native-ui.md +53 -0
  30. package/docs/animation.md +19 -3
  31. package/docs/eslint.md +3 -1
  32. package/docs/features.md +9 -5
  33. package/docs/iphone-duo.md +62 -35
  34. package/docs/migration.md +17 -26
  35. package/docs/setup.md +92 -0
  36. package/docs/special-markup.md +41 -10
  37. package/docs/using-ion-item-group.md +2 -2
  38. package/docs/vertical-bars-layout.md +67 -0
  39. package/package.json +12 -42
  40. package/src/index.ts +3 -1
  41. package/src/layout/index.ts +29 -0
  42. package/src/segment/index.ts +3 -3
  43. package/src/sheets-of-glass/index.ts +7 -7
  44. package/src/styles/components/ion-toolbar.scss +1 -1
  45. package/src/styles/vertical-bars.scss +15 -18
  46. package/src/tab-bar-searchable/dismiss-button.ts +73 -4
  47. package/src/tab-bar-searchable/index.ts +20 -3
  48. package/src/transition/ios.transition.ts +7 -4
  49. package/src/{native-integration/index.ts → transition/native-ui.ts} +17 -46
  50. package/Package.swift +0 -21
  51. package/dist/_virtual/_rolldown/runtime.js +0 -13
  52. package/dist/native/components/index.d.ts +0 -19
  53. package/dist/native/components/index.d.ts.map +0 -1
  54. package/dist/native/components/index.js +0 -40
  55. package/dist/native/components/index.js.map +0 -1
  56. package/dist/native/components/ion-back-button.d.ts +0 -9
  57. package/dist/native/components/ion-back-button.d.ts.map +0 -1
  58. package/dist/native/components/ion-back-button.js +0 -20
  59. package/dist/native/components/ion-back-button.js.map +0 -1
  60. package/dist/native/components/ion-button.d.ts +0 -10
  61. package/dist/native/components/ion-button.d.ts.map +0 -1
  62. package/dist/native/components/ion-button.js +0 -23
  63. package/dist/native/components/ion-button.js.map +0 -1
  64. package/dist/native/components/ion-buttons.d.ts +0 -11
  65. package/dist/native/components/ion-buttons.d.ts.map +0 -1
  66. package/dist/native/components/ion-buttons.js +0 -30
  67. package/dist/native/components/ion-buttons.js.map +0 -1
  68. package/dist/native/components/ion-fab.d.ts +0 -10
  69. package/dist/native/components/ion-fab.d.ts.map +0 -1
  70. package/dist/native/components/ion-fab.js +0 -132
  71. package/dist/native/components/ion-fab.js.map +0 -1
  72. package/dist/native/components/ion-menu-button.d.ts +0 -13
  73. package/dist/native/components/ion-menu-button.d.ts.map +0 -1
  74. package/dist/native/components/ion-menu-button.js +0 -31
  75. package/dist/native/components/ion-menu-button.js.map +0 -1
  76. package/dist/native/components/ion-segment.d.ts +0 -11
  77. package/dist/native/components/ion-segment.d.ts.map +0 -1
  78. package/dist/native/components/ion-segment.js +0 -30
  79. package/dist/native/components/ion-segment.js.map +0 -1
  80. package/dist/native/components/ion-tab-bar.d.ts +0 -11
  81. package/dist/native/components/ion-tab-bar.d.ts.map +0 -1
  82. package/dist/native/components/ion-tab-bar.js +0 -50
  83. package/dist/native/components/ion-tab-bar.js.map +0 -1
  84. package/dist/native/components/searchable-tabs.d.ts +0 -20
  85. package/dist/native/components/searchable-tabs.d.ts.map +0 -1
  86. package/dist/native/components/searchable-tabs.js +0 -383
  87. package/dist/native/components/searchable-tabs.js.map +0 -1
  88. package/dist/native/definitions.d.ts +0 -191
  89. package/dist/native/definitions.d.ts.map +0 -1
  90. package/dist/native/definitions.js +0 -0
  91. package/dist/native/foldable/fold-state.d.ts +0 -5
  92. package/dist/native/foldable/fold-state.d.ts.map +0 -1
  93. package/dist/native/foldable/fold-state.js +0 -14
  94. package/dist/native/foldable/fold-state.js.map +0 -1
  95. package/dist/native/foldable/types.d.ts +0 -12
  96. package/dist/native/foldable/types.d.ts.map +0 -1
  97. package/dist/native/foldable/types.js +0 -0
  98. package/dist/native/index.d.ts +0 -11
  99. package/dist/native/index.d.ts.map +0 -1
  100. package/dist/native/index.js +0 -267
  101. package/dist/native/index.js.map +0 -1
  102. package/dist/native/overlays/content.d.ts +0 -4
  103. package/dist/native/overlays/content.d.ts.map +0 -1
  104. package/dist/native/overlays/content.js +0 -51
  105. package/dist/native/overlays/content.js.map +0 -1
  106. package/dist/native/overlays/controller.d.ts +0 -8
  107. package/dist/native/overlays/controller.d.ts.map +0 -1
  108. package/dist/native/overlays/controller.js +0 -285
  109. package/dist/native/overlays/controller.js.map +0 -1
  110. package/dist/native/overlays/dialog-animation.d.ts +0 -9
  111. package/dist/native/overlays/dialog-animation.d.ts.map +0 -1
  112. package/dist/native/overlays/dialog-animation.js +0 -53
  113. package/dist/native/overlays/dialog-animation.js.map +0 -1
  114. package/dist/native/overlays/dismiss-animation.d.ts +0 -4
  115. package/dist/native/overlays/dismiss-animation.d.ts.map +0 -1
  116. package/dist/native/overlays/dismiss-animation.js +0 -18
  117. package/dist/native/overlays/dismiss-animation.js.map +0 -1
  118. package/dist/native/overlays/focus.d.ts +0 -5
  119. package/dist/native/overlays/focus.d.ts.map +0 -1
  120. package/dist/native/overlays/focus.js +0 -59
  121. package/dist/native/overlays/focus.js.map +0 -1
  122. package/dist/native/overlays/popover.d.ts +0 -12
  123. package/dist/native/overlays/popover.d.ts.map +0 -1
  124. package/dist/native/overlays/popover.js +0 -110
  125. package/dist/native/overlays/popover.js.map +0 -1
  126. package/dist/native/overlays/styles.d.ts +0 -11
  127. package/dist/native/overlays/styles.d.ts.map +0 -1
  128. package/dist/native/overlays/styles.js +0 -167
  129. package/dist/native/overlays/styles.js.map +0 -1
  130. package/dist/native/prehide.d.ts +0 -7
  131. package/dist/native/prehide.d.ts.map +0 -1
  132. package/dist/native/prehide.js +0 -230
  133. package/dist/native/prehide.js.map +0 -1
  134. package/dist/native/runtime.d.ts +0 -7
  135. package/dist/native/runtime.d.ts.map +0 -1
  136. package/dist/native/runtime.js +0 -710
  137. package/dist/native/runtime.js.map +0 -1
  138. package/dist/native/shared/bridge.d.ts +0 -6
  139. package/dist/native/shared/bridge.d.ts.map +0 -1
  140. package/dist/native/shared/bridge.js +0 -18
  141. package/dist/native/shared/bridge.js.map +0 -1
  142. package/dist/native/shared/candidate.d.ts +0 -21
  143. package/dist/native/shared/candidate.d.ts.map +0 -1
  144. package/dist/native/shared/candidate.js +0 -98
  145. package/dist/native/shared/candidate.js.map +0 -1
  146. package/dist/native/shared/crossfade.d.ts +0 -12
  147. package/dist/native/shared/crossfade.d.ts.map +0 -1
  148. package/dist/native/shared/crossfade.js +0 -67
  149. package/dist/native/shared/crossfade.js.map +0 -1
  150. package/dist/native/shared/dom.d.ts +0 -46
  151. package/dist/native/shared/dom.d.ts.map +0 -1
  152. package/dist/native/shared/dom.js +0 -172
  153. package/dist/native/shared/dom.js.map +0 -1
  154. package/dist/native/shared/events.d.ts +0 -11
  155. package/dist/native/shared/events.d.ts.map +0 -1
  156. package/dist/native/shared/events.js +0 -13
  157. package/dist/native/shared/events.js.map +0 -1
  158. package/dist/native/shared/icons.d.ts +0 -8
  159. package/dist/native/shared/icons.d.ts.map +0 -1
  160. package/dist/native/shared/icons.js +0 -61
  161. package/dist/native/shared/icons.js.map +0 -1
  162. package/dist/native/shared/modal.d.ts +0 -10
  163. package/dist/native/shared/modal.d.ts.map +0 -1
  164. package/dist/native/shared/modal.js +0 -160
  165. package/dist/native/shared/modal.js.map +0 -1
  166. package/dist/native/shared/projection-id.d.ts +0 -4
  167. package/dist/native/shared/projection-id.d.ts.map +0 -1
  168. package/dist/native/shared/projection-id.js +0 -7
  169. package/dist/native/shared/projection-id.js.map +0 -1
  170. package/dist/native/shared/vertical-bars-geometry.d.ts +0 -10
  171. package/dist/native/shared/vertical-bars-geometry.d.ts.map +0 -1
  172. package/dist/native/shared/vertical-bars-geometry.js +0 -85
  173. package/dist/native/shared/vertical-bars-geometry.js.map +0 -1
  174. package/dist/native/vertical-bars-web-search.d.ts +0 -10
  175. package/dist/native/vertical-bars-web-search.d.ts.map +0 -1
  176. package/dist/native/vertical-bars-web-search.js +0 -90
  177. package/dist/native/vertical-bars-web-search.js.map +0 -1
  178. package/dist/native/vertical-bars-web.d.ts +0 -5
  179. package/dist/native/vertical-bars-web.d.ts.map +0 -1
  180. package/dist/native/vertical-bars-web.js +0 -411
  181. package/dist/native/vertical-bars-web.js.map +0 -1
  182. package/dist/native-integration/index.d.ts +0 -23
  183. package/dist/native-integration/index.d.ts.map +0 -1
  184. package/dist/native-integration/index.js.map +0 -1
  185. package/dist/native-integration/transition.d.ts +0 -5
  186. package/dist/native-integration/transition.d.ts.map +0 -1
  187. package/dist/native-integration/transition.js +0 -16
  188. package/dist/native-integration/transition.js.map +0 -1
  189. package/dist/vertical-bars.d.ts +0 -5
  190. package/dist/vertical-bars.js +0 -4
  191. package/docs/e2e-testing.md +0 -51
  192. package/docs/feedback.md +0 -65
  193. package/docs/iphone-duo-with-original-theme.md +0 -158
  194. package/docs/native-ui-shell.md +0 -325
  195. package/docs/vertical-bars.md +0 -300
  196. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellButton.swift +0 -71
  197. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellButtons.swift +0 -24
  198. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellComponents.swift +0 -18
  199. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellFab.swift +0 -80
  200. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellSearchController.swift +0 -432
  201. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellSegment.swift +0 -91
  202. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellTabBar.swift +0 -218
  203. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellVerticalBars.swift +0 -565
  204. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellVerticalSearch.swift +0 -118
  205. package/ios/Sources/IonicNativeUIShellPlugin/IonicNativeUIShellPlugin.swift +0 -502
  206. package/ios/Sources/IonicNativeUIShellPlugin/Overlays/ShellOverlayController.swift +0 -119
  207. package/ios/Sources/IonicNativeUIShellPlugin/Overlays/ShellOverlayHost.swift +0 -75
  208. package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellCrossfade.swift +0 -35
  209. package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellHost.swift +0 -8
  210. package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellRendering.swift +0 -27
  211. package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellSnapshot.swift +0 -135
  212. package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellVerticalBarsGeometry.swift +0 -52
  213. package/ios/Tests/IonicNativeUIShellPluginTests/ShellSnapshotTests.swift +0 -788
  214. package/src/native/components/index.ts +0 -53
  215. package/src/native/components/ion-back-button.ts +0 -19
  216. package/src/native/components/ion-button.ts +0 -24
  217. package/src/native/components/ion-buttons.ts +0 -38
  218. package/src/native/components/ion-fab.ts +0 -151
  219. package/src/native/components/ion-menu-button.ts +0 -24
  220. package/src/native/components/ion-segment.ts +0 -27
  221. package/src/native/components/ion-tab-bar.ts +0 -50
  222. package/src/native/components/searchable-tabs.ts +0 -459
  223. package/src/native/definitions.ts +0 -218
  224. package/src/native/foldable/fold-state.ts +0 -9
  225. package/src/native/foldable/types.ts +0 -4
  226. package/src/native/index.ts +0 -315
  227. package/src/native/overlays/content.ts +0 -51
  228. package/src/native/overlays/controller.ts +0 -349
  229. package/src/native/overlays/dialog-animation.ts +0 -53
  230. package/src/native/overlays/dismiss-animation.ts +0 -15
  231. package/src/native/overlays/focus.ts +0 -64
  232. package/src/native/overlays/popover.ts +0 -120
  233. package/src/native/overlays/styles.ts +0 -181
  234. package/src/native/prehide.ts +0 -265
  235. package/src/native/runtime.ts +0 -885
  236. package/src/native/shared/bridge.ts +0 -18
  237. package/src/native/shared/candidate.ts +0 -150
  238. package/src/native/shared/crossfade.ts +0 -67
  239. package/src/native/shared/dom.ts +0 -286
  240. package/src/native/shared/events.ts +0 -8
  241. package/src/native/shared/icons.ts +0 -57
  242. package/src/native/shared/modal.ts +0 -157
  243. package/src/native/shared/projection-id.ts +0 -2
  244. package/src/native/shared/vertical-bars-geometry.ts +0 -80
  245. package/src/native/vertical-bars-web-search.ts +0 -86
  246. package/src/native/vertical-bars-web.ts +0 -485
  247. package/src/native-integration/transition.ts +0 -15
  248. package/src/vertical-bars.ts +0 -11
@@ -1 +0,0 @@
1
- {"version":3,"file":"fold-state.js","names":[],"sources":["../../../src/native/foldable/fold-state.ts"],"sourcesContent":["import type { FoldState } from './types';\n\n/** Keep posture on ion-app so descendants can follow it through CSS. */\nexport function applyFoldStateClasses(root: HTMLElement, fold: FoldState): void {\n for (const state of ['flat', 'half-opened', 'closed']) {\n root.classList.toggle(`ios-theme-fold-${state}`, fold.state === state);\n }\n root.classList.toggle('ios-theme-fold-expanded', fold.state === 'half-opened' || (fold.state === 'flat' && !!fold.hingeBounds));\n}\n"],"mappings":";;AAGA,SAAgB,sBAAsB,MAAmB,MAAuB;CAC9E,KAAK,MAAM,SAAS;EAAC;EAAQ;EAAe;CAAQ,GAClD,KAAK,UAAU,OAAO,kBAAkB,SAAS,KAAK,UAAU,KAAK;CAEvE,KAAK,UAAU,OAAO,2BAA2B,KAAK,UAAU,iBAAkB,KAAK,UAAU,UAAU,CAAC,CAAC,KAAK,WAAY;AAChI"}
@@ -1,12 +0,0 @@
1
- //#region src/native/foldable/types.d.ts
2
- export interface FoldState {
3
- state: 'flat' | 'half-opened' | 'closed';
4
- hingeBounds?: {
5
- x: number;
6
- y: number;
7
- width: number;
8
- height: number;
9
- };
10
- }
11
- //#endregion
12
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/native/foldable/types.ts"],"mappings":";iBAAiB;EACf;EACA;IAAgB;IAAW;IAAW;IAAe"}
File without changes
@@ -1,11 +0,0 @@
1
- import { NativeUIShellControls, NativeUIShellHandle, NativeUIShellOptions, NativeUIShellPlugin, NativeUIShellStatus, NativeUIShellSuspension, VerticalBarEdge, VerticalBarPlacement, VerticalControlAreaHandle, VerticalControlAreaOptions, WebViewMetrics } from "./definitions.js";
2
- import { NativeUIShellComponent } from "./components/index.js";
3
- //#region src/native/index.d.ts
4
- export declare const IonicNativeUIShell: NativeUIShellPlugin;
5
- export declare const configureNativeTransition: () => Promise<WebViewMetrics>;
6
- export declare const setVerticalControlAreaPlacement: (placement: VerticalBarEdge | VerticalBarPlacement, rtl?: boolean) => void;
7
- export declare const enableVerticalControlArea: (options?: VerticalControlAreaOptions) => Promise<VerticalControlAreaHandle>;
8
- export declare const enableNativeUIShell: (options?: NativeUIShellOptions) => Promise<NativeUIShellHandle>;
9
- //#endregion
10
- export type { NativeUIShellComponent, NativeUIShellControls, NativeUIShellHandle, NativeUIShellOptions, NativeUIShellStatus, NativeUIShellSuspension, VerticalBarEdge, VerticalBarPlacement, VerticalControlAreaHandle, VerticalControlAreaOptions, WebViewMetrics };
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/native/index.ts"],"mappings":";;;qBAiCa,oBAAkB;qBAqFlB,iCAAsC,QAAQ;qBAkD9C,kCAAmC,WAAW,kBAAkB,sBAAsB;qBAqBtF,4BAAmC,UAAS,+BAAkC,QAAQ;qBAgBtF,sBAAuB,UAAS,yBAA4B,QAAQ"}
@@ -1,267 +0,0 @@
1
- import { setConfig } from "../transition/ios.transition.js";
2
- import { bounded, boundedListener } from "./shared/bridge.js";
3
- import { observeVerticalBarsModals } from "./shared/modal.js";
4
- import { createRuntime } from "./runtime.js";
5
- import { createOverlayController } from "./overlays/controller.js";
6
- import { createVerticalBarsWebProjection } from "./vertical-bars-web.js";
7
- import { prehideVerticalBarsToolbarSources } from "./prehide.js";
8
- import { Capacitor, registerPlugin } from "@capacitor/core";
9
- //#region src/native/index.ts
10
- const plugin = registerPlugin("IonicNativeUIShell");
11
- const IonicNativeUIShell = plugin;
12
- let active;
13
- let activeConfiguration;
14
- let stopping;
15
- const stopActivation = (owner, destruction) => {
16
- if (active !== owner) return;
17
- active = void 0;
18
- activeConfiguration = void 0;
19
- stopping = destruction;
20
- const release = () => {
21
- if (stopping === destruction) stopping = void 0;
22
- };
23
- destruction.then(release, release);
24
- };
25
- const web = (reason) => ({
26
- getStatus: () => ({
27
- state: "web",
28
- projected: 0,
29
- updates: 0,
30
- reason
31
- }),
32
- suspend: async () => ({ resume: async () => {} }),
33
- destroy: async () => {}
34
- });
35
- const combine = (native, fallback) => ({
36
- getStatus() {
37
- const nativeStatus = native.getStatus();
38
- const fallbackStatus = fallback.getStatus();
39
- return {
40
- ...nativeStatus,
41
- state: nativeStatus.state === "stopped" && fallbackStatus.state === "stopped" ? "stopped" : nativeStatus.projected > 0 ? "native" : "web",
42
- projected: nativeStatus.projected + fallbackStatus.projected,
43
- updates: nativeStatus.updates + fallbackStatus.updates
44
- };
45
- },
46
- async suspend() {
47
- const [nativeLease, fallbackLease] = await Promise.all([native.suspend(), fallback.suspend()]);
48
- return { resume: async () => void await Promise.all([nativeLease.resume(), fallbackLease.resume()]) };
49
- },
50
- async destroy() {
51
- await Promise.all([native.destroy(), fallback.destroy()]);
52
- }
53
- });
54
- /** Wraps a runtime handle with the shared enable-lifecycle: reason, suspend hooks and idempotent destroy. */
55
- const manage = (handle, lifecycle = {}) => {
56
- let destruction;
57
- return {
58
- getStatus: () => lifecycle.reason ? {
59
- ...handle.getStatus(),
60
- reason: lifecycle.reason
61
- } : handle.getStatus(),
62
- async suspend() {
63
- const lease = await handle.suspend();
64
- const resume = await lifecycle.suspend?.();
65
- return { async resume() {
66
- await lease.resume();
67
- resume?.();
68
- } };
69
- },
70
- destroy() {
71
- if (!destruction) {
72
- destruction = Promise.resolve().then(async () => {
73
- try {
74
- await handle.destroy();
75
- } finally {
76
- await lifecycle.destroy?.();
77
- }
78
- });
79
- lifecycle.stopping?.(destruction);
80
- }
81
- return destruction;
82
- }
83
- };
84
- };
85
- /** Reads the current native WebView geometry and applies it to page transitions. */
86
- const configureNativeTransition = async () => {
87
- const metrics = typeof document !== "undefined" && Capacitor.getPlatform() === "ios" ? await bounded(plugin.getWebViewMetrics()) : { radius: 0 };
88
- setConfig({ radius: metrics.radius });
89
- return metrics;
90
- };
91
- /** Resolves a logical vertical-bar edge to the physical side for the given direction. */
92
- const physicalVerticalBarEdge = (edge, rtl) => edge === "leading" !== rtl ? "left" : "right";
93
- const elementRtl = (element) => element.closest("[dir]")?.getAttribute("dir") === "rtl";
94
- const nativePlacements = /* @__PURE__ */ new WeakMap();
95
- const horizontalFallbackAttribute = "data-native-ui-shell-vertical-bars-suspended";
96
- const observeNativeVerticalBarsLayout = (doc) => {
97
- const reconcile = () => {
98
- const app = doc.querySelector("ion-app");
99
- if (!app) return;
100
- const requested = app.classList.contains("ios-theme-vertical-bars") || app.hasAttribute(horizontalFallbackAttribute);
101
- const suspended = requested && nativePlacements.get(app)?.edge == null;
102
- if (app.hasAttribute(horizontalFallbackAttribute) !== suspended) app.toggleAttribute(horizontalFallbackAttribute, suspended);
103
- if (app.classList.contains("ios-theme-vertical-bars") !== (requested && !suspended)) app.classList.toggle("ios-theme-vertical-bars", requested && !suspended);
104
- };
105
- const observer = new MutationObserver(reconcile);
106
- observer.observe(doc.documentElement, {
107
- childList: true,
108
- subtree: true,
109
- attributes: true,
110
- attributeFilter: ["class"]
111
- });
112
- doc.defaultView?.addEventListener("nativeUIShellRefresh", reconcile);
113
- reconcile();
114
- return () => {
115
- observer.disconnect();
116
- doc.defaultView?.removeEventListener("nativeUIShellRefresh", reconcile);
117
- const app = doc.querySelector(`ion-app[${horizontalFallbackAttribute}]`);
118
- if (app) {
119
- app.removeAttribute(horizontalFallbackAttribute);
120
- app.classList.add("ios-theme-vertical-bars");
121
- }
122
- };
123
- };
124
- /**
125
- * Applies one placement to the CSS layout and both Web/native projections.
126
- * Pass `rtl` when the document direction is known; otherwise the nearest `dir` attribute is used.
127
- */
128
- const setVerticalControlAreaPlacement = (placement, rtl) => {
129
- if (typeof document === "undefined") return;
130
- const app = document.querySelector("ion-app");
131
- if (!app) throw new Error("Vertical Control Area requires ion-app");
132
- const { edge, inset = 0 } = placement && typeof placement === "object" ? placement : {
133
- edge: placement,
134
- inset: 0
135
- };
136
- if (placement && typeof placement === "object" && placement.nativeEdge !== void 0) nativePlacements.set(app, {
137
- edge: placement.nativeEdge,
138
- rtl
139
- });
140
- app.removeAttribute(horizontalFallbackAttribute);
141
- app.classList.toggle("ios-theme-vertical-bars", edge !== null);
142
- app.classList.toggle("ios-theme-vertical-bars-left", edge !== null && physicalVerticalBarEdge(edge, rtl ?? elementRtl(app)) === "left");
143
- if (edge && Number.isFinite(inset) && inset > 0) app.style.setProperty("--ios-theme-vertical-bars-native-inset", `${inset}px`);
144
- else app.style.removeProperty("--ios-theme-vertical-bars-native-inset");
145
- document.defaultView?.dispatchEvent(new Event("nativeUIShellRefresh"));
146
- };
147
- /**
148
- * Call once after ion-app is mounted. Ionic markup remains the source of truth.
149
- * Native vertical buttons default to SwiftUI appearance.
150
- * See VerticalControlAreaOptions for source styling and local overrides.
151
- */
152
- const enableVerticalControlArea = async (options = {}) => {
153
- const handle = await enableNativeUIShell({
154
- buttonProjection: options.buttonProjection,
155
- buttonDefaultFill: options.buttonDefaultFill,
156
- controls: {
157
- tabs: true,
158
- toolbar: true,
159
- popover: options.controls?.popover === true
160
- },
161
- verticalBarsOnly: true
162
- });
163
- return {
164
- getStatus: () => handle.getStatus(),
165
- suspend: () => handle.suspend(),
166
- destroy: () => handle.destroy(),
167
- setPlacement: setVerticalControlAreaPlacement
168
- };
169
- };
170
- /** Call once at application startup. Ionic markup remains the source of truth. */
171
- const enableNativeUIShell = (options = {}) => {
172
- if (options.enabled === false) {
173
- const current = active;
174
- if (current) stopActivation(current, current.then((handle) => handle.destroy()));
175
- return (stopping ?? Promise.resolve()).then(() => web("Disabled"));
176
- }
177
- if (typeof document === "undefined") return Promise.resolve(web("Requires a document"));
178
- const controls = options.controls;
179
- const configuration = JSON.stringify([
180
- options.verticalBarsOnly === true,
181
- options.buttonProjection ?? "system",
182
- options.buttonDefaultFill ?? null,
183
- ...[
184
- "tabs",
185
- "toolbar",
186
- "segment",
187
- "fab"
188
- ].map((component) => !controls || controls[component] === true),
189
- controls?.popover === true
190
- ]);
191
- if (active && activeConfiguration !== configuration) return Promise.reject(/* @__PURE__ */ new Error("Native UI Shell is already running with different controls; destroy it before changing configuration."));
192
- if (active) return active;
193
- activeConfiguration = configuration;
194
- const previousStop = stopping;
195
- let start;
196
- const stop = (destruction) => stopActivation(start, destruction);
197
- return start = active = (async () => {
198
- if (previousStop) await previousStop.catch(() => {});
199
- const stopModals = observeVerticalBarsModals(document);
200
- const prehide = options.controls === void 0 || options.controls.toolbar === true ? prehideVerticalBarsToolbarSources(document) : void 0;
201
- const fallback = (reason) => manage(createVerticalBarsWebProjection(document, options), {
202
- reason,
203
- suspend: () => prehide?.suspend(),
204
- destroy: () => {
205
- prehide?.stop();
206
- stopModals();
207
- },
208
- stopping: stop
209
- });
210
- if (Capacitor.getPlatform() !== "ios") return fallback("Requires Capacitor iOS");
211
- let runtime;
212
- let overlays;
213
- let metricsListener;
214
- let stopVerticalBarsLayout;
215
- try {
216
- if (!(await bounded(plugin.configure({ verticalBarsOnly: options.verticalBarsOnly === true }))).supported) return fallback("Requires iOS 26 or later");
217
- if (!options.verticalBarsOnly) stopVerticalBarsLayout = observeNativeVerticalBarsLayout(document);
218
- const nativeVerticalBars = () => {
219
- const app = document.querySelector("ion-app.ios-theme-vertical-bars");
220
- if (!app) return false;
221
- const reported = nativePlacements.get(app);
222
- if (!reported?.edge) return false;
223
- return (app.classList.contains("ios-theme-vertical-bars-left") ? "left" : "right") === physicalVerticalBarEdge(reported.edge, reported.rtl ?? elementRtl(app));
224
- };
225
- if (!options.verticalBarsOnly) {
226
- metricsListener = await boundedListener(plugin.addListener("webViewMetricsChange", (metrics) => {
227
- setConfig({ radius: metrics.radius });
228
- }));
229
- await configureNativeTransition().catch(() => void 0);
230
- }
231
- const native = await createRuntime(document, plugin, options, nativeVerticalBars, options.verticalBarsOnly === true);
232
- runtime = combine(native, createVerticalBarsWebProjection(document, options, () => !nativeVerticalBars() || native.getStatus().projected === 0));
233
- if (controls?.popover === true) overlays = await createOverlayController(document, plugin, options, native.retain, nativeVerticalBars);
234
- return manage(runtime, {
235
- suspend: async () => {
236
- const restorePrehide = prehide?.suspend();
237
- const resumeOverlays = await overlays?.suspend();
238
- return () => {
239
- restorePrehide?.();
240
- resumeOverlays?.();
241
- };
242
- },
243
- stopping: stop,
244
- destroy: async () => {
245
- try {
246
- await overlays?.destroy();
247
- } finally {
248
- if (metricsListener) await bounded(metricsListener.remove()).catch(() => {});
249
- stopVerticalBarsLayout?.();
250
- prehide?.stop();
251
- stopModals();
252
- }
253
- }
254
- });
255
- } catch (error) {
256
- await overlays?.destroy().catch(() => {});
257
- await runtime?.destroy().catch(() => {});
258
- if (metricsListener) await bounded(metricsListener.remove()).catch(() => {});
259
- stopVerticalBarsLayout?.();
260
- return fallback(error instanceof Error ? error.message : String(error));
261
- }
262
- })();
263
- };
264
- //#endregion
265
- export { IonicNativeUIShell, configureNativeTransition, enableNativeUIShell, enableVerticalControlArea, setVerticalControlAreaPlacement };
266
-
267
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/native/index.ts"],"sourcesContent":["import { Capacitor, registerPlugin } from '@capacitor/core';\nimport { setConfig } from '../transition/ios.transition';\nimport type {\n NativeUIShellHandle,\n NativeUIShellOptions,\n NativeUIShellPlugin,\n VerticalBarEdge,\n VerticalBarPlacement,\n VerticalControlAreaHandle,\n VerticalControlAreaOptions,\n WebViewMetrics,\n} from './definitions';\nimport { createRuntime } from './runtime';\nimport { bounded, boundedListener } from './shared/bridge';\nimport { createOverlayController } from './overlays/controller';\nimport { createVerticalBarsWebProjection } from './vertical-bars-web';\nimport { prehideVerticalBarsToolbarSources } from './prehide';\nimport { observeVerticalBarsModals } from './shared/modal';\nexport type {\n NativeUIShellComponent,\n NativeUIShellControls,\n NativeUIShellHandle,\n NativeUIShellOptions,\n NativeUIShellStatus,\n NativeUIShellSuspension,\n VerticalBarEdge,\n VerticalBarPlacement,\n VerticalControlAreaHandle,\n VerticalControlAreaOptions,\n WebViewMetrics,\n} from './definitions';\n\nconst plugin = registerPlugin<NativeUIShellPlugin>('IonicNativeUIShell');\nexport const IonicNativeUIShell = plugin;\nlet active: Promise<NativeUIShellHandle> | undefined;\nlet activeConfiguration: string | undefined;\nlet stopping: Promise<void> | undefined;\n\n// Every stop entry point releases the activation immediately but reserves the\n// shared native/DOM resources until its teardown has settled.\nconst stopActivation = (owner: Promise<NativeUIShellHandle>, destruction: Promise<void>) => {\n if (active !== owner) return;\n active = undefined;\n activeConfiguration = undefined;\n stopping = destruction;\n const release = () => {\n if (stopping === destruction) stopping = undefined;\n };\n void destruction.then(release, release);\n};\nconst web = (reason: string): NativeUIShellHandle => ({\n getStatus: () => ({ state: 'web', projected: 0, updates: 0, reason }),\n suspend: async () => ({ resume: async () => {} }),\n destroy: async () => {},\n});\n\nconst combine = (native: NativeUIShellHandle, fallback: NativeUIShellHandle): NativeUIShellHandle => ({\n getStatus() {\n const nativeStatus = native.getStatus();\n const fallbackStatus = fallback.getStatus();\n return {\n ...nativeStatus,\n state:\n nativeStatus.state === 'stopped' && fallbackStatus.state === 'stopped' ? 'stopped' : nativeStatus.projected > 0 ? 'native' : 'web',\n projected: nativeStatus.projected + fallbackStatus.projected,\n updates: nativeStatus.updates + fallbackStatus.updates,\n };\n },\n async suspend() {\n const [nativeLease, fallbackLease] = await Promise.all([native.suspend(), fallback.suspend()]);\n return { resume: async () => void (await Promise.all([nativeLease.resume(), fallbackLease.resume()])) };\n },\n async destroy() {\n await Promise.all([native.destroy(), fallback.destroy()]);\n },\n});\n\n/** Wraps a runtime handle with the shared enable-lifecycle: reason, suspend hooks and idempotent destroy. */\nconst manage = (\n handle: NativeUIShellHandle,\n lifecycle: {\n reason?: string;\n suspend?: () => (() => void) | undefined | Promise<(() => void) | undefined>;\n /** Registers teardown before it starts so direct destroy and disable share the same queue. */\n stopping?: (destruction: Promise<void>) => void;\n destroy?: () => void | Promise<void>;\n } = {},\n): NativeUIShellHandle => {\n let destruction: Promise<void> | undefined;\n return {\n getStatus: () => (lifecycle.reason ? { ...handle.getStatus(), reason: lifecycle.reason } : handle.getStatus()),\n async suspend() {\n const lease = await handle.suspend();\n const resume = await lifecycle.suspend?.();\n return {\n async resume() {\n await lease.resume();\n resume?.();\n },\n };\n },\n destroy() {\n if (!destruction) {\n destruction = Promise.resolve().then(async () => {\n try {\n await handle.destroy();\n } finally {\n await lifecycle.destroy?.();\n }\n });\n lifecycle.stopping?.(destruction);\n }\n return destruction;\n },\n };\n};\n\n/** Reads the current native WebView geometry and applies it to page transitions. */\nexport const configureNativeTransition = async (): Promise<WebViewMetrics> => {\n const metrics =\n typeof document !== 'undefined' && Capacitor.getPlatform() === 'ios' ? await bounded(plugin.getWebViewMetrics()) : { radius: 0 };\n setConfig({ radius: metrics.radius });\n return metrics;\n};\n\n/** Resolves a logical vertical-bar edge to the physical side for the given direction. */\nconst physicalVerticalBarEdge = (edge: Exclude<VerticalBarEdge, null>, rtl: boolean): 'left' | 'right' =>\n (edge === 'leading') !== rtl ? 'left' : 'right';\n\nconst elementRtl = (element: Element): boolean => element.closest('[dir]')?.getAttribute('dir') === 'rtl';\n\n// Device facts are supplied by the application; the theme only compares placement.\nconst nativePlacements = new WeakMap<HTMLElement, { edge: VerticalBarEdge; rtl?: boolean }>();\nconst horizontalFallbackAttribute = 'data-native-ui-shell-vertical-bars-suspended';\n\n// Keep the requested rail while ordinary Native UI Shell temporarily uses its\n// horizontal layout. Removing the effective class restores normal measurements,\n// toolbar ownership and safe areas throughout the existing rendering pipeline.\nconst observeNativeVerticalBarsLayout = (doc: Document): (() => void) => {\n const reconcile = () => {\n const app = doc.querySelector<HTMLElement>('ion-app');\n if (!app) return;\n const requested = app.classList.contains('ios-theme-vertical-bars') || app.hasAttribute(horizontalFallbackAttribute);\n const suspended = requested && nativePlacements.get(app)?.edge == null;\n if (app.hasAttribute(horizontalFallbackAttribute) !== suspended) app.toggleAttribute(horizontalFallbackAttribute, suspended);\n if (app.classList.contains('ios-theme-vertical-bars') !== (requested && !suspended)) {\n app.classList.toggle('ios-theme-vertical-bars', requested && !suspended);\n }\n };\n const observer = new MutationObserver(reconcile);\n observer.observe(doc.documentElement, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\n doc.defaultView?.addEventListener('nativeUIShellRefresh', reconcile);\n reconcile();\n return () => {\n observer.disconnect();\n doc.defaultView?.removeEventListener('nativeUIShellRefresh', reconcile);\n const app = doc.querySelector<HTMLElement>(`ion-app[${horizontalFallbackAttribute}]`);\n if (app) {\n app.removeAttribute(horizontalFallbackAttribute);\n app.classList.add('ios-theme-vertical-bars');\n }\n };\n};\n\n/**\n * Applies one placement to the CSS layout and both Web/native projections.\n * Pass `rtl` when the document direction is known; otherwise the nearest `dir` attribute is used.\n */\nexport const setVerticalControlAreaPlacement = (placement: VerticalBarEdge | VerticalBarPlacement, rtl?: boolean): void => {\n if (typeof document === 'undefined') return;\n const app = document.querySelector<HTMLElement>('ion-app');\n if (!app) throw new Error('Vertical Control Area requires ion-app');\n const { edge, inset = 0 } = placement && typeof placement === 'object' ? placement : { edge: placement, inset: 0 };\n if (placement && typeof placement === 'object' && placement.nativeEdge !== undefined) {\n nativePlacements.set(app, { edge: placement.nativeEdge, rtl });\n }\n app.removeAttribute(horizontalFallbackAttribute);\n app.classList.toggle('ios-theme-vertical-bars', edge !== null);\n app.classList.toggle('ios-theme-vertical-bars-left', edge !== null && physicalVerticalBarEdge(edge, rtl ?? elementRtl(app)) === 'left');\n if (edge && Number.isFinite(inset) && inset > 0) app.style.setProperty('--ios-theme-vertical-bars-native-inset', `${inset}px`);\n else app.style.removeProperty('--ios-theme-vertical-bars-native-inset');\n document.defaultView?.dispatchEvent(new Event('nativeUIShellRefresh'));\n};\n\n/**\n * Call once after ion-app is mounted. Ionic markup remains the source of truth.\n * Native vertical buttons default to SwiftUI appearance.\n * See VerticalControlAreaOptions for source styling and local overrides.\n */\nexport const enableVerticalControlArea = async (options: VerticalControlAreaOptions = {}): Promise<VerticalControlAreaHandle> => {\n const handle = await enableNativeUIShell({\n buttonProjection: options.buttonProjection,\n buttonDefaultFill: options.buttonDefaultFill,\n controls: { tabs: true, toolbar: true, popover: options.controls?.popover === true },\n verticalBarsOnly: true,\n });\n return {\n getStatus: () => handle.getStatus(),\n suspend: () => handle.suspend(),\n destroy: () => handle.destroy(),\n setPlacement: setVerticalControlAreaPlacement,\n };\n};\n\n/** Call once at application startup. Ionic markup remains the source of truth. */\nexport const enableNativeUIShell = (options: NativeUIShellOptions = {}): Promise<NativeUIShellHandle> => {\n if (options.enabled === false) {\n const current = active;\n if (current)\n stopActivation(\n current,\n current.then((handle) => handle.destroy()),\n );\n return (stopping ?? Promise.resolve()).then(() => web('Disabled'));\n }\n if (typeof document === 'undefined') return Promise.resolve(web('Requires a document'));\n const controls = options.controls;\n const configuration = JSON.stringify([\n options.verticalBarsOnly === true,\n options.buttonProjection ?? 'system',\n // Local source overrides can use this even when the startup projection is system.\n options.buttonDefaultFill ?? null,\n ...(['tabs', 'toolbar', 'segment', 'fab'] as const).map((component) => !controls || controls[component] === true),\n controls?.popover === true,\n ]);\n if (active && activeConfiguration !== configuration)\n return Promise.reject(\n new Error('Native UI Shell is already running with different controls; destroy it before changing configuration.'),\n );\n if (active) return active;\n activeConfiguration = configuration;\n const previousStop = stopping;\n let start: Promise<NativeUIShellHandle>;\n const stop = (destruction: Promise<void>) => stopActivation(start, destruction);\n return (start = active =\n (async () => {\n // Native controls and DOM ownership are shared. A replacement activation\n // must wait until the old handle has finished clearing both surfaces.\n if (previousStop) await previousStop.catch(() => {});\n const stopModals = observeVerticalBarsModals(document);\n const prehide =\n options.controls === undefined || options.controls.toolbar === true ? prehideVerticalBarsToolbarSources(document) : undefined;\n const fallback = (reason: string) =>\n manage(createVerticalBarsWebProjection(document, options), {\n reason,\n suspend: () => prehide?.suspend(),\n destroy: () => {\n prehide?.stop();\n stopModals();\n },\n stopping: stop,\n });\n if (Capacitor.getPlatform() !== 'ios') return fallback('Requires Capacitor iOS');\n let runtime: NativeUIShellHandle | undefined;\n let overlays: Awaited<ReturnType<typeof createOverlayController>> | undefined;\n let metricsListener: Awaited<ReturnType<typeof plugin.addListener>> | undefined;\n let stopVerticalBarsLayout: (() => void) | undefined;\n try {\n const capabilities = await bounded(plugin.configure({ verticalBarsOnly: options.verticalBarsOnly === true }));\n if (!capabilities.supported) return fallback('Requires iOS 26 or later');\n if (!options.verticalBarsOnly) stopVerticalBarsLayout = observeNativeVerticalBarsLayout(document);\n // The application owns device state and selects the rail through placement classes.\n const nativeVerticalBars = () => {\n const app = document.querySelector<HTMLElement>('ion-app.ios-theme-vertical-bars');\n if (!app) return false;\n const reported = nativePlacements.get(app);\n if (!reported?.edge) return false;\n const physicalEdge = app.classList.contains('ios-theme-vertical-bars-left') ? 'left' : 'right';\n return physicalEdge === physicalVerticalBarEdge(reported.edge, reported.rtl ?? elementRtl(app));\n };\n if (!options.verticalBarsOnly) {\n metricsListener = await boundedListener(\n plugin.addListener('webViewMetricsChange', (metrics) => {\n setConfig({ radius: metrics.radius });\n }),\n );\n await configureNativeTransition().catch(() => undefined);\n }\n const native = await createRuntime(document, plugin, options, nativeVerticalBars, options.verticalBarsOnly === true);\n runtime = combine(\n native,\n createVerticalBarsWebProjection(document, options, () => !nativeVerticalBars() || native.getStatus().projected === 0),\n );\n if (controls?.popover === true)\n overlays = await createOverlayController(document, plugin, options, native.retain, nativeVerticalBars);\n return manage(runtime, {\n suspend: async () => {\n const restorePrehide = prehide?.suspend();\n const resumeOverlays = await overlays?.suspend();\n return () => {\n restorePrehide?.();\n resumeOverlays?.();\n };\n },\n stopping: stop,\n destroy: async () => {\n try {\n await overlays?.destroy();\n } finally {\n if (metricsListener) await bounded(metricsListener.remove()).catch(() => {});\n stopVerticalBarsLayout?.();\n prehide?.stop();\n stopModals();\n }\n },\n });\n } catch (error) {\n await overlays?.destroy().catch(() => {});\n await runtime?.destroy().catch(() => {});\n if (metricsListener) await bounded(metricsListener.remove()).catch(() => {});\n stopVerticalBarsLayout?.();\n return fallback(error instanceof Error ? error.message : String(error));\n }\n })());\n};\n"],"mappings":";;;;;;;;;AAgCA,MAAM,SAAS,eAAoC,oBAAoB;AACvE,MAAa,qBAAqB;AAClC,IAAI;AACJ,IAAI;AACJ,IAAI;AAIJ,MAAM,kBAAkB,OAAqC,gBAA+B;CAC1F,IAAI,WAAW,OAAO;CACtB,SAAS,KAAA;CACT,sBAAsB,KAAA;CACtB,WAAW;CACX,MAAM,gBAAgB;EACpB,IAAI,aAAa,aAAa,WAAW,KAAA;CAC3C;CACA,YAAiB,KAAK,SAAS,OAA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CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;MAC3E,yBAAyB;MACzB,SAAS,KAAK;MACd,WAAW;KACb;IACF;GACF,CAAC;EACH,SAAS,OAAO;GACd,MAAM,UAAU,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;GACxC,MAAM,SAAS,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;GACvC,IAAI,iBAAiB,MAAM,QAAQ,gBAAgB,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;GAC3E,yBAAyB;GACzB,OAAO,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;EACxE;CACF,EAAA,CAAG;AACP"}
@@ -1,4 +0,0 @@
1
- //#region src/native/overlays/content.d.ts
2
- export declare const moveContent: (content: HTMLElement[], destination: HTMLElement) => (() => void);
3
- //#endregion
4
- //# sourceMappingURL=content.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content.d.ts","names":[],"sources":["../../../src/native/overlays/content.ts"],"mappings":";qBAGa,cAAe,SAAS,eAAe,aAAa"}
@@ -1,51 +0,0 @@
1
- import { sheetText } from "./styles.js";
2
- //#region src/native/overlays/content.ts
3
- /** Constructed stylesheets cannot cross documents with their nodes. */
4
- const moveContent = (content, destination) => {
5
- const home = content.map((element) => ({
6
- element,
7
- parent: element.parentNode,
8
- next: element.nextSibling
9
- }));
10
- const roots = [];
11
- const collect = (node) => {
12
- if (node.shadowRoot) {
13
- roots.push({
14
- root: node.shadowRoot,
15
- css: sheetText(node.shadowRoot.adoptedStyleSheets),
16
- sheets: [...node.shadowRoot.adoptedStyleSheets]
17
- });
18
- for (const child of Array.from(node.shadowRoot.children)) collect(child);
19
- }
20
- for (const child of Array.from(node.children)) collect(child);
21
- };
22
- content.forEach(collect);
23
- for (const element of content) destination.append(destination.ownerDocument.adoptNode(element));
24
- const styles = roots.filter(({ css }) => css).map(({ root, css }) => {
25
- const style = destination.ownerDocument.createElement("style");
26
- style.textContent = css;
27
- root.append(style);
28
- return style;
29
- });
30
- return () => {
31
- styles.forEach((style) => style.remove());
32
- for (const { element, parent, next } of home) {
33
- const connected = element.isConnected;
34
- parent.ownerDocument.adoptNode(element);
35
- if (connected) parent.insertBefore(element, next?.parentNode === parent ? next : null);
36
- }
37
- for (const { root, css, sheets } of roots) try {
38
- root.adoptedStyleSheets = sheets;
39
- } catch {
40
- if (css) {
41
- const style = root.ownerDocument.createElement("style");
42
- style.textContent = css;
43
- root.append(style);
44
- }
45
- }
46
- };
47
- };
48
- //#endregion
49
- export { moveContent };
50
-
51
- //# sourceMappingURL=content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content.js","names":[],"sources":["../../../src/native/overlays/content.ts"],"sourcesContent":["import { sheetText } from './styles';\n\n/** Constructed stylesheets cannot cross documents with their nodes. */\nexport const moveContent = (content: HTMLElement[], destination: HTMLElement): (() => void) => {\n const home = content.map((element) => ({ element, parent: element.parentNode!, next: element.nextSibling }));\n const roots: { root: ShadowRoot; css: string; sheets: CSSStyleSheet[] }[] = [];\n const collect = (node: Element) => {\n if (node.shadowRoot) {\n roots.push({\n root: node.shadowRoot,\n css: sheetText(node.shadowRoot.adoptedStyleSheets),\n sheets: [...node.shadowRoot.adoptedStyleSheets],\n });\n for (const child of Array.from(node.shadowRoot.children)) collect(child);\n }\n for (const child of Array.from(node.children)) collect(child);\n };\n content.forEach(collect);\n for (const element of content) destination.append(destination.ownerDocument.adoptNode(element));\n const styles = roots\n .filter(({ css }) => css)\n .map(({ root, css }) => {\n const style = destination.ownerDocument.createElement('style');\n style.textContent = css;\n root.append(style);\n return style;\n });\n return () => {\n styles.forEach((style) => style.remove());\n for (const { element, parent, next } of home) {\n const connected = element.isConnected;\n parent.ownerDocument!.adoptNode(element);\n // Ionic may already have destroyed the Angular component on dismiss.\n if (connected) parent.insertBefore(element, next?.parentNode === parent ? next : null);\n }\n for (const { root, css, sheets } of roots) {\n // WebKit re-associates adopted sheets with the new document across\n // adoptNode, so they may no longer match this root; fall back to the\n // inline copy instead of aborting the remaining restore.\n try {\n root.adoptedStyleSheets = sheets;\n } catch {\n if (css) {\n const style = root.ownerDocument.createElement('style');\n style.textContent = css;\n root.append(style);\n }\n }\n }\n };\n};\n"],"mappings":";;;AAGA,MAAa,eAAe,SAAwB,gBAA2C;CAC7F,MAAM,OAAO,QAAQ,KAAK,aAAa;EAAE;EAAS,QAAQ,QAAQ;EAAa,MAAM,QAAQ;CAAY,EAAE;CAC3G,MAAM,QAAsE,CAAC;CAC7E,MAAM,WAAW,SAAkB;EACjC,IAAI,KAAK,YAAY;GACnB,MAAM,KAAK;IACT,MAAM,KAAK;IACX,KAAK,UAAU,KAAK,WAAW,kBAAkB;IACjD,QAAQ,CAAC,GAAG,KAAK,WAAW,kBAAkB;GAChD,CAAC;GACD,KAAK,MAAM,SAAS,MAAM,KAAK,KAAK,WAAW,QAAQ,GAAG,QAAQ,KAAK;EACzE;EACA,KAAK,MAAM,SAAS,MAAM,KAAK,KAAK,QAAQ,GAAG,QAAQ,KAAK;CAC9D;CACA,QAAQ,QAAQ,OAAO;CACvB,KAAK,MAAM,WAAW,SAAS,YAAY,OAAO,YAAY,cAAc,UAAU,OAAO,CAAC;CAC9F,MAAM,SAAS,MACZ,QAAQ,EAAE,UAAU,GAAG,CAAC,CACxB,KAAK,EAAE,MAAM,UAAU;EACtB,MAAM,QAAQ,YAAY,cAAc,cAAc,OAAO;EAC7D,MAAM,cAAc;EACpB,KAAK,OAAO,KAAK;EACjB,OAAO;CACT,CAAC;CACH,aAAa;EACX,OAAO,SAAS,UAAU,MAAM,OAAO,CAAC;EACxC,KAAK,MAAM,EAAE,SAAS,QAAQ,UAAU,MAAM;GAC5C,MAAM,YAAY,QAAQ;GAC1B,OAAO,cAAe,UAAU,OAAO;GAEvC,IAAI,WAAW,OAAO,aAAa,SAAS,MAAM,eAAe,SAAS,OAAO,IAAI;EACvF;EACA,KAAK,MAAM,EAAE,MAAM,KAAK,YAAY,OAIlC,IAAI;GACF,KAAK,qBAAqB;EAC5B,QAAQ;GACN,IAAI,KAAK;IACP,MAAM,QAAQ,KAAK,cAAc,cAAc,OAAO;IACtD,MAAM,cAAc;IACpB,KAAK,OAAO,KAAK;GACnB;EACF;CAEJ;AACF"}
@@ -1,8 +0,0 @@
1
- import { NativeUIShellOptions, NativeUIShellPlugin } from "../definitions.js";
2
- //#region src/native/overlays/controller.d.ts
3
- export declare const createOverlayController: (doc: Document, plugin: NativeUIShellPlugin, options: NativeUIShellOptions, retainProjection: (deferActivation?: (id: string) => boolean) => () => void, nativeVerticalBars: () => boolean) => Promise<{
4
- suspend(): Promise<() => void>;
5
- destroy(): Promise<void>;
6
- }>;
7
- //#endregion
8
- //# sourceMappingURL=controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"controller.d.ts","names":[],"sources":["../../../src/native/overlays/controller.ts"],"mappings":";;qBAoCa,0BACX,KAAK,UACL,QAAQ,qBACR,SAAS,sBACT,mBAAmB,mBAAmB,uCACtC,sCAAiC"}