@examplary/ui 1.22.0 → 1.24.0
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.
|
@@ -20,7 +20,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { Fragment } from "react";
|
|
24
25
|
import { CheckCircle2Icon, SparkleIcon } from "lucide-react";
|
|
25
26
|
import { ChatTypingIndicator } from "./chat-typing-indicator";
|
|
26
27
|
import { cn } from "../../utils";
|
|
@@ -32,7 +33,7 @@ export var ChatView = function (_a) {
|
|
|
32
33
|
var role = _a.role;
|
|
33
34
|
return role !== "system";
|
|
34
35
|
})
|
|
35
|
-
.map(function (item, index) { return (_jsxs(
|
|
36
|
+
.map(function (item, index) { return (_jsxs(Fragment, { children: [_jsxs("div", { className: "flex gap-3 w-full", children: [item.role === "assistant" && botAvatar ? (_jsx("img", { src: botAvatar, alt: "Bot Avatar", className: "size-6.5 rounded-full border border-black shadow-light" })) : null, _jsx("div", { className: cn("flex gap-2 text-sm", "max-w-[85%] border rounded-3xl px-4 py-3", item.role === "user" &&
|
|
36
37
|
"bg-white border-border ml-auto rounded-tr-sm", item.role !== "user" &&
|
|
37
|
-
"border-transparent bg-border-accent rounded-tl-sm"), children: _jsx(RichTextDisplay, { children: item.content }) })] }
|
|
38
|
+
"border-transparent bg-border-accent rounded-tl-sm"), children: _jsx(RichTextDisplay, { children: item.content }) })] }), showTeacherContext && item.reason ? (_jsxs("div", { className: cn("text-xs text-gray-500 mb-1 max-w-[85%]"), children: [_jsx(SparkleIcon, { className: "size-3 -mt-0.5 inline-block mr-1", strokeWidth: 2.5 }), _jsx("span", { className: "font-semibold", children: "Reasoning:" }), " ", item.reason] }, "reason-".concat(index))) : null, showTeacherContext && item.completed && item.completionReason ? (_jsxs("div", { className: cn("text-xs text-gray-500 mb-1 max-w-[85%]"), children: [_jsxs("span", { className: "font-semibold text-emerald-600", children: [_jsx(CheckCircle2Icon, { className: "size-3 -mt-0.5 inline-block mr-1", strokeWidth: 2.6 }), "Completion reasoning:"] }), " ", item.completionReason] })) : null] }, index)); }), typing && _jsx(ChatTypingIndicator, {})] })));
|
|
38
39
|
};
|
|
@@ -34,7 +34,6 @@ import { useEffect, useMemo, useState } from "react";
|
|
|
34
34
|
import Document from "@tiptap/extension-document";
|
|
35
35
|
import Highlight from "@tiptap/extension-highlight";
|
|
36
36
|
import Link from "@tiptap/extension-link";
|
|
37
|
-
import { migrateMathStrings } from "@tiptap/extension-mathematics";
|
|
38
37
|
import Placeholder from "@tiptap/extension-placeholder";
|
|
39
38
|
import { TableKit } from "@tiptap/extension-table";
|
|
40
39
|
import Typography from "@tiptap/extension-typography";
|
|
@@ -110,10 +109,6 @@ export var MinimalRichTextField = function (_a) {
|
|
|
110
109
|
html = isEmpty(html) ? "" : html;
|
|
111
110
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(html);
|
|
112
111
|
},
|
|
113
|
-
onCreate: function (_a) {
|
|
114
|
-
var currentEditor = _a.editor;
|
|
115
|
-
migrateMathStrings(currentEditor);
|
|
116
|
-
},
|
|
117
112
|
autofocus: autoFocus,
|
|
118
113
|
content: content,
|
|
119
114
|
extensions: extensions,
|
|
@@ -60,11 +60,9 @@ export var useCommand = function (commandInput) {
|
|
|
60
60
|
useHotkeys(command.shortcut || [], command.action, command);
|
|
61
61
|
useEffect(function () {
|
|
62
62
|
if (command.enabled) {
|
|
63
|
-
console.log("Adding command: ".concat(command.id));
|
|
64
63
|
addCommand(command);
|
|
65
64
|
}
|
|
66
65
|
return function () {
|
|
67
|
-
console.log("Removing command: ".concat(command.id));
|
|
68
66
|
removeCommand(command.id);
|
|
69
67
|
};
|
|
70
68
|
}, [command, addCommand, removeCommand]);
|