@tylertech/forge-ai-react 0.4.0 → 0.5.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 +37 -30
- package/dist/ForgeAiChatHeader.js +19 -11
- package/dist/ForgeAiChatInterface.d.ts +16 -19
- package/dist/ForgeAiChatbot.d.ts +144 -0
- package/dist/ForgeAiChatbot.js +92 -0
- package/dist/ForgeAiChatbotToolCall.d.ts +57 -0
- package/dist/ForgeAiChatbotToolCall.js +36 -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 +19 -16
- package/dist/ForgeAiDropdownMenu.js +10 -2
- package/dist/ForgeAiDropdownMenuItem.d.ts +15 -16
- 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/ForgeAiFab.d.ts +15 -16
- package/dist/ForgeAiFilePicker.d.ts +32 -20
- 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/ForgeAiMessageThread.d.ts +87 -0
- package/dist/ForgeAiMessageThread.js +55 -0
- package/dist/ForgeAiModal.d.ts +19 -16
- package/dist/ForgeAiOverlay.d.ts +23 -16
- package/dist/ForgeAiOverlay.js +12 -1
- package/dist/ForgeAiPopover.d.ts +23 -16
- package/dist/ForgeAiPopover.js +12 -1
- package/dist/ForgeAiPrompt.d.ts +15 -16
- 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 +43 -20
- package/dist/ForgeAiResponseMessage.js +21 -3
- package/dist/ForgeAiSidebar.d.ts +15 -16
- package/dist/ForgeAiSidebarChat.d.ts +18 -30
- package/dist/ForgeAiSpinner.d.ts +55 -0
- package/dist/ForgeAiSpinner.js +21 -0
- package/dist/ForgeAiSuggestions.d.ts +15 -16
- package/dist/ForgeAiThinkingIndicator.d.ts +15 -16
- 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/ForgeAiTooltip.d.ts +15 -16
- 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 +12 -4
- package/dist/index.js +12 -4
- package/package.json +30 -30
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiMessageThread as ForgeAiMessageThreadElement } from "@tylertech/forge-ai/ai-message-thread";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiMessageThreadElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiMessageThreadProps 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
|
+
enableReactions?: boolean;
|
|
23
|
+
|
|
24
|
+
/** undefined */
|
|
25
|
+
showThinking?: boolean;
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
autoScroll?: ForgeAiMessageThreadElement["autoScroll"];
|
|
29
|
+
|
|
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()`. */
|
|
31
|
+
className?: string;
|
|
32
|
+
|
|
33
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
34
|
+
exportparts?: string;
|
|
35
|
+
|
|
36
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
37
|
+
htmlFor?: string;
|
|
38
|
+
|
|
39
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
40
|
+
key?: number | string;
|
|
41
|
+
|
|
42
|
+
/** 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. */
|
|
43
|
+
part?: string;
|
|
44
|
+
|
|
45
|
+
/** 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. */
|
|
46
|
+
ref?: any;
|
|
47
|
+
|
|
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. */
|
|
49
|
+
tabIndex?: number;
|
|
50
|
+
|
|
51
|
+
/** Fired when user clicks copy on a message */
|
|
52
|
+
onForgeAiMessageThreadCopy?: (
|
|
53
|
+
event: CustomEvent<CustomEvent<ForgeAiMessageThreadCopyEventData>>,
|
|
54
|
+
) => void;
|
|
55
|
+
|
|
56
|
+
/** Fired when user clicks refresh on a message */
|
|
57
|
+
onForgeAiMessageThreadRefresh?: (
|
|
58
|
+
event: CustomEvent<CustomEvent<ForgeAiMessageThreadRefreshEventData>>,
|
|
59
|
+
) => void;
|
|
60
|
+
|
|
61
|
+
/** Fired when user gives thumbs up */
|
|
62
|
+
onForgeAiMessageThreadThumbsUp?: (
|
|
63
|
+
event: CustomEvent<CustomEvent<ForgeAiMessageThreadThumbsEventData>>,
|
|
64
|
+
) => void;
|
|
65
|
+
|
|
66
|
+
/** Fired when user gives thumbs down */
|
|
67
|
+
onForgeAiMessageThreadThumbsDown?: (
|
|
68
|
+
event: CustomEvent<CustomEvent<ForgeAiMessageThreadThumbsEventData>>,
|
|
69
|
+
) => void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A primitive component for rendering a thread of chat messages, including user, assistant, system, and tool call messages.
|
|
74
|
+
* ---
|
|
75
|
+
*
|
|
76
|
+
*
|
|
77
|
+
* ### **Events:**
|
|
78
|
+
* - **forge-ai-message-thread-copy** - Fired when user clicks copy on a message
|
|
79
|
+
* - **forge-ai-message-thread-refresh** - Fired when user clicks refresh on a message
|
|
80
|
+
* - **forge-ai-message-thread-thumbs-up** - Fired when user gives thumbs up
|
|
81
|
+
* - **forge-ai-message-thread-thumbs-down** - Fired when user gives thumbs down
|
|
82
|
+
*
|
|
83
|
+
* ### **Slots:**
|
|
84
|
+
* - **empty-state-heading** - Slot for custom empty state heading content
|
|
85
|
+
* - **empty-state-actions** - Slot for custom empty state actions (e.g., suggestions)
|
|
86
|
+
*/
|
|
87
|
+
export const ForgeAiMessageThread: React.ForwardRefExoticComponent<ForgeAiMessageThreadProps>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-message-thread";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiMessageThread = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { enableReactions, showThinking, autoScroll, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(
|
|
11
|
+
ref,
|
|
12
|
+
"forge-ai-message-thread-copy",
|
|
13
|
+
props.onForgeAiMessageThreadCopy,
|
|
14
|
+
);
|
|
15
|
+
useEventListener(
|
|
16
|
+
ref,
|
|
17
|
+
"forge-ai-message-thread-refresh",
|
|
18
|
+
props.onForgeAiMessageThreadRefresh,
|
|
19
|
+
);
|
|
20
|
+
useEventListener(
|
|
21
|
+
ref,
|
|
22
|
+
"forge-ai-message-thread-thumbs-up",
|
|
23
|
+
props.onForgeAiMessageThreadThumbsUp,
|
|
24
|
+
);
|
|
25
|
+
useEventListener(
|
|
26
|
+
ref,
|
|
27
|
+
"forge-ai-message-thread-thumbs-down",
|
|
28
|
+
props.onForgeAiMessageThreadThumbsDown,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return React.createElement(
|
|
32
|
+
"forge-ai-message-thread",
|
|
33
|
+
{
|
|
34
|
+
ref: (node) => {
|
|
35
|
+
ref.current = node;
|
|
36
|
+
if (typeof forwardedRef === "function") {
|
|
37
|
+
forwardedRef(node);
|
|
38
|
+
} else if (forwardedRef) {
|
|
39
|
+
forwardedRef.current = node;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
...filteredProps,
|
|
43
|
+
"auto-scroll": props.autoScroll || props["auto-scroll"],
|
|
44
|
+
class: props.className,
|
|
45
|
+
exportparts: props.exportparts,
|
|
46
|
+
for: props.htmlFor,
|
|
47
|
+
part: props.part,
|
|
48
|
+
tabindex: props.tabIndex,
|
|
49
|
+
"enable-reactions": props.enableReactions ? true : undefined,
|
|
50
|
+
"show-thinking": props.showThinking ? true : undefined,
|
|
51
|
+
style: { ...props.style },
|
|
52
|
+
},
|
|
53
|
+
props.children,
|
|
54
|
+
);
|
|
55
|
+
});
|
package/dist/ForgeAiModal.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiModal as ForgeAiModalElement } from "@tylertech/forge-ai/ai-moda
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiModalElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiModalProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiModalProps 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
|
/** Controls whether the modal is open or closed. */
|
|
23
22
|
open?: boolean;
|
|
24
23
|
|
|
@@ -75,5 +74,9 @@ When not explicitly set, this will be automatically determined based on viewport
|
|
|
75
74
|
*
|
|
76
75
|
* ### **Slots:**
|
|
77
76
|
* - _default_ - Default slot for modal content
|
|
77
|
+
*
|
|
78
|
+
* ### **CSS Properties:**
|
|
79
|
+
* - **--forge-ai-modal-width** - Width of the modal in non-fullscreen mode _(default: undefined)_
|
|
80
|
+
* - **--forge-ai-modal-height** - Height of the modal in non-fullscreen mode _(default: undefined)_
|
|
78
81
|
*/
|
|
79
82
|
export const ForgeAiModal: React.ForwardRefExoticComponent<ForgeAiModalProps>;
|
package/dist/ForgeAiOverlay.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiOverlay as ForgeAiOverlayElement } from "@tylertech/forge-ai/cor
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiOverlayElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiOverlayProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiOverlayProps 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 overlay should flip to the opposite side when there's no space. */
|
|
23
22
|
flip?: boolean;
|
|
24
23
|
|
|
@@ -34,6 +33,14 @@ export interface ForgeAiOverlayProps
|
|
|
34
33
|
/** The placement of the overlay relative to the anchor. */
|
|
35
34
|
placement?: ForgeAiOverlayElement["placement"];
|
|
36
35
|
|
|
36
|
+
/** The arrow element to position relative to the overlay. */
|
|
37
|
+
arrowElement?: ForgeAiOverlayElement["arrowElement"];
|
|
38
|
+
|
|
39
|
+
/** The dismiss mode for the overlay.
|
|
40
|
+
- 'auto': Automatically closes on outside clicks and Escape key
|
|
41
|
+
- 'manual': Requires manual control to close */
|
|
42
|
+
dismissMode?: ForgeAiOverlayElement["dismissMode"];
|
|
43
|
+
|
|
37
44
|
/** 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()`. */
|
|
38
45
|
className?: string;
|
|
39
46
|
|
package/dist/ForgeAiOverlay.js
CHANGED
|
@@ -2,7 +2,16 @@ import React, { forwardRef } from "react";
|
|
|
2
2
|
import "@tylertech/forge-ai/core/overlay";
|
|
3
3
|
|
|
4
4
|
export const ForgeAiOverlay = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
flip,
|
|
7
|
+
shift,
|
|
8
|
+
open,
|
|
9
|
+
anchor,
|
|
10
|
+
placement,
|
|
11
|
+
arrowElement,
|
|
12
|
+
dismissMode,
|
|
13
|
+
...filteredProps
|
|
14
|
+
} = props;
|
|
6
15
|
|
|
7
16
|
return React.createElement(
|
|
8
17
|
"forge-ai-overlay",
|
|
@@ -10,6 +19,8 @@ export const ForgeAiOverlay = forwardRef((props, forwardedRef) => {
|
|
|
10
19
|
...filteredProps,
|
|
11
20
|
anchor: props.anchor,
|
|
12
21
|
placement: props.placement,
|
|
22
|
+
arrowElement: props.arrowElement,
|
|
23
|
+
"dismiss-mode": props.dismissMode || props["dismiss-mode"],
|
|
13
24
|
class: props.className,
|
|
14
25
|
exportparts: props.exportparts,
|
|
15
26
|
for: props.htmlFor,
|
package/dist/ForgeAiPopover.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiPopover as ForgeAiPopoverElement } from "@tylertech/forge-ai/cor
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiPopoverElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiPopoverProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiPopoverProps 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 popover should flip to the opposite side when there's no space. */
|
|
23
22
|
flip?: boolean;
|
|
24
23
|
|
|
@@ -28,12 +27,20 @@ export interface ForgeAiPopoverProps
|
|
|
28
27
|
/** Whether the popover is open. */
|
|
29
28
|
open?: boolean;
|
|
30
29
|
|
|
30
|
+
/** Whether to show an arrow pointing to the anchor element. */
|
|
31
|
+
arrow?: boolean;
|
|
32
|
+
|
|
31
33
|
/** The anchor element to position the popover relative to. */
|
|
32
34
|
anchor?: ForgeAiPopoverElement["anchor"];
|
|
33
35
|
|
|
34
36
|
/** The placement of the popover relative to the anchor. */
|
|
35
37
|
placement?: ForgeAiPopoverElement["placement"];
|
|
36
38
|
|
|
39
|
+
/** The dismiss mode for the popover.
|
|
40
|
+
- 'auto': Automatically closes on outside clicks and Escape key
|
|
41
|
+
- 'manual': Requires manual control to close */
|
|
42
|
+
dismissMode?: ForgeAiPopoverElement["dismissMode"];
|
|
43
|
+
|
|
37
44
|
/** 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()`. */
|
|
38
45
|
className?: string;
|
|
39
46
|
|
package/dist/ForgeAiPopover.js
CHANGED
|
@@ -2,7 +2,16 @@ import React, { forwardRef } from "react";
|
|
|
2
2
|
import "@tylertech/forge-ai/core/popover";
|
|
3
3
|
|
|
4
4
|
export const ForgeAiPopover = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
flip,
|
|
7
|
+
shift,
|
|
8
|
+
open,
|
|
9
|
+
arrow,
|
|
10
|
+
anchor,
|
|
11
|
+
placement,
|
|
12
|
+
dismissMode,
|
|
13
|
+
...filteredProps
|
|
14
|
+
} = props;
|
|
6
15
|
|
|
7
16
|
return React.createElement(
|
|
8
17
|
"forge-ai-popover",
|
|
@@ -10,6 +19,7 @@ export const ForgeAiPopover = forwardRef((props, forwardedRef) => {
|
|
|
10
19
|
...filteredProps,
|
|
11
20
|
anchor: props.anchor,
|
|
12
21
|
placement: props.placement,
|
|
22
|
+
"dismiss-mode": props.dismissMode || props["dismiss-mode"],
|
|
13
23
|
class: props.className,
|
|
14
24
|
exportparts: props.exportparts,
|
|
15
25
|
for: props.htmlFor,
|
|
@@ -18,6 +28,7 @@ export const ForgeAiPopover = forwardRef((props, forwardedRef) => {
|
|
|
18
28
|
flip: props.flip ? true : undefined,
|
|
19
29
|
shift: props.shift ? true : undefined,
|
|
20
30
|
open: props.open ? true : undefined,
|
|
31
|
+
arrow: props.arrow ? true : undefined,
|
|
21
32
|
style: { ...props.style },
|
|
22
33
|
},
|
|
23
34
|
props.children,
|
package/dist/ForgeAiPrompt.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiPrompt as ForgeAiPromptElement } from "@tylertech/forge-ai/ai-pr
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiPromptElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiPromptProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiPromptProps 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 send button is disabled */
|
|
23
22
|
sendDisabled?: boolean;
|
|
24
23
|
|
|
@@ -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,27 @@ 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
|
+
|
|
22
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()`. */
|
|
23
28
|
className?: string;
|
|
24
29
|
|
|
@@ -40,9 +45,24 @@ export interface ForgeAiResponseMessageProps
|
|
|
40
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. */
|
|
41
46
|
tabIndex?: number;
|
|
42
47
|
|
|
43
|
-
/** Fired when
|
|
44
|
-
|
|
45
|
-
event: CustomEvent<CustomEvent<
|
|
48
|
+
/** Fired when copy action is clicked. */
|
|
49
|
+
onForgeAiResponseMessageCopy?: (
|
|
50
|
+
event: CustomEvent<CustomEvent<void>>,
|
|
51
|
+
) => void;
|
|
52
|
+
|
|
53
|
+
/** Fired when refresh action is clicked. */
|
|
54
|
+
onForgeAiResponseMessageRefresh?: (
|
|
55
|
+
event: CustomEvent<CustomEvent<void>>,
|
|
56
|
+
) => void;
|
|
57
|
+
|
|
58
|
+
/** Fired when thumbs-up action is clicked. */
|
|
59
|
+
onForgeAiResponseMessageThumbsUp?: (
|
|
60
|
+
event: CustomEvent<CustomEvent<void>>,
|
|
61
|
+
) => void;
|
|
62
|
+
|
|
63
|
+
/** Fired when thumbs-down action is clicked. */
|
|
64
|
+
onForgeAiResponseMessageThumbsDown?: (
|
|
65
|
+
event: CustomEvent<CustomEvent<void>>,
|
|
46
66
|
) => void;
|
|
47
67
|
}
|
|
48
68
|
|
|
@@ -52,6 +72,9 @@ export interface ForgeAiResponseMessageProps
|
|
|
52
72
|
*
|
|
53
73
|
*
|
|
54
74
|
* ### **Events:**
|
|
55
|
-
* - **forge-ai-response-message-
|
|
75
|
+
* - **forge-ai-response-message-copy** - Fired when copy action is clicked.
|
|
76
|
+
* - **forge-ai-response-message-refresh** - Fired when refresh action is clicked.
|
|
77
|
+
* - **forge-ai-response-message-thumbs-up** - Fired when thumbs-up action is clicked.
|
|
78
|
+
* - **forge-ai-response-message-thumbs-down** - Fired when thumbs-down action is clicked.
|
|
56
79
|
*/
|
|
57
80
|
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, ...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,14 @@ 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,
|
|
32
50
|
style: { ...props.style },
|
|
33
51
|
},
|
|
34
52
|
props.children,
|