35 Commits

Author SHA1 Message Date
4fde5f07f6 chore: add strong types in several places (#28781)
Issue number: Internal

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

As part of FW-2832 the team has an initiative to remove much of the
`any` usage in favor of stronger types. This will make modifications to
this codebase safer as we will have access to proper type checking.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Removed several `any` usages in favor of stronger types.

Note that not all of the `any` types within these files have been
removed. I mainly stuck to the low hanging fruit 😄

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

I intentionally made type changes that do not impact public APIs. Any
incorrect type changes would cause our CI checks to fail.

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
2024-01-08 15:22:34 +00:00
fe47594dc0 feat(title): large title transition supports dynamic font scaling (#28290)
Issue number: resolves #28351

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

The collapsible large title transition does not support Dynamic Font
Scaling as the position values are all hardcoded. Additionally, I
noticed that the title and the text do not align very well even at the
default font scale.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

I made a few changes to support Dynamic Font Scaling, fix the default
scale alignment, and generally make this code easier to maintain (or at
least I hope it will):

1. Removed most hardcoded values in favor of bounding box calculations.
The hardcoded values that remain have comments explaining what they are.
2. Modified the back button animation so the container handles the
translation and have the back button text animation handle its scale.
Having the back button text handle the translation and the scale at the
same time made it hard to figure out what the correct values should be.
3. Added a lot of comments explaining what we are doing/why

**When the Large Title and Back Button Texts Do Not Match**

| `FW-4146` (default) | branch (default) | `FW-4146` (scaled) | branch
(scale) |
| - | - | - | - |
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/a6261499-c5ca-4ee3-af62-fa124718ca46"></video>
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/0648c0b1-e1f8-43c1-9e7e-91489cc8ec4a"></video>
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/0def6d88-22d0-48b9-98b3-0ed2bbb407aa"></video>
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/3650ceb1-f4cb-4530-b7c6-17194f4ccd66"></video>
|

**When the Large Title and Back Button Texts Do Match**

| `FW-4146` (default) | branch (default) | `FW-4146` (scaled) | branch
(scale) |
| - | - | - | - |
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/2b8035a4-81aa-4901-99e1-fd49db1fd0d7"></video>
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/e3c66978-2015-484e-b337-73ac1c4c02a1"></video>
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/437483a8-2495-4c54-9c27-47c91af4c562"></video>
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/05ef08b0-cf0d-469d-8834-533071a8c583"></video>
|





## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Note that the alignment of the title/button will not exactly match
native iOS. The goal of this PR is to get something that is pretty close
(similar to how it was when we originally implemented this)

---------

Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
2023-10-13 15:33:42 +00:00
f8067819ee feat(a11y): add dynamic font scaling (#28314)
Issue number: resolves #24638, resolves #18592

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Developers have requested that Ionic Framework support the dynamic type
feature on iOS for accessibility purposes. Ionic applications do not
respond to font scaling on iOS which can create inaccessible
applications particularly for users with low vision. Ionic apps on
Android devices currently support the Android equivalent due to
functionality in the Chromium webview.

Developers have also requested a way of adjusting the fonts in their
Ionic UI components consistently.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Ionic components now use `rem` instead of `px` where appropriate. This
means devs can change the font size on `html` and the text in supported
Ionic components will scale up/down appropriately
- Add support for Dynamic Type on iOS (the iOS version of Dynamic Font
Scaling)

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

---------

Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
Co-authored-by: Shawn Taylor <shawn@ionic.io>
Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Sean Perkins <sean@ionic.io>
Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
2023-10-10 17:38:09 -04:00
d0d9e35c37 refactor: remove extra typescript dependency (#28220) 2023-09-26 09:01:53 -04:00
c2e1ad385d chore(many): replace any types and add tech debt tickets (#26293)
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2023-01-06 09:34:55 -06:00
ae6aa0cb8e chore(eslint): add strict-boolean-expressions rule (#25768) 2022-08-23 11:50:02 -05:00
5676bab316 lint(eslint): migrate to eslint and prettier (#25046) 2022-04-04 11:12:53 -04:00
348c50b7ea fix(title): only add large title transition when using collapsible header (#22762)
resolves #22760
2021-01-13 10:12:04 -05:00
24cfdc308f fix(ios): respect toolbar opacity when doing nav transition (#21512) 2020-06-15 09:39:06 -04:00
8a02b28efe fix(ios): properly animate content when navigating from a tabbed page (#20918)
fixes #20912
2020-04-08 15:16:10 -04:00
e23dec5eb9 fix(ios): account for nested tabs with page transition (#20955)
fixes #20948
2020-04-02 15:03:08 -04:00
df27793702 fix(title): improve reliability of large title ios nav transition (#20861) 2020-03-24 18:06:17 -04:00
ec4878ac08 fix(ios): large title animation now works properly in a modal (#20703)
fixes #20696
2020-03-06 10:09:39 -05:00
71875417f2 fix(ios): large title transition works properly in tabbed applications (#20555)
fixes #20482
2020-02-24 11:38:50 -05:00
e580b88477 fix(ios): translucent toolbar blur no longer obscures entering page title (#20314)
fixes #19158
2020-01-29 15:12:00 -05:00
b3b3312711 feat(modal): add card-style presentation with swipe to close gesture (#19428)
resolves #18660
2019-12-10 16:02:41 -05:00
300d54356d fix(title): large title nav transition adds correct safe area value (#20029)
fixes #20028
2019-12-02 12:37:33 -05:00
fc4bb2db5c fix(header): support collapsible header with multiple toolbars (#19909)
* begin fix collapsible title with multi toolbars

* fix back button

* adjust large title positioning

* a few adjustments

* remove whitespace

* add types

* fix type
2019-11-18 08:57:56 -05:00
0d40d3f3b7 refactor(back-button): convert to shadow component (#19411)
references #18899
2019-11-14 14:39:35 -05:00
cace1b357e fix(ios): only animate large title if back button is in start slot (#19846)
fixes #19840
2019-11-06 11:14:09 -05:00
e6e01381eb fix(ios): hide leaving view after nav transition to avoid flicker (#19691)
fixes #19674
2019-10-18 10:08:42 -04:00
32b97582cb refactor(): remove old animation utility (#19586)
Use Ionic Animations instead
2019-10-11 13:47:52 -04:00
dea1c2635d fix(header): fix collapsing iOS header when using with split pane (#19480)
fixes #19541
2019-10-04 15:21:15 -04:00
f4818a1f3a refactor(animation): update animation API (#19529) 2019-10-02 19:52:46 +02:00
e90e960294 chore(header): finalize collapse API (#19276)
* make requested changes

* add e2e

* add RTL support

* fix typo

* add info on how to make collapsable title

* add usage examples

* fix typo

* fix another typo

* fix typos

* update usage

* fix alpha order

* update api

* add class to collapse buttons

* merge

* update

* change back to collapse

* remove platform specific class

* update docs

* run build

* update api again

* run build
2019-09-24 18:00:03 +01:00
923312ecd5 feat(title): add large iOS toolbar title (#19268)
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
2019-09-04 11:38:48 -04:00
f2cfdf1bad fix(animation): avoid partial keyframes (#19169)
* ensure custom props not part of final keyframes

* fix clear

* clean up
2019-08-23 12:48:20 -04:00
50a92c026c fix(animation): properties can be cleared after animation finishes (#19155)
* remove certain properties when done animating

* fix bug, add more tests

* clean up

* bug fix
2019-08-22 16:12:17 -04:00
30ca46ab12 feat(animation): add animation utility (#18918)
* Add new keyframes proof of concept

* update esm import

* add base before and after methods, add tests

* add base before and after hooks

* update clean up methods, add tests

* add web animations support, change to arrow functions

* remove console logs

* add from, to, fromTo, and other properties

* add more tests, fix onFinish functionality, being testing with nav transitions

* add progress methods, use force linear

* run linter

* Add playSync

* integrate animations with framework components

* onFinish now supports multiple callbacks

* change const to let

* testing reverse

* add support for both animation utilities

* bug fix

* export createAnimation, a few tweaks

* add base tests

* fix issue with onFinish being called out of order. added tests

* fix race conditions in tests

* clean up

* fix bug where onFinish not calling for empty elements array,  update test

* clean up

* fix treeshaking, remove old comments

* remove old tests

* Add test for animationbuilder backwards compat

* update typings for menu controller

* mock web animations in tests

* run build

* fix type errors

* sync with master

* use requestAnimationFrame instead of writeTask

* fix flaky tests, fix menu

* fix ordering

* update webdriver

* fix wrong version

* Revert "fix wrong version"

This reverts commit be91296e9701399f8d784b08d09a3c475ca15df7.

Revert chromedriver update

* Revert "update webdriver"

This reverts commit e49bc9d76e335a0af5828725065399bd6795fa37.

Revert chromedriver update

* expose raw animation object, add tests

* add stylesheet recycling

* finalize before and after hook tests

* a few styling changes

* fix lint warnings

* get rid of old code

* Fix progressStep overflow bug

* disable reuse stylesheet

* small updates

* fix old animation create

* setStyleProperty helper

* reuse keyframe styles

* keyframes

* fix css animation issue with display: none, add tests

* add comment

* fix issue with progress animations and css animations

* clean up

* clean up pt2

* fix tests

* fix linter

* add fill for overlays

* fix swipe to go back

* clean up css animations when done

* fix edge cases with css animations

* fix menu open and close

* add reset function

* clean up reset fn

* Fix issue where animation always being reset

* allow updating animations on the fly

* add clear onfinish method

* fix linter

* add callback options, expand force direction

* ensure opts is defined

* fix css animations open and close for menus

* remove test

* add extra check

* clean up

* fix css anim bug swipe to go back

* fix pause

* setup alt animation to avoid flickering

* clean up

* reset flags on destroy

* add ability to change duration on progressEnd

* fix flicker on duration change for css animations

* fix ios transition

* remove unneeded recursion

* increase durability of updating css animations on the fly

* fix gesture anim

* fix web anim as well. more work for cleanup

* simplify progressEnd for css animations

* fix swipe to go back race condition

* clean up

* Add todo

* fix one more bug
2019-08-12 10:05:04 -04:00
9b075ef529 feat(transition): iOS page transition shadow (#18695)
Closes #18661
2019-07-18 14:50:56 -05:00
03c1d19e07 perf(all): minify better by using arrow functions (#18730) 2019-07-10 10:33:33 -04:00
7d0120789c fix(transition): animate all toolbars in iOS page transitions (#17224)
* fix(transition): add all header toolbars to ios transition

* test(nav): add 2nd toolbar to test transition

* fix(transition): add remaining toolbar children to animation

* fix(transition): fix incorrect variable name

* fix(toolbar): fix bug in safari, clean up code, update test

* fix typo

* change elems to els

* change Elem to El
2019-03-14 15:38:40 -04:00
ad20bd6a70 fix(animation): fix header flicker on ios (#17422)
* add initial fix for flicker on ios

* fix(transition): do not remove opacity from outgoing element
2019-03-04 13:32:58 -05:00
4646f53ec7 fix(ssr): fix global window and document references (#17590) 2019-02-22 20:13:09 -06:00
f9483a0c13 refactor(utils): reorganize some chunks 2018-12-28 20:38:24 +01:00