Commit graph

149 commits

Author SHA1 Message Date
alistair3149 2f827857dc
feat: drop Codex tabs
It has never worked correctly and it is difficult to maintain
both MW compatability across versions and Codex
2024-11-19 16:04:26 -05:00
alistair3149 27e05c72a6
docs: explain why init module is needed 2024-11-17 17:47:00 -05:00
alistair3149 1f75afc217 fix: various issues found in code review 2024-11-16 03:19:11 -05:00
alistair3149 9e8ac878cc fix: fix various issues raised by code review 2024-11-16 03:19:11 -05:00
alistair3149 b0670f5df8 refactor: simplify VE tabber condition check 2024-11-16 03:19:11 -05:00
alistair3149 70f632a4db fix: no need to apply hover:hover to active state 2024-11-16 03:19:11 -05:00
alistair3149 f87c43e8e4 fix: drop unused variable 2024-11-16 03:19:11 -05:00
alistair3149 8f1cb74e4e refactor: use AbortController for tabbertransclude fetch 2024-11-16 03:19:11 -05:00
alistair3149 df9897441a refactor: remove unused function 2024-11-16 03:19:11 -05:00
alistair3149 56619bf56f feat: simplify implementation and drop hash usage
Instead of doing JS hashing, just append the tabber count to the end of the ID.
Having the same tab label within the same Tabber breaks in the previous behavior anyways
2024-11-16 03:19:11 -05:00
alistair3149 910f5c72f4 perf: drop incorrect usage of rAF and do not set aria-hidden on tabpanels 2024-11-16 03:19:11 -05:00
alistair3149 bd5738afe8 feat: use Codex CSS variable directly 2024-11-16 03:19:11 -05:00
alistair3149 1e1d3de9cd feat: render all HTML server-side 2024-11-16 03:19:11 -05:00
alistair3149 f24ddb58ee feat: only add empty paragraph for wikitext list elements
We don't need the empty paragraph hack for non-list elements.
Related: #151
2024-11-16 03:19:11 -05:00
alistair3149 21ad702ee2
refactor: more function clean up 2024-11-15 00:07:11 -05:00
csalinezh 201238ccd8
fix: keep arrow button icon inside its parent (#186)
If the parent element sets "text-align: center", "position: absolute"
leads to weird offset issue due to "left: auto" calculation rules.
Specifically the rule 2 for "static position" in Chapter 10 of CSS 2:
https://www.w3.org/TR/CSS2/visudet.html#static-position

It's not necessary for these pseudo-elements to be positioned, hence
the simplification.
2024-11-13 19:42:19 -05:00
alistair3149 1b60511ae7
feat: add TabberNeueUseLegacyTabIds config option (#184)
Also fix the issue where disabling TabberNeueEnableAnimation didn't actually work

---------

Co-authored-by: Jayden Bailey <jaydenkieran@gmail.com>
2024-11-10 03:16:11 -05:00
alistair3149 3d86ed5baa
feat: include Codex CSS variables in Tabber variables 2024-08-31 20:03:38 -04:00
Eamon Heffernan 795c76b4bd
fix: ensure that the active tab is set before the tabber event is initialized (#173)
Closes: #167, #172
2024-08-31 19:57:41 -04:00
Jayden 2f7e652e28
fix: incorrect conditions for shouldShowAnimation (#165) 2024-07-17 13:04:52 -04:00
alistair3149 2037cf38eb
feat: add print styles 2024-07-14 17:55:13 -04:00
alistair3149 1e5ad6592b
fix: prevent browser from scrolling to the tab before Tabber updates the aria attributes
Fixes: #161
2024-07-03 17:49:19 -04:00
alistair3149 421c42b6f0
feat: change tab when URL hash matches one of the tabs
Added an event listener to watch for hash change after the page is loaded.
If the hash matches a tabber tab, it will emit a tab click to switch the tab.

Closes: #150
2024-07-03 13:26:16 -04:00
alistair3149 d453adde07
fix: URL hash should be escaped when used as selector 2024-07-03 13:09:11 -04:00
alistair3149 ee54cc1bb3
perf: set active tab by hash on builder phase
Instead of setting first tab as the initial active tab the set the active tab from the URL,
just set it from the beginning. This can save a lot of code and makes it more maintainable.
2024-06-23 16:28:29 -04:00
alistair3149 05e95d880d
perf: only attach resize observer for active tabpanel when it is in viewport 2024-06-23 15:38:27 -04:00
alistair3149 72adfbc74e
fix: attach resize observer properly to current active tabpanel
This should finally fix #137
2024-06-23 15:31:44 -04:00
alistair3149 8a88a43d58
fix: make sure that init functions are run sequentially
Also fix the bug where the page does not scroll to the active tab on load by href.
It was introduced with the commit related to #133.

Closes: #148
2024-06-20 14:44:20 -04:00
alistair3149 35ffe555c0
perf: merge activeTabpanel resize observer into the main resizeObserver 2024-06-07 14:53:48 -04:00
alistair3149 a414d2df70
perf: only use one resizeObserver for header overflow 2024-06-07 14:20:41 -04:00
alistair3149 0177715f2b
fix: use resizeObserver on active tabpanel instead 2024-06-06 16:54:31 -04:00
alistair3149 8b39e9e970
fix: refresh Tabber height when it comes into viewport
Fixes: #137
2024-06-06 15:07:55 -04:00
alistair3149 d150b9e3e9
fix: prepend tabber ID with prefix to avoid conflict with existing header 2024-06-03 13:21:04 -04:00
alistair3149 0904298948
feat: add screen reader text to navigation button 2024-06-02 14:02:34 -04:00
alistair3149 7e921a4a3a
fix: set tabindex -1 on hidden tabs 2024-06-02 14:00:36 -04:00
alistair3149 ac27855dec
feat: add home and end key shortcuts on tablist 2024-06-02 13:53:44 -04:00
alistair3149 20e88b8b5a
fix: incorrect tab colors 2024-06-02 13:53:44 -04:00
alistair3149 def11349b1
fix: do not unobserve tabber 2024-05-26 22:29:20 -04:00
alistair3149 dfff2946c1
refactor: use CSS variables 2024-05-26 21:54:52 -04:00
alistair3149 2819ba83a9
perf: detach event listeners when not needed 2024-05-26 21:54:17 -04:00
alistair3149 783199016d
refactor: remove unnessecary styles 2024-05-26 17:17:26 -04:00
alistair3149 032aef7989
fix: do not use passive scroll event listener for tab header
The buttons and indicator are all depending on it
2024-05-25 23:00:06 -04:00
alistair3149 476af1352b
refactor: separate classes into other files 2024-05-25 16:38:57 -04:00
alistair3149 bbde0ae7bd
feat: add keyboard navigation to tabs 2024-05-25 16:20:59 -04:00
alistair3149 78a987d7c1
refactor: drop spread syntax for iterating nodeList 2024-05-25 15:40:10 -04:00
alistair3149 9162321c3c
feat: avoid layout shift in init 2024-05-25 15:29:56 -04:00
alistair3149 b4b66b8172
feat: improve handling of animation 2024-05-25 15:27:47 -04:00
alistair3149 a66f6e604f
feat: use skeleton screen as transclude load animation 2024-05-25 03:40:39 -04:00
alistair3149 0a3b30504d
fix: incorrect selector for hiding tabpanel in init 2024-05-25 03:07:49 -04:00
alistair3149 8d410dfb49
refactor: use init module instead of inline style for skeleton screen 2024-05-25 03:02:18 -04:00