baseguard 1.0.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/.eslintrc.json +25 -0
- package/.prettierrc +8 -0
- package/README.md +94 -0
- package/bin/base.js +494 -0
- package/dist/ai/fix-manager.d.ts +67 -0
- package/dist/ai/fix-manager.d.ts.map +1 -0
- package/dist/ai/fix-manager.js +326 -0
- package/dist/ai/fix-manager.js.map +1 -0
- package/dist/ai/gemini-analyzer.d.ts +116 -0
- package/dist/ai/gemini-analyzer.d.ts.map +1 -0
- package/dist/ai/gemini-analyzer.js +572 -0
- package/dist/ai/gemini-analyzer.js.map +1 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +5 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/jules-implementer.d.ts +115 -0
- package/dist/ai/jules-implementer.d.ts.map +1 -0
- package/dist/ai/jules-implementer.js +387 -0
- package/dist/ai/jules-implementer.js.map +1 -0
- package/dist/commands/automation.d.ts +5 -0
- package/dist/commands/automation.d.ts.map +1 -0
- package/dist/commands/automation.js +305 -0
- package/dist/commands/automation.js.map +1 -0
- package/dist/commands/check.d.ts +9 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +113 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/config.d.ts +11 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +324 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/fix.d.ts +9 -0
- package/dist/commands/fix.d.ts.map +1 -0
- package/dist/commands/fix.js +207 -0
- package/dist/commands/fix.js.map +1 -0
- package/dist/commands/index.d.ts +6 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +7 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +125 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/core/api-key-manager.d.ts +83 -0
- package/dist/core/api-key-manager.d.ts.map +1 -0
- package/dist/core/api-key-manager.js +244 -0
- package/dist/core/api-key-manager.js.map +1 -0
- package/dist/core/baseguard.d.ts +46 -0
- package/dist/core/baseguard.d.ts.map +1 -0
- package/dist/core/baseguard.js +132 -0
- package/dist/core/baseguard.js.map +1 -0
- package/dist/core/baseline-checker.d.ts +63 -0
- package/dist/core/baseline-checker.d.ts.map +1 -0
- package/dist/core/baseline-checker.js +502 -0
- package/dist/core/baseline-checker.js.map +1 -0
- package/dist/core/cache-manager.d.ts +88 -0
- package/dist/core/cache-manager.d.ts.map +1 -0
- package/dist/core/cache-manager.js +213 -0
- package/dist/core/cache-manager.js.map +1 -0
- package/dist/core/configuration.d.ts +140 -0
- package/dist/core/configuration.d.ts.map +1 -0
- package/dist/core/configuration.js +474 -0
- package/dist/core/configuration.js.map +1 -0
- package/dist/core/directory-filter.d.ts +90 -0
- package/dist/core/directory-filter.d.ts.map +1 -0
- package/dist/core/directory-filter.js +319 -0
- package/dist/core/directory-filter.js.map +1 -0
- package/dist/core/error-handler.d.ts +110 -0
- package/dist/core/error-handler.d.ts.map +1 -0
- package/dist/core/error-handler.js +392 -0
- package/dist/core/error-handler.js.map +1 -0
- package/dist/core/file-processor.d.ts +80 -0
- package/dist/core/file-processor.d.ts.map +1 -0
- package/dist/core/file-processor.js +259 -0
- package/dist/core/file-processor.js.map +1 -0
- package/dist/core/gitignore-manager.d.ts +44 -0
- package/dist/core/gitignore-manager.d.ts.map +1 -0
- package/dist/core/gitignore-manager.js +147 -0
- package/dist/core/gitignore-manager.js.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/lazy-loader.d.ts +68 -0
- package/dist/core/lazy-loader.d.ts.map +1 -0
- package/dist/core/lazy-loader.js +260 -0
- package/dist/core/lazy-loader.js.map +1 -0
- package/dist/core/memory-manager.d.ts +1 -0
- package/dist/core/memory-manager.d.ts.map +1 -0
- package/dist/core/memory-manager.js +2 -0
- package/dist/core/memory-manager.js.map +1 -0
- package/dist/core/startup-optimizer.d.ts +45 -0
- package/dist/core/startup-optimizer.d.ts.map +1 -0
- package/dist/core/startup-optimizer.js +140 -0
- package/dist/core/startup-optimizer.js.map +1 -0
- package/dist/git/automation-engine.d.ts +58 -0
- package/dist/git/automation-engine.d.ts.map +1 -0
- package/dist/git/automation-engine.js +318 -0
- package/dist/git/automation-engine.js.map +1 -0
- package/dist/git/github-manager.d.ts +71 -0
- package/dist/git/github-manager.d.ts.map +1 -0
- package/dist/git/github-manager.js +226 -0
- package/dist/git/github-manager.js.map +1 -0
- package/dist/git/hook-manager.d.ts +43 -0
- package/dist/git/hook-manager.d.ts.map +1 -0
- package/dist/git/hook-manager.js +191 -0
- package/dist/git/hook-manager.js.map +1 -0
- package/dist/git/index.d.ts +4 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +5 -0
- package/dist/git/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/feature-validator.d.ts +60 -0
- package/dist/parsers/feature-validator.d.ts.map +1 -0
- package/dist/parsers/feature-validator.js +483 -0
- package/dist/parsers/feature-validator.js.map +1 -0
- package/dist/parsers/index.d.ts +8 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +9 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/parser-manager.d.ts +103 -0
- package/dist/parsers/parser-manager.d.ts.map +1 -0
- package/dist/parsers/parser-manager.js +321 -0
- package/dist/parsers/parser-manager.js.map +1 -0
- package/dist/parsers/parser.d.ts +23 -0
- package/dist/parsers/parser.d.ts.map +1 -0
- package/dist/parsers/parser.js +6 -0
- package/dist/parsers/parser.js.map +1 -0
- package/dist/parsers/react-parser.d.ts +22 -0
- package/dist/parsers/react-parser.d.ts.map +1 -0
- package/dist/parsers/react-parser.js +307 -0
- package/dist/parsers/react-parser.js.map +1 -0
- package/dist/parsers/svelte-parser.d.ts +33 -0
- package/dist/parsers/svelte-parser.d.ts.map +1 -0
- package/dist/parsers/svelte-parser.js +408 -0
- package/dist/parsers/svelte-parser.js.map +1 -0
- package/dist/parsers/vanilla-parser.d.ts +31 -0
- package/dist/parsers/vanilla-parser.d.ts.map +1 -0
- package/dist/parsers/vanilla-parser.js +590 -0
- package/dist/parsers/vanilla-parser.js.map +1 -0
- package/dist/parsers/vue-parser.d.ts +9 -0
- package/dist/parsers/vue-parser.d.ts.map +1 -0
- package/dist/parsers/vue-parser.js +16 -0
- package/dist/parsers/vue-parser.js.map +1 -0
- package/dist/terminal-header.d.ts +12 -0
- package/dist/terminal-header.js +45 -0
- package/dist/types/index.d.ts +83 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/components.d.ts +133 -0
- package/dist/ui/components.d.ts.map +1 -0
- package/dist/ui/components.js +482 -0
- package/dist/ui/components.js.map +1 -0
- package/dist/ui/help.d.ts +11 -0
- package/dist/ui/help.d.ts.map +1 -0
- package/dist/ui/help.js +161 -0
- package/dist/ui/help.js.map +1 -0
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +5 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/prompts.d.ts +63 -0
- package/dist/ui/prompts.d.ts.map +1 -0
- package/dist/ui/prompts.js +611 -0
- package/dist/ui/prompts.js.map +1 -0
- package/dist/ui/terminal-header.d.ts +13 -0
- package/dist/ui/terminal-header.d.ts.map +1 -0
- package/dist/ui/terminal-header.js +46 -0
- package/dist/ui/terminal-header.js.map +1 -0
- package/package.json +80 -0
- package/src/ai/__tests__/gemini-analyzer.test.ts +181 -0
- package/src/ai/fix-manager.ts +362 -0
- package/src/ai/gemini-analyzer.ts +671 -0
- package/src/ai/index.ts +4 -0
- package/src/ai/jules-implementer.ts +459 -0
- package/src/commands/automation.ts +344 -0
- package/src/commands/check.ts +299 -0
- package/src/commands/config.ts +365 -0
- package/src/commands/fix.ts +234 -0
- package/src/commands/index.ts +6 -0
- package/src/commands/init.ts +142 -0
- package/src/commands/status.ts +0 -0
- package/src/core/api-key-manager.ts +298 -0
- package/src/core/baseguard.ts +742 -0
- package/src/core/baseline-checker.ts +563 -0
- package/src/core/cache-manager.ts +270 -0
- package/src/core/configuration-recovery.ts +676 -0
- package/src/core/configuration.ts +559 -0
- package/src/core/debug-logger.ts +590 -0
- package/src/core/directory-filter.ts +421 -0
- package/src/core/error-handler.ts +517 -0
- package/src/core/file-processor.ts +331 -0
- package/src/core/gitignore-manager.ts +169 -0
- package/src/core/graceful-degradation-manager.ts +596 -0
- package/src/core/index.ts +13 -0
- package/src/core/lazy-loader.ts +307 -0
- package/src/core/logger.ts +0 -0
- package/src/core/memory-manager.ts +294 -0
- package/src/core/startup-optimizer.ts +173 -0
- package/src/core/system-error-handler.ts +746 -0
- package/src/git/automation-engine.ts +361 -0
- package/src/git/github-manager.ts +260 -0
- package/src/git/hook-manager.ts +210 -0
- package/src/git/index.ts +4 -0
- package/src/index.ts +8 -0
- package/src/parsers/feature-validator.ts +559 -0
- package/src/parsers/index.ts +8 -0
- package/src/parsers/parser-manager.ts +419 -0
- package/src/parsers/parser.ts +26 -0
- package/src/parsers/react-parser-optimized.ts +161 -0
- package/src/parsers/react-parser.ts +359 -0
- package/src/parsers/svelte-parser.ts +506 -0
- package/src/parsers/vanilla-parser.ts +682 -0
- package/src/parsers/vue-parser.ts +472 -0
- package/src/types/index.ts +92 -0
- package/src/ui/components.ts +567 -0
- package/src/ui/help.ts +193 -0
- package/src/ui/index.ts +4 -0
- package/src/ui/prompts.ts +688 -0
- package/src/ui/terminal-header.ts +59 -0
- package/test-config-commands.js +56 -0
- package/test-header-simple.js +33 -0
- package/test-terminal-header.js +12 -0
- package/test-ui.js +29 -0
- package/tests/e2e/baseguard.e2e.test.ts +516 -0
- package/tests/e2e/cross-platform.e2e.test.ts +420 -0
- package/tests/e2e/git-integration.e2e.test.ts +487 -0
- package/tests/fixtures/react-project/package.json +14 -0
- package/tests/fixtures/react-project/src/App.css +76 -0
- package/tests/fixtures/react-project/src/App.tsx +77 -0
- package/tests/fixtures/svelte-project/package.json +11 -0
- package/tests/fixtures/svelte-project/src/App.svelte +369 -0
- package/tests/fixtures/vanilla-project/index.html +76 -0
- package/tests/fixtures/vanilla-project/script.js +331 -0
- package/tests/fixtures/vanilla-project/styles.css +359 -0
- package/tests/fixtures/vue-project/package.json +12 -0
- package/tests/fixtures/vue-project/src/App.vue +216 -0
- package/tsconfig.json +36 -0
- package/vitest.config.ts +10 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount, onDestroy } from 'svelte';
|
|
3
|
+
|
|
4
|
+
let dialogOpen = false;
|
|
5
|
+
let dialogElement: HTMLDialogElement;
|
|
6
|
+
let canvasElement: HTMLCanvasElement;
|
|
7
|
+
let resizeObserver: ResizeObserver | null = null;
|
|
8
|
+
|
|
9
|
+
onMount(() => {
|
|
10
|
+
setupModernAPIs();
|
|
11
|
+
setupCanvas();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
onDestroy(() => {
|
|
15
|
+
if (resizeObserver) {
|
|
16
|
+
resizeObserver.disconnect();
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
function setupModernAPIs() {
|
|
21
|
+
// ResizeObserver - baseline newly available
|
|
22
|
+
resizeObserver = new ResizeObserver((entries) => {
|
|
23
|
+
console.log('Svelte: Element resized:', entries);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
if (dialogElement) {
|
|
27
|
+
resizeObserver.observe(dialogElement);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// structuredClone - baseline newly available
|
|
31
|
+
const testData = { svelte: true, reactive: { state: 'awesome' } };
|
|
32
|
+
const cloned = structuredClone(testData);
|
|
33
|
+
console.log('Svelte: Cloned data:', cloned);
|
|
34
|
+
|
|
35
|
+
// Array.at() - baseline newly available
|
|
36
|
+
const frameworks = ['svelte', 'vue', 'react', 'angular'];
|
|
37
|
+
const firstFramework = frameworks.at(0);
|
|
38
|
+
const lastFramework = frameworks.at(-1);
|
|
39
|
+
console.log('Svelte: First and last frameworks:', firstFramework, lastFramework);
|
|
40
|
+
|
|
41
|
+
// Optional chaining and nullish coalescing - baseline widely available
|
|
42
|
+
const config = { api: { endpoint: null } };
|
|
43
|
+
const endpoint = config?.api?.endpoint ?? 'https://default-api.com';
|
|
44
|
+
console.log('Svelte: API endpoint:', endpoint);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function setupCanvas() {
|
|
48
|
+
if (!canvasElement) return;
|
|
49
|
+
|
|
50
|
+
const ctx = canvasElement.getContext('2d');
|
|
51
|
+
if (ctx) {
|
|
52
|
+
// Modern Canvas API - filter property
|
|
53
|
+
ctx.filter = 'blur(3px) brightness(1.2)';
|
|
54
|
+
ctx.fillStyle = '#ff3e00';
|
|
55
|
+
ctx.fillRect(20, 20, 80, 80);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function openDialog() {
|
|
60
|
+
if (dialogElement) {
|
|
61
|
+
// HTMLDialogElement.showModal() - baseline newly available
|
|
62
|
+
dialogElement.showModal();
|
|
63
|
+
}
|
|
64
|
+
dialogOpen = true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function closeDialog() {
|
|
68
|
+
if (dialogElement) {
|
|
69
|
+
dialogElement.close();
|
|
70
|
+
}
|
|
71
|
+
dialogOpen = false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function testWebAPIs() {
|
|
75
|
+
// Test various modern Web APIs
|
|
76
|
+
|
|
77
|
+
// AbortController - baseline widely available
|
|
78
|
+
const controller = new AbortController();
|
|
79
|
+
const { signal } = controller;
|
|
80
|
+
|
|
81
|
+
// Fetch with modern options
|
|
82
|
+
fetch('https://api.example.com/svelte-data', {
|
|
83
|
+
signal,
|
|
84
|
+
method: 'POST',
|
|
85
|
+
headers: {
|
|
86
|
+
'Content-Type': 'application/json'
|
|
87
|
+
},
|
|
88
|
+
body: JSON.stringify({ framework: 'svelte' })
|
|
89
|
+
})
|
|
90
|
+
.then(response => response.json())
|
|
91
|
+
.catch(error => {
|
|
92
|
+
if (error.name === 'AbortError') {
|
|
93
|
+
console.log('Svelte: Fetch aborted');
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// Abort after 500ms
|
|
98
|
+
setTimeout(() => controller.abort(), 500);
|
|
99
|
+
|
|
100
|
+
// IntersectionObserver - baseline widely available
|
|
101
|
+
const observer = new IntersectionObserver((entries) => {
|
|
102
|
+
entries.forEach(entry => {
|
|
103
|
+
console.log('Svelte: Element intersection:', entry.isIntersecting);
|
|
104
|
+
});
|
|
105
|
+
}, {
|
|
106
|
+
threshold: [0, 0.5, 1]
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
if (canvasElement) {
|
|
110
|
+
observer.observe(canvasElement);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Test URLSearchParams - baseline widely available
|
|
114
|
+
const params = new URLSearchParams();
|
|
115
|
+
params.set('framework', 'svelte');
|
|
116
|
+
params.set('version', '4.2');
|
|
117
|
+
console.log('Svelte: URL params:', params.toString());
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function testAdvancedCanvas() {
|
|
121
|
+
if (!canvasElement) return;
|
|
122
|
+
|
|
123
|
+
// Test OffscreenCanvas - baseline newly available
|
|
124
|
+
if ('OffscreenCanvas' in window) {
|
|
125
|
+
const offscreen = new OffscreenCanvas(150, 150);
|
|
126
|
+
const ctx = offscreen.getContext('2d');
|
|
127
|
+
if (ctx) {
|
|
128
|
+
ctx.fillStyle = '#ff3e00';
|
|
129
|
+
ctx.fillRect(0, 0, 75, 75);
|
|
130
|
+
|
|
131
|
+
// Convert to ImageBitmap - modern API
|
|
132
|
+
offscreen.convertToBlob().then(blob => {
|
|
133
|
+
console.log('Svelte: OffscreenCanvas blob created:', blob.size);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Test WebGL2 - baseline widely available
|
|
139
|
+
const gl = canvasElement.getContext('webgl2');
|
|
140
|
+
if (gl) {
|
|
141
|
+
gl.clearColor(1.0, 0.24, 0.0, 1.0); // Svelte orange
|
|
142
|
+
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
143
|
+
|
|
144
|
+
// Test WebGL2 specific features
|
|
145
|
+
const texture = gl.createTexture();
|
|
146
|
+
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
147
|
+
gl.texStorage2D(gl.TEXTURE_2D, 1, gl.RGBA8, 256, 256);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function testServiceWorker() {
|
|
152
|
+
// Service Worker registration - baseline widely available
|
|
153
|
+
if ('serviceWorker' in navigator) {
|
|
154
|
+
navigator.serviceWorker.register('/sw.js')
|
|
155
|
+
.then(registration => {
|
|
156
|
+
console.log('Svelte: SW registered:', registration.scope);
|
|
157
|
+
})
|
|
158
|
+
.catch(error => {
|
|
159
|
+
console.log('Svelte: SW registration failed:', error);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Test Cache API - baseline widely available
|
|
164
|
+
if ('caches' in window) {
|
|
165
|
+
caches.open('svelte-cache-v1').then(cache => {
|
|
166
|
+
cache.add('/api/data');
|
|
167
|
+
console.log('Svelte: Cache opened and populated');
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
</script>
|
|
172
|
+
|
|
173
|
+
<div class="svelte-app">
|
|
174
|
+
<h1>Svelte Test App</h1>
|
|
175
|
+
|
|
176
|
+
<div class="button-group">
|
|
177
|
+
<button on:click={openDialog}>Open Dialog</button>
|
|
178
|
+
<button on:click={testWebAPIs}>Test Web APIs</button>
|
|
179
|
+
<button on:click={testAdvancedCanvas}>Test Canvas</button>
|
|
180
|
+
<button on:click={testServiceWorker}>Test Service Worker</button>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<dialog bind:this={dialogElement} open={dialogOpen}>
|
|
184
|
+
<div class="dialog-content">
|
|
185
|
+
<h2>Modern Dialog in Svelte</h2>
|
|
186
|
+
<p>This dialog uses the native HTML dialog element with modern CSS styling.</p>
|
|
187
|
+
<button on:click={closeDialog}>Close Dialog</button>
|
|
188
|
+
</div>
|
|
189
|
+
</dialog>
|
|
190
|
+
|
|
191
|
+
<div class="container-test">
|
|
192
|
+
<h3>Container Query Test</h3>
|
|
193
|
+
<p>This container adapts based on its own size, not the viewport.</p>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<canvas bind:this={canvasElement} width="300" height="200"></canvas>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<style>
|
|
200
|
+
/* Modern CSS features in Svelte component */
|
|
201
|
+
.svelte-app {
|
|
202
|
+
container-type: inline-size;
|
|
203
|
+
container-name: svelte-container;
|
|
204
|
+
|
|
205
|
+
/* Modern CSS properties */
|
|
206
|
+
aspect-ratio: 16/10;
|
|
207
|
+
accent-color: #ff3e00;
|
|
208
|
+
color-scheme: light dark;
|
|
209
|
+
|
|
210
|
+
/* CSS Grid with modern features */
|
|
211
|
+
display: grid;
|
|
212
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
213
|
+
gap: 2rem;
|
|
214
|
+
|
|
215
|
+
/* Modern CSS functions */
|
|
216
|
+
background: color-mix(in srgb, #ff3e00 20%, white);
|
|
217
|
+
|
|
218
|
+
/* Backdrop filter */
|
|
219
|
+
backdrop-filter: blur(8px) saturate(1.2);
|
|
220
|
+
|
|
221
|
+
padding: 2rem;
|
|
222
|
+
border-radius: 12px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* Container queries */
|
|
226
|
+
@container svelte-container (min-width: 600px) {
|
|
227
|
+
.container-test {
|
|
228
|
+
font-size: 1.3rem;
|
|
229
|
+
grid-column: span 2;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.button-group {
|
|
233
|
+
display: flex;
|
|
234
|
+
gap: 1rem;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@container svelte-container (max-width: 400px) {
|
|
239
|
+
.svelte-app {
|
|
240
|
+
grid-template-columns: 1fr;
|
|
241
|
+
gap: 1rem;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* Modern selectors */
|
|
246
|
+
.svelte-app:has(dialog[open]) {
|
|
247
|
+
background-color: rgba(255, 62, 0, 0.1);
|
|
248
|
+
backdrop-filter: blur(12px);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* CSS nesting */
|
|
252
|
+
.button-group {
|
|
253
|
+
display: grid;
|
|
254
|
+
gap: 0.5rem;
|
|
255
|
+
|
|
256
|
+
button {
|
|
257
|
+
background: linear-gradient(135deg, #ff3e00, #ff6b35);
|
|
258
|
+
color: white;
|
|
259
|
+
border: none;
|
|
260
|
+
padding: 0.75rem 1.5rem;
|
|
261
|
+
border-radius: 6px;
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
transition: all 0.2s ease;
|
|
264
|
+
|
|
265
|
+
&:hover {
|
|
266
|
+
transform: translateY(-2px);
|
|
267
|
+
box-shadow: 0 4px 12px rgba(255, 62, 0, 0.3);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
&:focus-visible {
|
|
271
|
+
outline: 2px solid #ff3e00;
|
|
272
|
+
outline-offset: 2px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&:active {
|
|
276
|
+
transform: translateY(0);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.container-test {
|
|
282
|
+
background: linear-gradient(45deg, #ff3e00, transparent);
|
|
283
|
+
padding: 1.5rem;
|
|
284
|
+
border-radius: 8px;
|
|
285
|
+
|
|
286
|
+
/* Modern CSS units and functions */
|
|
287
|
+
width: clamp(200px, 100%, 500px);
|
|
288
|
+
height: max(120px, 12vh);
|
|
289
|
+
margin-block: 1rem;
|
|
290
|
+
padding-inline: 2rem;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* Dialog styling with modern CSS */
|
|
294
|
+
dialog {
|
|
295
|
+
border: none;
|
|
296
|
+
border-radius: 12px;
|
|
297
|
+
padding: 0;
|
|
298
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
|
|
299
|
+
backdrop-filter: blur(10px);
|
|
300
|
+
|
|
301
|
+
&::backdrop {
|
|
302
|
+
background: color-mix(in srgb, black 50%, transparent);
|
|
303
|
+
backdrop-filter: blur(4px);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.dialog-content {
|
|
308
|
+
padding: 2rem;
|
|
309
|
+
background: linear-gradient(135deg, white, #f8f9fa);
|
|
310
|
+
border-radius: 12px;
|
|
311
|
+
|
|
312
|
+
h2 {
|
|
313
|
+
margin-top: 0;
|
|
314
|
+
color: #ff3e00;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
button {
|
|
318
|
+
background: #ff3e00;
|
|
319
|
+
color: white;
|
|
320
|
+
border: none;
|
|
321
|
+
padding: 0.5rem 1rem;
|
|
322
|
+
border-radius: 4px;
|
|
323
|
+
cursor: pointer;
|
|
324
|
+
|
|
325
|
+
&:hover {
|
|
326
|
+
background: #e63600;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
canvas {
|
|
332
|
+
border: 2px solid #ff3e00;
|
|
333
|
+
border-radius: 8px;
|
|
334
|
+
background: white;
|
|
335
|
+
|
|
336
|
+
&:hover {
|
|
337
|
+
box-shadow: 0 4px 16px rgba(255, 62, 0, 0.2);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* CSS custom properties with modern color functions */
|
|
342
|
+
:root {
|
|
343
|
+
--svelte-primary: oklch(0.6 0.25 25);
|
|
344
|
+
--svelte-secondary: color(display-p3 1 0.24 0);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/* Modern pseudo-classes and logical properties */
|
|
348
|
+
.svelte-app > * {
|
|
349
|
+
margin-block-end: 1rem;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.svelte-app *:is(h1, h2, h3) {
|
|
353
|
+
color: var(--svelte-primary);
|
|
354
|
+
font-weight: 600;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/* CSS @supports for progressive enhancement */
|
|
358
|
+
@supports (container-type: inline-size) {
|
|
359
|
+
.svelte-app {
|
|
360
|
+
border: 3px solid #ff3e00;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
@supports (backdrop-filter: blur(10px)) {
|
|
365
|
+
dialog {
|
|
366
|
+
background: rgba(255, 255, 255, 0.9);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
</style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Vanilla Test Project</title>
|
|
7
|
+
<link rel="stylesheet" href="styles.css">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div class="vanilla-app">
|
|
11
|
+
<h1>Vanilla JavaScript Test App</h1>
|
|
12
|
+
|
|
13
|
+
<div class="button-group">
|
|
14
|
+
<button id="openDialog">Open Dialog</button>
|
|
15
|
+
<button id="testAPIs">Test Web APIs</button>
|
|
16
|
+
<button id="testCanvas">Test Canvas</button>
|
|
17
|
+
<button id="testWebGL">Test WebGL</button>
|
|
18
|
+
<button id="testServiceWorker">Test Service Worker</button>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<!-- Modern HTML elements -->
|
|
22
|
+
<dialog id="testDialog">
|
|
23
|
+
<div class="dialog-content">
|
|
24
|
+
<h2>Native HTML Dialog</h2>
|
|
25
|
+
<p>This is a native HTML dialog element with modern styling.</p>
|
|
26
|
+
<form method="dialog">
|
|
27
|
+
<button value="cancel">Cancel</button>
|
|
28
|
+
<button value="confirm">Confirm</button>
|
|
29
|
+
</form>
|
|
30
|
+
</div>
|
|
31
|
+
</dialog>
|
|
32
|
+
|
|
33
|
+
<details class="details-section">
|
|
34
|
+
<summary>Modern HTML Details/Summary</summary>
|
|
35
|
+
<p>This content is revealed when the summary is clicked. The details/summary elements are part of modern HTML.</p>
|
|
36
|
+
<ul>
|
|
37
|
+
<li>Baseline widely available</li>
|
|
38
|
+
<li>Native browser implementation</li>
|
|
39
|
+
<li>Accessible by default</li>
|
|
40
|
+
</ul>
|
|
41
|
+
</details>
|
|
42
|
+
|
|
43
|
+
<div class="container-test">
|
|
44
|
+
<h3>Container Query Test</h3>
|
|
45
|
+
<p>This container changes layout based on its own size.</p>
|
|
46
|
+
<div class="nested-container">
|
|
47
|
+
<p>Nested content that responds to container queries.</p>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div class="grid-container">
|
|
52
|
+
<div class="grid-item">Grid Item 1</div>
|
|
53
|
+
<div class="grid-item">Grid Item 2</div>
|
|
54
|
+
<div class="grid-item">Grid Item 3</div>
|
|
55
|
+
<div class="grid-item">Grid Item 4</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<canvas id="testCanvas" width="400" height="300"></canvas>
|
|
59
|
+
|
|
60
|
+
<div class="modern-inputs">
|
|
61
|
+
<h3>Modern Input Types</h3>
|
|
62
|
+
<input type="date" id="dateInput" />
|
|
63
|
+
<input type="color" id="colorInput" value="#ff0000" />
|
|
64
|
+
<input type="range" id="rangeInput" min="0" max="100" value="50" />
|
|
65
|
+
<input type="search" id="searchInput" placeholder="Search..." />
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="loading-test">
|
|
69
|
+
<h3>Lazy Loading Test</h3>
|
|
70
|
+
<img src="https://picsum.photos/400/300" alt="Test image" loading="lazy" />
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<script src="script.js"></script>
|
|
75
|
+
</body>
|
|
76
|
+
</html>
|