@ai-ecoverse/slicc-spectrum 1.86.6 → 1.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/{chunk-X4C3AZJT.js → chunk-VRFAMBWK.js} +12 -2
- package/dist/chunk-VRFAMBWK.js.map +7 -0
- package/dist/slicc-dummy.js +29 -6
- package/dist/slicc-dummy.js.map +2 -2
- package/dist/slicc-kernel-model.js +1 -1
- package/dist/slicc-ui.js +170 -51
- package/dist/slicc-ui.js.map +3 -3
- package/dist/types/app/messages.d.ts +9 -1
- package/dist/types/app/settings.d.ts +1 -0
- package/dist/types/components/file-tree.d.ts +2 -2
- package/dist/types/dummy/index.d.ts +2 -1
- package/dist/types/dummy/settings.d.ts +6 -1
- package/dist/types/model/types.d.ts +2 -0
- package/package.json +5 -5
- package/dist/chunk-X4C3AZJT.js.map +0 -7
package/dist/slicc-ui.js
CHANGED
|
@@ -10557,7 +10557,7 @@ var SliccFiles = class extends ModelElement {
|
|
|
10557
10557
|
this.#show();
|
|
10558
10558
|
if (this.#pending) {
|
|
10559
10559
|
this.#pending = false;
|
|
10560
|
-
requestAnimationFrame(() =>
|
|
10560
|
+
requestAnimationFrame(() => this.focusOn("slicc-file-tree"));
|
|
10561
10561
|
}
|
|
10562
10562
|
}
|
|
10563
10563
|
#show() {
|
|
@@ -10988,6 +10988,7 @@ var SliccFreezer = class extends ModelElement {
|
|
|
10988
10988
|
-webkit-box-orient: vertical;
|
|
10989
10989
|
-webkit-line-clamp: 2;
|
|
10990
10990
|
overflow: hidden;
|
|
10991
|
+
text-overflow: ellipsis;
|
|
10991
10992
|
overflow-wrap: anywhere;
|
|
10992
10993
|
line-height: var(--swc-line-height-100);
|
|
10993
10994
|
}
|
|
@@ -22557,10 +22558,10 @@ function getBuiltInFileIconName(token2) {
|
|
|
22557
22558
|
function isColoredBuiltInIconSet(set) {
|
|
22558
22559
|
return set !== "none" && COLORED_SETS.has(set);
|
|
22559
22560
|
}
|
|
22560
|
-
function resolveBuiltInFileIconToken(set,
|
|
22561
|
+
function resolveBuiltInFileIconToken(set, fileName2, extensionCandidates) {
|
|
22561
22562
|
if (set === "minimal" || set === "none") return;
|
|
22562
22563
|
const isComplete = set === "complete";
|
|
22563
|
-
const fileNameToken = BUILT_IN_FILE_NAME_TOKENS[
|
|
22564
|
+
const fileNameToken = BUILT_IN_FILE_NAME_TOKENS[fileName2.toLowerCase()];
|
|
22564
22565
|
if (fileNameToken != null) {
|
|
22565
22566
|
if (isComplete || STANDARD_TIER_TOKENS.has(fileNameToken)) return fileNameToken;
|
|
22566
22567
|
}
|
|
@@ -22613,8 +22614,8 @@ var normalizeIconRuleKey = (value) => value.trim().toLowerCase();
|
|
|
22613
22614
|
var getBaseFileName = (path) => {
|
|
22614
22615
|
return path.split("/").at(-1) ?? path;
|
|
22615
22616
|
};
|
|
22616
|
-
var getExtensionCandidates = (
|
|
22617
|
-
const segments =
|
|
22617
|
+
var getExtensionCandidates = (fileName2) => {
|
|
22618
|
+
const segments = fileName2.toLowerCase().split(".");
|
|
22618
22619
|
const candidates2 = [];
|
|
22619
22620
|
for (let index = 1; index < segments.length; index += 1) candidates2.push(segments.slice(index).join("."));
|
|
22620
22621
|
return candidates2;
|
|
@@ -22633,23 +22634,23 @@ function createFileTreeIconResolver(icons3) {
|
|
|
22633
22634
|
const normalizedIcons = normalizeFileTreeIcons(icons3);
|
|
22634
22635
|
const iconRemap = normalizedIcons.remap;
|
|
22635
22636
|
const iconByFileName = /* @__PURE__ */ new Map();
|
|
22636
|
-
for (const [
|
|
22637
|
+
for (const [fileName2, icon] of Object.entries(normalizedIcons.byFileName ?? {})) iconByFileName.set(fileName2.toLowerCase(), icon);
|
|
22637
22638
|
const iconByFileExtension = /* @__PURE__ */ new Map();
|
|
22638
22639
|
for (const [extension, icon] of Object.entries(normalizedIcons.byFileExtension ?? {})) iconByFileExtension.set(normalizeIconRuleKey(extension), icon);
|
|
22639
22640
|
const iconByFileNameContains = Object.entries(normalizedIcons.byFileNameContains ?? {}).map(([needle, icon]) => [needle.toLowerCase(), icon]);
|
|
22640
22641
|
const resolveIcon = (name, filePath) => {
|
|
22641
22642
|
if (name === "file-tree-icon-file" && filePath != null) {
|
|
22642
|
-
const
|
|
22643
|
-
const lowerFileName =
|
|
22643
|
+
const fileName2 = getBaseFileName(filePath);
|
|
22644
|
+
const lowerFileName = fileName2.toLowerCase();
|
|
22644
22645
|
const fileNameEntry = iconByFileName.get(lowerFileName);
|
|
22645
22646
|
if (fileNameEntry != null) return remapEntryToIcon(fileNameEntry, name);
|
|
22646
22647
|
for (const [needle, matchEntry] of iconByFileNameContains) if (lowerFileName.includes(needle)) return remapEntryToIcon(matchEntry, name);
|
|
22647
|
-
const extensionCandidates = getExtensionCandidates(
|
|
22648
|
+
const extensionCandidates = getExtensionCandidates(fileName2);
|
|
22648
22649
|
for (const extension of extensionCandidates) {
|
|
22649
22650
|
const extensionEntry = iconByFileExtension.get(extension);
|
|
22650
22651
|
if (extensionEntry != null) return remapEntryToIcon(extensionEntry, name);
|
|
22651
22652
|
}
|
|
22652
|
-
const builtInToken = resolveBuiltInFileIconToken(normalizedIcons.set,
|
|
22653
|
+
const builtInToken = resolveBuiltInFileIconToken(normalizedIcons.set, fileName2, extensionCandidates);
|
|
22653
22654
|
if (builtInToken != null && normalizedIcons.set !== "none") {
|
|
22654
22655
|
if (builtInToken === "default") {
|
|
22655
22656
|
const remappedEntry2 = iconRemap?.[name];
|
|
@@ -31530,15 +31531,32 @@ function actionLabel(action, handlers, messageId) {
|
|
|
31530
31531
|
const count = action === "drop-turn" ? handlers.dropping(messageId) : 1;
|
|
31531
31532
|
return count > 1 ? `Drop ${count} failed turns` : actionLabels[action];
|
|
31532
31533
|
}
|
|
31534
|
+
var signedIn = "Signed in. Retry to send it again.";
|
|
31535
|
+
function stopSigningIn(event2, handlers, account, id) {
|
|
31536
|
+
const main2 = event2.currentTarget.nextElementSibling;
|
|
31537
|
+
main2.focus();
|
|
31538
|
+
handlers.cancelLogin?.(account, id);
|
|
31539
|
+
}
|
|
31540
|
+
function fixButton(fix, item2, handlers, login) {
|
|
31541
|
+
const id = item2.id ?? "";
|
|
31542
|
+
const signing = login?.state === "signing-in";
|
|
31543
|
+
const shown4 = login?.state === "connected" ? "retry" : fix;
|
|
31544
|
+
const cancel = signing && login.cancel;
|
|
31545
|
+
return b`${cancel ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="cancel-login" @click=${(event2) => stopSigningIn(event2, handlers, item2.account, id)}>Cancel</swc-button>` : A}<swc-button size="s" variant="secondary" fill-style="outline" data-action=${shown4} ?pending=${signing} ?disabled=${handlers.readOnly} @click=${() => handlers.action(shown4, item2.id, item2.account)}>${signing ? "Signing in\u2026" : actionLabel(shown4, handlers, id)}</swc-button>`;
|
|
31546
|
+
}
|
|
31533
31547
|
function errorCard(item2, handlers) {
|
|
31534
31548
|
const id = item2.id ?? "";
|
|
31535
31549
|
const fix = handlers.seat === void 0 ? item2.action : void 0;
|
|
31536
|
-
const
|
|
31537
|
-
|
|
31538
|
-
|
|
31539
|
-
|
|
31540
|
-
|
|
31541
|
-
${
|
|
31550
|
+
const login = fix === "login" && item2.account && !handlers.readOnly ? handlers.login?.(item2.account, id) : void 0;
|
|
31551
|
+
const resolved = login?.state === "connected";
|
|
31552
|
+
const text2 = resolved ? signedIn : item2.text;
|
|
31553
|
+
const failure2 = login?.state === "idle" ? login.error : void 0;
|
|
31554
|
+
return b`<div class="error-card" role=${resolved ? A : "alert"} aria-atomic=${resolved ? A : "false"} data-id=${id || A} data-login=${login?.state ?? A}>
|
|
31555
|
+
${resolved ? b`<swc-icon-info-circle class="icon" size="s" aria-hidden="true"></swc-icon-info-circle>` : b`<swc-icon-alert-diamond class="icon" size="s" aria-hidden="true"></swc-icon-alert-diamond>`}
|
|
31556
|
+
${resolved ? A : b`<span class="sr">Error: </span>`}<span class="lead">${item2.title}</span>
|
|
31557
|
+
${text2 ? b`<span class="detail" role=${login ? "status" : A}>${text2}</span>` : A}
|
|
31558
|
+
${fix ? b`<div class="fix" aria-live="off">${fixButton(fix, item2, handlers, login)}</div>` : A}
|
|
31559
|
+
${failure2 ? b`<div class="help" data-error="login"><sp-help-text size="s" variant="negative" icon>${failure2}</sp-help-text><swc-action-button size="s" quiet data-action="settings" @click=${() => handlers.action("settings", item2.id, item2.account)}>Open settings</swc-action-button></div>` : A}
|
|
31542
31560
|
</div>`;
|
|
31543
31561
|
}
|
|
31544
31562
|
function time(at) {
|
|
@@ -31754,7 +31772,7 @@ function part(entry, handlers) {
|
|
|
31754
31772
|
return b`<div class="link-text">${entry.title}</div>`;
|
|
31755
31773
|
default:
|
|
31756
31774
|
return errorCard(
|
|
31757
|
-
{ title: entry.message, text: entry.detail, action: entry.action },
|
|
31775
|
+
{ title: entry.message, text: entry.detail, action: entry.action, account: entry.account },
|
|
31758
31776
|
handlers
|
|
31759
31777
|
);
|
|
31760
31778
|
}
|
|
@@ -31904,7 +31922,9 @@ function assistant(message, name, model, handlers, showThinking, suggestion = nu
|
|
|
31904
31922
|
message.parts,
|
|
31905
31923
|
{
|
|
31906
31924
|
...handlers,
|
|
31907
|
-
action: (action) => handlers.action(action, message.id),
|
|
31925
|
+
action: (action, _id, account) => handlers.action(action, message.id, account),
|
|
31926
|
+
login: (account) => handlers.login?.(account, message.id),
|
|
31927
|
+
cancelLogin: (account) => handlers.cancelLogin?.(account, message.id),
|
|
31908
31928
|
dropping: () => handlers.dropping(message.id)
|
|
31909
31929
|
},
|
|
31910
31930
|
showThinking,
|
|
@@ -31982,7 +32002,8 @@ function system(message, handlers) {
|
|
|
31982
32002
|
id: message.id,
|
|
31983
32003
|
title: message.title ?? "Error",
|
|
31984
32004
|
text: message.text,
|
|
31985
|
-
action: message.action
|
|
32005
|
+
action: message.action,
|
|
32006
|
+
account: message.account
|
|
31986
32007
|
},
|
|
31987
32008
|
handlers
|
|
31988
32009
|
)
|
|
@@ -32793,6 +32814,9 @@ var messageCss = i`
|
|
|
32793
32814
|
grid-row: span 2;
|
|
32794
32815
|
color: var(--swc-negative-visual-color);
|
|
32795
32816
|
}
|
|
32817
|
+
.error-card[data-login='connected'] .icon {
|
|
32818
|
+
color: var(--swc-neutral-subdued-content-color-default);
|
|
32819
|
+
}
|
|
32796
32820
|
.error-card .lead {
|
|
32797
32821
|
grid-column: 2;
|
|
32798
32822
|
font-weight: var(--swc-bold-font-weight);
|
|
@@ -32802,18 +32826,33 @@ var messageCss = i`
|
|
|
32802
32826
|
grid-column: 2;
|
|
32803
32827
|
overflow-wrap: anywhere;
|
|
32804
32828
|
}
|
|
32805
|
-
.error-card
|
|
32829
|
+
.error-card .fix {
|
|
32806
32830
|
grid-column: 3;
|
|
32807
|
-
grid-row: span 2;
|
|
32831
|
+
grid-row: 1 / span 2;
|
|
32832
|
+
display: flex;
|
|
32833
|
+
gap: var(--swc-spacing-100);
|
|
32834
|
+
}
|
|
32835
|
+
.error-card swc-button {
|
|
32808
32836
|
white-space: nowrap;
|
|
32809
32837
|
}
|
|
32838
|
+
.error-card .help {
|
|
32839
|
+
grid-column: 2 / -1;
|
|
32840
|
+
display: flex;
|
|
32841
|
+
flex-wrap: wrap;
|
|
32842
|
+
align-items: center;
|
|
32843
|
+
gap: var(--swc-spacing-50) var(--swc-spacing-100);
|
|
32844
|
+
}
|
|
32810
32845
|
@container (inline-size < 480px) {
|
|
32811
32846
|
.error-card {
|
|
32812
32847
|
margin-inline: var(--swc-spacing-300);
|
|
32813
32848
|
}
|
|
32849
|
+
.error-card .fix {
|
|
32850
|
+
flex-direction: column-reverse;
|
|
32851
|
+
align-items: flex-end;
|
|
32852
|
+
}
|
|
32814
32853
|
}
|
|
32815
32854
|
@container (inline-size < 360px) {
|
|
32816
|
-
.error-card
|
|
32855
|
+
.error-card .fix {
|
|
32817
32856
|
grid-column: 2;
|
|
32818
32857
|
grid-row: auto;
|
|
32819
32858
|
justify-self: start;
|
|
@@ -37477,7 +37516,9 @@ var SliccChat = class extends ThemedElement {
|
|
|
37477
37516
|
readOnly: false,
|
|
37478
37517
|
answer: (questionId, answer) => this.model?.agent.answer(this.#id(), questionId, answer),
|
|
37479
37518
|
resolve: (messageId, state2) => this.model?.agent.resolveLick(this.#id(), messageId, state2),
|
|
37480
|
-
action: (action, messageId) => this.#action(action, messageId),
|
|
37519
|
+
action: (action, messageId, account) => this.#action(action, messageId, account),
|
|
37520
|
+
login: (account, messageId) => this.#loginState(account, messageId),
|
|
37521
|
+
cancelLogin: (account, messageId) => this.#cancelLogin(account, messageId),
|
|
37481
37522
|
dropping: (messageId) => failedTurns(this.model.agent.messages(this.#id()), messageId).length,
|
|
37482
37523
|
open: (path) => this.dispatchEvent(
|
|
37483
37524
|
new CustomEvent("open-file", { detail: { path }, bubbles: true, composed: true })
|
|
@@ -37728,9 +37769,56 @@ var SliccChat = class extends ThemedElement {
|
|
|
37728
37769
|
if (!restored) return;
|
|
37729
37770
|
this.renderRoot.querySelector("slicc-composer")?.restore(latest ? { text: latest.text, attachments: latest.attachments } : restored);
|
|
37730
37771
|
}
|
|
37731
|
-
#
|
|
37772
|
+
#logins = /* @__PURE__ */ new Map();
|
|
37773
|
+
#loginState(accountId, messageId) {
|
|
37774
|
+
const settings = this.model.settings;
|
|
37775
|
+
const account = settings.accounts().find((candidate) => candidate.id === accountId);
|
|
37776
|
+
const local2 = this.#logins.get(`${messageId}:${accountId}`);
|
|
37777
|
+
const cancel = !!settings.cancel;
|
|
37778
|
+
if (account?.status === "signing-in" || local2?.pending) return { state: "signing-in", cancel };
|
|
37779
|
+
if (account?.status === "connected") return { state: "connected" };
|
|
37780
|
+
return { state: "idle", error: local2?.error };
|
|
37781
|
+
}
|
|
37782
|
+
#cancelLogin(accountId, messageId) {
|
|
37783
|
+
const local2 = this.#logins.get(`${messageId}:${accountId}`);
|
|
37784
|
+
if (local2) local2.cancelled = true;
|
|
37785
|
+
this.model?.settings.cancel?.(accountId);
|
|
37786
|
+
}
|
|
37787
|
+
#settings(section) {
|
|
37788
|
+
this.dispatchEvent(
|
|
37789
|
+
new CustomEvent("show-surface", {
|
|
37790
|
+
detail: section ? { id: "settings", section } : { id: "settings" },
|
|
37791
|
+
bubbles: true,
|
|
37792
|
+
composed: true
|
|
37793
|
+
})
|
|
37794
|
+
);
|
|
37795
|
+
}
|
|
37796
|
+
#login(model, messageId, accountId) {
|
|
37797
|
+
const account = model.settings.accounts().find((candidate) => candidate.id === accountId);
|
|
37798
|
+
if (!account || account.auth === "api-key" || account.secret || account.fields?.length) {
|
|
37799
|
+
this.#settings(accountId ?? "accounts");
|
|
37800
|
+
return;
|
|
37801
|
+
}
|
|
37802
|
+
const local2 = { pending: true };
|
|
37803
|
+
this.#logins.set(`${messageId}:${account.id}`, local2);
|
|
37804
|
+
const done2 = (error) => {
|
|
37805
|
+
local2.pending = false;
|
|
37806
|
+
local2.error = local2.cancelled ? void 0 : error;
|
|
37807
|
+
this.requestUpdate();
|
|
37808
|
+
};
|
|
37809
|
+
model.settings.connect(account.id).then(
|
|
37810
|
+
() => done2(),
|
|
37811
|
+
(error) => done2(error.message)
|
|
37812
|
+
);
|
|
37813
|
+
this.requestUpdate();
|
|
37814
|
+
}
|
|
37815
|
+
#action(action, messageId = "", account) {
|
|
37732
37816
|
const model = this.model;
|
|
37733
37817
|
if (!model) return;
|
|
37818
|
+
if (action === "login") {
|
|
37819
|
+
this.#login(model, messageId, account);
|
|
37820
|
+
return;
|
|
37821
|
+
}
|
|
37734
37822
|
const id = this.#id();
|
|
37735
37823
|
if (action === "drop-turn") {
|
|
37736
37824
|
void this.#rewind(id, messageId);
|
|
@@ -37741,9 +37829,7 @@ var SliccChat = class extends ThemedElement {
|
|
|
37741
37829
|
if (last) void model.agent.send(id, { text: last.text, attachments: last.attachments });
|
|
37742
37830
|
return;
|
|
37743
37831
|
}
|
|
37744
|
-
this
|
|
37745
|
-
new CustomEvent("show-surface", { detail: { id: "settings" }, bubbles: true, composed: true })
|
|
37746
|
-
);
|
|
37832
|
+
this.#settings(account);
|
|
37747
37833
|
}
|
|
37748
37834
|
#message(message, agent, suggestion, changed, extra, owners, stamp, pile) {
|
|
37749
37835
|
const model = this.model;
|
|
@@ -42162,6 +42248,15 @@ var SliccSettings = class extends ThemedElement {
|
|
|
42162
42248
|
focus() {
|
|
42163
42249
|
this.focusOn("sp-picker");
|
|
42164
42250
|
}
|
|
42251
|
+
reveal(section) {
|
|
42252
|
+
void this.updateComplete.then(() => {
|
|
42253
|
+
const root2 = this.renderRoot;
|
|
42254
|
+
const row = root2.querySelector(`.account[data-id="${CSS.escape(section)}"]`);
|
|
42255
|
+
const target2 = row ?? root2.querySelector("h2[data-section=accounts]");
|
|
42256
|
+
row?.querySelector("swc-button")?.focus();
|
|
42257
|
+
target2?.scrollIntoView({ block: "start" });
|
|
42258
|
+
});
|
|
42259
|
+
}
|
|
42165
42260
|
#update(patch) {
|
|
42166
42261
|
this.model?.settings.update(patch);
|
|
42167
42262
|
}
|
|
@@ -42551,7 +42646,7 @@ var SliccSettings = class extends ThemedElement {
|
|
|
42551
42646
|
</sp-picker>
|
|
42552
42647
|
</div>
|
|
42553
42648
|
</div>
|
|
42554
|
-
<h2>Accounts</h2>
|
|
42649
|
+
<h2 data-section="accounts">Accounts</h2>
|
|
42555
42650
|
<div class="accounts">${providers.map((account) => this.#account(account))}</div>
|
|
42556
42651
|
${servers.length ? b`<h2>MCP servers</h2>
|
|
42557
42652
|
<div class="accounts" data-group="mcp">${servers.map((account) => this.#account(account))}</div>` : A}
|
|
@@ -58968,21 +59063,21 @@ var EXTENSION_TO_FILE_FORMAT = {
|
|
|
58968
59063
|
zsh: "zsh",
|
|
58969
59064
|
sty: "tex"
|
|
58970
59065
|
};
|
|
58971
|
-
function getFiletypeFromFileName(
|
|
58972
|
-
const format = matchFiletypeFromName(
|
|
59066
|
+
function getFiletypeFromFileName(fileName2) {
|
|
59067
|
+
const format = matchFiletypeFromName(fileName2);
|
|
58973
59068
|
if (format != null) return format;
|
|
58974
|
-
const baseName =
|
|
58975
|
-
return baseName ===
|
|
59069
|
+
const baseName = fileName2.split(/[/\\]/).pop() ?? fileName2;
|
|
59070
|
+
return baseName === fileName2 ? "text" : matchFiletypeFromName(baseName) ?? "text";
|
|
58976
59071
|
}
|
|
58977
|
-
function matchFiletypeFromName(
|
|
58978
|
-
if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(
|
|
58979
|
-
if (Object.hasOwn(EXTENSION_TO_FILE_FORMAT,
|
|
58980
|
-
const compoundMatch =
|
|
59072
|
+
function matchFiletypeFromName(fileName2) {
|
|
59073
|
+
if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(fileName2)) return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(fileName2) ?? "text";
|
|
59074
|
+
if (Object.hasOwn(EXTENSION_TO_FILE_FORMAT, fileName2)) return EXTENSION_TO_FILE_FORMAT[fileName2] ?? null;
|
|
59075
|
+
const compoundMatch = fileName2.match(/\.([^/\\]+\.[^/\\]+)$/);
|
|
58981
59076
|
if (compoundMatch != null) {
|
|
58982
59077
|
if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(compoundMatch[1])) return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(compoundMatch[1]) ?? "text";
|
|
58983
59078
|
if (Object.hasOwn(EXTENSION_TO_FILE_FORMAT, compoundMatch[1])) return EXTENSION_TO_FILE_FORMAT[compoundMatch[1]] ?? "text";
|
|
58984
59079
|
}
|
|
58985
|
-
const simpleMatch =
|
|
59080
|
+
const simpleMatch = fileName2.match(/\.([^.]+)$/)?.[1] ?? "";
|
|
58986
59081
|
if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(simpleMatch)) return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(simpleMatch) ?? "text";
|
|
58987
59082
|
return Object.hasOwn(EXTENSION_TO_FILE_FORMAT, simpleMatch) ? EXTENSION_TO_FILE_FORMAT[simpleMatch] ?? "text" : null;
|
|
58988
59083
|
}
|
|
@@ -61938,22 +62033,22 @@ var NAMED_ESCAPES = {
|
|
|
61938
62033
|
};
|
|
61939
62034
|
function parseQuotedDiffFileName(input) {
|
|
61940
62035
|
if (input[0] !== '"') return;
|
|
61941
|
-
let
|
|
62036
|
+
let fileName2 = "";
|
|
61942
62037
|
let index = 1;
|
|
61943
62038
|
while (index < input.length) {
|
|
61944
62039
|
const char = input[index];
|
|
61945
62040
|
if (char === '"') return {
|
|
61946
|
-
fileName,
|
|
62041
|
+
fileName: fileName2,
|
|
61947
62042
|
rawLength: index + 1
|
|
61948
62043
|
};
|
|
61949
62044
|
if (char !== "\\") {
|
|
61950
|
-
|
|
62045
|
+
fileName2 += char;
|
|
61951
62046
|
index++;
|
|
61952
62047
|
continue;
|
|
61953
62048
|
}
|
|
61954
62049
|
const escaped = NAMED_ESCAPES[input[index + 1]];
|
|
61955
62050
|
if (escaped != null) {
|
|
61956
|
-
|
|
62051
|
+
fileName2 += escaped;
|
|
61957
62052
|
index += 2;
|
|
61958
62053
|
continue;
|
|
61959
62054
|
}
|
|
@@ -61964,7 +62059,7 @@ function parseQuotedDiffFileName(input) {
|
|
|
61964
62059
|
bytes.push(byte);
|
|
61965
62060
|
index += 4;
|
|
61966
62061
|
} while (input[index] === "\\" && input[index + 1] >= "0" && input[index + 1] <= "7");
|
|
61967
|
-
|
|
62062
|
+
fileName2 += filenameDecoder.decode(new Uint8Array(bytes));
|
|
61968
62063
|
}
|
|
61969
62064
|
}
|
|
61970
62065
|
function readOctalByte(input, index) {
|
|
@@ -62158,12 +62253,12 @@ function _processFile(fileDiffString, { cacheKey, isGitDiff = GIT_DIFF_FILE_BREA
|
|
|
62158
62253
|
const filenameMatch = line.startsWith("---") || line.startsWith("+++") ? line.match(FILENAME_HEADER_REGEX) : null;
|
|
62159
62254
|
if (filenameMatch != null) {
|
|
62160
62255
|
const [, type, rawFileName] = filenameMatch;
|
|
62161
|
-
const
|
|
62162
|
-
if (type === "---" &&
|
|
62163
|
-
const detachedFileName = detachString(
|
|
62256
|
+
const fileName2 = decodeDiffFileName(rawFileName, isGitDiff);
|
|
62257
|
+
if (type === "---" && fileName2 !== "/dev/null") {
|
|
62258
|
+
const detachedFileName = detachString(fileName2);
|
|
62164
62259
|
currentFile.prevName = detachedFileName;
|
|
62165
62260
|
currentFile.name = detachedFileName;
|
|
62166
|
-
} else if (type === "+++" &&
|
|
62261
|
+
} else if (type === "+++" && fileName2 !== "/dev/null") currentFile.name = detachString(fileName2);
|
|
62167
62262
|
} else if (isGitDiff) {
|
|
62168
62263
|
if (line.startsWith("new mode ")) currentFile.mode = detachString(line.slice(8).trim());
|
|
62169
62264
|
if (line.startsWith("old mode ")) currentFile.prevMode = detachString(line.slice(8).trim());
|
|
@@ -85617,7 +85712,17 @@ file-tree-container {
|
|
|
85617
85712
|
`;
|
|
85618
85713
|
var gestures = ["wheel", "touchmove", "pointerdown", "keydown"];
|
|
85619
85714
|
var folderName = "[data-item-type='folder'] > [data-item-section='content']";
|
|
85715
|
+
var fileName = "[data-item-type='file'] > [data-item-section='content']";
|
|
85620
85716
|
var rows = `
|
|
85717
|
+
[data-type='item'][data-item-focused='true']:focus:not(:focus-visible)::before {
|
|
85718
|
+
display: none;
|
|
85719
|
+
}
|
|
85720
|
+
@media (forced-colors: active) {
|
|
85721
|
+
[data-type='item'][data-item-selected='true'] {
|
|
85722
|
+
outline: var(--swc-border-width-100) solid Highlight;
|
|
85723
|
+
outline-offset: calc(-1 * var(--swc-border-width-100));
|
|
85724
|
+
}
|
|
85725
|
+
}
|
|
85621
85726
|
${folderName} {
|
|
85622
85727
|
display: block;
|
|
85623
85728
|
white-space: nowrap;
|
|
@@ -85634,6 +85739,20 @@ ${folderName} [data-truncate-content='visible'] {
|
|
|
85634
85739
|
display: inline;
|
|
85635
85740
|
direction: inherit;
|
|
85636
85741
|
}
|
|
85742
|
+
${fileName} [data-truncate-container] {
|
|
85743
|
+
white-space: nowrap;
|
|
85744
|
+
text-overflow: ellipsis;
|
|
85745
|
+
}
|
|
85746
|
+
${fileName} :is([data-truncate-grid], [data-truncate-grid] > div:not([data-truncate-marker-cell], [data-truncate-fill])) {
|
|
85747
|
+
display: contents;
|
|
85748
|
+
}
|
|
85749
|
+
${fileName} :is([data-truncate-content='overflow'], [data-truncate-marker-cell], [data-truncate-fill]) {
|
|
85750
|
+
display: none;
|
|
85751
|
+
}
|
|
85752
|
+
${fileName} [data-truncate-content='visible'] {
|
|
85753
|
+
display: inline;
|
|
85754
|
+
direction: inherit;
|
|
85755
|
+
}
|
|
85637
85756
|
`;
|
|
85638
85757
|
function titled(root2) {
|
|
85639
85758
|
for (const row of root2.querySelectorAll("[data-type='item'][aria-label]")) {
|
|
@@ -85966,22 +86085,22 @@ ${view.focused}`;
|
|
|
85966
86085
|
if (event2.key !== "Enter") return;
|
|
85967
86086
|
this.#open(this.#tree?.getFocusedPath());
|
|
85968
86087
|
}
|
|
85969
|
-
focus() {
|
|
86088
|
+
focus(options) {
|
|
85970
86089
|
const tree = this.#tree;
|
|
85971
86090
|
const path = tree?.getFocusedPath() ?? tree?.getVisibleRows(0, 1)[0]?.path;
|
|
85972
|
-
if (path) this.reveal(path);
|
|
86091
|
+
if (path) this.reveal(path, true, options);
|
|
85973
86092
|
}
|
|
85974
86093
|
#row(path) {
|
|
85975
86094
|
const container = this.#tree?.getFileTreeContainer();
|
|
85976
86095
|
return container?.shadowRoot?.querySelector(`[data-item-path="${CSS.escape(path)}"]`) ?? null;
|
|
85977
86096
|
}
|
|
85978
|
-
reveal(path, focus = true) {
|
|
86097
|
+
reveal(path, focus = true, options) {
|
|
85979
86098
|
this.#hold = null;
|
|
85980
86099
|
this.#tree?.scrollToPath(path, { focus });
|
|
85981
86100
|
if (!focus) return;
|
|
85982
86101
|
const row = this.#row(path);
|
|
85983
|
-
if (row) row.focus();
|
|
85984
|
-
else requestAnimationFrame(() => this.#row(path)?.focus());
|
|
86102
|
+
if (row) row.focus(options);
|
|
86103
|
+
else requestAnimationFrame(() => this.#row(path)?.focus(options));
|
|
85985
86104
|
}
|
|
85986
86105
|
};
|
|
85987
86106
|
function defineFileTree() {
|