pushfeedback 0.0.11 → 0.0.12

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,5 +1,5 @@
1
1
  import { h } from '@stencil/core';
2
- import domtoimage from 'dom-to-image';
2
+ import html2canvas from 'html2canvas';
3
3
  export class FeedbackModal {
4
4
  constructor() {
5
5
  this.handleSubmit = async (event) => {
@@ -137,13 +137,13 @@ export class FeedbackModal {
137
137
  const clonedElementSelected = this.elementSelected.cloneNode(true);
138
138
  document.body.appendChild(clonedElementSelected);
139
139
  this.elementSelected.style.top = `${top}px`;
140
- this.encodedScreenshot = domtoimage.toPng(document.body, { cacheBust: true })
141
- .then(function (dataUrl) {
140
+ this.encodedScreenshot = html2canvas(document.body).then(canvas => {
141
+ const dataUrl = canvas.toDataURL();
142
142
  document.body.removeChild(clonedElementSelected);
143
143
  return dataUrl;
144
144
  })
145
145
  .catch(function (error) {
146
- console.error('Oops, something went wrong!', error);
146
+ console.error(error);
147
147
  return "";
148
148
  });
149
149
  const page = document.getElementsByTagName('html')[0];