@dversum/mcp-server 2.11.2 → 2.13.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 +5 -0
- package/dist/src/client.d.ts +10 -0
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +21 -4
- package/dist/src/client.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/tools/creatives.d.ts +4 -0
- package/dist/src/tools/creatives.d.ts.map +1 -0
- package/dist/src/tools/creatives.js +78 -0
- package/dist/src/tools/creatives.js.map +1 -0
- package/dist/src/tools/invoices.d.ts.map +1 -1
- package/dist/src/tools/invoices.js +6 -5
- package/dist/src/tools/invoices.js.map +1 -1
- package/dist/src/tools/quotes.d.ts.map +1 -1
- package/dist/src/tools/quotes.js +6 -5
- package/dist/src/tools/quotes.js.map +1 -1
- package/dist/src/tools/request-bodies.spec.js +16 -0
- package/dist/src/tools/request-bodies.spec.js.map +1 -1
- package/dist/src/tools/subtasks.d.ts +14 -0
- package/dist/src/tools/subtasks.d.ts.map +1 -0
- package/dist/src/tools/subtasks.js +51 -0
- package/dist/src/tools/subtasks.js.map +1 -0
- package/dist/src/tools/subtasks.spec.d.ts +2 -0
- package/dist/src/tools/subtasks.spec.d.ts.map +1 -0
- package/dist/src/tools/subtasks.spec.js +90 -0
- package/dist/src/tools/subtasks.spec.js.map +1 -0
- package/dist/src/tools/text-slots.d.ts +17 -0
- package/dist/src/tools/text-slots.d.ts.map +1 -0
- package/dist/src/tools/text-slots.js +44 -0
- package/dist/src/tools/text-slots.js.map +1 -0
- package/dist/src/tools/text-slots.spec.d.ts +2 -0
- package/dist/src/tools/text-slots.spec.d.ts.map +1 -0
- package/dist/src/tools/text-slots.spec.js +31 -0
- package/dist/src/tools/text-slots.spec.js.map +1 -0
- package/dist/src/tools/universum.d.ts +42 -0
- package/dist/src/tools/universum.d.ts.map +1 -1
- package/dist/src/tools/universum.js +76 -2
- package/dist/src/tools/universum.js.map +1 -1
- package/dist/src/tools/whiteboard-brand.d.ts +4 -0
- package/dist/src/tools/whiteboard-brand.d.ts.map +1 -0
- package/dist/src/tools/whiteboard-brand.js +158 -0
- package/dist/src/tools/whiteboard-brand.js.map +1 -0
- package/dist/src/tools/whiteboard-compose.d.ts +39 -0
- package/dist/src/tools/whiteboard-compose.d.ts.map +1 -1
- package/dist/src/tools/whiteboard-compose.js +41 -17
- package/dist/src/tools/whiteboard-compose.js.map +1 -1
- package/dist/src/tools/whiteboards.d.ts.map +1 -1
- package/dist/src/tools/whiteboards.js +27 -7
- package/dist/src/tools/whiteboards.js.map +1 -1
- package/dist/src/whiteboard/brand.d.ts +58 -0
- package/dist/src/whiteboard/brand.d.ts.map +1 -0
- package/dist/src/whiteboard/brand.js +111 -0
- package/dist/src/whiteboard/brand.js.map +1 -0
- package/dist/src/whiteboard/elements.d.ts +1 -1
- package/dist/src/whiteboard/elements.d.ts.map +1 -1
- package/dist/src/whiteboard/elements.js.map +1 -1
- package/dist/src/whiteboard/measure.d.ts.map +1 -1
- package/dist/src/whiteboard/measure.js +4 -7
- package/dist/src/whiteboard/measure.js.map +1 -1
- package/dist/src/whiteboard/sections.d.ts +83 -1
- package/dist/src/whiteboard/sections.d.ts.map +1 -1
- package/dist/src/whiteboard/sections.js +392 -59
- package/dist/src/whiteboard/sections.js.map +1 -1
- package/dist/src/whiteboard/sections.spec.js +112 -3
- package/dist/src/whiteboard/sections.spec.js.map +1 -1
- package/dist/src/whiteboard/theme.d.ts +159 -0
- package/dist/src/whiteboard/theme.d.ts.map +1 -0
- package/dist/src/whiteboard/theme.js +441 -0
- package/dist/src/whiteboard/theme.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Board themes: one brand per board.
|
|
3
|
+
*
|
|
4
|
+
* Every board used to look like dVersum, because every colour an element
|
|
5
|
+
* stored was a literal hex value from one fixed palette. A theme moves the
|
|
6
|
+
* brand out of the elements and onto the board. An element that wants the
|
|
7
|
+
* brand says so with a token ("$accent", "$display", "$logo") and the
|
|
8
|
+
* renderer resolves it against the board's theme, so switching the theme
|
|
9
|
+
* re-brands everything that asked for it. Literal values still work and
|
|
10
|
+
* stay exactly as they are: a theme never overrides a colour someone picked
|
|
11
|
+
* by hand.
|
|
12
|
+
*
|
|
13
|
+
* With no theme stored, DEFAULT_THEME applies. Its values are the dVersum
|
|
14
|
+
* palette the boards were built with, so a token on an unthemed board
|
|
15
|
+
* renders exactly as the literal value it replaced.
|
|
16
|
+
*
|
|
17
|
+
* This file is pure (no imports) because the MCP server carries a verbatim
|
|
18
|
+
* copy at mcp-server/src/whiteboard/theme.ts. whiteboardTokensSync.spec.ts
|
|
19
|
+
* fails when the two differ. Never edit only one of them.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Roles, not a palette. The first block is what a brand defines; the rest
|
|
23
|
+
* are derived from it when a brand does not say, so a theme built from two
|
|
24
|
+
* colours on a website is still complete.
|
|
25
|
+
*/
|
|
26
|
+
export type ThemeColorRole = 'primary' | 'secondary' | 'accent' | 'accentStrong' | 'ink' | 'inkMuted' | 'surface' | 'surfaceMuted' | 'border' | 'paper';
|
|
27
|
+
/** Text colours computed for legibility, never stored. */
|
|
28
|
+
export type ThemeDerivedRole = 'onPrimary' | 'onSecondary' | 'onAccent' | 'onInk';
|
|
29
|
+
export type ThemeFontRole = 'display' | 'body';
|
|
30
|
+
export type ThemeRadius = 'sharp' | 'soft' | 'round';
|
|
31
|
+
export declare const THEME_COLOR_ROLES: ThemeColorRole[];
|
|
32
|
+
/** The roles a person sets. The rest follow from these. */
|
|
33
|
+
export declare const THEME_BASE_ROLES: ThemeColorRole[];
|
|
34
|
+
export declare const THEME_DERIVED_ROLES: ThemeDerivedRole[];
|
|
35
|
+
export interface BoardTheme {
|
|
36
|
+
/** Shown in the brand panel, e.g. the client's name. */
|
|
37
|
+
name?: string;
|
|
38
|
+
colors: Record<ThemeColorRole, string>;
|
|
39
|
+
fonts: Record<ThemeFontRole, string>;
|
|
40
|
+
/** data: URI or https URL. Image elements with src "$logo" show it. */
|
|
41
|
+
logo?: {
|
|
42
|
+
src: string;
|
|
43
|
+
alt?: string;
|
|
44
|
+
};
|
|
45
|
+
radius: ThemeRadius;
|
|
46
|
+
/** Where the theme came from, so it can be refreshed or saved back. */
|
|
47
|
+
source?: {
|
|
48
|
+
url?: string;
|
|
49
|
+
clientId?: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** What a writer may send: any subset, completed by createTheme. */
|
|
53
|
+
export interface BoardThemeInput {
|
|
54
|
+
name?: string;
|
|
55
|
+
colors?: Partial<Record<ThemeColorRole, string>>;
|
|
56
|
+
fonts?: Partial<Record<ThemeFontRole, string>>;
|
|
57
|
+
logo?: {
|
|
58
|
+
src: string;
|
|
59
|
+
alt?: string;
|
|
60
|
+
} | null;
|
|
61
|
+
radius?: ThemeRadius;
|
|
62
|
+
source?: {
|
|
63
|
+
url?: string;
|
|
64
|
+
clientId?: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/** The dVersum palette the boards were built with. */
|
|
68
|
+
export declare const DEFAULT_THEME: BoardTheme;
|
|
69
|
+
export type FontCategory = 'sans' | 'serif' | 'mono' | 'hand';
|
|
70
|
+
export interface ThemeFont {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
/** CSS font-family value, with a fallback of the same category. */
|
|
74
|
+
family: string;
|
|
75
|
+
category: FontCategory;
|
|
76
|
+
/**
|
|
77
|
+
* Average character width as a fraction of the font size, at weight 400.
|
|
78
|
+
* The MCP server lays out text without a DOM and wraps by this number.
|
|
79
|
+
*/
|
|
80
|
+
width: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The four generic families every board had, then a curated set of web
|
|
84
|
+
* fonts. The web fonts are self-hosted (frontend/utils/whiteboardFontLoader.ts):
|
|
85
|
+
* loading them from Google's servers sends every viewer's IP address to
|
|
86
|
+
* Google, which German courts have ruled a GDPR violation.
|
|
87
|
+
*/
|
|
88
|
+
export declare const THEME_FONTS: ThemeFont[];
|
|
89
|
+
export declare function themeFont(id: string | undefined): ThemeFont | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* The nearest font we have for a family name found on a website.
|
|
92
|
+
* "Inter", "'Inter Variable'", "inter, sans-serif" all find Inter; a
|
|
93
|
+
* family we do not carry falls back to its generic category.
|
|
94
|
+
*/
|
|
95
|
+
export declare function matchFont(family: string): string | undefined;
|
|
96
|
+
/** "#abc", "#AABBCC" → "#aabbcc"; anything else → undefined. */
|
|
97
|
+
export declare function normalizeHex(value: unknown): string | undefined;
|
|
98
|
+
/** a at weight 1-t, b at weight t. */
|
|
99
|
+
export declare function mix(a: string, b: string, t: number): string;
|
|
100
|
+
/** WCAG relative luminance, 0 (black) to 1 (white). */
|
|
101
|
+
export declare function luminance(hex: string): number;
|
|
102
|
+
export declare function contrastRatio(a: string, b: string): number;
|
|
103
|
+
/** The theme's ink or white, whichever reads better on bg. */
|
|
104
|
+
export declare function readableOn(bg: string, theme: BoardTheme): string;
|
|
105
|
+
/**
|
|
106
|
+
* A complete theme from any subset. Invalid values are dropped, not
|
|
107
|
+
* rejected, so a half-right brand from a website still yields a board.
|
|
108
|
+
*
|
|
109
|
+
* With no colours at all the dVersum defaults apply unchanged. With some,
|
|
110
|
+
* the missing ones are derived from the given ones, so a brand of one
|
|
111
|
+
* blue gets a muted blue-grey for secondary text rather than a dVersum
|
|
112
|
+
* green that has nothing to do with it.
|
|
113
|
+
*/
|
|
114
|
+
export declare function createTheme(input?: BoardThemeInput | null): BoardTheme;
|
|
115
|
+
/**
|
|
116
|
+
* What to store for an input: cleaned like createTheme, but only the
|
|
117
|
+
* colour roles the input actually names. Derived roles that were never
|
|
118
|
+
* set stay derived, so changing the ink later also moves the muted text
|
|
119
|
+
* and the borders, instead of leaving them at a value computed from the
|
|
120
|
+
* old ink.
|
|
121
|
+
*/
|
|
122
|
+
export declare function storableTheme(input: BoardThemeInput): BoardThemeInput;
|
|
123
|
+
/** The roles a person edits, from any theme: base roles only. */
|
|
124
|
+
export declare function baseColors(theme: BoardTheme): Partial<Record<ThemeColorRole, string>>;
|
|
125
|
+
/** Stored content → theme. Absent or broken means the default. */
|
|
126
|
+
export declare function themeFromContent(content: unknown): BoardTheme;
|
|
127
|
+
export declare const THEME_RADIUS: Record<ThemeRadius, {
|
|
128
|
+
sm: number;
|
|
129
|
+
md: number;
|
|
130
|
+
lg: number;
|
|
131
|
+
}>;
|
|
132
|
+
/** A colour token's value, or undefined when value is not one. */
|
|
133
|
+
export declare function resolveColor(value: string, theme: BoardTheme): string | undefined;
|
|
134
|
+
/** Any token's value: colours, "$display"/"$body" (a font id), "$logo". */
|
|
135
|
+
export declare function resolveToken(value: string, theme: BoardTheme): string | undefined;
|
|
136
|
+
/** Every token a writer may use, for tool descriptions and validation. */
|
|
137
|
+
export declare const THEME_TOKENS: string[];
|
|
138
|
+
/**
|
|
139
|
+
* The element as it should be drawn. Returns the same object when it holds
|
|
140
|
+
* no token, so a board without tokens costs nothing and keeps identities.
|
|
141
|
+
* Never write the result back: that would freeze the brand into the
|
|
142
|
+
* element and the next theme change would no longer reach it.
|
|
143
|
+
*/
|
|
144
|
+
export declare function resolveElement<T>(element: T, theme: BoardTheme): T;
|
|
145
|
+
/** The brand colours a person picks from, as tokens with their values. */
|
|
146
|
+
export declare function themeSwatches(theme: BoardTheme): {
|
|
147
|
+
token: string;
|
|
148
|
+
role: ThemeColorRole;
|
|
149
|
+
color: string;
|
|
150
|
+
}[];
|
|
151
|
+
/**
|
|
152
|
+
* The element with its default colours turned into brand tokens, or null
|
|
153
|
+
* when nothing changed. Text on a shape that became "$primary" becomes
|
|
154
|
+
* "$onPrimary", so it stays legible whatever the brand's primary is.
|
|
155
|
+
*/
|
|
156
|
+
export declare function adoptBrand<T extends Record<string, unknown>>(el: T): Partial<T> | null;
|
|
157
|
+
/** Series colours for charts: the brand first, then distinct fallbacks. */
|
|
158
|
+
export declare function seriesPalette(theme: BoardTheme): string[];
|
|
159
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/whiteboard/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,WAAW,GACX,QAAQ,GACR,cAAc,GACd,KAAK,GACL,UAAU,GACV,SAAS,GACT,cAAc,GACd,QAAQ,GACR,OAAO,CAAA;AAEX,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,GAAG,OAAO,CAAA;AAEjF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,CAAA;AAE9C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;AAEpD,eAAO,MAAM,iBAAiB,EAAE,cAAc,EAG7C,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAAkE,CAAA;AAE/G,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,EAAsD,CAAA;AAExG,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;IACtC,KAAK,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;IACpC,uEAAuE;IACvE,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACpC,MAAM,EAAE,WAAW,CAAA;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC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;AA4CD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,GAAG,CAAC,CAElE;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAGzG;AA2BD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAiBtF;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,CASzD"}
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Board themes: one brand per board.
|
|
3
|
+
*
|
|
4
|
+
* Every board used to look like dVersum, because every colour an element
|
|
5
|
+
* stored was a literal hex value from one fixed palette. A theme moves the
|
|
6
|
+
* brand out of the elements and onto the board. An element that wants the
|
|
7
|
+
* brand says so with a token ("$accent", "$display", "$logo") and the
|
|
8
|
+
* renderer resolves it against the board's theme, so switching the theme
|
|
9
|
+
* re-brands everything that asked for it. Literal values still work and
|
|
10
|
+
* stay exactly as they are: a theme never overrides a colour someone picked
|
|
11
|
+
* by hand.
|
|
12
|
+
*
|
|
13
|
+
* With no theme stored, DEFAULT_THEME applies. Its values are the dVersum
|
|
14
|
+
* palette the boards were built with, so a token on an unthemed board
|
|
15
|
+
* renders exactly as the literal value it replaced.
|
|
16
|
+
*
|
|
17
|
+
* This file is pure (no imports) because the MCP server carries a verbatim
|
|
18
|
+
* copy at mcp-server/src/whiteboard/theme.ts. whiteboardTokensSync.spec.ts
|
|
19
|
+
* fails when the two differ. Never edit only one of them.
|
|
20
|
+
*/
|
|
21
|
+
export const THEME_COLOR_ROLES = [
|
|
22
|
+
'primary', 'secondary', 'accent', 'accentStrong', 'ink', 'inkMuted',
|
|
23
|
+
'surface', 'surfaceMuted', 'border', 'paper',
|
|
24
|
+
];
|
|
25
|
+
/** The roles a person sets. The rest follow from these. */
|
|
26
|
+
export const THEME_BASE_ROLES = ['primary', 'secondary', 'accent', 'ink', 'surface', 'paper'];
|
|
27
|
+
export const THEME_DERIVED_ROLES = ['onPrimary', 'onSecondary', 'onAccent', 'onInk'];
|
|
28
|
+
/** The dVersum palette the boards were built with. */
|
|
29
|
+
export const DEFAULT_THEME = {
|
|
30
|
+
colors: {
|
|
31
|
+
primary: '#0c1f16',
|
|
32
|
+
secondary: '#6366f1',
|
|
33
|
+
accent: '#45e59f',
|
|
34
|
+
accentStrong: '#2bc97e',
|
|
35
|
+
ink: '#0c1f16',
|
|
36
|
+
inkMuted: '#5b7266',
|
|
37
|
+
surface: '#ffffff',
|
|
38
|
+
surfaceMuted: '#f6f8f6',
|
|
39
|
+
border: '#d9e2dc',
|
|
40
|
+
paper: '#ffffff',
|
|
41
|
+
},
|
|
42
|
+
fonts: { display: 'sans', body: 'sans' },
|
|
43
|
+
radius: 'soft',
|
|
44
|
+
};
|
|
45
|
+
/** A brand that names no text colour gets a neutral one, not dVersum green. */
|
|
46
|
+
const NEUTRAL_INK = '#16181d';
|
|
47
|
+
const SANS = 'ui-sans-serif, system-ui, sans-serif';
|
|
48
|
+
const SERIF = 'ui-serif, Georgia, serif';
|
|
49
|
+
const MONO = 'ui-monospace, SFMono-Regular, monospace';
|
|
50
|
+
/**
|
|
51
|
+
* The four generic families every board had, then a curated set of web
|
|
52
|
+
* fonts. The web fonts are self-hosted (frontend/utils/whiteboardFontLoader.ts):
|
|
53
|
+
* loading them from Google's servers sends every viewer's IP address to
|
|
54
|
+
* Google, which German courts have ruled a GDPR violation.
|
|
55
|
+
*/
|
|
56
|
+
export const THEME_FONTS = [
|
|
57
|
+
{ id: 'sans', label: 'System Sans', family: SANS, category: 'sans', width: 0.52 },
|
|
58
|
+
{ id: 'serif', label: 'System Serif', family: SERIF, category: 'serif', width: 0.5 },
|
|
59
|
+
{ id: 'mono', label: 'System Mono', family: MONO, category: 'mono', width: 0.6 },
|
|
60
|
+
{ id: 'hand', label: 'Caveat', family: "'Caveat', 'Segoe Print', cursive", category: 'hand', width: 0.44 },
|
|
61
|
+
{ id: 'inter', label: 'Inter', family: `'Inter Variable', ${SANS}`, category: 'sans', width: 0.54 },
|
|
62
|
+
{ id: 'manrope', label: 'Manrope', family: `'Manrope Variable', ${SANS}`, category: 'sans', width: 0.54 },
|
|
63
|
+
{ id: 'dm-sans', label: 'DM Sans', family: `'DM Sans Variable', ${SANS}`, category: 'sans', width: 0.52 },
|
|
64
|
+
{ id: 'plus-jakarta-sans', label: 'Plus Jakarta Sans', family: `'Plus Jakarta Sans Variable', ${SANS}`, category: 'sans', width: 0.55 },
|
|
65
|
+
{ id: 'figtree', label: 'Figtree', family: `'Figtree Variable', ${SANS}`, category: 'sans', width: 0.52 },
|
|
66
|
+
{ id: 'montserrat', label: 'Montserrat', family: `'Montserrat Variable', ${SANS}`, category: 'sans', width: 0.6 },
|
|
67
|
+
{ id: 'poppins', label: 'Poppins', family: `'Poppins', ${SANS}`, category: 'sans', width: 0.59 },
|
|
68
|
+
{ id: 'work-sans', label: 'Work Sans', family: `'Work Sans Variable', ${SANS}`, category: 'sans', width: 0.56 },
|
|
69
|
+
{ id: 'space-grotesk', label: 'Space Grotesk', family: `'Space Grotesk Variable', ${SANS}`, category: 'sans', width: 0.55 },
|
|
70
|
+
{ id: 'outfit', label: 'Outfit', family: `'Outfit Variable', ${SANS}`, category: 'sans', width: 0.52 },
|
|
71
|
+
{ id: 'sora', label: 'Sora', family: `'Sora Variable', ${SANS}`, category: 'sans', width: 0.6 },
|
|
72
|
+
{ id: 'raleway', label: 'Raleway', family: `'Raleway Variable', ${SANS}`, category: 'sans', width: 0.55 },
|
|
73
|
+
{ id: 'open-sans', label: 'Open Sans', family: `'Open Sans Variable', ${SANS}`, category: 'sans', width: 0.55 },
|
|
74
|
+
{ id: 'roboto', label: 'Roboto', family: `'Roboto Variable', ${SANS}`, category: 'sans', width: 0.52 },
|
|
75
|
+
{ id: 'lato', label: 'Lato', family: `'Lato', ${SANS}`, category: 'sans', width: 0.5 },
|
|
76
|
+
{ id: 'source-sans-3', label: 'Source Sans 3', family: `'Source Sans 3 Variable', ${SANS}`, category: 'sans', width: 0.48 },
|
|
77
|
+
{ id: 'nunito', label: 'Nunito', family: `'Nunito Variable', ${SANS}`, category: 'sans', width: 0.53 },
|
|
78
|
+
{ id: 'rubik', label: 'Rubik', family: `'Rubik Variable', ${SANS}`, category: 'sans', width: 0.55 },
|
|
79
|
+
{ id: 'archivo', label: 'Archivo', family: `'Archivo Variable', ${SANS}`, category: 'sans', width: 0.54 },
|
|
80
|
+
{ id: 'barlow', label: 'Barlow', family: `'Barlow', ${SANS}`, category: 'sans', width: 0.49 },
|
|
81
|
+
{ id: 'ibm-plex-sans', label: 'IBM Plex Sans', family: `'IBM Plex Sans Variable', ${SANS}`, category: 'sans', width: 0.53 },
|
|
82
|
+
{ id: 'playfair-display', label: 'Playfair Display', family: `'Playfair Display Variable', ${SERIF}`, category: 'serif', width: 0.52 },
|
|
83
|
+
{ id: 'fraunces', label: 'Fraunces', family: `'Fraunces Variable', ${SERIF}`, category: 'serif', width: 0.54 },
|
|
84
|
+
{ id: 'dm-serif-display', label: 'DM Serif Display', family: `'DM Serif Display', ${SERIF}`, category: 'serif', width: 0.5 },
|
|
85
|
+
{ id: 'instrument-serif', label: 'Instrument Serif', family: `'Instrument Serif', ${SERIF}`, category: 'serif', width: 0.42 },
|
|
86
|
+
{ id: 'lora', label: 'Lora', family: `'Lora Variable', ${SERIF}`, category: 'serif', width: 0.52 },
|
|
87
|
+
{ id: 'eb-garamond', label: 'EB Garamond', family: `'EB Garamond Variable', ${SERIF}`, category: 'serif', width: 0.46 },
|
|
88
|
+
{ id: 'source-serif-4', label: 'Source Serif 4', family: `'Source Serif 4 Variable', ${SERIF}`, category: 'serif', width: 0.5 },
|
|
89
|
+
{ id: 'newsreader', label: 'Newsreader', family: `'Newsreader Variable', ${SERIF}`, category: 'serif', width: 0.48 },
|
|
90
|
+
{ id: 'libre-baskerville', label: 'Libre Baskerville', family: `'Libre Baskerville', ${SERIF}`, category: 'serif', width: 0.58 },
|
|
91
|
+
{ id: 'jetbrains-mono', label: 'JetBrains Mono', family: `'JetBrains Mono Variable', ${MONO}`, category: 'mono', width: 0.6 },
|
|
92
|
+
{ id: 'ibm-plex-mono', label: 'IBM Plex Mono', family: `'IBM Plex Mono', ${MONO}`, category: 'mono', width: 0.6 },
|
|
93
|
+
{ id: 'space-mono', label: 'Space Mono', family: `'Space Mono', ${MONO}`, category: 'mono', width: 0.61 },
|
|
94
|
+
];
|
|
95
|
+
const FONT_BY_ID = Object.fromEntries(THEME_FONTS.map((f) => [f.id, f]));
|
|
96
|
+
export function themeFont(id) {
|
|
97
|
+
return id ? FONT_BY_ID[id] : undefined;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The nearest font we have for a family name found on a website.
|
|
101
|
+
* "Inter", "'Inter Variable'", "inter, sans-serif" all find Inter; a
|
|
102
|
+
* family we do not carry falls back to its generic category.
|
|
103
|
+
*/
|
|
104
|
+
export function matchFont(family) {
|
|
105
|
+
const names = family.split(',').map((n) => n.trim().replace(/^['"]|['"]$/g, '').toLowerCase());
|
|
106
|
+
// Compared without spaces and dashes: sites write "OpenSans", "open_sans".
|
|
107
|
+
const compact = (v) => v.replace(/[\s_-]+/g, '');
|
|
108
|
+
for (const name of names) {
|
|
109
|
+
const key = compact(name.replace(/\s+variable$/, ''));
|
|
110
|
+
const hit = THEME_FONTS.find((f) => !['sans', 'serif', 'mono', 'hand'].includes(f.id) && compact(f.id) === key);
|
|
111
|
+
if (hit)
|
|
112
|
+
return hit.id;
|
|
113
|
+
}
|
|
114
|
+
for (const name of names) {
|
|
115
|
+
if (name === 'serif' || (/serif|garamond|times|georgia|baskerville/.test(name) && !/sans/.test(name)))
|
|
116
|
+
return 'serif';
|
|
117
|
+
if (name === 'monospace' || /mono|courier|consolas/.test(name))
|
|
118
|
+
return 'mono';
|
|
119
|
+
if (name === 'sans-serif' || /sans|helvetica|arial|grotesk|system-ui/.test(name))
|
|
120
|
+
return 'sans';
|
|
121
|
+
}
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
// ---- Colour maths -------------------------------------------------------
|
|
125
|
+
/** "#abc", "#AABBCC" → "#aabbcc"; anything else → undefined. */
|
|
126
|
+
export function normalizeHex(value) {
|
|
127
|
+
if (typeof value !== 'string')
|
|
128
|
+
return undefined;
|
|
129
|
+
const v = value.trim().toLowerCase();
|
|
130
|
+
if (/^#[0-9a-f]{6}$/.test(v))
|
|
131
|
+
return v;
|
|
132
|
+
if (/^#[0-9a-f]{3}$/.test(v))
|
|
133
|
+
return '#' + v[1] + v[1] + v[2] + v[2] + v[3] + v[3];
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
function rgb(hex) {
|
|
137
|
+
return [parseInt(hex.slice(1, 3), 16), parseInt(hex.slice(3, 5), 16), parseInt(hex.slice(5, 7), 16)];
|
|
138
|
+
}
|
|
139
|
+
function toHex(r, g, b) {
|
|
140
|
+
const c = (n) => Math.max(0, Math.min(255, Math.round(n))).toString(16).padStart(2, '0');
|
|
141
|
+
return '#' + c(r) + c(g) + c(b);
|
|
142
|
+
}
|
|
143
|
+
/** a at weight 1-t, b at weight t. */
|
|
144
|
+
export function mix(a, b, t) {
|
|
145
|
+
const [r1, g1, b1] = rgb(a);
|
|
146
|
+
const [r2, g2, b2] = rgb(b);
|
|
147
|
+
return toHex(r1 + (r2 - r1) * t, g1 + (g2 - g1) * t, b1 + (b2 - b1) * t);
|
|
148
|
+
}
|
|
149
|
+
/** WCAG relative luminance, 0 (black) to 1 (white). */
|
|
150
|
+
export function luminance(hex) {
|
|
151
|
+
const lin = (c) => {
|
|
152
|
+
const s = c / 255;
|
|
153
|
+
return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
|
|
154
|
+
};
|
|
155
|
+
const [r, g, b] = rgb(hex);
|
|
156
|
+
return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
|
|
157
|
+
}
|
|
158
|
+
export function contrastRatio(a, b) {
|
|
159
|
+
const la = luminance(a);
|
|
160
|
+
const lb = luminance(b);
|
|
161
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
162
|
+
}
|
|
163
|
+
/** The theme's ink or white, whichever reads better on bg. */
|
|
164
|
+
export function readableOn(bg, theme) {
|
|
165
|
+
const light = '#ffffff';
|
|
166
|
+
return contrastRatio(bg, theme.colors.ink) >= contrastRatio(bg, light) ? theme.colors.ink : light;
|
|
167
|
+
}
|
|
168
|
+
// ---- Building a theme ---------------------------------------------------
|
|
169
|
+
function cleanLogo(logo) {
|
|
170
|
+
if (!logo || typeof logo.src !== 'string')
|
|
171
|
+
return undefined;
|
|
172
|
+
const src = logo.src.trim();
|
|
173
|
+
const ok = /^data:image\/(png|jpe?g|webp|gif|svg\+xml);base64,[a-z0-9+/=]+$/i.test(src)
|
|
174
|
+
|| /^https:\/\/[^\s"'<>]+$/i.test(src);
|
|
175
|
+
if (!ok || src.length > 600_000)
|
|
176
|
+
return undefined;
|
|
177
|
+
const alt = typeof logo.alt === 'string' ? logo.alt.slice(0, 200) : undefined;
|
|
178
|
+
return alt ? { src, alt } : { src };
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* A complete theme from any subset. Invalid values are dropped, not
|
|
182
|
+
* rejected, so a half-right brand from a website still yields a board.
|
|
183
|
+
*
|
|
184
|
+
* With no colours at all the dVersum defaults apply unchanged. With some,
|
|
185
|
+
* the missing ones are derived from the given ones, so a brand of one
|
|
186
|
+
* blue gets a muted blue-grey for secondary text rather than a dVersum
|
|
187
|
+
* green that has nothing to do with it.
|
|
188
|
+
*/
|
|
189
|
+
export function createTheme(input) {
|
|
190
|
+
const given = {};
|
|
191
|
+
for (const role of THEME_COLOR_ROLES) {
|
|
192
|
+
const hex = normalizeHex(input?.colors?.[role]);
|
|
193
|
+
if (hex)
|
|
194
|
+
given[role] = hex;
|
|
195
|
+
}
|
|
196
|
+
const branded = Object.keys(given).length > 0;
|
|
197
|
+
const d = DEFAULT_THEME.colors;
|
|
198
|
+
const paper = given.paper ?? d.paper;
|
|
199
|
+
const surface = given.surface ?? (branded ? (given.paper ?? '#ffffff') : d.surface);
|
|
200
|
+
const ink = given.ink ?? (branded ? NEUTRAL_INK : d.ink);
|
|
201
|
+
const primary = given.primary ?? (branded ? (given.accent ?? ink) : d.primary);
|
|
202
|
+
const accent = given.accent ?? (branded ? primary : d.accent);
|
|
203
|
+
const secondary = given.secondary ?? (branded ? mix(primary, paper, 0.45) : d.secondary);
|
|
204
|
+
const colors = {
|
|
205
|
+
primary,
|
|
206
|
+
secondary,
|
|
207
|
+
accent,
|
|
208
|
+
accentStrong: given.accentStrong ?? (branded ? mix(accent, '#000000', 0.15) : d.accentStrong),
|
|
209
|
+
ink,
|
|
210
|
+
inkMuted: given.inkMuted ?? (branded ? mix(ink, paper, 0.45) : d.inkMuted),
|
|
211
|
+
surface,
|
|
212
|
+
surfaceMuted: given.surfaceMuted ?? (branded ? mix(surface, ink, 0.04) : d.surfaceMuted),
|
|
213
|
+
border: given.border ?? (branded ? mix(surface, ink, 0.14) : d.border),
|
|
214
|
+
paper,
|
|
215
|
+
};
|
|
216
|
+
const font = (role) => {
|
|
217
|
+
const id = input?.fonts?.[role];
|
|
218
|
+
return id && FONT_BY_ID[id] ? id : undefined;
|
|
219
|
+
};
|
|
220
|
+
const display = font('display') ?? font('body') ?? DEFAULT_THEME.fonts.display;
|
|
221
|
+
const body = font('body') ?? DEFAULT_THEME.fonts.body;
|
|
222
|
+
const theme = {
|
|
223
|
+
colors,
|
|
224
|
+
fonts: { display, body },
|
|
225
|
+
radius: input?.radius && ['sharp', 'soft', 'round'].includes(input.radius) ? input.radius : DEFAULT_THEME.radius,
|
|
226
|
+
};
|
|
227
|
+
if (typeof input?.name === 'string' && input.name.trim())
|
|
228
|
+
theme.name = input.name.trim().slice(0, 120);
|
|
229
|
+
const logo = cleanLogo(input?.logo);
|
|
230
|
+
if (logo)
|
|
231
|
+
theme.logo = logo;
|
|
232
|
+
const source = {};
|
|
233
|
+
if (typeof input?.source?.url === 'string' && /^https?:\/\//i.test(input.source.url))
|
|
234
|
+
source.url = input.source.url.slice(0, 500);
|
|
235
|
+
if (typeof input?.source?.clientId === 'string' && input.source.clientId)
|
|
236
|
+
source.clientId = input.source.clientId.slice(0, 64);
|
|
237
|
+
if (source.url || source.clientId)
|
|
238
|
+
theme.source = source;
|
|
239
|
+
return theme;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* What to store for an input: cleaned like createTheme, but only the
|
|
243
|
+
* colour roles the input actually names. Derived roles that were never
|
|
244
|
+
* set stay derived, so changing the ink later also moves the muted text
|
|
245
|
+
* and the borders, instead of leaving them at a value computed from the
|
|
246
|
+
* old ink.
|
|
247
|
+
*/
|
|
248
|
+
export function storableTheme(input) {
|
|
249
|
+
const full = createTheme(input);
|
|
250
|
+
const colors = {};
|
|
251
|
+
for (const role of THEME_COLOR_ROLES) {
|
|
252
|
+
if (normalizeHex(input.colors?.[role]))
|
|
253
|
+
colors[role] = full.colors[role];
|
|
254
|
+
}
|
|
255
|
+
const out = { colors, fonts: { ...full.fonts }, radius: full.radius };
|
|
256
|
+
if (full.name)
|
|
257
|
+
out.name = full.name;
|
|
258
|
+
if (full.logo)
|
|
259
|
+
out.logo = full.logo;
|
|
260
|
+
if (full.source)
|
|
261
|
+
out.source = full.source;
|
|
262
|
+
return out;
|
|
263
|
+
}
|
|
264
|
+
/** The roles a person edits, from any theme: base roles only. */
|
|
265
|
+
export function baseColors(theme) {
|
|
266
|
+
return Object.fromEntries(THEME_BASE_ROLES.map((r) => [r, theme.colors[r]]));
|
|
267
|
+
}
|
|
268
|
+
/** Stored content → theme. Absent or broken means the default. */
|
|
269
|
+
export function themeFromContent(content) {
|
|
270
|
+
if (!content || typeof content !== 'object')
|
|
271
|
+
return DEFAULT_THEME;
|
|
272
|
+
const raw = content.theme;
|
|
273
|
+
if (!raw || typeof raw !== 'object')
|
|
274
|
+
return DEFAULT_THEME;
|
|
275
|
+
return createTheme(raw);
|
|
276
|
+
}
|
|
277
|
+
// ---- Radius -------------------------------------------------------------
|
|
278
|
+
export const THEME_RADIUS = {
|
|
279
|
+
sharp: { sm: 0, md: 2, lg: 4 },
|
|
280
|
+
soft: { sm: 6, md: 12, lg: 20 },
|
|
281
|
+
round: { sm: 10, md: 20, lg: 32 },
|
|
282
|
+
};
|
|
283
|
+
// ---- Tokens -------------------------------------------------------------
|
|
284
|
+
/** "$accent" → "accent"; anything that is not a whole token → undefined. */
|
|
285
|
+
function tokenName(value) {
|
|
286
|
+
if (value.length < 2 || value.length > 20 || value[0] !== '$')
|
|
287
|
+
return undefined;
|
|
288
|
+
const name = value.slice(1);
|
|
289
|
+
return /^[a-zA-Z]+$/.test(name) ? name : undefined;
|
|
290
|
+
}
|
|
291
|
+
/** A colour token's value, or undefined when value is not one. */
|
|
292
|
+
export function resolveColor(value, theme) {
|
|
293
|
+
const name = tokenName(value);
|
|
294
|
+
if (!name)
|
|
295
|
+
return undefined;
|
|
296
|
+
if (name in theme.colors)
|
|
297
|
+
return theme.colors[name];
|
|
298
|
+
switch (name) {
|
|
299
|
+
case 'onPrimary': return readableOn(theme.colors.primary, theme);
|
|
300
|
+
case 'onSecondary': return readableOn(theme.colors.secondary, theme);
|
|
301
|
+
case 'onAccent': return readableOn(theme.colors.accent, theme);
|
|
302
|
+
case 'onInk': return readableOn(theme.colors.ink, theme);
|
|
303
|
+
}
|
|
304
|
+
return undefined;
|
|
305
|
+
}
|
|
306
|
+
/** Any token's value: colours, "$display"/"$body" (a font id), "$logo". */
|
|
307
|
+
export function resolveToken(value, theme) {
|
|
308
|
+
const name = tokenName(value);
|
|
309
|
+
if (!name)
|
|
310
|
+
return undefined;
|
|
311
|
+
if (name === 'display' || name === 'body')
|
|
312
|
+
return theme.fonts[name];
|
|
313
|
+
if (name === 'logo')
|
|
314
|
+
return theme.logo?.src ?? '';
|
|
315
|
+
return resolveColor(value, theme);
|
|
316
|
+
}
|
|
317
|
+
/** Every token a writer may use, for tool descriptions and validation. */
|
|
318
|
+
export const THEME_TOKENS = [
|
|
319
|
+
...THEME_COLOR_ROLES.map((r) => '$' + r),
|
|
320
|
+
...THEME_DERIVED_ROLES.map((r) => '$' + r),
|
|
321
|
+
'$display', '$body', '$logo',
|
|
322
|
+
];
|
|
323
|
+
/**
|
|
324
|
+
* Fields that hold words, never a token. "$accent" typed into a sticky
|
|
325
|
+
* note is a sticky note about the accent, not a colour.
|
|
326
|
+
*/
|
|
327
|
+
const TEXT_KEYS = new Set([
|
|
328
|
+
'id', 'text', 'label', 'title', 'subtitle', 'alt', 'link', 'content', 'caption',
|
|
329
|
+
'labels', 'name', 'html', 'value', 'unit', 'prefix', 'suffix', 'iconName', 'groupId',
|
|
330
|
+
]);
|
|
331
|
+
function resolveDeep(value, theme, depth) {
|
|
332
|
+
if (depth > 8)
|
|
333
|
+
return value;
|
|
334
|
+
if (typeof value === 'string') {
|
|
335
|
+
if (value[0] !== '$')
|
|
336
|
+
return value;
|
|
337
|
+
const resolved = resolveToken(value, theme);
|
|
338
|
+
return resolved === undefined ? value : resolved;
|
|
339
|
+
}
|
|
340
|
+
if (Array.isArray(value)) {
|
|
341
|
+
let out;
|
|
342
|
+
for (let i = 0; i < value.length; i++) {
|
|
343
|
+
const next = resolveDeep(value[i], theme, depth + 1);
|
|
344
|
+
if (next !== value[i]) {
|
|
345
|
+
out ??= value.slice();
|
|
346
|
+
out[i] = next;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return out ?? value;
|
|
350
|
+
}
|
|
351
|
+
if (value && typeof value === 'object') {
|
|
352
|
+
let out;
|
|
353
|
+
for (const [key, v] of Object.entries(value)) {
|
|
354
|
+
if (TEXT_KEYS.has(key))
|
|
355
|
+
continue;
|
|
356
|
+
const next = resolveDeep(v, theme, depth + 1);
|
|
357
|
+
if (next !== v) {
|
|
358
|
+
out ??= { ...value };
|
|
359
|
+
out[key] = next;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return out ?? value;
|
|
363
|
+
}
|
|
364
|
+
return value;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* The element as it should be drawn. Returns the same object when it holds
|
|
368
|
+
* no token, so a board without tokens costs nothing and keeps identities.
|
|
369
|
+
* Never write the result back: that would freeze the brand into the
|
|
370
|
+
* element and the next theme change would no longer reach it.
|
|
371
|
+
*/
|
|
372
|
+
export function resolveElement(element, theme) {
|
|
373
|
+
return resolveDeep(element, theme, 0);
|
|
374
|
+
}
|
|
375
|
+
/** The brand colours a person picks from, as tokens with their values. */
|
|
376
|
+
export function themeSwatches(theme) {
|
|
377
|
+
const roles = ['primary', 'secondary', 'accent', 'ink', 'inkMuted', 'surfaceMuted', 'surface', 'paper'];
|
|
378
|
+
return roles.map((role) => ({ token: '$' + role, role, color: theme.colors[role] }));
|
|
379
|
+
}
|
|
380
|
+
// ---- Adopting a brand -----------------------------------------------------
|
|
381
|
+
/**
|
|
382
|
+
* Colours that mean "nobody chose this": the dVersum palette and the
|
|
383
|
+
* editor's factory defaults, per property. adoptBrand turns them into the
|
|
384
|
+
* brand role they stand for. Anything else was picked by a person and is
|
|
385
|
+
* left alone.
|
|
386
|
+
*/
|
|
387
|
+
const ADOPT = {
|
|
388
|
+
fill: {
|
|
389
|
+
'#374151': '$primary', '#0c1f16': '$primary', '#45e59f': '$accent', '#2bc97e': '$accentStrong',
|
|
390
|
+
'#e2e8f0': '$surfaceMuted', '#f1f5f9': '$surfaceMuted', '#f6f8f6': '$surfaceMuted',
|
|
391
|
+
},
|
|
392
|
+
stroke: {
|
|
393
|
+
'#6b7280': '$inkMuted', '#94a3b8': '$border', '#d9e2dc': '$border', '#cbd5e1': '$border',
|
|
394
|
+
'#45e59f': '$accent', '#2bc97e': '$accentStrong', '#0c1f16': '$ink', '#374151': '$primary',
|
|
395
|
+
},
|
|
396
|
+
color: { '#1e293b': '$ink', '#0c1f16': '$ink', '#5b7266': '$inkMuted', '#45e59f': '$accent', '#2bc97e': '$accentStrong' },
|
|
397
|
+
fontColor: { '#1e293b': '$ink', '#0c1f16': '$ink', '#5b7266': '$inkMuted' },
|
|
398
|
+
headerBg: { '#374151': '$surfaceMuted', '#e2e8f0': '$surfaceMuted', '#f6f8f6': '$surfaceMuted' },
|
|
399
|
+
cellBg: { '#1e293b': '$surface', '#ffffff': '$surface' },
|
|
400
|
+
borderColor: { '#4b5563': '$border', '#cbd5e1': '$border', '#d9e2dc': '$border' },
|
|
401
|
+
textColor: { '#e5e7eb': '$ink', '#1e293b': '$ink', '#0c1f16': '$ink' },
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* The element with its default colours turned into brand tokens, or null
|
|
405
|
+
* when nothing changed. Text on a shape that became "$primary" becomes
|
|
406
|
+
* "$onPrimary", so it stays legible whatever the brand's primary is.
|
|
407
|
+
*/
|
|
408
|
+
export function adoptBrand(el) {
|
|
409
|
+
const changes = {};
|
|
410
|
+
for (const [key, map] of Object.entries(ADOPT)) {
|
|
411
|
+
const v = el[key];
|
|
412
|
+
if (typeof v !== 'string')
|
|
413
|
+
continue;
|
|
414
|
+
const token = map[v.toLowerCase()];
|
|
415
|
+
if (token)
|
|
416
|
+
changes[key] = token;
|
|
417
|
+
}
|
|
418
|
+
if (changes.fill === '$primary') {
|
|
419
|
+
const fc = typeof el.fontColor === 'string' ? el.fontColor.toLowerCase() : undefined;
|
|
420
|
+
if (!fc || fc === '#ffffff' || fc === '#fff')
|
|
421
|
+
changes.fontColor = '$onPrimary';
|
|
422
|
+
}
|
|
423
|
+
const style = el.style;
|
|
424
|
+
if (style && typeof style.accent === 'string' && ['#45e59f', '#2bc97e'].includes(style.accent.toLowerCase())) {
|
|
425
|
+
changes.style = { ...style, accent: '$accent' };
|
|
426
|
+
}
|
|
427
|
+
return Object.keys(changes).length ? changes : null;
|
|
428
|
+
}
|
|
429
|
+
/** Series colours for charts: the brand first, then distinct fallbacks. */
|
|
430
|
+
export function seriesPalette(theme) {
|
|
431
|
+
const brand = [theme.colors.accent, theme.colors.primary, theme.colors.secondary];
|
|
432
|
+
const fallback = ['#6366f1', '#f59e0b', '#ef4444', '#8b5cf6', '#0ea5e9', '#10b981', '#f97316'];
|
|
433
|
+
const out = [];
|
|
434
|
+
for (const c of [...brand, ...fallback]) {
|
|
435
|
+
// Two near-identical series are worse than a stranger colour.
|
|
436
|
+
if (!out.some((o) => contrastRatio(o, c) < 1.25))
|
|
437
|
+
out.push(c);
|
|
438
|
+
}
|
|
439
|
+
return out;
|
|
440
|
+
}
|
|
441
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../src/whiteboard/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA4BH,MAAM,CAAC,MAAM,iBAAiB,GAAqB;IACjD,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU;IACnE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO;CAC7C,CAAA;AAED,2DAA2D;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAqB,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;AAE/G,MAAM,CAAC,MAAM,mBAAmB,GAAuB,CAAC,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;AAwBxG,sDAAsD;AACtD,MAAM,CAAC,MAAM,aAAa,GAAe;IACvC,MAAM,EAAE;QACN,OAAO,E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