obi-sdk 0.23.2 → 0.23.3-beta.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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PanelPresentationNotification } from "obi-chat-web";
|
|
1
2
|
import type { ObiSDK, SidePanelStartRequest } from "./sdk";
|
|
2
3
|
export type SidePanelContainerProps = {
|
|
3
4
|
sdk: ObiSDK;
|
|
@@ -17,5 +18,9 @@ export type SidePanelContainerProps = {
|
|
|
17
18
|
sidePanelPipActive?: boolean;
|
|
18
19
|
/** Forwarded to obi-chat-web SdkPanel: keep PiP UI in the shadow host (no Document PiP window). */
|
|
19
20
|
preferHostPip?: boolean;
|
|
21
|
+
/** Initial idle presentation for the embedded panel. */
|
|
22
|
+
widgetType?: "sidepanel" | "launcher";
|
|
23
|
+
/** Reports whether the host should reserve space for the panel. */
|
|
24
|
+
onPresentationChange?: (state: PanelPresentationNotification) => void;
|
|
20
25
|
};
|
|
21
|
-
export declare function SidePanelContainer({ sdk, startRequest, shadowHost, onPipChange, onDocumentPipChange, documentPipActive, sidePanelPipActive, preferHostPip, }: SidePanelContainerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export declare function SidePanelContainer({ sdk, startRequest, shadowHost, onPipChange, onDocumentPipChange, documentPipActive, sidePanelPipActive, preferHostPip, widgetType, onPresentationChange, }: SidePanelContainerProps): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/src/sdk.d.ts
CHANGED
|
@@ -55,6 +55,9 @@ export declare class ObiSDK extends EventEmitter<ObiSDKEvents> {
|
|
|
55
55
|
widgetDisplay?: string;
|
|
56
56
|
completedWidgetDisplay?: string;
|
|
57
57
|
widgetPosition?: string;
|
|
58
|
+
widgetType: "sidepanel" | "launcher";
|
|
59
|
+
/** True after the host sets widgetType through window config or update. */
|
|
60
|
+
private widgetTypeFromHost;
|
|
58
61
|
autoOpenPlanUuid: string | null;
|
|
59
62
|
showSidePanel: boolean;
|
|
60
63
|
sidePanelStartRequest: SidePanelStartRequest | null;
|
|
@@ -92,6 +95,7 @@ export declare class ObiSDK extends EventEmitter<ObiSDKEvents> {
|
|
|
92
95
|
user?: Identity | null;
|
|
93
96
|
}): void;
|
|
94
97
|
createClient(appToken: string): Promise<void>;
|
|
98
|
+
private applyProductWidgetType;
|
|
95
99
|
/**
|
|
96
100
|
* After a host-page reload, reopen the tutor side panel when chat-web stored a
|
|
97
101
|
* conversation uuid to resume (within its 30-second TTL). SdkPanel only mounts when
|
package/dist/src/types.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export type Config = {
|
|
|
8
8
|
apiKey?: string;
|
|
9
9
|
/** Override Obi API base URL (e.g. local obi-server). Snippet `obiWidgetConfig` is read before the client is constructed. */
|
|
10
10
|
apiBaseUrl?: string;
|
|
11
|
+
/** Widget type for the embedded SDK. Defaults to the side panel. */
|
|
12
|
+
widgetType?: "sidepanel" | "launcher";
|
|
11
13
|
isActive?: boolean;
|
|
12
14
|
primaryColour?: string;
|
|
13
15
|
user?: Identity;
|