@mks2508/better-logger 0.0.2-alpha.2 → 0.3.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/.claude/settings.local.json +18 -2
- package/.github/workflows/ci-quality.yml +357 -0
- package/.github/workflows/docs-demo.yml +119 -0
- package/.github/workflows/releases-core.yml +512 -0
- package/.github/workflows/releases-full.yml +582 -0
- package/.github/{workflows → workflows-backup}/ci.yml +12 -110
- package/.github/workflows-backup/nightly.yml +196 -0
- package/.github/workflows-backup/release-optimized.yml +373 -0
- package/.release-notes-0.2.0.md +129 -0
- package/.yamllint +28 -0
- package/CHANGELOG.json +783 -0
- package/CLAUDE.md +92 -1
- package/README.md +198 -490
- package/bun.lock +323 -0
- package/demo.html +9 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/Logger.d.ts +272 -0
- package/dist/Logger.d.ts.map +1 -0
- package/dist/Logger.js +680 -0
- package/dist/ScopedLogger.d.ts +126 -0
- package/dist/ScopedLogger.d.ts.map +1 -0
- package/dist/ScopedLogger.js +234 -0
- package/dist/chunks/Logger-BpeuYIxR.js +2 -0
- package/dist/chunks/Logger-BpeuYIxR.js.map +1 -0
- package/dist/chunks/Logger-Didxtr23.js +3275 -0
- package/dist/chunks/Logger-Didxtr23.js.map +1 -0
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
- package/dist/chunks/environment-Bxbnw4pd.js +544 -0
- package/dist/chunks/environment-Bxbnw4pd.js.map +1 -0
- package/dist/chunks/environment-Dm66zOML.js +4 -0
- package/dist/chunks/environment-Dm66zOML.js.map +1 -0
- package/dist/chunks/formatting-C0riPC5_.js +95 -0
- package/dist/chunks/formatting-C0riPC5_.js.map +1 -0
- package/dist/chunks/formatting-DNCAV66-.js +2 -0
- package/dist/chunks/formatting-DNCAV66-.js.map +1 -0
- package/dist/cli/CommandProcessor.d.ts +103 -0
- package/dist/cli/CommandProcessor.d.ts.map +1 -0
- package/dist/cli/CommandProcessor.js +184 -0
- package/dist/cli/commands/ConfigCommand.d.ts +17 -0
- package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
- package/dist/cli/commands/ConfigCommand.js +88 -0
- package/dist/cli/commands/ExportCommand.d.ts +51 -0
- package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
- package/dist/cli/commands/ExportCommand.js +243 -0
- package/dist/cli/commands/HistoryCommand.d.ts +50 -0
- package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
- package/dist/cli/commands/HistoryCommand.js +96 -0
- package/dist/cli/commands/StatusCommand.d.ts +33 -0
- package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
- package/dist/cli/commands/StatusCommand.js +93 -0
- package/dist/cli/commands/ThemeCommand.d.ts +33 -0
- package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
- package/dist/cli/commands/ThemeCommand.js +79 -0
- package/dist/cli/help.d.ts +15 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +118 -0
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +46 -0
- package/dist/constants.d.ts +122 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +159 -0
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +134 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +315 -242
- package/dist/core.js.map +1 -1
- package/dist/example.d.ts +18 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +154 -0
- package/dist/exports-module.d.ts +203 -0
- package/dist/exports-module.d.ts.map +1 -0
- package/dist/exports-module.js +260 -0
- package/dist/exports.cjs +1 -1
- package/dist/exports.cjs.map +1 -1
- package/dist/exports.js +5 -4
- package/dist/exports.js.map +1 -1
- package/dist/handlers/AnalyticsLogHandler.d.ts +11 -0
- package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
- package/dist/handlers/AnalyticsLogHandler.js +19 -0
- package/dist/handlers/ExportLogHandler.d.ts +103 -0
- package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
- package/dist/handlers/ExportLogHandler.js +516 -0
- package/dist/handlers/FileLogHandler.d.ts +36 -0
- package/dist/handlers/FileLogHandler.d.ts.map +1 -0
- package/dist/handlers/FileLogHandler.js +156 -0
- package/dist/handlers/RemoteLogHandler.d.ts +14 -0
- package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
- package/dist/handlers/RemoteLogHandler.js +37 -0
- package/dist/handlers/index.d.ts +8 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +7 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +86 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +89 -103
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +139 -0
- package/dist/styling/LogStyleBuilder.d.ts +149 -0
- package/dist/styling/LogStyleBuilder.d.ts.map +1 -0
- package/dist/styling/LogStyleBuilder.js +289 -0
- package/dist/styling/SemanticStyles.d.ts +181 -0
- package/dist/styling/SemanticStyles.d.ts.map +1 -0
- package/dist/styling/SemanticStyles.js +339 -0
- package/dist/styling/SmartPresets.d.ts +25 -0
- package/dist/styling/SmartPresets.d.ts.map +1 -0
- package/dist/styling/SmartPresets.js +276 -0
- package/dist/styling/StyleBuilder.d.ts +140 -0
- package/dist/styling/StyleBuilder.d.ts.map +1 -0
- package/dist/styling/StyleBuilder.js +280 -0
- package/dist/styling/banners.d.ts +45 -0
- package/dist/styling/banners.d.ts.map +1 -0
- package/dist/styling/banners.js +155 -0
- package/dist/styling/index.d.ts +10 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +9 -0
- package/dist/styling/themes.d.ts +10 -0
- package/dist/styling/themes.d.ts.map +1 -0
- package/dist/styling/themes.js +231 -0
- package/dist/styling-module.d.ts +185 -0
- package/dist/styling-module.d.ts.map +1 -0
- package/dist/styling-module.js +199 -0
- package/dist/styling.cjs +1 -1
- package/dist/styling.cjs.map +1 -1
- package/dist/styling.js +6 -6
- package/dist/styling.js.map +1 -1
- package/dist/types/Logger.d.ts +268 -0
- package/dist/types/Logger.d.ts.map +1 -0
- package/dist/types/ScopedLogger.d.ts +123 -0
- package/dist/types/ScopedLogger.d.ts.map +1 -0
- package/dist/types/cli/CommandProcessor.d.ts +100 -0
- package/dist/types/cli/CommandProcessor.d.ts.map +1 -0
- package/dist/types/cli/commands/ConfigCommand.d.ts +14 -0
- package/dist/types/cli/commands/ConfigCommand.d.ts.map +1 -0
- package/dist/types/cli/commands/ExportCommand.d.ts +48 -0
- package/dist/types/cli/commands/ExportCommand.d.ts.map +1 -0
- package/dist/types/cli/commands/HistoryCommand.d.ts +47 -0
- package/dist/types/cli/commands/HistoryCommand.d.ts.map +1 -0
- package/dist/types/cli/commands/StatusCommand.d.ts +30 -0
- package/dist/types/cli/commands/StatusCommand.d.ts.map +1 -0
- package/dist/types/cli/commands/ThemeCommand.d.ts +30 -0
- package/dist/types/cli/commands/ThemeCommand.d.ts.map +1 -0
- package/dist/types/cli/help.d.ts +12 -0
- package/dist/types/cli/help.d.ts.map +1 -0
- package/dist/types/cli/index.d.ts +15 -0
- package/dist/types/cli/index.d.ts.map +1 -0
- package/dist/types/constants.d.ts +119 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/core.d.ts +125 -211
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +13 -0
- package/dist/types/example.d.ts +18 -0
- package/dist/types/example.d.ts.map +1 -0
- package/dist/types/exports-module.d.ts +196 -0
- package/dist/types/exports-module.d.ts.map +1 -0
- package/dist/types/handlers/AnalyticsLogHandler.d.ts +8 -0
- package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +1 -0
- package/dist/types/handlers/ExportLogHandler.d.ts +100 -0
- package/dist/types/handlers/ExportLogHandler.d.ts.map +1 -0
- package/dist/types/handlers/FileLogHandler.d.ts +33 -0
- package/dist/types/handlers/FileLogHandler.d.ts.map +1 -0
- package/dist/types/handlers/RemoteLogHandler.d.ts +11 -0
- package/dist/types/handlers/RemoteLogHandler.d.ts.map +1 -0
- package/dist/types/handlers/index.d.ts +8 -0
- package/dist/types/handlers/index.d.ts.map +1 -0
- package/dist/types/handlers.d.ts +88 -0
- package/dist/types/handlers.d.ts.map +1 -0
- package/dist/types/handlers.js +4 -0
- package/dist/types/index.d.ts +7 -675
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/main.d.ts +2 -0
- package/dist/types/main.d.ts.map +1 -0
- package/dist/types/styling/LogStyleBuilder.d.ts +146 -0
- package/dist/types/styling/LogStyleBuilder.d.ts.map +1 -0
- package/dist/types/styling/SemanticStyles.d.ts +178 -0
- package/dist/types/styling/SemanticStyles.d.ts.map +1 -0
- package/dist/types/styling/SmartPresets.d.ts +22 -0
- package/dist/types/styling/SmartPresets.d.ts.map +1 -0
- package/dist/types/styling/StyleBuilder.d.ts +140 -0
- package/dist/types/styling/StyleBuilder.d.ts.map +1 -0
- package/dist/types/styling/banners.d.ts +42 -0
- package/dist/types/styling/banners.d.ts.map +1 -0
- package/dist/types/styling/index.d.ts +10 -0
- package/dist/types/styling/index.d.ts.map +1 -0
- package/dist/types/styling/themes.d.ts +7 -0
- package/dist/types/styling/themes.d.ts.map +1 -0
- package/dist/types/styling-module.d.ts +178 -0
- package/dist/types/styling-module.d.ts.map +1 -0
- package/dist/types/types/core.d.ts +125 -0
- package/dist/types/types/core.d.ts.map +1 -0
- package/dist/types/types/handlers.d.ts +85 -0
- package/dist/types/types/handlers.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +7 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/utils/environment.d.ts +47 -0
- package/dist/types/utils/environment.d.ts.map +1 -0
- package/dist/types/utils/formatting.d.ts +37 -0
- package/dist/types/utils/formatting.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/opentui-detection.d.ts +34 -0
- package/dist/types/utils/opentui-detection.d.ts.map +1 -0
- package/dist/types/utils/output.d.ts +41 -0
- package/dist/types/utils/output.d.ts.map +1 -0
- package/dist/types/utils/stackTrace.d.ts +6 -0
- package/dist/types/utils/stackTrace.d.ts.map +1 -0
- package/dist/types/utils/timestamps.d.ts +20 -0
- package/dist/types/utils/timestamps.d.ts.map +1 -0
- package/dist/utils/environment.d.ts +47 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/environment.js +85 -0
- package/dist/utils/formatting.d.ts +40 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/formatting.js +117 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/opentui-detection.d.ts +34 -0
- package/dist/utils/opentui-detection.d.ts.map +1 -0
- package/dist/utils/opentui-detection.js +116 -0
- package/dist/utils/output.d.ts +44 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +150 -0
- package/dist/utils/stackTrace.d.ts +9 -0
- package/dist/utils/stackTrace.d.ts.map +1 -0
- package/dist/utils/stackTrace.js +81 -0
- package/dist/utils/timestamps.d.ts +20 -0
- package/dist/utils/timestamps.d.ts.map +1 -0
- package/dist/utils/timestamps.js +71 -0
- package/docs/API.md +691 -0
- package/docs/CORE.md +10 -10
- package/docs/DEVELOPMENT.md +731 -0
- package/docs/PACKAGES.md +244 -0
- package/docs/_config.yml +36 -0
- package/docs/index.md +179 -0
- package/examples/README.md +208 -0
- package/examples/basic-logging.js +75 -0
- package/examples/data-export.js +234 -0
- package/examples/package.json +16 -0
- package/examples/performance-timing.js +170 -0
- package/examples/simplified-api.js +124 -0
- package/examples/styling-themes.js +207 -0
- package/package.json +37 -21
- package/packages/core/package.json +57 -0
- package/packages/exports/package.json +41 -0
- package/packages/nodejs-opentui/README.md +232 -0
- package/packages/nodejs-opentui/package.json +72 -0
- package/packages/nodejs-opentui/src/LogRenderer.ts +171 -0
- package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +178 -0
- package/packages/nodejs-opentui/src/components/LogBadge.tsx +131 -0
- package/packages/nodejs-opentui/src/index.ts +133 -0
- package/packages/nodejs-opentui/src/types.ts +158 -0
- package/packages/nodejs-opentui/tsconfig.json +20 -0
- package/packages/styling/package.json +41 -0
- package/project-utils/README.md +172 -0
- package/project-utils/auto-release-gemini.ts +1193 -0
- package/project-utils/auto-release-ui.ts +1329 -0
- package/project-utils/commit-generator.ts +1385 -0
- package/project-utils/commit-ui.ts +264 -0
- package/project-utils/git-utils.ts +199 -0
- package/project-utils/github-release-manager.ts +466 -0
- package/project-utils/project-config.ts +260 -0
- package/project-utils/prompt-templates.js +345 -0
- package/project-utils/prompt-templates.ts +422 -0
- package/project-utils/version-manager.ts +1078 -0
- package/src/Logger.ts +251 -16
- package/src/ScopedLogger.ts +262 -0
- package/src/cli/CommandProcessor.ts +173 -2
- package/src/cli/commands/HistoryCommand.ts +117 -0
- package/src/cli/index.ts +12 -0
- package/src/constants.ts +84 -2
- package/src/core.ts +119 -46
- package/src/example.ts +4 -4
- package/src/exports-module.ts +1 -1
- package/src/handlers/ExportLogHandler.ts +141 -0
- package/src/handlers/FileLogHandler.ts +144 -5
- package/src/index.ts +1 -1
- package/src/main.ts +3 -3
- package/src/styling/LogStyleBuilder.ts +355 -0
- package/src/styling/SemanticStyles.ts +380 -0
- package/src/styling/SmartPresets.ts +288 -0
- package/src/styling/StyleBuilder.ts +14 -0
- package/src/styling/index.ts +16 -1
- package/src/styling-module.ts +1 -1
- package/src/types/core.ts +60 -0
- package/src/types/index.ts +6 -0
- package/src/utils/environment.ts +94 -0
- package/src/utils/formatting.ts +142 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/opentui-detection.ts +138 -0
- package/src/utils/output.ts +66 -8
- package/test-core-browser.html +237 -0
- package/test-core-node.js +63 -0
- package/tests/test-conflict-resolution.ts +391 -0
- package/tests/validate-workflows.sh +131 -0
- package/tests/yaml-autofix.sh +146 -0
- package/vite.config.ts +189 -50
- package/.npmrc.bak +0 -1
- package/dist/chunks/Logger-BQhMKy_T.js +0 -2
- package/dist/chunks/Logger-BQhMKy_T.js.map +0 -1
- package/dist/chunks/Logger-BrFKFZcD.js +0 -978
- package/dist/chunks/Logger-BrFKFZcD.js.map +0 -1
- package/dist/chunks/core-2opW4Pi3.js +0 -194
- package/dist/chunks/core-2opW4Pi3.js.map +0 -1
- package/dist/chunks/core-DyugwSYZ.js +0 -4
- package/dist/chunks/core-DyugwSYZ.js.map +0 -1
- package/dist/chunks/exports-BNP3R7dp.js +0 -421
- package/dist/chunks/exports-BNP3R7dp.js.map +0 -1
- package/dist/chunks/exports-U1xLBXrY.js +0 -2
- package/dist/chunks/exports-U1xLBXrY.js.map +0 -1
- package/dist/chunks/styling-DhUDzwlE.js +0 -654
- package/dist/chunks/styling-DhUDzwlE.js.map +0 -1
- package/dist/chunks/styling-tmRDI28D.js +0 -2
- package/dist/chunks/styling-tmRDI28D.js.map +0 -1
- package/dist/types/exports.d.ts +0 -600
- package/dist/types/styling.d.ts +0 -751
- package/src/Logger.ts.backup +0 -1684
- /package/.github/{workflows → workflows-backup}/release.yml +0 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Smart presets for simplified logger configuration
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Smart presets that configure the entire log appearance
|
|
6
|
+
*/
|
|
7
|
+
export const SMART_PRESETS = {
|
|
8
|
+
/**
|
|
9
|
+
* Default preset - works perfectly out-of-the-box
|
|
10
|
+
* Clean, readable, automatically adaptive to dark/light themes
|
|
11
|
+
*/
|
|
12
|
+
default: {
|
|
13
|
+
layout: {
|
|
14
|
+
spacing: 'normal',
|
|
15
|
+
innerPadding: '2px',
|
|
16
|
+
outerMargin: '1px'
|
|
17
|
+
},
|
|
18
|
+
timestamp: {
|
|
19
|
+
show: true,
|
|
20
|
+
color: 'auto', // Automatically adaptive
|
|
21
|
+
font: 'Monaco, Consolas, monospace',
|
|
22
|
+
size: '11px'
|
|
23
|
+
},
|
|
24
|
+
level: {
|
|
25
|
+
show: true,
|
|
26
|
+
style: 'badge',
|
|
27
|
+
uppercase: false,
|
|
28
|
+
padding: '2px 8px'
|
|
29
|
+
},
|
|
30
|
+
prefix: {
|
|
31
|
+
show: true,
|
|
32
|
+
style: 'dark', // Automatically adaptive
|
|
33
|
+
padding: '2px 6px'
|
|
34
|
+
},
|
|
35
|
+
message: {
|
|
36
|
+
show: true,
|
|
37
|
+
color: 'auto', // Automatically adaptive
|
|
38
|
+
font: 'system-ui, -apple-system, sans-serif',
|
|
39
|
+
size: '14px'
|
|
40
|
+
},
|
|
41
|
+
location: {
|
|
42
|
+
show: true,
|
|
43
|
+
color: 'auto', // Automatically adaptive
|
|
44
|
+
font: 'Monaco, Consolas, monospace',
|
|
45
|
+
size: '11px'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Cyberpunk preset - neon colors, glowing effects, dark theme
|
|
50
|
+
*/
|
|
51
|
+
cyberpunk: {
|
|
52
|
+
layout: {
|
|
53
|
+
spacing: 'compact',
|
|
54
|
+
innerPadding: '1px',
|
|
55
|
+
outerMargin: '0px'
|
|
56
|
+
},
|
|
57
|
+
timestamp: {
|
|
58
|
+
show: true,
|
|
59
|
+
color: '#00ffff',
|
|
60
|
+
font: 'Monaco, Consolas, monospace',
|
|
61
|
+
size: '10px',
|
|
62
|
+
style: 'neon'
|
|
63
|
+
},
|
|
64
|
+
level: {
|
|
65
|
+
show: true,
|
|
66
|
+
style: 'glowing',
|
|
67
|
+
uppercase: true,
|
|
68
|
+
padding: '2px 8px'
|
|
69
|
+
},
|
|
70
|
+
prefix: {
|
|
71
|
+
show: true,
|
|
72
|
+
color: '#ff0080',
|
|
73
|
+
background: 'rgba(255, 0, 128, 0.1)',
|
|
74
|
+
border: '1px solid #ff0080',
|
|
75
|
+
style: 'neon'
|
|
76
|
+
},
|
|
77
|
+
message: {
|
|
78
|
+
show: true,
|
|
79
|
+
color: '#00ff41',
|
|
80
|
+
font: 'Monaco, Consolas, monospace',
|
|
81
|
+
size: '13px'
|
|
82
|
+
},
|
|
83
|
+
location: {
|
|
84
|
+
show: false // Hidden for cleaner look
|
|
85
|
+
},
|
|
86
|
+
backdrop: 'blur(2px)',
|
|
87
|
+
transparency: 0.9
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* Glassmorphism preset - modern blur effects, transparency
|
|
91
|
+
*/
|
|
92
|
+
glassmorphism: {
|
|
93
|
+
layout: {
|
|
94
|
+
spacing: 'spacious',
|
|
95
|
+
innerPadding: '4px',
|
|
96
|
+
outerMargin: '2px'
|
|
97
|
+
},
|
|
98
|
+
timestamp: {
|
|
99
|
+
show: true,
|
|
100
|
+
color: 'auto',
|
|
101
|
+
font: 'system-ui, sans-serif',
|
|
102
|
+
size: '11px',
|
|
103
|
+
style: 'glassmorphic'
|
|
104
|
+
},
|
|
105
|
+
level: {
|
|
106
|
+
show: true,
|
|
107
|
+
style: 'glassmorphic',
|
|
108
|
+
uppercase: false,
|
|
109
|
+
padding: '4px 12px'
|
|
110
|
+
},
|
|
111
|
+
prefix: {
|
|
112
|
+
show: true,
|
|
113
|
+
style: 'glassmorphic',
|
|
114
|
+
padding: '3px 8px'
|
|
115
|
+
},
|
|
116
|
+
message: {
|
|
117
|
+
show: true,
|
|
118
|
+
color: 'auto',
|
|
119
|
+
font: 'system-ui, sans-serif',
|
|
120
|
+
size: '14px'
|
|
121
|
+
},
|
|
122
|
+
location: {
|
|
123
|
+
show: true,
|
|
124
|
+
color: 'auto',
|
|
125
|
+
font: 'system-ui, sans-serif',
|
|
126
|
+
size: '11px',
|
|
127
|
+
style: 'glassmorphic'
|
|
128
|
+
},
|
|
129
|
+
backdrop: 'blur(10px)',
|
|
130
|
+
transparency: 0.8
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* Minimal preset - clean, no decorations, maximum readability
|
|
134
|
+
*/
|
|
135
|
+
minimal: {
|
|
136
|
+
layout: {
|
|
137
|
+
spacing: 'compact',
|
|
138
|
+
innerPadding: '0px',
|
|
139
|
+
outerMargin: '0px'
|
|
140
|
+
},
|
|
141
|
+
timestamp: {
|
|
142
|
+
show: false // Hidden for minimal look
|
|
143
|
+
},
|
|
144
|
+
level: {
|
|
145
|
+
show: true,
|
|
146
|
+
style: 'flat',
|
|
147
|
+
uppercase: true,
|
|
148
|
+
padding: '0px 4px',
|
|
149
|
+
border: 'none',
|
|
150
|
+
background: 'transparent'
|
|
151
|
+
},
|
|
152
|
+
prefix: {
|
|
153
|
+
show: true,
|
|
154
|
+
style: 'flat',
|
|
155
|
+
padding: '0px 4px',
|
|
156
|
+
border: 'none',
|
|
157
|
+
background: 'transparent'
|
|
158
|
+
},
|
|
159
|
+
message: {
|
|
160
|
+
show: true,
|
|
161
|
+
color: 'auto',
|
|
162
|
+
font: 'system-ui, sans-serif',
|
|
163
|
+
size: '14px'
|
|
164
|
+
},
|
|
165
|
+
location: {
|
|
166
|
+
show: false // Hidden for minimal look
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
/**
|
|
170
|
+
* Debug preset - monospace, detailed, compact for development
|
|
171
|
+
*/
|
|
172
|
+
debug: {
|
|
173
|
+
layout: {
|
|
174
|
+
spacing: 'compact',
|
|
175
|
+
innerPadding: '1px',
|
|
176
|
+
outerMargin: '0px'
|
|
177
|
+
},
|
|
178
|
+
timestamp: {
|
|
179
|
+
show: true,
|
|
180
|
+
color: 'auto',
|
|
181
|
+
font: 'Monaco, Consolas, monospace',
|
|
182
|
+
size: '10px'
|
|
183
|
+
},
|
|
184
|
+
level: {
|
|
185
|
+
show: true,
|
|
186
|
+
style: 'compact',
|
|
187
|
+
uppercase: true,
|
|
188
|
+
padding: '1px 4px',
|
|
189
|
+
font: 'Monaco, Consolas, monospace',
|
|
190
|
+
size: '10px'
|
|
191
|
+
},
|
|
192
|
+
prefix: {
|
|
193
|
+
show: true,
|
|
194
|
+
style: 'compact',
|
|
195
|
+
padding: '1px 4px',
|
|
196
|
+
font: 'Monaco, Consolas, monospace',
|
|
197
|
+
size: '10px'
|
|
198
|
+
},
|
|
199
|
+
message: {
|
|
200
|
+
show: true,
|
|
201
|
+
color: 'auto',
|
|
202
|
+
font: 'Monaco, Consolas, monospace',
|
|
203
|
+
size: '12px'
|
|
204
|
+
},
|
|
205
|
+
location: {
|
|
206
|
+
show: true,
|
|
207
|
+
color: 'auto',
|
|
208
|
+
font: 'Monaco, Consolas, monospace',
|
|
209
|
+
size: '10px',
|
|
210
|
+
style: 'clickable'
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
/**
|
|
214
|
+
* Production preset - clean, essential info only
|
|
215
|
+
*/
|
|
216
|
+
production: {
|
|
217
|
+
layout: {
|
|
218
|
+
spacing: 'normal',
|
|
219
|
+
innerPadding: '2px',
|
|
220
|
+
outerMargin: '1px'
|
|
221
|
+
},
|
|
222
|
+
timestamp: {
|
|
223
|
+
show: true,
|
|
224
|
+
color: 'auto',
|
|
225
|
+
font: 'system-ui, sans-serif',
|
|
226
|
+
size: '11px'
|
|
227
|
+
},
|
|
228
|
+
level: {
|
|
229
|
+
show: true,
|
|
230
|
+
style: 'badge',
|
|
231
|
+
uppercase: false,
|
|
232
|
+
padding: '2px 6px'
|
|
233
|
+
},
|
|
234
|
+
prefix: {
|
|
235
|
+
show: false // Hidden in production
|
|
236
|
+
},
|
|
237
|
+
message: {
|
|
238
|
+
show: true,
|
|
239
|
+
color: 'auto',
|
|
240
|
+
font: 'system-ui, sans-serif',
|
|
241
|
+
size: '14px'
|
|
242
|
+
},
|
|
243
|
+
location: {
|
|
244
|
+
show: false // Hidden in production
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Get a smart preset by name
|
|
250
|
+
*/
|
|
251
|
+
export function getSmartPreset(name) {
|
|
252
|
+
return SMART_PRESETS[name] || null;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* List all available smart presets
|
|
256
|
+
*/
|
|
257
|
+
export function getAvailablePresets() {
|
|
258
|
+
return Object.keys(SMART_PRESETS);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Check if a preset exists
|
|
262
|
+
*/
|
|
263
|
+
export function hasPreset(name) {
|
|
264
|
+
return name in SMART_PRESETS;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Preset descriptions for help/documentation
|
|
268
|
+
*/
|
|
269
|
+
export const PRESET_DESCRIPTIONS = {
|
|
270
|
+
default: 'Clean, readable, automatically adaptive to dark/light themes',
|
|
271
|
+
cyberpunk: 'Neon colors, glowing effects, perfect for dark themes',
|
|
272
|
+
glassmorphism: 'Modern blur effects with transparency and spacious layout',
|
|
273
|
+
minimal: 'Clean and simple, no decorations, maximum readability',
|
|
274
|
+
debug: 'Monospace fonts, detailed info, compact layout for development',
|
|
275
|
+
production: 'Professional look with essential information only'
|
|
276
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview StyleBuilder class for Advanced Logger
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Utility class for creating dynamic console styles with method chaining
|
|
6
|
+
*/
|
|
7
|
+
export declare class StyleBuilder {
|
|
8
|
+
private styles;
|
|
9
|
+
constructor(baseStyle?: string);
|
|
10
|
+
/**
|
|
11
|
+
* Add background color or gradient
|
|
12
|
+
*/
|
|
13
|
+
bg(background: string): StyleBuilder;
|
|
14
|
+
/**
|
|
15
|
+
* Add text color
|
|
16
|
+
*/
|
|
17
|
+
color(color: string): StyleBuilder;
|
|
18
|
+
/**
|
|
19
|
+
* Add border styling
|
|
20
|
+
*/
|
|
21
|
+
border(border: string): StyleBuilder;
|
|
22
|
+
/**
|
|
23
|
+
* Add box shadow
|
|
24
|
+
*/
|
|
25
|
+
shadow(shadow: string): StyleBuilder;
|
|
26
|
+
/**
|
|
27
|
+
* Add padding
|
|
28
|
+
*/
|
|
29
|
+
padding(padding: string): StyleBuilder;
|
|
30
|
+
/**
|
|
31
|
+
* Add margin
|
|
32
|
+
*/
|
|
33
|
+
margin(margin: string): StyleBuilder;
|
|
34
|
+
/**
|
|
35
|
+
* Add border radius
|
|
36
|
+
*/
|
|
37
|
+
rounded(radius?: string): StyleBuilder;
|
|
38
|
+
/**
|
|
39
|
+
* Add font weight
|
|
40
|
+
*/
|
|
41
|
+
bold(): StyleBuilder;
|
|
42
|
+
/**
|
|
43
|
+
* Add font styling
|
|
44
|
+
*/
|
|
45
|
+
font(font: string): StyleBuilder;
|
|
46
|
+
/**
|
|
47
|
+
* Set monospace font family (alias for common monospace fonts)
|
|
48
|
+
*/
|
|
49
|
+
mono(): StyleBuilder;
|
|
50
|
+
/**
|
|
51
|
+
* Set system font family (alias for system fonts)
|
|
52
|
+
*/
|
|
53
|
+
system(): StyleBuilder;
|
|
54
|
+
/**
|
|
55
|
+
* Add font size
|
|
56
|
+
*/
|
|
57
|
+
size(size: string): StyleBuilder;
|
|
58
|
+
/**
|
|
59
|
+
* Add line height
|
|
60
|
+
*/
|
|
61
|
+
lineHeight(height: string): StyleBuilder;
|
|
62
|
+
/**
|
|
63
|
+
* Add text decoration
|
|
64
|
+
*/
|
|
65
|
+
underline(): StyleBuilder;
|
|
66
|
+
/**
|
|
67
|
+
* Add text transform
|
|
68
|
+
*/
|
|
69
|
+
uppercase(): StyleBuilder;
|
|
70
|
+
/**
|
|
71
|
+
* Add opacity
|
|
72
|
+
*/
|
|
73
|
+
opacity(value: number): StyleBuilder;
|
|
74
|
+
/**
|
|
75
|
+
* Add display property
|
|
76
|
+
*/
|
|
77
|
+
display(value: string): StyleBuilder;
|
|
78
|
+
/**
|
|
79
|
+
* Add position property
|
|
80
|
+
*/
|
|
81
|
+
position(value: string): StyleBuilder;
|
|
82
|
+
/**
|
|
83
|
+
* Add transform property
|
|
84
|
+
*/
|
|
85
|
+
transform(value: string): StyleBuilder;
|
|
86
|
+
/**
|
|
87
|
+
* Add animation property
|
|
88
|
+
*/
|
|
89
|
+
animation(value: string): StyleBuilder;
|
|
90
|
+
/**
|
|
91
|
+
* Add transition property
|
|
92
|
+
*/
|
|
93
|
+
transition(value: string): StyleBuilder;
|
|
94
|
+
/**
|
|
95
|
+
* Add cursor property
|
|
96
|
+
*/
|
|
97
|
+
cursor(value: string): StyleBuilder;
|
|
98
|
+
/**
|
|
99
|
+
* Add any custom CSS property
|
|
100
|
+
*/
|
|
101
|
+
custom(property: string, value: string): StyleBuilder;
|
|
102
|
+
/**
|
|
103
|
+
* Add any CSS property (alias for custom)
|
|
104
|
+
*/
|
|
105
|
+
css(property: string, value: string): StyleBuilder;
|
|
106
|
+
/**
|
|
107
|
+
* Build the final CSS string
|
|
108
|
+
*/
|
|
109
|
+
build(): string;
|
|
110
|
+
/**
|
|
111
|
+
* Clear all styles and start fresh
|
|
112
|
+
*/
|
|
113
|
+
clear(): StyleBuilder;
|
|
114
|
+
/**
|
|
115
|
+
* Clone this StyleBuilder with the same styles
|
|
116
|
+
*/
|
|
117
|
+
clone(): StyleBuilder;
|
|
118
|
+
/**
|
|
119
|
+
* Merge another StyleBuilder's styles into this one
|
|
120
|
+
*/
|
|
121
|
+
merge(other: StyleBuilder): StyleBuilder;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Dynamic styler instance for external use
|
|
125
|
+
*/
|
|
126
|
+
export declare const $: any;
|
|
127
|
+
/**
|
|
128
|
+
* Pre-defined style presets for common use cases
|
|
129
|
+
*/
|
|
130
|
+
export declare const StylePresets: {
|
|
131
|
+
success: () => StyleBuilder;
|
|
132
|
+
error: () => StyleBuilder;
|
|
133
|
+
warning: () => StyleBuilder;
|
|
134
|
+
info: () => StyleBuilder;
|
|
135
|
+
debug: () => StyleBuilder;
|
|
136
|
+
muted: () => StyleBuilder;
|
|
137
|
+
accent: () => StyleBuilder;
|
|
138
|
+
neon: () => StyleBuilder;
|
|
139
|
+
};
|
|
140
|
+
//# sourceMappingURL=StyleBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyleBuilder.d.ts","sourceRoot":"","sources":["../../src/styling/StyleBuilder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,qBAAa,YAAY;IACrB,OAAO,CAAC,MAAM,CAAgB;gBAElB,SAAS,SAAK;IAI1B;;OAEG;IACH,EAAE,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKlC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY;IAKtC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,OAAO,CAAC,MAAM,GAAE,MAAc,GAAG,YAAY;IAK7C;;OAEG;IACH,IAAI,IAAI,YAAY;IAKpB;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAKhC;;OAEG;IACH,IAAI,IAAI,YAAY;IAIpB;;OAEG;IACH,MAAM,IAAI,YAAY;IAItB;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAKhC;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAKxC;;OAEG;IACH,SAAS,IAAI,YAAY;IAKzB;;OAEG;IACH,SAAS,IAAI,YAAY;IAKzB;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKrC;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKtC;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKtC;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKvC;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKnC;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY;IAKrD;;OAEG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY;IAIlD;;OAEG;IACH,KAAK,IAAI,MAAM;IAIf;;OAEG;IACH,KAAK,IAAI,YAAY;IAKrB;;OAEG;IACH,KAAK,IAAI,YAAY;IAMrB;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY;CAI3C;AAqBD;;GAEG;AACH,eAAO,MAAM,CAAC,KAAiB,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;CAuDxB,CAAC"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview StyleBuilder class for Advanced Logger
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Utility class for creating dynamic console styles with method chaining
|
|
6
|
+
*/
|
|
7
|
+
export class StyleBuilder {
|
|
8
|
+
styles = [];
|
|
9
|
+
constructor(baseStyle = '') {
|
|
10
|
+
if (baseStyle)
|
|
11
|
+
this.styles.push(baseStyle);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Add background color or gradient
|
|
15
|
+
*/
|
|
16
|
+
bg(background) {
|
|
17
|
+
this.styles.push(`background: ${background}`);
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Add text color
|
|
22
|
+
*/
|
|
23
|
+
color(color) {
|
|
24
|
+
this.styles.push(`color: ${color}`);
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Add border styling
|
|
29
|
+
*/
|
|
30
|
+
border(border) {
|
|
31
|
+
this.styles.push(`border: ${border}`);
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Add box shadow
|
|
36
|
+
*/
|
|
37
|
+
shadow(shadow) {
|
|
38
|
+
this.styles.push(`box-shadow: ${shadow}`);
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Add padding
|
|
43
|
+
*/
|
|
44
|
+
padding(padding) {
|
|
45
|
+
this.styles.push(`padding: ${padding}`);
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Add margin
|
|
50
|
+
*/
|
|
51
|
+
margin(margin) {
|
|
52
|
+
this.styles.push(`margin: ${margin}`);
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Add border radius
|
|
57
|
+
*/
|
|
58
|
+
rounded(radius = '4px') {
|
|
59
|
+
this.styles.push(`border-radius: ${radius}`);
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Add font weight
|
|
64
|
+
*/
|
|
65
|
+
bold() {
|
|
66
|
+
this.styles.push('font-weight: bold');
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Add font styling
|
|
71
|
+
*/
|
|
72
|
+
font(font) {
|
|
73
|
+
this.styles.push(`font-family: ${font}`);
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Set monospace font family (alias for common monospace fonts)
|
|
78
|
+
*/
|
|
79
|
+
mono() {
|
|
80
|
+
return this.font('Monaco, Consolas, "Courier New", monospace');
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Set system font family (alias for system fonts)
|
|
84
|
+
*/
|
|
85
|
+
system() {
|
|
86
|
+
return this.font('system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif');
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Add font size
|
|
90
|
+
*/
|
|
91
|
+
size(size) {
|
|
92
|
+
this.styles.push(`font-size: ${size}`);
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Add line height
|
|
97
|
+
*/
|
|
98
|
+
lineHeight(height) {
|
|
99
|
+
this.styles.push(`line-height: ${height}`);
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Add text decoration
|
|
104
|
+
*/
|
|
105
|
+
underline() {
|
|
106
|
+
this.styles.push('text-decoration: underline');
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Add text transform
|
|
111
|
+
*/
|
|
112
|
+
uppercase() {
|
|
113
|
+
this.styles.push('text-transform: uppercase');
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Add opacity
|
|
118
|
+
*/
|
|
119
|
+
opacity(value) {
|
|
120
|
+
this.styles.push(`opacity: ${value}`);
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Add display property
|
|
125
|
+
*/
|
|
126
|
+
display(value) {
|
|
127
|
+
this.styles.push(`display: ${value}`);
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Add position property
|
|
132
|
+
*/
|
|
133
|
+
position(value) {
|
|
134
|
+
this.styles.push(`position: ${value}`);
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Add transform property
|
|
139
|
+
*/
|
|
140
|
+
transform(value) {
|
|
141
|
+
this.styles.push(`transform: ${value}`);
|
|
142
|
+
return this;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Add animation property
|
|
146
|
+
*/
|
|
147
|
+
animation(value) {
|
|
148
|
+
this.styles.push(`animation: ${value}`);
|
|
149
|
+
return this;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Add transition property
|
|
153
|
+
*/
|
|
154
|
+
transition(value) {
|
|
155
|
+
this.styles.push(`transition: ${value}`);
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Add cursor property
|
|
160
|
+
*/
|
|
161
|
+
cursor(value) {
|
|
162
|
+
this.styles.push(`cursor: ${value}`);
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Add any custom CSS property
|
|
167
|
+
*/
|
|
168
|
+
custom(property, value) {
|
|
169
|
+
this.styles.push(`${property}: ${value}`);
|
|
170
|
+
return this;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Add any CSS property (alias for custom)
|
|
174
|
+
*/
|
|
175
|
+
css(property, value) {
|
|
176
|
+
return this.custom(property, value);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Build the final CSS string
|
|
180
|
+
*/
|
|
181
|
+
build() {
|
|
182
|
+
return this.styles.join('; ');
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Clear all styles and start fresh
|
|
186
|
+
*/
|
|
187
|
+
clear() {
|
|
188
|
+
this.styles = [];
|
|
189
|
+
return this;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Clone this StyleBuilder with the same styles
|
|
193
|
+
*/
|
|
194
|
+
clone() {
|
|
195
|
+
const cloned = new StyleBuilder();
|
|
196
|
+
cloned.styles = [...this.styles];
|
|
197
|
+
return cloned;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Merge another StyleBuilder's styles into this one
|
|
201
|
+
*/
|
|
202
|
+
merge(other) {
|
|
203
|
+
this.styles.push(...other.styles);
|
|
204
|
+
return this;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Proxy-based dynamic styler for chainable console styling
|
|
209
|
+
*/
|
|
210
|
+
function createStyler() {
|
|
211
|
+
const builder = new StyleBuilder();
|
|
212
|
+
return new Proxy(builder, {
|
|
213
|
+
get(target, prop) {
|
|
214
|
+
if (prop in target) {
|
|
215
|
+
const method = target[prop];
|
|
216
|
+
if (typeof method === 'function') {
|
|
217
|
+
return method.bind(target);
|
|
218
|
+
}
|
|
219
|
+
return method;
|
|
220
|
+
}
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Dynamic styler instance for external use
|
|
227
|
+
*/
|
|
228
|
+
export const $ = createStyler();
|
|
229
|
+
/**
|
|
230
|
+
* Pre-defined style presets for common use cases
|
|
231
|
+
*/
|
|
232
|
+
export const StylePresets = {
|
|
233
|
+
success: () => new StyleBuilder()
|
|
234
|
+
.bg('linear-gradient(135deg, #00b894 0%, #00a085 100%)')
|
|
235
|
+
.color('#ffffff')
|
|
236
|
+
.padding('4px 8px')
|
|
237
|
+
.rounded('4px')
|
|
238
|
+
.bold(),
|
|
239
|
+
error: () => new StyleBuilder()
|
|
240
|
+
.bg('linear-gradient(135deg, #e84393 0%, #d63031 100%)')
|
|
241
|
+
.color('#ffffff')
|
|
242
|
+
.padding('4px 8px')
|
|
243
|
+
.rounded('4px')
|
|
244
|
+
.bold(),
|
|
245
|
+
warning: () => new StyleBuilder()
|
|
246
|
+
.bg('linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)')
|
|
247
|
+
.color('#2d3436')
|
|
248
|
+
.padding('4px 8px')
|
|
249
|
+
.rounded('4px')
|
|
250
|
+
.bold(),
|
|
251
|
+
info: () => new StyleBuilder()
|
|
252
|
+
.bg('linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)')
|
|
253
|
+
.color('#ffffff')
|
|
254
|
+
.padding('4px 8px')
|
|
255
|
+
.rounded('4px')
|
|
256
|
+
.bold(),
|
|
257
|
+
debug: () => new StyleBuilder()
|
|
258
|
+
.bg('linear-gradient(135deg, #667eea 0%, #764ba2 100%)')
|
|
259
|
+
.color('#ffffff')
|
|
260
|
+
.padding('4px 8px')
|
|
261
|
+
.rounded('4px')
|
|
262
|
+
.bold(),
|
|
263
|
+
muted: () => new StyleBuilder()
|
|
264
|
+
.color('#6c757d')
|
|
265
|
+
.font('Monaco, Consolas, monospace')
|
|
266
|
+
.size('12px'),
|
|
267
|
+
accent: () => new StyleBuilder()
|
|
268
|
+
.bg('#f8f9fa')
|
|
269
|
+
.color('#495057')
|
|
270
|
+
.padding('2px 6px')
|
|
271
|
+
.rounded('3px')
|
|
272
|
+
.border('1px solid #dee2e6'),
|
|
273
|
+
neon: () => new StyleBuilder()
|
|
274
|
+
.bg('linear-gradient(135deg, #0f3460 0%, #e94560 100%)')
|
|
275
|
+
.color('#00ffff')
|
|
276
|
+
.padding('4px 8px')
|
|
277
|
+
.rounded('4px')
|
|
278
|
+
.bold()
|
|
279
|
+
.shadow('0 0 10px rgba(0, 255, 255, 0.5)'),
|
|
280
|
+
};
|