@mks2508/better-logger 0.14.0-alpha.2 → 0.18.2-alpha.2

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.
Files changed (472) hide show
  1. package/README.md +50 -244
  2. package/dist/Logger.d.ts +662 -202
  3. package/dist/Logger.d.ts.map +1 -1
  4. package/dist/ScopedLogger.d.ts +434 -175
  5. package/dist/ScopedLogger.d.ts.map +1 -1
  6. package/dist/chunks/HookBridge-C-AvXmPD.cjs +504 -0
  7. package/dist/chunks/HookBridge-C-AvXmPD.cjs.map +1 -0
  8. package/dist/chunks/HookBridge-CI2PH79S.js +487 -0
  9. package/dist/chunks/HookBridge-CI2PH79S.js.map +1 -0
  10. package/dist/chunks/LogContext-BaMXleWj.cjs +105 -0
  11. package/dist/chunks/LogContext-BaMXleWj.cjs.map +1 -0
  12. package/dist/chunks/LogContext-DjlITOzZ.js +100 -0
  13. package/dist/chunks/LogContext-DjlITOzZ.js.map +1 -0
  14. package/dist/chunks/SerializerBridge-Ba43Mk7j.js +393 -0
  15. package/dist/chunks/SerializerBridge-Ba43Mk7j.js.map +1 -0
  16. package/dist/chunks/SerializerBridge-C4a9Z37F.cjs +410 -0
  17. package/dist/chunks/SerializerBridge-C4a9Z37F.cjs.map +1 -0
  18. package/dist/chunks/StyleManager-DQ6UNRB-.cjs +118 -0
  19. package/dist/chunks/StyleManager-DQ6UNRB-.cjs.map +1 -0
  20. package/dist/chunks/StyleManager-DjwAYbxE.js +113 -0
  21. package/dist/chunks/StyleManager-DjwAYbxE.js.map +1 -0
  22. package/dist/chunks/core-Blfi2klP.js +31 -0
  23. package/dist/chunks/core-Blfi2klP.js.map +1 -0
  24. package/dist/chunks/core-CqS_UBzJ.cjs +36 -0
  25. package/dist/chunks/core-CqS_UBzJ.cjs.map +1 -0
  26. package/dist/chunks/environment-detector-7NvnYUfr.js +110 -0
  27. package/dist/chunks/environment-detector-7NvnYUfr.js.map +1 -0
  28. package/dist/chunks/environment-detector-D-tHkKWA.cjs +163 -0
  29. package/dist/chunks/environment-detector-D-tHkKWA.cjs.map +1 -0
  30. package/dist/chunks/server-fallback-CaCPjWby.cjs +119 -0
  31. package/dist/chunks/server-fallback-CaCPjWby.cjs.map +1 -0
  32. package/dist/chunks/server-fallback-jj0T6XaK.js +114 -0
  33. package/dist/chunks/server-fallback-jj0T6XaK.js.map +1 -0
  34. package/dist/chunks/spinner-BHyYEXsM.cjs +1029 -0
  35. package/dist/chunks/spinner-BHyYEXsM.cjs.map +1 -0
  36. package/dist/chunks/spinner-BtkwpzYv.js +982 -0
  37. package/dist/chunks/spinner-BtkwpzYv.js.map +1 -0
  38. package/dist/chunks/styling-CRw3KQW4.js +1592 -0
  39. package/dist/chunks/styling-CRw3KQW4.js.map +1 -0
  40. package/dist/chunks/styling-Cel2wPRy.cjs +1645 -0
  41. package/dist/chunks/styling-Cel2wPRy.cjs.map +1 -0
  42. package/dist/chunks/transports-BGfwwakw.js +1237 -0
  43. package/dist/chunks/transports-BGfwwakw.js.map +1 -0
  44. package/dist/chunks/transports-yK6CL0Ml.cjs +1278 -0
  45. package/dist/chunks/transports-yK6CL0Ml.cjs.map +1 -0
  46. package/dist/chunks/utils-W_cxqriN.cjs +705 -0
  47. package/dist/chunks/utils-W_cxqriN.cjs.map +1 -0
  48. package/dist/chunks/utils-tKfBAWUM.js +586 -0
  49. package/dist/chunks/utils-tKfBAWUM.js.map +1 -0
  50. package/dist/cli/CommandProcessor.d.ts +166 -19
  51. package/dist/cli/CommandProcessor.d.ts.map +1 -1
  52. package/dist/cli/commands/ConfigCommand.d.ts +36 -1
  53. package/dist/cli/commands/ConfigCommand.d.ts.map +1 -1
  54. package/dist/cli/commands/ExportCommand.d.ts +54 -26
  55. package/dist/cli/commands/ExportCommand.d.ts.map +1 -1
  56. package/dist/cli/commands/ThemeCommand.d.ts +62 -3
  57. package/dist/cli/commands/ThemeCommand.d.ts.map +1 -1
  58. package/dist/cli/help.d.ts +30 -2
  59. package/dist/cli/help.d.ts.map +1 -1
  60. package/dist/cli/index.d.ts +30 -4
  61. package/dist/cli/index.d.ts.map +1 -1
  62. package/dist/cli-module.d.ts +13 -0
  63. package/dist/cli-module.d.ts.map +1 -0
  64. package/dist/cli.cjs +11 -0
  65. package/dist/cli.js +3 -0
  66. package/dist/constants.d.ts +16 -47
  67. package/dist/constants.d.ts.map +1 -1
  68. package/dist/context/LogContext.d.ts +245 -0
  69. package/dist/context/LogContext.d.ts.map +1 -0
  70. package/dist/context/index.d.ts +6 -0
  71. package/dist/context/index.d.ts.map +1 -0
  72. package/dist/context-module.d.ts +6 -0
  73. package/dist/context-module.d.ts.map +1 -0
  74. package/dist/context.cjs +3 -0
  75. package/dist/context.js +2 -0
  76. package/dist/core.cjs +304 -2
  77. package/dist/core.cjs.map +1 -1
  78. package/dist/core.d.ts +56 -34
  79. package/dist/core.d.ts.map +1 -1
  80. package/dist/core.js +281 -314
  81. package/dist/core.js.map +1 -1
  82. package/dist/hooks/HookBridge.d.ts +32 -0
  83. package/dist/hooks/HookBridge.d.ts.map +1 -0
  84. package/dist/hooks/HookManager.d.ts +319 -0
  85. package/dist/hooks/HookManager.d.ts.map +1 -0
  86. package/dist/hooks/index.d.ts +7 -0
  87. package/dist/hooks/index.d.ts.map +1 -0
  88. package/dist/hooks-module.d.ts +7 -0
  89. package/dist/hooks-module.d.ts.map +1 -0
  90. package/dist/hooks.cjs +5 -0
  91. package/dist/hooks.js +2 -0
  92. package/dist/index.cjs +3402 -2
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.d.ts +42 -130
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +3327 -158
  97. package/dist/index.js.map +1 -1
  98. package/dist/node-module.d.ts +10 -0
  99. package/dist/node-module.d.ts.map +1 -0
  100. package/dist/node.cjs +13 -0
  101. package/dist/node.cjs.map +1 -0
  102. package/dist/node.js +12 -0
  103. package/dist/node.js.map +1 -0
  104. package/dist/playground/TerminalBridge.d.ts +53 -0
  105. package/dist/playground/TerminalBridge.d.ts.map +1 -0
  106. package/dist/playground/box.d.ts +45 -0
  107. package/dist/playground/box.d.ts.map +1 -0
  108. package/dist/playground/cli-table.d.ts +50 -0
  109. package/dist/playground/cli-table.d.ts.map +1 -0
  110. package/dist/playground/divider.d.ts +29 -0
  111. package/dist/playground/divider.d.ts.map +1 -0
  112. package/dist/playground/header.d.ts +28 -0
  113. package/dist/playground/header.d.ts.map +1 -0
  114. package/dist/playground/index.d.ts +11 -0
  115. package/dist/playground/index.d.ts.map +1 -0
  116. package/dist/playground/server-fallback.d.ts +114 -0
  117. package/dist/playground/server-fallback.d.ts.map +1 -0
  118. package/dist/playground/spinner.d.ts +197 -0
  119. package/dist/playground/spinner.d.ts.map +1 -0
  120. package/dist/playground/step.d.ts +33 -0
  121. package/dist/playground/step.d.ts.map +1 -0
  122. package/dist/playground-module.d.ts +11 -0
  123. package/dist/playground-module.d.ts.map +1 -0
  124. package/dist/playground.cjs +9 -0
  125. package/dist/playground.js +2 -0
  126. package/dist/serializers/SerializerBridge.d.ts +28 -0
  127. package/dist/serializers/SerializerBridge.d.ts.map +1 -0
  128. package/dist/serializers/SerializerRegistry.d.ts +252 -0
  129. package/dist/serializers/SerializerRegistry.d.ts.map +1 -0
  130. package/dist/serializers/index.d.ts +7 -0
  131. package/dist/serializers/index.d.ts.map +1 -0
  132. package/dist/serializers-module.d.ts +7 -0
  133. package/dist/serializers-module.d.ts.map +1 -0
  134. package/dist/serializers.cjs +5 -0
  135. package/dist/serializers.js +2 -0
  136. package/dist/styles/StyleManager.d.ts +190 -0
  137. package/dist/styles/StyleManager.d.ts.map +1 -0
  138. package/dist/styles/index.d.ts +7 -0
  139. package/dist/styles/index.d.ts.map +1 -0
  140. package/dist/styles-module.d.ts +7 -0
  141. package/dist/styles-module.d.ts.map +1 -0
  142. package/dist/styles.cjs +7 -0
  143. package/dist/styles.js +3 -0
  144. package/dist/styling/SmartPresets.d.ts +100 -6
  145. package/dist/styling/SmartPresets.d.ts.map +1 -1
  146. package/dist/styling/StyleBuilder.d.ts +453 -32
  147. package/dist/styling/StyleBuilder.d.ts.map +1 -1
  148. package/dist/styling/banners.d.ts +85 -5
  149. package/dist/styling/banners.d.ts.map +1 -1
  150. package/dist/styling/index.d.ts +8 -3
  151. package/dist/styling/index.d.ts.map +1 -1
  152. package/dist/styling/themes.d.ts +41 -2
  153. package/dist/styling/themes.d.ts.map +1 -1
  154. package/dist/terminal/color-converter.d.ts +73 -0
  155. package/dist/terminal/color-converter.d.ts.map +1 -0
  156. package/dist/terminal/formatter.d.ts +23 -0
  157. package/dist/terminal/formatter.d.ts.map +1 -0
  158. package/dist/transports/ConsoleTransport.d.ts +104 -0
  159. package/dist/transports/ConsoleTransport.d.ts.map +1 -0
  160. package/dist/transports/FileTransport.d.ts +137 -0
  161. package/dist/transports/FileTransport.d.ts.map +1 -0
  162. package/dist/transports/HttpTransport.d.ts +180 -0
  163. package/dist/transports/HttpTransport.d.ts.map +1 -0
  164. package/dist/transports/OtlpTransport.d.ts +165 -0
  165. package/dist/transports/OtlpTransport.d.ts.map +1 -0
  166. package/dist/transports/TransportBridge.d.ts +43 -0
  167. package/dist/transports/TransportBridge.d.ts.map +1 -0
  168. package/dist/transports/TransportManager.d.ts +251 -0
  169. package/dist/transports/TransportManager.d.ts.map +1 -0
  170. package/dist/transports/index.d.ts +6 -0
  171. package/dist/transports/index.d.ts.map +1 -0
  172. package/dist/transports-module.d.ts +10 -0
  173. package/dist/transports-module.d.ts.map +1 -0
  174. package/dist/transports.cjs +7 -0
  175. package/dist/transports.js +2 -0
  176. package/dist/types/core.d.ts +295 -17
  177. package/dist/types/core.d.ts.map +1 -1
  178. package/dist/types/handlers.d.ts +0 -67
  179. package/dist/types/handlers.d.ts.map +1 -1
  180. package/dist/types/hooks.d.ts +138 -0
  181. package/dist/types/hooks.d.ts.map +1 -0
  182. package/dist/types/index.d.ts +7 -3
  183. package/dist/types/index.d.ts.map +1 -1
  184. package/dist/types/serializers.d.ts +97 -0
  185. package/dist/types/serializers.d.ts.map +1 -0
  186. package/dist/types/transports.d.ts +132 -0
  187. package/dist/types/transports.d.ts.map +1 -0
  188. package/dist/utils/ansi-colors.d.ts +115 -0
  189. package/dist/utils/ansi-colors.d.ts.map +1 -0
  190. package/dist/utils/environment-detector.d.ts +53 -0
  191. package/dist/utils/environment-detector.d.ts.map +1 -0
  192. package/dist/utils/formatting.d.ts +9 -8
  193. package/dist/utils/formatting.d.ts.map +1 -1
  194. package/dist/utils/index.d.ts +3 -2
  195. package/dist/utils/index.d.ts.map +1 -1
  196. package/dist/utils/output.d.ts +14 -17
  197. package/dist/utils/output.d.ts.map +1 -1
  198. package/dist/utils/stackTrace.d.ts +2 -2
  199. package/dist/utils/stackTrace.d.ts.map +1 -1
  200. package/dist/utils/timestamps.d.ts +0 -12
  201. package/dist/utils/timestamps.d.ts.map +1 -1
  202. package/package.json +95 -21
  203. package/.claude/settings.local.json +0 -39
  204. package/.github/workflows/ci-quality.yml +0 -357
  205. package/.github/workflows/docs-demo.yml +0 -119
  206. package/.github/workflows/releases-core.yml +0 -512
  207. package/.github/workflows/releases-full.yml +0 -582
  208. package/.github/workflows-backup/ci.yml +0 -221
  209. package/.github/workflows-backup/nightly.yml +0 -196
  210. package/.github/workflows-backup/release-optimized.yml +0 -373
  211. package/.github/workflows-backup/release.yml +0 -269
  212. package/.release-notes-0.2.0.md +0 -129
  213. package/.yamllint +0 -28
  214. package/CHANGELOG.json +0 -865
  215. package/CLAUDE.md +0 -204
  216. package/bun.lock +0 -323
  217. package/demo.html +0 -847
  218. package/dist/.tsbuildinfo +0 -1
  219. package/dist/Logger.js +0 -1124
  220. package/dist/ScopedLogger.js +0 -426
  221. package/dist/chunks/Logger-Crw1woqR.js +0 -3464
  222. package/dist/chunks/Logger-Crw1woqR.js.map +0 -1
  223. package/dist/chunks/Logger-D_p3xnbq.js +0 -2
  224. package/dist/chunks/Logger-D_p3xnbq.js.map +0 -1
  225. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +0 -33
  226. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +0 -1
  227. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +0 -2
  228. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +0 -1
  229. package/dist/chunks/environment-Bxbnw4pd.js +0 -544
  230. package/dist/chunks/environment-Bxbnw4pd.js.map +0 -1
  231. package/dist/chunks/environment-Dm66zOML.js +0 -4
  232. package/dist/chunks/environment-Dm66zOML.js.map +0 -1
  233. package/dist/chunks/formatting-C0riPC5_.js +0 -95
  234. package/dist/chunks/formatting-C0riPC5_.js.map +0 -1
  235. package/dist/chunks/formatting-DNCAV66-.js +0 -2
  236. package/dist/chunks/formatting-DNCAV66-.js.map +0 -1
  237. package/dist/cli/CommandProcessor.js +0 -184
  238. package/dist/cli/commands/ConfigCommand.js +0 -88
  239. package/dist/cli/commands/ExportCommand.js +0 -243
  240. package/dist/cli/commands/HistoryCommand.d.ts +0 -50
  241. package/dist/cli/commands/HistoryCommand.d.ts.map +0 -1
  242. package/dist/cli/commands/HistoryCommand.js +0 -96
  243. package/dist/cli/commands/StatusCommand.d.ts +0 -33
  244. package/dist/cli/commands/StatusCommand.d.ts.map +0 -1
  245. package/dist/cli/commands/StatusCommand.js +0 -93
  246. package/dist/cli/commands/ThemeCommand.js +0 -79
  247. package/dist/cli/help.js +0 -118
  248. package/dist/cli/index.js +0 -46
  249. package/dist/constants.js +0 -159
  250. package/dist/example.d.ts +0 -18
  251. package/dist/example.d.ts.map +0 -1
  252. package/dist/example.js +0 -154
  253. package/dist/exports-module.d.ts +0 -203
  254. package/dist/exports-module.d.ts.map +0 -1
  255. package/dist/exports-module.js +0 -260
  256. package/dist/exports.cjs +0 -2
  257. package/dist/exports.cjs.map +0 -1
  258. package/dist/exports.js +0 -238
  259. package/dist/exports.js.map +0 -1
  260. package/dist/handlers/AnalyticsLogHandler.d.ts +0 -11
  261. package/dist/handlers/AnalyticsLogHandler.d.ts.map +0 -1
  262. package/dist/handlers/AnalyticsLogHandler.js +0 -19
  263. package/dist/handlers/ExportLogHandler.d.ts +0 -103
  264. package/dist/handlers/ExportLogHandler.d.ts.map +0 -1
  265. package/dist/handlers/ExportLogHandler.js +0 -516
  266. package/dist/handlers/FileLogHandler.d.ts +0 -36
  267. package/dist/handlers/FileLogHandler.d.ts.map +0 -1
  268. package/dist/handlers/FileLogHandler.js +0 -156
  269. package/dist/handlers/RemoteLogHandler.d.ts +0 -14
  270. package/dist/handlers/RemoteLogHandler.d.ts.map +0 -1
  271. package/dist/handlers/RemoteLogHandler.js +0 -37
  272. package/dist/handlers/index.d.ts +0 -8
  273. package/dist/handlers/index.d.ts.map +0 -1
  274. package/dist/handlers/index.js +0 -7
  275. package/dist/main.d.ts +0 -2
  276. package/dist/main.d.ts.map +0 -1
  277. package/dist/main.js +0 -139
  278. package/dist/styling/LogStyleBuilder.d.ts +0 -149
  279. package/dist/styling/LogStyleBuilder.d.ts.map +0 -1
  280. package/dist/styling/LogStyleBuilder.js +0 -289
  281. package/dist/styling/SemanticStyles.d.ts +0 -181
  282. package/dist/styling/SemanticStyles.d.ts.map +0 -1
  283. package/dist/styling/SemanticStyles.js +0 -339
  284. package/dist/styling/SmartPresets.js +0 -276
  285. package/dist/styling/StyleBuilder.js +0 -280
  286. package/dist/styling/banners.js +0 -155
  287. package/dist/styling/index.js +0 -9
  288. package/dist/styling/themes.js +0 -231
  289. package/dist/styling-module.d.ts +0 -185
  290. package/dist/styling-module.d.ts.map +0 -1
  291. package/dist/styling-module.js +0 -199
  292. package/dist/styling.cjs +0 -2
  293. package/dist/styling.cjs.map +0 -1
  294. package/dist/styling.js +0 -146
  295. package/dist/styling.js.map +0 -1
  296. package/dist/types/Logger.d.ts +0 -700
  297. package/dist/types/Logger.d.ts.map +0 -1
  298. package/dist/types/ScopedLogger.d.ts +0 -310
  299. package/dist/types/ScopedLogger.d.ts.map +0 -1
  300. package/dist/types/cli/CommandProcessor.d.ts +0 -100
  301. package/dist/types/cli/CommandProcessor.d.ts.map +0 -1
  302. package/dist/types/cli/commands/ConfigCommand.d.ts +0 -14
  303. package/dist/types/cli/commands/ConfigCommand.d.ts.map +0 -1
  304. package/dist/types/cli/commands/ExportCommand.d.ts +0 -48
  305. package/dist/types/cli/commands/ExportCommand.d.ts.map +0 -1
  306. package/dist/types/cli/commands/HistoryCommand.d.ts +0 -47
  307. package/dist/types/cli/commands/HistoryCommand.d.ts.map +0 -1
  308. package/dist/types/cli/commands/StatusCommand.d.ts +0 -30
  309. package/dist/types/cli/commands/StatusCommand.d.ts.map +0 -1
  310. package/dist/types/cli/commands/ThemeCommand.d.ts +0 -30
  311. package/dist/types/cli/commands/ThemeCommand.d.ts.map +0 -1
  312. package/dist/types/cli/help.d.ts +0 -12
  313. package/dist/types/cli/help.d.ts.map +0 -1
  314. package/dist/types/cli/index.d.ts +0 -15
  315. package/dist/types/cli/index.d.ts.map +0 -1
  316. package/dist/types/constants.d.ts +0 -119
  317. package/dist/types/constants.d.ts.map +0 -1
  318. package/dist/types/core.js +0 -28
  319. package/dist/types/example.d.ts +0 -18
  320. package/dist/types/example.d.ts.map +0 -1
  321. package/dist/types/exports-module.d.ts +0 -196
  322. package/dist/types/exports-module.d.ts.map +0 -1
  323. package/dist/types/handlers/AnalyticsLogHandler.d.ts +0 -8
  324. package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +0 -1
  325. package/dist/types/handlers/ExportLogHandler.d.ts +0 -100
  326. package/dist/types/handlers/ExportLogHandler.d.ts.map +0 -1
  327. package/dist/types/handlers/FileLogHandler.d.ts +0 -33
  328. package/dist/types/handlers/FileLogHandler.d.ts.map +0 -1
  329. package/dist/types/handlers/RemoteLogHandler.d.ts +0 -11
  330. package/dist/types/handlers/RemoteLogHandler.d.ts.map +0 -1
  331. package/dist/types/handlers/index.d.ts +0 -8
  332. package/dist/types/handlers/index.d.ts.map +0 -1
  333. package/dist/types/handlers.js +0 -4
  334. package/dist/types/index.js +0 -4
  335. package/dist/types/main.d.ts +0 -2
  336. package/dist/types/main.d.ts.map +0 -1
  337. package/dist/types/styling/LogStyleBuilder.d.ts +0 -146
  338. package/dist/types/styling/LogStyleBuilder.d.ts.map +0 -1
  339. package/dist/types/styling/SemanticStyles.d.ts +0 -178
  340. package/dist/types/styling/SemanticStyles.d.ts.map +0 -1
  341. package/dist/types/styling/SmartPresets.d.ts +0 -22
  342. package/dist/types/styling/SmartPresets.d.ts.map +0 -1
  343. package/dist/types/styling/StyleBuilder.d.ts +0 -140
  344. package/dist/types/styling/StyleBuilder.d.ts.map +0 -1
  345. package/dist/types/styling/banners.d.ts +0 -42
  346. package/dist/types/styling/banners.d.ts.map +0 -1
  347. package/dist/types/styling/index.d.ts +0 -10
  348. package/dist/types/styling/index.d.ts.map +0 -1
  349. package/dist/types/styling/themes.d.ts +0 -7
  350. package/dist/types/styling/themes.d.ts.map +0 -1
  351. package/dist/types/styling-module.d.ts +0 -178
  352. package/dist/types/styling-module.d.ts.map +0 -1
  353. package/dist/types/types/core.d.ts +0 -221
  354. package/dist/types/types/core.d.ts.map +0 -1
  355. package/dist/types/types/handlers.d.ts +0 -85
  356. package/dist/types/types/handlers.d.ts.map +0 -1
  357. package/dist/types/types/index.d.ts +0 -7
  358. package/dist/types/types/index.d.ts.map +0 -1
  359. package/dist/types/utils/environment.d.ts +0 -47
  360. package/dist/types/utils/environment.d.ts.map +0 -1
  361. package/dist/types/utils/formatting.d.ts +0 -37
  362. package/dist/types/utils/formatting.d.ts.map +0 -1
  363. package/dist/types/utils/index.d.ts +0 -7
  364. package/dist/types/utils/index.d.ts.map +0 -1
  365. package/dist/types/utils/opentui-detection.d.ts +0 -34
  366. package/dist/types/utils/opentui-detection.d.ts.map +0 -1
  367. package/dist/types/utils/output.d.ts +0 -41
  368. package/dist/types/utils/output.d.ts.map +0 -1
  369. package/dist/types/utils/stackTrace.d.ts +0 -6
  370. package/dist/types/utils/stackTrace.d.ts.map +0 -1
  371. package/dist/types/utils/timestamps.d.ts +0 -20
  372. package/dist/types/utils/timestamps.d.ts.map +0 -1
  373. package/dist/utils/environment.d.ts +0 -47
  374. package/dist/utils/environment.d.ts.map +0 -1
  375. package/dist/utils/environment.js +0 -85
  376. package/dist/utils/formatting.js +0 -117
  377. package/dist/utils/index.js +0 -6
  378. package/dist/utils/opentui-detection.d.ts +0 -34
  379. package/dist/utils/opentui-detection.d.ts.map +0 -1
  380. package/dist/utils/opentui-detection.js +0 -116
  381. package/dist/utils/output.js +0 -150
  382. package/dist/utils/stackTrace.js +0 -81
  383. package/dist/utils/timestamps.js +0 -71
  384. package/dist/vite.svg +0 -1
  385. package/docs/API.md +0 -691
  386. package/docs/CORE.md +0 -264
  387. package/docs/DEVELOPMENT.md +0 -731
  388. package/docs/EXPORTS.md +0 -467
  389. package/docs/PACKAGES.md +0 -244
  390. package/docs/STYLING.md +0 -405
  391. package/docs/_config.yml +0 -36
  392. package/docs/index.md +0 -179
  393. package/examples/README.md +0 -208
  394. package/examples/basic-logging.js +0 -75
  395. package/examples/data-export.js +0 -234
  396. package/examples/package.json +0 -16
  397. package/examples/performance-timing.js +0 -170
  398. package/examples/simplified-api.js +0 -124
  399. package/examples/styling-themes.js +0 -207
  400. package/index.html +0 -358
  401. package/packages/core/package.json +0 -57
  402. package/packages/exports/package.json +0 -41
  403. package/packages/nodejs-opentui/README.md +0 -232
  404. package/packages/nodejs-opentui/package.json +0 -72
  405. package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
  406. package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
  407. package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
  408. package/packages/nodejs-opentui/src/index.ts +0 -133
  409. package/packages/nodejs-opentui/src/types.ts +0 -158
  410. package/packages/nodejs-opentui/tsconfig.json +0 -20
  411. package/packages/styling/package.json +0 -41
  412. package/project-utils/README.md +0 -172
  413. package/project-utils/auto-release-gemini.ts +0 -1193
  414. package/project-utils/auto-release-ui.ts +0 -1329
  415. package/project-utils/commit-generator.ts +0 -1385
  416. package/project-utils/commit-ui.ts +0 -264
  417. package/project-utils/git-utils.ts +0 -199
  418. package/project-utils/github-release-manager.ts +0 -466
  419. package/project-utils/project-config.ts +0 -260
  420. package/project-utils/prompt-templates.js +0 -345
  421. package/project-utils/prompt-templates.ts +0 -422
  422. package/project-utils/version-manager.ts +0 -1078
  423. package/public/vite.svg +0 -1
  424. package/src/Logger.ts +0 -1276
  425. package/src/ScopedLogger.ts +0 -454
  426. package/src/cli/CommandProcessor.ts +0 -248
  427. package/src/cli/commands/ConfigCommand.ts +0 -93
  428. package/src/cli/commands/ExportCommand.ts +0 -276
  429. package/src/cli/commands/HistoryCommand.ts +0 -117
  430. package/src/cli/commands/StatusCommand.ts +0 -112
  431. package/src/cli/commands/ThemeCommand.ts +0 -88
  432. package/src/cli/help.ts +0 -127
  433. package/src/cli/index.ts +0 -71
  434. package/src/constants.ts +0 -171
  435. package/src/core.ts +0 -393
  436. package/src/example.ts +0 -210
  437. package/src/exports-module.ts +0 -311
  438. package/src/handlers/AnalyticsLogHandler.ts +0 -22
  439. package/src/handlers/ExportLogHandler.ts +0 -609
  440. package/src/handlers/FileLogHandler.ts +0 -169
  441. package/src/handlers/RemoteLogHandler.ts +0 -42
  442. package/src/handlers/index.ts +0 -8
  443. package/src/index.ts +0 -209
  444. package/src/main.ts +0 -196
  445. package/src/style.css +0 -96
  446. package/src/styling/LogStyleBuilder.ts +0 -355
  447. package/src/styling/SemanticStyles.ts +0 -380
  448. package/src/styling/SmartPresets.ts +0 -288
  449. package/src/styling/StyleBuilder.ts +0 -319
  450. package/src/styling/banners.ts +0 -168
  451. package/src/styling/index.ts +0 -27
  452. package/src/styling/themes.ts +0 -235
  453. package/src/styling-module.ts +0 -244
  454. package/src/types/core.ts +0 -236
  455. package/src/types/handlers.ts +0 -95
  456. package/src/types/index.ts +0 -35
  457. package/src/typescript.svg +0 -1
  458. package/src/utils/environment.ts +0 -94
  459. package/src/utils/formatting.ts +0 -142
  460. package/src/utils/index.ts +0 -21
  461. package/src/utils/opentui-detection.ts +0 -138
  462. package/src/utils/output.ts +0 -185
  463. package/src/utils/stackTrace.ts +0 -95
  464. package/src/utils/timestamps.ts +0 -80
  465. package/src/vite-env.d.ts +0 -1
  466. package/test-core-browser.html +0 -237
  467. package/test-core-node.js +0 -63
  468. package/tests/test-conflict-resolution.ts +0 -391
  469. package/tests/validate-workflows.sh +0 -131
  470. package/tests/yaml-autofix.sh +0 -146
  471. package/tsconfig.json +0 -50
  472. package/vite.config.ts +0 -223
@@ -0,0 +1,1645 @@
1
+ //#region src/styling/StyleBuilder.ts
2
+ /**
3
+ * @fileoverview StyleBuilder — constructor fluido de estilos CSS para
4
+ * `%c`-formatting del console. Basis de todos los gradientes, badges,
5
+ * presets y estilos por nivel del logger.
6
+ */
7
+ /**
8
+ * Constructor fluido de estilos CSS orientado al `%c`-formatting del
9
+ * DevTools console.
10
+ *
11
+ * Cada método empuja una declaración CSS a un buffer interno y retorna
12
+ * `this`, lo que permite encadenar llamadas para componer un estilo
13
+ * completo en una sola expresión. El string final se materializa con
14
+ * {@link StyleBuilder.build}, que une todas las declaraciones con `"; "`
15
+ * — exactamente el formato que espera `console.log("%c...", style)`.
16
+ *
17
+ * Está pensado como bloque base de la capa de styling del logger: los
18
+ * {@link StylePresets} se construyen con esta clase, y el proxy exportado
19
+ * `$` no es más que una instancia fresca expuesta vía `Proxy` para
20
+ * usarse ad-hoc sin instanciar manualmente.
21
+ *
22
+ * @example
23
+ * // Estilo inline para un solo log
24
+ * const banner = new StyleBuilder()
25
+ * .bg('linear-gradient(135deg, #667eea 0%, #764ba2 100%)')
26
+ * .color('#ffffff')
27
+ * .padding('4px 8px')
28
+ * .rounded('4px')
29
+ * .bold()
30
+ * .build();
31
+ * console.log('%c MiApp ', banner);
32
+ *
33
+ * @example
34
+ * // Clonar + variar sin mutar el builder original (útil para
35
+ * // compartir una base entre variantes de badge)
36
+ * const base = new StyleBuilder().padding('2px 6px').rounded('3px');
37
+ * const ok = base.clone().color('#00b894').build();
38
+ * const warn = base.clone().color('#fdcb6e').build();
39
+ *
40
+ * @see {@link StylePresets} para presets listos (success, error, warning, ...).
41
+ * @see {@link $} para el proxy global reutilizable sin instanciar.
42
+ */
43
+ var StyleBuilder = class StyleBuilder {
44
+ styles = [];
45
+ /**
46
+ * Crea un builder opcionalmente inicializado con una declaración CSS
47
+ * base (p.ej. un fragmento de estilo compartido del que arrancar).
48
+ *
49
+ * @param {string} [baseStyle] - Declaración CSS inicial en formato
50
+ * `"prop: value"`. Si se omite, el builder arranca vacío y se rellena
51
+ * vía los métodos chainable.
52
+ *
53
+ * @example
54
+ * const sb = new StyleBuilder('color: #333');
55
+ * sb.bg('#eee').build(); // => "color: #333; background: #eee"
56
+ */
57
+ constructor(baseStyle = "") {
58
+ if (baseStyle) this.styles.push(baseStyle);
59
+ }
60
+ /**
61
+ * Define el `background` del estilo. Acepta tanto colores planos
62
+ * (`#1e1e1e`) como gradientes CSS completos (`linear-gradient(...)`),
63
+ * que es lo que da el efecto "badge con color" característico del
64
+ * logger por nivel.
65
+ *
66
+ * @param {string} background - Valor crudo para la propiedad CSS
67
+ * `background` (color, gradiente o shorthand).
68
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
69
+ *
70
+ * @example
71
+ * new StyleBuilder().bg('linear-gradient(135deg, #00b894, #00a085)');
72
+ */
73
+ bg(background) {
74
+ this.styles.push(`background: ${background}`);
75
+ return this;
76
+ }
77
+ /**
78
+ * Define el `color` (color del texto). Es el principal contraste
79
+ * contra el `background`: en badges con gradiente se suele usar
80
+ * `#ffffff`, mientras que en logs "muted" se rebaja la opacidad o
81
+ * se usa un gris (`#6c757d`).
82
+ *
83
+ * @param {string} color - Valor CSS de color (hex, rgb, named, ...).
84
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
85
+ *
86
+ * @example
87
+ * new StyleBuilder().bg('#1e1e1e').color('#00ffff');
88
+ */
89
+ color(color) {
90
+ this.styles.push(`color: ${color}`);
91
+ return this;
92
+ }
93
+ /**
94
+ * Define el shorthand `border`. Útil para tags tipo "outline" sobre
95
+ * fondos neutros (ver preset `accent`) donde un borde sutil
96
+ * (`1px solid #dee2e6`) separa el badge del contenido sin saturar.
97
+ *
98
+ * @param {string} border - Shorthand CSS `border` completo
99
+ * (`"1px solid #dee2e6"`, `"2px dashed #e84393"`, ...).
100
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
101
+ *
102
+ * @example
103
+ * new StyleBuilder().border('1px solid #dee2e6').padding('2px 6px');
104
+ */
105
+ border(border) {
106
+ this.styles.push(`border: ${border}`);
107
+ return this;
108
+ }
109
+ /**
110
+ * Define el `box-shadow`. Se usa sobre todo para efectos neón o de
111
+ * glow (preset `neon`), donde una sombra con alfa baja
112
+ * (`0 0 10px rgba(0,255,255,0.5)`) genera el halo alrededor del
113
+ * badge sin necesidad de animaciones.
114
+ *
115
+ * @param {string} shadow - Shorthand CSS `box-shadow`.
116
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
117
+ *
118
+ * @example
119
+ * new StyleBuilder().shadow('0 0 10px rgba(0, 255, 255, 0.5)');
120
+ */
121
+ shadow(shadow) {
122
+ this.styles.push(`box-shadow: ${shadow}`);
123
+ return this;
124
+ }
125
+ /**
126
+ * Define el `padding` interno del badge. El valor típico en los
127
+ * presets del logger es `'4px 8px'` (vertical/horizontal), lo justo
128
+ * para que el texto respire sin engordar demasiado la línea de log.
129
+ *
130
+ * @param {string} padding - Shorthand CSS `padding`.
131
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
132
+ *
133
+ * @example
134
+ * new StyleBuilder().padding('4px 8px').rounded('4px');
135
+ */
136
+ padding(padding) {
137
+ this.styles.push(`padding: ${padding}`);
138
+ return this;
139
+ }
140
+ /**
141
+ * Define el `margin` externo. Rara vez se usa en estilos de console
142
+ * (el flujo del DevTools no respeta margin igual que el DOM), pero
143
+ * queda expuesto para casos donde se quiera separar visualmente un
144
+ * bloque de logs contiguos.
145
+ *
146
+ * @param {string} margin - Shorthand CSS `margin`.
147
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
148
+ *
149
+ * @example
150
+ * new StyleBuilder().margin('0 0 4px 0');
151
+ */
152
+ margin(margin) {
153
+ this.styles.push(`margin: ${margin}`);
154
+ return this;
155
+ }
156
+ /**
157
+ * Define el `border-radius`. Redondea las esquinas del badge para
158
+ * darle acabado de "pill" / "chip" en lugar de bloque recto.
159
+ *
160
+ * @param {string} [radius='4px'] - Valor CSS de `border-radius`.
161
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
162
+ *
163
+ * @example
164
+ * new StyleBuilder().rounded('999px'); // pill completo
165
+ */
166
+ rounded(radius = "4px") {
167
+ this.styles.push(`border-radius: ${radius}`);
168
+ return this;
169
+ }
170
+ /**
171
+ * Aplica `font-weight: bold`. Marca el texto del badge como enfatizado:
172
+ * los presets por nivel (`success`, `error`, ...) lo incluyen para que
173
+ * el severity destaque sobre el resto de la línea de log.
174
+ *
175
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
176
+ *
177
+ * @example
178
+ * new StyleBuilder().bg('#e84393').color('#fff').bold();
179
+ */
180
+ bold() {
181
+ this.styles.push("font-weight: bold");
182
+ return this;
183
+ }
184
+ /**
185
+ * Define el `font-family`. Recibe el stack completo (coma-incluido)
186
+ * tal cual se inyecta en CSS. Para stacks ya probados en DevTools,
187
+ * preferir los atajos {@link StyleBuilder.mono} y
188
+ * {@link StyleBuilder.system} en lugar de escribir el stack a mano.
189
+ *
190
+ * @param {string} font - Stack de `font-family` CSS.
191
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
192
+ *
193
+ * @example
194
+ * new StyleBuilder().font('"JetBrains Mono", monospace');
195
+ */
196
+ font(font) {
197
+ this.styles.push(`font-family: ${font}`);
198
+ return this;
199
+ }
200
+ /**
201
+ * Atajo de {@link StyleBuilder.font} con un stack monospace portable
202
+ * (`Monaco, Consolas, "Courier New", monospace`). Es el stack que usa
203
+ * el preset `muted` para logs de detalle/auxiliares, donde la
204
+ * alineación monoespaciada ayuda a escanear tablas y pares k=v.
205
+ *
206
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
207
+ *
208
+ * @example
209
+ * new StyleBuilder().mono().size('12px').color('#6c757d');
210
+ */
211
+ mono() {
212
+ return this.font("Monaco, Consolas, \"Courier New\", monospace");
213
+ }
214
+ /**
215
+ * Atajo de {@link StyleBuilder.font} con el stack "system-ui" nativo
216
+ * del SO del usuario. Útil cuando se quiere que el log se integre
217
+ * visualmente con la UI nativa en lugar de marcar como "técnico".
218
+ *
219
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
220
+ *
221
+ * @example
222
+ * new StyleBuilder().system().size('14px');
223
+ */
224
+ system() {
225
+ return this.font("system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif");
226
+ }
227
+ /**
228
+ * Define el `font-size`. El valor por defecto del DevTools suele ser
229
+ * suficiente; este método se usa para logs auxiliares (preset `muted`
230
+ * baja a `12px`) o para encabezados tipo banner donde se sube a
231
+ * `18px`-`24px`.
232
+ *
233
+ * @param {string} size - Valor CSS de `font-size` (`'12px'`, `'1.1em'`).
234
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
235
+ *
236
+ * @example
237
+ * new StyleBuilder().size('20px').bold();
238
+ */
239
+ size(size) {
240
+ this.styles.push(`font-size: ${size}`);
241
+ return this;
242
+ }
243
+ /**
244
+ * Define el `line-height`. Aplicable cuando un badge envuelve varias
245
+ * líneas o cuando se quiere controlar la altura visual del bloque de
246
+ * log para que no "salte" respecto al texto adyacente.
247
+ *
248
+ * @param {string} height - Valor CSS de `line-height` (`'1.4'`, `'20px'`).
249
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
250
+ *
251
+ * @example
252
+ * new StyleBuilder().lineHeight('1.5').padding('8px');
253
+ */
254
+ lineHeight(height) {
255
+ this.styles.push(`line-height: ${height}`);
256
+ return this;
257
+ }
258
+ /**
259
+ * Aplica `text-decoration: underline`. Útil para resaltar un token
260
+ * concreto dentro del mensaje (p.ej. un ID o un path) cuando el
261
+ * `color` por sí solo no basta para marcar jerarquía visual.
262
+ *
263
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
264
+ *
265
+ * @example
266
+ * new StyleBuilder().underline().color('#0984e3');
267
+ */
268
+ underline() {
269
+ this.styles.push("text-decoration: underline");
270
+ return this;
271
+ }
272
+ /**
273
+ * Aplica `text-transform: uppercase`. Convierte el texto a mayúsculas
274
+ * sin mutar el string original: ideal para tags cortos como severity
275
+ * (`INFO`, `WARN`) o siglas que conviene leer en bloque.
276
+ *
277
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
278
+ *
279
+ * @example
280
+ * new StyleBuilder().uppercase().bold().padding('2px 6px');
281
+ */
282
+ uppercase() {
283
+ this.styles.push("text-transform: uppercase");
284
+ return this;
285
+ }
286
+ /**
287
+ * Define la `opacity` global del estilo (0 a 1). Es el mecanismo
288
+ * recomendado para "apagar" un log sin tener que oscurecer el color
289
+ * a mano: sobre fondo oscuro, bajar opacity a `0.6` da el efecto
290
+ * muted sin perder legibilidad del hue.
291
+ *
292
+ * @param {number} value - Valor de opacidad entre `0` (invisible) y
293
+ * `1` (opaco).
294
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
295
+ *
296
+ * @example
297
+ * new StyleBuilder().opacity(0.5).color('#999');
298
+ */
299
+ opacity(value) {
300
+ this.styles.push(`opacity: ${value}`);
301
+ return this;
302
+ }
303
+ /**
304
+ * Define la propiedad `display`. Expuesta por completitud: en la
305
+ * mayoría de estilos de console el `display` del badge es controlado
306
+ * por el propio DevTools y este setter no tiene efecto visible, pero
307
+ * queda disponible para casos de render en contenedores DOM reales
308
+ * (preview components, overlays de playground).
309
+ *
310
+ * @param {string} value - Valor CSS de `display` (`'inline-block'`,
311
+ * `'flex'`, ...).
312
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
313
+ *
314
+ * @example
315
+ * new StyleBuilder().display('inline-block').padding('4px 8px');
316
+ */
317
+ display(value) {
318
+ this.styles.push(`display: ${value}`);
319
+ return this;
320
+ }
321
+ /**
322
+ * Define la propiedad `position`. Mismo alcance que
323
+ * {@link StyleBuilder.display}: no afecta al flujo normal del
324
+ * DevTools console, pero queda disponible para estilos que se
325
+ * reutilizan fuera del console (playground DOM, tests visuales).
326
+ *
327
+ * @param {string} value - Valor CSS de `position` (`'relative'`,
328
+ * `'absolute'`, ...).
329
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
330
+ *
331
+ * @example
332
+ * new StyleBuilder().position('relative').display('inline-block');
333
+ */
334
+ position(value) {
335
+ this.styles.push(`position: ${value}`);
336
+ return this;
337
+ }
338
+ /**
339
+ * Define la propiedad `transform`. Permite aplicar traslaciones,
340
+ * escalados o rotaciones al estilo. Útil en el playground DOM para
341
+ * micro-interacciones (hover scale, énfasis de banner); en el console
342
+ * crudo el soporte varía según navegador.
343
+ *
344
+ * @param {string} value - Valor CSS de `transform` (`'scale(1.1)'`,
345
+ * `'translateY(-2px)'`, ...).
346
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
347
+ *
348
+ * @example
349
+ * new StyleBuilder().transform('scale(1.05)');
350
+ */
351
+ transform(value) {
352
+ this.styles.push(`transform: ${value}`);
353
+ return this;
354
+ }
355
+ /**
356
+ * Define la propiedad `animation`. Aplica keyframes definidos en el
357
+ * contexto de render; en el DevTools console el soporte de animaciones
358
+ * es limitado y solo se materializa en el playground DOM o en
359
+ * overlays HTML, no en el flujo plano de logs.
360
+ *
361
+ * @param {string} value - Shorthand CSS `animation`.
362
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
363
+ *
364
+ * @example
365
+ * new StyleBuilder().animation('pulse 1s ease-in-out infinite');
366
+ */
367
+ animation(value) {
368
+ this.styles.push(`animation: ${value}`);
369
+ return this;
370
+ }
371
+ /**
372
+ * Define la propiedad `transition`. Mismo alcance que
373
+ * {@link StyleBuilder.animation}: pensado para el playground DOM,
374
+ * donde los estilos del logger se reutilizan en elementos que sí
375
+ * soportan transiciones (hover, focus, state changes).
376
+ *
377
+ * @param {string} value - Shorthand CSS `transition`.
378
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
379
+ *
380
+ * @example
381
+ * new StyleBuilder().transition('background 200ms ease');
382
+ */
383
+ transition(value) {
384
+ this.styles.push(`transition: ${value}`);
385
+ return this;
386
+ }
387
+ /**
388
+ * Define la propiedad `cursor`. Aplicable cuando el estilo se reutiliza
389
+ * en elementos interactivos del playground (chips clicables, badges con
390
+ * tooltip) donde se quiere sugerir affordance de click.
391
+ *
392
+ * @param {string} value - Valor CSS de `cursor` (`'pointer'`,
393
+ * `'help'`, ...).
394
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
395
+ *
396
+ * @example
397
+ * new StyleBuilder().cursor('pointer').rounded('4px');
398
+ */
399
+ cursor(value) {
400
+ this.styles.push(`cursor: ${value}`);
401
+ return this;
402
+ }
403
+ /**
404
+ * Escape hatch para cualquier propiedad CSS que no tenga método
405
+ * dedicado. Empuja la declaración `property: value` tal cual al
406
+ * buffer, sin validación — útil para props modernas
407
+ * (`backdrop-filter`, `clip-path`, `text-shadow`) o vendor prefixes.
408
+ *
409
+ * @param {string} property - Nombre de la propiedad CSS.
410
+ * @param {string} value - Valor crudo de la propiedad.
411
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
412
+ *
413
+ * @example
414
+ * new StyleBuilder().custom('backdrop-filter', 'blur(8px)');
415
+ */
416
+ custom(property, value) {
417
+ this.styles.push(`${property}: ${value}`);
418
+ return this;
419
+ }
420
+ /**
421
+ * Alias de {@link StyleBuilder.custom}. Mismo comportamiento exacto,
422
+ * expuesto solo porque `css(prop, val)` lee mejor como DSL inline
423
+ * cuando se está encadenando mucho.
424
+ *
425
+ * @param {string} property - Nombre de la propiedad CSS.
426
+ * @param {string} value - Valor crudo de la propiedad.
427
+ * @returns {StyleBuilder} `this` para encadenar más reglas.
428
+ *
429
+ * @example
430
+ * new StyleBuilder().css('letter-spacing', '0.5px');
431
+ */
432
+ css(property, value) {
433
+ return this.custom(property, value);
434
+ }
435
+ /**
436
+ * Materializa el string CSS final uniendo todas las declaraciones
437
+ * acumuladas con `"; "`. Es el formato exacto que espera el segundo
438
+ * argumento de `console.log("%c…", style)` — el resultado se puede
439
+ * pasar directo al logger o al DevTools.
440
+ *
441
+ * @returns {string} String CSS listo para `%c`-formatting.
442
+ *
443
+ * @example
444
+ * const css = new StyleBuilder().bg('#000').color('#0ff').build();
445
+ * console.log('%c DEBUG ', css);
446
+ */
447
+ build() {
448
+ return this.styles.join("; ");
449
+ }
450
+ /**
451
+ * Vacía el buffer de estilos y reinicia el builder al estado inicial.
452
+ * Útil cuando se reutiliza la misma instancia en un bucle para
453
+ * generar variantes (p.ej. render de N badges con estilo derivado)
454
+ * sin pagar el costo de instanciar un builder nuevo en cada pasada.
455
+ *
456
+ * @returns {StyleBuilder} `this` ya vaciado, listo para reutilizar.
457
+ *
458
+ * @example
459
+ * const sb = new StyleBuilder();
460
+ * for (const lvl of ['info', 'warn', 'error']) {
461
+ * sb.clear().bg(COLORS[lvl]).color('#fff').build();
462
+ * }
463
+ */
464
+ clear() {
465
+ this.styles = [];
466
+ return this;
467
+ }
468
+ /**
469
+ * Devuelve una copia independiente del builder con los mismos estilos
470
+ * acumulados. La clave para variar un estilo base sin mutar el
471
+ * original: el clone comparte las declaraciones hasta el momento del
472
+ * `clone()`, pero a partir de ahí cada uno acumula por su lado.
473
+ *
474
+ * @returns {StyleBuilder} Nuevo builder con el mismo buffer de estilos.
475
+ *
476
+ * @example
477
+ * const base = new StyleBuilder().padding('2px 6px').rounded('3px');
478
+ * const ok = base.clone().color('#00b894').build();
479
+ * const err = base.clone().color('#e84393').build();
480
+ */
481
+ clone() {
482
+ const cloned = new StyleBuilder();
483
+ cloned.styles = [...this.styles];
484
+ return cloned;
485
+ }
486
+ /**
487
+ * Anexa las declaraciones de otro builder al final del buffer actual.
488
+ * Útil para componer un estilo a partir de capas (p.ej. base común +
489
+ * override por tema) sin perder la trazabilidad de quién aportó qué.
490
+ *
491
+ * No deduplica: si ambos builders setean `color`, el resultado tendrá
492
+ * dos declaraciones y el navegador se queda con la última.
493
+ *
494
+ * @param {StyleBuilder} other - Builder cuyas declaraciones se anexan.
495
+ * @returns {StyleBuilder} `this` con los estilos mergueados.
496
+ *
497
+ * @example
498
+ * const base = new StyleBuilder().padding('4px 8px');
499
+ * const theme = new StyleBuilder().bg('#222').color('#eee');
500
+ * base.merge(theme).build();
501
+ */
502
+ merge(other) {
503
+ this.styles.push(...other.styles);
504
+ return this;
505
+ }
506
+ };
507
+ /**
508
+ * Construye el `Proxy` que envuelve un {@link StyleBuilder} fresco para
509
+ * exponer una instancia "always-on" sin necesidad de instanciar la clase
510
+ * a mano. El handler bindea cada método al builder interno al primer
511
+ * acceso, de forma que las llamadas encadenadas (`$.bg(...).color(...)`)
512
+ * operan sobre la misma instancia subyacente.
513
+ *
514
+ * @internal Helper del proxy exportado {@link $}; no es API pública.
515
+ * @returns Instancia proxy sobre un `StyleBuilder`.
516
+ */
517
+ function createStyler() {
518
+ const builder = new StyleBuilder();
519
+ return new Proxy(builder, { get(target, prop) {
520
+ if (prop in target) {
521
+ const method = target[prop];
522
+ if (typeof method === "function") return method.bind(target);
523
+ return method;
524
+ }
525
+ } });
526
+ }
527
+ createStyler();
528
+ /**
529
+ * Catálogo de factories de estilos pre-armados para los casos de uso más
530
+ * comunes en logging: un preset por severity (`success`/`error`/`warning`/
531
+ * `info`/`debug`), uno para texto secundario (`muted`), uno para tags
532
+ * neutros (`accent`) y uno decorativo (`neon`).
533
+ *
534
+ * Cada preset es una función zero-arg que devuelve un {@link StyleBuilder}
535
+ * nuevo, ya configurado y listo para `.build()` o para extender con más
536
+ * reglas antes del build. El patrón factory evita compartir estado entre
537
+ * llamadas: cada invocación es independiente.
538
+ *
539
+ * @example
540
+ * // Usar un preset tal cual
541
+ * console.log('%c OK ', StylePresets.success().build());
542
+ *
543
+ * @example
544
+ * // Extender un preset con reglas extra antes de materializar
545
+ * const css = StylePresets.info()
546
+ * .custom('text-shadow', '0 1px 0 rgba(0,0,0,0.3)')
547
+ * .build();
548
+ *
549
+ * @see {@link StyleBuilder} para la API completa de reglas encadenables.
550
+ */
551
+ const StylePresets = {
552
+ /**
553
+ * Preset para severity "success" (operación completada OK). Gradiente
554
+ * verde → verde oscuro, texto blanco, badge con padding/bold/radius
555
+ * estándar.
556
+ *
557
+ * @returns {StyleBuilder} Estilo verde de éxito.
558
+ *
559
+ * @example
560
+ * console.log('%c LOGIN OK ', StylePresets.success().build());
561
+ */
562
+ success: () => new StyleBuilder().bg("linear-gradient(135deg, #00b894 0%, #00a085 100%)").color("#ffffff").padding("4px 8px").rounded("4px").bold(),
563
+ /**
564
+ * Preset para severity "error" (fallo que requiere atención). Gradiente
565
+ * rosa → rojo intenso, texto blanco, badge bold para destacar sobre
566
+ * el resto de la línea.
567
+ *
568
+ * @returns {StyleBuilder} Estilo rojo de error.
569
+ *
570
+ * @example
571
+ * console.log('%c DB DOWN ', StylePresets.error().build());
572
+ */
573
+ error: () => new StyleBuilder().bg("linear-gradient(135deg, #e84393 0%, #d63031 100%)").color("#ffffff").padding("4px 8px").rounded("4px").bold(),
574
+ /**
575
+ * Preset para severity "warning" (situación recuperable pero a vigilar).
576
+ * Gradiente ámbar → naranja cálido, texto oscuro (`#2d3436`) para
577
+ * mantener contraste sobre fondo claro.
578
+ *
579
+ * @returns {StyleBuilder} Estilo ámbar de advertencia.
580
+ *
581
+ * @example
582
+ * console.log('%c RATE LIMIT ', StylePresets.warning().build());
583
+ */
584
+ warning: () => new StyleBuilder().bg("linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)").color("#2d3436").padding("4px 8px").rounded("4px").bold(),
585
+ /**
586
+ * Preset para severity "info" (mensaje informativo, flujo normal).
587
+ * Gradiente azul claro → azul medio, texto blanco, badge estándar.
588
+ *
589
+ * @returns {StyleBuilder} Estilo azul informativo.
590
+ *
591
+ * @example
592
+ * console.log('%c USER LOGIN ', StylePresets.info().build());
593
+ */
594
+ info: () => new StyleBuilder().bg("linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)").color("#ffffff").padding("4px 8px").rounded("4px").bold(),
595
+ /**
596
+ * Preset para severity "debug" (traza de diagnóstico, normalmente
597
+ * oculta en producción). Gradiente índigo → púrpura, distinto del
598
+ * azul de `info` para que se distinga visualmente.
599
+ *
600
+ * @returns {StyleBuilder} Estilo púrpura de debug.
601
+ *
602
+ * @example
603
+ * console.log('%c CACHE MISS ', StylePresets.debug().build());
604
+ */
605
+ debug: () => new StyleBuilder().bg("linear-gradient(135deg, #667eea 0%, #764ba2 100%)").color("#ffffff").padding("4px 8px").rounded("4px").bold(),
606
+ /**
607
+ * Preset para texto secundario (timestamps, metadatos, contexto
608
+ * auxiliar). Sin fondo, color gris y font monospace pequeño (`12px`):
609
+ * pensado para que el ojo lo lea como "de apoyo" y no compita con el
610
+ * severity principal.
611
+ *
612
+ * @returns {StyleBuilder} Estilo gris monoespaciado y reducido.
613
+ *
614
+ * @example
615
+ * console.log('%c 2026-01-01T12:00:00Z ', StylePresets.muted().build());
616
+ */
617
+ muted: () => new StyleBuilder().color("#6c757d").font("Monaco, Consolas, monospace").size("12px"),
618
+ /**
619
+ * Preset para tags neutros sobre fondo claro (categorías, IDs, labels
620
+ * que no son severity). Fondo gris muy claro, texto gris medio, borde
621
+ * sutil y padding más ajustado que los presets de severity para que
622
+ * conviva visualmente con ellos.
623
+ *
624
+ * @returns {StyleBuilder} Estilo "chip" neutro con borde.
625
+ *
626
+ * @example
627
+ * console.log('%c svc:auth ', StylePresets.accent().build());
628
+ */
629
+ accent: () => new StyleBuilder().bg("#f8f9fa").color("#495057").padding("2px 6px").rounded("3px").border("1px solid #dee2e6"),
630
+ /**
631
+ * Preset decorativo neón (gradiente azul oscuro → rojo coral con halo
632
+ * cyan). Pensado para banners o highlights puntuales que quieren llamar
633
+ * la atención por estética, no por severity. El `box-shadow` con alfa
634
+ * baja genera el glow característico.
635
+ *
636
+ * @returns {StyleBuilder} Estilo neón con sombra glow.
637
+ *
638
+ * @example
639
+ * console.log('%c ★ BANNER ★ ', StylePresets.neon().build());
640
+ */
641
+ neon: () => new StyleBuilder().bg("linear-gradient(135deg, #0f3460 0%, #e94560 100%)").color("#00ffff").padding("4px 8px").rounded("4px").bold().shadow("0 0 10px rgba(0, 255, 255, 0.5)")
642
+ };
643
+ //#endregion
644
+ //#region src/styling/themes.ts
645
+ /**
646
+ * Catálogo de themes visuales para los badges de cada log level.
647
+ *
648
+ * Cada {@link ThemeVariant} mapea a un record de {@link LevelStyleConfig}
649
+ * indexado por nivel (`debug`, `info`, `warn`, `error`, `success`,
650
+ * `critical`). El {@link StyleManager} consume este mappeo para resolver
651
+ * los estilos CSS del badge que rodea al label del nivel en la consola
652
+ * del navegador.
653
+ *
654
+ * Un {@link LevelStyleConfig} por nivel define seis campos visuales:
655
+ * - `emoji` — glyph que precede al label (vacío en themes minimal).
656
+ * - `label` — texto en mayúsculas renderizado dentro del badge.
657
+ * - `background` — CSS background (típicamente un `linear-gradient`).
658
+ * - `color` — color del texto interior del badge.
659
+ * - `border` — CSS border completo (`<width> <style> <color>`).
660
+ * - `shadow` — box-shadow alrededor del badge; `'none'` lo desactiva.
661
+ *
662
+ * Themes disponibles: `default` (gradientes vivos), `dark` (paleta oscura
663
+ * para DevTools oscuro), `neon` (glow neón sobre fondo oscuro), `minimal`
664
+ * (badges planos sin sombras ni emojis), `light` (paleta pastel para
665
+ * DevTools claro) y `cyberpunk` (cian/magenta con sombras extendidas).
666
+ *
667
+ * @example
668
+ * ```ts
669
+ * import { THEME_PRESETS } from '@mks2508/better-logger/styles';
670
+ *
671
+ * // Inspeccionar el badge `error` del theme `neon`
672
+ * const { emoji, label, background, color } = THEME_PRESETS.neon.error;
673
+ * console.log(`${emoji} ${label} → ${background}`);
674
+ * ```
675
+ *
676
+ * @example
677
+ * ```ts
678
+ * // Aplicar un theme al logger entero
679
+ * import logger from '@mks2508/better-logger';
680
+ * logger.configure({ theme: 'cyberpunk' });
681
+ * logger.error('Algo se rompió'); // badge con glow magenta
682
+ * ```
683
+ *
684
+ * @see {@link ThemeVariant} para la lista de claves válidas.
685
+ * @see {@link LevelStyleConfig} para la shape exacta de cada entrada.
686
+ */
687
+ const THEME_PRESETS = {
688
+ default: {
689
+ trace: {
690
+ emoji: "🔬",
691
+ label: "TRACE",
692
+ background: "linear-gradient(135deg, #b2bec3 0%, #636e72 100%)",
693
+ color: "#ffffff",
694
+ border: "1px solid #b2bec3",
695
+ shadow: "0 1px 2px rgba(178, 190, 195, 0.3)"
696
+ },
697
+ debug: {
698
+ emoji: "🐞",
699
+ label: "DEBUG",
700
+ background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
701
+ color: "#ffffff",
702
+ border: "1px solid #667eea",
703
+ shadow: "0 2px 4px rgba(102, 126, 234, 0.3)"
704
+ },
705
+ info: {
706
+ emoji: "ℹ️",
707
+ label: "INFO",
708
+ background: "linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)",
709
+ color: "#ffffff",
710
+ border: "1px solid #74b9ff",
711
+ shadow: "0 2px 4px rgba(116, 185, 255, 0.3)"
712
+ },
713
+ warn: {
714
+ emoji: "⚠️",
715
+ label: "WARN",
716
+ background: "linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)",
717
+ color: "#2d3436",
718
+ border: "1px solid #fdcb6e",
719
+ shadow: "0 2px 4px rgba(253, 203, 110, 0.3)"
720
+ },
721
+ error: {
722
+ emoji: "❌",
723
+ label: "ERROR",
724
+ background: "linear-gradient(135deg, #e84393 0%, #d63031 100%)",
725
+ color: "#ffffff",
726
+ border: "1px solid #e84393",
727
+ shadow: "0 2px 4px rgba(232, 67, 147, 0.3)"
728
+ },
729
+ success: {
730
+ emoji: "✅",
731
+ label: "SUCCESS",
732
+ background: "linear-gradient(135deg, #00b894 0%, #00a085 100%)",
733
+ color: "#ffffff",
734
+ border: "1px solid #00b894",
735
+ shadow: "0 2px 4px rgba(0, 184, 148, 0.3)"
736
+ },
737
+ critical: {
738
+ emoji: "🔥",
739
+ label: "CRITICAL",
740
+ background: "linear-gradient(135deg, #ff3838 0%, #ff1744 100%)",
741
+ color: "#ffffff",
742
+ border: "2px solid #ff3838",
743
+ shadow: "0 4px 8px rgba(255, 56, 56, 0.5)"
744
+ }
745
+ },
746
+ dark: {
747
+ trace: {
748
+ emoji: "🔬",
749
+ label: "TRACE",
750
+ background: "linear-gradient(135deg, #4a5568 0%, #2d3748 100%)",
751
+ color: "#cbd5e0",
752
+ border: "1px solid #4a5568",
753
+ shadow: "0 1px 3px rgba(74, 85, 104, 0.8)"
754
+ },
755
+ debug: {
756
+ emoji: "🌙",
757
+ label: "DEBUG",
758
+ background: "linear-gradient(135deg, #2d3748 0%, #4a5568 100%)",
759
+ color: "#e2e8f0",
760
+ border: "1px solid #4a5568",
761
+ shadow: "0 2px 4px rgba(45, 55, 72, 0.8)"
762
+ },
763
+ info: {
764
+ emoji: "💡",
765
+ label: "INFO",
766
+ background: "linear-gradient(135deg, #1a202c 0%, #2d3748 100%)",
767
+ color: "#90cdf4",
768
+ border: "1px solid #3182ce",
769
+ shadow: "0 2px 4px rgba(26, 32, 44, 0.8)"
770
+ },
771
+ warn: {
772
+ emoji: "⚡",
773
+ label: "WARN",
774
+ background: "linear-gradient(135deg, #744210 0%, #975a16 100%)",
775
+ color: "#faf089",
776
+ border: "1px solid #d69e2e",
777
+ shadow: "0 2px 4px rgba(116, 66, 16, 0.8)"
778
+ },
779
+ error: {
780
+ emoji: "💀",
781
+ label: "ERROR",
782
+ background: "linear-gradient(135deg, #742a2a 0%, #9b2c2c 100%)",
783
+ color: "#feb2b2",
784
+ border: "1px solid #e53e3e",
785
+ shadow: "0 2px 4px rgba(116, 42, 42, 0.8)"
786
+ },
787
+ success: {
788
+ emoji: "🎯",
789
+ label: "SUCCESS",
790
+ background: "linear-gradient(135deg, #276749 0%, #2f855a 100%)",
791
+ color: "#9ae6b4",
792
+ border: "1px solid #38a169",
793
+ shadow: "0 2px 4px rgba(39, 103, 73, 0.8)"
794
+ },
795
+ critical: {
796
+ emoji: "💥",
797
+ label: "CRITICAL",
798
+ background: "linear-gradient(135deg, #1a1a1a 0%, #ff0000 100%)",
799
+ color: "#ffffff",
800
+ border: "2px solid #ff0000",
801
+ shadow: "0 4px 8px rgba(255, 0, 0, 0.9)"
802
+ }
803
+ },
804
+ neon: {
805
+ trace: {
806
+ emoji: "🔬",
807
+ label: "TRACE",
808
+ background: "linear-gradient(135deg, #16213e 0%, #0a0a23 100%)",
809
+ color: "#00ffff",
810
+ border: "1px solid #00ffff",
811
+ shadow: "0 0 10px rgba(0, 255, 255, 0.5)"
812
+ },
813
+ debug: {
814
+ emoji: "⚡",
815
+ label: "DEBUG",
816
+ background: "linear-gradient(135deg, #0f3460 0%, #e94560 100%)",
817
+ color: "#00ffff",
818
+ border: "1px solid #00ffff",
819
+ shadow: "0 0 10px rgba(0, 255, 255, 0.5)"
820
+ },
821
+ info: {
822
+ emoji: "🔮",
823
+ label: "INFO",
824
+ background: "linear-gradient(135deg, #16213e 0%, #0f3460 100%)",
825
+ color: "#00ff41",
826
+ border: "1px solid #00ff41",
827
+ shadow: "0 0 10px rgba(0, 255, 65, 0.5)"
828
+ },
829
+ warn: {
830
+ emoji: "⚠️",
831
+ label: "WARN",
832
+ background: "linear-gradient(135deg, #533a03 0%, #e94560 100%)",
833
+ color: "#ffff00",
834
+ border: "1px solid #ffff00",
835
+ shadow: "0 0 10px rgba(255, 255, 0, 0.5)"
836
+ },
837
+ error: {
838
+ emoji: "💥",
839
+ label: "ERROR",
840
+ background: "linear-gradient(135deg, #5c0a0a 0%, #ff073a 100%)",
841
+ color: "#ff073a",
842
+ border: "1px solid #ff073a",
843
+ shadow: "0 0 10px rgba(255, 7, 58, 0.8)"
844
+ },
845
+ success: {
846
+ emoji: "✨",
847
+ label: "SUCCESS",
848
+ background: "linear-gradient(135deg, #0a5c0a 0%, #39ff14 100%)",
849
+ color: "#39ff14",
850
+ border: "1px solid #39ff14",
851
+ shadow: "0 0 10px rgba(57, 255, 20, 0.8)"
852
+ },
853
+ critical: {
854
+ emoji: "🌟",
855
+ label: "CRITICAL",
856
+ background: "linear-gradient(135deg, #000000 0%, #ff0080 100%)",
857
+ color: "#ff0080",
858
+ border: "2px solid #ff0080",
859
+ shadow: "0 0 20px rgba(255, 0, 128, 1)"
860
+ }
861
+ },
862
+ minimal: {
863
+ trace: {
864
+ emoji: "",
865
+ label: "TRACE",
866
+ background: "#fafafa",
867
+ color: "#9e9e9e",
868
+ border: "1px solid #eeeeee",
869
+ shadow: "none"
870
+ },
871
+ debug: {
872
+ emoji: "",
873
+ label: "DEBUG",
874
+ background: "#f7fafc",
875
+ color: "#4a5568",
876
+ border: "1px solid #e2e8f0",
877
+ shadow: "none"
878
+ },
879
+ info: {
880
+ emoji: "",
881
+ label: "INFO",
882
+ background: "#ebf8ff",
883
+ color: "#2b6cb0",
884
+ border: "1px solid #bee3f8",
885
+ shadow: "none"
886
+ },
887
+ warn: {
888
+ emoji: "",
889
+ label: "WARN",
890
+ background: "#fffbf0",
891
+ color: "#c05621",
892
+ border: "1px solid #fed7aa",
893
+ shadow: "none"
894
+ },
895
+ error: {
896
+ emoji: "",
897
+ label: "ERROR",
898
+ background: "#fef5f5",
899
+ color: "#c53030",
900
+ border: "1px solid #fca5a5",
901
+ shadow: "none"
902
+ },
903
+ success: {
904
+ emoji: "",
905
+ label: "SUCCESS",
906
+ background: "#f0fff4",
907
+ color: "#2f855a",
908
+ border: "1px solid #9ae6b4",
909
+ shadow: "none"
910
+ },
911
+ critical: {
912
+ emoji: "",
913
+ label: "CRITICAL",
914
+ background: "#fef5f5",
915
+ color: "#e53e3e",
916
+ border: "2px solid #f56565",
917
+ shadow: "none"
918
+ }
919
+ },
920
+ light: {
921
+ trace: {
922
+ emoji: "🔬",
923
+ label: "TRACE",
924
+ background: "linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%)",
925
+ color: "#616161",
926
+ border: "1px solid #bdbdbd",
927
+ shadow: "0 1px 3px rgba(189, 189, 189, 0.2)"
928
+ },
929
+ debug: {
930
+ emoji: "🔍",
931
+ label: "DEBUG",
932
+ background: "linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)",
933
+ color: "#1565c0",
934
+ border: "1px solid #90caf9",
935
+ shadow: "0 1px 3px rgba(33, 150, 243, 0.2)"
936
+ },
937
+ info: {
938
+ emoji: "ℹ️",
939
+ label: "INFO",
940
+ background: "linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%)",
941
+ color: "#7b1fa2",
942
+ border: "1px solid #ce93d8",
943
+ shadow: "0 1px 3px rgba(156, 39, 176, 0.2)"
944
+ },
945
+ warn: {
946
+ emoji: "⚠️",
947
+ label: "WARN",
948
+ background: "linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%)",
949
+ color: "#f57c00",
950
+ border: "1px solid #ffcc02",
951
+ shadow: "0 1px 3px rgba(255, 152, 0, 0.2)"
952
+ },
953
+ error: {
954
+ emoji: "❌",
955
+ label: "ERROR",
956
+ background: "linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%)",
957
+ color: "#d32f2f",
958
+ border: "1px solid #f44336",
959
+ shadow: "0 1px 3px rgba(244, 67, 54, 0.2)"
960
+ },
961
+ success: {
962
+ emoji: "✅",
963
+ label: "SUCCESS",
964
+ background: "linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%)",
965
+ color: "#388e3c",
966
+ border: "1px solid #4caf50",
967
+ shadow: "0 1px 3px rgba(76, 175, 80, 0.2)"
968
+ },
969
+ critical: {
970
+ emoji: "🚨",
971
+ label: "CRITICAL",
972
+ background: "linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%)",
973
+ color: "#c2185b",
974
+ border: "2px solid #e91e63",
975
+ shadow: "0 2px 6px rgba(233, 30, 99, 0.3)"
976
+ }
977
+ },
978
+ cyberpunk: {
979
+ trace: {
980
+ emoji: "🔬",
981
+ label: "TRACE",
982
+ background: "linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)",
983
+ color: "#48bfe3",
984
+ border: "1px solid #48bfe3",
985
+ shadow: "0 0 15px rgba(72, 191, 227, 0.4)"
986
+ },
987
+ debug: {
988
+ emoji: "🤖",
989
+ label: "DEBUG",
990
+ background: "linear-gradient(135deg, #0d1b2a 0%, #415a77 100%)",
991
+ color: "#00d4aa",
992
+ border: "1px solid #00d4aa",
993
+ shadow: "0 0 15px rgba(0, 212, 170, 0.4)"
994
+ },
995
+ info: {
996
+ emoji: "🔗",
997
+ label: "INFO",
998
+ background: "linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)",
999
+ color: "#00b4d8",
1000
+ border: "1px solid #00b4d8",
1001
+ shadow: "0 0 15px rgba(0, 180, 216, 0.4)"
1002
+ },
1003
+ warn: {
1004
+ emoji: "⚡",
1005
+ label: "WARN",
1006
+ background: "linear-gradient(135deg, #f72585 0%, #b5179e 100%)",
1007
+ color: "#ffff3f",
1008
+ border: "1px solid #ffff3f",
1009
+ shadow: "0 0 15px rgba(255, 255, 63, 0.4)"
1010
+ },
1011
+ error: {
1012
+ emoji: "💀",
1013
+ label: "ERROR",
1014
+ background: "linear-gradient(135deg, #7209b7 0%, #480ca8 100%)",
1015
+ color: "#ff006e",
1016
+ border: "1px solid #ff006e",
1017
+ shadow: "0 0 15px rgba(255, 0, 110, 0.6)"
1018
+ },
1019
+ success: {
1020
+ emoji: "⚡",
1021
+ label: "SUCCESS",
1022
+ background: "linear-gradient(135deg, #003566 0%, #001d3d 100%)",
1023
+ color: "#00f5ff",
1024
+ border: "1px solid #00f5ff",
1025
+ shadow: "0 0 15px rgba(0, 245, 255, 0.4)"
1026
+ },
1027
+ critical: {
1028
+ emoji: "💥",
1029
+ label: "CRITICAL",
1030
+ background: "linear-gradient(135deg, #000000 0%, #ff0040 100%)",
1031
+ color: "#ff0040",
1032
+ border: "2px solid #ff0040",
1033
+ shadow: "0 0 25px rgba(255, 0, 64, 0.8)"
1034
+ }
1035
+ }
1036
+ };
1037
+ //#endregion
1038
+ //#region src/styling/banners.ts
1039
+ /**
1040
+ * Catálogo de variantes del banner de inicialización del logger.
1041
+ *
1042
+ * Cada variante es un par `{ text, style }` listo para pasar a
1043
+ * `console.log(\`%c${text}\`, style)`. Las variantes escalan en complejidad
1044
+ * visual según las capacidades del navegador:
1045
+ * - `simple` — una sola línea con gradiente.
1046
+ * - `ascii` — ASCII art multiníveles (Safari, sin SVG).
1047
+ * - `unicode` — caja Unicode con gradiente de fondo.
1048
+ * - `svg` — `background-image` SVG con texto vectorial.
1049
+ * - `animated` — gradiente animado vía `@keyframes gradientShift`.
1050
+ *
1051
+ * La función {@link detectBannerCapabilities} elige automáticamente la
1052
+ * variante más rica soportada por el entorno actual.
1053
+ *
1054
+ * @example
1055
+ * ```ts
1056
+ * import { BANNER_VARIANTS } from '@mks2508/better-logger/styles';
1057
+ *
1058
+ * const { text, style } = BANNER_VARIANTS.unicode;
1059
+ * console.log(`%c${text}`, style);
1060
+ * ```
1061
+ *
1062
+ * @see {@link BannerType} para la unión de claves válidas.
1063
+ * @see {@link displayInitBanner} para pintar el banner auto-detectado.
1064
+ */
1065
+ const BANNER_VARIANTS = {
1066
+ simple: {
1067
+ text: "🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀",
1068
+ style: "background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;"
1069
+ },
1070
+ ascii: {
1071
+ text: `
1072
+ ___ ____ _ __ ___ _ __ _____ _____ ____ __ ___ _____ _____ _____ ____
1073
+ / _ \\ / __ \\| | / / / _ \\ | \\ | |/ ____| ____| _ \\ | | / _ \\ / ____| ___| _ | _ \\
1074
+ / /_\\ \\ / / _\` | |/ / / /_\\ \\ | \\| | | | |__ | | | | | | / / \\ \\| | __| |_ | |_| | |_) |
1075
+ | _ || | (_| | < | _ | | . \` | | | __| | | | | | | | | | | | |_ | _| | /| _ <
1076
+ | | | |\\ \\__,_|_|\\_\\ | | | | | |\\ | |___| |____| |_| | | |__\\ \\_/ /| |__| | |___| |\\ \\| |_) |
1077
+ \\_| |_/ \\____/ \\_| |_/ |_| \\_|\\_____|______|____/ |_____/\\___/ \\_____|_____|_| \\_|____/
1078
+
1079
+ Advanced Logger v2.0.0 - Console Excellence`,
1080
+ style: "font-family: \"Courier New\", Consolas, Monaco, monospace; color: #667eea; font-size: 11px; line-height: 1.2;"
1081
+ },
1082
+ unicode: {
1083
+ text: `
1084
+ ╔══════════════════════════════════════════════════════════════════════════╗
1085
+ ║ 🚀 ADVANCED LOGGER v2.0.0 ║
1086
+ ║ State-of-the-art Console Styling ║
1087
+ ╚══════════════════════════════════════════════════════════════════════════╝`,
1088
+ style: "font-family: \"Courier New\", Consolas, Monaco, monospace; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.3;"
1089
+ },
1090
+ svg: {
1091
+ text: " ",
1092
+ style: `
1093
+ background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='8'/><text x='200' y='30' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>🚀 ADVANCED LOGGER</text><text x='200' y='50' text-anchor='middle' fill='white' font-family='monospace' font-size='12'>State-of-the-art Console Styling</text><text x='200' y='65' text-anchor='middle' fill='white' font-family='monospace' font-size='10'>v2.0.0</text></svg>");
1094
+ background-repeat: no-repeat;
1095
+ background-size: 400px 80px;
1096
+ padding: 40px 200px;
1097
+ color: transparent;
1098
+ display: inline-block;
1099
+ border-radius: 8px;
1100
+ `
1101
+ },
1102
+ animated: {
1103
+ text: " 🚀 ADVANCED LOGGER v2.0.0 ",
1104
+ style: `
1105
+ background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);
1106
+ background-size: 400% 400%;
1107
+ color: white;
1108
+ padding: 15px 25px;
1109
+ border-radius: 10px;
1110
+ font-weight: bold;
1111
+ font-size: 14px;
1112
+ font-family: monospace;
1113
+ animation: gradientShift 3s ease infinite;
1114
+ display: inline-block;
1115
+ `
1116
+ }
1117
+ };
1118
+ /**
1119
+ * Banners de inicialización específicos por {@link ThemeVariant}.
1120
+ *
1121
+ * Cada theme trae su propio par `{ simple, style }` (banner de una línea
1122
+ * + CSS) que combina con la paleta del theme. El texto del banner es
1123
+ * siempre una sola línea (sin ASCII art), por lo que es la variante
1124
+ * usada por defecto cuando el logger arranca con un theme concreto.
1125
+ *
1126
+ * @example
1127
+ * ```ts
1128
+ * import { THEME_BANNERS } from '@mks2508/better-logger/styles';
1129
+ *
1130
+ * const { simple, style } = THEME_BANNERS.cyberpunk;
1131
+ * console.log(`%c${simple}`, style);
1132
+ * ```
1133
+ *
1134
+ * @see {@link THEME_PRESETS} para los estilos de badge por nivel de cada theme.
1135
+ * @see {@link ThemeVariant} para la lista de themes disponibles.
1136
+ */
1137
+ const THEME_BANNERS = {
1138
+ default: {
1139
+ simple: "🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀",
1140
+ style: "background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold;"
1141
+ },
1142
+ dark: {
1143
+ simple: "🌙 ADVANCED LOGGER v2.0.0 - Dark Mode Console Excellence 🌙",
1144
+ style: "background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #4a5568;"
1145
+ },
1146
+ neon: {
1147
+ simple: "⚡ ADVANCED LOGGER v2.0.0 - Cyberpunk Console Experience ⚡",
1148
+ style: "background: linear-gradient(135deg, #0f3460 0%, #e94560 100%); color: #00ffff; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00ffff;"
1149
+ },
1150
+ minimal: {
1151
+ simple: "ADVANCED LOGGER v2.0.0 - Clean Console Styling",
1152
+ style: "background: #f7fafc; color: #2d3748; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 4px; font-weight: 500;"
1153
+ },
1154
+ light: {
1155
+ simple: "☀️ ADVANCED LOGGER v2.0.0 - Bright Console Styling ☀️",
1156
+ style: "background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); color: #495057; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #dee2e6;"
1157
+ },
1158
+ cyberpunk: {
1159
+ simple: "🤖 ADVANCED LOGGER v2.0.0 - Neural Console Interface 🤖",
1160
+ style: "background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); color: #00d4aa; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00d4aa; border: 1px solid #00d4aa;"
1161
+ }
1162
+ };
1163
+ /**
1164
+ * Detecta la variante de banner más rica que el entorno puede renderizar.
1165
+ *
1166
+ * Usa `navigator.userAgent` y probes sobre `document` para decidir entre
1167
+ * `animated` (Chrome con CSS animations), `svg` (Chrome/Firefox con SVG),
1168
+ * `unicode` (Chrome/Firefox fallback), `ascii` (Safari) o `simple`
1169
+ * (todo lo demás). En entornos sin `navigator` o `document` retorna
1170
+ * `'simple'` inmediatamente (Node, SSR, Web Workers).
1171
+ *
1172
+ * @returns {BannerType} Variante de banner recomendada para el entorno.
1173
+ *
1174
+ * @example
1175
+ * ```ts
1176
+ * import { detectBannerCapabilities } from '@mks2508/better-logger/styles';
1177
+ *
1178
+ * const capable = detectBannerCapabilities();
1179
+ * console.log(`Best banner for this env: ${capable}`);
1180
+ * ```
1181
+ *
1182
+ * @see {@link BANNER_VARIANTS} para el catálogo que indexa este resultado.
1183
+ */
1184
+ function detectBannerCapabilities() {
1185
+ if (typeof navigator === "undefined" || typeof document === "undefined") return "simple";
1186
+ const userAgent = navigator.userAgent;
1187
+ const isChrome = /Chrome/.test(userAgent);
1188
+ const isFirefox = /Firefox/.test(userAgent);
1189
+ const isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent);
1190
+ const supportsSVG = !!document.createElementNS && !!document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect;
1191
+ if ("animationName" in document.createElement("div").style && isChrome) return "animated";
1192
+ else if (supportsSVG && (isChrome || isFirefox)) return "svg";
1193
+ else if (isChrome || isFirefox) return "unicode";
1194
+ else if (isSafari) return "ascii";
1195
+ return "simple";
1196
+ }
1197
+ /**
1198
+ * Pinta el banner de inicialización del logger en la consola del navegador.
1199
+ *
1200
+ * Si no se pasa `bannerType`, se auto-detecta vía
1201
+ * {@link detectBannerCapabilities}. Además del banner, abre un
1202
+ * `console.group` con la lista de features soportadas (styling, stack
1203
+ * traces, performance timers, handlers, ...).
1204
+ *
1205
+ * No-op cuando `document` no está disponible (Node, SSR, Web Workers),
1206
+ * para evitar referencias a APIs inexistentes.
1207
+ *
1208
+ * @param {BannerType} [bannerType] - Variante de banner a pintar. Si se
1209
+ * omite, se detecta automáticamente la mejor soportada.
1210
+ * @returns {void}
1211
+ *
1212
+ * @example
1213
+ * ```ts
1214
+ * import { displayInitBanner } from '@mks2508/better-logger/styles';
1215
+ *
1216
+ * displayInitBanner(); // auto-detecta
1217
+ * displayInitBanner('ascii'); // fuerza ASCII art
1218
+ * ```
1219
+ *
1220
+ * @see {@link BANNER_VARIANTS} para las variantes disponibles.
1221
+ * @see {@link THEME_BANNERS} para banners específicos por theme.
1222
+ */
1223
+ function displayInitBanner(bannerType) {
1224
+ if (typeof document === "undefined") return;
1225
+ const selectedType = bannerType || detectBannerCapabilities();
1226
+ const banner = BANNER_VARIANTS[selectedType];
1227
+ if (selectedType === "animated") {
1228
+ const style = document.createElement("style");
1229
+ style.textContent = `
1230
+ @keyframes gradientShift {
1231
+ 0% { background-position: 0% 50%; }
1232
+ 50% { background-position: 100% 50%; }
1233
+ 100% { background-position: 0% 50%; }
1234
+ }
1235
+ `;
1236
+ document.head.appendChild(style);
1237
+ }
1238
+ console.log(`%c${banner.text}`, banner.style);
1239
+ const features = [
1240
+ "🎨 Advanced CSS Console Styling",
1241
+ "📍 Automatic Stack Trace Parsing",
1242
+ "🔧 Scoped Loggers & Prefixes",
1243
+ "⚡ Performance Timers",
1244
+ "🎯 Verbosity Filtering",
1245
+ "🔌 Extensible Handlers",
1246
+ "📱 Modern TypeScript Patterns",
1247
+ "📤 Export & Clipboard Support"
1248
+ ];
1249
+ console.group(`%c✨ Features`, "background: #f8f9fa; color: #495057; padding: 4px 8px; border-radius: 4px; font-weight: bold;");
1250
+ features.forEach((feature) => {
1251
+ console.log(`%c${feature}`, "color: #6c757d; font-size: 13px;");
1252
+ });
1253
+ console.groupEnd();
1254
+ console.log("");
1255
+ }
1256
+ //#endregion
1257
+ //#region src/styling/SmartPresets.ts
1258
+ /**
1259
+ * Catálogo de smart presets que configuran el layout completo de un log.
1260
+ *
1261
+ * A diferencia de {@link THEME_PRESETS} — que solo controla los colores
1262
+ * y emojis del badge del nivel — los smart presets controlan la
1263
+ * composición entera del output: timestamp, badge de nivel, prefix,
1264
+ * mensaje, location, fuentes, padding/spacing y efectos visuales
1265
+ * (blur, transparency). Cada clave es un {@link LogStyles} completo.
1266
+ *
1267
+ * Presets disponibles:
1268
+ * - `default` — adaptativo (claro/oscuro según DevTools), legible.
1269
+ * - `cyberpunk` — neón, glow, fondo oscuro, location oculta.
1270
+ * - `glassmorphism` — blur + transparencia, layout spacious.
1271
+ * - `minimal` — sin timestamp, sin location, badges flat.
1272
+ * - `debug` — monospace, todo visible, compacto para dev.
1273
+ * - `production` — solo lo esencial: timestamp + level + mensaje.
1274
+ *
1275
+ * Los presets son ortogonales a los themes: pueden combinarse (por
1276
+ * ejemplo, `theme: 'dark'` + `preset: 'debug'` aplica el layout debug
1277
+ * sobre la paleta oscura).
1278
+ *
1279
+ * @example
1280
+ * ```ts
1281
+ * import logger from '@mks2508/better-logger';
1282
+ *
1283
+ * logger.preset('glassmorphism');
1284
+ * logger.info('Vidrio esmerilado en DevTools');
1285
+ * ```
1286
+ *
1287
+ * @example
1288
+ * ```ts
1289
+ * // Componer: theme custom + preset de layout
1290
+ * logger.configure({ theme: 'dark' });
1291
+ * logger.preset('debug');
1292
+ * logger.warn('Layout debug sobre theme dark');
1293
+ * ```
1294
+ *
1295
+ * @see {@link getSmartPreset} para resolver un preset por nombre.
1296
+ * @see {@link LogStyles} para la shape completa de un preset.
1297
+ */
1298
+ const SMART_PRESETS = {
1299
+ /**
1300
+ * Preset por defecto — funciona out-of-the-box.
1301
+ * Limpio, legible, adaptativo a themes claro/oscuro.
1302
+ */
1303
+ default: {
1304
+ layout: {
1305
+ spacing: "normal",
1306
+ innerPadding: "2px",
1307
+ outerMargin: "1px"
1308
+ },
1309
+ timestamp: {
1310
+ show: true,
1311
+ color: "auto",
1312
+ font: "Monaco, Consolas, monospace",
1313
+ size: "11px"
1314
+ },
1315
+ level: {
1316
+ show: true,
1317
+ style: "badge",
1318
+ uppercase: false,
1319
+ padding: "2px 8px"
1320
+ },
1321
+ prefix: {
1322
+ show: true,
1323
+ style: "dark",
1324
+ padding: "2px 6px"
1325
+ },
1326
+ message: {
1327
+ show: true,
1328
+ color: "auto",
1329
+ font: "system-ui, -apple-system, sans-serif",
1330
+ size: "14px"
1331
+ },
1332
+ location: {
1333
+ show: true,
1334
+ color: "auto",
1335
+ font: "Monaco, Consolas, monospace",
1336
+ size: "11px"
1337
+ }
1338
+ },
1339
+ /**
1340
+ * Preset cyberpunk — neón, glow y fondo oscuro.
1341
+ */
1342
+ cyberpunk: {
1343
+ layout: {
1344
+ spacing: "compact",
1345
+ innerPadding: "1px",
1346
+ outerMargin: "0px"
1347
+ },
1348
+ timestamp: {
1349
+ show: true,
1350
+ color: "#00ffff",
1351
+ font: "Monaco, Consolas, monospace",
1352
+ size: "10px",
1353
+ style: "neon"
1354
+ },
1355
+ level: {
1356
+ show: true,
1357
+ style: "glowing",
1358
+ uppercase: true,
1359
+ padding: "2px 8px"
1360
+ },
1361
+ prefix: {
1362
+ show: true,
1363
+ color: "#ff0080",
1364
+ background: "rgba(255, 0, 128, 0.1)",
1365
+ border: "1px solid #ff0080",
1366
+ style: "neon"
1367
+ },
1368
+ message: {
1369
+ show: true,
1370
+ color: "#00ff41",
1371
+ font: "Monaco, Consolas, monospace",
1372
+ size: "13px"
1373
+ },
1374
+ location: { show: false },
1375
+ backdrop: "blur(2px)",
1376
+ transparency: .9
1377
+ },
1378
+ /**
1379
+ * Preset glassmorphism — blur moderno y transparencia.
1380
+ */
1381
+ glassmorphism: {
1382
+ layout: {
1383
+ spacing: "spacious",
1384
+ innerPadding: "4px",
1385
+ outerMargin: "2px"
1386
+ },
1387
+ timestamp: {
1388
+ show: true,
1389
+ color: "auto",
1390
+ font: "system-ui, sans-serif",
1391
+ size: "11px",
1392
+ style: "glassmorphic"
1393
+ },
1394
+ level: {
1395
+ show: true,
1396
+ style: "glassmorphic",
1397
+ uppercase: false,
1398
+ padding: "4px 12px"
1399
+ },
1400
+ prefix: {
1401
+ show: true,
1402
+ style: "glassmorphic",
1403
+ padding: "3px 8px"
1404
+ },
1405
+ message: {
1406
+ show: true,
1407
+ color: "auto",
1408
+ font: "system-ui, sans-serif",
1409
+ size: "14px"
1410
+ },
1411
+ location: {
1412
+ show: true,
1413
+ color: "auto",
1414
+ font: "system-ui, sans-serif",
1415
+ size: "11px",
1416
+ style: "glassmorphic"
1417
+ },
1418
+ backdrop: "blur(10px)",
1419
+ transparency: .8
1420
+ },
1421
+ /**
1422
+ * Preset minimal — limpio, sin decoraciones, máxima legibilidad.
1423
+ */
1424
+ minimal: {
1425
+ layout: {
1426
+ spacing: "compact",
1427
+ innerPadding: "0px",
1428
+ outerMargin: "0px"
1429
+ },
1430
+ timestamp: { show: false },
1431
+ level: {
1432
+ show: true,
1433
+ style: "flat",
1434
+ uppercase: true,
1435
+ padding: "0px 4px",
1436
+ border: "none",
1437
+ background: "transparent"
1438
+ },
1439
+ prefix: {
1440
+ show: true,
1441
+ style: "flat",
1442
+ padding: "0px 4px",
1443
+ border: "none",
1444
+ background: "transparent"
1445
+ },
1446
+ message: {
1447
+ show: true,
1448
+ color: "auto",
1449
+ font: "system-ui, sans-serif",
1450
+ size: "14px"
1451
+ },
1452
+ location: { show: false }
1453
+ },
1454
+ /**
1455
+ * Preset debug — monospace, detallado, compacto para desarrollo.
1456
+ */
1457
+ debug: {
1458
+ layout: {
1459
+ spacing: "compact",
1460
+ innerPadding: "1px",
1461
+ outerMargin: "0px"
1462
+ },
1463
+ timestamp: {
1464
+ show: true,
1465
+ color: "auto",
1466
+ font: "Monaco, Consolas, monospace",
1467
+ size: "10px"
1468
+ },
1469
+ level: {
1470
+ show: true,
1471
+ style: "compact",
1472
+ uppercase: true,
1473
+ padding: "1px 4px",
1474
+ font: "Monaco, Consolas, monospace",
1475
+ size: "10px"
1476
+ },
1477
+ prefix: {
1478
+ show: true,
1479
+ style: "compact",
1480
+ padding: "1px 4px",
1481
+ font: "Monaco, Consolas, monospace",
1482
+ size: "10px"
1483
+ },
1484
+ message: {
1485
+ show: true,
1486
+ color: "auto",
1487
+ font: "Monaco, Consolas, monospace",
1488
+ size: "12px"
1489
+ },
1490
+ location: {
1491
+ show: true,
1492
+ color: "auto",
1493
+ font: "Monaco, Consolas, monospace",
1494
+ size: "10px",
1495
+ style: "clickable"
1496
+ }
1497
+ },
1498
+ /**
1499
+ * Preset production — limpio, solo info esencial.
1500
+ */
1501
+ production: {
1502
+ layout: {
1503
+ spacing: "normal",
1504
+ innerPadding: "2px",
1505
+ outerMargin: "1px"
1506
+ },
1507
+ timestamp: {
1508
+ show: true,
1509
+ color: "auto",
1510
+ font: "system-ui, sans-serif",
1511
+ size: "11px"
1512
+ },
1513
+ level: {
1514
+ show: true,
1515
+ style: "badge",
1516
+ uppercase: false,
1517
+ padding: "2px 6px"
1518
+ },
1519
+ prefix: { show: false },
1520
+ message: {
1521
+ show: true,
1522
+ color: "auto",
1523
+ font: "system-ui, sans-serif",
1524
+ size: "14px"
1525
+ },
1526
+ location: { show: false }
1527
+ }
1528
+ };
1529
+ /**
1530
+ * Resuelve un smart preset por nombre desde {@link SMART_PRESETS}.
1531
+ *
1532
+ * @param {string} name - Nombre del preset (`'default'`, `'cyberpunk'`,
1533
+ * `'glassmorphism'`, `'minimal'`, `'debug'`, `'production'`).
1534
+ * @returns {LogStyles | null} El preset encontrado, o `null` si el nombre
1535
+ * no existe en el catálogo.
1536
+ *
1537
+ * @example
1538
+ * ```ts
1539
+ * import { getSmartPreset } from '@mks2508/better-logger/styles';
1540
+ *
1541
+ * const preset = getSmartPreset('cyberpunk');
1542
+ * if (preset) {
1543
+ * console.log(preset.level?.style); // 'glowing'
1544
+ * }
1545
+ * ```
1546
+ *
1547
+ * @see {@link hasPreset} para un check booleano sin traer el objeto.
1548
+ */
1549
+ function getSmartPreset(name) {
1550
+ return SMART_PRESETS[name] || null;
1551
+ }
1552
+ /**
1553
+ * Lista los nombres de todos los smart presets registrados.
1554
+ *
1555
+ * Útil para alimentar menús de configuración, CLIs o help text.
1556
+ *
1557
+ * @returns {string[]} Array con las claves de {@link SMART_PRESETS}.
1558
+ *
1559
+ * @example
1560
+ * ```ts
1561
+ * import { getAvailablePresets } from '@mks2508/better-logger/styles';
1562
+ *
1563
+ * console.log(getAvailablePresets());
1564
+ * // ['default', 'cyberpunk', 'glassmorphism', 'minimal', 'debug', 'production']
1565
+ * ```
1566
+ */
1567
+ function getAvailablePresets() {
1568
+ return Object.keys(SMART_PRESETS);
1569
+ }
1570
+ /**
1571
+ * Comprueba si un smart preset existe en el catálogo.
1572
+ *
1573
+ * @param {string} name - Nombre del preset a verificar.
1574
+ * @returns {boolean} `true` si el preset está registrado, `false` en caso contrario.
1575
+ *
1576
+ * @example
1577
+ * ```ts
1578
+ * import { hasPreset, getSmartPreset } from '@mks2508/better-logger/styles';
1579
+ *
1580
+ * const name = 'glassmorphism';
1581
+ * const preset = hasPreset(name) ? getSmartPreset(name) : null;
1582
+ * ```
1583
+ *
1584
+ * @see {@link getSmartPreset} para resolver el preset (retorna `null` si no existe).
1585
+ */
1586
+ function hasPreset(name) {
1587
+ return name in SMART_PRESETS;
1588
+ }
1589
+ //#endregion
1590
+ Object.defineProperty(exports, "BANNER_VARIANTS", {
1591
+ enumerable: true,
1592
+ get: function() {
1593
+ return BANNER_VARIANTS;
1594
+ }
1595
+ });
1596
+ Object.defineProperty(exports, "StyleBuilder", {
1597
+ enumerable: true,
1598
+ get: function() {
1599
+ return StyleBuilder;
1600
+ }
1601
+ });
1602
+ Object.defineProperty(exports, "StylePresets", {
1603
+ enumerable: true,
1604
+ get: function() {
1605
+ return StylePresets;
1606
+ }
1607
+ });
1608
+ Object.defineProperty(exports, "THEME_BANNERS", {
1609
+ enumerable: true,
1610
+ get: function() {
1611
+ return THEME_BANNERS;
1612
+ }
1613
+ });
1614
+ Object.defineProperty(exports, "THEME_PRESETS", {
1615
+ enumerable: true,
1616
+ get: function() {
1617
+ return THEME_PRESETS;
1618
+ }
1619
+ });
1620
+ Object.defineProperty(exports, "displayInitBanner", {
1621
+ enumerable: true,
1622
+ get: function() {
1623
+ return displayInitBanner;
1624
+ }
1625
+ });
1626
+ Object.defineProperty(exports, "getAvailablePresets", {
1627
+ enumerable: true,
1628
+ get: function() {
1629
+ return getAvailablePresets;
1630
+ }
1631
+ });
1632
+ Object.defineProperty(exports, "getSmartPreset", {
1633
+ enumerable: true,
1634
+ get: function() {
1635
+ return getSmartPreset;
1636
+ }
1637
+ });
1638
+ Object.defineProperty(exports, "hasPreset", {
1639
+ enumerable: true,
1640
+ get: function() {
1641
+ return hasPreset;
1642
+ }
1643
+ });
1644
+
1645
+ //# sourceMappingURL=styling-Cel2wPRy.cjs.map