canvasframework 0.5.18 → 0.5.20
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/README.md +30 -0
- package/components/Accordion.js +265 -0
- package/components/AndroidDatePickerDialog.js +406 -0
- package/components/AppBar.js +398 -0
- package/components/AudioPlayer.js +611 -0
- package/components/Avatar.js +202 -0
- package/components/Banner.js +342 -0
- package/components/BottomNavigationBar.js +433 -0
- package/components/BottomSheet.js +234 -0
- package/components/Button.js +358 -0
- package/components/Camera.js +644 -0
- package/components/Card.js +193 -0
- package/components/Chart.js +700 -0
- package/components/Checkbox.js +166 -0
- package/components/Chip.js +212 -0
- package/components/CircularProgress.js +327 -0
- package/components/ContextMenu.js +116 -0
- package/components/DatePicker.js +298 -0
- package/components/Dialog.js +337 -0
- package/components/Divider.js +125 -0
- package/components/Drawer.js +276 -0
- package/components/FAB.js +270 -0
- package/components/FileUpload.js +315 -0
- package/components/FloatedCamera.js +644 -0
- package/components/IOSDatePickerWheel.js +430 -0
- package/components/ImageCarousel.js +219 -0
- package/components/ImageComponent.js +223 -0
- package/components/Input.js +831 -0
- package/components/InputDatalist.js +723 -0
- package/components/InputTags.js +624 -0
- package/components/List.js +95 -0
- package/components/ListItem.js +269 -0
- package/components/Modal.js +364 -0
- package/components/MorphingFAB.js +428 -0
- package/components/MultiSelectDialog.js +206 -0
- package/components/NumberInput.js +271 -0
- package/components/PasswordInput.js +462 -0
- package/components/ProgressBar.js +88 -0
- package/components/QRCodeReader.js +539 -0
- package/components/RadioButton.js +151 -0
- package/components/SearchInput.js +315 -0
- package/components/SegmentedControl.js +357 -0
- package/components/Select.js +199 -0
- package/components/SelectDialog.js +255 -0
- package/components/Slider.js +113 -0
- package/components/SliverAppBar.js +139 -0
- package/components/Snackbar.js +243 -0
- package/components/SpeedDialFAB.js +397 -0
- package/components/Stepper.js +281 -0
- package/components/SwipeableListItem.js +327 -0
- package/components/Switch.js +147 -0
- package/components/Table.js +492 -0
- package/components/Tabs.js +423 -0
- package/components/Text.js +141 -0
- package/components/TextField.js +151 -0
- package/components/TimePicker.js +934 -0
- package/components/Toast.js +236 -0
- package/components/TreeView.js +420 -0
- package/components/Video.js +397 -0
- package/components/View.js +140 -0
- package/components/VirtualList.js +120 -0
- package/core/CanvasFramework.js +3045 -0
- package/core/Component.js +243 -0
- package/core/ThemeManager.js +358 -0
- package/core/UIBuilder.js +267 -0
- package/core/WebGLCanvasAdapter.js +782 -0
- package/features/Column.js +43 -0
- package/features/Grid.js +47 -0
- package/features/LayoutComponent.js +43 -0
- package/features/OpenStreetMap.js +310 -0
- package/features/Positioned.js +33 -0
- package/features/PullToRefresh.js +328 -0
- package/features/Row.js +40 -0
- package/features/SignaturePad.js +257 -0
- package/features/Skeleton.js +193 -0
- package/features/Stack.js +21 -0
- package/index.js +119 -0
- package/manager/AccessibilityManager.js +107 -0
- package/manager/ErrorHandler.js +59 -0
- package/manager/FeatureFlags.js +60 -0
- package/manager/MemoryManager.js +107 -0
- package/manager/PerformanceMonitor.js +84 -0
- package/manager/SecurityManager.js +54 -0
- package/package.json +22 -16
- package/utils/AnimationEngine.js +734 -0
- package/utils/CryptoManager.js +303 -0
- package/utils/DataStore.js +403 -0
- package/utils/DevTools.js +1618 -0
- package/utils/DevToolsConsole.js +201 -0
- package/utils/EventBus.js +407 -0
- package/utils/FetchClient.js +74 -0
- package/utils/FirebaseAuth.js +653 -0
- package/utils/FirebaseCore.js +246 -0
- package/utils/FirebaseFirestore.js +581 -0
- package/utils/FirebaseFunctions.js +97 -0
- package/utils/FirebaseRealtimeDB.js +498 -0
- package/utils/FirebaseStorage.js +612 -0
- package/utils/FormValidator.js +355 -0
- package/utils/GeoLocationService.js +62 -0
- package/utils/I18n.js +207 -0
- package/utils/IndexedDBManager.js +273 -0
- package/utils/InspectionOverlay.js +308 -0
- package/utils/NotificationManager.js +60 -0
- package/utils/OfflineSyncManager.js +342 -0
- package/utils/PayPalPayment.js +678 -0
- package/utils/QueryBuilder.js +478 -0
- package/utils/SafeArea.js +64 -0
- package/utils/SecureStorage.js +289 -0
- package/utils/StateManager.js +207 -0
- package/utils/StripePayment.js +552 -0
- package/utils/WebSocketClient.js +66 -0
- package/dist/canvasframework.js +0 -2
- package/dist/canvasframework.js.LICENSE.txt +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// ==========================================
|
|
2
|
+
// 2. PERFORMANCE MONITORING
|
|
3
|
+
// ==========================================
|
|
4
|
+
|
|
5
|
+
class PerformanceMonitor {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.metrics = {
|
|
8
|
+
fps: 60,
|
|
9
|
+
frameTime: 0,
|
|
10
|
+
memoryUsage: 0,
|
|
11
|
+
renderTime: 0,
|
|
12
|
+
componentCount: 0
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
this.fpsHistory = [];
|
|
16
|
+
this.frameCount = 0;
|
|
17
|
+
this.lastTime = performance.now();
|
|
18
|
+
this.isMonitoring = false;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
startMonitoring() {
|
|
22
|
+
this.isMonitoring = true;
|
|
23
|
+
this.updateMetrics();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
stopMonitoring() {
|
|
27
|
+
this.isMonitoring = false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
updateMetrics() {
|
|
31
|
+
if (!this.isMonitoring) return;
|
|
32
|
+
|
|
33
|
+
const now = performance.now();
|
|
34
|
+
const deltaTime = now - this.lastTime;
|
|
35
|
+
|
|
36
|
+
// Calculer FPS
|
|
37
|
+
this.frameCount++;
|
|
38
|
+
if (deltaTime >= 1000) {
|
|
39
|
+
this.metrics.fps = Math.round((this.frameCount * 1000) / deltaTime);
|
|
40
|
+
this.fpsHistory.push(this.metrics.fps);
|
|
41
|
+
|
|
42
|
+
// Garder seulement les 60 dernières secondes
|
|
43
|
+
if (this.fpsHistory.length > 60) {
|
|
44
|
+
this.fpsHistory.shift();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
this.frameCount = 0;
|
|
48
|
+
this.lastTime = now;
|
|
49
|
+
|
|
50
|
+
// Alerter si FPS < 30
|
|
51
|
+
if (this.metrics.fps < 30) {
|
|
52
|
+
console.warn('⚠️ Low FPS detected:', this.metrics.fps);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Mémoire (si disponible)
|
|
57
|
+
if (performance.memory) {
|
|
58
|
+
this.metrics.memoryUsage = Math.round(
|
|
59
|
+
performance.memory.usedJSHeapSize / 1048576
|
|
60
|
+
); // MB
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
requestAnimationFrame(() => this.updateMetrics());
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
measureRender(fn) {
|
|
67
|
+
const start = performance.now();
|
|
68
|
+
fn();
|
|
69
|
+
const end = performance.now();
|
|
70
|
+
this.metrics.renderTime = end - start;
|
|
71
|
+
return this.metrics.renderTime;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
getReport() {
|
|
75
|
+
return {
|
|
76
|
+
current: this.metrics,
|
|
77
|
+
averageFPS: this.fpsHistory.reduce((a, b) => a + b, 0) / this.fpsHistory.length,
|
|
78
|
+
minFPS: Math.min(...this.fpsHistory),
|
|
79
|
+
maxFPS: Math.max(...this.fpsHistory)
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default PerformanceMonitor;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// ==========================================
|
|
2
|
+
// 5. SECURITY
|
|
3
|
+
// ==========================================
|
|
4
|
+
|
|
5
|
+
class SecurityManager {
|
|
6
|
+
static sanitizeInput(input) {
|
|
7
|
+
if (typeof input !== 'string') return input;
|
|
8
|
+
|
|
9
|
+
// Échapper les caractères HTML dangereux
|
|
10
|
+
return input
|
|
11
|
+
.replace(/&/g, '&')
|
|
12
|
+
.replace(/</g, '<')
|
|
13
|
+
.replace(/>/g, '>')
|
|
14
|
+
.replace(/"/g, '"')
|
|
15
|
+
.replace(/'/g, ''')
|
|
16
|
+
.replace(/\//g, '/');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static validateUrl(url) {
|
|
20
|
+
try {
|
|
21
|
+
const parsed = new URL(url);
|
|
22
|
+
// Autoriser seulement http(s)
|
|
23
|
+
if (!['http:', 'https:'].includes(parsed.protocol)) {
|
|
24
|
+
throw new Error('Invalid protocol');
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
} catch {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static rateLimit(fn, limit = 100, window = 1000) {
|
|
33
|
+
const calls = [];
|
|
34
|
+
|
|
35
|
+
return function(...args) {
|
|
36
|
+
const now = Date.now();
|
|
37
|
+
|
|
38
|
+
// Nettoyer les appels trop anciens
|
|
39
|
+
while (calls.length && calls[0] < now - window) {
|
|
40
|
+
calls.shift();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (calls.length >= limit) {
|
|
44
|
+
console.warn('⚠️ Rate limit exceeded');
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
calls.push(now);
|
|
49
|
+
return fn.apply(this, args);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default SecurityManager;
|
package/package.json
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canvasframework",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "Canvas-based cross-platform UI framework (Material & Cupertino)",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/canvasframework.js",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "webpack --config webpack.config.js"
|
|
12
|
-
},
|
|
3
|
+
"version": "0.5.20",
|
|
13
4
|
"repository": {
|
|
14
5
|
"type": "git",
|
|
15
6
|
"url": "https://github.com/beyons/CanvasFramework.git"
|
|
16
7
|
},
|
|
8
|
+
"description": "Canvas-based cross-platform UI framework (Material & Cupertino)",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./index.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./index.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"index.js",
|
|
16
|
+
"components",
|
|
17
|
+
"core",
|
|
18
|
+
"features",
|
|
19
|
+
"manager",
|
|
20
|
+
"layout",
|
|
21
|
+
"utils"
|
|
22
|
+
],
|
|
17
23
|
"keywords": [
|
|
18
24
|
"canvas",
|
|
19
25
|
"ui",
|
|
@@ -23,11 +29,11 @@
|
|
|
23
29
|
"mobile"
|
|
24
30
|
],
|
|
25
31
|
"license": "MIT",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"babel-loader": "^
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@babel/core": "^7.29.0",
|
|
34
|
+
"@babel/preset-env": "^7.29.0",
|
|
35
|
+
"babel-loader": "^10.0.0",
|
|
36
|
+
"webpack": "^5.105.0",
|
|
37
|
+
"webpack-cli": "^6.0.1"
|
|
32
38
|
}
|
|
33
39
|
}
|