@carbon/ai-chat 0.1.6 → 0.1.7-test-no-cjs

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 (144) hide show
  1. package/dist/es/{cds-aichat-internal.js → AppContainer.js} +50756 -18310
  2. package/dist/es/Carousel.js +14 -8
  3. package/dist/es/GenesysMessengerServiceDesk.js +17 -11
  4. package/dist/es/HumanAgentServiceImpl.js +17 -12
  5. package/dist/es/NiceDFOServiceDesk.js +17 -12
  6. package/dist/es/PDFViewerContainer.js +15 -108
  7. package/dist/es/ReactPlayer.js +2 -2
  8. package/dist/es/SFServiceDesk.js +18 -11
  9. package/dist/es/ServiceDeskImpl.js +2 -2
  10. package/dist/es/Table.js +429 -315
  11. package/dist/es/ZendeskServiceDesk.js +17 -11
  12. package/dist/es/_node-resolve_empty.js +2 -2
  13. package/dist/es/aiChatEntry.js +137 -120
  14. package/dist/es/ar-dz.js +3 -4
  15. package/dist/es/ar-kw.js +3 -4
  16. package/dist/es/ar-ly.js +3 -4
  17. package/dist/es/ar-ma.js +3 -4
  18. package/dist/es/ar-sa.js +3 -4
  19. package/dist/es/ar-tn.js +3 -4
  20. package/dist/es/ar.js +3 -4
  21. package/dist/es/ar2.js +2 -2
  22. package/dist/es/cds-aichat-container.js +104 -18
  23. package/dist/es/cds-aichat-custom-element.js +31 -21
  24. package/dist/es/cs.js +3 -4
  25. package/dist/es/cs2.js +2 -2
  26. package/dist/es/de-at.js +3 -4
  27. package/dist/es/de-ch.js +3 -4
  28. package/dist/es/de.js +3 -4
  29. package/dist/es/de2.js +2 -2
  30. package/dist/es/en-au.js +3 -4
  31. package/dist/es/en-ca.js +3 -4
  32. package/dist/es/en-gb.js +3 -4
  33. package/dist/es/en-ie.js +3 -4
  34. package/dist/es/en-il.js +3 -4
  35. package/dist/es/en-nz.js +3 -4
  36. package/dist/es/es-do.js +3 -4
  37. package/dist/es/es-us.js +3 -4
  38. package/dist/es/es.js +3 -4
  39. package/dist/es/es2.js +2 -2
  40. package/dist/es/export.js +3 -3
  41. package/dist/es/export.legacy.js +3 -3
  42. package/dist/es/fontUtils.js +2 -2
  43. package/dist/es/fr-ca.js +3 -4
  44. package/dist/es/fr-ch.js +3 -4
  45. package/dist/es/fr.js +3 -4
  46. package/dist/es/fr2.js +2 -2
  47. package/dist/es/it-ch.js +3 -4
  48. package/dist/es/it.js +3 -4
  49. package/dist/es/it2.js +2 -2
  50. package/dist/es/ja.js +3 -4
  51. package/dist/es/ja2.js +2 -2
  52. package/dist/es/ko.js +3 -4
  53. package/dist/es/ko2.js +2 -2
  54. package/dist/es/mockServiceDesk.js +17 -11
  55. package/dist/es/nl.js +3 -4
  56. package/dist/es/nl2.js +2 -2
  57. package/dist/es/pt-br.js +3 -4
  58. package/dist/es/pt-br2.js +2 -2
  59. package/dist/es/pt.js +3 -4
  60. package/dist/es/render.js +25 -12
  61. package/dist/es/zh-cn.js +3 -4
  62. package/dist/es/zh-tw.js +3 -4
  63. package/dist/es/zh-tw2.js +2 -2
  64. package/dist/es/zh.js +2 -2
  65. package/dist/types/aiChatEntry.d.ts +599 -11
  66. package/package.json +29 -21
  67. package/dist/cjs/Carousel.js +0 -5711
  68. package/dist/cjs/Chat.js +0 -8838
  69. package/dist/cjs/GenesysMessengerServiceDesk.js +0 -598
  70. package/dist/cjs/HumanAgentServiceImpl.js +0 -1145
  71. package/dist/cjs/NiceDFOServiceDesk.js +0 -2116
  72. package/dist/cjs/PDFViewerContainer.js +0 -83227
  73. package/dist/cjs/ReactPlayer.js +0 -57
  74. package/dist/cjs/SFServiceDesk.js +0 -1031
  75. package/dist/cjs/ServiceDeskImpl.js +0 -74
  76. package/dist/cjs/Table.js +0 -3146
  77. package/dist/cjs/ZendeskServiceDesk.js +0 -670
  78. package/dist/cjs/_node-resolve_empty.js +0 -27
  79. package/dist/cjs/agentActions.js +0 -214
  80. package/dist/cjs/aiChatEntry.js +0 -354
  81. package/dist/cjs/anonymousUserIDStorage.js +0 -254
  82. package/dist/cjs/ar-dz.js +0 -57
  83. package/dist/cjs/ar-kw.js +0 -57
  84. package/dist/cjs/ar-ly.js +0 -57
  85. package/dist/cjs/ar-ma.js +0 -57
  86. package/dist/cjs/ar-sa.js +0 -57
  87. package/dist/cjs/ar-tn.js +0 -57
  88. package/dist/cjs/ar.js +0 -57
  89. package/dist/cjs/ar2.js +0 -763
  90. package/dist/cjs/cds-aichat-container.js +0 -143
  91. package/dist/cjs/cds-aichat-custom-element.js +0 -200
  92. package/dist/cjs/cds-aichat-internal.js +0 -39150
  93. package/dist/cjs/cs.js +0 -57
  94. package/dist/cjs/cs2.js +0 -763
  95. package/dist/cjs/de-at.js +0 -57
  96. package/dist/cjs/de-ch.js +0 -57
  97. package/dist/cjs/de.js +0 -57
  98. package/dist/cjs/de2.js +0 -763
  99. package/dist/cjs/en-au.js +0 -57
  100. package/dist/cjs/en-ca.js +0 -57
  101. package/dist/cjs/en-gb.js +0 -57
  102. package/dist/cjs/en-ie.js +0 -57
  103. package/dist/cjs/en-il.js +0 -57
  104. package/dist/cjs/en-nz.js +0 -57
  105. package/dist/cjs/es-do.js +0 -57
  106. package/dist/cjs/es-us.js +0 -57
  107. package/dist/cjs/es.js +0 -57
  108. package/dist/cjs/es2.js +0 -763
  109. package/dist/cjs/export.js +0 -27
  110. package/dist/cjs/export.legacy.js +0 -27
  111. package/dist/cjs/fontUtils.js +0 -1038
  112. package/dist/cjs/fr-ca.js +0 -57
  113. package/dist/cjs/fr-ch.js +0 -57
  114. package/dist/cjs/fr.js +0 -57
  115. package/dist/cjs/fr2.js +0 -763
  116. package/dist/cjs/highlight_js.js +0 -15325
  117. package/dist/cjs/it-ch.js +0 -57
  118. package/dist/cjs/it.js +0 -57
  119. package/dist/cjs/it2.js +0 -763
  120. package/dist/cjs/ja.js +0 -57
  121. package/dist/cjs/ja2.js +0 -763
  122. package/dist/cjs/jstz.min.js +0 -43
  123. package/dist/cjs/ko.js +0 -57
  124. package/dist/cjs/ko2.js +0 -763
  125. package/dist/cjs/markdown.js +0 -8505
  126. package/dist/cjs/markdown_attrs.js +0 -805
  127. package/dist/cjs/mockServiceDesk.js +0 -887
  128. package/dist/cjs/nl.js +0 -57
  129. package/dist/cjs/nl2.js +0 -763
  130. package/dist/cjs/pt-br.js +0 -57
  131. package/dist/cjs/pt-br2.js +0 -763
  132. package/dist/cjs/pt.js +0 -57
  133. package/dist/cjs/render.js +0 -94
  134. package/dist/cjs/zh-cn.js +0 -57
  135. package/dist/cjs/zh-tw.js +0 -57
  136. package/dist/cjs/zh-tw2.js +0 -763
  137. package/dist/cjs/zh.js +0 -763
  138. package/dist/es/Chat.js +0 -8836
  139. package/dist/es/agentActions.js +0 -186
  140. package/dist/es/anonymousUserIDStorage.js +0 -249
  141. package/dist/es/highlight_js.js +0 -15320
  142. package/dist/es/jstz.min.js +0 -41
  143. package/dist/es/markdown.js +0 -8501
  144. package/dist/es/markdown_attrs.js +0 -803
@@ -1,143 +0,0 @@
1
- /*
2
-
3
-
4
- (C) Copyright IBM Corp. 2017, 2025. All Rights Reserved.
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
7
- in compliance with the License. You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software distributed under the License
12
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13
- or implied. See the License for the specific language governing permissions and limitations under
14
- the License.
15
-
16
- @carbon/ai-chat 0.1.6
17
-
18
- Built: Feb 3 2025 9:58 am -05:00
19
-
20
-
21
-
22
- */
23
- 'use strict';
24
-
25
- var cdsAichatInternal = require('./cds-aichat-internal.js');
26
- var lit = require('lit');
27
- var decorators_js = require('lit/decorators.js');
28
- require('react');
29
- require('react-dom');
30
- require('./highlight_js.js');
31
- require('@carbon/react');
32
- require('react-intl');
33
- require('react-redux');
34
- require('./markdown.js');
35
- require('./markdown_attrs.js');
36
- require('@carbon/web-components/es/components/button/index.js');
37
- require('@carbon/web-components/es/components/overflow-menu/index.js');
38
- require('lit/directives/unsafe-html.js');
39
- require('@carbon/web-components/es/components/slug/index.js');
40
- require('@carbon/web-components/es/components/popover/defs.js');
41
- require('@carbon/web-components/es/components/slug/defs.js');
42
- require('@carbon/web-components/es/components/slug/slug-action-button.js');
43
- require('@carbon/web-components/es/components/slug/slug.js');
44
- require('@carbon/web-components/es/components/textarea/index.js');
45
- require('@carbon/web-components/es/components/icon-button/index.js');
46
- require('lit/directives/unsafe-svg.js');
47
- require('@carbon/web-components/es/components/tag/index.js');
48
- require('@carbon/web-components/es/components/chat-button/index.js');
49
- require('@carbon/web-components/es/components/button/button.js');
50
- require('@carbon/web-components/es/components/layer/index.js');
51
-
52
- /**
53
- *
54
- * IBM Confidential
55
- *
56
- * (C) Copyright IBM Corp. 2024
57
- *
58
- * The source code for this program is not published or otherwise
59
- * divested of its trade secrets, irrespective of what has been
60
- * deposited with the U. S. Copyright Office
61
- *
62
- * US Government Users Restricted Rights - Use, duplication or
63
- * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
64
- *
65
- */
66
- /**
67
- * cds-aichat-container class
68
- */
69
- let ChatContainer = class ChatContainer extends lit.LitElement {
70
- constructor() {
71
- super(...arguments);
72
- /**
73
- * The existing array of slot names for all user_defined components.
74
- */
75
- this._userDefinedSlotNames = [];
76
- /**
77
- * The existing array of slot names for all writeable elements.
78
- */
79
- this._writeableElementSlots = [];
80
- /**
81
- * Adds the slot attribute to the element for the user_defined response type and then injects it into the component by
82
- * updating this._userDefinedSlotNames;
83
- */
84
- this._userDefinedHandler = (event) => {
85
- // This element already has `slot` as an attribute.
86
- const { slot } = event.data;
87
- if (!this._userDefinedSlotNames.includes(slot)) {
88
- this._userDefinedSlotNames = [...this._userDefinedSlotNames, slot];
89
- }
90
- };
91
- this._onBeforeRenderOverride = async (instance) => {
92
- this._instance = instance;
93
- this._instance.on({ type: "userDefinedResponse" /* BusEventType.USER_DEFINED_RESPONSE */, handler: this._userDefinedHandler });
94
- this._instance.on({ type: "chunk:userDefinedResponse" /* BusEventType.CHUNK_USER_DEFINED_RESPONSE */, handler: this._userDefinedHandler });
95
- this._addWriteableElementSlots();
96
- await this.onBeforeRender?.(instance);
97
- };
98
- }
99
- _addWriteableElementSlots() {
100
- const writeableElementSlots = [this._instance.customPanels.getPanel().hostElement.getAttribute('slot')];
101
- Object.keys(this._instance.writeableElements).forEach(writeableElementKey => {
102
- writeableElementSlots.push(writeableElementKey);
103
- });
104
- this._writeableElementSlots = writeableElementSlots;
105
- }
106
- /**
107
- * Renders the template while passing in class functionality
108
- */
109
- render() {
110
- return lit.html `<cds-aichat-internal
111
- .config=${this.config}
112
- .onAfterRender=${this.onAfterRender}
113
- .onBeforeRender=${this._onBeforeRenderOverride}
114
- >
115
- ${this._writeableElementSlots.map(slot => lit.html `<div slot=${slot}><slot name=${slot}></slot></div>`)}
116
- ${this._userDefinedSlotNames.map(slot => lit.html `<div slot=${slot}><slot name=${slot}></slot></div>`)}
117
- </cds-aichat-internal>`;
118
- }
119
- };
120
- cdsAichatInternal.__decorate([
121
- decorators_js.property({ type: Object })
122
- ], ChatContainer.prototype, "config", void 0);
123
- cdsAichatInternal.__decorate([
124
- decorators_js.property()
125
- ], ChatContainer.prototype, "onBeforeRender", void 0);
126
- cdsAichatInternal.__decorate([
127
- decorators_js.property()
128
- ], ChatContainer.prototype, "onAfterRender", void 0);
129
- cdsAichatInternal.__decorate([
130
- decorators_js.state()
131
- ], ChatContainer.prototype, "_userDefinedSlotNames", void 0);
132
- cdsAichatInternal.__decorate([
133
- decorators_js.state()
134
- ], ChatContainer.prototype, "_writeableElementSlots", void 0);
135
- cdsAichatInternal.__decorate([
136
- decorators_js.state()
137
- ], ChatContainer.prototype, "_instance", void 0);
138
- ChatContainer = cdsAichatInternal.__decorate([
139
- cdsAichatInternal.carbonElement('cds-aichat-container')
140
- ], ChatContainer);
141
- var ChatContainer$1 = ChatContainer;
142
-
143
- module.exports = ChatContainer$1;
@@ -1,200 +0,0 @@
1
- /*
2
-
3
-
4
- (C) Copyright IBM Corp. 2017, 2025. All Rights Reserved.
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
7
- in compliance with the License. You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software distributed under the License
12
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13
- or implied. See the License for the specific language governing permissions and limitations under
14
- the License.
15
-
16
- @carbon/ai-chat 0.1.6
17
-
18
- Built: Feb 3 2025 9:58 am -05:00
19
-
20
-
21
-
22
- */
23
- 'use strict';
24
-
25
- var cdsAichatInternal = require('./cds-aichat-internal.js');
26
- require('./cds-aichat-container.js');
27
- var lit = require('lit');
28
- var decorators_js = require('lit/decorators.js');
29
- require('react');
30
- require('react-dom');
31
- require('./highlight_js.js');
32
- require('@carbon/react');
33
- require('react-intl');
34
- require('react-redux');
35
- require('./markdown.js');
36
- require('./markdown_attrs.js');
37
- require('@carbon/web-components/es/components/button/index.js');
38
- require('@carbon/web-components/es/components/overflow-menu/index.js');
39
- require('lit/directives/unsafe-html.js');
40
- require('@carbon/web-components/es/components/slug/index.js');
41
- require('@carbon/web-components/es/components/popover/defs.js');
42
- require('@carbon/web-components/es/components/slug/defs.js');
43
- require('@carbon/web-components/es/components/slug/slug-action-button.js');
44
- require('@carbon/web-components/es/components/slug/slug.js');
45
- require('@carbon/web-components/es/components/textarea/index.js');
46
- require('@carbon/web-components/es/components/icon-button/index.js');
47
- require('lit/directives/unsafe-svg.js');
48
- require('@carbon/web-components/es/components/tag/index.js');
49
- require('@carbon/web-components/es/components/chat-button/index.js');
50
- require('@carbon/web-components/es/components/button/button.js');
51
- require('@carbon/web-components/es/components/layer/index.js');
52
-
53
- /**
54
- *
55
- * IBM Confidential
56
- *
57
- * (C) Copyright IBM Corp. 2024
58
- *
59
- * The source code for this program is not published or otherwise
60
- * divested of its trade secrets, irrespective of what has been
61
- * deposited with the U. S. Copyright Office
62
- *
63
- * US Government Users Restricted Rights - Use, duplication or
64
- * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
65
- *
66
- */
67
- /**
68
- * cds-aichat-container class
69
- */
70
- let ChatCustomElement = class ChatCustomElement extends lit.LitElement {
71
- constructor() {
72
- super(...arguments);
73
- this._originalStyles = { width: this.style.width, height: this.style.height };
74
- /**
75
- * A default handler for the "view:change" event. This will be used to show or hide the web chat main window
76
- * using a simple classname.
77
- */
78
- this.defaultViewChangeHandler = (event, instance) => {
79
- if (event.newViewState.mainWindow) {
80
- this._styles = { width: this._originalStyles?.width, height: this._originalStyles?.height };
81
- instance.elements.getMainWindow().removeClassName('HideWebChat');
82
- }
83
- else {
84
- this._originalStyles = { width: this.style.width, height: this.style.height };
85
- this._styles = { width: '0px', height: '0px' };
86
- instance.elements.getMainWindow().addClassName('HideWebChat');
87
- }
88
- };
89
- /**
90
- * The existing array of slot names for all user_defined components.
91
- */
92
- this._userDefinedSlotNames = [];
93
- /**
94
- * The existing array of slot names for all writeable elements.
95
- */
96
- this._writeableElementSlots = [];
97
- /**
98
- * Adds the slot attribute to the element for the user_defined response type and then injects it into the component by
99
- * updating this._userDefinedSlotNames;
100
- */
101
- this._userDefinedHandler = (event) => {
102
- // This element already has `slot` as an attribute.
103
- const { slot } = event.data;
104
- if (!this._userDefinedSlotNames.includes(slot)) {
105
- this._userDefinedSlotNames = [...this._userDefinedSlotNames, slot];
106
- }
107
- };
108
- this._onBeforeRenderOverride = async (instance) => {
109
- this._instance = instance;
110
- this._instance.on({ type: "view:change" /* BusEventType.VIEW_CHANGE */, handler: this.onViewChange || this.defaultViewChangeHandler });
111
- this._instance.on({ type: "userDefinedResponse" /* BusEventType.USER_DEFINED_RESPONSE */, handler: this._userDefinedHandler });
112
- this._instance.on({ type: "chunk:userDefinedResponse" /* BusEventType.CHUNK_USER_DEFINED_RESPONSE */, handler: this._userDefinedHandler });
113
- this._addWriteableElementSlots();
114
- await this.onBeforeRender?.(instance);
115
- };
116
- }
117
- _addWriteableElementSlots() {
118
- const writeableElementSlots = [this._instance.customPanels.getPanel().hostElement.getAttribute('slot')];
119
- Object.keys(this._instance.writeableElements).forEach(writeableElementKey => {
120
- writeableElementSlots.push(writeableElementKey);
121
- });
122
- this._writeableElementSlots = writeableElementSlots;
123
- }
124
- firstUpdated() {
125
- this._config = {
126
- ...this.config,
127
- element: this,
128
- };
129
- }
130
- updated(changedProperties) {
131
- if (changedProperties.has('config')) {
132
- this._config = {
133
- ...this.config,
134
- element: this,
135
- };
136
- this.requestUpdate();
137
- }
138
- }
139
- renderStyles() {
140
- if (this._styles?.width && this._styles?.height) {
141
- return lit.html `<style>
142
- :host {
143
- width: ${this._styles.width};
144
- height: ${this._styles.height};
145
- }
146
- </style>`;
147
- }
148
- return '';
149
- }
150
- /**
151
- * Renders the template while passing in class functionality
152
- */
153
- render() {
154
- return lit.html `${this.renderStyles()}
155
- <cds-aichat-container
156
- .config=${this._config}
157
- .onAfterRender=${this.onAfterRender}
158
- .onBeforeRender=${this._onBeforeRenderOverride}
159
- >
160
- ${this._writeableElementSlots.map(slot => lit.html `<div slot=${slot}><slot name=${slot}></slot></div>`)}
161
- ${this._userDefinedSlotNames.map(slot => lit.html `<div slot=${slot}><slot name=${slot}></slot></div>`)}
162
- </cds-aichat-container>`;
163
- }
164
- };
165
- cdsAichatInternal.__decorate([
166
- decorators_js.property({ type: Object })
167
- ], ChatCustomElement.prototype, "config", void 0);
168
- cdsAichatInternal.__decorate([
169
- decorators_js.property()
170
- ], ChatCustomElement.prototype, "onBeforeRender", void 0);
171
- cdsAichatInternal.__decorate([
172
- decorators_js.property()
173
- ], ChatCustomElement.prototype, "onAfterRender", void 0);
174
- cdsAichatInternal.__decorate([
175
- decorators_js.property()
176
- ], ChatCustomElement.prototype, "onViewChange", void 0);
177
- cdsAichatInternal.__decorate([
178
- decorators_js.state()
179
- ], ChatCustomElement.prototype, "_config", void 0);
180
- cdsAichatInternal.__decorate([
181
- decorators_js.state()
182
- ], ChatCustomElement.prototype, "_originalStyles", void 0);
183
- cdsAichatInternal.__decorate([
184
- decorators_js.state()
185
- ], ChatCustomElement.prototype, "_styles", void 0);
186
- cdsAichatInternal.__decorate([
187
- decorators_js.state()
188
- ], ChatCustomElement.prototype, "_userDefinedSlotNames", void 0);
189
- cdsAichatInternal.__decorate([
190
- decorators_js.state()
191
- ], ChatCustomElement.prototype, "_writeableElementSlots", void 0);
192
- cdsAichatInternal.__decorate([
193
- decorators_js.state()
194
- ], ChatCustomElement.prototype, "_instance", void 0);
195
- ChatCustomElement = cdsAichatInternal.__decorate([
196
- cdsAichatInternal.carbonElement('cds-aichat-custom-element')
197
- ], ChatCustomElement);
198
- var ChatCustomElement$1 = ChatCustomElement;
199
-
200
- module.exports = ChatCustomElement$1;