@carbon/ai-chat 1.2.0-rc.1 → 1.2.0-rc.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/dist/es/aiChatEntry.js +8 -2
- package/dist/es/aiChatEntry.js.map +1 -1
- package/dist/es/chat.PageObjectId.js +0 -1
- package/dist/es/chat.PageObjectId.js.map +1 -1
- package/dist/es/web-components/cds-aichat-custom-element/index.js +8 -0
- package/dist/es/web-components/cds-aichat-custom-element/index.js.map +1 -1
- package/dist/es-custom/aiChatEntry.js +8 -2
- package/dist/es-custom/aiChatEntry.js.map +1 -1
- package/dist/es-custom/chat.PageObjectId.js +0 -1
- package/dist/es-custom/chat.PageObjectId.js.map +1 -1
- package/dist/es-custom/web-components/cds-aichat-custom-element/index.js +8 -0
- package/dist/es-custom/web-components/cds-aichat-custom-element/index.js.map +1 -1
- package/dist/types/aiChatEntry.d.ts +38 -12
- package/dist/types/{serverEntry-C7dK61Jb.d.ts → serverEntry-Cad3Ek2W.d.ts} +2 -6
- package/dist/types/serverEntry.d.ts +1 -1
- package/package.json +2 -2
|
@@ -258,6 +258,12 @@ let ChatCustomElement = ChatCustomElement_1 = class ChatCustomElement extends Li
|
|
|
258
258
|
};
|
|
259
259
|
this.onBeforeRenderOverride = async instance => {
|
|
260
260
|
this._instance = instance;
|
|
261
|
+
if (this.onViewPreChange) {
|
|
262
|
+
this._instance.on({
|
|
263
|
+
type: BusEventType.VIEW_PRE_CHANGE,
|
|
264
|
+
handler: this.onViewPreChange
|
|
265
|
+
});
|
|
266
|
+
}
|
|
261
267
|
this._instance.on({
|
|
262
268
|
type: BusEventType.VIEW_CHANGE,
|
|
263
269
|
handler: this.onViewChange || this.defaultViewChangeHandler
|
|
@@ -515,6 +521,8 @@ __decorate([ property({
|
|
|
515
521
|
attribute: false
|
|
516
522
|
}) ], ChatCustomElement.prototype, "onAfterRender", void 0);
|
|
517
523
|
|
|
524
|
+
__decorate([ property() ], ChatCustomElement.prototype, "onViewPreChange", void 0);
|
|
525
|
+
|
|
518
526
|
__decorate([ property() ], ChatCustomElement.prototype, "onViewChange", void 0);
|
|
519
527
|
|
|
520
528
|
__decorate([ state() ], ChatCustomElement.prototype, "_userDefinedSlotNames", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/web-components/cds-custom-aichat-custom-element/index.ts"],"sourcesContent":["/*\n * Copyright IBM Corp. 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @license\n */\n\n// Ensure the container custom element is registered whenever the\n// custom element module is imported by re-exporting its exports.\n// This prevents bundlers (and our own multi-entry Rollup build)\n// from pruning the side-effect-only import.\nexport { default as __cds-custom_aichat_container_register } from \"../cds-custom-aichat-container\";\nimport \"../cds-custom-aichat-container\";\n\nimport { html, LitElement } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\n\nimport { carbonElement } from \"@carbon/ai-chat-components/es/globals/decorators/index.js\";\nimport {\n PublicConfig,\n OnErrorData,\n DisclaimerPublicConfig,\n CarbonTheme,\n HeaderConfig,\n LayoutConfig,\n PublicConfigMessaging,\n LanguagePack,\n InputConfig,\n} from \"../../types/config/PublicConfig\";\nimport { DeepPartial } from \"../../types/utilities/DeepPartial\";\nimport { HomeScreenConfig } from \"../../types/config/HomeScreenConfig\";\nimport { LauncherConfig } from \"../../types/config/LauncherConfig\";\nimport type {\n ServiceDesk,\n ServiceDeskFactoryParameters,\n ServiceDeskPublicConfig,\n} from \"../../types/config/ServiceDeskConfig\";\nimport { ChatInstance } from \"../../types/instance/ChatInstance\";\nimport {\n BusEventChunkUserDefinedResponse,\n BusEventType,\n BusEventUserDefinedResponse,\n BusEventViewChange,\n} from \"../../types/events/eventBusTypes\";\n\n/**\n * cds-custom-aichat-custom-element will is a pass through to cds-custom-aichat-container. It takes any user_defined and writeable element\n * slotted content and forwards it to cds-custom-aichat-container. It also will setup the custom element with a default viewChange\n * pattern (e.g. hiding and showing the custom element when the chat should be open/closed) if a onViewChange property is not\n * defined. Finally, it registers the custom element with cds-custom-aichat-container so a default \"floating\" element will not be created.\n *\n * The custom element should be sized using external CSS. When hidden, the 'cds-custom-aichat--hidden' class is added to set dimensions to 0x0.\n */\n@carbonElement(\"cds-custom-aichat-custom-element\")\nclass ChatCustomElement extends LitElement {\n @property({ attribute: false, type: Object })\n config?: PublicConfig;\n\n /**\n * Shared stylesheet for hiding styles.\n */\n private static hideSheet = new CSSStyleSheet();\n static {\n // Hide styles that override any external sizing\n ChatCustomElement.hideSheet.replaceSync(`\n :host {\n display: block;\n }\n :host(.cds-custom-aichat--hidden) {\n width: 0 !important;\n height: 0 !important;\n min-width: 0 !important;\n min-height: 0 !important;\n max-width: 0 !important;\n max-height: 0 !important;\n inline-size: 0 !important;\n block-size: 0 !important;\n min-inline-size: 0 !important;\n min-block-size: 0 !important;\n max-inline-size: 0 !important;\n max-block-size: 0 !important;\n overflow: hidden !important;\n display: block !important;\n }\n `);\n }\n\n /**\n * Adopt our stylesheet into every shadowRoot.\n */\n protected createRenderRoot(): ShadowRoot {\n // Lits default createRenderRoot actually returns a ShadowRoot\n const root = super.createRenderRoot() as ShadowRoot;\n\n // now TS knows root.adoptedStyleSheets exists\n root.adoptedStyleSheets = [\n ...root.adoptedStyleSheets,\n ChatCustomElement.hideSheet,\n ];\n return root;\n }\n\n // Flattened PublicConfig properties\n @property({ attribute: false })\n onError?: (data: OnErrorData) => void;\n\n @property({ type: Boolean, attribute: \"open-chat-by-default\" })\n openChatByDefault?: boolean;\n\n @property({ type: Object })\n disclaimer?: DisclaimerPublicConfig;\n\n @property({\n type: Boolean,\n attribute: \"disable-custom-element-mobile-enhancements\",\n })\n disableCustomElementMobileEnhancements?: boolean;\n\n @property({ type: Boolean })\n debug?: boolean;\n\n @property({ type: Boolean, attribute: \"expose-service-manager-for-testing\" })\n exposeServiceManagerForTesting?: boolean;\n\n @property({ type: String, attribute: \"inject-carbon-theme\" })\n injectCarbonTheme?: CarbonTheme;\n\n @property({\n attribute: \"ai-enabled\",\n converter: {\n fromAttribute: (value: string | null) => {\n if (value === null) {\n return undefined;\n }\n const v = String(value).trim().toLowerCase();\n const falsey = v === \"false\" || v === \"0\" || v === \"off\" || v === \"no\";\n return !falsey;\n },\n },\n })\n aiEnabled?: boolean;\n\n @property({ type: Boolean, attribute: \"ai-disabled\" })\n aiDisabled?: boolean;\n\n @property({\n type: Boolean,\n attribute: \"should-take-focus-if-opens-automatically\",\n })\n shouldTakeFocusIfOpensAutomatically?: boolean;\n\n @property({ type: String })\n namespace?: string;\n\n @state()\n private enableFocusTrap?: boolean;\n\n @property({ type: Boolean, attribute: \"should-sanitize-html\" })\n shouldSanitizeHTML?: boolean;\n\n @property({ type: Object })\n header?: HeaderConfig;\n\n @property({ type: Object })\n input?: InputConfig;\n\n @property({ type: Object })\n layout?: LayoutConfig;\n\n @property({ type: Object })\n messaging?: PublicConfigMessaging;\n\n @property({ type: Boolean, attribute: \"is-readonly\" })\n isReadonly?: boolean;\n\n @property({ type: String, attribute: \"assistant-name\" })\n assistantName?: string;\n\n @property({ type: String })\n locale?: string;\n\n @property({ type: Object })\n homescreen?: HomeScreenConfig;\n\n @property({ type: Object })\n launcher?: LauncherConfig;\n\n /** A factory for the {@link ServiceDesk} integration. */\n @property({ attribute: false })\n serviceDeskFactory?: (\n parameters: ServiceDeskFactoryParameters,\n ) => Promise<ServiceDesk>;\n\n /** Public configuration for the service desk integration. */\n @property({ type: Object, attribute: \"service-desk\" })\n serviceDesk?: ServiceDeskPublicConfig;\n\n /** Optional partial language pack overrides */\n @property({ type: Object })\n strings?: DeepPartial<LanguagePack>;\n\n /**\n * This function is called before the render function of Carbon AI Chat is called. This function can return a Promise\n * which will cause Carbon AI Chat to wait for it before rendering.\n */\n @property({ attribute: false })\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of Carbon AI Chat is called.\n */\n @property({ attribute: false })\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * An optional listener for \"view:change\" events. Such a listener is required when using a custom element in order\n * to control the visibility of the Carbon AI Chat main window. If no callback is provided here, a default one will be\n * used that injects styling into the app that will show and hide the Carbon AI Chat main window and also change the\n * size of the custom element so it doesn't take up space when the main window is closed.\n *\n * You can provide a different callback here if you want custom behavior such as an animation when the main window\n * is opened or closed.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded. After Carbon AI Chat is loaded, the event\n * handler will not be updated.\n */\n @property()\n onViewChange?: (event: BusEventViewChange, instance: ChatInstance) => void;\n\n @state()\n private _userDefinedSlotNames: string[] = [];\n\n @state()\n private _writeableElementSlots: string[] = [];\n\n @state()\n private _instance!: ChatInstance;\n\n private defaultViewChangeHandler = (event: BusEventViewChange) => {\n if (event.newViewState.mainWindow) {\n this.classList.remove(\"cds-custom-aichat--hidden\");\n } else {\n this.classList.add(\"cds-custom-aichat--hidden\");\n }\n };\n\n private userDefinedHandler = (\n event: BusEventUserDefinedResponse | BusEventChunkUserDefinedResponse,\n ) => {\n const { slot } = event.data;\n if (!this._userDefinedSlotNames.includes(slot)) {\n this._userDefinedSlotNames = [...this._userDefinedSlotNames, slot];\n }\n };\n\n private get resolvedConfig(): PublicConfig {\n const baseConfig = this.config ?? {};\n const resolvedConfig: PublicConfig = { ...baseConfig };\n\n if (this.onError !== undefined) {\n resolvedConfig.onError = this.onError;\n }\n if (this.openChatByDefault !== undefined) {\n resolvedConfig.openChatByDefault = this.openChatByDefault;\n }\n if (this.disclaimer !== undefined) {\n resolvedConfig.disclaimer = this.disclaimer;\n }\n if (this.disableCustomElementMobileEnhancements !== undefined) {\n resolvedConfig.disableCustomElementMobileEnhancements =\n this.disableCustomElementMobileEnhancements;\n }\n if (this.debug !== undefined) {\n resolvedConfig.debug = this.debug;\n }\n if (this.exposeServiceManagerForTesting !== undefined) {\n resolvedConfig.exposeServiceManagerForTesting =\n this.exposeServiceManagerForTesting;\n }\n if (this.injectCarbonTheme !== undefined) {\n resolvedConfig.injectCarbonTheme = this.injectCarbonTheme;\n }\n if (this.serviceDeskFactory !== undefined) {\n resolvedConfig.serviceDeskFactory = this.serviceDeskFactory;\n }\n if (this.serviceDesk !== undefined) {\n resolvedConfig.serviceDesk = this.serviceDesk;\n }\n if (this.shouldTakeFocusIfOpensAutomatically !== undefined) {\n resolvedConfig.shouldTakeFocusIfOpensAutomatically =\n this.shouldTakeFocusIfOpensAutomatically;\n }\n if (this.namespace !== undefined) {\n resolvedConfig.namespace = this.namespace;\n }\n if (this.enableFocusTrap !== undefined) {\n resolvedConfig.enableFocusTrap = this.enableFocusTrap;\n }\n if (this.shouldSanitizeHTML !== undefined) {\n resolvedConfig.shouldSanitizeHTML = this.shouldSanitizeHTML;\n }\n if (this.header !== undefined) {\n resolvedConfig.header = this.header;\n }\n if (this.input !== undefined) {\n resolvedConfig.input = this.input;\n }\n if (this.layout !== undefined) {\n resolvedConfig.layout = this.layout;\n }\n if (this.messaging !== undefined) {\n resolvedConfig.messaging = this.messaging;\n }\n if (this.isReadonly !== undefined) {\n resolvedConfig.isReadonly = this.isReadonly;\n }\n if (this.assistantName !== undefined) {\n resolvedConfig.assistantName = this.assistantName;\n }\n if (this.locale !== undefined) {\n resolvedConfig.locale = this.locale;\n }\n if (this.homescreen !== undefined) {\n resolvedConfig.homescreen = this.homescreen;\n }\n if (this.launcher !== undefined) {\n resolvedConfig.launcher = this.launcher;\n }\n if (this.strings !== undefined) {\n resolvedConfig.strings = this.strings;\n }\n\n if (this.aiDisabled === true) {\n resolvedConfig.aiEnabled = false;\n } else if (this.aiEnabled !== undefined) {\n resolvedConfig.aiEnabled = this.aiEnabled;\n }\n\n return resolvedConfig;\n }\n\n private onBeforeRenderOverride = async (instance: ChatInstance) => {\n this._instance = instance;\n this._instance.on({\n type: BusEventType.VIEW_CHANGE,\n handler: this.onViewChange || this.defaultViewChangeHandler,\n });\n this._instance.on({\n type: BusEventType.USER_DEFINED_RESPONSE,\n handler: this.userDefinedHandler,\n });\n this._instance.on({\n type: BusEventType.CHUNK_USER_DEFINED_RESPONSE,\n handler: this.userDefinedHandler,\n });\n this.addWriteableElementSlots();\n await this.onBeforeRender?.(instance);\n };\n\n private addWriteableElementSlots() {\n this._writeableElementSlots = Object.keys(this._instance.writeableElements);\n }\n\n render() {\n return html`\n <cds-custom-aichat-container\n .config=${this.resolvedConfig}\n .onAfterRender=${this.onAfterRender}\n .onBeforeRender=${this.onBeforeRenderOverride}\n .element=${this}\n >\n ${this._writeableElementSlots.map(\n (slot) => html`<div slot=${slot}><slot name=${slot}></slot></div>`,\n )}\n ${this._userDefinedSlotNames.map(\n (slot) => html`<div slot=${slot}><slot name=${slot}></slot></div>`,\n )}\n </cds-custom-aichat-container>\n `;\n }\n}\n\n/**\n * Attributes interface for the cds-custom-aichat-custom-element web component.\n * This interface extends {@link CdsAiChatContainerAttributes} and {@link PublicConfig} with additional component-specific props,\n * flattening all config properties as top-level properties for better TypeScript IntelliSense.\n *\n * @category Web component\n */\ninterface CdsAiChatCustomElementAttributes extends PublicConfig {\n /**\n * This function is called before the render function of Carbon AI Chat is called. This function can return a Promise\n * which will cause Carbon AI Chat to wait for it before rendering.\n */\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of Carbon AI Chat is called.\n */\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * An optional listener for \"view:change\" events. Such a listener is required when using a custom element in order\n * to control the visibility of the Carbon AI Chat main window. If no callback is provided here, a default one will be\n * used that injects styling into the app that will show and hide the Carbon AI Chat main window and also change the\n * size of the custom element so it doesn't take up space when the main window is closed.\n *\n * You can provide a different callback here if you want custom behavior such as an animation when the main window\n * is opened or closed.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded. After Carbon AI Chat is loaded, the event\n * handler will not be updated.\n */\n onViewChange?: (event: BusEventViewChange, instance: ChatInstance) => void;\n}\n\nexport { CdsAiChatCustomElementAttributes };\n\nexport default ChatCustomElement;\n"],"names":["ChatCustomElement","ChatCustomElement_1","LitElement","constructor","this","_userDefinedSlotNames","_writeableElementSlots","defaultViewChangeHandler","event","newViewState","mainWindow","classList","remove","add","userDefinedHandler","slot","data","includes","onBeforeRenderOverride","async","instance","_instance","on","type","BusEventType","VIEW_CHANGE","handler","onViewChange","USER_DEFINED_RESPONSE","CHUNK_USER_DEFINED_RESPONSE","addWriteableElementSlots","onBeforeRender","createRenderRoot","root","super","adoptedStyleSheets","hideSheet","resolvedConfig","baseConfig","config","onError","undefined","openChatByDefault","disclaimer","disableCustomElementMobileEnhancements","debug","exposeServiceManagerForTesting","injectCarbonTheme","serviceDeskFactory","serviceDesk","shouldTakeFocusIfOpensAutomatically","namespace","enableFocusTrap","shouldSanitizeHTML","header","input","layout","messaging","isReadonly","assistantName","locale","homescreen","launcher","strings","aiDisabled","aiEnabled","Object","keys","writeableElements","render","html","onAfterRender","map","CSSStyleSheet","replaceSync","__decorate","property","attribute","prototype","Boolean","String","converter","fromAttribute","value","v","trim","toLowerCase","falsey","state","carbonElement","ChatCustomElement$1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAMA,oBAAiBC,sBAAvB,MAAMD,0BAA0BE;EAAhC,WAAAC;;IAgLUC,KAAAC,wBAAkC;IAGlCD,KAAAE,yBAAmC;IAKnCF,KAAAG,2BAA4BC;MAClC,IAAIA,MAAMC,aAAaC,YAAY;QACjCN,KAAKO,UAAUC,OAAO;AACxB,aAAO;QACLR,KAAKO,UAAUE,IAAI;AACrB;;IAGMT,KAAAU,qBACNN;MAEA,OA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W,WAAW;MACC7E,kBAAA8E,WAAA;;AAItCH,WAAA,EADCC,SAAS;EAAErD,MAAM2C;MACkBlE,kBAAA8E,WAAA;;AAOpCH,WAAA,EADCC,SAAS;EAAEC,WAAW;MAC2C7E,kBAAA8E,WAAA;;AAMlEH,WAAA,EADCC,SAAS;EAAEC,WAAW;MAC0C7E,kBAAA8E,WAAA;;AAejEH,WAAA,EADCC,cAC0E5E,kBAAA8E,WAAA;;AAGnEH,WAAA,EADPa,WAC4CxF,kBAAA8E,WAAA;;AAGrCH,WAAA,EADPa,WAC6CxF,kBAAA8E,WAAA;;AAGtCH,WAAA,EADPa,WACgCxF,kBAAA8E,WAAA;;AAtL7B9E,oBAAiBC,sBAAA0E,WAAA,EADtBc,cAAc,gCACTzF;;AA4WN,IAAA0F,sBAAe1F;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/web-components/cds-custom-aichat-custom-element/index.ts"],"sourcesContent":["/*\n * Copyright IBM Corp. 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @license\n */\n\n// Ensure the container custom element is registered whenever the\n// custom element module is imported by re-exporting its exports.\n// This prevents bundlers (and our own multi-entry Rollup build)\n// from pruning the side-effect-only import.\nexport { default as __cds-custom_aichat_container_register } from \"../cds-custom-aichat-container\";\nimport \"../cds-custom-aichat-container\";\n\nimport { html, LitElement } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\n\nimport { carbonElement } from \"@carbon/ai-chat-components/es/globals/decorators/index.js\";\nimport {\n PublicConfig,\n OnErrorData,\n DisclaimerPublicConfig,\n CarbonTheme,\n HeaderConfig,\n LayoutConfig,\n PublicConfigMessaging,\n LanguagePack,\n InputConfig,\n} from \"../../types/config/PublicConfig\";\nimport { DeepPartial } from \"../../types/utilities/DeepPartial\";\nimport { HomeScreenConfig } from \"../../types/config/HomeScreenConfig\";\nimport { LauncherConfig } from \"../../types/config/LauncherConfig\";\nimport type {\n ServiceDesk,\n ServiceDeskFactoryParameters,\n ServiceDeskPublicConfig,\n} from \"../../types/config/ServiceDeskConfig\";\nimport { ChatInstance } from \"../../types/instance/ChatInstance\";\nimport {\n BusEventChunkUserDefinedResponse,\n BusEventType,\n BusEventUserDefinedResponse,\n BusEventViewChange,\n BusEventViewPreChange,\n} from \"../../types/events/eventBusTypes\";\n\n/**\n * cds-custom-aichat-custom-element will is a pass through to cds-custom-aichat-container. It takes any user_defined and writeable element\n * slotted content and forwards it to cds-custom-aichat-container. It also will setup the custom element with a default viewChange\n * pattern (e.g. hiding and showing the custom element when the chat should be open/closed) if a onViewChange property is not\n * defined. Finally, it registers the custom element with cds-custom-aichat-container so a default \"floating\" element will not be created.\n *\n * The custom element should be sized using external CSS. When hidden, the 'cds-custom-aichat--hidden' class is added to set dimensions to 0x0.\n */\n@carbonElement(\"cds-custom-aichat-custom-element\")\nclass ChatCustomElement extends LitElement {\n @property({ attribute: false, type: Object })\n config?: PublicConfig;\n\n /**\n * Shared stylesheet for hiding styles.\n */\n private static hideSheet = new CSSStyleSheet();\n static {\n // Hide styles that override any external sizing\n ChatCustomElement.hideSheet.replaceSync(`\n :host {\n display: block;\n }\n :host(.cds-custom-aichat--hidden) {\n width: 0 !important;\n height: 0 !important;\n min-width: 0 !important;\n min-height: 0 !important;\n max-width: 0 !important;\n max-height: 0 !important;\n inline-size: 0 !important;\n block-size: 0 !important;\n min-inline-size: 0 !important;\n min-block-size: 0 !important;\n max-inline-size: 0 !important;\n max-block-size: 0 !important;\n overflow: hidden !important;\n display: block !important;\n }\n `);\n }\n\n /**\n * Adopt our stylesheet into every shadowRoot.\n */\n protected createRenderRoot(): ShadowRoot {\n // Lits default createRenderRoot actually returns a ShadowRoot\n const root = super.createRenderRoot() as ShadowRoot;\n\n // now TS knows root.adoptedStyleSheets exists\n root.adoptedStyleSheets = [\n ...root.adoptedStyleSheets,\n ChatCustomElement.hideSheet,\n ];\n return root;\n }\n\n // Flattened PublicConfig properties\n @property({ attribute: false })\n onError?: (data: OnErrorData) => void;\n\n @property({ type: Boolean, attribute: \"open-chat-by-default\" })\n openChatByDefault?: boolean;\n\n @property({ type: Object })\n disclaimer?: DisclaimerPublicConfig;\n\n @property({\n type: Boolean,\n attribute: \"disable-custom-element-mobile-enhancements\",\n })\n disableCustomElementMobileEnhancements?: boolean;\n\n @property({ type: Boolean })\n debug?: boolean;\n\n @property({ type: Boolean, attribute: \"expose-service-manager-for-testing\" })\n exposeServiceManagerForTesting?: boolean;\n\n @property({ type: String, attribute: \"inject-carbon-theme\" })\n injectCarbonTheme?: CarbonTheme;\n\n @property({\n attribute: \"ai-enabled\",\n converter: {\n fromAttribute: (value: string | null) => {\n if (value === null) {\n return undefined;\n }\n const v = String(value).trim().toLowerCase();\n const falsey = v === \"false\" || v === \"0\" || v === \"off\" || v === \"no\";\n return !falsey;\n },\n },\n })\n aiEnabled?: boolean;\n\n @property({ type: Boolean, attribute: \"ai-disabled\" })\n aiDisabled?: boolean;\n\n @property({\n type: Boolean,\n attribute: \"should-take-focus-if-opens-automatically\",\n })\n shouldTakeFocusIfOpensAutomatically?: boolean;\n\n @property({ type: String })\n namespace?: string;\n\n @state()\n private enableFocusTrap?: boolean;\n\n @property({ type: Boolean, attribute: \"should-sanitize-html\" })\n shouldSanitizeHTML?: boolean;\n\n @property({ type: Object })\n header?: HeaderConfig;\n\n @property({ type: Object })\n input?: InputConfig;\n\n @property({ type: Object })\n layout?: LayoutConfig;\n\n @property({ type: Object })\n messaging?: PublicConfigMessaging;\n\n @property({ type: Boolean, attribute: \"is-readonly\" })\n isReadonly?: boolean;\n\n @property({ type: String, attribute: \"assistant-name\" })\n assistantName?: string;\n\n @property({ type: String })\n locale?: string;\n\n @property({ type: Object })\n homescreen?: HomeScreenConfig;\n\n @property({ type: Object })\n launcher?: LauncherConfig;\n\n /** A factory for the {@link ServiceDesk} integration. */\n @property({ attribute: false })\n serviceDeskFactory?: (\n parameters: ServiceDeskFactoryParameters,\n ) => Promise<ServiceDesk>;\n\n /** Public configuration for the service desk integration. */\n @property({ type: Object, attribute: \"service-desk\" })\n serviceDesk?: ServiceDeskPublicConfig;\n\n /** Optional partial language pack overrides */\n @property({ type: Object })\n strings?: DeepPartial<LanguagePack>;\n\n /**\n * This function is called before the render function of Carbon AI Chat is called. This function can return a Promise\n * which will cause Carbon AI Chat to wait for it before rendering.\n */\n @property({ attribute: false })\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of Carbon AI Chat is called.\n */\n @property({ attribute: false })\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * Called before a view change (chat opening/closing). The chat will hide the chat shell inside your custom element\n * to prevent invisible keyboard stops when the view change is complete.\n *\n * Use this callback to update your CSS class name values on this element before the view change happens if you want to add any open/close\n * animations to your custom element before the chat shell inner contents are hidden. It is async and so you can\n * tie it to native the AnimationEvent and only return when your animations have completed.\n *\n * A common pattern is to use this for when the chat is closing and to use onViewChange for when the chat opens.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded as it is registered before the\n * chat renders. After Carbon AI Chat is loaded, the callback will not be updated.\n */\n @property()\n onViewPreChange?: (event: BusEventViewPreChange) => Promise<void> | void;\n\n /**\n * Called when the chat view change is complete. If no callback is provided here, the default behavior will be to set\n * the chat shell to 0x0 size and set all inner contents aside from the launcher, if you are using it, to display: none.\n * The inner contents of the chat shell (aside from the launcher if you are using it) are always set to display: none\n * regardless of what is configured with this callback to prevent invisible tab stops and screen reader issues.\n *\n * Use this callback to update your className value when the chat has finished being opened or closed.\n *\n * You can provide a different callback here if you want custom animation behavior when the chat is opened or closed.\n * The animation behavior defined here will run in concert with the chat inside your custom container being hidden.\n *\n * If you want to run animations before the inner contents of the chat shell is shrunk and the inner contents are hidden,\n * make use of onViewPreChange.\n *\n * A common pattern is to use this for when the chat is opening and to use onViewPreChange for when the chat closes.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded as it is registered before the\n * chat renders. After Carbon AI Chat is loaded, the callback will not be updated.\n */\n @property()\n onViewChange?: (event: BusEventViewChange, instance: ChatInstance) => void;\n\n @state()\n private _userDefinedSlotNames: string[] = [];\n\n @state()\n private _writeableElementSlots: string[] = [];\n\n @state()\n private _instance!: ChatInstance;\n\n private defaultViewChangeHandler = (event: BusEventViewChange) => {\n if (event.newViewState.mainWindow) {\n this.classList.remove(\"cds-custom-aichat--hidden\");\n } else {\n this.classList.add(\"cds-custom-aichat--hidden\");\n }\n };\n\n private userDefinedHandler = (\n event: BusEventUserDefinedResponse | BusEventChunkUserDefinedResponse,\n ) => {\n const { slot } = event.data;\n if (!this._userDefinedSlotNames.includes(slot)) {\n this._userDefinedSlotNames = [...this._userDefinedSlotNames, slot];\n }\n };\n\n private get resolvedConfig(): PublicConfig {\n const baseConfig = this.config ?? {};\n const resolvedConfig: PublicConfig = { ...baseConfig };\n\n if (this.onError !== undefined) {\n resolvedConfig.onError = this.onError;\n }\n if (this.openChatByDefault !== undefined) {\n resolvedConfig.openChatByDefault = this.openChatByDefault;\n }\n if (this.disclaimer !== undefined) {\n resolvedConfig.disclaimer = this.disclaimer;\n }\n if (this.disableCustomElementMobileEnhancements !== undefined) {\n resolvedConfig.disableCustomElementMobileEnhancements =\n this.disableCustomElementMobileEnhancements;\n }\n if (this.debug !== undefined) {\n resolvedConfig.debug = this.debug;\n }\n if (this.exposeServiceManagerForTesting !== undefined) {\n resolvedConfig.exposeServiceManagerForTesting =\n this.exposeServiceManagerForTesting;\n }\n if (this.injectCarbonTheme !== undefined) {\n resolvedConfig.injectCarbonTheme = this.injectCarbonTheme;\n }\n if (this.serviceDeskFactory !== undefined) {\n resolvedConfig.serviceDeskFactory = this.serviceDeskFactory;\n }\n if (this.serviceDesk !== undefined) {\n resolvedConfig.serviceDesk = this.serviceDesk;\n }\n if (this.shouldTakeFocusIfOpensAutomatically !== undefined) {\n resolvedConfig.shouldTakeFocusIfOpensAutomatically =\n this.shouldTakeFocusIfOpensAutomatically;\n }\n if (this.namespace !== undefined) {\n resolvedConfig.namespace = this.namespace;\n }\n if (this.enableFocusTrap !== undefined) {\n resolvedConfig.enableFocusTrap = this.enableFocusTrap;\n }\n if (this.shouldSanitizeHTML !== undefined) {\n resolvedConfig.shouldSanitizeHTML = this.shouldSanitizeHTML;\n }\n if (this.header !== undefined) {\n resolvedConfig.header = this.header;\n }\n if (this.input !== undefined) {\n resolvedConfig.input = this.input;\n }\n if (this.layout !== undefined) {\n resolvedConfig.layout = this.layout;\n }\n if (this.messaging !== undefined) {\n resolvedConfig.messaging = this.messaging;\n }\n if (this.isReadonly !== undefined) {\n resolvedConfig.isReadonly = this.isReadonly;\n }\n if (this.assistantName !== undefined) {\n resolvedConfig.assistantName = this.assistantName;\n }\n if (this.locale !== undefined) {\n resolvedConfig.locale = this.locale;\n }\n if (this.homescreen !== undefined) {\n resolvedConfig.homescreen = this.homescreen;\n }\n if (this.launcher !== undefined) {\n resolvedConfig.launcher = this.launcher;\n }\n if (this.strings !== undefined) {\n resolvedConfig.strings = this.strings;\n }\n\n if (this.aiDisabled === true) {\n resolvedConfig.aiEnabled = false;\n } else if (this.aiEnabled !== undefined) {\n resolvedConfig.aiEnabled = this.aiEnabled;\n }\n\n return resolvedConfig;\n }\n\n private onBeforeRenderOverride = async (instance: ChatInstance) => {\n this._instance = instance;\n if (this.onViewPreChange) {\n this._instance.on({\n type: BusEventType.VIEW_PRE_CHANGE,\n handler: this.onViewPreChange,\n });\n }\n this._instance.on({\n type: BusEventType.VIEW_CHANGE,\n handler: this.onViewChange || this.defaultViewChangeHandler,\n });\n this._instance.on({\n type: BusEventType.USER_DEFINED_RESPONSE,\n handler: this.userDefinedHandler,\n });\n this._instance.on({\n type: BusEventType.CHUNK_USER_DEFINED_RESPONSE,\n handler: this.userDefinedHandler,\n });\n this.addWriteableElementSlots();\n await this.onBeforeRender?.(instance);\n };\n\n private addWriteableElementSlots() {\n this._writeableElementSlots = Object.keys(this._instance.writeableElements);\n }\n\n render() {\n return html`\n <cds-custom-aichat-container\n .config=${this.resolvedConfig}\n .onAfterRender=${this.onAfterRender}\n .onBeforeRender=${this.onBeforeRenderOverride}\n .element=${this}\n >\n ${this._writeableElementSlots.map(\n (slot) => html`<div slot=${slot}><slot name=${slot}></slot></div>`,\n )}\n ${this._userDefinedSlotNames.map(\n (slot) => html`<div slot=${slot}><slot name=${slot}></slot></div>`,\n )}\n </cds-custom-aichat-container>\n `;\n }\n}\n\n/**\n * Attributes interface for the cds-custom-aichat-custom-element web component.\n * This interface extends {@link CdsAiChatContainerAttributes} and {@link PublicConfig} with additional component-specific props,\n * flattening all config properties as top-level properties for better TypeScript IntelliSense.\n *\n * @category Web component\n */\ninterface CdsAiChatCustomElementAttributes extends PublicConfig {\n /**\n * This function is called before the render function of Carbon AI Chat is called. This function can return a Promise\n * which will cause Carbon AI Chat to wait for it before rendering.\n */\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of Carbon AI Chat is called.\n */\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * An optional listener for \"view:change\" events. Such a listener is required when using a custom element in order\n * to control the visibility of the Carbon AI Chat main window. If no callback is provided here, a default one will be\n * used that injects styling into the app that will show and hide the Carbon AI Chat main window and also change the\n * size of the custom element so it doesn't take up space when the main window is closed.\n *\n * You can provide a different callback here if you want custom behavior such as an animation when the main window\n * is opened or closed.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded. After Carbon AI Chat is loaded, the event\n * handler will not be updated.\n */\n onViewChange?: (event: BusEventViewChange, instance: ChatInstance) => void;\n}\n\nexport { CdsAiChatCustomElementAttributes };\n\nexport default ChatCustomElement;\n"],"names":["ChatCustomElement","ChatCustomElement_1","LitElement","constructor","this","_userDefinedSlotNames","_writeableElementSlots","defaultViewChangeHandler","event","newViewState","mainWindow","classList","remove","add","userDefinedHandler","slot","data","includes","onBeforeRenderOverride","async","instance","_instance","onViewPreChange","on","type","BusEventType","VIEW_PRE_CHANGE","handler","VIEW_CHANGE","onViewChange","USER_DEFINED_RESPONSE","CHUNK_USER_DEFINED_RESPONSE","addWriteableElementSlots","onBeforeRender","createRenderRoot","root","super","adoptedStyleSheets","hideSheet","resolvedConfig","baseConfig","config","onError","undefined","openChatByDefault","disclaimer","disableCustomElementMobileEnhancements","debug","exposeServiceManagerForTesting","injectCarbonTheme","serviceDeskFactory","serviceDesk","shouldTakeFocusIfOpensAutomatically","namespace","enableFocusTrap","shouldSanitizeHTML","header","input","layout","messaging","isReadonly","assistantName","locale","homescreen","launcher","strings","aiDisabled","aiEnabled","Object","keys","writeableElements","render","html","onAfterRender","map","CSSStyleSheet","replaceSync","__decorate","property","attribute","prototype","Boolean","String","converter","fromAttribute","value","v","trim","toLowerCase","falsey","state","carbonElement","ChatCustomElement$1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAMA,oBAAiBC,sBAAvB,MAAMD,0BAA0BE;EAAhC,WAAAC;;IAuMUC,KAAAC,wBAAkC;IAGlCD,KAAAE,yBAAmC;IAKnCF,KAAAG,2BAA4BC;MAClC,IAAIA,MAAMC,aAAaC,YAAY;QACjCN,KAAKO,UAAUC,OAAO;AACxB,aAAO;QACLR,KAAKO,UAAUE,IAAI;AACrB;;IAGMT,KAAAU,qBACNN;MAEA,OAAMO,MAAEA,QAASP,MAAMQ;MACvB,KAAKZ,KAAKC,sBAAsBY,SAASF,OAAO;QAC9CX,KAAKC,wBAAwB,KAAID,KAAKC,uBAAuBU;AAC/D;;IAyFMX,KAAAc,yBAAyBC,MAAOC;MACtChB,KAAKiB,YAAYD;MACjB,IAAIhB,K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AS;EAAEtD,MAAM4C;MACkBpE,kBAAAgF,WAAA;;AAOpCH,WAAA,EADCC,SAAS;EAAEC,WAAW;MAC2C/E,kBAAAgF,WAAA;;AAMlEH,WAAA,EADCC,SAAS;EAAEC,WAAW;MAC0C/E,kBAAAgF,WAAA;;AAgBjEH,WAAA,EADCC,cACwE9E,kBAAAgF,WAAA;;AAsBzEH,WAAA,EADCC,cAC0E9E,kBAAAgF,WAAA;;AAGnEH,WAAA,EADPa,WAC4C1F,kBAAAgF,WAAA;;AAGrCH,WAAA,EADPa,WAC6C1F,kBAAAgF,WAAA;;AAGtCH,WAAA,EADPa,WACgC1F,kBAAAgF,WAAA;;AA7M7BhF,oBAAiBC,sBAAA4E,WAAA,EADtBc,cAAc,gCACT3F;;AAyYN,IAAA4F,sBAAe5F;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChatContainerProps, B as
|
|
2
|
-
export { ar as AdditionalDataToAgent, as as AgentAvailability, aO as AudioItem, aJ as BaseGenericItem, aP as BaseMessageInput,
|
|
1
|
+
import { C as ChatContainerProps, B as BusEventViewPreChange, a as ChatInstance, b as BusEventViewChange } from './serverEntry-Cad3Ek2W.js';
|
|
2
|
+
export { ar as AdditionalDataToAgent, as as AgentAvailability, aO as AudioItem, aJ as BaseGenericItem, aP as BaseMessageInput, p as BusEvent, y as BusEventChatReady, z as BusEventChunkUserDefinedResponse, A as BusEventClosePanelButtonClicked, D as BusEventCustomPanelClose, G as BusEventCustomPanelOpen, H as BusEventCustomPanelPreClose, J as BusEventCustomPanelPreOpen, K as BusEventFeedback, M as BusEventHistoryBegin, O as BusEventHistoryEnd, q as BusEventHumanAgentAreAnyAgentsOnline, r as BusEventHumanAgentEndChat, s as BusEventHumanAgentPreEndChat, t as BusEventHumanAgentPreReceive, u as BusEventHumanAgentPreSend, v as BusEventHumanAgentPreStartChat, w as BusEventHumanAgentReceive, x as BusEventHumanAgentSend, Q as BusEventMessageItemCustom, R as BusEventPreReceive, U as BusEventPreReset, X as BusEventPreSend, Y as BusEventReceive, Z as BusEventReset, _ as BusEventSend, $ as BusEventType, a0 as BusEventUserDefinedResponse, aQ as ButtonItem, aR as ButtonItemKind, aS as ButtonItemType, a8 as CancellationReason, ab as CarbonTheme, aT as CardItem, aU as CarouselItem, bN as CdsAiChatContainerAttributes, bO as CdsAiChatCustomElementAttributes, bz as ChainOfThoughtStep, bA as ChainOfThoughtStepStatus, h as ChangeFunction, d as ChatHeaderConfig, a9 as ChatInstanceMessaging, i as ChatInstanceNotifications, j as ChatInstanceServiceDeskActions, aV as Chunk, aW as CompleteItemChunk, aX as ConnectToHumanAgentItem, aY as ConnectToHumanAgentItemTransferInfo, au as ConnectingErrorInfo, aZ as ConversationalSearchItem, a_ as ConversationalSearchItemCitation, o as CornersType, ac as CustomMenuOption, e as CustomPanelConfigOptions, f as CustomPanelInstance, g as CustomPanels, aa as CustomSendMessageOptions, a$ as DateItem, ap as DeepPartial, ad as DisclaimerPublicConfig, av as DisconnectedErrorInfo, aw as EndChatInfo, ax as ErrorType, E as EventBusHandler, k as EventHandlers, b0 as EventInput, b1 as EventInputData, a1 as FeedbackInteractionType, ay as FileStatusValue, az as FileUpload, F as FileUploadCapabilities, b2 as FinalResponseChunk, b3 as GenericItem, b4 as GenericItemMessageFeedbackCategories, bB as GenericItemMessageFeedbackOptions, bC as GenericItemMessageOptions, b5 as GridItem, af as HeaderConfig, bJ as HistoryItem, a4 as HomeScreenConfig, a5 as HomeScreenStarterButton, a6 as HomeScreenStarterButtons, a7 as HomeScreenState, b6 as HorizontalCellAlignment, by as HumanAgentMessageType, at as HumanAgentsOnlineStatus, b7 as IFrameItem, b8 as IFrameItemDisplayOption, b9 as ImageItem, I as IncreaseOrDecrease, ba as InlineErrorItem, ag as InputConfig, bb as ItemStreamingMetadata, ah as LanguagePack, bL as LauncherCallToActionConfig, bM as LauncherConfig, ai as LayoutConfig, L as LayoutCustomProperties, bc as MediaItem, bd as MediaItemDimensions, bD as Message, bK as MessageErrorState, bG as MessageHistoryFeedback, be as MessageInput, bf as MessageInputType, bg as MessageItemPanelInfo, bh as MessageOutput, bi as MessageRequest, aM as MessageRequestHistory, bj as MessageResponse, aL as MessageResponseHistory, aK as MessageResponseOptions, bk as MessageResponseTypes, a2 as MessageSendSource, aj as MinimizeButtonIconType, N as NotificationMessage, aq as ObjectMap, ak as OnErrorData, al as OnErrorType, bl as OptionItem, bm as OptionItemPreference, bS as PageObjectId, bn as PartialItemChunk, bE as PartialOrCompleteItemChunk, bF as PartialResponse, bo as PauseItem, ao as PersistedHumanAgentState, P as PersistedState, l as PublicChatHumanAgentState, m as PublicChatState, am as PublicConfig, an as PublicConfigMessaging, bP as RenderUserDefinedResponse, bQ as RenderUserDefinedState, bR as RenderWriteableElementResponse, aN as ResponseUserProfile, aA as ScreenShareState, bH as SearchResult, S as SendOptions, aB as ServiceDesk, aC as ServiceDeskCallback, aD as ServiceDeskCapabilities, aE as ServiceDeskErrorInfo, aF as ServiceDeskFactoryParameters, aG as ServiceDeskPublicConfig, bx as SingleOption, aH as StartChatOptions, bp as StreamChunk, bT as TestId, bq as TextItem, T as TypeAndHandler, br as UserDefinedItem, aI as UserMessageErrorInfo, bI as UserType, bs as VerticalCellAlignment, bt as VideoItem, a3 as ViewChangeReason, V as ViewState, c as ViewType, bu as WidthOptions, bv as WithBodyAndFooter, bw as WithWidthOptions, W as WriteableElementName, n as WriteableElements, ae as enLanguagePack } from './serverEntry-Cad3Ek2W.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import '@carbon/web-components/es/components/notification/defs.js';
|
|
5
5
|
import '@carbon/web-components/es/components/button/defs.js';
|
|
@@ -25,7 +25,12 @@ declare function ChatContainer(props: ChatContainerProps): React.JSX.Element;
|
|
|
25
25
|
interface ChatCustomElementProps extends ChatContainerProps {
|
|
26
26
|
/**
|
|
27
27
|
* A CSS class name that will be added to the custom element. This class must define the size of the
|
|
28
|
-
*
|
|
28
|
+
* your custom element (width and height or using logical inline-size/block-size).
|
|
29
|
+
*
|
|
30
|
+
* You can make use of onViewPreChange and/or onViewChange to mutate this className value so have open/close animations.
|
|
31
|
+
*
|
|
32
|
+
* By default, the chat will just set the chat shell to a 0x0 size and mark everything but the launcher (is you are using it)
|
|
33
|
+
* as display: none; if the chat is set to closed.
|
|
29
34
|
*/
|
|
30
35
|
className: string;
|
|
31
36
|
/**
|
|
@@ -33,16 +38,37 @@ interface ChatCustomElementProps extends ChatContainerProps {
|
|
|
33
38
|
*/
|
|
34
39
|
id?: string;
|
|
35
40
|
/**
|
|
36
|
-
*
|
|
37
|
-
* to
|
|
38
|
-
*
|
|
39
|
-
*
|
|
41
|
+
* Called before a view change (chat opening/closing). The chat will hide the chat shell inside your custom element
|
|
42
|
+
* to prevent invisible keyboard stops when the view change is *complete*.
|
|
43
|
+
*
|
|
44
|
+
* Use this callback to update your className value *before* the view change happens if you want to add any open/close
|
|
45
|
+
* animations to your custom element before the chat shell inner contents are hidden. It is async and so you can
|
|
46
|
+
* tie it to native the AnimationEvent and only return when your animations have completed.
|
|
47
|
+
*
|
|
48
|
+
* A common pattern is to use this for when the chat is closing and to use onViewChange for when the chat opens.
|
|
49
|
+
*
|
|
50
|
+
* Note that this function can only be provided before Carbon AI Chat is loaded as it is registered before the
|
|
51
|
+
* chat renders. After Carbon AI Chat is loaded, the callback will not be updated.
|
|
52
|
+
*/
|
|
53
|
+
onViewPreChange?: (event: BusEventViewPreChange, instance: ChatInstance) => Promise<void> | void;
|
|
54
|
+
/**
|
|
55
|
+
* Called when the chat view change is complete. If no callback is provided here, the default behavior will be to set
|
|
56
|
+
* the chat shell to 0x0 size and set all inner contents aside from the launcher, if you are using it, to display: none.
|
|
57
|
+
* The inner contents of the chat shell (aside from the launcher if you are using it) are always set to display: none
|
|
58
|
+
* regardless of what is configured with this callback to prevent invisible tab stops and screen reader issues.
|
|
59
|
+
*
|
|
60
|
+
* Use this callback to update your className value when the chat has finished being opened or closed.
|
|
61
|
+
*
|
|
62
|
+
* You can provide a different callback here if you want custom animation behavior when the chat is opened or closed.
|
|
63
|
+
* The animation behavior defined here will run in concert with the chat inside your custom container being hidden.
|
|
64
|
+
*
|
|
65
|
+
* If you want to run animations before the inner contents of the chat shell is shrunk and the inner contents are hidden,
|
|
66
|
+
* make use of onViewPreChange.
|
|
40
67
|
*
|
|
41
|
-
*
|
|
42
|
-
* is opened or closed.
|
|
68
|
+
* A common pattern is to use this for when the chat is opening and to use onViewPreChange for when the chat closes.
|
|
43
69
|
*
|
|
44
|
-
* Note that this function can only be provided before Carbon AI Chat is loaded
|
|
45
|
-
*
|
|
70
|
+
* Note that this function can only be provided before Carbon AI Chat is loaded as it is registered before the
|
|
71
|
+
* chat renders. After Carbon AI Chat is loaded, the callback will not be updated.
|
|
46
72
|
*/
|
|
47
73
|
onViewChange?: (event: BusEventViewChange, instance: ChatInstance) => void;
|
|
48
74
|
}
|
|
@@ -57,5 +83,5 @@ interface ChatCustomElementProps extends ChatContainerProps {
|
|
|
57
83
|
*/
|
|
58
84
|
declare function ChatCustomElement(props: ChatCustomElementProps): React.JSX.Element;
|
|
59
85
|
|
|
60
|
-
export { BusEventViewChange, ChatContainer, ChatContainerProps, ChatCustomElement, ChatInstance };
|
|
86
|
+
export { BusEventViewChange, BusEventViewPreChange, ChatContainer, ChatContainerProps, ChatCustomElement, ChatInstance };
|
|
61
87
|
export type { ChatCustomElementProps };
|
|
@@ -2314,10 +2314,6 @@ declare enum ViewChangeReason {
|
|
|
2314
2314
|
* Indicates the user clicked on our built-in minimize button that closed the launcher.
|
|
2315
2315
|
*/
|
|
2316
2316
|
MAIN_WINDOW_MINIMIZED = "mainWindowMinimized",
|
|
2317
|
-
/**
|
|
2318
|
-
* Indicates the user clicked the close and restart button that minimized to the launcher.
|
|
2319
|
-
*/
|
|
2320
|
-
MAIN_WINDOW_CLOSED_AND_RESTARTED = "mainWindowClosedAndRestarted",
|
|
2321
2317
|
/**
|
|
2322
2318
|
* Indicates the view was changed by a call to {@link ChatInstance.changeView}.
|
|
2323
2319
|
*/
|
|
@@ -4430,5 +4426,5 @@ declare enum PageObjectId {
|
|
|
4430
4426
|
*/
|
|
4431
4427
|
type TestId = PageObjectId;
|
|
4432
4428
|
|
|
4433
|
-
export { LayoutCustomProperties as L, WriteableElementName as W,
|
|
4434
|
-
export type {
|
|
4429
|
+
export { BusEventType as $, LayoutCustomProperties as L, WriteableElementName as W, FeedbackInteractionType as a1, MessageSendSource as a2, ViewChangeReason as a3, CancellationReason as a8, ScreenShareState as aA, ButtonItemKind as aR, ButtonItemType as aS, CarbonTheme as ab, enLanguagePack as ae, MinimizeButtonIconType as aj, OnErrorType as al, HumanAgentsOnlineStatus as at, ErrorType as ax, FileStatusValue as ay, IFrameItemDisplayOption as b8, ChainOfThoughtStepStatus as bA, UserType as bI, MessageErrorState as bK, PageObjectId as bS, MessageInputType as bf, MessageResponseTypes as bk, OptionItemPreference as bm, WidthOptions as bu, HumanAgentMessageType as by, ViewType as c, CornersType as o };
|
|
4430
|
+
export type { BusEventClosePanelButtonClicked as A, BusEventViewPreChange as B, ChatContainerProps as C, BusEventCustomPanelClose as D, EventBusHandler as E, FileUploadCapabilities as F, BusEventCustomPanelOpen as G, BusEventCustomPanelPreClose as H, IncreaseOrDecrease as I, BusEventCustomPanelPreOpen as J, BusEventFeedback as K, BusEventHistoryBegin as M, NotificationMessage as N, BusEventHistoryEnd as O, PersistedState as P, BusEventMessageItemCustom as Q, BusEventPreReceive as R, SendOptions as S, TypeAndHandler as T, BusEventPreReset as U, ViewState as V, BusEventPreSend as X, BusEventReceive as Y, BusEventReset as Z, BusEventSend as _, ChatInstance as a, DateItem as a$, BusEventUserDefinedResponse as a0, HomeScreenConfig as a4, HomeScreenStarterButton as a5, HomeScreenStarterButtons as a6, HomeScreenState as a7, ChatInstanceMessaging as a9, ServiceDesk as aB, ServiceDeskCallback as aC, ServiceDeskCapabilities as aD, ServiceDeskErrorInfo as aE, ServiceDeskFactoryParameters as aF, ServiceDeskPublicConfig as aG, StartChatOptions as aH, UserMessageErrorInfo as aI, BaseGenericItem as aJ, MessageResponseOptions as aK, MessageResponseHistory as aL, MessageRequestHistory as aM, ResponseUserProfile as aN, AudioItem as aO, BaseMessageInput as aP, ButtonItem as aQ, CardItem as aT, CarouselItem as aU, Chunk as aV, CompleteItemChunk as aW, ConnectToHumanAgentItem as aX, ConnectToHumanAgentItemTransferInfo as aY, ConversationalSearchItem as aZ, ConversationalSearchItemCitation as a_, CustomSendMessageOptions as aa, CustomMenuOption as ac, DisclaimerPublicConfig as ad, HeaderConfig as af, InputConfig as ag, LanguagePack as ah, LayoutConfig as ai, OnErrorData as ak, PublicConfig as am, PublicConfigMessaging as an, PersistedHumanAgentState as ao, DeepPartial as ap, ObjectMap as aq, AdditionalDataToAgent as ar, AgentAvailability as as, ConnectingErrorInfo as au, DisconnectedErrorInfo as av, EndChatInfo as aw, FileUpload as az, BusEventViewChange as b, EventInput as b0, EventInputData as b1, FinalResponseChunk as b2, GenericItem as b3, GenericItemMessageFeedbackCategories as b4, GridItem as b5, HorizontalCellAlignment as b6, IFrameItem as b7, ImageItem as b9, GenericItemMessageFeedbackOptions as bB, GenericItemMessageOptions as bC, Message as bD, PartialOrCompleteItemChunk as bE, PartialResponse as bF, MessageHistoryFeedback as bG, SearchResult as bH, HistoryItem as bJ, LauncherCallToActionConfig as bL, LauncherConfig as bM, CdsAiChatContainerAttributes as bN, CdsAiChatCustomElementAttributes as bO, RenderUserDefinedResponse as bP, RenderUserDefinedState as bQ, RenderWriteableElementResponse as bR, TestId as bT, InlineErrorItem as ba, ItemStreamingMetadata as bb, MediaItem as bc, MediaItemDimensions as bd, MessageInput as be, MessageItemPanelInfo as bg, MessageOutput as bh, MessageRequest as bi, MessageResponse as bj, OptionItem as bl, PartialItemChunk as bn, PauseItem as bo, StreamChunk as bp, TextItem as bq, UserDefinedItem as br, VerticalCellAlignment as bs, VideoItem as bt, WithBodyAndFooter as bv, WithWidthOptions as bw, SingleOption as bx, ChainOfThoughtStep as bz, ChatHeaderConfig as d, CustomPanelConfigOptions as e, CustomPanelInstance as f, CustomPanels as g, ChangeFunction as h, ChatInstanceNotifications as i, ChatInstanceServiceDeskActions as j, EventHandlers as k, PublicChatHumanAgentState as l, PublicChatState as m, WriteableElements as n, BusEvent as p, BusEventHumanAgentAreAnyAgentsOnline as q, BusEventHumanAgentEndChat as r, BusEventHumanAgentPreEndChat as s, BusEventHumanAgentPreReceive as t, BusEventHumanAgentPreSend as u, BusEventHumanAgentPreStartChat as v, BusEventHumanAgentReceive as w, BusEventHumanAgentSend as x, BusEventChatReady as y, BusEventChunkUserDefinedResponse as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ar as AdditionalDataToAgent, as as AgentAvailability, aO as AudioItem, aJ as BaseGenericItem, aP as BaseMessageInput,
|
|
1
|
+
export { ar as AdditionalDataToAgent, as as AgentAvailability, aO as AudioItem, aJ as BaseGenericItem, aP as BaseMessageInput, p as BusEvent, y as BusEventChatReady, z as BusEventChunkUserDefinedResponse, A as BusEventClosePanelButtonClicked, D as BusEventCustomPanelClose, G as BusEventCustomPanelOpen, H as BusEventCustomPanelPreClose, J as BusEventCustomPanelPreOpen, K as BusEventFeedback, M as BusEventHistoryBegin, O as BusEventHistoryEnd, q as BusEventHumanAgentAreAnyAgentsOnline, r as BusEventHumanAgentEndChat, s as BusEventHumanAgentPreEndChat, t as BusEventHumanAgentPreReceive, u as BusEventHumanAgentPreSend, v as BusEventHumanAgentPreStartChat, w as BusEventHumanAgentReceive, x as BusEventHumanAgentSend, Q as BusEventMessageItemCustom, R as BusEventPreReceive, U as BusEventPreReset, X as BusEventPreSend, Y as BusEventReceive, Z as BusEventReset, _ as BusEventSend, $ as BusEventType, a0 as BusEventUserDefinedResponse, b as BusEventViewChange, B as BusEventViewPreChange, aQ as ButtonItem, aR as ButtonItemKind, aS as ButtonItemType, a8 as CancellationReason, ab as CarbonTheme, aT as CardItem, aU as CarouselItem, bN as CdsAiChatContainerAttributes, bO as CdsAiChatCustomElementAttributes, bz as ChainOfThoughtStep, bA as ChainOfThoughtStepStatus, d as ChatHeaderConfig, a as ChatInstance, a9 as ChatInstanceMessaging, i as ChatInstanceNotifications, j as ChatInstanceServiceDeskActions, aV as Chunk, aW as CompleteItemChunk, aX as ConnectToHumanAgentItem, aY as ConnectToHumanAgentItemTransferInfo, au as ConnectingErrorInfo, aZ as ConversationalSearchItem, a_ as ConversationalSearchItemCitation, o as CornersType, ac as CustomMenuOption, e as CustomPanelConfigOptions, f as CustomPanelInstance, g as CustomPanels, aa as CustomSendMessageOptions, a$ as DateItem, ap as DeepPartial, ad as DisclaimerPublicConfig, av as DisconnectedErrorInfo, aw as EndChatInfo, ax as ErrorType, E as EventBusHandler, k as EventHandlers, b0 as EventInput, b1 as EventInputData, a1 as FeedbackInteractionType, ay as FileStatusValue, az as FileUpload, F as FileUploadCapabilities, b2 as FinalResponseChunk, b3 as GenericItem, b4 as GenericItemMessageFeedbackCategories, bB as GenericItemMessageFeedbackOptions, bC as GenericItemMessageOptions, b5 as GridItem, af as HeaderConfig, bJ as HistoryItem, a4 as HomeScreenConfig, a5 as HomeScreenStarterButton, a6 as HomeScreenStarterButtons, a7 as HomeScreenState, b6 as HorizontalCellAlignment, by as HumanAgentMessageType, at as HumanAgentsOnlineStatus, b7 as IFrameItem, b8 as IFrameItemDisplayOption, b9 as ImageItem, I as IncreaseOrDecrease, ba as InlineErrorItem, ag as InputConfig, bb as ItemStreamingMetadata, ah as LanguagePack, bL as LauncherCallToActionConfig, bM as LauncherConfig, ai as LayoutConfig, L as LayoutCustomProperties, bc as MediaItem, bd as MediaItemDimensions, bD as Message, bK as MessageErrorState, bG as MessageHistoryFeedback, be as MessageInput, bf as MessageInputType, bg as MessageItemPanelInfo, bh as MessageOutput, bi as MessageRequest, aM as MessageRequestHistory, bj as MessageResponse, aL as MessageResponseHistory, aK as MessageResponseOptions, bk as MessageResponseTypes, a2 as MessageSendSource, aj as MinimizeButtonIconType, N as NotificationMessage, aq as ObjectMap, ak as OnErrorData, al as OnErrorType, bl as OptionItem, bm as OptionItemPreference, bS as PageObjectId, bn as PartialItemChunk, bE as PartialOrCompleteItemChunk, bF as PartialResponse, bo as PauseItem, ao as PersistedHumanAgentState, P as PersistedState, l as PublicChatHumanAgentState, m as PublicChatState, am as PublicConfig, an as PublicConfigMessaging, bP as RenderUserDefinedResponse, bQ as RenderUserDefinedState, bR as RenderWriteableElementResponse, aN as ResponseUserProfile, aA as ScreenShareState, bH as SearchResult, S as SendOptions, aB as ServiceDesk, aC as ServiceDeskCallback, aD as ServiceDeskCapabilities, aE as ServiceDeskErrorInfo, aF as ServiceDeskFactoryParameters, aG as ServiceDeskPublicConfig, bx as SingleOption, aH as StartChatOptions, bp as StreamChunk, bT as TestId, bq as TextItem, T as TypeAndHandler, br as UserDefinedItem, aI as UserMessageErrorInfo, bI as UserType, bs as VerticalCellAlignment, bt as VideoItem, a3 as ViewChangeReason, V as ViewState, c as ViewType, bu as WidthOptions, bv as WithBodyAndFooter, bw as WithWidthOptions, W as WriteableElementName, n as WriteableElements, ae as enLanguagePack } from './serverEntry-Cad3Ek2W.js';
|
|
2
2
|
import '@carbon/web-components/es/components/notification/defs.js';
|
|
3
3
|
import '@carbon/web-components/es/components/button/defs.js';
|
|
4
4
|
import 'react';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/ai-chat",
|
|
3
|
-
"version": "1.2.0-rc.
|
|
3
|
+
"version": "1.2.0-rc.2",
|
|
4
4
|
"description": "Be sure to review the [chat documentation](https://chat.carbondesignsystem.com/tag/latest/docs/documents/Overview.html).",
|
|
5
5
|
"author": "IBM Corp",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -171,5 +171,5 @@
|
|
|
171
171
|
"url": "https://github.com/carbon-design-system/carbon-ai-chat/issues"
|
|
172
172
|
},
|
|
173
173
|
"homepage": "https://github.com/carbon-design-system/carbon-ai-chat#readme",
|
|
174
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "629fa651e520f6c70f2d4b4b21bd422ca2155538"
|
|
175
175
|
}
|