Skip to content

Commit 8450564

Browse files
authored
chore: sync with main
chore: sync with main
2 parents 6da82aa + b5261e0 commit 8450564

File tree

69 files changed

+1282
-303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1282
-303
lines changed

.github/workflows/stencil-nightly.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ on:
88
# at 6:00 UTC (6:00 am UTC)
99
- cron: '00 06 * * 1-5'
1010
workflow_dispatch:
11-
# allows for manual invocations in the GitHub UI
11+
inputs:
12+
npm_release_tag:
13+
required: true
14+
type: string
15+
description: What version should be pulled from NPM?
16+
default: nightly
1217

1318
# When pushing a new commit we should
1419
# cancel the previous test run to not
@@ -24,7 +29,7 @@ jobs:
2429
- uses: actions/checkout@v3
2530
- uses: ./.github/workflows/actions/build-core-stencil-prerelease
2631
with:
27-
stencil-version: nightly
32+
stencil-version: ${{ inputs.npm_release_tag || 'nightly' }}
2833

2934
test-core-clean-build:
3035
needs: [build-core-with-stencil-nightly]
@@ -47,7 +52,7 @@ jobs:
4752
- uses: actions/checkout@v3
4853
- uses: ./.github/workflows/actions/test-core-spec
4954
with:
50-
stencil-version: nightly
55+
stencil-version: ${{ inputs.npm_release_tag || 'nightly' }}
5156

5257
test-core-screenshot:
5358
strategy:

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [7.4.3](https://github.com/ionic-team/ionic-framework/compare/v7.4.2...v7.4.3) (2023-10-04)
7+
8+
9+
### Bug Fixes
10+
11+
* **fab-button:** position is correct with custom sizes ([#28195](https://github.com/ionic-team/ionic-framework/issues/28195)) ([eb41b55](https://github.com/ionic-team/ionic-framework/commit/eb41b556b57c97139b9c36dc3e3be3711d8afaca)), closes [#22564](https://github.com/ionic-team/ionic-framework/issues/22564)
12+
* **range:** knob positions are correct on initial render with custom elements build ([#28257](https://github.com/ionic-team/ionic-framework/issues/28257)) ([ac2c8e6](https://github.com/ionic-team/ionic-framework/commit/ac2c8e6c22da4d0d8224def24ddef56ee9d26246)), closes [#25444](https://github.com/ionic-team/ionic-framework/issues/25444)
13+
14+
15+
16+
17+
18+
## [7.4.2](https://github.com/ionic-team/ionic-framework/compare/v7.4.1...v7.4.2) (2023-09-27)
19+
20+
21+
### Bug Fixes
22+
23+
* **react:** Nav unmounts component while invoking popTo or popToRoot ([#27821](https://github.com/ionic-team/ionic-framework/issues/27821)) ([0edcb2c](https://github.com/ionic-team/ionic-framework/commit/0edcb2cd85133ae8c304c53c37ca829e5fbad447)), closes [#27798](https://github.com/ionic-team/ionic-framework/issues/27798)
24+
* **title:** large title uses custom font on transition ([#28231](https://github.com/ionic-team/ionic-framework/issues/28231)) ([71a7af0](https://github.com/ionic-team/ionic-framework/commit/71a7af0f52fe62937b1dea1ca2739e78801a2a6d))
25+
26+
27+
28+
29+
630
## [7.4.1](https://github.com/ionic-team/ionic-framework/compare/v7.4.0...v7.4.1) (2023-09-20)
731

832

core/CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,29 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [7.4.3](https://github.com/ionic-team/ionic-framework/compare/v7.4.2...v7.4.3) (2023-10-04)
7+
8+
9+
### Bug Fixes
10+
11+
* **fab-button:** position is correct with custom sizes ([#28195](https://github.com/ionic-team/ionic-framework/issues/28195)) ([eb41b55](https://github.com/ionic-team/ionic-framework/commit/eb41b556b57c97139b9c36dc3e3be3711d8afaca)), closes [#22564](https://github.com/ionic-team/ionic-framework/issues/22564)
12+
* **range:** knob positions are correct on initial render with custom elements build ([#28257](https://github.com/ionic-team/ionic-framework/issues/28257)) ([ac2c8e6](https://github.com/ionic-team/ionic-framework/commit/ac2c8e6c22da4d0d8224def24ddef56ee9d26246)), closes [#25444](https://github.com/ionic-team/ionic-framework/issues/25444)
13+
14+
15+
16+
17+
18+
## [7.4.2](https://github.com/ionic-team/ionic-framework/compare/v7.4.1...v7.4.2) (2023-09-27)
19+
20+
21+
### Bug Fixes
22+
23+
* **title:** large title uses custom font on transition ([#28231](https://github.com/ionic-team/ionic-framework/issues/28231)) ([71a7af0](https://github.com/ionic-team/ionic-framework/commit/71a7af0f52fe62937b1dea1ca2739e78801a2a6d))
24+
25+
26+
27+
28+
629
## [7.4.1](https://github.com/ionic-team/ionic-framework/compare/v7.4.0...v7.4.1) (2023-09-20)
730

831

core/package-lock.json

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/core",
3-
"version": "7.4.1",
3+
"version": "7.4.3",
44
"description": "Base components for Ionic",
55
"keywords": [
66
"ionic",
@@ -31,13 +31,13 @@
3131
"loader/"
3232
],
3333
"dependencies": {
34-
"@stencil/core": "^4.3.0",
34+
"@stencil/core": "^4.4.0",
3535
"ionicons": "7.1.0",
3636
"tslib": "^2.1.0"
3737
},
3838
"devDependencies": {
3939
"@axe-core/playwright": "^4.7.3",
40-
"@capacitor/core": "^5.4.1",
40+
"@capacitor/core": "^5.4.2",
4141
"@capacitor/haptics": "^5.0.6",
4242
"@capacitor/keyboard": "^5.0.6",
4343
"@capacitor/status-bar": "^5.0.6",
@@ -49,7 +49,7 @@
4949
"@rollup/plugin-virtual": "^2.0.3",
5050
"@stencil/angular-output-target": "^0.8.2",
5151
"@stencil/react-output-target": "^0.5.3",
52-
"@stencil/sass": "^3.0.5",
52+
"@stencil/sass": "^3.0.6",
5353
"@stencil/vue-output-target": "^0.8.6",
5454
"@types/jest": "^27.5.2",
5555
"@types/node": "^14.6.0",
@@ -94,6 +94,7 @@
9494
"test.spec": "stencil test --spec --max-workers=2",
9595
"test.spec.debug": "npx --node-arg=\"--inspect-brk\" stencil test --spec",
9696
"test.e2e": "npx playwright test",
97+
"test.e2e.update-snapshots": "npm run test.e2e -- --update-snapshots",
9798
"test.watch": "jest --watch --no-cache",
9899
"test.treeshake": "node scripts/treeshaking.js dist/index.js",
99100
"validate": "npm run lint && npm run test && npm run build && npm run test.treeshake"

core/src/components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6980,6 +6980,7 @@ declare namespace LocalJSX {
69806980
*/
69816981
"mode"?: "ios" | "md";
69826982
"onIonTabBarChanged"?: (event: IonTabBarCustomEvent<TabBarChangedEventDetail>) => void;
6983+
"onIonTabBarLoaded"?: (event: IonTabBarCustomEvent<void>) => void;
69836984
/**
69846985
* The selected tab component
69856986
*/

core/src/components/content/content.tsx

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ComponentInterface, EventEmitter } from '@stencil/core';
22
import { Build, Component, Element, Event, Host, Listen, Method, Prop, forceUpdate, h, readTask } from '@stencil/core';
3-
import { componentOnReady } from '@utils/helpers';
3+
import { componentOnReady, hasLazyBuild } from '@utils/helpers';
44
import { isPlatform } from '@utils/platform';
55
import { isRTL } from '@utils/rtl';
66
import { createColorClasses, hostContext } from '@utils/theme';
@@ -34,6 +34,9 @@ export class Content implements ComponentInterface {
3434
private isMainContent = true;
3535
private resizeTimeout: ReturnType<typeof setTimeout> | null = null;
3636

37+
private tabsElement: HTMLElement | null = null;
38+
private tabsLoadCallback?: () => void;
39+
3740
// Detail is used in a hot loop in the scroll event, by allocating it here
3841
// V8 will be able to inline any read/write to it since it's a monomorphic class.
3942
// https://mrale.ph/blog/2015/01/11/whats-up-with-monomorphism.html
@@ -115,15 +118,61 @@ export class Content implements ComponentInterface {
115118

116119
connectedCallback() {
117120
this.isMainContent = this.el.closest('ion-menu, ion-popover, ion-modal') === null;
121+
122+
/**
123+
* The fullscreen content offsets need to be
124+
* computed after the tab bar has loaded. Since
125+
* lazy evaluation means components are not hydrated
126+
* at the same time, we need to wait for the ionTabBarLoaded
127+
* event to fire. This does not impact dist-custom-elements
128+
* because there is no hydration there.
129+
*/
130+
if (hasLazyBuild(this.el)) {
131+
/**
132+
* We need to cache the reference to the tabs.
133+
* If just the content is unmounted then we won't
134+
* be able to query for the closest tabs on disconnectedCallback
135+
* since the content has been removed from the DOM tree.
136+
*/
137+
const closestTabs = (this.tabsElement = this.el.closest('ion-tabs'));
138+
if (closestTabs !== null) {
139+
/**
140+
* When adding and removing the event listener
141+
* we need to make sure we pass the same function reference
142+
* otherwise the event listener will not be removed properly.
143+
* We can't only pass `this.resize` because "this" in the function
144+
* context becomes a reference to IonTabs instead of IonContent.
145+
*
146+
* Additionally, we listen for ionTabBarLoaded on the IonTabs
147+
* instance rather than the IonTabBar instance. It's possible for
148+
* a tab bar to be conditionally rendered/mounted. Since ionTabBarLoaded
149+
* bubbles, we can catch any instances of child tab bars loading by listening
150+
* on IonTabs.
151+
*/
152+
this.tabsLoadCallback = () => this.resize();
153+
closestTabs.addEventListener('ionTabBarLoaded', this.tabsLoadCallback);
154+
}
155+
}
118156
}
119157

120158
disconnectedCallback() {
121159
this.onScrollEnd();
122-
}
123160

124-
@Listen('appload', { target: 'window' })
125-
onAppLoad() {
126-
this.resize();
161+
if (hasLazyBuild(this.el)) {
162+
/**
163+
* The event listener and tabs caches need to
164+
* be cleared otherwise this will create a memory
165+
* leak where the IonTabs instance can never be
166+
* garbage collected.
167+
*/
168+
const { tabsElement, tabsLoadCallback } = this;
169+
if (tabsElement !== null && tabsLoadCallback !== undefined) {
170+
tabsElement.removeEventListener('ionTabBarLoaded', tabsLoadCallback);
171+
}
172+
173+
this.tabsElement = null;
174+
this.tabsLoadCallback = undefined;
175+
}
127176
}
128177

129178
/**

core/src/components/fab-button/fab-button.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
// --------------------------------------------------
200200

201201
:host(.fab-button-small) {
202-
@include margin(($fab-size - $fab-small-size) * 0.5);
202+
@include margin($fab-button-small-margin);
203203

204204
width: #{$fab-small-size};
205205
height: #{$fab-small-size};

core/src/components/fab-button/fab-button.vars.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ $fab-small-size: 40px !default;
1111

1212
/// @prop - Border radius of the FAB button
1313
$fab-border-radius: 50% !default;
14+
15+
/// @prop - Margin applied to the small FAB button
16+
$fab-button-small-margin: 8px !default;

core/src/components/fab-list/fab-list.scss

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// --------------------------------------------------
55

66
:host {
7-
@include margin($fab-size + $fab-list-margin, 0);
7+
@include margin(calc(100% + #{$fab-list-margin}), 0);
88

99
display: none;
1010
position: absolute;
@@ -13,8 +13,15 @@
1313
flex-direction: column;
1414
align-items: center;
1515

16-
min-width: $fab-size;
17-
min-height: $fab-size;
16+
/**
17+
* The list should be centered relative to the parent
18+
* FAB button. We set minimum dimensions so the
19+
* FAB list can be centered relative to the small FAB button.
20+
* However, the small FAB button adds start/end margin, so we need
21+
* to account for that in the FAB list dimensions.
22+
*/
23+
min-width: $fab-small-size + ($fab-button-small-margin * 2);
24+
min-height: $fab-small-size + ($fab-button-small-margin * 2);
1825
}
1926

2027
:host(.fab-list-active) {
@@ -59,14 +66,14 @@
5966
}
6067

6168
:host(.fab-list-side-start) {
62-
@include margin(0, $fab-size + $fab-list-margin);
69+
@include margin(0, calc(100% + #{$fab-list-margin}));
6370
@include position-horizontal(null, 0);
6471

6572
flex-direction: row-reverse;
6673
}
6774

6875
:host(.fab-list-side-end) {
69-
@include margin(0, $fab-size + $fab-list-margin);
76+
@include margin(0, calc(100% + #{$fab-list-margin}));
7077
@include position(null, null, null, 0);
7178

7279
flex-direction: row;

0 commit comments

Comments
 (0)