@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
@@ -0,0 +1,106 @@
|
|
1
|
+
/**
|
2
|
+
* Browser support detection utilities
|
3
|
+
*/
|
4
|
+
|
5
|
+
export interface SupportInfo {
|
6
|
+
resizeObserver: boolean;
|
7
|
+
intersectionObserver: boolean;
|
8
|
+
containerQueries: boolean;
|
9
|
+
cssClamp: boolean;
|
10
|
+
cssCustomProperties: boolean;
|
11
|
+
webWorkers: boolean;
|
12
|
+
requestAnimationFrame: boolean;
|
13
|
+
passiveEventListeners: boolean;
|
14
|
+
}
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Check if the current environment supports ProteusJS features
|
18
|
+
*/
|
19
|
+
export function isSupported(): boolean {
|
20
|
+
const support = getSupportInfo();
|
21
|
+
return support.resizeObserver && support.intersectionObserver;
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Get detailed support information for all features
|
26
|
+
*/
|
27
|
+
export function getSupportInfo(): SupportInfo {
|
28
|
+
return {
|
29
|
+
resizeObserver: typeof ResizeObserver !== 'undefined',
|
30
|
+
intersectionObserver: typeof IntersectionObserver !== 'undefined',
|
31
|
+
containerQueries: checkContainerQuerySupport(),
|
32
|
+
cssClamp: checkCSSClampSupport(),
|
33
|
+
cssCustomProperties: checkCSSCustomPropertiesSupport(),
|
34
|
+
webWorkers: typeof Worker !== 'undefined',
|
35
|
+
requestAnimationFrame: typeof requestAnimationFrame !== 'undefined',
|
36
|
+
passiveEventListeners: checkPassiveEventListenerSupport()
|
37
|
+
};
|
38
|
+
}
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Check if CSS Container Queries are supported
|
42
|
+
*/
|
43
|
+
function checkContainerQuerySupport(): boolean {
|
44
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
45
|
+
return CSS.supports('container-type', 'inline-size');
|
46
|
+
}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Check if CSS clamp() function is supported
|
50
|
+
*/
|
51
|
+
function checkCSSClampSupport(): boolean {
|
52
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
53
|
+
return CSS.supports('font-size', 'clamp(1rem, 2vw, 2rem)');
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Check if CSS Custom Properties are supported
|
58
|
+
*/
|
59
|
+
function checkCSSCustomPropertiesSupport(): boolean {
|
60
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
61
|
+
return CSS.supports('--test', 'value');
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Check if passive event listeners are supported
|
66
|
+
*/
|
67
|
+
function checkPassiveEventListenerSupport(): boolean {
|
68
|
+
let passiveSupported = false;
|
69
|
+
|
70
|
+
try {
|
71
|
+
const options = {
|
72
|
+
get passive() {
|
73
|
+
passiveSupported = true;
|
74
|
+
return false;
|
75
|
+
}
|
76
|
+
};
|
77
|
+
|
78
|
+
window.addEventListener('test' as any, null as any, options as any);
|
79
|
+
window.removeEventListener('test' as any, null as any, options as any);
|
80
|
+
} catch (err) {
|
81
|
+
passiveSupported = false;
|
82
|
+
}
|
83
|
+
|
84
|
+
return passiveSupported;
|
85
|
+
}
|
86
|
+
|
87
|
+
/**
|
88
|
+
* Get a user-friendly support message
|
89
|
+
*/
|
90
|
+
export function getSupportMessage(): string {
|
91
|
+
const support = getSupportInfo();
|
92
|
+
|
93
|
+
if (!support.resizeObserver) {
|
94
|
+
return 'ResizeObserver is not supported. Please use a polyfill.';
|
95
|
+
}
|
96
|
+
|
97
|
+
if (!support.intersectionObserver) {
|
98
|
+
return 'IntersectionObserver is not supported. Please use a polyfill.';
|
99
|
+
}
|
100
|
+
|
101
|
+
if (!support.containerQueries) {
|
102
|
+
return 'CSS Container Queries are not supported. ProteusJS will provide a polyfill.';
|
103
|
+
}
|
104
|
+
|
105
|
+
return 'All features are supported!';
|
106
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**
|
2
|
+
* Version utilities for ProteusJS
|
3
|
+
*/
|
4
|
+
|
5
|
+
export const version = '1.0.0';
|
6
|
+
|
7
|
+
export function getVersion(): string {
|
8
|
+
return version;
|
9
|
+
}
|
10
|
+
|
11
|
+
export function isVersionSupported(requiredVersion: string): boolean {
|
12
|
+
const current = version.split('.').map(Number);
|
13
|
+
const required = requiredVersion.split('.').map(Number);
|
14
|
+
|
15
|
+
for (let i = 0; i < Math.max(current.length, required.length); i++) {
|
16
|
+
const currentPart = current[i] || 0;
|
17
|
+
const requiredPart = required[i] || 0;
|
18
|
+
|
19
|
+
if (currentPart > requiredPart) return true;
|
20
|
+
if (currentPart < requiredPart) return false;
|
21
|
+
}
|
22
|
+
|
23
|
+
return true;
|
24
|
+
}
|