@apform-ui/core 1.1.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.
Files changed (122) hide show
  1. package/README.md +5 -0
  2. package/dist/__tests__/components.spec.d.ts +1 -0
  3. package/dist/apform-ui.css +1 -1
  4. package/dist/apform-ui.js +4141 -2635
  5. package/dist/apform-ui.umd.cjs +61 -57
  6. package/dist/components/AppDialog/AppDialog.vue.d.ts +48 -0
  7. package/dist/components/AppDialog/index.d.ts +1 -0
  8. package/dist/components/AppIcon/AppIcon.vue.d.ts +11 -0
  9. package/dist/components/AppIcon/index.d.ts +1 -0
  10. package/dist/components/AppPagination/AppPagination.vue.d.ts +26 -0
  11. package/dist/components/AppPagination/index.d.ts +1 -0
  12. package/dist/components/CardGridSkeleton/CardGridSkeleton.vue.d.ts +34 -0
  13. package/dist/components/CardGridSkeleton/index.d.ts +1 -0
  14. package/dist/components/CardTable/CardTable.vue.d.ts +28 -0
  15. package/dist/components/CardTable/index.d.ts +1 -0
  16. package/dist/components/Chat/ApprovalCard/ApprovalCard.vue.d.ts +12 -0
  17. package/dist/components/Chat/ApprovalCard/index.d.ts +1 -0
  18. package/dist/components/Chat/AssistantPicker/AssistantPicker.vue.d.ts +23 -0
  19. package/dist/components/Chat/AssistantPicker/index.d.ts +2 -0
  20. package/dist/components/Chat/AssistantPicker/types.d.ts +9 -0
  21. package/dist/components/Chat/Composer/Composer.vue.d.ts +32 -0
  22. package/dist/components/Chat/Composer/index.d.ts +1 -0
  23. package/dist/components/Chat/ConversationHeader/ConversationHeader.vue.d.ts +21 -0
  24. package/dist/components/Chat/ConversationHeader/index.d.ts +1 -0
  25. package/dist/components/Chat/MessageBubble/MessageBubble.vue.d.ts +23 -0
  26. package/dist/components/Chat/MessageBubble/index.d.ts +1 -0
  27. package/dist/components/Chat/MessageList/MessageList.vue.d.ts +24 -0
  28. package/dist/components/Chat/MessageList/index.d.ts +1 -0
  29. package/dist/components/Chat/ModelPicker/ModelPicker.vue.d.ts +16 -0
  30. package/dist/components/Chat/ModelPicker/index.d.ts +2 -0
  31. package/dist/components/Chat/ModelPicker/types.d.ts +6 -0
  32. package/dist/components/Chat/ProcessingDrawer/ProcessingDrawer.vue.d.ts +32 -0
  33. package/dist/components/Chat/ProcessingDrawer/index.d.ts +1 -0
  34. package/dist/components/Chat/RunStatusBar/RunStatusBar.vue.d.ts +12 -0
  35. package/dist/components/Chat/RunStatusBar/index.d.ts +1 -0
  36. package/dist/components/Chat/SessionSidebar/SessionSidebar.vue.d.ts +18 -0
  37. package/dist/components/Chat/SessionSidebar/index.d.ts +1 -0
  38. package/dist/components/Chat/message/AttachmentPreviewModal.vue.d.ts +18 -0
  39. package/dist/components/Chat/message/DocumentSummaryList.vue.d.ts +12 -0
  40. package/dist/components/Chat/message/MessageAttachmentList.vue.d.ts +11 -0
  41. package/dist/components/Chat/message/MessageParts.vue.d.ts +6 -0
  42. package/dist/components/Chat/message/index.d.ts +4 -0
  43. package/dist/components/ConfirmDialog/ConfirmDialog.vue.d.ts +26 -0
  44. package/dist/components/ConfirmDialog/index.d.ts +1 -0
  45. package/dist/components/ContentPanel/ContentPanel.vue.d.ts +31 -0
  46. package/dist/components/ContentPanel/index.d.ts +1 -0
  47. package/dist/components/DocumentPreview/DocumentPreviewDrawer.vue.d.ts +61 -0
  48. package/dist/components/DocumentPreview/DocumentPreviewPanel.vue.d.ts +53 -0
  49. package/dist/components/DocumentPreview/index.d.ts +3 -0
  50. package/dist/components/DocumentPreview/types.d.ts +33 -0
  51. package/dist/components/EmptyState/EmptyState.vue.d.ts +33 -0
  52. package/dist/components/EmptyState/index.d.ts +1 -0
  53. package/dist/components/ErrorBoundary/ErrorBoundary.vue.d.ts +39 -0
  54. package/dist/components/ErrorBoundary/index.d.ts +1 -0
  55. package/dist/components/FieldRow/FieldRow.vue.d.ts +23 -0
  56. package/dist/components/FieldRow/index.d.ts +1 -0
  57. package/dist/components/FilterBar/FilterBar.vue.d.ts +30 -0
  58. package/dist/components/FilterBar/index.d.ts +1 -0
  59. package/dist/components/FilterTabs/FilterTabs.vue.d.ts +21 -0
  60. package/dist/components/FilterTabs/index.d.ts +1 -0
  61. package/dist/components/FormDialog/FormDialog.vue.d.ts +44 -0
  62. package/dist/components/FormDialog/index.d.ts +1 -0
  63. package/dist/components/HintText/HintText.vue.d.ts +19 -0
  64. package/dist/components/HintText/index.d.ts +1 -0
  65. package/dist/components/JsonCard/JsonCard.vue.d.ts +20 -0
  66. package/dist/components/JsonCard/index.d.ts +1 -0
  67. package/dist/components/JsonDetailDialog/JsonDetailDialog.vue.d.ts +13 -0
  68. package/dist/components/JsonDetailDialog/index.d.ts +1 -0
  69. package/dist/components/LoadingDots/LoadingDots.vue.d.ts +10 -0
  70. package/dist/components/LoadingDots/index.d.ts +1 -0
  71. package/dist/components/PageHeader/PageHeader.vue.d.ts +28 -0
  72. package/dist/components/PageHeader/index.d.ts +1 -0
  73. package/dist/components/PageShell/PageShell.vue.d.ts +25 -0
  74. package/dist/components/PageShell/index.d.ts +1 -0
  75. package/dist/components/SchemaLitePreview/SchemaLitePreview.vue.d.ts +30 -0
  76. package/dist/components/SchemaLitePreview/index.d.ts +2 -0
  77. package/dist/components/SearchForm/SearchForm.vue.d.ts +39 -0
  78. package/dist/components/SearchForm/index.d.ts +2 -0
  79. package/dist/components/SectionToggle/SectionToggle.vue.d.ts +20 -0
  80. package/dist/components/SectionToggle/index.d.ts +1 -0
  81. package/dist/components/Skeleton/Skeleton.vue.d.ts +29 -0
  82. package/dist/components/Skeleton/index.d.ts +1 -0
  83. package/dist/components/StatusTag/StatusTag.vue.d.ts +21 -0
  84. package/dist/components/StatusTag/index.d.ts +2 -0
  85. package/dist/components/TableRowActions/TableRowActions.vue.d.ts +23 -0
  86. package/dist/components/TableRowActions/index.d.ts +2 -0
  87. package/dist/components/Toast/Toast.vue.d.ts +12 -0
  88. package/dist/components/Toast/index.d.ts +2 -0
  89. package/dist/components/TruncatedTooltipText/TruncatedTooltipText.vue.d.ts +22 -0
  90. package/dist/components/TruncatedTooltipText/index.d.ts +1 -0
  91. package/dist/components/UserAvatar/UserAvatar.vue.d.ts +26 -0
  92. package/dist/components/UserAvatar/index.d.ts +1 -0
  93. package/dist/composables/index.d.ts +9 -0
  94. package/dist/composables/useClientPagination.d.ts +15 -0
  95. package/dist/composables/useConfirm.d.ts +15 -0
  96. package/dist/composables/useDataLoading.d.ts +30 -0
  97. package/dist/composables/useDebounceFn.d.ts +1 -0
  98. package/dist/composables/useMessage.d.ts +8 -0
  99. package/dist/composables/useToast.d.ts +17 -0
  100. package/dist/index.d.ts +77 -0
  101. package/dist/stories/AppDialog.stories.d.ts +9 -0
  102. package/dist/stories/AppIcon.stories.d.ts +9 -0
  103. package/dist/stories/ApprovalCard.stories.d.ts +8 -0
  104. package/dist/stories/Composer.stories.d.ts +9 -0
  105. package/dist/stories/MessageBubble.stories.d.ts +10 -0
  106. package/dist/stories/RunStatusBar.stories.d.ts +8 -0
  107. package/dist/stories/StatusTag.stories.d.ts +8 -0
  108. package/dist/stories/useConfirm.stories.d.ts +5 -0
  109. package/dist/stories/useMessage.stories.d.ts +5 -0
  110. package/dist/tokens/index.d.ts +139 -0
  111. package/dist/types/chat.d.ts +121 -0
  112. package/dist/types/index.d.ts +1 -0
  113. package/dist/utils/attachmentKind.d.ts +7 -0
  114. package/dist/utils/iconRegistry.d.ts +7 -0
  115. package/dist/utils/index.d.ts +6 -0
  116. package/dist/utils/pagination.d.ts +8 -0
  117. package/dist/utils/resolveApiErrorMessage.d.ts +22 -0
  118. package/dist/utils/textParser.d.ts +20 -0
  119. package/package.json +3 -1
  120. package/src/tokens/index.ts +78 -0
  121. package/src/tokens/tokens.css +74 -5
  122. package/styles/element-override.css +155 -0
@@ -0,0 +1,12 @@
1
+ export interface ToastItem {
2
+ id: number;
3
+ message: string;
4
+ type: 'info' | 'success' | 'error' | 'warning';
5
+ removing?: boolean;
6
+ }
7
+ declare function showToast(message: string, type?: ToastItem['type'], duration?: number): void;
8
+ declare const __VLS_export: import('vue').DefineComponent<{}, {
9
+ show: typeof showToast;
10
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as Toast } from './Toast.vue';
2
+ export type { ToastItem } from './Toast.vue';
@@ -0,0 +1,22 @@
1
+ type __VLS_Props = {
2
+ /** tooltip 完整内容 */
3
+ content: string;
4
+ placement?: 'top' | 'bottom' | 'left' | 'right';
5
+ maxWidth?: number;
6
+ };
7
+ declare var __VLS_8: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_8) => any;
10
+ };
11
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
12
+ placement: "top" | "bottom" | "left" | "right";
13
+ maxWidth: number;
14
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1 @@
1
+ export { default as TruncatedTooltipText } from './TruncatedTooltipText.vue';
@@ -0,0 +1,26 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import('vue').DefineComponent<{
4
+ /** 用户名(取首字母作为 fallback) */
5
+ name?: string;
6
+ /** 头像图片 URL */
7
+ src?: string;
8
+ /** 尺寸(px,默认 32 = `--avatar-size-md`) */
9
+ size?: number;
10
+ /** 形状(默认 'circle') */
11
+ shape?: "circle" | "square";
12
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
13
+ /** 用户名(取首字母作为 fallback) */
14
+ name?: string;
15
+ /** 头像图片 URL */
16
+ src?: string;
17
+ /** 尺寸(px,默认 32 = `--avatar-size-md`) */
18
+ size?: number;
19
+ /** 形状(默认 'circle') */
20
+ shape?: "circle" | "square";
21
+ }> & Readonly<{}>, {
22
+ name: string;
23
+ size: number;
24
+ src: string;
25
+ shape: "circle" | "square";
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1 @@
1
+ export { default as UserAvatar } from './UserAvatar.vue';
@@ -0,0 +1,9 @@
1
+ export { useToast, provideToast } from './useToast';
2
+ export { useConfirm } from './useConfirm';
3
+ export type { ConfirmOptions } from './useConfirm';
4
+ export { useMessage } from './useMessage';
5
+ export type { MessageApi } from './useMessage';
6
+ export { useDebounceFn } from './useDebounceFn';
7
+ export { useClientPagination } from './useClientPagination';
8
+ export { useDataLoading } from './useDataLoading';
9
+ export type { UseDataLoadingOptions, UseDataLoadingReturn } from './useDataLoading';
@@ -0,0 +1,15 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ /**
3
+ * @param source - 完整列表(可为 computed)
4
+ * @param options - initialPageSize / resetOn 依赖变化时重置到第 1 页
5
+ */
6
+ export declare function useClientPagination<T>(source: Ref<T[]> | ComputedRef<T[]>, options?: {
7
+ initialPageSize?: number;
8
+ resetOn?: Array<Ref<unknown> | ComputedRef<unknown>>;
9
+ }): {
10
+ currentPage: Ref<number, number>;
11
+ pageSize: Ref<number, number>;
12
+ pagedItems: ComputedRef<T[]>;
13
+ total: ComputedRef<number>;
14
+ resetPage: () => void;
15
+ };
@@ -0,0 +1,15 @@
1
+ export interface ConfirmOptions {
2
+ /** 标题(默认 '确认操作') */
3
+ title?: string;
4
+ /** 类型(默认 'warning') */
5
+ type?: 'info' | 'warning' | 'danger' | 'success';
6
+ /** 确认按钮文案(默认 '确定') */
7
+ confirmButtonText?: string;
8
+ /** 取消按钮文案(默认 '取消') */
9
+ cancelButtonText?: string;
10
+ }
11
+ export declare function useConfirm(): {
12
+ confirm: (message: string, options?: ConfirmOptions) => Promise<boolean>;
13
+ confirmDelete: (target: string, options?: Omit<ConfirmOptions, "type">) => Promise<boolean>;
14
+ confirmDanger: (message: string, options?: Omit<ConfirmOptions, "type">) => Promise<boolean>;
15
+ };
@@ -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;
@@ -0,0 +1 @@
1
+ export declare function useDebounceFn<T extends (...args: unknown[]) => unknown>(fn: T, delay?: number): (...args: Parameters<T>) => void;
@@ -0,0 +1,8 @@
1
+ import { MessageOptions } from 'element-plus';
2
+ export interface MessageApi {
3
+ success(message: string, options?: Partial<MessageOptions>): void;
4
+ error(message: string, options?: Partial<MessageOptions>): void;
5
+ warning(message: string, options?: Partial<MessageOptions>): void;
6
+ info(message: string, options?: Partial<MessageOptions>): void;
7
+ }
8
+ export declare function useMessage(): MessageApi;
@@ -0,0 +1,17 @@
1
+ import { Ref } from 'vue';
2
+ import { ToastItem } from '../components/Toast/Toast.vue';
3
+ interface ToastExpose {
4
+ show: (message: string, type?: ToastItem['type'], duration?: number) => void;
5
+ }
6
+ declare const TOAST_KEY: unique symbol;
7
+ export declare function provideToast(ref: Ref<ToastExpose | undefined>): {
8
+ [TOAST_KEY]: Ref<ToastExpose | undefined, ToastExpose | undefined>;
9
+ };
10
+ export declare function useToast(): {
11
+ show(message: string, type?: ToastItem["type"], duration?: number): void;
12
+ info(message: string, duration?: number): void;
13
+ success(message: string, duration?: number): void;
14
+ warning(message: string, duration?: number): void;
15
+ error(message: string, duration?: number): void;
16
+ };
17
+ export {};
@@ -0,0 +1,77 @@
1
+ /**
2
+ * @apform-ui/core — Apform UI 企业级 Vue 3 UI 组件库(基于 Element Plus 2.14.2 fork)
3
+ *
4
+ * Fork 基准版本:Element Plus 2.14.2
5
+ * Fork 日期:2026-08-27
6
+ */
7
+ export * from './types';
8
+ export { AppDialog } from './components/AppDialog';
9
+ export { AppIcon } from './components/AppIcon';
10
+ export { AppPagination } from './components/AppPagination';
11
+ export { ConfirmDialog } from './components/ConfirmDialog';
12
+ export { FormDialog } from './components/FormDialog';
13
+ export { FilterTabs } from './components/FilterTabs';
14
+ export { Toast } from './components/Toast';
15
+ export type { ToastItem } from './components/Toast';
16
+ export { EmptyState } from './components/EmptyState';
17
+ export { ErrorBoundary } from './components/ErrorBoundary';
18
+ export { StatusTag } from './components/StatusTag';
19
+ export type { StatusConfig } from './components/StatusTag';
20
+ export { Skeleton } from './components/Skeleton';
21
+ export { CardGridSkeleton } from './components/CardGridSkeleton';
22
+ export { UserAvatar } from './components/UserAvatar';
23
+ export { PageShell } from './components/PageShell';
24
+ export { PageHeader } from './components/PageHeader';
25
+ export { ContentPanel } from './components/ContentPanel';
26
+ export { FilterBar } from './components/FilterBar';
27
+ export { CardTable } from './components/CardTable';
28
+ export { TableRowActions } from './components/TableRowActions';
29
+ export type { TableRowAction } from './components/TableRowActions';
30
+ export { SearchForm } from './components/SearchForm';
31
+ export type { SearchFieldConfig } from './components/SearchForm';
32
+ export { FieldRow } from './components/FieldRow';
33
+ export { HintText } from './components/HintText';
34
+ export { SectionToggle } from './components/SectionToggle';
35
+ export { TruncatedTooltipText } from './components/TruncatedTooltipText';
36
+ export { LoadingDots } from './components/LoadingDots';
37
+ export { JsonCard } from './components/JsonCard';
38
+ export { JsonDetailDialog } from './components/JsonDetailDialog';
39
+ export { SchemaLitePreview } from './components/SchemaLitePreview';
40
+ export type { SchemaLiteField } from './components/SchemaLitePreview';
41
+ export { DocumentPreviewPanel, DocumentPreviewDrawer, } from './components/DocumentPreview';
42
+ export type { DocumentPreviewChunk, DocumentPreviewPanelProps, } from './components/DocumentPreview';
43
+ export { MessageBubble } from './components/Chat/MessageBubble';
44
+ export { MessageList } from './components/Chat/MessageList';
45
+ export { Composer } from './components/Chat/Composer';
46
+ export { RunStatusBar } from './components/Chat/RunStatusBar';
47
+ export { ApprovalCard } from './components/Chat/ApprovalCard';
48
+ export { MessageParts, MessageAttachmentList, DocumentSummaryList, AttachmentPreviewModal, } from './components/Chat/message';
49
+ export { SessionSidebar } from './components/Chat/SessionSidebar';
50
+ export { ProcessingDrawer } from './components/Chat/ProcessingDrawer';
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';
56
+ export { useToast, provideToast } from './composables';
57
+ export { useConfirm } from './composables';
58
+ export type { ConfirmOptions } from './composables';
59
+ export { useMessage } from './composables';
60
+ export type { MessageApi } from './composables';
61
+ export { useDebounceFn } from './composables';
62
+ export { useClientPagination } from './composables';
63
+ export { useDataLoading } from './composables';
64
+ export type { UseDataLoadingOptions, UseDataLoadingReturn } from './composables';
65
+ export { ICON_MAP, APP_ICON_NAMES, isRegisteredAppIcon } from './utils';
66
+ export type { AppIconName } from './utils';
67
+ export { DEFAULT_PAGE_SIZE, PAGE_SIZE_OPTIONS, PAGINATION_LAYOUT } from './utils';
68
+ export type { PageSizeOption } from './utils';
69
+ export { resolveApiErrorMessage } from './utils';
70
+ export type { ApiError } from './utils';
71
+ export { renderMarkdown, splitTextAndCodeBlocks } from './utils/textParser';
72
+ export type { TextPart } from './utils/textParser';
73
+ export { isImage, isPdf, isOffice, isPreviewable, fileKind, formatSize } from './utils/attachmentKind';
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';
75
+ export declare const SCHEMA_UI_VERSION = "1.4.0";
76
+ export declare const EP_FORK_BASE = "2.14.2";
77
+ export declare const EP_FORK_DATE = "2026-08-27";
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3';
2
+ import { default as AppDialog } from '../components/AppDialog/AppDialog.vue';
3
+ declare const meta: Meta<typeof AppDialog>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof AppDialog>;
6
+ export declare const Basic: Story;
7
+ export declare const Fullscreen: Story;
8
+ export declare const CustomButtons: Story;
9
+ export declare const Loading: Story;
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3';
2
+ import { default as AppIcon } from '../components/AppIcon/AppIcon.vue';
3
+ declare const meta: Meta<typeof AppIcon>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof AppIcon>;
6
+ export declare const Basic: Story;
7
+ export declare const Sizes: Story;
8
+ export declare const Colors: Story;
9
+ export declare const AllIcons: Story;
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3';
2
+ import { default as ApprovalCard } from '../components/Chat/ApprovalCard/ApprovalCard.vue';
3
+ declare const meta: Meta<typeof ApprovalCard>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ApprovalCard>;
6
+ export declare const Basic: Story;
7
+ export declare const Dangerous: Story;
8
+ export declare const WithFields: Story;
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3';
2
+ import { default as Composer } from '../components/Chat/Composer/Composer.vue';
3
+ declare const meta: Meta<typeof Composer>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Composer>;
6
+ export declare const Basic: Story;
7
+ export declare const WithFileUpload: Story;
8
+ export declare const Disabled: Story;
9
+ export declare const WithWebSocketStatus: Story;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3';
2
+ import { default as MessageBubble } from '../components/Chat/MessageBubble/MessageBubble.vue';
3
+ declare const meta: Meta<typeof MessageBubble>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MessageBubble>;
6
+ export declare const UserMessage: Story;
7
+ export declare const AssistantMessage: Story;
8
+ export declare const WithThinking: Story;
9
+ export declare const Failed: Story;
10
+ export declare const WaitingInput: Story;
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3';
2
+ import { default as RunStatusBar } from '../components/Chat/RunStatusBar/RunStatusBar.vue';
3
+ declare const meta: Meta<typeof RunStatusBar>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof RunStatusBar>;
6
+ export declare const Running: Story;
7
+ export declare const Completed: Story;
8
+ export declare const Failed: Story;
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3';
2
+ import { default as StatusTag } from '../components/StatusTag/StatusTag.vue';
3
+ declare const meta: Meta<typeof StatusTag>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof StatusTag>;
6
+ export declare const AllStatuses: Story;
7
+ export declare const Sizes: Story;
8
+ export declare const CustomStatus: Story;
@@ -0,0 +1,5 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj;
5
+ export declare const Basic: Story;
@@ -0,0 +1,5 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj;
5
+ export declare const Basic: Story;
@@ -0,0 +1,139 @@
1
+ /**
2
+ * @apform-ui/core 设计令牌
3
+ *
4
+ * CSS 变量通过 import './tokens.css' 和 './design-tokens.css' 引入
5
+ * 此文件导出令牌常量供 JS/TS 使用
6
+ */
7
+ /** 主色 */
8
+ export declare const COLORS: {
9
+ readonly primary: "#0060A2";
10
+ readonly primaryHover: "#4581E9";
11
+ readonly primaryLight: "#4581E9";
12
+ readonly primaryLighter: "#EEF5FF";
13
+ readonly primaryDark: "#0060A2";
14
+ readonly success: "#26A036";
15
+ readonly warning: "#F09700";
16
+ readonly danger: "#E50113";
17
+ readonly info: "#4581E9";
18
+ };
19
+ /** 文字色 */
20
+ export declare const TEXT_COLORS: {
21
+ readonly title: "#303133";
22
+ readonly primary: "#333333";
23
+ readonly regular: "#606266";
24
+ readonly secondary: "#666666";
25
+ readonly muted: "#909399";
26
+ readonly placeholder: "#969FA8";
27
+ readonly disabled: "#C0C4CC";
28
+ readonly inverse: "#FFFFFF";
29
+ };
30
+ /** 字号(与 CSS --font-size-* 对齐) */
31
+ export declare const FONT_SIZE: {
32
+ readonly 10: "10px";
33
+ readonly 11: "11px";
34
+ readonly 12: "12px";
35
+ readonly 13: "13px";
36
+ readonly 14: "14px";
37
+ readonly 15: "15px";
38
+ readonly 16: "16px";
39
+ readonly 18: "18px";
40
+ readonly 20: "20px";
41
+ readonly 22: "22px";
42
+ readonly 24: "24px";
43
+ readonly 28: "28px";
44
+ };
45
+ /** 间距 */
46
+ export declare const SPACING: {
47
+ readonly xs: "4px";
48
+ readonly sm: "8px";
49
+ readonly md: "16px";
50
+ readonly lg: "24px";
51
+ readonly xl: "32px";
52
+ readonly '2xl': "48px";
53
+ readonly '3xl': "64px";
54
+ readonly 10: "10px";
55
+ readonly 12: "12px";
56
+ readonly 20: "20px";
57
+ };
58
+ /**
59
+ * 控件高度阶梯
60
+ * 全仓统计:32 > 28 > 24 > 40/44/48/60
61
+ */
62
+ export declare const CONTROL_HEIGHT: {
63
+ readonly xs: "24px";
64
+ readonly sm: "28px";
65
+ readonly md: "32px";
66
+ readonly lg: "40px";
67
+ readonly xl: "44px";
68
+ };
69
+ /** 布局高度 */
70
+ export declare const LAYOUT_HEIGHT: {
71
+ readonly header: "56px";
72
+ readonly conversationHeader: "68px";
73
+ readonly dialogFooter: "60px";
74
+ readonly toolbar: "48px";
75
+ readonly tabs: "40px";
76
+ readonly listRow: "48px";
77
+ };
78
+ /** 图标尺寸 */
79
+ export declare const ICON_SIZE: {
80
+ readonly xs: "12px";
81
+ readonly sm: "14px";
82
+ readonly md: "16px";
83
+ readonly lg: "20px";
84
+ readonly xl: "24px";
85
+ };
86
+ /** 页面边距 */
87
+ export declare const PAGE: {
88
+ readonly paddingX: "24px";
89
+ readonly paddingY: "24px";
90
+ readonly headerPaddingTop: "28px";
91
+ readonly sidebarWidth: "240px";
92
+ readonly sidebarWidthCollapsed: "64px";
93
+ };
94
+ /** 圆角 */
95
+ export declare const BORDER_RADIUS: {
96
+ readonly sm: "2px";
97
+ readonly md: "4px";
98
+ readonly 6: "6px";
99
+ readonly 8: "8px";
100
+ readonly lg: "10px";
101
+ readonly xl: "12px";
102
+ readonly full: "999px";
103
+ };
104
+ /** 表单布局 */
105
+ export declare const FORM: {
106
+ readonly fieldWidth: "220px";
107
+ readonly labelWidth: "96px";
108
+ readonly fieldGap: "6px";
109
+ };
110
+ /** 头像尺寸 */
111
+ export declare const AVATAR_SIZE: {
112
+ readonly sm: "24px";
113
+ readonly md: "32px";
114
+ readonly lg: "40px";
115
+ readonly xl: "48px";
116
+ };
117
+ /** 阴影 */
118
+ export declare const SHADOWS: {
119
+ readonly sm: "0 1px 2px rgba(0, 0, 0, 0.05)";
120
+ readonly md: "0 4px 12px rgba(0, 0, 0, 0.08)";
121
+ readonly lg: "0 8px 24px rgba(0, 0, 0, 0.12)";
122
+ };
123
+ /** 动画时长 */
124
+ export declare const DURATION: {
125
+ readonly fast: "0.15s";
126
+ readonly normal: "0.25s";
127
+ readonly slow: "0.35s";
128
+ };
129
+ /** Z-Index 层级 */
130
+ export declare const Z_INDEX: {
131
+ readonly dropdown: 1000;
132
+ readonly sticky: 1020;
133
+ readonly fixed: 1030;
134
+ readonly modalBackdrop: 1040;
135
+ readonly modal: 1050;
136
+ readonly popover: 1060;
137
+ readonly tooltip: 1070;
138
+ readonly toast: 1080;
139
+ };
@@ -0,0 +1,121 @@
1
+ /**
2
+ * @apform-ui/core — 对话组件类型定义
3
+ *
4
+ * 从 workflow-agent-chat 和 ai/app 项目提取的通用类型。
5
+ * 去除了业务特定的 store 依赖,保留纯数据结构。
6
+ */
7
+ export type MessageRole = 'user' | 'assistant' | 'system';
8
+ export type MessageStatus = 'PENDING' | 'RUNNING' | 'WAITING_INPUT' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
9
+ export interface Message {
10
+ id: string;
11
+ role: MessageRole;
12
+ content: string;
13
+ status: MessageStatus;
14
+ createdAt: string;
15
+ thinking?: string;
16
+ tip?: string;
17
+ toolCalls?: ToolCallInfo[];
18
+ documentSummaries?: MessageDocumentSummary[];
19
+ workflowExecution?: WorkflowExecution;
20
+ attachments?: MessageAttachment[];
21
+ runtimeExecutionId?: string | null;
22
+ }
23
+ export interface MessageAttachment {
24
+ id: string;
25
+ filename: string;
26
+ mimetype: string;
27
+ size?: number;
28
+ excerpt?: string | null;
29
+ url?: string;
30
+ createdAt?: string;
31
+ }
32
+ export interface ToolCallInfo {
33
+ id?: string;
34
+ name: string;
35
+ arguments: Record<string, unknown>;
36
+ result?: unknown;
37
+ error?: string;
38
+ }
39
+ export interface MessageDocumentSummary {
40
+ documentId: string;
41
+ filename: string;
42
+ summary: string;
43
+ pageCount?: number;
44
+ }
45
+ export interface WorkflowExecution {
46
+ executionId: string;
47
+ workflowId: string;
48
+ workflowName: string;
49
+ status: string;
50
+ nodeRecords?: WorkflowNodeRecord[];
51
+ durationMs?: number;
52
+ error?: string;
53
+ }
54
+ export interface WorkflowNodeRecord {
55
+ nodeId: string;
56
+ nodeName: string;
57
+ nodeType: string;
58
+ status: string;
59
+ startedAt?: string;
60
+ finishedAt?: string;
61
+ durationMs?: number;
62
+ }
63
+ export type RunStatus = 'RUNNING' | 'COMPLETED' | 'FAILED' | 'WAITING_INPUT' | 'CANCELLED';
64
+ export interface RunStatusView {
65
+ runId: string;
66
+ sessionId: string;
67
+ agentId: string;
68
+ runtimeExecutionId: string | null;
69
+ status: RunStatus;
70
+ errorMessage: string | null;
71
+ waiting: WaitingPayload | null;
72
+ startedAt: string;
73
+ finishedAt: string | null;
74
+ }
75
+ export interface WaitingPayload {
76
+ prompt: string;
77
+ fields: WaitingField[];
78
+ actions: WaitingAction[];
79
+ dangerous: boolean;
80
+ }
81
+ export interface WaitingField {
82
+ key: string;
83
+ label: string;
84
+ type: string;
85
+ options: string[];
86
+ }
87
+ export interface WaitingAction {
88
+ action: string;
89
+ label: string;
90
+ style: string;
91
+ }
92
+ export interface Session {
93
+ id: string;
94
+ title: string;
95
+ agentId?: string | null;
96
+ agentName?: string | null;
97
+ status: string;
98
+ createdAt: string;
99
+ updatedAt: string;
100
+ }
101
+ export interface Agent {
102
+ id: string;
103
+ slug: string;
104
+ name: string;
105
+ description: string;
106
+ icon: string;
107
+ supportedInputs: string[];
108
+ hitlCapable: boolean;
109
+ version: string;
110
+ updatedAt: string;
111
+ published: boolean;
112
+ }
113
+ export interface PendingAttachment {
114
+ id: string;
115
+ filename: string;
116
+ mimetype: string;
117
+ size: number;
118
+ status: 'uploading' | 'done' | 'error';
119
+ error?: string;
120
+ previewUrl?: string;
121
+ }
@@ -0,0 +1 @@
1
+ export * from './chat';
@@ -0,0 +1,7 @@
1
+ import { MessageAttachment } from '../types';
2
+ export declare function isImage(att: MessageAttachment): boolean;
3
+ export declare function isPdf(att: MessageAttachment): boolean;
4
+ export declare function isOffice(att: MessageAttachment): boolean;
5
+ export declare function isPreviewable(att: MessageAttachment): boolean;
6
+ export declare function fileKind(att: MessageAttachment): string;
7
+ export declare function formatSize(size?: number): string;
@@ -0,0 +1,7 @@
1
+ import { IconifyIcon } from '@iconify/vue';
2
+ /** 图标名称 → Iconify 图标对象映射(AppIcon 唯一合法来源) */
3
+ export declare const ICON_MAP: Record<string, IconifyIcon>;
4
+ /** 已注册图标名称列表(kebab-case) */
5
+ export declare const APP_ICON_NAMES: readonly string[];
6
+ export type AppIconName = keyof typeof ICON_MAP;
7
+ export declare function isRegisteredAppIcon(name: string): name is AppIconName;
@@ -0,0 +1,6 @@
1
+ export { ICON_MAP, APP_ICON_NAMES, isRegisteredAppIcon } from './iconRegistry';
2
+ export type { AppIconName } from './iconRegistry';
3
+ export { DEFAULT_PAGE_SIZE, PAGE_SIZE_OPTIONS, PAGINATION_LAYOUT } from './pagination';
4
+ export type { PageSizeOption } from './pagination';
5
+ export { resolveApiErrorMessage } from './resolveApiErrorMessage';
6
+ export type { ApiError } from './resolveApiErrorMessage';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @apform-ui/core 分页统一常量
3
+ */
4
+ export declare const DEFAULT_PAGE_SIZE = 10;
5
+ export declare const PAGE_SIZE_OPTIONS: readonly [10, 20, 50];
6
+ export type PageSizeOption = (typeof PAGE_SIZE_OPTIONS)[number];
7
+ /** Element Plus pagination 统一 layout */
8
+ export declare const PAGINATION_LAYOUT = "total, sizes, prev, pager, next";