Skip to content

Commit

Permalink
feat: add support for keyboard shortcuts
Browse files Browse the repository at this point in the history
- Implemented most of the keyboard shortcuts specified in stdlib-js#26
- Moved shortcuts prop and related methods to client.jsx
- Made sure to not to overlap with the webaim keyboard shortcuts for web accessibility
  • Loading branch information
lovelindhoni committed Mar 18, 2024
1 parent 94b042b commit 9e12970
Show file tree
Hide file tree
Showing 40 changed files with 769 additions and 146 deletions.
2 changes: 1 addition & 1 deletion public/css/docs/bundle.min.css

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions public/css/docs/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -1143,10 +1143,28 @@ h2 {
display: flex;
}

.readme.help h2 {
border-bottom: 0px;
}

.readme.help h1 span {
flex-grow: 1;
}

.readme.help .keyboard-shortcut {
display: flex;
margin-bottom: 2em;
flex-direction: row;
align-items: baseline;
justify-content: space-between;
border-bottom: 2px solid var(--heading-border-bottom-color);

}

.readme.help .keyboard-shortcut-section {
margin-bottom: 5em;
}

/*
* Error decoder.
*/
Expand Down
12 changes: 9 additions & 3 deletions public/css/docs/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,12 @@ a:active {
*/

.readme kbd {
font-size: 0.6875em;
font-size: 1em;
font-family: var(--code-font-family);

color: #555555; /* charcoal */

line-height: 1em;

vertical-align: middle;
}

/*
Expand Down Expand Up @@ -338,6 +336,14 @@ a:active {
color: var(--feedback-error-text-color);
}

/*
* Help page.
*/

.help h1 button.icon-button .icon {
fill: var(--theme-text-color);
}

/*
* Search results.
*/
Expand Down
20 changes: 10 additions & 10 deletions public/docs/api/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"files": {
"main.js": "/docs/api/static/js/main.5625bdaa.chunk.js",
"main.js.map": "/docs/api/static/js/main.5625bdaa.chunk.js.map",
"runtime-main.js": "/docs/api/static/js/runtime-main.28fd50f1.js",
"runtime-main.js.map": "/docs/api/static/js/runtime-main.28fd50f1.js.map",
"static/js/2.ffe93d8f.chunk.js": "/docs/api/static/js/2.ffe93d8f.chunk.js",
"static/js/2.ffe93d8f.chunk.js.map": "/docs/api/static/js/2.ffe93d8f.chunk.js.map",
"main.js": "/docs/api/static/js/main.75fa6181.chunk.js",
"main.js.map": "/docs/api/static/js/main.75fa6181.chunk.js.map",
"runtime-main.js": "/docs/api/static/js/runtime-main.e47de42b.js",
"runtime-main.js.map": "/docs/api/static/js/runtime-main.e47de42b.js.map",
"static/js/2.ff78a71b.chunk.js": "/docs/api/static/js/2.ff78a71b.chunk.js",
"static/js/2.ff78a71b.chunk.js.map": "/docs/api/static/js/2.ff78a71b.chunk.js.map",
"index.html": "/docs/api/index.html",
"precache-manifest.195da204fc2b8a197fca9ceab76bf634.js": "/docs/api/precache-manifest.195da204fc2b8a197fca9ceab76bf634.js",
"precache-manifest.f72410b973cad64595aaf6751bf92855.js": "/docs/api/precache-manifest.f72410b973cad64595aaf6751bf92855.js",
"service-worker.js": "/docs/api/service-worker.js"
},
"entrypoints": [
"static/js/runtime-main.28fd50f1.js",
"static/js/2.ffe93d8f.chunk.js",
"static/js/main.5625bdaa.chunk.js"
"static/js/runtime-main.e47de42b.js",
"static/js/2.ff78a71b.chunk.js",
"static/js/main.75fa6181.chunk.js"
]
}
2 changes: 1 addition & 1 deletion public/docs/api/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en" data-theme="{{ THEME }}"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><title>{{ TITLE }}</title><meta name="description" content="{{ DESCRIPTION }}" data-rh="true"><meta name="author" content="stdlib"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="referrer" content="origin"><link rel="preload" as="font" type="font/woff2" href="/css/common/fonts/lato/latin/LatoLatin-Light.woff2" crossorigin><link rel="preload" as="font" type="font/woff2" href="/css/common/fonts/lato/latin/LatoLatin-LightItalic.woff2" crossorigin><link rel="stylesheet" href="/css/docs/bundle.min.css"><link rel="canonical" href="https://stdlib.io{{ URL }}" data-rh="true"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"><meta name="theme-color" content="#ffffff"><meta property="og:type" content="website"><meta property="og:site_name" content="stdlib"><meta property="og:url" content="https://stdlib.io{{ URL }}" data-rh="true"><meta property="og:title" content="{{ TITLE }}" data-rh="true"><meta property="og:description" content="{{ DESCRIPTION }}" data-rh="true"><meta property="og:locale" content="en_US"><meta property="og:image" content=""><meta name="twitter:card" content="{{ TITLE }}" data-rh="true"><meta name="twitter:site" content="@stdlibjs"><meta name="twitter:url" content="https://stdlib.io{{ URL }}" data-rh="true"><meta name="twitter:title" content="stdlib"><meta name="twitter:description" content="{{ DESCRIPTION }}" data-rh="true"><meta name="twitter:image" content=""><style id="mui-ssr-styles"></style></head><body><noscript>Please enable JavaScript in order to run this web application.</noscript><div class="skip-links" role="navigation" aria-label="Skip links pre nav"><a class="skip-link" href="#main">Skip to main content</a> <a class="skip-link" href="#top-nav-search">Skip to search</a> <a class="skip-link" href="#top-nav-package-menu">Skip to top navigation</a> <a class="skip-link" href="#side-menu-list">Skip to package tree</a> <a class="skip-link" href="#bottom-nav">Skip to bottom navigation</a></div><div id="root"></div><script type="text/javascript">!function(){var t,a,e,n,o,r=/Windows.+?(?=;)/g,s=/Firefox\/(\d+)/,c=/MSIE|Trident/i,g=["Windows NT 6.1","Windows NT 6.2","Windows NT 6.3"];!1===function(){"use strict";var t,a,e,n,o,i;return e={0:!1,1:!0},a=navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack,i=navigator.userAgent,!((o=c.test(i))&&"function"!=typeof Array.prototype.indexOf||(n=i.match(s))&&parseInt(n[1],10)<32||(t=i.match(r),o&&t&&-1!==g.indexOf(t[0])||void 0===e[a]))}()&&(t=window,a=document,e="script","ga",t.GoogleAnalyticsObject="ga",t.ga=t.ga||function(){(t.ga.q=t.ga.q||[]).push(arguments)},t.ga.l=1*new Date,n=a.createElement(e),o=a.getElementsByTagName(e)[0],n.async=1,n.src="https://www.google-analytics.com/analytics.js",o.parentNode.insertBefore(n,o),ga("create","UA-105890493-1","auto"),ga("send","pageview"))}()</script><script type="text/javascript">window.gitter={chat:{options:{disableDefaultChat:!0}}}</script><script>!function(a){function e(e){for(var t,r,n=e[0],o=e[1],u=e[2],i=0,l=[];i<n.length;i++)r=n[i],Object.prototype.hasOwnProperty.call(p,r)&&p[r]&&l.push(p[r][0]),p[r]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(a[t]=o[t]);for(s&&s(e);l.length;)l.shift()();return c.push.apply(c,u||[]),f()}function f(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var u=r[o];0!==p[u]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var r={},p={1:0},c=[];function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return a[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=a,i.c=r,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/docs/api/";var t=this["webpackJsonp@stdlib/website"]=this["webpackJsonp@stdlib/website"]||[],n=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var s=n;f()}([])</script><script src="/docs/api/static/js/2.ffe93d8f.chunk.js"></script><script src="/docs/api/static/js/main.5625bdaa.chunk.js"></script></body></html>
<!doctype html><html lang="en" data-theme="{{ THEME }}"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><title>{{ TITLE }}</title><meta name="description" content="{{ DESCRIPTION }}" data-rh="true"><meta name="author" content="stdlib"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="referrer" content="origin"><link rel="preload" as="font" type="font/woff2" href="/css/common/fonts/lato/latin/LatoLatin-Light.woff2" crossorigin><link rel="preload" as="font" type="font/woff2" href="/css/common/fonts/lato/latin/LatoLatin-LightItalic.woff2" crossorigin><link rel="stylesheet" href="/css/docs/bundle.min.css"><link rel="canonical" href="https://stdlib.io{{ URL }}" data-rh="true"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"><meta name="theme-color" content="#ffffff"><meta property="og:type" content="website"><meta property="og:site_name" content="stdlib"><meta property="og:url" content="https://stdlib.io{{ URL }}" data-rh="true"><meta property="og:title" content="{{ TITLE }}" data-rh="true"><meta property="og:description" content="{{ DESCRIPTION }}" data-rh="true"><meta property="og:locale" content="en_US"><meta property="og:image" content=""><meta name="twitter:card" content="{{ TITLE }}" data-rh="true"><meta name="twitter:site" content="@stdlibjs"><meta name="twitter:url" content="https://stdlib.io{{ URL }}" data-rh="true"><meta name="twitter:title" content="stdlib"><meta name="twitter:description" content="{{ DESCRIPTION }}" data-rh="true"><meta name="twitter:image" content=""><style id="mui-ssr-styles"></style></head><body><noscript>Please enable JavaScript in order to run this web application.</noscript><div class="skip-links" role="navigation" aria-label="Skip links pre nav"><a class="skip-link" href="#main">Skip to main content</a> <a class="skip-link" href="#top-nav-search">Skip to search</a> <a class="skip-link" href="#top-nav-package-menu">Skip to top navigation</a> <a class="skip-link" href="#side-menu-list">Skip to package tree</a> <a class="skip-link" href="#bottom-nav">Skip to bottom navigation</a></div><div id="root"></div><script type="text/javascript">!function(){var t,a,e,n,o,r=/Windows.+?(?=;)/g,s=/Firefox\/(\d+)/,c=/MSIE|Trident/i,g=["Windows NT 6.1","Windows NT 6.2","Windows NT 6.3"];!1===function(){"use strict";var t,a,e,n,o,i;return e={0:!1,1:!0},a=navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack,i=navigator.userAgent,!((o=c.test(i))&&"function"!=typeof Array.prototype.indexOf||(n=i.match(s))&&parseInt(n[1],10)<32||(t=i.match(r),o&&t&&-1!==g.indexOf(t[0])||void 0===e[a]))}()&&(t=window,a=document,e="script","ga",t.GoogleAnalyticsObject="ga",t.ga=t.ga||function(){(t.ga.q=t.ga.q||[]).push(arguments)},t.ga.l=1*new Date,n=a.createElement(e),o=a.getElementsByTagName(e)[0],n.async=1,n.src="https://www.google-analytics.com/analytics.js",o.parentNode.insertBefore(n,o),ga("create","UA-105890493-1","auto"),ga("send","pageview"))}()</script><script type="text/javascript">window.gitter={chat:{options:{disableDefaultChat:!0}}}</script><script>!function(a){function e(e){for(var t,r,n=e[0],o=e[1],u=e[2],i=0,l=[];i<n.length;i++)r=n[i],Object.prototype.hasOwnProperty.call(p,r)&&p[r]&&l.push(p[r][0]),p[r]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(a[t]=o[t]);for(s&&s(e);l.length;)l.shift()();return c.push.apply(c,u||[]),f()}function f(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var u=r[o];0!==p[u]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var r={},p={1:0},c=[];function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return a[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=a,i.c=r,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/docs/api/";var t=this["webpackJsonp@stdlib/website"]=this["webpackJsonp@stdlib/website"]||[],n=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var s=n;f()}([])</script><script src="/docs/api/static/js/2.ff78a71b.chunk.js"></script><script src="/docs/api/static/js/main.75fa6181.chunk.js"></script></body></html>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "29d33a31af5424096cd8c910c8e9b7ea",
"url": "/docs/api/index.html"
},
{
"revision": "1da66eb79ba54f3ecf3c",
"url": "/docs/api/static/js/2.ff78a71b.chunk.js"
},
{
"revision": "ed562178dc2da21e9a22",
"url": "/docs/api/static/js/main.75fa6181.chunk.js"
},
{
"revision": "64efee63e311d08b732e",
"url": "/docs/api/static/js/runtime-main.e47de42b.js"
}
]);
2 changes: 1 addition & 1 deletion public/docs/api/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"/docs/api/precache-manifest.195da204fc2b8a197fca9ceab76bf634.js"
"/docs/api/precache-manifest.f72410b973cad64595aaf6751bf92855.js"
);

self.addEventListener('message', (event) => {
Expand Down
2 changes: 2 additions & 0 deletions public/docs/api/static/js/2.ff78a71b.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/docs/api/static/js/2.ff78a71b.chunk.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions public/docs/api/static/js/2.ffe93d8f.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion public/docs/api/static/js/2.ffe93d8f.chunk.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions public/docs/api/static/js/main.5625bdaa.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion public/docs/api/static/js/main.5625bdaa.chunk.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions public/docs/api/static/js/main.75fa6181.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/docs/api/static/js/main.75fa6181.chunk.js.map

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9e12970

Please sign in to comment.