@chatcode/cco-better-sidebar 0.18.0-rc.3 → 0.18.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/README_EN.md +5 -1
- package/lib/client-editor.js +315 -258
- package/lib/client-mermaid.js +298 -256
- package/lib/client-registry.js +1097 -460
- package/lib/client-terminal.js +318 -261
- package/lib/client.js +1110 -473
- package/lib/index.js +47 -1
- package/lib/types/client/PluginMarketSettingsSection.d.ts +7 -0
- package/lib/types/client/PluginMarketView.d.ts +7 -0
- package/lib/types/client/api.d.ts +15 -0
- package/lib/types/client/builtins/tabs.d.ts +6 -3
- package/lib/types/client/locales.d.ts +21 -0
- package/lib/types/client/plugin-market-catalog.d.ts +25 -0
- package/lib/types/client/ui-tweaks/index.d.ts +1 -1
- package/lib/types/client/ui-tweaks/typography.d.ts +9 -0
- package/lib/types/plugin-market-api.d.ts +5 -0
- package/lib/types/plugin-market-shared.d.ts +37 -0
- package/lib/types/ui-tweaks/config.d.ts +5 -6
- package/package.json +1 -1
- package/src/client/PluginMarketSettingsSection.tsx +55 -0
- package/src/client/PluginMarketView.module.css +35 -0
- package/src/client/PluginMarketView.tsx +154 -0
- package/src/client/api.ts +7 -0
- package/src/client/builtins/tabs.tsx +16 -3
- package/src/client/index.tsx +10 -1
- package/src/client/locales-ja.ts +21 -0
- package/src/client/locales.ts +42 -0
- package/src/client/plugin-market-catalog.ts +90 -0
- package/src/client/ui-tweaks/branding.tsx +15 -7
- package/src/client/ui-tweaks/index.tsx +36 -99
- package/src/client/ui-tweaks/typography.ts +38 -0
- package/src/index.ts +2 -0
- package/src/plugin-market-api.ts +42 -0
- package/src/plugin-market-shared.ts +21 -0
- package/src/ui-tweaks/config.ts +10 -10
package/src/ui-tweaks/config.ts
CHANGED
|
@@ -29,10 +29,9 @@ export interface UITweaksConfig {
|
|
|
29
29
|
*/
|
|
30
30
|
codeFontScale?: number
|
|
31
31
|
/**
|
|
32
|
-
* Absolute code font size in px (8–32)
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* `codeFontScale` percentage, then to the stock default.
|
|
32
|
+
* Absolute code font size in px (8–32), default 13. Drives code blocks;
|
|
33
|
+
* inline code and small code follow proportionally. When unset, uses a non-default legacy
|
|
34
|
+
* `codeFontScale` percentage, otherwise 13px.
|
|
36
35
|
*/
|
|
37
36
|
codeFontSize?: number
|
|
38
37
|
/**
|
|
@@ -114,7 +113,7 @@ export interface UITweaksConfig {
|
|
|
114
113
|
|
|
115
114
|
export const MIN_FONT_SIZE = 10
|
|
116
115
|
export const MAX_FONT_SIZE = 32
|
|
117
|
-
export const DEFAULT_FONT_SIZE =
|
|
116
|
+
export const DEFAULT_FONT_SIZE = 14
|
|
118
117
|
|
|
119
118
|
/** 16px matches the stock DSH vertical rhythm (message/block gaps, etc.). */
|
|
120
119
|
export const MIN_LINE_HEIGHT = 0
|
|
@@ -126,7 +125,7 @@ export const MIN_CODE_FONT_SCALE = 50
|
|
|
126
125
|
export const MAX_CODE_FONT_SCALE = 150
|
|
127
126
|
export const DEFAULT_CODE_FONT_SCALE = 81
|
|
128
127
|
|
|
129
|
-
/**
|
|
128
|
+
/** Default absolute code-block size, paired with 14px prose. */
|
|
130
129
|
export const MIN_CODE_FONT_SIZE = 8
|
|
131
130
|
export const MAX_CODE_FONT_SIZE = 32
|
|
132
131
|
export const DEFAULT_CODE_FONT_SIZE = 13
|
|
@@ -164,7 +163,7 @@ export const DEFAULT_NOTIFY_SOUND = false
|
|
|
164
163
|
|
|
165
164
|
/** Configuration schema with documented defaults. */
|
|
166
165
|
export const Config: Schema<UITweaksConfig> = z.object({
|
|
167
|
-
fontSize: z.number().min(10).max(32).default(
|
|
166
|
+
fontSize: z.number().min(10).max(32).default(DEFAULT_FONT_SIZE),
|
|
168
167
|
codeFontScale: z.number().min(MIN_CODE_FONT_SCALE).max(MAX_CODE_FONT_SCALE).default(DEFAULT_CODE_FONT_SCALE),
|
|
169
168
|
codeFontSize: z.number().min(MIN_CODE_FONT_SIZE).max(MAX_CODE_FONT_SIZE),
|
|
170
169
|
lineHeight: z.number().min(MIN_LINE_HEIGHT).max(MAX_LINE_HEIGHT).default(DEFAULT_LINE_HEIGHT),
|
|
@@ -229,11 +228,12 @@ export interface ResolvedUITweaksConfig {
|
|
|
229
228
|
export function resolveConfig(config: UITweaksConfig = {}): ResolvedUITweaksConfig {
|
|
230
229
|
const fontSize = config.fontSize ?? DEFAULT_FONT_SIZE
|
|
231
230
|
const codeFontScale = config.codeFontScale ?? DEFAULT_CODE_FONT_SCALE
|
|
232
|
-
//
|
|
233
|
-
// the legacy percentage at the resolved body size; otherwise stock.
|
|
231
|
+
// Explicit code sizing wins; the stock preference keeps readable 13px code.
|
|
234
232
|
const codeFontSize = typeof config.codeFontSize === 'number'
|
|
235
233
|
? Math.min(MAX_CODE_FONT_SIZE, Math.max(MIN_CODE_FONT_SIZE, config.codeFontSize))
|
|
236
|
-
:
|
|
234
|
+
: codeFontScale === DEFAULT_CODE_FONT_SCALE
|
|
235
|
+
? DEFAULT_CODE_FONT_SIZE
|
|
236
|
+
: Math.max(8, Math.round(fontSize * (13 / 16) * (codeFontScale / DEFAULT_CODE_FONT_SCALE)))
|
|
237
237
|
const lineHeight = config.lineHeight ?? DEFAULT_LINE_HEIGHT
|
|
238
238
|
const tableStyle = config.tableStyle ?? 'default'
|
|
239
239
|
const gitBarEnabled = config.gitBarEnabled ?? DEFAULT_GITBAR_ENABLED
|