@mieweb/ui 0.10.0-dev.6 → 0.10.0-dev.8

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.
Files changed (105) hide show
  1. package/agent/mieweb-ui.instructions.md +13 -1
  2. package/dist/brands/index.cjs +13 -13
  3. package/dist/brands/index.js +1 -1
  4. package/dist/chunk-3YBS4WUQ.js +52 -0
  5. package/dist/chunk-3YBS4WUQ.js.map +1 -0
  6. package/dist/chunk-4IS3QCOQ.cjs +453 -0
  7. package/dist/chunk-4IS3QCOQ.cjs.map +1 -0
  8. package/dist/chunk-4NCDU5IG.cjs +56 -0
  9. package/dist/chunk-4NCDU5IG.cjs.map +1 -0
  10. package/dist/chunk-76TBQDED.js +166 -0
  11. package/dist/chunk-76TBQDED.js.map +1 -0
  12. package/dist/{chunk-JI244Y7C.js → chunk-7G3ZIYFY.js} +13 -3
  13. package/dist/chunk-7G3ZIYFY.js.map +1 -0
  14. package/dist/chunk-DZ5HFLRC.js +258 -0
  15. package/dist/chunk-DZ5HFLRC.js.map +1 -0
  16. package/dist/{chunk-U42F3HLE.cjs → chunk-EZSSESEU.cjs} +13 -3
  17. package/dist/chunk-EZSSESEU.cjs.map +1 -0
  18. package/dist/chunk-G4D6CLBT.js +333 -0
  19. package/dist/chunk-G4D6CLBT.js.map +1 -0
  20. package/dist/chunk-IT775BYG.js +179 -0
  21. package/dist/chunk-IT775BYG.js.map +1 -0
  22. package/dist/{chunk-ELPW32ZI.cjs → chunk-KQUI4BGS.cjs} +3 -3
  23. package/dist/{chunk-ELPW32ZI.cjs.map → chunk-KQUI4BGS.cjs.map} +1 -1
  24. package/dist/{chunk-WNM7IZJ7.js → chunk-MNILXWVY.js} +2 -2
  25. package/dist/{chunk-WNM7IZJ7.js.map → chunk-MNILXWVY.js.map} +1 -1
  26. package/dist/chunk-OCSCBB52.cjs +188 -0
  27. package/dist/chunk-OCSCBB52.cjs.map +1 -0
  28. package/dist/{chunk-2YCERQWC.js → chunk-TVTIGV7Q.js} +3 -3
  29. package/dist/{chunk-2YCERQWC.js.map → chunk-TVTIGV7Q.js.map} +1 -1
  30. package/dist/chunk-URAQIF67.cjs +356 -0
  31. package/dist/chunk-URAQIF67.cjs.map +1 -0
  32. package/dist/chunk-VINZZQBD.cjs +323 -0
  33. package/dist/chunk-VINZZQBD.cjs.map +1 -0
  34. package/dist/chunk-XDIMTPZU.cjs +202 -0
  35. package/dist/chunk-XDIMTPZU.cjs.map +1 -0
  36. package/dist/chunk-XVW5DPPP.js +429 -0
  37. package/dist/chunk-XVW5DPPP.js.map +1 -0
  38. package/dist/chunk-XZNN3S3S.cjs +281 -0
  39. package/dist/chunk-XZNN3S3S.cjs.map +1 -0
  40. package/dist/chunk-Y4QNLW7W.js +300 -0
  41. package/dist/chunk-Y4QNLW7W.js.map +1 -0
  42. package/dist/{chunk-2QKBTPUC.cjs → chunk-ZPSJ2UV6.cjs} +2 -2
  43. package/dist/{chunk-2QKBTPUC.cjs.map → chunk-ZPSJ2UV6.cjs.map} +1 -1
  44. package/dist/components/BoardView/index.cjs +24 -0
  45. package/dist/components/BoardView/index.cjs.map +1 -0
  46. package/dist/components/BoardView/index.d.cts +42 -0
  47. package/dist/components/BoardView/index.d.ts +42 -0
  48. package/dist/components/BoardView/index.js +7 -0
  49. package/dist/components/BoardView/index.js.map +1 -0
  50. package/dist/components/CalendarView/index.cjs +22 -0
  51. package/dist/components/CalendarView/index.cjs.map +1 -0
  52. package/dist/components/CalendarView/index.d.cts +40 -0
  53. package/dist/components/CalendarView/index.d.ts +40 -0
  54. package/dist/components/CalendarView/index.js +9 -0
  55. package/dist/components/CalendarView/index.js.map +1 -0
  56. package/dist/components/GanttView/index.cjs +20 -0
  57. package/dist/components/GanttView/index.cjs.map +1 -0
  58. package/dist/components/GanttView/index.d.cts +37 -0
  59. package/dist/components/GanttView/index.d.ts +37 -0
  60. package/dist/components/GanttView/index.js +7 -0
  61. package/dist/components/GanttView/index.js.map +1 -0
  62. package/dist/components/ListView/index.cjs +22 -0
  63. package/dist/components/ListView/index.cjs.map +1 -0
  64. package/dist/components/ListView/index.d.cts +37 -0
  65. package/dist/components/ListView/index.d.ts +37 -0
  66. package/dist/components/ListView/index.js +9 -0
  67. package/dist/components/ListView/index.js.map +1 -0
  68. package/dist/components/Markdown/index.cjs +15 -15
  69. package/dist/components/Markdown/index.js +3 -3
  70. package/dist/components/QuickAction/index.d.cts +1 -1
  71. package/dist/components/QuickAction/index.d.ts +1 -1
  72. package/dist/components/SuperChat/index.cjs +185 -159
  73. package/dist/components/SuperChat/index.cjs.map +1 -1
  74. package/dist/components/SuperChat/index.js +185 -159
  75. package/dist/components/SuperChat/index.js.map +1 -1
  76. package/dist/components/ViewSet/index.cjs +23 -0
  77. package/dist/components/ViewSet/index.cjs.map +1 -0
  78. package/dist/components/ViewSet/index.d.cts +89 -0
  79. package/dist/components/ViewSet/index.d.ts +89 -0
  80. package/dist/components/ViewSet/index.js +14 -0
  81. package/dist/components/ViewSet/index.js.map +1 -0
  82. package/dist/components/ViewSwitcher/index.cjs +20 -0
  83. package/dist/components/ViewSwitcher/index.cjs.map +1 -0
  84. package/dist/components/ViewSwitcher/index.d.cts +40 -0
  85. package/dist/components/ViewSwitcher/index.d.ts +40 -0
  86. package/dist/components/ViewSwitcher/index.js +7 -0
  87. package/dist/components/ViewSwitcher/index.js.map +1 -0
  88. package/dist/esheet.cjs +5 -5
  89. package/dist/esheet.js +2 -2
  90. package/dist/hooks/index.cjs +5 -5
  91. package/dist/hooks/index.js +1 -1
  92. package/dist/index.cjs +439 -372
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.d.cts +8 -0
  95. package/dist/index.d.ts +8 -0
  96. package/dist/index.js +57 -50
  97. package/dist/index.js.map +1 -1
  98. package/dist/styles.css +1 -1
  99. package/dist/tailwind-preset.cjs +4 -4
  100. package/dist/tailwind-preset.js +1 -1
  101. package/dist/types-CbWXIKbe.d.cts +119 -0
  102. package/dist/types-CbWXIKbe.d.ts +119 -0
  103. package/package.json +1 -1
  104. package/dist/chunk-JI244Y7C.js.map +0 -1
  105. package/dist/chunk-U42F3HLE.cjs.map +0 -1
@@ -0,0 +1,37 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { a as ViewBaseProps, S as Stage } from '../../types-CbWXIKbe.cjs';
5
+ import 'react';
6
+ import 'luxon';
7
+
8
+ type ListViewSlot = 'group' | 'groupHeader' | 'item' | 'selectedItem' | 'state';
9
+ interface ListViewProps<T> extends ViewBaseProps<T>, VariantProps<typeof itemVariants> {
10
+ /**
11
+ * Group rows by `accessors.getStatus`, using these stages for order and
12
+ * labels. Items whose status matches no stage are appended under their own
13
+ * heading rather than dropped.
14
+ */
15
+ stages?: readonly Stage[];
16
+ /** Group by `accessors.getGroup` instead of by stage. */
17
+ groupBy?: 'status' | 'group' | 'none';
18
+ /** Groups that start collapsed. Uncontrolled; the user can reopen them. */
19
+ defaultCollapsedGroups?: readonly string[];
20
+ /** Retries the failed load. Renders the retry action only when provided. */
21
+ onRetry?: () => void;
22
+ classNames?: Partial<Record<ListViewSlot, string>>;
23
+ /** Heading level for group headers, under the page's own heading. */
24
+ headingLevel?: 'h2' | 'h3' | 'h4';
25
+ }
26
+ declare const itemVariants: (props?: ({
27
+ density?: "compact" | "comfortable" | null | undefined;
28
+ interactive?: boolean | null | undefined;
29
+ selected?: boolean | null | undefined;
30
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
31
+ /**
32
+ * Declared `parameters.catalog.collection` — the three load states below are
33
+ * part of this component's API, not decoration.
34
+ */
35
+ declare function ListView<T>({ items, accessors, loading, error, selectedId, onOpen, getHref, renderItem, emptyState, labels, stages, groupBy, defaultCollapsedGroups, onRetry, density, className, classNames, headingLevel: Heading, }: ListViewProps<T>): react_jsx_runtime.JSX.Element;
36
+
37
+ export { ListView, type ListViewProps, type ListViewSlot, itemVariants as listViewItemVariants };
@@ -0,0 +1,37 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { a as ViewBaseProps, S as Stage } from '../../types-CbWXIKbe.js';
5
+ import 'react';
6
+ import 'luxon';
7
+
8
+ type ListViewSlot = 'group' | 'groupHeader' | 'item' | 'selectedItem' | 'state';
9
+ interface ListViewProps<T> extends ViewBaseProps<T>, VariantProps<typeof itemVariants> {
10
+ /**
11
+ * Group rows by `accessors.getStatus`, using these stages for order and
12
+ * labels. Items whose status matches no stage are appended under their own
13
+ * heading rather than dropped.
14
+ */
15
+ stages?: readonly Stage[];
16
+ /** Group by `accessors.getGroup` instead of by stage. */
17
+ groupBy?: 'status' | 'group' | 'none';
18
+ /** Groups that start collapsed. Uncontrolled; the user can reopen them. */
19
+ defaultCollapsedGroups?: readonly string[];
20
+ /** Retries the failed load. Renders the retry action only when provided. */
21
+ onRetry?: () => void;
22
+ classNames?: Partial<Record<ListViewSlot, string>>;
23
+ /** Heading level for group headers, under the page's own heading. */
24
+ headingLevel?: 'h2' | 'h3' | 'h4';
25
+ }
26
+ declare const itemVariants: (props?: ({
27
+ density?: "compact" | "comfortable" | null | undefined;
28
+ interactive?: boolean | null | undefined;
29
+ selected?: boolean | null | undefined;
30
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
31
+ /**
32
+ * Declared `parameters.catalog.collection` — the three load states below are
33
+ * part of this component's API, not decoration.
34
+ */
35
+ declare function ListView<T>({ items, accessors, loading, error, selectedId, onOpen, getHref, renderItem, emptyState, labels, stages, groupBy, defaultCollapsedGroups, onRetry, density, className, classNames, headingLevel: Heading, }: ListViewProps<T>): react_jsx_runtime.JSX.Element;
36
+
37
+ export { ListView, type ListViewProps, type ListViewSlot, itemVariants as listViewItemVariants };
@@ -0,0 +1,9 @@
1
+ export { ListView, itemVariants as listViewItemVariants } from '../../chunk-DZ5HFLRC.js';
2
+ import '../../chunk-3YBS4WUQ.js';
3
+ import '../../chunk-UA7E7PDS.js';
4
+ import '../../chunk-BKSPDTX4.js';
5
+ import '../../chunk-GOALNQZ2.js';
6
+ import '../../chunk-TQONQSJO.js';
7
+ import '../../chunk-PX6F3LHL.js';
8
+ //# sourceMappingURL=index.js.map
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunk2QKBTPUC_cjs = require('../../chunk-2QKBTPUC.cjs');
4
- var chunk7ZXAQTV4_cjs = require('../../chunk-7ZXAQTV4.cjs');
5
- var chunk5MCBWTIF_cjs = require('../../chunk-5MCBWTIF.cjs');
3
+ var chunkZPSJ2UV6_cjs = require('../../chunk-ZPSJ2UV6.cjs');
6
4
  var chunk3QEVGSFG_cjs = require('../../chunk-3QEVGSFG.cjs');
7
5
  var chunkIX6KFB3K_cjs = require('../../chunk-IX6KFB3K.cjs');
6
+ var chunk7ZXAQTV4_cjs = require('../../chunk-7ZXAQTV4.cjs');
7
+ var chunk5MCBWTIF_cjs = require('../../chunk-5MCBWTIF.cjs');
8
8
  var chunkUV2FVNWT_cjs = require('../../chunk-UV2FVNWT.cjs');
9
9
  require('../../chunk-VNYW4C4J.cjs');
10
10
  require('../../chunk-S5RVSXDV.cjs');
@@ -14,27 +14,19 @@ require('../../chunk-EUAMEVVI.cjs');
14
14
 
15
15
  Object.defineProperty(exports, "CodeBlock", {
16
16
  enumerable: true,
17
- get: function () { return chunk2QKBTPUC_cjs.CodeBlock; }
17
+ get: function () { return chunkZPSJ2UV6_cjs.CodeBlock; }
18
18
  });
19
19
  Object.defineProperty(exports, "MarkdownRenderer", {
20
20
  enumerable: true,
21
- get: function () { return chunk2QKBTPUC_cjs.MarkdownRenderer; }
21
+ get: function () { return chunkZPSJ2UV6_cjs.MarkdownRenderer; }
22
22
  });
23
23
  Object.defineProperty(exports, "highlightCode", {
24
24
  enumerable: true,
25
- get: function () { return chunk2QKBTPUC_cjs.highlightCode; }
25
+ get: function () { return chunkZPSJ2UV6_cjs.highlightCode; }
26
26
  });
27
27
  Object.defineProperty(exports, "useMarkdown", {
28
28
  enumerable: true,
29
- get: function () { return chunk2QKBTPUC_cjs.useMarkdown; }
30
- });
31
- Object.defineProperty(exports, "HtmlPreviewBlock", {
32
- enumerable: true,
33
- get: function () { return chunk7ZXAQTV4_cjs.HtmlPreviewBlock; }
34
- });
35
- Object.defineProperty(exports, "MermaidBlock", {
36
- enumerable: true,
37
- get: function () { return chunk5MCBWTIF_cjs.MermaidBlock; }
29
+ get: function () { return chunkZPSJ2UV6_cjs.useMarkdown; }
38
30
  });
39
31
  Object.defineProperty(exports, "SurveyBlock", {
40
32
  enumerable: true,
@@ -44,6 +36,14 @@ Object.defineProperty(exports, "CsvBlock", {
44
36
  enumerable: true,
45
37
  get: function () { return chunkIX6KFB3K_cjs.CsvBlock; }
46
38
  });
39
+ Object.defineProperty(exports, "HtmlPreviewBlock", {
40
+ enumerable: true,
41
+ get: function () { return chunk7ZXAQTV4_cjs.HtmlPreviewBlock; }
42
+ });
43
+ Object.defineProperty(exports, "MermaidBlock", {
44
+ enumerable: true,
45
+ get: function () { return chunk5MCBWTIF_cjs.MermaidBlock; }
46
+ });
47
47
  Object.defineProperty(exports, "FenceBlock", {
48
48
  enumerable: true,
49
49
  get: function () { return chunkUV2FVNWT_cjs.FenceBlock; }
@@ -1,8 +1,8 @@
1
- export { CodeBlock, MarkdownRenderer, highlightCode, useMarkdown } from '../../chunk-WNM7IZJ7.js';
2
- export { HtmlPreviewBlock } from '../../chunk-V7D3YGUV.js';
3
- export { MermaidBlock } from '../../chunk-KZFBQ7GY.js';
1
+ export { CodeBlock, MarkdownRenderer, highlightCode, useMarkdown } from '../../chunk-MNILXWVY.js';
4
2
  export { SurveyBlock } from '../../chunk-DEDN5HAG.js';
5
3
  export { CsvBlock } from '../../chunk-TMMVIUUN.js';
4
+ export { HtmlPreviewBlock } from '../../chunk-V7D3YGUV.js';
5
+ export { MermaidBlock } from '../../chunk-KZFBQ7GY.js';
6
6
  export { FenceBlock } from '../../chunk-H4ZXMQQW.js';
7
7
  import '../../chunk-GOALNQZ2.js';
8
8
  import '../../chunk-TQONQSJO.js';
@@ -3,7 +3,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
3
3
  import * as React from 'react';
4
4
 
5
5
  declare const quickActionIconVariants: (props?: ({
6
- color?: "primary" | "blue" | "green" | "orange" | "purple" | "red" | "amber" | "neutral" | null | undefined;
6
+ color?: "primary" | "blue" | "green" | "orange" | "purple" | "red" | "neutral" | "amber" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string;
8
8
  declare const quickActionVariants: (props?: ({
9
9
  disabled?: boolean | null | undefined;
@@ -3,7 +3,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
3
3
  import * as React from 'react';
4
4
 
5
5
  declare const quickActionIconVariants: (props?: ({
6
- color?: "primary" | "blue" | "green" | "orange" | "purple" | "red" | "amber" | "neutral" | null | undefined;
6
+ color?: "primary" | "blue" | "green" | "orange" | "purple" | "red" | "neutral" | "amber" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string;
8
8
  declare const quickActionVariants: (props?: ({
9
9
  disabled?: boolean | null | undefined;
@@ -604,11 +604,7 @@ var MessageActionsBar = React2__namespace.forwardRef(function MessageActionsBar2
604
604
  {
605
605
  ref,
606
606
  "data-slot": "superchat-message-actions",
607
- className: chunkS5RVSXDV_cjs.cn(
608
- "flex items-center gap-0.5",
609
- isSelf && "justify-end",
610
- actionRevealClass
611
- ),
607
+ className: chunkS5RVSXDV_cjs.cn("flex flex-col items-center gap-0.5", actionRevealClass),
612
608
  children: actions.map((action) => /* @__PURE__ */ jsxRuntime.jsx(FooterActionButton, { action, isSelf }, action.id))
613
609
  }
614
610
  );
@@ -627,7 +623,7 @@ function MessageOverflowMenu({
627
623
  "div",
628
624
  {
629
625
  className: chunkS5RVSXDV_cjs.cn(
630
- "sticky bottom-2 shrink-0 self-end transition-opacity",
626
+ "sticky bottom-2 mt-auto shrink-0 transition-opacity",
631
627
  // Rich content (e.g. NITRO tables) layers internals up to z-50, so the
632
628
  // open menu's stacking context must clear that.
633
629
  open ? "z-[60]" : "z-10",
@@ -686,6 +682,7 @@ var MessageRow = React2__namespace.memo(function MessageRow2({
686
682
  const hasBody = !!message.text || (message.content?.length ?? 0) > 0;
687
683
  const [isEditing, setIsEditing] = React2__namespace.useState(false);
688
684
  const [draft, setDraft] = React2__namespace.useState(message.text ?? "");
685
+ const [editMinWidth, setEditMinWidth] = React2__namespace.useState();
689
686
  const editRef = React2__namespace.useRef(null);
690
687
  const bubbleRef = React2__namespace.useRef(null);
691
688
  const autosize = React2__namespace.useCallback(() => {
@@ -715,7 +712,10 @@ ${block.text}
715
712
  return "";
716
713
  }).filter(Boolean).join("\n\n") ?? "";
717
714
  const canCopy = !isEditing && (!!message.content?.length || typeof message.text === "string" && message.text.length > 0);
718
- const hasActions = canCopy || canEdit && !isEditing;
715
+ const showEditAction = canEdit && !isEditing;
716
+ const actionCount = (canCopy ? 1 : 0) + (showEditAction ? 1 : 0);
717
+ const hasActions = actionCount > 0;
718
+ const collapseToMenu = actionCount > 1;
719
719
  const copy = useMessageCopy({
720
720
  markdown: markdownSource,
721
721
  getHtml: () => bubbleRef.current?.innerHTML ?? "",
@@ -732,7 +732,7 @@ ${block.text}
732
732
  });
733
733
  observer.observe(el);
734
734
  return () => observer.disconnect();
735
- }, [hasActions]);
735
+ }, [hasActions, collapseToMenu]);
736
736
  if (message.type === "system") {
737
737
  return /* @__PURE__ */ jsxRuntime.jsx(
738
738
  "div",
@@ -765,6 +765,12 @@ ${block.text}
765
765
  const accentTextColor = accessibleAccentTextColor(accent);
766
766
  const authorName = participant?.name ?? "Unknown";
767
767
  const startEdit = () => {
768
+ const el = bubbleRef.current;
769
+ if (el) {
770
+ const cs = getComputedStyle(el);
771
+ const contentWidth = el.clientWidth - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight);
772
+ setEditMinWidth(contentWidth > 0 ? contentWidth : void 0);
773
+ }
768
774
  setDraft(message.text ?? "");
769
775
  setIsEditing(true);
770
776
  };
@@ -838,7 +844,7 @@ ${block.text}
838
844
  }
839
845
  }
840
846
  ] : [],
841
- ...canEdit && !isEditing ? [
847
+ ...showEditAction ? [
842
848
  {
843
849
  id: "edit",
844
850
  label: "Edit message",
@@ -858,172 +864,191 @@ ${block.text}
858
864
  isSelf ? "flex-row-reverse" : "flex-row"
859
865
  ),
860
866
  children: [
861
- /* @__PURE__ */ jsxRuntime.jsx(ParticipantAvatar, { participant }),
862
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkS5RVSXDV_cjs.cn("flex min-w-0 flex-col gap-1", isSelf && "items-end"), children: [
863
- /* @__PURE__ */ jsxRuntime.jsxs(
864
- "div",
865
- {
866
- "data-slot": "superchat-message-meta",
867
- className: "flex items-baseline gap-2",
868
- children: [
867
+ /* @__PURE__ */ jsxRuntime.jsxs(
868
+ "div",
869
+ {
870
+ "data-slot": "superchat-message-gutter",
871
+ className: "flex shrink-0 flex-col items-center gap-1",
872
+ children: [
873
+ /* @__PURE__ */ jsxRuntime.jsx(ParticipantAvatar, { participant }),
874
+ hasActions && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
869
875
  /* @__PURE__ */ jsxRuntime.jsx(
870
- "span",
871
- {
872
- className: "text-xs font-medium",
873
- style: accentTextColor ? { color: accentTextColor } : void 0,
874
- children: authorName
875
- }
876
- ),
877
- participant?.role && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: participant.role }),
878
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: formatTime(message.time) }),
879
- message.editedAt && /* @__PURE__ */ jsxRuntime.jsx(
880
- "span",
881
- {
882
- "data-slot": "superchat-edited-indicator",
883
- className: "text-[10px] text-neutral-500 dark:text-neutral-400",
884
- title: `Edited ${formatTime(message.editedAt)}`,
885
- children: "(edited)"
886
- }
887
- )
888
- ]
889
- }
890
- ),
891
- /* @__PURE__ */ jsxRuntime.jsxs(
892
- "div",
893
- {
894
- className: chunkS5RVSXDV_cjs.cn(
895
- "flex items-center gap-1",
896
- isSelf ? "flex-row-reverse" : "flex-row"
897
- ),
898
- children: [
899
- hasActions && /* @__PURE__ */ jsxRuntime.jsx(
900
876
  MessageOverflowMenu,
901
877
  {
902
878
  isSelf,
903
879
  actions,
904
- footerVisible
880
+ footerVisible: collapseToMenu ? false : footerVisible
905
881
  }
906
882
  ),
907
- /* @__PURE__ */ jsxRuntime.jsx(
908
- chunkWIAQQNFU_cjs.ChatBubble,
883
+ !collapseToMenu && /* @__PURE__ */ jsxRuntime.jsx(
884
+ MessageActionsBar,
909
885
  {
910
- ref: bubbleRef,
911
- "data-slot": "superchat-bubble",
912
- variant: isSelf ? "user" : "assistant",
913
- hasError: message.status === "error",
914
- className: "text-sm has-[[data-slot=superchat-nitro-table]]:w-full has-[[data-slot=superchat-nitro-table]]:max-w-full",
915
- children: isEditing ? /* @__PURE__ */ jsxRuntime.jsxs(
916
- "div",
886
+ ref: actionsBarRef,
887
+ actions,
888
+ isSelf
889
+ }
890
+ )
891
+ ] })
892
+ ]
893
+ }
894
+ ),
895
+ /* @__PURE__ */ jsxRuntime.jsxs(
896
+ "div",
897
+ {
898
+ className: chunkS5RVSXDV_cjs.cn(
899
+ "flex min-w-0 flex-1 flex-col gap-1",
900
+ isSelf && "items-end"
901
+ ),
902
+ children: [
903
+ /* @__PURE__ */ jsxRuntime.jsxs(
904
+ "div",
905
+ {
906
+ "data-slot": "superchat-message-meta",
907
+ className: "flex items-baseline gap-2",
908
+ children: [
909
+ /* @__PURE__ */ jsxRuntime.jsx(
910
+ "span",
917
911
  {
918
- "data-slot": "superchat-message-editor",
919
- className: "flex w-80 max-w-full flex-col gap-2",
920
- children: [
921
- /* @__PURE__ */ jsxRuntime.jsx(
922
- "textarea",
923
- {
924
- value: draft,
925
- ref: editRef,
926
- rows: 2,
927
- onChange: (e) => {
928
- setDraft(e.target.value);
929
- autosize();
930
- },
931
- onPaste: handleEditPaste,
932
- onKeyDown: (e) => {
933
- if (e.key === "Enter" && !e.shiftKey) {
934
- e.preventDefault();
935
- saveEdit();
936
- } else if (e.key === "Escape") {
937
- e.preventDefault();
938
- cancelEdit();
939
- }
940
- },
941
- "aria-label": "Edit message",
942
- className: "focus:ring-primary-500 max-h-60 min-h-16 w-full resize-none rounded-lg border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 focus:ring-1 focus:outline-none dark:border-neutral-600 dark:bg-neutral-900 dark:text-white"
943
- }
944
- ),
945
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
912
+ className: "text-xs font-medium",
913
+ style: accentTextColor ? { color: accentTextColor } : void 0,
914
+ children: authorName
915
+ }
916
+ ),
917
+ participant?.role && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: participant.role }),
918
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: formatTime(message.time) }),
919
+ message.editedAt && /* @__PURE__ */ jsxRuntime.jsx(
920
+ "span",
921
+ {
922
+ "data-slot": "superchat-edited-indicator",
923
+ className: "text-[10px] text-neutral-500 dark:text-neutral-400",
924
+ title: `Edited ${formatTime(message.editedAt)}`,
925
+ children: "(edited)"
926
+ }
927
+ )
928
+ ]
929
+ }
930
+ ),
931
+ /* @__PURE__ */ jsxRuntime.jsx(
932
+ "div",
933
+ {
934
+ className: chunkS5RVSXDV_cjs.cn(
935
+ "flex w-full items-center gap-1",
936
+ isSelf ? "flex-row-reverse" : "flex-row"
937
+ ),
938
+ children: /* @__PURE__ */ jsxRuntime.jsx(
939
+ chunkWIAQQNFU_cjs.ChatBubble,
940
+ {
941
+ ref: bubbleRef,
942
+ "data-slot": "superchat-bubble",
943
+ variant: isSelf ? "user" : "assistant",
944
+ hasError: message.status === "error",
945
+ className: "text-sm has-[[data-slot=superchat-nitro-table]]:w-full has-[[data-slot=superchat-nitro-table]]:max-w-full",
946
+ children: isEditing ? /* @__PURE__ */ jsxRuntime.jsxs(
947
+ "div",
948
+ {
949
+ "data-slot": "superchat-message-editor",
950
+ className: "flex w-80 max-w-full flex-col gap-2",
951
+ style: editMinWidth ? { minWidth: editMinWidth } : void 0,
952
+ children: [
946
953
  /* @__PURE__ */ jsxRuntime.jsx(
947
- "button",
954
+ "textarea",
948
955
  {
949
- type: "button",
950
- onClick: cancelEdit,
951
- className: "rounded-md px-2.5 py-1 text-xs font-medium text-neutral-200 hover:bg-white/10",
952
- children: "Cancel"
956
+ value: draft,
957
+ ref: editRef,
958
+ rows: 2,
959
+ onChange: (e) => {
960
+ setDraft(e.target.value);
961
+ autosize();
962
+ },
963
+ onPaste: handleEditPaste,
964
+ onKeyDown: (e) => {
965
+ if (e.key === "Enter" && !e.shiftKey) {
966
+ e.preventDefault();
967
+ saveEdit();
968
+ } else if (e.key === "Escape") {
969
+ e.preventDefault();
970
+ cancelEdit();
971
+ }
972
+ },
973
+ "aria-label": "Edit message",
974
+ className: "focus:ring-primary-500 max-h-60 min-h-16 w-full resize-none rounded-lg border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 focus:ring-1 focus:outline-none dark:border-neutral-600 dark:bg-neutral-900 dark:text-white"
953
975
  }
954
976
  ),
955
- /* @__PURE__ */ jsxRuntime.jsx(
956
- "button",
957
- {
958
- type: "button",
959
- onClick: saveEdit,
960
- disabled: !draft.trim() || draft.trim() === message.text,
961
- className: "rounded-md bg-white px-2.5 py-1 text-xs font-medium text-neutral-900 hover:bg-neutral-100 disabled:opacity-40",
962
- children: "Save"
963
- }
964
- )
965
- ] })
966
- ]
967
- }
968
- ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
969
- message.content?.map((block, i) => {
970
- if (block.type === "tool_use" && block.toolCall) {
971
- return /* @__PURE__ */ jsxRuntime.jsx(chunkWIAQQNFU_cjs.MCPToolCallDisplay, { toolCall: block.toolCall }, i);
972
- }
973
- if ((block.type === "text" || block.type === "thinking") && block.text) {
974
- return /* @__PURE__ */ jsxRuntime.jsx(
975
- "div",
976
- {
977
- className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
978
- children: renderText(block.text, {
979
- messageId: message.id,
980
- streaming,
981
- role: participant?.kind === "human" ? "user" : "assistant"
982
- })
983
- },
984
- i
985
- );
977
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
978
+ /* @__PURE__ */ jsxRuntime.jsx(
979
+ "button",
980
+ {
981
+ type: "button",
982
+ onClick: cancelEdit,
983
+ className: "rounded-md px-2.5 py-1 text-xs font-medium text-neutral-200 hover:bg-white/10",
984
+ children: "Cancel"
985
+ }
986
+ ),
987
+ /* @__PURE__ */ jsxRuntime.jsx(
988
+ "button",
989
+ {
990
+ type: "button",
991
+ onClick: saveEdit,
992
+ disabled: !draft.trim() || draft.trim() === message.text,
993
+ className: "rounded-md bg-white px-2.5 py-1 text-xs font-medium text-neutral-900 hover:bg-neutral-100 disabled:opacity-40",
994
+ children: "Save"
995
+ }
996
+ )
997
+ ] })
998
+ ]
986
999
  }
987
- if (block.type === "code" && block.text) {
988
- const fenced = `\`\`\`${block.language ?? ""}
1000
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1001
+ message.content?.map((block, i) => {
1002
+ if (block.type === "tool_use" && block.toolCall) {
1003
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkWIAQQNFU_cjs.MCPToolCallDisplay, { toolCall: block.toolCall }, i);
1004
+ }
1005
+ if ((block.type === "text" || block.type === "thinking") && block.text) {
1006
+ return /* @__PURE__ */ jsxRuntime.jsx(
1007
+ "div",
1008
+ {
1009
+ className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
1010
+ children: renderText(block.text, {
1011
+ messageId: message.id,
1012
+ streaming,
1013
+ role: participant?.kind === "human" ? "user" : "assistant"
1014
+ })
1015
+ },
1016
+ i
1017
+ );
1018
+ }
1019
+ if (block.type === "code" && block.text) {
1020
+ const fenced = `\`\`\`${block.language ?? ""}
989
1021
  ${block.text}
990
1022
  \`\`\``;
991
- return /* @__PURE__ */ jsxRuntime.jsx(
992
- "div",
993
- {
994
- className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
995
- children: renderText(fenced, {
996
- messageId: message.id,
997
- streaming,
998
- role: participant?.kind === "human" ? "user" : "assistant"
999
- })
1000
- },
1001
- i
1002
- );
1003
- }
1004
- return null;
1005
- }),
1006
- message.text && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word", children: renderText(message.text, {
1007
- messageId: message.id,
1008
- streaming,
1009
- role: participant?.kind === "human" ? "user" : "assistant"
1010
- }) }),
1011
- streaming && !hasBody && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(chunkWIAQQNFU_cjs.AITypingIndicator, {}) })
1012
- ] })
1013
- }
1014
- )
1015
- ]
1016
- }
1017
- ),
1018
- hasActions && /* @__PURE__ */ jsxRuntime.jsx(
1019
- MessageActionsBar,
1020
- {
1021
- ref: actionsBarRef,
1022
- actions,
1023
- isSelf
1024
- }
1025
- )
1026
- ] })
1023
+ return /* @__PURE__ */ jsxRuntime.jsx(
1024
+ "div",
1025
+ {
1026
+ className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
1027
+ children: renderText(fenced, {
1028
+ messageId: message.id,
1029
+ streaming,
1030
+ role: participant?.kind === "human" ? "user" : "assistant"
1031
+ })
1032
+ },
1033
+ i
1034
+ );
1035
+ }
1036
+ return null;
1037
+ }),
1038
+ message.text && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word", children: renderText(message.text, {
1039
+ messageId: message.id,
1040
+ streaming,
1041
+ role: participant?.kind === "human" ? "user" : "assistant"
1042
+ }) }),
1043
+ streaming && !hasBody && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(chunkWIAQQNFU_cjs.AITypingIndicator, {}) })
1044
+ ] })
1045
+ }
1046
+ )
1047
+ }
1048
+ )
1049
+ ]
1050
+ }
1051
+ )
1027
1052
  ]
1028
1053
  }
1029
1054
  );
@@ -1350,6 +1375,7 @@ function SuperChat({
1350
1375
  onValueChange: handleDraftChange,
1351
1376
  onSend: handleComposerSend,
1352
1377
  disabled: readOnly,
1378
+ className: "px-4 pb-4",
1353
1379
  placeholder: readOnly ? "Read-only conversation" : "Type a message\u2026 use @ to address an agent",
1354
1380
  mentionOptions,
1355
1381
  allowAttachments: !readOnly,