pushfeedback 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/feedback-button_2.cjs.entry.js +18 -16
- package/dist/cjs/{index-ecaab1ef.js → index-df770657.js} +106 -109
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/pushfeedback.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +4 -4
- package/dist/collection/components/feedback-button/feedback-button.css +5 -3
- package/dist/collection/components/feedback-button/feedback-button.js +34 -19
- package/dist/components/feedback-button.js +18 -16
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.js +1 -1
- package/dist/esm/feedback-button_2.entry.js +18 -16
- package/dist/esm/{index-4051fc1e.js → index-0ae29483.js} +106 -110
- package/dist/esm/loader.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/pushfeedback.js +4 -3
- package/dist/pushfeedback/p-60079923.js +2 -0
- package/dist/pushfeedback/p-eac9210f.entry.js +1 -0
- package/dist/pushfeedback/pushfeedback.esm.js +1 -1
- package/dist/types/components/feedback-button/feedback-button.d.ts +4 -3
- package/dist/types/components.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +59 -3
- package/loader/index.d.ts +9 -0
- package/package.json +3 -2
- package/dist/pushfeedback/p-a5896889.entry.js +0 -1
- package/dist/pushfeedback/p-e53ad7c2.js +0 -2
package/dist/esm/pushfeedback.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-0ae29483.js';
|
|
2
|
+
export { s as setNonce } from './index-0ae29483.js';
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
|
-
Stencil Client Patch Browser v2.
|
|
5
|
+
Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
5
6
|
*/
|
|
6
7
|
const patchBrowser = () => {
|
|
7
8
|
const importMeta = import.meta.url;
|
|
@@ -13,5 +14,5 @@ const patchBrowser = () => {
|
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"
|
|
17
|
+
return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
|
|
17
18
|
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let e,t,n=!1,l=!1;const o={},s=e=>"object"==(e=typeof e)||"function"===e;function c(e){var t,n,l;return null!==(l=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==l?l:void 0}const i=(e,t,...n)=>{let l=null,o=!1,c=!1;const i=[],u=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!s(l))&&(l+=""),o&&c?i[i.length-1].t+=l:i.push(o?r(null,l):l),c=o)};if(u(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const a=r(e,null);return a.l=t,i.length>0&&(a.o=i),a},r=(e,t)=>({i:0,u:e,t,h:null,o:null,l:null}),u={},a=new WeakMap,f=e=>"sc-"+e.p,d=(e,t,n,l,o,c)=>{if(n!==l){let i=F(e,t),r=t.toLowerCase();if("class"===t){const t=e.classList,o=p(n),s=p(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const r=s(l);if((i||r&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&c||o)&&!r&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):F(D,r)?r.slice(2):r[2]+t.slice(3),n&&I.rel(e,t,n,!1),l&&I.ael(e,t,l,!1)}},h=/\s/,p=e=>e?e.split(h):[],$=(e,t,n,l)=>{const s=11===t.h.nodeType&&t.h.host?t.h.host:t.h,c=e&&e.l||o,i=t.l||o;for(l in c)l in i||d(s,l,c[l],void 0,n,t.i);for(l in i)d(s,l,c[l],i[l],n,t.i)},m=(t,l,o)=>{const s=l.o[o];let c,i,r=0;if(null!==s.t)c=s.h=G.createTextNode(s.t);else{if(n||(n="svg"===s.u),c=s.h=G.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s.u),n&&"foreignObject"===s.u&&(n=!1),$(null,s,n),null!=e&&c["s-si"]!==e&&c.classList.add(c["s-si"]=e),s.o)for(r=0;r<s.o.length;++r)i=m(t,s,r),i&&c.appendChild(i);"svg"===s.u?n=!1:"foreignObject"===c.tagName&&(n=!0)}return c},y=(e,n,l,o,s,c)=>{let i,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);s<=c;++s)o[s]&&(i=m(null,l,s),i&&(o[s].h=i,r.insertBefore(i,n)))},w=(e,t,n,l,o)=>{for(;t<=n;++t)(l=e[t])&&(o=l.h,g(l),o.remove())},b=(e,t)=>e.u===t.u,v=(e,t)=>{const l=t.h=e.h,o=e.o,s=t.o,c=t.u,i=t.t;null===i?(n="svg"===c||"foreignObject"!==c&&n,"slot"===c||$(e,t,n),null!==o&&null!==s?((e,t,n,l)=>{let o,s=0,c=0,i=t.length-1,r=t[0],u=t[i],a=l.length-1,f=l[0],d=l[a];for(;s<=i&&c<=a;)null==r?r=t[++s]:null==u?u=t[--i]:null==f?f=l[++c]:null==d?d=l[--a]:b(r,f)?(v(r,f),r=t[++s],f=l[++c]):b(u,d)?(v(u,d),u=t[--i],d=l[--a]):b(r,d)?(v(r,d),e.insertBefore(r.h,u.h.nextSibling),r=t[++s],d=l[--a]):b(u,f)?(v(u,f),e.insertBefore(u.h,r.h),u=t[--i],f=l[++c]):(o=m(t&&t[c],n,c),f=l[++c],o&&r.h.parentNode.insertBefore(o,r.h));s>i?y(e,null==l[a+1]?null:l[a+1].h,n,l,c,a):c>a&&w(t,s,i)})(l,o,t,s):null!==s?(null!==e.t&&(l.textContent=""),y(l,null,t,s,0,s.length-1)):null!==o&&w(o,0,o.length-1),n&&"svg"===c&&(n=!1)):e.t!==i&&(l.data=i)},g=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(g)},S=(e,t)=>{t&&!e.$&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.$=t)))},j=(e,t)=>{if(e.i|=16,!(4&e.i))return S(e,e.m),ne((()=>k(e,t)));e.i|=512},k=(e,t)=>{const n=e.v;let l;return t&&(l=P(n,"componentWillLoad")),E(l,(()=>O(e,n,t)))},O=async(e,t,n)=>{const l=e.g,o=l["s-rc"];n&&(e=>{const t=e.S,n=e.g,l=t.i,o=((e,t)=>{var n;let l=f(t);const o=B.get(l);if(e=11===e.nodeType?e:G,o)if("string"==typeof o){let t,s=a.get(e=e.head||e);if(s||a.set(e,s=new Set),!s.has(l)){{t=G.createElement("style"),t.innerHTML=o;const l=null!==(n=I.j)&&void 0!==n?n:c(G);null!=l&&t.setAttribute("nonce",l),e.insertBefore(t,e.querySelector("link"))}s&&s.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);C(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>M(e);0===t.length?n():(Promise.all(t).then(n),e.i|=4,t.length=0)}},C=(n,l)=>{try{l=l.render(),n.i&=-17,n.i|=2,((n,l)=>{const o=n.g,s=n.S,c=n.k||r(null,null),a=(e=>e&&e.u===u)(l)?l:i(null,null,l);t=o.tagName,s.O&&(a.l=a.l||{},s.O.map((([e,t])=>a.l[t]=o[e]))),a.u=null,a.i|=4,n.k=a,a.h=c.h=o.shadowRoot||o,e=o["s-sc"],v(c,a)})(n,l)}catch(e){V(e,n.g)}return null},M=e=>{const t=e.g,n=e.m;64&e.i||(e.i|=64,L(t),e.C(t),n||x()),e.$&&(e.$(),e.$=void 0),512&e.i&&te((()=>j(e,!1))),e.i&=-517},x=()=>{L(G.documentElement),te((()=>(e=>{const t=I.ce("appload",{detail:{namespace:"pushfeedback"}});return e.dispatchEvent(t),t})(D)))},P=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){V(e)}},E=(e,t)=>e&&e.then?e.then(t):t(),L=e=>e.classList.add("hydrated"),N=(e,t,n)=>{if(t.M){const l=Object.entries(t.M),o=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(o,e,{get(){return((e,t)=>R(this).P.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=R(e),c=o.P.get(t),i=o.i,r=o.v;n=((e,t)=>null==e||s(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.M[t][0]),8&i&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n)||(o.P.set(t,n),r&&2==(18&i)&&j(o,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){I.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.O.push([e,o]),o}))}}return e},T=e=>{P(e,"connectedCallback")},W=(e,t={})=>{var n;const l=[],o=t.exclude||[],s=D.customElements,i=G.head,r=i.querySelector("meta[charset]"),u=G.createElement("style"),a=[];let d,h=!0;Object.assign(I,t),I.L=new URL(t.resourcesUrl||"./",G.baseURI).href,e.map((e=>{e[1].map((t=>{const n={i:t[0],p:t[1],M:t[2],N:t[3]};n.M=t[2],n.O=[];const c=n.p,i=class extends HTMLElement{constructor(e){super(e),q(e=this,n),1&n.i&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),h?a.push(this):I.jmp((()=>(e=>{if(0==(1&I.i)){const t=R(e),n=t.S,l=()=>{};if(1&t.i)T(t.v);else{t.i|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){S(t,t.m=n);break}}n.M&&Object.entries(n.M).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.i)){{if(t.i|=32,(o=z(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(N(o,n,2),o.isProxied=!0);const e=()=>{};t.i|=8;try{new o(t)}catch(e){V(e)}t.i&=-9,e(),T(t.v)}if(o.style){let e=o.style;const t=f(n);if(!B.has(t)){const l=()=>{};((e,t,n)=>{let l=B.get(e);K&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,B.set(e,l)})(t,e,!!(1&n.i)),l()}}}const s=t.m,c=()=>j(t,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){I.jmp((()=>(()=>{0==(1&I.i)&&P(R(this).v,"disconnectedCallback")})()))}componentOnReady(){return R(this).T}};n.W=e[0],o.includes(c)||s.get(c)||(l.push(c),s.define(c,N(i,n,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(n=I.j)&&void 0!==n?n:c(G);null!=e&&u.setAttribute("nonce",e),i.insertBefore(u,r?r.nextSibling:i.firstChild)}h=!1,a.length?a.map((e=>e.connectedCallback())):I.jmp((()=>d=setTimeout(x,30)))},A=e=>I.j=e,H=new WeakMap,R=e=>H.get(e),U=(e,t)=>H.set(t.v=e,t),q=(e,t)=>{const n={i:0,g:e,S:t,P:new Map};return n.T=new Promise((e=>n.C=e)),e["s-p"]=[],e["s-rc"]=[],H.set(e,n)},F=(e,t)=>t in e,V=(e,t)=>(0,console.error)(e,t),_=new Map,z=e=>{const t=e.p.replace(/-/g,"_"),n=e.W,l=_.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(_.set(n,e),e[t])),V)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},B=new Map,D="undefined"!=typeof window?window:{},G=D.document||{head:{}},I={i:0,L:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},J=e=>Promise.resolve(e),K=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),Q=[],X=[],Y=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&I.i?te(ee):I.raf(ee))},Z=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){V(e)}e.length=0},ee=()=>{Z(Q),Z(X),(l=Q.length>0)&&I.raf(ee)},te=e=>J().then(e),ne=Y(X,!0);export{u as H,W as b,i as h,J as p,U as r,A as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as t,H as o}from"./p-60079923.js";const n=class{constructor(t){e(this,t),this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.buttonStyle="default"}connectedCallback(){this.feedbackModal=document.createElement("feedback-modal"),["modalTitle","successModalTitle","errorModalTitle","modalPosition","sendButtonText","project","screenshotButtonTooltipText","screenshotTopbarText","email","emailPlaceholder","messagePlaceholder"].forEach((e=>{this.feedbackModal[e]=this[e]})),document.body.appendChild(this.feedbackModal)}disconnectedCallback(){document.body.removeChild(this.feedbackModal)}showModal(){this.feedbackModal.showModal=!0}render(){return t(o,null,t("a",{class:`feedback-button-content feedback-button-content--${this.buttonStyle}`,onClick:()=>this.showModal()},t("slot",null)))}};n.style=".feedback-button-content{cursor:pointer}.feedback-button-content--light{background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);padding:5px 10px;font-size:var(--feedback-modal-button-font-size)}.feedback-button-content--light:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";var r,i,a=(r=function(e){!function(){var t=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var o,n;return(o="application/font-woff",n="image/jpeg",{woff:o,woff2:o,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[t(e).toLowerCase()]||""},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var o=window.atob(e.toDataURL().split(",")[1]),n=o.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=o.charCodeAt(i);t(new Blob([r],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var o=document.implementation.createHTMLDocument(),n=o.createElement("base");o.head.appendChild(n);var r=o.createElement("a");return o.body.appendChild(r),n.href=t,r.href=e,r.href},getAndEncode:function(e){return s.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime()),new Promise((function(t){var o,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var e=r.result.split(/,/)[1];t(e)},r.readAsDataURL(n.response)}else o?t(o):i("cannot fetch resource: "+e+", status: "+n.status)},n.ontimeout=function(){o?t(o):i("timeout of 30000ms occured while fetching resource: "+e)},n.responseType="blob",n.timeout=3e4,n.open("GET",e,!0),n.send(),s.impl.options.imagePlaceholder){var r=s.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(o=r[1])}function i(e){console.error(e),t("")}}))},uid:(e=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise((function(o){setTimeout((function(){o(t)}),e)}))}},asArray:function(e){for(var t=[],o=e.length,n=0;n<o;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,o){var n=new Image;n.onload=function(){t(n)},n.onerror=o,n.src=e}))},width:function(e){var t=o(e,"border-left-width"),n=o(e,"border-right-width");return e.scrollWidth+t+n},height:function(e){var t=o(e,"border-top-width"),n=o(e,"border-bottom-width");return e.scrollHeight+t+n}};var e;function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function o(e,t){var o=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(o.replace("px",""))}}(),o=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,t,i){return o(e)?Promise.resolve(e).then(n).then((function(o){var n=Promise.resolve(e);return o.forEach((function(e){n=n.then((function(o){return r(o,e,t,i)}))})),n})):Promise.resolve(e)},shouldProcess:o,impl:{readUrls:n,inline:r}};function o(t){return-1!==t.search(e)}function n(o){for(var n,r=[];null!==(n=e.exec(o));)r.push(n[1]);return r.filter((function(e){return!t.isDataUrl(e)}))}function r(e,o,n,r){return Promise.resolve(o).then((function(e){return n?t.resolveUrl(e,n):e})).then(r||t.getAndEncode).then((function(e){return t.dataAsUrl(e,t.mimeType(o))})).then((function(n){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+t.escape(e)+")(['\"]?\\))","g")}(o),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(e){var o=[];return e.forEach((function(e){try{t.asArray(e.cssRules||[]).forEach(o.push.bind(o))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),o})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return o.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){return o.inlineAll(e.cssText,(e.parentStyleSheet||{}).href)},src:function(){return e.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function n(r){return r instanceof Element?function(e){var t=e.style.getPropertyValue("background");return t?o.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}(r).then((function(){return r instanceof HTMLImageElement?e(r).inline():Promise.all(t.asArray(r.childNodes).map((function(e){return n(e)})))})):Promise.resolve(r)},impl:{newImage:e}};function e(e){return{inline:function(o){return t.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(o||t.getAndEncode).then((function(o){return t.dataAsUrl(o,t.mimeType(e.src))})).then((function(t){return new Promise((function(o,n){e.onload=o,e.onerror=n,e.src=t}))}))}}}}(),i=void 0,a=!1,s={toSvg:c,toPng:function(e,t){return d(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return d(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,o){return d(e,o||{}).then(t.canvasToBlob)},toPixelData:function(e,o){return d(e,o||{}).then((function(o){return o.getContext("2d").getImageData(0,0,t.width(e),t.height(e)).data}))},impl:{fontFaces:n,images:r,util:t,inliner:o,options:{}}};function c(e,o){return function(e){s.impl.options.imagePlaceholder=void 0===e.imagePlaceholder?i:e.imagePlaceholder,s.impl.options.cacheBust=void 0===e.cacheBust?a:e.cacheBust}(o=o||{}),Promise.resolve(e).then((function(e){return l(e,o.filter,!0)})).then(u).then(f).then((function(e){return o.bgcolor&&(e.style.backgroundColor=o.bgcolor),o.width&&(e.style.width=o.width+"px"),o.height&&(e.style.height=o.height+"px"),o.style&&Object.keys(o.style).forEach((function(t){e.style[t]=o.style[t]})),e})).then((function(n){return function(e,o,n){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(t.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+o+'" height="'+n+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(n,o.width||t.width(e),o.height||t.height(e))}))}function d(e,o){return c(e,o).then(t.makeImage).then(t.delay(100)).then((function(n){var r=function(e){var n=document.createElement("canvas");if(n.width=o.width||t.width(e),n.height=o.height||t.height(e),o.bgcolor){var r=n.getContext("2d");r.fillStyle=o.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(e);return r.getContext("2d").drawImage(n,0,0),r}))}function l(e,o,n){return n||!o||o(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?t.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(n){return function(e,o,n){var r=e.childNodes;return 0===r.length?Promise.resolve(o):function(e,t,o){var n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return l(t,o)})).then((function(t){t&&e.appendChild(t)}))})),n}(o,t.asArray(r),n).then((function(){return o}))}(e,n,o)})).then((function(o){return function(e,o){return o instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(e),r=o.style,n.cssText?r.cssText=n.cssText:function(e,o){t.asArray(e).forEach((function(t){o.setProperty(t,e.getPropertyValue(t),e.getPropertyPriority(t))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(""!==i&&"none"!==i){var a=t.uid();o.className=o.className+" "+a;var s=document.createElement("style");s.appendChild(function(e,o,n){var r="."+e+":"+o,i=n.cssText?a(n):s(n);return document.createTextNode(r+"{"+i+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function s(e){return t.asArray(e).map(o).join("; ")+";";function o(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}(a,n,r)),o.appendChild(s)}}(n)}))})).then((function(){e instanceof HTMLTextAreaElement&&(o.innerHTML=e.value),e instanceof HTMLInputElement&&o.setAttribute("value",e.value)})).then((function(){o instanceof SVGElement&&(o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o instanceof SVGRectElement&&["width","height"].forEach((function(e){var t=o.getAttribute(e);t&&o.style.setProperty(e,t)})))})).then((function(){return o})):o}(e,o)})):Promise.resolve()}function u(e){return n.resolveAll().then((function(t){var o=document.createElement("style");return e.appendChild(o),o.appendChild(document.createTextNode(t)),e}))}function f(e){return r.inlineAll(e).then((function(){return e}))}e.exports=s}()},r(i={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),i.exports);const s=class{constructor(t){e(this,t),this.handleSubmit=async e=>{e.preventDefault(),this.showScreenshotMode=!1,this.showModal=!1,this.sending=!0;let t="";this.encodedScreenshot&&await this.encodedScreenshot.then((e=>{t=e})).catch((e=>{console.log(e)}));try{200===(await fetch("https://app.pushfeedback.com/api/feedback/",{method:"POST",body:JSON.stringify({url:window.location.href,message:this.formMessage,email:this.formEmail,project:this.project,screenshot:t}),headers:{"Content-Type":"application/json"}})).status?(this.formSuccess=!0,this.formError=!1):(this.formSuccess=!1,this.formError=!0)}catch(e){this.formSuccess=!1,this.formError=!0}finally{this.sending=!1,this.showModal=!0}},this.close=()=>{this.sending=!1,this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.formSuccess=!1,this.formError=!1,this.formMessage="",this.formEmail=""},this.openScreenShot=()=>{this.hasSelectedElement=!1,this.showModal=!1,this.showScreenshotMode=!0,this.encodedScreenshot=null,document.getElementsByTagName("html")[0].style.overflow="auto"},this.closeScreenShot=()=>{this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.overlay.style.display="none",document.getElementsByTagName("html")[0].style.overflow="inherit"},this.handleMouseOverScreenShot=e=>{if(e.preventDefault(),this.hasSelectedElement)return;this.overlay.style.display="none",this.screenshotModal.style.display="none";const t=document.elementFromPoint(e.clientX,e.clientY).getBoundingClientRect();this.screenshotModal.style.display="",this.elementSelected.style.position="absolute",this.elementSelected.style.left=`${t.left}px`,this.elementSelected.style.top=`${t.top}px`,this.elementSelected.style.width=`${t.width}px`,this.elementSelected.style.height=`${t.height}px`,this.elementSelected.classList.add("feedback-modal-element-hover"),this.topSide.style.position="absolute",this.topSide.style.left=`${t.left}px`,this.topSide.style.top="0px",this.topSide.style.width=`${t.width+8}px`,this.topSide.style.height=`${t.top}px`,this.topSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.leftSide.style.position="absolute",this.leftSide.style.left="0px",this.leftSide.style.top="0px",this.leftSide.style.width=`${t.left}px`,this.leftSide.style.height="100vh",this.leftSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.bottomSide.style.position="absolute",this.bottomSide.style.left=`${t.left}px`,this.bottomSide.style.top=`${t.bottom+8}px`,this.bottomSide.style.width=`${t.width+8}px`,this.bottomSide.style.height="100vh",this.bottomSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.rightSide.style.position="absolute",this.rightSide.style.left=`${t.right+8}px`,this.rightSide.style.top="0px",this.rightSide.style.width="100%",this.rightSide.style.height="100vh",this.rightSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.screenshotModal.style.backgroundColor="transparent"},this.handleMouseClickedSelectedElement=e=>{e.preventDefault(),this.elementSelected&&this.elementSelected.classList.add("feedback-modal-element-selected");let t=this.elementSelected.getBoundingClientRect().top;this.elementSelected.style.top=`${t+window.pageYOffset}px`;const o=this.elementSelected.cloneNode(!0);document.body.appendChild(o),this.elementSelected.style.top=`${t}px`,this.encodedScreenshot=a.toPng(document.body,{cacheBust:!0}).then((function(e){return document.body.removeChild(o),e})).catch((function(e){return console.error("oops, something went wrong!",e),""})),document.getElementsByTagName("html")[0].style.overflow="hidden",this.hasSelectedElement=!0,this.overlay.style.display="block",this.showModal=!0},this.sending=!1,this.formMessage="",this.formEmail="",this.formSuccess=!1,this.formError=!1,this.encodedScreenshot=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1}componentWillLoad(){this.formEmail=this.email}handleMessageInput(e){this.formMessage=e.target.value}handleEmailInput(e){this.formEmail=e.target.value}render(){return t("div",{class:"feedback-modal-wrapper"},this.showScreenshotMode&&t("div",{class:"feedback-modal-screenshot",ref:e=>this.screenshotModal=e,onMouseMove:this.handleMouseOverScreenShot},t("div",{class:"feedback-modal-screenshot-element-selected",ref:e=>this.elementSelected=e,onClick:this.handleMouseClickedSelectedElement}),t("div",{class:"top-side",ref:e=>this.topSide=e}),t("div",{class:"left-side",ref:e=>this.leftSide=e}),t("div",{class:"bottom-side",ref:e=>this.bottomSide=e}),t("div",{class:"right-side",ref:e=>this.rightSide=e}),t("div",{class:"feedback-modal-screenshot-header",onClick:this.closeScreenShot},t("span",null,this.screenshotTopbarText),t("span",{class:"feedback-modal-screenshot-close"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-screenshot-overlay",ref:e=>this.overlay=e})),this.showModal&&t("div",{class:`feedback-modal-content feedback-modal-content--${this.modalPosition}`,ref:e=>this.modalContent=e},t("div",{class:"feedback-modal-header"},this.formSuccess||this.formError?this.formSuccess?t("span",{class:"text-center"},this.successModalTitle):this.formError?t("span",{class:"text-center"},this.errorModalTitle):t("span",null):t("span",null,this.modalTitle),t("button",{class:"feedback-modal-close",onClick:this.close},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#ccc","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-body"},this.formSuccess||this.formError?t("span",null):t("form",{onSubmit:this.handleSubmit},t("div",{class:"feedback-modal-text"},t("textarea",{placeholder:this.messagePlaceholder,value:this.formMessage,onInput:e=>this.handleMessageInput(e),required:!0})),!this.email&&t("div",{class:"feedback-modal-email"},t("input",{type:"email",placeholder:this.emailPlaceholder,onInput:e=>this.handleEmailInput(e),value:this.formEmail})),t("div",{class:"feedback-modal-buttons"},t("button",{type:"button",class:"button"+(this.encodedScreenshot?" active":""),title:this.screenshotButtonTooltipText,onClick:this.openScreenShot,disabled:this.sending},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-camera"},t("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t("circle",{cx:"12",cy:"13",r:"4"}))),t("button",{class:"button",type:"submit",disabled:this.sending},this.sendButtonText)))),t("div",{class:"feedback-modal-footer"},t("div",{class:"feedback-logo"},t("svg",{class:"w-8 h-8",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},t("defs",null,t("radialGradient",{cx:"21.152%",cy:"86.063%",fx:"21.152%",fy:"86.063%",r:"79.941%",id:"footer-logo"},t("stop",{"stop-color":"#4FD1C5",offset:"0%"}),t("stop",{"stop-color":"#81E6D9",offset:"25.871%"}),t("stop",{"stop-color":"#338CF5",offset:"100%"}))),t("rect",{width:"32",height:"32",rx:"16",fill:"url(#footer-logo)","fill-rule":"nonzero"}))," ",t("a",{href:"https://pushfeedback.com"},"PushFeedback")))))}};s.style=".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300}.feedback-modal-content.feedback-modal-content--center{left:50%;top:50%;transform:translate(-50%, -50%)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;justify-content:space-between}.button{background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";export{n as feedback_button,s as feedback_modal}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as
|
|
1
|
+
import{p as e,b as t}from"./p-60079923.js";export{s as setNonce}from"./p-60079923.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-eac9210f",[[1,"feedback-button",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],buttonStyle:[1,"button-style"]}],[1,"feedback-modal",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],showModal:[1540,"show-modal"],showScreenshotMode:[1540,"show-screenshot-mode"],hasSelectedElement:[1540,"has-selected-element"],sending:[32],formMessage:[32],formEmail:[32],formSuccess:[32],formError:[32],encodedScreenshot:[32]}]]]],e)));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { FeedbackModal } from '../feedback-modal/feedback-modal';
|
|
2
1
|
export declare class FeedbackButton {
|
|
3
|
-
feedbackModal:
|
|
2
|
+
feedbackModal: any;
|
|
4
3
|
modalTitle: string;
|
|
5
4
|
successModalTitle: string;
|
|
6
5
|
errorModalTitle: string;
|
|
@@ -12,7 +11,9 @@ export declare class FeedbackButton {
|
|
|
12
11
|
email: string;
|
|
13
12
|
emailPlaceholder: string;
|
|
14
13
|
messagePlaceholder: string;
|
|
15
|
-
|
|
14
|
+
buttonStyle: string;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
16
17
|
showModal(): void;
|
|
17
18
|
render(): any;
|
|
18
19
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
export namespace Components {
|
|
9
9
|
interface FeedbackButton {
|
|
10
|
+
"buttonStyle": string;
|
|
10
11
|
"email": string;
|
|
11
12
|
"emailPlaceholder": string;
|
|
12
13
|
"errorModalTitle": string;
|
|
@@ -56,6 +57,7 @@ declare global {
|
|
|
56
57
|
}
|
|
57
58
|
declare namespace LocalJSX {
|
|
58
59
|
interface FeedbackButton {
|
|
60
|
+
"buttonStyle"?: string;
|
|
59
61
|
"email"?: string;
|
|
60
62
|
"emailPlaceholder"?: string;
|
|
61
63
|
"errorModalTitle"?: string;
|
|
@@ -133,7 +133,7 @@ export interface ListenOptions {
|
|
|
133
133
|
*/
|
|
134
134
|
passive?: boolean;
|
|
135
135
|
}
|
|
136
|
-
export
|
|
136
|
+
export type ListenTargetOptions = 'body' | 'document' | 'window';
|
|
137
137
|
export interface StateDecorator {
|
|
138
138
|
(): PropertyDecorator;
|
|
139
139
|
}
|
|
@@ -214,8 +214,8 @@ export declare const State: StateDecorator;
|
|
|
214
214
|
* https://stenciljs.com/docs/reactive-data#watch-decorator
|
|
215
215
|
*/
|
|
216
216
|
export declare const Watch: WatchDecorator;
|
|
217
|
-
export
|
|
218
|
-
export
|
|
217
|
+
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
218
|
+
export type ErrorHandler = (err: any, element?: HTMLElement) => void;
|
|
219
219
|
/**
|
|
220
220
|
* `setMode()` is used for libraries which provide multiple "modes" for styles.
|
|
221
221
|
*/
|
|
@@ -257,6 +257,15 @@ export declare function getAssetPath(path: string): string;
|
|
|
257
257
|
* @returns the set path
|
|
258
258
|
*/
|
|
259
259
|
export declare function setAssetPath(path: string): string;
|
|
260
|
+
/**
|
|
261
|
+
* Used to specify a nonce value that corresponds with an application's
|
|
262
|
+
* [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
|
|
263
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
264
|
+
* Alternatively, the nonce value can be set on a `meta` tag in the DOM head
|
|
265
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) and will result in the same behavior.
|
|
266
|
+
* @param nonce The value to be used for the nonce attribute.
|
|
267
|
+
*/
|
|
268
|
+
export declare function setNonce(nonce: string): void;
|
|
260
269
|
/**
|
|
261
270
|
* Retrieve a Stencil element for a given reference
|
|
262
271
|
* @param ref the ref to get the Stencil element for
|
|
@@ -433,13 +442,57 @@ interface HostAttributes {
|
|
|
433
442
|
ref?: (el: HTMLElement | null) => void;
|
|
434
443
|
[prop: string]: any;
|
|
435
444
|
}
|
|
445
|
+
/**
|
|
446
|
+
* Utilities for working with functional Stencil components. An object
|
|
447
|
+
* conforming to this interface is passed by the Stencil runtime as the third
|
|
448
|
+
* argument to a functional component, allowing component authors to work with
|
|
449
|
+
* features like children.
|
|
450
|
+
*
|
|
451
|
+
* The children of a functional component will be passed as the second
|
|
452
|
+
* argument, so a functional component which uses these utils to transform its
|
|
453
|
+
* children might look like the following:
|
|
454
|
+
*
|
|
455
|
+
* ```ts
|
|
456
|
+
* export const AddClass: FunctionalComponent = (_, children, utils) => (
|
|
457
|
+
* utils.map(children, child => ({
|
|
458
|
+
* ...child,
|
|
459
|
+
* vattrs: {
|
|
460
|
+
* ...child.vattrs,
|
|
461
|
+
* class: `${child.vattrs.class} add-class`
|
|
462
|
+
* }
|
|
463
|
+
* }))
|
|
464
|
+
* );
|
|
465
|
+
* ```
|
|
466
|
+
*
|
|
467
|
+
* For more see the Stencil documentation, here:
|
|
468
|
+
* https://stenciljs.com/docs/functional-components
|
|
469
|
+
*/
|
|
436
470
|
export interface FunctionalUtilities {
|
|
471
|
+
/**
|
|
472
|
+
* Utility for reading the children of a functional component at runtime.
|
|
473
|
+
* Since the Stencil runtime uses a different interface for children it is
|
|
474
|
+
* not recommendeded to read the children directly, and is preferable to use
|
|
475
|
+
* this utility to, for instance, perform a side effect for each child.
|
|
476
|
+
*/
|
|
437
477
|
forEach: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => void) => void;
|
|
478
|
+
/**
|
|
479
|
+
* Utility for transforming the children of a functional component. Given an
|
|
480
|
+
* array of children and a callback this will return a list of the results of
|
|
481
|
+
* passing each child to the supplied callback.
|
|
482
|
+
*/
|
|
438
483
|
map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
|
|
439
484
|
}
|
|
440
485
|
export interface FunctionalComponent<T = {}> {
|
|
441
486
|
(props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[];
|
|
442
487
|
}
|
|
488
|
+
/**
|
|
489
|
+
* A Child VDOM node
|
|
490
|
+
*
|
|
491
|
+
* This has most of the same properties as {@link VNode} but friendlier names
|
|
492
|
+
* (i.e. `vtag` instead of `$tag$`, `vchildren` instead of `$children$`) in
|
|
493
|
+
* order to provide a friendlier public interface for users of the
|
|
494
|
+
* {@link FunctionalUtilities}).
|
|
495
|
+
*/
|
|
443
496
|
export interface ChildNode {
|
|
444
497
|
vtag?: string | number | Function;
|
|
445
498
|
vkey?: string | number;
|
|
@@ -486,6 +539,9 @@ export declare function h(sel: any, children: Array<VNode | undefined | null>):
|
|
|
486
539
|
export declare function h(sel: any, data: VNodeData | null, text: string): VNode;
|
|
487
540
|
export declare function h(sel: any, data: VNodeData | null, children: Array<VNode | undefined | null>): VNode;
|
|
488
541
|
export declare function h(sel: any, data: VNodeData | null, children: VNode): VNode;
|
|
542
|
+
/**
|
|
543
|
+
* A virtual DOM node
|
|
544
|
+
*/
|
|
489
545
|
export interface VNode {
|
|
490
546
|
$flags$: number;
|
|
491
547
|
$tag$: string | number | Function;
|
package/loader/index.d.ts
CHANGED
|
@@ -10,3 +10,12 @@ export interface CustomElementsDefineOptions {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
|
|
12
12
|
export declare function applyPolyfills(): Promise<void>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
16
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
17
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
18
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
19
|
+
* will result in the same behavior.
|
|
20
|
+
*/
|
|
21
|
+
export declare function setNonce(nonce: string): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pushfeedback",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Feedback widget for websites.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"es2015": "dist/esm/index.mjs",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"dom-to-image": "^2.6.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@stencil/react-output-target": "^0.5.3",
|
|
33
34
|
"@types/jest": "^27.0.3",
|
|
34
35
|
"jest": "^27.4.5",
|
|
35
36
|
"jest-cli": "^27.4.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,H as o}from"./p-e53ad7c2.js";const n=class{constructor(t){e(this,t),this.feedbackModal=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?"}componentDidLoad(){this.feedbackModal.showModal=!1}showModal(){this.feedbackModal.showModal=!0}render(){let e={};return["modalTitle","successModalTitle","errorModalTitle","modalPosition","sendButtonText","project","screenshotButtonTooltipText","screenshotTopbarText","email","emailPlaceholder","messagePlaceholder","showModal"].forEach((t=>{e[t]=this[t]})),t(o,null,t("a",{class:"feedback-button-content",onClick:()=>this.showModal()},t("slot",null)),t("feedback-modal",Object.assign({},e,{ref:e=>this.feedbackModal=e})))}};n.style=".feedback-button-content{cursor:pointer;background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.feedback-button-content:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";var r,i=(function(e){!function(){var t=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var o,n;return(o="application/font-woff",n="image/jpeg",{woff:o,woff2:o,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[t(e).toLowerCase()]||""},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var o=window.atob(e.toDataURL().split(",")[1]),n=o.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=o.charCodeAt(i);t(new Blob([r],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var o=document.implementation.createHTMLDocument(),n=o.createElement("base");o.head.appendChild(n);var r=o.createElement("a");return o.body.appendChild(r),n.href=t,r.href=e,r.href},getAndEncode:function(e){return s.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime()),new Promise((function(t){var o,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var e=r.result.split(/,/)[1];t(e)},r.readAsDataURL(n.response)}else o?t(o):i("cannot fetch resource: "+e+", status: "+n.status)},n.ontimeout=function(){o?t(o):i("timeout of 30000ms occured while fetching resource: "+e)},n.responseType="blob",n.timeout=3e4,n.open("GET",e,!0),n.send(),s.impl.options.imagePlaceholder){var r=s.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(o=r[1])}function i(e){console.error(e),t("")}}))},uid:(e=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise((function(o){setTimeout((function(){o(t)}),e)}))}},asArray:function(e){for(var t=[],o=e.length,n=0;n<o;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,o){var n=new Image;n.onload=function(){t(n)},n.onerror=o,n.src=e}))},width:function(e){var t=o(e,"border-left-width"),n=o(e,"border-right-width");return e.scrollWidth+t+n},height:function(e){var t=o(e,"border-top-width"),n=o(e,"border-bottom-width");return e.scrollHeight+t+n}};var e;function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function o(e,t){var o=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(o.replace("px",""))}}(),o=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,t,i){return o(e)?Promise.resolve(e).then(n).then((function(o){var n=Promise.resolve(e);return o.forEach((function(e){n=n.then((function(o){return r(o,e,t,i)}))})),n})):Promise.resolve(e)},shouldProcess:o,impl:{readUrls:n,inline:r}};function o(t){return-1!==t.search(e)}function n(o){for(var n,r=[];null!==(n=e.exec(o));)r.push(n[1]);return r.filter((function(e){return!t.isDataUrl(e)}))}function r(e,o,n,r){return Promise.resolve(o).then((function(e){return n?t.resolveUrl(e,n):e})).then(r||t.getAndEncode).then((function(e){return t.dataAsUrl(e,t.mimeType(o))})).then((function(n){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+t.escape(e)+")(['\"]?\\))","g")}(o),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(e){var o=[];return e.forEach((function(e){try{t.asArray(e.cssRules||[]).forEach(o.push.bind(o))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),o})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return o.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){return o.inlineAll(e.cssText,(e.parentStyleSheet||{}).href)},src:function(){return e.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function n(r){return r instanceof Element?function(e){var t=e.style.getPropertyValue("background");return t?o.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}(r).then((function(){return r instanceof HTMLImageElement?e(r).inline():Promise.all(t.asArray(r.childNodes).map((function(e){return n(e)})))})):Promise.resolve(r)},impl:{newImage:e}};function e(e){return{inline:function(o){return t.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(o||t.getAndEncode).then((function(o){return t.dataAsUrl(o,t.mimeType(e.src))})).then((function(t){return new Promise((function(o,n){e.onload=o,e.onerror=n,e.src=t}))}))}}}}(),i=void 0,a=!1,s={toSvg:c,toPng:function(e,t){return d(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return d(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,o){return d(e,o||{}).then(t.canvasToBlob)},toPixelData:function(e,o){return d(e,o||{}).then((function(o){return o.getContext("2d").getImageData(0,0,t.width(e),t.height(e)).data}))},impl:{fontFaces:n,images:r,util:t,inliner:o,options:{}}};function c(e,o){return function(e){s.impl.options.imagePlaceholder=void 0===e.imagePlaceholder?i:e.imagePlaceholder,s.impl.options.cacheBust=void 0===e.cacheBust?a:e.cacheBust}(o=o||{}),Promise.resolve(e).then((function(e){return l(e,o.filter,!0)})).then(u).then(f).then((function(e){return o.bgcolor&&(e.style.backgroundColor=o.bgcolor),o.width&&(e.style.width=o.width+"px"),o.height&&(e.style.height=o.height+"px"),o.style&&Object.keys(o.style).forEach((function(t){e.style[t]=o.style[t]})),e})).then((function(n){return function(e,o,n){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(t.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+o+'" height="'+n+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(n,o.width||t.width(e),o.height||t.height(e))}))}function d(e,o){return c(e,o).then(t.makeImage).then(t.delay(100)).then((function(n){var r=function(e){var n=document.createElement("canvas");if(n.width=o.width||t.width(e),n.height=o.height||t.height(e),o.bgcolor){var r=n.getContext("2d");r.fillStyle=o.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(e);return r.getContext("2d").drawImage(n,0,0),r}))}function l(e,o,n){return n||!o||o(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?t.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(n){return function(e,o,n){var r=e.childNodes;return 0===r.length?Promise.resolve(o):function(e,t,o){var n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return l(t,o)})).then((function(t){t&&e.appendChild(t)}))})),n}(o,t.asArray(r),n).then((function(){return o}))}(e,n,o)})).then((function(o){return function(e,o){return o instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(e),r=o.style,n.cssText?r.cssText=n.cssText:function(e,o){t.asArray(e).forEach((function(t){o.setProperty(t,e.getPropertyValue(t),e.getPropertyPriority(t))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(""!==i&&"none"!==i){var a=t.uid();o.className=o.className+" "+a;var s=document.createElement("style");s.appendChild(function(e,o,n){var r="."+e+":"+o,i=n.cssText?a(n):s(n);return document.createTextNode(r+"{"+i+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function s(e){return t.asArray(e).map(o).join("; ")+";";function o(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}(a,n,r)),o.appendChild(s)}}(n)}))})).then((function(){e instanceof HTMLTextAreaElement&&(o.innerHTML=e.value),e instanceof HTMLInputElement&&o.setAttribute("value",e.value)})).then((function(){o instanceof SVGElement&&(o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o instanceof SVGRectElement&&["width","height"].forEach((function(e){var t=o.getAttribute(e);t&&o.style.setProperty(e,t)})))})).then((function(){return o})):o}(e,o)})):Promise.resolve()}function u(e){return n.resolveAll().then((function(t){var o=document.createElement("style");return e.appendChild(o),o.appendChild(document.createTextNode(t)),e}))}function f(e){return r.inlineAll(e).then((function(){return e}))}e.exports=s}()}(r={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),r.exports);const a=class{constructor(t){e(this,t),this.handleSubmit=async e=>{e.preventDefault(),this.showScreenshotMode=!1,this.showModal=!1,this.sending=!0;let t="";this.encodedScreenshot&&await this.encodedScreenshot.then((e=>{t=e})).catch((e=>{console.log(e)}));try{200===(await fetch("https://app.pushfeedback.com/api/feedback/",{method:"POST",body:JSON.stringify({url:window.location.href,message:this.formMessage,email:this.formEmail,project:this.project,screenshot:t}),headers:{"Content-Type":"application/json"}})).status?(this.formSuccess=!0,this.formError=!1):(this.formSuccess=!1,this.formError=!0)}catch(e){this.formSuccess=!1,this.formError=!0}finally{this.sending=!1,this.showModal=!0}},this.close=()=>{this.sending=!1,this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.formSuccess=!1,this.formError=!1,this.formMessage="",this.formEmail=""},this.openScreenShot=()=>{this.hasSelectedElement=!1,this.showModal=!1,this.showScreenshotMode=!0,this.encodedScreenshot=null,document.getElementsByTagName("html")[0].style.overflow="auto"},this.closeScreenShot=()=>{this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.overlay.style.display="none",document.getElementsByTagName("html")[0].style.overflow="inherit"},this.handleMouseOverScreenShot=e=>{if(e.preventDefault(),this.hasSelectedElement)return;this.overlay.style.display="none",this.screenshotModal.style.display="none";const t=document.elementFromPoint(e.clientX,e.clientY).getBoundingClientRect();this.screenshotModal.style.display="",this.elementSelected.style.position="absolute",this.elementSelected.style.left=`${t.left}px`,this.elementSelected.style.top=`${t.top}px`,this.elementSelected.style.width=`${t.width}px`,this.elementSelected.style.height=`${t.height}px`,this.elementSelected.classList.add("feedback-modal-element-hover"),this.topSide.style.position="absolute",this.topSide.style.left=`${t.left}px`,this.topSide.style.top="0px",this.topSide.style.width=`${t.width+8}px`,this.topSide.style.height=`${t.top}px`,this.topSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.leftSide.style.position="absolute",this.leftSide.style.left="0px",this.leftSide.style.top="0px",this.leftSide.style.width=`${t.left}px`,this.leftSide.style.height="100vh",this.leftSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.bottomSide.style.position="absolute",this.bottomSide.style.left=`${t.left}px`,this.bottomSide.style.top=`${t.bottom+8}px`,this.bottomSide.style.width=`${t.width+8}px`,this.bottomSide.style.height="100vh",this.bottomSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.rightSide.style.position="absolute",this.rightSide.style.left=`${t.right+8}px`,this.rightSide.style.top="0px",this.rightSide.style.width="100%",this.rightSide.style.height="100vh",this.rightSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.screenshotModal.style.backgroundColor="transparent"},this.handleMouseClickedSelectedElement=e=>{e.preventDefault(),this.elementSelected&&this.elementSelected.classList.add("feedback-modal-element-selected");let t=this.elementSelected.getBoundingClientRect().top;this.elementSelected.style.top=`${t+window.pageYOffset}px`;const o=this.elementSelected.cloneNode(!0);document.body.appendChild(o),this.elementSelected.style.top=`${t}px`,this.encodedScreenshot=i.toPng(document.body,{cacheBust:!0}).then((function(e){return document.body.removeChild(o),e})).catch((function(e){return console.error("oops, something went wrong!",e),""})),document.getElementsByTagName("html")[0].style.overflow="hidden",this.hasSelectedElement=!0,this.overlay.style.display="block",this.showModal=!0},this.sending=!1,this.formMessage="",this.formEmail="",this.formSuccess=!1,this.formError=!1,this.encodedScreenshot=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1}componentWillLoad(){this.formEmail=this.email}handleMessageInput(e){this.formMessage=e.target.value}handleEmailInput(e){this.formEmail=e.target.value}render(){return t("div",{class:"feedback-modal-wrapper"},this.showScreenshotMode&&t("div",{class:"feedback-modal-screenshot",ref:e=>this.screenshotModal=e,onMouseMove:this.handleMouseOverScreenShot},t("div",{class:"feedback-modal-screenshot-element-selected",ref:e=>this.elementSelected=e,onClick:this.handleMouseClickedSelectedElement}),t("div",{class:"top-side",ref:e=>this.topSide=e}),t("div",{class:"left-side",ref:e=>this.leftSide=e}),t("div",{class:"bottom-side",ref:e=>this.bottomSide=e}),t("div",{class:"right-side",ref:e=>this.rightSide=e}),t("div",{class:"feedback-modal-screenshot-header",onClick:this.closeScreenShot},t("span",null,this.screenshotTopbarText),t("span",{class:"feedback-modal-screenshot-close"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-screenshot-overlay",ref:e=>this.overlay=e})),this.showModal&&t("div",{class:`feedback-modal-content feedback-modal-content--${this.modalPosition}`,ref:e=>this.modalContent=e},t("div",{class:"feedback-modal-header"},this.formSuccess||this.formError?this.formSuccess?t("span",{class:"text-center"},this.successModalTitle):this.formError?t("span",{class:"text-center"},this.errorModalTitle):t("span",null):t("span",null,this.modalTitle),t("button",{class:"feedback-modal-close",onClick:this.close},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#ccc","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-body"},this.formSuccess||this.formError?t("span",null):t("form",{onSubmit:this.handleSubmit},t("div",{class:"feedback-modal-text"},t("textarea",{placeholder:this.messagePlaceholder,value:this.formMessage,onInput:e=>this.handleMessageInput(e),required:!0})),!this.email&&t("div",{class:"feedback-modal-email"},t("input",{type:"email",placeholder:this.emailPlaceholder,onInput:e=>this.handleEmailInput(e),value:this.formEmail})),t("div",{class:"feedback-modal-buttons"},t("button",{type:"button",class:"button"+(this.encodedScreenshot?" active":""),title:this.screenshotButtonTooltipText,onClick:this.openScreenShot,disabled:this.sending},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-camera"},t("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t("circle",{cx:"12",cy:"13",r:"4"}))),t("button",{class:"button",type:"submit",disabled:this.sending},this.sendButtonText)))),t("div",{class:"feedback-modal-footer"},t("div",{class:"feedback-logo"},t("svg",{class:"w-8 h-8",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},t("defs",null,t("radialGradient",{cx:"21.152%",cy:"86.063%",fx:"21.152%",fy:"86.063%",r:"79.941%",id:"footer-logo"},t("stop",{"stop-color":"#4FD1C5",offset:"0%"}),t("stop",{"stop-color":"#81E6D9",offset:"25.871%"}),t("stop",{"stop-color":"#338CF5",offset:"100%"}))),t("rect",{width:"32",height:"32",rx:"16",fill:"url(#footer-logo)","fill-rule":"nonzero"}))," ",t("a",{href:"https://pushfeedback.com"},"PushFeedback")))))}};a.style=".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300}.feedback-modal-content.feedback-modal-content--center{left:50%;top:50%;transform:translate(-50%, -50%)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;justify-content:space-between}.button{background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";export{n as feedback_button,a as feedback_modal}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
let e,t,n=!1,l=!1;const s="http://www.w3.org/1999/xlink",o={},i=e=>"object"==(e=typeof e)||"function"===e,r=(e,t,...n)=>{let l=null,s=null,o=!1,r=!1;const u=[],f=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!i(l))&&(l+=""),o&&r?u[u.length-1].t+=l:u.push(o?c(null,l):l),r=o)};if(f(n),t){t.key&&(s=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const a=c(e,null);return a.l=t,u.length>0&&(a.o=u),a.i=s,a},c=(e,t)=>({u:0,h:e,t,$:null,o:null,l:null,i:null}),u={},f=new WeakMap,a=e=>"sc-"+e.p,h=(e,t,n,l,o,r)=>{if(n!==l){let c=U(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=p(n),o=p(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const f=i(l);if((c||f&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const s=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}let a=!1;u!==(u=u.replace(/^xlink\:?/,""))&&(t=u,a=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(a?e.removeAttributeNS(s,t):e.removeAttribute(t)):(!c||4&r||o)&&!f&&(l=!0===l?"":l,a?e.setAttributeNS(s,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):U(_,u)?u.slice(2):u[2]+t.slice(3),n&&B.rel(e,t,n,!1),l&&B.ael(e,t,l,!1)}},$=/\s/,p=e=>e?e.split($):[],y=(e,t,n,l)=>{const s=11===t.$.nodeType&&t.$.host?t.$.host:t.$,i=e&&e.l||o,r=t.l||o;for(l in i)l in r||h(s,l,i[l],void 0,n,t.u);for(l in r)h(s,l,i[l],r[l],n,t.u)},d=(t,l,s)=>{const o=l.o[s];let i,r,c=0;if(null!==o.t)i=o.$=z.createTextNode(o.t);else{if(n||(n="svg"===o.h),i=o.$=z.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.h),n&&"foreignObject"===o.h&&(n=!1),y(null,o,n),null!=e&&i["s-si"]!==e&&i.classList.add(i["s-si"]=e),o.o)for(c=0;c<o.o.length;++c)r=d(t,o,c),r&&i.appendChild(r);"svg"===o.h?n=!1:"foreignObject"===i.tagName&&(n=!0)}return i},w=(e,n,l,s,o,i)=>{let r,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=i;++o)s[o]&&(r=d(null,l,o),r&&(s[o].$=r,c.insertBefore(r,n)))},m=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.$,v(l),s.remove())},b=(e,t)=>e.h===t.h&&e.i===t.i,g=(e,t)=>{const l=t.$=e.$,s=e.o,o=t.o,i=t.h,r=t.t;null===r?(n="svg"===i||"foreignObject"!==i&&n,"slot"===i||y(e,t,n),null!==s&&null!==o?((e,t,n,l)=>{let s,o,i=0,r=0,c=0,u=0,f=t.length-1,a=t[0],h=t[f],$=l.length-1,p=l[0],y=l[$];for(;i<=f&&r<=$;)if(null==a)a=t[++i];else if(null==h)h=t[--f];else if(null==p)p=l[++r];else if(null==y)y=l[--$];else if(b(a,p))g(a,p),a=t[++i],p=l[++r];else if(b(h,y))g(h,y),h=t[--f],y=l[--$];else if(b(a,y))g(a,y),e.insertBefore(a.$,h.$.nextSibling),a=t[++i],y=l[--$];else if(b(h,p))g(h,p),e.insertBefore(h.$,a.$),h=t[--f],p=l[++r];else{for(c=-1,u=i;u<=f;++u)if(t[u]&&null!==t[u].i&&t[u].i===p.i){c=u;break}c>=0?(o=t[c],o.h!==p.h?s=d(t&&t[r],n,c):(g(o,p),t[c]=void 0,s=o.$),p=l[++r]):(s=d(t&&t[r],n,r),p=l[++r]),s&&a.$.parentNode.insertBefore(s,a.$)}i>f?w(e,null==l[$+1]?null:l[$+1].$,n,l,r,$):r>$&&m(t,i,f)})(l,s,t,o):null!==o?(null!==e.t&&(l.textContent=""),w(l,null,t,o,0,o.length-1)):null!==s&&m(s,0,s.length-1),n&&"svg"===i&&(n=!1)):e.t!==r&&(l.data=r)},v=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(v)},S=(e,t)=>{t&&!e.m&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.m=t)))},j=(e,t)=>{if(e.u|=16,!(4&e.u))return S(e,e.g),ee((()=>k(e,t)));e.u|=512},k=(e,t)=>{const n=e.v;let l;return t&&(l=L(n,"componentWillLoad")),P(l,(()=>O(e,n,t)))},O=async(e,t,n)=>{const l=e.S,s=l["s-rc"];n&&(e=>{const t=e.j,n=e.S,l=t.u,s=((e,t)=>{let n=a(t);const l=V.get(n);if(e=11===e.nodeType?e:z,l)if("string"==typeof l){let t,s=f.get(e=e.head||e);s||f.set(e,s=new Set),s.has(n)||(t=z.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);M(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>x(e);0===t.length?n():(Promise.all(t).then(n),e.u|=4,t.length=0)}},M=(n,l)=>{try{l=l.render(),n.u&=-17,n.u|=2,((n,l)=>{const s=n.S,o=n.j,i=n.k||c(null,null),f=(e=>e&&e.h===u)(l)?l:r(null,null,l);t=s.tagName,o.O&&(f.l=f.l||{},o.O.map((([e,t])=>f.l[t]=s[e]))),f.h=null,f.u|=4,n.k=f,f.$=i.$=s.shadowRoot||s,e=s["s-sc"],g(i,f)})(n,l)}catch(e){q(e,n.S)}return null},x=e=>{const t=e.S,n=e.v,l=e.g;64&e.u||(e.u|=64,E(t),L(n,"componentDidLoad"),e.M(t),l||C()),e.m&&(e.m(),e.m=void 0),512&e.u&&Z((()=>j(e,!1))),e.u&=-517},C=()=>{E(z.documentElement),Z((()=>(e=>{const t=B.ce("appload",{detail:{namespace:"pushfeedback"}});return e.dispatchEvent(t),t})(_)))},L=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){q(e)}},P=(e,t)=>e&&e.then?e.then(t):t(),E=e=>e.classList.add("hydrated"),N=(e,t,n)=>{if(t.C){const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>A(this).L.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=A(e),o=s.L.get(t),r=s.u,c=s.v;n=((e,t)=>null==e||i(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.C[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.L.set(t,n),c&&2==(18&r)&&j(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){B.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.O.push([e,s]),s}))}}return e},T=(e,t={})=>{const n=[],l=t.exclude||[],s=_.customElements,o=z.head,i=o.querySelector("meta[charset]"),r=z.createElement("style"),c=[];let u,f=!0;Object.assign(B,t),B.P=new URL(t.resourcesUrl||"./",z.baseURI).href,e.map((e=>{e[1].map((t=>{const o={u:t[0],p:t[1],C:t[2],N:t[3]};o.C=t[2],o.O=[];const i=o.p,r=class extends HTMLElement{constructor(e){super(e),R(e=this,o),1&o.u&&e.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),f?c.push(this):B.jmp((()=>(e=>{if(0==(1&B.u)){const t=A(e),n=t.j,l=()=>{};if(!(1&t.u)){t.u|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){S(t,t.g=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.u)){{if(t.u|=32,(s=F(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(N(s,n,2),s.isProxied=!0);const e=()=>{};t.u|=8;try{new s(t)}catch(e){q(e)}t.u&=-9,e()}if(s.style){let e=s.style;const t=a(n);if(!V.has(t)){const l=()=>{};((e,t,n)=>{let l=V.get(e);I&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,V.set(e,l)})(t,e,!!(1&n.u)),l()}}}const o=t.g,i=()=>j(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){B.jmp((()=>{}))}componentOnReady(){return A(this).T}};o.W=e[0],l.includes(i)||s.get(i)||(n.push(i),s.define(i,N(r,o,1)))}))})),r.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles",""),o.insertBefore(r,i?i.nextSibling:o.firstChild),f=!1,c.length?c.map((e=>e.connectedCallback())):B.jmp((()=>u=setTimeout(C,30)))},W=new WeakMap,A=e=>W.get(e),H=(e,t)=>W.set(t.v=e,t),R=(e,t)=>{const n={u:0,S:e,j:t,L:new Map};return n.T=new Promise((e=>n.M=e)),e["s-p"]=[],e["s-rc"]=[],W.set(e,n)},U=(e,t)=>t in e,q=(e,t)=>(0,console.error)(e,t),D=new Map,F=e=>{const t=e.p.replace(/-/g,"_"),n=e.W,l=D.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(D.set(n,e),e[t])),q)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},V=new Map,_="undefined"!=typeof window?window:{},z=_.document||{head:{}},B={u:0,P:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},G=e=>Promise.resolve(e),I=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),J=[],K=[],Q=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&B.u?Z(Y):B.raf(Y))},X=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){q(e)}e.length=0},Y=()=>{X(J),X(K),(l=J.length>0)&&B.raf(Y)},Z=e=>G().then(e),ee=Q(K,!0);export{u as H,T as b,r as h,G as p,H as r}
|