@layers-app/editor 0.7.18 → 0.7.20
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.cjs +2 -2
- package/dist/index.d.ts +77 -1
- package/dist/index.js +15 -9
- package/dist/layers.-pxItkuK.js +11 -0
- package/dist/layers.4783bPvO.js +39 -0
- package/dist/layers.4XOTUH37.js +1089 -0
- package/dist/layers.4peyl00A.js +2 -0
- package/dist/layers.4wAcqQtQ.js +423 -0
- package/dist/layers.4ykD0YcM.js +40 -0
- package/dist/layers.52famHy6.js +1 -0
- package/dist/layers.6Feq9YXQ.js +40 -0
- package/dist/layers.6GQPwq_6.js +960 -0
- package/dist/layers.7JqFgE4-.js +15 -0
- package/dist/layers.7wQbmwwB.js +1034 -0
- package/dist/layers.8JNx1FTq.js +35 -0
- package/dist/layers.8jhm9FEJ.js +10 -0
- package/dist/layers.8lNrKfca.js +41 -0
- package/dist/layers.9kQUqqYe.js +139 -0
- package/dist/layers.9pNaFvaX.js +1 -0
- package/dist/layers.AO3vHISA.js +33 -0
- package/dist/layers.Ab6Lx44l.js +129 -0
- package/dist/layers.B-w9_4cB.js +22 -0
- package/dist/layers.B0bpRgNT.js +122 -0
- package/dist/layers.B19hGmey.js +1 -0
- package/dist/layers.B2OK_mI8.js +1 -0
- package/dist/layers.B3D4g2HH.js +1 -0
- package/dist/layers.B3mzJc8P.js +907 -0
- package/dist/layers.B5YhL7Gw.js +40 -0
- package/dist/layers.B7K7JjK6.js +1510 -0
- package/dist/layers.B885pkJL.js +794 -0
- package/dist/layers.B961U-Vk.js +1 -0
- package/dist/layers.B9jATAXU.js +42 -0
- package/dist/layers.BAtv1CM7.js +1 -0
- package/dist/layers.BBv6P-Uu.js +37 -0
- package/dist/layers.BC6JEDP2.js +796 -0
- package/dist/layers.BEagxCE_.js +35 -0
- package/dist/layers.BH34WCDb.js +6 -0
- package/dist/layers.BIeVwYKL.js +1 -0
- package/dist/layers.BIkD0WQr.js +10 -0
- package/dist/layers.BIlhFIEz.js +37 -0
- package/dist/layers.BJDrjORS.js +244 -0
- package/dist/{layers.D99OBX9u.js → layers.BJLOp9cg.js} +88 -86
- package/dist/layers.BJsWSYrS.js +323 -0
- package/dist/layers.BKwcxD8A.js +5 -0
- package/dist/layers.BLd2spTm.js +1 -0
- package/dist/layers.BLv_frn1.js +10 -0
- package/dist/layers.BO2V23mI.js +1 -0
- package/dist/layers.BO_D4q5p.js +42 -0
- package/dist/layers.BP7EcZBZ.js +1 -0
- package/dist/layers.BP8OcU0T.js +10 -0
- package/dist/layers.BRaRY9tU.js +373 -0
- package/dist/layers.BSTBZrFn.js +1 -0
- package/dist/layers.BT2iHuSm.js +8 -0
- package/dist/layers.BU-tjKWq.js +33 -0
- package/dist/layers.BWEUOe94.js +40 -0
- package/dist/layers.BXAu7G4b.js +4 -0
- package/dist/layers.BZ9zcjtY.js +8 -0
- package/dist/layers.BZa5A6cg.js +425 -0
- package/dist/layers.BZlzQFiI.js +51 -0
- package/dist/layers.BagtOD0V.js +1 -0
- package/dist/layers.BbCfEXyj.js +55 -0
- package/dist/layers.Be94M_F4.js +7 -0
- package/dist/layers.BhdUQN6J.js +1583 -0
- package/dist/layers.Bj915C_T.js +5 -0
- package/dist/layers.BnHSrOPr.js +40 -0
- package/dist/layers.BngaRys_.js +8583 -0
- package/dist/layers.BoRvGzPp.js +1 -0
- package/dist/layers.Bob38w8X.js +5 -0
- package/dist/layers.BpTkSHkL.js +38 -0
- package/dist/layers.BpVR__4s.js +32 -0
- package/dist/layers.BpilXLfW.js +6 -0
- package/dist/layers.Br9HAzwf.js +2482 -0
- package/dist/layers.Bt7brqhi.js +116 -0
- package/dist/layers.BtqAfMks.js +1 -0
- package/dist/layers.BtvHse58.js +1 -0
- package/dist/layers.BwzogUnt.js +41 -0
- package/dist/layers.ByB5f2g3.js +7 -0
- package/dist/layers.ByipH4AB.js +207 -0
- package/dist/layers.BzC5N3hu.js +1619 -0
- package/dist/layers.C-KP-jFZ.js +8 -0
- package/dist/layers.C0iFGBoQ.js +213 -0
- package/dist/layers.C1AULvj_.js +40 -0
- package/dist/layers.C2f7uCzl.js +21620 -0
- package/dist/layers.C47t6lve.js +2 -0
- package/dist/layers.C4gRYt-z.js +9 -0
- package/dist/layers.C4nmPqDc.js +9 -0
- package/dist/layers.C5UKJ24R.js +271 -0
- package/dist/layers.C5qsYNKq.js +7 -0
- package/dist/layers.C70jnpZq.js +42 -0
- package/dist/layers.C7Qg5l_Q.js +5 -0
- package/dist/layers.C7v0beLV.js +9 -0
- package/dist/layers.C8_lu5UH.js +23 -0
- package/dist/layers.CAcCDIzK.js +32 -0
- package/dist/layers.CCWJVHwX.js +26946 -0
- package/dist/layers.CF2BAIC-.js +1 -0
- package/dist/layers.CFUGAgBV.js +805 -0
- package/dist/layers.CHZsXQcr.js +1 -0
- package/dist/layers.CIo6HbVI.js +37 -0
- package/dist/layers.CJaSQy6k.js +70 -0
- package/dist/layers.CJhFGqXY.js +1 -0
- package/dist/layers.CKU_klOZ.js +41 -0
- package/dist/layers.CKrtSnTU.js +7 -0
- package/dist/layers.CNoIsdHV.js +223 -0
- package/dist/layers.CQ-g_IO8.js +39 -0
- package/dist/layers.CRWtU7Vx.js +1268 -0
- package/dist/layers.CSattQNk.js +8 -0
- package/dist/layers.CT-8Geho.js +118 -0
- package/dist/layers.CWTjwUqI.js +9 -0
- package/dist/layers.CY3nuiOZ.js +39 -0
- package/dist/layers.CYDGmR2c.js +1 -0
- package/dist/layers.CYPtUh0S.js +36 -0
- package/dist/layers.CYjyWg9h.js +139 -0
- package/dist/layers.CZCoH1Jq.js +189 -0
- package/dist/layers.CZVe7Rrz.js +4 -0
- package/dist/layers.C_8NFZw0.js +84 -0
- package/dist/layers.C_IvrzZ3.js +7 -0
- package/dist/layers.C_vVmOaW.js +7 -0
- package/dist/layers.Cb3vLPzi.js +1 -0
- package/dist/layers.Cblg5KAJ.js +1286 -0
- package/dist/layers.CeUsnn-s.js +41 -0
- package/dist/layers.Cfwoj-CP.js +76 -0
- package/dist/layers.Cfxt2JbX.js +160 -0
- package/dist/layers.CjixIcYE.js +205 -0
- package/dist/layers.CliEt_s4.js +8 -0
- package/dist/layers.Cmumbtn4.js +11 -0
- package/dist/layers.Cnkh0zSn.js +5 -0
- package/dist/layers.Co0MEzNt.js +32 -0
- package/dist/layers.CpgPovn6.js +32 -0
- package/dist/layers.CqVTtuYm.js +6 -0
- package/dist/layers.Cr_8J_Ls.js +36 -0
- package/dist/layers.Cs7THreY.js +42 -0
- package/dist/layers.CtQHRQJd.js +65 -0
- package/dist/layers.Cuv2Lipq.js +10 -0
- package/dist/layers.Cuy--_Li.js +14 -0
- package/dist/layers.Cxrjuyke.js +38 -0
- package/dist/layers.Cxuu78R8.js +1 -0
- package/dist/layers.Cy_jbtrS.js +198 -0
- package/dist/layers.CyabQ7I1.js +40 -0
- package/dist/layers.CyqF5h2Z.js +1 -0
- package/dist/layers.Cyzu9PKQ.js +1 -0
- package/dist/layers.CzDyzzM2.js +36 -0
- package/dist/layers.D-LL79P8.js +32 -0
- package/dist/layers.D-uQN6e4.js +271 -0
- package/dist/layers.D00djYUT.js +9 -0
- package/dist/layers.D0zn4_Mx.js +1 -0
- package/dist/layers.D1PMEoqL.js +41 -0
- package/dist/layers.D1WSB9zI.js +806 -0
- package/dist/layers.D2dRxQww.js +10 -0
- package/dist/layers.D3KEnhiI.js +6 -0
- package/dist/layers.D3SlAvNp.js +934 -0
- package/dist/layers.D3eKKoAb.js +1 -0
- package/dist/layers.D4T8fTcj.js +1223 -0
- package/dist/layers.D7gfmd9A.js +36 -0
- package/dist/layers.D7jGxypv.js +8 -0
- package/dist/layers.DA1OUhKy.js +10 -0
- package/dist/layers.DB4o6Xfv.js +42 -0
- package/dist/layers.DBUjVgMd.js +1 -0
- package/dist/layers.DCkmUFPh.js +2966 -0
- package/dist/layers.DD4QPdYS.js +96 -0
- package/dist/layers.DE2Io1k7.js +295 -0
- package/dist/layers.DKnEcoKx.js +1088 -0
- package/dist/layers.DKsXm_hK.js +9 -0
- package/dist/layers.DLeGllIz.js +1 -0
- package/dist/layers.DLwuMfdd.js +84 -0
- package/dist/layers.DMkBISW1.js +1 -0
- package/dist/layers.DN9HoVxI.js +18 -0
- package/dist/layers.DOrgOHBr.js +1 -0
- package/dist/layers.DPipd7Yf.js +1 -0
- package/dist/layers.DQpNkl-s.js +39 -0
- package/dist/layers.DSNr6P6_.js +40 -0
- package/dist/layers.DWGLEZg1.js +34 -0
- package/dist/layers.DWxUDz1V.js +13 -0
- package/dist/layers.DYk9FILk.js +8 -0
- package/dist/layers.DZ3Nv-_j.js +8 -0
- package/dist/layers.DZGvjyDH.js +1 -0
- package/dist/layers.DZucH9TB.js +40 -0
- package/dist/layers.D__NkOsa.js +7 -0
- package/dist/layers.DbaKVP5e.js +1 -0
- package/dist/layers.DfkAyTyX.js +39 -0
- package/dist/layers.Dgie_iy2.js +772 -0
- package/dist/layers.DhHIDfZ5.js +1 -0
- package/dist/layers.Di-7t8Xt.js +6 -0
- package/dist/layers.DiPSTN4q.js +1 -0
- package/dist/layers.DjLIeP8d.js +257 -0
- package/dist/layers.DjUOC4st.js +16 -0
- package/dist/layers.Dk6h-6Wb.js +2 -0
- package/dist/layers.DkRR3p16.js +61 -0
- package/dist/layers.DnXxZJQo.js +48149 -0
- package/dist/layers.DpahuC02.js +6 -0
- package/dist/layers.Dpqc2FAN.js +40 -0
- package/dist/layers.DqScp2vq.js +1126 -0
- package/dist/layers.Dr1JRZ_S.js +4 -0
- package/dist/layers.DrTaVUsA.js +39 -0
- package/dist/layers.DrXLa4el.js +44 -0
- package/dist/layers.DtKxMd0g.js +4 -0
- package/dist/layers.DxA6ocdw.js +70 -0
- package/dist/layers.DxRZNwMP.js +1 -0
- package/dist/layers.Dy1naDTQ.js +14 -0
- package/dist/layers.FArKPCKA.js +21941 -0
- package/dist/layers.FXdB_jrR.js +9 -0
- package/dist/layers.GbuD0dtx.js +6 -0
- package/dist/layers.ILs-xE7i.js +11 -0
- package/dist/layers.JWCLFILJ.js +1 -0
- package/dist/layers.L9obQAvP.js +10 -0
- package/dist/layers.Lb5VQ9U4.js +504 -0
- package/dist/layers.MCy444Ia.js +41 -0
- package/dist/layers.QyDQqf0G.js +39 -0
- package/dist/layers.R4CPUhiF.js +8 -0
- package/dist/layers.R8mPlCA0.js +261 -0
- package/dist/layers.Sjtd5SpD.js +84 -0
- package/dist/layers.XlzBx5CM.js +437 -0
- package/dist/layers.YD8zq7G1.js +41 -0
- package/dist/layers.YWM6eRUH.js +1 -0
- package/dist/layers.a6EbdnVa.js +37 -0
- package/dist/layers.b0h5ZBmD.js +61 -0
- package/dist/layers.b9B2NY7n.js +11690 -0
- package/dist/layers.bS5nz97o.js +3 -0
- package/dist/layers.biaV5QcU.js +7 -0
- package/dist/layers.dxw35GiE.js +52 -0
- package/dist/layers.gFW_9pGM.js +1225 -0
- package/dist/layers.ge00jJfz.js +38 -0
- package/dist/layers.iryDeY19.js +9 -0
- package/dist/layers.jN02hLg8.js +7 -0
- package/dist/layers.jqEynR2I.js +8 -0
- package/dist/layers.lCpg7dOn.js +21 -0
- package/dist/layers.lIg0cncJ.js +39 -0
- package/dist/layers.lKk6bx4R.js +1 -0
- package/dist/layers.m4XcFQDd.js +6 -0
- package/dist/layers.m6FDW_ho.js +8 -0
- package/dist/layers.r6u8p96p.js +2238 -0
- package/dist/layers.rWob7btU.js +10 -0
- package/dist/layers.rYZbXo4d.js +32 -0
- package/dist/layers.sldWqHdD.js +11 -0
- package/dist/layers.tFqdqg82.js +10 -0
- package/dist/layers.v25uTBY8.js +39 -0
- package/dist/layers.wNarGMxP.js +9 -0
- package/dist/layers.wxYowcaq.js +41 -0
- package/dist/layers.xjN3ile4.js +9 -0
- package/dist/layers.yNlD-OCA.js +35 -0
- package/dist/layers.z-RuimGg.js +11 -0
- package/dist/layers.zvsP8spW.js +1 -0
- package/package.json +1 -1
- package/dist/layers.94hwidA2.js +0 -198
- package/dist/layers.B4l6ta1Q.js +0 -1
- package/dist/layers.BMrOAD_P.js +0 -1
- package/dist/layers.DOzLBYZr.js +0 -304
- package/dist/layers.YRyXopy_.js +0 -151
- package/dist/layers.usKC_Id5.js +0 -1
- package/dist/layers.zu-IYGYU.js +0 -47463
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as X } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as Z, useState as u, useContext as K, useEffect as g } from "react";
|
|
3
3
|
import { useTranslation as ee } from "react-i18next";
|
|
4
|
-
import {
|
|
5
|
-
import { LoadingOverlay as
|
|
6
|
-
import {
|
|
7
|
-
|
|
4
|
+
import { useLexicalComposerContext as te } from "@lexical/react/LexicalComposerContext";
|
|
5
|
+
import { LoadingOverlay as ie } from "@mantine/core";
|
|
6
|
+
import { $getNodeByKey as S, COMMAND_PRIORITY_LOW as oe, $setSelection as ae } from "lexical";
|
|
7
|
+
import { showErrorNotification as ne } from "@layers-app/shared";
|
|
8
|
+
import { u as se, C as re, m as P, a as le, b as de, $ as y, t as he, U as ge, I as ue, E as me, R as fe, p as T } from "./layers.CCWJVHwX.js";
|
|
9
|
+
const F = (t) => {
|
|
8
10
|
const {
|
|
9
11
|
width: m,
|
|
10
12
|
height: n,
|
|
@@ -13,10 +15,10 @@ const T = (t) => {
|
|
|
13
15
|
src: f,
|
|
14
16
|
id: c,
|
|
15
17
|
altText: p,
|
|
16
|
-
imageRef:
|
|
18
|
+
imageRef: I,
|
|
17
19
|
maxWidth: h
|
|
18
20
|
} = t;
|
|
19
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ X(
|
|
20
22
|
"div",
|
|
21
23
|
{
|
|
22
24
|
className: "media-wrapper",
|
|
@@ -28,7 +30,7 @@ const T = (t) => {
|
|
|
28
30
|
},
|
|
29
31
|
children: [
|
|
30
32
|
/* @__PURE__ */ l(
|
|
31
|
-
|
|
33
|
+
ie,
|
|
32
34
|
{
|
|
33
35
|
visible: d,
|
|
34
36
|
zIndex: 1e3,
|
|
@@ -42,7 +44,7 @@ const T = (t) => {
|
|
|
42
44
|
className: null,
|
|
43
45
|
src: f,
|
|
44
46
|
altText: p,
|
|
45
|
-
imageRef:
|
|
47
|
+
imageRef: I,
|
|
46
48
|
width: "inherit",
|
|
47
49
|
height: "inherit",
|
|
48
50
|
maxWidth: h || "auto",
|
|
@@ -63,11 +65,11 @@ function ce({
|
|
|
63
65
|
maxWidth: c,
|
|
64
66
|
id: p
|
|
65
67
|
}) {
|
|
66
|
-
const [
|
|
68
|
+
const [I, h] = u(!1);
|
|
67
69
|
return /* @__PURE__ */ l(
|
|
68
70
|
"img",
|
|
69
71
|
{
|
|
70
|
-
className: `${m || void 0} ${
|
|
72
|
+
className: `${m || void 0} ${I ? "" : "loading"}`,
|
|
71
73
|
src: d,
|
|
72
74
|
alt: t,
|
|
73
75
|
ref: n,
|
|
@@ -86,7 +88,7 @@ function ce({
|
|
|
86
88
|
}
|
|
87
89
|
);
|
|
88
90
|
}
|
|
89
|
-
function
|
|
91
|
+
function Se({
|
|
90
92
|
src: t,
|
|
91
93
|
altText: m,
|
|
92
94
|
nodeKey: n,
|
|
@@ -95,42 +97,42 @@ function Ne({
|
|
|
95
97
|
maxWidth: f,
|
|
96
98
|
showCaption: c,
|
|
97
99
|
caption: p,
|
|
98
|
-
id:
|
|
100
|
+
id: I,
|
|
99
101
|
create: h,
|
|
100
102
|
alignment: j
|
|
101
103
|
}) {
|
|
102
|
-
var
|
|
103
|
-
const R = Z(null), [
|
|
104
|
+
var D, H;
|
|
105
|
+
const R = Z(null), [N, w] = u(!0), [r] = te(), [C, W] = u(!0), [s, A] = u({
|
|
104
106
|
width: 0,
|
|
105
107
|
height: 0
|
|
106
|
-
}), { start: B, cancel: G } =
|
|
108
|
+
}), { start: B, cancel: G } = se(), [V, M] = u(0), { fetchUploadMedia: O, fetchDeleteMedia: z, maxFileSize: pe } = K(re), b = P.has(t) && (((D = P.get(t)) == null ? void 0 : D.mediaNodeKeys.length) === 0 || ((H = P.get(t)) == null ? void 0 : H.mediaNodeKeys.length) === void 0 || t.trim() === ""), { t: E } = ee(), [Ie, Y] = u(0);
|
|
107
109
|
g(() => r.registerDecoratorListener(() => {
|
|
108
|
-
|
|
109
|
-
}), [
|
|
110
|
+
Y((e) => e + 1);
|
|
111
|
+
}), [b]), g(() => {
|
|
110
112
|
if (!t || t.startsWith("data:image/") || !t.trim()) {
|
|
111
|
-
|
|
113
|
+
w(!1);
|
|
112
114
|
return;
|
|
113
115
|
}
|
|
114
116
|
const e = new Image();
|
|
115
|
-
e.src = t, e.onload = () =>
|
|
116
|
-
|
|
117
|
+
e.src = t, e.onload = () => w(!1), e.onerror = () => {
|
|
118
|
+
w(!1);
|
|
117
119
|
};
|
|
118
|
-
}, [t,
|
|
119
|
-
const
|
|
120
|
+
}, [t, b]);
|
|
121
|
+
const q = (e, o) => {
|
|
120
122
|
r.update(() => {
|
|
121
|
-
|
|
122
|
-
const i =
|
|
123
|
-
|
|
123
|
+
ae(null);
|
|
124
|
+
const i = S(n);
|
|
125
|
+
y(i) && i.setWidthAndHeight(e, o);
|
|
124
126
|
});
|
|
125
|
-
}, { historyState:
|
|
126
|
-
settings: { showNestedEditorTreeView:
|
|
127
|
-
} =
|
|
128
|
-
function
|
|
127
|
+
}, { historyState: U } = le(), {
|
|
128
|
+
settings: { showNestedEditorTreeView: _ }
|
|
129
|
+
} = de(), [L, x] = u(!1);
|
|
130
|
+
function J(e) {
|
|
129
131
|
return e.endsWith(".svg") || e.includes("image/svg+xml");
|
|
130
132
|
}
|
|
131
|
-
function
|
|
133
|
+
function Q(e) {
|
|
132
134
|
return new Promise((o, i) => {
|
|
133
|
-
if (
|
|
135
|
+
if (J(e)) {
|
|
134
136
|
o(0);
|
|
135
137
|
return;
|
|
136
138
|
}
|
|
@@ -146,150 +148,150 @@ function Ne({
|
|
|
146
148
|
h && x(!0);
|
|
147
149
|
}, [h]), g(() => {
|
|
148
150
|
let e = d, o = v, i = 100;
|
|
149
|
-
(t.includes("unsplash") ? t.trim() : !
|
|
150
|
-
typeof e == "number" && e < i && a < i ? (W(!0),
|
|
151
|
+
(t.includes("unsplash") ? t.trim() : !b && t.trim() || t.includes("upload-src-editor")) && t !== "upload" && Q(t).then((a) => {
|
|
152
|
+
typeof e == "number" && e < i && a < i ? (W(!0), A({
|
|
151
153
|
width: e,
|
|
152
154
|
height: o
|
|
153
|
-
})) : a < i ? (W(!0),
|
|
155
|
+
})) : a < i ? (W(!0), A({
|
|
154
156
|
width: "auto",
|
|
155
157
|
height: "auto"
|
|
156
|
-
})) : (
|
|
158
|
+
})) : (A({
|
|
157
159
|
width: a,
|
|
158
160
|
height: a
|
|
159
161
|
}), W(!1));
|
|
160
162
|
}).catch((a) => {
|
|
161
163
|
console.warn("Ошибка при загрузке изображения:", a.message);
|
|
162
164
|
});
|
|
163
|
-
}, [t,
|
|
165
|
+
}, [t, b]), g(() => {
|
|
164
166
|
s.width && s.height && C && r.update(() => {
|
|
165
|
-
const e =
|
|
166
|
-
|
|
167
|
+
const e = S(n);
|
|
168
|
+
y(e) && e.setWidthAndHeight(s.width, s.height);
|
|
167
169
|
});
|
|
168
170
|
}, [s.width, s.height, C]), g(() => {
|
|
169
171
|
const e = document.documentElement;
|
|
170
|
-
|
|
171
|
-
}, [
|
|
172
|
-
|
|
173
|
-
(e) => (t === "upload" &&
|
|
174
|
-
|
|
175
|
-
), [t,
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
const i =
|
|
179
|
-
|
|
172
|
+
he(L, e);
|
|
173
|
+
}, [L]), g(() => r.registerCommand(
|
|
174
|
+
ge,
|
|
175
|
+
(e) => (t === "upload" && k(e), !1),
|
|
176
|
+
oe
|
|
177
|
+
), [t, N]);
|
|
178
|
+
const $ = (e, o) => {
|
|
179
|
+
w(!1), r.update(() => {
|
|
180
|
+
const i = S(n);
|
|
181
|
+
y(i) && (i.setSrc(e), i.setId(o));
|
|
180
182
|
});
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
+
}, k = (e) => {
|
|
184
|
+
w(!0);
|
|
183
185
|
const o = B();
|
|
184
|
-
|
|
186
|
+
O && O(
|
|
185
187
|
e[0],
|
|
186
188
|
(i, a) => {
|
|
187
|
-
|
|
189
|
+
$(i, a), M(0);
|
|
188
190
|
},
|
|
189
191
|
(i) => {
|
|
190
|
-
i &&
|
|
191
|
-
message:
|
|
192
|
-
}),
|
|
192
|
+
i && ne({
|
|
193
|
+
message: E("editor.gallery.errorFile")
|
|
194
|
+
}), M(0), $("", "");
|
|
193
195
|
},
|
|
194
196
|
o,
|
|
195
197
|
(i) => {
|
|
196
|
-
|
|
198
|
+
M(i);
|
|
197
199
|
}
|
|
198
200
|
);
|
|
199
201
|
};
|
|
200
202
|
return !t || t === "upload" ? /* @__PURE__ */ l(
|
|
201
|
-
|
|
203
|
+
ue,
|
|
202
204
|
{
|
|
203
205
|
uploading: !1,
|
|
204
206
|
onUpload: (e) => {
|
|
205
|
-
!
|
|
207
|
+
!O || !e.length || (k(e), x(!1));
|
|
206
208
|
},
|
|
207
209
|
popoverProps: {
|
|
208
|
-
opened:
|
|
210
|
+
opened: L,
|
|
209
211
|
position: "bottom",
|
|
210
212
|
onChange: x
|
|
211
213
|
},
|
|
212
214
|
onChange: (e) => {
|
|
213
215
|
x(!1), r.update(() => {
|
|
214
|
-
const o =
|
|
215
|
-
|
|
216
|
+
const o = S(n);
|
|
217
|
+
y(o) && o.setSrc(e);
|
|
216
218
|
});
|
|
217
219
|
},
|
|
218
220
|
children: /* @__PURE__ */ l(
|
|
219
|
-
|
|
221
|
+
me,
|
|
220
222
|
{
|
|
221
|
-
title:
|
|
223
|
+
title: E("editor.image.add_photo"),
|
|
222
224
|
icon: "photo",
|
|
223
|
-
onClick: () => x(!
|
|
224
|
-
isLoading:
|
|
225
|
+
onClick: () => x(!L),
|
|
226
|
+
isLoading: N,
|
|
225
227
|
progress: V,
|
|
226
228
|
onAfterCancel: () => {
|
|
227
|
-
G(),
|
|
229
|
+
G(), w(!1);
|
|
228
230
|
}
|
|
229
231
|
}
|
|
230
232
|
)
|
|
231
233
|
}
|
|
232
234
|
) : C ? /* @__PURE__ */ l(
|
|
233
|
-
|
|
235
|
+
F,
|
|
234
236
|
{
|
|
235
237
|
width: s.width,
|
|
236
238
|
height: s.height,
|
|
237
|
-
isLoading:
|
|
239
|
+
isLoading: N,
|
|
238
240
|
isError: !1,
|
|
239
241
|
isIcon: C,
|
|
240
242
|
src: t,
|
|
241
|
-
id:
|
|
243
|
+
id: I,
|
|
242
244
|
editor: r,
|
|
243
245
|
nodeKey: n,
|
|
244
|
-
fetchDeleteMedia:
|
|
246
|
+
fetchDeleteMedia: z,
|
|
245
247
|
altText: m,
|
|
246
248
|
imageRef: R,
|
|
247
249
|
maxWidth: f,
|
|
248
250
|
showCaption: c,
|
|
249
251
|
caption: p,
|
|
250
252
|
isCollabActive: !1,
|
|
251
|
-
historyState:
|
|
252
|
-
showNestedEditorTreeView:
|
|
253
|
-
t:
|
|
253
|
+
historyState: U,
|
|
254
|
+
showNestedEditorTreeView: _,
|
|
255
|
+
t: E
|
|
254
256
|
}
|
|
255
257
|
) : /* @__PURE__ */ l(
|
|
256
|
-
|
|
258
|
+
fe,
|
|
257
259
|
{
|
|
258
260
|
editor: r,
|
|
259
261
|
isIcon: C,
|
|
260
|
-
width:
|
|
261
|
-
height:
|
|
262
|
+
width: T(d),
|
|
263
|
+
height: T(v),
|
|
262
264
|
initialWidth: s.width || "",
|
|
263
265
|
initialHeight: s.height || "",
|
|
264
|
-
onResizeEnd:
|
|
266
|
+
onResizeEnd: q,
|
|
265
267
|
alignment: j,
|
|
266
268
|
children: /* @__PURE__ */ l(
|
|
267
|
-
|
|
269
|
+
F,
|
|
268
270
|
{
|
|
269
271
|
width: "inherit",
|
|
270
272
|
height: "inherit",
|
|
271
|
-
isLoading:
|
|
273
|
+
isLoading: N,
|
|
272
274
|
isError: !1,
|
|
273
275
|
isIcon: C,
|
|
274
276
|
src: t,
|
|
275
|
-
id:
|
|
277
|
+
id: I,
|
|
276
278
|
editor: r,
|
|
277
279
|
nodeKey: n,
|
|
278
|
-
fetchDeleteMedia:
|
|
280
|
+
fetchDeleteMedia: z,
|
|
279
281
|
altText: m,
|
|
280
282
|
imageRef: R,
|
|
281
283
|
maxWidth: f,
|
|
282
284
|
showCaption: c,
|
|
283
285
|
caption: p,
|
|
284
286
|
isCollabActive: !1,
|
|
285
|
-
historyState:
|
|
286
|
-
showNestedEditorTreeView:
|
|
287
|
-
t:
|
|
287
|
+
historyState: U,
|
|
288
|
+
showNestedEditorTreeView: _,
|
|
289
|
+
t: E
|
|
288
290
|
}
|
|
289
291
|
)
|
|
290
292
|
}
|
|
291
293
|
);
|
|
292
294
|
}
|
|
293
295
|
export {
|
|
294
|
-
|
|
296
|
+
Se as default
|
|
295
297
|
};
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { l as Y, A as D, e as M } from "./layers.BngaRys_.js";
|
|
2
|
+
import "./layers.C2f7uCzl.js";
|
|
3
|
+
import "lodash-es/memoize.js";
|
|
4
|
+
import "lodash-es/merge.js";
|
|
5
|
+
import "lodash-es/isEmpty.js";
|
|
6
|
+
var O = (function() {
|
|
7
|
+
var a = function(u, t, e, n) {
|
|
8
|
+
for (e = e || {}, n = u.length; n--; e[u[n]] = t)
|
|
9
|
+
;
|
|
10
|
+
return e;
|
|
11
|
+
}, f = [6, 9, 10], m = {
|
|
12
|
+
trace: function() {
|
|
13
|
+
},
|
|
14
|
+
yy: {},
|
|
15
|
+
symbols_: { error: 2, start: 3, info: 4, document: 5, EOF: 6, line: 7, statement: 8, NL: 9, showInfo: 10, $accept: 0, $end: 1 },
|
|
16
|
+
terminals_: { 2: "error", 4: "info", 6: "EOF", 9: "NL", 10: "showInfo" },
|
|
17
|
+
productions_: [0, [3, 3], [5, 0], [5, 2], [7, 1], [7, 1], [8, 1]],
|
|
18
|
+
performAction: function(t, e, n, s, r, i, d) {
|
|
19
|
+
switch (i.length - 1, r) {
|
|
20
|
+
case 1:
|
|
21
|
+
return s;
|
|
22
|
+
case 4:
|
|
23
|
+
break;
|
|
24
|
+
case 6:
|
|
25
|
+
s.setInfo(!0);
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, a(f, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: 6, 9: [1, 7], 10: [1, 8] }, { 1: [2, 1] }, a(f, [2, 3]), a(f, [2, 4]), a(f, [2, 5]), a(f, [2, 6])],
|
|
30
|
+
defaultActions: { 4: [2, 1] },
|
|
31
|
+
parseError: function(t, e) {
|
|
32
|
+
if (e.recoverable)
|
|
33
|
+
this.trace(t);
|
|
34
|
+
else {
|
|
35
|
+
var n = new Error(t);
|
|
36
|
+
throw n.hash = e, n;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
parse: function(t) {
|
|
40
|
+
var e = this, n = [0], s = [], r = [null], i = [], d = this.table, P = "", v = 0, L = 0, N = 2, T = 1, R = i.slice.call(arguments, 1), o = Object.create(this.lexer), p = { yy: {} };
|
|
41
|
+
for (var E in this.yy)
|
|
42
|
+
Object.prototype.hasOwnProperty.call(this.yy, E) && (p.yy[E] = this.yy[E]);
|
|
43
|
+
o.setInput(t, p.yy), p.yy.lexer = o, p.yy.parser = this, typeof o.yylloc > "u" && (o.yylloc = {});
|
|
44
|
+
var I = o.yylloc;
|
|
45
|
+
i.push(I);
|
|
46
|
+
var z = o.options && o.options.ranges;
|
|
47
|
+
typeof p.yy.parseError == "function" ? this.parseError = p.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
48
|
+
function U() {
|
|
49
|
+
var y;
|
|
50
|
+
return y = s.pop() || o.lex() || T, typeof y != "number" && (y instanceof Array && (s = y, y = s.pop()), y = e.symbols_[y] || y), y;
|
|
51
|
+
}
|
|
52
|
+
for (var l, g, h, w, _ = {}, b, c, F, S; ; ) {
|
|
53
|
+
if (g = n[n.length - 1], this.defaultActions[g] ? h = this.defaultActions[g] : ((l === null || typeof l > "u") && (l = U()), h = d[g] && d[g][l]), typeof h > "u" || !h.length || !h[0]) {
|
|
54
|
+
var A = "";
|
|
55
|
+
S = [];
|
|
56
|
+
for (b in d[g])
|
|
57
|
+
this.terminals_[b] && b > N && S.push("'" + this.terminals_[b] + "'");
|
|
58
|
+
o.showPosition ? A = "Parse error on line " + (v + 1) + `:
|
|
59
|
+
` + o.showPosition() + `
|
|
60
|
+
Expecting ` + S.join(", ") + ", got '" + (this.terminals_[l] || l) + "'" : A = "Parse error on line " + (v + 1) + ": Unexpected " + (l == T ? "end of input" : "'" + (this.terminals_[l] || l) + "'"), this.parseError(A, {
|
|
61
|
+
text: o.match,
|
|
62
|
+
token: this.terminals_[l] || l,
|
|
63
|
+
line: o.yylineno,
|
|
64
|
+
loc: I,
|
|
65
|
+
expected: S
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (h[0] instanceof Array && h.length > 1)
|
|
69
|
+
throw new Error("Parse Error: multiple actions possible at state: " + g + ", token: " + l);
|
|
70
|
+
switch (h[0]) {
|
|
71
|
+
case 1:
|
|
72
|
+
n.push(l), r.push(o.yytext), i.push(o.yylloc), n.push(h[1]), l = null, L = o.yyleng, P = o.yytext, v = o.yylineno, I = o.yylloc;
|
|
73
|
+
break;
|
|
74
|
+
case 2:
|
|
75
|
+
if (c = this.productions_[h[1]][1], _.$ = r[r.length - c], _._$ = {
|
|
76
|
+
first_line: i[i.length - (c || 1)].first_line,
|
|
77
|
+
last_line: i[i.length - 1].last_line,
|
|
78
|
+
first_column: i[i.length - (c || 1)].first_column,
|
|
79
|
+
last_column: i[i.length - 1].last_column
|
|
80
|
+
}, z && (_._$.range = [
|
|
81
|
+
i[i.length - (c || 1)].range[0],
|
|
82
|
+
i[i.length - 1].range[1]
|
|
83
|
+
]), w = this.performAction.apply(_, [
|
|
84
|
+
P,
|
|
85
|
+
L,
|
|
86
|
+
v,
|
|
87
|
+
p.yy,
|
|
88
|
+
h[1],
|
|
89
|
+
r,
|
|
90
|
+
i
|
|
91
|
+
].concat(R)), typeof w < "u")
|
|
92
|
+
return w;
|
|
93
|
+
c && (n = n.slice(0, -1 * c * 2), r = r.slice(0, -1 * c), i = i.slice(0, -1 * c)), n.push(this.productions_[h[1]][0]), r.push(_.$), i.push(_._$), F = d[n[n.length - 2]][n[n.length - 1]], n.push(F);
|
|
94
|
+
break;
|
|
95
|
+
case 3:
|
|
96
|
+
return !0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return !0;
|
|
100
|
+
}
|
|
101
|
+
}, k = /* @__PURE__ */ (function() {
|
|
102
|
+
var u = {
|
|
103
|
+
EOF: 1,
|
|
104
|
+
parseError: function(e, n) {
|
|
105
|
+
if (this.yy.parser)
|
|
106
|
+
this.yy.parser.parseError(e, n);
|
|
107
|
+
else
|
|
108
|
+
throw new Error(e);
|
|
109
|
+
},
|
|
110
|
+
// resets the lexer, sets new input
|
|
111
|
+
setInput: function(t, e) {
|
|
112
|
+
return this.yy = e || this.yy || {}, this._input = t, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
113
|
+
first_line: 1,
|
|
114
|
+
first_column: 0,
|
|
115
|
+
last_line: 1,
|
|
116
|
+
last_column: 0
|
|
117
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
118
|
+
},
|
|
119
|
+
// consumes and returns one char from the input
|
|
120
|
+
input: function() {
|
|
121
|
+
var t = this._input[0];
|
|
122
|
+
this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t;
|
|
123
|
+
var e = t.match(/(?:\r\n?|\n).*/g);
|
|
124
|
+
return e ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t;
|
|
125
|
+
},
|
|
126
|
+
// unshifts one char (or a string) into the input
|
|
127
|
+
unput: function(t) {
|
|
128
|
+
var e = t.length, n = t.split(/(?:\r\n?|\n)/g);
|
|
129
|
+
this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - e), this.offset -= e;
|
|
130
|
+
var s = this.match.split(/(?:\r\n?|\n)/g);
|
|
131
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
|
|
132
|
+
var r = this.yylloc.range;
|
|
133
|
+
return this.yylloc = {
|
|
134
|
+
first_line: this.yylloc.first_line,
|
|
135
|
+
last_line: this.yylineno + 1,
|
|
136
|
+
first_column: this.yylloc.first_column,
|
|
137
|
+
last_column: n ? (n.length === s.length ? this.yylloc.first_column : 0) + s[s.length - n.length].length - n[0].length : this.yylloc.first_column - e
|
|
138
|
+
}, this.options.ranges && (this.yylloc.range = [r[0], r[0] + this.yyleng - e]), this.yyleng = this.yytext.length, this;
|
|
139
|
+
},
|
|
140
|
+
// When called from action, caches matched text and appends it on next action
|
|
141
|
+
more: function() {
|
|
142
|
+
return this._more = !0, this;
|
|
143
|
+
},
|
|
144
|
+
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
|
145
|
+
reject: function() {
|
|
146
|
+
if (this.options.backtrack_lexer)
|
|
147
|
+
this._backtrack = !0;
|
|
148
|
+
else
|
|
149
|
+
return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
150
|
+
` + this.showPosition(), {
|
|
151
|
+
text: "",
|
|
152
|
+
token: null,
|
|
153
|
+
line: this.yylineno
|
|
154
|
+
});
|
|
155
|
+
return this;
|
|
156
|
+
},
|
|
157
|
+
// retain first n characters of the match
|
|
158
|
+
less: function(t) {
|
|
159
|
+
this.unput(this.match.slice(t));
|
|
160
|
+
},
|
|
161
|
+
// displays already matched input, i.e. for error messages
|
|
162
|
+
pastInput: function() {
|
|
163
|
+
var t = this.matched.substr(0, this.matched.length - this.match.length);
|
|
164
|
+
return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "");
|
|
165
|
+
},
|
|
166
|
+
// displays upcoming input, i.e. for error messages
|
|
167
|
+
upcomingInput: function() {
|
|
168
|
+
var t = this.match;
|
|
169
|
+
return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
170
|
+
},
|
|
171
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
172
|
+
showPosition: function() {
|
|
173
|
+
var t = this.pastInput(), e = new Array(t.length + 1).join("-");
|
|
174
|
+
return t + this.upcomingInput() + `
|
|
175
|
+
` + e + "^";
|
|
176
|
+
},
|
|
177
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
178
|
+
test_match: function(t, e) {
|
|
179
|
+
var n, s, r;
|
|
180
|
+
if (this.options.backtrack_lexer && (r = {
|
|
181
|
+
yylineno: this.yylineno,
|
|
182
|
+
yylloc: {
|
|
183
|
+
first_line: this.yylloc.first_line,
|
|
184
|
+
last_line: this.last_line,
|
|
185
|
+
first_column: this.yylloc.first_column,
|
|
186
|
+
last_column: this.yylloc.last_column
|
|
187
|
+
},
|
|
188
|
+
yytext: this.yytext,
|
|
189
|
+
match: this.match,
|
|
190
|
+
matches: this.matches,
|
|
191
|
+
matched: this.matched,
|
|
192
|
+
yyleng: this.yyleng,
|
|
193
|
+
offset: this.offset,
|
|
194
|
+
_more: this._more,
|
|
195
|
+
_input: this._input,
|
|
196
|
+
yy: this.yy,
|
|
197
|
+
conditionStack: this.conditionStack.slice(0),
|
|
198
|
+
done: this.done
|
|
199
|
+
}, this.options.ranges && (r.yylloc.range = this.yylloc.range.slice(0))), s = t[0].match(/(?:\r\n?|\n).*/g), s && (this.yylineno += s.length), this.yylloc = {
|
|
200
|
+
first_line: this.yylloc.last_line,
|
|
201
|
+
last_line: this.yylineno + 1,
|
|
202
|
+
first_column: this.yylloc.last_column,
|
|
203
|
+
last_column: s ? s[s.length - 1].length - s[s.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
|
|
204
|
+
}, this.yytext += t[0], this.match += t[0], this.matches = t, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(t[0].length), this.matched += t[0], n = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n)
|
|
205
|
+
return n;
|
|
206
|
+
if (this._backtrack) {
|
|
207
|
+
for (var i in r)
|
|
208
|
+
this[i] = r[i];
|
|
209
|
+
return !1;
|
|
210
|
+
}
|
|
211
|
+
return !1;
|
|
212
|
+
},
|
|
213
|
+
// return next match in input
|
|
214
|
+
next: function() {
|
|
215
|
+
if (this.done)
|
|
216
|
+
return this.EOF;
|
|
217
|
+
this._input || (this.done = !0);
|
|
218
|
+
var t, e, n, s;
|
|
219
|
+
this._more || (this.yytext = "", this.match = "");
|
|
220
|
+
for (var r = this._currentRules(), i = 0; i < r.length; i++)
|
|
221
|
+
if (n = this._input.match(this.rules[r[i]]), n && (!e || n[0].length > e[0].length)) {
|
|
222
|
+
if (e = n, s = i, this.options.backtrack_lexer) {
|
|
223
|
+
if (t = this.test_match(n, r[i]), t !== !1)
|
|
224
|
+
return t;
|
|
225
|
+
if (this._backtrack) {
|
|
226
|
+
e = !1;
|
|
227
|
+
continue;
|
|
228
|
+
} else
|
|
229
|
+
return !1;
|
|
230
|
+
} else if (!this.options.flex)
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
return e ? (t = this.test_match(e, r[s]), t !== !1 ? t : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
234
|
+
` + this.showPosition(), {
|
|
235
|
+
text: "",
|
|
236
|
+
token: null,
|
|
237
|
+
line: this.yylineno
|
|
238
|
+
});
|
|
239
|
+
},
|
|
240
|
+
// return next match that has a token
|
|
241
|
+
lex: function() {
|
|
242
|
+
var e = this.next();
|
|
243
|
+
return e || this.lex();
|
|
244
|
+
},
|
|
245
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
246
|
+
begin: function(e) {
|
|
247
|
+
this.conditionStack.push(e);
|
|
248
|
+
},
|
|
249
|
+
// pop the previously active lexer condition state off the condition stack
|
|
250
|
+
popState: function() {
|
|
251
|
+
var e = this.conditionStack.length - 1;
|
|
252
|
+
return e > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
253
|
+
},
|
|
254
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
255
|
+
_currentRules: function() {
|
|
256
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
257
|
+
},
|
|
258
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
259
|
+
topState: function(e) {
|
|
260
|
+
return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
|
|
261
|
+
},
|
|
262
|
+
// alias for begin(condition)
|
|
263
|
+
pushState: function(e) {
|
|
264
|
+
this.begin(e);
|
|
265
|
+
},
|
|
266
|
+
// return the number of states currently on the stack
|
|
267
|
+
stateStackSize: function() {
|
|
268
|
+
return this.conditionStack.length;
|
|
269
|
+
},
|
|
270
|
+
options: { "case-insensitive": !0 },
|
|
271
|
+
performAction: function(e, n, s, r) {
|
|
272
|
+
switch (s) {
|
|
273
|
+
case 0:
|
|
274
|
+
return 4;
|
|
275
|
+
case 1:
|
|
276
|
+
return 9;
|
|
277
|
+
case 2:
|
|
278
|
+
return "space";
|
|
279
|
+
case 3:
|
|
280
|
+
return 10;
|
|
281
|
+
case 4:
|
|
282
|
+
return 6;
|
|
283
|
+
case 5:
|
|
284
|
+
return "TXT";
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
rules: [/^(?:info\b)/i, /^(?:[\s\n\r]+)/i, /^(?:[\s]+)/i, /^(?:showInfo\b)/i, /^(?:$)/i, /^(?:.)/i],
|
|
288
|
+
conditions: { INITIAL: { rules: [0, 1, 2, 3, 4, 5], inclusive: !0 } }
|
|
289
|
+
};
|
|
290
|
+
return u;
|
|
291
|
+
})();
|
|
292
|
+
m.lexer = k;
|
|
293
|
+
function x() {
|
|
294
|
+
this.yy = {};
|
|
295
|
+
}
|
|
296
|
+
return x.prototype = m, m.Parser = x, new x();
|
|
297
|
+
})();
|
|
298
|
+
O.parser = O;
|
|
299
|
+
const B = O, j = {
|
|
300
|
+
info: !1
|
|
301
|
+
};
|
|
302
|
+
let $ = j.info;
|
|
303
|
+
const V = (a) => {
|
|
304
|
+
$ = a;
|
|
305
|
+
}, X = () => $, q = () => {
|
|
306
|
+
$ = j.info;
|
|
307
|
+
}, C = {
|
|
308
|
+
clear: q,
|
|
309
|
+
setInfo: V,
|
|
310
|
+
getInfo: X
|
|
311
|
+
}, G = (a, f, m) => {
|
|
312
|
+
Y.debug(`rendering info diagram
|
|
313
|
+
` + a);
|
|
314
|
+
const k = D(f);
|
|
315
|
+
M(k, 100, 400, !0), k.append("g").append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${m}`);
|
|
316
|
+
}, H = { draw: G }, tt = {
|
|
317
|
+
parser: B,
|
|
318
|
+
db: C,
|
|
319
|
+
renderer: H
|
|
320
|
+
};
|
|
321
|
+
export {
|
|
322
|
+
tt as diagram
|
|
323
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const m=require("lodash-es");function b(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const r=b(m);var y="\0",u="\0",f="";class c{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[u]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return r.keys(this._nodes)}sources(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._in[t])})}sinks(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._out[t])})}setNodes(e,t){var s=arguments,i=this;return r.each(e,function(n){s.length>1?i.setNode(n,t):i.setNode(n)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=u,this._children[e]={},this._children[u][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),s=>{this.setParent(s)}),delete this._children[e]),r.each(r.keys(this._in[e]),t),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=u;else{t+="";for(var s=t;!r.isUndefined(s);s=this.parent(s))if(s===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==u)return t}}children(e){if(r.isUndefined(e)&&(e=u),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===u)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return r.keys(t)}successors(e){var t=this._sucs[e];if(t)return r.keys(t)}neighbors(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var s=this;r.each(this._nodes,function(h,d){e(d)&&t.setNode(d,h)}),r.each(this._edgeObjs,function(h){t.hasNode(h.v)&&t.hasNode(h.w)&&t.setEdge(h,s.edge(h))});var i={};function n(h){var d=s.parent(h);return d===void 0||t.hasNode(d)?(i[h]=d,d):d in i?i[d]:n(d)}return this._isCompound&&r.each(t.nodes(),function(h){t.setParent(h,n(h))}),t}setDefaultEdgeLabel(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return r.values(this._edgeObjs)}setPath(e,t){var s=this,i=arguments;return r.reduce(e,function(n,h){return i.length>1?s.setEdge(n,h,t):s.setEdge(n,h),h}),this}setEdge(){var e,t,s,i,n=!1,h=arguments[0];typeof h=="object"&&h!==null&&"v"in h?(e=h.v,t=h.w,s=h.name,arguments.length===2&&(i=arguments[1],n=!0)):(e=h,t=arguments[1],s=arguments[3],arguments.length>2&&(i=arguments[2],n=!0)),e=""+e,t=""+t,r.isUndefined(s)||(s=""+s);var d=l(this._isDirected,e,t,s);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,d))return n&&(this._edgeLabels[d]=i),this;if(!r.isUndefined(s)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[d]=n?i:this._defaultEdgeLabelFn(e,t,s);var a=O(this._isDirected,e,t,s);return e=a.v,t=a.w,Object.freeze(a),this._edgeObjs[d]=a,g(this._preds[t],e),g(this._sucs[e],t),this._in[t][d]=a,this._out[e][d]=a,this._edgeCount++,this}edge(e,t,s){var i=arguments.length===1?_(this._isDirected,arguments[0]):l(this._isDirected,e,t,s);return this._edgeLabels[i]}hasEdge(e,t,s){var i=arguments.length===1?_(this._isDirected,arguments[0]):l(this._isDirected,e,t,s);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,t,s){var i=arguments.length===1?_(this._isDirected,arguments[0]):l(this._isDirected,e,t,s),n=this._edgeObjs[i];return n&&(e=n.v,t=n.w,delete this._edgeLabels[i],delete this._edgeObjs[i],p(this._preds[t],e),p(this._sucs[e],t),delete this._in[t][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,t){var s=this._in[e];if(s){var i=r.values(s);return t?r.filter(i,function(n){return n.v===t}):i}}outEdges(e,t){var s=this._out[e];if(s){var i=r.values(s);return t?r.filter(i,function(n){return n.w===t}):i}}nodeEdges(e,t){var s=this.inEdges(e,t);if(s)return s.concat(this.outEdges(e,t))}}c.prototype._nodeCount=0;c.prototype._edgeCount=0;function g(o,e){o[e]?o[e]++:o[e]=1}function p(o,e){--o[e]||delete o[e]}function l(o,e,t,s){var i=""+e,n=""+t;if(!o&&i>n){var h=i;i=n,n=h}return i+f+n+f+(r.isUndefined(s)?y:s)}function O(o,e,t,s){var i=""+e,n=""+t;if(!o&&i>n){var h=i;i=n,n=h}var d={v:i,w:n};return s&&(d.name=s),d}function _(o,e){return l(o,e.v,e.w,e.name)}exports.Graph=c;
|