@copilotkitnext/react 0.0.29 → 0.0.30
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.js +21 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +80 -74
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1484,22 +1484,28 @@ var CopilotKitCoreReact = class extends import_core.CopilotKitCore {
|
|
|
1484
1484
|
var React4 = __toESM(require("react"));
|
|
1485
1485
|
var import_react5 = require("@lit-labs/react");
|
|
1486
1486
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1487
|
-
var
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1487
|
+
var CopilotKitInspector = ({ core, ...rest }) => {
|
|
1488
|
+
const [InspectorComponent, setInspectorComponent] = React4.useState(null);
|
|
1489
|
+
React4.useEffect(() => {
|
|
1490
|
+
let mounted = true;
|
|
1491
|
+
import("@copilotkitnext/web-inspector").then((mod) => {
|
|
1492
|
+
mod.defineWebInspector?.();
|
|
1493
|
+
const Component = (0, import_react5.createComponent)({
|
|
1494
|
+
tagName: mod.WEB_INSPECTOR_TAG,
|
|
1495
|
+
elementClass: mod.WebInspectorElement,
|
|
1496
|
+
react: React4
|
|
1497
|
+
});
|
|
1498
|
+
if (mounted) {
|
|
1499
|
+
setInspectorComponent(() => Component);
|
|
1500
|
+
}
|
|
1498
1501
|
});
|
|
1499
|
-
return
|
|
1500
|
-
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1502
|
+
return () => {
|
|
1503
|
+
mounted = false;
|
|
1504
|
+
};
|
|
1505
|
+
}, []);
|
|
1506
|
+
if (!InspectorComponent) return null;
|
|
1507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InspectorComponent, { ...rest, core: core ?? null });
|
|
1508
|
+
};
|
|
1503
1509
|
CopilotKitInspector.displayName = "CopilotKitInspector";
|
|
1504
1510
|
|
|
1505
1511
|
// src/providers/CopilotKitProvider.tsx
|