waybetter 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/bin/waybetter.mjs +2 -5
- package/cli/buildenv.mjs +1 -1
- package/cli/release.mjs +11 -18
- package/cli/releasecheck.mjs +15 -0
- package/cli/remote.mjs +4 -4
- package/cli/store.mjs +80 -28
- package/cli/strings.mjs +2 -0
- package/dist/runtime/stringPackHook.js +2 -2
- package/dist/runtime/stringPackHook.js.map +1 -1
- package/dist/runtime/stringPackTranslate.d.ts +3 -1
- package/dist/runtime/stringPackTranslate.js +6 -3
- package/dist/runtime/stringPackTranslate.js.map +1 -1
- package/dist/runtime/stringPacks.d.ts +53 -5
- package/dist/runtime/stringPacks.js +161 -25
- package/dist/runtime/stringPacks.js.map +1 -1
- package/dist/runtime/themeBar.d.ts +28 -0
- package/dist/runtime/themeBar.js +82 -0
- package/dist/runtime/themeBar.js.map +1 -0
- package/dist/runtime/themeComponents.js +16 -3
- package/dist/runtime/themeComponents.js.map +1 -1
- package/dist/runtime/themeDecor.js +3 -1
- package/dist/runtime/themeDecor.js.map +1 -1
- package/dist/runtime/themeDerive.d.ts +69 -0
- package/dist/runtime/themeDerive.js +117 -0
- package/dist/runtime/themeDerive.js.map +1 -0
- package/dist/runtime/themeDoctor.d.ts +44 -3
- package/dist/runtime/themeDoctor.js +86 -25
- package/dist/runtime/themeDoctor.js.map +1 -1
- package/dist/runtime/themeGuards.d.ts +60 -0
- package/dist/runtime/themeGuards.js +235 -0
- package/dist/runtime/themeGuards.js.map +1 -0
- package/dist/runtime/themeIcons.d.ts +1 -1
- package/dist/runtime/themeIcons.js +13 -5
- package/dist/runtime/themeIcons.js.map +1 -1
- package/dist/runtime/themeInk.d.ts +37 -0
- package/dist/runtime/themeInk.js +111 -0
- package/dist/runtime/themeInk.js.map +1 -0
- package/dist/runtime/themeInvariants.d.ts +39 -0
- package/dist/runtime/themeInvariants.js +273 -0
- package/dist/runtime/themeInvariants.js.map +1 -0
- package/dist/runtime/themeRuntime.d.ts +15 -1
- package/dist/runtime/themeRuntime.js +78 -5
- package/dist/runtime/themeRuntime.js.map +1 -1
- package/dist/runtime/themeSpec.d.ts +5 -1
- package/dist/runtime/themeSpec.js +9 -13
- package/dist/runtime/themeSpec.js.map +1 -1
- package/dist/shell/InstallDialog.js +14 -8
- package/dist/shell/InstallDialog.js.map +1 -1
- package/dist/shell/StoreView.d.ts +12 -0
- package/dist/shell/StoreView.js +9 -4
- package/dist/shell/StoreView.js.map +1 -1
- package/dist/shell/frame/AppMenu.d.ts +26 -3
- package/dist/shell/frame/AppMenu.js +106 -27
- package/dist/shell/frame/AppMenu.js.map +1 -1
- package/dist/shell/frame/FindBar.js +1 -1
- package/dist/shell/frame/FindBar.js.map +1 -1
- package/dist/shell/frame/Shell.d.ts +1 -0
- package/dist/shell/frame/Shell.js +10 -2
- package/dist/shell/frame/Shell.js.map +1 -1
- package/dist/shell/frame/Titlebar.d.ts +2 -1
- package/dist/shell/frame/Titlebar.js +5 -3
- package/dist/shell/frame/Titlebar.js.map +1 -1
- package/dist/shell/frame/WebPanel.js +4 -1
- package/dist/shell/frame/WebPanel.js.map +1 -1
- package/dist/shell/frame/accountSwitcher.css +10 -10
- package/dist/shell/frame/appMenu.css +19 -13
- package/dist/shell/frame/boot.js +2 -0
- package/dist/shell/frame/boot.js.map +1 -1
- package/dist/shell/frame/chromeTheme.d.ts +19 -1
- package/dist/shell/frame/chromeTheme.js +51 -14
- package/dist/shell/frame/chromeTheme.js.map +1 -1
- package/dist/shell/frame/deck.css +30 -30
- package/dist/shell/frame/edges.css +159 -0
- package/dist/shell/frame/index.d.ts +2 -2
- package/dist/shell/frame/index.js +1 -1
- package/dist/shell/frame/index.js.map +1 -1
- package/dist/shell/frame/mediaModel.d.ts +13 -0
- package/dist/shell/frame/mediaModel.js +14 -0
- package/dist/shell/frame/mediaModel.js.map +1 -1
- package/dist/shell/frame/menuMessages.en.json +43 -1
- package/dist/shell/frame/menuModel.d.ts +42 -0
- package/dist/shell/frame/menuModel.js +8 -0
- package/dist/shell/frame/menuModel.js.map +1 -1
- package/dist/shell/frame/nativeMenu.d.ts +5 -0
- package/dist/shell/frame/nativeMenu.js +178 -0
- package/dist/shell/frame/nativeMenu.js.map +1 -0
- package/dist/shell/frame/nativeMenuModel.d.ts +102 -0
- package/dist/shell/frame/nativeMenuModel.js +186 -0
- package/dist/shell/frame/nativeMenuModel.js.map +1 -0
- package/dist/shell/frame/paletteModel.js +3 -1
- package/dist/shell/frame/paletteModel.js.map +1 -1
- package/dist/shell/frame/paneTheme.css +1 -1
- package/dist/shell/frame/reportModel.d.ts +1 -1
- package/dist/shell/frame/reportModel.js +1 -1
- package/dist/shell/frame/reportModel.js.map +1 -1
- package/dist/shell/frame/shell.css +56 -51
- package/dist/shell/frame/state.d.ts +2 -0
- package/dist/shell/frame/state.js +3 -1
- package/dist/shell/frame/state.js.map +1 -1
- package/dist/shell/frame/themeStore.js +21 -6
- package/dist/shell/frame/themeStore.js.map +1 -1
- package/dist/shell/frame/workspaces.css +12 -12
- package/dist/shell/installController.d.ts +16 -1
- package/dist/shell/installController.js +31 -5
- package/dist/shell/installController.js.map +1 -1
- package/dist/shell/panel/Appearance.js +12 -3
- package/dist/shell/panel/Appearance.js.map +1 -1
- package/dist/shell/panel/Settings.d.ts +1 -1
- package/dist/shell/panel/Settings.js +4 -3
- package/dist/shell/panel/Settings.js.map +1 -1
- package/dist/shell/panel/StoreSection.d.ts +2 -1
- package/dist/shell/panel/StoreSection.js +31 -1
- package/dist/shell/panel/StoreSection.js.map +1 -1
- package/dist/shell/panel/StringPacks.d.ts +12 -3
- package/dist/shell/panel/StringPacks.js +33 -8
- package/dist/shell/panel/StringPacks.js.map +1 -1
- package/dist/shell/panel/backup.css +1 -1
- package/dist/shell/panel/builder.css +48 -40
- package/dist/shell/panel/make.css +8 -7
- package/dist/shell/panel/panel.css +401 -401
- package/dist/shell/panel/panelMessages.d.ts +41 -1
- package/dist/shell/panel/panelMessages.js +13 -1
- package/dist/shell/panel/panelMessages.js.map +1 -1
- package/dist/shell/panel/plugins.css +5 -5
- package/dist/shell/panel/strings.css +1 -1
- package/dist/shell/store.css +34 -14
- package/dist/shell/storeMessages.d.ts +24 -0
- package/dist/shell/storeMessages.js +24 -0
- package/dist/shell/storeMessages.js.map +1 -1
- package/dist/shell/storeModel.d.ts +31 -7
- package/dist/shell/storeModel.js +15 -2
- package/dist/shell/storeModel.js.map +1 -1
- package/dist/shell/stringPacksModel.js +7 -2
- package/dist/shell/stringPacksModel.js.map +1 -1
- package/icons.schema.json +9 -0
- package/locales/ar.json +109 -2
- package/locales/bg.json +109 -2
- package/locales/bn.json +109 -2
- package/locales/ca.json +109 -2
- package/locales/cs.json +109 -2
- package/locales/da.json +109 -2
- package/locales/de.json +109 -2
- package/locales/el.json +109 -2
- package/locales/en.json +108 -2
- package/locales/es.json +109 -2
- package/locales/eu.json +109 -2
- package/locales/fa.json +109 -2
- package/locales/fi.json +109 -2
- package/locales/fil.json +109 -2
- package/locales/fr.json +109 -2
- package/locales/ga.json +109 -2
- package/locales/gl.json +109 -2
- package/locales/gu.json +109 -2
- package/locales/ha.json +109 -2
- package/locales/he.json +109 -2
- package/locales/hi.json +109 -2
- package/locales/hr.json +109 -2
- package/locales/hu.json +110 -2
- package/locales/id.json +109 -2
- package/locales/ig.json +109 -2
- package/locales/it.json +109 -2
- package/locales/ja.json +109 -2
- package/locales/kn.json +109 -2
- package/locales/ko.json +109 -2
- package/locales/mr.json +109 -2
- package/locales/ms.json +109 -2
- package/locales/nb.json +109 -2
- package/locales/nl.json +109 -2
- package/locales/pl.json +109 -2
- package/locales/pt.json +109 -2
- package/locales/ro.json +109 -2
- package/locales/ru.json +109 -2
- package/locales/sk.json +109 -2
- package/locales/sr.json +109 -2
- package/locales/sv.json +109 -2
- package/locales/ta.json +109 -2
- package/locales/th.json +109 -2
- package/locales/tr.json +109 -2
- package/locales/uk.json +109 -2
- package/locales/ur.json +109 -2
- package/locales/vi.json +109 -2
- package/locales/yo.json +109 -2
- package/locales/zh-Hans.json +109 -2
- package/locales/zh-Hant.json +109 -2
- package/package.json +2 -3
- package/store-catalog.schema.json +18 -5
- package/theme.schema.json +9 -0
- package/windows/installer.nsi +22 -2
- package/cli/privacy.mjs +0 -768
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeComponents.js","sourceRoot":"","sources":["../../../runtime/src/themeComponents.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,sGAAsG;AACtG,6FAA6F;AAC7F,mFAAmF;AACnF,EAAE;AACF,oGAAoG;AACpG,kGAAkG;AAClG,gGAAgG;AAChG,EAAE;AACF,6EAA6E;AAC7E,mGAAmG;AACnG,mGAAmG;AACnG,8FAA8F;AAC9F,EAAE;AACF,mGAAmG;AACnG,qGAAqG;AAErG,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,iBAAiB,EAAqB,MAAM,eAAe,CAAC;AAEnG,gGAAgG;AAChG,aAAa;AAEb,wFAAwF;AACxF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC;AAInJ,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC;AAC/G,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAClF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAU,CAAC;AACrF,MAAM,CA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AAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvI,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAClC,CAAC;AAED,kHAAkH;AAClH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC","sourcesContent":["// Component tokens: the part of a theme that says how each piece of the site is built (a button's\n// radius and border, a post's padding and fill, the size and case of a handle), instead of one radius\n// and one density for everything. A theme names generic components (`post`, `buttonPrimary`,\n// `navItem`); the site adapter says which selectors they are (its part map). Pure.\n//\n// Safety is the same as the rest of a theme document: every token is a clamped number, a fixed word\n// or a color role name. No token carries CSS text, a selector or a color literal, so one contrast\n// pass over the palette covers every component, and the CSS is built from the vocabulary below.\n//\n// How it lands in the page: values are custom properties at zero specificity\n// (`:where(:root){--wb-part-post-radius:0px}`), rules are rigid (`:root:root <part>{border-radius:\n// var(--wb-part-post-radius) !important}`). An owner's Custom CSS or a plugin overrides a value by\n// setting the variable, for the whole page or for one subtree, without fighting `!important`.\n//\n// The bevel borders (`bevel-out`, `bevel-in`) follow 98.css's raised and sunken edges (MIT, Jordan\n// Scales, https://github.com/jdan/98.css): four inset shadows, here computed from the theme's roles.\n\nimport { contrastRatio, hexToRgb, mix, relativeLuminance, type FontRoleName } from './themeApi.ts';\n\n// ---------------------------------------------------------------------------------------------\n// Vocabulary\n\n/** Color roles a component may name. `onAccent` is the readable label on the accent. */\nexport const COLOR_ROLES = ['bg', 'surface', 'elevated', 'page', 'border', 'text', 'muted', 'accent', 'onAccent', 'inverse', 'onInverse'] as const;\nexport type ColorRole = typeof COLOR_ROLES[number];\nexport type RoleColors = Record<ColorRole, string>;\n\nexport const BORDER_STYLES = ['none', 'solid', 'dashed', 'dotted', 'double', 'bevel-out', 'bevel-in'] as const;\nexport const SHADOWS = ['none', 'soft', 'deep', 'hard', 'inset', 'glow'] as const;\nexport const CASES = ['none', 'upper', 'lower', 'capitalize', 'small-caps'] as const;\nexport const AVATAR_SHAPES = ['circle', 'rounded', 'square', 'squircle', 'hexagon', 'octagon', 'diamond'] as const;\nexport const CORNERS = ['round', 'cut'] as const;\nconst FONT_ROLES: readonly FontRoleName[] = ['interface', 'post', 'heading', 'numbers', 'mono', 'chrome', 'dialog'];\n\nexport type Gradient = { from: ColorRole; to: ColorRole; angle: number };\nexport type Fill = ColorRole | 'transparent' | 'glass' | Gradient;\nexport type StateTokens = { fill?: Fill; text?: ColorRole; borderColor?: ColorRole; shadow?: typeof SHADOWS[number]; lift?: number; scale?: number; underline?: boolean };\nexport type ComponentTokens = {\n preset?: string;\n radius?: number | 'pill';\n borderWidth?: number;\n borderStyle?: typeof BORDER_STYLES[number];\n borderColor?: ColorRole;\n fill?: Fill;\n text?: ColorRole;\n padX?: number;\n padY?: number;\n gap?: number;\n height?: number;\n width?: number;\n size?: number;\n maxHeight?: number;\n font?: FontRoleName;\n fontSize?: number;\n weight?: number;\n case?: typeof CASES[number];\n tracking?: number;\n leading?: number;\n shadow?: typeof SHADOWS[number];\n shape?: typeof AVATAR_SHAPES[number];\n corner?: typeof CORNERS[number];\n visible?: boolean;\n hover?: StateTokens;\n active?: StateTokens;\n focus?: StateTokens;\n};\n\ntype ComponentDef = {\n /** Tokens set on the parent apply to this component too. */\n parent?: string;\n /** A text part: type tokens land on its leaves. */\n text?: boolean;\n /** Size ranges in px (absent: the token is not accepted on this component). */\n height?: [number, number]; width?: [number, number]; size?: [number, number]; maxHeight?: [number, number]; fontSize?: [number, number];\n /** Tokens only some components take. */\n shape?: boolean; corner?: boolean; visible?: boolean;\n /** Glass fills (a blur) are allowed here; never on parts that repeat down a timeline. */\n glass?: boolean;\n /** Gradient fills are allowed here (bars and buttons). */\n gradient?: boolean;\n /** Presets of this component's family. */\n presets?: keyof typeof PRESETS;\n /** Contrast its text must reach on its own fill. */\n contrast?: number;\n};\n\nconst LABEL: [number, number] = [12, 20];\nconst SMALL: [number, number] = [11, 18];\n/** Every component a theme can name. Sites map them to selectors; a component a site does not have is ignored. */\nexport const COMPONENTS = {\n nav: { width: [56, 320], glass: true, gradient: true },\n navItem: { height: [36, 64], fontSize: LABEL, text: true },\n topBar: { height: [40, 64], glass: true, gradient: true, fontSize: LABEL },\n tabs: { presets: 'tabs', gradient: true },\n tab: { height: [32, 56], fontSize: LABEL, text: true, presets: 'tabs' },\n post: { corner: true, presets: 'post', contrast: 7 },\n avatar: { size: [20, 64], shape: true, visible: true },\n displayName: { text: true, fontSize: LABEL, visible: true },\n handle: { text: true, fontSize: SMALL, visible: true },\n postText: { text: true, fontSize: [13, 24], contrast: 7 },\n meta: { text: true, fontSize: SMALL },\n actionBar: {},\n action: { size: [28, 44] },\n count: { text: true, fontSize: SMALL, visible: true },\n media: { corner: true, maxHeight: [200, 700] },\n linkCard: { corner: true },\n quote: {},\n button: { height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n buttonPrimary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n buttonSecondary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n buttonGhost: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n input: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },\n search: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },\n composer: { fontSize: [13, 24], text: true },\n /** The tool icons under a composer (media, poll, emoji); `text` is their color. */\n composerTool: { size: [28, 44] },\n panel: { glass: true, presets: 'panel' },\n menu: { parent: 'panel', glass: true, presets: 'panel' },\n dialog: { parent: 'panel', glass: true, presets: 'panel' },\n toast: { parent: 'panel', glass: true, presets: 'panel' },\n hoverCard: { parent: 'panel', glass: true, presets: 'panel' },\n sidebarCard: { parent: 'panel', glass: true, corner: true, presets: 'panel' },\n badge: { size: [14, 24], corner: true, fontSize: SMALL, text: true },\n pill: { fontSize: SMALL, text: true },\n divider: {},\n scrollbar: {},\n profileHeader: {},\n} as const satisfies Record<string, ComponentDef>;\nexport type ComponentId = keyof typeof COMPONENTS;\nexport const COMPONENT_IDS = Object.keys(COMPONENTS) as ComponentId[];\nexport type ThemeComponents = Partial<Record<ComponentId, ComponentTokens>>;\n\n/** Clamp ranges of the tokens every component shares (the JSON Schema says the same; tested). */\nexport const TOKEN_LIMITS = {\n radius: [0, 32], borderWidth: [0, 4], padX: [0, 32], padY: [0, 32], gap: [0, 24], weight: [100, 900],\n tracking: [-0.05, 0.2], leading: [1.1, 2], angle: [0, 360], lift: [0, 4], scale: [0.96, 1.04],\n} as const;\n\n/** Named token bundles per family; a theme's own tokens win over its preset's. Frozen once shipped. */\nexport const PRESETS = {\n button: {\n pill: { radius: 'pill', borderWidth: 0 },\n soft: { radius: 8, borderWidth: 0 },\n square: { radius: 0, borderWidth: 1, borderStyle: 'solid' },\n outline: { radius: 6, borderWidth: 1, borderStyle: 'solid', fill: 'transparent', text: 'text', borderColor: 'border' },\n bevel: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', text: 'text', active: { shadow: 'inset' } },\n gloss: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', shadow: 'soft' },\n 'flat-link': { radius: 0, borderWidth: 0, fill: 'transparent', text: 'accent', hover: { underline: true } },\n },\n post: {\n flat: { radius: 0, borderWidth: 0, fill: 'transparent', shadow: 'none' },\n card: { radius: 14, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface' },\n bubble: { radius: 20, borderWidth: 0, fill: 'surface' },\n window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface' },\n ruled: { radius: 0, borderWidth: 0, fill: 'transparent' },\n },\n input: {\n pill: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },\n underline: { radius: 0, borderWidth: 0, fill: 'transparent' },\n sunken: { radius: 0, borderStyle: 'bevel-in', fill: 'bg', text: 'text' },\n boxed: { radius: 4, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'bg' },\n },\n panel: {\n sheet: { radius: 12, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface', shadow: 'soft' },\n window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', shadow: 'none' },\n glass: { radius: 16, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'glass', shadow: 'soft' },\n },\n tabs: {\n underline: { radius: 0 },\n pills: { radius: 'pill' },\n folder: { radius: 6, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },\n blocks: { radius: 0, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },\n },\n} as const satisfies Record<string, Record<string, ComponentTokens>>;\n\n// ---------------------------------------------------------------------------------------------\n// Sanitizing\n\nconst obj = (value: unknown): Record<string, unknown> => value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {};\nconst finite = (value: unknown): value is number => typeof value === 'number' && Number.isFinite(value);\nconst clamp = (value: number, [min, max]: readonly [number, number]) => Math.min(max, Math.max(min, value));\nconst oneOf = <T extends string>(value: unknown, options: readonly T[]): T | undefined => options.includes(value as T) ? value as T : undefined;\nconst role = (value: unknown) => oneOf(value, COLOR_ROLES);\n\nfunction sanitizeFill(value: unknown, def: ComponentDef): Fill | undefined {\n if (value === 'transparent') return 'transparent';\n if (value === 'glass') return def.glass ? 'glass' : undefined;\n const named = role(value);\n if (named) return named;\n const source = obj(value);\n const from = role(source.from), to = role(source.to);\n if (def.gradient && from && to) return { from, to, angle: Math.round(clamp(finite(source.angle) ? source.angle : 180, TOKEN_LIMITS.angle)) };\n return undefined;\n}\n\nfunction sanitizeState(value: unknown, def: ComponentDef): StateTokens | undefined {\n const source = obj(value);\n const out: StateTokens = {};\n const fill = sanitizeFill(source.fill, def); if (fill !== undefined) out.fill = fill;\n const text = role(source.text); if (text) out.text = text;\n const borderColor = role(source.borderColor); if (borderColor) out.borderColor = borderColor;\n const shadow = oneOf(source.shadow, SHADOWS); if (shadow) out.shadow = shadow;\n if (finite(source.lift)) out.lift = +clamp(source.lift, TOKEN_LIMITS.lift).toFixed(1);\n if (finite(source.scale)) out.scale = +clamp(source.scale, TOKEN_LIMITS.scale).toFixed(3);\n if (typeof source.underline === 'boolean') out.underline = source.underline;\n return Object.keys(out).length ? out : undefined;\n}\n\n/** One component's tokens from JSON: clamped, unknown names and tokens the component does not take dropped. */\nexport function sanitizeComponentTokens(id: ComponentId, value: unknown): ComponentTokens | undefined {\n const def: ComponentDef = COMPONENTS[id];\n const source = obj(value);\n const out: ComponentTokens = {};\n if (def.presets && typeof source.preset === 'string' && Object.hasOwn(PRESETS[def.presets], source.preset)) out.preset = source.preset;\n if (source.radius === 'pill') out.radius = 'pill';\n else if (finite(source.radius)) out.radius = Math.round(clamp(source.radius, TOKEN_LIMITS.radius));\n if (finite(source.borderWidth)) out.borderWidth = +clamp(source.borderWidth, TOKEN_LIMITS.borderWidth).toFixed(1);\n const borderStyle = oneOf(source.borderStyle, BORDER_STYLES); if (borderStyle) out.borderStyle = borderStyle;\n const borderColor = role(source.borderColor); if (borderColor) out.borderColor = borderColor;\n const fill = sanitizeFill(source.fill, def); if (fill !== undefined) out.fill = fill;\n const text = role(source.text); if (text) out.text = text;\n for (const key of ['padX', 'padY', 'gap'] as const) if (finite(source[key])) out[key] = Math.round(clamp(source[key] as number, TOKEN_LIMITS[key]));\n for (const key of ['height', 'width', 'size', 'maxHeight', 'fontSize'] as const) {\n const range = def[key];\n if (range && finite(source[key])) out[key] = Math.round(clamp(source[key] as number, range));\n }\n if (def.text || def.fontSize) {\n const font = oneOf(source.font, FONT_ROLES); if (font) out.font = font;\n if (finite(source.weight)) out.weight = Math.round(clamp(source.weight, TOKEN_LIMITS.weight) / 50) * 50;\n const textCase = oneOf(source.case, CASES); if (textCase && id !== 'postText') out.case = textCase;\n if (finite(source.tracking)) out.tracking = +clamp(source.tracking, TOKEN_LIMITS.tracking).toFixed(3);\n if (finite(source.leading)) out.leading = +clamp(source.leading, TOKEN_LIMITS.leading).toFixed(2);\n }\n const shadow = oneOf(source.shadow, SHADOWS); if (shadow) out.shadow = shadow;\n if (def.shape) { const shape = oneOf(source.shape, AVATAR_SHAPES); if (shape) out.shape = shape; }\n if (def.corner) { const corner = oneOf(source.corner, CORNERS); if (corner) out.corner = corner; }\n if (def.visible && typeof source.visible === 'boolean') out.visible = source.visible;\n for (const state of ['hover', 'active', 'focus'] as const) { const tokens = sanitizeState(source[state], def); if (tokens) out[state] = tokens; }\n return Object.keys(out).length ? out : undefined;\n}\n\n/** The `components` group from JSON. Null when nothing valid is left (the theme sets no component). */\nexport function sanitizeComponents(value: unknown): ThemeComponents | null {\n const source = obj(value);\n const out: ThemeComponents = {};\n for (const id of COMPONENT_IDS) {\n if (!Object.hasOwn(source, id)) continue;\n const tokens = sanitizeComponentTokens(id, source[id]);\n if (tokens) out[id] = tokens;\n }\n return Object.keys(out).length ? out : null;\n}\n\n/** Every component with its preset and its parent's tokens folded in (own tokens win, then the preset, then the parent). */\nexport function resolveComponents(components: ThemeComponents): ThemeComponents {\n const expand = (id: ComponentId, tokens: ComponentTokens | undefined): ComponentTokens => {\n if (!tokens) return {};\n const def: ComponentDef = COMPONENTS[id];\n const preset = tokens.preset && def.presets ? (PRESETS[def.presets] as Record<string, ComponentTokens>)[tokens.preset] : undefined;\n const { preset: _name, ...own } = tokens;\n return { ...preset, ...own };\n };\n const out: ThemeComponents = {};\n for (const id of COMPONENT_IDS) {\n const def: ComponentDef = COMPONENTS[id];\n const parent = def.parent as ComponentId | undefined;\n const inherited = parent ? expand(parent, components[parent]) : {};\n const merged = { ...inherited, ...expand(id, components[id]) };\n if (Object.keys(merged).length) out[id] = merged;\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------------------------\n// Compiling\n\n/** A site's selectors for one component. */\nexport type PartDef = {\n /** The component's box. */\n sel: string;\n /** Its text leaves (sites often put type on leaf spans); defaults to the box. */\n text?: string;\n /** Where a fill is painted when it is not the box itself. */\n fill?: string;\n /** Tokens the site cannot honor on this part (left out of the CSS). */\n skip?: ReadonlyArray<keyof ComponentTokens>;\n};\nexport type PartMap = Partial<Record<ComponentId, PartDef>>;\n\nexport type ComponentContext = {\n /** Every role as `#rrggbb` (the theme's palette, legible). */\n colors: RoleColors;\n /** `font-family` per font role. */\n fonts: Record<FontRoleName, string>;\n};\n\nconst rgba = (hex: string, alpha: number) => `rgba(${hexToRgb(hex).join(', ')}, ${alpha})`;\nconst dark = (hex: string) => relativeLuminance(hex) < 0.18;\n\n/** The most readable of the theme's text-capable roles on `fill`. */\nexport function readableRole(fill: string, colors: RoleColors, preferred?: ColorRole): ColorRole {\n const candidates: ColorRole[] = ['text', 'onAccent', 'onInverse', 'bg', 'inverse'];\n if (preferred && !candidates.includes(preferred)) candidates.unshift(preferred);\n return candidates.reduce((best, candidate) => contrastRatio(colors[candidate], fill) > contrastRatio(colors[best], fill) ? candidate : best, preferred ?? 'text');\n}\n\nfunction fillCss(fill: Fill, colors: RoleColors): { decl: Array<[string, string]>; solid: string | null } {\n if (fill === 'transparent') return { decl: [['background-color', 'transparent'], ['background-image', 'none']], solid: null };\n if (fill === 'glass') return { decl: [['background-color', rgba(colors.surface, 0.72)], ['backdrop-filter', 'blur(14px) saturate(1.4)'], ['-webkit-backdrop-filter', 'blur(14px) saturate(1.4)']], solid: colors.surface };\n if (typeof fill === 'string') return { decl: [['background-color', colors[fill]], ['background-image', 'none']], solid: colors[fill] };\n // A gradient is judged at its less readable end: the midpoint stands in for both when choosing a label.\n return { decl: [['background-color', colors[fill.to]], ['background-image', `linear-gradient(${fill.angle}deg, ${colors[fill.from]}, ${colors[fill.to]})`]], solid: mix(colors[fill.from], colors[fill.to], 0.5) };\n}\n\n/** Raised and sunken edges after 98.css: two light and two dark inset lines, from the part's own fill. */\nfunction bevel(out: boolean, face: string): string {\n const light = mix(face, '#ffffff', 0.85), soft = mix(face, '#ffffff', 0.35), shade = mix(face, '#000000', 0.35), deep = mix(face, '#000000', 0.9);\n return out\n ? `inset -1px -1px ${deep}, inset 1px 1px ${light}, inset -2px -2px ${shade}, inset 2px 2px ${soft}`\n : `inset -1px -1px ${light}, inset 1px 1px ${shade}, inset -2px -2px ${soft}, inset 2px 2px ${deep}`;\n}\n\nfunction shadowCss(name: typeof SHADOWS[number], colors: RoleColors): string {\n const base = dark(colors.bg);\n switch (name) {\n case 'soft': return base ? `0 1px 2px ${rgba('#000000', 0.4)}, 0 8px 24px ${rgba('#000000', 0.35)}` : `0 1px 2px ${rgba('#000000', 0.06)}, 0 8px 24px ${rgba('#000000', 0.1)}`;\n case 'deep': return `0 0 0 1px ${rgba(colors.border, 0.6)}, 0 24px 64px ${rgba('#000000', base ? 0.6 : 0.28)}`;\n case 'hard': return `4px 4px 0 ${colors.accent}`;\n case 'inset': return `inset 1px 1px 3px ${rgba('#000000', base ? 0.6 : 0.25)}`;\n case 'glow': return `0 0 0 1px ${rgba(colors.accent, 0.5)}, 0 0 18px ${rgba(colors.accent, 0.35)}`;\n default: return 'none';\n }\n}\n\nconst SHAPES: Record<typeof AVATAR_SHAPES[number], Array<[string, string]>> = {\n circle: [['border-radius', '50%']],\n rounded: [['border-radius', '26%']],\n square: [['border-radius', '2px']],\n squircle: [['border-radius', '34%']],\n hexagon: [['border-radius', '0'], ['clip-path', 'polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%)']],\n octagon: [['border-radius', '0'], ['clip-path', 'polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%)']],\n diamond: [['border-radius', '0'], ['clip-path', 'polygon(50% 0, 100% 50%, 50% 100%, 0 50%)']],\n};\nconst CASE_CSS: Record<typeof CASES[number], Array<[string, string]>> = {\n none: [['text-transform', 'none'], ['font-variant-caps', 'normal']],\n upper: [['text-transform', 'uppercase']],\n lower: [['text-transform', 'lowercase']],\n capitalize: [['text-transform', 'capitalize']],\n 'small-caps': [['text-transform', 'none'], ['font-variant-caps', 'all-small-caps']],\n};\n\n/** A part rule's selector: two `:root`s lift it over the site's atomic classes and inline styles' non-important values. */\nexport const partRule = (selector: string) => selector.split(/,(?![^(]*\\))/).map(one => `:root:root ${one.trim()}`).join(',');\n\nexport type CompiledComponents = {\n /** `--wb-part-*` declarations (for `:where(:root)`). */\n values: string[];\n /** Rules that read them. */\n rules: string[];\n /** What the contrast pass changed, for import notes and the builder's report. */\n notes: string[];\n};\n\n/**\n * CSS for a theme's components over a site's part map. A component without a part, and a token the\n * part skips, emits nothing. Text on a fill the theme chose is held to the component's contrast\n * (the text role is swapped for the most readable one); sizes stay at or above a 24px target.\n */\nexport function compileComponents(components: ThemeComponents, parts: PartMap, ctx: ComponentContext): CompiledComponents {\n const values: string[] = [], rules: string[] = [], notes: string[] = [];\n const resolved = resolveComponents(components);\n for (const id of COMPONENT_IDS) {\n const tokens = resolved[id], part = parts[id];\n if (!tokens || !part) continue;\n const def: ComponentDef = COMPONENTS[id];\n const skip = new Set<string>(part.skip ?? []);\n const has = <K extends keyof ComponentTokens>(key: K): boolean => tokens[key] !== undefined && !skip.has(key);\n const box: string[] = [], type: string[] = [], fillRule: string[] = [];\n const put = (list: string[], token: string, property: string, value: string) => {\n const name = `--wb-part-${id}-${token}`;\n if (!values.some(item => item.startsWith(`${name}:`))) values.push(`${name}:${value}`);\n list.push(`${property}:var(${name}) !important`);\n };\n\n // Fill first: the text role depends on it.\n let face: string | null = null;\n if (has('fill')) {\n const { decl, solid } = fillCss(tokens.fill!, ctx.colors);\n face = solid;\n decl.forEach(([property, value], index) => put(part.fill ? fillRule : box, `fill${index ? `-${index}` : ''}`, property, value));\n }\n let textRole = has('text') ? tokens.text! : undefined;\n if (face && (def.text || textRole)) {\n const need = def.contrast ?? 4.5;\n if (!textRole || contrastRatio(ctx.colors[textRole], face) < need) {\n const readable = readableRole(face, ctx.colors, textRole);\n if (textRole && readable !== textRole) notes.push(`${id}: text \"${textRole}\" on its fill is under ${need}:1, using \"${readable}\"`);\n textRole = readable;\n }\n }\n if (textRole) put(type, 'text', 'color', ctx.colors[textRole]);\n\n if (has('radius')) put(box, 'radius', 'border-radius', tokens.radius === 'pill' ? '9999px' : `${tokens.radius}px`);\n const style = has('borderStyle') ? tokens.borderStyle! : undefined;\n if (style === 'bevel-out' || style === 'bevel-in') {\n const base = face ?? ctx.colors.surface;\n put(box, 'border-style', 'border-style', 'none');\n put(box, 'bevel', 'box-shadow', bevel(style === 'bevel-out', base));\n } else {\n if (style) put(box, 'border-style', 'border-style', style);\n if (has('borderWidth')) put(box, 'border-width', 'border-width', `${tokens.borderWidth}px`);\n // A width without a style would draw nothing: X's boxes are `border: 0 solid`.\n if (has('borderWidth') && !style && tokens.borderWidth! > 0) put(box, 'border-style', 'border-style', 'solid');\n if (has('shadow')) put(box, 'shadow', 'box-shadow', shadowCss(tokens.shadow!, ctx.colors));\n }\n if (has('borderColor')) put(box, 'border-color', 'border-color', ctx.colors[tokens.borderColor!]);\n if (has('padX')) put(box, 'pad-x', 'padding-inline', `${tokens.padX}px`);\n if (has('padY')) put(box, 'pad-y', 'padding-block', `${tokens.padY}px`);\n if (has('gap')) put(box, 'gap', 'gap', `${tokens.gap}px`);\n if (has('height')) put(box, 'height', 'min-height', `${Math.max(24, tokens.height!)}px`);\n if (has('width')) put(box, 'width', 'width', `${tokens.width}px`);\n if (has('size')) { put(box, 'size', 'width', `${tokens.size}px`); box.push(`height:var(--wb-part-${id}-size) !important`); }\n if (has('maxHeight')) put(box, 'max-height', 'max-height', `${tokens.maxHeight}px`);\n if (has('shape')) SHAPES[tokens.shape!].forEach(([property, value], index) => put(box, `shape${index ? `-${index}` : ''}`, property, value));\n if (has('corner') && tokens.corner === 'cut') put(box, 'corner', 'clip-path', 'polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px))');\n if (has('visible') && tokens.visible === false) put(box, 'display', 'display', 'none');\n\n if (has('font')) put(type, 'font', 'font-family', ctx.fonts[tokens.font!]);\n if (has('fontSize')) {\n put(type, 'font-size', 'font-size', `${tokens.fontSize}px`);\n put(type, 'line-height', 'line-height', String(tokens.leading ?? 1.3));\n } else if (has('leading')) put(type, 'line-height', 'line-height', String(tokens.leading));\n if (has('weight')) put(type, 'weight', 'font-weight', String(tokens.weight));\n if (has('case')) CASE_CSS[tokens.case!].forEach(([property, value], index) => put(type, `case${index ? `-${index}` : ''}`, property, value));\n if (has('tracking')) put(type, 'tracking', 'letter-spacing', `${tokens.tracking}em`);\n\n const textSel = part.text ?? part.sel;\n if (box.length) rules.push(`${partRule(part.sel)}{${box.join(';')}}`);\n if (fillRule.length) rules.push(`${partRule(part.fill!)}{${fillRule.join(';')}}`);\n if (type.length) rules.push(`${partRule(textSel)}{${type.join(';')}}`);\n\n for (const state of ['hover', 'active', 'focus'] as const) {\n const tokensOf = tokens[state];\n if (!tokensOf || skip.has(state)) continue;\n const pseudo = state === 'focus' ? ':focus-visible' : `:${state}`;\n const still: string[] = [], moving: string[] = [], label: string[] = [];\n let stateFace = face;\n if (tokensOf.fill !== undefined) { const { decl, solid } = fillCss(tokensOf.fill, ctx.colors); stateFace = solid ?? face; for (const [property, value] of decl) still.push(`${property}:${value} !important`); }\n let stateText = tokensOf.text;\n if (stateFace && (stateText || tokensOf.fill !== undefined) && (def.text || stateText)) {\n if (!stateText || contrastRatio(ctx.colors[stateText], stateFace) < (def.contrast ?? 4.5)) stateText = readableRole(stateFace, ctx.colors, stateText);\n }\n if (stateText) label.push(`color:${ctx.colors[stateText]} !important`);\n if (tokensOf.underline !== undefined) label.push(`text-decoration:${tokensOf.underline ? 'underline' : 'none'} !important`);\n if (tokensOf.borderColor) still.push(`border-color:${ctx.colors[tokensOf.borderColor]} !important`);\n if (tokensOf.shadow) still.push(`box-shadow:${tokensOf.shadow === 'inset' && (style === 'bevel-out' || style === 'bevel-in') ? bevel(false, face ?? ctx.colors.surface) : shadowCss(tokensOf.shadow, ctx.colors)} !important`);\n const transforms = [tokensOf.lift ? `translateY(-${tokensOf.lift}px)` : '', tokensOf.scale && tokensOf.scale !== 1 ? `scale(${tokensOf.scale})` : ''].filter(Boolean);\n if (transforms.length) moving.push(`transform:${transforms.join(' ')} !important`);\n const stateSel = (selector: string) => selector.split(/,(?![^(]*\\))/).map(one => `${one.trim()}${pseudo}`).join(',');\n if (still.length) rules.push(`${partRule(stateSel(part.sel))}{${still.join(';')}}`);\n // The label of a hovered or pressed part: the box and the text leaves under it.\n if (label.length) rules.push(`${partRule(`${stateSel(part.sel)},${part.sel.split(/,(?![^(]*\\))/).map(one => `${one.trim()}${pseudo} :is(span,div,a)`).join(',')}`)}{${label.join(';')}}`);\n // Movement only for people who have not asked for less of it.\n if (moving.length) rules.push(`@media (prefers-reduced-motion:no-preference){${partRule(stateSel(part.sel))}{${moving.join(';')}}}`);\n }\n }\n return { values, rules, notes };\n}\n\n/** The `colors.actions` group: the colors of an on state (liked, reposted, bookmarked) and of the reply hover. */\nexport const ACTION_NAMES = ['reply', 'repost', 'like', 'bookmark'] as const;\nexport type ActionColors = Partial<Record<typeof ACTION_NAMES[number], string>>;\n"]}
|
|
1
|
+
{"version":3,"file":"themeComponents.js","sourceRoot":"","sources":["../../../runtime/src/themeComponents.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,sGAAsG;AACtG,6FAA6F;AAC7F,mFAAmF;AACnF,EAAE;AACF,oGAAoG;AACpG,kGAAkG;AAClG,gGAAgG;AAChG,EAAE;AACF,6EAA6E;AAC7E,mGAAmG;AACnG,mGAAmG;AACnG,8FAA8F;AAC9F,EAAE;AACF,mGAAmG;AACnG,qGAAqG;AAErG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,iBAAiB,EAAqB,MAAM,eAAe,CAAC;AAEnG,gGAAgG;AAChG,aAAa;AAEb,wFAAwF;AACxF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAA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AE,KAAK,CAAC,IAAI,CAAC,iDAAiD,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvI,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAClC,CAAC;AAED,kHAAkH;AAClH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC","sourcesContent":["// Component tokens: the part of a theme that says how each piece of the site is built (a button's\n// radius and border, a post's padding and fill, the size and case of a handle), instead of one radius\n// and one density for everything. A theme names generic components (`post`, `buttonPrimary`,\n// `navItem`); the site adapter says which selectors they are (its part map). Pure.\n//\n// Safety is the same as the rest of a theme document: every token is a clamped number, a fixed word\n// or a color role name. No token carries CSS text, a selector or a color literal, so one contrast\n// pass over the palette covers every component, and the CSS is built from the vocabulary below.\n//\n// How it lands in the page: values are custom properties at zero specificity\n// (`:where(:root){--wb-part-post-radius:0px}`), rules are rigid (`:root:root <part>{border-radius:\n// var(--wb-part-post-radius) !important}`). An owner's Custom CSS or a plugin overrides a value by\n// setting the variable, for the whole page or for one subtree, without fighting `!important`.\n//\n// The bevel borders (`bevel-out`, `bevel-in`) follow 98.css's raised and sunken edges (MIT, Jordan\n// Scales, https://github.com/jdan/98.css): four inset shadows, here computed from the theme's roles.\n\nimport { inkOnEvery } from './themeInk.ts';\nimport { contrastRatio, hexToRgb, mix, relativeLuminance, type FontRoleName } from './themeApi.ts';\n\n// ---------------------------------------------------------------------------------------------\n// Vocabulary\n\n/** Color roles a component may name. `onAccent` is the readable label on the accent. */\nexport const COLOR_ROLES = ['bg', 'surface', 'elevated', 'page', 'border', 'text', 'muted', 'accent', 'onAccent', 'inverse', 'onInverse'] as const;\nexport type ColorRole = typeof COLOR_ROLES[number];\nexport type RoleColors = Record<ColorRole, string>;\n\nexport const BORDER_STYLES = ['none', 'solid', 'dashed', 'dotted', 'double', 'bevel-out', 'bevel-in'] as const;\nexport const SHADOWS = ['none', 'soft', 'deep', 'hard', 'inset', 'glow'] as const;\nexport const CASES = ['none', 'upper', 'lower', 'capitalize', 'small-caps'] as const;\nexport const AVATAR_SHAPES = ['circle', 'rounded', 'square', 'squircle', 'hexagon', 'octagon', 'diamond'] as const;\nexport const CORNERS = ['round', 'cut'] as const;\nconst FONT_ROLES: readonly FontRoleName[] = ['interface', 'post', 'heading', 'numbers', 'mono', 'chrome', 'dialog'];\n\nexport type Gradient = { from: ColorRole; to: ColorRole; angle: number };\nexport type Fill = ColorRole | 'transparent' | 'glass' | Gradient;\nexport type StateTokens = { fill?: Fill; text?: ColorRole; borderColor?: ColorRole; shadow?: typeof SHADOWS[number]; lift?: number; scale?: number; underline?: boolean };\nexport type ComponentTokens = {\n preset?: string;\n radius?: number | 'pill';\n borderWidth?: number;\n borderStyle?: typeof BORDER_STYLES[number];\n borderColor?: ColorRole;\n fill?: Fill;\n text?: ColorRole;\n padX?: number;\n padY?: number;\n gap?: number;\n height?: number;\n width?: number;\n size?: number;\n maxHeight?: number;\n font?: FontRoleName;\n fontSize?: number;\n weight?: number;\n case?: typeof CASES[number];\n tracking?: number;\n leading?: number;\n shadow?: typeof SHADOWS[number];\n shape?: typeof AVATAR_SHAPES[number];\n corner?: typeof CORNERS[number];\n visible?: boolean;\n hover?: StateTokens;\n active?: StateTokens;\n focus?: StateTokens;\n};\n\ntype ComponentDef = {\n /** Tokens set on the parent apply to this component too. */\n parent?: string;\n /** A text part: type tokens land on its leaves. */\n text?: boolean;\n /** Size ranges in px (absent: the token is not accepted on this component). */\n height?: [number, number]; width?: [number, number]; size?: [number, number]; maxHeight?: [number, number]; fontSize?: [number, number];\n /** Tokens only some components take. */\n shape?: boolean; corner?: boolean; visible?: boolean;\n /** Glass fills (a blur) are allowed here; never on parts that repeat down a timeline. */\n glass?: boolean;\n /** Gradient fills are allowed here (bars and buttons). */\n gradient?: boolean;\n /** Presets of this component's family. */\n presets?: keyof typeof PRESETS;\n /** Contrast its text must reach on its own fill. */\n contrast?: number;\n};\n\nconst LABEL: [number, number] = [12, 20];\nconst SMALL: [number, number] = [11, 18];\n/** Every component a theme can name. Sites map them to selectors; a component a site does not have is ignored. */\nexport const COMPONENTS = {\n nav: { width: [56, 320], glass: true, gradient: true },\n navItem: { height: [36, 64], fontSize: LABEL, text: true },\n topBar: { height: [40, 64], glass: true, gradient: true, fontSize: LABEL },\n tabs: { presets: 'tabs', gradient: true },\n tab: { height: [32, 56], fontSize: LABEL, text: true, presets: 'tabs' },\n post: { corner: true, presets: 'post', contrast: 7 },\n avatar: { size: [20, 64], shape: true, visible: true },\n displayName: { text: true, fontSize: LABEL, visible: true },\n handle: { text: true, fontSize: SMALL, visible: true },\n postText: { text: true, fontSize: [13, 24], contrast: 7 },\n meta: { text: true, fontSize: SMALL },\n actionBar: {},\n action: { size: [28, 44] },\n count: { text: true, fontSize: SMALL, visible: true },\n media: { corner: true, maxHeight: [200, 700] },\n linkCard: { corner: true },\n quote: {},\n button: { height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n buttonPrimary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n buttonSecondary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n buttonGhost: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n input: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },\n search: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },\n composer: { fontSize: [13, 24], text: true },\n /** The tool icons under a composer (media, poll, emoji); `text` is their color. */\n composerTool: { size: [28, 44] },\n panel: { glass: true, presets: 'panel' },\n menu: { parent: 'panel', glass: true, presets: 'panel' },\n dialog: { parent: 'panel', glass: true, presets: 'panel' },\n toast: { parent: 'panel', glass: true, presets: 'panel' },\n hoverCard: { parent: 'panel', glass: true, presets: 'panel' },\n sidebarCard: { parent: 'panel', glass: true, corner: true, presets: 'panel' },\n badge: { size: [14, 24], corner: true, fontSize: SMALL, text: true },\n pill: { fontSize: SMALL, text: true },\n divider: {},\n scrollbar: {},\n profileHeader: {},\n} as const satisfies Record<string, ComponentDef>;\nexport type ComponentId = keyof typeof COMPONENTS;\nexport const COMPONENT_IDS = Object.keys(COMPONENTS) as ComponentId[];\nexport type ThemeComponents = Partial<Record<ComponentId, ComponentTokens>>;\n\n/** Clamp ranges of the tokens every component shares (the JSON Schema says the same; tested). */\nexport const TOKEN_LIMITS = {\n radius: [0, 32], borderWidth: [0, 4], padX: [0, 32], padY: [0, 32], gap: [0, 24], weight: [100, 900],\n tracking: [-0.05, 0.2], leading: [1.1, 2], angle: [0, 360], lift: [0, 4], scale: [0.96, 1.04],\n} as const;\n\n/** Named token bundles per family; a theme's own tokens win over its preset's. Frozen once shipped. */\nexport const PRESETS = {\n button: {\n pill: { radius: 'pill', borderWidth: 0 },\n soft: { radius: 8, borderWidth: 0 },\n square: { radius: 0, borderWidth: 1, borderStyle: 'solid' },\n outline: { radius: 6, borderWidth: 1, borderStyle: 'solid', fill: 'transparent', text: 'text', borderColor: 'border' },\n bevel: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', text: 'text', active: { shadow: 'inset' } },\n gloss: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', shadow: 'soft' },\n 'flat-link': { radius: 0, borderWidth: 0, fill: 'transparent', text: 'accent', hover: { underline: true } },\n },\n post: {\n flat: { radius: 0, borderWidth: 0, fill: 'transparent', shadow: 'none' },\n card: { radius: 14, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface' },\n bubble: { radius: 20, borderWidth: 0, fill: 'surface' },\n window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface' },\n ruled: { radius: 0, borderWidth: 0, fill: 'transparent' },\n },\n input: {\n pill: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },\n underline: { radius: 0, borderWidth: 0, fill: 'transparent' },\n sunken: { radius: 0, borderStyle: 'bevel-in', fill: 'bg', text: 'text' },\n boxed: { radius: 4, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'bg' },\n },\n panel: {\n sheet: { radius: 12, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface', shadow: 'soft' },\n window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', shadow: 'none' },\n glass: { radius: 16, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'glass', shadow: 'soft' },\n },\n tabs: {\n underline: { radius: 0 },\n pills: { radius: 'pill' },\n folder: { radius: 6, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },\n blocks: { radius: 0, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },\n },\n} as const satisfies Record<string, Record<string, ComponentTokens>>;\n\n// ---------------------------------------------------------------------------------------------\n// Sanitizing\n\nconst obj = (value: unknown): Record<string, unknown> => value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {};\nconst finite = (value: unknown): value is number => typeof value === 'number' && Number.isFinite(value);\nconst clamp = (value: number, [min, max]: readonly [number, number]) => Math.min(max, Math.max(min, value));\nconst oneOf = <T extends string>(value: unknown, options: readonly T[]): T | undefined => options.includes(value as T) ? value as T : undefined;\nconst role = (value: unknown) => oneOf(value, COLOR_ROLES);\n\nfunction sanitizeFill(value: unknown, def: ComponentDef): Fill | undefined {\n if (value === 'transparent') return 'transparent';\n if (value === 'glass') return def.glass ? 'glass' : undefined;\n const named = role(value);\n if (named) return named;\n const source = obj(value);\n const from = role(source.from), to = role(source.to);\n if (def.gradient && from && to) return { from, to, angle: Math.round(clamp(finite(source.angle) ? source.angle : 180, TOKEN_LIMITS.angle)) };\n return undefined;\n}\n\nfunction sanitizeState(value: unknown, def: ComponentDef): StateTokens | undefined {\n const source = obj(value);\n const out: StateTokens = {};\n const fill = sanitizeFill(source.fill, def); if (fill !== undefined) out.fill = fill;\n const text = role(source.text); if (text) out.text = text;\n const borderColor = role(source.borderColor); if (borderColor) out.borderColor = borderColor;\n const shadow = oneOf(source.shadow, SHADOWS); if (shadow) out.shadow = shadow;\n if (finite(source.lift)) out.lift = +clamp(source.lift, TOKEN_LIMITS.lift).toFixed(1);\n if (finite(source.scale)) out.scale = +clamp(source.scale, TOKEN_LIMITS.scale).toFixed(3);\n if (typeof source.underline === 'boolean') out.underline = source.underline;\n return Object.keys(out).length ? out : undefined;\n}\n\n/** One component's tokens from JSON: clamped, unknown names and tokens the component does not take dropped. */\nexport function sanitizeComponentTokens(id: ComponentId, value: unknown): ComponentTokens | undefined {\n const def: ComponentDef = COMPONENTS[id];\n const source = obj(value);\n const out: ComponentTokens = {};\n if (def.presets && typeof source.preset === 'string' && Object.hasOwn(PRESETS[def.presets], source.preset)) out.preset = source.preset;\n if (source.radius === 'pill') out.radius = 'pill';\n else if (finite(source.radius)) out.radius = Math.round(clamp(source.radius, TOKEN_LIMITS.radius));\n if (finite(source.borderWidth)) out.borderWidth = +clamp(source.borderWidth, TOKEN_LIMITS.borderWidth).toFixed(1);\n const borderStyle = oneOf(source.borderStyle, BORDER_STYLES); if (borderStyle) out.borderStyle = borderStyle;\n const borderColor = role(source.borderColor); if (borderColor) out.borderColor = borderColor;\n const fill = sanitizeFill(source.fill, def); if (fill !== undefined) out.fill = fill;\n const text = role(source.text); if (text) out.text = text;\n for (const key of ['padX', 'padY', 'gap'] as const) if (finite(source[key])) out[key] = Math.round(clamp(source[key] as number, TOKEN_LIMITS[key]));\n for (const key of ['height', 'width', 'size', 'maxHeight', 'fontSize'] as const) {\n const range = def[key];\n if (range && finite(source[key])) out[key] = Math.round(clamp(source[key] as number, range));\n }\n if (def.text || def.fontSize) {\n const font = oneOf(source.font, FONT_ROLES); if (font) out.font = font;\n if (finite(source.weight)) out.weight = Math.round(clamp(source.weight, TOKEN_LIMITS.weight) / 50) * 50;\n const textCase = oneOf(source.case, CASES); if (textCase && id !== 'postText') out.case = textCase;\n if (finite(source.tracking)) out.tracking = +clamp(source.tracking, TOKEN_LIMITS.tracking).toFixed(3);\n if (finite(source.leading)) out.leading = +clamp(source.leading, TOKEN_LIMITS.leading).toFixed(2);\n }\n const shadow = oneOf(source.shadow, SHADOWS); if (shadow) out.shadow = shadow;\n if (def.shape) { const shape = oneOf(source.shape, AVATAR_SHAPES); if (shape) out.shape = shape; }\n if (def.corner) { const corner = oneOf(source.corner, CORNERS); if (corner) out.corner = corner; }\n if (def.visible && typeof source.visible === 'boolean') out.visible = source.visible;\n for (const state of ['hover', 'active', 'focus'] as const) { const tokens = sanitizeState(source[state], def); if (tokens) out[state] = tokens; }\n return Object.keys(out).length ? out : undefined;\n}\n\n/** The `components` group from JSON. Null when nothing valid is left (the theme sets no component). */\nexport function sanitizeComponents(value: unknown): ThemeComponents | null {\n const source = obj(value);\n const out: ThemeComponents = {};\n for (const id of COMPONENT_IDS) {\n if (!Object.hasOwn(source, id)) continue;\n const tokens = sanitizeComponentTokens(id, source[id]);\n if (tokens) out[id] = tokens;\n }\n return Object.keys(out).length ? out : null;\n}\n\n/** Every component with its preset and its parent's tokens folded in (own tokens win, then the preset, then the parent). */\nexport function resolveComponents(components: ThemeComponents): ThemeComponents {\n const expand = (id: ComponentId, tokens: ComponentTokens | undefined): ComponentTokens => {\n if (!tokens) return {};\n const def: ComponentDef = COMPONENTS[id];\n const preset = tokens.preset && def.presets ? (PRESETS[def.presets] as Record<string, ComponentTokens>)[tokens.preset] : undefined;\n const { preset: _name, ...own } = tokens;\n return { ...preset, ...own };\n };\n const out: ThemeComponents = {};\n for (const id of COMPONENT_IDS) {\n const def: ComponentDef = COMPONENTS[id];\n const parent = def.parent as ComponentId | undefined;\n const inherited = parent ? expand(parent, components[parent]) : {};\n const merged = { ...inherited, ...expand(id, components[id]) };\n if (Object.keys(merged).length) out[id] = merged;\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------------------------\n// Compiling\n\n/** A site's selectors for one component. */\nexport type PartDef = {\n /** The component's box. */\n sel: string;\n /** Its text leaves (sites often put type on leaf spans); defaults to the box. */\n text?: string;\n /** Where a fill is painted when it is not the box itself. */\n fill?: string;\n /** Tokens the site cannot honor on this part (left out of the CSS). */\n skip?: ReadonlyArray<keyof ComponentTokens>;\n};\nexport type PartMap = Partial<Record<ComponentId, PartDef>>;\n\nexport type ComponentContext = {\n /** Every role as `#rrggbb` (the theme's palette, legible). */\n colors: RoleColors;\n /** `font-family` per font role. */\n fonts: Record<FontRoleName, string>;\n};\n\nconst rgba = (hex: string, alpha: number) => `rgba(${hexToRgb(hex).join(', ')}, ${alpha})`;\nconst dark = (hex: string) => relativeLuminance(hex) < 0.18;\n\n/** The most readable of the theme's text-capable roles on `fill`. */\nexport function readableRole(fill: string, colors: RoleColors, preferred?: ColorRole): ColorRole {\n const candidates: ColorRole[] = ['text', 'onAccent', 'onInverse', 'bg', 'inverse'];\n if (preferred && !candidates.includes(preferred)) candidates.unshift(preferred);\n return candidates.reduce((best, candidate) => contrastRatio(colors[candidate], fill) > contrastRatio(colors[best], fill) ? candidate : best, preferred ?? 'text');\n}\n\nfunction fillCss(fill: Fill, colors: RoleColors): { decl: Array<[string, string]>; solid: string | null } {\n if (fill === 'transparent') return { decl: [['background-color', 'transparent'], ['background-image', 'none']], solid: null };\n if (fill === 'glass') return { decl: [['background-color', rgba(colors.surface, 0.72)], ['backdrop-filter', 'blur(14px) saturate(1.4)'], ['-webkit-backdrop-filter', 'blur(14px) saturate(1.4)']], solid: colors.surface };\n if (typeof fill === 'string') return { decl: [['background-color', colors[fill]], ['background-image', 'none']], solid: colors[fill] };\n // A gradient is judged at its less readable end: the midpoint stands in for both when choosing a label.\n return { decl: [['background-color', colors[fill.to]], ['background-image', `linear-gradient(${fill.angle}deg, ${colors[fill.from]}, ${colors[fill.to]})`]], solid: mix(colors[fill.from], colors[fill.to], 0.5) };\n}\n\n/** Raised and sunken edges after 98.css: two light and two dark inset lines, from the part's own fill. */\nfunction bevel(out: boolean, face: string): string {\n const light = mix(face, '#ffffff', 0.85), soft = mix(face, '#ffffff', 0.35), shade = mix(face, '#000000', 0.35), deep = mix(face, '#000000', 0.9);\n return out\n ? `inset -1px -1px ${deep}, inset 1px 1px ${light}, inset -2px -2px ${shade}, inset 2px 2px ${soft}`\n : `inset -1px -1px ${light}, inset 1px 1px ${shade}, inset -2px -2px ${soft}, inset 2px 2px ${deep}`;\n}\n\nfunction shadowCss(name: typeof SHADOWS[number], colors: RoleColors): string {\n const base = dark(colors.bg);\n switch (name) {\n case 'soft': return base ? `0 1px 2px ${rgba('#000000', 0.4)}, 0 8px 24px ${rgba('#000000', 0.35)}` : `0 1px 2px ${rgba('#000000', 0.06)}, 0 8px 24px ${rgba('#000000', 0.1)}`;\n case 'deep': return `0 0 0 1px ${rgba(colors.border, 0.6)}, 0 24px 64px ${rgba('#000000', base ? 0.6 : 0.28)}`;\n case 'hard': return `4px 4px 0 ${colors.accent}`;\n case 'inset': return `inset 1px 1px 3px ${rgba('#000000', base ? 0.6 : 0.25)}`;\n case 'glow': return `0 0 0 1px ${rgba(colors.accent, 0.5)}, 0 0 18px ${rgba(colors.accent, 0.35)}`;\n default: return 'none';\n }\n}\n\nconst SHAPES: Record<typeof AVATAR_SHAPES[number], Array<[string, string]>> = {\n circle: [['border-radius', '50%']],\n rounded: [['border-radius', '26%']],\n square: [['border-radius', '2px']],\n squircle: [['border-radius', '34%']],\n hexagon: [['border-radius', '0'], ['clip-path', 'polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%)']],\n octagon: [['border-radius', '0'], ['clip-path', 'polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%)']],\n diamond: [['border-radius', '0'], ['clip-path', 'polygon(50% 0, 100% 50%, 50% 100%, 0 50%)']],\n};\nconst CASE_CSS: Record<typeof CASES[number], Array<[string, string]>> = {\n none: [['text-transform', 'none'], ['font-variant-caps', 'normal']],\n upper: [['text-transform', 'uppercase']],\n lower: [['text-transform', 'lowercase']],\n capitalize: [['text-transform', 'capitalize']],\n 'small-caps': [['text-transform', 'none'], ['font-variant-caps', 'all-small-caps']],\n};\n\n/** A part rule's selector: two `:root`s lift it over the site's atomic classes and inline styles' non-important values. */\nexport const partRule = (selector: string) => selector.split(/,(?![^(]*\\))/).map(one => `:root:root ${one.trim()}`).join(',');\n\nexport type CompiledComponents = {\n /** `--wb-part-*` declarations (for `:where(:root)`). */\n values: string[];\n /** Rules that read them. */\n rules: string[];\n /** What the contrast pass changed, for import notes and the builder's report. */\n notes: string[];\n};\n\n/**\n * CSS for a theme's components over a site's part map. A component without a part, and a token the\n * part skips, emits nothing. Text on a fill the theme chose is held to the component's contrast\n * (the text role is swapped for the most readable one); sizes stay at or above a 24px target.\n */\nexport function compileComponents(components: ThemeComponents, parts: PartMap, ctx: ComponentContext): CompiledComponents {\n const values: string[] = [], rules: string[] = [], notes: string[] = [];\n const resolved = resolveComponents(components);\n for (const id of COMPONENT_IDS) {\n const tokens = resolved[id], part = parts[id];\n if (!tokens || !part) continue;\n const def: ComponentDef = COMPONENTS[id];\n const skip = new Set<string>(part.skip ?? []);\n const has = <K extends keyof ComponentTokens>(key: K): boolean => tokens[key] !== undefined && !skip.has(key);\n const box: string[] = [], type: string[] = [], fillRule: string[] = [];\n const put = (list: string[], token: string, property: string, value: string) => {\n const name = `--wb-part-${id}-${token}`;\n if (!values.some(item => item.startsWith(`${name}:`))) values.push(`${name}:${value}`);\n list.push(`${property}:var(${name}) !important`);\n };\n\n // Fill first: the text role depends on it.\n let face: string | null = null;\n if (has('fill')) {\n const { decl, solid } = fillCss(tokens.fill!, ctx.colors);\n face = solid;\n decl.forEach(([property, value], index) => put(part.fill ? fillRule : box, `fill${index ? `-${index}` : ''}`, property, value));\n }\n let textRole = has('text') ? tokens.text! : undefined;\n const need = def.contrast ?? 4.5;\n if (face && (def.text || textRole)) {\n // A role that cannot read on this fill gives way to the best role (white label on an accent fill)...\n if (!textRole || contrastRatio(ctx.colors[textRole], face) < need) {\n const readable = readableRole(face, ctx.colors, textRole);\n if (textRole && readable !== textRole) notes.push(`${id}: text \"${textRole}\" on its fill is under ${need}:1, using \"${readable}\"`);\n textRole = readable;\n }\n }\n if (textRole) {\n // ...and the ink is then solved on the grounds it really sits on (theme engine v3 3.3): its fill, or with\n // no fill of its own every surface it can sit on, the page canvas included (an outline button in the\n // rail sits on the page: Solarized's accent read 4.45:1 there).\n // A role made for another ground (onAccent, onInverse, bg: a label on a fill some parent paints, the\n // Classic bar) is the theme's statement about that parent and stands.\n const surfaceInk = textRole === 'text' || textRole === 'muted' || textRole === 'accent';\n const grounds = face ? [face] : surfaceInk ? [ctx.colors.bg, ctx.colors.surface, ctx.colors.elevated, ctx.colors.page] : [];\n const solved = grounds.length ? inkOnEvery(grounds, ctx.colors[textRole], need) : { ink: ctx.colors[textRole], adjusted: false };\n if (solved.adjusted) notes.push(`${id}: text \"${textRole}\" moved to ${solved.ink} to read ${need}:1 on ${grounds.join('/')}`);\n put(type, 'text', 'color', solved.ink);\n }\n\n if (has('radius')) put(box, 'radius', 'border-radius', tokens.radius === 'pill' ? '9999px' : `${tokens.radius}px`);\n const style = has('borderStyle') ? tokens.borderStyle! : undefined;\n if (style === 'bevel-out' || style === 'bevel-in') {\n const base = face ?? ctx.colors.surface;\n put(box, 'border-style', 'border-style', 'none');\n put(box, 'bevel', 'box-shadow', bevel(style === 'bevel-out', base));\n } else {\n if (style) put(box, 'border-style', 'border-style', style);\n if (has('borderWidth')) put(box, 'border-width', 'border-width', `${tokens.borderWidth}px`);\n // A width without a style would draw nothing: X's boxes are `border: 0 solid`.\n if (has('borderWidth') && !style && tokens.borderWidth! > 0) put(box, 'border-style', 'border-style', 'solid');\n if (has('shadow')) put(box, 'shadow', 'box-shadow', shadowCss(tokens.shadow!, ctx.colors));\n }\n if (has('borderColor')) put(box, 'border-color', 'border-color', ctx.colors[tokens.borderColor!]);\n if (has('padX')) put(box, 'pad-x', 'padding-inline', `${tokens.padX}px`);\n if (has('padY')) put(box, 'pad-y', 'padding-block', `${tokens.padY}px`);\n if (has('gap')) put(box, 'gap', 'gap', `${tokens.gap}px`);\n if (has('height')) put(box, 'height', 'min-height', `${Math.max(24, tokens.height!)}px`);\n if (has('width')) put(box, 'width', 'width', `${tokens.width}px`);\n if (has('size')) { put(box, 'size', 'width', `${tokens.size}px`); box.push(`height:var(--wb-part-${id}-size) !important`); }\n if (has('maxHeight')) put(box, 'max-height', 'max-height', `${tokens.maxHeight}px`);\n if (has('shape')) SHAPES[tokens.shape!].forEach(([property, value], index) => put(box, `shape${index ? `-${index}` : ''}`, property, value));\n if (has('corner') && tokens.corner === 'cut') put(box, 'corner', 'clip-path', 'polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px))');\n if (has('visible') && tokens.visible === false) put(box, 'display', 'display', 'none');\n\n if (has('font')) put(type, 'font', 'font-family', ctx.fonts[tokens.font!]);\n if (has('fontSize')) {\n put(type, 'font-size', 'font-size', `${tokens.fontSize}px`);\n put(type, 'line-height', 'line-height', String(tokens.leading ?? 1.3));\n } else if (has('leading')) put(type, 'line-height', 'line-height', String(tokens.leading));\n if (has('weight')) put(type, 'weight', 'font-weight', String(tokens.weight));\n if (has('case')) CASE_CSS[tokens.case!].forEach(([property, value], index) => put(type, `case${index ? `-${index}` : ''}`, property, value));\n if (has('tracking')) put(type, 'tracking', 'letter-spacing', `${tokens.tracking}em`);\n\n const textSel = part.text ?? part.sel;\n if (box.length) rules.push(`${partRule(part.sel)}{${box.join(';')}}`);\n if (fillRule.length) rules.push(`${partRule(part.fill!)}{${fillRule.join(';')}}`);\n if (type.length) rules.push(`${partRule(textSel)}{${type.join(';')}}`);\n\n for (const state of ['hover', 'active', 'focus'] as const) {\n const tokensOf = tokens[state];\n if (!tokensOf || skip.has(state)) continue;\n const pseudo = state === 'focus' ? ':focus-visible' : `:${state}`;\n const still: string[] = [], moving: string[] = [], label: string[] = [];\n let stateFace = face;\n if (tokensOf.fill !== undefined) { const { decl, solid } = fillCss(tokensOf.fill, ctx.colors); stateFace = solid ?? face; for (const [property, value] of decl) still.push(`${property}:${value} !important`); }\n let stateText = tokensOf.text;\n if (stateFace && (stateText || tokensOf.fill !== undefined) && (def.text || stateText)) {\n if (!stateText || contrastRatio(ctx.colors[stateText], stateFace) < (def.contrast ?? 4.5)) stateText = readableRole(stateFace, ctx.colors, stateText);\n }\n if (stateText) label.push(`color:${ctx.colors[stateText]} !important`);\n if (tokensOf.underline !== undefined) label.push(`text-decoration:${tokensOf.underline ? 'underline' : 'none'} !important`);\n if (tokensOf.borderColor) still.push(`border-color:${ctx.colors[tokensOf.borderColor]} !important`);\n if (tokensOf.shadow) still.push(`box-shadow:${tokensOf.shadow === 'inset' && (style === 'bevel-out' || style === 'bevel-in') ? bevel(false, face ?? ctx.colors.surface) : shadowCss(tokensOf.shadow, ctx.colors)} !important`);\n const transforms = [tokensOf.lift ? `translateY(-${tokensOf.lift}px)` : '', tokensOf.scale && tokensOf.scale !== 1 ? `scale(${tokensOf.scale})` : ''].filter(Boolean);\n if (transforms.length) moving.push(`transform:${transforms.join(' ')} !important`);\n const stateSel = (selector: string) => selector.split(/,(?![^(]*\\))/).map(one => `${one.trim()}${pseudo}`).join(',');\n if (still.length) rules.push(`${partRule(stateSel(part.sel))}{${still.join(';')}}`);\n // The label of a hovered or pressed part: the box and the text leaves under it.\n if (label.length) rules.push(`${partRule(`${stateSel(part.sel)},${part.sel.split(/,(?![^(]*\\))/).map(one => `${one.trim()}${pseudo} :is(span,div,a)`).join(',')}`)}{${label.join(';')}}`);\n // Movement only for people who have not asked for less of it.\n if (moving.length) rules.push(`@media (prefers-reduced-motion:no-preference){${partRule(stateSel(part.sel))}{${moving.join(';')}}}`);\n }\n }\n return { values, rules, notes };\n}\n\n/** The `colors.actions` group: the colors of an on state (liked, reposted, bookmarked) and of the reply hover. */\nexport const ACTION_NAMES = ['reply', 'repost', 'like', 'bookmark'] as const;\nexport type ActionColors = Partial<Record<typeof ACTION_NAMES[number], string>>;\n"]}
|
|
@@ -89,7 +89,9 @@ export function compileDecor(decor, targets, ctx) {
|
|
|
89
89
|
if (decor.selection) {
|
|
90
90
|
const fill = colors[decor.selection.fill];
|
|
91
91
|
const text = contrastRatio(colors[decor.selection.text], fill) >= 4.5 ? colors[decor.selection.text] : (contrastRatio('#ffffff', fill) >= contrastRatio('#000000', fill) ? '#ffffff' : '#000000');
|
|
92
|
-
|
|
92
|
+
// A bare ::selection: with an ancestor in front (`:root:root ::selection`) every node the site
|
|
93
|
+
// inserts costs the engine extra style recalculation (theme matrix: 4 elements per insertion, 2 without).
|
|
94
|
+
out.push(`::selection{background-color:${fill} !important;color:${text} !important}`);
|
|
93
95
|
}
|
|
94
96
|
if (decor.scrollbar) {
|
|
95
97
|
const { width, thumb = 'border', track, style } = decor.scrollbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeDecor.js","sourceRoot":"","sources":["../../../runtime/src/themeDecor.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,oGAAoG;AACpG,sGAAsG;AACtG,QAAQ;AAER,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAmC,MAAM,sBAAsB,CAAC;AAEpF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AACnG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;AAChF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAC1F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AM,CAAC,IAAoD,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QACjI,IAAI,GAAG;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,0IAA0I;AAC1I,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC","sourcesContent":["// Decoration: what a theme draws between and around the components: divider lines, a title bar or a\n// masthead, the focus ring, selection, scrollbars, link underlines, the feel of motion. Fixed words\n// and clamped numbers, colors by role. Where the lines and bars go is the site's (its decor targets).\n// Pure.\n\nimport { contrastRatio } from './themeApi.ts';\nimport { COLOR_ROLES, type ColorRole, type RoleColors } from './themeComponents.ts';\n\nexport const DIVIDER_STYLES = ['none', 'hairline', 'solid', 'dashed', 'dotted', 'double'] as const;\nexport const CHROME_KINDS = ['none', 'titlebar', 'masthead', 'prompt'] as const;\nexport const RING_STYLES = ['solid', 'dashed', 'dotted', 'double'] as const;\nexport const MOTION_CURVES = ['standard', 'snappy', 'spring', 'linear', 'steps'] as const;\nexport const LINK_UNDERLINES = ['always', 'hover', 'never'] as const;\n\nexport type ThemeDecor = {\n dividers?: { style: typeof DIVIDER_STYLES[number]; color?: ColorRole; width?: number };\n /** A drawn frame around the main column: a window title bar, a newspaper masthead, a terminal prompt. `title` is plain text. */\n chrome?: { kind: typeof CHROME_KINDS[number]; title?: string };\n focusRing?: { width?: number; style?: typeof RING_STYLES[number]; color?: ColorRole; offset?: number };\n selection?: { fill: ColorRole; text: ColorRole };\n scrollbar?: { width?: 'auto' | 'thin'; thumb?: ColorRole; track?: ColorRole; style?: 'flat' | 'classic' };\n links?: { underline: typeof LINK_UNDERLINES[number] };\n motion?: { duration?: number; curve?: typeof MOTION_CURVES[number]; press?: number };\n};\n\nconst obj = (value: unknown): Record<string, unknown> => value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {};\nconst oneOf = <T extends string>(value: unknown, options: readonly T[]): T | undefined => options.includes(value as T) ? value as T : undefined;\nconst num = (value: unknown, min: number, max: number): number | undefined => typeof value === 'number' && Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : undefined;\nconst role = (value: unknown) => oneOf(value, COLOR_ROLES);\n/** Text a theme may put into a drawn bar: letters, digits, spaces and a little punctuation; it is written into a CSS string. */\nexport const chromeTitle = (value: unknown) => typeof value === 'string' ? value.replace(/[^\\p{L}\\p{N} .,:!?&+\\-_/#@*~()[\\]|>$]/gu, '').replace(/&/g, '+').trim().slice(0, 24) : '';\n\n/** The `decor` group from JSON. Null when nothing valid is left. */\nexport function sanitizeDecor(value: unknown): ThemeDecor | null {\n const source = obj(value);\n const out: ThemeDecor = {};\n const dividers = obj(source.dividers), dividerStyle = oneOf(dividers.style, DIVIDER_STYLES);\n if (dividerStyle) {\n const color = role(dividers.color), width = num(dividers.width, 0, 3);\n out.dividers = { style: dividerStyle, ...(color ? { color } : {}), ...(width !== undefined ? { width: +width.toFixed(1) } : {}) };\n }\n const chrome = obj(source.chrome), kind = oneOf(chrome.kind, CHROME_KINDS);\n if (kind && kind !== 'none') { const title = chromeTitle(chrome.title); out.chrome = { kind, ...(title ? { title } : {}) }; }\n const ring = obj(source.focusRing);\n if (Object.keys(ring).length) {\n const width = num(ring.width, 2, 4), style = oneOf(ring.style, RING_STYLES), color = role(ring.color), offset = num(ring.offset, 0, 4);\n const focusRing = { ...(width !== undefined ? { width: Math.round(width) } : {}), ...(style ? { style } : {}), ...(color ? { color } : {}), ...(offset !== undefined ? { offset: Math.round(offset) } : {}) };\n if (Object.keys(focusRing).length) out.focusRing = focusRing;\n }\n const selection = obj(source.selection), fill = role(selection.fill), text = role(selection.text);\n if (fill && text) out.selection = { fill, text };\n const bar = obj(source.scrollbar);\n if (Object.keys(bar).length) {\n const width = oneOf(bar.width, ['auto', 'thin'] as const), thumb = role(bar.thumb), track = role(bar.track), style = oneOf(bar.style, ['flat', 'classic'] as const);\n const scrollbar = { ...(width ? { width } : {}), ...(thumb ? { thumb } : {}), ...(track ? { track } : {}), ...(style ? { style } : {}) };\n if (Object.keys(scrollbar).length) out.scrollbar = scrollbar;\n }\n const underline = oneOf(obj(source.links).underline, LINK_UNDERLINES);\n if (underline) out.links = { underline };\n const motion = obj(source.motion);\n if (Object.keys(motion).length) {\n const duration = num(motion.duration, 0, 400), curve = oneOf(motion.curve, MOTION_CURVES), press = num(motion.press, 0.96, 1);\n const value = { ...(duration !== undefined ? { duration: Math.round(duration) } : {}), ...(curve ? { curve } : {}), ...(press !== undefined ? { press: +press.toFixed(3) } : {}) };\n if (Object.keys(value).length) out.motion = value;\n }\n return Object.keys(out).length ? out : null;\n}\n\n/** Where a site's decoration goes. Every entry is optional: a site without it draws nothing for that key. */\nexport type DecorTargets<Context> = {\n /** Rows whose bottom edge is the divider between items (a site's list cells). */\n divider?: string;\n /** Links inside running text. */\n link?: string;\n /** What takes keyboard focus. */\n focusable?: string;\n /** What moves with `motion` (buttons, links, rows). */\n moving?: string;\n /** What a press shrinks. */\n pressable?: string;\n /** The scrollable roots. */\n scroller?: string;\n /** The site's drawing of each chrome kind. */\n chrome?: Partial<Record<Exclude<typeof CHROME_KINDS[number], 'none'>, (title: string, ctx: Context) => string>>;\n};\n\nconst CURVES: Record<typeof MOTION_CURVES[number], string> = {\n standard: 'cubic-bezier(.2,.7,.2,1)', snappy: 'cubic-bezier(.3,1.4,.5,1)', spring: 'cubic-bezier(.2,1.6,.4,1)', linear: 'linear', steps: 'steps(3,end)',\n};\n\n/** The role among `candidates` that reaches `ratio` on every surface, else the most visible one. */\nfunction visibleOn(colors: RoleColors, wanted: ColorRole, surfaces: string[], ratio: number): string {\n const worst = (hex: string) => Math.min(...surfaces.map(surface => contrastRatio(hex, surface)));\n if (worst(colors[wanted]) >= ratio) return colors[wanted];\n return (['accent', 'text', 'inverse'] as ColorRole[]).map(name => colors[name]).reduce((best, hex) => worst(hex) > worst(best) ? hex : best, colors[wanted]);\n}\n\n/**\n * CSS for a theme's decoration. A focus ring is always drawn when the theme names one (at least 2px\n * and 3:1 on the page's surfaces: the color is swapped for a visible one otherwise); motion only\n * for people who have not asked for less of it.\n */\nexport function compileDecor<Context extends { colors: RoleColors }>(decor: ThemeDecor, targets: DecorTargets<Context>, ctx: Context): string[] {\n const out: string[] = [];\n const { colors } = ctx;\n const surfaces = [colors.bg, colors.surface, colors.page];\n if (decor.dividers && targets.divider) {\n const { style, color = 'border', width } = decor.dividers;\n const line = style === 'none' ? '0 none' : `${style === 'hairline' ? 1 : width ?? (style === 'double' ? 3 : 1)}px ${style === 'hairline' ? 'solid' : style} ${colors[color]}`;\n out.push(`:root:root :is(${targets.divider}){border-bottom:${line} !important}`);\n }\n if (decor.focusRing && targets.focusable) {\n const { width = 2, style = 'solid', color = 'accent', offset = 2 } = decor.focusRing;\n out.push(`:root:root :is(${targets.focusable}):focus-visible{outline:${Math.max(2, width)}px ${style} ${visibleOn(colors, color, surfaces, 3)} !important;outline-offset:${offset}px !important}`);\n }\n if (decor.selection) {\n const fill = colors[decor.selection.fill];\n const text = contrastRatio(colors[decor.selection.text], fill) >= 4.5 ? colors[decor.selection.text] : (contrastRatio('#ffffff', fill) >= contrastRatio('#000000', fill) ? '#ffffff' : '#000000');\n out.push(`:root:root ::selection{background-color:${fill} !important;color:${text} !important}`);\n }\n if (decor.scrollbar) {\n const { width, thumb = 'border', track, style } = decor.scrollbar;\n const scroller = targets.scroller ?? 'html,body';\n const thumbColor = visibleOn(colors, thumb, [track ? colors[track] : colors.page], 1.5);\n out.push(`:root:root :is(${scroller}){scrollbar-color:${thumbColor} ${track ? colors[track] : 'transparent'} !important${width ? `;scrollbar-width:${width} !important` : ''}}`);\n // The classic look needs the engine's own scrollbar parts; `scrollbar-color` would switch them off where both are set.\n if (style === 'classic') {\n const face = track ? colors[track] : colors.surface;\n out.push(`@supports selector(::-webkit-scrollbar){:root:root :is(${scroller}){scrollbar-color:auto !important;scrollbar-width:auto !important}:root:root ::-webkit-scrollbar{width:16px;height:16px;background:${face}}:root:root ::-webkit-scrollbar-thumb{background:${colors.surface};box-shadow:inset -1px -1px ${colors.text},inset 1px 1px ${colors.bg},inset -2px -2px ${colors.muted},inset 2px 2px ${colors.elevated}}:root:root ::-webkit-scrollbar-corner{background:${face}}}`);\n }\n }\n if (decor.links && targets.link) {\n const { underline } = decor.links;\n out.push(`:root:root :is(${targets.link}){text-decoration:${underline === 'always' ? 'underline' : 'none'} !important;text-underline-offset:2px}`);\n if (underline === 'hover') out.push(`:root:root :is(${targets.link}):hover{text-decoration:underline !important}`);\n }\n if (decor.motion && (targets.moving || targets.pressable)) {\n const { duration, curve = 'standard', press } = decor.motion;\n const rules: string[] = [];\n if (duration !== undefined && targets.moving) {\n rules.push(`:root:root :is(${targets.moving}){transition:background-color ${duration}ms ${CURVES[curve]},color ${duration}ms ${CURVES[curve]},border-color ${duration}ms ${CURVES[curve]},box-shadow ${duration}ms ${CURVES[curve]},transform ${duration}ms ${CURVES[curve]} !important}`);\n }\n if (press !== undefined && press < 1 && targets.pressable) rules.push(`:root:root :is(${targets.pressable}):active{transform:scale(${press}) !important}`);\n if (rules.length) out.push(`@media (prefers-reduced-motion:no-preference){${rules.join('')}}`);\n }\n if (decor.chrome) {\n const css = targets.chrome?.[decor.chrome.kind as Exclude<typeof CHROME_KINDS[number], 'none'>]?.(decor.chrome.title ?? '', ctx);\n if (css) out.push(css);\n }\n return out;\n}\n\n/** A theme's text as a CSS string literal (for `content`): the allow-list of `chromeTitle` plus escaping of what could end the string. */\nexport const cssString = (value: string) => `\"${value.replace(/[\\\\\"\\n\\r\\f]/g, match => `\\\\${match.charCodeAt(0).toString(16)} `)}\"`;\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focus ring, selection, scrollbars, link underlines, the feel of motion. Fixed words\n// and clamped numbers, colors by role. Where the lines and bars go is the site's (its decor targets).\n// Pure.\n\nimport { contrastRatio } from './themeApi.ts';\nimport { COLOR_ROLES, type ColorRole, type RoleColors } from './themeComponents.ts';\n\nexport const DIVIDER_STYLES = ['none', 'hairline', 'solid', 'dashed', 'dotted', 'double'] as const;\nexport const CHROME_KINDS = ['none', 'titlebar', 'masthead', 'prompt'] as const;\nexport const RING_STYLES = ['solid', 'dashed', 'dotted', 'double'] as const;\nexport const MOTION_CURVES = ['standard', 'snappy', 'spring', 'linear', 'steps'] as const;\nexport const LINK_UNDERLINES = ['always', 'hover', 'never'] as const;\n\nexport type ThemeDecor = {\n dividers?: { style: typeof DIVIDER_STYLES[number]; color?: ColorRole; width?: number };\n /** A drawn frame around the main column: a window title bar, a newspaper masthead, a terminal prompt. `title` is plain text. */\n chrome?: { kind: typeof CHROME_KINDS[number]; title?: string };\n focusRing?: { width?: number; style?: typeof RING_STYLES[number]; color?: ColorRole; offset?: number };\n selection?: { fill: ColorRole; text: ColorRole };\n scrollbar?: { width?: 'auto' | 'thin'; thumb?: ColorRole; track?: ColorRole; style?: 'flat' | 'classic' };\n links?: { underline: typeof LINK_UNDERLINES[number] };\n motion?: { duration?: number; curve?: typeof MOTION_CURVES[number]; press?: number };\n};\n\nconst obj = (value: unknown): Record<string, unknown> => value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {};\nconst oneOf = <T extends string>(value: unknown, options: readonly T[]): T | undefined => options.includes(value as T) ? value as T : undefined;\nconst num = (value: unknown, min: number, max: number): number | undefined => typeof value === 'number' && Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : undefined;\nconst role = (value: unknown) => oneOf(value, COLOR_ROLES);\n/** Text a theme may put into a drawn bar: letters, digits, spaces and a little punctuation; it is written into a CSS string. */\nexport const chromeTitle = (value: unknown) => typeof value === 'string' ? value.replace(/[^\\p{L}\\p{N} .,:!?&+\\-_/#@*~()[\\]|>$]/gu, '').replace(/&/g, '+').trim().slice(0, 24) : '';\n\n/** The `decor` group from JSON. Null when nothing valid is left. */\nexport function sanitizeDecor(value: unknown): ThemeDecor | null {\n const source = obj(value);\n const out: ThemeDecor = {};\n const dividers = obj(source.dividers), dividerStyle = oneOf(dividers.style, DIVIDER_STYLES);\n if (dividerStyle) {\n const color = role(dividers.color), width = num(dividers.width, 0, 3);\n out.dividers = { style: dividerStyle, ...(color ? { color } : {}), ...(width !== undefined ? { width: +width.toFixed(1) } : {}) };\n }\n const chrome = obj(source.chrome), kind = oneOf(chrome.kind, CHROME_KINDS);\n if (kind && kind !== 'none') { const title = chromeTitle(chrome.title); out.chrome = { kind, ...(title ? { title } : {}) }; }\n const ring = obj(source.focusRing);\n if (Object.keys(ring).length) {\n const width = num(ring.width, 2, 4), style = oneOf(ring.style, RING_STYLES), color = role(ring.color), offset = num(ring.offset, 0, 4);\n const focusRing = { ...(width !== undefined ? { width: Math.round(width) } : {}), ...(style ? { style } : {}), ...(color ? { color } : {}), ...(offset !== undefined ? { offset: Math.round(offset) } : {}) };\n if (Object.keys(focusRing).length) out.focusRing = focusRing;\n }\n const selection = obj(source.selection), fill = role(selection.fill), text = role(selection.text);\n if (fill && text) out.selection = { fill, text };\n const bar = obj(source.scrollbar);\n if (Object.keys(bar).length) {\n const width = oneOf(bar.width, ['auto', 'thin'] as const), thumb = role(bar.thumb), track = role(bar.track), style = oneOf(bar.style, ['flat', 'classic'] as const);\n const scrollbar = { ...(width ? { width } : {}), ...(thumb ? { thumb } : {}), ...(track ? { track } : {}), ...(style ? { style } : {}) };\n if (Object.keys(scrollbar).length) out.scrollbar = scrollbar;\n }\n const underline = oneOf(obj(source.links).underline, LINK_UNDERLINES);\n if (underline) out.links = { underline };\n const motion = obj(source.motion);\n if (Object.keys(motion).length) {\n const duration = num(motion.duration, 0, 400), curve = oneOf(motion.curve, MOTION_CURVES), press = num(motion.press, 0.96, 1);\n const value = { ...(duration !== undefined ? { duration: Math.round(duration) } : {}), ...(curve ? { curve } : {}), ...(press !== undefined ? { press: +press.toFixed(3) } : {}) };\n if (Object.keys(value).length) out.motion = value;\n }\n return Object.keys(out).length ? out : null;\n}\n\n/** Where a site's decoration goes. Every entry is optional: a site without it draws nothing for that key. */\nexport type DecorTargets<Context> = {\n /** Rows whose bottom edge is the divider between items (a site's list cells). */\n divider?: string;\n /** Links inside running text. */\n link?: string;\n /** What takes keyboard focus. */\n focusable?: string;\n /** What moves with `motion` (buttons, links, rows). */\n moving?: string;\n /** What a press shrinks. */\n pressable?: string;\n /** The scrollable roots. */\n scroller?: string;\n /** The site's drawing of each chrome kind. */\n chrome?: Partial<Record<Exclude<typeof CHROME_KINDS[number], 'none'>, (title: string, ctx: Context) => string>>;\n};\n\nconst CURVES: Record<typeof MOTION_CURVES[number], string> = {\n standard: 'cubic-bezier(.2,.7,.2,1)', snappy: 'cubic-bezier(.3,1.4,.5,1)', spring: 'cubic-bezier(.2,1.6,.4,1)', linear: 'linear', steps: 'steps(3,end)',\n};\n\n/** The role among `candidates` that reaches `ratio` on every surface, else the most visible one. */\nfunction visibleOn(colors: RoleColors, wanted: ColorRole, surfaces: string[], ratio: number): string {\n const worst = (hex: string) => Math.min(...surfaces.map(surface => contrastRatio(hex, surface)));\n if (worst(colors[wanted]) >= ratio) return colors[wanted];\n return (['accent', 'text', 'inverse'] as ColorRole[]).map(name => colors[name]).reduce((best, hex) => worst(hex) > worst(best) ? hex : best, colors[wanted]);\n}\n\n/**\n * CSS for a theme's decoration. A focus ring is always drawn when the theme names one (at least 2px\n * and 3:1 on the page's surfaces: the color is swapped for a visible one otherwise); motion only\n * for people who have not asked for less of it.\n */\nexport function compileDecor<Context extends { colors: RoleColors }>(decor: ThemeDecor, targets: DecorTargets<Context>, ctx: Context): string[] {\n const out: string[] = [];\n const { colors } = ctx;\n const surfaces = [colors.bg, colors.surface, colors.page];\n if (decor.dividers && targets.divider) {\n const { style, color = 'border', width } = decor.dividers;\n const line = style === 'none' ? '0 none' : `${style === 'hairline' ? 1 : width ?? (style === 'double' ? 3 : 1)}px ${style === 'hairline' ? 'solid' : style} ${colors[color]}`;\n out.push(`:root:root :is(${targets.divider}){border-bottom:${line} !important}`);\n }\n if (decor.focusRing && targets.focusable) {\n const { width = 2, style = 'solid', color = 'accent', offset = 2 } = decor.focusRing;\n out.push(`:root:root :is(${targets.focusable}):focus-visible{outline:${Math.max(2, width)}px ${style} ${visibleOn(colors, color, surfaces, 3)} !important;outline-offset:${offset}px !important}`);\n }\n if (decor.selection) {\n const fill = colors[decor.selection.fill];\n const text = contrastRatio(colors[decor.selection.text], fill) >= 4.5 ? colors[decor.selection.text] : (contrastRatio('#ffffff', fill) >= contrastRatio('#000000', fill) ? '#ffffff' : '#000000');\n // A bare ::selection: with an ancestor in front (`:root:root ::selection`) every node the site\n // inserts costs the engine extra style recalculation (theme matrix: 4 elements per insertion, 2 without).\n out.push(`::selection{background-color:${fill} !important;color:${text} !important}`);\n }\n if (decor.scrollbar) {\n const { width, thumb = 'border', track, style } = decor.scrollbar;\n const scroller = targets.scroller ?? 'html,body';\n const thumbColor = visibleOn(colors, thumb, [track ? colors[track] : colors.page], 1.5);\n out.push(`:root:root :is(${scroller}){scrollbar-color:${thumbColor} ${track ? colors[track] : 'transparent'} !important${width ? `;scrollbar-width:${width} !important` : ''}}`);\n // The classic look needs the engine's own scrollbar parts; `scrollbar-color` would switch them off where both are set.\n if (style === 'classic') {\n const face = track ? colors[track] : colors.surface;\n out.push(`@supports selector(::-webkit-scrollbar){:root:root :is(${scroller}){scrollbar-color:auto !important;scrollbar-width:auto !important}:root:root ::-webkit-scrollbar{width:16px;height:16px;background:${face}}:root:root ::-webkit-scrollbar-thumb{background:${colors.surface};box-shadow:inset -1px -1px ${colors.text},inset 1px 1px ${colors.bg},inset -2px -2px ${colors.muted},inset 2px 2px ${colors.elevated}}:root:root ::-webkit-scrollbar-corner{background:${face}}}`);\n }\n }\n if (decor.links && targets.link) {\n const { underline } = decor.links;\n out.push(`:root:root :is(${targets.link}){text-decoration:${underline === 'always' ? 'underline' : 'none'} !important;text-underline-offset:2px}`);\n if (underline === 'hover') out.push(`:root:root :is(${targets.link}):hover{text-decoration:underline !important}`);\n }\n if (decor.motion && (targets.moving || targets.pressable)) {\n const { duration, curve = 'standard', press } = decor.motion;\n const rules: string[] = [];\n if (duration !== undefined && targets.moving) {\n rules.push(`:root:root :is(${targets.moving}){transition:background-color ${duration}ms ${CURVES[curve]},color ${duration}ms ${CURVES[curve]},border-color ${duration}ms ${CURVES[curve]},box-shadow ${duration}ms ${CURVES[curve]},transform ${duration}ms ${CURVES[curve]} !important}`);\n }\n if (press !== undefined && press < 1 && targets.pressable) rules.push(`:root:root :is(${targets.pressable}):active{transform:scale(${press}) !important}`);\n if (rules.length) out.push(`@media (prefers-reduced-motion:no-preference){${rules.join('')}}`);\n }\n if (decor.chrome) {\n const css = targets.chrome?.[decor.chrome.kind as Exclude<typeof CHROME_KINDS[number], 'none'>]?.(decor.chrome.title ?? '', ctx);\n if (css) out.push(css);\n }\n return out;\n}\n\n/** A theme's text as a CSS string literal (for `content`): the allow-list of `chromeTitle` plus escaping of what could end the string. */\nexport const cssString = (value: string) => `\"${value.replace(/[\\\\\"\\n\\r\\f]/g, match => `\\\\${match.charCodeAt(0).toString(16)} `)}\"`;\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const SURFACE_NAMES: readonly ["canvas", "content", "card", "chrome", "raised", "panel", "strong", "accentFill", "tooltip"];
|
|
2
|
+
export type SurfaceName = typeof SURFACE_NAMES[number];
|
|
3
|
+
export type EdgeStyle = 'flat' | 'hairline' | 'outline' | 'bevel' | 'gloss';
|
|
4
|
+
export type DerivePalette = {
|
|
5
|
+
scheme?: 'light' | 'dark';
|
|
6
|
+
page?: string | null;
|
|
7
|
+
bg: string;
|
|
8
|
+
surface: string;
|
|
9
|
+
elevated: string;
|
|
10
|
+
face?: string | null;
|
|
11
|
+
border: string;
|
|
12
|
+
text: string;
|
|
13
|
+
muted: string;
|
|
14
|
+
accent: string;
|
|
15
|
+
inverse?: string | null;
|
|
16
|
+
inverse2?: string | null;
|
|
17
|
+
onInverse?: string | null;
|
|
18
|
+
hover?: string | null;
|
|
19
|
+
selected?: string | null;
|
|
20
|
+
};
|
|
21
|
+
export type DeriveInput = {
|
|
22
|
+
palette: DerivePalette;
|
|
23
|
+
edge?: {
|
|
24
|
+
style?: EdgeStyle;
|
|
25
|
+
strong?: boolean;
|
|
26
|
+
};
|
|
27
|
+
access?: 'standard' | 'high';
|
|
28
|
+
post?: {
|
|
29
|
+
style?: 'flat' | 'cards' | 'bubbles' | 'compact' | 'broadsheet';
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export type Surface = {
|
|
33
|
+
/** The fill (`fill2`: the far end of a gradient fill; inks read on both). */
|
|
34
|
+
fill: string;
|
|
35
|
+
fill2?: string;
|
|
36
|
+
ink: string;
|
|
37
|
+
inkSoft: string;
|
|
38
|
+
link: string;
|
|
39
|
+
line: string;
|
|
40
|
+
hover: string;
|
|
41
|
+
selected: string;
|
|
42
|
+
focus: string;
|
|
43
|
+
};
|
|
44
|
+
export type SurfaceSet = Record<SurfaceName, Surface> & {
|
|
45
|
+
scheme: 'light' | 'dark';
|
|
46
|
+
edge: EdgeStyle;
|
|
47
|
+
notes: string[];
|
|
48
|
+
};
|
|
49
|
+
/** The best ratio any ink can reach on every one of `fills` (black or white on the worst of them). */
|
|
50
|
+
export declare const reachable: (fills: string[]) => number;
|
|
51
|
+
/** Every surface of a theme. Notes list each ink the solver had to move. */
|
|
52
|
+
export declare function deriveSurfaces(input: DeriveInput): SurfaceSet;
|
|
53
|
+
/** The v2 palette and component hints as v3 derivation input (until the documents are v3, step 13). */
|
|
54
|
+
export declare function surfacesInputFromV2(colors: {
|
|
55
|
+
bg: string;
|
|
56
|
+
surface: string;
|
|
57
|
+
elevated: string;
|
|
58
|
+
border: string;
|
|
59
|
+
text: string;
|
|
60
|
+
muted: string;
|
|
61
|
+
accent: string;
|
|
62
|
+
page?: string | null;
|
|
63
|
+
inverse?: string | null;
|
|
64
|
+
onInverse?: string | null;
|
|
65
|
+
}, hints?: {
|
|
66
|
+
bevel?: boolean;
|
|
67
|
+
high?: boolean;
|
|
68
|
+
cards?: boolean;
|
|
69
|
+
}): DeriveInput;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Theme engine v3, step 5 (.omc/plans/theme-engine-v3.md 3.2): every surface the site and the shell
|
|
2
|
+
// paint, derived from a theme's tokens, with every ink solved for the fill it sits on (themeInk.ts).
|
|
3
|
+
// Pure. Consumers ask "what is the ink on the chrome", never "which palette role reads here".
|
|
4
|
+
//
|
|
5
|
+
// The input is the v3 palette shape; v2 documents reach it through `surfacesInputFromV2` until step 13
|
|
6
|
+
// makes v3 the stored format.
|
|
7
|
+
import { contrastRatio, relativeLuminance } from "./themeApi.js";
|
|
8
|
+
import { inkOn, inkOnEvery, mixOklab, TARGET } from "./themeInk.js";
|
|
9
|
+
export const SURFACE_NAMES = ['canvas', 'content', 'card', 'chrome', 'raised', 'panel', 'strong', 'accentFill', 'tooltip'];
|
|
10
|
+
const isDarkFill = (hex) => relativeLuminance(hex) < 0.18;
|
|
11
|
+
/** The best ratio any ink can reach on every one of `fills` (black or white on the worst of them). */
|
|
12
|
+
export const reachable = (fills) => Math.max(...['#000000', '#ffffff'].map(pole => Math.min(...fills.map(fill => contrastRatio(pole, fill)))));
|
|
13
|
+
/**
|
|
14
|
+
* One surface. Inks are solved on the fill (both ends of a gradient); the hover and selected states are
|
|
15
|
+
* then pulled back toward the fill until every ink still reads on them, so a hovered or selected row
|
|
16
|
+
* never costs contrast. A target no ink can reach on this fill (7:1 on a mid tone) is capped at the
|
|
17
|
+
* best there is and noted.
|
|
18
|
+
*/
|
|
19
|
+
function surface(name, fill, p, input, notes, opts = {}) {
|
|
20
|
+
const fills = opts.fill2 ? [fill, opts.fill2] : [fill];
|
|
21
|
+
const best = reachable(fills);
|
|
22
|
+
const cap = (target, what) => {
|
|
23
|
+
if (best >= target)
|
|
24
|
+
return target;
|
|
25
|
+
notes.push(`${name}.${what}: ${target}:1 is out of reach on ${fills.join('/')}, ${best.toFixed(2)}:1 at most`);
|
|
26
|
+
return best;
|
|
27
|
+
};
|
|
28
|
+
const textTarget = cap(input.access === 'high' ? TARGET.high : TARGET.text, 'ink');
|
|
29
|
+
const softTarget = cap(TARGET.text, 'inkSoft');
|
|
30
|
+
const solve = (preferred, target, what) => {
|
|
31
|
+
const result = inkOnEvery(fills, preferred, target);
|
|
32
|
+
if (result.adjusted)
|
|
33
|
+
notes.push(`${name}.${what} ${preferred} -> ${result.ink} (${result.ratio.toFixed(2)}:1)`);
|
|
34
|
+
return result.ink;
|
|
35
|
+
};
|
|
36
|
+
const ink = solve(opts.inkPreferred ?? p.text, textTarget, 'ink');
|
|
37
|
+
const inkSoft = solve(p.muted, softTarget, 'inkSoft');
|
|
38
|
+
const link = solve(p.accent, softTarget, 'link');
|
|
39
|
+
const reads = (state) => contrastRatio(ink, state) >= textTarget - 1e-9 && contrastRatio(inkSoft, state) >= softTarget - 1e-9 && contrastRatio(link, state) >= softTarget - 1e-9;
|
|
40
|
+
/** A state `t` of the way from the fill to `toward`, shrunk until the inks read on it. */
|
|
41
|
+
const state = (toward, t, what) => {
|
|
42
|
+
for (let k = t; k > 0.004; k /= 2) {
|
|
43
|
+
const candidate = mixOklab(fill, toward, k);
|
|
44
|
+
if (reads(candidate)) {
|
|
45
|
+
if (k !== t)
|
|
46
|
+
notes.push(`${name}.${what} step ${t} -> ${k.toFixed(3)}`);
|
|
47
|
+
return candidate;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return fill;
|
|
51
|
+
};
|
|
52
|
+
const dark = isDarkFill(fill);
|
|
53
|
+
// States: the theme's own hover/selected when they keep every ink readable, else a neutral step toward the ink (never the accent hue for hover).
|
|
54
|
+
const hover = opts.hover && reads(opts.hover) ? opts.hover : state(ink, dark ? 0.08 : 0.05, 'hover');
|
|
55
|
+
const selected = opts.selected && reads(opts.selected) ? opts.selected : state(p.accent, 0.14, 'selected');
|
|
56
|
+
const strongLine = input.edge?.strong || input.access === 'high';
|
|
57
|
+
const lineTarget = Math.min(best, strongLine || input.edge?.style === 'outline' ? TARGET.nonText : 1.3);
|
|
58
|
+
return {
|
|
59
|
+
fill, ...(opts.fill2 ? { fill2: opts.fill2 } : {}),
|
|
60
|
+
ink, inkSoft, link,
|
|
61
|
+
line: strongLine ? ink : inkOnEvery(fills, p.border, lineTarget).ink,
|
|
62
|
+
hover, selected, focus: inkOnEvery(fills, p.accent, Math.min(best, TARGET.nonText)).ink,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** Every surface of a theme. Notes list each ink the solver had to move. */
|
|
66
|
+
export function deriveSurfaces(input) {
|
|
67
|
+
const p = input.palette;
|
|
68
|
+
const notes = [];
|
|
69
|
+
const scheme = p.scheme ?? (relativeLuminance(p.bg) < relativeLuminance(p.text) ? 'dark' : 'light');
|
|
70
|
+
const edge = input.edge?.style ?? 'hairline';
|
|
71
|
+
const face = p.face ?? (edge === 'bevel' ? mixOklab(p.surface, p.border, 0.2) : p.surface);
|
|
72
|
+
const cards = input.post?.style === 'cards' || input.post?.style === 'bubbles';
|
|
73
|
+
// The strong fill (title bars, inverted buttons): its gradient end moves until one ink reads on both ends.
|
|
74
|
+
const inverse = p.inverse ?? p.text;
|
|
75
|
+
let inverse2 = p.inverse2 ?? inverse;
|
|
76
|
+
const strongPreferred = p.onInverse ?? p.bg;
|
|
77
|
+
if (inverse2 !== inverse) {
|
|
78
|
+
const both = inkOnEvery([inverse, inverse2], strongPreferred, TARGET.text);
|
|
79
|
+
if (both.ratio < TARGET.text) {
|
|
80
|
+
const ink = inkOn(inverse, strongPreferred, TARGET.text).ink;
|
|
81
|
+
const moved = inkOn(ink, inverse2, TARGET.text).ink;
|
|
82
|
+
notes.push(`strong.fill2 ${inverse2} -> ${moved} (one ink on both ends)`);
|
|
83
|
+
inverse2 = moved;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// The accent fill's label: white or the page colour, whichever reads better, then solved.
|
|
87
|
+
const accentLabel = contrastRatio('#ffffff', p.accent) >= contrastRatio(p.bg, p.accent) ? '#ffffff' : p.bg;
|
|
88
|
+
const tooltipFill = mixOklab(p.text, p.bg, 0.12);
|
|
89
|
+
const set = {
|
|
90
|
+
canvas: surface('canvas', p.page ?? p.bg, p, input, notes),
|
|
91
|
+
content: surface('content', p.bg, p, input, notes, { hover: p.hover, selected: p.selected }),
|
|
92
|
+
card: surface('card', cards ? p.surface : p.bg, p, input, notes, { hover: p.hover, selected: p.selected }),
|
|
93
|
+
chrome: surface('chrome', face, p, input, notes, { hover: p.hover, selected: p.selected }),
|
|
94
|
+
raised: surface('raised', p.elevated, p, input, notes),
|
|
95
|
+
panel: surface('panel', p.bg, p, input, notes, { hover: p.hover, selected: p.selected }),
|
|
96
|
+
strong: surface('strong', inverse, p, input, notes, { ...(inverse2 !== inverse ? { fill2: inverse2 } : {}), inkPreferred: strongPreferred }),
|
|
97
|
+
accentFill: surface('accentFill', p.accent, p, input, notes, { inkPreferred: accentLabel }),
|
|
98
|
+
tooltip: surface('tooltip', tooltipFill, p, input, notes, { inkPreferred: p.bg }),
|
|
99
|
+
};
|
|
100
|
+
return { ...set, scheme, edge, notes };
|
|
101
|
+
}
|
|
102
|
+
/** The v2 palette and component hints as v3 derivation input (until the documents are v3, step 13). */
|
|
103
|
+
export function surfacesInputFromV2(colors, hints = {}) {
|
|
104
|
+
return {
|
|
105
|
+
palette: {
|
|
106
|
+
page: colors.page ?? null, bg: colors.bg, surface: colors.surface, elevated: colors.elevated, border: colors.border,
|
|
107
|
+
text: colors.text, muted: colors.muted, accent: colors.accent, inverse: colors.inverse ?? null, onInverse: colors.onInverse ?? null,
|
|
108
|
+
// A bevelled v2 theme draws its chrome from `page` (Windows 98: the silver face) and its title bar from inverse to accent.
|
|
109
|
+
face: hints.bevel ? colors.page ?? colors.elevated : null,
|
|
110
|
+
inverse2: hints.bevel ? colors.accent : null,
|
|
111
|
+
},
|
|
112
|
+
edge: { style: hints.bevel ? 'bevel' : 'hairline' },
|
|
113
|
+
access: hints.high ? 'high' : 'standard',
|
|
114
|
+
post: { style: hints.cards ? 'cards' : 'flat' },
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=themeDerive.js.map
|