@copilotkit/react-core 2.0.0-rc.1 → 2.0.0-rc.3
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-ChSlVYOk.mjs → MarkdownSurfaces-Bd--93O1.mjs} +30 -9
- package/dist/MarkdownSurfaces-Bd--93O1.mjs.map +1 -0
- package/dist/{MarkdownSurfaces-C2XZISKn.cjs → MarkdownSurfaces-S4wfUl3J.cjs} +35 -8
- package/dist/MarkdownSurfaces-S4wfUl3J.cjs.map +1 -0
- package/dist/generative-ui.cjs +1 -1
- package/dist/generative-ui.mjs +1 -1
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.mjs.map +1 -1
- package/dist/index.cjs +426 -432
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +33 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +427 -434
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +451 -432
- package/dist/index.umd.js.map +1 -1
- package/package.json +12 -26
- package/dist/MarkdownSurfaces-C2XZISKn.cjs.map +0 -1
- package/dist/MarkdownSurfaces-ChSlVYOk.mjs.map +0 -1
- package/dist/index.css +0 -2
|
@@ -31,7 +31,6 @@ react = __toESM(react);
|
|
|
31
31
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
32
32
|
let _copilotkit_markdown_renderer_react = require("@copilotkit/markdown-renderer/react");
|
|
33
33
|
let _copilotkit_markdown_renderer = require("@copilotkit/markdown-renderer");
|
|
34
|
-
let tailwind_merge = require("tailwind-merge");
|
|
35
34
|
let _copilotkit_shared = require("@copilotkit/shared");
|
|
36
35
|
let _copilotkit_react_core_context = require("@copilotkit/react-core/context");
|
|
37
36
|
let zod = require("zod");
|
|
@@ -39,7 +38,7 @@ let zod_to_json_schema = require("zod-to-json-schema");
|
|
|
39
38
|
|
|
40
39
|
//#region src/components/chat/StreamingMarkdownDefaultRenderer.tsx
|
|
41
40
|
const defaultNodeRenderers = (0, _copilotkit_markdown_renderer_react.createStreamingMarkdownNodeRenderers)({ codeBlock: ({ node }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
42
|
-
className: "cpk
|
|
41
|
+
className: "cpk-markdown-code-block",
|
|
43
42
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
44
43
|
"data-code-info": node.info ?? void 0,
|
|
45
44
|
children: node.text
|
|
@@ -417,6 +416,28 @@ const ControlledModalOpenScope = ({ children, open, onOpenChange }) => {
|
|
|
417
416
|
};
|
|
418
417
|
ControlledModalOpenScope.displayName = "ControlledModalOpenScope";
|
|
419
418
|
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region src/lib/utils.ts
|
|
421
|
+
/**
|
|
422
|
+
* Joins class names, skipping falsy values. Takes the same inputs as `clsx`.
|
|
423
|
+
* Classes are not merged: every rule CopilotKit ships sits in `:where()`, so a
|
|
424
|
+
* class the app adds wins without removing ours.
|
|
425
|
+
*/
|
|
426
|
+
function cn(...inputs) {
|
|
427
|
+
const out = [];
|
|
428
|
+
for (const input of inputs) {
|
|
429
|
+
if (!input) continue;
|
|
430
|
+
if (typeof input === "string" || typeof input === "number" || typeof input === "bigint") out.push(String(input));
|
|
431
|
+
else if (Array.isArray(input)) {
|
|
432
|
+
const nested = cn(...input);
|
|
433
|
+
if (nested) out.push(nested);
|
|
434
|
+
} else if (typeof input === "object") {
|
|
435
|
+
for (const key in input) if (input[key]) out.push(key);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return out.join(" ");
|
|
439
|
+
}
|
|
440
|
+
|
|
420
441
|
//#endregion
|
|
421
442
|
//#region src/lib/slots.tsx
|
|
422
443
|
/**
|
|
@@ -435,7 +456,7 @@ function renderSlotElement(slot, DefaultComponent, props) {
|
|
|
435
456
|
const existingClassName = props.className;
|
|
436
457
|
return react.default.createElement(DefaultComponent, {
|
|
437
458
|
...props,
|
|
438
|
-
className: (
|
|
459
|
+
className: cn(existingClassName, slot)
|
|
439
460
|
});
|
|
440
461
|
}
|
|
441
462
|
if (isReactComponentType(slot)) return react.default.createElement(slot, props);
|
|
@@ -3448,10 +3469,10 @@ const GenerativeUIChatSlotContext = (0, react.createContext)(void 0);
|
|
|
3448
3469
|
function DefaultGenerativeUIChatCard({ surfaceId, isStreaming, error, children }) {
|
|
3449
3470
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3450
3471
|
"data-generative-ui-chat-surface": surfaceId,
|
|
3451
|
-
className: "cpk
|
|
3472
|
+
className: "cpk-generative-ui-chat-card",
|
|
3452
3473
|
children: [children, error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3453
3474
|
role: "alert",
|
|
3454
|
-
className: "cpk
|
|
3475
|
+
className: "cpk-generative-ui-chat-card-error",
|
|
3455
3476
|
children: "Part of this UI couldn't be shown."
|
|
3456
3477
|
})]
|
|
3457
3478
|
});
|
|
@@ -3589,10 +3610,10 @@ function DefaultMarkdownChatSurface({ surfaceId, error, children }) {
|
|
|
3589
3610
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3590
3611
|
"data-generative-ui-chat-surface": surfaceId,
|
|
3591
3612
|
"data-a2ui-markdown-surface": surfaceId,
|
|
3592
|
-
className: "cpk
|
|
3613
|
+
className: "cpk-markdown-chat-surface",
|
|
3593
3614
|
children: [children, error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3594
3615
|
role: "alert",
|
|
3595
|
-
className: "cpk
|
|
3616
|
+
className: "cpk-markdown-chat-surface-error",
|
|
3596
3617
|
children: "Part of this UI couldn't be shown."
|
|
3597
3618
|
})]
|
|
3598
3619
|
});
|
|
@@ -3793,6 +3814,12 @@ Object.defineProperty(exports, 'catalogIdsOf', {
|
|
|
3793
3814
|
return catalogIdsOf;
|
|
3794
3815
|
}
|
|
3795
3816
|
});
|
|
3817
|
+
Object.defineProperty(exports, 'cn', {
|
|
3818
|
+
enumerable: true,
|
|
3819
|
+
get: function () {
|
|
3820
|
+
return cn;
|
|
3821
|
+
}
|
|
3822
|
+
});
|
|
3796
3823
|
Object.defineProperty(exports, 'componentCatalogIds', {
|
|
3797
3824
|
enumerable: true,
|
|
3798
3825
|
get: function () {
|
|
@@ -3961,4 +3988,4 @@ Object.defineProperty(exports, 'wrapperAria', {
|
|
|
3961
3988
|
return wrapperAria;
|
|
3962
3989
|
}
|
|
3963
3990
|
});
|
|
3964
|
-
//# sourceMappingURL=MarkdownSurfaces-
|
|
3991
|
+
//# sourceMappingURL=MarkdownSurfaces-S4wfUl3J.cjs.map
|