integration-modules 0.1.18 → 0.1.19
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 +16 -16
- package/dist/chunks/emojiNodeTypes-BEJUMlcU.js +2 -0
- package/dist/chunks/emojiNodeTypes-BEJUMlcU.js.map +1 -0
- package/dist/chunks/emojiNodeTypes-ChzS-8r3.js +129 -0
- package/dist/chunks/emojiNodeTypes-ChzS-8r3.js.map +1 -0
- package/dist/chunks/stickers-CgxhVTwt.js +7 -0
- package/dist/chunks/stickers-CgxhVTwt.js.map +1 -0
- package/dist/chunks/stickers-MBhZw3wd.js +299 -0
- package/dist/chunks/stickers-MBhZw3wd.js.map +1 -0
- package/dist/emoji/index.cjs +1 -1
- package/dist/emoji/index.js +6 -4
- package/dist/index.cjs +1 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -17753
- package/dist/index.mjs.map +1 -1
- package/dist/integration-modules.css +1 -1
- package/dist/shape/index.cjs +32 -1
- package/dist/shape/index.cjs.map +1 -1
- package/dist/shape/index.js +19285 -3
- package/dist/shape/index.js.map +1 -1
- package/package.json +78 -78
- package/dist/chunks/EmojiBoardWidget-BT3AAibK.js +0 -270
- package/dist/chunks/EmojiBoardWidget-BT3AAibK.js.map +0 -1
- package/dist/chunks/EmojiBoardWidget-CzGz4-vT.js +0 -2
- package/dist/chunks/EmojiBoardWidget-CzGz4-vT.js.map +0 -1
- package/dist/chunks/ShapeBoardWidget-BmgYD5zN.js +0 -1321
- package/dist/chunks/ShapeBoardWidget-BmgYD5zN.js.map +0 -1
- package/dist/chunks/ShapeBoardWidget-quPjhnR6.js +0 -2
- package/dist/chunks/ShapeBoardWidget-quPjhnR6.js.map +0 -1
- package/dist/chunks/useStickersStore-BUOBakV7.js +0 -613
- package/dist/chunks/useStickersStore-BUOBakV7.js.map +0 -1
- package/dist/chunks/useStickersStore-CZRuiluy.js +0 -23
- package/dist/chunks/useStickersStore-CZRuiluy.js.map +0 -1
|
@@ -1,613 +0,0 @@
|
|
|
1
|
-
import K from "react";
|
|
2
|
-
import { create as ee } from "zustand";
|
|
3
|
-
var C = { exports: {} }, b = {};
|
|
4
|
-
/**
|
|
5
|
-
* @license React
|
|
6
|
-
* react-jsx-runtime.production.js
|
|
7
|
-
*
|
|
8
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
var H;
|
|
14
|
-
function te() {
|
|
15
|
-
if (H) return b;
|
|
16
|
-
H = 1;
|
|
17
|
-
var n = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
|
|
18
|
-
function t(r, o, a) {
|
|
19
|
-
var i = null;
|
|
20
|
-
if (a !== void 0 && (i = "" + a), o.key !== void 0 && (i = "" + o.key), "key" in o) {
|
|
21
|
-
a = {};
|
|
22
|
-
for (var d in o)
|
|
23
|
-
d !== "key" && (a[d] = o[d]);
|
|
24
|
-
} else a = o;
|
|
25
|
-
return o = a.ref, {
|
|
26
|
-
$$typeof: n,
|
|
27
|
-
type: r,
|
|
28
|
-
key: i,
|
|
29
|
-
ref: o !== void 0 ? o : null,
|
|
30
|
-
props: a
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return b.Fragment = c, b.jsx = t, b.jsxs = t, b;
|
|
34
|
-
}
|
|
35
|
-
var x = {};
|
|
36
|
-
/**
|
|
37
|
-
* @license React
|
|
38
|
-
* react-jsx-runtime.development.js
|
|
39
|
-
*
|
|
40
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
41
|
-
*
|
|
42
|
-
* This source code is licensed under the MIT license found in the
|
|
43
|
-
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/
|
|
45
|
-
var J;
|
|
46
|
-
function re() {
|
|
47
|
-
return J || (J = 1, process.env.NODE_ENV !== "production" && function() {
|
|
48
|
-
function n(e) {
|
|
49
|
-
if (e == null) return null;
|
|
50
|
-
if (typeof e == "function")
|
|
51
|
-
return e.$$typeof === X ? null : e.displayName || e.name || null;
|
|
52
|
-
if (typeof e == "string") return e;
|
|
53
|
-
switch (e) {
|
|
54
|
-
case w:
|
|
55
|
-
return "Fragment";
|
|
56
|
-
case O:
|
|
57
|
-
return "Profiler";
|
|
58
|
-
case v:
|
|
59
|
-
return "StrictMode";
|
|
60
|
-
case U:
|
|
61
|
-
return "Suspense";
|
|
62
|
-
case B:
|
|
63
|
-
return "SuspenseList";
|
|
64
|
-
case G:
|
|
65
|
-
return "Activity";
|
|
66
|
-
}
|
|
67
|
-
if (typeof e == "object")
|
|
68
|
-
switch (typeof e.tag == "number" && console.error(
|
|
69
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
70
|
-
), e.$$typeof) {
|
|
71
|
-
case m:
|
|
72
|
-
return "Portal";
|
|
73
|
-
case W:
|
|
74
|
-
return e.displayName || "Context";
|
|
75
|
-
case D:
|
|
76
|
-
return (e._context.displayName || "Context") + ".Consumer";
|
|
77
|
-
case L:
|
|
78
|
-
var s = e.render;
|
|
79
|
-
return e = e.displayName, e || (e = s.displayName || s.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
80
|
-
case V:
|
|
81
|
-
return s = e.displayName || null, s !== null ? s : n(e.type) || "Memo";
|
|
82
|
-
case A:
|
|
83
|
-
s = e._payload, e = e._init;
|
|
84
|
-
try {
|
|
85
|
-
return n(e(s));
|
|
86
|
-
} catch {
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
function c(e) {
|
|
92
|
-
return "" + e;
|
|
93
|
-
}
|
|
94
|
-
function t(e) {
|
|
95
|
-
try {
|
|
96
|
-
c(e);
|
|
97
|
-
var s = !1;
|
|
98
|
-
} catch {
|
|
99
|
-
s = !0;
|
|
100
|
-
}
|
|
101
|
-
if (s) {
|
|
102
|
-
s = console;
|
|
103
|
-
var l = s.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
104
|
-
return l.call(
|
|
105
|
-
s,
|
|
106
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
|
-
u
|
|
108
|
-
), c(e);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function r(e) {
|
|
112
|
-
if (e === w) return "<>";
|
|
113
|
-
if (typeof e == "object" && e !== null && e.$$typeof === A)
|
|
114
|
-
return "<...>";
|
|
115
|
-
try {
|
|
116
|
-
var s = n(e);
|
|
117
|
-
return s ? "<" + s + ">" : "<...>";
|
|
118
|
-
} catch {
|
|
119
|
-
return "<...>";
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function o() {
|
|
123
|
-
var e = j.A;
|
|
124
|
-
return e === null ? null : e.getOwner();
|
|
125
|
-
}
|
|
126
|
-
function a() {
|
|
127
|
-
return Error("react-stack-top-frame");
|
|
128
|
-
}
|
|
129
|
-
function i(e) {
|
|
130
|
-
if ($.call(e, "key")) {
|
|
131
|
-
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
132
|
-
if (s && s.isReactWarning) return !1;
|
|
133
|
-
}
|
|
134
|
-
return e.key !== void 0;
|
|
135
|
-
}
|
|
136
|
-
function d(e, s) {
|
|
137
|
-
function l() {
|
|
138
|
-
z || (z = !0, console.error(
|
|
139
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
140
|
-
s
|
|
141
|
-
));
|
|
142
|
-
}
|
|
143
|
-
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
144
|
-
get: l,
|
|
145
|
-
configurable: !0
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
function g() {
|
|
149
|
-
var e = n(this.type);
|
|
150
|
-
return M[e] || (M[e] = !0, console.error(
|
|
151
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
152
|
-
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
153
|
-
}
|
|
154
|
-
function E(e, s, l, u, y, N) {
|
|
155
|
-
var f = l.ref;
|
|
156
|
-
return e = {
|
|
157
|
-
$$typeof: _,
|
|
158
|
-
type: e,
|
|
159
|
-
key: s,
|
|
160
|
-
props: l,
|
|
161
|
-
_owner: u
|
|
162
|
-
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
|
|
163
|
-
enumerable: !1,
|
|
164
|
-
get: g
|
|
165
|
-
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
166
|
-
configurable: !1,
|
|
167
|
-
enumerable: !1,
|
|
168
|
-
writable: !0,
|
|
169
|
-
value: 0
|
|
170
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
171
|
-
configurable: !1,
|
|
172
|
-
enumerable: !1,
|
|
173
|
-
writable: !0,
|
|
174
|
-
value: null
|
|
175
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
176
|
-
configurable: !1,
|
|
177
|
-
enumerable: !1,
|
|
178
|
-
writable: !0,
|
|
179
|
-
value: y
|
|
180
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
181
|
-
configurable: !1,
|
|
182
|
-
enumerable: !1,
|
|
183
|
-
writable: !0,
|
|
184
|
-
value: N
|
|
185
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
186
|
-
}
|
|
187
|
-
function R(e, s, l, u, y, N) {
|
|
188
|
-
var f = s.children;
|
|
189
|
-
if (f !== void 0)
|
|
190
|
-
if (u)
|
|
191
|
-
if (q(f)) {
|
|
192
|
-
for (u = 0; u < f.length; u++)
|
|
193
|
-
S(f[u]);
|
|
194
|
-
Object.freeze && Object.freeze(f);
|
|
195
|
-
} else
|
|
196
|
-
console.error(
|
|
197
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
|
-
);
|
|
199
|
-
else S(f);
|
|
200
|
-
if ($.call(s, "key")) {
|
|
201
|
-
f = n(e);
|
|
202
|
-
var T = Object.keys(s).filter(function(Q) {
|
|
203
|
-
return Q !== "key";
|
|
204
|
-
});
|
|
205
|
-
u = 0 < T.length ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}", F[f + u] || (T = 0 < T.length ? "{" + T.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
207
|
-
let props = %s;
|
|
208
|
-
<%s {...props} />
|
|
209
|
-
React keys must be passed directly to JSX without using spread:
|
|
210
|
-
let props = %s;
|
|
211
|
-
<%s key={someKey} {...props} />`,
|
|
212
|
-
u,
|
|
213
|
-
f,
|
|
214
|
-
T,
|
|
215
|
-
f
|
|
216
|
-
), F[f + u] = !0);
|
|
217
|
-
}
|
|
218
|
-
if (f = null, l !== void 0 && (t(l), f = "" + l), i(s) && (t(s.key), f = "" + s.key), "key" in s) {
|
|
219
|
-
l = {};
|
|
220
|
-
for (var I in s)
|
|
221
|
-
I !== "key" && (l[I] = s[I]);
|
|
222
|
-
} else l = s;
|
|
223
|
-
return f && d(
|
|
224
|
-
l,
|
|
225
|
-
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
226
|
-
), E(
|
|
227
|
-
e,
|
|
228
|
-
f,
|
|
229
|
-
l,
|
|
230
|
-
o(),
|
|
231
|
-
y,
|
|
232
|
-
N
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
function S(e) {
|
|
236
|
-
k(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === A && (e._payload.status === "fulfilled" ? k(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
237
|
-
}
|
|
238
|
-
function k(e) {
|
|
239
|
-
return typeof e == "object" && e !== null && e.$$typeof === _;
|
|
240
|
-
}
|
|
241
|
-
var p = K, _ = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), D = Symbol.for("react.consumer"), W = Symbol.for("react.context"), L = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), B = Symbol.for("react.suspense_list"), V = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), G = Symbol.for("react.activity"), X = Symbol.for("react.client.reference"), j = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, q = Array.isArray, P = console.createTask ? console.createTask : function() {
|
|
242
|
-
return null;
|
|
243
|
-
};
|
|
244
|
-
p = {
|
|
245
|
-
react_stack_bottom_frame: function(e) {
|
|
246
|
-
return e();
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
var z, M = {}, Y = p.react_stack_bottom_frame.bind(
|
|
250
|
-
p,
|
|
251
|
-
a
|
|
252
|
-
)(), Z = P(r(a)), F = {};
|
|
253
|
-
x.Fragment = w, x.jsx = function(e, s, l) {
|
|
254
|
-
var u = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
255
|
-
return R(
|
|
256
|
-
e,
|
|
257
|
-
s,
|
|
258
|
-
l,
|
|
259
|
-
!1,
|
|
260
|
-
u ? Error("react-stack-top-frame") : Y,
|
|
261
|
-
u ? P(r(e)) : Z
|
|
262
|
-
);
|
|
263
|
-
}, x.jsxs = function(e, s, l) {
|
|
264
|
-
var u = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
265
|
-
return R(
|
|
266
|
-
e,
|
|
267
|
-
s,
|
|
268
|
-
l,
|
|
269
|
-
!0,
|
|
270
|
-
u ? Error("react-stack-top-frame") : Y,
|
|
271
|
-
u ? P(r(e)) : Z
|
|
272
|
-
);
|
|
273
|
-
};
|
|
274
|
-
}()), x;
|
|
275
|
-
}
|
|
276
|
-
process.env.NODE_ENV === "production" ? C.exports = te() : C.exports = re();
|
|
277
|
-
var ie = C.exports;
|
|
278
|
-
const se = 91, ce = 84, le = 160, de = 160, ue = 10, fe = "application/x-integration-shape", pe = "application/x-integration-emoji", me = "application/x-integration-note", he = "dnd/markdown", ge = "application/roadmap";
|
|
279
|
-
async function h(n) {
|
|
280
|
-
return await n.text() || `HTTP ${n.status}`;
|
|
281
|
-
}
|
|
282
|
-
const ne = {
|
|
283
|
-
async getAll() {
|
|
284
|
-
const n = await fetch("/api/v1/roadmap/get-all");
|
|
285
|
-
if (!n.ok)
|
|
286
|
-
throw new Error(await h(n));
|
|
287
|
-
return await n.json();
|
|
288
|
-
},
|
|
289
|
-
async getById(n) {
|
|
290
|
-
const c = await fetch(`/api/v1/roadmap/${n}`);
|
|
291
|
-
if (!c.ok)
|
|
292
|
-
throw new Error(await h(c));
|
|
293
|
-
return await c.json();
|
|
294
|
-
},
|
|
295
|
-
async create({ text: n, description: c, date: t, completed: r, cancelled: o, zIndex: a, width: i, height: d, parentId: g }) {
|
|
296
|
-
const E = await fetch("/api/v1/roadmap/create", {
|
|
297
|
-
method: "POST",
|
|
298
|
-
headers: { "Content-Type": "application/json" },
|
|
299
|
-
body: JSON.stringify({
|
|
300
|
-
text: n ?? "",
|
|
301
|
-
description: c ?? "",
|
|
302
|
-
date: t ?? null,
|
|
303
|
-
completed: r ?? !1,
|
|
304
|
-
cancelled: o ?? !1,
|
|
305
|
-
zIndex: a ?? 0,
|
|
306
|
-
width: i ?? 200,
|
|
307
|
-
height: d ?? 120,
|
|
308
|
-
parentId: g ?? null
|
|
309
|
-
})
|
|
310
|
-
});
|
|
311
|
-
if (!E.ok)
|
|
312
|
-
throw new Error(await h(E));
|
|
313
|
-
return await E.json();
|
|
314
|
-
},
|
|
315
|
-
async updateText(n, c) {
|
|
316
|
-
const t = await fetch(`/api/v1/roadmap/${n}/text`, {
|
|
317
|
-
method: "PATCH",
|
|
318
|
-
headers: { "Content-Type": "application/json" },
|
|
319
|
-
body: JSON.stringify({ text: c ?? "" })
|
|
320
|
-
});
|
|
321
|
-
if (!t.ok)
|
|
322
|
-
throw new Error(await h(t));
|
|
323
|
-
return await t.json();
|
|
324
|
-
},
|
|
325
|
-
async updateDescription(n, c) {
|
|
326
|
-
const t = await fetch(`/api/v1/roadmap/${n}/description`, {
|
|
327
|
-
method: "PATCH",
|
|
328
|
-
headers: { "Content-Type": "application/json" },
|
|
329
|
-
body: JSON.stringify({ description: c ?? "" })
|
|
330
|
-
});
|
|
331
|
-
if (!t.ok)
|
|
332
|
-
throw new Error(await h(t));
|
|
333
|
-
return await t.json();
|
|
334
|
-
},
|
|
335
|
-
async updateDate(n, c, t) {
|
|
336
|
-
const r = await fetch(`/api/v1/roadmap/${n}/date`, {
|
|
337
|
-
method: "PATCH",
|
|
338
|
-
headers: { "Content-Type": "application/json" },
|
|
339
|
-
body: JSON.stringify({ date: c ?? null, completed: t ?? !1 })
|
|
340
|
-
});
|
|
341
|
-
if (!r.ok)
|
|
342
|
-
throw new Error(await h(r));
|
|
343
|
-
return await r.json();
|
|
344
|
-
},
|
|
345
|
-
async updateCompleted(n, c) {
|
|
346
|
-
const t = await fetch(`/api/v1/roadmap/${n}/completed`, {
|
|
347
|
-
method: "PATCH",
|
|
348
|
-
headers: { "Content-Type": "application/json" },
|
|
349
|
-
body: JSON.stringify({ completed: c ?? !1 })
|
|
350
|
-
});
|
|
351
|
-
if (!t.ok)
|
|
352
|
-
throw new Error(await h(t));
|
|
353
|
-
return await t.json();
|
|
354
|
-
},
|
|
355
|
-
async updateCancelled(n, c) {
|
|
356
|
-
const t = await fetch(`/api/v1/roadmap/${n}/cancelled`, {
|
|
357
|
-
method: "PATCH",
|
|
358
|
-
headers: { "Content-Type": "application/json" },
|
|
359
|
-
body: JSON.stringify({ cancelled: c ?? !1 })
|
|
360
|
-
});
|
|
361
|
-
if (!t.ok)
|
|
362
|
-
throw new Error(await h(t));
|
|
363
|
-
return await t.json();
|
|
364
|
-
},
|
|
365
|
-
async updateZIndex(n, c) {
|
|
366
|
-
const t = await fetch(`/api/v1/roadmap/${n}/z-index`, {
|
|
367
|
-
method: "PATCH",
|
|
368
|
-
headers: { "Content-Type": "application/json" },
|
|
369
|
-
body: JSON.stringify({ zIndex: c ?? 0 })
|
|
370
|
-
});
|
|
371
|
-
if (!t.ok)
|
|
372
|
-
throw new Error(await h(t));
|
|
373
|
-
return await t.json();
|
|
374
|
-
},
|
|
375
|
-
async updateSize(n, c, t) {
|
|
376
|
-
const r = await fetch(`/api/v1/roadmap/${n}/size`, {
|
|
377
|
-
method: "PATCH",
|
|
378
|
-
headers: { "Content-Type": "application/json" },
|
|
379
|
-
body: JSON.stringify({ width: c, height: t })
|
|
380
|
-
});
|
|
381
|
-
if (!r.ok)
|
|
382
|
-
throw new Error(await h(r));
|
|
383
|
-
return await r.json();
|
|
384
|
-
},
|
|
385
|
-
async delete(n) {
|
|
386
|
-
const c = await fetch(`/api/v1/roadmap/${n}`, {
|
|
387
|
-
method: "DELETE",
|
|
388
|
-
headers: { "Content-Type": "application/json" }
|
|
389
|
-
});
|
|
390
|
-
if (!c.ok)
|
|
391
|
-
throw new Error(await h(c));
|
|
392
|
-
return c.status === 204;
|
|
393
|
-
}
|
|
394
|
-
}, we = ee((n, c) => ({
|
|
395
|
-
stickers: [],
|
|
396
|
-
edges: [],
|
|
397
|
-
topZ: 1,
|
|
398
|
-
selectedId: null,
|
|
399
|
-
addSticker: (t) => {
|
|
400
|
-
n((r) => {
|
|
401
|
-
const o = t && t.id ? String(t.id) : crypto.randomUUID(), a = t && t.zIndex ? t.zIndex : (r.topZ || 1) + 1, i = {
|
|
402
|
-
id: o,
|
|
403
|
-
x: t.x,
|
|
404
|
-
y: t.y,
|
|
405
|
-
width: t.width,
|
|
406
|
-
height: t.height,
|
|
407
|
-
color: t.color,
|
|
408
|
-
text: t.text ?? "",
|
|
409
|
-
description: t.description ?? "",
|
|
410
|
-
date: t.date ?? null,
|
|
411
|
-
completed: t.completed ?? !1,
|
|
412
|
-
cancelled: t.cancelled ?? !1,
|
|
413
|
-
parentId: t.parentId ?? null,
|
|
414
|
-
zIndex: a,
|
|
415
|
-
rotation: t.rotation ?? 0,
|
|
416
|
-
type: t.type,
|
|
417
|
-
shapeId: t.shapeId,
|
|
418
|
-
shapeData: t.shapeData,
|
|
419
|
-
imageUrl: t.imageUrl,
|
|
420
|
-
info: t.info ?? null
|
|
421
|
-
};
|
|
422
|
-
return {
|
|
423
|
-
stickers: [...r.stickers, i],
|
|
424
|
-
topZ: Math.max(r.topZ || 1, a)
|
|
425
|
-
};
|
|
426
|
-
});
|
|
427
|
-
},
|
|
428
|
-
addRoadmapBranch: async (t) => {
|
|
429
|
-
const r = c(), o = r.stickers.find((m) => String(m.id) === String(t));
|
|
430
|
-
if (!o)
|
|
431
|
-
return;
|
|
432
|
-
const a = r.stickers.filter(
|
|
433
|
-
(m) => r.edges.some((w) => String(w.source) === String(t) && String(w.target) === String(m.id))
|
|
434
|
-
), i = 200, d = 120, g = i + 140, E = 50, R = (o.x ?? 0) + g;
|
|
435
|
-
let S;
|
|
436
|
-
if (a.length === 0)
|
|
437
|
-
S = (o.y ?? 0) + (o.height || d) / 2 - d / 2 + E;
|
|
438
|
-
else {
|
|
439
|
-
const m = a.reduce((w, v) => {
|
|
440
|
-
const O = (w.y ?? 0) + (w.height || d);
|
|
441
|
-
return (v.y ?? 0) + (v.height || d) > O ? v : w;
|
|
442
|
-
});
|
|
443
|
-
S = (m.y ?? 0) + (m.height || d) + E;
|
|
444
|
-
}
|
|
445
|
-
const k = (r.topZ || 1) + 1;
|
|
446
|
-
let p;
|
|
447
|
-
try {
|
|
448
|
-
p = await ne.create({
|
|
449
|
-
text: "",
|
|
450
|
-
description: "",
|
|
451
|
-
date: null,
|
|
452
|
-
completed: !1,
|
|
453
|
-
cancelled: !1,
|
|
454
|
-
zIndex: k,
|
|
455
|
-
width: i,
|
|
456
|
-
height: d,
|
|
457
|
-
parentId: String(t)
|
|
458
|
-
});
|
|
459
|
-
} catch (m) {
|
|
460
|
-
console.warn("Не удалось создать roadmap ветку", m);
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
const _ = String(p.id);
|
|
464
|
-
r.addSticker({
|
|
465
|
-
id: _,
|
|
466
|
-
type: "roadmap",
|
|
467
|
-
x: R,
|
|
468
|
-
y: S,
|
|
469
|
-
width: p.width ?? i,
|
|
470
|
-
height: p.height ?? d,
|
|
471
|
-
text: p.text ?? "",
|
|
472
|
-
description: p.description ?? "",
|
|
473
|
-
date: p.date ?? null,
|
|
474
|
-
completed: p.completed ?? !1,
|
|
475
|
-
cancelled: p.cancelled ?? !1,
|
|
476
|
-
parentId: p.parentId ?? String(t),
|
|
477
|
-
zIndex: p.zIndex ?? k
|
|
478
|
-
}), n((m) => ({
|
|
479
|
-
edges: [
|
|
480
|
-
...m.edges,
|
|
481
|
-
{
|
|
482
|
-
id: `e-${t}-${_}`,
|
|
483
|
-
source: String(t),
|
|
484
|
-
target: _,
|
|
485
|
-
type: "default",
|
|
486
|
-
animated: !1
|
|
487
|
-
}
|
|
488
|
-
],
|
|
489
|
-
topZ: Math.max(m.topZ || 1, k)
|
|
490
|
-
}));
|
|
491
|
-
},
|
|
492
|
-
setStickers: (t) => {
|
|
493
|
-
n(() => ({
|
|
494
|
-
stickers: t,
|
|
495
|
-
topZ: t.reduce((r, o) => Math.max(r, o.zIndex ?? 1), 1)
|
|
496
|
-
}));
|
|
497
|
-
},
|
|
498
|
-
setEdges: (t) => {
|
|
499
|
-
n(() => ({
|
|
500
|
-
edges: t
|
|
501
|
-
}));
|
|
502
|
-
},
|
|
503
|
-
reset: () => {
|
|
504
|
-
n({
|
|
505
|
-
stickers: [],
|
|
506
|
-
edges: [],
|
|
507
|
-
topZ: 1,
|
|
508
|
-
selectedId: null
|
|
509
|
-
});
|
|
510
|
-
},
|
|
511
|
-
updateSticker: (t, r) => {
|
|
512
|
-
n((o) => ({
|
|
513
|
-
stickers: o.stickers.map(
|
|
514
|
-
(a) => String(a.id) === String(t) ? { ...a, ...r } : a
|
|
515
|
-
)
|
|
516
|
-
}));
|
|
517
|
-
},
|
|
518
|
-
setPosition: (t, r, o) => {
|
|
519
|
-
n((a) => ({
|
|
520
|
-
stickers: a.stickers.map(
|
|
521
|
-
(i) => String(i.id) === String(t) ? { ...i, x: r, y: o } : i
|
|
522
|
-
)
|
|
523
|
-
}));
|
|
524
|
-
},
|
|
525
|
-
setSize: (t, r, o) => {
|
|
526
|
-
n((a) => ({
|
|
527
|
-
stickers: a.stickers.map(
|
|
528
|
-
(i) => String(i.id) === String(t) ? { ...i, width: r, height: o } : i
|
|
529
|
-
)
|
|
530
|
-
}));
|
|
531
|
-
},
|
|
532
|
-
setText: (t, r) => {
|
|
533
|
-
n((o) => ({
|
|
534
|
-
stickers: o.stickers.map(
|
|
535
|
-
(a) => String(a.id) === String(t) ? { ...a, text: r } : a
|
|
536
|
-
)
|
|
537
|
-
}));
|
|
538
|
-
},
|
|
539
|
-
bringToFront: (t) => {
|
|
540
|
-
n((r) => {
|
|
541
|
-
if (!r.stickers.find((i) => String(i.id) === String(t)))
|
|
542
|
-
return r;
|
|
543
|
-
const a = (r.topZ || 1) + 1;
|
|
544
|
-
return {
|
|
545
|
-
stickers: r.stickers.map((i) => String(i.id) === String(t) ? { ...i, zIndex: a } : i),
|
|
546
|
-
topZ: a
|
|
547
|
-
};
|
|
548
|
-
});
|
|
549
|
-
},
|
|
550
|
-
removeSticker: (t) => {
|
|
551
|
-
n((r) => {
|
|
552
|
-
const o = r.stickers.filter((a) => String(a.id) !== String(t));
|
|
553
|
-
return {
|
|
554
|
-
stickers: o,
|
|
555
|
-
edges: r.edges.filter((a) => String(a.source) !== String(t) && String(a.target) !== String(t)),
|
|
556
|
-
topZ: o.reduce((a, i) => Math.max(a, i.zIndex ?? 1), 1)
|
|
557
|
-
};
|
|
558
|
-
});
|
|
559
|
-
},
|
|
560
|
-
selectSticker: (t) => {
|
|
561
|
-
n({ selectedId: t });
|
|
562
|
-
},
|
|
563
|
-
getDescendants: (t) => {
|
|
564
|
-
const { stickers: r } = c(), o = [], a = (i) => {
|
|
565
|
-
const d = r.filter(
|
|
566
|
-
(g) => String(g.parentId) === String(i)
|
|
567
|
-
);
|
|
568
|
-
for (const g of d)
|
|
569
|
-
o.push(g), a(g.id);
|
|
570
|
-
};
|
|
571
|
-
return a(t), o;
|
|
572
|
-
},
|
|
573
|
-
removeStickersBulk: (t) => {
|
|
574
|
-
n((r) => {
|
|
575
|
-
const o = new Set(t.map(String)), a = r.stickers.filter(
|
|
576
|
-
(i) => !o.has(String(i.id))
|
|
577
|
-
);
|
|
578
|
-
return {
|
|
579
|
-
stickers: a,
|
|
580
|
-
edges: r.edges.filter(
|
|
581
|
-
(i) => !o.has(String(i.source)) && !o.has(String(i.target))
|
|
582
|
-
),
|
|
583
|
-
topZ: a.reduce(
|
|
584
|
-
(i, d) => Math.max(i, d.zIndex ?? 1),
|
|
585
|
-
1
|
|
586
|
-
)
|
|
587
|
-
};
|
|
588
|
-
});
|
|
589
|
-
},
|
|
590
|
-
detachChildren: (t) => {
|
|
591
|
-
n((r) => ({
|
|
592
|
-
stickers: r.stickers.map(
|
|
593
|
-
(o) => String(o.parentId) === String(t) ? { ...o, parentId: null } : o
|
|
594
|
-
)
|
|
595
|
-
}));
|
|
596
|
-
}
|
|
597
|
-
}));
|
|
598
|
-
export {
|
|
599
|
-
ue as B,
|
|
600
|
-
pe as D,
|
|
601
|
-
se as E,
|
|
602
|
-
le as N,
|
|
603
|
-
ce as a,
|
|
604
|
-
fe as b,
|
|
605
|
-
de as c,
|
|
606
|
-
he as d,
|
|
607
|
-
ge as e,
|
|
608
|
-
me as f,
|
|
609
|
-
ie as j,
|
|
610
|
-
ne as r,
|
|
611
|
-
we as u
|
|
612
|
-
};
|
|
613
|
-
//# sourceMappingURL=useStickersStore-BUOBakV7.js.map
|