bilitoolkit-ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +3 -0
- package/dist/api/toolkit-api.d.ts +2 -0
- package/dist/bilitoolkit-ui.css +6 -0
- package/dist/bilitoolkit-ui.js +117707 -0
- package/dist/bilitoolkit-ui.umd.cjs +85 -0
- package/dist/common/ui-constants.d.ts +9 -0
- package/dist/components/bili/BiliAccountCard.vue.d.ts +18 -0
- package/dist/components/bili/types.d.ts +7 -0
- package/dist/components/common/AppIcon.vue.d.ts +9 -0
- package/dist/components/common/AppTooltip.vue.d.ts +25 -0
- package/dist/components/common/ExternalLink.vue.d.ts +20 -0
- package/dist/components/common/IconButton.vue.d.ts +27 -0
- package/dist/components/common/IconLabel.vue.d.ts +20 -0
- package/dist/components/common/LogPrint.vue.d.ts +5 -0
- package/dist/components/dialog/countdown/CountdownDialog.vue.d.ts +22 -0
- package/dist/components/dialog/countdown/types.d.ts +11 -0
- package/dist/components/dialog/countdown/useCountdown.d.ts +9 -0
- package/dist/components/dialog/loading/LoadingDialog.vue.d.ts +16 -0
- package/dist/components/dialog/loading/loadingService.d.ts +12 -0
- package/dist/components/dialog/loading/types.d.ts +21 -0
- package/dist/components/plugin/PluginMenuItem.vue.d.ts +3 -0
- package/dist/components/plugin/PluginMenus.vue.d.ts +25 -0
- package/dist/components/plugin/PluginPageContent.vue.d.ts +17 -0
- package/dist/components/plugin/PluginPageHeader.vue.d.ts +7 -0
- package/dist/components/plugin/types.d.ts +12 -0
- package/dist/components/settings/SettingGroup.vue.d.ts +20 -0
- package/dist/components/settings/SettingItem.vue.d.ts +22 -0
- package/dist/composables/useLoadingData.d.ts +4 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.d.ts +28 -0
- package/dist/main.d.ts +0 -0
- package/dist/stores/app-theme.d.ts +31 -0
- package/dist/stores/selected-account.d.ts +26 -0
- package/dist/stores/test-data.d.ts +70 -0
- package/dist/styles/functions.scss +4 -0
- package/dist/styles/mixins.scss +146 -0
- package/dist/styles/variables.scss +1 -0
- package/dist/test/menus.d.ts +2 -0
- package/dist/test/user.d.ts +12 -0
- package/dist/ui.d.ts +10 -0
- package/dist/utils/app-utils.d.ts +20 -0
- package/dist/utils/theme-utils.d.ts +10 -0
- package/dist/views/HomeView.vue.d.ts +2 -0
- package/package.json +94 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
省略左边内容
|
|
3
|
+
注意,内容前后需要加上【‎】(左至右符号)
|
|
4
|
+
https://stackoverflow.com/questions/27957443/strange-special-characters-issue-in-left-side-ellipsis
|
|
5
|
+
*/
|
|
6
|
+
@mixin txt-reverse-ellipsis {
|
|
7
|
+
background: var(--app-color-foreground-transparent-10);
|
|
8
|
+
width: fit-content;
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
text-overflow: ellipsis;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
direction: rtl; //定义方向
|
|
14
|
+
text-align: left; // 防止父元素宽度足够的时候文字靠右右边
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* 省略右边内容 */
|
|
18
|
+
@mixin txt-ellipsis {
|
|
19
|
+
width: fit-content;
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
direction: ltr; //定义方向
|
|
25
|
+
text-align: left; // 防止父元素宽度足够的时候文字靠右右边
|
|
26
|
+
unicode-bidi: plaintext; // 防止尾部特殊字符显示在前面
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** 伪元素实现的svg背景 */
|
|
30
|
+
@mixin pseudo-svg-icon($svg,$bg-color,$padding:4px) {
|
|
31
|
+
&:before {
|
|
32
|
+
content: '';
|
|
33
|
+
position: absolute;
|
|
34
|
+
left: $padding;
|
|
35
|
+
top: $padding;
|
|
36
|
+
right: $padding;
|
|
37
|
+
bottom: $padding;
|
|
38
|
+
mask: $svg no-repeat center / contain;
|
|
39
|
+
-webkit-mask: $svg no-repeat center / contain;
|
|
40
|
+
background: $bg-color;
|
|
41
|
+
z-index: 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/*科技风格的背景*/
|
|
46
|
+
@mixin tech-angled-bg(
|
|
47
|
+
$left-bg: var(--app-color-primary-transparent-5),
|
|
48
|
+
$right-bg: var(--app-color-primary-transparent-5),
|
|
49
|
+
$top-x: 90%,
|
|
50
|
+
$bottom-x: 50%) {
|
|
51
|
+
position: relative;
|
|
52
|
+
overflow: hidden !important;
|
|
53
|
+
background: $left-bg;
|
|
54
|
+
|
|
55
|
+
&:before {
|
|
56
|
+
content: '';
|
|
57
|
+
position: absolute;
|
|
58
|
+
right: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
width: 200%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
background: $left-bg;
|
|
63
|
+
clip-path: polygon(calc($top-x / 2) 0, 100% 0, 100% 100%, calc($bottom-x / 2) 100%);
|
|
64
|
+
transition: transform 0.3s ease;
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
transform: translateX(50%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/*科技风格的卡片*/
|
|
72
|
+
@mixin card-tech-style(
|
|
73
|
+
$init-bg: var(--app-color-primary-transparent-5),
|
|
74
|
+
$border-color: var(--app-color-primary-transparent-20),
|
|
75
|
+
$shadow: var(--app-color-primary-transparent-15),
|
|
76
|
+
$hover-extend-bg: var(--app-color-primary-transparent-2)) {
|
|
77
|
+
background: $hover-extend-bg;
|
|
78
|
+
border-radius: 10px;
|
|
79
|
+
border: 1px solid $border-color;
|
|
80
|
+
position: relative;
|
|
81
|
+
overflow: hidden !important;
|
|
82
|
+
|
|
83
|
+
&:before {
|
|
84
|
+
content: '';
|
|
85
|
+
position: absolute;
|
|
86
|
+
right: 0;
|
|
87
|
+
bottom: 0;
|
|
88
|
+
width: 200%;
|
|
89
|
+
height: 100%;
|
|
90
|
+
background: $init-bg;
|
|
91
|
+
clip-path: polygon(45% 0, 100% 0, 100% 100%, 25% 100%);
|
|
92
|
+
transition: transform 0.3s ease;
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
box-shadow: 0 2px 6px $shadow;
|
|
98
|
+
|
|
99
|
+
&:before {
|
|
100
|
+
transform: translateX(50%);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@mixin card-tech-style--static(
|
|
106
|
+
$bg: var(--app-color-primary-transparent-5),
|
|
107
|
+
$border-color: var(--app-color-primary-transparent-20),
|
|
108
|
+
$shadow: var(--app-color-primary-transparent-15)
|
|
109
|
+
) {
|
|
110
|
+
background: $bg;
|
|
111
|
+
border-radius: 10px;
|
|
112
|
+
border: 1px solid $border-color;
|
|
113
|
+
|
|
114
|
+
&:hover {
|
|
115
|
+
box-shadow: 0 2px 6px $shadow;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* 图标按钮 */
|
|
120
|
+
@mixin icon-btn($size:18px,$color:var(--el-color-primary)) {
|
|
121
|
+
width: $size;
|
|
122
|
+
height: $size;
|
|
123
|
+
font-size: $size;
|
|
124
|
+
line-height: $size;
|
|
125
|
+
color: $color;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
padding: 5px;
|
|
128
|
+
|
|
129
|
+
&:hover {
|
|
130
|
+
background: var(--app-color-primary-transparent-15);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* 圆形图标按钮 */
|
|
135
|
+
@mixin circle-icon-btn($size:18px,$color:var(--el-color-primary)) {
|
|
136
|
+
@include icon-btn($size, $color);
|
|
137
|
+
border-radius: 50%;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* 旋转的圆形图标按钮 */
|
|
141
|
+
@mixin circle-icon-btn--rotate($size:18px,$color:var(--el-color-primary)) {
|
|
142
|
+
@include circle-icon-btn($size, $color);
|
|
143
|
+
&:hover {
|
|
144
|
+
animation: rotate 3s linear infinite;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$test: 2px;
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { Pinia } from 'pinia';
|
|
3
|
+
/**
|
|
4
|
+
* 初始化UI
|
|
5
|
+
* @param pinia
|
|
6
|
+
* @param isTestMode 测试模式,不使用工具姬的API。方便插件直接本地调试。
|
|
7
|
+
*/
|
|
8
|
+
export declare const initBilitoolkitUi: (pinia: Pinia, isTestMode?: boolean) => Promise<{
|
|
9
|
+
install(app: App): void;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ElMessageBoxOptions } from 'element-plus';
|
|
2
|
+
/**
|
|
3
|
+
* App工具,包含一些全局的方法
|
|
4
|
+
*/
|
|
5
|
+
export declare class AppUtils {
|
|
6
|
+
/**
|
|
7
|
+
* 统一处理异常
|
|
8
|
+
* @param error
|
|
9
|
+
*/
|
|
10
|
+
static handleError(error: unknown): void;
|
|
11
|
+
static message(message: string): void;
|
|
12
|
+
static message({ message, type, duration, }: {
|
|
13
|
+
message: string;
|
|
14
|
+
type?: 'success' | 'warning' | 'info' | 'error';
|
|
15
|
+
duration?: number;
|
|
16
|
+
}): void;
|
|
17
|
+
static error(msg: string): void;
|
|
18
|
+
static warning(msg: string): void;
|
|
19
|
+
static confirm(message: string, title?: string, options?: ElMessageBoxOptions): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppThemeMode, AppThemeState } from 'bilitoolkit-api-types';
|
|
2
|
+
export type AppThemeCssVars = Record<string, string>;
|
|
3
|
+
export declare class ThemeUtils {
|
|
4
|
+
static isDark(themeMode?: AppThemeMode): Promise<boolean>;
|
|
5
|
+
/**
|
|
6
|
+
* 更新css变量
|
|
7
|
+
*/
|
|
8
|
+
static updateAppTheme(initState?: AppThemeState): Promise<void>;
|
|
9
|
+
static initAppTheme(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
package/package.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bilitoolkit-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"productName": "bilitoolkit-ui",
|
|
7
|
+
"description": "「哔哩工具姬」的 UI 库",
|
|
8
|
+
"author": "hzhilong",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"BiliToolkit",
|
|
11
|
+
"哔哩工具姬"
|
|
12
|
+
],
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/hzhilong/bilitoolkit-ui"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/hzhilong/bilitoolkit-ui/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/hzhilong/bilitoolkit-ui#readme",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
24
|
+
},
|
|
25
|
+
"main": "dist/bilitoolkit-ui.umd.cjs",
|
|
26
|
+
"module": "dist/bilitoolkit-ui.js",
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
28
|
+
"style": "dist/bilitoolkit-ui.css",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/bilitoolkit-ui.js",
|
|
33
|
+
"require": "./dist/bilitoolkit-ui.umd.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./style.css": "./dist/bilitoolkit-ui.css",
|
|
36
|
+
"./variables.scss": "./dist/styles/variables.scss",
|
|
37
|
+
"./mixins.scss": "./dist/styles/mixins.scss",
|
|
38
|
+
"./functions.scss": "./dist/styles/functions.scss"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"!dist/bundle-stats.*"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"dev": "chcp 65001 && vite",
|
|
46
|
+
"类型检查": "tsc --noEmit",
|
|
47
|
+
"构建前记得补全桶": "构建前记得补全桶",
|
|
48
|
+
"build": "vite build --mode library",
|
|
49
|
+
"npm 登录": " npm login",
|
|
50
|
+
"npm 发布": " npm publish --access public",
|
|
51
|
+
"本地构建并发布": "vite build --mode library && yalc publish",
|
|
52
|
+
"添加本地依赖包": "yalc add bilitoolkit-api-types @ybgnb/utils --peer",
|
|
53
|
+
"移除本地依赖包": "yalc remove --all",
|
|
54
|
+
"type-check": "vue-tsc --build",
|
|
55
|
+
"lint": "eslint . --fix"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@tsconfig/node22": "^22.0.2",
|
|
59
|
+
"@types/node": "^22.16.5",
|
|
60
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
61
|
+
"@vitejs/plugin-vue-jsx": "^5.0.1",
|
|
62
|
+
"@vue/eslint-config-prettier": "^10.2.0",
|
|
63
|
+
"@vue/eslint-config-typescript": "^14.6.0",
|
|
64
|
+
"@vue/language-core": "^3.0.7",
|
|
65
|
+
"@vue/tsconfig": "^0.7.0",
|
|
66
|
+
"eslint": "^9.31.0",
|
|
67
|
+
"eslint-plugin-vue": "~10.3.0",
|
|
68
|
+
"jiti": "^2.4.2",
|
|
69
|
+
"npm-run-all2": "^8.0.4",
|
|
70
|
+
"prettier": "3.6.2",
|
|
71
|
+
"rollup-plugin-bundle-stats": "^4.21.3",
|
|
72
|
+
"sass": "^1.92.1",
|
|
73
|
+
"typescript": "~5.8.0",
|
|
74
|
+
"unplugin-auto-import": "^20.1.0",
|
|
75
|
+
"unplugin-vue-components": "^29.0.0",
|
|
76
|
+
"vite": "^7.0.6",
|
|
77
|
+
"vite-plugin-dts": "^4.5.4",
|
|
78
|
+
"vite-plugin-static-copy": "^3.1.2",
|
|
79
|
+
"vue-tsc": "^3.0.4"
|
|
80
|
+
},
|
|
81
|
+
"peerDependencies": {
|
|
82
|
+
"@vue/language-core": "^3.0.7",
|
|
83
|
+
"@ybgnb/utils": "file:.yalc/@ybgnb/utils",
|
|
84
|
+
"bilitoolkit-api-types": "file:.yalc/bilitoolkit-api-types",
|
|
85
|
+
"element-plus": "^2.11.2",
|
|
86
|
+
"lodash-es": "^4.17.21",
|
|
87
|
+
"pinia": "^3.0.3",
|
|
88
|
+
"vue": "^3.5.18"
|
|
89
|
+
},
|
|
90
|
+
"dependencies": {
|
|
91
|
+
"@ybgnb/utils": "file:.yalc/@ybgnb/utils",
|
|
92
|
+
"bilitoolkit-api-types": "file:.yalc/bilitoolkit-api-types"
|
|
93
|
+
}
|
|
94
|
+
}
|