@baishuyun/chat-sdk 0.0.15 → 0.0.16
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/CHANGELOG.md +6 -0
- package/dist/chat-sdk.js +2555 -2537
- package/dist/chat-sdk.js.map +1 -1
- package/dist/chat-sdk.umd.cjs +79 -79
- package/dist/chat-sdk.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/components/bs-ui/previewer-header.tsx +3 -0
- package/src/stories/PreviewerHeader.stories.tsx +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/chat-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.jsx",
|
|
6
6
|
"module": "dist/chat-sdk.js",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"tailwindcss": "^4.1.17",
|
|
52
52
|
"vite": "^5.1.4",
|
|
53
53
|
"vite-plugin-dts": "^4.5.4",
|
|
54
|
-
"@baishuyun/
|
|
55
|
-
"@baishuyun/
|
|
54
|
+
"@baishuyun/typescript-config": "0.0.15",
|
|
55
|
+
"@baishuyun/types": "1.0.15"
|
|
56
56
|
},
|
|
57
57
|
"exports": {
|
|
58
58
|
".": {
|
|
@@ -4,6 +4,7 @@ import { IconBtn } from './icon-btn';
|
|
|
4
4
|
import { BackIcon, InfoIcon } from './bs-icons';
|
|
5
5
|
import { LinearGradientColorBgAnimation } from './linear-gradient-color-bg-animation';
|
|
6
6
|
import { ConfirmDialog } from './confirm-dialog';
|
|
7
|
+
import { Spinner } from '../ui/spinner';
|
|
7
8
|
|
|
8
9
|
export interface PreviewerHeaderProps {
|
|
9
10
|
title: string;
|
|
@@ -89,6 +90,7 @@ export const PreviewerHeader = ({
|
|
|
89
90
|
}}
|
|
90
91
|
className={classNames(
|
|
91
92
|
btnResetStyle,
|
|
93
|
+
'flex items-center gap-[6px]',
|
|
92
94
|
'bg-[#0265FF] hover:opacity-90 text-white text-[14px]',
|
|
93
95
|
{
|
|
94
96
|
'w-[115px]': isData,
|
|
@@ -96,6 +98,7 @@ export const PreviewerHeader = ({
|
|
|
96
98
|
}
|
|
97
99
|
)}
|
|
98
100
|
>
|
|
101
|
+
{loading ? <Spinner /> : null}
|
|
99
102
|
{isFields ? '保存' : '添加到表单'}
|
|
100
103
|
</button>
|
|
101
104
|
)}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import { PreviewerHeader } from '@/components/bs-ui/previewer-header';
|
|
3
3
|
|
|
4
|
+
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
5
|
+
|
|
4
6
|
const meta: Meta<typeof PreviewerHeader> = {
|
|
5
7
|
title: 'Example/Chat/PreviewerHeader',
|
|
6
8
|
component: PreviewerHeader,
|
|
@@ -51,3 +53,15 @@ export const DataVariant: Story = {
|
|
|
51
53
|
variant: 'data-previewer',
|
|
52
54
|
},
|
|
53
55
|
};
|
|
56
|
+
|
|
57
|
+
export const LoadingOnSave: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
title: '编辑表单',
|
|
60
|
+
onSave: async () => {
|
|
61
|
+
await delay(2000);
|
|
62
|
+
alert('保存完成');
|
|
63
|
+
},
|
|
64
|
+
onCancel: () => alert('取消点击'),
|
|
65
|
+
style: { width: 700 },
|
|
66
|
+
},
|
|
67
|
+
};
|