@tylertech/forge-ai-react 0.6.0 → 0.7.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.
@@ -0,0 +1,80 @@
1
+ import React from "react";
2
+ import { ForgeAiAssistantResponse as ForgeAiAssistantResponseElement } from "@tylertech/forge-ai/ai-assistant-response";
3
+
4
+ export type { ForgeAiAssistantResponseElement };
5
+
6
+ export interface ForgeAiAssistantResponseProps 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
+ debugMode?: boolean;
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 copy action is clicked */
49
+ onForgeAiAssistantResponseCopy?: (
50
+ event: CustomEvent<CustomEvent<{ responseId: string }>>,
51
+ ) => void;
52
+
53
+ /** Fired when refresh action is clicked */
54
+ onForgeAiAssistantResponseRefresh?: (
55
+ event: CustomEvent<CustomEvent<{ responseId: string }>>,
56
+ ) => void;
57
+
58
+ /** Fired when thumbs up is clicked */
59
+ onForgeAiAssistantResponseThumbsUp?: (
60
+ event: CustomEvent<CustomEvent<{ responseId: string }>>,
61
+ ) => void;
62
+
63
+ /** Fired when thumbs down is clicked */
64
+ onForgeAiAssistantResponseThumbsDown?: (
65
+ event: CustomEvent<CustomEvent<{ responseId: string }>>,
66
+ ) => void;
67
+ }
68
+
69
+ /**
70
+ * Renders a complete assistant response with interleaved text chunks and tool calls.
71
+ * ---
72
+ *
73
+ *
74
+ * ### **Events:**
75
+ * - **forge-ai-assistant-response-copy** - Fired when copy action is clicked
76
+ * - **forge-ai-assistant-response-refresh** - Fired when refresh action is clicked
77
+ * - **forge-ai-assistant-response-thumbs-up** - Fired when thumbs up is clicked
78
+ * - **forge-ai-assistant-response-thumbs-down** - Fired when thumbs down is clicked
79
+ */
80
+ export const ForgeAiAssistantResponse: React.ForwardRefExoticComponent<ForgeAiAssistantResponseProps>;
@@ -0,0 +1,54 @@
1
+ import React, { forwardRef, useRef, useEffect } from "react";
2
+ import "@tylertech/forge-ai/ai-assistant-response";
3
+ import { useEventListener } from "./react-utils.js";
4
+
5
+ export const ForgeAiAssistantResponse = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const { enableReactions, debugMode, ...filteredProps } = props;
8
+
9
+ /** Event listeners - run once */
10
+ useEventListener(
11
+ ref,
12
+ "forge-ai-assistant-response-copy",
13
+ props.onForgeAiAssistantResponseCopy,
14
+ );
15
+ useEventListener(
16
+ ref,
17
+ "forge-ai-assistant-response-refresh",
18
+ props.onForgeAiAssistantResponseRefresh,
19
+ );
20
+ useEventListener(
21
+ ref,
22
+ "forge-ai-assistant-response-thumbs-up",
23
+ props.onForgeAiAssistantResponseThumbsUp,
24
+ );
25
+ useEventListener(
26
+ ref,
27
+ "forge-ai-assistant-response-thumbs-down",
28
+ props.onForgeAiAssistantResponseThumbsDown,
29
+ );
30
+
31
+ return React.createElement(
32
+ "forge-ai-assistant-response",
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
+ class: props.className,
44
+ exportparts: props.exportparts,
45
+ for: props.htmlFor,
46
+ part: props.part,
47
+ tabindex: props.tabIndex,
48
+ "enable-reactions": props.enableReactions ? true : undefined,
49
+ "debug-mode": props.debugMode ? true : undefined,
50
+ style: { ...props.style },
51
+ },
52
+ props.children,
53
+ );
54
+ });
@@ -39,6 +39,9 @@ export interface ForgeAiChatbotProps extends Pick<
39
39
  /** undefined */
40
40
  voiceInput?: ForgeAiChatbotElement["voiceInput"];
41
41
 
42
+ /** undefined */
43
+ debugCommand?: ForgeAiChatbotElement["debugCommand"];
44
+
42
45
  /** undefined */
43
46
  placeholder?: ForgeAiChatbotElement["placeholder"];
44
47
 
@@ -51,6 +54,9 @@ export interface ForgeAiChatbotProps extends Pick<
51
54
  /** Controls the heading level for the title content (default: 2) */
52
55
  headingLevel?: ForgeAiChatbotElement["headingLevel"];
53
56
 
57
+ /** The disclaimer text to display below the prompt. Set to empty string, null, or undefined to hide. */
58
+ disclaimerText?: ForgeAiChatbotElement["disclaimerText"];
59
+
54
60
  /** 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()`. */
55
61
  className?: string;
56
62
 
@@ -12,10 +12,12 @@ export const ForgeAiChatbot = forwardRef((props, forwardedRef) => {
12
12
  debugMode,
13
13
  fileUpload,
14
14
  voiceInput,
15
+ debugCommand,
15
16
  placeholder,
16
17
  minimizeIcon,
17
18
  titleText,
18
19
  headingLevel,
20
+ disclaimerText,
19
21
  ...filteredProps
20
22
  } = props;
21
23
 
@@ -73,10 +75,12 @@ export const ForgeAiChatbot = forwardRef((props, forwardedRef) => {
73
75
  ...filteredProps,
74
76
  "file-upload": props.fileUpload || props["file-upload"],
75
77
  "voice-input": props.voiceInput || props["voice-input"],
78
+ "debug-command": props.debugCommand || props["debug-command"],
76
79
  placeholder: props.placeholder,
77
80
  "minimize-icon": props.minimizeIcon || props["minimize-icon"],
78
81
  "title-text": props.titleText || props["title-text"],
79
82
  "heading-level": props.headingLevel || props["heading-level"],
83
+ "disclaimer-text": props.disclaimerText || props["disclaimer-text"],
80
84
  class: props.className,
81
85
  exportparts: props.exportparts,
82
86
  for: props.htmlFor,
@@ -18,15 +18,6 @@ export interface ForgeAiResponseMessageProps extends Pick<
18
18
  | "onFocus"
19
19
  | "onBlur"
20
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
-
30
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()`. */
31
22
  className?: string;
32
23
 
@@ -47,37 +38,11 @@ export interface ForgeAiResponseMessageProps extends Pick<
47
38
 
48
39
  /** 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
40
  tabIndex?: number;
50
-
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>>,
69
- ) => void;
70
41
  }
71
42
 
72
43
  /**
73
- *
44
+ * A simple wrapper component for rendering assistant response message content.
74
45
  * ---
75
46
  *
76
- *
77
- * ### **Events:**
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.
82
47
  */
83
48
  export const ForgeAiResponseMessage: React.ForwardRefExoticComponent<ForgeAiResponseMessageProps>;
@@ -1,53 +1,16 @@
1
- import React, { forwardRef, useRef, useEffect } from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import "@tylertech/forge-ai/ai-response-message";
3
- import { useEventListener } from "./react-utils.js";
4
3
 
5
4
  export const ForgeAiResponseMessage = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const { complete, enableReactions, hasDebugData, ...filteredProps } = props;
8
-
9
- /** Event listeners - run once */
10
- useEventListener(
11
- ref,
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,
29
- );
30
-
31
5
  return React.createElement(
32
6
  "forge-ai-response-message",
33
7
  {
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,
8
+ ...props,
43
9
  class: props.className,
44
10
  exportparts: props.exportparts,
45
11
  for: props.htmlFor,
46
12
  part: props.part,
47
13
  tabindex: props.tabIndex,
48
- complete: props.complete ? true : undefined,
49
- "enable-reactions": props.enableReactions ? true : undefined,
50
- "has-debug-data": props.hasDebugData ? true : undefined,
51
14
  style: { ...props.style },
52
15
  },
53
16
  props.children,
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  export * from "./ForgeAiActionsToolbar.js";
2
- export * from "./ForgeAiAgentInfo.js";
3
2
  export * from "./ForgeAiArtifact.js";
4
- export * from "./ForgeAiAttachment.js";
5
- export * from "./ForgeAiChainOfThought.js";
3
+ export * from "./ForgeAiAgentInfo.js";
6
4
  export * from "./ForgeAiButton.js";
5
+ export * from "./ForgeAiAttachment.js";
7
6
  export * from "./ForgeAiChatHeader.js";
7
+ export * from "./ForgeAiAssistantResponse.js";
8
+ export * from "./ForgeAiChainOfThought.js";
8
9
  export * from "./ForgeAiChatInterface.js";
9
10
  export * from "./ForgeAiChatbotToolCall.js";
10
11
  export * from "./ForgeAiChatbot.js";
@@ -28,25 +29,25 @@ export * from "./ForgeAiMessageThread.js";
28
29
  export * from "./ForgeAiModal.js";
29
30
  export * from "./ForgeAiPrompt.js";
30
31
  export * from "./ForgeAiReasoning.js";
31
- export * from "./ForgeAiResponseMessage.js";
32
- export * from "./ForgeAiSlashCommandMenu.js";
33
32
  export * from "./ForgeAiReasoningHeader.js";
33
+ export * from "./ForgeAiResponseMessage.js";
34
34
  export * from "./ForgeAiSidebar.js";
35
- export * from "./ForgeAiSpinner.js";
36
35
  export * from "./ForgeAiSidebarChat.js";
36
+ export * from "./ForgeAiSpinner.js";
37
+ export * from "./ForgeAiSlashCommandMenu.js";
37
38
  export * from "./ForgeAiSuggestions.js";
38
- export * from "./ForgeAiThinkingIndicator.js";
39
39
  export * from "./ForgeAiThreads.js";
40
+ export * from "./ForgeAiThinkingIndicator.js";
40
41
  export * from "./ForgeAiUserMessage.js";
41
42
  export * from "./ForgeAiVoiceInput.js";
42
- export * from "./ForgeAiThoughtDetail.js";
43
43
  export * from "./ForgeAiThoughtBase.js";
44
+ export * from "./ForgeAiThoughtDetail.js";
44
45
  export * from "./ForgeAiThoughtImage.js";
45
46
  export * from "./ForgeAiThoughtSearchResult.js";
46
- export * from "./ForgeAiReasoningContent.js";
47
47
  export * from "./ForgePromptButton.js";
48
- export * from "./ForgeAiPopover.js";
48
+ export * from "./ForgeAiReasoningContent.js";
49
49
  export * from "./ForgeAiOverlay.js";
50
- export * from "./ForgeAiTooltip.js";
50
+ export * from "./ForgeAiPopover.js";
51
51
  export * from "./ForgeAiToolDataTable.js";
52
+ export * from "./ForgeAiTooltip.js";
52
53
  export * from "./ForgeAiPaginator.js";
package/dist/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  export * from "./ForgeAiActionsToolbar.js";
2
- export * from "./ForgeAiAgentInfo.js";
3
2
  export * from "./ForgeAiArtifact.js";
4
- export * from "./ForgeAiAttachment.js";
5
- export * from "./ForgeAiChainOfThought.js";
3
+ export * from "./ForgeAiAgentInfo.js";
6
4
  export * from "./ForgeAiButton.js";
5
+ export * from "./ForgeAiAttachment.js";
7
6
  export * from "./ForgeAiChatHeader.js";
7
+ export * from "./ForgeAiAssistantResponse.js";
8
+ export * from "./ForgeAiChainOfThought.js";
8
9
  export * from "./ForgeAiChatInterface.js";
9
10
  export * from "./ForgeAiChatbotToolCall.js";
10
11
  export * from "./ForgeAiChatbot.js";
@@ -28,25 +29,25 @@ export * from "./ForgeAiMessageThread.js";
28
29
  export * from "./ForgeAiModal.js";
29
30
  export * from "./ForgeAiPrompt.js";
30
31
  export * from "./ForgeAiReasoning.js";
31
- export * from "./ForgeAiResponseMessage.js";
32
- export * from "./ForgeAiSlashCommandMenu.js";
33
32
  export * from "./ForgeAiReasoningHeader.js";
33
+ export * from "./ForgeAiResponseMessage.js";
34
34
  export * from "./ForgeAiSidebar.js";
35
- export * from "./ForgeAiSpinner.js";
36
35
  export * from "./ForgeAiSidebarChat.js";
36
+ export * from "./ForgeAiSpinner.js";
37
+ export * from "./ForgeAiSlashCommandMenu.js";
37
38
  export * from "./ForgeAiSuggestions.js";
38
- export * from "./ForgeAiThinkingIndicator.js";
39
39
  export * from "./ForgeAiThreads.js";
40
+ export * from "./ForgeAiThinkingIndicator.js";
40
41
  export * from "./ForgeAiUserMessage.js";
41
42
  export * from "./ForgeAiVoiceInput.js";
42
- export * from "./ForgeAiThoughtDetail.js";
43
43
  export * from "./ForgeAiThoughtBase.js";
44
+ export * from "./ForgeAiThoughtDetail.js";
44
45
  export * from "./ForgeAiThoughtImage.js";
45
46
  export * from "./ForgeAiThoughtSearchResult.js";
46
- export * from "./ForgeAiReasoningContent.js";
47
47
  export * from "./ForgePromptButton.js";
48
- export * from "./ForgeAiPopover.js";
48
+ export * from "./ForgeAiReasoningContent.js";
49
49
  export * from "./ForgeAiOverlay.js";
50
- export * from "./ForgeAiTooltip.js";
50
+ export * from "./ForgeAiPopover.js";
51
51
  export * from "./ForgeAiToolDataTable.js";
52
+ export * from "./ForgeAiTooltip.js";
52
53
  export * from "./ForgeAiPaginator.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tylertech/forge-ai-react",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "A React adapter for Tyler Forge™ AI Web Components.",
5
5
  "repository": "tyler-technologies-oss/forge-ai",
6
6
  "author": "Tyler Technologies, Inc.",
@@ -11,34 +11,20 @@
11
11
  "files": [
12
12
  "dist"
13
13
  ],
14
- "scripts": {
15
- "predev": "pnpm run build",
16
- "dev": "vite",
17
- "build:demo": "vite build",
18
- "serve:demo": "vite preview",
19
- "clean": "rimraf dist/",
20
- "prebuild": "pnpm run clean",
21
- "build": "pnpm run generate-proxies",
22
- "lint": "eslint .",
23
- "format": "prettier --write .",
24
- "format:check": "prettier --check .",
25
- "generate-proxies": "node scripts/generate-proxies.mjs"
26
- },
27
14
  "dependencies": {
28
- "tslib": "catalog:"
15
+ "tslib": "2.8.1"
29
16
  },
30
17
  "peerDependencies": {
31
- "@tylertech/forge-ai": "workspace:^",
32
- "react": ">=17.0.0"
18
+ "react": ">=17.0.0",
19
+ "@tylertech/forge-ai": "^0.7.0"
33
20
  },
34
21
  "devDependencies": {
35
- "@repo/prettier-config": "workspace:",
36
- "@tylertech-eslint/eslint-plugin": "catalog:",
37
- "@tylertech/forge": "catalog:",
38
- "@tylertech/forge-ai": "workspace:^",
22
+ "@repo/prettier-config": "",
23
+ "@tylertech-eslint/eslint-plugin": "3.0.0",
24
+ "@tylertech/forge": "3.13.1",
39
25
  "@tylertech/forge-react": "^3.2.0",
40
- "@tylertech/tyler-icons": "catalog:",
41
- "@types/node": "catalog:",
26
+ "@tylertech/tyler-icons": "2.0.4",
27
+ "@types/node": "25.0.3",
42
28
  "@types/react": "^18.3.27",
43
29
  "@types/react-dom": "^18.3.7",
44
30
  "@types/react-router": "^5.1.20",
@@ -46,17 +32,31 @@
46
32
  "@vitejs/plugin-react": "^4.7.0",
47
33
  "change-case": "^5.4.4",
48
34
  "custom-element-react-wrappers": "^1.7.3",
49
- "eslint": "catalog:",
50
- "eslint-plugin-prettier": "catalog:",
35
+ "eslint": "9.39.2",
36
+ "eslint-plugin-prettier": "5.5.4",
51
37
  "react": "^17.0.2",
52
38
  "react-dom": "^17.0.2",
53
39
  "react-error-overlay": "^6.1.0",
54
40
  "react-router": "^5.3.4",
55
41
  "react-router-dom": "^5.3.4",
56
- "rimraf": "catalog:",
57
- "sass": "catalog:",
42
+ "rimraf": "6.1.2",
43
+ "sass": "1.93.3",
58
44
  "typescript": "~5.8.3",
59
- "vite": "catalog:",
60
- "vite-tsconfig-paths": "catalog:"
45
+ "vite": "7.3.0",
46
+ "vite-tsconfig-paths": "6.0.3",
47
+ "@tylertech/forge-ai": "^0.7.0"
48
+ },
49
+ "scripts": {
50
+ "predev": "pnpm run build",
51
+ "dev": "vite",
52
+ "build:demo": "vite build",
53
+ "serve:demo": "vite preview",
54
+ "clean": "rimraf dist/",
55
+ "prebuild": "pnpm run clean",
56
+ "build": "pnpm run generate-proxies",
57
+ "lint": "eslint .",
58
+ "format": "prettier --write .",
59
+ "format:check": "prettier --check .",
60
+ "generate-proxies": "node scripts/generate-proxies.mjs"
61
61
  }
62
- }
62
+ }