10 Commits
Author SHA1 Message Date
timi b934f76caa Merge pull request 'v2.0.1' (#7) from dev into master
Reviewed-on: #7
2026-11-26 04:09:32 +00:00
Timi 5c9b7ad620 v2.0.1
Release / release (pull_request) Successful in 35s
2026-11-26 12:09:12 +08:00
Timi 96febc972b style: refine scroll bar and rename class to tui-scroll-bar 2026-11-26 12:08:11 +08:00
timi 286c73d5c8 Merge pull request 'v2.0.0' (#6) from dev into master
Reviewed-on: #6
2026-11-23 12:39:24 +00:00
Timi 98406c655d v2.0.0
Release / release (pull_request) Successful in 34s
2026-11-23 20:39:03 +08:00
timi de8bfbe04a Merge pull request 'v2.0.0' (#5) from dev into master
Reviewed-on: #5
2026-11-23 12:36:15 +00:00
Timi a16e98da64 feat!: publish per-component ESM entries as @timi/web
Release / release (pull_request) Failing after 2s
2026-11-23 20:28:05 +08:00
timi b598967765 Merge pull request 'v1.0.2' (#4) from dev into master
Reviewed-on: #4
2026-11-07 17:48:21 +00:00
Timi 2c99c0dacb v1.0.2
Release / release (pull_request) Successful in 20s
2026-11-08 01:47:48 +08:00
Timi cdd0668390 add: --tui-backdrop-blur 2026-11-08 01:47:31 +08:00
16 changed files with 142 additions and 68 deletions
+2 -2
View File
@@ -75,8 +75,8 @@ jobs:
- name: Ensure version not published
if: ${{ steps.version.outputs.publish == 'true' }}
run: |
if npm view "timi-web@${{ steps.version.outputs.version }}" version > /dev/null 2>&1; then
echo "FAIL: timi-web@${{ steps.version.outputs.version }} 已存在于 nexus,请提升 package.json 版本"
if npm view "@timi/web@${{ steps.version.outputs.version }}" version > /dev/null 2>&1; then
echo "FAIL: @timi/web@${{ steps.version.outputs.version }} 已存在于 nexus,请提升 package.json 版本"
exit 1
fi
echo "OK: 版本未占用"
+5 -5
View File
@@ -1,15 +1,15 @@
# timi-web
# @timi/web
Vue 3 通用组件库与工具库。业务 API、领域类型和用户状态位于 [timi-web-api](https://gitea.imyeyu.com/timi/timi-web-api)。
Vue 3 通用组件库与工具库。业务 API、领域类型和用户状态由应用层自行提供。
## 工具依赖
平台无关的 `Events`、`IOSize`、`MethodLocker`、`Prismjs`、`Text`、`Time`、`Toolkit` 和通用类型统一由 `timi-ts` 提供。`timi-web` 直接依赖并从入口转出这些能力,业务项目只依赖 `timi-web` 时可以间接使用它们;Vue、DOM、浏览器文件和组件安装相关能力仍由 `timi-web` 提供。
平台无关的 `Events`、`IOSize`、`MethodLocker`、`Prismjs`、`Text`、`Time`、`Toolkit` 和通用类型统一由 `@timi/ts` 提供。`@timi/web` 直接依赖并从入口转出这些能力,业务项目只依赖 `@timi/web` 时可以间接使用它们;Vue、DOM、浏览器文件和组件安装相关能力仍由 `@timi/web` 提供。
Web 专属方法使用 `WebToolkit`,通用方法使用 `timi-ts` 导出的 `Toolkit`。
Web 专属方法使用 `WebToolkit`,通用方法使用 `@timi/ts` 导出的 `Toolkit`。
```ts
import { Text, Toolkit } from "timi-web";
import { Text, Toolkit } from "@timi/web";
```
## 文档与演示
@@ -1,5 +1,5 @@
<template>
<div class="tui-demo">
<div class="tui-demo tui-scroll-bar">
<section class="stage">
<slot />
</section>
+30 -12
View File
@@ -1,11 +1,15 @@
{
"name": "timi-web",
"main": "./dist/timi-web.umd.js",
"types": "./dist/src/index.d.ts",
"module": "./dist/timi-web.mjs",
"name": "@timi/web",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"style": "./dist/timi-web.css",
"sideEffects": [
"**/*.css"
],
"private": false,
"version": "1.0.1",
"version": "2.0.1",
"license": "MIT",
"scripts": {
"dev": "pnpm run -C docs dev",
@@ -27,14 +31,28 @@
],
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/timi-web.mjs",
"require": "./dist/timi-web.umd.js"
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./components": {
"types": "./dist/components/index.d.ts",
"import": "./dist/components/index.js"
},
"./components/background-effect/flower-fall": {
"types": "./dist/components/background-effect/flower-fall/index.d.ts",
"import": "./dist/components/background-effect/flower-fall/index.js"
},
"./components/*": {
"types": "./dist/components/*/index.d.ts",
"import": "./dist/components/*/index.js"
},
"./editor": {
"types": "./dist/src/editor/index.d.ts",
"import": "./dist/timi-web.mjs",
"require": "./dist/timi-web.umd.js"
"types": "./dist/editor/index.d.ts",
"import": "./dist/editor/index.js"
},
"./utils": {
"types": "./dist/utils/index.d.ts",
"import": "./dist/utils/index.js"
},
"./style.css": "./dist/timi-web.css",
"./src/*": "./src/*"
@@ -43,7 +61,7 @@
"node": ">=20.0.0"
},
"dependencies": {
"timi-ts": "^1.0.0",
"@timi/ts": "^1.0.0",
"@tiptap/extension-code-block": "^3.22.5",
"@tiptap/extension-color": "^3.22.4",
"@tiptap/extension-image": "^3.22.4",
+10 -9
View File
@@ -11,6 +11,9 @@ importers:
'@marsio/vue-split-pane':
specifier: ^1.0.0
version: 1.0.0(typescript@5.9.3)
'@timi/ts':
specifier: ^1.0.0
version: 1.0.0
'@tiptap/extension-code-block':
specifier: ^3.22.5
version: 3.30.2(@tiptap/core@3.30.2(@tiptap/pm@3.30.2))(@tiptap/pm@3.30.2)
@@ -83,9 +86,6 @@ importers:
terser:
specifier: ^5.44.1
version: 5.44.1
timi-ts:
specifier: ^1.0.0
version: 1.0.0
devDependencies:
'@types/marked':
specifier: ^6.0.0
@@ -776,6 +776,10 @@ packages:
'@standard-schema/spec@1.1.0':
resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==}
'@timi/ts@1.0.0':
resolution: {integrity: sha512-0NFi1+CnonZTcf73IeDdcd5Qoqnt/EdESI448wHfdbd5mk6gRqJNzb82z03SHOCJlIOiLUPvBgctAVLbB58V1A==}
engines: {node: '>=20.0.0'}
'@tiptap/core@3.30.2':
resolution: {integrity: sha512-QbZC/s1OOqcoUdkhIY16TjR/gCtR0qAk9e4bJwUqOJqZuv5ozqCL5hzWm22jjTPp6c6Ei2tPd6t30VwfIKW4lQ==}
peerDependencies:
@@ -1812,6 +1816,7 @@ packages:
image-size@0.5.5:
resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==}
engines: {node: '>=0.10.0'}
deprecated: Please migrate to image-size@2.x
hasBin: true
import-fresh@3.3.0:
@@ -2510,10 +2515,6 @@ packages:
engines: {node: '>=10'}
hasBin: true
timi-ts@1.0.0:
resolution: {integrity: sha512-MR9LJGH4/UEgzzrc1yVdxypTcoQRASt8xns2z5xNyoXr2e0kdXv8sjnuRshp3uZnOCU/pSks1LeLi9OvC2U/7g==}
engines: {node: '>=20.0.0'}
tinybench@2.9.0:
resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}
@@ -3400,6 +3401,8 @@ snapshots:
'@standard-schema/spec@1.1.0': {}
'@timi/ts@1.0.0': {}
'@tiptap/core@3.30.2(@tiptap/pm@3.30.2)':
dependencies:
'@tiptap/pm': 3.30.2
@@ -5211,8 +5214,6 @@ snapshots:
commander: 2.20.3
source-map-support: 0.5.21
timi-ts@1.0.0: {}
tinybench@2.9.0: {}
tinyexec@1.1.1: {}
+25 -15
View File
@@ -1,18 +1,28 @@
@import url(./variable);
.custom-scroll-bar *::-webkit-scrollbar {
width: 10px !important;
height: 10px !important;
background: #CFD2E0;
}
.tui-scroll-bar {
.custom-scroll-bar *::-webkit-scrollbar-corner {
background: #CFD2E0;
}
*::-webkit-scrollbar {
width: 10px !important;
height: 10px !important;
cursor: default;
background: #CFD2E0;
}
.custom-scroll-bar *::-webkit-scrollbar-thumb {
background: #525870;
border-radius: 0 !important;
*::-webkit-scrollbar-corner {
background: #CFD2E0;
}
*::-webkit-scrollbar-thumb {
cursor: default;
background: #525870;
border-radius: 0 !important;
&:hover {
cursor: default;
background: #636981;
}
}
}
*::selection {
@@ -113,16 +123,16 @@ textarea {
.glass-white {
color: var(--eui-black, #000);
background: rgba(255, 255, 255, .6);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
-webkit-backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
}
// 模糊玻璃效果:黑色
.glass-black {
color: var(--eui-white, #FFF);
background: rgba(0, 0, 0, .6);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
-webkit-backdrop-filter: blur(var(--tui-backdrop-blur, 10px));
}
.word-space {
+1
View File
@@ -23,6 +23,7 @@
--tui-shadow: 3px 3px 0 var(--tui-shadow-color);
--tui-bezier: cubic-bezier(.19, 1, .22, 1);
--tui-backdrop-blur: 10px;
--tui-shadow-color: rgba(0, 0, 0, .2);
--tui-radius-default: 0;
--tui-radius-small: .5rem;
@@ -6,7 +6,7 @@
<script lang="ts" setup>
import Resizer from "../../../utils/Resizer";
import { Toolkit } from "timi-ts";
import { Toolkit } from "@timi/ts";
defineOptions({
name: "BEFlowerFall"
+1 -1
View File
@@ -13,7 +13,7 @@
</template>
<script lang="ts" setup>
import { Toolkit } from "timi-ts";
import { Toolkit } from "@timi/ts";
defineOptions({
name: "Loading"
});
+1 -1
View File
@@ -12,7 +12,7 @@
</template>
<script lang="ts" setup>
import { Time } from "timi-ts";
import { Time } from "@timi/ts";
defineOptions({
name: "TimeLabel"
+1 -1
View File
@@ -1,6 +1,6 @@
import Prism from "prismjs";
// 平台组件会直接编译 src/editor,不能依赖 timi-web 构建阶段的 Prism 插件注入语言。
// 平台组件会直接编译 src/editor,不能依赖 @timi/web 构建阶段的 Prism 插件注入语言。
import "prismjs/components/prism-apacheconf";
import "prismjs/components/prism-bash";
import "prismjs/components/prism-css";
+1 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { Text } from "timi-ts";
import { Text } from "@timi/ts";
describe("Text", () => {
describe("keyValue", () => {
+1 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { Time } from "timi-ts";
import { Time } from "@timi/ts";
describe("Time", () => {
describe("toShortTime", () => {
+3 -3
View File
@@ -13,7 +13,7 @@ export { default as VPopup } from "./directives/Popup";
export * from "./directives/Draggable";
export * from "./directives/Popup";
// 通过 timi-web 间接提供 timi-ts,业务项目无需重复声明公共工具入口。
// 通过 @timi/web 间接提供 @timi/ts,业务项目无需重复声明公共工具入口。
export {
Events,
IOSize,
@@ -25,11 +25,11 @@ export {
Time,
Toolkit,
UNITS
} from "timi-ts";
} from "@timi/ts";
export type {
Merge,
PickRequiredUnion,
PickNotRequiredUnion,
PrismjsProperties,
Unit
} from "timi-ts";
} from "@timi/ts";
+1 -1
View File
@@ -17,7 +17,7 @@
"DOM.Iterable"
],
"paths": {
"timi-web": [
"@timi/web": [
"./src/index.ts"
]
}
+58 -14
View File
@@ -1,4 +1,5 @@
import { resolve } from "path";
import { existsSync, readdirSync, statSync } from "fs";
import { relative, resolve } from "path";
import { Alias, defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import VueSetupExtend from "vite-plugin-vue-setup-extend";
@@ -9,11 +10,43 @@ import dts from "vite-plugin-dts";
const alias: Alias[] = [
{
find: /^timi-web(\/(es|lib))?$/,
find: /^@timi\/web(\/(es|lib))?$/,
replacement: resolve(__dirname, "./src/index.ts")
}
];
/**
* 递归收集组件入口,用于按组件导出。
* 例如 src/components/icon/index.ts -> components/icon/index
*/
function collectComponentEntries(dir: string, root: string): Record<string, string> {
const entries: Record<string, string> = {};
for (const name of readdirSync(dir)) {
const fullPath = resolve(dir, name);
if (!statSync(fullPath).isDirectory()) {
continue;
}
const indexPath = resolve(fullPath, "index.ts");
if (existsSync(indexPath)) {
const entryName = relative(root, indexPath)
.replace(/\\/g, "/")
.replace(/\.ts$/, "");
entries[entryName] = indexPath;
} else {
Object.assign(entries, collectComponentEntries(fullPath, root));
}
}
return entries;
}
const srcRoot = resolve(__dirname, "src");
const componentEntries = collectComponentEntries(resolve(srcRoot, "components"), srcRoot);
export default defineConfig({
server: {
port: 3003,
@@ -23,22 +56,36 @@ export default defineConfig({
alias
},
build: {
target: "es2017",
outDir: "dist",
lib: {
entry: resolve(__dirname, "./src/index.ts"),
name: "TimiWeb",
fileName: "timi-web"
entry: {
index: resolve(srcRoot, "index.ts"),
"components/index": resolve(srcRoot, "components/index.ts"),
"editor/index": resolve(srcRoot, "editor/index.ts"),
"utils/index": resolve(srcRoot, "utils/index.ts"),
...componentEntries
},
formats: ["es"],
fileName: (_format, entryName) => `${entryName}.js`,
cssFileName: "timi-web"
},
rollupOptions: {
external: [
"vue"
"vue",
"@timi/ts",
"marked",
/^marked-/,
"prismjs",
/^prismjs\//,
/^@tiptap\//,
"@marsio/vue-split-pane"
],
output: {
globals: {
vue: "Vue"
}
chunkFileNames: "chunks/[name]-[hash].js"
}
},
cssCodeSplit: false,
minify: "terser"
},
plugins: [
@@ -47,11 +94,8 @@ export default defineConfig({
}),
VueSetupExtend(),
dts({
// package.json 的 types 与 exports 指向 dist/src/**。
// 不显式固定根目录时,插件会按 tsconfig include 推断公共根,
// include 一旦变化(例如移除 examples 目录)声明产物就会从
// dist/src/** 漂移到 dist/**,进而让所有引用本包类型的地方报错。
entryRoot: "."
// 按组件导出后,声明文件直接落在 dist/**,与 exports 的路径保持一致。
entryRoot: "src"
}),
prismjsPlugin({
languages: [