@tldraw/tlschema 4.6.0-canary.239a3cd0bda5 → 4.6.0-canary.2704cdc4a4e9
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/dist-cjs/index.d.ts +15 -1
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/styles/TLTheme.js.map +1 -1
- package/dist-esm/index.d.mts +15 -1
- package/dist-esm/index.mjs +1 -1
- package/package.json +5 -5
- package/src/styles/TLTheme.ts +21 -0
package/dist-cjs/index.d.ts
CHANGED
|
@@ -6272,6 +6272,20 @@ export declare interface TLThemeDefaultColors {
|
|
|
6272
6272
|
solid: string;
|
|
6273
6273
|
cursor: string;
|
|
6274
6274
|
noteBorder: string;
|
|
6275
|
+
/** Snap indicator line color */
|
|
6276
|
+
snap: string;
|
|
6277
|
+
/** Selection outline stroke */
|
|
6278
|
+
selectionStroke: string;
|
|
6279
|
+
/** Selection handle fill (typically the background color) */
|
|
6280
|
+
selectionFill: string;
|
|
6281
|
+
/** Brush rectangle fill */
|
|
6282
|
+
brushFill: string;
|
|
6283
|
+
/** Brush rectangle stroke */
|
|
6284
|
+
brushStroke: string;
|
|
6285
|
+
/** Selected contrast color (handle fills, etc.) */
|
|
6286
|
+
selectedContrast: string;
|
|
6287
|
+
/** Laser pointer color */
|
|
6288
|
+
laser: string;
|
|
6275
6289
|
black: TLDefaultColor;
|
|
6276
6290
|
grey: TLDefaultColor;
|
|
6277
6291
|
'light-violet': TLDefaultColor;
|
|
@@ -6371,7 +6385,7 @@ export declare interface TLThemes {
|
|
|
6371
6385
|
*
|
|
6372
6386
|
* @public
|
|
6373
6387
|
*/
|
|
6374
|
-
export declare type TLThemeUiColorKeys = 'background' | 'cursor' | 'negativeSpace' | 'noteBorder' | 'solid' | 'text';
|
|
6388
|
+
export declare type TLThemeUiColorKeys = 'background' | 'brushFill' | 'brushStroke' | 'cursor' | 'laser' | 'negativeSpace' | 'noteBorder' | 'selectedContrast' | 'selectionFill' | 'selectionStroke' | 'snap' | 'solid' | 'text';
|
|
6375
6389
|
|
|
6376
6390
|
/**
|
|
6377
6391
|
* A type for an asset that is available in the editor but whose type is
|
package/dist-cjs/index.js
CHANGED
|
@@ -205,7 +205,7 @@ var import_translations = require("./translations/translations");
|
|
|
205
205
|
var import_b64Vecs = require("./misc/b64Vecs");
|
|
206
206
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
207
207
|
"@tldraw/tlschema",
|
|
208
|
-
"4.6.0-canary.
|
|
208
|
+
"4.6.0-canary.2704cdc4a4e9",
|
|
209
209
|
"cjs"
|
|
210
210
|
);
|
|
211
211
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles/TLTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import type { TLFontFace } from './TLFontFace'\n\n/**\n * Defines the color variants available for each color in the default theme.\n * Each color has multiple variants for different use cases like fills, strokes,\n * patterns, and UI elements like frames and notes.\n *\n * @example\n * ```ts\n * import { TLDefaultColor } from '@tldraw/tlschema'\n *\n * const blueColor: TLDefaultColor = {\n * solid: '#4465e9',\n * semi: '#dce1f8',\n * pattern: '#6681ee',\n * fill: '#4465e9',\n * // ... other variants\n * }\n * ```\n *\n * @public\n */\nexport interface TLDefaultColor {\n\tsolid: string\n\tsemi: string\n\tpattern: string\n\tfill: string // usually same as solid\n\tlinedFill: string // usually slightly lighter than fill\n\tframeHeadingStroke: string\n\tframeHeadingFill: string\n\tframeStroke: string\n\tframeFill: string\n\tframeText: string\n\tnoteFill: string\n\tnoteText: string\n\thighlightSrgb: string\n\thighlightP3: string\n}\n\n/**\n * The color palette for a theme. Contains base UI colors (as strings) and\n * named shape colors (as {@link TLDefaultColor} objects).\n *\n * Extend this interface via module augmentation to add custom colors:\n *\n * @example\n * ```ts\n * declare module '@tldraw/tlschema' {\n * interface TLThemeColors {\n * pink: TLDefaultColor\n * }\n * }\n * ```\n *\n * @public\n */\nexport interface TLThemeDefaultColors {\n\ttext: string\n\tbackground: string\n\tnegativeSpace: string\n\tsolid: string\n\tcursor: string\n\tnoteBorder: string\n\tblack: TLDefaultColor\n\tgrey: TLDefaultColor\n\t'light-violet': TLDefaultColor\n\tviolet: TLDefaultColor\n\tblue: TLDefaultColor\n\t'light-blue': TLDefaultColor\n\tyellow: TLDefaultColor\n\torange: TLDefaultColor\n\tgreen: TLDefaultColor\n\t'light-green': TLDefaultColor\n\t'light-red': TLDefaultColor\n\tred: TLDefaultColor\n\twhite: TLDefaultColor\n}\n\n/**\n * A font definition within a theme. Maps a font style name to a CSS font-family\n * declaration and optional font face descriptors for loading.\n *\n * @example\n * ```ts\n * import { TLThemeFont } from '@tldraw/tlschema'\n *\n * const customSans: TLThemeFont = {\n * fontFamily: \"'Inter', sans-serif\",\n * faces: [\n * { family: 'Inter', src: { url: 'https://example.com/Inter-Regular.woff2', format: 'woff2' }, weight: 'normal' },\n * { family: 'Inter', src: { url: 'https://example.com/Inter-Bold.woff2', format: 'woff2' }, weight: 'bold' },\n * ]\n * }\n * ```\n *\n * @public\n */\nexport interface TLThemeFont {\n\t/** CSS font-family declaration, e.g. `\"'Inter', sans-serif\"` */\n\tfontFamily: string\n\t/** Font face definitions for loading. Omit for system fonts that don't need loading. */\n\tfaces?: TLFontFace[]\n\t/**\n\t * Icon for the style panel. Accepts a string icon ID (resolved via `assetUrls.icons`)\n\t * or a React element (`TLUiIconJsx`). Defaults to the built-in icon for known fonts,\n\t * or `'font-draw'` for custom fonts.\n\t */\n\ticon?: unknown\n}\n\n/**\n * The font palette for a theme. Contains named font definitions mapping font style\n * names to their CSS font-family strings and font face descriptors.\n *\n * Extend this interface via module augmentation to add custom fonts:\n *\n * @example\n * ```ts\n * declare module '@tldraw/tlschema' {\n * interface TLThemeFonts {\n * cursive: TLThemeFont\n * }\n * }\n * ```\n *\n * @public\n */\nexport interface TLThemeFonts {\n\tdraw: TLThemeFont\n\tsans: TLThemeFont\n\tserif: TLThemeFont\n\tmono: TLThemeFont\n}\n\n/**\n * Augment this interface to remove built-in palette colors from themes.\n * Each key you add will be omitted from {@link TLThemeColors}.\n *\n * @example\n * ```ts\n * declare module '@tldraw/tlschema' {\n * interface TLRemovedDefaultThemeColors {\n * 'light-violet': true\n * 'light-blue': true\n * }\n * }\n * ```\n *\n * @public\n */\n// oxlint-disable-next-line typescript/no-empty-object-type\nexport interface TLRemovedDefaultThemeColors {}\n\n/**\n * Keys in {@link TLThemeDefaultColors} that are required UI infrastructure colors\n * and cannot be removed via {@link TLRemovedDefaultThemeColors}.\n *\n * @public\n */\nexport type TLThemeUiColorKeys =\n\t| 'text'\n\t| 'background'\n\t| 'negativeSpace'\n\t| 'solid'\n\t| 'cursor'\n\t| 'noteBorder'\n\n/**\n * A color palette for one color mode. UI colors are always required.\n * Palette colors removed via {@link TLRemovedDefaultThemeColors} are omitted.\n *\n * @public\n */\nexport type TLThemeColors = Pick<TLThemeDefaultColors, TLThemeUiColorKeys> &\n\tOmit<TLThemeDefaultColors, TLThemeUiColorKeys | keyof TLRemovedDefaultThemeColors>\n\n/**\n * A theme definition containing shared properties and color/font palettes for\n * both light and dark modes.\n *\n * To remove palette colors from themes, augment {@link TLRemovedDefaultThemeColors}.\n * UI colors (`text`, `background`, `negativeSpace`, `solid`, `cursor`, `noteBorder`)\n * are always required.\n *\n * @example\n * ```ts\n * const myTheme: TLTheme = {\n * id: 'custom',\n * fontSize: 16,\n * lineHeight: 1.35,\n * strokeWidth: 2,\n * fonts: DEFAULT_THEME.fonts,\n * colors: {\n * light: { ... },\n * dark: { ... },\n * },\n * }\n * editor.updateTheme(myTheme)\n * ```\n *\n * @public\n */\nexport interface TLTheme {\n\t/** Unique identifier for this theme. Used as the key in the theme registry. */\n\tid: TLThemeId\n\t/** Base font size in pixels. Shape font sizes are derived by multiplying this value. */\n\tfontSize: number\n\t/** Base line height multiplier. */\n\tlineHeight: number\n\t/** Base stroke width in pixels. Shape stroke widths are derived by multiplying this value. */\n\tstrokeWidth: number\n\t/** Font definitions. Individual fonts may be absent if removed by a custom theme. */\n\tfonts: TLThemeFonts\n\tcolors: {\n\t\tlight: TLThemeColors\n\t\tdark: TLThemeColors\n\t}\n}\n\n/**\n * A registry of available themes. Extend this interface via module\n * augmentation to register custom themes for type-safe theme IDs.\n *\n * @example\n * ```ts\n * declare module '@tldraw/tlschema' {\n * interface TLThemes {\n * corporate: TLTheme\n * }\n * }\n * ```\n *\n * @public\n */\nexport interface TLThemes {\n\tdefault: TLTheme\n}\n\n/** @public */\nexport type TLThemeId = keyof TLThemes & string\n"],
|
|
4
|
+
"sourcesContent": ["import type { TLFontFace } from './TLFontFace'\n\n/**\n * Defines the color variants available for each color in the default theme.\n * Each color has multiple variants for different use cases like fills, strokes,\n * patterns, and UI elements like frames and notes.\n *\n * @example\n * ```ts\n * import { TLDefaultColor } from '@tldraw/tlschema'\n *\n * const blueColor: TLDefaultColor = {\n * solid: '#4465e9',\n * semi: '#dce1f8',\n * pattern: '#6681ee',\n * fill: '#4465e9',\n * // ... other variants\n * }\n * ```\n *\n * @public\n */\nexport interface TLDefaultColor {\n\tsolid: string\n\tsemi: string\n\tpattern: string\n\tfill: string // usually same as solid\n\tlinedFill: string // usually slightly lighter than fill\n\tframeHeadingStroke: string\n\tframeHeadingFill: string\n\tframeStroke: string\n\tframeFill: string\n\tframeText: string\n\tnoteFill: string\n\tnoteText: string\n\thighlightSrgb: string\n\thighlightP3: string\n}\n\n/**\n * The color palette for a theme. Contains base UI colors (as strings) and\n * named shape colors (as {@link TLDefaultColor} objects).\n *\n * Extend this interface via module augmentation to add custom colors:\n *\n * @example\n * ```ts\n * declare module '@tldraw/tlschema' {\n * interface TLThemeColors {\n * pink: TLDefaultColor\n * }\n * }\n * ```\n *\n * @public\n */\nexport interface TLThemeDefaultColors {\n\ttext: string\n\tbackground: string\n\tnegativeSpace: string\n\tsolid: string\n\tcursor: string\n\tnoteBorder: string\n\t/** Snap indicator line color */\n\tsnap: string\n\t/** Selection outline stroke */\n\tselectionStroke: string\n\t/** Selection handle fill (typically the background color) */\n\tselectionFill: string\n\t/** Brush rectangle fill */\n\tbrushFill: string\n\t/** Brush rectangle stroke */\n\tbrushStroke: string\n\t/** Selected contrast color (handle fills, etc.) */\n\tselectedContrast: string\n\t/** Laser pointer color */\n\tlaser: string\n\tblack: TLDefaultColor\n\tgrey: TLDefaultColor\n\t'light-violet': TLDefaultColor\n\tviolet: TLDefaultColor\n\tblue: TLDefaultColor\n\t'light-blue': TLDefaultColor\n\tyellow: TLDefaultColor\n\torange: TLDefaultColor\n\tgreen: TLDefaultColor\n\t'light-green': TLDefaultColor\n\t'light-red': TLDefaultColor\n\tred: TLDefaultColor\n\twhite: TLDefaultColor\n}\n\n/**\n * A font definition within a theme. Maps a font style name to a CSS font-family\n * declaration and optional font face descriptors for loading.\n *\n * @example\n * ```ts\n * import { TLThemeFont } from '@tldraw/tlschema'\n *\n * const customSans: TLThemeFont = {\n * fontFamily: \"'Inter', sans-serif\",\n * faces: [\n * { family: 'Inter', src: { url: 'https://example.com/Inter-Regular.woff2', format: 'woff2' }, weight: 'normal' },\n * { family: 'Inter', src: { url: 'https://example.com/Inter-Bold.woff2', format: 'woff2' }, weight: 'bold' },\n * ]\n * }\n * ```\n *\n * @public\n */\nexport interface TLThemeFont {\n\t/** CSS font-family declaration, e.g. `\"'Inter', sans-serif\"` */\n\tfontFamily: string\n\t/** Font face definitions for loading. Omit for system fonts that don't need loading. */\n\tfaces?: TLFontFace[]\n\t/**\n\t * Icon for the style panel. Accepts a string icon ID (resolved via `assetUrls.icons`)\n\t * or a React element (`TLUiIconJsx`). Defaults to the built-in icon for known fonts,\n\t * or `'font-draw'` for custom fonts.\n\t */\n\ticon?: unknown\n}\n\n/**\n * The font palette for a theme. Contains named font definitions mapping font style\n * names to their CSS font-family strings and font face descriptors.\n *\n * Extend this interface via module augmentation to add custom fonts:\n *\n * @example\n * ```ts\n * declare module '@tldraw/tlschema' {\n * interface TLThemeFonts {\n * cursive: TLThemeFont\n * }\n * }\n * ```\n *\n * @public\n */\nexport interface TLThemeFonts {\n\tdraw: TLThemeFont\n\tsans: TLThemeFont\n\tserif: TLThemeFont\n\tmono: TLThemeFont\n}\n\n/**\n * Augment this interface to remove built-in palette colors from themes.\n * Each key you add will be omitted from {@link TLThemeColors}.\n *\n * @example\n * ```ts\n * declare module '@tldraw/tlschema' {\n * interface TLRemovedDefaultThemeColors {\n * 'light-violet': true\n * 'light-blue': true\n * }\n * }\n * ```\n *\n * @public\n */\n// oxlint-disable-next-line typescript/no-empty-object-type\nexport interface TLRemovedDefaultThemeColors {}\n\n/**\n * Keys in {@link TLThemeDefaultColors} that are required UI infrastructure colors\n * and cannot be removed via {@link TLRemovedDefaultThemeColors}.\n *\n * @public\n */\nexport type TLThemeUiColorKeys =\n\t| 'text'\n\t| 'background'\n\t| 'negativeSpace'\n\t| 'solid'\n\t| 'cursor'\n\t| 'noteBorder'\n\t| 'snap'\n\t| 'selectionStroke'\n\t| 'selectionFill'\n\t| 'brushFill'\n\t| 'brushStroke'\n\t| 'selectedContrast'\n\t| 'laser'\n\n/**\n * A color palette for one color mode. UI colors are always required.\n * Palette colors removed via {@link TLRemovedDefaultThemeColors} are omitted.\n *\n * @public\n */\nexport type TLThemeColors = Pick<TLThemeDefaultColors, TLThemeUiColorKeys> &\n\tOmit<TLThemeDefaultColors, TLThemeUiColorKeys | keyof TLRemovedDefaultThemeColors>\n\n/**\n * A theme definition containing shared properties and color/font palettes for\n * both light and dark modes.\n *\n * To remove palette colors from themes, augment {@link TLRemovedDefaultThemeColors}.\n * UI colors (`text`, `background`, `negativeSpace`, `solid`, `cursor`, `noteBorder`)\n * are always required.\n *\n * @example\n * ```ts\n * const myTheme: TLTheme = {\n * id: 'custom',\n * fontSize: 16,\n * lineHeight: 1.35,\n * strokeWidth: 2,\n * fonts: DEFAULT_THEME.fonts,\n * colors: {\n * light: { ... },\n * dark: { ... },\n * },\n * }\n * editor.updateTheme(myTheme)\n * ```\n *\n * @public\n */\nexport interface TLTheme {\n\t/** Unique identifier for this theme. Used as the key in the theme registry. */\n\tid: TLThemeId\n\t/** Base font size in pixels. Shape font sizes are derived by multiplying this value. */\n\tfontSize: number\n\t/** Base line height multiplier. */\n\tlineHeight: number\n\t/** Base stroke width in pixels. Shape stroke widths are derived by multiplying this value. */\n\tstrokeWidth: number\n\t/** Font definitions. Individual fonts may be absent if removed by a custom theme. */\n\tfonts: TLThemeFonts\n\tcolors: {\n\t\tlight: TLThemeColors\n\t\tdark: TLThemeColors\n\t}\n}\n\n/**\n * A registry of available themes. Extend this interface via module\n * augmentation to register custom themes for type-safe theme IDs.\n *\n * @example\n * ```ts\n * declare module '@tldraw/tlschema' {\n * interface TLThemes {\n * corporate: TLTheme\n * }\n * }\n * ```\n *\n * @public\n */\nexport interface TLThemes {\n\tdefault: TLTheme\n}\n\n/** @public */\nexport type TLThemeId = keyof TLThemes & string\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist-esm/index.d.mts
CHANGED
|
@@ -6272,6 +6272,20 @@ export declare interface TLThemeDefaultColors {
|
|
|
6272
6272
|
solid: string;
|
|
6273
6273
|
cursor: string;
|
|
6274
6274
|
noteBorder: string;
|
|
6275
|
+
/** Snap indicator line color */
|
|
6276
|
+
snap: string;
|
|
6277
|
+
/** Selection outline stroke */
|
|
6278
|
+
selectionStroke: string;
|
|
6279
|
+
/** Selection handle fill (typically the background color) */
|
|
6280
|
+
selectionFill: string;
|
|
6281
|
+
/** Brush rectangle fill */
|
|
6282
|
+
brushFill: string;
|
|
6283
|
+
/** Brush rectangle stroke */
|
|
6284
|
+
brushStroke: string;
|
|
6285
|
+
/** Selected contrast color (handle fills, etc.) */
|
|
6286
|
+
selectedContrast: string;
|
|
6287
|
+
/** Laser pointer color */
|
|
6288
|
+
laser: string;
|
|
6275
6289
|
black: TLDefaultColor;
|
|
6276
6290
|
grey: TLDefaultColor;
|
|
6277
6291
|
'light-violet': TLDefaultColor;
|
|
@@ -6371,7 +6385,7 @@ export declare interface TLThemes {
|
|
|
6371
6385
|
*
|
|
6372
6386
|
* @public
|
|
6373
6387
|
*/
|
|
6374
|
-
export declare type TLThemeUiColorKeys = 'background' | 'cursor' | 'negativeSpace' | 'noteBorder' | 'solid' | 'text';
|
|
6388
|
+
export declare type TLThemeUiColorKeys = 'background' | 'brushFill' | 'brushStroke' | 'cursor' | 'laser' | 'negativeSpace' | 'noteBorder' | 'selectedContrast' | 'selectionFill' | 'selectionStroke' | 'snap' | 'solid' | 'text';
|
|
6375
6389
|
|
|
6376
6390
|
/**
|
|
6377
6391
|
* A type for an asset that is available in the editor but whose type is
|
package/dist-esm/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tldraw/tlschema",
|
|
3
3
|
"description": "tldraw infinite canvas SDK (schema).",
|
|
4
|
-
"version": "4.6.0-canary.
|
|
4
|
+
"version": "4.6.0-canary.2704cdc4a4e9",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "tldraw Inc.",
|
|
7
7
|
"email": "hello@tldraw.com"
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"vitest": "^3.2.4"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@tldraw/state": "4.6.0-canary.
|
|
54
|
-
"@tldraw/store": "4.6.0-canary.
|
|
55
|
-
"@tldraw/utils": "4.6.0-canary.
|
|
56
|
-
"@tldraw/validate": "4.6.0-canary.
|
|
53
|
+
"@tldraw/state": "4.6.0-canary.2704cdc4a4e9",
|
|
54
|
+
"@tldraw/store": "4.6.0-canary.2704cdc4a4e9",
|
|
55
|
+
"@tldraw/utils": "4.6.0-canary.2704cdc4a4e9",
|
|
56
|
+
"@tldraw/validate": "4.6.0-canary.2704cdc4a4e9"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"react": "^18.2.0 || ^19.2.1",
|
package/src/styles/TLTheme.ts
CHANGED
|
@@ -61,6 +61,20 @@ export interface TLThemeDefaultColors {
|
|
|
61
61
|
solid: string
|
|
62
62
|
cursor: string
|
|
63
63
|
noteBorder: string
|
|
64
|
+
/** Snap indicator line color */
|
|
65
|
+
snap: string
|
|
66
|
+
/** Selection outline stroke */
|
|
67
|
+
selectionStroke: string
|
|
68
|
+
/** Selection handle fill (typically the background color) */
|
|
69
|
+
selectionFill: string
|
|
70
|
+
/** Brush rectangle fill */
|
|
71
|
+
brushFill: string
|
|
72
|
+
/** Brush rectangle stroke */
|
|
73
|
+
brushStroke: string
|
|
74
|
+
/** Selected contrast color (handle fills, etc.) */
|
|
75
|
+
selectedContrast: string
|
|
76
|
+
/** Laser pointer color */
|
|
77
|
+
laser: string
|
|
64
78
|
black: TLDefaultColor
|
|
65
79
|
grey: TLDefaultColor
|
|
66
80
|
'light-violet': TLDefaultColor
|
|
@@ -164,6 +178,13 @@ export type TLThemeUiColorKeys =
|
|
|
164
178
|
| 'solid'
|
|
165
179
|
| 'cursor'
|
|
166
180
|
| 'noteBorder'
|
|
181
|
+
| 'snap'
|
|
182
|
+
| 'selectionStroke'
|
|
183
|
+
| 'selectionFill'
|
|
184
|
+
| 'brushFill'
|
|
185
|
+
| 'brushStroke'
|
|
186
|
+
| 'selectedContrast'
|
|
187
|
+
| 'laser'
|
|
167
188
|
|
|
168
189
|
/**
|
|
169
190
|
* A color palette for one color mode. UI colors are always required.
|