diff --git a/clean-scripts.config.js b/clean-scripts.config.js index 0589727..2bd614e 100644 --- a/clean-scripts.config.js +++ b/clean-scripts.config.js @@ -29,15 +29,17 @@ module.exports = { const { createServer } = require('http-server') const puppeteer = require('puppeteer') const fs = require('fs') + const beautify = require('js-beautify').html const server = createServer() server.listen(8000) const browser = await puppeteer.launch() const page = await browser.newPage() + await page.emulate({ viewport: { width: 1440, height: 900 }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36' }) for (const type of ['vue', 'react', 'angular']) { await page.goto(`http://localhost:8000/demo/${type}`) await page.screenshot({ path: `demo/${type}/screenshot.png`, fullPage: true }) const content = await page.content() - fs.writeFileSync(`demo/${type}/screenshot-src.html`, content) + fs.writeFileSync(`demo/${type}/screenshot-src.html`, beautify(content)) } server.close() browser.close() diff --git a/demo/angular/screenshot-src.html b/demo/angular/screenshot-src.html index 32756c4..1525d8c 100644 --- a/demo/angular/screenshot-src.html +++ b/demo/angular/screenshot-src.html @@ -1,44 +1,819 @@ - - - - Fork me on GitHub - + + - -
- the source code of the demo -
- default: - - selected id: -
- checkbox: - -
- draggable: - -
- no dots: - -
- large: - -
- small: - -
- dark theme: - -
- node id: - -
+ + + + + +Fork me on GitHub + + + +
+ the source code of the demo +
default: + +
+ +
+
+ selected id: +
checkbox: + +
+ +
+
+
draggable: + +
+ +
+
+
no dots: + +
+ +
+
+
large: + +
+ +
+
+
small: + +
+ +
+
+
dark theme: + +
+ +
+
+
node id: + +
+ +
+
+
- - \ No newline at end of file + + + + \ No newline at end of file diff --git a/demo/angular/screenshot.png b/demo/angular/screenshot.png index be1fb2e..e17edf2 100644 Binary files a/demo/angular/screenshot.png and b/demo/angular/screenshot.png differ diff --git a/demo/react/screenshot-src.html b/demo/react/screenshot-src.html index a989d01..236685f 100644 --- a/demo/react/screenshot-src.html +++ b/demo/react/screenshot-src.html @@ -1,15 +1,359 @@ - - - - Fork me on GitHub - - -
the source code of the demo
default:selected id:
checkbox:
draggable:
no dots:
large:
small:
dark theme:
contextmenu:
node id:
- - \ No newline at end of file + + + + + + + + +Fork me on GitHub + + +
+
the source code of the demo
+ default: + +
+ +
+ selected id: + +
+ checkbox: + +
+ +
+
+ draggable: + +
+ +
+
+ no dots: + +
+ +
+
+ large: + +
+ +
+
+ small: + +
+ +
+
+ dark theme: + +
+ +
+
+ contextmenu: + +
+ +
+
+ node id: + +
+ +
+
+
+ + + + \ No newline at end of file diff --git a/demo/react/screenshot.png b/demo/react/screenshot.png index 1328048..9135b90 100644 Binary files a/demo/react/screenshot.png and b/demo/react/screenshot.png differ diff --git a/demo/vue/screenshot-src.html b/demo/vue/screenshot-src.html index 6d2c63e..93b9857 100644 --- a/demo/vue/screenshot-src.html +++ b/demo/vue/screenshot-src.html @@ -1,35 +1,533 @@ - - - - Fork me on GitHub - + + -
the source code of the demo
- default: - - selected id: -
- checkbox: -
- draggable: -
- no dots: -
- large: -
- small: -
- dark theme: -
- contextmenu: -
- node id: -
- - \ No newline at end of file + + + + + +Fork me on GitHub + + +
the source code of the demo
default: + + selected id: +
checkbox: +
+ +
+
draggable: + +
no dots: + +
large: + +
small: + +
dark theme: +
+ +
+
contextmenu: +
node id: + +
+ + + + \ No newline at end of file diff --git a/demo/vue/screenshot.png b/demo/vue/screenshot.png index 91ddc4e..1d10285 100644 Binary files a/demo/vue/screenshot.png and b/demo/vue/screenshot.png differ diff --git a/package-lock.json b/package-lock.json index de8018f..0a62a8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -174,6 +174,12 @@ "@types/react": "15.6.0" } }, + "abbrev": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", + "dev": true + }, "accepts": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", @@ -1113,6 +1119,16 @@ } } }, + "config-chain": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz", + "integrity": "sha1-q6CXR9++TD5w52am5BWG4YWfxvI=", + "dev": true, + "requires": { + "ini": "1.3.4", + "proto-list": "1.2.4" + } + }, "connect": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.2.tgz", @@ -1565,6 +1581,30 @@ "url-join": "2.0.2" } }, + "editorconfig": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.13.3.tgz", + "integrity": "sha512-WkjsUNVCu+ITKDj73QDvi0trvpdDWdkDyHybDGSXPfekLCqwmpD7CP7iPbvBgosNuLcI96XTDwNa75JyFl7tEQ==", + "dev": true, + "requires": { + "bluebird": "3.5.0", + "commander": "2.9.0", + "lru-cache": "3.2.0", + "semver": "5.3.0", + "sigmund": "1.0.1" + }, + "dependencies": { + "lru-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", + "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", + "dev": true, + "requires": { + "pseudomap": "1.0.2" + } + } + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -3929,6 +3969,12 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "ini": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true + }, "inquirer": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", @@ -4286,6 +4332,18 @@ "integrity": "sha1-8OgK4DmkvWVLXygfyT8EqRSn/M4=", "dev": true }, + "js-beautify": { + "version": "1.6.14", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.6.14.tgz", + "integrity": "sha1-07j3Mi0CuSd9WL0jgmTDJ+WARM0=", + "dev": true, + "requires": { + "config-chain": "1.1.11", + "editorconfig": "0.13.3", + "mkdirp": "0.5.1", + "nopt": "3.0.6" + } + }, "js-tokens": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz", @@ -4989,6 +5047,15 @@ "vm-browserify": "0.0.4" } }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1.1.0" + } + }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -5668,6 +5735,12 @@ "loose-envify": "1.3.1" } }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true + }, "protobufjs": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.0.tgz", @@ -6319,6 +6392,12 @@ "rechoir": "0.6.2" } }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", diff --git a/package.json b/package.json index 42988b4..0bd56f0 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "http-server": "0.10.0", "image2base64-cli": "2.1.0", "jasmine": "2.7.0", + "js-beautify": "1.6.14", "karma": "1.7.0", "karma-chrome-launcher": "2.2.0", "karma-firefox-launcher": "1.0.1", diff --git a/tslint.json b/tslint.json index ca1bdf1..555b26f 100644 --- a/tslint.json +++ b/tslint.json @@ -25,6 +25,7 @@ "no-unused-expression": [ true, "allow-new" - ] + ], + "no-submodule-imports": false } } \ No newline at end of file