@rdlabo/ionic-theme-ios27 0.1.0 → 0.2.1-beta.pr185.sha0793981f6cf4
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 +34 -8
- package/dist/css/components/ion-button.css +1 -1
- package/dist/css/components/ion-fab.css +1 -1
- package/dist/css/components/ion-list.css +1 -1
- package/dist/css/components/ion-menu.css +1 -1
- package/dist/css/components/ion-searchbar.css +1 -1
- package/dist/css/components/ion-tabs.css +1 -1
- package/dist/css/components/ion-toolbar.css +1 -1
- package/dist/css/ionic-theme-ios27.css +1 -1
- package/dist/css/md-ion-list-inset.css +1 -1
- package/dist/css/utils/translucent.css +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/native/components/searchable-tabs.d.ts +2 -0
- package/dist/native/components/searchable-tabs.d.ts.map +1 -1
- package/dist/native/components/searchable-tabs.js +131 -21
- package/dist/native/definitions.d.ts +19 -0
- package/dist/native/definitions.d.ts.map +1 -1
- package/dist/native/index.d.ts +4 -3
- package/dist/native/index.d.ts.map +1 -1
- package/dist/native/index.js +22 -9
- package/dist/native/lifecycle.d.ts +4 -0
- package/dist/native/lifecycle.d.ts.map +1 -0
- package/dist/native/lifecycle.js +34 -0
- package/dist/native/runtime.d.ts +2 -2
- package/dist/native/runtime.d.ts.map +1 -1
- package/dist/native/runtime.js +57 -11
- package/dist/tab-bar-searchable/animations/enter.d.ts +1 -1
- package/dist/tab-bar-searchable/animations/enter.d.ts.map +1 -1
- package/dist/tab-bar-searchable/animations/enter.js +1 -1
- package/dist/tab-bar-searchable/animations/leave.d.ts +1 -1
- package/dist/tab-bar-searchable/animations/leave.d.ts.map +1 -1
- package/dist/tab-bar-searchable/animations/leave.js +1 -1
- package/dist/tab-bar-searchable/index.d.ts +2 -2
- package/dist/tab-bar-searchable/index.d.ts.map +1 -1
- package/dist/tab-bar-searchable/index.js +2 -3
- package/dist/transition/ios.transition.d.ts +6 -1
- package/dist/transition/ios.transition.d.ts.map +1 -1
- package/dist/transition/ios.transition.js +10 -385
- package/docs/features.md +3 -1
- package/docs/ios-adaptive.md +20 -21
- package/docs/native-ui-shell.md +117 -3
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellSearchController.swift +243 -64
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellTabBar.swift +77 -6
- package/ios/Sources/IonicNativeUIShellPlugin/IonicNativeUIShellPlugin.swift +106 -11
- package/ios/Tests/IonicNativeUIShellPluginTests/ShellSnapshotTests.swift +258 -2
- package/node_modules/@rdlabo/ionic-theme-utils/LICENSE +21 -0
- package/node_modules/@rdlabo/ionic-theme-utils/README.md +28 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/dom.d.ts +3 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/dom.d.ts.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/dom.js +13 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/dom.js.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/focus-controller.d.ts +6 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/focus-controller.d.ts.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/focus-controller.js +37 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/focus-controller.js.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/index.d.ts +13 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/index.d.ts.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/index.js +11 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/index.js.map +1 -0
- package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/animations/ios.enter.d.ts +0 -1
- package/node_modules/@rdlabo/ionic-theme-utils/dist/popover/animations/ios.enter.d.ts.map +1 -0
- package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/animations/ios.enter.js +8 -5
- package/node_modules/@rdlabo/ionic-theme-utils/dist/popover/animations/ios.enter.js.map +1 -0
- package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/animations/ios.leave.d.ts.map +1 -1
- package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/animations/ios.leave.js +11 -5
- package/node_modules/@rdlabo/ionic-theme-utils/dist/popover/animations/ios.leave.js.map +1 -0
- package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/callout-surface.js +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/popover/callout-surface.js.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/popover/popover-interface.js +2 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/popover/popover-interface.js.map +1 -0
- package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/utils.d.ts +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/popover/utils.d.ts.map +1 -0
- package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/utils.js +3 -2
- package/node_modules/@rdlabo/ionic-theme-utils/dist/popover/utils.js.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/sheets-of-glass.d.ts +16 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/sheets-of-glass.d.ts.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/sheets-of-glass.js +2 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/sheets-of-glass.js.map +1 -0
- package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/tab-bar-searchable/interfaces.js +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/tab-bar-searchable/interfaces.js.map +1 -0
- package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/tab-bar-searchable/utils.js +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/tab-bar-searchable/utils.js.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/theme.d.ts +15 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/theme.d.ts.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/theme.js +49 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/theme.js.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/transition/ios.transition.d.ts +18 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/transition/ios.transition.d.ts.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/transition/ios.transition.js +412 -0
- package/node_modules/@rdlabo/ionic-theme-utils/dist/transition/ios.transition.js.map +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/package.json +64 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/dom.spec.ts +19 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/dom.ts +16 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/focus-controller.ts +38 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/index.ts +59 -0
- package/{src → node_modules/@rdlabo/ionic-theme-utils/src}/popover/animations/ios.enter.ts +7 -5
- package/{src → node_modules/@rdlabo/ionic-theme-utils/src}/popover/animations/ios.leave.ts +14 -5
- package/node_modules/@rdlabo/ionic-theme-utils/src/popover/utils.spec.ts +58 -0
- package/{src → node_modules/@rdlabo/ionic-theme-utils/src}/popover/utils.ts +4 -2
- package/node_modules/@rdlabo/ionic-theme-utils/src/sheets-of-glass.ts +17 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/styles/index.scss +1 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/styles/md-ion-list-inset.scss +20 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/styles/structured-list.scss +310 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/tab-bar-searchable/utils.spec.ts +56 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/theme.ts +51 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/transition/ios.transition.spec.ts +52 -0
- package/node_modules/@rdlabo/ionic-theme-utils/src/transition/ios.transition.ts +542 -0
- package/package.json +13 -5
- package/src/index.ts +4 -2
- package/src/native/components/searchable-tabs.ts +142 -22
- package/src/native/definitions.ts +34 -0
- package/src/native/index.ts +38 -11
- package/src/native/lifecycle.ts +38 -0
- package/src/native/runtime.ts +60 -10
- package/src/styles/components/ion-button.scss +21 -10
- package/src/styles/components/ion-fab.scss +10 -4
- package/src/styles/components/ion-list.scss +12 -3
- package/src/styles/components/ion-menu.scss +17 -10
- package/src/styles/components/ion-searchbar.scss +1 -1
- package/src/styles/components/ion-tabs.scss +14 -10
- package/src/styles/components/ion-toolbar.scss +9 -10
- package/src/styles/md-ion-list-inset.scss +2 -2
- package/src/styles/utils/dark/ion-list.scss +1 -1
- package/src/styles/utils/translucent.scss +44 -0
- package/src/tab-bar-searchable/animations/enter.ts +1 -2
- package/src/tab-bar-searchable/animations/leave.ts +1 -2
- package/src/tab-bar-searchable/index.ts +12 -4
- package/src/transition/ios.transition.ts +14 -473
- package/dist/css/utils/structured-list.css +0 -1
- package/dist/popover/animations/ios.enter.d.ts.map +0 -1
- package/dist/popover/popover-interface.js +0 -1
- package/dist/popover/utils.d.ts.map +0 -1
- package/src/styles/utils/structured-list.scss +0 -223
- /package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/animations/ios.leave.d.ts +0 -0
- /package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/callout-surface.d.ts +0 -0
- /package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/callout-surface.d.ts.map +0 -0
- /package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/popover-interface.d.ts +0 -0
- /package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/popover/popover-interface.d.ts.map +0 -0
- /package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/tab-bar-searchable/interfaces.d.ts +0 -0
- /package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/tab-bar-searchable/interfaces.d.ts.map +0 -0
- /package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/tab-bar-searchable/utils.d.ts +0 -0
- /package/{dist → node_modules/@rdlabo/ionic-theme-utils/dist}/tab-bar-searchable/utils.d.ts.map +0 -0
- /package/{src → node_modules/@rdlabo/ionic-theme-utils/src}/popover/callout-surface.ts +0 -0
- /package/{src → node_modules/@rdlabo/ionic-theme-utils/src}/popover/popover-interface.ts +0 -0
- /package/{src → node_modules/@rdlabo/ionic-theme-utils/src}/tab-bar-searchable/interfaces.ts +0 -0
- /package/{src → node_modules/@rdlabo/ionic-theme-utils/src}/tab-bar-searchable/utils.ts +0 -0
package/dist/native/runtime.js
CHANGED
|
@@ -12,7 +12,7 @@ const bounded = (promise) => new Promise((resolve, reject) => {
|
|
|
12
12
|
const timer = setTimeout(() => reject(new Error('Native UI Shell bridge timed out')), 5000);
|
|
13
13
|
promise.then(resolve, reject).finally(() => clearTimeout(timer));
|
|
14
14
|
});
|
|
15
|
-
export const createRuntime = async (doc, plugin) => {
|
|
15
|
+
export const createRuntime = async (doc, plugin, options = {}) => {
|
|
16
16
|
const win = doc.defaultView;
|
|
17
17
|
const icons = createIconRenderer();
|
|
18
18
|
const crossfade = createCrossfade(win);
|
|
@@ -22,6 +22,7 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
22
22
|
const suspended = new Set();
|
|
23
23
|
const pages = new Set();
|
|
24
24
|
const presented = new Set();
|
|
25
|
+
const manualSuspensions = new Set();
|
|
25
26
|
const moving = new Map();
|
|
26
27
|
const observed = new Set();
|
|
27
28
|
const listeners = new AbortController();
|
|
@@ -44,6 +45,19 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
44
45
|
let listener;
|
|
45
46
|
let searchListener;
|
|
46
47
|
let waiters = [];
|
|
48
|
+
const control = (kind) => {
|
|
49
|
+
if (kind === 'ion-tab-bar')
|
|
50
|
+
return 'tabs';
|
|
51
|
+
if (kind === 'ion-segment')
|
|
52
|
+
return 'segment';
|
|
53
|
+
if (kind === 'ion-fab')
|
|
54
|
+
return 'fab';
|
|
55
|
+
return 'toolbar';
|
|
56
|
+
};
|
|
57
|
+
const controlEnabled = (candidate) => {
|
|
58
|
+
const controls = options.controls;
|
|
59
|
+
return controls === undefined || controls[control(candidate.control.kind)] === true;
|
|
60
|
+
};
|
|
47
61
|
const id = (element) => {
|
|
48
62
|
let value = ids.get(element);
|
|
49
63
|
if (!value) {
|
|
@@ -87,6 +101,10 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
87
101
|
};
|
|
88
102
|
const search = createSearchSupport(doc, id, schedule);
|
|
89
103
|
const candidateSources = (candidate) => candidate.sources ?? [candidate.element];
|
|
104
|
+
const readEnabledCandidate = (element) => {
|
|
105
|
+
const candidate = readCandidate(element, id);
|
|
106
|
+
return candidate && controlEnabled(candidate) ? candidate : undefined;
|
|
107
|
+
};
|
|
90
108
|
const flush = async () => {
|
|
91
109
|
if (stopped)
|
|
92
110
|
return;
|
|
@@ -106,7 +124,8 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
106
124
|
for (const element of presented)
|
|
107
125
|
if (!element.isConnected)
|
|
108
126
|
presented.delete(element);
|
|
109
|
-
return (
|
|
127
|
+
return (manualSuspensions.size > 0 ||
|
|
128
|
+
presented.size > 0 ||
|
|
110
129
|
Array.from(doc.querySelectorAll(overlays)).some((element) => element.presented || element.classList.contains('show-menu')));
|
|
111
130
|
};
|
|
112
131
|
const signature = (candidate) => JSON.stringify({ control: candidate.control, icons: candidate.icons.map(({ source }) => source) });
|
|
@@ -118,12 +137,14 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
118
137
|
for (const surface of moving.keys())
|
|
119
138
|
if (!surface.isConnected)
|
|
120
139
|
moving.delete(surface);
|
|
121
|
-
if (doc.hidden || overlayOpen()
|
|
140
|
+
if (doc.hidden || overlayOpen())
|
|
141
|
+
return [];
|
|
142
|
+
if (win.visualViewport && (win.visualViewport.scale !== 1 || win.visualViewport.offsetTop !== 0) && !search.hasActive())
|
|
122
143
|
return [];
|
|
123
144
|
return unprojected(sources.keys(), () => search
|
|
124
145
|
.decorate(Array.from(doc.querySelectorAll(selector))
|
|
125
146
|
.filter((element) => !blocked(element))
|
|
126
|
-
.map(
|
|
147
|
+
.map(readEnabledCandidate)
|
|
127
148
|
.filter((candidate) => !!candidate), blocked)
|
|
128
149
|
.filter((candidate) => !rejected.has(candidate.element) || rejected.get(candidate.element) !== signature(candidate)));
|
|
129
150
|
};
|
|
@@ -211,6 +232,7 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
211
232
|
}
|
|
212
233
|
if (result.rejectedSearches?.length) {
|
|
213
234
|
search.reject(result.rejectedSearches);
|
|
235
|
+
lastSnapshot = '';
|
|
214
236
|
dirty = true;
|
|
215
237
|
}
|
|
216
238
|
for (const candidate of candidates) {
|
|
@@ -366,6 +388,25 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
366
388
|
updates,
|
|
367
389
|
reason,
|
|
368
390
|
}),
|
|
391
|
+
async suspend() {
|
|
392
|
+
const token = Symbol();
|
|
393
|
+
let resumed = false;
|
|
394
|
+
if (!stopped) {
|
|
395
|
+
manualSuspensions.add(token);
|
|
396
|
+
getNativeSearchBindings(doc).forEach((binding) => search.retire(binding));
|
|
397
|
+
await flush();
|
|
398
|
+
}
|
|
399
|
+
return {
|
|
400
|
+
async resume() {
|
|
401
|
+
if (resumed)
|
|
402
|
+
return;
|
|
403
|
+
resumed = true;
|
|
404
|
+
if (stopped || !manualSuspensions.delete(token))
|
|
405
|
+
return;
|
|
406
|
+
await flush();
|
|
407
|
+
},
|
|
408
|
+
};
|
|
409
|
+
},
|
|
369
410
|
async destroy() {
|
|
370
411
|
if (stopped)
|
|
371
412
|
return;
|
|
@@ -392,6 +433,7 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
392
433
|
icons.clear();
|
|
393
434
|
pages.clear();
|
|
394
435
|
presented.clear();
|
|
436
|
+
manualSuspensions.clear();
|
|
395
437
|
moving.clear();
|
|
396
438
|
suspended.clear();
|
|
397
439
|
await listener?.remove().catch(() => { });
|
|
@@ -418,7 +460,7 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
418
460
|
const owner = Array.from(sources.keys()).find((source) => source === element || source.contains(element));
|
|
419
461
|
if (!owner)
|
|
420
462
|
return;
|
|
421
|
-
const direct = !blocked(owner) && unprojected(sources.keys(), () =>
|
|
463
|
+
const direct = !blocked(owner) && unprojected(sources.keys(), () => readEnabledCandidate(owner));
|
|
422
464
|
const candidate = direct || read().find((candidate) => candidate.actions.has(event.id));
|
|
423
465
|
const item = candidate?.control.items.find((item) => item.id === event.id);
|
|
424
466
|
const searchAction = candidate?.control.search && [candidate.control.search.trigger.id, candidate.control.search.closeId].includes(event.id);
|
|
@@ -441,12 +483,16 @@ export const createRuntime = async (doc, plugin) => {
|
|
|
441
483
|
async search(binding, active, focus) {
|
|
442
484
|
if (!getNativeSearchBindings(doc).includes(binding) || !search.projected(binding))
|
|
443
485
|
return false;
|
|
444
|
-
if (
|
|
445
|
-
search.
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
486
|
+
if (!active) {
|
|
487
|
+
search.setStatus(binding, false);
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
const entering = !binding.active;
|
|
491
|
+
if (entering)
|
|
492
|
+
search.begin(binding, revision + 1);
|
|
493
|
+
const nextFocused = focus === true ? true : focus === false ? false : entering ? false : binding.focused;
|
|
494
|
+
search.setStatus(binding, true, nextFocused);
|
|
495
|
+
}
|
|
450
496
|
await flush();
|
|
451
497
|
return !stopped && search.projected(binding);
|
|
452
498
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ElementReferences, ElementSizes } from '../interfaces';
|
|
2
1
|
import { Animation } from '@ionic/core';
|
|
2
|
+
import { type ElementReferences, type ElementSizes } from '@rdlabo/ionic-theme-utils';
|
|
3
3
|
export declare const createEffectAnimation: (references: ElementReferences, sizes: ElementSizes) => Animation;
|
|
4
4
|
export declare const createSearchContainerAnimation: (references: ElementReferences, sizes: ElementSizes) => Animation;
|
|
5
5
|
export declare const createCloseButtonsAnimation: (references: ElementReferences) => Animation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enter.d.ts","sourceRoot":"","sources":["../../../src/tab-bar-searchable/animations/enter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"enter.d.ts","sourceRoot":"","sources":["../../../src/tab-bar-searchable/animations/enter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAqD,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzI,eAAO,MAAM,qBAAqB,GAAI,YAAY,iBAAiB,EAAE,OAAO,YAAY,KAAG,SA0B1F,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,YAAY,iBAAiB,EAAE,OAAO,YAAY,KAAG,SAUnG,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,YAAY,iBAAiB,KAAG,SAO3E,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,WAAW,WAAW,EAAE,YAAY,iBAAiB,EAAE,OAAO,YAAY,KAAG,SAyBlH,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,cAAc,WAAW,KAAG,SAWpE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnimation } from '@ionic/core';
|
|
2
|
+
import { ANIMATION_DELAY_CLOSE_BUTTONS, OPACITY_TRANSITION } from '@rdlabo/ionic-theme-utils';
|
|
2
3
|
import { cloneElement } from '../../utils';
|
|
3
|
-
import { ANIMATION_DELAY_CLOSE_BUTTONS, OPACITY_TRANSITION } from '../utils';
|
|
4
4
|
export const createEffectAnimation = (references, sizes) => {
|
|
5
5
|
const effectElement = cloneElement('ion-icon');
|
|
6
6
|
const closeButtonRect = references.closeButtonIcon?.getBoundingClientRect();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ElementReferences, ElementSizes } from '../interfaces';
|
|
2
1
|
import { Animation } from '@ionic/core';
|
|
2
|
+
import { type ElementReferences, type ElementSizes } from '@rdlabo/ionic-theme-utils';
|
|
3
3
|
export declare const createReverseEffectAnimation: (references: ElementReferences, searchableElementSizes: ElementSizes, colorSelected: string) => Animation;
|
|
4
4
|
export declare const createReverseSearchContainerAnimation: (references: ElementReferences, sizes: ElementSizes) => Animation;
|
|
5
5
|
export declare const createReverseCloseButtonsAnimation: (references: ElementReferences) => Animation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leave.d.ts","sourceRoot":"","sources":["../../../src/tab-bar-searchable/animations/leave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"leave.d.ts","sourceRoot":"","sources":["../../../src/tab-bar-searchable/animations/leave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAqD,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzI,eAAO,MAAM,4BAA4B,GACvC,YAAY,iBAAiB,EAC7B,wBAAwB,YAAY,EACpC,eAAe,MAAM,KACpB,SAyBF,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAAI,YAAY,iBAAiB,EAAE,OAAO,YAAY,KAAG,SAU1G,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAAI,YAAY,iBAAiB,KAAG,SAOlF,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,WAAW,WAAW,EAAE,YAAY,iBAAiB,EAAE,OAAO,YAAY,KAAG,SAkBzH,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,cAAc,WAAW,EAAE,YAAY,YAAY,KAAG,SAYrG,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnimation } from '@ionic/core';
|
|
2
|
+
import { ANIMATION_DELAY_CLOSE_BUTTONS, OPACITY_TRANSITION } from '@rdlabo/ionic-theme-utils';
|
|
2
3
|
import { cloneElement } from '../../utils';
|
|
3
|
-
import { ANIMATION_DELAY_CLOSE_BUTTONS, OPACITY_TRANSITION } from '../utils';
|
|
4
4
|
export const createReverseEffectAnimation = (references, searchableElementSizes, colorSelected) => {
|
|
5
5
|
const effectElement = cloneElement('ion-icon');
|
|
6
6
|
const closeButtonRect = references.closeButtonIcon?.getBoundingClientRect();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TabBarSearchableFunction } from '
|
|
2
|
-
export
|
|
1
|
+
import { type TabBarSearchableFunction } from '@rdlabo/ionic-theme-utils';
|
|
2
|
+
export { TabBarSearchableType, type TabBarSearchableFunction, type SearchableEventCache, type ElementSizes, type ElementReferences, } from '@rdlabo/ionic-theme-utils';
|
|
3
3
|
export declare const attachTabBarSearchable: (ionTabBar: HTMLElement, ionFabButton: HTMLElement, ionFooter: HTMLElement) => TabBarSearchableFunction;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-bar-searchable/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-bar-searchable/index.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,wBAAwB,EAE9B,MAAM,2BAA2B,CAAC;AAiBnC,OAAO,EACL,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,iBAAiB,GACvB,MAAM,2BAA2B,CAAC;AAqBnC,eAAO,MAAM,sBAAsB,GACjC,WAAW,WAAW,EACtB,cAAc,WAAW,EACzB,WAAW,WAAW,KACrB,wBAwDF,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { createAnimation } from '@ionic/core';
|
|
2
|
+
import { ANIMATION_DELAY_BASE, ANIMATION_DURATION, ANIMATION_EASING, getElementReferences, getElementSizes, throwErrorByFailedClickElement, TabBarSearchableType, } from '@rdlabo/ionic-theme-utils';
|
|
2
3
|
import { isNativeUIShell, registerNativeSearch, requestNativeSearch, suspendNativeUIShell } from '../native-integration';
|
|
3
|
-
import { ANIMATION_DELAY_BASE, ANIMATION_DURATION, ANIMATION_EASING, getElementReferences, getElementSizes, throwErrorByFailedClickElement, } from './utils';
|
|
4
|
-
import { TabBarSearchableType } from './interfaces';
|
|
5
4
|
import { createCloseButtonsAnimation, createEffectAnimation, createFabButtonAnimation, createSearchContainerAnimation, createTabBarAnimation, } from './animations/enter';
|
|
6
5
|
import { createReverseCloseButtonsAnimation, createReverseEffectAnimation, createReverseFabButtonAnimation, createReverseSearchContainerAnimation, createReverseTabBarAnimation, } from './animations/leave';
|
|
7
|
-
export
|
|
6
|
+
export { TabBarSearchableType, } from '@rdlabo/ionic-theme-utils';
|
|
8
7
|
export const attachTabBarSearchable = (ionTabBar, ionFabButton, ionFooter) => {
|
|
9
8
|
if (!ionTabBar || !ionFabButton || !ionFooter) {
|
|
10
9
|
throw new Error('TabBarSearchable should be defined with props');
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { shadow } from '@rdlabo/ionic-theme-utils';
|
|
1
2
|
import type { Animation } from '@ionic/core';
|
|
2
3
|
import type { TransitionOptions } from './index';
|
|
3
|
-
export
|
|
4
|
+
export { shadow };
|
|
5
|
+
export interface IosTransitionConfig {
|
|
6
|
+
radius: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const setConfig: (config: Partial<IosTransitionConfig>) => void;
|
|
4
9
|
export declare const iosTransitionAnimation: (navEl: HTMLElement, opts: TransitionOptions) => Animation;
|
|
5
10
|
//# sourceMappingURL=ios.transition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios.transition.d.ts","sourceRoot":"","sources":["../../src/transition/ios.transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ios.transition.d.ts","sourceRoot":"","sources":["../../src/transition/ios.transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AASD,eAAO,MAAM,SAAS,GAAI,QAAQ,OAAO,CAAC,mBAAmB,CAAC,KAAG,IAEhE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,KAAK,SACnB,CAAC"}
|
|
@@ -1,389 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createIosTransitionAnimation, shadow } from '@rdlabo/ionic-theme-utils';
|
|
2
2
|
import { getIonPageElement } from './index';
|
|
3
3
|
import { connectNativeUIShellTransition } from '../native-integration';
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
export { shadow };
|
|
5
|
+
const transitionConfig = {
|
|
6
|
+
offLeftPercent: 30,
|
|
7
|
+
getIonPageElement,
|
|
8
|
+
connectNativeUIShellTransition,
|
|
9
|
+
radius: 0,
|
|
7
10
|
};
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
const animateFixedBackButton = (root, navEl, page, entering, interactive, otherPage) => {
|
|
12
|
-
const button = page.querySelector(':scope > ion-header.header-translucent:not(.ios-theme-disabled, .ios26-disabled) ion-back-button:not(.ios-theme-disabled, .ios26-disabled)');
|
|
13
|
-
if (!button || button.offsetWidth === 0) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const otherButton = otherPage?.querySelector(':scope > ion-header.header-translucent:not(.ios-theme-disabled, .ios26-disabled) ion-back-button:not(.ios-theme-disabled, .ios26-disabled)');
|
|
17
|
-
const persistent = !!otherButton && otherButton.offsetWidth > 0;
|
|
18
|
-
const buttons = [button, ...(persistent ? [otherButton] : [])].map((element) => ({
|
|
19
|
-
element,
|
|
20
|
-
visibility: element.style.visibility,
|
|
21
|
-
}));
|
|
22
|
-
const rect = button.getBoundingClientRect();
|
|
23
|
-
const width = button.offsetWidth;
|
|
24
|
-
const height = button.offsetHeight;
|
|
25
|
-
const clone = getClonedElement('ion-back-button');
|
|
26
|
-
if (!clone) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const cloneParent = clone.parentNode;
|
|
30
|
-
const cloneNextSibling = clone.nextSibling;
|
|
31
|
-
const cloneStyle = clone.getAttribute('style');
|
|
32
|
-
clone.icon = button.icon;
|
|
33
|
-
clone.text = button.text;
|
|
34
|
-
clone.mode = button.mode;
|
|
35
|
-
clone.color = button.color;
|
|
36
|
-
clone.disabled = button.disabled;
|
|
37
|
-
const icon = shadow(clone).querySelector('ion-icon');
|
|
38
|
-
const animation = createAnimation().addElement(clone);
|
|
39
|
-
const fadeStart = !entering && interactive ? 0.8 : 0.4;
|
|
40
|
-
const fadeEnd = entering ? 0.96 : interactive ? 1 : 0.95;
|
|
41
|
-
if (persistent) {
|
|
42
|
-
animation.fromTo('transform', 'scale(1)', 'scale(1)').fromTo('opacity', 1, 1);
|
|
43
|
-
}
|
|
44
|
-
else if (entering) {
|
|
45
|
-
animation.keyframes([
|
|
46
|
-
{ offset: 0, transform: 'scale(1.2)', opacity: 0 },
|
|
47
|
-
{ offset: fadeStart, transform: 'scale(1.2)', opacity: 0 },
|
|
48
|
-
{ offset: 0.65, transform: 'scale(1.12)', opacity: 0.15 },
|
|
49
|
-
{ offset: 0.9, transform: 'scale(1.02)', opacity: 0.75 },
|
|
50
|
-
{ offset: fadeEnd, transform: 'scale(1)', opacity: 1 },
|
|
51
|
-
{ offset: 1, transform: 'scale(1)', opacity: 1 },
|
|
52
|
-
]);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
animation.keyframes([
|
|
56
|
-
{ offset: 0, transform: 'scale(1)', opacity: 1 },
|
|
57
|
-
{ offset: fadeStart, transform: 'scale(1)', opacity: 1 },
|
|
58
|
-
{ offset: fadeEnd, transform: 'scale(1.2)', opacity: 0 },
|
|
59
|
-
{ offset: 1, transform: 'scale(1.2)', opacity: 0 },
|
|
60
|
-
]);
|
|
61
|
-
}
|
|
62
|
-
if (icon && !persistent) {
|
|
63
|
-
const from = entering ? 'blur(4px)' : 'blur(0px)';
|
|
64
|
-
const to = entering ? 'blur(0px)' : 'blur(4px)';
|
|
65
|
-
animation.addAnimation(createAnimation()
|
|
66
|
-
.addElement(icon)
|
|
67
|
-
.keyframes([
|
|
68
|
-
{ offset: 0, filter: from },
|
|
69
|
-
{ offset: fadeStart, filter: from },
|
|
70
|
-
{ offset: fadeEnd, filter: to },
|
|
71
|
-
{ offset: 1, filter: to },
|
|
72
|
-
]));
|
|
73
|
-
}
|
|
74
|
-
root.beforeAddWrite(() => {
|
|
75
|
-
Object.assign(clone.style, {
|
|
76
|
-
position: 'fixed',
|
|
77
|
-
left: `${rect.left + (rect.width - width) / 2}px`,
|
|
78
|
-
top: `${rect.top + (rect.height - height) / 2}px`,
|
|
79
|
-
width: `${width}px`,
|
|
80
|
-
height: `${height}px`,
|
|
81
|
-
margin: '0',
|
|
82
|
-
pointerEvents: 'none',
|
|
83
|
-
visibility: 'visible',
|
|
84
|
-
display: getComputedStyle(button).display,
|
|
85
|
-
zIndex: '1000',
|
|
86
|
-
});
|
|
87
|
-
navEl.appendChild(clone);
|
|
88
|
-
buttons.forEach(({ element }) => (element.style.visibility = 'hidden'));
|
|
89
|
-
});
|
|
90
|
-
root.afterAddWrite(() => {
|
|
91
|
-
buttons.forEach(({ element, visibility }) => (element.style.visibility = visibility));
|
|
92
|
-
cloneParent.insertBefore(clone, cloneNextSibling);
|
|
93
|
-
if (cloneStyle === null) {
|
|
94
|
-
clone.removeAttribute('style');
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
clone.setAttribute('style', cloneStyle);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
root.addAnimation(animation);
|
|
101
|
-
};
|
|
102
|
-
export const iosTransitionAnimation = (navEl, opts) => {
|
|
103
|
-
try {
|
|
104
|
-
const EASING = 'cubic-bezier(0.32,0.72,0,1)';
|
|
105
|
-
const OPACITY = 'opacity';
|
|
106
|
-
const TRANSFORM = 'transform';
|
|
107
|
-
const CENTER = '0%';
|
|
108
|
-
const OFF_OPACITY = 0.8;
|
|
109
|
-
const isRTL = navEl.ownerDocument.dir === 'rtl';
|
|
110
|
-
const OFF_RIGHT = isRTL ? '-99.5%' : '99.5%';
|
|
111
|
-
const OFF_LEFT = isRTL ? '33%' : '-33%';
|
|
112
|
-
const enteringEl = opts.enteringEl;
|
|
113
|
-
const leavingEl = opts.leavingEl;
|
|
114
|
-
const backDirection = opts.direction === 'back';
|
|
115
|
-
const contentEl = enteringEl.querySelector(':scope > ion-content');
|
|
116
|
-
const headerEls = enteringEl.querySelectorAll(':scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *');
|
|
117
|
-
const enteringToolBarEls = enteringEl.querySelectorAll(':scope > ion-header > ion-toolbar');
|
|
118
|
-
const rootAnimation = createAnimation();
|
|
119
|
-
const enteringContentAnimation = createAnimation();
|
|
120
|
-
rootAnimation
|
|
121
|
-
.addElement(enteringEl)
|
|
122
|
-
.duration((opts.duration ?? 0) || DURATION)
|
|
123
|
-
.easing(opts.easing || EASING)
|
|
124
|
-
.fill('both')
|
|
125
|
-
.beforeRemoveClass('ion-page-invisible');
|
|
126
|
-
const topPage = backDirection ? leavingEl : enteringEl;
|
|
127
|
-
if (topPage?.querySelector(':scope > ion-header.header-translucent:not(.ios-theme-disabled, .ios26-disabled)')) {
|
|
128
|
-
const shadow = topPage.style.boxShadow;
|
|
129
|
-
rootAnimation.beforeAddWrite(() => {
|
|
130
|
-
topPage.style.boxShadow = `${isRTL ? 4 : -4}px 0 24px rgba(0, 0, 0, 0.04)`;
|
|
131
|
-
});
|
|
132
|
-
rootAnimation.afterAddWrite(() => {
|
|
133
|
-
topPage.style.boxShadow = shadow;
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
if (leavingEl && navEl !== null && navEl !== undefined) {
|
|
137
|
-
const navDecorAnimation = createAnimation();
|
|
138
|
-
navDecorAnimation.addElement(navEl);
|
|
139
|
-
rootAnimation.addAnimation(navDecorAnimation);
|
|
140
|
-
}
|
|
141
|
-
if (enteringEl.querySelector(':scope > ion-header.header-translucent:not(.ios-theme-disabled, .ios26-disabled)')) {
|
|
142
|
-
enteringContentAnimation.addElement(enteringEl);
|
|
143
|
-
}
|
|
144
|
-
else if (!contentEl && enteringToolBarEls.length === 0 && headerEls.length === 0) {
|
|
145
|
-
enteringContentAnimation.addElement(enteringEl.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs'));
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
enteringContentAnimation.addElement(contentEl);
|
|
149
|
-
enteringContentAnimation.addElement(headerEls);
|
|
150
|
-
}
|
|
151
|
-
rootAnimation.addAnimation(enteringContentAnimation);
|
|
152
|
-
if (backDirection) {
|
|
153
|
-
enteringContentAnimation
|
|
154
|
-
.beforeClearStyles([OPACITY])
|
|
155
|
-
.fromTo('transform', `translateX(${OFF_LEFT})`, `translateX(${CENTER})`)
|
|
156
|
-
.fromTo(OPACITY, OFF_OPACITY, 1);
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
enteringContentAnimation.beforeClearStyles([OPACITY]).fromTo('transform', `translateX(${OFF_RIGHT})`, `translateX(${CENTER})`);
|
|
160
|
-
}
|
|
161
|
-
if (contentEl && !enteringEl.querySelector(':scope > ion-header.header-translucent:not(.ios-theme-disabled, .ios26-disabled)')) {
|
|
162
|
-
const enteringTransitionEffectEl = shadow(contentEl).querySelector('.transition-effect');
|
|
163
|
-
if (enteringTransitionEffectEl) {
|
|
164
|
-
const enteringTransitionCoverEl = enteringTransitionEffectEl.querySelector('.transition-cover');
|
|
165
|
-
const enteringTransitionShadowEl = enteringTransitionEffectEl.querySelector('.transition-shadow');
|
|
166
|
-
const enteringTransitionEffect = createAnimation();
|
|
167
|
-
const enteringTransitionCover = createAnimation();
|
|
168
|
-
const enteringTransitionShadow = createAnimation();
|
|
169
|
-
enteringTransitionEffect
|
|
170
|
-
.addElement(enteringTransitionEffectEl)
|
|
171
|
-
.beforeStyles({ opacity: '1', display: 'block' })
|
|
172
|
-
.afterStyles({ opacity: '', display: '' });
|
|
173
|
-
enteringTransitionCover
|
|
174
|
-
.addElement(enteringTransitionCoverEl)
|
|
175
|
-
.beforeClearStyles([OPACITY])
|
|
176
|
-
.fromTo(OPACITY, 0, 0.1);
|
|
177
|
-
enteringTransitionShadow
|
|
178
|
-
.addElement(enteringTransitionShadowEl)
|
|
179
|
-
.beforeClearStyles([OPACITY])
|
|
180
|
-
.fromTo(OPACITY, 0.03, 0.7);
|
|
181
|
-
enteringTransitionEffect.addAnimation([enteringTransitionCover, enteringTransitionShadow]);
|
|
182
|
-
enteringContentAnimation.addAnimation([enteringTransitionEffect]);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
if (topPage) {
|
|
186
|
-
animateFixedBackButton(rootAnimation, navEl, topPage, !backDirection, opts.progressCallback !== undefined, backDirection ? enteringEl : leavingEl);
|
|
187
|
-
}
|
|
188
|
-
const enteringContentHasLargeTitle = enteringEl.querySelector('ion-header.header-collapse-condense');
|
|
189
|
-
enteringToolBarEls.forEach((enteringToolBarEl) => {
|
|
190
|
-
if (enteringToolBarEl.closest('ion-header')?.matches('.header-translucent:not(.ios-theme-disabled, .ios26-disabled)')) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
const enteringToolBar = createAnimation();
|
|
194
|
-
enteringToolBar.addElement(enteringToolBarEl);
|
|
195
|
-
rootAnimation.addAnimation(enteringToolBar);
|
|
196
|
-
const enteringTitle = createAnimation();
|
|
197
|
-
enteringTitle.addElement(enteringToolBarEl.querySelector('ion-title'));
|
|
198
|
-
const enteringToolBarButtons = createAnimation();
|
|
199
|
-
const buttons = Array.from(enteringToolBarEl.querySelectorAll('ion-buttons,[menuToggle]'));
|
|
200
|
-
const parentHeader = enteringToolBarEl.closest('ion-header');
|
|
201
|
-
const inactiveHeader = parentHeader?.classList.contains('header-collapse-condense-inactive');
|
|
202
|
-
let buttonsToAnimate;
|
|
203
|
-
if (backDirection) {
|
|
204
|
-
buttonsToAnimate = buttons.filter((button) => {
|
|
205
|
-
const isCollapseButton = button.classList.contains('buttons-collapse');
|
|
206
|
-
return (isCollapseButton && !inactiveHeader) || !isCollapseButton;
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
buttonsToAnimate = buttons.filter((button) => !button.classList.contains('buttons-collapse'));
|
|
211
|
-
}
|
|
212
|
-
enteringToolBarButtons.addElement(buttonsToAnimate);
|
|
213
|
-
const enteringToolBarItems = createAnimation();
|
|
214
|
-
enteringToolBarItems.addElement(enteringToolBarEl.querySelectorAll(':scope > *:not(ion-title):not(ion-buttons):not([menuToggle])'));
|
|
215
|
-
const enteringToolBarBg = createAnimation();
|
|
216
|
-
enteringToolBarBg.addElement(shadow(enteringToolBarEl).querySelector('.toolbar-background'));
|
|
217
|
-
const enteringBackButton = createAnimation();
|
|
218
|
-
const backButtonEl = enteringToolBarEl.querySelector('ion-back-button');
|
|
219
|
-
if (backButtonEl) {
|
|
220
|
-
enteringBackButton.addElement(backButtonEl);
|
|
221
|
-
}
|
|
222
|
-
enteringToolBar.addAnimation([enteringTitle, enteringToolBarButtons, enteringToolBarItems, enteringToolBarBg, enteringBackButton]);
|
|
223
|
-
enteringToolBarButtons.fromTo(OPACITY, 0.01, 1);
|
|
224
|
-
enteringToolBarItems.fromTo(OPACITY, 0.01, 1);
|
|
225
|
-
if (backDirection) {
|
|
226
|
-
if (!inactiveHeader) {
|
|
227
|
-
enteringTitle.fromTo('transform', `translateX(${OFF_LEFT})`, `translateX(${CENTER})`).fromTo(OPACITY, 0.01, 1);
|
|
228
|
-
}
|
|
229
|
-
enteringToolBarItems.fromTo('transform', `translateX(${OFF_LEFT})`, `translateX(${CENTER})`);
|
|
230
|
-
enteringBackButton.fromTo(OPACITY, 0.01, 1);
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
if (!enteringContentHasLargeTitle) {
|
|
234
|
-
enteringTitle.fromTo('transform', `translateX(${OFF_RIGHT})`, `translateX(${CENTER})`).fromTo(OPACITY, 0.01, 1);
|
|
235
|
-
}
|
|
236
|
-
enteringToolBarItems.fromTo('transform', `translateX(${OFF_RIGHT})`, `translateX(${CENTER})`);
|
|
237
|
-
enteringToolBarBg.beforeClearStyles([OPACITY, 'transform']);
|
|
238
|
-
const translucentHeader = parentHeader?.translucent;
|
|
239
|
-
if (!translucentHeader) {
|
|
240
|
-
enteringToolBarBg.fromTo(OPACITY, 0.01, 'var(--opacity)');
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
enteringToolBarBg.fromTo('transform', isRTL ? 'translateX(-100%)' : 'translateX(100%)', 'translateX(0px)');
|
|
244
|
-
}
|
|
245
|
-
enteringBackButton.fromTo(OPACITY, 0.01, 1);
|
|
246
|
-
if (backButtonEl) {
|
|
247
|
-
const enteringBackBtnText = createAnimation();
|
|
248
|
-
enteringBackBtnText
|
|
249
|
-
.addElement(shadow(backButtonEl).querySelector('.button-text'))
|
|
250
|
-
.fromTo(`transform`, isRTL ? 'translateX(-100px)' : 'translateX(100px)', 'translateX(0px)');
|
|
251
|
-
enteringToolBar.addAnimation(enteringBackBtnText);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
if (leavingEl) {
|
|
256
|
-
const leavingContent = createAnimation();
|
|
257
|
-
const leavingContentEl = leavingEl.querySelector(':scope > ion-content');
|
|
258
|
-
const leavingToolBarEls = leavingEl.querySelectorAll(':scope > ion-header > ion-toolbar');
|
|
259
|
-
const leavingHeaderEls = leavingEl.querySelectorAll(':scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *');
|
|
260
|
-
if (leavingEl.querySelector(':scope > ion-header.header-translucent:not(.ios-theme-disabled, .ios26-disabled)')) {
|
|
261
|
-
leavingContent.addElement(leavingEl);
|
|
262
|
-
}
|
|
263
|
-
else if (!leavingContentEl && leavingToolBarEls.length === 0 && leavingHeaderEls.length === 0) {
|
|
264
|
-
leavingContent.addElement(leavingEl.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs'));
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
leavingContent.addElement(leavingContentEl);
|
|
268
|
-
leavingContent.addElement(leavingHeaderEls);
|
|
269
|
-
}
|
|
270
|
-
rootAnimation.addAnimation(leavingContent);
|
|
271
|
-
if (backDirection) {
|
|
272
|
-
leavingContent
|
|
273
|
-
.beforeClearStyles([OPACITY])
|
|
274
|
-
.fromTo('transform', `translateX(${CENTER})`, isRTL ? 'translateX(-100%)' : 'translateX(100%)');
|
|
275
|
-
const leavingPage = getIonPageElement(leavingEl);
|
|
276
|
-
rootAnimation.afterAddWrite(() => {
|
|
277
|
-
if (rootAnimation.getDirection() === 'normal') {
|
|
278
|
-
leavingPage.style.setProperty('display', 'none');
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
leavingContent.fromTo('transform', `translateX(${CENTER})`, `translateX(${OFF_LEFT})`).fromTo(OPACITY, 1, OFF_OPACITY);
|
|
284
|
-
}
|
|
285
|
-
if (leavingContentEl &&
|
|
286
|
-
!leavingEl.querySelector(':scope > ion-header.header-translucent:not(.ios-theme-disabled, .ios26-disabled)')) {
|
|
287
|
-
const leavingTransitionEffectEl = shadow(leavingContentEl).querySelector('.transition-effect');
|
|
288
|
-
if (leavingTransitionEffectEl) {
|
|
289
|
-
const leavingTransitionCoverEl = leavingTransitionEffectEl.querySelector('.transition-cover');
|
|
290
|
-
const leavingTransitionShadowEl = leavingTransitionEffectEl.querySelector('.transition-shadow');
|
|
291
|
-
const leavingTransitionEffect = createAnimation();
|
|
292
|
-
const leavingTransitionCover = createAnimation();
|
|
293
|
-
const leavingTransitionShadow = createAnimation();
|
|
294
|
-
leavingTransitionEffect
|
|
295
|
-
.addElement(leavingTransitionEffectEl)
|
|
296
|
-
.beforeStyles({ opacity: '1', display: 'block' })
|
|
297
|
-
.afterStyles({ opacity: '', display: '' });
|
|
298
|
-
leavingTransitionCover
|
|
299
|
-
.addElement(leavingTransitionCoverEl)
|
|
300
|
-
.beforeClearStyles([OPACITY])
|
|
301
|
-
.fromTo(OPACITY, 0.1, 0);
|
|
302
|
-
leavingTransitionShadow
|
|
303
|
-
.addElement(leavingTransitionShadowEl)
|
|
304
|
-
.beforeClearStyles([OPACITY])
|
|
305
|
-
.fromTo(OPACITY, 0.7, 0.03);
|
|
306
|
-
leavingTransitionEffect.addAnimation([leavingTransitionCover, leavingTransitionShadow]);
|
|
307
|
-
leavingContent.addAnimation([leavingTransitionEffect]);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
leavingToolBarEls.forEach((leavingToolBarEl) => {
|
|
311
|
-
if (leavingToolBarEl.closest('ion-header')?.matches('.header-translucent:not(.ios-theme-disabled, .ios26-disabled)')) {
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
const leavingToolBar = createAnimation();
|
|
315
|
-
leavingToolBar.addElement(leavingToolBarEl);
|
|
316
|
-
const leavingTitle = createAnimation();
|
|
317
|
-
leavingTitle.addElement(leavingToolBarEl.querySelector('ion-title'));
|
|
318
|
-
const leavingToolBarButtons = createAnimation();
|
|
319
|
-
const buttons = leavingToolBarEl.querySelectorAll('ion-buttons,[menuToggle]');
|
|
320
|
-
const parentHeader = leavingToolBarEl.closest('ion-header');
|
|
321
|
-
const inactiveHeader = parentHeader?.classList.contains('header-collapse-condense-inactive');
|
|
322
|
-
const buttonsToAnimate = Array.from(buttons).filter((button) => {
|
|
323
|
-
const isCollapseButton = button.classList.contains('buttons-collapse');
|
|
324
|
-
return (isCollapseButton && !inactiveHeader) || !isCollapseButton;
|
|
325
|
-
});
|
|
326
|
-
leavingToolBarButtons.addElement(buttonsToAnimate);
|
|
327
|
-
const leavingToolBarItems = createAnimation();
|
|
328
|
-
const leavingToolBarItemEls = leavingToolBarEl.querySelectorAll(':scope > *:not(ion-title):not(ion-buttons):not([menuToggle])');
|
|
329
|
-
if (leavingToolBarItemEls.length > 0) {
|
|
330
|
-
leavingToolBarItems.addElement(leavingToolBarItemEls);
|
|
331
|
-
}
|
|
332
|
-
const leavingToolBarBg = createAnimation();
|
|
333
|
-
leavingToolBarBg.addElement(shadow(leavingToolBarEl).querySelector('.toolbar-background'));
|
|
334
|
-
const leavingBackButton = createAnimation();
|
|
335
|
-
const backButtonEl = leavingToolBarEl.querySelector('ion-back-button');
|
|
336
|
-
if (backButtonEl) {
|
|
337
|
-
leavingBackButton.addElement(backButtonEl);
|
|
338
|
-
}
|
|
339
|
-
leavingToolBar.addAnimation([leavingTitle, leavingToolBarButtons, leavingToolBarItems, leavingBackButton, leavingToolBarBg]);
|
|
340
|
-
rootAnimation.addAnimation(leavingToolBar);
|
|
341
|
-
leavingBackButton.fromTo(OPACITY, 0.99, 0);
|
|
342
|
-
leavingToolBarButtons.fromTo(OPACITY, 0.99, 0);
|
|
343
|
-
leavingToolBarItems.fromTo(OPACITY, 0.99, 0);
|
|
344
|
-
if (backDirection) {
|
|
345
|
-
if (!inactiveHeader) {
|
|
346
|
-
leavingTitle
|
|
347
|
-
.fromTo('transform', `translateX(${CENTER})`, isRTL ? 'translateX(-100%)' : 'translateX(100%)')
|
|
348
|
-
.fromTo(OPACITY, 0.99, 0);
|
|
349
|
-
}
|
|
350
|
-
leavingToolBarItems.fromTo('transform', `translateX(${CENTER})`, isRTL ? 'translateX(-100%)' : 'translateX(100%)');
|
|
351
|
-
leavingToolBarBg.beforeClearStyles([OPACITY, 'transform']);
|
|
352
|
-
const translucentHeader = parentHeader?.translucent;
|
|
353
|
-
if (!translucentHeader) {
|
|
354
|
-
leavingToolBarBg.fromTo(OPACITY, 'var(--opacity)', 0);
|
|
355
|
-
}
|
|
356
|
-
else {
|
|
357
|
-
leavingToolBarBg.fromTo('transform', 'translateX(0px)', isRTL ? 'translateX(-100%)' : 'translateX(100%)');
|
|
358
|
-
}
|
|
359
|
-
if (backButtonEl) {
|
|
360
|
-
const leavingBackBtnText = createAnimation();
|
|
361
|
-
leavingBackBtnText
|
|
362
|
-
.addElement(shadow(backButtonEl).querySelector('.button-text'))
|
|
363
|
-
.fromTo('transform', `translateX(${CENTER})`, `translateX(${(isRTL ? -124 : 124) + 'px'})`);
|
|
364
|
-
leavingToolBar.addAnimation(leavingBackBtnText);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
else {
|
|
368
|
-
if (!inactiveHeader) {
|
|
369
|
-
leavingTitle
|
|
370
|
-
.fromTo('transform', `translateX(${CENTER})`, `translateX(${OFF_LEFT})`)
|
|
371
|
-
.fromTo(OPACITY, 0.99, 0)
|
|
372
|
-
.afterClearStyles([TRANSFORM, OPACITY]);
|
|
373
|
-
}
|
|
374
|
-
leavingToolBarItems
|
|
375
|
-
.fromTo('transform', `translateX(${CENTER})`, `translateX(${OFF_LEFT})`)
|
|
376
|
-
.afterClearStyles([TRANSFORM, OPACITY]);
|
|
377
|
-
leavingBackButton.afterClearStyles([OPACITY]);
|
|
378
|
-
leavingTitle.afterClearStyles([OPACITY]);
|
|
379
|
-
leavingToolBarButtons.afterClearStyles([OPACITY]);
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
connectNativeUIShellTransition(rootAnimation, enteringEl, leavingEl);
|
|
384
|
-
return rootAnimation;
|
|
385
|
-
}
|
|
386
|
-
catch (err) {
|
|
387
|
-
throw err;
|
|
388
|
-
}
|
|
11
|
+
export const setConfig = (config) => {
|
|
12
|
+
Object.assign(transitionConfig, config);
|
|
389
13
|
};
|
|
14
|
+
export const iosTransitionAnimation = createIosTransitionAnimation(transitionConfig);
|