mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-21 11:42:44 +08:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # feature/src/languages/i18n.ts
This commit is contained in:
commit
60ba2bb6ad
@ -88,7 +88,7 @@ If you need more features, please come here to give us suggestions:[issues](ht
|
|||||||
We will add valuable ideas to the later development. At the same time, welcome to join and build together。
|
We will add valuable ideas to the later development. At the same time, welcome to join and build together。
|
||||||
|
|
||||||
## 贡献
|
## 贡献
|
||||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. <a href="https://github.com/rubickCenter/rubick/graphs/contributors"><img src="https://opencollective.com/rubick/contributors.svg?width=890&button=false" /></a>
|
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/rubickCenter/rubick/graphs/contributors)]. <a href="https://github.com/rubickCenter/rubick/graphs/contributors"><img src="https://opencollective.com/rubick/contributors.svg?width=890&button=false" /></a>
|
||||||
|
|
||||||
## 反馈
|
## 反馈
|
||||||
对本项目有兴趣或者想要交流学习的同学可以扫码加下面的微信,备注 rubick,帮助我们更好的成长:
|
对本项目有兴趣或者想要交流学习的同学可以扫码加下面的微信,备注 rubick,帮助我们更好的成长:
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
有价值的想法我们会加入到后期的开发当中。同时也欢迎一起加入共建。
|
有价值的想法我们会加入到后期的开发当中。同时也欢迎一起加入共建。
|
||||||
|
|
||||||
## 贡献
|
## 贡献
|
||||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. <a href="https://github.com/rubickCenter/rubick/graphs/contributors"><img src="https://opencollective.com/rubick/contributors.svg?width=890&button=false" /></a>
|
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/rubickCenter/rubick/graphs/contributors)]. <a href="https://github.com/rubickCenter/rubick/graphs/contributors"><img src="https://opencollective.com/rubick/contributors.svg?width=890&button=false" /></a>
|
||||||
|
|
||||||
## 反馈
|
## 反馈
|
||||||
对本项目有兴趣或者想要交流学习的同学可以扫码加下面的微信,备注 rubick,帮助我们更好的成长:
|
对本项目有兴趣或者想要交流学习的同学可以扫码加下面的微信,备注 rubick,帮助我们更好的成长:
|
||||||
|
@ -80,7 +80,7 @@ window.showNotification = function () {
|
|||||||
rubick.showNotification('HI, rubick')
|
rubick.showNotification('HI, rubick')
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
rubick 更多支持 API 能力参考:[rubick 全局API](https://github.com/rubickCenter/rubick/blob/master/static/preload.js#L49)
|
rubick 更多支持 API 能力参考:[rubick 全局API](https://github.com/rubickCenter/rubick/blob/master/public/preload.js)
|
||||||
|
|
||||||
### 测试写好的插件
|
### 测试写好的插件
|
||||||
由于 `rubick` 插件是基于 `npm` 的管理方式,所以开发者调试插件,也是基于 `npm` 的软连接的方式进行调试。
|
由于 `rubick` 插件是基于 `npm` 的管理方式,所以开发者调试插件,也是基于 `npm` 的软连接的方式进行调试。
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick-system-feature",
|
"name": "rubick-system-feature",
|
||||||
"pluginName": "rubick 系统菜单",
|
"pluginName": "系统菜单",
|
||||||
"description": "rubick 系统菜单",
|
"description": "系统菜单",
|
||||||
"main": "index.html",
|
"main": "index.html",
|
||||||
"logo": "https://pic1.zhimg.com/80/v2-c09780808301668a82e6646cb42f0806_720w.png",
|
"logo": "https://pic1.zhimg.com/80/v2-c09780808301668a82e6646cb42f0806_720w.png",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
@ -10,19 +10,19 @@
|
|||||||
"features": [
|
"features": [
|
||||||
{
|
{
|
||||||
"code": "market",
|
"code": "market",
|
||||||
"explain": "rubick 插件市场",
|
"explain": "插件市场",
|
||||||
"cmds":[
|
"cmds":[
|
||||||
"插件市场"
|
"插件市场"
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
"code": "installed",
|
"code": "installed",
|
||||||
"explain": "rubick 已安装插件",
|
"explain": "已安装插件",
|
||||||
"cmds":[
|
"cmds":[
|
||||||
"已安装插件"
|
"已安装插件"
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
"code": "settings",
|
"code": "settings",
|
||||||
"explain": "rubick 偏好设置",
|
"explain": "偏好设置",
|
||||||
"cmds":[
|
"cmds":[
|
||||||
"偏好设置"
|
"偏好设置"
|
||||||
]
|
]
|
||||||
|
@ -1,16 +1,39 @@
|
|||||||
const {remote} = require("electron");
|
const remote = require('@electron/remote');
|
||||||
|
const { ipcRenderer } = require('electron');
|
||||||
|
|
||||||
|
const ipcSendSync = (type, data) => {
|
||||||
|
const returnValue = ipcRenderer.sendSync('msg-trigger', {
|
||||||
|
type,
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
if (returnValue instanceof Error) throw returnValue;
|
||||||
|
return returnValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
const ipcSend = (type, data) => {
|
||||||
|
ipcRenderer.send('msg-trigger', {
|
||||||
|
type,
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
window.market = {
|
window.market = {
|
||||||
getLocalPlugins() {
|
getLocalPlugins() {
|
||||||
return remote.getGlobal("LOCAL_PLUGINS").getLocalPlugins();
|
return remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||||
},
|
},
|
||||||
downloadPlugin(plugin) {
|
downloadPlugin(plugin) {
|
||||||
return remote.getGlobal("LOCAL_PLUGINS").downloadPlugin(plugin);
|
return remote.getGlobal('LOCAL_PLUGINS').downloadPlugin(plugin);
|
||||||
},
|
},
|
||||||
deletePlugin(plugin) {
|
deletePlugin(plugin) {
|
||||||
return remote.getGlobal("LOCAL_PLUGINS").deletePlugin(plugin);
|
return remote.getGlobal('LOCAL_PLUGINS').deletePlugin(plugin);
|
||||||
},
|
},
|
||||||
refreshPlugin(plugin) {
|
refreshPlugin(plugin) {
|
||||||
return remote.getGlobal("LOCAL_PLUGINS").refreshPlugin(plugin);
|
return remote.getGlobal('LOCAL_PLUGINS').refreshPlugin(plugin);
|
||||||
|
},
|
||||||
|
addLocalStartPlugin(plugin) {
|
||||||
|
ipcSend('addLocalStartPlugin', { plugin });
|
||||||
|
},
|
||||||
|
removeLocalStartPlugin(plugin) {
|
||||||
|
ipcSend('removeLocalStartPlugin', { plugin });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -69,6 +69,7 @@ init();
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-container {
|
.main-container {
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
background: var(--color-body-bg);
|
background: var(--color-body-bg);
|
||||||
|
22
feature/src/confOp.ts
Normal file
22
feature/src/confOp.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
const LOCAL_CONFIG_KEY = 'rubick-local-config';
|
||||||
|
|
||||||
|
const localConfig = {
|
||||||
|
getConfig(): Promise<any> {
|
||||||
|
const data: any = window.rubick.db.get(LOCAL_CONFIG_KEY) || {};
|
||||||
|
return data.data;
|
||||||
|
},
|
||||||
|
|
||||||
|
setConfig(data: any) {
|
||||||
|
const localConfig: any = window.rubick.db.get(LOCAL_CONFIG_KEY) || {};
|
||||||
|
window.rubick.db.put({
|
||||||
|
_id: LOCAL_CONFIG_KEY,
|
||||||
|
_rev: localConfig._rev,
|
||||||
|
data: {
|
||||||
|
...localConfig.data,
|
||||||
|
...data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default localConfig;
|
@ -1,7 +1,7 @@
|
|||||||
import { createI18n } from 'vue-i18n';
|
import { createI18n } from 'vue-i18n';
|
||||||
import messages from './langs';
|
import messages from './langs';
|
||||||
const { remote } = window.require('electron');
|
import localConfig from '@/confOp';
|
||||||
const { perf } = remote.getGlobal('OP_CONFIG').get();
|
const { perf }: any = localConfig.getConfig();
|
||||||
|
|
||||||
// 2. Create i18n instance with options
|
// 2. Create i18n instance with options
|
||||||
const i18n = createI18n({
|
const i18n = createI18n({
|
||||||
|
@ -96,6 +96,9 @@ export default {
|
|||||||
accessToken: 'access token',
|
accessToken: 'access token',
|
||||||
placeholder: 'required for private network gitlab warehouse',
|
placeholder: 'required for private network gitlab warehouse',
|
||||||
},
|
},
|
||||||
|
localstart: {
|
||||||
|
title: 'Local Start',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
dev: {
|
dev: {
|
||||||
title: 'Developer',
|
title: 'Developer',
|
||||||
|
@ -94,6 +94,9 @@ export default {
|
|||||||
accessToken: 'access token',
|
accessToken: 'access token',
|
||||||
placeholder: '内网gitlab仓库必填',
|
placeholder: '内网gitlab仓库必填',
|
||||||
},
|
},
|
||||||
|
localstart: {
|
||||||
|
title: '本地启动',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
dev: {
|
dev: {
|
||||||
title: '开发者',
|
title: '开发者',
|
||||||
|
@ -6,13 +6,12 @@ import store from './store';
|
|||||||
import './assets/ant-reset.less';
|
import './assets/ant-reset.less';
|
||||||
import 'ant-design-vue/dist/antd.variable.min.css';
|
import 'ant-design-vue/dist/antd.variable.min.css';
|
||||||
import registerI18n from './languages/i18n';
|
import registerI18n from './languages/i18n';
|
||||||
|
import localConfig from './confOp';
|
||||||
|
|
||||||
const { remote } = window.require('electron');
|
const config: any = localConfig.getConfig();
|
||||||
|
|
||||||
const { perf } = remote.getGlobal('OP_CONFIG').get();
|
|
||||||
|
|
||||||
ConfigProvider.config({
|
ConfigProvider.config({
|
||||||
theme: perf.custom || {},
|
theme: config.perf.custom || {},
|
||||||
});
|
});
|
||||||
|
|
||||||
createApp(App).use(registerI18n).use(store).use(Antd).use(router).mount('#app');
|
createApp(App).use(registerI18n).use(store).use(Antd).use(router).mount('#app');
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
:title="$t('feature.installed.removeFromPanel')"
|
:title="$t('feature.installed.removeFromPanel')"
|
||||||
>
|
>
|
||||||
<MinusCircleOutlined
|
<MinusCircleOutlined
|
||||||
@click="removePluginToSuperPanel(cmd)"
|
@click="removePluginToSuperPanel({ cmd })"
|
||||||
/>
|
/>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
@ -121,11 +121,11 @@ import { message } from 'ant-design-vue';
|
|||||||
|
|
||||||
const { ipcRenderer } = window.require('electron');
|
const { ipcRenderer } = window.require('electron');
|
||||||
|
|
||||||
const { remote } = window.require('electron');
|
const remote = window.require('@electron/remote');
|
||||||
const fs = window.require('fs');
|
const fs = window.require('fs');
|
||||||
const md = new MarkdownIt();
|
const md = new MarkdownIt();
|
||||||
|
|
||||||
const appPath = remote.app.getPath('cache');
|
const appPath = remote.app.getPath('userData');
|
||||||
const baseDir = path.join(appPath, './rubick-plugins');
|
const baseDir = path.join(appPath, './rubick-plugins');
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
@ -145,9 +145,9 @@ const pluginDetail = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const superPanelPlugins = ref(
|
const superPanelPlugins = ref(
|
||||||
window.rubick.db.get('super-panel-plugins') || {
|
window.rubick.db.get('super-panel-user-plugins') || {
|
||||||
data: [],
|
data: [],
|
||||||
_id: 'super-panel-plugins',
|
_id: 'super-panel-user-plugins',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -165,13 +165,13 @@ const addCmdToSuperPanel = ({ cmd, code }) => {
|
|||||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||||
};
|
};
|
||||||
|
|
||||||
const removePluginToSuperPanel = (cmd) => {
|
const removePluginToSuperPanel = ({ cmd, name }) => {
|
||||||
superPanelPlugins.value.data = toRaw(superPanelPlugins.value).data.filter(
|
superPanelPlugins.value.data = toRaw(superPanelPlugins.value).data.filter(
|
||||||
(item) => {
|
(item) => {
|
||||||
|
if (name) return item.name !== name;
|
||||||
return item.cmd !== cmd;
|
return item.cmd !== cmd;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
console.log(toRaw(superPanelPlugins.value));
|
|
||||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ const readme = computed(() => {
|
|||||||
baseDir,
|
baseDir,
|
||||||
'node_modules',
|
'node_modules',
|
||||||
pluginDetail.value.name,
|
pluginDetail.value.name,
|
||||||
'readme.md'
|
'README.md'
|
||||||
);
|
);
|
||||||
if (fs.existsSync(readmePath)) {
|
if (fs.existsSync(readmePath)) {
|
||||||
const str = fs.readFileSync(readmePath, 'utf-8');
|
const str = fs.readFileSync(readmePath, 'utf-8');
|
||||||
@ -225,9 +225,12 @@ const deletePlugin = async (plugin) => {
|
|||||||
message.error('卸载超时,请重试!');
|
message.error('卸载超时,请重试!');
|
||||||
}, 20000);
|
}, 20000);
|
||||||
await window.market.deletePlugin(plugin);
|
await window.market.deletePlugin(plugin);
|
||||||
|
removePluginToSuperPanel({ name: plugin.name });
|
||||||
updateLocalPlugin();
|
updateLocalPlugin();
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
@ -14,6 +14,12 @@
|
|||||||
</template>
|
</template>
|
||||||
{{ $t('feature.settings.basic.title') }}
|
{{ $t('feature.settings.basic.title') }}
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
|
<a-menu-item key="localstart">
|
||||||
|
<template #icon>
|
||||||
|
<FolderOpenOutlined />
|
||||||
|
</template>
|
||||||
|
{{ $t('feature.settings.localstart.title') }}
|
||||||
|
</a-menu-item>
|
||||||
<a-menu-item key="global">
|
<a-menu-item key="global">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<LaptopOutlined />
|
<LaptopOutlined />
|
||||||
@ -220,6 +226,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<SuperPanel v-if="currentSelect[0] === 'superpanel'" />
|
<SuperPanel v-if="currentSelect[0] === 'superpanel'" />
|
||||||
<Localhost v-if="currentSelect[0] === 'localhost'" />
|
<Localhost v-if="currentSelect[0] === 'localhost'" />
|
||||||
|
<LocalStart v-if="currentSelect[0] === 'localstart'" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -231,19 +238,22 @@ import {
|
|||||||
DatabaseOutlined,
|
DatabaseOutlined,
|
||||||
MinusCircleOutlined,
|
MinusCircleOutlined,
|
||||||
PlusCircleOutlined,
|
PlusCircleOutlined,
|
||||||
FileAddOutlined,
|
|
||||||
UserOutlined,
|
UserOutlined,
|
||||||
|
FolderOpenOutlined,
|
||||||
} from '@ant-design/icons-vue';
|
} from '@ant-design/icons-vue';
|
||||||
import debounce from 'lodash.debounce';
|
import debounce from 'lodash.debounce';
|
||||||
import { ref, reactive, watch, toRefs, computed, onMounted, toRaw } from 'vue';
|
import { ref, reactive, watch, toRefs, computed } from 'vue';
|
||||||
import keycodes from './keycode';
|
import keycodes from './keycode';
|
||||||
import Localhost from './localhost.vue';
|
import Localhost from './localhost.vue';
|
||||||
import SuperPanel from './super-panel.vue';
|
import SuperPanel from './super-panel.vue';
|
||||||
import UserInfo from './user-info';
|
import UserInfo from './user-info';
|
||||||
|
import LocalStart from './local-start';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import localConfig from '@/confOp';
|
||||||
|
|
||||||
const { locale, t } = useI18n();
|
const { locale, t } = useI18n();
|
||||||
|
|
||||||
const { remote, ipcRenderer } = window.require('electron');
|
const { ipcRenderer } = window.require('electron');
|
||||||
|
|
||||||
const examples = [
|
const examples = [
|
||||||
{
|
{
|
||||||
@ -274,7 +284,7 @@ const tipText = computed(() => {
|
|||||||
|
|
||||||
const currentSelect = ref(['userInfo']);
|
const currentSelect = ref(['userInfo']);
|
||||||
|
|
||||||
const { perf, global: defaultGlobal } = remote.getGlobal('OP_CONFIG').get();
|
const { perf, global: defaultGlobal } = localConfig.getConfig();
|
||||||
|
|
||||||
state.shortCut = perf.shortCut;
|
state.shortCut = perf.shortCut;
|
||||||
state.custom = perf.custom;
|
state.custom = perf.custom;
|
||||||
@ -283,7 +293,7 @@ state.local = perf.local;
|
|||||||
state.global = defaultGlobal;
|
state.global = defaultGlobal;
|
||||||
|
|
||||||
const setConfig = debounce(() => {
|
const setConfig = debounce(() => {
|
||||||
remote.getGlobal('OP_CONFIG').set(
|
localConfig.setConfig(
|
||||||
JSON.parse(
|
JSON.parse(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
perf: {
|
perf: {
|
||||||
|
111
feature/src/views/settings/local-start.vue
Normal file
111
feature/src/views/settings/local-start.vue
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
<template>
|
||||||
|
<div class="file-container" @drop.prevent="dropFile" @dragenter="checkDrop" @dragover="checkDrop">
|
||||||
|
<a-alert message="可拖放文件夹到这里加入启动" type="info" show-icon />
|
||||||
|
<a-list item-layout="horizontal" :data-source="localStartList">
|
||||||
|
<template #renderItem="{ item }">
|
||||||
|
<a-list-item>
|
||||||
|
<template #actions>
|
||||||
|
<a key="list-loadmore-edit" @click="() => remove(item)">移除</a>
|
||||||
|
</template>
|
||||||
|
<a-list-item-meta :description="item.desc">
|
||||||
|
<template #title>
|
||||||
|
<div>
|
||||||
|
<span :class="item.del ? 'del-title' : ''">{{item.name}}</span>
|
||||||
|
<span v-if="item.del" class="has-del">文件不存在</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #avatar>
|
||||||
|
<a-avatar shape="square" :src="item.icon" />
|
||||||
|
</template>
|
||||||
|
</a-list-item-meta>
|
||||||
|
</a-list-item>
|
||||||
|
</template>
|
||||||
|
</a-list>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
const fs = window.require('fs');
|
||||||
|
|
||||||
|
const dbId = 'rubick-local-start-app';
|
||||||
|
|
||||||
|
const localStartList = ref(window.rubick.dbStorage.getItem(dbId) || []);
|
||||||
|
|
||||||
|
const checkFileExists = () => {
|
||||||
|
localStartList.value = localStartList.value.map((plugin) => {
|
||||||
|
if (!fs.existsSync(plugin.desc)) {
|
||||||
|
return {
|
||||||
|
...plugin,
|
||||||
|
del: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return plugin;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
checkFileExists();
|
||||||
|
|
||||||
|
const dropFile = (e) => {
|
||||||
|
const files = Array.from(e.dataTransfer.files).map((file) => {
|
||||||
|
const action =
|
||||||
|
process.platform === 'win32'
|
||||||
|
? `start "dummyclient" "${file.path}"`
|
||||||
|
: `open ${file.path.replace(/ /g, '\\ ')}`;
|
||||||
|
const plugin = {
|
||||||
|
icon: window.rubick.getFileIcon(file.path),
|
||||||
|
value: 'plugin',
|
||||||
|
desc: file.path,
|
||||||
|
pluginType: 'app',
|
||||||
|
name: file.name,
|
||||||
|
action,
|
||||||
|
keyWords: [file.name],
|
||||||
|
names: [file.name],
|
||||||
|
};
|
||||||
|
window.market.addLocalStartPlugin(plugin);
|
||||||
|
return plugin;
|
||||||
|
});
|
||||||
|
localStartList.value = [
|
||||||
|
...localStartList.value,
|
||||||
|
...files,
|
||||||
|
];
|
||||||
|
window.rubick.dbStorage.setItem(
|
||||||
|
dbId,
|
||||||
|
JSON.parse(JSON.stringify(localStartList.value))
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const remove = (item) => {
|
||||||
|
localStartList.value = localStartList.value.filter(
|
||||||
|
(app) => app.desc !== item.desc
|
||||||
|
);
|
||||||
|
window.rubick.dbStorage.setItem(
|
||||||
|
dbId,
|
||||||
|
JSON.parse(JSON.stringify(localStartList.value))
|
||||||
|
);
|
||||||
|
window.market.removeLocalStartPlugin(JSON.parse(JSON.stringify(item)));
|
||||||
|
};
|
||||||
|
|
||||||
|
const checkDrop = (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.file-container {
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background: var(--color-body-bg);
|
||||||
|
height: calc(~'100vh - 106px');
|
||||||
|
.del-title {
|
||||||
|
text-decoration-line: line-through;
|
||||||
|
text-decoration-color: var(--ant-error-color);
|
||||||
|
}
|
||||||
|
.has-del {
|
||||||
|
color: var(--ant-error-color);
|
||||||
|
font-size: 12px;
|
||||||
|
margin-left: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -122,30 +122,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer-btn">
|
<!-- <div class="footer-btn">-->
|
||||||
<a-button @click="reset" type="danger">
|
<!-- <a-button @click="reset" type="danger">-->
|
||||||
{{ $t('feature.settings.account.reset') }}
|
<!-- {{ $t('feature.settings.account.reset') }}-->
|
||||||
</a-button>
|
<!-- </a-button>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, toRefs, watch } from 'vue';
|
import { reactive, ref, toRefs, watch } from 'vue';
|
||||||
import { Modal } from 'ant-design-vue';
|
|
||||||
import { UserOutlined } from '@ant-design/icons-vue';
|
|
||||||
import debounce from 'lodash.debounce';
|
import debounce from 'lodash.debounce';
|
||||||
|
import localConfig from '@/confOp';
|
||||||
|
|
||||||
import service from '../../assets/service';
|
import service from '../../assets/service';
|
||||||
|
|
||||||
const { remote, ipcRenderer } = window.require('electron');
|
const { ipcRenderer } = window.require('electron');
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
custom: {},
|
custom: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { perf } = remote.getGlobal('OP_CONFIG').get();
|
const { perf } = localConfig.getConfig();
|
||||||
|
|
||||||
state.custom = perf.custom || {};
|
state.custom = perf.custom || {};
|
||||||
|
|
||||||
@ -156,7 +155,7 @@ const userInfo = ref(window.rubick.dbStorage.getItem('rubick-user-info'));
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
const setConfig = debounce(() => {
|
const setConfig = debounce(() => {
|
||||||
remote.getGlobal('OP_CONFIG').set(
|
localConfig.setConfig(
|
||||||
JSON.parse(
|
JSON.parse(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
perf: {
|
perf: {
|
||||||
@ -181,17 +180,17 @@ const changeLogo = () => {
|
|||||||
state.custom.logo = `file://${logoPath}`;
|
state.custom.logo = `file://${logoPath}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const reset = () => {
|
// const reset = () => {
|
||||||
Modal.warning({
|
// Modal.warning({
|
||||||
title: '确定恢复默认设置吗?',
|
// title: '确定恢复默认设置吗?',
|
||||||
content: '回复后之前的设置将会被清空',
|
// content: '回复后之前的设置将会被清空',
|
||||||
onOk() {
|
// onOk() {
|
||||||
const defaultcustom = remote.getGlobal('OP_CONFIG').getDefaultConfig()
|
// const defaultcustom = remote.getGlobal('OP_CONFIG').getDefaultConfig()
|
||||||
.perf.custom;
|
// .perf.custom;
|
||||||
state.custom = JSON.parse(JSON.stringify(defaultcustom));
|
// state.custom = JSON.parse(JSON.stringify(defaultcustom));
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
};
|
// };
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve --port 8083",
|
"serve": "vue-cli-service serve --port 8084",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick",
|
"name": "rubick",
|
||||||
"version": "2.4.5",
|
"version": "3.1.0",
|
||||||
"author": "muwoo <2424880409@qq.com>",
|
"author": "muwoo <2424880409@qq.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -20,6 +20,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@better-scroll/core": "^2.4.2",
|
"@better-scroll/core": "^2.4.2",
|
||||||
|
"@electron/remote": "^2.0.10",
|
||||||
"ant-design-vue": "3.2.14",
|
"ant-design-vue": "3.2.14",
|
||||||
"axios": "^1.3.4",
|
"axios": "^1.3.4",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
@ -31,7 +32,9 @@
|
|||||||
"got": "^11.8.3",
|
"got": "^11.8.3",
|
||||||
"lodash.throttle": "^4.1.1",
|
"lodash.throttle": "^4.1.1",
|
||||||
"node-key-sender": "^1.0.11",
|
"node-key-sender": "^1.0.11",
|
||||||
|
"pinyin-match": "^1.2.4",
|
||||||
"pouchdb": "^7.2.2",
|
"pouchdb": "^7.2.2",
|
||||||
|
"simple-plist": "0.2.1",
|
||||||
"vue": "^3.0.0",
|
"vue": "^3.0.0",
|
||||||
"vue-router": "^4.0.0-0",
|
"vue-router": "^4.0.0-0",
|
||||||
"vuex": "^4.0.0-0",
|
"vuex": "^4.0.0-0",
|
||||||
@ -52,7 +55,7 @@
|
|||||||
"@vue/eslint-config-prettier": "^6.0.0",
|
"@vue/eslint-config-prettier": "^6.0.0",
|
||||||
"@vue/eslint-config-typescript": "^7.0.0",
|
"@vue/eslint-config-typescript": "^7.0.0",
|
||||||
"babel-plugin-import": "^1.13.3",
|
"babel-plugin-import": "^1.13.3",
|
||||||
"electron": "^13.0.0",
|
"electron": "26.0.0",
|
||||||
"electron-builder": "22.13.1",
|
"electron-builder": "22.13.1",
|
||||||
"electron-devtools-installer": "^3.1.0",
|
"electron-devtools-installer": "^3.1.0",
|
||||||
"eslint": "^6.7.2",
|
"eslint": "^6.7.2",
|
||||||
|
2
public/feature/css/app.4e3502cb.css
Normal file
2
public/feature/css/app.4e3502cb.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>feature</title><link href="css/app.518884da.css" rel="preload" as="style"><link href="css/chunk-vendors.7f9dcb72.css" rel="preload" as="style"><link href="js/app.e81c0c2f.js" rel="preload" as="script"><link href="js/chunk-vendors.cc39b888.js" rel="preload" as="script"><link href="css/chunk-vendors.7f9dcb72.css" rel="stylesheet"><link href="css/app.518884da.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but feature doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.cc39b888.js"></script><script src="js/app.e81c0c2f.js"></script></body></html>
|
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>feature</title><link href="css/app.4e3502cb.css" rel="preload" as="style"><link href="css/chunk-vendors.7f9dcb72.css" rel="preload" as="style"><link href="js/app.5fe607e9.js" rel="preload" as="script"><link href="js/chunk-vendors.73a23bae.js" rel="preload" as="script"><link href="css/chunk-vendors.7f9dcb72.css" rel="stylesheet"><link href="css/app.4e3502cb.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but feature doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.73a23bae.js"></script><script src="js/app.5fe607e9.js"></script></body></html>
|
2
public/feature/js/app.5fe607e9.js
Normal file
2
public/feature/js/app.5fe607e9.js
Normal file
File diff suppressed because one or more lines are too long
1
public/feature/js/app.5fe607e9.js.map
Normal file
1
public/feature/js/app.5fe607e9.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
38
public/feature/js/chunk-vendors.73a23bae.js
Normal file
38
public/feature/js/chunk-vendors.73a23bae.js
Normal file
File diff suppressed because one or more lines are too long
1
public/feature/js/chunk-vendors.73a23bae.js.map
Normal file
1
public/feature/js/chunk-vendors.73a23bae.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick-system-feature",
|
"name": "rubick-system-feature",
|
||||||
"pluginName": "rubick 系统菜单",
|
"pluginName": "系统菜单",
|
||||||
"description": "rubick 系统菜单",
|
"description": "系统菜单",
|
||||||
"main": "index.html",
|
"main": "index.html",
|
||||||
"logo": "https://pic1.zhimg.com/80/v2-c09780808301668a82e6646cb42f0806_720w.png",
|
"logo": "https://pic1.zhimg.com/80/v2-c09780808301668a82e6646cb42f0806_720w.png",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
@ -10,19 +10,19 @@
|
|||||||
"features": [
|
"features": [
|
||||||
{
|
{
|
||||||
"code": "market",
|
"code": "market",
|
||||||
"explain": "rubick 插件市场",
|
"explain": "插件市场",
|
||||||
"cmds":[
|
"cmds":[
|
||||||
"插件市场"
|
"插件市场"
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
"code": "installed",
|
"code": "installed",
|
||||||
"explain": "rubick 已安装插件",
|
"explain": "已安装插件",
|
||||||
"cmds":[
|
"cmds":[
|
||||||
"已安装插件"
|
"已安装插件"
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
"code": "settings",
|
"code": "settings",
|
||||||
"explain": "rubick 偏好设置",
|
"explain": "偏好设置",
|
||||||
"cmds":[
|
"cmds":[
|
||||||
"偏好设置"
|
"偏好设置"
|
||||||
]
|
]
|
||||||
|
@ -1,16 +1,39 @@
|
|||||||
const {remote} = require("electron");
|
const remote = require('@electron/remote');
|
||||||
|
const { ipcRenderer } = require('electron');
|
||||||
|
|
||||||
|
const ipcSendSync = (type, data) => {
|
||||||
|
const returnValue = ipcRenderer.sendSync('msg-trigger', {
|
||||||
|
type,
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
if (returnValue instanceof Error) throw returnValue;
|
||||||
|
return returnValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
const ipcSend = (type, data) => {
|
||||||
|
ipcRenderer.send('msg-trigger', {
|
||||||
|
type,
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
window.market = {
|
window.market = {
|
||||||
getLocalPlugins() {
|
getLocalPlugins() {
|
||||||
return remote.getGlobal("LOCAL_PLUGINS").getLocalPlugins();
|
return remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||||
},
|
},
|
||||||
downloadPlugin(plugin) {
|
downloadPlugin(plugin) {
|
||||||
return remote.getGlobal("LOCAL_PLUGINS").downloadPlugin(plugin);
|
return remote.getGlobal('LOCAL_PLUGINS').downloadPlugin(plugin);
|
||||||
},
|
},
|
||||||
deletePlugin(plugin) {
|
deletePlugin(plugin) {
|
||||||
return remote.getGlobal("LOCAL_PLUGINS").deletePlugin(plugin);
|
return remote.getGlobal('LOCAL_PLUGINS').deletePlugin(plugin);
|
||||||
},
|
},
|
||||||
refreshPlugin(plugin) {
|
refreshPlugin(plugin) {
|
||||||
return remote.getGlobal("LOCAL_PLUGINS").refreshPlugin(plugin);
|
return remote.getGlobal('LOCAL_PLUGINS').refreshPlugin(plugin);
|
||||||
|
},
|
||||||
|
addLocalStartPlugin(plugin) {
|
||||||
|
ipcSend('addLocalStartPlugin', { plugin });
|
||||||
|
},
|
||||||
|
removeLocalStartPlugin(plugin) {
|
||||||
|
ipcSend('removeLocalStartPlugin', { plugin });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
version: 12,
|
version: 0,
|
||||||
perf: {
|
perf: {
|
||||||
custom: {
|
custom: {
|
||||||
primaryColor: '#ff4ea4',
|
primaryColor: '#ff4ea4',
|
||||||
|
@ -1,89 +1,86 @@
|
|||||||
import { app } from "electron";
|
import { app } from 'electron';
|
||||||
import path from "path";
|
import path from 'path';
|
||||||
|
|
||||||
const appPath = app.getPath("cache");
|
const appPath = app.getPath('userData');
|
||||||
|
|
||||||
console.log(appPath);
|
const PLUGIN_INSTALL_DIR = path.join(appPath, './rubick-plugins');
|
||||||
|
|
||||||
|
|
||||||
const PLUGIN_INSTALL_DIR = path.join(appPath, "./rubick-plugins");
|
|
||||||
|
|
||||||
const DECODE_KEY = {
|
const DECODE_KEY = {
|
||||||
Backspace: "Backspace",
|
Backspace: 'Backspace',
|
||||||
Tab: "Tab",
|
Tab: 'Tab',
|
||||||
Enter: "Enter",
|
Enter: 'Enter',
|
||||||
MediaPlayPause: "MediaPlayPause",
|
MediaPlayPause: 'MediaPlayPause',
|
||||||
Escape: "Escape",
|
Escape: 'Escape',
|
||||||
Space: "Space",
|
Space: 'Space',
|
||||||
PageUp: "PageUp",
|
PageUp: 'PageUp',
|
||||||
PageDown: "PageDown",
|
PageDown: 'PageDown',
|
||||||
End: "End",
|
End: 'End',
|
||||||
Home: "Home",
|
Home: 'Home',
|
||||||
ArrowLeft: "Left",
|
ArrowLeft: 'Left',
|
||||||
ArrowUp: "Up",
|
ArrowUp: 'Up',
|
||||||
ArrowRight: "Right",
|
ArrowRight: 'Right',
|
||||||
ArrowDown: "Down",
|
ArrowDown: 'Down',
|
||||||
PrintScreen: "PrintScreen",
|
PrintScreen: 'PrintScreen',
|
||||||
Insert: "Insert",
|
Insert: 'Insert',
|
||||||
Delete: "Delete",
|
Delete: 'Delete',
|
||||||
Digit0: "0",
|
Digit0: '0',
|
||||||
Digit1: "1",
|
Digit1: '1',
|
||||||
Digit2: "2",
|
Digit2: '2',
|
||||||
Digit3: "3",
|
Digit3: '3',
|
||||||
Digit4: "4",
|
Digit4: '4',
|
||||||
Digit5: "5",
|
Digit5: '5',
|
||||||
Digit6: "6",
|
Digit6: '6',
|
||||||
Digit7: "7",
|
Digit7: '7',
|
||||||
Digit8: "8",
|
Digit8: '8',
|
||||||
Digit9: "9",
|
Digit9: '9',
|
||||||
KeyA: "A",
|
KeyA: 'A',
|
||||||
KeyB: "B",
|
KeyB: 'B',
|
||||||
KeyC: "C",
|
KeyC: 'C',
|
||||||
KeyD: "D",
|
KeyD: 'D',
|
||||||
KeyE: "E",
|
KeyE: 'E',
|
||||||
KeyF: "F",
|
KeyF: 'F',
|
||||||
KeyG: "G",
|
KeyG: 'G',
|
||||||
KeyH: "H",
|
KeyH: 'H',
|
||||||
KeyI: "I",
|
KeyI: 'I',
|
||||||
KeyJ: "J",
|
KeyJ: 'J',
|
||||||
KeyK: "K",
|
KeyK: 'K',
|
||||||
KeyL: "L",
|
KeyL: 'L',
|
||||||
KeyM: "M",
|
KeyM: 'M',
|
||||||
KeyN: "N",
|
KeyN: 'N',
|
||||||
KeyO: "O",
|
KeyO: 'O',
|
||||||
KeyP: "P",
|
KeyP: 'P',
|
||||||
KeyQ: "Q",
|
KeyQ: 'Q',
|
||||||
KeyR: "R",
|
KeyR: 'R',
|
||||||
KeyS: "S",
|
KeyS: 'S',
|
||||||
KeyT: "T",
|
KeyT: 'T',
|
||||||
KeyU: "U",
|
KeyU: 'U',
|
||||||
KeyV: "V",
|
KeyV: 'V',
|
||||||
KeyW: "W",
|
KeyW: 'W',
|
||||||
KeyX: "X",
|
KeyX: 'X',
|
||||||
KeyY: "Y",
|
KeyY: 'Y',
|
||||||
KeyZ: "Z",
|
KeyZ: 'Z',
|
||||||
F1: "F1",
|
F1: 'F1',
|
||||||
F2: "F2",
|
F2: 'F2',
|
||||||
F3: "F3",
|
F3: 'F3',
|
||||||
F4: "F4",
|
F4: 'F4',
|
||||||
F5: "F5",
|
F5: 'F5',
|
||||||
F6: "F6",
|
F6: 'F6',
|
||||||
F7: "F7",
|
F7: 'F7',
|
||||||
F8: "F8",
|
F8: 'F8',
|
||||||
F9: "F9",
|
F9: 'F9',
|
||||||
F10: "F10",
|
F10: 'F10',
|
||||||
F11: "F11",
|
F11: 'F11',
|
||||||
F12: "F12",
|
F12: 'F12',
|
||||||
Semicolon: ";",
|
Semicolon: ';',
|
||||||
Equal: "=",
|
Equal: '=',
|
||||||
Comma: ",",
|
Comma: ',',
|
||||||
Minus: "-",
|
Minus: '-',
|
||||||
Period: ".",
|
Period: '.',
|
||||||
Slash: "/",
|
Slash: '/',
|
||||||
Backquote: "`",
|
Backquote: '`',
|
||||||
BracketLeft: "[",
|
BracketLeft: '[',
|
||||||
Backslash: "\\",
|
Backslash: '\\',
|
||||||
BracketRight: "]",
|
BracketRight: ']',
|
||||||
Quote: "'",
|
Quote: "'",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { remote } from "electron";
|
import { app } from '@electron/remote';
|
||||||
import path from "path";
|
import path from 'path';
|
||||||
|
|
||||||
const appPath = remote.app.getPath("cache");
|
const appPath = app.getPath('userData');
|
||||||
|
|
||||||
const PLUGIN_INSTALL_DIR = path.join(appPath, "./rubick-plugins");
|
const PLUGIN_INSTALL_DIR = path.join(appPath, './rubick-plugins');
|
||||||
|
|
||||||
export { PLUGIN_INSTALL_DIR };
|
export { PLUGIN_INSTALL_DIR };
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
export default {
|
export default {
|
||||||
linux(): boolean {
|
linux(): boolean {
|
||||||
return process.platform === "linux";
|
return process.platform === 'linux';
|
||||||
},
|
},
|
||||||
macOS(): boolean {
|
macOS(): boolean {
|
||||||
return process.platform === "darwin";
|
return process.platform === 'darwin';
|
||||||
},
|
},
|
||||||
windows(): boolean {
|
windows(): boolean {
|
||||||
return process.platform === "win32";
|
return process.platform === 'win32';
|
||||||
},
|
},
|
||||||
production(): boolean {
|
production(): boolean {
|
||||||
return process.env.NODE_ENV !== "development";
|
return process.env.NODE_ENV !== 'development';
|
||||||
},
|
},
|
||||||
dev(): boolean {
|
dev(): boolean {
|
||||||
return process.env.NODE_ENV === "development";
|
return process.env.NODE_ENV === 'development';
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import commonConst from './commonConst';
|
|
||||||
|
|
||||||
const useDrag = () => {
|
const useDrag = () => {
|
||||||
let animationId: number;
|
let animationId: number;
|
||||||
@ -10,7 +9,7 @@ const useDrag = () => {
|
|||||||
let draggable = true;
|
let draggable = true;
|
||||||
|
|
||||||
const onMouseDown = (e) => {
|
const onMouseDown = (e) => {
|
||||||
if (commonConst.macOS()) return;
|
// if (commonConst.macOS()) return;
|
||||||
draggable = true;
|
draggable = true;
|
||||||
mouseX = e.clientX;
|
mouseX = e.clientX;
|
||||||
mouseY = e.clientY;
|
mouseY = e.clientY;
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
import commonConst from "./commonConst";
|
import commonConst from './commonConst';
|
||||||
import { clipboard, remote } from "electron";
|
import { clipboard } from 'electron';
|
||||||
import plist from "plist";
|
import plist from 'plist';
|
||||||
import fs from "fs";
|
import fs from 'fs';
|
||||||
import path from "path";
|
import path from 'path';
|
||||||
import ofs from "original-fs";
|
import ofs from 'original-fs';
|
||||||
|
|
||||||
export default function getCopyFiles(): Array<any> | null {
|
export default function getCopyFiles(): Array<any> | null {
|
||||||
let fileInfo;
|
let fileInfo;
|
||||||
if (commonConst.macOS()) {
|
if (commonConst.macOS()) {
|
||||||
if (!clipboard.has("NSFilenamesPboardType")) return null;
|
if (!clipboard.has('NSFilenamesPboardType')) return null;
|
||||||
const result = clipboard.read("NSFilenamesPboardType");
|
const result = clipboard.read('NSFilenamesPboardType');
|
||||||
if (!result) return null;
|
if (!result) return null;
|
||||||
try {
|
try {
|
||||||
fileInfo = plist.parse(result);
|
fileInfo = plist.parse(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if (process.platform === "win32") {
|
} else if (process.platform === 'win32') {
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
const clipboardEx = require("electron-clipboard-ex");
|
const clipboardEx = require('electron-clipboard-ex');
|
||||||
fileInfo = clipboardEx.readFilePaths();
|
fileInfo = clipboardEx.readFilePaths();
|
||||||
// todo
|
// todo
|
||||||
} else {
|
} else {
|
||||||
if (!commonConst.linux()) return null;
|
if (!commonConst.linux()) return null;
|
||||||
if (!clipboard.has("text/uri-list")) return null;
|
if (!clipboard.has('text/uri-list')) return null;
|
||||||
const result = clipboard.read("text/uri-list").match(/^file:\/\/\/.*/gm);
|
const result = clipboard.read('text/uri-list').match(/^file:\/\/\/.*/gm);
|
||||||
if (!result || !result.length) return null;
|
if (!result || !result.length) return null;
|
||||||
fileInfo = result.map((e) =>
|
fileInfo = result.map((e) =>
|
||||||
decodeURIComponent(e).replace(/^file:\/\//, "")
|
decodeURIComponent(e).replace(/^file:\/\//, '')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!Array.isArray(fileInfo)) return null;
|
if (!Array.isArray(fileInfo)) return null;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import path from "path";
|
import path from 'path';
|
||||||
import fs from "fs";
|
import fs from 'fs';
|
||||||
|
|
||||||
export default (): string => {
|
export default (): string => {
|
||||||
let localDataFile: any = process.env.HOME;
|
let localDataFile: any = process.env.HOME;
|
||||||
if (!localDataFile) {
|
if (!localDataFile) {
|
||||||
localDataFile = process.env.LOCALAPPDATA;
|
localDataFile = process.env.LOCALAPPDATA;
|
||||||
}
|
}
|
||||||
const rubickPath = path.join(localDataFile, "rubick");
|
const rubickPath = path.join(localDataFile, 'rubick');
|
||||||
if (!fs.existsSync(rubickPath)) {
|
if (!fs.existsSync(rubickPath)) {
|
||||||
fs.mkdirSync(rubickPath);
|
fs.mkdirSync(rubickPath);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
const WINDOW_MAX_HEIGHT = 600;
|
const WINDOW_MAX_HEIGHT = 600;
|
||||||
const WINDOW_MIN_HEIGHT = 60;
|
const WINDOW_MIN_HEIGHT = 60;
|
||||||
const PRE_ITEM_HEIGHT = 60;
|
const PRE_ITEM_HEIGHT = 60;
|
||||||
|
const HISTORY_HEIGHT = 80;
|
||||||
|
|
||||||
export default (searchList: Array<any>): number => {
|
export default (searchList: Array<any>, historyList): number => {
|
||||||
if (!searchList) return WINDOW_MAX_HEIGHT;
|
const defaultHeight = historyList.length ? HISTORY_HEIGHT : 0;
|
||||||
if (!searchList.length) return WINDOW_MIN_HEIGHT;
|
if (!searchList) return WINDOW_MAX_HEIGHT + defaultHeight;
|
||||||
return searchList.length * PRE_ITEM_HEIGHT + WINDOW_MIN_HEIGHT + 5 >
|
if (!searchList.length) return WINDOW_MIN_HEIGHT + defaultHeight;
|
||||||
|
return searchList.length * PRE_ITEM_HEIGHT + WINDOW_MIN_HEIGHT >
|
||||||
WINDOW_MAX_HEIGHT
|
WINDOW_MAX_HEIGHT
|
||||||
? WINDOW_MAX_HEIGHT
|
? WINDOW_MAX_HEIGHT
|
||||||
: searchList.length * PRE_ITEM_HEIGHT + WINDOW_MIN_HEIGHT + 5;
|
: searchList.length * PRE_ITEM_HEIGHT + WINDOW_MIN_HEIGHT;
|
||||||
};
|
};
|
||||||
|
@ -16,16 +16,7 @@ if (!exists) {
|
|||||||
|
|
||||||
const isZhRegex = /[\u4e00-\u9fa5]/;
|
const isZhRegex = /[\u4e00-\u9fa5]/;
|
||||||
|
|
||||||
async function getAppIcon(
|
async function getAppIcon(appPath: string, nativeImage: any, name: string) {
|
||||||
appPath: string,
|
|
||||||
nativeImage: {
|
|
||||||
createThumbnailFromPath: (
|
|
||||||
iconPath: string,
|
|
||||||
size: { width: number; height: number }
|
|
||||||
) => { toDataURL: () => string };
|
|
||||||
},
|
|
||||||
name: string
|
|
||||||
) {
|
|
||||||
try {
|
try {
|
||||||
const iconpath = path.join(icondir, `${name}.png`);
|
const iconpath = path.join(icondir, `${name}.png`);
|
||||||
const iconnone = path.join(icondir, `${name}.none`);
|
const iconnone = path.join(icondir, `${name}.none`);
|
||||||
@ -33,52 +24,40 @@ async function getAppIcon(
|
|||||||
const existsnone = fs.existsSync(iconnone);
|
const existsnone = fs.existsSync(iconnone);
|
||||||
if (exists) return true;
|
if (exists) return true;
|
||||||
if (existsnone) return false;
|
if (existsnone) return false;
|
||||||
const appName: string = appPath.split('/').pop() || '';
|
// const appName: string = appPath.split('/').pop() || '';
|
||||||
const extname: string = path.extname(appName);
|
// const extname: string = path.extname(appName);
|
||||||
const appSubStr: string = appName.split(extname)[0];
|
// const appSubStr: string = appName.split(extname)[0];
|
||||||
const path1 = path.join(appPath, `/Contents/Resources/App.icns`);
|
// const path1 = path.join(appPath, `/Contents/Resources/App.icns`);
|
||||||
const path2 = path.join(appPath, `/Contents/Resources/AppIcon.icns`);
|
// const path2 = path.join(appPath, `/Contents/Resources/AppIcon.icns`);
|
||||||
const path3 = path.join(appPath, `/Contents/Resources/${appSubStr}.icns`);
|
// const path3 = path.join(appPath, `/Contents/Resources/${appSubStr}.icns`);
|
||||||
const path4 = path.join(
|
// const path4 = path.join(
|
||||||
appPath,
|
// appPath,
|
||||||
`/Contents/Resources/${appSubStr.replace(' ', '')}.icns`
|
// `/Contents/Resources/${appSubStr.replace(' ', '')}.icns`
|
||||||
);
|
// );
|
||||||
let iconPath: string = path1;
|
// let iconPath: string = path1;
|
||||||
if (fs.existsSync(path1)) {
|
// if (fs.existsSync(path1)) {
|
||||||
iconPath = path1;
|
// iconPath = path1;
|
||||||
} else if (fs.existsSync(path2)) {
|
// } else if (fs.existsSync(path2)) {
|
||||||
iconPath = path2;
|
// iconPath = path2;
|
||||||
} else if (fs.existsSync(path3)) {
|
// } else if (fs.existsSync(path3)) {
|
||||||
iconPath = path3;
|
// iconPath = path3;
|
||||||
} else if (fs.existsSync(path4)) {
|
// } else if (fs.existsSync(path4)) {
|
||||||
iconPath = path4;
|
// iconPath = path4;
|
||||||
} else {
|
// } else {
|
||||||
// 性能最低的方式
|
// // 性能最低的方式
|
||||||
const resourceList = fs.readdirSync(
|
// const resourceList = fs.readdirSync(
|
||||||
path.join(appPath, `/Contents/Resources`)
|
// path.join(appPath, `/Contents/Resources`)
|
||||||
);
|
// );
|
||||||
const iconName = resourceList.filter(
|
// const iconName = resourceList.filter(
|
||||||
(file) => path.extname(file) === '.icns'
|
// (file) => path.extname(file) === '.icns'
|
||||||
)[0];
|
// )[0];
|
||||||
if (!iconName) {
|
// if (!iconName) {
|
||||||
fs.writeFileSync(iconnone, '');
|
// fs.writeFileSync(iconnone, '');
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
iconPath = path.join(appPath, `/Contents/Resources/${iconName}`);
|
// iconPath = path.join(appPath, `/Contents/Resources/${iconName}`);
|
||||||
}
|
// }
|
||||||
const img = await nativeImage.createThumbnailFromPath(iconPath, {
|
await getMacApps.app2png(appPath, iconpath);
|
||||||
width: 64,
|
|
||||||
height: 64,
|
|
||||||
});
|
|
||||||
|
|
||||||
const base64Data = img.toDataURL().replace(/^data:.+;base64,/, '"');
|
|
||||||
|
|
||||||
const result = Buffer.from(base64Data, 'base64');
|
|
||||||
|
|
||||||
fs.writeFile(iconpath, result, 'base64', () => {
|
|
||||||
// todo
|
|
||||||
});
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false;
|
return false;
|
||||||
@ -120,12 +99,12 @@ export default async (nativeImage: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (app._name && isZhRegex.test(app._name)) {
|
if (app._name && isZhRegex.test(app._name)) {
|
||||||
const [, pinyinArr] = translate(app._name);
|
// const [, pinyinArr] = translate(app._name);
|
||||||
const firstLatter = pinyinArr.map((py) => py[0]);
|
// const firstLatter = pinyinArr.map((py) => py[0]);
|
||||||
// 拼音
|
// // 拼音
|
||||||
fileOptions.keyWords.push(pinyinArr.join(''));
|
// fileOptions.keyWords.push(pinyinArr.join(''));
|
||||||
// 缩写
|
// // 缩写
|
||||||
fileOptions.keyWords.push(firstLatter.join(''));
|
// fileOptions.keyWords.push(firstLatter.join(''));
|
||||||
// 中文
|
// 中文
|
||||||
fileOptions.keyWords.push(app._name);
|
fileOptions.keyWords.push(app._name);
|
||||||
}
|
}
|
||||||
|
109
src/core/app-search/get-mac-app/app2png.ts
Normal file
109
src/core/app-search/get-mac-app/app2png.ts
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
import path from 'path';
|
||||||
|
import fs from 'fs';
|
||||||
|
import { exec } from 'child_process';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
const plist = require('simple-plist');
|
||||||
|
|
||||||
|
const getIconFile = (appFileInput) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const plistPath = path.join(appFileInput, 'Contents', 'Info.plist');
|
||||||
|
plist.readFile(plistPath, (err, data) => {
|
||||||
|
if (err || !data.CFBundleIconFile) {
|
||||||
|
return resolve(
|
||||||
|
'/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const iconFile = path.join(
|
||||||
|
appFileInput,
|
||||||
|
'Contents',
|
||||||
|
'Resources',
|
||||||
|
data.CFBundleIconFile
|
||||||
|
);
|
||||||
|
const iconFiles = [iconFile, iconFile + '.icns', iconFile + '.tiff'];
|
||||||
|
const existedIcon = iconFiles.find((iconFile) => {
|
||||||
|
return fs.existsSync(iconFile);
|
||||||
|
});
|
||||||
|
resolve(
|
||||||
|
existedIcon ||
|
||||||
|
'/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// const sortIcons = (icons) => {
|
||||||
|
// const aWins = -1;
|
||||||
|
// const bWins = 1;
|
||||||
|
// const catWins = 0;
|
||||||
|
// return icons.sort((a, b) => {
|
||||||
|
// const aSize = parseInt(a.match(/(\d+)x\1/)[1], 10);
|
||||||
|
// const bSize = parseInt(b.match(/(\d+)x\1/)[1], 10);
|
||||||
|
// if (aSize === bSize) {
|
||||||
|
// if (a.indexOf('@2x') > -1) return aWins;
|
||||||
|
// if (b.indexOf('@2x') > -1) return bWins;
|
||||||
|
// return catWins;
|
||||||
|
// }
|
||||||
|
// if (aSize > bSize) return aWins;
|
||||||
|
// if (aSize < bSize) return bWins;
|
||||||
|
// return catWins;
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const icnsToPng = (iconFile, pngFileOutput) => {
|
||||||
|
// const outputDir = pngFileOutput.split('.')[0] + '.iconset'
|
||||||
|
// return new Promise((resolve, reject) => {
|
||||||
|
// exec(`iconutil --convert iconset '${iconFile}' --output '${outputDir}'`, (error) => {
|
||||||
|
// if (error) return reject(error)
|
||||||
|
// fs.readdir(outputDir, (error, files) => {
|
||||||
|
// if (error) {
|
||||||
|
// return resolve(tiffToPng(iconFile, pngFileOutput))
|
||||||
|
// }
|
||||||
|
// const realIcons = files.map((file) => {
|
||||||
|
// return path.join(outputDir, file)
|
||||||
|
// })
|
||||||
|
// const biggestIcon = sortIcons(realIcons).find(Boolean)
|
||||||
|
// fs.rename(biggestIcon, pngFileOutput, (error) => {
|
||||||
|
// error ? reject(error) : resolve(realIcons.filter((file) => {
|
||||||
|
// return file !== biggestIcon
|
||||||
|
// }))
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }).then((files) => {
|
||||||
|
// // Cleanup temp icons
|
||||||
|
// return Promise.all(files.map((file) => {
|
||||||
|
// return new Promise((resolve, reject) => {
|
||||||
|
// fs.unlink(file, (error) => {
|
||||||
|
// error ? reject(error) : resolve()
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }))
|
||||||
|
// }).then(() => {
|
||||||
|
// // Cleanup temp directory
|
||||||
|
// return new Promise((resolve, reject) => {
|
||||||
|
// fs.rmdir(outputDir, (error) => {
|
||||||
|
// error ? reject(error) : resolve()
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
const tiffToPng = (iconFile, pngFileOutput) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
exec(
|
||||||
|
`sips -s format png '${iconFile}' --out '${pngFileOutput}' --resampleHeightWidth 64 64`,
|
||||||
|
(error) => {
|
||||||
|
error ? reject(error) : resolve(null);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const app2png = (appFileInput, pngFileOutput) => {
|
||||||
|
return getIconFile(appFileInput).then((iconFile) => {
|
||||||
|
return tiffToPng(iconFile, pngFileOutput);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export default app2png;
|
@ -1,4 +1,5 @@
|
|||||||
import getApps from "./getApps";
|
import getApps from './getApps';
|
||||||
|
import app2png from './app2png';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getApps: () => {
|
getApps: () => {
|
||||||
@ -7,4 +8,5 @@ export default {
|
|||||||
isInstalled: (appName) => {
|
isInstalled: (appName) => {
|
||||||
return new Promise((resolve, reject) => getApps(resolve, reject, appName));
|
return new Promise((resolve, reject) => getApps(resolve, reject, appName));
|
||||||
},
|
},
|
||||||
|
app2png,
|
||||||
};
|
};
|
||||||
|
@ -78,12 +78,12 @@ function fileDisplay(filePath) {
|
|||||||
keyWords.push(path.basename(appDetail.target, '.exe'));
|
keyWords.push(path.basename(appDetail.target, '.exe'));
|
||||||
|
|
||||||
if (isZhRegex.test(appName)) {
|
if (isZhRegex.test(appName)) {
|
||||||
const [, pinyinArr] = translate(appName);
|
// const [, pinyinArr] = translate(appName);
|
||||||
const zh_firstLatter = pinyinArr.map((py) => py[0]);
|
// const zh_firstLatter = pinyinArr.map((py) => py[0]);
|
||||||
// 拼音
|
// // 拼音
|
||||||
keyWords.push(pinyinArr.join(''));
|
// keyWords.push(pinyinArr.join(''));
|
||||||
// 缩写
|
// 缩写
|
||||||
keyWords.push(zh_firstLatter.join(''));
|
// keyWords.push(zh_firstLatter.join(''));
|
||||||
} else {
|
} else {
|
||||||
const firstLatter = appName
|
const firstLatter = appName
|
||||||
.split(' ')
|
.split(' ')
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { BrowserWindow, ipcMain, nativeTheme } from 'electron';
|
import { BrowserWindow, ipcMain, nativeTheme } from 'electron';
|
||||||
|
import localConfig from '../common/initLocalConfig';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
export default () => {
|
export default () => {
|
||||||
let win: any;
|
let win: any;
|
||||||
@ -9,6 +10,8 @@ export default () => {
|
|||||||
event.returnValue = data;
|
event.returnValue = data;
|
||||||
});
|
});
|
||||||
createWindow(pluginInfo, viewInfo, view);
|
createWindow(pluginInfo, viewInfo, view);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
require('@electron/remote/main').enable(win.webContents);
|
||||||
};
|
};
|
||||||
|
|
||||||
const createWindow = async (pluginInfo, viewInfo, view) => {
|
const createWindow = async (pluginInfo, viewInfo, view) => {
|
||||||
@ -28,7 +31,6 @@ export default () => {
|
|||||||
y: viewInfo.y,
|
y: viewInfo.y,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
webSecurity: false,
|
webSecurity: false,
|
||||||
enableRemoteModule: true,
|
|
||||||
backgroundThrottling: false,
|
backgroundThrottling: false,
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
webviewTag: true,
|
webviewTag: true,
|
||||||
@ -49,8 +51,9 @@ export default () => {
|
|||||||
win = undefined;
|
win = undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
win.once('ready-to-show', () => {
|
win.once('ready-to-show', async () => {
|
||||||
const darkMode = global.OP_CONFIG.get().perf.common.darkMode;
|
const config = await localConfig.getConfig();
|
||||||
|
const darkMode = config.perf.common.darkMode;
|
||||||
darkMode &&
|
darkMode &&
|
||||||
win.webContents.executeJavaScript(
|
win.webContents.executeJavaScript(
|
||||||
`document.body.classList.add("dark");window.rubick.theme="dark"`
|
`document.body.classList.add("dark");window.rubick.theme="dark"`
|
||||||
|
@ -43,7 +43,6 @@ export default () => {
|
|||||||
height: 600,
|
height: 600,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
webSecurity: false,
|
webSecurity: false,
|
||||||
enableRemoteModule: true,
|
|
||||||
backgroundThrottling: false,
|
backgroundThrottling: false,
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
webviewTag: true,
|
webviewTag: true,
|
||||||
@ -53,7 +52,7 @@ export default () => {
|
|||||||
});
|
});
|
||||||
if (process.env.WEBPACK_DEV_SERVER_URL) {
|
if (process.env.WEBPACK_DEV_SERVER_URL) {
|
||||||
// Load the url of the dev server if in development mode
|
// Load the url of the dev server if in development mode
|
||||||
win.loadURL('http://localhost:8083');
|
win.loadURL('http://localhost:8084');
|
||||||
} else {
|
} else {
|
||||||
win.loadURL(`file://${path.join(__static, './guide/index.html')}`);
|
win.loadURL(`file://${path.join(__static, './guide/index.html')}`);
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,17 @@ import { app, BrowserWindow, protocol, nativeTheme } from 'electron';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib';
|
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib';
|
||||||
import versonHandler from '../common/versionHandler';
|
import versonHandler from '../common/versionHandler';
|
||||||
|
import localConfig from '@/main/common/initLocalConfig';
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
require('@electron/remote/main').initialize();
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
let win: any;
|
let win: any;
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
createWindow();
|
createWindow();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
require('@electron/remote/main').enable(win.webContents);
|
||||||
};
|
};
|
||||||
|
|
||||||
const createWindow = async () => {
|
const createWindow = async () => {
|
||||||
@ -22,7 +28,6 @@ export default () => {
|
|||||||
backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c28' : '#fff',
|
backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c28' : '#fff',
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
webSecurity: false,
|
webSecurity: false,
|
||||||
enableRemoteModule: true,
|
|
||||||
backgroundThrottling: false,
|
backgroundThrottling: false,
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
webviewTag: true,
|
webviewTag: true,
|
||||||
@ -61,8 +66,8 @@ export default () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 判断失焦是否隐藏
|
// 判断失焦是否隐藏
|
||||||
win.on('blur', () => {
|
win.on('blur', async () => {
|
||||||
const config = { ...global.OP_CONFIG.get() };
|
const config = await localConfig.getConfig();
|
||||||
if (config.perf.common.hideOnBlur) {
|
if (config.perf.common.hideOnBlur) {
|
||||||
win.hide();
|
win.hide();
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import { BrowserView, BrowserWindow, session } from 'electron';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import commonConst from '../../common/utils/commonConst';
|
import commonConst from '../../common/utils/commonConst';
|
||||||
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/main';
|
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/main';
|
||||||
|
import localConfig from '@/main/common/initLocalConfig';
|
||||||
|
|
||||||
const getRelativePath = (indexPath) => {
|
const getRelativePath = (indexPath) => {
|
||||||
return commonConst.windows()
|
return commonConst.windows()
|
||||||
@ -27,12 +28,62 @@ const getPreloadPath = (plugin, pluginIndexPath) => {
|
|||||||
return path.resolve(getRelativePath(pluginIndexPath), `../`, preload);
|
return path.resolve(getRelativePath(pluginIndexPath), `../`, preload);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const viewPoolManager = () => {
|
||||||
|
const viewPool: any = {
|
||||||
|
views: [],
|
||||||
|
};
|
||||||
|
const maxLen = 4;
|
||||||
|
return {
|
||||||
|
getView(pluginName) {
|
||||||
|
return viewPool.views.find((view) => view.pluginName === pluginName);
|
||||||
|
},
|
||||||
|
addView(pluginName, view) {
|
||||||
|
if (this.getView(pluginName)) return;
|
||||||
|
if (viewPool.views.length > maxLen) {
|
||||||
|
viewPool.views.shift();
|
||||||
|
}
|
||||||
|
viewPool.views.push({
|
||||||
|
pluginName,
|
||||||
|
view,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
let view;
|
let view;
|
||||||
|
const viewInstance = viewPoolManager();
|
||||||
|
|
||||||
|
const viewReadyFn = async (window, { pluginSetting, ext }) => {
|
||||||
|
if (!view) return;
|
||||||
|
const height = pluginSetting && pluginSetting.height;
|
||||||
|
window.setSize(800, height || 660);
|
||||||
|
view.setBounds({ x: 0, y: 60, width: 800, height: height || 600 });
|
||||||
|
view.setAutoResize({ width: true });
|
||||||
|
executeHooks('PluginEnter', ext);
|
||||||
|
executeHooks('PluginReady', ext);
|
||||||
|
const config = await localConfig.getConfig();
|
||||||
|
const darkMode = config.perf.common.darkMode;
|
||||||
|
darkMode &&
|
||||||
|
view.webContents.executeJavaScript(
|
||||||
|
`document.body.classList.add("dark");window.rubick.theme="dark"`
|
||||||
|
);
|
||||||
|
window.webContents.executeJavaScript(`window.pluginLoaded()`);
|
||||||
|
};
|
||||||
|
|
||||||
const init = (plugin, window: BrowserWindow) => {
|
const init = (plugin, window: BrowserWindow) => {
|
||||||
if (view === null || view === undefined) {
|
if (view === null || view === undefined) {
|
||||||
|
if (viewInstance.getView(plugin.name) && !commonConst.dev()) {
|
||||||
|
view = viewInstance.getView(plugin.name).view;
|
||||||
|
window.setBrowserView(view);
|
||||||
|
view.inited = true;
|
||||||
|
viewReadyFn(window, plugin);
|
||||||
|
} else {
|
||||||
createView(plugin, window);
|
createView(plugin, window);
|
||||||
|
viewInstance.addView(plugin.name, view);
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
require('@electron/remote/main').enable(view.webContents);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -65,7 +116,6 @@ export default () => {
|
|||||||
|
|
||||||
view = new BrowserView({
|
view = new BrowserView({
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
enableRemoteModule: true,
|
|
||||||
webSecurity: false,
|
webSecurity: false,
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
@ -73,25 +123,16 @@ export default () => {
|
|||||||
webviewTag: true,
|
webviewTag: true,
|
||||||
preload,
|
preload,
|
||||||
session: ses,
|
session: ses,
|
||||||
|
defaultFontSize: 14,
|
||||||
|
defaultFontFamily: {
|
||||||
|
standard: 'system-ui',
|
||||||
|
serif: 'system-ui',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
window.setBrowserView(view);
|
window.setBrowserView(view);
|
||||||
view.webContents.loadURL(pluginIndexPath);
|
view.webContents.loadURL(pluginIndexPath);
|
||||||
view.webContents.once('dom-ready', () => {
|
view.webContents.once('dom-ready', () => viewReadyFn(window, plugin));
|
||||||
if (!view) return;
|
|
||||||
const height = pluginSetting && pluginSetting.height;
|
|
||||||
window.setSize(800, height || 660);
|
|
||||||
view.setBounds({ x: 0, y: 60, width: 800, height: height || 600 });
|
|
||||||
view.setAutoResize({ width: true });
|
|
||||||
executeHooks('PluginEnter', plugin.ext);
|
|
||||||
executeHooks('PluginReady', plugin.ext);
|
|
||||||
darkMode = global.OP_CONFIG.get().perf.common.darkMode;
|
|
||||||
darkMode &&
|
|
||||||
view.webContents.executeJavaScript(
|
|
||||||
`document.body.classList.add("dark");window.rubick.theme="dark"`
|
|
||||||
);
|
|
||||||
window.webContents.executeJavaScript(`window.pluginLoaded()`);
|
|
||||||
});
|
|
||||||
// 修复请求跨域问题
|
// 修复请求跨域问题
|
||||||
view.webContents.session.webRequest.onBeforeSendHeaders(
|
view.webContents.session.webRequest.onBeforeSendHeaders(
|
||||||
(details, callback) => {
|
(details, callback) => {
|
||||||
|
@ -9,9 +9,8 @@ import {
|
|||||||
screen,
|
screen,
|
||||||
shell,
|
shell,
|
||||||
} from 'electron';
|
} from 'electron';
|
||||||
import { runner, detach } from '../browsers';
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { LocalDb, screenCapture } from '@/core';
|
import { screenCapture } from '@/core';
|
||||||
import plist from 'plist';
|
import plist from 'plist';
|
||||||
import ks from 'node-key-sender';
|
import ks from 'node-key-sender';
|
||||||
|
|
||||||
@ -19,16 +18,15 @@ import { DECODE_KEY } from '@/common/constans/main';
|
|||||||
import getCopyFiles from '@/common/utils/getCopyFiles';
|
import getCopyFiles from '@/common/utils/getCopyFiles';
|
||||||
|
|
||||||
import mainInstance from '../index';
|
import mainInstance from '../index';
|
||||||
|
import { runner, detach } from '../browsers';
|
||||||
|
import DBInstance from './db';
|
||||||
|
import getWinPosition from './getWinPosition';
|
||||||
|
|
||||||
const runnerInstance = runner();
|
const runnerInstance = runner();
|
||||||
const detachInstance = detach();
|
const detachInstance = detach();
|
||||||
const dbInstance = new LocalDb(app.getPath('userData'));
|
|
||||||
|
|
||||||
dbInstance.init();
|
class API extends DBInstance {
|
||||||
|
|
||||||
class API {
|
|
||||||
public currentPlugin: null | any = null;
|
public currentPlugin: null | any = null;
|
||||||
private DBKEY = 'RUBICK_DB_DEFAULT';
|
|
||||||
|
|
||||||
init(mainWindow: BrowserWindow) {
|
init(mainWindow: BrowserWindow) {
|
||||||
// 响应 preload.js 事件
|
// 响应 preload.js 事件
|
||||||
ipcMain.on('msg-trigger', async (event, arg) => {
|
ipcMain.on('msg-trigger', async (event, arg) => {
|
||||||
@ -37,6 +35,10 @@ class API {
|
|||||||
event.returnValue = data;
|
event.returnValue = data;
|
||||||
// event.sender.send(`msg-back-${arg.type}`, data);
|
// event.sender.send(`msg-back-${arg.type}`, data);
|
||||||
});
|
});
|
||||||
|
// 按 ESC 退出插件
|
||||||
|
mainWindow.webContents.on('before-input-event', (event, input) =>
|
||||||
|
this.__EscapeKeyDown(event, input, mainWindow)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getCurrentWindow = (window, e) => {
|
public getCurrentWindow = (window, e) => {
|
||||||
@ -65,6 +67,7 @@ class API {
|
|||||||
const originWindow = this.getCurrentWindow(window, e);
|
const originWindow = this.getCurrentWindow(window, e);
|
||||||
if (!originWindow) return;
|
if (!originWindow) return;
|
||||||
originWindow.setBounds({ x: x - mouseX, y: y - mouseY, width, height });
|
originWindow.setBounds({ x: x - mouseX, y: y - mouseY, width, height });
|
||||||
|
getWinPosition.setPosition(x - mouseX, y - mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public loadPlugin({ data: plugin }, window) {
|
public loadPlugin({ data: plugin }, window) {
|
||||||
@ -85,16 +88,13 @@ class API {
|
|||||||
})})`
|
})})`
|
||||||
);
|
);
|
||||||
window.show();
|
window.show();
|
||||||
// 按 ESC 退出插件
|
const view = runnerInstance.getView();
|
||||||
window.webContents.on('before-input-event', (event, input) =>
|
if (!view.inited) {
|
||||||
this.__EscapeKeyDown(event, input, window)
|
view.webContents.on('before-input-event', (event, input) =>
|
||||||
);
|
|
||||||
runnerInstance
|
|
||||||
.getView()
|
|
||||||
.webContents.on('before-input-event', (event, input) =>
|
|
||||||
this.__EscapeKeyDown(event, input, window)
|
this.__EscapeKeyDown(event, input, window)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public removePlugin(e, window) {
|
public removePlugin(e, window) {
|
||||||
this.currentPlugin = null;
|
this.currentPlugin = null;
|
||||||
@ -196,26 +196,6 @@ class API {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public dbPut({ data }) {
|
|
||||||
return dbInstance.put(this.DBKEY, data.data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public dbGet({ data }) {
|
|
||||||
return dbInstance.get(this.DBKEY, data.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public dbRemove({ data }) {
|
|
||||||
return dbInstance.remove(this.DBKEY, data.doc);
|
|
||||||
}
|
|
||||||
|
|
||||||
public dbBulkDocs({ data }) {
|
|
||||||
return dbInstance.bulkDocs(this.DBKEY, data.docs);
|
|
||||||
}
|
|
||||||
|
|
||||||
public dbAllDocs({ data }) {
|
|
||||||
return dbInstance.allDocs(this.DBKEY, data.key);
|
|
||||||
}
|
|
||||||
|
|
||||||
public getFeatures() {
|
public getFeatures() {
|
||||||
return this.currentPlugin.features;
|
return this.currentPlugin.features;
|
||||||
}
|
}
|
||||||
@ -342,6 +322,22 @@ class API {
|
|||||||
ks.sendKeys(keys);
|
ks.sendKeys(keys);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public addLocalStartPlugin({ data: { plugin } }, window) {
|
||||||
|
window.webContents.executeJavaScript(
|
||||||
|
`window.addLocalStartPlugin(${JSON.stringify({
|
||||||
|
plugin,
|
||||||
|
})})`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public removeLocalStartPlugin({ data: { plugin } }, window) {
|
||||||
|
window.webContents.executeJavaScript(
|
||||||
|
`window.removeLocalStartPlugin(${JSON.stringify({
|
||||||
|
plugin,
|
||||||
|
})})`
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new API();
|
export default new API();
|
||||||
|
28
src/main/common/db.ts
Normal file
28
src/main/common/db.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { LocalDb } from '@/core';
|
||||||
|
import { app } from 'electron';
|
||||||
|
|
||||||
|
const dbInstance = new LocalDb(app.getPath('userData'));
|
||||||
|
dbInstance.init();
|
||||||
|
|
||||||
|
export default class DBInstance {
|
||||||
|
private DBKEY = 'RUBICK_DB_DEFAULT';
|
||||||
|
public dbPut({ data }) {
|
||||||
|
return dbInstance.put(this.DBKEY, data.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public dbGet({ data }) {
|
||||||
|
return dbInstance.get(this.DBKEY, data.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public dbRemove({ data }) {
|
||||||
|
return dbInstance.remove(this.DBKEY, data.doc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public dbBulkDocs({ data }) {
|
||||||
|
return dbInstance.bulkDocs(this.DBKEY, data.docs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public dbAllDocs({ data }) {
|
||||||
|
return dbInstance.allDocs(this.DBKEY, data.key);
|
||||||
|
}
|
||||||
|
}
|
34
src/main/common/getWinPosition.ts
Normal file
34
src/main/common/getWinPosition.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { screen } from 'electron';
|
||||||
|
|
||||||
|
const winPosition = {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
id: -1,
|
||||||
|
getPosition(): { x: number; y: number } {
|
||||||
|
const { x, y } = screen.getCursorScreenPoint();
|
||||||
|
const currentDisplay = screen.getDisplayNearestPoint({ x, y });
|
||||||
|
if (winPosition.id !== currentDisplay.id) {
|
||||||
|
winPosition.id = currentDisplay.id;
|
||||||
|
winPosition.x = parseInt(
|
||||||
|
String(
|
||||||
|
currentDisplay.workArea.x + currentDisplay.workArea.width / 2 - 400
|
||||||
|
)
|
||||||
|
);
|
||||||
|
winPosition.y = parseInt(
|
||||||
|
String(
|
||||||
|
currentDisplay.workArea.y + currentDisplay.workArea.height / 2 - 200
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
x: winPosition.x,
|
||||||
|
y: winPosition.y,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
setPosition(x: number, y: number): void {
|
||||||
|
winPosition.x = x;
|
||||||
|
winPosition.y = y;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default winPosition;
|
51
src/main/common/initLocalConfig.ts
Normal file
51
src/main/common/initLocalConfig.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import defaultConfig from '@/common/constans/defaultConfig';
|
||||||
|
import DBInstance from './db';
|
||||||
|
const LOCAL_CONFIG_KEY = 'rubick-local-config';
|
||||||
|
|
||||||
|
const db = new DBInstance();
|
||||||
|
|
||||||
|
const localConfig = {
|
||||||
|
async init(): Promise<any> {
|
||||||
|
const localConfig = await db.dbGet({ data: { id: LOCAL_CONFIG_KEY } });
|
||||||
|
if (
|
||||||
|
!localConfig ||
|
||||||
|
!localConfig.data ||
|
||||||
|
localConfig.data.version !== defaultConfig.version
|
||||||
|
) {
|
||||||
|
const data: any = {
|
||||||
|
_id: LOCAL_CONFIG_KEY,
|
||||||
|
data: defaultConfig,
|
||||||
|
};
|
||||||
|
if (localConfig && localConfig.data) {
|
||||||
|
data._rev = localConfig.data._rev;
|
||||||
|
}
|
||||||
|
await db.dbPut({
|
||||||
|
data: { data },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getConfig(): Promise<any> {
|
||||||
|
const data: any =
|
||||||
|
(await db.dbGet({ data: { id: LOCAL_CONFIG_KEY } })) || {};
|
||||||
|
return data.data;
|
||||||
|
},
|
||||||
|
|
||||||
|
async setConfig(data) {
|
||||||
|
const localConfig: any =
|
||||||
|
(await db.dbGet({ data: { id: LOCAL_CONFIG_KEY } })) || {};
|
||||||
|
await db.dbPut({
|
||||||
|
data: {
|
||||||
|
data: {
|
||||||
|
_id: LOCAL_CONFIG_KEY,
|
||||||
|
_rev: localConfig._rev,
|
||||||
|
data: {
|
||||||
|
...localConfig.data,
|
||||||
|
...data,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default localConfig;
|
@ -9,19 +9,21 @@ import {
|
|||||||
Notification,
|
Notification,
|
||||||
} from 'electron';
|
} from 'electron';
|
||||||
import screenCapture from '@/core/screen-capture';
|
import screenCapture from '@/core/screen-capture';
|
||||||
|
import localConfig from '@/main/common/initLocalConfig';
|
||||||
|
import winPosition from './getWinPosition';
|
||||||
|
|
||||||
const registerHotKey = (mainWindow: BrowserWindow): void => {
|
const registerHotKey = (mainWindow: BrowserWindow): void => {
|
||||||
// 设置开机启动
|
// 设置开机启动
|
||||||
const setAutoLogin = () => {
|
const setAutoLogin = async () => {
|
||||||
const config = global.OP_CONFIG.get();
|
const config = await localConfig.getConfig();
|
||||||
app.setLoginItemSettings({
|
app.setLoginItemSettings({
|
||||||
openAtLogin: config.perf.common.start,
|
openAtLogin: config.perf.common.start,
|
||||||
openAsHidden: true,
|
openAsHidden: true,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 设置暗黑模式
|
// 设置暗黑模式
|
||||||
const setDarkMode = () => {
|
const setDarkMode = async () => {
|
||||||
const config = global.OP_CONFIG.get();
|
const config = await localConfig.getConfig();
|
||||||
const isDark = config.perf.common.darkMode;
|
const isDark = config.perf.common.darkMode;
|
||||||
if (isDark) {
|
if (isDark) {
|
||||||
nativeTheme.themeSource = 'dark';
|
nativeTheme.themeSource = 'dark';
|
||||||
@ -46,29 +48,16 @@ const registerHotKey = (mainWindow: BrowserWindow): void => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const init = () => {
|
const init = async () => {
|
||||||
setAutoLogin();
|
await setAutoLogin();
|
||||||
setDarkMode();
|
await setDarkMode();
|
||||||
const config = global.OP_CONFIG.get();
|
const config = await localConfig.getConfig();
|
||||||
globalShortcut.unregisterAll();
|
globalShortcut.unregisterAll();
|
||||||
// 注册偏好快捷键
|
// 注册偏好快捷键
|
||||||
globalShortcut.register(config.perf.shortCut.showAndHidden, () => {
|
globalShortcut.register(config.perf.shortCut.showAndHidden, () => {
|
||||||
const currentShow = mainWindow.isVisible() && mainWindow.isFocused();
|
const currentShow = mainWindow.isVisible() && mainWindow.isFocused();
|
||||||
if (currentShow) return mainWindow.hide();
|
if (currentShow) return mainWindow.hide();
|
||||||
|
const { x: wx, y: wy } = winPosition.getPosition();
|
||||||
const { x, y } = screen.getCursorScreenPoint();
|
|
||||||
const currentDisplay = screen.getDisplayNearestPoint({ x, y });
|
|
||||||
const wx = parseInt(
|
|
||||||
String(
|
|
||||||
currentDisplay.workArea.x + currentDisplay.workArea.width / 2 - 400
|
|
||||||
)
|
|
||||||
);
|
|
||||||
const wy = parseInt(
|
|
||||||
String(
|
|
||||||
currentDisplay.workArea.y + currentDisplay.workArea.height / 2 - 200
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
mainWindow.setAlwaysOnTop(false);
|
mainWindow.setAlwaysOnTop(false);
|
||||||
mainWindow.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
|
mainWindow.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
|
||||||
mainWindow.focus();
|
mainWindow.focus();
|
||||||
|
@ -2,7 +2,6 @@ import { dialog, Menu, Tray, app, shell, BrowserWindow } from 'electron';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import pkg from '../../../package.json';
|
import pkg from '../../../package.json';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import API from '../common/api';
|
|
||||||
import commonConst from '@/common/utils/commonConst';
|
import commonConst from '@/common/utils/commonConst';
|
||||||
import { guide } from '../browsers';
|
import { guide } from '../browsers';
|
||||||
|
|
||||||
@ -21,11 +20,6 @@ function createTray(window: BrowserWindow): Promise<Tray> {
|
|||||||
}
|
}
|
||||||
const appIcon = new Tray(path.join(__static, icon));
|
const appIcon = new Tray(path.join(__static, icon));
|
||||||
|
|
||||||
const getShowAndHiddenHotKey = (): string => {
|
|
||||||
const config = global.OP_CONFIG.get();
|
|
||||||
return config.perf.shortCut.showAndHidden;
|
|
||||||
};
|
|
||||||
|
|
||||||
const openSettings = () => {
|
const openSettings = () => {
|
||||||
window.webContents.executeJavaScript(
|
window.webContents.executeJavaScript(
|
||||||
`window.rubick && window.rubick.openMenu && window.rubick.openMenu({ code: "settings" })`
|
`window.rubick && window.rubick.openMenu && window.rubick.openMenu({ code: "settings" })`
|
||||||
@ -59,8 +53,7 @@ function createTray(window: BrowserWindow): Promise<Tray> {
|
|||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{
|
{
|
||||||
label: '显示窗口',
|
label: '显示',
|
||||||
accelerator: getShowAndHiddenHotKey(),
|
|
||||||
click() {
|
click() {
|
||||||
window.show();
|
window.show();
|
||||||
},
|
},
|
||||||
|
@ -12,9 +12,9 @@ import commonConst from '../common/utils/commonConst';
|
|||||||
import API from './common/api';
|
import API from './common/api';
|
||||||
import createTray from './common/tray';
|
import createTray from './common/tray';
|
||||||
import registerHotKey from './common/registerHotKey';
|
import registerHotKey from './common/registerHotKey';
|
||||||
|
import localConfig from './common/initLocalConfig';
|
||||||
|
|
||||||
import '../common/utils/localPlugin';
|
import '../common/utils/localPlugin';
|
||||||
import '../common/utils/localConfig';
|
|
||||||
|
|
||||||
import registerySystemPlugin from './common/registerySystemPlugin';
|
import registerySystemPlugin from './common/registerySystemPlugin';
|
||||||
|
|
||||||
@ -55,12 +55,13 @@ class App {
|
|||||||
this.windowCreator.init();
|
this.windowCreator.init();
|
||||||
}
|
}
|
||||||
onReady() {
|
onReady() {
|
||||||
const readyFunction = () => {
|
const readyFunction = async () => {
|
||||||
const config = global.OP_CONFIG.get();
|
await localConfig.init();
|
||||||
|
const config = await localConfig.getConfig();
|
||||||
if (!config.perf.common.guide) {
|
if (!config.perf.common.guide) {
|
||||||
guide().init();
|
guide().init();
|
||||||
config.perf.common.guide = true;
|
config.perf.common.guide = true;
|
||||||
global.OP_CONFIG.set(config);
|
localConfig.setConfig(config);
|
||||||
}
|
}
|
||||||
this.createWindow();
|
this.createWindow();
|
||||||
const mainWindow = this.windowCreator.getWindow();
|
const mainWindow = this.windowCreator.getWindow();
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
id="components-layout"
|
id="components-layout"
|
||||||
:class="commonConst.macOS() && 'drag'"
|
|
||||||
@mousedown="onMouseDown"
|
@mousedown="onMouseDown"
|
||||||
>
|
>
|
||||||
<Search
|
<Search
|
||||||
@ -13,6 +12,7 @@
|
|||||||
:searchValue="searchValue"
|
:searchValue="searchValue"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:pluginLoading="pluginLoading"
|
:pluginLoading="pluginLoading"
|
||||||
|
:pluginHistory="pluginHistory"
|
||||||
:clipboardFile="clipboardFile || []"
|
:clipboardFile="clipboardFile || []"
|
||||||
@choosePlugin="choosePlugin"
|
@choosePlugin="choosePlugin"
|
||||||
@focus="searchFocus"
|
@focus="searchFocus"
|
||||||
@ -21,6 +21,7 @@
|
|||||||
@readClipboardContent="readClipboardContent"
|
@readClipboardContent="readClipboardContent"
|
||||||
/>
|
/>
|
||||||
<Result
|
<Result
|
||||||
|
:pluginHistory="pluginHistory"
|
||||||
:currentPlugin="currentPlugin"
|
:currentPlugin="currentPlugin"
|
||||||
:searchValue="searchValue"
|
:searchValue="searchValue"
|
||||||
:currentSelect="currentSelect"
|
:currentSelect="currentSelect"
|
||||||
@ -32,15 +33,15 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { watch, ref, nextTick, toRaw } from 'vue';
|
import { watch, ref, nextTick, toRaw } from 'vue';
|
||||||
import { ipcRenderer, remote } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import Result from './components/result.vue';
|
import Result from './components/result.vue';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import getWindowHeight from '../common/utils/getWindowHeight';
|
import getWindowHeight from '../common/utils/getWindowHeight';
|
||||||
import createPluginManager from './plugins-manager';
|
import createPluginManager from './plugins-manager';
|
||||||
import useDrag from '../common/utils/dragWindow';
|
import useDrag from '../common/utils/dragWindow';
|
||||||
import commonConst from '@/common/utils/commonConst';
|
|
||||||
|
|
||||||
const { onMouseDown } = useDrag();
|
const { onMouseDown } = useDrag();
|
||||||
|
const remote = window.require('@electron/remote');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
initPlugins,
|
initPlugins,
|
||||||
@ -58,6 +59,7 @@ const {
|
|||||||
setSearchValue,
|
setSearchValue,
|
||||||
clearClipboardFile,
|
clearClipboardFile,
|
||||||
readClipboardContent,
|
readClipboardContent,
|
||||||
|
pluginHistory,
|
||||||
} = createPluginManager();
|
} = createPluginManager();
|
||||||
|
|
||||||
initPlugins();
|
initPlugins();
|
||||||
@ -74,24 +76,37 @@ getPluginInfo({
|
|||||||
remote.getGlobal('LOCAL_PLUGINS').addPlugin(res);
|
remote.getGlobal('LOCAL_PLUGINS').addPlugin(res);
|
||||||
});
|
});
|
||||||
|
|
||||||
watch([options], () => {
|
watch([options, pluginHistory], () => {
|
||||||
currentSelect.value = 0;
|
currentSelect.value = 0;
|
||||||
if (currentPlugin.value.name) return;
|
if (currentPlugin.value.name) return;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
ipcRenderer.sendSync('msg-trigger', {
|
ipcRenderer.sendSync('msg-trigger', {
|
||||||
type: 'setExpendHeight',
|
type: 'setExpendHeight',
|
||||||
data: getWindowHeight(options.value),
|
data: getWindowHeight(options.value, pluginHistory.value),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const changeIndex = (index) => {
|
const changeIndex = (index) => {
|
||||||
if (!options.value.length) return;
|
if (!options.value.length) {
|
||||||
|
if (!pluginHistory.value.length) return;
|
||||||
|
if (
|
||||||
|
currentSelect.value + index > pluginHistory.value.length - 1 ||
|
||||||
|
currentSelect.value + index < 0
|
||||||
|
) {
|
||||||
|
currentSelect.value = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
currentSelect.value = currentSelect.value + index;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
currentSelect.value + index > options.value.length - 1 ||
|
currentSelect.value + index > options.value.length - 1 ||
|
||||||
currentSelect.value + index < 0
|
currentSelect.value + index < 0
|
||||||
)
|
) {
|
||||||
|
currentSelect.value = 0;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
currentSelect.value = currentSelect.value + index;
|
currentSelect.value = currentSelect.value + index;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -101,14 +116,20 @@ const openMenu = (ext) => {
|
|||||||
feature: menuPluginInfo.value.features[0],
|
feature: menuPluginInfo.value.features[0],
|
||||||
cmd: '插件市场',
|
cmd: '插件市场',
|
||||||
ext,
|
ext,
|
||||||
|
click: () => openMenu(ext),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
window.rubick.openMenu = openMenu;
|
window.rubick.openMenu = openMenu;
|
||||||
|
|
||||||
const choosePlugin = () => {
|
const choosePlugin = () => {
|
||||||
|
if (options.value.length) {
|
||||||
const currentChoose = options.value[currentSelect.value];
|
const currentChoose = options.value[currentSelect.value];
|
||||||
currentChoose.click();
|
currentChoose.click();
|
||||||
|
} else {
|
||||||
|
const currentChoose = pluginHistory.value[currentSelect.value];
|
||||||
|
currentChoose.click();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const clearSearchValue = () => {
|
const clearSearchValue = () => {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// 背景色
|
// 背景色
|
||||||
--color-body-bg: #fff;
|
--color-body-bg: #fff;
|
||||||
--color-menu-bg: #f3efef;
|
--color-menu-bg: #f3efef;
|
||||||
--color-list-hover: #e2e2e2;
|
--color-list-hover: #ebeee8;
|
||||||
--color-input-hover: #fff;
|
--color-input-hover: #fff;
|
||||||
// 边框
|
// 边框
|
||||||
--color-border-light: #f0f0f0;
|
--color-border-light: #f0f0f0;
|
||||||
|
@ -1,14 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-show="
|
v-show="!currentPlugin.name"
|
||||||
!!options.length &&
|
|
||||||
(searchValue || !!clipboardFile.length) &&
|
|
||||||
!currentPlugin.name
|
|
||||||
"
|
|
||||||
class="options"
|
class="options"
|
||||||
ref="scrollDom"
|
ref="scrollDom"
|
||||||
>
|
>
|
||||||
<a-list item-layout="horizontal" :dataSource="sort(options)">
|
<div class="history-plugins" v-if="!options.length || !(searchValue || !!clipboardFile.length)">
|
||||||
|
<a-row>
|
||||||
|
<a-col
|
||||||
|
@click="() => item.click()"
|
||||||
|
:class="currentSelect === index ? 'active history-item' : 'history-item'"
|
||||||
|
:span="3"
|
||||||
|
v-for="(item, index) in pluginHistory"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<a-avatar style="border-radius: 0" :src="item.icon" />
|
||||||
|
<div class="name ellpise">{{item.pluginName || item._name || item.name}}</div>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
<a-list v-else item-layout="horizontal" :dataSource="sort(options)">
|
||||||
<template #renderItem="{ item, index }">
|
<template #renderItem="{ item, index }">
|
||||||
<a-list-item
|
<a-list-item
|
||||||
@click="() => item.click()"
|
@click="() => item.click()"
|
||||||
@ -16,7 +26,7 @@
|
|||||||
>
|
>
|
||||||
<a-list-item-meta :description="renderDesc(item.desc)">
|
<a-list-item-meta :description="renderDesc(item.desc)">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span v-html="renderTitle(item.name)"></span>
|
<span v-html="renderTitle(item.name, item.match)"></span>
|
||||||
</template>
|
</template>
|
||||||
<template #avatar>
|
<template #avatar>
|
||||||
<a-avatar style="border-radius: 0" :src="item.icon" />
|
<a-avatar style="border-radius: 0" :src="item.icon" />
|
||||||
@ -52,18 +62,15 @@ const props = defineProps({
|
|||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
currentPlugin: {},
|
currentPlugin: {},
|
||||||
|
pluginHistory: (() => [])(),
|
||||||
clipboardFile: (() => [])(),
|
clipboardFile: (() => [])(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const renderTitle = (title) => {
|
const renderTitle = (title, match) => {
|
||||||
if (typeof title !== 'string') return;
|
if (typeof title !== 'string') return;
|
||||||
if (!props.searchValue) return title;
|
if (!props.searchValue || !match) return title;
|
||||||
const result = title.toLowerCase().split(props.searchValue.toLowerCase());
|
const result = title.substring(match[0], match[1] + 1);
|
||||||
if (result && result.length > 1) {
|
return `<div>${title.substring(0, match[0])}<span style='color: var(--ant-error-color)'>${result}</span>${title.substring(match[1]+1, title.length)}</div>`;
|
||||||
return `<div>${result[0]}<span style='color: var(--ant-error-color)'>${props.searchValue}</span>${result[1]}</div>`;
|
|
||||||
} else {
|
|
||||||
return `<div>${result[0]}</div>`;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderDesc = (desc) => {
|
const renderDesc = (desc) => {
|
||||||
@ -91,15 +98,45 @@ const sort = (options) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
.ellpise {
|
||||||
|
overflow:hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
display:-webkit-box;
|
||||||
|
-webkit-line-clamp:1;
|
||||||
|
-webkit-box-orient:vertical;
|
||||||
|
}
|
||||||
|
|
||||||
.options {
|
.options {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 62px;
|
top: 60px;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
max-height: calc(~'100vh - 64px');
|
max-height: calc(~'100vh - 60px');
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
background: var(--color-body-bg);
|
background: var(--color-body-bg);
|
||||||
|
.history-plugins {
|
||||||
|
width: 100%;
|
||||||
|
border-top: 1px dashed #ddd;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.history-item {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 79px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
border-right: 1px dashed #ddd;
|
||||||
|
&.active {
|
||||||
|
background: var(--color-list-hover);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.name {
|
||||||
|
margin-top: 4px;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
.op-item {
|
.op-item {
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
class="main-input"
|
class="main-input"
|
||||||
@input="e => changeValue(e)"
|
@input="e => changeValue(e)"
|
||||||
@keydown.down="e => keydownEvent(e, 'down')"
|
@keydown.down="e => keydownEvent(e, 'down')"
|
||||||
|
@keydown.tab="e => keydownEvent(e, 'down')"
|
||||||
@keydown.up="e => keydownEvent(e, 'up')"
|
@keydown.up="e => keydownEvent(e, 'up')"
|
||||||
@keydown="e => checkNeedInit(e)"
|
@keydown="e => checkNeedInit(e)"
|
||||||
:value="searchValue"
|
:value="searchValue"
|
||||||
@ -53,13 +54,14 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineProps, defineEmits, ref } from 'vue';
|
import { defineProps, defineEmits, ref } from 'vue';
|
||||||
import { ipcRenderer, remote } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import { LoadingOutlined, MoreOutlined } from '@ant-design/icons-vue';
|
import { LoadingOutlined, MoreOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
const opConfig = remote.getGlobal('OP_CONFIG');
|
const remote = window.require('@electron/remote');
|
||||||
|
import localConfig from '../confOp';
|
||||||
const { Menu } = remote;
|
const { Menu } = remote;
|
||||||
|
|
||||||
const config = ref(opConfig.get());
|
const config: any = ref(localConfig.getConfig());
|
||||||
|
|
||||||
const props: any = defineProps({
|
const props: any = defineProps({
|
||||||
searchValue: {
|
searchValue: {
|
||||||
@ -70,6 +72,7 @@ const props: any = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
pluginHistory: (() => [])(),
|
||||||
currentPlugin: {},
|
currentPlugin: {},
|
||||||
pluginLoading: Boolean,
|
pluginLoading: Boolean,
|
||||||
clipboardFile: (() => [])(),
|
clipboardFile: (() => [])(),
|
||||||
@ -106,7 +109,7 @@ const keydownEvent = (e, key: string) => {
|
|||||||
modifiers,
|
modifiers,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const runPluginDisable = e.target.value === '' || props.currentPlugin.name;
|
const runPluginDisable = ((e.target.value === '' && !props.pluginHistory.length) || props.currentPlugin.name) ;
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'up':
|
case 'up':
|
||||||
emit('changeCurrent', -1);
|
emit('changeCurrent', -1);
|
||||||
@ -119,7 +122,7 @@ const keydownEvent = (e, key: string) => {
|
|||||||
emit('choosePlugin');
|
emit('choosePlugin');
|
||||||
break;
|
break;
|
||||||
case 'space':
|
case 'space':
|
||||||
if (runPluginDisable || !opConfig.get().perf.common.space) return;
|
if (runPluginDisable || !config.value.perf.common.space) return;
|
||||||
emit('choosePlugin');
|
emit('choosePlugin');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -216,14 +219,14 @@ const showSeparate = () => {
|
|||||||
const changeLang = (lang) => {
|
const changeLang = (lang) => {
|
||||||
let cfg = { ...config.value };
|
let cfg = { ...config.value };
|
||||||
cfg.perf.common.lang = lang;
|
cfg.perf.common.lang = lang;
|
||||||
opConfig.set(cfg);
|
localConfig.setConfig(JSON.parse(JSON.stringify(cfg)));
|
||||||
config.value = cfg;
|
config.value = cfg;
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeHideOnBlur = () => {
|
const changeHideOnBlur = () => {
|
||||||
let cfg = { ...config.value };
|
let cfg = { ...config.value };
|
||||||
cfg.perf.common.hideOnBlur = !cfg.perf.common.hideOnBlur;
|
cfg.perf.common.hideOnBlur = !cfg.perf.common.hideOnBlur;
|
||||||
opConfig.set(cfg);
|
localConfig.setConfig(JSON.parse(JSON.stringify(cfg)));
|
||||||
config.value = cfg;
|
config.value = cfg;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -261,6 +264,9 @@ window.rubick.hooks.onHide = () => {
|
|||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
height: 60px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
.ellipse {
|
.ellipse {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
@ -284,7 +290,7 @@ window.rubick.hooks.onHide = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-input {
|
.main-input {
|
||||||
height: 60px !important;
|
height: 40px !important;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
border: none;
|
border: none;
|
||||||
|
22
src/renderer/confOp.ts
Normal file
22
src/renderer/confOp.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
const LOCAL_CONFIG_KEY = 'rubick-local-config';
|
||||||
|
|
||||||
|
const localConfig = {
|
||||||
|
getConfig(): Promise<any> {
|
||||||
|
const data: any = window.rubick.db.get(LOCAL_CONFIG_KEY) || {};
|
||||||
|
return data.data;
|
||||||
|
},
|
||||||
|
|
||||||
|
setConfig(data) {
|
||||||
|
const localConfig: any = window.rubick.db.get(LOCAL_CONFIG_KEY) || {};
|
||||||
|
window.rubick.db.put({
|
||||||
|
_id: LOCAL_CONFIG_KEY,
|
||||||
|
_rev: localConfig._rev,
|
||||||
|
data: {
|
||||||
|
...localConfig.data,
|
||||||
|
...data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default localConfig;
|
@ -7,17 +7,18 @@ import {
|
|||||||
Avatar,
|
Avatar,
|
||||||
Tag,
|
Tag,
|
||||||
ConfigProvider,
|
ConfigProvider,
|
||||||
|
Row,
|
||||||
|
Col,
|
||||||
} from 'ant-design-vue';
|
} from 'ant-design-vue';
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
|
import localConfig from './confOp';
|
||||||
|
|
||||||
import 'ant-design-vue/dist/antd.variable.min.css';
|
import 'ant-design-vue/dist/antd.variable.min.css';
|
||||||
|
|
||||||
const { remote } = window.require('electron');
|
const config: any = localConfig.getConfig();
|
||||||
|
|
||||||
const { perf } = remote.getGlobal('OP_CONFIG').get();
|
|
||||||
|
|
||||||
ConfigProvider.config({
|
ConfigProvider.config({
|
||||||
theme: perf.custom || {},
|
theme: config.perf.custom || {},
|
||||||
});
|
});
|
||||||
|
|
||||||
createApp(App)
|
createApp(App)
|
||||||
@ -27,4 +28,6 @@ createApp(App)
|
|||||||
.use(Input)
|
.use(Input)
|
||||||
.use(Avatar)
|
.use(Avatar)
|
||||||
.use(Tag)
|
.use(Tag)
|
||||||
|
.use(Row)
|
||||||
|
.use(Col)
|
||||||
.mount('#app');
|
.mount('#app');
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
import getCopyFiles from '@/common/utils/getCopyFiles';
|
import getCopyFiles from '@/common/utils/getCopyFiles';
|
||||||
import { clipboard, nativeImage, remote, ipcRenderer } from 'electron';
|
import { clipboard, nativeImage, ipcRenderer } from 'electron';
|
||||||
|
import { getGlobal } from '@electron/remote';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import pluginClickEvent from './pluginClickEvent';
|
import pluginClickEvent from './pluginClickEvent';
|
||||||
|
import localConfig from '../confOp';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||||
const clipboardFile: any = ref([]);
|
const clipboardFile: any = ref([]);
|
||||||
const searchFocus = () => {
|
const searchFocus = () => {
|
||||||
const config = remote.getGlobal('OP_CONFIG').get();
|
const config: any = localConfig.getConfig();
|
||||||
// 未开启自动粘贴
|
// 未开启自动粘贴
|
||||||
if (!config.perf.common.autoPast) return;
|
if (!config.perf.common.autoPast) return;
|
||||||
|
|
||||||
@ -17,7 +19,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
|||||||
if (fileList) {
|
if (fileList) {
|
||||||
window.setSubInputValue({ value: '' });
|
window.setSubInputValue({ value: '' });
|
||||||
clipboardFile.value = fileList;
|
clipboardFile.value = fileList;
|
||||||
const localPlugins = remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
const localPlugins = getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||||
const options: any = [
|
const options: any = [
|
||||||
{
|
{
|
||||||
name: '复制路径',
|
name: '复制路径',
|
||||||
@ -54,7 +56,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
|||||||
regImg.test(ext) &&
|
regImg.test(ext) &&
|
||||||
fileList.length === 1
|
fileList.length === 1
|
||||||
) {
|
) {
|
||||||
options.push({
|
const option = {
|
||||||
name: cmd.label,
|
name: cmd.label,
|
||||||
value: 'plugin',
|
value: 'plugin',
|
||||||
icon: plugin.logo,
|
icon: plugin.logo,
|
||||||
@ -73,17 +75,19 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
|||||||
.toDataURL(),
|
.toDataURL(),
|
||||||
},
|
},
|
||||||
openPlugin,
|
openPlugin,
|
||||||
|
option,
|
||||||
});
|
});
|
||||||
clearClipboardFile();
|
clearClipboardFile();
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
options.push(option);
|
||||||
}
|
}
|
||||||
// 如果是文件,且符合文件正则类型
|
// 如果是文件,且符合文件正则类型
|
||||||
if (
|
if (
|
||||||
fileList.length > 1 ||
|
fileList.length > 1 ||
|
||||||
(cmd.type === 'file' && new RegExp(cmd.match).test(ext))
|
(cmd.type === 'file' && new RegExp(cmd.match).test(ext))
|
||||||
) {
|
) {
|
||||||
options.push({
|
const option = {
|
||||||
name: cmd,
|
name: cmd,
|
||||||
value: 'plugin',
|
value: 'plugin',
|
||||||
icon: plugin.logo,
|
icon: plugin.logo,
|
||||||
@ -94,6 +98,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
|||||||
plugin,
|
plugin,
|
||||||
fe,
|
fe,
|
||||||
cmd,
|
cmd,
|
||||||
|
option,
|
||||||
ext: {
|
ext: {
|
||||||
code: fe.code,
|
code: fe.code,
|
||||||
type: cmd.type || 'text',
|
type: cmd.type || 'text',
|
||||||
@ -103,7 +108,8 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
|||||||
});
|
});
|
||||||
clearClipboardFile();
|
clearClipboardFile();
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
options.push(option);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -143,7 +149,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
|||||||
dataUrl,
|
dataUrl,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const localPlugins = remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
const localPlugins = getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||||
const options: any = [];
|
const options: any = [];
|
||||||
// 再正则插件
|
// 再正则插件
|
||||||
localPlugins.forEach((plugin) => {
|
localPlugins.forEach((plugin) => {
|
||||||
@ -153,7 +159,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
|||||||
feature.forEach((fe) => {
|
feature.forEach((fe) => {
|
||||||
fe.cmds.forEach((cmd) => {
|
fe.cmds.forEach((cmd) => {
|
||||||
if (cmd.type === 'img') {
|
if (cmd.type === 'img') {
|
||||||
options.push({
|
const option = {
|
||||||
name: cmd.label,
|
name: cmd.label,
|
||||||
value: 'plugin',
|
value: 'plugin',
|
||||||
icon: plugin.logo,
|
icon: plugin.logo,
|
||||||
@ -170,10 +176,12 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
|||||||
payload: dataUrl,
|
payload: dataUrl,
|
||||||
},
|
},
|
||||||
openPlugin,
|
openPlugin,
|
||||||
|
option,
|
||||||
});
|
});
|
||||||
clearClipboardFile();
|
clearClipboardFile();
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
options.push(option);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { reactive, toRefs, ref } from 'vue';
|
import { reactive, toRefs, ref } from 'vue';
|
||||||
import { nativeImage, remote, ipcRenderer } from 'electron';
|
import { nativeImage, ipcRenderer } from 'electron';
|
||||||
|
import { getGlobal } from '@electron/remote';
|
||||||
import appSearch from '@/core/app-search';
|
import appSearch from '@/core/app-search';
|
||||||
import { PluginHandler } from '@/core';
|
import { PluginHandler } from '@/core';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
@ -8,6 +9,7 @@ import { execSync } from 'child_process';
|
|||||||
import searchManager from './search';
|
import searchManager from './search';
|
||||||
import optionsManager from './options';
|
import optionsManager from './options';
|
||||||
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/renderer';
|
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/renderer';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
const createPluginManager = (): any => {
|
const createPluginManager = (): any => {
|
||||||
const pluginInstance = new PluginHandler({
|
const pluginInstance = new PluginHandler({
|
||||||
@ -20,12 +22,35 @@ const createPluginManager = (): any => {
|
|||||||
localPlugins: [],
|
localPlugins: [],
|
||||||
currentPlugin: {},
|
currentPlugin: {},
|
||||||
pluginLoading: false,
|
pluginLoading: false,
|
||||||
|
pluginHistory: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
const appList = ref([]);
|
const appList: any = ref([]);
|
||||||
|
|
||||||
const initPlugins = async () => {
|
const initPlugins = async () => {
|
||||||
appList.value = await appSearch(nativeImage);
|
appList.value = await appSearch(nativeImage);
|
||||||
|
initLocalStartPlugin();
|
||||||
|
};
|
||||||
|
|
||||||
|
const initLocalStartPlugin = () => {
|
||||||
|
const result = ipcRenderer.sendSync('msg-trigger', {
|
||||||
|
type: 'dbGet',
|
||||||
|
data: {
|
||||||
|
id: 'rubick-local-start-app',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (result && result.value) {
|
||||||
|
appList.value = [...appList.value, ...result.value];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.removeLocalStartPlugin = ({ plugin }) => {
|
||||||
|
appList.value = appList.value.filter((app) => app.desc !== plugin.desc);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addLocalStartPlugin = ({ plugin }) => {
|
||||||
|
window.removeLocalStartPlugin({ plugin });
|
||||||
|
appList.value.push(plugin);
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadPlugin = async (plugin) => {
|
const loadPlugin = async (plugin) => {
|
||||||
@ -42,7 +67,7 @@ const createPluginManager = (): any => {
|
|||||||
state.pluginLoading = false;
|
state.pluginLoading = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const openPlugin = async (plugin) => {
|
const openPlugin = async (plugin, option) => {
|
||||||
if (plugin.pluginType === 'ui' || plugin.pluginType === 'system') {
|
if (plugin.pluginType === 'ui' || plugin.pluginType === 'system') {
|
||||||
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
|
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
|
||||||
return;
|
return;
|
||||||
@ -63,8 +88,29 @@ const createPluginManager = (): any => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (plugin.pluginType === 'app') {
|
if (plugin.pluginType === 'app') {
|
||||||
|
try {
|
||||||
execSync(plugin.action);
|
execSync(plugin.action);
|
||||||
|
} catch (e) {
|
||||||
|
message.error('启动应用出错,请确保启动应用存在!');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
window.initRubick();
|
||||||
|
changePluginHistory({
|
||||||
|
...plugin,
|
||||||
|
...option,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const changePluginHistory = (plugin) => {
|
||||||
|
if (state.pluginHistory.length >= 8) {
|
||||||
|
state.pluginHistory.pop();
|
||||||
|
}
|
||||||
|
state.pluginHistory.forEach((p, index) => {
|
||||||
|
if (p.name === plugin.name) {
|
||||||
|
state.pluginHistory.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
state.pluginHistory.unshift(plugin);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { searchValue, onSearch, setSearchValue, placeholder } =
|
const { searchValue, onSearch, setSearchValue, placeholder } =
|
||||||
@ -112,7 +158,7 @@ const createPluginManager = (): any => {
|
|||||||
|
|
||||||
window.updatePlugin = ({ currentPlugin }: any) => {
|
window.updatePlugin = ({ currentPlugin }: any) => {
|
||||||
state.currentPlugin = currentPlugin;
|
state.currentPlugin = currentPlugin;
|
||||||
remote.getGlobal('LOCAL_PLUGINS').updatePlugin(currentPlugin);
|
getGlobal('LOCAL_PLUGINS').updatePlugin(currentPlugin);
|
||||||
};
|
};
|
||||||
|
|
||||||
window.setCurrentPlugin = ({ currentPlugin }) => {
|
window.setCurrentPlugin = ({ currentPlugin }) => {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import throttle from 'lodash.throttle';
|
import throttle from 'lodash.throttle';
|
||||||
import { remote, ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
|
import { getGlobal } from '@electron/remote';
|
||||||
|
import PinyinMatch from 'pinyin-match';
|
||||||
import pluginClickEvent from './pluginClickEvent';
|
import pluginClickEvent from './pluginClickEvent';
|
||||||
import useFocus from './clipboardWatch';
|
import useFocus from './clipboardWatch';
|
||||||
|
|
||||||
@ -13,12 +15,12 @@ function formatReg(regStr) {
|
|||||||
function searchKeyValues(lists, value, strict = false) {
|
function searchKeyValues(lists, value, strict = false) {
|
||||||
return lists.filter((item) => {
|
return lists.filter((item) => {
|
||||||
if (typeof item === 'string') {
|
if (typeof item === 'string') {
|
||||||
return item.toLowerCase().indexOf(value.toLowerCase()) >= 0;
|
return !!PinyinMatch.match(item, value);
|
||||||
}
|
}
|
||||||
if (item.type === 'regex' && !strict) {
|
if (item.type === 'regex' && !strict) {
|
||||||
return formatReg(item.match).test(value);
|
return formatReg(item.match).test(value);
|
||||||
}
|
}
|
||||||
if (item.type === 'over') {
|
if (item.type === 'over' && !strict) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -40,7 +42,7 @@ const optionsManager = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const getOptionsFromSearchValue = (value, strict = false) => {
|
const getOptionsFromSearchValue = (value, strict = false) => {
|
||||||
const localPlugins = remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
const localPlugins = getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||||
let options: any = [];
|
let options: any = [];
|
||||||
// todo 先搜索 plugin
|
// todo 先搜索 plugin
|
||||||
localPlugins.forEach((plugin) => {
|
localPlugins.forEach((plugin) => {
|
||||||
@ -51,12 +53,14 @@ const optionsManager = ({
|
|||||||
const cmds = searchKeyValues(fe.cmds, value, strict);
|
const cmds = searchKeyValues(fe.cmds, value, strict);
|
||||||
options = [
|
options = [
|
||||||
...options,
|
...options,
|
||||||
...cmds.map((cmd) => ({
|
...cmds.map((cmd) => {
|
||||||
|
const option = {
|
||||||
name: cmd.label || cmd,
|
name: cmd.label || cmd,
|
||||||
value: 'plugin',
|
value: 'plugin',
|
||||||
icon: plugin.logo,
|
icon: plugin.logo,
|
||||||
desc: fe.explain,
|
desc: fe.explain,
|
||||||
type: plugin.pluginType,
|
type: plugin.pluginType,
|
||||||
|
match: PinyinMatch.match(cmd.label || cmd, value),
|
||||||
zIndex: cmd.label ? 0 : 1, // 排序权重
|
zIndex: cmd.label ? 0 : 1, // 排序权重
|
||||||
click: () => {
|
click: () => {
|
||||||
pluginClickEvent({
|
pluginClickEvent({
|
||||||
@ -71,9 +75,12 @@ const optionsManager = ({
|
|||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
openPlugin,
|
openPlugin,
|
||||||
|
option,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
})),
|
};
|
||||||
|
return option;
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -88,13 +95,16 @@ const optionsManager = ({
|
|||||||
descMap.set(plugin, true);
|
descMap.set(plugin, true);
|
||||||
let has = false;
|
let has = false;
|
||||||
plugin.keyWords.some((keyWord) => {
|
plugin.keyWords.some((keyWord) => {
|
||||||
|
const match = PinyinMatch.match(keyWord, value);
|
||||||
if (
|
if (
|
||||||
keyWord
|
// keyWord
|
||||||
.toLocaleUpperCase()
|
// .toLocaleUpperCase()
|
||||||
.indexOf(value.toLocaleUpperCase()) >= 0
|
// .indexOf(value.toLocaleUpperCase()) >= 0 ||
|
||||||
|
match
|
||||||
) {
|
) {
|
||||||
has = keyWord;
|
has = keyWord;
|
||||||
plugin.name = keyWord;
|
plugin.name = keyWord;
|
||||||
|
plugin.match = match;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -105,13 +115,14 @@ const optionsManager = ({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.map((plugin) => {
|
.map((plugin) => {
|
||||||
return {
|
const option = {
|
||||||
...plugin,
|
...plugin,
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
click: () => {
|
click: () => {
|
||||||
openPlugin(plugin);
|
openPlugin(plugin, option);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
return option;
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
return options;
|
return options;
|
||||||
|
@ -3,7 +3,14 @@ import path from 'path';
|
|||||||
import { toRaw } from 'vue';
|
import { toRaw } from 'vue';
|
||||||
import commonConst from '@/common/utils/commonConst';
|
import commonConst from '@/common/utils/commonConst';
|
||||||
|
|
||||||
export default function pluginClickEvent({ plugin, fe, cmd, ext, openPlugin }) {
|
export default function pluginClickEvent({
|
||||||
|
plugin,
|
||||||
|
fe,
|
||||||
|
cmd,
|
||||||
|
ext,
|
||||||
|
openPlugin,
|
||||||
|
option,
|
||||||
|
}) {
|
||||||
const pluginPath = path.resolve(baseDir, 'node_modules', plugin.name);
|
const pluginPath = path.resolve(baseDir, 'node_modules', plugin.name);
|
||||||
const pluginDist = {
|
const pluginDist = {
|
||||||
...toRaw(plugin),
|
...toRaw(plugin),
|
||||||
@ -15,7 +22,7 @@ export default function pluginClickEvent({ plugin, fe, cmd, ext, openPlugin }) {
|
|||||||
// 模板文件
|
// 模板文件
|
||||||
if (!plugin.main) {
|
if (!plugin.main) {
|
||||||
pluginDist.tplPath = commonConst.dev()
|
pluginDist.tplPath = commonConst.dev()
|
||||||
? 'http://localhost:8082/#/'
|
? 'http://localhost:8083/#/'
|
||||||
: `file://${__static}/tpl/index.html`;
|
: `file://${__static}/tpl/index.html`;
|
||||||
}
|
}
|
||||||
// 插件市场
|
// 插件市场
|
||||||
@ -24,5 +31,5 @@ export default function pluginClickEvent({ plugin, fe, cmd, ext, openPlugin }) {
|
|||||||
? 'http://localhost:8081/#/'
|
? 'http://localhost:8081/#/'
|
||||||
: `file://${__static}/feature/index.html`;
|
: `file://${__static}/feature/index.html`;
|
||||||
}
|
}
|
||||||
openPlugin(pluginDist);
|
openPlugin(pluginDist, option);
|
||||||
}
|
}
|
||||||
|
2
src/renderer/shims-vue.d.ts
vendored
2
src/renderer/shims-vue.d.ts
vendored
@ -21,6 +21,8 @@ interface Window {
|
|||||||
loadPlugin: (plugin: any) => void;
|
loadPlugin: (plugin: any) => void;
|
||||||
updatePlugin: (plugin: any) => void;
|
updatePlugin: (plugin: any) => void;
|
||||||
initRubick: () => void;
|
initRubick: () => void;
|
||||||
|
addLocalStartPlugin: (plugin: any) => void;
|
||||||
|
removeLocalStartPlugin: (plugin: any) => void;
|
||||||
setCurrentPlugin: (plugin: any) => void;
|
setCurrentPlugin: (plugin: any) => void;
|
||||||
pluginLoaded: () => void;
|
pluginLoaded: () => void;
|
||||||
getMainInputInfo: () => any;
|
getMainInputInfo: () => any;
|
||||||
|
@ -24,7 +24,12 @@ module.exports = {
|
|||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
mainProcessFile: 'src/main/index.ts',
|
mainProcessFile: 'src/main/index.ts',
|
||||||
mainProcessWatch: ['src/main'],
|
mainProcessWatch: ['src/main'],
|
||||||
externals: ['pouchdb', 'extract-file-icon', 'electron-screenshots'],
|
externals: [
|
||||||
|
'pouchdb',
|
||||||
|
'extract-file-icon',
|
||||||
|
'electron-screenshots',
|
||||||
|
'@electron/remote',
|
||||||
|
],
|
||||||
// Use this to change the entry point of your app's render process. default src/[main|index].[js|ts]
|
// Use this to change the entry point of your app's render process. default src/[main|index].[js|ts]
|
||||||
builderOptions: {
|
builderOptions: {
|
||||||
productName: 'rubick2',
|
productName: 'rubick2',
|
||||||
|
189
yarn.lock
189
yarn.lock
@ -998,21 +998,25 @@
|
|||||||
ajv "^6.12.0"
|
ajv "^6.12.0"
|
||||||
ajv-keywords "^3.4.1"
|
ajv-keywords "^3.4.1"
|
||||||
|
|
||||||
"@electron/get@^1.0.1":
|
"@electron/get@^2.0.0":
|
||||||
version "1.14.1"
|
version "2.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.14.1.tgz#16ba75f02dffb74c23965e72d617adc721d27f40"
|
resolved "https://registry.yarnpkg.com/@electron/get/-/get-2.0.2.tgz#ae2a967b22075e9c25aaf00d5941cd79c21efd7e"
|
||||||
integrity sha512-BrZYyL/6m0ZXz/lDxy/nlVhQz+WF+iPS6qXolEU8atw7h6v1aYkjwJZ63m+bJMBTxDE66X+r2tPS4a/8C82sZw==
|
integrity sha512-eFZVFoRXb3GFGd7Ak7W4+6jBl9wBtiZ4AaYOse97ej6mKj5tkyO0dUnUChs1IhJZtx1BENo4/p4WUTXpi6vT+g==
|
||||||
dependencies:
|
dependencies:
|
||||||
debug "^4.1.1"
|
debug "^4.1.1"
|
||||||
env-paths "^2.2.0"
|
env-paths "^2.2.0"
|
||||||
fs-extra "^8.1.0"
|
fs-extra "^8.1.0"
|
||||||
got "^9.6.0"
|
got "^11.8.5"
|
||||||
progress "^2.0.3"
|
progress "^2.0.3"
|
||||||
semver "^6.2.0"
|
semver "^6.2.0"
|
||||||
sumchecker "^3.0.1"
|
sumchecker "^3.0.1"
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
global-agent "^3.0.0"
|
global-agent "^3.0.0"
|
||||||
global-tunnel-ng "^2.7.1"
|
|
||||||
|
"@electron/remote@^2.0.10":
|
||||||
|
version "2.0.10"
|
||||||
|
resolved "https://registry.yarnpkg.com/@electron/remote/-/remote-2.0.10.tgz#133e2f607b1861ac249bd78b5abd1e961feed713"
|
||||||
|
integrity sha512-3SFKKaQXcyWgwmibud+UqJl/XlHOgLcI3fwtB9pNelPSJAcTxocOJrF6FaxBIQaj1+R05Di6xuAswZpXAW7xhA==
|
||||||
|
|
||||||
"@electron/universal@1.0.5":
|
"@electron/universal@1.0.5":
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
@ -1391,10 +1395,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.4.tgz#fd26723a8a3f8f46729812a7f9b4fc2d1608ed39"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.4.tgz#fd26723a8a3f8f46729812a7f9b4fc2d1608ed39"
|
||||||
integrity sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg==
|
integrity sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg==
|
||||||
|
|
||||||
"@types/node@^14.6.2":
|
"@types/node@^18.11.18":
|
||||||
version "14.18.23"
|
version "18.17.6"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.23.tgz#70f5f20b0b1b38f696848c1d3647bb95694e615e"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.6.tgz#0296e9a30b22d2a8fcaa48d3c45afe51474ca55b"
|
||||||
integrity sha512-MhbCWN18R4GhO8ewQWAFK4TGQdBpXWByukz7cWyJmXhvRuCIaM/oWytGPqVmDzgEnnaIc9ss6HbU5mUi+vyZPA==
|
integrity sha512-fGmT/P7z7ecA6bv/ia5DlaWCH4YeZvAQMNpUhrJjtAhOhZfoxS1VLUgU2pdk63efSjQaOJWdXMuAJsws+8I6dg==
|
||||||
|
|
||||||
"@types/normalize-package-data@^2.4.0":
|
"@types/normalize-package-data@^2.4.0":
|
||||||
version "2.4.1"
|
version "2.4.1"
|
||||||
@ -1525,6 +1529,13 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@types/yargs-parser" "*"
|
"@types/yargs-parser" "*"
|
||||||
|
|
||||||
|
"@types/yauzl@^2.9.1":
|
||||||
|
version "2.10.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.0.tgz#b3248295276cf8c6f153ebe6a9aba0c988cb2599"
|
||||||
|
integrity sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
"@typescript-eslint/eslint-plugin@^4.18.0":
|
"@typescript-eslint/eslint-plugin@^4.18.0":
|
||||||
version "4.33.0"
|
version "4.33.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276"
|
||||||
@ -2717,6 +2728,11 @@ balanced-match@^1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||||
|
|
||||||
|
base64-js@1.1.2:
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.1.2.tgz#d6400cac1c4c660976d90d07a04351d89395f5e8"
|
||||||
|
integrity sha512-AIxxJSNK6fMJTnRuY14y/+86h+R4Ybztcchea+Al8aPIPFa6LvDSV90VN5EH81DVXQmh6YjIqpLyG/ljQDoqeQ==
|
||||||
|
|
||||||
base64-js@^1.0.2, base64-js@^1.3.1, base64-js@^1.5.1:
|
base64-js@^1.0.2, base64-js@^1.3.1, base64-js@^1.5.1:
|
||||||
version "1.5.1"
|
version "1.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
||||||
@ -2757,6 +2773,11 @@ bfj@^6.1.1:
|
|||||||
hoopy "^0.1.4"
|
hoopy "^0.1.4"
|
||||||
tryer "^1.0.1"
|
tryer "^1.0.1"
|
||||||
|
|
||||||
|
big-integer@^1.6.7:
|
||||||
|
version "1.6.51"
|
||||||
|
resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686"
|
||||||
|
integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==
|
||||||
|
|
||||||
big.js@^3.1.3:
|
big.js@^3.1.3:
|
||||||
version "3.2.0"
|
version "3.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e"
|
resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e"
|
||||||
@ -2860,6 +2881,20 @@ boxen@^5.0.0:
|
|||||||
widest-line "^3.1.0"
|
widest-line "^3.1.0"
|
||||||
wrap-ansi "^7.0.0"
|
wrap-ansi "^7.0.0"
|
||||||
|
|
||||||
|
bplist-creator@0.0.7:
|
||||||
|
version "0.0.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/bplist-creator/-/bplist-creator-0.0.7.tgz#37df1536092824b87c42f957b01344117372ae45"
|
||||||
|
integrity sha512-xp/tcaV3T5PCiaY04mXga7o/TE+t95gqeLmADeBI1CvZtdWTbgBt3uLpvh4UWtenKeBhCV6oVxGk38yZr2uYEA==
|
||||||
|
dependencies:
|
||||||
|
stream-buffers "~2.2.0"
|
||||||
|
|
||||||
|
bplist-parser@0.1.1:
|
||||||
|
version "0.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.1.1.tgz#d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6"
|
||||||
|
integrity sha512-2AEM0FXy8ZxVLBuqX0hqt1gDwcnz2zygEkQ6zaD5Wko/sB9paUNwlpawrFtKeHUAQUOzjVy9AO4oeonqIHKA9Q==
|
||||||
|
dependencies:
|
||||||
|
big-integer "^1.6.7"
|
||||||
|
|
||||||
brace-expansion@^1.1.7:
|
brace-expansion@^1.1.7:
|
||||||
version "1.1.11"
|
version "1.1.11"
|
||||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||||
@ -3720,7 +3755,7 @@ concat-map@0.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||||
|
|
||||||
concat-stream@^1.5.0, concat-stream@^1.6.2:
|
concat-stream@^1.5.0:
|
||||||
version "1.6.2"
|
version "1.6.2"
|
||||||
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
|
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
|
||||||
integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==
|
integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==
|
||||||
@ -3730,14 +3765,6 @@ concat-stream@^1.5.0, concat-stream@^1.6.2:
|
|||||||
readable-stream "^2.2.2"
|
readable-stream "^2.2.2"
|
||||||
typedarray "^0.0.6"
|
typedarray "^0.0.6"
|
||||||
|
|
||||||
config-chain@^1.1.11:
|
|
||||||
version "1.1.13"
|
|
||||||
resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4"
|
|
||||||
integrity sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==
|
|
||||||
dependencies:
|
|
||||||
ini "^1.3.4"
|
|
||||||
proto-list "~1.2.1"
|
|
||||||
|
|
||||||
configstore@^5.0.1:
|
configstore@^5.0.1:
|
||||||
version "5.0.1"
|
version "5.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96"
|
resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96"
|
||||||
@ -4170,7 +4197,7 @@ dayjs@^1.10.5:
|
|||||||
resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.9.tgz#9ca491933fadd0a60a2c19f6c237c03517d71d1a"
|
resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.9.tgz#9ca491933fadd0a60a2c19f6c237c03517d71d1a"
|
||||||
integrity sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==
|
integrity sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==
|
||||||
|
|
||||||
debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9:
|
debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8:
|
||||||
version "2.6.9"
|
version "2.6.9"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
||||||
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
|
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
|
||||||
@ -4765,14 +4792,14 @@ electron-updater@^4.6.5:
|
|||||||
lodash.isequal "^4.5.0"
|
lodash.isequal "^4.5.0"
|
||||||
semver "^7.3.5"
|
semver "^7.3.5"
|
||||||
|
|
||||||
electron@^13.0.0:
|
electron@26.0.0:
|
||||||
version "13.6.9"
|
version "26.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/electron/-/electron-13.6.9.tgz#7bd83cc1662ceaaa09dcd132a7b507cec888b028"
|
resolved "https://registry.yarnpkg.com/electron/-/electron-26.0.0.tgz#f054aad7db99379aba11237622e9742bbe800dea"
|
||||||
integrity sha512-Es/sBy85NIuqsO9MW41PUCpwIkeinlTQ7g0ainfnmRAM2rmog3GBxVCaoV5dzEjwTF7TKG1Yr/E7Z3qHmlfWAg==
|
integrity sha512-x57bdCaDvgnlc41VOm/UWihJCCiI3OxJKiBgB/e5F7Zd6avo+61mO6IzQS7Bu/k/a1KPjou25EUORR6UPKznBQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@electron/get" "^1.0.1"
|
"@electron/get" "^2.0.0"
|
||||||
"@types/node" "^14.6.2"
|
"@types/node" "^18.11.18"
|
||||||
extract-zip "^1.0.3"
|
extract-zip "^2.0.1"
|
||||||
|
|
||||||
elliptic@^6.5.3:
|
elliptic@^6.5.3:
|
||||||
version "6.5.4"
|
version "6.5.4"
|
||||||
@ -4807,7 +4834,7 @@ emojis-list@^3.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
|
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
|
||||||
integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==
|
integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==
|
||||||
|
|
||||||
encodeurl@^1.0.2, encodeurl@~1.0.2:
|
encodeurl@~1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
|
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
|
||||||
integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==
|
integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==
|
||||||
@ -5330,15 +5357,16 @@ extract-file-icon@^0.3.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
node-addon-api "1.7.1"
|
node-addon-api "1.7.1"
|
||||||
|
|
||||||
extract-zip@^1.0.3:
|
extract-zip@^2.0.1:
|
||||||
version "1.7.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.7.0.tgz#556cc3ae9df7f452c493a0cfb51cc30277940927"
|
resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a"
|
||||||
integrity sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==
|
integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==
|
||||||
dependencies:
|
dependencies:
|
||||||
concat-stream "^1.6.2"
|
debug "^4.1.1"
|
||||||
debug "^2.6.9"
|
get-stream "^5.1.0"
|
||||||
mkdirp "^0.5.4"
|
|
||||||
yauzl "^2.10.0"
|
yauzl "^2.10.0"
|
||||||
|
optionalDependencies:
|
||||||
|
"@types/yauzl" "^2.9.1"
|
||||||
|
|
||||||
extsprintf@1.3.0:
|
extsprintf@1.3.0:
|
||||||
version "1.3.0"
|
version "1.3.0"
|
||||||
@ -5913,16 +5941,6 @@ global-dirs@^3.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
ini "2.0.0"
|
ini "2.0.0"
|
||||||
|
|
||||||
global-tunnel-ng@^2.7.1:
|
|
||||||
version "2.7.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/global-tunnel-ng/-/global-tunnel-ng-2.7.1.tgz#d03b5102dfde3a69914f5ee7d86761ca35d57d8f"
|
|
||||||
integrity sha512-4s+DyciWBV0eK148wqXxcmVAbFVPqtc3sEtUE/GTQfuU80rySLcMhUmHKSHI7/LDj8q0gDYI1lIhRRB7ieRAqg==
|
|
||||||
dependencies:
|
|
||||||
encodeurl "^1.0.2"
|
|
||||||
lodash "^4.17.10"
|
|
||||||
npm-conf "^1.1.3"
|
|
||||||
tunnel "^0.0.6"
|
|
||||||
|
|
||||||
globals@^11.1.0:
|
globals@^11.1.0:
|
||||||
version "11.12.0"
|
version "11.12.0"
|
||||||
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
|
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
|
||||||
@ -6008,6 +6026,23 @@ got@^11.8.3:
|
|||||||
p-cancelable "^2.0.0"
|
p-cancelable "^2.0.0"
|
||||||
responselike "^2.0.0"
|
responselike "^2.0.0"
|
||||||
|
|
||||||
|
got@^11.8.5:
|
||||||
|
version "11.8.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a"
|
||||||
|
integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==
|
||||||
|
dependencies:
|
||||||
|
"@sindresorhus/is" "^4.0.0"
|
||||||
|
"@szmarczak/http-timer" "^4.0.5"
|
||||||
|
"@types/cacheable-request" "^6.0.1"
|
||||||
|
"@types/responselike" "^1.0.0"
|
||||||
|
cacheable-lookup "^5.0.3"
|
||||||
|
cacheable-request "^7.0.2"
|
||||||
|
decompress-response "^6.0.0"
|
||||||
|
http2-wrapper "^1.0.0-beta.5.2"
|
||||||
|
lowercase-keys "^2.0.0"
|
||||||
|
p-cancelable "^2.0.0"
|
||||||
|
responselike "^2.0.0"
|
||||||
|
|
||||||
got@^9.6.0:
|
got@^9.6.0:
|
||||||
version "9.6.0"
|
version "9.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
|
resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
|
||||||
@ -6559,7 +6594,7 @@ ini@2.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5"
|
resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5"
|
||||||
integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==
|
integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==
|
||||||
|
|
||||||
ini@^1.3.4, ini@~1.3.0:
|
ini@~1.3.0:
|
||||||
version "1.3.8"
|
version "1.3.8"
|
||||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
|
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
|
||||||
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
|
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
|
||||||
@ -7524,7 +7559,7 @@ lodash.uniq@^4.5.0:
|
|||||||
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
||||||
integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==
|
integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==
|
||||||
|
|
||||||
lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3:
|
lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3:
|
||||||
version "4.17.21"
|
version "4.17.21"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||||
@ -7898,7 +7933,7 @@ mixin-deep@^1.2.0:
|
|||||||
for-in "^1.0.2"
|
for-in "^1.0.2"
|
||||||
is-extendable "^1.0.1"
|
is-extendable "^1.0.1"
|
||||||
|
|
||||||
mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.6, mkdirp@~0.5.1:
|
mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.6, mkdirp@~0.5.1:
|
||||||
version "0.5.6"
|
version "0.5.6"
|
||||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6"
|
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6"
|
||||||
integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==
|
integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==
|
||||||
@ -8072,7 +8107,7 @@ node-gyp-build@~4.1.0:
|
|||||||
|
|
||||||
node-key-sender@^1.0.11:
|
node-key-sender@^1.0.11:
|
||||||
version "1.0.11"
|
version "1.0.11"
|
||||||
resolved "https://registry.npmmirror.com/node-key-sender/-/node-key-sender-1.0.11.tgz#93210f07163607d8daf2874f1a29567d0acdb94c"
|
resolved "https://registry.yarnpkg.com/node-key-sender/-/node-key-sender-1.0.11.tgz#93210f07163607d8daf2874f1a29567d0acdb94c"
|
||||||
integrity sha512-vv2IXd8QdZBFYXaIy02uy2rK6EKj+tOTEuoTxJKS9l8zw8Cz6DeLffR8ompj7N2A3h6XK7aiy+YAcTaeOqwp2Q==
|
integrity sha512-vv2IXd8QdZBFYXaIy02uy2rK6EKj+tOTEuoTxJKS9l8zw8Cz6DeLffR8ompj7N2A3h6XK7aiy+YAcTaeOqwp2Q==
|
||||||
|
|
||||||
node-libs-browser@^2.2.1:
|
node-libs-browser@^2.2.1:
|
||||||
@ -8166,14 +8201,6 @@ normalize-url@^6.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a"
|
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a"
|
||||||
integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==
|
integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==
|
||||||
|
|
||||||
npm-conf@^1.1.3:
|
|
||||||
version "1.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/npm-conf/-/npm-conf-1.1.3.tgz#256cc47bd0e218c259c4e9550bf413bc2192aff9"
|
|
||||||
integrity sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==
|
|
||||||
dependencies:
|
|
||||||
config-chain "^1.1.11"
|
|
||||||
pify "^3.0.0"
|
|
||||||
|
|
||||||
npm-run-path@^2.0.0:
|
npm-run-path@^2.0.0:
|
||||||
version "2.0.2"
|
version "2.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
|
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
|
||||||
@ -8681,6 +8708,11 @@ pinkie@^2.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
||||||
integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==
|
integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==
|
||||||
|
|
||||||
|
pinyin-match@^1.2.4:
|
||||||
|
version "1.2.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/pinyin-match/-/pinyin-match-1.2.4.tgz#94381bb6501cfd3c24f923fe36c81710d8c49bcc"
|
||||||
|
integrity sha512-HpUiaSxcG3rrpKAMZXq/rMHbEp7wvfu9B64lHJBy+63xAr/hVdBC8xqkWWPnNyjSb19ihdh8FnXo+9m6jAr9Mg==
|
||||||
|
|
||||||
pkg-dir@^1.0.0:
|
pkg-dir@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4"
|
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4"
|
||||||
@ -8702,6 +8734,15 @@ pkg-dir@^4.1.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
find-up "^4.0.0"
|
find-up "^4.0.0"
|
||||||
|
|
||||||
|
plist@2.0.1:
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/plist/-/plist-2.0.1.tgz#0a32ca9481b1c364e92e18dc55c876de9d01da8b"
|
||||||
|
integrity sha512-pLZ1xkqqdO0puqm8g9kHzGb9oPkW32RPprDsNtjyVJ1cAWdglIgq+k+kO3sFAm5fEGIW04B4oa27JsfzncnHkA==
|
||||||
|
dependencies:
|
||||||
|
base64-js "1.1.2"
|
||||||
|
xmlbuilder "8.2.2"
|
||||||
|
xmldom "0.1.x"
|
||||||
|
|
||||||
plist@^3.0.1, plist@^3.0.4:
|
plist@^3.0.1, plist@^3.0.4:
|
||||||
version "3.0.6"
|
version "3.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.6.tgz#7cfb68a856a7834bca6dbfe3218eb9c7740145d3"
|
resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.6.tgz#7cfb68a856a7834bca6dbfe3218eb9c7740145d3"
|
||||||
@ -9158,11 +9199,6 @@ promise-inflight@^1.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
|
resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
|
||||||
integrity sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==
|
integrity sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==
|
||||||
|
|
||||||
proto-list@~1.2.1:
|
|
||||||
version "1.2.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
|
|
||||||
integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==
|
|
||||||
|
|
||||||
proxy-addr@~2.0.7:
|
proxy-addr@~2.0.7:
|
||||||
version "2.0.7"
|
version "2.0.7"
|
||||||
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
|
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
|
||||||
@ -10040,6 +10076,15 @@ signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3:
|
|||||||
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
|
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
|
||||||
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
|
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
|
||||||
|
|
||||||
|
simple-plist@0.2.1:
|
||||||
|
version "0.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/simple-plist/-/simple-plist-0.2.1.tgz#71766db352326928cf3a807242ba762322636723"
|
||||||
|
integrity sha512-1xgqR0IwahCZDfwUp36DmxKX0dwoh/KtnxbY8D5cs19BF5889ZlRSViTAknEWO39ND573T2NBBHqP7Qf6spPPQ==
|
||||||
|
dependencies:
|
||||||
|
bplist-creator "0.0.7"
|
||||||
|
bplist-parser "0.1.1"
|
||||||
|
plist "2.0.1"
|
||||||
|
|
||||||
simple-swizzle@^0.2.2:
|
simple-swizzle@^0.2.2:
|
||||||
version "0.2.2"
|
version "0.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
|
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
|
||||||
@ -10351,6 +10396,11 @@ stream-browserify@^2.0.1:
|
|||||||
inherits "~2.0.1"
|
inherits "~2.0.1"
|
||||||
readable-stream "^2.0.2"
|
readable-stream "^2.0.2"
|
||||||
|
|
||||||
|
stream-buffers@~2.2.0:
|
||||||
|
version "2.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
|
||||||
|
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
|
||||||
|
|
||||||
stream-each@^1.1.0:
|
stream-each@^1.1.0:
|
||||||
version "1.2.3"
|
version "1.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae"
|
resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae"
|
||||||
@ -10926,11 +10976,6 @@ tunnel-agent@^0.6.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer "^5.0.1"
|
safe-buffer "^5.0.1"
|
||||||
|
|
||||||
tunnel@^0.0.6:
|
|
||||||
version "0.0.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
|
|
||||||
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==
|
|
||||||
|
|
||||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||||
version "0.14.5"
|
version "0.14.5"
|
||||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||||
@ -11769,11 +11814,21 @@ xdg-basedir@^4.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13"
|
resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13"
|
||||||
integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==
|
integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==
|
||||||
|
|
||||||
|
xmlbuilder@8.2.2:
|
||||||
|
version "8.2.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773"
|
||||||
|
integrity sha512-eKRAFz04jghooy8muekqzo8uCSVNeyRedbuJrp0fovbLIi7wlsYtdUn3vBAAPq2Y3/0xMz2WMEUQ8yhVVO9Stw==
|
||||||
|
|
||||||
xmlbuilder@>=11.0.1, xmlbuilder@^15.1.1:
|
xmlbuilder@>=11.0.1, xmlbuilder@^15.1.1:
|
||||||
version "15.1.1"
|
version "15.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz#9dcdce49eea66d8d10b42cae94a79c3c8d0c2ec5"
|
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz#9dcdce49eea66d8d10b42cae94a79c3c8d0c2ec5"
|
||||||
integrity sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==
|
integrity sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==
|
||||||
|
|
||||||
|
xmldom@0.1.x:
|
||||||
|
version "0.1.31"
|
||||||
|
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.31.tgz#b76c9a1bd9f0a9737e5a72dc37231cf38375e2ff"
|
||||||
|
integrity sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==
|
||||||
|
|
||||||
xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1:
|
xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1:
|
||||||
version "4.0.2"
|
version "4.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
|
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user