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.
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface SpecialCharactersWidgetProps {
3
+ title?: string;
4
+ icon: React.ReactNode;
5
+ onChange?: (char: string) => void;
6
+ }
7
+ declare const SpecialCharactersWidget: React.ForwardRefExoticComponent<SpecialCharactersWidgetProps & React.RefAttributes<HTMLDivElement>>;
8
+ export default SpecialCharactersWidget;
@@ -0,0 +1,2 @@
1
+ export { default } from './SpecialCharactersWidget';
2
+ export type { SpecialCharactersWidgetProps } from './SpecialCharactersWidget';
@@ -11,6 +11,7 @@ export declare const editorConfig: {
11
11
  enableColors: boolean;
12
12
  enableClearOptions: boolean;
13
13
  enableEmojiPicker: boolean;
14
+ enableSpecialCharacters: boolean;
14
15
  enableLinks: boolean;
15
16
  enableFormatTextMenu: boolean;
16
17
  enableCodeFormat: boolean;
@@ -1,4 +1,4 @@
1
- import { c as Tt, g as Se, J as Ce, k as xe } from "./index-BO5Zqvun.js";
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, k as Di } from "./index-BO5Zqvun.js";
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,
@@ -1,4 +1,4 @@
1
- import { c as Ka, g as $u } from "./index-BO5Zqvun.js";
1
+ import { s as Ka, v as $u } from "./index-BOOPaoFA.js";
2
2
  function tl(Qa, iu) {
3
3
  for (var jo = 0; jo < iu.length; jo++) {
4
4
  const qs = iu[jo];