open-chat-studio-widget 0.4.6 → 0.4.8

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.
Files changed (60) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  3. package/dist/cjs/{index-c9203be6.js → index-AhSI5tER.js} +329 -238
  4. package/dist/cjs/index-AhSI5tER.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +1 -0
  6. package/dist/cjs/index.cjs.js.map +1 -1
  7. package/dist/cjs/loader.cjs.js +4 -5
  8. package/dist/cjs/loader.cjs.js.map +1 -1
  9. package/dist/cjs/open-chat-studio-widget.cjs.entry.js +3941 -3904
  10. package/dist/cjs/open-chat-studio-widget.cjs.entry.js.map +1 -1
  11. package/dist/cjs/open-chat-studio-widget.cjs.js +8 -7
  12. package/dist/cjs/open-chat-studio-widget.cjs.js.map +1 -1
  13. package/dist/cjs/open-chat-studio-widget.entry.cjs.js.map +1 -0
  14. package/dist/collection/collection-manifest.json +1 -1
  15. package/dist/collection/components/ocs-chat/ocs-chat.css +36 -661
  16. package/dist/collection/components/ocs-chat/ocs-chat.js +41 -20
  17. package/dist/collection/components/ocs-chat/ocs-chat.js.map +1 -1
  18. package/dist/components/index.js +2 -1
  19. package/dist/components/open-chat-studio-widget.js +3939 -3900
  20. package/dist/components/open-chat-studio-widget.js.map +1 -1
  21. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  22. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  23. package/dist/esm/{index-0349ca51.js → index-DkJ7OJTS.js} +327 -216
  24. package/dist/esm/index-DkJ7OJTS.js.map +1 -0
  25. package/dist/esm/index.js +1 -0
  26. package/dist/esm/index.js.map +1 -1
  27. package/dist/esm/loader.js +5 -4
  28. package/dist/esm/loader.js.map +1 -1
  29. package/dist/esm/open-chat-studio-widget.entry.js +3942 -3903
  30. package/dist/esm/open-chat-studio-widget.entry.js.map +1 -1
  31. package/dist/esm/open-chat-studio-widget.js +7 -5
  32. package/dist/esm/open-chat-studio-widget.js.map +1 -1
  33. package/dist/open-chat-studio-widget/index.esm.js.map +1 -1
  34. package/dist/open-chat-studio-widget/loader.esm.js.map +1 -0
  35. package/dist/open-chat-studio-widget/open-chat-studio-widget.entry.esm.js.map +1 -0
  36. package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js +1 -1
  37. package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js.map +1 -1
  38. package/dist/open-chat-studio-widget/p-DQuL1Twl.js +2 -0
  39. package/dist/open-chat-studio-widget/p-DQuL1Twl.js.map +1 -0
  40. package/dist/open-chat-studio-widget/p-DkJ7OJTS.js +3 -0
  41. package/dist/open-chat-studio-widget/p-DkJ7OJTS.js.map +1 -0
  42. package/dist/open-chat-studio-widget/p-bde68fbd.entry.js +4 -0
  43. package/dist/open-chat-studio-widget/p-bde68fbd.entry.js.map +1 -0
  44. package/dist/types/components/ocs-chat/ocs-chat.d.ts +5 -0
  45. package/dist/types/components.d.ts +20 -0
  46. package/dist/types/stencil-public-runtime.d.ts +35 -6
  47. package/package.json +2 -2
  48. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  49. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  50. package/dist/cjs/index-c9203be6.js.map +0 -1
  51. package/dist/esm/app-globals-0f993ce5.js +0 -5
  52. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  53. package/dist/esm/index-0349ca51.js.map +0 -1
  54. package/dist/open-chat-studio-widget/p-16df1b20.entry.js +0 -4
  55. package/dist/open-chat-studio-widget/p-16df1b20.entry.js.map +0 -1
  56. package/dist/open-chat-studio-widget/p-3dc66a9a.js +0 -3
  57. package/dist/open-chat-studio-widget/p-3dc66a9a.js.map +0 -1
  58. package/dist/open-chat-studio-widget/p-e1255160.js +0 -2
  59. package/dist/open-chat-studio-widget/p-e1255160.js.map +0 -1
  60. package/loader/package.json +0 -11
@@ -163,6 +163,11 @@ export declare class OcsChat {
163
163
  private pauseMessagePolling;
164
164
  private resumeMessagePolling;
165
165
  private pollForMessages;
166
+ /**
167
+ * Scroll the message container to the bottom.
168
+ * @param forceEnd When `false`, scroll the top of the last message into view.
169
+ * When `true`, scroll all the way to the end of the last message.
170
+ */
166
171
  private scrollToBottom;
167
172
  private focusInput;
168
173
  private handleKeyPress;
@@ -9,18 +9,22 @@ export namespace Components {
9
9
  interface OpenChatStudioWidget {
10
10
  /**
11
11
  * Allow the user to attach files to their messages.
12
+ * @default false
12
13
  */
13
14
  "allowAttachments": boolean;
14
15
  /**
15
16
  * Allow the user to make the chat window full screen.
17
+ * @default true
16
18
  */
17
19
  "allowFullScreen": boolean;
18
20
  /**
19
21
  * The base URL for the API (defaults to current origin).
22
+ * @default "https://chatbots.dimagi.com"
20
23
  */
21
24
  "apiBaseUrl"?: string;
22
25
  /**
23
26
  * The shape of the chat button. 'round' makes it circular, 'square' keeps it rectangular.
27
+ * @default 'square'
24
28
  */
25
29
  "buttonShape": 'round' | 'square';
26
30
  /**
@@ -41,18 +45,22 @@ export namespace Components {
41
45
  "iconUrl"?: string;
42
46
  /**
43
47
  * The message to display in the new chat confirmation dialog.
48
+ * @default "Starting a new chat will clear your current conversation. Continue?"
44
49
  */
45
50
  "newChatConfirmationMessage"?: string;
46
51
  /**
47
52
  * Whether to persist session data to local storage to allow resuming previous conversations after page reload.
53
+ * @default true
48
54
  */
49
55
  "persistentSession": boolean;
50
56
  /**
51
57
  * Minutes since the most recent message after which the session data in local storage will expire. Set this to `0` to never expire.
58
+ * @default 60 * 24
52
59
  */
53
60
  "persistentSessionExpire": number;
54
61
  /**
55
62
  * The initial position of the chat widget on the screen.
63
+ * @default 'right'
56
64
  */
57
65
  "position": 'left' | 'center' | 'right';
58
66
  /**
@@ -61,6 +69,7 @@ export namespace Components {
61
69
  "starterQuestions"?: string;
62
70
  /**
63
71
  * The text to display while the assistant is typing/preparing a response.
72
+ * @default "Preparing response"
64
73
  */
65
74
  "typingIndicatorText"?: string;
66
75
  /**
@@ -73,6 +82,7 @@ export namespace Components {
73
82
  "userName"?: string;
74
83
  /**
75
84
  * Whether the chat widget is visible on load.
85
+ * @default false
76
86
  */
77
87
  "visible": boolean;
78
88
  /**
@@ -96,18 +106,22 @@ declare namespace LocalJSX {
96
106
  interface OpenChatStudioWidget {
97
107
  /**
98
108
  * Allow the user to attach files to their messages.
109
+ * @default false
99
110
  */
100
111
  "allowAttachments"?: boolean;
101
112
  /**
102
113
  * Allow the user to make the chat window full screen.
114
+ * @default true
103
115
  */
104
116
  "allowFullScreen"?: boolean;
105
117
  /**
106
118
  * The base URL for the API (defaults to current origin).
119
+ * @default "https://chatbots.dimagi.com"
107
120
  */
108
121
  "apiBaseUrl"?: string;
109
122
  /**
110
123
  * The shape of the chat button. 'round' makes it circular, 'square' keeps it rectangular.
124
+ * @default 'square'
111
125
  */
112
126
  "buttonShape"?: 'round' | 'square';
113
127
  /**
@@ -128,18 +142,22 @@ declare namespace LocalJSX {
128
142
  "iconUrl"?: string;
129
143
  /**
130
144
  * The message to display in the new chat confirmation dialog.
145
+ * @default "Starting a new chat will clear your current conversation. Continue?"
131
146
  */
132
147
  "newChatConfirmationMessage"?: string;
133
148
  /**
134
149
  * Whether to persist session data to local storage to allow resuming previous conversations after page reload.
150
+ * @default true
135
151
  */
136
152
  "persistentSession"?: boolean;
137
153
  /**
138
154
  * Minutes since the most recent message after which the session data in local storage will expire. Set this to `0` to never expire.
155
+ * @default 60 * 24
139
156
  */
140
157
  "persistentSessionExpire"?: number;
141
158
  /**
142
159
  * The initial position of the chat widget on the screen.
160
+ * @default 'right'
143
161
  */
144
162
  "position"?: 'left' | 'center' | 'right';
145
163
  /**
@@ -148,6 +166,7 @@ declare namespace LocalJSX {
148
166
  "starterQuestions"?: string;
149
167
  /**
150
168
  * The text to display while the assistant is typing/preparing a response.
169
+ * @default "Preparing response"
151
170
  */
152
171
  "typingIndicatorText"?: string;
153
172
  /**
@@ -160,6 +179,7 @@ declare namespace LocalJSX {
160
179
  "userName"?: string;
161
180
  /**
162
181
  * Whether the chat widget is visible on load.
182
+ * @default false
163
183
  */
164
184
  "visible"?: boolean;
165
185
  /**
@@ -260,6 +260,25 @@ export declare function setPlatformHelpers(helpers: {
260
260
  * @returns the base path
261
261
  */
262
262
  export declare function getAssetPath(path: string): string;
263
+ /**
264
+ * Method to render a virtual DOM tree to a container element.
265
+ *
266
+ * @example
267
+ * ```tsx
268
+ * import { render } from '@stencil/core';
269
+ *
270
+ * const vnode = (
271
+ * <div>
272
+ * <h1>Hello, world!</h1>
273
+ * </div>
274
+ * );
275
+ * render(vnode, document.body);
276
+ * ```
277
+ *
278
+ * @param vnode - The virtual DOM tree to render
279
+ * @param container - The container element to render the virtual DOM tree to
280
+ */
281
+ export declare function render(vnode: VNode, container: Element): void;
263
282
  /**
264
283
  * Used to manually set the base path where assets can be found. For lazy-loaded
265
284
  * builds the asset path is automatically set and assets copied to the correct
@@ -826,7 +845,8 @@ export declare namespace JSXBase {
826
845
  }
827
846
  interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
828
847
  open?: boolean;
829
- onToggle?: (event: Event) => void;
848
+ name?: string;
849
+ onToggle?: (event: ToggleEvent) => void;
830
850
  }
831
851
  interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
832
852
  cite?: string;
@@ -1532,6 +1552,13 @@ export declare namespace JSXBase {
1532
1552
  z?: number | string;
1533
1553
  zoomAndPan?: string;
1534
1554
  }
1555
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent) */
1556
+ interface ToggleEvent extends Event {
1557
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/newState) */
1558
+ readonly newState: string;
1559
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/oldState) */
1560
+ readonly oldState: string;
1561
+ }
1535
1562
  interface DOMAttributes<T> extends JSXAttributes<T> {
1536
1563
  slot?: string;
1537
1564
  part?: string;
@@ -1548,6 +1575,10 @@ export declare namespace JSXBase {
1548
1575
  onCompositionstartCapture?: (event: CompositionEvent) => void;
1549
1576
  onCompositionupdate?: (event: CompositionEvent) => void;
1550
1577
  onCompositionupdateCapture?: (event: CompositionEvent) => void;
1578
+ onBeforeToggle?: (event: ToggleEvent) => void;
1579
+ onBeforeToggleCapture?: (event: ToggleEvent) => void;
1580
+ onToggle?: (event: ToggleEvent) => void;
1581
+ onToggleCapture?: (event: ToggleEvent) => void;
1551
1582
  onFocus?: (event: FocusEvent) => void;
1552
1583
  onFocusCapture?: (event: FocusEvent) => void;
1553
1584
  onFocusin?: (event: FocusEvent) => void;
@@ -1566,10 +1597,6 @@ export declare namespace JSXBase {
1566
1597
  onSubmitCapture?: (event: Event) => void;
1567
1598
  onInvalid?: (event: Event) => void;
1568
1599
  onInvalidCapture?: (event: Event) => void;
1569
- onBeforeToggle?: (event: Event) => void;
1570
- onBeforeToggleCapture?: (event: Event) => void;
1571
- onToggle?: (event: Event) => void;
1572
- onToggleCapture?: (event: Event) => void;
1573
1600
  onLoad?: (event: Event) => void;
1574
1601
  onLoadCapture?: (event: Event) => void;
1575
1602
  onError?: (event: Event) => void;
@@ -1581,7 +1608,7 @@ export declare namespace JSXBase {
1581
1608
  onKeyUp?: (event: KeyboardEvent) => void;
1582
1609
  onKeyUpCapture?: (event: KeyboardEvent) => void;
1583
1610
  onAuxClick?: (event: MouseEvent) => void;
1584
- onClick?: (event: MouseEvent) => void;
1611
+ onClick?: (event: PointerEvent) => void;
1585
1612
  onClickCapture?: (event: MouseEvent) => void;
1586
1613
  onContextMenu?: (event: MouseEvent) => void;
1587
1614
  onContextMenuCapture?: (event: MouseEvent) => void;
@@ -1661,6 +1688,8 @@ export declare namespace JSXBase {
1661
1688
  onTransitionRunCapture?: (event: TransitionEvent) => void;
1662
1689
  onTransitionStart?: (event: TransitionEvent) => void;
1663
1690
  onTransitionStartCapture?: (event: TransitionEvent) => void;
1691
+ [key: `aria-${string}`]: string | boolean | undefined;
1692
+ [key: `aria${string}`]: string | boolean | undefined;
1664
1693
  }
1665
1694
  }
1666
1695
  export interface JSXAttributes<T = Element> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-chat-studio-widget",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "Chat component for Open Chat Studio",
5
5
  "main": "dist/index.cjs.js",
6
6
  "exports": "./dist/esm/open-chat-studio-widget.js",
@@ -29,7 +29,7 @@
29
29
  "postpublish": "npm run use:gitReadme"
30
30
  },
31
31
  "dependencies": {
32
- "@stencil/core": "^4.26.0",
32
+ "@stencil/core": "^4.27.0",
33
33
  "dompurify": "^3.0.5",
34
34
  "js-cookie": "^3.0.5",
35
35
  "marked": "^4.3.0",
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- const globalScripts = () => {};
4
-
5
- exports.globalScripts = globalScripts;
6
-
7
- //# sourceMappingURL=app-globals-3a1e7e63.js.map
@@ -1 +0,0 @@
1
- {"file":"app-globals-3a1e7e63.js","mappings":";;AAAY,MAAC,aAAa,GAAG,MAAM;;;;","names":[],"sources":["@stencil/core/internal/app-globals"],"sourcesContent":["export const globalScripts = () => {};\n"],"version":3}