eddyter 1.4.1-beta.1 → 1.4.1-beta.2
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/{generateDocxThumbnail-Dka6P9vZ.js → generateDocxThumbnail-BI1KNMQ0.js} +1 -1
- package/dist/generatePdfThumbnail-BbeFjmU8.js +69 -0
- package/dist/{generateXlsxThumbnail-DjPc9AwZ.js → generateXlsxThumbnail-C-Nl4L4S.js} +1 -1
- package/dist/{html2pdf.bundle.min-uLMyd5s_.js → html2pdf.bundle.min-CkWPSMgx.js} +1 -1
- package/dist/{index-DJjthzdy.js → index-BOOPaoFA.js} +5 -5
- package/dist/{index-Bi9IXsuh.js → index-CuTC2G3E.js} +1 -1
- package/dist/{index-BekVWmYK.js → index-Ditr63DI.js} +4 -4
- package/dist/{index-0sk4_PRi.js → index-_ZFyP1BG.js} +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/generatePdfThumbnail-BllzxUNM.js +0 -53
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as Tt, v as Se, J as Ce, h as xe } from "./index-
|
|
1
|
+
import { s as Tt, v as Se, J as Ce, h as xe } from "./index-BOOPaoFA.js";
|
|
2
2
|
import { h as Ee } from "./html2canvas.esm-C2wu93Kq.js";
|
|
3
3
|
function Ft(c) {
|
|
4
4
|
throw new Error('Could not dynamically require "' + c + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { J as u, h as b } from "./index-BOOPaoFA.js";
|
|
2
|
+
const m = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174";
|
|
3
|
+
let w = null;
|
|
4
|
+
async function C() {
|
|
5
|
+
if (w)
|
|
6
|
+
return w;
|
|
7
|
+
await new Promise((n, o) => {
|
|
8
|
+
if (window.pdfjsLib) {
|
|
9
|
+
n();
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const a = document.createElement("script");
|
|
13
|
+
a.src = `${m}/pdf.min.js`, a.onload = () => n(), a.onerror = () => o(new Error("Failed to load pdf.js from CDN")), document.head.appendChild(a);
|
|
14
|
+
});
|
|
15
|
+
const t = window.pdfjsLib;
|
|
16
|
+
if (!t)
|
|
17
|
+
throw new Error("pdfjsLib not found on window after loading CDN script");
|
|
18
|
+
return t.GlobalWorkerOptions.workerSrc = `${m}/pdf.worker.min.js`, w = t, t;
|
|
19
|
+
}
|
|
20
|
+
async function j(t) {
|
|
21
|
+
if (t.startsWith("data:application/pdf;base64,") || t.startsWith("data:application/pdf,")) {
|
|
22
|
+
const r = t.split(",")[1] ?? "", i = atob(r), c = new Uint8Array(i.length);
|
|
23
|
+
for (let e = 0; e < i.length; e++)
|
|
24
|
+
c[e] = i.charCodeAt(e);
|
|
25
|
+
return c;
|
|
26
|
+
}
|
|
27
|
+
const n = `${u}${b.project.proxyPdf}?url=${encodeURIComponent(t)}`, o = await fetch(n);
|
|
28
|
+
if (!o.ok)
|
|
29
|
+
throw new Error(`PDF fetch failed: ${o.status}`);
|
|
30
|
+
const a = await o.arrayBuffer();
|
|
31
|
+
return new Uint8Array(a);
|
|
32
|
+
}
|
|
33
|
+
const p = 240, h = 176;
|
|
34
|
+
async function D(t) {
|
|
35
|
+
try {
|
|
36
|
+
const n = await C(), o = await j(t), r = await (await n.getDocument({ data: o }).promise).getPage(1), i = r.getViewport({ scale: 1 }), c = p / i.width, e = r.getViewport({ scale: c }), s = document.createElement("canvas");
|
|
37
|
+
s.width = e.width, s.height = e.height;
|
|
38
|
+
const l = s.getContext("2d");
|
|
39
|
+
if (!l)
|
|
40
|
+
throw new Error("Could not get 2d context");
|
|
41
|
+
await r.render({
|
|
42
|
+
canvasContext: l,
|
|
43
|
+
viewport: e
|
|
44
|
+
}).promise;
|
|
45
|
+
const d = document.createElement("canvas");
|
|
46
|
+
d.width = p, d.height = h;
|
|
47
|
+
const f = d.getContext("2d");
|
|
48
|
+
if (!f)
|
|
49
|
+
return s.toDataURL("image/png");
|
|
50
|
+
f.fillStyle = "#ffffff", f.fillRect(0, 0, p, h);
|
|
51
|
+
const g = Math.min(e.height, h);
|
|
52
|
+
return f.drawImage(
|
|
53
|
+
s,
|
|
54
|
+
0,
|
|
55
|
+
0,
|
|
56
|
+
e.width,
|
|
57
|
+
g,
|
|
58
|
+
0,
|
|
59
|
+
0,
|
|
60
|
+
p,
|
|
61
|
+
g
|
|
62
|
+
), d.toDataURL("image/png");
|
|
63
|
+
} catch (n) {
|
|
64
|
+
throw console.error("[generatePdfThumbnail] Error", n), n;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
D as generatePdfThumbnail
|
|
69
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as Ci } from "./html2canvas.esm-C2wu93Kq.js";
|
|
2
|
-
import { J as yi, h as Di } from "./index-
|
|
2
|
+
import { J as yi, h as Di } from "./index-BOOPaoFA.js";
|
|
3
3
|
var In = 1252, Oi = [874, 932, 936, 949, 950, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1e4], Zt = {
|
|
4
4
|
/*::[*/
|
|
5
5
|
0: 1252,
|
|
@@ -964,7 +964,7 @@ function cj(t) {
|
|
|
964
964
|
}
|
|
965
965
|
const Wn = vr(
|
|
966
966
|
"AI_ACTION_COMMAND"
|
|
967
|
-
), k4 = vr(), Oj = Pt.lazy(() => import("./index-
|
|
967
|
+
), k4 = vr(), Oj = Pt.lazy(() => import("./index-CuTC2G3E.js"));
|
|
968
968
|
function dj(t) {
|
|
969
969
|
return t.parentElement != null && t.parentElement.tagName === "LI" && t.previousSibling === null && t.getAttribute("aria-roledescription") === "checkbox";
|
|
970
970
|
}
|
|
@@ -61381,7 +61381,7 @@ const Ap = (t) => {
|
|
|
61381
61381
|
)
|
|
61382
61382
|
}
|
|
61383
61383
|
);
|
|
61384
|
-
}, X_e = _.lazy(() => import("./index-
|
|
61384
|
+
}, X_e = _.lazy(() => import("./index-Ditr63DI.js"));
|
|
61385
61385
|
function R_e(t) {
|
|
61386
61386
|
if (t instanceof HTMLDivElement) {
|
|
61387
61387
|
const e = t.getAttribute("data-lexical-file-src"), r = t.getAttribute("data-lexical-file-name");
|
|
@@ -64329,7 +64329,7 @@ function kXe({
|
|
|
64329
64329
|
function Gy(t) {
|
|
64330
64330
|
return t instanceof UO;
|
|
64331
64331
|
}
|
|
64332
|
-
const TXe = Pt.lazy(() => import("./index-
|
|
64332
|
+
const TXe = Pt.lazy(() => import("./index-_ZFyP1BG.js"));
|
|
64333
64333
|
function _Xe(t) {
|
|
64334
64334
|
const e = t;
|
|
64335
64335
|
if (e.src.startsWith("file:///"))
|
|
@@ -67625,7 +67625,7 @@ const Fo = {
|
|
|
67625
67625
|
NEAR_BLACK: "#111111"
|
|
67626
67626
|
}
|
|
67627
67627
|
}, v2e = async () => {
|
|
67628
|
-
const t = await import("./html2pdf.bundle.min-
|
|
67628
|
+
const t = await import("./html2pdf.bundle.min-CkWPSMgx.js").then((e) => e.h);
|
|
67629
67629
|
return t?.default || t;
|
|
67630
67630
|
};
|
|
67631
67631
|
async function P2e(t, e = "document.pdf", r) {
|
|
@@ -86767,7 +86767,7 @@ const t4e = 2 * 60 * 1e3, r4e = ({
|
|
|
86767
86767
|
className: a ? "cteditor-text-[10px] cteditor-text-gray-500 dark:cteditor-text-gray-400 cteditor-border-l cteditor-border-gray-200 dark:cteditor-border-gray-700 cteditor-pl-2" : "cteditor-text-[10px] cteditor-text-gray-500 dark:cteditor-text-gray-400",
|
|
86768
86768
|
children: [
|
|
86769
86769
|
"v",
|
|
86770
|
-
"1.4.1-beta.
|
|
86770
|
+
"1.4.1-beta.2"
|
|
86771
86771
|
]
|
|
86772
86772
|
}
|
|
86773
86773
|
)
|
|
@@ -16,7 +16,7 @@ import { useLexicalNodeSelection as Te } from "@lexical/react/useLexicalNodeSele
|
|
|
16
16
|
import { mergeRegister as _e } from "@lexical/utils";
|
|
17
17
|
import { RootNode as Qt, TextNode as Zt, LineBreakNode as te, ParagraphNode as ee, $getSelection as et, $isNodeSelection as ct, $isParagraphNode as Pt, $setSelection as gt, $isRangeSelection as je, SELECTION_CHANGE_COMMAND as Ye, COMMAND_PRIORITY_LOW as K, CLICK_COMMAND as Oe, DRAGSTART_COMMAND as He, KEY_DELETE_COMMAND as Fe, KEY_BACKSPACE_COMMAND as Xe, KEY_ENTER_COMMAND as Be, KEY_ESCAPE_COMMAND as Ue, $getNodeByKey as rt, createCommand as Ke } from "lexical";
|
|
18
18
|
import ht, { useState as S, useRef as G, useMemo as _t, useCallback as I, useEffect as V, useLayoutEffect as qe, Suspense as Ge } from "react";
|
|
19
|
-
import { c as ft, D as re, a as oe, b as ie, d as ae, e as ne, f as se, B as jt, L as de, i as ce, C as xt, I as Ve, S as Je, u as Qe, $ as q, t as z, g as Ze, h as tr, W as er, j as rr, A as or, k as ir, l as ar, T as nr, m as sr, n as dr, E as cr, o as lr, p as ur, q as mr, r as gr } from "./index-
|
|
19
|
+
import { c as ft, D as re, a as oe, b as ie, d as ae, e as ne, f as se, B as jt, L as de, i as ce, C as xt, I as Ve, S as Je, u as Qe, $ as q, t as z, g as Ze, h as tr, W as er, j as rr, A as or, k as ir, l as ar, T as nr, m as sr, n as dr, E as cr, o as lr, p as ur, q as mr, r as gr } from "./index-BOOPaoFA.js";
|
|
20
20
|
import "react-dom";
|
|
21
21
|
const le = ft("Crop", [
|
|
22
22
|
["path", { d: "M6 2v14a2 2 0 0 0 2 2h14", key: "ron5a4" }],
|
|
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
|
2
2
|
import { useLexicalComposerContext as B } from "@lexical/react/LexicalComposerContext";
|
|
3
3
|
import { $getNodeByKey as b } from "lexical";
|
|
4
4
|
import { useState as E, useEffect as N } from "react";
|
|
5
|
-
import { w as y, x as k, y as I, F as x, z as T, G as W } from "./index-
|
|
5
|
+
import { w as y, x as k, y as I, F as x, z as T, G as W } from "./index-BOOPaoFA.js";
|
|
6
6
|
function $(e, t) {
|
|
7
7
|
const c = e.split(".").pop()?.toLowerCase();
|
|
8
8
|
return c === "pdf" || t.startsWith("data:application/pdf") ? "pdf" : c === "docx" || t.startsWith("data:application/vnd.openxmlformats") && e.toLowerCase().endsWith(".docx") ? "docx" : c === "xlsx" || c === "xls" || t.startsWith("data:application/vnd.openxmlformats-officedocument.spreadsheetml") || t.startsWith("data:application/vnd.ms-excel") ? "xlsx" : null;
|
|
@@ -16,15 +16,15 @@ function z(e, t) {
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
let l = !1;
|
|
19
|
-
return d === "pdf" ? import("./generatePdfThumbnail-
|
|
19
|
+
return d === "pdf" ? import("./generatePdfThumbnail-BbeFjmU8.js").then(({ generatePdfThumbnail: o }) => o(e)).then((o) => {
|
|
20
20
|
l || n(o);
|
|
21
21
|
}).catch(() => {
|
|
22
22
|
l || n(null);
|
|
23
|
-
}) : d === "docx" ? import("./generateDocxThumbnail-
|
|
23
|
+
}) : d === "docx" ? import("./generateDocxThumbnail-BI1KNMQ0.js").then(({ generateDocxThumbnail: o }) => o(e)).then((o) => {
|
|
24
24
|
l || n(o);
|
|
25
25
|
}).catch(() => {
|
|
26
26
|
l || n(null);
|
|
27
|
-
}) : d === "xlsx" && import("./generateXlsxThumbnail-
|
|
27
|
+
}) : d === "xlsx" && import("./generateXlsxThumbnail-C-Nl4L4S.js").then(({ generateXlsxThumbnail: o }) => o(e)).then((o) => {
|
|
28
28
|
l || n(o);
|
|
29
29
|
}).catch(() => {
|
|
30
30
|
l || n(null);
|
|
@@ -15,7 +15,7 @@ import { useLexicalNodeSelection as ht } from "@lexical/react/useLexicalNodeSele
|
|
|
15
15
|
import { mergeRegister as pt } from "@lexical/utils";
|
|
16
16
|
import { $getSelection as L, $isNodeSelection as h, $setSelection as O, SELECTION_CHANGE_COMMAND as bt, COMMAND_PRIORITY_LOW as f, CLICK_COMMAND as Ct, DRAGSTART_COMMAND as Nt, KEY_DELETE_COMMAND as xt, KEY_BACKSPACE_COMMAND as vt, KEY_ENTER_COMMAND as Et, KEY_ESCAPE_COMMAND as yt, RootNode as Rt, TextNode as kt, LineBreakNode as At, ParagraphNode as St, $getNodeByKey as k, $isParagraphNode as T } from "lexical";
|
|
17
17
|
import { useRef as P, useState as j, useCallback as x, useEffect as Dt } from "react";
|
|
18
|
-
import { H as v, W as Lt, j as Pt, A as Mt, k as _t, l as $t, T as zt, y as It, L as Wt, i as Ot } from "./index-
|
|
18
|
+
import { H as v, W as Lt, j as Pt, A as Mt, k as _t, l as $t, T as zt, y as It, L as Wt, i as Ot } from "./index-BOOPaoFA.js";
|
|
19
19
|
function ie({
|
|
20
20
|
src: w,
|
|
21
21
|
nodeKey: g,
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as a, M as r, N as t, O as s, P as o, Q as d, R as v, U as u, V as f, X as n, Y as l, Z as w } from "./index-
|
|
1
|
+
import { K as a, M as r, N as t, O as s, P as o, Q as d, R as v, U as u, V as f, X as n, Y as l, Z as w } from "./index-BOOPaoFA.js";
|
|
2
2
|
export {
|
|
3
3
|
a as ConfigurableEditor,
|
|
4
4
|
r as ConfigurableEditorWithAuth,
|
package/package.json
CHANGED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { J as l, h as m } from "./index-DJjthzdy.js";
|
|
2
|
-
async function u(a) {
|
|
3
|
-
if (a.startsWith("data:application/pdf;base64,") || a.startsWith("data:application/pdf,")) {
|
|
4
|
-
const o = a.split(",")[1] ?? "", r = atob(o), s = new Uint8Array(r.length);
|
|
5
|
-
for (let t = 0; t < r.length; t++)
|
|
6
|
-
s[t] = r.charCodeAt(t);
|
|
7
|
-
return s;
|
|
8
|
-
}
|
|
9
|
-
const e = `${l}${m.project.proxyPdf}?url=${encodeURIComponent(a)}`, n = await fetch(e);
|
|
10
|
-
if (!n.ok)
|
|
11
|
-
throw new Error(`PDF fetch failed: ${n.status}`);
|
|
12
|
-
const h = await n.arrayBuffer();
|
|
13
|
-
return new Uint8Array(h);
|
|
14
|
-
}
|
|
15
|
-
const f = 240, p = 176;
|
|
16
|
-
async function y(a) {
|
|
17
|
-
try {
|
|
18
|
-
const e = await import("pdfjs-dist");
|
|
19
|
-
e.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js";
|
|
20
|
-
const n = await u(a), o = await (await e.getDocument({ data: n }).promise).getPage(1), r = o.getViewport({ scale: 1 }), s = f / r.width, t = o.getViewport({ scale: s }), i = document.createElement("canvas");
|
|
21
|
-
i.width = t.width, i.height = t.height;
|
|
22
|
-
const w = i.getContext("2d");
|
|
23
|
-
if (!w)
|
|
24
|
-
throw new Error("Could not get 2d context");
|
|
25
|
-
await o.render({
|
|
26
|
-
canvasContext: w,
|
|
27
|
-
viewport: t
|
|
28
|
-
}).promise;
|
|
29
|
-
const c = document.createElement("canvas");
|
|
30
|
-
c.width = f, c.height = p;
|
|
31
|
-
const d = c.getContext("2d");
|
|
32
|
-
if (!d)
|
|
33
|
-
return i.toDataURL("image/png");
|
|
34
|
-
d.fillStyle = "#ffffff", d.fillRect(0, 0, f, p);
|
|
35
|
-
const g = Math.min(t.height, p);
|
|
36
|
-
return d.drawImage(
|
|
37
|
-
i,
|
|
38
|
-
0,
|
|
39
|
-
0,
|
|
40
|
-
t.width,
|
|
41
|
-
g,
|
|
42
|
-
0,
|
|
43
|
-
0,
|
|
44
|
-
f,
|
|
45
|
-
g
|
|
46
|
-
), c.toDataURL("image/png");
|
|
47
|
-
} catch (e) {
|
|
48
|
-
throw console.error("[generatePdfThumbnail] Error", e), e;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
y as generatePdfThumbnail
|
|
53
|
-
};
|