integration-modules 0.1.4 → 0.1.6
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/assets/integration-modules-BCtq75x-.css +1 -0
- package/dist/chunks/Board-CoDGhH3-.js +19436 -0
- package/dist/chunks/Board-CoDGhH3-.js.map +1 -0
- package/dist/chunks/Board-wlHU_0oT.cjs +38 -0
- package/dist/chunks/Board-wlHU_0oT.cjs.map +1 -0
- package/dist/chunks/EmojiBoardWidget-BA5Xt9cs.cjs +2 -0
- package/dist/chunks/EmojiBoardWidget-BA5Xt9cs.cjs.map +1 -0
- package/dist/chunks/EmojiBoardWidget-C-Uhinz6.js +191 -0
- package/dist/chunks/EmojiBoardWidget-C-Uhinz6.js.map +1 -0
- package/dist/chunks/ShapeBoardWidget-0JrJFCZl.js +155 -0
- package/dist/chunks/ShapeBoardWidget-0JrJFCZl.js.map +1 -0
- package/dist/chunks/ShapeBoardWidget-BKEMVbRg.cjs +2 -0
- package/dist/chunks/ShapeBoardWidget-BKEMVbRg.cjs.map +1 -0
- package/dist/emoji/index.cjs +2 -1
- package/dist/emoji/index.cjs.map +1 -0
- package/dist/emoji/index.js +5 -3
- package/dist/emoji/index.js.map +1 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +190 -327
- package/dist/index.mjs.map +1 -0
- package/dist/shape/index.cjs +2 -0
- package/dist/shape/index.cjs.map +1 -0
- package/dist/shape/index.js +6 -0
- package/dist/shape/index.js.map +1 -0
- package/package.json +5 -1
- package/dist/EmojiBoardWidget-BSJXzLd_.js +0 -25630
- package/dist/EmojiBoardWidget-Cm305IEM.cjs +0 -43
- package/dist/integration-modules.css +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { j as a, u as p, B as F, n as j, N as L, h as M, m as S, r as N } from "./chunks/Board-CoDGhH3-.js";
|
|
2
|
+
import { i as q } from "./chunks/Board-CoDGhH3-.js";
|
|
3
|
+
import { E as K, e as Q } from "./chunks/EmojiBoardWidget-C-Uhinz6.js";
|
|
4
|
+
import y, { useState as g, useRef as x, useEffect as k } from "react";
|
|
5
|
+
import { S as t2, s as e2 } from "./chunks/ShapeBoardWidget-0JrJFCZl.js";
|
|
6
|
+
const Z = "application/x-integration-note", H = [
|
|
5
7
|
"#FFF79A",
|
|
6
8
|
"#FFD7A6",
|
|
7
9
|
"#FFD1F2",
|
|
@@ -14,465 +16,326 @@ const V = "application/x-integration-note", E = [
|
|
|
14
16
|
"#68DF8B",
|
|
15
17
|
"#FFFFFF",
|
|
16
18
|
"#262626"
|
|
17
|
-
],
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
},
|
|
19
|
+
], V = ({ onPick: s }) => {
|
|
20
|
+
const i = (n) => () => {
|
|
21
|
+
s && s(n);
|
|
22
|
+
}, l = (n) => (c) => {
|
|
21
23
|
c.stopPropagation();
|
|
22
24
|
try {
|
|
23
|
-
c.dataTransfer.setData(
|
|
24
|
-
} catch (
|
|
25
|
-
console.warn("Не удалось начать перенос заметки:",
|
|
25
|
+
c.dataTransfer.setData(Z, JSON.stringify({ color: n })), c.dataTransfer.effectAllowed = "copy";
|
|
26
|
+
} catch (t) {
|
|
27
|
+
console.warn("Не удалось начать перенос заметки:", t);
|
|
26
28
|
}
|
|
27
29
|
};
|
|
28
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ a.jsx("div", { className: "palette-panel--large", role: "dialog", "aria-label": "Палитра", children: /* @__PURE__ */ a.jsx("div", { className: "palette-grid", children: H.map((n) => /* @__PURE__ */ a.jsx(
|
|
29
31
|
"button",
|
|
30
32
|
{
|
|
31
33
|
type: "button",
|
|
32
34
|
className: "color-swatch color-swatch--large",
|
|
33
35
|
title: n,
|
|
34
36
|
style: { background: n },
|
|
35
|
-
onClick:
|
|
37
|
+
onClick: i(n),
|
|
36
38
|
draggable: !0,
|
|
37
|
-
onDragStart:
|
|
39
|
+
onDragStart: l(n)
|
|
38
40
|
},
|
|
39
41
|
n
|
|
40
42
|
)) }) });
|
|
41
|
-
},
|
|
42
|
-
const [
|
|
43
|
-
|
|
43
|
+
}, W = "data:image/svg+xml,%3csvg%20width='58'%20height='53'%20viewBox='0%200%2058%2053'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%204.5C1.5%202.84315%202.84315%201.5%204.5%201.5H52.8237C54.4806%201.5%2055.8237%202.84315%2055.8237%204.5V26.2263C55.8237%2040.0334%2044.6308%2051.2263%2030.8237%2051.2263H4.5C2.84315%2051.2263%201.5%2049.8832%201.5%2048.2263V4.5Z'%20stroke='black'%20stroke-width='3'/%3e%3cpath%20d='M35.0601%2031.2097C34.7425%2031.0584%2034.3739%2030.9988%2033.9426%2031.1381L33.7534%2031.2097L33.7524%2031.2107C33.5121%2031.3184%2033.3222%2031.459%2033.2417%2031.6573C33.1549%2031.8715%2033.2259%2032.0712%2033.3187%2032.2156C33.4103%2032.3579%2033.5466%2032.4867%2033.6731%2032.5948C33.7936%2032.6977%2033.9493%2032.8164%2034.0458%2032.896C36.3535%2034.7931%2039.159%2036.2031%2043.164%2036.228L43.163%2036.229C47.4558%2036.378%2051.4539%2036.0058%2054.6019%2034.0582C55.1353%2033.7296%2055.6664%2033.348%2056.0128%2032.9039L56.0118%2032.9029C56.1048%2032.7875%2056.2271%2032.5829%2056.1927%2032.3439C56.1537%2032.0744%2055.9392%2031.8802%2055.6031%2031.7644L55.4249%2031.7188C55.2448%2031.6873%2055.0608%2031.6962%2054.8946%2031.7229C54.6708%2031.7588%2054.4593%2031.8298%2054.2959%2031.903L54.2969%2031.9031C53.9148%2032.0702%2053.565%2032.2641%2053.2255%2032.4511C52.8827%2032.6399%2052.5495%2032.8224%2052.1866%2032.9789L52.1856%2032.9789C48.701%2034.4994%2044.8566%2034.9504%2040.6985%2034.1745L40.6985%2034.1736C38.6283%2033.7916%2037.1913%2032.8572%2035.9052%2031.8179L35.9042%2031.8169C35.6881%2031.6444%2035.3972%2031.3703%2035.0601%2031.2097Z'%20fill='black'%20stroke='black'%20stroke-width='0.5'/%3e%3cpath%20d='M33.3199%2032.0092C33.3711%2031.784%2033.5023%2031.5723%2033.7172%2031.3748L33.7186%2031.3732C33.9351%2031.1771%2034.16%2031.0665%2034.3932%2031.0561C34.6255%2031.0457%2034.8211%2031.1371%2034.9778%2031.2547C35.1328%2031.3711%2035.2665%2031.5255%2035.3799%2031.6731L35.6886%2032.0981C37.637%2034.7374%2038.8375%2037.7048%2037.8721%2041.3534C37.0056%2045.2765%2035.513%2048.7857%2032.1275%2051.0424C31.5557%2051.4251%2030.9218%2051.7831%2030.2602%2051.9579C30.0886%2052.0063%2029.8315%2052.042%2029.586%2051.9604C29.3206%2051.8722%2029.1054%2051.659%2029.0272%2051.288L29.0119%2051.1918C28.9909%2050.9686%2029.0611%2050.7564%2029.156%2050.581C29.2641%2050.3813%2029.4161%2050.208%2029.5556%2050.081C29.8749%2049.7851%2030.2219%2049.5259%2030.5549%2049.2766C30.8073%2049.0875%2031.0527%2048.9034%2031.2845%2048.7058L31.5119%2048.5028L31.5131%2048.5021C34.3886%2045.833%2035.9263%2042.5303%2035.9218%2038.5803L35.9211%2038.5791C35.9245%2036.6231%2035.0456%2035.0563%2033.9747%2033.5785L33.9739%2033.5773C33.9268%2033.5114%2033.8755%2033.4438%2033.821%2033.3711C33.7673%2033.2995%2033.7113%2033.2234%2033.6569%2033.1455C33.5491%2032.9909%2033.4413%2032.8178%2033.3724%2032.6319C33.3026%2032.4439%2033.2691%2032.2329%2033.3199%2032.0092Z'%20fill='black'%20stroke='black'%20stroke-width='0.5'/%3e%3c/svg%3e", I = "data:image/svg+xml,%3csvg%20width='58'%20height='53'%20viewBox='0%200%2058%2053'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%204.5C1.5%202.84315%202.84315%201.5%204.5%201.5H52.8237C54.4806%201.5%2055.8237%202.84315%2055.8237%204.5V26.2263C55.8237%2040.0334%2044.6308%2051.2263%2030.8237%2051.2263H4.5C2.84315%2051.2263%201.5%2049.8832%201.5%2048.2263V4.5Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3cpath%20d='M35.0599%2031.2098C34.7423%2031.0585%2034.3737%2030.9989%2033.9424%2031.1382L33.7532%2031.2097L33.7522%2031.2107C33.5119%2031.3185%2033.3221%2031.459%2033.2415%2031.6573C33.1547%2031.8716%2033.2257%2032.0713%2033.3185%2032.2156C33.4101%2032.3579%2033.5464%2032.4868%2033.6729%2032.5948C33.7935%2032.6977%2033.9491%2032.8165%2034.0457%2032.896C36.3533%2034.7932%2039.1588%2036.2031%2043.1638%2036.2281L43.1628%2036.229C47.4556%2036.3781%2051.4537%2036.0059%2054.6017%2034.0583C55.1351%2033.7297%2055.6662%2033.3481%2056.0126%2032.9039L56.0117%2032.9029C56.1047%2032.7876%2056.2269%2032.5829%2056.1925%2032.344C56.1535%2032.0744%2055.939%2031.8803%2055.603%2031.7645L55.4247%2031.7189C55.2446%2031.6874%2055.0607%2031.6962%2054.8944%2031.7229C54.6706%2031.7589%2054.4592%2031.8298%2054.2957%2031.9031L54.2967%2031.9031C53.9146%2032.0702%2053.5648%2032.2642%2053.2253%2032.4511C52.8825%2032.6399%2052.5493%2032.8225%2052.1864%2032.9789L52.1854%2032.9789C48.7008%2034.4994%2044.8564%2034.9504%2040.6983%2034.1746L40.6984%2034.1736C38.6281%2033.7917%2037.1911%2032.8573%2035.905%2031.818L35.904%2031.817C35.688%2031.6445%2035.397%2031.3704%2035.0599%2031.2098Z'%20fill='%230000FF'%20stroke='%230000FF'%20stroke-width='0.5'/%3e%3cpath%20d='M33.32%2032.0091C33.3712%2031.7839%2033.5024%2031.5722%2033.7173%2031.3747L33.7188%2031.373C33.9352%2031.177%2034.1602%2031.0664%2034.3934%2031.056C34.6256%2031.0456%2034.8213%2031.137%2034.9779%2031.2546C35.1329%2031.371%2035.2666%2031.5254%2035.3801%2031.673L35.6888%2032.098C37.6372%2034.7373%2038.8377%2037.7047%2037.8722%2041.3533C37.0057%2045.2764%2035.5131%2048.7856%2032.1276%2051.0422C31.5558%2051.425%2030.9219%2051.783%2030.2604%2051.9578C30.0887%2052.0062%2029.8316%2052.0419%2029.5861%2051.9603C29.3207%2051.8721%2029.1055%2051.6589%2029.0273%2051.2879L29.012%2051.1917C28.9911%2050.9685%2029.0612%2050.7563%2029.1561%2050.5809C29.2643%2050.3812%2029.4162%2050.2079%2029.5557%2050.0809C29.875%2049.785%2030.222%2049.5258%2030.555%2049.2765C30.8075%2049.0874%2031.0529%2048.9032%2031.2846%2048.7057L31.512%2048.5027L31.5132%2048.502C34.3887%2045.8329%2035.9264%2042.5302%2035.9219%2038.5801L35.9212%2038.579C35.9246%2036.623%2035.0457%2035.0562%2033.9748%2033.5784L33.9741%2033.5772C33.927%2033.5113%2033.8756%2033.4437%2033.8211%2033.371C33.7674%2033.2994%2033.7114%2033.2233%2033.6571%2033.1454C33.5492%2032.9908%2033.4414%2032.8177%2033.3725%2032.6318C33.3028%2032.4437%2033.2692%2032.2328%2033.32%2032.0091Z'%20fill='%230000FF'%20stroke='%230000FF'%20stroke-width='0.5'/%3e%3c/svg%3e", B = ({ onPick: s }) => {
|
|
44
|
+
const [i, l] = g(!1), n = x(null), c = (t) => {
|
|
45
|
+
t.stopPropagation(), l((e) => !e);
|
|
44
46
|
};
|
|
45
|
-
return
|
|
46
|
-
if (!
|
|
47
|
-
const
|
|
48
|
-
n.current && !n.current.contains(
|
|
47
|
+
return k(() => {
|
|
48
|
+
if (!i) return;
|
|
49
|
+
const t = (e) => {
|
|
50
|
+
n.current && !n.current.contains(e.target) && l(!1);
|
|
49
51
|
};
|
|
50
|
-
return window.addEventListener("pointerdown",
|
|
51
|
-
}, [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
return window.addEventListener("pointerdown", t), () => window.removeEventListener("pointerdown", t);
|
|
53
|
+
}, [i]), /* @__PURE__ */ a.jsxs("div", { className: "left-toolbar-container dragHandle__custom", ref: n, onClick: (t) => t.stopPropagation(), children: [
|
|
54
|
+
/* @__PURE__ */ a.jsx("div", { className: `toolbar-card ${i ? "toolbar-card--open" : ""}`, children: /* @__PURE__ */ a.jsx("button", { onClick: c, className: `toolbar-btn toolbar-btn--icon toolbar-btn--note ${i ? "toolbar-btn--active" : ""}`, children: /* @__PURE__ */ a.jsx("div", { className: `toolbar-note-plate ${i ? "toolbar-note-plate--active" : ""}`, children: /* @__PURE__ */ a.jsx("img", { src: i ? I : W, alt: "Заметки", draggable: !1 }) }) }) }),
|
|
55
|
+
i && /* @__PURE__ */ a.jsx("div", { className: "palette-wrapper", onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a.jsx(V, { onPick: (t) => {
|
|
56
|
+
s?.(t), l(!1);
|
|
55
57
|
} }) })
|
|
56
58
|
] });
|
|
57
|
-
},
|
|
58
|
-
const
|
|
59
|
-
|
|
59
|
+
}, f = ({ children: s }) => /* @__PURE__ */ a.jsx("div", { children: s }), O = () => {
|
|
60
|
+
const s = p((o) => o.addSticker), i = p((o) => o.setStickers), l = x(null), [n, c] = g(() => f);
|
|
61
|
+
k(() => {
|
|
60
62
|
(async () => {
|
|
61
63
|
try {
|
|
62
|
-
const r = await
|
|
63
|
-
let h = 30,
|
|
64
|
-
const
|
|
65
|
-
for (const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
id:
|
|
64
|
+
const r = await j.getAll();
|
|
65
|
+
let h = 30, C = 30;
|
|
66
|
+
const w = [];
|
|
67
|
+
for (const d of r) {
|
|
68
|
+
const u = d.width ?? L, v = d.height ?? M;
|
|
69
|
+
w.push({
|
|
70
|
+
id: d.id,
|
|
69
71
|
x: h,
|
|
70
|
-
y:
|
|
71
|
-
color:
|
|
72
|
-
width:
|
|
73
|
-
height:
|
|
74
|
-
text:
|
|
72
|
+
y: C,
|
|
73
|
+
color: d.color,
|
|
74
|
+
width: u,
|
|
75
|
+
height: v,
|
|
76
|
+
text: d.content ?? "",
|
|
75
77
|
zIndex: 1
|
|
76
|
-
}), h += 24,
|
|
78
|
+
}), h += 24, C += 24;
|
|
77
79
|
}
|
|
78
|
-
|
|
80
|
+
i(w);
|
|
79
81
|
} catch (r) {
|
|
80
82
|
console.warn("Не удалось загрузить доску для заметок:", r);
|
|
81
83
|
}
|
|
82
84
|
})();
|
|
83
|
-
}, [
|
|
84
|
-
let
|
|
85
|
-
return import("
|
|
86
|
-
if (!
|
|
85
|
+
}, [i]), k(() => {
|
|
86
|
+
let o = !0;
|
|
87
|
+
return import("@xyflow/react").then((r) => {
|
|
88
|
+
if (!o) return;
|
|
87
89
|
const h = (r && (r.Widget || r.default || r?.widget || r?.XyflowWidget)) ?? null;
|
|
88
|
-
typeof h == "function" ||
|
|
90
|
+
typeof h == "function" || y.isValidElement(h) ? c(() => h) : c(() => f);
|
|
89
91
|
}).catch(() => {
|
|
90
|
-
|
|
92
|
+
o && c(() => f);
|
|
91
93
|
}), () => {
|
|
92
|
-
|
|
94
|
+
o = !1;
|
|
93
95
|
};
|
|
94
96
|
}, []);
|
|
95
|
-
const
|
|
97
|
+
const t = n || f, e = async (o) => {
|
|
96
98
|
try {
|
|
97
|
-
const r = await
|
|
98
|
-
if (
|
|
99
|
-
|
|
99
|
+
const r = await j.create(o, L, M), h = r.width ?? L, C = r.height ?? M;
|
|
100
|
+
if (l.current?.addStickerAtCenter) {
|
|
101
|
+
l.current.addStickerAtCenter(o, {
|
|
100
102
|
id: r.id,
|
|
101
103
|
text: r.content ?? "",
|
|
102
104
|
width: h,
|
|
103
|
-
height:
|
|
105
|
+
height: C
|
|
104
106
|
});
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
107
|
-
|
|
109
|
+
s({
|
|
108
110
|
id: r.id,
|
|
109
111
|
x: 260,
|
|
110
112
|
y: 120,
|
|
111
|
-
color:
|
|
113
|
+
color: o,
|
|
112
114
|
width: h,
|
|
113
|
-
height:
|
|
115
|
+
height: C,
|
|
114
116
|
text: r.content ?? ""
|
|
115
117
|
});
|
|
116
118
|
} catch (r) {
|
|
117
119
|
console.warn("Не удалось создать заметку:", r);
|
|
118
120
|
}
|
|
119
121
|
};
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ a.jsx(t, { children: /* @__PURE__ */ a.jsxs("div", { className: "relative flex h-screen w-screen bg-gray-100", children: [
|
|
123
|
+
/* @__PURE__ */ a.jsx(B, { onPick: e }),
|
|
124
|
+
/* @__PURE__ */ a.jsx(F, { ref: l })
|
|
123
125
|
] }) });
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
star: /* @__PURE__ */ t.jsx("svg", { width: "40", height: "40", children: /* @__PURE__ */ t.jsx(
|
|
129
|
-
"polygon",
|
|
130
|
-
{
|
|
131
|
-
points: "20,4 25,16 38,16 27,24 32,36 20,28 8,36 13,24 2,16 15,16",
|
|
132
|
-
stroke: "black",
|
|
133
|
-
fill: "none",
|
|
134
|
-
strokeWidth: "2"
|
|
135
|
-
}
|
|
136
|
-
) }),
|
|
137
|
-
stick: /* @__PURE__ */ t.jsx("svg", { width: "40", height: "40", children: /* @__PURE__ */ t.jsx("rect", { x: "16", y: "4", width: "8", height: "32", stroke: "black", fill: "none", strokeWidth: "2" }) }),
|
|
138
|
-
line: /* @__PURE__ */ t.jsx("svg", { width: "40", height: "40", children: /* @__PURE__ */ t.jsx("line", { x1: "4", y1: "20", x2: "36", y2: "20", stroke: "black", strokeWidth: "2" }) }),
|
|
139
|
-
arrow: /* @__PURE__ */ t.jsxs("svg", { width: "40", height: "40", children: [
|
|
140
|
-
/* @__PURE__ */ t.jsx("line", { x1: "4", y1: "20", x2: "30", y2: "20", stroke: "black", strokeWidth: "2" }),
|
|
141
|
-
/* @__PURE__ */ t.jsx("polygon", { points: "30,14 38,20 30,26", fill: "black" })
|
|
142
|
-
] }),
|
|
143
|
-
dblarrow: /* @__PURE__ */ t.jsxs("svg", { width: "40", height: "40", children: [
|
|
144
|
-
/* @__PURE__ */ t.jsx("polygon", { points: "4,20 12,14 12,26", fill: "black" }),
|
|
145
|
-
/* @__PURE__ */ t.jsx("line", { x1: "12", y1: "20", x2: "28", y2: "20", stroke: "black", strokeWidth: "2" }),
|
|
146
|
-
/* @__PURE__ */ t.jsx("polygon", { points: "28,14 36,20 28,26", fill: "black" })
|
|
147
|
-
] }),
|
|
148
|
-
parallelogram: /* @__PURE__ */ t.jsx("svg", { width: "40", height: "40", viewBox: "0 0 40 40", children: /* @__PURE__ */ t.jsx("polygon", { points: "8,8 34,8 26,32 0,32", stroke: "black", fill: "none", strokeWidth: "2" }) }),
|
|
149
|
-
roundedRect: /* @__PURE__ */ t.jsx("svg", { width: "40", height: "40", viewBox: "0 0 40 40", children: /* @__PURE__ */ t.jsx("rect", { x: "6", y: "10", width: "28", height: "20", rx: "4", ry: "4", stroke: "black", fill: "none", strokeWidth: "2" }) }),
|
|
150
|
-
capsule: /* @__PURE__ */ t.jsx("svg", { width: "40", height: "40", viewBox: "0 0 40 40", children: /* @__PURE__ */ t.jsx("rect", { x: "6", y: "14", width: "28", height: "12", rx: "6", ry: "6", stroke: "black", fill: "none", strokeWidth: "2" }) }),
|
|
151
|
-
pentagon: /* @__PURE__ */ t.jsx("svg", { width: "40", height: "40", viewBox: "0 0 40 40", children: /* @__PURE__ */ t.jsx("polygon", { points: "20,6 34,15 28,32 12,32 6,15", stroke: "black", fill: "none", strokeWidth: "2" }) }),
|
|
152
|
-
chevron: /* @__PURE__ */ t.jsx("svg", { width: "40", height: "40", viewBox: "0 0 100 100", children: /* @__PURE__ */ t.jsx(
|
|
153
|
-
"polyline",
|
|
154
|
-
{
|
|
155
|
-
points: "0,0 50,100 100,0",
|
|
156
|
-
fill: "none",
|
|
157
|
-
stroke: "black",
|
|
158
|
-
strokeWidth: "5"
|
|
159
|
-
}
|
|
160
|
-
) }),
|
|
161
|
-
table3x3: /* @__PURE__ */ t.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", children: [
|
|
162
|
-
/* @__PURE__ */ t.jsx("rect", { x: "4", y: "4", width: "32", height: "32", stroke: "black", fill: "none", strokeWidth: "2" }),
|
|
163
|
-
/* @__PURE__ */ t.jsx("line", { x1: "14", y1: "4", x2: "14", y2: "36", stroke: "black", strokeWidth: "2" }),
|
|
164
|
-
/* @__PURE__ */ t.jsx("line", { x1: "26", y1: "4", x2: "26", y2: "36", stroke: "black", strokeWidth: "2" }),
|
|
165
|
-
/* @__PURE__ */ t.jsx("line", { x1: "4", y1: "14", x2: "36", y2: "14", stroke: "black", strokeWidth: "2" }),
|
|
166
|
-
/* @__PURE__ */ t.jsx("line", { x1: "4", y1: "26", x2: "36", y2: "26", stroke: "black", strokeWidth: "2" })
|
|
167
|
-
] }),
|
|
168
|
-
pyramid: /* @__PURE__ */ t.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", children: [
|
|
169
|
-
/* @__PURE__ */ t.jsx("polygon", { points: "20,4 36,36 4,36", stroke: "black", fill: "none", strokeWidth: "2" }),
|
|
170
|
-
/* @__PURE__ */ t.jsx("line", { x1: "15", y1: "12", x2: "25", y2: "12", stroke: "black", strokeWidth: "2" }),
|
|
171
|
-
/* @__PURE__ */ t.jsx("line", { x1: "11", y1: "20", x2: "28", y2: "20", stroke: "black", strokeWidth: "2" }),
|
|
172
|
-
/* @__PURE__ */ t.jsx("line", { x1: "7", y1: "28", x2: "32", y2: "28", stroke: "black", strokeWidth: "2" })
|
|
173
|
-
] }),
|
|
174
|
-
circleArrow: /* @__PURE__ */ t.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", children: [
|
|
175
|
-
/* @__PURE__ */ t.jsx("circle", { cx: "20", cy: "20", r: "14", stroke: "black", fill: "none", strokeWidth: "2" }),
|
|
176
|
-
/* @__PURE__ */ t.jsx("line", { x1: "20", y1: "6", x2: "20", y2: "0", stroke: "black", strokeWidth: "2" }),
|
|
177
|
-
/* @__PURE__ */ t.jsx("polygon", { points: "18,2 22,2 20,0", fill: "black" })
|
|
178
|
-
] }),
|
|
179
|
-
table3x3LeftMerge: /* @__PURE__ */ t.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", children: [
|
|
180
|
-
/* @__PURE__ */ t.jsx("rect", { x: "4", y: "4", width: "32", height: "32", stroke: "black", fill: "none", strokeWidth: "2" }),
|
|
181
|
-
/* @__PURE__ */ t.jsx("line", { x1: "14", y1: "4", x2: "14", y2: "36", stroke: "black", strokeWidth: "2" }),
|
|
182
|
-
/* @__PURE__ */ t.jsx("line", { x1: "26", y1: "4", x2: "26", y2: "36", stroke: "black", strokeWidth: "2" }),
|
|
183
|
-
/* @__PURE__ */ t.jsx("line", { x1: "14", y1: "16", x2: "36", y2: "16", stroke: "black", strokeWidth: "2" }),
|
|
184
|
-
/* @__PURE__ */ t.jsx("line", { x1: "14", y1: "28", x2: "36", y2: "28", stroke: "black", strokeWidth: "2" })
|
|
185
|
-
] })
|
|
186
|
-
}, O = "data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e", _ = "data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e", z = () => {
|
|
187
|
-
const [o, l] = x(!1), d = C(null), n = (e) => {
|
|
188
|
-
e.stopPropagation(), l((s) => !s);
|
|
189
|
-
};
|
|
190
|
-
w(() => {
|
|
191
|
-
if (!o) return;
|
|
192
|
-
const e = (s) => {
|
|
193
|
-
d.current && !d.current.contains(s.target) && l(!1);
|
|
194
|
-
};
|
|
195
|
-
return window.addEventListener("pointerdown", e), () => window.removeEventListener("pointerdown", e);
|
|
196
|
-
}, [o]);
|
|
197
|
-
const c = (e) => (s) => {
|
|
198
|
-
s.stopPropagation(), s.dataTransfer.setData(A, JSON.stringify({ shapeId: e.id })), s.dataTransfer.effectAllowed = "copy";
|
|
199
|
-
};
|
|
200
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "left-toolbar-container dragHandle__custom", ref: d, onClick: (e) => e.stopPropagation(), children: [
|
|
201
|
-
/* @__PURE__ */ t.jsx("div", { className: `toolbar-card ${o ? "toolbar-card--open" : ""}`, children: /* @__PURE__ */ t.jsx("button", { onClick: n, className: `toolbar-btn toolbar-btn--icon toolbar-btn--shape ${o ? "toolbar-btn--active" : ""}`, children: /* @__PURE__ */ t.jsx("div", { className: `toolbar-shape-plate ${o ? "toolbar-shape-plate--active" : ""}`, children: /* @__PURE__ */ t.jsx("img", { src: o ? _ : O, alt: "Фигуры", draggable: !1 }) }) }) }),
|
|
202
|
-
o && /* @__PURE__ */ t.jsx("div", { className: "palette-wrapper", onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ t.jsx("div", { className: "shape-panel", children: /* @__PURE__ */ t.jsx("div", { className: "shape-grid", children: Z.map((e) => /* @__PURE__ */ t.jsx(
|
|
203
|
-
"button",
|
|
204
|
-
{
|
|
205
|
-
className: "shape-item",
|
|
206
|
-
draggable: !0,
|
|
207
|
-
onDragStart: c(e),
|
|
208
|
-
title: e.name,
|
|
209
|
-
children: T[e.id]
|
|
210
|
-
},
|
|
211
|
-
e.id
|
|
212
|
-
)) }) }) })
|
|
213
|
-
] });
|
|
214
|
-
}, v = ({ children: o }) => /* @__PURE__ */ t.jsx("div", { children: o }), e2 = () => {
|
|
215
|
-
const o = g((e) => e.setStickers), l = C(null), [d, n] = x(() => v);
|
|
216
|
-
w(() => {
|
|
217
|
-
(async () => {
|
|
126
|
+
}, E = "data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='black'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e", A = "data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='%230000FF'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e", R = () => {
|
|
127
|
+
const [s, i] = g(!1), l = p((t) => t.addSticker), n = p((t) => t.topZ), c = async () => {
|
|
128
|
+
if (!s) {
|
|
129
|
+
i(!0);
|
|
218
130
|
try {
|
|
219
|
-
const
|
|
220
|
-
F.getAll(),
|
|
221
|
-
F.getBoard()
|
|
222
|
-
]), r = new Map(s.map((i) => [String(i.id), i.shapeId]));
|
|
223
|
-
let h = 30, k = 30;
|
|
224
|
-
const p = [];
|
|
225
|
-
for (const i of a) {
|
|
226
|
-
const b = i.width ?? 140, f = i.height ?? 140, H = i.rotation ?? 0, I = r.get(String(i.shapeId)) ?? "square";
|
|
227
|
-
p.push({
|
|
228
|
-
id: i.id,
|
|
229
|
-
stickerId: i.id,
|
|
230
|
-
type: "shape",
|
|
231
|
-
shapeId: I,
|
|
232
|
-
shapeDbId: i.shapeId,
|
|
233
|
-
x: h,
|
|
234
|
-
y: k,
|
|
235
|
-
width: b,
|
|
236
|
-
height: f,
|
|
237
|
-
rotation: H,
|
|
238
|
-
zIndex: 1,
|
|
239
|
-
fill: "transparent",
|
|
240
|
-
stroke: "#000"
|
|
241
|
-
}), h += 24, k += 24;
|
|
242
|
-
}
|
|
243
|
-
o(p);
|
|
244
|
-
} catch (s) {
|
|
245
|
-
console.warn("Не удалось загрузить доску для фигур:", s);
|
|
246
|
-
}
|
|
247
|
-
})();
|
|
248
|
-
}, [o]), w(() => {
|
|
249
|
-
let e = !0;
|
|
250
|
-
return import("./EmojiBoardWidget-BSJXzLd_.js").then((s) => s.i).then((s) => {
|
|
251
|
-
if (!e) return;
|
|
252
|
-
const a = (s && (s.Widget || s.default || s?.widget || s?.XyflowWidget)) ?? null;
|
|
253
|
-
typeof a == "function" || W.isValidElement(a) ? n(() => a) : n(() => v);
|
|
254
|
-
}).catch(() => {
|
|
255
|
-
e && n(() => v);
|
|
256
|
-
}), () => {
|
|
257
|
-
e = !1;
|
|
258
|
-
};
|
|
259
|
-
}, []);
|
|
260
|
-
const c = d || v;
|
|
261
|
-
return /* @__PURE__ */ t.jsx(c, { children: /* @__PURE__ */ t.jsxs("div", { className: "relative flex h-screen w-screen bg-gray-100", children: [
|
|
262
|
-
/* @__PURE__ */ t.jsx(z, {}),
|
|
263
|
-
/* @__PURE__ */ t.jsx(j, { ref: l })
|
|
264
|
-
] }) });
|
|
265
|
-
}, X = "data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='black'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e", q = "data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='%230000FF'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e", J = () => {
|
|
266
|
-
const [o, l] = x(!1), d = g((e) => e.addSticker), n = g((e) => e.topZ), c = async () => {
|
|
267
|
-
if (!o) {
|
|
268
|
-
l(!0);
|
|
269
|
-
try {
|
|
270
|
-
const e = (n || 1) + 1, s = await N.create({
|
|
131
|
+
const t = (n || 1) + 1, e = await S.create({
|
|
271
132
|
content: `# Новый Markdown
|
|
272
133
|
|
|
273
134
|
Начните писать здесь...`,
|
|
274
135
|
width: 600,
|
|
275
136
|
height: 400,
|
|
276
137
|
isEditorVisible: !0
|
|
277
|
-
}),
|
|
278
|
-
|
|
279
|
-
id:
|
|
280
|
-
stickerId:
|
|
281
|
-
isEditorVisible:
|
|
138
|
+
}), o = window.innerWidth / 2 - 300, r = window.innerHeight / 2 - 200;
|
|
139
|
+
l({
|
|
140
|
+
id: e.id,
|
|
141
|
+
stickerId: e.markdownId,
|
|
142
|
+
isEditorVisible: e.isEditorVisible ?? !0,
|
|
282
143
|
type: "markdown",
|
|
283
|
-
x:
|
|
144
|
+
x: o,
|
|
284
145
|
y: r,
|
|
285
|
-
width:
|
|
286
|
-
height:
|
|
287
|
-
text:
|
|
288
|
-
zIndex:
|
|
146
|
+
width: e.width ?? 600,
|
|
147
|
+
height: e.height ?? 400,
|
|
148
|
+
text: e.content ?? "",
|
|
149
|
+
zIndex: t
|
|
289
150
|
});
|
|
290
|
-
} catch (
|
|
291
|
-
console.warn("Не удалось создать markdown блок:",
|
|
151
|
+
} catch (t) {
|
|
152
|
+
console.warn("Не удалось создать markdown блок:", t);
|
|
292
153
|
} finally {
|
|
293
|
-
|
|
154
|
+
i(!1);
|
|
294
155
|
}
|
|
295
156
|
}
|
|
296
157
|
};
|
|
297
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ a.jsx("div", { className: "left-toolbar-container", onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a.jsx("div", { className: "toolbar-card", children: /* @__PURE__ */ a.jsx(
|
|
298
159
|
"button",
|
|
299
160
|
{
|
|
300
161
|
onClick: c,
|
|
301
|
-
disabled:
|
|
302
|
-
className: `toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${
|
|
162
|
+
disabled: s,
|
|
163
|
+
className: `toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${s ? "toolbar-btn--active" : ""}`.trim(),
|
|
303
164
|
title: "Добавить Markdown блок",
|
|
304
|
-
children: /* @__PURE__ */
|
|
165
|
+
children: /* @__PURE__ */ a.jsx("div", { className: `toolbar-markdown-plate ${s ? "toolbar-markdown-plate--active" : ""}`, children: /* @__PURE__ */ a.jsx(
|
|
305
166
|
"img",
|
|
306
167
|
{
|
|
307
|
-
src:
|
|
168
|
+
src: s ? A : E,
|
|
308
169
|
alt: "Markdown",
|
|
309
170
|
draggable: !1
|
|
310
171
|
}
|
|
311
172
|
) })
|
|
312
173
|
}
|
|
313
174
|
) }) });
|
|
314
|
-
},
|
|
315
|
-
const
|
|
316
|
-
|
|
175
|
+
}, b = ({ children: s }) => /* @__PURE__ */ a.jsx("div", { children: s }), _ = () => {
|
|
176
|
+
const s = p((t) => t.setStickers), i = x(null), [l, n] = g(() => b);
|
|
177
|
+
k(() => {
|
|
317
178
|
(async () => {
|
|
318
179
|
try {
|
|
319
|
-
const
|
|
320
|
-
let
|
|
180
|
+
const e = await S.getBoard();
|
|
181
|
+
let o = 30, r = 30;
|
|
321
182
|
const h = [];
|
|
322
|
-
for (const
|
|
323
|
-
const
|
|
183
|
+
for (const C of e) {
|
|
184
|
+
const w = C.width ?? 600, d = C.height ?? 400;
|
|
324
185
|
h.push({
|
|
325
|
-
id:
|
|
326
|
-
stickerId:
|
|
327
|
-
isEditorVisible:
|
|
186
|
+
id: C.id,
|
|
187
|
+
stickerId: C.markdownId,
|
|
188
|
+
isEditorVisible: C.isEditorVisible ?? !0,
|
|
328
189
|
type: "markdown",
|
|
329
|
-
x:
|
|
190
|
+
x: o,
|
|
330
191
|
y: r,
|
|
331
|
-
width:
|
|
332
|
-
height:
|
|
333
|
-
text:
|
|
192
|
+
width: w,
|
|
193
|
+
height: d,
|
|
194
|
+
text: C.content ?? "",
|
|
334
195
|
zIndex: 1
|
|
335
|
-
}),
|
|
196
|
+
}), o += 24, r += 24;
|
|
336
197
|
}
|
|
337
|
-
|
|
338
|
-
} catch (
|
|
339
|
-
console.warn("Не удалось загрузить доску для markdown:",
|
|
198
|
+
s(h);
|
|
199
|
+
} catch (e) {
|
|
200
|
+
console.warn("Не удалось загрузить доску для markdown:", e);
|
|
340
201
|
}
|
|
341
202
|
})();
|
|
342
|
-
}, [
|
|
343
|
-
let
|
|
344
|
-
return import("
|
|
345
|
-
if (!
|
|
346
|
-
const
|
|
347
|
-
typeof
|
|
203
|
+
}, [s]), k(() => {
|
|
204
|
+
let t = !0;
|
|
205
|
+
return import("@xyflow/react").then((e) => {
|
|
206
|
+
if (!t) return;
|
|
207
|
+
const o = (e && (e.Widget || e.default || e?.widget || e?.XyflowWidget)) ?? null;
|
|
208
|
+
typeof o == "function" || y.isValidElement(o) ? n(() => o) : n(() => b);
|
|
348
209
|
}).catch(() => {
|
|
349
|
-
|
|
210
|
+
t && n(() => b);
|
|
350
211
|
}), () => {
|
|
351
|
-
|
|
212
|
+
t = !1;
|
|
352
213
|
};
|
|
353
214
|
}, []);
|
|
354
|
-
const c =
|
|
355
|
-
return /* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
215
|
+
const c = l || b;
|
|
216
|
+
return /* @__PURE__ */ a.jsx(c, { children: /* @__PURE__ */ a.jsxs("div", { className: "relative flex h-screen w-screen bg-gray-100", children: [
|
|
217
|
+
/* @__PURE__ */ a.jsx(R, { createInCenter: () => ({ x: 300, y: 200 }) }),
|
|
218
|
+
/* @__PURE__ */ a.jsx(F, { ref: i })
|
|
358
219
|
] }) });
|
|
359
|
-
},
|
|
360
|
-
const [
|
|
361
|
-
if (!
|
|
362
|
-
|
|
220
|
+
}, D = "data:image/svg+xml,%3csvg%20width='57'%20height='45'%20viewBox='0%200%2057%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.1%2023.36H1V44H49.06L55%2033.1067L49.06%2023.36H41.5M9.1%2023.36V18.2M9.1%2023.36H25.3M25.3%2023.36V14.76M25.3%2023.36H41.5M41.5%2023.36V11.32M41.5%2011.32V1H55L51.22%206.16L55%2011.32H41.5Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M22.5999%2033.6799L16.6599%2043.9999H32.8599L38.7999%2033.6799L32.8599%2023.3599H16.6599L22.5999%2033.6799Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3c/svg%3e", T = "data:image/svg+xml,%3csvg%20width='57'%20height='45'%20viewBox='0%200%2057%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.1%2023.36H1V44H49.06L55%2033.1067L49.06%2023.36H41.5M9.1%2023.36V18.2M9.1%2023.36H25.3M25.3%2023.36V14.76M25.3%2023.36H41.5M41.5%2023.36V11.32M41.5%2011.32V1H55L51.22%206.16L55%2011.32H41.5Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M22.5999%2033.6799L16.6599%2043.9999H32.8599L38.7999%2033.6799L32.8599%2023.3599H16.6599L22.5999%2033.6799Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3c/svg%3e", $ = () => {
|
|
221
|
+
const [s, i] = g(!1), l = p((t) => t.addSticker), n = p((t) => t.topZ), c = async () => {
|
|
222
|
+
if (!s) {
|
|
223
|
+
i(!0);
|
|
363
224
|
try {
|
|
364
|
-
const
|
|
225
|
+
const t = (n || 1) + 1, e = await N.create({
|
|
365
226
|
text: "",
|
|
366
227
|
description: "",
|
|
367
228
|
date: null,
|
|
368
229
|
completed: !1,
|
|
369
230
|
cancelled: !1,
|
|
370
|
-
zIndex:
|
|
231
|
+
zIndex: t,
|
|
371
232
|
width: 200,
|
|
372
233
|
height: 50,
|
|
373
234
|
parentId: null
|
|
374
|
-
}),
|
|
375
|
-
|
|
376
|
-
id: String(
|
|
235
|
+
}), o = window.innerWidth / 2 - 100, r = window.innerHeight / 2 - 60;
|
|
236
|
+
l({
|
|
237
|
+
id: String(e.id),
|
|
377
238
|
type: "roadmap",
|
|
378
|
-
x:
|
|
239
|
+
x: o,
|
|
379
240
|
y: r,
|
|
380
|
-
width:
|
|
381
|
-
height:
|
|
382
|
-
text:
|
|
383
|
-
description:
|
|
384
|
-
date:
|
|
385
|
-
completed:
|
|
386
|
-
cancelled:
|
|
387
|
-
parentId:
|
|
388
|
-
zIndex:
|
|
241
|
+
width: e.width ?? 200,
|
|
242
|
+
height: e.height ?? 120,
|
|
243
|
+
text: e.text ?? "",
|
|
244
|
+
description: e.description ?? "",
|
|
245
|
+
date: e.date ?? null,
|
|
246
|
+
completed: e.completed ?? !1,
|
|
247
|
+
cancelled: e.cancelled ?? !1,
|
|
248
|
+
parentId: e.parentId ?? null,
|
|
249
|
+
zIndex: e.zIndex ?? t
|
|
389
250
|
});
|
|
390
|
-
} catch (
|
|
391
|
-
console.warn("Не удалось создать roadmap:",
|
|
251
|
+
} catch (t) {
|
|
252
|
+
console.warn("Не удалось создать roadmap:", t);
|
|
392
253
|
} finally {
|
|
393
|
-
|
|
254
|
+
i(!1);
|
|
394
255
|
}
|
|
395
256
|
}
|
|
396
257
|
};
|
|
397
|
-
return /* @__PURE__ */
|
|
258
|
+
return /* @__PURE__ */ a.jsx("div", { className: "left-toolbar-container", onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a.jsx("div", { className: "toolbar-card", children: /* @__PURE__ */ a.jsx(
|
|
398
259
|
"button",
|
|
399
260
|
{
|
|
400
261
|
onClick: c,
|
|
401
|
-
disabled:
|
|
402
|
-
className: `toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${
|
|
262
|
+
disabled: s,
|
|
263
|
+
className: `toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${s ? "toolbar-btn--active" : ""}`,
|
|
403
264
|
title: "Добавить Roadmap",
|
|
404
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ a.jsx("div", { className: `toolbar-markdown-plate ${s ? "toolbar-markdown-plate--active" : ""}`, children: /* @__PURE__ */ a.jsx(
|
|
405
266
|
"img",
|
|
406
267
|
{
|
|
407
|
-
src:
|
|
268
|
+
src: s ? T : D,
|
|
408
269
|
alt: "Roadmap",
|
|
409
270
|
draggable: !1
|
|
410
271
|
}
|
|
411
272
|
) })
|
|
412
273
|
}
|
|
413
274
|
) }) });
|
|
414
|
-
},
|
|
415
|
-
const
|
|
416
|
-
|
|
275
|
+
}, m = ({ children: s }) => /* @__PURE__ */ a.jsx("div", { children: s }), X = () => {
|
|
276
|
+
const s = p((e) => e.setStickers), i = p((e) => e.setEdges), l = x(null), [n, c] = g(() => m);
|
|
277
|
+
k(() => {
|
|
417
278
|
(async () => {
|
|
418
279
|
try {
|
|
419
|
-
const
|
|
280
|
+
const o = await N.getAll();
|
|
420
281
|
let r = 30, h = 30;
|
|
421
|
-
const
|
|
422
|
-
for (const
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
id: String(
|
|
282
|
+
const C = [], w = [];
|
|
283
|
+
for (const d of o) {
|
|
284
|
+
const u = d.width ?? 200, v = d.height ?? 120;
|
|
285
|
+
C.push({
|
|
286
|
+
id: String(d.id),
|
|
426
287
|
type: "roadmap",
|
|
427
288
|
x: r,
|
|
428
289
|
y: h,
|
|
429
|
-
width:
|
|
430
|
-
height:
|
|
431
|
-
text:
|
|
432
|
-
description:
|
|
433
|
-
date:
|
|
434
|
-
completed:
|
|
435
|
-
cancelled:
|
|
436
|
-
parentId:
|
|
437
|
-
zIndex:
|
|
438
|
-
}),
|
|
439
|
-
id: `e-${
|
|
440
|
-
source: String(
|
|
441
|
-
target: String(
|
|
290
|
+
width: u,
|
|
291
|
+
height: v,
|
|
292
|
+
text: d.text ?? "",
|
|
293
|
+
description: d.description ?? "",
|
|
294
|
+
date: d.date ?? null,
|
|
295
|
+
completed: d.completed ?? !1,
|
|
296
|
+
cancelled: d.cancelled ?? !1,
|
|
297
|
+
parentId: d.parentId ?? null,
|
|
298
|
+
zIndex: d.zIndex ?? 1
|
|
299
|
+
}), d.parentId && w.push({
|
|
300
|
+
id: `e-${d.parentId}-${d.id}`,
|
|
301
|
+
source: String(d.parentId),
|
|
302
|
+
target: String(d.id),
|
|
442
303
|
type: "default",
|
|
443
304
|
animated: !1
|
|
444
305
|
}), r += 24, h += 24;
|
|
445
306
|
}
|
|
446
|
-
|
|
447
|
-
} catch (
|
|
448
|
-
console.warn("Не удалось загрузить доску для роадмапа:",
|
|
307
|
+
s(C), i(w);
|
|
308
|
+
} catch (o) {
|
|
309
|
+
console.warn("Не удалось загрузить доску для роадмапа:", o);
|
|
449
310
|
}
|
|
450
311
|
})();
|
|
451
|
-
}, [
|
|
452
|
-
let
|
|
453
|
-
return import("
|
|
454
|
-
if (!
|
|
455
|
-
const r = (
|
|
456
|
-
typeof r == "function" ||
|
|
312
|
+
}, [s, i]), k(() => {
|
|
313
|
+
let e = !0;
|
|
314
|
+
return import("@xyflow/react").then((o) => {
|
|
315
|
+
if (!e) return;
|
|
316
|
+
const r = (o && (o.Widget || o.default || o?.widget || o?.XyflowWidget)) ?? null;
|
|
317
|
+
typeof r == "function" || y.isValidElement(r) ? c(() => r) : c(() => m);
|
|
457
318
|
}).catch(() => {
|
|
458
|
-
|
|
319
|
+
e && c(() => m);
|
|
459
320
|
}), () => {
|
|
460
|
-
|
|
321
|
+
e = !1;
|
|
461
322
|
};
|
|
462
323
|
}, []);
|
|
463
|
-
const
|
|
464
|
-
return /* @__PURE__ */
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */
|
|
324
|
+
const t = n || m;
|
|
325
|
+
return /* @__PURE__ */ a.jsx(t, { children: /* @__PURE__ */ a.jsxs("div", { className: "relative flex h-screen w-screen bg-gray-100", children: [
|
|
326
|
+
/* @__PURE__ */ a.jsx($, { createInCenter: () => ({ x: 300, y: 200 }) }),
|
|
327
|
+
/* @__PURE__ */ a.jsx(F, { ref: l })
|
|
467
328
|
] }) });
|
|
468
329
|
};
|
|
469
330
|
export {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
331
|
+
F as Board,
|
|
332
|
+
K as EmojiBoardWidget,
|
|
333
|
+
_ as MarkdownBoardWidget,
|
|
334
|
+
O as NoteBoardWidget,
|
|
335
|
+
X as RoadmapBoardWidget,
|
|
336
|
+
t2 as ShapeBoardWidget,
|
|
337
|
+
q as baseNodeTypes,
|
|
338
|
+
Q as emojiNodeTypes,
|
|
339
|
+
e2 as shapeNodeTypes
|
|
478
340
|
};
|
|
341
|
+
//# sourceMappingURL=index.mjs.map
|