@sentientui/core 0.34.2 → 0.35.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.
- package/dist/{chunk-DGRAS5VP.mjs → chunk-EUD4PUKP.mjs} +1 -1
- package/dist/chunk-EUD4PUKP.mjs.map +1 -0
- package/dist/{index-Dyc-wA0o.d.cts → index-Dg2gkw_l.d.cts} +1 -0
- package/dist/{index-JgzRgOO4.d.ts → index-DjbSOAEF.d.ts} +1 -0
- package/dist/index-consent.d.cts +63 -0
- package/dist/index-consent.d.ts +63 -0
- package/dist/index-consent.js +2 -0
- package/dist/index-consent.js.map +1 -0
- package/dist/index-consent.mjs +2 -0
- package/dist/index-consent.mjs.map +1 -0
- package/dist/index-engagement.js.map +1 -1
- package/dist/index-engagement.mjs +1 -1
- package/dist/index-graph.d.cts +3 -2
- package/dist/index-graph.d.ts +3 -2
- package/dist/index-graph.js.map +1 -1
- package/dist/index-graph.mjs +1 -1
- package/dist/index-local.d.cts +2 -1
- package/dist/index-local.d.ts +2 -1
- package/dist/index-style-sample.js +1 -1
- package/dist/index-style-sample.js.map +1 -1
- package/dist/index-style-sample.mjs +1 -1
- package/dist/index-style-sample.mjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +7 -1
- package/dist/chunk-DGRAS5VP.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Z}from"./chunk-WKXD7KI3.mjs";import{
|
|
1
|
+
import{a as Z}from"./chunk-WKXD7KI3.mjs";import{a as j,d as J,e as H,f as q,g as se}from"./chunk-Z6ILOYBD.mjs";import{K as Q,M as X}from"./chunk-EUD4PUKP.mjs";import"./chunk-NCLBL5V3.mjs";import"./chunk-2NVSFI4V.mjs";import{a as $,b as z}from"./chunk-TMCGHANO.mjs";import{fnv1a as ue}from"@sentientui/policy";var ee=[100,300,1e3,3e3,1e4],ie=250,ae=1e3,ce=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function te(t,o){t.n++;let e=o-t.mean;t.mean+=e/t.n,t.m2+=e*(o-t.mean)}var ne=t=>t.n>1?Math.sqrt(t.m2/t.n):0;function le(t){var o;try{let e=t.createElement("canvas"),u=e.getContext("webgl")||e.getContext("experimental-webgl");if(!u)return"unknown";let d=u.getExtension("WEBGL_debug_renderer_info"),p=d?String((o=u.getParameter(d.UNMASKED_RENDERER_WEBGL))!=null?o:""):"";return p?/swiftshader|llvmpipe|softpipe|software|mesa offscreen/i.test(p)?"sw":"hw":"unknown"}catch(e){return"unknown"}}function re(t,o=Date.now){var a,c;let e=(a=t.defaultView)!=null?a:typeof window!="undefined"?window:void 0,u={n:0,mean:0,m2:0},d={n:0,mean:0,m2:0},p=[0,0,0,0,0,0],_=0,G=0,k=0,U=0,g=0,V=0,T=0,h=0,I=0,b=0,L=-1/0,C=-1/0,m=null,w=null,A=null,x=(c=e==null?void 0:e.scrollY)!=null?c:0,N=0,f=t.hidden?null:o(),E=()=>{let n=o();if(A!=null){let l=n-A,v=0;for(;v<ee.length&&l>=ee[v];)v++;p[v]++}A=n},O=()=>{_++,L=o()},R=()=>{G++,C=o()},M=()=>{m=o()},D=()=>{m!=null&&(te(u,o()-m),m=null)},P=()=>{let n=o();k++,n-L>ie&&n-C>ae&&U++,E()},S=()=>{g++},W=()=>{var l;let n=(l=e==null?void 0:e.scrollY)!=null?l:0;V+=Math.abs(n-x),x=n,E()},K=n=>{let l=o();T++,(n.key==="Backspace"||n.key==="Delete")&&I++,ce.has(n.key)&&b++,w!=null&&te(d,l-w),w=l,E()},F=n=>{let l=n.data;typeof l=="string"&&(h+=l.length),E()},B=()=>{let n=o();t.hidden?f!=null&&(N+=n-f,f=null):f==null&&(f=n)},i={passive:!0,capture:!0};t.addEventListener("mousemove",O,i),t.addEventListener("touchstart",R,i),t.addEventListener("touchmove",S,i),t.addEventListener("mousedown",M,i),t.addEventListener("mouseup",D,i),t.addEventListener("click",P,i),t.addEventListener("wheel",S,i),t.addEventListener("keydown",K,i),t.addEventListener("input",F,i),t.addEventListener("visibilitychange",B),e==null||e.addEventListener("scroll",W,i);let r=le(t),s=(()=>{var n;try{return((n=e==null?void 0:e.matchMedia)==null?void 0:n.call(e,"(prefers-reduced-motion: reduce)").matches)===!0}catch(l){return!1}})();return{snapshot(){var v,y;let n=o(),l=N+(f!=null?n-f:0);return{v:1,active_ms:Math.round(l),mm:_,mm_rate:l>0?Number((_*1e3/l).toFixed(2)):0,touches:G,clicks:k,hold_n:u.n,hold_mean:Math.round(u.mean),hold_std:Math.round(ne(u)),teleport:U,wheel:g,scroll_px:Math.round(V),keydowns:T,input_chars:h,ik_cv:d.mean>0?Number((ne(d)/d.mean).toFixed(2)):0,backspaces:I,gaps:[...p],reduced_motion:s,kb_nav:b,renderer:r,vp:[(v=e==null?void 0:e.innerWidth)!=null?v:0,(y=e==null?void 0:e.innerHeight)!=null?y:0],dpr:(e==null?void 0:e.devicePixelRatio)||1}},stop(){t.removeEventListener("mousemove",O,i),t.removeEventListener("touchstart",R,i),t.removeEventListener("touchmove",S,i),t.removeEventListener("mousedown",M,i),t.removeEventListener("mouseup",D,i),t.removeEventListener("click",P,i),t.removeEventListener("wheel",S,i),t.removeEventListener("keydown",K,i),t.removeEventListener("input",F,i),t.removeEventListener("visibilitychange",B),e==null||e.removeEventListener("scroll",W,i)}}}var de="section, header, footer, nav, main > div, [data-sentient-section]",me=2e4,oe="__session__";function pe(t){let o=Array.from(t.querySelectorAll(de)),e=o.filter(u=>o.filter(d=>d!==u&&u.contains(d)).length<2);return e.filter(u=>!e.some(d=>d!==u&&d.contains(u)))}function fe(t,o,e,u){try{fetch(`${o}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${t}`},body:JSON.stringify({pageUrl:e,sections:u})}).catch(()=>{})}catch(d){}}var Y=()=>{};function ve(t,o){var x,N,f,E,O,R,M,D,P,S,W,K,F,B,i;let e=(x=o.doc)!=null?x:typeof document!="undefined"?document:void 0;if(!e||typeof IntersectionObserver=="undefined"||X()||!o.apiKey||!o.apiKey.startsWith("pk_"))return Y;let u=((N=o.apiBase)!=null?N:"https://api.sentient-ui.com").replace(/\/+$/,"").replace(/\/v1$/,""),d=pe(e);if(d.length===0)return Y;let p=new Map,_=[];for(let r of d){let s=(O=[(E=o.sectionTypes)==null?void 0:E[(f=r.getAttribute("data-sentient-id"))!=null?f:""],r.getAttribute("data-sentient-type")].find(y=>j.includes(y)))!=null?O:null,a=q(r),c=(M=s!=null?s:(R=o.typeOf)==null?void 0:R.call(o,r))!=null?M:H(a).type,n=Z(r,e),l=n?`nc-${c}-${ue(JSON.stringify({id:(D=n.id)!=null?D:null,dataAttr:(P=n.dataAttr)!=null?P:null,selector:(S=n.selector)!=null?S:null})).toString(36)}`:`nc-${c}`;p.set(r,l);let v=J.filter(([,y])=>y.test(a.bodyText)).map(([y])=>y);_.push(z($({componentId:l,semanticType:c,source:s?"markup":"auto"},n?{locator:n}:{}),{observation:$($({tag:a.tag,idClass:a.idClass.slice(0,200),headingText:a.headingText,textLength:a.textLength,actionCount:a.actionCount},a.ariaRole?{ariaRole:a.ariaRole}:{}),v.length>0?{patternFlags:v}:{})}))}let G=(B=(F=(K=(W=e.defaultView)!=null?W:typeof window!="undefined"?window:void 0)==null?void 0:K.location)==null?void 0:F.pathname)!=null?B:"/";fe(o.apiKey,u,G,_);let k=re(e),U=()=>{let r;try{r=k.snapshot()}catch(s){return}try{t.track({projectId:o.apiKey,componentId:oe,eventType:"interaction_stats",payload:r})}catch(s){}},g=new Map,V=r=>{let s=g.get(r);return s||(s={ms:0,scroll:0,enterAt:null,intersecting:!1},g.set(r,s)),s},T=new IntersectionObserver(r=>{for(let s of r){let a=p.get(s.target);if(!a)continue;let c=V(a);s.isIntersecting?(c.intersecting=!0,c.enterAt=Date.now(),s.intersectionRatio>c.scroll&&(c.scroll=s.intersectionRatio)):(c.intersecting=!1,c.enterAt!=null&&(c.ms+=Date.now()-c.enterAt,c.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let r of p.keys())T.observe(r);let h=(r=!1)=>{var a;let s=Date.now();for(let[c,n]of g)if(n.enterAt!=null&&(n.ms+=s-n.enterAt,n.enterAt=null),!(n.ms<=0)){try{t.track({projectId:o.apiKey,componentId:c,eventType:"dwell",payload:{dwell_time:Math.round(n.ms),scroll_depth:Number(n.scroll.toFixed(2))}})}catch(l){}n.ms=0}if(U(),r)try{(a=t.flush)==null||a.call(t)}catch(c){}},I=()=>{if(e.hidden)h(!0);else{let r=Date.now();for(let s of g.values())s.intersecting&&(s.enterAt=r)}},b=!1,L=r=>{if(h(!0),r!=null&&r.persisted){b=!0;return}try{T.disconnect()}catch(s){}},C=r=>{if(!(r!=null&&r.persisted)||!b)return;b=!1;let s=Date.now();for(let a of g.values())a.enterAt=a.intersecting&&!e.hidden?s:null};e.addEventListener("visibilitychange",I);let m=(i=e.defaultView)!=null?i:typeof window!="undefined"?window:void 0;m==null||m.addEventListener("pagehide",L),m==null||m.addEventListener("pageshow",C);let w=setInterval(()=>{if(e.hidden||b)return;h();let r=Date.now();for(let s of g.values())s.intersecting&&(s.enterAt=r)},me),A=[];return o.microSignals&&[...p.entries()].forEach(([r,s],a)=>{A.push(Q((c,n={})=>{try{t.track({projectId:o.apiKey,componentId:s,eventType:"micro_signal",payload:$({signalType:c},n)})}catch(l){}},r,void 0,{tabLoss:a===0}))}),()=>{h(!0),clearInterval(w),k.stop(),e.removeEventListener("visibilitychange",I),m==null||m.removeEventListener("pagehide",L),m==null||m.removeEventListener("pageshow",C);for(let r of A)r();try{T.disconnect()}catch(r){}}}export{oe as INTERACTION_STATS_COMPONENT,j as SEMANTIC_TYPES,H as classifyFeatures,se as classifySection,q as featuresFromElement,ve as startEngagementCapture};
|
|
2
2
|
//# sourceMappingURL=index-engagement.mjs.map
|
package/dist/index-graph.d.cts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { q as SentientConfig, p as SentientClient } from './index-
|
|
2
|
-
export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, f as EventType, h as GraphClient, i as GraphConfig, j as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, l as MicroSignalType, n as PageNode, Q as QueueConfig, r as SentientEvent, s as SessionConfig, t as SessionManager, v as attachMicroSignalDetectors, w as grantConsent, y as isDoNotTrackEnabled, H as sanitizePageUrl, I as sessionCookieName } from './index-
|
|
1
|
+
import { q as SentientConfig, p as SentientClient } from './index-Dg2gkw_l.cjs';
|
|
2
|
+
export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, f as EventType, h as GraphClient, i as GraphConfig, j as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, l as MicroSignalType, n as PageNode, Q as QueueConfig, r as SentientEvent, s as SessionConfig, t as SessionManager, v as attachMicroSignalDetectors, w as grantConsent, y as isDoNotTrackEnabled, H as sanitizePageUrl, I as sessionCookieName } from './index-Dg2gkw_l.cjs';
|
|
3
3
|
import { b as CompoundLocator } from './session-meta-CJwAWbJr.cjs';
|
|
4
4
|
export { D as DecisionSnapshot, S as SNAPSHOT_STORAGE_KEY_PREFIX, d as SlotConfigEntry, e as SlotDeclInput, f as SlotOps, i as armOfResult, j as baselineResultFor, k as baselineSlots, n as deriveSessionSegment, o as detectDeviceClass, p as detectTimeOfDay, q as detectTrafficSource, t as readSnapshot, u as referrerDomainFromReferer, v as renderPrePaintScript, w as toWireSlot, y as writeSnapshot } from './session-meta-CJwAWbJr.cjs';
|
|
5
5
|
export { B as BLOCK_ALIGNS, a as BLOCK_EMPHASES, b as BLOCK_FITS, c as BLOCK_GAPS, d as BLOCK_GRID_COLUMNS, e as BLOCK_HEADING_LEVELS, f as BLOCK_JUSTIFIES, g as BLOCK_MAX_WIDTHS, h as BLOCK_PADS, i as BLOCK_RATIOS, j as BLOCK_SIZES, k as BLOCK_SURFACES, l as BLOCK_TEXT_ALIGNS, m as BLOCK_TONES, n as BLOCK_WEIGHTS, o as BadgeBlock, p as BlockAlign, q as BlockEmphasis, r as BlockFit, s as BlockGap, t as BlockJustify, u as BlockMaxWidth, v as BlockNode, w as BlockPad, x as BlockRatio, y as BlockSize, z as BlockSurface, A as BlockTextAlign, C as BlockTone, D as BlockWeight, E as ButtonBlock, G as DividerBlock, H as FORM_FIELD_KINDS, I as FORM_INPUT_TYPES, J as FormBlock, K as FormField, L as GridBlock, M as HeadingBlock, N as ImageBlock, P as LinkBlock, Q as MAX_BLOCK_ARMS, R as MAX_BLOCK_CHILDREN, S as MAX_BLOCK_DEPTH, T as MAX_BLOCK_NODES, U as MAX_BLOCK_TEXT_LEN, V as MAX_FORM_FIELDS, W as MAX_FORM_SELECT_OPTIONS, $ as SitePalette, a0 as SpacerBlock, a1 as StackBlock, a5 as TextBlock, a6 as containsFormBlock } from './style-vocabulary-Ba_g6_DD.cjs';
|
|
6
6
|
export { SlotResult } from '@sentientui/policy';
|
|
7
7
|
import './region-skeleton-D2ahkcbe.cjs';
|
|
8
|
+
import './index-consent.cjs';
|
|
8
9
|
|
|
9
10
|
/** Reads the rendered DOM to build the page-side context graph. */
|
|
10
11
|
|
package/dist/index-graph.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { q as SentientConfig, p as SentientClient } from './index-
|
|
2
|
-
export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, f as EventType, h as GraphClient, i as GraphConfig, j as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, l as MicroSignalType, n as PageNode, Q as QueueConfig, r as SentientEvent, s as SessionConfig, t as SessionManager, v as attachMicroSignalDetectors, w as grantConsent, y as isDoNotTrackEnabled, H as sanitizePageUrl, I as sessionCookieName } from './index-
|
|
1
|
+
import { q as SentientConfig, p as SentientClient } from './index-DjbSOAEF.js';
|
|
2
|
+
export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, f as EventType, h as GraphClient, i as GraphConfig, j as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, l as MicroSignalType, n as PageNode, Q as QueueConfig, r as SentientEvent, s as SessionConfig, t as SessionManager, v as attachMicroSignalDetectors, w as grantConsent, y as isDoNotTrackEnabled, H as sanitizePageUrl, I as sessionCookieName } from './index-DjbSOAEF.js';
|
|
3
3
|
import { b as CompoundLocator } from './session-meta-CKXcaBjt.js';
|
|
4
4
|
export { D as DecisionSnapshot, S as SNAPSHOT_STORAGE_KEY_PREFIX, d as SlotConfigEntry, e as SlotDeclInput, f as SlotOps, i as armOfResult, j as baselineResultFor, k as baselineSlots, n as deriveSessionSegment, o as detectDeviceClass, p as detectTimeOfDay, q as detectTrafficSource, t as readSnapshot, u as referrerDomainFromReferer, v as renderPrePaintScript, w as toWireSlot, y as writeSnapshot } from './session-meta-CKXcaBjt.js';
|
|
5
5
|
export { B as BLOCK_ALIGNS, a as BLOCK_EMPHASES, b as BLOCK_FITS, c as BLOCK_GAPS, d as BLOCK_GRID_COLUMNS, e as BLOCK_HEADING_LEVELS, f as BLOCK_JUSTIFIES, g as BLOCK_MAX_WIDTHS, h as BLOCK_PADS, i as BLOCK_RATIOS, j as BLOCK_SIZES, k as BLOCK_SURFACES, l as BLOCK_TEXT_ALIGNS, m as BLOCK_TONES, n as BLOCK_WEIGHTS, o as BadgeBlock, p as BlockAlign, q as BlockEmphasis, r as BlockFit, s as BlockGap, t as BlockJustify, u as BlockMaxWidth, v as BlockNode, w as BlockPad, x as BlockRatio, y as BlockSize, z as BlockSurface, A as BlockTextAlign, C as BlockTone, D as BlockWeight, E as ButtonBlock, G as DividerBlock, H as FORM_FIELD_KINDS, I as FORM_INPUT_TYPES, J as FormBlock, K as FormField, L as GridBlock, M as HeadingBlock, N as ImageBlock, P as LinkBlock, Q as MAX_BLOCK_ARMS, R as MAX_BLOCK_CHILDREN, S as MAX_BLOCK_DEPTH, T as MAX_BLOCK_NODES, U as MAX_BLOCK_TEXT_LEN, V as MAX_FORM_FIELDS, W as MAX_FORM_SELECT_OPTIONS, $ as SitePalette, a0 as SpacerBlock, a1 as StackBlock, a5 as TextBlock, a6 as containsFormBlock } from './style-vocabulary-Ba_g6_DD.js';
|
|
6
6
|
export { SlotResult } from '@sentientui/policy';
|
|
7
7
|
import './region-skeleton-D2ahkcbe.js';
|
|
8
|
+
import './index-consent.js';
|
|
8
9
|
|
|
9
10
|
/** Reads the rendered DOM to build the page-side context graph. */
|
|
10
11
|
|