@botonic/webviews 2.25.0 → 2.27.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.
@@ -0,0 +1,3 @@
1
+ export declare const useBotonicContextWebviews: () => {
2
+ botonicContextWebviews: any;
3
+ };
@@ -1,6 +1,7 @@
1
+ import { BotonicContextWebviews } from '../../../../shared/src/index.ts';
1
2
  export interface CloseWebviewOptions {
2
3
  payload?: any;
3
4
  path?: string;
4
5
  params?: Record<string, string>;
5
6
  }
6
- export declare function useWebviewClose(session: any): (options?: CloseWebviewOptions) => Promise<void>;
7
+ export declare function useWebviewClose(botonicContextWebviews?: BotonicContextWebviews): (options?: CloseWebviewOptions) => Promise<void>;
@@ -1,8 +1,10 @@
1
+ import { BotonicContextWebviews } from '../../../../../shared/src/index.ts';
1
2
  import { MapContentsType, UseWebviewContents } from './types';
2
3
  export interface UseWebviewContentsProps<T extends MapContentsType> {
3
- botSession: Record<string, any>;
4
+ /** Undefined until `useBotonicContextWebviews` finishes loading the GET webviews session. */
5
+ botonicContextWebviews?: BotonicContextWebviews;
4
6
  params: Record<string, string>;
5
7
  version?: 'draft' | 'latest' | string;
6
8
  mapContents: Record<keyof T, string>;
7
9
  }
8
- export declare function useWebviewContents<T extends MapContentsType>({ botSession, params, version, mapContents, }: UseWebviewContentsProps<T>): UseWebviewContents<T>;
10
+ export declare function useWebviewContents<T extends MapContentsType>({ botonicContextWebviews, params, version, mapContents, }: UseWebviewContentsProps<T>): UseWebviewContents<T>;
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './components';
2
- export * from './hooks/use-bot-session';
2
+ export * from './hooks/use-botonic-context-webviews';
3
3
  export * from './hooks/use-webview-close';
4
4
  export * from './hooks/use-webview-contents';
5
5
  export * from './webview-context';
@@ -1,8 +1,9 @@
1
+ import { BotonicContextWebviews } from '../../../shared/src/index.ts';
1
2
  import { ConfirmCloseOption } from '../../../webchat-core/src/index.ts';
2
3
  import { CloseWebviewOptions } from './hooks/use-webview-close';
3
4
  import { WebviewDefinition } from './webviews';
4
5
  export interface WebviewContextType {
5
- botSession: Record<string, any>;
6
+ botonicContextWebviews?: BotonicContextWebviews;
6
7
  params: Record<string, string>;
7
8
  closeWebview: (options?: CloseWebviewOptions) => Promise<void>;
8
9
  setWebviewTitle: (title: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/webviews",
3
- "version": "2.25.0",
3
+ "version": "2.27.0",
4
4
  "type": "module",
5
5
  "types": "./index.d.ts",
6
6
  "module": "./index.js",
@@ -12,9 +12,9 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@botonic/core": "2.25.0",
16
- "@botonic/webchat-core": "2.25.0",
17
- "@lilara/foundations": ">=0.4.0",
15
+ "@botonic/shared": "2.27.0",
16
+ "@botonic/webchat-core": "2.27.0",
17
+ "@lilara/foundations": ">=0.6.0",
18
18
  "class-variance-authority": "^0.7.0",
19
19
  "react": "18.3.1"
20
20
  },
@@ -1,3 +0,0 @@
1
- export declare const useBotSession: () => {
2
- botSession: any;
3
- };