@iblai/web-utils 1.2.7 → 1.2.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.
- package/dist/index.d.ts +5 -3
- package/dist/index.esm.js +17 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/web-utils/src/features/chat/slice.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -859,6 +859,7 @@ type ChatSliceState = {
|
|
|
859
859
|
href: string;
|
|
860
860
|
};
|
|
861
861
|
pageContent: string;
|
|
862
|
+
metadata: Record<string, string> | null;
|
|
862
863
|
};
|
|
863
864
|
documentFilter: Record<string, unknown> | null;
|
|
864
865
|
shouldStartNewChat: boolean;
|
|
@@ -910,6 +911,7 @@ declare const selectIframeContext: (state: {
|
|
|
910
911
|
href: string;
|
|
911
912
|
};
|
|
912
913
|
pageContent: string;
|
|
914
|
+
metadata: Record<string, string> | null;
|
|
913
915
|
};
|
|
914
916
|
declare const selectDocumentFilter: (state: {
|
|
915
917
|
chatSliceShared: ChatSliceState;
|
|
@@ -1527,7 +1529,7 @@ type Props$2 = {
|
|
|
1527
1529
|
* 4. Handles redirects to auth SPA when needed
|
|
1528
1530
|
* 5. Manages public route access state
|
|
1529
1531
|
*/
|
|
1530
|
-
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, skipAuthCheck, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1532
|
+
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, skipAuthCheck, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1531
1533
|
|
|
1532
1534
|
/**
|
|
1533
1535
|
* Props for the MentorProvider component
|
|
@@ -1560,7 +1562,7 @@ type Props$1 = {
|
|
|
1560
1562
|
* 3. Manages redirection based on mentor availability
|
|
1561
1563
|
* 4. Integrates with tenant context for access control
|
|
1562
1564
|
*/
|
|
1563
|
-
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1565
|
+
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1564
1566
|
|
|
1565
1567
|
/**
|
|
1566
1568
|
* Type definition for the tenant context
|
|
@@ -1623,7 +1625,7 @@ type Props = {
|
|
|
1623
1625
|
* 4. Handles tenant-specific domain redirects
|
|
1624
1626
|
* 5. Maintains tenant access state
|
|
1625
1627
|
*/
|
|
1626
|
-
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, }: Props): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1628
|
+
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, }: Props): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1627
1629
|
|
|
1628
1630
|
/**
|
|
1629
1631
|
* Chat area size constants
|
package/dist/index.esm.js
CHANGED
|
@@ -2822,12 +2822,22 @@ function useAuthProvider({ middleware = new Map(), onAuthSuccess, onAuthFailure,
|
|
|
2822
2822
|
return;
|
|
2823
2823
|
}
|
|
2824
2824
|
isRedirectingRef.current = true;
|
|
2825
|
-
//
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2825
|
+
// NOTE: we intentionally do NOT clear the interval here.
|
|
2826
|
+
// The isRedirectingRef guard prevents redundant redirects while navigation
|
|
2827
|
+
// is in progress. Clearing the interval preemptively can permanently stop
|
|
2828
|
+
// cross-SPA sync if the consuming app suppresses the redirect (e.g. during
|
|
2829
|
+
// its own concurrent tenant switch), leaving the page with no active poller.
|
|
2830
2830
|
redirectToAuthSpa(...args);
|
|
2831
|
+
// Safety recovery: if navigation was suppressed by the consuming app
|
|
2832
|
+
// (e.g. _suppressAuthRedirect was true), reset the guard after a short delay
|
|
2833
|
+
// so the interval can resume cross-SPA sync on its next tick.
|
|
2834
|
+
// If navigation did occur, the page will have unloaded before this fires.
|
|
2835
|
+
setTimeout(() => {
|
|
2836
|
+
if (isRedirectingRef.current) {
|
|
2837
|
+
console.log("[AuthProvider] safeRedirectToAuthSpa: navigation did not occur, resetting redirect guard");
|
|
2838
|
+
isRedirectingRef.current = false;
|
|
2839
|
+
}
|
|
2840
|
+
}, 3000);
|
|
2831
2841
|
};
|
|
2832
2842
|
/**
|
|
2833
2843
|
* Sync cookies to localStorage on mount and periodically (web only)
|
|
@@ -5904,6 +5914,7 @@ const initialState$3 = {
|
|
|
5904
5914
|
href: "",
|
|
5905
5915
|
},
|
|
5906
5916
|
pageContent: "",
|
|
5917
|
+
metadata: null,
|
|
5907
5918
|
},
|
|
5908
5919
|
documentFilter: null,
|
|
5909
5920
|
token: null,
|
|
@@ -8047,6 +8058,7 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
|
|
|
8047
8058
|
messageData = {
|
|
8048
8059
|
...messageData,
|
|
8049
8060
|
page_content: iframeContext.pageContent,
|
|
8061
|
+
metadata: iframeContext.metadata,
|
|
8050
8062
|
};
|
|
8051
8063
|
}
|
|
8052
8064
|
if (documentFilter) {
|