@highlight-run/react
Advanced tools
Comparing version
# @highlight-run/react | ||
## 19.0.5 | ||
### Patch Changes | ||
- Updated dependencies [bcd8ece] | ||
- highlight.run@9.18.5 | ||
## 19.0.4 | ||
@@ -4,0 +11,0 @@ |
@@ -1,2 +0,2 @@ | ||
'use strict';var C=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var C__default=/*#__PURE__*/_interopDefault(C);var W=Object.create;var S=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var G=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var K=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of $(e))!J.call(t,o)&&o!==r&&S(t,o,{get:()=>e[o],enumerable:!(n=Y(e,o))||n.enumerable});return t};var Q=(t,e,r)=>(r=t!=null?W(q(t)):{},K(!t||!t.__esModule?S(r,"default",{value:t,enumerable:true}):r,t));var k=G((fe,h)=>{(function(){var t={}.hasOwnProperty;function e(){for(var o="",i=0;i<arguments.length;i++){var s=arguments[i];s&&(o=n(o,r(s)));}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return "";if(Array.isArray(o))return e.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var s in o)t.call(o,s)&&o[s]&&(i=n(i,s));return i}function n(o,i){return i?o?o+" "+i:o+i:o}typeof h<"u"&&h.exports?(e.default=e,h.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e;})();});var R=Q(k());var E="ab47aa3085e9e5ae575dd6025eb36dec4968ec7ca807d8e4a715a66db3542672",X=`._container_18f8u_1 { | ||
'use strict';var C=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var C__default=/*#__PURE__*/_interopDefault(C);var W=Object.create;var S=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var G=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);var K=(t,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of $(o))!J.call(t,e)&&e!==r&&S(t,e,{get:()=>o[e],enumerable:!(n=Y(o,e))||n.enumerable});return t};var Q=(t,o,r)=>(r=t!=null?W(q(t)):{},K(!t||!t.__esModule?S(r,"default",{value:t,enumerable:true}):r,t));var k=G((uo,h)=>{(function(){var t={}.hasOwnProperty;function o(){for(var e="",i=0;i<arguments.length;i++){var s=arguments[i];s&&(e=n(e,r(s)));}return e}function r(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e!="object")return "";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var i="";for(var s in e)t.call(e,s)&&e[s]&&(i=n(i,s));return i}function n(e,i){return i?e?e+" "+i:e+i:e}typeof h<"u"&&h.exports?(o.default=o,h.exports=o):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return o}):window.classNames=o;})();});var R=Q(k());var E="3ebfeb838292587dbc889368d6d681a10fd28dc4c1a590436fe117d0cefa1385",X=`._container_18f8u_1 { | ||
--brand-color: #744ed4; | ||
@@ -225,3 +225,3 @@ --brand-color-dark: #5629c6; | ||
} | ||
`;(function(){if(!(typeof document>"u")&&!document.getElementById(E)){var t=document.createElement("style");t.id=E,t.textContent=X,document.head.appendChild(t);}})();var a={container:"_container_18f8u_1",card:"_card_18f8u_41",cardContents:"_cardContents_18f8u_47",form:"_form_18f8u_53",textareaLabel:"_textareaLabel_18f8u_57",ad:"_ad_18f8u_65",title:"_title_18f8u_78",subtitle:"_subtitle_18f8u_83",closeButton:"_closeButton_18f8u_154",confirmationButton:"_confirmationButton_18f8u_167",formFooter:"_formFooter_18f8u_172",formActionsContainer:"_formActionsContainer_18f8u_180",logoContainer:"_logoContainer_18f8u_190",logo:"_logo_18f8u_190"};function b({labelClose:t="Cancel",labelComments:e="Message",labelName:r="Name",labelEmail:n="Email",labelSubmit:o="Submit",subtitle2:i="If you\u2019d like to help, tell us what happened below.",subtitle:s="Our team has been notified.",successMessage:f="Your feedback has been sent. Thank you!",successSubtitle:I="Thank you for sending us feedback. If you have any other concerns/questions, reach out to this application's support email.",title:H="It looks like we\u2019re having issues.",placeholderComments:A="I typed in a name then clicked the button",user:y,onCloseHandler:x,onSubmitHandler:v,hideHighlightBranding:z=false,error:_}){let[p,O]=C.useState(y?.name||""),[m,M]=C.useState(y?.email||""),[g,F]=C.useState(""),[T,w]=C.useState(false),[U,j]=C.useState(false),L=C.useRef(new Date().toISOString()),P=C.useMemo(()=>{let d=!!m.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i);return !!p&&d&&!!g},[p,m,g]);C__default.default.useEffect(()=>{window?.H?.consumeError&&_&&window.H.consumeError(_);},[_]);let V=d=>{d.preventDefault(),w(true),window?.H?.addSessionFeedback?window.H.addSessionFeedback({verbatim:g,userName:p,userEmail:m,timestampOverride:L.current}):console.warn("Highlight is not initialized. Make sure highlight.run is installed and running."),new Promise(Z=>window.setTimeout(Z,300)).then(()=>{w(false),j(true),v&&v();});};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:` | ||
`;(function(){if(!(typeof document>"u")&&!document.getElementById(E)){var t=document.createElement("style");t.id=E,t.textContent=X,document.head.appendChild(t);}})();var a={container:"_container_18f8u_1",card:"_card_18f8u_41",cardContents:"_cardContents_18f8u_47",form:"_form_18f8u_53",textareaLabel:"_textareaLabel_18f8u_57",ad:"_ad_18f8u_65",title:"_title_18f8u_78",subtitle:"_subtitle_18f8u_83",closeButton:"_closeButton_18f8u_154",confirmationButton:"_confirmationButton_18f8u_167",formFooter:"_formFooter_18f8u_172",formActionsContainer:"_formActionsContainer_18f8u_180",logoContainer:"_logoContainer_18f8u_190",logo:"_logo_18f8u_190"};function b({labelClose:t="Cancel",labelComments:o="Message",labelName:r="Name",labelEmail:n="Email",labelSubmit:e="Submit",subtitle2:i="If you\u2019d like to help, tell us what happened below.",subtitle:s="Our team has been notified.",successMessage:f="Your feedback has been sent. Thank you!",successSubtitle:I="Thank you for sending us feedback. If you have any other concerns/questions, reach out to this application's support email.",title:H="It looks like we\u2019re having issues.",placeholderComments:A="I typed in a name then clicked the button",user:y,onCloseHandler:x,onSubmitHandler:v,hideHighlightBranding:z=false,error:_}){let[p,O]=C.useState(y?.name||""),[m,M]=C.useState(y?.email||""),[g,F]=C.useState(""),[T,w]=C.useState(false),[U,j]=C.useState(false),L=C.useRef(new Date().toISOString()),P=C.useMemo(()=>{let d=!!m.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i);return !!p&&d&&!!g},[p,m,g]);C__default.default.useEffect(()=>{window?.H?.consumeError&&_&&window.H.consumeError(_);},[_]);let V=d=>{d.preventDefault(),w(true),window?.H?.addSessionFeedback?window.H.addSessionFeedback({verbatim:g,userName:p,userEmail:m,timestampOverride:L.current}):console.warn("Highlight is not initialized. Make sure highlight.run is installed and running."),new Promise(Z=>window.setTimeout(Z,300)).then(()=>{w(false),j(true),v&&v();});};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:` | ||
@font-face { | ||
@@ -249,4 +249,4 @@ font-display: swap; | ||
} | ||
`}}),jsxRuntime.jsx("main",{className:a.container,children:jsxRuntime.jsx("div",{className:a.card,children:U?jsxRuntime.jsxs("div",{className:a.cardContents,children:[jsxRuntime.jsx("h1",{className:a.title,children:f}),jsxRuntime.jsx("h4",{className:a.subtitle,children:I}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("button",{className:(0, R.default)(a.button,a.confirmationButton),onClick:x,children:"Close"})})]}):jsxRuntime.jsxs("div",{className:a.cardContents,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:a.title,children:H}),jsxRuntime.jsxs("h2",{className:a.subtitle,children:[s," ",i]})]}),jsxRuntime.jsxs("form",{className:a.form,onSubmit:V,children:[jsxRuntime.jsxs("label",{children:[r,jsxRuntime.jsx("input",{type:"text",value:p,name:"name",autoFocus:true,onChange:d=>{O(d.target.value);},placeholder:"Tom Jerry"})]}),jsxRuntime.jsxs("label",{children:[n,jsxRuntime.jsx("input",{type:"email",value:m,name:"email",onChange:d=>{M(d.target.value);},placeholder:"mail@mail.com"})]}),jsxRuntime.jsxs("label",{className:a.textareaLabel,children:[e,jsxRuntime.jsx("textarea",{value:g,placeholder:A,name:"verbatim",rows:3,onChange:d=>{F(d.target.value);}})]}),jsxRuntime.jsxs("div",{className:a.formFooter,children:[jsxRuntime.jsxs("div",{className:a.formActionsContainer,children:[jsxRuntime.jsx("button",{type:"submit",disabled:!P||T,children:o}),jsxRuntime.jsx("button",{className:a.closeButton,onClick:x,type:"button",children:t})]}),!z&&jsxRuntime.jsx("div",{className:a.ad,children:jsxRuntime.jsx("a",{href:"https://highlight.io",target:"_blank",children:jsxRuntime.jsxs("div",{className:a.logoContainer,children:[jsxRuntime.jsx("img",{src:"https://www.highlight.io/images/logo-on-dark.png",alt:"Highlight",className:a.logo}),jsxRuntime.jsx("span",{children:"Powered by highlight.io"})]})})})]})]})]})})})]})}var D={componentStack:null,error:null,showingDialog:false},B=class extends C__default.default.Component{refs={};state=D;componentDidCatch(e,r){let{beforeCapture:n,onError:o,showDialog:i}=this.props;n&&n(e,r.componentStack??null),ne(e,r),o&&o(e,r.componentStack??""),i!==false&&this.setState({...this.state,showingDialog:true}),this.setState({error:e,componentStack:r.componentStack??null});}componentDidMount(){let{onMount:e}=this.props;e&&e();}componentWillUnmount(){let{error:e,componentStack:r}=this.state,{onUnmount:n}=this.props;n&&n(e,r);}resetErrorBoundary=()=>{let{onReset:e}=this.props,{error:r,componentStack:n}=this.state;e&&e(r,n),this.setState(D);};hideDialog=()=>{this.setState({...this.state,showingDialog:false}),(this.props.onAfterReportDialogCancelHandler||(()=>{window.location.href=window.location.origin;}))();};onReportDialogSubmitHandler=()=>{this.props.onAfterReportDialogSubmitHandler&&this.props.onAfterReportDialogSubmitHandler();};render(){let{fallback:e,children:r,customDialog:n}=this.props,{error:o,componentStack:i,showingDialog:s}=this.state;if(o){let f;return typeof e=="function"?f=e({error:o,componentStack:i,resetError:this.resetErrorBoundary}):f=e,C__default.default.isValidElement(f)?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(b,{...this.props.dialogOptions,onCloseHandler:this.hideDialog,onSubmitHandler:this.onReportDialogSubmitHandler}),f]}):(e&&console.warn("fallback did not produce a valid ReactElement"),s&&n?n:s&&jsxRuntime.jsx(b,{...this.props.dialogOptions,onCloseHandler:this.hideDialog,onSubmitHandler:this.onReportDialogSubmitHandler}))}return typeof r=="function"?r():r}};function ne(t,e){let r=ae(e.componentStack??"");window.H?(console.error("Highlight ErrorBoundary caught an exception while rendering React component",{error:t}),window.H.consume(t,{payload:{component:r},source:r,type:"React.ErrorBoundary"})):console.warn("You need to install highlight.run.");}function ae(t){let e=t.split(` | ||
`);if(e.length<1)return;let n=e[1].trim().split(" ");if(n.length===4)return `<${n[1]}>`}var ke=({children:t})=>{let[e,r]=C__default.default.useState(false);if(e)throw new Error("something bad happened - this is a sample test error");return jsxRuntime.jsx("button",{type:"button",className:"buggyButton",onClick:()=>r(true),children:t??"Throw an Error"})};/*! Bundled license information: | ||
`}}),jsxRuntime.jsx("main",{className:a.container,children:jsxRuntime.jsx("div",{className:a.card,children:U?jsxRuntime.jsxs("div",{className:a.cardContents,children:[jsxRuntime.jsx("h1",{className:a.title,children:f}),jsxRuntime.jsx("h4",{className:a.subtitle,children:I}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("button",{className:(0, R.default)(a.button,a.confirmationButton),onClick:x,children:"Close"})})]}):jsxRuntime.jsxs("div",{className:a.cardContents,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:a.title,children:H}),jsxRuntime.jsxs("h2",{className:a.subtitle,children:[s," ",i]})]}),jsxRuntime.jsxs("form",{className:a.form,onSubmit:V,children:[jsxRuntime.jsxs("label",{children:[r,jsxRuntime.jsx("input",{type:"text",value:p,name:"name",autoFocus:true,onChange:d=>{O(d.target.value);},placeholder:"Tom Jerry"})]}),jsxRuntime.jsxs("label",{children:[n,jsxRuntime.jsx("input",{type:"email",value:m,name:"email",onChange:d=>{M(d.target.value);},placeholder:"mail@mail.com"})]}),jsxRuntime.jsxs("label",{className:a.textareaLabel,children:[o,jsxRuntime.jsx("textarea",{value:g,placeholder:A,name:"verbatim",rows:3,onChange:d=>{F(d.target.value);}})]}),jsxRuntime.jsxs("div",{className:a.formFooter,children:[jsxRuntime.jsxs("div",{className:a.formActionsContainer,children:[jsxRuntime.jsx("button",{type:"submit",disabled:!P||T,children:e}),jsxRuntime.jsx("button",{className:a.closeButton,onClick:x,type:"button",children:t})]}),!z&&jsxRuntime.jsx("div",{className:a.ad,children:jsxRuntime.jsx("a",{href:"https://highlight.io",target:"_blank",children:jsxRuntime.jsxs("div",{className:a.logoContainer,children:[jsxRuntime.jsx("img",{src:"https://www.highlight.io/images/logo-on-dark.png",alt:"Highlight",className:a.logo}),jsxRuntime.jsx("span",{children:"Powered by highlight.io"})]})})})]})]})]})})})]})}var D={componentStack:null,error:null,showingDialog:false},B=class extends C__default.default.Component{refs={};state=D;componentDidCatch(o,r){let{beforeCapture:n,onError:e,showDialog:i}=this.props;n&&n(o,r.componentStack??null),no(o,r),e&&e(o,r.componentStack??""),i!==false&&this.setState({...this.state,showingDialog:true}),this.setState({error:o,componentStack:r.componentStack??null});}componentDidMount(){let{onMount:o}=this.props;o&&o();}componentWillUnmount(){let{error:o,componentStack:r}=this.state,{onUnmount:n}=this.props;n&&n(o,r);}resetErrorBoundary=()=>{let{onReset:o}=this.props,{error:r,componentStack:n}=this.state;o&&o(r,n),this.setState(D);};hideDialog=()=>{this.setState({...this.state,showingDialog:false}),(this.props.onAfterReportDialogCancelHandler||(()=>{window.location.href=window.location.origin;}))();};onReportDialogSubmitHandler=()=>{this.props.onAfterReportDialogSubmitHandler&&this.props.onAfterReportDialogSubmitHandler();};render(){let{fallback:o,children:r,customDialog:n}=this.props,{error:e,componentStack:i,showingDialog:s}=this.state;if(e){let f;return typeof o=="function"?f=o({error:e,componentStack:i,resetError:this.resetErrorBoundary}):f=o,C__default.default.isValidElement(f)?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(b,{...this.props.dialogOptions,onCloseHandler:this.hideDialog,onSubmitHandler:this.onReportDialogSubmitHandler}),f]}):(o&&console.warn("fallback did not produce a valid ReactElement"),s&&n?n:s&&jsxRuntime.jsx(b,{...this.props.dialogOptions,onCloseHandler:this.hideDialog,onSubmitHandler:this.onReportDialogSubmitHandler}))}return typeof r=="function"?r():r}};function no(t,o){let r=ao(o.componentStack??"");window.H?(console.error("Highlight ErrorBoundary caught an exception while rendering React component",{error:t}),window.H.consume(t,{payload:{component:r},source:r,type:"React.ErrorBoundary"})):console.warn("You need to install highlight.run.");}function ao(t){let o=t.split(` | ||
`);if(o.length<1)return;let n=o[1].trim().split(" ");if(n.length===4)return `<${n[1]}>`}var Eo=({children:t})=>{let[o,r]=C__default.default.useState(false);if(o)throw new Error("something bad happened - this is a sample test error");return jsxRuntime.jsx("button",{type:"button",className:"buggyButton",onClick:()=>r(true),children:t??"Throw an Error"})};/*! Bundled license information: | ||
@@ -259,3 +259,3 @@ classnames/index.js: | ||
*) | ||
*/exports.ErrorBoundary=B;exports.ReportDialog=b;exports.SampleBuggyButton=ke;//# sourceMappingURL=index.js.map | ||
*/exports.ErrorBoundary=B;exports.ReportDialog=b;exports.SampleBuggyButton=Eo;//# sourceMappingURL=index.js.map | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@highlight-run/react", | ||
"version": "19.0.4", | ||
"version": "19.0.5", | ||
"description": "The official Highlight SDK for React", | ||
"license": "Apache-2.0", | ||
"peerDependencies": { | ||
"highlight.run": "9.18.4", | ||
"highlight.run": "9.18.5", | ||
"react": ">=16", | ||
@@ -9,0 +9,0 @@ "react-dom": ">=16" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
112492
0.08%