Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:🔥New Component: Chatbox #48384

Draft
wants to merge 89 commits into
base: feature
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
c654965
feat: 🔥 New Component: ChatBox
li-jia-nan Apr 10, 2024
34c6805
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 10, 2024
d25df53
chore: rename folder chatbox => chat-box
li-jia-nan Apr 10, 2024
1aa99bb
test: update snap
li-jia-nan Apr 10, 2024
b1153e8
test: update snap
li-jia-nan Apr 10, 2024
82e4cdc
feat: add more props
li-jia-nan Apr 10, 2024
d4a6956
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 11, 2024
bb69469
feat: add style
li-jia-nan Apr 11, 2024
a7e8146
style: fix style
li-jia-nan Apr 12, 2024
13ee805
test: update snap
li-jia-nan Apr 12, 2024
09c50ea
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 12, 2024
e0b5de6
fix: fix
li-jia-nan Apr 12, 2024
f9824b8
fix: fix
li-jia-nan Apr 12, 2024
b3d598a
fix: fix
li-jia-nan Apr 12, 2024
30b4d0d
fix: fix
li-jia-nan Apr 12, 2024
6badfde
fix: fix
li-jia-nan Apr 12, 2024
4f9fd72
fix: fix
li-jia-nan Apr 12, 2024
ae22830
fix: fix style
li-jia-nan Apr 13, 2024
d2ea73d
fix: fix test case
li-jia-nan Apr 13, 2024
2d41145
chore: rename
li-jia-nan Apr 13, 2024
36e6aa8
demo: update demo
li-jia-nan Apr 13, 2024
3b4d993
fix: fix
li-jia-nan Apr 13, 2024
4e9363e
fix: fix
li-jia-nan Apr 13, 2024
2249400
fix: fix
li-jia-nan Apr 13, 2024
ee1eaf3
fix: fix
li-jia-nan Apr 13, 2024
84e2bce
fix: update demo
li-jia-nan Apr 14, 2024
edc5a03
test: add test case
li-jia-nan Apr 15, 2024
7af6008
demo: update demo
li-jia-nan Apr 15, 2024
a1a08f3
test: add test case
li-jia-nan Apr 15, 2024
4aa79b5
chore: rename `chat-box` => `chatbox`
li-jia-nan Apr 15, 2024
93f9e7d
chore: rename `chat-box` => `chatbox`
li-jia-nan Apr 15, 2024
3b4e220
chore: rename `chat-box` => `chatbox`
li-jia-nan Apr 15, 2024
aa793e4
fix: update demo
li-jia-nan Apr 15, 2024
8e0608e
fix: fix
li-jia-nan Apr 15, 2024
1bc3e43
fix: setInterval => setTimeout
li-jia-nan Apr 15, 2024
70edfe1
test: update test snap
li-jia-nan Apr 15, 2024
323ef28
test: update test snap
li-jia-nan Apr 15, 2024
55fa7b0
docs: update docs
li-jia-nan Apr 15, 2024
2182d10
demo: update demo
li-jia-nan Apr 16, 2024
6079a76
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 16, 2024
9ee1fe6
test: add test case
li-jia-nan Apr 16, 2024
4c37e55
test: add test case
li-jia-nan Apr 16, 2024
ccdf17a
feat: CP support Chatbox
li-jia-nan Apr 16, 2024
322bbb0
test: add test case
li-jia-nan Apr 16, 2024
ebe1177
fix: fix type export
li-jia-nan Apr 16, 2024
0d37062
demo: update demo
li-jia-nan Apr 16, 2024
92607b4
feat: add loading
li-jia-nan Apr 16, 2024
1ebe32b
fix: fix style
li-jia-nan Apr 16, 2024
2b258f1
fix: fix
li-jia-nan Apr 16, 2024
3f298f0
fix: fix style
li-jia-nan Apr 16, 2024
d5e66af
fix: fix style
li-jia-nan Apr 16, 2024
6c1f4bc
demo: update demo
li-jia-nan Apr 16, 2024
8a01906
chore: update style
li-jia-nan Apr 16, 2024
e74db08
docs: add Semantic DOM
li-jia-nan Apr 17, 2024
6c3aac1
Update components/chatbox/style/index.ts
li-jia-nan Apr 17, 2024
6514137
Update components/chatbox/style/index.ts
li-jia-nan Apr 17, 2024
2bd5309
Update components/chatbox/style/index.ts
li-jia-nan Apr 17, 2024
2499d6f
fix: fix
li-jia-nan Apr 17, 2024
eb4605b
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 17, 2024
1384ab0
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 17, 2024
992478e
docs: update docs
li-jia-nan Apr 17, 2024
dfb7be7
fix: fix
li-jia-nan Apr 17, 2024
a112882
fix: fix
li-jia-nan Apr 17, 2024
412ed48
chore: animationDuration 0.6s => 0.8s
li-jia-nan Apr 17, 2024
e4fe3fc
fix: fix
li-jia-nan Apr 17, 2024
7cda45b
test: update test
li-jia-nan Apr 17, 2024
e318875
Update components/chatbox/index.tsx
li-jia-nan Apr 17, 2024
2178cad
type: add React.HTMLAttributes
li-jia-nan Apr 17, 2024
65b2120
chore: rename
li-jia-nan Apr 17, 2024
321fc90
style: update loading
li-jia-nan Apr 17, 2024
05cd3b7
fix: svg anima => css anima
li-jia-nan Apr 18, 2024
d6df817
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 18, 2024
2ea1781
fix: fix style
li-jia-nan Apr 18, 2024
cc62a5f
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 18, 2024
e3684ff
chore: update css animation style
li-jia-nan Apr 18, 2024
c75945e
demo: update demo
li-jia-nan Apr 18, 2024
a826849
fix: add last-child
li-jia-nan Apr 18, 2024
fc10a88
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 19, 2024
644f4a1
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 22, 2024
c560a96
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 24, 2024
3112e9b
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 25, 2024
75ba736
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 26, 2024
36ca905
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 28, 2024
82ce5b5
test: test
li-jia-nan Apr 28, 2024
fae8eb0
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan Apr 30, 2024
40d41b5
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan May 1, 2024
00ea674
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan May 1, 2024
72e3638
Merge branch 'feature' into New-Component-ChatBox
li-jia-nan May 2, 2024
bac2edb
chore: update since 5.17.0 => 5.18.0
li-jia-nan May 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions components/__tests__/__snapshots__/index.test.ts.snap
Expand Up @@ -16,6 +16,7 @@ exports[`antd exports modules correctly 1`] = `
"Card",
"Carousel",
"Cascader",
"Chatbox",
"Checkbox",
"Col",
"Collapse",
Expand Down
313 changes: 313 additions & 0 deletions components/chatbox/__tests__/__snapshots__/demo-extend.test.ts.snap
@@ -0,0 +1,313 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders components/chatbox/demo/avatar-and-placement.tsx extend context correctly 1`] = `
<div
class="ant-flex ant-flex-align-stretch ant-flex-gap-middle ant-flex-vertical"
>
<div
class="ant-chatbox ant-chatbox-start"
>
<div
class="ant-chatbox-avatar"
>
<span
class="ant-avatar ant-avatar-circle ant-avatar-icon"
style="width: 32px; height: 32px; font-size: 16px; color: rgb(245, 106, 0); background-color: rgb(253, 227, 207);"
>
<span
aria-label="user"
class="anticon anticon-user"
role="img"
>
<svg
aria-hidden="true"
data-icon="user"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"
/>
</svg>
</span>
</span>
</div>
<div
class="ant-chatbox-content"
>
Good morning, how are you ?
</div>
</div>
<div
class="ant-chatbox ant-chatbox-start"
>
<div
class="ant-chatbox-avatar"
style="visibility: hidden;"
>
<span
class="ant-avatar ant-avatar-circle"
style="width: 32px; height: 32px; font-size: 18px;"
>
<span
class="ant-avatar-string"
style="transform: scale(1);"
/>
</span>
</div>
<div
class="ant-chatbox-content"
>
What a beautiful day !
</div>
</div>
<div
class="ant-chatbox ant-chatbox-end"
>
<div
class="ant-chatbox-avatar"
>
<span
class="ant-avatar ant-avatar-circle ant-avatar-icon"
style="width: 32px; height: 32px; font-size: 16px; color: rgb(255, 255, 255); background-color: rgb(135, 208, 104);"
>
<span
aria-label="user"
class="anticon anticon-user"
role="img"
>
<svg
aria-hidden="true"
data-icon="user"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"
/>
</svg>
</span>
</span>
</div>
<div
class="ant-chatbox-content"
>
Hi, good morning, I'm fine !
</div>
</div>
<div
class="ant-chatbox ant-chatbox-end"
>
<div
class="ant-chatbox-avatar"
style="visibility: hidden;"
>
<span
class="ant-avatar ant-avatar-circle"
style="width: 32px; height: 32px; font-size: 18px;"
>
<span
class="ant-avatar-string"
style="transform: scale(1);"
/>
</span>
</div>
<div
class="ant-chatbox-content"
>
Thank you !
</div>
</div>
</div>
`;

exports[`renders components/chatbox/demo/avatar-and-placement.tsx extend context correctly 2`] = `[]`;

exports[`renders components/chatbox/demo/basic.tsx extend context correctly 1`] = `
<div
class="ant-chatbox ant-chatbox-start"
>
<div
class="ant-chatbox-content"
>
hello world !
</div>
</div>
`;

exports[`renders components/chatbox/demo/basic.tsx extend context correctly 2`] = `[]`;

exports[`renders components/chatbox/demo/contentRender.tsx extend context correctly 1`] = `
<div
class="ant-chatbox ant-chatbox-start"
>
<div
class="ant-chatbox-avatar"
>
<span
class="ant-avatar ant-avatar-circle ant-avatar-icon"
style="width: 32px; height: 32px; font-size: 16px;"
>
<span
aria-label="user"
class="anticon anticon-user"
role="img"
>
<svg
aria-hidden="true"
data-icon="user"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"
/>
</svg>
</span>
</span>
</div>
<div
class="ant-chatbox-content"
>
<span>
<h1 />
</span>
</div>
</div>
`;

exports[`renders components/chatbox/demo/contentRender.tsx extend context correctly 2`] = `[]`;

exports[`renders components/chatbox/demo/loading.tsx extend context correctly 1`] = `
<div
class="ant-flex ant-flex-align-stretch ant-flex-gap-large ant-flex-vertical"
>
<div
class="ant-chatbox ant-chatbox-start"
>
<div
class="ant-chatbox-avatar"
>
<span
class="ant-avatar ant-avatar-circle ant-avatar-icon"
style="width: 32px; height: 32px; font-size: 16px;"
>
<span
aria-label="user"
class="anticon anticon-user"
role="img"
>
<svg
aria-hidden="true"
data-icon="user"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"
/>
</svg>
</span>
</span>
</div>
<div
class="ant-chatbox-content"
>
<span
class="ant-chatbox-dot"
>
<i
class="ant-chatbox-dot-item"
/>
<i
class="ant-chatbox-dot-item"
/>
<i
class="ant-chatbox-dot-item"
/>
</span>
</div>
</div>
<div
class="ant-flex ant-flex-wrap-wrap ant-flex-gap-large"
>
Loading state:
<button
aria-checked="true"
class="ant-switch ant-switch-checked"
role="switch"
type="button"
>
<div
class="ant-switch-handle"
/>
<span
class="ant-switch-inner"
>
<span
class="ant-switch-inner-checked"
/>
<span
class="ant-switch-inner-unchecked"
/>
</span>
</button>
</div>
</div>
`;

exports[`renders components/chatbox/demo/loading.tsx extend context correctly 2`] = `[]`;

exports[`renders components/chatbox/demo/typing.tsx extend context correctly 1`] = `
<div
class="ant-chatbox ant-chatbox-start ant-chatbox-typing"
>
<div
class="ant-chatbox-avatar"
>
<span
class="ant-avatar ant-avatar-circle ant-avatar-icon"
style="width: 32px; height: 32px; font-size: 16px;"
>
<span
aria-label="user"
class="anticon anticon-user"
role="img"
>
<svg
aria-hidden="true"
data-icon="user"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"
/>
</svg>
</span>
</span>
</div>
<div
class="ant-chatbox-content"
>
F
</div>
</div>
`;

exports[`renders components/chatbox/demo/typing.tsx extend context correctly 2`] = `[]`;