@superinterface/react 2.25.3 → 3.0.2

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.cjs CHANGED
@@ -5706,73 +5706,21 @@ var ComponentsProvider = function(_param) {
5706
5706
  });
5707
5707
  };
5708
5708
  // src/components/assistants/AssistantProvider/index.tsx
5709
- var import_react68 = require("react");
5710
- var import_themes66 = require("@radix-ui/themes");
5711
- // src/components/assistants/AssistantProvider/Code.tsx
5712
- var import_react67 = require("react");
5713
5709
  var import_jsx_runtime97 = require("react/jsx-runtime");
5714
- var Code4 = function(param) {
5715
- var children = param.children, className = param.className, markdownContext = param.markdownContext;
5716
- var messageContext = useMessageContext();
5717
- var isAssistantMessage = (0, import_react67.useMemo)(function() {
5718
- var _messageContext_message;
5719
- return ((_messageContext_message = messageContext.message) === null || _messageContext_message === void 0 ? void 0 : _messageContext_message.role) === "assistant";
5720
- }, [
5721
- messageContext
5722
- ]);
5723
- if (!isAssistantMessage || className !== "language-suggestions") {
5724
- return markdownContext.components.code({
5725
- children: children,
5726
- className: className
5727
- });
5728
- }
5729
- return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Suggestions, {
5730
- children: children
5731
- });
5732
- };
5733
- // src/components/assistants/AssistantProvider/index.tsx
5734
- var import_jsx_runtime98 = // @ts-ignore-next-line
5735
- require("react/jsx-runtime");
5736
5710
  var AssistantProvider = function(param) {
5737
5711
  var children = param.children;
5738
5712
  var superinterfaceContext = useSuperinterfaceContext();
5739
5713
  var assistant = useAssistant({
5740
5714
  assistantId: superinterfaceContext.variables.assistantId
5741
5715
  }).assistant;
5742
- var markdownContext = useMarkdownContext();
5743
- var components2 = (0, import_react68.useMemo)(function() {
5744
- return {
5745
- code: function(props) {
5746
- return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Code4, _object_spread_props(_object_spread({}, props), {
5747
- markdownContext: markdownContext
5748
- }));
5749
- }
5750
- };
5751
- }, [
5752
- markdownContext
5753
- ]);
5754
- if (!assistant) {
5755
- return null;
5756
- }
5757
- return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_themes66.Theme, {
5758
- accentColor: assistant.theme.accentColor,
5759
- grayColor: assistant.theme.grayColor,
5760
- radius: assistant.theme.radius,
5761
- appearance: assistant.theme.appearance,
5762
- scaling: assistant.theme.scaling,
5763
- panelBackground: "solid",
5764
- hasBackground: false,
5765
- children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(AssistantNameContext.Provider, {
5766
- value: assistant.name,
5767
- children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(AssistantAvatarContext.Provider, {
5768
- value: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Avatar6, {
5769
- avatar: assistant.avatar
5770
- }),
5771
- children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(MarkdownProvider, {
5772
- components: components2,
5773
- children: children
5774
- })
5775
- })
5716
+ var _assistant_name;
5717
+ return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(AssistantNameContext.Provider, {
5718
+ value: (_assistant_name = assistant === null || assistant === void 0 ? void 0 : assistant.name) !== null && _assistant_name !== void 0 ? _assistant_name : "",
5719
+ children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(AssistantAvatarContext.Provider, {
5720
+ value: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Avatar6, {
5721
+ avatar: assistant === null || assistant === void 0 ? void 0 : assistant.avatar
5722
+ }),
5723
+ children: children
5776
5724
  })
5777
5725
  });
5778
5726
  };