@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
|
@@ -71,28 +71,6 @@ function StreamingMarkdownDefaultRenderer({ content, isStreaming, className, nod
|
|
|
71
71
|
}
|
|
72
72
|
StreamingMarkdownDefaultRenderer.displayName = "StreamingMarkdownDefaultRenderer";
|
|
73
73
|
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/lib/utils.ts
|
|
76
|
-
/**
|
|
77
|
-
* Joins class names, skipping falsy values. Takes the same inputs as `clsx`.
|
|
78
|
-
* Classes are not merged: every rule CopilotKit ships sits in `:where()`, so a
|
|
79
|
-
* class the app adds wins without removing ours.
|
|
80
|
-
*/
|
|
81
|
-
function cn(...inputs) {
|
|
82
|
-
const out = [];
|
|
83
|
-
for (const input of inputs) {
|
|
84
|
-
if (!input) continue;
|
|
85
|
-
if (typeof input === "string" || typeof input === "number" || typeof input === "bigint") out.push(String(input));
|
|
86
|
-
else if (Array.isArray(input)) {
|
|
87
|
-
const nested = cn(...input);
|
|
88
|
-
if (nested) out.push(nested);
|
|
89
|
-
} else if (typeof input === "object") {
|
|
90
|
-
for (const key in input) if (input[key]) out.push(key);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return out.join(" ");
|
|
94
|
-
}
|
|
95
|
-
|
|
96
74
|
//#endregion
|
|
97
75
|
//#region src/components/icons/CopilotIcon.tsx
|
|
98
76
|
/** Turns SVG attribute names such as `stroke-width` into React's `strokeWidth`. */
|
|
@@ -118,7 +96,7 @@ const IconSvg = (0, react.forwardRef)(function IconSvg({ lucideName, nodes, size
|
|
|
118
96
|
height: size,
|
|
119
97
|
stroke: color,
|
|
120
98
|
strokeWidth,
|
|
121
|
-
className: cn("lucide", `lucide-${lucideName}`, className),
|
|
99
|
+
className: (0, _copilotkit_core.ɵcn)("lucide", `lucide-${lucideName}`, className),
|
|
122
100
|
"aria-hidden": isDecorative || void 0,
|
|
123
101
|
...props,
|
|
124
102
|
children: [nodes.map((node, index) => (0, react.createElement)(node.tag, {
|
|
@@ -158,14 +136,11 @@ const CopilotIcon = (0, react.forwardRef)(function CopilotIcon({ name, ...props
|
|
|
158
136
|
//#endregion
|
|
159
137
|
//#region src/lib/shallow-stable-ref.ts
|
|
160
138
|
/**
|
|
161
|
-
* Shallow equality comparison for objects
|
|
139
|
+
* Shallow equality comparison for objects: same own keys, each holding the
|
|
140
|
+
* same value (`Object.is`). Core's `ɵshallowEqualRecord` holds the rule.
|
|
162
141
|
*/
|
|
163
142
|
function shallowEqual(obj1, obj2) {
|
|
164
|
-
|
|
165
|
-
const keys2 = Object.keys(obj2);
|
|
166
|
-
if (keys1.length !== keys2.length) return false;
|
|
167
|
-
for (const key of keys1) if (obj1[key] !== obj2[key]) return false;
|
|
168
|
-
return true;
|
|
143
|
+
return (0, _copilotkit_core.ɵshallowEqualRecord)(obj1, obj2);
|
|
169
144
|
}
|
|
170
145
|
/**
|
|
171
146
|
* Returns true only for plain JS objects (`{}`), excluding arrays, Dates,
|
|
@@ -473,7 +448,7 @@ function renderSlotElement(slot, DefaultComponent, props) {
|
|
|
473
448
|
const existingClassName = props.className;
|
|
474
449
|
return react.default.createElement(DefaultComponent, {
|
|
475
450
|
...props,
|
|
476
|
-
className: cn(existingClassName, slot)
|
|
451
|
+
className: (0, _copilotkit_core.ɵcn)(existingClassName, slot)
|
|
477
452
|
});
|
|
478
453
|
}
|
|
479
454
|
if (isReactComponentType(slot)) return react.default.createElement(slot, props);
|
|
@@ -3887,12 +3862,6 @@ Object.defineProperty(exports, 'catalogIdsOf', {
|
|
|
3887
3862
|
return catalogIdsOf;
|
|
3888
3863
|
}
|
|
3889
3864
|
});
|
|
3890
|
-
Object.defineProperty(exports, 'cn', {
|
|
3891
|
-
enumerable: true,
|
|
3892
|
-
get: function () {
|
|
3893
|
-
return cn;
|
|
3894
|
-
}
|
|
3895
|
-
});
|
|
3896
3865
|
Object.defineProperty(exports, 'componentCatalogIds', {
|
|
3897
3866
|
enumerable: true,
|
|
3898
3867
|
get: function () {
|
|
@@ -4061,4 +4030,4 @@ Object.defineProperty(exports, 'wrapperAria', {
|
|
|
4061
4030
|
return wrapperAria;
|
|
4062
4031
|
}
|
|
4063
4032
|
});
|
|
4064
|
-
//# sourceMappingURL=MarkdownSurfaces-
|
|
4033
|
+
//# sourceMappingURL=MarkdownSurfaces-CoUoPhR9.cjs.map
|