@tylertech/forge-ai-react 0.4.1 → 0.6.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/dist/ForgeAiActionsToolbar.d.ts +24 -16
- package/dist/ForgeAiActionsToolbar.js +8 -1
- package/dist/ForgeAiAgentInfo.d.ts +51 -0
- package/dist/ForgeAiAgentInfo.js +33 -0
- package/dist/ForgeAiArtifact.d.ts +15 -16
- package/dist/ForgeAiAttachment.d.ts +77 -0
- package/dist/ForgeAiAttachment.js +43 -0
- package/dist/ForgeAiButton.d.ts +15 -16
- package/dist/ForgeAiChainOfThought.d.ts +15 -16
- package/dist/ForgeAiChatHeader.d.ts +40 -30
- package/dist/ForgeAiChatHeader.js +19 -11
- package/dist/ForgeAiChatInterface.d.ts +16 -19
- package/dist/ForgeAiChatbot.d.ts +147 -0
- package/dist/ForgeAiChatbot.js +94 -0
- package/dist/ForgeAiChatbotToolCall.d.ts +60 -0
- package/dist/ForgeAiChatbotToolCall.js +38 -0
- package/dist/ForgeAiConfirmationPrompt.d.ts +74 -0
- package/dist/ForgeAiConfirmationPrompt.js +46 -0
- package/dist/ForgeAiDialog.d.ts +15 -16
- package/dist/ForgeAiDropdownMenu.d.ts +23 -22
- package/dist/ForgeAiDropdownMenu.js +10 -2
- package/dist/ForgeAiDropdownMenuItem.d.ts +16 -19
- package/dist/ForgeAiDropdownMenuItemGroup.d.ts +15 -16
- package/dist/ForgeAiDropdownMenuSeparator.d.ts +15 -16
- package/dist/ForgeAiEmbeddedChat.d.ts +33 -20
- package/dist/ForgeAiEmbeddedChat.js +18 -2
- package/dist/ForgeAiEmptyState.d.ts +19 -18
- package/dist/ForgeAiErrorMessage.d.ts +52 -0
- package/dist/ForgeAiErrorMessage.js +18 -0
- package/dist/ForgeAiEventStreamViewer.d.ts +48 -0
- package/dist/ForgeAiEventStreamViewer.js +18 -0
- package/dist/ForgeAiFab.d.ts +15 -16
- package/dist/ForgeAiFilePicker.d.ts +32 -24
- package/dist/ForgeAiFilePicker.js +19 -2
- package/dist/ForgeAiFloatingChat.d.ts +18 -30
- package/dist/ForgeAiGradientContainer.d.ts +15 -16
- package/dist/ForgeAiIcon.d.ts +15 -16
- package/dist/ForgeAiIconButton.d.ts +51 -0
- package/dist/ForgeAiIconButton.js +21 -0
- package/dist/ForgeAiMessageThread.d.ts +90 -0
- package/dist/ForgeAiMessageThread.js +62 -0
- package/dist/ForgeAiModal.d.ts +19 -16
- package/dist/ForgeAiOverlay.d.ts +27 -22
- package/dist/ForgeAiOverlay.js +14 -1
- package/dist/ForgeAiPaginator.d.ts +66 -0
- package/dist/ForgeAiPaginator.js +36 -0
- package/dist/ForgeAiPopover.d.ts +27 -22
- package/dist/ForgeAiPopover.js +14 -1
- package/dist/ForgeAiPrompt.d.ts +44 -22
- package/dist/ForgeAiPrompt.js +18 -1
- package/dist/ForgeAiReasoning.d.ts +15 -16
- package/dist/ForgeAiReasoningContent.d.ts +15 -16
- package/dist/ForgeAiReasoningHeader.d.ts +15 -16
- package/dist/ForgeAiResponseMessage.d.ts +46 -20
- package/dist/ForgeAiResponseMessage.js +22 -3
- package/dist/ForgeAiSidebar.d.ts +15 -16
- package/dist/ForgeAiSidebarChat.d.ts +18 -30
- package/dist/ForgeAiSlashCommandMenu.d.ts +68 -0
- package/dist/ForgeAiSlashCommandMenu.js +44 -0
- package/dist/ForgeAiSpinner.d.ts +55 -0
- package/dist/ForgeAiSpinner.js +21 -0
- package/dist/ForgeAiSuggestions.d.ts +18 -16
- package/dist/ForgeAiThinkingIndicator.d.ts +24 -16
- package/dist/ForgeAiThinkingIndicator.js +6 -1
- package/dist/ForgeAiThoughtBase.d.ts +15 -16
- package/dist/ForgeAiThoughtDetail.d.ts +15 -16
- package/dist/ForgeAiThoughtImage.d.ts +15 -16
- package/dist/ForgeAiThoughtSearchResult.d.ts +15 -16
- package/dist/ForgeAiThreads.d.ts +18 -16
- package/dist/ForgeAiToolDataTable.d.ts +51 -0
- package/dist/ForgeAiToolDataTable.js +33 -0
- package/dist/ForgeAiTooltip.d.ts +17 -18
- package/dist/ForgeAiUserMessage.d.ts +15 -16
- package/dist/ForgeAiVoiceInput.d.ts +15 -16
- package/dist/ForgePromptButton.d.ts +15 -16
- package/dist/index.d.ts +20 -7
- package/dist/index.js +20 -7
- package/package.json +31 -31
package/dist/ForgeAiPrompt.d.ts
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
import {
|
|
3
|
+
ForgeAiPrompt as ForgeAiPromptElement,
|
|
4
|
+
Event,
|
|
5
|
+
CustomEvent,
|
|
6
|
+
} from "@tylertech/forge-ai/ai-prompt";
|
|
7
|
+
|
|
8
|
+
export type { ForgeAiPromptElement, Event, CustomEvent };
|
|
9
|
+
|
|
10
|
+
export interface ForgeAiPromptProps extends Pick<
|
|
11
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
12
|
+
| "children"
|
|
13
|
+
| "dir"
|
|
14
|
+
| "hidden"
|
|
15
|
+
| "id"
|
|
16
|
+
| "lang"
|
|
17
|
+
| "slot"
|
|
18
|
+
| "style"
|
|
19
|
+
| "title"
|
|
20
|
+
| "translate"
|
|
21
|
+
| "onClick"
|
|
22
|
+
| "onFocus"
|
|
23
|
+
| "onBlur"
|
|
24
|
+
> {
|
|
22
25
|
/** Whether the send button is disabled */
|
|
23
26
|
sendDisabled?: boolean;
|
|
24
27
|
|
|
@@ -34,6 +37,9 @@ export interface ForgeAiPromptProps
|
|
|
34
37
|
/** Whether the component is in running state (shows stop button instead of send button) */
|
|
35
38
|
running?: boolean;
|
|
36
39
|
|
|
40
|
+
/** Whether debug mode is active (shows debug icon button) */
|
|
41
|
+
debugMode?: boolean;
|
|
42
|
+
|
|
37
43
|
/** Placeholder text for the textarea field */
|
|
38
44
|
placeholder?: ForgeAiPromptElement["placeholder"];
|
|
39
45
|
|
|
@@ -64,6 +70,15 @@ export interface ForgeAiPromptProps
|
|
|
64
70
|
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
65
71
|
tabIndex?: number;
|
|
66
72
|
|
|
73
|
+
/** Available slash commands */
|
|
74
|
+
slashCommands?: ForgeAiPromptElement["slashCommands"];
|
|
75
|
+
|
|
76
|
+
/** undefined */
|
|
77
|
+
onInput?: (event: CustomEvent) => void;
|
|
78
|
+
|
|
79
|
+
/** undefined */
|
|
80
|
+
onForgeAiPromptCommand?: (event: CustomEvent) => void;
|
|
81
|
+
|
|
67
82
|
/** Fired when the send button is clicked or Enter is pressed (without Shift). Cancelable - if cancelled, running state is not set and input is not cleared. */
|
|
68
83
|
onForgeAiPromptSend?: (
|
|
69
84
|
event: CustomEvent<CustomEvent<ForgeAiPromptSendEventData>>,
|
|
@@ -79,6 +94,9 @@ export interface ForgeAiPromptProps
|
|
|
79
94
|
|
|
80
95
|
/** Fired when the stop button is clicked. Cancelable - if cancelled, running state remains true. */
|
|
81
96
|
onForgeAiPromptStop?: (event: CustomEvent<CustomEvent<void>>) => void;
|
|
97
|
+
|
|
98
|
+
/** Fired when the debug icon button is clicked. */
|
|
99
|
+
onForgeAiPromptDebugToggle?: (event: CustomEvent<CustomEvent<void>>) => void;
|
|
82
100
|
}
|
|
83
101
|
|
|
84
102
|
/**
|
|
@@ -87,13 +105,17 @@ export interface ForgeAiPromptProps
|
|
|
87
105
|
*
|
|
88
106
|
*
|
|
89
107
|
* ### **Events:**
|
|
90
|
-
* - **
|
|
108
|
+
* - **input**
|
|
109
|
+
* - **forge-ai-prompt-command**
|
|
110
|
+
* - **forge-ai-prompt-send** - Fired when the send button is clicked or Enter is pressed (without Shift). Cancelable - if cancelled, running state is not set and input is not cleared.
|
|
91
111
|
* - **forge-ai-prompt-cancel** - Fired when the Escape key is pressed (if cancelOnEscape is true).
|
|
92
112
|
* - **forge-ai-prompt-attachment** - Fired when files are pasted into the textarea.
|
|
93
113
|
* - **forge-ai-prompt-stop** - Fired when the stop button is clicked. Cancelable - if cancelled, running state remains true.
|
|
114
|
+
* - **forge-ai-prompt-debug-toggle** - Fired when the debug icon button is clicked.
|
|
94
115
|
*
|
|
95
116
|
* ### **Methods:**
|
|
96
|
-
* - **
|
|
117
|
+
* - **closeSlashMenu(): _void_** - Closes the slash command menu
|
|
118
|
+
* - **focus(): _void_** - Focuses the textarea element
|
|
97
119
|
*
|
|
98
120
|
* ### **Slots:**
|
|
99
121
|
* - **actions** - Slot for action components that are hidden in inline mode (voice input, file picker, model selectors, web search, etc.)
|
package/dist/ForgeAiPrompt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
2
|
import "@tylertech/forge-ai/ai-prompt";
|
|
3
|
-
import { useEventListener } from "./react-utils.js";
|
|
3
|
+
import { useEventListener, useProperties } from "./react-utils.js";
|
|
4
4
|
|
|
5
5
|
export const ForgeAiPrompt = forwardRef((props, forwardedRef) => {
|
|
6
6
|
const ref = useRef(null);
|
|
@@ -10,13 +10,21 @@ export const ForgeAiPrompt = forwardRef((props, forwardedRef) => {
|
|
|
10
10
|
inputDisabled,
|
|
11
11
|
cancelOnEscape,
|
|
12
12
|
running,
|
|
13
|
+
debugMode,
|
|
13
14
|
placeholder,
|
|
14
15
|
value,
|
|
15
16
|
variant,
|
|
17
|
+
slashCommands,
|
|
16
18
|
...filteredProps
|
|
17
19
|
} = props;
|
|
18
20
|
|
|
19
21
|
/** Event listeners - run once */
|
|
22
|
+
useEventListener(ref, "input", props.onInput);
|
|
23
|
+
useEventListener(
|
|
24
|
+
ref,
|
|
25
|
+
"forge-ai-prompt-command",
|
|
26
|
+
props.onForgeAiPromptCommand,
|
|
27
|
+
);
|
|
20
28
|
useEventListener(ref, "forge-ai-prompt-send", props.onForgeAiPromptSend);
|
|
21
29
|
useEventListener(ref, "forge-ai-prompt-cancel", props.onForgeAiPromptCancel);
|
|
22
30
|
useEventListener(
|
|
@@ -25,6 +33,14 @@ export const ForgeAiPrompt = forwardRef((props, forwardedRef) => {
|
|
|
25
33
|
props.onForgeAiPromptAttachment,
|
|
26
34
|
);
|
|
27
35
|
useEventListener(ref, "forge-ai-prompt-stop", props.onForgeAiPromptStop);
|
|
36
|
+
useEventListener(
|
|
37
|
+
ref,
|
|
38
|
+
"forge-ai-prompt-debug-toggle",
|
|
39
|
+
props.onForgeAiPromptDebugToggle,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
/** Properties - run whenever a property has changed */
|
|
43
|
+
useProperties(ref, "slashCommands", props.slashCommands);
|
|
28
44
|
|
|
29
45
|
return React.createElement(
|
|
30
46
|
"forge-ai-prompt",
|
|
@@ -51,6 +67,7 @@ export const ForgeAiPrompt = forwardRef((props, forwardedRef) => {
|
|
|
51
67
|
"input-disabled": props.inputDisabled ? true : undefined,
|
|
52
68
|
"cancel-on-escape": props.cancelOnEscape ? true : undefined,
|
|
53
69
|
running: props.running ? true : undefined,
|
|
70
|
+
"debug-mode": props.debugMode ? true : undefined,
|
|
54
71
|
style: { ...props.style },
|
|
55
72
|
},
|
|
56
73
|
props.children,
|
|
@@ -3,22 +3,21 @@ import { ForgeAiReasoning as ForgeAiReasoningElement } from "@tylertech/forge-ai
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiReasoningElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiReasoningProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiReasoningProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
22
21
|
/** Whether the reasoning is expanded */
|
|
23
22
|
expanded?: boolean;
|
|
24
23
|
|
|
@@ -3,22 +3,21 @@ import { ForgeAiReasoningContent as ForgeAiReasoningContentElement } from "@tyle
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiReasoningContentElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiReasoningContentProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiReasoningContentProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
22
21
|
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
23
22
|
className?: string;
|
|
24
23
|
|
|
@@ -3,22 +3,21 @@ import { ForgeAiReasoningHeader as ForgeAiReasoningHeaderElement } from "@tylert
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiReasoningHeaderElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiReasoningHeaderProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiReasoningHeaderProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
22
21
|
/** Whether the header is expanded */
|
|
23
22
|
expanded?: boolean;
|
|
24
23
|
|
|
@@ -3,22 +3,30 @@ import { ForgeAiResponseMessage as ForgeAiResponseMessageElement } from "@tylert
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiResponseMessageElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiResponseMessageProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
export interface ForgeAiResponseMessageProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
21
|
+
/** Whether the message is complete. Toolbar only shows when true. */
|
|
22
|
+
complete?: boolean;
|
|
23
|
+
|
|
24
|
+
/** undefined */
|
|
25
|
+
enableReactions?: boolean;
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
hasDebugData?: boolean;
|
|
29
|
+
|
|
22
30
|
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
23
31
|
className?: string;
|
|
24
32
|
|
|
@@ -40,9 +48,24 @@ export interface ForgeAiResponseMessageProps
|
|
|
40
48
|
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
41
49
|
tabIndex?: number;
|
|
42
50
|
|
|
43
|
-
/** Fired when
|
|
44
|
-
|
|
45
|
-
event: CustomEvent<CustomEvent<
|
|
51
|
+
/** Fired when copy action is clicked. */
|
|
52
|
+
onForgeAiResponseMessageCopy?: (
|
|
53
|
+
event: CustomEvent<CustomEvent<void>>,
|
|
54
|
+
) => void;
|
|
55
|
+
|
|
56
|
+
/** Fired when refresh action is clicked. */
|
|
57
|
+
onForgeAiResponseMessageRefresh?: (
|
|
58
|
+
event: CustomEvent<CustomEvent<void>>,
|
|
59
|
+
) => void;
|
|
60
|
+
|
|
61
|
+
/** Fired when thumbs-up action is clicked. */
|
|
62
|
+
onForgeAiResponseMessageThumbsUp?: (
|
|
63
|
+
event: CustomEvent<CustomEvent<void>>,
|
|
64
|
+
) => void;
|
|
65
|
+
|
|
66
|
+
/** Fired when thumbs-down action is clicked. */
|
|
67
|
+
onForgeAiResponseMessageThumbsDown?: (
|
|
68
|
+
event: CustomEvent<CustomEvent<void>>,
|
|
46
69
|
) => void;
|
|
47
70
|
}
|
|
48
71
|
|
|
@@ -52,6 +75,9 @@ export interface ForgeAiResponseMessageProps
|
|
|
52
75
|
*
|
|
53
76
|
*
|
|
54
77
|
* ### **Events:**
|
|
55
|
-
* - **forge-ai-response-message-
|
|
78
|
+
* - **forge-ai-response-message-copy** - Fired when copy action is clicked.
|
|
79
|
+
* - **forge-ai-response-message-refresh** - Fired when refresh action is clicked.
|
|
80
|
+
* - **forge-ai-response-message-thumbs-up** - Fired when thumbs-up action is clicked.
|
|
81
|
+
* - **forge-ai-response-message-thumbs-down** - Fired when thumbs-down action is clicked.
|
|
56
82
|
*/
|
|
57
83
|
export const ForgeAiResponseMessage: React.ForwardRefExoticComponent<ForgeAiResponseMessageProps>;
|
|
@@ -4,12 +4,28 @@ import { useEventListener } from "./react-utils.js";
|
|
|
4
4
|
|
|
5
5
|
export const ForgeAiResponseMessage = forwardRef((props, forwardedRef) => {
|
|
6
6
|
const ref = useRef(null);
|
|
7
|
+
const { complete, enableReactions, hasDebugData, ...filteredProps } = props;
|
|
7
8
|
|
|
8
9
|
/** Event listeners - run once */
|
|
9
10
|
useEventListener(
|
|
10
11
|
ref,
|
|
11
|
-
"forge-ai-response-message-
|
|
12
|
-
props.
|
|
12
|
+
"forge-ai-response-message-copy",
|
|
13
|
+
props.onForgeAiResponseMessageCopy,
|
|
14
|
+
);
|
|
15
|
+
useEventListener(
|
|
16
|
+
ref,
|
|
17
|
+
"forge-ai-response-message-refresh",
|
|
18
|
+
props.onForgeAiResponseMessageRefresh,
|
|
19
|
+
);
|
|
20
|
+
useEventListener(
|
|
21
|
+
ref,
|
|
22
|
+
"forge-ai-response-message-thumbs-up",
|
|
23
|
+
props.onForgeAiResponseMessageThumbsUp,
|
|
24
|
+
);
|
|
25
|
+
useEventListener(
|
|
26
|
+
ref,
|
|
27
|
+
"forge-ai-response-message-thumbs-down",
|
|
28
|
+
props.onForgeAiResponseMessageThumbsDown,
|
|
13
29
|
);
|
|
14
30
|
|
|
15
31
|
return React.createElement(
|
|
@@ -23,12 +39,15 @@ export const ForgeAiResponseMessage = forwardRef((props, forwardedRef) => {
|
|
|
23
39
|
forwardedRef.current = node;
|
|
24
40
|
}
|
|
25
41
|
},
|
|
26
|
-
...
|
|
42
|
+
...filteredProps,
|
|
27
43
|
class: props.className,
|
|
28
44
|
exportparts: props.exportparts,
|
|
29
45
|
for: props.htmlFor,
|
|
30
46
|
part: props.part,
|
|
31
47
|
tabindex: props.tabIndex,
|
|
48
|
+
complete: props.complete ? true : undefined,
|
|
49
|
+
"enable-reactions": props.enableReactions ? true : undefined,
|
|
50
|
+
"has-debug-data": props.hasDebugData ? true : undefined,
|
|
32
51
|
style: { ...props.style },
|
|
33
52
|
},
|
|
34
53
|
props.children,
|
package/dist/ForgeAiSidebar.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiSidebar as ForgeAiSidebarElement } from "@tylertech/forge-ai/ai-
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiSidebarElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiSidebarProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiSidebarProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
22
21
|
/** Indicates whether the sidebar is open. */
|
|
23
22
|
open?: boolean;
|
|
24
23
|
|
|
@@ -3,28 +3,25 @@ import { ForgeAiSidebarChat as ForgeAiSidebarChatElement } from "@tylertech/forg
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiSidebarChatElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiSidebarChatProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/** Indicates whether the sidebar chat is open. */
|
|
6
|
+
export interface ForgeAiSidebarChatProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
21
|
+
/** undefined */
|
|
23
22
|
open?: boolean;
|
|
24
23
|
|
|
25
|
-
/**
|
|
26
|
-
When true, the chat content will be shown in a fullscreen modal.
|
|
27
|
-
When false, the chat will be displayed in the sidebar. */
|
|
24
|
+
/** undefined */
|
|
28
25
|
expanded?: boolean;
|
|
29
26
|
|
|
30
27
|
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
@@ -72,16 +69,7 @@ When false, the chat will be displayed in the sidebar. */
|
|
|
72
69
|
* - **forge-ai-sidebar-chat-expand** - Fired when the sidebar chat is expanded to modal
|
|
73
70
|
* - **forge-ai-sidebar-chat-collapse** - Fired when the sidebar chat is collapsed from modal
|
|
74
71
|
*
|
|
75
|
-
* ### **Methods:**
|
|
76
|
-
* - **show(): _void_** - Opens the sidebar chat.
|
|
77
|
-
* - **close(): _void_** - Closes the sidebar chat.
|
|
78
|
-
* - **toggle(): _void_** - Toggles the sidebar chat open state.
|
|
79
|
-
* - **expand(): _void_** - Expands the chat to fullscreen modal.
|
|
80
|
-
* - **collapse(): _void_** - Collapses the chat from fullscreen modal back to sidebar.
|
|
81
|
-
*
|
|
82
72
|
* ### **Slots:**
|
|
83
|
-
* - _default_ - Default slot for
|
|
84
|
-
* - **suggestions** - Slot for AI suggestions component
|
|
85
|
-
* - **prompt** - Slot for custom AI prompt component. If not provided, a default forge-ai-prompt will be used.
|
|
73
|
+
* - _default_ - Default slot for chatbot component
|
|
86
74
|
*/
|
|
87
75
|
export const ForgeAiSidebarChat: React.ForwardRefExoticComponent<ForgeAiSidebarChatProps>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiSlashCommandMenu as ForgeAiSlashCommandMenuElement } from "@tylertech/forge-ai/ai-slash-command-menu";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiSlashCommandMenuElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiSlashCommandMenuProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
21
|
+
/** undefined */
|
|
22
|
+
open?: boolean;
|
|
23
|
+
|
|
24
|
+
/** undefined */
|
|
25
|
+
filterQuery?: ForgeAiSlashCommandMenuElement["filterQuery"];
|
|
26
|
+
|
|
27
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
28
|
+
className?: string;
|
|
29
|
+
|
|
30
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
31
|
+
exportparts?: string;
|
|
32
|
+
|
|
33
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
34
|
+
htmlFor?: string;
|
|
35
|
+
|
|
36
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
37
|
+
key?: number | string;
|
|
38
|
+
|
|
39
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
40
|
+
part?: string;
|
|
41
|
+
|
|
42
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
43
|
+
ref?: any;
|
|
44
|
+
|
|
45
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
46
|
+
tabIndex?: number;
|
|
47
|
+
|
|
48
|
+
/** Fired when a command is selected. */
|
|
49
|
+
onForgeAiSlashCommandMenuSelect?: (
|
|
50
|
+
event: CustomEvent<CustomEvent<ForgeAiSlashCommandMenuSelectEventData>>,
|
|
51
|
+
) => void;
|
|
52
|
+
|
|
53
|
+
/** Fired when the menu should close. */
|
|
54
|
+
onForgeAiSlashCommandMenuClose?: (
|
|
55
|
+
event: CustomEvent<CustomEvent<void>>,
|
|
56
|
+
) => void;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* ---
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* ### **Events:**
|
|
65
|
+
* - **forge-ai-slash-command-menu-select** - Fired when a command is selected.
|
|
66
|
+
* - **forge-ai-slash-command-menu-close** - Fired when the menu should close.
|
|
67
|
+
*/
|
|
68
|
+
export const ForgeAiSlashCommandMenu: React.ForwardRefExoticComponent<ForgeAiSlashCommandMenuProps>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-slash-command-menu";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiSlashCommandMenu = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { open, filterQuery, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(
|
|
11
|
+
ref,
|
|
12
|
+
"forge-ai-slash-command-menu-select",
|
|
13
|
+
props.onForgeAiSlashCommandMenuSelect,
|
|
14
|
+
);
|
|
15
|
+
useEventListener(
|
|
16
|
+
ref,
|
|
17
|
+
"forge-ai-slash-command-menu-close",
|
|
18
|
+
props.onForgeAiSlashCommandMenuClose,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return React.createElement(
|
|
22
|
+
"forge-ai-slash-command-menu",
|
|
23
|
+
{
|
|
24
|
+
ref: (node) => {
|
|
25
|
+
ref.current = node;
|
|
26
|
+
if (typeof forwardedRef === "function") {
|
|
27
|
+
forwardedRef(node);
|
|
28
|
+
} else if (forwardedRef) {
|
|
29
|
+
forwardedRef.current = node;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
...filteredProps,
|
|
33
|
+
"filter-query": props.filterQuery || props["filter-query"],
|
|
34
|
+
class: props.className,
|
|
35
|
+
exportparts: props.exportparts,
|
|
36
|
+
for: props.htmlFor,
|
|
37
|
+
part: props.part,
|
|
38
|
+
tabindex: props.tabIndex,
|
|
39
|
+
open: props.open ? true : undefined,
|
|
40
|
+
style: { ...props.style },
|
|
41
|
+
},
|
|
42
|
+
props.children,
|
|
43
|
+
);
|
|
44
|
+
});
|