@layers-app/editor 0.0.9 → 0.0.11
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.
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +52 -1926
- package/dist/layers.BngHKUYL.js +37817 -0
- package/dist/{DSD.CyHt896W.js → layers.C4lrr1t_.js} +23 -23
- package/dist/layers.D95tWX8p.js +16605 -0
- package/dist/{DSD.BxXlla7M.js → layers.DKx4HQvO.js} +10 -10
- package/dist/{DSD.Cnyz6FCq.js → layers.DWcfRy1Z.js} +76 -76
- package/dist/{DSD.DA-gowVh.js → layers.DwVbMntu.js} +21 -21
- package/dist/layers.qcUUnbCI.js +281 -0
- package/package.json +2 -2
- package/dist/DSD.CEKnmfYP.js +0 -5658
- package/dist/DSD.DFUnZ3VB.js +0 -103161
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as f, Fragment as L } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as w, useState as E, useCallback as _, useEffect as j, Suspense as M } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { d as oe, P as ie } from "./
|
|
3
|
+
import { e as U, f as q, u as z, w as k, g as F, c as B, h as O, F as R, N as W, i as G, K as h, j as H, k as J, m as Q, D as V, r as X, n as Y, L as Z, o as K, p as ee, q as te, s as ne, v as ae, B as le } from "./layers.BngHKUYL.js";
|
|
4
|
+
import { d as oe, P as ie } from "./layers.DKx4HQvO.js";
|
|
5
5
|
import { TextInput as re } from "@mantine/core";
|
|
6
6
|
function se({
|
|
7
7
|
label: n,
|
|
@@ -80,12 +80,12 @@ function me({
|
|
|
80
80
|
}) {
|
|
81
81
|
const i = n.getEditorState().read(
|
|
82
82
|
() => B(o)
|
|
83
|
-
), [c, r] = E(i.getAltText()), [
|
|
83
|
+
), [c, r] = E(i.getAltText()), [v, x] = E(i.getShowCaption()), [I, C] = E(i.getPosition()), b = (m) => {
|
|
84
84
|
x(m.target.checked);
|
|
85
85
|
}, d = (m) => {
|
|
86
86
|
C(m.target.value);
|
|
87
87
|
}, p = () => {
|
|
88
|
-
const m = { altText: c, position:
|
|
88
|
+
const m = { altText: c, position: I, showCaption: v };
|
|
89
89
|
i && n.update(() => {
|
|
90
90
|
i.update(m);
|
|
91
91
|
}), t();
|
|
@@ -105,7 +105,7 @@ function me({
|
|
|
105
105
|
ce,
|
|
106
106
|
{
|
|
107
107
|
style: { marginBottom: "1em", width: "208px" },
|
|
108
|
-
value:
|
|
108
|
+
value: I,
|
|
109
109
|
label: "Position",
|
|
110
110
|
name: "position",
|
|
111
111
|
id: "position-select",
|
|
@@ -123,7 +123,7 @@ function me({
|
|
|
123
123
|
{
|
|
124
124
|
id: "caption",
|
|
125
125
|
type: "checkbox",
|
|
126
|
-
checked:
|
|
126
|
+
checked: v,
|
|
127
127
|
onChange: b
|
|
128
128
|
}
|
|
129
129
|
),
|
|
@@ -139,7 +139,7 @@ function me({
|
|
|
139
139
|
) })
|
|
140
140
|
] });
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function ve({
|
|
143
143
|
src: n,
|
|
144
144
|
altText: o,
|
|
145
145
|
nodeKey: t,
|
|
@@ -147,32 +147,32 @@ function Ie({
|
|
|
147
147
|
height: i,
|
|
148
148
|
showCaption: c,
|
|
149
149
|
caption: r,
|
|
150
|
-
position:
|
|
150
|
+
position: v
|
|
151
151
|
}) {
|
|
152
|
-
const [x,
|
|
152
|
+
const [x, I] = U(), C = w(null), b = w(null), [d, p, m] = q(t), [l] = z(), [A, $] = E(null), P = w(null), N = _(
|
|
153
153
|
(s) => {
|
|
154
154
|
if (d && k(F())) {
|
|
155
155
|
s.preventDefault();
|
|
156
156
|
const a = B(t);
|
|
157
|
-
|
|
157
|
+
O(a) && a.remove();
|
|
158
158
|
}
|
|
159
159
|
return !1;
|
|
160
160
|
},
|
|
161
161
|
[d, t]
|
|
162
|
-
),
|
|
162
|
+
), T = _(
|
|
163
163
|
(s) => {
|
|
164
164
|
const g = F(), a = b.current;
|
|
165
165
|
if (d && k(g) && g.getNodes().length === 1) {
|
|
166
166
|
if (c)
|
|
167
|
-
return
|
|
167
|
+
return R(null), s.preventDefault(), r.focus(), !0;
|
|
168
168
|
if (a !== null && a !== document.activeElement)
|
|
169
169
|
return s.preventDefault(), a.focus(), !0;
|
|
170
170
|
}
|
|
171
171
|
return !1;
|
|
172
172
|
},
|
|
173
173
|
[r, d, c]
|
|
174
|
-
),
|
|
175
|
-
(s) => P.current === r || b.current === s.target ? (
|
|
174
|
+
), D = _(
|
|
175
|
+
(s) => P.current === r || b.current === s.target ? (R(null), l.update(() => {
|
|
176
176
|
p(!0);
|
|
177
177
|
const g = l.getRootElement();
|
|
178
178
|
g !== null && g.focus();
|
|
@@ -181,9 +181,9 @@ function Ie({
|
|
|
181
181
|
);
|
|
182
182
|
return j(() => {
|
|
183
183
|
let s = !0;
|
|
184
|
-
const g =
|
|
184
|
+
const g = W(
|
|
185
185
|
l.registerUpdateListener(({ editorState: a }) => {
|
|
186
|
-
s &&
|
|
186
|
+
s && $(a.read(() => F()));
|
|
187
187
|
}),
|
|
188
188
|
l.registerCommand(
|
|
189
189
|
Y,
|
|
@@ -213,10 +213,10 @@ function Ie({
|
|
|
213
213
|
N,
|
|
214
214
|
h
|
|
215
215
|
),
|
|
216
|
-
l.registerCommand(H,
|
|
216
|
+
l.registerCommand(H, T, h),
|
|
217
217
|
l.registerCommand(
|
|
218
218
|
G,
|
|
219
|
-
|
|
219
|
+
D,
|
|
220
220
|
h
|
|
221
221
|
)
|
|
222
222
|
);
|
|
@@ -229,8 +229,8 @@ function Ie({
|
|
|
229
229
|
d,
|
|
230
230
|
t,
|
|
231
231
|
N,
|
|
232
|
-
R,
|
|
233
232
|
T,
|
|
233
|
+
D,
|
|
234
234
|
p
|
|
235
235
|
]), /* @__PURE__ */ f(M, { fallback: null, children: [
|
|
236
236
|
/* @__PURE__ */ f(L, { children: [
|
|
@@ -241,7 +241,7 @@ function Ie({
|
|
|
241
241
|
className: "image-edit-button",
|
|
242
242
|
ref: b,
|
|
243
243
|
onClick: () => {
|
|
244
|
-
|
|
244
|
+
I("Update Inline Image", (s) => /* @__PURE__ */ e(
|
|
245
245
|
me,
|
|
246
246
|
{
|
|
247
247
|
activeEditor: l,
|
|
@@ -256,13 +256,13 @@ function Ie({
|
|
|
256
256
|
/* @__PURE__ */ e(
|
|
257
257
|
de,
|
|
258
258
|
{
|
|
259
|
-
className: d ? `focused ${k(
|
|
259
|
+
className: d ? `focused ${k(A) ? "draggable" : ""}` : null,
|
|
260
260
|
src: n,
|
|
261
261
|
altText: o,
|
|
262
262
|
imageRef: C,
|
|
263
263
|
width: u,
|
|
264
264
|
height: i,
|
|
265
|
-
position:
|
|
265
|
+
position: v
|
|
266
266
|
}
|
|
267
267
|
)
|
|
268
268
|
] }),
|
|
@@ -284,5 +284,5 @@ function Ie({
|
|
|
284
284
|
}
|
|
285
285
|
export {
|
|
286
286
|
me as UpdateInlineImageDialog,
|
|
287
|
-
|
|
287
|
+
ve as default
|
|
288
288
|
};
|