@copilotkit/react-core 2.0.0-rc.19 → 2.0.0-rc.20
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/{MarkdownSurfaces-kfFfyx5V.mjs → MarkdownSurfaces-Bt7TD_U1.mjs} +5 -30
- package/dist/MarkdownSurfaces-Bt7TD_U1.mjs.map +1 -0
- package/dist/{MarkdownSurfaces-Ci0E7XKw.cjs → MarkdownSurfaces-CoUoPhR9.cjs} +6 -37
- package/dist/MarkdownSurfaces-CoUoPhR9.cjs.map +1 -0
- package/dist/generative-ui.cjs +1 -1
- package/dist/generative-ui.mjs +1 -1
- package/dist/headless.cjs +3 -6
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.mjs +4 -7
- package/dist/headless.mjs.map +1 -1
- package/dist/index.cjs +509 -786
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +172 -707
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +513 -815
- package/dist/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/dist/MarkdownSurfaces-Ci0E7XKw.cjs.map +0 -1
- package/dist/MarkdownSurfaces-kfFfyx5V.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CopilotChatDefaultLabels, extractFenceOperations, flattenInformationalCards, getMarkdownOperationSurfaceId, prepareSurfaceOperations, segmentSurfaceProse, splitA2UIMarkdown, ɵcopilotIconSvgAttributes, ɵcopilotIcons } from "@copilotkit/core";
|
|
1
|
+
import { CopilotChatDefaultLabels, extractFenceOperations, flattenInformationalCards, getMarkdownOperationSurfaceId, prepareSurfaceOperations, segmentSurfaceProse, splitA2UIMarkdown, ɵcn as cn, ɵcopilotIconSvgAttributes, ɵcopilotIcons, ɵshallowEqualRecord } from "@copilotkit/core";
|
|
2
2
|
import React, { Component, createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
import { StreamingMarkdownRenderer, createStreamingMarkdownNodeRenderers } from "@copilotkit/markdown/react";
|
|
4
4
|
import { warnUnsupportedRichSyntaxOnce } from "@copilotkit/markdown";
|
|
@@ -42,28 +42,6 @@ function StreamingMarkdownDefaultRenderer({ content, isStreaming, className, nod
|
|
|
42
42
|
}
|
|
43
43
|
StreamingMarkdownDefaultRenderer.displayName = "StreamingMarkdownDefaultRenderer";
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/lib/utils.ts
|
|
47
|
-
/**
|
|
48
|
-
* Joins class names, skipping falsy values. Takes the same inputs as `clsx`.
|
|
49
|
-
* Classes are not merged: every rule CopilotKit ships sits in `:where()`, so a
|
|
50
|
-
* class the app adds wins without removing ours.
|
|
51
|
-
*/
|
|
52
|
-
function cn(...inputs) {
|
|
53
|
-
const out = [];
|
|
54
|
-
for (const input of inputs) {
|
|
55
|
-
if (!input) continue;
|
|
56
|
-
if (typeof input === "string" || typeof input === "number" || typeof input === "bigint") out.push(String(input));
|
|
57
|
-
else if (Array.isArray(input)) {
|
|
58
|
-
const nested = cn(...input);
|
|
59
|
-
if (nested) out.push(nested);
|
|
60
|
-
} else if (typeof input === "object") {
|
|
61
|
-
for (const key in input) if (input[key]) out.push(key);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return out.join(" ");
|
|
65
|
-
}
|
|
66
|
-
|
|
67
45
|
//#endregion
|
|
68
46
|
//#region src/components/icons/CopilotIcon.tsx
|
|
69
47
|
/** Turns SVG attribute names such as `stroke-width` into React's `strokeWidth`. */
|
|
@@ -129,14 +107,11 @@ const CopilotIcon = forwardRef(function CopilotIcon({ name, ...props }, ref) {
|
|
|
129
107
|
//#endregion
|
|
130
108
|
//#region src/lib/shallow-stable-ref.ts
|
|
131
109
|
/**
|
|
132
|
-
* Shallow equality comparison for objects
|
|
110
|
+
* Shallow equality comparison for objects: same own keys, each holding the
|
|
111
|
+
* same value (`Object.is`). Core's `ɵshallowEqualRecord` holds the rule.
|
|
133
112
|
*/
|
|
134
113
|
function shallowEqual(obj1, obj2) {
|
|
135
|
-
|
|
136
|
-
const keys2 = Object.keys(obj2);
|
|
137
|
-
if (keys1.length !== keys2.length) return false;
|
|
138
|
-
for (const key of keys1) if (obj1[key] !== obj2[key]) return false;
|
|
139
|
-
return true;
|
|
114
|
+
return ɵshallowEqualRecord(obj1, obj2);
|
|
140
115
|
}
|
|
141
116
|
/**
|
|
142
117
|
* Returns true only for plain JS objects (`{}`), excluding arrays, Dates,
|
|
@@ -3739,4 +3714,4 @@ function MarkdownSurfaces({ content, messageId, isStreaming = false, ...markdown
|
|
|
3739
3714
|
|
|
3740
3715
|
//#endregion
|
|
3741
3716
|
export { ExpressionError as A, renderSlot as B, issueKey as C, getMarkdownSurfaceSource as D, containsDynamicValue as E, toJsonSchema as F, CopilotIcon as G, CopilotChatConfigurationProvider as H, defineToolCallRenderer as I, StreamingMarkdownDefaultRenderer as J, IconSvg as K, MarkdownRendererProvider as L, catalogIdsOf as M, componentCatalogIds as N, isRecord as O, createGenerativeUI as P, useMarkdownRenderer as R, isAsyncIssue as S, withoutRejectedNulls as T, useCopilotChatConfiguration as U, ControlledModalOpenScope as V, useShallowStableRef as W, GenerativeUINodeContext as _, GenerativeUIToolCallRenderer as a, useRequiredGenerativeUIRuntime as b, SurfaceView as c, namedRole as d, useGenerativeUIAccessibility as f, useManagerVersion as g, useGenerativeUIState as h, GenerativeUIChatSlotContext as i, GenerativeUIError as j, BASIC_FUNCTIONS as k, DARK_THEME_CSS as l, useGenerativeUIFunction as m, ProviderMarkdown as n, createGenerativeUIActivityRenderer as o, wrapperAria as p, cn as q, DefaultGenerativeUIChatCard as r, createGenerativeUIFunctionCallActivityRenderer as s, MarkdownSurfaces as t, controlAria as u, GenerativeUIRuntimeContext as v, validateSchemaSync as w, formatIssues as x, useGenerativeUIRuntime as y, isReactComponentType as z };
|
|
3742
|
-
//# sourceMappingURL=MarkdownSurfaces-
|
|
3717
|
+
//# sourceMappingURL=MarkdownSurfaces-Bt7TD_U1.mjs.map
|