@picked/hotjar 0.0.1-dev.1764633009920 → 0.0.1-dev.1764634757151

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 CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../plugin-gtyELynT.cjs");exports.hotjarPlugin=e.hotjarPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../plugin-BAyhnwk-.cjs");exports.hotjarPlugin=e.hotjarPlugin;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../plugin-gtyELynT.cjs");exports.hotjarPlugin=e.hotjarPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../plugin-BAyhnwk-.cjs");exports.hotjarPlugin=e.hotjarPlugin;
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { h as a } from "../plugin-Dyy--wRc.js";
1
+ import { h as a } from "../plugin-B-kx9hgz.js";
2
2
  export {
3
3
  a as hotjarPlugin
4
4
  };
@@ -1,4 +1,4 @@
1
- import { h as a } from "../../../plugin-Dyy--wRc.js";
1
+ import { h as a } from "../../../plugin-B-kx9hgz.js";
2
2
  export {
3
3
  a as hotjarPlugin
4
4
  };
@@ -7,7 +7,7 @@ const I = [
7
7
  "step_submit",
8
8
  "field_validation_error",
9
9
  "experience_complete",
10
- "experience_initialized",
10
+ "experience_initialize",
11
11
  "session"
12
12
  ], w = ({
13
13
  siteId: u,
@@ -70,7 +70,7 @@ const I = [
70
70
  p(() => {
71
71
  var s;
72
72
  try {
73
- y && e.type === "experience_initialized" && !a && (i.event(g), a = !0);
73
+ y && e.type === "experience_initialize" && !a && (i.event(g), a = !0);
74
74
  const r = [e.type], h = "experience" in e && e.experience.configStore.getState().name;
75
75
  h && (r.push(h), "step" in e && ((s = e.step) != null && s.label) && r.push(e.step.label)), i.event(r.join(" > "));
76
76
  } catch {
@@ -0,0 +1 @@
1
+ "use strict";const i=require("@hotjar/browser"),m=require("@picked/client"),n=require("effector"),E=["step_enter","step_complete","step_submit","field_validation_error","experience_complete","experience_initialize","session"],I=({siteId:h,snippetVersion:f=6,trackedEvents:d=E,getUserAttributes:r,autoStartRecording:g=!0,recordingStartEvent:y="hotjar_start"})=>{let a=!1,c=!1;const l={events:[],isProcessing:!1,isWaiting:!1,push(t){l.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)}},p=t=>{l.push(t)};return{name:"hotjar",setup:t=>{if(!m.supportsWindow())return;const v=new Set(d),_=n.createEffect(e=>{if(!a){a=!0;try{i.init(h,f)}catch{}}p(()=>{var s;try{g&&e.type==="experience_initialize"&&!c&&(i.event(y),c=!0);const o=[e.type],u="experience"in e&&e.experience.configStore.getState().name;u&&(o.push(u),"step"in e&&((s=e.step)!=null&&s.label)&&o.push(e.step.label)),i.event(o.join(" > "))}catch{}})}),j=n.createEffect(e=>{e.type==="session"&&"id"in e&&p(()=>{try{const s=(r==null?void 0:r())??{};i.identify(e.id,{organisationId:t.organizationId,projectId:t.projectId,...s})}catch{}})});n.sample({clock:t.eventBus,filter:({type:e})=>e==="session",target:j}),n.sample({clock:t.eventBus,filter:e=>v.has(e.type),target:_})}}};exports.hotjarPlugin=I;
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.1764633009920",
4
+ "version": "0.0.1-dev.1764634757151",
5
5
  "dependencies": {
6
6
  "@hotjar/browser": "^1.0.9"
7
7
  },
@@ -41,7 +41,7 @@
41
41
  "main": "./dist/cjs/index.js",
42
42
  "module": "./dist/esm/index.js",
43
43
  "peerDependencies": {
44
- "@picked/client": "0.0.1-dev.1764633009920",
44
+ "@picked/client": "0.0.1-dev.1764634757151",
45
45
  "effector": "^23.3.0"
46
46
  },
47
47
  "private": false,
@@ -1 +0,0 @@
1
- "use strict";const i=require("@hotjar/browser"),m=require("@picked/client"),n=require("effector"),E=["step_enter","step_complete","step_submit","field_validation_error","experience_complete","experience_initialized","session"],I=({siteId:h,snippetVersion:f=6,trackedEvents:d=E,getUserAttributes:r,autoStartRecording:g=!0,recordingStartEvent:y="hotjar_start"})=>{let a=!1,c=!1;const l={events:[],isProcessing:!1,isWaiting:!1,push(t){l.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)}},p=t=>{l.push(t)};return{name:"hotjar",setup:t=>{if(!m.supportsWindow())return;const v=new Set(d),_=n.createEffect(e=>{if(!a){a=!0;try{i.init(h,f)}catch{}}p(()=>{var s;try{g&&e.type==="experience_initialized"&&!c&&(i.event(y),c=!0);const o=[e.type],u="experience"in e&&e.experience.configStore.getState().name;u&&(o.push(u),"step"in e&&((s=e.step)!=null&&s.label)&&o.push(e.step.label)),i.event(o.join(" > "))}catch{}})}),j=n.createEffect(e=>{e.type==="session"&&"id"in e&&p(()=>{try{const s=(r==null?void 0:r())??{};i.identify(e.id,{organisationId:t.organizationId,projectId:t.projectId,...s})}catch{}})});n.sample({clock:t.eventBus,filter:({type:e})=>e==="session",target:j}),n.sample({clock:t.eventBus,filter:e=>v.has(e.type),target:_})}}};exports.hotjarPlugin=I;