@adecore/agents-react 0.37.2 → 0.37.3
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/chat/chat-client.d.ts +1 -0
- package/dist/chat/chat-client.js +2 -1
- package/dist/chat/chat-references.d.ts +16 -1
- package/dist/chat/chat-references.js +29 -3
- package/dist/chat/drafts.d.ts +2 -0
- package/dist/chat/drafts.js +21 -5
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/mentions.d.ts +31 -14
- package/dist/chat/mentions.js +186 -41
- package/dist/chat/stash.d.ts +1 -0
- package/dist/chat/stash.js +4 -2
- package/dist/chat/ui/Composer.js +438 -429
- package/dist/chat/ui/ComposerInput.d.ts +1 -0
- package/dist/chat/ui/ComposerInput.js +2 -0
- package/dist/chat/ui/Markdown.d.ts +3 -1
- package/dist/chat/ui/Markdown.js +194 -120
- package/dist/chat/ui/MessageActions.js +70 -66
- package/dist/chat/ui/ReferenceChip.d.ts +15 -0
- package/dist/chat/ui/ReferenceChip.js +255 -0
- package/dist/chat/ui/Timeline.js +52 -29
- package/dist/chat/ui/TimelineMenu.js +84 -78
- package/dist/chat/ui/chip-clipboard.d.ts +9 -0
- package/dist/chat/ui/chip-clipboard.js +105 -0
- package/dist/chat/ui/chips.d.ts +5 -0
- package/dist/chat/ui/chips.js +15 -1
- package/dist/chat/ui/composer/ComposerMenu.js +140 -79
- package/dist/chat/ui/composer/DraftParts.d.ts +0 -4
- package/dist/chat/ui/composer/DraftParts.js +0 -41
- package/dist/chat/ui/composer/chip-paste.d.ts +15 -0
- package/dist/chat/ui/composer/chip-paste.js +104 -0
- package/dist/chat/ui/composer/chips.d.ts +5 -0
- package/dist/chat/ui/composer/chips.js +59 -9
- package/dist/chat/ui/composer/key-handler.js +9 -0
- package/dist/chat/ui/composer/use-composer-draft.d.ts +0 -1
- package/dist/chat/ui/composer/use-composer-draft.js +2 -10
- package/dist/chat/ui/composer/use-composer-menus.d.ts +12 -2
- package/dist/chat/ui/composer/use-composer-menus.js +192 -149
- package/dist/chat/ui/composer/use-composer-submit.js +17 -12
- package/dist/chat/ui/composer/use-draft-files.d.ts +7 -1
- package/dist/chat/ui/composer/use-draft-files.js +90 -58
- package/dist/chat/ui/composer/use-take-back.js +2 -1
- package/dist/chat/ui/index.d.ts +0 -1
- package/dist/chat/ui/index.js +0 -1
- package/dist/chat/ui/reference-icons.d.ts +3 -0
- package/dist/chat/ui/reference-icons.js +15 -0
- package/dist/chat/ui/reference-lookup.d.ts +7 -0
- package/dist/chat/ui/reference-lookup.js +6 -0
- package/dist/chat/ui/rehype-chips.d.ts +8 -1
- package/dist/chat/ui/rehype-chips.js +35 -11
- package/dist/chat/ui/rows/MessageRows.js +218 -158
- package/dist/chat/ui/thread-references.d.ts +4 -0
- package/dist/chat/ui/thread-references.js +78 -0
- package/dist/host-hooks.d.ts +2 -0
- package/dist/host-hooks.js +7 -0
- package/dist/host.d.ts +3 -0
- package/dist/locales/en/agent-chat.d.ts +20 -3
- package/dist/locales/en/agent-chat.js +24 -7
- package/dist/locales/nl/agent-chat.d.ts +20 -3
- package/dist/locales/nl/agent-chat.js +24 -7
- package/package.json +8 -8
- package/src/chat/chat-client.ts +4 -1
- package/src/chat/chat-references.ts +44 -3
- package/src/chat/drafts.ts +24 -6
- package/src/chat/index.ts +1 -1
- package/src/chat/mentions.ts +202 -36
- package/src/chat/stash.ts +6 -2
- package/src/chat/ui/Composer.tsx +14 -4
- package/src/chat/ui/ComposerInput.tsx +4 -0
- package/src/chat/ui/Markdown.tsx +57 -25
- package/src/chat/ui/MessageActions.tsx +5 -2
- package/src/chat/ui/ReferenceChip.tsx +74 -0
- package/src/chat/ui/Timeline.tsx +24 -2
- package/src/chat/ui/TimelineMenu.tsx +7 -3
- package/src/chat/ui/chip-clipboard.ts +115 -0
- package/src/chat/ui/chips.ts +20 -1
- package/src/chat/ui/composer/ComposerMenu.tsx +53 -37
- package/src/chat/ui/composer/DraftParts.tsx +0 -12
- package/src/chat/ui/composer/chip-paste.ts +122 -0
- package/src/chat/ui/composer/chips.ts +60 -10
- package/src/chat/ui/composer/key-handler.ts +9 -0
- package/src/chat/ui/composer/use-composer-draft.ts +1 -7
- package/src/chat/ui/composer/use-composer-menus.ts +68 -29
- package/src/chat/ui/composer/use-composer-submit.ts +13 -6
- package/src/chat/ui/composer/use-draft-files.ts +39 -5
- package/src/chat/ui/composer/use-take-back.ts +2 -1
- package/src/chat/ui/index.ts +0 -1
- package/src/chat/ui/reference-icons.ts +17 -0
- package/src/chat/ui/reference-lookup.ts +13 -0
- package/src/chat/ui/rehype-chips.ts +38 -13
- package/src/chat/ui/rows/MessageRows.tsx +88 -64
- package/src/chat/ui/thread-references.ts +47 -0
- package/src/host-hooks.ts +9 -0
- package/src/host.ts +6 -1
- package/src/locales/en/agent-chat.ts +24 -7
- package/src/locales/nl/agent-chat.ts +24 -7
- package/dist/chat/ui/ChatReferenceChip.d.ts +0 -4
- package/dist/chat/ui/ChatReferenceChip.js +0 -110
- package/src/chat/ui/ChatReferenceChip.tsx +0 -26
|
@@ -26,6 +26,7 @@ interface ComposerInputProps {
|
|
|
26
26
|
onComposing?(composing: boolean): void;
|
|
27
27
|
onKeyDown?(event: KeyboardEvent, view: EditorView): boolean;
|
|
28
28
|
onPaste?(event: ClipboardEvent, view: EditorView): boolean;
|
|
29
|
+
onCopy?(event: ClipboardEvent, view: EditorView): boolean;
|
|
29
30
|
}
|
|
30
31
|
export declare function ComposerInput({ ref, value, placeholder, disabled, tabbable, className, dictationToolbar, extensions, aria, ...handlers }: ComposerInputProps): import("react").JSX.Element;
|
|
31
32
|
export {};
|
|
@@ -117,6 +117,8 @@ export function ComposerInput(t0) {
|
|
|
117
117
|
extensions: [composerEditorExtensions(), dictation.composer?.extensions ?? [], compartments.attributes.of([]), compartments.editable.of([]), compartments.placeholder.of([]), compartments.extensions.of([]), Prec.highest(EditorView.domEventHandlers({
|
|
118
118
|
keydown: (event, target) => latest.current.handlers.onKeyDown?.(event, target) ?? false,
|
|
119
119
|
paste: (event_0, target_0) => latest.current.handlers.onPaste?.(event_0, target_0) ?? false,
|
|
120
|
+
copy: (event_1, target_1) => latest.current.handlers.onCopy?.(event_1, target_1) ?? false,
|
|
121
|
+
cut: (event_2, target_2) => latest.current.handlers.onCopy?.(event_2, target_2) ?? false,
|
|
120
122
|
compositionstart: () => {
|
|
121
123
|
latest.current.handlers.onComposing?.(true);
|
|
122
124
|
return false;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Components, type Options } from 'react-markdown';
|
|
2
|
+
import type { ReferenceToken } from '../mentions.js';
|
|
2
3
|
import { type ShellCodeBlockContext } from '../../host.js';
|
|
3
4
|
type ShellCodeBlockReply = Pick<ShellCodeBlockContext, 'scopeId' | 'chatId' | 'itemId'> & {
|
|
4
5
|
streaming: boolean;
|
|
@@ -9,10 +10,11 @@ export declare const ReplyMarkdown: import("react").MemoExoticComponent<({ text,
|
|
|
9
10
|
arriving?: boolean;
|
|
10
11
|
reply?: ShellCodeBlockReply;
|
|
11
12
|
}) => import("react").JSX.Element>;
|
|
12
|
-
export declare const MessageMarkdown: import("react").MemoExoticComponent<({ text, mentions, skills }: {
|
|
13
|
+
export declare const MessageMarkdown: import("react").MemoExoticComponent<({ text, mentions, skills, references }: {
|
|
13
14
|
text: string;
|
|
14
15
|
mentions?: string[];
|
|
15
16
|
skills?: string[];
|
|
17
|
+
references?: readonly ReferenceToken[];
|
|
16
18
|
}) => import("react").JSX.Element>;
|
|
17
19
|
export declare const Markdown: import("react").MemoExoticComponent<({ text, breaks, fileLinks, muted, rehypePlugins, componentOverrides }: {
|
|
18
20
|
text: string;
|
package/dist/chat/ui/Markdown.js
CHANGED
|
@@ -5,19 +5,21 @@ import { Zap } from 'lucide-react';
|
|
|
5
5
|
import ReactMarkdown from 'react-markdown';
|
|
6
6
|
import remarkBreaks from 'remark-breaks';
|
|
7
7
|
import remarkGfm from 'remark-gfm';
|
|
8
|
-
import {
|
|
8
|
+
import { MENTION_TONE, SKILL_TONE, TOKEN_ICON } from './chips.js';
|
|
9
9
|
import { CodeBlock } from './CodeBlock.js';
|
|
10
10
|
import { MermaidBlock } from './MermaidBlock.js';
|
|
11
11
|
import { CodeStreamingContext } from './code-streaming.js';
|
|
12
12
|
import { splitMarkdownBlocks } from './markdown-blocks.js';
|
|
13
|
-
import {
|
|
13
|
+
import { ReferenceChip, TokenChip } from './ReferenceChip.js';
|
|
14
|
+
import { ReferenceLookupContext } from './reference-lookup.js';
|
|
15
|
+
import { rehypeChips, rehypeNamedReferences } from './rehype-chips.js';
|
|
14
16
|
import { rehypeFadeWords } from './rehype-fade.js';
|
|
15
17
|
import { remarkHtmlAsText } from './remark-html-as-text.js';
|
|
16
18
|
import { useChatHost } from '../../host.js';
|
|
17
19
|
import { useFileLinkCwd, useFileLinkScopeId, useFileLinkTarget, useOpenFileLink } from './file-links.js';
|
|
18
20
|
import { ErrorBoundary, FileIcon, Icon } from '@adecore/ui';
|
|
19
21
|
import { useTranslation } from 'react-i18next';
|
|
20
|
-
import { jsx as _jsx
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
23
|
const ShellCodeBlockReplyContext = createContext(null);
|
|
22
24
|
const BlockCodeContext = createContext(false);
|
|
23
25
|
/* The command a shell fence holds, read from the fence as written, so it keeps the indentation and line endings it has. */
|
|
@@ -562,6 +564,7 @@ function replyHeading(level) {
|
|
|
562
564
|
const replyComponents = {
|
|
563
565
|
...components,
|
|
564
566
|
code: ReplyCode,
|
|
567
|
+
span: ChipSpan,
|
|
565
568
|
h1: replyHeading(1),
|
|
566
569
|
h2: replyHeading(2),
|
|
567
570
|
h3: replyHeading(3),
|
|
@@ -685,121 +688,162 @@ function ReplyCode(t0) {
|
|
|
685
688
|
}
|
|
686
689
|
return t2;
|
|
687
690
|
}
|
|
688
|
-
/* A picked file or
|
|
691
|
+
/* A picked file, skill or reference in a sent message. The glyph stands in for the sigil the text still carries. */
|
|
689
692
|
function Chip(t0) {
|
|
690
|
-
const $ = _c(
|
|
693
|
+
const $ = _c(14);
|
|
691
694
|
const {
|
|
692
695
|
kind,
|
|
693
696
|
value
|
|
694
697
|
} = t0;
|
|
698
|
+
if (kind === "reference") {
|
|
699
|
+
let t1;
|
|
700
|
+
if ($[0] !== value) {
|
|
701
|
+
t1 = /*#__PURE__*/_jsx(ReferenceChip, {
|
|
702
|
+
id: value
|
|
703
|
+
});
|
|
704
|
+
$[0] = value;
|
|
705
|
+
$[1] = t1;
|
|
706
|
+
} else {
|
|
707
|
+
t1 = $[1];
|
|
708
|
+
}
|
|
709
|
+
return t1;
|
|
710
|
+
}
|
|
695
711
|
if (kind === "skill") {
|
|
696
712
|
let t1;
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
t1 = clsx(CHIP_IN_MESSAGE, SKILL_TONE);
|
|
700
|
-
t2 = /*#__PURE__*/_jsx(Icon, {
|
|
713
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
714
|
+
t1 = /*#__PURE__*/_jsx(Icon, {
|
|
701
715
|
icon: Zap,
|
|
702
716
|
size: 14,
|
|
703
|
-
className: "
|
|
717
|
+
className: clsx(TOKEN_ICON, "opacity-85")
|
|
704
718
|
});
|
|
705
|
-
$[
|
|
706
|
-
$[1] = t2;
|
|
719
|
+
$[2] = t1;
|
|
707
720
|
} else {
|
|
708
|
-
t1 = $[
|
|
709
|
-
t2 = $[1];
|
|
721
|
+
t1 = $[2];
|
|
710
722
|
}
|
|
711
|
-
let
|
|
712
|
-
if ($[
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
723
|
+
let t2;
|
|
724
|
+
if ($[3] !== value) {
|
|
725
|
+
t2 = /*#__PURE__*/_jsx(TokenChip, {
|
|
726
|
+
kind: "skill",
|
|
727
|
+
value: value,
|
|
728
|
+
sigil: "$",
|
|
729
|
+
icon: t1,
|
|
730
|
+
label: value,
|
|
731
|
+
tone: SKILL_TONE
|
|
719
732
|
});
|
|
720
|
-
$[
|
|
721
|
-
$[
|
|
733
|
+
$[3] = value;
|
|
734
|
+
$[4] = t2;
|
|
722
735
|
} else {
|
|
723
|
-
|
|
736
|
+
t2 = $[4];
|
|
724
737
|
}
|
|
725
|
-
return
|
|
738
|
+
return t2;
|
|
726
739
|
}
|
|
727
740
|
let t1;
|
|
728
|
-
if ($[
|
|
729
|
-
t1 =
|
|
730
|
-
|
|
741
|
+
if ($[5] !== value) {
|
|
742
|
+
t1 = /*#__PURE__*/_jsx(FileIcon, {
|
|
743
|
+
path: value,
|
|
744
|
+
size: 14,
|
|
745
|
+
className: TOKEN_ICON
|
|
746
|
+
});
|
|
747
|
+
$[5] = value;
|
|
748
|
+
$[6] = t1;
|
|
731
749
|
} else {
|
|
732
|
-
t1 = $[
|
|
750
|
+
t1 = $[6];
|
|
733
751
|
}
|
|
734
752
|
let t2;
|
|
735
|
-
if ($[
|
|
753
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
736
754
|
t2 = /[\\/]$/;
|
|
737
|
-
$[
|
|
755
|
+
$[7] = t2;
|
|
738
756
|
} else {
|
|
739
|
-
t2 = $[
|
|
757
|
+
t2 = $[7];
|
|
740
758
|
}
|
|
741
759
|
let t3;
|
|
742
|
-
if ($[6] !== value) {
|
|
743
|
-
t3 = t2.test(value);
|
|
744
|
-
$[6] = value;
|
|
745
|
-
$[7] = t3;
|
|
746
|
-
} else {
|
|
747
|
-
t3 = $[7];
|
|
748
|
-
}
|
|
749
|
-
let t4;
|
|
750
|
-
let t5;
|
|
751
760
|
if ($[8] !== value) {
|
|
752
|
-
|
|
753
|
-
path: value,
|
|
754
|
-
size: 14
|
|
755
|
-
});
|
|
756
|
-
t5 = /*#__PURE__*/_jsx("span", {
|
|
757
|
-
className: "truncate",
|
|
758
|
-
children: value
|
|
759
|
-
});
|
|
761
|
+
t3 = t2.test(value);
|
|
760
762
|
$[8] = value;
|
|
761
|
-
$[9] =
|
|
762
|
-
$[10] = t5;
|
|
763
|
+
$[9] = t3;
|
|
763
764
|
} else {
|
|
764
|
-
|
|
765
|
-
t5 = $[10];
|
|
765
|
+
t3 = $[9];
|
|
766
766
|
}
|
|
767
|
-
let
|
|
768
|
-
if ($[
|
|
769
|
-
|
|
770
|
-
|
|
767
|
+
let t4;
|
|
768
|
+
if ($[10] !== t1 || $[11] !== t3 || $[12] !== value) {
|
|
769
|
+
t4 = /*#__PURE__*/_jsx(TokenChip, {
|
|
770
|
+
kind: "mention",
|
|
771
|
+
value: value,
|
|
772
|
+
sigil: "@",
|
|
773
|
+
icon: t1,
|
|
774
|
+
label: value,
|
|
775
|
+
tone: MENTION_TONE,
|
|
771
776
|
"data-file-path": value,
|
|
772
|
-
"data-file-directory": t3
|
|
773
|
-
children: [t4, t5]
|
|
777
|
+
"data-file-directory": t3
|
|
774
778
|
});
|
|
779
|
+
$[10] = t1;
|
|
775
780
|
$[11] = t3;
|
|
776
|
-
$[12] =
|
|
777
|
-
$[13] =
|
|
778
|
-
$[14] = value;
|
|
779
|
-
$[15] = t6;
|
|
781
|
+
$[12] = value;
|
|
782
|
+
$[13] = t4;
|
|
780
783
|
} else {
|
|
781
|
-
|
|
784
|
+
t4 = $[13];
|
|
782
785
|
}
|
|
783
|
-
return
|
|
786
|
+
return t4;
|
|
784
787
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
788
|
+
/* A span the chip plugins made is a chip; any other, such as a fading word, stays the span it was. */
|
|
789
|
+
function ChipSpan(t0) {
|
|
790
|
+
const $ = _c(11);
|
|
791
|
+
let children;
|
|
792
|
+
let chip;
|
|
793
|
+
let rest;
|
|
794
|
+
let value;
|
|
795
|
+
if ($[0] !== t0) {
|
|
796
|
+
const {
|
|
797
|
+
children: t1,
|
|
798
|
+
node: _node,
|
|
799
|
+
"data-chip": t2,
|
|
800
|
+
"data-value": t3,
|
|
801
|
+
...t4
|
|
802
|
+
} = t0;
|
|
803
|
+
children = t1;
|
|
804
|
+
chip = t2;
|
|
805
|
+
value = t3;
|
|
806
|
+
rest = t4;
|
|
807
|
+
$[0] = t0;
|
|
808
|
+
$[1] = children;
|
|
809
|
+
$[2] = chip;
|
|
810
|
+
$[3] = rest;
|
|
811
|
+
$[4] = value;
|
|
812
|
+
} else {
|
|
813
|
+
children = $[1];
|
|
814
|
+
chip = $[2];
|
|
815
|
+
rest = $[3];
|
|
816
|
+
value = $[4];
|
|
817
|
+
}
|
|
818
|
+
if (chip === undefined || value === undefined) {
|
|
819
|
+
let t1;
|
|
820
|
+
if ($[5] !== children || $[6] !== rest) {
|
|
821
|
+
t1 = /*#__PURE__*/_jsx("span", {
|
|
822
|
+
...rest,
|
|
794
823
|
children: children
|
|
795
824
|
});
|
|
825
|
+
$[5] = children;
|
|
826
|
+
$[6] = rest;
|
|
827
|
+
$[7] = t1;
|
|
828
|
+
} else {
|
|
829
|
+
t1 = $[7];
|
|
796
830
|
}
|
|
797
|
-
return
|
|
831
|
+
return t1;
|
|
832
|
+
}
|
|
833
|
+
let t1;
|
|
834
|
+
if ($[8] !== chip || $[9] !== value) {
|
|
835
|
+
t1 = /*#__PURE__*/_jsx(Chip, {
|
|
798
836
|
kind: chip,
|
|
799
837
|
value: value
|
|
800
838
|
});
|
|
839
|
+
$[8] = chip;
|
|
840
|
+
$[9] = value;
|
|
841
|
+
$[10] = t1;
|
|
842
|
+
} else {
|
|
843
|
+
t1 = $[10];
|
|
801
844
|
}
|
|
802
|
-
|
|
845
|
+
return t1;
|
|
846
|
+
}
|
|
803
847
|
// Module constants, so a render never hands react-markdown a fresh array and makes it parse again.
|
|
804
848
|
const PLUGINS = [remarkGfm];
|
|
805
849
|
const REPLY_PLUGINS = [remarkGfm, remarkShellCodeBlocks];
|
|
@@ -809,54 +853,81 @@ const FADE_PLUGINS = [rehypeFadeWords];
|
|
|
809
853
|
const NO_PLUGINS = [];
|
|
810
854
|
/* One block of a reply. It renders no element of its own, so prose keeps its first and last margins. */
|
|
811
855
|
const ReplyBlock = memo(function ReplyBlock(t0) {
|
|
812
|
-
const $ = _c(
|
|
856
|
+
const $ = _c(16);
|
|
813
857
|
const {
|
|
814
858
|
text,
|
|
815
859
|
fade,
|
|
816
860
|
open,
|
|
817
861
|
reply
|
|
818
862
|
} = t0;
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
863
|
+
const {
|
|
864
|
+
items,
|
|
865
|
+
referenced
|
|
866
|
+
} = useContext(ReferenceLookupContext);
|
|
867
|
+
let t1;
|
|
868
|
+
if ($[0] !== items || $[1] !== referenced) {
|
|
869
|
+
t1 = {
|
|
870
|
+
items,
|
|
871
|
+
referenced
|
|
872
|
+
};
|
|
873
|
+
$[0] = items;
|
|
874
|
+
$[1] = referenced;
|
|
875
|
+
$[2] = t1;
|
|
876
|
+
} else {
|
|
877
|
+
t1 = $[2];
|
|
878
|
+
}
|
|
879
|
+
const named = t1;
|
|
880
|
+
let t2;
|
|
881
|
+
if ($[3] !== fade || $[4] !== items.length || $[5] !== named) {
|
|
882
|
+
t2 = items.length === 0 ? fade ? FADE_PLUGINS : NO_PLUGINS : [[rehypeNamedReferences, named], ...(fade ? FADE_PLUGINS : [])];
|
|
883
|
+
$[3] = fade;
|
|
884
|
+
$[4] = items.length;
|
|
885
|
+
$[5] = named;
|
|
886
|
+
$[6] = t2;
|
|
887
|
+
} else {
|
|
888
|
+
t2 = $[6];
|
|
889
|
+
}
|
|
890
|
+
const rehypePlugins = t2;
|
|
891
|
+
const t3 = reply ?? null;
|
|
892
|
+
let t4;
|
|
893
|
+
if ($[7] !== rehypePlugins || $[8] !== text) {
|
|
894
|
+
t4 = /*#__PURE__*/_jsx(ReactMarkdown, {
|
|
824
895
|
remarkPlugins: REPLY_PLUGINS,
|
|
825
|
-
rehypePlugins:
|
|
896
|
+
rehypePlugins: rehypePlugins,
|
|
826
897
|
components: replyComponents,
|
|
827
898
|
children: text
|
|
828
899
|
});
|
|
829
|
-
$[
|
|
830
|
-
$[
|
|
831
|
-
$[
|
|
900
|
+
$[7] = rehypePlugins;
|
|
901
|
+
$[8] = text;
|
|
902
|
+
$[9] = t4;
|
|
832
903
|
} else {
|
|
833
|
-
|
|
904
|
+
t4 = $[9];
|
|
834
905
|
}
|
|
835
|
-
let
|
|
836
|
-
if ($[
|
|
837
|
-
|
|
838
|
-
value:
|
|
839
|
-
children:
|
|
906
|
+
let t5;
|
|
907
|
+
if ($[10] !== t3 || $[11] !== t4) {
|
|
908
|
+
t5 = /*#__PURE__*/_jsx(ShellCodeBlockReplyContext.Provider, {
|
|
909
|
+
value: t3,
|
|
910
|
+
children: t4
|
|
840
911
|
});
|
|
841
|
-
$[
|
|
842
|
-
$[
|
|
843
|
-
$[
|
|
912
|
+
$[10] = t3;
|
|
913
|
+
$[11] = t4;
|
|
914
|
+
$[12] = t5;
|
|
844
915
|
} else {
|
|
845
|
-
|
|
916
|
+
t5 = $[12];
|
|
846
917
|
}
|
|
847
|
-
let
|
|
848
|
-
if ($[
|
|
849
|
-
|
|
918
|
+
let t6;
|
|
919
|
+
if ($[13] !== open || $[14] !== t5) {
|
|
920
|
+
t6 = /*#__PURE__*/_jsx(CodeStreamingContext.Provider, {
|
|
850
921
|
value: open,
|
|
851
|
-
children:
|
|
922
|
+
children: t5
|
|
852
923
|
});
|
|
853
|
-
$[
|
|
854
|
-
$[
|
|
855
|
-
$[
|
|
924
|
+
$[13] = open;
|
|
925
|
+
$[14] = t5;
|
|
926
|
+
$[15] = t6;
|
|
856
927
|
} else {
|
|
857
|
-
|
|
928
|
+
t6 = $[15];
|
|
858
929
|
}
|
|
859
|
-
return
|
|
930
|
+
return t6;
|
|
860
931
|
});
|
|
861
932
|
/*
|
|
862
933
|
* A code fence at the top level of a reply, drawn as markdown draws it but without parsing, so a word
|
|
@@ -998,44 +1069,47 @@ export const ReplyMarkdown = memo(function ReplyMarkdown(t0) {
|
|
|
998
1069
|
});
|
|
999
1070
|
/*
|
|
1000
1071
|
* A message a person sent. Enter meant a line break, a tag typed without backticks stays the text
|
|
1001
|
-
* it was, and the files and
|
|
1072
|
+
* it was, and the files, skills and references picked in the composer are chips again.
|
|
1002
1073
|
*/
|
|
1003
1074
|
export const MessageMarkdown = memo(function MessageMarkdown(t0) {
|
|
1004
|
-
const $ = _c(
|
|
1075
|
+
const $ = _c(7);
|
|
1005
1076
|
const {
|
|
1006
1077
|
text,
|
|
1007
1078
|
mentions,
|
|
1008
|
-
skills
|
|
1079
|
+
skills,
|
|
1080
|
+
references
|
|
1009
1081
|
} = t0;
|
|
1010
1082
|
let t1;
|
|
1011
|
-
if ($[0] !== mentions || $[1] !== skills) {
|
|
1083
|
+
if ($[0] !== mentions || $[1] !== references || $[2] !== skills) {
|
|
1012
1084
|
t1 = [[rehypeChips, {
|
|
1013
1085
|
mentions,
|
|
1014
|
-
skills
|
|
1086
|
+
skills,
|
|
1087
|
+
references
|
|
1015
1088
|
}]];
|
|
1016
1089
|
$[0] = mentions;
|
|
1017
|
-
$[1] =
|
|
1018
|
-
$[2] =
|
|
1090
|
+
$[1] = references;
|
|
1091
|
+
$[2] = skills;
|
|
1092
|
+
$[3] = t1;
|
|
1019
1093
|
} else {
|
|
1020
|
-
t1 = $[
|
|
1094
|
+
t1 = $[3];
|
|
1021
1095
|
}
|
|
1022
1096
|
const rehypePlugins = t1;
|
|
1023
1097
|
let t2;
|
|
1024
|
-
if ($[
|
|
1098
|
+
if ($[4] !== rehypePlugins || $[5] !== text) {
|
|
1025
1099
|
t2 = /*#__PURE__*/_jsx("div", {
|
|
1026
1100
|
className: "chat-markdown prose prose-sm max-w-none text-sm",
|
|
1027
1101
|
children: /*#__PURE__*/_jsx(ReactMarkdown, {
|
|
1028
1102
|
remarkPlugins: MESSAGE_PLUGINS,
|
|
1029
1103
|
rehypePlugins: rehypePlugins,
|
|
1030
|
-
components:
|
|
1104
|
+
components: replyComponents,
|
|
1031
1105
|
children: text
|
|
1032
1106
|
})
|
|
1033
1107
|
});
|
|
1034
|
-
$[
|
|
1035
|
-
$[
|
|
1036
|
-
$[
|
|
1108
|
+
$[4] = rehypePlugins;
|
|
1109
|
+
$[5] = text;
|
|
1110
|
+
$[6] = t2;
|
|
1037
1111
|
} else {
|
|
1038
|
-
t2 = $[
|
|
1112
|
+
t2 = $[6];
|
|
1039
1113
|
}
|
|
1040
1114
|
return t2;
|
|
1041
1115
|
});
|