jupyterlab_vscode_icons_extension 1.0.58 → 1.0.60
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/lib/index.js +8 -6
- package/package.json +1 -1
- package/src/index.ts +10 -9
package/lib/index.js
CHANGED
|
@@ -472,14 +472,18 @@ const plugin = {
|
|
|
472
472
|
`;
|
|
473
473
|
// Add a MutationObserver to mark special files in the file browser
|
|
474
474
|
const markSpecialFiles = () => {
|
|
475
|
-
//
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
// Clear all previous special file attributes first
|
|
475
|
+
// Clear all special attributes from ALL items first (to handle DOM element reuse)
|
|
476
|
+
const allItems = document.querySelectorAll('.jp-DirListing-item');
|
|
477
|
+
allItems.forEach(item => {
|
|
479
478
|
item.removeAttribute('data-claude-md');
|
|
480
479
|
item.removeAttribute('data-readme-md');
|
|
481
480
|
item.removeAttribute('data-jupytext-py');
|
|
482
481
|
item.removeAttribute('data-jupytext-md');
|
|
482
|
+
item.removeAttribute('data-shell-type');
|
|
483
|
+
});
|
|
484
|
+
// Mark Jupytext files (.py and .md notebooks) and CLAUDE.md
|
|
485
|
+
const notebookItems = document.querySelectorAll('.jp-DirListing-item[data-file-type="notebook"]');
|
|
486
|
+
notebookItems.forEach(item => {
|
|
483
487
|
const nameSpan = item.querySelector('.jp-DirListing-itemText');
|
|
484
488
|
if (nameSpan && nameSpan.textContent) {
|
|
485
489
|
const name = nameSpan.textContent.trim();
|
|
@@ -500,8 +504,6 @@ const plugin = {
|
|
|
500
504
|
// Mark shell script files for different coloring
|
|
501
505
|
const shellItems = document.querySelectorAll('.jp-DirListing-item[data-file-type="vscode-file-type-shell"]');
|
|
502
506
|
shellItems.forEach(item => {
|
|
503
|
-
// Clear previous shell type attribute first
|
|
504
|
-
item.removeAttribute('data-shell-type');
|
|
505
507
|
const nameSpan = item.querySelector('.jp-DirListing-itemText');
|
|
506
508
|
if (nameSpan && nameSpan.textContent) {
|
|
507
509
|
const name = nameSpan.textContent.trim();
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -521,17 +521,21 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
521
521
|
|
|
522
522
|
// Add a MutationObserver to mark special files in the file browser
|
|
523
523
|
const markSpecialFiles = () => {
|
|
524
|
-
//
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
);
|
|
528
|
-
notebookItems.forEach(item => {
|
|
529
|
-
// Clear all previous special file attributes first
|
|
524
|
+
// Clear all special attributes from ALL items first (to handle DOM element reuse)
|
|
525
|
+
const allItems = document.querySelectorAll('.jp-DirListing-item');
|
|
526
|
+
allItems.forEach(item => {
|
|
530
527
|
item.removeAttribute('data-claude-md');
|
|
531
528
|
item.removeAttribute('data-readme-md');
|
|
532
529
|
item.removeAttribute('data-jupytext-py');
|
|
533
530
|
item.removeAttribute('data-jupytext-md');
|
|
531
|
+
item.removeAttribute('data-shell-type');
|
|
532
|
+
});
|
|
534
533
|
|
|
534
|
+
// Mark Jupytext files (.py and .md notebooks) and CLAUDE.md
|
|
535
|
+
const notebookItems = document.querySelectorAll(
|
|
536
|
+
'.jp-DirListing-item[data-file-type="notebook"]'
|
|
537
|
+
);
|
|
538
|
+
notebookItems.forEach(item => {
|
|
535
539
|
const nameSpan = item.querySelector(
|
|
536
540
|
'.jp-DirListing-itemText'
|
|
537
541
|
) as HTMLElement;
|
|
@@ -554,9 +558,6 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
554
558
|
'.jp-DirListing-item[data-file-type="vscode-file-type-shell"]'
|
|
555
559
|
);
|
|
556
560
|
shellItems.forEach(item => {
|
|
557
|
-
// Clear previous shell type attribute first
|
|
558
|
-
item.removeAttribute('data-shell-type');
|
|
559
|
-
|
|
560
561
|
const nameSpan = item.querySelector(
|
|
561
562
|
'.jp-DirListing-itemText'
|
|
562
563
|
) as HTMLElement;
|