eddyter 1.3.70 → 1.3.71

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.
@@ -1,7 +1,7 @@
1
1
  import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
2
  import { useLexicalComposerContext as v } from "@lexical/react/LexicalComposerContext";
3
3
  import { $getNodeByKey as w } from "lexical";
4
- import { q as k, r as F, F as y, s as N, v as C, w as D } from "./index-DJEsPHep.js";
4
+ import { q as k, r as F, F as y, s as N, v as C, w as D } from "./index-BgjRNNca.js";
5
5
  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) => {
6
6
  const o = t.split(".");
7
7
  return o.length > 1 ? o[o.length - 1].toLowerCase() : "";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { y as a, z as r, G as t, H as s, I as o, J as d, K as v, M as u, N as f, O as n, P as l, Q as w } from "./index-DJEsPHep.js";
1
+ import { y as a, z as r, G as t, H as s, I as o, J as d, K as v, M as u, N as f, O as n, P as l, Q as w } from "./index-BgjRNNca.js";
2
2
  export {
3
3
  a as ConfigurableEditor,
4
4
  r as ConfigurableEditorWithAuth,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eddyter",
3
3
  "private": false,
4
- "version": "1.3.70",
4
+ "version": "1.3.71",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@9.0.0",
7
7
  "keywords": [
@@ -1,199 +0,0 @@
1
- import { jsxs as Y, jsx as c } from "react/jsx-runtime";
2
- import { calculateZoomLevel as N } from "@lexical/utils";
3
- import { useRef as z } from "react";
4
- function v(m, g, p) {
5
- return Math.min(Math.max(m, g), p);
6
- }
7
- const r = {
8
- east: 1,
9
- north: 8,
10
- south: 2,
11
- west: 4
12
- };
13
- function S({
14
- onResizeStart: m,
15
- onResizeEnd: g,
16
- buttonRef: p,
17
- imageRef: w,
18
- maxWidth: k,
19
- editor: P,
20
- showCaption: W,
21
- setShowCaption: C,
22
- captionsEnabled: E
23
- }) {
24
- const y = z(null), d = z({
25
- priority: "",
26
- value: "default"
27
- }), f = z({
28
- currentHeight: 0,
29
- currentWidth: 0,
30
- direction: 0,
31
- isResizing: !1,
32
- ratio: 0,
33
- startHeight: 0,
34
- startWidth: 0,
35
- startX: 0,
36
- startY: 0
37
- }), a = P.getRootElement(), b = a !== null ? a.getBoundingClientRect().width - 20 : 100, X = a !== null ? a.getBoundingClientRect().height - 20 : 100, x = 100, $ = 100, L = (t) => {
38
- const i = t === r.east || t === r.west, e = t === r.north || t === r.south, u = t & r.north && t & r.west || t & r.south && t & r.east, o = i ? "ew" : e ? "ns" : u ? "nwse" : "nesw";
39
- a !== null && a.style.setProperty(
40
- "cursor",
41
- `${o}-resize`,
42
- "important"
43
- ), document.body !== null && (document.body.style.setProperty(
44
- "cursor",
45
- `${o}-resize`,
46
- "important"
47
- ), d.current.value = document.body.style.getPropertyValue(
48
- "-webkit-user-select"
49
- ), d.current.priority = document.body.style.getPropertyPriority(
50
- "-webkit-user-select"
51
- ), document.body.style.setProperty(
52
- "-webkit-user-select",
53
- "none",
54
- "important"
55
- ));
56
- }, M = () => {
57
- a !== null && a.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
58
- "-webkit-user-select",
59
- d.current.value,
60
- d.current.priority
61
- ));
62
- }, l = (t, i) => {
63
- if (!P.isEditable())
64
- return;
65
- const e = w.current, u = y.current;
66
- if (e !== null && u !== null) {
67
- t.preventDefault();
68
- const { width: o, height: h } = e.getBoundingClientRect(), s = N(e), n = f.current;
69
- n.startWidth = o, n.startHeight = h, n.ratio = o / h, n.currentWidth = o, n.currentHeight = h, n.startX = t.clientX / s, n.startY = t.clientY / s, n.isResizing = !0, n.direction = i, L(i), m(), u.classList.add("image-control-wrapper--resizing"), e.style.height = `${h}px`, e.style.width = `${o}px`, document.addEventListener("pointermove", H), document.addEventListener("pointerup", D);
70
- }
71
- }, H = (t) => {
72
- const i = w.current, e = f.current, u = e.direction & (r.east | r.west), o = e.direction & (r.south | r.north);
73
- if (i !== null && e.isResizing) {
74
- const h = N(i);
75
- if (u && o) {
76
- let s = Math.floor(e.startX - t.clientX / h);
77
- s = e.direction & r.east ? -s : s;
78
- const n = v(
79
- e.startWidth + s,
80
- x,
81
- b
82
- ), R = n / e.ratio;
83
- i.style.width = `${n}px`, i.style.height = `${R}px`, e.currentHeight = R, e.currentWidth = n;
84
- } else if (o) {
85
- let s = Math.floor(e.startY - t.clientY / h);
86
- s = e.direction & r.south ? -s : s;
87
- const n = v(
88
- e.startHeight + s,
89
- $,
90
- X
91
- );
92
- i.style.height = `${n}px`, e.currentHeight = n;
93
- } else {
94
- let s = Math.floor(e.startX - t.clientX / h);
95
- s = e.direction & r.east ? -s : s;
96
- const n = v(
97
- e.startWidth + s,
98
- x,
99
- b
100
- );
101
- i.style.width = `${n}px`, e.currentWidth = n;
102
- }
103
- }
104
- }, D = () => {
105
- const t = w.current, i = f.current, e = y.current;
106
- if (t !== null && e !== null && i.isResizing) {
107
- const u = i.currentWidth, o = i.currentHeight;
108
- i.startWidth = 0, i.startHeight = 0, i.ratio = 0, i.startX = 0, i.startY = 0, i.currentWidth = 0, i.currentHeight = 0, i.isResizing = !1, e.classList.remove("image-control-wrapper--resizing"), M(), g(u, o), document.removeEventListener("pointermove", H), document.removeEventListener("pointerup", D);
109
- }
110
- };
111
- return /* @__PURE__ */ Y("div", { ref: y, children: [
112
- !W && E && /* @__PURE__ */ c(
113
- "button",
114
- {
115
- className: "image-caption-button",
116
- ref: p,
117
- onClick: () => {
118
- C(!W);
119
- },
120
- children: "Add Caption"
121
- }
122
- ),
123
- /* @__PURE__ */ c(
124
- "div",
125
- {
126
- className: "image-resizer image-resizer-n",
127
- onPointerDown: (t) => {
128
- l(t, r.north);
129
- }
130
- }
131
- ),
132
- /* @__PURE__ */ c(
133
- "div",
134
- {
135
- className: "image-resizer image-resizer-ne",
136
- onPointerDown: (t) => {
137
- l(t, r.north | r.east);
138
- }
139
- }
140
- ),
141
- /* @__PURE__ */ c(
142
- "div",
143
- {
144
- className: "image-resizer image-resizer-e",
145
- onPointerDown: (t) => {
146
- l(t, r.east);
147
- }
148
- }
149
- ),
150
- /* @__PURE__ */ c(
151
- "div",
152
- {
153
- className: "image-resizer image-resizer-se",
154
- onPointerDown: (t) => {
155
- l(t, r.south | r.east);
156
- }
157
- }
158
- ),
159
- /* @__PURE__ */ c(
160
- "div",
161
- {
162
- className: "image-resizer image-resizer-s",
163
- onPointerDown: (t) => {
164
- l(t, r.south);
165
- }
166
- }
167
- ),
168
- /* @__PURE__ */ c(
169
- "div",
170
- {
171
- className: "image-resizer image-resizer-sw",
172
- onPointerDown: (t) => {
173
- l(t, r.south | r.west);
174
- }
175
- }
176
- ),
177
- /* @__PURE__ */ c(
178
- "div",
179
- {
180
- className: "image-resizer image-resizer-w",
181
- onPointerDown: (t) => {
182
- l(t, r.west);
183
- }
184
- }
185
- ),
186
- /* @__PURE__ */ c(
187
- "div",
188
- {
189
- className: "image-resizer image-resizer-nw",
190
- onPointerDown: (t) => {
191
- l(t, r.north | r.west);
192
- }
193
- }
194
- )
195
- ] });
196
- }
197
- export {
198
- S as I
199
- };