@g9tm/lynxcontrols-foundation 2.5.9 → 2.5.10
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/catalog/catalog.json +216 -8
- package/catalog/index.md +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/theme/appearance-kit.d.ts +32 -9
- package/dist/theme/appearance-kit.d.ts.map +1 -1
- package/dist/theme/appearance-kit.js +62 -24
- package/dist/theme/appearance-kit.js.map +1 -1
- package/dist/theme/appearance.d.ts +6 -1
- package/dist/theme/appearance.d.ts.map +1 -1
- package/dist/theme/appearance.js +21 -3
- package/dist/theme/appearance.js.map +1 -1
- package/dist/theme/index.d.ts +3 -2
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -1
- package/dist/theme/sanitize.d.ts +7 -0
- package/dist/theme/sanitize.d.ts.map +1 -0
- package/dist/theme/sanitize.js +22 -0
- package/dist/theme/sanitize.js.map +1 -0
- package/dist/theme/theme.d.ts +12 -0
- package/dist/theme/theme.d.ts.map +1 -1
- package/dist/theme/theme.js +13 -2
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/token-themes.d.ts +114 -0
- package/dist/theme/token-themes.d.ts.map +1 -0
- package/dist/theme/token-themes.js +568 -0
- package/dist/theme/token-themes.js.map +1 -0
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/root.d.ts +8 -0
- package/dist/tokens/root.d.ts.map +1 -1
- package/dist/tokens/root.js +9 -2
- package/dist/tokens/root.js.map +1 -1
- package/docs/api.md +28 -2
- package/package.json +1 -1
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { aliasCssVariables, aliasPalette, type G9TokenAliasMap, g9AliasPresets } from './aliases.js';
|
|
2
2
|
export { applyThemeDefinition, exportTheme, type G9ThemeDefinition, type G9ThemeSource, g9AccentPresets, g9BuiltInThemes, importTheme, overriddenTokens, previewThemeDefinition, themeName, } from './appearance.js';
|
|
3
|
-
export { createG9ThemeRegistry, type G9AppearanceSettings, type G9AppTokenName, type G9AppTokenOptions, type G9EffectsMode, type G9FontScale, type G9PersonalThemeDraft, type G9SurfaceTone, type G9ThemeRegistry, type G9ThemeRegistryOptions, type G9ThemeRegistrySnapshot, type G9Wallpaper, g9ActiveThemeId, g9AppTokenNames, g9AppTokens, g9AppTokenVariables, g9BuildPersonalTheme, g9DefaultAppearance, g9EffectsEnabled, g9FontScaleFactors, g9NewPersonalThemeId, g9NormalizeAppearance, g9PersonalDraft, g9SanitizeTokens, g9ScaledType, g9ThemeFileName, g9ThemeFromInput, g9Wallpaper, g9Wallpapers, } from './appearance-kit.js';
|
|
3
|
+
export { createG9ThemeRegistry, type G9AppearanceSettings, type G9AppTokenName, type G9AppTokenOptions, type G9EffectsMode, type G9FontScale, type G9PersonalThemeDraft, type G9SurfaceTone, type G9ThemeRegistry, type G9ThemeRegistryOptions, type G9ThemeRegistrySnapshot, type G9Wallpaper, g9ActiveThemeId, g9AllAppTokenNames, g9AppearanceClasses, g9AppTokenNames, g9AppTokens, g9AppTokenVariables, g9BuildPersonalTheme, g9DefaultAppearance, g9EffectsEnabled, g9EffectsState, g9FontScaleFactors, g9NewPersonalThemeId, g9NormalizeAppearance, g9PersonalDraft, g9SanitizeTokens, g9ScaledType, g9ThemeFileName, g9ThemeFromInput, g9Wallpaper, g9Wallpapers, } from './appearance-kit.js';
|
|
4
4
|
export { createBrandPalette, createBrandPalettes, type G9BrandColors, type G9BrandPaletteOptions } from './brand.js';
|
|
5
5
|
export { applyAlpha, createBorderColor, createHoverColor, createPressedColor, darken, formatColor, type G9Color, G9ColorFormatError, type G9ColorInput, type G9Rgba, getContrastingTextColor, getContrastRatio, getLuminance, lighten, meetsWcagAA, meetsWcagAAA, mix, parseColor, parseMauiColor, rgba, toHex, toRgba, tryParseColor, withAlpha, withOpacity, } from './color.js';
|
|
6
6
|
export { contrastFailures, contrastReport, type G9ContrastResult, type G9ContrastRule, g9ContrastRules, } from './contrast.js';
|
|
@@ -9,6 +9,7 @@ export { g9Easings, lightnessOf, parseCssColor, resolveColorFunctions, resolveCs
|
|
|
9
9
|
export { createDesignRegistry, type G9DesignRegistry, type G9DesignRegistryOptions, type G9DesignToken, } from './design.js';
|
|
10
10
|
export { chartPalette, colorDistance, ensureContrast, fixedNeutralScale, fromOklch, type G9EnsureContrastOptions, type G9Oklch, type G9ScaleOptions, type G9TonalScale, type G9TonalStep, g9TonalSteps, interpolateStops, isInSrgbGamut, mixOklch, nearestTonalStep, neutralScale, oklchToHex, readableOn, tonalScale, toOklch, } from './oklch.js';
|
|
11
11
|
export { brandRecipe, designedRecipe, type G9ThemeRecipe, getRecipe, listRecipes, recipePalettes, registerRecipe, } from './recipe.js';
|
|
12
|
-
export { createPalette, createThemeStore, G9ColorScheme, type G9CustomPalettes, type G9PaletteOverrides, type G9ResolvedTheme, type G9ThemeListener, G9ThemeMode, type G9ThemeOptions, type G9ThemeSchedule, type G9ThemeStore, g9DefaultThemeSchedule, isScheduledDark, resolveColorScheme, resolveTheme, stockPalette, } from './theme.js';
|
|
12
|
+
export { createPalette, createThemeStore, G9ColorScheme, type G9CustomPalettes, type G9PaletteOverrides, type G9ResolvedTheme, type G9SchemeAppTokens, type G9ThemeListener, G9ThemeMode, type G9ThemeOptions, type G9ThemeSchedule, type G9ThemeStore, g9DefaultThemeSchedule, isScheduledDark, resolveColorScheme, resolveTheme, stockPalette, } from './theme.js';
|
|
13
|
+
export { type G9BackgroundStyle, type G9CssWallpaper, type G9EffectsReason, type G9ThemeTokenName, type G9ThemeTokens, type G9TokenPersonalDraft, type G9TokenTheme, type G9TokenThemeOptions, g9AccentTokens, g9BackgroundStyle, g9BuildTokenPersonalTheme, g9IsTokenTheme, g9ResolveThemeTokens, g9SubstituteTokens, g9ThemeBaseTokens, g9ThemeFromTokens, g9ThemeTokenGroups, g9ThemeTokenNames, g9TokenForPalette, g9TokenValueValid, resolveColorMix, } from './token-themes.js';
|
|
13
14
|
export { type G9ButtonVisualResult, type G9VariantColors, type G9VariantVars, hasSwatch, resolveButtonVariant, resolveButtonVariantVars, resolveProgressColor, resolveProgressColorVar, } from './variants.js';
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAClG,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,eAAe,EACf,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACtB,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,eAAe,EACf,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAClH,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,MAAM,EACN,WAAW,EACX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K,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,SAAS,EACT,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAClG,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,eAAe,EACf,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACtB,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,MAAM,kB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EACV,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,WAAW,EACX,cAAc,EACd,KAAK,aAAa,EAClB,SAAS,EACT,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,cAAc,EACd,iBAAiB,EACjB,yBAAyB,EACzB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,SAAS,EACT,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
package/dist/theme/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { aliasCssVariables, aliasPalette, g9AliasPresets } from "./aliases.js";
|
|
2
2
|
export { applyThemeDefinition, exportTheme, g9AccentPresets, g9BuiltInThemes, importTheme, overriddenTokens, previewThemeDefinition, themeName } from "./appearance.js";
|
|
3
|
-
export { createG9ThemeRegistry, g9ActiveThemeId, g9AppTokenNames, g9AppTokenVariables, g9AppTokens, g9BuildPersonalTheme, g9DefaultAppearance, g9EffectsEnabled, g9FontScaleFactors, g9NewPersonalThemeId, g9NormalizeAppearance, g9PersonalDraft, g9SanitizeTokens, g9ScaledType, g9ThemeFileName, g9ThemeFromInput, g9Wallpaper, g9Wallpapers } from "./appearance-kit.js";
|
|
3
|
+
export { createG9ThemeRegistry, g9ActiveThemeId, g9AllAppTokenNames, g9AppTokenNames, g9AppTokenVariables, g9AppTokens, g9AppearanceClasses, g9BuildPersonalTheme, g9DefaultAppearance, g9EffectsEnabled, g9EffectsState, g9FontScaleFactors, g9NewPersonalThemeId, g9NormalizeAppearance, g9PersonalDraft, g9SanitizeTokens, g9ScaledType, g9ThemeFileName, g9ThemeFromInput, g9Wallpaper, g9Wallpapers } from "./appearance-kit.js";
|
|
4
4
|
export { createBrandPalette, createBrandPalettes } from "./brand.js";
|
|
5
5
|
export { G9ColorFormatError, applyAlpha, createBorderColor, createHoverColor, createPressedColor, darken, formatColor, getContrastRatio, getContrastingTextColor, getLuminance, lighten, meetsWcagAA, meetsWcagAAA, mix, parseColor, parseMauiColor, rgba, toHex, toRgba, tryParseColor, withAlpha, withOpacity } from "./color.js";
|
|
6
6
|
export { contrastFailures, contrastReport, g9ContrastRules } from "./contrast.js";
|
|
@@ -10,4 +10,5 @@ export { createDesignRegistry } from "./design.js";
|
|
|
10
10
|
export { chartPalette, colorDistance, ensureContrast, fixedNeutralScale, fromOklch, g9TonalSteps, interpolateStops, isInSrgbGamut, mixOklch, nearestTonalStep, neutralScale, oklchToHex, readableOn, toOklch, tonalScale } from "./oklch.js";
|
|
11
11
|
export { brandRecipe, designedRecipe, getRecipe, listRecipes, recipePalettes, registerRecipe } from "./recipe.js";
|
|
12
12
|
export { G9ColorScheme, G9ThemeMode, createPalette, createThemeStore, g9DefaultThemeSchedule, isScheduledDark, resolveColorScheme, resolveTheme, stockPalette } from "./theme.js";
|
|
13
|
+
export { g9AccentTokens, g9BackgroundStyle, g9BuildTokenPersonalTheme, g9IsTokenTheme, g9ResolveThemeTokens, g9SubstituteTokens, g9ThemeBaseTokens, g9ThemeFromTokens, g9ThemeTokenGroups, g9ThemeTokenNames, g9TokenForPalette, g9TokenValueValid, resolveColorMix } from "./token-themes.js";
|
|
13
14
|
export { hasSwatch, resolveButtonVariant, resolveButtonVariantVars, resolveProgressColor, resolveProgressColorVar } from "./variants.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Only well-formed tokens of `allowed` names (a leading `--g9-` is dropped first; without `allowed`, any lower-case
|
|
3
|
+
* token name), from a theme that came from outside (the server, a file): values that cannot break out of a
|
|
4
|
+
* declaration, and pictures only as inline `data:` images.
|
|
5
|
+
*/
|
|
6
|
+
export declare function g9SanitizeTokens(input: Readonly<Record<string, unknown>> | null | undefined, allowed?: readonly string[]): Record<string, string>;
|
|
7
|
+
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/theme/sanitize.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,EAC3D,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAC1B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBxB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const MAX_VALUE = 2000;
|
|
2
|
+
function g9SanitizeTokens(input, allowed) {
|
|
3
|
+
const known = allowed ? new Set(allowed) : null;
|
|
4
|
+
const result = {};
|
|
5
|
+
if (!input) return result;
|
|
6
|
+
for (const [rawName, rawValue] of Object.entries(input)){
|
|
7
|
+
var _value_match;
|
|
8
|
+
const name = rawName.replace(/^--g9-/, '');
|
|
9
|
+
if ((known ? !known.has(name) : !/^[a-z][a-z0-9-]*$/.test(name)) || 'string' != typeof rawValue) continue;
|
|
10
|
+
const value = rawValue.trim();
|
|
11
|
+
if (!value || value.length > MAX_VALUE) continue;
|
|
12
|
+
if (/[;{}<>]|\/\*|\\/.test(value.replace(/url\("data:image\/svg\+xml,[^"]*"\)/g, ''))) continue;
|
|
13
|
+
const urls = null != (_value_match = value.match(/url\(([^)]*)\)/g)) ? _value_match : [];
|
|
14
|
+
if (!urls.some((url)=>!/^url\(["']?data:image\//.test(url))) {
|
|
15
|
+
if (!/expression\s*\(|javascript:/i.test(value)) result[name] = value;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
export { g9SanitizeTokens };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=sanitize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme/sanitize.js","sources":["../../src/theme/sanitize.ts"],"sourcesContent":["// The token sanitizer (2.5.8, moved here in 2.5.10 so the token themes and the appearance kit share it).\n\nconst MAX_VALUE = 2000;\n\n/**\n * Only well-formed tokens of `allowed` names (a leading `--g9-` is dropped first; without `allowed`, any lower-case\n * token name), from a theme that came from outside (the server, a file): values that cannot break out of a\n * declaration, and pictures only as inline `data:` images.\n */\nexport function g9SanitizeTokens(\n input: Readonly<Record<string, unknown>> | null | undefined,\n allowed?: readonly string[],\n): Record<string, string> {\n const known = allowed ? new Set(allowed) : null;\n const result: Record<string, string> = {};\n if (!input) return result;\n for (const [rawName, rawValue] of Object.entries(input)) {\n const name = rawName.replace(/^--g9-/, '');\n if ((known ? !known.has(name) : !/^[a-z][a-z0-9-]*$/.test(name)) || typeof rawValue !== 'string') continue;\n const value = rawValue.trim();\n if (!value || value.length > MAX_VALUE) continue;\n if (/[;{}<>]|\\/\\*|\\\\/.test(value.replace(/url\\(\"data:image\\/svg\\+xml,[^\"]*\"\\)/g, ''))) continue;\n const urls = value.match(/url\\(([^)]*)\\)/g) ?? [];\n if (urls.some((url) => !/^url\\([\"']?data:image\\//.test(url))) continue;\n if (/expression\\s*\\(|javascript:/i.test(value)) continue;\n result[name] = value;\n }\n return result;\n}\n"],"names":["MAX_VALUE","g9SanitizeTokens","input","allowed","known","Set","result","rawName","rawValue","Object","_value_match","name","value","urls","url"],"mappings":"AAEA,MAAMA,YAAY;AAOX,SAASC,iBACdC,KAA2D,EAC3DC,OAA2B;IAE3B,MAAMC,QAAQD,UAAU,IAAIE,IAAIF,WAAW;IAC3C,MAAMG,SAAiC,CAAC;IACxC,IAAI,CAACJ,OAAO,OAAOI;IACnB,KAAK,MAAM,CAACC,SAASC,SAAS,IAAIC,OAAO,OAAO,CAACP,OAAQ;YAM1CQ;QALb,MAAMC,OAAOJ,QAAQ,OAAO,CAAC,UAAU;QACvC,IAAKH,AAAAA,CAAAA,QAAQ,CAACA,MAAM,GAAG,CAACO,QAAQ,CAAC,oBAAoB,IAAI,CAACA,KAAI,KAAM,AAAoB,YAApB,OAAOH,UAAuB;QAClG,MAAMI,QAAQJ,SAAS,IAAI;QAC3B,IAAI,CAACI,SAASA,MAAM,MAAM,GAAGZ,WAAW;QACxC,IAAI,kBAAkB,IAAI,CAACY,MAAM,OAAO,CAAC,wCAAwC,MAAM;QACvF,MAAMC,OAAO,QAAAH,CAAAA,eAAAA,MAAM,KAAK,CAAC,kBAAiB,IAA7BA,eAAkC,EAAE;QACjD,KAAIG,KAAK,IAAI,CAAC,CAACC,MAAQ,CAAC,0BAA0B,IAAI,CAACA,OACvD;YAAA,KAAI,+BAA+B,IAAI,CAACF,QACxCN,MAAM,CAACK,KAAK,GAAGC;QADyC;IAE1D;IACA,OAAON;AACT"}
|
package/dist/theme/theme.d.ts
CHANGED
|
@@ -56,6 +56,16 @@ export interface G9ResolvedTheme {
|
|
|
56
56
|
readonly systemScheme: G9ColorScheme;
|
|
57
57
|
readonly scheme: G9ColorScheme;
|
|
58
58
|
readonly palette: G9PaletteValues;
|
|
59
|
+
/**
|
|
60
|
+
* The theme's app tokens for this scheme (2.5.10: a token theme's `--g9-<name>` values — bubbles, glass, wallpaper,
|
|
61
|
+
* depth, radii, motion), written by G9Provider beside the palette. Absent when the theme sets none.
|
|
62
|
+
*/
|
|
63
|
+
readonly appTokens?: Readonly<Record<string, string>>;
|
|
64
|
+
}
|
|
65
|
+
/** App tokens per scheme (2.5.10; {@link G9ResolvedTheme.appTokens}). */
|
|
66
|
+
export interface G9SchemeAppTokens {
|
|
67
|
+
readonly light?: Readonly<Record<string, string>>;
|
|
68
|
+
readonly dark?: Readonly<Record<string, string>>;
|
|
59
69
|
}
|
|
60
70
|
/**
|
|
61
71
|
* `'light'`/`'dark'` pick that scheme; `'system'` follows `systemScheme` (MAUI `G9Theme.ApplyCurrent`);
|
|
@@ -105,6 +115,8 @@ export interface G9ThemeStore {
|
|
|
105
115
|
* designer's change on the running app that never touches the app's own palettes or overrides.
|
|
106
116
|
*/
|
|
107
117
|
setDesignOverrides(overrides: G9PaletteOverrides | undefined): void;
|
|
118
|
+
/** A theme's app tokens per scheme (2.5.10), or none. Optional: stores written before 2.5.10 lack it. */
|
|
119
|
+
setAppTokens?(tokens: G9SchemeAppTokens | undefined): void;
|
|
108
120
|
/** The local hour (0–23), for the `'scheduled'` mode; repaints only when it crosses the schedule. */
|
|
109
121
|
setHour(hour: number): void;
|
|
110
122
|
/** The dark span of the `'scheduled'` mode. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EAIrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,SAAS,CAAC;AAEnD,oGAAoG;AACpG,eAAO,MAAM,WAAW;;;;;CAAsF,CAAC;AAC/G,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;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IAAI,CAAC;IAC7C,gEAAgE;IAChE,WAAW,IAAI;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAA;KAAE,CAAC;IAC7E;;;OAGG;IACH,KAAK,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IACrC,iGAAiG;IACjG,UAAU,IAAI,IAAI,CAAC;IACnB,gGAAgG;IAChG,QAAQ,IAAI,IAAI,CAAC;CAClB;AAsCD,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,cAAmB,GAAG,YAAY,CAkH3E"}
|
package/dist/theme/theme.js
CHANGED
|
@@ -109,6 +109,7 @@ function samePalette(a, b) {
|
|
|
109
109
|
return g9ColorTokens.every((token)=>a[token] === b[token]);
|
|
110
110
|
}
|
|
111
111
|
function resolveState(state) {
|
|
112
|
+
var _state_appTokens;
|
|
112
113
|
const { palettes, overrides } = state;
|
|
113
114
|
const next = resolveTheme({
|
|
114
115
|
mode: state.mode,
|
|
@@ -126,10 +127,15 @@ function resolveState(state) {
|
|
|
126
127
|
...next,
|
|
127
128
|
palette: Object.freeze(theme_layer(state.applied, overrides))
|
|
128
129
|
}) : next;
|
|
129
|
-
|
|
130
|
+
const designed = state.design ? Object.freeze({
|
|
130
131
|
...painted,
|
|
131
132
|
palette: Object.freeze(theme_layer(painted.palette, state.design))
|
|
132
133
|
}) : painted;
|
|
134
|
+
const tokens = null == (_state_appTokens = state.appTokens) ? void 0 : _state_appTokens[designed.scheme];
|
|
135
|
+
return tokens ? Object.freeze({
|
|
136
|
+
...designed,
|
|
137
|
+
appTokens: tokens
|
|
138
|
+
}) : designed;
|
|
133
139
|
}
|
|
134
140
|
function createThemeStore(options = {}) {
|
|
135
141
|
var _options_mode, _options_systemScheme, _options_hour, _options_schedule;
|
|
@@ -155,7 +161,7 @@ function createThemeStore(options = {}) {
|
|
|
155
161
|
};
|
|
156
162
|
const next = resolveState(nextState);
|
|
157
163
|
state = nextState;
|
|
158
|
-
const changed = next.mode !== snapshot.mode || next.systemScheme !== snapshot.systemScheme || next.scheme !== snapshot.scheme || !samePalette(next.palette, snapshot.palette);
|
|
164
|
+
const changed = next.mode !== snapshot.mode || next.systemScheme !== snapshot.systemScheme || next.scheme !== snapshot.scheme || next.appTokens !== snapshot.appTokens || !samePalette(next.palette, snapshot.palette);
|
|
159
165
|
if (changed) snapshot = next;
|
|
160
166
|
flush();
|
|
161
167
|
}
|
|
@@ -224,6 +230,11 @@ function createThemeStore(options = {}) {
|
|
|
224
230
|
design
|
|
225
231
|
});
|
|
226
232
|
},
|
|
233
|
+
setAppTokens (appTokens) {
|
|
234
|
+
commit({
|
|
235
|
+
appTokens
|
|
236
|
+
});
|
|
237
|
+
},
|
|
227
238
|
setHour (hour) {
|
|
228
239
|
if (!Number.isInteger(hour) || hour < 0 || hour > 23) throw new G9Error('theme-invalid-hour', `${hour} is not an hour (0–23).`);
|
|
229
240
|
const before = isScheduledDark(state.hour, state.schedule);
|
package/dist/theme/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme/theme.js","sources":["../../src/theme/theme.ts"],"sourcesContent":["import { G9Error } from '../errors';\nimport {\n type G9ColorToken,\n type G9PaletteValues,\n g9ColorTokens,\n g9DarkPalette,\n g9LightPalette,\n} from '../tokens/generated/palettes';\nimport { type G9Color, parseColor } from './color';\n\n/** Which theme the user chose (MAUI `AppTheme`: `Unspecified` is `system`, follow the platform). */\nexport const G9ThemeMode = { System: 'system', Light: 'light', Dark: 'dark', Scheduled: 'scheduled' } as const;\nexport type G9ThemeMode = (typeof G9ThemeMode)[keyof typeof G9ThemeMode];\n\n/**\n * When `'scheduled'` paints dark: from `darkFrom` (hour, 0–23) to `darkTo` (exclusive), across midnight when\n * `darkFrom > darkTo`. Default 18 → 7 (Riskara's evening theme).\n */\nexport interface G9ThemeSchedule {\n readonly darkFrom: number;\n readonly darkTo: number;\n}\n\n/** The default dark span of the scheduled mode: from 18:00 to 07:00. */\nexport const g9DefaultThemeSchedule: G9ThemeSchedule = Object.freeze({ darkFrom: 18, darkTo: 7 });\n\n/** True when `hour` falls in the schedule's dark span. */\nexport function isScheduledDark(hour: number, schedule: G9ThemeSchedule = g9DefaultThemeSchedule): boolean {\n const { darkFrom, darkTo } = schedule;\n if (darkFrom === darkTo) return false;\n return darkFrom < darkTo ? hour >= darkFrom && hour < darkTo : hour >= darkFrom || hour < darkTo;\n}\n\n/** The scheme actually painted. */\nexport const G9ColorScheme = { Light: 'light', Dark: 'dark' } as const;\nexport type G9ColorScheme = (typeof G9ColorScheme)[keyof typeof G9ColorScheme];\n\n/** Some tokens replaced by CSS colours. */\nexport type G9PaletteOverrides = { readonly [K in G9ColorToken]?: G9Color | undefined };\n\n/** App palettes replacing (all or some of) the stock light and dark palettes. */\nexport interface G9CustomPalettes {\n readonly light?: G9PaletteOverrides;\n readonly dark?: G9PaletteOverrides;\n}\n\n/** Inputs of theme resolution. */\nexport interface G9ThemeOptions {\n /** The user's choice. Default `'system'`. */\n readonly mode?: G9ThemeMode;\n /** What the platform currently asks for. Default `'light'`. */\n readonly systemScheme?: G9ColorScheme;\n /** App palettes layered over the stock ones, per scheme. */\n readonly palettes?: G9CustomPalettes;\n /** Last layer, applied whatever the scheme (e.g. a brand colour). */\n readonly overrides?: G9PaletteOverrides;\n /** The local hour (0–23) for `'scheduled'`. Default 12 (light). The provider keeps it current. */\n readonly hour?: number;\n /** The dark span for `'scheduled'`. */\n readonly schedule?: G9ThemeSchedule;\n}\n\n/** A resolved theme: what is painted and why. Frozen. */\nexport interface G9ResolvedTheme {\n readonly mode: G9ThemeMode;\n readonly systemScheme: G9ColorScheme;\n readonly scheme: G9ColorScheme;\n readonly palette: G9PaletteValues;\n}\n\nconst MODES: readonly string[] = ['system', 'light', 'dark', 'scheduled'];\nconst SCHEMES: readonly string[] = ['light', 'dark'];\n\nfunction check(kind: 'mode' | 'scheme', value: string): void {\n if (!(kind === 'mode' ? MODES : SCHEMES).includes(value)) {\n throw new G9Error(`theme-invalid-${kind}`, `\"${value}\" is not a theme ${kind}.`);\n }\n}\n\n/**\n * `'light'`/`'dark'` pick that scheme; `'system'` follows `systemScheme` (MAUI `G9Theme.ApplyCurrent`);\n * `'scheduled'` is dark during the schedule's span at `hour`.\n */\nexport function resolveColorScheme(\n mode: G9ThemeMode,\n systemScheme: G9ColorScheme,\n hour = 12,\n schedule: G9ThemeSchedule = g9DefaultThemeSchedule,\n): G9ColorScheme {\n check('mode', mode);\n check('scheme', systemScheme);\n if (mode === 'scheduled') return isScheduledDark(hour, schedule) ? 'dark' : 'light';\n return mode === 'system' ? systemScheme : mode;\n}\n\n/** The stock palette of a scheme (MAUI `G9ThemeLight` / `G9ThemeDark`). */\nexport const stockPalette = (scheme: G9ColorScheme): G9PaletteValues =>\n scheme === 'dark' ? g9DarkPalette : g9LightPalette;\n\nconst known = new Set<string>(g9ColorTokens);\n\n/** Complete palettes the library made itself (recipes, the brand generator): already valid, never re-parsed. */\nconst trusted = new WeakSet<object>();\n/** `palettes` objects whose schemes are built on first read (recipes): the inactive one is not built to be checked. */\nconst lazy = new WeakSet<object>();\n\n/** Marks a complete, generated palette as valid (internal: recipes and the brand generator). */\nexport function trustPalette<T extends G9PaletteValues>(palette: T): T {\n trusted.add(palette);\n return palette;\n}\n\n/**\n * Palettes per scheme, each built on first read and kept (a recipe's dark palette costs nothing until the app turns\n * dark). Internal: `recipePalettes`, `applyThemeDefinition`.\n */\nexport function lazyPalettes(build: (scheme: G9ColorScheme) => G9PaletteValues): G9CustomPalettes {\n const made: Partial<Record<G9ColorScheme, G9PaletteValues>> = {};\n const get = (scheme: G9ColorScheme) => {\n const hit = made[scheme];\n if (hit) return hit;\n const p = trustPalette(build(scheme));\n made[scheme] = p;\n return p;\n };\n const out = {} as G9CustomPalettes;\n Object.defineProperty(out, 'light', { enumerable: true, get: () => get('light') });\n Object.defineProperty(out, 'dark', { enumerable: true, get: () => get('dark') });\n lazy.add(out);\n return Object.freeze(out);\n}\n\nfunction layer(base: G9PaletteValues, overrides: G9PaletteOverrides | undefined): G9PaletteValues {\n if (!overrides) return base;\n if (trusted.has(overrides)) return overrides as G9PaletteValues;\n const next: Record<string, string> = { ...base };\n for (const [token, color] of Object.entries(overrides)) {\n if (color === undefined) continue;\n if (!known.has(token)) throw new G9Error('theme-unknown-token', `\"${token}\" is not a G9ColorToken.`);\n parseColor(color);\n next[token] = color;\n }\n return next as G9PaletteValues;\n}\n\n/**\n * Validates a complete palette (every token, every value a readable colour) and returns a frozen copy in token order.\n * @throws {G9Error} `theme-incomplete-palette` / `theme-unknown-token`, or {@link G9ColorFormatError}.\n */\nexport function createPalette(values: G9PaletteValues): G9PaletteValues {\n const missing = g9ColorTokens.filter((token) => typeof values[token] !== 'string');\n if (missing.length) {\n throw new G9Error('theme-incomplete-palette', `Palette is missing: ${missing.join(', ')}.`);\n }\n const ordered: Record<string, string> = {};\n for (const token of g9ColorTokens) ordered[token] = values[token];\n return Object.freeze(layer(ordered as G9PaletteValues, values));\n}\n\n/**\n * Resolves the painted theme: the stock palette of the effective scheme, then the app palette for that scheme, then\n * `overrides`. Every supplied value is validated; nothing invalid is silently kept.\n */\nexport function resolveTheme(options: G9ThemeOptions = {}): G9ResolvedTheme {\n const mode = options.mode ?? 'system';\n const systemScheme = options.systemScheme ?? 'light';\n const scheme = resolveColorScheme(mode, systemScheme, options.hour, options.schedule);\n // Validate the inactive scheme's palette too, so a typo surfaces now rather than on the next theme switch — unless the\n // palettes are a recipe's, built on demand and valid by construction.\n const inactive: G9ColorScheme = scheme === 'dark' ? 'light' : 'dark';\n if (!(options.palettes && lazy.has(options.palettes))) layer(stockPalette(inactive), options.palettes?.[inactive]);\n const custom = layer(stockPalette(scheme), options.palettes?.[scheme]);\n const palette = Object.freeze(layer(custom, options.overrides));\n return Object.freeze({ mode, systemScheme, scheme, palette });\n}\n\n/** Listener of {@link G9ThemeStore}; receives the snapshot taken at notify time. */\nexport type G9ThemeListener = (theme: G9ResolvedTheme) => void;\n\n/**\n * The live theme (MAUI `G9Palette.Current` + `G9Theme`): one snapshot, replaced on every change, and listeners told\n * once per change. Works with `useSyncExternalStore` (`subscribe` / `getSnapshot`).\n */\nexport interface G9ThemeStore {\n /** The current theme; the same object until something visible changes. */\n getSnapshot(): G9ResolvedTheme;\n /** Adds a listener; returns its unsubscribe function. */\n subscribe(listener: G9ThemeListener): () => void;\n /** The user's choice (MAUI `G9Theme.ChangeTheme`). Persisting it is the caller's job (see the guide). */\n setMode(mode: G9ThemeMode): void;\n /** Report the platform scheme (MAUI `RequestedThemeChanged`); repaints only while the mode is `'system'`. */\n setSystemScheme(scheme: G9ColorScheme): void;\n /** Replace the app palettes. */\n setPalettes(palettes: G9CustomPalettes | undefined): void;\n /** Replace the override layer. */\n setOverrides(overrides: G9PaletteOverrides | undefined): void;\n /**\n * The live-design layer, above everything (G9AppPilot `design.set` through {@link createDesignRegistry}): a\n * designer's change on the running app that never touches the app's own palettes or overrides.\n */\n setDesignOverrides(overrides: G9PaletteOverrides | undefined): void;\n /** The local hour (0–23), for the `'scheduled'` mode; repaints only when it crosses the schedule. */\n setHour(hour: number): void;\n /** The dark span of the `'scheduled'` mode. */\n setSchedule(schedule: G9ThemeSchedule): void;\n /** The current hour and schedule (what `'scheduled'` reads). */\n getSchedule(): { readonly hour: number; readonly schedule: G9ThemeSchedule };\n /**\n * Paint `values` as the complete palette (MAUI `G9Palette.Apply`) until the next mode or scheme change re-resolves\n * the theme, as the next `G9Theme.ApplyCurrent` did. The override layer still applies on top.\n */\n apply(values: G9PaletteValues): void;\n /** Open a batch: changes inside are notified once, by the outermost `endBatch`. Batches nest. */\n beginBatch(): void;\n /** Close a batch; the outermost close notifies once, and only if the theme actually changed. */\n endBatch(): void;\n}\n\nfunction samePalette(a: G9PaletteValues, b: G9PaletteValues): boolean {\n return g9ColorTokens.every((token) => a[token] === b[token]);\n}\n\ninterface StoreState {\n readonly mode: G9ThemeMode;\n readonly systemScheme: G9ColorScheme;\n readonly palettes: G9CustomPalettes | undefined;\n readonly overrides: G9PaletteOverrides | undefined;\n readonly applied: G9PaletteValues | undefined;\n readonly hour: number;\n readonly schedule: G9ThemeSchedule;\n readonly design: G9PaletteOverrides | undefined;\n}\n\nfunction resolveState(state: StoreState): G9ResolvedTheme {\n const { palettes, overrides } = state;\n const next = resolveTheme({\n mode: state.mode,\n systemScheme: state.systemScheme,\n hour: state.hour,\n schedule: state.schedule,\n ...(palettes ? { palettes } : {}),\n ...(overrides ? { overrides } : {}),\n });\n const painted = state.applied\n ? Object.freeze({ ...next, palette: Object.freeze(layer(state.applied, overrides)) })\n : next;\n return state.design\n ? Object.freeze({ ...painted, palette: Object.freeze(layer(painted.palette, state.design)) })\n : painted;\n}\n\n/** Creates a {@link G9ThemeStore}. Options are validated like {@link resolveTheme}. */\nexport function createThemeStore(options: G9ThemeOptions = {}): G9ThemeStore {\n let state: StoreState = {\n mode: options.mode ?? 'system',\n systemScheme: options.systemScheme ?? 'light',\n palettes: options.palettes,\n overrides: options.overrides,\n applied: undefined,\n hour: options.hour ?? 12,\n schedule: options.schedule ?? g9DefaultThemeSchedule,\n design: undefined,\n };\n let snapshot = resolveState(state);\n let notified = snapshot;\n const listeners = new Set<G9ThemeListener>();\n let depth = 0;\n let notifying = false;\n\n // Resolve first, commit second: an invalid input throws and leaves the store untouched.\n function commit(patch: Partial<StoreState>): void {\n const nextState = { ...state, ...patch };\n const next = resolveState(nextState);\n state = nextState;\n const changed =\n next.mode !== snapshot.mode ||\n next.systemScheme !== snapshot.systemScheme ||\n next.scheme !== snapshot.scheme ||\n !samePalette(next.palette, snapshot.palette);\n if (changed) snapshot = next;\n flush();\n }\n\n function flush(): void {\n // Re-entrant changes made by a listener are delivered after the current round, with the then-current snapshot\n // (MAUI ApplyCurrent remembered a request made mid-switch and ran it afterwards).\n if (depth > 0 || notifying) return;\n notifying = true;\n let failure: unknown;\n let failed = false;\n try {\n while (notified !== snapshot) {\n notified = snapshot;\n const current = snapshot;\n for (const listener of Array.from(listeners)) {\n if (!listeners.has(listener)) continue;\n try {\n listener(current);\n } catch (error) {\n if (!failed) {\n failed = true;\n failure = error;\n }\n }\n }\n }\n } finally {\n notifying = false;\n }\n if (failed) throw failure;\n }\n\n return {\n getSnapshot: () => snapshot,\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n setMode(mode) {\n check('mode', mode);\n // A different choice re-resolves the theme, dropping a palette painted with apply().\n commit(mode === state.mode ? { mode } : { mode, applied: undefined });\n },\n setSystemScheme(systemScheme) {\n check('scheme', systemScheme);\n const repaint = systemScheme !== state.systemScheme && state.mode === 'system';\n commit(repaint ? { systemScheme, applied: undefined } : { systemScheme });\n },\n setPalettes(palettes) {\n commit({ palettes });\n },\n setOverrides(overrides) {\n commit({ overrides });\n },\n setDesignOverrides(design) {\n commit({ design });\n },\n setHour(hour) {\n if (!Number.isInteger(hour) || hour < 0 || hour > 23)\n throw new G9Error('theme-invalid-hour', `${hour} is not an hour (0–23).`);\n const before = isScheduledDark(state.hour, state.schedule);\n const crosses = state.mode === 'scheduled' && isScheduledDark(hour, state.schedule) !== before;\n commit(crosses ? { hour, applied: undefined } : { hour });\n },\n setSchedule(schedule) {\n commit({ schedule: Object.freeze({ ...schedule }) });\n },\n getSchedule: () => ({ hour: state.hour, schedule: state.schedule }),\n apply(values) {\n commit({ applied: createPalette(values) });\n },\n beginBatch() {\n depth += 1;\n },\n endBatch() {\n if (depth === 0) return;\n depth -= 1;\n flush();\n },\n };\n}\n"],"names":["G9ThemeMode","g9DefaultThemeSchedule","Object","isScheduledDark","hour","schedule","darkFrom","darkTo","G9ColorScheme","MODES","SCHEMES","check","kind","value","G9Error","resolveColorScheme","mode","systemScheme","stockPalette","scheme","g9DarkPalette","g9LightPalette","known","Set","g9ColorTokens","trusted","WeakSet","lazy","trustPalette","palette","lazyPalettes","build","made","get","hit","p","out","layer","base","overrides","next","token","color","undefined","parseColor","createPalette","values","missing","ordered","resolveTheme","options","_options_mode","_options_systemScheme","_options_palettes","_options_palettes1","inactive","custom","samePalette","a","b","resolveState","state","palettes","painted","createThemeStore","_options_hour","_options_schedule","snapshot","notified","listeners","depth","notifying","commit","patch","nextState","changed","flush","failure","failed","current","listener","Array","error","repaint","design","Number","before","crosses"],"mappings":";;;AAWO,MAAMA,cAAc;IAAE,QAAQ;IAAU,OAAO;IAAS,MAAM;IAAQ,WAAW;AAAY;AAa7F,MAAMC,yBAA0CC,OAAO,MAAM,CAAC;IAAE,UAAU;IAAI,QAAQ;AAAE;AAGxF,SAASC,gBAAgBC,IAAY,EAAEC,WAA4BJ,sBAAsB;IAC9F,MAAM,EAAEK,QAAQ,EAAEC,MAAM,EAAE,GAAGF;IAC7B,IAAIC,aAAaC,QAAQ,OAAO;IAChC,OAAOD,WAAWC,SAASH,QAAQE,YAAYF,OAAOG,SAASH,QAAQE,YAAYF,OAAOG;AAC5F;AAGO,MAAMC,gBAAgB;IAAE,OAAO;IAAS,MAAM;AAAO;AAoC5D,MAAMC,QAA2B;IAAC;IAAU;IAAS;IAAQ;CAAY;AACzE,MAAMC,UAA6B;IAAC;IAAS;CAAO;AAEpD,SAASC,MAAMC,IAAuB,EAAEC,KAAa;IACnD,IAAI,CAAED,AAAAA,CAAAA,AAAS,WAATA,OAAkBH,QAAQC,OAAM,EAAG,QAAQ,CAACG,QAChD,MAAM,IAAIC,QAAQ,CAAC,cAAc,EAAEF,MAAM,EAAE,CAAC,CAAC,EAAEC,MAAM,iBAAiB,EAAED,KAAK,CAAC,CAAC;AAEnF;AAMO,SAASG,mBACdC,IAAiB,EACjBC,YAA2B,EAC3Bb,OAAO,EAAE,EACTC,WAA4BJ,sBAAsB;IAElDU,MAAM,QAAQK;IACdL,MAAM,UAAUM;IAChB,IAAID,AAAS,gBAATA,MAAsB,OAAOb,gBAAgBC,MAAMC,YAAY,SAAS;IAC5E,OAAOW,AAAS,aAATA,OAAoBC,eAAeD;AAC5C;AAGO,MAAME,eAAe,CAACC,S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I;YACjEW,OAAOW,UAAU;gBAAElE;gBAAc,SAAS0B;YAAU,IAAI;gBAAE1B;YAAa;QACzE;QACA,aAAY6C,QAAQ;YAClBU,OAAO;gBAAEV;YAAS;QACpB;QACA,cAAavB,SAAS;YACpBiC,OAAO;gBAAEjC;YAAU;QACrB;QACA,oBAAmB6C,MAAM;YACvBZ,OAAO;gBAAEY;YAAO;QAClB;QACA,SAAQhF,IAAI;YACV,IAAI,CAACiF,OAAO,SAAS,CAACjF,SAASA,OAAO,KAAKA,OAAO,IAChD,MAAM,IAAIU,QAAQ,sBAAsB,GAAGV,KAAK,uBAAuB,CAAC;YAC1E,MAAMkF,SAASnF,gBAAgB0D,MAAM,IAAI,EAAEA,MAAM,QAAQ;YACzD,MAAM0B,UAAU1B,AAAe,gBAAfA,MAAM,IAAI,IAAoB1D,gBAAgBC,MAAMyD,MAAM,QAAQ,MAAMyB;YACxFd,OAAOe,UAAU;gBAAEnF;gBAAM,SAASuC;YAAU,IAAI;gBAAEvC;YAAK;QACzD;QACA,aAAYC,QAAQ;YAClBmE,OAAO;gBAAE,UAAUtE,OAAO,MAAM,CAAC;oBAAE,GAAGG,QAAQ;gBAAC;YAAG;QACpD;QACA,aAAa,IAAO;gBAAE,MAAMwD,MAAM,IAAI;gBAAE,UAAUA,MAAM,QAAQ;YAAC;QACjE,OAAMf,MAAM;YACV0B,OAAO;gBAAE,SAAS3B,cAAcC;YAAQ;QAC1C;QACA;YACEwB,SAAS;QACX;QACA;YACE,IAAIA,AAAU,MAAVA,OAAa;YACjBA,SAAS;YACTM;QACF;IACF;AACF"}
|
|
1
|
+
{"version":3,"file":"theme/theme.js","sources":["../../src/theme/theme.ts"],"sourcesContent":["import { G9Error } from '../errors';\nimport {\n type G9ColorToken,\n type G9PaletteValues,\n g9ColorTokens,\n g9DarkPalette,\n g9LightPalette,\n} from '../tokens/generated/palettes';\nimport { type G9Color, parseColor } from './color';\n\n/** Which theme the user chose (MAUI `AppTheme`: `Unspecified` is `system`, follow the platform). */\nexport const G9ThemeMode = { System: 'system', Light: 'light', Dark: 'dark', Scheduled: 'scheduled' } as const;\nexport type G9ThemeMode = (typeof G9ThemeMode)[keyof typeof G9ThemeMode];\n\n/**\n * When `'scheduled'` paints dark: from `darkFrom` (hour, 0–23) to `darkTo` (exclusive), across midnight when\n * `darkFrom > darkTo`. Default 18 → 7 (Riskara's evening theme).\n */\nexport interface G9ThemeSchedule {\n readonly darkFrom: number;\n readonly darkTo: number;\n}\n\n/** The default dark span of the scheduled mode: from 18:00 to 07:00. */\nexport const g9DefaultThemeSchedule: G9ThemeSchedule = Object.freeze({ darkFrom: 18, darkTo: 7 });\n\n/** True when `hour` falls in the schedule's dark span. */\nexport function isScheduledDark(hour: number, schedule: G9ThemeSchedule = g9DefaultThemeSchedule): boolean {\n const { darkFrom, darkTo } = schedule;\n if (darkFrom === darkTo) return false;\n return darkFrom < darkTo ? hour >= darkFrom && hour < darkTo : hour >= darkFrom || hour < darkTo;\n}\n\n/** The scheme actually painted. */\nexport const G9ColorScheme = { Light: 'light', Dark: 'dark' } as const;\nexport type G9ColorScheme = (typeof G9ColorScheme)[keyof typeof G9ColorScheme];\n\n/** Some tokens replaced by CSS colours. */\nexport type G9PaletteOverrides = { readonly [K in G9ColorToken]?: G9Color | undefined };\n\n/** App palettes replacing (all or some of) the stock light and dark palettes. */\nexport interface G9CustomPalettes {\n readonly light?: G9PaletteOverrides;\n readonly dark?: G9PaletteOverrides;\n}\n\n/** Inputs of theme resolution. */\nexport interface G9ThemeOptions {\n /** The user's choice. Default `'system'`. */\n readonly mode?: G9ThemeMode;\n /** What the platform currently asks for. Default `'light'`. */\n readonly systemScheme?: G9ColorScheme;\n /** App palettes layered over the stock ones, per scheme. */\n readonly palettes?: G9CustomPalettes;\n /** Last layer, applied whatever the scheme (e.g. a brand colour). */\n readonly overrides?: G9PaletteOverrides;\n /** The local hour (0–23) for `'scheduled'`. Default 12 (light). The provider keeps it current. */\n readonly hour?: number;\n /** The dark span for `'scheduled'`. */\n readonly schedule?: G9ThemeSchedule;\n}\n\n/** A resolved theme: what is painted and why. Frozen. */\nexport interface G9ResolvedTheme {\n readonly mode: G9ThemeMode;\n readonly systemScheme: G9ColorScheme;\n readonly scheme: G9ColorScheme;\n readonly palette: G9PaletteValues;\n /**\n * The theme's app tokens for this scheme (2.5.10: a token theme's `--g9-<name>` values — bubbles, glass, wallpaper,\n * depth, radii, motion), written by G9Provider beside the palette. Absent when the theme sets none.\n */\n readonly appTokens?: Readonly<Record<string, string>>;\n}\n\n/** App tokens per scheme (2.5.10; {@link G9ResolvedTheme.appTokens}). */\nexport interface G9SchemeAppTokens {\n readonly light?: Readonly<Record<string, string>>;\n readonly dark?: Readonly<Record<string, string>>;\n}\n\nconst MODES: readonly string[] = ['system', 'light', 'dark', 'scheduled'];\nconst SCHEMES: readonly string[] = ['light', 'dark'];\n\nfunction check(kind: 'mode' | 'scheme', value: string): void {\n if (!(kind === 'mode' ? MODES : SCHEMES).includes(value)) {\n throw new G9Error(`theme-invalid-${kind}`, `\"${value}\" is not a theme ${kind}.`);\n }\n}\n\n/**\n * `'light'`/`'dark'` pick that scheme; `'system'` follows `systemScheme` (MAUI `G9Theme.ApplyCurrent`);\n * `'scheduled'` is dark during the schedule's span at `hour`.\n */\nexport function resolveColorScheme(\n mode: G9ThemeMode,\n systemScheme: G9ColorScheme,\n hour = 12,\n schedule: G9ThemeSchedule = g9DefaultThemeSchedule,\n): G9ColorScheme {\n check('mode', mode);\n check('scheme', systemScheme);\n if (mode === 'scheduled') return isScheduledDark(hour, schedule) ? 'dark' : 'light';\n return mode === 'system' ? systemScheme : mode;\n}\n\n/** The stock palette of a scheme (MAUI `G9ThemeLight` / `G9ThemeDark`). */\nexport const stockPalette = (scheme: G9ColorScheme): G9PaletteValues =>\n scheme === 'dark' ? g9DarkPalette : g9LightPalette;\n\nconst known = new Set<string>(g9ColorTokens);\n\n/** Complete palettes the library made itself (recipes, the brand generator): already valid, never re-parsed. */\nconst trusted = new WeakSet<object>();\n/** `palettes` objects whose schemes are built on first read (recipes): the inactive one is not built to be checked. */\nconst lazy = new WeakSet<object>();\n\n/** Marks a complete, generated palette as valid (internal: recipes and the brand generator). */\nexport function trustPalette<T extends G9PaletteValues>(palette: T): T {\n trusted.add(palette);\n return palette;\n}\n\n/**\n * Palettes per scheme, each built on first read and kept (a recipe's dark palette costs nothing until the app turns\n * dark). Internal: `recipePalettes`, `applyThemeDefinition`.\n */\nexport function lazyPalettes(build: (scheme: G9ColorScheme) => G9PaletteValues): G9CustomPalettes {\n const made: Partial<Record<G9ColorScheme, G9PaletteValues>> = {};\n const get = (scheme: G9ColorScheme) => {\n const hit = made[scheme];\n if (hit) return hit;\n const p = trustPalette(build(scheme));\n made[scheme] = p;\n return p;\n };\n const out = {} as G9CustomPalettes;\n Object.defineProperty(out, 'light', { enumerable: true, get: () => get('light') });\n Object.defineProperty(out, 'dark', { enumerable: true, get: () => get('dark') });\n lazy.add(out);\n return Object.freeze(out);\n}\n\nfunction layer(base: G9PaletteValues, overrides: G9PaletteOverrides | undefined): G9PaletteValues {\n if (!overrides) return base;\n if (trusted.has(overrides)) return overrides as G9PaletteValues;\n const next: Record<string, string> = { ...base };\n for (const [token, color] of Object.entries(overrides)) {\n if (color === undefined) continue;\n if (!known.has(token)) throw new G9Error('theme-unknown-token', `\"${token}\" is not a G9ColorToken.`);\n parseColor(color);\n next[token] = color;\n }\n return next as G9PaletteValues;\n}\n\n/**\n * Validates a complete palette (every token, every value a readable colour) and returns a frozen copy in token order.\n * @throws {G9Error} `theme-incomplete-palette` / `theme-unknown-token`, or {@link G9ColorFormatError}.\n */\nexport function createPalette(values: G9PaletteValues): G9PaletteValues {\n const missing = g9ColorTokens.filter((token) => typeof values[token] !== 'string');\n if (missing.length) {\n throw new G9Error('theme-incomplete-palette', `Palette is missing: ${missing.join(', ')}.`);\n }\n const ordered: Record<string, string> = {};\n for (const token of g9ColorTokens) ordered[token] = values[token];\n return Object.freeze(layer(ordered as G9PaletteValues, values));\n}\n\n/**\n * Resolves the painted theme: the stock palette of the effective scheme, then the app palette for that scheme, then\n * `overrides`. Every supplied value is validated; nothing invalid is silently kept.\n */\nexport function resolveTheme(options: G9ThemeOptions = {}): G9ResolvedTheme {\n const mode = options.mode ?? 'system';\n const systemScheme = options.systemScheme ?? 'light';\n const scheme = resolveColorScheme(mode, systemScheme, options.hour, options.schedule);\n // Validate the inactive scheme's palette too, so a typo surfaces now rather than on the next theme switch — unless the\n // palettes are a recipe's, built on demand and valid by construction.\n const inactive: G9ColorScheme = scheme === 'dark' ? 'light' : 'dark';\n if (!(options.palettes && lazy.has(options.palettes))) layer(stockPalette(inactive), options.palettes?.[inactive]);\n const custom = layer(stockPalette(scheme), options.palettes?.[scheme]);\n const palette = Object.freeze(layer(custom, options.overrides));\n return Object.freeze({ mode, systemScheme, scheme, palette });\n}\n\n/** Listener of {@link G9ThemeStore}; receives the snapshot taken at notify time. */\nexport type G9ThemeListener = (theme: G9ResolvedTheme) => void;\n\n/**\n * The live theme (MAUI `G9Palette.Current` + `G9Theme`): one snapshot, replaced on every change, and listeners told\n * once per change. Works with `useSyncExternalStore` (`subscribe` / `getSnapshot`).\n */\nexport interface G9ThemeStore {\n /** The current theme; the same object until something visible changes. */\n getSnapshot(): G9ResolvedTheme;\n /** Adds a listener; returns its unsubscribe function. */\n subscribe(listener: G9ThemeListener): () => void;\n /** The user's choice (MAUI `G9Theme.ChangeTheme`). Persisting it is the caller's job (see the guide). */\n setMode(mode: G9ThemeMode): void;\n /** Report the platform scheme (MAUI `RequestedThemeChanged`); repaints only while the mode is `'system'`. */\n setSystemScheme(scheme: G9ColorScheme): void;\n /** Replace the app palettes. */\n setPalettes(palettes: G9CustomPalettes | undefined): void;\n /** Replace the override layer. */\n setOverrides(overrides: G9PaletteOverrides | undefined): void;\n /**\n * The live-design layer, above everything (G9AppPilot `design.set` through {@link createDesignRegistry}): a\n * designer's change on the running app that never touches the app's own palettes or overrides.\n */\n setDesignOverrides(overrides: G9PaletteOverrides | undefined): void;\n /** A theme's app tokens per scheme (2.5.10), or none. Optional: stores written before 2.5.10 lack it. */\n setAppTokens?(tokens: G9SchemeAppTokens | undefined): void;\n /** The local hour (0–23), for the `'scheduled'` mode; repaints only when it crosses the schedule. */\n setHour(hour: number): void;\n /** The dark span of the `'scheduled'` mode. */\n setSchedule(schedule: G9ThemeSchedule): void;\n /** The current hour and schedule (what `'scheduled'` reads). */\n getSchedule(): { readonly hour: number; readonly schedule: G9ThemeSchedule };\n /**\n * Paint `values` as the complete palette (MAUI `G9Palette.Apply`) until the next mode or scheme change re-resolves\n * the theme, as the next `G9Theme.ApplyCurrent` did. The override layer still applies on top.\n */\n apply(values: G9PaletteValues): void;\n /** Open a batch: changes inside are notified once, by the outermost `endBatch`. Batches nest. */\n beginBatch(): void;\n /** Close a batch; the outermost close notifies once, and only if the theme actually changed. */\n endBatch(): void;\n}\n\nfunction samePalette(a: G9PaletteValues, b: G9PaletteValues): boolean {\n return g9ColorTokens.every((token) => a[token] === b[token]);\n}\n\ninterface StoreState {\n readonly mode: G9ThemeMode;\n readonly systemScheme: G9ColorScheme;\n readonly palettes: G9CustomPalettes | undefined;\n readonly overrides: G9PaletteOverrides | undefined;\n readonly applied: G9PaletteValues | undefined;\n readonly hour: number;\n readonly schedule: G9ThemeSchedule;\n readonly design: G9PaletteOverrides | undefined;\n readonly appTokens?: G9SchemeAppTokens | undefined;\n}\n\nfunction resolveState(state: StoreState): G9ResolvedTheme {\n const { palettes, overrides } = state;\n const next = resolveTheme({\n mode: state.mode,\n systemScheme: state.systemScheme,\n hour: state.hour,\n schedule: state.schedule,\n ...(palettes ? { palettes } : {}),\n ...(overrides ? { overrides } : {}),\n });\n const painted = state.applied\n ? Object.freeze({ ...next, palette: Object.freeze(layer(state.applied, overrides)) })\n : next;\n const designed = state.design\n ? Object.freeze({ ...painted, palette: Object.freeze(layer(painted.palette, state.design)) })\n : painted;\n const tokens = state.appTokens?.[designed.scheme];\n return tokens ? Object.freeze({ ...designed, appTokens: tokens }) : designed;\n}\n\n/** Creates a {@link G9ThemeStore}. Options are validated like {@link resolveTheme}. */\nexport function createThemeStore(options: G9ThemeOptions = {}): G9ThemeStore {\n let state: StoreState = {\n mode: options.mode ?? 'system',\n systemScheme: options.systemScheme ?? 'light',\n palettes: options.palettes,\n overrides: options.overrides,\n applied: undefined,\n hour: options.hour ?? 12,\n schedule: options.schedule ?? g9DefaultThemeSchedule,\n design: undefined,\n };\n let snapshot = resolveState(state);\n let notified = snapshot;\n const listeners = new Set<G9ThemeListener>();\n let depth = 0;\n let notifying = false;\n\n // Resolve first, commit second: an invalid input throws and leaves the store untouched.\n function commit(patch: Partial<StoreState>): void {\n const nextState = { ...state, ...patch };\n const next = resolveState(nextState);\n state = nextState;\n const changed =\n next.mode !== snapshot.mode ||\n next.systemScheme !== snapshot.systemScheme ||\n next.scheme !== snapshot.scheme ||\n next.appTokens !== snapshot.appTokens ||\n !samePalette(next.palette, snapshot.palette);\n if (changed) snapshot = next;\n flush();\n }\n\n function flush(): void {\n // Re-entrant changes made by a listener are delivered after the current round, with the then-current snapshot\n // (MAUI ApplyCurrent remembered a request made mid-switch and ran it afterwards).\n if (depth > 0 || notifying) return;\n notifying = true;\n let failure: unknown;\n let failed = false;\n try {\n while (notified !== snapshot) {\n notified = snapshot;\n const current = snapshot;\n for (const listener of Array.from(listeners)) {\n if (!listeners.has(listener)) continue;\n try {\n listener(current);\n } catch (error) {\n if (!failed) {\n failed = true;\n failure = error;\n }\n }\n }\n }\n } finally {\n notifying = false;\n }\n if (failed) throw failure;\n }\n\n return {\n getSnapshot: () => snapshot,\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n setMode(mode) {\n check('mode', mode);\n // A different choice re-resolves the theme, dropping a palette painted with apply().\n commit(mode === state.mode ? { mode } : { mode, applied: undefined });\n },\n setSystemScheme(systemScheme) {\n check('scheme', systemScheme);\n const repaint = systemScheme !== state.systemScheme && state.mode === 'system';\n commit(repaint ? { systemScheme, applied: undefined } : { systemScheme });\n },\n setPalettes(palettes) {\n commit({ palettes });\n },\n setOverrides(overrides) {\n commit({ overrides });\n },\n setDesignOverrides(design) {\n commit({ design });\n },\n setAppTokens(appTokens) {\n commit({ appTokens });\n },\n setHour(hour) {\n if (!Number.isInteger(hour) || hour < 0 || hour > 23)\n throw new G9Error('theme-invalid-hour', `${hour} is not an hour (0–23).`);\n const before = isScheduledDark(state.hour, state.schedule);\n const crosses = state.mode === 'scheduled' && isScheduledDark(hour, state.schedule) !== before;\n commit(crosses ? { hour, applied: undefined } : { hour });\n },\n setSchedule(schedule) {\n commit({ schedule: Object.freeze({ ...schedule }) });\n },\n getSchedule: () => ({ hour: state.hour, schedule: state.schedule }),\n apply(values) {\n commit({ applied: createPalette(values) });\n },\n beginBatch() {\n depth += 1;\n },\n endBatch() {\n if (depth === 0) return;\n depth -= 1;\n flush();\n },\n };\n}\n"],"names":["G9ThemeMode","g9DefaultThemeSchedule","Object","isScheduledDark","hour","schedule","darkFrom","darkTo","G9ColorScheme","MODES","SCHEMES","check","kind","value","G9Error","resolveColorScheme","mode","systemScheme","stockPalette","scheme","g9DarkPalette","g9LightPalette","known","Set","g9ColorTokens","trusted","WeakSet","lazy","trustPalette","palette","lazyPalettes","build","made","get","hit","p","out","layer","base","overrides","next","token","color","undefined","parseColor","createPalette","values","missing","ordered","resolveTheme","options","_options_mode","_options_systemScheme","_options_palettes","_options_palettes1","inactive","custom","samePalette","a","b","resolveState","state","_state_appTokens","palettes","painted","designed","tokens","createThemeStore","_options_hour","_options_schedule","snapshot","notified","listeners","depth","notifying","commit","patch","nextState","changed","flush","failure","failed","current","listener","Array","error","repaint","design","appTokens","Number","before","crosses"],"mappings":";;;AAWO,MAAMA,cAAc;IAAE,QAAQ;IAAU,OAAO;IAAS,MAAM;IAAQ,WAAW;AAAY;AAa7F,MAAMC,yBAA0CC,OAAO,MAAM,CAAC;IAAE,UAAU;IAAI,QAAQ;AAAE;AAGxF,SAASC,gBAAgBC,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;YAClBY,OAAO;gBAAEZ;YAAS;QACpB;QACA,cAAaxB,SAAS;YACpBoC,OAAO;gBAAEpC;YAAU;QACrB;QACA,oBAAmBgD,MAAM;YACvBZ,OAAO;gBAAEY;YAAO;QAClB;QACA,cAAaC,SAAS;YACpBb,OAAO;gBAAEa;YAAU;QACrB;QACA,SAAQpF,IAAI;YACV,IAAI,CAACqF,OAAO,SAAS,CAACrF,SAASA,OAAO,KAAKA,OAAO,IAChD,MAAM,IAAIU,QAAQ,sBAAsB,GAAGV,KAAK,uBAAuB,CAAC;YAC1E,MAAMsF,SAASvF,gBAAgB0D,MAAM,IAAI,EAAEA,MAAM,QAAQ;YACzD,MAAM8B,UAAU9B,AAAe,gBAAfA,MAAM,IAAI,IAAoB1D,gBAAgBC,MAAMyD,MAAM,QAAQ,MAAM6B;YACxFf,OAAOgB,UAAU;gBAAEvF;gBAAM,SAASuC;YAAU,IAAI;gBAAEvC;YAAK;QACzD;QACA,aAAYC,QAAQ;YAClBsE,OAAO;gBAAE,UAAUzE,OAAO,MAAM,CAAC;oBAAE,GAAGG,QAAQ;gBAAC;YAAG;QACpD;QACA,aAAa,IAAO;gBAAE,MAAMwD,MAAM,IAAI;gBAAE,UAAUA,MAAM,QAAQ;YAAC;QACjE,OAAMf,MAAM;YACV6B,OAAO;gBAAE,SAAS9B,cAAcC;YAAQ;QAC1C;QACA;YACE2B,SAAS;QACX;QACA;YACE,IAAIA,AAAU,MAAVA,OAAa;YACjBA,SAAS;YACTM;QACF;IACF;AACF"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { G9ColorToken } from '../tokens/generated/palettes.js';
|
|
2
|
+
import type { G9ThemeDefinition, G9ThemeSource } from './appearance.js';
|
|
3
|
+
import type { G9ColorScheme } from './theme.js';
|
|
4
|
+
/** Every design token a token theme may set (G9Hub TOKEN_NAMES), grouped as {@link g9ThemeTokenGroups}. */
|
|
5
|
+
export declare const g9ThemeTokenNames: readonly ["bg", "bg-elev", "surface", "surface-2", "surface-3", "glass", "glass-border", "glass-blur", "border", "border-strong", "hover", "press", "field", "skeleton", "scrim", "knob", "text", "text-2", "text-3", "text-on-accent", "link", "selection", "accent", "accent-2", "accent-3", "accent-soft", "accent-gradient", "accent-glow", "aurora-1", "aurora-2", "aurora-3", "bubble-mine", "bubble-mine-text", "bubble-mine-meta", "bubble-other", "bubble-other-text", "bubble-other-border", "bubble-radius", "wallpaper", "highlight", "success", "warning", "danger", "info", "online", "away", "busy", "focus-ring", "shadow-1", "shadow-2", "shadow-3", "radius-sm", "radius-md", "radius-lg", "radius-xl", "dur-fast", "dur", "dur-slow", "ease-out", "ease-spring"];
|
|
6
|
+
/** A design token's name (`bg`, `bubble-mine`, `radius-lg`…). */
|
|
7
|
+
export type G9ThemeTokenName = (typeof g9ThemeTokenNames)[number];
|
|
8
|
+
/** A token map (a theme lists only what it changes). */
|
|
9
|
+
export type G9ThemeTokens = Readonly<Partial<Record<G9ThemeTokenName, string>>>;
|
|
10
|
+
/** The token groups an editor shows (G9Hub TOKEN_GROUPS). */
|
|
11
|
+
export declare const g9ThemeTokenGroups: readonly {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly tokens: readonly G9ThemeTokenName[];
|
|
14
|
+
}[];
|
|
15
|
+
/** Shape and motion every token theme shares unless it sets its own (G9Hub BASE_TOKENS). */
|
|
16
|
+
export declare const g9ThemeBaseTokens: G9ThemeTokens;
|
|
17
|
+
/** A theme as one scheme's token map: G9Hub's built-in and organisation themes (the server's `G9DtTheme`). */
|
|
18
|
+
export interface G9TokenTheme {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly name: string | Readonly<Record<string, string>>;
|
|
21
|
+
readonly scheme: G9ColorScheme;
|
|
22
|
+
readonly tokens: G9ThemeTokens;
|
|
23
|
+
readonly builtIn?: boolean;
|
|
24
|
+
/** A theme the person made on this device (id `me:…`). */
|
|
25
|
+
readonly personal?: boolean;
|
|
26
|
+
readonly updatedUtc?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* One token value as the Lynx engines paint it (2.5.10): `color-mix()` / `oklch()` / `oklab()` / `hsl()` computed,
|
|
30
|
+
* `rgb(r g b / a)` written as `rgba()`, a `linear()` easing as its nearest cubic-bezier, `rem` as px (16 per rem).
|
|
31
|
+
* Anything else passes through.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveColorMix(value: string): string;
|
|
34
|
+
/** The design token a palette token takes its colour from in a token theme (a contrast fix sets that token), or null. */
|
|
35
|
+
export declare function g9TokenForPalette(token: G9ColorToken): G9ThemeTokenName | null;
|
|
36
|
+
/** Options of {@link g9ThemeFromTokens}. */
|
|
37
|
+
export interface G9TokenThemeOptions {
|
|
38
|
+
/**
|
|
39
|
+
* The complete token map of each scheme a theme falls back to for what it leaves out (G9Hub SCHEME_DEFAULTS: Aurora
|
|
40
|
+
* for dark, Daylight for light). Without it a missing colour comes from the recipe.
|
|
41
|
+
*/
|
|
42
|
+
readonly defaults?: Readonly<Partial<Record<G9ColorScheme, G9ThemeTokens>>>;
|
|
43
|
+
/** Shape and motion under everything (default {@link g9ThemeBaseTokens}). */
|
|
44
|
+
readonly base?: G9ThemeTokens;
|
|
45
|
+
/** Where it comes from (default: `builtin` for `builtIn`, `personal` for `personal`, else `org`). */
|
|
46
|
+
readonly source?: G9ThemeSource;
|
|
47
|
+
/** The recipe behind the palette tokens a token map does not cover (default `stock`, `midnight` for dark). */
|
|
48
|
+
readonly recipe?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Every token of a token theme, merged over its scheme's defaults and the base, each value made paintable
|
|
52
|
+
* ({@link resolveColorMix}), unknown names and unsafe values dropped.
|
|
53
|
+
*/
|
|
54
|
+
export declare function g9ResolveThemeTokens(theme: G9TokenTheme, options?: G9TokenThemeOptions): Record<string, string>;
|
|
55
|
+
/**
|
|
56
|
+
* A token theme as a G9ThemeDefinition (2.5.10): its colours as the palette of its scheme (overrides over a recipe
|
|
57
|
+
* branded with its accent), every token as an app token of that scheme (`--g9-<name>` through G9Provider), and its
|
|
58
|
+
* scheme as the forced mode. Organisation themes that list only some tokens take the rest from `options.defaults`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function g9ThemeFromTokens(theme: G9TokenTheme, options?: G9TokenThemeOptions): G9ThemeDefinition;
|
|
61
|
+
/** Whether a value read from outside is a token theme (`scheme` and a `tokens` map) rather than a G9ThemeDefinition. */
|
|
62
|
+
export declare function g9IsTokenTheme(input: unknown): input is G9TokenTheme;
|
|
63
|
+
/** Whether a token value is acceptable (what an editor marks invalid otherwise; G9Hub `tokenValueValid`). */
|
|
64
|
+
export declare function g9TokenValueValid(name: string, value: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Every token a single accent colour sets, for a scheme (G9Hub `accentTokens`): `color-mix()` values, resolved when the
|
|
67
|
+
* theme is read. `{}` for something that is not a colour.
|
|
68
|
+
*/
|
|
69
|
+
export declare function g9AccentTokens(accent: string, scheme: G9ColorScheme): G9ThemeTokens;
|
|
70
|
+
/** A personal theme as G9Hub stores it on the device (Plan-V3 §11.5): a built-in base by id, an accent, surfaces, wallpaper. */
|
|
71
|
+
export interface G9TokenPersonalDraft {
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly name: string;
|
|
74
|
+
/** A built-in theme's id. */
|
|
75
|
+
readonly base: string;
|
|
76
|
+
/** `#rrggbb`. */
|
|
77
|
+
readonly accent: string;
|
|
78
|
+
readonly surfaces: 'neutral' | 'cool' | 'warm' | 'tinted';
|
|
79
|
+
/** A wallpaper id, or `theme` for the base's own. */
|
|
80
|
+
readonly wallpaper: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The token theme a stored personal draft describes (G9Hub `buildTheme`, the same tokens): the base's tokens with the
|
|
84
|
+
* draft's accent, the surfaces tinted (cool, warm, or by the accent) and the wallpaper's CSS. `wallpapers` are the
|
|
85
|
+
* app's (default the library's, see {@link G9CssWallpaper}).
|
|
86
|
+
*/
|
|
87
|
+
export declare function g9BuildTokenPersonalTheme(draft: G9TokenPersonalDraft, builtins: readonly G9TokenTheme[], options?: G9TokenThemeOptions & {
|
|
88
|
+
readonly wallpapers?: readonly G9CssWallpaper[];
|
|
89
|
+
}): G9TokenTheme;
|
|
90
|
+
/** A chat wallpaper written as a CSS `background` per scheme (G9Hub WALLPAPERS: layers built from `var(--g9-…)`). */
|
|
91
|
+
export interface G9CssWallpaper {
|
|
92
|
+
readonly id: string;
|
|
93
|
+
readonly name?: Readonly<Record<string, string>>;
|
|
94
|
+
css(scheme: G9ColorScheme): string;
|
|
95
|
+
}
|
|
96
|
+
/** The style a CSS background takes on a Lynx view (each property a comma list, one entry per image layer). */
|
|
97
|
+
export interface G9BackgroundStyle {
|
|
98
|
+
readonly backgroundColor: string;
|
|
99
|
+
readonly backgroundImage?: string;
|
|
100
|
+
readonly backgroundPosition?: string;
|
|
101
|
+
readonly backgroundSize?: string;
|
|
102
|
+
readonly backgroundRepeat?: string;
|
|
103
|
+
}
|
|
104
|
+
/** `var(--<token>)` (and `var(--<token>, fallback)`) replaced by the token's value, nested ones too. */
|
|
105
|
+
export declare function g9SubstituteTokens(value: string, tokens: Readonly<Record<string, string>>): string;
|
|
106
|
+
/**
|
|
107
|
+
* A CSS `background` (a token theme's `wallpaper`, a {@link G9CssWallpaper}) as a Lynx view's style (2.5.10): the
|
|
108
|
+
* tokens substituted, colour functions computed, the last plain layer as the colour, every image layer's position,
|
|
109
|
+
* size and repeat split out.
|
|
110
|
+
*/
|
|
111
|
+
export declare function g9BackgroundStyle(css: string, tokens?: Readonly<Record<string, string>>): G9BackgroundStyle;
|
|
112
|
+
/** Why the effects are off when they are (2.5.10): the person chose it, a low-end device, or the system asks for less motion. */
|
|
113
|
+
export type G9EffectsReason = 'setting' | 'lowEnd' | 'reducedMotion' | null;
|
|
114
|
+
//# sourceMappingURL=token-themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-themes.d.ts","sourceRoot":"","sources":["../../src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