@bodhiapp/bodhi-js-core 0.0.34 → 0.0.35
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/bodhi-core.cjs.js +81 -4
- package/dist/bodhi-core.esm.js +393 -244
- package/dist/cli/setup-modal.js +45 -40
- package/dist/onboarding/index.d.ts +1 -0
- package/dist/onboarding/modal-v2.d.ts +32 -0
- package/package.json +5 -4
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
* Onboarding module - Framework-agnostic setup modal
|
|
3
3
|
*/
|
|
4
4
|
export { OnboardingModal, type AsyncRequestHandler, type AsyncRequestHandlers, type ModalEvent, type ModalEventMap, type OnboardingModalConfig, } from './modal';
|
|
5
|
+
export { OnboardingModalV2, type AsyncRequestHandlerV2, type AsyncRequestHandlersV2, type OnboardingModalV2Config, } from './modal-v2';
|
|
5
6
|
export { BROWSER_CONFIGS, OS_CONFIGS } from './config';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MessageTypeV2, RequestMessageV2, ResponsePayloadV2, SetupStateV2 } from '@bodhiapp/setup-modal-v2-types';
|
|
2
|
+
export type AsyncRequestHandlerV2<K extends MessageTypeV2> = ((msg: RequestMessageV2<K>) => Promise<ResponsePayloadV2<K>>) | ((msg: RequestMessageV2<K>) => ResponsePayloadV2<K>);
|
|
3
|
+
export type AsyncRequestHandlersV2 = {
|
|
4
|
+
[K in MessageTypeV2]?: AsyncRequestHandlerV2<K>;
|
|
5
|
+
};
|
|
6
|
+
export interface OnboardingModalV2Config {
|
|
7
|
+
/**
|
|
8
|
+
* Path to the modal-v2 HTML relative to extension root. Used with
|
|
9
|
+
* chrome.runtime.getURL in extension contexts.
|
|
10
|
+
*
|
|
11
|
+
* @default 'src/bodhi-js-core/setup-modal-v2.html'
|
|
12
|
+
*/
|
|
13
|
+
modalHtmlPath?: string;
|
|
14
|
+
/** Message handlers for iframe-to-host requests. */
|
|
15
|
+
handlers: AsyncRequestHandlersV2;
|
|
16
|
+
}
|
|
17
|
+
export declare class OnboardingModalV2 {
|
|
18
|
+
private overlayElement;
|
|
19
|
+
private iframeElement;
|
|
20
|
+
private isIframeReady;
|
|
21
|
+
private currentSetupState;
|
|
22
|
+
private messageHandler;
|
|
23
|
+
private modalHtmlPath;
|
|
24
|
+
private handlers;
|
|
25
|
+
constructor(config: OnboardingModalV2Config);
|
|
26
|
+
show(state: SetupStateV2): void;
|
|
27
|
+
showLoading(): void;
|
|
28
|
+
updateState(state: SetupStateV2): void;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
private handleMessage;
|
|
31
|
+
private sendStateToModal;
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bodhiapp/bodhi-js-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "Core types and interfaces for Bodhi Browser SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/bodhi-core.cjs.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
|
-
"clean": "rimraf dist src/onboarding/modal.html",
|
|
64
|
+
"clean": "rimraf dist src/onboarding/modal.html src/onboarding/modal-v2.html",
|
|
65
65
|
"copy-deps": "node scripts/copy-deps.js",
|
|
66
66
|
"build-cli": "vite build --config vite.config.cli.ts",
|
|
67
67
|
"prebuild": "make dependencies",
|
|
@@ -85,8 +85,9 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@bodhiapp/bodhi-browser-types": "0.0.
|
|
89
|
-
"@bodhiapp/setup-modal-types": "0.0.
|
|
88
|
+
"@bodhiapp/bodhi-browser-types": "0.0.35",
|
|
89
|
+
"@bodhiapp/setup-modal-types": "0.0.35",
|
|
90
|
+
"@bodhiapp/setup-modal-v2-types": "0.0.35",
|
|
90
91
|
"@bodhiapp/ts-client": "0.1.31",
|
|
91
92
|
"ua-parser-js": "^1.0.40"
|
|
92
93
|
},
|