@cossistant/next 0.0.32 → 0.1.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.
- package/README.md +4 -4
- package/_virtual/rolldown_runtime.js +42 -0
- package/hooks/index.d.ts +4 -3
- package/hooks/index.js +4 -2
- package/identify-visitor.d.ts +1 -1
- package/identify-visitor.js +4 -2
- package/index.d.ts +15 -21
- package/index.js +23 -10
- package/index.js.map +1 -0
- package/package.json +3 -15
- package/primitives/index.d.ts +13 -2
- package/primitives/index.d.ts.map +1 -0
- package/primitives/index.js +11 -2
- package/primitives/index.js.map +1 -0
- package/provider.d.ts +2 -1
- package/provider.js +4 -2
- package/react/src/hooks/index.d.ts +2 -2
- package/react/src/hooks/private/use-grouped-messages.d.ts +27 -2
- package/react/src/hooks/private/use-grouped-messages.d.ts.map +1 -1
- package/react/src/hooks/use-conversation-auto-seen.d.ts.map +1 -1
- package/react/src/hooks/use-conversation-page.d.ts.map +1 -1
- package/react/src/hooks/use-file-upload.d.ts +54 -1
- package/react/src/hooks/use-file-upload.d.ts.map +1 -0
- package/react/src/hooks/use-new-message-sound.d.ts.map +1 -1
- package/react/src/hooks/use-typing-sound.d.ts.map +1 -1
- package/react/src/primitives/command-block-utils.d.ts +10 -0
- package/react/src/primitives/command-block-utils.d.ts.map +1 -0
- package/react/src/primitives/index.d.ts +5 -1
- package/react/src/primitives/index.parts.d.ts +5 -1
- package/react/src/primitives/timeline-code-block.d.ts +32 -0
- package/react/src/primitives/timeline-code-block.d.ts.map +1 -0
- package/react/src/primitives/timeline-command-block.d.ts +29 -0
- package/react/src/primitives/timeline-command-block.d.ts.map +1 -0
- package/react/src/primitives/timeline-item-group.d.ts.map +1 -1
- package/react/src/primitives/timeline-item.d.ts +20 -1
- package/react/src/primitives/timeline-item.d.ts.map +1 -1
- package/react/src/primitives/timeline-message-layout.d.ts +9 -0
- package/react/src/primitives/timeline-message-layout.d.ts.map +1 -0
- package/react/src/provider.d.ts.map +1 -1
- package/react/src/realtime/provider.d.ts +0 -1
- package/react/src/realtime/provider.d.ts.map +1 -1
- package/react/src/support/components/button.d.ts +25 -1
- package/react/src/support/components/button.d.ts.map +1 -0
- package/react/src/support/components/header.d.ts +11 -0
- package/react/src/support/components/header.d.ts.map +1 -0
- package/react/src/support/context/events.d.ts +54 -1
- package/react/src/support/context/events.d.ts.map +1 -1
- package/react/src/support/context/handle.d.ts +17 -1
- package/react/src/support/context/handle.d.ts.map +1 -1
- package/react/src/support/index.d.ts +25 -5
- package/react/src/support/index.d.ts.map +1 -1
- package/react/src/support/store/support-store.d.ts.map +1 -1
- package/react/src/support/text/index.d.ts +34 -2
- package/react/src/support/text/index.d.ts.map +1 -0
- package/react/src/support/text/locales/keys.d.ts +11 -1
- package/react/src/support/text/locales/keys.d.ts.map +1 -1
- package/react/src/support-config.d.ts +30 -3
- package/react/src/support-config.d.ts.map +1 -1
- package/react/src/utils/index.d.ts +1 -1
- package/react/src/utils/merge-refs.d.ts +30 -1
- package/react/src/utils/merge-refs.d.ts.map +1 -0
- package/react/src/utils/use-render-element.d.ts.map +1 -1
- package/realtime/index.d.ts +1 -1
- package/realtime/index.js +4 -2
- package/styles.css +1 -0
- package/support/index.d.ts +9 -3
- package/support/index.js +5 -2
- package/support-config.d.ts +2 -2
- package/support-config.js +4 -2
- package/support.css +1 -2
- package/utils/index.d.ts +2 -1
- package/utils/index.js +4 -2
|
@@ -5,12 +5,16 @@ import { AvatarFallback } from "./avatar/fallback.js";
|
|
|
5
5
|
import { AvatarImage } from "./avatar/image.js";
|
|
6
6
|
import "./avatar/index.js";
|
|
7
7
|
import { Button } from "./button.js";
|
|
8
|
+
import { CommandPackageManager, CommandVariants, DEFAULT_PACKAGE_MANAGER, mapCommandVariants } from "./command-block-utils.js";
|
|
8
9
|
import { ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading } from "./conversation-timeline.js";
|
|
9
10
|
import { DaySeparator, DaySeparatorLabel, DaySeparatorLabelProps, DaySeparatorLine, DaySeparatorLineProps, DaySeparatorProps, DaySeparatorRenderProps, defaultFormatDate } from "./day-separator.js";
|
|
10
11
|
import { FileInput, MultimodalInput, SupportInput } from "./multimodal-input.js";
|
|
11
12
|
import { PageDefinition, Router, RouterProps } from "./router.js";
|
|
12
|
-
import {
|
|
13
|
+
import { TimelineCodeBlock, TimelineCodeBlockProps } from "./timeline-code-block.js";
|
|
14
|
+
import { TimelineCommandBlock, TimelineCommandBlockProps } from "./timeline-command-block.js";
|
|
15
|
+
import { TimelineItem, TimelineItemContent, TimelineItemContentMarkdownRenderers, TimelineItemTimestamp } from "./timeline-item.js";
|
|
13
16
|
import { TimelineItemAttachments, TimelineItemFiles, TimelineItemImages, extractFileParts, extractImageParts, hasAttachments } from "./timeline-item-attachments.js";
|
|
14
17
|
import { TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator } from "./timeline-item-group.js";
|
|
18
|
+
import { hasExpandedTimelineContent } from "./timeline-message-layout.js";
|
|
15
19
|
import { SupportTrigger, TriggerProps, TriggerRenderProps } from "./trigger.js";
|
|
16
20
|
import { SupportWindow } from "./window.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
|
|
3
|
+
//#region ../react/src/primitives/timeline-code-block.d.ts
|
|
4
|
+
type TimelineCodeBlockRenderState = {
|
|
5
|
+
code: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
languageLabel: string;
|
|
8
|
+
codeClassName?: string;
|
|
9
|
+
fileName?: string;
|
|
10
|
+
hasCopied: boolean;
|
|
11
|
+
onCopy: () => Promise<boolean>;
|
|
12
|
+
};
|
|
13
|
+
type TimelineCodeBlockProps = {
|
|
14
|
+
code: string;
|
|
15
|
+
language?: string;
|
|
16
|
+
fileName?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
children?: (state: TimelineCodeBlockRenderState) => React$1.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Shared timeline code block UI with filename/language metadata and copy action.
|
|
22
|
+
*/
|
|
23
|
+
declare function TimelineCodeBlock({
|
|
24
|
+
code,
|
|
25
|
+
language,
|
|
26
|
+
fileName,
|
|
27
|
+
className,
|
|
28
|
+
children
|
|
29
|
+
}: TimelineCodeBlockProps): React$1.ReactElement;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { TimelineCodeBlock, TimelineCodeBlockProps };
|
|
32
|
+
//# sourceMappingURL=timeline-code-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-code-block.d.ts","names":[],"sources":["../../../../../react/src/primitives/timeline-code-block.tsx"],"sourcesContent":[],"mappings":";;;KAEY,4BAAA;;EAAA,QAAA,CAAA,EAAA,MAAA;EAUA,aAAA,EAAA,MAAA;EAgCI,aAAA,CAAA,EAAA,MAAiB;EAChC,QAAA,CAAA,EAAA,MAAA;EACA,SAAA,EAAA,OAAA;EACA,MAAA,EAAA,GAAA,GAtCc,OAsCd,CAAA,OAAA,CAAA;CACA;AACA,KArCW,sBAAA,GAqCX;EACE,IAAA,EAAA,MAAA;EAAyB,QAAM,CAAA,EAAA,MAAA;EAAY,QAAA,CAAA,EAAA,MAAA;;qBAjC1B,iCAAiC,OAAA,CAAM;;;;;iBA2B3C,iBAAA;;;;;;GAMb,yBAAyB,OAAA,CAAM"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CommandPackageManager, CommandVariants } from "./command-block-utils.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
|
|
4
|
+
//#region ../react/src/primitives/timeline-command-block.d.ts
|
|
5
|
+
type TimelineCommandBlockRenderState = {
|
|
6
|
+
commands: CommandVariants;
|
|
7
|
+
packageManagers: readonly CommandPackageManager[];
|
|
8
|
+
activePackageManager: CommandPackageManager;
|
|
9
|
+
activeCommand: string;
|
|
10
|
+
setPackageManager: (packageManager: CommandPackageManager) => void;
|
|
11
|
+
hasCopied: boolean;
|
|
12
|
+
onCopy: () => Promise<boolean>;
|
|
13
|
+
};
|
|
14
|
+
type TimelineCommandBlockProps = {
|
|
15
|
+
commands: CommandVariants;
|
|
16
|
+
className?: string;
|
|
17
|
+
children?: (state: TimelineCommandBlockRenderState) => React$1.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Shared command block UI with package-manager tabs and copy action.
|
|
21
|
+
*/
|
|
22
|
+
declare function TimelineCommandBlock({
|
|
23
|
+
commands,
|
|
24
|
+
className,
|
|
25
|
+
children
|
|
26
|
+
}: TimelineCommandBlockProps): React$1.ReactElement;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { TimelineCommandBlock, TimelineCommandBlockProps };
|
|
29
|
+
//# sourceMappingURL=timeline-command-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-command-block.d.ts","names":[],"sources":["../../../../../react/src/primitives/timeline-command-block.tsx"],"sourcesContent":[],"mappings":";;;;KAWY,+BAAA;YACD;EADC,eAAA,EAAA,SAEe,qBAFgB,EAAA;EAChC,oBAAA,EAEY,qBAFZ;EACgB,aAAA,EAAA,MAAA;EACJ,iBAAA,EAAA,CAAA,cAAA,EAEc,qBAFd,EAAA,GAAA,IAAA;EAEc,SAAA,EAAA,OAAA;EAEtB,MAAA,EAAA,GAAA,GAAA,OAAA,CAAA,OAAA,CAAA;CAAO;AAGV,KAAA,yBAAA,GAAyB;EAC1B,QAAA,EAAA,eAAA;EAES,SAAA,CAAA,EAAA,MAAA;EAAoC,QAAM,CAAA,EAAA,CAAA,KAAA,EAA1C,+BAA0C,EAAA,GAAN,OAAA,CAAM,SAAA;CAAS;AAkCvE;;;AAGC,iBAHe,oBAAA,CAGf;EAAA,QAAA;EAAA,SAAA;EAAA;AAAA,CAAA,EACE,yBADF,CAAA,EAC8B,OAAA,CAAM,YADpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-item-group.d.ts","names":[],"sources":["../../../../../react/src/primitives/timeline-item-group.tsx"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"timeline-item-group.d.ts","names":[],"sources":["../../../../../react/src/primitives/timeline-item-group.tsx"],"sourcesContent":[],"mappings":";;;;;;AAUA;AAmDA;;AAA8B,KAnDlB,4BAAA,GAmDkB;EAAA,UAAA,EAjDjB,UAiDiB;EArB1B,QAAM,EAAA,MAAA;EACG,UAAA,CAAA,EA3BC,UA2BD;EAAiC,cAAM,EAAA,OAAA;EAG5C,kBAAA,EAAA,OAAA;EAIM,SAAA,EAAA,OAAA;EAIK,IAAA,EAAA,OAAA;;;EASW,WAAA,EAAA,MAAA,GAAA,SAAA;EAAA,UAAA,EAAA,MAAA,GAAA,SAAA;EAuGjB,mBAAA,CAAA,EAAA,OAuBT;EAvBgC,SAAA,CAAA,EAAA,SAAA,MAAA,EAAA;CAAA;;;;;;;AAgDA,cAvJvB,iBAuJuB,EAvJN,OAAA,CAAA,yBAuJM,CAvJN,IAuJM,CAvJN,OAAA,CAAA,cAuJM,CAvJN,cAuJM,CAAA,EAAA,UAAA,CAAA,GAAA;EAAA,QAAA,CAAA,EA5KhC,OAAA,CAAM,SA4K0B,GAAA,CAAA,CAAA,KAAA,EA3KvB,4BA2KuB,EAAA,GA3KU,OAAA,CAAM,SA2KhB,CAAA;EAyDvB,OAAA,CAAA,EAAA,OAAA;EAAwB,SAAA,CAAA,EAAA,MAAA;EAAA,KAAA,EAjO7B,gBAiO6B,EAAA;EAAA,QAAA,CAAA,EAAA,MAAA;EAVzB,UAAM,CAAA,EAnNJ,UAmNI;;oBA/MC;CAyNkB,wBAAA,eAAA,CAAA,CAAA;;;;;AA6CM,cAtJ9B,uBAsJ8B,EAtJP,OAAA,CAAA,yBAsJO,CAtJP,IAsJO,CAtJP,OAAA,CAAA,cAsJO,CAtJP,cAsJO,CAAA,EAAA,UAAA,CAAA,GAAA;EAAA,QAAA,CAAA,EA/J/B,OAAA,CAAM,SA+JyB;EA+D9B,OAAA,CAAA,EAAA,OAAA;EAA8B,SAAA,CAAA,EAAA,MAAA;CAAA,wBAAA,eAAA,CAAA,CAAA;;;;;;cArK9B,yBAAuB,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAlBhC,OAAA,CAAM;;;iBAIO;QACP,OAAA,CAAM;;;;;eAKF;;;;;;;cAiED,0BAAwB,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAVzB,OAAA,CAAM;;;;;;;;;cAuDL,gCAA8B,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAfvC,OAAA,CAAM;;;QAIA,OAAA,CAAM;;;;;;;;;;cA0EH,gCAA8B,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAhBvC,OAAA,CAAM;aAEG;;;;;QAEH,OAAA,CAAM;;;;oBAIG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommandVariants } from "./command-block-utils.js";
|
|
1
2
|
import * as React$1 from "react";
|
|
2
3
|
|
|
3
4
|
//#region ../react/src/primitives/timeline-item.d.ts
|
|
@@ -26,6 +27,23 @@ declare const TimelineItem: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLA
|
|
|
26
27
|
className?: string;
|
|
27
28
|
item: TimelineItemType;
|
|
28
29
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
type TimelineInlineCodeRendererProps = {
|
|
31
|
+
code: string;
|
|
32
|
+
};
|
|
33
|
+
type TimelineCodeBlockRendererProps = {
|
|
34
|
+
code: string;
|
|
35
|
+
language?: string;
|
|
36
|
+
fileName?: string;
|
|
37
|
+
};
|
|
38
|
+
type TimelineCommandBlockRendererProps = {
|
|
39
|
+
command: string;
|
|
40
|
+
commands: CommandVariants;
|
|
41
|
+
};
|
|
42
|
+
type TimelineItemContentMarkdownRenderers = {
|
|
43
|
+
inlineCode?: (props: TimelineInlineCodeRendererProps) => React$1.ReactNode;
|
|
44
|
+
codeBlock?: (props: TimelineCodeBlockRendererProps) => React$1.ReactNode;
|
|
45
|
+
commandBlock?: (props: TimelineCommandBlockRendererProps) => React$1.ReactNode;
|
|
46
|
+
};
|
|
29
47
|
/**
|
|
30
48
|
* Renders the content of a timeline item, optionally piping Markdown content through a
|
|
31
49
|
* memoised renderer or handing the raw text to a render prop for custom
|
|
@@ -37,6 +55,7 @@ declare const TimelineItemContent: React$1.ForwardRefExoticComponent<Omit<React$
|
|
|
37
55
|
className?: string;
|
|
38
56
|
text?: string | null;
|
|
39
57
|
renderMarkdown?: boolean;
|
|
58
|
+
markdownRenderers?: TimelineItemContentMarkdownRenderers;
|
|
40
59
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
41
60
|
/**
|
|
42
61
|
* Timestamp helper that renders a formatted date or allows callers to supply a
|
|
@@ -50,5 +69,5 @@ declare const TimelineItemTimestamp: React$1.ForwardRefExoticComponent<Omit<Reac
|
|
|
50
69
|
format?: (date: Date) => string;
|
|
51
70
|
} & React$1.RefAttributes<HTMLSpanElement>>;
|
|
52
71
|
//#endregion
|
|
53
|
-
export { TimelineItem, TimelineItemContent, TimelineItemTimestamp };
|
|
72
|
+
export { TimelineItem, TimelineItemContent, TimelineItemContentMarkdownRenderers, TimelineItemTimestamp };
|
|
54
73
|
//# sourceMappingURL=timeline-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-item.d.ts","names":[],"sources":["../../../../../react/src/primitives/timeline-item.tsx"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timeline-item.d.ts","names":[],"sources":["../../../../../react/src/primitives/timeline-item.tsx"],"sourcesContent":[],"mappings":";;;;;;AAoBA;AA2BA;;AAAyB,KA3Bb,uBAAA,GA2Ba;EAAA,SAAA,EAAA,OAAA;EAZrB,IAAA,EAAM,OAAA;EACG,OAAA,EAAA,OAAA;EAA4B,SAAM,EAZnC,I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region ../react/src/primitives/timeline-message-layout.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Detects whether message text includes fenced code content that should use
|
|
4
|
+
* the expanded timeline bubble layout.
|
|
5
|
+
*/
|
|
6
|
+
declare function hasExpandedTimelineContent(text: string | null | undefined): boolean;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { hasExpandedTimelineContent };
|
|
9
|
+
//# sourceMappingURL=timeline-message-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-message-layout.d.ts","names":[],"sources":["../../../../../react/src/primitives/timeline-message-layout.ts"],"sourcesContent":[],"mappings":";;AAOA;;;iBAAgB,0BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","names":[],"sources":["../../../../react/src/provider.tsx"],"sourcesContent":[],"mappings":";;;;;;KAsEY,oBAAA;YACD,KAAA,CAAM;EADL,WAAA,CAAA,EAAA,OAAA;EACD,MAAM,CAAA,EAAA,MAAA;EAKE,KAAA,CAAA,EAAA,MAAA;EAKE,SAAA,CAAA,EAAA,MAAA;EAAK,eAAA,CAAA,EALP,cAKO,EAAA;EAId,YAAA,CAAA,EAAA,MAAA,EAAA;EAEA,WAAA,CAAA,EAAA,OAAA;EACF,WAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EACQ,cAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EAEc,SAAA,CAAA,EAAA,CAAA,KAAA,EAVX,KAUW,EAAA,GAAA,IAAA;EAKxB,IAAA,CAAA,EAAA,QAAA,GAAA,QAAA;CACa;AACZ,KAbG,uBAAA,GAA0B,oBAa7B;AAAgB,KAXb,sBAAA,GAWa;EAOpB,OAAA,EAjBK,qBAiBqB,GAAA,IAAA;EAE1B,eAAA,EAlBa,cAkBI,EAAA;EAAG,YAAA,EAAA,MAAA,EAAA;EAEV,kBAAA,EAAA,CAAA,QAAA,EAlBiB,cAkBjB,EAAA,EAAA,GAAA,IAAA;EAAZ,eAA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Provides websocket connectivity and heartbeating logic for realtime events.
|
|
45
|
-
* Handles SSR by only initializing the WebSocket connection in the browser.
|
|
46
45
|
*/
|
|
47
46
|
declare function RealtimeProvider({
|
|
48
47
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","names":[],"sources":["../../../../../react/src/realtime/provider.tsx"],"sourcesContent":[],"mappings":";;;KAuBK,gBAAA,WAA2B;AAfD,KA8C1B,iBAAA,GA/BgB;EA+BhB,IAAA,EAAA,SAAA;EAOA,SAAA,EAAA,MAAA,GAAiB,IAAA;EAOjB,SAAA,CAAA,EAAA,MAAA,GAAkB,IAAA;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","names":[],"sources":["../../../../../react/src/realtime/provider.tsx"],"sourcesContent":[],"mappings":";;;KAuBK,gBAAA,WAA2B;AAfD,KA8C1B,iBAAA,GA/BgB;EA+BhB,IAAA,EAAA,SAAA;EAOA,SAAA,EAAA,MAAA,GAAiB,IAAA;EAOjB,SAAA,CAAA,EAAA,MAAA,GAAkB,IAAA;EAgBlB,SAAA,CAAA,EAAA,MAAA,GAAA,IAAqB;CACf;KAxBN,iBAAA,GA0BE;EAIY,IAAA,EAAA,SAAA;EAAK,YAAA,EAAA,MAAA,GAAA,IAAA;EAGnB,SAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EAGG,MAAA,CAAA,EAAA,MAAA,GAAA,IAAA;CACO;KA9BV,kBAAA,GAAqB,iBAgCJ,GAhCwB,iBAgCxB;KAhBjB,qBAAA,GAiBO;EAAgB,QAAA,EAhBjB,KAAA,CAAM,SAgBW;EAKvB,KAAA,CAAA,EAAA,MAAA;EAmoBW,IAAA,EAtpBT,kBAspByB,GAAA,IAAA;EAC/B,WAAA,CAAA,EAAA,OAAA;EACA,SAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EACA,YAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EACA,OAAA,CAAA,EAAA,CAAA,KAAA,EAtpBkB,KAspBlB,EAAA,GAAA,IAAA;CACA;KAppBI,uBAAA,GAqpBJ;EACA,WAAA,EAAA,OAAA;EACE,YAAA,EAAA,OAAA;EAAwB,KAAM,EAppBzB,KAopByB,GAAA,IAAA;EAAY,IAAA,EAAA,CAAA,KAAA,EAnpB9B,gBAmpB8B,EAAA,GAAA,IAAA;EAkB7B,OAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAqB,GAAA,IAAA;uBAnqBf;aACV;;;;KAKP,oBAAA,GAAuB;;;;;;;;iBAmoBZ,gBAAA;;;;;;;;GAQb,wBAAwB,KAAA,CAAM;;;;iBAkBjB,qBAAA,CAAA,GAAyB"}
|
|
@@ -1 +1,25 @@
|
|
|
1
|
-
import "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
//#region ../react/src/support/components/button.d.ts
|
|
6
|
+
declare const coButtonVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "secondary" | "ghost" | "outline" | "tab" | "tab-selected" | null | undefined;
|
|
8
|
+
size?: "default" | "large" | "small" | "icon" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
|
+
type CossistantButtonProps = React$1.ComponentProps<"button"> & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
} & VariantProps<typeof coButtonVariants>;
|
|
13
|
+
/**
|
|
14
|
+
* Styled button primitive that forwards variant and size props to the shared
|
|
15
|
+
* design tokens.
|
|
16
|
+
*/
|
|
17
|
+
declare function CoButton({
|
|
18
|
+
className,
|
|
19
|
+
variant,
|
|
20
|
+
size,
|
|
21
|
+
...props
|
|
22
|
+
}: CossistantButtonProps): React$1.ReactElement;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { CoButton };
|
|
25
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","names":[],"sources":["../../../../../../react/src/support/components/button.tsx"],"sourcesContent":[],"mappings":";;;;;cAKa,wBA6BZ;;;AA7BD,CAAA,GA6BC,+BAAA,CAAA,SAAA,CAAA,GAAA,SAAA,EAAA,GAAA,MAAA;AAEW,KAAA,qBAAA,GAAwB,OAAA,CAAM,cAAT,CAAA,QAAA,CAAA,GAAA;EAAG,OAAM,CAAA,EAAA,OAAA;CAElB,GAApB,YAAoB,CAAA,OAAA,gBAAA,CAAA;;;AAMxB;;AAEC,iBAFe,QAAA,CAEf;EAAA,SAAA;EAAA,OAAA;EAAA,IAAA;EAAA,GAAA;AAAA,CAAA,EAGE,qBAHF,CAAA,EAG0B,OAAA,CAAM,YAHhC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region ../react/src/support/components/header.d.ts
|
|
2
|
+
type HeaderProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
actions?: React.ReactNode;
|
|
6
|
+
onGoBack?: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare const Header: React.FC<HeaderProps>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Header };
|
|
11
|
+
//# sourceMappingURL=header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.d.ts","names":[],"sources":["../../../../../../react/src/support/components/header.tsx"],"sourcesContent":[],"mappings":";KAKY,WAAA;EAAA,SAAA,CAAA,EAAA,MAAW;EAOV,QAAA,CA+BZ,EApCW,KAAA,CAAM,SAKY;YAJnB,KAAA,CAAM;;;cAIJ,QAAQ,KAAA,CAAM,GAAG"}
|
|
@@ -2,6 +2,7 @@ import { Conversation } from "@cossistant/types";
|
|
|
2
2
|
import "react";
|
|
3
3
|
|
|
4
4
|
//#region ../react/src/support/context/events.d.ts
|
|
5
|
+
type SupportEventType = "conversationStart" | "conversationEnd" | "messageSent" | "messageReceived" | "error";
|
|
5
6
|
type ConversationStartEvent = {
|
|
6
7
|
type: "conversationStart";
|
|
7
8
|
conversationId: string;
|
|
@@ -27,6 +28,58 @@ type ErrorEvent = {
|
|
|
27
28
|
error: Error;
|
|
28
29
|
context?: string;
|
|
29
30
|
};
|
|
31
|
+
type SupportEvent = ConversationStartEvent | ConversationEndEvent | MessageSentEvent | MessageReceivedEvent | ErrorEvent;
|
|
32
|
+
type SupportEventCallbacks = {
|
|
33
|
+
/**
|
|
34
|
+
* Called when a new conversation is started.
|
|
35
|
+
*/
|
|
36
|
+
onConversationStart?: (event: ConversationStartEvent) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Called when a conversation ends (resolved, closed, etc.).
|
|
39
|
+
*/
|
|
40
|
+
onConversationEnd?: (event: ConversationEndEvent) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Called when the visitor sends a message.
|
|
43
|
+
*/
|
|
44
|
+
onMessageSent?: (event: MessageSentEvent) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Called when a message is received from an agent (human or AI).
|
|
47
|
+
*/
|
|
48
|
+
onMessageReceived?: (event: MessageReceivedEvent) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Called when an error occurs.
|
|
51
|
+
*/
|
|
52
|
+
onError?: (event: ErrorEvent) => void;
|
|
53
|
+
};
|
|
54
|
+
type SupportEventsContextValue = {
|
|
55
|
+
/**
|
|
56
|
+
* Emit an event to all registered callbacks.
|
|
57
|
+
*/
|
|
58
|
+
emit: <T extends SupportEvent>(event: T) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Subscribe to a specific event type.
|
|
61
|
+
* Returns an unsubscribe function.
|
|
62
|
+
*/
|
|
63
|
+
subscribe: <T extends SupportEventType>(type: T, callback: (event: Extract<SupportEvent, {
|
|
64
|
+
type: T;
|
|
65
|
+
}>) => void) => () => void;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Access the events context.
|
|
69
|
+
* Returns null if not inside a SupportEventsProvider.
|
|
70
|
+
*/
|
|
71
|
+
declare function useSupportEvents(): SupportEventsContextValue | null;
|
|
72
|
+
/**
|
|
73
|
+
* Hook to emit events from within the widget.
|
|
74
|
+
* Safe to use outside of provider (will no-op).
|
|
75
|
+
*/
|
|
76
|
+
declare function useSupportEventEmitter(): {
|
|
77
|
+
emitConversationStart: (conversationId: string, conversation?: Conversation) => void;
|
|
78
|
+
emitConversationEnd: (conversationId: string, conversation?: Conversation) => void;
|
|
79
|
+
emitMessageSent: (conversationId: string, message: TimelineItem) => void;
|
|
80
|
+
emitMessageReceived: (conversationId: string, message: TimelineItem) => void;
|
|
81
|
+
emitError: (error: Error, context?: string) => void;
|
|
82
|
+
};
|
|
30
83
|
//#endregion
|
|
31
|
-
export { ConversationEndEvent, ConversationStartEvent, ErrorEvent, MessageReceivedEvent, MessageSentEvent };
|
|
84
|
+
export { ConversationEndEvent, ConversationStartEvent, ErrorEvent, MessageReceivedEvent, MessageSentEvent, SupportEvent, SupportEventCallbacks, SupportEventType, useSupportEventEmitter, useSupportEvents };
|
|
32
85
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","names":[],"sources":["../../../../../../react/src/support/context/events.tsx"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"events.d.ts","names":[],"sources":["../../../../../../react/src/support/context/events.tsx"],"sourcesContent":[],"mappings":";;;;KAUY,gBAAA;AAAA,KAOA,sBAAA,GAPgB;EAOhB,IAAA,EAAA,mBAAsB;EAMtB,cAAA,EAAA,MAAA;EAMA,YAAA,CAAA,EATI,YASY;AAM5B,CAAA;AAMY,KAlBA,oBAAA,GAoBJ;EAII,IAAA,EAAA,iBAAY;EACrB,cAAA,EAAA,MAAA;EACA,YAAA,CAAA,EAvBa,YAuBb;CACA;AACA,KAtBS,gBAAA,GAsBT;EACA,IAAA,EAAA,aAAA;EAAU,cAAA,EAAA,MAAA;EAMD,OAAA,EA1BF,YA0BE;CAImB;AAIF,KA/BjB,oBAAA,GA+BiB;EAIJ,IAAA,EAAA,iBAAA;EAII,cAAA,EAAA,MAAA;EAIV,OAAA,EAxCT,YAwCS;CAAU;AAOjB,KA5CA,UAAA,GA4CA;EAIM,IAAA,EAAA,OAAA;EAAqB,KAAA,EA9C/B,KA8C+B;EAKhB,OAAA,CAAA,EAAA,MAAA;CACf;AACoB,KAjDhB,YAAA,GACT,sBAgDyB,GA/CzB,oBA+CyB,GA9CzB,gBA8CyB,GA7CzB,oBA6CyB,GA5CzB,UA4CyB;AAAsB,KAtCtC,qBAAA,GAsCsC;EAA9B;;AAkIpB;EAQgB,mBAAA,CAAA,EAAA,CAAA,KAAsB,EA5KP,sBA4KO,EAAA,GAAA,IAAA;EAOnB;;;EAyBuC,iBAAA,CAAA,EAAA,CAAA,KAAA,EAxM7B,oBAwM6B,EAAA,GAAA,IAAA;EAOpC;;;0BA3MG;;;;8BAII;;;;oBAIV;;KAOP,yBAAA;;;;mBAIM,qBAAqB;;;;;wBAKhB,wBACf,qBACY,QAAQ;UAAsB;;;;;;;iBAkIlC,gBAAA,CAAA,GAAoB;;;;;iBAQpB,sBAAA,CAAA;iEAOG;+DAUA;qDAQmC;yDAOI;qBAOpC"}
|
|
@@ -58,6 +58,22 @@ type SupportHandle = {
|
|
|
58
58
|
*/
|
|
59
59
|
goHome: () => void;
|
|
60
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Hook to access the imperative handle from within the widget.
|
|
63
|
+
* Returns null if not inside Support component.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* function MyComponent() {
|
|
67
|
+
* const support = useSupportHandle();
|
|
68
|
+
*
|
|
69
|
+
* return (
|
|
70
|
+
* <button onClick={() => support?.startConversation("Hello!")}>
|
|
71
|
+
* Get Help
|
|
72
|
+
* </button>
|
|
73
|
+
* );
|
|
74
|
+
* }
|
|
75
|
+
*/
|
|
76
|
+
declare function useSupportHandle(): SupportHandle | null;
|
|
61
77
|
//#endregion
|
|
62
|
-
export { SupportHandle };
|
|
78
|
+
export { SupportHandle, useSupportHandle };
|
|
63
79
|
//# sourceMappingURL=handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.d.ts","names":[],"sources":["../../../../../../react/src/support/context/handle.tsx"],"sourcesContent":[],"mappings":";;;;;;;AA6BA
|
|
1
|
+
{"version":3,"file":"handle.d.ts","names":[],"sources":["../../../../../../react/src/support/context/handle.tsx"],"sourcesContent":[],"mappings":";;;;;;;AA6BA;;;;;;AAkIA;;;;;;;;;;KAlIY,aAAA;;;;;;;;;;;;;;;;6BAgBgB;UACpB;aACG,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgHT,gBAAA,CAAA,GAAoB"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { SupportLocale, SupportTextContentOverrides } from "./text/locales/keys.js";
|
|
2
2
|
import { CustomPage, PageProps } from "./router.js";
|
|
3
3
|
import { SlotProps } from "./context/slots.js";
|
|
4
|
-
import { ConversationEndEvent, ConversationStartEvent, ErrorEvent, MessageReceivedEvent, MessageSentEvent } from "./context/events.js";
|
|
5
|
-
import { SupportHandle } from "./context/handle.js";
|
|
6
|
-
import "./text/index.js";
|
|
4
|
+
import { ConversationEndEvent, ConversationStartEvent, ErrorEvent, MessageReceivedEvent, MessageSentEvent, SupportEvent, SupportEventCallbacks, SupportEventType, useSupportEventEmitter, useSupportEvents } from "./context/events.js";
|
|
5
|
+
import { SupportHandle, useSupportHandle } from "./context/handle.js";
|
|
6
|
+
import { Text, useSupportText } from "./text/index.js";
|
|
7
7
|
import { Align, CollisionPadding, ContentProps, RootProps, Side, TriggerRenderProps } from "./types.js";
|
|
8
|
-
import "./components/button.js";
|
|
8
|
+
import { CoButton } from "./components/button.js";
|
|
9
|
+
import { Header } from "./components/header.js";
|
|
9
10
|
import { WebSocketContextValue, WebSocketProvider, useWebSocket } from "./context/websocket.js";
|
|
10
11
|
import { useSupportConfig, useSupportNavigation, useSupportStore } from "./store/support-store.js";
|
|
11
12
|
import "./store/index.js";
|
|
12
13
|
import * as _cossistant_core0 from "@cossistant/core";
|
|
14
|
+
import { DefaultRoutes, NavigationState, RouteRegistry as RouteRegistry$1, SupportPage as SupportPageType } from "@cossistant/core";
|
|
13
15
|
import { DefaultMessage } from "@cossistant/types";
|
|
14
16
|
import * as React$1 from "react";
|
|
15
17
|
|
|
@@ -125,6 +127,18 @@ type SupportProps<Locale extends string = SupportLocale> = {
|
|
|
125
127
|
*/
|
|
126
128
|
children?: React$1.ReactNode;
|
|
127
129
|
};
|
|
130
|
+
type SupportTriggerProps = Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
131
|
+
/**
|
|
132
|
+
* Content to render inside the trigger.
|
|
133
|
+
* Can be static content or a function receiving render props.
|
|
134
|
+
*/
|
|
135
|
+
children?: React$1.ReactNode | ((props: TriggerRenderProps) => React$1.ReactNode);
|
|
136
|
+
/**
|
|
137
|
+
* When true, renders children directly with all props passed through.
|
|
138
|
+
*/
|
|
139
|
+
asChild?: boolean;
|
|
140
|
+
className?: string;
|
|
141
|
+
};
|
|
128
142
|
type SupportContentProps = {
|
|
129
143
|
className?: string;
|
|
130
144
|
/**
|
|
@@ -165,6 +179,12 @@ type SupportRouterProps = {
|
|
|
165
179
|
*/
|
|
166
180
|
children?: React$1.ReactNode;
|
|
167
181
|
};
|
|
182
|
+
type SupportPageProps<K extends keyof _cossistant_core0.RouteRegistry = keyof _cossistant_core0.RouteRegistry> = {
|
|
183
|
+
name: K;
|
|
184
|
+
component: React$1.ComponentType<{
|
|
185
|
+
params?: _cossistant_core0.RouteRegistry[K];
|
|
186
|
+
}>;
|
|
187
|
+
};
|
|
168
188
|
type SupportRootProps = {
|
|
169
189
|
/**
|
|
170
190
|
* Controlled open state.
|
|
@@ -235,5 +255,5 @@ declare const Support: (<Locale extends string = SupportLocale>(props: SupportPr
|
|
|
235
255
|
Footer: React$1.FC<SlotProps>;
|
|
236
256
|
};
|
|
237
257
|
//#endregion
|
|
238
|
-
export { Support, SupportProps };
|
|
258
|
+
export { type DefaultRoutes, type NavigationState, type RouteRegistry$1 as RouteRegistry, Support, SupportContentProps, SupportPageProps, type SupportPageType, SupportProps, SupportRootProps, SupportRouterProps, SupportTriggerProps };
|
|
239
259
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../react/src/support/index.tsx"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../react/src/support/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;KAuCY,qCAAqC;;;;;;;;;SAUzC;EAVI;;;;EAmCQ,KAAA,CAAA,EAnBX,KAmBW;EA+CD;;;;EAeJ,UAAA,CAAA,EAAA,MAAA;EASgB;;;;;EA4BnB,eAAM,CAAA,EAAA,OAAA;EAAS;AAwO3B;;;EAAkC,gBAAA,CAAA,EA3Ud,gBA2Uc;EAQtB;;;EAAiE,UAAA,CAAA,EAAA;IAsCjE,OAAA,CAAA,EAAA,MAAA;IAMJ,OAAA,CAAA,EAAA,MAAA;EAKC,CAAA;EAgBW;;;EA4CR,KAAA,CAAA,EAAA,OAAA,GAAA,MAAkB;EAsClB;;;;;EAMwC,IAAA,CAAA,EAAA,OAAA;EADxC;;AAuBZ;;;;;;EA6CW,YAAM,CAAA,EAAA,CAAA,IAAA,EAAA,OAAA,EAAA,GAAA,IAAA;EAAS;AA+G1B;;;;EA1ViD,WAAA,CAAA,EAAA,OAAA;EAAV;;;;;;;oBArRpB;;;;EAoS2C,MAAM,CAAA,EA/R1D,MA+R0D;;;;YA1RzD,4BAA4B;;;;gBAKxB;;;;gCASgB;;;;8BAKF;;;;0BAKJ;;;;8BAKI;;;;oBAKV;;;;;;;aAQP,OAAA,CAAM;;KAwON,mBAAA,GAAsB,KACjC,OAAA,CAAM,qBAAqB;;;;;aAOhB,OAAA,CAAM,qBAAqB,uBAAuB,OAAA,CAAM;;;;;;;KAsCxD,mBAAA;;;;;;SAMJ;;;;;UAKC;;;;;;;;;;;;;;;;qBAgBW;aACR,OAAA,CAAM;;KA2CN,kBAAA;;;;gBAIG;;;;aAIH,OAAA,CAAM;;KA8BN,iCAAgB,iBAAA,CAEO,sBAAa,iBAAA,CAAoC;QAE7E;aACK,OAAA,CAAM;aADV,iBAAA,CAE8B,aAAA,CAAc;;;KAsBxC,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA4BmB;;;;8BAIF;;;;0BAIJ;;;;8BAII;;;;oBAIV;YACR,OAAA,CAAM;;cA+GJ,mCA5VS,sBAEd,aAAa;QAAkB,OAAA,CAAM,IAAI;MAC5C,OAAA,CAAM;;;;;;;eAcC,OAAA,CAAM,qBAAqB,uBAAuB,OAAA,CAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-store.d.ts","names":[],"sources":["../../../../../../react/src/support/store/support-store.ts"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"support-store.d.ts","names":[],"sources":["../../../../../../react/src/support/store/support-store.ts"],"sourcesContent":[],"mappings":";;;;KAgDY,qBAAA,GAAwB,oBACnC,KACC;;;AAFF;;;;AACK,iBAkBW,eAAA,CAAA,CAlBX,EAkB8B,qBAlB9B;AAkBW,KAmBJ,sBAAA,GAnBuB;EAmBvB,MAAA,EAAA,OAAA;EA0BC,IAAA,EAxBN,aAuEN,CAAA,MAAA,CAAA;EAQY,IAAA,EAAA,GAAA,GAAA,IAAA;EAiBZ,KAAA,EAAA,GAAA,GAAA,IAAA;;;;;;;;;;;;;;;;;;;;;cAxEY,wBAAuB;;;;;;;cAuDvB;6CAiBZ,iBAAA,CAAA,aAAA"}
|
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
import { SupportLocale, SupportTextContentOverrides, SupportTextKey, SupportTextVariables } from "./locales/keys.js";
|
|
2
|
-
import React from "react";
|
|
1
|
+
import { SupportLocale, SupportTextContentOverrides, SupportTextDefinitions, SupportTextKey, SupportTextResolvedFormatter, SupportTextVariables } from "./locales/keys.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region ../react/src/support/text/index.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns the active text formatter for the support widget. Throws if used
|
|
8
|
+
* outside of `SupportTextProvider` to help catch integration mistakes.
|
|
9
|
+
*/
|
|
10
|
+
declare function useSupportText(): SupportTextResolvedFormatter;
|
|
11
|
+
type OptionalVariablesProp<K extends SupportTextKey> = SupportTextDefinitions[K]["variables"] extends undefined ? {
|
|
12
|
+
variables?: undefined;
|
|
13
|
+
} : "optional" extends keyof SupportTextDefinitions[K] ? SupportTextDefinitions[K]["optional"] extends true ? {
|
|
14
|
+
variables?: SupportTextVariables<K>;
|
|
15
|
+
} : {
|
|
16
|
+
variables: SupportTextVariables<K>;
|
|
17
|
+
} : {
|
|
18
|
+
variables: SupportTextVariables<K>;
|
|
19
|
+
};
|
|
20
|
+
type TextProps<K extends SupportTextKey, As extends keyof React.JSX.IntrinsicElements = "span"> = OptionalVariablesProp<K> & {
|
|
21
|
+
textKey: K;
|
|
22
|
+
as?: As;
|
|
23
|
+
} & Omit<React.ComponentPropsWithoutRef<As>, "children">;
|
|
24
|
+
/**
|
|
25
|
+
* Convenience component that renders localized support copy via the
|
|
26
|
+
* `SupportTextProvider` context while still allowing callers to customize the
|
|
27
|
+
* rendered HTML element.
|
|
28
|
+
*/
|
|
29
|
+
declare const Text: <K extends SupportTextKey, As extends keyof React.JSX.IntrinsicElements = "span">(props: TextProps<K, As> & {
|
|
30
|
+
ref?: React.Ref<Element>;
|
|
31
|
+
}) => React.ReactElement | null;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Text, useSupportText };
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../../react/src/support/text/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAmIsC,iBAhBtB,cAAA,CAAA,CAgBsB,EAhBJ,4BAgBI;AAAA,KAPjC,qBASS,CAAA,UATuB,cASvB,CAAA,GARb,sBAQa,CARU,CAQV,CAAA,CAAA,WAAA,CAAA,SAAA,SAAA,GAAA;EACH,SAAA,CAAA,EAAA,SAAA;CACO,GAAA,UAAU,SAAA,MARC,sBAQD,CARwB,CAQxB,CAAA,GAPvB,sBAOuB,CAPA,CAOA,CAAA,CAAA,UAAA,CAAA,SAAA,IAAA,GAAA;EACF,SAAA,CAAA,EAPN,oBAOM,CAPe,CAOf,CAAA;CAAtB,GAAA;EACM,SAAA,EAPS,oBAOT,CAP8B,CAO9B,CAAA;CACJ,GAAA;EACkC,SAAA,EARtB,oBAQsB,CARD,CAQC,CAAA;CAA/B;KANJ,SAMD,CAAA,UALO,cAKP,EAAA,WAAA,MAJc,KAAA,CAAM,GAAA,CAAI,iBAIxB,GAAA,MAAA,CAAA,GAHA,qBAGA,CAHsB,CAGtB,CAAA,GAAA;EAAI,OAAA,EAFE,CAEF;EA2BK,EAAA,CAAA,EA5BP,EAiCwB;CAJnB,GA5BP,IA4BO,CA5BF,KAAA,CAAM,wBA4BJ,CA5B6B,EA4B7B,CAAA,EAAA,UAAA,CAAA;;;;;;AAG8B,cAJ5B,IAI4B,EAAA,CAAA,UAH9B,cAG8B,EAAA,WAAA,MAFvB,KAAA,CAAM,GAAA,CAAI,iBAEa,GAAA,MAAA,CAAA,CAAA,KAAA,EAAjC,SAAiC,CAAvB,CAAuB,EAApB,EAAoB,CAAA,GAAA;EACpC,GAAM,CAAA,EADwB,KAAA,CAAM,GAC9B,CADkC,OAClC,CAAA;CAAY,EAAA,GAAlB,KAAA,CAAM,YAAY,GAAA,IAAA"}
|
|
@@ -276,6 +276,16 @@ type SupportTextMessage<K$1 extends SupportTextKey, Vars = SupportTextVariables<
|
|
|
276
276
|
utils: SupportTextUtils;
|
|
277
277
|
}) => string);
|
|
278
278
|
type SupportTextContentOverrides<Locale extends string = SupportLocale> = Partial<{ [K in SupportTextKey]: SupportTextMessage<K> | Partial<Record<SupportLocale | Locale, SupportTextMessage<K>>> }>;
|
|
279
|
+
type SupportTextFormatter = {
|
|
280
|
+
<K$1 extends SupportTextKey>(key: K$1, variables: SupportTextVariables<K$1>): string;
|
|
281
|
+
<K$1 extends SupportTextKey>(key: K$1): string;
|
|
282
|
+
};
|
|
283
|
+
type KeysWithVariables = { [K in SupportTextKey]: SupportTextVariables<K> extends undefined ? never : OptionalFlag<K> extends true ? never : K }[SupportTextKey];
|
|
284
|
+
type StrictSupportTextFormatter = {
|
|
285
|
+
<K$1 extends KeysWithVariables>(key: K$1, variables: SupportTextVariables<K$1>): string;
|
|
286
|
+
<K$1 extends Exclude<SupportTextKey, KeysWithVariables>>(key: K$1, variables?: SupportTextVariables<K$1>): string;
|
|
287
|
+
};
|
|
288
|
+
type SupportTextResolvedFormatter = StrictSupportTextFormatter & SupportTextFormatter;
|
|
279
289
|
//#endregion
|
|
280
|
-
export { SupportLocale, SupportTextContentOverrides, SupportTextKey, SupportTextVariables };
|
|
290
|
+
export { SupportLocale, SupportTextContentOverrides, SupportTextDefinitions, SupportTextKey, SupportTextResolvedFormatter, SupportTextVariables };
|
|
281
291
|
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","names":[],"sources":["../../../../../../../react/src/support/text/locales/keys.ts"],"sourcesContent":[],"mappings":";;;KAMY,aAAA;KAEA,qBAAA;AAFA,KAIA,qBAAA,GAJa;EAEb,KAAA,EAGJ,qBAHyB;EAErB,KAAA,EAAA,MAAA;AAKZ,CAAA;AAOY,KAPA,gBAAA,GAOkB;EACpB,YAAA,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAP+B,IAAA,CAAK,mBAOpC,EAAA,GAAA,MAAA;EACA,SAAA,EAAA,CAAA,KAAA,EAAA,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KApEA,sBAAA,UAAgC;KAChC,cAAA,SAAuB;KAEvB,iCAA+B,kBAC1C,uBAAuB;KAEnB,yBAAuB,kBAC3B,uBAAuB;;;KAEnB,6BACM,uBACH,qBAAqB,QACzB,qCAED,aAAa,oBACZ,mBACA;KAEQ,+BACD,uBACH,qBAAqB;aAIf,iBAAiB,KAAG;WACtB;SACF;;KAOE,oDAAoD,iBAC/D,gBACO,iBACH,mBAAmB,KACnB,QAAQ,OAAO,gBAAgB,QAAQ,mBAAmB;KAGnD,oBAAA;eACA,qBACL,gBACM,qBAAqB;eAGtB,qBAAqB;;KAG5B,iBAAA,WACE,iBAAiB,qBAAqB,+BAEzC,aAAa,0BAEZ,IACH;KAEU,0BAAA;eACA,wBACL,gBACM,qBAAqB;eAEtB,QAAQ,gBAAgB,yBAC7B,iBACO,qBAAqB;;KAIvB,4BAAA,GAA+B,6BAC1C"}
|
|
@@ -1,10 +1,36 @@
|
|
|
1
|
-
import { DefaultMessage } from "@cossistant/types";
|
|
1
|
+
import { DefaultMessage, SenderType } from "@cossistant/types";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
|
|
4
4
|
//#region ../react/src/support-config.d.ts
|
|
5
|
+
type DefaultMessageProps = {
|
|
6
|
+
content: string;
|
|
7
|
+
senderType: SenderType;
|
|
8
|
+
senderId?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Declarative message entry for `SupportConfig`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <SupportConfig>
|
|
15
|
+
* <DefaultMessage senderType="team_member" content="How can we help?" />
|
|
16
|
+
* </SupportConfig>
|
|
17
|
+
*/
|
|
18
|
+
declare function DefaultMessage$1(_props: DefaultMessageProps): React$1.ReactElement | null;
|
|
19
|
+
declare namespace DefaultMessage$1 {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
declare function extractDefaultMessagesFromChildren(children: React$1.ReactNode): DefaultMessage[];
|
|
23
|
+
declare function resolveSupportConfigMessages({
|
|
24
|
+
children,
|
|
25
|
+
defaultMessages
|
|
26
|
+
}: {
|
|
27
|
+
children?: React$1.ReactNode;
|
|
28
|
+
defaultMessages?: DefaultMessage[];
|
|
29
|
+
}): DefaultMessage[] | undefined;
|
|
5
30
|
type SupportConfigProps = {
|
|
6
31
|
defaultMessages?: DefaultMessage[];
|
|
7
32
|
quickOptions?: string[];
|
|
33
|
+
children?: React$1.ReactNode;
|
|
8
34
|
};
|
|
9
35
|
/**
|
|
10
36
|
* Component exposed by Cossistant allowing you to change the support widget default messages and quick response whenever rendered.
|
|
@@ -12,10 +38,11 @@ type SupportConfigProps = {
|
|
|
12
38
|
declare const SupportConfig: {
|
|
13
39
|
({
|
|
14
40
|
defaultMessages,
|
|
15
|
-
quickOptions
|
|
41
|
+
quickOptions,
|
|
42
|
+
children
|
|
16
43
|
}: SupportConfigProps): React$1.ReactElement | null;
|
|
17
44
|
displayName: string;
|
|
18
45
|
};
|
|
19
46
|
//#endregion
|
|
20
|
-
export { SupportConfig, SupportConfigProps };
|
|
47
|
+
export { DefaultMessage$1 as DefaultMessage, DefaultMessageProps, SupportConfig, SupportConfigProps, extractDefaultMessagesFromChildren, resolveSupportConfigMessages };
|
|
21
48
|
//# sourceMappingURL=support-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-config.d.ts","names":[],"sources":["../../../../react/src/support-config.tsx"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"support-config.d.ts","names":[],"sources":["../../../../react/src/support-config.tsx"],"sourcesContent":[],"mappings":";;;;KASY,mBAAA;;EAAA,UAAA,EAEC,UAFkB;EAcf,QAAA,CAAA,EAAA,MAAA;;AAchB;AA0CA;;;;;;;AAeY,iBAvEI,gBAAA,CAwEG,MAAA,EAvEV,mBAyES,CAAA,EAxEf,OAAA,CAAM,YAwEkB,GAAA,IAAA;AAMd,kBAhFG,gBAAA,CAyGf;;;iBA3Fe,kCAAA,WACL,OAAA,CAAM,YACd;AAoEA,iBA5Ba,4BAAA,CA4Bb;EAAA,QAAA;EAAA;CAAA,EAAA;EAAqB,QAAM,CAAA,EAxBlB,OAAA,CAAM,SAwBY;EAAY,eAAA,CAAA,EAvBvB,cAuBuB,EAAA;IAtBtC;KASQ,kBAAA;oBACO;;aAEP,OAAA,CAAM;;;;;cAML;;;;;KAIV,qBAAqB,OAAA,CAAM"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { shouldDisplayConversation } from "./conversation.js";
|
|
2
2
|
import { PENDING_CONVERSATION_ID, generateShortPrimaryId } from "./id.js";
|
|
3
|
-
import "./merge-refs.js";
|
|
3
|
+
import { mergeRefs, useMergeRefs } from "./merge-refs.js";
|
|
4
4
|
import { useRenderElement } from "./use-render-element.js";
|
|
@@ -1 +1,30 @@
|
|
|
1
|
-
import "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
|
|
3
|
+
//#region ../react/src/utils/merge-refs.d.ts
|
|
4
|
+
type PossibleRef<T> = React$1.Ref<T> | React$1.RefCallback<T> | undefined | null;
|
|
5
|
+
/**
|
|
6
|
+
* Merges multiple refs into a single callback ref.
|
|
7
|
+
* Useful for forwarding refs to a component while also using a local ref.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const Component = forwardRef((props, forwardedRef) => {
|
|
11
|
+
* const localRef = useRef(null);
|
|
12
|
+
* const mergedRef = mergeRefs([forwardedRef, localRef]);
|
|
13
|
+
* return <div ref={mergedRef} />;
|
|
14
|
+
* });
|
|
15
|
+
*/
|
|
16
|
+
declare function mergeRefs<T>(refs: PossibleRef<T>[]): React$1.RefCallback<T> | null;
|
|
17
|
+
/**
|
|
18
|
+
* Hook version of mergeRefs that memoizes the result.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const Component = forwardRef((props, forwardedRef) => {
|
|
22
|
+
* const localRef = useRef(null);
|
|
23
|
+
* const mergedRef = useMergeRefs([forwardedRef, localRef]);
|
|
24
|
+
* return <div ref={mergedRef} />;
|
|
25
|
+
* });
|
|
26
|
+
*/
|
|
27
|
+
declare function useMergeRefs<T>(refs: PossibleRef<T>[]): React$1.RefCallback<T> | null;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { mergeRefs, useMergeRefs };
|
|
30
|
+
//# sourceMappingURL=merge-refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-refs.d.ts","names":[],"sources":["../../../../../react/src/utils/merge-refs.ts"],"sourcesContent":[],"mappings":";;;KAEK,iBAAiB,OAAA,CAAM,IAAI,KAAK,OAAA,CAAM,YAAY;;AAFxB;;;;;;AAe/B;;;;AAEG,iBAFa,SAEP,CAAA,CAAA,CAAA,CAAA,IAAA,EADF,WACE,CADU,CACV,CAAA,EAAA,CAAA,EAAN,OAAA,CAAM,WAAA,CAAY,CAAZ,CAAA,GAAA,IAAA;;AA2CT;;;;;;;;;iBAAgB,sBACT,YAAY,OAChB,OAAA,CAAM,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-render-element.d.ts","names":[],"sources":["../../../../../react/src/utils/use-render-element.tsx"],"sourcesContent":[],"mappings":";;;;AAI+B,KA8B1B,YAAA,GAAY,MAAS,GAAA,CAAI,iBAAA;AAAiB,KAE1C,SAAA,CAAA,KAAS,CAAA,GAAA,MAAA,
|
|
1
|
+
{"version":3,"file":"use-render-element.d.ts","names":[],"sources":["../../../../../react/src/utils/use-render-element.tsx"],"sourcesContent":[],"mappings":";;;;AAI+B,KA8B1B,YAAA,GAAY,MAAS,GAAA,CAAI,iBAAA;AAAiB,KAE1C,SAAA,CAAA,KAAS,CAAA,GAAA,MAAA,GAAA,CAA4B,CAAA,KAAK,EAAL,KAAK,EAAA,GAAA,MAAA,CA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