@assistant-ui/react-markdown 0.0.2 → 0.0.4
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/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Options } from 'react-markdown';
|
|
3
3
|
|
|
4
|
-
type MarkdownTextPrimitiveProps = Omit<Options, "children"
|
|
4
|
+
type MarkdownTextPrimitiveProps = Omit<Options, "children"> & {
|
|
5
|
+
smooth?: boolean;
|
|
6
|
+
};
|
|
5
7
|
declare const MarkdownTextPrimitive: FC<MarkdownTextPrimitiveProps>;
|
|
6
8
|
|
|
7
|
-
export { MarkdownTextPrimitive };
|
|
9
|
+
export { MarkdownTextPrimitive, type MarkdownTextPrimitiveProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Options } from 'react-markdown';
|
|
3
3
|
|
|
4
|
-
type MarkdownTextPrimitiveProps = Omit<Options, "children"
|
|
4
|
+
type MarkdownTextPrimitiveProps = Omit<Options, "children"> & {
|
|
5
|
+
smooth?: boolean;
|
|
6
|
+
};
|
|
5
7
|
declare const MarkdownTextPrimitive: FC<MarkdownTextPrimitiveProps>;
|
|
6
8
|
|
|
7
|
-
export { MarkdownTextPrimitive };
|
|
9
|
+
export { MarkdownTextPrimitive, type MarkdownTextPrimitiveProps };
|
package/dist/index.js
CHANGED
|
@@ -38,16 +38,13 @@ module.exports = __toCommonJS(src_exports);
|
|
|
38
38
|
var import_react = require("@assistant-ui/react");
|
|
39
39
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
40
40
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var { useSmooth } = import_react.INTERNAL;
|
|
41
42
|
var MarkdownTextPrimitive = (options) => {
|
|
42
|
-
const {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
);
|
|
48
|
-
return c.part.text;
|
|
49
|
-
});
|
|
50
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_markdown.default, { ...options, children: text || "\xA0" });
|
|
43
|
+
const {
|
|
44
|
+
part: { text }
|
|
45
|
+
} = (0, import_react.useContentPartText)();
|
|
46
|
+
const smoothText = useSmooth(text, options.smooth);
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_markdown.default, { ...options, children: smoothText });
|
|
51
48
|
};
|
|
52
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
53
50
|
0 && (module.exports = {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/MarkdownText.tsx"],"sourcesContent":["export {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/MarkdownText.tsx"],"sourcesContent":["export {\n MarkdownTextPrimitive,\n type MarkdownTextPrimitiveProps,\n} from \"./MarkdownText\";\n","import { INTERNAL, useContentPartText } from \"@assistant-ui/react\";\nimport type { FC } from \"react\";\nimport ReactMarkdown, { type Options } from \"react-markdown\";\n\nconst { useSmooth } = INTERNAL;\n\nexport type MarkdownTextPrimitiveProps = Omit<Options, \"children\"> & {\n smooth?: boolean;\n};\n\nexport const MarkdownTextPrimitive: FC<MarkdownTextPrimitiveProps> = (\n options,\n) => {\n const {\n part: { text },\n } = useContentPartText();\n const smoothText = useSmooth(text, options.smooth);\n return <ReactMarkdown {...options}>{smoothText}</ReactMarkdown>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA6C;AAE7C,4BAA4C;AAenC;AAbT,IAAM,EAAE,UAAU,IAAI;AAMf,IAAM,wBAAwD,CACnE,YACG;AACH,QAAM;AAAA,IACJ,MAAM,EAAE,KAAK;AAAA,EACf,QAAI,iCAAmB;AACvB,QAAM,aAAa,UAAU,MAAM,QAAQ,MAAM;AACjD,SAAO,4CAAC,sBAAAA,SAAA,EAAe,GAAG,SAAU,sBAAW;AACjD;","names":["ReactMarkdown"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
// src/MarkdownText.tsx
|
|
2
|
-
import {
|
|
2
|
+
import { INTERNAL, useContentPartText } from "@assistant-ui/react";
|
|
3
3
|
import ReactMarkdown from "react-markdown";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var { useSmooth } = INTERNAL;
|
|
5
6
|
var MarkdownTextPrimitive = (options) => {
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
);
|
|
12
|
-
return c.part.text;
|
|
13
|
-
});
|
|
14
|
-
return /* @__PURE__ */ jsx(ReactMarkdown, { ...options, children: text || "\xA0" });
|
|
7
|
+
const {
|
|
8
|
+
part: { text }
|
|
9
|
+
} = useContentPartText();
|
|
10
|
+
const smoothText = useSmooth(text, options.smooth);
|
|
11
|
+
return /* @__PURE__ */ jsx(ReactMarkdown, { ...options, children: smoothText });
|
|
15
12
|
};
|
|
16
13
|
export {
|
|
17
14
|
MarkdownTextPrimitive
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/MarkdownText.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/MarkdownText.tsx"],"sourcesContent":["import { INTERNAL, useContentPartText } from \"@assistant-ui/react\";\nimport type { FC } from \"react\";\nimport ReactMarkdown, { type Options } from \"react-markdown\";\n\nconst { useSmooth } = INTERNAL;\n\nexport type MarkdownTextPrimitiveProps = Omit<Options, \"children\"> & {\n smooth?: boolean;\n};\n\nexport const MarkdownTextPrimitive: FC<MarkdownTextPrimitiveProps> = (\n options,\n) => {\n const {\n part: { text },\n } = useContentPartText();\n const smoothText = useSmooth(text, options.smooth);\n return <ReactMarkdown {...options}>{smoothText}</ReactMarkdown>;\n};\n"],"mappings":";AAAA,SAAS,UAAU,0BAA0B;AAE7C,OAAO,mBAAqC;AAenC;AAbT,IAAM,EAAE,UAAU,IAAI;AAMf,IAAM,wBAAwD,CACnE,YACG;AACH,QAAM;AAAA,IACJ,MAAM,EAAE,KAAK;AAAA,EACf,IAAI,mBAAmB;AACvB,QAAM,aAAa,UAAU,MAAM,QAAQ,MAAM;AACjD,SAAO,oBAAC,iBAAe,GAAG,SAAU,sBAAW;AACjD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/react-markdown",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"zod": "^3.23.8"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@assistant-ui/react": "^0.3.
|
|
31
|
+
"@assistant-ui/react": "^0.3.2",
|
|
32
32
|
"@types/react": "*",
|
|
33
33
|
"react": "^18"
|
|
34
34
|
},
|