@picked/hotjar 0.0.1-dev.1772493269328 → 0.0.1-dev.1773364848747
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/cjs/index.js +1 -1
- package/dist/cjs/plugins/hotjar/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/plugins/hotjar/index.js +1 -1
- package/dist/plugin-BbLRWqnA.cjs +1 -0
- package/dist/{plugin-8YCruaTQ.js → plugin-CBN2Bzgr.js} +5 -5
- package/package.json +28 -4
- package/dist/plugin-BWR_ipa5.cjs +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../plugin-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../plugin-BbLRWqnA.cjs");exports.hotjarPlugin=e.hotjarPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../plugin-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../plugin-BbLRWqnA.cjs");exports.hotjarPlugin=e.hotjarPlugin;
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("@hotjar/browser"),_=require("@picked/client"),r=require("effector"),j=["step_enter","step_complete","step_submit","field_validation_error","experience_complete","experience_initialize","session"],E=({siteId:p,snippetVersion:h=6,trackedEvents:f=j,getUserAttributes:l,autoStartRecording:d=!0,recordingStartEvent:g="hotjar_start"})=>{let n=!1,o=!1;const a={events:[],isProcessing:!1,isWaiting:!1,push(t){a.events.push(t),Promise.resolve().then(()=>this.processQueue())},processQueue(){if(!this.isProcessing){if(!i.isReady()){this.wait();return}this.isProcessing=!0;try{for(;this.events.length>0;){const t=this.events.shift();if(!t)break;t()}}finally{this.isProcessing=!1,this.events.length>0&&i.isReady()&&Promise.resolve().then(()=>this.processQueue())}}},wait(){if(this.isWaiting)return;this.isWaiting=!0;const t=setInterval(()=>{i.isReady()&&(clearInterval(t),this.isWaiting=!1,this.processQueue())},100)}},c=t=>{a.push(t)};return{name:"hotjar",setup:t=>{if(!_.supportsWindow())return;const y=new Set(f),m=r.createEffect(e=>{if(!n){n=!0;try{i.init(p,h)}catch{}}c(()=>{try{d&&e.type==="experience_initialize"&&!o&&(i.event(g),o=!0);const s=[e.type],u="experience"in e&&e.experience.configStore.getState().name;u&&(s.push(u),"step"in e&&e.step?.name&&s.push(e.step.name)),i.event(s.join(" > "))}catch{}})}),v=r.createEffect(e=>{e.type==="session"&&"id"in e&&c(()=>{try{const s=l?.()??{};i.identify(e.id,{organisationId:t.organizationId,projectId:t.projectId,...s})}catch{}})});r.sample({clock:t.eventBus,filter:({type:e})=>e==="session",target:v}),r.sample({clock:t.eventBus,filter:e=>y.has(e.type),target:m})}}};exports.hotjarPlugin=E;
|
|
@@ -11,8 +11,8 @@ const x = [
|
|
|
11
11
|
"session"
|
|
12
12
|
], R = ({
|
|
13
13
|
siteId: u,
|
|
14
|
-
snippetVersion:
|
|
15
|
-
trackedEvents:
|
|
14
|
+
snippetVersion: f = 6,
|
|
15
|
+
trackedEvents: l = x,
|
|
16
16
|
getUserAttributes: d,
|
|
17
17
|
autoStartRecording: g = !0,
|
|
18
18
|
recordingStartEvent: m = "hotjar_start"
|
|
@@ -59,11 +59,11 @@ const x = [
|
|
|
59
59
|
setup: (t) => {
|
|
60
60
|
if (!j())
|
|
61
61
|
return;
|
|
62
|
-
const y = new Set(
|
|
62
|
+
const y = new Set(l), v = p((e) => {
|
|
63
63
|
if (!r) {
|
|
64
64
|
r = !0;
|
|
65
65
|
try {
|
|
66
|
-
i.init(u,
|
|
66
|
+
i.init(u, f);
|
|
67
67
|
} catch {
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -71,7 +71,7 @@ const x = [
|
|
|
71
71
|
try {
|
|
72
72
|
g && e.type === "experience_initialize" && !n && (i.event(m), n = !0);
|
|
73
73
|
const s = [e.type], c = "experience" in e && e.experience.configStore.getState().name;
|
|
74
|
-
c && (s.push(c), "step" in e && e.step?.
|
|
74
|
+
c && (s.push(c), "step" in e && e.step?.name && s.push(e.step.name)), i.event(s.join(" > "));
|
|
75
75
|
} catch {
|
|
76
76
|
}
|
|
77
77
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/hotjar",
|
|
3
3
|
"description": "Picked Hotjar Plugin",
|
|
4
|
-
"version": "0.0.1-dev.
|
|
4
|
+
"version": "0.0.1-dev.1773364848747",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@hotjar/browser": "^1.0.9"
|
|
7
7
|
},
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
"@repo/types": "workspace:*",
|
|
12
12
|
"@repo/typescript-config": "workspace:*",
|
|
13
13
|
"@rollup/plugin-replace": "^6.0.2",
|
|
14
|
+
"@size-limit/preset-small-lib": "^12.0.0",
|
|
14
15
|
"@types/node": "^22",
|
|
15
16
|
"@vitest/coverage-v8": "^4.0.17",
|
|
16
17
|
"effector": "^23.3.0",
|
|
17
18
|
"jsdom": "^26.1.0",
|
|
19
|
+
"size-limit": "^12.0.0",
|
|
18
20
|
"tsup": "^8.5.0",
|
|
19
21
|
"tsx": "^4.20.3",
|
|
20
22
|
"vite": "^7.3.1",
|
|
@@ -43,13 +45,24 @@
|
|
|
43
45
|
"knip",
|
|
44
46
|
"jscpd",
|
|
45
47
|
"eslint",
|
|
46
|
-
"tsc"
|
|
48
|
+
"tsc",
|
|
49
|
+
"attw"
|
|
50
|
+
],
|
|
51
|
+
"ignoreFiles": [
|
|
52
|
+
"eslint.config.js"
|
|
53
|
+
],
|
|
54
|
+
"ignoreDependencies": [
|
|
55
|
+
"@picked/client",
|
|
56
|
+
"@repo/eslint-config",
|
|
57
|
+
"@repo/types",
|
|
58
|
+
"@repo/typescript-config",
|
|
59
|
+
"tsup"
|
|
47
60
|
]
|
|
48
61
|
},
|
|
49
62
|
"main": "./dist/cjs/index.js",
|
|
50
63
|
"module": "./dist/esm/index.js",
|
|
51
64
|
"peerDependencies": {
|
|
52
|
-
"@picked/client": "0.0.1-dev.
|
|
65
|
+
"@picked/client": "0.0.1-dev.1773364848747",
|
|
53
66
|
"effector": "^23.3.0"
|
|
54
67
|
},
|
|
55
68
|
"private": false,
|
|
@@ -59,16 +72,27 @@
|
|
|
59
72
|
"dev": "vite build --watch",
|
|
60
73
|
"jscpd": "jscpd src",
|
|
61
74
|
"knip": "knip",
|
|
62
|
-
"lint": "eslint .",
|
|
75
|
+
"lint": "if [ \"$AGENT\" = \"true\" ]; then echo \"[AGENT HINT] Prefer running lint on specific files from the repo root: node scripts/lint-files.js <files>\"; fi && eslint .",
|
|
63
76
|
"lint-files": "eslint",
|
|
64
77
|
"lint:format": "eslint . --fix",
|
|
65
78
|
"lint:report": "eslint . -o './.reports/eslint.json' -f json || true",
|
|
79
|
+
"size": "size-limit",
|
|
66
80
|
"test": "vitest run",
|
|
67
81
|
"test:coverage": "vitest run --coverage",
|
|
68
82
|
"test:packaged-types": "attw --pack",
|
|
69
83
|
"test:watch": "vitest",
|
|
70
84
|
"type-check": "tsc -p . --noEmit"
|
|
71
85
|
},
|
|
86
|
+
"size-limit": [
|
|
87
|
+
{
|
|
88
|
+
"path": "dist/esm/index.js",
|
|
89
|
+
"limit": "5 kB"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"path": "dist/esm/plugins/hotjar/index.js",
|
|
93
|
+
"limit": "5 kB"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
72
96
|
"type": "module",
|
|
73
97
|
"types": "./dist/types/index.d.ts"
|
|
74
98
|
}
|
package/dist/plugin-BWR_ipa5.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("@hotjar/browser"),j=require("@picked/client"),r=require("effector"),m=["step_enter","step_complete","step_submit","field_validation_error","experience_complete","experience_initialize","session"],E=({siteId:l,snippetVersion:p=6,trackedEvents:h=m,getUserAttributes:f,autoStartRecording:d=!0,recordingStartEvent:g="hotjar_start"})=>{let n=!1,o=!1;const a={events:[],isProcessing:!1,isWaiting:!1,push(t){a.events.push(t),Promise.resolve().then(()=>this.processQueue())},processQueue(){if(!this.isProcessing){if(!i.isReady()){this.wait();return}this.isProcessing=!0;try{for(;this.events.length>0;){const t=this.events.shift();if(!t)break;t()}}finally{this.isProcessing=!1,this.events.length>0&&i.isReady()&&Promise.resolve().then(()=>this.processQueue())}}},wait(){if(this.isWaiting)return;this.isWaiting=!0;const t=setInterval(()=>{i.isReady()&&(clearInterval(t),this.isWaiting=!1,this.processQueue())},100)}},c=t=>{a.push(t)};return{name:"hotjar",setup:t=>{if(!j.supportsWindow())return;const y=new Set(h),v=r.createEffect(e=>{if(!n){n=!0;try{i.init(l,p)}catch{}}c(()=>{try{d&&e.type==="experience_initialize"&&!o&&(i.event(g),o=!0);const s=[e.type],u="experience"in e&&e.experience.configStore.getState().name;u&&(s.push(u),"step"in e&&e.step?.label&&s.push(e.step.label)),i.event(s.join(" > "))}catch{}})}),_=r.createEffect(e=>{e.type==="session"&&"id"in e&&c(()=>{try{const s=f?.()??{};i.identify(e.id,{organisationId:t.organizationId,projectId:t.projectId,...s})}catch{}})});r.sample({clock:t.eventBus,filter:({type:e})=>e==="session",target:_}),r.sample({clock:t.eventBus,filter:e=>y.has(e.type),target:v})}}};exports.hotjarPlugin=E;
|