watermark-js-plus 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -1
- package/package.json +22 -10
- package/.editorconfig +0 -16
- package/.eslintignore +0 -7
- package/.eslintrc.cjs +0 -46
- package/.github/workflows/deploy.yml +0 -29
- package/.github/workflows/npm-publish.yml +0 -32
- package/.husky/commit-msg +0 -4
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -10
- package/CHANGELOG.md +0 -9
- package/babel.config.cjs +0 -23
- package/changelog-option.cjs +0 -87
- package/commitlint.config.cjs +0 -26
- package/docs/.vitepress/config.ts +0 -91
- package/docs/.vitepress/locales/zh-CN.ts +0 -49
- package/docs/.vitepress/theme/index.ts +0 -12
- package/docs/config/blind-decode.md +0 -33
- package/docs/config/blind.md +0 -19
- package/docs/config/index.md +0 -178
- package/docs/guide/blind-watermark.md +0 -267
- package/docs/guide/getting-started.md +0 -73
- package/docs/guide/watermark.md +0 -213
- package/docs/guide/what-is-this.md +0 -19
- package/docs/index.md +0 -33
- package/docs/public/logo.png +0 -0
- package/docs/zh/config/blind-decode.md +0 -33
- package/docs/zh/config/blind.md +0 -19
- package/docs/zh/config/index.md +0 -178
- package/docs/zh/guide/blink-watermark.md +0 -288
- package/docs/zh/guide/getting-started.md +0 -48
- package/docs/zh/guide/watermark.md +0 -213
- package/docs/zh/guide/what-is-this.md +0 -19
- package/docs/zh/index.md +0 -33
- package/rollup.config.mjs +0 -40
- package/src/blind.ts +0 -43
- package/src/index.ts +0 -7
- package/src/types/index.ts +0 -69
- package/src/utils/index.ts +0 -63
- package/src/watermark.ts +0 -288
- package/tools/terser.js +0 -19
- package/tsconfig.json +0 -15
package/README.md
CHANGED
|
@@ -1 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://zhensherlock.github.io/watermark-js-plus/" target="_blank" rel="noopener noreferrer">
|
|
3
|
+
<img width="300" src="https://zhensherlock.github.io/watermark-js-plus/hero-image.png" alt="watermark logo">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://npmjs.com/package/pinia"><img src="https://badgen.net/npm/v/pinia" alt="npm package"></a>
|
|
8
|
+
<a href="https://github.com/vuejs/pinia/actions/workflows/test.yml?query=branch%3Av2"><img src="https://github.com/vuejs/pinia/workflows/test/badge.svg?branch=v2" alt="build status"></a>
|
|
9
|
+
<a href="https://codecov.io/github/vuejs/pinia"><img src="https://badgen.net/codecov/c/github/vuejs/pinia/v2" alt="code coverage"></a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
# Watermark
|
|
13
|
+
|
|
14
|
+
> This is a *canvas-based* watermark for browser.
|
|
15
|
+
|
|
16
|
+
- 🛠️ Rich Features
|
|
17
|
+
- 🔑 Fully Typed APIs
|
|
18
|
+
- 📦️ Extremely light
|
|
19
|
+
|
|
20
|
+
Watermark works with both Vue 2 , Vue 3 And React.
|
|
21
|
+
|
|
22
|
+
# Translations
|
|
23
|
+
|
|
24
|
+
* [中文文档](README_zh.md)
|
|
25
|
+
|
|
26
|
+
## Installing
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# or pnpm or yarn
|
|
30
|
+
npm install watermark-js-plus
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
### Watermark
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { Watermark } from 'watermark-js-plus'
|
|
39
|
+
|
|
40
|
+
const watermark = new Watermark({
|
|
41
|
+
content: 'hello my watermark',
|
|
42
|
+
width: 200,
|
|
43
|
+
height: 200,
|
|
44
|
+
onSuccess: () => {
|
|
45
|
+
// success callback
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
watermark.create()
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Blind Watermark
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { BlindWatermark } from 'watermark-js-plus'
|
|
56
|
+
|
|
57
|
+
const watermark = new BlindWatermark({
|
|
58
|
+
content: 'hello my watermark',
|
|
59
|
+
width: 200,
|
|
60
|
+
height: 200,
|
|
61
|
+
onSuccess: () => {
|
|
62
|
+
// success callback
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
watermark.create()
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Decode Blind Watermark
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
import { BlindWatermark } from 'watermark-js-plus'
|
|
73
|
+
|
|
74
|
+
BlindWatermark.decode({
|
|
75
|
+
url: uploadFile.url, // image url
|
|
76
|
+
onSuccess: (imageBase64) => {
|
|
77
|
+
// success callback
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Documentation
|
|
83
|
+
|
|
84
|
+
To learn more, check [its documentation](https://zhensherlock.github.io/watermark-js-plus).
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
[MIT](LICENSE).
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "watermark-js-plus",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "watermark for the browser",
|
|
5
|
-
"main": "lib/watermark.js",
|
|
6
5
|
"type": "module",
|
|
7
6
|
"scripts": {
|
|
8
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
8
|
"prepare": "husky install",
|
|
10
9
|
"lint": "npx eslint \"src/*.{ts,js}\"",
|
|
11
10
|
"dev": "concurrently \"npm run src:dev\" \"npm run docs:dev\"",
|
|
12
|
-
"src:dev": "rollup -c --watch",
|
|
13
|
-
"build": "rollup -c --environment NODE_ENV:production
|
|
11
|
+
"src:dev": "rollup -c --watch --bundleConfigAsCjs",
|
|
12
|
+
"build": "rollup -c --bundleConfigAsCjs --environment NODE_ENV:production",
|
|
14
13
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 -n changelog-option.cjs",
|
|
15
14
|
"docs:dev": "vitepress dev docs",
|
|
16
15
|
"docs:build": "vitepress build docs",
|
|
@@ -37,6 +36,19 @@
|
|
|
37
36
|
"防删除水印",
|
|
38
37
|
"解密水印"
|
|
39
38
|
],
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"types": "./dist/index.js",
|
|
42
|
+
"require": "./dist/index.js",
|
|
43
|
+
"import": "./dist/index.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"main": "dist/index.js",
|
|
47
|
+
"module": "dist/index.js",
|
|
48
|
+
"types": "dist/index.js",
|
|
49
|
+
"files": [
|
|
50
|
+
"dist"
|
|
51
|
+
],
|
|
40
52
|
"devDependencies": {
|
|
41
53
|
"@babel/core": "^7.20.5",
|
|
42
54
|
"@babel/eslint-parser": "^7.19.1",
|
|
@@ -46,14 +58,14 @@
|
|
|
46
58
|
"@commitlint/config-conventional": "^17.3.0",
|
|
47
59
|
"@element-plus/icons-vue": "^2.0.10",
|
|
48
60
|
"@rollup/plugin-babel": "^6.0.3",
|
|
49
|
-
"@rollup/plugin-commonjs": "^23.0.
|
|
61
|
+
"@rollup/plugin-commonjs": "^23.0.4",
|
|
50
62
|
"@rollup/plugin-eslint": "^9.0.1",
|
|
51
63
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
52
64
|
"@rollup/plugin-replace": "^5.0.1",
|
|
53
|
-
"@rollup/plugin-terser": "^0.
|
|
65
|
+
"@rollup/plugin-terser": "^0.2.0",
|
|
54
66
|
"@rollup/plugin-typescript": "^10.0.1",
|
|
55
67
|
"@types/markdown-it": "^12.2.3",
|
|
56
|
-
"@typescript-eslint/parser": "^5.45.
|
|
68
|
+
"@typescript-eslint/parser": "^5.45.1",
|
|
57
69
|
"@vue/theme": "^1.3.0",
|
|
58
70
|
"concurrently": "^7.6.0",
|
|
59
71
|
"conventional-changelog-angular": "^5.0.13",
|
|
@@ -67,12 +79,12 @@
|
|
|
67
79
|
"husky": "^8.0.2",
|
|
68
80
|
"lint-staged": "^13.1.0",
|
|
69
81
|
"markdown-it": "^13.0.1",
|
|
70
|
-
"rollup": "^3.
|
|
82
|
+
"rollup": "^3.7.0",
|
|
71
83
|
"rollup-plugin-filesize": "^9.1.2",
|
|
72
84
|
"rollup-plugin-your-function": "^0.4.3",
|
|
73
85
|
"terser": "^5.16.1",
|
|
74
|
-
"typescript": "^4.9.
|
|
86
|
+
"typescript": "^4.9.4",
|
|
75
87
|
"unplugin-element-plus": "^0.4.1",
|
|
76
|
-
"vitepress": "^1.0.0-alpha.
|
|
88
|
+
"vitepress": "^1.0.0-alpha.30"
|
|
77
89
|
}
|
|
78
90
|
}
|
package/.editorconfig
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# http://editorconfig.org
|
|
2
|
-
root = true
|
|
3
|
-
|
|
4
|
-
[*]
|
|
5
|
-
indent_style = space
|
|
6
|
-
indent_size = 2
|
|
7
|
-
end_of_line = lf
|
|
8
|
-
charset = utf-8
|
|
9
|
-
trim_trailing_whitespace = true
|
|
10
|
-
insert_final_newline = true
|
|
11
|
-
|
|
12
|
-
[*.md]
|
|
13
|
-
trim_trailing_whitespace = false
|
|
14
|
-
|
|
15
|
-
[Makefile]
|
|
16
|
-
indent_style = tab
|
package/.eslintignore
DELETED
package/.eslintrc.cjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser', // 解析器,默认使用Espree
|
|
3
|
-
env: { // 指定脚本的运行环境。每种环境都有一组特定的预定义全局变量。
|
|
4
|
-
browser: true, // 运行在浏览器
|
|
5
|
-
es2021: true, // 支持es2021
|
|
6
|
-
es6: true,
|
|
7
|
-
},
|
|
8
|
-
extends: [ // 使用的外部代码格式化配置文件
|
|
9
|
-
'semistandard',
|
|
10
|
-
'plugin:import/recommended'
|
|
11
|
-
],
|
|
12
|
-
plugins: [
|
|
13
|
-
'import'
|
|
14
|
-
],
|
|
15
|
-
parserOptions: {
|
|
16
|
-
ecmaVersion: 12, // ecmaVersion 用来指定支持的 ECMAScript 版本 。默认为 5,即仅支持es5
|
|
17
|
-
sourceType: 'module',
|
|
18
|
-
},
|
|
19
|
-
globals: { // 脚本在执行期间访问的额外的全局变量
|
|
20
|
-
describe: true,
|
|
21
|
-
it: true,
|
|
22
|
-
after: true,
|
|
23
|
-
before: true,
|
|
24
|
-
afterEach: true,
|
|
25
|
-
beforeEach: true,
|
|
26
|
-
__BUILD__: true,
|
|
27
|
-
__DEV__: true,
|
|
28
|
-
__SIT__: true,
|
|
29
|
-
__UAT__: true,
|
|
30
|
-
__PROD__: true
|
|
31
|
-
},
|
|
32
|
-
rules: {
|
|
33
|
-
// 启用的规则及其各自的错误级别。0(off) 1(warning) 2(error)
|
|
34
|
-
'no-console': 0,
|
|
35
|
-
semi: [1, 'never'],
|
|
36
|
-
quotes: [1, 'single'],
|
|
37
|
-
'no-unused-vars': 0,
|
|
38
|
-
},
|
|
39
|
-
settings: {
|
|
40
|
-
'import/resolver': {
|
|
41
|
-
node: {
|
|
42
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
name: Deploy
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
deploy:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v3
|
|
13
|
-
with:
|
|
14
|
-
fetch-depth: 0
|
|
15
|
-
- uses: actions/setup-node@v3
|
|
16
|
-
with:
|
|
17
|
-
node-version: 16
|
|
18
|
-
cache: npm
|
|
19
|
-
- run: npm ci
|
|
20
|
-
|
|
21
|
-
- name: Build
|
|
22
|
-
run: yarn docs:build
|
|
23
|
-
|
|
24
|
-
- name: Deploy
|
|
25
|
-
uses: peaceiris/actions-gh-pages@v3
|
|
26
|
-
with:
|
|
27
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
28
|
-
publish_dir: docs/.vitepress/dist
|
|
29
|
-
# cname: example.com # if wanna deploy to custom domain
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Publish
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types: [created]
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v3
|
|
15
|
-
- uses: actions/setup-node@v3
|
|
16
|
-
with:
|
|
17
|
-
node-version: 16
|
|
18
|
-
- run: npm ci
|
|
19
|
-
|
|
20
|
-
publish-npm:
|
|
21
|
-
needs: build
|
|
22
|
-
runs-on: ubuntu-latest
|
|
23
|
-
steps:
|
|
24
|
-
- uses: actions/checkout@v3
|
|
25
|
-
- uses: actions/setup-node@v3
|
|
26
|
-
with:
|
|
27
|
-
node-version: 16
|
|
28
|
-
registry-url: https://registry.npmjs.org/
|
|
29
|
-
- run: npm ci
|
|
30
|
-
- run: npm publish
|
|
31
|
-
env:
|
|
32
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
package/.husky/commit-msg
DELETED
package/.husky/pre-commit
DELETED
package/.prettierrc
DELETED
package/CHANGELOG.md
DELETED
package/babel.config.cjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const presets = [
|
|
2
|
-
[
|
|
3
|
-
'@babel/preset-env',
|
|
4
|
-
{
|
|
5
|
-
useBuiltIns: 'usage',
|
|
6
|
-
corejs: { version: 3 },
|
|
7
|
-
targets: [
|
|
8
|
-
'> 1%',
|
|
9
|
-
'Firefox ESR',
|
|
10
|
-
'last 4 versions',
|
|
11
|
-
'maintained node versions',
|
|
12
|
-
'not dead',
|
|
13
|
-
'safari >= 7'
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
const plugins = [
|
|
20
|
-
'@babel/plugin-transform-runtime'
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
module.exports = { presets, plugins }
|
package/changelog-option.cjs
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
const compareFunc = require('compare-func')
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
writerOpts: {
|
|
5
|
-
transform: (commit, context) => {
|
|
6
|
-
let discard = true
|
|
7
|
-
const issues = []
|
|
8
|
-
|
|
9
|
-
commit.notes.forEach(note => {
|
|
10
|
-
note.title = 'BREAKING CHANGES'
|
|
11
|
-
discard = false
|
|
12
|
-
})
|
|
13
|
-
if (commit.type === 'feat') {
|
|
14
|
-
commit.type = '✨ Features | 新功能'
|
|
15
|
-
} else if (commit.type === 'fix') {
|
|
16
|
-
commit.type = '🐛 Bug Fixes | Bug 修复'
|
|
17
|
-
} else if (commit.type === 'perf') {
|
|
18
|
-
commit.type = '⚡ Performance Improvements | 性能优化'
|
|
19
|
-
} else if (commit.type === 'revert' || commit.revert) {
|
|
20
|
-
commit.type = '⏪ Reverts | 回退'
|
|
21
|
-
} else if (discard) {
|
|
22
|
-
return
|
|
23
|
-
} else if (commit.type === 'refactor') {
|
|
24
|
-
commit.type = '♻ Code Refactoring | 代码重构'
|
|
25
|
-
} else if (commit.type === 'test') {
|
|
26
|
-
commit.type = '✅ Tests | 测试'
|
|
27
|
-
} else if (commit.type === 'build') {
|
|
28
|
-
commit.type = '👷 Build System | 构建'
|
|
29
|
-
} else if (commit.type === 'ci') {
|
|
30
|
-
commit.type = '🔧 Continuous Integration | CI 配置'
|
|
31
|
-
} else if (commit.type === 'chore') {
|
|
32
|
-
commit.type = '🎫 Chores | 其他更新'
|
|
33
|
-
} else if (commit.type === 'style') {
|
|
34
|
-
commit.type = '💄 Styles | 风格'
|
|
35
|
-
} else if (commit.type === 'docs') {
|
|
36
|
-
commit.type = '📝 Documentation | 文档'
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (commit.scope === '*') {
|
|
40
|
-
commit.scope = ''
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (typeof commit.hash === 'string') {
|
|
44
|
-
commit.shortHash = commit.hash.substring(0, 7)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (typeof commit.subject === 'string') {
|
|
48
|
-
let url = context.repository
|
|
49
|
-
? `${context.host}/${context.owner}/${context.repository}`
|
|
50
|
-
: context.repoUrl
|
|
51
|
-
|
|
52
|
-
if (url) {
|
|
53
|
-
url = `${url}/issues/`
|
|
54
|
-
// Issue URLs.
|
|
55
|
-
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
|
|
56
|
-
issues.push(issue)
|
|
57
|
-
return `[#${issue}](${url}${issue})`
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (context.host) {
|
|
62
|
-
// User URLs.
|
|
63
|
-
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
|
|
64
|
-
if (username.includes('/')) {
|
|
65
|
-
return `@${username}`
|
|
66
|
-
}
|
|
67
|
-
return `[@${username}](${context.host}/${username})`
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// remove references that already appear in the subject
|
|
73
|
-
commit.references = commit.references.filter(reference => {
|
|
74
|
-
if (issues.indexOf(reference.issue) === -1) {
|
|
75
|
-
return true
|
|
76
|
-
}
|
|
77
|
-
return false
|
|
78
|
-
})
|
|
79
|
-
return commit
|
|
80
|
-
},
|
|
81
|
-
groupBy: 'type',
|
|
82
|
-
commitGroupsSort: 'title',
|
|
83
|
-
commitsSort: ['scope', 'subject'],
|
|
84
|
-
noteGroupsSort: 'title',
|
|
85
|
-
notesSort: compareFunc
|
|
86
|
-
}
|
|
87
|
-
}
|
package/commitlint.config.cjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['@commitlint/config-conventional'],
|
|
3
|
-
rules: {
|
|
4
|
-
// type 类型定义,表示 git 提交的 type 必须在以下类型范围内
|
|
5
|
-
'type-enum': [
|
|
6
|
-
2,
|
|
7
|
-
'always',
|
|
8
|
-
[
|
|
9
|
-
'feat', // 新功能
|
|
10
|
-
'fix', // 修复
|
|
11
|
-
'docs', // 文档变更
|
|
12
|
-
'style', // 代码格式
|
|
13
|
-
'refactor', // 重构
|
|
14
|
-
'pref', // 性能优化
|
|
15
|
-
'test', // 增加测试
|
|
16
|
-
'build', // 构建
|
|
17
|
-
'ci', // CI配置
|
|
18
|
-
'chore', // 构建过程或辅助工具的变动
|
|
19
|
-
'revert', // 回退
|
|
20
|
-
'build' // 打包
|
|
21
|
-
]
|
|
22
|
-
],
|
|
23
|
-
// subject 大小写不做校验
|
|
24
|
-
'subject-case': [0]
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { version } from '../../package.json'
|
|
2
|
-
import zh_CN from './locales/zh-CN'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'watermark-js-plus',
|
|
6
|
-
description: 'A watermark plugin',
|
|
7
|
-
base: '/watermark-js-plus',
|
|
8
|
-
themeConfig: {
|
|
9
|
-
// siteTitle: "Kitty",
|
|
10
|
-
// logo: "/logo.png",
|
|
11
|
-
nav: [
|
|
12
|
-
{ text: 'Guide', link: '/guide/what-is-this', activeMatch: '/guide/' },
|
|
13
|
-
{ text: 'Configs', link: '/config/', activeMatch: '/config/' },
|
|
14
|
-
{
|
|
15
|
-
text: version,
|
|
16
|
-
items: [
|
|
17
|
-
{
|
|
18
|
-
text: 'Changelog',
|
|
19
|
-
link: 'https://github.com/zhensherlock/watermark-js-plus/blob/main/CHANGELOG.md'
|
|
20
|
-
},
|
|
21
|
-
// {
|
|
22
|
-
// text: 'Contributing',
|
|
23
|
-
// link: 'https://github.com/vuejs/vitepress/blob/main/.github/contributing.md'
|
|
24
|
-
// }
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
socialLinks: [
|
|
29
|
-
{ icon: 'github', link: 'https://github.com/zhensherlock/watermark-js-plus' },
|
|
30
|
-
],
|
|
31
|
-
sidebar: {
|
|
32
|
-
'/guide': [
|
|
33
|
-
{
|
|
34
|
-
text: 'Guide',
|
|
35
|
-
items: [
|
|
36
|
-
{ text: 'Introduce', link: '/guide/what-is-this' },
|
|
37
|
-
{ text: 'Getting Started', link: '/guide/getting-started' },
|
|
38
|
-
{ text: 'Watermark', link: '/guide/watermark' },
|
|
39
|
-
{ text: 'Blind Watermark', link: '/guide/blind-watermark' },
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
'/config': [
|
|
44
|
-
{
|
|
45
|
-
text: 'Config',
|
|
46
|
-
items: [
|
|
47
|
-
{ text: 'Basic Config', link: '/config/' },
|
|
48
|
-
{ text: 'Blind Watermark Config', link: '/config/blind' },
|
|
49
|
-
{ text: 'Blind Watermark Decode', link: '/config/blind-decode' },
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
algolia: {
|
|
55
|
-
appId: 'V6CF28P0PS',
|
|
56
|
-
apiKey: '692752b7b3c6f794997d8ae22aed79fa',
|
|
57
|
-
indexName: 'dev_docs'
|
|
58
|
-
},
|
|
59
|
-
footer: {
|
|
60
|
-
message: 'Released under the MIT License.',
|
|
61
|
-
copyright: 'Copyright © 2021-present Michael Sun'
|
|
62
|
-
},
|
|
63
|
-
locales: {
|
|
64
|
-
'/zh/': zh_CN
|
|
65
|
-
},
|
|
66
|
-
localeLinks: {
|
|
67
|
-
// text: 'English',
|
|
68
|
-
items: [
|
|
69
|
-
{ text: 'English', link: '/' },
|
|
70
|
-
{ text: '简体中文', link: '/zh/' },
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
markdown: {
|
|
75
|
-
lineNumbers: true
|
|
76
|
-
},
|
|
77
|
-
locales: {
|
|
78
|
-
'/': {
|
|
79
|
-
lang: 'en-US',
|
|
80
|
-
title: 'watermark-js-plus',
|
|
81
|
-
description: 'A watermark plugin',
|
|
82
|
-
},
|
|
83
|
-
'/zh/': {
|
|
84
|
-
lang: 'zh-CN',
|
|
85
|
-
description: '一个水印插件',
|
|
86
|
-
outlineTitle: '本页目录',
|
|
87
|
-
lastUpdatedText: '上次更新',
|
|
88
|
-
base: '/zh/',
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { version } from '../../../package.json'
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
outlineTitle: '本页目录',
|
|
5
|
-
lastUpdatedText: '上次更新',
|
|
6
|
-
nav: [
|
|
7
|
-
{ text: '指南', link: '/zh/guide/what-is-this', activeMatch: '/guide/' },
|
|
8
|
-
{ text: '配置项', link: '/zh/config/', activeMatch: '/config/' },
|
|
9
|
-
{
|
|
10
|
-
text: version,
|
|
11
|
-
items: [
|
|
12
|
-
{
|
|
13
|
-
text: '更新日志',
|
|
14
|
-
link: 'https://github.com/zhensherlock/watermark-js-plus/blob/main/CHANGELOG.md'
|
|
15
|
-
},
|
|
16
|
-
// {
|
|
17
|
-
// text: '贡献',
|
|
18
|
-
// link: 'https://github.com/vuejs/vitepress/blob/main/.github/contributing.md'
|
|
19
|
-
// }
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
sidebar: {
|
|
24
|
-
'/zh/guide': [
|
|
25
|
-
{
|
|
26
|
-
text: '向导',
|
|
27
|
-
items: [
|
|
28
|
-
{ text: '介绍', link: '/zh/guide/what-is-this' },
|
|
29
|
-
{ text: '开始使用', link: '/zh/guide/getting-started' },
|
|
30
|
-
{ text: '水印', link: '/zh/guide/watermark' },
|
|
31
|
-
{ text: '暗水印', link: '/zh/guide/blink-watermark' },
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
'/zh/config': [
|
|
36
|
-
{
|
|
37
|
-
text: '配置',
|
|
38
|
-
items: [
|
|
39
|
-
{ text: '基础配置项', link: '/zh/config/' },
|
|
40
|
-
{ text: '暗水印配置项', link: '/zh/config/blind' },
|
|
41
|
-
{ text: '暗水印解码配置项', link: '/zh/config/blind-decode' },
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
footer: {
|
|
47
|
-
message: '本中文文档内容版权为 Michael Sun 所有,保留所有权利。'
|
|
48
|
-
},
|
|
49
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import DefaultTheme from 'vitepress/theme'
|
|
2
|
-
import 'element-plus/dist/index.css'
|
|
3
|
-
export default {
|
|
4
|
-
...DefaultTheme,
|
|
5
|
-
enhanceApp: async ({ app, router, siteData, isServer }: any) => {
|
|
6
|
-
// app is the Vue 3 app instance from `createApp()`. router is VitePress'
|
|
7
|
-
// custom router. `siteData`` is a `ref`` of current site-level metadata.
|
|
8
|
-
import('element-plus').then((module) => {
|
|
9
|
-
app.use(module)
|
|
10
|
-
})
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: doc
|
|
3
|
-
---
|
|
4
|
-
# Blind Watermark Decode
|
|
5
|
-
|
|
6
|
-
## url
|
|
7
|
-
|
|
8
|
-
- **Type:** `string`
|
|
9
|
-
- **Default:** `''`
|
|
10
|
-
|
|
11
|
-
Decoding picture path.
|
|
12
|
-
|
|
13
|
-
## mode
|
|
14
|
-
|
|
15
|
-
- **Type:** `string`
|
|
16
|
-
- **Default:** `'canvas'`
|
|
17
|
-
- **available values**: `'canvas'`
|
|
18
|
-
|
|
19
|
-
Mode of decoding.
|
|
20
|
-
|
|
21
|
-
## fillColor
|
|
22
|
-
|
|
23
|
-
- **Type:** `string`
|
|
24
|
-
- **Default:** `'#000'`
|
|
25
|
-
|
|
26
|
-
fill color.
|
|
27
|
-
|
|
28
|
-
## compositeOperation
|
|
29
|
-
|
|
30
|
-
- **Type:** `string`
|
|
31
|
-
- **Default:** `'color-burn'`
|
|
32
|
-
|
|
33
|
-
composite operation.
|
package/docs/config/blind.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: doc
|
|
3
|
-
---
|
|
4
|
-
# Blind Watermark Config
|
|
5
|
-
|
|
6
|
-
## globalAlpha
|
|
7
|
-
|
|
8
|
-
- **Type:** `number`
|
|
9
|
-
- **Default:** `0.005`
|
|
10
|
-
|
|
11
|
-
Transparency of watermark.
|
|
12
|
-
|
|
13
|
-
## mode
|
|
14
|
-
|
|
15
|
-
- **Type:** `string`
|
|
16
|
-
- **Default:** `'blind'`
|
|
17
|
-
- **available values**: `'default' | 'blind'`
|
|
18
|
-
|
|
19
|
-
Watermark mode
|