Граф коммитов

124 Коммитов

Автор SHA1 Сообщение Дата
Mu-An 慕安 eb44a7a777
Apply suggestions from code review
Co-authored-by: David Graham <dgraham@github.com>
2020-05-20 13:43:17 -04:00
Mu-An Chiou 18a6ef5cca
Convert to typescript and simplify toolchain 2020-05-19 18:03:33 -04:00
Mu-An Chiou 6eb51d1c28
Update test runs 2020-05-19 17:10:44 -04:00
Keith Cirkel b99ce212ec
1.2.0 2020-04-02 13:01:04 +01:00
Keith Cirkel 3516cb5dd4
Merge pull request #29 from github/dependabot/npm_and_yarn/acorn-6.4.1
Bump acorn from 6.1.1 to 6.4.1
2020-04-02 12:58:55 +01:00
Keith Cirkel f5afa6bade
Merge pull request #30 from github/feat-add-focus-management-for-toolbar
Feat add focus management for toolbar
2020-04-02 12:58:30 +01:00
Keith Cirkel dcfdbd7845
docs: clarify focus management in readme
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
2020-04-02 10:40:04 +01:00
Keith Cirkel b8777de92b
docs: add README note about data-md-button 2020-04-01 12:19:15 +01:00
Keith Cirkel 434e68c0f9
style: move let binding closer to first use
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
2020-04-01 12:18:13 +01:00
Keith Cirkel d91d2f0151
fix: apply focus event listener only once
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
2020-04-01 12:17:50 +01:00
Keith Cirkel 44edfbcc60
test: fixup example & test html
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
2020-04-01 10:56:34 +01:00
Keith Cirkel 4d6dbc831c
test: add hidden toolbar to examples 2020-03-31 11:45:34 +01:00
Keith Cirkel ee95e9d92a
fix: Home/End shortcuts should preventDefault 2020-03-31 11:42:36 +01:00
Keith Cirkel 85206b258d
fix: make focus management lazy, on focus of toolbar.
This allows toolbars to be in an initially hidden state, and only when
they are visible and focus moves to them does the focus management kick
in.
2020-03-31 11:23:05 +01:00
Keith Cirkel 715efc8cfa
fix: do not focus on buttons that are hidden via CSS 2020-03-27 14:56:31 +00:00
Keith Cirkel baa5138975
fix: filter out hidden elements 2020-03-26 16:42:38 +00:00
Keith Cirkel 33a7ceb03e
refactor: move element selectors to assignment 2020-03-26 16:33:37 +00:00
Keith Cirkel e6e2ae0beb
style: add type guard to buttons 2020-03-24 17:25:46 +00:00
Keith Cirkel 014e98f0e9
style: add return type annotation for getButtons function
Co-Authored-By: David Graham <dgraham@github.com>
2020-03-24 17:18:56 +00:00
Keith Cirkel 7fef62f7e5
refactor: move needless if condition out of loop 2020-03-19 12:31:49 +00:00
Keith Cirkel f1bfabac8c
refactor: DRY up buttons.length 2020-03-19 12:30:40 +00:00
Keith Cirkel abafcb6dec
style: drop erroneous console.log 2020-03-19 12:28:41 +00:00
Keith Cirkel 98ed87f243
refactor: DRY up indexOf calls 2020-03-19 12:28:21 +00:00
Keith Cirkel 054b4c36b7
test: add test for generic data-md-button elements 2020-03-19 12:26:31 +00:00
Keith Cirkel 311e8c625e
refactor: move tabIndex assigment to markdown-toolbar
Now markdown-toolbar manages all tabindex assignment, which means it
will also assign tabindexes to `data-md-button` elements, as needed.
2020-03-19 12:19:18 +00:00
Keith Cirkel 538ff34ade
refactor: use md-* selectors where possible
This catches an edge case where if the `md-*` buttons aren't upgraded
before `markdown-toolbar` is, then `markdown-toolbar` will still behave
correctly, as it can still select for the `md-*` buttons.
2020-03-19 12:18:05 +00:00
Keith Cirkel 95b19a50e3
refactor: drop unecessary binding on focusKeydown 2020-03-18 15:06:23 +00:00
Keith Cirkel fa869bdf22
fix: check currentTarget is closest to button invoking keypress
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
2020-03-18 15:01:50 +00:00
Keith Cirkel bf0fde1df3
fix: remove MarkDownButtonElement instance check
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
2020-03-18 15:00:51 +00:00
Keith Cirkel fc01316296
feat: use delegated event listener for keyboard focus
This allows for non-MarkdownButtonElement members to also handle focus
management keyboard shortcuts, as the event binding is per-toolbar not
per-button
2020-03-18 10:44:42 +00:00
Keith Cirkel 72c0c73057
feat: use `data-md-button` to select for focus management
This allows non-MarkdownButtonElement instances to be part of the focus
management cycle
2020-03-18 10:42:32 +00:00
Keith Cirkel 987b5a2a57
test: change example link to button
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
2020-03-18 09:50:11 +00:00
Keith Cirkel a19ded0ff2
feat: add focus management for toolbar
This follows best practices for toolbar focus management, following the
guidelines available at https://www.w3.org/TR/wai-aria-practices-1.1/examples/toolbar/toolbar.html.

ArrowLeft/ArrowRight will switch tabindex/focus the next and previous
buttons respectively, cycling round the whole toolbar if needed. Home
and End keys were also implemented.
2020-03-17 14:50:21 +00:00
Keith Cirkel 4516834531
test: add a focussable link ahead of markdown-toolbar in example 2020-03-17 14:44:56 +00:00
dependabot[bot] f18e9c9815
Bump acorn from 6.1.1 to 6.4.1
Bumps [acorn](https://github.com/acornjs/acorn) from 6.1.1 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.1.1...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-13 22:39:29 +00:00
Kristján Oddsson aea975ea42
1.1.1 2020-01-20 12:42:06 +00:00
Kristján Oddsson 3fc119908a
Merge pull request #28 from github/use-html-element-tag-name-map
Add HTMLElementTagNameMap interface to TypeScript declaration file.
2020-01-20 12:41:14 +00:00
Kristján Oddsson a8a481a40d
'add type to HTMLElementTagNameMap' 2020-01-16 17:07:05 +00:00
Mu-An Chiou fac7fdab8a
Fix closing tag in example page 2019-11-07 16:19:47 -05:00
Kristján Oddsson 60eb1da06e
also fetch library from unpkg on github.com 2019-10-14 10:54:03 +01:00
Kristján Oddsson e7f67b2a9e
1.1.0 2019-09-26 11:46:51 +01:00
Kristján Oddsson 21286dfbbf
Merge pull request #22 from mintbridge/image-button
adding an image button to generate image markdown
2019-09-26 11:26:52 +01:00
Kristján Oddsson c6e4e15940
Merge branch 'master' into image-button 2019-09-26 11:23:23 +01:00
Kristján Oddsson 931dbeb64a
Merge pull request #24 from github/no-more-then-six-levels-of-headers
No more then six levels of headers
2019-09-26 09:55:41 +01:00
Kristján Oddsson 762cdf03ef
check to see if level is less than one
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
2019-09-25 17:14:24 +01:00
Kristján Oddsson 6c77550bfb
Merge branch 'master' into no-more-then-six-levels-of-headers 2019-09-25 11:46:22 +01:00
Kristján Oddsson 0599d0e675
Merge pull request #25 from github/dependabot/npm_and_yarn/eslint-utils-1.4.2
Bump eslint-utils from 1.3.1 to 1.4.2
2019-09-25 11:41:34 +01:00
dependabot[bot] 0fc3ba82bb
Bump eslint-utils from 1.3.1 to 1.4.2
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-25 10:38:49 +00:00
Kristján Oddsson b6d2bce37a
dont render headers above level 6 2019-09-25 11:22:40 +01:00
Kristján Oddsson a000d2b319
add example test from @muan 2019-09-25 11:21:43 +01:00