升级package, 以及更新声明文件

This commit is contained in:
zhengw
2026-01-09 16:33:18 +08:00
parent 0c4b2a886c
commit cf461d33f9
238 changed files with 46252 additions and 5857 deletions

View File

@@ -0,0 +1,24 @@
import { SuperComponent } from '../../../components/common/src/index';
export default class ChatThinking extends SuperComponent {
options: {
multipleSlots: boolean;
};
properties: import("./type").TdChatThinkingProps;
data: {
localCollapsed: boolean;
contentStyle: string;
classPrefix: string;
};
observers: {
maxHeight(): void;
};
methods: {
handleCollapse(): void;
setContentStyle(): void;
};
lifetimes: {
created(): void;
attached(): void;
detached(): void;
};
}

View File

@@ -0,0 +1 @@
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";const{prefix:prefix}=config,name=`${prefix}-chat-thinking`;let ChatThinking=class extends SuperComponent{constructor(){super(...arguments),this.options={multipleSlots:!0},this.properties=props,this.data={localCollapsed:!1,contentStyle:"",classPrefix:name},this.observers={maxHeight(){this.setContentStyle()}},this.methods={handleCollapse(){this.setData({localCollapsed:!this.data.localCollapsed}),this.triggerEvent("collapsedChange",this.data.localCollapsed)},setContentStyle(){this.data.maxHeight?this.setData({contentStyle:`max-height: ${this.data.maxHeight}px;`}):this.setData({contentStyle:""})}},this.lifetimes={created(){this.data.handleCollapse=this.handleCollapse.bind(this)},attached(){(function(){this.setData({localCollapsed:this.properties.collapsed||!1})}).call(this),this.setContentStyle()},detached(){}}}};ChatThinking=__decorate([wxComponent()],ChatThinking);export default ChatThinking;

View File

@@ -0,0 +1 @@
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"t-chat-loading":"../chat-loading/chat-loading","t-icon":"../icon/icon"}}

View File

@@ -0,0 +1 @@
<wxs src="../common/utils.wxs" module="_"/><view class="class {{classPrefix}}" style="{{_._style([style, customStyle])}}"><view class="{{_.cls(classPrefix + '__inner', [layout])}}"><view class="{{classPrefix}}__hd"><block wx:if="{{status === 'error' || status === 'complete' || status === 'stop'}}"><t-icon class="{{_.cls(classPrefix + '__icon', [status])}}" name="{{ status === 'error' ? 'close-circle' : 'check-circle'}}"/></block><block wx:else><t-chat-loading animation="{{animation}}"></t-chat-loading></block><view class="{{classPrefix}}__txt">{{content.title || "正在思考中..."}}</view><view data-event-opts="{{[['tap',[['handleCollapse',['$event']]]]]}}"><t-icon style="{{localCollapsed ? 'transform: rotate(180deg)' : ''}}" class="{{_.cls(classPrefix + '__icon', [['collapse', true]])}}" name="chevron-up" bindtap="handleCollapse"/></view></view><view hidden="{{!(!localCollapsed)}}" class="{{_.cls(classPrefix + '__bd', [layout])}}" style="{{contentStyle}}">{{content.text||""}}</view></view></view>

View File

@@ -0,0 +1,21 @@
@import '../common/style/index.wxss';.t-chat-thinking{width:100%;box-sizing:border-box;}
.t-chat-thinking__inner--block{background-color:var(--td-bg-color-page,var(--td-gray-color-1,#f3f3f3));border-radius:var(--td-radius-default,12rpx);padding:var(--td-spacer,16rpx) var(--td-spacer-1,24rpx);}
.t-chat-thinking__inner--border{padding:var(--td-spacer,16rpx) var(--td-spacer-1,24rpx);}
.t-chat-thinking__hd{height:48rpx;overflow:hidden;display:flex;align-items:center;}
.t-chat-thinking__hd .t-chat-thinking__icon{font-size:var(--td-font-size-xl,40rpx);}
.t-chat-thinking__hd .t-chat-thinking__icon--close{color:var(--td-text-color-secondary,var(--td-font-gray-2,rgba(0,0,0,.6)));}
.t-chat-thinking__hd .t-chat-thinking__icon--complete,.t-chat-thinking__hd .t-chat-thinking__icon--stop{color:var(--td-success-color,var(--td-success-color-5,#2ba471));}
.t-chat-thinking__hd .t-chat-thinking__icon--collapse{color:var(--td-text-color-secondary,var(--td-font-gray-2,rgba(0,0,0,.6)));transition:transform .3s ease-in-out;}
.t-chat-thinking__hd .t-chat-thinking__txt{color:var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9)));font-size:var(--td-font-size-base,28rpx);line-height:32rpx;flex:1;margin-left:var(--td-spacer,16rpx);}
.t-chat-thinking__bd{color:var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4)));font-size:var(--td-font-size-base,28rpx);line-height:170%;margin-top:var(--td-spacer-1,24rpx);white-space:pre-wrap;overflow-y:auto;}
.t-chat-thinking__bd--border{border-left:4rpx solid var(--td-component-stroke,var(--td-gray-color-3,#e7e7e7));padding-left:var(--td-spacer,16rpx);}
@keyframes scale{
0%{transform:scale(1.333) translateY(-50%);}
33%{transform:scale(1.333) translateY(-50%);}
34%{transform:scale(1) translateY(-50%);}
100%{transform:scale(1) translateY(-50%);}}
@-webkit-keyframes scale{
0%{-webkit-transform:scale(1.333) translateY(-50%);transform:scale(1.333) translateY(-50%);}
33%{-webkit-transform:scale(1.333) translateY(-50%);transform:scale(1.333) translateY(-50%);}
34%{-webkit-transform:scale(1) translateY(-50%);transform:scale(1) translateY(-50%);}
100%{-webkit-transform:scale(1) translateY(-50%);transform:scale(1) translateY(-50%);}}

View File

@@ -0,0 +1,3 @@
import { TdChatThinkingProps } from './type';
declare const props: TdChatThinkingProps;
export default props;

View File

@@ -0,0 +1 @@
const props={animation:{type:String,value:"moving"},collapsed:{type:Boolean,value:!1},content:{type:Object,required:!0},layout:{type:String,value:"block"},maxHeight:{type:Number},status:{type:String,value:"pending",required:!0}};export default props;

View File

@@ -0,0 +1,31 @@
export interface TdChatThinkingProps {
animation?: {
type: StringConstructor;
value?: 'skeleton' | 'moving' | 'gradient' | 'dot';
};
collapsed?: {
type: BooleanConstructor;
value?: boolean;
};
content: {
type: ObjectConstructor;
value?: {
text?: string;
title?: string;
};
required?: boolean;
};
layout?: {
type: StringConstructor;
value?: 'block' | 'border';
};
maxHeight?: {
type: NumberConstructor;
value?: number;
};
status: {
type: StringConstructor;
value?: 'complete' | 'stop' | 'error' | 'pending';
required?: boolean;
};
}

View File

@@ -0,0 +1 @@
export{};