@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.
@@ -1,10 +1,23 @@
1
1
  /**
2
- * Simple token utility for waiting on hash-based tokens
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
- * Gets the token from URL hash (first call) or returns cached value (subsequent calls)
6
- * @param isDevelopment - If true, returns 'dev-token' for local development
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
@@ -1 +1 @@
1
- {"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../src/frontend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,aAAa,UAAQ,GAAG,MAAM,CA+CtD"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mochabug/adapt-sdk",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "The API toolkit to facilitate mochabug adapt plugin development",
5
5
  "publishConfig": {
6
6
  "access": "public"