Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4707c4e8e | ||
|
|
a4c9e7e102 | ||
|
|
21085b967d | ||
|
|
d0202247ce | ||
|
|
e4681bef35 | ||
|
|
f618d8bce9 | ||
|
|
3ee2bef7ce |
No files matched your search
@@ -1,5 +1,22 @@
|
||||
# Changelog
|
||||
|
||||
## 0.1.7 — 2026-11-02
|
||||
|
||||
- Matched light-theme toolbar/header/composer icon colors, header separators and chevron placement
|
||||
to the installed reference. Corrected narrow chat width and input placeholder spacing.
|
||||
All eight main-screen EN/RU, dark/light and wide/narrow fixture comparisons passed; this does not
|
||||
establish whole-client parity or native-platform interoperability.
|
||||
- Replaced the plain chat textarea with one local CodeMirror editor and the persisted Rich Text Editor
|
||||
toggle. Hybrid preview uses the existing safe TS Markdown renderer; switching modes retains text,
|
||||
selection and undo, while switching conversations isolates draft history. Toolbar/slash/emoji edits,
|
||||
Enter/Shift+Enter, IME and refused-send preservation were exercised in the packaged offscreen app.
|
||||
Constructed stylesheets keep the application CSP strict; no inline-style exception was added.
|
||||
- Added the original editor's bold, italic, link, inline-code and code-block keyboard bindings.
|
||||
Corrected the notification output selector's missing bottom margin using the original component rule.
|
||||
- Matched list/quote authoring controls: Shift+Enter continuation, ordered/task item transitions,
|
||||
Tab/Shift+Tab indentation, empty-item exit and Escape-then-Tab focus escape. Fenced code is not
|
||||
mistaken for a list; quoted fences retain their quote prefix.
|
||||
|
||||
## 0.1.6 — 2026-11-02
|
||||
|
||||
Current development snapshot; full visual parity and native Asahi verification remain unfinished.
|
||||
|
||||
@@ -17,6 +17,7 @@ the exact build hashes and limits are in `docs/evidence/official-parity/qa-parit
|
||||
| Server icons and snapshot transfer ownership | Main/renderer consumer tests cover session grants, reconnect, partial failure and recycled transfer IDs | No successful live server icon mutation is claimed |
|
||||
| Local contacts and public badges | Model/prefs/catalog tests and actual contact add/alias/restart passed; offline state is retained honestly | Not cloud contacts, badge ownership/redeeming or global presence |
|
||||
| Rich chat | Actual history IPC/restart, scope isolation and local KaTeX/Mermaid hydration passed | Synthetic messages, no server traffic; sandbox permissions tested separately |
|
||||
| Rich-text composer (post-release development) | Real packaged typing, formatting, emoji/slash completion, raw/hybrid settings, selection/undo, conversation isolation, refused sends and IME passed; hostile preview stayed inert with zero network requests | Windows hidden runtime only; the separate v0.1.6 release does not include this post-cut feature |
|
||||
| Identity related bookmarks | Actual nested/default assignment display and nickname-clearing restart passed without changing UID | The original identity component exposes ordinary nickname, not a separate editable phonetic field |
|
||||
| Whisper manager and history | Actual hidden UI with synthetic events passed overlay switching, preview, session/recycled-ID cleanup and received-history handling | No live whisper delivery proof; two microphone attempts were refused by the test stub |
|
||||
| Changelog and licenses | Actual packaged list/detail navigation and focus restoration passed after fixing stringified DOM arrays | Displays this installation's documents, not TeamSpeak service terms |
|
||||
@@ -79,10 +80,11 @@ unless stated. No new live-server mutation or physical media capture is part of
|
||||
|
||||
## Earlier account-free acceptance checkpoint (2026-11-01)
|
||||
|
||||
Scope is strictly local/server functionality without an account; myTeamSpeak/cloud/Matrix services and
|
||||
Remote Apps integration are excluded by instruction. No account UI is substituted for a missing local
|
||||
feature. Tests use disposable state and controlled inputs. A protocol unit fixture is not a real server
|
||||
interoperability claim, and synthetic renderer IPC is never described as native transaction success.
|
||||
Scope is strictly local/server functionality without an account; central myTeamSpeak/homebase services and
|
||||
Remote Apps integration are excluded by instruction. Server-hosted `MATRIXCHAT` is not an account-only
|
||||
exception: its native transport remains unimplemented (see below). No account UI is substituted for a
|
||||
missing local feature. Tests use disposable state and controlled inputs; protocol fixtures do not establish
|
||||
real server interoperability, and synthetic renderer IPC is never native transaction success.
|
||||
|
||||
Current exercised gates: **318 Node consumer tests passed**, one deliberately skipped live release-list
|
||||
test; **152 native unit tests passed**, one optional external-PCM audit ignored; **5 native stdio bridge
|
||||
@@ -115,11 +117,11 @@ reference's source-observed 260 px popup modifier; this is not whole-image or wh
|
||||
| Legacy files, opaque chooser capabilities, commit/cancel/no-overwrite, global settings | AstraFiles | Real loopback TCP byte/hash/pacing/cancellation tests and main/renderer/scheduler consumer suites passed | HTTPFT/S3 explicitly unsupported; no speculative fallback; filesystem hard-link requirement fails safely |
|
||||
| Recording/WAV timing, tracks, pause/finalize, notification log/matrix, OS local settings | AstraRecordThemes | Generated native PCM/WAV tests and main/renderer policy suites passed | No real microphone, OS startup/lock action, notification sound or private recording exercised |
|
||||
| Local themes and appearance options | AstraRecordThemes / AstraVisual | Functional confinement suites and real selected CSS/font/image/restart/denied-remote smoke passed; actual settings pixels inspected | Package/token compatibility only, not official DOM-class compatibility |
|
||||
| Local history, safe rich chat, drafts/unread, links/images, file attachments | AstraChat | Main/parser suites; actual 621-row history IPC/restart, local KaTeX/Mermaid and inert malicious-content smoke passed | Non-own-channel legacy text delivery unverified; no Matrix/cloud edit/reactions/read receipts |
|
||||
| Local history, safe rich chat, drafts/unread, links/images, file attachments | AstraChat | Main/parser suites; actual 621-row history IPC/restart, local KaTeX/Mermaid and inert malicious-content smoke passed | Non-own-channel legacy delivery unverified; central chat excluded, server-hosted Matrix room actions missing |
|
||||
| P2P stream extras, layout, internal/standalone popout and publishing controls | AstraStreams | 249 generated-media stage checks; actual sender→receiver video/Opus, admission, rate changes, pause, ban and cleanup passed | macOS selected-application audio unimplemented; standalone viewport emulation limitation below; no live SFU claim |
|
||||
| Official visual system and EN/RU catalogs | AstraVisual / AstraQA | All twelve settings categories EN/RU/restart; actual full three-pane/settings/menu pixels reviewed; 224 class-matched metrics passed | Historical 22/22 source-reference probes are not whole-client identity |
|
||||
|
||||
The complete **38-row original feature inventory**, owner, evidence and exclusions is
|
||||
The original feature inventory, owners, evidence and corrected exclusions are in
|
||||
[`docs/evidence/official-parity/final-feature-matrix.json`](docs/evidence/official-parity/final-feature-matrix.json).
|
||||
Consolidated results and exact package hashes: `qa-final/verification.json` and `qa-final/package-manifest.json`
|
||||
under the evidence root above. The isolated package is `build/win-unpacked/TeamsPeach.exe`; no installer
|
||||
@@ -127,6 +129,22 @@ was run, no version was changed and nothing was published.
|
||||
|
||||
## Remaining implementation gaps and external verification prerequisites
|
||||
|
||||
Authorized live check on 2026-11-02: `server_info` and the resulting snapshot from 10.10.10.160:9987
|
||||
announced P2P=true and Matrix/SFU/HTTPFT/S3=false to core 0.1.6. Both mute flags were confirmed.
|
||||
Two temporary identities disconnected cleanly and their local profiles were removed; no token,
|
||||
invitation, media or server-setting mutation was attempted. This is a per-client/session advertisement,
|
||||
not a claim about every server configuration. Evidence: `docs/evidence/official-parity/server-sfu-prerequisite.json`.
|
||||
|
||||
- **Server-hosted Matrix chat:** static frontend review on 2026-11-02 corrects the earlier blanket Matrix
|
||||
exclusion. `MATRIXCHAT` selects a server-identity participation, separate from account/homebase login.
|
||||
It supports channel/private rooms, invitation accept/reject and room-based edit/reply/reactions;
|
||||
pinning is non-direct-room-only and other actions remain permission/event-dependent. Static native
|
||||
constructors establish `chatlogintoken`, `notifychatlogintoken token=...` and
|
||||
`requestchat type=private clid=<uint16>`, but well-known binding, token-to-Matrix login/renewal,
|
||||
device/session lifecycle, server UUID derivation and sync/event envelopes remain unresolved.
|
||||
No authenticated native/server-room exchange has been captured. Generic Matrix login is not a valid
|
||||
substitute, and no inert setting or room-action controls are added. Exact source chain and scope:
|
||||
`docs/evidence/official-parity/ts6spec-chat.md`, section 0.
|
||||
- **SFU:** `docs/evidence/official-parity/sfu-native-inspection.json` and
|
||||
`docs/evidence/official-parity/sfu-request-construction.json` recover command/envelope fields,
|
||||
not authoritative token origin/renewal, exact optional/value branches or a proved mediasoup-to-Chromium
|
||||
|
||||
@@ -151,8 +151,10 @@ attached with a `local` designation and a `*-build-info.txt` provenance file.
|
||||
10. Chat history is local and separated by own identity, server and channel/peer identity. Drafts and
|
||||
unread state are connection-local. Rich text, local math/diagrams, emoji and server-file links do not
|
||||
require cloud services. Remote images require explicit consent; trusted external sites can be removed
|
||||
in Settings → Privacy. Matrix/cloud edits, reactions, read receipts and cloud contacts are outside
|
||||
the account-free scope; local UID contacts are separate.
|
||||
in Settings → Privacy. Central myTeamSpeak/homebase chat and cloud contacts are outside the account-free
|
||||
scope. Server-hosted Matrix rooms on `MATRIXCHAT` servers are a separate, unimplemented transport:
|
||||
their frontend uses the server identity, but native endpoint discovery, authentication and invite requests
|
||||
remain unresolved. They are not excluded merely because they share Matrix room controls. Local UID contacts are separate.
|
||||
11. Streams support hide/show without unsubscribing, ordering, focus with a secondary strip, pages,
|
||||
an internal tile overlay and moving the existing stage over the server tree. Publisher admission,
|
||||
kick/ban/unblock, pause and live options keep the original tracks/sessions. Standalone pop-out reuses
|
||||
|
||||
+10
-4
@@ -5,6 +5,7 @@
|
||||
* near offset 4873300; defaults from workflowSettings class `Xe` and appearanceSettings class `qe`).
|
||||
*
|
||||
* Official key → TeamsPeach key default
|
||||
* workflowSettings.useRichTextEditor → chatRichTextEditor true
|
||||
* appearanceSettings.chat_input_toolbar_visibility → chatToolbarVisibility 'always-visible'
|
||||
* appearanceSettings.chat_mermaid_autoload_mode → chatMermaidAutoload 'only-simple'
|
||||
* workflowSettings.openIncomingChats → chatOpenIncoming true
|
||||
@@ -13,10 +14,14 @@
|
||||
* workflowSettings.autoDownloadImages → autoDownloadImages false
|
||||
* chat-server ignore list (per myTeamSpeak chat connection) → chatIgnoredUsers [] (local, keyed by client UID)
|
||||
*
|
||||
* Not modelled because TeamsPeach has no backing feature: useRichTextEditor (the composer is a plain
|
||||
* textarea), autoAcceptIncomingDirectChats (TS6-server decentral chat invitations), useChatsHistory and
|
||||
* sort_contacts_alphabetically / show_offline_contacts / group_offline_contacts (myTeamSpeak contacts and
|
||||
* group chats).
|
||||
* chatRichTextEditor switches the one composer editor between hybrid Markdown preview and raw source
|
||||
* (main.js@1298380 default true, @3520977 hybridMarkdown enablePreview:useRichTextEditing).
|
||||
*
|
||||
* autoAcceptIncomingDirectChats belongs to server-hosted MATRIXCHAT invitations, not central account chat.
|
||||
* Its official frontend uses the server identity without a myTeamSpeak gate; TeamsPeach still lacks the
|
||||
* native discovery/login/invite transport, so no nonfunctional toggle is exposed here.
|
||||
* useChatsHistory and sort_contacts_alphabetically / show_offline_contacts / group_offline_contacts
|
||||
* refer to the separate myTeamSpeak/homebase contacts and group chats.
|
||||
*/
|
||||
|
||||
const MAX_IGNORED_USERS = 1000;
|
||||
@@ -48,6 +53,7 @@ function validIgnoredUsers(list) {
|
||||
}
|
||||
|
||||
const CHAT_SCHEMA = {
|
||||
chatRichTextEditor: { default: true, check: isBool },
|
||||
chatToolbarVisibility: { default: 'always-visible', check: (v) => v === 'inactive' || v === 'dynamic' || v === 'always-visible' },
|
||||
chatMermaidAutoload: { default: 'only-simple', check: (v) => v === 'never' || v === 'only-simple' },
|
||||
chatOpenIncoming: { default: true, check: isBool },
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<link rel="stylesheet" href="styles/privacy.css">
|
||||
<link rel="stylesheet" href="styles/information-panels.css">
|
||||
<link rel="stylesheet" href="styles/chat-options.css">
|
||||
<link rel="stylesheet" href="styles/chat-editor.css">
|
||||
<link rel="stylesheet" href="styles/keybinds.css">
|
||||
<link rel="stylesheet" href="styles/whisper.css">
|
||||
<link rel="stylesheet" href="styles/contacts.css">
|
||||
@@ -492,7 +493,8 @@
|
||||
<button id="chat-format-more" class="composer-tool is-overflow" type="button" aria-haspopup="menu" aria-expanded="false" hidden><svg class="icon" aria-hidden="true"><use href="#i-chevron-right"/></svg><span class="composer-tool-text" data-i18n="chat.toolbar.more">More</span></button>
|
||||
</div>
|
||||
<div class="composer-row">
|
||||
<textarea id="chat-input" rows="1" aria-label="Message" data-i18n-aria-label="ui.message" placeholder="Message" data-i18n-placeholder="ui.message"></textarea>
|
||||
<!-- chat-input render @3561667: TSChatInputTextarea hosts one CodeMirror view (hybrid/raw, main.js@3520977); its contentDOM is #chat-input -->
|
||||
<div id="chat-editor" class="composer-editor ts-chat-input"></div>
|
||||
<div class="composer-actions">
|
||||
<button id="chat-emoji" class="icon-btn" type="button" aria-label="Emoji" data-i18n-aria-label="chat.emoji.label" aria-expanded="false"><svg class="icon" aria-hidden="true"><use href="#i-chat-emoji"/></svg></button>
|
||||
<button id="chat-attach" class="icon-btn" type="button" aria-label="Attach file" data-i18n-aria-label="chat.attachment.label" hidden><svg class="icon" aria-hidden="true"><use href="#i-attachment"/></svg></button>
|
||||
|
||||
@@ -927,7 +927,7 @@ async function closeSettings() {
|
||||
S.view = 'main';
|
||||
renderConnection();
|
||||
chat.onViewChanged();
|
||||
(isConnected() ? $('#chat-input') : $('#connect-address')).focus();
|
||||
(isConnected() ? chat.composerEditor() : $('#connect-address')).focus();
|
||||
}
|
||||
|
||||
// ---------- diagnostics for automated smoke runs (read-only) ----------
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import EMOJI from '../vendor/emoji/shortcodes.js';
|
||||
import { t, onLanguageChange } from './i18n.js';
|
||||
import { $, h, icon } from './dom.js';
|
||||
import { continueMarkup, indentMarkup } from './chat-editor-commands.js';
|
||||
|
||||
// Each tuple is prefix, suffix, group, and optional line-prefix mode.
|
||||
export const SNIPPETS = {
|
||||
@@ -23,33 +24,58 @@ export const SNIPPETS = {
|
||||
callout: ['> [!NOTE]\n> ', ''], escape: ['\\', ''], entity: ['&', ';'], url: ['https://', ''],
|
||||
};
|
||||
|
||||
/** The text change for snippet `id` over [start, end): `insert` replaces [from, to), then [start, end) is selected. */
|
||||
export function formatSelection(value, start, end, id) {
|
||||
const snippet = SNIPPETS[id]; if (!snippet) return null;
|
||||
const [prefix, suffix, , lines] = snippet;
|
||||
const selected = value.slice(start, end);
|
||||
if (selected && !lines && value.slice(Math.max(0, start - prefix.length), start) === prefix && value.slice(end, end + suffix.length) === suffix) {
|
||||
return { value: value.slice(0, start - prefix.length) + selected + value.slice(end + suffix.length), start: start - prefix.length, end: end - prefix.length };
|
||||
return { from: start - prefix.length, to: end + suffix.length, insert: selected, start: start - prefix.length, end: end - prefix.length };
|
||||
}
|
||||
const text = lines ? selected.split('\n').map((line, i) => `${id === 'ol' ? `${i + 1}. ` : prefix}${line}`).join('\n') : prefix + selected + suffix;
|
||||
return { value: value.slice(0, start) + text + value.slice(end), start: start + prefix.length, end: start + text.length - suffix.length };
|
||||
return { from: start, to: end, insert: text, start: start + prefix.length, end: start + text.length - suffix.length };
|
||||
}
|
||||
|
||||
export function initChatComposer({ onChange, attach }) {
|
||||
const input = $('#chat-input');
|
||||
/** `editor` is the chat-editor.js adapter; every edit is a text transaction on its single CodeMirror view. */
|
||||
export function initChatComposer({ editor, onChange, attach }) {
|
||||
const bar = $('#chat-format-bar');
|
||||
let menu = null;
|
||||
let completion = null;
|
||||
const close = () => {
|
||||
menu?.remove(); menu = null; completion = null;
|
||||
for (const button of bar.querySelectorAll('[aria-expanded]')) button.setAttribute('aria-expanded', 'false');
|
||||
input.removeAttribute('aria-controls'); input.removeAttribute('aria-activedescendant');
|
||||
editor.removeAttribute('aria-controls'); editor.removeAttribute('aria-activedescendant');
|
||||
$('#chat-emoji')?.setAttribute('aria-expanded', 'false');
|
||||
};
|
||||
const apply = (id, range) => {
|
||||
if (input.disabled) return;
|
||||
const result = formatSelection(input.value, range?.start ?? input.selectionStart, range?.end ?? input.selectionEnd, id);
|
||||
if (!result) return;
|
||||
input.value = result.value; input.setSelectionRange(result.start, result.end); close(); onChange(); input.focus();
|
||||
const edit = (change) => {
|
||||
editor.setRangeText(change.insert, change.from, change.to, 'preserve');
|
||||
editor.setSelectionRange(change.start, change.end); close(); onChange(); editor.focus();
|
||||
};
|
||||
const apply = (id) => {
|
||||
if (editor.disabled) return;
|
||||
const change = formatSelection(editor.value, editor.selectionStart, editor.selectionEnd, id);
|
||||
if (change) edit(change);
|
||||
};
|
||||
const markupKey = (key, calculate, consume = false) => ({ key, run: () => {
|
||||
if (editor.disabled) return false;
|
||||
const change = calculate(editor.value, editor.selectionStart, editor.selectionEnd);
|
||||
if (change) edit(change);
|
||||
return Boolean(change) || consume;
|
||||
} });
|
||||
// Original hybrid editor keymap (main.js@7313296); use the same text transactions as the toolbar.
|
||||
editor.setKeymap([
|
||||
...[['Mod-b', 'bold'], ['Mod-i', 'italic'], ['Mod-k', 'link'], ['Mod-`', 'code'], ['Mod-Alt-c', 'codeblock']]
|
||||
.map(([key, id]) => markupKey(key, (value, start, end) => formatSelection(value, start, end, id))),
|
||||
markupKey('Shift-Enter', continueMarkup),
|
||||
markupKey('Tab', (value, start, end) => indentMarkup(value, start, end, 1)),
|
||||
markupKey('Shift-Tab', (value, start, end) => indentMarkup(value, start, end, -1), true),
|
||||
]);
|
||||
// A slash command replaces its typed "/name" token with the snippet; the caret lands inside the snippet.
|
||||
const applySlash = (id, range) => {
|
||||
if (editor.disabled) return;
|
||||
const value = editor.value;
|
||||
const change = formatSelection(value.slice(0, range.start) + value.slice(range.end), range.start, range.start, id);
|
||||
if (change) edit({ ...change, from: range.start, to: range.end });
|
||||
};
|
||||
const more = $('#chat-format-more');
|
||||
const tools = [...bar.querySelectorAll('button[data-format], button[data-format-group]')];
|
||||
@@ -101,40 +127,41 @@ export function initChatComposer({ onChange, attach }) {
|
||||
if (button.dataset.formatGroup) showMenu(button, groupEntries(button.dataset.formatGroup));
|
||||
});
|
||||
// Slash commands insert formatting snippets, never execute native commands or fake Matrix actions.
|
||||
input.addEventListener('input', () => {
|
||||
editor.addEventListener('input', () => {
|
||||
close();
|
||||
const before = input.value.slice(0, input.selectionStart);
|
||||
const before = editor.value.slice(0, editor.selectionStart);
|
||||
const match = /(?:^|\n)\/([a-z0-9-]*)$/i.exec(before);
|
||||
if (!match) return;
|
||||
const ids = Object.keys(SNIPPETS).filter((id) => id.startsWith(match[1])).slice(0, 12);
|
||||
if (!ids.length) return;
|
||||
const range = { start: input.selectionStart - match[1].length - 1, end: input.selectionStart };
|
||||
const range = { start: editor.selectionStart - match[1].length - 1, end: editor.selectionStart };
|
||||
menu = h('div', { class: 'ts-autocomplete-list', role: 'listbox', id: 'chat-slash-completion' });
|
||||
completion = { ids, range, index: 0 };
|
||||
ids.forEach((id, i) => {
|
||||
const button = h('button', { type: 'button', role: 'option', id: `chat-slash-${i}`, 'aria-selected': String(i === 0), text: `/${id} — ${t(`chat.snippet.${id}`)}` });
|
||||
button.addEventListener('mousedown', (e) => e.preventDefault());
|
||||
button.addEventListener('click', () => apply(id, range)); menu.append(button);
|
||||
button.addEventListener('click', () => applySlash(id, range)); menu.append(button);
|
||||
});
|
||||
bar.before(menu); input.setAttribute('aria-controls', menu.id); input.setAttribute('aria-activedescendant', 'chat-slash-0');
|
||||
bar.before(menu); editor.setAttribute('aria-controls', menu.id); editor.setAttribute('aria-activedescendant', 'chat-slash-0');
|
||||
});
|
||||
input.addEventListener('keydown', (e) => {
|
||||
// Capture phase on the editor's own content element: runs before CodeMirror's keymap and the send listener.
|
||||
editor.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape') { close(); return; }
|
||||
if (!completion || e.isComposing) return;
|
||||
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
||||
e.preventDefault();
|
||||
e.preventDefault(); e.stopImmediatePropagation();
|
||||
completion.index = (completion.index + (e.key === 'ArrowDown' ? 1 : completion.ids.length - 1)) % completion.ids.length;
|
||||
[...menu.children].forEach((node, i) => node.setAttribute('aria-selected', String(i === completion.index)));
|
||||
input.setAttribute('aria-activedescendant', `chat-slash-${completion.index}`);
|
||||
editor.setAttribute('aria-activedescendant', `chat-slash-${completion.index}`);
|
||||
} else if (e.key === 'Enter' || e.key === 'Tab') {
|
||||
e.preventDefault(); e.stopImmediatePropagation(); apply(completion.ids[completion.index], completion.range);
|
||||
e.preventDefault(); e.stopImmediatePropagation(); applySlash(completion.ids[completion.index], completion.range);
|
||||
}
|
||||
}, true);
|
||||
$('#chat-attach')?.addEventListener('click', attach);
|
||||
$('#chat-emoji')?.addEventListener('click', () => {
|
||||
if (menu?.classList.contains('chat-emoji-picker')) { close(); return; }
|
||||
close();
|
||||
const range = { start: input.selectionStart, end: input.selectionEnd };
|
||||
const range = { start: editor.selectionStart, end: editor.selectionEnd };
|
||||
const search = h('input', { type: 'search', 'aria-label': t('chat.emoji.search'), placeholder: t('chat.emoji.search') });
|
||||
const list = h('div', { class: 'ts-autocomplete-list' });
|
||||
menu = h('div', { class: 'chat-emoji-picker' }, search, list);
|
||||
@@ -144,15 +171,15 @@ export function initChatComposer({ onChange, attach }) {
|
||||
if (!name.includes(query)) continue;
|
||||
const button = h('button', { type: 'button', text: unicode, title: `:${name}:`, 'aria-label': name });
|
||||
button.addEventListener('click', () => {
|
||||
if (input.disabled) return;
|
||||
input.setRangeText(`:${name}:`, range.start, range.end, 'end'); close(); onChange(); input.focus();
|
||||
if (editor.disabled) return;
|
||||
editor.setRangeText(`:${name}:`, range.start, range.end, 'end'); close(); onChange(); editor.focus();
|
||||
});
|
||||
list.append(button); if (++count === 80) break;
|
||||
}
|
||||
};
|
||||
search.addEventListener('input', draw); bar.before(menu); draw(); search.focus(); $('#chat-emoji').setAttribute('aria-expanded', 'true');
|
||||
});
|
||||
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && menu) { close(); input.focus(); } });
|
||||
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && menu) { close(); editor.focus(); } });
|
||||
document.addEventListener('pointerdown', (e) => { if (menu && !menu.contains(e.target) && !e.target.closest('#chat-format-bar, #chat-emoji')) close(); });
|
||||
return close;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
// Source editor list controls (main.js@6386708-6389000): Shift+Enter continues markup,
|
||||
// Tab indents a list item, Shift+Tab removes one two-column indentation step.
|
||||
// The existing message parser supplies block context; source text remains authoritative.
|
||||
import { parseMarkdown } from './markdown/parse.js';
|
||||
import { PREVIEW_MAX_LENGTH } from './chat-editor-preview.js';
|
||||
|
||||
const PREFIX = /^(\s*(?:>\s*)*)(?:([-*]|\d+[.)]) )?(?:(\[[ xX]\] ))?/;
|
||||
const space = c => c === ' ' || c === '\t';
|
||||
|
||||
function lineAt(text, position) {
|
||||
const from = position === 0 ? 0 : text.lastIndexOf('\n', position - 1) + 1;
|
||||
const next = text.indexOf('\n', position);
|
||||
let number = 0;
|
||||
for (let i = 0; i < from; i++) if (text[i] === '\n') number++;
|
||||
const to = next < 0 ? text.length : next;
|
||||
return { from, to, number, text: text.slice(from, to) };
|
||||
}
|
||||
|
||||
function context(lines, line, depth = 0, quotes = 0) {
|
||||
if (depth >= 24) return { list: false, code: false, quotes };
|
||||
const node = parseMarkdown(lines.join('\n')).children.find(n => n.lines && n.lines[0] <= line && line < n.lines[1]);
|
||||
if (!node) return { list: false, code: false, quotes };
|
||||
if (node.type === 'list') return { list: true, code: false, quotes };
|
||||
if (node.type === 'code' || node.type === 'mermaid') return { list: false, code: true, quotes };
|
||||
const [from, to] = node.lines;
|
||||
if (node.type === 'blockquote') {
|
||||
// Reparse the stripped source rather than using the display-only children: callout marker lines
|
||||
// are omitted from those children, which would otherwise shift the cursor's source line.
|
||||
const inner = lines.slice(from, to).map(value => value.replace(/^[ \t]{0,3}> ?/, ''));
|
||||
return context(inner, line - from, depth + 1, quotes + 1);
|
||||
}
|
||||
if (['details', 'align', 'bb_block', 'bb_align'].includes(node.type) && node.children) {
|
||||
const inner = lines.slice(from + 1, to - 1);
|
||||
if (line > from && line - from - 1 < inner.length) return context(inner, line - from - 1, depth + 1, quotes);
|
||||
}
|
||||
return { list: false, code: false, quotes };
|
||||
}
|
||||
|
||||
function blockContext(text, line) {
|
||||
return context(text.split('\n'), line.number);
|
||||
}
|
||||
|
||||
// End of the quote prefix, leaving indentation after its last optional space untouched.
|
||||
function quoteEnd(line) {
|
||||
let end = 0;
|
||||
while (end < line.length) {
|
||||
let next = end;
|
||||
while (space(line[next])) next++;
|
||||
if (line[next] !== '>') break;
|
||||
end = next + 1;
|
||||
if (line[end] === ' ') end++;
|
||||
}
|
||||
return end;
|
||||
}
|
||||
|
||||
function removeIndent(line, cursor) {
|
||||
const first = quoteEnd(line.text);
|
||||
let last = first;
|
||||
while (space(line.text[last])) last++;
|
||||
let from = last;
|
||||
let columns = 0;
|
||||
while (from > first && columns < 2) {
|
||||
columns += line.text[from - 1] === '\t' ? 2 : 1;
|
||||
from--;
|
||||
}
|
||||
if (from === last) return null;
|
||||
const position = cursor >= line.from + last ? cursor - (last - from) : Math.min(cursor, line.from + from);
|
||||
return { from: line.from + from, to: line.from + last, insert: '', start: position, end: position };
|
||||
}
|
||||
|
||||
/** Returns a source edit, or null to keep ordinary editor/focus handling. Positions are UTF-16 offsets. */
|
||||
export function indentMarkup(text, start, end, direction) {
|
||||
if (start !== end || text.length > PREVIEW_MAX_LENGTH) return null;
|
||||
const line = lineAt(text, start);
|
||||
const location = blockContext(text, line);
|
||||
if (direction < 0) {
|
||||
if (!location.list && !PREFIX.exec(line.text)?.[2]) return null;
|
||||
return removeIndent(line, start);
|
||||
}
|
||||
if (!location.list) return null;
|
||||
const prefix = /^[ \t]*(?:>[ \t]*)*/.exec(line.text)[0];
|
||||
const at = line.from + prefix.length;
|
||||
const position = start >= at ? start + 2 : start;
|
||||
return { from: at, to: at, insert: ' ', start: position, end: position };
|
||||
}
|
||||
|
||||
/** Shift+Enter continuation; null lets CodeMirror insert its ordinary newline (including selections). */
|
||||
export function continueMarkup(text, start, end) {
|
||||
if (start !== end || text.length > PREVIEW_MAX_LENGTH) return null;
|
||||
const line = lineAt(text, start);
|
||||
const location = blockContext(text, line);
|
||||
let prefix;
|
||||
if (location.code) {
|
||||
if (!location.quotes) return null;
|
||||
prefix = '> '.repeat(location.quotes);
|
||||
} else {
|
||||
const match = PREFIX.exec(line.text);
|
||||
const [, leading, marker, task] = match;
|
||||
if (!leading && !marker) return null;
|
||||
if (marker && !line.text.slice(match[0].length).trim()) {
|
||||
const outdent = removeIndent(line, start);
|
||||
if (outdent) return outdent;
|
||||
const insert = leading.trimEnd();
|
||||
const position = line.from + insert.length;
|
||||
return { from: line.from, to: line.to, insert, start: position, end: position };
|
||||
}
|
||||
prefix = leading;
|
||||
if (marker) {
|
||||
const ordered = /^(\d+)([.)])$/.exec(marker);
|
||||
prefix += ordered ? `${Number(ordered[1]) + 1}${ordered[2]} ` : `${marker} `;
|
||||
if (task) prefix += '[ ] ';
|
||||
}
|
||||
}
|
||||
const insert = `\n${prefix}`;
|
||||
const position = start + insert.length;
|
||||
return { from: start, to: start, insert, start: position, end: position };
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
// Hybrid (rich-text) preview for the chat editor, the account-free counterpart of the official
|
||||
// `hybridMarkdown({ enablePreview: useRichTextEditing })` CodeMirror extension (main.js @3520977).
|
||||
// The document is parsed with the same dialect parser as sent messages (markdown/parse.js) and every
|
||||
// top-level block the selection does not touch is replaced by its message rendering (markdown/render.js);
|
||||
// the block holding the cursor or any selected text stays raw source. The source text is never rewritten:
|
||||
// widgets are display-only, so typing, IME, undo and the clipboard always operate on the exact raw text.
|
||||
// Rendered previews never navigate, load server images or run actions: links lose their href, server
|
||||
// image buttons are disabled, spoilers are shown revealed and nothing in a widget is focusable.
|
||||
import { Decoration, EditorSelection, EditorView, StateField, WidgetType, keymap } from '../vendor/codemirror/codemirror.js';
|
||||
import { parseMarkdown } from './markdown/parse.js';
|
||||
import { renderMarkdownBlock, renderMarkdownFootnotes } from './markdown/render.js';
|
||||
|
||||
// Chat messages are limited to 8 KiB of UTF-8, so a longer draft is never sent as-is; past this many
|
||||
// UTF-16 units the editor stays raw instead of re-parsing on every keystroke.
|
||||
export const PREVIEW_MAX_LENGTH = 16384;
|
||||
|
||||
const skipLines = (key, value) => (key === 'lines' ? undefined : value);
|
||||
|
||||
/**
|
||||
* Top-level source blocks of `text` as `{ from, to, kind, node, key }` with 0-based document line indexes
|
||||
* (`to` exclusive), in document order. `key` identifies the rendering, independent of where the block is.
|
||||
* Lines outside every block (blank lines, link reference definitions) are not listed.
|
||||
*/
|
||||
export function previewBlocks(text) {
|
||||
if (text.length > PREVIEW_MAX_LENGTH) return [];
|
||||
const doc = parseMarkdown(text);
|
||||
if (doc.tooComplex) return [];
|
||||
const blocks = [];
|
||||
const add = (kind, node) => {
|
||||
const [from, to] = node.lines;
|
||||
if (to > from) blocks.push({ from, to, kind, node, key: `${kind}:${to - from}:${JSON.stringify(node, skipLines)}` });
|
||||
};
|
||||
for (const node of doc.children) if (node.lines) add('block', node);
|
||||
for (const note of doc.footnotes) if (note.lines) add('footnote', note);
|
||||
return blocks.sort((a, b) => a.from - b.from);
|
||||
}
|
||||
|
||||
/** Removes every navigation, network and focus affordance from a rendered message fragment. */
|
||||
function inert(root) {
|
||||
for (const a of root.querySelectorAll('a')) {
|
||||
a.removeAttribute('href');
|
||||
delete a.dataset.href;
|
||||
}
|
||||
for (const spoiler of root.querySelectorAll('.md-spoiler')) {
|
||||
spoiler.removeAttribute('tabindex');
|
||||
spoiler.removeAttribute('role');
|
||||
spoiler.removeAttribute('aria-expanded');
|
||||
spoiler.classList.add('revealed');
|
||||
}
|
||||
for (const button of root.querySelectorAll('.md-ts3image-load')) button.disabled = true;
|
||||
for (const node of root.querySelectorAll('summary, [tabindex]')) node.tabIndex = -1;
|
||||
}
|
||||
|
||||
class BlockWidget extends WidgetType {
|
||||
constructor(block) {
|
||||
super();
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
eq(other) {
|
||||
return other.block.key === this.block.key;
|
||||
}
|
||||
|
||||
toDOM(view) {
|
||||
const wrap = document.createElement('div');
|
||||
wrap.className = 'tp-chat-editor-block ts-parsed-text-content';
|
||||
const { kind, node } = this.block;
|
||||
const rendered = kind === 'footnote' ? renderMarkdownFootnotes([node]) : renderMarkdownBlock(node);
|
||||
if (rendered) wrap.append(rendered);
|
||||
inert(wrap);
|
||||
const lineCount = this.block.to - this.block.from;
|
||||
wrap.addEventListener('mousedown', (event) => {
|
||||
// Diagram load/retry buttons render locally in the sandboxed frame; everything else edits.
|
||||
if (event.button !== 0 || event.target.closest?.('button:not(:disabled)')) return;
|
||||
event.preventDefault();
|
||||
if (view.state.readOnly) return;
|
||||
const rect = wrap.getBoundingClientRect();
|
||||
const row = rect.height > 0 ? Math.floor(((event.clientY - rect.top) / rect.height) * lineCount) : 0;
|
||||
const first = view.state.doc.lineAt(view.posAtDOM(wrap)).number;
|
||||
const line = view.state.doc.line(Math.min(view.state.doc.lines, first + Math.max(0, Math.min(lineCount - 1, row))));
|
||||
view.dispatch({ selection: EditorSelection.cursor(line.to), scrollIntoView: true, userEvent: 'select.pointer' });
|
||||
view.focus();
|
||||
});
|
||||
// Math and diagrams finish asynchronously; keep CodeMirror's height map in step with them.
|
||||
const observer = new ResizeObserver(() => view.requestMeasure());
|
||||
observer.observe(wrap);
|
||||
wrap.tpObserver = observer;
|
||||
return wrap;
|
||||
}
|
||||
|
||||
destroy(dom) {
|
||||
dom.tpObserver?.disconnect();
|
||||
}
|
||||
|
||||
ignoreEvent() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
const blocksField = StateField.define({
|
||||
create: (state) => previewBlocks(state.doc.toString()),
|
||||
update: (blocks, tr) => (tr.docChanged ? previewBlocks(tr.state.doc.toString()) : blocks),
|
||||
});
|
||||
|
||||
const definitionLine = Decoration.line({ class: 'tp-chat-editor-definition' });
|
||||
|
||||
function decorate(state) {
|
||||
const { doc, selection } = state;
|
||||
const blocks = state.field(blocksField);
|
||||
const ranges = [];
|
||||
let next = 0;
|
||||
for (const block of blocks) {
|
||||
// Non-blank lines between blocks are source the message does not show (reference definitions).
|
||||
for (let i = next; i < block.from; i += 1) {
|
||||
const line = doc.line(i + 1);
|
||||
if (line.text.trim()) ranges.push(definitionLine.range(line.from));
|
||||
}
|
||||
next = block.to;
|
||||
const from = doc.line(block.from + 1).from;
|
||||
const to = doc.line(Math.min(block.to, doc.lines)).to;
|
||||
if (selection.ranges.some((r) => r.from <= to && r.to >= from)) continue;
|
||||
ranges.push(Decoration.replace({ widget: new BlockWidget(block), block: true }).range(from, to));
|
||||
}
|
||||
for (let i = next; i < doc.lines; i += 1) {
|
||||
const line = doc.line(i + 1);
|
||||
if (line.text.trim()) ranges.push(definitionLine.range(line.from));
|
||||
}
|
||||
return Decoration.set(ranges, true);
|
||||
}
|
||||
|
||||
const decorationsField = StateField.define({
|
||||
create: decorate,
|
||||
update: (decorations, tr) => (tr.docChanged || tr.selection ? decorate(tr.state) : decorations),
|
||||
provide: (field) => EditorView.decorations.from(field),
|
||||
});
|
||||
|
||||
function rendered(state, pos) {
|
||||
let found = false;
|
||||
state.field(decorationsField).between(pos, pos, (from, to, value) => {
|
||||
if (value.spec.widget) found = true;
|
||||
return !found;
|
||||
});
|
||||
return found;
|
||||
}
|
||||
|
||||
/**
|
||||
* Up/Down into a rendered block lands on the adjacent source line (same column) so the block opens for
|
||||
* editing there; CodeMirror's own vertical motion would treat the whole widget as one line.
|
||||
*/
|
||||
function vertical(forward, extend) {
|
||||
return (view) => {
|
||||
const { state } = view;
|
||||
const range = state.selection.main;
|
||||
const line = state.doc.lineAt(range.head);
|
||||
const target = line.number + (forward ? 1 : -1);
|
||||
if (target < 1 || target > state.doc.lines) return false;
|
||||
// Inside a wrapped line the normal visual motion applies.
|
||||
if (state.doc.lineAt(view.moveVertically(range, forward).head).number === line.number) return false;
|
||||
const next = state.doc.line(target);
|
||||
if (!rendered(state, next.from)) return false;
|
||||
const head = next.from + Math.min(range.head - line.from, next.length);
|
||||
view.dispatch({
|
||||
selection: extend ? EditorSelection.range(range.anchor, head) : EditorSelection.cursor(head),
|
||||
scrollIntoView: true,
|
||||
userEvent: 'select',
|
||||
});
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
const previewKeymap = keymap.of([
|
||||
{ key: 'ArrowDown', run: vertical(true, false), shift: vertical(true, true) },
|
||||
{ key: 'ArrowUp', run: vertical(false, false), shift: vertical(false, true) },
|
||||
]);
|
||||
|
||||
const previewTheme = EditorView.baseTheme({
|
||||
// flow-root keeps rendered margins inside the widget, so CodeMirror measures the height it shows.
|
||||
'.tp-chat-editor-block': { display: 'flow-root', whiteSpace: 'normal', cursor: 'text', userSelect: 'none' },
|
||||
});
|
||||
|
||||
/** The hybrid preview extension; absent, the same editor shows raw source only. */
|
||||
export function chatPreview() {
|
||||
return [
|
||||
blocksField,
|
||||
decorationsField,
|
||||
previewKeymap,
|
||||
previewTheme,
|
||||
EditorView.editorAttributes.of({ class: 'tp-chat-editor-hybrid' }),
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// Chat message editor: one CodeMirror 6 view (vendored core, see scripts/vendor-chat-libs.mjs) that shows
|
||||
// either raw source or the hybrid preview, like the official composer (main.js @3520977 createEditorState,
|
||||
// @6389722 hybrid/raw switch through compartments with history, keymap and wrapping kept).
|
||||
//
|
||||
// createChatEditor(host) fills the empty `host` element and returns an adapter with the textarea-like
|
||||
// surface the chat composer uses. The editable element is `.cm-content#chat-input`. Contract:
|
||||
// - 'input' listeners live on the adapter (it is an EventTarget): fired once per microtask after USER edits
|
||||
// (typing, IME commit, paste, cut, drop, undo/redo, Shift+Enter), never synchronously inside a
|
||||
// CodeMirror update and never for programmatic value/setRangeText/reset (textarea semantics).
|
||||
// - Every other event type is registered on the content element with the given options.
|
||||
// - Plain Enter is not bound, so the chat's own keydown listener sends; Shift+Enter inserts a newline.
|
||||
// - Settings (preview, disabled, placeholder, attributes) are no-ops when unchanged, keep the document,
|
||||
// selection and undo history, and are deferred to a microtask if requested during an update.
|
||||
// - Positions are UTF-16 offsets into the exact source text (line breaks normalised to \n, as a textarea).
|
||||
import {
|
||||
Annotation, Compartment, EditorSelection, EditorState, EditorView, history, historyKeymap, insertNewline,
|
||||
keymap, placeholder as placeholderExtension, standardKeymap,
|
||||
} from '../vendor/codemirror/codemirror.js';
|
||||
import { chatPreview } from './chat-editor-preview.js';
|
||||
|
||||
const programmatic = Annotation.define();
|
||||
|
||||
const chatKeymap = [
|
||||
{ key: 'Shift-Enter', run: insertNewline },
|
||||
...standardKeymap.filter((binding) => binding.key !== 'Enter'),
|
||||
...historyKeymap,
|
||||
];
|
||||
|
||||
// Neutralises CodeMirror's default look (monospace, black caret, focus outline, padding) so the
|
||||
// composer's stylesheet decides it; selection and caret stay native, as in a textarea.
|
||||
const editorTheme = EditorView.theme({
|
||||
'&': { color: 'inherit', backgroundColor: 'transparent' },
|
||||
'&.cm-focused': { outline: 'none' },
|
||||
'.cm-scroller': { fontFamily: 'inherit', lineHeight: 'inherit' },
|
||||
'.cm-content': { padding: '0', caretColor: 'currentColor' },
|
||||
'.cm-line': { padding: '0' },
|
||||
});
|
||||
|
||||
const disabledExtension = [
|
||||
EditorView.editable.of(false),
|
||||
EditorState.readOnly.of(true),
|
||||
EditorView.contentAttributes.of({ 'aria-disabled': 'true' }),
|
||||
EditorView.editorAttributes.of({ class: 'tp-chat-editor-disabled' }),
|
||||
];
|
||||
|
||||
// A dropped file would otherwise be read as text into the draft; files are attached explicitly instead.
|
||||
const ignoreFileDrops = EditorView.domEventHandlers({
|
||||
drop: (event) => Boolean(event.dataTransfer?.files?.length),
|
||||
});
|
||||
|
||||
const normalize = (text) => String(text ?? '').replace(/\r\n?/g, '\n');
|
||||
const clamp = (value, max) => Math.min(Math.max(0, Math.trunc(Number(value)) || 0), max);
|
||||
|
||||
class ChatEditor extends EventTarget {
|
||||
#view;
|
||||
#preview = new Compartment();
|
||||
#disabled = new Compartment();
|
||||
#placeholder = new Compartment();
|
||||
#attributes = new Compartment();
|
||||
#shortcuts = new Compartment();
|
||||
#keyBindings = [];
|
||||
#settings = { preview: true, disabled: false, placeholder: '', attributes: {} };
|
||||
#inputQueued = false;
|
||||
#destroyed = false;
|
||||
|
||||
constructor(host) {
|
||||
super();
|
||||
this.#view = new EditorView({ state: this.#createState('') });
|
||||
host.replaceChildren(this.#view.dom);
|
||||
}
|
||||
|
||||
#extensions() {
|
||||
const { preview, disabled, placeholder, attributes } = this.#settings;
|
||||
return [
|
||||
this.#shortcuts.of(keymap.of(this.#keyBindings)),
|
||||
this.#preview.of(preview ? chatPreview() : []),
|
||||
this.#disabled.of(disabled ? disabledExtension : []),
|
||||
this.#placeholder.of(placeholder ? placeholderExtension(placeholder) : []),
|
||||
this.#attributes.of(EditorView.contentAttributes.of({ ...attributes })),
|
||||
EditorView.contentAttributes.of({ id: 'chat-input', spellcheck: 'true' }),
|
||||
history(),
|
||||
keymap.of(chatKeymap),
|
||||
EditorView.lineWrapping,
|
||||
ignoreFileDrops,
|
||||
editorTheme,
|
||||
EditorView.updateListener.of((update) => {
|
||||
if (update.transactions.some((tr) => tr.docChanged && !tr.annotation(programmatic))) this.#queueInput();
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
#createState(text) {
|
||||
const doc = normalize(text);
|
||||
return EditorState.create({ doc, selection: EditorSelection.cursor(doc.length), extensions: this.#extensions() });
|
||||
}
|
||||
|
||||
#queueInput() {
|
||||
if (this.#inputQueued) return;
|
||||
this.#inputQueued = true;
|
||||
queueMicrotask(() => {
|
||||
this.#inputQueued = false;
|
||||
if (!this.#destroyed) this.dispatchEvent(new Event('input'));
|
||||
});
|
||||
}
|
||||
|
||||
/** Runs `fn` now, or right after the update in progress (CodeMirror forbids re-entrant updates). */
|
||||
#whenIdle(fn) {
|
||||
if (this.#destroyed) return;
|
||||
if (this.#view.updateState === 0) fn();
|
||||
else queueMicrotask(() => this.#whenIdle(fn));
|
||||
}
|
||||
|
||||
#dispatch(spec) {
|
||||
this.#whenIdle(() => this.#view.dispatch({ ...spec, annotations: programmatic.of(true) }));
|
||||
}
|
||||
|
||||
#reconfigure(compartment, extension) {
|
||||
this.#dispatch({ effects: compartment.reconfigure(extension) });
|
||||
}
|
||||
|
||||
get dom() { return this.#view.dom; }
|
||||
|
||||
get contentDOM() { return this.#view.contentDOM; }
|
||||
|
||||
get value() { return this.#view.state.doc.toString(); }
|
||||
|
||||
/** Replaces the text as one undoable change (only the differing middle) and puts the caret at the end. */
|
||||
set value(text) {
|
||||
const next = normalize(text);
|
||||
this.#whenIdle(() => {
|
||||
const current = this.#view.state.doc.toString();
|
||||
if (current === next) return;
|
||||
let start = 0;
|
||||
const limit = Math.min(current.length, next.length);
|
||||
while (start < limit && current.charCodeAt(start) === next.charCodeAt(start)) start += 1;
|
||||
let end = 0;
|
||||
while (end < limit - start && current.charCodeAt(current.length - 1 - end) === next.charCodeAt(next.length - 1 - end)) end += 1;
|
||||
this.#view.dispatch({
|
||||
changes: { from: start, to: current.length - end, insert: next.slice(start, next.length - end) },
|
||||
selection: EditorSelection.cursor(next.length),
|
||||
scrollIntoView: this.#view.hasFocus,
|
||||
annotations: programmatic.of(true),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
get selectionStart() { return this.#view.state.selection.main.from; }
|
||||
|
||||
get selectionEnd() { return this.#view.state.selection.main.to; }
|
||||
|
||||
get selectionDirection() {
|
||||
const { anchor, head } = this.#view.state.selection.main;
|
||||
return head < anchor ? 'backward' : 'forward';
|
||||
}
|
||||
|
||||
setSelectionRange(start, end, direction = 'none') {
|
||||
this.#whenIdle(() => {
|
||||
const length = this.#view.state.doc.length;
|
||||
const to = clamp(end, length);
|
||||
const from = Math.min(clamp(start, length), to);
|
||||
const selection = direction === 'backward' ? EditorSelection.single(to, from) : EditorSelection.single(from, to);
|
||||
this.#view.dispatch({ selection, scrollIntoView: this.#view.hasFocus, annotations: programmatic.of(true) });
|
||||
});
|
||||
}
|
||||
|
||||
/** HTMLTextAreaElement.setRangeText: replaces [start, end) (default: the selection). */
|
||||
setRangeText(text, start, end, selectionMode = 'preserve') {
|
||||
const insert = normalize(text);
|
||||
this.#whenIdle(() => {
|
||||
const { state } = this.#view;
|
||||
const main = state.selection.main;
|
||||
const length = state.doc.length;
|
||||
const from = start === undefined ? main.from : clamp(start, length);
|
||||
const to = end === undefined ? main.to : clamp(end, length);
|
||||
if (from > to) throw new DOMException('The start offset is greater than the end offset.', 'IndexSizeError');
|
||||
const newEnd = from + insert.length;
|
||||
const delta = insert.length - (to - from);
|
||||
let selection;
|
||||
if (selectionMode === 'select') selection = EditorSelection.single(from, newEnd);
|
||||
else if (selectionMode === 'start') selection = EditorSelection.cursor(from);
|
||||
else if (selectionMode === 'end') selection = EditorSelection.cursor(newEnd);
|
||||
else {
|
||||
// Spec "preserve": ends after the range shift, ends inside it snap to its start / new end.
|
||||
const selStart = main.from > to ? main.from + delta : main.from > from ? from : main.from;
|
||||
const selEnd = main.to > to ? main.to + delta : main.to > from ? newEnd : main.to;
|
||||
selection = main.head < main.anchor ? EditorSelection.single(selEnd, selStart) : EditorSelection.single(selStart, selEnd);
|
||||
}
|
||||
this.#view.dispatch({ changes: { from, to, insert }, selection, scrollIntoView: this.#view.hasFocus, annotations: programmatic.of(true) });
|
||||
});
|
||||
}
|
||||
|
||||
get disabled() { return this.#settings.disabled; }
|
||||
|
||||
set disabled(value) {
|
||||
const disabled = Boolean(value);
|
||||
if (disabled === this.#settings.disabled) return;
|
||||
this.#settings.disabled = disabled;
|
||||
this.#reconfigure(this.#disabled, disabled ? disabledExtension : []);
|
||||
if (disabled && this.#view.hasFocus) this.#view.contentDOM.blur();
|
||||
}
|
||||
|
||||
get placeholder() { return this.#settings.placeholder; }
|
||||
|
||||
set placeholder(value) {
|
||||
const text = String(value ?? '');
|
||||
if (text === this.#settings.placeholder) return;
|
||||
this.#settings.placeholder = text;
|
||||
this.#reconfigure(this.#placeholder, text ? placeholderExtension(text) : []);
|
||||
}
|
||||
|
||||
get preview() { return this.#settings.preview; }
|
||||
|
||||
setPreview(enabled) {
|
||||
const preview = Boolean(enabled);
|
||||
if (preview === this.#settings.preview) return;
|
||||
this.#settings.preview = preview;
|
||||
this.#reconfigure(this.#preview, preview ? chatPreview() : []);
|
||||
}
|
||||
|
||||
/** Application formatting commands retain CodeMirror's platform and focus-mode key handling. */
|
||||
setKeymap(bindings) {
|
||||
this.#keyBindings = bindings;
|
||||
this.#reconfigure(this.#shortcuts, keymap.of(bindings));
|
||||
}
|
||||
|
||||
getAttribute(name) { return this.#view.contentDOM.getAttribute(name); }
|
||||
|
||||
hasAttribute(name) { return this.#view.contentDOM.hasAttribute(name); }
|
||||
|
||||
/** Content-element attributes go through CodeMirror, which would otherwise drop or overwrite them. */
|
||||
setAttribute(name, value) {
|
||||
const key = String(name).toLowerCase();
|
||||
const text = String(value);
|
||||
if (this.#settings.attributes[key] === text) return;
|
||||
this.#settings.attributes = { ...this.#settings.attributes, [key]: text };
|
||||
this.#reconfigure(this.#attributes, EditorView.contentAttributes.of({ ...this.#settings.attributes }));
|
||||
}
|
||||
|
||||
removeAttribute(name) {
|
||||
const key = String(name).toLowerCase();
|
||||
if (!Object.hasOwn(this.#settings.attributes, key)) return;
|
||||
const { [key]: _removed, ...rest } = this.#settings.attributes;
|
||||
this.#settings.attributes = rest;
|
||||
this.#reconfigure(this.#attributes, EditorView.contentAttributes.of({ ...rest }));
|
||||
}
|
||||
|
||||
addEventListener(type, listener, options) {
|
||||
if (type === 'input') super.addEventListener(type, listener, options);
|
||||
else this.#view.contentDOM.addEventListener(type, listener, options);
|
||||
}
|
||||
|
||||
removeEventListener(type, listener, options) {
|
||||
if (type === 'input') super.removeEventListener(type, listener, options);
|
||||
else this.#view.contentDOM.removeEventListener(type, listener, options);
|
||||
}
|
||||
|
||||
focus() {
|
||||
if (!this.#settings.disabled && !this.#destroyed) this.#view.focus();
|
||||
}
|
||||
|
||||
/** New conversation: replaces the document and drops undo history and selection with it. */
|
||||
reset(value = '') {
|
||||
this.#whenIdle(() => this.#view.setState(this.#createState(value)));
|
||||
}
|
||||
|
||||
resize() {
|
||||
if (!this.#destroyed) this.#view.requestMeasure();
|
||||
}
|
||||
|
||||
destroy() {
|
||||
if (this.#destroyed) return;
|
||||
this.#destroyed = true;
|
||||
this.#view.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
/** Creates the chat editor inside the empty `host` element (`#chat-editor`). */
|
||||
export function createChatEditor(host) {
|
||||
return new ChatEditor(host);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// Settings > Chats in the official order (client_ui/main.js settings component near 4873300): Text Editing
|
||||
// (toolbar visibility, diagram auto-load, Markdown Help), Options, Ignored Users. Preference semantics live in
|
||||
// chat-options.js; schema and defaults in app/main/chat-prefs.js.
|
||||
// (rich text editor, toolbar visibility, diagram auto-load, Markdown Help), Options, Ignored Users. Preference
|
||||
// semantics live in chat-options.js; schema and defaults in app/main/chat-prefs.js.
|
||||
import { S } from './state.js';
|
||||
import { tp } from './core.js';
|
||||
import { h, icon } from './dom.js';
|
||||
@@ -93,6 +93,8 @@ export function initChatSettings(changed) {
|
||||
host.replaceChildren(
|
||||
contactSettingsSection(save),
|
||||
section(t('settings.chat.text_edit'), [
|
||||
// render@4879468: the subtitle shows the source enabled/disabled strings verbatim.
|
||||
toggle('chatRichTextEditor', 'settings.chat.text_edit.rich_text', 'settings.chat.text_edit.rich_text.enabled', 'settings.chat.text_edit.rich_text.disabled'),
|
||||
inlineRow(t('settings.chat.toolbar'), t('settings.chat.toolbar.info'),
|
||||
segmented('chatToolbarVisibility', 'settings.chat.toolbar', [['inactive', 'settings.chat.text_edit.toolbar_visibility.inactive'], ['dynamic', 'settings.chat.text_edit.toolbar_visibility.dynamic'], ['always-visible', 'settings.chat.text_edit.toolbar_visibility.always_visible']])),
|
||||
inlineRow(t('settings.chat.diagrams'), t('settings.chat.diagrams.info'),
|
||||
|
||||
+32
-19
@@ -9,6 +9,7 @@ import { setMermaidAutoload } from './markdown/mermaid.js';
|
||||
import { handleMarkdownClick, handleMarkdownKey } from './chat-markdown-help.js';
|
||||
import { requestServerFileDownload, fetchServerImage, chooseAndUploadChatAttachments, canAttachFiles } from './files.js';
|
||||
import { initChatComposer } from './chat-composer.js';
|
||||
import { createChatEditor } from './chat-editor.js';
|
||||
import { notify } from './notifications.js';
|
||||
import { initChatSettings, setIgnoredUser } from './chat-settings.js';
|
||||
import { formatClock, showsMessage, opensIncoming, isIgnoredText, isIgnoredUid } from './chat-options.js';
|
||||
@@ -24,6 +25,8 @@ let controls;
|
||||
let privateInfo;
|
||||
let lastBadge = -1;
|
||||
let closeComposer = () => {};
|
||||
// The single composer editor (chat-editor.js adapter); its contentDOM is #chat-input.
|
||||
let editor = null;
|
||||
const imageUrls = new Set();
|
||||
|
||||
function stateFor(conn) {
|
||||
@@ -115,9 +118,11 @@ async function restore(state) {
|
||||
|
||||
export function initChat() {
|
||||
$('#chat-form').addEventListener('submit', (e) => { e.preventDefault(); void send(); });
|
||||
const input = $('#chat-input');
|
||||
input.addEventListener('input', () => { if (displayed) displayed.draft = input.value; autosize(); updateComposer(); });
|
||||
input.addEventListener('keydown', (e) => {
|
||||
editor = createChatEditor($('#chat-editor'));
|
||||
editor.setPreview(richTextEditing());
|
||||
editor.addEventListener('input', () => { if (displayed) displayed.draft = editor.value; updateComposer(); });
|
||||
// Plain Enter is not in CodeMirror's keymap: this listener sends; Shift+Enter stays a newline.
|
||||
editor.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter' && !e.shiftKey && !e.isComposing && !e.defaultPrevented) { e.preventDefault(); void send(); }
|
||||
});
|
||||
$('#chat-tabs')?.addEventListener('keydown', onTabKey);
|
||||
@@ -135,13 +140,13 @@ export function initChat() {
|
||||
$('#chat-log').before(controls);
|
||||
$('#chat-log').addEventListener('click', handleMarkdownClick);
|
||||
$('#chat-log').addEventListener('keydown', handleMarkdownKey);
|
||||
closeComposer = initChatComposer({ onChange: () => { if (displayed) displayed.draft = input.value; autosize(); updateComposer(); }, attach });
|
||||
closeComposer = initChatComposer({ editor, onChange: () => { if (displayed) displayed.draft = editor.value; updateComposer(); }, attach });
|
||||
$('#chat-form').append(h('div', { id: 'chat-start-prompt', class: 'chat-start-prompt', hidden: true }, icon('mode-chat'), h('span')));
|
||||
on('appearance-changed', renderLog);
|
||||
on('server_event', onChannelEvent);
|
||||
onLanguageChange(renderLog);
|
||||
initChatSettings(() => { renderLog(); updateComposer(); });
|
||||
input.addEventListener('focus', updateComposer);
|
||||
editor.addEventListener('focus', updateComposer);
|
||||
$('#chat-form').addEventListener('focusout', () => queueMicrotask(updateComposer));
|
||||
const composer = $('#chat-form');
|
||||
const log = $('#chat-log');
|
||||
@@ -171,7 +176,10 @@ export function initChat() {
|
||||
onViewChanged();
|
||||
}
|
||||
|
||||
function autosize() { const input = $('#chat-input'); input.style.height = 'auto'; input.style.height = `${Math.min(input.scrollHeight, 160)}px`; }
|
||||
/** workflowSettings.useRichTextEditor (default true): hybrid Markdown preview, otherwise raw source. */
|
||||
function richTextEditing() { return S.prefs?.chatRichTextEditor !== false; }
|
||||
/** The composer adapter for callers that move focus into the chat (app.js) or inspect it. */
|
||||
export function composerEditor() { return editor; }
|
||||
function partner(chat) { return chat.state.conn.snap?.clients.find((c) => c.uid === chat.scope?.key) ?? null; }
|
||||
function tabTitle(chat) {
|
||||
if (chat.kind === 'channel') return chat.state.conn.snap?.channels.find((c) => String(c.id) === chat.scope?.key)?.name ?? chat.nickname ?? t('ui.channel');
|
||||
@@ -186,8 +194,7 @@ function canSend(chat) {
|
||||
|
||||
async function send() {
|
||||
const chat = current();
|
||||
const input = $('#chat-input');
|
||||
const text = input.value.replace(/\s+$/u, '');
|
||||
const text = editor.value.replace(/\s+$/u, '');
|
||||
if (!text.trim() || !canSend(chat)) return;
|
||||
if (new TextEncoder().encode(text).length > 8192) { toast(() => t('ui.message.exceeds.8.kib'), 'error'); return; }
|
||||
const conn = chat.state.conn;
|
||||
@@ -200,7 +207,7 @@ async function send() {
|
||||
if (!isAlive(conn) || conn.session !== session) return;
|
||||
notify('message_sent', conn);
|
||||
chat.draft = '';
|
||||
if (current() === chat && input.value.replace(/\s+$/u, '') === text) { input.value = ''; autosize(); }
|
||||
if (current() === chat && editor.value.replace(/\s+$/u, '') === text) editor.value = '';
|
||||
} catch (err) { report(err); }
|
||||
finally { chat.sending = false; if (current() === chat) updateComposer(); }
|
||||
}
|
||||
@@ -313,7 +320,7 @@ function revealChat(chat) {
|
||||
}
|
||||
function select(state, key) {
|
||||
if (!state.chats.has(key)) return;
|
||||
if (displayed) displayed.draft = $('#chat-input').value;
|
||||
if (displayed) displayed.draft = editor.value;
|
||||
state.active = key;
|
||||
emit('set-view', 'main');
|
||||
onViewChanged();
|
||||
@@ -512,12 +519,13 @@ function rowFor(chat, msg, prev) {
|
||||
li.append(body); return li;
|
||||
}
|
||||
export function updateComposer() {
|
||||
const input = $('#chat-input'); if (!input) return;
|
||||
if (!editor) return;
|
||||
const chat = current(); const enabled = canSend(chat);
|
||||
input.disabled = !enabled; $('#chat-send').disabled = !enabled || !input.value.trim();
|
||||
editor.setPreview(richTextEditing());
|
||||
editor.disabled = !enabled; $('#chat-send').disabled = !enabled || !editor.value.trim();
|
||||
const prompt = $('#chat-start-prompt');
|
||||
if (prompt) {
|
||||
prompt.hidden = !enabled || Boolean(chat?.messages.length) || Boolean(input.value);
|
||||
prompt.hidden = !enabled || Boolean(chat?.messages.length) || Boolean(editor.value);
|
||||
prompt.lastElementChild.textContent = t('chat.input.start_conversation');
|
||||
}
|
||||
for (const button of document.querySelectorAll('#chat-format-bar button, #chat-emoji, #chat-attach')) button.disabled = !enabled;
|
||||
@@ -525,7 +533,8 @@ export function updateComposer() {
|
||||
if (attachment) attachment.hidden = !canAttachFiles(chat?.state.conn);
|
||||
const toolbar = $('#chat-format-bar');
|
||||
if (toolbar) toolbar.hidden = S.prefs?.chatToolbarVisibility === 'inactive' || (S.prefs?.chatToolbarVisibility === 'dynamic' && !$('#chat-form').contains(document.activeElement));
|
||||
input.placeholder = !enabled ? t('ui.not.connected') : t('chat.sendMessage');
|
||||
editor.placeholder = !enabled ? t('ui.not.connected') : t('chat.sendMessage');
|
||||
editor.setAttribute('aria-label', t('ui.message'));
|
||||
}
|
||||
export function onSnapshot(conn) {
|
||||
const state = stateFor(conn); if (!state) return;
|
||||
@@ -541,10 +550,14 @@ export function onSnapshot(conn) {
|
||||
}
|
||||
}
|
||||
export function onViewChanged() {
|
||||
if (displayed !== current()) closeComposer();
|
||||
if (displayed && $('#chat-input')) displayed.draft = $('#chat-input').value;
|
||||
displayed = current();
|
||||
if ($('#chat-input')) { $('#chat-input').value = displayed?.draft ?? ''; autosize(); }
|
||||
const next = current();
|
||||
if (displayed !== next) closeComposer();
|
||||
if (displayed && editor) displayed.draft = editor.value;
|
||||
// Only a different conversation replaces the document and clears undo/selection; re-rendering the same
|
||||
// conversation keeps the live editor state.
|
||||
const changed = displayed !== next;
|
||||
displayed = next;
|
||||
if (editor && changed) editor.reset(next?.draft ?? '');
|
||||
if (displayed && S.view === 'main') displayed.unread = 0;
|
||||
renderTabs(); renderLog(); badge();
|
||||
if (displayed && !displayed.loaded) void loadPage(displayed);
|
||||
@@ -585,6 +598,6 @@ async function attach() {
|
||||
const query = new URLSearchParams({ port: endpoint.port || '9987', serverUID: serverUid, channel: String(file.channelId), path: file.path, filename: file.name, size: String(file.size), isDir: '0' });
|
||||
chat.draft += `${chat.draft ? '\n' : ''}ts3file://${endpoint.hostname}?${query}`;
|
||||
}
|
||||
if (current() === chat) { $('#chat-input').value = chat.draft; autosize(); }
|
||||
if (current() === chat) { editor.value = chat.draft; updateComposer(); }
|
||||
} catch (err) { report(err); }
|
||||
}
|
||||
+160
-156
@@ -156,7 +156,7 @@ class Parser {
|
||||
// all, every definition in document order (the Markdown Help "Footnote Definition" example).
|
||||
for (const label of this.footnoteOrder.length > 0 ? this.footnoteOrder : [...this.footnoteDefs.keys()]) {
|
||||
const def = this.footnoteDefs.get(label);
|
||||
if (def) notes.push({ label, number: notes.length + 1, children: def.children });
|
||||
if (def) notes.push({ label, number: notes.length + 1, children: def.children, lines: def.lines });
|
||||
}
|
||||
return { type: 'doc', children, footnotes: notes };
|
||||
}
|
||||
@@ -166,165 +166,169 @@ class Parser {
|
||||
const out = [];
|
||||
let i = 0;
|
||||
while (i < lines.length) {
|
||||
const line = lines[i];
|
||||
this.count();
|
||||
if (isBlank(line)) { i += 1; continue; }
|
||||
|
||||
// Fenced code (``` or ~~~); ```mermaid is a diagram.
|
||||
const fence = FENCE.exec(line);
|
||||
if (fence && !(fence[2][0] === '`' && fence[3].includes('`'))) {
|
||||
const marker = fence[2];
|
||||
const indent = fence[1].length;
|
||||
const body = [];
|
||||
let j = i + 1;
|
||||
for (; j < lines.length; j += 1) {
|
||||
const close = FENCE.exec(lines[j]);
|
||||
if (close && close[2][0] === marker[0] && close[2].length >= marker.length && !close[3].trim()) break;
|
||||
body.push(lines[j].replace(new RegExp(`^[ \\t]{0,${indent}}`), ''));
|
||||
}
|
||||
const lang = fence[3].trim().split(/\s+/)[0] ?? '';
|
||||
const content = body.join('\n');
|
||||
out.push(lang.toLowerCase() === 'mermaid' ? { type: 'mermaid', text: content } : { type: 'code', lang: unescapeText(lang), text: content });
|
||||
i = j + 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// $$ math block: needs a closing $$ and some content, otherwise the line is plain text.
|
||||
if (line.trim() === '$$') {
|
||||
let j = i + 1;
|
||||
while (j < lines.length && lines[j].trim() !== '$$') j += 1;
|
||||
const content = lines.slice(i + 1, j).filter((l) => l.length > 0);
|
||||
if (j < lines.length && content.length > 0) {
|
||||
out.push({ type: 'math_block', text: content.join('\n') });
|
||||
i = j + 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// :::details Title / :::left|center|right|justify … ::: (the close needs the same colon count).
|
||||
const colon = COLON_FENCE.exec(line);
|
||||
if (colon) {
|
||||
const keyword = colon[2].toLowerCase();
|
||||
const header = colon[3] ?? '';
|
||||
const isDetails = keyword === 'details';
|
||||
const isAlign = ['left', 'center', 'right', 'justify'].includes(keyword);
|
||||
if ((isDetails || (isAlign && !header)) && !header.includes(':::')) {
|
||||
const count = colon[1].length;
|
||||
let j = i + 1;
|
||||
while (j < lines.length && !new RegExp(`^[ \\t]*:{${count}}[ \\t]*$`).test(lines[j])) j += 1;
|
||||
const inner = this.parseBlocks(lines.slice(i + 1, j), depth + 1);
|
||||
if (isDetails) out.push({ type: 'details', summary: header ? this.parseInline(header, depth + 1) : [], children: inner });
|
||||
else out.push({ type: 'align', align: keyword, children: inner });
|
||||
i = j + 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// BBCode block mode: an opening tag alone on its line, its closing tag alone on a later line.
|
||||
const bbOpen = /^[ \t]*\[([a-z]+)(?:[= ]([^\]\n]*))?\][ \t]*$/i.exec(line);
|
||||
if (bbOpen) {
|
||||
const tag = bbOpen[1].toLowerCase();
|
||||
if (tag === 'hr') {
|
||||
out.push({ type: 'hr' });
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
if (BB_PAIRED.has(tag) && (bbOpen[2] === undefined || BB_PARAM.has(tag))) {
|
||||
const closeRe = new RegExp(`^[ \\t]*\\[/${tag}\\][ \\t]*$`, 'i');
|
||||
let j = i + 1;
|
||||
while (j < lines.length && !closeRe.test(lines[j])) j += 1;
|
||||
if (j < lines.length && j > i + 1 && lines.slice(i + 1, j).some((l) => l.trim())) {
|
||||
out.push(bbBlock(tag, (bbOpen[2] ?? '').trim(), this.parseBlocks(lines.slice(i + 1, j), depth + 1)));
|
||||
i = j + 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Blockquote: every quoted line needs its own `>` (strict, no lazy continuation).
|
||||
if (/^[ \t]{0,3}>/.test(line)) {
|
||||
const inner = [];
|
||||
let j = i;
|
||||
for (; j < lines.length && /^[ \t]{0,3}>/.test(lines[j]); j += 1) inner.push(lines[j].replace(/^[ \t]{0,3}> ?/, ''));
|
||||
let callout = null;
|
||||
const rest = [];
|
||||
for (const l of inner) {
|
||||
const marker = /^\s*\[!([A-Za-z]+)\]\s*$/.exec(l);
|
||||
const type = marker && CALLOUTS.get(marker[1].toUpperCase());
|
||||
if (type) {
|
||||
if (!callout) callout = { type, title: CALLOUT_TITLES[type] };
|
||||
continue;
|
||||
}
|
||||
rest.push(l);
|
||||
}
|
||||
out.push({ type: 'blockquote', callout, children: this.parseBlocks(rest, depth + 1) });
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isThematicBreak(line)) { out.push({ type: 'hr' }); i += 1; continue; }
|
||||
|
||||
const atx = ATX.exec(line);
|
||||
if (atx) {
|
||||
out.push({ type: 'heading', level: atx[1].length, children: this.parseInline(atx[2] ?? '', depth + 1) });
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
const marker = listMarker(line);
|
||||
if (marker) {
|
||||
const { list, next } = this.parseList(lines, i, marker.kind, marker.from, depth);
|
||||
out.push(list);
|
||||
i = next;
|
||||
continue;
|
||||
}
|
||||
|
||||
const fn = FOOTNOTE_DEF.exec(line);
|
||||
if (fn) {
|
||||
const body = [fn[2]];
|
||||
let j = i + 1;
|
||||
while (j < lines.length && !isBlank(lines[j]) && leadingSpaces(lines[j]) > 0) body.push(lines[j].trim()), (j += 1);
|
||||
if (!this.footnoteDefs.has(fn[1])) this.footnoteDefs.set(fn[1], { children: this.parseInline(body.join(' '), depth + 1) });
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
|
||||
const def = LINK_DEF.exec(line);
|
||||
if (def && !def[1].startsWith('^')) { i += 1; continue; }
|
||||
|
||||
// GFM table: header row with pipes followed by a delimiter row.
|
||||
if (line.includes('|') && i + 1 < lines.length && isTableDelimiter(lines[i + 1])) {
|
||||
const align = splitRow(lines[i + 1]).map((c) => {
|
||||
const t = c.trim();
|
||||
if (t.startsWith(':') && t.endsWith(':')) return 'center';
|
||||
if (t.endsWith(':')) return 'right';
|
||||
if (t.startsWith(':')) return 'left';
|
||||
return null;
|
||||
});
|
||||
const header = splitRow(line).map((c) => this.parseInline(c.trim(), depth + 1));
|
||||
const rows = [];
|
||||
let j = i + 2;
|
||||
for (; j < lines.length && !isBlank(lines[j]) && lines[j].includes('|'); j += 1) {
|
||||
rows.push(splitRow(lines[j]).map((c) => this.parseInline(c.trim(), depth + 1)));
|
||||
}
|
||||
out.push({ type: 'table', align, header, rows });
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Setext heading: a text line underlined by === or ---.
|
||||
if (i + 1 < lines.length && isSetextUnderline(lines[i + 1])) {
|
||||
out.push({ type: 'heading', level: lines[i + 1].trim()[0] === '=' ? 1 : 2, children: this.parseInline(line.trim(), depth + 1) });
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
|
||||
out.push({ type: 'paragraph', children: this.parseInline(line.replace(/^[ \t]+/, '').replace(/[ \t]+$/, ''), depth + 1) });
|
||||
i += 1;
|
||||
const before = out.length;
|
||||
const next = this.parseBlock(lines, i, depth, out);
|
||||
// Source span [first line, end line) of the block within `lines`; at depth 0 these are document
|
||||
// lines, which the chat editor's preview uses to map rendered blocks back to their source.
|
||||
if (out.length > before) out[before].lines = [i, Math.min(next, lines.length)];
|
||||
i = next;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Parses the block that starts at line `i` (pushing at most one node) and returns the next line index. */
|
||||
parseBlock(lines, i, depth, out) {
|
||||
const line = lines[i];
|
||||
this.count();
|
||||
if (isBlank(line)) return i + 1;
|
||||
|
||||
// Fenced code (``` or ~~~); ```mermaid is a diagram.
|
||||
const fence = FENCE.exec(line);
|
||||
if (fence && !(fence[2][0] === '`' && fence[3].includes('`'))) {
|
||||
const marker = fence[2];
|
||||
const indent = fence[1].length;
|
||||
const body = [];
|
||||
let j = i + 1;
|
||||
for (; j < lines.length; j += 1) {
|
||||
const close = FENCE.exec(lines[j]);
|
||||
if (close && close[2][0] === marker[0] && close[2].length >= marker.length && !close[3].trim()) break;
|
||||
body.push(lines[j].replace(new RegExp(`^[ \\t]{0,${indent}}`), ''));
|
||||
}
|
||||
const lang = fence[3].trim().split(/\s+/)[0] ?? '';
|
||||
const content = body.join('\n');
|
||||
out.push(lang.toLowerCase() === 'mermaid' ? { type: 'mermaid', text: content } : { type: 'code', lang: unescapeText(lang), text: content });
|
||||
return j + 1;
|
||||
}
|
||||
|
||||
// $$ math block: needs a closing $$ and some content, otherwise the line is plain text.
|
||||
if (line.trim() === '$$') {
|
||||
let j = i + 1;
|
||||
while (j < lines.length && lines[j].trim() !== '$$') j += 1;
|
||||
const content = lines.slice(i + 1, j).filter((l) => l.length > 0);
|
||||
if (j < lines.length && content.length > 0) {
|
||||
out.push({ type: 'math_block', text: content.join('\n') });
|
||||
return j + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// :::details Title / :::left|center|right|justify … ::: (the close needs the same colon count).
|
||||
const colon = COLON_FENCE.exec(line);
|
||||
if (colon) {
|
||||
const keyword = colon[2].toLowerCase();
|
||||
const header = colon[3] ?? '';
|
||||
const isDetails = keyword === 'details';
|
||||
const isAlign = ['left', 'center', 'right', 'justify'].includes(keyword);
|
||||
if ((isDetails || (isAlign && !header)) && !header.includes(':::')) {
|
||||
const count = colon[1].length;
|
||||
let j = i + 1;
|
||||
while (j < lines.length && !new RegExp(`^[ \\t]*:{${count}}[ \\t]*$`).test(lines[j])) j += 1;
|
||||
const inner = this.parseBlocks(lines.slice(i + 1, j), depth + 1);
|
||||
if (isDetails) out.push({ type: 'details', summary: header ? this.parseInline(header, depth + 1) : [], children: inner });
|
||||
else out.push({ type: 'align', align: keyword, children: inner });
|
||||
return j + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// BBCode block mode: an opening tag alone on its line, its closing tag alone on a later line.
|
||||
const bbOpen = /^[ \t]*\[([a-z]+)(?:[= ]([^\]\n]*))?\][ \t]*$/i.exec(line);
|
||||
if (bbOpen) {
|
||||
const tag = bbOpen[1].toLowerCase();
|
||||
if (tag === 'hr') {
|
||||
out.push({ type: 'hr' });
|
||||
return i + 1;
|
||||
}
|
||||
if (BB_PAIRED.has(tag) && (bbOpen[2] === undefined || BB_PARAM.has(tag))) {
|
||||
const closeRe = new RegExp(`^[ \\t]*\\[/${tag}\\][ \\t]*$`, 'i');
|
||||
let j = i + 1;
|
||||
while (j < lines.length && !closeRe.test(lines[j])) j += 1;
|
||||
if (j < lines.length && j > i + 1 && lines.slice(i + 1, j).some((l) => l.trim())) {
|
||||
out.push(bbBlock(tag, (bbOpen[2] ?? '').trim(), this.parseBlocks(lines.slice(i + 1, j), depth + 1)));
|
||||
return j + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Blockquote: every quoted line needs its own `>` (strict, no lazy continuation).
|
||||
if (/^[ \t]{0,3}>/.test(line)) {
|
||||
const inner = [];
|
||||
let j = i;
|
||||
for (; j < lines.length && /^[ \t]{0,3}>/.test(lines[j]); j += 1) inner.push(lines[j].replace(/^[ \t]{0,3}> ?/, ''));
|
||||
let callout = null;
|
||||
const rest = [];
|
||||
for (const l of inner) {
|
||||
const marker = /^\s*\[!([A-Za-z]+)\]\s*$/.exec(l);
|
||||
const type = marker && CALLOUTS.get(marker[1].toUpperCase());
|
||||
if (type) {
|
||||
if (!callout) callout = { type, title: CALLOUT_TITLES[type] };
|
||||
continue;
|
||||
}
|
||||
rest.push(l);
|
||||
}
|
||||
out.push({ type: 'blockquote', callout, children: this.parseBlocks(rest, depth + 1) });
|
||||
return j;
|
||||
}
|
||||
|
||||
if (isThematicBreak(line)) {
|
||||
out.push({ type: 'hr' });
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
const atx = ATX.exec(line);
|
||||
if (atx) {
|
||||
out.push({ type: 'heading', level: atx[1].length, children: this.parseInline(atx[2] ?? '', depth + 1) });
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
const marker = listMarker(line);
|
||||
if (marker) {
|
||||
const { list, next } = this.parseList(lines, i, marker.kind, marker.from, depth);
|
||||
out.push(list);
|
||||
return next;
|
||||
}
|
||||
|
||||
const fn = FOOTNOTE_DEF.exec(line);
|
||||
if (fn) {
|
||||
const body = [fn[2]];
|
||||
let j = i + 1;
|
||||
while (j < lines.length && !isBlank(lines[j]) && leadingSpaces(lines[j]) > 0) body.push(lines[j].trim()), (j += 1);
|
||||
if (!this.footnoteDefs.has(fn[1])) {
|
||||
this.footnoteDefs.set(fn[1], { children: this.parseInline(body.join(' '), depth + 1), lines: depth === 0 ? [i, j] : null });
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
const def = LINK_DEF.exec(line);
|
||||
if (def && !def[1].startsWith('^')) return i + 1;
|
||||
|
||||
// GFM table: header row with pipes followed by a delimiter row.
|
||||
if (line.includes('|') && i + 1 < lines.length && isTableDelimiter(lines[i + 1])) {
|
||||
const align = splitRow(lines[i + 1]).map((c) => {
|
||||
const t = c.trim();
|
||||
if (t.startsWith(':') && t.endsWith(':')) return 'center';
|
||||
if (t.endsWith(':')) return 'right';
|
||||
if (t.startsWith(':')) return 'left';
|
||||
return null;
|
||||
});
|
||||
const header = splitRow(line).map((c) => this.parseInline(c.trim(), depth + 1));
|
||||
const rows = [];
|
||||
let j = i + 2;
|
||||
for (; j < lines.length && !isBlank(lines[j]) && lines[j].includes('|'); j += 1) {
|
||||
rows.push(splitRow(lines[j]).map((c) => this.parseInline(c.trim(), depth + 1)));
|
||||
}
|
||||
out.push({ type: 'table', align, header, rows });
|
||||
return j;
|
||||
}
|
||||
|
||||
// Setext heading: a text line underlined by === or ---.
|
||||
if (i + 1 < lines.length && isSetextUnderline(lines[i + 1])) {
|
||||
out.push({ type: 'heading', level: lines[i + 1].trim()[0] === '=' ? 1 : 2, children: this.parseInline(line.trim(), depth + 1) });
|
||||
return i + 2;
|
||||
}
|
||||
|
||||
out.push({ type: 'paragraph', children: this.parseInline(line.replace(/^[ \t]+/, '').replace(/[ \t]+$/, ''), depth + 1) });
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
/** Strict single-line list items; deeper markers (≥ marker + 2 columns) open a nested list. */
|
||||
parseList(lines, i, kind, baseIndent, depth) {
|
||||
const items = [];
|
||||
|
||||
@@ -396,3 +396,18 @@ export function renderMarkdownInto(target, source, options = {}) {
|
||||
&& doc.children[0].children.every((c) => c.type === 'emoji' || (c.type === 'text' && !c.value.trim()));
|
||||
return { onlyEmoji };
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders one top-level block of a `parseMarkdown` tree (chat editor preview). Reference links and
|
||||
* footnote numbers are resolved document-wide by the parser, so a block looks as it will in the message.
|
||||
*/
|
||||
export function renderMarkdownBlock(node, options = {}) {
|
||||
return new DomRenderer(options).block(node);
|
||||
}
|
||||
|
||||
/** Renders footnote definitions as the message's footnote section, numbered from the first note. */
|
||||
export function renderMarkdownFootnotes(notes, options = {}) {
|
||||
const section = new DomRenderer(options).footnotes(notes);
|
||||
if (section && notes[0].number !== 1) section.firstChild.start = notes[0].number;
|
||||
return section;
|
||||
}
|
||||
@@ -1676,6 +1676,9 @@
|
||||
"settings.chat.ignored_users": "Ignored Users",
|
||||
"settings.chat.ignored_users.empty": "No ignored users",
|
||||
"settings.chat.ignored_users.empty.info": "You can set other chat users as Ignored, meaning TeamSpeak will ignore any invites and messages from them",
|
||||
"settings.chat.text_edit.rich_text": "Use Rich Text Editor",
|
||||
"settings.chat.text_edit.rich_text.disabled": "See and change the style of text as you type.",
|
||||
"settings.chat.text_edit.rich_text.enabled": "See exactly the text you have typed, including text style marks.",
|
||||
"settings.chat.text_edit.toolbar_visibility.inactive": "Hidden",
|
||||
"settings.chat.text_edit.toolbar_visibility.dynamic": "Dynamic",
|
||||
"settings.chat.text_edit.toolbar_visibility.always_visible": "Always Visible",
|
||||
|
||||
@@ -1678,6 +1678,9 @@
|
||||
"settings.chat.ignored_users": "Игнорируемые пользователи",
|
||||
"settings.chat.ignored_users.empty": "Нет игнорируемых пользователей",
|
||||
"settings.chat.ignored_users.empty.info": "Ты можешь установить для других пользователей чата статус \"Игнорируемые\" и TeamSpeak будет игнорировать любые приглашения и сообщения от них",
|
||||
"settings.chat.text_edit.rich_text": "Использовать редактор форматированного текста",
|
||||
"settings.chat.text_edit.rich_text.disabled": "Просматривай и меняй стиль текста по мере его ввода.",
|
||||
"settings.chat.text_edit.rich_text.enabled": "Текст, который ты вводишь, отображается с применением форматирования в реальном времени.",
|
||||
"settings.chat.text_edit.toolbar_visibility.inactive": "Скрыта",
|
||||
"settings.chat.text_edit.toolbar_visibility.dynamic": "Динамически",
|
||||
"settings.chat.text_edit.toolbar_visibility.always_visible": "Всегда видна",
|
||||
|
||||
+20
-24
@@ -777,13 +777,15 @@ body.is-resizing[data-resize-axis="y"], body.is-resizing[data-resize-axis="y"] *
|
||||
cursor: pointer;
|
||||
}
|
||||
.tool-btn + .tool-btn { padding-left: 0; }
|
||||
/* light theme paints tool glyphs with --tsv-icon-base #494949 (main.js light theme module); .shell routes the token through currentColor */
|
||||
@media (prefers-color-scheme: light) { .tool-btn { color: #494949; } }
|
||||
.toolbar-pill > .tool-btn:not(:last-child)::after { content: ""; position: absolute; right: 4px; top: 2px; bottom: 2px; width: 1px; background: var(--strong-bg); }
|
||||
.toolbar-pill > .tool-btn:last-child:not([hidden])::after, .toolbar-pill > .tool-btn:nth-last-child(2):has(+ [hidden])::after { display: none; }
|
||||
.toolbar-pill > .tool-btn:has(+ .toolbar-menu-toggle)::after { display: none; }
|
||||
.toolbar-pill > .tool-btn { height: var(--tsv-icon-size); }
|
||||
.toolbar-pill > .tool-btn:has(+ .toolbar-menu-toggle) { padding-right: 0; }
|
||||
/* enabled .tsv-tool-button-context-menu-toggle paints --tsv-contrast-color; hover tint, open tint2 (main.css@184560) */
|
||||
.toolbar-menu-toggle { display: grid; place-items: center; width: 16px; padding: 0; border: 0; background: transparent; color: var(--tsv-contrast-color); cursor: pointer; }
|
||||
/* enabled .tsv-tool-button-context-menu-toggle paints --tsv-contrast-color; hover tint, open tint2; 16×(22+2·2), icon absolute bottom 0 (main.css@184502) */
|
||||
.toolbar-menu-toggle { display: grid; place-items: end center; width: 16px; height: calc(var(--tsv-icon-size) + 2 * var(--tsv-padding-v-minimal)); padding: 0; border: 0; background: transparent; color: var(--tsv-contrast-color); cursor: pointer; }
|
||||
.toolbar-menu-toggle .icon { width: var(--tsv-icon-size-small); height: var(--tsv-icon-size-small); }
|
||||
.toolbar-menu-toggle:hover { color: var(--tsv-tint); }
|
||||
.toolbar-menu-toggle[aria-expanded="true"] { color: var(--tsv-tint2); }
|
||||
@@ -794,7 +796,7 @@ body.is-resizing[data-resize-axis="y"], body.is-resizing[data-resize-axis="y"] *
|
||||
.btn-ptt { user-select: none; touch-action: none; padding-left: 5px !important; color: var(--tsv-font-subtitle-color); }
|
||||
.btn-ptt[aria-pressed="true"] { color: var(--presence-online); }
|
||||
.toolbar-away { height: var(--tsv-bar-element-height); padding: 0 5px 0 10px; gap: 0; }
|
||||
.toolbar-away .toolbar-away-chevron { width: 16px; height: 16px; color: var(--tsv-contrast-color); }
|
||||
.toolbar-away .toolbar-away-chevron { align-self: flex-end; width: 16px; height: 16px; color: var(--tsv-contrast-color); }
|
||||
.toolbar-away[aria-pressed="true"] { color: var(--tsv-away-color); }
|
||||
.server-status-bar .btn-ptt { height: var(--tsv-bar-element-height); padding: 0 10px; border-radius: var(--tsv-border-radius-pill); background: var(--tsv-bg); }
|
||||
|
||||
@@ -1027,7 +1029,9 @@ img.country { width: var(--tsv-icon-size); height: var(--tsv-icon-size-small); o
|
||||
/* Content modes belong to the detail header; open conversations belong to sidebar activities. */
|
||||
.detail-modes { display: inline-flex; align-items: center; flex: none; height: var(--tsv-bar-element-height); border-radius: var(--tsv-border-radius-pill); background: var(--tsv-bg); }
|
||||
.detail-modes .icon-btn { position: relative; width: 30px; height: var(--tsv-bar-element-height); padding: 0 4px; }
|
||||
.detail-modes .icon-btn:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 4px; bottom: 4px; width: 1px; background: var(--strong-bg); }
|
||||
@media (prefers-color-scheme: light) { .detail-modes .icon-btn { color: #494949; } }
|
||||
/* .tsv-tool-buttons-bar separator: right calc(-.5·border-radius + 1px) (main.js theme .tsv-tool-buttons-bar rule) */
|
||||
.detail-modes .icon-btn:not(:last-child)::after { content: ""; position: absolute; right: calc(-0.5 * var(--tsv-border-radius) + 1px); top: 4px; bottom: 4px; width: 1px; background: var(--strong-bg); }
|
||||
.detail-modes .icon-btn[aria-pressed="true"] { color: var(--tsv-tint); }
|
||||
.chat-tabs { display: flex; flex-direction: column; gap: 4px; padding: 0; }
|
||||
.chat-tabs:empty { display: none; }
|
||||
@@ -1149,7 +1153,10 @@ body.stream-popout-window { margin: 0; padding: 0; overflow: hidden; background:
|
||||
|
||||
/* ---------- chat (legacy server text chat in the official chat view) ---------- */
|
||||
.chat { position: relative; flex: 1; min-height: 180px; display: flex; flex-direction: column; }
|
||||
.chat-log { flex: 1; min-height: 0; margin: 0; padding: 1px max(0px, calc(var(--tsv-padding-h-small) - var(--chat-scrollbar-width, 0px))) var(--composer-height, 87px) 0; list-style: none; overflow-y: auto; user-select: text; }
|
||||
/* source `.tsv-virtual-list.scrollbar-visible{padding-right:10px}` (main.css@541386): the 10px safe area exists only
|
||||
while the list overflows. A native scrollbar (width > 0 only when overflowing) fills part of it; without one the
|
||||
log has no right inset, so `width * 999` collapses the padding to 0 instead of reserving 10px. */
|
||||
.chat-log { flex: 1; min-height: 0; margin: 0; padding: 1px max(0px, min(var(--chat-scrollbar-width, 0px) * 999, var(--tsv-padding-h-small) - var(--chat-scrollbar-width, 0px))) var(--composer-height, 87px) 0; list-style: none; overflow-y: auto; user-select: text; }
|
||||
.chat-log:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--tsv-tint2); }
|
||||
.chat-empty { padding: 8px 20px 0; color: var(--tsv-font-subtitle-color); font-size: var(--tsv-font-size-small); text-align: center; }
|
||||
.chat-start-prompt { position: absolute; bottom: calc(100% - var(--tsv-padding-v)); left: 0; display: flex; align-items: center; max-width: 100%; margin-bottom: var(--tsv-padding-v-large); padding: var(--tsv-padding-v) var(--tsv-padding-h); border-radius: var(--tsv-border-radius-xxlarge); background: var(--tsv-contrast-bg); pointer-events: none; }
|
||||
@@ -1237,39 +1244,28 @@ html[data-chat-style="compact"] .msg .msg-body::before { display: none; }
|
||||
.composer:is(:hover, :focus-within) { border-color: var(--tsv-tint); }
|
||||
/* formatting toolbar: shaded, 2px 10px, gap 2.5px, 24px buttons (main.css@213134) */
|
||||
.composer-toolbar { display: flex; align-items: center; gap: 2.5px; padding: 2px 10px; border-bottom: 1px solid var(--tsv-separation-border-color); border-radius: var(--tsv-border-radius-large) var(--tsv-border-radius-large) 0 0; background: var(--tsv-shaded-bg); white-space: nowrap; overflow: hidden; }
|
||||
.composer-tool { flex: none; display: inline-flex; align-items: center; min-height: 24px; padding: 0 2.5px; border: 2px solid transparent; border-radius: var(--tsv-border-radius-small); background: transparent; color: var(--tsv-font-color); font: inherit; font-size: var(--tsv-font-size-content); cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease; }
|
||||
.composer-tool { flex: none; display: inline-flex; align-items: center; min-height: 24px; padding: 0 2.5px; border: 2px solid transparent; border-radius: var(--tsv-border-radius-small); background: transparent; color: var(--tsv-font-color); font: inherit; font-size: var(--tsv-font-size-content); cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease; --tsv-icon-base: var(--tsv-font-color); }
|
||||
.composer-tool .icon { width: var(--tsv-icon-size-small); height: var(--tsv-icon-size-small); }
|
||||
.composer-tool.is-group { padding-right: 0; }
|
||||
.composer-tool-text { margin: 0; font-size: var(--tsv-font-size-small); font-weight: var(--tsv-font-weight-normal); line-height: var(--tsv-control-element-height); }
|
||||
.composer-tool-expander { width: var(--tsv-icon-size-small) !important; height: var(--tsv-icon-size-small) !important; margin-left: 0; color: var(--tsv-font-subtitle-color); }
|
||||
.composer-tool-expander { width: var(--tsv-icon-size-small) !important; height: var(--tsv-icon-size-small) !important; margin-left: 0; color: var(--tsv-font-subtitle-color); --tsv-icon-base: var(--tsv-font-subtitle-color); }
|
||||
.composer-tool-expander.only-text { margin-left: 0; }
|
||||
/* overflow "More" (is-overflow TSButton): image first, content margin-left padding-h-minimal (main.css@214344) */
|
||||
.composer-tool.is-overflow .composer-tool-text { margin-left: 5px; }
|
||||
.composer-tool:hover { background: color-mix(in srgb, var(--tsv-bg) 65%, transparent); border-bottom-color: var(--tsv-tint); color: var(--tsv-tint); }
|
||||
.composer-tool:hover { background: color-mix(in srgb, var(--tsv-bg) 65%, transparent); border-bottom-color: var(--tsv-tint); color: var(--tsv-tint); --tsv-icon-base: var(--tsv-tint); }
|
||||
.composer-tool:active, .composer-tool[aria-expanded="true"] { background: color-mix(in srgb, var(--tsv-bg) 80%, transparent); }
|
||||
.composer-row { display: flex; align-items: stretch; }
|
||||
.composer textarea {
|
||||
flex: 1;
|
||||
min-height: 34px;
|
||||
max-height: 250px;
|
||||
padding: 8px 10px;
|
||||
border: 0;
|
||||
border-radius: var(--tsv-border-radius-large);
|
||||
background: transparent;
|
||||
color: var(--tsv-font-color);
|
||||
font-size: var(--tsv-font-size-content);
|
||||
line-height: var(--tsv-line-height-content);
|
||||
letter-spacing: -0.025rem;
|
||||
resize: none;
|
||||
}
|
||||
.composer textarea { font-weight: 400; }
|
||||
.composer textarea:focus-visible { outline: none; }
|
||||
/* the input itself (#chat-editor, one CodeMirror view): styles/chat-editor.css */
|
||||
.composer-actions { flex: none; display: flex; align-items: center; height: var(--tsv-bar-element-height); margin: auto 3px 4px auto; }
|
||||
/* source `.ts-chat-input-container-actions *{margin:auto 3px}`: 24px buttons, glyph inset 3px from the left */
|
||||
.composer-actions .icon-btn { width: 24px; height: 26px; margin: auto 3px; padding: 0; justify-items: start; color: var(--tsv-tint); }
|
||||
.composer-actions .icon-btn .icon { margin-left: 3px; }
|
||||
.composer-actions .icon-btn { --tsv-icon-base: var(--tsv-font-color); }
|
||||
.composer-actions .icon-btn:hover { --tsv-icon-base: var(--tsv-tint); }
|
||||
/* glyphs paint the light module's --tsv-icon-base #494949 (main.js@314275); labels keep --tsv-font-color */
|
||||
@media (prefers-color-scheme: light) {
|
||||
.composer-tool:not(:hover), .composer-actions .icon-btn:not(:hover) { --tsv-icon-base: #494949; }
|
||||
}
|
||||
.composer-actions .icon-btn .icon { transition: transform 0.1s ease-out; }
|
||||
.composer-actions .icon-btn:hover:not(:disabled) .icon { transform: scale(1.2); }
|
||||
.composer-actions .icon-btn:disabled { opacity: 0.5; }
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/* Chat composer editor: one CodeMirror view in #chat-editor (chat-editor.js), contentDOM #chat-input.
|
||||
Source: TSChatInputTextarea `.ts-chat-input` (main.css@212291), its inner editor (@205434) and the
|
||||
CodeMirror overrides scoped to it (@205985-206823). The engine's JS theme only neutralises CodeMirror
|
||||
defaults; every visible value here is the source's. */
|
||||
.composer-editor {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
min-height: 34px;
|
||||
max-height: 250px;
|
||||
padding: var(--tsv-padding-v) var(--tsv-padding-h-small);
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
color: var(--tsv-font-color);
|
||||
font-size: var(--tsv-font-size-content);
|
||||
font-weight: 400;
|
||||
line-height: var(--tsv-line-height-content);
|
||||
/* source -.025rem resolves against the source's fixed 15px root (main.css@1034 `body,html{font-size:15px}`) */
|
||||
letter-spacing: -0.375px;
|
||||
outline: none;
|
||||
}
|
||||
#chat-editor .cm-editor { flex-shrink: 1; min-height: 0; background: transparent; color: var(--tsv-font-color); outline: none; }
|
||||
#chat-editor .cm-editor.cm-focused { outline: none; }
|
||||
#chat-editor .cm-scroller { font-family: inherit; line-height: inherit; overflow: auto; }
|
||||
#chat-editor .cm-content { padding: 0; white-space: pre-wrap; caret-color: var(--tsv-font-color); }
|
||||
#chat-editor .cm-content:focus-visible { outline: none; }
|
||||
/* `.is-empty:before{content:attr(data-placeholder)}` (main.css@205743): subtitle colour, content size */
|
||||
#chat-editor .cm-placeholder { color: var(--tsv-font-subtitle-color); font-size: var(--tsv-font-size-content); pointer-events: none; }
|
||||
#chat-editor .tp-chat-editor-disabled .cm-content { cursor: default; }
|
||||
/* Raw `[id]: url` definitions stay editable source; they are not message content. */
|
||||
#chat-editor .cm-line.tp-chat-editor-definition { color: var(--tsv-font-subtitle-color); }
|
||||
/* Rendered inactive blocks reuse the message markdown rules (.ts-parsed-text-content) without extra spacing. */
|
||||
#chat-editor .tp-chat-editor-block { margin: 0; }
|
||||
@@ -5,6 +5,9 @@
|
||||
Section cards, toggles, the select field and its device caption come from settings.css; the row menu is
|
||||
the shared .client-menu. */
|
||||
|
||||
/* Source main.css@502210: the device selector has 8px above and below, not only above. */
|
||||
#settings-notifications-events .ts-audio-device-selector { margin: var(--tsv-padding-v) 0; }
|
||||
|
||||
#settings-notifications-events .ts-notifications-item { min-width: 0; margin: 0; padding: 0; list-style: none; }
|
||||
|
||||
/* ContentItemCell: 10px side padding (.tsv-no-padding), sub settings 40px in (.tsv-inset-right) with the
|
||||
|
||||
+96
@@ -25,6 +25,46 @@
|
||||
"integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==",
|
||||
"location": "node_modules/@chevrotain/types"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/commands",
|
||||
"version": "6.11.1",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.11.1.tgz",
|
||||
"integrity": "sha512-O/4hG3SC1YwcmQ0d2UVNDs+AsaNWd1iHVxbTeEBuqH+6bExAiPK3iS/BvpY6rZGURALv4ZD3sIgcCmRvw3ehBg==",
|
||||
"location": "node_modules/@codemirror/commands"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/language",
|
||||
"version": "6.13.1",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.13.1.tgz",
|
||||
"integrity": "sha512-zfvU2r3TyylQLMj/te+5CnQ0rSqZi8B1oTCBbQkagcLW4Xc6imab6qN+pEJhsuNOLaJqiRyBXp9UhWA1DhVvDw==",
|
||||
"location": "node_modules/@codemirror/language"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/state",
|
||||
"version": "6.7.6",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.6.tgz",
|
||||
"integrity": "sha512-kAz+AncRtKuIknedxT1bq4XwXv4UowhbkHU1myPrtVb/jZtImWuV5BXzv5vK6i3kYACsdiZiQKFQQ5Mq7elW8w==",
|
||||
"location": "node_modules/@codemirror/state"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/streamparser",
|
||||
"version": "6.0.0",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/streamparser/-/streamparser-6.0.0.tgz",
|
||||
"integrity": "sha512-JTFPF6xrfjt0mnfGPgzcLiMwYmvIyNaoizp8BYzv8FE8KrT6GBGDZ190rtt+O7Wke3gG/MFHyiY9YGNeimof4w==",
|
||||
"location": "node_modules/@codemirror/streamparser"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/view",
|
||||
"version": "6.43.15",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.43.15.tgz",
|
||||
"integrity": "sha512-HHsfpqFeHyXLs983pSRe38Xajs0vFWZQ2BuX0m7Ki8w3jZ5iD8cuR3lBz2/5/X53Dhf32SBHKh6rtSTB6tKeGw==",
|
||||
"location": "node_modules/@codemirror/view"
|
||||
},
|
||||
{
|
||||
"name": "@iconify/types",
|
||||
"version": "2.0.0",
|
||||
@@ -41,6 +81,38 @@
|
||||
"integrity": "sha512-JZHlwdID+dy+lTgbYC8NEC4zeugqeYsc6jewvzb4c58kHauJn+X7rNwQjxz5p2qSjqaEeQoLkCIQ9v/H4PK0/w==",
|
||||
"location": "node_modules/@iconify/utils"
|
||||
},
|
||||
{
|
||||
"name": "@lezer/common",
|
||||
"version": "1.5.5",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.5.tgz",
|
||||
"integrity": "sha512-Pw7PVCndruF1pb3ebCxpSVpkMHSDjwRCLcTRw+RizUKco5QbWylwq2g4lnG/RYN7yTTQDXE9F77MwtkAyphrjg==",
|
||||
"location": "node_modules/@lezer/common"
|
||||
},
|
||||
{
|
||||
"name": "@lezer/highlight",
|
||||
"version": "1.2.5",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.5.tgz",
|
||||
"integrity": "sha512-O1GMVKgtf5YspFaRzpmqkVgMtIk2HG9uMAbH6wdAIdNh3TVzCsch/+cRi+6l2//UGDKe6NB9BW3cvuR5ezMQ0w==",
|
||||
"location": "node_modules/@lezer/highlight"
|
||||
},
|
||||
{
|
||||
"name": "@lezer/lr",
|
||||
"version": "1.4.12",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.12.tgz",
|
||||
"integrity": "sha512-On9HU4oMMiHPMkQDgoTnGahjgG5n/MkN38CgG77sMraKLL+3JBbeQNi1FcCXV9QRqwF9/BUXP3caHyJC1fBOTQ==",
|
||||
"location": "node_modules/@lezer/lr"
|
||||
},
|
||||
{
|
||||
"name": "@marijn/find-cluster-break",
|
||||
"version": "1.0.4",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.4.tgz",
|
||||
"integrity": "sha512-Wy0V7+SGUjnF9/TkiM1hKVDPj7jKXduPNboMVtHTA8dySMURWqfg/JZ9E2Sq8JgSJmkl7k7Qe9FLeMSrSraWmQ==",
|
||||
"location": "node_modules/@marijn/find-cluster-break"
|
||||
},
|
||||
{
|
||||
"name": "@mermaid-js/parser",
|
||||
"version": "1.2.1",
|
||||
@@ -337,6 +409,14 @@
|
||||
"integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==",
|
||||
"location": "node_modules/cose-base"
|
||||
},
|
||||
{
|
||||
"name": "crelt",
|
||||
"version": "1.0.7",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.7.tgz",
|
||||
"integrity": "sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA==",
|
||||
"location": "node_modules/crelt"
|
||||
},
|
||||
{
|
||||
"name": "cytoscape",
|
||||
"version": "3.34.4",
|
||||
@@ -889,6 +969,14 @@
|
||||
"integrity": "sha512-cEmp9QeXXRmjj/rVp9oyiqcvyocWab/HaoN4+bwFeZ7QzykJD6L3yD4v12K1x0tHpqRqVpJevN3gW7kyM39Bqg==",
|
||||
"location": "node_modules/strictdom"
|
||||
},
|
||||
{
|
||||
"name": "style-mod",
|
||||
"version": "4.1.4",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.4.tgz",
|
||||
"integrity": "sha512-XXWIQt633/EpAFx8aZDOTjBzrCaGmhvEQlQo6MVPfa2OzO2cWo+4hV9h+6UkHYlXGfy+ODXKUdP7Pthmcu5ATw==",
|
||||
"location": "node_modules/style-mod"
|
||||
},
|
||||
{
|
||||
"name": "stylis",
|
||||
"version": "4.4.0",
|
||||
@@ -920,6 +1008,14 @@
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.3.tgz",
|
||||
"integrity": "sha512-Sc5u1VVln93y1Xnz4R+CunOZc7R9LUcTmhj7Rc7Eg3HVcf7rVn2FOoa812fe0W8p3jD7xeoGSYbfqCGGH2B6xw==",
|
||||
"location": "node_modules/uuid"
|
||||
},
|
||||
{
|
||||
"name": "w3c-keyname",
|
||||
"version": "2.2.8",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
|
||||
"integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",
|
||||
"location": "node_modules/w3c-keyname"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+133
@@ -164,6 +164,139 @@
|
||||
"sha256": "3ca9d4afd21425087cf31893b8f9f63c81b0b8408db5e343ca76e5f8aa26ab9a"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "codemirror",
|
||||
"bundler": "esbuild@0.28.2",
|
||||
"exports": {
|
||||
"@codemirror/state": [
|
||||
"Annotation",
|
||||
"Compartment",
|
||||
"EditorSelection",
|
||||
"EditorState",
|
||||
"StateField"
|
||||
],
|
||||
"@codemirror/view": [
|
||||
"Decoration",
|
||||
"EditorView",
|
||||
"WidgetType",
|
||||
"keymap",
|
||||
"placeholder"
|
||||
],
|
||||
"@codemirror/commands": [
|
||||
"history",
|
||||
"historyKeymap",
|
||||
"insertNewline",
|
||||
"standardKeymap"
|
||||
]
|
||||
},
|
||||
"patches": [
|
||||
"style-mod: use constructed stylesheets on Document as well as ShadowRoot; no inline style element under the application CSP"
|
||||
],
|
||||
"bundled": [
|
||||
{
|
||||
"name": "@codemirror/commands",
|
||||
"version": "6.11.1",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/language",
|
||||
"version": "6.13.1",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/state",
|
||||
"version": "6.7.6",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/view",
|
||||
"version": "6.43.15",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"name": "@lezer/common",
|
||||
"version": "1.5.5",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"name": "@lezer/highlight",
|
||||
"version": "1.2.5",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"name": "@marijn/find-cluster-break",
|
||||
"version": "1.0.4",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"name": "style-mod",
|
||||
"version": "4.1.4",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"name": "w3c-keyname",
|
||||
"version": "2.2.8",
|
||||
"license": "MIT"
|
||||
}
|
||||
],
|
||||
"files": [
|
||||
{
|
||||
"path": "codemirror/codemirror.js",
|
||||
"generated": true,
|
||||
"sha256": "4d1ae27dba70188a37a581a48d20ff4cfc2c8f81783db1a3157a4d91637381f0"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/package.json",
|
||||
"generated": true,
|
||||
"sha256": "3ca9d4afd21425087cf31893b8f9f63c81b0b8408db5e343ca76e5f8aa26ab9a"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/licenses/@codemirror__commands.LICENSE",
|
||||
"from": "@codemirror/commands/LICENSE",
|
||||
"sha256": "05c6130cda97e7600ca91427a41e8a065efcf82365fc0293e7de80faec494c07"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/licenses/@codemirror__language.LICENSE",
|
||||
"from": "@codemirror/language/LICENSE",
|
||||
"sha256": "05c6130cda97e7600ca91427a41e8a065efcf82365fc0293e7de80faec494c07"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/licenses/@codemirror__state.LICENSE",
|
||||
"from": "@codemirror/state/LICENSE",
|
||||
"sha256": "05c6130cda97e7600ca91427a41e8a065efcf82365fc0293e7de80faec494c07"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/licenses/@codemirror__view.LICENSE",
|
||||
"from": "@codemirror/view/LICENSE",
|
||||
"sha256": "05c6130cda97e7600ca91427a41e8a065efcf82365fc0293e7de80faec494c07"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/licenses/@lezer__common.LICENSE",
|
||||
"from": "@lezer/common/LICENSE",
|
||||
"sha256": "568902fb66eaf1f11750e966b33fd7b5d7c618e65af09f35ef843635bcf5f1ba"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/licenses/@lezer__highlight.LICENSE",
|
||||
"from": "@lezer/highlight/LICENSE",
|
||||
"sha256": "568902fb66eaf1f11750e966b33fd7b5d7c618e65af09f35ef843635bcf5f1ba"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/licenses/@marijn__find-cluster-break.LICENSE",
|
||||
"from": "@marijn/find-cluster-break/LICENSE",
|
||||
"sha256": "9360b00fdd091f05c783b568bdd46c679c41b72415599252de98949462ea1acb"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/licenses/style-mod.LICENSE",
|
||||
"from": "style-mod/LICENSE",
|
||||
"sha256": "cb4474e26547397169061d3586c00022cda5330a1b64fa13e872319f3b63aff1"
|
||||
},
|
||||
{
|
||||
"path": "codemirror/licenses/w3c-keyname.LICENSE",
|
||||
"from": "w3c-keyname/LICENSE",
|
||||
"sha256": "869c30f368eb08735e779027b9f4bc9fea2f39624351856aebe42741f0bc0884"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+307
-1
@@ -1,5 +1,5 @@
|
||||
Chat renderer dependency notices
|
||||
The npm workspace inventory below conservatively includes build/type-only dependencies as well as runtime bundled dependencies.
|
||||
The npm workspace inventory below conservatively includes build/type-only dependencies as well as runtime bundled dependencies; devDependencies (build tools such as esbuild) are not redistributed and are excluded.
|
||||
DOMPurify is redistributed under its Apache-2.0 option. No official TeamSpeak bundle is redistributed.
|
||||
|
||||
===== @antfu/install-pkg@2.1.0 (MIT) =====
|
||||
@@ -261,6 +261,136 @@ SOFTWARE.
|
||||
limitations under the License.
|
||||
|
||||
|
||||
===== @codemirror/commands@6.11.1 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== @codemirror/language@6.13.1 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== @codemirror/state@6.7.6 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== @codemirror/streamparser@6.0.0 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== @codemirror/view@6.43.15 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== @iconify/types@2.0.0 (MIT) =====
|
||||
|
||||
--- license.txt ---
|
||||
@@ -311,6 +441,110 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
===== @lezer/common@1.5.5 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== @lezer/highlight@1.2.5 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== @lezer/lr@1.4.12 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== @marijn/find-cluster-break@1.0.4 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2024 by Marijn Haverbeke <marijn@haverbeke.berlin>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== @mermaid-js/parser@1.2.1 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
@@ -1275,6 +1509,30 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
===== crelt@1.0.7 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
Copyright (C) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== cytoscape@3.34.4 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
@@ -3904,6 +4162,30 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
===== style-mod@4.1.4 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
===== stylis@4.4.0 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
@@ -3995,3 +4277,27 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
===== w3c-keyname@2.2.8 (MIT) =====
|
||||
|
||||
--- LICENSE ---
|
||||
Copyright (C) 2016 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
+16127
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2024 by Marijn Haverbeke <marijn@haverbeke.berlin>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,19 @@
|
||||
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,19 @@
|
||||
Copyright (C) 2016 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
Generated
+1
-1
@@ -1945,7 +1945,7 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
|
||||
|
||||
[[package]]
|
||||
name = "teamspeach-core"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
dependencies = [
|
||||
"audiopus",
|
||||
"base64 0.22.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "teamspeach-core"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
edition = "2021"
|
||||
rust-version = "1.89"
|
||||
description = "TeamsPeach native TeamSpeak protocol core (stdio JSON bridge)"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"schema": "teamspeach-official-parity-features/1",
|
||||
"generated": "2026-11-01",
|
||||
"scope": "Strictly without account (user decision). Remote Apps API excluded. Local CSS theme extensions included.",
|
||||
"scopeReviewed": "2026-11-02: server-hosted MATRIXCHAT split from central account chat; the verification block below remains the historical 2026-11-01 checkpoint",
|
||||
"source": {
|
||||
"officialUi": "C:/Users/Admin/AppData/Local/Programs/TeamSpeak/html/client_ui/main.js",
|
||||
"sha256": "9d6bea2ee5333086555c36584621c1b3462a83042ce746d3229d6766a9b82c39",
|
||||
@@ -323,10 +324,21 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "chat.matrix_features",
|
||||
"id": "chat.central_matrix",
|
||||
"owner": "-",
|
||||
"status": "excluded",
|
||||
"official": "tschat_redactMessage col 2630785 (edit/delete/react/pin/reply/attachments/typing/rooms)"
|
||||
"official": "Central/homebase initialization requires account.isConnected or isPseudoConnected (main.js col 2476536); this is not the decentralized server-chat path"
|
||||
},
|
||||
{
|
||||
"id": "chat.server_matrix",
|
||||
"owner": "AstraChat",
|
||||
"status": "blocked",
|
||||
"official": "MATRIXCHAT capability col 2420596; unconditional decentral manager col 2482171; connectToDecentral(server identity) col 2480332; accept/reject col 3556822; shared room edit/reply/react/redact col 1523559",
|
||||
"blocker": "Native well-known binding, token-to-Matrix login/renewal, device/session lifecycle, server uuidv5 derivation and sync/event payloads are unresolved; chatlogintoken and requestchat constructors are statically observed, not a controlled authenticated exchange",
|
||||
"contract": "Server-identity frontend flow has no myTeamSpeak gate. Implement independently when native transport is established; do not exclude as account-only or expose nonfunctional settings/actions.",
|
||||
"evidence": {
|
||||
"source": ["docs/evidence/official-parity/ts6spec-chat.md", "docs/evidence/ts6-filetransfer-native-continuation.json"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "chat.unread_badge",
|
||||
@@ -529,8 +541,10 @@
|
||||
},
|
||||
"evidenceRoot": "C:/Users/Admin/tmp/teamspeach-official-parity-20261101",
|
||||
"scopeLimits": [
|
||||
"The corrected authorized core 0.1.6 probe on 2026-11-02 explicitly received P2P=true and Matrix/SFU/HTTPFT/S3=false; no positive backend for those protocols was exercised (server-sfu-prerequisite.json)",
|
||||
"SFU authentication/token/SDP negotiation unresolved; no configured controlled endpoint",
|
||||
"HTTPFT/S3 endpoint/payload/header mapping unresolved; no speculative legacy fallback",
|
||||
"Server-hosted MATRIXCHAT is in scope, but native discovery/login/private-invite transport and sync/event envelopes remain unresolved",
|
||||
"Independent DSP is not official private native DSP bit identity",
|
||||
"macOS selected application audio remains unimplemented",
|
||||
"No Asahi ARM execution or physical microphone/speaker/camera/appcapture/globalhook/portal runtime",
|
||||
|
||||
@@ -1,6 +1,63 @@
|
||||
# Official TS6 visual parity — QA harness (2026-11-01)
|
||||
|
||||
## Current result: exact-design correction, 2026-11-01
|
||||
### Rich-text composer checkpoint (2026-11-02, post-release development)
|
||||
|
||||
`rich-editor-csp-confirmed/result.json` passed **14** actual packaged offscreen scenarios: typing,
|
||||
Shift+Enter, formatting and selection, undo/redo, slash and emoji insertion, persisted raw/hybrid mode,
|
||||
refused-send preservation, conversation draft/undo isolation, disabled partner/session state,
|
||||
wide/narrow toolbar collapse, inert hostile Markdown and IME composition. Network requests and page/console
|
||||
errors were empty. Windows redo uses its actual Ctrl+Y binding; the initial smoke's Mac/Linux shortcut
|
||||
was corrected, not added to production as an unrelated shortcut.
|
||||
|
||||
The initial paired run detected CodeMirror's inline stylesheet insertion being blocked by CSP.
|
||||
The pinned vendor build now uses style-mod's constructed-sheet path on Document as well as ShadowRoot;
|
||||
the exact guarded adaptation is recorded in vendor provenance. No CSP directive was relaxed.
|
||||
`rich-editor-csp-pairs/` then passed **8/8** main-screen comparisons with no blocked cases or console errors.
|
||||
|
||||
Packaged app.asar SHA-256: `676360e8aaa7ef3bc4b49098a50c7dd1ecaf32e8eca7ce38a6a99d1a97f858d9`;
|
||||
native core: `86d216cf4891a009548f0f38155ec80f03160e42e6582ea914e8049aa8d59469` (the verified v0.1.6 core).
|
||||
The Node consumer suite passed **505**, with one skipped and no failures. Existing message/history smoke
|
||||
`rich-editor-message-regression/result.json` passed 621-row IPC persistence/restart, cross-scope isolation,
|
||||
safe local KaTeX/Mermaid and generated attack rejection after the parser gained source ranges.
|
||||
|
||||
These are synthetic Windows hidden-runtime checks, not a live send or Asahi proof. Capture methods were
|
||||
refusing test stubs; no physical media was opened. Preview stays raw above 16,384 UTF-16 units (already beyond
|
||||
the sendable 8 KiB message bound). The feature is not in the separately published v0.1.6 snapshot.
|
||||
|
||||
The follow-on `rich-editor-keymaps/result.json` passed **15** development-runtime scenarios, adding all
|
||||
five source formatting shortcuts through actual keyboard events. CI run **#52** passed Linux x64 and
|
||||
ARM64 cross-test jobs for the preceding rich-editor source checkpoint `f618d8b`.
|
||||
|
||||
`rich-editor-final/result.json` subsequently passed **16** packaged scenarios, including list continuation,
|
||||
indent/outdent, empty-item exit, quoted fenced-code continuation and keyboard focus escape. The complete
|
||||
consumer suite then passed **510** tests with one skipped and no failures. Final app.asar SHA-256 is
|
||||
`2d98dcd284260abee9044a19d2cdd06c981134105c847a8fc3050634a2f41a1c`; the verified native core is unchanged.
|
||||
|
||||
`notification-control-metrics.json` and `notification-sound-controls-confirmed.png` record the original
|
||||
and actual product sound-card controls after restoring the selector's source `8px 0` margins: description
|
||||
y=118, slider y=178/h=36 and help y=218 now agree relative to the card. No notification was played.
|
||||
The full `local-settings-current/` comparisons still fail; omitted account/Remote Apps rows, safe default
|
||||
states and truthful app-wide transfer-limit descriptions are not masked or reclassified as passes.
|
||||
|
||||
|
||||
### Common-screen correction checkpoint (2026-11-02, after the release cut)
|
||||
|
||||
`common-screen-confirmed/` under the exact-design evidence root passed **8/8** `main@few` comparisons:
|
||||
EN/RU, dark/light, 1553×998 and 880×800. No blocked cases or harness errors remain. Original captures
|
||||
come from `integrated-settings-pairs/`; thresholds and excluded brand/account/native-caption regions
|
||||
are unchanged. Actual whole-screen and narrow Russian light-composer strips were inspected.
|
||||
|
||||
Corrections cover source icon colors, chevron alignment, header separators, non-overflowing chat width
|
||||
and the original input's −0.375px letter spacing. The active output-device chooser is not painted as a
|
||||
disabled source-only multi-connection menu. Other settings comparisons and whole-client parity remain open.
|
||||
|
||||
This is a development UI-only assembly, not the release package: app.asar SHA-256
|
||||
`4d5800c241aed526ad225fee52262e4231941b02fca3ccc3e1d92595ad0dbda3`, native core unchanged at
|
||||
`5ab259ca57f5252ef355850601c808aa4e2a3496703a77aca90f6f6a63f4eb20`. These post-cut corrections
|
||||
are not part of release commit `72e4ad6`. An initial reuse attempt was blocked by a missing reference
|
||||
directory; the completed run uses the actual reference capture directory, not manufactured captures.
|
||||
|
||||
### Selected-identity, file-settings and notification checkpoint (2026-11-02)
|
||||
|
||||
Package `2026-11-02T07:10:17.354Z`: app.asar
|
||||
|
||||
@@ -1,9 +1,25 @@
|
||||
{
|
||||
"scope": "Read-only configured teamspeak SSH host, SQLite mode=ro, schema inspection and an exact nonsecret server-property allowlist. No TS client joined, no server/configuration/database mutation, no user/credential/token/message records read.",
|
||||
"scope": "Historical read-only SQLite inspection plus the separately user-authorized live capability probe below. No server settings or normal client profile were changed.",
|
||||
"server": "teamspeak (10.10.10.160)",
|
||||
"database": "/opt/teamspeak-server_linux_amd64/tsserver.sqlitedb",
|
||||
"observed": {"server_id": 1, "virtualserver_sfu_endpoint": "", "virtualserver_storage_quota": "4294967295"},
|
||||
"not_present_in_queried_storage": ["virtualserver_capability_extensions", "instance property names matching %sfu% or %capability%"],
|
||||
"limits": ["An empty persisted SFU endpoint does not establish runtime feature flags or all server configurations.", "No live TS6 protocol handshake, access-token acquisition or SFU transport was exercised.", "No configured endpoint was found here for controlled SFU interoperability verification."],
|
||||
"transport": "ssh-manager read-only commands; ssh:// reader refused shell capability validation, so documented SSH command route was used."
|
||||
"historical_limits": ["An empty persisted SFU endpoint does not establish runtime feature flags or all server configurations.", "The historical SQLite inspection performed no live TS6 handshake or token acquisition.", "No configured endpoint was found in that inspection for controlled SFU interoperability verification."],
|
||||
"transport": "Historical SQLite read: ssh-manager with mode=ro. Live probe: isolated native core stdio, temporary identities, input/output muted before connect.",
|
||||
"authorized_live_probe": {
|
||||
"started_at": "2026-11-02T10:19:00.435Z",
|
||||
"finished_at": "2026-11-02T10:19:01.544Z",
|
||||
"client": "TeamsPeach core 0.1.6, Windows x64",
|
||||
"server_version": "6.0.0-beta13.1 [Build: 1790080330]",
|
||||
"source": "servergetvariables/notifyserverupdated via server_info and the resulting snapshot",
|
||||
"capabilities_announced": true,
|
||||
"advertised_features": {"chat": false, "file_transfer_http": false, "file_transfer_s3": false, "stream_p2p": true, "stream_sfu": false},
|
||||
"own_client_muted": {"input": true, "output": true},
|
||||
"token_requests": 0,
|
||||
"invite_requests": 0,
|
||||
"media_frames_sent": 0,
|
||||
"cleanup": {"identities_created": 2, "profiles_removed": 2, "clean_process_exits": 2, "disconnect_events": 2, "forced_kills": 0},
|
||||
"evidence_root": "C:/Users/Admin/tmp/teamspeach-exact-design-20261101/native-server-probe",
|
||||
"limits": ["The first collector lost its own-client summary after disconnect; its incomplete capability observation was not treated as feature absence.", "The corrected second probe retained live own-client flags and read the explicit server-info capability property.", "These are advertisements to this client/protocol session, not proof about every client or configuration, and not media interoperability proof.", "No Matrix/SFU/HTTPFT/S3-positive backend was exercised; tokens and invitations were not requested.", "Ordinary server-side connection/database/log records may remain; no such records were deleted."]
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,9 @@ Token values used (from themes.txt): see §6.
|
||||
|
||||
## 0. Architecture: what drives which chat
|
||||
|
||||
- **One component for every chat.** `ts-chat` (chat container, render@3472672) renders channel chats, private chats and Matrix rooms.
|
||||
- Container getters at main.js@~3431811: `isLegacy = !this.room`, `chat = room ? null : item`, and `room` is set only when `item instanceof NW` (a Matrix room, main.js@1521496).
|
||||
- A **channel item or client item is passed directly**, which makes it a *legacy* chat.
|
||||
- **One component for every chat.** `ts-chat` (render@3472672) renders legacy channel/private text and room-based chat.
|
||||
- Container getters at main.js@~3431811: `isLegacy = !this.room`, `chat = room ? null : item`; `room` is set for the shared `NW` room class. A room does not by itself imply a myTeamSpeak account.
|
||||
- A directly passed channel/client item selects legacy chat. With a decentralized participation, the content view instead passes `roomParticipation.room` (main.js@4324239 / @4326512).
|
||||
- **Legacy chat model** (module 60408, main.js@2137033). Chat target enum: `CLIENT=1` (private), `CHANNEL=2`, `SERVER=3`, `POKE=4`. Event types: `None, TextMessage, Poke, ChannelJoined, ChannelLeft`.
|
||||
- Messages (class main.js@2136580) have the fields `time, isPoke, isSystem, isSelfMentioned, isGroupStart, isDayStart`.
|
||||
- Grouping window constant `CU = 30` (minutes).
|
||||
@@ -19,16 +19,61 @@ Token values used (from themes.txt): see §6.
|
||||
- channel: `ChannelInfo` "Info" → `Chat` "Chat" (`universal.chats` count 1) → `ChannelFiles` "Files". `Chat` is only offered when **your own client is in that channel** (isAvailable checks `GetClients().find(own id)`).
|
||||
- client: `ClientInfo` "Info" → `Chat` (shown only when the client is **not yourself**) → `OwnFiles` (unlisted). This is the private chat.
|
||||
- server: Recording, `Info`, `ServerLog` "Recent Server Events", Permissions … — **no Chat mode for the server**. A server-chat UI surface was not found (see UNRESOLVED). Only the notification strings `settings.notifications.self.text.(from|to).server` refer to server chat.
|
||||
- Matrix room (`chatRoom`): Chat / Pinned / Info / Settings. Account-bound; excluded under the no-account requirement.
|
||||
- Room (`chatRoom`): Chat / Pinned / Info / Settings. Central/homebase rooms are account-bound; server-hosted rooms use the decentralized server-identity path below. Pinning is non-direct-room-only.
|
||||
- The tool button `currentChannelToolButton` (main.js@1746938) has icon `ChannelShowChat`, title "Show current Channel Chat" / "Showing current Channel Chat" ("Показать текущий чат канала" / "Показывается текущий чат канала"), and a Notification-style badge = `channel.chat.GetUnreadMessagesCount()`. The badge is 0 while that chat is the one being shown.
|
||||
- **Pokes**:
|
||||
- Pokes are legacy messages with `isPoke` (bubble class `poke`; no `.poke` CSS rule exists).
|
||||
- Pokes survive the system-message filter: `!e.isSystem || e.isPoke` (main.js@2140412).
|
||||
- The poke notification widget is render@1730302, string `channel.chat.events.client.poked_you` "Poked you".
|
||||
|
||||
### Feature inventory (legacy = server text message / native; Matrix = myTeamSpeak/homebase-only)
|
||||
|
||||
| Feature | Legacy channel / private chat | Matrix-only (account) | Evidence |
|
||||
### Server-hosted Matrix versus central account chat — static scope correction, 2026-11-02
|
||||
|
||||
The server's `MATRIXCHAT` capability enables `hasDecentralMessaging` (main.js@2420596).
|
||||
The decentralized manager starts unconditionally (@2482171), unlike central/default participation,
|
||||
which requires `account.isConnected || account.isPseudoConnected` (@2476536).
|
||||
|
||||
On a server connection, `getConnectionParticipation` keys participation by `uuidv5/usedIdentityId`
|
||||
(@2556137); `connectToDecentral` requires that server identity, calls native `getWellKnown(scHandlerId)`
|
||||
and consumes `chat.domain`. It then calls `tschat_create(scHandlerId, serverUuid, identityId, endpoint)`
|
||||
and `tschat_connect(tsChatId, displayName, presence)` (@2480332, @2486407, @2526967).
|
||||
There is no frontend myTeamSpeak login gate in this route. **Native authentication is still unresolved**;
|
||||
these static findings are not a successful account-free server-room login.
|
||||
|
||||
Incoming `PrivateChat` invitations create a direct participation. Manual Accept and the default-false
|
||||
`autoAcceptIncomingDirectChats` setting both set `permanentlyJoined=true` (@1328392, @3556822), leading
|
||||
to native `tschat_joinRoom`. Reject calls `tschat_leaveRoom`. An outgoing private request instead uses
|
||||
`tschat_requestPrivateChat(scHandlerId, clientId)` and waits up to ten seconds for a matching invitation.
|
||||
Channel participation waits for and accepts its own channel invitation. Peer availability, the
|
||||
`CAN_RECIEVE_TEXTMESSAGES` hint and room permissions still gate actions.
|
||||
|
||||
Both decentralized and central paths use room class `NW` (@2585285). The edit/reply/react/redact menu
|
||||
does not require a central room (@1523559); edit additionally checks sender/permission and pending/redacted
|
||||
state, and pinning requires a non-direct room. Native sync/E2EE/event behavior has not been exercised.
|
||||
Attachments need server `HTTPFT`, or the separate central fallback with `mytsFeaturesEnabled`; do not
|
||||
infer that account-free room text therefore includes central attachment storage.
|
||||
|
||||
Static native inspection subsequently recovered two command constructors from `TeamSpeak.dll`
|
||||
(SHA-256 `b4888a71b8e7a029e7124950737874e124aff7404f126ed8140b55273113edcb`):
|
||||
|
||||
- `0x181496030` constructs `chatlogintoken` without adding command parameters.
|
||||
- `0x1814b6140` constructs `requestchat type=private clid=<uint16>`; a different type returns `0x602` before sending.
|
||||
- The registered `notifychatlogintoken` handler at `0x1814b1960` reads string field `token` and passes it
|
||||
to a per-connection callback. No token value or network traffic was captured.
|
||||
|
||||
Exact disassembly and limits are in `native-chat-command-constructors.json` under
|
||||
`C:/Users/Admin/tmp/teamspeach-exact-design-20261101/`. These are constructor facts, not an executed
|
||||
exchange; common command transport may add return-code metadata.
|
||||
|
||||
Independent implementation still needs the native well-known binding and full envelope, token-to-Matrix
|
||||
login construction and renewal, device/session lifecycle, server `uuidv5` derivation and room/sync payloads.
|
||||
The string `http://{0}/.well-known/teamspeak/{1}` is recorded in `../ts6-filetransfer-native-continuation.json`;
|
||||
its placeholders are not established here. Go build metadata identifies the chat library as a private local
|
||||
`tschat_client_lib` module, not an independently reusable ARM64 implementation.
|
||||
|
||||
### Feature inventory (legacy server text versus shared room-based chat)
|
||||
|
||||
| Feature | Legacy channel / private chat | Room-based (server-hosted or central) | Evidence |
|
||||
|---|---|---|---|
|
||||
| Send/receive text, BBCode + markdown render | yes | yes | markdown help intro "We still support BBCode" (en.json `settings.chat.markdown_help.intro.body`) |
|
||||
| Join/leave/move/kick/ban/poke system rows | yes (`legacyEvent` + `i18nPath`) | own variants | main.js@3305577 |
|
||||
@@ -282,7 +327,7 @@ Legacy event strings (en / ru):
|
||||
| `.ts-chat-input-container-content` | look | bg `--tsv-bg` (theme); radius 8px; flex column; z-index 6 | | theme@34898, main.css@211964 |
|
||||
| | light extra | `--ts-chat-background-color` = contrast-bg on `.ts-chat-input-container-inner`; input colour font-color | | main.js@201685@115487 (light only) |
|
||||
| content-inner | layout | flex row, nowrap, stretch | | main.css@212210 |
|
||||
| textarea `.ts-chat-input` | typography | **14px**, weight 400, letter-spacing −0.025rem (−0.4px), line-height **18px**, colour font-color (#FFF / #1a1a1a) | | main.css@212377 |
|
||||
| editor `.ts-chat-input` | typography | **14px**, weight 400, letter-spacing −0.025rem (−0.375px at the source's fixed 15px root), line-height **18px**, colour font-color (#FFF / #1a1a1a) | | main.css@212377, @1034 |
|
||||
| | box | padding **8px 10px**; max-height 250px; transparent; no border | | |
|
||||
| | `.error` | colour `--ts-error-color` #f82929 | | |
|
||||
| placeholder (`.is-empty::before`) | look | subtitle colour #697A97 / #445d77; 14px; absolute 0,0 | | main.css@205825 |
|
||||
@@ -396,7 +441,7 @@ Button order `ve` (main.js@3517677). Overflowing items collapse into the **More*
|
||||
|
||||
**Hover quick-actions bar:**
|
||||
- Pill radius (theme), shaded-bg at .9, buttons separated by 1px `--strong-bg` dividers; shows at most 2 buttons plus an expander.
|
||||
- Matrix-only: needs `room`.
|
||||
- Room-based: needs `room`, which may belong to a TS server or the central/account connection.
|
||||
|
||||
**Keyboard and drag-drop:**
|
||||
- Composer: `keydown` handler, paste handler, drop handler.
|
||||
|
||||
@@ -47,7 +47,7 @@ User captures of the official client (session-local, not copied) confirmed place
|
||||
| `.msg-system` | `.ts-chat-message-system-body.compact` | 23px, radius 10, #131824→transparent 80%, 13/15 subtitle, bold names #acacac | css@477464, D@33354 |
|
||||
| `.composer` | `.ts-chat-input-container` | margin 10, `--tsv-bg`, 1px #697a97 → tint, radius 8 | css@206847, D@34684 |
|
||||
| `.composer-toolbar`, `.composer-tool` | `.ts-chat-input-edit-toolbar` | shaded, 2px 10px, gap 2.5, buttons 24px radius 2 | css@213134–215372 |
|
||||
| `.composer textarea` | `.ts-chat-input` | 14/18, padding 8px 10px, letter-spacing −.025rem | css@212377 |
|
||||
| `.composer-editor` / CodeMirror content | `.ts-chat-input` | 14/18, padding 8px 10px, letter-spacing −.375px (source −.025rem at 15px root) | css@212377, css@1034 |
|
||||
| `.settings-nav`, `.nav-item` | `.tsv-settings-categories` | clamp(30ch,20vw,50ch), 44px rows, highlight #282F40 + 4px tint bar | css@259528, D@55972–56581 |
|
||||
| `.card` | `.ts-widget-wrapper` | header-bg, radius 15, padding 8px 20px, 12px gaps | D@57054, css@35075 |
|
||||
| `.card-title` | `.ts-widget-section-header .title` | 15/19 semibold, 16px below | D@57857 |
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "teamspeach",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "teamspeach",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.7",
|
||||
"license": "UNLICENSED",
|
||||
"dependencies": {
|
||||
"electron-updater": "6.8.11",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "teamspeach",
|
||||
"productName": "TeamsPeach",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.7",
|
||||
"description": "Desktop TeamSpeak 6 client: voice, chat and TS6 screenshare viewing",
|
||||
"main": "app/main/main.js",
|
||||
"private": true,
|
||||
|
||||
@@ -0,0 +1,349 @@
|
||||
// Offscreen chat-editor regression: one CodeMirror composer, real keyboard/IME input through CDP, real toolbar,
|
||||
// slash/emoji completion, Settings toggle persistence, undo/selection across hybrid/raw, conversation isolation,
|
||||
// session gates and hostile Markdown in the live preview. Synthetic core IPC only; no server, network, media,
|
||||
// clipboard, native dialog or OS input. Never run on the interactive desktop: the shared harness enforces offscreen.
|
||||
import { closeSettings, launchApp } from './lib/electron-app.mjs';
|
||||
import assert from 'node:assert/strict';
|
||||
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { maliciousMessages } from '../test/fixtures/chat-markup.mjs';
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const opt = (key, fallback) => args.includes(`--${key}`) ? args[args.indexOf(`--${key}`) + 1] : fallback;
|
||||
const out = path.resolve(opt('out', 'smoke-out/chat-editor'));
|
||||
const profile = mkdtempSync(path.join(tmpdir(), 'teamspeach-chat-editor-'));
|
||||
mkdirSync(out, { recursive: true });
|
||||
const result = { scope: 'Offscreen disposable Electron; synthetic core IPC and snapshots; CDP keyboard/IME input into the real CodeMirror contentDOM. No server, network, capture, sound, OS clipboard, native dialog or global input.', checks: [], screenshots: [], errors: [], network: [] };
|
||||
let app;
|
||||
let page;
|
||||
let revision = 0;
|
||||
const SELF = { id: 1, uid: 'ZWRpdG9yLXNlbGY=', nickname: 'EditorQA', channel_id: 10, is_self: true, input_muted: true, output_muted: true, input_hardware: true, output_hardware: true, server_groups: [] };
|
||||
const PEER = { id: 2, uid: 'ZWRpdG9yLXBlZXI=', nickname: 'Peer', channel_id: 10, input_muted: false, output_muted: false, input_hardware: true, output_hardware: true, server_groups: [] };
|
||||
const snapshot = (clients = [SELF, PEER]) => ({
|
||||
event: 'snapshot', rev: ++revision, own_client_id: 1, own_channel_id: 10,
|
||||
server: { uid: 'ZWRpdG9yLXNlcnZlcg==', name: 'Editor QA', version: 'fixture', welcome_message: '', hostbanner_gfx_url: null, hostbanner_url: null },
|
||||
channels: [{ id: 10, parent_id: 0, order: 0, depth: 0, name: 'Lobby', topic: '', codec: 'opus_voice', needed_talk_power: 0, has_password: false }],
|
||||
clients, server_groups: [], channel_groups: [],
|
||||
});
|
||||
const send = (event) => app.evaluate(({ BrowserWindow }, value) => BrowserWindow.getAllWindows()[0].webContents.send('core:event', { ...value, connectionId: 'c1' }), event);
|
||||
const resize = (width, height) => app.evaluate(({ BrowserWindow }, size) => BrowserWindow.getAllWindows()[0].setContentSize(...size), [width, height]);
|
||||
const check = (name, data = {}) => result.checks.push({ name, ...data });
|
||||
const shot = async (name) => { const file = `${name}.png`; await page.screenshot({ path: path.join(out, file) }); result.screenshots.push(file); };
|
||||
const sent = () => app.evaluate(() => globalThis.__editorCommands.filter((c) => c.cmd === 'send_text'));
|
||||
const t = (key) => page.evaluate(async (k) => (await import('./js/i18n.js')).t(k), key);
|
||||
const state = () => page.evaluate(async () => {
|
||||
const editor = (await import('./js/chat.js')).composerEditor();
|
||||
const root = document.querySelector('#chat-editor .cm-editor');
|
||||
const input = document.querySelector('#chat-input');
|
||||
return { value: editor.value, start: editor.selectionStart, end: editor.selectionEnd, disabled: editor.disabled,
|
||||
editable: input.contentEditable, ariaDisabled: input.getAttribute('aria-disabled'), focused: document.activeElement === input,
|
||||
hybrid: root.classList.contains('tp-chat-editor-hybrid'), blocks: root.querySelectorAll('.tp-chat-editor-block').length,
|
||||
views: document.querySelectorAll('#chat-editor .cm-editor').length };
|
||||
});
|
||||
const select = (start, end) => page.evaluate(async ([s, e]) => (await import('./js/chat.js')).composerEditor().setSelectionRange(s, e), [start, end]);
|
||||
const clear = async () => { await page.focus('#chat-input'); await page.keyboard.press('ControlOrMeta+A'); await page.keyboard.press('Delete'); };
|
||||
const setRichText = async (on) => {
|
||||
await page.click('#btn-settings');
|
||||
await page.click('#settings-nav [data-panel="chats"]');
|
||||
const toggle = page.getByRole('switch', { name: await t('settings.chat.text_edit.rich_text'), exact: false });
|
||||
if (on) await toggle.check(); else await toggle.uncheck();
|
||||
const subtitle = await t(on ? 'settings.chat.text_edit.rich_text.enabled' : 'settings.chat.text_edit.rich_text.disabled');
|
||||
await page.waitForFunction((text) => [...document.querySelectorAll('#settings-chat-markdown *')].some((n) => n.childElementCount === 0 && n.textContent === text), subtitle);
|
||||
const stored = await page.evaluate(async () => (await (await import('./js/core.js')).tp.getPrefs()).chatRichTextEditor);
|
||||
await closeSettings(page);
|
||||
return stored;
|
||||
};
|
||||
|
||||
try {
|
||||
app = await launchApp({ exe: opt('exe'), profile });
|
||||
page = await app.firstWindow();
|
||||
page.on('pageerror', (error) => result.errors.push(error.message));
|
||||
page.on('console', (message) => { if (message.type() === 'error') result.errors.push(message.text()); });
|
||||
await page.route(/^(https?|wss?|ftp):\/\//, (route) => { result.network.push(route.request().url()); return route.abort(); });
|
||||
await page.waitForSelector('#view-onboarding', { state: 'visible', timeout: 30000 });
|
||||
await page.evaluate(() => {
|
||||
for (const method of ['getUserMedia', 'getDisplayMedia']) navigator.mediaDevices[method] = async () => { throw new DOMException('Capture forbidden in editor QA', 'NotAllowedError'); };
|
||||
});
|
||||
await page.fill('#onboarding-nick', 'EditorQA');
|
||||
await page.click('#onboarding-submit');
|
||||
await page.waitForSelector('#view-app', { state: 'visible' });
|
||||
await page.waitForFunction(() => window.teamspeachDiagnostics?.snapshot().core === 'ready');
|
||||
// Only this disposable process replaces its request handler. send_text is recorded and refused, so no sent-message
|
||||
// sound plays and the failed send must keep the draft exactly as a real refusal would.
|
||||
await app.evaluate(({ ipcMain }) => {
|
||||
globalThis.__editorCommands = [];
|
||||
ipcMain.removeHandler('core:request');
|
||||
ipcMain.handle('core:request', (_event, connectionId, cmd, args) => {
|
||||
globalThis.__editorCommands.push({ connectionId, cmd, args });
|
||||
if (cmd === 'set_transmit') return { ok: true, result: { mode: args.mode, sensitivity: args.sensitivity } };
|
||||
if (cmd === 'stream_list') return { ok: true, result: { results: [] } };
|
||||
return { ok: false, error: { code: 'not_connected', message: 'Offline editor fixture' } };
|
||||
});
|
||||
});
|
||||
await resize(1280, 800);
|
||||
await send({ event: 'audio_state', input_muted: true, output_muted: true, transmitting: false });
|
||||
await send(snapshot());
|
||||
await page.waitForFunction(() => document.querySelector('#chat-input')?.contentEditable === 'true');
|
||||
|
||||
// One editor, source placeholder metrics, rich text on by default.
|
||||
const initial = await page.evaluate(() => {
|
||||
const placeholder = document.querySelector('#chat-editor .cm-placeholder');
|
||||
const style = placeholder && getComputedStyle(placeholder);
|
||||
const host = getComputedStyle(document.querySelector('#chat-editor'));
|
||||
return { textareas: document.querySelectorAll('#chat-form textarea').length, placeholder: placeholder?.textContent ?? null,
|
||||
letterSpacing: style?.letterSpacing, color: style?.color, fontSize: host.fontSize, lineHeight: host.lineHeight,
|
||||
subtitle: getComputedStyle(document.documentElement).getPropertyValue('--tsv-font-subtitle-color').trim(), role: document.querySelector('#chat-input').getAttribute('role'),
|
||||
label: document.querySelector('#chat-input').getAttribute('aria-label') };
|
||||
});
|
||||
const initialState = await state();
|
||||
assert.equal(initial.textareas, 0, 'no hidden textarea mirror');
|
||||
assert.equal(initialState.views, 1);
|
||||
assert.equal(initialState.hybrid, true, 'chatRichTextEditor defaults to hybrid preview');
|
||||
assert.equal(initial.placeholder, await t('chat.sendMessage'));
|
||||
assert.equal(initial.letterSpacing, '-0.375px');
|
||||
assert.equal(initial.fontSize, '14px'); assert.equal(initial.lineHeight, '18px');
|
||||
assert.equal(initial.role, 'textbox'); assert.equal(initial.label, await t('ui.message'));
|
||||
check('Single CodeMirror composer with source placeholder metrics, hybrid by default', { ...initial, ...initialState });
|
||||
await shot('01-empty-hybrid-dark');
|
||||
|
||||
// Real typing, Shift+Enter newline, Enter stays out of CodeMirror and leaves the line inactive/rendered.
|
||||
await page.focus('#chat-input');
|
||||
await page.keyboard.type('Hello **bold** world');
|
||||
await page.keyboard.press('Shift+Enter');
|
||||
await page.keyboard.type('second line');
|
||||
let now = await state();
|
||||
assert.equal(now.value, 'Hello **bold** world\nsecond line');
|
||||
assert.equal(now.start, now.value.length); assert.equal(now.end, now.value.length);
|
||||
const preview = await page.evaluate(() => ({ strong: [...document.querySelectorAll('#chat-editor .tp-chat-editor-block strong')].map((n) => n.textContent),
|
||||
rawActive: [...document.querySelectorAll('#chat-editor .cm-line')].some((n) => n.textContent === 'second line') }));
|
||||
assert.deepEqual(preview.strong, ['bold'], 'inactive line renders through the safe renderer');
|
||||
assert.equal(preview.rawActive, true, 'active line stays raw source');
|
||||
assert.deepEqual(await sent(), []);
|
||||
check('Typing, Shift+Enter and hybrid preview of the inactive line', { value: now.value, preview });
|
||||
await shot('02-hybrid-typed-dark');
|
||||
|
||||
// Toolbar formatting is a text transaction with selection, undoable and redoable. CodeMirror joins adjacent
|
||||
// edits made within 500 ms into one undo event, so distinct steps wait past that window.
|
||||
const settle = () => page.waitForTimeout(600);
|
||||
await settle();
|
||||
await select(21, 27);
|
||||
await page.click('#chat-format-bar [data-format="italic"]');
|
||||
now = await state();
|
||||
assert.equal(now.value, 'Hello **bold** world\n*second* line');
|
||||
assert.deepEqual([now.start, now.end, now.focused], [22, 28, true]);
|
||||
await settle();
|
||||
await page.click('#chat-format-bar [data-format="italic"]');
|
||||
assert.equal((await state()).value, 'Hello **bold** world\nsecond line', 'toolbar toggles a wrapped selection back');
|
||||
await page.keyboard.press('ControlOrMeta+Z');
|
||||
assert.equal((await state()).value, 'Hello **bold** world\n*second* line', 'undo restores the formatted text');
|
||||
await page.keyboard.press(process.platform === 'win32' ? 'Control+y' : 'ControlOrMeta+Shift+z');
|
||||
assert.equal((await state()).value, 'Hello **bold** world\nsecond line', 'redo re-applies the unwrap');
|
||||
check('Toolbar wrap/unwrap with selection, undo and redo');
|
||||
|
||||
// Slash completion consumes Enter before the send listener and CodeMirror.
|
||||
await page.keyboard.press('End');
|
||||
await page.keyboard.press('Shift+Enter');
|
||||
await page.keyboard.type('/bol');
|
||||
await page.waitForSelector('#chat-slash-completion [role=option]');
|
||||
assert.equal(await page.getAttribute('#chat-input', 'aria-activedescendant'), 'chat-slash-0');
|
||||
await page.keyboard.press('Enter');
|
||||
await page.keyboard.type('x');
|
||||
now = await state();
|
||||
assert.equal(now.value, 'Hello **bold** world\nsecond line\n**x**');
|
||||
assert.equal(await page.locator('#chat-slash-completion').count(), 0);
|
||||
assert.equal(await page.getAttribute('#chat-input', 'aria-activedescendant'), null);
|
||||
assert.deepEqual(await sent(), [], 'completion Enter never sends');
|
||||
check('Slash completion replaces its token and keeps the caret inside the snippet', { value: now.value });
|
||||
|
||||
// Emoji picker inserts at the remembered selection and returns focus.
|
||||
await settle();
|
||||
await page.click('#chat-emoji');
|
||||
await page.fill('.chat-emoji-picker input[type=search]', 'smile');
|
||||
await page.click('.chat-emoji-picker button[title=":smile:"]');
|
||||
now = await state();
|
||||
assert.equal(now.value, 'Hello **bold** world\nsecond line\n**x:smile:**');
|
||||
assert.equal(now.focused, true);
|
||||
check('Emoji insertion at the remembered caret');
|
||||
|
||||
// Raw/hybrid toggle through Settings: same view, same document/selection/history, persisted.
|
||||
await select(6, 14);
|
||||
const beforeToggle = await state();
|
||||
assert.equal(await setRichText(false), false, 'raw choice persisted by main prefs');
|
||||
now = await state();
|
||||
assert.deepEqual({ value: now.value, start: now.start, end: now.end, views: now.views, hybrid: now.hybrid, blocks: now.blocks },
|
||||
{ value: beforeToggle.value, start: 6, end: 14, views: 1, hybrid: false, blocks: 0 });
|
||||
await shot('03-raw-dark');
|
||||
await page.focus('#chat-input');
|
||||
await page.keyboard.press('ControlOrMeta+Z');
|
||||
assert.equal((await state()).value, 'Hello **bold** world\nsecond line\n**x**', 'history survives the mode switch');
|
||||
await page.keyboard.press(process.platform === 'win32' ? 'Control+y' : 'ControlOrMeta+Shift+z');
|
||||
assert.equal((await state()).value, beforeToggle.value);
|
||||
assert.equal(await setRichText(true), true);
|
||||
now = await state();
|
||||
assert.equal(now.hybrid, true); assert.equal(now.views, 1); assert.equal(now.value, beforeToggle.value);
|
||||
check('Settings toggle reconfigures the same editor immediately and persists', { stored: false, restored: true });
|
||||
|
||||
// Enter sends the exact trimmed text; the refused send keeps the draft and inserts no newline.
|
||||
await clear();
|
||||
await page.keyboard.type('Ship it ');
|
||||
await page.keyboard.press('Enter');
|
||||
await page.waitForFunction(() => document.querySelector('.toast[data-kind="error"]'));
|
||||
const attempts = await sent();
|
||||
assert.equal(attempts.length, 1);
|
||||
assert.deepEqual({ cmd: attempts[0].cmd, target: attempts[0].args.target, message: attempts[0].args.message }, { cmd: 'send_text', target: 'channel', message: 'Ship it' });
|
||||
assert.equal((await state()).value, 'Ship it ');
|
||||
await page.evaluate(() => document.querySelectorAll('.toast .icon-btn').forEach((button) => button.click()));
|
||||
check('Plain Enter sends through the chat listener; refused send preserves the draft');
|
||||
|
||||
// Conversation identity change resets document, selection and undo; returning restores only the draft.
|
||||
await clear();
|
||||
await page.keyboard.type('channel draft');
|
||||
await page.evaluate(async () => { const { S } = await import('./js/state.js'); (await import('./js/chat.js')).openPrivate(S.connections.get('c1'), 2); });
|
||||
now = await state();
|
||||
assert.deepEqual([now.value, now.start, now.end], ['', 0, 0]);
|
||||
await page.focus('#chat-input');
|
||||
await page.keyboard.press('ControlOrMeta+Z');
|
||||
assert.equal((await state()).value, '', 'undo cannot reach the other conversation');
|
||||
await page.keyboard.type('private draft');
|
||||
await page.evaluate(async () => (await import('./js/chat.js')).showOwnChannel());
|
||||
assert.equal((await state()).value, 'channel draft');
|
||||
await page.focus('#chat-input');
|
||||
await page.keyboard.press('ControlOrMeta+Z');
|
||||
assert.equal((await state()).value, 'channel draft', 'no cross-conversation undo after returning');
|
||||
// Re-rendering the same conversation (snapshot) keeps the live editor history.
|
||||
await page.keyboard.type('!');
|
||||
await send(snapshot());
|
||||
await page.waitForTimeout(100);
|
||||
await page.focus('#chat-input');
|
||||
await page.keyboard.press('ControlOrMeta+Z');
|
||||
assert.equal((await state()).value, 'channel draft', 'same conversation keeps undo across re-render');
|
||||
check('Conversation switch isolates drafts and undo history');
|
||||
|
||||
// Session gate: the private partner leaves; the surface is not editable and controls are disabled.
|
||||
await page.evaluate(async () => { const { S } = await import('./js/state.js'); (await import('./js/chat.js')).openPrivate(S.connections.get('c1'), 2); });
|
||||
assert.equal((await state()).value, 'private draft');
|
||||
await send(snapshot([SELF]));
|
||||
await page.waitForFunction(() => document.querySelector('#chat-input').contentEditable === 'false');
|
||||
now = await state();
|
||||
assert.deepEqual({ disabled: now.disabled, editable: now.editable, aria: now.ariaDisabled }, { disabled: true, editable: 'false', aria: 'true' });
|
||||
await page.keyboard.type('ignored');
|
||||
assert.equal((await state()).value, 'private draft');
|
||||
assert.equal(await page.evaluate(() => [...document.querySelectorAll('#chat-format-bar button, #chat-emoji, #chat-send')].every((b) => b.disabled)), true);
|
||||
assert.equal(await page.locator('#chat-editor .cm-placeholder').count(), 0, 'the draft, not a placeholder, remains visible');
|
||||
check('Disabled session gate on the real editable surface');
|
||||
await page.evaluate(async () => (await import('./js/chat.js')).showOwnChannel());
|
||||
await page.waitForFunction(() => document.querySelector('#chat-input').contentEditable === 'true');
|
||||
|
||||
// Toolbar collapse still measures the real buttons at both widths.
|
||||
for (const [width, height] of [[1280, 800], [880, 560]]) {
|
||||
await resize(width, height);
|
||||
await page.waitForTimeout(150);
|
||||
const bar = await page.evaluate(() => {
|
||||
const node = document.querySelector('#chat-format-bar');
|
||||
const tools = [...node.querySelectorAll('button[data-format], button[data-format-group]')];
|
||||
return { overflow: node.scrollWidth > node.clientWidth, hidden: tools.filter((n) => n.hidden).length, more: !document.querySelector('#chat-format-more').hidden };
|
||||
});
|
||||
assert.equal(bar.overflow, false); assert.equal(bar.more, bar.hidden > 0);
|
||||
check(`Toolbar collapse at ${width}px`, bar);
|
||||
}
|
||||
await resize(1280, 800);
|
||||
|
||||
// Hostile Markdown typed into the hybrid editor renders inertly: no script, remote fetch, live link or handler.
|
||||
await clear();
|
||||
await page.evaluate(() => { globalThis.CHAT_XSS = null; });
|
||||
for (const source of maliciousMessages) { await page.keyboard.insertText(source); await page.keyboard.press('Shift+Enter'); }
|
||||
await page.keyboard.insertText('tail');
|
||||
await page.waitForTimeout(300);
|
||||
const hostile = await page.evaluate(() => {
|
||||
const host = document.querySelector('#chat-editor');
|
||||
return { blocks: host.querySelectorAll('.tp-chat-editor-block').length,
|
||||
// KaTeX draws some glyphs as local inline <svg>; any other svg, or svg content that can act, is a failure.
|
||||
active: host.querySelectorAll('script,iframe,object,embed,foreignObject,frame,link,meta,style,svg:not(.katex svg),svg script,svg use,svg image,svg a').length,
|
||||
remoteImages: [...host.querySelectorAll('img')].filter((n) => !/^(data|blob):/.test(n.getAttribute('src') ?? 'data:')).length,
|
||||
hrefs: host.querySelectorAll('[href], [src^="javascript:"], [action], [formaction]').length,
|
||||
handlers: [...host.querySelectorAll('*')].flatMap((n) => [...n.attributes]).filter((a) => /^on/i.test(a.name)).length,
|
||||
styles: host.querySelectorAll('.cm-content [style*="url("]').length, xss: globalThis.CHAT_XSS };
|
||||
});
|
||||
now = await state();
|
||||
assert.ok(hostile.blocks > 0, 'inactive hostile lines were rendered, not skipped');
|
||||
assert.deepEqual({ ...hostile, blocks: 0 }, { blocks: 0, active: 0, remoteImages: 0, hrefs: 0, handlers: 0, styles: 0, xss: null });
|
||||
assert.equal(now.value, `${maliciousMessages.join('\n')}\ntail`, 'source text is preserved exactly');
|
||||
await page.click('#chat-editor .tp-chat-editor-block');
|
||||
assert.equal(await page.evaluate(() => globalThis.CHAT_XSS ?? null), null);
|
||||
check('Hostile Markdown in hybrid preview stays inert and exact', hostile);
|
||||
await shot('04-hostile-hybrid-dark');
|
||||
|
||||
// IME composition commits through CodeMirror's input path.
|
||||
await clear();
|
||||
const cdp = await page.context().newCDPSession(page);
|
||||
await cdp.send('Input.imeSetComposition', { text: 'にほん', selectionStart: 3, selectionEnd: 3 });
|
||||
await cdp.send('Input.insertText', { text: '日本' });
|
||||
await cdp.detach();
|
||||
await page.waitForTimeout(100);
|
||||
assert.equal((await state()).value, '日本');
|
||||
assert.deepEqual((await sent()).length, 1, 'composition never sends');
|
||||
check('IME composition commit');
|
||||
|
||||
for (const [shortcut, expected] of [
|
||||
['ControlOrMeta+b', '**word**'], ['ControlOrMeta+i', '*word*'],
|
||||
['ControlOrMeta+k', '[word](https://)'], ['ControlOrMeta+Backquote', '`word`'],
|
||||
['ControlOrMeta+Alt+c', '```\nword\n```'],
|
||||
]) {
|
||||
await clear();
|
||||
await page.keyboard.type('word');
|
||||
await select(0, 4);
|
||||
await page.keyboard.press(shortcut);
|
||||
assert.equal((await state()).value, expected, shortcut);
|
||||
}
|
||||
assert.equal((await sent()).length, 1, 'formatting shortcuts never send');
|
||||
check('Original bold, italic, link, inline-code and code-block keyboard bindings');
|
||||
|
||||
await clear();
|
||||
await page.keyboard.type('- first');
|
||||
await page.keyboard.press('Shift+Enter');
|
||||
assert.equal((await state()).value, '- first\n- ');
|
||||
await page.keyboard.type('second');
|
||||
await page.keyboard.press('Tab');
|
||||
assert.equal((await state()).value, '- first\n - second');
|
||||
await page.keyboard.press('Shift+Tab');
|
||||
assert.equal((await state()).value, '- first\n- second');
|
||||
await page.keyboard.press('Shift+Enter');
|
||||
await page.keyboard.press('Shift+Enter');
|
||||
assert.equal((await state()).value, '- first\n- second\n');
|
||||
await page.keyboard.type('plain');
|
||||
await page.keyboard.press('Tab');
|
||||
assert.equal((await state()).focused, false, 'ordinary Tab leaves non-list text');
|
||||
await clear();
|
||||
await page.keyboard.type('> ```');
|
||||
await page.keyboard.press('Shift+Enter');
|
||||
await page.keyboard.type('- literal');
|
||||
await page.keyboard.press('Shift+Enter');
|
||||
assert.equal((await state()).value, '> ```\n> - literal\n> ', 'quoted code retains quotes, not a list marker');
|
||||
await clear();
|
||||
await page.keyboard.type('- leave editor');
|
||||
await page.keyboard.press('Escape');
|
||||
await page.keyboard.press('Tab');
|
||||
assert.equal((await state()).focused, false, 'Escape then Tab escapes list indentation');
|
||||
assert.equal((await sent()).length, 1, 'list controls never send');
|
||||
check('List continuation, indent/outdent, empty-item exit and accessible Tab escape');
|
||||
|
||||
assert.deepEqual(result.network, []);
|
||||
assert.deepEqual(result.errors, []);
|
||||
const safety = await app.evaluate(({ BrowserWindow }) => { const win = BrowserWindow.getAllWindows()[0]; return { visible: win.isVisible(), focused: win.isFocused(), focusable: win.isFocusable(), offscreen: win.webContents.isOffscreen(), muted: win.webContents.isAudioMuted() }; });
|
||||
assert.deepEqual(safety, { visible: false, focused: false, focusable: false, offscreen: true, muted: true });
|
||||
result.commands = (await app.evaluate(() => globalThis.__editorCommands)).map((c) => c.cmd);
|
||||
assert.equal(result.commands.includes('connect'), false);
|
||||
check('Offscreen safety and command log', { safety });
|
||||
result.ok = true;
|
||||
} catch (error) {
|
||||
result.ok = false;
|
||||
result.errors.push(error.stack || String(error));
|
||||
if (page) await page.screenshot({ path: path.join(out, 'failure.png') }).catch(() => {});
|
||||
process.exitCode = 1;
|
||||
} finally {
|
||||
if (app) await app.close().catch(() => {});
|
||||
rmSync(profile, { recursive: true, force: true });
|
||||
writeFileSync(path.join(out, 'result.json'), JSON.stringify(result, null, 2));
|
||||
}
|
||||
console.log(JSON.stringify({ ok: result.ok, out, checks: result.checks.length, errors: result.errors }, null, 2));
|
||||
@@ -77,7 +77,9 @@ try {
|
||||
const historyButtons = [...document.querySelectorAll('.chat-history-controls button')].filter((n) => n.checkVisibility()).map((n) => n.textContent);
|
||||
S.viewId = b.id; chat.onViewChanged(); const bText = document.querySelector('#chat-log').textContent;
|
||||
chat.openPrivate(b, 2); b.snap.clients[1] = { id: 2, uid: 'ReusedIdDifferentPeer=', nickname: 'Different' }; chat.onSnapshot(b);
|
||||
const reusedDisabled = document.querySelector('#chat-input').disabled;
|
||||
// The real editable surface refuses input: adapter state, contentEditable and the accessible state agree.
|
||||
const input = document.querySelector('#chat-input');
|
||||
const reusedDisabled = chat.composerEditor().disabled && input.contentEditable === 'false' && input.getAttribute('aria-disabled') === 'true';
|
||||
return { rows, aIsolated: !aText.includes('B isolated'), bIsolated: !bText.includes('A 509'), unreadB, reusedDisabled, systemRow, historyButtons };
|
||||
});
|
||||
assert.ok(integrated.rows <= 500); assert.equal(integrated.aIsolated, true); assert.equal(integrated.bIsolated, true); assert.equal(integrated.unreadB, 1); assert.equal(integrated.reusedDisabled, true);
|
||||
|
||||
@@ -43,7 +43,7 @@ async function checkBindings(language) {
|
||||
for (const attr of ['title', 'aria-label', 'placeholder']) {
|
||||
for (const el of document.querySelectorAll(`[data-i18n-${attr}]`)) {
|
||||
// Dynamic mute/stream controls intentionally override their initial label.
|
||||
if (['btn-mute', 'btn-deafen', 'stream-mute', 'chat-input'].includes(el.id)) continue;
|
||||
if (['btn-mute', 'btn-deafen', 'stream-mute'].includes(el.id)) continue;
|
||||
if (attr === 'title' && ['btn-away', 'btn-talk-power'].includes(el.id)) {
|
||||
const keys = el.id === 'btn-away' ? ['admin.available', 'admin.away'] : ['admin.talk.pending', 'admin.talk.queue'];
|
||||
if (!keys.some(key => el.title === t(key))) issues.push(`${el.id}:${attr}`);
|
||||
|
||||
@@ -624,7 +624,7 @@ try {
|
||||
assert.ok((await boundary()).chat.height > resized.chat.height);
|
||||
await page.fill('#chat-input', 'Unsent local composer fixture');
|
||||
await page.click('#stream-collapse');
|
||||
assert.equal(await page.inputValue('#chat-input'), 'Unsent local composer fixture');
|
||||
assert.equal(await page.evaluate(async () => (await import('./js/chat.js')).composerEditor().value), 'Unsent local composer fixture');
|
||||
await page.fill('#chat-input', '');
|
||||
assert.equal((await multiState()).joins, initialMulti.joins, 'collapse/resize must not resubscribe');
|
||||
await resize(880, 560);
|
||||
|
||||
@@ -121,7 +121,8 @@ try {
|
||||
assert.equal(await page.locator('#chat-input').isVisible(), true);
|
||||
await page.locator('#chat-input').fill('Selectable local fixture text');
|
||||
await page.locator('#chat-input').press('ControlOrMeta+A');
|
||||
assert.equal(await page.locator('#chat-input').evaluate((el) => el.selectionEnd - el.selectionStart), 29);
|
||||
assert.deepEqual(await page.evaluate(async () => { const editor = (await import('./js/chat.js')).composerEditor(); return { value: editor.value, selected: editor.selectionEnd - editor.selectionStart, native: getSelection().toString() }; }),
|
||||
{ value: 'Selectable local fixture text', selected: 29, native: 'Selectable local fixture text' });
|
||||
await shot('03-narrow-clamped-dark.png');
|
||||
await separator.press('Enter');
|
||||
assert.equal(await width(), 280);
|
||||
|
||||
@@ -115,7 +115,8 @@ try {
|
||||
await cdp.send('Input.dispatchKeyEvent', { type: 'rawKeyDown', key: 'a', code: 'KeyA', windowsVirtualKeyCode: 65, modifiers: 2 });
|
||||
await cdp.send('Input.dispatchKeyEvent', { type: 'keyUp', key: 'a', code: 'KeyA', windowsVirtualKeyCode: 65, modifiers: 2 });
|
||||
await cdp.detach();
|
||||
assert.equal(await page.$eval('#chat-input', input => input.selectionEnd - input.selectionStart), 36);
|
||||
assert.deepEqual(await page.evaluate(async () => { const editor = (await import('./js/chat.js')).composerEditor(); return { value: editor.value, selected: editor.selectionEnd - editor.selectionStart }; }),
|
||||
{ value: 'Keyboard selection remains available', selected: 36 });
|
||||
await page.fill('#chat-input', '');
|
||||
await page.focus('#servers-toggle');
|
||||
await page.keyboard.press('Enter');
|
||||
|
||||
@@ -1,23 +1,31 @@
|
||||
#!/usr/bin/env node
|
||||
// Copies the chat renderer's third-party assets into app/renderer/vendor with a provenance record.
|
||||
// The packages are installed OUTSIDE this repository so they never become runtime dependencies:
|
||||
// npm install --prefix <dir> katex@0.16.47 mermaid@11.17.2 emojibase-data@18.0.0
|
||||
// npm install --prefix <dir> katex@0.16.47 mermaid@11.17.2 emojibase-data@18.0.0 \
|
||||
// @codemirror/state@6.7.6 @codemirror/view@6.43.15 @codemirror/commands@6.11.1
|
||||
// npm install --prefix <dir> --save-dev esbuild@0.28.2
|
||||
// node scripts/vendor-chat-libs.mjs <dir>/node_modules
|
||||
// Versions match the installed official TeamSpeak 6 client where it bundles the same library
|
||||
// (KaTeX 0.16.47 and Mermaid 11.17.2 in html/client_ui/main.js). Emoji shortcodes come from the
|
||||
// emojibase preset, which covers every shortcode the official emoji table uses.
|
||||
// emojibase preset, which covers every shortcode the official emoji table uses. The official composer
|
||||
// is a CodeMirror 6 view (main.js @3520977); the chat editor uses the CodeMirror core packages only,
|
||||
// bundled by esbuild (a build tool, not redistributed) into one offline ES module.
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import crypto from 'node:crypto';
|
||||
import { createRequire } from 'node:module';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const OUT = path.join(ROOT, 'app', 'renderer', 'vendor');
|
||||
const PINNED = { katex: '0.16.47', mermaid: '11.17.2', 'emojibase-data': '18.0.0' };
|
||||
const PINNED = {
|
||||
katex: '0.16.47', mermaid: '11.17.2', 'emojibase-data': '18.0.0',
|
||||
'@codemirror/state': '6.7.6', '@codemirror/view': '6.43.15', '@codemirror/commands': '6.11.1', esbuild: '0.28.2',
|
||||
};
|
||||
|
||||
const nodeModules = process.argv[2];
|
||||
if (!nodeModules || !fs.existsSync(nodeModules)) {
|
||||
console.error('usage: node scripts/vendor-chat-libs.mjs <node_modules with katex, mermaid, emojibase-data>');
|
||||
console.error('usage: node scripts/vendor-chat-libs.mjs <node_modules with katex, mermaid, emojibase-data, @codemirror/*, esbuild>');
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
@@ -86,5 +94,64 @@ copy('emojibase-data', [['LICENSE', 'LICENSE']], (dir) => {
|
||||
return [['shortcodes.js', body], ['package.json', '{\n "type": "module"\n}\n']];
|
||||
});
|
||||
|
||||
// Only the symbols chat-editor.js uses; esbuild tree-shakes the rest. The output is deterministic for the
|
||||
// pinned inputs, so regenerating it with the same lock reproduces the recorded hash.
|
||||
const CODEMIRROR_EXPORTS = {
|
||||
'@codemirror/state': ['Annotation', 'Compartment', 'EditorSelection', 'EditorState', 'StateField'],
|
||||
'@codemirror/view': ['Decoration', 'EditorView', 'WidgetType', 'keymap', 'placeholder'],
|
||||
'@codemirror/commands': ['history', 'historyKeymap', 'insertNewline', 'standardKeymap'],
|
||||
};
|
||||
{
|
||||
for (const name of [...Object.keys(CODEMIRROR_EXPORTS), 'esbuild']) pkg(name);
|
||||
const workspace = path.resolve(nodeModules, '..');
|
||||
const esbuild = createRequire(path.join(workspace, 'package.json'))('esbuild');
|
||||
const entry = Object.entries(CODEMIRROR_EXPORTS).map(([name, symbols]) => `export { ${symbols.join(', ')} } from '${name}';`).join('\n');
|
||||
const result = await esbuild.build({
|
||||
stdin: { contents: entry, resolveDir: workspace, sourcefile: 'codemirror-entry.js', loader: 'js' },
|
||||
bundle: true, format: 'esm', platform: 'browser', target: 'chrome120', write: false, metafile: true,
|
||||
legalComments: 'inline', charset: 'utf8', logLevel: 'error', absWorkingDir: workspace,
|
||||
});
|
||||
// Every package that contributed bytes to the bundle (after tree-shaking), with its own license text.
|
||||
const bundled = new Map();
|
||||
const [output] = Object.values(result.metafile.outputs);
|
||||
for (const [input, { bytesInOutput }] of Object.entries(output.inputs)) {
|
||||
const match = /^.*node_modules\/((?:@[^/]+\/)?[^/]+)\//.exec(input.replace(/\\/g, '/'));
|
||||
if (match && bytesInOutput > 0) bundled.set(match[1], path.join(workspace, ...match[0].split('/')));
|
||||
}
|
||||
const target = path.join(OUT, 'codemirror');
|
||||
fs.rmSync(target, { recursive: true, force: true });
|
||||
fs.mkdirSync(path.join(target, 'licenses'), { recursive: true });
|
||||
const record = { name: 'codemirror', bundler: `esbuild@${PINNED.esbuild}`, exports: CODEMIRROR_EXPORTS, patches: ['style-mod: use constructed stylesheets on Document as well as ShadowRoot; no inline style element under the application CSP'], bundled: [], files: [] };
|
||||
for (const [name, dir] of [...bundled].sort(([a], [b]) => a.localeCompare(b))) {
|
||||
const meta = JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8'));
|
||||
const license = fs.readdirSync(dir).find((f) => /^licen[cs]e(\..*)?$/i.test(f));
|
||||
if (!license) throw new Error(`${name} has no license file`);
|
||||
const buf = fs.readFileSync(path.join(dir, license));
|
||||
const to = `licenses/${name.replace('/', '__')}.LICENSE`;
|
||||
fs.writeFileSync(path.join(target, to), buf);
|
||||
record.bundled.push({ name, version: meta.version, license: meta.license });
|
||||
record.files.push({ path: `codemirror/${to}`, from: `${name}/${license}`, sha256: sha256(buf) });
|
||||
}
|
||||
const header = `// Generated by scripts/vendor-chat-libs.mjs with esbuild ${PINNED.esbuild}. Do not edit.\n`
|
||||
+ `// Bundles ${record.bundled.map((p) => `${p.name}@${p.version} (${p.license})`).join(', ')}.\n`
|
||||
+ '// License texts: vendor/codemirror/licenses/.\n';
|
||||
// Chromium supports constructed sheets on Document too. style-mod otherwise inserts a <style> there,
|
||||
// which our strict CSP rejects. Use its existing CSSOM path without allowing inline styles or adding a nonce.
|
||||
// Fail generation on upstream drift rather than silently shipping the blocked fallback again.
|
||||
const sheetGuard = 'if (!root.head && root.adoptedStyleSheets && win.CSSStyleSheet) {';
|
||||
const generated = result.outputFiles[0].text;
|
||||
if (generated.split(sheetGuard).length !== 2) throw new Error('style-mod constructed stylesheet guard changed');
|
||||
const body = header + '// Local CSP adaptation: constructed stylesheets also on Document.\n'
|
||||
+ generated.replace(sheetGuard, 'if (root.adoptedStyleSheets && win.CSSStyleSheet) {');
|
||||
const moduleType = '{\n "type": "module"\n}\n';
|
||||
fs.writeFileSync(path.join(target, 'codemirror.js'), body);
|
||||
fs.writeFileSync(path.join(target, 'package.json'), moduleType);
|
||||
record.files.unshift(
|
||||
{ path: 'codemirror/codemirror.js', generated: true, sha256: sha256(Buffer.from(body)) },
|
||||
{ path: 'codemirror/package.json', generated: true, sha256: sha256(Buffer.from(moduleType)) },
|
||||
);
|
||||
provenance.packages.push(record);
|
||||
}
|
||||
|
||||
fs.writeFileSync(path.join(OUT, 'PROVENANCE.json'), `${JSON.stringify(provenance, null, 2)}\n`);
|
||||
console.log(`vendored ${provenance.packages.map((p) => `${p.name}@${p.version}`).join(', ')} into ${path.relative(ROOT, OUT)}`);
|
||||
console.log(`vendored ${provenance.packages.map((p) => (p.version ? `${p.name}@${p.version}` : p.bundled.map((b) => `${b.name}@${b.version}`).join(', '))).join(', ')} into ${path.relative(ROOT, OUT)}`);
|
||||
@@ -6,10 +6,10 @@ import { fileURLToPath } from 'node:url';
|
||||
const workspace = path.resolve(process.argv[2]);
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const lock = JSON.parse(fs.readFileSync(path.join(workspace, 'package-lock.json'), 'utf8'));
|
||||
const output = ['Chat renderer dependency notices', 'The npm workspace inventory below conservatively includes build/type-only dependencies as well as runtime bundled dependencies.', 'DOMPurify is redistributed under its Apache-2.0 option. No official TeamSpeak bundle is redistributed.'];
|
||||
const output = ['Chat renderer dependency notices', 'The npm workspace inventory below conservatively includes build/type-only dependencies as well as runtime bundled dependencies; devDependencies (build tools such as esbuild) are not redistributed and are excluded.', 'DOMPurify is redistributed under its Apache-2.0 option. No official TeamSpeak bundle is redistributed.'];
|
||||
const inventory = [];
|
||||
for (const [location, entry] of Object.entries(lock.packages)) {
|
||||
if (!location) continue;
|
||||
if (!location || entry.dev) continue;
|
||||
const dir = path.join(workspace, location);
|
||||
const metadata = JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8'));
|
||||
const names = fs.readdirSync(dir).filter((name) => /^(licen[cs]e|copying|notice)([.-].*)?$/i.test(name) && fs.statSync(path.join(dir, name)).isFile());
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { continueMarkup, indentMarkup } from '../app/renderer/js/chat-editor-commands.js';
|
||||
|
||||
function apply(text, change) {
|
||||
assert.ok(change, 'command must produce an edit');
|
||||
return { text: text.slice(0, change.from) + change.insert + text.slice(change.to), cursor: change.start };
|
||||
}
|
||||
const next = text => apply(text, continueMarkup(text, text.length, text.length));
|
||||
|
||||
test('new list items retain their marker, increment ordinals and reset checked tasks', () => {
|
||||
assert.deepEqual(next('- [x] done'), { text: '- [x] done\n- [ ] ', cursor: 17 });
|
||||
assert.equal(next('9) item').text, '9) item\n10) ');
|
||||
assert.equal(next('> * item').text, '> * item\n> * ');
|
||||
assert.equal(next(' indented').text, ' indented\n ');
|
||||
});
|
||||
|
||||
test('an empty nested item outdents before leaving the list, retaining a quote prefix', () => {
|
||||
assert.deepEqual(next(' - '), { text: '- ', cursor: 2 });
|
||||
assert.deepEqual(next('- '), { text: '', cursor: 0 });
|
||||
assert.deepEqual(next('> - [ ] '), { text: '> - [ ] ', cursor: 8 });
|
||||
assert.deepEqual(next('> - '), { text: '>', cursor: 1 });
|
||||
});
|
||||
|
||||
test('fenced list-looking text does not continue as a list; quoted fences retain only quote depth', () => {
|
||||
const code = '```\n- item';
|
||||
assert.equal(continueMarkup(code, code.length, code.length), null);
|
||||
assert.equal(indentMarkup(code, code.length, code.length, 1), null);
|
||||
assert.equal(next('> ```\n> - item').text, '> ```\n> - item\n> ');
|
||||
assert.equal(next('> > ```\n> > - item').text, '> > ```\n> > - item\n> > ');
|
||||
});
|
||||
|
||||
test('indentation edits only the list indentation, including lists after a callout marker or inside details', () => {
|
||||
const quoted = '> [!NOTE]\n> - item';
|
||||
assert.equal(apply(quoted, indentMarkup(quoted, quoted.length, quoted.length, 1)).text, '> [!NOTE]\n> - item');
|
||||
const details = ':::details Summary\n- item\n:::';
|
||||
const caret = details.indexOf('item') + 4;
|
||||
assert.equal(apply(details, indentMarkup(details, caret, caret, 1)).text, ':::details Summary\n - item\n:::');
|
||||
assert.equal(apply('> \t- item', indentMarkup('> \t- item', 9, 9, -1)).text, '> - item');
|
||||
});
|
||||
|
||||
test('plain text, thematic breaks and selections retain ordinary editor/focus behavior', () => {
|
||||
assert.equal(indentMarkup('plain', 5, 5, 1), null);
|
||||
assert.equal(indentMarkup('- - -', 5, 5, 1), null);
|
||||
assert.equal(indentMarkup('- item', 2, 6, 1), null);
|
||||
assert.equal(continueMarkup('- item', 2, 6), null);
|
||||
assert.equal(continueMarkup('plain', 5, 5), null);
|
||||
});
|
||||
@@ -0,0 +1,41 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { previewBlocks, PREVIEW_MAX_LENGTH } from '../app/renderer/js/chat-editor-preview.js';
|
||||
|
||||
const spans = (text) => previewBlocks(text).map(({ from, to, kind, node }) => [from, to, kind === 'footnote' ? 'footnote' : node.type]);
|
||||
|
||||
test('preview blocks map to exact source line spans of the message dialect', () => {
|
||||
const text = [
|
||||
'one', 'two', '', // 0-1: strict per-line paragraphs
|
||||
'```js', 'a', '', 'b', '```', // 3-7: a fence keeps its blank line
|
||||
'| a | b |', '|---|:-:|', '| 1 | 2 |', // 8-10
|
||||
':::details Title', 'x', '', 'y', ':::', // 11-15
|
||||
'[b]', 'bold', '[/b]', // 16-18: BBCode block mode
|
||||
'$$', 'x^2', '$$', // 19-21
|
||||
'> q', '> [!NOTE]', // 22-23
|
||||
'- a', ' - b', // 24-25
|
||||
'Title', '===', // 26-27: setext
|
||||
'[ref]: https://example.com', // 28: reference definition, not shown in messages
|
||||
'[^n]: note', // 29
|
||||
'```mermaid', 'graph TD', // 30-31: unclosed fence runs to the end
|
||||
].join('\n');
|
||||
assert.deepEqual(spans(text), [
|
||||
[0, 1, 'paragraph'], [1, 2, 'paragraph'], [3, 8, 'code'], [8, 11, 'table'], [11, 16, 'details'],
|
||||
[16, 19, 'bb_block'], [19, 22, 'math_block'], [22, 24, 'blockquote'], [24, 26, 'list'], [26, 28, 'heading'],
|
||||
[29, 30, 'footnote'], [30, 32, 'mermaid'],
|
||||
]);
|
||||
});
|
||||
|
||||
test('block keys ignore position but follow document-wide references', () => {
|
||||
const keys = (text) => previewBlocks(text).map((block) => block.key);
|
||||
const [para, link] = keys('**a**\n[x][r]\n[r]: https://a.example');
|
||||
const shifted = keys('new line\n**a**\n[x][r]\n[r]: https://a.example');
|
||||
assert.deepEqual(shifted.slice(1), [para, link], 'moving a block reuses its rendering');
|
||||
const [, relinked] = keys('**a**\n[x][r]\n[r]: https://b.example');
|
||||
assert.notEqual(relinked, link, 'editing a reference definition re-renders the block that uses it');
|
||||
});
|
||||
|
||||
test('preview work is bounded to chat-sized drafts', () => {
|
||||
assert.equal(previewBlocks('a'.repeat(PREVIEW_MAX_LENGTH)).length, 1);
|
||||
assert.deepEqual(previewBlocks('a'.repeat(PREVIEW_MAX_LENGTH + 1)), [], 'longer drafts stay raw');
|
||||
});
|
||||
@@ -19,6 +19,7 @@ test('new profiles get the official Settings > Chats defaults', () => {
|
||||
const { file, cleanup } = tempFile();
|
||||
try {
|
||||
const values = new Prefs(file).get();
|
||||
assert.equal(values.chatRichTextEditor, true);
|
||||
assert.equal(values.chatToolbarVisibility, 'always-visible');
|
||||
assert.equal(values.chatMermaidAutoload, 'only-simple');
|
||||
assert.equal(values.chatOpenIncoming, true);
|
||||
@@ -32,8 +33,9 @@ test('new profiles get the official Settings > Chats defaults', () => {
|
||||
test('chat options and the ignore list persist across restarts', () => {
|
||||
const { file, cleanup } = tempFile();
|
||||
try {
|
||||
new Prefs(file).set({ chatOpenIncoming: false, chatShowModerationEvents: false, chatUse24hTime: false, chatIgnoredUsers: [{ uid: UID, name: 'Spammer' }, { uid: 'serveradmin', name: '' }] });
|
||||
new Prefs(file).set({ chatRichTextEditor: false, chatOpenIncoming: false, chatShowModerationEvents: false, chatUse24hTime: false, chatIgnoredUsers: [{ uid: UID, name: 'Spammer' }, { uid: 'serveradmin', name: '' }] });
|
||||
const values = new Prefs(file).get();
|
||||
assert.equal(values.chatRichTextEditor, false);
|
||||
assert.equal(values.chatOpenIncoming, false);
|
||||
assert.equal(values.chatShowModerationEvents, false);
|
||||
assert.equal(values.chatUse24hTime, false);
|
||||
@@ -47,7 +49,7 @@ test('malformed chat values are rejected without changing stored prefs', () => {
|
||||
const prefs = new Prefs(file);
|
||||
prefs.set({ chatIgnoredUsers: [{ uid: UID, name: 'Kept' }] });
|
||||
const invalid = [
|
||||
{ chatOpenIncoming: 'yes' }, { chatShowModerationEvents: 1 }, { chatUse24hTime: null },
|
||||
{ chatRichTextEditor: 'true' }, { chatOpenIncoming: 'yes' }, { chatShowModerationEvents: 1 }, { chatUse24hTime: null },
|
||||
{ chatIgnoredUsers: [{ uid: UID, name: 'A' }, { uid: UID, name: 'B' }] },
|
||||
{ chatIgnoredUsers: [{ uid: 'not a uid', name: '' }] },
|
||||
{ chatIgnoredUsers: [{ uid: UID, name: 'line\nbreak' }] },
|
||||
@@ -64,8 +66,9 @@ test('malformed chat values are rejected without changing stored prefs', () => {
|
||||
test('a hand-edited file with invalid chat values falls back to the defaults per key', () => {
|
||||
const { file, cleanup } = tempFile();
|
||||
try {
|
||||
fs.writeFileSync(file, JSON.stringify({ chatUse24hTime: 'no', chatIgnoredUsers: [{ uid: '', name: 'x' }], chatShowModerationEvents: false }));
|
||||
fs.writeFileSync(file, JSON.stringify({ chatRichTextEditor: 0, chatUse24hTime: 'no', chatIgnoredUsers: [{ uid: '', name: 'x' }], chatShowModerationEvents: false }));
|
||||
const values = new Prefs(file).get();
|
||||
assert.equal(values.chatRichTextEditor, true);
|
||||
assert.equal(values.chatUse24hTime, true);
|
||||
assert.deepEqual(values.chatIgnoredUsers, []);
|
||||
assert.equal(values.chatShowModerationEvents, false);
|
||||
|
||||
Reference in new issue
Block a user