@ai-ecoverse/slicc-spectrum 1.86.6 → 1.86.7
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 +5 -1
- package/dist/slicc-dummy.js +6 -3
- package/dist/slicc-dummy.js.map +2 -2
- package/dist/slicc-ui.js +58 -33
- package/dist/slicc-ui.js.map +3 -3
- package/dist/types/components/file-tree.d.ts +2 -2
- package/package.json +5 -5
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];
|
|
@@ -58968,21 +58969,21 @@ var EXTENSION_TO_FILE_FORMAT = {
|
|
|
58968
58969
|
zsh: "zsh",
|
|
58969
58970
|
sty: "tex"
|
|
58970
58971
|
};
|
|
58971
|
-
function getFiletypeFromFileName(
|
|
58972
|
-
const format = matchFiletypeFromName(
|
|
58972
|
+
function getFiletypeFromFileName(fileName2) {
|
|
58973
|
+
const format = matchFiletypeFromName(fileName2);
|
|
58973
58974
|
if (format != null) return format;
|
|
58974
|
-
const baseName =
|
|
58975
|
-
return baseName ===
|
|
58975
|
+
const baseName = fileName2.split(/[/\\]/).pop() ?? fileName2;
|
|
58976
|
+
return baseName === fileName2 ? "text" : matchFiletypeFromName(baseName) ?? "text";
|
|
58976
58977
|
}
|
|
58977
|
-
function matchFiletypeFromName(
|
|
58978
|
-
if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(
|
|
58979
|
-
if (Object.hasOwn(EXTENSION_TO_FILE_FORMAT,
|
|
58980
|
-
const compoundMatch =
|
|
58978
|
+
function matchFiletypeFromName(fileName2) {
|
|
58979
|
+
if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(fileName2)) return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(fileName2) ?? "text";
|
|
58980
|
+
if (Object.hasOwn(EXTENSION_TO_FILE_FORMAT, fileName2)) return EXTENSION_TO_FILE_FORMAT[fileName2] ?? null;
|
|
58981
|
+
const compoundMatch = fileName2.match(/\.([^/\\]+\.[^/\\]+)$/);
|
|
58981
58982
|
if (compoundMatch != null) {
|
|
58982
58983
|
if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(compoundMatch[1])) return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(compoundMatch[1]) ?? "text";
|
|
58983
58984
|
if (Object.hasOwn(EXTENSION_TO_FILE_FORMAT, compoundMatch[1])) return EXTENSION_TO_FILE_FORMAT[compoundMatch[1]] ?? "text";
|
|
58984
58985
|
}
|
|
58985
|
-
const simpleMatch =
|
|
58986
|
+
const simpleMatch = fileName2.match(/\.([^.]+)$/)?.[1] ?? "";
|
|
58986
58987
|
if (CUSTOM_EXTENSION_TO_FILE_FORMAT.has(simpleMatch)) return CUSTOM_EXTENSION_TO_FILE_FORMAT.get(simpleMatch) ?? "text";
|
|
58987
58988
|
return Object.hasOwn(EXTENSION_TO_FILE_FORMAT, simpleMatch) ? EXTENSION_TO_FILE_FORMAT[simpleMatch] ?? "text" : null;
|
|
58988
58989
|
}
|
|
@@ -61938,22 +61939,22 @@ var NAMED_ESCAPES = {
|
|
|
61938
61939
|
};
|
|
61939
61940
|
function parseQuotedDiffFileName(input) {
|
|
61940
61941
|
if (input[0] !== '"') return;
|
|
61941
|
-
let
|
|
61942
|
+
let fileName2 = "";
|
|
61942
61943
|
let index = 1;
|
|
61943
61944
|
while (index < input.length) {
|
|
61944
61945
|
const char = input[index];
|
|
61945
61946
|
if (char === '"') return {
|
|
61946
|
-
fileName,
|
|
61947
|
+
fileName: fileName2,
|
|
61947
61948
|
rawLength: index + 1
|
|
61948
61949
|
};
|
|
61949
61950
|
if (char !== "\\") {
|
|
61950
|
-
|
|
61951
|
+
fileName2 += char;
|
|
61951
61952
|
index++;
|
|
61952
61953
|
continue;
|
|
61953
61954
|
}
|
|
61954
61955
|
const escaped = NAMED_ESCAPES[input[index + 1]];
|
|
61955
61956
|
if (escaped != null) {
|
|
61956
|
-
|
|
61957
|
+
fileName2 += escaped;
|
|
61957
61958
|
index += 2;
|
|
61958
61959
|
continue;
|
|
61959
61960
|
}
|
|
@@ -61964,7 +61965,7 @@ function parseQuotedDiffFileName(input) {
|
|
|
61964
61965
|
bytes.push(byte);
|
|
61965
61966
|
index += 4;
|
|
61966
61967
|
} while (input[index] === "\\" && input[index + 1] >= "0" && input[index + 1] <= "7");
|
|
61967
|
-
|
|
61968
|
+
fileName2 += filenameDecoder.decode(new Uint8Array(bytes));
|
|
61968
61969
|
}
|
|
61969
61970
|
}
|
|
61970
61971
|
function readOctalByte(input, index) {
|
|
@@ -62158,12 +62159,12 @@ function _processFile(fileDiffString, { cacheKey, isGitDiff = GIT_DIFF_FILE_BREA
|
|
|
62158
62159
|
const filenameMatch = line.startsWith("---") || line.startsWith("+++") ? line.match(FILENAME_HEADER_REGEX) : null;
|
|
62159
62160
|
if (filenameMatch != null) {
|
|
62160
62161
|
const [, type, rawFileName] = filenameMatch;
|
|
62161
|
-
const
|
|
62162
|
-
if (type === "---" &&
|
|
62163
|
-
const detachedFileName = detachString(
|
|
62162
|
+
const fileName2 = decodeDiffFileName(rawFileName, isGitDiff);
|
|
62163
|
+
if (type === "---" && fileName2 !== "/dev/null") {
|
|
62164
|
+
const detachedFileName = detachString(fileName2);
|
|
62164
62165
|
currentFile.prevName = detachedFileName;
|
|
62165
62166
|
currentFile.name = detachedFileName;
|
|
62166
|
-
} else if (type === "+++" &&
|
|
62167
|
+
} else if (type === "+++" && fileName2 !== "/dev/null") currentFile.name = detachString(fileName2);
|
|
62167
62168
|
} else if (isGitDiff) {
|
|
62168
62169
|
if (line.startsWith("new mode ")) currentFile.mode = detachString(line.slice(8).trim());
|
|
62169
62170
|
if (line.startsWith("old mode ")) currentFile.prevMode = detachString(line.slice(8).trim());
|
|
@@ -85617,7 +85618,17 @@ file-tree-container {
|
|
|
85617
85618
|
`;
|
|
85618
85619
|
var gestures = ["wheel", "touchmove", "pointerdown", "keydown"];
|
|
85619
85620
|
var folderName = "[data-item-type='folder'] > [data-item-section='content']";
|
|
85621
|
+
var fileName = "[data-item-type='file'] > [data-item-section='content']";
|
|
85620
85622
|
var rows = `
|
|
85623
|
+
[data-type='item'][data-item-focused='true']:focus:not(:focus-visible)::before {
|
|
85624
|
+
display: none;
|
|
85625
|
+
}
|
|
85626
|
+
@media (forced-colors: active) {
|
|
85627
|
+
[data-type='item'][data-item-selected='true'] {
|
|
85628
|
+
outline: var(--swc-border-width-100) solid Highlight;
|
|
85629
|
+
outline-offset: calc(-1 * var(--swc-border-width-100));
|
|
85630
|
+
}
|
|
85631
|
+
}
|
|
85621
85632
|
${folderName} {
|
|
85622
85633
|
display: block;
|
|
85623
85634
|
white-space: nowrap;
|
|
@@ -85634,6 +85645,20 @@ ${folderName} [data-truncate-content='visible'] {
|
|
|
85634
85645
|
display: inline;
|
|
85635
85646
|
direction: inherit;
|
|
85636
85647
|
}
|
|
85648
|
+
${fileName} [data-truncate-container] {
|
|
85649
|
+
white-space: nowrap;
|
|
85650
|
+
text-overflow: ellipsis;
|
|
85651
|
+
}
|
|
85652
|
+
${fileName} :is([data-truncate-grid], [data-truncate-grid] > div:not([data-truncate-marker-cell], [data-truncate-fill])) {
|
|
85653
|
+
display: contents;
|
|
85654
|
+
}
|
|
85655
|
+
${fileName} :is([data-truncate-content='overflow'], [data-truncate-marker-cell], [data-truncate-fill]) {
|
|
85656
|
+
display: none;
|
|
85657
|
+
}
|
|
85658
|
+
${fileName} [data-truncate-content='visible'] {
|
|
85659
|
+
display: inline;
|
|
85660
|
+
direction: inherit;
|
|
85661
|
+
}
|
|
85637
85662
|
`;
|
|
85638
85663
|
function titled(root2) {
|
|
85639
85664
|
for (const row of root2.querySelectorAll("[data-type='item'][aria-label]")) {
|
|
@@ -85966,22 +85991,22 @@ ${view.focused}`;
|
|
|
85966
85991
|
if (event2.key !== "Enter") return;
|
|
85967
85992
|
this.#open(this.#tree?.getFocusedPath());
|
|
85968
85993
|
}
|
|
85969
|
-
focus() {
|
|
85994
|
+
focus(options) {
|
|
85970
85995
|
const tree = this.#tree;
|
|
85971
85996
|
const path = tree?.getFocusedPath() ?? tree?.getVisibleRows(0, 1)[0]?.path;
|
|
85972
|
-
if (path) this.reveal(path);
|
|
85997
|
+
if (path) this.reveal(path, true, options);
|
|
85973
85998
|
}
|
|
85974
85999
|
#row(path) {
|
|
85975
86000
|
const container = this.#tree?.getFileTreeContainer();
|
|
85976
86001
|
return container?.shadowRoot?.querySelector(`[data-item-path="${CSS.escape(path)}"]`) ?? null;
|
|
85977
86002
|
}
|
|
85978
|
-
reveal(path, focus = true) {
|
|
86003
|
+
reveal(path, focus = true, options) {
|
|
85979
86004
|
this.#hold = null;
|
|
85980
86005
|
this.#tree?.scrollToPath(path, { focus });
|
|
85981
86006
|
if (!focus) return;
|
|
85982
86007
|
const row = this.#row(path);
|
|
85983
|
-
if (row) row.focus();
|
|
85984
|
-
else requestAnimationFrame(() => this.#row(path)?.focus());
|
|
86008
|
+
if (row) row.focus(options);
|
|
86009
|
+
else requestAnimationFrame(() => this.#row(path)?.focus(options));
|
|
85985
86010
|
}
|
|
85986
86011
|
};
|
|
85987
86012
|
function defineFileTree() {
|