ai-text-summary-ng 1.0.0
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/README.md +118 -0
- package/ai-text-summary-ng-1.0.0.tgz +0 -0
- package/app/app.component.d.ts +38 -0
- package/app/components/fmode-avatar/fmode-avatar.component.d.ts +16 -0
- package/app/components/fmode-badge/fmode-badge.component.d.ts +8 -0
- package/app/components/fmode-button/fmode-button.component.d.ts +10 -0
- package/app/components/fmode-card/fmode-card.component.d.ts +6 -0
- package/app/components/fmode-digital-human/fmode-digital-human.component.d.ts +10 -0
- package/app/components/fmode-divider/fmode-divider.component.d.ts +7 -0
- package/app/components/fmode-header/fmode-header.component.d.ts +7 -0
- package/app/components/fmode-list/fmode-list.component.d.ts +9 -0
- package/app/components/fmode-loading/fmode-loading.component.d.ts +6 -0
- package/app/components/fmode-select/fmode-select.component.d.ts +17 -0
- package/app/components/fmode-tag/fmode-tag.component.d.ts +9 -0
- package/app/components/fmode-textarea/fmode-textarea.component.d.ts +15 -0
- package/esm2022/ai-text-summary-ng.mjs +5 -0
- package/esm2022/app/app.component.mjs +533 -0
- package/esm2022/app/components/fmode-avatar/fmode-avatar.component.mjs +83 -0
- package/esm2022/app/components/fmode-badge/fmode-badge.component.mjs +49 -0
- package/esm2022/app/components/fmode-button/fmode-button.component.mjs +52 -0
- package/esm2022/app/components/fmode-card/fmode-card.component.mjs +34 -0
- package/esm2022/app/components/fmode-digital-human/fmode-digital-human.component.mjs +119 -0
- package/esm2022/app/components/fmode-divider/fmode-divider.component.mjs +35 -0
- package/esm2022/app/components/fmode-header/fmode-header.component.mjs +33 -0
- package/esm2022/app/components/fmode-list/fmode-list.component.mjs +50 -0
- package/esm2022/app/components/fmode-loading/fmode-loading.component.mjs +25 -0
- package/esm2022/app/components/fmode-select/fmode-select.component.mjs +62 -0
- package/esm2022/app/components/fmode-tag/fmode-tag.component.mjs +54 -0
- package/esm2022/app/components/fmode-textarea/fmode-textarea.component.mjs +75 -0
- package/esm2022/public-api.mjs +15 -0
- package/fesm2022/ai-text-summary-ng.mjs +1155 -0
- package/fesm2022/ai-text-summary-ng.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/package.json +42 -0
- package/public-api.d.ts +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# AI 文本智能总结助手 (ai-text-summary-ng)
|
|
2
|
+
|
|
3
|
+
基于 Angular + fmode-ng UI 组件库的 AI 文本智能总结助手,包含数字人交互界面。
|
|
4
|
+
|
|
5
|
+
## 功能特性
|
|
6
|
+
|
|
7
|
+
- ✅ 智能文本总结(支持简短/详细两种模式)
|
|
8
|
+
- ✅ 五种预设测试文本
|
|
9
|
+
- ✅ 数字人交互界面(等待/聆听/思考/说话状态)
|
|
10
|
+
- ✅ 历史记录管理
|
|
11
|
+
- ✅ 结果复制功能
|
|
12
|
+
- ✅ 响应式设计
|
|
13
|
+
|
|
14
|
+
## 技术栈
|
|
15
|
+
|
|
16
|
+
- Angular 17+
|
|
17
|
+
- TypeScript
|
|
18
|
+
- fmode-ng UI 组件库(自定义)
|
|
19
|
+
- 模拟 AI 总结接口
|
|
20
|
+
|
|
21
|
+
## 安装
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install ai-text-summary-ng
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 使用方法
|
|
28
|
+
|
|
29
|
+
### 1. 导入模块
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { NgModule } from '@angular/core';
|
|
33
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
34
|
+
import { AppComponent } from './app.component';
|
|
35
|
+
import { AiTextSummaryModule } from 'ai-text-summary-ng';
|
|
36
|
+
|
|
37
|
+
@NgModule({
|
|
38
|
+
declarations: [
|
|
39
|
+
AppComponent
|
|
40
|
+
],
|
|
41
|
+
imports: [
|
|
42
|
+
BrowserModule,
|
|
43
|
+
AiTextSummaryModule
|
|
44
|
+
],
|
|
45
|
+
providers: [],
|
|
46
|
+
bootstrap: [AppComponent]
|
|
47
|
+
})
|
|
48
|
+
export class AppModule { }
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. 在组件中使用
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<ai-text-summary></ai-text-summary>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 开发
|
|
58
|
+
|
|
59
|
+
### 克隆项目
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
git clone <repository-url>
|
|
63
|
+
cd ai-text-summary-demo
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 安装依赖
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm install
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 启动开发服务器
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm start
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 构建生产版本
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm run build
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 打包为 npm 包
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run pack
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## 项目结构
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
ai-text-summary-demo/
|
|
94
|
+
├── src/
|
|
95
|
+
│ ├── app/
|
|
96
|
+
│ │ ├── components/ # fmode-ng 组件
|
|
97
|
+
│ │ │ ├── fmode-avatar/ # 头像组件
|
|
98
|
+
│ │ │ ├── fmode-badge/ # 徽章组件
|
|
99
|
+
│ │ │ ├── fmode-button/ # 按钮组件
|
|
100
|
+
│ │ │ ├── fmode-card/ # 卡片组件
|
|
101
|
+
│ │ │ ├── fmode-divider/ # 分割线组件
|
|
102
|
+
│ │ │ ├── fmode-digital-human/ # 数字人组件
|
|
103
|
+
│ │ │ ├── fmode-header/ # 头部组件
|
|
104
|
+
│ │ │ ├── fmode-loading/ # 加载组件
|
|
105
|
+
│ │ │ ├── fmode-list/ # 列表组件
|
|
106
|
+
│ │ │ ├── fmode-select/ # 选择组件
|
|
107
|
+
│ │ │ ├── fmode-tag/ # 标签组件
|
|
108
|
+
│ │ │ └── fmode-textarea/ # 文本输入组件
|
|
109
|
+
│ │ ├── app.component.ts # 主应用组件
|
|
110
|
+
│ │ └── app.module.ts # 应用模块
|
|
111
|
+
│ └── main.ts # 应用入口
|
|
112
|
+
├── package.json # 项目配置
|
|
113
|
+
└── README.md # 项目说明
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## 许可证
|
|
117
|
+
|
|
118
|
+
MIT License
|
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
interface SummaryHistory {
|
|
3
|
+
id: number;
|
|
4
|
+
originalText: string;
|
|
5
|
+
summaryText: string;
|
|
6
|
+
timestamp: Date;
|
|
7
|
+
}
|
|
8
|
+
export declare class AppComponent {
|
|
9
|
+
inputText: string;
|
|
10
|
+
currentSummary: string;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
summaryLength: string;
|
|
13
|
+
history: SummaryHistory[];
|
|
14
|
+
digitalHumanState: 'waiting' | 'listening' | 'thinking' | 'speaking';
|
|
15
|
+
digitalHumanSpeech: string;
|
|
16
|
+
lengthOptions: {
|
|
17
|
+
value: string;
|
|
18
|
+
label: string;
|
|
19
|
+
}[];
|
|
20
|
+
testTexts: {
|
|
21
|
+
id: number;
|
|
22
|
+
title: string;
|
|
23
|
+
content: string;
|
|
24
|
+
}[];
|
|
25
|
+
onInputTextChange(value: string): void;
|
|
26
|
+
onSummaryLengthChange(value: string): void;
|
|
27
|
+
loadTestText(index: number): void;
|
|
28
|
+
summarizeText(): Promise<void>;
|
|
29
|
+
mockAISummary(text: string, length: string): Promise<string>;
|
|
30
|
+
clearInput(): void;
|
|
31
|
+
clearHistory(): void;
|
|
32
|
+
loadHistoryItem(item: SummaryHistory): void;
|
|
33
|
+
copySummary(): void;
|
|
34
|
+
formatTime(timestamp: Date): string;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppComponent, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AppComponent, "app-root", never, {}, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FmodeAvatarComponent {
|
|
4
|
+
name: string;
|
|
5
|
+
imageUrl: string;
|
|
6
|
+
size: 'small' | 'medium' | 'large' | 'xlarge';
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
textColor: string;
|
|
9
|
+
alt: string;
|
|
10
|
+
rounded: boolean;
|
|
11
|
+
clickable: boolean;
|
|
12
|
+
onClick: EventEmitter<void>;
|
|
13
|
+
get initials(): string;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeAvatarComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeAvatarComponent, "fmode-avatar", never, { "name": { "alias": "name"; "required": false; }; "imageUrl": { "alias": "imageUrl"; "required": false; }; "size": { "alias": "size"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; "textColor": { "alias": "textColor"; "required": false; }; "alt": { "alias": "alt"; "required": false; }; "rounded": { "alias": "rounded"; "required": false; }; "clickable": { "alias": "clickable"; "required": false; }; }, { "onClick": "onClick"; }, never, never, true, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FmodeBadgeComponent {
|
|
3
|
+
type: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
|
|
4
|
+
pill: boolean;
|
|
5
|
+
outline: boolean;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeBadgeComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeBadgeComponent, "fmode-badge", never, { "type": { "alias": "type"; "required": false; }; "pill": { "alias": "pill"; "required": false; }; "outline": { "alias": "outline"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FmodeButtonComponent {
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
type: 'primary' | 'secondary' | 'success' | 'danger';
|
|
6
|
+
size: 'small' | 'medium' | 'large';
|
|
7
|
+
onClick: EventEmitter<void>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeButtonComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeButtonComponent, "fmode-button", never, { "disabled": { "alias": "disabled"; "required": false; }; "type": { "alias": "type"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "onClick": "onClick"; }, never, ["*"], true, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FmodeCardComponent {
|
|
3
|
+
title: string;
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeCardComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeCardComponent, "fmode-card", never, { "title": { "alias": "title"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FmodeDigitalHumanComponent implements OnInit {
|
|
4
|
+
size: 'small' | 'medium' | 'large' | 'xlarge';
|
|
5
|
+
state: 'waiting' | 'listening' | 'thinking' | 'speaking';
|
|
6
|
+
speechText: string;
|
|
7
|
+
ngOnInit(): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeDigitalHumanComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeDigitalHumanComponent, "fmode-digital-human", never, { "size": { "alias": "size"; "required": false; }; "state": { "alias": "state"; "required": false; }; "speechText": { "alias": "speechText"; "required": false; }; }, {}, never, never, true, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FmodeDividerComponent {
|
|
3
|
+
text: string;
|
|
4
|
+
vertical: boolean;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeDividerComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeDividerComponent, "fmode-divider", never, { "text": { "alias": "text"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; }, {}, never, never, true, never>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FmodeHeaderComponent {
|
|
3
|
+
title: string;
|
|
4
|
+
subtitle: string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeHeaderComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeHeaderComponent, "fmode-header", never, { "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; }, {}, never, never, true, never>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FmodeListComponent {
|
|
4
|
+
items: any[];
|
|
5
|
+
itemClick: EventEmitter<any>;
|
|
6
|
+
onItemClick(item: any): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeListComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeListComponent, "fmode-list", never, { "items": { "alias": "items"; "required": false; }; }, { "itemClick": "itemClick"; }, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FmodeLoadingComponent {
|
|
3
|
+
loadingText: string;
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeLoadingComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeLoadingComponent, "fmode-loading", never, { "loadingText": { "alias": "loadingText"; "required": false; }; }, {}, never, never, true, never>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
interface SelectOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class FmodeSelectComponent {
|
|
8
|
+
value: string;
|
|
9
|
+
valueChange: EventEmitter<string>;
|
|
10
|
+
label: string;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
options: SelectOption[];
|
|
13
|
+
onSelectChange(event: any): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeSelectComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeSelectComponent, "fmode-select", never, { "value": { "alias": "value"; "required": false; }; "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FmodeTagComponent {
|
|
4
|
+
color: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
|
|
5
|
+
closable: boolean;
|
|
6
|
+
onClose: EventEmitter<void>;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeTagComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeTagComponent, "fmode-tag", never, { "color": { "alias": "color"; "required": false; }; "closable": { "alias": "closable"; "required": false; }; }, { "onClose": "onClose"; }, never, ["*"], true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FmodeTextareaComponent {
|
|
4
|
+
value: string;
|
|
5
|
+
valueChange: EventEmitter<string>;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
label: string;
|
|
8
|
+
rows: number;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
maxLength: number;
|
|
11
|
+
showCharCount: boolean;
|
|
12
|
+
onInputChange(event: any): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeTextareaComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmodeTextareaComponent, "fmode-textarea", never, { "value": { "alias": "value"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "label": { "alias": "label"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "showCharCount": { "alias": "showCharCount"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWktdGV4dC1zdW1tYXJ5LW5nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2FpLXRleHQtc3VtbWFyeS1uZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
|