@aws/mynah-ui 4.27.0 → 4.28.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.
- package/dist/components/card/card-body.d.ts +1 -0
- package/dist/components/chat-item/chat-item-card-content.d.ts +1 -0
- package/dist/components/chat-item/chat-item-card.d.ts +3 -0
- package/dist/components/syntax-highlighter.d.ts +2 -1
- package/dist/helper/test-ids.d.ts +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +1 -0
- package/docs/DATAMODEL.md +24 -0
- package/docs/img/data-model/chatItems/autoCollapse.png +0 -0
- package/package.json +1 -1
- package/ui-tests/dist/main.js +1 -1
- package/ui-tests/dist/main.js.map +1 -1
package/dist/static.d.ts
CHANGED
package/docs/DATAMODEL.md
CHANGED
|
@@ -1154,6 +1154,7 @@ interface ChatItem extends ChatItemContent{
|
|
|
1154
1154
|
type: ChatItemType;
|
|
1155
1155
|
messageId?: string;
|
|
1156
1156
|
snapToTop?: boolean;
|
|
1157
|
+
autoCollapse?: boolean;
|
|
1157
1158
|
canBeVoted?: boolean;
|
|
1158
1159
|
icon?: MynahIcons;
|
|
1159
1160
|
hoverEffect?: boolean;
|
|
@@ -1969,6 +1970,29 @@ mkdir -p src/ lalalaaaa
|
|
|
1969
1970
|
**Note:** Keep in mind that, if the `padding` is set to `false`, code blocks inside body will not show language if there are also no actions specified for them. So, if you turn of `copy` and `insert-to-cursor` by setting them to `null` in `codeBlockActions`, it will also hide the language bar if the card padding is false.
|
|
1970
1971
|
|
|
1971
1972
|
|
|
1973
|
+
---
|
|
1974
|
+
|
|
1975
|
+
## `autoCollapse`
|
|
1976
|
+
It will allow you to limit the card height up to 25% of the screen height and give an option to expand/collapse it back.
|
|
1977
|
+
|
|
1978
|
+
```typescript
|
|
1979
|
+
mynahUI.addChatItem(tabId, {
|
|
1980
|
+
autoCollapse: true,
|
|
1981
|
+
fullWidth: true,
|
|
1982
|
+
type: ChatItemType.ANSWER,
|
|
1983
|
+
body: `Hello from MynahUI:
|
|
1984
|
+
.....
|
|
1985
|
+
`,
|
|
1986
|
+
});
|
|
1987
|
+
```
|
|
1988
|
+
|
|
1989
|
+
<p align="center">
|
|
1990
|
+
<img src="./img/data-model/chatItems/autoCollapse.png" alt="autoCollapse" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
1991
|
+
</p>
|
|
1992
|
+
|
|
1993
|
+
**Note:** Keep in mind that, when you enable `autoCollapse`, code blocks will not be collapsed by default. To avoid multiple inner collapsed items inside a collapsed item.
|
|
1994
|
+
|
|
1995
|
+
|
|
1972
1996
|
---
|
|
1973
1997
|
|
|
1974
1998
|
## `codeBlockActions`
|
|
Binary file
|
package/package.json
CHANGED