voyager-ionic-core 7.5.0 → 7.5.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/components/ion-title.js +1 -1
- package/components/ios.transition.js +209 -41
- package/dist/cjs/{index-d93fb71d.js → index-eccba000.js} +2 -2
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/ion-app_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/{ios.transition-a4d545dd.js → ios.transition-5af5991e.js} +210 -42
- package/dist/cjs/{md.transition-80bb961b.js → md.transition-1e740a6a.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/title/title.ios.css +9 -0
- package/dist/collection/utils/transition/ios.transition.js +209 -41
- package/dist/docs.json +2 -2
- package/dist/esm/{index-7d2b2808.js → index-a09eac70.js} +2 -2
- package/dist/esm/index.js +3 -3
- package/dist/esm/ion-app_8.entry.js +2 -2
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-nav_2.entry.js +1 -1
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/{ios.transition-a86d7bbe.js → ios.transition-4d1322d6.js} +210 -42
- package/dist/esm/{md.transition-365ef6b6.js → md.transition-66b425d0.js} +1 -1
- package/dist/esm-es5/index-a09eac70.js +4 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-nav_2.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ios.transition-4d1322d6.js +4 -0
- package/dist/esm-es5/md.transition-66b425d0.js +4 -0
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/ionic.js +1 -1
- package/dist/ionic/p-091c8792.system.js +4 -0
- package/dist/ionic/p-2a8eeef7.system.js +4 -0
- package/dist/ionic/p-61b192a4.system.entry.js +4 -0
- package/dist/ionic/{p-15decbec.entry.js → p-7423746f.entry.js} +1 -1
- package/dist/ionic/{p-5c3e72a8.system.js → p-755b2917.system.js} +1 -1
- package/dist/ionic/{p-e42aaa8b.entry.js → p-8209372c.entry.js} +1 -1
- package/dist/ionic/{p-a7f8dc42.entry.js → p-9e106f58.entry.js} +1 -1
- package/dist/ionic/p-bb055450.system.entry.js +4 -0
- package/dist/ionic/{p-e38a5f77.js → p-c44fe9fd.js} +1 -1
- package/dist/ionic/p-c575a7b8.system.entry.js +4 -0
- package/dist/ionic/p-de68588d.js +4 -0
- package/dist/ionic/p-e028178a.system.js +4 -0
- package/dist/ionic/{p-ced41304.system.js → p-e0f0d55f.system.js} +1 -1
- package/dist/ionic/{p-f34f001c.entry.js → p-e25cb483.entry.js} +1 -1
- package/dist/ionic/p-eb7d0922.js +4 -0
- package/dist/ionic/p-eb8dc56f.system.entry.js +4 -0
- package/dist/types/components/menu/menu-interface.d.ts +15 -4
- package/dist/types/stencil-public-runtime.d.ts +19 -0
- package/dist/types/utils/menu-controller/index.d.ts +2 -21
- package/hydrate/index.js +220 -44
- package/package.json +5 -5
- package/dist/esm-es5/index-7d2b2808.js +0 -4
- package/dist/esm-es5/ios.transition-a86d7bbe.js +0 -4
- package/dist/esm-es5/md.transition-365ef6b6.js +0 -4
- package/dist/ionic/p-128a98e8.system.js +0 -4
- package/dist/ionic/p-16e44585.js +0 -4
- package/dist/ionic/p-2bbf3ac4.system.entry.js +0 -4
- package/dist/ionic/p-95817276.system.entry.js +0 -4
- package/dist/ionic/p-9b9dcc3e.system.entry.js +0 -4
- package/dist/ionic/p-b9047b05.system.js +0 -4
- package/dist/ionic/p-c05315f5.system.entry.js +0 -4
- package/dist/ionic/p-c994fff0.system.js +0 -4
- package/dist/ionic/p-e2bb634f.js +0 -4
|
@@ -54,60 +54,134 @@ const createLargeTitleTransition = (rootAnimation, rtl, backDirection, enteringE
|
|
|
54
54
|
if (shouldAnimationForward) {
|
|
55
55
|
const leavingLargeTitleBox = leavingLargeTitle.getBoundingClientRect();
|
|
56
56
|
const enteringBackButtonBox = enteringBackButton.getBoundingClientRect();
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const enteringBackButtonTextEl = shadow(enteringBackButton).querySelector('.button-text');
|
|
58
|
+
const enteringBackButtonTextBox = enteringBackButtonTextEl.getBoundingClientRect();
|
|
59
|
+
const leavingLargeTitleTextEl = shadow(leavingLargeTitle).querySelector('.toolbar-title');
|
|
60
|
+
const leavingLargeTitleTextBox = leavingLargeTitleTextEl.getBoundingClientRect();
|
|
61
|
+
animateLargeTitle(rootAnimation, rtl, backDirection, leavingLargeTitle, leavingLargeTitleBox, leavingLargeTitleTextBox, enteringBackButtonTextEl, enteringBackButtonTextBox);
|
|
62
|
+
animateBackButton(rootAnimation, rtl, backDirection, enteringBackButton, enteringBackButtonBox, enteringBackButtonTextEl, enteringBackButtonTextBox, leavingLargeTitle, leavingLargeTitleTextBox);
|
|
59
63
|
}
|
|
60
64
|
else if (shouldAnimationBackward) {
|
|
61
65
|
const enteringLargeTitleBox = enteringLargeTitle.getBoundingClientRect();
|
|
62
66
|
const leavingBackButtonBox = leavingBackButton.getBoundingClientRect();
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
const leavingBackButtonTextEl = shadow(leavingBackButton).querySelector('.button-text');
|
|
68
|
+
const leavingBackButtonTextBox = leavingBackButtonTextEl.getBoundingClientRect();
|
|
69
|
+
const enteringLargeTitleTextEl = shadow(enteringLargeTitle).querySelector('.toolbar-title');
|
|
70
|
+
const enteringLargeTitleTextBox = enteringLargeTitleTextEl.getBoundingClientRect();
|
|
71
|
+
animateLargeTitle(rootAnimation, rtl, backDirection, enteringLargeTitle, enteringLargeTitleBox, enteringLargeTitleTextBox, leavingBackButtonTextEl, leavingBackButtonTextBox);
|
|
72
|
+
animateBackButton(rootAnimation, rtl, backDirection, leavingBackButton, leavingBackButtonBox, leavingBackButtonTextEl, leavingBackButtonTextBox, enteringLargeTitle, enteringLargeTitleTextBox);
|
|
65
73
|
}
|
|
66
74
|
return {
|
|
67
75
|
forward: shouldAnimationForward,
|
|
68
76
|
backward: shouldAnimationBackward,
|
|
69
77
|
};
|
|
70
78
|
};
|
|
71
|
-
const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl,
|
|
79
|
+
const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, backButtonBox, backButtonTextEl, backButtonTextBox, largeTitleEl, largeTitleTextBox) => {
|
|
80
|
+
var _a, _b;
|
|
72
81
|
const BACK_BUTTON_START_OFFSET = rtl ? `calc(100% - ${backButtonBox.right + 4}px)` : `${backButtonBox.left - 4}px`;
|
|
73
|
-
const START_TEXT_TRANSLATE = rtl ? '7px' : '-7px';
|
|
74
|
-
const END_TEXT_TRANSLATE = rtl ? '-4px' : '4px';
|
|
75
|
-
const ICON_TRANSLATE = rtl ? '-4px' : '4px';
|
|
76
82
|
const TEXT_ORIGIN_X = rtl ? 'right' : 'left';
|
|
77
83
|
const ICON_ORIGIN_X = rtl ? 'left' : 'right';
|
|
84
|
+
const CONTAINER_ORIGIN_X = rtl ? 'right' : 'left';
|
|
85
|
+
/**
|
|
86
|
+
* When the title and back button texts match
|
|
87
|
+
* then they should overlap during the page transition.
|
|
88
|
+
* If the texts do not match up then the back button text scale adjusts
|
|
89
|
+
* to not perfectly match the large title text otherwise the
|
|
90
|
+
* proportions will be incorrect.
|
|
91
|
+
* When the texts match we scale both the width and height to account for
|
|
92
|
+
* font weight differences between the title and back button.
|
|
93
|
+
*/
|
|
94
|
+
const doTitleAndButtonTextsMatch = ((_a = backButtonTextEl.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === ((_b = largeTitleEl.textContent) === null || _b === void 0 ? void 0 : _b.trim());
|
|
95
|
+
const WIDTH_SCALE = largeTitleTextBox.width / backButtonTextBox.width;
|
|
96
|
+
/**
|
|
97
|
+
* We subtract an offset to account for slight sizing/padding
|
|
98
|
+
* differences between the title and the back button.
|
|
99
|
+
*/
|
|
100
|
+
const HEIGHT_SCALE = (largeTitleTextBox.height - LARGE_TITLE_SIZE_OFFSET) / backButtonTextBox.height;
|
|
101
|
+
const TEXT_START_SCALE = doTitleAndButtonTextsMatch
|
|
102
|
+
? `scale(${WIDTH_SCALE}, ${HEIGHT_SCALE})`
|
|
103
|
+
: `scale(${HEIGHT_SCALE})`;
|
|
104
|
+
const TEXT_END_SCALE = 'scale(1)';
|
|
105
|
+
const backButtonIconEl = shadow(backButtonEl).querySelector('ion-icon');
|
|
106
|
+
const backButtonIconBox = backButtonIconEl.getBoundingClientRect();
|
|
107
|
+
/**
|
|
108
|
+
* We need to offset the container by the icon dimensions
|
|
109
|
+
* so that the back button text aligns with the large title
|
|
110
|
+
* text. Otherwise, the back button icon will align with the
|
|
111
|
+
* large title text but the back button text will not.
|
|
112
|
+
*/
|
|
113
|
+
const CONTAINER_START_TRANSLATE_X = rtl
|
|
114
|
+
? `${backButtonIconBox.width / 2 - (backButtonIconBox.right - backButtonBox.right)}px`
|
|
115
|
+
: `${backButtonBox.left - backButtonIconBox.width / 2}px`;
|
|
116
|
+
const CONTAINER_END_TRANSLATE_X = rtl ? `-${window.innerWidth - backButtonBox.right}px` : `${backButtonBox.left}px`;
|
|
117
|
+
/**
|
|
118
|
+
* Back button container should be
|
|
119
|
+
* aligned to the top of the title container
|
|
120
|
+
* so the texts overlap as the back button
|
|
121
|
+
* text begins to fade in.
|
|
122
|
+
*/
|
|
123
|
+
const CONTAINER_START_TRANSLATE_Y = `${largeTitleTextBox.top}px`;
|
|
124
|
+
/**
|
|
125
|
+
* The cloned back button should align exactly with the
|
|
126
|
+
* real back button on the entering page otherwise there will
|
|
127
|
+
* be a layout shift.
|
|
128
|
+
*/
|
|
129
|
+
const CONTAINER_END_TRANSLATE_Y = `${backButtonBox.top}px`;
|
|
130
|
+
/**
|
|
131
|
+
* In the forward direction, the cloned back button
|
|
132
|
+
* container should translate from over the large title
|
|
133
|
+
* to over the back button. In the backward direction,
|
|
134
|
+
* it should translate from over the back button to over
|
|
135
|
+
* the large title.
|
|
136
|
+
*/
|
|
137
|
+
const FORWARD_CONTAINER_KEYFRAMES = [
|
|
138
|
+
{ offset: 0, transform: `translate3d(${CONTAINER_START_TRANSLATE_X}, ${CONTAINER_START_TRANSLATE_Y}, 0)` },
|
|
139
|
+
{ offset: 1, transform: `translate3d(${CONTAINER_END_TRANSLATE_X}, ${CONTAINER_END_TRANSLATE_Y}, 0)` },
|
|
140
|
+
];
|
|
141
|
+
const BACKWARD_CONTAINER_KEYFRAMES = [
|
|
142
|
+
{ offset: 0, transform: `translate3d(${CONTAINER_END_TRANSLATE_X}, ${CONTAINER_END_TRANSLATE_Y}, 0)` },
|
|
143
|
+
{ offset: 1, transform: `translate3d(${CONTAINER_START_TRANSLATE_X}, ${CONTAINER_START_TRANSLATE_Y}, 0)` },
|
|
144
|
+
];
|
|
145
|
+
const CONTAINER_KEYFRAMES = backDirection ? BACKWARD_CONTAINER_KEYFRAMES : FORWARD_CONTAINER_KEYFRAMES;
|
|
146
|
+
/**
|
|
147
|
+
* In the forward direction, the text in the cloned back button
|
|
148
|
+
* should start to be (roughly) the size of the large title
|
|
149
|
+
* and then scale down to be the size of the actual back button.
|
|
150
|
+
* The text should also translate, but that translate is handled
|
|
151
|
+
* by the container keyframes.
|
|
152
|
+
*/
|
|
78
153
|
const FORWARD_TEXT_KEYFRAMES = [
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
opacity: 0,
|
|
82
|
-
transform: `translate3d(${START_TEXT_TRANSLATE}, ${largeTitleBox.top - 40}px, 0) scale(2.1)`,
|
|
83
|
-
},
|
|
84
|
-
{ offset: 1, opacity: 1, transform: `translate3d(${END_TEXT_TRANSLATE}, ${backButtonBox.top - 46}px, 0) scale(1)` },
|
|
154
|
+
{ offset: 0, opacity: 0, transform: TEXT_START_SCALE },
|
|
155
|
+
{ offset: 1, opacity: 1, transform: TEXT_END_SCALE },
|
|
85
156
|
];
|
|
86
157
|
const BACKWARD_TEXT_KEYFRAMES = [
|
|
87
|
-
{ offset: 0, opacity: 1, transform:
|
|
88
|
-
{ offset:
|
|
89
|
-
{
|
|
90
|
-
offset: 1,
|
|
91
|
-
opacity: 0,
|
|
92
|
-
transform: `translate3d(${START_TEXT_TRANSLATE}, ${largeTitleBox.top - 40}px, 0) scale(2.1)`,
|
|
93
|
-
},
|
|
158
|
+
{ offset: 0, opacity: 1, transform: TEXT_END_SCALE },
|
|
159
|
+
{ offset: 1, opacity: 0, transform: TEXT_START_SCALE },
|
|
94
160
|
];
|
|
95
161
|
const TEXT_KEYFRAMES = backDirection ? BACKWARD_TEXT_KEYFRAMES : FORWARD_TEXT_KEYFRAMES;
|
|
162
|
+
/**
|
|
163
|
+
* The icon should scale in/out in the second
|
|
164
|
+
* half of the animation. The icon should also
|
|
165
|
+
* translate, but that translate is handled by the
|
|
166
|
+
* container keyframes.
|
|
167
|
+
*/
|
|
96
168
|
const FORWARD_ICON_KEYFRAMES = [
|
|
97
|
-
{ offset: 0, opacity: 0, transform:
|
|
98
|
-
{ offset:
|
|
169
|
+
{ offset: 0, opacity: 0, transform: 'scale(0.6)' },
|
|
170
|
+
{ offset: 0.6, opacity: 0, transform: 'scale(0.6)' },
|
|
171
|
+
{ offset: 1, opacity: 1, transform: 'scale(1)' },
|
|
99
172
|
];
|
|
100
173
|
const BACKWARD_ICON_KEYFRAMES = [
|
|
101
|
-
{ offset: 0, opacity: 1, transform:
|
|
102
|
-
{ offset: 0.2, opacity: 0, transform:
|
|
103
|
-
{ offset: 1, opacity: 0, transform:
|
|
174
|
+
{ offset: 0, opacity: 1, transform: 'scale(1)' },
|
|
175
|
+
{ offset: 0.2, opacity: 0, transform: 'scale(0.6)' },
|
|
176
|
+
{ offset: 1, opacity: 0, transform: 'scale(0.6)' },
|
|
104
177
|
];
|
|
105
178
|
const ICON_KEYFRAMES = backDirection ? BACKWARD_ICON_KEYFRAMES : FORWARD_ICON_KEYFRAMES;
|
|
106
179
|
const enteringBackButtonTextAnimation = createAnimation();
|
|
107
180
|
const enteringBackButtonIconAnimation = createAnimation();
|
|
181
|
+
const enteringBackButtonAnimation = createAnimation();
|
|
108
182
|
const clonedBackButtonEl = getClonedElement('ion-back-button');
|
|
109
|
-
const
|
|
110
|
-
const
|
|
183
|
+
const clonedBackButtonTextEl = shadow(clonedBackButtonEl).querySelector('.button-text');
|
|
184
|
+
const clonedBackButtonIconEl = shadow(clonedBackButtonEl).querySelector('ion-icon');
|
|
111
185
|
clonedBackButtonEl.text = backButtonEl.text;
|
|
112
186
|
clonedBackButtonEl.mode = backButtonEl.mode;
|
|
113
187
|
clonedBackButtonEl.icon = backButtonEl.icon;
|
|
@@ -115,11 +189,19 @@ const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, larg
|
|
|
115
189
|
clonedBackButtonEl.disabled = backButtonEl.disabled;
|
|
116
190
|
clonedBackButtonEl.style.setProperty('display', 'block');
|
|
117
191
|
clonedBackButtonEl.style.setProperty('position', 'fixed');
|
|
118
|
-
enteringBackButtonIconAnimation.addElement(
|
|
119
|
-
enteringBackButtonTextAnimation.addElement(
|
|
192
|
+
enteringBackButtonIconAnimation.addElement(clonedBackButtonIconEl);
|
|
193
|
+
enteringBackButtonTextAnimation.addElement(clonedBackButtonTextEl);
|
|
194
|
+
enteringBackButtonAnimation.addElement(clonedBackButtonEl);
|
|
195
|
+
enteringBackButtonAnimation
|
|
196
|
+
.beforeStyles({
|
|
197
|
+
position: 'absolute',
|
|
198
|
+
top: '0px',
|
|
199
|
+
[CONTAINER_ORIGIN_X]: '0px',
|
|
200
|
+
})
|
|
201
|
+
.keyframes(CONTAINER_KEYFRAMES);
|
|
120
202
|
enteringBackButtonTextAnimation
|
|
121
203
|
.beforeStyles({
|
|
122
|
-
'transform-origin': `${TEXT_ORIGIN_X}
|
|
204
|
+
'transform-origin': `${TEXT_ORIGIN_X} top`,
|
|
123
205
|
})
|
|
124
206
|
.beforeAddWrite(() => {
|
|
125
207
|
backButtonEl.style.setProperty('display', 'none');
|
|
@@ -136,21 +218,91 @@ const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, larg
|
|
|
136
218
|
'transform-origin': `${ICON_ORIGIN_X} center`,
|
|
137
219
|
})
|
|
138
220
|
.keyframes(ICON_KEYFRAMES);
|
|
139
|
-
rootAnimation.addAnimation([
|
|
221
|
+
rootAnimation.addAnimation([
|
|
222
|
+
enteringBackButtonTextAnimation,
|
|
223
|
+
enteringBackButtonIconAnimation,
|
|
224
|
+
enteringBackButtonAnimation,
|
|
225
|
+
]);
|
|
140
226
|
};
|
|
141
|
-
const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, largeTitleBox,
|
|
142
|
-
|
|
143
|
-
|
|
227
|
+
const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, largeTitleBox, largeTitleTextBox, backButtonTextEl, backButtonTextBox) => {
|
|
228
|
+
var _a, _b;
|
|
229
|
+
/**
|
|
230
|
+
* The horizontal transform origin for the large title
|
|
231
|
+
*/
|
|
144
232
|
const ORIGIN_X = rtl ? 'right' : 'left';
|
|
233
|
+
const TITLE_START_OFFSET = rtl ? `calc(100% - ${largeTitleBox.right}px)` : `${largeTitleBox.left}px`;
|
|
234
|
+
/**
|
|
235
|
+
* The cloned large should align exactly with the
|
|
236
|
+
* real large title on the leaving page otherwise there will
|
|
237
|
+
* be a layout shift.
|
|
238
|
+
*/
|
|
239
|
+
const START_TRANSLATE_X = '0px';
|
|
240
|
+
const START_TRANSLATE_Y = `${largeTitleBox.top}px`;
|
|
241
|
+
/**
|
|
242
|
+
* How much to offset the large title translation by.
|
|
243
|
+
* This accounts for differences in sizing between the large
|
|
244
|
+
* title and the back button due to padding and font weight.
|
|
245
|
+
*/
|
|
246
|
+
const LARGE_TITLE_TRANSLATION_OFFSET = 8;
|
|
247
|
+
/**
|
|
248
|
+
* The scaled title should (roughly) overlap the back button.
|
|
249
|
+
* This ensures that the back button and title overlap during
|
|
250
|
+
* the animation. Note that since both elements either fade in
|
|
251
|
+
* or fade out over the course of the animation, neither element
|
|
252
|
+
* will be fully visible on top of the other. As a result, the overlap
|
|
253
|
+
* does not need to be perfect, so approximate values are acceptable here.
|
|
254
|
+
*/
|
|
255
|
+
const END_TRANSLATE_X = rtl
|
|
256
|
+
? `-${window.innerWidth - backButtonTextBox.right - LARGE_TITLE_TRANSLATION_OFFSET}px`
|
|
257
|
+
: `${backButtonTextBox.x - LARGE_TITLE_TRANSLATION_OFFSET}px`;
|
|
258
|
+
/**
|
|
259
|
+
* The top of the scaled large title
|
|
260
|
+
* should match with the top of the
|
|
261
|
+
* back button text element.
|
|
262
|
+
* We subtract 2px to account for the top padding
|
|
263
|
+
* on the large title element.
|
|
264
|
+
*/
|
|
265
|
+
const LARGE_TITLE_TOP_PADDING = 2;
|
|
266
|
+
const END_TRANSLATE_Y = `${backButtonTextBox.y - LARGE_TITLE_TOP_PADDING}px`;
|
|
267
|
+
/**
|
|
268
|
+
* In the forward direction, the large title should start at its
|
|
269
|
+
* normal size and then scale down to be (roughly) the size of the
|
|
270
|
+
* back button on the other view. In the backward direction, the
|
|
271
|
+
* large title should start at (roughly) the size of the back button
|
|
272
|
+
* and then scale up to its original size.
|
|
273
|
+
*
|
|
274
|
+
* Note that since both elements either fade in
|
|
275
|
+
* or fade out over the course of the animation, neither element
|
|
276
|
+
* will be fully visible on top of the other. As a result, the overlap
|
|
277
|
+
* does not need to be perfect, so approximate values are acceptable here.
|
|
278
|
+
*/
|
|
279
|
+
/**
|
|
280
|
+
* When the title and back button texts match
|
|
281
|
+
* then they should overlap during the page transition.
|
|
282
|
+
* If the texts do not match up then the large title text scale adjusts
|
|
283
|
+
* to not perfectly match the back button text otherwise the
|
|
284
|
+
* proportions will be incorrect.
|
|
285
|
+
* When the texts match we scale both the width and height to account for
|
|
286
|
+
* font weight differences between the title and back button.
|
|
287
|
+
*/
|
|
288
|
+
const doTitleAndButtonTextsMatch = ((_a = backButtonTextEl.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === ((_b = largeTitleEl.textContent) === null || _b === void 0 ? void 0 : _b.trim());
|
|
289
|
+
const WIDTH_SCALE = backButtonTextBox.width / largeTitleTextBox.width;
|
|
290
|
+
const HEIGHT_SCALE = backButtonTextBox.height / (largeTitleTextBox.height - LARGE_TITLE_SIZE_OFFSET);
|
|
291
|
+
const START_SCALE = 'scale(1)';
|
|
292
|
+
const END_SCALE = doTitleAndButtonTextsMatch ? `scale(${WIDTH_SCALE}, ${HEIGHT_SCALE})` : `scale(${HEIGHT_SCALE})`;
|
|
145
293
|
const BACKWARDS_KEYFRAMES = [
|
|
146
|
-
{ offset: 0, opacity: 0, transform: `translate3d(${
|
|
294
|
+
{ offset: 0, opacity: 0, transform: `translate3d(${END_TRANSLATE_X}, ${END_TRANSLATE_Y}, 0) ${END_SCALE}` },
|
|
147
295
|
{ offset: 0.1, opacity: 0 },
|
|
148
|
-
{ offset: 1, opacity: 1, transform: `translate3d(
|
|
296
|
+
{ offset: 1, opacity: 1, transform: `translate3d(${START_TRANSLATE_X}, ${START_TRANSLATE_Y}, 0) ${START_SCALE}` },
|
|
149
297
|
];
|
|
150
298
|
const FORWARDS_KEYFRAMES = [
|
|
151
|
-
{
|
|
299
|
+
{
|
|
300
|
+
offset: 0,
|
|
301
|
+
opacity: 0.99,
|
|
302
|
+
transform: `translate3d(${START_TRANSLATE_X}, ${START_TRANSLATE_Y}, 0) ${START_SCALE}`,
|
|
303
|
+
},
|
|
152
304
|
{ offset: 0.6, opacity: 0 },
|
|
153
|
-
{ offset: 1, opacity: 0, transform: `translate3d(${
|
|
305
|
+
{ offset: 1, opacity: 0, transform: `translate3d(${END_TRANSLATE_X}, ${END_TRANSLATE_Y}, 0) ${END_SCALE}` },
|
|
154
306
|
];
|
|
155
307
|
const KEYFRAMES = backDirection ? BACKWARDS_KEYFRAMES : FORWARDS_KEYFRAMES;
|
|
156
308
|
const clonedTitleEl = getClonedElement('ion-title');
|
|
@@ -161,8 +313,14 @@ const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, larg
|
|
|
161
313
|
clonedLargeTitleAnimation.addElement(clonedTitleEl);
|
|
162
314
|
clonedLargeTitleAnimation
|
|
163
315
|
.beforeStyles({
|
|
164
|
-
'transform-origin': `${ORIGIN_X}
|
|
165
|
-
|
|
316
|
+
'transform-origin': `${ORIGIN_X} top`,
|
|
317
|
+
/**
|
|
318
|
+
* Since font size changes will cause
|
|
319
|
+
* the dimension of the large title to change
|
|
320
|
+
* we need to set the cloned title height
|
|
321
|
+
* equal to that of the original large title height.
|
|
322
|
+
*/
|
|
323
|
+
height: `${largeTitleBox.height}px`,
|
|
166
324
|
display: '',
|
|
167
325
|
position: 'relative',
|
|
168
326
|
[ORIGIN_X]: TITLE_START_OFFSET,
|
|
@@ -475,3 +633,13 @@ export const iosTransitionAnimation = (navEl, opts) => {
|
|
|
475
633
|
throw err;
|
|
476
634
|
}
|
|
477
635
|
};
|
|
636
|
+
/**
|
|
637
|
+
* The scale of the back button during the animation
|
|
638
|
+
* is computed based on the scale of the large title
|
|
639
|
+
* and vice versa. However, we need to account for slight
|
|
640
|
+
* variations in the size of the large title due to
|
|
641
|
+
* padding and font weight. This value should be used to subtract
|
|
642
|
+
* a small amount from the large title height when computing scales
|
|
643
|
+
* to get more accurate scale results.
|
|
644
|
+
*/
|
|
645
|
+
const LARGE_TITLE_SIZE_OFFSET = 10;
|
package/dist/docs.json
CHANGED
|
@@ -10,8 +10,8 @@ const LIFECYCLE_WILL_LEAVE = 'ionViewWillLeave';
|
|
|
10
10
|
const LIFECYCLE_DID_LEAVE = 'ionViewDidLeave';
|
|
11
11
|
const LIFECYCLE_WILL_UNLOAD = 'ionViewWillUnload';
|
|
12
12
|
|
|
13
|
-
const iosTransitionAnimation = () => import('./ios.transition-
|
|
14
|
-
const mdTransitionAnimation = () => import('./md.transition-
|
|
13
|
+
const iosTransitionAnimation = () => import('./ios.transition-4d1322d6.js');
|
|
14
|
+
const mdTransitionAnimation = () => import('./md.transition-66b425d0.js');
|
|
15
15
|
// TODO(FW-2832): types
|
|
16
16
|
const transition = (opts) => {
|
|
17
17
|
return new Promise((resolve, reject) => {
|
package/dist/esm/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
4
|
export { c as createAnimation } from './animation-92066c62.js';
|
|
5
|
-
export { a as LIFECYCLE_DID_ENTER, c as LIFECYCLE_DID_LEAVE, L as LIFECYCLE_WILL_ENTER, b as LIFECYCLE_WILL_LEAVE, d as LIFECYCLE_WILL_UNLOAD, g as getIonPageElement } from './index-
|
|
6
|
-
export { iosTransitionAnimation } from './ios.transition-
|
|
7
|
-
export { mdTransitionAnimation } from './md.transition-
|
|
5
|
+
export { a as LIFECYCLE_DID_ENTER, c as LIFECYCLE_DID_LEAVE, L as LIFECYCLE_WILL_ENTER, b as LIFECYCLE_WILL_LEAVE, d as LIFECYCLE_WILL_UNLOAD, g as getIonPageElement } from './index-a09eac70.js';
|
|
6
|
+
export { iosTransitionAnimation } from './ios.transition-4d1322d6.js';
|
|
7
|
+
export { mdTransitionAnimation } from './md.transition-66b425d0.js';
|
|
8
8
|
export { g as getTimeGivenProgression } from './cubic-bezier-66542bc5.js';
|
|
9
9
|
export { createGesture } from './index-ff313b19.js';
|
|
10
10
|
export { g as getPlatforms, i as initialize, a as isPlatform } from './ionic-global-246ca78f.js';
|
|
@@ -11,7 +11,7 @@ import { c as createKeyboardController } from './keyboard-controller-0c2dce71.js
|
|
|
11
11
|
import { g as getTimeGivenProgression } from './cubic-bezier-66542bc5.js';
|
|
12
12
|
import { a as attachComponent, d as detachComponent } from './framework-delegate-aa433dea.js';
|
|
13
13
|
import { c as createLockController } from './lock-controller-e8c6c051.js';
|
|
14
|
-
import { t as transition } from './index-
|
|
14
|
+
import { t as transition } from './index-a09eac70.js';
|
|
15
15
|
import './index-595d62c9.js';
|
|
16
16
|
import './index-7a14ecec.js';
|
|
17
17
|
import './keyboard-b063f012.js';
|
|
@@ -1166,7 +1166,7 @@ const RouterOutlet = class {
|
|
|
1166
1166
|
};
|
|
1167
1167
|
RouterOutlet.style = routerOutletCss;
|
|
1168
1168
|
|
|
1169
|
-
const titleIosCss = ":host{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{top:0;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0);font-size:min(1.0625rem, 20.4px);font-weight:600;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host:dir(rtl){left:unset;right:unset;right:0}}}:host(.title-small){-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:min(0.8125rem, 23.4px);font-weight:normal}:host(.title-large){-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:2px;padding-bottom:4px;-webkit-transform-origin:left center;transform-origin:left center;position:static;-ms-flex-align:end;align-items:flex-end;min-width:100%;font-size:min(2.125rem, 61.2px);font-weight:700;text-align:start}:host(.title-large.title-rtl){-webkit-transform-origin:right center;transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000);font-family:var(--ion-font-family)}:host(.title-large) .toolbar-title{-webkit-transform-origin:inherit;transform-origin:inherit}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}@supports selector(:dir(rtl)){:host(.title-large) .toolbar-title:dir(rtl){-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}}";
|
|
1169
|
+
const titleIosCss = ":host{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{top:0;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0);font-size:min(1.0625rem, 20.4px);font-weight:600;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host:dir(rtl){left:unset;right:unset;right:0}}}:host(.title-small){-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:min(0.8125rem, 23.4px);font-weight:normal}:host(.title-large){-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:2px;padding-bottom:4px;-webkit-transform-origin:left center;transform-origin:left center;position:static;-ms-flex-align:end;align-items:flex-end;min-width:100%;font-size:min(2.125rem, 61.2px);font-weight:700;text-align:start}:host(.title-large.title-rtl){-webkit-transform-origin:right center;transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000);font-family:var(--ion-font-family)}:host(.title-large) .toolbar-title{-webkit-transform-origin:inherit;transform-origin:inherit;width:auto}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}@supports selector(:dir(rtl)){:host(.title-large) .toolbar-title:dir(rtl){-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}}";
|
|
1170
1170
|
|
|
1171
1171
|
const titleMdCss = ":host{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:0;padding-bottom:0;font-size:1.25rem;font-weight:500;letter-spacing:0.0125em}:host(.title-small){width:100%;height:100%;font-size:0.9375rem;font-weight:normal}";
|
|
1172
1172
|
|
|
@@ -10,7 +10,7 @@ import { p as printIonWarning } from './index-595d62c9.js';
|
|
|
10
10
|
import { g as getCapacitor } from './capacitor-b4979570.js';
|
|
11
11
|
import { G as GESTURE, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, n as activeAnimations, g as dismiss, h as eventMethod } from './overlays-cec6bac8.js';
|
|
12
12
|
import { g as getClassMap } from './theme-17531cdf.js';
|
|
13
|
-
import { e as deepReady, w as waitForMount } from './index-
|
|
13
|
+
import { e as deepReady, w as waitForMount } from './index-a09eac70.js';
|
|
14
14
|
import { b as getIonMode, c as config } from './ionic-global-246ca78f.js';
|
|
15
15
|
import { KEYBOARD_DID_OPEN } from './keyboard-b551279d.js';
|
|
16
16
|
import { c as createAnimation } from './animation-92066c62.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, f as getElement, H as Host } from './index-b49b173c.js';
|
|
5
5
|
import { g as getTimeGivenProgression } from './cubic-bezier-66542bc5.js';
|
|
6
6
|
import { o as assert, s as shallowEqualStringMap } from './helpers-3379ba19.js';
|
|
7
|
-
import { l as lifecycle, t as transition, s as setPageHidden, d as LIFECYCLE_WILL_UNLOAD, b as LIFECYCLE_WILL_LEAVE, c as LIFECYCLE_DID_LEAVE } from './index-
|
|
7
|
+
import { l as lifecycle, t as transition, s as setPageHidden, d as LIFECYCLE_WILL_UNLOAD, b as LIFECYCLE_WILL_LEAVE, c as LIFECYCLE_DID_LEAVE } from './index-a09eac70.js';
|
|
8
8
|
import { b as getIonMode, c as config } from './ionic-global-246ca78f.js';
|
|
9
9
|
import { a as attachComponent } from './framework-delegate-aa433dea.js';
|
|
10
10
|
|
|
@@ -9,7 +9,7 @@ import { p as printIonWarning } from './index-595d62c9.js';
|
|
|
9
9
|
import { B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, o as focusFirstDescendant, g as dismiss, h as eventMethod } from './overlays-cec6bac8.js';
|
|
10
10
|
import { b as getIonMode, a as isPlatform } from './ionic-global-246ca78f.js';
|
|
11
11
|
import { g as getClassMap } from './theme-17531cdf.js';
|
|
12
|
-
import { e as deepReady, w as waitForMount } from './index-
|
|
12
|
+
import { e as deepReady, w as waitForMount } from './index-a09eac70.js';
|
|
13
13
|
import { c as createAnimation } from './animation-92066c62.js';
|
|
14
14
|
import './index-7a14ecec.js';
|
|
15
15
|
import './hardware-back-button-39299f84.js';
|
package/dist/esm/ionic.js
CHANGED
|
@@ -7,7 +7,7 @@ import { g as globalScripts } from './app-globals-ec816a70.js';
|
|
|
7
7
|
import './ionic-global-246ca78f.js';
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
|
-
Stencil Client Patch Browser v4.
|
|
10
|
+
Stencil Client Patch Browser v4.5.0 | MIT Licensed | https://stenciljs.com
|
|
11
11
|
*/
|
|
12
12
|
const patchBrowser = () => {
|
|
13
13
|
const importMeta = import.meta.url;
|