eddyter 1.4.0 → 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.
@@ -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 { a as ft, D as re, b as oe, d as ie, e as ae, f as ne, h 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, j as Ze, k as tr, W as er, l as rr, A as or, m as ir, n as ar, T as nr, o as sr, p as dr, E as cr, q as lr, r as ur, s as mr, v as gr } from "./index-BO5Zqvun.js";
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-BO5Zqvun.js";
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-Dlhq91Bf.js").then(({ generatePdfThumbnail: o }) => o(e)).then((o) => {
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-Bh5xHzEB.js").then(({ generateDocxThumbnail: o }) => o(e)).then((o) => {
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-DSRkPI7J.js").then(({ generateXlsxThumbnail: o }) => o(e)).then((o) => {
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);
@@ -13,14 +13,14 @@ import { RichTextPlugin as gt } from "@lexical/react/LexicalRichTextPlugin";
13
13
  import { useLexicalEditable as mt } from "@lexical/react/useLexicalEditable";
14
14
  import { useLexicalNodeSelection as ht } from "@lexical/react/useLexicalNodeSelection";
15
15
  import { mergeRegister as pt } from "@lexical/utils";
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 At, LineBreakNode as kt, ParagraphNode as St, $getNodeByKey as A, $isParagraphNode as T } from "lexical";
17
- import { useRef as P, useState as w, useCallback as x, useEffect as Dt } from "react";
18
- import { H as v, W as Lt, l as Pt, A as Mt, m as _t, n as $t, T as zt, y as It, L as Wt, i as Ot } from "./index-BO5Zqvun.js";
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
+ 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-BOOPaoFA.js";
19
19
  function ie({
20
- src: j,
20
+ src: w,
21
21
  nodeKey: g,
22
22
  width: p,
23
- height: k,
23
+ height: A,
24
24
  maxWidth: B,
25
25
  resizable: Y,
26
26
  showCaption: E,
@@ -29,7 +29,7 @@ function ie({
29
29
  controls: V = !0,
30
30
  position: n = "none"
31
31
  }) {
32
- const a = P(null), S = P(null), [l, d, C] = ht(g), [s, M] = w(!1), [o] = lt(), [y, H] = w(null), _ = P(null), K = mt(), D = x(
32
+ const a = P(null), S = P(null), [l, d, C] = ht(g), [s, M] = j(!1), [o] = lt(), [y, H] = j(null), _ = P(null), K = mt(), D = x(
33
33
  (t) => {
34
34
  const r = L();
35
35
  return l && h(r) && (t.preventDefault(), o.update(() => {
@@ -131,21 +131,21 @@ function ie({
131
131
  ]);
132
132
  const X = () => {
133
133
  o.update(() => {
134
- const t = A(g);
134
+ const t = k(g);
135
135
  v(t) && t.setShowCaption(!0);
136
136
  });
137
137
  }, G = (t, r) => {
138
138
  setTimeout(() => {
139
139
  M(!1);
140
140
  }, 200), o.update(() => {
141
- const e = A(g);
141
+ const e = k(g);
142
142
  v(e) && e.setWidthAndHeight(t, r);
143
143
  });
144
144
  }, U = () => {
145
145
  M(!0);
146
146
  }, q = (t) => {
147
147
  t.preventDefault(), t.stopPropagation(), o.update(() => {
148
- const r = A(g);
148
+ const r = k(g);
149
149
  if (v(r)) {
150
150
  const e = r.getParent();
151
151
  r.remove(), e && T(e) && e.getChildrenSize() === 0 && e.setFormat("left");
@@ -153,7 +153,7 @@ function ie({
153
153
  });
154
154
  }, m = (t, r) => {
155
155
  t.preventDefault(), t.stopPropagation(), o.update(() => {
156
- const e = A(g);
156
+ const e = k(g);
157
157
  if (v(e)) {
158
158
  e.setPosition(r);
159
159
  const c = e.getParent();
@@ -173,7 +173,7 @@ function ie({
173
173
  !e && !c || (t.stopPropagation(), t.shiftKey ? d(!l) : (C(), d(!0)));
174
174
  },
175
175
  [s, l, d, C]
176
- ), Q = l && h(y) && !s, W = (l || s) && K, Z = typeof p == "number" && typeof k == "number", tt = typeof p == "number" ? p : "auto", et = typeof k == "number" ? k : "auto";
176
+ ), Q = l && h(y) && !s, W = (l || s) && K, Z = typeof p == "number" && typeof A == "number", tt = typeof p == "number" ? p : "auto", et = typeof A == "number" ? A : "auto";
177
177
  return /* @__PURE__ */ N(rt, { children: [
178
178
  /* @__PURE__ */ N(
179
179
  "div",
@@ -213,7 +213,7 @@ function ie({
213
213
  "video",
214
214
  {
215
215
  ref: a,
216
- src: j,
216
+ src: w,
217
217
  controls: V,
218
218
  preload: "metadata",
219
219
  className: W ? `focused ${h(y) ? "draggable" : ""}` : void 0,
@@ -338,8 +338,8 @@ function ie({
338
338
  initialEditor: b,
339
339
  initialNodes: [
340
340
  Rt,
341
- At,
342
341
  kt,
342
+ At,
343
343
  St,
344
344
  nt,
345
345
  ot
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-BO5Zqvun.js";
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/dist/types.d.ts CHANGED
@@ -27,6 +27,7 @@ export interface ToolbarProps {
27
27
  enableColors?: boolean;
28
28
  enableClearOptions?: boolean;
29
29
  enableEmojiPicker?: boolean;
30
+ enableSpecialCharacters?: boolean;
30
31
  enableDatePicker?: boolean;
31
32
  enableLinks?: boolean;
32
33
  enableFormatTextMenu?: boolean;
@@ -133,6 +134,7 @@ export interface EditorConfigTypes {
133
134
  enableColors: boolean;
134
135
  enableClearOptions: boolean;
135
136
  enableEmojiPicker: boolean;
137
+ enableSpecialCharacters?: boolean;
136
138
  enableDatePicker: boolean;
137
139
  enableLinks: boolean;
138
140
  enableFormatTextMenu: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eddyter",
3
3
  "private": false,
4
- "version": "1.4.0",
4
+ "version": "1.4.1-beta.2",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@9.0.0",
7
7
  "keywords": [
@@ -91,7 +91,7 @@
91
91
  "class-variance-authority": "^0.7.1",
92
92
  "clsx": "^2.1.1",
93
93
  "docx-preview": "^0.3.0",
94
- "emoji-picker-react": "^4.12.0",
94
+ "emoji-picker-react": "^4.18.0",
95
95
  "html-docx-js": "^0.3.1",
96
96
  "html2canvas": "^1.4.1",
97
97
  "html2pdf.js": "^0.14.0",
@@ -1,53 +0,0 @@
1
- import * as g from "pdfjs-dist";
2
- import { J as l, k as m } from "./index-BO5Zqvun.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
- };