@layers-app/editor 0.0.17-editor-02 → 0.0.17-editor-03

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,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.Ck8c0KB8.js";
5
- import { LoadingOverlay as T, Flex as se, Alert as re } from "@mantine/core";
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.8vBcoTVc.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 j = (t) => {
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
- T,
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
- T,
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 z = V(null), [R, y] = I(!0), [k, D] = I(!1), { isCollabActive: A } = Q(), [h] = X(), [m, S] = I(!0), [r, W] = I({
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
- }), { fetchUploadImage: F, fetchDeleteImage: L } = q(Y), { t: N } = J();
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), D(!0);
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: O } = Z(), {
137
- settings: { showNestedEditorTreeView: H }
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
- j,
181
+ T,
182
182
  {
183
183
  width: r.width,
184
184
  height: r.height,
185
- isLoading: R,
186
- isError: k,
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
- fetchDeleteImage: L,
192
+ fetchDeleteMedia: F,
193
193
  altText: c,
194
- imageRef: z,
194
+ imageRef: P,
195
195
  maxWidth: g,
196
196
  showCaption: f,
197
197
  caption: u,
198
- isCollabActive: A,
199
- historyState: O,
200
- showNestedEditorTreeView: H,
201
- t: N
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
- j,
215
+ T,
216
216
  {
217
217
  width: "inherit",
218
218
  height: "inherit",
219
- isLoading: R,
220
- isError: k,
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
- fetchDeleteImage: L,
226
+ fetchDeleteMedia: F,
227
227
  altText: c,
228
- imageRef: z,
228
+ imageRef: P,
229
229
  maxWidth: g,
230
230
  showCaption: f,
231
231
  caption: u,
232
- isCollabActive: A,
233
- historyState: O,
234
- showNestedEditorTreeView: H,
235
- t: N
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
- !F || !e.length || (e.forEach((n, l) => {
245
- F(n, (i, M) => {
244
+ !A || !e.length || (e.forEach((n, l) => {
245
+ A(n, (i, D) => {
246
246
  l === 0 ? h.update(() => {
247
- const P = C(a);
248
- E(P) && (P.setSrc(i), P.setId(M));
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: M
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: N("editor.image.add_photo"),
271
+ title: M("editor.image.add_photo"),
272
272
  icon: "photo",
273
273
  onClick: () => p(!x)
274
274
  }