diff --git a/index.json b/index.json index 1a103b1..c79dfec 100644 --- a/index.json +++ b/index.json @@ -161,6 +161,15 @@ "install": false, "react": false }, + "logcat": { + "version": "0.1.0", + "style": true, + "icon": false, + "test": true, + "install": false, + "react": false, + "dependencies": [] + }, "lrc-player": { "version": "0.1.0", "style": true, diff --git a/src/logcat/README.md b/src/logcat/README.md new file mode 100644 index 0000000..4432c9c --- /dev/null +++ b/src/logcat/README.md @@ -0,0 +1,27 @@ +# Luna Logcat + +Android logcat viewer. + +## Demo + +https://luna.liriliri.io/?path=/story/logcat + +## Install + +Add the following script and style to your page. + +```html + + +``` + +You can also get it on npm. + +```bash +npm install luna-logcat --save +``` + +```javascript +import 'luna-logcat/luna-logcat.css' +import LunaLogcat from 'luna-logcat' +``` diff --git a/src/logcat/index.ts b/src/logcat/index.ts new file mode 100644 index 0000000..f189bec --- /dev/null +++ b/src/logcat/index.ts @@ -0,0 +1,15 @@ +import Component from '../share/Component' +import { exportCjs } from '../share/util' + +/** + * Android logcat viewer. + */ +export default class Logcat extends Component { + constructor(container: HTMLElement) { + super(container, { compName: 'logcat' }) + } +} + +if (typeof module !== 'undefined') { + exportCjs(module, Logcat) +} diff --git a/src/logcat/package.json b/src/logcat/package.json new file mode 100644 index 0000000..044551e --- /dev/null +++ b/src/logcat/package.json @@ -0,0 +1,5 @@ +{ + "name": "logcat", + "version": "0.1.0", + "description": "Android logcat viewer" +} diff --git a/src/logcat/story.js b/src/logcat/story.js new file mode 100644 index 0000000..4021133 --- /dev/null +++ b/src/logcat/story.js @@ -0,0 +1,20 @@ +import 'luna-logcat.css' +import Logcat from 'luna-logcat.js' +import readme from './README.md' +import story from '../share/story' + +const def = story( + 'logcat', + (container) => { + const logcat = new Logcat(container) + + return logcat + }, + { + readme, + story: __STORY__, + } +) + +export default def +export const { logcat } = def diff --git a/src/logcat/style.scss b/src/logcat/style.scss new file mode 100644 index 0000000..e69de29 diff --git a/tsconfig.json b/tsconfig.json index f43a7db..e6d4fd0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -59,7 +59,8 @@ "luna-painter": ["src/painter/index"], "luna-mask-editor": ["src/mask-editor/index"], "luna-image-list": ["src/image-list/index"], - "luna-lrc-player": ["src/lrc-player/index"] + "luna-lrc-player": ["src/lrc-player/index"], + "luna-logcat": ["src/logcat/index"] } } }