pushfeedback 0.1.47 → 0.1.48

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.
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-90e8ba79.js";export{s as setNonce}from"./p-90e8ba79.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-4398a3ae",[[1,"feedback-button",{sessionId:[1537,"session-id"],customFont:[4,"custom-font"],errorMessage:[1,"error-message"],errorMessage403:[1,"error-message-4-0-3"],errorMessage404:[1,"error-message-4-0-4"],modalTitle:[1,"modal-title"],modalTitleSuccess:[1,"modal-title-success"],modalTitleError:[1,"modal-title-error"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],successMessage:[1,"success-message"],project:[1],screenshotButtonText:[1,"screenshot-button-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],hideEmail:[4,"hide-email"],emailAddress:[1,"email-address"],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],hideRating:[4,"hide-rating"],rating:[2],ratingMode:[1,"rating-mode"],ratingPlaceholder:[1,"rating-placeholder"],ratingStarsPlaceholder:[1,"rating-stars-placeholder"],buttonStyle:[1,"button-style"],buttonPosition:[1,"button-position"],hideIcon:[4,"hide-icon"],hideScreenshotButton:[4,"hide-screenshot-button"],hidePrivacyPolicy:[4,"hide-privacy-policy"],privacyPolicyText:[1,"privacy-policy-text"],fetchData:[4,"fetch-data"]}],[1,"feedback-modal",{customFont:[4,"custom-font"],errorMessage:[1,"error-message"],errorMessage403:[1,"error-message-4-0-3"],errorMessage404:[1,"error-message-4-0-4"],modalTitle:[1,"modal-title"],modalTitleSuccess:[1,"modal-title-success"],modalTitleError:[1,"modal-title-error"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],successMessage:[1,"success-message"],project:[1],screenshotButtonText:[1,"screenshot-button-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],hideEmail:[4,"hide-email"],emailAddress:[1,"email-address"],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],hideRating:[4,"hide-rating"],rating:[2],ratingMode:[1,"rating-mode"],ratingPlaceholder:[1,"rating-placeholder"],ratingStarsPlaceholder:[1,"rating-stars-placeholder"],showModal:[1540,"show-modal"],showScreenshotMode:[1540,"show-screenshot-mode"],showScreenshotTopBar:[1540,"show-screenshot-top-bar"],hasSelectedElement:[1540,"has-selected-element"],hideScreenshotButton:[4,"hide-screenshot-button"],hidePrivacyPolicy:[4,"hide-privacy-policy"],privacyPolicyText:[1,"privacy-policy-text"],fetchData:[4,"fetch-data"],sending:[32],formMessage:[32],formEmail:[32],formSuccess:[32],formVerification:[32],formError:[32],formErrorStatus:[32],encodedScreenshot:[32],isPrivacyChecked:[32],whitelabel:[32],selectedRating:[32]}]]]],e)));
1
+ import{p as e,b as t}from"./p-6204856a.js";export{s as setNonce}from"./p-6204856a.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-9641858f",[[1,"feedback-button",{sessionId:[1537,"session-id"],customFont:[4,"custom-font"],errorMessage:[1,"error-message"],errorMessage403:[1,"error-message-4-0-3"],errorMessage404:[1,"error-message-4-0-4"],modalTitle:[1,"modal-title"],modalTitleSuccess:[1,"modal-title-success"],modalTitleError:[1,"modal-title-error"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],successMessage:[1,"success-message"],project:[1],screenshotButtonText:[1,"screenshot-button-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],hideEmail:[4,"hide-email"],emailAddress:[1,"email-address"],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],hideRating:[4,"hide-rating"],rating:[2],ratingMode:[1,"rating-mode"],ratingPlaceholder:[1,"rating-placeholder"],ratingStarsPlaceholder:[1,"rating-stars-placeholder"],buttonStyle:[1,"button-style"],buttonPosition:[1,"button-position"],hideIcon:[4,"hide-icon"],hideScreenshotButton:[4,"hide-screenshot-button"],hidePrivacyPolicy:[4,"hide-privacy-policy"],privacyPolicyText:[1,"privacy-policy-text"],fetchData:[4,"fetch-data"]}],[1,"feedback-modal",{customFont:[4,"custom-font"],errorMessage:[1,"error-message"],errorMessage403:[1,"error-message-4-0-3"],errorMessage404:[1,"error-message-4-0-4"],modalTitle:[1,"modal-title"],modalTitleSuccess:[1,"modal-title-success"],modalTitleError:[1,"modal-title-error"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],successMessage:[1,"success-message"],project:[1],screenshotButtonText:[1,"screenshot-button-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],hideEmail:[4,"hide-email"],emailAddress:[1,"email-address"],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],hideRating:[4,"hide-rating"],rating:[2],ratingMode:[1,"rating-mode"],ratingPlaceholder:[1,"rating-placeholder"],ratingStarsPlaceholder:[1,"rating-stars-placeholder"],showModal:[1540,"show-modal"],showScreenshotMode:[1540,"show-screenshot-mode"],showScreenshotTopBar:[1540,"show-screenshot-top-bar"],hasSelectedElement:[1540,"has-selected-element"],hideScreenshotButton:[4,"hide-screenshot-button"],hidePrivacyPolicy:[4,"hide-privacy-policy"],privacyPolicyText:[1,"privacy-policy-text"],fetchData:[4,"fetch-data"],sending:[32],formMessage:[32],formEmail:[32],formSuccess:[32],formVerification:[32],formError:[32],formErrorStatus:[32],encodedScreenshot:[32],isPrivacyChecked:[32],whitelabel:[32],selectedRating:[32]}]]]],e)));
@@ -1,3 +1,4 @@
1
+ import { Event, EventEmitter } from '../../stencil-public-runtime';
1
2
  export declare class FeedbackModal {
2
3
  scrollTimeout: any;
3
4
  sending: boolean;
@@ -41,6 +42,12 @@ export declare class FeedbackModal {
41
42
  hidePrivacyPolicy: boolean;
42
43
  privacyPolicyText: string;
43
44
  fetchData: boolean;
45
+ feedbackSent: EventEmitter<{
46
+ feedback: any;
47
+ }>;
48
+ feedbackError: EventEmitter<{
49
+ error: any;
50
+ }>;
44
51
  modalContent: HTMLElement;
45
52
  screenshotModal: HTMLElement;
46
53
  elementSelected: HTMLElement;
@@ -71,6 +71,10 @@ export namespace Components {
71
71
  "successMessage": string;
72
72
  }
73
73
  }
74
+ export interface FeedbackModalCustomEvent<T> extends CustomEvent<T> {
75
+ detail: T;
76
+ target: HTMLFeedbackModalElement;
77
+ }
74
78
  declare global {
75
79
  interface HTMLFeedbackButtonElement extends Components.FeedbackButton, HTMLStencilElement {
76
80
  }
@@ -140,6 +144,8 @@ declare namespace LocalJSX {
140
144
  "modalTitle"?: string;
141
145
  "modalTitleError"?: string;
142
146
  "modalTitleSuccess"?: string;
147
+ "onFeedbackError"?: (event: FeedbackModalCustomEvent<{ error: any }>) => void;
148
+ "onFeedbackSent"?: (event: FeedbackModalCustomEvent<{ feedback: any }>) => void;
143
149
  "privacyPolicyText"?: string;
144
150
  "project"?: string;
145
151
  "rating"?: number;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "pushfeedback",
3
3
  "author": "TechDocs Studio <hi@techdocs.studio>",
4
4
  "homepage": "https://pushfeedback.com/",
5
- "version": "0.1.47",
5
+ "version": "0.1.48",
6
6
  "description": "Feedback widget for websites.",
7
7
  "main": "dist/index.cjs.js",
8
8
  "module": "dist/index.js",
@@ -1,2 +0,0 @@
1
- let e,n,t=!1,l=!1;const s={},o=e=>"object"==(e=typeof e)||"function"===e;function i(e){var n,t,l;return null!==(l=null===(t=null===(n=e.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const c=(e,n,...t)=>{let l=null,s=null,i=!1,c=!1;const u=[],a=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?a(l):null!=l&&"boolean"!=typeof l&&((i="function"!=typeof e&&!o(l))&&(l+=""),i&&c?u[u.length-1].t+=l:u.push(i?r(null,l):l),c=i)};if(a(t),n){n.key&&(s=n.key);{const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((n=>e[n])).join(" "))}}const f=r(e,null);return f.l=n,u.length>0&&(f.o=u),f.i=s,f},r=(e,n)=>({u:0,h:e,t:n,p:null,o:null,l:null,i:null}),u={},a=e=>R(e).$,f=new WeakMap,d=e=>"sc-"+e.m,h=(e,n,t,l,s,i)=>{if(t!==l){let c=D(e,n),r=n.toLowerCase();if("class"===n){const n=e.classList,s=$(t),o=$(l);n.remove(...s.filter((e=>e&&!o.includes(e)))),n.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===n){for(const n in t)l&&null!=l[n]||(n.includes("-")?e.style.removeProperty(n):e.style[n]="");for(const n in l)t&&l[n]===t[n]||(n.includes("-")?e.style.setProperty(n,l[n]):e.style[n]=l[n])}else if("key"===n);else if("ref"===n)l&&l(e);else if(c||"o"!==n[0]||"n"!==n[1]){const r=o(l);if((c||r&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[n]=l;else{const s=null==l?"":l;"list"===n?c=!1:null!=t&&e[n]==s||(e[n]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(n)||e.removeAttribute(n):(!c||4&i||s)&&!r&&e.setAttribute(n,l=!0===l?"":l)}else n="-"===n[2]?n.slice(3):D(G,r)?r.slice(2):r[2]+n.slice(3),t&&J.rel(e,n,t,!1),l&&J.ael(e,n,l,!1)}},p=/\s/,$=e=>e?e.split(p):[],y=(e,n,t,l)=>{const o=11===n.p.nodeType&&n.p.host?n.p.host:n.p,i=e&&e.l||s,c=n.l||s;for(l in i)l in c||h(o,l,i[l],void 0,t,n.u);for(l in c)h(o,l,i[l],c[l],t,n.u)},m=(n,l,s)=>{const o=l.o[s];let i,c,r=0;if(null!==o.t)i=o.p=I.createTextNode(o.t);else{if(t||(t="svg"===o.h),i=o.p=I.createElementNS(t?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.h),t&&"foreignObject"===o.h&&(t=!1),y(null,o,t),null!=e&&i["s-si"]!==e&&i.classList.add(i["s-si"]=e),o.o)for(r=0;r<o.o.length;++r)c=m(n,o,r),c&&i.appendChild(c);"svg"===o.h?t=!1:"foreignObject"===i.tagName&&(t=!0)}return i},b=(e,t,l,s,o,i)=>{let c,r=e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);o<=i;++o)s[o]&&(c=m(null,l,o),c&&(s[o].p=c,r.insertBefore(c,t)))},w=(e,n,t,l,s)=>{for(;n<=t;++n)(l=e[n])&&(s=l.p,S(l),s.remove())},v=(e,n)=>e.h===n.h&&e.i===n.i,g=(e,n)=>{const l=n.p=e.p,s=e.o,o=n.o,i=n.h,c=n.t;null===c?(t="svg"===i||"foreignObject"!==i&&t,"slot"===i||y(e,n,t),null!==s&&null!==o?((e,n,t,l)=>{let s,o,i=0,c=0,r=0,u=0,a=n.length-1,f=n[0],d=n[a],h=l.length-1,p=l[0],$=l[h];for(;i<=a&&c<=h;)if(null==f)f=n[++i];else if(null==d)d=n[--a];else if(null==p)p=l[++c];else if(null==$)$=l[--h];else if(v(f,p))g(f,p),f=n[++i],p=l[++c];else if(v(d,$))g(d,$),d=n[--a],$=l[--h];else if(v(f,$))g(f,$),e.insertBefore(f.p,d.p.nextSibling),f=n[++i],$=l[--h];else if(v(d,p))g(d,p),e.insertBefore(d.p,f.p),d=n[--a],p=l[++c];else{for(r=-1,u=i;u<=a;++u)if(n[u]&&null!==n[u].i&&n[u].i===p.i){r=u;break}r>=0?(o=n[r],o.h!==p.h?s=m(n&&n[c],t,r):(g(o,p),n[r]=void 0,s=o.p),p=l[++c]):(s=m(n&&n[c],t,c),p=l[++c]),s&&f.p.parentNode.insertBefore(s,f.p)}i>a?b(e,null==l[h+1]?null:l[h+1].p,t,l,c,h):c>h&&w(n,i,a)})(l,s,n,o):null!==o?(null!==e.t&&(l.textContent=""),b(l,null,n,o,0,o.length-1)):null!==s&&w(s,0,s.length-1),t&&"svg"===i&&(t=!1)):e.t!==c&&(l.data=c)},S=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(S)},j=(e,n)=>{n&&!e.v&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.v=n)))},k=(e,n)=>{if(e.u|=16,!(4&e.u))return j(e,e.g),le((()=>O(e,n)));e.u|=512},O=(e,n)=>{const t=e.S;let l;return n&&(l=P(t,"componentWillLoad")),E(l,(()=>C(e,t,n)))},C=async(e,n,t)=>{const l=e.$,s=l["s-rc"];t&&(e=>{const n=e.j,t=e.$,l=n.u,s=((e,n)=>{var t;let l=d(n);const s=B.get(l);if(e=11===e.nodeType?e:I,s)if("string"==typeof s){let n,o=f.get(e=e.head||e);if(o||f.set(e,o=new Set),!o.has(l)){{n=I.createElement("style"),n.innerHTML=s;const l=null!==(t=J.k)&&void 0!==t?t:i(I);null!=l&&n.setAttribute("nonce",l),e.insertBefore(n,e.querySelector("link"))}o&&o.add(l)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=s,t.classList.add(s+"-h"))})(e);M(e,n),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const n=l["s-p"],t=()=>x(e);0===n.length?t():(Promise.all(n).then(t),e.u|=4,n.length=0)}},M=(t,l)=>{try{l=l.render(),t.u&=-17,t.u|=2,((t,l)=>{const s=t.$,o=t.j,i=t.O||r(null,null),a=(e=>e&&e.h===u)(l)?l:c(null,null,l);n=s.tagName,o.C&&(a.l=a.l||{},o.C.map((([e,n])=>a.l[n]=s[e]))),a.h=null,a.u|=4,t.O=a,a.p=i.p=s.shadowRoot||s,e=s["s-sc"],g(i,a)})(t,l)}catch(e){V(e,t.$)}return null},x=e=>{const n=e.$,t=e.S,l=e.g;64&e.u||(e.u|=64,N(n),P(t,"componentDidLoad"),e.M(n),l||L()),e.v&&(e.v(),e.v=void 0),512&e.u&&te((()=>k(e,!1))),e.u&=-517},L=()=>{N(I.documentElement),te((()=>(e=>{const n=J.ce("appload",{detail:{namespace:"pushfeedback"}});return e.dispatchEvent(n),n})(G)))},P=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){V(e)}},E=(e,n)=>e&&e.then?e.then(n):n(),N=e=>e.classList.add("hydrated"),T=(e,n,t)=>{if(n.L){const l=Object.entries(n.L),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&t&&32&l)&&Object.defineProperty(s,e,{get(){return((e,n)=>R(this).P.get(n))(0,e)},set(t){((e,n,t,l)=>{const s=R(e),i=s.P.get(n),c=s.u,r=s.S;t=((e,n)=>null==e||o(e)?e:4&n?"false"!==e&&(""===e||!!e):2&n?parseFloat(e):1&n?e+"":e)(t,l.L[n][0]),8&c&&void 0!==i||t===i||Number.isNaN(i)&&Number.isNaN(t)||(s.P.set(n,t),r&&2==(18&c)&&k(s,!1))})(this,e,t,n)},configurable:!0,enumerable:!0})})),1&t){const t=new Map;s.attributeChangedCallback=function(e,n,l){J.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,n])=>15&n[0])).map((([e,l])=>{const s=l[1]||e;return t.set(s,e),512&l[0]&&n.C.push([e,s]),s}))}}return e},W=e=>{P(e,"connectedCallback")},A=(e,n={})=>{var t;const l=[],s=n.exclude||[],o=G.customElements,c=I.head,r=c.querySelector("meta[charset]"),u=I.createElement("style"),a=[];let f,h=!0;Object.assign(J,n),J.N=new URL(n.resourcesUrl||"./",I.baseURI).href,e.map((e=>{e[1].map((n=>{const t={u:n[0],m:n[1],L:n[2],T:n[3]};t.L=n[2],t.C=[];const i=t.m,c=class extends HTMLElement{constructor(e){super(e),q(e=this,t),1&t.u&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),h?a.push(this):J.jmp((()=>(e=>{if(0==(1&J.u)){const n=R(e),t=n.j,l=()=>{};if(1&n.u)W(n.S);else{n.u|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){j(n,n.g=t);break}}t.L&&Object.entries(t.L).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t,l,s)=>{if(0==(32&n.u)){{if(n.u|=32,(s=z(t)).then){const e=()=>{};s=await s,e()}s.isProxied||(T(s,t,2),s.isProxied=!0);const e=()=>{};n.u|=8;try{new s(n)}catch(e){V(e)}n.u&=-9,e(),W(n.S)}if(s.style){let e=s.style;const n=d(t);if(!B.has(n)){const l=()=>{};((e,n,t)=>{let l=B.get(e);Q&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,B.set(e,l)})(n,e,!!(1&t.u)),l()}}}const o=n.g,i=()=>k(n,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,n,t)}l()}})(this)))}disconnectedCallback(){J.jmp((()=>(()=>{0==(1&J.u)&&P(R(this).S,"disconnectedCallback")})()))}componentOnReady(){return R(this).W}};t.A=e[0],s.includes(i)||o.get(i)||(l.push(i),o.define(i,T(c,t,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(t=J.k)&&void 0!==t?t:i(I);null!=e&&u.setAttribute("nonce",e),c.insertBefore(u,r?r.nextSibling:c.firstChild)}h=!1,a.length?a.map((e=>e.connectedCallback())):J.jmp((()=>f=setTimeout(L,30)))},F=e=>J.k=e,H=new WeakMap,R=e=>H.get(e),U=(e,n)=>H.set(n.S=e,n),q=(e,n)=>{const t={u:0,$:e,j:n,P:new Map};return t.W=new Promise((e=>t.M=e)),e["s-p"]=[],e["s-rc"]=[],H.set(e,t)},D=(e,n)=>n in e,V=(e,n)=>(0,console.error)(e,n),_=new Map,z=e=>{const n=e.m.replace(/-/g,"_"),t=e.A,l=_.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(_.set(t,e),e[n])),V)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},B=new Map,G="undefined"!=typeof window?window:{},I=G.document||{head:{}},J={u:0,N:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},K=e=>Promise.resolve(e),Q=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),X=[],Y=[],Z=(e,n)=>t=>{e.push(t),l||(l=!0,n&&4&J.u?te(ne):J.raf(ne))},ee=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){V(e)}e.length=0},ne=()=>{ee(X),ee(Y),(l=X.length>0)&&J.raf(ne)},te=e=>K().then(e),le=Z(Y,!0);export{u as H,A as b,a as g,c as h,K as p,U as r,F as s}