alice-and-bot 1.0.94 → 1.0.96
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/components.js +886 -354
- package/package.json +1 -1
package/components.js
CHANGED
|
@@ -438,7 +438,7 @@ var require__ = __commonJS({
|
|
|
438
438
|
});
|
|
439
439
|
|
|
440
440
|
// lit/components/connected-chat.ts
|
|
441
|
-
import { html as
|
|
441
|
+
import { html as html12, LitElement as LitElement10, nothing as nothing6 } from "lit";
|
|
442
442
|
|
|
443
443
|
// protocol/src/pushNotification.ts
|
|
444
444
|
var maxPreviewLength = 160;
|
|
@@ -1544,7 +1544,7 @@ var makeCreateVoiceCall = (deps) => (params) => {
|
|
|
1544
1544
|
var createVoiceCall = (params) => makeCreateVoiceCall(defaultDeps())(params);
|
|
1545
1545
|
|
|
1546
1546
|
// lit/components/chat-box.ts
|
|
1547
|
-
import { html as
|
|
1547
|
+
import { html as html10, LitElement as LitElement8, nothing as nothing4 } from "lit";
|
|
1548
1548
|
import { repeat } from "lit/directives/repeat.js";
|
|
1549
1549
|
|
|
1550
1550
|
// lit/components/design.ts
|
|
@@ -1828,9 +1828,22 @@ var faCopy = icon("M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-2
|
|
|
1828
1828
|
var faReply = icon("M8.309 189.836L184.313 37.851C199.719 24.546 224 35.347 224 56.015v80.053c160.629 5.618 288 66.816 288 207.931 0 56.548-36.256 112.589-76.437 141.821-12.73 9.261-30.669-2.577-25.536-17.832C449.428 344.102 376.389 292.009 224 288.063v84.421c0 20.7-24.3 31.453-39.687 18.164L8.309 238.477c-11.078-9.592-11.078-26.049 0-35.641z", "0 0 512 512");
|
|
1829
1829
|
var faShare = icon("M503.7 226.2l-160-160c-21.9-21.9-59.7-6.3-59.7 24.7V160H224C100.3 160 0 260.3 0 384c0 35.3 28.7 64 64 64 27.2 0 50.4-16.9 59.8-41.4 24.4-63.7 85.3-110.6 156.2-110.6h5v69.1c0 31.1 37.8 46.6 59.7 24.7l160-160c12.5-12.5 12.5-32.8 0-45.6z", "0 0 512 512");
|
|
1830
1830
|
var faChevronDown = icon("M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z", "0 0 24 24");
|
|
1831
|
+
var faPlus = html`
|
|
1832
|
+
<svg
|
|
1833
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1834
|
+
viewBox="0 0 24 24"
|
|
1835
|
+
fill="none"
|
|
1836
|
+
stroke="currentColor"
|
|
1837
|
+
stroke-width="2.4"
|
|
1838
|
+
stroke-linecap="round"
|
|
1839
|
+
style="width:1em;height:1em;display:block"
|
|
1840
|
+
>
|
|
1841
|
+
<path d="M12 5v14M5 12h14" />
|
|
1842
|
+
</svg>
|
|
1843
|
+
`;
|
|
1831
1844
|
|
|
1832
1845
|
// lit/components/chat-message.ts
|
|
1833
|
-
import { html as
|
|
1846
|
+
import { html as html8, LitElement as LitElement6, nothing as nothing3 } from "lit";
|
|
1834
1847
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
1835
1848
|
|
|
1836
1849
|
// lit/components/chat-attachment.ts
|
|
@@ -2944,11 +2957,13 @@ var ChatAttachment = class extends LitElement4 {
|
|
|
2944
2957
|
}
|
|
2945
2958
|
if (attachment.type === "image") {
|
|
2946
2959
|
const isSelected = this._decryptedUrl && this._decryptedUrl === this.selectedImageSrc;
|
|
2960
|
+
const highlightAnim = isDark ? "msg-highlight-dark" : "msg-highlight-light";
|
|
2961
|
+
const selectedShadow = isDark ? "0 0 0 1px rgba(255,255,255,0.18),0 14px 36px rgba(0,0,0,0.62)" : "0 0 0 1px rgba(24,23,21,0.08),0 12px 32px rgba(24,23,21,0.22)";
|
|
2947
2962
|
return this._decryptedUrl ? html5`
|
|
2948
2963
|
<img
|
|
2949
2964
|
src="${this._decryptedUrl}"
|
|
2950
2965
|
alt="${attachment.name}"
|
|
2951
|
-
style="max-width:100%;border-radius:8px;cursor:pointer;transition:box-shadow .
|
|
2966
|
+
style="max-width:100%;border-radius:8px;cursor:pointer;transition:box-shadow .22s ease,filter .22s ease${isSelected ? `;box-shadow:${selectedShadow}` : ""}${this.longPressActive && isSelected ? `;animation:${highlightAnim} .28s cubic-bezier(0.2, 0.8, 0.2, 1) forwards` : ""}"
|
|
2952
2967
|
/>
|
|
2953
2968
|
` : this._failed ? unavailableAttachmentHtml(isDark) : html5`
|
|
2954
2969
|
<div style="${imagePlaceholderStyle(isDark)}">${spinnerHtml(isDark)}</div>
|
|
@@ -3462,10 +3477,10 @@ var trim = (characters) => (str) => {
|
|
|
3462
3477
|
return str.substring(start, end + 1);
|
|
3463
3478
|
};
|
|
3464
3479
|
|
|
3465
|
-
// deno:https://jsr.io/@uri/silly-nlp/0.2.
|
|
3480
|
+
// deno:https://jsr.io/@uri/silly-nlp/0.2.16/src/index.ts
|
|
3466
3481
|
var import_npm_levenshtein_search_0_1 = __toESM(require__());
|
|
3467
3482
|
|
|
3468
|
-
// deno:https://jsr.io/@uri/silly-nlp/0.2.
|
|
3483
|
+
// deno:https://jsr.io/@uri/silly-nlp/0.2.16/src/stopWords.ts
|
|
3469
3484
|
var stopWords = [
|
|
3470
3485
|
"i",
|
|
3471
3486
|
"me",
|
|
@@ -3598,7 +3613,7 @@ var stopWords = [
|
|
|
3598
3613
|
"now"
|
|
3599
3614
|
];
|
|
3600
3615
|
|
|
3601
|
-
// deno:https://jsr.io/@uri/silly-nlp/0.2.
|
|
3616
|
+
// deno:https://jsr.io/@uri/silly-nlp/0.2.16/src/index.ts
|
|
3602
3617
|
var regExpLocations = (pattern, input) => {
|
|
3603
3618
|
const locations = [];
|
|
3604
3619
|
let match;
|
|
@@ -3758,7 +3773,12 @@ var isWordLike = (s) => s.length >= 2 && /^[A-Z]?[a-z]+$/.test(s) && /[aeiouy]/i
|
|
|
3758
3773
|
var isAllCapsWord = (s) => /^[A-Z]{2,5}$/.test(s) || s.length >= 2 && s.length <= 12 && /^[A-Z]+$/.test(s) && /[AEIOUY]/.test(s) && !/[BCDFGHJKLMNPQRSTVWXZ]{5,}/.test(s);
|
|
3759
3774
|
var isKnownWord = (word) => commonWebTerms.has(word.toLowerCase()) || isWordLike(word);
|
|
3760
3775
|
var isPureCamelWord = (p) => /^[A-Z]{2,5}$/.test(p) || isWordLike(p);
|
|
3761
|
-
var
|
|
3776
|
+
var isShortLowerAbbrev = (s) => /^[a-z]{1,4}$/.test(s);
|
|
3777
|
+
var isShortAcronym = (p) => isShortLowerAbbrev(p) || /^[A-Z][a-z]{1,3}$/.test(p);
|
|
3778
|
+
var isWordPlusDigits = (s) => letIn(/^([A-Za-z]+)(\d{1,3})$/.exec(s), (m) => m ? /^[A-Z][a-z]{0,3}$/.test(m[1]) || /^[a-z]{1,3}$/.test(m[1]) || /^[A-Z]{2,5}$/.test(m[1]) || m[1].length <= 10 && isWordLike(m[1]) || /^[A-Z]{2}[a-z]{2,6}$/.test(m[1]) : false);
|
|
3779
|
+
var isShortTechLabel = (s) => s.length <= 12 && !/^[0-9a-f]{6,}$/i.test(s) && (isWordPlusDigits(s) || /^[A-Za-z]\d{1,2}[a-z]{1,3}$/.test(s) || /^[A-Za-z][a-z]{1,6}\d[a-z]{2,6}$/.test(s));
|
|
3780
|
+
var isAuxCamelPart = (p) => /^[A-Z]$/.test(p) || isShortAcronym(p) || isShortTechLabel(p);
|
|
3781
|
+
var isLongWord = (p) => p.length >= 3 && isWordLike(p);
|
|
3762
3782
|
var isCamelCaseIdentifier = (token) => {
|
|
3763
3783
|
if (!/^[a-zA-Z][a-zA-Z0-9]*$/.test(token)) return false;
|
|
3764
3784
|
const parts = token.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(" ");
|
|
@@ -3768,8 +3788,16 @@ var isCamelCaseIdentifier = (token) => {
|
|
|
3768
3788
|
return false;
|
|
3769
3789
|
}
|
|
3770
3790
|
const pureCount = parts.filter(isPureCamelWord).length;
|
|
3771
|
-
const
|
|
3772
|
-
|
|
3791
|
+
const auxCount = parts.length - pureCount;
|
|
3792
|
+
const allCapsCount = parts.filter((p) => /^[A-Z]{2,5}$/.test(p)).length;
|
|
3793
|
+
if (allCapsCount > 1) return false;
|
|
3794
|
+
const wordChars = parts.filter(isLongWord).reduce((n, p) => n + p.length, 0);
|
|
3795
|
+
if (wordChars < token.length * 0.5) return false;
|
|
3796
|
+
if (parts.length === 2) {
|
|
3797
|
+
return parts.some((p) => p.length >= 4 && isWordLike(p)) && auxCount === 1;
|
|
3798
|
+
}
|
|
3799
|
+
const longWordCount = parts.filter(isLongWord).length;
|
|
3800
|
+
return longWordCount >= 2 && auxCount <= 2;
|
|
3773
3801
|
};
|
|
3774
3802
|
var isSlugWord = (s) => isKnownWord(s) || isAllCapsWord(s) || isCamelCaseIdentifier(s);
|
|
3775
3803
|
var isNumericSegment = (s) => /^\d+$/.test(s);
|
|
@@ -3778,13 +3806,17 @@ var isLongRandomSegment = (s) => s.length >= 12 && (characterClasses(s) >= 2 ||
|
|
|
3778
3806
|
var dictionarySlug = (token) => {
|
|
3779
3807
|
if (token.includes("+") || isUuid(token)) return false;
|
|
3780
3808
|
if (isKnownWord(token) || isCamelCaseIdentifier(token)) return true;
|
|
3781
|
-
|
|
3809
|
+
const normalized = token.startsWith("~/") ? token.slice(2) : token;
|
|
3810
|
+
return letIn(normalized.split(/[-_.:/]+/).filter((s) => s.length > 0), (segments) => {
|
|
3782
3811
|
if (segments.length < 2) return false;
|
|
3783
3812
|
const wordCount = segments.filter(isSlugWord).length;
|
|
3784
3813
|
if (wordCount === 0) return false;
|
|
3785
|
-
const nonWordOrNumeric = segments.filter((s) => !isSlugWord(s) && !isNumericSegment(s));
|
|
3814
|
+
const nonWordOrNumeric = segments.filter((s) => !isSlugWord(s) && !isNumericSegment(s) && !isShortLowerAbbrev(s));
|
|
3786
3815
|
if (nonWordOrNumeric.length === 0) return true;
|
|
3787
|
-
|
|
3816
|
+
if (nonWordOrNumeric.length === 1 && !isLongRandomSegment(nonWordOrNumeric[0])) {
|
|
3817
|
+
return wordCount >= 2 || isShortTechLabel(nonWordOrNumeric[0]);
|
|
3818
|
+
}
|
|
3819
|
+
return wordCount >= 2 && nonWordOrNumeric.length <= 2 && nonWordOrNumeric.every(isShortTechLabel);
|
|
3788
3820
|
});
|
|
3789
3821
|
};
|
|
3790
3822
|
var shannonEntropy = (token) => {
|
|
@@ -3819,7 +3851,7 @@ var blurredSecretHtml = (secret) => {
|
|
|
3819
3851
|
};
|
|
3820
3852
|
var withSecretsBlurred = (text) => secretsInText(text).reverse().reduce((result, { start, end }) => result.slice(0, start) + blurredSecretHtml(result.slice(start, end)) + result.slice(end), text);
|
|
3821
3853
|
var tagOrText = /(<[^>]+>)/;
|
|
3822
|
-
var blurSecretsInHtml = (
|
|
3854
|
+
var blurSecretsInHtml = (html14) => html14.split(tagOrText).map((part) => part.startsWith("<") ? part : withSecretsBlurred(part)).join("");
|
|
3823
3855
|
var secretBlurCss = (isDark) => `
|
|
3824
3856
|
.secret-blur{border-radius:4px;padding:0 3px;cursor:default;background:${isDark ? "#ffffff14" : "#0000000d"}}
|
|
3825
3857
|
.secret-blur .secret-prefix{font-family:inherit;opacity:.85}
|
|
@@ -4064,10 +4096,10 @@ var processButtons = (text, isDark, primaryColor, showButtons) => {
|
|
|
4064
4096
|
var escapeHtmlTags = (text) => text.replace(/<(\/?[a-zA-Z!])/g, "<$1");
|
|
4065
4097
|
var renderMarkdown = (text, textColor, isDark, primaryColor = defaultPrimary(isDark), showButtons = true) => {
|
|
4066
4098
|
const { text: cleanText, buttonsHtml } = processButtons(text, isDark, primaryColor, showButtons);
|
|
4067
|
-
const
|
|
4099
|
+
const html14 = createMarked(textColor, isDark).parse(escapeHtmlTags(preprocessText(cleanText)), {
|
|
4068
4100
|
async: false
|
|
4069
4101
|
}).trim();
|
|
4070
|
-
const trimmedHtml =
|
|
4102
|
+
const trimmedHtml = html14.replace(/(?:<br\s*\/?>)+$/gi, "");
|
|
4071
4103
|
const spanCount = (trimmedHtml.match(/<span\b/g) || []).length;
|
|
4072
4104
|
const hasOtherBlocks = /<(div|pre|blockquote|ul|ol|table|h[1-6])\b/i.test(trimmedHtml);
|
|
4073
4105
|
const baseHtml = spanCount === 1 && !hasOtherBlocks && trimmedHtml.startsWith("<span") && trimmedHtml.endsWith("</span>") ? trimmedHtml.replace(/^<span\b[^>]*>/i, "").replace(/<\/span>$/i, "") : trimmedHtml;
|
|
@@ -4075,6 +4107,9 @@ var renderMarkdown = (text, textColor, isDark, primaryColor = defaultPrimary(isD
|
|
|
4075
4107
|
};
|
|
4076
4108
|
var fencedCodeHoverCss = `.fenced-code-wrap:hover [data-testid="copy-code-button"]{opacity:1!important;background:#ffffff1a!important}`;
|
|
4077
4109
|
|
|
4110
|
+
// lit/components/reaction-picker.ts
|
|
4111
|
+
import { html as html7 } from "lit";
|
|
4112
|
+
|
|
4078
4113
|
// lit/components/emoji.ts
|
|
4079
4114
|
var quickReactionEmojis = [
|
|
4080
4115
|
"\u{1F44D}",
|
|
@@ -6541,6 +6576,389 @@ var parseReactionCommand = (text) => {
|
|
|
6541
6576
|
} : null;
|
|
6542
6577
|
};
|
|
6543
6578
|
|
|
6579
|
+
// lit/components/reaction-picker.ts
|
|
6580
|
+
var clamp = (value, min, max2) => Math.max(min, Math.min(value, Math.max(min, max2)));
|
|
6581
|
+
var viewportMargin = 12;
|
|
6582
|
+
var anchorGap = 8;
|
|
6583
|
+
var mobileAnchorGap = 10;
|
|
6584
|
+
var quickBarHeight = 46;
|
|
6585
|
+
var quickBarWidth = 242;
|
|
6586
|
+
var mobilePillHeight = 52;
|
|
6587
|
+
var mobilePillMaxWidth = 276;
|
|
6588
|
+
var mobileMenuMaxWidth = 236;
|
|
6589
|
+
var mobileActionRowHeight = 46;
|
|
6590
|
+
var desktopPopoverMaxWidth = 352;
|
|
6591
|
+
var desktopPopoverMaxHeight = 416;
|
|
6592
|
+
var computeQuickBarPosition = ({ anchor, isOwn, vpWidth, vpHeight }) => {
|
|
6593
|
+
const width = Math.min(quickBarWidth, vpWidth - viewportMargin * 2);
|
|
6594
|
+
const aboveTop = anchor.top - quickBarHeight - anchorGap;
|
|
6595
|
+
const fitsAbove = aboveTop >= viewportMargin;
|
|
6596
|
+
const placement = fitsAbove ? "above" : "below";
|
|
6597
|
+
const rawTop = fitsAbove ? aboveTop : anchor.bottom + anchorGap;
|
|
6598
|
+
const top = clamp(rawTop, viewportMargin, vpHeight - quickBarHeight - viewportMargin);
|
|
6599
|
+
const rawLeft = isOwn ? anchor.right - width : anchor.left;
|
|
6600
|
+
const left = clamp(rawLeft, viewportMargin, vpWidth - width - viewportMargin);
|
|
6601
|
+
return {
|
|
6602
|
+
top,
|
|
6603
|
+
left,
|
|
6604
|
+
width,
|
|
6605
|
+
placement
|
|
6606
|
+
};
|
|
6607
|
+
};
|
|
6608
|
+
var computeEmojiPopoverPosition = ({ anchor, isOwn, vpWidth, vpHeight }) => {
|
|
6609
|
+
const width = Math.min(desktopPopoverMaxWidth, vpWidth - viewportMargin * 2);
|
|
6610
|
+
const height = Math.min(desktopPopoverMaxHeight, vpHeight - viewportMargin * 2);
|
|
6611
|
+
const fitsAbove = anchor.top - anchorGap - viewportMargin >= height;
|
|
6612
|
+
const fitsBelow = vpHeight - anchor.bottom - anchorGap - viewportMargin >= height;
|
|
6613
|
+
if (fitsAbove) {
|
|
6614
|
+
const left2 = clamp(isOwn ? anchor.right - width : anchor.left, viewportMargin, vpWidth - width - viewportMargin);
|
|
6615
|
+
return {
|
|
6616
|
+
top: anchor.top - height - anchorGap,
|
|
6617
|
+
left: left2,
|
|
6618
|
+
width,
|
|
6619
|
+
height,
|
|
6620
|
+
placement: "above"
|
|
6621
|
+
};
|
|
6622
|
+
}
|
|
6623
|
+
if (fitsBelow) {
|
|
6624
|
+
const left2 = clamp(isOwn ? anchor.right - width : anchor.left, viewportMargin, vpWidth - width - viewportMargin);
|
|
6625
|
+
return {
|
|
6626
|
+
top: anchor.bottom + anchorGap,
|
|
6627
|
+
left: left2,
|
|
6628
|
+
width,
|
|
6629
|
+
height,
|
|
6630
|
+
placement: "below"
|
|
6631
|
+
};
|
|
6632
|
+
}
|
|
6633
|
+
const sideLeft = isOwn ? anchor.left - width - anchorGap : anchor.right + anchorGap;
|
|
6634
|
+
const fitsSide = sideLeft >= viewportMargin && sideLeft + width <= vpWidth - viewportMargin;
|
|
6635
|
+
const left = fitsSide ? sideLeft : clamp(isOwn ? anchor.right - width : anchor.left, viewportMargin, vpWidth - width - viewportMargin);
|
|
6636
|
+
const top = clamp(anchor.top, viewportMargin, vpHeight - height - viewportMargin);
|
|
6637
|
+
return {
|
|
6638
|
+
top,
|
|
6639
|
+
left,
|
|
6640
|
+
width,
|
|
6641
|
+
height,
|
|
6642
|
+
placement: "side"
|
|
6643
|
+
};
|
|
6644
|
+
};
|
|
6645
|
+
var computeMobileContextLayout = ({ anchor, isOwn, hasReactions, actionCount, vpWidth, vpHeight }) => {
|
|
6646
|
+
const topSafe = 16;
|
|
6647
|
+
const bottomSafe = 16;
|
|
6648
|
+
const pillWidth = Math.min(mobilePillMaxWidth, vpWidth - viewportMargin * 2);
|
|
6649
|
+
const menuWidth = Math.min(mobileMenuMaxWidth, vpWidth - viewportMargin * 2);
|
|
6650
|
+
const menuHeight = Math.max(1, actionCount) * mobileActionRowHeight + 8;
|
|
6651
|
+
const pillLeft = clamp(isOwn ? anchor.right - pillWidth : anchor.left, viewportMargin, vpWidth - pillWidth - viewportMargin);
|
|
6652
|
+
const menuLeft = clamp(isOwn ? anchor.right - menuWidth : anchor.left, viewportMargin, vpWidth - menuWidth - viewportMargin);
|
|
6653
|
+
const idealPillTop = anchor.top - mobilePillHeight - mobileAnchorGap;
|
|
6654
|
+
const idealMenuTop = anchor.bottom + mobileAnchorGap;
|
|
6655
|
+
const fitsSplit = (!hasReactions || idealPillTop >= topSafe) && idealMenuTop + menuHeight <= vpHeight - bottomSafe;
|
|
6656
|
+
if (fitsSplit) {
|
|
6657
|
+
return {
|
|
6658
|
+
pillTop: idealPillTop,
|
|
6659
|
+
pillLeft,
|
|
6660
|
+
pillWidth,
|
|
6661
|
+
menuTop: idealMenuTop,
|
|
6662
|
+
menuLeft,
|
|
6663
|
+
menuWidth,
|
|
6664
|
+
pillPlacement: "above"
|
|
6665
|
+
};
|
|
6666
|
+
}
|
|
6667
|
+
const stackedHeight = menuHeight + (hasReactions ? mobilePillHeight + mobileAnchorGap : 0);
|
|
6668
|
+
const fitsAllAbove = anchor.top - mobileAnchorGap - stackedHeight >= topSafe;
|
|
6669
|
+
if (fitsAllAbove) {
|
|
6670
|
+
const menuTop2 = anchor.top - menuHeight - mobileAnchorGap;
|
|
6671
|
+
const pillTop2 = menuTop2 - mobilePillHeight - mobileAnchorGap;
|
|
6672
|
+
return {
|
|
6673
|
+
pillTop: pillTop2,
|
|
6674
|
+
pillLeft,
|
|
6675
|
+
pillWidth,
|
|
6676
|
+
menuTop: menuTop2,
|
|
6677
|
+
menuLeft,
|
|
6678
|
+
menuWidth,
|
|
6679
|
+
pillPlacement: "above"
|
|
6680
|
+
};
|
|
6681
|
+
}
|
|
6682
|
+
const fitsAllBelow = anchor.bottom + mobileAnchorGap + stackedHeight <= vpHeight - bottomSafe;
|
|
6683
|
+
if (fitsAllBelow) {
|
|
6684
|
+
const pillTop2 = anchor.bottom + mobileAnchorGap;
|
|
6685
|
+
const menuTop2 = hasReactions ? pillTop2 + mobilePillHeight + mobileAnchorGap : anchor.bottom + mobileAnchorGap;
|
|
6686
|
+
return {
|
|
6687
|
+
pillTop: pillTop2,
|
|
6688
|
+
pillLeft,
|
|
6689
|
+
pillWidth,
|
|
6690
|
+
menuTop: menuTop2,
|
|
6691
|
+
menuLeft,
|
|
6692
|
+
menuWidth,
|
|
6693
|
+
pillPlacement: "below"
|
|
6694
|
+
};
|
|
6695
|
+
}
|
|
6696
|
+
const centeredTop = clamp(Math.round((vpHeight - stackedHeight) / 2), topSafe, vpHeight - bottomSafe - stackedHeight);
|
|
6697
|
+
const pillTop = centeredTop;
|
|
6698
|
+
const menuTop = hasReactions ? pillTop + mobilePillHeight + mobileAnchorGap : centeredTop;
|
|
6699
|
+
return {
|
|
6700
|
+
pillTop,
|
|
6701
|
+
pillLeft,
|
|
6702
|
+
pillWidth,
|
|
6703
|
+
menuTop,
|
|
6704
|
+
menuLeft,
|
|
6705
|
+
menuWidth,
|
|
6706
|
+
pillPlacement: "above"
|
|
6707
|
+
};
|
|
6708
|
+
};
|
|
6709
|
+
var reactionPickerCss = (isDark) => `
|
|
6710
|
+
@keyframes emoji-tray-in{from{opacity:0;transform:scale(.92) translateY(4px)}to{opacity:1;transform:scale(1) translateY(0)}}
|
|
6711
|
+
@keyframes emoji-popover-in{from{opacity:0;transform:scale(.95) translateY(6px)}to{opacity:1;transform:scale(1) translateY(0)}}
|
|
6712
|
+
@keyframes emoji-sheet-up{from{transform:translateY(100%)}to{transform:translateY(0)}}
|
|
6713
|
+
@keyframes emoji-fade-in{from{opacity:0}to{opacity:1}}
|
|
6714
|
+
@keyframes emoji-item-pop{0%{opacity:0;transform:scale(.6) translateY(4px)}100%{opacity:1;transform:scale(1) translateY(0)}}
|
|
6715
|
+
.msg-emoji-btn{transition:transform .14s cubic-bezier(0.2,0.9,0.3,1.2),background .14s ease}
|
|
6716
|
+
@media (hover:hover) and (pointer:fine){
|
|
6717
|
+
.msg-emoji-btn:hover{transform:scale(1.24) translateY(-2px);background:${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.06)"}!important}
|
|
6718
|
+
.msg-emoji-expand-btn:hover{transform:scale(1.08);background:${isDark ? "rgba(255,255,255,0.16)" : "rgba(24,23,21,0.12)"}!important;color:${isDark ? "#f3f1ea" : "#181715"}!important}
|
|
6719
|
+
}
|
|
6720
|
+
.msg-emoji-btn:active{transform:scale(.88)!important}
|
|
6721
|
+
.msg-emoji-expand-btn{transition:transform .14s ease,background .14s ease,color .14s ease}
|
|
6722
|
+
.msg-emoji-expand-btn:active{transform:scale(.92)!important}
|
|
6723
|
+
.msg-mobile-action{transition:background .12s ease}
|
|
6724
|
+
.msg-mobile-action:active{background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(24,23,21,0.06)"}!important}
|
|
6725
|
+
`;
|
|
6726
|
+
var pickerSurface = (isDark) => isDark ? "#1c1b19" : "#ffffff";
|
|
6727
|
+
var pickerBorder = (isDark) => isDark ? "rgba(255,255,255,0.10)" : "rgba(24,23,21,0.09)";
|
|
6728
|
+
var pillShadow = (isDark) => isDark ? "0 10px 30px rgba(0,0,0,0.52),0 2px 8px rgba(0,0,0,0.3)" : "0 8px 28px rgba(24,23,21,0.14),0 2px 6px rgba(24,23,21,0.06)";
|
|
6729
|
+
var quickEmojiPillStyle = ({ isDark, top, left, isMobile, placement }) => `position:fixed;top:${top}px;left:${left}px;display:inline-flex;align-items:center;gap:${isMobile ? "3px" : "2px"};background:${pickerSurface(isDark)};border:1px solid ${pickerBorder(isDark)};border-radius:999px;padding:${isMobile ? "5px 8px" : "4px 6px"};box-shadow:${pillShadow(isDark)};z-index:10001;transform-origin:${placement === "above" ? "bottom center" : "top center"};animation:emoji-tray-in .18s cubic-bezier(0.16, 1, 0.3, 1);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent`;
|
|
6730
|
+
var quickEmojiItemStyle = (baseStyle, { isDark, isActive, isMobile, index }) => {
|
|
6731
|
+
const size = isMobile ? "40px" : "36px";
|
|
6732
|
+
const fontSize = isMobile ? "24px" : "21px";
|
|
6733
|
+
const activeBg = isDark ? "rgba(125,162,207,0.22)" : "rgba(57,88,127,0.13)";
|
|
6734
|
+
const activeRing = isDark ? "inset 0 0 0 1px rgba(125,162,207,0.34)" : "inset 0 0 0 1px rgba(57,88,127,0.24)";
|
|
6735
|
+
return `${baseStyle};width:${size};height:${size};font-size:${fontSize};padding:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;background:${isActive ? activeBg : "transparent"};box-shadow:${isActive ? activeRing : "none"};animation:emoji-item-pop .2s cubic-bezier(0.16, 1, 0.3, 1) ${index * 20}ms backwards`;
|
|
6736
|
+
};
|
|
6737
|
+
var quickEmojiDividerStyle = (isDark) => `width:1px;height:20px;margin:0 3px;flex-shrink:0;background:${isDark ? "rgba(255,255,255,0.11)" : "rgba(24,23,21,0.09)"}`;
|
|
6738
|
+
var quickEmojiExpandBtnStyle = (baseStyle, isDark, isMobile) => {
|
|
6739
|
+
const size = isMobile ? "36px" : "32px";
|
|
6740
|
+
const fontSize = isMobile ? "17px" : "15px";
|
|
6741
|
+
return `${baseStyle};width:${size};height:${size};font-size:${fontSize};padding:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(24,23,21,0.065)"};color:${isDark ? "#c7c2b8" : "#57534e"}`;
|
|
6742
|
+
};
|
|
6743
|
+
var emojiPickerState = {
|
|
6744
|
+
loaded: null
|
|
6745
|
+
};
|
|
6746
|
+
var ensureEmojiPickerLoaded = () => {
|
|
6747
|
+
if (!emojiPickerState.loaded) {
|
|
6748
|
+
emojiPickerState.loaded = import("emoji-picker-element").catch((err) => {
|
|
6749
|
+
emojiPickerState.loaded = null;
|
|
6750
|
+
console.error("Failed to load emoji picker", err);
|
|
6751
|
+
});
|
|
6752
|
+
}
|
|
6753
|
+
return emojiPickerState.loaded;
|
|
6754
|
+
};
|
|
6755
|
+
var emojiPickerCssVars = (isDark, isMobile, accentColor) => [
|
|
6756
|
+
`width:100%`,
|
|
6757
|
+
`height:${isMobile ? "min(56vh, 420px)" : "100%"}`,
|
|
6758
|
+
`--background:${pickerSurface(isDark)}`,
|
|
6759
|
+
`--border-color:${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.08)"}`,
|
|
6760
|
+
`--border-size:0px`,
|
|
6761
|
+
`--border-radius:0px`,
|
|
6762
|
+
`--button-hover-background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(24,23,21,0.065)"}`,
|
|
6763
|
+
`--button-active-background:${isDark ? "rgba(255,255,255,0.16)" : "rgba(24,23,21,0.12)"}`,
|
|
6764
|
+
`--indicator-color:${accentColor}`,
|
|
6765
|
+
`--indicator-height:2.5px`,
|
|
6766
|
+
`--input-border-color:${isDark ? "rgba(255,255,255,0.10)" : "rgba(24,23,21,0.10)"}`,
|
|
6767
|
+
`--input-border-radius:999px`,
|
|
6768
|
+
`--input-border-size:1px`,
|
|
6769
|
+
`--input-font-color:${isDark ? "#f3f1ea" : "#181715"}`,
|
|
6770
|
+
`--input-font-size:13.5px`,
|
|
6771
|
+
`--input-padding:7px 12px`,
|
|
6772
|
+
`--input-placeholder-color:${isDark ? "#8c877d" : "#78736a"}`,
|
|
6773
|
+
`--category-font-color:${isDark ? "#9c968c" : "#6b665d"}`,
|
|
6774
|
+
`--category-font-size:11.5px`,
|
|
6775
|
+
`--emoji-size:${isMobile ? "1.6rem" : "1.4rem"}`,
|
|
6776
|
+
`--emoji-padding:${isMobile ? "0.42rem" : "0.38rem"}`,
|
|
6777
|
+
`--category-emoji-size:${isMobile ? "1.2rem" : "1.12rem"}`,
|
|
6778
|
+
`--category-emoji-padding:0.42rem`,
|
|
6779
|
+
`--num-columns:${isMobile ? "7" : "8"}`,
|
|
6780
|
+
`--outline-color:${accentColor}`,
|
|
6781
|
+
`--skintone-border-radius:14px`
|
|
6782
|
+
].join(";");
|
|
6783
|
+
var searchIconDataUri = (isDark) => {
|
|
6784
|
+
const stroke = isDark ? "%238c877d" : "%2378736a";
|
|
6785
|
+
return `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='${stroke}' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E")`;
|
|
6786
|
+
};
|
|
6787
|
+
var emojiShadowPolishCss = (isDark, isMobile, accentColor) => {
|
|
6788
|
+
const searchBg = isDark ? "rgba(255,255,255,0.07)" : "rgba(24,23,21,0.05)";
|
|
6789
|
+
const searchFocusBg = isDark ? "rgba(255,255,255,0.10)" : "rgba(24,23,21,0.03)";
|
|
6790
|
+
const scrollThumb = isDark ? "rgba(255,255,255,0.18)" : "rgba(24,23,21,0.16)";
|
|
6791
|
+
const skinShadow = isDark ? "0 8px 24px rgba(0,0,0,0.5)" : "0 8px 24px rgba(24,23,21,0.14)";
|
|
6792
|
+
return `
|
|
6793
|
+
.picker{border:0}
|
|
6794
|
+
.pad-top{height:${isMobile ? "4px" : "10px"}}
|
|
6795
|
+
.search-row{padding:0 12px 8px 12px;gap:6px}
|
|
6796
|
+
input.search{background:${searchBg} ${searchIconDataUri(isDark)} no-repeat 12px center / 14px 14px;padding:7px 12px 7px 34px;border-radius:999px;transition:border-color .15s,background-color .15s}
|
|
6797
|
+
input.search:focus{outline:none;border-color:${accentColor};background-color:${searchFocusBg}}
|
|
6798
|
+
.nav{padding:0 8px}
|
|
6799
|
+
.nav-button{opacity:.56;border-radius:8px;transition:opacity .15s}
|
|
6800
|
+
.nav-button:hover{opacity:.88}
|
|
6801
|
+
.nav-button[aria-selected="true"]{opacity:1}
|
|
6802
|
+
.indicator-wrapper{margin:0 8px}
|
|
6803
|
+
.indicator{border-radius:999px}
|
|
6804
|
+
.tabpanel{padding:4px 8px 8px;scrollbar-width:thin;scrollbar-color:${scrollThumb} transparent}
|
|
6805
|
+
.category{font-weight:600;letter-spacing:.03em;text-transform:uppercase;opacity:.7;padding:8px 6px 4px}
|
|
6806
|
+
.emoji,button.emoji{border-radius:10px;transition:transform .12s cubic-bezier(0.2,0.8,0.2,1),background .12s ease}
|
|
6807
|
+
@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{transform:scale(1.14)}}
|
|
6808
|
+
.emoji:active,button.emoji:active{transform:scale(.9)}
|
|
6809
|
+
.skintone-button-wrapper button.emoji{border-radius:50%;background:${searchBg};width:34px;height:34px;font-size:18px}
|
|
6810
|
+
.skintone-list{border-radius:14px;box-shadow:${skinShadow};border:1px solid var(--border-color)}
|
|
6811
|
+
.favorites{padding:6px 8px;justify-content:space-around;scrollbar-width:thin}
|
|
6812
|
+
`;
|
|
6813
|
+
};
|
|
6814
|
+
var applyEmojiPickerShadowPolish = (picker, isDark, isMobile, accentColor, shouldAutoFocus) => {
|
|
6815
|
+
const root = picker.shadowRoot;
|
|
6816
|
+
if (!root) return false;
|
|
6817
|
+
const existing = root.querySelector("style[data-alice-emoji-polish]");
|
|
6818
|
+
const css2 = emojiShadowPolishCss(isDark, isMobile, accentColor);
|
|
6819
|
+
if (existing) {
|
|
6820
|
+
if (existing.textContent !== css2) existing.textContent = css2;
|
|
6821
|
+
} else {
|
|
6822
|
+
const styleEl = document.createElement("style");
|
|
6823
|
+
styleEl.setAttribute("data-alice-emoji-polish", "");
|
|
6824
|
+
styleEl.textContent = css2;
|
|
6825
|
+
root.appendChild(styleEl);
|
|
6826
|
+
}
|
|
6827
|
+
if (shouldAutoFocus && !isMobile) {
|
|
6828
|
+
const searchInput = root.querySelector("input.search");
|
|
6829
|
+
if (searchInput instanceof HTMLInputElement) {
|
|
6830
|
+
searchInput.focus({
|
|
6831
|
+
preventScroll: true
|
|
6832
|
+
});
|
|
6833
|
+
}
|
|
6834
|
+
}
|
|
6835
|
+
return true;
|
|
6836
|
+
};
|
|
6837
|
+
var desktopBackdropStyle = "position:fixed;inset:0;background:transparent;z-index:10002";
|
|
6838
|
+
var mobileSheetBackdropStyle = "position:fixed;inset:0;background:rgba(0,0,0,0.42);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);display:flex;align-items:flex-end;justify-content:center;z-index:10002;animation:emoji-fade-in .18s ease-out";
|
|
6839
|
+
var mobileSheetStyle = (isDark, dragOffset) => `width:100%;max-width:520px;background:${pickerSurface(isDark)};border-radius:22px 22px 0 0;border-top:1px solid ${pickerBorder(isDark)};box-shadow:0 -10px 36px rgba(0,0,0,${isDark ? "0.6" : "0.24"});overflow:hidden;display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom,0px);${dragOffset > 0 ? `transform:translateY(${dragOffset}px);transition:none` : "animation:emoji-sheet-up .24s cubic-bezier(0.16, 1, 0.3, 1);transition:transform .2s ease"}`;
|
|
6840
|
+
var sheetHandleWrapStyle = "display:flex;align-items:center;justify-content:center;padding:10px 0 6px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none";
|
|
6841
|
+
var sheetHandleBarStyle = (isDark) => `width:38px;height:4px;border-radius:999px;background:${isDark ? "rgba(255,255,255,0.22)" : "rgba(24,23,21,0.16)"}`;
|
|
6842
|
+
var desktopPopoverStyle = (isDark, pos) => `position:fixed;top:${pos.top}px;left:${pos.left}px;width:${pos.width}px;height:${pos.height}px;background:${pickerSurface(isDark)};border-radius:18px;border:1px solid ${pickerBorder(isDark)};box-shadow:${isDark ? "0 14px 44px rgba(0,0,0,0.62),0 2px 10px rgba(0,0,0,0.36)" : "0 12px 40px rgba(24,23,21,0.18),0 2px 8px rgba(24,23,21,0.07)"};overflow:hidden;display:flex;flex-direction:column;transform-origin:${pos.placement === "above" ? "bottom center" : pos.placement === "below" ? "top center" : "center"};animation:emoji-popover-in .16s cubic-bezier(0.16, 1, 0.3, 1)`;
|
|
6843
|
+
var renderQuickEmojiBar = ({ isDark, isMobile, top, left, placement, ownReactions, baseBtnStyle, onPick, onExpand }) => html7`
|
|
6844
|
+
<div
|
|
6845
|
+
class="msg-quick-emojis"
|
|
6846
|
+
data-testid="quick-emoji-bar"
|
|
6847
|
+
style="${quickEmojiPillStyle({
|
|
6848
|
+
isDark,
|
|
6849
|
+
top,
|
|
6850
|
+
left,
|
|
6851
|
+
isMobile,
|
|
6852
|
+
placement
|
|
6853
|
+
})}"
|
|
6854
|
+
@click="${(e) => e.stopPropagation()}"
|
|
6855
|
+
>
|
|
6856
|
+
${quickReactionEmojis.map((emoji, index) => {
|
|
6857
|
+
const isActive = ownReactions.has(emoji);
|
|
6858
|
+
return html7`
|
|
6859
|
+
<button
|
|
6860
|
+
type="button"
|
|
6861
|
+
class="msg-emoji-btn"
|
|
6862
|
+
aria-pressed="${isActive}"
|
|
6863
|
+
@click="${() => onPick(emoji)}"
|
|
6864
|
+
style="${quickEmojiItemStyle(baseBtnStyle, {
|
|
6865
|
+
isDark,
|
|
6866
|
+
isActive,
|
|
6867
|
+
isMobile,
|
|
6868
|
+
index
|
|
6869
|
+
})}"
|
|
6870
|
+
>
|
|
6871
|
+
${emoji}
|
|
6872
|
+
</button>
|
|
6873
|
+
`;
|
|
6874
|
+
})}
|
|
6875
|
+
<span aria-hidden="true" style="${quickEmojiDividerStyle(isDark)}"></span>
|
|
6876
|
+
<button
|
|
6877
|
+
type="button"
|
|
6878
|
+
class="msg-emoji-expand-btn"
|
|
6879
|
+
data-testid="emoji-expand-btn"
|
|
6880
|
+
@click="${onExpand}"
|
|
6881
|
+
style="${quickEmojiExpandBtnStyle(baseBtnStyle, isDark, isMobile)}"
|
|
6882
|
+
title="More reactions"
|
|
6883
|
+
aria-label="More reactions"
|
|
6884
|
+
>
|
|
6885
|
+
${faPlus}
|
|
6886
|
+
</button>
|
|
6887
|
+
</div>
|
|
6888
|
+
`;
|
|
6889
|
+
var renderEmojiPickerPanel = ({ isDark, isMobile, accentColor, anchor, isOwn, sheetDragOffset, onSheetTouchStart, onSheetTouchMove, onSheetTouchEnd, onPick, onClose }) => {
|
|
6890
|
+
ensureEmojiPickerLoaded();
|
|
6891
|
+
const handleKeydown = (e) => {
|
|
6892
|
+
if (e.key === "Escape") {
|
|
6893
|
+
e.preventDefault();
|
|
6894
|
+
e.stopPropagation();
|
|
6895
|
+
onClose();
|
|
6896
|
+
}
|
|
6897
|
+
};
|
|
6898
|
+
const pickerEl = html7`
|
|
6899
|
+
<emoji-picker
|
|
6900
|
+
class="${isDark ? "dark" : "light"}"
|
|
6901
|
+
style="${emojiPickerCssVars(isDark, isMobile, accentColor)}"
|
|
6902
|
+
@emoji-click="${(e) => {
|
|
6903
|
+
onPick(e.detail.unicode);
|
|
6904
|
+
onClose();
|
|
6905
|
+
}}"
|
|
6906
|
+
></emoji-picker>
|
|
6907
|
+
`;
|
|
6908
|
+
if (isMobile) {
|
|
6909
|
+
return html7`
|
|
6910
|
+
<div
|
|
6911
|
+
data-testid="emoji-picker-backdrop"
|
|
6912
|
+
style="${mobileSheetBackdropStyle}"
|
|
6913
|
+
@click="${onClose}"
|
|
6914
|
+
@keydown="${handleKeydown}"
|
|
6915
|
+
>
|
|
6916
|
+
<div
|
|
6917
|
+
data-testid="emoji-picker-panel"
|
|
6918
|
+
data-presentation="sheet"
|
|
6919
|
+
style="${mobileSheetStyle(isDark, sheetDragOffset)}"
|
|
6920
|
+
@click="${(e) => e.stopPropagation()}"
|
|
6921
|
+
>
|
|
6922
|
+
<div
|
|
6923
|
+
data-testid="emoji-sheet-handle"
|
|
6924
|
+
style="${sheetHandleWrapStyle}"
|
|
6925
|
+
@touchstart="${onSheetTouchStart}"
|
|
6926
|
+
@touchmove="${onSheetTouchMove}"
|
|
6927
|
+
@touchend="${onSheetTouchEnd}"
|
|
6928
|
+
@touchcancel="${onSheetTouchEnd}"
|
|
6929
|
+
>
|
|
6930
|
+
<div style="${sheetHandleBarStyle(isDark)}"></div>
|
|
6931
|
+
</div>
|
|
6932
|
+
${pickerEl}
|
|
6933
|
+
</div>
|
|
6934
|
+
</div>
|
|
6935
|
+
`;
|
|
6936
|
+
}
|
|
6937
|
+
const pos = computeEmojiPopoverPosition({
|
|
6938
|
+
anchor,
|
|
6939
|
+
isOwn,
|
|
6940
|
+
vpWidth: globalThis.innerWidth || 1024,
|
|
6941
|
+
vpHeight: globalThis.innerHeight || 768
|
|
6942
|
+
});
|
|
6943
|
+
return html7`
|
|
6944
|
+
<div
|
|
6945
|
+
data-testid="emoji-picker-backdrop"
|
|
6946
|
+
style="${desktopBackdropStyle}"
|
|
6947
|
+
@click="${onClose}"
|
|
6948
|
+
@keydown="${handleKeydown}"
|
|
6949
|
+
>
|
|
6950
|
+
<div
|
|
6951
|
+
data-testid="emoji-picker-panel"
|
|
6952
|
+
data-presentation="popover"
|
|
6953
|
+
style="${desktopPopoverStyle(isDark, pos)}"
|
|
6954
|
+
@click="${(e) => e.stopPropagation()}"
|
|
6955
|
+
>
|
|
6956
|
+
${pickerEl}
|
|
6957
|
+
</div>
|
|
6958
|
+
</div>
|
|
6959
|
+
`;
|
|
6960
|
+
};
|
|
6961
|
+
|
|
6544
6962
|
// lit/components/chat-message.ts
|
|
6545
6963
|
var clearSelection = () => globalThis.getSelection?.()?.removeAllRanges();
|
|
6546
6964
|
var kebabHoverCss = `.msg-bubble .msg-kebab{opacity:0;transition:opacity .15s}.msg-bubble:hover .msg-kebab,.msg-kebab[data-open]{opacity:.7}`;
|
|
@@ -6555,44 +6973,41 @@ var historyCloseButtonStyle = (isDark) => `margin-top:8px;padding:6px 12px;backg
|
|
|
6555
6973
|
var editTextareaStyle = "width:100%;padding:6px;border-radius:8px;border:none;font-size:14px;resize:vertical;min-height:40px";
|
|
6556
6974
|
var saveButtonStyle = (isDark) => `padding:4px 8px;border-radius:6px;border:none;background:${isDark ? "#2a2a2a" : "#e5e7eb"};cursor:pointer;font-size:12px`;
|
|
6557
6975
|
var cancelButtonStyle = "padding:4px 8px;border-radius:6px;border:none;background:transparent;cursor:pointer;font-size:12px;opacity:0.7";
|
|
6558
|
-
var quickEmojis = quickReactionEmojis;
|
|
6559
6976
|
var keyboardSelectedRowStyle = (isDark) => `;border-radius:14px;padding:4px 6px;margin:-4px -6px;background:${isDark ? "rgba(125,162,207,0.12)" : "rgba(57,88,127,0.08)"};outline:1.5px solid ${isDark ? "rgba(125,162,207,0.45)" : "rgba(57,88,127,0.38)"};outline-offset:1px;transition:background 0.15s,outline-color 0.15s`;
|
|
6560
6977
|
var keyboardHintBarStyle = (isDark) => `display:inline-flex;align-items:center;gap:6px;margin-top:4px;padding:2px 8px;border-radius:999px;font-size:11px;background:${isDark ? "#1e1d1a" : "#f3f1ea"};border:1px solid ${isDark ? "#2e2d28" : "#dcd8cc"};color:${isDark ? "#b8b2a6" : "#5a564f"};user-select:none`;
|
|
6561
6978
|
var keyboardHintKeyStyle = (isDark) => `font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;padding:0 4px;border-radius:4px;background:${isDark ? "#2c2b26" : "#e5e1d6"};color:${isDark ? "#f3f1ea" : "#181715"}`;
|
|
6562
|
-
var longPressHighlightCss = `@keyframes msg-highlight{0%{box-shadow:0 0 0 0 rgba(
|
|
6563
|
-
var longPressHighlightDelayMs =
|
|
6564
|
-
var longPressTriggerDelayMs =
|
|
6979
|
+
var longPressHighlightCss = `@keyframes msg-highlight-light{0%{box-shadow:0 1px 3px rgba(24,23,21,0.08);filter:brightness(1)}100%{box-shadow:0 0 0 1px rgba(24,23,21,0.10),0 10px 26px rgba(24,23,21,0.18),0 2px 8px rgba(24,23,21,0.10);filter:brightness(0.96)}}@keyframes msg-highlight-dark{0%{box-shadow:0 1px 2px rgba(0,0,0,0.28);filter:brightness(1)}100%{box-shadow:0 0 0 1px rgba(255,255,255,0.18),0 10px 28px rgba(0,0,0,0.55),0 2px 8px rgba(0,0,0,0.32);filter:brightness(1.10)}}`;
|
|
6980
|
+
var longPressHighlightDelayMs = 120;
|
|
6981
|
+
var longPressTriggerDelayMs = 420;
|
|
6565
6982
|
var longPressMoveSlopPx = 8;
|
|
6983
|
+
var sheetDismissThresholdPx = 72;
|
|
6566
6984
|
var msgEntranceCss = `@keyframes msg-enter{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}`;
|
|
6567
6985
|
var liveCursorCss = `@keyframes msg-live-cursor{0%,100%{opacity:.35;transform:scaleY(.9)}50%{opacity:1;transform:scaleY(1)}}`;
|
|
6568
6986
|
var streamTickMs = 20;
|
|
6569
6987
|
var liveCursorHtml = (isDark) => `<span aria-hidden="true" style="display:inline-block;width:2px;height:1.05em;margin-inline-start:2px;border-radius:999px;vertical-align:-0.12em;background:${isDark ? "#ffffffcc" : "#111111aa"};animation:msg-live-cursor .9s ease-in-out infinite"></span>`;
|
|
6570
|
-
var injectCursorAtEnd = (
|
|
6571
|
-
const i =
|
|
6572
|
-
return i === -1 ?
|
|
6573
|
-
};
|
|
6574
|
-
var mobileContextOverlayStyle = "position:fixed;
|
|
6575
|
-
var mobileContextMenuStyle = (isDark,
|
|
6576
|
-
const
|
|
6577
|
-
const
|
|
6578
|
-
const
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
}
|
|
6584
|
-
var
|
|
6585
|
-
var
|
|
6586
|
-
var smileyTriggerCss = `.msg-wrap .msg-smiley-trigger{opacity:0;transition:opacity .15s}.msg-wrap:hover .msg-smiley-trigger{opacity:1}`;
|
|
6587
|
-
var smileyTriggerStyle = (isDark, isOwn) => `position:absolute;${isOwn ? "left:-36px" : "right:-36px"};top:calc(50% - 18px);transform:translateY(-50%);background:${isDark ? "#1a1a1a" : "#fff"};border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;box-shadow:${isDark ? "0 1px 4px #0006" : "0 1px 4px #0002"};color:${isDark ? "#aaa" : "#666"};font-size:17px;padding:0`;
|
|
6588
|
-
var quickEmojiRowStyle = (isDark, isOwn) => `position:absolute;top:50%;transform:translateY(calc(-100% - 24px));${isOwn ? "left:-36px" : "right:-36px"};display:flex;gap:2px;background:${isDark ? "#1e1e1e" : "#ffffff"};border:1px solid ${isDark ? "#2a2a2a" : "#e5e7eb"};border-radius:20px;padding:4px 6px;box-shadow:${isDark ? "0 2px 12px #0008" : "0 2px 12px #0003"};z-index:10000;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent`;
|
|
6988
|
+
var injectCursorAtEnd = (html14, cursor) => {
|
|
6989
|
+
const i = html14.lastIndexOf("</div>");
|
|
6990
|
+
return i === -1 ? html14 + cursor : html14.slice(0, i) + cursor + html14.slice(i);
|
|
6991
|
+
};
|
|
6992
|
+
var mobileContextOverlayStyle = "position:fixed;inset:0;background:rgba(0,0,0,0.38);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);z-index:999;animation:emoji-fade-in .16s ease-out;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent";
|
|
6993
|
+
var mobileContextMenuStyle = (isDark, top, left, width = 236) => {
|
|
6994
|
+
const bg = isDark ? "#1c1b19" : "#ffffff";
|
|
6995
|
+
const border = isDark ? "rgba(255,255,255,0.10)" : "rgba(24,23,21,0.09)";
|
|
6996
|
+
const shadow = isDark ? "0 14px 40px rgba(0,0,0,0.58),0 2px 10px rgba(0,0,0,0.32)" : "0 12px 36px rgba(24,23,21,0.18),0 2px 8px rgba(24,23,21,0.07)";
|
|
6997
|
+
return `position:fixed;top:${top}px;left:${left}px;width:${width}px;background:${bg};border:1px solid ${border};border-radius:16px;padding:4px 0;box-shadow:${shadow};overflow:hidden;z-index:10001;animation:emoji-popover-in .18s cubic-bezier(0.16, 1, 0.3, 1);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent`;
|
|
6998
|
+
};
|
|
6999
|
+
var mobileContextActionStyle = (isDark, withDivider) => `display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:46px;padding:0 16px;background:transparent;border:none;${withDivider ? `border-bottom:1px solid ${isDark ? "rgba(255,255,255,0.07)" : "rgba(24,23,21,0.06)"};` : ""}cursor:pointer;font-size:15px;font-weight:450;color:${isDark ? "#f3f1ea" : "#181715"};user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;outline:none`;
|
|
7000
|
+
var mobileActionIconStyle = (isDark) => `display:inline-flex;align-items:center;justify-content:center;font-size:15px;color:${isDark ? "#a8a29e" : "#6b665d"}`;
|
|
7001
|
+
var smileyTriggerCss = `.msg-wrap .msg-smiley-trigger{opacity:0;transition:opacity .15s}.msg-wrap:hover .msg-smiley-trigger,.msg-smiley-trigger[data-open]{opacity:1}`;
|
|
7002
|
+
var smileyTriggerStyle = (isDark, isOwn) => `position:absolute;${isOwn ? "left:-36px" : "right:-36px"};top:calc(50% - 18px);transform:translateY(-50%);background:${isDark ? "#1c1b19" : "#fff"};border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid ${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.07)"};box-shadow:${isDark ? "0 2px 6px rgba(0,0,0,0.4)" : "0 1px 4px rgba(24,23,21,0.08)"};color:${isDark ? "#a8a29e" : "#6b665d"};font-size:17px;padding:0`;
|
|
7003
|
+
var spotlightBubbleStyle = (isDark) => `;position:relative;z-index:1000;box-shadow:${isDark ? "0 0 0 1px rgba(255,255,255,0.14),0 14px 36px rgba(0,0,0,0.62)" : "0 0 0 1px rgba(24,23,21,0.08),0 12px 32px rgba(24,23,21,0.22)"}`;
|
|
6589
7004
|
var reactionBtnStyle = "background:transparent;border:none;cursor:pointer;font-size:16px;padding:2px 3px;line-height:1;border-radius:4px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;outline:none";
|
|
6590
7005
|
var reactionPillStyle = (isDark, isActive) => `display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:999px;font-size:12px;cursor:pointer;border:1px solid ${isActive ? isDark ? "#4a4740" : "#c7c2b6" : isDark ? "#292824" : "#e7e4dc"};background:${isActive ? isDark ? "#262521" : "#ebe8df" : isDark ? "#171614" : "#faf9f5"};color:${isDark ? "#f3f1ea" : "#181715"};user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;outline:none`;
|
|
6591
7006
|
var diffPartStyle = (kind, isDark) => kind === "add" ? `background:${isDark ? "#16532e" : "#d4edda"};color:${isDark ? "#6ee7b7" : "#155724"}` : kind === "del" ? `background:${isDark ? "#5c1d1d" : "#f8d7da"};color:${isDark ? "#fca5a5" : "#721c24"};text-decoration:line-through` : "";
|
|
6592
|
-
var renderDiff = (parts, isDark) => parts.map((p) =>
|
|
7007
|
+
var renderDiff = (parts, isDark) => parts.map((p) => html8`
|
|
6593
7008
|
<span style="${diffPartStyle(p.kind, isDark)}">${p.text}</span>
|
|
6594
7009
|
`);
|
|
6595
|
-
var renderEditHistory = (edits, currentText, isDark, onClose) =>
|
|
7010
|
+
var renderEditHistory = (edits, currentText, isDark, onClose) => html8`
|
|
6596
7011
|
<div style="${overlayStyle}" @click="${onClose}">
|
|
6597
7012
|
<div style="${historyPopupStyle(isDark)}" @click="${(e) => e.stopPropagation()}">
|
|
6598
7013
|
<div style="font-weight:bold;margin-bottom:12px">Edit History</div>
|
|
@@ -6600,7 +7015,7 @@ var renderEditHistory = (edits, currentText, isDark, onClose) => html7`
|
|
|
6600
7015
|
<div style="font-size:10px;opacity:0.7">Current</div>
|
|
6601
7016
|
<div>${currentText}</div>
|
|
6602
7017
|
</div>
|
|
6603
|
-
${edits.map((edit, i) =>
|
|
7018
|
+
${edits.map((edit, i) => html8`
|
|
6604
7019
|
<div style="${historyEntryStyle(isDark)}">
|
|
6605
7020
|
<div style="font-size:10px;opacity:0.7">${formatEditTime(edit.timestamp)}</div>
|
|
6606
7021
|
<div>${renderDiff(wordDiff(edit.text, successorText(edits, currentText, i)), isDark)}</div>
|
|
@@ -6615,7 +7030,7 @@ var renderEditHistory = (edits, currentText, isDark, onClose) => html7`
|
|
|
6615
7030
|
var replyTriggerStyle = (isDark, isOwn) => `position:absolute;${isOwn ? "left:-36px" : "right:-36px"};top:calc(50% + 20px);transform:translateY(-50%);background:${isDark ? "#1a1a1a" : "#fff"};border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;box-shadow:${isDark ? "0 1px 4px #0006" : "0 1px 4px #0002"};color:${isDark ? "#aaa" : "#666"};font-size:13px;padding:0`;
|
|
6616
7031
|
var renderQuotedMessage = (reply, isDark, customColors, bubbleTextColor) => {
|
|
6617
7032
|
const barColor2 = quoteBarColor(isDark, customColors);
|
|
6618
|
-
return
|
|
7033
|
+
return html8`
|
|
6619
7034
|
<div
|
|
6620
7035
|
style="margin-bottom:4px;padding:6px 8px;border-radius:6px;border-left:3px solid ${barColor2};background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.05)"};cursor:pointer;user-select:none;-webkit-user-select:none"
|
|
6621
7036
|
>
|
|
@@ -6649,9 +7064,9 @@ var groupReactions = (userId) => (reactions) => {
|
|
|
6649
7064
|
hasOwn
|
|
6650
7065
|
}));
|
|
6651
7066
|
};
|
|
6652
|
-
var renderReactionPills = (groups, isDark, onToggle) =>
|
|
7067
|
+
var renderReactionPills = (groups, isDark, onToggle) => html8`
|
|
6653
7068
|
<div style="display:flex;flex-wrap:wrap;gap:4px;margin-top:4px">
|
|
6654
|
-
${groups.map(({ emoji, count: count2, hasOwn }) =>
|
|
7069
|
+
${groups.map(({ emoji, count: count2, hasOwn }) => html8`
|
|
6655
7070
|
<button
|
|
6656
7071
|
type="button"
|
|
6657
7072
|
@click="${() => onToggle(emoji)}"
|
|
@@ -6664,37 +7079,25 @@ var renderReactionPills = (groups, isDark, onToggle) => html7`
|
|
|
6664
7079
|
`)}
|
|
6665
7080
|
</div>
|
|
6666
7081
|
`;
|
|
6667
|
-
var
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
}
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
@click="${(e) => e.stopPropagation()}"
|
|
6685
|
-
>
|
|
6686
|
-
<emoji-picker
|
|
6687
|
-
class="${isDark ? "dark" : "light"}"
|
|
6688
|
-
style="width:100%;height:350px;max-height:60vh;max-width:350px;--background:transparent"
|
|
6689
|
-
@emoji-click="${(e) => {
|
|
6690
|
-
onPick(e.detail.unicode);
|
|
6691
|
-
onClose();
|
|
6692
|
-
}}"
|
|
6693
|
-
></emoji-picker>
|
|
6694
|
-
</div>
|
|
7082
|
+
var renderMobileContextCard = ({ isDark, top, left, width, actions }) => html8`
|
|
7083
|
+
<div
|
|
7084
|
+
data-testid="mobile-context-menu"
|
|
7085
|
+
style="${mobileContextMenuStyle(isDark, top, left, width)}"
|
|
7086
|
+
@click="${(e) => e.stopPropagation()}"
|
|
7087
|
+
>
|
|
7088
|
+
${actions.map((item, idx) => html8`
|
|
7089
|
+
<button
|
|
7090
|
+
type="button"
|
|
7091
|
+
class="msg-mobile-action"
|
|
7092
|
+
@click="${item.onClick}"
|
|
7093
|
+
style="${mobileContextActionStyle(isDark, idx < actions.length - 1)}"
|
|
7094
|
+
>
|
|
7095
|
+
<span>${item.label}</span>
|
|
7096
|
+
<span style="${mobileActionIconStyle(isDark)}">${item.icon}</span>
|
|
7097
|
+
</button>
|
|
7098
|
+
`)}
|
|
6695
7099
|
</div>
|
|
6696
7100
|
`;
|
|
6697
|
-
};
|
|
6698
7101
|
var resolveTargetMedia = (target, msg, host) => {
|
|
6699
7102
|
const el = target instanceof HTMLElement ? target : null;
|
|
6700
7103
|
const imgEl = el?.closest("img");
|
|
@@ -6814,6 +7217,12 @@ var ChatMessage = class extends LitElement6 {
|
|
|
6814
7217
|
},
|
|
6815
7218
|
_touchX: {
|
|
6816
7219
|
state: true
|
|
7220
|
+
},
|
|
7221
|
+
_anchorRect: {
|
|
7222
|
+
state: true
|
|
7223
|
+
},
|
|
7224
|
+
_sheetDragY: {
|
|
7225
|
+
state: true
|
|
6817
7226
|
}
|
|
6818
7227
|
};
|
|
6819
7228
|
_streamTimer = 0;
|
|
@@ -6823,6 +7232,8 @@ var ChatMessage = class extends LitElement6 {
|
|
|
6823
7232
|
_outsideClickHandler = null;
|
|
6824
7233
|
_longPressTimer = 0;
|
|
6825
7234
|
_longPressHighlightTimer = 0;
|
|
7235
|
+
_sheetDragStartY = 0;
|
|
7236
|
+
_emojiPickerFocused = false;
|
|
6826
7237
|
constructor() {
|
|
6827
7238
|
super();
|
|
6828
7239
|
this.isOwn = false;
|
|
@@ -6846,6 +7257,15 @@ var ChatMessage = class extends LitElement6 {
|
|
|
6846
7257
|
this._selectedMedia = null;
|
|
6847
7258
|
this._touchY = 0;
|
|
6848
7259
|
this._touchX = 0;
|
|
7260
|
+
this._anchorRect = {
|
|
7261
|
+
top: 0,
|
|
7262
|
+
bottom: 0,
|
|
7263
|
+
left: 0,
|
|
7264
|
+
right: 0,
|
|
7265
|
+
width: 0,
|
|
7266
|
+
height: 0
|
|
7267
|
+
};
|
|
7268
|
+
this._sheetDragY = 0;
|
|
6849
7269
|
this._visibleText = "";
|
|
6850
7270
|
}
|
|
6851
7271
|
createRenderRoot() {
|
|
@@ -6869,7 +7289,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
6869
7289
|
clearTimeout(this._streamTimer);
|
|
6870
7290
|
clearTimeout(this._longPressTimer);
|
|
6871
7291
|
clearTimeout(this._longPressHighlightTimer);
|
|
6872
|
-
|
|
7292
|
+
this._removeQuickEmojiListeners();
|
|
6873
7293
|
this._removeOutsideClick();
|
|
6874
7294
|
this.removeEventListener("click", this._handleCopyCode);
|
|
6875
7295
|
this.removeEventListener("click", this._handleQuickReplyClick);
|
|
@@ -6967,10 +7387,73 @@ var ChatMessage = class extends LitElement6 {
|
|
|
6967
7387
|
this._startEdit();
|
|
6968
7388
|
return true;
|
|
6969
7389
|
};
|
|
6970
|
-
|
|
6971
|
-
|
|
7390
|
+
_readAnchorRect = () => {
|
|
7391
|
+
const bubble = this.querySelector(".msg-bubble");
|
|
7392
|
+
if (bubble) {
|
|
7393
|
+
const r = bubble.getBoundingClientRect();
|
|
7394
|
+
if (r.width > 0 || r.height > 0) {
|
|
7395
|
+
return {
|
|
7396
|
+
top: r.top,
|
|
7397
|
+
bottom: r.bottom,
|
|
7398
|
+
left: r.left,
|
|
7399
|
+
right: r.right,
|
|
7400
|
+
width: r.width,
|
|
7401
|
+
height: r.height
|
|
7402
|
+
};
|
|
7403
|
+
}
|
|
7404
|
+
}
|
|
7405
|
+
return {
|
|
7406
|
+
top: this._touchY,
|
|
7407
|
+
bottom: this._touchY,
|
|
7408
|
+
left: this._touchX,
|
|
7409
|
+
right: this._touchX,
|
|
7410
|
+
width: 0,
|
|
7411
|
+
height: 0
|
|
7412
|
+
};
|
|
7413
|
+
};
|
|
7414
|
+
_removeQuickEmojiListeners = () => {
|
|
7415
|
+
document.removeEventListener("mousedown", this._dismissQuickEmojis);
|
|
7416
|
+
globalThis.removeEventListener("scroll", this._dismissQuickEmojisOnScroll, true);
|
|
7417
|
+
globalThis.removeEventListener("resize", this._dismissQuickEmojisOnScroll);
|
|
7418
|
+
};
|
|
7419
|
+
_addQuickEmojiListeners = () => {
|
|
7420
|
+
requestAnimationFrame(() => {
|
|
7421
|
+
if (!this._showQuickEmojis) return;
|
|
7422
|
+
document.addEventListener("mousedown", this._dismissQuickEmojis);
|
|
7423
|
+
globalThis.addEventListener("scroll", this._dismissQuickEmojisOnScroll, true);
|
|
7424
|
+
globalThis.addEventListener("resize", this._dismissQuickEmojisOnScroll);
|
|
7425
|
+
});
|
|
7426
|
+
};
|
|
7427
|
+
_openFullEmojiPicker = () => {
|
|
7428
|
+
this._anchorRect = this._readAnchorRect();
|
|
6972
7429
|
this._showQuickEmojis = false;
|
|
7430
|
+
this._removeQuickEmojiListeners();
|
|
7431
|
+
this._showMobileContext = false;
|
|
7432
|
+
this._selectedMedia = null;
|
|
7433
|
+
this._sheetDragY = 0;
|
|
7434
|
+
this._emojiPickerFocused = false;
|
|
6973
7435
|
this._showEmojiPicker = true;
|
|
7436
|
+
ensureEmojiPickerLoaded();
|
|
7437
|
+
};
|
|
7438
|
+
_closeFullEmojiPicker = () => {
|
|
7439
|
+
this._showEmojiPicker = false;
|
|
7440
|
+
this._sheetDragY = 0;
|
|
7441
|
+
this._emojiPickerFocused = false;
|
|
7442
|
+
};
|
|
7443
|
+
_toggleQuickEmojis = () => {
|
|
7444
|
+
if (this._showQuickEmojis) {
|
|
7445
|
+
this._showQuickEmojis = false;
|
|
7446
|
+
this._removeQuickEmojiListeners();
|
|
7447
|
+
return;
|
|
7448
|
+
}
|
|
7449
|
+
this._anchorRect = this._readAnchorRect();
|
|
7450
|
+
this._showQuickEmojis = true;
|
|
7451
|
+
ensureEmojiPickerLoaded();
|
|
7452
|
+
this._addQuickEmojiListeners();
|
|
7453
|
+
};
|
|
7454
|
+
openReactionPicker = () => {
|
|
7455
|
+
if (!this.onReact) return false;
|
|
7456
|
+
this._openFullEmojiPicker();
|
|
6974
7457
|
return true;
|
|
6975
7458
|
};
|
|
6976
7459
|
toggleReaction = (emoji) => {
|
|
@@ -6978,12 +7461,12 @@ var ChatMessage = class extends LitElement6 {
|
|
|
6978
7461
|
};
|
|
6979
7462
|
dismissActivePopup = () => {
|
|
6980
7463
|
if (this._showEmojiPicker) {
|
|
6981
|
-
this.
|
|
7464
|
+
this._closeFullEmojiPicker();
|
|
6982
7465
|
return true;
|
|
6983
7466
|
}
|
|
6984
7467
|
if (this._showQuickEmojis) {
|
|
6985
7468
|
this._showQuickEmojis = false;
|
|
6986
|
-
|
|
7469
|
+
this._removeQuickEmojiListeners();
|
|
6987
7470
|
return true;
|
|
6988
7471
|
}
|
|
6989
7472
|
if (this._showHistory) {
|
|
@@ -7062,6 +7545,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7062
7545
|
const hasOwn = (this.msg.reactions ?? []).some((r) => r.emoji === emoji && r.authorId === this.userId);
|
|
7063
7546
|
this.onReact(emoji, hasOwn || void 0);
|
|
7064
7547
|
this._showQuickEmojis = false;
|
|
7548
|
+
this._removeQuickEmojiListeners();
|
|
7065
7549
|
};
|
|
7066
7550
|
_longPressStart = (e) => {
|
|
7067
7551
|
if (!this.isMobile) return;
|
|
@@ -7079,8 +7563,11 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7079
7563
|
}, longPressHighlightDelayMs);
|
|
7080
7564
|
this._longPressTimer = globalThis.setTimeout(() => {
|
|
7081
7565
|
this._longPressActive = false;
|
|
7566
|
+
this._anchorRect = this._readAnchorRect();
|
|
7082
7567
|
this._showMobileContext = true;
|
|
7083
7568
|
clearSelection();
|
|
7569
|
+
globalThis.navigator?.vibrate?.(12);
|
|
7570
|
+
if (this.onReact) ensureEmojiPickerLoaded();
|
|
7084
7571
|
}, longPressTriggerDelayMs);
|
|
7085
7572
|
};
|
|
7086
7573
|
_longPressMove = (e) => {
|
|
@@ -7105,10 +7592,31 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7105
7592
|
};
|
|
7106
7593
|
_dismissQuickEmojis = (e) => {
|
|
7107
7594
|
const target = e.target;
|
|
7108
|
-
if (
|
|
7109
|
-
|
|
7110
|
-
|
|
7595
|
+
if (target instanceof Element && (target.closest(".msg-quick-emojis") || target.closest(".msg-smiley-trigger"))) {
|
|
7596
|
+
return;
|
|
7597
|
+
}
|
|
7598
|
+
this._showQuickEmojis = false;
|
|
7599
|
+
this._removeQuickEmojiListeners();
|
|
7600
|
+
};
|
|
7601
|
+
_dismissQuickEmojisOnScroll = () => {
|
|
7602
|
+
if (!this._showQuickEmojis) return;
|
|
7603
|
+
this._showQuickEmojis = false;
|
|
7604
|
+
this._removeQuickEmojiListeners();
|
|
7605
|
+
};
|
|
7606
|
+
_sheetTouchStart = (e) => {
|
|
7607
|
+
this._sheetDragStartY = e.touches[0]?.clientY ?? 0;
|
|
7608
|
+
this._sheetDragY = 0;
|
|
7609
|
+
};
|
|
7610
|
+
_sheetTouchMove = (e) => {
|
|
7611
|
+
const y = e.touches[0]?.clientY ?? this._sheetDragStartY;
|
|
7612
|
+
this._sheetDragY = Math.max(0, y - this._sheetDragStartY);
|
|
7613
|
+
};
|
|
7614
|
+
_sheetTouchEnd = () => {
|
|
7615
|
+
if (this._sheetDragY >= sheetDismissThresholdPx) {
|
|
7616
|
+
this._closeFullEmojiPicker();
|
|
7617
|
+
return;
|
|
7111
7618
|
}
|
|
7619
|
+
this._sheetDragY = 0;
|
|
7112
7620
|
};
|
|
7113
7621
|
_closeMobileContext = () => {
|
|
7114
7622
|
this._showMobileContext = false;
|
|
@@ -7136,7 +7644,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7136
7644
|
};
|
|
7137
7645
|
_copyText = () => {
|
|
7138
7646
|
copyToClipboard(this.msg.text);
|
|
7139
|
-
this.
|
|
7647
|
+
this._closeMobileContext();
|
|
7140
7648
|
};
|
|
7141
7649
|
render() {
|
|
7142
7650
|
const { authorId, authorName, authorAvatar, text, timestamp, attachments, editHistory, callDetails } = this.msg;
|
|
@@ -7169,11 +7677,76 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7169
7677
|
const primaryColor = attachmentPrimaryColor(isDark, customColors);
|
|
7170
7678
|
const markdownHtml = renderMarkdown(displayedText, textColor, isDark, primaryColor, !this.hideQuickReplies);
|
|
7171
7679
|
const canSave = !!this._editText.trim() && this._editText !== text;
|
|
7680
|
+
const ownReactions = new Set((this.msg.reactions ?? []).filter((r) => r.authorId === this.userId).map((r) => r.emoji));
|
|
7681
|
+
const quickBarPos = this._showQuickEmojis && this.onReact ? computeQuickBarPosition({
|
|
7682
|
+
anchor: this._anchorRect,
|
|
7683
|
+
isOwn,
|
|
7684
|
+
vpWidth: globalThis.innerWidth || 1024,
|
|
7685
|
+
vpHeight: globalThis.innerHeight || 768
|
|
7686
|
+
}) : null;
|
|
7687
|
+
const mobileActions = this._showMobileContext ? [
|
|
7688
|
+
...this.onReply ? [
|
|
7689
|
+
{
|
|
7690
|
+
icon: faReply,
|
|
7691
|
+
label: "Reply",
|
|
7692
|
+
onClick: () => {
|
|
7693
|
+
this.onReply?.();
|
|
7694
|
+
this._closeMobileContext();
|
|
7695
|
+
}
|
|
7696
|
+
}
|
|
7697
|
+
] : [],
|
|
7698
|
+
...this._selectedMedia ? [
|
|
7699
|
+
{
|
|
7700
|
+
icon: this._selectedMedia.type === "video" ? faShare : faImage,
|
|
7701
|
+
label: `Share ${this._selectedMedia.type === "video" ? "Video" : "Image"}`,
|
|
7702
|
+
onClick: this._shareSelectedMedia
|
|
7703
|
+
},
|
|
7704
|
+
{
|
|
7705
|
+
icon: faDownload,
|
|
7706
|
+
label: `Download ${this._selectedMedia.type === "video" ? "Video" : "Image"}`,
|
|
7707
|
+
onClick: this._downloadSelectedMedia
|
|
7708
|
+
}
|
|
7709
|
+
] : [],
|
|
7710
|
+
{
|
|
7711
|
+
icon: faCopy,
|
|
7712
|
+
label: "Copy",
|
|
7713
|
+
onClick: this._copyText
|
|
7714
|
+
},
|
|
7715
|
+
...canEdit ? [
|
|
7716
|
+
{
|
|
7717
|
+
icon: faPen,
|
|
7718
|
+
label: "Edit",
|
|
7719
|
+
onClick: () => {
|
|
7720
|
+
this._closeMobileContext();
|
|
7721
|
+
this._startEdit();
|
|
7722
|
+
}
|
|
7723
|
+
}
|
|
7724
|
+
] : [],
|
|
7725
|
+
...hasEdits ? [
|
|
7726
|
+
{
|
|
7727
|
+
icon: faHistory,
|
|
7728
|
+
label: "View history",
|
|
7729
|
+
onClick: () => {
|
|
7730
|
+
this._closeMobileContext();
|
|
7731
|
+
this._showHistory = true;
|
|
7732
|
+
}
|
|
7733
|
+
}
|
|
7734
|
+
] : []
|
|
7735
|
+
] : [];
|
|
7736
|
+
const mobileLayout = this._showMobileContext ? computeMobileContextLayout({
|
|
7737
|
+
anchor: this._anchorRect,
|
|
7738
|
+
isOwn,
|
|
7739
|
+
hasReactions: Boolean(this.onReact),
|
|
7740
|
+
actionCount: mobileActions.length,
|
|
7741
|
+
vpWidth: globalThis.innerWidth || 390,
|
|
7742
|
+
vpHeight: globalThis.innerHeight || 844
|
|
7743
|
+
}) : null;
|
|
7172
7744
|
const isLiveNew = this.sessionStart > 0 && timestamp >= this.sessionStart;
|
|
7173
7745
|
const bubbleDecoration = noBubble ? "" : isOwn ? `;box-shadow:${isDark ? "0 1px 2px rgba(0,0,0,0.28)" : "0 1px 3px rgba(24,23,21,0.08)"}` : `;border:1px solid ${isDark ? "rgba(255,255,255,0.07)" : "rgba(24,23,21,0.07)"};box-shadow:${isDark ? "0 1px 2px rgba(0,0,0,0.22)" : "0 1px 2px rgba(24,23,21,0.04)"}`;
|
|
7174
|
-
|
|
7746
|
+
const longPressBubbleEffect = this._showMobileContext ? this._selectedMedia ? ";position:relative;z-index:1000" : spotlightBubbleStyle(isDark) : this._longPressActive && !this._selectedMedia ? `;animation:${isDark ? "msg-highlight-dark" : "msg-highlight-light"} .28s cubic-bezier(0.2, 0.8, 0.2, 1) forwards` : "";
|
|
7747
|
+
return html8`
|
|
7175
7748
|
<style>
|
|
7176
|
-
${kebabHoverCss}${fencedCodeHoverCss}${smileyTriggerCss}${longPressHighlightCss}${msgEntranceCss}${liveCursorCss}${highlightCss}${secretBlurCss(isDark)}
|
|
7749
|
+
${kebabHoverCss}${fencedCodeHoverCss}${smileyTriggerCss}${longPressHighlightCss}${msgEntranceCss}${liveCursorCss}${highlightCss}${reactionPickerCss(isDark)}${secretBlurCss(isDark)}
|
|
7177
7750
|
.msg-wrap .msg-reply-trigger{opacity:0;transition:opacity .15s}.msg-wrap:hover .msg-reply-trigger{opacity:1}
|
|
7178
7751
|
.chat-quick-reply-btn:hover{filter:brightness(1.08)}
|
|
7179
7752
|
[data-testid="message-text"]{unicode-bidi:plaintext;text-align:start}
|
|
@@ -7186,7 +7759,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7186
7759
|
?data-keyboard-selected="${this.isKeyboardSelected}"
|
|
7187
7760
|
style="display:flex;gap:6px;align-items:flex-start;flex-direction:${isOwn ? "row-reverse" : "row"};min-width:0${isLiveNew ? ";animation:msg-enter .22s cubic-bezier(0.16, 1, 0.3, 1)" : ""}${this.isKeyboardSelected ? keyboardSelectedRowStyle(isDark) : ""}"
|
|
7188
7761
|
>
|
|
7189
|
-
${showAvatar ?
|
|
7762
|
+
${showAvatar ? html8`
|
|
7190
7763
|
<chat-avatar
|
|
7191
7764
|
.image="${authorAvatar ?? ""}"
|
|
7192
7765
|
.name="${authorName}"
|
|
@@ -7210,24 +7783,31 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7210
7783
|
<div
|
|
7211
7784
|
class="msg-bubble"
|
|
7212
7785
|
dir="${textDirection(displayedText)}"
|
|
7786
|
+
@click="${(e) => {
|
|
7787
|
+
if (this._showMobileContext) {
|
|
7788
|
+
e.preventDefault();
|
|
7789
|
+
e.stopPropagation();
|
|
7790
|
+
this._closeMobileContext();
|
|
7791
|
+
}
|
|
7792
|
+
}}"
|
|
7213
7793
|
style="display:${noBubble ? "block" : "inline-block"};min-width:0;max-width:100%;box-sizing:border-box;${noBubble ? "width:100%;" : ""}background:${noBubble ? "transparent" : baseColor};color:${textColor};align-self:${isOwn ? "flex-end" : "flex-start"};border-radius:${messageBubbleRadius({
|
|
7214
7794
|
noBubble,
|
|
7215
7795
|
isOwn,
|
|
7216
7796
|
isStartOfSequence
|
|
7217
|
-
})};padding:${noBubble ? "2px 0" : "8px 13px"};margin-left:${isOwn ? "0" : showAvatar ? "0" : avatarSpace + "px"};margin-right:${isOwn ? showAvatar ? "0" : avatarSpace + "px" : "0"};overflow-x:hidden;overflow-y:hidden;word-break:break-word;overflow-wrap:anywhere
|
|
7797
|
+
})};padding:${noBubble ? "2px 0" : "8px 13px"};margin-left:${isOwn ? "0" : showAvatar ? "0" : avatarSpace + "px"};margin-right:${isOwn ? showAvatar ? "0" : avatarSpace + "px" : "0"};overflow-x:hidden;overflow-y:hidden;word-break:break-word;overflow-wrap:anywhere;transition:box-shadow .22s ease,filter .22s ease${bubbleDecoration}${longPressBubbleEffect}"
|
|
7218
7798
|
>
|
|
7219
7799
|
${shouldShowName({
|
|
7220
7800
|
isStartOfSequence,
|
|
7221
7801
|
isOwn,
|
|
7222
7802
|
isGroupChat: this.isGroupChat,
|
|
7223
7803
|
hideNames: customColors?.hideNames
|
|
7224
|
-
}) ?
|
|
7804
|
+
}) ? html8`
|
|
7225
7805
|
<b
|
|
7226
7806
|
data-testid="author-name"
|
|
7227
7807
|
dir="auto"
|
|
7228
7808
|
style="font-size:11px;color:${participantColor};user-select:none;-webkit-user-select:none"
|
|
7229
7809
|
>${authorName}</b>
|
|
7230
|
-
` : nothing3}${this.msg.replyTo ? renderQuotedMessage(this.msg.replyTo, isDark, customColors, textColor) : nothing3}${this._isEditing ?
|
|
7810
|
+
` : nothing3}${this.msg.replyTo ? renderQuotedMessage(this.msg.replyTo, isDark, customColors, textColor) : nothing3}${this._isEditing ? html8`
|
|
7231
7811
|
<div style="margin-top:4px">
|
|
7232
7812
|
<textarea
|
|
7233
7813
|
data-testid="edit-message-input"
|
|
@@ -7252,16 +7832,16 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7252
7832
|
</button>
|
|
7253
7833
|
</div>
|
|
7254
7834
|
</div>
|
|
7255
|
-
` : displayedText || this.streamActive ?
|
|
7835
|
+
` : displayedText || this.streamActive ? html8`
|
|
7256
7836
|
<span
|
|
7257
7837
|
data-testid="message-text"
|
|
7258
7838
|
dir="${textDirection(displayedText)}"
|
|
7259
7839
|
style="${callDetails ? "display:flex;align-items:center;gap:8px;" : "display:inline;"}user-select:${this.isMobile ? "none" : "text"};-webkit-user-select:${this.isMobile ? "none" : "text"};overflow-wrap:anywhere;word-break:break-word;min-width:0"
|
|
7260
7840
|
>${callDetails ? faPhoneAlt : nothing3}${unsafeHTML((this.streamActive || isRevealing) && displayedText.trim() ? injectCursorAtEnd(markdownHtml, liveCursorHtml(isDark)) : markdownHtml)}</span>
|
|
7261
|
-
` : nothing3}${attachments && attachments.length > 0 ?
|
|
7841
|
+
` : nothing3}${attachments && attachments.length > 0 ? html8`
|
|
7262
7842
|
<div
|
|
7263
7843
|
style="display:flex;flex-direction:column;gap:6px;margin-top:6px;min-width:0;max-width:100%">
|
|
7264
|
-
${attachments.map((att) =>
|
|
7844
|
+
${attachments.map((att) => html8`
|
|
7265
7845
|
<chat-attachment
|
|
7266
7846
|
.attachment="${att}"
|
|
7267
7847
|
.isDark="${isDark}"
|
|
@@ -7279,9 +7859,9 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7279
7859
|
` : nothing3}<div
|
|
7280
7860
|
style="display:flex;justify-content:flex-end;align-items:center;gap:4px;margin-top:4px;user-select:none;-webkit-user-select:none"
|
|
7281
7861
|
>
|
|
7282
|
-
${showMenu ?
|
|
7862
|
+
${showMenu ? html8`
|
|
7283
7863
|
<div style="display:flex;align-items:center;gap:4px">
|
|
7284
|
-
${hasEdits ?
|
|
7864
|
+
${hasEdits ? html8`
|
|
7285
7865
|
<span dir="auto" style="font-size:10px;opacity:0.7">edited</span>
|
|
7286
7866
|
` : nothing3}
|
|
7287
7867
|
<button
|
|
@@ -7294,11 +7874,11 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7294
7874
|
>
|
|
7295
7875
|
${faEllipsisV}
|
|
7296
7876
|
</button>
|
|
7297
|
-
${this._menuOpen ?
|
|
7877
|
+
${this._menuOpen ? html8`
|
|
7298
7878
|
<div
|
|
7299
7879
|
style="${dropdownMenuStyle(isDark, this._btnEl?.getBoundingClientRect() ?? new DOMRect())}"
|
|
7300
7880
|
>
|
|
7301
|
-
${canEdit ?
|
|
7881
|
+
${canEdit ? html8`
|
|
7302
7882
|
<button
|
|
7303
7883
|
type="button"
|
|
7304
7884
|
@click="${this._startEdit}"
|
|
@@ -7308,7 +7888,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7308
7888
|
>
|
|
7309
7889
|
${faPen} Edit
|
|
7310
7890
|
</button>
|
|
7311
|
-
` : nothing3} ${hasEdits ?
|
|
7891
|
+
` : nothing3} ${hasEdits ? html8`
|
|
7312
7892
|
<button
|
|
7313
7893
|
type="button"
|
|
7314
7894
|
@click="${() => {
|
|
@@ -7326,7 +7906,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7326
7906
|
</div>
|
|
7327
7907
|
` : nothing3}
|
|
7328
7908
|
</div>
|
|
7329
|
-
` :
|
|
7909
|
+
` : html8`
|
|
7330
7910
|
<div style="display:flex;align-items:center;gap:4px">
|
|
7331
7911
|
<button type="button" style="${kebabMenuStyle(textColor)};visibility:hidden">
|
|
7332
7912
|
${faEllipsisV}
|
|
@@ -7340,22 +7920,18 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7340
7920
|
>${this._timeAgo}</span>
|
|
7341
7921
|
</div>
|
|
7342
7922
|
</div>
|
|
7343
|
-
${this.onReact && !this.isMobile ?
|
|
7923
|
+
${this.onReact && !this.isMobile ? html8`
|
|
7344
7924
|
<button
|
|
7345
7925
|
type="button"
|
|
7346
7926
|
class="msg-smiley-trigger"
|
|
7927
|
+
?data-open="${this._showQuickEmojis || this._showEmojiPicker || void 0}"
|
|
7347
7928
|
style="${smileyTriggerStyle(isDark, isOwn)}"
|
|
7348
|
-
@click="${
|
|
7349
|
-
this._showQuickEmojis = !this._showQuickEmojis;
|
|
7350
|
-
if (this._showQuickEmojis) {
|
|
7351
|
-
requestAnimationFrame(() => document.addEventListener("mousedown", this._dismissQuickEmojis));
|
|
7352
|
-
}
|
|
7353
|
-
}}"
|
|
7929
|
+
@click="${this._toggleQuickEmojis}"
|
|
7354
7930
|
title="React"
|
|
7355
7931
|
>
|
|
7356
7932
|
${faSmile}
|
|
7357
7933
|
</button>
|
|
7358
|
-
` : nothing3} ${this.onReply && !this.isMobile ?
|
|
7934
|
+
` : nothing3} ${this.onReply && !this.isMobile ? html8`
|
|
7359
7935
|
<button
|
|
7360
7936
|
type="button"
|
|
7361
7937
|
class="msg-reply-trigger"
|
|
@@ -7365,142 +7941,95 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7365
7941
|
>
|
|
7366
7942
|
${faReply}
|
|
7367
7943
|
</button>
|
|
7368
|
-
` : nothing3} ${
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
<button
|
|
7380
|
-
type="button"
|
|
7381
|
-
@click="${() => {
|
|
7382
|
-
this._showQuickEmojis = false;
|
|
7383
|
-
this._showEmojiPicker = true;
|
|
7384
|
-
}}"
|
|
7385
|
-
style="${reactionBtnStyle};font-size:14px"
|
|
7386
|
-
title="More reactions"
|
|
7387
|
-
>
|
|
7388
|
-
+
|
|
7389
|
-
</button>
|
|
7390
|
-
</div>
|
|
7391
|
-
` : nothing3} ${!empty(this.msg.reactions ?? []) ? renderReactionPills(groupReactions(this.userId)(this.msg.reactions), isDark, (emoji) => this._toggleReaction(emoji)) : nothing3} ${this.isKeyboardSelected && !this.isMobile && !this._isEditing ? html7`
|
|
7944
|
+
` : nothing3} ${quickBarPos ? renderQuickEmojiBar({
|
|
7945
|
+
isDark,
|
|
7946
|
+
isMobile: false,
|
|
7947
|
+
top: quickBarPos.top,
|
|
7948
|
+
left: quickBarPos.left,
|
|
7949
|
+
placement: quickBarPos.placement,
|
|
7950
|
+
ownReactions,
|
|
7951
|
+
baseBtnStyle: reactionBtnStyle,
|
|
7952
|
+
onPick: (emoji) => this._toggleReaction(emoji),
|
|
7953
|
+
onExpand: this._openFullEmojiPicker
|
|
7954
|
+
}) : nothing3} ${!empty(this.msg.reactions ?? []) ? renderReactionPills(groupReactions(this.userId)(this.msg.reactions), isDark, (emoji) => this._toggleReaction(emoji)) : nothing3} ${this.isKeyboardSelected && !this.isMobile && !this._isEditing ? html8`
|
|
7392
7955
|
<div
|
|
7393
7956
|
data-testid="message-keyboard-hint"
|
|
7394
7957
|
style="${keyboardHintBarStyle(isDark)}"
|
|
7395
7958
|
>
|
|
7396
|
-
${this.onReact ?
|
|
7959
|
+
${this.onReact ? html8`
|
|
7397
7960
|
<span><kbd style="${keyboardHintKeyStyle(isDark)}">1–5</kbd> react</span>
|
|
7398
7961
|
<span><kbd style="${keyboardHintKeyStyle(isDark)}">+</kbd> emoji</span>
|
|
7399
|
-
` : nothing3} ${this.onReply ?
|
|
7962
|
+
` : nothing3} ${this.onReply ? html8`
|
|
7400
7963
|
<span><kbd style="${keyboardHintKeyStyle(isDark)}">r</kbd> reply</span>
|
|
7401
|
-
` : nothing3} ${canEdit ?
|
|
7964
|
+
` : nothing3} ${canEdit ? html8`
|
|
7402
7965
|
<span><kbd style="${keyboardHintKeyStyle(isDark)}">e</kbd> edit</span>
|
|
7403
7966
|
` : nothing3}
|
|
7404
7967
|
<span><kbd style="${keyboardHintKeyStyle(isDark)}">Esc</kbd> back</span>
|
|
7405
7968
|
</div>
|
|
7406
7969
|
` : nothing3}
|
|
7407
7970
|
</div>
|
|
7408
|
-
${this._showMobileContext ?
|
|
7409
|
-
<div
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
this.
|
|
7442
|
-
this.
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
${faReply} Reply
|
|
7447
|
-
</button>
|
|
7448
|
-
` : nothing3} ${this._selectedMedia ? html7`
|
|
7449
|
-
<button
|
|
7450
|
-
type="button"
|
|
7451
|
-
@click="${this._shareSelectedMedia}"
|
|
7452
|
-
style="${mobileContextActionStyle(isDark)}"
|
|
7453
|
-
>
|
|
7454
|
-
${this._selectedMedia.type === "video" ? faShare : faImage} Share ${this._selectedMedia.type === "video" ? "Video" : "Image"}
|
|
7455
|
-
</button>
|
|
7456
|
-
<button
|
|
7457
|
-
type="button"
|
|
7458
|
-
@click="${this._downloadSelectedMedia}"
|
|
7459
|
-
style="${mobileContextActionStyle(isDark)}"
|
|
7460
|
-
>
|
|
7461
|
-
${faDownload} Download ${this._selectedMedia.type === "video" ? "Video" : "Image"}
|
|
7462
|
-
</button>
|
|
7463
|
-
` : nothing3}
|
|
7464
|
-
<button
|
|
7465
|
-
type="button"
|
|
7466
|
-
@click="${this._copyText}"
|
|
7467
|
-
style="${mobileContextActionStyle(isDark)}"
|
|
7468
|
-
>
|
|
7469
|
-
${faCopy} Copy
|
|
7470
|
-
</button>
|
|
7471
|
-
${canEdit ? html7`
|
|
7472
|
-
<button
|
|
7473
|
-
type="button"
|
|
7474
|
-
@click="${() => {
|
|
7475
|
-
this._showMobileContext = false;
|
|
7476
|
-
this._startEdit();
|
|
7477
|
-
}}"
|
|
7478
|
-
style="${mobileContextActionStyle(isDark)}"
|
|
7479
|
-
>
|
|
7480
|
-
${faPen} Edit
|
|
7481
|
-
</button>
|
|
7482
|
-
` : nothing3} ${hasEdits ? html7`
|
|
7483
|
-
<button
|
|
7484
|
-
type="button"
|
|
7485
|
-
@click="${() => {
|
|
7486
|
-
this._showMobileContext = false;
|
|
7487
|
-
this._showHistory = true;
|
|
7488
|
-
}}"
|
|
7489
|
-
style="${mobileContextActionStyle(isDark)}"
|
|
7490
|
-
>
|
|
7491
|
-
${faHistory} View history
|
|
7492
|
-
</button>
|
|
7493
|
-
` : nothing3}
|
|
7494
|
-
</div>
|
|
7495
|
-
</div>
|
|
7496
|
-
` : nothing3} ${this._showEmojiPicker ? renderEmojiGrid(isDark, (emoji) => this._toggleReaction(emoji), () => {
|
|
7497
|
-
this._showEmojiPicker = false;
|
|
7971
|
+
${this._showMobileContext && mobileLayout ? html8`
|
|
7972
|
+
<div
|
|
7973
|
+
data-testid="mobile-context-backdrop"
|
|
7974
|
+
style="${mobileContextOverlayStyle}"
|
|
7975
|
+
@click="${this._closeMobileContext}"
|
|
7976
|
+
></div>
|
|
7977
|
+
${this.onReact ? renderQuickEmojiBar({
|
|
7978
|
+
isDark,
|
|
7979
|
+
isMobile: true,
|
|
7980
|
+
top: mobileLayout.pillTop,
|
|
7981
|
+
left: mobileLayout.pillLeft,
|
|
7982
|
+
placement: mobileLayout.pillPlacement,
|
|
7983
|
+
ownReactions,
|
|
7984
|
+
baseBtnStyle: reactionBtnStyle,
|
|
7985
|
+
onPick: (emoji) => {
|
|
7986
|
+
this._toggleReaction(emoji);
|
|
7987
|
+
this._closeMobileContext();
|
|
7988
|
+
},
|
|
7989
|
+
onExpand: this._openFullEmojiPicker
|
|
7990
|
+
}) : nothing3} ${renderMobileContextCard({
|
|
7991
|
+
isDark,
|
|
7992
|
+
top: mobileLayout.menuTop,
|
|
7993
|
+
left: mobileLayout.menuLeft,
|
|
7994
|
+
width: mobileLayout.menuWidth,
|
|
7995
|
+
actions: mobileActions
|
|
7996
|
+
})}
|
|
7997
|
+
` : nothing3} ${this._showEmojiPicker ? renderEmojiPickerPanel({
|
|
7998
|
+
isDark,
|
|
7999
|
+
isMobile: this.isMobile,
|
|
8000
|
+
accentColor: primaryColor,
|
|
8001
|
+
anchor: this._anchorRect,
|
|
8002
|
+
isOwn,
|
|
8003
|
+
sheetDragOffset: this._sheetDragY,
|
|
8004
|
+
onSheetTouchStart: this._sheetTouchStart,
|
|
8005
|
+
onSheetTouchMove: this._sheetTouchMove,
|
|
8006
|
+
onSheetTouchEnd: this._sheetTouchEnd,
|
|
8007
|
+
onPick: (emoji) => this._toggleReaction(emoji),
|
|
8008
|
+
onClose: this._closeFullEmojiPicker
|
|
7498
8009
|
}) : nothing3} ${this._showHistory && editHistory ? renderEditHistory(editHistory, text, isDark, () => {
|
|
7499
8010
|
this._showHistory = false;
|
|
7500
8011
|
}) : nothing3}
|
|
7501
8012
|
</div>
|
|
7502
8013
|
`;
|
|
7503
8014
|
}
|
|
8015
|
+
_polishMountedEmojiPicker = () => {
|
|
8016
|
+
const picker = this.querySelector("emoji-picker");
|
|
8017
|
+
if (!picker) return;
|
|
8018
|
+
const primaryColor = attachmentPrimaryColor(this.isDark, this.customColors);
|
|
8019
|
+
const applied = applyEmojiPickerShadowPolish(picker, this.isDark, this.isMobile, primaryColor, !this._emojiPickerFocused);
|
|
8020
|
+
if (applied) {
|
|
8021
|
+
this._emojiPickerFocused = true;
|
|
8022
|
+
return;
|
|
8023
|
+
}
|
|
8024
|
+
customElements.whenDefined("emoji-picker").then(() => {
|
|
8025
|
+
if (!this._showEmojiPicker || !this.isConnected) return;
|
|
8026
|
+
const upgraded = this.querySelector("emoji-picker");
|
|
8027
|
+
if (!upgraded) return;
|
|
8028
|
+
const done = applyEmojiPickerShadowPolish(upgraded, this.isDark, this.isMobile, attachmentPrimaryColor(this.isDark, this.customColors), !this._emojiPickerFocused);
|
|
8029
|
+
if (done) this._emojiPickerFocused = true;
|
|
8030
|
+
}).catch(() => {
|
|
8031
|
+
});
|
|
8032
|
+
};
|
|
7504
8033
|
updated() {
|
|
7505
8034
|
if (!this._btnEl) {
|
|
7506
8035
|
this._btnEl = this.querySelector(".msg-kebab");
|
|
@@ -7510,6 +8039,9 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7510
8039
|
if (dropdown) this._menuEl = dropdown;
|
|
7511
8040
|
}
|
|
7512
8041
|
if (!this._menuOpen) this._menuEl = null;
|
|
8042
|
+
if (this._showEmojiPicker) {
|
|
8043
|
+
this._polishMountedEmojiPicker();
|
|
8044
|
+
}
|
|
7513
8045
|
}
|
|
7514
8046
|
};
|
|
7515
8047
|
if (!customElements.get("chat-message")) {
|
|
@@ -7517,7 +8049,7 @@ if (!customElements.get("chat-message")) {
|
|
|
7517
8049
|
}
|
|
7518
8050
|
|
|
7519
8051
|
// lit/components/chat-typing-indicator.ts
|
|
7520
|
-
import { html as
|
|
8052
|
+
import { html as html9, LitElement as LitElement7 } from "lit";
|
|
7521
8053
|
var typingIndicatorStyle = (isDark) => `padding:0 8px 6px 44px;color:${isDark ? "#cbd5e1" : "#475569"};font-size:12px`;
|
|
7522
8054
|
var typingLabel = (names) => names.length === 1 ? `${names[0]} is typing` : `${names.slice(0, 2).join(", ")}${names.length > 2 ? " and others" : ""} are typing`;
|
|
7523
8055
|
var ChatTypingIndicator = class extends LitElement7 {
|
|
@@ -7553,7 +8085,7 @@ var ChatTypingIndicator = class extends LitElement7 {
|
|
|
7553
8085
|
clearInterval(this._interval);
|
|
7554
8086
|
}
|
|
7555
8087
|
render() {
|
|
7556
|
-
return
|
|
8088
|
+
return html9`
|
|
7557
8089
|
<div style="${typingIndicatorStyle(this.isDark)}">
|
|
7558
8090
|
${typingLabel(this.names)}<span style="display:inline-block;width:18px;letter-spacing:2px"
|
|
7559
8091
|
>${".".repeat(this._dots)}</span>
|
|
@@ -7656,18 +8188,18 @@ var renderSpinnerIndicator = (spinner, isDark, hideNames, isGroupChat, color) =>
|
|
|
7656
8188
|
const active = spinner.active && !stale;
|
|
7657
8189
|
const direction = textDirection(spinner.text);
|
|
7658
8190
|
const isRtl = direction === "rtl";
|
|
7659
|
-
return
|
|
8191
|
+
return html10`
|
|
7660
8192
|
<div
|
|
7661
8193
|
data-testid="spinner-indicator"
|
|
7662
8194
|
dir="${direction}"
|
|
7663
8195
|
style="${indicatorTextStyle(isDark, color, stale, isRtl)}"
|
|
7664
8196
|
>
|
|
7665
|
-
<span>${showAuthorName(hideNames, isGroupChat) ?
|
|
7666
|
-
${active ?
|
|
8197
|
+
<span>${showAuthorName(hideNames, isGroupChat) ? html10`<b dir="auto">${spinner.authorName}: </b>` : nothing4}<span data-testid="spinner-text" dir="${direction}">${spinner.text}</span>${stale ? " (failed)" : nothing4}</span>
|
|
8198
|
+
${active ? html10`
|
|
7667
8199
|
<div style="${linearBarTrackStyle(isDark, color, stale, isRtl)}">
|
|
7668
8200
|
<div style="${indeterminateBarStyle(isDark, color)}"></div>
|
|
7669
8201
|
</div>
|
|
7670
|
-
` :
|
|
8202
|
+
` : html10`
|
|
7671
8203
|
<div style="${linearBarTrackStyle(isDark, color, stale, isRtl)}">
|
|
7672
8204
|
<div style="${linearBarFillStyle(1, isDark, color, stale)}"></div>
|
|
7673
8205
|
</div>
|
|
@@ -7680,20 +8212,20 @@ var renderProgressIndicator = (progress, isDark, hideNames, isGroupChat, color)
|
|
|
7680
8212
|
const stale = progress.percentage < 1 && isStale(progress.timestamp);
|
|
7681
8213
|
const direction = textDirection(progress.text);
|
|
7682
8214
|
const isRtl = direction === "rtl";
|
|
7683
|
-
return
|
|
8215
|
+
return html10`
|
|
7684
8216
|
<div
|
|
7685
8217
|
data-testid="progress-indicator"
|
|
7686
8218
|
dir="${direction}"
|
|
7687
8219
|
style="${indicatorTextStyle(isDark, color, stale, isRtl)}"
|
|
7688
8220
|
>
|
|
7689
|
-
<span>${showAuthorName(hideNames, isGroupChat) ?
|
|
8221
|
+
<span>${showAuthorName(hideNames, isGroupChat) ? html10`<b dir="auto">${progress.authorName}: </b>` : nothing4}<span dir="${direction}">${progress.text}</span> (${Math.round(progress.percentage * 100)}%)${stale ? " (failed)" : nothing4}</span>
|
|
7690
8222
|
<div style="${linearBarTrackStyle(isDark, color, stale, isRtl)}">
|
|
7691
8223
|
<div style="${linearBarFillStyle(progress.percentage, isDark, color, stale)}"></div>
|
|
7692
8224
|
</div>
|
|
7693
8225
|
</div>
|
|
7694
8226
|
`;
|
|
7695
8227
|
};
|
|
7696
|
-
var renderTypingIndicatorEntry = (typingUsers, isDark) => empty(typingUsers) ? nothing4 :
|
|
8228
|
+
var renderTypingIndicatorEntry = (typingUsers, isDark) => empty(typingUsers) ? nothing4 : html10`
|
|
7697
8229
|
<chat-typing-indicator
|
|
7698
8230
|
.names="${typingUsers}"
|
|
7699
8231
|
.isDark="${isDark}"
|
|
@@ -7712,7 +8244,7 @@ var activeQuickReplyEntryId = (timeline, isSending) => isSending ? null : timeli
|
|
|
7712
8244
|
var spinnerKeyframes = `@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}`;
|
|
7713
8245
|
var indeterminateKeyframes = `@keyframes indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(200px)}}`;
|
|
7714
8246
|
var pulseKeyframes2 = `@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.3}}`;
|
|
7715
|
-
var spinnerEl = (isDark, color) =>
|
|
8247
|
+
var spinnerEl = (isDark, color) => html10`
|
|
7716
8248
|
<style>
|
|
7717
8249
|
${spinnerKeyframes}
|
|
7718
8250
|
</style>
|
|
@@ -7730,7 +8262,7 @@ var syncingTrackStyle = (isDark) => `width:100%;height:2px;overflow:hidden;backg
|
|
|
7730
8262
|
var syncingTrackBarStyle = (isDark, color) => `height:100%;width:32%;border-radius:9999px;background:${color ?? (isDark ? "rgba(147,197,253,0.75)" : "rgba(57,88,127,0.65)")};animation:syncingSweep 1.3s ease-in-out infinite`;
|
|
7731
8263
|
var syncingPillStyle = (isDark, textColor) => `margin-top:8px;display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:9999px;font-size:11px;font-weight:500;letter-spacing:0.01em;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:${isDark ? "rgba(24,24,22,0.78)" : "rgba(250,249,245,0.84)"};color:${textColor ?? (isDark ? "#b8b3a8" : "#625e56")};border:1px solid ${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.08)"};box-shadow:0 2px 8px ${isDark ? "rgba(0,0,0,0.28)" : "rgba(24,23,21,0.06)"}`;
|
|
7732
8264
|
var syncingSpinnerStyle = (isDark, color) => `width:10px;height:10px;border:1.5px solid ${isDark ? "rgba(255,255,255,0.16)" : "rgba(24,23,21,0.14)"};border-top:1.5px solid ${color ?? (isDark ? "#93c5fd" : "#39587f")};border-radius:50%;animation:spin 0.85s linear infinite;flex-shrink:0`;
|
|
7733
|
-
var syncingIndicator = (isDark, color) =>
|
|
8265
|
+
var syncingIndicator = (isDark, color) => html10`
|
|
7734
8266
|
<div
|
|
7735
8267
|
data-testid="messages-syncing-indicator"
|
|
7736
8268
|
role="status"
|
|
@@ -7750,7 +8282,7 @@ var syncingIndicator = (isDark, color) => html9`
|
|
|
7750
8282
|
</div>
|
|
7751
8283
|
</div>
|
|
7752
8284
|
`;
|
|
7753
|
-
var sendingIndicator = (label, primaryColor, isDark) =>
|
|
8285
|
+
var sendingIndicator = (label, primaryColor, isDark) => html10`
|
|
7754
8286
|
<div style="display:flex;flex-direction:row-reverse;gap:6px">
|
|
7755
8287
|
<div
|
|
7756
8288
|
style="background:${primaryColor};border-radius:16px;padding:10px 14px;display:flex;align-items:center;gap:10px;opacity:0.7"
|
|
@@ -7770,7 +8302,7 @@ var replyBarStyle = (isDark, custom) => `display:flex;align-items:center;gap:8px
|
|
|
7770
8302
|
var replyBarQuoteStyle = (isDark, custom) => `flex:1;min-width:0;border-left:3px solid ${quoteBarColor(isDark, custom)};padding:2px 8px;font-size:13px;overflow:hidden`;
|
|
7771
8303
|
var renderReplyBar = (reply, isDark, onClear, custom) => {
|
|
7772
8304
|
const lightSurface = inputSurfaceIsLight(isDark, custom);
|
|
7773
|
-
return
|
|
8305
|
+
return html10`
|
|
7774
8306
|
<div style="${replyBarStyle(isDark, custom)}">
|
|
7775
8307
|
<span style="color:${lightSurface ? "#6b7280" : "#9ca3af"};font-size:16px;display:flex;align-items:center"
|
|
7776
8308
|
>${faReply}</span>
|
|
@@ -7799,7 +8331,7 @@ var renderReplyBar = (reply, isDark, onClear, custom) => {
|
|
|
7799
8331
|
var reactionPreviewKeyStyle = (isDark, custom) => `font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;padding:2px 6px;border-radius:6px;flex-shrink:0;background:${inputSurfaceIsLight(isDark, custom) ? "rgba(24,23,21,0.08)" : "rgba(255,255,255,0.1)"};color:${inputSurfaceIsLight(isDark, custom) ? "#374151" : "#d1d5db"}`;
|
|
7800
8332
|
var renderReactionPreviewBar = ({ emoji, remove: remove2, target, isDark, custom }) => {
|
|
7801
8333
|
const lightSurface = inputSurfaceIsLight(isDark, custom);
|
|
7802
|
-
return
|
|
8334
|
+
return html10`
|
|
7803
8335
|
<div
|
|
7804
8336
|
data-testid="reaction-command-preview"
|
|
7805
8337
|
style="${replyBarStyle(isDark, custom)}"
|
|
@@ -7864,7 +8396,7 @@ var unreadDividerRowStyle = "display:flex;align-items:center;gap:10px;margin:8px
|
|
|
7864
8396
|
var unreadDividerLineStyle = (isDark) => `flex:1;height:1px;background:${isDark ? "rgba(96,165,250,0.28)" : "rgba(37,99,235,0.24)"}`;
|
|
7865
8397
|
var unreadDividerPillStyle = (isDark) => `font-size:11px;font-weight:700;letter-spacing:0.01em;padding:3px 10px;border-radius:9999px;white-space:nowrap;background:${isDark ? "rgba(96,165,250,0.18)" : "rgba(37,99,235,0.10)"};color:${isDark ? "#93c5fd" : "#1d4ed8"};border:1px solid ${isDark ? "rgba(96,165,250,0.34)" : "rgba(37,99,235,0.24)"}`;
|
|
7866
8398
|
var backUnreadBadgeStyle = (isDark) => `display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:-4px;margin-right:4px;border-radius:9999px;border:none;cursor:pointer;font-size:11px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;background:${isDark ? "#60a5fa" : "#2563eb"};color:${isDark ? "#0d1526" : "#ffffff"};flex-shrink:0`;
|
|
7867
|
-
var renderUnreadMessagesDivider = (count2, isDark) =>
|
|
8399
|
+
var renderUnreadMessagesDivider = (count2, isDark) => html10`
|
|
7868
8400
|
<div
|
|
7869
8401
|
data-testid="unread-messages-divider"
|
|
7870
8402
|
role="separator"
|
|
@@ -8475,15 +9007,15 @@ var ChatBox = class extends LitElement8 {
|
|
|
8475
9007
|
this.onToggleNotificationsMute?.();
|
|
8476
9008
|
};
|
|
8477
9009
|
_renderMenuContent() {
|
|
8478
|
-
return
|
|
8479
|
-
${this.enableVoiceCall && this.voiceCallState === "idle" ?
|
|
9010
|
+
return html10`
|
|
9011
|
+
${this.enableVoiceCall && this.voiceCallState === "idle" ? html10`
|
|
8480
9012
|
<div
|
|
8481
9013
|
class="menu-item"
|
|
8482
9014
|
@click="${this._handleMenuCall}"
|
|
8483
9015
|
>
|
|
8484
9016
|
Voice Call
|
|
8485
9017
|
</div>
|
|
8486
|
-
` : nothing4} ${this.onToggleNotificationsMute ?
|
|
9018
|
+
` : nothing4} ${this.onToggleNotificationsMute ? html10`
|
|
8487
9019
|
<div
|
|
8488
9020
|
data-testid="menu-toggle-mute-notifications"
|
|
8489
9021
|
class="menu-item"
|
|
@@ -8491,7 +9023,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
8491
9023
|
>
|
|
8492
9024
|
${this.notificationsMuted ? "Unmute notifications" : "Mute notifications"}
|
|
8493
9025
|
</div>
|
|
8494
|
-
` : nothing4} ${this.credentials ?
|
|
9026
|
+
` : nothing4} ${this.credentials ? html10`
|
|
8495
9027
|
<div
|
|
8496
9028
|
class="menu-item"
|
|
8497
9029
|
@click="${this._handleMenuNewThread}"
|
|
@@ -8521,7 +9053,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
8521
9053
|
}
|
|
8522
9054
|
_renderHeaderMenu() {
|
|
8523
9055
|
const isDark = this._effectiveDark;
|
|
8524
|
-
return
|
|
9056
|
+
return html10`
|
|
8525
9057
|
<div style="position:relative;display:flex;align-items:center;flex-shrink:0">
|
|
8526
9058
|
<button
|
|
8527
9059
|
data-testid="menu-button"
|
|
@@ -8538,7 +9070,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
8538
9070
|
>
|
|
8539
9071
|
${faEllipsisV}
|
|
8540
9072
|
</button>
|
|
8541
|
-
${this._showMenu ?
|
|
9073
|
+
${this._showMenu ? html10`
|
|
8542
9074
|
<div
|
|
8543
9075
|
data-testid="menu-container"
|
|
8544
9076
|
style="position:absolute;top:calc(100% + 8px);right:0;background:${isDark ? "#2a2a2a" : "#ffffff"};color:${isDark ? "#ffffff" : "#000000"};border:1px solid ${isDark ? "#4b5563" : "#d1d5db"};border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.15);padding:4px 0;z-index:100000;font-size:14px;min-width:160px;display:flex;flex-direction:column"
|
|
@@ -8552,7 +9084,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
8552
9084
|
_renderBottomMenu() {
|
|
8553
9085
|
const isDark = this._effectiveDark;
|
|
8554
9086
|
const customColors = this.customColors;
|
|
8555
|
-
return
|
|
9087
|
+
return html10`
|
|
8556
9088
|
<div style="position:relative;display:flex">
|
|
8557
9089
|
<button
|
|
8558
9090
|
data-testid="menu-button"
|
|
@@ -8567,7 +9099,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
8567
9099
|
>
|
|
8568
9100
|
${faEllipsisV}
|
|
8569
9101
|
</button>
|
|
8570
|
-
${this._showMenu ?
|
|
9102
|
+
${this._showMenu ? html10`
|
|
8571
9103
|
<div
|
|
8572
9104
|
data-testid="menu-container"
|
|
8573
9105
|
style="position:absolute;bottom:calc(100% + 8px);right:0;background:${isDark ? "#2a2a2a" : "#ffffff"};color:${isDark ? "#ffffff" : "#000000"};border:1px solid ${isDark ? "#4b5563" : "#d1d5db"};border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.15);padding:4px 0;z-index:100000;font-size:14px;min-width:160px;display:flex;flex-direction:column"
|
|
@@ -9296,7 +9828,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9296
9828
|
} : null;
|
|
9297
9829
|
})() : null;
|
|
9298
9830
|
const remaining = maxTextLength - estimateSerializedLength(this._input);
|
|
9299
|
-
return
|
|
9831
|
+
return html10`
|
|
9300
9832
|
<style>
|
|
9301
9833
|
${kebabHoverCss2}${indeterminateKeyframes}${pulseKeyframes2}
|
|
9302
9834
|
.menu-item {
|
|
@@ -9393,12 +9925,12 @@ var ChatBox = class extends LitElement8 {
|
|
|
9393
9925
|
data-testid="chat-container"
|
|
9394
9926
|
style="${chatContainerStyle(isDark, customColors)}"
|
|
9395
9927
|
>
|
|
9396
|
-
${!customColors?.hideTitle ?
|
|
9928
|
+
${!customColors?.hideTitle ? html10`
|
|
9397
9929
|
<div data-testid="title-bar" style="${titleStyle(isDark, customColors)}">
|
|
9398
9930
|
<div
|
|
9399
9931
|
style="${contentMaxWidthStyle(customColors) ? contentMaxWidthStyle(customColors) + ";" : ""}width:100%;display:flex;align-items:center;padding:0 ${this.onClose || this.onBack ? "16px" : "44px"} 0 16px"
|
|
9400
9932
|
>
|
|
9401
|
-
${this.onBack ?
|
|
9933
|
+
${this.onBack ? html10`
|
|
9402
9934
|
<button
|
|
9403
9935
|
type="button"
|
|
9404
9936
|
data-testid="back-to-chats-button"
|
|
@@ -9411,7 +9943,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9411
9943
|
>
|
|
9412
9944
|
${faArrowLeft}
|
|
9413
9945
|
</button>
|
|
9414
|
-
${this.otherUnreadCount > 0 ?
|
|
9946
|
+
${this.otherUnreadCount > 0 ? html10`
|
|
9415
9947
|
<button
|
|
9416
9948
|
type="button"
|
|
9417
9949
|
data-testid="back-unread-badge"
|
|
@@ -9424,7 +9956,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9424
9956
|
` : nothing4}
|
|
9425
9957
|
` : nothing4}
|
|
9426
9958
|
<div style="flex:1;display:flex;justify-content:center;min-width:0;overflow:hidden">
|
|
9427
|
-
${this._isEditingTitle ?
|
|
9959
|
+
${this._isEditingTitle ? html10`
|
|
9428
9960
|
<input
|
|
9429
9961
|
type="text"
|
|
9430
9962
|
data-testid="rename-conversation-input"
|
|
@@ -9436,7 +9968,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9436
9968
|
@keydown="${this._onTitleDraftKeydown}"
|
|
9437
9969
|
@blur="${this._commitEditingTitle}"
|
|
9438
9970
|
/>
|
|
9439
|
-
` :
|
|
9971
|
+
` : html10`
|
|
9440
9972
|
<div
|
|
9441
9973
|
data-testid="title-text"
|
|
9442
9974
|
class="${this.credentials ? "title-editable" : ""}"
|
|
@@ -9444,11 +9976,11 @@ var ChatBox = class extends LitElement8 {
|
|
|
9444
9976
|
@click="${this.credentials ? this._startEditingTitle : void 0}"
|
|
9445
9977
|
style="text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
|
|
9446
9978
|
>
|
|
9447
|
-
<span style="overflow:hidden;text-overflow:ellipsis">${this.title}</span>${this.credentials ?
|
|
9979
|
+
<span style="overflow:hidden;text-overflow:ellipsis">${this.title}</span>${this.credentials ? html10`<span class="title-edit-icon">${faPen}</span>` : nothing4}
|
|
9448
9980
|
</div>
|
|
9449
9981
|
`}
|
|
9450
9982
|
</div>
|
|
9451
|
-
${this._renderHeaderMenu()} ${this.onClose ?
|
|
9983
|
+
${this._renderHeaderMenu()} ${this.onClose ? html10`
|
|
9452
9984
|
<button
|
|
9453
9985
|
type="button"
|
|
9454
9986
|
data-testid="widget-close-button"
|
|
@@ -9463,13 +9995,13 @@ var ChatBox = class extends LitElement8 {
|
|
|
9463
9995
|
` : nothing4}
|
|
9464
9996
|
</div>
|
|
9465
9997
|
</div>
|
|
9466
|
-
` : nothing4} ${this.voiceCallState !== "idle" ?
|
|
9998
|
+
` : nothing4} ${this.voiceCallState !== "idle" ? html10`
|
|
9467
9999
|
<div
|
|
9468
10000
|
style="background:${isDark ? "#2a2a2a" : "#e2e8f0"};padding:12px 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid ${isDark ? "#1a1a1a" : "#cbd5e1"}"
|
|
9469
10001
|
>
|
|
9470
10002
|
<div style="color:${isDark ? "#fff" : "#000"};font-weight:bold">${voiceCallLabel(this.voiceCallState, this.voiceCallDuration)}</div>
|
|
9471
10003
|
<div style="display:flex;gap:8px">
|
|
9472
|
-
${this.voiceCallState === "active" && this.onToggleMute ?
|
|
10004
|
+
${this.voiceCallState === "active" && this.onToggleMute ? html10`
|
|
9473
10005
|
<button
|
|
9474
10006
|
type="button"
|
|
9475
10007
|
@click="${this.onToggleMute}"
|
|
@@ -9477,7 +10009,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9477
10009
|
>
|
|
9478
10010
|
${this.voiceCallMuted ? faMicrophoneSlash : faMicrophone} ${this.voiceCallMuted ? "Unmute" : "Mute"}
|
|
9479
10011
|
</button>
|
|
9480
|
-
` : nothing4} ${this.voiceCallState === "ringing" && this.onAcceptCall ?
|
|
10012
|
+
` : nothing4} ${this.voiceCallState === "ringing" && this.onAcceptCall ? html10`
|
|
9481
10013
|
<button
|
|
9482
10014
|
type="button"
|
|
9483
10015
|
@click="${this.onAcceptCall}"
|
|
@@ -9485,7 +10017,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9485
10017
|
>
|
|
9486
10018
|
Accept
|
|
9487
10019
|
</button>
|
|
9488
|
-
` : nothing4} ${(this.voiceCallState === "ringing" || this.voiceCallState === "active" || this.voiceCallState === "calling" || this.voiceCallState === "connecting") && this.onEndCall && this.onRejectCall ?
|
|
10020
|
+
` : nothing4} ${(this.voiceCallState === "ringing" || this.voiceCallState === "active" || this.voiceCallState === "calling" || this.voiceCallState === "connecting") && this.onEndCall && this.onRejectCall ? html10`
|
|
9489
10021
|
<button
|
|
9490
10022
|
type="button"
|
|
9491
10023
|
@click="${this.voiceCallState === "ringing" ? this.onRejectCall : this.onEndCall}"
|
|
@@ -9514,11 +10046,11 @@ var ChatBox = class extends LitElement8 {
|
|
|
9514
10046
|
data-content-inner
|
|
9515
10047
|
style="display:flex;flex-direction:column;gap:8px;padding:12px 12px ${this._inputAreaHeight}px 12px;flex-grow:1;width:100%;max-width:100%;box-sizing:border-box;min-width:0;${contentMaxWidthStyle(customColors)}"
|
|
9516
10048
|
>
|
|
9517
|
-
${this.isLoading || this.isSyncing && allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ?
|
|
10049
|
+
${this.isLoading || this.isSyncing && allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ? html10`
|
|
9518
10050
|
<div style="${centerFillStyle(isDark)}">${spinnerEl(isDark, customColors?.text)}</div>
|
|
9519
|
-
` : allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ?
|
|
10051
|
+
` : allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ? html10`
|
|
9520
10052
|
<div style="${centerFillStyle(isDark)}">
|
|
9521
|
-
${nonempty(this.suggestedMessages ?? []) ?
|
|
10053
|
+
${nonempty(this.suggestedMessages ?? []) ? html10`
|
|
9522
10054
|
<div style="${emptySuggestionsWrapStyle}">
|
|
9523
10055
|
<span
|
|
9524
10056
|
data-testid="empty-state"
|
|
@@ -9530,7 +10062,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9530
10062
|
>
|
|
9531
10063
|
${map((item) => {
|
|
9532
10064
|
const { label, text } = resolveSuggestedMessage(item);
|
|
9533
|
-
return
|
|
10065
|
+
return html10`
|
|
9534
10066
|
<button
|
|
9535
10067
|
type="button"
|
|
9536
10068
|
class="suggested-message-btn"
|
|
@@ -9545,13 +10077,13 @@ var ChatBox = class extends LitElement8 {
|
|
|
9545
10077
|
})(this.suggestedMessages ?? [])}
|
|
9546
10078
|
</div>
|
|
9547
10079
|
</div>
|
|
9548
|
-
` : this.emptyMessage ?
|
|
10080
|
+
` : this.emptyMessage ? html10`
|
|
9549
10081
|
<span data-testid="empty-state">${this.emptyMessage}</span>
|
|
9550
|
-
` :
|
|
10082
|
+
` : html10`
|
|
9551
10083
|
<span data-testid="empty-state">No messages yet. Start the conversation!</span>
|
|
9552
10084
|
`}
|
|
9553
10085
|
</div>
|
|
9554
|
-
` :
|
|
10086
|
+
` : html10`
|
|
9555
10087
|
${repeat(timeline, (entry) => {
|
|
9556
10088
|
if (entry.kind === "message") return entry.msg.id;
|
|
9557
10089
|
if (entry.kind === "spinner") {
|
|
@@ -9568,7 +10100,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9568
10100
|
</div>
|
|
9569
10101
|
</div>
|
|
9570
10102
|
|
|
9571
|
-
${this._showScrollDownButton ?
|
|
10103
|
+
${this._showScrollDownButton ? html10`
|
|
9572
10104
|
<button
|
|
9573
10105
|
class="scroll-down-btn"
|
|
9574
10106
|
style="bottom:${this._inputAreaHeight + 16}px"
|
|
@@ -9591,10 +10123,10 @@ var ChatBox = class extends LitElement8 {
|
|
|
9591
10123
|
custom: customColors
|
|
9592
10124
|
}) : this._replyingTo ? renderReplyBar(this._replyingTo, isDark, () => {
|
|
9593
10125
|
this._replyingTo = null;
|
|
9594
|
-
}, customColors) : nothing4} ${!empty(this._pendingFiles) ?
|
|
10126
|
+
}, customColors) : nothing4} ${!empty(this._pendingFiles) ? html10`
|
|
9595
10127
|
<div style="background:${inputBgColor}">
|
|
9596
10128
|
<div style="display:flex;gap:8px;padding:8px 12px;flex-wrap:wrap;${contentMaxWidthStyle(customColors)}">
|
|
9597
|
-
${this._pendingFiles.map((f, i) =>
|
|
10129
|
+
${this._pendingFiles.map((f, i) => html10`
|
|
9598
10130
|
<div
|
|
9599
10131
|
style="display:flex;align-items:center;gap:4px;padding:4px 8px;background:${isDark ? "#2a2a2a" : "#cbd5e1"};border-radius:4px;font-size:12px"
|
|
9600
10132
|
>
|
|
@@ -9612,7 +10144,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9612
10144
|
`)}
|
|
9613
10145
|
</div>
|
|
9614
10146
|
</div>
|
|
9615
|
-
` : nothing4} ${this._isRecording ?
|
|
10147
|
+
` : nothing4} ${this._isRecording ? html10`
|
|
9616
10148
|
<div style="${recordingIndicatorStyle(isDark)}">
|
|
9617
10149
|
<div style="display:flex;align-items:center;gap:8px">
|
|
9618
10150
|
<span
|
|
@@ -9620,7 +10152,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9620
10152
|
></span>
|
|
9621
10153
|
<span>Recording... ${formatDuration(this._recordingDuration)}</span>
|
|
9622
10154
|
</div>
|
|
9623
|
-
${this._isMobile && !this._isRecordingLocked ?
|
|
10155
|
+
${this._isMobile && !this._isRecordingLocked ? html10`
|
|
9624
10156
|
<div style="display:flex;align-items:center;gap:16px;font-size:12px">
|
|
9625
10157
|
<span
|
|
9626
10158
|
style="opacity:${0.6 + Math.min(0.4, Math.abs(this._swipeOffset.x) / 50)};transform:translateX(${Math.min(0, this._swipeOffset.x / 3)}px);transition:opacity 0.15s"
|
|
@@ -9629,7 +10161,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9629
10161
|
style="opacity:${0.4 + Math.min(0.6, Math.abs(this._swipeOffset.y) / 30)};transform:translateY(${Math.min(0, this._swipeOffset.y / 3)}px);transition:opacity 0.15s"
|
|
9630
10162
|
>↑ lock</span>
|
|
9631
10163
|
</div>
|
|
9632
|
-
` : nothing4} ${this._isMobile && this._isRecordingLocked ?
|
|
10164
|
+
` : nothing4} ${this._isMobile && this._isRecordingLocked ? html10`
|
|
9633
10165
|
<div style="display:flex;gap:8px">
|
|
9634
10166
|
<button
|
|
9635
10167
|
type="button"
|
|
@@ -9646,7 +10178,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9646
10178
|
Send
|
|
9647
10179
|
</button>
|
|
9648
10180
|
</div>
|
|
9649
|
-
` : nothing4} ${!this._isMobile ?
|
|
10181
|
+
` : nothing4} ${!this._isMobile ? html10`
|
|
9650
10182
|
<button
|
|
9651
10183
|
type="button"
|
|
9652
10184
|
@click="${() => this._stopRecording(false)}"
|
|
@@ -9686,7 +10218,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9686
10218
|
<div
|
|
9687
10219
|
style="position:relative;flex-grow:1;display:flex;align-items:flex-end"
|
|
9688
10220
|
>
|
|
9689
|
-
${this._autocompleteState?.kind === "mention" ?
|
|
10221
|
+
${this._autocompleteState?.kind === "mention" ? html10`
|
|
9690
10222
|
<div
|
|
9691
10223
|
class="autocomplete-dropdown"
|
|
9692
10224
|
data-testid="mention-autocomplete"
|
|
@@ -9694,7 +10226,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9694
10226
|
>
|
|
9695
10227
|
${repeat(this._autocompleteState.filtered, (p) => p.publicSignKey, (p, index) => {
|
|
9696
10228
|
const isSelected = this._autocompleteState.selectedIndex === index;
|
|
9697
|
-
return
|
|
10229
|
+
return html10`
|
|
9698
10230
|
<div
|
|
9699
10231
|
style="${autocompleteItemStyle(isSelected, isDark, customColors)}"
|
|
9700
10232
|
@click="${() => this._selectAutocompleteItem(p)}"
|
|
@@ -9717,19 +10249,19 @@ var ChatBox = class extends LitElement8 {
|
|
|
9717
10249
|
`;
|
|
9718
10250
|
})}
|
|
9719
10251
|
</div>
|
|
9720
|
-
` : this._autocompleteState?.kind === "emoji" ?
|
|
10252
|
+
` : this._autocompleteState?.kind === "emoji" ? html10`
|
|
9721
10253
|
<div
|
|
9722
10254
|
class="autocomplete-dropdown"
|
|
9723
10255
|
data-testid="emoji-autocomplete"
|
|
9724
10256
|
style="${autocompleteDropdownStyle(isDark, customColors)}"
|
|
9725
10257
|
>
|
|
9726
|
-
${this._autocompleteState.reactionMode ?
|
|
10258
|
+
${this._autocompleteState.reactionMode ? html10`
|
|
9727
10259
|
<div style="${autocompleteHeaderStyle(isDark, customColors)}">
|
|
9728
10260
|
${this._autocompleteState.reactionMode === "remove" ? "Remove reaction from" : "React to"} ${this._reactionTargetMessage()?.authorName || "previous message"}
|
|
9729
10261
|
</div>
|
|
9730
10262
|
` : nothing4} ${repeat(this._autocompleteState.items, (entry) => entry.shortcode, (entry, index) => {
|
|
9731
10263
|
const isSelected = this._autocompleteState.selectedIndex === index;
|
|
9732
|
-
return
|
|
10264
|
+
return html10`
|
|
9733
10265
|
<div
|
|
9734
10266
|
data-testid="emoji-autocomplete-item"
|
|
9735
10267
|
data-shortcode="${entry.shortcode}"
|
|
@@ -9745,7 +10277,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9745
10277
|
>${entry.emoji}</span>
|
|
9746
10278
|
<div style="display:flex;align-items:baseline;gap:8px;min-width:0;flex:1">
|
|
9747
10279
|
<span style="${autocompleteItemNameStyle(isDark, customColors)}">:${entry.shortcode}:</span>
|
|
9748
|
-
${entry.aliases && entry.aliases.length > 0 ?
|
|
10280
|
+
${entry.aliases && entry.aliases.length > 0 ? html10`
|
|
9749
10281
|
<span style="${autocompleteItemKeyStyle(isDark, customColors)}">${entry.aliases[0]}</span>
|
|
9750
10282
|
` : nothing4}
|
|
9751
10283
|
</div>
|
|
@@ -9753,7 +10285,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9753
10285
|
`;
|
|
9754
10286
|
})}
|
|
9755
10287
|
</div>
|
|
9756
|
-
` : nothing4} ${this.enableAttachments ?
|
|
10288
|
+
` : nothing4} ${this.enableAttachments ? html10`
|
|
9757
10289
|
<div
|
|
9758
10290
|
data-attach-wrapper
|
|
9759
10291
|
style="position:absolute;right:${isTransparentInput(customColors) ? "0px" : "4px"};top:50%;transform:translateY(-50%);z-index:100"
|
|
@@ -9767,7 +10299,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9767
10299
|
>
|
|
9768
10300
|
${faPaperclip}
|
|
9769
10301
|
</button>
|
|
9770
|
-
${this._showAttachMenu ?
|
|
10302
|
+
${this._showAttachMenu ? html10`
|
|
9771
10303
|
<div data-testid="attach-menu" style="${attachMenuStyle(isDark)}">
|
|
9772
10304
|
<button
|
|
9773
10305
|
type="button"
|
|
@@ -9796,7 +10328,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9796
10328
|
>
|
|
9797
10329
|
${faFile} Document
|
|
9798
10330
|
</button>
|
|
9799
|
-
${this.onSendLocation ?
|
|
10331
|
+
${this.onSendLocation ? html10`
|
|
9800
10332
|
<button
|
|
9801
10333
|
type="button"
|
|
9802
10334
|
@click="${this._onAttachLocation}"
|
|
@@ -9844,14 +10376,14 @@ var ChatBox = class extends LitElement8 {
|
|
|
9844
10376
|
</button>
|
|
9845
10377
|
${customColors?.hideTitle ? this._renderBottomMenu() : nothing4}
|
|
9846
10378
|
</div>
|
|
9847
|
-
${remaining < charCountThreshold ?
|
|
10379
|
+
${remaining < charCountThreshold ? html10`
|
|
9848
10380
|
<div style="${charCountStyle(isDark, remaining < 0)}">
|
|
9849
10381
|
${remaining < 0 ? `${-remaining} characters over limit` : `${remaining} characters remaining`}
|
|
9850
10382
|
</div>
|
|
9851
10383
|
` : nothing4}
|
|
9852
10384
|
</div>
|
|
9853
10385
|
</div>
|
|
9854
|
-
${this._fetchingMore ?
|
|
10386
|
+
${this._fetchingMore ? html10`
|
|
9855
10387
|
<div style="${loadingStyle}">Loading more...</div>
|
|
9856
10388
|
` : nothing4}
|
|
9857
10389
|
</div>
|
|
@@ -9861,7 +10393,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9861
10393
|
const isDark = this._effectiveDark;
|
|
9862
10394
|
const { customColors } = this;
|
|
9863
10395
|
const showUnreadDivider = unreadDivider !== null && entry.msg.id === unreadDivider.firstUnreadMessageId;
|
|
9864
|
-
return
|
|
10396
|
+
return html10`
|
|
9865
10397
|
${showUnreadDivider ? renderUnreadMessagesDivider(unreadDivider.count, isDark) : nothing4}
|
|
9866
10398
|
<chat-message
|
|
9867
10399
|
.msg="${entry.msg}"
|
|
@@ -9906,7 +10438,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9906
10438
|
text: entry.stream.text,
|
|
9907
10439
|
timestamp: entry.stream.timestamp
|
|
9908
10440
|
};
|
|
9909
|
-
return
|
|
10441
|
+
return html10`
|
|
9910
10442
|
<chat-message
|
|
9911
10443
|
.msg="${streamMsg}"
|
|
9912
10444
|
.prev="${entry.prevMsg}"
|
|
@@ -9928,7 +10460,7 @@ if (!customElements.get("chat-box")) {
|
|
|
9928
10460
|
}
|
|
9929
10461
|
|
|
9930
10462
|
// lit/components/user-profile-popup.ts
|
|
9931
|
-
import { html as
|
|
10463
|
+
import { html as html11, LitElement as LitElement9, nothing as nothing5 } from "lit";
|
|
9932
10464
|
var overlayStyle2 = "position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;z-index:1000";
|
|
9933
10465
|
var popupStyle = (isDark) => `background:${isDark ? "#1a1a1a" : "#fff"};border-radius:16px;padding:24px;min-width:260px;max-width:320px;border:1px solid ${isDark ? "#2a2a2a" : "#e5e7eb"};box-shadow:${isDark ? "0 8px 24px #0008" : "0 8px 24px #0002"};display:flex;flex-direction:column;align-items:center;gap:16px`;
|
|
9934
10466
|
var bigAvatarStyle = (baseColor, isDark) => `display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;background:${baseColor};box-shadow:${isDark ? "0 2px 8px #0004" : "0 2px 8px #0001"}`;
|
|
@@ -10012,20 +10544,20 @@ var UserProfilePopup = class extends LitElement9 {
|
|
|
10012
10544
|
render() {
|
|
10013
10545
|
const baseColor = avatarColor(this.authorId, this.isDark);
|
|
10014
10546
|
const shortId = compactPublicKey(this.authorId);
|
|
10015
|
-
return
|
|
10547
|
+
return html11`
|
|
10016
10548
|
<div style="${overlayStyle2}" @click="${this.onClose}">
|
|
10017
10549
|
<div style="${popupStyle(this.isDark)}" @click="${(e) => e.stopPropagation()}">
|
|
10018
|
-
${this.authorAvatar ?
|
|
10550
|
+
${this.authorAvatar ? html11`
|
|
10019
10551
|
<div style="${bigAvatarStyle(baseColor, this.isDark)}">
|
|
10020
10552
|
<img src="${this.authorAvatar}" alt="${this.authorName}" style="${bigAvatarImgStyle}" />
|
|
10021
10553
|
</div>
|
|
10022
|
-
` :
|
|
10554
|
+
` : html11`
|
|
10023
10555
|
<div style="${bigAvatarStyle(baseColor, this.isDark)}">
|
|
10024
10556
|
<span style="${bigInitialsStyle(baseColor, this.isDark)}">${(this.authorName ?? "").slice(0, 2).toUpperCase()}</span>
|
|
10025
10557
|
</div>
|
|
10026
10558
|
`}
|
|
10027
10559
|
<div style="${nameStyle2(this.isDark)}">${this.authorName}</div>
|
|
10028
|
-
${this._alias ?
|
|
10560
|
+
${this._alias ? html11`
|
|
10029
10561
|
<div style="${aliasStyle(this.isDark)}">@${this._alias}</div>
|
|
10030
10562
|
` : nothing5}
|
|
10031
10563
|
<div style="${idRowStyle}">
|
|
@@ -10034,7 +10566,7 @@ var UserProfilePopup = class extends LitElement9 {
|
|
|
10034
10566
|
${this._copied ? "Copied!" : "Copy"}
|
|
10035
10567
|
</button>
|
|
10036
10568
|
</div>
|
|
10037
|
-
${this.onChatWith ?
|
|
10569
|
+
${this.onChatWith ? html11`
|
|
10038
10570
|
<button type="button" style="${chatBtnStyle(this.isDark)}" @click="${this._handleChatWith}">
|
|
10039
10571
|
Chat with ${this.authorName}
|
|
10040
10572
|
</button>
|
|
@@ -10143,7 +10675,7 @@ var sidebarItemTypingStyle = (isDark) => `${sidebarItemPreviewRowStyle};font-wei
|
|
|
10143
10675
|
var sidebarUnreadBadgeStyle = (isDark) => `display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border-radius:9999px;font-size:11px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;flex-shrink:0;background:${isDark ? "#60a5fa" : "#2563eb"};color:${isDark ? "#0d1526" : "#ffffff"}`;
|
|
10144
10676
|
var sidebarUnreadDotStyle = (isDark) => `display:inline-block;width:12px;height:12px;border-radius:9999px;flex-shrink:0;background:${isDark ? "#60a5fa" : "#2563eb"}`;
|
|
10145
10677
|
var sidebarPinnedIndicatorStyle = (isDark) => `display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;color:${isDark ? "#9e988e" : "#625e56"}`;
|
|
10146
|
-
var sidebarPinSvg =
|
|
10678
|
+
var sidebarPinSvg = html12`
|
|
10147
10679
|
<svg
|
|
10148
10680
|
width="12"
|
|
10149
10681
|
height="12"
|
|
@@ -10293,7 +10825,7 @@ var sidebarItemTitleStyle = (isDark, isSelected, customColors) => `font-size:13p
|
|
|
10293
10825
|
var mobileBackButtonStyle = (isDark, customColors) => `position:absolute;top:10px;left:10px;z-index:90;display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:18px;background:${isDark ? "rgba(30,30,30,0.9)" : "rgba(255,255,255,0.9)"};color:${customColors?.text ?? (isDark ? "#f4f4f4" : "#111827")};border:1px solid ${isDark ? "#444" : "#e5e7eb"};box-shadow:0 2px 8px rgba(0,0,0,0.15);cursor:pointer;font-size:12px;font-weight:600;backdrop-filter:blur(4px)`;
|
|
10294
10826
|
var mobileFullListStyle = (isDark, customColors) => `display:flex;flex-direction:column;width:100%;height:100%;min-height:0;background:${customColors?.background ?? (isDark ? "#111110" : "#f6f4ee")};font-family:sans-serif;box-sizing:border-box`;
|
|
10295
10827
|
var mainChatContainerStyle = "display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;overflow:hidden;position:relative";
|
|
10296
|
-
var chatsIconSvg =
|
|
10828
|
+
var chatsIconSvg = html12`
|
|
10297
10829
|
<svg
|
|
10298
10830
|
width="14"
|
|
10299
10831
|
height="14"
|
|
@@ -10307,7 +10839,7 @@ var chatsIconSvg = html11`
|
|
|
10307
10839
|
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
|
10308
10840
|
</svg>
|
|
10309
10841
|
`;
|
|
10310
|
-
var notFoundHtml = (customColors, isDark) =>
|
|
10842
|
+
var notFoundHtml = (customColors, isDark) => html12`
|
|
10311
10843
|
<div
|
|
10312
10844
|
style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;color:${customColors?.text ?? "#6b7280"};background:${customColors?.background ?? (isDark ? "#111" : "#f9fafb")};font-family:sans-serif"
|
|
10313
10845
|
>
|
|
@@ -10318,7 +10850,7 @@ var notFoundHtml = (customColors, isDark) => html11`
|
|
|
10318
10850
|
<div style="font-size:0.9rem">This conversation does not exist.</div>
|
|
10319
10851
|
</div>
|
|
10320
10852
|
`;
|
|
10321
|
-
var accessDeniedHtml = (onClose, customColors, isDark) =>
|
|
10853
|
+
var accessDeniedHtml = (onClose, customColors, isDark) => html12`
|
|
10322
10854
|
<div
|
|
10323
10855
|
style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;color:${customColors?.text ?? "#6b7280"};background:${customColors?.background ?? (isDark ? "#111" : "#f9fafb")};font-family:sans-serif"
|
|
10324
10856
|
>
|
|
@@ -10329,7 +10861,7 @@ var accessDeniedHtml = (onClose, customColors, isDark) => html11`
|
|
|
10329
10861
|
<div style="font-size:0.9rem">
|
|
10330
10862
|
You do not have the encryption keys for this conversation.
|
|
10331
10863
|
</div>
|
|
10332
|
-
${onClose ?
|
|
10864
|
+
${onClose ? html12`
|
|
10333
10865
|
<button
|
|
10334
10866
|
type="button"
|
|
10335
10867
|
@click="${onClose}"
|
|
@@ -11491,7 +12023,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11491
12023
|
};
|
|
11492
12024
|
_renderConversationList(isDark) {
|
|
11493
12025
|
if (!this._conversations) {
|
|
11494
|
-
return
|
|
12026
|
+
return html12`
|
|
11495
12027
|
<div style="font-size:12px;color:${isDark ? "#888" : "#999"};padding:16px;text-align:center">
|
|
11496
12028
|
Loading chats...
|
|
11497
12029
|
</div>
|
|
@@ -11500,7 +12032,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11500
12032
|
const myKey = this.credentials?.publicSignKey ?? "";
|
|
11501
12033
|
const filtered = this._filteredConversations();
|
|
11502
12034
|
if (empty(filtered)) {
|
|
11503
|
-
return
|
|
12035
|
+
return html12`
|
|
11504
12036
|
<div style="font-size:12px;color:${isDark ? "#888" : "#999"};padding:16px;text-align:center">
|
|
11505
12037
|
No chats found
|
|
11506
12038
|
</div>
|
|
@@ -11533,7 +12065,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11533
12065
|
}) : null;
|
|
11534
12066
|
const timeLabel = preview?.empty ? "" : formatConversationTime(preview?.timestamp || conv.updatedAt);
|
|
11535
12067
|
const isPinned = isConversationPinned(conv);
|
|
11536
|
-
return
|
|
12068
|
+
return html12`
|
|
11537
12069
|
<div
|
|
11538
12070
|
class="alice-sidebar-item"
|
|
11539
12071
|
data-conversation-id="${conv.id}"
|
|
@@ -11550,7 +12082,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11550
12082
|
></chat-avatar>
|
|
11551
12083
|
<div style="${sidebarItemBodyStyle}">
|
|
11552
12084
|
<div style="${sidebarItemTopRowStyle}">
|
|
11553
|
-
${this._editingSidebarConvId === conv.id ?
|
|
12085
|
+
${this._editingSidebarConvId === conv.id ? html12`
|
|
11554
12086
|
<input
|
|
11555
12087
|
type="text"
|
|
11556
12088
|
data-testid="sidebar-rename-input"
|
|
@@ -11563,11 +12095,11 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11563
12095
|
@keydown="${this._onSidebarRenameKeydown}"
|
|
11564
12096
|
@blur="${this._commitSidebarRename}"
|
|
11565
12097
|
/>
|
|
11566
|
-
` :
|
|
12098
|
+
` : html12`
|
|
11567
12099
|
<div style="${sidebarItemTitleStyle(isDark, isSelected, this.customColors)}">
|
|
11568
12100
|
${displayName}
|
|
11569
12101
|
</div>
|
|
11570
|
-
`} ${timeLabel && this._editingSidebarConvId !== conv.id ?
|
|
12102
|
+
`} ${timeLabel && this._editingSidebarConvId !== conv.id ? html12`
|
|
11571
12103
|
<span style="${sidebarItemTimeStyle(isDark)}">${timeLabel}</span>
|
|
11572
12104
|
` : nothing6}
|
|
11573
12105
|
</div>
|
|
@@ -11580,20 +12112,20 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11580
12112
|
</div>
|
|
11581
12113
|
<span
|
|
11582
12114
|
style="display:inline-flex;align-items:center;gap:6px;flex-shrink:0">
|
|
11583
|
-
${isPinned ?
|
|
12115
|
+
${isPinned ? html12`
|
|
11584
12116
|
<span
|
|
11585
12117
|
data-testid="conversation-pin-indicator"
|
|
11586
12118
|
aria-label="Pinned"
|
|
11587
12119
|
style="${sidebarPinnedIndicatorStyle(isDark)}"
|
|
11588
12120
|
>${sidebarPinSvg}</span>
|
|
11589
12121
|
` : nothing6}
|
|
11590
|
-
${unread.isUnread ? unreadLabel ?
|
|
12122
|
+
${unread.isUnread ? unreadLabel ? html12`
|
|
11591
12123
|
<span
|
|
11592
12124
|
data-testid="conversation-unread-badge"
|
|
11593
12125
|
aria-label="${unread.count === 1 ? "1 unread message" : `${unreadLabel} unread messages`}"
|
|
11594
12126
|
style="${sidebarUnreadBadgeStyle(isDark)}"
|
|
11595
12127
|
>${unreadLabel}</span>
|
|
11596
|
-
` :
|
|
12128
|
+
` : html12`
|
|
11597
12129
|
<span
|
|
11598
12130
|
data-testid="conversation-unread-badge"
|
|
11599
12131
|
data-unread-dot
|
|
@@ -11623,7 +12155,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11623
12155
|
_renderChatContent(isDark) {
|
|
11624
12156
|
const targetId = this._activeConversationId || this.conversationId;
|
|
11625
12157
|
if (!targetId) {
|
|
11626
|
-
return
|
|
12158
|
+
return html12`
|
|
11627
12159
|
<div
|
|
11628
12160
|
style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;color:${this.customColors?.text ?? (isDark ? "#888" : "#999")};background:${this.customColors?.background ?? (isDark ? "#111" : "#f9fafb")};font-family:sans-serif"
|
|
11629
12161
|
>
|
|
@@ -11639,7 +12171,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11639
12171
|
}
|
|
11640
12172
|
const { chatMessages, activeSpinners, activeProgress, activeStreams } = this._processMessages();
|
|
11641
12173
|
const isLoadingMessages = !this._messages || !this._hasFreshMessages && this._isSyncingMessages;
|
|
11642
|
-
return
|
|
12174
|
+
return html12`
|
|
11643
12175
|
<chat-box
|
|
11644
12176
|
.messages="${chatMessages}"
|
|
11645
12177
|
.participants="${this._participants.map((p) => ({
|
|
@@ -11706,8 +12238,8 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11706
12238
|
return nothing6;
|
|
11707
12239
|
}
|
|
11708
12240
|
const isDark = this._effectiveDark;
|
|
11709
|
-
const renderPopups = () =>
|
|
11710
|
-
${this._profileAuthorId ?
|
|
12241
|
+
const renderPopups = () => html12`
|
|
12242
|
+
${this._profileAuthorId ? html12`
|
|
11711
12243
|
<user-profile-popup
|
|
11712
12244
|
.authorId="${this._profileAuthorId}"
|
|
11713
12245
|
.authorName="${resolveName(this._identityDetails)(this._profileAuthorId)}"
|
|
@@ -11716,7 +12248,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11716
12248
|
.onClose="${this._closeProfile}"
|
|
11717
12249
|
.onChatWith="${this.onChatWith ?? (this.enableChatSwitching ? this._handleChatWith : void 0)}"
|
|
11718
12250
|
></user-profile-popup>
|
|
11719
|
-
` : nothing6} ${this._showParticipantsPopup ?
|
|
12251
|
+
` : nothing6} ${this._showParticipantsPopup ? html12`
|
|
11720
12252
|
<div style="${participantsOverlayStyle}" @click="${this._handleCloseParticipants}">
|
|
11721
12253
|
<div style="${participantsPopupStyle(isDark)}" @click="${(e) => e.stopPropagation()}">
|
|
11722
12254
|
<h3 style="${popupTitleStyle(isDark)}">Participants</h3>
|
|
@@ -11726,7 +12258,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11726
12258
|
const avatar = resolveParticipantAvatar(p, this._identityDetails);
|
|
11727
12259
|
const baseColor = avatarColor(p.publicSignKey, isDark);
|
|
11728
12260
|
const isCopied = this._copiedParticipantId === p.publicSignKey;
|
|
11729
|
-
return
|
|
12261
|
+
return html12`
|
|
11730
12262
|
<div
|
|
11731
12263
|
style="${participantRowStyle(isDark)}"
|
|
11732
12264
|
@click="${() => this._handleParticipantClick(p.publicSignKey)}"
|
|
@@ -11771,7 +12303,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11771
12303
|
</button>
|
|
11772
12304
|
</div>
|
|
11773
12305
|
</div>
|
|
11774
|
-
` : nothing6} ${this._showSecretIdentityPopup && this.credentials ?
|
|
12306
|
+
` : nothing6} ${this._showSecretIdentityPopup && this.credentials ? html12`
|
|
11775
12307
|
<div style="${participantsOverlayStyle}" @click="${() => {
|
|
11776
12308
|
this._showSecretIdentityPopup = false;
|
|
11777
12309
|
this.requestUpdate();
|
|
@@ -11785,13 +12317,13 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11785
12317
|
<div
|
|
11786
12318
|
style="display:flex;justify-content:center;align-items:center;width:200px;height:200px;background:#ffffff;border-radius:8px;padding:8px;margin: 0 auto;"
|
|
11787
12319
|
>
|
|
11788
|
-
${this._qrCodeDataUrl ?
|
|
12320
|
+
${this._qrCodeDataUrl ? html12`
|
|
11789
12321
|
<img
|
|
11790
12322
|
src="${this._qrCodeDataUrl}"
|
|
11791
12323
|
alt="Export Identity QR Code"
|
|
11792
12324
|
style="width:100%;height:100%"
|
|
11793
12325
|
/>
|
|
11794
|
-
` :
|
|
12326
|
+
` : html12`
|
|
11795
12327
|
<div style="color:#000000;font-size:14px">Generating...</div>
|
|
11796
12328
|
`}
|
|
11797
12329
|
</div>
|
|
@@ -11819,7 +12351,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11819
12351
|
</div>
|
|
11820
12352
|
</div>
|
|
11821
12353
|
</div>
|
|
11822
|
-
` : nothing6} ${this._showImportIdentityPopup ?
|
|
12354
|
+
` : nothing6} ${this._showImportIdentityPopup ? html12`
|
|
11823
12355
|
<div style="${participantsOverlayStyle}" @click="${() => {
|
|
11824
12356
|
this._showImportIdentityPopup = false;
|
|
11825
12357
|
this.requestUpdate();
|
|
@@ -11863,12 +12395,12 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11863
12395
|
` : nothing6}
|
|
11864
12396
|
`;
|
|
11865
12397
|
if (!this.enableChatSwitching) {
|
|
11866
|
-
return
|
|
12398
|
+
return html12`
|
|
11867
12399
|
${this._renderChatContent(isDark)} ${renderPopups()}
|
|
11868
12400
|
`;
|
|
11869
12401
|
}
|
|
11870
12402
|
if (this._isMobile && this._mobileShowList) {
|
|
11871
|
-
return
|
|
12403
|
+
return html12`
|
|
11872
12404
|
<style>${sidebarHoverStyles}</style>
|
|
11873
12405
|
<div style="${mobileFullListStyle(isDark, this.customColors)}">
|
|
11874
12406
|
<div style="${sidebarHeaderStyle(isDark)}">
|
|
@@ -11891,7 +12423,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11891
12423
|
`;
|
|
11892
12424
|
}
|
|
11893
12425
|
if (this._isMobile && !this._mobileShowList) {
|
|
11894
|
-
return
|
|
12426
|
+
return html12`
|
|
11895
12427
|
<div style="${mainChatContainerStyle}">
|
|
11896
12428
|
<button
|
|
11897
12429
|
type="button"
|
|
@@ -11910,7 +12442,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11910
12442
|
${renderPopups()}
|
|
11911
12443
|
`;
|
|
11912
12444
|
}
|
|
11913
|
-
return
|
|
12445
|
+
return html12`
|
|
11914
12446
|
<style>${sidebarHoverStyles}</style>
|
|
11915
12447
|
<div style="${chatSwitcherContainerStyle}">
|
|
11916
12448
|
<div
|
|
@@ -12718,7 +13250,7 @@ import { createComponent } from "@lit/react";
|
|
|
12718
13250
|
import React from "react";
|
|
12719
13251
|
|
|
12720
13252
|
// canvas/canvas-view.ts
|
|
12721
|
-
import { html as
|
|
13253
|
+
import { html as html13, LitElement as LitElement11, nothing as nothing7 } from "lit";
|
|
12722
13254
|
var toastLifetimeMs = 5e3;
|
|
12723
13255
|
var canvasViewCss = (isDark) => `
|
|
12724
13256
|
.canvas-view {
|
|
@@ -12912,7 +13444,7 @@ var sanitizeCanvasClassName = (raw) => (raw ?? "").split(/\s+/).filter((token) =
|
|
|
12912
13444
|
var isExternalCanvasHref = (href) => href.startsWith("https://") || href.startsWith("http://");
|
|
12913
13445
|
var renderNode = (node, onAction) => {
|
|
12914
13446
|
if (typeof node === "string" || typeof node === "number") {
|
|
12915
|
-
return
|
|
13447
|
+
return html13`${node}`;
|
|
12916
13448
|
}
|
|
12917
13449
|
const tag = node.tag.toLowerCase();
|
|
12918
13450
|
if (!isRenderableTag(tag)) return nothing7;
|
|
@@ -12927,25 +13459,25 @@ var renderNode = (node, onAction) => {
|
|
|
12927
13459
|
onAction(node.on.submit, collectFields(e.currentTarget));
|
|
12928
13460
|
} : void 0;
|
|
12929
13461
|
if (tag === "button") {
|
|
12930
|
-
return
|
|
13462
|
+
return html13`
|
|
12931
13463
|
<button dir="auto" class="canvas-el ${className}" type="button"
|
|
12932
13464
|
@click=${clickHandler}>${node.text ?? nothing7}${children}</button>
|
|
12933
13465
|
`;
|
|
12934
13466
|
}
|
|
12935
13467
|
if (tag === "form") {
|
|
12936
|
-
return
|
|
13468
|
+
return html13`
|
|
12937
13469
|
<form dir="auto" class="canvas-el ${className}"
|
|
12938
13470
|
@submit=${submitHandler}>${node.text ?? nothing7}${children}</form>
|
|
12939
13471
|
`;
|
|
12940
13472
|
}
|
|
12941
13473
|
if (tag === "input") {
|
|
12942
|
-
return
|
|
13474
|
+
return html13`
|
|
12943
13475
|
<input dir="auto" class="canvas-el ${className}" name=${node.attrs?.name ?? nothing7}
|
|
12944
13476
|
placeholder=${node.attrs?.placeholder ?? nothing7} .value=${node.attrs?.value ?? ""} />
|
|
12945
13477
|
`;
|
|
12946
13478
|
}
|
|
12947
13479
|
if (tag === "textarea") {
|
|
12948
|
-
return
|
|
13480
|
+
return html13`
|
|
12949
13481
|
<textarea dir="auto" class="canvas-el ${className}" name=${node.attrs?.name ?? nothing7}
|
|
12950
13482
|
placeholder=${node.attrs?.placeholder ?? nothing7}>${node.text ?? ""}</textarea>
|
|
12951
13483
|
`;
|
|
@@ -12953,7 +13485,7 @@ var renderNode = (node, onAction) => {
|
|
|
12953
13485
|
if (tag === "a") {
|
|
12954
13486
|
const safeHref = sanitizeViewUrl(node.attrs?.href, "#");
|
|
12955
13487
|
const external = isExternalCanvasHref(safeHref);
|
|
12956
|
-
return
|
|
13488
|
+
return html13`
|
|
12957
13489
|
<a dir="auto" class="canvas-el ${className}" href=${safeHref}
|
|
12958
13490
|
target=${external ? "_blank" : nothing7}
|
|
12959
13491
|
rel=${external ? "noopener noreferrer" : nothing7}
|
|
@@ -12961,75 +13493,75 @@ var renderNode = (node, onAction) => {
|
|
|
12961
13493
|
`;
|
|
12962
13494
|
}
|
|
12963
13495
|
if (tag === "img") {
|
|
12964
|
-
return
|
|
13496
|
+
return html13`<img class="canvas-el ${className}" src=${sanitizeViewUrl(node.attrs?.src, "")} alt=${node.attrs?.alt ?? ""} />`;
|
|
12965
13497
|
}
|
|
12966
13498
|
if (tag === "label") {
|
|
12967
|
-
return
|
|
13499
|
+
return html13`
|
|
12968
13500
|
<label dir="auto" class="canvas-el ${className}"
|
|
12969
13501
|
for=${node.attrs?.for ?? nothing7}>${node.text ?? nothing7}${children}</label>
|
|
12970
13502
|
`;
|
|
12971
13503
|
}
|
|
12972
13504
|
if (tag === "h1") {
|
|
12973
|
-
return
|
|
13505
|
+
return html13`<h1 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h1>`;
|
|
12974
13506
|
}
|
|
12975
13507
|
if (tag === "h2") {
|
|
12976
|
-
return
|
|
13508
|
+
return html13`<h2 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h2>`;
|
|
12977
13509
|
}
|
|
12978
13510
|
if (tag === "h3") {
|
|
12979
|
-
return
|
|
13511
|
+
return html13`<h3 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h3>`;
|
|
12980
13512
|
}
|
|
12981
13513
|
if (tag === "h4") {
|
|
12982
|
-
return
|
|
13514
|
+
return html13`<h4 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h4>`;
|
|
12983
13515
|
}
|
|
12984
13516
|
if (tag === "p") {
|
|
12985
|
-
return
|
|
13517
|
+
return html13`<p dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</p>`;
|
|
12986
13518
|
}
|
|
12987
13519
|
if (tag === "span") {
|
|
12988
|
-
return
|
|
13520
|
+
return html13`<span dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</span>`;
|
|
12989
13521
|
}
|
|
12990
13522
|
if (tag === "strong") {
|
|
12991
|
-
return
|
|
13523
|
+
return html13`<strong dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</strong>`;
|
|
12992
13524
|
}
|
|
12993
13525
|
if (tag === "em") {
|
|
12994
|
-
return
|
|
13526
|
+
return html13`<em dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</em>`;
|
|
12995
13527
|
}
|
|
12996
13528
|
if (tag === "small") {
|
|
12997
|
-
return
|
|
13529
|
+
return html13`<small dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</small>`;
|
|
12998
13530
|
}
|
|
12999
13531
|
if (tag === "ul") {
|
|
13000
|
-
return
|
|
13532
|
+
return html13`<ul dir="auto" class="canvas-el ${className}">${children}</ul>`;
|
|
13001
13533
|
}
|
|
13002
13534
|
if (tag === "li") {
|
|
13003
|
-
return
|
|
13535
|
+
return html13`<li dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</li>`;
|
|
13004
13536
|
}
|
|
13005
13537
|
if (tag === "code") {
|
|
13006
|
-
return
|
|
13538
|
+
return html13`<code dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</code>`;
|
|
13007
13539
|
}
|
|
13008
13540
|
if (tag === "pre") {
|
|
13009
|
-
return
|
|
13541
|
+
return html13`<pre dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</pre>`;
|
|
13010
13542
|
}
|
|
13011
13543
|
if (tag === "blockquote") {
|
|
13012
|
-
return
|
|
13544
|
+
return html13`
|
|
13013
13545
|
<blockquote dir="auto"
|
|
13014
13546
|
class="canvas-el ${className}">${node.text ?? nothing7}${children}</blockquote>
|
|
13015
13547
|
`;
|
|
13016
13548
|
}
|
|
13017
13549
|
if (tag === "section") {
|
|
13018
|
-
return
|
|
13550
|
+
return html13`<section dir="auto" class="canvas-el ${className}">${children}</section>`;
|
|
13019
13551
|
}
|
|
13020
13552
|
if (tag === "header") {
|
|
13021
|
-
return
|
|
13553
|
+
return html13`<header dir="auto" class="canvas-el ${className}">${children}</header>`;
|
|
13022
13554
|
}
|
|
13023
13555
|
if (tag === "footer") {
|
|
13024
|
-
return
|
|
13556
|
+
return html13`<footer dir="auto" class="canvas-el ${className}">${children}</footer>`;
|
|
13025
13557
|
}
|
|
13026
13558
|
if (tag === "nav") {
|
|
13027
|
-
return
|
|
13559
|
+
return html13`<nav dir="auto" class="canvas-el ${className}">${children}</nav>`;
|
|
13028
13560
|
}
|
|
13029
13561
|
if (tag === "main") {
|
|
13030
|
-
return
|
|
13562
|
+
return html13`<main dir="auto" class="canvas-el ${className}">${children}</main>`;
|
|
13031
13563
|
}
|
|
13032
|
-
return
|
|
13564
|
+
return html13`<div dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</div>`;
|
|
13033
13565
|
};
|
|
13034
13566
|
var problemText = (problems) => problems.map((problem) => `${problem.stage}: ${problem.message}`).join("\n\n");
|
|
13035
13567
|
var messageToast = (text, authorName) => authorName ? `${authorName}: ${text}` : text;
|
|
@@ -13236,22 +13768,22 @@ var CanvasView = class extends LitElement11 {
|
|
|
13236
13768
|
}
|
|
13237
13769
|
render() {
|
|
13238
13770
|
const onAction = (action, fields) => this._act(action, fields);
|
|
13239
|
-
return
|
|
13771
|
+
return html13`
|
|
13240
13772
|
<style>${canvasViewCss(this.isDark)}</style>
|
|
13241
13773
|
<div class="canvas-view">
|
|
13242
|
-
${this._toasts.length === 0 ? nothing7 :
|
|
13774
|
+
${this._toasts.length === 0 ? nothing7 : html13`
|
|
13243
13775
|
<div class="canvas-view-toasts">
|
|
13244
|
-
${this._toasts.map((toast) =>
|
|
13776
|
+
${this._toasts.map((toast) => html13`
|
|
13245
13777
|
<div class="canvas-view-toast" .dataId=${toast.id}>${toast.text}</div>
|
|
13246
13778
|
`)}
|
|
13247
13779
|
</div>
|
|
13248
13780
|
`}
|
|
13249
|
-
${this._problems.length === 0 ? nothing7 :
|
|
13781
|
+
${this._problems.length === 0 ? nothing7 : html13`
|
|
13250
13782
|
<div class="canvas-view-error">${problemText(this._problems)}</div>
|
|
13251
13783
|
`}
|
|
13252
|
-
${this._view ?
|
|
13784
|
+
${this._view ? html13`<div class="canvas-view-body">
|
|
13253
13785
|
${renderNode(this._view, onAction)}
|
|
13254
|
-
</div>` :
|
|
13786
|
+
</div>` : html13`<div class="canvas-view-empty">${this.emptyMessage}</div>`}
|
|
13255
13787
|
</div>
|
|
13256
13788
|
`;
|
|
13257
13789
|
}
|