Skip to content

Commit

Permalink
Use relative imports to load type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed Feb 16, 2025
1 parent fa57699 commit e053640
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'
import { observer } from 'mobx-react'
import styled, { css, withTheme } from 'styled-components'

import useScale from '@plugins/drawingTools/hooks/useScale'
import useScale from '../../hooks/useScale'

const StyledGroup = styled('g')`
&:focus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styled from 'styled-components'
import draggable from '../draggable'
import { STROKE_WIDTH } from '../Mark/Mark';

import useScale from '@plugins/drawingTools/hooks/useScale'
import useScale from '../../hooks/useScale'

const StyledCircle = styled('circle')`
stroke-width: 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { observer } from 'mobx-react'
import PropTypes from 'prop-types'

import useScale from '@plugins/drawingTools/hooks/useScale'
import useScale from '../../hooks/useScale'

// TODO update per tool size prop

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { string, number } from 'prop-types'
import draggable from '../draggable'
import { useTranslation } from '@translations/i18n'

import useScale from '@plugins/drawingTools/hooks/useScale'
import useScale from '../../hooks/useScale'

const RotateHandle = forwardRef(function RotateHandle(
{ fill = 'currentColor', x, y },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { number, func } from 'prop-types'
import styled from 'styled-components'
import { Tooltip } from '@zooniverse/react-components'

import useScale from '@plugins/drawingTools/hooks/useScale'
import useScale from '../../hooks/useScale'

const StyledGroup = styled('g')`
&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components'
import DragHandle from '../../../components/DragHandle'
import { useTranslation } from '@translations/i18n'

import useScale from '@plugins/drawingTools/hooks/useScale'
import useScale from '../../../hooks/useScale'

const GRAB_STROKE_WIDTH = 10
const FINISHER_RADIUS = 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Tooltip } from '@zooniverse/react-components'
import SVGContext from '@plugins/drawingTools/shared/SVGContext'
import { useTranslation } from '@translations/i18n'
import { Pan, Radial, Redo, Trash, Undo, Checkmark, Close } from 'grommet-icons'
import useScale from '@plugins/drawingTools/hooks/useScale'
import useScale from '../../../hooks/useScale'

const StyledPath = styled('path')`
&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { observer } from 'mobx-react'
import { DragHandle } from '@plugins/drawingTools/components'
import { HANDLE_RADIUS, GRAB_STROKE_WIDTH } from '../../helpers/constants'

import useScale from '@plugins/drawingTools/hooks/useScale'
import useScale from '../../../../../hooks/useScale'

const Circle = ({ fill, r, transform, ...props }) => (
<g transform={transform}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext, useState } from 'react'

import SVGContext from '@plugins/drawingTools/shared/SVGContext'
import SVGContext from '../shared/SVGContext'

/**
* Get the rotation angle of the drawing canvas.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
import { createContext } from 'react'

export default createContext({})
/**
* Canvas context for drawing tools.
*/
export default createContext({
/**
* The drawing canvas node from the DOM.
* @type {SVGGraphicsElement}
* @default null
*/
canvas: null
})

0 comments on commit e053640

Please sign in to comment.