eddyter 1.3.69 → 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.
@@ -0,0 +1,24 @@
1
+ <svg width="621" height="665" viewBox="0 0 621 665" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M338.062 405.907C416.398 543.243 440.118 577.099 589.378 545.12C591.595 544.645 592.13 541.662 590.148 540.561L341.351 402.458C339.174 401.249 336.828 403.744 338.062 405.907Z" fill="white"/>
3
+ <path d="M302.175 399.431C304.013 557.527 308.321 598.641 454.344 643.121C456.513 643.781 458.43 641.433 457.23 639.509L306.724 398.012C305.407 395.899 302.146 396.941 302.175 399.431Z" fill="white"/>
4
+ <path d="M274.009 376.372C198.889 515.493 182.702 553.53 288.787 663.29C290.362 664.92 293.178 663.796 293.063 661.532L278.676 377.339C278.55 374.852 275.193 374.181 274.009 376.372Z" fill="white"/>
5
+ <path d="M260.601 342.543C127.402 427.722 94.7879 453.124 134.272 600.577C134.859 602.766 137.866 603.15 138.864 601.115L264.212 345.654C265.309 343.418 262.699 341.201 260.601 342.543Z" fill="white"/>
6
+ <path d="M265.244 306.434C107.444 316.264 66.6005 322.645 29.5602 470.73C29.0101 472.93 31.4528 474.725 33.3137 473.43L266.892 310.906C268.936 309.484 267.73 306.279 265.244 306.434Z" fill="white"/>
7
+ <path d="M286.823 277.121C144.082 209.131 105.274 194.888 1.01888 306.387C-0.529463 308.043 0.735046 310.798 2.99049 310.569L286.093 281.831C288.57 281.58 289.071 278.192 286.823 277.121Z" fill="white"/>
8
+ <path d="M319.975 261.978C228.171 133.256 201.152 101.968 55.8848 148.857C53.7274 149.553 53.4959 152.576 55.579 153.47L317.052 265.742C319.34 266.724 321.421 264.006 319.975 261.978Z" fill="white"/>
9
+ <path d="M356.232 264.8C338.436 107.699 329.998 67.2301 180.229 37.7244C178.005 37.2862 176.336 39.8166 177.723 41.6096L351.848 266.672C353.372 268.642 356.512 267.275 356.232 264.8Z" fill="white"/>
10
+ <path d="M386.584 284.893C447.271 138.898 459.534 99.4196 342.906 0.93483C341.174 -0.52781 338.486 0.874383 338.829 3.11537L381.844 284.403C382.22 286.864 385.628 287.193 386.584 284.893Z" fill="white"/>
11
+ <path d="M403.369 317.189C527.286 218.993 557.167 190.427 502.993 47.7164C502.189 45.597 499.158 45.5185 498.37 47.6442L399.463 314.459C398.597 316.794 401.418 318.735 403.369 317.189Z" fill="white"/>
12
+ <path d="M402.421 353.581C558.422 327.865 598.412 317.392 620.308 166.323C620.633 164.079 618.021 162.54 616.301 164.016L400.33 349.298C398.44 350.919 399.964 353.986 402.421 353.581Z" fill="white"/>
13
+ <path d="M338.062 405.907C416.398 543.243 440.118 577.099 589.378 545.12C591.595 544.645 592.13 541.662 590.148 540.561L341.351 402.458C339.174 401.249 336.828 403.744 338.062 405.907Z" stroke="white" stroke-width="0.675776"/>
14
+ <path d="M302.175 399.431C304.013 557.527 308.321 598.641 454.344 643.121C456.513 643.781 458.43 641.433 457.23 639.509L306.724 398.012C305.407 395.899 302.146 396.941 302.175 399.431Z" stroke="white" stroke-width="0.675776"/>
15
+ <path d="M274.009 376.372C198.889 515.493 182.702 553.53 288.787 663.29C290.362 664.92 293.178 663.796 293.063 661.532L278.676 377.339C278.55 374.852 275.193 374.181 274.009 376.372Z" stroke="white" stroke-width="0.675776"/>
16
+ <path d="M260.601 342.543C127.402 427.722 94.7879 453.124 134.272 600.577C134.859 602.766 137.866 603.15 138.864 601.115L264.212 345.654C265.309 343.418 262.699 341.201 260.601 342.543Z" stroke="white" stroke-width="0.675776"/>
17
+ <path d="M265.244 306.434C107.444 316.264 66.6005 322.645 29.5602 470.73C29.0101 472.93 31.4528 474.725 33.3137 473.43L266.892 310.906C268.936 309.484 267.73 306.279 265.244 306.434Z" stroke="white" stroke-width="0.675776"/>
18
+ <path d="M286.823 277.121C144.082 209.131 105.274 194.888 1.01888 306.387C-0.529463 308.043 0.735046 310.798 2.99049 310.569L286.093 281.831C288.57 281.58 289.071 278.192 286.823 277.121Z" stroke="white" stroke-width="0.675776"/>
19
+ <path d="M319.975 261.978C228.171 133.256 201.152 101.968 55.8848 148.857C53.7274 149.553 53.4959 152.576 55.579 153.47L317.052 265.742C319.34 266.724 321.421 264.006 319.975 261.978Z" stroke="white" stroke-width="0.675776"/>
20
+ <path d="M356.232 264.8C338.436 107.699 329.998 67.2301 180.229 37.7244C178.005 37.2862 176.336 39.8166 177.723 41.6096L351.848 266.672C353.372 268.642 356.512 267.275 356.232 264.8Z" stroke="white" stroke-width="0.675776"/>
21
+ <path d="M386.584 284.893C447.271 138.898 459.534 99.4196 342.906 0.93483C341.174 -0.52781 338.486 0.874383 338.829 3.11537L381.844 284.403C382.22 286.864 385.628 287.193 386.584 284.893Z" stroke="white" stroke-width="0.675776"/>
22
+ <path d="M403.369 317.189C527.286 218.993 557.167 190.427 502.993 47.7164C502.189 45.597 499.158 45.5185 498.37 47.6442L399.463 314.459C398.597 316.794 401.418 318.735 403.369 317.189Z" stroke="white" stroke-width="0.675776"/>
23
+ <path d="M402.421 353.581C558.422 327.865 598.412 317.392 620.308 166.323C620.633 164.079 618.021 162.54 616.301 164.016L400.33 349.298C398.44 350.919 399.964 353.986 402.421 353.581Z" stroke="white" stroke-width="0.675776"/>
24
+ </svg>
@@ -0,0 +1,237 @@
1
+ import { jsxs as B, jsx as p } from "react/jsx-runtime";
2
+ import { calculateZoomLevel as C } from "@lexical/utils";
3
+ import { useRef as P } from "react";
4
+ function $(f, x, z) {
5
+ return Math.min(Math.max(f, x), z);
6
+ }
7
+ const r = {
8
+ east: 1,
9
+ north: 8,
10
+ south: 2,
11
+ west: 4
12
+ };
13
+ function Z({
14
+ onResizeStart: f,
15
+ onResizeEnd: x,
16
+ buttonRef: z,
17
+ imageRef: v,
18
+ maxWidth: j,
19
+ editor: H,
20
+ showCaption: R,
21
+ setShowCaption: X,
22
+ captionsEnabled: L
23
+ }) {
24
+ const W = P(null), g = P({
25
+ priority: "",
26
+ value: "default"
27
+ }), b = P({
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
+ }), w = P({ imageWrapper: null, editorImageSpan: null, parentParagraph: null }), m = H.getRootElement(), c = m !== null ? m.getBoundingClientRect().width - 20 : 100, I = m !== null ? m.getBoundingClientRect().height - 20 : 100, D = 100, M = 100, S = (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";
39
+ m !== null && m.style.setProperty(
40
+ "cursor",
41
+ `${l}-resize`,
42
+ "important"
43
+ ), document.body !== null && (document.body.style.setProperty(
44
+ "cursor",
45
+ `${l}-resize`,
46
+ "important"
47
+ ), g.current.value = document.body.style.getPropertyValue(
48
+ "-webkit-user-select"
49
+ ), g.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
+ }, Y = () => {
57
+ m !== null && m.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
58
+ "-webkit-user-select",
59
+ g.current.value,
60
+ g.current.priority
61
+ ));
62
+ }, u = (t, i) => {
63
+ if (!H.isEditable())
64
+ return;
65
+ const e = v.current, d = W.current;
66
+ if (e !== null && d !== null) {
67
+ t.preventDefault();
68
+ const { width: l, height: o } = e.getBoundingClientRect(), y = C(e), s = b.current;
69
+ s.startWidth = l, s.startHeight = o, s.ratio = l / o, s.currentWidth = l, s.currentHeight = o, s.startX = t.clientX / y, s.startY = t.clientY / y, s.isResizing = !0, s.direction = i, S(i), f(), d.classList.add("image-control-wrapper--resizing"), e.style.setProperty(
70
+ "max-width",
71
+ `${c}px`,
72
+ "important"
73
+ );
74
+ const h = e.parentElement, n = e.closest(
75
+ ".editor-image"
76
+ ), a = n?.parentElement ?? null;
77
+ w.current = { imageWrapper: h, editorImageSpan: n, parentParagraph: a }, h && (h.style.setProperty("display", "inline-block", "important"), h.style.setProperty("width", "auto", "important"), h.style.setProperty(
78
+ "max-width",
79
+ `${c}px`,
80
+ "important"
81
+ )), n && (n.style.setProperty("display", "inline-block", "important"), n.style.setProperty(
82
+ "max-width",
83
+ `${c}px`,
84
+ "important"
85
+ )), a && a.style.setProperty(
86
+ "max-width",
87
+ `${c}px`,
88
+ "important"
89
+ ), e.style.setProperty("height", `${o}px`, "important"), e.style.setProperty("width", `${l}px`, "important"), document.addEventListener("pointermove", E), document.addEventListener("pointerup", k);
90
+ }
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);
93
+ if (i !== null && e.isResizing) {
94
+ const o = C(i), { imageWrapper: y, editorImageSpan: s, parentParagraph: h } = w.current;
95
+ if (i.style.setProperty(
96
+ "max-width",
97
+ `${c}px`,
98
+ "important"
99
+ ), y && (y.style.setProperty("display", "inline-block", "important"), y.style.setProperty("width", "auto", "important"), y.style.setProperty(
100
+ "max-width",
101
+ `${c}px`,
102
+ "important"
103
+ )), s && (s.style.setProperty("display", "inline-block", "important"), s.style.setProperty(
104
+ "max-width",
105
+ `${c}px`,
106
+ "important"
107
+ )), h && h.style.setProperty(
108
+ "max-width",
109
+ `${c}px`,
110
+ "important"
111
+ ), d && l) {
112
+ let n = Math.floor(e.startX - t.clientX / o);
113
+ n = e.direction & r.east ? -n : n;
114
+ const a = $(
115
+ e.startWidth + n,
116
+ D,
117
+ c
118
+ ), N = a / e.ratio;
119
+ i.style.setProperty("width", `${a}px`, "important"), i.style.setProperty("height", `${N}px`, "important"), e.currentHeight = N, e.currentWidth = a;
120
+ } else if (l) {
121
+ let n = Math.floor(e.startY - t.clientY / o);
122
+ n = e.direction & r.south ? -n : n;
123
+ const a = $(
124
+ e.startHeight + n,
125
+ M,
126
+ I
127
+ );
128
+ i.style.setProperty("height", `${a}px`, "important"), e.currentHeight = a;
129
+ } else {
130
+ let n = Math.floor(e.startX - t.clientX / o);
131
+ n = e.direction & r.east ? -n : n;
132
+ const a = $(
133
+ e.startWidth + n,
134
+ D,
135
+ c
136
+ );
137
+ i.style.setProperty("width", `${a}px`, "important"), e.currentWidth = a;
138
+ }
139
+ }
140
+ }, k = () => {
141
+ const t = v.current, i = b.current, e = W.current;
142
+ if (t !== null && e !== null && i.isResizing) {
143
+ const d = i.currentWidth, l = i.currentHeight;
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
+ const { imageWrapper: o } = w.current;
146
+ o && (o.style.removeProperty("display"), o.style.removeProperty("width"), o.style.removeProperty("max-width")), w.current = { imageWrapper: null, editorImageSpan: null, parentParagraph: null }, Y(), x(d, l), document.removeEventListener("pointermove", E), document.removeEventListener("pointerup", k);
147
+ }
148
+ };
149
+ return /* @__PURE__ */ B("div", { ref: W, children: [
150
+ !R && L && /* @__PURE__ */ p(
151
+ "button",
152
+ {
153
+ className: "image-caption-button",
154
+ ref: z,
155
+ onClick: () => {
156
+ X(!R);
157
+ },
158
+ children: "Add Caption"
159
+ }
160
+ ),
161
+ /* @__PURE__ */ p(
162
+ "div",
163
+ {
164
+ className: "image-resizer image-resizer-n",
165
+ onPointerDown: (t) => {
166
+ u(t, r.north);
167
+ }
168
+ }
169
+ ),
170
+ /* @__PURE__ */ p(
171
+ "div",
172
+ {
173
+ className: "image-resizer image-resizer-ne",
174
+ onPointerDown: (t) => {
175
+ u(t, r.north | r.east);
176
+ }
177
+ }
178
+ ),
179
+ /* @__PURE__ */ p(
180
+ "div",
181
+ {
182
+ className: "image-resizer image-resizer-e",
183
+ onPointerDown: (t) => {
184
+ u(t, r.east);
185
+ }
186
+ }
187
+ ),
188
+ /* @__PURE__ */ p(
189
+ "div",
190
+ {
191
+ className: "image-resizer image-resizer-se",
192
+ onPointerDown: (t) => {
193
+ u(t, r.south | r.east);
194
+ }
195
+ }
196
+ ),
197
+ /* @__PURE__ */ p(
198
+ "div",
199
+ {
200
+ className: "image-resizer image-resizer-s",
201
+ onPointerDown: (t) => {
202
+ u(t, r.south);
203
+ }
204
+ }
205
+ ),
206
+ /* @__PURE__ */ p(
207
+ "div",
208
+ {
209
+ className: "image-resizer image-resizer-sw",
210
+ onPointerDown: (t) => {
211
+ u(t, r.south | r.west);
212
+ }
213
+ }
214
+ ),
215
+ /* @__PURE__ */ p(
216
+ "div",
217
+ {
218
+ className: "image-resizer image-resizer-w",
219
+ onPointerDown: (t) => {
220
+ u(t, r.west);
221
+ }
222
+ }
223
+ ),
224
+ /* @__PURE__ */ p(
225
+ "div",
226
+ {
227
+ className: "image-resizer image-resizer-nw",
228
+ onPointerDown: (t) => {
229
+ u(t, r.north | r.west);
230
+ }
231
+ }
232
+ )
233
+ ] });
234
+ }
235
+ export {
236
+ Z as I
237
+ };