@rdlabo/ionic-theme-ios27 1.2.1 → 2.0.0-beta.pr304.sha56daf151ad80
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 +24 -280
- package/dist/css/components/ion-toolbar.css +1 -1
- package/dist/css/ionic-theme-ios27.css +1 -1
- package/dist/css/vertical-bars.css +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/layout/index.d.ts +18 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +26 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/segment/index.js +3 -3
- package/dist/segment/index.js.map +1 -1
- package/dist/sheets-of-glass/index.js +7 -7
- package/dist/sheets-of-glass/index.js.map +1 -1
- package/dist/tab-bar-searchable/dismiss-button.js +53 -3
- package/dist/tab-bar-searchable/dismiss-button.js.map +1 -1
- package/dist/tab-bar-searchable/index.js +18 -3
- package/dist/tab-bar-searchable/index.js.map +1 -1
- package/dist/transition/ios.transition.d.ts.map +1 -1
- package/dist/transition/ios.transition.js +7 -4
- package/dist/transition/ios.transition.js.map +1 -1
- package/dist/transition/native-ui.d.ts +6 -0
- package/dist/transition/native-ui.d.ts.map +1 -0
- package/dist/{native-integration/index.js → transition/native-ui.js} +16 -30
- package/dist/transition/native-ui.js.map +1 -0
- package/docs/adaptive-themes.md +151 -0
- package/docs/add-native-ui.md +53 -0
- package/docs/animation.md +1 -1
- package/docs/eslint.md +1 -1
- package/docs/features.md +3 -3
- package/docs/iphone-duo-with-original-theme.md +44 -29
- package/docs/iphone-duo.md +29 -32
- package/docs/migration.md +12 -24
- package/docs/setup.md +82 -0
- package/docs/special-markup.md +5 -5
- package/docs/using-ion-item-group.md +2 -2
- package/docs/vertical-bars-layout.md +47 -0
- package/package.json +12 -42
- package/src/index.ts +3 -1
- package/src/layout/index.ts +29 -0
- package/src/segment/index.ts +3 -3
- package/src/sheets-of-glass/index.ts +7 -7
- package/src/styles/components/ion-toolbar.scss +1 -1
- package/src/styles/vertical-bars.scss +15 -18
- package/src/tab-bar-searchable/dismiss-button.ts +73 -4
- package/src/tab-bar-searchable/index.ts +20 -3
- package/src/transition/ios.transition.ts +7 -4
- package/src/{native-integration/index.ts → transition/native-ui.ts} +17 -46
- package/Package.swift +0 -21
- package/dist/_virtual/_rolldown/runtime.js +0 -13
- package/dist/native/components/index.d.ts +0 -19
- package/dist/native/components/index.d.ts.map +0 -1
- package/dist/native/components/index.js +0 -40
- package/dist/native/components/index.js.map +0 -1
- package/dist/native/components/ion-back-button.d.ts +0 -9
- package/dist/native/components/ion-back-button.d.ts.map +0 -1
- package/dist/native/components/ion-back-button.js +0 -20
- package/dist/native/components/ion-back-button.js.map +0 -1
- package/dist/native/components/ion-button.d.ts +0 -10
- package/dist/native/components/ion-button.d.ts.map +0 -1
- package/dist/native/components/ion-button.js +0 -23
- package/dist/native/components/ion-button.js.map +0 -1
- package/dist/native/components/ion-buttons.d.ts +0 -11
- package/dist/native/components/ion-buttons.d.ts.map +0 -1
- package/dist/native/components/ion-buttons.js +0 -30
- package/dist/native/components/ion-buttons.js.map +0 -1
- package/dist/native/components/ion-fab.d.ts +0 -10
- package/dist/native/components/ion-fab.d.ts.map +0 -1
- package/dist/native/components/ion-fab.js +0 -132
- package/dist/native/components/ion-fab.js.map +0 -1
- package/dist/native/components/ion-menu-button.d.ts +0 -13
- package/dist/native/components/ion-menu-button.d.ts.map +0 -1
- package/dist/native/components/ion-menu-button.js +0 -31
- package/dist/native/components/ion-menu-button.js.map +0 -1
- package/dist/native/components/ion-segment.d.ts +0 -11
- package/dist/native/components/ion-segment.d.ts.map +0 -1
- package/dist/native/components/ion-segment.js +0 -30
- package/dist/native/components/ion-segment.js.map +0 -1
- package/dist/native/components/ion-tab-bar.d.ts +0 -11
- package/dist/native/components/ion-tab-bar.d.ts.map +0 -1
- package/dist/native/components/ion-tab-bar.js +0 -50
- package/dist/native/components/ion-tab-bar.js.map +0 -1
- package/dist/native/components/searchable-tabs.d.ts +0 -20
- package/dist/native/components/searchable-tabs.d.ts.map +0 -1
- package/dist/native/components/searchable-tabs.js +0 -383
- package/dist/native/components/searchable-tabs.js.map +0 -1
- package/dist/native/definitions.d.ts +0 -152
- package/dist/native/definitions.d.ts.map +0 -1
- package/dist/native/definitions.js +0 -0
- package/dist/native/foldable/fold-state.d.ts +0 -5
- package/dist/native/foldable/fold-state.d.ts.map +0 -1
- package/dist/native/foldable/fold-state.js +0 -14
- package/dist/native/foldable/fold-state.js.map +0 -1
- package/dist/native/foldable/types.d.ts +0 -12
- package/dist/native/foldable/types.d.ts.map +0 -1
- package/dist/native/foldable/types.js +0 -0
- package/dist/native/index.d.ts +0 -11
- package/dist/native/index.d.ts.map +0 -1
- package/dist/native/index.js +0 -242
- package/dist/native/index.js.map +0 -1
- package/dist/native/prehide.d.ts +0 -7
- package/dist/native/prehide.d.ts.map +0 -1
- package/dist/native/prehide.js +0 -230
- package/dist/native/prehide.js.map +0 -1
- package/dist/native/runtime.d.ts +0 -5
- package/dist/native/runtime.d.ts.map +0 -1
- package/dist/native/runtime.js +0 -640
- package/dist/native/runtime.js.map +0 -1
- package/dist/native/shared/candidate.d.ts +0 -21
- package/dist/native/shared/candidate.d.ts.map +0 -1
- package/dist/native/shared/candidate.js +0 -98
- package/dist/native/shared/candidate.js.map +0 -1
- package/dist/native/shared/crossfade.d.ts +0 -10
- package/dist/native/shared/crossfade.d.ts.map +0 -1
- package/dist/native/shared/crossfade.js +0 -50
- package/dist/native/shared/crossfade.js.map +0 -1
- package/dist/native/shared/dom.d.ts +0 -46
- package/dist/native/shared/dom.d.ts.map +0 -1
- package/dist/native/shared/dom.js +0 -172
- package/dist/native/shared/dom.js.map +0 -1
- package/dist/native/shared/events.d.ts +0 -11
- package/dist/native/shared/events.d.ts.map +0 -1
- package/dist/native/shared/events.js +0 -13
- package/dist/native/shared/events.js.map +0 -1
- package/dist/native/shared/icons.d.ts +0 -8
- package/dist/native/shared/icons.d.ts.map +0 -1
- package/dist/native/shared/icons.js +0 -61
- package/dist/native/shared/icons.js.map +0 -1
- package/dist/native/shared/modal.d.ts +0 -10
- package/dist/native/shared/modal.d.ts.map +0 -1
- package/dist/native/shared/modal.js +0 -160
- package/dist/native/shared/modal.js.map +0 -1
- package/dist/native/vertical-bars-web-search.d.ts +0 -9
- package/dist/native/vertical-bars-web-search.d.ts.map +0 -1
- package/dist/native/vertical-bars-web-search.js +0 -84
- package/dist/native/vertical-bars-web-search.js.map +0 -1
- package/dist/native/vertical-bars-web.d.ts +0 -5
- package/dist/native/vertical-bars-web.d.ts.map +0 -1
- package/dist/native/vertical-bars-web.js +0 -341
- package/dist/native/vertical-bars-web.js.map +0 -1
- package/dist/native-integration/index.d.ts +0 -23
- package/dist/native-integration/index.d.ts.map +0 -1
- package/dist/native-integration/index.js.map +0 -1
- package/dist/native-integration/transition.d.ts +0 -5
- package/dist/native-integration/transition.d.ts.map +0 -1
- package/dist/native-integration/transition.js +0 -16
- package/dist/native-integration/transition.js.map +0 -1
- package/dist/vertical-bars.d.ts +0 -5
- package/dist/vertical-bars.js +0 -4
- package/docs/e2e-testing.md +0 -51
- package/docs/feedback.md +0 -65
- package/docs/native-ui-shell.md +0 -285
- package/docs/vertical-bars.md +0 -285
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellButton.swift +0 -71
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellButtons.swift +0 -24
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellComponents.swift +0 -18
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellFab.swift +0 -83
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellSearchController.swift +0 -432
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellSegment.swift +0 -91
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellTabBar.swift +0 -221
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellVerticalBars.swift +0 -437
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellVerticalSearch.swift +0 -118
- package/ios/Sources/IonicNativeUIShellPlugin/IonicNativeUIShellPlugin.swift +0 -396
- package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellCrossfade.swift +0 -35
- package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellHost.swift +0 -8
- package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellRendering.swift +0 -27
- package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellSnapshot.swift +0 -135
- package/ios/Tests/IonicNativeUIShellPluginTests/ShellSnapshotTests.swift +0 -650
- package/src/native/components/index.ts +0 -53
- package/src/native/components/ion-back-button.ts +0 -19
- package/src/native/components/ion-button.ts +0 -24
- package/src/native/components/ion-buttons.ts +0 -38
- package/src/native/components/ion-fab.ts +0 -151
- package/src/native/components/ion-menu-button.ts +0 -24
- package/src/native/components/ion-segment.ts +0 -27
- package/src/native/components/ion-tab-bar.ts +0 -50
- package/src/native/components/searchable-tabs.ts +0 -459
- package/src/native/definitions.ts +0 -191
- package/src/native/foldable/fold-state.ts +0 -9
- package/src/native/foldable/types.ts +0 -4
- package/src/native/index.ts +0 -281
- package/src/native/prehide.ts +0 -265
- package/src/native/runtime.ts +0 -781
- package/src/native/shared/candidate.ts +0 -150
- package/src/native/shared/crossfade.ts +0 -50
- package/src/native/shared/dom.ts +0 -286
- package/src/native/shared/events.ts +0 -8
- package/src/native/shared/icons.ts +0 -57
- package/src/native/shared/modal.ts +0 -157
- package/src/native/vertical-bars-web-search.ts +0 -80
- package/src/native/vertical-bars-web.ts +0 -411
- package/src/native-integration/transition.ts +0 -15
- package/src/vertical-bars.ts +0 -11
package/dist/native/runtime.js
DELETED
|
@@ -1,640 +0,0 @@
|
|
|
1
|
-
import { VERTICAL_BARS_TRANSITION_CANCELED, getNativeSearchBindings, setNativeUIShellIntegration } from "../native-integration/index.js";
|
|
2
|
-
import { inVerticalBarsSurface, modalUsesVerticalBars, modalVerticalBarFrame, topModal } from "./shared/modal.js";
|
|
3
|
-
import { createCrossfade, fadeMarker } from "./shared/crossfade.js";
|
|
4
|
-
import { activateProjectedElement, createVerticalBarsPageState, isVerticalBarsSource, marker, preferredVerticalBarsBack, prehideOnlyMutation, rejectedClass, syncToolbarText, unprojected } from "./shared/dom.js";
|
|
5
|
-
import { createIconRenderer } from "./shared/icons.js";
|
|
6
|
-
import { createSearchSupport } from "./components/searchable-tabs.js";
|
|
7
|
-
import { isVerticalBarsCandidate, motionSelector, readCandidate, selector, shadowSelector } from "./components/index.js";
|
|
8
|
-
import { CSS_MOTION_EVENTS } from "./shared/events.js";
|
|
9
|
-
import { LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE } from "@ionic/core/components/index.js";
|
|
10
|
-
//#region src/native/runtime.ts
|
|
11
|
-
const overlays = "ion-modal, ion-popover, ion-alert, ion-action-sheet, ion-loading, ion-picker, ion-toast, ion-menu";
|
|
12
|
-
const overlayNames = [
|
|
13
|
-
"Modal",
|
|
14
|
-
"Popover",
|
|
15
|
-
"Alert",
|
|
16
|
-
"ActionSheet",
|
|
17
|
-
"Loading",
|
|
18
|
-
"Picker",
|
|
19
|
-
"Toast"
|
|
20
|
-
];
|
|
21
|
-
const verticalBarsMarker = "data-native-ui-shell-vertical-bars";
|
|
22
|
-
const verticalBarsMemberMarker = "data-native-ui-shell-vertical-bars-member";
|
|
23
|
-
const bounded = (promise) => new Promise((resolve, reject) => {
|
|
24
|
-
const timer = setTimeout(() => reject(/* @__PURE__ */ new Error("Native UI Shell bridge timed out")), 5e3);
|
|
25
|
-
promise.then(resolve, reject).finally(() => clearTimeout(timer));
|
|
26
|
-
});
|
|
27
|
-
const createRuntime = async (doc, plugin, options = {}, nativeVerticalBars = () => true, verticalBarsOnly = false) => {
|
|
28
|
-
const win = doc.defaultView;
|
|
29
|
-
const icons = createIconRenderer();
|
|
30
|
-
const crossfade = createCrossfade(win);
|
|
31
|
-
const ids = /* @__PURE__ */ new WeakMap();
|
|
32
|
-
let rejected = /* @__PURE__ */ new WeakMap();
|
|
33
|
-
const sources = /* @__PURE__ */ new Map();
|
|
34
|
-
const verticalBarsOwners = /* @__PURE__ */ new Set();
|
|
35
|
-
const verticalBarsMembers = /* @__PURE__ */ new Set();
|
|
36
|
-
const suspended = /* @__PURE__ */ new Set();
|
|
37
|
-
const pages = /* @__PURE__ */ new Set();
|
|
38
|
-
const verticalBarsPages = createVerticalBarsPageState();
|
|
39
|
-
const presented = /* @__PURE__ */ new Set();
|
|
40
|
-
const manualSuspensions = /* @__PURE__ */ new Set();
|
|
41
|
-
const moving = /* @__PURE__ */ new Map();
|
|
42
|
-
const observed = /* @__PURE__ */ new Set();
|
|
43
|
-
const listeners = new AbortController();
|
|
44
|
-
let actions = /* @__PURE__ */ new Map();
|
|
45
|
-
let nextId = 0;
|
|
46
|
-
let revision = 0;
|
|
47
|
-
let acceptedRevision = 0;
|
|
48
|
-
let updatingRevision;
|
|
49
|
-
let pendingActivations = [];
|
|
50
|
-
let lastSequence = 0;
|
|
51
|
-
let lastSnapshot = "";
|
|
52
|
-
let viewport = `${win.innerWidth}:${win.innerHeight}`;
|
|
53
|
-
let forceRefresh = false;
|
|
54
|
-
let dirty = false;
|
|
55
|
-
let pending = false;
|
|
56
|
-
let stopped = false;
|
|
57
|
-
/** True while a tab-switch handoff should skip crossfade. */
|
|
58
|
-
let tabSwitchHandoff = false;
|
|
59
|
-
/** Keep instant updates until this time — DidLeave often precedes the retire sync. */
|
|
60
|
-
let handoffUntil = 0;
|
|
61
|
-
/** Tab switch armed while a sync was already in flight; extend instant past that sync. */
|
|
62
|
-
let handoffAcrossPending = false;
|
|
63
|
-
/** Captured at the start of each sync so an in-flight update keeps a stable duration. */
|
|
64
|
-
let handoffInstant = false;
|
|
65
|
-
/** Retire native controls immediately as a modal starts covering the page. */
|
|
66
|
-
let modalPresentHandoff = false;
|
|
67
|
-
let frame = 0;
|
|
68
|
-
let updates = 0;
|
|
69
|
-
let reason;
|
|
70
|
-
let listener;
|
|
71
|
-
let searchListener;
|
|
72
|
-
let waiters = [];
|
|
73
|
-
const control = (kind) => {
|
|
74
|
-
if (kind === "ion-tab-bar") return "tabs";
|
|
75
|
-
if (kind === "ion-segment") return "segment";
|
|
76
|
-
if (kind === "ion-fab") return "fab";
|
|
77
|
-
return "toolbar";
|
|
78
|
-
};
|
|
79
|
-
const controlEnabled = (candidate) => {
|
|
80
|
-
const controls = options.controls;
|
|
81
|
-
return controls === void 0 || controls[control(candidate.control.kind)] === true;
|
|
82
|
-
};
|
|
83
|
-
const id = (element) => {
|
|
84
|
-
let value = ids.get(element);
|
|
85
|
-
if (!value) {
|
|
86
|
-
value = `shell-${++nextId}`;
|
|
87
|
-
ids.set(element, value);
|
|
88
|
-
}
|
|
89
|
-
return value;
|
|
90
|
-
};
|
|
91
|
-
const style = doc.createElement("style");
|
|
92
|
-
const hidden = `[${marker}]:not([${fadeMarker}])`;
|
|
93
|
-
style.textContent = `${hidden}, ${hidden} *, ${hidden}::before, ${hidden}::after, ${hidden}::part(native) { visibility: hidden !important; }
|
|
94
|
-
[${marker}], [${marker}] * { pointer-events: none !important; }
|
|
95
|
-
/* Ionic disables the covered page while a menu is open. VerticalBars rail
|
|
96
|
-
controls remain outside that page; zero specificity preserves any
|
|
97
|
-
pointer-events rule supplied by the application itself. */
|
|
98
|
-
:where(.menu-content-open) :where([${verticalBarsMarker}]) {
|
|
99
|
-
pointer-events: auto;
|
|
100
|
-
}
|
|
101
|
-
:where(.menu-content-open) :where([${verticalBarsMarker}]) > :where(:not([${verticalBarsMemberMarker}])) {
|
|
102
|
-
pointer-events: none;
|
|
103
|
-
}`;
|
|
104
|
-
const restore = (element) => {
|
|
105
|
-
lastSnapshot = "";
|
|
106
|
-
search.release(element);
|
|
107
|
-
element.removeAttribute(marker);
|
|
108
|
-
if (!stopped) crossfade.play(element, false, isVerticalBarsSource(element) ? !element.matches("ion-tab-bar") : handoffInstant);
|
|
109
|
-
if (element.getAttribute("aria-hidden") === "true") {
|
|
110
|
-
const previous = sources.get(element);
|
|
111
|
-
if (previous == null) element.removeAttribute("aria-hidden");
|
|
112
|
-
else element.setAttribute("aria-hidden", previous);
|
|
113
|
-
}
|
|
114
|
-
sources.delete(element);
|
|
115
|
-
element.dispatchEvent(new CustomEvent("nativeUIShellChange"));
|
|
116
|
-
};
|
|
117
|
-
const restoreAll = () => {
|
|
118
|
-
Array.from(sources.keys()).forEach(restore);
|
|
119
|
-
verticalBarsOwners.forEach((element) => element.removeAttribute(verticalBarsMarker));
|
|
120
|
-
verticalBarsOwners.clear();
|
|
121
|
-
verticalBarsMembers.forEach((element) => element.removeAttribute(verticalBarsMemberMarker));
|
|
122
|
-
verticalBarsMembers.clear();
|
|
123
|
-
};
|
|
124
|
-
const finishWaiters = () => {
|
|
125
|
-
const current = waiters;
|
|
126
|
-
waiters = [];
|
|
127
|
-
current.forEach((resolve) => resolve());
|
|
128
|
-
};
|
|
129
|
-
const schedule = () => {
|
|
130
|
-
if (stopped) return;
|
|
131
|
-
dirty = true;
|
|
132
|
-
if (!pending && !frame) frame = win.requestAnimationFrame(() => void sync());
|
|
133
|
-
};
|
|
134
|
-
const search = createSearchSupport(doc, id, schedule);
|
|
135
|
-
const candidateSources = (candidate) => candidate.sources ?? [candidate.element];
|
|
136
|
-
const setRejected = (element, value) => {
|
|
137
|
-
element.classList.toggle(rejectedClass, value);
|
|
138
|
-
};
|
|
139
|
-
const measuringPointerPages = /* @__PURE__ */ new WeakSet();
|
|
140
|
-
const readEnabledCandidate = (element) => {
|
|
141
|
-
if (element.matches("ion-back-button") && element.closest("ion-app.ios-theme-vertical-bars") && !isVerticalBarsCandidate(element)) return;
|
|
142
|
-
if (verticalBarsOnly && !isVerticalBarsCandidate(element)) return;
|
|
143
|
-
const pointerPage = isVerticalBarsCandidate(element) ? element.closest(".ion-page") : void 0;
|
|
144
|
-
let candidate;
|
|
145
|
-
if (pointerPage && getComputedStyle(pointerPage).pointerEvents === "none") {
|
|
146
|
-
const previous = pointerPage.style.getPropertyValue("pointer-events");
|
|
147
|
-
const priority = pointerPage.style.getPropertyPriority("pointer-events");
|
|
148
|
-
const hadStyle = pointerPage.hasAttribute("style");
|
|
149
|
-
measuringPointerPages.add(pointerPage);
|
|
150
|
-
pointerPage.style.setProperty("pointer-events", "auto", "important");
|
|
151
|
-
try {
|
|
152
|
-
candidate = readCandidate(element, id, options);
|
|
153
|
-
} finally {
|
|
154
|
-
if (previous) pointerPage.style.setProperty("pointer-events", previous, priority);
|
|
155
|
-
else pointerPage.style.removeProperty("pointer-events");
|
|
156
|
-
if (!hadStyle && !pointerPage.style.length) pointerPage.removeAttribute("style");
|
|
157
|
-
win.setTimeout(() => measuringPointerPages.delete(pointerPage), 0);
|
|
158
|
-
}
|
|
159
|
-
} else candidate = readCandidate(element, id, options);
|
|
160
|
-
if (candidate && isVerticalBarsCandidate(element)) {
|
|
161
|
-
if (!nativeVerticalBars()) return void 0;
|
|
162
|
-
candidate.control.placement = "vertical-bars";
|
|
163
|
-
if ([
|
|
164
|
-
"ion-button",
|
|
165
|
-
"ion-buttons",
|
|
166
|
-
"ion-menu-button"
|
|
167
|
-
].includes(candidate.control.kind)) {
|
|
168
|
-
const slot = (element.matches("ion-buttons") ? element : element.closest("ion-buttons") ?? element).getAttribute("slot");
|
|
169
|
-
if (slot === "start" || slot === "end") candidate.control.toolbarSlot = slot;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return candidate && controlEnabled(candidate) ? candidate : void 0;
|
|
173
|
-
};
|
|
174
|
-
const flush = async () => {
|
|
175
|
-
if (stopped) return;
|
|
176
|
-
schedule();
|
|
177
|
-
try {
|
|
178
|
-
await bounded(new Promise((resolve) => waiters.push(resolve)));
|
|
179
|
-
} catch (error) {
|
|
180
|
-
await fail(error);
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
const blocked = (element) => verticalBarsPages.isDeparted(element) || !isVerticalBarsSource(element) && (Array.from(suspended).some((scopes) => scopes.some((scope) => scope.contains(element))) || Array.from(pages).some((scope) => scope.contains(element)) || Array.from(moving.keys()).some((surface) => surface.contains(element)));
|
|
184
|
-
const painted = () => new Promise((resolve) => win.requestAnimationFrame(() => win.requestAnimationFrame(() => resolve())));
|
|
185
|
-
const overlayOpen = (includeMenu = true, allowModal = false) => {
|
|
186
|
-
const modal = topModal(doc);
|
|
187
|
-
const ignored = (element) => allowModal && !!modal && modalUsesVerticalBars(modal) && element.matches("ion-modal");
|
|
188
|
-
for (const element of presented) if (!element.isConnected) presented.delete(element);
|
|
189
|
-
const presentedOverlayOpen = Array.from(presented).some((element) => !ignored(element) && (includeMenu || !element.matches("ion-menu")));
|
|
190
|
-
return manualSuspensions.size > 0 || presentedOverlayOpen || Array.from(doc.querySelectorAll(overlays)).some((element) => !ignored(element) && (includeMenu || !element.matches("ion-menu")) && (element.presented || element.classList.contains("show-menu")));
|
|
191
|
-
};
|
|
192
|
-
const signature = (candidate) => JSON.stringify({
|
|
193
|
-
control: candidate.control,
|
|
194
|
-
icons: candidate.icons.map(({ source }) => source)
|
|
195
|
-
});
|
|
196
|
-
const read = () => {
|
|
197
|
-
search.keepSearchTabsVisible();
|
|
198
|
-
for (const page of pages) if (!page.isConnected) pages.delete(page);
|
|
199
|
-
for (const surface of moving.keys()) if (!surface.isConnected) moving.delete(surface);
|
|
200
|
-
if (doc.hidden || overlayOpen(false, true)) return [];
|
|
201
|
-
if (win.visualViewport && (win.visualViewport.scale !== 1 || win.visualViewport.offsetTop !== 0) && !search.hasActive()) return [];
|
|
202
|
-
const menuOpen = overlayOpen();
|
|
203
|
-
const candidates = unprojected(sources.keys(), () => search.decorate(Array.from(doc.querySelectorAll(selector)).filter((element) => inVerticalBarsSurface(element) && !verticalBarsPages.isDeparted(element) && (!blocked(element) || menuOpen && isVerticalBarsSource(element))).map(readEnabledCandidate).filter((candidate) => !!candidate), blocked).filter((candidate) => !rejected.has(candidate.element) || rejected.get(candidate.element) !== signature(candidate)));
|
|
204
|
-
const back = preferredVerticalBarsBack(candidates.filter((candidate) => candidate.control.kind === "ion-back-button" && isVerticalBarsCandidate(candidate.element)).map((candidate) => candidate.element), doc);
|
|
205
|
-
const selected = candidates.filter((candidate) => candidate.control.kind !== "ion-back-button" || !isVerticalBarsCandidate(candidate.element) || candidate.element === back);
|
|
206
|
-
return menuOpen ? selected.filter((candidate) => isVerticalBarsCandidate(candidate.element)) : selected;
|
|
207
|
-
};
|
|
208
|
-
const observe = () => {
|
|
209
|
-
const wanted = /* @__PURE__ */ new Set();
|
|
210
|
-
for (const element of Array.from(doc.querySelectorAll(selector))) {
|
|
211
|
-
wanted.add(element);
|
|
212
|
-
if (element.parentElement) wanted.add(element.parentElement);
|
|
213
|
-
const inspectShadow = (node) => {
|
|
214
|
-
if (node.shadowRoot) {
|
|
215
|
-
wanted.add(node.shadowRoot);
|
|
216
|
-
node.shadowRoot.querySelectorAll("ion-icon").forEach(inspectShadow);
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
inspectShadow(element);
|
|
220
|
-
element.querySelectorAll(shadowSelector).forEach(inspectShadow);
|
|
221
|
-
}
|
|
222
|
-
if (wanted.size === observed.size && Array.from(wanted).every((element) => observed.has(element))) return;
|
|
223
|
-
observer.disconnect();
|
|
224
|
-
resize.disconnect();
|
|
225
|
-
observed.clear();
|
|
226
|
-
observer.observe(doc.documentElement, observation);
|
|
227
|
-
for (const element of wanted) {
|
|
228
|
-
observed.add(element);
|
|
229
|
-
if (element instanceof ShadowRoot) observer.observe(element, observation);
|
|
230
|
-
else resize.observe(element);
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
const fail = async (error) => {
|
|
234
|
-
reason = error instanceof Error ? error.message : String(error);
|
|
235
|
-
console.warn("[Native UI Shell] Returning to Web:", reason);
|
|
236
|
-
await handle.destroy();
|
|
237
|
-
win.dispatchEvent(new Event("nativeUIShellRefresh"));
|
|
238
|
-
};
|
|
239
|
-
const sync = async () => {
|
|
240
|
-
frame = 0;
|
|
241
|
-
dirty = false;
|
|
242
|
-
pending = true;
|
|
243
|
-
syncToolbarText(doc);
|
|
244
|
-
handoffInstant = tabSwitchHandoff || handoffAcrossPending || modalPresentHandoff || win.performance.now() < handoffUntil;
|
|
245
|
-
modalPresentHandoff = false;
|
|
246
|
-
try {
|
|
247
|
-
const size = `${win.innerWidth}:${win.innerHeight}`;
|
|
248
|
-
if (viewport !== size) {
|
|
249
|
-
viewport = size;
|
|
250
|
-
dirty = true;
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
observe();
|
|
254
|
-
const candidates = read();
|
|
255
|
-
const signatures = new Map(candidates.map((candidate) => [candidate.element, signature(candidate)]));
|
|
256
|
-
for (const candidate of candidates) for (const icon of candidate.icons) {
|
|
257
|
-
const field = icon.field ?? "icon";
|
|
258
|
-
icon.item[field] = await icons.render(icon.source, field === "icon" ? icon.item.iconWidth : icon.item.closeIconWidth, field === "icon" ? icon.item.iconHeight : icon.item.closeIconHeight);
|
|
259
|
-
}
|
|
260
|
-
if (stopped || dirty) return;
|
|
261
|
-
const retained = new Set(candidates.flatMap(candidateSources));
|
|
262
|
-
const removed = Array.from(sources.keys()).filter((element) => !retained.has(element));
|
|
263
|
-
if (removed.length) {
|
|
264
|
-
removed.forEach(restore);
|
|
265
|
-
if (!handoffInstant && removed.some((element) => !isVerticalBarsSource(element))) {
|
|
266
|
-
await painted();
|
|
267
|
-
if (stopped || dirty) return;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
const root = doc.querySelector("ion-app.ios-theme-vertical-bars");
|
|
271
|
-
const verticalBarEdge = root ? root.classList.contains("ios-theme-vertical-bars-left") ? "left" : "right" : void 0;
|
|
272
|
-
const modal = topModal(doc);
|
|
273
|
-
const data = {
|
|
274
|
-
verticalBarFrame: modal && modalUsesVerticalBars(modal) ? modalVerticalBarFrame(modal) : void 0,
|
|
275
|
-
viewportWidth: win.innerWidth,
|
|
276
|
-
verticalBarEdge,
|
|
277
|
-
controls: candidates.map((candidate) => candidate.control)
|
|
278
|
-
};
|
|
279
|
-
const serialized = JSON.stringify(data);
|
|
280
|
-
if (serialized === lastSnapshot && !forceRefresh) return;
|
|
281
|
-
const snapshot = {
|
|
282
|
-
...data,
|
|
283
|
-
revision: ++revision,
|
|
284
|
-
transitionDuration: crossfade.duration(handoffInstant)
|
|
285
|
-
};
|
|
286
|
-
forceRefresh = false;
|
|
287
|
-
updates++;
|
|
288
|
-
updatingRevision = snapshot.revision;
|
|
289
|
-
const result = await bounded(plugin.update(snapshot));
|
|
290
|
-
if (stopped) return;
|
|
291
|
-
if (result.revision !== snapshot.revision) throw new Error("Native UI Shell revision mismatch");
|
|
292
|
-
if (`${win.innerWidth}:${win.innerHeight}` !== size) {
|
|
293
|
-
lastSnapshot = "";
|
|
294
|
-
dirty = true;
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
if (result.rejectedSearches?.length) {
|
|
298
|
-
search.reject(result.rejectedSearches);
|
|
299
|
-
lastSnapshot = "";
|
|
300
|
-
dirty = true;
|
|
301
|
-
}
|
|
302
|
-
for (const candidate of candidates) if (result.rejectedControls?.includes(candidate.control.id)) {
|
|
303
|
-
rejected.set(candidate.element, signatures.get(candidate.element));
|
|
304
|
-
setRejected(candidate.element, true);
|
|
305
|
-
dirty = true;
|
|
306
|
-
}
|
|
307
|
-
const currentCandidates = dirty ? read() : candidates;
|
|
308
|
-
const current = dirty ? new Map(currentCandidates.map((candidate) => [candidate.element, signature(candidate)])) : signatures;
|
|
309
|
-
const currentSources = new Set(currentCandidates.flatMap(candidateSources));
|
|
310
|
-
const accepted = candidates.filter((candidate) => current.get(candidate.element) === signatures.get(candidate.element));
|
|
311
|
-
accepted.forEach((candidate) => setRejected(candidate.element, false));
|
|
312
|
-
const acceptedVerticalBarsOwners = new Set(accepted.filter((candidate) => candidate.control.placement === "vertical-bars").map((candidate) => candidate.element));
|
|
313
|
-
const acceptedVerticalBarsMembers = new Set(accepted.filter((candidate) => candidate.control.placement === "vertical-bars").flatMap((candidate) => Array.from(candidate.actions.values())));
|
|
314
|
-
const invalidated = candidates.length !== accepted.length;
|
|
315
|
-
acceptedRevision = result.revision;
|
|
316
|
-
lastSnapshot = invalidated ? "" : serialized;
|
|
317
|
-
actions = new Map(candidates.filter((candidate) => current.has(candidate.element)).flatMap((candidate) => Array.from(candidate.actions)));
|
|
318
|
-
for (const element of sources.keys()) if (!currentSources.has(element)) restore(element);
|
|
319
|
-
for (const element of verticalBarsOwners) {
|
|
320
|
-
if (acceptedVerticalBarsOwners.has(element)) continue;
|
|
321
|
-
element.removeAttribute(verticalBarsMarker);
|
|
322
|
-
verticalBarsOwners.delete(element);
|
|
323
|
-
}
|
|
324
|
-
for (const element of acceptedVerticalBarsOwners) {
|
|
325
|
-
element.setAttribute(verticalBarsMarker, "");
|
|
326
|
-
verticalBarsOwners.add(element);
|
|
327
|
-
}
|
|
328
|
-
for (const element of verticalBarsMembers) {
|
|
329
|
-
if (acceptedVerticalBarsMembers.has(element)) continue;
|
|
330
|
-
element.removeAttribute(verticalBarsMemberMarker);
|
|
331
|
-
verticalBarsMembers.delete(element);
|
|
332
|
-
}
|
|
333
|
-
for (const element of acceptedVerticalBarsMembers) {
|
|
334
|
-
element.setAttribute(verticalBarsMemberMarker, "");
|
|
335
|
-
verticalBarsMembers.add(element);
|
|
336
|
-
}
|
|
337
|
-
for (const element of accepted.flatMap(candidateSources)) {
|
|
338
|
-
const newlyProjected = !sources.has(element) || !element.hasAttribute("data-native-ui-shell");
|
|
339
|
-
if (!sources.has(element)) {
|
|
340
|
-
sources.set(element, element.getAttribute("aria-hidden"));
|
|
341
|
-
crossfade.play(element, true, handoffInstant || isVerticalBarsSource(element));
|
|
342
|
-
}
|
|
343
|
-
element.setAttribute(marker, "");
|
|
344
|
-
element.setAttribute("aria-hidden", "true");
|
|
345
|
-
if (newlyProjected) element.dispatchEvent(new CustomEvent("nativeUIShellChange"));
|
|
346
|
-
}
|
|
347
|
-
const received = pendingActivations;
|
|
348
|
-
pendingActivations = [];
|
|
349
|
-
received.forEach(activate);
|
|
350
|
-
await crossfade.settled();
|
|
351
|
-
if (invalidated) {
|
|
352
|
-
dirty = true;
|
|
353
|
-
await painted();
|
|
354
|
-
}
|
|
355
|
-
} catch (error) {
|
|
356
|
-
await fail(error);
|
|
357
|
-
} finally {
|
|
358
|
-
updatingRevision = void 0;
|
|
359
|
-
pendingActivations = [];
|
|
360
|
-
if (forceRefresh) rejected = /* @__PURE__ */ new WeakMap();
|
|
361
|
-
if (!stopped && (handoffAcrossPending || handoffInstant && dirty)) handoffUntil = Math.max(handoffUntil, win.performance.now() + 400);
|
|
362
|
-
handoffAcrossPending = false;
|
|
363
|
-
pending = false;
|
|
364
|
-
if (dirty && !stopped) schedule();
|
|
365
|
-
else finishWaiters();
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
const observation = {
|
|
369
|
-
subtree: true,
|
|
370
|
-
childList: true,
|
|
371
|
-
characterData: true,
|
|
372
|
-
attributes: true,
|
|
373
|
-
attributeOldValue: true
|
|
374
|
-
};
|
|
375
|
-
const observer = new MutationObserver((records) => {
|
|
376
|
-
if (records.some((record) => record.attributeName !== "data-native-ui-shell" && record.attributeName !== "data-native-ui-shell-toolbar-text" && record.attributeName !== "data-native-ui-shell-fading" && !prehideOnlyMutation(record) && !(record.attributeName === "style" && measuringPointerPages.has(record.target)) && !(record.attributeName === "aria-hidden" && sources.has(record.target) && record.target.getAttribute("aria-hidden") === "true"))) schedule();
|
|
377
|
-
});
|
|
378
|
-
const resize = new ResizeObserver(schedule);
|
|
379
|
-
const on = (target, name, callback = schedule) => target.addEventListener(name, callback, {
|
|
380
|
-
capture: true,
|
|
381
|
-
signal: listeners.signal
|
|
382
|
-
});
|
|
383
|
-
const pageWill = (event) => {
|
|
384
|
-
const page = event.target;
|
|
385
|
-
verticalBarsPages.lifecycle(event);
|
|
386
|
-
getNativeSearchBindings(doc).filter((binding) => page.contains(binding.footer)).forEach((binding) => search.retire(binding));
|
|
387
|
-
if (event.type === LIFECYCLE_WILL_LEAVE) beginTabSwitchHandoffIfNeeded(page);
|
|
388
|
-
pages.add(page);
|
|
389
|
-
schedule();
|
|
390
|
-
};
|
|
391
|
-
const pageDid = (event) => {
|
|
392
|
-
const page = event.target;
|
|
393
|
-
verticalBarsPages.lifecycle(event);
|
|
394
|
-
pages.delete(page);
|
|
395
|
-
schedule();
|
|
396
|
-
if (tabSwitchHandoff && pages.size === 0) endTabSwitchHandoff();
|
|
397
|
-
};
|
|
398
|
-
const tabOfPath = (tabs, pathname) => {
|
|
399
|
-
let best;
|
|
400
|
-
for (const button of Array.from(tabs.querySelectorAll("ion-tab-button"))) {
|
|
401
|
-
const tab = button.getAttribute("tab");
|
|
402
|
-
const href = button.getAttribute("href")?.split(/[?#]/)[0];
|
|
403
|
-
if (!tab || !href) continue;
|
|
404
|
-
if (pathname === href || pathname.startsWith(`${href}/`)) {
|
|
405
|
-
if (!best || href.length > best.length) best = {
|
|
406
|
-
tab,
|
|
407
|
-
length: href.length
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
return best?.tab;
|
|
412
|
-
};
|
|
413
|
-
const armTabSwitchHandoff = () => {
|
|
414
|
-
tabSwitchHandoff = true;
|
|
415
|
-
handoffUntil = Math.max(handoffUntil, win.performance.now() + 400);
|
|
416
|
-
if (pending) handoffAcrossPending = true;
|
|
417
|
-
};
|
|
418
|
-
const beginTabSwitchHandoffIfNeeded = (page) => {
|
|
419
|
-
const tabs = page.closest("ion-tabs");
|
|
420
|
-
if (!tabs) return;
|
|
421
|
-
const bar = tabs.querySelector("ion-tab-bar");
|
|
422
|
-
const selected = (bar && "selectedTab" in bar ? String(bar.selectedTab ?? "") : "") || tabs.querySelector("ion-tab-button.tab-selected")?.getAttribute("tab") || void 0;
|
|
423
|
-
const destination = tabOfPath(tabs, win.location.pathname);
|
|
424
|
-
if (selected && destination && selected !== destination) armTabSwitchHandoff();
|
|
425
|
-
};
|
|
426
|
-
const endTabSwitchHandoff = () => {
|
|
427
|
-
win.requestAnimationFrame(() => {
|
|
428
|
-
if (stopped || !tabSwitchHandoff) return;
|
|
429
|
-
tabSwitchHandoff = false;
|
|
430
|
-
schedule();
|
|
431
|
-
});
|
|
432
|
-
};
|
|
433
|
-
const motion = (event) => {
|
|
434
|
-
const target = event.target;
|
|
435
|
-
if (!target.matches?.(motionSelector)) return;
|
|
436
|
-
const key = event.propertyName ?? event.animationName;
|
|
437
|
-
if (event.type === CSS_MOTION_EVENTS.transitionRun || event.type === CSS_MOTION_EVENTS.animationStart) {
|
|
438
|
-
const keys = moving.get(target) ?? /* @__PURE__ */ new Set();
|
|
439
|
-
keys.add(key);
|
|
440
|
-
moving.set(target, keys);
|
|
441
|
-
} else {
|
|
442
|
-
moving.get(target)?.delete(key);
|
|
443
|
-
if (!moving.get(target)?.size) moving.delete(target);
|
|
444
|
-
}
|
|
445
|
-
schedule();
|
|
446
|
-
};
|
|
447
|
-
for (const name of Object.values(CSS_MOTION_EVENTS)) on(doc, name, motion);
|
|
448
|
-
for (const name of [LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE]) on(doc, name, pageWill);
|
|
449
|
-
for (const name of [LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE]) on(doc, name, pageDid);
|
|
450
|
-
on(doc, VERTICAL_BARS_TRANSITION_CANCELED, (event) => {
|
|
451
|
-
const leaving = event.target;
|
|
452
|
-
const entering = event.detail?.entering;
|
|
453
|
-
verticalBarsPages.cancel(entering, leaving);
|
|
454
|
-
pages.delete(leaving);
|
|
455
|
-
if (entering) pages.delete(entering);
|
|
456
|
-
schedule();
|
|
457
|
-
});
|
|
458
|
-
on(doc, "ionTabsWillChange", () => {
|
|
459
|
-
armTabSwitchHandoff();
|
|
460
|
-
schedule();
|
|
461
|
-
});
|
|
462
|
-
on(doc, "ionTabsDidChange", endTabSwitchHandoff);
|
|
463
|
-
for (const name of overlayNames) {
|
|
464
|
-
on(doc, `ion${name}WillPresent`, (event) => {
|
|
465
|
-
presented.add(event.target);
|
|
466
|
-
if (name === "Modal") {
|
|
467
|
-
modalPresentHandoff = true;
|
|
468
|
-
if (pending) handoffInstant = true;
|
|
469
|
-
}
|
|
470
|
-
schedule();
|
|
471
|
-
});
|
|
472
|
-
on(doc, `ion${name}DidDismiss`, (event) => {
|
|
473
|
-
presented.delete(event.target);
|
|
474
|
-
schedule();
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
const eventMenu = (event) => event.composedPath().find((target) => target instanceof HTMLElement && target.matches("ion-menu"));
|
|
478
|
-
on(doc, "ionWillOpen", (event) => {
|
|
479
|
-
const menu = eventMenu(event);
|
|
480
|
-
if (menu) presented.add(menu);
|
|
481
|
-
schedule();
|
|
482
|
-
});
|
|
483
|
-
on(doc, "ionDidClose", (event) => {
|
|
484
|
-
const menu = eventMenu(event);
|
|
485
|
-
if (menu) presented.delete(menu);
|
|
486
|
-
schedule();
|
|
487
|
-
});
|
|
488
|
-
for (const name of [
|
|
489
|
-
"ionChange",
|
|
490
|
-
"ionSelect",
|
|
491
|
-
"ionImgDidLoad",
|
|
492
|
-
CSS_MOTION_EVENTS.transitionEnd,
|
|
493
|
-
CSS_MOTION_EVENTS.animationEnd,
|
|
494
|
-
"focusin",
|
|
495
|
-
"focusout"
|
|
496
|
-
]) on(doc, name);
|
|
497
|
-
const refreshLayout = () => {
|
|
498
|
-
rejected = /* @__PURE__ */ new WeakMap();
|
|
499
|
-
forceRefresh = true;
|
|
500
|
-
schedule();
|
|
501
|
-
};
|
|
502
|
-
on(doc, "visibilitychange", () => {
|
|
503
|
-
if (doc.hidden) {
|
|
504
|
-
getNativeSearchBindings(doc).forEach((binding) => search.retire(binding));
|
|
505
|
-
schedule();
|
|
506
|
-
} else refreshLayout();
|
|
507
|
-
});
|
|
508
|
-
on(win, "resize", refreshLayout);
|
|
509
|
-
on(win, "keyboardWillShow", () => search.keyboard(true));
|
|
510
|
-
on(win, "keyboardWillHide", () => search.keyboard(false));
|
|
511
|
-
on(win, "scroll");
|
|
512
|
-
on(win.matchMedia("(prefers-color-scheme: dark)"), "change");
|
|
513
|
-
on(win, "nativeUIShellRefresh", (event) => {
|
|
514
|
-
if (event.retireSearch) getNativeSearchBindings(doc).forEach((binding) => search.retire(binding));
|
|
515
|
-
refreshLayout();
|
|
516
|
-
});
|
|
517
|
-
if (win.visualViewport) {
|
|
518
|
-
on(win.visualViewport, "resize", refreshLayout);
|
|
519
|
-
on(win.visualViewport, "scroll");
|
|
520
|
-
}
|
|
521
|
-
const handle = {
|
|
522
|
-
getStatus: () => ({
|
|
523
|
-
state: stopped ? "stopped" : sources.size ? "native" : "web",
|
|
524
|
-
projected: sources.size,
|
|
525
|
-
updates,
|
|
526
|
-
reason
|
|
527
|
-
}),
|
|
528
|
-
async suspend() {
|
|
529
|
-
const token = Symbol();
|
|
530
|
-
let resumed = false;
|
|
531
|
-
if (!stopped) {
|
|
532
|
-
manualSuspensions.add(token);
|
|
533
|
-
getNativeSearchBindings(doc).forEach((binding) => search.retire(binding));
|
|
534
|
-
await flush();
|
|
535
|
-
}
|
|
536
|
-
return { async resume() {
|
|
537
|
-
if (resumed) return;
|
|
538
|
-
resumed = true;
|
|
539
|
-
if (stopped || !manualSuspensions.delete(token)) return;
|
|
540
|
-
await flush();
|
|
541
|
-
} };
|
|
542
|
-
},
|
|
543
|
-
async destroy() {
|
|
544
|
-
if (stopped) return;
|
|
545
|
-
stopped = true;
|
|
546
|
-
setNativeUIShellIntegration(doc);
|
|
547
|
-
win.cancelAnimationFrame(frame);
|
|
548
|
-
listeners.abort();
|
|
549
|
-
observer.disconnect();
|
|
550
|
-
resize.disconnect();
|
|
551
|
-
observed.clear();
|
|
552
|
-
actions.clear();
|
|
553
|
-
pendingActivations = [];
|
|
554
|
-
search.destroy();
|
|
555
|
-
crossfade.destroy();
|
|
556
|
-
restoreAll();
|
|
557
|
-
if (!doc.hidden) await painted();
|
|
558
|
-
try {
|
|
559
|
-
await bounded(plugin.clear({ revision: ++revision }));
|
|
560
|
-
} catch {}
|
|
561
|
-
style.remove();
|
|
562
|
-
doc.querySelectorAll(`.${rejectedClass}`).forEach((element) => setRejected(element, false));
|
|
563
|
-
icons.clear();
|
|
564
|
-
pages.clear();
|
|
565
|
-
presented.clear();
|
|
566
|
-
manualSuspensions.clear();
|
|
567
|
-
moving.clear();
|
|
568
|
-
suspended.clear();
|
|
569
|
-
await listener?.remove().catch(() => {});
|
|
570
|
-
await searchListener?.remove().catch(() => {});
|
|
571
|
-
finishWaiters();
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
const activate = (event) => {
|
|
575
|
-
if (stopped || doc.hidden || event.revision < acceptedRevision || event.revision > revision || event.sequence <= lastSequence || overlayOpen(false, true)) return;
|
|
576
|
-
if (event.revision > acceptedRevision && event.revision === updatingRevision) {
|
|
577
|
-
pendingActivations.push(event);
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
lastSequence = event.sequence;
|
|
581
|
-
const element = actions.get(event.id);
|
|
582
|
-
if (!element) return;
|
|
583
|
-
const owner = Array.from(sources.keys()).find((source) => source === element || source.contains(element));
|
|
584
|
-
if (!owner || !inVerticalBarsSurface(owner)) return;
|
|
585
|
-
const candidate = !blocked(owner) && unprojected(sources.keys(), () => readEnabledCandidate(owner)) || read().find((candidate) => candidate.actions.has(event.id));
|
|
586
|
-
const item = candidate?.control.items.find((item) => item.id === event.id);
|
|
587
|
-
if (!(candidate?.control.search && [candidate.control.search.trigger.id, candidate.control.search.closeId].includes(event.id)) && (!item || item.disabled || item.visible === false)) return;
|
|
588
|
-
activateProjectedElement(element);
|
|
589
|
-
lastSnapshot = "";
|
|
590
|
-
schedule();
|
|
591
|
-
};
|
|
592
|
-
try {
|
|
593
|
-
listener = await bounded(plugin.addListener("activate", activate));
|
|
594
|
-
searchListener = await bounded(plugin.addListener("search", (event) => {
|
|
595
|
-
if (stopped || doc.hidden || event.revision < acceptedRevision || event.revision > revision || overlayOpen()) return;
|
|
596
|
-
search.event(event);
|
|
597
|
-
}));
|
|
598
|
-
doc.head.append(style);
|
|
599
|
-
observer.observe(doc.documentElement, observation);
|
|
600
|
-
setNativeUIShellIntegration(doc, {
|
|
601
|
-
async search(binding, active, focus) {
|
|
602
|
-
if (!getNativeSearchBindings(doc).includes(binding) || !search.projected(binding)) return false;
|
|
603
|
-
if (!active) search.setStatus(binding, false);
|
|
604
|
-
else {
|
|
605
|
-
const entering = !binding.active;
|
|
606
|
-
if (entering) search.begin(binding, revision + 1);
|
|
607
|
-
const nextFocused = focus === true ? true : focus === false ? false : entering ? false : binding.focused;
|
|
608
|
-
search.setStatus(binding, true, nextFocused);
|
|
609
|
-
}
|
|
610
|
-
await flush();
|
|
611
|
-
return !stopped && search.projected(binding);
|
|
612
|
-
},
|
|
613
|
-
async suspend(scopes) {
|
|
614
|
-
getNativeSearchBindings(doc).filter((binding) => scopes.some((scope) => scope.contains(binding.footer) || scope.contains(binding.tabBar))).forEach((binding) => search.retire(binding));
|
|
615
|
-
suspended.add(scopes);
|
|
616
|
-
await flush();
|
|
617
|
-
await new Promise((resolve) => win.requestAnimationFrame(() => resolve()));
|
|
618
|
-
return (canceled = false) => {
|
|
619
|
-
suspended.delete(scopes);
|
|
620
|
-
if (canceled || !scopes.some((scope) => scope.closest("ion-app.ios-theme-vertical-bars"))) {
|
|
621
|
-
scopes.forEach((scope) => pages.delete(scope));
|
|
622
|
-
if (canceled) verticalBarsPages.cancel(scopes[0], scopes[1]);
|
|
623
|
-
}
|
|
624
|
-
schedule();
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
on(win, "pagehide", () => {
|
|
629
|
-
handle.destroy();
|
|
630
|
-
});
|
|
631
|
-
schedule();
|
|
632
|
-
} catch (error) {
|
|
633
|
-
await fail(error);
|
|
634
|
-
}
|
|
635
|
-
return handle;
|
|
636
|
-
};
|
|
637
|
-
//#endregion
|
|
638
|
-
export { createRuntime };
|
|
639
|
-
|
|
640
|
-
//# sourceMappingURL=runtime.js.map
|