diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index fe40b4d..b61faf5 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -72,8 +72,8 @@ jobs: - name: Ensure version not published if: ${{ steps.version.outputs.publish == 'true' }} run: | - if npm view "timi-tdesign-mobile@${{ steps.version.outputs.version }}" version > /dev/null 2>&1; then - echo "FAIL: timi-tdesign-mobile@${{ steps.version.outputs.version }} 已存在于 nexus,请提升 package.json 版本" + if npm view "@timi/tdesign-mobile@${{ steps.version.outputs.version }}" version > /dev/null 2>&1; then + echo "FAIL: @timi/tdesign-mobile@${{ steps.version.outputs.version }} 已存在于 nexus,请提升 package.json 版本" exit 1 fi echo "OK: 版本未占用" diff --git a/README.md b/README.md index 2898741..47a407e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# timi-tdesign-mobile +# @timi/tdesign-mobile -Vue 3 移动端通用组件库,依赖 `timi-web` 提供基础组件和编辑器能力。 +Vue 3 移动端通用组件库,依赖 `@timi/web` 提供基础组件和编辑器能力。 -本包不依赖 `timi-web-api`。业务项目可以只安装本包使用通用组件;需要业务接口、领域类型或用户状态时,再单独安装 `timi-web-api`。 +本包不绑定业务 API 包。业务项目可以只安装本包使用通用组件;业务接口、领域类型和用户状态由应用层自行提供。 ## 文章和通知组件 -`ArticleEditor`、`ArticleView`、`NotifyEditor`、`NotifyView` 只约束对象的最小字段。`Article`、`Attachment` 和 `NotifyDetail` 支持携带业务自定义字段,不要求对象来自 `timi-web-api`。 +`ArticleEditor`、`ArticleView`、`NotifyEditor`、`NotifyView` 只约束对象的最小字段。`Article`、`Attachment` 和 `NotifyDetail` 支持携带业务自定义字段,不要求对象来自特定 API 包。 上传和附件地址由业务项目通过回调注入: diff --git a/components.d.ts b/components.d.ts index 37bbfc8..350b8db 100644 --- a/components.d.ts +++ b/components.d.ts @@ -22,8 +22,10 @@ declare module 'vue' { BottomPopup: typeof import('./src/components/bottom-popup/index.vue')['default'] CardContainer: typeof import('./src/components/card-container/index.vue')['default'] CodeEditor: typeof import('./src/components/code-editor/index.vue')['default'] + DropdownFilter: typeof import('./src/components/dropdown-filter/index.vue')['default'] DurationPicker: typeof import('./src/components/duration-picker/index.vue')['default'] EditorSearch: typeof import('./src/components/editor-search/index.vue')['default'] + Item: typeof import('./src/components/timeline/item.vue')['default'] MasterDetail: typeof import('./src/components/master-detail/index.vue')['default'] MasterDetailPage: typeof import('./src/components/master-detail-page/index.vue')['default'] NotifyEditor: typeof import('./src/components/notify-editor/index.vue')['default'] @@ -44,6 +46,7 @@ declare module 'vue' { TIcon: typeof import('tdesign-mobile-vue')['Icon'] TImage: typeof import('tdesign-mobile-vue')['Image'] TImageViewer: typeof import('tdesign-mobile-vue')['ImageViewer'] + Timeline: typeof import('./src/components/timeline/index.vue')['default'] TInput: typeof import('tdesign-mobile-vue')['Input'] TiptapCodeBlockButton: typeof import('./src/components/tiptap-editor/TiptapCodeBlockButton.vue')['default'] TiptapEditor: typeof import('./src/components/tiptap-editor/index.vue')['default'] diff --git a/package.json b/package.json index 5eb614d..19fd407 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,15 @@ { - "name": "timi-tdesign-mobile", - "main": "./dist/timi-tdesign-mobile.umd.js", + "name": "@timi/tdesign-mobile", + "type": "module", + "main": "./dist/index.js", "types": "./dist/index.d.ts", - "module": "./dist/timi-tdesign-mobile.mjs", + "module": "./dist/index.js", "style": "./dist/timi-tdesign-mobile.css", + "sideEffects": [ + "**/*.css" + ], "private": false, - "version": "1.5.0", + "version": "2.0.0", "license": "MIT", "scripts": { "dev": "pnpm run -C docs dev", @@ -25,8 +29,23 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/timi-tdesign-mobile.mjs", - "require": "./dist/timi-tdesign-mobile.umd.js" + "import": "./dist/index.js" + }, + "./components": { + "types": "./dist/components/index.d.ts", + "import": "./dist/components/index.js" + }, + "./components/*": { + "types": "./dist/components/*/index.d.ts", + "import": "./dist/components/*/index.js" + }, + "./directives": { + "types": "./dist/directives/index.d.ts", + "import": "./dist/directives/index.js" + }, + "./utils/message": { + "types": "./dist/utils/message.d.ts", + "import": "./dist/utils/message.js" }, "./style.css": "./dist/timi-tdesign-mobile.css", "./src/*": "./src/*" @@ -35,8 +54,8 @@ "node": ">=20.0.0" }, "dependencies": { - "tdesign-mobile-vue": "^1.17.1", - "timi-web": "^1.0.2" + "tdesign-mobile-vue": "^1.17.2", + "@timi/web": "^2.0.0" }, "peerDependencies": { "vue": "^3.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1bb88dd..9dc18f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,12 +8,12 @@ importers: .: dependencies: + '@timi/web': + specifier: ^2.0.0 + version: 2.0.0(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.26(typescript@5.8.3)) tdesign-mobile-vue: - specifier: ^1.17.1 - version: 1.17.1(vue@3.5.26(typescript@5.8.3)) - timi-web: - specifier: ^1.0.2 - version: 1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.26(typescript@5.8.3)) + specifier: ^1.17.2 + version: 1.17.2(vue@3.5.26(typescript@5.8.3)) devDependencies: '@types/node': specifier: ^22.13.5 @@ -1152,6 +1152,14 @@ packages: '@soda/get-current-script@1.0.2': resolution: {integrity: sha512-T7VNNlYVM1SgQ+VsMYhnDkcGmWhQdL0bDyGm5TlQ3GBXnJscEClUUOKduWTmm2zCnvNLC1hc3JpuXjs/nFOc5w==} + '@timi/ts@1.0.0': + resolution: {integrity: sha512-0NFi1+CnonZTcf73IeDdcd5Qoqnt/EdESI448wHfdbd5mk6gRqJNzb82z03SHOCJlIOiLUPvBgctAVLbB58V1A==} + engines: {node: '>=20.0.0'} + + '@timi/web@2.0.0': + resolution: {integrity: sha512-Qp/jvLpRbmPCK6jO70cHuefHdw8qw4l90GjPRFpo0ZB8CpIYmwcqHffcDS61p59z1GqsDP6BGT1kEPHDGxDsGg==} + engines: {node: '>=20.0.0'} + '@tiptap/core@3.33.0': resolution: {integrity: sha512-sZjBCwK9+h0kbc/CZvkepX6RTJ2jOfeWY1aId9O3YnG0CAiOs/4DbqFmpcmv5BQAGPA6gC96gqdafa/9Dpg0tw==} peerDependencies: @@ -3271,6 +3279,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.1: @@ -4675,6 +4684,9 @@ packages: sockjs@0.3.24: resolution: {integrity: sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==} + sortablejs@1.15.7: + resolution: {integrity: sha512-Kk8wLQPlS+yi1ZEf48a4+fzHa4yxjC30M/Sr2AnQu+f/MPwvvX9XjZ6OWejiz8crBsLwSq8GHqaxaET7u6ux0A==} + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -4822,8 +4834,8 @@ packages: peerDependencies: vue: ^3.0.0 - tdesign-mobile-vue@1.17.1: - resolution: {integrity: sha512-gCmhaNCc2xhSkbITHiXnE/UGs6GHLe9LTE7T26ELOENC5Cqpa+j4KYU9wz6uqFV+Ro10RkG3DFikYHnq0gNN0A==} + tdesign-mobile-vue@1.17.2: + resolution: {integrity: sha512-/MH+eNnySvMlEMwIlG0sMPOuwUuhWyOHn6HdS79ct9/+ZP+gCDzGH/usgcahZHM1l0ulY2NTlUp32opimlSZkQ==} engines: {node: '>=18.0.0'} peerDependencies: vue: ^3.2.6 @@ -4865,14 +4877,6 @@ packages: thunky@1.1.0: resolution: {integrity: sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==} - timi-ts@1.0.0: - resolution: {integrity: sha512-MR9LJGH4/UEgzzrc1yVdxypTcoQRASt8xns2z5xNyoXr2e0kdXv8sjnuRshp3uZnOCU/pSks1LeLi9OvC2U/7g==} - engines: {node: '>=20.0.0'} - - timi-web@1.0.2: - resolution: {integrity: sha512-CXyWEeGTjrExnrAwstdWPc3qK5Lfyp7ipD8p7+WYcm4mcnJOS48k6SkVnrAIADAImeJAr/1e5JEV8wk+8AcvxQ==} - engines: {node: '>=20.0.0'} - tinycolor2@1.6.0: resolution: {integrity: sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==} @@ -6556,6 +6560,44 @@ snapshots: '@soda/get-current-script@1.0.2': {} + '@timi/ts@1.0.0': {} + + '@timi/web@2.0.0(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.26(typescript@5.8.3))': + dependencies: + '@marsio/vue-split-pane': 1.0.0(typescript@5.8.3) + '@timi/ts': 1.0.0 + '@tiptap/extension-code-block': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) + '@tiptap/extension-color': 3.33.0(@tiptap/extension-text-style@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))) + '@tiptap/extension-image': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0)) + '@tiptap/extension-link': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) + '@tiptap/extension-placeholder': 3.33.0(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)) + '@tiptap/extension-subscript': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) + '@tiptap/extension-superscript': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) + '@tiptap/extension-table': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) + '@tiptap/extension-table-cell': 3.33.0(@tiptap/extension-table@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)) + '@tiptap/extension-table-header': 3.33.0(@tiptap/extension-table@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)) + '@tiptap/extension-table-row': 3.33.0(@tiptap/extension-table@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)) + '@tiptap/extension-text-align': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0)) + '@tiptap/extension-text-style': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0)) + '@tiptap/extension-underline': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0)) + '@tiptap/pm': 3.33.0 + '@tiptap/starter-kit': 3.33.0 + '@tiptap/vue-3': 3.33.0(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)(vue@3.5.26(typescript@5.8.3)) + less: 4.5.1 + marked: 17.0.6 + marked-gfm-heading-id: 4.1.4(marked@17.0.6) + marked-highlight: 2.2.4(marked@17.0.6) + marked-mangle: 1.1.14(marked@17.0.6) + prismjs: 1.30.0 + terser: 5.46.0 + transitivePeerDependencies: + - '@floating-ui/dom' + - '@tiptap/core' + - '@tiptap/extensions' + - supports-color + - typescript + - vue + '@tiptap/core@3.33.0(@tiptap/pm@3.33.0)': dependencies: '@tiptap/pm': 3.33.0 @@ -10443,6 +10485,8 @@ snapshots: uuid: 8.3.2 websocket-driver: 0.7.4 + sortablejs@1.15.7: {} + source-map-js@1.2.1: {} source-map-support@0.5.21: @@ -10590,13 +10634,14 @@ snapshots: '@babel/runtime': 7.26.9 vue: 3.5.26(typescript@5.8.3) - tdesign-mobile-vue@1.17.1(vue@3.5.26(typescript@5.8.3)): + tdesign-mobile-vue@1.17.2(vue@3.5.26(typescript@5.8.3)): dependencies: '@babel/runtime': 7.26.9 '@use-gesture/vanilla': 10.3.1 '@vueuse/core': 10.7.0(vue@3.5.26(typescript@5.8.3)) dayjs: 1.11.13 lodash-es: 4.17.21 + sortablejs: 1.15.7 tdesign-icons-vue-next: 0.4.11(vue@3.5.26(typescript@5.8.3)) tinycolor2: 1.6.0 validator: 13.12.0 @@ -10639,44 +10684,6 @@ snapshots: thunky@1.1.0: {} - timi-ts@1.0.0: {} - - timi-web@1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.26(typescript@5.8.3)): - dependencies: - '@marsio/vue-split-pane': 1.0.0(typescript@5.8.3) - '@tiptap/extension-code-block': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) - '@tiptap/extension-color': 3.33.0(@tiptap/extension-text-style@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))) - '@tiptap/extension-image': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0)) - '@tiptap/extension-link': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) - '@tiptap/extension-placeholder': 3.33.0(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)) - '@tiptap/extension-subscript': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) - '@tiptap/extension-superscript': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) - '@tiptap/extension-table': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0) - '@tiptap/extension-table-cell': 3.33.0(@tiptap/extension-table@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)) - '@tiptap/extension-table-header': 3.33.0(@tiptap/extension-table@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)) - '@tiptap/extension-table-row': 3.33.0(@tiptap/extension-table@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)) - '@tiptap/extension-text-align': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0)) - '@tiptap/extension-text-style': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0)) - '@tiptap/extension-underline': 3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0)) - '@tiptap/pm': 3.33.0 - '@tiptap/starter-kit': 3.33.0 - '@tiptap/vue-3': 3.33.0(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0)(vue@3.5.26(typescript@5.8.3)) - less: 4.5.1 - marked: 17.0.6 - marked-gfm-heading-id: 4.1.4(marked@17.0.6) - marked-highlight: 2.2.4(marked@17.0.6) - marked-mangle: 1.1.14(marked@17.0.6) - prismjs: 1.30.0 - terser: 5.46.0 - timi-ts: 1.0.0 - transitivePeerDependencies: - - '@floating-ui/dom' - - '@tiptap/core' - - '@tiptap/extensions' - - supports-color - - typescript - - vue - tinycolor2@1.6.0: {} tinyglobby@0.2.12: diff --git a/src/components/ai/AiChatMessageList.vue b/src/components/ai/AiChatMessageList.vue index b8ab2ca..6c949cb 100644 --- a/src/components/ai/AiChatMessageList.vue +++ b/src/components/ai/AiChatMessageList.vue @@ -84,7 +84,7 @@