@merittdev/horus-lens 0.6.0 → 0.6.1
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/browser.cjs +1 -1
- package/dist/browser.js +3 -3
- package/dist/{chunk-XGZ7BZTS.js → chunk-KRNRUQ7I.js} +2 -2
- package/dist/{chunk-AS225HUA.js → chunk-QCSZ3U2C.js} +2 -2
- package/dist/{chunk-RVIL2GL4.js → chunk-XKTKSLJW.js} +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/lens.min.js +1 -1
- package/dist/react-native.cjs +141 -90
- package/dist/react-native.cjs.map +1 -1
- package/dist/react-native.js +141 -90
- package/dist/react-native.js.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-XGZ7BZTS.js.map → chunk-KRNRUQ7I.js.map} +0 -0
- /package/dist/{chunk-AS225HUA.js.map → chunk-QCSZ3U2C.js.map} +0 -0
- /package/dist/{chunk-RVIL2GL4.js.map → chunk-XKTKSLJW.js.map} +0 -0
package/dist/browser.cjs
CHANGED
|
@@ -33,7 +33,7 @@ module.exports = __toCommonJS(browser_exports);
|
|
|
33
33
|
|
|
34
34
|
// ../core/dist/chunk-YBVE6CBL.js
|
|
35
35
|
var SDK_NAME = "@merittdev/horus-lens";
|
|
36
|
-
var SDK_VERSION = true ? "0.6.
|
|
36
|
+
var SDK_VERSION = true ? "0.6.1" : "0.0.0-dev";
|
|
37
37
|
var DEFAULT_ENDPOINT = "https://api.horus.sh";
|
|
38
38
|
var DEFAULT_REPLAY_WINDOW_MS = 15e3;
|
|
39
39
|
var DEFAULT_MAX_CONSOLE_ENTRIES = 200;
|
package/dist/browser.js
CHANGED
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
isGateActive,
|
|
8
8
|
loaderSnippet,
|
|
9
9
|
processQueue
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-XKTKSLJW.js";
|
|
11
|
+
import "./chunk-QCSZ3U2C.js";
|
|
12
|
+
import "./chunk-KRNRUQ7I.js";
|
|
13
13
|
export {
|
|
14
14
|
DEFAULT_CDN_URL,
|
|
15
15
|
LOADER_SNIPPET,
|
|
@@ -14776,7 +14776,7 @@ var ApiErrorSchema = external_exports.object({
|
|
|
14776
14776
|
|
|
14777
14777
|
// ../core/dist/chunk-YBVE6CBL.js
|
|
14778
14778
|
var SDK_NAME = "@merittdev/horus-lens";
|
|
14779
|
-
var SDK_VERSION = true ? "0.6.
|
|
14779
|
+
var SDK_VERSION = true ? "0.6.1" : "0.0.0-dev";
|
|
14780
14780
|
var DEFAULT_ENDPOINT = "https://api.horus.sh";
|
|
14781
14781
|
var DEFAULT_REPLAY_WINDOW_MS = 15e3;
|
|
14782
14782
|
var DEFAULT_MAX_CONSOLE_ENTRIES = 200;
|
|
@@ -15079,4 +15079,4 @@ export {
|
|
|
15079
15079
|
Transport,
|
|
15080
15080
|
installConsole
|
|
15081
15081
|
};
|
|
15082
|
-
//# sourceMappingURL=chunk-
|
|
15082
|
+
//# sourceMappingURL=chunk-KRNRUQ7I.js.map
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
SDK_VERSION,
|
|
23
23
|
Transport,
|
|
24
24
|
installConsole
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-KRNRUQ7I.js";
|
|
26
26
|
|
|
27
27
|
// ../../node_modules/.pnpm/rrweb@2.1.0/node_modules/rrweb/dist/rrweb.js
|
|
28
28
|
var __defProp = Object.defineProperty;
|
|
@@ -15341,4 +15341,4 @@ rrweb/dist/rrweb.js:
|
|
|
15341
15341
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15342
15342
|
***************************************************************************** *)
|
|
15343
15343
|
*/
|
|
15344
|
-
//# sourceMappingURL=chunk-
|
|
15344
|
+
//# sourceMappingURL=chunk-QCSZ3U2C.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LensClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QCSZ3U2C.js";
|
|
4
4
|
import {
|
|
5
5
|
LENS_OVERLAY_HOST_ID
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KRNRUQ7I.js";
|
|
7
7
|
|
|
8
8
|
// ../browser/dist/index.js
|
|
9
9
|
var DEFAULT_PARAM_NAME = "lens";
|
|
@@ -2726,4 +2726,4 @@ export {
|
|
|
2726
2726
|
boot,
|
|
2727
2727
|
autoBoot
|
|
2728
2728
|
};
|
|
2729
|
-
//# sourceMappingURL=chunk-
|
|
2729
|
+
//# sourceMappingURL=chunk-XKTKSLJW.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -14824,7 +14824,7 @@ var ApiErrorSchema = external_exports.object({
|
|
|
14824
14824
|
|
|
14825
14825
|
// ../core/dist/chunk-YBVE6CBL.js
|
|
14826
14826
|
var SDK_NAME = "@merittdev/horus-lens";
|
|
14827
|
-
var SDK_VERSION = true ? "0.6.
|
|
14827
|
+
var SDK_VERSION = true ? "0.6.1" : "0.0.0-dev";
|
|
14828
14828
|
var DEFAULT_ENDPOINT = "https://api.horus.sh";
|
|
14829
14829
|
var DEFAULT_REPLAY_WINDOW_MS = 15e3;
|
|
14830
14830
|
var DEFAULT_MAX_CONSOLE_ENTRIES = 200;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LensClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QCSZ3U2C.js";
|
|
4
4
|
import {
|
|
5
5
|
ACCESS_ID_PREFIX,
|
|
6
6
|
ACCESS_SECRET_PREFIX,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
TargetElementSchema,
|
|
31
31
|
isAccessId,
|
|
32
32
|
isAccessSecret
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-KRNRUQ7I.js";
|
|
34
34
|
export {
|
|
35
35
|
ACCESS_ID_PREFIX,
|
|
36
36
|
ACCESS_SECRET_PREFIX,
|
package/dist/lens.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var LensSDK=(()=>{var Yo=Object.defineProperty;var Pb=Object.getOwnPropertyDescriptor;var Ab=Object.getOwnPropertyNames;var Mb=Object.prototype.hasOwnProperty;var Ve=(e,r)=>{for(var n in r)Yo(e,n,{get:r[n],enumerable:!0})},Ub=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Ab(r))!Mb.call(e,t)&&t!==n&&Yo(e,t,{get:()=>r[t],enumerable:!(o=Pb(r,t))||o.enumerable});return e};var Lb=e=>Ub(Yo({},"__esModule",{value:!0}),e);var L0={};Ve(L0,{DEFAULT_CDN_URL:()=>Db,LOADER_SNIPPET:()=>A0,autoBoot:()=>Rb,boot:()=>Xo,installGlobal:()=>_r,isGateActive:()=>Eb,loaderSnippet:()=>zb,processQueue:()=>Tb});var op="@merittdev/horus-lens",sp="0.6.
|
|
1
|
+
"use strict";var LensSDK=(()=>{var Yo=Object.defineProperty;var Pb=Object.getOwnPropertyDescriptor;var Ab=Object.getOwnPropertyNames;var Mb=Object.prototype.hasOwnProperty;var Ve=(e,r)=>{for(var n in r)Yo(e,n,{get:r[n],enumerable:!0})},Ub=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Ab(r))!Mb.call(e,t)&&t!==n&&Yo(e,t,{get:()=>r[t],enumerable:!(o=Pb(r,t))||o.enumerable});return e};var Lb=e=>Ub(Yo({},"__esModule",{value:!0}),e);var L0={};Ve(L0,{DEFAULT_CDN_URL:()=>Db,LOADER_SNIPPET:()=>A0,autoBoot:()=>Rb,boot:()=>Xo,installGlobal:()=>_r,isGateActive:()=>Eb,loaderSnippet:()=>zb,processQueue:()=>Tb});var op="@merittdev/horus-lens",sp="0.6.1",ap="https://api.horus.sh",lp=15e3,cp=200,up=100,dp=100,fp=50,_n=30,np=2e3,pp=2*1024*1024,hp=200,Sn=2e4,mp=3500,gp=2,vp=25e5,yp=600*1e3,bp=5,wp=12e4,xp=1e4,$n="__lens_root__",kn=class{constructor(e){if(this.capacity=e,e<=0)throw new Error("RingBuffer capacity must be > 0")}capacity;items=[];push(e){this.items.push(e),this.items.length>this.capacity&&this.items.splice(0,this.items.length-this.capacity)}drain(){return[...this.items]}tail(e){return this.items.slice(-e)}clear(){this.items=[]}get size(){return this.items.length}},ip=class extends Error{constructor(e,r){super(r),this.status=e,this.name="HttpError"}status},_p=class{constructor(e){this.config=e}config;async initiate(e){let r={accessId:this.config.accessId,assets:e};return this.postJson(`${this.config.endpoint}/v1/reports/initiate`,r,{retries:0})}async attachAsset(e,r){let n={accessId:this.config.accessId,...r};await this.postJson(`${this.config.endpoint}/v1/reports/${encodeURIComponent(e)}/assets`,n)}async uploadAsset(e,r,n){let o=this.config.signal,t=o?new AbortController:void 0,i=()=>t?.abort();(o?.aborted||n?.aborted)&&i(),o?.addEventListener("abort",i),t&&n?.addEventListener("abort",i);try{let s=await(this.config.fetch??fetch)(e.url,{method:e.method,headers:e.headers,body:r,signal:t?.signal??n});if(!s.ok)throw new Error(`Asset upload failed (${e.kind}): ${s.status}`)}finally{o?.removeEventListener("abort",i),t&&n?.removeEventListener("abort",i)}}async finalize(e,r,n){let o={accessId:this.config.accessId,metadata:r,uploadedAssets:n};try{return await this.postJson(`${this.config.endpoint}/v1/reports/${e}/finalize`,o)}catch(t){if(t instanceof ip&&t.status===409)return{reportId:e,status:"submitted"};throw t}}async postJson(e,r,n={}){let o=n.retries??1,t;for(let i=0;i<=o;i++){let s=this.config.requestTimeoutMs||this.config.signal?new AbortController:void 0,a=()=>s?.abort(),c=this.config.signal;if(c?.aborted)throw new Error("Capture session ended");c?.addEventListener("abort",a);let u=s&&this.config.requestTimeoutMs?setTimeout(()=>s.abort(),this.config.requestTimeoutMs):void 0;try{let l=await(this.config.fetch??fetch)(e,{method:"POST",headers:{"content-type":"application/json",...this.config.origin?{Origin:this.config.origin}:{}},body:JSON.stringify(r),...s?{signal:s.signal}:{}});if(!l.ok){let p=await l.text().catch(()=>"");throw new ip(l.status,`Request to ${e} failed: ${l.status} ${p}`.trim())}return await l.json()}catch(l){t=l,this.config.debug&&console.warn(`[lens] request failed (attempt ${i+1}/${o+1})`,l)}finally{u!==void 0&&clearTimeout(u),c?.removeEventListener("abort",a)}}throw t}},jb=["log","info","warn","error","debug"];function xn(e){return e.length>np?`${e.slice(0,np)}\u2026[truncated]`:e}function Sp(e){if(e===null)return"null";if(e===void 0)return"undefined";let r=typeof e;if(r==="string")return xn(e);if(r==="number"||r==="boolean"||r==="bigint"||r==="symbol")return String(e);if(r==="function")return`[Function: ${e.name||"anonymous"}]`;if(e instanceof Error)return xn(e.stack?`${e.name}: ${e.message}
|
|
2
2
|
${e.stack}`:`${e.name}: ${e.message}`);try{let n=new WeakSet,o=JSON.stringify(e,(t,i)=>{if(typeof i=="bigint")return String(i);if(typeof i=="function")return"[Function]";if(typeof i=="object"&&i!==null){if(n.has(i))return"[Circular]";n.add(i)}return i});return xn(o??String(e))}catch{return xn(String(e))}}function Fb(e){for(let r of e)if(r instanceof Error&&r.stack)return r.stack}function $p(e,r){if(typeof console>"u")return()=>{};let n=console,o=[],t=!0;for(let i of jb){let s=n[i];if(typeof s!="function")continue;let a=(...c)=>{if(!t){s.apply(console,c);return}try{let u=c.map(Sp),l=Date.now();if(e.push({level:i,args:u,timestamp:l}),i==="error"){let p=Fb(c),f={message:u.join(" ")||"console.error",source:"console.error",timestamp:l};p&&(f.stack=p),r.push(f)}}catch{}s.apply(console,c)};n[i]=a,o.push(()=>{n[i]===a&&(n[i]=s)})}return()=>{t=!1;for(let i of o)i()}}var Zb=Object.defineProperty,Bb=(e,r,n)=>r in e?Zb(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,A=(e,r,n)=>Bb(e,typeof r!="symbol"?r+"":r,n),kp,Wb=Object.defineProperty,Vb=(e,r,n)=>r in e?Wb(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,Ip=(e,r,n)=>Vb(e,typeof r!="symbol"?r+"":r,n),pe=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(pe||{}),Ep={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Cp={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},In={},Hh={},qb=()=>!!globalThis.Zone;function ya(e){if(In[e])return In[e];let r=globalThis[e],n=r.prototype,o=e in Ep?Ep[e]:void 0,t=!!(o&&o.every(a=>{var c,u;return!!((u=(c=Object.getOwnPropertyDescriptor(n,a))==null?void 0:c.get)!=null&&u.toString().includes("[native code]"))})),i=e in Cp?Cp[e]:void 0,s=!!(i&&i.every(a=>{var c;return typeof n[a]=="function"&&((c=n[a])==null?void 0:c.toString().includes("[native code]"))}));if(t&&s&&!qb())return In[e]=r.prototype,r.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let c=a.contentWindow;if(!c)return r.prototype;let u=c[e].prototype;if(!u)return a.remove(),n;let l=navigator.userAgent;return l.includes("Safari")&&!l.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Hh[e]=()=>a.remove()):a.remove(),In[e]=u}catch{return n}}var Qo={};function Qe(e,r,n){var o;let t=`${e}.${String(n)}`;if(Qo[t])return Qo[t].call(r);let i=ya(e),s=(o=Object.getOwnPropertyDescriptor(i,n))==null?void 0:o.get;return s?(Qo[t]=s,s.call(r)):r[n]}var es={};function Xh(e,r,n){let o=`${e}.${String(n)}`;if(es[o])return es[o].bind(r);let i=ya(e)[n];return typeof i!="function"?r[n]:(es[o]=i,i.bind(r))}function Gb(e){return Qe("Node",e,"ownerDocument")}function Jb(e){return Qe("Node",e,"childNodes")}function Hb(e){return Qe("Node",e,"parentNode")}function Xb(e){return Qe("Node",e,"parentElement")}function Kb(e){return Qe("Node",e,"textContent")}function Yb(e,r){return Xh("Node",e,"contains")(r)}function Qb(e){return Xh("Node",e,"getRootNode")()}function ew(e){return!e||!("host"in e)?null:Qe("ShadowRoot",e,"host")}function tw(e){return e.styleSheets}function rw(e){return!e||!("shadowRoot"in e)?null:Qe("Element",e,"shadowRoot")}function nw(e,r){return Qe("Element",e,"querySelector")(r)}function iw(e,r){return Qe("Element",e,"querySelectorAll")(r)}function ow(){return[ya("MutationObserver").constructor,Hh.MutationObserver??(()=>{})]}var Kh=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Kh=()=>new Date().getTime());function sw(e,r,n){try{if(!(r in e))return()=>{};let o=e[r],t=n(o);return typeof t=="function"&&(t.prototype=t.prototype||{},Object.defineProperties(t,{__rrweb_original__:{enumerable:!1,value:o}})),e[r]=t,()=>{e[r]=o}}catch{return()=>{}}}var ve={ownerDocument:Gb,childNodes:Jb,parentNode:Hb,parentElement:Xb,textContent:Kb,contains:Yb,getRootNode:Qb,host:ew,styleSheets:tw,shadowRoot:rw,querySelector:nw,querySelectorAll:iw,nowTimestamp:Kh,mutationObserverCtor:ow,patch:sw};function Yh(e){return e.nodeType===e.ELEMENT_NODE}function kr(e){let r=e&&"host"in e&&"mode"in e&&ve.host(e)||null;return!!(r&&"shadowRoot"in r&&ve.shadowRoot(r)===e)}function Ir(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function aw(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function lw(e){let{cssText:r}=e;if(r.split('"').length<3)return r;let n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function oa(e){try{let r=e.rules||e.cssRules;if(!r)return null;let n=e.href;!n&&e.ownerNode&&(n=e.ownerNode.baseURI);let o=Array.from(r,t=>Qh(t,n)).join("");return aw(o)}catch{return null}}function Qh(e,r){if(uw(e)){let n;try{n=oa(e.styleSheet)||lw(e)}catch{n=e.cssText}return e.styleSheet.href?jn(n,e.styleSheet.href):n}else{let n=e.cssText;return dw(e)&&e.selectorText.includes(":")&&(n=cw(n)),r?jn(n,r):n}}function cw(e){let r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(r,"$1\\$2")}function uw(e){return"styleSheet"in e}function dw(e){return"selectorText"in e}var Mn=class{constructor(){Ip(this,"idNodeMap",new Map),Ip(this,"nodeMetaMap",new WeakMap)}getId(r){var n;return r?((n=this.getMeta(r))==null?void 0:n.id)??-1:-1}getNode(r){return this.idNodeMap.get(r)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(r){return this.nodeMetaMap.get(r)||null}removeNodeFromMap(r){let n=this.getId(r);this.idNodeMap.delete(n),r.childNodes&&r.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(r){return this.idNodeMap.has(r)}hasNode(r){return this.nodeMetaMap.has(r)}add(r,n){let o=n.id;this.idNodeMap.set(o,r),this.nodeMetaMap.set(r,n)}replace(r,n){let o=this.getNode(r);if(o){let t=this.nodeMetaMap.get(o);t&&this.nodeMetaMap.set(n,t)}this.idNodeMap.set(r,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function fw(){return new Mn}function Un({element:e,maskInputOptions:r,tagName:n,type:o,value:t,maskInputFn:i}){let s=t||"",a=o&&_t(o);return(r[n.toLowerCase()]||a&&r[a])&&(i?s=i(s,e):s="*".repeat(s.length)),s}function _t(e){return e.toLowerCase()}var Op="__rrweb_original__";function pw(e){let r=e.getContext("2d");if(!r)return!0;let n=50;for(let o=0;o<e.width;o+=n)for(let t=0;t<e.height;t+=n){let i=r.getImageData,s=Op in i?i[Op]:i;if(new Uint32Array(s.call(r,o,t,Math.min(n,e.width-o),Math.min(n,e.height-t)).data.buffer).some(c=>c!==0))return!1}return!0}function Ln(e){let r=e.type;return e.hasAttribute("data-rr-is-password")?"password":r?_t(r):null}function em(e,r){let n;try{n=new URL(e,r??window.location.href)}catch{return null}let o=/\.([0-9a-z]+)(?:$)/i,t=n.pathname.match(o);return t?.[1]??null}function hw(e){let r="";return e.indexOf("//")>-1?r=e.split("/").slice(0,3).join("/"):r=e.split("/")[0],r=r.split("?")[0],r}var mw=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,gw=/^(?:[a-z+]+:)?\/\//i,vw=/^www\..*/i,yw=/^(data:)([^,]*),(.*)/i;function jn(e,r){return(e||"").replace(mw,(n,o,t,i,s,a)=>{let c=t||s||a,u=o||i||"";if(!c)return n;if(gw.test(c)||vw.test(c))return`url(${u}${c}${u})`;if(yw.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${hw(r)+c}${u})`;let l=c.split("#")[0],p=c.substring(l.length),f=r.split("#")[0].split("/"),d=l.split("/");f.pop();for(let m of d)m!=="."&&(m===".."?f.pop():f.push(m));return`url(${u}${f.join("/")}${p}${u})`})}function En(e,r=!1){return r?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function bw(e,r,n=!1){let o=Array.from(r.childNodes),t=[],i=0;if(o.length>1&&e&&typeof e=="string"){let s=En(e,n),a=s.length/e.length;for(let c=1;c<o.length;c++)if(o[c].textContent&&typeof o[c].textContent=="string"){let u=En(o[c].textContent,n),l=100,p=3;for(;p<u.length&&(u[p].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,p),1)!==-1);p++);for(;p<u.length;p++){let f=u.substring(0,p),d=s.split(f),m=-1;if(d.length===2)m=d[0].length;else if(d.length>2&&d[0]===""&&o[c-1].textContent!=="")m=s.indexOf(f,1);else if(d.length===1){if(f=f.substring(0,f.length-1),d=s.split(f),d.length<=1)return t.push(e),t;p=l+1}else p===u.length-1&&(m=s.indexOf(f));if(d.length>=2&&p>l){let h=o[c-1].textContent;if(h&&typeof h=="string"){let g=En(h).length;m=s.indexOf(f,g)}m===-1&&(m=d[0].length)}if(m!==-1){let h=Math.floor(m/a);for(;h>0&&h<e.length;){if(i+=1,i>50*o.length)return t.push(e),t;let g=En(e.substring(0,h),n);if(g.length===m){t.push(e.substring(0,h)),e=e.substring(h),s=s.substring(m);break}else g.length<m?h+=Math.max(1,Math.floor((m-g.length)/a)):h-=Math.max(1,Math.floor((g.length-m)*a))}break}}}}return t.push(e),t}function ww(e,r){return bw(e,r).join("/* rr_split */")}var xw=1,_w=new RegExp("[^a-z0-9-_:]"),Cr=-2;function tm(){return xw++}function Sw(e){if(e instanceof HTMLFormElement)return"form";let r=_t(e.tagName);return _w.test(r)?"div":r}var Pt,Np,$w=/^[^ \t\n\r\u000c]+/,kw=/^[, \t\n\r\u000c]+/;function Iw(e,r){if(r.trim()==="")return r;let n=0;function o(i){let s,a=i.exec(r.substring(n));return a?(s=a[0],n+=s.length,s):""}let t=[];for(;o(kw),!(n>=r.length);){let i=o($w);if(i.slice(-1)===",")i=Ut(e,i.substring(0,i.length-1)),t.push(i);else{let s="";i=Ut(e,i);let a=!1;for(;;){let c=r.charAt(n);if(c===""){t.push((i+s).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,t.push((i+s).trim());break}else c==="("&&(a=!0);s+=c,n+=1}}}return t.join(", ")}var Tp=new WeakMap;function Ut(e,r){return!r||r.trim()===""?r:ba(e,r)}function Ew(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ba(e,r){let n=Tp.get(e);if(n||(n=e.createElement("a"),Tp.set(e,n)),!r)r="";else if(r.startsWith("blob:")||r.startsWith("data:"))return r;return n.setAttribute("href",r),n.href}function rm(e,r,n,o){return o&&(n==="src"||n==="href"&&!(r==="use"&&o[0]==="#")||n==="xlink:href"&&o[0]!=="#"||n==="background"&&["table","td","th"].includes(r)?Ut(e,o):n==="srcset"?Iw(e,o):n==="style"?jn(o,ba(e)):r==="object"&&n==="data"?Ut(e,o):o)}function nm(e,r,n){return["video","audio"].includes(e)&&r==="autoplay"}function Cw(e,r,n){try{if(typeof r=="string"){if(e.classList.contains(r))return!0}else for(let o=e.classList.length;o--;){let t=e.classList[o];if(r.test(t))return!0}if(n)return e.matches(n)}catch{}return!1}function Fn(e,r,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Fn(ve.parentNode(e),r,n):!1;for(let o=e.classList.length;o--;){let t=e.classList[o];if(r.test(t))return!0}return n?Fn(ve.parentNode(e),r,n):!1}function im(e,r,n,o){let t;if(Yh(e)){if(t=e,!ve.childNodes(t).length)return!1}else{if(ve.parentElement(e)===null)return!1;t=ve.parentElement(e)}try{if(typeof r=="string"){if(o){if(t.closest(`.${r}`))return!0}else if(t.classList.contains(r))return!0}else if(Fn(t,r,o))return!0;if(n){if(o){if(t.closest(n))return!0}else if(t.matches(n))return!0}}catch{}return!1}function Ow(e,r,n){let o=e.contentWindow;if(!o)return;let t=!1,i;try{i=o.document.readyState}catch{return}if(i!=="complete"){let a=setTimeout(()=>{t||(r(),t=!0)},n);e.addEventListener("load",()=>{clearTimeout(a),t=!0,r()});return}let s="about:blank";if(o.location.href!==s||e.src===s||e.src==="")return setTimeout(r,0),e.addEventListener("load",r);e.addEventListener("load",r)}function Nw(e,r,n){let o=!1,t;try{t=e.sheet}catch{return}if(t)return;let i=setTimeout(()=>{o||(r(),o=!0)},n);e.addEventListener("load",()=>{clearTimeout(i),o=!0,r()})}function Tw(e,r){let{doc:n,mirror:o,blockClass:t,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:c={},maskTextFn:u,maskInputFn:l,dataURLOptions:p={},inlineImages:f,recordCanvas:d,keepIframeSrcFn:m,newlyAddedElement:h=!1,cssCaptured:g=!1}=r,x=Dw(n,o);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:pe.Document,childNodes:[],compatMode:e.compatMode}:{type:pe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:pe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:x};case e.ELEMENT_NODE:return Rw(e,{doc:n,blockClass:t,blockSelector:i,inlineStylesheet:a,maskInputOptions:c,maskInputFn:l,dataURLOptions:p,inlineImages:f,recordCanvas:d,keepIframeSrcFn:m,newlyAddedElement:h,rootId:x});case e.TEXT_NODE:return zw(e,{doc:n,needsMask:s,maskTextFn:u,rootId:x,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:pe.CDATA,textContent:"",rootId:x};case e.COMMENT_NODE:return{type:pe.Comment,textContent:ve.textContent(e)||"",rootId:x};default:return!1}}function Dw(e,r){if(!r.hasNode(e))return;let n=r.getId(e);return n===1?void 0:n}function zw(e,r){let{needsMask:n,maskTextFn:o,rootId:t,cssCaptured:i}=r,s=ve.parentNode(e),a=s&&s.tagName,c="",u=a==="STYLE"?!0:void 0,l=a==="SCRIPT"?!0:void 0;return l?c="SCRIPT_PLACEHOLDER":i||(c=ve.textContent(e),u&&c&&(c=jn(c,ba(r.doc)))),!u&&!l&&c&&n&&(c=o?o(c,ve.parentElement(e)):c.replace(/[\S]/g,"*")),{type:pe.Text,textContent:c||"",rootId:t}}function Rw(e,r){let{doc:n,blockClass:o,blockSelector:t,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:c={},inlineImages:u,recordCanvas:l,keepIframeSrcFn:p,newlyAddedElement:f=!1,rootId:d}=r,m=Cw(e,o,t),h=Sw(e),g={},x=e.attributes.length;for(let y=0;y<x;y++){let _=e.attributes[y];nm(h,_.name,_.value)||(g[_.name]=rm(n,h,_t(_.name),_.value))}if(h==="link"&&i){let y=Array.from(n.styleSheets).find(b=>b.href===e.href),_=null;y&&(_=oa(y)),_&&(delete g.rel,delete g.href,g._cssText=_)}if(h==="style"&&e.sheet){let y=oa(e.sheet);y&&(e.childNodes.length>1&&(y=ww(y,e)),g._cssText=y)}if(["input","textarea","select"].includes(h)){let y=e.value,_=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&y?g.value=Un({element:e,type:Ln(e),tagName:h,value:y,maskInputOptions:s,maskInputFn:a}):_&&(g.checked=_)}if(h==="option"&&(e.selected&&!s.select?g.selected=!0:delete g.selected),h==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),h==="canvas"&&l){if(e.__context==="2d")pw(e)||(g.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){let y=e.toDataURL(c.type,c.quality),_=n.createElement("canvas");_.width=e.width,_.height=e.height;let b=_.toDataURL(c.type,c.quality);y!==b&&(g.rr_dataURL=y)}}if(h==="img"&&u){Pt||(Pt=n.createElement("canvas"),Np=Pt.getContext("2d"));let y=e,_=y.currentSrc||y.getAttribute("src")||"<unknown-src>",b=y.crossOrigin,w=()=>{y.removeEventListener("load",w);try{Pt.width=y.naturalWidth,Pt.height=y.naturalHeight,Np.drawImage(y,0,0),g.rr_dataURL=Pt.toDataURL(c.type,c.quality)}catch($){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?w():y.addEventListener("load",w);return}else console.warn(`Cannot inline img src=${_}! Error: ${$}`)}y.crossOrigin==="anonymous"&&(b?g.crossOrigin=b:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?w():y.addEventListener("load",w)}if(["audio","video"].includes(h)){let y=g;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),m){let{width:y,height:_}=e.getBoundingClientRect();g={class:g.class,rr_width:`${y}px`,rr_height:`${_}px`}}h==="iframe"&&!p(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(h)&&(v=!0)}catch{}return{type:pe.Element,tagName:h,attributes:g,childNodes:[],isSVG:Ew(e)||void 0,needBlock:m,rootId:d,isCustom:v}}function ie(e){return e==null?"":e.toLowerCase()}function om(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Pw(e,r){if(r.comment&&e.type===pe.Comment)return!0;if(e.type===pe.Element){if(r.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&em(e.attributes.href)==="js"))return!0;if(r.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ie(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ie(e.attributes.name)==="application-name"||ie(e.attributes.rel)==="icon"||ie(e.attributes.rel)==="apple-touch-icon"||ie(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(r.headMetaDescKeywords&&ie(e.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(ie(e.attributes.property).match(/^(og|twitter|fb):/)||ie(e.attributes.name).match(/^(og|twitter):/)||ie(e.attributes.name)==="pinterest"))return!0;if(r.headMetaRobots&&(ie(e.attributes.name)==="robots"||ie(e.attributes.name)==="googlebot"||ie(e.attributes.name)==="bingbot"))return!0;if(r.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(r.headMetaAuthorship&&(ie(e.attributes.name)==="author"||ie(e.attributes.name)==="generator"||ie(e.attributes.name)==="framework"||ie(e.attributes.name)==="publisher"||ie(e.attributes.name)==="progid"||ie(e.attributes.property).match(/^article:/)||ie(e.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&(ie(e.attributes.name)==="google-site-verification"||ie(e.attributes.name)==="yandex-verification"||ie(e.attributes.name)==="csrf-token"||ie(e.attributes.name)==="p:domain_verify"||ie(e.attributes.name)==="verify-v1"||ie(e.attributes.name)==="verification"||ie(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Lt(e,r){let{doc:n,mirror:o,blockClass:t,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:c=!1,inlineStylesheet:u=!0,maskInputOptions:l={},maskTextFn:p,maskInputFn:f,slimDOMOptions:d,dataURLOptions:m={},inlineImages:h=!1,recordCanvas:g=!1,onSerialize:x,onIframeLoad:v,iframeLoadTimeout:y=5e3,onStylesheetLoad:_,stylesheetLoadTimeout:b=5e3,keepIframeSrcFn:w=()=>!1,newlyAddedElement:$=!1,cssCaptured:C=!1}=r,{needsMask:P}=r,{preserveWhiteSpace:O=!0}=r;P||(P=im(e,s,a,P===void 0));let j=Tw(e,{doc:n,mirror:o,blockClass:t,blockSelector:i,needsMask:P,inlineStylesheet:u,maskInputOptions:l,maskTextFn:p,maskInputFn:f,dataURLOptions:m,inlineImages:h,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:$,cssCaptured:C});if(!j)return console.warn(e,"not serialized"),null;let L;o.hasNode(e)?L=o.getId(e):Pw(j,d)||!O&&j.type===pe.Text&&!j.textContent.replace(/^\s+|\s+$/gm,"").length?L=Cr:L=tm();let I=Object.assign(j,{id:L});if(o.add(e,I),L===Cr)return null;x&&x(e);let Ne=!c;if(I.type===pe.Element){Ne=Ne&&!I.needBlock,delete I.needBlock;let K=ve.shadowRoot(e);K&&Ir(K)&&(I.isShadowHost=!0)}if((I.type===pe.Document||I.type===pe.Element)&&Ne){d.headWhitespace&&I.type===pe.Element&&I.tagName==="head"&&(O=!1);let K={doc:n,mirror:o,blockClass:t,blockSelector:i,needsMask:P,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:u,maskInputOptions:l,maskTextFn:p,maskInputFn:f,slimDOMOptions:d,dataURLOptions:m,inlineImages:h,recordCanvas:g,preserveWhiteSpace:O,onSerialize:x,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:_,stylesheetLoadTimeout:b,keepIframeSrcFn:w,cssCaptured:!1};if(!(I.type===pe.Element&&I.tagName==="textarea"&&I.attributes.value!==void 0)){I.type===pe.Element&&I.attributes._cssText!==void 0&&typeof I.attributes._cssText=="string"&&(K.cssCaptured=!0);for(let ue of Array.from(ve.childNodes(e))){let ge=Lt(ue,K);ge&&I.childNodes.push(ge)}}let H=null;if(Yh(e)&&(H=ve.shadowRoot(e)))for(let ue of Array.from(ve.childNodes(H))){let ge=Lt(ue,K);ge&&(Ir(H)&&(ge.isShadow=!0),I.childNodes.push(ge))}}let Te=ve.parentNode(e);return Te&&kr(Te)&&Ir(Te)&&(I.isShadow=!0),I.type===pe.Element&&I.tagName==="iframe"&&Ow(e,()=>{let K=e.contentDocument;if(K&&v){let H=Lt(K,{doc:K,mirror:o,blockClass:t,blockSelector:i,needsMask:P,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:l,maskTextFn:p,maskInputFn:f,slimDOMOptions:d,dataURLOptions:m,inlineImages:h,recordCanvas:g,preserveWhiteSpace:O,onSerialize:x,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:_,stylesheetLoadTimeout:b,keepIframeSrcFn:w});H&&v(e,H)}},y),I.type===pe.Element&&I.tagName==="link"&&typeof I.attributes.rel=="string"&&(I.attributes.rel==="stylesheet"||I.attributes.rel==="preload"&&typeof I.attributes.href=="string"&&em(I.attributes.href)==="css")&&Nw(e,()=>{if(_){let K=Lt(e,{doc:n,mirror:o,blockClass:t,blockSelector:i,needsMask:P,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:l,maskTextFn:p,maskInputFn:f,slimDOMOptions:d,dataURLOptions:m,inlineImages:h,recordCanvas:g,preserveWhiteSpace:O,onSerialize:x,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:_,stylesheetLoadTimeout:b,keepIframeSrcFn:w});K&&_(e,K)}},b),I}function Aw(e,r){let{mirror:n=new Mn,blockClass:o="rr-block",blockSelector:t=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:u=!1,maskAllInputs:l=!1,maskTextFn:p,maskInputFn:f,slimDOM:d=!1,dataURLOptions:m,preserveWhiteSpace:h,onSerialize:g,onIframeLoad:x,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:_,keepIframeSrcFn:b=()=>!1}=r,w=l===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:l===!1?{password:!0}:l,$=om(d);return Lt(e,{doc:e,mirror:n,blockClass:o,blockSelector:t,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:w,maskTextFn:p,maskInputFn:f,slimDOMOptions:$,dataURLOptions:m,inlineImages:c,recordCanvas:u,preserveWhiteSpace:h,onSerialize:g,onIframeLoad:x,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:_,keepIframeSrcFn:b,newlyAddedElement:!1})}var Mw=/(max|min)-device-(width|height)/,V0=new RegExp(Mw.source,"g");function Uw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Lw(e){if(e.__esModule)return e;var r=e.default;if(typeof r=="function"){var n=function o(){return this instanceof o?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};n.prototype=r.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,t.get?t:{enumerable:!0,get:function(){return e[o]}})}),n}var Cn={exports:{}},Dp;function jw(){if(Dp)return Cn.exports;Dp=1;var e=String,r=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Cn.exports=r(),Cn.exports.createColors=r,Cn.exports}var Fw={},Zw=Object.freeze(Object.defineProperty({__proto__:null,default:Fw},Symbol.toStringTag,{value:"Module"})),je=Lw(Zw),ts,zp;function wa(){if(zp)return ts;zp=1;let e=jw(),r=je;class n extends Error{constructor(t,i,s,a,c,u){super(t),this.name="CssSyntaxError",this.reason=t,c&&(this.file=c),a&&(this.source=a),u&&(this.plugin=u),typeof i<"u"&&typeof s<"u"&&(typeof i=="number"?(this.line=i,this.column=s):(this.line=i.line,this.column=i.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let i=this.source;t==null&&(t=e.isColorSupported),r&&t&&(i=r(i));let s=i.split(/\r?\n/),a=Math.max(this.line-3,0),c=Math.min(this.line+2,s.length),u=String(c).length,l,p;if(t){let{bold:f,gray:d,red:m}=e.createColors(!0);l=h=>f(m(h)),p=h=>d(h)}else l=p=f=>f;return s.slice(a,c).map((f,d)=>{let m=a+1+d,h=" "+(" "+m).slice(-u)+" | ";if(m===this.line){let g=p(h.replace(/\d/g," "))+f.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+p(h)+f+`
|
|
3
3
|
`+g+l("^")}return" "+p(h)+f}).join(`
|
|
4
4
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
package/dist/react-native.cjs
CHANGED
|
@@ -41,7 +41,7 @@ module.exports = __toCommonJS(react_native_exports);
|
|
|
41
41
|
var import_react_native = require("react-native");
|
|
42
42
|
|
|
43
43
|
// ../core/dist/chunk-YBVE6CBL.js
|
|
44
|
-
var SDK_VERSION = true ? "0.6.
|
|
44
|
+
var SDK_VERSION = true ? "0.6.1" : "0.0.0-dev";
|
|
45
45
|
var DEFAULT_ENDPOINT = "https://api.horus.sh";
|
|
46
46
|
var MAX_SERIALIZED_ARG_CHARS = 2e3;
|
|
47
47
|
var MAX_DOM_BYTES = 2 * 1024 * 1024;
|
|
@@ -15662,6 +15662,7 @@ var NativeLensClient = class {
|
|
|
15662
15662
|
}
|
|
15663
15663
|
};
|
|
15664
15664
|
var tools = [
|
|
15665
|
+
["pan", "Move"],
|
|
15665
15666
|
["rect", "Rectangle"],
|
|
15666
15667
|
["ellipse", "Ellipse"],
|
|
15667
15668
|
["arrow", "Arrow"],
|
|
@@ -15841,6 +15842,10 @@ function AnnotationEditor({
|
|
|
15841
15842
|
const [exporting, setExporting] = (0, import_react3.useState)(false);
|
|
15842
15843
|
const [error51, setError] = (0, import_react3.useState)("");
|
|
15843
15844
|
const canvas = (0, import_react3.useRef)(null);
|
|
15845
|
+
const viewport = (0, import_react3.useRef)(null);
|
|
15846
|
+
const scrollOffset = (0, import_react3.useRef)(0);
|
|
15847
|
+
const scrollStart = (0, import_react3.useRef)(0);
|
|
15848
|
+
const scrollTouchY = (0, import_react3.useRef)(0);
|
|
15844
15849
|
const mounted = (0, import_react3.useRef)(true);
|
|
15845
15850
|
(0, import_react3.useEffect)(() => {
|
|
15846
15851
|
mounted.current = true;
|
|
@@ -15851,16 +15856,30 @@ function AnnotationEditor({
|
|
|
15851
15856
|
const points = (0, import_react3.useRef)([]);
|
|
15852
15857
|
const screen = (0, import_react_native6.useWindowDimensions)();
|
|
15853
15858
|
const [stageSize, setStageSize] = (0, import_react3.useState)({ width: 0, height: 0 });
|
|
15854
|
-
const scale = Math.
|
|
15855
|
-
Math.max(1, (stageSize.width || screen.width) - 32) / image.width,
|
|
15856
|
-
Math.max(1, (stageSize.height || screen.height - 260) - 16) / image.height
|
|
15857
|
-
);
|
|
15859
|
+
const scale = exporting ? 1 : Math.max(1, (stageSize.width || screen.width) - 32) / image.width;
|
|
15858
15860
|
const shownCrop = exporting ? crop : null;
|
|
15861
|
+
function moveScreenshot(pageY) {
|
|
15862
|
+
const maxOffset = Math.max(
|
|
15863
|
+
0,
|
|
15864
|
+
image.height * scale - (stageSize.height - 16)
|
|
15865
|
+
);
|
|
15866
|
+
const y = Math.max(
|
|
15867
|
+
0,
|
|
15868
|
+
Math.min(maxOffset, scrollStart.current + scrollTouchY.current - pageY)
|
|
15869
|
+
);
|
|
15870
|
+
scrollOffset.current = y;
|
|
15871
|
+
viewport.current?.scrollTo({ y, animated: false });
|
|
15872
|
+
}
|
|
15859
15873
|
const responder = (0, import_react3.useMemo)(
|
|
15860
15874
|
() => import_react_native6.PanResponder.create({
|
|
15861
15875
|
onStartShouldSetPanResponder: () => !exporting,
|
|
15862
15876
|
onMoveShouldSetPanResponder: () => !exporting,
|
|
15863
15877
|
onPanResponderGrant: (event) => {
|
|
15878
|
+
if (tool === "pan") {
|
|
15879
|
+
scrollStart.current = scrollOffset.current;
|
|
15880
|
+
scrollTouchY.current = event.nativeEvent.pageY;
|
|
15881
|
+
return;
|
|
15882
|
+
}
|
|
15864
15883
|
const { locationX, locationY } = event.nativeEvent;
|
|
15865
15884
|
points.current = [
|
|
15866
15885
|
{
|
|
@@ -15879,6 +15898,10 @@ function AnnotationEditor({
|
|
|
15879
15898
|
);
|
|
15880
15899
|
},
|
|
15881
15900
|
onPanResponderMove: (event) => {
|
|
15901
|
+
if (tool === "pan") {
|
|
15902
|
+
moveScreenshot(event.nativeEvent.pageY);
|
|
15903
|
+
return;
|
|
15904
|
+
}
|
|
15882
15905
|
const { locationX, locationY } = event.nativeEvent;
|
|
15883
15906
|
const p = {
|
|
15884
15907
|
x: Math.max(0, Math.min(image.width, locationX / scale)),
|
|
@@ -15898,6 +15921,10 @@ function AnnotationEditor({
|
|
|
15898
15921
|
);
|
|
15899
15922
|
},
|
|
15900
15923
|
onPanResponderRelease: (event) => {
|
|
15924
|
+
if (tool === "pan") {
|
|
15925
|
+
moveScreenshot(event.nativeEvent.pageY);
|
|
15926
|
+
return;
|
|
15927
|
+
}
|
|
15901
15928
|
const first = points.current[0];
|
|
15902
15929
|
if (first && tool !== "text" && tool !== "step") {
|
|
15903
15930
|
const { locationX, locationY } = event.nativeEvent;
|
|
@@ -15941,7 +15968,17 @@ function AnnotationEditor({
|
|
|
15941
15968
|
points.current = [];
|
|
15942
15969
|
}
|
|
15943
15970
|
}),
|
|
15944
|
-
[
|
|
15971
|
+
[
|
|
15972
|
+
color,
|
|
15973
|
+
exporting,
|
|
15974
|
+
image.height,
|
|
15975
|
+
image.width,
|
|
15976
|
+
marks,
|
|
15977
|
+
scale,
|
|
15978
|
+
stageSize.height,
|
|
15979
|
+
text,
|
|
15980
|
+
tool
|
|
15981
|
+
]
|
|
15945
15982
|
);
|
|
15946
15983
|
async function done() {
|
|
15947
15984
|
if (exporting) return;
|
|
@@ -16089,95 +16126,109 @@ function AnnotationEditor({
|
|
|
16089
16126
|
(current) => current.width === layout.width && current.height === layout.height ? current : { width: layout.width, height: layout.height }
|
|
16090
16127
|
);
|
|
16091
16128
|
},
|
|
16092
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
16093
|
-
import_react_native6.
|
|
16129
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
16130
|
+
import_react_native6.ScrollView,
|
|
16094
16131
|
{
|
|
16095
|
-
ref:
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16132
|
+
ref: viewport,
|
|
16133
|
+
style: s.viewport,
|
|
16134
|
+
contentContainerStyle: s.canvasContent,
|
|
16135
|
+
scrollEnabled: false,
|
|
16136
|
+
bounces: false,
|
|
16137
|
+
onScroll: (event) => {
|
|
16138
|
+
scrollOffset.current = event.nativeEvent.contentOffset.y;
|
|
16102
16139
|
},
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16108
|
-
|
|
16109
|
-
|
|
16110
|
-
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
|
|
16121
|
-
|
|
16122
|
-
|
|
16123
|
-
resizeMode: "stretch"
|
|
16124
|
-
}
|
|
16125
|
-
),
|
|
16126
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
16127
|
-
import_react_native_svg.default,
|
|
16128
|
-
{
|
|
16129
|
-
pointerEvents: "none",
|
|
16130
|
-
style: import_react_native6.StyleSheet.absoluteFill,
|
|
16140
|
+
scrollEventThrottle: 16,
|
|
16141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
16142
|
+
import_react_native6.View,
|
|
16143
|
+
{
|
|
16144
|
+
ref: canvas,
|
|
16145
|
+
collapsable: false,
|
|
16146
|
+
style: {
|
|
16147
|
+
width: (shownCrop?.width ?? image.width) * scale,
|
|
16148
|
+
height: (shownCrop?.height ?? image.height) * scale,
|
|
16149
|
+
overflow: "hidden",
|
|
16150
|
+
backgroundColor: "#fff"
|
|
16151
|
+
},
|
|
16152
|
+
children: [
|
|
16153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
16154
|
+
import_react_native6.View,
|
|
16155
|
+
{
|
|
16156
|
+
style: {
|
|
16157
|
+
position: "absolute",
|
|
16158
|
+
left: -(shownCrop?.x ?? 0) * scale,
|
|
16159
|
+
top: -(shownCrop?.y ?? 0) * scale,
|
|
16131
16160
|
width: image.width * scale,
|
|
16132
|
-
height: image.height * scale
|
|
16133
|
-
|
|
16134
|
-
|
|
16135
|
-
|
|
16136
|
-
|
|
16137
|
-
|
|
16138
|
-
|
|
16139
|
-
|
|
16140
|
-
|
|
16141
|
-
|
|
16142
|
-
|
|
16143
|
-
|
|
16144
|
-
|
|
16145
|
-
|
|
16146
|
-
|
|
16147
|
-
|
|
16148
|
-
|
|
16149
|
-
|
|
16150
|
-
|
|
16151
|
-
|
|
16152
|
-
|
|
16153
|
-
{
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
|
|
16172
|
-
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16161
|
+
height: image.height * scale
|
|
16162
|
+
},
|
|
16163
|
+
children: [
|
|
16164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
16165
|
+
import_react_native6.Image,
|
|
16166
|
+
{
|
|
16167
|
+
source: { uri: image.uri },
|
|
16168
|
+
style: {
|
|
16169
|
+
width: image.width * scale,
|
|
16170
|
+
height: image.height * scale
|
|
16171
|
+
},
|
|
16172
|
+
resizeMode: "stretch"
|
|
16173
|
+
}
|
|
16174
|
+
),
|
|
16175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
16176
|
+
import_react_native_svg.default,
|
|
16177
|
+
{
|
|
16178
|
+
pointerEvents: "none",
|
|
16179
|
+
style: import_react_native6.StyleSheet.absoluteFill,
|
|
16180
|
+
width: image.width * scale,
|
|
16181
|
+
height: image.height * scale,
|
|
16182
|
+
viewBox: `0 0 ${image.width} ${image.height}`,
|
|
16183
|
+
children: [
|
|
16184
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
16185
|
+
AnnotationShapes,
|
|
16186
|
+
{
|
|
16187
|
+
annotations: [...marks, ...draft ? [draft] : []]
|
|
16188
|
+
}
|
|
16189
|
+
),
|
|
16190
|
+
!exporting && crop && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
16191
|
+
import_react_native_svg.Rect,
|
|
16192
|
+
{
|
|
16193
|
+
...crop,
|
|
16194
|
+
fill: "none",
|
|
16195
|
+
stroke: "#3b82f6",
|
|
16196
|
+
strokeWidth: 2,
|
|
16197
|
+
strokeDasharray: "6 4"
|
|
16198
|
+
}
|
|
16199
|
+
),
|
|
16200
|
+
target?.boundingRect && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
16201
|
+
import_react_native_svg.Rect,
|
|
16202
|
+
{
|
|
16203
|
+
...target.boundingRect,
|
|
16204
|
+
fill: "none",
|
|
16205
|
+
stroke: "#22c55e",
|
|
16206
|
+
strokeWidth: 2,
|
|
16207
|
+
strokeDasharray: "4 4"
|
|
16208
|
+
}
|
|
16209
|
+
)
|
|
16210
|
+
]
|
|
16211
|
+
}
|
|
16212
|
+
)
|
|
16213
|
+
]
|
|
16214
|
+
}
|
|
16215
|
+
),
|
|
16216
|
+
!exporting && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
16217
|
+
import_react_native6.View,
|
|
16218
|
+
{
|
|
16219
|
+
style: import_react_native6.StyleSheet.absoluteFill,
|
|
16220
|
+
...responder.panHandlers,
|
|
16221
|
+
accessibilityLabel: "Screenshot annotation canvas"
|
|
16222
|
+
}
|
|
16223
|
+
)
|
|
16224
|
+
]
|
|
16225
|
+
}
|
|
16226
|
+
)
|
|
16176
16227
|
}
|
|
16177
16228
|
)
|
|
16178
16229
|
}
|
|
16179
16230
|
),
|
|
16180
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native6.Text, { style: s.hint, children: error51 || (tool === "target" ? "Mark the native screen region related to the issue." : tool === "blur" ? "Redaction permanently covers screenshot pixels and removes earlier recording frames." : "Draw on the screenshot. Changes are attached when you submit.") })
|
|
16231
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native6.Text, { style: s.hint, children: error51 || (tool === "pan" ? "Scroll to another part of the screenshot, then select a drawing tool." : tool === "target" ? "Mark the native screen region related to the issue." : tool === "blur" ? "Redaction permanently covers screenshot pixels and removes earlier recording frames." : "Draw on the screenshot. Use Move to scroll. Changes are attached when you submit.") })
|
|
16181
16232
|
] });
|
|
16182
16233
|
}
|
|
16183
16234
|
var s = import_react_native6.StyleSheet.create({
|
|
@@ -16222,11 +16273,11 @@ var s = import_react_native6.StyleSheet.create({
|
|
|
16222
16273
|
swatch: { width: 24, height: 24, borderRadius: 12, borderColor: "#a1a1aa" },
|
|
16223
16274
|
stage: {
|
|
16224
16275
|
flex: 1,
|
|
16225
|
-
alignItems: "flex-start",
|
|
16226
|
-
justifyContent: "flex-start",
|
|
16227
16276
|
paddingHorizontal: 16,
|
|
16228
16277
|
paddingVertical: 8
|
|
16229
16278
|
},
|
|
16279
|
+
viewport: { flex: 1 },
|
|
16280
|
+
canvasContent: { alignItems: "center" },
|
|
16230
16281
|
hint: {
|
|
16231
16282
|
paddingHorizontal: 16,
|
|
16232
16283
|
fontSize: 12,
|