Update package version to 0.0.7, add media/styles.css for styling, and adjust paths in webview files to reference new stylesheet location. Include .vscodeignore update to exclude media directory from packaging.
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
out/**
|
out/**
|
||||||
node_modules/**
|
node_modules/**
|
||||||
src/**
|
src/**
|
||||||
|
!media/**
|
||||||
.gitignore
|
.gitignore
|
||||||
.yarnrc
|
.yarnrc
|
||||||
webpack.config.js
|
webpack.config.js
|
||||||
|
|||||||
124
media/styles.css
Normal file
124
media/styles.css
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
:root {
|
||||||
|
--bg: #f7f7fa;
|
||||||
|
--panel-bg: #fff;
|
||||||
|
--text: #222;
|
||||||
|
--label: #555;
|
||||||
|
--input-bg: #f0f0f3;
|
||||||
|
--input-border: #d0d0d7;
|
||||||
|
--input-focus: #1976d2;
|
||||||
|
--button-bg: #1976d2;
|
||||||
|
--button-text: #fff;
|
||||||
|
--button-hover: #1565c0;
|
||||||
|
--border-radius: 8px;
|
||||||
|
--shadow: 0 2px 12px rgba(0,0,0,0.07);
|
||||||
|
}
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root {
|
||||||
|
--bg: #181a1b;
|
||||||
|
--panel-bg: #23272e;
|
||||||
|
--text: #f3f3f3;
|
||||||
|
--label: #b0b0b0;
|
||||||
|
--input-bg: #23272e;
|
||||||
|
--input-border: #33363b;
|
||||||
|
--input-focus: #90caf9;
|
||||||
|
--button-bg: #1976d2;
|
||||||
|
--button-text: #fff;
|
||||||
|
--button-hover: #1565c0;
|
||||||
|
--border-radius: 8px;
|
||||||
|
--shadow: 0 2px 12px rgba(0,0,0,0.25);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
|
||||||
|
margin: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
.create-container, .config-container {
|
||||||
|
max-width: 420px;
|
||||||
|
margin: 48px auto;
|
||||||
|
background: var(--panel-bg);
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
padding: 32px 36px 28px 36px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 18px;
|
||||||
|
}
|
||||||
|
.head-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.create-container h2, .config-container h2 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.01em;
|
||||||
|
}
|
||||||
|
.form-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
color: var(--label);
|
||||||
|
font-size: 1em;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
input, select {
|
||||||
|
background: var(--input-bg);
|
||||||
|
color: var(--text);
|
||||||
|
border: 1.5px solid var(--input-border);
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
padding: 8px 10px;
|
||||||
|
font-size: 1em;
|
||||||
|
transition: border 0.2s, box-shadow 0.2s;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
input:focus, select:focus {
|
||||||
|
border-color: var(--input-focus);
|
||||||
|
box-shadow: 0 0 0 2px var(--input-focus)33;
|
||||||
|
}
|
||||||
|
button, .btn {
|
||||||
|
margin-top: 10px;
|
||||||
|
background: var(--button-bg);
|
||||||
|
color: var(--button-text);
|
||||||
|
border: none;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
padding: 10px 15px;
|
||||||
|
font-size: 1.1em;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.2s, box-shadow 0.2s;
|
||||||
|
box-shadow: 0 1px 4px rgba(25, 118, 210, 0.08);
|
||||||
|
}
|
||||||
|
button:hover, button:focus, .btn:hover, .btn:focus {
|
||||||
|
background: var(--button-hover);
|
||||||
|
}
|
||||||
|
.destination {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
color: #888;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
.lang-select {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.var-hint {
|
||||||
|
color: #888;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.template-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#configForm {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
BIN
mytemplategenerator-0.0.6.vsix
Normal file
BIN
mytemplategenerator-0.0.6.vsix
Normal file
Binary file not shown.
@@ -2,7 +2,7 @@
|
|||||||
"name": "mytemplategenerator",
|
"name": "mytemplategenerator",
|
||||||
"displayName": "myTemplateGenerator",
|
"displayName": "myTemplateGenerator",
|
||||||
"description": "Generate files and folders from customizable templates with variable substitution in VSCode.",
|
"description": "Generate files and folders from customizable templates with variable substitution in VSCode.",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"publisher": "MyTemplateGenerator",
|
"publisher": "MyTemplateGenerator",
|
||||||
"author": "Sergey Gromov",
|
"author": "Sergey Gromov",
|
||||||
"icon": "logo.png",
|
"icon": "logo.png",
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ export async function showConfigWebview(context: vscode.ExtensionContext) {
|
|||||||
{ enableScripts: true }
|
{ enableScripts: true }
|
||||||
);
|
);
|
||||||
let config = readConfig();
|
let config = readConfig();
|
||||||
// Получаем URI для стилей
|
// Стили теперь лежат в media/styles.css (папка для статики)
|
||||||
const stylePath = vscode.Uri.joinPath(context.extensionUri, 'src', 'webview', 'styles.css');
|
const stylePath = vscode.Uri.joinPath(context.extensionUri, 'media', 'styles.css');
|
||||||
const styleUri = panel.webview.asWebviewUri(stylePath);
|
const styleUri = panel.webview.asWebviewUri(stylePath);
|
||||||
setHtml((config.language === 'en' ? 'en' : 'ru'));
|
setHtml((config.language === 'en' ? 'en' : 'ru'));
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ export async function showTemplateAndVarsWebview(
|
|||||||
return I18N_DICTIONARIES[language] || I18N_DICTIONARIES['ru'];
|
return I18N_DICTIONARIES[language] || I18N_DICTIONARIES['ru'];
|
||||||
}
|
}
|
||||||
const templates = fs.readdirSync(templatesDir).filter(f => fs.statSync(path.join(templatesDir, f)).isDirectory());
|
const templates = fs.readdirSync(templatesDir).filter(f => fs.statSync(path.join(templatesDir, f)).isDirectory());
|
||||||
const stylePath = vscode.Uri.joinPath(context.extensionUri, 'src', 'webview', 'styles.css');
|
// Стили теперь лежат в media/styles.css (папка для статики)
|
||||||
|
const stylePath = vscode.Uri.joinPath(context.extensionUri, 'media', 'styles.css');
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const panel = vscode.window.createWebviewPanel(
|
const panel = vscode.window.createWebviewPanel(
|
||||||
'templateVars',
|
'templateVars',
|
||||||
|
|||||||
Reference in New Issue
Block a user