@rdlabo/ionic-theme-ios27 1.2.0 → 1.2.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.
- package/dist/css/components/ion-button.css +1 -1
- 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/native/components/index.js +2 -2
- package/dist/native/components/index.js.map +1 -1
- package/dist/native/prehide.d.ts.map +1 -1
- package/dist/native/prehide.js +6 -2
- package/dist/native/prehide.js.map +1 -1
- package/dist/native/runtime.d.ts.map +1 -1
- package/dist/native/runtime.js +4 -3
- package/dist/native/runtime.js.map +1 -1
- package/dist/native/shared/dom.d.ts +2 -0
- package/dist/native/shared/dom.d.ts.map +1 -1
- package/dist/native/shared/dom.js +5 -1
- package/dist/native/shared/dom.js.map +1 -1
- package/dist/native/vertical-bars-web.d.ts.map +1 -1
- package/dist/native/vertical-bars-web.js +4 -2
- package/dist/native/vertical-bars-web.js.map +1 -1
- package/dist/native-integration/index.d.ts +1 -1
- package/dist/native-integration/index.js.map +1 -1
- package/dist/native-integration/transition.d.ts +1 -1
- package/dist/native-integration/transition.js.map +1 -1
- package/dist/sheets-of-glass/animations.d.ts +1 -1
- package/dist/sheets-of-glass/animations.js +1 -1
- package/dist/sheets-of-glass/animations.js.map +1 -1
- package/dist/sheets-of-glass/index.js +1 -1
- package/dist/sheets-of-glass/index.js.map +1 -1
- 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/enter.js.map +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/animations/leave.js.map +1 -1
- package/dist/tab-bar-searchable/index.js +1 -1
- package/dist/tab-bar-searchable/index.js.map +1 -1
- package/dist/transition/index.d.ts +1 -1
- package/dist/transition/index.js +1 -1
- package/dist/transition/index.js.map +1 -1
- package/dist/transition/ios.transition.d.ts +1 -1
- package/dist/transition/ios.transition.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js.map +1 -1
- package/docs/native-ui-shell.md +2 -2
- package/docs/vertical-bars.md +3 -1
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellSearchController.swift +65 -91
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellTabBar.swift +9 -3
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellVerticalBars.swift +4 -2
- package/package.json +1 -1
- package/src/native/components/index.ts +3 -2
- package/src/native/prehide.ts +6 -1
- package/src/native/runtime.ts +5 -1
- package/src/native/shared/dom.ts +14 -0
- package/src/native/vertical-bars-web.ts +11 -1
- package/src/native-integration/index.ts +1 -1
- package/src/native-integration/transition.ts +1 -1
- package/src/sheets-of-glass/animations.ts +2 -2
- package/src/sheets-of-glass/index.ts +2 -2
- package/src/styles/components/ion-button.scss +47 -0
- package/src/styles/components/ion-toolbar.scss +62 -7
- package/src/styles/vertical-bars.scss +23 -0
- package/src/tab-bar-searchable/animations/enter.ts +2 -1
- package/src/tab-bar-searchable/animations/leave.ts +2 -1
- package/src/tab-bar-searchable/index.ts +1 -1
- package/src/transition/index.ts +3 -3
- package/src/transition/ios.transition.ts +1 -1
- package/src/utils.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/native-integration/index.ts"],"sourcesContent":["/// <reference lib=\"es2021.weakref\" />\nimport type { Animation } from '@ionic/core';\n\nexport interface NativeUIShellIntegration {\n suspend(scopes: HTMLElement[]): Promise<(canceled?: boolean) => void>;\n search?(binding: NativeSearchBinding, active: boolean, focus?: boolean): Promise<boolean>;\n}\n\nexport interface NativeSearchBinding {\n tabBar: HTMLElement;\n trigger: HTMLElement;\n footer: HTMLElement;\n active: boolean;\n focused: boolean;\n}\n\nconst searches = new WeakMap<Document, WeakRef<NativeSearchBinding>[]>();\n\nexport const registerNativeSearch = (tabBar: HTMLElement, trigger: HTMLElement, footer: HTMLElement): NativeSearchBinding => {\n const binding = { tabBar, trigger, footer, active: false, focused: false };\n const entries = (searches.get(tabBar.ownerDocument) ?? []).filter((entry) => entry.deref() && entry.deref()?.footer !== footer);\n entries.push(new WeakRef(binding));\n searches.set(tabBar.ownerDocument, entries);\n tabBar.ownerDocument.defaultView?.dispatchEvent(new Event('nativeUIShellRefresh'));\n return binding;\n};\n\nexport const getNativeSearchBindings = (doc: Document): NativeSearchBinding[] =>\n (searches.get(doc) ?? []).flatMap((entry) => entry.deref() ?? []);\n\nexport const requestNativeSearch = async (binding: NativeSearchBinding, active: boolean, focus?: boolean): Promise<boolean> =>\n (await runtimes.get(binding.tabBar.ownerDocument)?.search?.(binding, active, focus)) ?? false;\n\nconst runtimes = new WeakMap<Document, NativeUIShellIntegration>();\nexport const VERTICAL_BARS_TRANSITION_CANCELED = 'iosThemeVerticalBarsTransitionCanceled';\n\nexport const setNativeUIShellIntegration = (doc: Document, runtime?: NativeUIShellIntegration) => {\n if (runtime) runtimes.set(doc, runtime);\n else runtimes.delete(doc);\n};\n\nexport const isNativeUIShell = (element: HTMLElement) => element.hasAttribute('data-native-ui-shell');\n\nexport const suspendNativeUIShell = async (scopes: HTMLElement[]): Promise<(canceled?: boolean) => void> =>\n (await runtimes.get(scopes[0]?.ownerDocument)?.suspend(scopes)) ?? (() => {});\n\nconst connectedTransitions = new WeakSet<Animation>();\nconst cancellationTransitions = new WeakSet<Animation>();\n\n/** Ionic write hooks cannot await the bridge. Gate playback, including interactive playback. */\nexport const connectNativeUIShellTransition = (animation: Animation, entering: HTMLElement, leaving?: HTMLElement) => {\n if (leaving && !cancellationTransitions.has(animation)) {\n cancellationTransitions.add(animation);\n animation.onFinish((step) => {\n if (step === 0) leaving.dispatchEvent(new CustomEvent(VERTICAL_BARS_TRANSITION_CANCELED, { bubbles: true, detail: { entering } }));\n });\n }\n if (connectedTransitions.has(animation) || !runtimes.has(entering.ownerDocument)) return;\n connectedTransitions.add(animation);\n const scopes = leaving ? [entering, leaving] : [entering];\n const play = animation.play.bind(animation);\n const progressStart = animation.progressStart.bind(animation);\n const progressStep = animation.progressStep.bind(animation);\n const progressEnd = animation.progressEnd.bind(animation);\n const destroy = animation.destroy.bind(animation);\n let release: ((canceled?: boolean) => void) | undefined;\n let preparation: Promise<void> | undefined;\n let disposed = false;\n let interactiveReady = false;\n let step: number | undefined;\n let end: Parameters<Animation['progressEnd']> | undefined;\n const prepare = () =>\n (preparation ??= suspendNativeUIShell(scopes).then((resume) => {\n if (disposed) resume(true);\n else release = resume;\n }));\n const finish = (canceled = false) => {\n release?.(canceled);\n release = undefined;\n preparation = undefined;\n };\n animation.onFinish((step) => finish(step === 0));\n animation.play = async (options) => {\n await prepare();\n if (disposed) return;\n try {\n await play(options);\n } finally {\n finish();\n }\n };\n animation.progressStart = (...args) => {\n interactiveReady = false;\n step = undefined;\n end = undefined;\n void prepare().then(() => {\n if (disposed) return;\n progressStart(...args);\n interactiveReady = true;\n if (step !== undefined) progressStep(step);\n if (end) progressEnd(...end);\n });\n return animation;\n };\n animation.progressStep = (value) => {\n step = value;\n if (interactiveReady) progressStep(value);\n return animation;\n };\n animation.progressEnd = (...args) => {\n end = args;\n if (interactiveReady) progressEnd(...args);\n return animation;\n };\n animation.destroy = (...args) => {\n disposed = true;\n finish(true);\n return destroy(...args);\n };\n};\n"],"mappings":";AAgBA,MAAM,2BAAW,IAAI,QAAkD;AAEvE,MAAa,wBAAwB,QAAqB,SAAsB,WAA6C;CAC3H,MAAM,UAAU;EAAE;EAAQ;EAAS;EAAQ,QAAQ;EAAO,SAAS;CAAM;CACzE,MAAM,WAAW,SAAS,IAAI,OAAO,aAAa,KAAK,CAAC,EAAA,CAAG,QAAQ,UAAU,MAAM,MAAM,KAAK,MAAM,M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;EACX,OAAO,QAAQ,GAAG,IAAI;CACxB;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/native-integration/index.ts"],"sourcesContent":["/// <reference lib=\"es2021.weakref\" />\nimport type { Animation } from '@ionic/core/components';\n\nexport interface NativeUIShellIntegration {\n suspend(scopes: HTMLElement[]): Promise<(canceled?: boolean) => void>;\n search?(binding: NativeSearchBinding, active: boolean, focus?: boolean): Promise<boolean>;\n}\n\nexport interface NativeSearchBinding {\n tabBar: HTMLElement;\n trigger: HTMLElement;\n footer: HTMLElement;\n active: boolean;\n focused: boolean;\n}\n\nconst searches = new WeakMap<Document, WeakRef<NativeSearchBinding>[]>();\n\nexport const registerNativeSearch = (tabBar: HTMLElement, trigger: HTMLElement, footer: HTMLElement): NativeSearchBinding => {\n const binding = { tabBar, trigger, footer, active: false, focused: false };\n const entries = (searches.get(tabBar.ownerDocument) ?? []).filter((entry) => entry.deref() && entry.deref()?.footer !== footer);\n entries.push(new WeakRef(binding));\n searches.set(tabBar.ownerDocument, entries);\n tabBar.ownerDocument.defaultView?.dispatchEvent(new Event('nativeUIShellRefresh'));\n return binding;\n};\n\nexport const getNativeSearchBindings = (doc: Document): NativeSearchBinding[] =>\n (searches.get(doc) ?? []).flatMap((entry) => entry.deref() ?? []);\n\nexport const requestNativeSearch = async (binding: NativeSearchBinding, active: boolean, focus?: boolean): Promise<boolean> =>\n (await runtimes.get(binding.tabBar.ownerDocument)?.search?.(binding, active, focus)) ?? false;\n\nconst runtimes = new WeakMap<Document, NativeUIShellIntegration>();\nexport const VERTICAL_BARS_TRANSITION_CANCELED = 'iosThemeVerticalBarsTransitionCanceled';\n\nexport const setNativeUIShellIntegration = (doc: Document, runtime?: NativeUIShellIntegration) => {\n if (runtime) runtimes.set(doc, runtime);\n else runtimes.delete(doc);\n};\n\nexport const isNativeUIShell = (element: HTMLElement) => element.hasAttribute('data-native-ui-shell');\n\nexport const suspendNativeUIShell = async (scopes: HTMLElement[]): Promise<(canceled?: boolean) => void> =>\n (await runtimes.get(scopes[0]?.ownerDocument)?.suspend(scopes)) ?? (() => {});\n\nconst connectedTransitions = new WeakSet<Animation>();\nconst cancellationTransitions = new WeakSet<Animation>();\n\n/** Ionic write hooks cannot await the bridge. Gate playback, including interactive playback. */\nexport const connectNativeUIShellTransition = (animation: Animation, entering: HTMLElement, leaving?: HTMLElement) => {\n if (leaving && !cancellationTransitions.has(animation)) {\n cancellationTransitions.add(animation);\n animation.onFinish((step) => {\n if (step === 0) leaving.dispatchEvent(new CustomEvent(VERTICAL_BARS_TRANSITION_CANCELED, { bubbles: true, detail: { entering } }));\n });\n }\n if (connectedTransitions.has(animation) || !runtimes.has(entering.ownerDocument)) return;\n connectedTransitions.add(animation);\n const scopes = leaving ? [entering, leaving] : [entering];\n const play = animation.play.bind(animation);\n const progressStart = animation.progressStart.bind(animation);\n const progressStep = animation.progressStep.bind(animation);\n const progressEnd = animation.progressEnd.bind(animation);\n const destroy = animation.destroy.bind(animation);\n let release: ((canceled?: boolean) => void) | undefined;\n let preparation: Promise<void> | undefined;\n let disposed = false;\n let interactiveReady = false;\n let step: number | undefined;\n let end: Parameters<Animation['progressEnd']> | undefined;\n const prepare = () =>\n (preparation ??= suspendNativeUIShell(scopes).then((resume) => {\n if (disposed) resume(true);\n else release = resume;\n }));\n const finish = (canceled = false) => {\n release?.(canceled);\n release = undefined;\n preparation = undefined;\n };\n animation.onFinish((step) => finish(step === 0));\n animation.play = async (options) => {\n await prepare();\n if (disposed) return;\n try {\n await play(options);\n } finally {\n finish();\n }\n };\n animation.progressStart = (...args) => {\n interactiveReady = false;\n step = undefined;\n end = undefined;\n void prepare().then(() => {\n if (disposed) return;\n progressStart(...args);\n interactiveReady = true;\n if (step !== undefined) progressStep(step);\n if (end) progressEnd(...end);\n });\n return animation;\n };\n animation.progressStep = (value) => {\n step = value;\n if (interactiveReady) progressStep(value);\n return animation;\n };\n animation.progressEnd = (...args) => {\n end = args;\n if (interactiveReady) progressEnd(...args);\n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,KAAA,GAAW,aAAa,IAAI;GACzC,IAAI,KAAK,YAAY,GAAG,GAAG;EAC7B,CAAC;EACD,OAAO;CACT;CACA,UAAU,gBAAgB,UAAU;EAClC,OAAO;EACP,IAAI,kBAAkB,aAAa,KAAK;EACxC,OAAO;CACT;CACA,UAAU,eAAe,GAAG,SAAS;EACnC,MAAM;EACN,IAAI,kBAAkB,YAAY,GAAG,IAAI;EACzC,OAAO;CACT;CACA,UAAU,WAAW,GAAG,SAAS;EAC/B,WAAW;EACX,OAAO,IAAI;EACX,OAAO,QAAQ,GAAG,IAAI;CACxB;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimationBuilder } from "@ionic/core";
|
|
1
|
+
import { AnimationBuilder } from "@ionic/core/components";
|
|
2
2
|
//#region src/native-integration/transition.d.ts
|
|
3
3
|
export declare const withNativeUIShellTransition: (builder: AnimationBuilder) => AnimationBuilder;
|
|
4
4
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transition.js","names":[],"sources":["../../src/native-integration/transition.ts"],"sourcesContent":["import type { AnimationBuilder } from '@ionic/core';\nimport { connectNativeUIShellTransition } from './index';\n\n/**\n * Keeps an existing Ionic navigation animation and coordinates native control handoff.\n * Register the returned builder as navAnimation. Do not use it for overlay animations.\n * The builder must return a fresh Animation for each navigation; Ionic destroys it afterward.\n */\nexport const withNativeUIShellTransition =\n (builder: AnimationBuilder): AnimationBuilder =>\n (baseEl, opts) => {\n const animation = builder(baseEl, opts);\n if (opts?.enteringEl) connectNativeUIShellTransition(animation, opts.enteringEl, opts.leavingEl);\n return animation;\n };\n"],"mappings":";;;;;;;AAQA,MAAa,+BACV,aACA,QAAQ,SAAS;CAChB,MAAM,YAAY,QAAQ,QAAQ,IAAI;CACtC,IAAI,MAAM,YAAY,+BAA+B,WAAW,KAAK,YAAY,KAAK,SAAS;CAC/F,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"transition.js","names":[],"sources":["../../src/native-integration/transition.ts"],"sourcesContent":["import type { AnimationBuilder } from '@ionic/core/components';\nimport { connectNativeUIShellTransition } from './index';\n\n/**\n * Keeps an existing Ionic navigation animation and coordinates native control handoff.\n * Register the returned builder as navAnimation. Do not use it for overlay animations.\n * The builder must return a fresh Animation for each navigation; Ionic destroys it afterward.\n */\nexport const withNativeUIShellTransition =\n (builder: AnimationBuilder): AnimationBuilder =>\n (baseEl, opts) => {\n const animation = builder(baseEl, opts);\n if (opts?.enteringEl) connectNativeUIShellTransition(animation, opts.enteringEl, opts.leavingEl);\n return animation;\n };\n"],"mappings":";;;;;;;AAQA,MAAa,+BACV,aACA,QAAQ,SAAS;CAChB,MAAM,YAAY,QAAQ,QAAQ,IAAI;CACtC,IAAI,MAAM,YAAY,+BAA+B,WAAW,KAAK,YAAY,KAAK,SAAS;CAC/F,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimationPosition, EffectScales } from "./interfaces.js";
|
|
2
|
-
import { Animation, AnimationKeyFrames, GestureDetail } from "@ionic/core";
|
|
2
|
+
import { Animation, AnimationKeyFrames, GestureDetail } from "@ionic/core/components";
|
|
3
3
|
//#region src/sheets-of-glass/animations.d.ts
|
|
4
4
|
export declare const animationRect: (element: Element, vertical?: boolean) => DOMRect | {
|
|
5
5
|
left: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getStep } from "../utils.js";
|
|
2
|
-
import { createAnimation } from "@ionic/core";
|
|
2
|
+
import { createAnimation } from "@ionic/core/components/index.js";
|
|
3
3
|
//#region src/sheets-of-glass/animations.ts
|
|
4
4
|
const animationRect = (element, vertical = false) => {
|
|
5
5
|
const rect = element.getBoundingClientRect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animations.js","names":[],"sources":["../../src/sheets-of-glass/animations.ts"],"sourcesContent":["import type { Animation, AnimationKeyFrames } from '@ionic/core';\nimport { AnimationPosition, EffectScales } from './interfaces';\nimport { createAnimation, GestureDetail } from '@ionic/core';\nimport { getStep } from '../utils';\n\n// Work in main/cross-axis coordinates so native horizontal samples also drive the rail.\nexport const animationRect = (element: Element, vertical = false) => {\n const rect = element.getBoundingClientRect();\n return vertical\n ? { left: rect.top, top: rect.left, right: rect.bottom, width: rect.height, height: rect.width, x: rect.y, y: rect.x }\n : rect;\n};\nconst translate = (x: number, y: number, vertical: boolean) => `translate3d(${vertical ? y : x}px, ${vertical ? x : y}px, 0)`;\nconst stretchTransform = (x: number, y: number, vertical: boolean) => `scale(${vertical ? y : x}, ${vertical ? x : y})`;\nconst mainSize = (element: HTMLElement, vertical: boolean) => (vertical ? element.offsetHeight : element.offsetWidth);\nconst axisScale = (transform: string, vertical: boolean) => {\n const matrix = new DOMMatrixReadOnly(transform);\n return vertical ? { a: matrix.d, d: matrix.a } : matrix;\n};\n\nexport const getScaleAnimation = (effectElement: Element): Animation => {\n return createAnimation().addElement(effectElement.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!).easing('ease-out');\n};\n\n// Seconds, center progress, extra width/height (pt), platter expansion progress.\nconst tabBarPressFrames = [\n [0, 0, 0, 0, 0],\n [0.033, 0.091, 4.26, 1.52, 0.148],\n [0.067, 0.312, 13.28, 2.89, 0.46],\n [0.1, 0.551, 21.99, 2.24, 0.752],\n [0.133, 0.736, 25.94, 2.77, 0.951],\n [0.167, 0.858, 24.35, 6.03, 1.052],\n [0.2, 0.932, 22.72, 8.41, 1.081],\n [0.267, 0.985, 21.55, 10.38, 1.058],\n [0.333, 1.003, 17.89, 13.98, 1.01],\n [0.4, 1.015, 13.54, 18.42, 1],\n [0.467, 1.018, 11.3, 20.75, 1],\n [0.6, 1.005, 12.36, 19.72, 1],\n [0.733, 0.993, 14.75, 17.27, 1],\n [0.9, 1, 16, 16, 1],\n];\n\n// Short-tap transfer, measured separately from a held press (seconds, center, width/height deltas).\nconst tabBarTapFrames = [\n [0, 0, 0, 0],\n [0.033, 0.099, 4.15, 2.91],\n [0.067, 0.333, 13.81, 5.59],\n [0.1, 0.589, 23.77, 5.52],\n [0.133, 0.794, 29.84, 4.24],\n [0.167, 0.925, 29.01, 5.83],\n [0.2, 0.992, 26.85, 7.25],\n [0.233, 1.015, 25.83, 7.87],\n [0.267, 1.018, 20.43, 5.56],\n [0.3, 1.018, 12.87, 3.16],\n [0.367, 1.024, 1.3, 2.69],\n [0.433, 1.031, -3.98, 4.1],\n [0.5, 1.027, -5.05, 3.89],\n [0.6, 1.013, -2.95, 2.31],\n [0.7, 1.003, -0.74, 0.59],\n [0.8, 1, 0, 0],\n];\n\n// UITabBarController presentation-layer samples: horizontal stretch precedes vertical stretch.\nexport const createTabBarPressAnimation = (\n effect: HTMLElement,\n from: HTMLElement,\n to: HTMLElement,\n bar: HTMLElement,\n vertical = false,\n): Animation => {\n const box = animationRect(bar, vertical);\n const center = box.left + box.width / 2;\n const left = center - mainSize(bar, vertical) / 2;\n const fromBox = animationRect(from, vertical);\n const toBox = animationRect(to, vertical);\n const parentScale = box.width / mainSize(bar, vertical);\n const buttonScale = axisScale(getComputedStyle(from).transform, vertical);\n const width = fromBox.width / parentScale / buttonScale.a;\n const height = fromBox.height / parentScale / buttonScale.d;\n const start = (fromBox.left + fromBox.width / 2 - box.left) / parentScale;\n const end = (toBox.left + toBox.width / 2 - box.left) / parentScale;\n const selected = from === to;\n const growth = vertical ? 20 / 16 : 1;\n const frames = tabBarPressFrames.map(([time, position, extraWidth, extraHeight, expansion]) => {\n const scale = vertical ? 1 : 1 + (14.14 / mainSize(bar, vertical)) * expansion;\n // A selected item expands in place, without the transfer's sideways deformation.\n const press = 1 - Math.exp(-18 * time) * (1 + 18 * time);\n return {\n offset: time / 0.9,\n x: center + (left + start + (end - start) * position - center) * scale - width / 2,\n sx: ((width + (selected ? 16 * press : extraWidth) * growth) * scale) / width,\n sy: ((height + (selected ? 16 * press : extraHeight) * growth) * scale) / height,\n };\n });\n const move = createAnimation()\n .addElement(effect)\n .beforeStyles({\n width: `${vertical ? height : width}px`,\n height: `${vertical ? width : height}px`,\n display: 'block',\n opacity: '1',\n })\n .keyframes(frames.map(({ offset, x }) => ({ offset, transform: translate(x, box.top + box.height / 2 - height / 2, vertical) })));\n const stretch = getScaleAnimation(effect)\n .easing('linear')\n .keyframes(frames.map(({ offset, sx, sy }) => ({ offset, transform: stretchTransform(sx, sy, vertical) })));\n return createAnimation().duration(900).easing('linear').addAnimation([move, stretch]);\n};\n\n// Drag samples: faster movement stretches sideways, then rebounds vertically at rest.\nexport const createTabBarDragAnimation = (effect: HTMLElement, bar: HTMLElement, velocity: number, vertical = false): Animation => {\n const native = effect.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!;\n const current = axisScale(native.style.transform || getComputedStyle(native).transform, vertical);\n const { width, height } = animationRect(effect, vertical);\n const scale = vertical ? 1 : 1 + 14.14 / mainSize(bar, vertical);\n const restX = ((width + (vertical ? 20 : 16)) * scale) / width;\n const restY = ((height + (vertical ? 20 : 16)) * scale) / height;\n // Approximate the 100/600pt/s UIKit samples; keep deformation bounded for fast swipes.\n const stretch = Math.min(16, 32 * velocity * velocity) * scale;\n const rebound = Math.max(stretch, (current.a - restX) * width) * 0.8;\n return getScaleAnimation(effect)\n .duration(500)\n .easing('linear')\n .keyframes([\n { offset: 0, transform: stretchTransform(current.a, current.d, vertical) },\n { offset: 0.2, transform: stretchTransform(restX + stretch / width, restY - stretch / height, vertical) },\n { offset: 0.44, transform: stretchTransform(restX - rebound / width, restY + rebound / height, vertical) },\n { offset: 1, transform: stretchTransform(restX, restY, vertical) },\n ]);\n};\n\n// UITabBarController release samples: return to rest with a small undershoot.\nexport const createTabBarReleaseAnimation = (\n effectElement: Element,\n target: HTMLElement,\n tap?: { elapsed: number; distance: number },\n vertical = false,\n): Animation => {\n const tapElapsed = tap?.elapsed;\n const native = effectElement.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!;\n const scale = axisScale(native.style.transform || getComputedStyle(native).transform, vertical);\n const samples = [\n [0, 1],\n [0.033, 0.85],\n [0.067, 0.58],\n [0.1, 0.31],\n [0.133, 0.15],\n [0.167, 0.055],\n [0.2, 0.01],\n [0.267, -0.01],\n [0.367, -0.004],\n [0.45, 0],\n ];\n const bar = target.parentElement!;\n const box = animationRect(bar, vertical);\n const current = animationRect(effectElement, vertical);\n const targetBox = animationRect(target, vertical);\n const center = box.left + box.width / 2;\n const x = center + (targetBox.left + targetBox.width / 2 - center) / (box.width / mainSize(bar, vertical)) - current.width / 2;\n const y = box.top + box.height / 2 - current.height / 2;\n // The vertical platter contracts from 64pt items to 44 × 58pt on release.\n const endScaleX = vertical ? target.offsetHeight / current.width : 1;\n const endScaleY = vertical ? target.offsetWidth / current.height : 1;\n const elapsed = (tapElapsed ?? 0) / 1000;\n const duration = tapElapsed === undefined ? 450 : 800 - tapElapsed;\n let frames = samples.map(([time, remaining]) => ({\n offset: time / 0.45,\n x: x + (current.x - x) * remaining,\n y: y + (current.y - y) * remaining,\n sx: endScaleX + (scale.a - endScaleX) * remaining,\n sy: endScaleY + (scale.d - endScaleY) * remaining,\n }));\n if (tapElapsed !== undefined && !vertical) {\n const nextIndex = tabBarTapFrames.findIndex(([time]) => time > elapsed);\n const previous = tabBarTapFrames[Math.max(0, nextIndex - 1)];\n const next = tabBarTapFrames[nextIndex];\n const progress = previous[1] + ((next[1] - previous[1]) * (elapsed - previous[0])) / (next[0] - previous[0]);\n // The late squeeze grows with travel (adjacent and three-item UIKit samples).\n const extraDistance = Math.max(0, tap!.distance - 1);\n // Start at the rendered press, not a recomputed rectangle, to avoid a release-frame jump.\n frames = [\n { offset: 0, x: current.x, y: current.y, sx: scale.a, sy: scale.d },\n ...tabBarTapFrames.slice(nextIndex).map(([time, position, width, height]) => ({\n offset: (time - elapsed) / (0.8 - elapsed),\n x: x + ((current.x - x) * (1 - position)) / Math.max(0.1, 1 - progress),\n y: y + ((current.y - y) * (1 - position)) / Math.max(0.1, 1 - progress),\n sx: 1 + (width * (time >= 0.367 ? 1 + 0.75 * extraDistance : 1)) / current.width,\n sy: 1 + (height * (time >= 0.367 ? 1 + 0.5 * extraDistance : 1)) / current.height,\n })),\n ];\n }\n const stretch = createAnimation()\n .addElement(native)\n .duration(duration)\n .easing('linear')\n .keyframes(frames.map(({ offset, sx, sy }) => ({ offset, transform: stretchTransform(sx, sy, vertical) })));\n const move = createAnimation()\n .addElement(effectElement)\n .duration(duration)\n .easing('linear')\n .keyframes(\n frames.map(({ offset, x, y }) => ({\n offset,\n transform: translate(x, y, vertical),\n })),\n );\n // Blend the reflective lens into the selected surface during the final 200ms.\n const offset = 1 - 200 / duration;\n const selectedBackground =\n 'var(--ios27-tab-selected-background, rgba(var(--ios-theme-button-color-selected-rgb, var(--ios26-button-color-selected-rgb, var(--ios27-button-color-selected-default-rgb))), 0.095))';\n const glass = createAnimation()\n .addElement(effectElement)\n .easing('linear')\n .keyframes([\n { offset: 0, opacity: 1 },\n { offset, opacity: 1 },\n { offset: 1, opacity: 0 },\n ]);\n const selected = createAnimation()\n .addElement(target.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!)\n .easing('linear')\n .keyframes([\n { offset: 0, backgroundColor: 'transparent' },\n { offset, backgroundColor: 'transparent' },\n { offset: 1, backgroundColor: selectedBackground },\n ]);\n const release = createAnimation().duration(duration).addAnimation([stretch, move, glass, selected]);\n if (tapElapsed !== undefined && !vertical) {\n // A short UIKit tap keeps expanding after lift-off, then settles independently of the lens.\n // Width deltas from the 50ms tap; preserve the rendered size for an uninterrupted handoff.\n const width = mainSize(bar, vertical);\n const expansion = box.width - width;\n const peak = Math.max(8.65, expansion);\n const platter = createAnimation()\n .addElement(bar)\n .easing('linear')\n .keyframes(\n [\n [0, expansion],\n [17, expansion + (peak - expansion) * 0.503],\n [34, expansion + (peak - expansion) * 0.868],\n [50, peak],\n [67, peak * (8.46 / 8.65)],\n [83, peak * (7.73 / 8.65)],\n [100, peak * (6.66 / 8.65)],\n [117, peak * (5.44 / 8.65)],\n [134, peak * (4.19 / 8.65)],\n [150, peak * (3 / 8.65)],\n [167, peak * (1.97 / 8.65)],\n [184, peak * (1.09 / 8.65)],\n [200, peak * (0.39 / 8.65)],\n [217, 0],\n [234, peak * (-0.48 / 8.65)],\n [250, peak * (-0.7 / 8.65)],\n [267, peak * (-0.8 / 8.65)],\n [283, peak * (-0.82 / 8.65)],\n [300, peak * (-0.77 / 8.65)],\n [317, peak * (-0.68 / 8.65)],\n [334, peak * (-0.57 / 8.65)],\n [350, peak * (-0.46 / 8.65)],\n [383, peak * (-0.14 / 8.65)],\n [417, 0],\n [duration, 0],\n ].map(([time, extra]) => ({ offset: time / duration, transform: `scale(${1 + extra / width}) translateZ(0)` })),\n );\n release.addAnimation(platter);\n }\n return release;\n};\n\nexport const createPreMoveAnimation = (\n effectElement: Element,\n tabSelectedElement: Element,\n currentTouchedElement: Element,\n animationPosition: AnimationPosition,\n): Animation => {\n const diff = Math.max(\n Math.abs(tabSelectedElement.getBoundingClientRect().left - currentTouchedElement.getBoundingClientRect().left),\n 140,\n );\n return createAnimation()\n .duration(diff * 2.1)\n .easing('ease-out')\n .addElement(effectElement)\n .beforeStyles({\n width: `${tabSelectedElement.clientWidth}px`,\n height: `${tabSelectedElement.clientHeight}px`,\n display: 'block',\n opacity: '1',\n transform: 'none',\n })\n .keyframes([\n {\n offset: 0,\n transform: `translate3d(${tabSelectedElement.getBoundingClientRect().left}px, ${animationPosition.positionY}px, 0)`,\n },\n {\n offset: 1,\n transform: `translate3d(${currentTouchedElement.getBoundingClientRect().left}px, ${animationPosition.positionY}px, 0)`,\n },\n ]);\n};\n\nexport const createMoveAnimation = (\n effectElement: Element,\n detail: GestureDetail,\n tabSelectedElement: Element,\n animationPosition: AnimationPosition,\n vertical = false,\n): Animation => {\n return createAnimation()\n .duration(500)\n .addElement(effectElement)\n .beforeStyles({\n width: `${tabSelectedElement.clientWidth}px`,\n height: `${tabSelectedElement.clientHeight}px`,\n display: 'block',\n opacity: '1',\n transform: 'none',\n })\n .fromTo(\n 'transform',\n translate(animationPosition.minPositionX, animationPosition.positionY, vertical),\n translate(animationPosition.maxPositionX, animationPosition.positionY, vertical),\n )\n .progressStep(getStep(detail.currentX, animationPosition));\n};\n\nexport const getMoveAnimationKeyframe = (type: 'moveRight' | 'moveLeft' | 'slowly', scales: EffectScales): AnimationKeyFrames => {\n return {\n moveRight: [\n {\n offset: 0,\n transform: scales.large,\n },\n {\n offset: 0.4,\n transform: scales.small,\n },\n {\n offset: 0.75,\n transform: scales.xlarge,\n },\n {\n offset: 1,\n transform: scales.large,\n },\n ],\n moveLeft: [\n {\n offset: 0,\n transform: scales.large,\n },\n {\n offset: 0.1,\n transform: scales.xlarge,\n },\n {\n offset: 0.6,\n transform: scales.small,\n },\n {\n offset: 1,\n transform: scales.large,\n },\n ],\n slowly: [\n {\n offset: 0,\n transform: scales.large,\n },\n {\n offset: 0.4,\n transform: scales.medium,\n },\n {\n offset: 1,\n transform: scales.large,\n },\n ],\n }[type];\n};\n"],"mappings":";;;AAMA,MAAa,iBAAiB,SAAkB,WAAW,UAAU;CACnE,MAAM,OAAO,QAAQ,sBAAsB;CAC3C,OAAO,WACH;EAAE,MAAM,KAAK;EAAK,KAAK,KAAK;EAAM,OAAO,KAAK;EAAQ,OAAO,KAAK;EAAQ,QAAQ,KAAK;EAAO,GAAG,KAAK;EAAG,GAAG,KAAK;CAAE,IACnH;AACN;AACA,MAAM,aAAa,GAAW,GAAW,aAAsB,eAAe,WAAW,IAAI,EAAE,MAAM,WAAW,IAAI,EAAE;AACtH,MAAM,oBAAoB,GAAW,GAAW,aAAsB,SAAS,WAAW,IAAI,EAAE,IAAI,WAAW,IAAI,EAAE;AACrH,MAAM,YAAY,SAAsB,aAAuB,WAAW,QAAQ,eAAe,QAAQ;AACzG,MAAM,aAAa,WAAmB,aAAsB;CAC1D,MAAM,SAAS,IAAI,kBAAkB,SAAS;CAC9C,OAAO,WAAW;EAAE,GAAG,OAAO;EAAG,GAAG,OAAO;CAAE,IAAI;AACnD;AAEA,MAAa,qBAAqB,kBAAsC;CACt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;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;EACF;EACA,QAAQ;GACN;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;EACF;CACF,EAAE;AACJ"}
|
|
1
|
+
{"version":3,"file":"animations.js","names":[],"sources":["../../src/sheets-of-glass/animations.ts"],"sourcesContent":["import type { Animation, AnimationKeyFrames, GestureDetail } from '@ionic/core/components';\nimport { AnimationPosition, EffectScales } from './interfaces';\nimport { createAnimation } from '@ionic/core/components/index.js';\nimport { getStep } from '../utils';\n\n// Work in main/cross-axis coordinates so native horizontal samples also drive the rail.\nexport const animationRect = (element: Element, vertical = false) => {\n const rect = element.getBoundingClientRect();\n return vertical\n ? { left: rect.top, top: rect.left, right: rect.bottom, width: rect.height, height: rect.width, x: rect.y, y: rect.x }\n : rect;\n};\nconst translate = (x: number, y: number, vertical: boolean) => `translate3d(${vertical ? y : x}px, ${vertical ? x : y}px, 0)`;\nconst stretchTransform = (x: number, y: number, vertical: boolean) => `scale(${vertical ? y : x}, ${vertical ? x : y})`;\nconst mainSize = (element: HTMLElement, vertical: boolean) => (vertical ? element.offsetHeight : element.offsetWidth);\nconst axisScale = (transform: string, vertical: boolean) => {\n const matrix = new DOMMatrixReadOnly(transform);\n return vertical ? { a: matrix.d, d: matrix.a } : matrix;\n};\n\nexport const getScaleAnimation = (effectElement: Element): Animation => {\n return createAnimation().addElement(effectElement.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!).easing('ease-out');\n};\n\n// Seconds, center progress, extra width/height (pt), platter expansion progress.\nconst tabBarPressFrames = [\n [0, 0, 0, 0, 0],\n [0.033, 0.091, 4.26, 1.52, 0.148],\n [0.067, 0.312, 13.28, 2.89, 0.46],\n [0.1, 0.551, 21.99, 2.24, 0.752],\n [0.133, 0.736, 25.94, 2.77, 0.951],\n [0.167, 0.858, 24.35, 6.03, 1.052],\n [0.2, 0.932, 22.72, 8.41, 1.081],\n [0.267, 0.985, 21.55, 10.38, 1.058],\n [0.333, 1.003, 17.89, 13.98, 1.01],\n [0.4, 1.015, 13.54, 18.42, 1],\n [0.467, 1.018, 11.3, 20.75, 1],\n [0.6, 1.005, 12.36, 19.72, 1],\n [0.733, 0.993, 14.75, 17.27, 1],\n [0.9, 1, 16, 16, 1],\n];\n\n// Short-tap transfer, measured separately from a held press (seconds, center, width/height deltas).\nconst tabBarTapFrames = [\n [0, 0, 0, 0],\n [0.033, 0.099, 4.15, 2.91],\n [0.067, 0.333, 13.81, 5.59],\n [0.1, 0.589, 23.77, 5.52],\n [0.133, 0.794, 29.84, 4.24],\n [0.167, 0.925, 29.01, 5.83],\n [0.2, 0.992, 26.85, 7.25],\n [0.233, 1.015, 25.83, 7.87],\n [0.267, 1.018, 20.43, 5.56],\n [0.3, 1.018, 12.87, 3.16],\n [0.367, 1.024, 1.3, 2.69],\n [0.433, 1.031, -3.98, 4.1],\n [0.5, 1.027, -5.05, 3.89],\n [0.6, 1.013, -2.95, 2.31],\n [0.7, 1.003, -0.74, 0.59],\n [0.8, 1, 0, 0],\n];\n\n// UITabBarController presentation-layer samples: horizontal stretch precedes vertical stretch.\nexport const createTabBarPressAnimation = (\n effect: HTMLElement,\n from: HTMLElement,\n to: HTMLElement,\n bar: HTMLElement,\n vertical = false,\n): Animation => {\n const box = animationRect(bar, vertical);\n const center = box.left + box.width / 2;\n const left = center - mainSize(bar, vertical) / 2;\n const fromBox = animationRect(from, vertical);\n const toBox = animationRect(to, vertical);\n const parentScale = box.width / mainSize(bar, vertical);\n const buttonScale = axisScale(getComputedStyle(from).transform, vertical);\n const width = fromBox.width / parentScale / buttonScale.a;\n const height = fromBox.height / parentScale / buttonScale.d;\n const start = (fromBox.left + fromBox.width / 2 - box.left) / parentScale;\n const end = (toBox.left + toBox.width / 2 - box.left) / parentScale;\n const selected = from === to;\n const growth = vertical ? 20 / 16 : 1;\n const frames = tabBarPressFrames.map(([time, position, extraWidth, extraHeight, expansion]) => {\n const scale = vertical ? 1 : 1 + (14.14 / mainSize(bar, vertical)) * expansion;\n // A selected item expands in place, without the transfer's sideways deformation.\n const press = 1 - Math.exp(-18 * time) * (1 + 18 * time);\n return {\n offset: time / 0.9,\n x: center + (left + start + (end - start) * position - center) * scale - width / 2,\n sx: ((width + (selected ? 16 * press : extraWidth) * growth) * scale) / width,\n sy: ((height + (selected ? 16 * press : extraHeight) * growth) * scale) / height,\n };\n });\n const move = createAnimation()\n .addElement(effect)\n .beforeStyles({\n width: `${vertical ? height : width}px`,\n height: `${vertical ? width : height}px`,\n display: 'block',\n opacity: '1',\n })\n .keyframes(frames.map(({ offset, x }) => ({ offset, transform: translate(x, box.top + box.height / 2 - height / 2, vertical) })));\n const stretch = getScaleAnimation(effect)\n .easing('linear')\n .keyframes(frames.map(({ offset, sx, sy }) => ({ offset, transform: stretchTransform(sx, sy, vertical) })));\n return createAnimation().duration(900).easing('linear').addAnimation([move, stretch]);\n};\n\n// Drag samples: faster movement stretches sideways, then rebounds vertically at rest.\nexport const createTabBarDragAnimation = (effect: HTMLElement, bar: HTMLElement, velocity: number, vertical = false): Animation => {\n const native = effect.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!;\n const current = axisScale(native.style.transform || getComputedStyle(native).transform, vertical);\n const { width, height } = animationRect(effect, vertical);\n const scale = vertical ? 1 : 1 + 14.14 / mainSize(bar, vertical);\n const restX = ((width + (vertical ? 20 : 16)) * scale) / width;\n const restY = ((height + (vertical ? 20 : 16)) * scale) / height;\n // Approximate the 100/600pt/s UIKit samples; keep deformation bounded for fast swipes.\n const stretch = Math.min(16, 32 * velocity * velocity) * scale;\n const rebound = Math.max(stretch, (current.a - restX) * width) * 0.8;\n return getScaleAnimation(effect)\n .duration(500)\n .easing('linear')\n .keyframes([\n { offset: 0, transform: stretchTransform(current.a, current.d, vertical) },\n { offset: 0.2, transform: stretchTransform(restX + stretch / width, restY - stretch / height, vertical) },\n { offset: 0.44, transform: stretchTransform(restX - rebound / width, restY + rebound / height, vertical) },\n { offset: 1, transform: stretchTransform(restX, restY, vertical) },\n ]);\n};\n\n// UITabBarController release samples: return to rest with a small undershoot.\nexport const createTabBarReleaseAnimation = (\n effectElement: Element,\n target: HTMLElement,\n tap?: { elapsed: number; distance: number },\n vertical = false,\n): Animation => {\n const tapElapsed = tap?.elapsed;\n const native = effectElement.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!;\n const scale = axisScale(native.style.transform || getComputedStyle(native).transform, vertical);\n const samples = [\n [0, 1],\n [0.033, 0.85],\n [0.067, 0.58],\n [0.1, 0.31],\n [0.133, 0.15],\n [0.167, 0.055],\n [0.2, 0.01],\n [0.267, -0.01],\n [0.367, -0.004],\n [0.45, 0],\n ];\n const bar = target.parentElement!;\n const box = animationRect(bar, vertical);\n const current = animationRect(effectElement, vertical);\n const targetBox = animationRect(target, vertical);\n const center = box.left + box.width / 2;\n const x = center + (targetBox.left + targetBox.width / 2 - center) / (box.width / mainSize(bar, vertical)) - current.width / 2;\n const y = box.top + box.height / 2 - current.height / 2;\n // The vertical platter contracts from 64pt items to 44 × 58pt on release.\n const endScaleX = vertical ? target.offsetHeight / current.width : 1;\n const endScaleY = vertical ? target.offsetWidth / current.height : 1;\n const elapsed = (tapElapsed ?? 0) / 1000;\n const duration = tapElapsed === undefined ? 450 : 800 - tapElapsed;\n let frames = samples.map(([time, remaining]) => ({\n offset: time / 0.45,\n x: x + (current.x - x) * remaining,\n y: y + (current.y - y) * remaining,\n sx: endScaleX + (scale.a - endScaleX) * remaining,\n sy: endScaleY + (scale.d - endScaleY) * remaining,\n }));\n if (tapElapsed !== undefined && !vertical) {\n const nextIndex = tabBarTapFrames.findIndex(([time]) => time > elapsed);\n const previous = tabBarTapFrames[Math.max(0, nextIndex - 1)];\n const next = tabBarTapFrames[nextIndex];\n const progress = previous[1] + ((next[1] - previous[1]) * (elapsed - previous[0])) / (next[0] - previous[0]);\n // The late squeeze grows with travel (adjacent and three-item UIKit samples).\n const extraDistance = Math.max(0, tap!.distance - 1);\n // Start at the rendered press, not a recomputed rectangle, to avoid a release-frame jump.\n frames = [\n { offset: 0, x: current.x, y: current.y, sx: scale.a, sy: scale.d },\n ...tabBarTapFrames.slice(nextIndex).map(([time, position, width, height]) => ({\n offset: (time - elapsed) / (0.8 - elapsed),\n x: x + ((current.x - x) * (1 - position)) / Math.max(0.1, 1 - progress),\n y: y + ((current.y - y) * (1 - position)) / Math.max(0.1, 1 - progress),\n sx: 1 + (width * (time >= 0.367 ? 1 + 0.75 * extraDistance : 1)) / current.width,\n sy: 1 + (height * (time >= 0.367 ? 1 + 0.5 * extraDistance : 1)) / current.height,\n })),\n ];\n }\n const stretch = createAnimation()\n .addElement(native)\n .duration(duration)\n .easing('linear')\n .keyframes(frames.map(({ offset, sx, sy }) => ({ offset, transform: stretchTransform(sx, sy, vertical) })));\n const move = createAnimation()\n .addElement(effectElement)\n .duration(duration)\n .easing('linear')\n .keyframes(\n frames.map(({ offset, x, y }) => ({\n offset,\n transform: translate(x, y, vertical),\n })),\n );\n // Blend the reflective lens into the selected surface during the final 200ms.\n const offset = 1 - 200 / duration;\n const selectedBackground =\n 'var(--ios27-tab-selected-background, rgba(var(--ios-theme-button-color-selected-rgb, var(--ios26-button-color-selected-rgb, var(--ios27-button-color-selected-default-rgb))), 0.095))';\n const glass = createAnimation()\n .addElement(effectElement)\n .easing('linear')\n .keyframes([\n { offset: 0, opacity: 1 },\n { offset, opacity: 1 },\n { offset: 1, opacity: 0 },\n ]);\n const selected = createAnimation()\n .addElement(target.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!)\n .easing('linear')\n .keyframes([\n { offset: 0, backgroundColor: 'transparent' },\n { offset, backgroundColor: 'transparent' },\n { offset: 1, backgroundColor: selectedBackground },\n ]);\n const release = createAnimation().duration(duration).addAnimation([stretch, move, glass, selected]);\n if (tapElapsed !== undefined && !vertical) {\n // A short UIKit tap keeps expanding after lift-off, then settles independently of the lens.\n // Width deltas from the 50ms tap; preserve the rendered size for an uninterrupted handoff.\n const width = mainSize(bar, vertical);\n const expansion = box.width - width;\n const peak = Math.max(8.65, expansion);\n const platter = createAnimation()\n .addElement(bar)\n .easing('linear')\n .keyframes(\n [\n [0, expansion],\n [17, expansion + (peak - expansion) * 0.503],\n [34, expansion + (peak - expansion) * 0.868],\n [50, peak],\n [67, peak * (8.46 / 8.65)],\n [83, peak * (7.73 / 8.65)],\n [100, peak * (6.66 / 8.65)],\n [117, peak * (5.44 / 8.65)],\n [134, peak * (4.19 / 8.65)],\n [150, peak * (3 / 8.65)],\n [167, peak * (1.97 / 8.65)],\n [184, peak * (1.09 / 8.65)],\n [200, peak * (0.39 / 8.65)],\n [217, 0],\n [234, peak * (-0.48 / 8.65)],\n [250, peak * (-0.7 / 8.65)],\n [267, peak * (-0.8 / 8.65)],\n [283, peak * (-0.82 / 8.65)],\n [300, peak * (-0.77 / 8.65)],\n [317, peak * (-0.68 / 8.65)],\n [334, peak * (-0.57 / 8.65)],\n [350, peak * (-0.46 / 8.65)],\n [383, peak * (-0.14 / 8.65)],\n [417, 0],\n [duration, 0],\n ].map(([time, extra]) => ({ offset: time / duration, transform: `scale(${1 + extra / width}) translateZ(0)` })),\n );\n release.addAnimation(platter);\n }\n return release;\n};\n\nexport const createPreMoveAnimation = (\n effectElement: Element,\n tabSelectedElement: Element,\n currentTouchedElement: Element,\n animationPosition: AnimationPosition,\n): Animation => {\n const diff = Math.max(\n Math.abs(tabSelectedElement.getBoundingClientRect().left - currentTouchedElement.getBoundingClientRect().left),\n 140,\n );\n return createAnimation()\n .duration(diff * 2.1)\n .easing('ease-out')\n .addElement(effectElement)\n .beforeStyles({\n width: `${tabSelectedElement.clientWidth}px`,\n height: `${tabSelectedElement.clientHeight}px`,\n display: 'block',\n opacity: '1',\n transform: 'none',\n })\n .keyframes([\n {\n offset: 0,\n transform: `translate3d(${tabSelectedElement.getBoundingClientRect().left}px, ${animationPosition.positionY}px, 0)`,\n },\n {\n offset: 1,\n transform: `translate3d(${currentTouchedElement.getBoundingClientRect().left}px, ${animationPosition.positionY}px, 0)`,\n },\n ]);\n};\n\nexport const createMoveAnimation = (\n effectElement: Element,\n detail: GestureDetail,\n tabSelectedElement: Element,\n animationPosition: AnimationPosition,\n vertical = false,\n): Animation => {\n return createAnimation()\n .duration(500)\n .addElement(effectElement)\n .beforeStyles({\n width: `${tabSelectedElement.clientWidth}px`,\n height: `${tabSelectedElement.clientHeight}px`,\n display: 'block',\n opacity: '1',\n transform: 'none',\n })\n .fromTo(\n 'transform',\n translate(animationPosition.minPositionX, animationPosition.positionY, vertical),\n translate(animationPosition.maxPositionX, animationPosition.positionY, vertical),\n )\n .progressStep(getStep(detail.currentX, animationPosition));\n};\n\nexport const getMoveAnimationKeyframe = (type: 'moveRight' | 'moveLeft' | 'slowly', scales: EffectScales): AnimationKeyFrames => {\n return {\n moveRight: [\n {\n offset: 0,\n transform: scales.large,\n },\n {\n offset: 0.4,\n transform: scales.small,\n },\n {\n offset: 0.75,\n transform: scales.xlarge,\n },\n {\n offset: 1,\n transform: scales.large,\n },\n ],\n moveLeft: [\n {\n offset: 0,\n transform: scales.large,\n },\n {\n offset: 0.1,\n transform: scales.xlarge,\n },\n {\n offset: 0.6,\n transform: scales.small,\n },\n {\n offset: 1,\n transform: scales.large,\n },\n ],\n slowly: [\n {\n offset: 0,\n transform: scales.large,\n },\n {\n offset: 0.4,\n transform: scales.medium,\n },\n {\n offset: 1,\n transform: scales.large,\n },\n ],\n }[type];\n};\n"],"mappings":";;;AAMA,MAAa,iBAAiB,SAAkB,WAAW,UAAU;CACnE,MAAM,OAAO,QAAQ,sBAAsB;CAC3C,OAAO,WACH;EAAE,MAAM,KAAK;EAAK,KAAK,KAAK;EAAM,OAAO,KAAK;EAAQ,OAAO,KAAK;EAAQ,QAAQ,KAAK;EAAO,GAAG,KAAK;EAAG,GAAG,KAAK;CAAE,IACnH;AACN;AACA,MAAM,aAAa,GAAW,GAAW,aAAsB,eAAe,W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,CAAC;AAC7D;AAEA,MAAa,4BAA4B,MAA2C,WAA6C;CAC/H,OAAO;EACL,WAAW;GACT;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;EACF;EACA,UAAU;GACR;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;EACF;EACA,QAAQ;GACN;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;GACA;IACE,QAAQ;IACR,WAAW,OAAO;GACpB;EACF;CACF,EAAE;AACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { changeSelectedElement, cloneElement, getStep } from "../utils.js";
|
|
2
2
|
import { isNativeUIShell } from "../native-integration/index.js";
|
|
3
3
|
import { animationRect, createMoveAnimation, createPreMoveAnimation, createTabBarDragAnimation, createTabBarPressAnimation, createTabBarReleaseAnimation, getMoveAnimationKeyframe, getScaleAnimation } from "./animations.js";
|
|
4
|
-
import { createGesture } from "@ionic/core";
|
|
4
|
+
import { createGesture } from "@ionic/core/components/index.js";
|
|
5
5
|
//#region src/sheets-of-glass/index.ts
|
|
6
6
|
const GESTURE_NAME = "ios27-enable-gesture";
|
|
7
7
|
const ANIMATED_NAME = "ios27-animated";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/sheets-of-glass/index.ts"],"sourcesContent":["import { AnimationPosition, EffectScales, registeredEffect } from './interfaces';\nimport { createAnimation, createGesture } from '@ionic/core';\nimport type { Animation, Gesture, GestureDetail } from '@ionic/core';\nimport { changeSelectedElement, cloneElement, getStep } from '../utils';\nimport { isNativeUIShell } from '../native-integration';\nimport {\n animationRect,\n createMoveAnimation,\n createPreMoveAnimation,\n createTabBarDragAnimation,\n createTabBarPressAnimation,\n createTabBarReleaseAnimation,\n getMoveAnimationKeyframe,\n getScaleAnimation,\n} from './animations';\n\nconst GESTURE_NAME = 'ios27-enable-gesture';\nconst ANIMATED_NAME = 'ios27-animated';\n\nexport const registerEffect = (\n targetElement: HTMLElement,\n effectTagName: string,\n selectedClassName: string,\n scales: EffectScales,\n vertical = false,\n): registeredEffect | undefined => {\n if (!targetElement.classList.contains('ios')) {\n return undefined;\n }\n\n let gesture!: Gesture;\n let moveAnimation: Animation | undefined;\n let currentTouchedElement: HTMLElement | undefined;\n let selectedElementBeforeGesture: HTMLElement | undefined;\n let clearActivatedTimer: ReturnType<typeof setTimeout> | undefined;\n let animationPosition: AnimationPosition | undefined = undefined;\n let scaleAnimationPromise: Promise<void> | undefined;\n let startAnimationPromise: Promise<void> | undefined;\n let maxVelocity = 0;\n let releaseAnimation: Animation | undefined;\n let tabPressAnimation: Animation | undefined;\n let tabPressStartedAt = 0;\n let tabDragging = false;\n let destroyed = false;\n const originalTabBarScale = targetElement.style.getPropertyValue('--ios27-tab-bar-scale');\n const effectElement = cloneElement(effectTagName, false);\n if (vertical) effectElement.classList.add('ios27-vertical-tab-effect');\n const stopTabPress = () => {\n if (!tabPressAnimation) return;\n const native = effectElement.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!;\n const transform = getComputedStyle(effectElement).transform;\n const scale = getComputedStyle(native).transform;\n tabPressAnimation.destroy();\n tabPressAnimation = undefined;\n effectElement.style.transform = transform;\n native.style.transform = scale;\n };\n let onPointerUp: (() => void) | undefined;\n let onPointerCancel: (() => void) | undefined;\n\n const removePointerEndListeners = () => {\n if (onPointerUp) {\n document.removeEventListener('pointerup', onPointerUp);\n onPointerUp = undefined;\n }\n if (onPointerCancel) {\n document.removeEventListener('pointercancel', onPointerCancel);\n onPointerCancel = undefined;\n }\n };\n\n const cancelActiveGesture = () => {\n stopTabPress();\n releaseAnimation?.destroy();\n releaseAnimation = undefined;\n removePointerEndListeners();\n if (clearActivatedTimer !== undefined) {\n clearTimeout(clearActivatedTimer);\n clearActivatedTimer = undefined;\n }\n currentTouchedElement?.classList.remove('ion-activated');\n // Preserve a committed selection, or restore the original if the press was cancelled.\n if (!currentTouchedElement?.classList.contains(selectedClassName)) {\n selectedElementBeforeGesture?.classList.add(selectedClassName);\n }\n currentTouchedElement = undefined;\n selectedElementBeforeGesture = undefined;\n moveAnimation?.destroy();\n moveAnimation = undefined;\n effectElement.style.display = 'none';\n maxVelocity = 0;\n targetElement.classList.remove(ANIMATED_NAME);\n };\n\n /**\n * These event listeners fix a bug where gestures don't complete properly.\n * They terminate the gesture using native events as a fallback.\n */\n const onPointerDown = (event: PointerEvent) => {\n if (isNativeUIShell(targetElement)) return;\n stopTabPress();\n tabDragging = false;\n releaseAnimation?.destroy();\n releaseAnimation = undefined;\n clearActivated();\n gesture.destroy();\n createAnimationGesture();\n removePointerEndListeners();\n onPointerUp = () => {\n clearActivatedTimer = setTimeout(async () => {\n await onEndGesture();\n if (destroyed) return;\n gesture.destroy();\n createAnimationGesture();\n });\n removePointerEndListeners();\n };\n onPointerCancel = () => {\n cancelActiveGesture();\n gesture.destroy();\n createAnimationGesture();\n };\n document.addEventListener('pointerup', onPointerUp);\n document.addEventListener('pointercancel', onPointerCancel);\n };\n targetElement.addEventListener('pointerdown', onPointerDown);\n const onClick = (event: MouseEvent) => {\n // A drag commits its destination itself; the browser may click the old pressed tab.\n if (vertical && tabDragging && event.isTrusted && event.detail > 0) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n };\n targetElement.addEventListener('click', onClick, true);\n\n const axisDetail = (detail: GestureDetail): GestureDetail =>\n vertical\n ? {\n ...detail,\n currentX: detail.currentY,\n currentY: detail.currentX,\n startX: detail.startY,\n startY: detail.startX,\n velocityX: detail.velocityY,\n velocityY: detail.velocityX,\n }\n : detail;\n const createAnimationGesture = () => {\n targetElement.classList.add(GESTURE_NAME);\n gesture = createGesture({\n el: targetElement,\n threshold: 0,\n direction: vertical ? 'y' : 'x',\n gestureName: `${GESTURE_NAME}_${effectTagName}_${crypto.randomUUID()}`,\n onStart: (event) => onStartGesture(axisDetail(event)),\n onMove: (event) => onMoveGesture(axisDetail(event)),\n onEnd: (detail) => {\n // Ionic coalesces moves; consume the release coordinate before committing a drag.\n if (effectTagName === 'ion-tab-button' && tabDragging) onMoveGesture(axisDetail(detail));\n onEndGesture().then();\n },\n });\n gesture.enable(true);\n };\n createAnimationGesture();\n\n const clearActivated = (isEndGesture: boolean = false) => {\n if (!currentTouchedElement) {\n return;\n }\n if (!isEndGesture && !currentTouchedElement.classList.contains(selectedClassName)) {\n currentTouchedElement!.click();\n currentTouchedElement.classList.add(selectedClassName);\n }\n currentTouchedElement.classList.remove('ion-activated');\n currentTouchedElement = undefined;\n selectedElementBeforeGesture = undefined;\n effectElement.style.display = 'none';\n maxVelocity = 0;\n targetElement.classList.remove(ANIMATED_NAME);\n };\n\n const onStartGesture = (detail: GestureDetail): boolean | undefined => {\n if (isNativeUIShell(targetElement)) return false;\n currentTouchedElement = ((detail.event.target as HTMLElement).closest(effectTagName) as HTMLElement) || undefined;\n const tabSelectedElement = targetElement.querySelector(`${effectTagName}.${selectedClassName}`);\n if (\n currentTouchedElement === undefined ||\n currentTouchedElement.parentElement !== targetElement ||\n (currentTouchedElement as HTMLIonTabButtonElement).disabled ||\n tabSelectedElement === null\n ) {\n currentTouchedElement = undefined;\n return false;\n }\n selectedElementBeforeGesture = tabSelectedElement as HTMLElement;\n if (effectTagName === 'ion-tab-button') {\n // UIKit expands the platter by 14.14pt at both two- and four-tab widths.\n targetElement.style.setProperty(\n '--ios27-tab-bar-scale',\n String(1 + 14.14 / (vertical ? targetElement.offsetHeight : targetElement.offsetWidth)),\n );\n }\n if (vertical) targetElement.classList.add(ANIMATED_NAME);\n animationPosition = {\n minPositionX: animationRect(targetElement, vertical).left,\n maxPositionX:\n animationRect(targetElement, vertical).right - (vertical ? tabSelectedElement.clientHeight : tabSelectedElement.clientWidth),\n width: vertical ? tabSelectedElement.clientHeight : tabSelectedElement.clientWidth,\n positionY: animationRect(tabSelectedElement, vertical).top,\n };\n targetElement.classList.add(ANIMATED_NAME);\n changeSelectedElement(targetElement, currentTouchedElement, effectTagName, selectedClassName);\n\n if (effectTagName === 'ion-tab-button') {\n moveAnimation = createMoveAnimation(effectElement, detail, tabSelectedElement, animationPosition, vertical);\n moveAnimation.progressStart(\n true,\n getStep(\n animationRect(tabSelectedElement, vertical).left + animationRect(tabSelectedElement, vertical).width / 2,\n animationPosition,\n ),\n );\n tabPressAnimation = createTabBarPressAnimation(\n effectElement,\n tabSelectedElement as HTMLElement,\n currentTouchedElement,\n targetElement,\n vertical,\n );\n tabPressStartedAt = performance.now();\n void tabPressAnimation.play();\n return true;\n }\n\n const startAnimation = (() => {\n if (tabSelectedElement === currentTouchedElement) {\n return new Promise<void>((resolve) => resolve());\n } else {\n const preMoveAnimation = createPreMoveAnimation(effectElement, tabSelectedElement, currentTouchedElement, animationPosition!);\n return preMoveAnimation.play().finally(() => preMoveAnimation.destroy());\n }\n })();\n startAnimationPromise = startAnimation;\n startAnimation.then(() => {\n if (!currentTouchedElement) {\n return;\n }\n moveAnimation = createMoveAnimation(effectElement, detail, tabSelectedElement, animationPosition!);\n moveAnimation.progressStart(\n true,\n getStep(currentTouchedElement.getBoundingClientRect().left + currentTouchedElement.clientWidth / 2, animationPosition!),\n );\n });\n getScaleAnimation(effectElement).duration(200).to('opacity', 1).to('transform', scales.large).play();\n return true;\n };\n\n const onMoveGesture = (detail: GestureDetail): boolean | undefined => {\n if (currentTouchedElement === undefined || !moveAnimation || releaseAnimation) {\n return false; // Skip Animation\n }\n if (effectTagName === 'ion-tab-button') {\n if (Math.abs(detail.currentX - detail.startX) < 3 && !tabDragging) return;\n tabDragging = true;\n stopTabPress();\n tabPressAnimation = createTabBarDragAnimation(effectElement, targetElement, detail.velocityX, vertical);\n void tabPressAnimation.play();\n } else if (scaleAnimationPromise === undefined) {\n if (Math.abs(detail.velocityX) > maxVelocity) {\n maxVelocity = Math.abs(detail.velocityX);\n }\n if (Math.abs(detail.velocityX) > 0.2) {\n scaleAnimationPromise = getScaleAnimation(effectElement)\n .duration(720)\n .keyframes(getMoveAnimationKeyframe('slowly', scales))\n .play()\n .finally(() => (scaleAnimationPromise = undefined));\n }\n if (maxVelocity > 0.2 && Math.abs(detail.velocityX) < 0.15 && Math.abs(detail.startX - detail.currentX) > 100) {\n scaleAnimationPromise = getScaleAnimation(effectElement)\n .duration(720)\n .keyframes(getMoveAnimationKeyframe(detail.velocityX > 0 ? 'moveRight' : 'moveLeft', scales))\n .play()\n .finally(() => (scaleAnimationPromise = undefined));\n maxVelocity = 0;\n }\n }\n\n const currentX = detail.currentX;\n const previousY = animationRect(targetElement, vertical).top + animationRect(targetElement, vertical).height / 2;\n const nextEl = (targetElement.getRootNode() as Document | ShadowRoot).elementFromPoint(\n vertical ? previousY : currentX,\n vertical ? currentX : previousY,\n );\n let latestTouchedElement: HTMLElement | undefined = (nextEl?.closest(effectTagName) as HTMLElement) || undefined;\n if (vertical && effectTagName === 'ion-tab-button') {\n // Overlapping, scaled tabs must not steal a drag from their neighbor.\n const bar = targetElement.getBoundingClientRect();\n const tabs = Array.from(targetElement.querySelectorAll<HTMLElement>(effectTagName)).filter((tab) => tab.offsetWidth > 0);\n const distance = (tab: HTMLElement) => Math.abs(currentX - (bar.top + tab.offsetTop + tab.offsetHeight / 2));\n latestTouchedElement =\n currentX >= bar.top && currentX <= bar.bottom\n ? tabs.reduce<HTMLElement | undefined>(\n (closest, tab) => (!closest || distance(tab) < distance(closest) ? tab : closest),\n undefined,\n )\n : undefined;\n }\n\n if (\n latestTouchedElement &&\n latestTouchedElement.parentElement === targetElement &&\n !(latestTouchedElement as HTMLIonTabButtonElement).disabled &&\n currentTouchedElement !== latestTouchedElement\n ) {\n currentTouchedElement = latestTouchedElement;\n changeSelectedElement(targetElement, currentTouchedElement, effectTagName, selectedClassName);\n }\n moveAnimation.progressStep(getStep(detail.currentX, animationPosition!));\n return true;\n };\n\n const onEndGesture = async (): Promise<boolean | undefined> => {\n if (releaseAnimation) return;\n // タイマーをクリア(正常にonEndGestureが実行された場合)\n if (clearActivatedTimer !== undefined) {\n clearTimeout(clearActivatedTimer);\n clearActivatedTimer = undefined;\n }\n\n if (currentTouchedElement && !currentTouchedElement.classList.contains(selectedClassName)) {\n currentTouchedElement.click();\n currentTouchedElement.classList.add(selectedClassName);\n }\n\n if (startAnimationPromise) {\n await startAnimationPromise;\n }\n\n const tapElapsed =\n tabPressAnimation && !tabDragging && selectedElementBeforeGesture !== currentTouchedElement\n ? performance.now() - tabPressStartedAt\n : undefined;\n if (tabPressAnimation && !tabDragging && tapElapsed === undefined) {\n // A quick tap still completes the initial stretch before relaxing.\n const pressing = tabPressAnimation;\n const remaining = 200 - (performance.now() - tabPressStartedAt);\n if (remaining > 0) await new Promise<void>((resolve) => setTimeout(resolve, remaining));\n if (tabPressAnimation !== pressing) return;\n }\n\n if (currentTouchedElement === undefined || !moveAnimation || releaseAnimation) {\n return false;\n }\n\n if (effectTagName !== 'ion-tab-button')\n setTimeout(() => {\n if (!currentTouchedElement) {\n return;\n }\n const targetX = currentTouchedElement.getBoundingClientRect().left + currentTouchedElement.clientWidth / 2;\n const step = getStep(targetX, animationPosition!);\n moveAnimation!.progressStep(step);\n });\n if (effectTagName === 'ion-tab-button') {\n stopTabPress();\n moveAnimation.destroy();\n moveAnimation = undefined;\n const tabs = Array.from(targetElement.querySelectorAll<HTMLElement>(effectTagName)).filter((tab) => tab.offsetWidth > 0);\n if (vertical) {\n currentTouchedElement.classList.remove('ion-activated');\n targetElement.classList.remove(ANIMATED_NAME);\n }\n const releasing = createTabBarReleaseAnimation(\n effectElement,\n currentTouchedElement,\n tapElapsed !== undefined && tapElapsed < 200\n ? {\n elapsed: tapElapsed,\n distance: Math.abs(tabs.indexOf(currentTouchedElement) - tabs.indexOf(selectedElementBeforeGesture!)),\n }\n : undefined,\n vertical,\n );\n currentTouchedElement.classList.remove('ion-activated');\n releaseAnimation = releasing;\n await releasing.play();\n if (releaseAnimation !== releasing) return;\n clearActivated(true);\n releasing.destroy();\n releaseAnimation = undefined;\n } else {\n await getScaleAnimation(effectElement).duration(120).to('transform', `scale(1, 0.92)`).play();\n }\n moveAnimation?.destroy();\n\n clearActivated(true);\n return true;\n };\n\n const nativeChanged = () => {\n gesture.enable(!isNativeUIShell(targetElement));\n cancelActiveGesture();\n };\n targetElement.addEventListener('nativeUIShellChange', nativeChanged);\n if (isNativeUIShell(targetElement)) nativeChanged();\n\n return {\n destroy: () => {\n destroyed = true;\n cancelActiveGesture();\n // Remove event listeners\n targetElement.removeEventListener('pointerdown', onPointerDown);\n targetElement.removeEventListener('click', onClick, true);\n targetElement.removeEventListener('nativeUIShellChange', nativeChanged);\n\n // Destroy gesture\n if (gesture) {\n gesture.destroy();\n }\n // Remove gesture class\n targetElement.classList.remove(GESTURE_NAME);\n effectElement.remove();\n if (effectTagName === 'ion-tab-button') {\n if (originalTabBarScale) targetElement.style.setProperty('--ios27-tab-bar-scale', originalTabBarScale);\n else targetElement.style.removeProperty('--ios27-tab-bar-scale');\n }\n },\n };\n};\n"],"mappings":";;;;;AAgBA,MAAM,eAAe;AACrB,MAAM,gBAAgB;AAEtB,MAAa,kBACX,eACA,eACA,mBACA,QACA,WAAW,UACsB;CACjC,IAAI,CAAC,cAAc,UAAU,SAAS,KAAK,GACzC;CAGF,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI,oBAAmD,KAAA;CACvD,IAAI;CACJ,IAAI;CACJ,IAAI,cAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI,oBAAoB;CACxB,IAAI,cAAc;CAClB,IAAI,YAAY;CAChB,MAAM,sBAAsB,cAAc,MAAM,iBAAiB,uBAAuB;CACxF,MAAM,gBAAgB,aAAa,eAAe,K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B;GACnB,MAAM,UAAU,KAAK;GACrB,IAAI,qBAAqB,WAAW;GACpC,eAAe,IAAI;GACnB,UAAU,QAAQ;GAClB,mBAAmB,KAAA;EACrB,OACE,MAAM,kBAAkB,aAAa,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,aAAa,gBAAgB,CAAC,CAAC,KAAK;EAE9F,eAAe,QAAQ;EAEvB,eAAe,IAAI;EACnB,OAAO;CACT;CAEA,MAAM,sBAAsB;EAC1B,QAAQ,OAAO,CAAC,gBAAgB,aAAa,CAAC;EAC9C,oBAAoB;CACtB;CACA,cAAc,iBAAiB,uBAAuB,aAAa;CACnE,IAAI,gBAAgB,aAAa,GAAG,cAAc;CAElD,OAAO,EACL,eAAe;EACb,YAAY;EACZ,oBAAoB;EAEpB,cAAc,oBAAoB,eAAe,aAAa;EAC9D,cAAc,oBAAoB,SAAS,SAAS,IAAI;EACxD,cAAc,oBAAoB,uBAAuB,aAAa;EAGtE,IAAI,SACF,QAAQ,QAAQ;EAGlB,cAAc,UAAU,OAAO,YAAY;EAC3C,cAAc,OAAO;EACrB,IAAI,kBAAkB,kBAAkB;GACtC,IAAI,qBAAqB,cAAc,MAAM,YAAY,yBAAyB,mBAAmB;QAChG,cAAc,MAAM,eAAe,uBAAuB;EACjE;CACF,EACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/sheets-of-glass/index.ts"],"sourcesContent":["import { AnimationPosition, EffectScales, registeredEffect } from './interfaces';\nimport { createAnimation, createGesture } from '@ionic/core/components/index.js';\nimport type { Animation, Gesture, GestureDetail } from '@ionic/core/components';\nimport { changeSelectedElement, cloneElement, getStep } from '../utils';\nimport { isNativeUIShell } from '../native-integration';\nimport {\n animationRect,\n createMoveAnimation,\n createPreMoveAnimation,\n createTabBarDragAnimation,\n createTabBarPressAnimation,\n createTabBarReleaseAnimation,\n getMoveAnimationKeyframe,\n getScaleAnimation,\n} from './animations';\n\nconst GESTURE_NAME = 'ios27-enable-gesture';\nconst ANIMATED_NAME = 'ios27-animated';\n\nexport const registerEffect = (\n targetElement: HTMLElement,\n effectTagName: string,\n selectedClassName: string,\n scales: EffectScales,\n vertical = false,\n): registeredEffect | undefined => {\n if (!targetElement.classList.contains('ios')) {\n return undefined;\n }\n\n let gesture!: Gesture;\n let moveAnimation: Animation | undefined;\n let currentTouchedElement: HTMLElement | undefined;\n let selectedElementBeforeGesture: HTMLElement | undefined;\n let clearActivatedTimer: ReturnType<typeof setTimeout> | undefined;\n let animationPosition: AnimationPosition | undefined = undefined;\n let scaleAnimationPromise: Promise<void> | undefined;\n let startAnimationPromise: Promise<void> | undefined;\n let maxVelocity = 0;\n let releaseAnimation: Animation | undefined;\n let tabPressAnimation: Animation | undefined;\n let tabPressStartedAt = 0;\n let tabDragging = false;\n let destroyed = false;\n const originalTabBarScale = targetElement.style.getPropertyValue('--ios27-tab-bar-scale');\n const effectElement = cloneElement(effectTagName, false);\n if (vertical) effectElement.classList.add('ios27-vertical-tab-effect');\n const stopTabPress = () => {\n if (!tabPressAnimation) return;\n const native = effectElement.shadowRoot!.querySelector<HTMLElement>('[part=\"native\"]')!;\n const transform = getComputedStyle(effectElement).transform;\n const scale = getComputedStyle(native).transform;\n tabPressAnimation.destroy();\n tabPressAnimation = undefined;\n effectElement.style.transform = transform;\n native.style.transform = scale;\n };\n let onPointerUp: (() => void) | undefined;\n let onPointerCancel: (() => void) | undefined;\n\n const removePointerEndListeners = () => {\n if (onPointerUp) {\n document.removeEventListener('pointerup', onPointerUp);\n onPointerUp = undefined;\n }\n if (onPointerCancel) {\n document.removeEventListener('pointercancel', onPointerCancel);\n onPointerCancel = undefined;\n }\n };\n\n const cancelActiveGesture = () => {\n stopTabPress();\n releaseAnimation?.destroy();\n releaseAnimation = undefined;\n removePointerEndListeners();\n if (clearActivatedTimer !== undefined) {\n clearTimeout(clearActivatedTimer);\n clearActivatedTimer = undefined;\n }\n currentTouchedElement?.classList.remove('ion-activated');\n // Preserve a committed selection, or restore the original if the press was cancelled.\n if (!currentTouchedElement?.classList.contains(selectedClassName)) {\n selectedElementBeforeGesture?.classList.add(selectedClassName);\n }\n currentTouchedElement = undefined;\n selectedElementBeforeGesture = undefined;\n moveAnimation?.destroy();\n moveAnimation = undefined;\n effectElement.style.display = 'none';\n maxVelocity = 0;\n targetElement.classList.remove(ANIMATED_NAME);\n };\n\n /**\n * These event listeners fix a bug where gestures don't complete properly.\n * They terminate the gesture using native events as a fallback.\n */\n const onPointerDown = (event: PointerEvent) => {\n if (isNativeUIShell(targetElement)) return;\n stopTabPress();\n tabDragging = false;\n releaseAnimation?.destroy();\n releaseAnimation = undefined;\n clearActivated();\n gesture.destroy();\n createAnimationGesture();\n removePointerEndListeners();\n onPointerUp = () => {\n clearActivatedTimer = setTimeout(async () => {\n await onEndGesture();\n if (destroyed) return;\n gesture.destroy();\n createAnimationGesture();\n });\n removePointerEndListeners();\n };\n onPointerCancel = () => {\n cancelActiveGesture();\n gesture.destroy();\n createAnimationGesture();\n };\n document.addEventListener('pointerup', onPointerUp);\n document.addEventListener('pointercancel', onPointerCancel);\n };\n targetElement.addEventListener('pointerdown', onPointerDown);\n const onClick = (event: MouseEvent) => {\n // A drag commits its destination itself; the browser may click the old pressed tab.\n if (vertical && tabDragging && event.isTrusted && event.detail > 0) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n };\n targetElement.addEventListener('click', onClick, true);\n\n const axisDetail = (detail: GestureDetail): GestureDetail =>\n vertical\n ? {\n ...detail,\n currentX: detail.currentY,\n currentY: detail.currentX,\n startX: detail.startY,\n startY: detail.startX,\n velocityX: detail.velocityY,\n velocityY: detail.velocityX,\n }\n : detail;\n const createAnimationGesture = () => {\n targetElement.classList.add(GESTURE_NAME);\n gesture = createGesture({\n el: targetElement,\n threshold: 0,\n direction: vertical ? 'y' : 'x',\n gestureName: `${GESTURE_NAME}_${effectTagName}_${crypto.randomUUID()}`,\n onStart: (event) => onStartGesture(axisDetail(event)),\n onMove: (event) => onMoveGesture(axisDetail(event)),\n onEnd: (detail) => {\n // Ionic coalesces moves; consume the release coordinate before committing a drag.\n if (effectTagName === 'ion-tab-button' && tabDragging) onMoveGesture(axisDetail(detail));\n onEndGesture().then();\n },\n });\n gesture.enable(true);\n };\n createAnimationGesture();\n\n const clearActivated = (isEndGesture: boolean = false) => {\n if (!currentTouchedElement) {\n return;\n }\n if (!isEndGesture && !currentTouchedElement.classList.contains(selectedClassName)) {\n currentTouchedElement!.click();\n currentTouchedElement.classList.add(selectedClassName);\n }\n currentTouchedElement.classList.remove('ion-activated');\n currentTouchedElement = undefined;\n selectedElementBeforeGesture = undefined;\n effectElement.style.display = 'none';\n maxVelocity = 0;\n targetElement.classList.remove(ANIMATED_NAME);\n };\n\n const onStartGesture = (detail: GestureDetail): boolean | undefined => {\n if (isNativeUIShell(targetElement)) return false;\n currentTouchedElement = ((detail.event.target as HTMLElement).closest(effectTagName) as HTMLElement) || undefined;\n const tabSelectedElement = targetElement.querySelector(`${effectTagName}.${selectedClassName}`);\n if (\n currentTouchedElement === undefined ||\n currentTouchedElement.parentElement !== targetElement ||\n (currentTouchedElement as HTMLIonTabButtonElement).disabled ||\n tabSelectedElement === null\n ) {\n currentTouchedElement = undefined;\n return false;\n }\n selectedElementBeforeGesture = tabSelectedElement as HTMLElement;\n if (effectTagName === 'ion-tab-button') {\n // UIKit expands the platter by 14.14pt at both two- and four-tab widths.\n targetElement.style.setProperty(\n '--ios27-tab-bar-scale',\n String(1 + 14.14 / (vertical ? targetElement.offsetHeight : targetElement.offsetWidth)),\n );\n }\n if (vertical) targetElement.classList.add(ANIMATED_NAME);\n animationPosition = {\n minPositionX: animationRect(targetElement, vertical).left,\n maxPositionX:\n animationRect(targetElement, vertical).right - (vertical ? tabSelectedElement.clientHeight : tabSelectedElement.clientWidth),\n width: vertical ? tabSelectedElement.clientHeight : tabSelectedElement.clientWidth,\n positionY: animationRect(tabSelectedElement, vertical).top,\n };\n targetElement.classList.add(ANIMATED_NAME);\n changeSelectedElement(targetElement, currentTouchedElement, effectTagName, selectedClassName);\n\n if (effectTagName === 'ion-tab-button') {\n moveAnimation = createMoveAnimation(effectElement, detail, tabSelectedElement, animationPosition, vertical);\n moveAnimation.progressStart(\n true,\n getStep(\n animationRect(tabSelectedElement, vertical).left + animationRect(tabSelectedElement, vertical).width / 2,\n animationPosition,\n ),\n );\n tabPressAnimation = createTabBarPressAnimation(\n effectElement,\n tabSelectedElement as HTMLElement,\n currentTouchedElement,\n targetElement,\n vertical,\n );\n tabPressStartedAt = performance.now();\n void tabPressAnimation.play();\n return true;\n }\n\n const startAnimation = (() => {\n if (tabSelectedElement === currentTouchedElement) {\n return new Promise<void>((resolve) => resolve());\n } else {\n const preMoveAnimation = createPreMoveAnimation(effectElement, tabSelectedElement, currentTouchedElement, animationPosition!);\n return preMoveAnimation.play().finally(() => preMoveAnimation.destroy());\n }\n })();\n startAnimationPromise = startAnimation;\n startAnimation.then(() => {\n if (!currentTouchedElement) {\n return;\n }\n moveAnimation = createMoveAnimation(effectElement, detail, tabSelectedElement, animationPosition!);\n moveAnimation.progressStart(\n true,\n getStep(currentTouchedElement.getBoundingClientRect().left + currentTouchedElement.clientWidth / 2, animationPosition!),\n );\n });\n getScaleAnimation(effectElement).duration(200).to('opacity', 1).to('transform', scales.large).play();\n return true;\n };\n\n const onMoveGesture = (detail: GestureDetail): boolean | undefined => {\n if (currentTouchedElement === undefined || !moveAnimation || releaseAnimation) {\n return false; // Skip Animation\n }\n if (effectTagName === 'ion-tab-button') {\n if (Math.abs(detail.currentX - detail.startX) < 3 && !tabDragging) return;\n tabDragging = true;\n stopTabPress();\n tabPressAnimation = createTabBarDragAnimation(effectElement, targetElement, detail.velocityX, vertical);\n void tabPressAnimation.play();\n } else if (scaleAnimationPromise === undefined) {\n if (Math.abs(detail.velocityX) > maxVelocity) {\n maxVelocity = Math.abs(detail.velocityX);\n }\n if (Math.abs(detail.velocityX) > 0.2) {\n scaleAnimationPromise = getScaleAnimation(effectElement)\n .duration(720)\n .keyframes(getMoveAnimationKeyframe('slowly', scales))\n .play()\n .finally(() => (scaleAnimationPromise = undefined));\n }\n if (maxVelocity > 0.2 && Math.abs(detail.velocityX) < 0.15 && Math.abs(detail.startX - detail.currentX) > 100) {\n scaleAnimationPromise = getScaleAnimation(effectElement)\n .duration(720)\n .keyframes(getMoveAnimationKeyframe(detail.velocityX > 0 ? 'moveRight' : 'moveLeft', scales))\n .play()\n .finally(() => (scaleAnimationPromise = undefined));\n maxVelocity = 0;\n }\n }\n\n const currentX = detail.currentX;\n const previousY = animationRect(targetElement, vertical).top + animationRect(targetElement, vertical).height / 2;\n const nextEl = (targetElement.getRootNode() as Document | ShadowRoot).elementFromPoint(\n vertical ? previousY : currentX,\n vertical ? currentX : previousY,\n );\n let latestTouchedElement: HTMLElement | undefined = (nextEl?.closest(effectTagName) as HTMLElement) || undefined;\n if (vertical && effectTagName === 'ion-tab-button') {\n // Overlapping, scaled tabs must not steal a drag from their neighbor.\n const bar = targetElement.getBoundingClientRect();\n const tabs = Array.from(targetElement.querySelectorAll<HTMLElement>(effectTagName)).filter((tab) => tab.offsetWidth > 0);\n const distance = (tab: HTMLElement) => Math.abs(currentX - (bar.top + tab.offsetTop + tab.offsetHeight / 2));\n latestTouchedElement =\n currentX >= bar.top && currentX <= bar.bottom\n ? tabs.reduce<HTMLElement | undefined>(\n (closest, tab) => (!closest || distance(tab) < distance(closest) ? tab : closest),\n undefined,\n )\n : undefined;\n }\n\n if (\n latestTouchedElement &&\n latestTouchedElement.parentElement === targetElement &&\n !(latestTouchedElement as HTMLIonTabButtonElement).disabled &&\n currentTouchedElement !== latestTouchedElement\n ) {\n currentTouchedElement = latestTouchedElement;\n changeSelectedElement(targetElement, currentTouchedElement, effectTagName, selectedClassName);\n }\n moveAnimation.progressStep(getStep(detail.currentX, animationPosition!));\n return true;\n };\n\n const onEndGesture = async (): Promise<boolean | undefined> => {\n if (releaseAnimation) return;\n // タイマーをクリア(正常にonEndGestureが実行された場合)\n if (clearActivatedTimer !== undefined) {\n clearTimeout(clearActivatedTimer);\n clearActivatedTimer = undefined;\n }\n\n if (currentTouchedElement && !currentTouchedElement.classList.contains(selectedClassName)) {\n currentTouchedElement.click();\n currentTouchedElement.classList.add(selectedClassName);\n }\n\n if (startAnimationPromise) {\n await startAnimationPromise;\n }\n\n const tapElapsed =\n tabPressAnimation && !tabDragging && selectedElementBeforeGesture !== currentTouchedElement\n ? performance.now() - tabPressStartedAt\n : undefined;\n if (tabPressAnimation && !tabDragging && tapElapsed === undefined) {\n // A quick tap still completes the initial stretch before relaxing.\n const pressing = tabPressAnimation;\n const remaining = 200 - (performance.now() - tabPressStartedAt);\n if (remaining > 0) await new Promise<void>((resolve) => setTimeout(resolve, remaining));\n if (tabPressAnimation !== pressing) return;\n }\n\n if (currentTouchedElement === undefined || !moveAnimation || releaseAnimation) {\n return false;\n }\n\n if (effectTagName !== 'ion-tab-button')\n setTimeout(() => {\n if (!currentTouchedElement) {\n return;\n }\n const targetX = currentTouchedElement.getBoundingClientRect().left + currentTouchedElement.clientWidth / 2;\n const step = getStep(targetX, animationPosition!);\n moveAnimation!.progressStep(step);\n });\n if (effectTagName === 'ion-tab-button') {\n stopTabPress();\n moveAnimation.destroy();\n moveAnimation = undefined;\n const tabs = Array.from(targetElement.querySelectorAll<HTMLElement>(effectTagName)).filter((tab) => tab.offsetWidth > 0);\n if (vertical) {\n currentTouchedElement.classList.remove('ion-activated');\n targetElement.classList.remove(ANIMATED_NAME);\n }\n const releasing = createTabBarReleaseAnimation(\n effectElement,\n currentTouchedElement,\n tapElapsed !== undefined && tapElapsed < 200\n ? {\n elapsed: tapElapsed,\n distance: Math.abs(tabs.indexOf(currentTouchedElement) - tabs.indexOf(selectedElementBeforeGesture!)),\n }\n : undefined,\n vertical,\n );\n currentTouchedElement.classList.remove('ion-activated');\n releaseAnimation = releasing;\n await releasing.play();\n if (releaseAnimation !== releasing) return;\n clearActivated(true);\n releasing.destroy();\n releaseAnimation = undefined;\n } else {\n await getScaleAnimation(effectElement).duration(120).to('transform', `scale(1, 0.92)`).play();\n }\n moveAnimation?.destroy();\n\n clearActivated(true);\n return true;\n };\n\n const nativeChanged = () => {\n gesture.enable(!isNativeUIShell(targetElement));\n cancelActiveGesture();\n };\n targetElement.addEventListener('nativeUIShellChange', nativeChanged);\n if (isNativeUIShell(targetElement)) nativeChanged();\n\n return {\n destroy: () => {\n destroyed = true;\n cancelActiveGesture();\n // Remove event listeners\n targetElement.removeEventListener('pointerdown', onPointerDown);\n targetElement.removeEventListener('click', onClick, true);\n targetElement.removeEventListener('nativeUIShellChange', nativeChanged);\n\n // Destroy gesture\n if (gesture) {\n gesture.destroy();\n }\n // Remove gesture class\n targetElement.classList.remove(GESTURE_NAME);\n effectElement.remove();\n if (effectTagName === 'ion-tab-button') {\n if (originalTabBarScale) targetElement.style.setProperty('--ios27-tab-bar-scale', originalTabBarScale);\n else targetElement.style.removeProperty('--ios27-tab-bar-scale');\n }\n },\n };\n};\n"],"mappings":";;;;;AAgBA,MAAM,eAAe;AACrB,MAAM,gBAAgB;AAEtB,MAAa,kBACX,eACA,eACA,mBACA,QACA,WAAW,UACsB;CACjC,IAAI,CAAC,cAAc,UAAU,SAAS,KAAK,GACzC;CAGF,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI,oBAAmD,KAAA;CACvD,IAAI;CACJ,IAAI;CACJ,IAAI,cAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI,oBAAoB;CACxB,IAAI,cAAc;CAClB,IAAI,YAAY;CAChB,MAAM,sBAAsB,cAAc,MAAM,iBAAiB,uBAAuB;CACxF,MAAM,gBAAgB,aAAa,eAAe,KAAK;CACvD,IAAI,UAAU,cAAc,UAAU,IAAI,2BAA2B;CACrE,MAAM,qBAAqB;EACzB,IAAI,CAAC,mBAAmB;EACxB,MAAM,SAAS,cAAc,WAAY,cAA2B,mBAAiB;EACrF,MAAM,YAAY,iBAAiB,aAAa,CAAC,CAAC;EAClD,MA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gB,CAAC,CAAC,KAAK;EAE9F,eAAe,QAAQ;EAEvB,eAAe,IAAI;EACnB,OAAO;CACT;CAEA,MAAM,sBAAsB;EAC1B,QAAQ,OAAO,CAAC,gBAAgB,aAAa,CAAC;EAC9C,oBAAoB;CACtB;CACA,cAAc,iBAAiB,uBAAuB,aAAa;CACnE,IAAI,gBAAgB,aAAa,GAAG,cAAc;CAElD,OAAO,EACL,eAAe;EACb,YAAY;EACZ,oBAAoB;EAEpB,cAAc,oBAAoB,eAAe,aAAa;EAC9D,cAAc,oBAAoB,SAAS,SAAS,IAAI;EACxD,cAAc,oBAAoB,uBAAuB,aAAa;EAGtE,IAAI,SACF,QAAQ,QAAQ;EAGlB,cAAc,UAAU,OAAO,YAAY;EAC3C,cAAc,OAAO;EACrB,IAAI,kBAAkB,kBAAkB;GACtC,IAAI,qBAAqB,cAAc,MAAM,YAAY,yBAAyB,mBAAmB;QAChG,cAAc,MAAM,eAAe,uBAAuB;EACjE;CACF,EACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Animation } from "@ionic/core";
|
|
2
1
|
import { ElementReferences, ElementSizes } from "@rdlabo/ionic-theme-utils";
|
|
2
|
+
import { Animation } from "@ionic/core/components";
|
|
3
3
|
//#region src/tab-bar-searchable/animations/enter.d.ts
|
|
4
4
|
export declare const createEffectAnimation: (references: ElementReferences, sizes: ElementSizes) => Animation;
|
|
5
5
|
export declare const createSearchContainerAnimation: (references: ElementReferences, sizes: ElementSizes) => Animation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enter.d.ts","names":[],"sources":["../../../src/tab-bar-searchable/animations/enter.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"enter.d.ts","names":[],"sources":["../../../src/tab-bar-searchable/animations/enter.ts"],"mappings":";;;qBAKa,wBAAyB,YAAY,mBAAmB,OAAO,iBAAe;qBA4B9E,iCAAkC,YAAY,mBAAmB,OAAO,iBAAe;qBAYvF,8BAA+B,YAAY,sBAAoB;qBAS/D,wBAAyB,WAAW,aAAa,YAAY,mBAAmB,OAAO,iBAAe;qBA2BtG,2BAA4B,cAAc,gBAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cloneElement } from "../../utils.js";
|
|
2
|
-
import { createAnimation } from "@ionic/core";
|
|
2
|
+
import { createAnimation } from "@ionic/core/components/index.js";
|
|
3
3
|
import { ANIMATION_DELAY_CLOSE_BUTTONS, OPACITY_TRANSITION } from "@rdlabo/ionic-theme-utils";
|
|
4
4
|
//#region src/tab-bar-searchable/animations/enter.ts
|
|
5
5
|
const createEffectAnimation = (references, sizes) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enter.js","names":[],"sources":["../../../src/tab-bar-searchable/animations/enter.ts"],"sourcesContent":["import { Animation
|
|
1
|
+
{"version":3,"file":"enter.js","names":[],"sources":["../../../src/tab-bar-searchable/animations/enter.ts"],"sourcesContent":["import type { Animation } from '@ionic/core/components';\nimport { createAnimation } from '@ionic/core/components/index.js';\nimport { ANIMATION_DELAY_CLOSE_BUTTONS, OPACITY_TRANSITION, type ElementReferences, type ElementSizes } from '@rdlabo/ionic-theme-utils';\nimport { cloneElement } from '../../utils';\n\nexport const createEffectAnimation = (references: ElementReferences, sizes: ElementSizes): Animation => {\n const effectElement = cloneElement('ion-icon');\n const closeButtonRect = references.closeButtonIcon?.getBoundingClientRect();\n const iconName = references.selectedTabButtonIcon?.getAttribute('name');\n const selectedTabButtonIconRect = references.selectedTabButtonIcon?.getBoundingClientRect();\n\n return createAnimation()\n .addElement(effectElement)\n .beforeAddWrite(() => {\n effectElement.style.display = 'inline-block';\n references.closeButtonIcon.style.opacity = '0';\n if (iconName && closeButtonRect) {\n effectElement.setAttribute('name', iconName);\n effectElement.style.width = `${closeButtonRect.width}px`;\n effectElement.style.height = `${closeButtonRect.height}px`;\n }\n })\n .afterAddWrite(() => {\n effectElement.style.display = 'none';\n references.closeButtonIcon.style.opacity = '1';\n })\n .fromTo(\n 'transform',\n `translate3d(${selectedTabButtonIconRect.left}px, ${selectedTabButtonIconRect.top}px, 0)`,\n `translate3d(${closeButtonRect.left}px, ${closeButtonRect.top}px, 0)`,\n );\n};\n\nexport const createSearchContainerAnimation = (references: ElementReferences, sizes: ElementSizes): Animation => {\n return createAnimation()\n .addElement(references.searchContainer)\n .beforeAddWrite(() => (references.searchContainer.style.transformOrigin = 'right center'))\n .fromTo(\n 'transform',\n `scale(${sizes.fabButton.width / sizes.searchContainer.width}, ${sizes.fabButton.height / sizes.searchContainer.height})`,\n 'scale(1)',\n )\n .fromTo('opacity', '0.2', '1');\n};\n\nexport const createCloseButtonsAnimation = (references: ElementReferences): Animation => {\n return createAnimation()\n .delay(ANIMATION_DELAY_CLOSE_BUTTONS)\n .addElement(references.closeButtons)\n .beforeAddWrite(() => (references.closeButtons.style.transformOrigin = 'left center'))\n .afterClearStyles(['transform', 'transform-origin'])\n .fromTo('transform', 'scale(1.5, 1)', 'scale(1)');\n};\n\nexport const createTabBarAnimation = (ionTabBar: HTMLElement, references: ElementReferences, sizes: ElementSizes): Animation => {\n return createAnimation()\n .addElement(ionTabBar)\n .beforeAddWrite(() => {\n ionTabBar.style.transformOrigin = 'left center';\n ionTabBar.querySelectorAll<HTMLElement>('ion-tab-button').forEach((element: HTMLElement) => {\n element.style.transition = OPACITY_TRANSITION;\n element.style.opacity = '0';\n });\n references.selectedTabButton.classList.remove('tab-selected');\n const iconName = references.selectedTabButtonIcon?.getAttribute('name');\n if (iconName) {\n references.closeButtonIcon?.setAttribute('name', iconName);\n }\n })\n .afterAddWrite(() => {\n references.selectedTabButton.classList.add('tab-selected');\n ionTabBar.style.pointerEvents = 'none';\n })\n .fromTo(\n 'transform',\n 'scale(1)',\n `scale(${sizes.closeButton.width / sizes.tabBar.width}, ${sizes.closeButton.height / sizes.tabBar.height})`,\n )\n .fromTo('opacity', '1', '0');\n};\n\nexport const createFabButtonAnimation = (ionFabButton: HTMLElement): Animation => {\n return createAnimation()\n .addElement(ionFabButton)\n .beforeAddWrite(() => {\n ionFabButton.style.transformOrigin = 'center right';\n ionFabButton.querySelector<HTMLElement>('ion-icon')?.style.setProperty('opacity', '0');\n })\n .afterAddWrite(() => {\n ionFabButton.style.pointerEvents = 'none';\n })\n .fromTo('opacity', '1', '0');\n};\n"],"mappings":";;;;AAKA,MAAa,yBAAyB,YAA+B,UAAmC;CACtG,MAAM,gBAAgB,aAAa,UAAU;CAC7C,MAAM,kBAAkB,WAAW,iBAAiB,sBAAsB;CAC1E,MAAM,WAAW,WAAW,uBAAuB,aAAa,MAAM;CACtE,MAAM,4BAA4B,WAAW,uBAAuB,sBAAsB;CAE1F,OAAO,gBAAgB,CAAC,CACrB,WAAW,aAAa,CAAC,CACzB,qBAAqB;EACpB,cAAc,MAAM,UAAU;EAC9B,WAAW,gBAAgB,MAAM,UAAU;EAC3C,IAAI,YAAY,iBAAiB;GAC/B,cAAc,aAAa,QAAQ,QAAQ;GAC3C,cAAc,MAAM,QAAQ,GAAG,gBAAgB,MAAM;GACrD,cAAc,MAAM,SAAS,GAAG,gBAAgB,OAAO;EACzD;CACF,CAAC,CAAC,CACD,oBAAoB;EACnB,cAAc,MAAM,UAAU;EAC9B,WAAW,gBAAgB,MAAM,UAAU;CAC7C,CAAC,CAAC,CACD,OACC,aACA,eAAe,0BAA0B,KAAK,MAAM,0BAA0B,IAAI,SAClF,eAAe,gBAAgB,KAAK,MAAM,gBAAgB,IAAI,OAChE;AACJ;AAEA,MAAa,kCAAkC,YAA+B,UAAmC;CAC/G,OAAO,gBAAgB,CAAC,CACrB,WAAW,WAAW,eAAe,CAAC,CACtC,qBAAsB,WAAW,gBAAgB,MAAM,kBAAkB,cAAe,CAAC,CACzF,OACC,aACA,SAAS,MAAM,UAAU,QAAQ,MAAM,gBAAgB,MAAM,IAAI,MAAM,UAAU,SAAS,MAAM,gBAAgB,OAAO,IACvH,UACF,CAAC,CACA,OAAO,WAAW,OAAO,GAAG;AACjC;AAEA,MAAa,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{ Animation } from "@ionic/core";
|
|
2
1
|
import { ElementReferences, ElementSizes } from "@rdlabo/ionic-theme-utils";
|
|
2
|
+
import { Animation } from "@ionic/core/components";
|
|
3
3
|
//#region src/tab-bar-searchable/animations/leave.d.ts
|
|
4
4
|
export declare const createReverseEffectAnimation: (references: ElementReferences, searchableElementSizes: ElementSizes, colorSelected: string) => Animation;
|
|
5
5
|
export declare const createReverseSearchContainerAnimation: (references: ElementReferences, sizes: ElementSizes) => Animation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leave.d.ts","names":[],"sources":["../../../src/tab-bar-searchable/animations/leave.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"leave.d.ts","names":[],"sources":["../../../src/tab-bar-searchable/animations/leave.ts"],"mappings":";;;qBAKa,+BACX,YAAY,mBACZ,wBAAwB,cACxB,0BACC;qBA2BU,wCAAyC,YAAY,mBAAmB,OAAO,iBAAe;qBAY9F,qCAAsC,YAAY,sBAAoB;qBAStE,+BAAgC,WAAW,aAAa,YAAY,mBAAmB,OAAO,iBAAe;qBAoB7G,kCAAmC,cAAc,aAAa,YAAY,iBAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cloneElement } from "../../utils.js";
|
|
2
|
-
import { createAnimation } from "@ionic/core";
|
|
2
|
+
import { createAnimation } from "@ionic/core/components/index.js";
|
|
3
3
|
import { ANIMATION_DELAY_CLOSE_BUTTONS, OPACITY_TRANSITION } from "@rdlabo/ionic-theme-utils";
|
|
4
4
|
//#region src/tab-bar-searchable/animations/leave.ts
|
|
5
5
|
const createReverseEffectAnimation = (references, searchableElementSizes, colorSelected) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leave.js","names":[],"sources":["../../../src/tab-bar-searchable/animations/leave.ts"],"sourcesContent":["import { Animation
|
|
1
|
+
{"version":3,"file":"leave.js","names":[],"sources":["../../../src/tab-bar-searchable/animations/leave.ts"],"sourcesContent":["import type { Animation } from '@ionic/core/components';\nimport { createAnimation } from '@ionic/core/components/index.js';\nimport { ANIMATION_DELAY_CLOSE_BUTTONS, OPACITY_TRANSITION, type ElementReferences, type ElementSizes } from '@rdlabo/ionic-theme-utils';\nimport { cloneElement } from '../../utils';\n\nexport const createReverseEffectAnimation = (\n references: ElementReferences,\n searchableElementSizes: ElementSizes,\n colorSelected: string,\n): Animation => {\n const effectElement = cloneElement('ion-icon');\n const closeButtonRect = references.closeButtonIcon?.getBoundingClientRect();\n\n return createAnimation()\n .addElement(effectElement)\n .beforeAddWrite(() => {\n effectElement.style.display = 'inline-block';\n references.closeButtonIcon.style.opacity = '0';\n if (searchableElementSizes.selectedTabButtonIcon) {\n effectElement.style.width = `${searchableElementSizes.selectedTabButtonIcon.width}px`;\n effectElement.style.height = `${searchableElementSizes.selectedTabButtonIcon.height}px`;\n effectElement.style.color = colorSelected;\n }\n })\n .afterAddWrite(() => {\n effectElement.style.display = 'none';\n references.closeButtonIcon.style.opacity = '1';\n effectElement.style.color = '';\n })\n .fromTo(\n 'transform',\n `translate3d(${closeButtonRect.left}px, ${closeButtonRect.top}px, 0)`,\n `translate3d(${searchableElementSizes.selectedTabButtonIcon.left}px, ${searchableElementSizes.selectedTabButtonIcon.top}px, 0)`,\n );\n};\n\nexport const createReverseSearchContainerAnimation = (references: ElementReferences, sizes: ElementSizes): Animation => {\n return createAnimation()\n .addElement(references.searchContainer)\n .beforeAddWrite(() => (references.searchContainer.style.transformOrigin = 'right center'))\n .fromTo(\n 'transform',\n 'scale(1)',\n `scale(${sizes.fabButton.width / sizes.searchContainer.width}, ${sizes.fabButton.height / sizes.searchContainer.height})`,\n )\n .fromTo('opacity', '1', '0.2');\n};\n\nexport const createReverseCloseButtonsAnimation = (references: ElementReferences): Animation => {\n return createAnimation()\n .delay(ANIMATION_DELAY_CLOSE_BUTTONS)\n .addElement(references.closeButtons)\n .beforeAddWrite(() => (references.closeButtons.style.transformOrigin = 'left center'))\n .afterClearStyles(['transform', 'transform-origin'])\n .fromTo('transform', 'scale(1)', 'scale(1.5, 1)');\n};\n\nexport const createReverseTabBarAnimation = (ionTabBar: HTMLElement, references: ElementReferences, sizes: ElementSizes): Animation => {\n return createAnimation()\n .addElement(ionTabBar)\n .beforeAddWrite(() => {\n ionTabBar.style.transformOrigin = 'left center';\n ionTabBar.style.pointerEvents = 'auto';\n ionTabBar.querySelectorAll<HTMLElement>('ion-tab-button').forEach((element: HTMLElement) => {\n element.style.transition = OPACITY_TRANSITION;\n element.style.opacity = '1';\n });\n })\n .afterClearStyles(['transform', 'opacity', 'transform-origin'])\n .fromTo(\n 'transform',\n `scale(${sizes.closeButton.width / sizes.tabBar.width}, ${sizes.closeButton.height / sizes.tabBar.height})`,\n 'scale(1)',\n )\n .fromTo('opacity', '0', '1');\n};\n\nexport const createReverseFabButtonAnimation = (ionFabButton: HTMLElement, references: ElementSizes): Animation => {\n return createAnimation()\n .addElement(ionFabButton)\n .beforeAddWrite(() => {\n ionFabButton.querySelector<HTMLElement>('ion-icon')?.style.setProperty('opacity', '1');\n ionFabButton.style.transformOrigin = 'center right';\n })\n .afterAddWrite(() => {\n ionFabButton.style.pointerEvents = 'auto';\n })\n .fromTo('opacity', '0', '1')\n .fromTo('transform', `scale(${references.searchContainer.height / references.fabButton.height})`, 'scale(1)');\n};\n"],"mappings":";;;;AAKA,MAAa,gCACX,YACA,wBACA,kBACc;CACd,MAAM,gBAAgB,aAAa,UAAU;CAC7C,MAAM,kBAAkB,WAAW,iBAAiB,sBAAsB;CAE1E,OAAO,gBAAgB,CAAC,CACrB,WAAW,aAAa,CAAC,CACzB,qBAAqB;EACpB,cAAc,MAAM,UAAU;EAC9B,WAAW,gBAAgB,MAAM,UAAU;EAC3C,IAAI,uBAAuB,uBAAuB;GAChD,cAAc,MAAM,QAAQ,GAAG,uBAAuB,sBAAsB,MAAM;GAClF,cAAc,MAAM,SAAS,GAAG,uBAAuB,sBAAsB,OAAO;GACpF,cAAc,MAAM,QAAQ;EAC9B;CACF,CAAC,CA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SAAS,MAAM,OAAO,OAAO,IACzG,UACF,CAAC,CACA,OAAO,WAAW,KAAK,GAAG;AAC/B;AAEA,MAAa,mCAAmC,cAA2B,eAAwC;CACjH,OAAO,gBAAgB,CAAC,CACrB,WAAW,YAAY,CAAC,CACxB,qBAAqB;EACpB,aAAa,cAA2B,UAAU,CAAC,EAAE,MAAM,YAAY,WAAW,GAAG;EACrF,aAAa,MAAM,kBAAkB;CACvC,CAAC,CAAC,CACD,oBAAoB;EACnB,aAAa,MAAM,gBAAgB;CACrC,CAAC,CAAC,CACD,OAAO,WAAW,KAAK,GAAG,CAAC,CAC3B,OAAO,aAAa,SAAS,WAAW,gBAAgB,SAAS,WAAW,UAAU,OAAO,IAAI,UAAU;AAChH"}
|
|
@@ -2,7 +2,7 @@ import { isNativeUIShell, registerNativeSearch, requestNativeSearch, suspendNati
|
|
|
2
2
|
import { addSearchDismissButton } from "./dismiss-button.js";
|
|
3
3
|
import { createCloseButtonsAnimation, createEffectAnimation, createFabButtonAnimation, createSearchContainerAnimation, createTabBarAnimation } from "./animations/enter.js";
|
|
4
4
|
import { createReverseCloseButtonsAnimation, createReverseEffectAnimation, createReverseFabButtonAnimation, createReverseSearchContainerAnimation, createReverseTabBarAnimation } from "./animations/leave.js";
|
|
5
|
-
import { createAnimation } from "@ionic/core";
|
|
5
|
+
import { createAnimation } from "@ionic/core/components/index.js";
|
|
6
6
|
import { ANIMATION_DELAY_BASE, ANIMATION_DURATION, ANIMATION_EASING, TabBarSearchableType, TabBarSearchableType as TabBarSearchableType$1, getElementReferences, getElementSizes, throwErrorByFailedClickElement } from "@rdlabo/ionic-theme-utils";
|
|
7
7
|
//#region src/tab-bar-searchable/index.ts
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TabBarSearchableType"],"sources":["../../src/tab-bar-searchable/index.ts"],"sourcesContent":["import { createAnimation } from '@ionic/core';\nimport { addSearchDismissButton } from './dismiss-button';\nimport {\n ANIMATION_DELAY_BASE,\n ANIMATION_DURATION,\n ANIMATION_EASING,\n getElementReferences,\n getElementSizes,\n throwErrorByFailedClickElement,\n type SearchableEventCache,\n type TabBarSearchableFunction,\n TabBarSearchableType,\n} from '@rdlabo/ionic-theme-utils';\nimport { isNativeUIShell, registerNativeSearch, requestNativeSearch, suspendNativeUIShell } from '../native-integration';\nimport {\n createCloseButtonsAnimation,\n createEffectAnimation,\n createFabButtonAnimation,\n createSearchContainerAnimation,\n createTabBarAnimation,\n} from './animations/enter';\nimport {\n createReverseCloseButtonsAnimation,\n createReverseEffectAnimation,\n createReverseFabButtonAnimation,\n createReverseSearchContainerAnimation,\n createReverseTabBarAnimation,\n} from './animations/leave';\n\nexport {\n TabBarSearchableType,\n type TabBarSearchableFunction,\n type SearchableEventCache,\n type ElementSizes,\n type ElementReferences,\n} from '@rdlabo/ionic-theme-utils';\n\n/**\n * <ion-fab vertical=\"bottom\" horizontal=\"end\" slot=\"fixed\">\n * <ion-fab-button (click)=\"present($event)\">\n * <ion-icon name=\"search\"></ion-icon>\n * </ion-fab-button>\n * </ion-fab>\n * <ion-footer [translucent]=\"true\">\n * <ion-toolbar>\n * <ion-buttons slot=\"start\">\n * <!-- ion-icon does not need `name` attribute. -->\n * <ion-button fill=\"default\"><ion-icon slot=\"icon-only\"></ion-icon>\n * </ion-button>\n * </ion-buttons>\n * <!-- User set `ionChange` or other events. -->\n * <ion-searchbar aria-label=\"Search\" (ionChange)=\"example($event)\"></ion-searchbar>\n * </ion-toolbar>\n * </ion-footer>\n **/\n\nexport const attachTabBarSearchable = (\n ionTabBar: HTMLElement,\n ionFabButton: HTMLElement,\n ionFooter: HTMLElement,\n): TabBarSearchableFunction => {\n if (!ionTabBar || !ionFabButton || !ionFooter) {\n throw new Error('TabBarSearchable should be defined with props');\n }\n // Initialize\n ionFooter.classList.add('ios-theme-searchable');\n ionFabButton.closest('ion-fab')?.classList.add('ios-theme-searchable-trigger');\n addSearchDismissButton(ionFooter);\n ionFooter.style.pointerEvents = 'none';\n ionFooter.style.opacity = '0';\n // Search dismissal belongs beside the Web search field, never in the vertical rail.\n ionFooter.querySelector('ion-buttons[slot=start]')?.classList.add('ios-theme-horizontal-only');\n const nativeSearch = registerNativeSearch(ionTabBar, ionFabButton, ionFooter);\n\n // Saved Params\n let searchableEventCache: SearchableEventCache | undefined;\n let resumeNative: (() => void) | undefined;\n // Leave is valid both while native Enter awaits its ack and after it completes.\n let nativeEntry = false;\n let nativeRequest = 0;\n let verticalSearch = false;\n let tabVisibilityObserver: MutationObserver | undefined;\n\n return async (event: Event, type: TabBarSearchableType) => {\n const selector = type === TabBarSearchableType.Enter ? 'ion-fab-button' : 'ion-buttons[slot=start] ion-button';\n if (!(event.target as HTMLElement)?.closest(selector)) throw throwErrorByFailedClickElement(selector);\n if (type === TabBarSearchableType.Leave && !nativeEntry && !searchableEventCache)\n throw new Error('TabBarSearchableType.Leave should be run after TabBarSearchableType.Enter');\n const hadNativeEntry = nativeEntry;\n const request = ++nativeRequest;\n if (type === TabBarSearchableType.Enter) nativeEntry ||= isNativeUIShell(ionFooter);\n const accepted = await requestNativeSearch(nativeSearch, type === TabBarSearchableType.Enter);\n if (request !== nativeRequest) return;\n if (accepted) {\n nativeEntry = type === TabBarSearchableType.Enter;\n return;\n }\n nativeEntry = false;\n if (type === TabBarSearchableType.Leave && hadNativeEntry) {\n // Forced native retirement already restored the closed Web presentation.\n return;\n }\n if (type === TabBarSearchableType.Enter) {\n verticalSearch = !!ionTabBar.closest('ion-app.ios-theme-vertical-bars');\n if (verticalSearch) {\n // Ionic hides horizontal tabs when the keyboard opens; keep this rail available.\n const keepTabsVisible = () => {\n if (ionTabBar.classList.contains('tab-bar-hidden') && ionTabBar.closest('ion-app.ios-theme-vertical-bars')) {\n ionTabBar.classList.remove('tab-bar-hidden');\n }\n };\n tabVisibilityObserver?.disconnect();\n tabVisibilityObserver = new MutationObserver(keepTabsVisible);\n tabVisibilityObserver.observe(ionTabBar, { attributes: true, attributeFilter: ['class'] });\n keepTabsVisible();\n }\n resumeNative ??= await suspendNativeUIShell([\n ...(verticalSearch ? [] : [ionTabBar]),\n ionFooter,\n ionFabButton.closest('ion-fab') ?? ionFabButton,\n ]);\n try {\n searchableEventCache = await enterEvent(event, ionTabBar, ionFabButton, ionFooter, verticalSearch);\n } catch (error) {\n tabVisibilityObserver?.disconnect();\n resumeNative();\n resumeNative = undefined;\n throw error;\n }\n } else if (searchableEventCache !== undefined) {\n try {\n await leaveEvent(event, searchableEventCache, ionTabBar, ionFabButton, ionFooter, verticalSearch);\n searchableEventCache = undefined;\n } finally {\n tabVisibilityObserver?.disconnect();\n resumeNative?.();\n resumeNative = undefined;\n }\n } else {\n throw new Error('TabBarSearchableType.Leave should be run after TabBarSearchableType.Enter');\n }\n };\n};\n\nconst enterEvent = async (\n event: Event,\n ionTabBar: HTMLElement,\n ionFabButton: HTMLElement,\n ionFooter: HTMLElement,\n verticalSearch: boolean,\n): Promise<SearchableEventCache> => {\n if (!(event.target as HTMLElement)?.closest('ion-fab-button')) {\n throw throwErrorByFailedClickElement('ion-fab-button');\n }\n\n const references = getElementReferences(ionTabBar, ionFooter);\n const sizes = getElementSizes(ionTabBar, ionFabButton, references);\n const colorSelected = references.selectedTabButton\n ? getComputedStyle(references.selectedTabButton).getPropertyValue('--color-selected').trim()\n : '';\n\n if (verticalSearch) references.closeButtonIcon.setAttribute('name', 'close');\n const tabAnimations = verticalSearch\n ? []\n : [createTabBarAnimation(ionTabBar, references, sizes), createEffectAnimation(references, sizes)];\n const searchContainerAnimation = createSearchContainerAnimation(references, sizes);\n const closeButtonsAnimation = createCloseButtonsAnimation(references);\n const fabButtonAnimation = createFabButtonAnimation(ionFabButton);\n\n await createAnimation()\n .delay(ANIMATION_DELAY_BASE)\n .duration(ANIMATION_DURATION)\n .easing(ANIMATION_EASING)\n .addElement(ionFooter)\n .afterAddWrite(() => (ionFooter.style.pointerEvents = 'auto'))\n .fromTo('opacity', '0.8', '1')\n .addAnimation([...tabAnimations, fabButtonAnimation, searchContainerAnimation, closeButtonsAnimation])\n .play();\n\n return {\n elementSizes: sizes,\n colorSelected,\n };\n};\n\nconst leaveEvent = async (\n event: Event,\n searchableEventCache: SearchableEventCache,\n ionTabBar: HTMLElement,\n ionFabButton: HTMLElement,\n ionFooter: HTMLElement,\n verticalSearch: boolean,\n): Promise<void> => {\n if (!(event.target as HTMLElement)?.closest('ion-buttons[slot=start] ion-button')) {\n throw throwErrorByFailedClickElement('ion-buttons[slot=start] ion-button');\n }\n\n const focused = ionFooter.ownerDocument.activeElement;\n if (focused instanceof HTMLElement && ionFooter.contains(focused)) focused.blur();\n const references = getElementReferences(ionTabBar, ionFooter);\n\n const tabAnimations = verticalSearch\n ? []\n : [\n createReverseTabBarAnimation(ionTabBar, references, searchableEventCache.elementSizes),\n createReverseEffectAnimation(references, searchableEventCache.elementSizes, searchableEventCache.colorSelected),\n ];\n const searchContainerAnimation = createReverseSearchContainerAnimation(references, searchableEventCache.elementSizes);\n const closeButtonsAnimation = createReverseCloseButtonsAnimation(references);\n const fabButtonAnimation = createReverseFabButtonAnimation(ionFabButton, searchableEventCache.elementSizes);\n\n await createAnimation()\n .delay(ANIMATION_DELAY_BASE)\n .duration(ANIMATION_DURATION)\n .easing(ANIMATION_EASING)\n .addElement(ionFooter)\n .afterAddWrite(() => (ionFooter.style.pointerEvents = 'none'))\n .fromTo('opacity', '1', '0')\n .addAnimation([...tabAnimations, fabButtonAnimation, searchContainerAnimation, closeButtonsAnimation])\n .play();\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAa,0BACX,WACA,cACA,cAC6B;CAC7B,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,WAClC,MAAM,IAAI,MAAM,+CAA+C;CAGjE,UAAU,UAAU,IAAI,sBAAsB;CAC9C,aAAa,QAAQ,SAAS,CAAC,EAAE,UAAU,IAAI,8BAA8B;CAC7E,uBAAuB,SAAS;CAChC,UAAU,MAAM,gBAAgB;CAChC,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AC7B,aAAa;EAAC,GAAG;EAAe;EAAoB;EAA0B;CAAqB,CAAC,CAAC,CACrG,KAAK;CAER,OAAO;EACL,cAAc;EACd;CACF;AACF;AAEA,MAAM,aAAa,OACjB,OACA,sBACA,WACA,cACA,WACA,mBACkB;CAClB,IAAI,CAAE,MAAM,QAAwB,QAAQ,oCAAoC,GAC9E,MAAM,+BAA+B,oCAAoC;CAG3E,MAAM,UAAU,UAAU,cAAc;CACxC,IAAI,mBAAmB,eAAe,UAAU,SAAS,OAAO,GAAG,QAAQ,KAAK;CAChF,MAAM,aAAa,qBAAqB,WAAW,SAAS;CAE5D,MAAM,gBAAgB,iBAClB,CAAC,IACD,CACE,6BAA6B,WAAW,YAAY,qBAAqB,YAAY,GACrF,6BAA6B,YAAY,qBAAqB,cAAc,qBAAqB,aAAa,CAChH;CACJ,MAAM,2BAA2B,sCAAsC,YAAY,qBAAqB,YAAY;CACpH,MAAM,wBAAwB,mCAAmC,UAAU;CAC3E,MAAM,qBAAqB,gCAAgC,cAAc,qBAAqB,YAAY;CAE1G,MAAM,gBAAgB,CAAC,CACpB,MAAM,oBAAoB,CAAC,CAC3B,SAAS,kBAAkB,CAAC,CAC5B,OAAO,gBAAgB,CAAC,CACxB,WAAW,SAAS,CAAC,CACrB,oBAAqB,UAAU,MAAM,gBAAgB,MAAO,CAAC,CAC7D,OAAO,WAAW,KAAK,GAAG,CAAC,CAC3B,aAAa;EAAC,GAAG;EAAe;EAAoB;EAA0B;CAAqB,CAAC,CAAC,CACrG,KAAK;AACV"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["TabBarSearchableType"],"sources":["../../src/tab-bar-searchable/index.ts"],"sourcesContent":["import { createAnimation } from '@ionic/core/components/index.js';\nimport { addSearchDismissButton } from './dismiss-button';\nimport {\n ANIMATION_DELAY_BASE,\n ANIMATION_DURATION,\n ANIMATION_EASING,\n getElementReferences,\n getElementSizes,\n throwErrorByFailedClickElement,\n type SearchableEventCache,\n type TabBarSearchableFunction,\n TabBarSearchableType,\n} from '@rdlabo/ionic-theme-utils';\nimport { isNativeUIShell, registerNativeSearch, requestNativeSearch, suspendNativeUIShell } from '../native-integration';\nimport {\n createCloseButtonsAnimation,\n createEffectAnimation,\n createFabButtonAnimation,\n createSearchContainerAnimation,\n createTabBarAnimation,\n} from './animations/enter';\nimport {\n createReverseCloseButtonsAnimation,\n createReverseEffectAnimation,\n createReverseFabButtonAnimation,\n createReverseSearchContainerAnimation,\n createReverseTabBarAnimation,\n} from './animations/leave';\n\nexport {\n TabBarSearchableType,\n type TabBarSearchableFunction,\n type SearchableEventCache,\n type ElementSizes,\n type ElementReferences,\n} from '@rdlabo/ionic-theme-utils';\n\n/**\n * <ion-fab vertical=\"bottom\" horizontal=\"end\" slot=\"fixed\">\n * <ion-fab-button (click)=\"present($event)\">\n * <ion-icon name=\"search\"></ion-icon>\n * </ion-fab-button>\n * </ion-fab>\n * <ion-footer [translucent]=\"true\">\n * <ion-toolbar>\n * <ion-buttons slot=\"start\">\n * <!-- ion-icon does not need `name` attribute. -->\n * <ion-button fill=\"default\"><ion-icon slot=\"icon-only\"></ion-icon>\n * </ion-button>\n * </ion-buttons>\n * <!-- User set `ionChange` or other events. -->\n * <ion-searchbar aria-label=\"Search\" (ionChange)=\"example($event)\"></ion-searchbar>\n * </ion-toolbar>\n * </ion-footer>\n **/\n\nexport const attachTabBarSearchable = (\n ionTabBar: HTMLElement,\n ionFabButton: HTMLElement,\n ionFooter: HTMLElement,\n): TabBarSearchableFunction => {\n if (!ionTabBar || !ionFabButton || !ionFooter) {\n throw new Error('TabBarSearchable should be defined with props');\n }\n // Initialize\n ionFooter.classList.add('ios-theme-searchable');\n ionFabButton.closest('ion-fab')?.classList.add('ios-theme-searchable-trigger');\n addSearchDismissButton(ionFooter);\n ionFooter.style.pointerEvents = 'none';\n ionFooter.style.opacity = '0';\n // Search dismissal belongs beside the Web search field, never in the vertical rail.\n ionFooter.querySelector('ion-buttons[slot=start]')?.classList.add('ios-theme-horizontal-only');\n const nativeSearch = registerNativeSearch(ionTabBar, ionFabButton, ionFooter);\n\n // Saved Params\n let searchableEventCache: SearchableEventCache | undefined;\n let resumeNative: (() => void) | undefined;\n // Leave is valid both while native Enter awaits its ack and after it completes.\n let nativeEntry = false;\n let nativeRequest = 0;\n let verticalSearch = false;\n let tabVisibilityObserver: MutationObserver | undefined;\n\n return async (event: Event, type: TabBarSearchableType) => {\n const selector = type === TabBarSearchableType.Enter ? 'ion-fab-button' : 'ion-buttons[slot=start] ion-button';\n if (!(event.target as HTMLElement)?.closest(selector)) throw throwErrorByFailedClickElement(selector);\n if (type === TabBarSearchableType.Leave && !nativeEntry && !searchableEventCache)\n throw new Error('TabBarSearchableType.Leave should be run after TabBarSearchableType.Enter');\n const hadNativeEntry = nativeEntry;\n const request = ++nativeRequest;\n if (type === TabBarSearchableType.Enter) nativeEntry ||= isNativeUIShell(ionFooter);\n const accepted = await requestNativeSearch(nativeSearch, type === TabBarSearchableType.Enter);\n if (request !== nativeRequest) return;\n if (accepted) {\n nativeEntry = type === TabBarSearchableType.Enter;\n return;\n }\n nativeEntry = false;\n if (type === TabBarSearchableType.Leave && hadNativeEntry) {\n // Forced native retirement already restored the closed Web presentation.\n return;\n }\n if (type === TabBarSearchableType.Enter) {\n verticalSearch = !!ionTabBar.closest('ion-app.ios-theme-vertical-bars');\n if (verticalSearch) {\n // Ionic hides horizontal tabs when the keyboard opens; keep this rail available.\n const keepTabsVisible = () => {\n if (ionTabBar.classList.contains('tab-bar-hidden') && ionTabBar.closest('ion-app.ios-theme-vertical-bars')) {\n ionTabBar.classList.remove('tab-bar-hidden');\n }\n };\n tabVisibilityObserver?.disconnect();\n tabVisibilityObserver = new MutationObserver(keepTabsVisible);\n tabVisibilityObserver.observe(ionTabBar, { attributes: true, attributeFilter: ['class'] });\n keepTabsVisible();\n }\n resumeNative ??= await suspendNativeUIShell([\n ...(verticalSearch ? [] : [ionTabBar]),\n ionFooter,\n ionFabButton.closest('ion-fab') ?? ionFabButton,\n ]);\n try {\n searchableEventCache = await enterEvent(event, ionTabBar, ionFabButton, ionFooter, verticalSearch);\n } catch (error) {\n tabVisibilityObserver?.disconnect();\n resumeNative();\n resumeNative = undefined;\n throw error;\n }\n } else if (searchableEventCache !== undefined) {\n try {\n await leaveEvent(event, searchableEventCache, ionTabBar, ionFabButton, ionFooter, verticalSearch);\n searchableEventCache = undefined;\n } finally {\n tabVisibilityObserver?.disconnect();\n resumeNative?.();\n resumeNative = undefined;\n }\n } else {\n throw new Error('TabBarSearchableType.Leave should be run after TabBarSearchableType.Enter');\n }\n };\n};\n\nconst enterEvent = async (\n event: Event,\n ionTabBar: HTMLElement,\n ionFabButton: HTMLElement,\n ionFooter: HTMLElement,\n verticalSearch: boolean,\n): Promise<SearchableEventCache> => {\n if (!(event.target as HTMLElement)?.closest('ion-fab-button')) {\n throw throwErrorByFailedClickElement('ion-fab-button');\n }\n\n const references = getElementReferences(ionTabBar, ionFooter);\n const sizes = getElementSizes(ionTabBar, ionFabButton, references);\n const colorSelected = references.selectedTabButton\n ? getComputedStyle(references.selectedTabButton).getPropertyValue('--color-selected').trim()\n : '';\n\n if (verticalSearch) references.closeButtonIcon.setAttribute('name', 'close');\n const tabAnimations = verticalSearch\n ? []\n : [createTabBarAnimation(ionTabBar, references, sizes), createEffectAnimation(references, sizes)];\n const searchContainerAnimation = createSearchContainerAnimation(references, sizes);\n const closeButtonsAnimation = createCloseButtonsAnimation(references);\n const fabButtonAnimation = createFabButtonAnimation(ionFabButton);\n\n await createAnimation()\n .delay(ANIMATION_DELAY_BASE)\n .duration(ANIMATION_DURATION)\n .easing(ANIMATION_EASING)\n .addElement(ionFooter)\n .afterAddWrite(() => (ionFooter.style.pointerEvents = 'auto'))\n .fromTo('opacity', '0.8', '1')\n .addAnimation([...tabAnimations, fabButtonAnimation, searchContainerAnimation, closeButtonsAnimation])\n .play();\n\n return {\n elementSizes: sizes,\n colorSelected,\n };\n};\n\nconst leaveEvent = async (\n event: Event,\n searchableEventCache: SearchableEventCache,\n ionTabBar: HTMLElement,\n ionFabButton: HTMLElement,\n ionFooter: HTMLElement,\n verticalSearch: boolean,\n): Promise<void> => {\n if (!(event.target as HTMLElement)?.closest('ion-buttons[slot=start] ion-button')) {\n throw throwErrorByFailedClickElement('ion-buttons[slot=start] ion-button');\n }\n\n const focused = ionFooter.ownerDocument.activeElement;\n if (focused instanceof HTMLElement && ionFooter.contains(focused)) focused.blur();\n const references = getElementReferences(ionTabBar, ionFooter);\n\n const tabAnimations = verticalSearch\n ? []\n : [\n createReverseTabBarAnimation(ionTabBar, references, searchableEventCache.elementSizes),\n createReverseEffectAnimation(references, searchableEventCache.elementSizes, searchableEventCache.colorSelected),\n ];\n const searchContainerAnimation = createReverseSearchContainerAnimation(references, searchableEventCache.elementSizes);\n const closeButtonsAnimation = createReverseCloseButtonsAnimation(references);\n const fabButtonAnimation = createReverseFabButtonAnimation(ionFabButton, searchableEventCache.elementSizes);\n\n await createAnimation()\n .delay(ANIMATION_DELAY_BASE)\n .duration(ANIMATION_DURATION)\n .easing(ANIMATION_EASING)\n .addElement(ionFooter)\n .afterAddWrite(() => (ionFooter.style.pointerEvents = 'none'))\n .fromTo('opacity', '1', '0')\n .addAnimation([...tabAnimations, fabButtonAnimation, searchContainerAnimation, closeButtonsAnimation])\n .play();\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAa,0BACX,WACA,cACA,cAC6B;CAC7B,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,WAClC,MAAM,IAAI,MAAM,+CAA+C;CAGjE,UAAU,UAAU,IAAI,sBAAsB;CAC9C,aAAa,QAAQ,SAAS,CAAC,EAAE,UAAU,IAAI,8BAA8B;CAC7E,uBAAuB,SAAS;CAChC,UAAU,MAAM,gBAAgB;CAChC,UAAU,MAAM,UAAU;CAE1B,UAAU,cAAc,yBAAyB,CAAC,EAAE,UAAU,IAAI,2BAA2B;CAC7F,MAAM,eAAe,qBAAqB,WAAW,cAAc,SAAS;CA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Aa,OACjB,OACA,sBACA,WACA,cACA,WACA,mBACkB;CAClB,IAAI,CAAE,MAAM,QAAwB,QAAQ,oCAAoC,GAC9E,MAAM,+BAA+B,oCAAoC;CAG3E,MAAM,UAAU,UAAU,cAAc;CACxC,IAAI,mBAAmB,eAAe,UAAU,SAAS,OAAO,GAAG,QAAQ,KAAK;CAChF,MAAM,aAAa,qBAAqB,WAAW,SAAS;CAE5D,MAAM,gBAAgB,iBAClB,CAAC,IACD,CACE,6BAA6B,WAAW,YAAY,qBAAqB,YAAY,GACrF,6BAA6B,YAAY,qBAAqB,cAAc,qBAAqB,aAAa,CAChH;CACJ,MAAM,2BAA2B,sCAAsC,YAAY,qBAAqB,YAAY;CACpH,MAAM,wBAAwB,mCAAmC,UAAU;CAC3E,MAAM,qBAAqB,gCAAgC,cAAc,qBAAqB,YAAY;CAE1G,MAAM,gBAAgB,CAAC,CACpB,MAAM,oBAAoB,CAAC,CAC3B,SAAS,kBAAkB,CAAC,CAC5B,OAAO,gBAAgB,CAAC,CACxB,WAAW,SAAS,CAAC,CACrB,oBAAqB,UAAU,MAAM,gBAAgB,MAAO,CAAC,CAC7D,OAAO,WAAW,KAAK,GAAG,CAAC,CAC3B,aAAa;EAAC,GAAG;EAAe;EAAoB;EAA0B;CAAqB,CAAC,CAAC,CACrG,KAAK;AACV"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Animation, NavOptions } from "@ionic/core";
|
|
1
|
+
import { Animation, NavOptions } from "@ionic/core/components";
|
|
2
2
|
//#region src/transition/index.d.ts
|
|
3
3
|
export declare const transition: (opts: TransitionOptions) => Promise<TransitionResult>;
|
|
4
4
|
export declare const lifecycle: (el: HTMLElement | undefined, eventName: string) => void;
|
package/dist/transition/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { config, raf } from "../utils.js";
|
|
2
2
|
import { createFocusController } from "../focus-controller/index.js";
|
|
3
|
-
import { LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE } from "@ionic/core";
|
|
3
|
+
import { LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE } from "@ionic/core/components/index.js";
|
|
4
4
|
import { Build, writeTask } from "@stencil/core";
|
|
5
5
|
//#region src/transition/index.ts
|
|
6
6
|
const iosTransitionAnimation = () => import("./ios.transition.js");
|