chore: Update kkt to v5.8.0

pull/183/head
jaywcjlove 5 years ago
parent 2ac5e4e0a0
commit 5bbf8ac3a5

@ -1,7 +1,8 @@
import path from 'path'; import path from 'path';
export const loaderOneOf = [ export const loaderOneOf = [
require.resolve('@kkt/loader-less') require.resolve('@kkt/loader-less'),
require.resolve('@kkt/loader-raw')
]; ];
export const moduleScopePluginOpts = [ export const moduleScopePluginOpts = [
@ -11,16 +12,6 @@ export const moduleScopePluginOpts = [
export default (conf, opts, webpack) => { export default (conf, opts, webpack) => {
conf.output.path = path.resolve(process.cwd(), 'doc'); conf.output.path = path.resolve(process.cwd(), 'doc');
const pkg = require(path.resolve(process.cwd(), 'package.json')); const pkg = require(path.resolve(process.cwd(), 'package.json'));
// Webpack parses md file text
conf.module.rules.map((item) => {
if (item.oneOf) {
item.oneOf.unshift({
test: /\.md$/,
use: require.resolve('raw-loader'),
});
}
return item;
});
// Get the project version. // Get the project version.
conf.plugins.push( conf.plugins.push(

@ -6,7 +6,7 @@
HotKeys.js is an input capture library with some very special features, it is easy to pick up and use, has a reasonable footprint ([~3kb](https://bundlephobia.com/result?p=hotkeys-js)) (gzipped: 1.73kb), and has no dependencies. It should not interfere with any JavaScript libraries or frameworks. Official document [demo preview](http://jaywcjlove.github.io/hotkeys). [More examples](https://github.com/jaywcjlove/hotkeys/issues?q=label%3ADemo+). HotKeys.js is an input capture library with some very special features, it is easy to pick up and use, has a reasonable footprint ([~3kb](https://bundlephobia.com/result?p=hotkeys-js)) (gzipped: 1.73kb), and has no dependencies. It should not interfere with any JavaScript libraries or frameworks. Official document [demo preview](http://jaywcjlove.github.io/hotkeys). [More examples](https://github.com/jaywcjlove/hotkeys/issues?q=label%3ADemo+).
```shell ```bash
╭┈┈╮ ╭┈┈╮ ╭┈┈╮ ╭┈┈╮ ╭┈┈╮ ╭┈┈╮
┆ ├┈┈..┈┈┈┈┈.┆ └┈╮┆ ├┈┈..┈┈┈┈┈..┈┈.┈┈..┈┈┈┈┈. ┆ ├┈┈..┈┈┈┈┈.┆ └┈╮┆ ├┈┈..┈┈┈┈┈..┈┈.┈┈..┈┈┈┈┈.
┆ ┆┆ □ ┆┆ ┈┤┆ < ┆ -__┘┆ ┆ ┆┆__ ┈┈┤ ┆ ┆┆ □ ┆┆ ┈┤┆ < ┆ -__┘┆ ┆ ┆┆__ ┈┈┤
@ -18,7 +18,7 @@ HotKeys.js is an input capture library with some very special features, it is ea
You will need `Node.js` installed on your system. You will need `Node.js` installed on your system.
```shell ```bash
$ npm install hotkeys-js --save $ npm install hotkeys-js --save
``` ```

8101
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -49,8 +49,10 @@
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"@kkt/loader-less": "5.6.1", "@kkt/loader-less": "5.8.0",
"@kkt/loader-raw": "5.8.0",
"@uiw/react-github-corners": "1.1.3", "@uiw/react-github-corners": "1.1.3",
"@uiw/react-markdown-preview": "^1.0.3",
"@uiw/react-shields": "1.1.0", "@uiw/react-shields": "1.1.0",
"@uiw/reset.css": "1.0.3", "@uiw/reset.css": "1.0.3",
"babel-eslint": "10.1.0", "babel-eslint": "10.1.0",
@ -64,16 +66,12 @@
"eslint-plugin-jsx-a11y": "6.2.3", "eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.19.0", "eslint-plugin-react": "7.19.0",
"gh-pages": "2.2.0", "gh-pages": "2.2.0",
"highlight.js": "9.18.1",
"husky": "4.2.3", "husky": "4.2.3",
"jest": "25.2.7", "jest": "25.2.7",
"kkt": "5.6.1", "kkt": "5.8.0",
"less": "3.11.1",
"puppeteer": "2.1.1", "puppeteer": "2.1.1",
"raw-loader": "4.0.0",
"react": "16.13.1", "react": "16.13.1",
"react-dom": "16.13.1", "react-dom": "16.13.1",
"react-markdown": "4.3.1",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"rollup": "2.3.2", "rollup": "2.3.2",
"rollup-plugin-babel": "4.4.0", "rollup-plugin-babel": "4.4.0",

@ -5,6 +5,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>hotkeys.js - A robust Javascript library for capturing keyboard input.</title> <title>hotkeys.js - A robust Javascript library for capturing keyboard input.</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="hotkey,hotkeys,hotkeysjs,key,keys,keyboard,shortcuts,keypress" />
<meta name="description" content="A robust Javascript library for capturing keyboard input and key combinations entered. It has no dependencies. Try to press your keyboard, The following button will highlight."> <meta name="description" content="A robust Javascript library for capturing keyboard input and key combinations entered. It has no dependencies. Try to press your keyboard, The following button will highlight.">
</head> </head>

@ -1,9 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import GithubCorner from '@uiw/react-github-corners'; import GithubCorner from '@uiw/react-github-corners';
import { Github } from '@uiw/react-shields'; import { Github } from '@uiw/react-shields';
import MarkdownPreview from '@uiw/react-markdown-preview';
import KeyBoard from './components/KeyBoard'; import KeyBoard from './components/KeyBoard';
import Footer from './components/Footer'; import Footer from './components/Footer';
import Markdown from './components/Markdown';
import styles from './styles/index.module.less'; import styles from './styles/index.module.less';
import DocumentStr from '../README.md'; import DocumentStr from '../README.md';
import hotkeys from '..'; import hotkeys from '..';
@ -128,7 +128,7 @@ export default class App extends Component {
onMouseUp={this.onKeyBoardMouseUp.bind(this)} onMouseUp={this.onKeyBoardMouseUp.bind(this)}
keyCode={keyCode} keyCode={keyCode}
/> />
<Markdown source={DocumentStrSource} /> <MarkdownPreview style={{ maxWidth: 995, margin: '0 auto' }} source={DocumentStrSource} />
<Footer name="Kenny Wong" href="http://jaywcjlove.github.io" year="2015-present"> <Footer name="Kenny Wong" href="http://jaywcjlove.github.io" year="2015-present">
<Github user="jaywcjlove" repo="hotkeys"> <Github user="jaywcjlove" repo="hotkeys">
<Github.Social href="https://github.com/jaywcjlove/hotkeys" type="forks" /> <Github.Social href="https://github.com/jaywcjlove/hotkeys" type="forks" />

@ -1,44 +0,0 @@
import React, { Component } from 'react';
import ReactMarkdown from 'react-markdown';
import hljs from 'highlight.js';
import classNames from 'classnames';
import styles from './styles/index.module.less';
hljs.configure({
tabReplace: ' ', // 2 spaces
classPrefix: '', // don't append class prefix
});
export default class Markdown extends Component {
componentDidMount() {
const code = this.node.getElementsByTagName('code');
for (let i = 0; i < code.length; i += 1) {
if (code[i].parentNode && code[i].parentNode.tagName === 'PRE') {
hljs.highlightBlock(code[i]);
}
}
}
render() {
const { source } = this.props;
return (
<div ref={(node) => { this.node = node; }}>
<ReactMarkdown
className={classNames(styles.markdown, 'markdown')}
source={source}
escapeHtml={false}
allowNode={(node) => {
if (node.type === 'html') {
if (/<!--([^]+?)-->/.test(node.value)) return false;
// const scriptValue = node.value.match(/<script.*?>(.*?)<\/script>/ig);
// node.value.replace(/<script.*?>(.*?)<\/script>/, (te) => {
// console.log('te:', te);
// });
}
return node;
}}
/>
</div>
);
}
}

@ -1,227 +0,0 @@
code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
word-wrap: normal;
}
code:not(.hljs){
padding: 0.2em 0.4em 0.08em 0.4em;
margin: 0;
font-size: 85%;
background-color: rgba(27, 31, 35, 0.07);
border-radius: 3px;
}
// code.hljs {
// padding: 16px;
// font-size: 95%;
// line-height: 1.5;
// display: block;
// text-shadow: 0 1px #fff;
// }
pre code {
padding: 16px;
font-size: 95%;
line-height: 1.5;
display: block;
text-shadow: 0 1px #fff;
}
pre {
margin-bottom: 18px;
max-height: 35em;
position: relative;
overflow: auto;
background-color: #F0F0F0;
border-radius: 3px;
}
del {
color: #888;
}
pre code {
background: none;
font-size: 1em;
overflow-wrap: normal;
white-space: inherit;
}
ul, li, ol, dl, dt {
list-style: inherit;
}
ul, ol {
padding-left: 2em;
}
dl {
padding: 0;
dt {
padding: 0;
margin-top: 16px;
font-size: 14px;
font-style: italic;
font-weight: 600;
}
}
li + li {
margin-top: 3px;
}
a {
color: #0366d6;
}
p, ol, ul {
margin-bottom: 16px;
}
li {
display: list-item;
}
table {
margin-bottom: 16px;
}
blockquote {
margin: 0;
padding: 0 1em;
margin-bottom: 10px;
color: #6a737d;
border-left: 0.25em solid #dfe2e5;
& >:first-child {
margin-top: 0;
}
& >:last-child {
margin-bottom: 0;
}
}
hr {
height: 0.25em;
padding: 0;
margin: 24px 0;
background-color: #e1e4e8;
border: 0;
}
h1 tt,h1 code,h2 tt,h2 code,h3 tt,h3 code,h4 tt,h4 code,h5 tt,h5 code,h6 tt,h6 code {
font-size: inherit
}
h1 {
padding-bottom: 0.3em;
font-size: 2em;
border-bottom: 1px solid #cecece;
margin-bottom: 10px;
}
h2 {
margin-bottom: 10px;
padding-bottom: 0.3em;
font-size: 1.5em;
border-bottom: 1px solid #cecece;
}
h3 {
margin-bottom: 10px;
font-size: 1.25em
}
h4 {
margin-bottom: 8px;
font-size: 1em
}
h5 {
margin-bottom: 8px;
font-size: 0.875em
}
h6 {
margin-bottom: 5px;
font-size: 0.85em;
color: #6a737d
}
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
display: block;
width: 100%;
}
table th {
font-weight: 600;
}
table th,table td {
padding: 6px 13px;
border: 1px solid #dfe2e5;
}
table tr {
background-color: #fff;
border-top: 1px solid #c6cbd1;
}
table tr:nth-child(2n) {
background-color: #f6f8fa;
}
table img {
background-color: transparent;
}
img {
max-width: 100%;
box-sizing: content-box;
vertical-align: middle;
}
img[align=right] {
padding-left: 20px;
}
img[align=left] {
padding-right: 20px;
}
.comment,.quote{
color:#998;
}
.keyword,.selector-tag,.subst{
color:#333;font-weight:bold;
}
.number,.literal,.variable,.template-variable,.tag .attr{
color:#008080;
}
.string,.doctag{
color:#d14;
}
.title,.section,.selector-id{
color:#900;font-weight:bold;
}
.subst{
font-weight:normal;
}
.type,.class .title{
color:#458;font-weight:bold;
}
.tag,.name,.attribute{
color:#000098;
font-weight:normal;
}
.regexp,.link{
color:#009926;
}
.symbol,.bullet{
color:#990073;
}
.built_in,.builtin-name{
color:#0086b3;
}
.meta{
color:#999;font-weight:bold;
}
.deletion{
background:#fdd;
}
.addition{
background:#dfd;
}
.emphasis{
font-style:italic;
}
.strong{
font-weight:bold;
}

@ -1,25 +0,0 @@
.markdown {
padding: 0 20px 20px;
max-width: 995px;
margin: 0 auto;
font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
font-size: 14px;
line-height: 1.5;
word-wrap: break-word;
color: #24292e;
& >*:first-child {
margin-top: 0 !important
}
& >*:last-child {
margin-bottom: 0 !important
}
:global {
@import "./default.less";
// @import "./xml.less";
// @import "./swift.less";
// @import "./diff.less";
// @import "./css.less";
@import "./javascript.less";
}
}

@ -1,34 +0,0 @@
.language-jsx, .language-js,.language-javascript{
.keyword, .selector-tag {
color: #b111bf;
font-weight: 600;
}
.subst {
color: #0000ca;
}
.title, .section {
color: #4e00dc;
font-weight: normal;
}
.string, .doctag {
color: #d73a49;
}
.attr {
color: #0000ca;
}
.class .keyword{
color: #008cd4;
}
.function {
color: #0000ca;
.params {
color: #008cd4;
}
}
}
.language-json {
color: #444;
.attr {
color: #0000ca;
}
}
Loading…
Cancel
Save