Commit graph

202 commits

Author SHA1 Message Date
alistair3149 1b7025ef85
feat(toc): expand the current active section 2024-09-10 22:07:22 -04:00
alistair3149 ca1f31d789
refactor(core): ♻️ remove redundant intersection observers 2024-09-10 18:38:11 -04:00
alistair3149 8640d4ef30
feat(toc): switch to ToC implementation based on Vector 2022
This will serve as the groundwork of merging the intersection observers
and collapsible toc in the future.
2024-09-10 18:28:12 -04:00
alistair3149 764f7593c3
fix(overflow): 🐛 fix undefined wrapper 2024-07-20 19:32:22 -04:00
alistair3149 c9d98e477a
feat(stickyHeader): add CSS var --height-sticky-header to offset sticky elements
--height-sticky-header will always return the current height of sticky header.
It can be used to offset sticky elements so that it adjusts to the sticky header.
2024-07-19 17:08:03 -04:00
alistair3149 c3855ff8b9
fix(stickyHeader): use cached value for placeholder height if possible
Related: #854
2024-07-12 03:47:25 -04:00
alistair3149 a4593d7dd3
fix(dropdown): 🐛 use both touchstart and mousedown event listener for click outside event
On iOS devices, click event listeners don't work when the target does not have cursor: pointer.
This should resolve the issue for iOS browsers.

Related: #895
2024-07-08 15:54:15 -04:00
alistair3149 7f9f975b9e
fix(stickyHeader): 🐛 only add sticky class on resize when it is applicable 2024-07-08 14:01:13 -04:00
alistair3149 a7a763b57f
fix(stickyHeader): 🐛 use more accurate calculation for placeholder 2024-07-07 18:17:50 -04:00
alistair3149 e5336c4610
fix(stickyHeader): 🐛 add a placeholder element to page header to avoid layout shift when stickied
Closes: #854
2024-07-07 17:58:02 -04:00
alistair3149 e9fd488cee
fix(share): 🐛 incorrect debounce parameter assignment 2024-07-07 17:40:37 -04:00
alistair3149 fdc6eaee20
feat(Echo): upgrade Echo buttons for consistency
This is similiar to how it is handled in Vector.
We are forcing the Echo button to render in the same way as it was initially.
This took me so many hours sigh.
2024-07-05 20:37:52 -04:00
alistair3149 317296e7b0
fix(dropdown): 🐛 merge conflicting dismiss event handlers
Focus loss and click outside are basically using the same function.
Merging them should avoid them conflicting with each other.

Related: #895
2024-07-04 16:00:46 -04:00
alistair3149 f2ff92e1ac
feat(toc): drop checkbox hack usage in ToC in favor of dropdown (#894)
Now that ToC is also using the new dropdown system, we can remove all references to the old checkbox hack now.

Fixes: #855
2024-07-03 17:44:52 -04:00
alistair3149 516ef3a1cb
feat(dropdown): revamp dropdown menu handling
Putting the dropdown content in the details elemenet have been inconsistent.
Transition are not working correctly and different browsers are not handling it well.
Furthermore, the previous implementation does not allow an always visible state of dropdown content.

Fixes: #882
2024-07-03 16:07:19 -04:00
alistair3149 7ec0ae5b8e
refactor(stickyHeader): ♻️ create sticky sentinel in JS instead
It is only used for sticky header which requires JS, we should just create it in JS
2024-07-02 19:20:17 -04:00
alistair3149 5715a29dae
feat(stickyHeader): reduce direction observer throttle 2024-07-01 13:19:59 -04:00
alistair3149 aaee215cf6
refactor(stickyHeader): ♻️ move sticky header script into a separate module 2024-07-01 13:19:31 -04:00
alistair3149 1edc40e70c
feat(share): only share URL
The text handling across OS is inconsistent, and it is more desirable to just share the link and get the description through the embed.
2024-06-28 19:25:57 -04:00
alistair3149 327aca0b2c
feat(pageActions): add share button to page actions for article pages 2024-06-28 18:42:04 -04:00
alistair3149 7fb35f90f5
fix(overflow): 🐛 prevent overflow button from triggering form action button
When the overflow button is within a `<form>` element, it can sometimes
trigger the form action (e.g. In the realtime preview of WikiEditor).
2024-06-24 14:39:33 -04:00
alistair3149 dd89daba39
fix(overflow): 🐛 allow to click through the nav element 2024-06-12 12:51:50 -04:00
alistair3149 7830faa8fe
fix(overflow): 🐛 mark oveflow button as not accessible for screen reader 2024-06-11 19:15:57 -04:00
alistair3149 4b457dfa08
fix(overflow): 🐛 align scroll buttons with content margin 2024-06-11 19:07:38 -04:00
alistair3149 cbf60030f1
fix(overflow): 🐛 use more accurate rounding method for overflow detection 2024-06-11 18:56:54 -04:00
alistair3149 55d413eeda
feat(overflow): add overflow scroll button when using a pointer device 2024-06-11 18:00:45 -04:00
alistair3149 ababe58186
fix(core): 🐛 do not debounce scroll direction script 2024-06-09 22:58:17 -04:00
github-actions 26076514c1 ci: 👷 lint code to MediaWiki standards
Check commit and GitHub actions for more details
2024-06-07 19:01:54 +00:00
alistair3149 502b462c06
style(dropdown): 🎨 clean up code styles 2024-06-01 15:28:49 -04:00
alistair3149 32d10f893b
fix(dropdown): 🐛 toggle should dismiss the dropdown properly 2024-06-01 15:13:38 -04:00
alistair3149 a2d3159def
feat(core): replace checkbox hack with details and summary
Note that ToC is still using the old checkbox hack, it will be replaced in a later time.
Related: T333394
2024-05-30 02:20:13 -04:00
alistair3149 83ab221408
feat(core): only handle wikitable instead of all tables
Wikis use tables in creative ways and it is probably just safer to only apply it to wikitables.
Might revisit if there are any news from T330527.
2024-05-29 17:47:13 -04:00
alistair3149 2bbb1d9408
perf(core): ️ check for nowrap classes before constructing class 2024-05-29 14:02:57 -04:00
alistair3149 4ed68a924d
feat(core): wrap any elements tagged with the class citizen-overflow 2024-05-27 18:01:09 -04:00
alistair3149 7b32aeec7d
fix(core): 🐛 always reset overflow state 2024-05-27 17:58:04 -04:00
alistair3149 974e6b2750
feat(core): add config to change overflow inherited classes 2024-05-27 17:16:23 -04:00
alistair3149 c9210bd0dd
refactor(core): ♻️ separate inherited class function 2024-05-27 17:10:04 -04:00
alistair3149 523140f62f
perf(core): ️ only toggle class when the element is overflowing 2024-05-27 17:04:28 -04:00
alistair3149 bc356f915d
fix(core): 🐛 fix incorrect overflow wrapper class name 2024-05-27 16:12:09 -04:00
alistair3149 cb1cfde785
fix(core): 🐛 remove table border expansion before the JS is loaded 2024-05-27 16:10:25 -04:00
alistair3149 c17aeab3fd
feat(core): rename wgCitizenTableNowrapClasses to wgCitizenOverflowNowrapClasses
Allow this config to use for more generic elements in the future
2024-05-27 15:54:34 -04:00
alistair3149 7a4d43392d
perf(core): ️ remove scroll eventListener and resizeObserver on tables when not needed
Also started to refactor the table script to be more generic for overflow elements.
2024-05-27 15:47:53 -04:00
alistair3149 d34fb7b6f9
refactor(core): ♻️ clean up responsive table code 2024-05-26 00:37:54 -04:00
alistair3149 8ba6b55770
refactor(core): ♻️ clean up section functions 2024-05-25 23:51:50 -04:00
alistair3149 e9289b149a
perf(core): ️ further improvements to scroll and section observers 2024-05-25 23:18:18 -04:00
alistair3149 af3d72ad75
fix(core): 🐛 incorrect sticky header class assignment 2024-05-25 19:53:17 -04:00
alistair3149 27bca0fc66
feat: improve scrolling performance 2024-05-25 19:26:38 -04:00
alistair3149 ae6d207fb4
fix(core): 🐛 escape double quotes for toc selector 2024-05-25 06:57:02 -04:00
alistair3149 685901cce3
fix(core): 🐛 incorrect section selector 2024-05-21 23:15:53 -04:00
alistair3149 593c6406fb
refactor(core): ♻️ simplify section handling 2024-05-21 18:46:19 -04:00