@gamention/pulse-elements 0.1.16 → 0.1.18
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/pulse-elements.cjs +3 -3
- package/dist/pulse-elements.js +215 -200
- package/package.json +2 -2
package/dist/pulse-elements.js
CHANGED
|
@@ -245,6 +245,18 @@ let De = class {
|
|
|
245
245
|
get unreadCount() {
|
|
246
246
|
return this._notifications.filter((e) => !e.read).length;
|
|
247
247
|
}
|
|
248
|
+
/** Optimistically mark a single notification as read. */
|
|
249
|
+
markNotificationRead(e) {
|
|
250
|
+
const t = this._notifications.find((i) => i.id === e);
|
|
251
|
+
t && !t.read && (t.read = !0, this.emit("notifications", this._notifications));
|
|
252
|
+
}
|
|
253
|
+
/** Optimistically mark all notifications as read. */
|
|
254
|
+
markAllNotificationsRead() {
|
|
255
|
+
let e = !1;
|
|
256
|
+
for (const t of this._notifications)
|
|
257
|
+
t.read || (t.read = !0, e = !0);
|
|
258
|
+
e && this.emit("notifications", this._notifications);
|
|
259
|
+
}
|
|
248
260
|
get activityLogs() {
|
|
249
261
|
return this._activityLogs;
|
|
250
262
|
}
|
|
@@ -514,10 +526,10 @@ let De = class {
|
|
|
514
526
|
}
|
|
515
527
|
// ── Notifications ──
|
|
516
528
|
markRead(e) {
|
|
517
|
-
this.send({ type: "notification:read", notificationId: e });
|
|
529
|
+
this.state.markNotificationRead(e), this.send({ type: "notification:read", notificationId: e });
|
|
518
530
|
}
|
|
519
531
|
markAllRead() {
|
|
520
|
-
this.send({ type: "notification:read-all" });
|
|
532
|
+
this.state.markAllNotificationsRead(), this.send({ type: "notification:read-all" });
|
|
521
533
|
}
|
|
522
534
|
// ── Clicks ──
|
|
523
535
|
performClick(e) {
|
|
@@ -575,10 +587,10 @@ let De = class {
|
|
|
575
587
|
* Copyright 2019 Google LLC
|
|
576
588
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
577
589
|
*/
|
|
578
|
-
const ye = globalThis, He = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
|
|
590
|
+
const ye = globalThis, He = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ne = Symbol(), Je = /* @__PURE__ */ new WeakMap();
|
|
579
591
|
let kt = class {
|
|
580
592
|
constructor(e, t, i) {
|
|
581
|
-
if (this._$cssResult$ = !0, i !==
|
|
593
|
+
if (this._$cssResult$ = !0, i !== Ne) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
582
594
|
this.cssText = e, this.t = t;
|
|
583
595
|
}
|
|
584
596
|
get styleSheet() {
|
|
@@ -594,14 +606,14 @@ let kt = class {
|
|
|
594
606
|
return this.cssText;
|
|
595
607
|
}
|
|
596
608
|
};
|
|
597
|
-
const
|
|
609
|
+
const Nt = (n) => new kt(typeof n == "string" ? n : n + "", void 0, Ne), M = (n, ...e) => {
|
|
598
610
|
const t = n.length === 1 ? n[0] : e.reduce((i, s, o) => i + ((r) => {
|
|
599
611
|
if (r._$cssResult$ === !0) return r.cssText;
|
|
600
612
|
if (typeof r == "number") return r;
|
|
601
613
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
602
614
|
})(s) + n[o + 1], n[0]);
|
|
603
|
-
return new kt(t, n,
|
|
604
|
-
},
|
|
615
|
+
return new kt(t, n, Ne);
|
|
616
|
+
}, Bt = (n, e) => {
|
|
605
617
|
if (He) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
606
618
|
else for (const t of e) {
|
|
607
619
|
const i = document.createElement("style"), s = ye.litNonce;
|
|
@@ -610,7 +622,7 @@ const Bt = (n) => new kt(typeof n == "string" ? n : n + "", void 0, Be), M = (n,
|
|
|
610
622
|
}, Ze = He ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
|
|
611
623
|
let t = "";
|
|
612
624
|
for (const i of e.cssRules) t += i.cssText;
|
|
613
|
-
return
|
|
625
|
+
return Nt(t);
|
|
614
626
|
})(n) : n;
|
|
615
627
|
/**
|
|
616
628
|
* @license
|
|
@@ -645,7 +657,7 @@ const { is: Ft, defineProperty: qt, getOwnPropertyDescriptor: Vt, getOwnProperty
|
|
|
645
657
|
}
|
|
646
658
|
}
|
|
647
659
|
return t;
|
|
648
|
-
} },
|
|
660
|
+
} }, Be = (n, e) => !Ft(n, e), et = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Be };
|
|
649
661
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), H.litPropertyMetadata ?? (H.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
650
662
|
let G = class extends HTMLElement {
|
|
651
663
|
static addInitializer(e) {
|
|
@@ -731,7 +743,7 @@ let G = class extends HTMLElement {
|
|
|
731
743
|
}
|
|
732
744
|
createRenderRoot() {
|
|
733
745
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
734
|
-
return
|
|
746
|
+
return Bt(e, this.constructor.elementStyles), e;
|
|
735
747
|
}
|
|
736
748
|
connectedCallback() {
|
|
737
749
|
var e;
|
|
@@ -774,7 +786,7 @@ let G = class extends HTMLElement {
|
|
|
774
786
|
var r;
|
|
775
787
|
if (e !== void 0) {
|
|
776
788
|
const a = this.constructor;
|
|
777
|
-
if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ??
|
|
789
|
+
if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ?? Be)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(a._$Eu(e, i)))) return;
|
|
778
790
|
this.C(e, t, i);
|
|
779
791
|
}
|
|
780
792
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -857,9 +869,9 @@ G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[ne("elementPrope
|
|
|
857
869
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
858
870
|
*/
|
|
859
871
|
const oe = globalThis, tt = (n) => n, Ee = oe.trustedTypes, it = Ee ? Ee.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Et = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, Ct = "?" + D, Gt = `<${Ct}>`, V = document, ae = () => V.createComment(""), le = (n) => n === null || typeof n != "object" && typeof n != "function", Fe = Array.isArray, Jt = (n) => Fe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Ie = `[
|
|
860
|
-
\f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, nt = />/g,
|
|
861
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, rt = /"/g, Tt = /^(?:script|style|textarea|title)$/i, St = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), u = St(1), Zt = St(2), W = Symbol.for("lit-noChange"),
|
|
862
|
-
function
|
|
872
|
+
\f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, nt = />/g, B = RegExp(`>|${Ie}(?:([^\\s"'>=/]+)(${Ie}*=${Ie}*(?:[^
|
|
873
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, rt = /"/g, Tt = /^(?:script|style|textarea|title)$/i, St = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), u = St(1), Zt = St(2), W = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
|
|
874
|
+
function At(n, e) {
|
|
863
875
|
if (!Fe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
864
876
|
return it !== void 0 ? it.createHTML(e) : e;
|
|
865
877
|
}
|
|
@@ -869,11 +881,11 @@ const Qt = (n, e) => {
|
|
|
869
881
|
for (let a = 0; a < t; a++) {
|
|
870
882
|
const l = n[a];
|
|
871
883
|
let d, c, h = -1, p = 0;
|
|
872
|
-
for (; p < l.length && (r.lastIndex = p, c = r.exec(l), c !== null); ) p = r.lastIndex, r === se ? c[1] === "!--" ? r = st : c[1] !== void 0 ? r = nt : c[2] !== void 0 ? (Tt.test(c[2]) && (s = RegExp("</" + c[2], "g")), r =
|
|
873
|
-
const m = r ===
|
|
884
|
+
for (; p < l.length && (r.lastIndex = p, c = r.exec(l), c !== null); ) p = r.lastIndex, r === se ? c[1] === "!--" ? r = st : c[1] !== void 0 ? r = nt : c[2] !== void 0 ? (Tt.test(c[2]) && (s = RegExp("</" + c[2], "g")), r = B) : c[3] !== void 0 && (r = B) : r === B ? c[0] === ">" ? (r = s ?? se, h = -1) : c[1] === void 0 ? h = -2 : (h = r.lastIndex - c[2].length, d = c[1], r = c[3] === void 0 ? B : c[3] === '"' ? rt : ot) : r === rt || r === ot ? r = B : r === st || r === nt ? r = se : (r = B, s = void 0);
|
|
885
|
+
const m = r === B && n[a + 1].startsWith("/>") ? " " : "";
|
|
874
886
|
o += r === se ? l + Gt : h >= 0 ? (i.push(d), l.slice(0, h) + Et + l.slice(h) + D + m) : l + D + (h === -2 ? a : m);
|
|
875
887
|
}
|
|
876
|
-
return [
|
|
888
|
+
return [At(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
877
889
|
};
|
|
878
890
|
class ce {
|
|
879
891
|
constructor({ strings: e, _$litType$: t }, i) {
|
|
@@ -953,7 +965,7 @@ class me {
|
|
|
953
965
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
954
966
|
}
|
|
955
967
|
constructor(e, t, i, s) {
|
|
956
|
-
this.type = 2, this._$AH =
|
|
968
|
+
this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
|
|
957
969
|
}
|
|
958
970
|
get parentNode() {
|
|
959
971
|
let e = this._$AA.parentNode;
|
|
@@ -967,7 +979,7 @@ class me {
|
|
|
967
979
|
return this._$AB;
|
|
968
980
|
}
|
|
969
981
|
_$AI(e, t = this) {
|
|
970
|
-
e = J(this, e, t), le(e) ? e ===
|
|
982
|
+
e = J(this, e, t), le(e) ? e === v || e == null || e === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Jt(e) ? this.k(e) : this._(e);
|
|
971
983
|
}
|
|
972
984
|
O(e) {
|
|
973
985
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -976,11 +988,11 @@ class me {
|
|
|
976
988
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
977
989
|
}
|
|
978
990
|
_(e) {
|
|
979
|
-
this._$AH !==
|
|
991
|
+
this._$AH !== v && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
|
|
980
992
|
}
|
|
981
993
|
$(e) {
|
|
982
994
|
var o;
|
|
983
|
-
const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(
|
|
995
|
+
const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(At(i.h, i.h[0]), this.options)), i);
|
|
984
996
|
if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(t);
|
|
985
997
|
else {
|
|
986
998
|
const r = new ei(s, this), a = r.u(this.options);
|
|
@@ -1018,7 +1030,7 @@ class Se {
|
|
|
1018
1030
|
return this._$AM._$AU;
|
|
1019
1031
|
}
|
|
1020
1032
|
constructor(e, t, i, s, o) {
|
|
1021
|
-
this.type = 1, this._$AH =
|
|
1033
|
+
this.type = 1, this._$AH = v, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = v;
|
|
1022
1034
|
}
|
|
1023
1035
|
_$AI(e, t = this, i, s) {
|
|
1024
1036
|
const o = this.strings;
|
|
@@ -1027,12 +1039,12 @@ class Se {
|
|
|
1027
1039
|
else {
|
|
1028
1040
|
const a = e;
|
|
1029
1041
|
let l, d;
|
|
1030
|
-
for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d ===
|
|
1042
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d === v ? e = v : e !== v && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
|
|
1031
1043
|
}
|
|
1032
1044
|
r && !s && this.j(e);
|
|
1033
1045
|
}
|
|
1034
1046
|
j(e) {
|
|
1035
|
-
e ===
|
|
1047
|
+
e === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
1036
1048
|
}
|
|
1037
1049
|
}
|
|
1038
1050
|
class ti extends Se {
|
|
@@ -1040,7 +1052,7 @@ class ti extends Se {
|
|
|
1040
1052
|
super(...arguments), this.type = 3;
|
|
1041
1053
|
}
|
|
1042
1054
|
j(e) {
|
|
1043
|
-
this.element[this.name] = e ===
|
|
1055
|
+
this.element[this.name] = e === v ? void 0 : e;
|
|
1044
1056
|
}
|
|
1045
1057
|
}
|
|
1046
1058
|
class ii extends Se {
|
|
@@ -1048,7 +1060,7 @@ class ii extends Se {
|
|
|
1048
1060
|
super(...arguments), this.type = 4;
|
|
1049
1061
|
}
|
|
1050
1062
|
j(e) {
|
|
1051
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
1063
|
+
this.element.toggleAttribute(this.name, !!e && e !== v);
|
|
1052
1064
|
}
|
|
1053
1065
|
}
|
|
1054
1066
|
class si extends Se {
|
|
@@ -1056,8 +1068,8 @@ class si extends Se {
|
|
|
1056
1068
|
super(e, t, i, s, o), this.type = 5;
|
|
1057
1069
|
}
|
|
1058
1070
|
_$AI(e, t = this) {
|
|
1059
|
-
if ((e = J(this, e, t, 0) ??
|
|
1060
|
-
const i = this._$AH, s = e ===
|
|
1071
|
+
if ((e = J(this, e, t, 0) ?? v) === W) return;
|
|
1072
|
+
const i = this._$AH, s = e === v && i !== v || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== v && (i === v || s);
|
|
1061
1073
|
s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
1062
1074
|
}
|
|
1063
1075
|
handleEvent(e) {
|
|
@@ -1093,7 +1105,7 @@ const oi = (n, e, t) => {
|
|
|
1093
1105
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1094
1106
|
*/
|
|
1095
1107
|
const q = globalThis;
|
|
1096
|
-
let
|
|
1108
|
+
let A = class extends G {
|
|
1097
1109
|
constructor() {
|
|
1098
1110
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1099
1111
|
}
|
|
@@ -1119,9 +1131,9 @@ let P = class extends G {
|
|
|
1119
1131
|
}
|
|
1120
1132
|
};
|
|
1121
1133
|
var yt;
|
|
1122
|
-
|
|
1134
|
+
A._$litElement$ = !0, A.finalized = !0, (yt = q.litElementHydrateSupport) == null || yt.call(q, { LitElement: A });
|
|
1123
1135
|
const Oe = q.litElementPolyfillSupport;
|
|
1124
|
-
Oe == null || Oe({ LitElement:
|
|
1136
|
+
Oe == null || Oe({ LitElement: A });
|
|
1125
1137
|
(q.litElementVersions ?? (q.litElementVersions = [])).push("4.2.2");
|
|
1126
1138
|
/**
|
|
1127
1139
|
* @license
|
|
@@ -1138,7 +1150,7 @@ const L = (n) => (e, t) => {
|
|
|
1138
1150
|
* Copyright 2017 Google LLC
|
|
1139
1151
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1140
1152
|
*/
|
|
1141
|
-
const ri = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged:
|
|
1153
|
+
const ri = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: Be }, ai = (n = ri, e, t) => {
|
|
1142
1154
|
const { kind: i, metadata: s } = t;
|
|
1143
1155
|
let o = globalThis.litPropertyMetadata.get(s);
|
|
1144
1156
|
if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), i === "setter" && ((n = Object.create(n)).wrapped = !0), o.set(t.name, n), i === "accessor") {
|
|
@@ -1179,7 +1191,7 @@ var li = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, ee = (n, e
|
|
|
1179
1191
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1180
1192
|
return i && s && li(e, t, s), s;
|
|
1181
1193
|
};
|
|
1182
|
-
let X = class extends
|
|
1194
|
+
let X = class extends A {
|
|
1183
1195
|
constructor() {
|
|
1184
1196
|
super(...arguments), this.apiKey = "", this.token = "", this.room = "";
|
|
1185
1197
|
}
|
|
@@ -1219,12 +1231,12 @@ ee([
|
|
|
1219
1231
|
X = ee([
|
|
1220
1232
|
L("pulse-provider")
|
|
1221
1233
|
], X);
|
|
1222
|
-
var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor,
|
|
1234
|
+
var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, Ae = (n, e, t, i) => {
|
|
1223
1235
|
for (var s = i > 1 ? void 0 : i ? hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1224
1236
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1225
1237
|
return i && s && di(e, t, s), s;
|
|
1226
1238
|
};
|
|
1227
|
-
let Z = class extends
|
|
1239
|
+
let Z = class extends A {
|
|
1228
1240
|
constructor() {
|
|
1229
1241
|
super(...arguments), this.maxVisible = 5, this.users = [];
|
|
1230
1242
|
}
|
|
@@ -1372,17 +1384,17 @@ Z.styles = M`
|
|
|
1372
1384
|
opacity: 1;
|
|
1373
1385
|
}
|
|
1374
1386
|
`;
|
|
1375
|
-
|
|
1387
|
+
Ae([
|
|
1376
1388
|
fe({ context: Q, subscribe: !0 }),
|
|
1377
1389
|
x({ attribute: !1 })
|
|
1378
1390
|
], Z.prototype, "client", 2);
|
|
1379
|
-
|
|
1391
|
+
Ae([
|
|
1380
1392
|
x({ type: Number, attribute: "max-visible" })
|
|
1381
1393
|
], Z.prototype, "maxVisible", 2);
|
|
1382
|
-
|
|
1394
|
+
Ae([
|
|
1383
1395
|
$()
|
|
1384
1396
|
], Z.prototype, "users", 2);
|
|
1385
|
-
Z =
|
|
1397
|
+
Z = Ae([
|
|
1386
1398
|
L("pulse-presence")
|
|
1387
1399
|
], Z);
|
|
1388
1400
|
var pi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, qe = (n, e, t, i) => {
|
|
@@ -1390,7 +1402,7 @@ var pi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, qe = (n, e
|
|
|
1390
1402
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1391
1403
|
return i && s && pi(e, t, s), s;
|
|
1392
1404
|
};
|
|
1393
|
-
let de = class extends
|
|
1405
|
+
let de = class extends A {
|
|
1394
1406
|
constructor() {
|
|
1395
1407
|
super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (n) => {
|
|
1396
1408
|
var e;
|
|
@@ -1519,7 +1531,7 @@ var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, ge = (n, e
|
|
|
1519
1531
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1520
1532
|
return i && s && fi(e, t, s), s;
|
|
1521
1533
|
};
|
|
1522
|
-
let Y = class extends
|
|
1534
|
+
let Y = class extends A {
|
|
1523
1535
|
constructor() {
|
|
1524
1536
|
super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
|
|
1525
1537
|
}
|
|
@@ -1588,7 +1600,7 @@ let Y = class extends P {
|
|
|
1588
1600
|
${n.comments.map((e, t) => {
|
|
1589
1601
|
const i = this.getUserForComment(e.userId);
|
|
1590
1602
|
return u`
|
|
1591
|
-
${t > 0 ? u`<div class="divider"></div>` :
|
|
1603
|
+
${t > 0 ? u`<div class="divider"></div>` : v}
|
|
1592
1604
|
<div class="comment">
|
|
1593
1605
|
<div class="comment-header">
|
|
1594
1606
|
<div
|
|
@@ -1625,7 +1637,7 @@ let Y = class extends P {
|
|
|
1625
1637
|
<input type="text" placeholder="Write a reply..." />
|
|
1626
1638
|
<button type="submit">Send</button>
|
|
1627
1639
|
</form>
|
|
1628
|
-
` :
|
|
1640
|
+
` : v}
|
|
1629
1641
|
</div>
|
|
1630
1642
|
`;
|
|
1631
1643
|
}
|
|
@@ -1865,12 +1877,12 @@ ge([
|
|
|
1865
1877
|
Y = ge([
|
|
1866
1878
|
L("pulse-comments")
|
|
1867
1879
|
], Y);
|
|
1868
|
-
var gi = Object.defineProperty,
|
|
1869
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1880
|
+
var gi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
|
|
1881
|
+
for (var s = i > 1 ? void 0 : i ? vi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1870
1882
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1871
1883
|
return i && s && gi(e, t, s), s;
|
|
1872
1884
|
};
|
|
1873
|
-
const
|
|
1885
|
+
const bi = {
|
|
1874
1886
|
"comment:created": "left a comment",
|
|
1875
1887
|
"comment:mention": "mentioned you",
|
|
1876
1888
|
"comment:reply": "replied to your comment",
|
|
@@ -1883,7 +1895,7 @@ const vi = {
|
|
|
1883
1895
|
"thread:resolved": "✅",
|
|
1884
1896
|
"reaction:added": "🎉"
|
|
1885
1897
|
};
|
|
1886
|
-
let he = class extends
|
|
1898
|
+
let he = class extends A {
|
|
1887
1899
|
constructor() {
|
|
1888
1900
|
super(...arguments), this.notifications = [];
|
|
1889
1901
|
}
|
|
@@ -1934,11 +1946,11 @@ let he = class extends P {
|
|
|
1934
1946
|
<div class="header">
|
|
1935
1947
|
<span class="title">
|
|
1936
1948
|
Notifications
|
|
1937
|
-
${n > 0 ? u`<span class="badge">${n}</span>` :
|
|
1949
|
+
${n > 0 ? u`<span class="badge">${n}</span>` : v}
|
|
1938
1950
|
</span>
|
|
1939
1951
|
${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
1940
1952
|
Mark all read
|
|
1941
|
-
</button>` :
|
|
1953
|
+
</button>` : v}
|
|
1942
1954
|
</div>
|
|
1943
1955
|
<div class="list">
|
|
1944
1956
|
${this.notifications.length === 0 ? u`<div class="empty">
|
|
@@ -1954,7 +1966,7 @@ let he = class extends P {
|
|
|
1954
1966
|
<div class="content">
|
|
1955
1967
|
<div class="text">
|
|
1956
1968
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
1957
|
-
${
|
|
1969
|
+
${bi[e.type] ?? e.type}
|
|
1958
1970
|
</div>
|
|
1959
1971
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
1960
1972
|
</div>
|
|
@@ -2123,7 +2135,7 @@ var yi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, te = (n, e
|
|
|
2123
2135
|
return i && s && yi(e, t, s), s;
|
|
2124
2136
|
};
|
|
2125
2137
|
const $i = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
2126
|
-
let
|
|
2138
|
+
let N = class extends A {
|
|
2127
2139
|
constructor() {
|
|
2128
2140
|
super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
|
|
2129
2141
|
}
|
|
@@ -2192,12 +2204,12 @@ let B = class extends P {
|
|
|
2192
2204
|
`
|
|
2193
2205
|
)}
|
|
2194
2206
|
</div>
|
|
2195
|
-
` :
|
|
2207
|
+
` : v}
|
|
2196
2208
|
</div>
|
|
2197
2209
|
`;
|
|
2198
2210
|
}
|
|
2199
2211
|
};
|
|
2200
|
-
|
|
2212
|
+
N.styles = M`
|
|
2201
2213
|
:host {
|
|
2202
2214
|
display: inline-flex;
|
|
2203
2215
|
align-items: center;
|
|
@@ -2312,22 +2324,22 @@ B.styles = M`
|
|
|
2312
2324
|
te([
|
|
2313
2325
|
fe({ context: Q, subscribe: !0 }),
|
|
2314
2326
|
x({ attribute: !1 })
|
|
2315
|
-
],
|
|
2327
|
+
], N.prototype, "client", 2);
|
|
2316
2328
|
te([
|
|
2317
2329
|
x({ attribute: "target-id" })
|
|
2318
|
-
],
|
|
2330
|
+
], N.prototype, "targetId", 2);
|
|
2319
2331
|
te([
|
|
2320
2332
|
x({ attribute: "target-type" })
|
|
2321
|
-
],
|
|
2333
|
+
], N.prototype, "targetType", 2);
|
|
2322
2334
|
te([
|
|
2323
2335
|
$()
|
|
2324
|
-
],
|
|
2336
|
+
], N.prototype, "reactions", 2);
|
|
2325
2337
|
te([
|
|
2326
2338
|
$()
|
|
2327
|
-
],
|
|
2328
|
-
|
|
2339
|
+
], N.prototype, "showPicker", 2);
|
|
2340
|
+
N = te([
|
|
2329
2341
|
L("pulse-reactions")
|
|
2330
|
-
],
|
|
2342
|
+
], N);
|
|
2331
2343
|
/**
|
|
2332
2344
|
* @license
|
|
2333
2345
|
* Copyright 2017 Google LLC
|
|
@@ -2357,10 +2369,10 @@ class Ci {
|
|
|
2357
2369
|
*/
|
|
2358
2370
|
class Re extends Ci {
|
|
2359
2371
|
constructor(e) {
|
|
2360
|
-
if (super(e), this.it =
|
|
2372
|
+
if (super(e), this.it = v, e.type !== ki.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
2361
2373
|
}
|
|
2362
2374
|
render(e) {
|
|
2363
|
-
if (e ===
|
|
2375
|
+
if (e === v || e == null) return this._t = void 0, this.it = e;
|
|
2364
2376
|
if (e === W) return e;
|
|
2365
2377
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
2366
2378
|
if (e === this.it) return this._t;
|
|
@@ -2400,7 +2412,7 @@ const Si = [
|
|
|
2400
2412
|
* This source code is licensed under the ISC license.
|
|
2401
2413
|
* See the LICENSE file in the root directory of this source tree.
|
|
2402
2414
|
*/
|
|
2403
|
-
const
|
|
2415
|
+
const Ai = [
|
|
2404
2416
|
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
2405
2417
|
["path", { d: "M12 6v6l4 2" }]
|
|
2406
2418
|
];
|
|
@@ -2410,7 +2422,7 @@ const Pi = [
|
|
|
2410
2422
|
* This source code is licensed under the ISC license.
|
|
2411
2423
|
* See the LICENSE file in the root directory of this source tree.
|
|
2412
2424
|
*/
|
|
2413
|
-
const
|
|
2425
|
+
const Pi = [
|
|
2414
2426
|
[
|
|
2415
2427
|
"path",
|
|
2416
2428
|
{
|
|
@@ -2486,7 +2498,7 @@ const Oi = [
|
|
|
2486
2498
|
* This source code is licensed under the ISC license.
|
|
2487
2499
|
* See the LICENSE file in the root directory of this source tree.
|
|
2488
2500
|
*/
|
|
2489
|
-
const
|
|
2501
|
+
const Pt = [
|
|
2490
2502
|
["path", { d: "M12 17v5" }],
|
|
2491
2503
|
[
|
|
2492
2504
|
"path",
|
|
@@ -2539,7 +2551,7 @@ const ji = [
|
|
|
2539
2551
|
* This source code is licensed under the ISC license.
|
|
2540
2552
|
* See the LICENSE file in the root directory of this source tree.
|
|
2541
2553
|
*/
|
|
2542
|
-
const
|
|
2554
|
+
const ve = [
|
|
2543
2555
|
["path", { d: "M18 6 6 18" }],
|
|
2544
2556
|
["path", { d: "m6 6 12 12" }]
|
|
2545
2557
|
];
|
|
@@ -2619,7 +2631,7 @@ const ie = M`
|
|
|
2619
2631
|
--pw-shadow: var(--pulse-shadow);
|
|
2620
2632
|
--pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
2621
2633
|
}
|
|
2622
|
-
`,
|
|
2634
|
+
`, be = M`
|
|
2623
2635
|
.pw-btn {
|
|
2624
2636
|
display: inline-flex;
|
|
2625
2637
|
align-items: center;
|
|
@@ -2663,7 +2675,7 @@ const ie = M`
|
|
|
2663
2675
|
width: 18px;
|
|
2664
2676
|
height: 18px;
|
|
2665
2677
|
}
|
|
2666
|
-
`,
|
|
2678
|
+
`, Pe = M`
|
|
2667
2679
|
.pw-scrollable::-webkit-scrollbar {
|
|
2668
2680
|
width: 4px;
|
|
2669
2681
|
}
|
|
@@ -2680,7 +2692,7 @@ var Di = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, We = (n, e
|
|
|
2680
2692
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
2681
2693
|
return i && s && Di(e, t, s), s;
|
|
2682
2694
|
};
|
|
2683
|
-
let K = class extends
|
|
2695
|
+
let K = class extends A {
|
|
2684
2696
|
constructor() {
|
|
2685
2697
|
super(...arguments), this.items = [], this.unsubs = [], this.counter = 0;
|
|
2686
2698
|
}
|
|
@@ -2731,7 +2743,7 @@ let K = class extends P {
|
|
|
2731
2743
|
<div class="panel-header">
|
|
2732
2744
|
<span class="panel-title">Activity</span>
|
|
2733
2745
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
2734
|
-
${C(
|
|
2746
|
+
${C(ve, 16)}
|
|
2735
2747
|
</button>
|
|
2736
2748
|
</div>
|
|
2737
2749
|
|
|
@@ -2764,8 +2776,8 @@ let K = class extends P {
|
|
|
2764
2776
|
};
|
|
2765
2777
|
K.styles = [
|
|
2766
2778
|
ie,
|
|
2767
|
-
|
|
2768
|
-
|
|
2779
|
+
be,
|
|
2780
|
+
Pe,
|
|
2769
2781
|
M`
|
|
2770
2782
|
:host {
|
|
2771
2783
|
display: block;
|
|
@@ -2900,7 +2912,7 @@ We([
|
|
|
2900
2912
|
K = We([
|
|
2901
2913
|
L("pulse-widget-activity-panel")
|
|
2902
2914
|
], K);
|
|
2903
|
-
const
|
|
2915
|
+
const Ni = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", lt = "#6366f1", ct = "#e2e8f0", Bi = "#f8fafc", Fi = "#e2e8f0", dt = "#64748b", we = 28, qi = Array.from({ length: we }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
|
|
2904
2916
|
function ht(n) {
|
|
2905
2917
|
const e = Math.max(0, Math.floor(n)), t = Math.floor(e / 60), i = e % 60;
|
|
2906
2918
|
return `${t}:${i.toString().padStart(2, "0")}`;
|
|
@@ -2926,10 +2938,10 @@ class je {
|
|
|
2926
2938
|
width: "220px",
|
|
2927
2939
|
height: "44px",
|
|
2928
2940
|
padding: "0 10px",
|
|
2929
|
-
background:
|
|
2941
|
+
background: Bi,
|
|
2930
2942
|
borderRadius: "12px",
|
|
2931
2943
|
border: `1px solid ${Fi}`,
|
|
2932
|
-
fontFamily:
|
|
2944
|
+
fontFamily: Ni,
|
|
2933
2945
|
fontSize: "11px",
|
|
2934
2946
|
color: dt,
|
|
2935
2947
|
userSelect: "none",
|
|
@@ -3006,11 +3018,11 @@ class je {
|
|
|
3006
3018
|
whiteSpace: "nowrap",
|
|
3007
3019
|
lineHeight: "1"
|
|
3008
3020
|
});
|
|
3009
|
-
function
|
|
3021
|
+
function b() {
|
|
3010
3022
|
const E = ht(o), I = ht(s);
|
|
3011
3023
|
y.textContent = `${E} / ${I}`;
|
|
3012
3024
|
}
|
|
3013
|
-
|
|
3025
|
+
b(), p.appendChild(m), p.appendChild(y), a.appendChild(l), a.appendChild(p);
|
|
3014
3026
|
function w() {
|
|
3015
3027
|
const E = s > 0 ? o / s : 0, I = Math.floor(E * we);
|
|
3016
3028
|
for (let z = 0; z < we; z++)
|
|
@@ -3022,7 +3034,7 @@ class je {
|
|
|
3022
3034
|
1,
|
|
3023
3035
|
Math.max(0, (E.clientX - I.left) / I.width)
|
|
3024
3036
|
);
|
|
3025
|
-
r.currentTime = z * s, o = r.currentTime, w(),
|
|
3037
|
+
r.currentTime = z * s, o = r.currentTime, w(), b();
|
|
3026
3038
|
}), l.addEventListener("click", () => {
|
|
3027
3039
|
i ? r.pause() : r.play().catch(() => {
|
|
3028
3040
|
});
|
|
@@ -3031,13 +3043,13 @@ class je {
|
|
|
3031
3043
|
}), r.addEventListener("pause", () => {
|
|
3032
3044
|
i = !1, c();
|
|
3033
3045
|
}), r.addEventListener("ended", () => {
|
|
3034
|
-
i = !1, c(), o = 0, w(),
|
|
3046
|
+
i = !1, c(), o = 0, w(), b();
|
|
3035
3047
|
}), r.addEventListener("timeupdate", () => {
|
|
3036
|
-
o = r.currentTime, w(),
|
|
3048
|
+
o = r.currentTime, w(), b();
|
|
3037
3049
|
}), r.addEventListener("loadedmetadata", () => {
|
|
3038
|
-
r.duration && isFinite(r.duration) && (s = r.duration,
|
|
3050
|
+
r.duration && isFinite(r.duration) && (s = r.duration, b());
|
|
3039
3051
|
}), r.addEventListener("durationchange", () => {
|
|
3040
|
-
r.duration && isFinite(r.duration) && (s = r.duration,
|
|
3052
|
+
r.duration && isFinite(r.duration) && (s = r.duration, b());
|
|
3041
3053
|
}), a;
|
|
3042
3054
|
}
|
|
3043
3055
|
}
|
|
@@ -4020,8 +4032,8 @@ class ns {
|
|
|
4020
4032
|
const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit");
|
|
4021
4033
|
d.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new re(this.client));
|
|
4022
4034
|
const h = this.form.querySelector(".pin-attachments-preview"), p = (g, y) => {
|
|
4023
|
-
const
|
|
4024
|
-
Object.assign(
|
|
4035
|
+
const b = document.createElement("div");
|
|
4036
|
+
Object.assign(b.style, { position: "relative", display: "inline-block" }), b.appendChild(y);
|
|
4025
4037
|
const w = document.createElement("button");
|
|
4026
4038
|
w.innerHTML = "×", Object.assign(w.style, {
|
|
4027
4039
|
position: "absolute",
|
|
@@ -4043,17 +4055,17 @@ class ns {
|
|
|
4043
4055
|
fontWeight: "700"
|
|
4044
4056
|
}), w.addEventListener("click", () => {
|
|
4045
4057
|
const E = this.pendingAttachmentIds.indexOf(g);
|
|
4046
|
-
E !== -1 && this.pendingAttachmentIds.splice(E, 1),
|
|
4047
|
-
}),
|
|
4058
|
+
E !== -1 && this.pendingAttachmentIds.splice(E, 1), b.remove();
|
|
4059
|
+
}), b.appendChild(w), h.appendChild(b);
|
|
4048
4060
|
}, m = 5;
|
|
4049
4061
|
this.form.querySelector(".attach-img").addEventListener("click", async () => {
|
|
4050
4062
|
const g = m - this.pendingAttachmentIds.length;
|
|
4051
4063
|
if (g <= 0) return;
|
|
4052
4064
|
const y = await this.upload.pickFiles("image/*", g);
|
|
4053
|
-
for (const
|
|
4054
|
-
this.pendingAttachmentIds.push(
|
|
4065
|
+
for (const b of y) {
|
|
4066
|
+
this.pendingAttachmentIds.push(b.id);
|
|
4055
4067
|
const w = document.createElement("img");
|
|
4056
|
-
w.src =
|
|
4068
|
+
w.src = b.thumbnailUrl || b.url, Object.assign(w.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), p(b.id, w);
|
|
4057
4069
|
}
|
|
4058
4070
|
}), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
|
|
4059
4071
|
if (this.pendingAttachmentIds.length >= m) return;
|
|
@@ -4063,8 +4075,8 @@ class ns {
|
|
|
4063
4075
|
const y = await this.upload.uploadBlob(g, "audio.webm");
|
|
4064
4076
|
if (y) {
|
|
4065
4077
|
this.pendingAttachmentIds.push(y.id);
|
|
4066
|
-
const
|
|
4067
|
-
Object.assign(
|
|
4078
|
+
const b = document.createElement("span");
|
|
4079
|
+
Object.assign(b.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), b.textContent = "🎤 Audio", p(y.id, b);
|
|
4068
4080
|
}
|
|
4069
4081
|
}
|
|
4070
4082
|
}), this.form.querySelector(".attach-video").addEventListener("click", async () => {
|
|
@@ -4075,14 +4087,14 @@ class ns {
|
|
|
4075
4087
|
const y = await this.upload.uploadBlob(g.blob, "video.webm");
|
|
4076
4088
|
if (y) {
|
|
4077
4089
|
this.pendingAttachmentIds.push(y.id);
|
|
4078
|
-
const
|
|
4079
|
-
Object.assign(
|
|
4090
|
+
const b = document.createElement("span");
|
|
4091
|
+
Object.assign(b.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), b.textContent = "🎥 Video", p(y.id, b);
|
|
4080
4092
|
}
|
|
4081
4093
|
}
|
|
4082
4094
|
}), c.addEventListener("click", () => {
|
|
4083
4095
|
const g = l.value.trim();
|
|
4084
4096
|
if (!g && this.pendingAttachmentIds.length === 0) return;
|
|
4085
|
-
const y = [...(g || "").matchAll(/@(\w+)/g)].map((
|
|
4097
|
+
const y = [...(g || "").matchAll(/@(\w+)/g)].map((b) => b[1]);
|
|
4086
4098
|
this.client.createThread(g, { position: i, mentions: y, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
4087
4099
|
}), l.addEventListener("keydown", (g) => {
|
|
4088
4100
|
g.key === "Escape" && this.exitPinMode(), g.stopPropagation();
|
|
@@ -4149,7 +4161,7 @@ class ns {
|
|
|
4149
4161
|
}
|
|
4150
4162
|
const i = (d = this.client.state.user) == null ? void 0 : d.id;
|
|
4151
4163
|
t.innerHTML = e.comments.map((c) => {
|
|
4152
|
-
const h = this.client.state.getUser(c.userId), p = h ? h.name.split(" ").map((O) => O[0]).join("").toUpperCase().slice(0, 2) : "?", m = (h == null ? void 0 : h.color) ?? "#94a3b8", g = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), y = this.formatTime(c.createdAt),
|
|
4164
|
+
const h = this.client.state.getUser(c.userId), p = h ? h.name.split(" ").map((O) => O[0]).join("").toUpperCase().slice(0, 2) : "?", m = (h == null ? void 0 : h.color) ?? "#94a3b8", g = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), y = this.formatTime(c.createdAt), b = i === c.userId, w = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
|
|
4153
4165
|
if (this.editingPopoverCommentId === c.id)
|
|
4154
4166
|
return `
|
|
4155
4167
|
<div style="margin-bottom:10px;" data-comment-id="${c.id}">
|
|
@@ -4177,7 +4189,7 @@ class ns {
|
|
|
4177
4189
|
</div>`;
|
|
4178
4190
|
}
|
|
4179
4191
|
return O.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(O.url)}" data-duration="${O.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : O.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(O.url)}" data-poster="${this.escapeHtml(O.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
|
|
4180
|
-
}).join(""), z =
|
|
4192
|
+
}).join(""), z = b ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
|
|
4181
4193
|
<button class="edit-btn" data-comment-id="${c.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Edit"
|
|
4182
4194
|
onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
|
|
4183
4195
|
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${is}</button>
|
|
@@ -4307,8 +4319,8 @@ class ns {
|
|
|
4307
4319
|
padding: "0",
|
|
4308
4320
|
fontWeight: "700"
|
|
4309
4321
|
}), y.addEventListener("click", () => {
|
|
4310
|
-
const
|
|
4311
|
-
|
|
4322
|
+
const b = l.indexOf(p);
|
|
4323
|
+
b !== -1 && l.splice(b, 1), g.remove();
|
|
4312
4324
|
}), g.appendChild(y), a.appendChild(g);
|
|
4313
4325
|
}, c = 5;
|
|
4314
4326
|
t.querySelector(".reply-attach-img").addEventListener("click", async () => {
|
|
@@ -4510,7 +4522,7 @@ var os = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, U = (n, e,
|
|
|
4510
4522
|
return i && s && os(e, t, s), s;
|
|
4511
4523
|
};
|
|
4512
4524
|
const as = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
4513
|
-
let
|
|
4525
|
+
let P = class extends A {
|
|
4514
4526
|
constructor() {
|
|
4515
4527
|
super(...arguments), this.highlightThreadId = null, this.threadsVersion = 0, this.replyingTo = null, this.editingCommentId = null, this.editBody = "", this.pickerOpenForComment = null, this.typingByThread = /* @__PURE__ */ new Map(), this.reactionsVersion = 0, this.typingTimers = /* @__PURE__ */ new Map(), this.lastTypingSend = /* @__PURE__ */ new Map(), this.replyAttachmentIds = [];
|
|
4516
4528
|
}
|
|
@@ -4625,14 +4637,14 @@ let A = class extends P {
|
|
|
4625
4637
|
}
|
|
4626
4638
|
async handleAttachImage() {
|
|
4627
4639
|
this.upload || (this.upload = new re(this.client));
|
|
4628
|
-
const n =
|
|
4640
|
+
const n = P.MAX_ATTACHMENTS - this.replyAttachmentIds.length;
|
|
4629
4641
|
if (n <= 0) return;
|
|
4630
4642
|
const e = await this.upload.pickFiles("image/*", n);
|
|
4631
4643
|
e.length > 0 && (this.replyAttachmentIds.push(...e.map((t) => t.id)), this.requestUpdate());
|
|
4632
4644
|
}
|
|
4633
4645
|
async handleRecordAudio(n) {
|
|
4634
4646
|
var i;
|
|
4635
|
-
if (this.replyAttachmentIds.length >=
|
|
4647
|
+
if (this.replyAttachmentIds.length >= P.MAX_ATTACHMENTS) return;
|
|
4636
4648
|
this.upload || (this.upload = new re(this.client)), this.audioRecorder || (this.audioRecorder = new ze());
|
|
4637
4649
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
|
|
4638
4650
|
if (t) {
|
|
@@ -4642,7 +4654,7 @@ let A = class extends P {
|
|
|
4642
4654
|
}
|
|
4643
4655
|
async handleRecordVideo(n) {
|
|
4644
4656
|
var i;
|
|
4645
|
-
if (this.replyAttachmentIds.length >=
|
|
4657
|
+
if (this.replyAttachmentIds.length >= P.MAX_ATTACHMENTS) return;
|
|
4646
4658
|
this.upload || (this.upload = new re(this.client)), this.videoRecorder || (this.videoRecorder = new Ue());
|
|
4647
4659
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.videoRecorder.startRecording(e ?? document.body);
|
|
4648
4660
|
if (t) {
|
|
@@ -4735,14 +4747,14 @@ let A = class extends P {
|
|
|
4735
4747
|
`
|
|
4736
4748
|
)}
|
|
4737
4749
|
</div>
|
|
4738
|
-
` :
|
|
4750
|
+
` : v}
|
|
4739
4751
|
</button>
|
|
4740
4752
|
</div>
|
|
4741
4753
|
`;
|
|
4742
4754
|
}
|
|
4743
4755
|
renderTypingIndicator(n) {
|
|
4744
4756
|
const e = this.typingByThread.get(n) ?? [];
|
|
4745
|
-
if (e.length === 0) return
|
|
4757
|
+
if (e.length === 0) return v;
|
|
4746
4758
|
const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
|
|
4747
4759
|
return u`<div class="typing-indicator">${t}</div>`;
|
|
4748
4760
|
}
|
|
@@ -4763,7 +4775,7 @@ let A = class extends P {
|
|
|
4763
4775
|
<span class="thread-count">${this.threads.length}</span>
|
|
4764
4776
|
</span>
|
|
4765
4777
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
4766
|
-
${C(
|
|
4778
|
+
${C(ve, 16)}
|
|
4767
4779
|
</button>
|
|
4768
4780
|
</div>
|
|
4769
4781
|
|
|
@@ -4781,7 +4793,7 @@ let A = class extends P {
|
|
|
4781
4793
|
`;
|
|
4782
4794
|
}
|
|
4783
4795
|
renderAttachments(n) {
|
|
4784
|
-
if (!n || n.length === 0) return
|
|
4796
|
+
if (!n || n.length === 0) return v;
|
|
4785
4797
|
const e = n.filter((t) => t.type === "image").map((t) => t.url);
|
|
4786
4798
|
return u`
|
|
4787
4799
|
${n.map((t) => {
|
|
@@ -4806,7 +4818,7 @@ let A = class extends P {
|
|
|
4806
4818
|
<div class="comment-attachment-media" id="video-${t.id}">
|
|
4807
4819
|
${this.renderVideoPlayer(t)}
|
|
4808
4820
|
</div>
|
|
4809
|
-
` :
|
|
4821
|
+
` : v;
|
|
4810
4822
|
})}
|
|
4811
4823
|
`;
|
|
4812
4824
|
}
|
|
@@ -4825,13 +4837,13 @@ let A = class extends P {
|
|
|
4825
4837
|
data-thread-id=${n.id}
|
|
4826
4838
|
>
|
|
4827
4839
|
${n.position ? u`<div class="pin-badge">
|
|
4828
|
-
${C(
|
|
4840
|
+
${C(Pt, 12)}
|
|
4829
4841
|
Pinned
|
|
4830
|
-
</div>` :
|
|
4842
|
+
</div>` : v}
|
|
4831
4843
|
${n.comments.map((t, i) => {
|
|
4832
4844
|
const s = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
|
|
4833
4845
|
return u`
|
|
4834
|
-
${i > 0 ? u`<div class="comment-divider"></div>` :
|
|
4846
|
+
${i > 0 ? u`<div class="comment-divider"></div>` : v}
|
|
4835
4847
|
<div class="comment">
|
|
4836
4848
|
<div class="comment-header">
|
|
4837
4849
|
<div
|
|
@@ -4842,16 +4854,16 @@ let A = class extends P {
|
|
|
4842
4854
|
</div>
|
|
4843
4855
|
<span class="comment-author">${(s == null ? void 0 : s.name) ?? "Unknown"}</span>
|
|
4844
4856
|
<span class="comment-time">${this.formatTime(t.createdAt)}</span>
|
|
4845
|
-
${t.editedAt ? u`<span class="edited-badge">(edited)</span>` :
|
|
4857
|
+
${t.editedAt ? u`<span class="edited-badge">(edited)</span>` : v}
|
|
4846
4858
|
</div>
|
|
4847
4859
|
${r ? this.renderEditForm(t) : u`
|
|
4848
|
-
${t.body && t.body !== "(attachment)" ? u`<div class="comment-body">${this.parseMentions(t.body)}</div>` :
|
|
4860
|
+
${t.body && t.body !== "(attachment)" ? u`<div class="comment-body">${this.parseMentions(t.body)}</div>` : v}
|
|
4849
4861
|
${this.renderAttachments(t.attachments ?? [])}
|
|
4850
4862
|
`}
|
|
4851
4863
|
${o && !r ? u`<div class="comment-actions">
|
|
4852
4864
|
<button @click=${() => this.startEdit(t)} title="Edit">${C(Oi, 14)}</button>
|
|
4853
4865
|
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(Li, 14)}</button>
|
|
4854
|
-
</div>` :
|
|
4866
|
+
</div>` : v}
|
|
4855
4867
|
${this.renderReactions(t)}
|
|
4856
4868
|
</div>
|
|
4857
4869
|
`;
|
|
@@ -4918,15 +4930,15 @@ let A = class extends P {
|
|
|
4918
4930
|
</div>
|
|
4919
4931
|
</div>
|
|
4920
4932
|
</form>
|
|
4921
|
-
` :
|
|
4933
|
+
` : v}
|
|
4922
4934
|
</div>
|
|
4923
4935
|
`;
|
|
4924
4936
|
}
|
|
4925
4937
|
};
|
|
4926
|
-
|
|
4938
|
+
P.styles = [
|
|
4927
4939
|
ie,
|
|
4928
|
-
|
|
4929
|
-
|
|
4940
|
+
be,
|
|
4941
|
+
Pe,
|
|
4930
4942
|
M`
|
|
4931
4943
|
:host {
|
|
4932
4944
|
display: block;
|
|
@@ -5467,37 +5479,37 @@ A.styles = [
|
|
|
5467
5479
|
}
|
|
5468
5480
|
`
|
|
5469
5481
|
];
|
|
5470
|
-
|
|
5482
|
+
P.MAX_ATTACHMENTS = 5;
|
|
5471
5483
|
U([
|
|
5472
5484
|
x({ attribute: !1 })
|
|
5473
|
-
],
|
|
5485
|
+
], P.prototype, "client", 2);
|
|
5474
5486
|
U([
|
|
5475
5487
|
x()
|
|
5476
|
-
],
|
|
5488
|
+
], P.prototype, "highlightThreadId", 2);
|
|
5477
5489
|
U([
|
|
5478
5490
|
$()
|
|
5479
|
-
],
|
|
5491
|
+
], P.prototype, "threadsVersion", 2);
|
|
5480
5492
|
U([
|
|
5481
5493
|
$()
|
|
5482
|
-
],
|
|
5494
|
+
], P.prototype, "replyingTo", 2);
|
|
5483
5495
|
U([
|
|
5484
5496
|
$()
|
|
5485
|
-
],
|
|
5497
|
+
], P.prototype, "editingCommentId", 2);
|
|
5486
5498
|
U([
|
|
5487
5499
|
$()
|
|
5488
|
-
],
|
|
5500
|
+
], P.prototype, "editBody", 2);
|
|
5489
5501
|
U([
|
|
5490
5502
|
$()
|
|
5491
|
-
],
|
|
5503
|
+
], P.prototype, "pickerOpenForComment", 2);
|
|
5492
5504
|
U([
|
|
5493
5505
|
$()
|
|
5494
|
-
],
|
|
5506
|
+
], P.prototype, "typingByThread", 2);
|
|
5495
5507
|
U([
|
|
5496
5508
|
$()
|
|
5497
|
-
],
|
|
5498
|
-
|
|
5509
|
+
], P.prototype, "reactionsVersion", 2);
|
|
5510
|
+
P = U([
|
|
5499
5511
|
L("pulse-widget-comments-panel")
|
|
5500
|
-
],
|
|
5512
|
+
], P);
|
|
5501
5513
|
var ls = Object.defineProperty, cs = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
|
|
5502
5514
|
for (var s = i > 1 ? void 0 : i ? cs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
5503
5515
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
@@ -5516,7 +5528,7 @@ const ds = {
|
|
|
5516
5528
|
"thread:resolved": "✅",
|
|
5517
5529
|
"reaction:added": "🎉"
|
|
5518
5530
|
};
|
|
5519
|
-
let pe = class extends
|
|
5531
|
+
let pe = class extends A {
|
|
5520
5532
|
constructor() {
|
|
5521
5533
|
super(...arguments), this.notifications = [];
|
|
5522
5534
|
}
|
|
@@ -5565,14 +5577,14 @@ let pe = class extends P {
|
|
|
5565
5577
|
<div class="panel-header">
|
|
5566
5578
|
<span class="panel-title">
|
|
5567
5579
|
Notifications
|
|
5568
|
-
${n > 0 ? u`<span class="unread-badge">${n}</span>` :
|
|
5580
|
+
${n > 0 ? u`<span class="unread-badge">${n}</span>` : v}
|
|
5569
5581
|
</span>
|
|
5570
5582
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
5571
5583
|
${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
5572
5584
|
Mark all read
|
|
5573
|
-
</button>` :
|
|
5585
|
+
</button>` : v}
|
|
5574
5586
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5575
|
-
${C(
|
|
5587
|
+
${C(ve, 16)}
|
|
5576
5588
|
</button>
|
|
5577
5589
|
</div>
|
|
5578
5590
|
</div>
|
|
@@ -5606,8 +5618,8 @@ let pe = class extends P {
|
|
|
5606
5618
|
};
|
|
5607
5619
|
pe.styles = [
|
|
5608
5620
|
ie,
|
|
5609
|
-
|
|
5610
|
-
|
|
5621
|
+
be,
|
|
5622
|
+
Pe,
|
|
5611
5623
|
M`
|
|
5612
5624
|
:host {
|
|
5613
5625
|
display: block;
|
|
@@ -6044,7 +6056,7 @@ class fs {
|
|
|
6044
6056
|
}
|
|
6045
6057
|
function ms(n) {
|
|
6046
6058
|
if (!n.rangeCount || n.isCollapsed) return null;
|
|
6047
|
-
const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s =
|
|
6059
|
+
const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = vt(t), o = vt(i);
|
|
6048
6060
|
return !s || !o ? null : {
|
|
6049
6061
|
startSelector: s,
|
|
6050
6062
|
startOffset: e.startOffset,
|
|
@@ -6063,18 +6075,18 @@ function gs(n) {
|
|
|
6063
6075
|
return null;
|
|
6064
6076
|
}
|
|
6065
6077
|
}
|
|
6066
|
-
function
|
|
6078
|
+
function vt(n) {
|
|
6067
6079
|
if (n.nodeType === Node.TEXT_NODE) {
|
|
6068
6080
|
const e = n.parentElement;
|
|
6069
6081
|
if (!e) return null;
|
|
6070
|
-
const t =
|
|
6082
|
+
const t = bt(e);
|
|
6071
6083
|
if (!t) return null;
|
|
6072
6084
|
const i = Array.from(e.childNodes).indexOf(n);
|
|
6073
6085
|
return `${t}::text(${i})`;
|
|
6074
6086
|
}
|
|
6075
|
-
return n.nodeType === Node.ELEMENT_NODE ?
|
|
6087
|
+
return n.nodeType === Node.ELEMENT_NODE ? bt(n) : null;
|
|
6076
6088
|
}
|
|
6077
|
-
function
|
|
6089
|
+
function bt(n) {
|
|
6078
6090
|
if (!n || n === document.documentElement) return "html";
|
|
6079
6091
|
if (n === document.body) return "body";
|
|
6080
6092
|
if (n.id) return `#${CSS.escape(n.id)}`;
|
|
@@ -6117,7 +6129,7 @@ function xt(n) {
|
|
|
6117
6129
|
return null;
|
|
6118
6130
|
}
|
|
6119
6131
|
}
|
|
6120
|
-
class
|
|
6132
|
+
class vs {
|
|
6121
6133
|
constructor(e) {
|
|
6122
6134
|
this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
|
|
6123
6135
|
}
|
|
@@ -6200,12 +6212,12 @@ class bs {
|
|
|
6200
6212
|
}
|
|
6201
6213
|
}
|
|
6202
6214
|
}
|
|
6203
|
-
var
|
|
6215
|
+
var bs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
|
|
6204
6216
|
for (var s = i > 1 ? void 0 : i ? xs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
6205
6217
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6206
|
-
return i && s &&
|
|
6218
|
+
return i && s && bs(e, t, s), s;
|
|
6207
6219
|
};
|
|
6208
|
-
let ue = class extends
|
|
6220
|
+
let ue = class extends A {
|
|
6209
6221
|
constructor() {
|
|
6210
6222
|
super(...arguments), this.roomId = "";
|
|
6211
6223
|
}
|
|
@@ -6246,7 +6258,7 @@ let ue = class extends P {
|
|
|
6246
6258
|
<div class="panel-header">
|
|
6247
6259
|
<span class="panel-title">Settings</span>
|
|
6248
6260
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
6249
|
-
${C(
|
|
6261
|
+
${C(ve, 16)}
|
|
6250
6262
|
</button>
|
|
6251
6263
|
</div>
|
|
6252
6264
|
|
|
@@ -6293,8 +6305,8 @@ let ue = class extends P {
|
|
|
6293
6305
|
};
|
|
6294
6306
|
ue.styles = [
|
|
6295
6307
|
ie,
|
|
6296
|
-
|
|
6297
|
-
|
|
6308
|
+
be,
|
|
6309
|
+
Pe,
|
|
6298
6310
|
M`
|
|
6299
6311
|
:host {
|
|
6300
6312
|
display: block;
|
|
@@ -6503,7 +6515,7 @@ var $s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, j = (n, e,
|
|
|
6503
6515
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6504
6516
|
return i && s && $s(e, t, s), s;
|
|
6505
6517
|
};
|
|
6506
|
-
let R = class extends
|
|
6518
|
+
let R = class extends A {
|
|
6507
6519
|
constructor() {
|
|
6508
6520
|
super(...arguments), this.collapsed = !1, this.activePanel = null, this.pinModeActive = !1, this.featuresDisabled = !1, this.drawModeActive = !1, this.followingUserId = null, this.display = "floating", this.users = [], this.unreadCount = 0;
|
|
6509
6521
|
}
|
|
@@ -6511,16 +6523,18 @@ let R = class extends P {
|
|
|
6511
6523
|
super.connectedCallback(), this.setupPresence();
|
|
6512
6524
|
}
|
|
6513
6525
|
disconnectedCallback() {
|
|
6514
|
-
var n, e;
|
|
6515
|
-
super.disconnectedCallback(), (n = this.unsub) == null || n.call(this), (e = this.
|
|
6526
|
+
var n, e, t;
|
|
6527
|
+
super.disconnectedCallback(), (n = this.unsub) == null || n.call(this), (e = this.authUnsub) == null || e.call(this), (t = this.notifUnsub) == null || t.call(this);
|
|
6516
6528
|
}
|
|
6517
6529
|
updated(n) {
|
|
6518
|
-
var e, t;
|
|
6519
|
-
n.has("client") && this.client && ((e = this.unsub) == null || e.call(this), (t = this.
|
|
6530
|
+
var e, t, i;
|
|
6531
|
+
n.has("client") && this.client && ((e = this.unsub) == null || e.call(this), (t = this.authUnsub) == null || t.call(this), (i = this.notifUnsub) == null || i.call(this), this.setupPresence());
|
|
6520
6532
|
}
|
|
6521
6533
|
setupPresence() {
|
|
6522
6534
|
this.client && (this.users = this.client.state.presence, this.unreadCount = this.client.state.unreadCount, this.unsub = this.client.state.on("presence", (n) => {
|
|
6523
|
-
this.users = n;
|
|
6535
|
+
this.users = [...n];
|
|
6536
|
+
}), this.authUnsub = this.client.state.on("auth", () => {
|
|
6537
|
+
this.users = this.client.state.presence, this.unreadCount = this.client.state.unreadCount;
|
|
6524
6538
|
}), this.notifUnsub = this.client.state.on("notifications", () => {
|
|
6525
6539
|
this.unreadCount = this.client.state.unreadCount;
|
|
6526
6540
|
}));
|
|
@@ -6565,7 +6579,7 @@ let R = class extends P {
|
|
|
6565
6579
|
<!-- Presence avatars -->
|
|
6566
6580
|
${this.users.length > 0 ? u`
|
|
6567
6581
|
<div class="presence">
|
|
6568
|
-
${t > 0 ? u`<div class="presence-overflow">+${t}</div>` :
|
|
6582
|
+
${t > 0 ? u`<div class="presence-overflow">+${t}</div>` : v}
|
|
6569
6583
|
${e.map(
|
|
6570
6584
|
(i) => u`
|
|
6571
6585
|
<div
|
|
@@ -6576,13 +6590,13 @@ let R = class extends P {
|
|
|
6576
6590
|
>
|
|
6577
6591
|
${i.user.avatar ? u`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
|
|
6578
6592
|
<span class="presence-tooltip">${i.user.name}</span>
|
|
6579
|
-
${i.deviceType && i.deviceType !== "desktop" ? u`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` :
|
|
6593
|
+
${i.deviceType && i.deviceType !== "desktop" ? u`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : v}
|
|
6580
6594
|
</div>
|
|
6581
6595
|
`
|
|
6582
6596
|
)}
|
|
6583
6597
|
</div>
|
|
6584
6598
|
<div class="separator"></div>
|
|
6585
|
-
` :
|
|
6599
|
+
` : v}
|
|
6586
6600
|
|
|
6587
6601
|
<!-- Pin comment (primary) -->
|
|
6588
6602
|
<button
|
|
@@ -6592,7 +6606,7 @@ let R = class extends P {
|
|
|
6592
6606
|
?disabled=${this.featuresDisabled}
|
|
6593
6607
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6594
6608
|
>
|
|
6595
|
-
${C(
|
|
6609
|
+
${C(Pt)}
|
|
6596
6610
|
</button>
|
|
6597
6611
|
|
|
6598
6612
|
<!-- View comments -->
|
|
@@ -6603,7 +6617,7 @@ let R = class extends P {
|
|
|
6603
6617
|
?disabled=${this.featuresDisabled}
|
|
6604
6618
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6605
6619
|
>
|
|
6606
|
-
${C(
|
|
6620
|
+
${C(Pi)}
|
|
6607
6621
|
</button>
|
|
6608
6622
|
|
|
6609
6623
|
<!-- Activity feed -->
|
|
@@ -6614,7 +6628,7 @@ let R = class extends P {
|
|
|
6614
6628
|
?disabled=${this.featuresDisabled}
|
|
6615
6629
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6616
6630
|
>
|
|
6617
|
-
${C(
|
|
6631
|
+
${C(Ai)}
|
|
6618
6632
|
</button>
|
|
6619
6633
|
|
|
6620
6634
|
<!-- Draw mode -->
|
|
@@ -6637,7 +6651,7 @@ let R = class extends P {
|
|
|
6637
6651
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
|
|
6638
6652
|
>
|
|
6639
6653
|
${C(Si)}
|
|
6640
|
-
${this.unreadCount > 0 ? u`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` :
|
|
6654
|
+
${this.unreadCount > 0 ? u`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : v}
|
|
6641
6655
|
</button>
|
|
6642
6656
|
|
|
6643
6657
|
<!-- Settings -->
|
|
@@ -6657,7 +6671,7 @@ let R = class extends P {
|
|
|
6657
6671
|
@click=${this.fireToggle}
|
|
6658
6672
|
title="Collapse"
|
|
6659
6673
|
>
|
|
6660
|
-
${C(
|
|
6674
|
+
${C(ve, 14)}
|
|
6661
6675
|
</button>
|
|
6662
6676
|
</div>
|
|
6663
6677
|
`;
|
|
@@ -6665,7 +6679,7 @@ let R = class extends P {
|
|
|
6665
6679
|
};
|
|
6666
6680
|
R.styles = [
|
|
6667
6681
|
ie,
|
|
6668
|
-
|
|
6682
|
+
be,
|
|
6669
6683
|
M`
|
|
6670
6684
|
:host {
|
|
6671
6685
|
display: block;
|
|
@@ -6963,7 +6977,7 @@ class Es {
|
|
|
6963
6977
|
(E) => E.user.id === a
|
|
6964
6978
|
);
|
|
6965
6979
|
if (!m) continue;
|
|
6966
|
-
const g = l.scrollY + l.viewportHeight / 2, y = i > 0 ? g / i : 0,
|
|
6980
|
+
const g = l.scrollY + l.viewportHeight / 2, y = i > 0 ? g / i : 0, b = Math.max(
|
|
6967
6981
|
8,
|
|
6968
6982
|
Math.min(t - 28, y * t)
|
|
6969
6983
|
);
|
|
@@ -6980,7 +6994,7 @@ class Es {
|
|
|
6980
6994
|
whiteSpace: "nowrap",
|
|
6981
6995
|
pointerEvents: "none",
|
|
6982
6996
|
transition: "top 0.3s ease"
|
|
6983
|
-
}), this.container.appendChild(w), this.pillEls.set(a, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${
|
|
6997
|
+
}), this.container.appendChild(w), this.pillEls.set(a, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${b}px`, w.textContent = this.getInitials(m.user.name);
|
|
6984
6998
|
}
|
|
6985
6999
|
for (const [a, l] of this.pillEls)
|
|
6986
7000
|
!o.has(a) && !this.client.state.viewports.has(a) && (l.remove(), this.pillEls.delete(a));
|
|
@@ -6994,7 +7008,7 @@ var Cs = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, _ = (n, e,
|
|
|
6994
7008
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6995
7009
|
return i && s && Cs(e, t, s), s;
|
|
6996
7010
|
};
|
|
6997
|
-
let T = class extends
|
|
7011
|
+
let T = class extends A {
|
|
6998
7012
|
constructor() {
|
|
6999
7013
|
super(...arguments), this.apiKey = "", this.token = "", this.room = "", this.position = "bottom-right", this.display = "floating", this.collapsed = !0, this.activePanel = null, this.pinModeActive = !1, this.highlightThreadId = null, this.settings = { ...$e }, this.followingUserId = null, this.drawModeActive = !1, this.connectionState = "disconnected", this.showConnectedFlash = !1, this.unsubs = [], this.clientConfigKey = "", this._isFollowScrolling = !1, this._viewportThrottleTimer = null, this._selectionThrottleTimer = null, this._connectedFlashTimer = null, this._wasDisconnected = !1, this.handleScroll = () => {
|
|
7000
7014
|
!this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
|
|
@@ -7053,7 +7067,7 @@ let T = class extends P {
|
|
|
7053
7067
|
onPinModeExit: () => {
|
|
7054
7068
|
this.pinModeActive = !1;
|
|
7055
7069
|
}
|
|
7056
|
-
}), this.viewportOverlay = new Es(this.client), this.selectionOverlay = new
|
|
7070
|
+
}), this.viewportOverlay = new Es(this.client), this.selectionOverlay = new vs(this.client), this.drawingOverlay = new fs(this.client), this.settings = ys(this.room), this.applySettings(this.settings), this.unsubs.push(
|
|
7057
7071
|
this.client.on("connection", (e) => {
|
|
7058
7072
|
this.connectionState = e, e === "connected" && this._wasDisconnected ? (this.showConnectedFlash = !0, this._connectedFlashTimer && clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = setTimeout(() => {
|
|
7059
7073
|
this.showConnectedFlash = !1, this._connectedFlashTimer = null;
|
|
@@ -7090,29 +7104,30 @@ let T = class extends P {
|
|
|
7090
7104
|
this.activePanel = null, this.highlightThreadId = null;
|
|
7091
7105
|
}
|
|
7092
7106
|
handleToolbarAction(n) {
|
|
7093
|
-
var
|
|
7107
|
+
var i, s, o, r;
|
|
7094
7108
|
const e = n.detail;
|
|
7095
|
-
if (!
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7109
|
+
if (!this.settings.enabled && e !== "settings") return;
|
|
7110
|
+
const t = e === "comments" || e === "settings" || e === "notifications" || e === "activity";
|
|
7111
|
+
switch ((t || e === "pin-mode") && this.drawModeActive && (this.drawModeActive = !1, (i = this.drawingOverlay) == null || i.disableDrawMode()), (t || e === "draw-mode") && this.pinModeActive && (this.pinModeActive = !1, (s = this.commentPins) == null || s.exitPinMode()), (e === "pin-mode" || e === "draw-mode") && (this.activePanel = null), e) {
|
|
7112
|
+
case "comments":
|
|
7113
|
+
this.activePanel = this.activePanel === "comments" ? null : "comments", this.highlightThreadId = null;
|
|
7114
|
+
break;
|
|
7115
|
+
case "settings":
|
|
7116
|
+
this.activePanel = this.activePanel === "settings" ? null : "settings";
|
|
7117
|
+
break;
|
|
7118
|
+
case "notifications":
|
|
7119
|
+
this.activePanel = this.activePanel === "notifications" ? null : "notifications";
|
|
7120
|
+
break;
|
|
7121
|
+
case "activity":
|
|
7122
|
+
this.activePanel = this.activePanel === "activity" ? null : "activity";
|
|
7123
|
+
break;
|
|
7124
|
+
case "pin-mode":
|
|
7125
|
+
this.pinModeActive = !this.pinModeActive, this.pinModeActive && ((o = this.commentPins) == null || o.enterPinMode());
|
|
7126
|
+
break;
|
|
7127
|
+
case "draw-mode":
|
|
7128
|
+
this.drawModeActive = !this.drawModeActive, this.drawModeActive && ((r = this.drawingOverlay) == null || r.enableDrawMode());
|
|
7129
|
+
break;
|
|
7130
|
+
}
|
|
7116
7131
|
}
|
|
7117
7132
|
handleFollow(n) {
|
|
7118
7133
|
const e = n.detail;
|
|
@@ -7123,12 +7138,12 @@ let T = class extends P {
|
|
|
7123
7138
|
this.settings = e, ws(this.room, e), this.applySettings(e);
|
|
7124
7139
|
}
|
|
7125
7140
|
applySettings(n) {
|
|
7126
|
-
var e, t, i, s, o, r, a, l, d, c, h, p, m, g, y,
|
|
7141
|
+
var e, t, i, s, o, r, a, l, d, c, h, p, m, g, y, b, w;
|
|
7127
7142
|
if (!n.enabled) {
|
|
7128
7143
|
(e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (s = this.drawingOverlay) == null || s.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (a = this.commentPins) == null || a.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((l = this.commentPins) == null || l.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
|
|
7129
7144
|
return;
|
|
7130
7145
|
}
|
|
7131
|
-
this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (p = this.viewportOverlay) == null || p.disable(), n.showSelections ? (m = this.selectionOverlay) == null || m.enable() : (g = this.selectionOverlay) == null || g.disable(), n.showDrawings ? (y = this.drawingOverlay) == null || y.enable() : ((
|
|
7146
|
+
this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (p = this.viewportOverlay) == null || p.disable(), n.showSelections ? (m = this.selectionOverlay) == null || m.enable() : (g = this.selectionOverlay) == null || g.disable(), n.showDrawings ? (y = this.drawingOverlay) == null || y.enable() : ((b = this.drawingOverlay) == null || b.disable(), this.drawModeActive && ((w = this.drawingOverlay) == null || w.disableDrawMode(), this.drawModeActive = !1));
|
|
7132
7147
|
}
|
|
7133
7148
|
applyCursorSettings(n) {
|
|
7134
7149
|
if (!this.cursorOverlay) return;
|
|
@@ -7142,10 +7157,10 @@ let T = class extends P {
|
|
|
7142
7157
|
* the trigger element, flipping vertically/horizontally as needed.
|
|
7143
7158
|
*/
|
|
7144
7159
|
positionPopups() {
|
|
7145
|
-
var g, y,
|
|
7160
|
+
var g, y, b, w;
|
|
7146
7161
|
const n = this.display === "inline", e = (g = this.shadowRoot) == null ? void 0 : g.querySelector(".inline-trigger"), t = (y = this.shadowRoot) == null ? void 0 : y.querySelector("pulse-widget-toolbar"), i = n ? e : t;
|
|
7147
7162
|
if (!i) return;
|
|
7148
|
-
const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (
|
|
7163
|
+
const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".toolbar-popover");
|
|
7149
7164
|
if (l) {
|
|
7150
7165
|
Object.assign(l.style, { top: "auto", left: "auto" });
|
|
7151
7166
|
const E = l.getBoundingClientRect(), I = this.computePosition(s, E, o, r, a);
|
|
@@ -7182,7 +7197,7 @@ let T = class extends P {
|
|
|
7182
7197
|
<span class="connection-dot"></span>Reconnecting...
|
|
7183
7198
|
</div>` : this.connectionState === "disconnected" && this.client ? u`<div class="connection-banner disconnected">
|
|
7184
7199
|
<span class="connection-dot"></span>Disconnected
|
|
7185
|
-
</div>` :
|
|
7200
|
+
</div>` : v;
|
|
7186
7201
|
}
|
|
7187
7202
|
handleToolbarToggle() {
|
|
7188
7203
|
this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
|
|
@@ -7202,25 +7217,25 @@ let T = class extends P {
|
|
|
7202
7217
|
${this.activePanel === "comments" ? u`<pulse-widget-comments-panel
|
|
7203
7218
|
.client=${this.client}
|
|
7204
7219
|
.highlightThreadId=${this.highlightThreadId}
|
|
7205
|
-
></pulse-widget-comments-panel>` :
|
|
7220
|
+
></pulse-widget-comments-panel>` : v}
|
|
7206
7221
|
${this.activePanel === "settings" ? u`<pulse-widget-settings-panel
|
|
7207
7222
|
.settings=${this.settings}
|
|
7208
7223
|
.roomId=${this.room}
|
|
7209
7224
|
@settings-change=${this.handleSettingsChange}
|
|
7210
|
-
></pulse-widget-settings-panel>` :
|
|
7225
|
+
></pulse-widget-settings-panel>` : v}
|
|
7211
7226
|
${this.activePanel === "notifications" ? u`<pulse-widget-notifications-panel
|
|
7212
7227
|
.client=${this.client}
|
|
7213
|
-
></pulse-widget-notifications-panel>` :
|
|
7228
|
+
></pulse-widget-notifications-panel>` : v}
|
|
7214
7229
|
${this.activePanel === "activity" ? u`<pulse-widget-activity-panel
|
|
7215
7230
|
.client=${this.client}
|
|
7216
|
-
></pulse-widget-activity-panel>` :
|
|
7231
|
+
></pulse-widget-activity-panel>` : v}
|
|
7217
7232
|
</div>
|
|
7218
|
-
` :
|
|
7233
|
+
` : v, t = this.followingUserId ? u`<div class="follow-banner">
|
|
7219
7234
|
Following ${this.getFollowUserName()}
|
|
7220
7235
|
<button @click=${() => {
|
|
7221
7236
|
this.followingUserId = null;
|
|
7222
7237
|
}}>Stop</button>
|
|
7223
|
-
</div>` :
|
|
7238
|
+
</div>` : v;
|
|
7224
7239
|
return n ? u`
|
|
7225
7240
|
${t}
|
|
7226
7241
|
<div class="widget-root">
|
|
@@ -7499,6 +7514,6 @@ export {
|
|
|
7499
7514
|
he as PulseNotifications,
|
|
7500
7515
|
Z as PulsePresence,
|
|
7501
7516
|
X as PulseProvider,
|
|
7502
|
-
|
|
7517
|
+
N as PulseReactions,
|
|
7503
7518
|
T as PulseWidget
|
|
7504
7519
|
};
|