@bothub-chat/ui 2.80.9-develop-48253cbe-b50a-4e3d-8ddf-ada4a817fb0c → 2.80.10
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/message/markdown/index.js +1 -1
- package/dist/components/message/markdown/styled.d.ts +0 -1
- package/dist/components/message/markdown/styled.js +9 -9
- package/dist/components/message/markdown/useMarkdownPlugins.d.ts +1 -3
- package/dist/components/message/markdown/useMarkdownPlugins.js +1 -1
- package/package.json +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as o,Fragment as e}from"react/jsx-runtime";import{forwardRef as
|
|
1
|
+
import{jsx as t,jsxs as o,Fragment as e}from"react/jsx-runtime";import{forwardRef as s,useMemo as n}from"react";import r from"react-markdown";import{useMessage as i}from"../context.js";import"tslib";import"styled-components";import"../components/code/inline/styled.js";import"../components/code/multiline/styled.js";import"@react-spring/web";import"react-dom";import"../../portal/styled.js";import"../../tooltip/styled.js";import"../../tooltip/arrow/styled.js";import"../../../theme/index.js";import"../../tooltip/context.js";import"../components/code/multiline/copy/styled.js";import"../../../icons/check-small/index.js";import"../../../icons/copy/index.js";import"../components/code/multiline/content/styled.js";import{MessageParagraph as m}from"../components/paragraph/index.js";import"../components/bold/styled.js";import"../components/italic/styled.js";import"../components/pre/styled.js";import"../components/table/styled.js";import"../components/table/cell/styled.js";import"../components/list/styled.js";import"../components/list/context.js";import"../components/list/item/styled.js";import"../components/title/styled.js";import"../components/link/styled.js";import"../components/image/styled.js";import"../components/image/context.js";import"../components/image/grid/styled.js";import"../components/image/button/styled.js";import"../components/image/button/list/styled.js";import"../components/document-copy/styled.js";import"unified";import"remark-parse";import"remark-gfm";import"mdast-util-to-markdown";import"../../../utils/colors/calculateGrayScale.js";import"../../../utils/colors/calculateAccentColors.js";import{MessageMarkdownStyled as p,MessageMarkdownLine as l}from"./styled.js";import{markdownComponents as c}from"./markdown-components.js";import{useMarkdownPlugins as d}from"./useMarkdownPlugins.js";const a=s(({children:s,components:a={},componentsOverride:j={},disableTyping:y=!1,forceMarkdown:g=!1},u)=>{const{typing:$,variant:f,color:h}=i(),k=!g&&"user"===f,x=n(()=>"string"!=typeof s||k?s:s.replace(/\\$$((.|[\r\n])*?)\\$$/g,(t,o)=>`$$${o}$$`).replace(/\\$((.|[\r\n])*?)\\$/g,(t,o)=>`$${o}$`),[s,k]),{remarkPlugins:b,rehypePlugins:w}=d(),P=n(()=>{const o=x.split("\n\n"),e=[];let s=!1;for(const t of o)s?e[e.length-1]+=`${t}\n\n`:t.match(/\n*\s*```/g)?(s=!s,s&&e.push(`${t}\n\n`)):e.push(t);return t(p,{ref:u,children:e.map((o,e)=>t(l,{$typing:!y&&$,$color:h,children:t(r,{remarkPlugins:b,rehypePlugins:w,components:c(a,j,b,w),children:o},e)},e))})},[$,x,b,w,u,a,j]);return o(e,{children:[k&&"string"==typeof s&&t(m,{wrap:!0,disableMargin:!0,children:x}),!k&&"string"==typeof s&&P]})});export{a as MessageMarkdown};
|
|
@@ -287,7 +287,6 @@ export declare const MessageMarkdownStyled: import("styled-components").IStyledC
|
|
|
287
287
|
export interface MessageMarkdownStyledProps {
|
|
288
288
|
$typing: boolean;
|
|
289
289
|
$color: MessageColor;
|
|
290
|
-
$singleDollarTextMath: boolean;
|
|
291
290
|
}
|
|
292
291
|
export declare const MessageMarkdownLine: React.NamedExoticComponent<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, MessageMarkdownStyledProps>>;
|
|
293
292
|
export declare const messageTextCursorOpacity: import("styled-components/dist/models/Keyframes").default;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{styled as t,css as o,keyframes as i}from"styled-components";import s from"react";import"tslib";import"react/jsx-runtime";import{MessageInlineCodeStyled as l}from"../components/code/inline/styled.js";import"../context.js";import{MessageMultilineCodeStyled as e}from"../components/code/multiline/styled.js";import"@react-spring/web";import"react-markdown";import"react-dom";import"../../portal/styled.js";import"../../tooltip/styled.js";import"../../tooltip/arrow/styled.js";import"../../../theme/index.js";import"../../tooltip/context.js";import"../components/code/multiline/copy/styled.js";import"../../../icons/check-small/index.js";import"../../../icons/copy/index.js";import{MessageMultilineCodeContentContainer as m,MessageMultilineCodeLastLine as r}from"../components/code/multiline/content/styled.js";import{MessageParagraphStyled as c}from"../components/paragraph/styled.js";import{MessageBoldStyled as n}from"../components/bold/styled.js";import{MessageItalicStyled as
|
|
1
|
+
import{styled as t,css as o,keyframes as i}from"styled-components";import s from"react";import"tslib";import"react/jsx-runtime";import{MessageInlineCodeStyled as l}from"../components/code/inline/styled.js";import"../context.js";import{MessageMultilineCodeStyled as e}from"../components/code/multiline/styled.js";import"@react-spring/web";import"react-markdown";import"react-dom";import"../../portal/styled.js";import"../../tooltip/styled.js";import"../../tooltip/arrow/styled.js";import"../../../theme/index.js";import"../../tooltip/context.js";import"../components/code/multiline/copy/styled.js";import"../../../icons/check-small/index.js";import"../../../icons/copy/index.js";import{MessageMultilineCodeContentContainer as m,MessageMultilineCodeLastLine as r}from"../components/code/multiline/content/styled.js";import{MessageParagraphStyled as c}from"../components/paragraph/styled.js";import{MessageBoldStyled as n}from"../components/bold/styled.js";import{MessageItalicStyled as p}from"../components/italic/styled.js";import{MessagePre as a}from"../components/pre/styled.js";import{MessageTableStyled as d,MessageTableRow as h}from"../components/table/styled.js";import{MessageTableCellStyled as y}from"../components/table/cell/styled.js";import{MessageListStyled as j}from"../components/list/styled.js";import"../components/list/context.js";import{MessageListItemStyled as f}from"../components/list/item/styled.js";import{MessageTitleStyled as g}from"../components/title/styled.js";import{MessageLinkStyled as x}from"../components/link/styled.js";import"../components/image/styled.js";import"../components/image/context.js";import"../components/image/grid/styled.js";import"../components/image/button/styled.js";import"../components/image/button/list/styled.js";import"../components/document-copy/styled.js";import"unified";import"remark-parse";import"remark-gfm";import"mdast-util-to-markdown";import"../../../utils/colors/calculateGrayScale.js";import"../../../utils/colors/calculateAccentColors.js";const u=t.div.withConfig({displayName:"styled__MessageMarkdownStyled",componentId:"sc-8jnypu-0"})(["display:flex;flex-direction:column;align-items:flex-start;gap:10px;width:100%;"]),$=s.memo(t.div.withConfig({displayName:"styled__MessageMarkdownLine",componentId:"sc-8jnypu-1"})(["display:block;width:100%;color:",";font-weight:400;font-size:16px;line-height:22px;> *:first-child{margin-top:0px;}> *:last-child{margin-bottom:0px;}> ",":first-child{> ","{margin-top:0px;}}> ",":last-child{> ","{margin-bottom:0px;}}",""],({theme:t})=>"custom"===t.scheme?t.colors.custom.message.assistant.text:"dark"===t.mode?t.colors.base.white:"#a1a19a",a,e,a,e,({$typing:t,$color:i,theme:s})=>t&&o`
|
|
2
2
|
&:last-child
|
|
3
3
|
> ${c}:last-child,
|
|
4
4
|
&:last-child
|
|
5
5
|
> ${n}:last-child,
|
|
6
6
|
&:last-child
|
|
7
|
-
> ${
|
|
7
|
+
> ${p}:last-child,
|
|
8
8
|
&:last-child
|
|
9
9
|
> ${l}:last-child,
|
|
10
10
|
&:last-child
|
|
11
|
-
> ${
|
|
11
|
+
> ${a}:last-child
|
|
12
12
|
> ${e}:last-child
|
|
13
13
|
${m}
|
|
14
14
|
${r}:last-child,
|
|
15
15
|
&:last-child
|
|
16
|
-
> ${
|
|
16
|
+
> ${a}:last-child
|
|
17
17
|
> ${e}:last-child
|
|
18
18
|
${m}
|
|
19
19
|
pre
|
|
@@ -24,11 +24,11 @@ import{styled as t,css as o,keyframes as i}from"styled-components";import s from
|
|
|
24
24
|
> ${h}:last-child
|
|
25
25
|
> ${y}:last-child,
|
|
26
26
|
&:last-child
|
|
27
|
-
> ${
|
|
28
|
-
> ${j}:last-child,
|
|
29
|
-
&:last-child
|
|
27
|
+
> ${j}:last-child
|
|
30
28
|
> ${f}:last-child,
|
|
31
29
|
&:last-child
|
|
30
|
+
> ${g}:last-child,
|
|
31
|
+
&:last-child
|
|
32
32
|
> ${x}:last-child {
|
|
33
33
|
&:after {
|
|
34
34
|
display: inline-flex;
|
|
@@ -45,7 +45,7 @@ import{styled as t,css as o,keyframes as i}from"styled-components";import s from
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
`),(t,o)=>t.children===o.children&&t.$typing===o.$typing&&t.$color===o.$color
|
|
48
|
+
`),(t,o)=>t.children===o.children&&t.$typing===o.$typing&&t.$color===o.$color),b=i`
|
|
49
49
|
from {
|
|
50
50
|
opacity: 0.75;
|
|
51
51
|
}
|
|
@@ -55,4 +55,4 @@ import{styled as t,css as o,keyframes as i}from"styled-components";import s from
|
|
|
55
55
|
to {
|
|
56
56
|
opacity: 0.75;
|
|
57
57
|
}
|
|
58
|
-
`;export{
|
|
58
|
+
`;export{$ as MessageMarkdownLine,u as MessageMarkdownStyled,b as messageTextCursorOpacity};
|
|
@@ -5,10 +5,8 @@ export declare const useMarkdownPlugins: () => {
|
|
|
5
5
|
singleDollarTextMath: boolean;
|
|
6
6
|
})[])[];
|
|
7
7
|
rehypePlugins: (typeof rehypeKatex | {
|
|
8
|
-
displayMode: boolean;
|
|
9
8
|
output: string;
|
|
10
9
|
errorColor: string;
|
|
11
|
-
strict:
|
|
10
|
+
strict: boolean;
|
|
12
11
|
})[][];
|
|
13
|
-
singleDollarTextMath: boolean;
|
|
14
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useMemo as r}from"react";import t from"remark-gfm";import"../../../theme/index.js";import o from"remark-math";import e from"rehype-katex";import"katex/dist/katex.min.css";import{useTheme as m}from"../../../theme/hook.js";const i=()=>{const i=m();return{remarkPlugins:r(()=>[t,[o,{singleDollarTextMath:!0}]],[]),rehypePlugins:r(()=>[[e,{output:"html",errorColor:i.colors.orange,strict:!1}]],[i])}};export{i as useMarkdownPlugins};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bothub-chat/ui",
|
|
3
|
-
"version": "2.80.
|
|
3
|
+
"version": "2.80.10",
|
|
4
4
|
"description": "Bothub UI Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bot",
|
|
@@ -39,7 +39,10 @@
|
|
|
39
39
|
"./fonts/*": "./fonts/*",
|
|
40
40
|
"./utils/*": "./dist/utils/*"
|
|
41
41
|
},
|
|
42
|
-
"sideEffects":
|
|
42
|
+
"sideEffects": [
|
|
43
|
+
"**/*.css",
|
|
44
|
+
"**/markdown-plugins.ts"
|
|
45
|
+
],
|
|
43
46
|
"resolutions": {
|
|
44
47
|
"react-helmet/react": "^19.0.0"
|
|
45
48
|
},
|