@solomei-ai/intent 1.10.0 → 1.11.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.
@@ -6,6 +6,11 @@ type InitOptions = {
6
6
  geo?: boolean;
7
7
  sidMaxAgeSeconds?: number;
8
8
  debug?: boolean;
9
+ /**
10
+ * @internal - For development/debugging only. Only available in debug builds.
11
+ * Use `@solomei-ai/intent/debug` or `intent.debug.umd.min.js` to access this feature.
12
+ */
13
+ debugPanel?: boolean;
9
14
  };
10
15
  /**
11
16
  * Valid flag names for the Intent SDK
@@ -35,11 +40,32 @@ declare function setGeo(enabled: boolean): void;
35
40
  * @param enabled - true to enable debug logging, false to disable
36
41
  */
37
42
  declare function setDebug(enabled: boolean): void;
43
+ /**
44
+ * Toggle debug panel - controls whether the debug panel UI is shown
45
+ *
46
+ * **⚠️ WARNING: Only available in debug builds**
47
+ *
48
+ * This function is only available when using debug build variants:
49
+ * - ESM: `@solomei-ai/intent/debug` → `dist/esm/index.debug.js`
50
+ * - UMD: `intent.debug.umd.min.js`
51
+ *
52
+ * The debug panel exposes internal SDK behavior including:
53
+ * - Screenshots of user interactions
54
+ * - Event payloads and metadata
55
+ * - HTML content and element information
56
+ *
57
+ * **Production builds do not include this functionality.**
58
+ * Attempting to use this in production builds will result in a warning and no-op.
59
+ *
60
+ * @internal
61
+ * @param enabled - true to show debug panel, false to hide
62
+ */
63
+ declare function setDebugPanel(enabled: boolean): void;
38
64
  declare function initIntent(opts?: InitOptions): void;
39
65
  declare function getIntentSessionId(): string | undefined;
40
66
  declare function ensureIntentSessionId(): void;
41
67
  declare function clearIntentSessionId(): void;
42
68
  declare function setIntentSessionMaxAge(seconds: number): void;
43
69
 
44
- export { clearIntentSessionId, ensureIntentSessionId, getIntentSessionId, initIntent, setConsent, setDebug, setFlag, setGeo, setIntentSessionMaxAge };
70
+ export { clearIntentSessionId, ensureIntentSessionId, getIntentSessionId, initIntent, setConsent, setDebug, setDebugPanel, setFlag, setGeo, setIntentSessionMaxAge };
45
71
  export type { FlagName, InitOptions };
package/package.json CHANGED
@@ -1,51 +1,67 @@
1
1
  {
2
2
  "name": "@solomei-ai/intent",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "Lightweight browser SDK for intent events (client-only).",
5
5
  "type": "module",
6
6
  "module": "dist/esm/index.js",
7
+ "browser": "dist/intent.umd.min.js",
7
8
  "types": "dist/types/index.d.ts",
8
9
  "exports": {
9
10
  ".": {
10
11
  "types": "./dist/types/index.d.ts",
11
12
  "import": "./dist/esm/index.js",
12
13
  "default": "./dist/esm/index.js"
14
+ },
15
+ "./debug": {
16
+ "types": "./dist/types/index.d.ts",
17
+ "import": "./dist/esm/index.debug.js",
18
+ "default": "./dist/esm/index.debug.js"
13
19
  }
14
20
  },
15
21
  "unpkg": "dist/intent.umd.min.js",
16
22
  "jsdelivr": "dist/intent.umd.min.js",
17
23
  "files": [
18
- "dist"
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE"
19
27
  ],
20
28
  "sideEffects": false,
29
+ "engines": {
30
+ "node": ">=24.0.0 <25.0.0"
31
+ },
21
32
  "scripts": {
22
33
  "build": "rollup -c",
34
+ "build:debug": "rollup -c rollup.config.debug.js",
23
35
  "build:dev": "rollup -c rollup.config.dev.js",
36
+ "build:all": "npm run build && npm run build:debug",
24
37
  "dev": "rollup -c -w",
25
38
  "clean": "rm -rf dist",
26
39
  "test": "vitest run",
27
- "test:watch": "vitest"
40
+ "test:watch": "vitest",
41
+ "test:browser": "vitest run --config vitest.browser.config.ts"
28
42
  },
29
43
  "dependencies": {
30
- "html2canvas-pro": "^1.5.13",
44
+ "html2canvas-pro": "^1.6.3",
31
45
  "js-cookie": "3.0.5"
32
46
  },
33
47
  "devDependencies": {
34
48
  "@babel/preset-env": "^7.28.5",
35
49
  "@rollup/plugin-babel": "^6.1.0",
36
- "@rollup/plugin-commonjs": "^29.0.0",
37
50
  "@rollup/plugin-node-resolve": "^16.0.3",
51
+ "@rollup/plugin-replace": "^6.0.3",
38
52
  "@rollup/plugin-terser": "^0.4.4",
39
53
  "@rollup/plugin-typescript": "^12.3.0",
40
54
  "@tsconfig/recommended": "^1.0.13",
41
55
  "@types/js-cookie": "^3.0.6",
42
- "@vitest/ui": "^4.0.15",
56
+ "@vitest/browser-playwright": "^4.0.16",
57
+ "@vitest/coverage-v8": "^4.0.16",
58
+ "@vitest/ui": "^4.0.16",
43
59
  "eslint-config-xo-typescript": "^9.0.0",
44
60
  "happy-dom": "^20.0.11",
45
- "rollup": "^4.53.3",
61
+ "rollup": "^4.54.0",
46
62
  "rollup-plugin-dts": "^6.3.0",
47
63
  "rollup-plugin-obfuscator": "^1.1.0",
48
64
  "typescript": "^5.9.3",
49
- "vitest": "^4.0.15"
65
+ "vitest": "^4.0.16"
50
66
  }
51
67
  }