tldraw 3.15.0-canary.e3f6387b7e04 → 3.15.0-next.032b45f439ca

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 (39) hide show
  1. package/dist-cjs/index.d.ts +0 -5
  2. package/dist-cjs/index.js +1 -2
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/shapes/shared/PathBuilder.js +3 -21
  5. package/dist-cjs/lib/shapes/shared/PathBuilder.js.map +2 -2
  6. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +1 -2
  7. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
  8. package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js +1 -1
  9. package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js.map +2 -2
  10. package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js +2 -5
  11. package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js.map +2 -2
  12. package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js +0 -1
  13. package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js.map +2 -2
  14. package/dist-cjs/lib/ui/version.js +3 -3
  15. package/dist-cjs/lib/ui/version.js.map +1 -1
  16. package/dist-esm/index.d.mts +0 -5
  17. package/dist-esm/index.mjs +1 -3
  18. package/dist-esm/index.mjs.map +2 -2
  19. package/dist-esm/lib/shapes/shared/PathBuilder.mjs +3 -22
  20. package/dist-esm/lib/shapes/shared/PathBuilder.mjs.map +2 -2
  21. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +1 -2
  22. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
  23. package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs +1 -1
  24. package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs.map +2 -2
  25. package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs +2 -5
  26. package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs.map +2 -2
  27. package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs +0 -1
  28. package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs.map +2 -2
  29. package/dist-esm/lib/ui/version.mjs +3 -3
  30. package/dist-esm/lib/ui/version.mjs.map +1 -1
  31. package/package.json +3 -3
  32. package/src/index.ts +0 -1
  33. package/src/lib/shapes/shared/PathBuilder.test.tsx +1 -1
  34. package/src/lib/shapes/shared/PathBuilder.tsx +1 -35
  35. package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +0 -1
  36. package/src/lib/ui/components/primitives/TldrawUiDialog.tsx +1 -1
  37. package/src/lib/ui/components/primitives/TldrawUiSlider.tsx +1 -5
  38. package/src/lib/ui/components/primitives/TldrawUiToolbar.tsx +0 -4
  39. package/src/lib/ui/version.ts +3 -3
@@ -10,7 +10,6 @@ import {
10
10
  Geometry2dFilters,
11
11
  Geometry2dOptions,
12
12
  getPerfectDashProps,
13
- getVerticesCountForArcLength,
14
13
  Group2d,
15
14
  modulate,
16
15
  PerfectDashTerminal,
@@ -122,7 +121,6 @@ export interface CubicBezierToPathBuilderCommand extends PathBuilderCommandBase
122
121
  type: 'cubic'
123
122
  cp1: VecModel
124
123
  cp2: VecModel
125
- resolution?: number
126
124
  }
127
125
 
128
126
  /** @internal */
@@ -319,17 +317,8 @@ export class PathBuilder {
319
317
  // Calculate the sweep angle
320
318
  const sweepAngle = endAngle - startAngle
321
319
 
322
- // Calculate the approximate arc length. General ellipse arc length is expensive - there's
323
- // no closed form solution, so we have to do iterative numerical approximation. As we only
324
- // use this to control the resolution of later approximations, let's cheat and just use the
325
- // circular arc length with the largest radius:
326
- const approximateArcLength = Math.max(rx1, ry1) * Math.abs(sweepAngle)
327
-
328
320
  // Approximate the arc using cubic bezier curves
329
321
  const numSegments = Math.min(4, Math.ceil(Math.abs(sweepAngle) / (Math.PI / 2)))
330
- const resolutionPerSegment = Math.ceil(
331
- getVerticesCountForArcLength(approximateArcLength) / numSegments
332
- )
333
322
  const anglePerSegment = sweepAngle / numSegments
334
323
 
335
324
  // Helper function to compute point on ellipse
@@ -375,16 +364,7 @@ export class PathBuilder {
375
364
  const cp2y = end.y - handleScale * d2.y
376
365
 
377
366
  const bezierOpts = i === 0 ? opts : { ...opts, mergeWithPrevious: true }
378
- this.cubicBezierToWithResolution(
379
- end.x,
380
- end.y,
381
- cp1x,
382
- cp1y,
383
- cp2x,
384
- cp2y,
385
- bezierOpts,
386
- resolutionPerSegment
387
- )
367
+ this.cubicBezierTo(end.x, end.y, cp1x, cp1y, cp2x, cp2y, bezierOpts)
388
368
  }
389
369
 
390
370
  return this
@@ -398,18 +378,6 @@ export class PathBuilder {
398
378
  cp2X: number,
399
379
  cp2Y: number,
400
380
  opts?: PathBuilderCommandOpts
401
- ) {
402
- return this.cubicBezierToWithResolution(x, y, cp1X, cp1Y, cp2X, cp2Y, opts)
403
- }
404
- private cubicBezierToWithResolution(
405
- x: number,
406
- y: number,
407
- cp1X: number,
408
- cp1Y: number,
409
- cp2X: number,
410
- cp2Y: number,
411
- opts?: PathBuilderCommandOpts,
412
- resolution?: number
413
381
  ) {
414
382
  this.assertHasMoveTo()
415
383
  this.commands.push({
@@ -420,7 +388,6 @@ export class PathBuilder {
420
388
  cp2: { x: cp2X, y: cp2Y },
421
389
  isClose: false,
422
390
  opts,
423
- resolution,
424
391
  })
425
392
  return this
426
393
  }
@@ -1005,7 +972,6 @@ export class PathBuilderGeometry2d extends Geometry2d {
1005
972
  cp1: Vec.From(command.cp1),
1006
973
  cp2: Vec.From(command.cp2),
1007
974
  end: Vec.From(command),
1008
- resolution: command.resolution,
1009
975
  })
1010
976
  )
1011
977
  break
@@ -451,7 +451,6 @@ export function OpacitySlider() {
451
451
  steps={tldrawSupportedOpacities.length - 1}
452
452
  title={msg('style-panel.opacity')}
453
453
  onHistoryMark={onHistoryMark}
454
- ariaValueModifier={25}
455
454
  />
456
455
  )
457
456
  }
@@ -65,7 +65,7 @@ export interface TLUiDialogBodyProps {
65
65
  /** @public @react */
66
66
  export function TldrawUiDialogBody({ className, children, style }: TLUiDialogBodyProps) {
67
67
  return (
68
- <div className={classNames('tlui-dialog__body', className)} style={style} tabIndex={0}>
68
+ <div className={classNames('tlui-dialog__body', className)} style={style}>
69
69
  {children}
70
70
  </div>
71
71
  )
@@ -13,7 +13,6 @@ export interface TLUiSliderProps {
13
13
  onValueChange(value: number): void
14
14
  onHistoryMark(id: string): void
15
15
  'data-testid'?: string
16
- ariaValueModifier?: number
17
16
  }
18
17
 
19
18
  /** @public @react */
@@ -27,7 +26,6 @@ export const TldrawUiSlider = React.forwardRef<HTMLDivElement, TLUiSliderProps>(
27
26
  label,
28
27
  onValueChange,
29
28
  ['data-testid']: testId,
30
- ariaValueModifier = 1,
31
29
  }: TLUiSliderProps,
32
30
  ref
33
31
  ) {
@@ -83,9 +81,7 @@ export const TldrawUiSlider = React.forwardRef<HTMLDivElement, TLUiSliderProps>(
83
81
  </_Slider.Track>
84
82
  {value !== null && (
85
83
  <_Slider.Thumb
86
- aria-valuemin={(min ?? 0) * ariaValueModifier}
87
- aria-valuenow={value * ariaValueModifier}
88
- aria-valuemax={steps * ariaValueModifier}
84
+ aria-label={msg('style-panel.opacity')}
89
85
  className="tlui-slider__thumb"
90
86
  dir="ltr"
91
87
  ref={ref}
@@ -76,10 +76,6 @@ export const TldrawUiToolbarToggleGroup = ({
76
76
  <_Toolbar.ToggleGroup
77
77
  type={type}
78
78
  {...props}
79
- // TODO: this fixes a bug in Radix until they fix it.
80
- // https://github.com/radix-ui/primitives/issues/3188
81
- // https://github.com/radix-ui/primitives/pull/3189
82
- role="radiogroup"
83
79
  className={classnames('tlui-toolbar-toggle-group', className)}
84
80
  >
85
81
  {children}
@@ -1,9 +1,9 @@
1
1
  // This file is automatically generated by internal/scripts/refresh-assets.ts.
2
2
  // Do not edit manually. Or do, I'm a comment, not a cop.
3
3
 
4
- export const version = '3.15.0-canary.e3f6387b7e04'
4
+ export const version = '3.15.0-next.032b45f439ca'
5
5
  export const publishDates = {
6
6
  major: '2024-09-13T14:36:29.063Z',
7
- minor: '2025-07-14T11:01:29.466Z',
8
- patch: '2025-07-14T11:01:29.466Z',
7
+ minor: '2025-07-14T09:15:42.267Z',
8
+ patch: '2025-07-14T09:15:42.267Z',
9
9
  }