@layers-app/editor 0.0.17-editor-02 → 0.0.18
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/README.md +11 -11
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +6 -196
- package/dist/index.js +2 -2
- package/dist/{layers.mZsUCWha.js → layers.Beb8H5iK.js} +1 -1
- package/dist/{layers.DeVO3cbn.js → layers.CWaWCp52.js} +1 -1
- package/dist/layers.CmuE7cyq.js +1 -0
- package/dist/{layers.Ck8c0KB8.js → layers.Cnf8ktNm.js} +11395 -11806
- package/dist/layers.Crl1Kzhp.js +164 -0
- package/dist/{layers.8IsVFZzu.js → layers.DicigL6z.js} +36 -36
- package/package.json +9 -7
- package/dist/layers.BNEO_yBt.js +0 -164
- package/dist/layers.CXZ1fGx2.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o, jsxs as G } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as V, useState as I, useContext as q, useEffect as w } from "react";
|
|
3
3
|
import { useTranslation as J } from "react-i18next";
|
|
4
|
-
import { l as Q, u as X, C as Y, a as Z, b as K, c as C, $ as E, t as ee, I as te, E as ie, d as oe, R as ne, F as ae } from "./layers.
|
|
5
|
-
import { LoadingOverlay as
|
|
4
|
+
import { l as Q, u as X, C as Y, a as Z, b as K, c as C, $ as E, t as ee, I as te, E as ie, d as oe, R as ne, F as ae } from "./layers.Cnf8ktNm.js";
|
|
5
|
+
import { LoadingOverlay as H, Flex as se, Alert as re } from "@mantine/core";
|
|
6
6
|
import { IconInfoCircle as le } from "@tabler/icons-react";
|
|
7
|
-
const
|
|
7
|
+
const T = (t) => {
|
|
8
8
|
const {
|
|
9
9
|
width: c,
|
|
10
10
|
height: a,
|
|
@@ -28,7 +28,7 @@ const j = (t) => {
|
|
|
28
28
|
},
|
|
29
29
|
children: [
|
|
30
30
|
/* @__PURE__ */ o(
|
|
31
|
-
|
|
31
|
+
H,
|
|
32
32
|
{
|
|
33
33
|
visible: s,
|
|
34
34
|
zIndex: 1e3,
|
|
@@ -37,7 +37,7 @@ const j = (t) => {
|
|
|
37
37
|
}
|
|
38
38
|
),
|
|
39
39
|
/* @__PURE__ */ o(
|
|
40
|
-
|
|
40
|
+
H,
|
|
41
41
|
{
|
|
42
42
|
visible: d,
|
|
43
43
|
zIndex: 1e3,
|
|
@@ -111,12 +111,12 @@ function pe({
|
|
|
111
111
|
caption: u,
|
|
112
112
|
id: b,
|
|
113
113
|
create: v,
|
|
114
|
-
alignment:
|
|
114
|
+
alignment: j
|
|
115
115
|
}) {
|
|
116
|
-
const
|
|
116
|
+
const P = V(null), [z, y] = I(!0), [R, _] = I(!1), { isCollabActive: k } = Q(), [h] = X(), [m, S] = I(!0), [r, W] = I({
|
|
117
117
|
width: 0,
|
|
118
118
|
height: 0
|
|
119
|
-
}), {
|
|
119
|
+
}), { fetchUploadMedia: A, fetchDeleteMedia: F } = q(Y), { t: M } = J();
|
|
120
120
|
w(() => {
|
|
121
121
|
if (!t || t.startsWith("data:image/")) {
|
|
122
122
|
y(!1);
|
|
@@ -124,7 +124,7 @@ function pe({
|
|
|
124
124
|
}
|
|
125
125
|
const e = new Image();
|
|
126
126
|
e.src = t, e.onload = () => y(!1), e.onerror = () => {
|
|
127
|
-
y(!1),
|
|
127
|
+
y(!1), _(!0);
|
|
128
128
|
};
|
|
129
129
|
}, [t]);
|
|
130
130
|
const U = (e, n) => {
|
|
@@ -133,8 +133,8 @@ function pe({
|
|
|
133
133
|
const l = C(a);
|
|
134
134
|
E(l) && l.setWidthAndHeight(e, n);
|
|
135
135
|
});
|
|
136
|
-
}, { historyState:
|
|
137
|
-
settings: { showNestedEditorTreeView:
|
|
136
|
+
}, { historyState: L } = Z(), {
|
|
137
|
+
settings: { showNestedEditorTreeView: O }
|
|
138
138
|
} = K(), [x, p] = I(!1);
|
|
139
139
|
function $(e) {
|
|
140
140
|
return e.endsWith(".svg") || e.includes("image/svg+xml");
|
|
@@ -178,27 +178,27 @@ function pe({
|
|
|
178
178
|
const e = document.documentElement;
|
|
179
179
|
ee(x, e);
|
|
180
180
|
}, [x]), t ? m ? /* @__PURE__ */ o(
|
|
181
|
-
|
|
181
|
+
T,
|
|
182
182
|
{
|
|
183
183
|
width: r.width,
|
|
184
184
|
height: r.height,
|
|
185
|
-
isLoading:
|
|
186
|
-
isError:
|
|
185
|
+
isLoading: z,
|
|
186
|
+
isError: R,
|
|
187
187
|
isIcon: m,
|
|
188
188
|
src: t,
|
|
189
189
|
id: b,
|
|
190
190
|
editor: h,
|
|
191
191
|
nodeKey: a,
|
|
192
|
-
|
|
192
|
+
fetchDeleteMedia: F,
|
|
193
193
|
altText: c,
|
|
194
|
-
imageRef:
|
|
194
|
+
imageRef: P,
|
|
195
195
|
maxWidth: g,
|
|
196
196
|
showCaption: f,
|
|
197
197
|
caption: u,
|
|
198
|
-
isCollabActive:
|
|
199
|
-
historyState:
|
|
200
|
-
showNestedEditorTreeView:
|
|
201
|
-
t:
|
|
198
|
+
isCollabActive: k,
|
|
199
|
+
historyState: L,
|
|
200
|
+
showNestedEditorTreeView: O,
|
|
201
|
+
t: M
|
|
202
202
|
}
|
|
203
203
|
) : /* @__PURE__ */ o(
|
|
204
204
|
ne,
|
|
@@ -210,29 +210,29 @@ function pe({
|
|
|
210
210
|
initialWidth: r.width || "",
|
|
211
211
|
initialHeight: r.height || "",
|
|
212
212
|
onResizeEnd: U,
|
|
213
|
-
alignment:
|
|
213
|
+
alignment: j,
|
|
214
214
|
children: /* @__PURE__ */ o(
|
|
215
|
-
|
|
215
|
+
T,
|
|
216
216
|
{
|
|
217
217
|
width: "inherit",
|
|
218
218
|
height: "inherit",
|
|
219
|
-
isLoading:
|
|
220
|
-
isError:
|
|
219
|
+
isLoading: z,
|
|
220
|
+
isError: R,
|
|
221
221
|
isIcon: m,
|
|
222
222
|
src: t,
|
|
223
223
|
id: b,
|
|
224
224
|
editor: h,
|
|
225
225
|
nodeKey: a,
|
|
226
|
-
|
|
226
|
+
fetchDeleteMedia: F,
|
|
227
227
|
altText: c,
|
|
228
|
-
imageRef:
|
|
228
|
+
imageRef: P,
|
|
229
229
|
maxWidth: g,
|
|
230
230
|
showCaption: f,
|
|
231
231
|
caption: u,
|
|
232
|
-
isCollabActive:
|
|
233
|
-
historyState:
|
|
234
|
-
showNestedEditorTreeView:
|
|
235
|
-
t:
|
|
232
|
+
isCollabActive: k,
|
|
233
|
+
historyState: L,
|
|
234
|
+
showNestedEditorTreeView: O,
|
|
235
|
+
t: M
|
|
236
236
|
}
|
|
237
237
|
)
|
|
238
238
|
}
|
|
@@ -241,15 +241,15 @@ function pe({
|
|
|
241
241
|
{
|
|
242
242
|
uploading: !1,
|
|
243
243
|
onUpload: (e) => {
|
|
244
|
-
!
|
|
245
|
-
|
|
244
|
+
!A || !e.length || (e.forEach((n, l) => {
|
|
245
|
+
A(n, (i, D) => {
|
|
246
246
|
l === 0 ? h.update(() => {
|
|
247
|
-
const
|
|
248
|
-
E(
|
|
247
|
+
const N = C(a);
|
|
248
|
+
E(N) && (N.setSrc(i), N.setId(D));
|
|
249
249
|
}) : h.dispatchCommand(oe, {
|
|
250
250
|
altText: "",
|
|
251
251
|
src: i,
|
|
252
|
-
id:
|
|
252
|
+
id: D
|
|
253
253
|
});
|
|
254
254
|
});
|
|
255
255
|
}), p(!1));
|
|
@@ -268,7 +268,7 @@ function pe({
|
|
|
268
268
|
children: /* @__PURE__ */ o(
|
|
269
269
|
ie,
|
|
270
270
|
{
|
|
271
|
-
title:
|
|
271
|
+
title: M("editor.image.add_photo"),
|
|
272
272
|
icon: "photo",
|
|
273
273
|
onClick: () => p(!x)
|
|
274
274
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layers-app/editor",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.18",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "vite --mode full",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"main": "dist/index.js",
|
|
26
26
|
"types": "dist/index.d.ts",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@layers-app/shared": "^0.0.
|
|
28
|
+
"@layers-app/shared": "^0.0.27",
|
|
29
29
|
"@lexical/headless": "0.21.0",
|
|
30
30
|
"@lexical/markdown": "0.21.0",
|
|
31
31
|
"@lexical/react": "0.21.0",
|
|
@@ -40,11 +40,13 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@eslint/js": "^9.9.0",
|
|
43
|
-
"@mantine/core": "
|
|
44
|
-
"@mantine/dropzone": "
|
|
45
|
-
"@mantine/form": "
|
|
46
|
-
"@mantine/hooks": "
|
|
47
|
-
"@mantine/modals": "
|
|
43
|
+
"@mantine/core": "7.17.2",
|
|
44
|
+
"@mantine/dropzone": "7.17.2",
|
|
45
|
+
"@mantine/form": "7.17.2",
|
|
46
|
+
"@mantine/hooks": "7.17.2",
|
|
47
|
+
"@mantine/modals": "7.17.2",
|
|
48
|
+
"@mantine/tiptap": "7.17.2",
|
|
49
|
+
"@mantine/notifications": "7.17.2",
|
|
48
50
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
49
51
|
"@tabler/icons-react": "^3.7.0",
|
|
50
52
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|