integration-modules 0.1.14 → 0.1.15
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/chunks/EmojiBoardWidget-qFIIWsdw.js +274 -0
- package/dist/chunks/EmojiBoardWidget-qFIIWsdw.js.map +1 -0
- package/dist/chunks/EmojiBoardWidget-uWxNQwpF.js +2 -0
- package/dist/chunks/EmojiBoardWidget-uWxNQwpF.js.map +1 -0
- package/dist/chunks/ShapeBoardWidget-CYvTmNUV.js +2 -0
- package/dist/chunks/ShapeBoardWidget-CYvTmNUV.js.map +1 -0
- package/dist/chunks/ShapeBoardWidget-ChVcXBBP.js +1312 -0
- package/dist/chunks/ShapeBoardWidget-ChVcXBBP.js.map +1 -0
- package/dist/chunks/constants-D-rHISmr.js +23 -0
- package/dist/chunks/constants-D-rHISmr.js.map +1 -0
- package/dist/chunks/constants-pVjh1MjZ.js +612 -0
- package/dist/chunks/constants-pVjh1MjZ.js.map +1 -0
- package/dist/emoji/index.cjs +1 -1
- package/dist/emoji/index.js +2 -2
- package/dist/index.cjs +36 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +17729 -85
- package/dist/index.mjs.map +1 -1
- package/dist/integration-modules.css +1 -1
- package/dist/shape/index.cjs +1 -1
- package/dist/shape/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/Board-CENI1zTY.js +0 -19484
- package/dist/chunks/Board-CENI1zTY.js.map +0 -1
- package/dist/chunks/Board-DBlzUx0o.js +0 -58
- package/dist/chunks/Board-DBlzUx0o.js.map +0 -1
- package/dist/chunks/EmojiBoardWidget-94JjolG3.js +0 -197
- package/dist/chunks/EmojiBoardWidget-94JjolG3.js.map +0 -1
- package/dist/chunks/EmojiBoardWidget-jQpQl320.js +0 -2
- package/dist/chunks/EmojiBoardWidget-jQpQl320.js.map +0 -1
- package/dist/chunks/ShapeBoardWidget-C9nNKwtj.js +0 -157
- package/dist/chunks/ShapeBoardWidget-C9nNKwtj.js.map +0 -1
- package/dist/chunks/ShapeBoardWidget-D1TcdWRO.js +0 -2
- package/dist/chunks/ShapeBoardWidget-D1TcdWRO.js.map +0 -1
|
@@ -0,0 +1,612 @@
|
|
|
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
|
+
async function h(n) {
|
|
279
|
+
return await n.text() || `HTTP ${n.status}`;
|
|
280
|
+
}
|
|
281
|
+
const ne = {
|
|
282
|
+
async getAll() {
|
|
283
|
+
const n = await fetch("/api/v1/roadmap/get-all");
|
|
284
|
+
if (!n.ok)
|
|
285
|
+
throw new Error(await h(n));
|
|
286
|
+
return await n.json();
|
|
287
|
+
},
|
|
288
|
+
async getById(n) {
|
|
289
|
+
const c = await fetch(`/api/v1/roadmap/${n}`);
|
|
290
|
+
if (!c.ok)
|
|
291
|
+
throw new Error(await h(c));
|
|
292
|
+
return await c.json();
|
|
293
|
+
},
|
|
294
|
+
async create({ text: n, description: c, date: t, completed: r, cancelled: o, zIndex: a, width: i, height: d, parentId: g }) {
|
|
295
|
+
const E = await fetch("/api/v1/roadmap/create", {
|
|
296
|
+
method: "POST",
|
|
297
|
+
headers: { "Content-Type": "application/json" },
|
|
298
|
+
body: JSON.stringify({
|
|
299
|
+
text: n ?? "",
|
|
300
|
+
description: c ?? "",
|
|
301
|
+
date: t ?? null,
|
|
302
|
+
completed: r ?? !1,
|
|
303
|
+
cancelled: o ?? !1,
|
|
304
|
+
zIndex: a ?? 0,
|
|
305
|
+
width: i ?? 200,
|
|
306
|
+
height: d ?? 120,
|
|
307
|
+
parentId: g ?? null
|
|
308
|
+
})
|
|
309
|
+
});
|
|
310
|
+
if (!E.ok)
|
|
311
|
+
throw new Error(await h(E));
|
|
312
|
+
return await E.json();
|
|
313
|
+
},
|
|
314
|
+
async updateText(n, c) {
|
|
315
|
+
const t = await fetch(`/api/v1/roadmap/${n}/text`, {
|
|
316
|
+
method: "PATCH",
|
|
317
|
+
headers: { "Content-Type": "application/json" },
|
|
318
|
+
body: JSON.stringify({ text: c ?? "" })
|
|
319
|
+
});
|
|
320
|
+
if (!t.ok)
|
|
321
|
+
throw new Error(await h(t));
|
|
322
|
+
return await t.json();
|
|
323
|
+
},
|
|
324
|
+
async updateDescription(n, c) {
|
|
325
|
+
const t = await fetch(`/api/v1/roadmap/${n}/description`, {
|
|
326
|
+
method: "PATCH",
|
|
327
|
+
headers: { "Content-Type": "application/json" },
|
|
328
|
+
body: JSON.stringify({ description: c ?? "" })
|
|
329
|
+
});
|
|
330
|
+
if (!t.ok)
|
|
331
|
+
throw new Error(await h(t));
|
|
332
|
+
return await t.json();
|
|
333
|
+
},
|
|
334
|
+
async updateDate(n, c, t) {
|
|
335
|
+
const r = await fetch(`/api/v1/roadmap/${n}/date`, {
|
|
336
|
+
method: "PATCH",
|
|
337
|
+
headers: { "Content-Type": "application/json" },
|
|
338
|
+
body: JSON.stringify({ date: c ?? null, completed: t ?? !1 })
|
|
339
|
+
});
|
|
340
|
+
if (!r.ok)
|
|
341
|
+
throw new Error(await h(r));
|
|
342
|
+
return await r.json();
|
|
343
|
+
},
|
|
344
|
+
async updateCompleted(n, c) {
|
|
345
|
+
const t = await fetch(`/api/v1/roadmap/${n}/completed`, {
|
|
346
|
+
method: "PATCH",
|
|
347
|
+
headers: { "Content-Type": "application/json" },
|
|
348
|
+
body: JSON.stringify({ completed: c ?? !1 })
|
|
349
|
+
});
|
|
350
|
+
if (!t.ok)
|
|
351
|
+
throw new Error(await h(t));
|
|
352
|
+
return await t.json();
|
|
353
|
+
},
|
|
354
|
+
async updateCancelled(n, c) {
|
|
355
|
+
const t = await fetch(`/api/v1/roadmap/${n}/cancelled`, {
|
|
356
|
+
method: "PATCH",
|
|
357
|
+
headers: { "Content-Type": "application/json" },
|
|
358
|
+
body: JSON.stringify({ cancelled: c ?? !1 })
|
|
359
|
+
});
|
|
360
|
+
if (!t.ok)
|
|
361
|
+
throw new Error(await h(t));
|
|
362
|
+
return await t.json();
|
|
363
|
+
},
|
|
364
|
+
async updateZIndex(n, c) {
|
|
365
|
+
const t = await fetch(`/api/v1/roadmap/${n}/z-index`, {
|
|
366
|
+
method: "PATCH",
|
|
367
|
+
headers: { "Content-Type": "application/json" },
|
|
368
|
+
body: JSON.stringify({ zIndex: c ?? 0 })
|
|
369
|
+
});
|
|
370
|
+
if (!t.ok)
|
|
371
|
+
throw new Error(await h(t));
|
|
372
|
+
return await t.json();
|
|
373
|
+
},
|
|
374
|
+
async updateSize(n, c, t) {
|
|
375
|
+
const r = await fetch(`/api/v1/roadmap/${n}/size`, {
|
|
376
|
+
method: "PATCH",
|
|
377
|
+
headers: { "Content-Type": "application/json" },
|
|
378
|
+
body: JSON.stringify({ width: c, height: t })
|
|
379
|
+
});
|
|
380
|
+
if (!r.ok)
|
|
381
|
+
throw new Error(await h(r));
|
|
382
|
+
return await r.json();
|
|
383
|
+
},
|
|
384
|
+
async delete(n) {
|
|
385
|
+
const c = await fetch(`/api/v1/roadmap/${n}`, {
|
|
386
|
+
method: "DELETE",
|
|
387
|
+
headers: { "Content-Type": "application/json" }
|
|
388
|
+
});
|
|
389
|
+
if (!c.ok)
|
|
390
|
+
throw new Error(await h(c));
|
|
391
|
+
return c.status === 204;
|
|
392
|
+
}
|
|
393
|
+
}, se = ee((n, c) => ({
|
|
394
|
+
stickers: [],
|
|
395
|
+
edges: [],
|
|
396
|
+
topZ: 1,
|
|
397
|
+
selectedId: null,
|
|
398
|
+
addSticker: (t) => {
|
|
399
|
+
n((r) => {
|
|
400
|
+
const o = t && t.id ? String(t.id) : crypto.randomUUID(), a = t && t.zIndex ? t.zIndex : (r.topZ || 1) + 1, i = {
|
|
401
|
+
id: o,
|
|
402
|
+
x: t.x,
|
|
403
|
+
y: t.y,
|
|
404
|
+
width: t.width,
|
|
405
|
+
height: t.height,
|
|
406
|
+
color: t.color,
|
|
407
|
+
text: t.text ?? "",
|
|
408
|
+
description: t.description ?? "",
|
|
409
|
+
date: t.date ?? null,
|
|
410
|
+
completed: t.completed ?? !1,
|
|
411
|
+
cancelled: t.cancelled ?? !1,
|
|
412
|
+
parentId: t.parentId ?? null,
|
|
413
|
+
zIndex: a,
|
|
414
|
+
rotation: t.rotation ?? 0,
|
|
415
|
+
type: t.type,
|
|
416
|
+
shapeId: t.shapeId,
|
|
417
|
+
shapeData: t.shapeData,
|
|
418
|
+
imageUrl: t.imageUrl,
|
|
419
|
+
info: t.info ?? null
|
|
420
|
+
};
|
|
421
|
+
return {
|
|
422
|
+
stickers: [...r.stickers, i],
|
|
423
|
+
topZ: Math.max(r.topZ || 1, a)
|
|
424
|
+
};
|
|
425
|
+
});
|
|
426
|
+
},
|
|
427
|
+
addRoadmapBranch: async (t) => {
|
|
428
|
+
const r = c(), o = r.stickers.find((m) => String(m.id) === String(t));
|
|
429
|
+
if (!o)
|
|
430
|
+
return;
|
|
431
|
+
const a = r.stickers.filter(
|
|
432
|
+
(m) => r.edges.some((w) => String(w.source) === String(t) && String(w.target) === String(m.id))
|
|
433
|
+
), i = 200, d = 120, g = i + 140, E = 50, R = (o.x ?? 0) + g;
|
|
434
|
+
let S;
|
|
435
|
+
if (a.length === 0)
|
|
436
|
+
S = (o.y ?? 0) + (o.height || d) / 2 - d / 2 + E;
|
|
437
|
+
else {
|
|
438
|
+
const m = a.reduce((w, v) => {
|
|
439
|
+
const O = (w.y ?? 0) + (w.height || d);
|
|
440
|
+
return (v.y ?? 0) + (v.height || d) > O ? v : w;
|
|
441
|
+
});
|
|
442
|
+
S = (m.y ?? 0) + (m.height || d) + E;
|
|
443
|
+
}
|
|
444
|
+
const k = (r.topZ || 1) + 1;
|
|
445
|
+
let p;
|
|
446
|
+
try {
|
|
447
|
+
p = await ne.create({
|
|
448
|
+
text: "",
|
|
449
|
+
description: "",
|
|
450
|
+
date: null,
|
|
451
|
+
completed: !1,
|
|
452
|
+
cancelled: !1,
|
|
453
|
+
zIndex: k,
|
|
454
|
+
width: i,
|
|
455
|
+
height: d,
|
|
456
|
+
parentId: String(t)
|
|
457
|
+
});
|
|
458
|
+
} catch (m) {
|
|
459
|
+
console.warn("Не удалось создать roadmap ветку", m);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
const _ = String(p.id);
|
|
463
|
+
r.addSticker({
|
|
464
|
+
id: _,
|
|
465
|
+
type: "roadmap",
|
|
466
|
+
x: R,
|
|
467
|
+
y: S,
|
|
468
|
+
width: p.width ?? i,
|
|
469
|
+
height: p.height ?? d,
|
|
470
|
+
text: p.text ?? "",
|
|
471
|
+
description: p.description ?? "",
|
|
472
|
+
date: p.date ?? null,
|
|
473
|
+
completed: p.completed ?? !1,
|
|
474
|
+
cancelled: p.cancelled ?? !1,
|
|
475
|
+
parentId: p.parentId ?? String(t),
|
|
476
|
+
zIndex: p.zIndex ?? k
|
|
477
|
+
}), n((m) => ({
|
|
478
|
+
edges: [
|
|
479
|
+
...m.edges,
|
|
480
|
+
{
|
|
481
|
+
id: `e-${t}-${_}`,
|
|
482
|
+
source: String(t),
|
|
483
|
+
target: _,
|
|
484
|
+
type: "default",
|
|
485
|
+
animated: !1
|
|
486
|
+
}
|
|
487
|
+
],
|
|
488
|
+
topZ: Math.max(m.topZ || 1, k)
|
|
489
|
+
}));
|
|
490
|
+
},
|
|
491
|
+
setStickers: (t) => {
|
|
492
|
+
n(() => ({
|
|
493
|
+
stickers: t,
|
|
494
|
+
topZ: t.reduce((r, o) => Math.max(r, o.zIndex ?? 1), 1)
|
|
495
|
+
}));
|
|
496
|
+
},
|
|
497
|
+
setEdges: (t) => {
|
|
498
|
+
n(() => ({
|
|
499
|
+
edges: t
|
|
500
|
+
}));
|
|
501
|
+
},
|
|
502
|
+
reset: () => {
|
|
503
|
+
n({
|
|
504
|
+
stickers: [],
|
|
505
|
+
edges: [],
|
|
506
|
+
topZ: 1,
|
|
507
|
+
selectedId: null
|
|
508
|
+
});
|
|
509
|
+
},
|
|
510
|
+
updateSticker: (t, r) => {
|
|
511
|
+
n((o) => ({
|
|
512
|
+
stickers: o.stickers.map(
|
|
513
|
+
(a) => String(a.id) === String(t) ? { ...a, ...r } : a
|
|
514
|
+
)
|
|
515
|
+
}));
|
|
516
|
+
},
|
|
517
|
+
setPosition: (t, r, o) => {
|
|
518
|
+
n((a) => ({
|
|
519
|
+
stickers: a.stickers.map(
|
|
520
|
+
(i) => String(i.id) === String(t) ? { ...i, x: r, y: o } : i
|
|
521
|
+
)
|
|
522
|
+
}));
|
|
523
|
+
},
|
|
524
|
+
setSize: (t, r, o) => {
|
|
525
|
+
n((a) => ({
|
|
526
|
+
stickers: a.stickers.map(
|
|
527
|
+
(i) => String(i.id) === String(t) ? { ...i, width: r, height: o } : i
|
|
528
|
+
)
|
|
529
|
+
}));
|
|
530
|
+
},
|
|
531
|
+
setText: (t, r) => {
|
|
532
|
+
n((o) => ({
|
|
533
|
+
stickers: o.stickers.map(
|
|
534
|
+
(a) => String(a.id) === String(t) ? { ...a, text: r } : a
|
|
535
|
+
)
|
|
536
|
+
}));
|
|
537
|
+
},
|
|
538
|
+
bringToFront: (t) => {
|
|
539
|
+
n((r) => {
|
|
540
|
+
if (!r.stickers.find((i) => String(i.id) === String(t)))
|
|
541
|
+
return r;
|
|
542
|
+
const a = (r.topZ || 1) + 1;
|
|
543
|
+
return {
|
|
544
|
+
stickers: r.stickers.map((i) => String(i.id) === String(t) ? { ...i, zIndex: a } : i),
|
|
545
|
+
topZ: a
|
|
546
|
+
};
|
|
547
|
+
});
|
|
548
|
+
},
|
|
549
|
+
removeSticker: (t) => {
|
|
550
|
+
n((r) => {
|
|
551
|
+
const o = r.stickers.filter((a) => String(a.id) !== String(t));
|
|
552
|
+
return {
|
|
553
|
+
stickers: o,
|
|
554
|
+
edges: r.edges.filter((a) => String(a.source) !== String(t) && String(a.target) !== String(t)),
|
|
555
|
+
topZ: o.reduce((a, i) => Math.max(a, i.zIndex ?? 1), 1)
|
|
556
|
+
};
|
|
557
|
+
});
|
|
558
|
+
},
|
|
559
|
+
selectSticker: (t) => {
|
|
560
|
+
n({ selectedId: t });
|
|
561
|
+
},
|
|
562
|
+
getDescendants: (t) => {
|
|
563
|
+
const { stickers: r } = c(), o = [], a = (i) => {
|
|
564
|
+
const d = r.filter(
|
|
565
|
+
(g) => String(g.parentId) === String(i)
|
|
566
|
+
);
|
|
567
|
+
for (const g of d)
|
|
568
|
+
o.push(g), a(g.id);
|
|
569
|
+
};
|
|
570
|
+
return a(t), o;
|
|
571
|
+
},
|
|
572
|
+
removeStickersBulk: (t) => {
|
|
573
|
+
n((r) => {
|
|
574
|
+
const o = new Set(t.map(String)), a = r.stickers.filter(
|
|
575
|
+
(i) => !o.has(String(i.id))
|
|
576
|
+
);
|
|
577
|
+
return {
|
|
578
|
+
stickers: a,
|
|
579
|
+
edges: r.edges.filter(
|
|
580
|
+
(i) => !o.has(String(i.source)) && !o.has(String(i.target))
|
|
581
|
+
),
|
|
582
|
+
topZ: a.reduce(
|
|
583
|
+
(i, d) => Math.max(i, d.zIndex ?? 1),
|
|
584
|
+
1
|
|
585
|
+
)
|
|
586
|
+
};
|
|
587
|
+
});
|
|
588
|
+
},
|
|
589
|
+
detachChildren: (t) => {
|
|
590
|
+
n((r) => ({
|
|
591
|
+
stickers: r.stickers.map(
|
|
592
|
+
(o) => String(o.parentId) === String(t) ? { ...o, parentId: null } : o
|
|
593
|
+
)
|
|
594
|
+
}));
|
|
595
|
+
}
|
|
596
|
+
})), ce = 91, le = 84, de = 160, ue = 160, fe = 10, pe = "application/x-integration-shape", me = "application/x-integration-emoji", he = "application/x-integration-note", ge = "dnd/markdown", we = "application/roadmap";
|
|
597
|
+
export {
|
|
598
|
+
fe as B,
|
|
599
|
+
pe as D,
|
|
600
|
+
ce as E,
|
|
601
|
+
de as N,
|
|
602
|
+
le as a,
|
|
603
|
+
me as b,
|
|
604
|
+
ue as c,
|
|
605
|
+
ge as d,
|
|
606
|
+
we as e,
|
|
607
|
+
he as f,
|
|
608
|
+
ie as j,
|
|
609
|
+
ne as r,
|
|
610
|
+
se as u
|
|
611
|
+
};
|
|
612
|
+
//# sourceMappingURL=constants-pVjh1MjZ.js.map
|