@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,355 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview LogStyleBuilder for fluent log styling API
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { Logger } from '../Logger.js';
|
|
6
|
+
import type { LogStyles, LogLayout, SpacingType } from '../types/index.js';
|
|
7
|
+
import {
|
|
8
|
+
TimestampStyler,
|
|
9
|
+
LevelStyler,
|
|
10
|
+
PrefixStyler,
|
|
11
|
+
MessageStyler,
|
|
12
|
+
LocationStyler
|
|
13
|
+
} from './SemanticStyles.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Fluent API builder for log styling with semantic methods
|
|
17
|
+
*/
|
|
18
|
+
export class LogStyleBuilder {
|
|
19
|
+
private logStyles: LogStyles = {};
|
|
20
|
+
private logger: Logger;
|
|
21
|
+
|
|
22
|
+
constructor(logger: Logger) {
|
|
23
|
+
this.logger = logger;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Configure timestamp styling
|
|
28
|
+
*/
|
|
29
|
+
timestamp(): TimestampStyleBuilderProxy {
|
|
30
|
+
return new TimestampStyleBuilderProxy(this);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Configure level badge styling
|
|
35
|
+
*/
|
|
36
|
+
level(): LevelStyleBuilderProxy {
|
|
37
|
+
return new LevelStyleBuilderProxy(this);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Configure prefix styling
|
|
42
|
+
*/
|
|
43
|
+
prefix(): PrefixStyleBuilderProxy {
|
|
44
|
+
return new PrefixStyleBuilderProxy(this);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Configure message text styling
|
|
49
|
+
*/
|
|
50
|
+
message(): MessageStyleBuilderProxy {
|
|
51
|
+
return new MessageStyleBuilderProxy(this);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Configure location info styling
|
|
56
|
+
*/
|
|
57
|
+
location(): LocationStyleBuilderProxy {
|
|
58
|
+
return new LocationStyleBuilderProxy(this);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Use a predefined preset
|
|
63
|
+
*/
|
|
64
|
+
usePreset(presetName: string): LogStyleBuilder {
|
|
65
|
+
// Will be implemented when we create the presets
|
|
66
|
+
console.warn(`Preset '${presetName}' will be available in next implementation phase`);
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Customize with partial configuration
|
|
72
|
+
*/
|
|
73
|
+
customize(overrides: Partial<LogStyles>): LogStyleBuilder {
|
|
74
|
+
this.logStyles = { ...this.logStyles, ...overrides };
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Set layout spacing
|
|
80
|
+
*/
|
|
81
|
+
spacing(type: SpacingType): LogStyleBuilder {
|
|
82
|
+
if (!this.logStyles.layout) {
|
|
83
|
+
this.logStyles.layout = { spacing: type };
|
|
84
|
+
} else {
|
|
85
|
+
this.logStyles.layout.spacing = type;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Apply spacing-specific configurations
|
|
89
|
+
switch (type) {
|
|
90
|
+
case 'compact':
|
|
91
|
+
this.logStyles.layout.innerPadding = '1px';
|
|
92
|
+
this.logStyles.layout.outerMargin = '0px';
|
|
93
|
+
break;
|
|
94
|
+
case 'spacious':
|
|
95
|
+
this.logStyles.layout.innerPadding = '4px';
|
|
96
|
+
this.logStyles.layout.outerMargin = '2px';
|
|
97
|
+
break;
|
|
98
|
+
default: // normal
|
|
99
|
+
this.logStyles.layout.innerPadding = '2px';
|
|
100
|
+
this.logStyles.layout.outerMargin = '1px';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Set backdrop filter for glassmorphism effects
|
|
108
|
+
*/
|
|
109
|
+
backdrop(filter: string): LogStyleBuilder {
|
|
110
|
+
this.logStyles.backdrop = filter;
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Set overall transparency
|
|
116
|
+
*/
|
|
117
|
+
transparency(value: number): LogStyleBuilder {
|
|
118
|
+
this.logStyles.transparency = Math.max(0, Math.min(1, value));
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Apply the configured styles to the logger
|
|
124
|
+
*/
|
|
125
|
+
apply(): void {
|
|
126
|
+
// Store the configuration in the logger
|
|
127
|
+
// This will be implemented when we integrate with the main Logger
|
|
128
|
+
(this.logger as any)._customLogStyles = this.logStyles;
|
|
129
|
+
console.log('Applied log styles:', this.logStyles);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Get current configuration (for debugging)
|
|
134
|
+
*/
|
|
135
|
+
getConfig(): LogStyles {
|
|
136
|
+
return { ...this.logStyles };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Internal method to update part configuration
|
|
141
|
+
*/
|
|
142
|
+
_updatePartConfig(part: keyof LogStyles, styles: string): void {
|
|
143
|
+
if (part === 'layout' || part === 'backdrop' || part === 'transparency') {
|
|
144
|
+
return; // Skip these non-part configs
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (!this.logStyles[part]) {
|
|
148
|
+
this.logStyles[part] = {};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Parse basic CSS styles into config
|
|
152
|
+
// This is a simplified approach - in production might want more sophisticated parsing
|
|
153
|
+
this.logStyles[part]!.style = styles;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Base proxy class for part-specific styling
|
|
159
|
+
*/
|
|
160
|
+
abstract class PartStyleBuilderProxy {
|
|
161
|
+
protected parentBuilder: LogStyleBuilder;
|
|
162
|
+
protected partName: keyof LogStyles;
|
|
163
|
+
|
|
164
|
+
constructor(parentBuilder: LogStyleBuilder, partName: keyof LogStyles) {
|
|
165
|
+
this.parentBuilder = parentBuilder;
|
|
166
|
+
this.partName = partName;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Return to the main builder for chaining other parts
|
|
171
|
+
*/
|
|
172
|
+
and(): LogStyleBuilder {
|
|
173
|
+
return this.parentBuilder;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Apply styles and finish configuration
|
|
178
|
+
*/
|
|
179
|
+
apply(): void {
|
|
180
|
+
this.parentBuilder.apply();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Helper to apply styles to the parent builder
|
|
185
|
+
*/
|
|
186
|
+
protected applyStyles(styler: any): this {
|
|
187
|
+
const styles = styler.build();
|
|
188
|
+
this.parentBuilder._updatePartConfig(this.partName, styles);
|
|
189
|
+
return this;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Timestamp styling proxy with fluent API
|
|
195
|
+
*/
|
|
196
|
+
class TimestampStyleBuilderProxy extends PartStyleBuilderProxy {
|
|
197
|
+
constructor(parentBuilder: LogStyleBuilder) {
|
|
198
|
+
super(parentBuilder, 'timestamp');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
default(): TimestampStyleBuilderProxy {
|
|
202
|
+
return this.applyStyles(new TimestampStyler().default());
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
hidden(): TimestampStyleBuilderProxy {
|
|
206
|
+
return this.applyStyles(new TimestampStyler().hidden());
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
minimal(): TimestampStyleBuilderProxy {
|
|
210
|
+
return this.applyStyles(new TimestampStyler().minimal());
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
muted(): TimestampStyleBuilderProxy {
|
|
214
|
+
return this.applyStyles(new TimestampStyler().muted());
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
mono(): TimestampStyleBuilderProxy {
|
|
218
|
+
return this.applyStyles(new TimestampStyler().mono());
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
compact(): TimestampStyleBuilderProxy {
|
|
222
|
+
return this.applyStyles(new TimestampStyler().compact());
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Level badge styling proxy with fluent API
|
|
228
|
+
*/
|
|
229
|
+
class LevelStyleBuilderProxy extends PartStyleBuilderProxy {
|
|
230
|
+
constructor(parentBuilder: LogStyleBuilder) {
|
|
231
|
+
super(parentBuilder, 'level');
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
badge(): LevelStyleBuilderProxy {
|
|
235
|
+
return this.applyStyles(new LevelStyler().badge());
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
gradient(from?: string, to?: string): LevelStyleBuilderProxy {
|
|
239
|
+
return this.applyStyles(new LevelStyler().gradient(from, to));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
glowing(): LevelStyleBuilderProxy {
|
|
243
|
+
return this.applyStyles(new LevelStyler().glowing());
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
flat(): LevelStyleBuilderProxy {
|
|
247
|
+
return this.applyStyles(new LevelStyler().flat());
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
bold(): LevelStyleBuilderProxy {
|
|
251
|
+
return this.applyStyles(new LevelStyler().bold());
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
uppercase(): LevelStyleBuilderProxy {
|
|
255
|
+
return this.applyStyles(new LevelStyler().uppercase());
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
neon(): LevelStyleBuilderProxy {
|
|
259
|
+
return this.applyStyles(new LevelStyler().neon());
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Prefix styling proxy with fluent API
|
|
265
|
+
*/
|
|
266
|
+
class PrefixStyleBuilderProxy extends PartStyleBuilderProxy {
|
|
267
|
+
constructor(parentBuilder: LogStyleBuilder) {
|
|
268
|
+
super(parentBuilder, 'prefix');
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
dark(): PrefixStyleBuilderProxy {
|
|
272
|
+
return this.applyStyles(new PrefixStyler().dark());
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
light(): PrefixStyleBuilderProxy {
|
|
276
|
+
return this.applyStyles(new PrefixStyler().light());
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
compact(): PrefixStyleBuilderProxy {
|
|
280
|
+
return this.applyStyles(new PrefixStyler().compact());
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
muted(): PrefixStyleBuilderProxy {
|
|
284
|
+
return this.applyStyles(new PrefixStyler().muted());
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
mono(): PrefixStyleBuilderProxy {
|
|
288
|
+
return this.applyStyles(new PrefixStyler().mono());
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Message styling proxy with fluent API
|
|
294
|
+
*/
|
|
295
|
+
class MessageStyleBuilderProxy extends PartStyleBuilderProxy {
|
|
296
|
+
constructor(parentBuilder: LogStyleBuilder) {
|
|
297
|
+
super(parentBuilder, 'message');
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
readable(): MessageStyleBuilderProxy {
|
|
301
|
+
return this.applyStyles(new MessageStyler().readable());
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
code(): MessageStyleBuilderProxy {
|
|
305
|
+
return this.applyStyles(new MessageStyler().code());
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
large(): MessageStyleBuilderProxy {
|
|
309
|
+
return this.applyStyles(new MessageStyler().large());
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
system(): MessageStyleBuilderProxy {
|
|
313
|
+
return this.applyStyles(new MessageStyler().system());
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
mono(): MessageStyleBuilderProxy {
|
|
317
|
+
return this.applyStyles(new MessageStyler().mono());
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Location styling proxy with fluent API
|
|
323
|
+
*/
|
|
324
|
+
class LocationStyleBuilderProxy extends PartStyleBuilderProxy {
|
|
325
|
+
constructor(parentBuilder: LogStyleBuilder) {
|
|
326
|
+
super(parentBuilder, 'location');
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
subtle(): LocationStyleBuilderProxy {
|
|
330
|
+
return this.applyStyles(new LocationStyler().subtle());
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
hidden(): LocationStyleBuilderProxy {
|
|
334
|
+
return this.applyStyles(new LocationStyler().hidden());
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
clickable(): LocationStyleBuilderProxy {
|
|
338
|
+
return this.applyStyles(new LocationStyler().clickable());
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
muted(): LocationStyleBuilderProxy {
|
|
342
|
+
return this.applyStyles(new LocationStyler().muted());
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
mono(): LocationStyleBuilderProxy {
|
|
346
|
+
return this.applyStyles(new LocationStyler().mono());
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Create a new LogStyleBuilder instance
|
|
352
|
+
*/
|
|
353
|
+
export function createLogStyleBuilder(logger: Logger): LogStyleBuilder {
|
|
354
|
+
return new LogStyleBuilder(logger);
|
|
355
|
+
}
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Semantic styling system for Advanced Logger
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { StyleBuilder } from './StyleBuilder.js';
|
|
6
|
+
import type { AdaptiveColors } from '../types/index.js';
|
|
7
|
+
import { ADAPTIVE_COLORS } from '../constants.js';
|
|
8
|
+
import { getAdaptiveColor } from '../utils/index.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Base semantic styler with common style methods
|
|
12
|
+
*/
|
|
13
|
+
export abstract class BaseStyler {
|
|
14
|
+
protected builder: StyleBuilder;
|
|
15
|
+
|
|
16
|
+
constructor(builder: StyleBuilder = new StyleBuilder()) {
|
|
17
|
+
this.builder = builder;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Primary brand color (typically blue)
|
|
22
|
+
*/
|
|
23
|
+
primary(): this {
|
|
24
|
+
return this.color('#007bff');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Secondary color (typically gray)
|
|
29
|
+
*/
|
|
30
|
+
secondary(): this {
|
|
31
|
+
return this.color('#6c757d');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Accent color for highlights
|
|
36
|
+
*/
|
|
37
|
+
accent(): this {
|
|
38
|
+
return this.color('#17a2b8');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Muted/subtle color - automatically adaptive
|
|
43
|
+
*/
|
|
44
|
+
muted(): this {
|
|
45
|
+
const mutedColors: AdaptiveColors = { light: '#6c757d', dark: '#a0aec0' };
|
|
46
|
+
return this.color(getAdaptiveColor(mutedColors));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Success color (green)
|
|
51
|
+
*/
|
|
52
|
+
success(): this {
|
|
53
|
+
return this.color('#28a745');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Warning color (yellow/orange)
|
|
58
|
+
*/
|
|
59
|
+
warning(): this {
|
|
60
|
+
return this.color('#ffc107');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Danger/error color (red)
|
|
65
|
+
*/
|
|
66
|
+
danger(): this {
|
|
67
|
+
return this.color('#dc3545');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Monospace font family
|
|
72
|
+
*/
|
|
73
|
+
mono(): this {
|
|
74
|
+
this.builder.font('Monaco, Consolas, "Courier New", monospace');
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* System font family
|
|
80
|
+
*/
|
|
81
|
+
system(): this {
|
|
82
|
+
this.builder.font('system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif');
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Readable font optimized for text
|
|
88
|
+
*/
|
|
89
|
+
readable(): this {
|
|
90
|
+
this.builder.font('Georgia, "Times New Roman", serif');
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Compact spacing
|
|
96
|
+
*/
|
|
97
|
+
compact(): this {
|
|
98
|
+
this.builder.padding('1px 4px').margin('0 1px');
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Spacious layout
|
|
104
|
+
*/
|
|
105
|
+
spacious(): this {
|
|
106
|
+
this.builder.padding('6px 12px').margin('2px 4px');
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Inline display
|
|
112
|
+
*/
|
|
113
|
+
inline(): this {
|
|
114
|
+
this.builder.display('inline-block');
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Glass morphism effect
|
|
120
|
+
*/
|
|
121
|
+
glassmorphic(): this {
|
|
122
|
+
this.builder
|
|
123
|
+
.css('backdrop-filter', 'blur(10px)')
|
|
124
|
+
.css('background', 'rgba(255, 255, 255, 0.1)')
|
|
125
|
+
.border('1px solid rgba(255, 255, 255, 0.2)')
|
|
126
|
+
.rounded('8px');
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Neon glow effect
|
|
132
|
+
*/
|
|
133
|
+
neon(): this {
|
|
134
|
+
const neonColor = '#00ffff';
|
|
135
|
+
this.builder
|
|
136
|
+
.color(neonColor)
|
|
137
|
+
.border(`1px solid ${neonColor}`)
|
|
138
|
+
.shadow(`0 0 10px ${neonColor}, 0 0 20px ${neonColor}`)
|
|
139
|
+
.css('text-shadow', `0 0 5px ${neonColor}`);
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Gradient background
|
|
145
|
+
*/
|
|
146
|
+
gradient(from: string = '#667eea', to: string = '#764ba2'): this {
|
|
147
|
+
this.builder.bg(`linear-gradient(135deg, ${from} 0%, ${to} 100%)`);
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Bold text
|
|
153
|
+
*/
|
|
154
|
+
bold(): this {
|
|
155
|
+
this.builder.bold();
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Set color with automatic adaptation
|
|
161
|
+
*/
|
|
162
|
+
protected color(color: string): this {
|
|
163
|
+
this.builder.color(color);
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Build the final CSS string
|
|
169
|
+
*/
|
|
170
|
+
build(): string {
|
|
171
|
+
return this.builder.build();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Timestamp-specific styling
|
|
177
|
+
*/
|
|
178
|
+
export class TimestampStyler extends BaseStyler {
|
|
179
|
+
/**
|
|
180
|
+
* Default timestamp style - subtle and informative
|
|
181
|
+
*/
|
|
182
|
+
default(): this {
|
|
183
|
+
this.muted().mono();
|
|
184
|
+
this.builder.size('11px');
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Hide timestamp
|
|
190
|
+
*/
|
|
191
|
+
hidden(): this {
|
|
192
|
+
this.builder.display('none');
|
|
193
|
+
return this;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Minimal timestamp (just time, no date)
|
|
198
|
+
*/
|
|
199
|
+
minimal(): this {
|
|
200
|
+
this.muted().mono();
|
|
201
|
+
this.builder.size('10px').opacity(0.7);
|
|
202
|
+
return this;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Set font size
|
|
207
|
+
*/
|
|
208
|
+
size(size: string): this {
|
|
209
|
+
this.builder.size(size);
|
|
210
|
+
return this;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Level badge styling
|
|
216
|
+
*/
|
|
217
|
+
export class LevelStyler extends BaseStyler {
|
|
218
|
+
/**
|
|
219
|
+
* Colorful gradient badge
|
|
220
|
+
*/
|
|
221
|
+
badge(): this {
|
|
222
|
+
this.builder
|
|
223
|
+
.padding('2px 8px')
|
|
224
|
+
.rounded('4px')
|
|
225
|
+
.bold()
|
|
226
|
+
.color('#ffffff');
|
|
227
|
+
return this;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Glowing effect for dark themes
|
|
232
|
+
*/
|
|
233
|
+
glowing(): this {
|
|
234
|
+
return this.neon().badge();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Minimal flat style
|
|
239
|
+
*/
|
|
240
|
+
flat(): this {
|
|
241
|
+
this.builder
|
|
242
|
+
.padding('1px 6px')
|
|
243
|
+
.rounded('2px')
|
|
244
|
+
.border('1px solid currentColor')
|
|
245
|
+
.css('background', 'transparent');
|
|
246
|
+
return this;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Uppercase text
|
|
251
|
+
*/
|
|
252
|
+
uppercase(): this {
|
|
253
|
+
this.builder.uppercase();
|
|
254
|
+
return this;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Prefix styling
|
|
260
|
+
*/
|
|
261
|
+
export class PrefixStyler extends BaseStyler {
|
|
262
|
+
/**
|
|
263
|
+
* Dark theme prefix
|
|
264
|
+
*/
|
|
265
|
+
dark(): this {
|
|
266
|
+
const prefixColors: AdaptiveColors = { light: '#2d3748', dark: '#4a5568' };
|
|
267
|
+
const textColors: AdaptiveColors = { light: '#e2e8f0', dark: '#f7fafc' };
|
|
268
|
+
|
|
269
|
+
this.builder
|
|
270
|
+
.bg(getAdaptiveColor(prefixColors))
|
|
271
|
+
.color(getAdaptiveColor(textColors))
|
|
272
|
+
.padding('2px 6px')
|
|
273
|
+
.rounded('3px')
|
|
274
|
+
.bold()
|
|
275
|
+
.mono()
|
|
276
|
+
.size('11px');
|
|
277
|
+
return this;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Light theme prefix
|
|
282
|
+
*/
|
|
283
|
+
light(): this {
|
|
284
|
+
this.builder
|
|
285
|
+
.bg('#f8f9fa')
|
|
286
|
+
.color('#495057')
|
|
287
|
+
.padding('2px 6px')
|
|
288
|
+
.rounded('3px')
|
|
289
|
+
.bold()
|
|
290
|
+
.mono()
|
|
291
|
+
.size('11px')
|
|
292
|
+
.border('1px solid #dee2e6');
|
|
293
|
+
return this;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Compact prefix
|
|
298
|
+
*/
|
|
299
|
+
compact(): this {
|
|
300
|
+
this.builder
|
|
301
|
+
.padding('1px 4px')
|
|
302
|
+
.size('10px')
|
|
303
|
+
.rounded('2px');
|
|
304
|
+
return this;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Message text styling
|
|
310
|
+
*/
|
|
311
|
+
export class MessageStyler extends BaseStyler {
|
|
312
|
+
/**
|
|
313
|
+
* Readable message text - automatically adaptive
|
|
314
|
+
*/
|
|
315
|
+
readable(): this {
|
|
316
|
+
this.builder
|
|
317
|
+
.color(getAdaptiveColor(ADAPTIVE_COLORS.messageText))
|
|
318
|
+
.system()
|
|
319
|
+
.size('14px');
|
|
320
|
+
return this;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Code-style monospace text
|
|
325
|
+
*/
|
|
326
|
+
code(): this {
|
|
327
|
+
this.builder
|
|
328
|
+
.mono()
|
|
329
|
+
.size('13px')
|
|
330
|
+
.color(getAdaptiveColor(ADAPTIVE_COLORS.messageText))
|
|
331
|
+
.bg('rgba(0, 0, 0, 0.05)')
|
|
332
|
+
.padding('1px 4px')
|
|
333
|
+
.rounded('3px');
|
|
334
|
+
return this;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Large, prominent text
|
|
339
|
+
*/
|
|
340
|
+
large(): this {
|
|
341
|
+
this.builder
|
|
342
|
+
.size('16px')
|
|
343
|
+
.color(getAdaptiveColor(ADAPTIVE_COLORS.messageText));
|
|
344
|
+
return this;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Location info styling
|
|
350
|
+
*/
|
|
351
|
+
export class LocationStyler extends BaseStyler {
|
|
352
|
+
/**
|
|
353
|
+
* Subtle location info - automatically adaptive
|
|
354
|
+
*/
|
|
355
|
+
subtle(): this {
|
|
356
|
+
this.builder
|
|
357
|
+
.color(getAdaptiveColor(ADAPTIVE_COLORS.location))
|
|
358
|
+
.mono()
|
|
359
|
+
.size('11px')
|
|
360
|
+
.opacity(0.7);
|
|
361
|
+
return this;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Hide location info
|
|
366
|
+
*/
|
|
367
|
+
hidden(): this {
|
|
368
|
+
this.builder.display('none');
|
|
369
|
+
return this;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Clickable style (for IDE integration)
|
|
374
|
+
*/
|
|
375
|
+
clickable(): this {
|
|
376
|
+
this.subtle();
|
|
377
|
+
this.builder.css('text-decoration', 'underline').cursor('pointer');
|
|
378
|
+
return this;
|
|
379
|
+
}
|
|
380
|
+
}
|