@lucida-analytics/browser 0.1.10 → 0.1.12
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/CHANGELOG.md +15 -0
- package/README.md +7 -2
- package/dist/autocapture.d.ts +1 -1
- package/dist/autocapture.js +1 -1
- package/dist/{client-DTogLMYz.d.ts → client-C9F2fWI4.d.ts} +2 -2
- package/dist/consent.d.ts +2 -2
- package/dist/core.d.ts +3 -3
- package/dist/core.js +3 -3
- package/dist/correlate.d.ts +1 -1
- package/dist/early-access.d.ts +1 -1
- package/dist/experiments.d.ts +1 -1
- package/dist/flags.d.ts +1 -1
- package/dist/forms.d.ts +1 -1
- package/dist/guides.d.ts +1 -1
- package/dist/heatmaps.d.ts +1 -1
- package/dist/heatmaps.js +1 -1
- package/dist/host-headers.d.ts +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +2 -2
- package/dist/inspector.d.ts +1 -1
- package/dist/lucida.js +2 -2
- package/dist/recommendations.d.ts +1 -1
- package/dist/{static/v0/recorder-TZCDQIZN.js → recorder-AJ7XX7OZ.js} +4 -4
- package/dist/replay.d.ts +2 -2
- package/dist/replay.js +1 -1
- package/dist/static/v0/autocapture.js +1 -1
- package/dist/static/v0/core.js +3 -3
- package/dist/static/v0/heatmaps.js +1 -1
- package/dist/static/v0/index.js +2 -2
- package/dist/static/v0/lucida.js +2 -2
- package/dist/static/v0/manifest.json +8 -8
- package/dist/static/{v0.1.10/recorder-TZCDQIZN.js → v0/recorder-AJ7XX7OZ.js} +4 -4
- package/dist/static/v0/replay.js +1 -1
- package/dist/static/v0.1.12/autocapture.js +1 -0
- package/dist/static/v0.1.12/core.js +3 -0
- package/dist/static/v0.1.12/heatmaps.js +1 -0
- package/dist/static/v0.1.12/index.js +3 -0
- package/dist/static/v0.1.12/lucida.js +3 -0
- package/dist/static/{v0.1.10 → v0.1.12}/manifest.json +8 -8
- package/dist/{recorder-TZCDQIZN.js → static/v0.1.12/recorder-AJ7XX7OZ.js} +4 -4
- package/dist/static/{v0.1.10 → v0.1.12}/replay.js +1 -1
- package/dist/toolbar.d.ts +1 -1
- package/dist/{types-B_CVJeLI.d.ts → types-Chfj1wdu.d.ts} +9 -2
- package/dist/webmcp.d.ts +1 -1
- package/package.json +1 -1
- package/storage.json +2 -2
- package/dist/static/v0.1.10/autocapture.js +0 -1
- package/dist/static/v0.1.10/core.js +0 -3
- package/dist/static/v0.1.10/heatmaps.js +0 -1
- package/dist/static/v0.1.10/index.js +0 -3
- package/dist/static/v0.1.10/lucida.js +0 -3
- /package/dist/static/{v0.1.10 → v0.1.12}/banner-TXLAMTQM.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-AWIQCFGN.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-B722OERZ.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-EFNCQJI3.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-IXDYCBAD.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-UPPUYIIH.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/consent.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/correlate.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/early-access.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/experiments.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/flags.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/forms.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/guides.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/host-headers.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/inspector.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/modules-FANMZRDJ.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/persistent-G2OR2L2N.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/recommendations.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/toolbar.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/validation-S6TYVWAI.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/webmcp.js +0 -0
package/dist/heatmaps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var $=new Set(["input","textarea","select","option"]),T=["name","type","role","aria-label","title","alt","placeholder"],S=/(?:\d[ -]?){9,}/;function
|
|
1
|
+
var $=new Set(["input","textarea","select","option"]),T=["name","type","role","aria-label","title","alt","placeholder"],S=new Set(["aria-label","aria-description","title","alt","placeholder","value","label"]),I=/(?:\d[ -]?){9,}/;function C(t){if($.has(t.tagName.toLowerCase())||t.isContentEditable)return;let n="";for(let e of Array.from(t.childNodes))e.nodeType===3&&(n+=e.textContent??"");if(n=n.replace(/\s+/g," ").trim(),!(!n||I.test(n)))return n.slice(0,255)}function E(t){if(!t?.length)return()=>!1;let n=t.map(e=>e.toLowerCase());return e=>n.some(r=>r.endsWith("*")?e.startsWith(r.slice(0,-1)):e===r)}var H="***";function P(t,n,e,r,c){let o=t.parentElement,s=o?Array.from(o.children):[t],i={tag_name:t.tagName.toLowerCase(),nth_child:s.indexOf(t)+1,nth_of_type:s.filter(u=>u.tagName===t.tagName).indexOf(t)+1},l=(t.getAttribute("class")??"").split(/\s+/).filter(Boolean);l.length&&!r("class")&&(i.classes=l),t.id&&!r("id")&&(i.attr__id=c("id",t.id));let a=t.getAttribute("href");a&&!r("href")&&(i.href=c("href",a.slice(0,1024)));let d={};for(let u of Array.from(t.attributes))(u.name.startsWith("data-lc-")||T.includes(u.name))&&!r(u.name)&&(e||!S.has(u.name))&&(d[u.name]=c(u.name,u.value.slice(0,255)));if(Object.keys(d).length&&(i.attrs=d),n){let u=C(t);u&&(i.text=u)}return i}function w(t,n,e,r,c={}){let o=[],s=E(r),i=E(c.allow),l=c.maskAll?(d,u)=>i(d)?u:H:(d,u)=>u,a=n;for(let d=t;d&&o.length<10;d=d.parentElement)o.push(P(d,a,n,s,l)),(d===e||!e)&&(a=!1);return o}var p=t=>t.replace(/(["\\])/g,"\\$1");function _(t){return t.map(n=>{let e=n.tag_name+(n.classes?"."+n.classes.join("."):"")+":";n.attr__id&&(e+=`attr__id="${p(n.attr__id)}"`),n.href&&(e+=`href="${p(n.href)}"`),n.text&&(e+=`text="${p(n.text)}"`);for(let[r,c]of Object.entries(n.attrs??{}))e+=`attr__${r}="${p(c)}"`;return e+`nth-child="${n.nth_child}"nth-of-type="${n.nth_of_type}"`}).join(";")}var f=[],X=/^[+\-−–‹›<>«»←→↑↓▲▼▶◀^ˇ˄˅]$/,L=/\b(increase|decrease|increment|decrement|plus|minus|add one|remove one|next|prev|previous|scroll (left|right))\b/i,D=/(^|[-_\s])(stepper|spinner|quantity|qty|increment|decrement|inc|dec|plus|minus|carousel|slider|swiper|slick|glide|splide|arrow|next|prev)([-_\s]|$)/i,j="button,[role=button],a,input[type=button],input[type=submit],[role=spinbutton]";function N(t,n=[]){if(n.length&&t.closest(n.join(","))||t.closest("input[type=number],[role=spinbutton],[role=slider]"))return!0;let e=t.closest(j)??t,r=`${e.getAttribute("aria-label")??""} ${e.getAttribute("title")??""}`;if(X.test((e.textContent??"").trim())||L.test(r))return!0;for(let c=e,o=0;c&&o<3;c=c.parentElement,o++)if(D.test(c.getAttribute("class")??""))return!0;return!1}var O=()=>typeof getSelection=="function"?(getSelection()?.toString()??"")!=="":!1;function v(t,n=Date.now(),e={},r){if(r&&e.ignoreSelectors?.length&&r.closest(e.ignoreSelectors.join(",")))return{};if(r&&e.suppressSteppers!==!1&&N(r,e.stepperSelectors))return{};if(e.ignoreTextSelection!==!1&&O())return{};let c=e.windowMs??1e3,o=e.radiusPx??30;for(f.length&&n<f[f.length-1].t&&(f.length=0),f.push({t:n,x:t.clientX,y:t.clientY});f.length&&n-f[0].t>c;)f.shift();let s=f.filter(i=>Math.hypot(i.x-t.clientX,i.y-t.clientY)<=o).length;return s>=(e.count??3)?{$rageclick:!0,$rageclick_count:s}:{}}function y(t,n,e=700){if(typeof MutationObserver>"u")return;let r=!1,c=new MutationObserver(()=>r=!0);c.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let o=()=>{r=!0};window.addEventListener("scroll",o,{capture:!0,passive:!0}),document.addEventListener("selectionchange",o);let s=()=>{c.disconnect(),window.removeEventListener("scroll",o,{capture:!0}),document.removeEventListener("selectionchange",o)},i=setTimeout(()=>{s(),!r&&document.visibilityState!=="hidden"&&t.client.capture("$deadclick_hint",{$selector:n,$no_mutation_ms:e})},e);t.onUnload(()=>{clearTimeout(i),s()})}var M=/^[A-Za-z_][\w-]*$/,W=5;function g(t){let n=[];for(let e=t;e&&n.length<W;e=e.parentElement){let r=e.tagName.toLowerCase();if(e.id&&M.test(e.id)){n.unshift(`${r}#${e.id}`);break}let c=(e.getAttribute("class")??"").split(/\s+/).filter(o=>M.test(o)).slice(0,2);n.unshift(r+c.map(o=>`.${o}`).join(""))}return n.join(" ")}function k(t,n,e,r,c={}){let o={$selector:g(e),$el_interactive:r};(n.clientX||n.clientY||n.detail)&&(o.$click_x=Math.round(n.clientX+(window.scrollX||0)),o.$click_y=Math.round(n.clientY+(window.scrollY||0))),c.rageClicks!==!1&&!e.closest(".lc-no-rageclick,[data-lc-no-rageclick]")&&Object.assign(o,v(n,Date.now(),c.rageClicks||{},e));let s=c.deadClicks;!r&&n.isTrusted&&s!==!1&&!(s?.ignoreSelectors?.length&&e.closest(s.ignoreSelectors.join(",")))&&y(t,o.$selector,s?.waitMs);for(let i of t.clickExtras)Object.assign(o,i(n,e));return o}function A(t){let n=new Array(10).fill(0),e=new Map,r=new Map,c=t.now(),o=(s,i)=>{e.set(s,(e.get(s)??0)+i)};return{tick(){let s=t.now(),i=s-c;if(c=s,i<=0||!t.visible())return;let l=Math.max(t.pageH(),1),a=Math.max(0,t.scrollY()),d=Math.min(l,a+t.viewportH());for(let u=0;u<10;u++){let m=u*l/10,x=(u+1)*l/10;a<x&&d>m&&(n[u]=(n[u]??0)+i)}},enter(s){r.has(s)||r.set(s,t.now())},leave(s){let i=r.get(s);i!==void 0&&(r.delete(s),t.visible()&&o(s,t.now()-i))},drain(){let s=t.now();for(let[l,a]of r)t.visible()&&o(l,s-a),r.set(l,s);let i={bands:n.flatMap((l,a)=>l>=100?[[a,Math.round(l)]]:[]),elements:[...e].filter(([,l])=>l>=100).map(([l,a])=>[l,Math.round(a)])};return n.fill(0),e.clear(),i}}}var h="[data-lc-ignore]",Y="a,button,input,select,textarea,label,summary,[role=button],[role=link],[data-lc-capture]";function b(t){return t<768?"mobile":t<1024?"tablet":"desktop"}function R(t,n){let e=n.getBoundingClientRect();return{$click_el_x:Math.round(t.clientX-e.left),$click_el_y:Math.round(t.clientY-e.top),$el_width:Math.round(e.width),$el_height:Math.round(e.height),$viewport_bucket:b(window.innerWidth)}}function B(t){for(let n=t;n;n=n.parentElement){let e=getComputedStyle(n).position;if(e==="fixed"||e==="sticky")return!0}return!1}function V(t,n){let e=[],r=0,c=0,o=()=>{e.length&&(t.client.capture("$heatmap_moves",{$points:e,$viewport_bucket:b(window.innerWidth),$viewport_width:window.innerWidth,$viewport_height:window.innerHeight}),e=[])},s=l=>{let a=Date.now();if(a-c<n||l.target instanceof Element&&l.target.closest(h))return;e.length||(r=a),c=a;let d=l.target instanceof Element&&B(l.target),u=Math.round(l.clientX+(d?0:scrollX)),m=Math.round(l.clientY+(d?0:scrollY));e.push(d?[u,m,a-r,1]:[u,m,a-r]),e.length>=100&&o()};document.addEventListener("mousemove",s,{passive:!0,capture:!0});let i=setInterval(o,5e3);return t.onUnload(o),()=>{document.removeEventListener("mousemove",s,!0),clearInterval(i),o()}}var q="h1,h2,h3,section,article,main,form,[data-lc-attention]",U=200;function F(t){let n=A({now:Date.now,scrollY:()=>window.scrollY,viewportH:()=>window.innerHeight,pageH:()=>document.documentElement.scrollHeight,visible:()=>document.visibilityState!=="hidden"}),e=new WeakMap,r=typeof IntersectionObserver>"u"?void 0:new IntersectionObserver(i=>{for(let l of i){let a=e.get(l.target);a&&(l.isIntersecting?n.enter(a):n.leave(a))}},{threshold:.5});for(let i of[...document.querySelectorAll(q)].slice(0,U))i.closest(h)||(e.set(i,g(i)),r?.observe(i));let c=()=>{let i=n.drain();(i.bands.length||i.elements.length)&&t.client.capture("$attention",{$bands:i.bands,$elements:i.elements,$viewport_bucket:b(window.innerWidth)})},o=setInterval(()=>n.tick(),1e3),s=setInterval(c,15e3);return t.onUnload(()=>(n.tick(),c())),()=>{clearInterval(o),clearInterval(s),r?.disconnect(),n.tick(),c()}}var nt=t=>{let n=!1;t.loadConfig().then(l=>n=l?.heatmaps!==!1);let e=t.config.autocapture,r=typeof e=="object"?e.denySelectors:void 0;t.clickExtras.push((l,a)=>n?R(l,a):{});let c=l=>{let a=l.target;if(!n||!(a instanceof Element)||a.closest(h)||r?.length&&a.closest(r.join(",")))return;let d=!!a.closest(Y);if(d&&t.autocaptureClicks||a instanceof HTMLInputElement&&a.type==="password")return;let u=w(a,!1);t.client.capture("$autocapture",{$event_type:"click",$elements:u,$elements_chain:_(u),...k(t,l,a,d)})};document.addEventListener("click",c,!0);let o=t.config.heatmaps,s=o?.moves?V(t,o.moveIntervalMs??250):void 0,i=o?.attention?F(t):void 0;return()=>{document.removeEventListener("click",c,!0),s?.(),i?.()}};export{R as heatmapProps,nt as heatmaps,B as pinned,b as viewportBucket};
|
package/dist/host-headers.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as LazyModuleName, M as Module, e as Client, d as BrowserConfig } from './types-
|
|
2
|
-
export { A as AgentAnalytics, i as AutocaptureConfig, j as BeforeSend, k as BootstrapConfig, l as CaptureOptions, D as DeliveryConfig, m as FlagOptions, F as FlagValue, n as FlagsService, o as FrustrationConfig, g as Guide, f as GuideAutomation, p as GuideButton, q as GuideKind, r as GuideRule, G as GuideStep, h as GuideTokens, s as GuidesService, H as Host, P as Persistence, t as PersonProfiles, u as PropFilter, R as RECS_PAYLOAD_KEY, v as RecommendationItem, w as RecommendationOptions, x as Recommendations, y as RecsService, z as RemoteConfig, E as ReplayControl, S as StorageConfig, T as TargetConditions, U as UrlPrivacy, W as WatchtowerLike, I as denylistHook, J as placementFlag, K as privatizeUrl, N as recommendations, O as sampleHook, Q as urlPrivacyHook } from './types-
|
|
3
|
-
export { D as DEFAULT_HOST, L as LIB_VERSION, c as createClient } from './client-
|
|
1
|
+
import { L as LazyModuleName, M as Module, e as Client, d as BrowserConfig } from './types-Chfj1wdu.js';
|
|
2
|
+
export { A as AgentAnalytics, i as AutocaptureConfig, j as BeforeSend, k as BootstrapConfig, l as CaptureOptions, D as DeliveryConfig, m as FlagOptions, F as FlagValue, n as FlagsService, o as FrustrationConfig, g as Guide, f as GuideAutomation, p as GuideButton, q as GuideKind, r as GuideRule, G as GuideStep, h as GuideTokens, s as GuidesService, H as Host, P as Persistence, t as PersonProfiles, u as PropFilter, R as RECS_PAYLOAD_KEY, v as RecommendationItem, w as RecommendationOptions, x as Recommendations, y as RecsService, z as RemoteConfig, E as ReplayControl, S as StorageConfig, T as TargetConditions, U as UrlPrivacy, W as WatchtowerLike, I as denylistHook, J as placementFlag, K as privatizeUrl, N as recommendations, O as sampleHook, Q as urlPrivacyHook } from './types-Chfj1wdu.js';
|
|
3
|
+
export { D as DEFAULT_HOST, L as LIB_VERSION, c as createClient } from './client-C9F2fWI4.js';
|
|
4
4
|
export { autocapture, tag404 } from './autocapture.js';
|
|
5
5
|
export { flags } from './flags.js';
|
|
6
6
|
export { hostHeaders } from './host-headers.js';
|
|
@@ -9,6 +9,8 @@ import { WireEvent } from '@lucida-analytics/sdk-core';
|
|
|
9
9
|
export { AgentConversation, AgentConversationOptions, AgentFeedback, AgentOutcome, AgentRole, EarlyAccessFeature, EarlyAccessService, FlagResult, Intervention } from '@lucida-analytics/sdk-core';
|
|
10
10
|
|
|
11
11
|
declare const isExtensionPage: () => boolean;
|
|
12
|
+
/** `assetHost` may be an absolute URL or a path on this site (`/dashboard/lucida`): resolved against the page URL, trailing slash dropped. */
|
|
13
|
+
declare const resolveAssetHost: (assetHost: string) => string;
|
|
12
14
|
/** Immutable, versioned URL of an SDK static file: `<assetHost>/static/v<version>/<file>`. */
|
|
13
15
|
declare const assetUrl: (assetHost: string, version: string, file: string) => string;
|
|
14
16
|
type Importer = (url: string) => Promise<Record<string, unknown>>;
|
|
@@ -96,4 +98,4 @@ declare const flagSources: Module;
|
|
|
96
98
|
* Opt-in modules (replay, heatmaps, forms, toolbar, inspector, consent adapters) have their own entry points. Import "@lucida-analytics/browser/core" for the minimal build. */
|
|
97
99
|
declare function init(apiKey: string, config?: BrowserConfig, extra?: Module[]): Client;
|
|
98
100
|
|
|
99
|
-
export { BrowserConfig, Client, type CspCaptureOptions, type DevtoolsHook, type DevtoolsTarget, type FlagTargetingSources, LazyModuleName, Module, assetUrl, blocksInlineStyle, captureCspViolations, crossDomain, exposeGlobal, flagSourceProps, flagSources, init, isExtensionPage, loadModules, noopClient, rewriteUrl, styleTag };
|
|
101
|
+
export { BrowserConfig, Client, type CspCaptureOptions, type DevtoolsHook, type DevtoolsTarget, type FlagTargetingSources, LazyModuleName, Module, assetUrl, blocksInlineStyle, captureCspViolations, crossDomain, exposeGlobal, flagSourceProps, flagSources, init, isExtensionPage, loadModules, noopClient, resolveAssetHost, rewriteUrl, styleTag };
|