@apform-ui/core 1.3.0 → 1.4.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.
@@ -0,0 +1,23 @@
1
+ import { AssistantPickerItem } from './types';
2
+ type __VLS_Props = {
3
+ /** 智能体列表 */
4
+ items: AssistantPickerItem[];
5
+ /** 当前选中 id */
6
+ modelValue: string | null;
7
+ /** 加载中 */
8
+ loading?: boolean;
9
+ /** 错误信息 */
10
+ error?: string | null;
11
+ };
12
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ "update:modelValue": (value: string) => any;
14
+ select: (item: AssistantPickerItem) => any;
15
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
17
+ onSelect?: ((item: AssistantPickerItem) => any) | undefined;
18
+ }>, {
19
+ error: string | null;
20
+ loading: boolean;
21
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as AssistantPicker } from './AssistantPicker.vue';
2
+ export type { AssistantPickerItem } from './types';
@@ -0,0 +1,9 @@
1
+ /** AssistantPicker 可选智能体项 */
2
+ export interface AssistantPickerItem {
3
+ id: string;
4
+ name: string;
5
+ description?: string;
6
+ icon?: string;
7
+ supportedInputs?: string[];
8
+ hitlCapable?: boolean;
9
+ }
@@ -0,0 +1,16 @@
1
+ import { ModelPickerItem } from './types';
2
+ type __VLS_Props = {
3
+ /** 模型列表 */
4
+ models: ModelPickerItem[];
5
+ /** 当前选中 id */
6
+ modelValue: string | null;
7
+ /** 加载中 */
8
+ loading?: boolean;
9
+ };
10
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ "update:modelValue": (value: string) => any;
12
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as ModelPicker } from './ModelPicker.vue';
2
+ export type { ModelPickerItem } from './types';
@@ -0,0 +1,6 @@
1
+ /** ModelPicker 可选模型项 */
2
+ export interface ModelPickerItem {
3
+ id: string;
4
+ name: string;
5
+ provider: string;
6
+ }
@@ -0,0 +1,61 @@
1
+ import { DocumentPreviewChunk } from './types';
2
+ type __VLS_Props = {
3
+ /** 是否打开 */
4
+ modelValue: boolean;
5
+ /** 文件名 */
6
+ filename?: string;
7
+ /** MIME 类型 */
8
+ mimetype?: string;
9
+ /** 文件大小(字节) */
10
+ size?: number;
11
+ /** 文本分块 */
12
+ chunks?: DocumentPreviewChunk[];
13
+ /** 抽取方法 */
14
+ extractionMethod?: string;
15
+ /** 是否有原文件可下载 */
16
+ hasOriginalFile?: boolean;
17
+ /** PDF 预览 URL */
18
+ pdfUrl?: string;
19
+ /** Excel 预览 URL */
20
+ excelUrl?: string;
21
+ /** 加载中 */
22
+ loading?: boolean;
23
+ /** 错误信息 */
24
+ error?: string | null;
25
+ /** 抽屉宽度 */
26
+ sizeDrawer?: string | number;
27
+ };
28
+ declare var __VLS_21: {
29
+ url: string | undefined;
30
+ }, __VLS_24: {
31
+ url: string | undefined;
32
+ };
33
+ type __VLS_Slots = {} & {
34
+ pdf?: (props: typeof __VLS_21) => any;
35
+ } & {
36
+ excel?: (props: typeof __VLS_24) => any;
37
+ };
38
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
39
+ "update:modelValue": (value: boolean) => any;
40
+ close: () => any;
41
+ download: () => any;
42
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
43
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
44
+ onClose?: (() => any) | undefined;
45
+ onDownload?: (() => any) | undefined;
46
+ }>, {
47
+ error: string | null;
48
+ loading: boolean;
49
+ filename: string;
50
+ chunks: DocumentPreviewChunk[];
51
+ hasOriginalFile: boolean;
52
+ sizeDrawer: string | number;
53
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
54
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
55
+ declare const _default: typeof __VLS_export;
56
+ export default _default;
57
+ type __VLS_WithSlots<T, S> = T & {
58
+ new (): {
59
+ $slots: S;
60
+ };
61
+ };
@@ -0,0 +1,53 @@
1
+ import { DocumentPreviewChunk } from './types';
2
+ type __VLS_Props = {
3
+ /** 文件名 */
4
+ filename: string;
5
+ /** MIME 类型 */
6
+ mimetype?: string;
7
+ /** 文件大小(字节) */
8
+ size?: number;
9
+ /** 文本分块 */
10
+ chunks?: DocumentPreviewChunk[];
11
+ /** 抽取方法 */
12
+ extractionMethod?: string;
13
+ /** 是否有原文件可下载 */
14
+ hasOriginalFile?: boolean;
15
+ /** PDF 预览 URL */
16
+ pdfUrl?: string;
17
+ /** Excel 预览 URL */
18
+ excelUrl?: string;
19
+ /** 加载中 */
20
+ loading?: boolean;
21
+ /** 错误信息 */
22
+ error?: string | null;
23
+ };
24
+ declare var __VLS_9: {
25
+ url: string | undefined;
26
+ }, __VLS_11: {
27
+ url: string | undefined;
28
+ };
29
+ type __VLS_Slots = {} & {
30
+ pdf?: (props: typeof __VLS_9) => any;
31
+ } & {
32
+ excel?: (props: typeof __VLS_11) => any;
33
+ };
34
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
35
+ close: () => any;
36
+ download: () => any;
37
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
38
+ onClose?: (() => any) | undefined;
39
+ onDownload?: (() => any) | undefined;
40
+ }>, {
41
+ error: string | null;
42
+ loading: boolean;
43
+ chunks: DocumentPreviewChunk[];
44
+ hasOriginalFile: boolean;
45
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
46
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
47
+ declare const _default: typeof __VLS_export;
48
+ export default _default;
49
+ type __VLS_WithSlots<T, S> = T & {
50
+ new (): {
51
+ $slots: S;
52
+ };
53
+ };
@@ -0,0 +1,3 @@
1
+ export { default as DocumentPreviewPanel } from './DocumentPreviewPanel.vue';
2
+ export { default as DocumentPreviewDrawer } from './DocumentPreviewDrawer.vue';
3
+ export type { DocumentPreviewChunk, DocumentPreviewPanelProps } from './types';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * DocumentPreview 相关类型
3
+ */
4
+ /** 文档分块 */
5
+ export interface DocumentPreviewChunk {
6
+ /** 块序号(可选) */
7
+ index?: number;
8
+ /** 块文本 */
9
+ text: string;
10
+ }
11
+ /** DocumentPreviewPanel 展示 props */
12
+ export interface DocumentPreviewPanelProps {
13
+ /** 文件名 */
14
+ filename: string;
15
+ /** MIME 类型 */
16
+ mimetype?: string;
17
+ /** 文件大小(字节) */
18
+ size?: number;
19
+ /** 文本分块 */
20
+ chunks?: DocumentPreviewChunk[];
21
+ /** 抽取方法 */
22
+ extractionMethod?: string;
23
+ /** 是否有原文件可下载 */
24
+ hasOriginalFile?: boolean;
25
+ /** PDF 预览 URL(提供时用 iframe/embed) */
26
+ pdfUrl?: string;
27
+ /** Excel 预览 URL(提供时用 iframe) */
28
+ excelUrl?: string;
29
+ /** 加载中 */
30
+ loading?: boolean;
31
+ /** 错误信息 */
32
+ error?: string | null;
33
+ }
@@ -7,12 +7,22 @@ type __VLS_Props = {
7
7
  title?: string;
8
8
  /** 描述文案 */
9
9
  description?: string;
10
+ /** 紧凑空态,减少留白 */
11
+ compact?: boolean;
12
+ /** 操作按钮文案(无 default slot 时显示) */
13
+ actionText?: string;
10
14
  };
11
15
  declare var __VLS_6: {};
12
16
  type __VLS_Slots = {} & {
13
17
  default?: (props: typeof __VLS_6) => any;
14
18
  };
15
- declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
19
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
20
+ action: () => any;
21
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onAction?: (() => any) | undefined;
23
+ }>, {
24
+ compact: boolean;
25
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
26
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
27
  declare const _default: typeof __VLS_export;
18
28
  export default _default;
@@ -5,3 +5,5 @@ export { useMessage } from './useMessage';
5
5
  export type { MessageApi } from './useMessage';
6
6
  export { useDebounceFn } from './useDebounceFn';
7
7
  export { useClientPagination } from './useClientPagination';
8
+ export { useDataLoading } from './useDataLoading';
9
+ export type { UseDataLoadingOptions, UseDataLoadingReturn } from './useDataLoading';
@@ -0,0 +1,30 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ /** useDataLoading 配置项 */
3
+ export interface UseDataLoadingOptions {
4
+ /** 超时时间(ms),超时后 timedOut 变为 true */
5
+ timeout?: number;
6
+ /** 是否静默处理错误(不设置 error ref) */
7
+ silentError?: boolean;
8
+ }
9
+ /** useDataLoading 返回值 */
10
+ export interface UseDataLoadingReturn {
11
+ /** 加载状态(直接用于 v-loading) */
12
+ loading: Ref<boolean>;
13
+ /** 错误信息 */
14
+ error: Ref<string | null>;
15
+ /** 是否超时 */
16
+ timedOut: Ref<boolean>;
17
+ /** 是否有错误 */
18
+ hasError: ComputedRef<boolean>;
19
+ /** 包装异步函数,自动管理 loading/error 状态 */
20
+ withLoading: <T>(fn: () => Promise<T>) => Promise<T | null>;
21
+ /** 重置状态 */
22
+ reset: () => void;
23
+ }
24
+ /**
25
+ * 创建数据加载状态管理器
26
+ *
27
+ * @param options - 超时与静默错误配置
28
+ * @returns loading / error / withLoading 等
29
+ */
30
+ export declare function useDataLoading(options?: UseDataLoadingOptions): UseDataLoadingReturn;
package/dist/index.d.ts CHANGED
@@ -38,6 +38,8 @@ export { JsonCard } from './components/JsonCard';
38
38
  export { JsonDetailDialog } from './components/JsonDetailDialog';
39
39
  export { SchemaLitePreview } from './components/SchemaLitePreview';
40
40
  export type { SchemaLiteField } from './components/SchemaLitePreview';
41
+ export { DocumentPreviewPanel, DocumentPreviewDrawer, } from './components/DocumentPreview';
42
+ export type { DocumentPreviewChunk, DocumentPreviewPanelProps, } from './components/DocumentPreview';
41
43
  export { MessageBubble } from './components/Chat/MessageBubble';
42
44
  export { MessageList } from './components/Chat/MessageList';
43
45
  export { Composer } from './components/Chat/Composer';
@@ -47,6 +49,10 @@ export { MessageParts, MessageAttachmentList, DocumentSummaryList, AttachmentPre
47
49
  export { SessionSidebar } from './components/Chat/SessionSidebar';
48
50
  export { ProcessingDrawer } from './components/Chat/ProcessingDrawer';
49
51
  export { ConversationHeader } from './components/Chat/ConversationHeader';
52
+ export { AssistantPicker } from './components/Chat/AssistantPicker';
53
+ export type { AssistantPickerItem } from './components/Chat/AssistantPicker';
54
+ export { ModelPicker } from './components/Chat/ModelPicker';
55
+ export type { ModelPickerItem } from './components/Chat/ModelPicker';
50
56
  export { useToast, provideToast } from './composables';
51
57
  export { useConfirm } from './composables';
52
58
  export type { ConfirmOptions } from './composables';
@@ -54,6 +60,8 @@ export { useMessage } from './composables';
54
60
  export type { MessageApi } from './composables';
55
61
  export { useDebounceFn } from './composables';
56
62
  export { useClientPagination } from './composables';
63
+ export { useDataLoading } from './composables';
64
+ export type { UseDataLoadingOptions, UseDataLoadingReturn } from './composables';
57
65
  export { ICON_MAP, APP_ICON_NAMES, isRegisteredAppIcon } from './utils';
58
66
  export type { AppIconName } from './utils';
59
67
  export { DEFAULT_PAGE_SIZE, PAGE_SIZE_OPTIONS, PAGINATION_LAYOUT } from './utils';
@@ -64,6 +72,6 @@ export { renderMarkdown, splitTextAndCodeBlocks } from './utils/textParser';
64
72
  export type { TextPart } from './utils/textParser';
65
73
  export { isImage, isPdf, isOffice, isPreviewable, fileKind, formatSize } from './utils/attachmentKind';
66
74
  export { COLORS, TEXT_COLORS, SPACING, BORDER_RADIUS, SHADOWS, DURATION, Z_INDEX, FONT_SIZE, CONTROL_HEIGHT, LAYOUT_HEIGHT, ICON_SIZE, PAGE, FORM, AVATAR_SIZE, } from './tokens';
67
- export declare const SCHEMA_UI_VERSION = "1.2.0";
75
+ export declare const SCHEMA_UI_VERSION = "1.4.0";
68
76
  export declare const EP_FORK_BASE = "2.14.2";
69
77
  export declare const EP_FORK_DATE = "2026-08-27";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apform-ui/core",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "author": "yangdongnan",
6
6
  "license": "MIT",
@@ -35,6 +35,7 @@
35
35
  },
36
36
  "./tokens.css": "./src/tokens/tokens.css",
37
37
  "./design-tokens.css": "./src/tokens/design-tokens.css",
38
+ "./style.css": "./dist/apform-ui.css",
38
39
  "./styles/element-override.css": "./styles/element-override.css",
39
40
  "./theme/*": "./src/theme/*",
40
41
  "./styles/*": "./styles/*"