eddyter 1.4.8 → 1.4.9-beta.1

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,4 +1,4 @@
1
- import { jsxs as B, jsx as u } from "react/jsx-runtime";
1
+ import { jsxs as B, jsx as d } from "react/jsx-runtime";
2
2
  import { calculateZoomLevel as N } from "@lexical/utils";
3
3
  import { useRef as P } from "react";
4
4
  function $(f, x, z) {
@@ -35,7 +35,7 @@ function F({
35
35
  startX: 0,
36
36
  startY: 0
37
37
  }), w = P({ imageWrapper: null, editorImageSpan: null, parentParagraph: null }), h = R.getRootElement(), m = h !== null ? h.getBoundingClientRect().width - 20 : 100, L = h !== null ? h.getBoundingClientRect().height - 20 : 100, D = 100, S = 100, M = (t) => {
38
- const i = t === r.east || t === r.west, e = t === r.north || t === r.south, d = t & r.north && t & r.west || t & r.south && t & r.east, l = i ? "ew" : e ? "ns" : d ? "nwse" : "nesw";
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, l = i ? "ew" : e ? "ns" : u ? "nwse" : "nesw";
39
39
  h !== null && h.style.setProperty(
40
40
  "cursor",
41
41
  `${l}-resize`,
@@ -62,11 +62,11 @@ function F({
62
62
  }, y = (t, i) => {
63
63
  if (!R.isEditable())
64
64
  return;
65
- const e = v.current, d = W.current;
66
- if (e !== null && d !== null) {
65
+ const e = v.current, u = W.current;
66
+ if (e !== null && u !== null) {
67
67
  t.preventDefault();
68
68
  const { width: l, height: s } = e.getBoundingClientRect(), c = N(e), o = b.current;
69
- o.startWidth = l, o.startHeight = s, o.ratio = l / s, o.currentWidth = l, o.currentHeight = s, o.startX = t.clientX / c, o.startY = t.clientY / c, o.isResizing = !0, o.direction = i, M(i), f(), d.classList.add("image-control-wrapper--resizing"), e.style.setProperty(
69
+ o.startWidth = l, o.startHeight = s, o.ratio = l / s, o.currentWidth = l, o.currentHeight = s, o.startX = t.clientX / c, o.startY = t.clientY / c, o.isResizing = !0, o.direction = i, M(i), f(), u.classList.add("image-control-wrapper--resizing"), e.style.setProperty(
70
70
  "max-width",
71
71
  `${m}px`,
72
72
  "important"
@@ -89,7 +89,7 @@ function F({
89
89
  ), e.style.setProperty("height", `${s}px`, "important"), e.style.setProperty("width", `${l}px`, "important"), document.addEventListener("pointermove", E), document.addEventListener("pointerup", k);
90
90
  }
91
91
  }, E = (t) => {
92
- const i = v.current, e = b.current, d = e.direction & (r.east | r.west), l = e.direction & (r.south | r.north);
92
+ const i = v.current, e = b.current, u = e.direction & (r.east | r.west), l = e.direction & (r.south | r.north);
93
93
  if (i !== null && e.isResizing) {
94
94
  const s = N(i), { imageWrapper: c, editorImageSpan: o, parentParagraph: p } = w.current;
95
95
  if (i.style.setProperty(
@@ -108,7 +108,7 @@ function F({
108
108
  "max-width",
109
109
  `${m}px`,
110
110
  "important"
111
- ), d && l) {
111
+ ), u && l) {
112
112
  let n = Math.floor(e.startX - t.clientX / s);
113
113
  n = e.direction & r.east ? -n : n;
114
114
  const a = $(
@@ -140,11 +140,11 @@ function F({
140
140
  }, k = () => {
141
141
  const t = v.current, i = b.current, e = W.current;
142
142
  if (t !== null && e !== null && i.isResizing) {
143
- const d = i.currentWidth, l = i.currentHeight;
143
+ const u = i.currentWidth, l = i.currentHeight;
144
144
  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");
145
145
  const { imageWrapper: s, editorImageSpan: c, parentParagraph: o } = w.current;
146
- s && (s.style.removeProperty("display"), s.style.removeProperty("width"), s.style.removeProperty("max-width")), Y(), x(d, l);
147
- const p = d;
146
+ s && (s.style.removeProperty("display"), s.style.removeProperty("width"), s.style.removeProperty("max-width")), Y(), x(u, l);
147
+ const p = u;
148
148
  requestAnimationFrame(() => {
149
149
  if (t.style.removeProperty("max-width"), c && (c.style.removeProperty("display"), c.style.removeProperty("max-width")), o) {
150
150
  const n = o.getBoundingClientRect().width;
@@ -162,9 +162,10 @@ function F({
162
162
  }
163
163
  };
164
164
  return /* @__PURE__ */ B("div", { ref: W, children: [
165
- !H && I && /* @__PURE__ */ u(
165
+ !H && I && /* @__PURE__ */ d(
166
166
  "button",
167
167
  {
168
+ type: "button",
168
169
  className: "image-caption-button cteditor-text-sm",
169
170
  ref: z,
170
171
  onClick: () => {
@@ -173,7 +174,7 @@ function F({
173
174
  children: "Add Caption"
174
175
  }
175
176
  ),
176
- /* @__PURE__ */ u(
177
+ /* @__PURE__ */ d(
177
178
  "div",
178
179
  {
179
180
  className: "image-resizer image-resizer-n",
@@ -182,7 +183,7 @@ function F({
182
183
  }
183
184
  }
184
185
  ),
185
- /* @__PURE__ */ u(
186
+ /* @__PURE__ */ d(
186
187
  "div",
187
188
  {
188
189
  className: "image-resizer image-resizer-ne",
@@ -191,7 +192,7 @@ function F({
191
192
  }
192
193
  }
193
194
  ),
194
- /* @__PURE__ */ u(
195
+ /* @__PURE__ */ d(
195
196
  "div",
196
197
  {
197
198
  className: "image-resizer image-resizer-e",
@@ -200,7 +201,7 @@ function F({
200
201
  }
201
202
  }
202
203
  ),
203
- /* @__PURE__ */ u(
204
+ /* @__PURE__ */ d(
204
205
  "div",
205
206
  {
206
207
  className: "image-resizer image-resizer-se",
@@ -209,7 +210,7 @@ function F({
209
210
  }
210
211
  }
211
212
  ),
212
- /* @__PURE__ */ u(
213
+ /* @__PURE__ */ d(
213
214
  "div",
214
215
  {
215
216
  className: "image-resizer image-resizer-s",
@@ -218,7 +219,7 @@ function F({
218
219
  }
219
220
  }
220
221
  ),
221
- /* @__PURE__ */ u(
222
+ /* @__PURE__ */ d(
222
223
  "div",
223
224
  {
224
225
  className: "image-resizer image-resizer-sw",
@@ -227,7 +228,7 @@ function F({
227
228
  }
228
229
  }
229
230
  ),
230
- /* @__PURE__ */ u(
231
+ /* @__PURE__ */ d(
231
232
  "div",
232
233
  {
233
234
  className: "image-resizer image-resizer-w",
@@ -236,7 +237,7 @@ function F({
236
237
  }
237
238
  }
238
239
  ),
239
- /* @__PURE__ */ u(
240
+ /* @__PURE__ */ d(
240
241
  "div",
241
242
  {
242
243
  className: "image-resizer image-resizer-nw",