@tldraw/tlschema 4.2.0-next.f100cedfc45b → 4.3.0-canary.03ae87dcc44b
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/bindings/TLBaseBinding.js.map +2 -2
- package/dist-cjs/createTLSchema.js.map +2 -2
- package/dist-cjs/index.d.ts +194 -38
- package/dist-cjs/index.js +2 -1
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/misc/TLHandle.js.map +1 -1
- package/dist-cjs/records/TLAsset.js.map +1 -1
- package/dist-cjs/records/TLBinding.js.map +2 -2
- package/dist-cjs/records/TLShape.js.map +2 -2
- package/dist-cjs/shapes/ShapeWithCrop.js.map +1 -1
- package/dist-cjs/shapes/TLBaseShape.js.map +2 -2
- package/dist-cjs/store-migrations.js +1 -1
- package/dist-cjs/store-migrations.js.map +2 -2
- package/dist-cjs/styles/TLColorStyle.js +26 -0
- package/dist-cjs/styles/TLColorStyle.js.map +2 -2
- package/dist-cjs/styles/TLFillStyle.js +1 -1
- package/dist-cjs/styles/TLFillStyle.js.map +2 -2
- package/dist-esm/bindings/TLBaseBinding.mjs.map +2 -2
- package/dist-esm/createTLSchema.mjs.map +2 -2
- package/dist-esm/index.d.mts +194 -38
- package/dist-esm/index.mjs +3 -1
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/misc/TLHandle.mjs.map +1 -1
- package/dist-esm/records/TLAsset.mjs.map +1 -1
- package/dist-esm/records/TLBinding.mjs.map +2 -2
- package/dist-esm/records/TLShape.mjs.map +2 -2
- package/dist-esm/shapes/TLBaseShape.mjs.map +2 -2
- package/dist-esm/store-migrations.mjs +1 -1
- package/dist-esm/store-migrations.mjs.map +2 -2
- package/dist-esm/styles/TLColorStyle.mjs +26 -0
- package/dist-esm/styles/TLColorStyle.mjs.map +2 -2
- package/dist-esm/styles/TLFillStyle.mjs +1 -1
- package/dist-esm/styles/TLFillStyle.mjs.map +2 -2
- package/package.json +5 -5
- package/src/bindings/TLBaseBinding.ts +25 -14
- package/src/createTLSchema.ts +8 -2
- package/src/index.ts +7 -0
- package/src/misc/TLHandle.ts +2 -0
- package/src/records/TLAsset.ts +2 -2
- package/src/records/TLBinding.ts +65 -23
- package/src/records/TLRecord.test.ts +17 -5
- package/src/records/TLShape.ts +100 -5
- package/src/shapes/ShapeWithCrop.ts +2 -2
- package/src/shapes/TLBaseShape.ts +34 -10
- package/src/store-migrations.ts +2 -1
- package/src/styles/TLColorStyle.ts +27 -0
- package/src/styles/TLFillStyle.ts +1 -1
package/src/records/TLShape.ts
CHANGED
|
@@ -79,12 +79,51 @@ export type TLDefaultShape =
|
|
|
79
79
|
*/
|
|
80
80
|
export type TLUnknownShape = TLBaseShape<string, object>
|
|
81
81
|
|
|
82
|
+
/** @public */
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
84
|
+
export interface TLGlobalShapePropsMap {}
|
|
85
|
+
|
|
86
|
+
/** @public */
|
|
87
|
+
// prettier-ignore
|
|
88
|
+
export type TLIndexedShapes = {
|
|
89
|
+
// We iterate over a union of augmented keys and default shape types.
|
|
90
|
+
// This allows us to include (or conditionally exclude or override) the default shapes in one go.
|
|
91
|
+
//
|
|
92
|
+
// In the `as` clause we are filtering out disabled shapes.
|
|
93
|
+
[K in keyof TLGlobalShapePropsMap | TLDefaultShape['type'] as K extends TLDefaultShape['type']
|
|
94
|
+
? // core shapes are always available and cannot be overridden so we just include them
|
|
95
|
+
K extends 'group'
|
|
96
|
+
? K
|
|
97
|
+
: K extends keyof TLGlobalShapePropsMap
|
|
98
|
+
? // if it extends a nullish value the user has disabled this shape type so we filter it out with never
|
|
99
|
+
TLGlobalShapePropsMap[K] extends null | undefined
|
|
100
|
+
? never
|
|
101
|
+
: K
|
|
102
|
+
: K
|
|
103
|
+
: K]: K extends 'group'
|
|
104
|
+
? // core shapes are always available and cannot be overridden so we just include them
|
|
105
|
+
Extract<TLDefaultShape, { type: K }>
|
|
106
|
+
: K extends TLDefaultShape['type']
|
|
107
|
+
? // if it's a default shape type we need to check if it's been overridden
|
|
108
|
+
K extends keyof TLGlobalShapePropsMap
|
|
109
|
+
? // if it has been overriden then use the custom shape definition
|
|
110
|
+
TLBaseShape<K, TLGlobalShapePropsMap[K]>
|
|
111
|
+
: // if it has not been overriden then reuse existing type aliases for better type display
|
|
112
|
+
Extract<TLDefaultShape, { type: K }>
|
|
113
|
+
: // use the custom shape definition
|
|
114
|
+
TLBaseShape<K, TLGlobalShapePropsMap[K & keyof TLGlobalShapePropsMap]>
|
|
115
|
+
}
|
|
116
|
+
|
|
82
117
|
/**
|
|
83
|
-
* The set of all shapes that are available in the editor
|
|
118
|
+
* The set of all shapes that are available in the editor.
|
|
84
119
|
*
|
|
85
120
|
* This is the primary shape type used throughout tldraw. It includes both the
|
|
86
121
|
* built-in default shapes and any custom shapes that might be added.
|
|
87
122
|
*
|
|
123
|
+
* You can use this type without a type argument to work with any shape, or pass
|
|
124
|
+
* a specific shape type string (e.g., `'geo'`, `'arrow'`, `'text'`) to narrow
|
|
125
|
+
* down to that specific shape type.
|
|
126
|
+
*
|
|
88
127
|
* @example
|
|
89
128
|
* ```ts
|
|
90
129
|
* // Work with any shape in the editor
|
|
@@ -95,11 +134,16 @@ export type TLUnknownShape = TLBaseShape<string, object>
|
|
|
95
134
|
* y: shape.y + deltaY
|
|
96
135
|
* }
|
|
97
136
|
* }
|
|
137
|
+
*
|
|
138
|
+
* // Narrow to a specific shape type by passing the type as a generic argument
|
|
139
|
+
* function getArrowLabel(shape: TLShape<'arrow'>): string {
|
|
140
|
+
* return shape.props.text // TypeScript knows this is a TLArrowShape
|
|
141
|
+
* }
|
|
98
142
|
* ```
|
|
99
143
|
*
|
|
100
144
|
* @public
|
|
101
145
|
*/
|
|
102
|
-
export type TLShape =
|
|
146
|
+
export type TLShape<K extends keyof TLIndexedShapes = keyof TLIndexedShapes> = TLIndexedShapes[K]
|
|
103
147
|
|
|
104
148
|
/**
|
|
105
149
|
* A partial version of a shape, useful for updates and patches.
|
|
@@ -139,6 +183,57 @@ export type TLShapePartial<T extends TLShape = TLShape> = T extends T
|
|
|
139
183
|
} & Partial<Omit<T, 'type' | 'id' | 'props' | 'meta'>>
|
|
140
184
|
: never
|
|
141
185
|
|
|
186
|
+
/**
|
|
187
|
+
* A partial version of a shape, useful for creating shapes.
|
|
188
|
+
*
|
|
189
|
+
* This type represents a shape where all properties except `type` are optional.
|
|
190
|
+
* It's commonly used when creating shapes.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```ts
|
|
194
|
+
* // Create a shape
|
|
195
|
+
* const shapeCreate: TLCreateShapePartial = {
|
|
196
|
+
* type: 'geo',
|
|
197
|
+
* x: 100,
|
|
198
|
+
* y: 200
|
|
199
|
+
* }
|
|
200
|
+
*
|
|
201
|
+
* // Create shape properties
|
|
202
|
+
* const propsCreate: TLCreateShapePartial<TLGeoShape> = {
|
|
203
|
+
* type: 'geo',
|
|
204
|
+
* props: {
|
|
205
|
+
* w: 150,
|
|
206
|
+
* h: 100
|
|
207
|
+
* }
|
|
208
|
+
* }
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* @public
|
|
212
|
+
*/
|
|
213
|
+
export type TLCreateShapePartial<T extends TLShape = TLShape> = T extends T
|
|
214
|
+
? {
|
|
215
|
+
type: T['type']
|
|
216
|
+
props?: Partial<T['props']>
|
|
217
|
+
meta?: Partial<T['meta']>
|
|
218
|
+
} & Partial<Omit<T, 'type' | 'props' | 'meta'>>
|
|
219
|
+
: never
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Extract a shape type by its props.
|
|
223
|
+
*
|
|
224
|
+
* This utility type takes a props object type and returns the corresponding shape type
|
|
225
|
+
* from the TLShape union whose props match the given type.
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```ts
|
|
229
|
+
* type MyShape = ExtractShapeByProps<{ w: number; h: number }>
|
|
230
|
+
* // MyShape is now the type of shape(s) that have props with w and h as numbers
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* @public
|
|
234
|
+
*/
|
|
235
|
+
export type ExtractShapeByProps<P> = Extract<TLShape, { props: P }>
|
|
236
|
+
|
|
142
237
|
/**
|
|
143
238
|
* A unique identifier for a shape record.
|
|
144
239
|
*
|
|
@@ -153,7 +248,7 @@ export type TLShapePartial<T extends TLShape = TLShape> = T extends T
|
|
|
153
248
|
*
|
|
154
249
|
* @public
|
|
155
250
|
*/
|
|
156
|
-
export type TLShapeId = RecordId<
|
|
251
|
+
export type TLShapeId = RecordId<TLShape>
|
|
157
252
|
|
|
158
253
|
/**
|
|
159
254
|
* The ID of a shape's parent, which can be either a page or another shape.
|
|
@@ -195,7 +290,7 @@ export const rootShapeVersions = createMigrationIds('com.tldraw.shape', {
|
|
|
195
290
|
HoistOpacity: 2,
|
|
196
291
|
AddMeta: 3,
|
|
197
292
|
AddWhite: 4,
|
|
198
|
-
}
|
|
293
|
+
})
|
|
199
294
|
|
|
200
295
|
/**
|
|
201
296
|
* Migration sequence for the root shape record type.
|
|
@@ -469,7 +564,7 @@ export function createShapePropsMigrationIds<
|
|
|
469
564
|
* @internal
|
|
470
565
|
*/
|
|
471
566
|
export function createShapeRecordType(shapes: Record<string, SchemaPropsInfo>) {
|
|
472
|
-
return createRecordType
|
|
567
|
+
return createRecordType('shape', {
|
|
473
568
|
scope: 'document',
|
|
474
569
|
validator: T.model(
|
|
475
570
|
'shape',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VecModel } from '../misc/geometry-types'
|
|
2
|
-
import {
|
|
2
|
+
import { ExtractShapeByProps } from '../records/TLShape'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Defines cropping parameters for shapes that support cropping.
|
|
@@ -71,4 +71,4 @@ export interface TLShapeCrop {
|
|
|
71
71
|
*
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
export type ShapeWithCrop =
|
|
74
|
+
export type ShapeWithCrop = ExtractShapeByProps<{ w: number; h: number; crop: TLShapeCrop | null }>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BaseRecord } from '@tldraw/store'
|
|
2
1
|
import { IndexKey, JsonObject } from '@tldraw/utils'
|
|
3
2
|
import { T } from '@tldraw/validate'
|
|
4
3
|
import { TLOpacityType, opacityValidator } from '../misc/TLOpacity'
|
|
@@ -9,18 +8,37 @@ import { TLParentId, TLShapeId } from '../records/TLShape'
|
|
|
9
8
|
* Base interface for all shapes in tldraw.
|
|
10
9
|
*
|
|
11
10
|
* This interface defines the common properties that all shapes share, regardless of their
|
|
12
|
-
* specific type. Every shape extends this base with additional type-specific properties.
|
|
11
|
+
* specific type. Every default shape extends this base with additional type-specific properties.
|
|
12
|
+
*
|
|
13
|
+
* Custom shapes should be defined by augmenting the TLGlobalShapePropsMap type and getting the shape type from the TLShape type.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```ts
|
|
16
|
-
* // Define a
|
|
17
|
-
* interface
|
|
17
|
+
* // Define a default shape type
|
|
18
|
+
* interface TLArrowShape extends TLBaseShape<'arrow', {
|
|
19
|
+
* kind: TLArrowShapeKind
|
|
20
|
+
* labelColor: TLDefaultColorStyle
|
|
21
|
+
* color: TLDefaultColorStyle
|
|
22
|
+
* fill: TLDefaultFillStyle
|
|
23
|
+
* dash: TLDefaultDashStyle
|
|
24
|
+
* size: TLDefaultSizeStyle
|
|
25
|
+
* arrowheadStart: TLArrowShapeArrowheadStyle
|
|
26
|
+
* arrowheadEnd: TLArrowShapeArrowheadStyle
|
|
27
|
+
* font: TLDefaultFontStyle
|
|
28
|
+
* start: VecModel
|
|
29
|
+
* end: VecModel
|
|
30
|
+
* bend: number
|
|
31
|
+
* richText: TLRichText
|
|
32
|
+
* labelPosition: number
|
|
33
|
+
* scale: number
|
|
34
|
+
* elbowMidPoint: number
|
|
35
|
+
* }> {}
|
|
18
36
|
*
|
|
19
37
|
* // Create a shape instance
|
|
20
|
-
* const
|
|
38
|
+
* const arrowShape: TLArrowShape = {
|
|
21
39
|
* id: 'shape:abc123',
|
|
22
40
|
* typeName: 'shape',
|
|
23
|
-
* type: '
|
|
41
|
+
* type: 'arrow',
|
|
24
42
|
* x: 100,
|
|
25
43
|
* y: 200,
|
|
26
44
|
* rotation: 0,
|
|
@@ -29,8 +47,10 @@ import { TLParentId, TLShapeId } from '../records/TLShape'
|
|
|
29
47
|
* isLocked: false,
|
|
30
48
|
* opacity: 1,
|
|
31
49
|
* props: {
|
|
32
|
-
*
|
|
33
|
-
*
|
|
50
|
+
* kind: 'arc',
|
|
51
|
+
* start: { x: 0, y: 0 },
|
|
52
|
+
* end: { x: 100, y: 100 },
|
|
53
|
+
* // ... other props
|
|
34
54
|
* },
|
|
35
55
|
* meta: {}
|
|
36
56
|
* }
|
|
@@ -38,8 +58,12 @@ import { TLParentId, TLShapeId } from '../records/TLShape'
|
|
|
38
58
|
*
|
|
39
59
|
* @public
|
|
40
60
|
*/
|
|
41
|
-
export interface TLBaseShape<Type extends string, Props extends object>
|
|
42
|
-
extends BaseRecord<'shape', TLShapeId
|
|
61
|
+
export interface TLBaseShape<Type extends string, Props extends object> {
|
|
62
|
+
// using real `extends BaseRecord<'shape', TLShapeId>` introduces a circularity in the types
|
|
63
|
+
// and for that reason those "base members" have to be declared manually here
|
|
64
|
+
readonly id: TLShapeId
|
|
65
|
+
readonly typeName: 'shape'
|
|
66
|
+
|
|
43
67
|
type: Type
|
|
44
68
|
x: number
|
|
45
69
|
y: number
|
package/src/store-migrations.ts
CHANGED
|
@@ -72,7 +72,8 @@ export const storeMigrations = createMigrationSequence({
|
|
|
72
72
|
for (const [id, record] of objectMapEntries(store)) {
|
|
73
73
|
if (
|
|
74
74
|
record.typeName === 'shape' &&
|
|
75
|
-
|
|
75
|
+
'type' in record &&
|
|
76
|
+
(record.type === 'icon' || record.type === 'code')
|
|
76
77
|
) {
|
|
77
78
|
delete store[id]
|
|
78
79
|
}
|
|
@@ -61,6 +61,7 @@ export interface TLDefaultColorThemeColor {
|
|
|
61
61
|
semi: string
|
|
62
62
|
pattern: string
|
|
63
63
|
fill: string // usually same as solid
|
|
64
|
+
linedFill: string // usually slightly lighter than fill
|
|
64
65
|
frameHeadingStroke: string
|
|
65
66
|
frameHeadingFill: string
|
|
66
67
|
frameStroke: string
|
|
@@ -134,6 +135,7 @@ export const DefaultColorThemePalette: {
|
|
|
134
135
|
black: {
|
|
135
136
|
solid: '#1d1d1d',
|
|
136
137
|
fill: '#1d1d1d',
|
|
138
|
+
linedFill: '#363636',
|
|
137
139
|
frameHeadingStroke: '#717171',
|
|
138
140
|
frameHeadingFill: '#ffffff',
|
|
139
141
|
frameStroke: '#717171',
|
|
@@ -149,6 +151,7 @@ export const DefaultColorThemePalette: {
|
|
|
149
151
|
blue: {
|
|
150
152
|
solid: '#4465e9',
|
|
151
153
|
fill: '#4465e9',
|
|
154
|
+
linedFill: '#6580ec',
|
|
152
155
|
frameHeadingStroke: '#6681ec',
|
|
153
156
|
frameHeadingFill: '#f9fafe',
|
|
154
157
|
frameStroke: '#6681ec',
|
|
@@ -164,6 +167,7 @@ export const DefaultColorThemePalette: {
|
|
|
164
167
|
green: {
|
|
165
168
|
solid: '#099268',
|
|
166
169
|
fill: '#099268',
|
|
170
|
+
linedFill: '#0bad7c',
|
|
167
171
|
frameHeadingStroke: '#37a684',
|
|
168
172
|
frameHeadingFill: '#f8fcfa',
|
|
169
173
|
frameStroke: '#37a684',
|
|
@@ -179,6 +183,7 @@ export const DefaultColorThemePalette: {
|
|
|
179
183
|
grey: {
|
|
180
184
|
solid: '#9fa8b2',
|
|
181
185
|
fill: '#9fa8b2',
|
|
186
|
+
linedFill: '#bbc1c9',
|
|
182
187
|
frameHeadingStroke: '#aaaaab',
|
|
183
188
|
frameHeadingFill: '#fbfcfc',
|
|
184
189
|
frameStroke: '#aaaaab',
|
|
@@ -194,6 +199,7 @@ export const DefaultColorThemePalette: {
|
|
|
194
199
|
'light-blue': {
|
|
195
200
|
solid: '#4ba1f1',
|
|
196
201
|
fill: '#4ba1f1',
|
|
202
|
+
linedFill: '#7abaf5',
|
|
197
203
|
frameHeadingStroke: '#6cb2f3',
|
|
198
204
|
frameHeadingFill: '#f8fbfe',
|
|
199
205
|
frameStroke: '#6cb2f3',
|
|
@@ -209,6 +215,7 @@ export const DefaultColorThemePalette: {
|
|
|
209
215
|
'light-green': {
|
|
210
216
|
solid: '#4cb05e',
|
|
211
217
|
fill: '#4cb05e',
|
|
218
|
+
linedFill: '#7ec88c',
|
|
212
219
|
frameHeadingStroke: '#6dbe7c',
|
|
213
220
|
frameHeadingFill: '#f8fcf9',
|
|
214
221
|
frameStroke: '#6dbe7c',
|
|
@@ -224,6 +231,7 @@ export const DefaultColorThemePalette: {
|
|
|
224
231
|
'light-red': {
|
|
225
232
|
solid: '#f87777',
|
|
226
233
|
fill: '#f87777',
|
|
234
|
+
linedFill: '#f99a9a',
|
|
227
235
|
frameHeadingStroke: '#f89090',
|
|
228
236
|
frameHeadingFill: '#fffafa',
|
|
229
237
|
frameStroke: '#f89090',
|
|
@@ -239,6 +247,7 @@ export const DefaultColorThemePalette: {
|
|
|
239
247
|
'light-violet': {
|
|
240
248
|
solid: '#e085f4',
|
|
241
249
|
fill: '#e085f4',
|
|
250
|
+
linedFill: '#e9abf7',
|
|
242
251
|
frameHeadingStroke: '#e59bf5',
|
|
243
252
|
frameHeadingFill: '#fefaff',
|
|
244
253
|
frameStroke: '#e59bf5',
|
|
@@ -254,6 +263,7 @@ export const DefaultColorThemePalette: {
|
|
|
254
263
|
orange: {
|
|
255
264
|
solid: '#e16919',
|
|
256
265
|
fill: '#e16919',
|
|
266
|
+
linedFill: '#ea8643',
|
|
257
267
|
frameHeadingStroke: '#e68544',
|
|
258
268
|
frameHeadingFill: '#fef9f6',
|
|
259
269
|
frameStroke: '#e68544',
|
|
@@ -269,6 +279,7 @@ export const DefaultColorThemePalette: {
|
|
|
269
279
|
red: {
|
|
270
280
|
solid: '#e03131',
|
|
271
281
|
fill: '#e03131',
|
|
282
|
+
linedFill: '#e75f5f',
|
|
272
283
|
frameHeadingStroke: '#e55757',
|
|
273
284
|
frameHeadingFill: '#fef7f7',
|
|
274
285
|
frameStroke: '#e55757',
|
|
@@ -284,6 +295,7 @@ export const DefaultColorThemePalette: {
|
|
|
284
295
|
violet: {
|
|
285
296
|
solid: '#ae3ec9',
|
|
286
297
|
fill: '#ae3ec9',
|
|
298
|
+
linedFill: '#be68d4',
|
|
287
299
|
frameHeadingStroke: '#bc62d3',
|
|
288
300
|
frameHeadingFill: '#fcf7fd',
|
|
289
301
|
frameStroke: '#bc62d3',
|
|
@@ -299,6 +311,7 @@ export const DefaultColorThemePalette: {
|
|
|
299
311
|
yellow: {
|
|
300
312
|
solid: '#f1ac4b',
|
|
301
313
|
fill: '#f1ac4b',
|
|
314
|
+
linedFill: '#f5c27a',
|
|
302
315
|
frameHeadingStroke: '#f3bb6c',
|
|
303
316
|
frameHeadingFill: '#fefcf8',
|
|
304
317
|
frameStroke: '#f3bb6c',
|
|
@@ -314,6 +327,7 @@ export const DefaultColorThemePalette: {
|
|
|
314
327
|
white: {
|
|
315
328
|
solid: '#FFFFFF',
|
|
316
329
|
fill: '#FFFFFF',
|
|
330
|
+
linedFill: '#ffffff',
|
|
317
331
|
semi: '#f5f5f5',
|
|
318
332
|
pattern: '#f9f9f9',
|
|
319
333
|
frameHeadingStroke: '#7d7d7d',
|
|
@@ -336,6 +350,7 @@ export const DefaultColorThemePalette: {
|
|
|
336
350
|
black: {
|
|
337
351
|
solid: '#f2f2f2',
|
|
338
352
|
fill: '#f2f2f2',
|
|
353
|
+
linedFill: '#ffffff',
|
|
339
354
|
frameHeadingStroke: '#5c5c5c',
|
|
340
355
|
frameHeadingFill: '#252525',
|
|
341
356
|
frameStroke: '#5c5c5c',
|
|
@@ -351,6 +366,7 @@ export const DefaultColorThemePalette: {
|
|
|
351
366
|
blue: {
|
|
352
367
|
solid: '#4f72fc', // 3c60f0
|
|
353
368
|
fill: '#4f72fc',
|
|
369
|
+
linedFill: '#3c5cdd',
|
|
354
370
|
frameHeadingStroke: '#384994',
|
|
355
371
|
frameHeadingFill: '#1C2036',
|
|
356
372
|
frameStroke: '#384994',
|
|
@@ -366,6 +382,7 @@ export const DefaultColorThemePalette: {
|
|
|
366
382
|
green: {
|
|
367
383
|
solid: '#099268',
|
|
368
384
|
fill: '#099268',
|
|
385
|
+
linedFill: '#087856',
|
|
369
386
|
frameHeadingStroke: '#10513C',
|
|
370
387
|
frameHeadingFill: '#14241f',
|
|
371
388
|
frameStroke: '#10513C',
|
|
@@ -381,6 +398,7 @@ export const DefaultColorThemePalette: {
|
|
|
381
398
|
grey: {
|
|
382
399
|
solid: '#9398b0',
|
|
383
400
|
fill: '#9398b0',
|
|
401
|
+
linedFill: '#8388a5',
|
|
384
402
|
frameHeadingStroke: '#42474D',
|
|
385
403
|
frameHeadingFill: '#23262A',
|
|
386
404
|
frameStroke: '#42474D',
|
|
@@ -396,6 +414,7 @@ export const DefaultColorThemePalette: {
|
|
|
396
414
|
'light-blue': {
|
|
397
415
|
solid: '#4dabf7',
|
|
398
416
|
fill: '#4dabf7',
|
|
417
|
+
linedFill: '#2793ec',
|
|
399
418
|
frameHeadingStroke: '#075797',
|
|
400
419
|
frameHeadingFill: '#142839',
|
|
401
420
|
frameStroke: '#075797',
|
|
@@ -411,6 +430,7 @@ export const DefaultColorThemePalette: {
|
|
|
411
430
|
'light-green': {
|
|
412
431
|
solid: '#40c057',
|
|
413
432
|
fill: '#40c057',
|
|
433
|
+
linedFill: '#37a44b',
|
|
414
434
|
frameHeadingStroke: '#1C5427',
|
|
415
435
|
frameHeadingFill: '#18251A',
|
|
416
436
|
frameStroke: '#1C5427',
|
|
@@ -426,6 +446,7 @@ export const DefaultColorThemePalette: {
|
|
|
426
446
|
'light-red': {
|
|
427
447
|
solid: '#ff8787',
|
|
428
448
|
fill: '#ff8787',
|
|
449
|
+
linedFill: '#ff6666',
|
|
429
450
|
frameHeadingStroke: '#6f3232', // Darker and desaturated variant of solid
|
|
430
451
|
frameHeadingFill: '#341818', // Deep, muted dark red
|
|
431
452
|
frameStroke: '#6f3232', // Matches headingStroke
|
|
@@ -441,6 +462,7 @@ export const DefaultColorThemePalette: {
|
|
|
441
462
|
'light-violet': {
|
|
442
463
|
solid: '#e599f7',
|
|
443
464
|
fill: '#e599f7',
|
|
465
|
+
linedFill: '#dc71f4',
|
|
444
466
|
frameHeadingStroke: '#6c367a',
|
|
445
467
|
frameHeadingFill: '#2D2230',
|
|
446
468
|
frameStroke: '#6c367a',
|
|
@@ -456,6 +478,7 @@ export const DefaultColorThemePalette: {
|
|
|
456
478
|
orange: {
|
|
457
479
|
solid: '#f76707',
|
|
458
480
|
fill: '#f76707',
|
|
481
|
+
linedFill: '#f54900',
|
|
459
482
|
frameHeadingStroke: '#773a0e', // Darker, muted version of solid
|
|
460
483
|
frameHeadingFill: '#2f1d13', // Deep, warm, muted background
|
|
461
484
|
frameStroke: '#773a0e', // Matches headingStroke
|
|
@@ -471,6 +494,7 @@ export const DefaultColorThemePalette: {
|
|
|
471
494
|
red: {
|
|
472
495
|
solid: '#e03131',
|
|
473
496
|
fill: '#e03131',
|
|
497
|
+
linedFill: '#c31d1d',
|
|
474
498
|
frameHeadingStroke: '#701e1e', // Darker, muted variation of solid
|
|
475
499
|
frameHeadingFill: '#301616', // Deep, muted reddish backdrop
|
|
476
500
|
frameStroke: '#701e1e', // Matches headingStroke
|
|
@@ -486,6 +510,7 @@ export const DefaultColorThemePalette: {
|
|
|
486
510
|
violet: {
|
|
487
511
|
solid: '#ae3ec9',
|
|
488
512
|
fill: '#ae3ec9',
|
|
513
|
+
linedFill: '#8f2fa7',
|
|
489
514
|
frameHeadingStroke: '#6d1583', // Darker, muted variation of solid
|
|
490
515
|
frameHeadingFill: '#27152e', // Deep, rich muted violet backdrop
|
|
491
516
|
frameStroke: '#6d1583', // Matches headingStroke
|
|
@@ -501,6 +526,7 @@ export const DefaultColorThemePalette: {
|
|
|
501
526
|
yellow: {
|
|
502
527
|
solid: '#ffc034',
|
|
503
528
|
fill: '#ffc034',
|
|
529
|
+
linedFill: '#ffae00',
|
|
504
530
|
frameHeadingStroke: '#684e12', // Darker, muted variant of solid
|
|
505
531
|
frameHeadingFill: '#2a2113', // Rich, muted dark-yellow background
|
|
506
532
|
frameStroke: '#684e12', // Matches headingStroke
|
|
@@ -516,6 +542,7 @@ export const DefaultColorThemePalette: {
|
|
|
516
542
|
white: {
|
|
517
543
|
solid: '#f3f3f3',
|
|
518
544
|
fill: '#f3f3f3',
|
|
545
|
+
linedFill: '#f3f3f3',
|
|
519
546
|
semi: '#f5f5f5',
|
|
520
547
|
pattern: '#f9f9f9',
|
|
521
548
|
frameHeadingStroke: '#ffffff',
|
|
@@ -36,7 +36,7 @@ import { StyleProp } from './StyleProp'
|
|
|
36
36
|
*/
|
|
37
37
|
export const DefaultFillStyle = StyleProp.defineEnum('tldraw:fill', {
|
|
38
38
|
defaultValue: 'none',
|
|
39
|
-
values: ['none', 'semi', 'solid', 'pattern', 'fill'],
|
|
39
|
+
values: ['none', 'semi', 'solid', 'pattern', 'fill', 'lined-fill'],
|
|
40
40
|
})
|
|
41
41
|
|
|
42
42
|
/**
|