@mieweb/ui 0.6.1-dev.158 → 0.6.1-dev.159
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/{chunk-7PA26KBF.cjs → chunk-3AMNAMJA.cjs} +4 -2
- package/dist/chunk-3AMNAMJA.cjs.map +1 -0
- package/dist/{chunk-3SSXDWD7.js → chunk-4N72FAQW.js} +13 -11
- package/dist/chunk-4N72FAQW.js.map +1 -0
- package/dist/{chunk-UHPQYBXQ.js → chunk-7QZSJFYT.js} +3 -6
- package/dist/chunk-7QZSJFYT.js.map +1 -0
- package/dist/{chunk-2T4JU5RH.cjs → chunk-CB4JX5EJ.cjs} +3 -6
- package/dist/chunk-CB4JX5EJ.cjs.map +1 -0
- package/dist/{chunk-TXYTMU3K.js → chunk-EYJDPYOP.js} +3 -3
- package/dist/{chunk-TXYTMU3K.js.map → chunk-EYJDPYOP.js.map} +1 -1
- package/dist/{chunk-6R2ZPDN7.cjs → chunk-HMQ2PRTB.cjs} +3 -3
- package/dist/{chunk-6R2ZPDN7.cjs.map → chunk-HMQ2PRTB.cjs.map} +1 -1
- package/dist/{chunk-FADQVM4M.cjs → chunk-KX4NWZIR.cjs} +5 -5
- package/dist/{chunk-FADQVM4M.cjs.map → chunk-KX4NWZIR.cjs.map} +1 -1
- package/dist/{chunk-RXY5SD3O.js → chunk-RUGWUQ47.js} +4 -2
- package/dist/chunk-RUGWUQ47.js.map +1 -0
- package/dist/{chunk-ASLZUFH4.js → chunk-TQV5CGSA.js} +3 -3
- package/dist/{chunk-ASLZUFH4.js.map → chunk-TQV5CGSA.js.map} +1 -1
- package/dist/{chunk-LZPPH5BW.cjs → chunk-WJIANZPI.cjs} +13 -11
- package/dist/chunk-WJIANZPI.cjs.map +1 -0
- package/dist/components/RichTextEditor/index.cjs +4 -4
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/SuperChat/index.cjs +61 -10
- package/dist/components/SuperChat/index.cjs.map +1 -1
- package/dist/components/SuperChat/index.js +60 -9
- package/dist/components/SuperChat/index.js.map +1 -1
- package/dist/components/SuperChat/plugins/index.cjs +7 -4
- package/dist/components/SuperChat/plugins/index.cjs.map +1 -1
- package/dist/components/SuperChat/plugins/index.js +6 -3
- package/dist/components/SuperChat/plugins/index.js.map +1 -1
- package/dist/datavis.cjs +5 -5
- package/dist/datavis.d.cts +1 -0
- package/dist/datavis.d.ts +1 -0
- package/dist/datavis.js +1 -1
- package/dist/index.cjs +52 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/kerebron.cjs +15 -0
- package/dist/kerebron.cjs.map +1 -1
- package/dist/kerebron.js +15 -0
- package/dist/kerebron.js.map +1 -1
- package/dist/{nitroTableGrid-J7F6D2QA.cjs → nitroTableGrid-RQNSZQO4.cjs} +14 -11
- package/dist/nitroTableGrid-RQNSZQO4.cjs.map +1 -0
- package/dist/nitroTableGrid-W6XWRFA7.js +25 -0
- package/dist/nitroTableGrid-W6XWRFA7.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-2T4JU5RH.cjs.map +0 -1
- package/dist/chunk-3SSXDWD7.js.map +0 -1
- package/dist/chunk-7PA26KBF.cjs.map +0 -1
- package/dist/chunk-LZPPH5BW.cjs.map +0 -1
- package/dist/chunk-RXY5SD3O.js.map +0 -1
- package/dist/chunk-UHPQYBXQ.js.map +0 -1
- package/dist/nitroTableGrid-GKJAX3J4.js +0 -22
- package/dist/nitroTableGrid-GKJAX3J4.js.map +0 -1
- package/dist/nitroTableGrid-J7F6D2QA.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextRenderContext } from '../../chunk-I6CY5C6A.js';
|
|
2
2
|
export { TextRenderContext, useTextRenderContext } from '../../chunk-I6CY5C6A.js';
|
|
3
3
|
import { ChatBubble, MCPToolCallDisplay, AITypingIndicator, SparklesIcon, CloseIcon } from '../../chunk-NQME7MCK.js';
|
|
4
|
-
import { MessageComposer } from '../../chunk-
|
|
4
|
+
import { MessageComposer } from '../../chunk-7QZSJFYT.js';
|
|
5
5
|
import { Dropdown, DropdownItem } from '../../chunk-M7BLVBL4.js';
|
|
6
6
|
import '../../chunk-KAKH2UZA.js';
|
|
7
7
|
import '../../chunk-PVUDXJAI.js';
|
|
@@ -100,7 +100,7 @@ function baseComponents() {
|
|
|
100
100
|
{
|
|
101
101
|
...props,
|
|
102
102
|
className: cn(
|
|
103
|
-
"text-primary-
|
|
103
|
+
"text-primary-800 hover:text-primary-900 dark:text-primary-300 underline underline-offset-2",
|
|
104
104
|
props.className
|
|
105
105
|
),
|
|
106
106
|
target: props.target ?? "_blank",
|
|
@@ -112,6 +112,7 @@ function baseComponents() {
|
|
|
112
112
|
"pre",
|
|
113
113
|
{
|
|
114
114
|
...props,
|
|
115
|
+
tabIndex: 0,
|
|
115
116
|
className: cn(
|
|
116
117
|
"overflow-x-auto rounded-lg bg-neutral-900 p-3 text-sm text-neutral-100 dark:bg-neutral-950",
|
|
117
118
|
props.className
|
|
@@ -125,12 +126,24 @@ function baseComponents() {
|
|
|
125
126
|
{
|
|
126
127
|
...props,
|
|
127
128
|
className: cn(
|
|
128
|
-
!isBlock && "rounded bg-neutral-200 px-1 py-0.5 text-[0.85em] dark:bg-neutral-700",
|
|
129
|
+
!isBlock && "rounded bg-neutral-200 px-1 py-0.5 text-[0.85em] text-neutral-800 dark:bg-neutral-700 dark:text-neutral-100",
|
|
129
130
|
props.className
|
|
130
131
|
)
|
|
131
132
|
}
|
|
132
133
|
);
|
|
133
134
|
},
|
|
135
|
+
input: ({ node: _node, ...props }) => {
|
|
136
|
+
if (props.type === "checkbox") {
|
|
137
|
+
return /* @__PURE__ */ jsx(
|
|
138
|
+
"input",
|
|
139
|
+
{
|
|
140
|
+
...props,
|
|
141
|
+
"aria-label": props["aria-label"] ?? (props["aria-labelledby"] ? void 0 : "Task list item")
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
return /* @__PURE__ */ jsx("input", { ...props });
|
|
146
|
+
},
|
|
134
147
|
table: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("div", { className: "my-2 overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
135
148
|
"table",
|
|
136
149
|
{
|
|
@@ -311,6 +324,43 @@ function lastMessageByTime(thread) {
|
|
|
311
324
|
}
|
|
312
325
|
return latest;
|
|
313
326
|
}
|
|
327
|
+
function parseHexColor(value) {
|
|
328
|
+
const hex = value.trim();
|
|
329
|
+
if (!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(hex)) return null;
|
|
330
|
+
const normalized = hex.length === 4 ? "#" + [...hex.slice(1)].map((char) => char + char).join("") : hex;
|
|
331
|
+
return [1, 3, 5].map(
|
|
332
|
+
(start) => parseInt(normalized.slice(start, start + 2), 16)
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
function relativeLuminanceChannel(channel) {
|
|
336
|
+
const normalized = channel / 255;
|
|
337
|
+
return normalized <= 0.03928 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
|
|
338
|
+
}
|
|
339
|
+
function relativeLuminance(value) {
|
|
340
|
+
const rgb = parseHexColor(value);
|
|
341
|
+
if (!rgb) return null;
|
|
342
|
+
const [red, green, blue] = rgb;
|
|
343
|
+
return 0.2126 * relativeLuminanceChannel(red) + 0.7152 * relativeLuminanceChannel(green) + 0.0722 * relativeLuminanceChannel(blue);
|
|
344
|
+
}
|
|
345
|
+
function contrastRatio(foreground, background) {
|
|
346
|
+
const foregroundLuminance = relativeLuminance(foreground);
|
|
347
|
+
const backgroundLuminance = relativeLuminance(background);
|
|
348
|
+
if (foregroundLuminance === null || backgroundLuminance === null) return null;
|
|
349
|
+
const lighter = Math.max(foregroundLuminance, backgroundLuminance);
|
|
350
|
+
const darker = Math.min(foregroundLuminance, backgroundLuminance);
|
|
351
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
352
|
+
}
|
|
353
|
+
function minimumContrastRatio(value, backgrounds) {
|
|
354
|
+
const contrasts = backgrounds.map((background) => contrastRatio(value, background)).filter((contrast) => contrast !== null);
|
|
355
|
+
if (contrasts.length !== backgrounds.length) return null;
|
|
356
|
+
return Math.min(...contrasts);
|
|
357
|
+
}
|
|
358
|
+
function accessibleAccentTextColor(value) {
|
|
359
|
+
if (!value) return void 0;
|
|
360
|
+
const contrast = minimumContrastRatio(value, ["#f5f5f5", "#262626"]);
|
|
361
|
+
if (contrast === null) return value;
|
|
362
|
+
return contrast < 4.5 ? void 0 : value;
|
|
363
|
+
}
|
|
314
364
|
function ParticipantAvatar({
|
|
315
365
|
participant
|
|
316
366
|
}) {
|
|
@@ -552,6 +602,7 @@ var MessageRow = React4.memo(function MessageRow2({
|
|
|
552
602
|
);
|
|
553
603
|
}
|
|
554
604
|
const accent = participant?.color;
|
|
605
|
+
const accentTextColor = accessibleAccentTextColor(accent);
|
|
555
606
|
const authorName = participant?.name ?? "Unknown";
|
|
556
607
|
const canEdit = !!editable && isSelf && !streaming && typeof message.text === "string" && !message.content?.length;
|
|
557
608
|
const startEdit = () => {
|
|
@@ -632,17 +683,17 @@ ${block.text}
|
|
|
632
683
|
"span",
|
|
633
684
|
{
|
|
634
685
|
className: "text-xs font-medium",
|
|
635
|
-
style:
|
|
686
|
+
style: accentTextColor ? { color: accentTextColor } : void 0,
|
|
636
687
|
children: authorName
|
|
637
688
|
}
|
|
638
689
|
),
|
|
639
|
-
participant?.role && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-400", children: participant.role }),
|
|
640
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-400", children: formatTime(message.time) }),
|
|
690
|
+
participant?.role && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: participant.role }),
|
|
691
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: formatTime(message.time) }),
|
|
641
692
|
message.editedAt && /* @__PURE__ */ jsx(
|
|
642
693
|
"span",
|
|
643
694
|
{
|
|
644
695
|
"data-slot": "superchat-edited-indicator",
|
|
645
|
-
className: "text-[10px] text-neutral-400",
|
|
696
|
+
className: "text-[10px] text-neutral-500 dark:text-neutral-400",
|
|
646
697
|
title: `Edited ${formatTime(message.editedAt)}`,
|
|
647
698
|
children: "(edited)"
|
|
648
699
|
}
|
|
@@ -685,7 +736,7 @@ ${block.text}
|
|
|
685
736
|
"data-slot": "superchat-bubble",
|
|
686
737
|
variant: isSelf ? "user" : "assistant",
|
|
687
738
|
hasError: message.status === "error",
|
|
688
|
-
className: "text-sm",
|
|
739
|
+
className: "text-sm has-[[data-slot=superchat-nitro-table]]:w-full has-[[data-slot=superchat-nitro-table]]:max-w-full",
|
|
689
740
|
children: isEditing ? /* @__PURE__ */ jsxs(
|
|
690
741
|
"div",
|
|
691
742
|
{
|
|
@@ -1166,7 +1217,7 @@ function SuperChatConversations({
|
|
|
1166
1217
|
children: [
|
|
1167
1218
|
/* @__PURE__ */ jsxs("span", { className: "flex-1 truncate", children: [
|
|
1168
1219
|
/* @__PURE__ */ jsx("span", { className: "block truncate font-medium", children: c.title }),
|
|
1169
|
-
last?.text && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-neutral-400", children: last.text })
|
|
1220
|
+
last?.text && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-neutral-600 dark:text-neutral-400", children: last.text })
|
|
1170
1221
|
] }),
|
|
1171
1222
|
!!c.unread && /* @__PURE__ */ jsxs("span", { className: "bg-primary-600 ml-1 inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[10px] font-semibold text-white", children: [
|
|
1172
1223
|
c.unread,
|