@tldraw/tlschema 4.3.0-next.39f1d5b92226 → 4.3.0-next.40e4536afc8e

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 (97) hide show
  1. package/dist-cjs/index.d.ts +82 -34
  2. package/dist-cjs/index.js +4 -1
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/misc/TLOpacity.js +1 -5
  5. package/dist-cjs/misc/TLOpacity.js.map +2 -2
  6. package/dist-cjs/misc/TLRichText.js +5 -1
  7. package/dist-cjs/misc/TLRichText.js.map +2 -2
  8. package/dist-cjs/misc/b64Vecs.js +224 -0
  9. package/dist-cjs/misc/b64Vecs.js.map +7 -0
  10. package/dist-cjs/shapes/TLArrowShape.js +30 -13
  11. package/dist-cjs/shapes/TLArrowShape.js.map +2 -2
  12. package/dist-cjs/shapes/TLDrawShape.js +37 -4
  13. package/dist-cjs/shapes/TLDrawShape.js.map +2 -2
  14. package/dist-cjs/shapes/TLEmbedShape.js +17 -0
  15. package/dist-cjs/shapes/TLEmbedShape.js.map +2 -2
  16. package/dist-cjs/shapes/TLGeoShape.js +12 -1
  17. package/dist-cjs/shapes/TLGeoShape.js.map +2 -2
  18. package/dist-cjs/shapes/TLHighlightShape.js +29 -2
  19. package/dist-cjs/shapes/TLHighlightShape.js.map +2 -2
  20. package/dist-cjs/shapes/TLNoteShape.js +12 -1
  21. package/dist-cjs/shapes/TLNoteShape.js.map +2 -2
  22. package/dist-cjs/shapes/TLTextShape.js +12 -1
  23. package/dist-cjs/shapes/TLTextShape.js.map +2 -2
  24. package/dist-cjs/store-migrations.js +14 -14
  25. package/dist-cjs/store-migrations.js.map +2 -2
  26. package/dist-esm/index.d.mts +82 -34
  27. package/dist-esm/index.mjs +5 -1
  28. package/dist-esm/index.mjs.map +2 -2
  29. package/dist-esm/misc/TLOpacity.mjs +1 -5
  30. package/dist-esm/misc/TLOpacity.mjs.map +2 -2
  31. package/dist-esm/misc/TLRichText.mjs +5 -1
  32. package/dist-esm/misc/TLRichText.mjs.map +2 -2
  33. package/dist-esm/misc/b64Vecs.mjs +204 -0
  34. package/dist-esm/misc/b64Vecs.mjs.map +7 -0
  35. package/dist-esm/shapes/TLArrowShape.mjs +30 -13
  36. package/dist-esm/shapes/TLArrowShape.mjs.map +2 -2
  37. package/dist-esm/shapes/TLDrawShape.mjs +37 -4
  38. package/dist-esm/shapes/TLDrawShape.mjs.map +2 -2
  39. package/dist-esm/shapes/TLEmbedShape.mjs +17 -0
  40. package/dist-esm/shapes/TLEmbedShape.mjs.map +2 -2
  41. package/dist-esm/shapes/TLGeoShape.mjs +12 -1
  42. package/dist-esm/shapes/TLGeoShape.mjs.map +2 -2
  43. package/dist-esm/shapes/TLHighlightShape.mjs +29 -2
  44. package/dist-esm/shapes/TLHighlightShape.mjs.map +2 -2
  45. package/dist-esm/shapes/TLNoteShape.mjs +12 -1
  46. package/dist-esm/shapes/TLNoteShape.mjs.map +2 -2
  47. package/dist-esm/shapes/TLTextShape.mjs +12 -1
  48. package/dist-esm/shapes/TLTextShape.mjs.map +2 -2
  49. package/dist-esm/store-migrations.mjs +14 -14
  50. package/dist-esm/store-migrations.mjs.map +2 -2
  51. package/package.json +8 -8
  52. package/src/__tests__/migrationTestUtils.ts +9 -3
  53. package/src/index.ts +3 -0
  54. package/src/migrations.test.ts +149 -1
  55. package/src/misc/TLOpacity.ts +1 -5
  56. package/src/misc/TLRichText.ts +6 -1
  57. package/src/misc/b64Vecs.ts +308 -0
  58. package/src/shapes/TLArrowShape.ts +36 -13
  59. package/src/shapes/TLDrawShape.ts +59 -12
  60. package/src/shapes/TLEmbedShape.ts +17 -0
  61. package/src/shapes/TLGeoShape.ts +14 -1
  62. package/src/shapes/TLHighlightShape.ts +37 -0
  63. package/src/shapes/TLNoteShape.ts +15 -1
  64. package/src/shapes/TLTextShape.ts +16 -2
  65. package/src/store-migrations.ts +15 -15
  66. package/src/assets/TLBookmarkAsset.test.ts +0 -96
  67. package/src/assets/TLImageAsset.test.ts +0 -213
  68. package/src/assets/TLVideoAsset.test.ts +0 -105
  69. package/src/bindings/TLArrowBinding.test.ts +0 -55
  70. package/src/misc/id-validator.test.ts +0 -50
  71. package/src/records/TLAsset.test.ts +0 -234
  72. package/src/records/TLBinding.test.ts +0 -22
  73. package/src/records/TLCamera.test.ts +0 -19
  74. package/src/records/TLDocument.test.ts +0 -35
  75. package/src/records/TLInstance.test.ts +0 -201
  76. package/src/records/TLPage.test.ts +0 -110
  77. package/src/records/TLPageState.test.ts +0 -228
  78. package/src/records/TLPointer.test.ts +0 -63
  79. package/src/records/TLPresence.test.ts +0 -190
  80. package/src/records/TLRecord.test.ts +0 -82
  81. package/src/records/TLShape.test.ts +0 -232
  82. package/src/shapes/ShapeWithCrop.test.ts +0 -18
  83. package/src/shapes/TLArrowShape.test.ts +0 -505
  84. package/src/shapes/TLBaseShape.test.ts +0 -142
  85. package/src/shapes/TLBookmarkShape.test.ts +0 -122
  86. package/src/shapes/TLDrawShape.test.ts +0 -177
  87. package/src/shapes/TLEmbedShape.test.ts +0 -286
  88. package/src/shapes/TLFrameShape.test.ts +0 -71
  89. package/src/shapes/TLGeoShape.test.ts +0 -247
  90. package/src/shapes/TLGroupShape.test.ts +0 -59
  91. package/src/shapes/TLHighlightShape.test.ts +0 -325
  92. package/src/shapes/TLImageShape.test.ts +0 -534
  93. package/src/shapes/TLLineShape.test.ts +0 -269
  94. package/src/shapes/TLNoteShape.test.ts +0 -1568
  95. package/src/shapes/TLTextShape.test.ts +0 -407
  96. package/src/shapes/TLVideoShape.test.ts +0 -112
  97. package/src/styles/TLColorStyle.test.ts +0 -439
@@ -210,6 +210,7 @@ export declare const arrowShapeVersions: {
210
210
  readonly AddLabelColor: "com.tldraw.shape.arrow/1";
211
211
  readonly AddLabelPosition: "com.tldraw.shape.arrow/3";
212
212
  readonly AddRichText: "com.tldraw.shape.arrow/7";
213
+ readonly AddRichTextAttrs: "com.tldraw.shape.arrow/8";
213
214
  readonly AddScale: "com.tldraw.shape.arrow/5";
214
215
  readonly ExtractBindings: "com.tldraw.shape.arrow/4";
215
216
  };
@@ -299,6 +300,59 @@ export declare const AssetRecordType: RecordType<TLAsset, "props" | "type">;
299
300
  */
300
301
  export declare const assetValidator: T.Validator<TLAsset>;
301
302
 
303
+ /**
304
+ * Utilities for encoding and decoding points using base64 and Float16 encoding.
305
+ * Provides functions for converting between VecModel arrays and compact base64 strings,
306
+ * as well as individual point encoding/decoding operations.
307
+ *
308
+ * @public
309
+ */
310
+ export declare class b64Vecs {
311
+ /**
312
+ * Encode a single point (x, y, z) to 8 base64 characters.
313
+ * Each coordinate is encoded as a Float16 value, resulting in 6 bytes total.
314
+ *
315
+ * @param x - The x coordinate
316
+ * @param y - The y coordinate
317
+ * @param z - The z coordinate
318
+ * @returns An 8-character base64 string representing the point
319
+ */
320
+ static encodePoint(x: number, y: number, z: number): string;
321
+ /**
322
+ * Convert an array of VecModels to a base64 string for compact storage.
323
+ * Uses Float16 encoding for each coordinate (x, y, z). If a point's z value is
324
+ * undefined, it defaults to 0.5.
325
+ *
326
+ * @param points - An array of VecModel objects to encode
327
+ * @returns A base64-encoded string containing all points
328
+ */
329
+ static encodePoints(points: VecModel[]): string;
330
+ /**
331
+ * Convert a base64 string back to an array of VecModels.
332
+ * Decodes Float16-encoded coordinates (x, y, z) from the base64 string.
333
+ *
334
+ * @param base64 - The base64-encoded string containing point data
335
+ * @returns An array of VecModel objects decoded from the string
336
+ */
337
+ static decodePoints(base64: string): VecModel[];
338
+ /* Excluded from this release type: decodePointAt */
339
+ /**
340
+ * Get the first point from a base64-encoded string of points.
341
+ *
342
+ * @param b64Points - The base64-encoded string containing point data
343
+ * @returns The first point as a VecModel, or null if the string is too short
344
+ * @public
345
+ */
346
+ static decodeFirstPoint(b64Points: string): null | VecModel;
347
+ /**
348
+ * Get the last point from a base64-encoded string of points.
349
+ *
350
+ * @param b64Points - The base64-encoded string containing point data
351
+ * @returns The last point as a VecModel, or null if the string is too short
352
+ */
353
+ static decodeLastPoint(b64Points: string): null | VecModel;
354
+ }
355
+
302
356
  /**
303
357
  * Validator for binding IDs. Ensures that binding identifiers follow the correct
304
358
  * format and type constraints required by the tldraw schema system.
@@ -426,6 +480,17 @@ export declare const CameraRecordType: RecordType<TLCamera, never>;
426
480
  */
427
481
  export declare const canvasUiColorTypeValidator: T.Validator<"accent" | "black" | "laser" | "muted-1" | "selection-fill" | "selection-stroke" | "white">;
428
482
 
483
+ /**
484
+ * Compress legacy draw shape segments by converting VecModel[] points to base64 format.
485
+ * This function is useful for converting old draw shape data to the new compressed format.
486
+ *
487
+ * @public
488
+ */
489
+ export declare function compressLegacySegments(segments: {
490
+ points: VecModel[];
491
+ type: 'free' | 'straight';
492
+ }[]): TLDrawShapeSegment[];
493
+
429
494
  /**
430
495
  * Creates a validator for a specific asset record type. This factory function generates
431
496
  * a complete validator that validates the entire asset record structure including the
@@ -1398,22 +1463,7 @@ export declare const DocumentRecordType: RecordType<TLDocument, never>;
1398
1463
  */
1399
1464
  export declare const drawShapeMigrations: TLPropsMigrations;
1400
1465
 
1401
- /**
1402
- * Validation schema for draw shape properties.
1403
- *
1404
- * @public
1405
- * @example
1406
- * ```ts
1407
- * // Validate draw shape properties
1408
- * const props = {
1409
- * color: 'red',
1410
- * fill: 'solid',
1411
- * segments: [{ type: 'free', points: [] }],
1412
- * isComplete: true
1413
- * }
1414
- * const isValid = drawShapeProps.color.isValid(props.color)
1415
- * ```
1416
- */
1466
+ /** @public */
1417
1467
  export declare const drawShapeProps: RecordProps<TLDrawShape>;
1418
1468
 
1419
1469
  /**
@@ -1537,7 +1587,7 @@ export declare const GeoShapeGeoStyle: EnumStyleProp<"arrow-down" | "arrow-left"
1537
1587
  /**
1538
1588
  * Migration sequence for geo shape properties across different schema versions.
1539
1589
  * Handles evolution of geo shapes including URL support, label colors, alignment changes,
1540
- * and the transition from plain text to rich text.
1590
+ * the transition from plain text to rich text, and support for attrs property on richText.
1541
1591
  *
1542
1592
  * @public
1543
1593
  */
@@ -1753,20 +1803,7 @@ export declare const groupShapeProps: RecordProps<TLGroupShape>;
1753
1803
  */
1754
1804
  export declare const highlightShapeMigrations: TLPropsMigrations;
1755
1805
 
1756
- /**
1757
- * Validation schema for highlight shape properties. Defines the runtime validation rules
1758
- * for all properties of highlight shapes.
1759
- *
1760
- * @public
1761
- * @example
1762
- * ```ts
1763
- * import { highlightShapeProps } from '@tldraw/tlschema'
1764
- *
1765
- * // Used internally by the validation system
1766
- * const validator = T.object(highlightShapeProps)
1767
- * const validatedProps = validator.validate(someHighlightProps)
1768
- * ```
1769
- */
1806
+ /** @public */
1770
1807
  export declare const highlightShapeProps: RecordProps<TLHighlightShape>;
1771
1808
 
1772
1809
  /**
@@ -2215,7 +2252,8 @@ export declare const LineShapeSplineStyle: EnumStyleProp<"cubic" | "line">;
2215
2252
  * Migration sequence for note shapes. Handles schema evolution over time by defining
2216
2253
  * how to upgrade and downgrade note shape data between different versions. Includes
2217
2254
  * migrations for URL properties, text alignment changes, vertical alignment addition,
2218
- * font size adjustments, scaling support, label color, and the transition from plain text to rich text.
2255
+ * font size adjustments, scaling support, label color, the transition from plain text to rich text,
2256
+ * and support for attrs property on richText.
2219
2257
  *
2220
2258
  * @public
2221
2259
  */
@@ -2412,6 +2450,7 @@ export declare type RecordPropsType<Config extends Record<string, T.Validatable<
2412
2450
  * ```
2413
2451
  */
2414
2452
  export declare const richTextValidator: T.ObjectValidator<{
2453
+ attrs?: any;
2415
2454
  content: unknown[];
2416
2455
  type: string;
2417
2456
  }>;
@@ -2717,6 +2756,7 @@ export declare type StylePropValue<T extends StyleProp<any>> = T extends StylePr
2717
2756
  * - RemoveJustify: Replaced 'justify' alignment with 'start'
2718
2757
  * - AddTextAlign: Migrated from 'align' to 'textAlign' property
2719
2758
  * - AddRichText: Converted plain text to rich text format
2759
+ * - AddRichTextAttrs: Added support for attrs property on richText
2720
2760
  *
2721
2761
  * @public
2722
2762
  */
@@ -4161,6 +4201,10 @@ export declare interface TLDrawShapeProps {
4161
4201
  isPen: boolean;
4162
4202
  /** Scale factor applied to the drawing */
4163
4203
  scale: number;
4204
+ /** Horizontal scale factor for lazy resize */
4205
+ scaleX: number;
4206
+ /** Vertical scale factor for lazy resize */
4207
+ scaleY: number;
4164
4208
  }
4165
4209
 
4166
4210
  /**
@@ -4171,8 +4215,8 @@ export declare interface TLDrawShapeProps {
4171
4215
  export declare interface TLDrawShapeSegment {
4172
4216
  /** Type of drawing segment - 'free' for freehand curves, 'straight' for line segments */
4173
4217
  type: 'free' | 'straight';
4174
- /** Array of points defining the segment path with x, y coordinates and pressure (z) */
4175
- points: VecModel[];
4218
+ /** Base64-encoded points (x, y, z triplets stored as Float16) */
4219
+ points: string;
4176
4220
  }
4177
4221
 
4178
4222
  /**
@@ -4543,6 +4587,10 @@ export declare interface TLHighlightShapeProps {
4543
4587
  isPen: boolean;
4544
4588
  /** Scale factor applied to the highlight shape for display */
4545
4589
  scale: number;
4590
+ /** Horizontal scale factor for lazy resize */
4591
+ scaleX: number;
4592
+ /** Vertical scale factor for lazy resize */
4593
+ scaleY: number;
4546
4594
  }
4547
4595
 
4548
4596
  /**
package/dist-cjs/index.js CHANGED
@@ -62,11 +62,13 @@ __export(index_exports, {
62
62
  assetIdValidator: () => import_TLBaseAsset.assetIdValidator,
63
63
  assetMigrations: () => import_TLAsset.assetMigrations,
64
64
  assetValidator: () => import_TLAsset.assetValidator,
65
+ b64Vecs: () => import_b64Vecs.b64Vecs,
65
66
  bindingIdValidator: () => import_TLBaseBinding.bindingIdValidator,
66
67
  bookmarkShapeMigrations: () => import_TLBookmarkShape.bookmarkShapeMigrations,
67
68
  bookmarkShapeProps: () => import_TLBookmarkShape.bookmarkShapeProps,
68
69
  boxModelValidator: () => import_geometry_types.boxModelValidator,
69
70
  canvasUiColorTypeValidator: () => import_TLColor.canvasUiColorTypeValidator,
71
+ compressLegacySegments: () => import_TLDrawShape.compressLegacySegments,
70
72
  createAssetValidator: () => import_TLBaseAsset.createAssetValidator,
71
73
  createBindingId: () => import_TLBinding.createBindingId,
72
74
  createBindingPropsMigrationIds: () => import_TLBinding.createBindingPropsMigrationIds,
@@ -176,9 +178,10 @@ var import_TLSizeStyle = require("./styles/TLSizeStyle");
176
178
  var import_TLTextAlignStyle = require("./styles/TLTextAlignStyle");
177
179
  var import_TLVerticalAlignStyle = require("./styles/TLVerticalAlignStyle");
178
180
  var import_translations = require("./translations/translations");
181
+ var import_b64Vecs = require("./misc/b64Vecs");
179
182
  (0, import_utils.registerTldrawLibraryVersion)(
180
183
  "@tldraw/tlschema",
181
- "4.3.0-next.39f1d5b92226",
184
+ "4.3.0-next.40e4536afc8e",
182
185
  "cjs"
183
186
  );
184
187
  //# 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\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 { type TLRecord } 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\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"],
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;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,wBAKO;AACP,wBAKO;AACP,oBAMO;AACP,yBAIO;AACP,uBAKO;AACP,wBAIO;AAEP,qBAkBO;AAQP,0BAWO;AACP,yBAKO;AACP,6BAKO;AACP,yBAMO;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;AAAA,IAGP;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 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\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 { type TLRecord } 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_LIBR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O;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;",
6
6
  "names": []
7
7
  }
@@ -22,9 +22,5 @@ __export(TLOpacity_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(TLOpacity_exports);
24
24
  var import_validate = require("@tldraw/validate");
25
- const opacityValidator = import_validate.T.number.check((n) => {
26
- if (n < 0 || n > 1) {
27
- throw new import_validate.T.ValidationError("Opacity must be between 0 and 1");
28
- }
29
- });
25
+ const opacityValidator = import_validate.T.unitInterval;
30
26
  //# sourceMappingURL=TLOpacity.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/misc/TLOpacity.ts"],
4
- "sourcesContent": ["import { T } from '@tldraw/validate'\n\n/**\n * A type representing opacity values in tldraw.\n *\n * Opacity values are numbers between 0 and 1, where 0 is fully transparent\n * and 1 is fully opaque. This type is used throughout the editor to control\n * the transparency of shapes, UI elements, and other visual components.\n *\n * @example\n * ```ts\n * const fullyOpaque: TLOpacityType = 1.0\n * const halfTransparent: TLOpacityType = 0.5\n * const fullyTransparent: TLOpacityType = 0.0\n * const quarterOpaque: TLOpacityType = 0.25\n * ```\n *\n * @public\n */\nexport type TLOpacityType = number\n\n/**\n * A validator for opacity values.\n *\n * This validator ensures that opacity values are numbers between 0 and 1 (inclusive).\n * Values outside this range will cause a validation error. The validator provides\n * runtime type checking for opacity properties throughout the editor.\n *\n * @param n - The number to validate as an opacity value\n * @throws T.ValidationError When the value is not between 0 and 1\n *\n * @example\n * ```ts\n * import { opacityValidator } from '@tldraw/tlschema'\n *\n * // Valid opacity values\n * try {\n * const validOpacity1 = opacityValidator.validate(0.5) // \u2713\n * const validOpacity2 = opacityValidator.validate(1.0) // \u2713\n * const validOpacity3 = opacityValidator.validate(0.0) // \u2713\n * } catch (error) {\n * console.error('Validation failed:', error.message)\n * }\n *\n * // Invalid opacity values\n * try {\n * opacityValidator.validate(-0.1) // \u2717 Throws error\n * opacityValidator.validate(1.5) // \u2717 Throws error\n * } catch (error) {\n * console.error('Invalid opacity:', error.message)\n * }\n * ```\n *\n * @public\n */\nexport const opacityValidator = T.number.check((n) => {\n\tif (n < 0 || n > 1) {\n\t\tthrow new T.ValidationError('Opacity must be between 0 and 1')\n\t}\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAkB;AAuDX,MAAM,mBAAmB,kBAAE,OAAO,MAAM,CAAC,MAAM;AACrD,MAAI,IAAI,KAAK,IAAI,GAAG;AACnB,UAAM,IAAI,kBAAE,gBAAgB,iCAAiC;AAAA,EAC9D;AACD,CAAC;",
4
+ "sourcesContent": ["import { T } from '@tldraw/validate'\n\n/**\n * A type representing opacity values in tldraw.\n *\n * Opacity values are numbers between 0 and 1, where 0 is fully transparent\n * and 1 is fully opaque. This type is used throughout the editor to control\n * the transparency of shapes, UI elements, and other visual components.\n *\n * @example\n * ```ts\n * const fullyOpaque: TLOpacityType = 1.0\n * const halfTransparent: TLOpacityType = 0.5\n * const fullyTransparent: TLOpacityType = 0.0\n * const quarterOpaque: TLOpacityType = 0.25\n * ```\n *\n * @public\n */\nexport type TLOpacityType = number\n\n/**\n * A validator for opacity values.\n *\n * This validator ensures that opacity values are numbers between 0 and 1 (inclusive).\n * Values outside this range will cause a validation error. The validator provides\n * runtime type checking for opacity properties throughout the editor.\n *\n * @param n - The number to validate as an opacity value\n * @throws T.ValidationError When the value is not between 0 and 1\n *\n * @example\n * ```ts\n * import { opacityValidator } from '@tldraw/tlschema'\n *\n * // Valid opacity values\n * try {\n * const validOpacity1 = opacityValidator.validate(0.5) // \u2713\n * const validOpacity2 = opacityValidator.validate(1.0) // \u2713\n * const validOpacity3 = opacityValidator.validate(0.0) // \u2713\n * } catch (error) {\n * console.error('Validation failed:', error.message)\n * }\n *\n * // Invalid opacity values\n * try {\n * opacityValidator.validate(-0.1) // \u2717 Throws error\n * opacityValidator.validate(1.5) // \u2717 Throws error\n * } catch (error) {\n * console.error('Invalid opacity:', error.message)\n * }\n * ```\n *\n * @public\n */\nexport const opacityValidator = T.unitInterval\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAkB;AAuDX,MAAM,mBAAmB,kBAAE;",
6
6
  "names": []
7
7
  }
@@ -23,7 +23,11 @@ __export(TLRichText_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(TLRichText_exports);
25
25
  var import_validate = require("@tldraw/validate");
26
- const richTextValidator = import_validate.T.object({ type: import_validate.T.string, content: import_validate.T.arrayOf(import_validate.T.unknown) });
26
+ const richTextValidator = import_validate.T.object({
27
+ type: import_validate.T.string,
28
+ content: import_validate.T.arrayOf(import_validate.T.unknown),
29
+ attrs: import_validate.T.any.optional()
30
+ });
27
31
  function toRichText(text) {
28
32
  const lines = text.split("\n");
29
33
  const content = lines.map((text2) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/misc/TLRichText.ts"],
4
- "sourcesContent": ["import { T } from '@tldraw/validate'\n\n/**\n * Validator for TLRichText objects that ensures they have the correct structure\n * for document-based rich text content. Validates a document with a type field\n * and an array of content blocks.\n *\n * @public\n * @example\n * ```ts\n * const richText = { type: 'doc', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] }] }\n * const isValid = richTextValidator.check(richText) // true\n * ```\n */\nexport const richTextValidator = T.object({ type: T.string, content: T.arrayOf(T.unknown) })\n\n/**\n * Type representing rich text content in tldraw. Rich text follows a document-based\n * structure with a root document containing an array of content blocks (paragraphs,\n * text nodes, etc.). This enables formatted text with support for multiple paragraphs,\n * styling, and other rich content.\n *\n * @public\n * @example\n * ```ts\n * const richText: TLRichText = {\n * type: 'doc',\n * content: [\n * {\n * type: 'paragraph',\n * content: [{ type: 'text', text: 'Hello world!' }]\n * }\n * ]\n * }\n * ```\n */\nexport type TLRichText = T.TypeOf<typeof richTextValidator>\n\n/**\n * Converts a plain text string into a TLRichText object. Each line of the input\n * text becomes a separate paragraph in the rich text document. Empty lines are\n * preserved as empty paragraphs to maintain the original text structure.\n *\n * @param text - The plain text string to convert to rich text\n * @returns A TLRichText object with the text content structured as paragraphs\n * @public\n * @example\n * ```ts\n * const richText = toRichText('Hello\\nWorld')\n * // Returns:\n * // {\n * // type: 'doc',\n * // content: [\n * // { type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] },\n * // { type: 'paragraph', content: [{ type: 'text', text: 'World' }] }\n * // ]\n * // }\n *\n * const emptyLine = toRichText('Line 1\\n\\nLine 3')\n * // Creates three paragraphs, with the middle one being empty\n * ```\n */\nexport function toRichText(text: string): TLRichText {\n\tconst lines = text.split('\\n')\n\tconst content = lines.map((text) => {\n\t\tif (!text) {\n\t\t\treturn {\n\t\t\t\ttype: 'paragraph',\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'paragraph',\n\t\t\tcontent: [{ type: 'text', text }],\n\t\t}\n\t})\n\n\treturn {\n\t\ttype: 'doc',\n\t\tcontent,\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAkB;AAcX,MAAM,oBAAoB,kBAAE,OAAO,EAAE,MAAM,kBAAE,QAAQ,SAAS,kBAAE,QAAQ,kBAAE,OAAO,EAAE,CAAC;AAgDpF,SAAS,WAAW,MAA0B;AACpD,QAAM,QAAQ,KAAK,MAAM,IAAI;AAC7B,QAAM,UAAU,MAAM,IAAI,CAACA,UAAS;AACnC,QAAI,CAACA,OAAM;AACV,aAAO;AAAA,QACN,MAAM;AAAA,MACP;AAAA,IACD;AAEA,WAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAAA,MAAK,CAAC;AAAA,IACjC;AAAA,EACD,CAAC;AAED,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["import { T } from '@tldraw/validate'\n\n/**\n * Validator for TLRichText objects that ensures they have the correct structure\n * for document-based rich text content. Validates a document with a type field\n * and an array of content blocks.\n *\n * @public\n * @example\n * ```ts\n * const richText = { type: 'doc', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] }] }\n * const isValid = richTextValidator.check(richText) // true\n * ```\n */\n\nexport const richTextValidator = T.object({\n\ttype: T.string,\n\tcontent: T.arrayOf(T.unknown),\n\tattrs: T.any.optional(),\n})\n\n/**\n * Type representing rich text content in tldraw. Rich text follows a document-based\n * structure with a root document containing an array of content blocks (paragraphs,\n * text nodes, etc.). This enables formatted text with support for multiple paragraphs,\n * styling, and other rich content.\n *\n * @public\n * @example\n * ```ts\n * const richText: TLRichText = {\n * type: 'doc',\n * content: [\n * {\n * type: 'paragraph',\n * content: [{ type: 'text', text: 'Hello world!' }]\n * }\n * ]\n * }\n * ```\n */\nexport type TLRichText = T.TypeOf<typeof richTextValidator>\n\n/**\n * Converts a plain text string into a TLRichText object. Each line of the input\n * text becomes a separate paragraph in the rich text document. Empty lines are\n * preserved as empty paragraphs to maintain the original text structure.\n *\n * @param text - The plain text string to convert to rich text\n * @returns A TLRichText object with the text content structured as paragraphs\n * @public\n * @example\n * ```ts\n * const richText = toRichText('Hello\\nWorld')\n * // Returns:\n * // {\n * // type: 'doc',\n * // content: [\n * // { type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] },\n * // { type: 'paragraph', content: [{ type: 'text', text: 'World' }] }\n * // ]\n * // }\n *\n * const emptyLine = toRichText('Line 1\\n\\nLine 3')\n * // Creates three paragraphs, with the middle one being empty\n * ```\n */\nexport function toRichText(text: string): TLRichText {\n\tconst lines = text.split('\\n')\n\tconst content = lines.map((text) => {\n\t\tif (!text) {\n\t\t\treturn {\n\t\t\t\ttype: 'paragraph',\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'paragraph',\n\t\t\tcontent: [{ type: 'text', text }],\n\t\t}\n\t})\n\n\treturn {\n\t\ttype: 'doc',\n\t\tcontent,\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAkB;AAeX,MAAM,oBAAoB,kBAAE,OAAO;AAAA,EACzC,MAAM,kBAAE;AAAA,EACR,SAAS,kBAAE,QAAQ,kBAAE,OAAO;AAAA,EAC5B,OAAO,kBAAE,IAAI,SAAS;AACvB,CAAC;AAgDM,SAAS,WAAW,MAA0B;AACpD,QAAM,QAAQ,KAAK,MAAM,IAAI;AAC7B,QAAM,UAAU,MAAM,IAAI,CAACA,UAAS;AACnC,QAAI,CAACA,OAAM;AACV,aAAO;AAAA,QACN,MAAM;AAAA,MACP;AAAA,IACD;AAEA,WAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAAA,MAAK,CAAC;AAAA,IACjC;AAAA,EACD,CAAC;AAED,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;",
6
6
  "names": ["text"]
7
7
  }
@@ -0,0 +1,224 @@
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 b64Vecs_exports = {};
20
+ __export(b64Vecs_exports, {
21
+ b64Vecs: () => b64Vecs
22
+ });
23
+ module.exports = __toCommonJS(b64Vecs_exports);
24
+ const POINT_B64_LENGTH = 8;
25
+ const BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
26
+ const B64_LOOKUP = new Uint8Array(128);
27
+ for (let i = 0; i < 64; i++) {
28
+ B64_LOOKUP[BASE64_CHARS.charCodeAt(i)] = i;
29
+ }
30
+ const POW2 = new Float64Array(31);
31
+ for (let i = 0; i < 31; i++) {
32
+ POW2[i] = Math.pow(2, i - 15);
33
+ }
34
+ const POW2_SUBNORMAL = Math.pow(2, -14) / 1024;
35
+ const MANTISSA = new Float64Array(1024);
36
+ for (let i = 0; i < 1024; i++) {
37
+ MANTISSA[i] = 1 + i / 1024;
38
+ }
39
+ function uint16ArrayToBase64(uint16Array) {
40
+ const uint8Array = new Uint8Array(
41
+ uint16Array.buffer,
42
+ uint16Array.byteOffset,
43
+ uint16Array.byteLength
44
+ );
45
+ let result = "";
46
+ for (let i = 0; i < uint8Array.length; i += 3) {
47
+ const byte1 = uint8Array[i];
48
+ const byte2 = uint8Array[i + 1];
49
+ const byte3 = uint8Array[i + 2];
50
+ const bitmap = byte1 << 16 | byte2 << 8 | byte3;
51
+ result += BASE64_CHARS[bitmap >> 18 & 63] + BASE64_CHARS[bitmap >> 12 & 63] + BASE64_CHARS[bitmap >> 6 & 63] + BASE64_CHARS[bitmap & 63];
52
+ }
53
+ return result;
54
+ }
55
+ function base64ToUint16Array(base64) {
56
+ const numBytes = Math.floor(base64.length * 3 / 4);
57
+ const bytes = new Uint8Array(numBytes);
58
+ let byteIndex = 0;
59
+ for (let i = 0; i < base64.length; i += 4) {
60
+ const c0 = B64_LOOKUP[base64.charCodeAt(i)];
61
+ const c1 = B64_LOOKUP[base64.charCodeAt(i + 1)];
62
+ const c2 = B64_LOOKUP[base64.charCodeAt(i + 2)];
63
+ const c3 = B64_LOOKUP[base64.charCodeAt(i + 3)];
64
+ const bitmap = c0 << 18 | c1 << 12 | c2 << 6 | c3;
65
+ bytes[byteIndex++] = bitmap >> 16 & 255;
66
+ bytes[byteIndex++] = bitmap >> 8 & 255;
67
+ bytes[byteIndex++] = bitmap & 255;
68
+ }
69
+ return new Uint16Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 2);
70
+ }
71
+ function float16BitsToNumber(bits) {
72
+ const sign = bits >> 15;
73
+ const exp = bits >> 10 & 31;
74
+ const frac = bits & 1023;
75
+ if (exp === 0) {
76
+ return sign ? -frac * POW2_SUBNORMAL : frac * POW2_SUBNORMAL;
77
+ }
78
+ if (exp === 31) {
79
+ return frac ? NaN : sign ? -Infinity : Infinity;
80
+ }
81
+ const magnitude = POW2[exp] * MANTISSA[frac];
82
+ return sign ? -magnitude : magnitude;
83
+ }
84
+ function numberToFloat16Bits(value) {
85
+ if (value === 0) return Object.is(value, -0) ? 32768 : 0;
86
+ if (!Number.isFinite(value)) {
87
+ if (Number.isNaN(value)) return 32256;
88
+ return value > 0 ? 31744 : 64512;
89
+ }
90
+ const sign = value < 0 ? 1 : 0;
91
+ value = Math.abs(value);
92
+ const exp = Math.floor(Math.log2(value));
93
+ let expBiased = exp + 15;
94
+ if (expBiased >= 31) {
95
+ return sign << 15 | 31744;
96
+ }
97
+ if (expBiased <= 0) {
98
+ const frac2 = Math.round(value * Math.pow(2, 14) * 1024);
99
+ return sign << 15 | frac2 & 1023;
100
+ }
101
+ const mantissa = value / Math.pow(2, exp) - 1;
102
+ let frac = Math.round(mantissa * 1024);
103
+ if (frac >= 1024) {
104
+ frac = 0;
105
+ expBiased++;
106
+ if (expBiased >= 31) {
107
+ return sign << 15 | 31744;
108
+ }
109
+ }
110
+ return sign << 15 | expBiased << 10 | frac;
111
+ }
112
+ class b64Vecs {
113
+ /**
114
+ * Encode a single point (x, y, z) to 8 base64 characters.
115
+ * Each coordinate is encoded as a Float16 value, resulting in 6 bytes total.
116
+ *
117
+ * @param x - The x coordinate
118
+ * @param y - The y coordinate
119
+ * @param z - The z coordinate
120
+ * @returns An 8-character base64 string representing the point
121
+ */
122
+ static encodePoint(x, y, z) {
123
+ const xBits = numberToFloat16Bits(x);
124
+ const yBits = numberToFloat16Bits(y);
125
+ const zBits = numberToFloat16Bits(z);
126
+ const b0 = xBits & 255;
127
+ const b1 = xBits >> 8 & 255;
128
+ const b2 = yBits & 255;
129
+ const b3 = yBits >> 8 & 255;
130
+ const b4 = zBits & 255;
131
+ const b5 = zBits >> 8 & 255;
132
+ const bitmap1 = b0 << 16 | b1 << 8 | b2;
133
+ const bitmap2 = b3 << 16 | b4 << 8 | b5;
134
+ return BASE64_CHARS[bitmap1 >> 18 & 63] + BASE64_CHARS[bitmap1 >> 12 & 63] + BASE64_CHARS[bitmap1 >> 6 & 63] + BASE64_CHARS[bitmap1 & 63] + BASE64_CHARS[bitmap2 >> 18 & 63] + BASE64_CHARS[bitmap2 >> 12 & 63] + BASE64_CHARS[bitmap2 >> 6 & 63] + BASE64_CHARS[bitmap2 & 63];
135
+ }
136
+ /**
137
+ * Convert an array of VecModels to a base64 string for compact storage.
138
+ * Uses Float16 encoding for each coordinate (x, y, z). If a point's z value is
139
+ * undefined, it defaults to 0.5.
140
+ *
141
+ * @param points - An array of VecModel objects to encode
142
+ * @returns A base64-encoded string containing all points
143
+ */
144
+ static encodePoints(points) {
145
+ const uint16s = new Uint16Array(points.length * 3);
146
+ for (let i = 0; i < points.length; i++) {
147
+ const p = points[i];
148
+ uint16s[i * 3] = numberToFloat16Bits(p.x);
149
+ uint16s[i * 3 + 1] = numberToFloat16Bits(p.y);
150
+ uint16s[i * 3 + 2] = numberToFloat16Bits(p.z ?? 0.5);
151
+ }
152
+ return uint16ArrayToBase64(uint16s);
153
+ }
154
+ /**
155
+ * Convert a base64 string back to an array of VecModels.
156
+ * Decodes Float16-encoded coordinates (x, y, z) from the base64 string.
157
+ *
158
+ * @param base64 - The base64-encoded string containing point data
159
+ * @returns An array of VecModel objects decoded from the string
160
+ */
161
+ static decodePoints(base64) {
162
+ const uint16s = base64ToUint16Array(base64);
163
+ const result = [];
164
+ for (let i = 0; i < uint16s.length; i += 3) {
165
+ result.push({
166
+ x: float16BitsToNumber(uint16s[i]),
167
+ y: float16BitsToNumber(uint16s[i + 1]),
168
+ z: float16BitsToNumber(uint16s[i + 2])
169
+ });
170
+ }
171
+ return result;
172
+ }
173
+ /**
174
+ * Decode a single point (8 base64 chars) starting at the given offset.
175
+ * Each point is encoded as 3 Float16 values (x, y, z) in 8 base64 characters.
176
+ *
177
+ * @param b64Points - The base64-encoded string containing point data
178
+ * @param charOffset - The character offset where the point starts (must be a multiple of 8)
179
+ * @returns A VecModel object with x, y, and z coordinates
180
+ * @internal
181
+ */
182
+ static decodePointAt(b64Points, charOffset) {
183
+ const c0 = B64_LOOKUP[b64Points.charCodeAt(charOffset)];
184
+ const c1 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 1)];
185
+ const c2 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 2)];
186
+ const c3 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 3)];
187
+ const c4 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 4)];
188
+ const c5 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 5)];
189
+ const c6 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 6)];
190
+ const c7 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 7)];
191
+ const bitmap1 = c0 << 18 | c1 << 12 | c2 << 6 | c3;
192
+ const bitmap2 = c4 << 18 | c5 << 12 | c6 << 6 | c7;
193
+ const xBits = bitmap1 >> 16 & 255 | bitmap1 & 65280;
194
+ const yBits = bitmap1 & 255 | bitmap2 >> 8 & 65280;
195
+ const zBits = bitmap2 >> 8 & 255 | bitmap2 << 8 & 65280;
196
+ return {
197
+ x: float16BitsToNumber(xBits),
198
+ y: float16BitsToNumber(yBits),
199
+ z: float16BitsToNumber(zBits)
200
+ };
201
+ }
202
+ /**
203
+ * Get the first point from a base64-encoded string of points.
204
+ *
205
+ * @param b64Points - The base64-encoded string containing point data
206
+ * @returns The first point as a VecModel, or null if the string is too short
207
+ * @public
208
+ */
209
+ static decodeFirstPoint(b64Points) {
210
+ if (b64Points.length < POINT_B64_LENGTH) return null;
211
+ return b64Vecs.decodePointAt(b64Points, 0);
212
+ }
213
+ /**
214
+ * Get the last point from a base64-encoded string of points.
215
+ *
216
+ * @param b64Points - The base64-encoded string containing point data
217
+ * @returns The last point as a VecModel, or null if the string is too short
218
+ */
219
+ static decodeLastPoint(b64Points) {
220
+ if (b64Points.length < POINT_B64_LENGTH) return null;
221
+ return b64Vecs.decodePointAt(b64Points, b64Points.length - POINT_B64_LENGTH);
222
+ }
223
+ }
224
+ //# sourceMappingURL=b64Vecs.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/misc/b64Vecs.ts"],
4
+ "sourcesContent": ["import { VecModel } from './geometry-types'\n\n// Each point = 3 Float16s = 6 bytes = 8 base64 chars\nconst POINT_B64_LENGTH = 8\n\n// O(1) lookup table for base64 decoding (maps char code -> 6-bit value)\nconst BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nconst B64_LOOKUP = new Uint8Array(128)\nfor (let i = 0; i < 64; i++) {\n\tB64_LOOKUP[BASE64_CHARS.charCodeAt(i)] = i\n}\n\n// Precomputed powers of 2 for Float16 exponents (exp - 15, so indices 0-30 map to 2^-15 to 2^15)\nconst POW2 = new Float64Array(31)\nfor (let i = 0; i < 31; i++) {\n\tPOW2[i] = Math.pow(2, i - 15)\n}\nconst POW2_SUBNORMAL = Math.pow(2, -14) / 1024 // For subnormal numbers\n\n// Precomputed mantissa values: 1 + frac/1024 for all 1024 possible frac values\n// Avoids division in hot path\nconst MANTISSA = new Float64Array(1024)\nfor (let i = 0; i < 1024; i++) {\n\tMANTISSA[i] = 1 + i / 1024\n}\n\n/**\n * Convert a Uint16Array (containing Float16 bits) to base64.\n * Processes bytes in groups of 3 to produce 4 base64 characters.\n *\n * @internal\n */\nfunction uint16ArrayToBase64(uint16Array: Uint16Array): string {\n\tconst uint8Array = new Uint8Array(\n\t\tuint16Array.buffer,\n\t\tuint16Array.byteOffset,\n\t\tuint16Array.byteLength\n\t)\n\tlet result = ''\n\n\t// Process bytes in groups of 3 -> 4 base64 chars\n\tfor (let i = 0; i < uint8Array.length; i += 3) {\n\t\tconst byte1 = uint8Array[i]\n\t\tconst byte2 = uint8Array[i + 1] // Always exists for our use case (multiple of 6 bytes)\n\t\tconst byte3 = uint8Array[i + 2]\n\n\t\tconst bitmap = (byte1 << 16) | (byte2 << 8) | byte3\n\t\tresult +=\n\t\t\tBASE64_CHARS[(bitmap >> 18) & 63] +\n\t\t\tBASE64_CHARS[(bitmap >> 12) & 63] +\n\t\t\tBASE64_CHARS[(bitmap >> 6) & 63] +\n\t\t\tBASE64_CHARS[bitmap & 63]\n\t}\n\n\treturn result\n}\n\n/**\n * Convert a base64 string to Uint16Array containing Float16 bits.\n * The base64 string must have a length that is a multiple of 4.\n *\n * @param base64 - The base64-encoded string to decode\n * @returns A Uint16Array containing the decoded Float16 bit values\n * @public\n */\nfunction base64ToUint16Array(base64: string): Uint16Array {\n\t// Calculate exact number of bytes (4 base64 chars = 3 bytes)\n\tconst numBytes = Math.floor((base64.length * 3) / 4)\n\tconst bytes = new Uint8Array(numBytes)\n\tlet byteIndex = 0\n\n\t// Process in groups of 4 base64 characters\n\tfor (let i = 0; i < base64.length; i += 4) {\n\t\tconst c0 = B64_LOOKUP[base64.charCodeAt(i)]\n\t\tconst c1 = B64_LOOKUP[base64.charCodeAt(i + 1)]\n\t\tconst c2 = B64_LOOKUP[base64.charCodeAt(i + 2)]\n\t\tconst c3 = B64_LOOKUP[base64.charCodeAt(i + 3)]\n\n\t\tconst bitmap = (c0 << 18) | (c1 << 12) | (c2 << 6) | c3\n\n\t\tbytes[byteIndex++] = (bitmap >> 16) & 255\n\t\tbytes[byteIndex++] = (bitmap >> 8) & 255\n\t\tbytes[byteIndex++] = bitmap & 255\n\t}\n\n\treturn new Uint16Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 2)\n}\n\n/**\n * Convert Float16 bits to a number using optimized lookup tables.\n * Handles normal numbers, subnormal numbers, zero, infinity, and NaN.\n *\n * @param bits - The 16-bit Float16 value to decode\n * @returns The decoded number value\n */\nfunction float16BitsToNumber(bits: number): number {\n\tconst sign = bits >> 15\n\tconst exp = (bits >> 10) & 0x1f\n\tconst frac = bits & 0x3ff\n\n\tif (exp === 0) {\n\t\t// Subnormal or zero - rare case\n\t\treturn sign ? -frac * POW2_SUBNORMAL : frac * POW2_SUBNORMAL\n\t}\n\tif (exp === 31) {\n\t\t// Infinity or NaN - very rare\n\t\treturn frac ? NaN : sign ? -Infinity : Infinity\n\t}\n\t// Normal case - two table lookups, one multiply, no division\n\tconst magnitude = POW2[exp] * MANTISSA[frac]\n\treturn sign ? -magnitude : magnitude\n}\n\n/**\n * Convert a number to Float16 bits.\n * Handles normal numbers, subnormal numbers, zero, infinity, and NaN.\n *\n * @param value - The number to encode as Float16\n * @returns The 16-bit Float16 representation of the number\n * @internal\n */\nfunction numberToFloat16Bits(value: number): number {\n\tif (value === 0) return Object.is(value, -0) ? 0x8000 : 0\n\tif (!Number.isFinite(value)) {\n\t\tif (Number.isNaN(value)) return 0x7e00\n\t\treturn value > 0 ? 0x7c00 : 0xfc00\n\t}\n\n\tconst sign = value < 0 ? 1 : 0\n\tvalue = Math.abs(value)\n\n\t// Find exponent and mantissa\n\tconst exp = Math.floor(Math.log2(value))\n\tlet expBiased = exp + 15\n\n\tif (expBiased >= 31) {\n\t\t// Overflow to infinity\n\t\treturn (sign << 15) | 0x7c00\n\t}\n\tif (expBiased <= 0) {\n\t\t// Subnormal or underflow\n\t\tconst frac = Math.round(value * Math.pow(2, 14) * 1024)\n\t\treturn (sign << 15) | (frac & 0x3ff)\n\t}\n\n\t// Normal number\n\tconst mantissa = value / Math.pow(2, exp) - 1\n\tlet frac = Math.round(mantissa * 1024)\n\n\t// Handle rounding overflow: if frac rounds to 1024, increment exponent\n\tif (frac >= 1024) {\n\t\tfrac = 0\n\t\texpBiased++\n\t\tif (expBiased >= 31) {\n\t\t\t// Overflow to infinity\n\t\t\treturn (sign << 15) | 0x7c00\n\t\t}\n\t}\n\n\treturn (sign << 15) | (expBiased << 10) | frac\n}\n\n/**\n * Utilities for encoding and decoding points using base64 and Float16 encoding.\n * Provides functions for converting between VecModel arrays and compact base64 strings,\n * as well as individual point encoding/decoding operations.\n *\n * @public\n */\nexport class b64Vecs {\n\t/**\n\t * Encode a single point (x, y, z) to 8 base64 characters.\n\t * Each coordinate is encoded as a Float16 value, resulting in 6 bytes total.\n\t *\n\t * @param x - The x coordinate\n\t * @param y - The y coordinate\n\t * @param z - The z coordinate\n\t * @returns An 8-character base64 string representing the point\n\t */\n\tstatic encodePoint(x: number, y: number, z: number): string {\n\t\tconst xBits = numberToFloat16Bits(x)\n\t\tconst yBits = numberToFloat16Bits(y)\n\t\tconst zBits = numberToFloat16Bits(z)\n\n\t\t// Convert Float16 bits to 6 bytes (little-endian)\n\t\tconst b0 = xBits & 0xff\n\t\tconst b1 = (xBits >> 8) & 0xff\n\t\tconst b2 = yBits & 0xff\n\t\tconst b3 = (yBits >> 8) & 0xff\n\t\tconst b4 = zBits & 0xff\n\t\tconst b5 = (zBits >> 8) & 0xff\n\n\t\t// Convert 6 bytes to 8 base64 chars\n\t\tconst bitmap1 = (b0 << 16) | (b1 << 8) | b2\n\t\tconst bitmap2 = (b3 << 16) | (b4 << 8) | b5\n\n\t\treturn (\n\t\t\tBASE64_CHARS[(bitmap1 >> 18) & 0x3f] +\n\t\t\tBASE64_CHARS[(bitmap1 >> 12) & 0x3f] +\n\t\t\tBASE64_CHARS[(bitmap1 >> 6) & 0x3f] +\n\t\t\tBASE64_CHARS[bitmap1 & 0x3f] +\n\t\t\tBASE64_CHARS[(bitmap2 >> 18) & 0x3f] +\n\t\t\tBASE64_CHARS[(bitmap2 >> 12) & 0x3f] +\n\t\t\tBASE64_CHARS[(bitmap2 >> 6) & 0x3f] +\n\t\t\tBASE64_CHARS[bitmap2 & 0x3f]\n\t\t)\n\t}\n\n\t/**\n\t * Convert an array of VecModels to a base64 string for compact storage.\n\t * Uses Float16 encoding for each coordinate (x, y, z). If a point's z value is\n\t * undefined, it defaults to 0.5.\n\t *\n\t * @param points - An array of VecModel objects to encode\n\t * @returns A base64-encoded string containing all points\n\t */\n\tstatic encodePoints(points: VecModel[]): string {\n\t\tconst uint16s = new Uint16Array(points.length * 3)\n\t\tfor (let i = 0; i < points.length; i++) {\n\t\t\tconst p = points[i]\n\t\t\tuint16s[i * 3] = numberToFloat16Bits(p.x)\n\t\t\tuint16s[i * 3 + 1] = numberToFloat16Bits(p.y)\n\t\t\tuint16s[i * 3 + 2] = numberToFloat16Bits(p.z ?? 0.5)\n\t\t}\n\t\treturn uint16ArrayToBase64(uint16s)\n\t}\n\n\t/**\n\t * Convert a base64 string back to an array of VecModels.\n\t * Decodes Float16-encoded coordinates (x, y, z) from the base64 string.\n\t *\n\t * @param base64 - The base64-encoded string containing point data\n\t * @returns An array of VecModel objects decoded from the string\n\t */\n\tstatic decodePoints(base64: string): VecModel[] {\n\t\tconst uint16s = base64ToUint16Array(base64)\n\t\tconst result: VecModel[] = []\n\t\tfor (let i = 0; i < uint16s.length; i += 3) {\n\t\t\tresult.push({\n\t\t\t\tx: float16BitsToNumber(uint16s[i]),\n\t\t\t\ty: float16BitsToNumber(uint16s[i + 1]),\n\t\t\t\tz: float16BitsToNumber(uint16s[i + 2]),\n\t\t\t})\n\t\t}\n\t\treturn result\n\t}\n\n\t/**\n\t * Decode a single point (8 base64 chars) starting at the given offset.\n\t * Each point is encoded as 3 Float16 values (x, y, z) in 8 base64 characters.\n\t *\n\t * @param b64Points - The base64-encoded string containing point data\n\t * @param charOffset - The character offset where the point starts (must be a multiple of 8)\n\t * @returns A VecModel object with x, y, and z coordinates\n\t * @internal\n\t */\n\tstatic decodePointAt(b64Points: string, charOffset: number): VecModel {\n\t\t// Decode 8 base64 chars -> 6 bytes -> 3 Float16s using O(1) lookup\n\t\tconst c0 = B64_LOOKUP[b64Points.charCodeAt(charOffset)]\n\t\tconst c1 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 1)]\n\t\tconst c2 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 2)]\n\t\tconst c3 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 3)]\n\t\tconst c4 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 4)]\n\t\tconst c5 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 5)]\n\t\tconst c6 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 6)]\n\t\tconst c7 = B64_LOOKUP[b64Points.charCodeAt(charOffset + 7)]\n\n\t\t// 4 base64 chars -> 24 bits -> 3 bytes\n\t\tconst bitmap1 = (c0 << 18) | (c1 << 12) | (c2 << 6) | c3\n\t\tconst bitmap2 = (c4 << 18) | (c5 << 12) | (c6 << 6) | c7\n\n\t\t// Extract Float16 bits directly (little-endian byte order)\n\t\t// bitmap1 = [byte0:8][byte1:8][byte2:8], bitmap2 = [byte3:8][byte4:8][byte5:8]\n\t\t// xBits = byte0 | (byte1 << 8), yBits = byte2 | (byte3 << 8), zBits = byte4 | (byte5 << 8)\n\t\tconst xBits = ((bitmap1 >> 16) & 0xff) | (bitmap1 & 0xff00)\n\t\tconst yBits = (bitmap1 & 0xff) | ((bitmap2 >> 8) & 0xff00)\n\t\tconst zBits = ((bitmap2 >> 8) & 0xff) | ((bitmap2 << 8) & 0xff00)\n\n\t\treturn {\n\t\t\tx: float16BitsToNumber(xBits),\n\t\t\ty: float16BitsToNumber(yBits),\n\t\t\tz: float16BitsToNumber(zBits),\n\t\t}\n\t}\n\n\t/**\n\t * Get the first point from a base64-encoded string of points.\n\t *\n\t * @param b64Points - The base64-encoded string containing point data\n\t * @returns The first point as a VecModel, or null if the string is too short\n\t * @public\n\t */\n\tstatic decodeFirstPoint(b64Points: string): VecModel | null {\n\t\tif (b64Points.length < POINT_B64_LENGTH) return null\n\t\treturn b64Vecs.decodePointAt(b64Points, 0)\n\t}\n\n\t/**\n\t * Get the last point from a base64-encoded string of points.\n\t *\n\t * @param b64Points - The base64-encoded string containing point data\n\t * @returns The last point as a VecModel, or null if the string is too short\n\t */\n\tstatic decodeLastPoint(b64Points: string): VecModel | null {\n\t\tif (b64Points.length < POINT_B64_LENGTH) return null\n\t\treturn b64Vecs.decodePointAt(b64Points, b64Points.length - POINT_B64_LENGTH)\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,MAAM,mBAAmB;AAGzB,MAAM,eAAe;AACrB,MAAM,aAAa,IAAI,WAAW,GAAG;AACrC,SAAS,IAAI,GAAG,IAAI,IAAI,KAAK;AAC5B,aAAW,aAAa,WAAW,CAAC,CAAC,IAAI;AAC1C;AAGA,MAAM,OAAO,IAAI,aAAa,EAAE;AAChC,SAAS,IAAI,GAAG,IAAI,IAAI,KAAK;AAC5B,OAAK,CAAC,IAAI,KAAK,IAAI,GAAG,IAAI,EAAE;AAC7B;AACA,MAAM,iBAAiB,KAAK,IAAI,GAAG,GAAG,IAAI;AAI1C,MAAM,WAAW,IAAI,aAAa,IAAI;AACtC,SAAS,IAAI,GAAG,IAAI,MAAM,KAAK;AAC9B,WAAS,CAAC,IAAI,IAAI,IAAI;AACvB;AAQA,SAAS,oBAAoB,aAAkC;AAC9D,QAAM,aAAa,IAAI;AAAA,IACtB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,YAAY;AAAA,EACb;AACA,MAAI,SAAS;AAGb,WAAS,IA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