Skip to content

Commit 9ac10bc

Browse files
authored
Merge pull request #474 from easyops-cn/steve/sidebar
feat(): new brick: chat-panel
2 parents 44149e5 + 4ba7c30 commit 9ac10bc

File tree

14 files changed

+508
-126
lines changed

14 files changed

+508
-126
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
构件 `ai-portal.chat-panel`
2+
3+
## Examples
4+
5+
### Basic
6+
7+
```yaml preview
8+
brick: ai-portal.chat-panel
9+
properties:
10+
textContent: Hello world
11+
```

bricks/ai-portal/src/blank-state/index.spec.tsx

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@ describe("ai-portal.blank-state", () => {
1717
document.body.appendChild(element);
1818
});
1919
expect(element.shadowRoot?.childNodes).toMatchInlineSnapshot(`
20-
NodeList [
21-
<style>
22-
styles.shadow.css
23-
</style>,
24-
<img
25-
height="138"
26-
27-
width="184"
28-
/>,
29-
<p>
30-
No goals
31-
</p>,
32-
]
33-
`);
20+
NodeList [
21+
<style>
22+
styles.shadow.css
23+
</style>,
24+
<img
25+
height="138"
26+
27+
width="184"
28+
/>,
29+
<p>
30+
No goals
31+
</p>,
32+
<slot />,
33+
]
34+
`);
3435

3536
act(() => {
3637
document.body.removeChild(element);
@@ -46,18 +47,19 @@ describe("ai-portal.blank-state", () => {
4647
document.body.appendChild(element);
4748
});
4849
expect(element.shadowRoot?.childNodes).toMatchInlineSnapshot(`
49-
NodeList [
50-
<style>
51-
styles.shadow.css
52-
</style>,
53-
<img
54-
height="138"
55-
56-
width="184"
57-
/>,
58-
<p />,
59-
]
60-
`);
50+
NodeList [
51+
<style>
52+
styles.shadow.css
53+
</style>,
54+
<img
55+
height="138"
56+
57+
width="184"
58+
/>,
59+
<p />,
60+
<slot />,
61+
]
62+
`);
6163

6264
act(() => {
6365
document.body.removeChild(element);

bricks/ai-portal/src/blank-state/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function BlankStateComponent({ illustration, description }: BlankStateProps) {
5050
<>
5151
<img src={getIllustrationSrc(illustration)} width={184} height={138} />
5252
<p>{description}</p>
53+
<slot />
5354
</>
5455
);
5556
}

bricks/ai-portal/src/blank-state/styles.shadow.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
display: flex;
33
flex-direction: column;
44
align-items: center;
5-
gap: 26px;
5+
gap: 16px;
66
}
77

88
:host([hidden]) {
@@ -11,5 +11,5 @@
1111

1212
p {
1313
color: rgba(0, 0, 0, 0.45);
14-
margin: 0;
14+
margin: 10px 0 0;
1515
}

bricks/ai-portal/src/bootstrap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ import "./running-flow/index.js";
3333
import "./notice-dropdown/index.js";
3434
import "./notice-list/index.js";
3535
import "./gantt-chart/index.js";
36+
import "./chat-panel/index.js";

0 commit comments

Comments
 (0)