소스 검색

Fixes utils imports

main
Steve Ruiz 4 년 전
부모
커밋
82bd129e3a
83개의 변경된 파일191개의 추가작업 그리고 154개의 파일을 삭제
  1. 1
    1
      __tests__/test-utils.ts
  2. 1
    1
      components/canvas/bounds/bounding-box.tsx
  3. 1
    1
      components/canvas/bounds/bounds-bg.tsx
  4. 1
    1
      components/canvas/bounds/handles.tsx
  5. 1
    1
      components/canvas/context-menu/context-menu.tsx
  6. 1
    1
      components/canvas/defs.tsx
  7. 1
    1
      components/canvas/page.tsx
  8. 1
    6
      components/canvas/selected.tsx
  9. 1
    1
      components/canvas/shape.tsx
  10. 1
    1
      components/controls-panel/controls-panel.tsx
  11. 1
    1
      components/style-panel/style-panel.tsx
  12. 1
    1
      hooks/useCamera.ts
  13. 1
    1
      hooks/useKeyboardEvents.ts
  14. 1
    1
      state/clipboard.ts
  15. 1
    1
      state/code/arrow.ts
  16. 1
    1
      state/code/control.ts
  17. 1
    1
      state/code/dot.ts
  18. 1
    1
      state/code/draw.ts
  19. 1
    1
      state/code/ellipse.ts
  20. 1
    1
      state/code/generate.ts
  21. 1
    1
      state/code/line.ts
  22. 1
    1
      state/code/polyline.ts
  23. 1
    1
      state/code/ray.ts
  24. 1
    1
      state/code/rectangle.ts
  25. 40
    42
      state/code/utils.ts
  26. 46
    0
      state/code/vector.ts
  27. 1
    1
      state/commands/align.ts
  28. 1
    1
      state/commands/arrow.ts
  29. 1
    1
      state/commands/command.ts
  30. 1
    1
      state/commands/create-page.ts
  31. 1
    1
      state/commands/delete-selected.ts
  32. 1
    1
      state/commands/direct.ts
  33. 1
    1
      state/commands/distribute.ts
  34. 1
    1
      state/commands/double-point-handle.ts
  35. 1
    1
      state/commands/draw.ts
  36. 2
    2
      state/commands/duplicate.ts
  37. 1
    1
      state/commands/edit.ts
  38. 1
    1
      state/commands/generate.ts
  39. 1
    1
      state/commands/group.ts
  40. 1
    1
      state/commands/handle.ts
  41. 1
    1
      state/commands/move-to-page.ts
  42. 1
    1
      state/commands/move.ts
  43. 1
    1
      state/commands/mutate.ts
  44. 1
    1
      state/commands/nudge.ts
  45. 2
    2
      state/commands/paste.ts
  46. 1
    1
      state/commands/reset-bounds.ts
  47. 1
    1
      state/commands/rotate-ccw.ts
  48. 1
    1
      state/commands/rotate.ts
  49. 1
    6
      state/commands/stretch.ts
  50. 1
    6
      state/commands/style.ts
  51. 1
    1
      state/commands/toggle.ts
  52. 1
    1
      state/commands/transform-single.ts
  53. 1
    1
      state/commands/transform.ts
  54. 1
    1
      state/commands/translate.ts
  55. 1
    1
      state/commands/ungroup.ts
  56. 1
    1
      state/hacks.ts
  57. 1
    1
      state/inputs.tsx
  58. 1
    1
      state/sessions/arrow-session.ts
  59. 1
    1
      state/sessions/brush-session.ts
  60. 1
    1
      state/sessions/direction-session.ts
  61. 1
    1
      state/sessions/draw-session.ts
  62. 1
    1
      state/sessions/edit-session.ts
  63. 1
    1
      state/sessions/handle-session.ts
  64. 1
    1
      state/sessions/rotate-session.ts
  65. 1
    1
      state/sessions/transform-session.ts
  66. 1
    1
      state/sessions/transform-single-session.ts
  67. 2
    2
      state/sessions/translate-session.ts
  68. 3
    3
      state/shape-utils/arrow.tsx
  69. 2
    2
      state/shape-utils/dot.tsx
  70. 2
    2
      state/shape-utils/draw.tsx
  71. 1
    1
      state/shape-utils/ellipse.tsx
  72. 2
    2
      state/shape-utils/group.tsx
  73. 2
    2
      state/shape-utils/line.tsx
  74. 2
    2
      state/shape-utils/polyline.tsx
  75. 2
    2
      state/shape-utils/ray.tsx
  76. 2
    2
      state/shape-utils/rectangle.tsx
  77. 2
    6
      state/shape-utils/register.tsx
  78. 1
    1
      state/shape-utils/text.tsx
  79. 1
    1
      state/state.ts
  80. 2
    2
      state/storage.ts
  81. 11
    0
      types.ts
  82. 1
    0
      utils/index.ts
  83. 1
    1
      utils/svg.ts

+ 1
- 1
__tests__/test-utils.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import { Data } from 'types'
2
-import { getSelectedIds } from 'utils/utils'
2
+import { getSelectedIds } from 'utils'
3 3
 
4 4
 interface PointerOptions {
5 5
   id?: string

+ 1
- 1
components/canvas/bounds/bounding-box.tsx 파일 보기

@@ -9,7 +9,7 @@ import {
9 9
   getSelectedIds,
10 10
   getSelectedShapes,
11 11
   isMobile,
12
-} from 'utils/utils'
12
+} from 'utils'
13 13
 import CenterHandle from './center-handle'
14 14
 import CornerHandle from './corner-handle'
15 15
 import EdgeHandle from './edge-handle'

+ 1
- 1
components/canvas/bounds/bounds-bg.tsx 파일 보기

@@ -2,7 +2,7 @@ import { useRef } from 'react'
2 2
 import state, { useSelector } from 'state'
3 3
 import inputs from 'state/inputs'
4 4
 import styled from 'styles'
5
-import { deepCompareArrays, getPage } from 'utils/utils'
5
+import { deepCompareArrays, getPage } from 'utils'
6 6
 
7 7
 function handlePointerDown(e: React.PointerEvent<SVGRectElement>) {
8 8
   if (!inputs.canAccept(e.pointerId)) return

+ 1
- 1
components/canvas/bounds/handles.tsx 파일 보기

@@ -3,7 +3,7 @@ import { getShapeUtils } from 'state/shape-utils'
3 3
 import { useRef } from 'react'
4 4
 import { useSelector } from 'state'
5 5
 import styled from 'styles'
6
-import { deepCompareArrays, getPage } from 'utils/utils'
6
+import { deepCompareArrays, getPage } from 'utils'
7 7
 import vec from 'utils/vec'
8 8
 
9 9
 export default function Handles(): JSX.Element {

+ 1
- 1
components/canvas/context-menu/context-menu.tsx 파일 보기

@@ -10,7 +10,7 @@ import {
10 10
   deepCompareArrays,
11 11
   getSelectedShapes,
12 12
   isMobile,
13
-} from 'utils/utils'
13
+} from 'utils'
14 14
 import state, { useSelector } from 'state'
15 15
 import {
16 16
   AlignType,

+ 1
- 1
components/canvas/defs.tsx 파일 보기

@@ -2,7 +2,7 @@ import { getShapeStyle } from 'state/shape-styles'
2 2
 import { getShapeUtils } from 'state/shape-utils'
3 3
 import React, { memo } from 'react'
4 4
 import { useSelector } from 'state'
5
-import { deepCompareArrays, getCurrentCamera, getPage } from 'utils/utils'
5
+import { deepCompareArrays, getCurrentCamera, getPage } from 'utils'
6 6
 import { DotCircle, Handle } from './misc'
7 7
 
8 8
 export default function Defs(): JSX.Element {

+ 1
- 1
components/canvas/page.tsx 파일 보기

@@ -2,7 +2,7 @@ import { getShapeUtils } from 'state/shape-utils'
2 2
 import { useSelector } from 'state'
3 3
 import { Bounds, PageState } from 'types'
4 4
 import { boundsCollide, boundsContain } from 'utils/bounds'
5
-import { deepCompareArrays, getPage, getViewport } from 'utils/utils'
5
+import { deepCompareArrays, getPage, getViewport } from 'utils'
6 6
 import Shape from './shape'
7 7
 
8 8
 /* 

+ 1
- 6
components/canvas/selected.tsx 파일 보기

@@ -1,11 +1,6 @@
1 1
 import styled from 'styles'
2 2
 import { useSelector } from 'state'
3
-import {
4
-  deepCompareArrays,
5
-  getPage,
6
-  getSelectedIds,
7
-  setToArray,
8
-} from 'utils/utils'
3
+import { deepCompareArrays, getPage, getSelectedIds, setToArray } from 'utils'
9 4
 import { getShapeUtils } from 'state/shape-utils'
10 5
 import { memo } from 'react'
11 6
 

+ 1
- 1
components/canvas/shape.tsx 파일 보기

@@ -2,7 +2,7 @@ import React, { useRef, memo, useEffect } from 'react'
2 2
 import { useSelector } from 'state'
3 3
 import styled from 'styles'
4 4
 import { getShapeUtils } from 'state/shape-utils'
5
-import { getPage, getSelectedIds, isMobile } from 'utils/utils'
5
+import { getPage, getSelectedIds, isMobile } from 'utils'
6 6
 import { Shape as _Shape } from 'types'
7 7
 import useShapeEvents from 'hooks/useShapeEvents'
8 8
 import vec from 'utils/vec'

+ 1
- 1
components/controls-panel/controls-panel.tsx 파일 보기

@@ -6,7 +6,7 @@ import { X, Code } from 'react-feather'
6 6
 import { IconButton } from 'components/shared'
7 7
 import * as Panel from '../panel'
8 8
 import Control from './control'
9
-import { deepCompareArrays } from 'utils/utils'
9
+import { deepCompareArrays } from 'utils'
10 10
 
11 11
 export default function ControlPanel(): JSX.Element {
12 12
   const rContainer = useRef<HTMLDivElement>(null)

+ 1
- 1
components/style-panel/style-panel.tsx 파일 보기

@@ -10,7 +10,7 @@ import {
10 10
   getPage,
11 11
   getSelectedIds,
12 12
   setToArray,
13
-} from 'utils/utils'
13
+} from 'utils'
14 14
 import AlignDistribute from './align-distribute'
15 15
 import { MoveType } from 'types'
16 16
 import SizePicker from './size-picker'

+ 1
- 1
hooks/useCamera.ts 파일 보기

@@ -2,7 +2,7 @@
2 2
 import React, { useEffect } from 'react'
3 3
 import state from 'state'
4 4
 import storage from 'state/storage'
5
-import { getCurrentCamera } from 'utils/utils'
5
+import { getCurrentCamera } from 'utils'
6 6
 
7 7
 /**
8 8
  * When the state's camera changes, update the transform of

+ 1
- 1
hooks/useKeyboardEvents.ts 파일 보기

@@ -2,7 +2,7 @@
2 2
 import { useEffect } from 'react'
3 3
 import state from 'state'
4 4
 import { MoveType } from 'types'
5
-import { getKeyboardEventInfo, metaKey } from 'utils/utils'
5
+import { getKeyboardEventInfo, metaKey } from 'utils'
6 6
 
7 7
 export default function useKeyboardEvents() {
8 8
   useEffect(() => {

+ 1
- 1
state/clipboard.ts 파일 보기

@@ -1,6 +1,6 @@
1 1
 import { getShapeUtils } from './shape-utils'
2 2
 import { Data, Shape } from 'types'
3
-import { getCommonBounds, getSelectedShapes } from 'utils/utils'
3
+import { getCommonBounds, getSelectedShapes } from 'utils'
4 4
 import state from './state'
5 5
 
6 6
 class Clipboard {

+ 1
- 1
state/code/arrow.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import CodeShape from './index'
2
-import { uniqueId } from 'utils/utils'
2
+import { uniqueId } from 'utils'
3 3
 import { ArrowShape, Decoration, ShapeStyles, ShapeType } from 'types'
4 4
 import { defaultStyle } from 'state/shape-styles'
5 5
 import { getShapeUtils } from 'state/shape-utils'

+ 1
- 1
state/code/control.ts 파일 보기

@@ -4,7 +4,7 @@ import {
4 4
   NumberCodeControl,
5 5
   VectorCodeControl,
6 6
 } from 'types'
7
-import { uniqueId } from 'utils/utils'
7
+import { uniqueId } from 'utils'
8 8
 
9 9
 export const controls: Record<string, any> = {}
10 10
 

+ 1
- 1
state/code/dot.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import CodeShape from './index'
2
-import { uniqueId } from 'utils/utils'
2
+import { uniqueId } from 'utils'
3 3
 import { DotShape, ShapeStyles, ShapeType } from 'types'
4 4
 import { defaultStyle } from 'state/shape-styles'
5 5
 

+ 1
- 1
state/code/draw.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import CodeShape from './index'
2
-import { uniqueId } from 'utils/utils'
2
+import { uniqueId } from 'utils'
3 3
 import { DrawShape, ShapeType } from 'types'
4 4
 import { defaultStyle } from 'state/shape-styles'
5 5
 

+ 1
- 1
state/code/ellipse.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import CodeShape from './index'
2
-import { uniqueId } from 'utils/utils'
2
+import { uniqueId } from 'utils'
3 3
 import { EllipseShape, ShapeStyles, ShapeType } from 'types'
4 4
 import { defaultStyle } from 'state/shape-styles'
5 5
 

+ 1
- 1
state/code/generate.ts 파일 보기

@@ -11,7 +11,7 @@ import Vec from 'utils/vec'
11 11
 import { NumberControl, VectorControl, codeControls, controls } from './control'
12 12
 import { codeShapes } from './index'
13 13
 import { CodeControl, Data, Shape } from 'types'
14
-import { getPage } from 'utils/utils'
14
+import { getPage } from 'utils'
15 15
 
16 16
 const baseScope = {
17 17
   Dot,

+ 1
- 1
state/code/line.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import CodeShape from './index'
2
-import { uniqueId } from 'utils/utils'
2
+import { uniqueId } from 'utils'
3 3
 import { LineShape, ShapeStyles, ShapeType } from 'types'
4 4
 import { defaultStyle } from 'state/shape-styles'
5 5
 

+ 1
- 1
state/code/polyline.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import CodeShape from './index'
2
-import { uniqueId } from 'utils/utils'
2
+import { uniqueId } from 'utils'
3 3
 import { PolylineShape, ShapeStyles, ShapeType } from 'types'
4 4
 import { defaultStyle } from 'state/shape-styles'
5 5
 

+ 1
- 1
state/code/ray.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import CodeShape from './index'
2
-import { uniqueId } from 'utils/utils'
2
+import { uniqueId } from 'utils'
3 3
 import { RayShape, ShapeStyles, ShapeType } from 'types'
4 4
 import { defaultStyle } from 'state/shape-styles'
5 5
 

+ 1
- 1
state/code/rectangle.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import CodeShape from './index'
2
-import { uniqueId } from 'utils/utils'
2
+import { uniqueId } from 'utils'
3 3
 import { RectangleShape, ShapeStyles, ShapeType } from 'types'
4 4
 import { defaultStyle } from 'state/shape-styles'
5 5
 

+ 40
- 42
state/code/utils.ts 파일 보기

@@ -1,51 +1,45 @@
1 1
 import { Bounds } from 'types'
2
-import Vector, { Point } from './vector'
2
+import { ease } from 'utils'
3
+import vec from 'utils/vec'
3 4
 
4 5
 /**
5 6
  * ## Utils
6 7
  */
7 8
 export default class Utils {
8
-  static vectorToPoint(point: number[] | Vector | undefined): number[] {
9
-    if (typeof point === 'undefined') {
10
-      return [0, 0]
11
-    }
12
-
13
-    if (point instanceof Vector) {
14
-      return [point.x, point.y]
15
-    }
16
-    return point
9
+  static pointsBetween(a: number[], b: number[], steps = 6): number[][] {
10
+    return Array.from(Array(steps))
11
+      .map((_, i) => ease(i / steps))
12
+      .map((t) => [...vec.lrp(a, b, t), (1 - t) / 2])
17 13
   }
18 14
 
19 15
   static getRayRayIntersection(
20
-    p0: Vector,
21
-    n0: Vector,
22
-    p1: Vector,
23
-    n1: Vector
24
-  ): Vector {
25
-    const p0e = Vector.add(p0, n0),
26
-      p1e = Vector.add(p1, n1),
27
-      m0 = (p0e.y - p0.y) / (p0e.x - p0.x),
28
-      m1 = (p1e.y - p1.y) / (p1e.x - p1.x),
29
-      b0 = p0.y - m0 * p0.x,
30
-      b1 = p1.y - m1 * p1.x,
16
+    p0: number[],
17
+    n0: number[],
18
+    p1: number[],
19
+    n1: number[]
20
+  ): number[] {
21
+    const p0e = vec.add(p0, n0),
22
+      p1e = vec.add(p1, n1),
23
+      m0 = (p0e[1] - p0[1]) / (p0e[0] - p0[0]),
24
+      m1 = (p1e[1] - p1[1]) / (p1e[0] - p1[0]),
25
+      b0 = p0[1] - m0 * p0[0],
26
+      b1 = p1[1] - m1 * p1[0],
31 27
       x = (b1 - b0) / (m0 - m1),
32 28
       y = m0 * x + b0
33 29
 
34
-    return new Vector({ x, y })
30
+    return [x, y]
35 31
   }
36 32
 
37 33
   static getCircleTangentToPoint(
38
-    A: Point | Vector,
34
+    A: number[],
39 35
     r0: number,
40
-    P: Point | Vector,
36
+    P: number[],
41 37
     side: number
42
-  ): Vector {
43
-    const v0 = Vector.cast(A)
44
-    const v1 = Vector.cast(P)
45
-    const B = Vector.lrp(v0, v1, 0.5),
46
-      r1 = Vector.dist(v0, B),
47
-      delta = Vector.sub(B, v0),
48
-      d = Vector.len(delta)
38
+  ): number[] {
39
+    const B = vec.lrp(A, P, 0.5),
40
+      r1 = vec.dist(A, B),
41
+      delta = vec.sub(B, A),
42
+      d = vec.len(delta)
49 43
 
50 44
     if (!(d <= r0 + r1 && d >= Math.abs(r0 - r1))) {
51 45
       return
@@ -53,21 +47,25 @@ export default class Utils {
53 47
 
54 48
     const a = (r0 * r0 - r1 * r1 + d * d) / (2.0 * d),
55 49
       n = 1 / d,
56
-      p = Vector.add(v0, Vector.mul(delta, a * n)),
50
+      p = vec.add(A, vec.mul(delta, a * n)),
57 51
       h = Math.sqrt(r0 * r0 - a * a),
58
-      k = Vector.mul(Vector.per(delta), h * n)
52
+      k = vec.mul(vec.per(delta), h * n)
59 53
 
60
-    return side === 0 ? p.add(k) : p.sub(k)
54
+    return side === 0 ? vec.add(p, k) : vec.sub(p, k)
61 55
   }
62 56
 
63
-  static shortAngleDist(a: number, b: number): number {
57
+  static shortAngleDist(a0: number, a1: number): number {
64 58
     const max = Math.PI * 2
65
-    const da = (b - a) % max
59
+    const da = (a1 - a0) % max
66 60
     return ((2 * da) % max) - da
67 61
   }
68 62
 
69
-  static getSweep(C: Vector, A: Vector, B: Vector): number {
70
-    return Utils.shortAngleDist(Vector.ang(C, A), Vector.ang(C, B))
63
+  static angleDelta(a0: number, a1: number): number {
64
+    return this.shortAngleDist(a0, a1)
65
+  }
66
+
67
+  static getSweep(C: number[], A: number[], B: number[]): number {
68
+    return this.angleDelta(vec.angle(C, A), vec.angle(C, B))
71 69
   }
72 70
 
73 71
   static bez1d(a: number, b: number, c: number, d: number, t: number): number {
@@ -80,10 +78,10 @@ export default class Utils {
80 78
   }
81 79
 
82 80
   static getCubicBezierBounds(
83
-    p0: Point | Vector,
84
-    c0: Point | Vector,
85
-    c1: Point | Vector,
86
-    p1: Point | Vector
81
+    p0: number[],
82
+    c0: number[],
83
+    c1: number[],
84
+    p1: number[]
87 85
   ): Bounds {
88 86
     // solve for x
89 87
     let a = 3 * p1[0] - 9 * c1[0] + 9 * c0[0] - 3 * p0[0]

+ 46
- 0
state/code/vector.ts 파일 보기

@@ -494,3 +494,49 @@ export default class Vector {
494 494
     return Vector.dist(a, Vector.nearestPointOnLineSegment(a, p0, p1, clamp))
495 495
   }
496 496
 }
497
+
498
+export class Utils {
499
+  static getRayRayIntersection(
500
+    p0: Vector,
501
+    n0: Vector,
502
+    p1: Vector,
503
+    n1: Vector
504
+  ): Vector {
505
+    const p0e = Vector.add(p0, n0),
506
+      p1e = Vector.add(p1, n1),
507
+      m0 = (p0e.y - p0.y) / (p0e.x - p0.x),
508
+      m1 = (p1e.y - p1.y) / (p1e.x - p1.x),
509
+      b0 = p0.y - m0 * p0.x,
510
+      b1 = p1.y - m1 * p1.x,
511
+      x = (b1 - b0) / (m0 - m1),
512
+      y = m0 * x + b0
513
+
514
+    return new Vector({ x, y })
515
+  }
516
+
517
+  static getCircleTangentToPoint(
518
+    A: Point | Vector,
519
+    r0: number,
520
+    P: Point | Vector,
521
+    side: number
522
+  ): Vector {
523
+    const v0 = Vector.cast(A)
524
+    const v1 = Vector.cast(P)
525
+    const B = Vector.lrp(v0, v1, 0.5),
526
+      r1 = Vector.dist(v0, B),
527
+      delta = Vector.sub(B, v0),
528
+      d = Vector.len(delta)
529
+
530
+    if (!(d <= r0 + r1 && d >= Math.abs(r0 - r1))) {
531
+      return
532
+    }
533
+
534
+    const a = (r0 * r0 - r1 * r1 + d * d) / (2.0 * d),
535
+      n = 1 / d,
536
+      p = Vector.add(v0, Vector.mul(delta, a * n)),
537
+      h = Math.sqrt(r0 * r0 - a * a),
538
+      k = Vector.mul(Vector.per(delta), h * n)
539
+
540
+    return side === 0 ? p.add(k) : p.sub(k)
541
+  }
542
+}

+ 1
- 1
state/commands/align.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { AlignType, Data } from 'types'
4
-import { getCommonBounds, getPage, getSelectedShapes } from 'utils/utils'
4
+import { getCommonBounds, getPage, getSelectedShapes } from 'utils'
5 5
 import { getShapeUtils } from 'state/shape-utils'
6 6
 
7 7
 export default function alignCommand(data: Data, type: AlignType): void {

+ 1
- 1
state/commands/arrow.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data } from 'types'
4
-import { getPage, getSelectedIds } from 'utils/utils'
4
+import { getPage, getSelectedIds } from 'utils'
5 5
 import { ArrowSnapshot } from 'state/sessions/arrow-session'
6 6
 
7 7
 export default function arrowCommand(

+ 1
- 1
state/commands/command.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import { Data } from 'types'
2
-import { getSelectedIds, setSelectedIds, setToArray } from 'utils/utils'
2
+import { getSelectedIds, setSelectedIds, setToArray } from 'utils'
3 3
 
4 4
 /* ------------------ Command Class ----------------- */
5 5
 

+ 1
- 1
state/commands/create-page.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data, Page, PageState } from 'types'
4
-import { uniqueId } from 'utils/utils'
4
+import { uniqueId } from 'utils'
5 5
 import { current } from 'immer'
6 6
 import storage from 'state/storage'
7 7
 

+ 1
- 1
state/commands/delete-selected.ts 파일 보기

@@ -6,7 +6,7 @@ import {
6 6
   getPage,
7 7
   getSelectedShapes,
8 8
   setSelectedIds,
9
-} from 'utils/utils'
9
+} from 'utils'
10 10
 import { current } from 'immer'
11 11
 import { getShapeUtils } from 'state/shape-utils'
12 12
 

+ 1
- 1
state/commands/direct.ts 파일 보기

@@ -2,7 +2,7 @@ import Command from './command'
2 2
 import history from '../history'
3 3
 import { DirectionSnapshot } from 'state/sessions/direction-session'
4 4
 import { Data, LineShape, RayShape } from 'types'
5
-import { getPage } from 'utils/utils'
5
+import { getPage } from 'utils'
6 6
 
7 7
 export default function directCommand(
8 8
   data: Data,

+ 1
- 1
state/commands/distribute.ts 파일 보기

@@ -6,7 +6,7 @@ import {
6 6
   getCommonBounds,
7 7
   getPage,
8 8
   getSelectedShapes,
9
-} from 'utils/utils'
9
+} from 'utils'
10 10
 import { getShapeUtils } from 'state/shape-utils'
11 11
 
12 12
 export default function distributeCommand(

+ 1
- 1
state/commands/double-point-handle.ts 파일 보기

@@ -2,7 +2,7 @@ import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data, PointerInfo } from 'types'
4 4
 import { getShapeUtils } from 'state/shape-utils'
5
-import { deepClone, getPage, getShape, updateParents } from 'utils/utils'
5
+import { deepClone, getPage, getShape, updateParents } from 'utils'
6 6
 
7 7
 export default function doublePointHandleCommand(
8 8
   data: Data,

+ 1
- 1
state/commands/draw.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data, DrawShape } from 'types'
4
-import { getPage, setSelectedIds } from 'utils/utils'
4
+import { getPage, setSelectedIds } from 'utils'
5 5
 import { current } from 'immer'
6 6
 
7 7
 export default function drawCommand(data: Data, id: string): void {

+ 2
- 2
state/commands/duplicate.ts 파일 보기

@@ -6,8 +6,8 @@ import {
6 6
   getPage,
7 7
   getSelectedShapes,
8 8
   setSelectedIds,
9
-} from 'utils/utils'
10
-import { uniqueId } from 'utils/utils'
9
+} from 'utils'
10
+import { uniqueId } from 'utils'
11 11
 import { current } from 'immer'
12 12
 import vec from 'utils/vec'
13 13
 

+ 1
- 1
state/commands/edit.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data } from 'types'
4
-import { getPage } from 'utils/utils'
4
+import { getPage } from 'utils'
5 5
 import { EditSnapshot } from 'state/sessions/edit-session'
6 6
 import { getShapeUtils } from 'state/shape-utils'
7 7
 

+ 1
- 1
state/commands/generate.ts 파일 보기

@@ -2,7 +2,7 @@ import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data, Shape } from 'types'
4 4
 import { current } from 'immer'
5
-import { getPage, setSelectedIds } from 'utils/utils'
5
+import { getPage, setSelectedIds } from 'utils'
6 6
 
7 7
 export default function generateCommand(
8 8
   data: Data,

+ 1
- 1
state/commands/group.ts 파일 보기

@@ -8,7 +8,7 @@ import {
8 8
   getSelectedShapes,
9 9
   getShape,
10 10
   setSelectedIds,
11
-} from 'utils/utils'
11
+} from 'utils'
12 12
 import { current } from 'immer'
13 13
 import { createShape, getShapeUtils } from 'state/shape-utils'
14 14
 import commands from '.'

+ 1
- 1
state/commands/handle.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data } from 'types'
4
-import { getPage } from 'utils/utils'
4
+import { getPage } from 'utils'
5 5
 import { HandleSnapshot } from 'state/sessions/handle-session'
6 6
 import { getShapeUtils } from 'state/shape-utils'
7 7
 

+ 1
- 1
state/commands/move-to-page.ts 파일 보기

@@ -8,7 +8,7 @@ import {
8 8
   getSelectedIds,
9 9
   setToArray,
10 10
   uniqueArray,
11
-} from 'utils/utils'
11
+} from 'utils'
12 12
 import { getShapeUtils } from 'state/shape-utils'
13 13
 import storage from 'state/storage'
14 14
 

+ 1
- 1
state/commands/move.ts 파일 보기

@@ -7,7 +7,7 @@ import {
7 7
   getPage,
8 8
   getSelectedIds,
9 9
   setToArray,
10
-} from 'utils/utils'
10
+} from 'utils'
11 11
 import { getShapeUtils } from 'state/shape-utils'
12 12
 
13 13
 export default function moveCommand(data: Data, type: MoveType): void {

+ 1
- 1
state/commands/mutate.ts 파일 보기

@@ -2,7 +2,7 @@ import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data, Shape } from 'types'
4 4
 import { getShapeUtils } from 'state/shape-utils'
5
-import { getPage, updateParents } from 'utils/utils'
5
+import { getPage, updateParents } from 'utils'
6 6
 
7 7
 // Used when changing the properties of one or more shapes,
8 8
 // without changing selection or deleting any shapes.

+ 1
- 1
state/commands/nudge.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data } from 'types'
4
-import { getPage, getSelectedShapes } from 'utils/utils'
4
+import { getPage, getSelectedShapes } from 'utils'
5 5
 import { getShapeUtils } from 'state/shape-utils'
6 6
 import vec from 'utils/vec'
7 7
 

+ 2
- 2
state/commands/paste.ts 파일 보기

@@ -8,8 +8,8 @@ import {
8 8
   screenToWorld,
9 9
   setSelectedIds,
10 10
   setToArray,
11
-} from 'utils/utils'
12
-import { uniqueId } from 'utils/utils'
11
+} from 'utils'
12
+import { uniqueId } from 'utils'
13 13
 import vec from 'utils/vec'
14 14
 import { getShapeUtils } from 'state/shape-utils'
15 15
 import state from 'state/state'

+ 1
- 1
state/commands/reset-bounds.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data } from 'types'
4
-import { getPage, getSelectedShapes, updateParents } from 'utils/utils'
4
+import { getPage, getSelectedShapes, updateParents } from 'utils'
5 5
 import { current } from 'immer'
6 6
 import { getShapeUtils } from 'state/shape-utils'
7 7
 

+ 1
- 1
state/commands/rotate-ccw.ts 파일 보기

@@ -6,7 +6,7 @@ import {
6 6
   getCommonBounds,
7 7
   getPage,
8 8
   getSelectedShapes,
9
-} from 'utils/utils'
9
+} from 'utils'
10 10
 import vec from 'utils/vec'
11 11
 import { getShapeUtils } from 'state/shape-utils'
12 12
 

+ 1
- 1
state/commands/rotate.ts 파일 보기

@@ -2,7 +2,7 @@ import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data } from 'types'
4 4
 import { RotateSnapshot } from 'state/sessions/rotate-session'
5
-import { getPage } from 'utils/utils'
5
+import { getPage } from 'utils'
6 6
 import { getShapeUtils } from 'state/shape-utils'
7 7
 
8 8
 export default function rotateCommand(

+ 1
- 6
state/commands/stretch.ts 파일 보기

@@ -1,12 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { StretchType, Data, Corner } from 'types'
4
-import {
5
-  deepClone,
6
-  getCommonBounds,
7
-  getPage,
8
-  getSelectedShapes,
9
-} from 'utils/utils'
4
+import { deepClone, getCommonBounds, getPage, getSelectedShapes } from 'utils'
10 5
 import { getShapeUtils } from 'state/shape-utils'
11 6
 
12 7
 export default function stretchCommand(data: Data, type: StretchType): void {

+ 1
- 6
state/commands/style.ts 파일 보기

@@ -1,12 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data, ShapeStyles } from 'types'
4
-import {
5
-  getDocumentBranch,
6
-  getPage,
7
-  getSelectedIds,
8
-  setToArray,
9
-} from 'utils/utils'
4
+import { getDocumentBranch, getPage, getSelectedIds, setToArray } from 'utils'
10 5
 import { getShapeUtils } from 'state/shape-utils'
11 6
 import { current } from 'immer'
12 7
 

+ 1
- 1
state/commands/toggle.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data, Shape } from 'types'
4
-import { getPage, getSelectedShapes } from 'utils/utils'
4
+import { getPage, getSelectedShapes } from 'utils'
5 5
 import { getShapeUtils } from 'state/shape-utils'
6 6
 import { PropsOfType } from 'types'
7 7
 

+ 1
- 1
state/commands/transform-single.ts 파일 보기

@@ -3,7 +3,7 @@ import history from '../history'
3 3
 import { Data } from 'types'
4 4
 import { current } from 'immer'
5 5
 import { TransformSingleSnapshot } from 'state/sessions/transform-single-session'
6
-import { getPage, setSelectedIds, updateParents } from 'utils/utils'
6
+import { getPage, setSelectedIds, updateParents } from 'utils'
7 7
 
8 8
 export default function transformSingleCommand(
9 9
   data: Data,

+ 1
- 1
state/commands/transform.ts 파일 보기

@@ -2,7 +2,7 @@ import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data } from 'types'
4 4
 import { TransformSnapshot } from 'state/sessions/transform-session'
5
-import { getPage, updateParents } from 'utils/utils'
5
+import { getPage, updateParents } from 'utils'
6 6
 
7 7
 export default function transformCommand(
8 8
   data: Data,

+ 1
- 1
state/commands/translate.ts 파일 보기

@@ -7,7 +7,7 @@ import {
7 7
   getPage,
8 8
   setSelectedIds,
9 9
   updateParents,
10
-} from 'utils/utils'
10
+} from 'utils'
11 11
 import { getShapeUtils } from 'state/shape-utils'
12 12
 
13 13
 export default function translateCommand(

+ 1
- 1
state/commands/ungroup.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import Command from './command'
2 2
 import history from '../history'
3 3
 import { Data, ShapeType } from 'types'
4
-import { getPage, getSelectedShapes, setSelectedIds } from 'utils/utils'
4
+import { getPage, getSelectedShapes, setSelectedIds } from 'utils'
5 5
 import { current } from 'immer'
6 6
 import { getShapeUtils } from 'state/shape-utils'
7 7
 

+ 1
- 1
state/hacks.ts 파일 보기

@@ -5,7 +5,7 @@ import {
5 5
   getSelectedIds,
6 6
   screenToWorld,
7 7
   setToArray,
8
-} from 'utils/utils'
8
+} from 'utils'
9 9
 import { freeze } from 'immer'
10 10
 import session from './session'
11 11
 import state from './state'

+ 1
- 1
state/inputs.tsx 파일 보기

@@ -1,7 +1,7 @@
1 1
 import React from 'react'
2 2
 import { PointerInfo } from 'types'
3 3
 import vec from 'utils/vec'
4
-import { isDarwin, getPoint } from 'utils/utils'
4
+import { isDarwin, getPoint } from 'utils'
5 5
 
6 6
 const DOUBLE_CLICK_DURATION = 250
7 7
 

+ 1
- 1
state/sessions/arrow-session.ts 파일 보기

@@ -9,7 +9,7 @@ import {
9 9
   getSelectedIds,
10 10
   setToArray,
11 11
   updateParents,
12
-} from 'utils/utils'
12
+} from 'utils'
13 13
 import { getShapeUtils } from 'state/shape-utils'
14 14
 
15 15
 export default class ArrowSession extends BaseSession {

+ 1
- 1
state/sessions/brush-session.ts 파일 보기

@@ -9,7 +9,7 @@ import {
9 9
   getTopParentId,
10 10
   setSelectedIds,
11 11
   setToArray,
12
-} from 'utils/utils'
12
+} from 'utils'
13 13
 import vec from 'utils/vec'
14 14
 
15 15
 export default class BrushSession extends BaseSession {

+ 1
- 1
state/sessions/direction-session.ts 파일 보기

@@ -3,7 +3,7 @@ import vec from 'utils/vec'
3 3
 import BaseSession from './base-session'
4 4
 import commands from 'state/commands'
5 5
 import { current } from 'immer'
6
-import { getPage, getSelectedIds } from 'utils/utils'
6
+import { getPage, getSelectedIds } from 'utils'
7 7
 
8 8
 export default class DirectionSession extends BaseSession {
9 9
   delta = [0, 0]

+ 1
- 1
state/sessions/draw-session.ts 파일 보기

@@ -2,7 +2,7 @@ import { current } from 'immer'
2 2
 import { Data, DrawShape } from 'types'
3 3
 import BaseSession from './base-session'
4 4
 import { getShapeUtils } from 'state/shape-utils'
5
-import { getPage, getShape, updateParents } from 'utils/utils'
5
+import { getPage, getShape, updateParents } from 'utils'
6 6
 import vec from 'utils/vec'
7 7
 import commands from 'state/commands'
8 8
 export default class BrushSession extends BaseSession {

+ 1
- 1
state/sessions/edit-session.ts 파일 보기

@@ -2,7 +2,7 @@ import { Data, Shape } from 'types'
2 2
 import BaseSession from './base-session'
3 3
 import commands from 'state/commands'
4 4
 import { current } from 'immer'
5
-import { getPage, getSelectedShapes, getShape } from 'utils/utils'
5
+import { getPage, getSelectedShapes, getShape } from 'utils'
6 6
 import { getShapeUtils } from 'state/shape-utils'
7 7
 
8 8
 export default class EditSession extends BaseSession {

+ 1
- 1
state/sessions/handle-session.ts 파일 보기

@@ -3,7 +3,7 @@ import vec from 'utils/vec'
3 3
 import BaseSession from './base-session'
4 4
 import commands from 'state/commands'
5 5
 import { current } from 'immer'
6
-import { getPage } from 'utils/utils'
6
+import { getPage } from 'utils'
7 7
 import { getShapeUtils } from 'state/shape-utils'
8 8
 
9 9
 export default class HandleSession extends BaseSession {

+ 1
- 1
state/sessions/rotate-session.ts 파일 보기

@@ -14,7 +14,7 @@ import {
14 14
   getDocumentBranch,
15 15
   setToArray,
16 16
   getSelectedIds,
17
-} from 'utils/utils'
17
+} from 'utils'
18 18
 import { getShapeUtils } from 'state/shape-utils'
19 19
 
20 20
 const PI2 = Math.PI * 2

+ 1
- 1
state/sessions/transform-session.ts 파일 보기

@@ -15,7 +15,7 @@ import {
15 15
   getTransformedBoundingBox,
16 16
   setToArray,
17 17
   updateParents,
18
-} from 'utils/utils'
18
+} from 'utils'
19 19
 
20 20
 export default class TransformSession extends BaseSession {
21 21
   scaleX = 1

+ 1
- 1
state/sessions/transform-single-session.ts 파일 보기

@@ -10,7 +10,7 @@ import {
10 10
   getShape,
11 11
   getSelectedShapes,
12 12
   updateParents,
13
-} from 'utils/utils'
13
+} from 'utils'
14 14
 
15 15
 export default class TransformSingleSession extends BaseSession {
16 16
   transformType: Edge | Corner

+ 2
- 2
state/sessions/translate-session.ts 파일 보기

@@ -3,7 +3,7 @@ import vec from 'utils/vec'
3 3
 import BaseSession from './base-session'
4 4
 import commands from 'state/commands'
5 5
 import { current } from 'immer'
6
-import { uniqueId } from 'utils/utils'
6
+import { uniqueId } from 'utils'
7 7
 import {
8 8
   getChildIndexAbove,
9 9
   getDocumentBranch,
@@ -11,7 +11,7 @@ import {
11 11
   getSelectedShapes,
12 12
   setSelectedIds,
13 13
   updateParents,
14
-} from 'utils/utils'
14
+} from 'utils'
15 15
 import { getShapeUtils } from 'state/shape-utils'
16 16
 
17 17
 export default class TranslateSession extends BaseSession {

+ 3
- 3
state/shape-utils/arrow.tsx 파일 보기

@@ -1,4 +1,4 @@
1
-import { getArcLength, uniqueId } from 'utils/utils'
1
+import { getArcLength, uniqueId } from 'utils'
2 2
 import vec from 'utils/vec'
3 3
 import {
4 4
   getSvgPathFromStroke,
@@ -6,7 +6,7 @@ import {
6 6
   getBoundsFromPoints,
7 7
   translateBounds,
8 8
   pointsBetween,
9
-} from 'utils/utils'
9
+} from 'utils'
10 10
 import {
11 11
   ArrowShape,
12 12
   DashStyle,
@@ -14,7 +14,7 @@ import {
14 14
   ShapeHandle,
15 15
   ShapeType,
16 16
 } from 'types'
17
-import { circleFromThreePoints, isAngleBetween } from 'utils/utils'
17
+import { circleFromThreePoints, isAngleBetween } from 'utils'
18 18
 import { pointInBounds } from 'utils/hitTests'
19 19
 import {
20 20
   intersectArcBounds,

+ 2
- 2
state/shape-utils/dot.tsx 파일 보기

@@ -1,8 +1,8 @@
1
-import { uniqueId } from 'utils/utils'
1
+import { uniqueId } from 'utils'
2 2
 import { DotShape, ShapeType } from 'types'
3 3
 import { boundsContained } from 'utils/bounds'
4 4
 import { intersectCircleBounds } from 'utils/intersections'
5
-import { translateBounds } from 'utils/utils'
5
+import { translateBounds } from 'utils'
6 6
 import { defaultStyle } from 'state/shape-styles'
7 7
 import { registerShapeUtils } from './register'
8 8
 

+ 2
- 2
state/shape-utils/draw.tsx 파일 보기

@@ -1,4 +1,4 @@
1
-import { uniqueId } from 'utils/utils'
1
+import { uniqueId } from 'utils'
2 2
 import vec from 'utils/vec'
3 3
 import { DashStyle, DrawShape, ShapeStyles, ShapeType } from 'types'
4 4
 import { intersectPolylineBounds } from 'utils/intersections'
@@ -9,7 +9,7 @@ import {
9 9
   getBoundsFromPoints,
10 10
   getSvgPathFromStroke,
11 11
   translateBounds,
12
-} from 'utils/utils'
12
+} from 'utils'
13 13
 import { defaultStyle, getShapeStyle } from 'state/shape-styles'
14 14
 import { registerShapeUtils } from './register'
15 15
 

+ 1
- 1
state/shape-utils/ellipse.tsx 파일 보기

@@ -11,7 +11,7 @@ import {
11 11
   getSvgPathFromStroke,
12 12
   rng,
13 13
   translateBounds,
14
-} from 'utils/utils'
14
+} from 'utils'
15 15
 import { defaultStyle, getShapeStyle } from 'state/shape-styles'
16 16
 import getStroke from 'perfect-freehand'
17 17
 import { registerShapeUtils } from './register'

+ 2
- 2
state/shape-utils/group.tsx 파일 보기

@@ -1,8 +1,8 @@
1
-import { uniqueId } from 'utils/utils'
1
+import { uniqueId } from 'utils'
2 2
 import vec from 'utils/vec'
3 3
 import { GroupShape, ShapeType } from 'types'
4 4
 import { getShapeUtils } from './index'
5
-import { getCommonBounds, translateBounds } from 'utils/utils'
5
+import { getCommonBounds, translateBounds } from 'utils'
6 6
 import { defaultStyle } from 'state/shape-styles'
7 7
 import styled from 'styles'
8 8
 import { registerShapeUtils } from './register'

+ 2
- 2
state/shape-utils/line.tsx 파일 보기

@@ -1,10 +1,10 @@
1
-import { uniqueId } from 'utils/utils'
1
+import { uniqueId } from 'utils'
2 2
 import vec from 'utils/vec'
3 3
 import { LineShape, ShapeType } from 'types'
4 4
 import { boundsContained } from 'utils/bounds'
5 5
 import { intersectCircleBounds } from 'utils/intersections'
6 6
 import { ThinLine } from 'components/canvas/misc'
7
-import { translateBounds } from 'utils/utils'
7
+import { translateBounds } from 'utils'
8 8
 import { defaultStyle } from 'state/shape-styles'
9 9
 import { registerShapeUtils } from './register'
10 10
 

+ 2
- 2
state/shape-utils/polyline.tsx 파일 보기

@@ -1,9 +1,9 @@
1
-import { uniqueId } from 'utils/utils'
1
+import { uniqueId } from 'utils'
2 2
 import vec from 'utils/vec'
3 3
 import { PolylineShape, ShapeType } from 'types'
4 4
 import { intersectPolylineBounds } from 'utils/intersections'
5 5
 import { boundsContainPolygon } from 'utils/bounds'
6
-import { getBoundsFromPoints, translateBounds } from 'utils/utils'
6
+import { getBoundsFromPoints, translateBounds } from 'utils'
7 7
 import { defaultStyle } from 'state/shape-styles'
8 8
 import { registerShapeUtils } from './register'
9 9
 

+ 2
- 2
state/shape-utils/ray.tsx 파일 보기

@@ -1,10 +1,10 @@
1
-import { uniqueId } from 'utils/utils'
1
+import { uniqueId } from 'utils'
2 2
 import vec from 'utils/vec'
3 3
 import { RayShape, ShapeType } from 'types'
4 4
 import { boundsContained } from 'utils/bounds'
5 5
 import { intersectCircleBounds } from 'utils/intersections'
6 6
 import { ThinLine } from 'components/canvas/misc'
7
-import { translateBounds } from 'utils/utils'
7
+import { translateBounds } from 'utils'
8 8
 import { defaultStyle } from 'state/shape-styles'
9 9
 import { registerShapeUtils } from './register'
10 10
 

+ 2
- 2
state/shape-utils/rectangle.tsx 파일 보기

@@ -1,4 +1,4 @@
1
-import { uniqueId } from 'utils/utils'
1
+import { uniqueId } from 'utils'
2 2
 import vec from 'utils/vec'
3 3
 import { DashStyle, RectangleShape, ShapeType } from 'types'
4 4
 import {
@@ -7,7 +7,7 @@ import {
7 7
   rng,
8 8
   shuffleArr,
9 9
   pointsBetween,
10
-} from 'utils/utils'
10
+} from 'utils'
11 11
 import { defaultStyle, getShapeStyle } from 'state/shape-styles'
12 12
 import getStroke from 'perfect-freehand'
13 13
 import { registerShapeUtils } from './register'

+ 2
- 6
state/shape-utils/register.tsx 파일 보기

@@ -1,12 +1,8 @@
1 1
 import { Shape, ShapeUtility } from 'types'
2 2
 import vec from 'utils/vec'
3
-import {
4
-  getBoundsCenter,
5
-  getBoundsFromPoints,
6
-  getRotatedCorners,
7
-} from 'utils/utils'
3
+import { getBoundsCenter, getBoundsFromPoints, getRotatedCorners } from 'utils'
8 4
 import { boundsCollidePolygon, boundsContainPolygon } from 'utils/bounds'
9
-import { uniqueId } from 'utils/utils'
5
+import { uniqueId } from 'utils'
10 6
 import React from 'react'
11 7
 import { pointInBounds } from 'utils/hitTests'
12 8
 

+ 1
- 1
state/shape-utils/text.tsx 파일 보기

@@ -1,4 +1,4 @@
1
-import { uniqueId, isMobile } from 'utils/utils'
1
+import { uniqueId, isMobile } from 'utils'
2 2
 import vec from 'utils/vec'
3 3
 import { TextShape, ShapeType, FontSize } from 'types'
4 4
 import {

+ 1
- 1
state/state.ts 파일 보기

@@ -28,7 +28,7 @@ import {
28 28
   getPageState,
29 29
   setToArray,
30 30
   copyToClipboard,
31
-} from 'utils/utils'
31
+} from 'utils'
32 32
 import {
33 33
   Data,
34 34
   PointerInfo,

+ 2
- 2
state/storage.ts 파일 보기

@@ -1,7 +1,7 @@
1 1
 import { Data, PageState, TLDocument } from 'types'
2
-import { decompress, compress, setToArray } from 'utils/utils'
2
+import { decompress, compress, setToArray } from 'utils'
3 3
 import state from './state'
4
-import { uniqueId } from 'utils/utils'
4
+import { uniqueId } from 'utils'
5 5
 import * as idb from 'idb-keyval'
6 6
 
7 7
 const CURRENT_VERSION = 'code_slate_0.0.8'

+ 11
- 0
types.ts 파일 보기

@@ -355,6 +355,17 @@ export enum DistributeType {
355 355
   Vertical,
356 356
 }
357 357
 
358
+export interface BezierCurveSegment {
359
+  start: number[]
360
+  tangentStart: number[]
361
+  normalStart: number[]
362
+  pressureStart: number
363
+  end: number[]
364
+  tangentEnd: number[]
365
+  normalEnd: number[]
366
+  pressureEnd: number
367
+}
368
+
358 369
 /* -------------------------------------------------- */
359 370
 /*                     Code Editor                    */
360 371
 /* -------------------------------------------------- */

+ 1
- 0
utils/index.ts 파일 보기

@@ -0,0 +1 @@
1
+export * from './utils'

+ 1
- 1
utils/svg.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 // Some helpers for drawing SVGs.
2
-import { getSweep } from 'utils/utils'
2
+import { getSweep } from 'utils'
3 3
 
4 4
 // General
5 5
 

Loading…
취소
저장