eddyter 1.3.75 → 1.3.77

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.
Files changed (54) hide show
  1. package/LICENSE +24 -24
  2. package/README.md +478 -478
  3. package/dist/EddyterIcon.svg +24 -24
  4. package/dist/Provider/EditorProvider.d.ts +12 -0
  5. package/dist/api/auth.d.ts +10 -0
  6. package/dist/api/bugReport.d.ts +2 -0
  7. package/dist/api/config/endpoints.d.ts +1 -0
  8. package/dist/assets/style.css +1 -1
  9. package/dist/{babel-B9hn44Wo.js → babel-CCPWkrf4.js} +1302 -726
  10. package/dist/components/EddyterLogo/EddyterLogo.d.ts +2 -1
  11. package/dist/components/HtmlCodeEditor.d.ts +9 -0
  12. package/dist/components/ImageView/ImageCropDialog.d.ts +18 -0
  13. package/dist/components/LockedFeature/LockedFeature.d.ts +4 -0
  14. package/dist/components/Placeholder/styles.d.ts +2 -0
  15. package/dist/components/Toast/EditorToast.d.ts +2 -0
  16. package/dist/components/ui/button.d.ts +1 -1
  17. package/dist/config/env.d.ts +9 -0
  18. package/dist/editorConfig.d.ts +1 -0
  19. package/dist/{estree-CocPn_Md.js → estree-CxUPh9wa.js} +917 -529
  20. package/dist/generateDocxThumbnail-Du6zd_sv.js +5876 -0
  21. package/dist/generatePdfThumbnail-DdNHlnr8.js +53 -0
  22. package/dist/generateXlsxThumbnail-VFzuEJln.js +21707 -0
  23. package/dist/hooks/useFeedbackEligibility.d.ts +2 -2
  24. package/dist/hooks/usePdfPreview.d.ts +6 -0
  25. package/dist/{html-CxCicOef.js → html-CmniStvG.js} +589 -350
  26. package/dist/html2canvas.esm-C2wu93Kq.js +4867 -0
  27. package/dist/{html2pdf.bundle.min-BxzIoi3T.js → html2pdf.bundle.min-4S-fQVxW.js} +5223 -3407
  28. package/dist/index-BUrH5xJk.js +1498 -0
  29. package/dist/index-DCBdbL8A.js +131 -0
  30. package/dist/{index-Cuv9ugJL.js → index-DSNo50FN.js} +17 -17
  31. package/dist/{index-DxEP36zG.js → index-Dh3DFyBT.js} +16269 -15166
  32. package/dist/index.js +1 -1
  33. package/dist/lib/toast.d.ts +39 -0
  34. package/dist/{markdown-BUjgWFLu.js → markdown-B0mEGGfQ.js} +1015 -578
  35. package/dist/nodes/EmbedNode.d.ts +9 -3
  36. package/dist/nodes/FileNode.d.ts +3 -0
  37. package/dist/{postcss-CGIcwj_g.js → postcss-B0bxXf7u.js} +1065 -615
  38. package/dist/{standalone-C0qguT38.js → standalone-DmuJV5rn.js} +596 -350
  39. package/dist/store/tableFullWidthStore.d.ts +6 -0
  40. package/dist/types.d.ts +4 -0
  41. package/dist/{typescript-BM7wk6k-.js → typescript-DZlC_9M8.js} +1805 -1113
  42. package/dist/utils/cropUrl.d.ts +28 -0
  43. package/dist/utils/editorStyleConverter.d.ts +3 -1
  44. package/dist/utils/export.d.ts +5 -0
  45. package/dist/utils/generateDocxThumbnail.d.ts +5 -0
  46. package/dist/utils/generatePdfThumbnail.d.ts +1 -0
  47. package/dist/utils/generateXlsxThumbnail.d.ts +5 -0
  48. package/dist/utils/helper.d.ts +2 -0
  49. package/dist/utils/htmlFormat.d.ts +5 -0
  50. package/dist/utils/index.d.ts +4 -4
  51. package/package.json +148 -150
  52. package/dist/html2pdf.bundle-CVq-OpZt.js +0 -32961
  53. package/dist/index-CtPRZTab.js +0 -845
  54. package/dist/index-eRyVFO7x.js +0 -83
@@ -0,0 +1,53 @@
1
+ import * as g from "pdfjs-dist";
2
+ import { H as l, k as m } from "./index-Dh3DFyBT.js";
3
+ g.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js";
4
+ async function u(a) {
5
+ if (a.startsWith("data:application/pdf;base64,") || a.startsWith("data:application/pdf,")) {
6
+ const f = a.split(",")[1] ?? "", r = atob(f), e = new Uint8Array(r.length);
7
+ for (let t = 0; t < r.length; t++)
8
+ e[t] = r.charCodeAt(t);
9
+ return e;
10
+ }
11
+ const o = `${l}${m.project.proxyPdf}?url=${encodeURIComponent(a)}`, i = await fetch(o);
12
+ if (!i.ok)
13
+ throw new Error(`PDF fetch failed: ${i.status}`);
14
+ const n = await i.arrayBuffer();
15
+ return new Uint8Array(n);
16
+ }
17
+ const d = 240, p = 176;
18
+ async function y(a) {
19
+ try {
20
+ const o = await u(a), n = await (await g.getDocument({ data: o }).promise).getPage(1), f = n.getViewport({ scale: 1 }), r = d / f.width, e = n.getViewport({ scale: r }), t = document.createElement("canvas");
21
+ t.width = e.width, t.height = e.height;
22
+ const h = t.getContext("2d");
23
+ if (!h)
24
+ throw new Error("Could not get 2d context");
25
+ await n.render({
26
+ canvasContext: h,
27
+ viewport: e
28
+ }).promise;
29
+ const s = document.createElement("canvas");
30
+ s.width = d, s.height = p;
31
+ const c = s.getContext("2d");
32
+ if (!c)
33
+ return t.toDataURL("image/png");
34
+ c.fillStyle = "#ffffff", c.fillRect(0, 0, d, p);
35
+ const w = Math.min(e.height, p);
36
+ return c.drawImage(
37
+ t,
38
+ 0,
39
+ 0,
40
+ e.width,
41
+ w,
42
+ 0,
43
+ 0,
44
+ d,
45
+ w
46
+ ), s.toDataURL("image/png");
47
+ } catch (o) {
48
+ throw console.error("[generatePdfThumbnail] Error", o), o;
49
+ }
50
+ }
51
+ export {
52
+ y as generatePdfThumbnail
53
+ };