@sc4rfurryx/proteusjs 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/API.md +438 -0
- package/FEATURES.md +286 -0
- package/LICENSE +21 -0
- package/README.md +645 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/proteus.cjs.js +16014 -0
- package/dist/proteus.cjs.js.map +1 -0
- package/dist/proteus.d.ts +3018 -0
- package/dist/proteus.esm.js +16005 -0
- package/dist/proteus.esm.js.map +1 -0
- package/dist/proteus.esm.min.js +8 -0
- package/dist/proteus.esm.min.js.map +1 -0
- package/dist/proteus.js +16020 -0
- package/dist/proteus.js.map +1 -0
- package/dist/proteus.min.js +8 -0
- package/dist/proteus.min.js.map +1 -0
- package/package.json +98 -0
- package/src/__tests__/mvp-integration.test.ts +518 -0
- package/src/accessibility/AccessibilityEngine.ts +2106 -0
- package/src/accessibility/ScreenReaderSupport.ts +444 -0
- package/src/accessibility/__tests__/ScreenReaderSupport.test.ts +435 -0
- package/src/animations/FLIPAnimationSystem.ts +491 -0
- package/src/compatibility/BrowserCompatibility.ts +1076 -0
- package/src/containers/BreakpointSystem.ts +347 -0
- package/src/containers/ContainerBreakpoints.ts +726 -0
- package/src/containers/ContainerManager.ts +370 -0
- package/src/containers/ContainerUnits.ts +336 -0
- package/src/containers/ContextIsolation.ts +394 -0
- package/src/containers/ElementQueries.ts +411 -0
- package/src/containers/SmartContainer.ts +536 -0
- package/src/containers/SmartContainers.ts +376 -0
- package/src/containers/__tests__/ContainerBreakpoints.test.ts +411 -0
- package/src/containers/__tests__/SmartContainers.test.ts +281 -0
- package/src/content/ResponsiveImages.ts +570 -0
- package/src/core/EventSystem.ts +147 -0
- package/src/core/MemoryManager.ts +321 -0
- package/src/core/PerformanceMonitor.ts +238 -0
- package/src/core/PluginSystem.ts +275 -0
- package/src/core/ProteusJS.test.ts +164 -0
- package/src/core/ProteusJS.ts +962 -0
- package/src/developer/PerformanceProfiler.ts +567 -0
- package/src/developer/VisualDebuggingTools.ts +656 -0
- package/src/developer/ZeroConfigSystem.ts +593 -0
- package/src/index.ts +35 -0
- package/src/integration.test.ts +227 -0
- package/src/layout/AdaptiveGrid.ts +429 -0
- package/src/layout/ContentReordering.ts +532 -0
- package/src/layout/FlexboxEnhancer.ts +406 -0
- package/src/layout/FlowLayout.ts +545 -0
- package/src/layout/SpacingSystem.ts +512 -0
- package/src/observers/IntersectionObserverPolyfill.ts +289 -0
- package/src/observers/ObserverManager.ts +299 -0
- package/src/observers/ResizeObserverPolyfill.ts +179 -0
- package/src/performance/BatchDOMOperations.ts +519 -0
- package/src/performance/CSSOptimizationEngine.ts +646 -0
- package/src/performance/CacheOptimizationSystem.ts +601 -0
- package/src/performance/EfficientEventHandler.ts +740 -0
- package/src/performance/LazyEvaluationSystem.ts +532 -0
- package/src/performance/MemoryManagementSystem.ts +497 -0
- package/src/performance/PerformanceMonitor.ts +931 -0
- package/src/performance/__tests__/BatchDOMOperations.test.ts +309 -0
- package/src/performance/__tests__/EfficientEventHandler.test.ts +268 -0
- package/src/performance/__tests__/PerformanceMonitor.test.ts +422 -0
- package/src/polyfills/BrowserPolyfills.ts +586 -0
- package/src/polyfills/__tests__/BrowserPolyfills.test.ts +328 -0
- package/src/test/setup.ts +115 -0
- package/src/theming/SmartThemeSystem.ts +591 -0
- package/src/types/index.ts +134 -0
- package/src/typography/ClampScaling.ts +356 -0
- package/src/typography/FluidTypography.ts +759 -0
- package/src/typography/LineHeightOptimization.ts +430 -0
- package/src/typography/LineHeightOptimizer.ts +326 -0
- package/src/typography/TextFitting.ts +355 -0
- package/src/typography/TypographicScale.ts +428 -0
- package/src/typography/VerticalRhythm.ts +369 -0
- package/src/typography/__tests__/FluidTypography.test.ts +432 -0
- package/src/typography/__tests__/LineHeightOptimization.test.ts +436 -0
- package/src/utils/Logger.ts +173 -0
- package/src/utils/debounce.ts +259 -0
- package/src/utils/performance.ts +371 -0
- package/src/utils/support.ts +106 -0
- package/src/utils/version.ts +24 -0
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 sc4rfurry
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,645 @@
|
|
1
|
+
<div align="center">
|
2
|
+
|
3
|
+
# 🌊 ProteusJS
|
4
|
+
|
5
|
+
**The Modern Web Development Framework for Accessible, Responsive, and High-Performance Applications**
|
6
|
+
|
7
|
+
*Shape-shifting responsive design that adapts like the sea god himself*
|
8
|
+
|
9
|
+
[](https://www.npmjs.com/package/@sc4rfurryx/proteusjs)
|
10
|
+
[](https://www.npmjs.com/package/@sc4rfurryx/proteusjs)
|
11
|
+
[](https://github.com/sc4rfurry/ProteusJS/stargazers)
|
12
|
+
[](https://github.com/sc4rfurry/ProteusJS/blob/main/LICENSE)
|
13
|
+
|
14
|
+
[](https://www.typescriptlang.org/)
|
15
|
+
[](https://www.w3.org/WAI/WCAG21/quickref/)
|
16
|
+
[](https://github.com/sc4rfurry/ProteusJS/actions)
|
17
|
+
[](https://github.com/sc4rfurry/ProteusJS)
|
18
|
+
|
19
|
+
</div>
|
20
|
+
|
21
|
+
---
|
22
|
+
|
23
|
+
## 🚀 **What is ProteusJS?**
|
24
|
+
|
25
|
+
ProteusJS is a comprehensive TypeScript library that revolutionizes web development with intelligent layout systems, advanced typography, WCAG-compliant accessibility features, and performance optimizations. Built for modern web development, it offers **container queries**, **fluid typography**, **screen reader support**, and **automated accessibility compliance**.
|
26
|
+
|
27
|
+
## ✨ **Key Features**
|
28
|
+
|
29
|
+
<table>
|
30
|
+
<tr>
|
31
|
+
<td width="50%">
|
32
|
+
|
33
|
+
### 🎯 **Intelligent Container Queries**
|
34
|
+
- 📦 Native container query support with automatic fallbacks
|
35
|
+
- 📱 Responsive breakpoints based on element size, not viewport
|
36
|
+
- ⚡ Real-time layout adaptation with performance optimization
|
37
|
+
- 🧠 Memory-efficient observer management
|
38
|
+
|
39
|
+
### 📝 **Advanced Typography System**
|
40
|
+
- 🔤 Fluid typography with clamp-based scaling
|
41
|
+
- 📏 Automatic line height optimization for readability
|
42
|
+
- ♿ WCAG AAA compliance for enhanced accessibility
|
43
|
+
- 🌍 Multi-language support with intelligent spacing
|
44
|
+
|
45
|
+
</td>
|
46
|
+
<td width="50%">
|
47
|
+
|
48
|
+
### ♿ **Comprehensive Accessibility Engine**
|
49
|
+
- ✅ WCAG 2.1 Level A, AA, and AAA compliance
|
50
|
+
- 🔊 Screen reader optimization with live regions
|
51
|
+
- ⌨️ Keyboard navigation enhancement
|
52
|
+
- 🧩 Cognitive accessibility features including content simplification
|
53
|
+
- 🔍 Automated accessibility auditing and reporting
|
54
|
+
|
55
|
+
### 🚀 **Performance Optimizations**
|
56
|
+
- 🚀 Lazy loading with intersection observers
|
57
|
+
- 🧹 Memory management and cleanup
|
58
|
+
- ⏱️ Debounced resize handling
|
59
|
+
- 🎯 Efficient DOM manipulation
|
60
|
+
|
61
|
+
</td>
|
62
|
+
</tr>
|
63
|
+
</table>
|
64
|
+
|
65
|
+
## 🚀 **Quick Start**
|
66
|
+
|
67
|
+
### 📦 **Installation**
|
68
|
+
|
69
|
+
```bash
|
70
|
+
# npm
|
71
|
+
npm install @sc4rfurryx/proteusjs
|
72
|
+
|
73
|
+
# yarn
|
74
|
+
yarn add @sc4rfurryx/proteusjs
|
75
|
+
|
76
|
+
# pnpm
|
77
|
+
pnpm add @sc4rfurryx/proteusjs
|
78
|
+
|
79
|
+
# CDN (for quick testing)
|
80
|
+
<script src="https://unpkg.com/@sc4rfurryx/proteusjs@latest/dist/proteus.min.js"></script>
|
81
|
+
```
|
82
|
+
|
83
|
+
### ⚡ **Basic Usage**
|
84
|
+
|
85
|
+
```typescript
|
86
|
+
import { ProteusJS } from '@sc4rfurryx/proteusjs';
|
87
|
+
|
88
|
+
// Initialize ProteusJS
|
89
|
+
const proteus = new ProteusJS();
|
90
|
+
|
91
|
+
// 🎯 Create responsive container
|
92
|
+
proteus.container('.hero-section', {
|
93
|
+
breakpoints: {
|
94
|
+
sm: '320px',
|
95
|
+
md: '768px',
|
96
|
+
lg: '1024px'
|
97
|
+
}
|
98
|
+
});
|
99
|
+
|
100
|
+
// 📝 Apply fluid typography
|
101
|
+
proteus.fluidType('h1, h2, h3', {
|
102
|
+
minSize: 16,
|
103
|
+
maxSize: 32,
|
104
|
+
accessibility: 'AAA'
|
105
|
+
});
|
106
|
+
|
107
|
+
// ♿ Enable accessibility features
|
108
|
+
proteus.enableAccessibility(document.body, {
|
109
|
+
wcagLevel: 'AA',
|
110
|
+
screenReader: true,
|
111
|
+
cognitiveAccessibility: true
|
112
|
+
});
|
113
|
+
```
|
114
|
+
|
115
|
+
<details>
|
116
|
+
<summary>🎨 <strong>See it in action</strong></summary>
|
117
|
+
|
118
|
+
```html
|
119
|
+
<!DOCTYPE html>
|
120
|
+
<html lang="en">
|
121
|
+
<head>
|
122
|
+
<meta charset="UTF-8">
|
123
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
124
|
+
<title>ProteusJS Demo</title>
|
125
|
+
</head>
|
126
|
+
<body>
|
127
|
+
<div class="container">
|
128
|
+
<h1>Responsive Typography</h1>
|
129
|
+
<p>This content adapts to container size and maintains accessibility.</p>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
<script type="module">
|
133
|
+
import { ProteusJS } from '@sc4rfurryx/proteusjs';
|
134
|
+
|
135
|
+
const proteus = new ProteusJS();
|
136
|
+
proteus.autoOptimize(document.body, {
|
137
|
+
typography: { accessibility: 'AAA' },
|
138
|
+
accessibility: { wcagLevel: 'AA' },
|
139
|
+
container: { breakpoints: { sm: '300px', lg: '800px' } }
|
140
|
+
});
|
141
|
+
</script>
|
142
|
+
</body>
|
143
|
+
</html>
|
144
|
+
```
|
145
|
+
|
146
|
+
</details>
|
147
|
+
|
148
|
+
---
|
149
|
+
|
150
|
+
## 🎯 **Why Choose ProteusJS?**
|
151
|
+
|
152
|
+
<div align="center">
|
153
|
+
|
154
|
+
| 🆚 **Traditional Approach** | ✨ **ProteusJS Approach** |
|
155
|
+
|:---|:---|
|
156
|
+
| 📱 Viewport-based breakpoints | 📦 **Container-based breakpoints** |
|
157
|
+
| 🔧 Manual accessibility implementation | ♿ **Automated WCAG compliance** |
|
158
|
+
| ⚡ Basic performance optimization | 🚀 **Real-time performance monitoring** |
|
159
|
+
| 📝 Static typography | 🔤 **Fluid, accessible typography** |
|
160
|
+
| 🎨 Framework-specific solutions | 🌐 **Framework-agnostic design** |
|
161
|
+
|
162
|
+
</div>
|
163
|
+
|
164
|
+
### 🏆 **Key Differentiators**
|
165
|
+
|
166
|
+
- **🎯 Container-First Design**: Revolutionary approach using element-based breakpoints instead of viewport-based
|
167
|
+
- **♿ Accessibility-First**: Built-in WCAG 2.1 compliance with cognitive accessibility features
|
168
|
+
- **⚡ Performance-Optimized**: Real-time monitoring with sub-60ms response times
|
169
|
+
- **👨💻 Developer-Friendly**: Comprehensive TypeScript support with excellent documentation
|
170
|
+
- **🔧 Framework-Agnostic**: Works with React, Vue, Angular, and vanilla JavaScript
|
171
|
+
|
172
|
+
---
|
173
|
+
|
174
|
+
## 🎨 **Live Examples & Showcases**
|
175
|
+
|
176
|
+
Experience ProteusJS in action with our comprehensive real-world examples:
|
177
|
+
|
178
|
+
### 🛒 **[E-commerce Product Grid](examples/real-world/e-commerce-showcase.html)**
|
179
|
+
- Responsive product grid with container queries
|
180
|
+
- Accessibility-enhanced product cards
|
181
|
+
- Real-time performance metrics
|
182
|
+
- WCAG compliance demonstrations
|
183
|
+
|
184
|
+
### 📝 **[Blog Article Layout](examples/real-world/blog-article-showcase.html)**
|
185
|
+
- Fluid typography with reading time estimation
|
186
|
+
- Cognitive accessibility features
|
187
|
+
- Content simplification toggle
|
188
|
+
- Enhanced keyboard navigation
|
189
|
+
|
190
|
+
### 📊 **[Dashboard Interface](examples/real-world/dashboard-showcase.html)**
|
191
|
+
- Adaptive admin panel layout
|
192
|
+
- Container-based responsive widgets
|
193
|
+
- Accessibility controls panel
|
194
|
+
- Performance monitoring dashboard
|
195
|
+
|
196
|
+
### 🚀 **[Landing Page](examples/real-world/landing-page-showcase.html)**
|
197
|
+
- Hero section with fluid typography
|
198
|
+
- Interactive container query demos
|
199
|
+
- Performance metrics visualization
|
200
|
+
- Responsive component showcases
|
201
|
+
|
202
|
+
### 📊 **[Before/After Comparison](examples/comparisons/before-after-showcase.html)**
|
203
|
+
- Side-by-side traditional vs ProteusJS
|
204
|
+
- Interactive comparison controls
|
205
|
+
- Feature comparison table
|
206
|
+
- Code examples and metrics
|
207
|
+
|
208
|
+
---
|
209
|
+
|
210
|
+
## 📚 **API Documentation**
|
211
|
+
|
212
|
+
<details>
|
213
|
+
<summary>🎯 <strong>Container Queries API</strong></summary>
|
214
|
+
|
215
|
+
### `container(selector, options)`
|
216
|
+
Creates responsive containers with element-based breakpoints.
|
217
|
+
|
218
|
+
```typescript
|
219
|
+
proteus.container('.sidebar', {
|
220
|
+
breakpoints: {
|
221
|
+
sm: '200px',
|
222
|
+
md: '400px',
|
223
|
+
lg: '600px'
|
224
|
+
},
|
225
|
+
containerType: 'inline-size',
|
226
|
+
announceChanges: true, // Screen reader announcements
|
227
|
+
callbacks: {
|
228
|
+
breakpointChange: (breakpoint, active) => {
|
229
|
+
console.log(`Breakpoint ${breakpoint} is now ${active ? 'active' : 'inactive'}`);
|
230
|
+
}
|
231
|
+
}
|
232
|
+
});
|
233
|
+
```
|
234
|
+
|
235
|
+
</details>
|
236
|
+
|
237
|
+
<details>
|
238
|
+
<summary>📝 <strong>Typography API</strong></summary>
|
239
|
+
|
240
|
+
### `fluidType(selector, options)`
|
241
|
+
Applies fluid typography with accessibility compliance.
|
242
|
+
|
243
|
+
```typescript
|
244
|
+
proteus.fluidType('p, li', {
|
245
|
+
minSize: 14,
|
246
|
+
maxSize: 18,
|
247
|
+
minContainer: 320,
|
248
|
+
maxContainer: 1200,
|
249
|
+
accessibility: 'AAA', // Enforces 1.5+ line height
|
250
|
+
unit: 'rem'
|
251
|
+
});
|
252
|
+
```
|
253
|
+
|
254
|
+
</details>
|
255
|
+
|
256
|
+
<details>
|
257
|
+
<summary>♿ <strong>Accessibility API</strong></summary>
|
258
|
+
|
259
|
+
### `enableAccessibility(element, options)`
|
260
|
+
Enables comprehensive accessibility features.
|
261
|
+
|
262
|
+
```typescript
|
263
|
+
proteus.enableAccessibility(document.main, {
|
264
|
+
wcagLevel: 'AAA',
|
265
|
+
screenReader: true,
|
266
|
+
keyboardNavigation: true,
|
267
|
+
cognitiveAccessibility: true,
|
268
|
+
enhanceErrorMessages: true,
|
269
|
+
showReadingTime: true,
|
270
|
+
simplifyContent: true,
|
271
|
+
readingLevel: 'elementary'
|
272
|
+
});
|
273
|
+
```
|
274
|
+
|
275
|
+
</details>
|
276
|
+
|
277
|
+
---
|
278
|
+
|
279
|
+
## 🎨 **Real-World Examples**
|
280
|
+
|
281
|
+
<details>
|
282
|
+
<summary>🛒 <strong>E-commerce Product Grid</strong></summary>
|
283
|
+
|
284
|
+
```typescript
|
285
|
+
// Responsive product grid that adapts to container size
|
286
|
+
proteus.container('.product-grid', {
|
287
|
+
breakpoints: { sm: '300px', md: '600px', lg: '900px' }
|
288
|
+
});
|
289
|
+
|
290
|
+
proteus.createGrid('.product-grid', {
|
291
|
+
minItemWidth: '200px',
|
292
|
+
gap: '1rem'
|
293
|
+
});
|
294
|
+
|
295
|
+
// Accessible product cards
|
296
|
+
proteus.enableAccessibility('.product-card', {
|
297
|
+
wcagLevel: 'AA',
|
298
|
+
autoLabeling: true,
|
299
|
+
enhanceErrorMessages: true
|
300
|
+
});
|
301
|
+
```
|
302
|
+
|
303
|
+
</details>
|
304
|
+
|
305
|
+
<details>
|
306
|
+
<summary>📝 <strong>Blog Article Layout</strong></summary>
|
307
|
+
|
308
|
+
```typescript
|
309
|
+
// Fluid typography for optimal reading
|
310
|
+
proteus.fluidType('article h1', {
|
311
|
+
minSize: 24,
|
312
|
+
maxSize: 48,
|
313
|
+
accessibility: 'AAA'
|
314
|
+
});
|
315
|
+
|
316
|
+
proteus.fluidType('article p', {
|
317
|
+
minSize: 16,
|
318
|
+
maxSize: 18,
|
319
|
+
accessibility: 'AAA'
|
320
|
+
});
|
321
|
+
|
322
|
+
// Cognitive accessibility features
|
323
|
+
proteus.enableAccessibility('article', {
|
324
|
+
showReadingTime: true,
|
325
|
+
simplifyContent: true,
|
326
|
+
readingLevel: 'middle',
|
327
|
+
cognitiveAccessibility: true
|
328
|
+
});
|
329
|
+
```
|
330
|
+
|
331
|
+
</details>
|
332
|
+
|
333
|
+
<details>
|
334
|
+
<summary>📊 <strong>Dashboard Layout</strong></summary>
|
335
|
+
|
336
|
+
```typescript
|
337
|
+
// Responsive dashboard with container queries
|
338
|
+
proteus.container('.dashboard', {
|
339
|
+
breakpoints: {
|
340
|
+
compact: '400px',
|
341
|
+
comfortable: '800px',
|
342
|
+
spacious: '1200px'
|
343
|
+
},
|
344
|
+
announceChanges: true
|
345
|
+
});
|
346
|
+
|
347
|
+
// Accessible data visualization
|
348
|
+
proteus.enableAccessibility('.chart', {
|
349
|
+
wcagLevel: 'AA',
|
350
|
+
screenReader: true,
|
351
|
+
autoLabeling: true
|
352
|
+
});
|
353
|
+
```
|
354
|
+
|
355
|
+
</details>
|
356
|
+
|
357
|
+
---
|
358
|
+
|
359
|
+
## 🌐 **Browser Compatibility**
|
360
|
+
|
361
|
+
<div align="center">
|
362
|
+
|
363
|
+
| Browser | Version | Support Level |
|
364
|
+
|:--------|:--------|:-------------|
|
365
|
+
| 🟢 **Chrome** | 88+ | ✅ Full Support |
|
366
|
+
| 🟢 **Firefox** | 85+ | ✅ Full Support |
|
367
|
+
| 🟢 **Safari** | 14+ | ✅ Full Support |
|
368
|
+
| 🟢 **Edge** | 88+ | ✅ Full Support |
|
369
|
+
| 📱 **iOS Safari** | 14+ | ✅ Full Support |
|
370
|
+
| 📱 **Android Chrome** | 88+ | ✅ Full Support |
|
371
|
+
|
372
|
+
</div>
|
373
|
+
|
374
|
+
### 🔧 **Polyfills Included**
|
375
|
+
- ✅ Container Query polyfill for older browsers
|
376
|
+
- ✅ ResizeObserver polyfill
|
377
|
+
- ✅ IntersectionObserver polyfill
|
378
|
+
- ✅ Graceful degradation strategies
|
379
|
+
|
380
|
+
---
|
381
|
+
|
382
|
+
## 🔧 **Framework Integration**
|
383
|
+
|
384
|
+
<details>
|
385
|
+
<summary>⚛️ <strong>React Integration</strong></summary>
|
386
|
+
|
387
|
+
```tsx
|
388
|
+
import { useEffect, useRef } from 'react';
|
389
|
+
import { ProteusJS } from '@sc4rfurryx/proteusjs';
|
390
|
+
|
391
|
+
function ResponsiveComponent() {
|
392
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
393
|
+
|
394
|
+
useEffect(() => {
|
395
|
+
if (containerRef.current) {
|
396
|
+
const proteus = new ProteusJS();
|
397
|
+
proteus.container(containerRef.current, {
|
398
|
+
breakpoints: { sm: '300px', lg: '600px' }
|
399
|
+
});
|
400
|
+
|
401
|
+
return () => proteus.destroy();
|
402
|
+
}
|
403
|
+
}, []);
|
404
|
+
|
405
|
+
return <div ref={containerRef}>Responsive content</div>;
|
406
|
+
}
|
407
|
+
```
|
408
|
+
|
409
|
+
</details>
|
410
|
+
|
411
|
+
<details>
|
412
|
+
<summary>💚 <strong>Vue 3 Integration</strong></summary>
|
413
|
+
|
414
|
+
```vue
|
415
|
+
<template>
|
416
|
+
<div ref="container">Responsive content</div>
|
417
|
+
</template>
|
418
|
+
|
419
|
+
<script setup>
|
420
|
+
import { ref, onMounted, onUnmounted } from 'vue';
|
421
|
+
import { ProteusJS } from '@sc4rfurryx/proteusjs';
|
422
|
+
|
423
|
+
const container = ref();
|
424
|
+
let proteus;
|
425
|
+
|
426
|
+
onMounted(() => {
|
427
|
+
proteus = new ProteusJS();
|
428
|
+
proteus.container(container.value, {
|
429
|
+
breakpoints: { sm: '300px', lg: '600px' }
|
430
|
+
});
|
431
|
+
});
|
432
|
+
|
433
|
+
onUnmounted(() => {
|
434
|
+
proteus?.destroy();
|
435
|
+
});
|
436
|
+
</script>
|
437
|
+
```
|
438
|
+
|
439
|
+
</details>
|
440
|
+
|
441
|
+
<details>
|
442
|
+
<summary>🅰️ <strong>Angular Integration</strong></summary>
|
443
|
+
|
444
|
+
```typescript
|
445
|
+
import { Component, ElementRef, OnInit, OnDestroy } from '@angular/core';
|
446
|
+
import { ProteusJS } from '@sc4rfurryx/proteusjs';
|
447
|
+
|
448
|
+
@Component({
|
449
|
+
selector: 'app-responsive',
|
450
|
+
template: '<div>Responsive content</div>'
|
451
|
+
})
|
452
|
+
export class ResponsiveComponent implements OnInit, OnDestroy {
|
453
|
+
private proteus: ProteusJS;
|
454
|
+
|
455
|
+
constructor(private elementRef: ElementRef) {}
|
456
|
+
|
457
|
+
ngOnInit() {
|
458
|
+
this.proteus = new ProteusJS();
|
459
|
+
this.proteus.container(this.elementRef.nativeElement, {
|
460
|
+
breakpoints: { sm: '300px', lg: '600px' }
|
461
|
+
});
|
462
|
+
}
|
463
|
+
|
464
|
+
ngOnDestroy() {
|
465
|
+
this.proteus.destroy();
|
466
|
+
}
|
467
|
+
}
|
468
|
+
```
|
469
|
+
|
470
|
+
</details>
|
471
|
+
|
472
|
+
---
|
473
|
+
|
474
|
+
## 🧪 **Testing & Quality**
|
475
|
+
|
476
|
+
<div align="center">
|
477
|
+
|
478
|
+

|
479
|
+

|
480
|
+

|
481
|
+
|
482
|
+
</div>
|
483
|
+
|
484
|
+
```bash
|
485
|
+
# 🧪 Run all tests
|
486
|
+
npm test
|
487
|
+
|
488
|
+
# ♿ Run accessibility validation tests
|
489
|
+
npm run accessibility
|
490
|
+
|
491
|
+
# ⚡ Run performance benchmarks
|
492
|
+
npm run benchmark
|
493
|
+
|
494
|
+
# 📊 Generate coverage report
|
495
|
+
npm run test:coverage
|
496
|
+
```
|
497
|
+
|
498
|
+
---
|
499
|
+
|
500
|
+
## 🤝 **Contributing**
|
501
|
+
|
502
|
+
We welcome contributions from the community! 🎉
|
503
|
+
|
504
|
+
<div align="center">
|
505
|
+
|
506
|
+
[](https://github.com/sc4rfurry/ProteusJS/graphs/contributors)
|
507
|
+
[](https://github.com/sc4rfurry/ProteusJS/issues)
|
508
|
+
[](https://github.com/sc4rfurry/ProteusJS/pulls)
|
509
|
+
|
510
|
+
</div>
|
511
|
+
|
512
|
+
### 🚀 **Quick Start for Contributors**
|
513
|
+
|
514
|
+
```bash
|
515
|
+
# 1️⃣ Fork and clone the repository
|
516
|
+
git clone https://github.com/sc4rfurry/ProteusJS.git
|
517
|
+
cd ProteusJS
|
518
|
+
|
519
|
+
# 2️⃣ Install dependencies
|
520
|
+
npm install
|
521
|
+
|
522
|
+
# 3️⃣ Start development
|
523
|
+
npm run dev
|
524
|
+
|
525
|
+
# 4️⃣ Run tests
|
526
|
+
npm test
|
527
|
+
|
528
|
+
# 5️⃣ Build for production
|
529
|
+
npm run build:prod
|
530
|
+
```
|
531
|
+
|
532
|
+
### 📋 **Code Standards**
|
533
|
+
- ✅ TypeScript strict mode
|
534
|
+
- ✅ ESLint + Prettier formatting
|
535
|
+
- ✅ WCAG 2.1 compliance required
|
536
|
+
- ✅ 90%+ test coverage target
|
537
|
+
- ✅ Semantic commit messages
|
538
|
+
|
539
|
+
### 🐛 **Found a Bug?**
|
540
|
+
[Open an issue](https://github.com/sc4rfurry/ProteusJS/issues/new) with a detailed description and reproduction steps.
|
541
|
+
|
542
|
+
### 💡 **Have an Idea?**
|
543
|
+
[Start a discussion](https://github.com/sc4rfurry/ProteusJS/discussions) to share your ideas with the community.
|
544
|
+
|
545
|
+
---
|
546
|
+
|
547
|
+
## 📄 **License**
|
548
|
+
|
549
|
+
<div align="center">
|
550
|
+
|
551
|
+
[](https://opensource.org/licenses/MIT)
|
552
|
+
|
553
|
+
**ProteusJS** is open source software licensed under the [MIT License](LICENSE).
|
554
|
+
|
555
|
+
</div>
|
556
|
+
|
557
|
+
---
|
558
|
+
|
559
|
+
## 🙏 **Acknowledgments**
|
560
|
+
|
561
|
+
Special thanks to:
|
562
|
+
|
563
|
+
- 🌐 **Web Content Accessibility Guidelines (WCAG) 2.1** - For accessibility standards
|
564
|
+
- 📦 **CSS Container Queries Working Group** - For container query specifications
|
565
|
+
- 🎨 **Modern Web Standards Community** - For best practices and innovations
|
566
|
+
- 👥 **All Contributors** - For making ProteusJS better every day
|
567
|
+
|
568
|
+
---
|
569
|
+
|
570
|
+
<div align="center">
|
571
|
+
|
572
|
+
## 🌟 **Star History**
|
573
|
+
|
574
|
+
[](https://star-history.com/#sc4rfurry/ProteusJS&Date)
|
575
|
+
|
576
|
+
---
|
577
|
+
|
578
|
+
### **Made with ❤️ by [sc4rfurry](https://github.com/sc4rfurry)**
|
579
|
+
|
580
|
+
**ProteusJS** - *Shape-shifting responsive design for the modern web* 🌊
|
581
|
+
|
582
|
+
[⭐ Star this repo](https://github.com/sc4rfurry/ProteusJS/stargazers) • [🐛 Report Bug](https://github.com/sc4rfurry/ProteusJS/issues) • [💡 Request Feature](https://github.com/sc4rfurry/ProteusJS/issues) • [📖 Documentation](https://github.com/sc4rfurry/ProteusJS#readme)
|
583
|
+
|
584
|
+
</div>
|
585
|
+
- **Visual Regression Tests**: UI consistency validation
|
586
|
+
|
587
|
+
## 🚀 Production Deployment
|
588
|
+
|
589
|
+
### Quality Gates
|
590
|
+
Before deploying to production, ensure all quality gates pass:
|
591
|
+
|
592
|
+
```bash
|
593
|
+
npm run validate:production
|
594
|
+
```
|
595
|
+
|
596
|
+
Required quality gates:
|
597
|
+
- ✅ Test coverage ≥ 80%
|
598
|
+
- ✅ Performance benchmarks passed
|
599
|
+
- ✅ WCAG AA compliance ≥ 90%
|
600
|
+
- ✅ No critical security vulnerabilities
|
601
|
+
- ✅ Bundle size optimized
|
602
|
+
- ✅ Browser compatibility verified
|
603
|
+
|
604
|
+
### Performance Monitoring
|
605
|
+
```javascript
|
606
|
+
// Production monitoring setup
|
607
|
+
proteus.performance.addCallback('production', (metrics) => {
|
608
|
+
// Send to monitoring service
|
609
|
+
analytics.track('performance', {
|
610
|
+
fps: metrics.averageFPS,
|
611
|
+
memory: metrics.memoryUsage.percentage,
|
612
|
+
operations: metrics.operationsPerSecond
|
613
|
+
});
|
614
|
+
});
|
615
|
+
```
|
616
|
+
|
617
|
+
## 🤝 Contributing
|
618
|
+
|
619
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
620
|
+
|
621
|
+
### Development Setup
|
622
|
+
```bash
|
623
|
+
git clone https://github.com/proteusjs/proteus.git
|
624
|
+
cd proteus
|
625
|
+
npm install
|
626
|
+
npm run dev
|
627
|
+
```
|
628
|
+
|
629
|
+
### Running Tests
|
630
|
+
```bash
|
631
|
+
npm run test:watch
|
632
|
+
npm run test:coverage
|
633
|
+
npm run validate:all
|
634
|
+
```
|
635
|
+
|
636
|
+
## 📄 License
|
637
|
+
|
638
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
639
|
+
|
640
|
+
## 🙏 Acknowledgments
|
641
|
+
|
642
|
+
- Inspired by the CSS Container Queries specification
|
643
|
+
- Built with modern web standards and accessibility in mind
|
644
|
+
- Named after Proteus, the shape-shifting sea god of Greek mythology
|
645
|
+
- Special thanks to the web standards community and accessibility advocates
|