eddyter 1.3.44 → 1.3.52

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 (43) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +7 -1
  3. package/dist/assets/style.css +1 -7989
  4. package/dist/{babel-d155920e.js → babel-1c4a328b.js} +2278 -2303
  5. package/dist/estree-2cbea43c.js +4667 -0
  6. package/dist/html-c18fb60e.js +2841 -0
  7. package/dist/html2pdf.bundle-ffb2feaa.js +34001 -0
  8. package/dist/html2pdf.bundle.min-1455f5bc.js +21964 -0
  9. package/dist/index-02397e44.js +111 -0
  10. package/dist/index-4b2cda16.js +35136 -0
  11. package/dist/index-ed633fb3.js +1002 -0
  12. package/dist/index.js +13 -14
  13. package/dist/markdown-39c3822b.js +3547 -0
  14. package/dist/postcss-bbcc713e.js +5151 -0
  15. package/dist/standalone-36ad3877.js +2600 -0
  16. package/dist/types.d.ts +2 -0
  17. package/dist/typescript-39d06710.js +13533 -0
  18. package/dist/ui/Icons.d.ts +2 -1
  19. package/package.json +2 -1
  20. package/dist/babel-d155920e.js.map +0 -1
  21. package/dist/estree-b1fff53b.js +0 -4706
  22. package/dist/estree-b1fff53b.js.map +0 -1
  23. package/dist/html-f95ee5dc.js +0 -2885
  24. package/dist/html-f95ee5dc.js.map +0 -1
  25. package/dist/html2pdf.bundle-71c6840e.js +0 -46128
  26. package/dist/html2pdf.bundle-71c6840e.js.map +0 -1
  27. package/dist/html2pdf.bundle.min-570c9085.js +0 -21987
  28. package/dist/html2pdf.bundle.min-570c9085.js.map +0 -1
  29. package/dist/index-6eb4d179.js +0 -46618
  30. package/dist/index-6eb4d179.js.map +0 -1
  31. package/dist/index-92744040.js +0 -1282
  32. package/dist/index-92744040.js.map +0 -1
  33. package/dist/index-bb293cb2.js +0 -161
  34. package/dist/index-bb293cb2.js.map +0 -1
  35. package/dist/index.js.map +0 -1
  36. package/dist/markdown-1d9e6c3f.js +0 -3759
  37. package/dist/markdown-1d9e6c3f.js.map +0 -1
  38. package/dist/postcss-c2592f3f.js +0 -5399
  39. package/dist/postcss-c2592f3f.js.map +0 -1
  40. package/dist/standalone-bcc7f37a.js +0 -2649
  41. package/dist/standalone-bcc7f37a.js.map +0 -1
  42. package/dist/typescript-48c10f50.js +0 -13601
  43. package/dist/typescript-48c10f50.js.map +0 -1
@@ -0,0 +1,111 @@
1
+ import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
+ import { useLexicalComposerContext as v } from "@lexical/react/LexicalComposerContext";
3
+ import { $getNodeByKey as w } from "lexical";
4
+ import { q as k, r as F, F as y, s as N, u as C, v as D } from "./index-4b2cda16.js";
5
+ import "react";
6
+ import "axios";
7
+ import "react-dom";
8
+ import "@emotion/styled";
9
+ import "@lexical/html";
10
+ import "@lexical/react/LexicalCheckListPlugin";
11
+ import "@lexical/react/LexicalComposer";
12
+ import "@lexical/react/LexicalContentEditable";
13
+ import "@lexical/react/LexicalErrorBoundary";
14
+ import "@lexical/react/LexicalHistoryPlugin";
15
+ import "@lexical/react/LexicalHorizontalRulePlugin";
16
+ import "@lexical/react/LexicalListPlugin";
17
+ import "@lexical/react/LexicalOnChangePlugin";
18
+ import "@lexical/react/LexicalRichTextPlugin";
19
+ import "@lexical/react/LexicalTablePlugin";
20
+ import "@lexical/table";
21
+ import "@lexical/utils";
22
+ import "@lexical/code";
23
+ import "@lexical/link";
24
+ import "@lexical/list";
25
+ import "@lexical/rich-text";
26
+ import "@lexical/selection";
27
+ import "@lexical/react/LexicalHorizontalRuleNode";
28
+ import "@lexical/react/LexicalDecoratorBlockNode";
29
+ import "emoji-picker-react";
30
+ import "@lexical/react/LexicalLinkPlugin";
31
+ import "@lexical/react/LexicalTypeaheadMenuPlugin";
32
+ import "@lexical/react/useLexicalEditable";
33
+ const B = (t) => t ? t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} MB` : `${(t / (1024 * 1024 * 1024)).toFixed(1)} GB` : "", E = (t) => {
34
+ const o = t.split(".");
35
+ return o.length > 1 ? o[o.length - 1].toLowerCase() : "";
36
+ }, L = (t) => {
37
+ const o = E(t);
38
+ return ["pdf", "doc", "docx", "txt", "odt"].includes(o) ? /* @__PURE__ */ r(y, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-blue-500" }) : ["zip", "rar", "7z", "tar", "gz"].includes(o) ? /* @__PURE__ */ r(N, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-orange-500" }) : /* @__PURE__ */ r(C, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-gray-500" });
39
+ }, lt = ({ src: t, fileName: o, fileSize: n, nodeKey: s }) => {
40
+ const [x] = v();
41
+ if (!t || !o)
42
+ return console.error("FileView: Missing required props", { src: t, fileName: o, fileSize: n, nodeKey: s }), /* @__PURE__ */ r("div", { className: "cteditor-inline-flex cteditor-items-center cteditor-gap-3 cteditor-px-4 cteditor-py-3 cteditor-my-2 cteditor-border cteditor-border-destructive cteditor-rounded-lg cteditor-bg-destructive/10", children: /* @__PURE__ */ r("div", { className: "cteditor-text-sm cteditor-text-destructive", children: "Error loading file" }) });
43
+ const l = (i) => {
44
+ i.preventDefault(), i.stopPropagation();
45
+ try {
46
+ if (t.startsWith("data:")) {
47
+ const e = t.split(","), m = e[0].match(/:(.*?);/), g = m ? m[1] : "application/octet-stream", p = atob(e[1]);
48
+ let c = p.length;
49
+ const u = new Uint8Array(c);
50
+ for (; c--; )
51
+ u[c] = p.charCodeAt(c);
52
+ const b = new Blob([u], { type: g }), h = URL.createObjectURL(b), d = document.createElement("a");
53
+ d.href = h, d.download = o, d.style.display = "none", document.body.appendChild(d), d.click(), document.body.removeChild(d), setTimeout(() => URL.revokeObjectURL(h), 100);
54
+ } else {
55
+ const e = document.createElement("a");
56
+ e.href = t, e.download = o, e.style.display = "none", e.target = "_blank", document.body.appendChild(e), e.click(), document.body.removeChild(e);
57
+ }
58
+ } catch (e) {
59
+ console.error("Error downloading file:", e), window.open(t, "_blank");
60
+ }
61
+ }, f = (i) => {
62
+ i.preventDefault(), i.stopPropagation(), x.update(() => {
63
+ const e = w(s);
64
+ D(e) && e.remove();
65
+ });
66
+ };
67
+ return /* @__PURE__ */ a(
68
+ "div",
69
+ {
70
+ className: "cteditor-inline-flex cteditor-items-center cteditor-gap-3 cteditor-py-1 cteditor-px-2 cteditor-my-2 cteditor-border cteditor-border-border cteditor-rounded-lg cteditor-bg-background hover:cteditor-bg-accent/50 cteditor-transition-colors cteditor-cursor-pointer cteditor-max-w-md",
71
+ onClick: l,
72
+ role: "button",
73
+ tabIndex: 0,
74
+ onKeyDown: (i) => {
75
+ (i.key === "Enter" || i.key === " ") && (i.preventDefault(), l(i));
76
+ },
77
+ children: [
78
+ /* @__PURE__ */ r("div", { className: "cteditor-flex-shrink-0 *:cteditor-size-5", children: L(o) }),
79
+ /* @__PURE__ */ a("div", { className: "cteditor-flex-1 cteditor-min-w-0", children: [
80
+ /* @__PURE__ */ r("div", { className: "cteditor-font-medium cteditor-text-xs cteditor-text-foreground cteditor-truncate", children: o }),
81
+ n && /* @__PURE__ */ r("div", { className: "cteditor-text-xs cteditor-text-muted-foreground", children: B(n) })
82
+ ] }),
83
+ /* @__PURE__ */ a("div", { className: "cteditor-flex cteditor-gap-1 cteditor-flex-shrink-0", children: [
84
+ /* @__PURE__ */ r(
85
+ "button",
86
+ {
87
+ onClick: l,
88
+ className: "cteditor-p-1 cteditor-rounded-md hover:cteditor-bg-accent cteditor-transition-colors",
89
+ "aria-label": "Download file",
90
+ title: "Download file",
91
+ children: /* @__PURE__ */ r(k, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground" })
92
+ }
93
+ ),
94
+ /* @__PURE__ */ r(
95
+ "button",
96
+ {
97
+ onClick: f,
98
+ className: "cteditor-p-1 cteditor-rounded-md hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors",
99
+ "aria-label": "Delete file",
100
+ title: "Delete file",
101
+ children: /* @__PURE__ */ r(F, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground" })
102
+ }
103
+ )
104
+ ] })
105
+ ]
106
+ }
107
+ );
108
+ };
109
+ export {
110
+ lt as default
111
+ };