From 32ddbe775a97df08944c19f3d9d54439f26f5936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8F=8E=EF=B8=8F=20Imer?= <98121322+YumoImer@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:39:08 +0800 Subject: [PATCH] refactor: Bubble style (#314) * fix: Bubble width overflow problem * refactor: bubble style - docs: add debug demo * test: update snapshot for debug demo * docs: add basic placement: end demo --- .../__snapshots__/demo-extend.test.ts.snap | 607 ++++++++++++++++++ .../__tests__/__snapshots__/demo.test.ts.snap | 605 +++++++++++++++++ components/bubble/demo/debug.md | 7 + components/bubble/demo/debug.tsx | 127 ++++ components/bubble/index.en-US.md | 1 + components/bubble/index.zh-CN.md | 1 + components/bubble/style/index.ts | 9 +- 7 files changed, 1356 insertions(+), 1 deletion(-) create mode 100644 components/bubble/demo/debug.md create mode 100644 components/bubble/demo/debug.tsx diff --git a/components/bubble/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/bubble/__tests__/__snapshots__/demo-extend.test.ts.snap index cafb1770..6df281c9 100644 --- a/components/bubble/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/bubble/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -403,6 +403,613 @@ exports[`renders components/bubble/demo/bubble-custom.tsx extend context correct exports[`renders components/bubble/demo/bubble-custom.tsx extend context correctly 2`] = `[]`; +exports[`renders components/bubble/demo/debug.tsx extend context correctly 1`] = ` +
debug
Basic
Placement and avatar
Header and footer
diff --git a/components/bubble/index.zh-CN.md b/components/bubble/index.zh-CN.md
index 7985340e..948457ac 100644
--- a/components/bubble/index.zh-CN.md
+++ b/components/bubble/index.zh-CN.md
@@ -19,6 +19,7 @@ demo:
## 代码演示
+debug
基本
支持位置和头像
头和尾
diff --git a/components/bubble/style/index.ts b/components/bubble/style/index.ts
index c45040fb..b7319603 100644
--- a/components/bubble/style/index.ts
+++ b/components/bubble/style/index.ts
@@ -46,10 +46,13 @@ const genBubbleStyle: GenerateStyle