feat: 文件传输插件增加文叔叔与filesend

pull/64/head
moonrailgun 2 years ago
parent b677845f97
commit d9acf3b679

@ -5,6 +5,6 @@
"icon": "/plugins/com.msgbyte.filepizza/assets/icon.png", "icon": "/plugins/com.msgbyte.filepizza/assets/icon.png",
"version": "0.0.0", "version": "0.0.0",
"author": "moonrailgun", "author": "moonrailgun",
"description": "快捷打开 filepizza 以支持p2p传输文件", "description": "在聊天输入框快捷打开 filepizza 以支持p2p传输文件",
"requireRestart": true "requireRestart": true
} }

@ -2,7 +2,7 @@
"name": "@plugins/com.msgbyte.filepizza", "name": "@plugins/com.msgbyte.filepizza",
"main": "src/index.tsx", "main": "src/index.tsx",
"version": "0.0.0", "version": "0.0.0",
"description": "快捷打开filepizza以支持p2p传输文件", "description": "在聊天输入框快捷打开filepizza以支持p2p传输文件",
"private": true, "private": true,
"scripts": { "scripts": {
"sync:declaration": "tailchat declaration github" "sync:declaration": "tailchat declaration github"

@ -0,0 +1,9 @@
{
"label": "filesend",
"name": "com.msgbyte.filesend",
"url": "/plugins/com.msgbyte.filesend/index.js",
"version": "0.0.0",
"author": "moonrailgun",
"description": "在聊天输入框快捷打开 Filesend 以支持传输文件",
"requireRestart": true
}

@ -0,0 +1,14 @@
{
"name": "@plugins/com.msgbyte.filesend",
"main": "src/index.tsx",
"version": "0.0.0",
"description": "在聊天输入框快捷打开 filesend 以支持传输文件",
"private": true,
"scripts": {
"sync:declaration": "tailchat declaration github"
},
"dependencies": {},
"devDependencies": {
"react": "18.2.0"
}
}

@ -0,0 +1,35 @@
import { regChatInputAction } from '@capital/common';
regChatInputAction({
label: 'FileSend',
onClick: () => {
const width = 414;
const height = 736;
const top = (window.screen.height - height) / 2;
const left = (window.screen.width - width) / 2;
window.open(
'https://filesend.standardnotes.com/',
'FileSend',
buildWindowFeatures({
top,
left,
width,
height,
menubar: false,
toolbar: false,
location: false,
status: false,
resizable: true,
})
);
},
});
function buildWindowFeatures(
options: Record<string, string | number | boolean>
): string {
return Object.entries(options)
.map(([key, val]) => `${key}=${val}`)
.join(',');
}

@ -0,0 +1,7 @@
{
"compilerOptions": {
"esModuleInterop": true,
"jsx": "react",
"importsNotUsedAsValues": "error"
}
}

@ -0,0 +1,326 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/// <reference types="react" />
/**
* Tailchat
*
* : pnpm run plugins:declaration:generate
*/
/**
* Tailchat
*/
declare module '@capital/common' {
export const useGroupPanelParams: any;
/**
*
*/
export const openModal: (
content: React.ReactNode,
props?: {
/**
*
* @default false
*/
closable?: boolean;
/**
*
*/
maskClosable?: boolean;
/**
* modal
*/
onCloseModal?: () => void;
}
) => number;
export const closeModal: any;
export const ModalWrapper: any;
export const useModalContext: any;
export const openConfirmModal: any;
export const openReconfirmModal: any;
export const Loadable: any;
export const getGlobalState: any;
export const getJWTUserInfo: () => Promise<{
_id?: string;
nickname?: string;
email?: string;
avatar?: string;
}>;
export const dataUrlToFile: any;
export const urlSearchStringify: any;
export const urlSearchParse: any;
export const appendUrlSearch: any;
export const getServiceWorkerRegistration: any;
export const getServiceUrl: () => string;
export const getCachedUserInfo: (
userId: string,
refetch?: boolean
) => Promise<{
_id: string;
email: string;
nickname: string;
discriminator: string;
avatar: string | null;
temporary: boolean;
}>;
export const getCachedConverseInfo: any;
/**
*
* @example
* localTrans({'zh-CN': '你好', 'en-US': 'Hello'});
*
* @param trans
*/
export const localTrans: (trans: Record<'zh-CN' | 'en-US', string>) => string;
export const getLanguage: any;
export const sharedEvent: any;
export const useAsync: any;
export const useAsyncFn: any;
export const useAsyncRefresh: any;
export const useAsyncRequest: any;
export const uploadFile: any;
export const showToasts: any;
export const showErrorToasts: any;
export const fetchAvailableServices: any;
export const isValidStr: any;
export const useGroupPanelInfo: any;
export const sendMessage: any;
export const useLocation: any;
export const useNavigate: any;
export const createFastFormSchema: any;
export const fieldSchema: any;
export const useCurrentUserInfo: any;
export const createPluginRequest: (pluginName: string) => {
get: (actionName: string, config?: any) => Promise<any>;
post: (actionName: string, data?: any, config?: any) => Promise<any>;
};
export const postRequest: any;
export const pluginCustomPanel: any;
export const regCustomPanel: any;
export const pluginGroupPanel: any;
export const regGroupPanel: any;
export const messageInterpreter: any;
export const regMessageInterpreter: any;
export const getMessageRender: any;
export const regMessageRender: any;
export const getMessageTextDecorators: any;
export const regMessageTextDecorators: any;
export const ChatInputActionContextProps: any;
export const pluginChatInputActions: any;
export const regChatInputAction: any;
export const regSocketEventListener: (item: {
eventName: string;
eventFn: (...args: any[]) => void;
}) => void;
export const pluginColorScheme: any;
export const regPluginColorScheme: any;
export const pluginInspectServices: any;
export const regInspectService: any;
export const pluginMessageExtraParsers: any;
export const regMessageExtraParser: any;
export const pluginRootRoute: any;
export const regPluginRootRoute: any;
export const pluginPanelActions: any;
export const regPluginPanelAction: any;
export const pluginPermission: any;
export const regPluginPermission: (permission: {
/**
* key,
* , : plugin.com.msgbyte.github.manage
*/
key: string;
/**
*
*/
title: string;
/**
*
*/
desc: string;
/**
*
*/
default: boolean;
/**
*
*/
required?: string[];
}) => void;
export const useGroupIdContext: () => string;
export const useGroupPanelContext: () => {
groupId: string;
panelId: string;
} | null;
export const useSocketContext: any;
}
/**
* Tailchat
*/
declare module '@capital/component' {
export const Button: any;
export const Checkbox: any;
export const Input: any;
export const Divider: any;
export const Space: any;
export const Menu: any;
export const Table: any;
export const Switch: any;
export const Tooltip: any;
/**
* @link https://ant.design/components/notification-cn/
*/
export const notification: any;
export const Empty: any;
export const Avatar: any;
export const SensitiveText: React.FC<{ className?: string; text: string }>;
export const TextArea: any;
export const Image: any;
export const Icon: React.FC<{ icon: string } & React.SVGProps<SVGSVGElement>>;
export const IconBtn: React.FC<{
icon: string;
iconClassName?: string;
shape?: 'circle' | 'square';
title?: string;
}>;
export const PillTabs: any;
export const PillTabPane: any;
export const LoadingSpinner: any;
export const WebFastForm: any;
export const WebMetaForm: any;
export const createMetaFormSchema: any;
export const metaFormFieldSchema: any;
export const FullModalField: any;
export const DefaultFullModalInputEditorRender: any;
export const DefaultFullModalTextAreaEditorRender: any;
export const openModal: any;
export const closeModal: any;
export const ModalWrapper: any;
export const useModalContext: any;
export const openConfirmModal: any;
export const openReconfirmModal: any;
export const Loading: any;
export const SidebarView: any;
export const GroupPanelSelector: any;
export const Emoji: any;
export const PortalAdd: any;
export const PortalRemove: any;
export const ErrorBoundary: any;
export const UserName: React.FC<{
userId: string;
className?: string;
}>;
export const Markdown: any;
}

@ -5,6 +5,6 @@
"icon": "/plugins/com.msgbyte.filesfm/assets/icon.png", "icon": "/plugins/com.msgbyte.filesfm/assets/icon.png",
"version": "0.0.0", "version": "0.0.0",
"author": "moonrailgun", "author": "moonrailgun",
"description": "快捷打开 files.fm 以支持传输文件", "description": "在聊天输入框快捷打开 files.fm 以支持传输文件",
"requireRestart": true "requireRestart": true
} }

@ -2,7 +2,7 @@
"name": "@plugins/com.msgbyte.filesfm", "name": "@plugins/com.msgbyte.filesfm",
"main": "src/index.tsx", "main": "src/index.tsx",
"version": "0.0.0", "version": "0.0.0",
"description": "快捷打开 files.fm 以支持传输文件", "description": "在聊天输入框快捷打开 files.fm 以支持传输文件",
"private": true, "private": true,
"scripts": { "scripts": {
"sync:declaration": "tailchat declaration github" "sync:declaration": "tailchat declaration github"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,10 @@
{
"label": "wenshushu",
"name": "com.msgbyte.wenshushu",
"url": "/plugins/com.msgbyte.wenshushu/index.js",
"icon": "/plugins/com.msgbyte.wenshushu/assets/icon.png",
"version": "0.0.0",
"author": "moonrailgun",
"description": "在聊天输入框快捷打开 文叔叔 以支持传输文件",
"requireRestart": true
}

@ -0,0 +1,14 @@
{
"name": "@plugins/com.msgbyte.wenshushu",
"main": "src/index.tsx",
"version": "0.0.0",
"description": "在聊天输入框快捷打开 文叔叔 以支持传输文件",
"private": true,
"scripts": {
"sync:declaration": "tailchat declaration github"
},
"dependencies": {},
"devDependencies": {
"react": "18.2.0"
}
}

@ -0,0 +1,35 @@
import { regChatInputAction } from '@capital/common';
regChatInputAction({
label: '文叔叔',
onClick: () => {
const width = 1230; // 不支持手机UA
const height = 736;
const top = (window.screen.height - height) / 2;
const left = (window.screen.width - width) / 2;
window.open(
'https://www.wenshushu.cn/',
'文叔叔',
buildWindowFeatures({
top,
left,
width,
height,
menubar: false,
toolbar: false,
location: false,
status: false,
resizable: true,
})
);
},
});
function buildWindowFeatures(
options: Record<string, string | number | boolean>
): string {
return Object.entries(options)
.map(([key, val]) => `${key}=${val}`)
.join(',');
}

@ -0,0 +1,7 @@
{
"compilerOptions": {
"esModuleInterop": true,
"jsx": "react",
"importsNotUsedAsValues": "error"
}
}

@ -0,0 +1,326 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/// <reference types="react" />
/**
* Tailchat
*
* : pnpm run plugins:declaration:generate
*/
/**
* Tailchat
*/
declare module '@capital/common' {
export const useGroupPanelParams: any;
/**
*
*/
export const openModal: (
content: React.ReactNode,
props?: {
/**
*
* @default false
*/
closable?: boolean;
/**
*
*/
maskClosable?: boolean;
/**
* modal
*/
onCloseModal?: () => void;
}
) => number;
export const closeModal: any;
export const ModalWrapper: any;
export const useModalContext: any;
export const openConfirmModal: any;
export const openReconfirmModal: any;
export const Loadable: any;
export const getGlobalState: any;
export const getJWTUserInfo: () => Promise<{
_id?: string;
nickname?: string;
email?: string;
avatar?: string;
}>;
export const dataUrlToFile: any;
export const urlSearchStringify: any;
export const urlSearchParse: any;
export const appendUrlSearch: any;
export const getServiceWorkerRegistration: any;
export const getServiceUrl: () => string;
export const getCachedUserInfo: (
userId: string,
refetch?: boolean
) => Promise<{
_id: string;
email: string;
nickname: string;
discriminator: string;
avatar: string | null;
temporary: boolean;
}>;
export const getCachedConverseInfo: any;
/**
*
* @example
* localTrans({'zh-CN': '你好', 'en-US': 'Hello'});
*
* @param trans
*/
export const localTrans: (trans: Record<'zh-CN' | 'en-US', string>) => string;
export const getLanguage: any;
export const sharedEvent: any;
export const useAsync: any;
export const useAsyncFn: any;
export const useAsyncRefresh: any;
export const useAsyncRequest: any;
export const uploadFile: any;
export const showToasts: any;
export const showErrorToasts: any;
export const fetchAvailableServices: any;
export const isValidStr: any;
export const useGroupPanelInfo: any;
export const sendMessage: any;
export const useLocation: any;
export const useNavigate: any;
export const createFastFormSchema: any;
export const fieldSchema: any;
export const useCurrentUserInfo: any;
export const createPluginRequest: (pluginName: string) => {
get: (actionName: string, config?: any) => Promise<any>;
post: (actionName: string, data?: any, config?: any) => Promise<any>;
};
export const postRequest: any;
export const pluginCustomPanel: any;
export const regCustomPanel: any;
export const pluginGroupPanel: any;
export const regGroupPanel: any;
export const messageInterpreter: any;
export const regMessageInterpreter: any;
export const getMessageRender: any;
export const regMessageRender: any;
export const getMessageTextDecorators: any;
export const regMessageTextDecorators: any;
export const ChatInputActionContextProps: any;
export const pluginChatInputActions: any;
export const regChatInputAction: any;
export const regSocketEventListener: (item: {
eventName: string;
eventFn: (...args: any[]) => void;
}) => void;
export const pluginColorScheme: any;
export const regPluginColorScheme: any;
export const pluginInspectServices: any;
export const regInspectService: any;
export const pluginMessageExtraParsers: any;
export const regMessageExtraParser: any;
export const pluginRootRoute: any;
export const regPluginRootRoute: any;
export const pluginPanelActions: any;
export const regPluginPanelAction: any;
export const pluginPermission: any;
export const regPluginPermission: (permission: {
/**
* key,
* , : plugin.com.msgbyte.github.manage
*/
key: string;
/**
*
*/
title: string;
/**
*
*/
desc: string;
/**
*
*/
default: boolean;
/**
*
*/
required?: string[];
}) => void;
export const useGroupIdContext: () => string;
export const useGroupPanelContext: () => {
groupId: string;
panelId: string;
} | null;
export const useSocketContext: any;
}
/**
* Tailchat
*/
declare module '@capital/component' {
export const Button: any;
export const Checkbox: any;
export const Input: any;
export const Divider: any;
export const Space: any;
export const Menu: any;
export const Table: any;
export const Switch: any;
export const Tooltip: any;
/**
* @link https://ant.design/components/notification-cn/
*/
export const notification: any;
export const Empty: any;
export const Avatar: any;
export const SensitiveText: React.FC<{ className?: string; text: string }>;
export const TextArea: any;
export const Image: any;
export const Icon: React.FC<{ icon: string } & React.SVGProps<SVGSVGElement>>;
export const IconBtn: React.FC<{
icon: string;
iconClassName?: string;
shape?: 'circle' | 'square';
title?: string;
}>;
export const PillTabs: any;
export const PillTabPane: any;
export const LoadingSpinner: any;
export const WebFastForm: any;
export const WebMetaForm: any;
export const createMetaFormSchema: any;
export const metaFormFieldSchema: any;
export const FullModalField: any;
export const DefaultFullModalInputEditorRender: any;
export const DefaultFullModalTextAreaEditorRender: any;
export const openModal: any;
export const closeModal: any;
export const ModalWrapper: any;
export const useModalContext: any;
export const openConfirmModal: any;
export const openReconfirmModal: any;
export const Loading: any;
export const SidebarView: any;
export const GroupPanelSelector: any;
export const Emoji: any;
export const PortalAdd: any;
export const PortalRemove: any;
export const ErrorBoundary: any;
export const UserName: React.FC<{
userId: string;
className?: string;
}>;
export const Markdown: any;
}

@ -76,6 +76,25 @@
"description": "快捷打开 files.fm 以支持传输文件", "description": "快捷打开 files.fm 以支持传输文件",
"requireRestart": true "requireRestart": true
}, },
{
"label": "wenshushu",
"name": "com.msgbyte.wenshushu",
"url": "/plugins/com.msgbyte.wenshushu/index.js",
"icon": "/plugins/com.msgbyte.wenshushu/assets/icon.png",
"version": "0.0.0",
"author": "moonrailgun",
"description": "在聊天输入框快捷打开 文叔叔 以支持传输文件",
"requireRestart": true
},
{
"label": "filesend",
"name": "com.msgbyte.filesend",
"url": "/plugins/com.msgbyte.filesend/index.js",
"version": "0.0.0",
"author": "moonrailgun",
"description": "在聊天输入框快捷打开 Filesend 以支持传输文件",
"requireRestart": true
},
{ {
"label": "用户地理位置", "label": "用户地理位置",
"name": "com.msgbyte.user.location", "name": "com.msgbyte.user.location",

Loading…
Cancel
Save