Compare commits
3 Commits
f13623f4fc
...
d6f1cae7b7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6f1cae7b7 | ||
|
|
0754b4128f | ||
|
|
1cb8ac3fff |
@@ -1,15 +1,3 @@
|
||||
type ApiCallbackMessage = {
|
||||
msg: string,
|
||||
/**
|
||||
* 200: 成功
|
||||
* 400: 伺服器端無法理解客戶端請求
|
||||
* 401: 需要身份驗證
|
||||
* 403: 伺服器端拒絕執行客戶端請求
|
||||
* 404: Not Found
|
||||
* 500: 伺服器端錯誤
|
||||
* 501: 伺服器端不支持請求的功能
|
||||
*/
|
||||
code: 200 | 400 | 401 | 403 | 404 | 500 | 501 | -1,
|
||||
data?: { [key: string]: unknown },
|
||||
}
|
||||
export default ApiCallbackMessage
|
||||
import { ApiCallbackMessage } from 'lingchair-internal-shared'
|
||||
|
||||
export type { ApiCallbackMessage as default }
|
||||
|
||||
@@ -1,62 +1 @@
|
||||
export type CallMethod =
|
||||
// 用户验证
|
||||
"User.auth" |
|
||||
"User.register" |
|
||||
"User.login" |
|
||||
"User.refreshAccessToken" |
|
||||
|
||||
// 账号
|
||||
"User.setAvatar" |
|
||||
"User.updateProfile" |
|
||||
"User.getMyInfo" |
|
||||
"User.resetPassword" |
|
||||
|
||||
// 用户资料
|
||||
"User.getInfo" |
|
||||
|
||||
// 收藏对话列表
|
||||
"User.getMyContacts" |
|
||||
"User.addContacts" |
|
||||
"User.removeContacts" |
|
||||
|
||||
// 最近对话列表
|
||||
"User.getMyRecentChats" |
|
||||
|
||||
// 所有对话列表
|
||||
"User.getMyAllChats" |
|
||||
|
||||
// 对话信息
|
||||
"Chat.getInfo" |
|
||||
"Chat.getAnotherUserIdFromPrivate" |
|
||||
"Chat.getMembers" |
|
||||
|
||||
// 对话设置
|
||||
"Chat.updateSettings" |
|
||||
"Chat.setAvatar" |
|
||||
|
||||
// 对话创建
|
||||
"Chat.createGroup" |
|
||||
"Chat.getIdForPrivate" |
|
||||
|
||||
// 入群请求
|
||||
"Chat.processJoinRequest" |
|
||||
"Chat.sendJoinRequest" |
|
||||
"Chat.getJoinRequests" |
|
||||
|
||||
// 对话消息
|
||||
"Chat.sendMessage" |
|
||||
"Chat.getMessageHistory"
|
||||
|
||||
// (废弃) 文件上传
|
||||
// "Chat.uploadFile"
|
||||
|
||||
export type ClientEvent =
|
||||
// 对话收消息
|
||||
"Client.onMessage"
|
||||
|
||||
export const CallableMethodBeforeAuth = [
|
||||
"User.auth",
|
||||
"User.register",
|
||||
"User.login",
|
||||
"User.refreshAccessToken",
|
||||
]
|
||||
export * from 'lingchair-internal-shared'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"imports": {
|
||||
"socket.io-client": "npm:socket.io-client@4.8.1"
|
||||
"socket.io-client": "npm:socket.io-client@4.8.1",
|
||||
"lingchair-internal-shared": "../internal-shared/mod.ts"
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,3 @@
|
||||
type ApiCallbackMessage = {
|
||||
msg: string,
|
||||
/**
|
||||
* 200: 成功
|
||||
* 400: 伺服器端無法理解客戶端請求
|
||||
* 401: 需要身份驗證
|
||||
* 403: 伺服器端拒絕執行客戶端請求
|
||||
* 404: Not Found
|
||||
* 500: 伺服器端錯誤
|
||||
* 501: 伺服器端不支持請求的功能
|
||||
*/
|
||||
code: 200 | 400 | 401 | 403 | 404 | 500 | 501 | -1,
|
||||
data?: { [key: string]: unknown },
|
||||
}
|
||||
export default ApiCallbackMessage
|
||||
import { ApiCallbackMessage } from 'lingchair-internal-shared'
|
||||
|
||||
export type { ApiCallbackMessage as default }
|
||||
|
||||
@@ -1,62 +1 @@
|
||||
export type CallMethod =
|
||||
// 用户验证
|
||||
"User.auth" |
|
||||
"User.register" |
|
||||
"User.login" |
|
||||
"User.refreshAccessToken" |
|
||||
|
||||
// 账号
|
||||
"User.setAvatar" |
|
||||
"User.updateProfile" |
|
||||
"User.getMyInfo" |
|
||||
"User.resetPassword" |
|
||||
|
||||
// 用户资料
|
||||
"User.getInfo" |
|
||||
|
||||
// 收藏对话列表
|
||||
"User.getMyContacts" |
|
||||
"User.addContacts" |
|
||||
"User.removeContacts" |
|
||||
|
||||
// 最近对话列表
|
||||
"User.getMyRecentChats" |
|
||||
|
||||
// 所有对话列表
|
||||
"User.getMyAllChats" |
|
||||
|
||||
// 对话信息
|
||||
"Chat.getInfo" |
|
||||
"Chat.getAnotherUserIdFromPrivate" |
|
||||
"Chat.getMembers" |
|
||||
|
||||
// 对话设置
|
||||
"Chat.updateSettings" |
|
||||
"Chat.setAvatar" |
|
||||
|
||||
// 对话创建
|
||||
"Chat.createGroup" |
|
||||
"Chat.getIdForPrivate" |
|
||||
|
||||
// 入群请求
|
||||
"Chat.processJoinRequest" |
|
||||
"Chat.sendJoinRequest" |
|
||||
"Chat.getJoinRequests" |
|
||||
|
||||
// 对话消息
|
||||
"Chat.sendMessage" |
|
||||
"Chat.getMessageHistory"
|
||||
|
||||
// (废弃) 文件上传
|
||||
// "Chat.uploadFile"
|
||||
|
||||
export type ClientEvent =
|
||||
// 对话收消息
|
||||
"Client.onMessage"
|
||||
|
||||
export const CallableMethodBeforeAuth = [
|
||||
"User.auth",
|
||||
"User.register",
|
||||
"User.login",
|
||||
"User.refreshAccessToken",
|
||||
]
|
||||
export * from 'lingchair-internal-shared'
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
"jsxImportSource": "react",
|
||||
"jsxImportSourceTypes": "@types/react"
|
||||
},
|
||||
"links": [
|
||||
"./mdui_patched",
|
||||
],
|
||||
"nodeModulesDir": "auto",
|
||||
"links": [
|
||||
"../mdui_patched"
|
||||
],
|
||||
"imports": {
|
||||
"@deno/vite-plugin": "npm:@deno/vite-plugin@1.0.5",
|
||||
"@types/react": "npm:@types/react@18.3.1",
|
||||
@@ -34,6 +34,8 @@
|
||||
"socket.io-client": "npm:socket.io-client@4.8.1",
|
||||
"marked": "npm:marked@16.3.0",
|
||||
"dompurify": "npm:dompurify@3.2.7",
|
||||
"pinch-zoom-element": "npm:pinch-zoom-element@1.1.1"
|
||||
"pinch-zoom-element": "npm:pinch-zoom-element@1.1.1",
|
||||
|
||||
"lingchair-internal-shared": "../internal-shared/mod.ts"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"express": "npm:express@5.1.0",
|
||||
"socket.io": "npm:socket.io@4.8.1",
|
||||
"cookie-parser": "npm:cookie-parser@1.4.7",
|
||||
"express-fileupload": "npm:express-fileupload@1.5.2"
|
||||
"express-fileupload": "npm:express-fileupload@1.5.2",
|
||||
"lingchair-internal-shared": "./internal-shared/mod.ts"
|
||||
}
|
||||
}
|
||||
16
internal-shared/ApiCallbackMessage.ts
Normal file
16
internal-shared/ApiCallbackMessage.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
type ApiCallbackMessage = {
|
||||
msg: string,
|
||||
/**
|
||||
* 200: 成功
|
||||
* 400: 伺服器端無法理解客戶端請求
|
||||
* 401: 需要身份驗證
|
||||
* 403: 伺服器端拒絕執行客戶端請求
|
||||
* 404: Not Found
|
||||
* 500: 伺服器端錯誤
|
||||
* 501: 伺服器端不支持請求的功能
|
||||
* -1: 请求错误
|
||||
*/
|
||||
code: 200 | 400 | 401 | 403 | 404 | 500 | 501 | -1,
|
||||
data?: { [key: string]: unknown },
|
||||
}
|
||||
export default ApiCallbackMessage
|
||||
63
internal-shared/ApiDeclare.ts
Normal file
63
internal-shared/ApiDeclare.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
export type CallMethod =
|
||||
// 用户验证
|
||||
"User.auth" |
|
||||
"User.register" |
|
||||
"User.login" |
|
||||
"User.refreshAccessToken" |
|
||||
|
||||
// 账号
|
||||
"User.setAvatar" |
|
||||
"User.updateProfile" |
|
||||
"User.getMyInfo" |
|
||||
"User.resetPassword" |
|
||||
|
||||
// 用户资料
|
||||
"User.getInfo" |
|
||||
|
||||
// 收藏对话列表
|
||||
"User.getMyContacts" |
|
||||
"User.addContacts" |
|
||||
"User.removeContacts" |
|
||||
|
||||
// 最近对话列表
|
||||
"User.getMyRecentChats" |
|
||||
|
||||
// 对话信息
|
||||
"Chat.getInfo" |
|
||||
"Chat.getAnotherUserIdFromPrivate" |
|
||||
"Chat.getMembers" |
|
||||
|
||||
// 对话设置
|
||||
"Chat.updateSettings" |
|
||||
"Chat.setAvatar" |
|
||||
|
||||
// 对话创建
|
||||
"Chat.createGroup" |
|
||||
"Chat.getIdForPrivate" |
|
||||
|
||||
// 入群请求
|
||||
"Chat.processJoinRequest" |
|
||||
"Chat.sendJoinRequest" |
|
||||
"Chat.getJoinRequests" |
|
||||
|
||||
// 对话成员
|
||||
"Chat.removeMembers" |
|
||||
"Chat.quit" |
|
||||
|
||||
// 对话消息
|
||||
"Chat.sendMessage" |
|
||||
"Chat.getMessageHistory"
|
||||
|
||||
// (废弃) 文件上传
|
||||
// "Chat.uploadFile"
|
||||
|
||||
export type ClientEvent =
|
||||
// 对话收消息
|
||||
"Client.onMessage"
|
||||
|
||||
export const CallableMethodBeforeAuth = [
|
||||
"User.auth",
|
||||
"User.register",
|
||||
"User.login",
|
||||
"User.refreshAccessToken",
|
||||
]
|
||||
4
internal-shared/mod.ts
Normal file
4
internal-shared/mod.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './ApiDeclare.ts'
|
||||
|
||||
import ApiCallbackMessage from './ApiCallbackMessage.ts'
|
||||
export type { ApiCallbackMessage }
|
||||
@@ -1,49 +1,49 @@
|
||||
# mdui
|
||||
|
||||
[](https://badge.fury.io/gh/zdhxiong%2Fmdui)
|
||||
[](https://www.npmjs.com/package/mdui)
|
||||
[](https://cdnjs.com/libraries/mdui)
|
||||
|
||||
[官网](https://www.mdui.org) | [文档](https://www.mdui.org/docs/2/)
|
||||
|
||||
使用 Web Components 实现,遵循 Material You 设计规范的 Web 前端组件库。
|
||||
|
||||
* **Web Components**:mdui 组件全部使用 Web Components 开发,使用组件就像使用 `<div>` 标签一样简单。
|
||||
* **Material You**:遵循最新的 Material Design 3(Material You)设计规范,使你的产品美观、易用。
|
||||
* **动态配色**:支持根据给定颜色值,或给定一张图片,mdui 能自动计算出颜色值,生成整套配色方案,并在所有 mdui 组件中生效。
|
||||
* **暗色模式**:所有组件都支持暗色模式、及支持根据操作系统设置自动切换亮色模式和暗色模式。
|
||||
* **轻量级**:gzip 后的 CSS + JavaScript 仅 85KB,使用按需导入可进一步减小体积,使加载更迅速。
|
||||
* **IDE 支持**:在 VSCode 和 WebStorm 中能获得完美的代码提示。且提供了 VSCode 扩展和 WebStorm 插件,使开发更便捷。
|
||||
* **兼容所有框架**:mdui 能兼容 Vue、React、Angular 等框架,只要在浏览器上运行的应用,都能使用 mdui。
|
||||
* **TypeScript 支持**:mdui 完全使用 TypeScript 开发,拥有完美的类型提示。
|
||||
* **无依赖**:不需要依赖任何第三方库,节约网络流量,使加载更迅速。
|
||||
* **组件丰富**:mdui 包含 30 多个组件,及十余个工具函数,常用组件都有。
|
||||
* **Material Icons 图标库**:提供了超过 1 万个图标组件,可按需导入所需图标。
|
||||
* **低学习成本**:只需懂一点 HTML、CSS、JavaScript 的基础知识,就能使用 mdui。
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
npm install mdui --save
|
||||
```
|
||||
|
||||
### 导入 CSS 及 JS 文件
|
||||
|
||||
```js
|
||||
import 'mdui/mdui.css';
|
||||
import 'mdui';
|
||||
```
|
||||
|
||||
### 使用组件
|
||||
|
||||
```html
|
||||
<mdui-button>Button</mdui-button>
|
||||
```
|
||||
|
||||
## 赞助
|
||||
|
||||
赞助以帮助 mdui 持续更新
|
||||
|
||||

|
||||

|
||||
[](https://www.paypal.me/zdhxiong/5)
|
||||
# mdui
|
||||
|
||||
[](https://badge.fury.io/gh/zdhxiong%2Fmdui)
|
||||
[](https://www.npmjs.com/package/mdui)
|
||||
[](https://cdnjs.com/libraries/mdui)
|
||||
|
||||
[官网](https://www.mdui.org) | [文档](https://www.mdui.org/docs/2/)
|
||||
|
||||
使用 Web Components 实现,遵循 Material You 设计规范的 Web 前端组件库。
|
||||
|
||||
* **Web Components**:mdui 组件全部使用 Web Components 开发,使用组件就像使用 `<div>` 标签一样简单。
|
||||
* **Material You**:遵循最新的 Material Design 3(Material You)设计规范,使你的产品美观、易用。
|
||||
* **动态配色**:支持根据给定颜色值,或给定一张图片,mdui 能自动计算出颜色值,生成整套配色方案,并在所有 mdui 组件中生效。
|
||||
* **暗色模式**:所有组件都支持暗色模式、及支持根据操作系统设置自动切换亮色模式和暗色模式。
|
||||
* **轻量级**:gzip 后的 CSS + JavaScript 仅 85KB,使用按需导入可进一步减小体积,使加载更迅速。
|
||||
* **IDE 支持**:在 VSCode 和 WebStorm 中能获得完美的代码提示。且提供了 VSCode 扩展和 WebStorm 插件,使开发更便捷。
|
||||
* **兼容所有框架**:mdui 能兼容 Vue、React、Angular 等框架,只要在浏览器上运行的应用,都能使用 mdui。
|
||||
* **TypeScript 支持**:mdui 完全使用 TypeScript 开发,拥有完美的类型提示。
|
||||
* **无依赖**:不需要依赖任何第三方库,节约网络流量,使加载更迅速。
|
||||
* **组件丰富**:mdui 包含 30 多个组件,及十余个工具函数,常用组件都有。
|
||||
* **Material Icons 图标库**:提供了超过 1 万个图标组件,可按需导入所需图标。
|
||||
* **低学习成本**:只需懂一点 HTML、CSS、JavaScript 的基础知识,就能使用 mdui。
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
npm install mdui --save
|
||||
```
|
||||
|
||||
### 导入 CSS 及 JS 文件
|
||||
|
||||
```js
|
||||
import 'mdui/mdui.css';
|
||||
import 'mdui';
|
||||
```
|
||||
|
||||
### 使用组件
|
||||
|
||||
```html
|
||||
<mdui-button>Button</mdui-button>
|
||||
```
|
||||
|
||||
## 赞助
|
||||
|
||||
赞助以帮助 mdui 持续更新
|
||||
|
||||

|
||||

|
||||
[](https://www.paypal.me/zdhxiong/5)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user