@carbon/ai-chat 1.11.0-rc.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/aiChatEntry.js +1 -1
- package/dist/es/chat.ChatAppEntry.js +3 -18
- package/dist/es/chat.ChatAppEntry.js.map +1 -1
- package/dist/es/web-components/cds-aichat-container/index.js +1 -1
- package/dist/es/web-components/cds-aichat-custom-element/index.js +1 -1
- package/dist/es-custom/aiChatEntry.js +1 -1
- package/dist/es-custom/chat.ChatAppEntry.js +3 -18
- package/dist/es-custom/chat.ChatAppEntry.js.map +1 -1
- package/dist/es-custom/web-components/cds-aichat-container/index.js +1 -1
- package/dist/es-custom/web-components/cds-aichat-custom-element/index.js +1 -1
- package/package.json +3 -3
- package/telemetry.yml +1 -0
package/dist/es/aiChatEntry.js
CHANGED
|
@@ -2,7 +2,7 @@ import isEqual from "lodash-es/isEqual.js";
|
|
|
2
2
|
|
|
3
3
|
import React, { useMemo, createContext, useContext, useRef, useCallback, useEffect, createElement, useState, useImperativeHandle, forwardRef, PureComponent, Component, Suspense, useLayoutEffect, Fragment } from "react";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/with-selector.js";
|
|
6
6
|
|
|
7
7
|
import { compute } from "compute-scroll-into-view";
|
|
8
8
|
|
|
@@ -220,7 +220,7 @@ import Toolbar from "@carbon/ai-chat-components/es/react/toolbar.js";
|
|
|
220
220
|
|
|
221
221
|
import CarbonChatButtonElement, { CHAT_BUTTON_SIZE as CHAT_BUTTON_SIZE$1, CHAT_BUTTON_KIND as CHAT_BUTTON_KIND$1 } from "@carbon/web-components/es/components/chat-button/chat-button.js";
|
|
222
222
|
|
|
223
|
-
const VERSION = "1.
|
|
223
|
+
const VERSION = "1.11.0";
|
|
224
224
|
|
|
225
225
|
function memoizeFunction(fn, isEqual) {
|
|
226
226
|
let hasResult = false;
|
|
@@ -394,26 +394,11 @@ function useStore() {
|
|
|
394
394
|
return store;
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
const useSyncExternalStore = React.useSyncExternalStore ?? useSyncExternalStore$1;
|
|
398
|
-
|
|
399
397
|
function useSelector(selector, equalityFn) {
|
|
400
398
|
const store = useStore();
|
|
401
|
-
|
|
402
|
-
const compare = equalityFn ?? Object.is;
|
|
403
|
-
const computeSelected = useCallback(() => {
|
|
404
|
-
const nextSelected = selector(store.getState());
|
|
405
|
-
const lastSelected = lastSelectedRef.current;
|
|
406
|
-
if (lastSelected !== UNINITIALIZED && compare(nextSelected, lastSelected)) {
|
|
407
|
-
return lastSelected;
|
|
408
|
-
}
|
|
409
|
-
lastSelectedRef.current = nextSelected;
|
|
410
|
-
return nextSelected;
|
|
411
|
-
}, [ store, selector, compare ]);
|
|
412
|
-
return useSyncExternalStore(store.subscribe, computeSelected, computeSelected);
|
|
399
|
+
return useSyncExternalStoreWithSelector(store.subscribe, store.getState, store.getState, selector, equalityFn);
|
|
413
400
|
}
|
|
414
401
|
|
|
415
|
-
const UNINITIALIZED = Symbol("useSelector.uninitialized");
|
|
416
|
-
|
|
417
402
|
const LanguagePackContext = React.createContext(null);
|
|
418
403
|
|
|
419
404
|
function LanguagePackProvider({children}) {
|