mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-09 07:24:03 +08:00
Merge branch 'v1.4.2'
This commit is contained in:
commit
624060eb56
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/node_modules
|
||||
/dist
|
||||
|
||||
# local env files
|
||||
|
@ -4,16 +4,14 @@
|
||||
"build": "vue-cli-service build"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^3.6.4",
|
||||
"crypto": "^1.0.1",
|
||||
"@element-plus/icons-vue": "^2.0.9",
|
||||
"element-plus": "^2.2.17",
|
||||
"less": "^4.1.3",
|
||||
"licia": "^1.23.0",
|
||||
"vue": "^3.2.37",
|
||||
"webpack": "4.37.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-service": "^5.0.8",
|
||||
"copy-webpack-plugin": "^6.0.2",
|
||||
"less-loader": "^11.0.0",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"vue-template-compiler": "^2.7.8"
|
||||
|
462
pnpm-lock.yaml
generated
462
pnpm-lock.yaml
generated
@ -1,31 +1,25 @@
|
||||
lockfileVersion: 5.4
|
||||
|
||||
specifiers:
|
||||
'@element-plus/icons-vue': ^2.0.9
|
||||
'@vue/cli-service': ^5.0.8
|
||||
copy-webpack-plugin: ^6.0.2
|
||||
core-js: ^3.6.4
|
||||
crypto: ^1.0.1
|
||||
deepmerge: ^4.2.2
|
||||
element-plus: ^2.2.17
|
||||
less: ^4.1.3
|
||||
less-loader: ^11.0.0
|
||||
licia: ^1.23.0
|
||||
uglifyjs-webpack-plugin: ^2.2.0
|
||||
vue: ^3.2.37
|
||||
vue-template-compiler: ^2.7.8
|
||||
webpack: 4.37.0
|
||||
|
||||
dependencies:
|
||||
core-js: registry.npmmirror.com/core-js/3.24.1
|
||||
crypto: registry.npmmirror.com/crypto/1.0.1
|
||||
'@element-plus/icons-vue': registry.npmmirror.com/@element-plus/icons-vue/2.0.9_vue@3.2.37
|
||||
element-plus: registry.npmmirror.com/element-plus/2.2.17_vue@3.2.37
|
||||
less: registry.npmmirror.com/less/4.1.3
|
||||
licia: registry.npmmirror.com/licia/1.37.0
|
||||
vue: registry.npmmirror.com/vue/3.2.37
|
||||
webpack: registry.npmmirror.com/webpack/4.37.0
|
||||
|
||||
devDependencies:
|
||||
'@vue/cli-service': registry.npmmirror.com/@vue/cli-service/5.0.8_rd7zcyopzq3edztmqqbboasfsu
|
||||
copy-webpack-plugin: registry.npmmirror.com/copy-webpack-plugin/6.4.1_webpack@4.37.0
|
||||
deepmerge: registry.npmmirror.com/deepmerge/4.2.2
|
||||
less-loader: registry.npmmirror.com/less-loader/11.0.0_less@4.1.3+webpack@4.37.0
|
||||
uglifyjs-webpack-plugin: registry.npmmirror.com/uglifyjs-webpack-plugin/2.2.0_webpack@4.37.0
|
||||
vue-template-compiler: registry.npmmirror.com/vue-template-compiler/2.7.8
|
||||
@ -125,11 +119,37 @@ packages:
|
||||
to-fast-properties: registry.npmmirror.com/to-fast-properties/2.0.0
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@gar/promisify/1.1.3:
|
||||
resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@gar/promisify/-/promisify-1.1.3.tgz}
|
||||
name: '@gar/promisify'
|
||||
version: 1.1.3
|
||||
dev: true
|
||||
registry.npmmirror.com/@ctrl/tinycolor/3.4.1:
|
||||
resolution: {integrity: sha512-ej5oVy6lykXsvieQtqZxCOaLT+xD4+QNarq78cIYISHmZXshCvROLudpQN3lfL8G0NL7plMSSK+zlyvCaIJ4Iw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.4.1.tgz}
|
||||
name: '@ctrl/tinycolor'
|
||||
version: 3.4.1
|
||||
engines: {node: '>=10'}
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@element-plus/icons-vue/2.0.9_vue@3.2.37:
|
||||
resolution: {integrity: sha512-okdrwiVeKBmW41Hkl0eMrXDjzJwhQMuKiBOu17rOszqM+LS/yBYpNQNV5Jvoh06Wc+89fMmb/uhzf8NZuDuUaQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.0.9.tgz}
|
||||
id: registry.npmmirror.com/@element-plus/icons-vue/2.0.9
|
||||
name: '@element-plus/icons-vue'
|
||||
version: 2.0.9
|
||||
peerDependencies:
|
||||
vue: ^3.2.0
|
||||
dependencies:
|
||||
vue: registry.npmmirror.com/vue/3.2.37
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@floating-ui/core/1.0.1:
|
||||
resolution: {integrity: sha512-bO37brCPfteXQfFY0DyNDGB3+IMe4j150KFQcgJ5aBP295p9nBGeHEs/p0czrRbtlHq4Px/yoPXO/+dOCcF4uA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@floating-ui/core/-/core-1.0.1.tgz}
|
||||
name: '@floating-ui/core'
|
||||
version: 1.0.1
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@floating-ui/dom/1.0.1:
|
||||
resolution: {integrity: sha512-wBDiLUKWU8QNPNOTAFHiIAkBv1KlHauG2AhqjSeh2H+wR8PX+AArXfz8NkRexH5PgMJMmSOS70YS89AbWYh5dA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.0.1.tgz}
|
||||
name: '@floating-ui/dom'
|
||||
version: 1.0.1
|
||||
dependencies:
|
||||
'@floating-ui/core': registry.npmmirror.com/@floating-ui/core/1.0.1
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@hapi/hoek/9.3.0:
|
||||
resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@hapi/hoek/-/hoek-9.3.0.tgz}
|
||||
@ -236,25 +256,6 @@ packages:
|
||||
fastq: registry.npmmirror.com/fastq/1.13.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/@npmcli/fs/1.1.1:
|
||||
resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@npmcli/fs/-/fs-1.1.1.tgz}
|
||||
name: '@npmcli/fs'
|
||||
version: 1.1.1
|
||||
dependencies:
|
||||
'@gar/promisify': registry.npmmirror.com/@gar/promisify/1.1.3
|
||||
semver: registry.npmmirror.com/semver/7.3.7
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/@npmcli/move-file/1.1.2:
|
||||
resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@npmcli/move-file/-/move-file-1.1.2.tgz}
|
||||
name: '@npmcli/move-file'
|
||||
version: 1.1.2
|
||||
engines: {node: '>=10'}
|
||||
dependencies:
|
||||
mkdirp: registry.npmmirror.com/mkdirp/1.0.4
|
||||
rimraf: registry.npmmirror.com/rimraf/3.0.2
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/@polka/url/1.0.0-next.21:
|
||||
resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@polka/url/-/url-1.0.0-next.21.tgz}
|
||||
name: '@polka/url'
|
||||
@ -303,6 +304,12 @@ packages:
|
||||
version: 1.0.2
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/@sxzz/popperjs-es/2.11.7:
|
||||
resolution: {integrity: sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz}
|
||||
name: '@sxzz/popperjs-es'
|
||||
version: 2.11.7
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@trysound/sax/0.2.0:
|
||||
resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@trysound/sax/-/sax-0.2.0.tgz}
|
||||
name: '@trysound/sax'
|
||||
@ -409,6 +416,20 @@ packages:
|
||||
version: 7.0.11
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/@types/lodash-es/4.17.6:
|
||||
resolution: {integrity: sha512-R+zTeVUKDdfoRxpAryaQNRKk3105Rrgx2CFRClIgRGaqDTdjsm8h6IYA8ir584W3ePzkZfst5xIgDwYrlh9HLg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.6.tgz}
|
||||
name: '@types/lodash-es'
|
||||
version: 4.17.6
|
||||
dependencies:
|
||||
'@types/lodash': registry.npmmirror.com/@types/lodash/4.14.185
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@types/lodash/4.14.185:
|
||||
resolution: {integrity: sha512-evMDG1bC4rgQg4ku9tKpuMh5iBNEwNa3tf9zRHdP1qlv+1WUg44xat4IxCE14gIpZRGUUWAx2VhItCZc25NfMA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/lodash/-/lodash-4.14.185.tgz}
|
||||
name: '@types/lodash'
|
||||
version: 4.14.185
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@types/mime/3.0.1:
|
||||
resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/mime/-/mime-3.0.1.tgz}
|
||||
name: '@types/mime'
|
||||
@ -482,6 +503,12 @@ packages:
|
||||
'@types/node': registry.npmmirror.com/@types/node/18.7.3
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/@types/web-bluetooth/0.0.15:
|
||||
resolution: {integrity: sha512-w7hEHXnPMEZ+4nGKl/KDRVpxkwYxYExuHOYXyzIzCDzEZ9ZCGMAewulr9IqJu2LR4N37fcnb1XVeuZ09qgOxhA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.15.tgz}
|
||||
name: '@types/web-bluetooth'
|
||||
version: 0.0.15
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@types/ws/8.5.3:
|
||||
resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/ws/-/ws-8.5.3.tgz}
|
||||
name: '@types/ws'
|
||||
@ -883,6 +910,39 @@ packages:
|
||||
version: 1.3.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/@vueuse/core/9.2.0_vue@3.2.37:
|
||||
resolution: {integrity: sha512-/MZ6qpz6uSyaXrtoeBWQzAKRG3N7CvfVWvQxiM3ei3Xe5ydOjjtVbo7lGl9p8dECV93j7W8s63A8H0kFLpLyxg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vueuse/core/-/core-9.2.0.tgz}
|
||||
id: registry.npmmirror.com/@vueuse/core/9.2.0
|
||||
name: '@vueuse/core'
|
||||
version: 9.2.0
|
||||
dependencies:
|
||||
'@types/web-bluetooth': registry.npmmirror.com/@types/web-bluetooth/0.0.15
|
||||
'@vueuse/metadata': registry.npmmirror.com/@vueuse/metadata/9.2.0
|
||||
'@vueuse/shared': registry.npmmirror.com/@vueuse/shared/9.2.0_vue@3.2.37
|
||||
vue-demi: registry.npmmirror.com/vue-demi/0.13.11_vue@3.2.37
|
||||
transitivePeerDependencies:
|
||||
- '@vue/composition-api'
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@vueuse/metadata/9.2.0:
|
||||
resolution: {integrity: sha512-exN4KE6iquxDCdt72BgEhb3tlOpECtD61AUdXnUqBTIUCl70x1Ar/QXo3bYcvxmdMS2/peQyfeTzBjRTpvL5xw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.2.0.tgz}
|
||||
name: '@vueuse/metadata'
|
||||
version: 9.2.0
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@vueuse/shared/9.2.0_vue@3.2.37:
|
||||
resolution: {integrity: sha512-NnRp/noSWuXW0dKhZK5D0YLrDi0nmZ18UeEgwXQq7Ul5TTP93lcNnKjrHtd68j2xFB/l59yPGFlCryL692bnrA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vueuse/shared/-/shared-9.2.0.tgz}
|
||||
id: registry.npmmirror.com/@vueuse/shared/9.2.0
|
||||
name: '@vueuse/shared'
|
||||
version: 9.2.0
|
||||
dependencies:
|
||||
vue-demi: registry.npmmirror.com/vue-demi/0.13.11_vue@3.2.37
|
||||
transitivePeerDependencies:
|
||||
- '@vue/composition-api'
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/@webassemblyjs/ast/1.11.1:
|
||||
resolution: {integrity: sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@webassemblyjs/ast/-/ast-1.11.1.tgz}
|
||||
name: '@webassemblyjs/ast'
|
||||
@ -1224,16 +1284,6 @@ packages:
|
||||
engines: {node: '>= 10.0.0'}
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/aggregate-error/3.1.0:
|
||||
resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/aggregate-error/-/aggregate-error-3.1.0.tgz}
|
||||
name: aggregate-error
|
||||
version: 3.1.0
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
clean-stack: registry.npmmirror.com/clean-stack/2.2.0
|
||||
indent-string: registry.npmmirror.com/indent-string/4.0.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/ajv-errors/1.0.1_ajv@6.12.6:
|
||||
resolution: {integrity: sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ajv-errors/-/ajv-errors-1.0.1.tgz}
|
||||
id: registry.npmmirror.com/ajv-errors/1.0.1
|
||||
@ -1455,6 +1505,12 @@ packages:
|
||||
version: 1.0.3
|
||||
optional: true
|
||||
|
||||
registry.npmmirror.com/async-validator/4.2.5:
|
||||
resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz}
|
||||
name: async-validator
|
||||
version: 4.2.5
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/async/2.6.4:
|
||||
resolution: {integrity: sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/async/-/async-2.6.4.tgz}
|
||||
name: async
|
||||
@ -1799,34 +1855,6 @@ packages:
|
||||
unique-filename: registry.npmmirror.com/unique-filename/1.1.1
|
||||
y18n: registry.npmmirror.com/y18n/4.0.3
|
||||
|
||||
registry.npmmirror.com/cacache/15.3.0:
|
||||
resolution: {integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/cacache/-/cacache-15.3.0.tgz}
|
||||
name: cacache
|
||||
version: 15.3.0
|
||||
engines: {node: '>= 10'}
|
||||
dependencies:
|
||||
'@npmcli/fs': registry.npmmirror.com/@npmcli/fs/1.1.1
|
||||
'@npmcli/move-file': registry.npmmirror.com/@npmcli/move-file/1.1.2
|
||||
chownr: registry.npmmirror.com/chownr/2.0.0
|
||||
fs-minipass: registry.npmmirror.com/fs-minipass/2.1.0
|
||||
glob: registry.npmmirror.com/glob/7.2.3
|
||||
infer-owner: registry.npmmirror.com/infer-owner/1.0.4
|
||||
lru-cache: registry.npmmirror.com/lru-cache/6.0.0
|
||||
minipass: registry.npmmirror.com/minipass/3.3.4
|
||||
minipass-collect: registry.npmmirror.com/minipass-collect/1.0.2
|
||||
minipass-flush: registry.npmmirror.com/minipass-flush/1.0.5
|
||||
minipass-pipeline: registry.npmmirror.com/minipass-pipeline/1.2.4
|
||||
mkdirp: registry.npmmirror.com/mkdirp/1.0.4
|
||||
p-map: registry.npmmirror.com/p-map/4.0.0
|
||||
promise-inflight: registry.npmmirror.com/promise-inflight/1.0.1_bluebird@3.7.2
|
||||
rimraf: registry.npmmirror.com/rimraf/3.0.2
|
||||
ssri: registry.npmmirror.com/ssri/8.0.1
|
||||
tar: registry.npmmirror.com/tar/6.1.11
|
||||
unique-filename: registry.npmmirror.com/unique-filename/1.1.1
|
||||
transitivePeerDependencies:
|
||||
- bluebird
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/cache-base/1.0.1:
|
||||
resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/cache-base/-/cache-base-1.0.1.tgz}
|
||||
name: cache-base
|
||||
@ -1968,13 +1996,6 @@ packages:
|
||||
name: chownr
|
||||
version: 1.1.4
|
||||
|
||||
registry.npmmirror.com/chownr/2.0.0:
|
||||
resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/chownr/-/chownr-2.0.0.tgz}
|
||||
name: chownr
|
||||
version: 2.0.0
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/chrome-trace-event/1.0.3:
|
||||
resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz}
|
||||
name: chrome-trace-event
|
||||
@ -2009,13 +2030,6 @@ packages:
|
||||
source-map: registry.npmmirror.com/source-map/0.6.1
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/clean-stack/2.2.0:
|
||||
resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/clean-stack/-/clean-stack-2.2.0.tgz}
|
||||
name: clean-stack
|
||||
version: 2.2.0
|
||||
engines: {node: '>=6'}
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/cli-cursor/2.1.0:
|
||||
resolution: {integrity: sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/cli-cursor/-/cli-cursor-2.1.0.tgz}
|
||||
name: cli-cursor
|
||||
@ -2457,31 +2471,6 @@ packages:
|
||||
version: 0.1.1
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
registry.npmmirror.com/copy-webpack-plugin/6.4.1_webpack@4.37.0:
|
||||
resolution: {integrity: sha512-MXyPCjdPVx5iiWyl40Va3JGh27bKzOTNY3NjUTrosD2q7dR/cLD0013uqJ3BpFbUjyONINjb6qI7nDIJujrMbA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/copy-webpack-plugin/-/copy-webpack-plugin-6.4.1.tgz}
|
||||
id: registry.npmmirror.com/copy-webpack-plugin/6.4.1
|
||||
name: copy-webpack-plugin
|
||||
version: 6.4.1
|
||||
engines: {node: '>= 10.13.0'}
|
||||
peerDependencies:
|
||||
webpack: ^4.37.0 || ^5.0.0
|
||||
dependencies:
|
||||
cacache: registry.npmmirror.com/cacache/15.3.0
|
||||
fast-glob: registry.npmmirror.com/fast-glob/3.2.11
|
||||
find-cache-dir: registry.npmmirror.com/find-cache-dir/3.3.2
|
||||
glob-parent: registry.npmmirror.com/glob-parent/5.1.2
|
||||
globby: registry.npmmirror.com/globby/11.1.0
|
||||
loader-utils: registry.npmmirror.com/loader-utils/2.0.2
|
||||
normalize-path: registry.npmmirror.com/normalize-path/3.0.0
|
||||
p-limit: registry.npmmirror.com/p-limit/3.1.0
|
||||
schema-utils: registry.npmmirror.com/schema-utils/3.1.1
|
||||
serialize-javascript: registry.npmmirror.com/serialize-javascript/5.0.1
|
||||
webpack: registry.npmmirror.com/webpack/4.37.0
|
||||
webpack-sources: registry.npmmirror.com/webpack-sources/1.4.3
|
||||
transitivePeerDependencies:
|
||||
- bluebird
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/copy-webpack-plugin/9.1.0_webpack@5.74.0:
|
||||
resolution: {integrity: sha512-rxnR7PaGigJzhqETHGmAcxKnLZSR5u1Y3/bcIv/1FnqXedcL/E2ewK7ZCNrArJKCiSv8yVXhTqetJh8inDvfsA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/copy-webpack-plugin/-/copy-webpack-plugin-9.1.0.tgz}
|
||||
id: registry.npmmirror.com/copy-webpack-plugin/9.1.0
|
||||
@ -2500,13 +2489,6 @@ packages:
|
||||
webpack: registry.npmmirror.com/webpack/5.74.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/core-js/3.24.1:
|
||||
resolution: {integrity: sha512-0QTBSYSUZ6Gq21utGzkfITDylE8jWC9Ne1D2MrhvlsZBI1x39OdDIVbzSqtgMndIy6BlHxBXpMGqzZmnztg2rg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/core-js/-/core-js-3.24.1.tgz}
|
||||
name: core-js
|
||||
version: 3.24.1
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/core-util-is/1.0.3:
|
||||
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz}
|
||||
name: core-util-is
|
||||
@ -2597,13 +2579,6 @@ packages:
|
||||
randombytes: registry.npmmirror.com/randombytes/2.1.0
|
||||
randomfill: registry.npmmirror.com/randomfill/1.0.4
|
||||
|
||||
registry.npmmirror.com/crypto/1.0.1:
|
||||
resolution: {integrity: sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/crypto/-/crypto-1.0.1.tgz}
|
||||
name: crypto
|
||||
version: 1.0.1
|
||||
deprecated: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/css-declaration-sorter/6.3.0_postcss@8.4.16:
|
||||
resolution: {integrity: sha512-OGT677UGHJTAVMRhPO+HJ4oKln3wkBTwtDFH0ojbqm+MJm6xuDMHp2nkhh/ThaBqq20IbraBQSWKfSLNHQO9Og==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/css-declaration-sorter/-/css-declaration-sorter-6.3.0.tgz}
|
||||
id: registry.npmmirror.com/css-declaration-sorter/6.3.0
|
||||
@ -2792,6 +2767,12 @@ packages:
|
||||
name: cyclist
|
||||
version: 1.0.1
|
||||
|
||||
registry.npmmirror.com/dayjs/1.11.5:
|
||||
resolution: {integrity: sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/dayjs/-/dayjs-1.11.5.tgz}
|
||||
name: dayjs
|
||||
version: 1.11.5
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/de-indent/1.0.2:
|
||||
resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz}
|
||||
name: de-indent
|
||||
@ -2849,13 +2830,6 @@ packages:
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/deepmerge/4.2.2:
|
||||
resolution: {integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/deepmerge/-/deepmerge-4.2.2.tgz}
|
||||
name: deepmerge
|
||||
version: 4.2.2
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/default-gateway/6.0.3:
|
||||
resolution: {integrity: sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/default-gateway/-/default-gateway-6.0.3.tgz}
|
||||
name: default-gateway
|
||||
@ -3079,6 +3053,34 @@ packages:
|
||||
version: 1.4.219
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/element-plus/2.2.17_vue@3.2.37:
|
||||
resolution: {integrity: sha512-MGwMIE/q+FFD3kgS23x8HIe5043tmD1cTRwjhIX9o6fim1avFnUkrsfYRvybbz4CkyqSb185EheZS5AUPpXh2g==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/element-plus/-/element-plus-2.2.17.tgz}
|
||||
id: registry.npmmirror.com/element-plus/2.2.17
|
||||
name: element-plus
|
||||
version: 2.2.17
|
||||
peerDependencies:
|
||||
vue: ^3.2.0
|
||||
dependencies:
|
||||
'@ctrl/tinycolor': registry.npmmirror.com/@ctrl/tinycolor/3.4.1
|
||||
'@element-plus/icons-vue': registry.npmmirror.com/@element-plus/icons-vue/2.0.9_vue@3.2.37
|
||||
'@floating-ui/dom': registry.npmmirror.com/@floating-ui/dom/1.0.1
|
||||
'@popperjs/core': registry.npmmirror.com/@sxzz/popperjs-es/2.11.7
|
||||
'@types/lodash': registry.npmmirror.com/@types/lodash/4.14.185
|
||||
'@types/lodash-es': registry.npmmirror.com/@types/lodash-es/4.17.6
|
||||
'@vueuse/core': registry.npmmirror.com/@vueuse/core/9.2.0_vue@3.2.37
|
||||
async-validator: registry.npmmirror.com/async-validator/4.2.5
|
||||
dayjs: registry.npmmirror.com/dayjs/1.11.5
|
||||
escape-html: registry.npmmirror.com/escape-html/1.0.3
|
||||
lodash: registry.npmmirror.com/lodash/4.17.21
|
||||
lodash-es: registry.npmmirror.com/lodash-es/4.17.21
|
||||
lodash-unified: registry.npmmirror.com/lodash-unified/1.0.2_3ib2ivapxullxkx3xftsimdk7u
|
||||
memoize-one: registry.npmmirror.com/memoize-one/6.0.0
|
||||
normalize-wheel-es: registry.npmmirror.com/normalize-wheel-es/1.2.0
|
||||
vue: registry.npmmirror.com/vue/3.2.37
|
||||
transitivePeerDependencies:
|
||||
- '@vue/composition-api'
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/elliptic/6.5.4:
|
||||
resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/elliptic/-/elliptic-6.5.4.tgz}
|
||||
name: elliptic
|
||||
@ -3185,7 +3187,6 @@ packages:
|
||||
resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz}
|
||||
name: escape-html
|
||||
version: 1.0.3
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/escape-string-regexp/1.0.5:
|
||||
resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz}
|
||||
@ -3503,17 +3504,6 @@ packages:
|
||||
make-dir: registry.npmmirror.com/make-dir/2.1.0
|
||||
pkg-dir: registry.npmmirror.com/pkg-dir/3.0.0
|
||||
|
||||
registry.npmmirror.com/find-cache-dir/3.3.2:
|
||||
resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz}
|
||||
name: find-cache-dir
|
||||
version: 3.3.2
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
commondir: registry.npmmirror.com/commondir/1.0.1
|
||||
make-dir: registry.npmmirror.com/make-dir/3.1.0
|
||||
pkg-dir: registry.npmmirror.com/pkg-dir/4.2.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/find-up/3.0.0:
|
||||
resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/find-up/-/find-up-3.0.0.tgz}
|
||||
name: find-up
|
||||
@ -3609,15 +3599,6 @@ packages:
|
||||
universalify: registry.npmmirror.com/universalify/2.0.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/fs-minipass/2.1.0:
|
||||
resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fs-minipass/-/fs-minipass-2.1.0.tgz}
|
||||
name: fs-minipass
|
||||
version: 2.1.0
|
||||
engines: {node: '>= 8'}
|
||||
dependencies:
|
||||
minipass: registry.npmmirror.com/minipass/3.3.4
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/fs-monkey/1.0.3:
|
||||
resolution: {integrity: sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fs-monkey/-/fs-monkey-1.0.3.tgz}
|
||||
name: fs-monkey
|
||||
@ -4125,13 +4106,6 @@ packages:
|
||||
version: 0.1.4
|
||||
engines: {node: '>=0.8.19'}
|
||||
|
||||
registry.npmmirror.com/indent-string/4.0.0:
|
||||
resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/indent-string/-/indent-string-4.0.0.tgz}
|
||||
name: indent-string
|
||||
version: 4.0.0
|
||||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/infer-owner/1.0.4:
|
||||
resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/infer-owner/-/infer-owner-1.0.4.tgz}
|
||||
name: infer-owner
|
||||
@ -4615,12 +4589,6 @@ packages:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
registry.npmmirror.com/licia/1.37.0:
|
||||
resolution: {integrity: sha512-jX49+WmzikOPGNrcy/giS23HCI8Pb7RF585Ei5d7oWF4WMelaZWv4odqQNdT0jtHkoUxqSvPz67Jvyq06xamUA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/licia/-/licia-1.37.0.tgz}
|
||||
name: licia
|
||||
version: 1.37.0
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/lilconfig/2.0.6:
|
||||
resolution: {integrity: sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/lilconfig/-/lilconfig-2.0.6.tgz}
|
||||
name: lilconfig
|
||||
@ -4686,6 +4654,27 @@ packages:
|
||||
p-locate: registry.npmmirror.com/p-locate/4.1.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/lodash-es/4.17.21:
|
||||
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz}
|
||||
name: lodash-es
|
||||
version: 4.17.21
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/lodash-unified/1.0.2_3ib2ivapxullxkx3xftsimdk7u:
|
||||
resolution: {integrity: sha512-OGbEy+1P+UT26CYi4opY4gebD8cWRDxAT6MAObIVQMiqYdxZr1g3QHWCToVsm31x2NkLS4K3+MC2qInaRMa39g==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/lodash-unified/-/lodash-unified-1.0.2.tgz}
|
||||
id: registry.npmmirror.com/lodash-unified/1.0.2
|
||||
name: lodash-unified
|
||||
version: 1.0.2
|
||||
peerDependencies:
|
||||
'@types/lodash-es': '*'
|
||||
lodash: '*'
|
||||
lodash-es: '*'
|
||||
dependencies:
|
||||
'@types/lodash-es': registry.npmmirror.com/@types/lodash-es/4.17.6
|
||||
lodash: registry.npmmirror.com/lodash/4.17.21
|
||||
lodash-es: registry.npmmirror.com/lodash-es/4.17.21
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/lodash.defaultsdeep/4.6.1:
|
||||
resolution: {integrity: sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz}
|
||||
name: lodash.defaultsdeep
|
||||
@ -4714,7 +4703,6 @@ packages:
|
||||
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz}
|
||||
name: lodash
|
||||
version: 4.17.21
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/log-symbols/4.1.0:
|
||||
resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/log-symbols/-/log-symbols-4.1.0.tgz}
|
||||
@ -4787,15 +4775,6 @@ packages:
|
||||
pify: registry.npmmirror.com/pify/4.0.1
|
||||
semver: registry.npmmirror.com/semver/5.7.1
|
||||
|
||||
registry.npmmirror.com/make-dir/3.1.0:
|
||||
resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/make-dir/-/make-dir-3.1.0.tgz}
|
||||
name: make-dir
|
||||
version: 3.1.0
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
semver: registry.npmmirror.com/semver/6.3.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/mamacro/0.0.3:
|
||||
resolution: {integrity: sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/mamacro/-/mamacro-0.0.3.tgz}
|
||||
name: mamacro
|
||||
@ -4846,6 +4825,12 @@ packages:
|
||||
fs-monkey: registry.npmmirror.com/fs-monkey/1.0.3
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/memoize-one/6.0.0:
|
||||
resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz}
|
||||
name: memoize-one
|
||||
version: 6.0.0
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/memory-fs/0.4.1:
|
||||
resolution: {integrity: sha512-cda4JKCxReDXFXRqOHPQscuIYg1PvxbE2S2GP45rnwfEK+vZaXC8C1OFvdHIbgw0DLzowXGVoxLaAmlgRy14GQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/memory-fs/-/memory-fs-0.4.1.tgz}
|
||||
name: memory-fs
|
||||
@ -5010,33 +4995,6 @@ packages:
|
||||
name: minimist
|
||||
version: 1.2.6
|
||||
|
||||
registry.npmmirror.com/minipass-collect/1.0.2:
|
||||
resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/minipass-collect/-/minipass-collect-1.0.2.tgz}
|
||||
name: minipass-collect
|
||||
version: 1.0.2
|
||||
engines: {node: '>= 8'}
|
||||
dependencies:
|
||||
minipass: registry.npmmirror.com/minipass/3.3.4
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/minipass-flush/1.0.5:
|
||||
resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/minipass-flush/-/minipass-flush-1.0.5.tgz}
|
||||
name: minipass-flush
|
||||
version: 1.0.5
|
||||
engines: {node: '>= 8'}
|
||||
dependencies:
|
||||
minipass: registry.npmmirror.com/minipass/3.3.4
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/minipass-pipeline/1.2.4:
|
||||
resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz}
|
||||
name: minipass-pipeline
|
||||
version: 1.2.4
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
minipass: registry.npmmirror.com/minipass/3.3.4
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/minipass/3.3.4:
|
||||
resolution: {integrity: sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/minipass/-/minipass-3.3.4.tgz}
|
||||
name: minipass
|
||||
@ -5046,16 +5004,6 @@ packages:
|
||||
yallist: registry.npmmirror.com/yallist/4.0.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/minizlib/2.1.2:
|
||||
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/minizlib/-/minizlib-2.1.2.tgz}
|
||||
name: minizlib
|
||||
version: 2.1.2
|
||||
engines: {node: '>= 8'}
|
||||
dependencies:
|
||||
minipass: registry.npmmirror.com/minipass/3.3.4
|
||||
yallist: registry.npmmirror.com/yallist/4.0.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/mississippi/3.0.0:
|
||||
resolution: {integrity: sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/mississippi/-/mississippi-3.0.0.tgz}
|
||||
name: mississippi
|
||||
@ -5090,14 +5038,6 @@ packages:
|
||||
dependencies:
|
||||
minimist: registry.npmmirror.com/minimist/1.2.6
|
||||
|
||||
registry.npmmirror.com/mkdirp/1.0.4:
|
||||
resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/mkdirp/-/mkdirp-1.0.4.tgz}
|
||||
name: mkdirp
|
||||
version: 1.0.4
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/module-alias/2.2.2:
|
||||
resolution: {integrity: sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/module-alias/-/module-alias-2.2.2.tgz}
|
||||
name: module-alias
|
||||
@ -5331,6 +5271,12 @@ packages:
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/normalize-wheel-es/1.2.0:
|
||||
resolution: {integrity: sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz}
|
||||
name: normalize-wheel-es
|
||||
version: 1.2.0
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/npm-run-path/2.0.2:
|
||||
resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/npm-run-path/-/npm-run-path-2.0.2.tgz}
|
||||
name: npm-run-path
|
||||
@ -5497,15 +5443,6 @@ packages:
|
||||
dependencies:
|
||||
p-try: registry.npmmirror.com/p-try/2.2.0
|
||||
|
||||
registry.npmmirror.com/p-limit/3.1.0:
|
||||
resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/p-limit/-/p-limit-3.1.0.tgz}
|
||||
name: p-limit
|
||||
version: 3.1.0
|
||||
engines: {node: '>=10'}
|
||||
dependencies:
|
||||
yocto-queue: registry.npmmirror.com/yocto-queue/0.1.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/p-locate/3.0.0:
|
||||
resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/p-locate/-/p-locate-3.0.0.tgz}
|
||||
name: p-locate
|
||||
@ -5523,15 +5460,6 @@ packages:
|
||||
p-limit: registry.npmmirror.com/p-limit/2.3.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/p-map/4.0.0:
|
||||
resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/p-map/-/p-map-4.0.0.tgz}
|
||||
name: p-map
|
||||
version: 4.0.0
|
||||
engines: {node: '>=10'}
|
||||
dependencies:
|
||||
aggregate-error: registry.npmmirror.com/aggregate-error/3.1.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/p-retry/4.6.2:
|
||||
resolution: {integrity: sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/p-retry/-/p-retry-4.6.2.tgz}
|
||||
name: p-retry
|
||||
@ -5757,15 +5685,6 @@ packages:
|
||||
dependencies:
|
||||
find-up: registry.npmmirror.com/find-up/3.0.0
|
||||
|
||||
registry.npmmirror.com/pkg-dir/4.2.0:
|
||||
resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/pkg-dir/-/pkg-dir-4.2.0.tgz}
|
||||
name: pkg-dir
|
||||
version: 4.2.0
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
find-up: registry.npmmirror.com/find-up/4.1.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/portfinder/1.0.32:
|
||||
resolution: {integrity: sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/portfinder/-/portfinder-1.0.32.tgz}
|
||||
name: portfinder
|
||||
@ -6820,14 +6739,6 @@ packages:
|
||||
dependencies:
|
||||
randombytes: registry.npmmirror.com/randombytes/2.1.0
|
||||
|
||||
registry.npmmirror.com/serialize-javascript/5.0.1:
|
||||
resolution: {integrity: sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz}
|
||||
name: serialize-javascript
|
||||
version: 5.0.1
|
||||
dependencies:
|
||||
randombytes: registry.npmmirror.com/randombytes/2.1.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/serialize-javascript/6.0.0:
|
||||
resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz}
|
||||
name: serialize-javascript
|
||||
@ -7381,20 +7292,6 @@ packages:
|
||||
engines: {node: '>=6'}
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/tar/6.1.11:
|
||||
resolution: {integrity: sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/tar/-/tar-6.1.11.tgz}
|
||||
name: tar
|
||||
version: 6.1.11
|
||||
engines: {node: '>= 10'}
|
||||
dependencies:
|
||||
chownr: registry.npmmirror.com/chownr/2.0.0
|
||||
fs-minipass: registry.npmmirror.com/fs-minipass/2.1.0
|
||||
minipass: registry.npmmirror.com/minipass/3.3.4
|
||||
minizlib: registry.npmmirror.com/minizlib/2.1.2
|
||||
mkdirp: registry.npmmirror.com/mkdirp/1.0.4
|
||||
yallist: registry.npmmirror.com/yallist/4.0.0
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/terser-webpack-plugin/1.4.5_webpack@4.37.0:
|
||||
resolution: {integrity: sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz}
|
||||
id: registry.npmmirror.com/terser-webpack-plugin/1.4.5
|
||||
@ -7815,6 +7712,24 @@ packages:
|
||||
name: vm-browserify
|
||||
version: 1.1.2
|
||||
|
||||
registry.npmmirror.com/vue-demi/0.13.11_vue@3.2.37:
|
||||
resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vue-demi/-/vue-demi-0.13.11.tgz}
|
||||
id: registry.npmmirror.com/vue-demi/0.13.11
|
||||
name: vue-demi
|
||||
version: 0.13.11
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
peerDependencies:
|
||||
'@vue/composition-api': ^1.0.0-rc.1
|
||||
vue: ^3.0.0-0 || ^2.6.0
|
||||
peerDependenciesMeta:
|
||||
'@vue/composition-api':
|
||||
optional: true
|
||||
dependencies:
|
||||
vue: registry.npmmirror.com/vue/3.2.37
|
||||
dev: false
|
||||
|
||||
registry.npmmirror.com/vue-hot-reload-api/2.3.4:
|
||||
resolution: {integrity: sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz}
|
||||
name: vue-hot-reload-api
|
||||
@ -8407,10 +8322,3 @@ packages:
|
||||
y18n: registry.npmmirror.com/y18n/5.0.8
|
||||
yargs-parser: registry.npmmirror.com/yargs-parser/20.2.9
|
||||
dev: true
|
||||
|
||||
registry.npmmirror.com/yocto-queue/0.1.0:
|
||||
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/yocto-queue/-/yocto-queue-0.1.0.tgz}
|
||||
name: yocto-queue
|
||||
version: 0.1.0
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.3.4",
|
||||
"version": "1.4.2",
|
||||
"pluginName": "超级剪贴板",
|
||||
"description": "强大的剪贴板管理工具",
|
||||
"author": "ZiuChen",
|
||||
|
@ -1,252 +1,15 @@
|
||||
// /*
|
||||
// name: clipboard_manager
|
||||
// author: Github @ZiuChen
|
||||
// desc: 监听剪贴板 读写本地文件
|
||||
// */
|
||||
|
||||
const fs = require('fs')
|
||||
const { existsSync, readFileSync, writeFileSync, mkdirSync } = require('fs')
|
||||
const crypto = require('crypto')
|
||||
const { clipboard } = require('electron')
|
||||
const time = require('./time')
|
||||
|
||||
const homePath = utools.getPath('home')
|
||||
const userDataPath = utools.getPath('userData')
|
||||
const dbName = '_utools_clipboard_manager_storage'
|
||||
|
||||
const isMacOs = utools.isMacOs()
|
||||
const isWindows = utools.isWindows()
|
||||
const sep = isWindows ? '\\' : '/'
|
||||
const DBPath = `${isMacOs ? userDataPath : homePath}${sep}${dbName}`
|
||||
|
||||
let globalImageOversize = false
|
||||
|
||||
class DB {
|
||||
constructor(path) {
|
||||
const d = new Date()
|
||||
this.path = path
|
||||
this.dataBase = {}
|
||||
this.createTime = d.getTime()
|
||||
this.updateTime = d.getTime()
|
||||
}
|
||||
init() {
|
||||
const isExist = fs.existsSync(this.path)
|
||||
if (isExist) {
|
||||
const data = fs.readFileSync(this.path, {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
try {
|
||||
// 读取磁盘记录到内存
|
||||
const dataBase = JSON.parse(data)
|
||||
this.dataBase = dataBase
|
||||
// 将超过14天的数据删除 排除掉收藏
|
||||
const now = new Date().getTime()
|
||||
const deleteTime = now - '\u0031\u0034' * '\u0032\u0034' * 60 * 60 * 1000 // unicode
|
||||
this.dataBase.data = this.dataBase.data?.filter((item) => item.updateTime > deleteTime)
|
||||
this.updateDataBaseLocal()
|
||||
} catch (err) {
|
||||
utools.showNotification('读取剪切板出错: ' + err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
const defaultDB = {
|
||||
data: [],
|
||||
createTime: this.createTime,
|
||||
updateTime: this.updateTime
|
||||
}
|
||||
this.dataBase = defaultDB
|
||||
this.updateDataBaseLocal(defaultDB)
|
||||
}
|
||||
updateDataBase() {
|
||||
// 更新内存数据
|
||||
this.dataBase.updateTime = new Date().getTime()
|
||||
}
|
||||
updateDataBaseLocal(dataBase) {
|
||||
// 更新文件数据
|
||||
fs.writeFileSync(this.path, JSON.stringify(dataBase || this.dataBase), (err) => {
|
||||
if (err) {
|
||||
utools.showNotification('写入剪切板出错: ' + err)
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
addItem(cItem) {
|
||||
this.dataBase.data.unshift(cItem)
|
||||
this.updateDataBase()
|
||||
const exceedCount = this.dataBase.data.length - '\u0038\u0030\u0030'
|
||||
if (exceedCount > 0) {
|
||||
// 达到条数限制 删除超出部分
|
||||
for (let i = 0; i < exceedCount; i++) {
|
||||
this.dataBase.data.pop()
|
||||
}
|
||||
}
|
||||
this.updateDataBaseLocal()
|
||||
}
|
||||
emptyDataBase() {
|
||||
this.dataBase.data = []
|
||||
this.updateDataBase()
|
||||
this.updateDataBaseLocal()
|
||||
}
|
||||
filterDataBaseViaId(id) {
|
||||
return this.dataBase.data.filter((item) => item.id === id)
|
||||
}
|
||||
updateItemViaId(id) {
|
||||
for (const item of this.dataBase.data) {
|
||||
if (item.id === id) {
|
||||
item.updateTime = new Date().getTime()
|
||||
this.sortDataBaseViaTime()
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
sortDataBaseViaTime() {
|
||||
this.dataBase.data = this.dataBase.data.sort((a, b) => {
|
||||
return b.updateTime - a.updateTime
|
||||
})
|
||||
this.updateDataBaseLocal()
|
||||
}
|
||||
removeItemViaId(id) {
|
||||
for (const item of this.dataBase.data) {
|
||||
if (item.id === id) {
|
||||
this.dataBase.data.splice(this.dataBase.data.indexOf(item), 1)
|
||||
this.updateDataBaseLocal()
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
window.exports = {
|
||||
utools,
|
||||
existsSync,
|
||||
readFileSync,
|
||||
writeFileSync,
|
||||
mkdirSync,
|
||||
crypto,
|
||||
clipboard,
|
||||
time
|
||||
}
|
||||
|
||||
const pbpaste = () => {
|
||||
// file
|
||||
const files = utools.getCopyedFiles() // null | Array
|
||||
if (files) {
|
||||
return {
|
||||
type: 'file',
|
||||
data: JSON.stringify(files)
|
||||
}
|
||||
}
|
||||
// text
|
||||
const text = clipboard.readText()
|
||||
if (text.trim()) return { type: 'text', data: text }
|
||||
// image
|
||||
const image = clipboard.readImage() // 大图卡顿来源
|
||||
const data = image.toDataURL()
|
||||
globalImageOversize = data.length > 3e5
|
||||
if (!image.isEmpty()) {
|
||||
return {
|
||||
type: 'image',
|
||||
data: data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const watchClipboard = async (db, fn) => {
|
||||
let prev = db.dataBase.data[0] || {}
|
||||
function loop() {
|
||||
time.sleep(250).then(loop)
|
||||
const item = pbpaste()
|
||||
if (!item) return
|
||||
item.id = crypto.createHash('md5').update(item.data).digest('hex')
|
||||
if (item && prev.id != item.id) {
|
||||
// 剪切板元素 与最近一次复制内容不同
|
||||
prev = item
|
||||
fn(item)
|
||||
} else {
|
||||
// 剪切板元素 与上次复制内容相同
|
||||
}
|
||||
}
|
||||
loop()
|
||||
}
|
||||
|
||||
const copy = (item, isHideMainWindow = true) => {
|
||||
switch (item.type) {
|
||||
case 'text':
|
||||
utools.copyText(item.data)
|
||||
break
|
||||
case 'image':
|
||||
utools.copyImage(item.data)
|
||||
break
|
||||
case 'file':
|
||||
const paths = JSON.parse(item.data).map((file) => file.path)
|
||||
utools.copyFile(paths)
|
||||
break
|
||||
}
|
||||
isHideMainWindow && utools.hideMainWindow()
|
||||
}
|
||||
|
||||
const paste = () => {
|
||||
if (utools.isMacOs()) utools.simulateKeyboardTap('v', 'command')
|
||||
else utools.simulateKeyboardTap('v', 'ctrl')
|
||||
}
|
||||
|
||||
const createFile = (item) => {
|
||||
const tempPath = utools.getPath('temp')
|
||||
const folderPath = tempPath + sep + 'utools-clipboard-manager'
|
||||
if (!fs.existsSync(folderPath)) {
|
||||
try {
|
||||
fs.mkdirSync(folderPath)
|
||||
} catch (err) {
|
||||
utools.showNotification('创建临时文件夹出错: ' + err)
|
||||
}
|
||||
}
|
||||
const { type } = item
|
||||
if (type === 'image') {
|
||||
const base64Data = item.data.replace(/^data:image\/\w+;base64,/, '') // remove the prefix
|
||||
const buffer = Buffer.from(base64Data, 'base64') // to Buffer
|
||||
const filePath = folderPath + sep + new Date().valueOf() + '.png'
|
||||
fs.writeFileSync(filePath, buffer)
|
||||
return filePath
|
||||
} else if (type === 'text') {
|
||||
const filePath = folderPath + sep + new Date().valueOf() + '.txt'
|
||||
fs.writeFileSync(filePath, item.data)
|
||||
return filePath
|
||||
}
|
||||
}
|
||||
|
||||
const db = new DB(DBPath)
|
||||
db.init()
|
||||
|
||||
const remove = (item) => db.removeItemViaId(item.id)
|
||||
|
||||
const focus = (isBlur = false) => {
|
||||
return document.querySelector('.clip-search').style.display !== 'none'
|
||||
? isBlur
|
||||
? document.querySelector('.clip-search-input')?.blur()
|
||||
: document.querySelector('.clip-search-input')?.focus()
|
||||
: (document.querySelector('.clip-search-btn')?.click(),
|
||||
document.querySelector('.clip-search-input')?.focus())
|
||||
}
|
||||
const toTop = () => (document.scrollingElement.scrollTop = 0)
|
||||
const resetNav = () => document.querySelectorAll('.clip-switch-item')[0]?.click()
|
||||
|
||||
watchClipboard(db, (item) => {
|
||||
// 此函数不断执行
|
||||
if (!item) return
|
||||
if (db.updateItemViaId(item.id)) {
|
||||
// 在库中 由 updateItemViaId 更新 updateTime
|
||||
return
|
||||
}
|
||||
// 不在库中 由 addItem 添加
|
||||
item.createTime = new Date().getTime()
|
||||
item.updateTime = new Date().getTime()
|
||||
db.addItem(item)
|
||||
})
|
||||
|
||||
utools.onPluginEnter(() => {
|
||||
if (globalImageOversize) {
|
||||
utools.copyText('ImageOverSized')
|
||||
globalImageOversize = false
|
||||
}
|
||||
toTop()
|
||||
resetNav()
|
||||
})
|
||||
|
||||
window.db = db
|
||||
window.copy = copy
|
||||
window.paste = paste
|
||||
window.remove = remove
|
||||
window.createFile = createFile
|
||||
window.focus = focus
|
||||
window.toTop = toTop
|
||||
|
@ -1,9 +1,16 @@
|
||||
<template>
|
||||
<div class="app">
|
||||
<Main></Main>
|
||||
<Main @show-setting="settingShown = true" v-show="!settingShown"></Main>
|
||||
<transition name="el-fade-in-linear">
|
||||
<Setting v-show="settingShown" @back="settingShown = false"></Setting>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import Main from './views/Main.vue'
|
||||
import Setting from './views/Setting.vue'
|
||||
|
||||
const settingShown = ref(false)
|
||||
</script>
|
||||
|
@ -1,59 +0,0 @@
|
||||
<template>
|
||||
<div class="clip-card" v-show="isShow">
|
||||
<div class="clip-card-header">
|
||||
<slot name="header">
|
||||
<div class="clip-card-header-title">
|
||||
{{ title }}
|
||||
</div>
|
||||
<div class="clip-card-header-operate">
|
||||
<span class="clip-card-header-operate-btn" @click="handleCloseBtnClick">❌</span>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="clip-card-content">
|
||||
<slot>
|
||||
<template v-for="c of content.split('\n')">
|
||||
<div class="clip-card-content-item">
|
||||
{{ c }}
|
||||
</div>
|
||||
</template>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="clip-card-footer"><slot name="footer"></slot></div>
|
||||
</div>
|
||||
<div class="clip-overlay" v-show="isShow"></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const emit = defineEmits(['onClose'])
|
||||
const props = defineProps({
|
||||
isShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
content: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
version: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
})
|
||||
const handleCloseBtnClick = () => {
|
||||
utools.dbStorage.setItem('notify', {
|
||||
title: props.title,
|
||||
content: props.content,
|
||||
version: props.version
|
||||
})
|
||||
emit('onClose')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import '../style';
|
||||
</style>
|
@ -60,6 +60,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import FileList from './FileList.vue'
|
||||
import ClipOperate from './ClipOperate.vue'
|
||||
import { dateFormat } from '../utils'
|
||||
@ -170,6 +171,10 @@ const handleItemClick = (ev, item) => {
|
||||
// 右键 仅复制
|
||||
window.copy(item)
|
||||
}
|
||||
ElMessage({
|
||||
message: '复制成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
}
|
||||
const activeIndex = ref(0)
|
||||
@ -214,6 +219,10 @@ onMounted(() => {
|
||||
// 如果侧栏中有数据 证明侧栏是打开的 不执行复制
|
||||
if (!props.isMultiple) {
|
||||
window.copy(props.showList[activeIndex.value])
|
||||
ElMessage({
|
||||
message: '复制成功',
|
||||
type: 'success'
|
||||
})
|
||||
} else {
|
||||
emit('onMultiCopyExecute', false)
|
||||
}
|
||||
@ -222,6 +231,10 @@ onMounted(() => {
|
||||
if (!props.isMultiple) {
|
||||
window.copy(props.showList[activeIndex.value])
|
||||
window.paste()
|
||||
ElMessage({
|
||||
message: '复制成功',
|
||||
type: 'success'
|
||||
})
|
||||
} else {
|
||||
emit('onMultiCopyExecute', true)
|
||||
}
|
||||
|
@ -1,34 +1,25 @@
|
||||
<template>
|
||||
<div class="clip-operate">
|
||||
<template v-for="{ id, title, icon } of operation">
|
||||
<template v-for="o of operation">
|
||||
<div
|
||||
v-if="
|
||||
(id !== 'collect' &&
|
||||
id !== 'view' &&
|
||||
id !== 'open-folder' &&
|
||||
id !== 'word-break' &&
|
||||
id !== 'save-file') ||
|
||||
(id === 'collect' && item.type !== 'file') ||
|
||||
(id === 'view' && !isFullData) ||
|
||||
(id === 'open-folder' && item.type === 'file') ||
|
||||
(id === 'save-file' && isFullData && item.type !== 'file') ||
|
||||
(id === 'word-break' &&
|
||||
isFullData &&
|
||||
item.type === 'text' &&
|
||||
item.data.length <= 500 &&
|
||||
item.data.length >= 2)
|
||||
"
|
||||
:class="id"
|
||||
:title="title"
|
||||
@click.stop="handleOperateClick({ id, item })"
|
||||
v-if="filterOperate(o, item, isFullData)"
|
||||
:class="o.id"
|
||||
:title="o.title"
|
||||
@click.stop="handleOperateClick(o, item)"
|
||||
>
|
||||
{{ icon }}
|
||||
{{ o.icon }}
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import defaultOperation from '../data/operation.json'
|
||||
import setting from '../global/readSetting'
|
||||
import useClipOperate from '../hooks/useClipOperate'
|
||||
|
||||
const emit = defineEmits(['onDataChange', 'onDataRemove', 'onOperateExecute'])
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Object,
|
||||
@ -39,56 +30,10 @@ const props = defineProps({
|
||||
default: false
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['onDataChange', 'onDataRemove', 'onOperateExecute'])
|
||||
const operation = [
|
||||
{ id: 'copy', title: '复制', icon: '📄' },
|
||||
{ id: 'view', title: '查看全部', icon: '💬' },
|
||||
{ id: 'open-folder', title: '打开文件夹', icon: '📁' },
|
||||
{ id: 'collect', title: '收藏', icon: '⭐' },
|
||||
{ id: 'word-break', title: '分词', icon: '💣' },
|
||||
{ id: 'save-file', title: '保存', icon: '💾' },
|
||||
{ id: 'remove', title: '删除', icon: '❌' }
|
||||
]
|
||||
const handleOperateClick = ({ id, item }) => {
|
||||
const typeMap = {
|
||||
text: 'text',
|
||||
file: 'files',
|
||||
image: 'img'
|
||||
}
|
||||
switch (id) {
|
||||
case 'copy':
|
||||
window.copy(item, false)
|
||||
break
|
||||
case 'view':
|
||||
emit('onDataChange', item)
|
||||
break
|
||||
case 'open-folder':
|
||||
const { data } = item
|
||||
const fl = JSON.parse(data)
|
||||
utools.shellShowItemInFolder(fl[0].path) // 取第一个文件的路径打开
|
||||
break
|
||||
case 'collect':
|
||||
utools.redirect('添加到「备忘快贴」', {
|
||||
type: typeMap[item.type],
|
||||
data: item.data
|
||||
})
|
||||
break
|
||||
case 'word-break':
|
||||
utools.redirect('超级分词', item.data)
|
||||
break
|
||||
case 'save-file':
|
||||
utools.redirect('收集文件', {
|
||||
type: typeMap[item.type],
|
||||
data: item.data
|
||||
})
|
||||
break
|
||||
case 'remove':
|
||||
window.remove(item)
|
||||
emit('onDataRemove')
|
||||
break
|
||||
}
|
||||
emit('onOperateExecute')
|
||||
}
|
||||
|
||||
const operation = computed(() => [...defaultOperation, ...setting.operation.custom])
|
||||
|
||||
const { handleOperateClick, filterOperate } = useClipOperate({ emit })
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -45,6 +45,14 @@ const clear = () => {
|
||||
emit('update:modelValue', '')
|
||||
nextTick(() => window.focus())
|
||||
}
|
||||
|
||||
utools.onPluginEnter(() => {
|
||||
// 如果输入框有内容 则清空 并且移除焦点
|
||||
if (filterText.value) {
|
||||
clear()
|
||||
nextTick(() => document.activeElement.blur())
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -6,6 +6,7 @@
|
||||
:class="{ 'clip-switch-item': true, active: activeTab === tab.type }"
|
||||
@click="onNavClick(tab.type)"
|
||||
>
|
||||
<component :is="tab.icon"></component>
|
||||
{{ tab.name }}
|
||||
</div>
|
||||
</template>
|
||||
@ -16,13 +17,15 @@
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { Menu, Tickets, Picture, Document, Collection } from '@element-plus/icons-vue'
|
||||
|
||||
const tabs = ref([
|
||||
{ name: '📚 全部', type: 'all' },
|
||||
{ name: '📋 文字', type: 'text' },
|
||||
{ name: '⛺ 图片', type: 'image' },
|
||||
{ name: '📂 文件', type: 'file' }
|
||||
])
|
||||
const tabs = [
|
||||
{ name: '全部', type: 'all', icon: Menu },
|
||||
{ name: '文字', type: 'text', icon: Tickets },
|
||||
{ name: '图片', type: 'image', icon: Picture },
|
||||
{ name: '文件', type: 'file', icon: Document },
|
||||
{ name: '收藏', type: 'collect', icon: Collection }
|
||||
]
|
||||
const activeTab = ref('all')
|
||||
const emit = defineEmits(['onNavClick'])
|
||||
const toggleNav = (type) => (activeTab.value = type)
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "重要版本更新提示",
|
||||
"content": "1. 如果你是第一次使用此插件, 请务必设置跟随主程序启动选项, 否则可能导致剪贴板记录丢失\n2. 插件内的收藏栏将在最近一个版本中移除, 届时点击收藏按钮将跳转到备忘快贴, 请尽快将已有数据保存, 使用备忘快贴代替\n3. 插件使用过程中遇到任何问题, 请到论坛发布页回帖或加入QQ群反馈",
|
||||
"version": 1
|
||||
"content": "1. 如果你是第一次使用此插件, 请务必设置跟随主程序启动选项, 否则可能导致剪贴板记录丢失</br>2. 插件使用过程中遇到任何问题, 请到论坛发布页回帖或加入QQ群反馈",
|
||||
"version": 2
|
||||
}
|
||||
|
10
src/data/operation.json
Normal file
10
src/data/operation.json
Normal file
@ -0,0 +1,10 @@
|
||||
[
|
||||
{ "id": "copy", "title": "复制", "icon": "📄" },
|
||||
{ "id": "view", "title": "查看全部", "icon": "💬" },
|
||||
{ "id": "open-folder", "title": "打开文件夹", "icon": "📁" },
|
||||
{ "id": "collect", "title": "收藏", "icon": "⭐" },
|
||||
{ "id": "un-collect", "title": "移出收藏", "icon": "📤" },
|
||||
{ "id": "remove", "title": "删除", "icon": "❌" },
|
||||
{ "id": "word-break", "title": "分词", "icon": "💣" },
|
||||
{ "id": "save-file", "title": "保存", "icon": "💾" }
|
||||
]
|
76
src/data/setting.json
Normal file
76
src/data/setting.json
Normal file
@ -0,0 +1,76 @@
|
||||
{
|
||||
"database.path": "",
|
||||
"database.maxsize": 800,
|
||||
"database.maxage": 14,
|
||||
"operation.shown": ["copy", "view", "collect", "un-collect", "remove"],
|
||||
"operation.custom": [
|
||||
{
|
||||
"id": "custom.1663583455000",
|
||||
"title": "收藏到备忘快贴",
|
||||
"icon": "📌",
|
||||
"match": ["text", "image"],
|
||||
"command": "redirect:添加到「备忘快贴」"
|
||||
},
|
||||
{
|
||||
"id": "custom.1663490858",
|
||||
"title": "讯飞OCR识别",
|
||||
"icon": "⚡",
|
||||
"match": ["image", { "type": "file", "regex": ".(?:jpg|jpeg|png)$" }],
|
||||
"command": "redirect:讯飞ocr"
|
||||
},
|
||||
{
|
||||
"id": "custom.1663490864",
|
||||
"title": "上传到图床",
|
||||
"icon": "🚀",
|
||||
"match": ["image", { "type": "file", "regex": ".(?:jpg|jpeg|png)$" }],
|
||||
"command": "redirect:上传到图床"
|
||||
},
|
||||
{
|
||||
"id": "custom.1663490859",
|
||||
"title": "百度搜索",
|
||||
"icon": "🔍",
|
||||
"match": ["text"],
|
||||
"command": "redirect:百度一下"
|
||||
},
|
||||
{
|
||||
"id": "custom.1663490860",
|
||||
"title": "统计文本字数",
|
||||
"icon": "🧮",
|
||||
"match": ["text"],
|
||||
"command": "redirect:统计文本次数"
|
||||
},
|
||||
{
|
||||
"id": "custom.1663490861",
|
||||
"title": "颜色管理",
|
||||
"icon": "🎨",
|
||||
"match": [
|
||||
{
|
||||
"type": "text",
|
||||
"regex": "^(?:#?[a-f0-9]{6}|(?:(?:25[0-5]|2[0-4]\\d|1?\\d{1,2}), ?){2}(?:25[0-5]|2[0-4]\\d|1?\\d{1,2})|rgba?\\((?:(?:25[0-5]|2[0-4]\\d|1?\\d{1,2}), ?){2}(?:25[0-5]|2[0-4]\\d|1?\\d{1,2})(?:, ?(?:1|0|0\\.\\d{1,2}))?\\)|hs[liv]a?\\((?:360|(?:(?:3[0-5]\\d|[1-2]\\d{2}|\\d{1,2})(?:\\.\\d{1,15})?))(?:deg)?(?:, |,| )(?:100|\\d{1,2}(?:\\.\\d{1,15})?)%?(?:, |,| )(?:100|\\d{1,2}(?:\\.\\d{1,15})?)%?(?:, ?(?:1|0|0\\.\\d{1,2}))?\\))$"
|
||||
}
|
||||
],
|
||||
"command": "redirect:统计文本次数"
|
||||
},
|
||||
{
|
||||
"id": "custom.1663490862",
|
||||
"title": "百度识图",
|
||||
"icon": "🌄",
|
||||
"match": ["image"],
|
||||
"command": "redirect:百度识图"
|
||||
},
|
||||
{
|
||||
"id": "custom.1663490863",
|
||||
"title": "识别图片中二维码",
|
||||
"icon": "📜",
|
||||
"match": ["image"],
|
||||
"command": "redirect:识别图片中二维码"
|
||||
},
|
||||
{
|
||||
"id": "custom.1663490865",
|
||||
"title": "翻译",
|
||||
"icon": "🌎",
|
||||
"match": ["text"],
|
||||
"command": "redirect:翻译"
|
||||
}
|
||||
]
|
||||
}
|
236
src/global/initPlugin.js
Normal file
236
src/global/initPlugin.js
Normal file
@ -0,0 +1,236 @@
|
||||
const { utools, existsSync, readFileSync, writeFileSync, mkdirSync, crypto, clipboard, time } =
|
||||
window.exports
|
||||
import setting from './readSetting'
|
||||
|
||||
export default function initPlugin() {
|
||||
const SEP = utools.isWindows() ? '\\' : '/'
|
||||
class DB {
|
||||
constructor(path) {
|
||||
const d = new Date()
|
||||
this.path = path
|
||||
this.dataBase = {}
|
||||
this.createTime = d.getTime()
|
||||
this.updateTime = d.getTime()
|
||||
}
|
||||
init() {
|
||||
const isExist = existsSync(this.path)
|
||||
if (isExist) {
|
||||
const data = readFileSync(this.path, {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
try {
|
||||
// 读取磁盘记录到内存
|
||||
const dataBase = JSON.parse(data)
|
||||
this.dataBase = dataBase
|
||||
// 将超过14天的数据删除 排除掉收藏
|
||||
const now = new Date().getTime()
|
||||
const deleteTime = now - setting.database.maxage * 24 * 60 * 60 * 1000 // unicode
|
||||
this.dataBase.data = this.dataBase.data?.filter(
|
||||
(item) => item.updateTime > deleteTime || item.collect
|
||||
)
|
||||
this.updateDataBaseLocal()
|
||||
} catch (err) {
|
||||
utools.showNotification('读取剪切板出错: ' + err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
const defaultDB = {
|
||||
data: [],
|
||||
createTime: this.createTime,
|
||||
updateTime: this.updateTime
|
||||
}
|
||||
this.dataBase = defaultDB
|
||||
this.updateDataBaseLocal(defaultDB)
|
||||
}
|
||||
updateDataBase() {
|
||||
// 更新内存数据
|
||||
this.dataBase.updateTime = new Date().getTime()
|
||||
}
|
||||
updateDataBaseLocal(dataBase) {
|
||||
// 更新文件数据
|
||||
writeFileSync(this.path, JSON.stringify(dataBase || this.dataBase), (err) => {
|
||||
if (err) {
|
||||
utools.showNotification('写入剪切板出错: ' + err)
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
addItem(cItem) {
|
||||
this.dataBase.data.unshift(cItem)
|
||||
this.updateDataBase()
|
||||
const exceedCount = this.dataBase.data.length - setting.database.maxsize
|
||||
if (exceedCount > 0) {
|
||||
// 达到条数限制 在收藏条数限制内遍历非收藏历史并删除
|
||||
// 所有被移除的 item都存入tempList
|
||||
const tmpList = []
|
||||
for (let i = 0; i < exceedCount; i++) {
|
||||
const item = this.dataBase.data.pop()
|
||||
tmpList.push(item)
|
||||
}
|
||||
tmpList.forEach((item) => !item.collect || this.dataBase.data.push(item)) // 收藏内容 重新入栈
|
||||
}
|
||||
this.updateDataBaseLocal()
|
||||
}
|
||||
emptyDataBase() {
|
||||
this.dataBase.data = []
|
||||
this.updateDataBase()
|
||||
this.updateDataBaseLocal()
|
||||
}
|
||||
filterDataBaseViaId(id) {
|
||||
return this.dataBase.data.filter((item) => item.id === id)
|
||||
}
|
||||
updateItemViaId(id) {
|
||||
for (const item of this.dataBase.data) {
|
||||
if (item.id === id) {
|
||||
item.updateTime = new Date().getTime()
|
||||
this.sortDataBaseViaTime()
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
sortDataBaseViaTime() {
|
||||
this.dataBase.data = this.dataBase.data.sort((a, b) => {
|
||||
return b.updateTime - a.updateTime
|
||||
})
|
||||
this.updateDataBaseLocal()
|
||||
}
|
||||
removeItemViaId(id) {
|
||||
for (const item of this.dataBase.data) {
|
||||
if (item.id === id) {
|
||||
this.dataBase.data.splice(this.dataBase.data.indexOf(item), 1)
|
||||
this.updateDataBaseLocal()
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const pbpaste = () => {
|
||||
// file
|
||||
const files = utools.getCopyedFiles() // null | Array
|
||||
if (files) {
|
||||
return {
|
||||
type: 'file',
|
||||
data: JSON.stringify(files)
|
||||
}
|
||||
}
|
||||
// text
|
||||
const text = clipboard.readText()
|
||||
if (text.trim()) return { type: 'text', data: text }
|
||||
// image
|
||||
const image = clipboard.readImage() // 大图卡顿来源
|
||||
const data = image.toDataURL()
|
||||
if (!image.isEmpty()) {
|
||||
return {
|
||||
type: 'image',
|
||||
data: data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const copy = (item, isHideMainWindow = true) => {
|
||||
switch (item.type) {
|
||||
case 'text':
|
||||
utools.copyText(item.data)
|
||||
break
|
||||
case 'image':
|
||||
utools.copyImage(item.data)
|
||||
break
|
||||
case 'file':
|
||||
const paths = JSON.parse(item.data).map((file) => file.path)
|
||||
utools.copyFile(paths)
|
||||
break
|
||||
}
|
||||
isHideMainWindow && utools.hideMainWindow()
|
||||
}
|
||||
|
||||
const paste = () => {
|
||||
if (utools.isMacOs()) utools.simulateKeyboardTap('v', 'command')
|
||||
else utools.simulateKeyboardTap('v', 'ctrl')
|
||||
}
|
||||
|
||||
const createFile = (item) => {
|
||||
const tempPath = utools.getPath('temp')
|
||||
const folderPath = tempPath + SEP + 'utools-clipboard-manager'
|
||||
if (!existsSync(folderPath)) {
|
||||
try {
|
||||
mkdirSync(folderPath)
|
||||
} catch (err) {
|
||||
utools.showNotification('创建临时文件夹出错: ' + err)
|
||||
}
|
||||
}
|
||||
const { type } = item
|
||||
if (type === 'image') {
|
||||
const base64Data = item.data.replace(/^data:image\/\w+;base64,/, '') // remove the prefix
|
||||
const buffer = Buffer.from(base64Data, 'base64') // to Buffer
|
||||
const filePath = folderPath + SEP + new Date().valueOf() + '.png'
|
||||
writeFileSync(filePath, buffer)
|
||||
return filePath
|
||||
} else if (type === 'text') {
|
||||
const filePath = folderPath + SEP + new Date().valueOf() + '.txt'
|
||||
writeFileSync(filePath, item.data)
|
||||
return filePath
|
||||
}
|
||||
}
|
||||
|
||||
const db = new DB(setting.database.path)
|
||||
db.init()
|
||||
|
||||
const remove = (item) => db.removeItemViaId(item.id)
|
||||
|
||||
const focus = (isBlur = false) => {
|
||||
return document.querySelector('.clip-search').style.display !== 'none'
|
||||
? isBlur
|
||||
? document.querySelector('.clip-search-input')?.blur()
|
||||
: document.querySelector('.clip-search-input')?.focus()
|
||||
: (document.querySelector('.clip-search-btn')?.click(),
|
||||
document.querySelector('.clip-search-input')?.focus())
|
||||
}
|
||||
const toTop = () => (document.scrollingElement.scrollTop = 0)
|
||||
const resetNav = () => document.querySelectorAll('.clip-switch-item')[0]?.click()
|
||||
|
||||
const handleClipboardChange = (item = pbpaste()) => {
|
||||
if (!item) return
|
||||
item.id = crypto.createHash('md5').update(item.data).digest('hex')
|
||||
if (db.updateItemViaId(item.id)) {
|
||||
// 在库中 由 updateItemViaId 更新 updateTime
|
||||
return
|
||||
}
|
||||
// 不在库中 由 addItem 添加
|
||||
item.createTime = new Date().getTime()
|
||||
item.updateTime = new Date().getTime()
|
||||
db.addItem(item)
|
||||
}
|
||||
|
||||
let prev = db.dataBase.data[0] || {}
|
||||
function loop() {
|
||||
time.sleep(300).then(loop)
|
||||
const item = pbpaste()
|
||||
if (!item) return
|
||||
item.id = crypto.createHash('md5').update(item.data).digest('hex')
|
||||
if (item && prev.id != item.id) {
|
||||
// 剪切板元素 与最近一次复制内容不同
|
||||
prev = item
|
||||
handleClipboardChange(item)
|
||||
} else {
|
||||
// 剪切板元素 与上次复制内容相同
|
||||
}
|
||||
}
|
||||
loop()
|
||||
|
||||
utools.onPluginEnter(() => {
|
||||
toTop()
|
||||
resetNav()
|
||||
})
|
||||
|
||||
window.db = db
|
||||
window.copy = copy
|
||||
window.paste = paste
|
||||
window.remove = remove
|
||||
window.createFile = createFile
|
||||
window.focus = focus
|
||||
window.toTop = toTop
|
||||
}
|
5
src/global/readSetting.js
Normal file
5
src/global/readSetting.js
Normal file
@ -0,0 +1,5 @@
|
||||
import restoreSetting from './restoreSetting'
|
||||
|
||||
const setting = utools.dbStorage.getItem('setting') || restoreSetting()
|
||||
|
||||
export default setting
|
48
src/global/registerElement.js
Normal file
48
src/global/registerElement.js
Normal file
@ -0,0 +1,48 @@
|
||||
import 'element-plus/theme-chalk/base.css'
|
||||
import 'element-plus/theme-chalk/dark/css-vars.css'
|
||||
import 'element-plus/theme-chalk/el-overlay.css'
|
||||
import 'element-plus/theme-chalk/el-button.css'
|
||||
import 'element-plus/theme-chalk/el-message-box.css'
|
||||
import 'element-plus/theme-chalk/el-message.css'
|
||||
import 'element-plus/theme-chalk/el-card.css'
|
||||
import 'element-plus/theme-chalk/el-input.css'
|
||||
import 'element-plus/theme-chalk/el-select.css'
|
||||
import 'element-plus/theme-chalk/el-option.css'
|
||||
import 'element-plus/theme-chalk/el-scrollbar.css'
|
||||
import {
|
||||
ElButton,
|
||||
ElMessageBox,
|
||||
ElMessage,
|
||||
ElCard,
|
||||
ElInput,
|
||||
ElSelect,
|
||||
ElOption,
|
||||
ElScrollbar
|
||||
} from 'element-plus'
|
||||
|
||||
const components = [
|
||||
ElButton,
|
||||
ElMessageBox,
|
||||
ElMessage,
|
||||
ElCard,
|
||||
ElInput,
|
||||
ElSelect,
|
||||
ElOption,
|
||||
ElScrollbar
|
||||
]
|
||||
|
||||
document.querySelector('html').className = utools.isDarkColors() ? 'dark' : ''
|
||||
|
||||
export default function registerElement(app) {
|
||||
components.forEach((c) => {
|
||||
let name = transferCamel(c.name)
|
||||
app.component(name, c)
|
||||
})
|
||||
}
|
||||
|
||||
function transferCamel(camel) {
|
||||
return camel
|
||||
.replace(/([A-Z])/g, '-$1')
|
||||
.toLowerCase()
|
||||
.slice(1)
|
||||
}
|
15
src/global/restoreSetting.js
Normal file
15
src/global/restoreSetting.js
Normal file
@ -0,0 +1,15 @@
|
||||
import defaultSetting from '../data/setting.json'
|
||||
import { pointToObj } from '../utils'
|
||||
|
||||
const SEP = utools.isWindows() ? '\\' : '/'
|
||||
const defaultPath = `${
|
||||
utools.isMacOs() ? utools.getPath('userData') : utools.getPath('home')
|
||||
}${SEP}_utools_clipboard_manager_storage`
|
||||
|
||||
export default function restoreSetting() {
|
||||
// 将defaultSetting的key点语法转换为对象
|
||||
const setting = pointToObj(defaultSetting)
|
||||
setting.database.path = defaultPath
|
||||
utools.dbStorage.setItem('setting', setting)
|
||||
return setting
|
||||
}
|
102
src/hooks/useClipOperate.js
Normal file
102
src/hooks/useClipOperate.js
Normal file
@ -0,0 +1,102 @@
|
||||
import { ElMessage } from 'element-plus'
|
||||
import setting from '../global/readSetting'
|
||||
|
||||
export default function useClipOperate({ emit }) {
|
||||
return {
|
||||
handleOperateClick: (operation, item) => {
|
||||
const { id } = operation
|
||||
const typeMap = {
|
||||
text: 'text',
|
||||
file: 'files',
|
||||
image: 'img'
|
||||
}
|
||||
if (id === 'copy') {
|
||||
window.copy(item, false)
|
||||
ElMessage({
|
||||
message: '复制成功',
|
||||
type: 'success'
|
||||
})
|
||||
} else if (id === 'view') {
|
||||
emit('onDataChange', item)
|
||||
} else if (id === 'open-folder') {
|
||||
const { data } = item
|
||||
const fl = JSON.parse(data)
|
||||
utools.shellShowItemInFolder(fl[0].path) // 取第一个文件的路径打开
|
||||
} else if (id === 'collect') {
|
||||
item.collect = true
|
||||
window.db.updateDataBaseLocal()
|
||||
} else if (id === 'un-collect') {
|
||||
item.collect = undefined
|
||||
window.db.updateDataBaseLocal()
|
||||
} else if (id === 'word-break') {
|
||||
utools.redirect('超级分词', item.data)
|
||||
} else if (id === 'save-file') {
|
||||
utools.redirect('收集文件', {
|
||||
type: typeMap[item.type],
|
||||
data: item.type === 'file' ? JSON.parse(item.data).map((f) => f.path) : item.data
|
||||
})
|
||||
} else if (id === 'remove') {
|
||||
window.remove(item)
|
||||
emit('onDataRemove')
|
||||
} else if (id.indexOf('custom') !== -1) {
|
||||
const a = operation.command.split(':')
|
||||
if (a[0] === 'redirect') {
|
||||
utools.redirect(a[1], {
|
||||
type: typeMap[item.type],
|
||||
data: item.type === 'file' ? JSON.parse(item.data).map((f) => f.path) : item.data
|
||||
})
|
||||
}
|
||||
}
|
||||
emit('onOperateExecute')
|
||||
},
|
||||
filterOperate: (operation, item, isFullData) => {
|
||||
const { id } = operation
|
||||
if (!isFullData) {
|
||||
// 在非预览页 只展示setting.operation.shown中的功能按钮
|
||||
if (!setting.operation.shown.includes(id)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (id === 'copy') {
|
||||
return true
|
||||
} else if (id === 'view') {
|
||||
return !isFullData
|
||||
} else if (id === 'open-folder') {
|
||||
return item.type === 'file'
|
||||
} else if (id === 'collect') {
|
||||
return item.type !== 'file' && !item.collect
|
||||
} else if (id === 'un-collect') {
|
||||
return item.type !== 'file' && item.collect
|
||||
} else if (id === 'word-break') {
|
||||
return item.type === 'text' && item.data.length <= 500 && item.data.length >= 2
|
||||
} else if (id === 'save-file') {
|
||||
return true
|
||||
} else if (id === 'remove') {
|
||||
return true
|
||||
} else if (id.indexOf('custom') !== -1) {
|
||||
// 如果匹配到了自定义的操作 则展示
|
||||
for (const m of operation.match) {
|
||||
if (typeof m === 'string') {
|
||||
if (item.type === m) {
|
||||
return true
|
||||
}
|
||||
} else if (typeof m === 'object') {
|
||||
// 根据正则匹配内容
|
||||
const r = new RegExp(m.regex)
|
||||
if (item.type === 'file') {
|
||||
const fl = JSON.parse(item.data)
|
||||
for (const f of fl) {
|
||||
if (r.test(f.name)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return r.test(item.data)
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
import initPlugin from './global/initPlugin'
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import less from 'less'
|
||||
import registerElement from './global/registerElement'
|
||||
|
||||
initPlugin()
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(less)
|
||||
app.use(less).use(registerElement)
|
||||
|
||||
app.mount('#app')
|
||||
|
@ -1,81 +0,0 @@
|
||||
.clip-card {
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 10%;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
z-index: 999999999;
|
||||
background-color: @bg-color;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
|
||||
&-header {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
background-color: @primary-color;
|
||||
color: @bg-color;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.clip-card-header-title {
|
||||
margin-left: 25px;
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.clip-card-header-operate {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
margin: 20px;
|
||||
.clip-card-header-operate-item {
|
||||
margin-left: 10px;
|
||||
cursor: pointer;
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-content {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
padding: 30px;
|
||||
color: @text-color;
|
||||
.clip-card-content-item {
|
||||
font-size: 15px;
|
||||
margin-bottom: 10px;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background-color: @primary-color;
|
||||
color: @text-color;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-radius: 0px 0px 5px 5px;
|
||||
.clip-card-footer-operate {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.clip-card-footer-operate-item {
|
||||
margin-left: 10px;
|
||||
cursor: pointer;
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
z-index: 99999;
|
||||
z-index: 100;
|
||||
bottom: 15px;
|
||||
right: 15px;
|
||||
height: 50px;
|
||||
|
@ -1,9 +1,9 @@
|
||||
.clip-full-wrapper {
|
||||
z-index: 9999999999;
|
||||
z-index: 102;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
height: -webkit-fill-available;
|
||||
width: 70%;
|
||||
width: 80%;
|
||||
color: @text-color;
|
||||
background: @bg-color;
|
||||
margin: 0px 0px;
|
||||
@ -13,8 +13,8 @@
|
||||
white-space: pre-wrap;
|
||||
.clip-full-operate-list {
|
||||
position: fixed;
|
||||
right: 50%;
|
||||
z-index: 99;
|
||||
right: 20%;
|
||||
z-index: 102;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -26,9 +26,13 @@
|
||||
border-radius: 5px;
|
||||
}
|
||||
.clip-full-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
top: 50px;
|
||||
padding: 20px;
|
||||
margin-bottom: 55px;
|
||||
border-radius: 5px;
|
||||
background-color: @text-bg-color;
|
||||
img {
|
||||
@ -56,7 +60,7 @@
|
||||
}
|
||||
}
|
||||
.clip-overlay {
|
||||
z-index: 9999999;
|
||||
z-index: 101;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
|
@ -11,7 +11,7 @@
|
||||
border-color: @text-bg-color-lighter @bg-color @bg-color @bg-color;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
border-style: hidden hidden hidden solid;
|
||||
border-style: solid hidden hidden solid;
|
||||
border-width: 1px 0px 0px 6px;
|
||||
border-color: @text-bg-color-lighter @bg-color @bg-color @primary-color;
|
||||
background-color: @text-bg-color-lighter;
|
||||
@ -31,7 +31,7 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
padding: 10px;
|
||||
padding: 10px 10px 10px 5px;
|
||||
.clip-time {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -43,6 +43,7 @@
|
||||
border-color: @text-bg-color-lighter;
|
||||
border-style: solid;
|
||||
border-width: 0px 2px 0px 0px;
|
||||
margin: 0px 5px 0px 0px;
|
||||
.relative-date {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@ -60,7 +61,7 @@
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
max-height: 120px;
|
||||
max-width: 480px;
|
||||
max-width: 460px;
|
||||
padding: 5px 5px 5px 10px;
|
||||
white-space: pre-wrap;
|
||||
flex-direction: column;
|
||||
@ -68,7 +69,7 @@
|
||||
img.clip-data-image {
|
||||
// 此 class用于区分 file的 image
|
||||
max-height: 100px; // 比外框 max-height少一点 因为有 5px的边框
|
||||
max-width: 90%;
|
||||
max-width: 85%;
|
||||
box-shadow: 0px 0px 3px @text-color;
|
||||
}
|
||||
.clip-over-sized-content {
|
||||
|
@ -4,7 +4,6 @@
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
min-width: 180px;
|
||||
padding: 0px 10px;
|
||||
flex-wrap: wrap;
|
||||
& div {
|
||||
display: flex;
|
||||
|
@ -1,5 +1,5 @@
|
||||
.clip-switch {
|
||||
z-index: 999;
|
||||
z-index: 100;
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
display: flex;
|
||||
@ -14,6 +14,9 @@
|
||||
color: @primary-color;
|
||||
background-color: @bg-color;
|
||||
transition: all 0.15s ease-in-out;
|
||||
svg {
|
||||
fill: @primary-color;
|
||||
}
|
||||
}
|
||||
.clip-switch-items {
|
||||
display: flex;
|
||||
@ -22,8 +25,12 @@
|
||||
flex-direction: row;
|
||||
margin-left: 5px;
|
||||
.clip-switch-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 58px;
|
||||
padding: 10px 15px 10px 15px;
|
||||
margin: 10px 5px 10px 5px;
|
||||
margin: 10px 0px 10px 5px;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
font-size: 14px;
|
||||
@ -32,6 +39,11 @@
|
||||
background-color: @nav-hover-bg-color;
|
||||
transition: all 0.15s ease-in-out;
|
||||
}
|
||||
svg {
|
||||
margin-right: 5px;
|
||||
max-width: 30%;
|
||||
fill: @text-color-lighter;
|
||||
}
|
||||
}
|
||||
}
|
||||
.clip-switch-btn-list {
|
||||
|
34
src/style/cpns/setting.less
Normal file
34
src/style/cpns/setting.less
Normal file
@ -0,0 +1,34 @@
|
||||
.setting-card {
|
||||
margin: 10px;
|
||||
&-content {
|
||||
padding: 10px;
|
||||
&-item {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin: 10px;
|
||||
.el-select {
|
||||
&.number-select {
|
||||
width: 85px;
|
||||
}
|
||||
&.operation-select {
|
||||
width: 450px;
|
||||
}
|
||||
}
|
||||
.el-textarea {
|
||||
width: 70%;
|
||||
}
|
||||
.path {
|
||||
width: 65%;
|
||||
}
|
||||
& div {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
.import() {
|
||||
/* 导入全部涉及到变量的样式文件 */
|
||||
@import (multiple) './cpns/clip-card.less';
|
||||
@import (multiple) './cpns/clip-float-btn.less';
|
||||
@import (multiple) './cpns/clip-full-data.less';
|
||||
@import (multiple) './cpns/clip-item-list.less';
|
||||
@ -9,6 +8,7 @@
|
||||
@import (multiple) './cpns/clip-switch.less';
|
||||
@import (multiple) './cpns/clip-word-break.less';
|
||||
@import (multiple) './cpns/file-list.less';
|
||||
@import (multiple) './cpns/setting.less';
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
|
@ -19,4 +19,21 @@ const dateFormat = (timeStamp) => {
|
||||
return info
|
||||
}
|
||||
|
||||
export { dateFormat }
|
||||
const pointToObj = (objWithPointKey) => {
|
||||
let rtnObj = {}
|
||||
for (const key in objWithPointKey) {
|
||||
const keys = key.split('.')
|
||||
let obj = rtnObj
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
if (i === keys.length - 1) {
|
||||
obj[keys[i]] = objWithPointKey[key]
|
||||
} else {
|
||||
if (!obj[keys[i]]) obj[keys[i]] = {}
|
||||
obj = obj[keys[i]]
|
||||
}
|
||||
}
|
||||
}
|
||||
return rtnObj
|
||||
}
|
||||
|
||||
export { dateFormat, pointToObj }
|
||||
|
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<ClipCard :isShow="notifyShown" v-bind="notify" @onClose="notifyShown = false"></ClipCard>
|
||||
<ClipFloatBtn :icon="'🧭'" @onBtnClick="restoreDataBase"></ClipFloatBtn>
|
||||
<ClipFullData
|
||||
:isShow="fullDataShow"
|
||||
@ -23,6 +22,7 @@
|
||||
<span class="clip-switch-btn" @click="isMultiple = !isMultiple">{{
|
||||
isMultiple ? '❌ 退出多选' : '👆'
|
||||
}}</span>
|
||||
<span class="clip-switch-btn" v-show="!isMultiple" @click="emit('showSetting')">🎨</span>
|
||||
<span
|
||||
class="clip-switch-btn clip-search-btn"
|
||||
v-show="!isMultiple"
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, computed, nextTick } from 'vue'
|
||||
import ClipCard from '../cpns/ClipCard.vue'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import ClipItemList from '../cpns/ClipItemList.vue'
|
||||
import ClipFullData from '../cpns/ClipFullData.vue'
|
||||
import ClipSearch from '../cpns/ClipSearch.vue'
|
||||
@ -65,7 +65,7 @@ import ClipSwitch from '../cpns/ClipSwitch.vue'
|
||||
import ClipFloatBtn from '../cpns/ClipFloatBtn.vue'
|
||||
import notify from '../data/notify.json'
|
||||
|
||||
const notifyShown = ref(false)
|
||||
const notifyShown = ref(false) // 将在onMounted时根据此值判断是否显示通知
|
||||
const storageNotify = utools.dbStorage.getItem('notify')
|
||||
notifyShown.value = storageNotify ? storageNotify.version < notify.version : true
|
||||
|
||||
@ -117,6 +117,10 @@ const handleMultiCopyBtnClick = (isPaste) => {
|
||||
data: result
|
||||
})
|
||||
}
|
||||
ElMessage({
|
||||
message: '复制成功',
|
||||
type: 'success'
|
||||
})
|
||||
isPaste && window.paste()
|
||||
ClipItemListRef.value.emptySelectItemList()
|
||||
isMultiple.value = false
|
||||
@ -152,7 +156,9 @@ const textFilterCallBack = (item) => {
|
||||
const updateShowList = (type) => {
|
||||
// 更新显示列表
|
||||
showList.value = list.value
|
||||
.filter((item) => (type === 'all' ? item : item.type === type)) // 是 all则返回所有 否则按照 type返回
|
||||
.filter((item) =>
|
||||
type === 'collect' ? item.collect === true : type === 'all' ? item : item.type === type
|
||||
) // 是 collect则返回所有收藏 否则按照 type返回
|
||||
.filter((item) => (filterText.value ? item.type !== 'image' : item)) // 有过滤词 排除掉图片 DataURL
|
||||
.filter((item) => textFilterCallBack(item))
|
||||
.slice(0, GAP) // 重新切分懒加载列表
|
||||
@ -161,10 +167,16 @@ const updateShowList = (type) => {
|
||||
|
||||
const restoreDataBase = () => {
|
||||
// 清空数据库
|
||||
if (window.confirm('确定要清空剪贴板记录吗?')) {
|
||||
window.db.emptyDataBase()
|
||||
updateShowList('all')
|
||||
}
|
||||
ElMessageBox.confirm('确定要清空剪贴板记录吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
window.db.emptyDataBase()
|
||||
updateShowList('all')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
const handleNavClick = (type) => {
|
||||
@ -188,6 +200,8 @@ const handleDataRemove = () => {
|
||||
updateShowList(ClipSwitchRef.value.activeTab)
|
||||
}
|
||||
|
||||
const emit = defineEmits(['showSetting'])
|
||||
|
||||
const activeTab = ref('all')
|
||||
|
||||
onMounted(() => {
|
||||
@ -227,6 +241,21 @@ onMounted(() => {
|
||||
// 监听搜索框
|
||||
watch(filterText, (val) => updateShowList(activeTab.value))
|
||||
|
||||
// 展示通知
|
||||
if (notifyShown.value) {
|
||||
ElMessageBox.alert(notify.content, notify.title, {
|
||||
confirmButtonText: '确定',
|
||||
dangerouslyUseHTMLString: true,
|
||||
callback: () => {
|
||||
utools.dbStorage.setItem('notify', {
|
||||
title: notify.title,
|
||||
content: notify.content,
|
||||
version: notify.version
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 列表懒加载
|
||||
document.addEventListener('scroll', (e) => {
|
||||
const { scrollTop, clientHeight, scrollHeight } = e.target.scrollingElement
|
||||
|
@ -1,28 +0,0 @@
|
||||
<template>
|
||||
<div class="notify">
|
||||
<ClipCard>
|
||||
<template #header>
|
||||
<div class="notify-header">
|
||||
<div class="notify-header-title">通知</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="notify-content">
|
||||
<div class="notify-content-title">通知标题</div>
|
||||
<div class="notify-content-text">通知内容</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="notify-footer">
|
||||
<div class="notify-footer-btn">知道了</div>
|
||||
</div>
|
||||
</template>
|
||||
</ClipCard>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import ClipCard from '../cpns/ClipCard.vue'
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import '../style';
|
||||
</style>
|
176
src/views/Setting.vue
Normal file
176
src/views/Setting.vue
Normal file
@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<div class="setting">
|
||||
<el-card class="setting-card">
|
||||
<template #header>
|
||||
<el-button type="primary" @click="handleLinkClick(0)">🚀 主页</el-button>
|
||||
<el-button @click="handleLinkClick(1)">⚡ 云同步教程</el-button>
|
||||
<el-button @click="handleLinkClick(1)">💡 创造自己的功能按钮</el-button>
|
||||
<el-button @click="handleLinkClick(2)">⭐ 开源代码</el-button>
|
||||
<el-button @click="handleLinkClick(3)">🎈 论坛发布页</el-button>
|
||||
</template>
|
||||
<div class="setting-card-content">
|
||||
<div class="setting-card-content-item">
|
||||
<span>数据库路径</span>
|
||||
<el-input class="path" v-model="path" :title="path" disabled></el-input>
|
||||
<el-button type="primary" @click="handlePathBtnClick('modify')">修改</el-button>
|
||||
<el-button @click="handlePathBtnClick('open')" v-show="path">打开</el-button>
|
||||
<input type="file" id="database-path" :style="{ display: 'none' }" />
|
||||
</div>
|
||||
<div class="setting-card-content-item">
|
||||
<span>最大历史条数</span>
|
||||
<el-select class="number-select" v-model="maxsize" fit-input-width>
|
||||
<el-option v-for="n in [500, 600, 700, 800, 900, 1000]" :key="n" :value="n" />
|
||||
</el-select>
|
||||
条
|
||||
</div>
|
||||
<div class="setting-card-content-item">
|
||||
<span>最长保存时间</span>
|
||||
<el-select class="number-select" v-model="maxage" fit-input-width>
|
||||
<el-option v-for="n in [8, 9, 10, 11, 12, 13, 14]" :key="n" :value="n" />
|
||||
</el-select>
|
||||
天
|
||||
</div>
|
||||
<div class="setting-card-content-item">
|
||||
<span>展示在主界面的功能</span>
|
||||
<el-select
|
||||
class="operation-select"
|
||||
v-model="shown"
|
||||
multiple
|
||||
:multiple-limit="5"
|
||||
placeholder="请选择"
|
||||
:teleported="false"
|
||||
>
|
||||
<el-option
|
||||
v-for="{ id, title, icon } in [
|
||||
...defaultOperation,
|
||||
...custom.map(({ id, title, icon }) => ({ id, title, icon }))
|
||||
]"
|
||||
:key="id"
|
||||
:label="icon + ' ' + title"
|
||||
:value="id"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="setting-card-content-item">
|
||||
<span>自定义功能</span>
|
||||
<el-input v-model="stringCustom" :rows="5" type="textarea" placeholder="Please input" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-card-footer">
|
||||
<el-button @click="handleRestoreBtnClick">重置</el-button>
|
||||
<el-button @click="emit('back')">返回</el-button>
|
||||
<el-button @click="handleSaveBtnClick" type="primary">保存</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import setting from '../global/readSetting'
|
||||
import restoreSetting from '../global/restoreSetting'
|
||||
import defaultOperation from '../data/operation.json'
|
||||
|
||||
const emit = defineEmits(['back'])
|
||||
const { database, operation } = setting
|
||||
|
||||
const path = ref(database.path)
|
||||
const maxsize = ref(database.maxsize)
|
||||
const maxage = ref(database.maxage)
|
||||
|
||||
const shown = ref(operation.shown)
|
||||
const custom = ref(operation.custom)
|
||||
const stringCustom = ref(JSON.stringify(operation.custom))
|
||||
|
||||
const handleLinkClick = (index) => {
|
||||
const links = [
|
||||
'https://ziuchen.gitee.io/project/ClipboardManager/',
|
||||
'https://ziuchen.gitee.io/project/ClipboardManager/guide/',
|
||||
'https://github.com/ZiuChen/ClipboardManager',
|
||||
'https://yuanliao.info/d/5722'
|
||||
]
|
||||
utools.shellOpenExternal(links[index])
|
||||
}
|
||||
|
||||
const handleSaveBtnClick = () => {
|
||||
// 校验格式
|
||||
if (path.value === '') {
|
||||
ElMessage.error('数据库路径不能为空')
|
||||
return
|
||||
} else if (path.value.indexOf('_utools_clipboard_manager_storage') === -1) {
|
||||
ElMessage.error('数据库路径不正确')
|
||||
return
|
||||
}
|
||||
if (stringCustom.value === '') {
|
||||
// 如果将全部清空 则默认为空数组
|
||||
stringCustom.value = '[]'
|
||||
}
|
||||
if (!/^\[.*\]$/.test(stringCustom.value)) {
|
||||
ElMessage.error('自定义功能格式不正确')
|
||||
return
|
||||
}
|
||||
try {
|
||||
custom.value = JSON.parse(stringCustom.value)
|
||||
} catch (error) {
|
||||
custom.value = operation.custom
|
||||
stringCustom.value = JSON.stringify(custom.value)
|
||||
ElMessage.error('自定义功能格式不正确')
|
||||
return
|
||||
}
|
||||
// 执行保存到utools本地数据库
|
||||
utools.dbStorage.setItem(
|
||||
'setting',
|
||||
JSON.parse(
|
||||
JSON.stringify({
|
||||
database: {
|
||||
path: path.value,
|
||||
maxsize: maxsize.value,
|
||||
maxage: maxage.value
|
||||
},
|
||||
operation: {
|
||||
shown: shown.value,
|
||||
custom: custom.value
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
ElMessage.success('保存成功 重启插件生效')
|
||||
}
|
||||
|
||||
const handlePathBtnClick = (param) => {
|
||||
if (param === 'modify') {
|
||||
const file = document.getElementById('database-path')
|
||||
file.click()
|
||||
file.onchange = (e) => {
|
||||
const { files } = e.target
|
||||
if (files.length > 0) {
|
||||
path.value = files[0].path
|
||||
}
|
||||
handleSaveBtnClick()
|
||||
}
|
||||
} else if (param === 'open') {
|
||||
utools.shellShowItemInFolder(path.value)
|
||||
}
|
||||
}
|
||||
|
||||
const handleRestoreBtnClick = () => {
|
||||
ElMessageBox.confirm('确定要重置设置吗', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
restoreSetting()
|
||||
ElMessage({
|
||||
message: '重置成功 重启插件生效',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import '../style';
|
||||
</style>
|
@ -1,6 +1,4 @@
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
const CopyPlugin = require('copy-webpack-plugin')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
publicPath: './',
|
||||
@ -15,15 +13,5 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
])
|
||||
config.plugin('copy-plugin').use(CopyPlugin, [
|
||||
{
|
||||
patterns: [
|
||||
{
|
||||
from: path.join(__dirname, 'README.md'),
|
||||
to: path.join(__dirname, 'dist', 'README.md')
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user