Skip to content

Commit d0658ea

Browse files
Bump version to 0.0.3 and update version badge in README.md
1 parent 87c3786 commit d0658ea

File tree

8 files changed

+27
-297
lines changed

8 files changed

+27
-297
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# JetTreeMark for VS Code
22

33
![Build](https://github.com/HichemTab-tech/JetTreeMark-vscode/actions/workflows/ci.yml/badge.svg)
4-
[![Version](https://img.shields.io/badge/version-0.0.2-blue.svg)](https://github.com/HichemTab-tech/JetTreeMark-vscode/releases) [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/HichemTab-tech/JetTreeMark-vscode/blob/master/LICENSE)
4+
[![Version](https://img.shields.io/badge/version-0.0.3-blue.svg)](https://github.com/HichemTab-tech/JetTreeMark-vscode/releases) [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/HichemTab-tech/JetTreeMark-vscode/blob/master/LICENSE)
55

66
---
77

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "jettreemark",
33
"displayName": "JetTreeMark",
44
"description": "JetTreeMark is a VS Code plugin that generates a markdown-compatible structure tree for selected files and folders",
5-
"version": "0.0.2",
5+
"version": "0.0.3",
66
"publisher": "HichemTab-tech",
77
"repository": "https://github.com/HichemTab-tech/JetTreeMark-vscode",
88
"icon": "pluginIcon.png",
@@ -23,15 +23,15 @@
2323
{
2424
"id": "jettreemark",
2525
"title": "JetTreeMark",
26-
"icon": "src/pluginIcon.ico"
26+
"icon": "pluginIcon.png"
2727
}
2828
]
2929
},
3030
"views": {
3131
"jettreemark": [
3232
{
3333
"type": "webview",
34-
"icon": "src/pluginIcon.ico",
34+
"icon": "pluginIcon.png",
3535
"id": "jettreemark.view",
3636
"name": "Tree View"
3737
}

src/JetTreeMarkViewProvider.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,30 @@ export class JetTreeMarkViewProvider implements vscode.WebviewViewProvider {
2424
const folder = path.join(this.extensionUri.fsPath, 'src', 'webview-ui-dist');
2525
let html = fs.readFileSync(path.join(folder, 'index.html'), 'utf8');
2626

27-
// Rewrite all <link href> and <script src> to use webview.asWebviewUri
27+
// 1) compute the folder URI for assets
28+
const baseUri = webviewView.webview.asWebviewUri(
29+
vscode.Uri.joinPath(this.extensionUri, 'src', 'webview-ui-dist')
30+
) + '/';
31+
32+
// 2) inject the <base> so that all "./…" references resolve correctly
33+
html = html.replace(
34+
/<head([^>]*)>/,
35+
`<head$1><base href="${baseUri}">`
36+
);
37+
38+
// 3) now do your existing href/src rewrite to rewrite only the HTML tags
2839
html = html.replace(/(href|src)="(.+?)"/g, (_, attr, src) => {
29-
// normalize the path
30-
let rel = src;
31-
if (rel.startsWith('/')) {rel = rel.slice(1);}
32-
if (!rel.startsWith('assets/') && !rel.startsWith('./')) {
33-
return `${attr}="${src}"`; // leave untouched
40+
// only rewrite links that aren’t absolute URLs (http, https, vscode-*)
41+
if (/^(https?:|vscode-webview:)/.test(src)) {
42+
return `${attr}="${src}"`;
3443
}
35-
36-
// remove any leading "./"
37-
rel = rel.replace(/^\.\//, '');
38-
// map to disk path under media/webview
39-
const diskPath = path.join(folder, rel);
40-
// get a proper vscode-webview:// URI
41-
const uri = webviewView.webview.asWebviewUri(
42-
vscode.Uri.file(diskPath)
43-
);
44-
return `${attr}="${uri}"`;
44+
// Every other href/src (i.e. "./assets/…" or "assets/…") now resolves via <base>
45+
return `${attr}="${src}"`;
4546
});
4647

4748
webviewView.webview.html = html;
4849

50+
4951
// Listen for copyTree messages from the webview
5052
webviewView.webview.onDidReceiveMessage(msg => {
5153
if (msg.command === 'copyTree') {

src/webview-ui-dist/assets/index-BqG2SY6q.js

Lines changed: 0 additions & 191 deletions
This file was deleted.

src/webview-ui-dist/assets/index-BqG2SY6q.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/webview-ui-dist/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/pluginIcon.svg" />
5+
<link rel="icon" type="image/svg+xml" href="./pluginIcon.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Vite + React + TS</title>
8-
<script type="module" crossorigin src="/assets/index-BqG2SY6q.js"></script>
9-
<link rel="stylesheet" crossorigin href="/assets/index-CQH7BAVW.css">
8+
<script type="module" crossorigin src="./assets/index-FgDeyH1r.js"></script>
9+
<link rel="stylesheet" crossorigin href="./assets/index-CQH7BAVW.css">
1010
</head>
1111
<body>
1212
<div id="root"></div>

webview-ui/src/components/logo.tsx

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,6 @@
11
const Logo = () => {
22
return (
3-
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
4-
width="100%" viewBox="0 0 704 704" enableBackground="new 0 0 704 704" xmlSpace="preserve" className="w-24 h-24">
5-
<path fill="#34d399" opacity="1.000000" stroke="none"
6-
d="
7-
M316.797455,26.501810
8-
C319.175659,11.839892 332.329590,6.402603 343.407867,10.816363
9-
C350.018677,13.450212 353.501953,18.593798 354.364349,25.661318
10-
C355.705292,36.650482 354.339966,47.623676 354.341705,58.603580
11-
C354.350922,116.430145 354.318024,174.256699 354.353760,232.083237
12-
C354.355042,234.121368 353.556335,236.447281 355.540009,238.168869
13-
C357.772095,238.319000 358.741119,236.570908 359.985199,235.318039
14-
C383.700623,211.435333 407.413147,187.549744 431.101257,163.639954
15-
C436.165161,158.528656 441.921448,155.490036 449.401123,156.544937
16-
C461.488251,158.249634 468.920807,171.383423 464.033112,182.594223
17-
C462.132782,186.952972 459.028687,190.401794 455.715271,193.732483
18-
C423.277618,226.338989 390.902435,259.007812 358.399384,291.548920
19-
C355.448792,294.503021 354.247711,297.515686 354.260437,301.674469
20-
C354.387238,343.169220 354.325684,384.664490 354.375732,426.159607
21-
C354.378204,428.201111 353.566864,430.532227 355.775330,432.389313
22-
C358.969513,431.880920 360.572266,429.109009 362.602051,427.079010
23-
C407.370392,382.306732 452.114990,337.510590 496.798706,292.653870
24-
C502.695343,286.734406 509.485016,283.957367 517.596375,286.343933
25-
C530.863525,290.247559 535.544495,305.602814 526.459045,316.421448
26-
C519.940308,324.183746 512.527771,331.210419 505.351440,338.403198
27-
C456.387970,387.479156 407.397583,436.528351 358.346588,485.516754
28-
C355.557495,488.302277 354.254211,491.152832 354.262573,495.168274
29-
C354.373322,548.328491 354.396576,601.489197 354.233826,654.649170
30-
C354.218842,659.547729 355.756012,660.791809 360.490845,660.780396
31-
C420.483429,660.635498 480.476501,660.690063 540.469421,660.656860
32-
C543.989075,660.654907 547.459106,660.823547 550.852661,661.796509
33-
C560.081055,664.442627 565.348694,672.552612 564.295776,682.468262
34-
C563.431824,690.603760 555.565369,697.758484 546.835754,698.328247
35-
C545.839478,698.393250 544.836670,698.367859 543.836853,698.367920
36-
C426.850555,698.376770 309.864227,698.394348 192.877930,698.379456
37-
C176.909988,698.377380 167.655380,683.445618 175.385864,670.091614
38-
C179.484482,663.011414 186.281876,660.699280 194.045471,660.694031
39-
C232.207657,660.668274 270.369873,660.679321 308.532074,660.675842
40-
C316.716217,660.675110 316.734406,660.672302 316.735016,652.545410
41-
C316.740509,579.220703 316.696686,505.895935 316.835388,432.571533
42-
C316.844604,427.689941 315.452576,424.231476 311.971680,420.775360
43-
C262.308228,371.466095 212.781616,322.018982 163.217346,272.609802
44-
C157.546158,266.956360 153.680573,260.668396 155.567596,252.169235
45-
C158.482941,239.038513 172.539886,232.952423 183.947891,240.046509
46-
C186.321121,241.522293 188.447922,243.482681 190.441559,245.467560
47-
C230.706955,285.556213 270.934875,325.682495 311.178680,365.792847
48-
C312.575012,367.184601 314.057281,368.490143 315.532440,369.866638
49-
C317.362701,368.341187 316.625366,366.559265 316.626984,365.046783
50-
C316.677002,318.552246 316.628845,272.057587 316.747345,225.563324
51-
C316.757599,221.537354 315.402618,218.709595 312.612549,215.933609
52-
C284.853210,188.314163 257.196075,160.591965 229.507126,132.901718
53-
C226.793335,130.187820 224.086319,127.471497 222.283386,124.019203
54-
C217.668472,115.182442 219.828064,104.923012 227.452377,99.453339
55-
C234.488327,94.405762 244.827255,95.638153 251.603333,102.344398
56-
C271.381989,121.919220 291.168365,141.486267 310.910767,161.097580
57-
C312.436279,162.612976 313.642365,164.449951 314.996948,166.137466
58-
C315.580078,165.903656 316.163208,165.669846 316.746338,165.436035
59-
C316.746338,119.272728 316.746338,73.109413 316.797455,26.501810
60-
z"/>
61-
<path fill="#34d399" opacity="1.000000" stroke="none"
62-
d="
63-
M499.482849,449.477722
64-
C515.117676,433.757477 530.507019,418.288544 545.890564,402.813873
65-
C553.855774,394.801544 563.980408,394.740173 571.902954,402.646545
66-
C590.294739,421.000732 608.694763,439.346588 627.092346,457.694977
67-
C636.455444,467.033020 636.730835,475.595642 627.470764,484.950165
68-
C593.837280,518.926636 560.083679,552.783997 526.398621,586.709412
69-
C512.433716,600.773987 498.426514,614.799194 484.649353,629.046143
70-
C479.825775,634.034119 474.488495,636.292542 467.464264,636.528442
71-
C455.188538,636.940796 442.948669,638.384460 430.688934,639.333801
72-
C428.002991,639.541748 425.901550,640.962646 424.098053,642.610107
73-
C413.229919,652.538086 400.615784,655.765686 386.008972,654.590088
74-
C373.719086,653.601013 373.695404,654.389404 373.628082,642.106201
75-
C373.607147,638.285217 373.321503,634.464905 373.129944,630.645630
76-
C372.939301,626.844482 373.892456,623.436951 376.278748,620.403076
77-
C380.909393,614.515869 385.445251,608.554138 390.064209,602.657593
78-
C391.648743,600.634766 392.647156,598.529236 392.686523,595.843323
79-
C392.859619,584.037476 393.657379,572.263855 394.529114,560.488098
80-
C394.850891,556.141479 396.603455,552.970093 399.529724,550.029358
81-
C429.257721,520.154663 458.948486,490.242859 488.651672,460.343445
82-
C492.173340,456.798462 495.706848,453.265259 499.482849,449.477722
83-
z"/>
84-
</svg>
3+
<img src="./pluginIcon.png" className="w-24 h-24"/>
854
)
865
}
876

webview-ui/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import react from '@vitejs/plugin-react'
55

66
// https://vite.dev/config/
77
export default defineConfig({
8+
base: "./",
89
plugins: [react(), tailwindcss()],
910
resolve: {
1011
alias: {

0 commit comments

Comments
 (0)