@copilotkit/react-native 2.0.0-rc.10 → 2.0.0-rc.12

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.
Files changed (54) hide show
  1. package/dist/{CopilotKitProvider-BWjzCdHN.d.mts → CopilotKitProvider-BOaKT5J9.d.cts} +3 -3
  2. package/dist/{CopilotKitProvider-Byw3cqe2.cjs → CopilotKitProvider-DbI3aQam.cjs} +1 -1
  3. package/dist/{CopilotKitProvider-Byw3cqe2.cjs.map → CopilotKitProvider-DbI3aQam.cjs.map} +1 -1
  4. package/dist/{CopilotKitProvider-Btm10msB.d.cts → CopilotKitProvider-DcRVO6WN.d.mts} +3 -3
  5. package/dist/{CopilotKitProvider-CE4bc6CP.mjs → CopilotKitProvider-DlP73sLt.mjs} +2 -2
  6. package/dist/{CopilotKitProvider-CE4bc6CP.mjs.map → CopilotKitProvider-DlP73sLt.mjs.map} +1 -1
  7. package/dist/{Markdown-C_9Re36O.cjs → Markdown-CaYHlD4j.cjs} +8 -8
  8. package/dist/Markdown-CaYHlD4j.cjs.map +1 -0
  9. package/dist/{Markdown-1ips7myr.d.cts → Markdown-DzjnSuu5.d.cts} +3 -3
  10. package/dist/{Markdown-C6AsLHmd.mjs → Markdown-SE9MfY2U.mjs} +4 -4
  11. package/dist/Markdown-SE9MfY2U.mjs.map +1 -0
  12. package/dist/{Markdown-JsYh7oSA.d.mts → Markdown-a-rdG22_.d.mts} +3 -3
  13. package/dist/{MarkdownRendererContext-CAnuohIS.mjs → MarkdownRendererContext-B_AKdPAN.mjs} +1 -1
  14. package/dist/{MarkdownRendererContext-CAnuohIS.mjs.map → MarkdownRendererContext-B_AKdPAN.mjs.map} +1 -1
  15. package/dist/components/index.cjs +1 -1
  16. package/dist/components/index.d.cts +1 -1
  17. package/dist/components/index.d.mts +1 -1
  18. package/dist/components/index.mjs +2 -2
  19. package/dist/headless.cjs +2 -1
  20. package/dist/headless.d.cts +2 -2
  21. package/dist/headless.d.mts +2 -2
  22. package/dist/headless.mjs +2 -1
  23. package/dist/index.cjs +3 -2
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +2 -2
  26. package/dist/index.d.mts +2 -2
  27. package/dist/index.mjs +4 -3
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/polyfills/encoding.cjs +5 -5
  30. package/dist/polyfills/encoding.cjs.map +1 -1
  31. package/dist/polyfills/encoding.mjs +5 -4
  32. package/dist/polyfills/encoding.mjs.map +1 -1
  33. package/dist/polyfills.cjs +2 -1
  34. package/dist/polyfills.cjs.map +1 -1
  35. package/dist/polyfills.mjs +2 -1
  36. package/dist/polyfills.mjs.map +1 -1
  37. package/dist/{streaming-fetch-Dm1oN4f2.mjs → streaming-fetch-CLHG3Z1H.mjs} +1 -1
  38. package/dist/{streaming-fetch-Dm1oN4f2.mjs.map → streaming-fetch-CLHG3Z1H.mjs.map} +1 -1
  39. package/dist/{streaming-fetch-Bm91EsRc.cjs → streaming-fetch-DbDALGya.cjs} +1 -1
  40. package/dist/{streaming-fetch-Bm91EsRc.cjs.map → streaming-fetch-DbDALGya.cjs.map} +1 -1
  41. package/dist/utf8-BIN9t4Oy.mjs +113 -0
  42. package/dist/utf8-BIN9t4Oy.mjs.map +1 -0
  43. package/dist/utf8-Cf3Ssy33.cjs +125 -0
  44. package/dist/utf8-Cf3Ssy33.cjs.map +1 -0
  45. package/package.json +6 -15
  46. package/scripts/verify-polyfill-barrel.mjs +4 -6
  47. package/src/components/Markdown.tsx +4 -4
  48. package/src/components/__tests__/Markdown.code-alias.test.tsx +1 -1
  49. package/src/polyfills/__tests__/utf8.test.ts +112 -0
  50. package/src/polyfills/encoding.ts +5 -4
  51. package/src/polyfills/utf8.ts +151 -0
  52. package/src/types.d.ts +0 -13
  53. package/dist/Markdown-C6AsLHmd.mjs.map +0 -1
  54. package/dist/Markdown-C_9Re36O.cjs.map +0 -1
@@ -0,0 +1,112 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { Utf8TextDecoder, Utf8TextEncoder } from "../utf8";
3
+
4
+ // Node's built-in classes are the reference: the polyfill must give the same
5
+ // output on the runtimes that lack them.
6
+ const NativeEncoder = globalThis.TextEncoder;
7
+ const NativeDecoder = globalThis.TextDecoder;
8
+
9
+ const strings = [
10
+ "",
11
+ "hello",
12
+ "Grüße, 東京, emoji 🚀🧪",
13
+ "\u0000\u007f\u0080߿ࠀ￿",
14
+ "🚀 pair, \ud800 lone high, \udc00 lone low",
15
+ "starts with a BOM",
16
+ ];
17
+
18
+ const byteSequences: number[][] = [
19
+ [0xe2, 0x82, 0xac],
20
+ [0xc3],
21
+ [0xc0, 0x80],
22
+ [0xed, 0xa0, 0x80],
23
+ [0xf4, 0x90, 0x80, 0x80],
24
+ [0xf0, 0x9f, 0x9a],
25
+ [0xe0, 0x80, 0x41],
26
+ [0x80, 0xbf, 0x41],
27
+ [0xff, 0xfe, 0x41],
28
+ [0xef, 0xbb, 0xbf, 0x41],
29
+ [0xf0, 0x9f, 0x98, 0x80, 0xe2, 0x82],
30
+ ];
31
+
32
+ function splits(bytes: Uint8Array): Uint8Array[][] {
33
+ const out: Uint8Array[][] = [[bytes]];
34
+ for (let at = 0; at <= bytes.length; at++) {
35
+ out.push([bytes.subarray(0, at), bytes.subarray(at)]);
36
+ }
37
+ out.push([...bytes].map((byte) => new Uint8Array([byte])));
38
+ return out;
39
+ }
40
+
41
+ function streamDecode(
42
+ decoder: {
43
+ decode: (input?: Uint8Array, options?: { stream?: boolean }) => string;
44
+ },
45
+ chunks: Uint8Array[],
46
+ ): string {
47
+ return (
48
+ chunks.map((chunk) => decoder.decode(chunk, { stream: true })).join("") +
49
+ decoder.decode()
50
+ );
51
+ }
52
+
53
+ describe("Utf8TextEncoder", () => {
54
+ it.each(strings)("encodes %j like the built-in encoder", (input) => {
55
+ expect([...new Utf8TextEncoder().encode(input)]).toEqual([
56
+ ...new NativeEncoder().encode(input),
57
+ ]);
58
+ });
59
+ });
60
+
61
+ describe("Utf8TextDecoder", () => {
62
+ const inputs = [
63
+ ...strings.map((input) => new NativeEncoder().encode(input)),
64
+ ...byteSequences.map((bytes) => new Uint8Array(bytes)),
65
+ ];
66
+
67
+ it.each(inputs.map((bytes) => [[...bytes].join(","), bytes] as const))(
68
+ "decodes [%s] like the built-in decoder, in every chunk split",
69
+ (_, bytes) => {
70
+ for (const chunks of splits(bytes)) {
71
+ for (const ignoreBOM of [false, true]) {
72
+ expect(
73
+ streamDecode(new Utf8TextDecoder("utf-8", { ignoreBOM }), chunks),
74
+ ).toBe(
75
+ streamDecode(new NativeDecoder("utf-8", { ignoreBOM }), chunks),
76
+ );
77
+ }
78
+ }
79
+ },
80
+ );
81
+
82
+ it("throws on invalid bytes when fatal is set", () => {
83
+ for (const bytes of byteSequences.map((b) => new Uint8Array(b))) {
84
+ const native = () =>
85
+ new NativeDecoder("utf-8", { fatal: true }).decode(bytes);
86
+ const polyfill = () =>
87
+ new Utf8TextDecoder("utf-8", { fatal: true }).decode(bytes);
88
+ let nativeThrew = false;
89
+ try {
90
+ native();
91
+ } catch {
92
+ nativeThrew = true;
93
+ }
94
+ if (nativeThrew) expect(polyfill).toThrow(TypeError);
95
+ else expect(polyfill()).toBe(native());
96
+ }
97
+ });
98
+
99
+ it("decodes an ArrayBuffer and a view into a larger buffer", () => {
100
+ const buffer = new NativeEncoder().encode("xx東京xx").buffer;
101
+ expect(new Utf8TextDecoder().decode(buffer)).toBe("xx東京xx");
102
+ expect(new Utf8TextDecoder().decode(new Uint8Array(buffer, 2, 6))).toBe(
103
+ "東京",
104
+ );
105
+ expect(new Utf8TextDecoder().decode()).toBe("");
106
+ });
107
+
108
+ it("supports only UTF-8", () => {
109
+ expect(new Utf8TextDecoder("UTF8").encoding).toBe("utf-8");
110
+ expect(() => new Utf8TextDecoder("latin1")).toThrow(RangeError);
111
+ });
112
+ });
@@ -1,20 +1,21 @@
1
1
  /**
2
2
  * Polyfill: TextEncoder, TextDecoder
3
3
  *
4
- * Required for stream chunk processing in CopilotKit.
4
+ * Required for stream chunk processing in CopilotKit. The polyfill supports
5
+ * UTF-8, the only encoding that CopilotKit uses.
5
6
  * Skipped if the globals are already defined.
6
7
  *
7
8
  * Usage:
8
9
  * import "@copilotkit/react-native/polyfills/encoding";
9
10
  */
10
11
 
11
- import { TextEncoder, TextDecoder } from "text-encoding";
12
+ import { Utf8TextDecoder, Utf8TextEncoder } from "./utf8";
12
13
 
13
14
  const g = globalThis as Record<string, unknown>;
14
15
 
15
16
  if (typeof g.TextEncoder === "undefined") {
16
- g.TextEncoder = TextEncoder;
17
+ g.TextEncoder = Utf8TextEncoder;
17
18
  }
18
19
  if (typeof g.TextDecoder === "undefined") {
19
- g.TextDecoder = TextDecoder;
20
+ g.TextDecoder = Utf8TextDecoder;
20
21
  }
@@ -0,0 +1,151 @@
1
+ /**
2
+ * UTF-8 `TextEncoder` and `TextDecoder`, for runtimes that have neither.
3
+ *
4
+ * CopilotKit only reads and writes UTF-8, so these classes support only that
5
+ * encoding. The decoder follows the WHATWG UTF-8 decode algorithm, so its
6
+ * output, including U+FFFD for invalid bytes and `{ stream: true }` chunks,
7
+ * matches the built-in `TextDecoder`.
8
+ */
9
+
10
+ const REPLACEMENT = 0xfffd;
11
+
12
+ export class Utf8TextEncoder {
13
+ readonly encoding = "utf-8";
14
+
15
+ encode(input = ""): Uint8Array {
16
+ const bytes: number[] = [];
17
+ for (const char of input) {
18
+ let codePoint = char.codePointAt(0)!;
19
+ // A lone surrogate is not a Unicode scalar value.
20
+ if (codePoint >= 0xd800 && codePoint <= 0xdfff) codePoint = REPLACEMENT;
21
+ if (codePoint < 0x80) bytes.push(codePoint);
22
+ else if (codePoint < 0x800)
23
+ bytes.push(0xc0 | (codePoint >> 6), 0x80 | (codePoint & 0x3f));
24
+ else if (codePoint < 0x10000)
25
+ bytes.push(
26
+ 0xe0 | (codePoint >> 12),
27
+ 0x80 | ((codePoint >> 6) & 0x3f),
28
+ 0x80 | (codePoint & 0x3f),
29
+ );
30
+ else
31
+ bytes.push(
32
+ 0xf0 | (codePoint >> 18),
33
+ 0x80 | ((codePoint >> 12) & 0x3f),
34
+ 0x80 | ((codePoint >> 6) & 0x3f),
35
+ 0x80 | (codePoint & 0x3f),
36
+ );
37
+ }
38
+ return new Uint8Array(bytes);
39
+ }
40
+ }
41
+
42
+ export class Utf8TextDecoder {
43
+ readonly encoding = "utf-8";
44
+ readonly fatal: boolean;
45
+ readonly ignoreBOM: boolean;
46
+
47
+ #codePoint = 0;
48
+ #bytesNeeded = 0;
49
+ #bytesSeen = 0;
50
+ #lowerBoundary = 0x80;
51
+ #upperBoundary = 0xbf;
52
+ #atStart = true;
53
+
54
+ constructor(
55
+ label = "utf-8",
56
+ options: { fatal?: boolean; ignoreBOM?: boolean } = {},
57
+ ) {
58
+ const normalized = String(label).trim().toLowerCase();
59
+ if (normalized !== "utf-8" && normalized !== "utf8") {
60
+ throw new RangeError(`The "${label}" encoding is not supported.`);
61
+ }
62
+ this.fatal = options.fatal ?? false;
63
+ this.ignoreBOM = options.ignoreBOM ?? false;
64
+ }
65
+
66
+ decode(
67
+ input?: ArrayBuffer | ArrayBufferView,
68
+ options: { stream?: boolean } = {},
69
+ ): string {
70
+ const bytes =
71
+ input === undefined
72
+ ? new Uint8Array(0)
73
+ : ArrayBuffer.isView(input)
74
+ ? new Uint8Array(input.buffer, input.byteOffset, input.byteLength)
75
+ : new Uint8Array(input);
76
+ const codePoints: number[] = [];
77
+
78
+ for (let i = 0; i < bytes.length; i++) {
79
+ const byte = bytes[i];
80
+ if (this.#bytesNeeded === 0) {
81
+ if (byte <= 0x7f) codePoints.push(byte);
82
+ else if (byte >= 0xc2 && byte <= 0xdf) this.#start(1, byte & 0x1f);
83
+ else if (byte >= 0xe0 && byte <= 0xef) {
84
+ if (byte === 0xe0) this.#lowerBoundary = 0xa0;
85
+ if (byte === 0xed) this.#upperBoundary = 0x9f;
86
+ this.#start(2, byte & 0x0f);
87
+ } else if (byte >= 0xf0 && byte <= 0xf4) {
88
+ if (byte === 0xf0) this.#lowerBoundary = 0x90;
89
+ if (byte === 0xf4) this.#upperBoundary = 0x8f;
90
+ this.#start(3, byte & 0x07);
91
+ } else codePoints.push(this.#error());
92
+ continue;
93
+ }
94
+ if (byte < this.#lowerBoundary || byte > this.#upperBoundary) {
95
+ // The sequence ends early. Read this byte again as a new sequence.
96
+ this.#reset();
97
+ codePoints.push(this.#error());
98
+ i--;
99
+ continue;
100
+ }
101
+ this.#lowerBoundary = 0x80;
102
+ this.#upperBoundary = 0xbf;
103
+ this.#codePoint = (this.#codePoint << 6) | (byte & 0x3f);
104
+ if (++this.#bytesSeen === this.#bytesNeeded) {
105
+ codePoints.push(this.#codePoint);
106
+ this.#reset();
107
+ }
108
+ }
109
+
110
+ if (!options.stream && this.#bytesNeeded > 0) {
111
+ this.#reset();
112
+ codePoints.push(this.#error());
113
+ }
114
+ if (this.#atStart && codePoints.length > 0) {
115
+ this.#atStart = false;
116
+ if (!this.ignoreBOM && codePoints[0] === 0xfeff) codePoints.shift();
117
+ }
118
+ if (!options.stream) this.#atStart = true;
119
+ return codePointsToString(codePoints);
120
+ }
121
+
122
+ #start(bytesNeeded: number, codePoint: number): void {
123
+ this.#bytesNeeded = bytesNeeded;
124
+ this.#codePoint = codePoint;
125
+ }
126
+
127
+ #reset(): void {
128
+ this.#codePoint = 0;
129
+ this.#bytesNeeded = 0;
130
+ this.#bytesSeen = 0;
131
+ this.#lowerBoundary = 0x80;
132
+ this.#upperBoundary = 0xbf;
133
+ }
134
+
135
+ #error(): number {
136
+ if (this.fatal) {
137
+ this.#atStart = true;
138
+ throw new TypeError("The encoded data was not valid utf-8.");
139
+ }
140
+ return REPLACEMENT;
141
+ }
142
+ }
143
+
144
+ function codePointsToString(codePoints: number[]): string {
145
+ let out = "";
146
+ // Stay under the engine's limit on function arguments.
147
+ for (let i = 0; i < codePoints.length; i += 0x8000) {
148
+ out += String.fromCodePoint(...codePoints.slice(i, i + 0x8000));
149
+ }
150
+ return out;
151
+ }
package/src/types.d.ts CHANGED
@@ -8,16 +8,3 @@ declare const __DEV__: boolean;
8
8
  // (`g`) instead of repeating `(globalThis as any)` on every line — same pattern as
9
9
  // packages/angular/src/test-setup.ts. Files without imports add `export {}` so
10
10
  // TypeScript treats them as modules with isolated scope.
11
-
12
- declare module "text-encoding" {
13
- export class TextEncoder {
14
- encode(input?: string): Uint8Array;
15
- }
16
- export class TextDecoder {
17
- constructor(label?: string, options?: { fatal?: boolean });
18
- decode(
19
- input?: ArrayBufferView | ArrayBuffer,
20
- options?: { stream?: boolean },
21
- ): string;
22
- }
23
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"Markdown-C6AsLHmd.mjs","names":["defaultMarkdownStyles","_streamingDefaultStyles"],"sources":["../src/components/Markdown.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n StreamingMarkdownRenderer,\n defaultMarkdownStyles as _streamingDefaultStyles,\n} from \"@copilotkit/markdown-renderer/react-native\";\nimport type { MarkdownStyle as StreamingMarkdownStyle } from \"@copilotkit/markdown-renderer/react-native\";\nimport { warnUnsupportedRichSyntaxOnce } from \"@copilotkit/markdown-renderer\";\n\n/**\n * Style map for CopilotMarkdown. Each key maps a node type to a React Native\n * style object. Extends the streaming renderer's style keys with a `code`\n * shorthand kept for backward compatibility (`list` already exists on the\n * base style and needs no alias).\n *\n * @public\n */\nexport type MarkdownStyle = StreamingMarkdownStyle & {\n /** Alias for `inlineCode`; kept for backward compatibility. */\n code?: Record<string, unknown>;\n};\n\n/**\n * Default styles that ship with CopilotMarkdown.\n *\n * @public\n */\nexport const defaultMarkdownStyles: MarkdownStyle = {\n ..._streamingDefaultStyles,\n // Back-compat alias: `code` = same as `inlineCode`\n code: _streamingDefaultStyles.inlineCode,\n};\n\nexport interface CopilotMarkdownProps {\n content: string;\n style?: MarkdownStyle;\n /**\n * Toggles `Intl.Segmenter`-based token segmentation in the parser. Defaults\n * to `false` (Hermes-safe: no Segmenter needed). Note: the React Native\n * renderer renders text directly and does not perform per-token fade-in\n * animation, so this currently has no visual effect — it is accepted for\n * backward compatibility.\n */\n streamingAnimation?: boolean;\n}\n\n/**\n * GFM markdown renderer for React Native. Delegates to the shared\n * `StreamingMarkdownRenderer` from `@copilotkit/markdown-renderer/react-native`.\n *\n * Public API is backward-compatible with the previous basic renderer:\n * - `CopilotMarkdownProps` — same shape.\n * - `MarkdownStyle` / `defaultMarkdownStyles` — same exports.\n * - `streamingAnimation` maps to `animate` (defaults `false` = Hermes-safe).\n *\n * @public\n */\nexport function CopilotMarkdown({\n content,\n style,\n streamingAnimation = false,\n}: CopilotMarkdownProps): React.ReactElement | null {\n // Translate the back-compat `code` alias onto `inlineCode` — the key the\n // streaming renderer actually reads. Without this, a caller migrating from\n // the previous renderer who passes `style={{ code: ... }}` would silently\n // lose inline-code styling. An explicit `inlineCode` wins over the alias.\n // Dev-only: nudge upgraders from the bundled Streamdown default when their\n // content needs math/syntax highlighting the built-in renderer doesn't do.\n warnUnsupportedRichSyntaxOnce(content);\n\n let resolvedStyle = style as StreamingMarkdownStyle | undefined;\n if (style?.code !== undefined) {\n const { code, ...rest } = style;\n resolvedStyle = {\n ...(rest as StreamingMarkdownStyle),\n inlineCode: (rest as StreamingMarkdownStyle).inlineCode ?? code,\n };\n }\n return (\n <StreamingMarkdownRenderer\n content={content}\n isComplete={true}\n style={resolvedStyle}\n animate={streamingAnimation}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;AA0BA,MAAaA,0BAAuC;CAClD,GAAGC;CAEH,MAAMA,sBAAwB;CAC/B;;;;;;;;;;;;AA0BD,SAAgB,gBAAgB,EAC9B,SACA,OACA,qBAAqB,SAC6B;AAOlD,+BAA8B,QAAQ;CAEtC,IAAI,gBAAgB;AACpB,KAAI,OAAO,SAAS,QAAW;EAC7B,MAAM,EAAE,MAAM,GAAG,SAAS;AAC1B,kBAAgB;GACd,GAAI;GACJ,YAAa,KAAgC,cAAc;GAC5D;;AAEH,QACE,oBAAC;EACU;EACT,YAAY;EACZ,OAAO;EACP,SAAS;GACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Markdown-C_9Re36O.cjs","names":["_streamingDefaultStyles","StreamingMarkdownRenderer"],"sources":["../src/components/Markdown.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n StreamingMarkdownRenderer,\n defaultMarkdownStyles as _streamingDefaultStyles,\n} from \"@copilotkit/markdown-renderer/react-native\";\nimport type { MarkdownStyle as StreamingMarkdownStyle } from \"@copilotkit/markdown-renderer/react-native\";\nimport { warnUnsupportedRichSyntaxOnce } from \"@copilotkit/markdown-renderer\";\n\n/**\n * Style map for CopilotMarkdown. Each key maps a node type to a React Native\n * style object. Extends the streaming renderer's style keys with a `code`\n * shorthand kept for backward compatibility (`list` already exists on the\n * base style and needs no alias).\n *\n * @public\n */\nexport type MarkdownStyle = StreamingMarkdownStyle & {\n /** Alias for `inlineCode`; kept for backward compatibility. */\n code?: Record<string, unknown>;\n};\n\n/**\n * Default styles that ship with CopilotMarkdown.\n *\n * @public\n */\nexport const defaultMarkdownStyles: MarkdownStyle = {\n ..._streamingDefaultStyles,\n // Back-compat alias: `code` = same as `inlineCode`\n code: _streamingDefaultStyles.inlineCode,\n};\n\nexport interface CopilotMarkdownProps {\n content: string;\n style?: MarkdownStyle;\n /**\n * Toggles `Intl.Segmenter`-based token segmentation in the parser. Defaults\n * to `false` (Hermes-safe: no Segmenter needed). Note: the React Native\n * renderer renders text directly and does not perform per-token fade-in\n * animation, so this currently has no visual effect — it is accepted for\n * backward compatibility.\n */\n streamingAnimation?: boolean;\n}\n\n/**\n * GFM markdown renderer for React Native. Delegates to the shared\n * `StreamingMarkdownRenderer` from `@copilotkit/markdown-renderer/react-native`.\n *\n * Public API is backward-compatible with the previous basic renderer:\n * - `CopilotMarkdownProps` — same shape.\n * - `MarkdownStyle` / `defaultMarkdownStyles` — same exports.\n * - `streamingAnimation` maps to `animate` (defaults `false` = Hermes-safe).\n *\n * @public\n */\nexport function CopilotMarkdown({\n content,\n style,\n streamingAnimation = false,\n}: CopilotMarkdownProps): React.ReactElement | null {\n // Translate the back-compat `code` alias onto `inlineCode` — the key the\n // streaming renderer actually reads. Without this, a caller migrating from\n // the previous renderer who passes `style={{ code: ... }}` would silently\n // lose inline-code styling. An explicit `inlineCode` wins over the alias.\n // Dev-only: nudge upgraders from the bundled Streamdown default when their\n // content needs math/syntax highlighting the built-in renderer doesn't do.\n warnUnsupportedRichSyntaxOnce(content);\n\n let resolvedStyle = style as StreamingMarkdownStyle | undefined;\n if (style?.code !== undefined) {\n const { code, ...rest } = style;\n resolvedStyle = {\n ...(rest as StreamingMarkdownStyle),\n inlineCode: (rest as StreamingMarkdownStyle).inlineCode ?? code,\n };\n }\n return (\n <StreamingMarkdownRenderer\n content={content}\n isComplete={true}\n style={resolvedStyle}\n animate={streamingAnimation}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA0BA,MAAa,wBAAuC;CAClD,GAAGA;CAEH,MAAMA,iEAAwB;CAC/B;;;;;;;;;;;;AA0BD,SAAgB,gBAAgB,EAC9B,SACA,OACA,qBAAqB,SAC6B;AAOlD,kEAA8B,QAAQ;CAEtC,IAAI,gBAAgB;AACpB,KAAI,OAAO,SAAS,QAAW;EAC7B,MAAM,EAAE,MAAM,GAAG,SAAS;AAC1B,kBAAgB;GACd,GAAI;GACJ,YAAa,KAAgC,cAAc;GAC5D;;AAEH,QACE,2CAACC;EACU;EACT,YAAY;EACZ,OAAO;EACP,SAAS;GACT"}