@aintela/chat 0.2.53 → 0.2.54
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/{atMentions-BQ-FxbtK.js → atMentions-DgYt2JSK.js} +207 -186
- package/dist/atMentions-DgYt2JSK.js.map +1 -0
- package/dist/{auth-DnA-Qvpi.js → auth-Bx_DLZsc.js} +2 -2
- package/dist/{auth-DnA-Qvpi.js.map → auth-Bx_DLZsc.js.map} +1 -1
- package/dist/components.js +3181 -3184
- package/dist/components.js.map +1 -1
- package/dist/index.js +30 -29
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/placeCaret.d.ts +19 -0
- package/dist/utils.js +16 -15
- package/package.json +1 -1
- package/dist/atMentions-BQ-FxbtK.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
var d = (i, t) =>
|
|
1
|
+
var A = Object.defineProperty;
|
|
2
|
+
var d = (i, t) => A(i, "name", { value: t, configurable: !0 });
|
|
3
3
|
const O = /* @__PURE__ */ d((i) => {
|
|
4
4
|
if (i[0] == "#")
|
|
5
5
|
return null;
|
|
@@ -9,72 +9,72 @@ const O = /* @__PURE__ */ d((i) => {
|
|
|
9
9
|
return null;
|
|
10
10
|
const s = e.split("?")[0];
|
|
11
11
|
return s.startsWith("#") ? s : s.split("#")[0];
|
|
12
|
-
}, "parseAndValidateArtifactUrl"),
|
|
13
|
-
let s = "URL",
|
|
12
|
+
}, "parseAndValidateArtifactUrl"), I = /* @__PURE__ */ d((i, t, e) => {
|
|
13
|
+
let s = "URL", o = null, n = null, r = null;
|
|
14
14
|
if (i[0] == "#") {
|
|
15
15
|
const a = i.indexOf("-"), l = i.slice(1, a);
|
|
16
|
-
switch (
|
|
16
|
+
switch (r = i.slice(a + 1), l.toLowerCase()) {
|
|
17
17
|
case "opendashboard":
|
|
18
18
|
s = "OpenDashboard";
|
|
19
19
|
break;
|
|
20
20
|
case "ask":
|
|
21
|
-
s = "Question",
|
|
21
|
+
s = "Question", o = e;
|
|
22
22
|
break;
|
|
23
23
|
}
|
|
24
24
|
} else
|
|
25
25
|
i.indexOf("http") > -1 ? (s = "URL", n = i) : (i = i.replaceAll("exported/", `exported/${t}/`), s = "Export");
|
|
26
|
-
return { action: s, url: n, question:
|
|
26
|
+
return { action: s, url: n, question: o, parameter: r };
|
|
27
27
|
}, "extractLinkAction"), T = /* @__PURE__ */ d((i, t) => Array.from(
|
|
28
28
|
{ length: Math.ceil(i.length / t) },
|
|
29
29
|
(e, s) => i.slice(s * t, s * t + t)
|
|
30
|
-
), "chunkArray"),
|
|
30
|
+
), "chunkArray"), F = /* @__PURE__ */ d((i) => {
|
|
31
31
|
i = i.replaceAll("\\n", `
|
|
32
32
|
`);
|
|
33
33
|
const t = 90, e = i.split(" "), s = [];
|
|
34
|
-
let
|
|
34
|
+
let o = !1;
|
|
35
35
|
for (const n of e)
|
|
36
36
|
if (n.length > t) {
|
|
37
|
-
|
|
38
|
-
const
|
|
37
|
+
o = !0;
|
|
38
|
+
const r = [...n], l = T(r, t).map((c) => c.join("")).join(`
|
|
39
39
|
`);
|
|
40
40
|
s.push(l);
|
|
41
41
|
} else
|
|
42
42
|
s.push(n);
|
|
43
|
-
return
|
|
43
|
+
return o ? s.join(" ") : i;
|
|
44
44
|
}, "splitBigLinesWithSpaces");
|
|
45
45
|
function k(i) {
|
|
46
46
|
let t = parseFloat(i);
|
|
47
47
|
if (!isNaN(t))
|
|
48
48
|
return i = i.replaceAll(/[,\.]/g, ""), parseInt(i);
|
|
49
49
|
var e = "";
|
|
50
|
-
for (const
|
|
51
|
-
|
|
50
|
+
for (const o of i)
|
|
51
|
+
o.match(/[0-9]/) && (e += o);
|
|
52
52
|
const s = e.length / i.length;
|
|
53
53
|
return t = parseInt(e), !isNaN(t) && s > 0.5 ? t : NaN;
|
|
54
54
|
}
|
|
55
55
|
d(k, "parseRawNumber");
|
|
56
|
-
function
|
|
56
|
+
function H(i) {
|
|
57
57
|
if (!i) return { prefix: void 0, suffix: void 0, number: void 0 };
|
|
58
58
|
const t = /[$%(\w?\$)]/gi, e = /[a-z]?\$/gi;
|
|
59
|
-
let s = "",
|
|
59
|
+
let s = "", o = "";
|
|
60
60
|
if (i.match(t)) {
|
|
61
|
-
i.indexOf("%") > -1 && (
|
|
61
|
+
i.indexOf("%") > -1 && (o = " %");
|
|
62
62
|
const a = i.match(e);
|
|
63
63
|
a && (s = a[0] + " ");
|
|
64
64
|
}
|
|
65
65
|
let n = parseFloat(i);
|
|
66
66
|
if (!isNaN(n))
|
|
67
|
-
return i = i.replaceAll(".", "").replaceAll(",", "."), { prefix: s, suffix:
|
|
68
|
-
var
|
|
67
|
+
return i = i.replaceAll(".", "").replaceAll(",", "."), { prefix: s, suffix: o, number: parseFloat(i) };
|
|
68
|
+
var r = "";
|
|
69
69
|
for (const a of i)
|
|
70
70
|
if (a.match(/[0-9.,]/)) {
|
|
71
71
|
let l = a;
|
|
72
|
-
l == "." ? l = "" : l == "," && (l = "."),
|
|
72
|
+
l == "." ? l = "" : l == "," && (l = "."), r += l;
|
|
73
73
|
}
|
|
74
|
-
return n = parseFloat(
|
|
74
|
+
return n = parseFloat(r), isNaN(n) ? { prefix: void 0, suffix: void 0, number: void 0 } : { prefix: s, suffix: o, number: n };
|
|
75
75
|
}
|
|
76
|
-
d(
|
|
77
|
-
const E = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,
|
|
76
|
+
d(H, "parseKnownNumbers");
|
|
77
|
+
const E = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i, L = /^[0-9a-f]{32}/i;
|
|
78
78
|
function R(i) {
|
|
79
79
|
if (!i || typeof i != "string")
|
|
80
80
|
return !1;
|
|
@@ -88,13 +88,13 @@ function $(i) {
|
|
|
88
88
|
const t = i.match(E);
|
|
89
89
|
if (t)
|
|
90
90
|
return t[0];
|
|
91
|
-
const e = i.match(
|
|
91
|
+
const e = i.match(L);
|
|
92
92
|
return e ? e[0] : null;
|
|
93
93
|
}
|
|
94
94
|
d($, "extractInteractionId");
|
|
95
95
|
function _(i) {
|
|
96
|
-
const s = i.replaceAll("_", " ").replaceAll("-", " ").replaceAll("user:", "").replace(/\.[^/.]+$/, ""),
|
|
97
|
-
return
|
|
96
|
+
const s = i.replaceAll("_", " ").replaceAll("-", " ").replaceAll("user:", "").replace(/\.[^/.]+$/, ""), o = N(s).trim();
|
|
97
|
+
return o.length > 1 ? o[0].toUpperCase() + o.slice(1) : o;
|
|
98
98
|
}
|
|
99
99
|
d(_, "prettiffyFileName");
|
|
100
100
|
function z(i) {
|
|
@@ -108,7 +108,7 @@ function N(i) {
|
|
|
108
108
|
const t = i.match(E);
|
|
109
109
|
if (t)
|
|
110
110
|
return i.replace(t[0], "");
|
|
111
|
-
const e = i.match(
|
|
111
|
+
const e = i.match(L);
|
|
112
112
|
return e ? i.replace(e[0], "") : i;
|
|
113
113
|
}
|
|
114
114
|
d(N, "extractNameFromStringWithInteractionId");
|
|
@@ -214,13 +214,13 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
214
214
|
* Make a specific table sortable
|
|
215
215
|
*/
|
|
216
216
|
makeTableSortable(t, e) {
|
|
217
|
-
let s = t.querySelector("thead"),
|
|
218
|
-
if (s && (
|
|
217
|
+
let s = t.querySelector("thead"), o = null, n = [];
|
|
218
|
+
if (s && (o = s.querySelector("tr"), o && (n = o.querySelectorAll("th"))), n.length === 0) {
|
|
219
219
|
console.warn("Table has no sortable columns, skipping");
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
|
-
const
|
|
223
|
-
t.classList.add("sortable-table"),
|
|
222
|
+
const r = !t.hasAttribute("data-sortable-arrived");
|
|
223
|
+
t.classList.add("sortable-table"), r && (t.setAttribute("data-sortable-arrived", "true"), t.classList.add("sortable-table-arriving"), setTimeout(() => {
|
|
224
224
|
t.classList.remove("sortable-table-arriving");
|
|
225
225
|
}, 400)), this.sortStates.set(e, {
|
|
226
226
|
currentColumn: -1,
|
|
@@ -236,12 +236,12 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
236
236
|
replaceExponentialValues(t) {
|
|
237
237
|
const e = t.querySelector("tbody");
|
|
238
238
|
if (!e) return;
|
|
239
|
-
e.querySelectorAll("tr").forEach((
|
|
240
|
-
|
|
241
|
-
const l =
|
|
239
|
+
e.querySelectorAll("tr").forEach((o) => {
|
|
240
|
+
o.querySelectorAll("td, th").forEach((r) => {
|
|
241
|
+
const l = r.textContent.trim().match(/^([\d,]+\.?\d*)[eE][+-]?(\d+)$/);
|
|
242
242
|
if (l) {
|
|
243
243
|
const c = parseFloat(l[1].replace(/,/g, "")), p = parseInt(l[2]), u = c * Math.pow(10, p), h = this.formatNumber(u);
|
|
244
|
-
|
|
244
|
+
r.textContent = h;
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
});
|
|
@@ -263,30 +263,30 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
263
263
|
*/
|
|
264
264
|
convertRowToHeader(t, e, s) {
|
|
265
265
|
try {
|
|
266
|
-
const
|
|
267
|
-
return
|
|
266
|
+
const o = t.cloneNode(!0);
|
|
267
|
+
return o.querySelectorAll("td").forEach((r) => {
|
|
268
268
|
const a = document.createElement("th");
|
|
269
|
-
Array.from(
|
|
269
|
+
Array.from(r.attributes).forEach((l) => {
|
|
270
270
|
a.setAttribute(l.name, l.value);
|
|
271
|
-
}), a.innerHTML =
|
|
272
|
-
}), s && s.contains(t) ? s.removeChild(t) : t.parentNode && t.parentNode.removeChild(t), e.appendChild(
|
|
273
|
-
} catch (
|
|
274
|
-
return console.error("Error converting row to header:",
|
|
271
|
+
}), a.innerHTML = r.innerHTML, a.style.cssText = r.style.cssText, r.parentNode.replaceChild(a, r);
|
|
272
|
+
}), s && s.contains(t) ? s.removeChild(t) : t.parentNode && t.parentNode.removeChild(t), e.appendChild(o), o;
|
|
273
|
+
} catch (o) {
|
|
274
|
+
return console.error("Error converting row to header:", o), null;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
/**
|
|
278
278
|
* Make a specific header sortable
|
|
279
279
|
*/
|
|
280
|
-
makeHeaderSortable(t, e, s,
|
|
281
|
-
t.classList.add(this.options.sortableClass), t.style.cursor = "pointer", (!this.options.preserveExistingIcons || !t.querySelector(".material-icons")) && this.addSortIcon(t), this.options.enableResizing && this.addResizing(t, e, s,
|
|
280
|
+
makeHeaderSortable(t, e, s, o) {
|
|
281
|
+
t.classList.add(this.options.sortableClass), t.style.cursor = "pointer", (!this.options.preserveExistingIcons || !t.querySelector(".material-icons")) && this.addSortIcon(t), this.options.enableResizing && this.addResizing(t, e, s, o), this.options.enableReordering && this.addDragAndDrop(t, e, s, o);
|
|
282
282
|
const n = /* @__PURE__ */ d((l) => {
|
|
283
|
-
l.preventDefault(), this.sortTable(e, s,
|
|
284
|
-
}, "clickListener"),
|
|
283
|
+
l.preventDefault(), this.sortTable(e, s, o);
|
|
284
|
+
}, "clickListener"), r = /* @__PURE__ */ d((l) => {
|
|
285
285
|
t.classList.contains(this.options.activeSortClass) || (t.style.background = this.options.theme.palette.surface.hover);
|
|
286
286
|
}, "mouseEnterListener"), a = /* @__PURE__ */ d((l) => {
|
|
287
287
|
t.classList.contains(this.options.activeSortClass) || (t.style.background = "");
|
|
288
288
|
}, "mouseLeaveListener");
|
|
289
|
-
t.removeEventListener("click", n), t.addEventListener("click", n), t.removeEventListener("mouseenter",
|
|
289
|
+
t.removeEventListener("click", n), t.addEventListener("click", n), t.removeEventListener("mouseenter", r), t.addEventListener("mouseenter", r), t.removeEventListener("mouseleave", a), t.addEventListener("mouseleave", a);
|
|
290
290
|
}
|
|
291
291
|
/**
|
|
292
292
|
* Add sort icon to header
|
|
@@ -305,33 +305,33 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
305
305
|
* Sort table by column
|
|
306
306
|
*/
|
|
307
307
|
sortTable(t, e, s) {
|
|
308
|
-
const
|
|
309
|
-
if (!
|
|
308
|
+
const o = t.querySelector("tbody");
|
|
309
|
+
if (!o) {
|
|
310
310
|
console.warn("Table has no tbody element");
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
|
-
const n = Array.from(
|
|
313
|
+
const n = Array.from(o.querySelectorAll("tr"));
|
|
314
314
|
if (n.length === 0) {
|
|
315
315
|
console.warn("Table has no data rows");
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
|
-
const
|
|
318
|
+
const r = this.sortStates.get(e);
|
|
319
319
|
t.querySelector(`thead tr th:nth-child(${s + 1})`);
|
|
320
320
|
let a;
|
|
321
|
-
if (this.options.sortOnFirstClick ? a =
|
|
321
|
+
if (this.options.sortOnFirstClick ? a = r.currentColumn === s && r.direction === "asc" ? "desc" : "asc" : r.currentColumn !== s ? a = "asc" : a = r.direction === "none" ? "asc" : r.direction === "asc" ? "desc" : "none", r.currentColumn = s, r.direction = a, this.sortStates.set(e, r), this.updateSortIndicators(t, e, s, a), a === "none") {
|
|
322
322
|
this.restoreOriginalOrder(t, n);
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
this.sortRows(n, s, a).forEach((c) =>
|
|
325
|
+
this.sortRows(n, s, a).forEach((c) => o.appendChild(c));
|
|
326
326
|
}
|
|
327
327
|
/**
|
|
328
328
|
* Sort rows based on column data
|
|
329
329
|
*/
|
|
330
330
|
sortRows(t, e, s) {
|
|
331
|
-
return t.sort((
|
|
332
|
-
const
|
|
333
|
-
if (!
|
|
334
|
-
const l = this.extractValue(
|
|
331
|
+
return t.sort((o, n) => {
|
|
332
|
+
const r = o.cells[e], a = n.cells[e];
|
|
333
|
+
if (!r || !a) return 0;
|
|
334
|
+
const l = this.extractValue(r), c = this.extractValue(a);
|
|
335
335
|
if (this.options.customSorters[e])
|
|
336
336
|
return this.options.customSorters[e](l, c, s);
|
|
337
337
|
const p = this.compareValues(l, c);
|
|
@@ -350,9 +350,9 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
350
350
|
const n = e.match(/^([\d,]+\.?\d*)\s*%$/);
|
|
351
351
|
if (n)
|
|
352
352
|
return parseFloat(n[1].replace(/,/g, ""));
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
355
|
-
const p = parseFloat(
|
|
353
|
+
const r = e.match(/^([\d,]+\.?\d*)[eE][+-]?(\d+)$/);
|
|
354
|
+
if (r) {
|
|
355
|
+
const p = parseFloat(r[1].replace(/,/g, "")), u = parseInt(r[2]);
|
|
356
356
|
return p * Math.pow(10, u);
|
|
357
357
|
}
|
|
358
358
|
if (e.match(/^[\d,]+\.?\d*[KMB]?$/))
|
|
@@ -372,17 +372,17 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
372
372
|
/**
|
|
373
373
|
* Update visual indicators for sort state
|
|
374
374
|
*/
|
|
375
|
-
updateSortIndicators(t, e, s,
|
|
375
|
+
updateSortIndicators(t, e, s, o) {
|
|
376
376
|
const n = t.querySelectorAll("thead tr th");
|
|
377
|
-
if (n.forEach((
|
|
378
|
-
|
|
379
|
-
const l =
|
|
377
|
+
if (n.forEach((r, a) => {
|
|
378
|
+
r.classList.remove(this.options.activeSortClass, this.options.ascendingClass, this.options.descendingClass);
|
|
379
|
+
const l = r.querySelector(".material-icons");
|
|
380
380
|
l && (l.textContent = this.options.unsortedIcon, l.style.opacity = "0.6");
|
|
381
|
-
}),
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
const a =
|
|
385
|
-
a && (
|
|
381
|
+
}), o !== "none") {
|
|
382
|
+
const r = n[s];
|
|
383
|
+
r.classList.add(this.options.activeSortClass);
|
|
384
|
+
const a = r.querySelector(".material-icons");
|
|
385
|
+
a && (o === "asc" ? (r.classList.add(this.options.ascendingClass), a.textContent = this.options.ascendingIcon) : (r.classList.add(this.options.descendingClass), a.textContent = this.options.descendingIcon), a.style.opacity = "1");
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
/**
|
|
@@ -390,12 +390,12 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
390
390
|
*/
|
|
391
391
|
restoreOriginalOrder(t, e) {
|
|
392
392
|
const s = t.querySelector("tbody");
|
|
393
|
-
e.forEach((
|
|
393
|
+
e.forEach((o) => s.appendChild(o));
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
396
|
* Add resizing functionality to a header
|
|
397
397
|
*/
|
|
398
|
-
addResizing(t, e, s,
|
|
398
|
+
addResizing(t, e, s, o) {
|
|
399
399
|
if (t.classList.add(this.options.resizableClass), t.style.position = "relative", t.querySelector(".resize-handle"))
|
|
400
400
|
return;
|
|
401
401
|
const n = document.createElement("div");
|
|
@@ -409,12 +409,12 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
409
409
|
cursor: col-resize;
|
|
410
410
|
z-index: 10;
|
|
411
411
|
`, t.appendChild(n);
|
|
412
|
-
let
|
|
412
|
+
let r = !1, a = 0, l = 0;
|
|
413
413
|
n.addEventListener("mousedown", (u) => {
|
|
414
|
-
u.preventDefault(), u.stopPropagation(), u.stopImmediatePropagation(),
|
|
414
|
+
u.preventDefault(), u.stopPropagation(), u.stopImmediatePropagation(), r = !0, a = u.clientX, l = t.offsetWidth, t.style.borderRight = "2px solid var(--primary-main, #2196F3)", t.style.background = "var(--background-active, rgba(255, 255, 255, 0.1))", document.addEventListener("mousemove", c), document.addEventListener("mouseup", p), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
415
415
|
});
|
|
416
416
|
const c = /* @__PURE__ */ d((u) => {
|
|
417
|
-
if (!
|
|
417
|
+
if (!r) return;
|
|
418
418
|
const h = l + (u.clientX - a);
|
|
419
419
|
if (h > 30) {
|
|
420
420
|
t.style.width = h + "px";
|
|
@@ -425,39 +425,39 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
425
425
|
}), this.updateTableWidth(e);
|
|
426
426
|
}
|
|
427
427
|
}, "handleResize"), p = /* @__PURE__ */ d(() => {
|
|
428
|
-
|
|
428
|
+
r = !1, t.style.borderRight = "", t.style.background = "", document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", p), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
429
429
|
}, "stopResize");
|
|
430
430
|
}
|
|
431
431
|
/**
|
|
432
432
|
* Add drag and drop functionality to a header
|
|
433
433
|
*/
|
|
434
|
-
addDragAndDrop(t, e, s,
|
|
434
|
+
addDragAndDrop(t, e, s, o) {
|
|
435
435
|
if (t.querySelector(".drag-handle"))
|
|
436
436
|
return;
|
|
437
437
|
t.classList.add(this.options.draggableClass), t.draggable = !0;
|
|
438
438
|
const n = e.querySelector("thead tr");
|
|
439
|
-
t.addEventListener("dragstart", (
|
|
439
|
+
t.addEventListener("dragstart", (r) => {
|
|
440
440
|
this.isDragging = !0;
|
|
441
441
|
const a = Array.from(n.children).indexOf(t);
|
|
442
|
-
this.dragSource = { table: e, tableIndex: s, columnIndex: a },
|
|
442
|
+
this.dragSource = { table: e, tableIndex: s, columnIndex: a }, r.dataTransfer.effectAllowed = "move", r.dataTransfer.setData("text/html", t.outerHTML);
|
|
443
443
|
const l = t.outerHTML;
|
|
444
|
-
t.style.opacity = "0.5", this.createCustomDragImage(
|
|
445
|
-
}), t.addEventListener("dragend", (
|
|
444
|
+
t.style.opacity = "0.5", this.createCustomDragImage(r, t, l);
|
|
445
|
+
}), t.addEventListener("dragend", (r) => {
|
|
446
446
|
this.isDragging = !1, this.dragSource = null, t.style.opacity = "", this.clearAllColumnHighlights(e);
|
|
447
|
-
}), t.addEventListener("dragover", (
|
|
448
|
-
|
|
449
|
-
}), t.addEventListener("dragenter", (
|
|
450
|
-
if (
|
|
447
|
+
}), t.addEventListener("dragover", (r) => {
|
|
448
|
+
r.preventDefault(), r.dataTransfer.dropEffect = "move";
|
|
449
|
+
}), t.addEventListener("dragenter", (r) => {
|
|
450
|
+
if (r.preventDefault(), this.dragSource && this.dragSource.tableIndex === s) {
|
|
451
451
|
const a = Array.from(n.children).indexOf(t);
|
|
452
452
|
this.dragSource.columnIndex !== a && this.highlightColumn(e, a, !0);
|
|
453
453
|
}
|
|
454
|
-
}), t.addEventListener("dragleave", (
|
|
455
|
-
if (!t.contains(
|
|
454
|
+
}), t.addEventListener("dragleave", (r) => {
|
|
455
|
+
if (!t.contains(r.relatedTarget)) {
|
|
456
456
|
const a = Array.from(n.children).indexOf(t);
|
|
457
457
|
this.highlightColumn(e, a, !1);
|
|
458
458
|
}
|
|
459
|
-
}), t.addEventListener("drop", (
|
|
460
|
-
if (
|
|
459
|
+
}), t.addEventListener("drop", (r) => {
|
|
460
|
+
if (r.preventDefault(), this.dragSource && this.dragSource.tableIndex === s) {
|
|
461
461
|
const a = Array.from(n.children).indexOf(t);
|
|
462
462
|
this.dragSource.columnIndex !== a && this.reorderColumns(e, s, this.dragSource.columnIndex, a);
|
|
463
463
|
}
|
|
@@ -468,8 +468,8 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
468
468
|
* Create a custom drag image for better UX
|
|
469
469
|
*/
|
|
470
470
|
createCustomDragImage(t, e, s) {
|
|
471
|
-
const
|
|
472
|
-
|
|
471
|
+
const o = document.createElement("div");
|
|
472
|
+
o.style.cssText = `
|
|
473
473
|
position: absolute;
|
|
474
474
|
top: -1000px;
|
|
475
475
|
left: -1000px;
|
|
@@ -493,32 +493,32 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
493
493
|
align-items: center;
|
|
494
494
|
`;
|
|
495
495
|
const n = s;
|
|
496
|
-
|
|
496
|
+
o.innerHTML = `
|
|
497
497
|
<div style="display: flex; align-items: center; gap: 5px; align-content: center;color:white;">
|
|
498
498
|
<span style="overflow: hidden; text-overflow: ellipsis">${n}</span>
|
|
499
499
|
<svg style="fill: grey; font-size: 10px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20" ><defs><path id="a" d="M0 0h24v24H0V0z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><path clip-path="url(#b)" d="M9.01 14H2v2h7.01v3L13 15l-3.99-4v3zm5.98-1v-3H22V8h-7.01V5L11 9l3.99 4z"/></svg>
|
|
500
500
|
</div>
|
|
501
|
-
`, document.body.appendChild(
|
|
502
|
-
document.body.contains(
|
|
501
|
+
`, document.body.appendChild(o), t.dataTransfer.setDragImage(o, 50, 12), setTimeout(() => {
|
|
502
|
+
document.body.contains(o) && document.body.removeChild(o);
|
|
503
503
|
}, 100);
|
|
504
504
|
}
|
|
505
505
|
/**
|
|
506
506
|
* Highlight an entire column during drag operations
|
|
507
507
|
*/
|
|
508
508
|
highlightColumn(t, e, s) {
|
|
509
|
-
const
|
|
510
|
-
if (!
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
509
|
+
const o = t.querySelector("thead tr"), n = t.querySelector("tbody");
|
|
510
|
+
if (!o || !n) return;
|
|
511
|
+
const r = o.children[e];
|
|
512
|
+
if (r)
|
|
513
513
|
if (s) {
|
|
514
|
-
|
|
514
|
+
r.classList.add(this.options.dragOverClass);
|
|
515
515
|
const a = n.children;
|
|
516
516
|
for (let l = 0; l < a.length; l++) {
|
|
517
517
|
const c = a[l].children[e];
|
|
518
518
|
c && c.classList.add(this.options.dragOverClass);
|
|
519
519
|
}
|
|
520
520
|
} else {
|
|
521
|
-
|
|
521
|
+
r.classList.remove(this.options.dragOverClass);
|
|
522
522
|
const a = n.children;
|
|
523
523
|
for (let l = 0; l < a.length; l++) {
|
|
524
524
|
const c = a[l].children[e];
|
|
@@ -532,12 +532,12 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
532
532
|
clearAllColumnHighlights(t) {
|
|
533
533
|
const e = t.querySelector("thead tr"), s = t.querySelector("tbody");
|
|
534
534
|
if (!e || !s) return;
|
|
535
|
-
const
|
|
536
|
-
for (let
|
|
537
|
-
r
|
|
535
|
+
const o = e.children;
|
|
536
|
+
for (let r = 0; r < o.length; r++)
|
|
537
|
+
o[r].classList.remove(this.options.dragOverClass);
|
|
538
538
|
const n = s.children;
|
|
539
|
-
for (let
|
|
540
|
-
const a = n[
|
|
539
|
+
for (let r = 0; r < n.length; r++) {
|
|
540
|
+
const a = n[r].children;
|
|
541
541
|
for (let l = 0; l < a.length; l++)
|
|
542
542
|
a[l].classList.remove(this.options.dragOverClass);
|
|
543
543
|
}
|
|
@@ -545,25 +545,25 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
545
545
|
/**
|
|
546
546
|
* Reorder columns in a table
|
|
547
547
|
*/
|
|
548
|
-
reorderColumns(t, e, s,
|
|
549
|
-
const n = t.querySelector("thead tr"),
|
|
550
|
-
if (!n || !
|
|
551
|
-
const a = Array.from(n.children), l = Array.from(
|
|
552
|
-
if (s < 0 || s >= a.length ||
|
|
548
|
+
reorderColumns(t, e, s, o) {
|
|
549
|
+
const n = t.querySelector("thead tr"), r = t.querySelector("tbody");
|
|
550
|
+
if (!n || !r) return;
|
|
551
|
+
const a = Array.from(n.children), l = Array.from(r.children);
|
|
552
|
+
if (s < 0 || s >= a.length || o < 0 || o >= a.length) {
|
|
553
553
|
console.warn("Invalid column indices for reordering");
|
|
554
554
|
return;
|
|
555
555
|
}
|
|
556
|
-
if (s ===
|
|
556
|
+
if (s === o)
|
|
557
557
|
return;
|
|
558
|
-
const c = a[s], p = a[
|
|
559
|
-
s <
|
|
560
|
-
const f = Array.from(h.children), m = f[s], y = f[
|
|
561
|
-
s <
|
|
558
|
+
const c = a[s], p = a[o];
|
|
559
|
+
s < o ? n.insertBefore(c, p.nextSibling) : n.insertBefore(c, p), l.forEach((h, g) => {
|
|
560
|
+
const f = Array.from(h.children), m = f[s], y = f[o];
|
|
561
|
+
s < o ? h.insertBefore(m, y.nextSibling) : h.insertBefore(m, y);
|
|
562
562
|
});
|
|
563
563
|
const u = this.originalColumnOrder.get(e);
|
|
564
564
|
if (u) {
|
|
565
565
|
const h = [...u], g = h[s];
|
|
566
|
-
h.splice(s, 1), h.splice(
|
|
566
|
+
h.splice(s, 1), h.splice(o, 0, g), this.originalColumnOrder.set(e, h);
|
|
567
567
|
}
|
|
568
568
|
this.applyTableStyles(t), this.refreshDragAndDropListeners(t, e);
|
|
569
569
|
}
|
|
@@ -573,11 +573,11 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
573
573
|
refreshDragAndDropListeners(t, e) {
|
|
574
574
|
const s = t.querySelector("thead tr");
|
|
575
575
|
if (!s) return;
|
|
576
|
-
Array.from(s.children).forEach((n,
|
|
576
|
+
Array.from(s.children).forEach((n, r) => {
|
|
577
577
|
if (n.classList.contains(this.options.draggableClass)) {
|
|
578
578
|
n.style.opacity = "", n.style.background = "", n.style.borderRight = "";
|
|
579
579
|
const a = n.cloneNode(!0);
|
|
580
|
-
n.parentNode.replaceChild(a, n), this.makeHeaderSortable(a, t, e,
|
|
580
|
+
n.parentNode.replaceChild(a, n), this.makeHeaderSortable(a, t, e, r);
|
|
581
581
|
}
|
|
582
582
|
});
|
|
583
583
|
}
|
|
@@ -587,14 +587,14 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
587
587
|
updateTableWidth(t) {
|
|
588
588
|
const e = t.querySelectorAll("th");
|
|
589
589
|
let s = 0;
|
|
590
|
-
e.forEach((
|
|
591
|
-
const n =
|
|
590
|
+
e.forEach((o) => {
|
|
591
|
+
const n = o.style.width;
|
|
592
592
|
if (n) {
|
|
593
|
-
const
|
|
594
|
-
s +=
|
|
593
|
+
const r = parseInt(n.replace("px", ""));
|
|
594
|
+
s += r;
|
|
595
595
|
} else {
|
|
596
|
-
const
|
|
597
|
-
s +=
|
|
596
|
+
const r = o.textContent.replace(/[📊🔍]/g, "").trim();
|
|
597
|
+
s += r.length;
|
|
598
598
|
}
|
|
599
599
|
}), t.style.width = `${s}px`;
|
|
600
600
|
}
|
|
@@ -603,27 +603,27 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
603
603
|
*/
|
|
604
604
|
calculateTableWidth(t) {
|
|
605
605
|
var u;
|
|
606
|
-
const e = t.getAttribute("data-original-width"), s = e ? parseFloat(e) : 0,
|
|
606
|
+
const e = t.getAttribute("data-original-width"), s = e ? parseFloat(e) : 0, o = t.querySelectorAll("th");
|
|
607
607
|
let n = 0;
|
|
608
608
|
t.parentElement.clientWidth;
|
|
609
|
-
const
|
|
610
|
-
|
|
609
|
+
const r = [];
|
|
610
|
+
o.forEach((h) => {
|
|
611
611
|
let f = h.textContent.replace(/[📊🔍]/g, "").trim().length * this.charWidth + 15;
|
|
612
|
-
|
|
612
|
+
r.push(f), n += f;
|
|
613
613
|
});
|
|
614
614
|
const a = t.querySelectorAll("tr"), l = ((u = t.parentElement) == null ? void 0 : u.getBoundingClientRect().width) ?? n;
|
|
615
615
|
var c = 0;
|
|
616
616
|
for (const h of a)
|
|
617
617
|
h.querySelectorAll("td").forEach((f, m) => {
|
|
618
618
|
const b = f.textContent.length * this.charWidth + 15;
|
|
619
|
-
b >
|
|
619
|
+
b > r[m] && m < r.length && (r[m] = b);
|
|
620
620
|
});
|
|
621
|
-
c =
|
|
621
|
+
c = r.reduce((h, g) => h += g, 0), o.forEach((h, g) => {
|
|
622
622
|
if (c > l) {
|
|
623
|
-
const f =
|
|
623
|
+
const f = r[g] / c;
|
|
624
624
|
h.style.width = `${l * f}px`;
|
|
625
625
|
} else
|
|
626
|
-
h.style.width = `${
|
|
626
|
+
h.style.width = `${r[g]}px`;
|
|
627
627
|
});
|
|
628
628
|
let p = 0;
|
|
629
629
|
return c > l ? p = "100%" : p = `${Math.max(c, s)}px`, p;
|
|
@@ -779,15 +779,15 @@ const C = /* @__PURE__ */ new Set(), S = class S {
|
|
|
779
779
|
*/
|
|
780
780
|
destroy() {
|
|
781
781
|
this.tables.forEach((e) => {
|
|
782
|
-
e.querySelectorAll(`.${this.options.sortableClass}`).forEach((
|
|
783
|
-
|
|
782
|
+
e.querySelectorAll(`.${this.options.sortableClass}`).forEach((o) => {
|
|
783
|
+
o.classList.remove(
|
|
784
784
|
this.options.sortableClass,
|
|
785
785
|
this.options.activeSortClass,
|
|
786
786
|
this.options.ascendingClass,
|
|
787
787
|
this.options.descendingClass
|
|
788
|
-
),
|
|
789
|
-
const n =
|
|
790
|
-
|
|
788
|
+
), o.style.cursor = "", o.style.background = "";
|
|
789
|
+
const n = o.cloneNode(!0);
|
|
790
|
+
o.parentNode.replaceChild(n, o);
|
|
791
791
|
});
|
|
792
792
|
});
|
|
793
793
|
const t = document.getElementById("sortable-table-styles");
|
|
@@ -816,8 +816,8 @@ const x = /* @__PURE__ */ new Set(["/", "@", "#"]), W = /* @__PURE__ */ d((i) =>
|
|
|
816
816
|
} else {
|
|
817
817
|
let n = e + 1;
|
|
818
818
|
for (; n < i.length; ) {
|
|
819
|
-
const
|
|
820
|
-
if (x.has(
|
|
819
|
+
const r = i[n], a = v.test(i[n - 1]);
|
|
820
|
+
if (x.has(r) && a) break;
|
|
821
821
|
n += 1;
|
|
822
822
|
}
|
|
823
823
|
t.push({ type: "plain", text: i.slice(e, n) }), e = n;
|
|
@@ -825,107 +825,128 @@ const x = /* @__PURE__ */ new Set(["/", "@", "#"]), W = /* @__PURE__ */ d((i) =>
|
|
|
825
825
|
}
|
|
826
826
|
return t;
|
|
827
827
|
}, "tokenizeForHighlight"), U = /* @__PURE__ */ d((i, t) => {
|
|
828
|
-
const e = t.filter((
|
|
828
|
+
const e = t.filter((o) => o.trim().length > 0).sort((o, n) => n.length - o.length);
|
|
829
829
|
if (e.length === 0) return i;
|
|
830
830
|
const s = [];
|
|
831
|
-
for (const
|
|
832
|
-
if (
|
|
833
|
-
s.push(
|
|
831
|
+
for (const o of i) {
|
|
832
|
+
if (o.type !== "plain") {
|
|
833
|
+
s.push(o);
|
|
834
834
|
continue;
|
|
835
835
|
}
|
|
836
|
-
let n =
|
|
836
|
+
let n = o.text;
|
|
837
837
|
for (; n.length > 0; ) {
|
|
838
|
-
let
|
|
838
|
+
let r = -1, a = 0;
|
|
839
839
|
for (const l of e) {
|
|
840
840
|
const c = n.indexOf(l);
|
|
841
|
-
c >= 0 && (
|
|
841
|
+
c >= 0 && (r === -1 || c < r) && (r = c, a = l.length);
|
|
842
842
|
}
|
|
843
|
-
if (
|
|
843
|
+
if (r === -1) {
|
|
844
844
|
s.push({ type: "plain", text: n });
|
|
845
845
|
break;
|
|
846
846
|
}
|
|
847
|
-
|
|
847
|
+
r > 0 && s.push({ type: "plain", text: n.slice(0, r) }), s.push({ type: "at", text: n.slice(r, r + a) }), n = n.slice(r + a);
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
return s;
|
|
851
|
-
}, "chipLocations")
|
|
852
|
-
function P(i, t) {
|
|
851
|
+
}, "chipLocations");
|
|
852
|
+
function P(i, t, e = t, s = 600) {
|
|
853
|
+
const o = i.value;
|
|
854
|
+
let n = !1;
|
|
855
|
+
const r = /* @__PURE__ */ d(() => {
|
|
856
|
+
n || (n = !0, document.removeEventListener("selectionchange", l), i.removeEventListener("keydown", r), i.removeEventListener("input", r), i.removeEventListener("pointerdown", r), window.clearTimeout(c), window.clearInterval(p));
|
|
857
|
+
}, "stop"), a = /* @__PURE__ */ d(() => {
|
|
858
|
+
if (i.value !== o) {
|
|
859
|
+
r();
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
i.selectionStart === t && i.selectionEnd === e || i.setSelectionRange(t, e);
|
|
863
|
+
}, "apply"), l = /* @__PURE__ */ d(() => {
|
|
864
|
+
document.activeElement === i && a();
|
|
865
|
+
}, "onSelectionChange");
|
|
866
|
+
a();
|
|
867
|
+
const c = window.setTimeout(r, s), p = window.setInterval(a, 50);
|
|
868
|
+
return document.addEventListener("selectionchange", l), i.addEventListener("keydown", r), i.addEventListener("input", r), i.addEventListener("pointerdown", r), r;
|
|
869
|
+
}
|
|
870
|
+
d(P, "placeCaret");
|
|
871
|
+
const M = 2;
|
|
872
|
+
function X(i, t) {
|
|
853
873
|
let e = 0;
|
|
854
874
|
for (let s = t - 1; s >= 0; s -= 1) {
|
|
855
|
-
const
|
|
856
|
-
if (
|
|
857
|
-
return !(s === 0 || /\s/.test(i[s - 1])) ||
|
|
858
|
-
trigger:
|
|
875
|
+
const o = i[s];
|
|
876
|
+
if (o === "/" || o === "@" || o === "#")
|
|
877
|
+
return !(s === 0 || /\s/.test(i[s - 1])) || o !== "@" && e > 0 ? null : {
|
|
878
|
+
trigger: o,
|
|
859
879
|
query: i.slice(s + 1, t),
|
|
860
880
|
startIdx: s,
|
|
861
881
|
endIdx: t
|
|
862
882
|
};
|
|
863
|
-
if (
|
|
864
|
-
if (
|
|
883
|
+
if (o === " ") return null;
|
|
884
|
+
if (o === " " || o === " ") {
|
|
865
885
|
if (e += 1, e > M) return null;
|
|
866
886
|
continue;
|
|
867
887
|
}
|
|
868
|
-
if (/\s/.test(
|
|
888
|
+
if (/\s/.test(o)) return null;
|
|
869
889
|
}
|
|
870
890
|
return null;
|
|
871
891
|
}
|
|
872
|
-
d(
|
|
892
|
+
d(X, "detectTrigger");
|
|
873
893
|
const q = /\[[^\]\n]+\]/;
|
|
874
|
-
function
|
|
875
|
-
const s = i.slice(0, t.startIdx),
|
|
894
|
+
function G(i, t, e) {
|
|
895
|
+
const s = i.slice(0, t.startIdx), o = i.slice(t.endIdx), n = q.exec(e);
|
|
876
896
|
if (n) {
|
|
877
897
|
const c = s.length + n.index;
|
|
878
898
|
return {
|
|
879
|
-
next: `${s}${e}${
|
|
899
|
+
next: `${s}${e}${o}`,
|
|
880
900
|
selectionStart: c,
|
|
881
901
|
selectionEnd: c + n[0].length,
|
|
882
902
|
reopenTrigger: !1
|
|
883
903
|
};
|
|
884
904
|
}
|
|
885
|
-
const
|
|
886
|
-
if (
|
|
905
|
+
const r = e[e.length - 1];
|
|
906
|
+
if (r === "@" || r === "#" || r === "/") {
|
|
887
907
|
const c = s.length + e.length;
|
|
888
|
-
return { next: `${s}${e}${
|
|
908
|
+
return { next: `${s}${e}${o}`, selectionStart: c, selectionEnd: c, reopenTrigger: !0 };
|
|
889
909
|
}
|
|
890
910
|
const a = `${e} `, l = s.length + a.length;
|
|
891
|
-
return { next: `${s}${a}${
|
|
911
|
+
return { next: `${s}${a}${o}`, selectionStart: l, selectionEnd: l, reopenTrigger: !1 };
|
|
892
912
|
}
|
|
893
|
-
d(
|
|
894
|
-
async function
|
|
895
|
-
const [
|
|
913
|
+
d(G, "applyTriggerInsertion");
|
|
914
|
+
async function j(i, { onAtQuery: t, onAtPersonQuery: e }, { personConfidence: s = 0, locationConfidence: o = 0, personFirstThreshold: n = 0.5 } = {}) {
|
|
915
|
+
const [r, a] = await Promise.all([
|
|
896
916
|
t ? t(i).catch(() => []) : Promise.resolve([]),
|
|
897
917
|
e ? e(i).catch(() => []) : Promise.resolve([])
|
|
898
918
|
]);
|
|
899
919
|
if (t && e) {
|
|
900
|
-
const l = a.map((u) => ({ ...u, group: "person" })), c =
|
|
901
|
-
return s >= n && s >=
|
|
920
|
+
const l = a.map((u) => ({ ...u, group: "person" })), c = r.map((u) => ({ ...u, group: "location" }));
|
|
921
|
+
return s >= n && s >= o ? [...l, ...c] : [...c, ...l];
|
|
902
922
|
}
|
|
903
|
-
return [...a, ...
|
|
923
|
+
return [...a, ...r];
|
|
904
924
|
}
|
|
905
|
-
d(
|
|
906
|
-
function
|
|
907
|
-
var s,
|
|
925
|
+
d(j, "fetchAtMentions");
|
|
926
|
+
function K(i, t) {
|
|
927
|
+
var s, o;
|
|
908
928
|
const e = (s = i[t]) == null ? void 0 : s.group;
|
|
909
|
-
return e !== void 0 && (t === 0 || ((
|
|
929
|
+
return e !== void 0 && (t === 0 || ((o = i[t - 1]) == null ? void 0 : o.group) !== e);
|
|
910
930
|
}
|
|
911
|
-
d(
|
|
931
|
+
d(K, "isSectionStart");
|
|
912
932
|
export {
|
|
913
933
|
w as S,
|
|
914
|
-
|
|
934
|
+
G as a,
|
|
915
935
|
T as b,
|
|
916
936
|
U as c,
|
|
917
|
-
|
|
937
|
+
X as d,
|
|
918
938
|
$ as e,
|
|
919
|
-
|
|
920
|
-
|
|
939
|
+
I as f,
|
|
940
|
+
j as g,
|
|
921
941
|
B as h,
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
942
|
+
K as i,
|
|
943
|
+
H as j,
|
|
944
|
+
P as k,
|
|
945
|
+
_ as l,
|
|
946
|
+
z as m,
|
|
947
|
+
R as n,
|
|
927
948
|
O as p,
|
|
928
|
-
|
|
949
|
+
F as s,
|
|
929
950
|
V as t
|
|
930
951
|
};
|
|
931
|
-
//# sourceMappingURL=atMentions-
|
|
952
|
+
//# sourceMappingURL=atMentions-DgYt2JSK.js.map
|