ordify-chat-widget 1.1.1 → 1.1.2
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/CHANGELOG.md +16 -0
- package/README.md +8 -0
- package/dist/components/AssistantMessageContent.d.ts +13 -0
- package/dist/components/AssistantMessageContent.d.ts.map +1 -0
- package/dist/components/Conversation.d.ts +3 -1
- package/dist/components/Conversation.d.ts.map +1 -1
- package/dist/components/EmbeddedChat.d.ts.map +1 -1
- package/dist/components/FloatingChat.d.ts.map +1 -1
- package/dist/components/InlineChat.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer.d.ts.map +1 -1
- package/dist/components/styled/ChatComponents.d.ts.map +1 -1
- package/dist/hooks/useOrdifyChat.d.ts.map +1 -1
- package/dist/hooks/useOrdifyConfig.d.ts +5 -0
- package/dist/hooks/useOrdifyConfig.d.ts.map +1 -1
- package/dist/index.cjs.js +154 -110
- package/dist/index.esm.js +1031 -892
- package/dist/ordify-chat-widget.standalone.js +154 -110
- package/dist/ordify-chat-widget.standalone.js.map +1 -1
- package/dist/standalone.d.ts.map +1 -1
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/api.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Generated images in the widget**: ADK `image` SSE events are no longer dropped during streaming (they appear as markdown images in the assistant bubble). Assistant messages with image **attachments** from history now render inline images plus non-image attachment chips.
|
|
12
|
+
- **Empty assistant bubbles on tool-heavy turns**: SSE `adk_tool` events with a `content` string are now folded into the streamed assistant text so status lines (e.g. tool progress) still appear when the model does not emit a separate text chunk.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **`enableImageGeneration` on `OrdifyConfig`**: for publishable-key chat, the widget sends **`enable_image_generation: true` or `false`** on every request. The API allows the image tool only when **`true`**. Standalone: `data-ordify-enable-image-generation="true"` / `"false"`.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- **Breaking (publishable keys):** image generation is not configured on publishable keys; use the embed **`enableImageGeneration`** / **`enable_image_generation`** flag only.
|
|
19
|
+
- **Widget image generation:** When `enable_image_generation` is false, the API does not attach the real `generate_image` tool; a stub tool with the same name returns user-facing guidance if the model still calls it. When true, the real tool is attached.
|
|
20
|
+
|
|
21
|
+
### Notes
|
|
22
|
+
- **Backend**: `POST /widget/chat/...` sets **`use_image_generation_tool`** and **`enable_image_generation`** from the embed flag (default off). The real image tool is omitted when off; a stub answers with guidance text. **`POST /images/generate`** remains blocked for widget keys.
|
|
23
|
+
|
|
8
24
|
## [1.0.45] - 2026-05-04
|
|
9
25
|
|
|
10
26
|
### Added
|
package/README.md
CHANGED
|
@@ -170,6 +170,8 @@ Add a single script tag with `data-ordify-widget` and the required/optional data
|
|
|
170
170
|
| `data-ordify-welcome-image` | URL for welcome screen image. |
|
|
171
171
|
| `data-ordify-quick-questions` | JSON array of strings, or comma-separated list (e.g. `["Question 1","Question 2"]` or `Question 1, Question 2`). |
|
|
172
172
|
| `data-ordify-container-id` | ID of the element to mount into; if omitted, mounts to `document.body`. |
|
|
173
|
+
| `data-ordify-use-thinking` | `true` / `1` to enable thinking path (`use_thinking` on chat requests). |
|
|
174
|
+
| `data-ordify-enable-image-generation` | `true` / `1` sends `enable_image_generation: true` on widget chat. Any other value or omitting the attribute sends **`false`** (images off). |
|
|
173
175
|
|
|
174
176
|
### WordPress and Local WP
|
|
175
177
|
|
|
@@ -246,6 +248,12 @@ So the “config” is the snippet or script tag you paste; the credentials are
|
|
|
246
248
|
| `quickQuestions` | string[] | - | **Optional** - Array of quick action questions displayed as buttons in welcome screen |
|
|
247
249
|
| `welcomeMessage` | string | "Hi there 👋 How can we help?" | **Optional** - Custom greeting message shown in welcome screen when quickQuestions are provided |
|
|
248
250
|
| `welcomeImage` | string | - | **Optional** - URL to image/graphic displayed in welcome screen |
|
|
251
|
+
| `useThinking` | boolean | `false` | **Optional** - When `true`, sends `use_thinking: true` on chat requests (thinking model path). |
|
|
252
|
+
| `enableAttachments` | boolean | `false` | **Optional** - File attachments (requires `publishableKey`). |
|
|
253
|
+
| `maxAttachmentSizeMB` | number | `10` | **Optional** - Client-side max attachment size. |
|
|
254
|
+
| `maxAttachments` | number | `3` | **Optional** - Max attachments per message. |
|
|
255
|
+
| `allowedAttachmentTypes` | string[] | (widget defaults) | **Optional** - Client MIME allow list. |
|
|
256
|
+
| `enableImageGeneration` | boolean | `false` (sent on each request) | Publishable key only: **`true`** sends `enable_image_generation: true` so the image tool may run; otherwise the widget sends **`false`**. |
|
|
249
257
|
|
|
250
258
|
## 🎯 Advanced Features
|
|
251
259
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Message } from '../types';
|
|
2
|
+
|
|
3
|
+
interface AssistantMessageContentProps {
|
|
4
|
+
message: Message;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Renders assistant text (markdown) plus inline images from stored session attachments.
|
|
9
|
+
* Live streams also inject `` via SSE `type: "image"` handling in `parseStreamingResponse`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function AssistantMessageContent({ message, className }: AssistantMessageContentProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=AssistantMessageContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssistantMessageContent.d.ts","sourceRoot":"","sources":["../../src/components/AssistantMessageContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAIjC,UAAU,4BAA4B;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,4BAA4B,2CA2B3F"}
|
|
@@ -4,6 +4,8 @@ interface ConversationProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
|
+
/** Match ChatWidget / ChatWindow `data-theme` so the scroll area is never transparent on colored host pages */
|
|
8
|
+
surfaceTheme?: 'light' | 'dark';
|
|
7
9
|
onDragOver?: React.DragEventHandler<HTMLDivElement>;
|
|
8
10
|
onDragLeave?: React.DragEventHandler<HTMLDivElement>;
|
|
9
11
|
onDrop?: React.DragEventHandler<HTMLDivElement>;
|
|
@@ -15,7 +17,7 @@ interface ConversationContentProps {
|
|
|
15
17
|
interface ConversationScrollButtonProps {
|
|
16
18
|
className?: string;
|
|
17
19
|
}
|
|
18
|
-
export declare function Conversation({ className, children, style, onDragOver, onDragLeave, onDrop }: ConversationProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function Conversation({ className, children, style, surfaceTheme, onDragOver, onDragLeave, onDrop }: ConversationProps): import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
export declare function ConversationContent({ className, children }: ConversationContentProps): import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
export declare function ConversationScrollButton({ className }: ConversationScrollButtonProps): false | import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Conversation.d.ts","sourceRoot":"","sources":["../../src/components/Conversation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,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ACX,MAAM,EACP,EAAE,iBAAiB,2CAiBnB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,wBAAwB,2CAMpF;AAED,wBAAgB,wBAAwB,CAAC,EAAE,SAAS,EAAE,EAAE,6BAA6B,mDAkBpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbeddedChat.d.ts","sourceRoot":"","sources":["../../src/components/EmbeddedChat.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAkB3D,UAAU,iBAAiB;IACzB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,mBAAmB,CAAA;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"EmbeddedChat.d.ts","sourceRoot":"","sources":["../../src/components/EmbeddedChat.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAkB3D,UAAU,iBAAiB;IACzB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,mBAAmB,CAAA;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,iBAAiB,2CA0Q/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingChat.d.ts","sourceRoot":"","sources":["../../src/components/FloatingChat.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAqB3D,UAAU,iBAAiB;IACzB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,mBAAmB,CAAA;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"FloatingChat.d.ts","sourceRoot":"","sources":["../../src/components/FloatingChat.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAqB3D,UAAU,iBAAiB;IACzB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,mBAAmB,CAAA;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,iBAAiB,2CA6S/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineChat.d.ts","sourceRoot":"","sources":["../../src/components/InlineChat.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAiB3D,UAAU,eAAe;IACvB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,mBAAmB,CAAA;CAC1B;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"InlineChat.d.ts","sourceRoot":"","sources":["../../src/components/InlineChat.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAiB3D,UAAU,eAAe;IACvB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,mBAAmB,CAAA;CAC1B;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,eAAe,2CAkM3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownRenderer.tsx"],"names":[],"mappings":"AA2CA,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownRenderer.tsx"],"names":[],"mappings":"AA2CA,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,qBAAqB,2CA2L7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComponents.d.ts","sourceRoot":"","sources":["../../../src/components/styled/ChatComponents.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"ChatComponents.d.ts","sourceRoot":"","sources":["../../../src/components/styled/ChatComponents.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,6NA8CtB,CAAA;AAGD,eAAO,MAAM,WAAW;aAAyB,OAAO;YAmDvD,CAAA;AAED,eAAO,MAAM,aAAa,6NAiCzB,CAAA;AAED,eAAO,MAAM,eAAe,6NAmB3B,CAAA;AAED,eAAO,MAAM,kBAAkB,+OA6C9B,CAAA;AAGD,eAAO,MAAM,SAAS,6NAiBrB,CAAA;AAGD,eAAO,MAAM,iBAAiB,+OA4D7B,CAAA;AAGD,eAAO,MAAM,UAAU,yOAyEtB,CAAA;AAED,eAAO,MAAM,kBAAkB,yOA+F9B,CAAA;AAgBD,eAAO,MAAM,cAAc;gBAA+B,MAAM;oBAAkB,MAAM;YA6DvF,CAAA;AAGD,eAAO,MAAM,UAAU;eAA2B,MAAM;YA4CvD,CAAA;AAGD,eAAO,MAAM,UAAU;mBAA+B,MAAM;YAqB3D,CAAA;AAGD,eAAO,MAAM,WAAW,yOAwBvB,CAAA;AAGD,eAAO,MAAM,YAAY,6NAqDxB,CAAA;AAGD,eAAO,MAAM,WAAW,6NA+BvB,CAAA;AAGD,eAAO,MAAM,SAAS;aAAyB,OAAO;YAYrD,CAAA;AAGD,eAAO,MAAM,YAAY,6NAUxB,CAAA;AAGD,eAAO,MAAM,YAAY;eAA2B,MAAM;YAwBzD,CAAA;AAGD,eAAO,MAAM,WAAW;YAAwB,MAAM;YAQrD,CAAA;AAID,eAAO,MAAM,sBAAsB;oBAAgC,MAAM;YA8CxE,CAAA;AAGD,eAAO,MAAM,eAAe,6NAkB3B,CAAA;AAGD,eAAO,MAAM,YAAY,oOAQxB,CAAA;AAGD,eAAO,MAAM,yBAAyB,6NAOrC,CAAA;AAGD,eAAO,MAAM,cAAc;oBAAmC,MAAM;YAoDnE,CAAA;AAGD,eAAO,MAAM,qBAAqB,6NAgBjC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOrdifyChat.d.ts","sourceRoot":"","sources":["../../src/hooks/useOrdifyChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AA+BpF,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useOrdifyChat.d.ts","sourceRoot":"","sources":["../../src/hooks/useOrdifyChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AA+BpF,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,mBAAmB,CA4ZvE"}
|
|
@@ -10,6 +10,9 @@ export declare function useOrdifyConfig(config: OrdifyConfig): {
|
|
|
10
10
|
theme: "light" | "dark" | "auto";
|
|
11
11
|
placeholder: string;
|
|
12
12
|
height: string | number;
|
|
13
|
+
backgroundColor: string | undefined;
|
|
14
|
+
textColor: string | undefined;
|
|
15
|
+
borderRadius: string | number | undefined;
|
|
13
16
|
className: string;
|
|
14
17
|
buttonStyle: import('react').CSSProperties;
|
|
15
18
|
chatWindowStyle: import('react').CSSProperties;
|
|
@@ -32,5 +35,7 @@ export declare function useOrdifyConfig(config: OrdifyConfig): {
|
|
|
32
35
|
maxAttachmentSizeMB: number | undefined;
|
|
33
36
|
maxAttachments: number | undefined;
|
|
34
37
|
allowedAttachmentTypes: string[] | undefined;
|
|
38
|
+
useThinking: boolean;
|
|
39
|
+
enableImageGeneration: boolean | undefined;
|
|
35
40
|
};
|
|
36
41
|
//# sourceMappingURL=useOrdifyConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOrdifyConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useOrdifyConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAWtC,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY
|
|
1
|
+
{"version":3,"file":"useOrdifyConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useOrdifyConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAWtC,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDnD"}
|