pushfeedback 0.1.68 → 0.1.70
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/components/canvas-editor.d.ts +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/pushfeedback/app-globals-0f993ce5.js +3 -0
- package/dist/pushfeedback/canvas-editor.entry.js +860 -0
- package/dist/pushfeedback/css-shim-b7d3d95f.js +4 -0
- package/dist/pushfeedback/dom-64053c71.js +73 -0
- package/dist/{components/feedback-button.js → pushfeedback/feedback-button.entry.js} +30 -73
- package/dist/pushfeedback/feedback-modal.entry.js +295 -0
- package/dist/pushfeedback/index-36434da0.js +3371 -0
- package/dist/pushfeedback/index.esm.js +1 -0
- package/dist/pushfeedback/pushfeedback.css +146 -1
- package/dist/pushfeedback/pushfeedback.esm.js +148 -1
- package/dist/pushfeedback/shadow-css-98135883.js +387 -0
- package/dist/types/components/canvas-editor/canvas-editor.d.ts +108 -0
- package/dist/types/components/feedback-button/feedback-button.d.ts +11 -0
- package/dist/types/components/feedback-modal/feedback-modal.d.ts +23 -71
- package/dist/types/components.d.ts +102 -0
- package/package.json +3 -4
- package/dist/cjs/feedback-button_2.cjs.entry.js +0 -9918
- package/dist/cjs/index-9a8f4784.js +0 -1584
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -22
- package/dist/cjs/pushfeedback.cjs.js +0 -23
- package/dist/collection/collection-manifest.json +0 -13
- package/dist/collection/components/feedback-button/feedback-button.css +0 -81
- package/dist/collection/components/feedback-button/feedback-button.js +0 -949
- package/dist/collection/components/feedback-modal/feedback-modal.css +0 -896
- package/dist/collection/components/feedback-modal/feedback-modal.js +0 -1700
- package/dist/collection/index.js +0 -1
- package/dist/components/feedback-modal.js +0 -6
- package/dist/components/feedback-modal2.js +0 -9814
- package/dist/components/index.js +0 -3
- package/dist/esm/feedback-button_2.entry.js +0 -9913
- package/dist/esm/index-f65e9124.js +0 -1555
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -18
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/pushfeedback.js +0 -18
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/pushfeedback/p-7406f7be.entry.js +0 -7
- package/dist/pushfeedback/p-af2a1f7f.js +0 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
3
|
+
*/
|
|
4
|
+
var __assign=undefined&&undefined.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector="";};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r);}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE;}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return "\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return {start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return {start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t);}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else {if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s);}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value;}));}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0);})),!t)return "break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return [];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t});})),t++;})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o});}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement;}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors);})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return ":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return {original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return !1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t));}));}function reScope(e,t){var r=e.template.map((function(r){return "string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t);}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t);})).observe(document.head,{childList:!0});}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove();}})).catch((function(e){console.error(e);}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1;}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}));}));})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal();}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal();},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e);},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n);}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes);},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document));}("undefined"!=typeof window&&window);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
3
|
+
*/
|
|
4
|
+
(function(){
|
|
5
|
+
var aa=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function g(a){var b=aa.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return !b&&a}function l(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return !(!a||!(a.__CE_isImportDocument||a instanceof Document))}
|
|
6
|
+
function n(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null}
|
|
7
|
+
function p(a,b,d){d=void 0===d?new Set:d;for(var c=a;c;){if(c.nodeType===Node.ELEMENT_NODE){var e=c;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){c=e.import;if(c instanceof Node&&!d.has(c))for(d.add(c),c=c.firstChild;c;c=c.nextSibling)p(c,b,d);c=n(a,e);continue}else if("template"===f){c=n(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)p(e,b,d);}c=c.firstChild?c.firstChild:n(a,c);}}function r(a,b,d){a[b]=d;}function u(){this.a=new Map;this.g=new Map;this.c=[];this.f=[];this.b=!1;}function ba(a,b,d){a.a.set(b,d);a.g.set(d.constructorFunction,d);}function ca(a,b){a.b=!0;a.c.push(b);}function da(a,b){a.b=!0;a.f.push(b);}function v(a,b){a.b&&p(b,function(b){return w(a,b)});}function w(a,b){if(a.b&&!b.__CE_patched){b.__CE_patched=!0;for(var d=0;d<a.c.length;d++)a.c[d](b);for(d=0;d<a.f.length;d++)a.f[d](b);}}
|
|
8
|
+
function x(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state?a.connectedCallback(c):y(a,c);}}function z(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state&&a.disconnectedCallback(c);}}
|
|
9
|
+
function A(a,b,d){d=void 0===d?{}:d;var c=d.u||new Set,e=d.i||function(b){return y(a,b)},f=[];p(b,function(b){if("link"===b.localName&&"import"===b.getAttribute("rel")){var d=b.import;d instanceof Node&&(d.__CE_isImportDocument=!0,d.__CE_hasRegistry=!0);d&&"complete"===d.readyState?d.__CE_documentLoadHandled=!0:b.addEventListener("load",function(){var d=b.import;if(!d.__CE_documentLoadHandled){d.__CE_documentLoadHandled=!0;var f=new Set(c);f.delete(d);A(a,d,{u:f,i:e});}});}else f.push(b);},c);if(a.b)for(b=
|
|
10
|
+
0;b<f.length;b++)w(a,f[b]);for(b=0;b<f.length;b++)e(f[b]);}
|
|
11
|
+
function y(a,b){if(void 0===b.__CE_state){var d=b.ownerDocument;if(d.defaultView||d.__CE_isImportDocument&&d.__CE_hasRegistry)if(d=a.a.get(b.localName)){d.constructionStack.push(b);var c=d.constructorFunction;try{try{if(new c!==b)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{d.constructionStack.pop();}}catch(t){throw b.__CE_state=2,t;}b.__CE_state=1;b.__CE_definition=d;if(d.attributeChangedCallback)for(d=d.observedAttributes,c=0;c<d.length;c++){var e=
|
|
12
|
+
d[c],f=b.getAttribute(e);null!==f&&a.attributeChangedCallback(b,e,null,f,null);}l(b)&&a.connectedCallback(b);}}}u.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a);};u.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a);};
|
|
13
|
+
u.prototype.attributeChangedCallback=function(a,b,d,c,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&f.attributeChangedCallback.call(a,b,d,c,e);};function B(a){var b=document;this.c=a;this.a=b;this.b=void 0;A(this.c,this.a);"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}));}function C(a){a.b&&a.b.disconnect();}B.prototype.f=function(a){var b=this.a.readyState;"interactive"!==b&&"complete"!==b||C(this);for(b=0;b<a.length;b++)for(var d=a[b].addedNodes,c=0;c<d.length;c++)A(this.c,d[c]);};function ea(){var a=this;this.b=this.a=void 0;this.c=new Promise(function(b){a.b=b;a.a&&b(a.a);});}function D(a){if(a.a)throw Error("Already resolved.");a.a=void 0;a.b&&a.b(void 0);}function E(a){this.c=!1;this.a=a;this.j=new Map;this.f=function(b){return b()};this.b=!1;this.g=[];this.o=new B(a);}
|
|
14
|
+
E.prototype.l=function(a,b){var d=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!g(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this.a.a.get(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var c=function(b){var a=e[b];if(void 0!==a&&!(a instanceof Function))throw Error("The '"+b+"' callback must be a function.");
|
|
15
|
+
return a},e=b.prototype;if(!(e instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=c("connectedCallback");var t=c("disconnectedCallback");var k=c("adoptedCallback");var h=c("attributeChangedCallback");var m=b.observedAttributes||[];}catch(q){return}finally{this.c=!1;}b={localName:a,constructorFunction:b,connectedCallback:f,disconnectedCallback:t,adoptedCallback:k,attributeChangedCallback:h,observedAttributes:m,constructionStack:[]};ba(this.a,
|
|
16
|
+
a,b);this.g.push(b);this.b||(this.b=!0,this.f(function(){return fa(d)}));};E.prototype.i=function(a){A(this.a,a);};
|
|
17
|
+
function fa(a){if(!1!==a.b){a.b=!1;for(var b=a.g,d=[],c=new Map,e=0;e<b.length;e++)c.set(b[e].localName,[]);A(a.a,document,{i:function(b){if(void 0===b.__CE_state){var e=b.localName,f=c.get(e);f?f.push(b):a.a.a.get(e)&&d.push(b);}}});for(e=0;e<d.length;e++)y(a.a,d[e]);for(;0<b.length;){var f=b.shift();e=f.localName;f=c.get(f.localName);for(var t=0;t<f.length;t++)y(a.a,f[t]);(e=a.j.get(e))&&D(e);}}}E.prototype.get=function(a){if(a=this.a.a.get(a))return a.constructorFunction};
|
|
18
|
+
E.prototype.m=function(a){if(!g(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this.j.get(a);if(b)return b.c;b=new ea;this.j.set(a,b);this.a.a.get(a)&&!this.g.some(function(b){return b.localName===a})&&D(b);return b.c};E.prototype.s=function(a){C(this.o);var b=this.f;this.f=function(d){return a(function(){return b(d)})};};window.CustomElementRegistry=E;E.prototype.define=E.prototype.l;E.prototype.upgrade=E.prototype.i;E.prototype.get=E.prototype.get;
|
|
19
|
+
E.prototype.whenDefined=E.prototype.m;E.prototype.polyfillWrapFlushCallback=E.prototype.s;var F=window.Document.prototype.createElement,G=window.Document.prototype.createElementNS,ha=window.Document.prototype.importNode,ia=window.Document.prototype.prepend,ja=window.Document.prototype.append,ka=window.DocumentFragment.prototype.prepend,la=window.DocumentFragment.prototype.append,H=window.Node.prototype.cloneNode,I=window.Node.prototype.appendChild,J=window.Node.prototype.insertBefore,K=window.Node.prototype.removeChild,L=window.Node.prototype.replaceChild,M=Object.getOwnPropertyDescriptor(window.Node.prototype,
|
|
20
|
+
"textContent"),N=window.Element.prototype.attachShadow,O=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),P=window.Element.prototype.getAttribute,Q=window.Element.prototype.setAttribute,R=window.Element.prototype.removeAttribute,S=window.Element.prototype.getAttributeNS,T=window.Element.prototype.setAttributeNS,U=window.Element.prototype.removeAttributeNS,ma=window.Element.prototype.insertAdjacentElement,na=window.Element.prototype.insertAdjacentHTML,oa=window.Element.prototype.prepend,
|
|
21
|
+
pa=window.Element.prototype.append,V=window.Element.prototype.before,qa=window.Element.prototype.after,ra=window.Element.prototype.replaceWith,sa=window.Element.prototype.remove,ta=window.HTMLElement,W=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),ua=window.HTMLElement.prototype.insertAdjacentElement,va=window.HTMLElement.prototype.insertAdjacentHTML;var wa=new function(){};function xa(){var a=X;window.HTMLElement=function(){function b(){var b=this.constructor,c=a.g.get(b);if(!c)throw Error("The custom element being constructed was not registered with `customElements`.");var e=c.constructionStack;if(0===e.length)return e=F.call(document,c.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=1,e.__CE_definition=c,w(a,e),e;c=e.length-1;var f=e[c];if(f===wa)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");
|
|
22
|
+
e[c]=wa;Object.setPrototypeOf(f,b.prototype);w(a,f);return f}b.prototype=ta.prototype;Object.defineProperty(b.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:b});return b}();}function Y(a,b,d){function c(b){return function(d){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var f=[],m=0;m<e.length;m++){var q=e[m];q instanceof Element&&l(q)&&f.push(q);if(q instanceof DocumentFragment)for(q=q.firstChild;q;q=q.nextSibling)c.push(q);else c.push(q);}b.apply(this,e);for(e=0;e<f.length;e++)z(a,f[e]);if(l(this))for(e=0;e<c.length;e++)f=c[e],f instanceof Element&&x(a,f);}}void 0!==d.h&&(b.prepend=c(d.h));void 0!==d.append&&(b.append=c(d.append));}function ya(){var a=X;r(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var d=a.a.get(b);if(d)return new d.constructorFunction}b=F.call(this,b);w(a,b);return b});r(Document.prototype,"importNode",function(b,d){b=ha.call(this,b,!!d);this.__CE_hasRegistry?A(a,b):v(a,b);return b});r(Document.prototype,"createElementNS",function(b,d){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var c=a.a.get(d);if(c)return new c.constructorFunction}b=G.call(this,b,
|
|
23
|
+
d);w(a,b);return b});Y(a,Document.prototype,{h:ia,append:ja});}function za(){function a(a,c){Object.defineProperty(a,"textContent",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(a){if(this.nodeType===Node.TEXT_NODE)c.set.call(this,a);else {var d=void 0;if(this.firstChild){var e=this.childNodes,k=e.length;if(0<k&&l(this)){d=Array(k);for(var h=0;h<k;h++)d[h]=e[h];}}c.set.call(this,a);if(d)for(a=0;a<d.length;a++)z(b,d[a]);}}});}var b=X;r(Node.prototype,"insertBefore",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes);
|
|
24
|
+
a=J.call(this,a,c);if(l(this))for(c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);c=J.call(this,a,c);e&&z(b,a);l(this)&&x(b,a);return c});r(Node.prototype,"appendChild",function(a){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);a=I.call(this,a);if(l(this))for(var e=0;e<c.length;e++)x(b,c[e]);return a}c=l(a);e=I.call(this,a);c&&z(b,a);l(this)&&x(b,a);return e});r(Node.prototype,"cloneNode",function(a){a=H.call(this,!!a);this.ownerDocument.__CE_hasRegistry?A(b,a):v(b,
|
|
25
|
+
a);return a});r(Node.prototype,"removeChild",function(a){var c=l(a),e=K.call(this,a);c&&z(b,a);return e});r(Node.prototype,"replaceChild",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes);a=L.call(this,a,c);if(l(this))for(z(b,c),c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);var f=L.call(this,a,c),d=l(this);d&&z(b,c);e&&z(b,a);d&&x(b,a);return f});M&&M.get?a(Node.prototype,M):ca(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){for(var a=[],
|
|
26
|
+
b=0;b<this.childNodes.length;b++){var f=this.childNodes[b];f.nodeType!==Node.COMMENT_NODE&&a.push(f.textContent);}return a.join("")},set:function(a){for(;this.firstChild;)K.call(this,this.firstChild);null!=a&&""!==a&&I.call(this,document.createTextNode(a));}});});}function Aa(a){function b(b){return function(e){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];d=[];for(var k=[],h=0;h<c.length;h++){var m=c[h];m instanceof Element&&l(m)&&k.push(m);if(m instanceof DocumentFragment)for(m=m.firstChild;m;m=m.nextSibling)d.push(m);else d.push(m);}b.apply(this,c);for(c=0;c<k.length;c++)z(a,k[c]);if(l(this))for(c=0;c<d.length;c++)k=d[c],k instanceof Element&&x(a,k);}}var d=Element.prototype;void 0!==V&&(d.before=b(V));void 0!==V&&(d.after=b(qa));void 0!==ra&&
|
|
27
|
+
r(d,"replaceWith",function(b){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var d=[],k=0;k<e.length;k++){var h=e[k];h instanceof Element&&l(h)&&d.push(h);if(h instanceof DocumentFragment)for(h=h.firstChild;h;h=h.nextSibling)c.push(h);else c.push(h);}k=l(this);ra.apply(this,e);for(e=0;e<d.length;e++)z(a,d[e]);if(k)for(z(a,this),e=0;e<c.length;e++)d=c[e],d instanceof Element&&x(a,d);});void 0!==sa&&r(d,"remove",function(){var b=l(this);sa.call(this);b&&z(a,this);});}function Ba(){function a(a,b){Object.defineProperty(a,"innerHTML",{enumerable:b.enumerable,configurable:!0,get:b.get,set:function(a){var e=this,d=void 0;l(this)&&(d=[],p(this,function(a){a!==e&&d.push(a);}));b.set.call(this,a);if(d)for(var f=0;f<d.length;f++){var t=d[f];1===t.__CE_state&&c.disconnectedCallback(t);}this.ownerDocument.__CE_hasRegistry?A(c,this):v(c,this);return a}});}function b(a,b){r(a,"insertAdjacentElement",function(a,e){var d=l(e);a=b.call(this,a,e);d&&z(c,e);l(a)&&x(c,e);return a});}
|
|
28
|
+
function d(a,b){function e(a,b){for(var e=[];a!==b;a=a.nextSibling)e.push(a);for(b=0;b<e.length;b++)A(c,e[b]);}r(a,"insertAdjacentHTML",function(a,c){a=a.toLowerCase();if("beforebegin"===a){var d=this.previousSibling;b.call(this,a,c);e(d||this.parentNode.firstChild,this);}else if("afterbegin"===a)d=this.firstChild,b.call(this,a,c),e(this.firstChild,d);else if("beforeend"===a)d=this.lastChild,b.call(this,a,c),e(d||this.firstChild,null);else if("afterend"===a)d=this.nextSibling,b.call(this,a,c),e(this.nextSibling,
|
|
29
|
+
d);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");});}var c=X;N&&r(Element.prototype,"attachShadow",function(a){a=N.call(this,a);var b=c;if(b.b&&!a.__CE_patched){a.__CE_patched=!0;for(var e=0;e<b.c.length;e++)b.c[e](a);}return this.__CE_shadowRoot=a});O&&O.get?a(Element.prototype,O):W&&W.get?a(HTMLElement.prototype,W):da(c,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){return H.call(this,!0).innerHTML},
|
|
30
|
+
set:function(a){var b="template"===this.localName,c=b?this.content:this,e=G.call(document,this.namespaceURI,this.localName);for(e.innerHTML=a;0<c.childNodes.length;)K.call(c,c.childNodes[0]);for(a=b?e.content:e;0<a.childNodes.length;)I.call(c,a.childNodes[0]);}});});r(Element.prototype,"setAttribute",function(a,b){if(1!==this.__CE_state)return Q.call(this,a,b);var e=P.call(this,a);Q.call(this,a,b);b=P.call(this,a);c.attributeChangedCallback(this,a,e,b,null);});r(Element.prototype,"setAttributeNS",function(a,
|
|
31
|
+
b,d){if(1!==this.__CE_state)return T.call(this,a,b,d);var e=S.call(this,a,b);T.call(this,a,b,d);d=S.call(this,a,b);c.attributeChangedCallback(this,b,e,d,a);});r(Element.prototype,"removeAttribute",function(a){if(1!==this.__CE_state)return R.call(this,a);var b=P.call(this,a);R.call(this,a);null!==b&&c.attributeChangedCallback(this,a,b,null,null);});r(Element.prototype,"removeAttributeNS",function(a,b){if(1!==this.__CE_state)return U.call(this,a,b);var d=S.call(this,a,b);U.call(this,a,b);var e=S.call(this,
|
|
32
|
+
a,b);d!==e&&c.attributeChangedCallback(this,b,d,e,a);});ua?b(HTMLElement.prototype,ua):ma?b(Element.prototype,ma):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");va?d(HTMLElement.prototype,va):na?d(Element.prototype,na):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");Y(c,Element.prototype,{h:oa,append:pa});Aa(c);}var Z=window.customElements;if(!Z||Z.forcePolyfill||"function"!=typeof Z.define||"function"!=typeof Z.get){var X=new u;xa();ya();Y(X,DocumentFragment.prototype,{h:ka,append:la});za();Ba();document.__CE_hasRegistry=!0;var customElements=new E(X);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:customElements});}}).call(self);
|
|
33
|
+
|
|
34
|
+
// Polyfill document.baseURI
|
|
35
|
+
"string"!==typeof document.baseURI&&Object.defineProperty(Document.prototype,"baseURI",{enumerable:!0,configurable:!0,get:function(){var a=document.querySelector("base");return a&&a.href?a.href:document.URL}});
|
|
36
|
+
|
|
37
|
+
// Polyfill CustomEvent
|
|
38
|
+
"function"!==typeof window.CustomEvent&&(window.CustomEvent=function(c,a){a=a||{bubbles:!1,cancelable:!1,detail:void 0};var b=document.createEvent("CustomEvent");b.initCustomEvent(c,a.bubbles,a.cancelable,a.detail);return b},window.CustomEvent.prototype=window.Event.prototype);
|
|
39
|
+
|
|
40
|
+
// Event.composedPath
|
|
41
|
+
(function(b,c,d){b.composedPath||(b.composedPath=function(){if(this.path)return this.path;var a=this.target;for(this.path=[];null!==a.parentNode;)this.path.push(a),a=a.parentNode;this.path.push(c,d);return this.path});})(Event.prototype,document,window);
|
|
42
|
+
|
|
43
|
+
/*!
|
|
44
|
+
Element.closest and Element.matches
|
|
45
|
+
https://github.com/jonathantneal/closest
|
|
46
|
+
Creative Commons Zero v1.0 Universal
|
|
47
|
+
*/
|
|
48
|
+
(function(a){"function"!==typeof a.matches&&(a.matches=a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||function(a){a=(this.document||this.ownerDocument).querySelectorAll(a);for(var b=0;a[b]&&a[b]!==this;)++b;return !!a[b]});"function"!==typeof a.closest&&(a.closest=function(a){for(var b=this;b&&1===b.nodeType;){if(b.matches(a))return b;b=b.parentNode;}return null});})(window.Element.prototype);
|
|
49
|
+
|
|
50
|
+
/*!
|
|
51
|
+
Element.getRootNode()
|
|
52
|
+
*/
|
|
53
|
+
(function(c){function d(a){a=b(a);return a&&11===a.nodeType?d(a.host):a}function b(a){return a&&a.parentNode?b(a.parentNode):a}"function"!==typeof c.getRootNode&&(c.getRootNode=function(a){return a&&a.composed?d(this):b(this)});})(Element.prototype);
|
|
54
|
+
|
|
55
|
+
/*!
|
|
56
|
+
Element.isConnected()
|
|
57
|
+
*/
|
|
58
|
+
(function(a){"isConnected"in a||Object.defineProperty(a,"isConnected",{configurable:!0,enumerable:!0,get:function(){var a=this.getRootNode({composed:!0});return a&&9===a.nodeType}});})(Element.prototype);
|
|
59
|
+
|
|
60
|
+
/*!
|
|
61
|
+
Element.remove()
|
|
62
|
+
*/
|
|
63
|
+
(function(b){b.forEach(function(a){a.hasOwnProperty("remove")||Object.defineProperty(a,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this);}});});})([Element.prototype,CharacterData.prototype,DocumentType.prototype]);
|
|
64
|
+
|
|
65
|
+
/*!
|
|
66
|
+
Element.classList
|
|
67
|
+
*/
|
|
68
|
+
!function(e){'classList'in e||Object.defineProperty(e,"classList",{get:function(){var e=this,t=(e.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){t.length>0?e.setAttribute("class",t.join(" ")):e.removeAttribute("class");}return ""===t[0]&&t.splice(0,1),t.toggle=function(e,i){void 0!==i?i?t.add(e):t.remove(e):-1!==t.indexOf(e)?t.splice(t.indexOf(e),1):t.push(e),n();},t.add=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1===t.indexOf(e[i])&&t.push(e[i]);n();},t.remove=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1!==t.indexOf(e[i])&&t.splice(t.indexOf(e[i]),1);n();},t.item=function(e){return t[e]},t.contains=function(e){return -1!==t.indexOf(e)},t.replace=function(e,i){-1!==t.indexOf(e)&&t.splice(t.indexOf(e),1,i),n();},t.value=e.getAttribute("class")||"",t}});}(Element.prototype);
|
|
69
|
+
|
|
70
|
+
/*!
|
|
71
|
+
DOMTokenList
|
|
72
|
+
*/
|
|
73
|
+
(function(b){try{document.body.classList.add();}catch(e){var c=b.add,d=b.remove;b.add=function(){for(var a=0;a<arguments.length;a++)c.call(this,arguments[a]);};b.remove=function(){for(var a=0;a<arguments.length;a++)d.call(this,arguments[a]);};}})(DOMTokenList.prototype);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as defineCustomElement$2 } from './feedback-modal2.js';
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-36434da0.js';
|
|
3
2
|
|
|
4
3
|
const feedbackButtonCss = ".feedback-button-content{cursor:pointer;max-width:fit-content;z-index:var(--feedback-button-z-index);font-family:var(--feedback-font-family)}.feedback-button-content--custom-font{font-family:inherit}.feedback-button-content--light{align-items:center;background-color:var(--feedback-button-light-bg-color);border-radius:var(--feedback-button-border-radius);box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;color:var(--feedback-button-light-text-color);display:flex;font-size:var(--feedback-button-text-font-size);font-weight:var(--feedback-button-text-font-weight);padding:8px 15px}.feedback-button-content--dark{align-items:center;background-color:var(--feedback-button-dark-bg-color);border-radius:var(--feedback-button-border-radius);box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;color:var(--feedback-button-dark-text-color);display:flex;font-weight:var(--feedback-button-text-font-weight);font-size:var(--feedback-button-text-font-size);padding:8px 15px}.icon-edit{stroke:var(--feedback-button-light-icon-color)}.feedback-button-content--dark .icon-edit{stroke:var(--feedback-button-dark-icon-color)}.feedback-button-content--bottom-right{bottom:10px;position:fixed;right:10px}.feedback-button-content--center-right{position:fixed;transform:rotate(-90deg) translateY(-50%);top:50%}.feedback-button-content--center-right.feedback-button-content--dark,.feedback-button-content--center-right.feedback-button-content--light{border-radius:4px;border-bottom-left-radius:0px;border-bottom-right-radius:0px}.feedback-button-content-icon{height:16px;margin-right:5px;width:16px}.feedback-button-content--center-right .feedback-button-content-icon{rotate:90deg}@media screen and (max-width: 767px){.feedback-button-content--hide-mobile{display:none}}";
|
|
5
4
|
|
|
6
|
-
const FeedbackButton
|
|
7
|
-
constructor() {
|
|
8
|
-
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
this.__attachShadow();
|
|
5
|
+
const FeedbackButton = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
11
8
|
this.feedbackSent = createEvent(this, "feedbackSent", 7);
|
|
12
9
|
this.feedbackError = createEvent(this, "feedbackError", 7);
|
|
13
10
|
this.buttonPosition = 'default';
|
|
@@ -32,6 +29,17 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
32
29
|
this.canvasEditorTitle = 'Edit screenshot';
|
|
33
30
|
this.canvasEditorCancelText = 'Cancel';
|
|
34
31
|
this.canvasEditorSaveText = 'Save';
|
|
32
|
+
this.editTextButtonText = 'Edit Text';
|
|
33
|
+
this.sizeLabelText = 'Size:';
|
|
34
|
+
this.borderLabelText = 'Border:';
|
|
35
|
+
this.editTextPromptText = 'Edit text:';
|
|
36
|
+
this.screenshotErrorGeneral = 'Failed to capture screenshot.';
|
|
37
|
+
this.screenshotErrorPermission = 'Permission denied. Please allow screen sharing to take screenshots.';
|
|
38
|
+
this.screenshotErrorNotSupported = 'Screen capture is not supported in this browser.';
|
|
39
|
+
this.screenshotErrorNotFound = 'No screen sources available for capture.';
|
|
40
|
+
this.screenshotErrorCancelled = 'Screenshot capture was cancelled.';
|
|
41
|
+
this.screenshotErrorBrowserNotSupported = 'Your browser does not support screen capture. Please use a browser like Chrome, Firefox, or Safari.';
|
|
42
|
+
this.screenshotErrorUnexpected = 'An unexpected error occurred. Please try again.';
|
|
35
43
|
this.emailPlaceholder = 'Email address (optional)';
|
|
36
44
|
this.errorMessage = 'Please try again later.';
|
|
37
45
|
this.errorMessage403 = 'The request URL does not match the one defined in PushFeedback for this project.';
|
|
@@ -95,6 +103,17 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
95
103
|
'canvasEditorTitle',
|
|
96
104
|
'canvasEditorCancelText',
|
|
97
105
|
'canvasEditorSaveText',
|
|
106
|
+
'editTextButtonText',
|
|
107
|
+
'sizeLabelText',
|
|
108
|
+
'borderLabelText',
|
|
109
|
+
'editTextPromptText',
|
|
110
|
+
'screenshotErrorGeneral',
|
|
111
|
+
'screenshotErrorPermission',
|
|
112
|
+
'screenshotErrorNotSupported',
|
|
113
|
+
'screenshotErrorNotFound',
|
|
114
|
+
'screenshotErrorCancelled',
|
|
115
|
+
'screenshotErrorBrowserNotSupported',
|
|
116
|
+
'screenshotErrorUnexpected',
|
|
98
117
|
'emailPlaceholder',
|
|
99
118
|
'errorMessage',
|
|
100
119
|
'errorMessage403',
|
|
@@ -186,70 +205,8 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
186
205
|
render() {
|
|
187
206
|
return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition} ${this.customFont ? 'feedback-button-content--custom-font' : ''} ${this.hideMobile ? 'feedback-button-content--hide-mobile' : ''}`, onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle != 'default' && (h("span", { class: "feedback-button-content-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "icon-edit" }, h("path", { d: "M12 20h9" }), h("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })))), h("slot", null))));
|
|
188
207
|
}
|
|
189
|
-
get el() { return this; }
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"buttonPosition": [1, "button-position"],
|
|
193
|
-
"buttonStyle": [1, "button-style"],
|
|
194
|
-
"hideIcon": [4, "hide-icon"],
|
|
195
|
-
"hideMobile": [4, "hide-mobile"],
|
|
196
|
-
"sessionId": [1537, "session-id"],
|
|
197
|
-
"metadata": [1],
|
|
198
|
-
"submit": [4],
|
|
199
|
-
"customFont": [4, "custom-font"],
|
|
200
|
-
"emailAddress": [1, "email-address"],
|
|
201
|
-
"isEmailRequired": [4, "is-email-required"],
|
|
202
|
-
"fetchData": [4, "fetch-data"],
|
|
203
|
-
"hideEmail": [4, "hide-email"],
|
|
204
|
-
"hidePrivacyPolicy": [4, "hide-privacy-policy"],
|
|
205
|
-
"hideRating": [4, "hide-rating"],
|
|
206
|
-
"hideScreenshotButton": [4, "hide-screenshot-button"],
|
|
207
|
-
"modalPosition": [1, "modal-position"],
|
|
208
|
-
"project": [1],
|
|
209
|
-
"rating": [2],
|
|
210
|
-
"ratingMode": [1, "rating-mode"],
|
|
211
|
-
"canvasEditorTitle": [1, "canvas-editor-title"],
|
|
212
|
-
"canvasEditorCancelText": [1, "canvas-editor-cancel-text"],
|
|
213
|
-
"canvasEditorSaveText": [1, "canvas-editor-save-text"],
|
|
214
|
-
"emailPlaceholder": [1, "email-placeholder"],
|
|
215
|
-
"errorMessage": [1, "error-message"],
|
|
216
|
-
"errorMessage403": [1, "error-message-4-0-3"],
|
|
217
|
-
"errorMessage404": [1, "error-message-4-0-4"],
|
|
218
|
-
"footerText": [1, "footer-text"],
|
|
219
|
-
"messagePlaceholder": [1, "message-placeholder"],
|
|
220
|
-
"modalTitle": [1, "modal-title"],
|
|
221
|
-
"modalTitleError": [1, "modal-title-error"],
|
|
222
|
-
"modalTitleSuccess": [1, "modal-title-success"],
|
|
223
|
-
"privacyPolicyText": [1, "privacy-policy-text"],
|
|
224
|
-
"ratingPlaceholder": [1, "rating-placeholder"],
|
|
225
|
-
"ratingStarsPlaceholder": [1, "rating-stars-placeholder"],
|
|
226
|
-
"screenshotAttachedText": [1, "screenshot-attached-text"],
|
|
227
|
-
"screenshotButtonText": [1, "screenshot-button-text"],
|
|
228
|
-
"screenshotTakingText": [1, "screenshot-taking-text"],
|
|
229
|
-
"screenshotTopbarText": [1, "screenshot-topbar-text"],
|
|
230
|
-
"sendButtonText": [1, "send-button-text"],
|
|
231
|
-
"successMessage": [1, "success-message"]
|
|
232
|
-
}]);
|
|
233
|
-
function defineCustomElement$1() {
|
|
234
|
-
if (typeof customElements === "undefined") {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
const components = ["feedback-button", "feedback-modal"];
|
|
238
|
-
components.forEach(tagName => { switch (tagName) {
|
|
239
|
-
case "feedback-button":
|
|
240
|
-
if (!customElements.get(tagName)) {
|
|
241
|
-
customElements.define(tagName, FeedbackButton$1);
|
|
242
|
-
}
|
|
243
|
-
break;
|
|
244
|
-
case "feedback-modal":
|
|
245
|
-
if (!customElements.get(tagName)) {
|
|
246
|
-
defineCustomElement$2();
|
|
247
|
-
}
|
|
248
|
-
break;
|
|
249
|
-
} });
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
const FeedbackButton = FeedbackButton$1;
|
|
253
|
-
const defineCustomElement = defineCustomElement$1;
|
|
208
|
+
get el() { return getElement(this); }
|
|
209
|
+
};
|
|
210
|
+
FeedbackButton.style = feedbackButtonCss;
|
|
254
211
|
|
|
255
|
-
export { FeedbackButton
|
|
212
|
+
export { FeedbackButton as feedback_button };
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h } from './index-36434da0.js';
|
|
2
|
+
|
|
3
|
+
const feedbackModalCss = ".text-center{flex-grow:1;text-align:center}.feedback-modal-wrapper *{font-family:var(--feedback-font-family)}.feedback-modal-wrapper--custom-font *{font-family:inherit}.feedback-modal-wrapper{position:absolute;z-index:var(--feedback-modal-modal-wrapper-z-index)}.feedback-overlay{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;opacity:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index);transition:opacity 0.2s ease-out}.feedback-overlay--visible{opacity: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;left:50%;max-width:90%;padding:20px;position:fixed;top:50%;transform:translate(-50%, -50%) scale(0.95);opacity:0;width:100%;z-index:var(--feedback-modal-content-z-index);transition:transform 0.2s ease-out, opacity 0.2s ease-out}.feedback-modal-content--open{transform:translate(-50%, -50%) scale(1);opacity:1}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);display:flex;font-size:var(--feedback-header-font-size);font-weight:var(--feedback-modal-header-font-weight);justify-content:space-between;margin-bottom:20px}.feedback-modal-rating-buttons{width:100%;margin-bottom:20px}.feedback-modal-rating-button{padding:0;background-color:transparent;border:transparent;margin-right:5px;cursor:pointer}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button{border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);font-size:var(--feedback-modal-button-font-size);font-weight:500;margin-right:10px;justify-content:center;padding:5px 10px}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover svg,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected svg{stroke:var(--feedback-modal-rating-button-selected-color)}.feedback-modal-rating-buttons svg{stroke:var(--feedback-modal-rating-button-color);cursor:pointer}.feedback-modal-rating-buttons--stars .feedback-modal-rating-button--selected svg{fill:var(--feedback-modal-rating-button-stars-selected-color);stroke:var(--feedback-modal-rating-button-stars-selected-color)}.feedback-modal-text textarea{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:100px;min-height:100px;padding:10px;resize:vertical;width:100%}.feedback-modal-email input{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:40px;padding:10px;width:100%;margin-bottom:20px}.feedback-modal-privacy{font-size:var(--feedback-modal-input-font-size);margin-bottom:20px}.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;flex-direction:column}.feedback-modal-buttons .feedback-modal-button{margin-bottom:20px}.feedback-modal-button{align-items:center;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;display:flex;font-size:var(--feedback-modal-button-font-size);font-weight:500;justify-content:center;min-height:40px;padding:5px 10px}.feedback-modal-button svg{margin-right:6px}.feedback-modal-button path{fill:var(--feedback-modal-button-icon-color)}.feedback-modal-button:hover path,.feedback-modal-button--active path{fill:var(--feedback-modal-button-icon-color-active)}.feedback-modal-button--submit{background-color:var(--feedback-modal-button-submit-bg-color);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-submit-text-color)}.feedback-modal-button:hover,.feedback-modal-button--active{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-button--submit:hover{background-color:var(--feedback-modal-button-submit-bg-color-hover);border:1px solid var(--feedback-modal-button-submit-border-color-hover);color:var(--feedback-modal-button-submit-text-color-hover)}.feedback-modal-input-heading{display:block;font-size:14px;font-weight:300;padding-bottom:10px}.feedback-modal-footer{font-size:12px;text-align:center}.feedback-modal-footer a{color:var(--feedback-modal-footer-link);font-weight:500;text-decoration:none}.feedback-logo,.feedback-footer-text{display:block;text-align:center;margin-top:5px}.feedback-footer-text{margin-top:10px;line-height:1.5}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;height:22px;margin-left:auto;padding:0;width:22px}.feedback-modal-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index)}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-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-screenshot-header-text-color);cursor:pointer;display:flex;left:50%;top:20px;transform:translateX(-50%);padding:10px;position:fixed;width:max-content;z-index:var(--feedback-modal-screenshot-header-z-index)}.feedback-modal-screenshot-close{height:24px;padding-left:10px;width:24px}.feedback-modal-screenshot-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-message{font-size:var(--feedback-modal-message-font-size);margin-top:0}.feedback-modal-element-hover{background-color:transparent;cursor:pointer;border:1px solid var(--feedback-modal-element-hover-border-color)}.feedback-modal-element-selected{background-color:transparent;border:3px solid var(--feedback-modal-element-selected-border-color) !important;box-shadow:0 0 0 2px rgba(0, 123, 255, 0.3) !important}.screenshot-preview{display:inline-block;width:30px;height:30px;overflow:hidden;border-radius:4px;margin-right:10px;box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);cursor:pointer;transition:transform 0.2s ease}.screenshot-preview:hover{transform:scale(1.1)}.screenshot-preview img{width:100%;height:100%;object-fit:cover}.screenshot-loading{display:inline-flex;align-items:center;margin-right:8px}@media screen and (min-width: 768px){.feedback-modal-content{max-width:var(--feedback-modal-content-max-width)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);left:initial;right:var(--feedback-modal-content-position-right);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--center-left{left:5px;right:auto;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--center-right{left:auto;right:5px;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--sidebar-left.feedback-modal-content--open,.feedback-modal-content.feedback-modal-content--sidebar-right.feedback-modal-content--open{transform:translateX(0)}.feedback-modal-content.feedback-modal-content--sidebar-left{max-width:var(--feedback-modal-content-sidebar-max-width);left:0;right:auto;height:100vh;top:0;transform:translateX(-100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-content.feedback-modal-content--sidebar-right{max-width:var(--feedback-modal-content-sidebar-max-width);left:auto;right:0;height:100vh;top:0;transform:translateX(100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-text textarea{height:150px;min-height:150px}.feedback-modal-content.feedback-modal-content--bottom-right{transform:translateY(20px)}.feedback-modal-content.feedback-modal-content--bottom-right.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--bottom-left{transform:translateY(20px)}.feedback-modal-content.feedback-modal-content--bottom-left.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--top-right{transform:translateY(-20px)}.feedback-modal-content.feedback-modal-content--top-right.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--top-left{transform:translateY(-20px)}.feedback-modal-content.feedback-modal-content--top-left.feedback-modal-content--open{transform:translateY(0)}}@keyframes feather-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.feather-loader{animation:feather-spin 1s linear infinite;display:block}.screenshot-error-notification{position:fixed;top:20px;left:50%;transform:translateX(-50%);z-index:10001;max-width:500px;width:90%;animation:slideDown 0.3s ease-out}@keyframes slideDown{from{opacity:0;transform:translateX(-50%) translateY(-20px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}.screenshot-error-content{background:#fee;border:1px solid #fcc;border-radius:8px;padding:12px 16px;display:flex;align-items:center;gap:12px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);color:#c53030}.screenshot-error-content svg:first-child{color:#e53e3e;flex-shrink:0}.screenshot-error-content span{flex:1;font-size:14px;line-height:1.4;font-weight:500}.error-close-btn{background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#c53030;flex-shrink:0;transition:background-color 0.2s ease}.error-close-btn:hover{background:rgba(197, 48, 48, 0.1)}";
|
|
4
|
+
|
|
5
|
+
const FeedbackModal = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.feedbackSent = createEvent(this, "feedbackSent", 7);
|
|
9
|
+
this.feedbackError = createEvent(this, "feedbackError", 7);
|
|
10
|
+
this.onScrollDebounced = () => {
|
|
11
|
+
clearTimeout(this.scrollTimeout);
|
|
12
|
+
this.scrollTimeout = setTimeout(() => {
|
|
13
|
+
document.documentElement.classList.remove('feedback-modal-screenshot-closing');
|
|
14
|
+
document.documentElement.style.top = '';
|
|
15
|
+
window.removeEventListener('scroll', this.onScrollDebounced);
|
|
16
|
+
}, 200);
|
|
17
|
+
};
|
|
18
|
+
this.handleSubmit = async (event) => {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
if (this.isEmailRequired && !this.formEmail) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
this.resetOverflow();
|
|
24
|
+
this.showScreenshotMode = false;
|
|
25
|
+
this.showScreenshotTopBar = false;
|
|
26
|
+
this.showModal = false;
|
|
27
|
+
this.sending = true;
|
|
28
|
+
try {
|
|
29
|
+
const body = {
|
|
30
|
+
url: window.location.href,
|
|
31
|
+
message: this.formMessage,
|
|
32
|
+
email: this.formEmail,
|
|
33
|
+
project: this.project,
|
|
34
|
+
screenshot: this.encodedScreenshot,
|
|
35
|
+
rating: this.selectedRating,
|
|
36
|
+
ratingMode: this.ratingMode,
|
|
37
|
+
metadata: this.metadata,
|
|
38
|
+
verification: this.formVerification,
|
|
39
|
+
session: localStorage.getItem('pushfeedback_sessionid') || '',
|
|
40
|
+
};
|
|
41
|
+
const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
|
|
42
|
+
method: 'POST',
|
|
43
|
+
body: JSON.stringify(body),
|
|
44
|
+
headers: {
|
|
45
|
+
'Content-Type': 'application/json',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
if (res.status === 201) {
|
|
49
|
+
const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
|
|
50
|
+
this.feedbackSent.emit({ feedback: feedback_with_id });
|
|
51
|
+
this.formSuccess = true;
|
|
52
|
+
this.formError = false;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
const errorText = await res.text();
|
|
56
|
+
const response = {
|
|
57
|
+
status: res.status,
|
|
58
|
+
message: errorText,
|
|
59
|
+
};
|
|
60
|
+
this.feedbackError.emit({ error: response });
|
|
61
|
+
this.formSuccess = false;
|
|
62
|
+
this.formError = true;
|
|
63
|
+
this.formErrorStatus = res.status;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
const response = {
|
|
68
|
+
status: 500,
|
|
69
|
+
message: error,
|
|
70
|
+
};
|
|
71
|
+
this.feedbackError.emit({ error: response });
|
|
72
|
+
this.formSuccess = false;
|
|
73
|
+
this.formError = true;
|
|
74
|
+
this.formErrorStatus = 500;
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
this.sending = false;
|
|
78
|
+
this.showModal = true;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
this.close = () => {
|
|
82
|
+
this.isAnimating = false;
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
this.sending = false;
|
|
85
|
+
this.showModal = false;
|
|
86
|
+
this.showScreenshotMode = false;
|
|
87
|
+
this.showScreenshotTopBar = false;
|
|
88
|
+
this.hasSelectedElement = false;
|
|
89
|
+
this.encodedScreenshot = null;
|
|
90
|
+
// Remove highlight from ALL selected elements
|
|
91
|
+
document.querySelectorAll('.feedback-modal-element-selected').forEach(el => {
|
|
92
|
+
el.classList.remove('feedback-modal-element-selected');
|
|
93
|
+
});
|
|
94
|
+
// Reset form states
|
|
95
|
+
this.formSuccess = false;
|
|
96
|
+
this.formError = false;
|
|
97
|
+
this.formErrorStatus = 500;
|
|
98
|
+
this.formMessage = '';
|
|
99
|
+
this.formEmail = '';
|
|
100
|
+
this.resetOverflow();
|
|
101
|
+
}, 200);
|
|
102
|
+
};
|
|
103
|
+
// Handle screenshot events from canvas editor
|
|
104
|
+
this.handleScreenshotReady = (event) => {
|
|
105
|
+
this.encodedScreenshot = event.detail.screenshot;
|
|
106
|
+
this.showModal = true;
|
|
107
|
+
this.takingScreenshot = false;
|
|
108
|
+
this.showCanvasEditor = false;
|
|
109
|
+
this.autoStartCapture = false;
|
|
110
|
+
};
|
|
111
|
+
this.handleScreenshotCancelled = () => {
|
|
112
|
+
this.showModal = true;
|
|
113
|
+
this.takingScreenshot = false;
|
|
114
|
+
this.showCanvasEditor = false;
|
|
115
|
+
this.autoStartCapture = false;
|
|
116
|
+
};
|
|
117
|
+
this.handleScreenshotError = (event) => {
|
|
118
|
+
console.error('Screenshot error:', event.detail.error);
|
|
119
|
+
// Store error message to display in feedback modal
|
|
120
|
+
this.screenshotError = event.detail.error;
|
|
121
|
+
this.showScreenshotError = true;
|
|
122
|
+
// Close canvas editor and return to feedback modal
|
|
123
|
+
this.showModal = true;
|
|
124
|
+
this.takingScreenshot = false;
|
|
125
|
+
this.showCanvasEditor = false;
|
|
126
|
+
this.autoStartCapture = false;
|
|
127
|
+
// Auto-hide error after 8 seconds
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
this.showScreenshotError = false;
|
|
130
|
+
}, 8000);
|
|
131
|
+
};
|
|
132
|
+
// Trigger screenshot capture
|
|
133
|
+
this.openScreenShot = () => {
|
|
134
|
+
this.showModal = false;
|
|
135
|
+
this.takingScreenshot = true;
|
|
136
|
+
this.autoStartCapture = true; // Auto-start new screenshot
|
|
137
|
+
this.showCanvasEditor = true;
|
|
138
|
+
};
|
|
139
|
+
// Open canvas editor for existing screenshot
|
|
140
|
+
this.openCanvasEditor = (event) => {
|
|
141
|
+
if (event) {
|
|
142
|
+
event.stopPropagation();
|
|
143
|
+
}
|
|
144
|
+
this.showModal = false;
|
|
145
|
+
this.autoStartCapture = false; // Don't auto-start, just edit existing
|
|
146
|
+
this.showCanvasEditor = true;
|
|
147
|
+
};
|
|
148
|
+
this.sending = false;
|
|
149
|
+
this.formMessage = '';
|
|
150
|
+
this.formEmail = '';
|
|
151
|
+
this.formSuccess = false;
|
|
152
|
+
this.formVerification = '';
|
|
153
|
+
this.formError = false;
|
|
154
|
+
this.formErrorStatus = 500;
|
|
155
|
+
this.encodedScreenshot = undefined;
|
|
156
|
+
this.isPrivacyChecked = false;
|
|
157
|
+
this.whitelabel = false;
|
|
158
|
+
this.selectedRating = -1;
|
|
159
|
+
this.overlayVisible = false;
|
|
160
|
+
this.isAnimating = false;
|
|
161
|
+
this.takingScreenshot = false;
|
|
162
|
+
this.showScreenshotError = false;
|
|
163
|
+
this.screenshotError = '';
|
|
164
|
+
this.showCanvasEditor = false;
|
|
165
|
+
this.autoStartCapture = false;
|
|
166
|
+
this.customFont = false;
|
|
167
|
+
this.emailAddress = '';
|
|
168
|
+
this.hideEmail = false;
|
|
169
|
+
this.isEmailRequired = false;
|
|
170
|
+
this.ratingMode = 'thumbs';
|
|
171
|
+
this.hasSelectedElement = false;
|
|
172
|
+
this.hidePrivacyPolicy = true;
|
|
173
|
+
this.hideRating = false;
|
|
174
|
+
this.hideScreenshotButton = false;
|
|
175
|
+
this.project = '';
|
|
176
|
+
this.showScreenshotMode = false;
|
|
177
|
+
this.showScreenshotTopBar = false;
|
|
178
|
+
this.showModal = false;
|
|
179
|
+
this.rating = undefined;
|
|
180
|
+
this.metadata = undefined;
|
|
181
|
+
this.fetchData = true;
|
|
182
|
+
this.emailPlaceholder = 'Email address (optional)';
|
|
183
|
+
this.errorMessage = 'Please try again later.';
|
|
184
|
+
this.errorMessage403 = 'The request URL does not match the one defined in PushFeedback for this project.';
|
|
185
|
+
this.errorMessage404 = 'We could not find the provided project ID in PushFeedback.';
|
|
186
|
+
this.messagePlaceholder = 'Comments';
|
|
187
|
+
this.footerText = '';
|
|
188
|
+
this.modalPosition = 'center';
|
|
189
|
+
this.modalTitle = 'Share your feedback';
|
|
190
|
+
this.modalTitleError = 'Oops!';
|
|
191
|
+
this.modalTitleSuccess = 'Thanks for your feedback!';
|
|
192
|
+
this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
|
|
193
|
+
this.ratingPlaceholder = 'Was this page helpful?';
|
|
194
|
+
this.ratingStarsPlaceholder = 'How would you rate this page?';
|
|
195
|
+
this.sendButtonText = 'Send';
|
|
196
|
+
this.screenshotAttachedText = 'Screenshot attached';
|
|
197
|
+
this.screenshotButtonText = 'Add a screenshot';
|
|
198
|
+
this.screenshotTakingText = 'Taking screenshot...';
|
|
199
|
+
this.screenshotTopbarText = 'Select an element on this page';
|
|
200
|
+
this.successMessage = '';
|
|
201
|
+
this.canvasEditorTitle = 'Edit screenshot';
|
|
202
|
+
this.canvasEditorCancelText = 'Cancel';
|
|
203
|
+
this.canvasEditorSaveText = 'Save';
|
|
204
|
+
this.editTextButtonText = 'Edit Text';
|
|
205
|
+
this.sizeLabelText = 'Size:';
|
|
206
|
+
this.borderLabelText = 'Border:';
|
|
207
|
+
this.editTextPromptText = 'Edit text:';
|
|
208
|
+
this.screenshotErrorGeneral = 'Failed to capture screenshot.';
|
|
209
|
+
this.screenshotErrorPermission = 'Permission denied. Please allow screen sharing to take screenshots.';
|
|
210
|
+
this.screenshotErrorNotSupported = 'Screen capture is not supported in this browser.';
|
|
211
|
+
this.screenshotErrorNotFound = 'No screen sources available for capture.';
|
|
212
|
+
this.screenshotErrorCancelled = 'Screenshot capture was cancelled.';
|
|
213
|
+
this.screenshotErrorBrowserNotSupported = 'Your browser does not support screen capture. Please use a browser like Chrome, Firefox, or Safari.';
|
|
214
|
+
this.screenshotErrorUnexpected = 'An unexpected error occurred. Please try again.';
|
|
215
|
+
}
|
|
216
|
+
componentWillLoad() {
|
|
217
|
+
if (this.fetchData)
|
|
218
|
+
this.fetchProjectData();
|
|
219
|
+
this.formEmail = this.emailAddress;
|
|
220
|
+
if (this.rating) {
|
|
221
|
+
this.selectedRating = this.rating;
|
|
222
|
+
}
|
|
223
|
+
if (this.ratingMode == 'thumbs' && this.rating == 0) {
|
|
224
|
+
this.selectedRating = 5;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
async fetchProjectData() {
|
|
228
|
+
try {
|
|
229
|
+
const response = await fetch('https://app.pushfeedback.com/api/projects/' + this.project + '/');
|
|
230
|
+
const data = await response.json();
|
|
231
|
+
this.whitelabel = data.whitelabel;
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
console.log(error);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
resetOverflow() {
|
|
238
|
+
// Just clean up any stray classes, don't add/remove during screenshot
|
|
239
|
+
document.documentElement.classList.remove('feedback-modal-screenshot-open');
|
|
240
|
+
document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
|
|
241
|
+
document.documentElement.classList.remove('feedback-modal-screenshot-closing');
|
|
242
|
+
}
|
|
243
|
+
handleMessageInput(event) {
|
|
244
|
+
this.formMessage = event.target.value;
|
|
245
|
+
}
|
|
246
|
+
handleEmailInput(event) {
|
|
247
|
+
this.formEmail = event.target.value;
|
|
248
|
+
}
|
|
249
|
+
handleCheckboxChange(event) {
|
|
250
|
+
this.isPrivacyChecked = event.target.checked;
|
|
251
|
+
}
|
|
252
|
+
handleVerification(event) {
|
|
253
|
+
this.formVerification = event.target.value;
|
|
254
|
+
}
|
|
255
|
+
handleRatingChange(newRating) {
|
|
256
|
+
this.selectedRating = newRating;
|
|
257
|
+
}
|
|
258
|
+
render() {
|
|
259
|
+
return (h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showCanvasEditor && (h("canvas-editor", { ref: (el) => this.canvasEditorRef = el, "canvas-editor-title": this.canvasEditorTitle, "canvas-editor-cancel-text": this.canvasEditorCancelText, "canvas-editor-save-text": this.canvasEditorSaveText, "screenshot-taking-text": this.screenshotTakingText, "screenshot-attached-text": this.screenshotAttachedText, "screenshot-button-text": this.screenshotButtonText, "auto-start-screenshot": this.autoStartCapture, "existing-screenshot": this.encodedScreenshot || '', "edit-text-button-text": this.editTextButtonText, "size-label-text": this.sizeLabelText, "border-label-text": this.borderLabelText, "edit-text-prompt-text": this.editTextPromptText, "screenshot-error-general": this.screenshotErrorGeneral, "screenshot-error-permission": this.screenshotErrorPermission, "screenshot-error-not-supported": this.screenshotErrorNotSupported, "screenshot-error-not-found": this.screenshotErrorNotFound, "screenshot-error-cancelled": this.screenshotErrorCancelled, "screenshot-error-browser-not-supported": this.screenshotErrorBrowserNotSupported, "screenshot-error-unexpected": this.screenshotErrorUnexpected, onScreenshotReady: this.handleScreenshotReady, onScreenshotCancelled: this.handleScreenshotCancelled, onScreenshotFailed: this.handleScreenshotError })), this.showScreenshotError && (h("div", { class: "screenshot-error-notification" }, h("div", { class: "screenshot-error-content" }, h("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("circle", { cx: "12", cy: "12", r: "10" }), h("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), h("line", { x1: "9", y1: "9", x2: "15", y2: "15" })), h("span", null, this.screenshotError), h("button", { class: "error-close-btn", onClick: () => this.showScreenshotError = false, title: "Close" }, h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))))), this.showModal && (h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}` })), this.showModal && (h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''}`, ref: (el) => (this.modalContent = el) }, h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (h("span", null, this.modalTitle)) : this.formSuccess ? (h("span", null, this.modalTitleSuccess)) : (h("span", null, this.modalTitleError)), h("button", { class: "feedback-modal-close", onClick: this.close }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "#191919", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), h("div", { class: "feedback-modal-body" }, !this.formSuccess && !this.formError ? (h("form", { onSubmit: this.handleSubmit }, !this.hideRating && (h("div", { class: "feedback-modal-rating" }, this.ratingMode === 'thumbs' ? (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs" }, h("button", { title: "Yes", class: `feedback-modal-rating-button ${this.selectedRating === 1
|
|
260
|
+
? 'feedback-modal-rating-button--selected'
|
|
261
|
+
: ''}`, onClick: (event) => {
|
|
262
|
+
event.preventDefault();
|
|
263
|
+
this.handleRatingChange(1);
|
|
264
|
+
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }))), h("button", { title: "No", class: `feedback-modal-rating-button ${this.selectedRating === 5
|
|
265
|
+
? 'feedback-modal-rating-button--selected'
|
|
266
|
+
: ''}`, onClick: (event) => {
|
|
267
|
+
event.preventDefault();
|
|
268
|
+
this.handleRatingChange(5);
|
|
269
|
+
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17" })))))) : (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingStarsPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--stars" }, [1, 2, 3, 4, 5].map((rating) => (h("button", { key: rating, class: `feedback-modal-rating-button ${this.selectedRating >= rating
|
|
270
|
+
? 'feedback-modal-rating-button--selected'
|
|
271
|
+
: ''}`, onClick: (event) => {
|
|
272
|
+
event.preventDefault();
|
|
273
|
+
this.handleRatingChange(rating);
|
|
274
|
+
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" })))))))))), h("div", { class: "feedback-modal-text" }, h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event) })), !this.hideEmail && (h("div", { class: "feedback-modal-email" }, h("input", { placeholder: this.emailPlaceholder, type: "email", onInput: (event) => this.handleEmailInput(event), value: this.formEmail, required: this.isEmailRequired }))), h("div", { class: "feedback-verification" }, h("input", { type: "text", name: "verification", style: { display: 'none' }, onInput: (event) => this.handleVerification(event), value: this.formVerification })), !this.hidePrivacyPolicy && (h("div", { class: "feedback-modal-privacy" }, h("input", { type: "checkbox", id: "privacyPolicy", onChange: (ev) => this.handleCheckboxChange(ev), required: true }), h("span", { innerHTML: this.privacyPolicyText }))), h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}` }, !this.hideScreenshotButton && (h("button", { type: "button", class: `feedback-modal-button feedback-modal-button--screenshot ${this.encodedScreenshot ? 'feedback-modal-button--active' : ''}`, onClick: this.openScreenShot, disabled: this.sending || this.takingScreenshot }, this.encodedScreenshot && (h("div", { class: "screenshot-preview", onClick: this.openCanvasEditor }, h("img", { src: this.encodedScreenshot, alt: "Screenshot Preview" }))), !this.encodedScreenshot && !this.takingScreenshot && (h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 -960 960 960", width: "24" }, h("path", { d: "M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z" }))), this.takingScreenshot && (h("div", { class: "screenshot-loading" }, h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#666", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather-loader" }, h("line", { x1: "12", y1: "2", x2: "12", y2: "6" }), h("line", { x1: "12", y1: "18", x2: "12", y2: "22" }), h("line", { x1: "4.93", y1: "4.93", x2: "7.76", y2: "7.76" }), h("line", { x1: "16.24", y1: "16.24", x2: "19.07", y2: "19.07" }), h("line", { x1: "2", y1: "12", x2: "6", y2: "12" }), h("line", { x1: "18", y1: "12", x2: "22", y2: "12" }), h("line", { x1: "4.93", y1: "19.07", x2: "7.76", y2: "16.24" }), h("line", { x1: "16.24", y1: "7.76", x2: "19.07", y2: "4.93" })))), this.takingScreenshot ? this.screenshotTakingText :
|
|
275
|
+
this.encodedScreenshot ? this.screenshotAttachedText : this.screenshotButtonText)), h("button", { class: "feedback-modal-button feedback-modal-button--submit", type: "submit", disabled: this.sending }, this.sendButtonText)))) : this.formSuccess && !this.formError ? (h("div", { class: "feedback-modal-success" }, h("p", { class: "feedback-modal-message" }, this.successMessage))) : this.formError && this.formErrorStatus == 404 ? (h("p", { class: "feedback-modal-message" }, this.errorMessage404)) : this.formError && this.formErrorStatus == 403 ? (h("p", { class: "feedback-modal-message" }, this.errorMessage403)) : this.formError ? (h("p", { class: "feedback-modal-message" }, this.errorMessage)) : (h("span", null))), h("div", { class: "feedback-modal-footer" }, h("div", { class: "feedback-logo", style: { display: this.whitelabel ? 'none' : 'block' } }, "Powered by", ' ', h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")), this.footerText && (h("div", { class: "feedback-footer-text" }, h("span", { innerHTML: this.footerText }))))))));
|
|
276
|
+
}
|
|
277
|
+
componentDidRender() {
|
|
278
|
+
if (this.showModal) {
|
|
279
|
+
requestAnimationFrame(() => {
|
|
280
|
+
this.overlayVisible = true;
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
async openModal() {
|
|
285
|
+
this.showModal = true;
|
|
286
|
+
requestAnimationFrame(() => {
|
|
287
|
+
requestAnimationFrame(() => {
|
|
288
|
+
this.isAnimating = true;
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
FeedbackModal.style = feedbackModalCss;
|
|
294
|
+
|
|
295
|
+
export { FeedbackModal as feedback_modal };
|