@tldraw/tlschema 4.6.0-next.d15997ff5a4b → 4.6.0-next.d8328a2dcc3d

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.
Files changed (38) hide show
  1. package/dist-cjs/TLStore.js +13 -0
  2. package/dist-cjs/TLStore.js.map +2 -2
  3. package/dist-cjs/createPresenceStateDerivation.js +6 -4
  4. package/dist-cjs/createPresenceStateDerivation.js.map +2 -2
  5. package/dist-cjs/createTLSchema.js +8 -1
  6. package/dist-cjs/createTLSchema.js.map +2 -2
  7. package/dist-cjs/index.d.ts +211 -28
  8. package/dist-cjs/index.js +9 -1
  9. package/dist-cjs/index.js.map +2 -2
  10. package/dist-cjs/records/TLRecord.js.map +1 -1
  11. package/dist-cjs/records/TLUser.js +101 -0
  12. package/dist-cjs/records/TLUser.js.map +7 -0
  13. package/dist-cjs/shapes/TLNoteShape.js +13 -2
  14. package/dist-cjs/shapes/TLNoteShape.js.map +2 -2
  15. package/dist-esm/TLStore.mjs +13 -0
  16. package/dist-esm/TLStore.mjs.map +2 -2
  17. package/dist-esm/createPresenceStateDerivation.mjs +6 -4
  18. package/dist-esm/createPresenceStateDerivation.mjs.map +2 -2
  19. package/dist-esm/createTLSchema.mjs +8 -1
  20. package/dist-esm/createTLSchema.mjs.map +2 -2
  21. package/dist-esm/index.d.mts +211 -28
  22. package/dist-esm/index.mjs +17 -1
  23. package/dist-esm/index.mjs.map +2 -2
  24. package/dist-esm/records/TLUser.mjs +85 -0
  25. package/dist-esm/records/TLUser.mjs.map +7 -0
  26. package/dist-esm/shapes/TLNoteShape.mjs +13 -2
  27. package/dist-esm/shapes/TLNoteShape.mjs.map +2 -2
  28. package/package.json +6 -6
  29. package/src/TLStore.test.ts +5 -0
  30. package/src/TLStore.ts +95 -1
  31. package/src/createPresenceStateDerivation.test.ts +33 -20
  32. package/src/createPresenceStateDerivation.ts +20 -25
  33. package/src/createTLSchema.ts +52 -0
  34. package/src/index.ts +13 -1
  35. package/src/migrations.test.ts +22 -0
  36. package/src/records/TLRecord.ts +2 -0
  37. package/src/records/TLUser.ts +148 -0
  38. package/src/shapes/TLNoteShape.ts +13 -0
@@ -718,6 +718,32 @@ export declare function createBindingValidator<Type extends string, Props extend
718
718
  [K in keyof Meta]: T.Validatable<Meta[K]>;
719
719
  }): T.ObjectValidator<Expand< { [P in "fromId" | "id" | "meta" | "toId" | "typeName" | (undefined extends Props ? never : "props") | (undefined extends Type ? never : "type")]: TLBaseBinding<Type, Props>[P]; } & { [P in (undefined extends Props ? "props" : never) | (undefined extends Type ? "type" : never)]?: TLBaseBinding<Type, Props>[P] | undefined; }>>;
720
720
 
721
+ /**
722
+ * Create a cached {@link TLUserStore.resolve} implementation.
723
+ *
724
+ * Wraps a reactive lookup function so that each `userId` gets a single
725
+ * stable {@link @tldraw/state#Signal | Signal} that is reused across calls.
726
+ * The `resolveFn` is evaluated inside a `computed`, so any `.get()` calls
727
+ * it makes are automatically tracked.
728
+ *
729
+ * @param resolveFn - A function that resolves a raw user-ID string to a
730
+ * {@link TLUser} or `null`. Called reactively inside a `computed`.
731
+ * @returns A function suitable for use as `TLUserStore.resolve`.
732
+ *
733
+ * @example
734
+ * ```ts
735
+ * const users: TLUserStore = {
736
+ * currentUser: currentUserSignal,
737
+ * resolve: createCachedUserResolve(
738
+ * (userId) => usersAtom.get()[createUserId(userId)] ?? null
739
+ * ),
740
+ * }
741
+ * ```
742
+ *
743
+ * @public
744
+ */
745
+ export declare function createCachedUserResolve(resolveFn: (userId: string) => null | TLUser): (userId: string) => Signal<null | TLUser>;
746
+
721
747
  /**
722
748
  * Creates a unique ID for a custom record type.
723
749
  *
@@ -802,8 +828,8 @@ export declare function createCustomRecordMigrationSequence(migrations: TLPropsM
802
828
  * position, selected shapes, camera position, and user metadata that gets synchronized in
803
829
  * multiplayer scenarios.
804
830
  *
805
- * @param $user - A reactive signal containing the user information
806
- * @param instanceId - Optional custom instance ID. If not provided, one will be generated based on the store ID
831
+ * @param $user - A reactive signal containing the user information, or `null` when anonymous
832
+ * @param opts - Optional configuration for instance ID and presence derivation
807
833
  * @returns A function that takes a store and returns a computed signal of the user's presence state
808
834
  *
809
835
  * @example
@@ -811,7 +837,7 @@ export declare function createCustomRecordMigrationSequence(migrations: TLPropsM
811
837
  * import { createPresenceStateDerivation } from '@tldraw/tlschema'
812
838
  * import { atom } from '@tldraw/state'
813
839
  *
814
- * const userSignal = atom('user', { id: 'user-123', name: 'Alice', color: '#ff0000' })
840
+ * const userSignal = atom('user', { id: 'user-123', name: 'Alice', color: '#ff0000', meta: {} })
815
841
  * const presenceDerivation = createPresenceStateDerivation(userSignal)
816
842
  *
817
843
  * // Use with a store to get reactive presence state
@@ -821,7 +847,18 @@ export declare function createCustomRecordMigrationSequence(migrations: TLPropsM
821
847
  *
822
848
  * @public
823
849
  */
824
- export declare function createPresenceStateDerivation($user: Signal<TLPresenceUserInfo>, instanceId?: TLInstancePresence['id']): (store: TLStore) => Signal<null | TLInstancePresence, unknown>;
850
+ export declare function createPresenceStateDerivation($user: Signal<null | TLUser>, opts?: CreatePresenceStateDerivationOpts): (store: TLStore) => Signal<null | TLInstancePresence, unknown>;
851
+
852
+ /** @public */
853
+ export declare interface CreatePresenceStateDerivationOpts {
854
+ /** Custom instance ID. If not provided, one is generated from the store ID. */
855
+ instanceId?: TLInstancePresence['id'];
856
+ /**
857
+ * Override how presence state is built from the store and current user.
858
+ * Defaults to {@link getDefaultUserPresence}.
859
+ */
860
+ getUserPresence?(store: TLStore, user: TLUser): null | TLPresenceStateInfo;
861
+ }
825
862
 
826
863
  /**
827
864
  * Creates a new shape ID.
@@ -965,6 +1002,7 @@ export declare function createShapeValidator<Type extends string, Props extends
965
1002
  * @param options - Configuration options for the schema
966
1003
  * - shapes - Shape schema configurations. Defaults to defaultShapeSchemas if not provided
967
1004
  * - bindings - Binding schema configurations. Defaults to defaultBindingSchemas if not provided
1005
+ * - user - Custom user record configuration with meta validators and migrations
968
1006
  * - records - Custom record type configurations. These are additional record types beyond
969
1007
  * the built-in shapes, bindings, assets, etc.
970
1008
  * - migrations - Additional migration sequences to include in the schema
@@ -990,6 +1028,16 @@ export declare function createShapeValidator<Type extends string, Props extends
990
1028
  * },
991
1029
  * })
992
1030
  *
1031
+ * // Create schema with custom user metadata
1032
+ * const schemaWithCustomUser = createTLSchema({
1033
+ * user: {
1034
+ * meta: {
1035
+ * isAdmin: T.boolean,
1036
+ * department: T.string,
1037
+ * },
1038
+ * },
1039
+ * })
1040
+ *
993
1041
  * // Create schema with custom record types
994
1042
  * const schemaWithCustomRecords = createTLSchema({
995
1043
  * records: {
@@ -1014,13 +1062,47 @@ export declare function createShapeValidator<Type extends string, Props extends
1014
1062
  * })
1015
1063
  * ```
1016
1064
  */
1017
- export declare function createTLSchema({ shapes, bindings, records, migrations }?: {
1065
+ export declare function createTLSchema({ shapes, bindings, user, records, migrations }?: {
1018
1066
  bindings?: Record<string, SchemaPropsInfo>;
1019
1067
  migrations?: readonly MigrationSequence[];
1020
1068
  records?: Record<string, CustomRecordInfo>;
1021
1069
  shapes?: Record<string, SchemaPropsInfo>;
1070
+ user?: UserSchemaInfo;
1022
1071
  }): TLSchema;
1023
1072
 
1073
+ /** @public */
1074
+ export declare function createUserId(id: string): TLUserId;
1075
+
1076
+ /**
1077
+ * Creates a user record type with optional custom meta validation.
1078
+ *
1079
+ * When `meta` validators are provided, the user record's `meta` field will
1080
+ * validate those specific fields (when present) while still allowing
1081
+ * arbitrary additional JSON properties. Custom meta fields are treated as
1082
+ * optional so that user records created without them remain valid.
1083
+ *
1084
+ * @param config - Optional configuration for custom meta validators
1085
+ * @returns A configured user record type
1086
+ *
1087
+ * @example
1088
+ * ```ts
1089
+ * import { createUserRecordType } from '@tldraw/tlschema'
1090
+ * import { T } from '@tldraw/validate'
1091
+ *
1092
+ * const CustomUserRecordType = createUserRecordType({
1093
+ * meta: {
1094
+ * isAdmin: T.boolean,
1095
+ * department: T.string,
1096
+ * },
1097
+ * })
1098
+ * ```
1099
+ *
1100
+ * @public
1101
+ */
1102
+ export declare function createUserRecordType(config?: {
1103
+ meta?: Record<string, T.Validatable<any>>;
1104
+ }): RecordType<TLUser, never>;
1105
+
1024
1106
  /**
1025
1107
  * Configuration for a custom record type in the schema.
1026
1108
  *
@@ -1873,7 +1955,7 @@ export declare function getDefaultTranslationLocale(): TLLanguage['locale'];
1873
1955
  * ```ts
1874
1956
  * import { getDefaultUserPresence } from '@tldraw/tlschema'
1875
1957
  *
1876
- * const user = { id: 'user-123', name: 'Alice', color: '#ff0000' }
1958
+ * const user = { id: 'user-123', name: 'Alice', color: '#ff0000', meta: {} }
1877
1959
  * const presenceInfo = getDefaultUserPresence(store, user)
1878
1960
  *
1879
1961
  * if (presenceInfo) {
@@ -1897,7 +1979,7 @@ export declare function getDefaultTranslationLocale(): TLLanguage['locale'];
1897
1979
  *
1898
1980
  * @public
1899
1981
  */
1900
- export declare function getDefaultUserPresence(store: TLStore, user: TLPresenceUserInfo): {
1982
+ export declare function getDefaultUserPresence(store: TLStore, user: TLUser): {
1901
1983
  brush: BoxModel | null;
1902
1984
  camera: {
1903
1985
  x: number;
@@ -1919,7 +2001,7 @@ export declare function getDefaultUserPresence(store: TLStore, user: TLPresenceU
1919
2001
  screenBounds: BoxModel;
1920
2002
  scribbles: TLScribble[];
1921
2003
  selectedShapeIds: TLShapeId[];
1922
- userId: string;
2004
+ userId: TLUserId;
1923
2005
  userName: string;
1924
2006
  } | null;
1925
2007
 
@@ -2249,6 +2331,9 @@ export declare function isShape(record?: UnknownRecord): record is TLShape;
2249
2331
  */
2250
2332
  export declare function isShapeId(id?: string): id is TLShapeId;
2251
2333
 
2334
+ /** @public */
2335
+ export declare function isUserId(id: string): id is TLUserId;
2336
+
2252
2337
  /** @public */
2253
2338
  export declare const LANGUAGES: readonly [{
2254
2339
  readonly label: "Bahasa Indonesia";
@@ -4197,7 +4282,7 @@ export declare type TLDefaultHorizontalAlignStyle = T.TypeOf<typeof DefaultHoriz
4197
4282
  *
4198
4283
  * @public
4199
4284
  */
4200
- export declare type TLDefaultRecord = TLAsset | TLBinding | TLCamera | TLDocument | TLInstance | TLInstancePageState | TLInstancePresence | TLPage | TLPointer | TLShape;
4285
+ export declare type TLDefaultRecord = TLAsset | TLBinding | TLCamera | TLDocument | TLInstance | TLInstancePageState | TLInstancePresence | TLPage | TLPointer | TLShape | TLUser;
4201
4286
 
4202
4287
  /**
4203
4288
  * The default set of shapes that are available in the editor.
@@ -5390,6 +5475,8 @@ export declare interface TLNoteShapeProps {
5390
5475
  richText: TLRichText;
5391
5476
  /** Scale factor applied to the note shape for display */
5392
5477
  scale: number;
5478
+ /** User ID of the person who first edited the note text */
5479
+ textFirstEditedBy: null | string;
5393
5480
  }
5394
5481
 
5395
5482
  /**
@@ -5546,25 +5633,6 @@ export declare type TLPointerId = RecordId<TLPointer>;
5546
5633
  */
5547
5634
  export declare type TLPresenceStateInfo = Parameters<(typeof InstancePresenceRecordType)['create']>[0];
5548
5635
 
5549
- /**
5550
- * The information about a user which is used for multiplayer features.
5551
- * @public
5552
- */
5553
- export declare interface TLPresenceUserInfo {
5554
- /**
5555
- * id - A unique identifier for the user. This should be the same across all devices and sessions.
5556
- */
5557
- id: string;
5558
- /**
5559
- * The user's display name.
5560
- */
5561
- name?: null | string;
5562
- /**
5563
- * The user's color. If not given, a random color will be assigned.
5564
- */
5565
- color?: null | string;
5566
- }
5567
-
5568
5636
  /**
5569
5637
  * A migration definition for shape or record properties.
5570
5638
  *
@@ -5968,6 +6036,8 @@ export declare interface TLStoreProps {
5968
6036
  defaultName: string;
5969
6037
  /** Asset store implementation for handling file uploads and storage */
5970
6038
  assets: Required<TLAssetStore>;
6039
+ /** User store implementation for user resolution and attribution */
6040
+ users: Required<TLUserStore>;
5971
6041
  /**
5972
6042
  * Called when an {@link @tldraw/editor#Editor} connected to this store is mounted.
5973
6043
  * Can optionally return a cleanup function that will be called when unmounted.
@@ -6119,6 +6189,82 @@ export declare type TLUnknownBinding = TLBaseBinding<string, object>;
6119
6189
  */
6120
6190
  export declare type TLUnknownShape = TLBaseShape<string, object>;
6121
6191
 
6192
+ /**
6193
+ * A user record in a tldraw store. User records are document-scoped and
6194
+ * persist alongside shapes, assets, and pages. They are automatically
6195
+ * included in snapshots, clipboard content, and `.tldr` files so that
6196
+ * attribution display names survive across boards and sessions.
6197
+ *
6198
+ * User records are populated from the {@link @tldraw/tlschema#TLUserStore}
6199
+ * when the editor stamps attribution metadata onto shapes.
6200
+ *
6201
+ * Extend user records with custom metadata by passing validators to
6202
+ * {@link @tldraw/tlschema#createTLSchema} or {@link createUserRecordType}.
6203
+ *
6204
+ * @public
6205
+ */
6206
+ export declare interface TLUser extends BaseRecord<'user', TLUserId> {
6207
+ name: string;
6208
+ color: string;
6209
+ imageUrl: string;
6210
+ meta: JsonObject;
6211
+ }
6212
+
6213
+ /** @public */
6214
+ export declare type TLUserId = RecordId<TLUser>;
6215
+
6216
+ /**
6217
+ * Interface for resolving user information in tldraw.
6218
+ *
6219
+ * A `TLUserStore` sits alongside the main {@link TLStore} and provides user
6220
+ * resolution for attribution labels and display names. Implement this interface
6221
+ * to connect tldraw to your auth/user system.
6222
+ *
6223
+ * `currentUser` and `resolve` are reactive {@link @tldraw/state#Signal | Signals}
6224
+ * so that the editor can automatically track changes to user data and
6225
+ * re-render when a user's name, color, or avatar updates.
6226
+ *
6227
+ * Implementations should cache signals returned by `resolve` — e.g. return the
6228
+ * same `Signal` for repeated calls with the same `userId` — to avoid
6229
+ * unnecessary re-computation.
6230
+ *
6231
+ * @public
6232
+ * @example
6233
+ * ```ts
6234
+ * const currentUser = computed('currentUser', () =>
6235
+ * UserRecordType.create({
6236
+ * id: createUserId(myAuth.userId),
6237
+ * name: myAuth.displayName,
6238
+ * color: myAuth.color,
6239
+ * })
6240
+ * )
6241
+ *
6242
+ * const userStore: TLUserStore = {
6243
+ * currentUser,
6244
+ * resolve(userId) {
6245
+ * return computed('resolve-' + userId, () =>
6246
+ * myUserCache.get(userId) ?? null
6247
+ * )
6248
+ * },
6249
+ * }
6250
+ * ```
6251
+ */
6252
+ export declare interface TLUserStore {
6253
+ /**
6254
+ * A signal resolving to the currently authenticated user,
6255
+ * or `null` for anonymous / unknown.
6256
+ * Read when stamping attribution on shape create/update.
6257
+ */
6258
+ currentUser: Signal<null | TLUser>;
6259
+ /**
6260
+ * Return a signal resolving an arbitrary user ID to display info.
6261
+ * Called when rendering attribution labels for shapes that may have been
6262
+ * created or edited by someone else.
6263
+ * The signal's value should be `null` if the user cannot be resolved.
6264
+ */
6265
+ resolve?(userId: string): Signal<null | TLUser>;
6266
+ }
6267
+
6122
6268
  /**
6123
6269
  * An asset record representing video files that can be displayed in video shapes.
6124
6270
  * Video assets store metadata about video files including dimensions, MIME type,
@@ -6257,6 +6403,43 @@ export declare interface TLVideoShapeProps {
6257
6403
  */
6258
6404
  export declare function toRichText(text: string): TLRichText;
6259
6405
 
6406
+ /** @public */
6407
+ export declare const userIdValidator: T.Validator<TLUserId>;
6408
+
6409
+ /** @public */
6410
+ export declare const UserRecordType: RecordType<TLUser, never>;
6411
+
6412
+ /**
6413
+ * Configuration for extending the user record type with custom metadata
6414
+ * validators and migration sequences.
6415
+ *
6416
+ * @example
6417
+ * ```ts
6418
+ * import { T } from '@tldraw/validate'
6419
+ *
6420
+ * const userSchema: UserSchemaInfo = {
6421
+ * meta: {
6422
+ * isAdmin: T.boolean,
6423
+ * department: T.string,
6424
+ * },
6425
+ * }
6426
+ * ```
6427
+ *
6428
+ * @public
6429
+ */
6430
+ export declare interface UserSchemaInfo {
6431
+ /**
6432
+ * Validators for custom metadata fields on user records. Each field is
6433
+ * treated as optional — user records without these fields remain valid,
6434
+ * but when present, values are validated against the provided validators.
6435
+ */
6436
+ meta?: Record<string, T.Validatable<any>>;
6437
+ /**
6438
+ * Additional migration sequences for evolving custom user data over time.
6439
+ */
6440
+ migrations?: readonly MigrationSequence[];
6441
+ }
6442
+
6260
6443
  /**
6261
6444
  * A serializable model for 2D vectors.
6262
6445
  *
package/dist-cjs/index.js CHANGED
@@ -53,6 +53,7 @@ __export(index_exports, {
53
53
  TL_CURSOR_TYPES: () => import_TLCursor.TL_CURSOR_TYPES,
54
54
  TL_HANDLE_TYPES: () => import_TLHandle.TL_HANDLE_TYPES,
55
55
  TL_SCRIBBLE_STATES: () => import_TLScribble.TL_SCRIBBLE_STATES,
56
+ UserRecordType: () => import_TLUser.UserRecordType,
56
57
  arrowBindingMigrations: () => import_TLArrowBinding.arrowBindingMigrations,
57
58
  arrowBindingProps: () => import_TLArrowBinding.arrowBindingProps,
58
59
  arrowBindingVersions: () => import_TLArrowBinding.arrowBindingVersions,
@@ -74,6 +75,7 @@ __export(index_exports, {
74
75
  createBindingPropsMigrationIds: () => import_TLBinding.createBindingPropsMigrationIds,
75
76
  createBindingPropsMigrationSequence: () => import_TLBinding.createBindingPropsMigrationSequence,
76
77
  createBindingValidator: () => import_TLBaseBinding.createBindingValidator,
78
+ createCachedUserResolve: () => import_TLStore.createCachedUserResolve,
77
79
  createCustomRecordId: () => import_TLCustomRecord.createCustomRecordId,
78
80
  createCustomRecordMigrationIds: () => import_TLCustomRecord.createCustomRecordMigrationIds,
79
81
  createCustomRecordMigrationSequence: () => import_TLCustomRecord.createCustomRecordMigrationSequence,
@@ -83,6 +85,8 @@ __export(index_exports, {
83
85
  createShapePropsMigrationSequence: () => import_TLShape.createShapePropsMigrationSequence,
84
86
  createShapeValidator: () => import_TLBaseShape.createShapeValidator,
85
87
  createTLSchema: () => import_createTLSchema.createTLSchema,
88
+ createUserId: () => import_TLUser.createUserId,
89
+ createUserRecordType: () => import_TLUser.createUserRecordType,
86
90
  defaultBindingSchemas: () => import_createTLSchema.defaultBindingSchemas,
87
91
  defaultColorNames: () => import_TLColorStyle.defaultColorNames,
88
92
  defaultShapeSchemas: () => import_createTLSchema.defaultShapeSchemas,
@@ -114,6 +118,7 @@ __export(index_exports, {
114
118
  isPageId: () => import_TLPage.isPageId,
115
119
  isShape: () => import_TLShape.isShape,
116
120
  isShapeId: () => import_TLShape.isShapeId,
121
+ isUserId: () => import_TLUser.isUserId,
117
122
  lineShapeMigrations: () => import_TLLineShape.lineShapeMigrations,
118
123
  lineShapeProps: () => import_TLLineShape.lineShapeProps,
119
124
  noteShapeMigrations: () => import_TLNoteShape.noteShapeMigrations,
@@ -130,6 +135,7 @@ __export(index_exports, {
130
135
  textShapeMigrations: () => import_TLTextShape.textShapeMigrations,
131
136
  textShapeProps: () => import_TLTextShape.textShapeProps,
132
137
  toRichText: () => import_TLRichText.toRichText,
138
+ userIdValidator: () => import_TLUser.userIdValidator,
133
139
  vecModelValidator: () => import_geometry_types.vecModelValidator,
134
140
  videoShapeMigrations: () => import_TLVideoShape.videoShapeMigrations,
135
141
  videoShapeProps: () => import_TLVideoShape.videoShapeProps
@@ -160,6 +166,7 @@ var import_TLPageState = require("./records/TLPageState");
160
166
  var import_TLPointer = require("./records/TLPointer");
161
167
  var import_TLPresence = require("./records/TLPresence");
162
168
  var import_TLShape = require("./records/TLShape");
169
+ var import_TLUser = require("./records/TLUser");
163
170
  var import_TLArrowShape = require("./shapes/TLArrowShape");
164
171
  var import_TLBaseShape = require("./shapes/TLBaseShape");
165
172
  var import_TLBookmarkShape = require("./shapes/TLBookmarkShape");
@@ -183,11 +190,12 @@ var import_TLHorizontalAlignStyle = require("./styles/TLHorizontalAlignStyle");
183
190
  var import_TLSizeStyle = require("./styles/TLSizeStyle");
184
191
  var import_TLTextAlignStyle = require("./styles/TLTextAlignStyle");
185
192
  var import_TLVerticalAlignStyle = require("./styles/TLVerticalAlignStyle");
193
+ var import_TLStore = require("./TLStore");
186
194
  var import_translations = require("./translations/translations");
187
195
  var import_b64Vecs = require("./misc/b64Vecs");
188
196
  (0, import_utils.registerTldrawLibraryVersion)(
189
197
  "@tldraw/tlschema",
190
- "4.6.0-next.d15997ff5a4b",
198
+ "4.6.0-next.d8328a2dcc3d",
191
199
  "cjs"
192
200
  );
193
201
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["/**\n * @fileoverview\n * Main entry point for the tldraw schema package. Exports the complete type system,\n * data structures, validation, and migrations for tldraw's persisted data.\n *\n * This package provides:\n * - Schema creation utilities (createTLSchema, defaultShapeSchemas, defaultBindingSchemas)\n * - All built-in shape types (TLGeoShape, TLTextShape, TLArrowShape, etc.)\n * - Asset management types and validators (TLImageAsset, TLVideoAsset, TLBookmarkAsset)\n * - Binding system for shape relationships (TLArrowBinding)\n * - Store integration types (TLStore, TLStoreProps, TLStoreSnapshot)\n * - Style properties for consistent styling (DefaultColorStyle, DefaultSizeStyle, etc.)\n * - Validation utilities and type guards\n * - Migration systems for schema evolution\n * - Geometry and utility types\n *\n * @example\n * ```ts\n * import { createTLSchema, defaultShapeSchemas, TLStore } from '@tldraw/tlschema'\n *\n * // Create a schema with default shapes\n * const schema = createTLSchema({\n * shapes: defaultShapeSchemas\n * })\n *\n * // Use with a store\n * const store = new Store({ schema })\n * ```\n *\n * @public\n */\n\nimport { registerTldrawLibraryVersion } from '@tldraw/utils'\nexport { assetIdValidator, createAssetValidator, type TLBaseAsset } from './assets/TLBaseAsset'\nexport { type TLBookmarkAsset } from './assets/TLBookmarkAsset'\nexport { type TLImageAsset } from './assets/TLImageAsset'\nexport { type TLVideoAsset } from './assets/TLVideoAsset'\nexport {\n\tarrowBindingMigrations,\n\tarrowBindingProps,\n\tarrowBindingVersions,\n\tElbowArrowSnap,\n\ttype TLArrowBinding,\n\ttype TLArrowBindingProps,\n} from './bindings/TLArrowBinding'\nexport {\n\tbindingIdValidator,\n\tcreateBindingValidator,\n\ttype TLBaseBinding,\n} from './bindings/TLBaseBinding'\nexport {\n\tcreatePresenceStateDerivation,\n\tgetDefaultUserPresence,\n\ttype TLPresenceStateInfo,\n\ttype TLPresenceUserInfo,\n} from './createPresenceStateDerivation'\nexport {\n\tcreateTLSchema,\n\tdefaultBindingSchemas,\n\tdefaultShapeSchemas,\n\ttype SchemaPropsInfo,\n\ttype TLSchema,\n} from './createTLSchema'\nexport {\n\tboxModelValidator,\n\tvecModelValidator,\n\ttype BoxModel,\n\ttype VecModel,\n} from './misc/geometry-types'\nexport { idValidator } from './misc/id-validator'\nexport {\n\tcanvasUiColorTypeValidator,\n\tTL_CANVAS_UI_COLOR_TYPES,\n\ttype TLCanvasUiColor,\n} from './misc/TLColor'\nexport { TL_CURSOR_TYPES, type TLCursor, type TLCursorType } from './misc/TLCursor'\nexport { TL_HANDLE_TYPES, type TLHandle, type TLHandleType } from './misc/TLHandle'\nexport { opacityValidator, type TLOpacityType } from './misc/TLOpacity'\nexport { richTextValidator, toRichText, type TLRichText } from './misc/TLRichText'\nexport { scribbleValidator, TL_SCRIBBLE_STATES, type TLScribble } from './misc/TLScribble'\nexport {\n\tassetMigrations,\n\tAssetRecordType,\n\tassetValidator,\n\ttype TLAsset,\n\ttype TLAssetId,\n\ttype TLAssetPartial,\n\ttype TLAssetShape,\n} from './records/TLAsset'\nexport {\n\tcreateBindingId,\n\tcreateBindingPropsMigrationIds,\n\tcreateBindingPropsMigrationSequence,\n\tisBinding,\n\tisBindingId,\n\trootBindingMigrations,\n\ttype TLBinding,\n\ttype TLBindingCreate,\n\ttype TLBindingId,\n\ttype TLBindingUpdate,\n\ttype TLDefaultBinding,\n\ttype TLGlobalBindingPropsMap,\n\ttype TLIndexedBindings,\n\ttype TLUnknownBinding,\n} from './records/TLBinding'\nexport { CameraRecordType, type TLCamera, type TLCameraId } from './records/TLCamera'\nexport {\n\tcreateCustomRecordId,\n\tcreateCustomRecordMigrationIds,\n\tcreateCustomRecordMigrationSequence,\n\tisCustomRecord,\n\tisCustomRecordId,\n\ttype CustomRecordInfo,\n} from './records/TLCustomRecord'\nexport {\n\tDocumentRecordType,\n\tisDocument,\n\tTLDOCUMENT_ID,\n\ttype TLDocument,\n} from './records/TLDocument'\nexport {\n\tpluckPreservingValues,\n\tTLINSTANCE_ID,\n\ttype TLInstance,\n\ttype TLInstanceId,\n} from './records/TLInstance'\nexport {\n\tisPageId,\n\tpageIdValidator,\n\tPageRecordType,\n\ttype TLPage,\n\ttype TLPageId,\n} from './records/TLPage'\nexport {\n\tInstancePageStateRecordType,\n\ttype TLInstancePageState,\n\ttype TLInstancePageStateId,\n} from './records/TLPageState'\nexport {\n\tPointerRecordType,\n\tTLPOINTER_ID,\n\ttype TLPointer,\n\ttype TLPointerId,\n} from './records/TLPointer'\nexport {\n\tInstancePresenceRecordType,\n\ttype TLInstancePresence,\n\ttype TLInstancePresenceID,\n} from './records/TLPresence'\nexport {\n\ttype TLCustomRecord,\n\ttype TLDefaultRecord,\n\ttype TLGlobalRecordPropsMap,\n\ttype TLIndexedRecords,\n\ttype TLRecord,\n} from './records/TLRecord'\nexport {\n\tcreateShapeId,\n\tcreateShapePropsMigrationIds,\n\tcreateShapePropsMigrationSequence,\n\tgetShapePropKeysByStyle,\n\tisShape,\n\tisShapeId,\n\trootShapeMigrations,\n\ttype ExtractShapeByProps,\n\ttype TLCreateShapePartial,\n\ttype TLDefaultShape,\n\ttype TLGlobalShapePropsMap,\n\ttype TLIndexedShapes,\n\ttype TLParentId,\n\ttype TLShape,\n\ttype TLShapeId,\n\ttype TLShapePartial,\n\ttype TLUnknownShape,\n} from './records/TLShape'\nexport {\n\ttype RecordProps,\n\ttype RecordPropsType,\n\ttype TLPropsMigration,\n\ttype TLPropsMigrations,\n} from './recordsWithProps'\nexport { type ShapeWithCrop, type TLShapeCrop } from './shapes/ShapeWithCrop'\nexport {\n\tArrowShapeArrowheadEndStyle,\n\tArrowShapeArrowheadStartStyle,\n\tArrowShapeKindStyle,\n\tarrowShapeMigrations,\n\tarrowShapeProps,\n\tarrowShapeVersions,\n\ttype TLArrowShape,\n\ttype TLArrowShapeArrowheadStyle,\n\ttype TLArrowShapeKind,\n\ttype TLArrowShapeProps,\n} from './shapes/TLArrowShape'\nexport {\n\tcreateShapeValidator,\n\tparentIdValidator,\n\tshapeIdValidator,\n\ttype TLBaseShape,\n} from './shapes/TLBaseShape'\nexport {\n\tbookmarkShapeMigrations,\n\tbookmarkShapeProps,\n\ttype TLBookmarkShape,\n\ttype TLBookmarkShapeProps,\n} from './shapes/TLBookmarkShape'\nexport {\n\tcompressLegacySegments,\n\tdrawShapeMigrations,\n\tdrawShapeProps,\n\ttype TLDrawShape,\n\ttype TLDrawShapeProps,\n\ttype TLDrawShapeSegment,\n} from './shapes/TLDrawShape'\nexport {\n\tembedShapeMigrations,\n\tembedShapeProps,\n\ttype TLEmbedShape,\n\ttype TLEmbedShapeProps,\n} from './shapes/TLEmbedShape'\nexport {\n\tframeShapeMigrations,\n\tframeShapeProps,\n\ttype TLFrameShape,\n\ttype TLFrameShapeProps,\n} from './shapes/TLFrameShape'\nexport {\n\tGeoShapeGeoStyle,\n\tgeoShapeMigrations,\n\tgeoShapeProps,\n\ttype TLGeoShape,\n\ttype TLGeoShapeGeoStyle,\n\ttype TLGeoShapeProps,\n} from './shapes/TLGeoShape'\nexport {\n\tgroupShapeMigrations,\n\tgroupShapeProps,\n\ttype TLGroupShape,\n\ttype TLGroupShapeProps,\n} from './shapes/TLGroupShape'\nexport {\n\thighlightShapeMigrations,\n\thighlightShapeProps,\n\ttype TLHighlightShape,\n\ttype TLHighlightShapeProps,\n} from './shapes/TLHighlightShape'\nexport {\n\tImageShapeCrop,\n\timageShapeMigrations,\n\timageShapeProps,\n\ttype TLImageShape,\n\ttype TLImageShapeProps,\n} from './shapes/TLImageShape'\nexport {\n\tlineShapeMigrations,\n\tlineShapeProps,\n\tLineShapeSplineStyle,\n\ttype TLLineShape,\n\ttype TLLineShapePoint,\n\ttype TLLineShapeProps,\n\ttype TLLineShapeSplineStyle,\n} from './shapes/TLLineShape'\nexport {\n\tnoteShapeMigrations,\n\tnoteShapeProps,\n\ttype TLNoteShape,\n\ttype TLNoteShapeProps,\n} from './shapes/TLNoteShape'\nexport {\n\ttextShapeMigrations,\n\ttextShapeProps,\n\ttype TLTextShape,\n\ttype TLTextShapeProps,\n} from './shapes/TLTextShape'\nexport {\n\tvideoShapeMigrations,\n\tvideoShapeProps,\n\ttype TLVideoShape,\n\ttype TLVideoShapeProps,\n} from './shapes/TLVideoShape'\nexport { EnumStyleProp, StyleProp, type StylePropValue } from './styles/StyleProp'\nexport {\n\tdefaultColorNames,\n\tDefaultColorStyle,\n\tDefaultColorThemePalette,\n\tDefaultLabelColorStyle,\n\tgetColorValue,\n\tgetDefaultColorTheme,\n\ttype TLDefaultColorStyle,\n\ttype TLDefaultColorTheme,\n\ttype TLDefaultColorThemeColor,\n} from './styles/TLColorStyle'\nexport { DefaultDashStyle, type TLDefaultDashStyle } from './styles/TLDashStyle'\nexport { DefaultFillStyle, type TLDefaultFillStyle } from './styles/TLFillStyle'\nexport {\n\tDefaultFontFamilies,\n\tDefaultFontStyle,\n\ttype TLDefaultFontStyle,\n} from './styles/TLFontStyle'\nexport {\n\tDefaultHorizontalAlignStyle,\n\ttype TLDefaultHorizontalAlignStyle,\n} from './styles/TLHorizontalAlignStyle'\nexport { DefaultSizeStyle, type TLDefaultSizeStyle } from './styles/TLSizeStyle'\nexport { DefaultTextAlignStyle, type TLDefaultTextAlignStyle } from './styles/TLTextAlignStyle'\nexport {\n\tDefaultVerticalAlignStyle,\n\ttype TLDefaultVerticalAlignStyle,\n} from './styles/TLVerticalAlignStyle'\nexport {\n\ttype TLAssetContext,\n\ttype TLAssetStore,\n\ttype TLSerializedStore,\n\ttype TLStore,\n\ttype TLStoreProps,\n\ttype TLStoreSchema,\n\ttype TLStoreSnapshot,\n} from './TLStore'\nexport {\n\tgetDefaultTranslationLocale,\n\tLANGUAGES,\n\ttype TLLanguage,\n} from './translations/translations'\nexport { type SetValue } from './util-types'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n\nexport { b64Vecs } from './misc/b64Vecs'\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCA,mBAA6C;AAC7C,yBAAyE;AAIzE,4BAOO;AACP,2BAIO;AACP,2CAKO;AACP,4BAMO;AACP,4BAKO;AACP,0BAA4B;AAC5B,qBAIO;AACP,sBAAkE;AAClE,sBAAkE;AAClE,uBAAqD;AACrD,wBAA+D;AAC/D,wBAAuE;AACvE,qBAQO;AACP,uBAeO;AACP,sBAAiE;AACjE,4BAOO;AACP,wBAKO;AACP,wBAKO;AACP,oBAMO;AACP,yBAIO;AACP,uBAKO;AACP,wBAIO;AAQP,qBAkBO;AAQP,0BAWO;AACP,yBAKO;AACP,6BAKO;AACP,yBAOO;AACP,0BAKO;AACP,0BAKO;AACP,wBAOO;AACP,0BAKO;AACP,8BAKO;AACP,0BAMO;AACP,yBAQO;AACP,yBAKO;AACP,yBAKO;AACP,0BAKO;AACP,uBAA8D;AAC9D,0BAUO;AACP,yBAA0D;AAC1D,yBAA0D;AAC1D,yBAIO;AACP,oCAGO;AACP,yBAA0D;AAC1D,8BAAoE;AACpE,kCAGO;AAUP,0BAIO;AASP,qBAAwB;AAAA,IANxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["/**\n * @fileoverview\n * Main entry point for the tldraw schema package. Exports the complete type system,\n * data structures, validation, and migrations for tldraw's persisted data.\n *\n * This package provides:\n * - Schema creation utilities (createTLSchema, defaultShapeSchemas, defaultBindingSchemas)\n * - All built-in shape types (TLGeoShape, TLTextShape, TLArrowShape, etc.)\n * - Asset management types and validators (TLImageAsset, TLVideoAsset, TLBookmarkAsset)\n * - Binding system for shape relationships (TLArrowBinding)\n * - Store integration types (TLStore, TLStoreProps, TLStoreSnapshot)\n * - Style properties for consistent styling (DefaultColorStyle, DefaultSizeStyle, etc.)\n * - Validation utilities and type guards\n * - Migration systems for schema evolution\n * - Geometry and utility types\n *\n * @example\n * ```ts\n * import { createTLSchema, defaultShapeSchemas, TLStore } from '@tldraw/tlschema'\n *\n * // Create a schema with default shapes\n * const schema = createTLSchema({\n * shapes: defaultShapeSchemas\n * })\n *\n * // Use with a store\n * const store = new Store({ schema })\n * ```\n *\n * @public\n */\n\nimport { registerTldrawLibraryVersion } from '@tldraw/utils'\nexport { assetIdValidator, createAssetValidator, type TLBaseAsset } from './assets/TLBaseAsset'\nexport { type TLBookmarkAsset } from './assets/TLBookmarkAsset'\nexport { type TLImageAsset } from './assets/TLImageAsset'\nexport { type TLVideoAsset } from './assets/TLVideoAsset'\nexport {\n\tarrowBindingMigrations,\n\tarrowBindingProps,\n\tarrowBindingVersions,\n\tElbowArrowSnap,\n\ttype TLArrowBinding,\n\ttype TLArrowBindingProps,\n} from './bindings/TLArrowBinding'\nexport {\n\tbindingIdValidator,\n\tcreateBindingValidator,\n\ttype TLBaseBinding,\n} from './bindings/TLBaseBinding'\nexport {\n\tcreatePresenceStateDerivation,\n\tgetDefaultUserPresence,\n\ttype CreatePresenceStateDerivationOpts,\n\ttype TLPresenceStateInfo,\n} from './createPresenceStateDerivation'\nexport {\n\tcreateTLSchema,\n\tdefaultBindingSchemas,\n\tdefaultShapeSchemas,\n\ttype SchemaPropsInfo,\n\ttype TLSchema,\n\ttype UserSchemaInfo,\n} from './createTLSchema'\nexport {\n\tboxModelValidator,\n\tvecModelValidator,\n\ttype BoxModel,\n\ttype VecModel,\n} from './misc/geometry-types'\nexport { idValidator } from './misc/id-validator'\nexport {\n\tcanvasUiColorTypeValidator,\n\tTL_CANVAS_UI_COLOR_TYPES,\n\ttype TLCanvasUiColor,\n} from './misc/TLColor'\nexport { TL_CURSOR_TYPES, type TLCursor, type TLCursorType } from './misc/TLCursor'\nexport { TL_HANDLE_TYPES, type TLHandle, type TLHandleType } from './misc/TLHandle'\nexport { opacityValidator, type TLOpacityType } from './misc/TLOpacity'\nexport { richTextValidator, toRichText, type TLRichText } from './misc/TLRichText'\nexport { scribbleValidator, TL_SCRIBBLE_STATES, type TLScribble } from './misc/TLScribble'\nexport {\n\tassetMigrations,\n\tAssetRecordType,\n\tassetValidator,\n\ttype TLAsset,\n\ttype TLAssetId,\n\ttype TLAssetPartial,\n\ttype TLAssetShape,\n} from './records/TLAsset'\nexport {\n\tcreateBindingId,\n\tcreateBindingPropsMigrationIds,\n\tcreateBindingPropsMigrationSequence,\n\tisBinding,\n\tisBindingId,\n\trootBindingMigrations,\n\ttype TLBinding,\n\ttype TLBindingCreate,\n\ttype TLBindingId,\n\ttype TLBindingUpdate,\n\ttype TLDefaultBinding,\n\ttype TLGlobalBindingPropsMap,\n\ttype TLIndexedBindings,\n\ttype TLUnknownBinding,\n} from './records/TLBinding'\nexport { CameraRecordType, type TLCamera, type TLCameraId } from './records/TLCamera'\nexport {\n\tcreateCustomRecordId,\n\tcreateCustomRecordMigrationIds,\n\tcreateCustomRecordMigrationSequence,\n\tisCustomRecord,\n\tisCustomRecordId,\n\ttype CustomRecordInfo,\n} from './records/TLCustomRecord'\nexport {\n\tDocumentRecordType,\n\tisDocument,\n\tTLDOCUMENT_ID,\n\ttype TLDocument,\n} from './records/TLDocument'\nexport {\n\tpluckPreservingValues,\n\tTLINSTANCE_ID,\n\ttype TLInstance,\n\ttype TLInstanceId,\n} from './records/TLInstance'\nexport {\n\tisPageId,\n\tpageIdValidator,\n\tPageRecordType,\n\ttype TLPage,\n\ttype TLPageId,\n} from './records/TLPage'\nexport {\n\tInstancePageStateRecordType,\n\ttype TLInstancePageState,\n\ttype TLInstancePageStateId,\n} from './records/TLPageState'\nexport {\n\tPointerRecordType,\n\tTLPOINTER_ID,\n\ttype TLPointer,\n\ttype TLPointerId,\n} from './records/TLPointer'\nexport {\n\tInstancePresenceRecordType,\n\ttype TLInstancePresence,\n\ttype TLInstancePresenceID,\n} from './records/TLPresence'\nexport {\n\ttype TLCustomRecord,\n\ttype TLDefaultRecord,\n\ttype TLGlobalRecordPropsMap,\n\ttype TLIndexedRecords,\n\ttype TLRecord,\n} from './records/TLRecord'\nexport {\n\tcreateShapeId,\n\tcreateShapePropsMigrationIds,\n\tcreateShapePropsMigrationSequence,\n\tgetShapePropKeysByStyle,\n\tisShape,\n\tisShapeId,\n\trootShapeMigrations,\n\ttype ExtractShapeByProps,\n\ttype TLCreateShapePartial,\n\ttype TLDefaultShape,\n\ttype TLGlobalShapePropsMap,\n\ttype TLIndexedShapes,\n\ttype TLParentId,\n\ttype TLShape,\n\ttype TLShapeId,\n\ttype TLShapePartial,\n\ttype TLUnknownShape,\n} from './records/TLShape'\nexport {\n\tcreateUserId,\n\tcreateUserRecordType,\n\tisUserId,\n\tuserIdValidator,\n\tUserRecordType,\n\ttype TLUser,\n\ttype TLUserId,\n} from './records/TLUser'\nexport {\n\ttype RecordProps,\n\ttype RecordPropsType,\n\ttype TLPropsMigration,\n\ttype TLPropsMigrations,\n} from './recordsWithProps'\nexport { type ShapeWithCrop, type TLShapeCrop } from './shapes/ShapeWithCrop'\nexport {\n\tArrowShapeArrowheadEndStyle,\n\tArrowShapeArrowheadStartStyle,\n\tArrowShapeKindStyle,\n\tarrowShapeMigrations,\n\tarrowShapeProps,\n\tarrowShapeVersions,\n\ttype TLArrowShape,\n\ttype TLArrowShapeArrowheadStyle,\n\ttype TLArrowShapeKind,\n\ttype TLArrowShapeProps,\n} from './shapes/TLArrowShape'\nexport {\n\tcreateShapeValidator,\n\tparentIdValidator,\n\tshapeIdValidator,\n\ttype TLBaseShape,\n} from './shapes/TLBaseShape'\nexport {\n\tbookmarkShapeMigrations,\n\tbookmarkShapeProps,\n\ttype TLBookmarkShape,\n\ttype TLBookmarkShapeProps,\n} from './shapes/TLBookmarkShape'\nexport {\n\tcompressLegacySegments,\n\tdrawShapeMigrations,\n\tdrawShapeProps,\n\ttype TLDrawShape,\n\ttype TLDrawShapeProps,\n\ttype TLDrawShapeSegment,\n} from './shapes/TLDrawShape'\nexport {\n\tembedShapeMigrations,\n\tembedShapeProps,\n\ttype TLEmbedShape,\n\ttype TLEmbedShapeProps,\n} from './shapes/TLEmbedShape'\nexport {\n\tframeShapeMigrations,\n\tframeShapeProps,\n\ttype TLFrameShape,\n\ttype TLFrameShapeProps,\n} from './shapes/TLFrameShape'\nexport {\n\tGeoShapeGeoStyle,\n\tgeoShapeMigrations,\n\tgeoShapeProps,\n\ttype TLGeoShape,\n\ttype TLGeoShapeGeoStyle,\n\ttype TLGeoShapeProps,\n} from './shapes/TLGeoShape'\nexport {\n\tgroupShapeMigrations,\n\tgroupShapeProps,\n\ttype TLGroupShape,\n\ttype TLGroupShapeProps,\n} from './shapes/TLGroupShape'\nexport {\n\thighlightShapeMigrations,\n\thighlightShapeProps,\n\ttype TLHighlightShape,\n\ttype TLHighlightShapeProps,\n} from './shapes/TLHighlightShape'\nexport {\n\tImageShapeCrop,\n\timageShapeMigrations,\n\timageShapeProps,\n\ttype TLImageShape,\n\ttype TLImageShapeProps,\n} from './shapes/TLImageShape'\nexport {\n\tlineShapeMigrations,\n\tlineShapeProps,\n\tLineShapeSplineStyle,\n\ttype TLLineShape,\n\ttype TLLineShapePoint,\n\ttype TLLineShapeProps,\n\ttype TLLineShapeSplineStyle,\n} from './shapes/TLLineShape'\nexport {\n\tnoteShapeMigrations,\n\tnoteShapeProps,\n\ttype TLNoteShape,\n\ttype TLNoteShapeProps,\n} from './shapes/TLNoteShape'\nexport {\n\ttextShapeMigrations,\n\ttextShapeProps,\n\ttype TLTextShape,\n\ttype TLTextShapeProps,\n} from './shapes/TLTextShape'\nexport {\n\tvideoShapeMigrations,\n\tvideoShapeProps,\n\ttype TLVideoShape,\n\ttype TLVideoShapeProps,\n} from './shapes/TLVideoShape'\nexport { EnumStyleProp, StyleProp, type StylePropValue } from './styles/StyleProp'\nexport {\n\tdefaultColorNames,\n\tDefaultColorStyle,\n\tDefaultColorThemePalette,\n\tDefaultLabelColorStyle,\n\tgetColorValue,\n\tgetDefaultColorTheme,\n\ttype TLDefaultColorStyle,\n\ttype TLDefaultColorTheme,\n\ttype TLDefaultColorThemeColor,\n} from './styles/TLColorStyle'\nexport { DefaultDashStyle, type TLDefaultDashStyle } from './styles/TLDashStyle'\nexport { DefaultFillStyle, type TLDefaultFillStyle } from './styles/TLFillStyle'\nexport {\n\tDefaultFontFamilies,\n\tDefaultFontStyle,\n\ttype TLDefaultFontStyle,\n} from './styles/TLFontStyle'\nexport {\n\tDefaultHorizontalAlignStyle,\n\ttype TLDefaultHorizontalAlignStyle,\n} from './styles/TLHorizontalAlignStyle'\nexport { DefaultSizeStyle, type TLDefaultSizeStyle } from './styles/TLSizeStyle'\nexport { DefaultTextAlignStyle, type TLDefaultTextAlignStyle } from './styles/TLTextAlignStyle'\nexport {\n\tDefaultVerticalAlignStyle,\n\ttype TLDefaultVerticalAlignStyle,\n} from './styles/TLVerticalAlignStyle'\nexport {\n\tcreateCachedUserResolve,\n\ttype TLAssetContext,\n\ttype TLAssetStore,\n\ttype TLSerializedStore,\n\ttype TLStore,\n\ttype TLStoreProps,\n\ttype TLStoreSchema,\n\ttype TLStoreSnapshot,\n\ttype TLUserStore,\n} from './TLStore'\nexport {\n\tgetDefaultTranslationLocale,\n\tLANGUAGES,\n\ttype TLLanguage,\n} from './translations/translations'\nexport { type SetValue } from './util-types'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n\nexport { b64Vecs } from './misc/b64Vecs'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCA,mBAA6C;AAC7C,yBAAyE;AAIzE,4BAOO;AACP,2BAIO;AACP,2CAKO;AACP,4BAOO;AACP,4BAKO;AACP,0BAA4B;AAC5B,qBAIO;AACP,sBAAkE;AAClE,sBAAkE;AAClE,uBAAqD;AACrD,wBAA+D;AAC/D,wBAAuE;AACvE,qBAQO;AACP,uBAeO;AACP,sBAAiE;AACjE,4BAOO;AACP,wBAKO;AACP,wBAKO;AACP,oBAMO;AACP,yBAIO;AACP,uBAKO;AACP,wBAIO;AAQP,qBAkBO;AACP,oBAQO;AAQP,0BAWO;AACP,yBAKO;AACP,6BAKO;AACP,yBAOO;AACP,0BAKO;AACP,0BAKO;AACP,wBAOO;AACP,0BAKO;AACP,8BAKO;AACP,0BAMO;AACP,yBAQO;AACP,yBAKO;AACP,yBAKO;AACP,0BAKO;AACP,uBAA8D;AAC9D,0BAUO;AACP,yBAA0D;AAC1D,yBAA0D;AAC1D,yBAIO;AACP,oCAGO;AACP,yBAA0D;AAC1D,8BAAoE;AACpE,kCAGO;AACP,qBAUO;AACP,0BAIO;AASP,qBAAwB;AAAA,IANxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/records/TLRecord.ts"],
4
- "sourcesContent": ["import { TLAsset } from './TLAsset'\nimport { TLBinding } from './TLBinding'\nimport { TLCamera } from './TLCamera'\nimport { TLDocument } from './TLDocument'\nimport { TLInstance } from './TLInstance'\nimport { TLPage } from './TLPage'\nimport { TLInstancePageState } from './TLPageState'\nimport { TLPointer } from './TLPointer'\nimport { TLInstancePresence } from './TLPresence'\nimport { TLShape } from './TLShape'\n\n/**\n * Interface for extending tldraw with custom record types via TypeScript module augmentation.\n *\n * Custom record types allow you to add entirely new data types to the tldraw store that\n * don't fit into the existing shape, binding, or asset categories. Each key in this\n * interface becomes a new record type name, and the value should be your full record type.\n *\n * @example\n * ```ts\n * import { BaseRecord, RecordId } from '@tldraw/store'\n *\n * // Define your custom record type\n * interface TLComment extends BaseRecord<'comment', RecordId<TLComment>> {\n * text: string\n * shapeId: TLShapeId\n * authorId: string\n * createdAt: number\n * }\n *\n * // Augment the global record props map\n * declare module '@tldraw/tlschema' {\n * interface TLGlobalRecordPropsMap {\n * comment: TLComment\n * }\n * }\n *\n * // Now TLRecord includes your custom comment type\n * // and you can use it with createTLSchema()\n * ```\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface TLGlobalRecordPropsMap {}\n\n/**\n * Union type of all built-in tldraw record types.\n *\n * This includes persistent records (documents, pages, shapes, assets, bindings)\n * and session/presence records (cameras, instances, pointers, page states).\n *\n * @public\n */\nexport type TLDefaultRecord =\n\t| TLAsset\n\t| TLBinding\n\t| TLCamera\n\t| TLDocument\n\t| TLInstance\n\t| TLInstancePageState\n\t| TLPage\n\t| TLShape\n\t| TLInstancePresence\n\t| TLPointer\n\n/**\n * Index type that maps custom record type names to their record types.\n *\n * Similar to TLIndexedShapes and TLIndexedBindings, this type creates a mapping\n * from type name keys to their corresponding record types, filtering out any\n * disabled types (those set to null or undefined in TLGlobalRecordPropsMap).\n *\n * @public\n */\n// prettier-ignore\nexport type TLIndexedRecords = {\n\t[K in keyof TLGlobalRecordPropsMap as TLGlobalRecordPropsMap[K] extends null | undefined\n\t\t? never\n\t\t: K]: TLGlobalRecordPropsMap[K]\n}\n\n/**\n * Union type representing a custom record from the TLGlobalRecordPropsMap.\n *\n * @public\n */\nexport type TLCustomRecord = TLIndexedRecords[keyof TLIndexedRecords]\n\n/**\n * Union type representing all possible record types in a tldraw store.\n * This includes both persistent records (documents, pages, shapes, assets, bindings)\n * and session/presence records (cameras, instances, pointers, page states),\n * as well as any custom record types added via TLGlobalRecordPropsMap augmentation.\n *\n * Records are organized by scope:\n * - **document**: Persisted across sessions (shapes, pages, assets, bindings, documents)\n * - **session**: Local to current session (cameras, instances, page states)\n * - **presence**: Ephemeral user presence data (pointers, instance presence)\n *\n * @example\n * ```ts\n * // Function that works with any record type\n * function processRecord(record: TLRecord) {\n * switch (record.typeName) {\n * case 'shape':\n * console.log(`Shape: ${record.type} at (${record.x}, ${record.y})`)\n * break\n * case 'page':\n * console.log(`Page: ${record.name}`)\n * break\n * case 'asset':\n * console.log(`Asset: ${record.type}`)\n * break\n * case 'camera':\n * console.log(`Camera at (${record.x}, ${record.y}) zoom: ${record.z}`)\n * break\n * // ... handle other record types\n * }\n * }\n *\n * // Get all records from store\n * const allRecords: TLRecord[] = store.allRecords()\n *\n * // Filter by record type using type guards\n * import { isShape, isPage, isAsset } from '@tldraw/tlschema'\n * const shapes = allRecords.filter(isShape)\n * const pages = allRecords.filter(isPage)\n * const assets = allRecords.filter(isAsset)\n * ```\n *\n * @public\n */\nexport type TLRecord = TLDefaultRecord | TLCustomRecord\n"],
4
+ "sourcesContent": ["import { TLAsset } from './TLAsset'\nimport { TLBinding } from './TLBinding'\nimport { TLCamera } from './TLCamera'\nimport { TLDocument } from './TLDocument'\nimport { TLInstance } from './TLInstance'\nimport { TLPage } from './TLPage'\nimport { TLInstancePageState } from './TLPageState'\nimport { TLPointer } from './TLPointer'\nimport { TLInstancePresence } from './TLPresence'\nimport { TLShape } from './TLShape'\nimport { TLUser } from './TLUser'\n\n/**\n * Interface for extending tldraw with custom record types via TypeScript module augmentation.\n *\n * Custom record types allow you to add entirely new data types to the tldraw store that\n * don't fit into the existing shape, binding, or asset categories. Each key in this\n * interface becomes a new record type name, and the value should be your full record type.\n *\n * @example\n * ```ts\n * import { BaseRecord, RecordId } from '@tldraw/store'\n *\n * // Define your custom record type\n * interface TLComment extends BaseRecord<'comment', RecordId<TLComment>> {\n * text: string\n * shapeId: TLShapeId\n * authorId: string\n * createdAt: number\n * }\n *\n * // Augment the global record props map\n * declare module '@tldraw/tlschema' {\n * interface TLGlobalRecordPropsMap {\n * comment: TLComment\n * }\n * }\n *\n * // Now TLRecord includes your custom comment type\n * // and you can use it with createTLSchema()\n * ```\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface TLGlobalRecordPropsMap {}\n\n/**\n * Union type of all built-in tldraw record types.\n *\n * This includes persistent records (documents, pages, shapes, assets, bindings)\n * and session/presence records (cameras, instances, pointers, page states).\n *\n * @public\n */\nexport type TLDefaultRecord =\n\t| TLAsset\n\t| TLBinding\n\t| TLCamera\n\t| TLDocument\n\t| TLInstance\n\t| TLInstancePageState\n\t| TLPage\n\t| TLShape\n\t| TLInstancePresence\n\t| TLPointer\n\t| TLUser\n\n/**\n * Index type that maps custom record type names to their record types.\n *\n * Similar to TLIndexedShapes and TLIndexedBindings, this type creates a mapping\n * from type name keys to their corresponding record types, filtering out any\n * disabled types (those set to null or undefined in TLGlobalRecordPropsMap).\n *\n * @public\n */\n// prettier-ignore\nexport type TLIndexedRecords = {\n\t[K in keyof TLGlobalRecordPropsMap as TLGlobalRecordPropsMap[K] extends null | undefined\n\t\t? never\n\t\t: K]: TLGlobalRecordPropsMap[K]\n}\n\n/**\n * Union type representing a custom record from the TLGlobalRecordPropsMap.\n *\n * @public\n */\nexport type TLCustomRecord = TLIndexedRecords[keyof TLIndexedRecords]\n\n/**\n * Union type representing all possible record types in a tldraw store.\n * This includes both persistent records (documents, pages, shapes, assets, bindings)\n * and session/presence records (cameras, instances, pointers, page states),\n * as well as any custom record types added via TLGlobalRecordPropsMap augmentation.\n *\n * Records are organized by scope:\n * - **document**: Persisted across sessions (shapes, pages, assets, bindings, documents)\n * - **session**: Local to current session (cameras, instances, page states)\n * - **presence**: Ephemeral user presence data (pointers, instance presence)\n *\n * @example\n * ```ts\n * // Function that works with any record type\n * function processRecord(record: TLRecord) {\n * switch (record.typeName) {\n * case 'shape':\n * console.log(`Shape: ${record.type} at (${record.x}, ${record.y})`)\n * break\n * case 'page':\n * console.log(`Page: ${record.name}`)\n * break\n * case 'asset':\n * console.log(`Asset: ${record.type}`)\n * break\n * case 'camera':\n * console.log(`Camera at (${record.x}, ${record.y}) zoom: ${record.z}`)\n * break\n * // ... handle other record types\n * }\n * }\n *\n * // Get all records from store\n * const allRecords: TLRecord[] = store.allRecords()\n *\n * // Filter by record type using type guards\n * import { isShape, isPage, isAsset } from '@tldraw/tlschema'\n * const shapes = allRecords.filter(isShape)\n * const pages = allRecords.filter(isPage)\n * const assets = allRecords.filter(isAsset)\n * ```\n *\n * @public\n */\nexport type TLRecord = TLDefaultRecord | TLCustomRecord\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var TLUser_exports = {};
20
+ __export(TLUser_exports, {
21
+ UserRecordType: () => UserRecordType,
22
+ createUserId: () => createUserId,
23
+ createUserRecordType: () => createUserRecordType,
24
+ isUserId: () => isUserId,
25
+ userIdValidator: () => userIdValidator,
26
+ userMigrations: () => userMigrations,
27
+ userValidator: () => userValidator,
28
+ userVersions: () => userVersions
29
+ });
30
+ module.exports = __toCommonJS(TLUser_exports);
31
+ var import_store = require("@tldraw/store");
32
+ var import_validate = require("@tldraw/validate");
33
+ var import_id_validator = require("../misc/id-validator");
34
+ const userIdValidator = (0, import_id_validator.idValidator)("user");
35
+ const userVersions = (0, import_store.createMigrationIds)("com.tldraw.user", {
36
+ Initial: 1
37
+ });
38
+ const userMigrations = (0, import_store.createRecordMigrationSequence)({
39
+ sequenceId: "com.tldraw.user",
40
+ recordType: "user",
41
+ sequence: [
42
+ {
43
+ id: userVersions.Initial,
44
+ up: (_record) => {
45
+ }
46
+ }
47
+ ]
48
+ });
49
+ function createUserRecordType(config) {
50
+ const metaConfig = config?.meta;
51
+ const metaValidator = metaConfig ? import_validate.T.object(
52
+ Object.fromEntries(
53
+ Object.entries(metaConfig).map(([key, v]) => [
54
+ key,
55
+ new import_validate.T.Validator((value) => {
56
+ if (value === void 0) return void 0;
57
+ return v.validate(value);
58
+ })
59
+ ])
60
+ )
61
+ ).allowUnknownProperties() : import_validate.T.jsonValue;
62
+ const validator = import_validate.T.model(
63
+ "user",
64
+ import_validate.T.object({
65
+ typeName: import_validate.T.literal("user"),
66
+ id: userIdValidator,
67
+ name: import_validate.T.string,
68
+ color: import_validate.T.string,
69
+ imageUrl: import_validate.T.string,
70
+ meta: metaValidator
71
+ })
72
+ );
73
+ return (0, import_store.createRecordType)("user", {
74
+ validator,
75
+ scope: "document"
76
+ }).withDefaultProperties(() => ({
77
+ name: "",
78
+ color: "",
79
+ imageUrl: "",
80
+ meta: {}
81
+ }));
82
+ }
83
+ const userValidator = import_validate.T.model(
84
+ "user",
85
+ import_validate.T.object({
86
+ typeName: import_validate.T.literal("user"),
87
+ id: userIdValidator,
88
+ name: import_validate.T.string,
89
+ color: import_validate.T.string,
90
+ imageUrl: import_validate.T.string,
91
+ meta: import_validate.T.jsonValue
92
+ })
93
+ );
94
+ const UserRecordType = createUserRecordType();
95
+ function isUserId(id) {
96
+ return UserRecordType.isId(id);
97
+ }
98
+ function createUserId(id) {
99
+ return UserRecordType.createId(id);
100
+ }
101
+ //# sourceMappingURL=TLUser.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/records/TLUser.ts"],
4
+ "sourcesContent": ["import {\n\tBaseRecord,\n\tcreateMigrationIds,\n\tcreateRecordMigrationSequence,\n\tcreateRecordType,\n\tRecordId,\n} from '@tldraw/store'\nimport { JsonObject } from '@tldraw/utils'\nimport { T } from '@tldraw/validate'\nimport { idValidator } from '../misc/id-validator'\n\n/**\n * A user record in a tldraw store. User records are document-scoped and\n * persist alongside shapes, assets, and pages. They are automatically\n * included in snapshots, clipboard content, and `.tldr` files so that\n * attribution display names survive across boards and sessions.\n *\n * User records are populated from the {@link @tldraw/tlschema#TLUserStore}\n * when the editor stamps attribution metadata onto shapes.\n *\n * Extend user records with custom metadata by passing validators to\n * {@link @tldraw/tlschema#createTLSchema} or {@link createUserRecordType}.\n *\n * @public\n */\nexport interface TLUser extends BaseRecord<'user', TLUserId> {\n\tname: string\n\tcolor: string\n\timageUrl: string\n\tmeta: JsonObject\n}\n\n/** @public */\nexport type TLUserId = RecordId<TLUser>\n\n/** @public */\nexport const userIdValidator = idValidator<TLUserId>('user')\n\n/** @public */\nexport const userVersions = createMigrationIds('com.tldraw.user', {\n\tInitial: 1,\n})\n\n/** @public */\nexport const userMigrations = createRecordMigrationSequence({\n\tsequenceId: 'com.tldraw.user',\n\trecordType: 'user',\n\tsequence: [\n\t\t{\n\t\t\tid: userVersions.Initial,\n\t\t\tup: (_record: any) => {\n\t\t\t\t// initial version \u2014 nothing to migrate\n\t\t\t},\n\t\t},\n\t],\n})\n\n/**\n * Creates a user record type with optional custom meta validation.\n *\n * When `meta` validators are provided, the user record's `meta` field will\n * validate those specific fields (when present) while still allowing\n * arbitrary additional JSON properties. Custom meta fields are treated as\n * optional so that user records created without them remain valid.\n *\n * @param config - Optional configuration for custom meta validators\n * @returns A configured user record type\n *\n * @example\n * ```ts\n * import { createUserRecordType } from '@tldraw/tlschema'\n * import { T } from '@tldraw/validate'\n *\n * const CustomUserRecordType = createUserRecordType({\n * meta: {\n * isAdmin: T.boolean,\n * department: T.string,\n * },\n * })\n * ```\n *\n * @public\n */\nexport function createUserRecordType(config?: { meta?: Record<string, T.Validatable<any>> }) {\n\tconst metaConfig = config?.meta\n\n\tconst metaValidator = metaConfig\n\t\t? T.object(\n\t\t\t\tObject.fromEntries(\n\t\t\t\t\tObject.entries(metaConfig).map(([key, v]) => [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tnew T.Validator((value) => {\n\t\t\t\t\t\t\tif (value === undefined) return undefined\n\t\t\t\t\t\t\treturn (v as T.Validator<unknown>).validate(value)\n\t\t\t\t\t\t}),\n\t\t\t\t\t])\n\t\t\t\t)\n\t\t\t).allowUnknownProperties()\n\t\t: (T.jsonValue as T.ObjectValidator<JsonObject>)\n\n\tconst validator: T.Validator<TLUser> = T.model(\n\t\t'user',\n\t\tT.object({\n\t\t\ttypeName: T.literal('user'),\n\t\t\tid: userIdValidator,\n\t\t\tname: T.string,\n\t\t\tcolor: T.string,\n\t\t\timageUrl: T.string,\n\t\t\tmeta: metaValidator as T.ObjectValidator<JsonObject>,\n\t\t})\n\t)\n\n\treturn createRecordType<TLUser>('user', {\n\t\tvalidator,\n\t\tscope: 'document',\n\t}).withDefaultProperties(() => ({\n\t\tname: '',\n\t\tcolor: '',\n\t\timageUrl: '',\n\t\tmeta: {},\n\t}))\n}\n\n/** @public */\nexport const userValidator: T.Validator<TLUser> = T.model(\n\t'user',\n\tT.object({\n\t\ttypeName: T.literal('user'),\n\t\tid: userIdValidator,\n\t\tname: T.string,\n\t\tcolor: T.string,\n\t\timageUrl: T.string,\n\t\tmeta: T.jsonValue as T.ObjectValidator<JsonObject>,\n\t})\n)\n\n/** @public */\nexport const UserRecordType = createUserRecordType()\n\n/** @public */\nexport function isUserId(id: string): id is TLUserId {\n\treturn UserRecordType.isId(id)\n}\n\n/** @public */\nexport function createUserId(id: string): TLUserId {\n\treturn UserRecordType.createId(id)\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAMO;AAEP,sBAAkB;AAClB,0BAA4B;AA2BrB,MAAM,sBAAkB,iCAAsB,MAAM;AAGpD,MAAM,mBAAe,iCAAmB,mBAAmB;AAAA,EACjE,SAAS;AACV,CAAC;AAGM,MAAM,qBAAiB,4CAA8B;AAAA,EAC3D,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,IACT;AAAA,MACC,IAAI,aAAa;AAAA,MACjB,IAAI,CAAC,YAAiB;AAAA,MAEtB;AAAA,IACD;AAAA,EACD;AACD,CAAC;AA4BM,SAAS,qBAAqB,QAAwD;AAC5F,QAAM,aAAa,QAAQ;AAE3B,QAAM,gBAAgB,aACnB,kBAAE;AAAA,IACF,OAAO;AAAA,MACN,OAAO,QAAQ,UAAU,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM;AAAA,QAC5C;AAAA,QACA,IAAI,kBAAE,UAAU,CAAC,UAAU;AAC1B,cAAI,UAAU,OAAW,QAAO;AAChC,iBAAQ,EAA2B,SAAS,KAAK;AAAA,QAClD,CAAC;AAAA,MACF,CAAC;AAAA,IACF;AAAA,EACD,EAAE,uBAAuB,IACvB,kBAAE;AAEN,QAAM,YAAiC,kBAAE;AAAA,IACxC;AAAA,IACA,kBAAE,OAAO;AAAA,MACR,UAAU,kBAAE,QAAQ,MAAM;AAAA,MAC1B,IAAI;AAAA,MACJ,MAAM,kBAAE;AAAA,MACR,OAAO,kBAAE;AAAA,MACT,UAAU,kBAAE;AAAA,MACZ,MAAM;AAAA,IACP,CAAC;AAAA,EACF;AAEA,aAAO,+BAAyB,QAAQ;AAAA,IACvC;AAAA,IACA,OAAO;AAAA,EACR,CAAC,EAAE,sBAAsB,OAAO;AAAA,IAC/B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM,CAAC;AAAA,EACR,EAAE;AACH;AAGO,MAAM,gBAAqC,kBAAE;AAAA,EACnD;AAAA,EACA,kBAAE,OAAO;AAAA,IACR,UAAU,kBAAE,QAAQ,MAAM;AAAA,IAC1B,IAAI;AAAA,IACJ,MAAM,kBAAE;AAAA,IACR,OAAO,kBAAE;AAAA,IACT,UAAU,kBAAE;AAAA,IACZ,MAAM,kBAAE;AAAA,EACT,CAAC;AACF;AAGO,MAAM,iBAAiB,qBAAqB;AAG5C,SAAS,SAAS,IAA4B;AACpD,SAAO,eAAe,KAAK,EAAE;AAC9B;AAGO,SAAS,aAAa,IAAsB;AAClD,SAAO,eAAe,SAAS,EAAE;AAClC;",
6
+ "names": []
7
+ }
@@ -42,7 +42,8 @@ const noteShapeProps = {
42
42
  growY: import_validate.T.positiveNumber,
43
43
  url: import_validate.T.linkUrl,
44
44
  richText: import_TLRichText.richTextValidator,
45
- scale: import_validate.T.nonZeroNumber
45
+ scale: import_validate.T.nonZeroNumber,
46
+ textFirstEditedBy: import_validate.T.string.nullable()
46
47
  };
47
48
  const Versions = (0, import_TLShape.createShapePropsMigrationIds)("note", {
48
49
  AddUrlProp: 1,
@@ -54,7 +55,8 @@ const Versions = (0, import_TLShape.createShapePropsMigrationIds)("note", {
54
55
  AddScale: 7,
55
56
  AddLabelColor: 8,
56
57
  AddRichText: 9,
57
- AddRichTextAttrs: 10
58
+ AddRichTextAttrs: 10,
59
+ AddFirstEditedBy: 11
58
60
  });
59
61
  const noteShapeMigrations = (0, import_TLShape.createShapePropsMigrationSequence)({
60
62
  sequence: [
@@ -155,6 +157,15 @@ const noteShapeMigrations = (0, import_TLShape.createShapePropsMigrationSequence
155
157
  delete props.richText.attrs;
156
158
  }
157
159
  }
160
+ },
161
+ {
162
+ id: Versions.AddFirstEditedBy,
163
+ up: (props) => {
164
+ props.textFirstEditedBy = null;
165
+ },
166
+ down: (props) => {
167
+ delete props.textFirstEditedBy;
168
+ }
158
169
  }
159
170
  ]
160
171
  });