@mochabug/adapt-sdk 0.1.5 → 0.1.7
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/README.md +3 -3
- package/dist/cjs/api.cjs.map +2 -2
- package/dist/cjs/frontend.cjs +1 -1
- package/dist/cjs/frontend.cjs.map +3 -3
- package/dist/cjs/router.cjs.map +2 -2
- package/dist/esm/api.mjs.map +2 -2
- package/dist/esm/frontend.mjs +1 -1
- package/dist/esm/frontend.mjs.map +3 -3
- package/dist/esm/router.mjs.map +2 -2
- package/dist/frontend.d.ts +17 -4
- package/dist/frontend.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/frontend.d.ts
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Frontend utilities for Adapt plugins running in browser/iframe contexts
|
|
3
|
+
*
|
|
4
|
+
* Iframe resizing is handled automatically - no initialization required.
|
|
5
|
+
* Just import the functions you need and the resize communication starts automatically.
|
|
3
6
|
*/
|
|
4
7
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param isDevelopment
|
|
7
|
-
* @returns The token string
|
|
8
|
+
* Get the authentication token from the URL hash.
|
|
9
|
+
* @param isDevelopment If true, returns a dev token for local development
|
|
8
10
|
*/
|
|
9
11
|
export declare function getToken(isDevelopment?: boolean): string;
|
|
12
|
+
/**
|
|
13
|
+
* Get the current dark mode state.
|
|
14
|
+
* Returns null if dark mode state hasn't been received from parent yet.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getDarkMode(): boolean | null;
|
|
17
|
+
/**
|
|
18
|
+
* Listen for dark mode changes from the parent window.
|
|
19
|
+
* Returns an unsubscribe function.
|
|
20
|
+
* @param callback Called immediately with current state (if known) and on every change
|
|
21
|
+
*/
|
|
22
|
+
export declare function listenDarkMode(callback: (darkMode: boolean) => void): () => void;
|
|
10
23
|
//# sourceMappingURL=frontend.d.ts.map
|
package/dist/frontend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../src/frontend.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../src/frontend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,aAAa,UAAQ,GAAG,MAAM,CAgBtD;AASD;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,GAAG,IAAI,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,GACpC,MAAM,IAAI,CAaZ"}
|