@pie-lib/tools 0.29.2-next.0 → 0.29.2-next.164
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.
- package/CHANGELOG.md +7 -70
- package/esm/index.css +847 -0
- package/esm/index.js +13155 -0
- package/esm/index.js.map +1 -0
- package/esm/package.json +3 -0
- package/lib/anchor-utils.js +18 -74
- package/lib/anchor-utils.js.map +1 -1
- package/lib/anchor.js +20 -28
- package/lib/anchor.js.map +1 -1
- package/lib/index.js +1 -11
- package/lib/index.js.map +1 -1
- package/lib/protractor/graphic.js +68 -105
- package/lib/protractor/graphic.js.map +1 -1
- package/lib/protractor/index.js +35 -65
- package/lib/protractor/index.js.map +1 -1
- package/lib/rotatable.js +73 -141
- package/lib/rotatable.js.map +1 -1
- package/lib/ruler/graphic.js +29 -66
- package/lib/ruler/graphic.js.map +1 -1
- package/lib/ruler/index.js +43 -75
- package/lib/ruler/index.js.map +1 -1
- package/lib/ruler/unit-type.js +19 -36
- package/lib/ruler/unit-type.js.map +1 -1
- package/lib/ruler/unit.js +51 -88
- package/lib/ruler/unit.js.map +1 -1
- package/lib/style-utils.js +2 -9
- package/lib/style-utils.js.map +1 -1
- package/lib/transform-origin.js +2 -13
- package/lib/transform-origin.js.map +1 -1
- package/package.json +20 -10
- package/src/__tests__/rotatable.test.jsx +84 -41
- package/src/anchor.jsx +15 -16
- package/src/protractor/__tests__/graphic.test.jsx +57 -6
- package/src/protractor/__tests__/index.test.jsx +58 -6
- package/src/protractor/graphic.jsx +49 -54
- package/src/protractor/index.jsx +24 -22
- package/src/rotatable.jsx +23 -28
- package/src/ruler/__tests__/graphic.test.jsx +57 -16
- package/src/ruler/__tests__/index.test.jsx +70 -12
- package/src/ruler/__tests__/unit-type.test.jsx +59 -6
- package/src/ruler/__tests__/unit.test.jsx +61 -8
- package/src/ruler/graphic.jsx +11 -14
- package/src/ruler/index.jsx +25 -28
- package/src/ruler/unit-type.jsx +10 -9
- package/src/ruler/unit.jsx +25 -29
- package/src/__tests__/__snapshots__/rotatable.test.jsx.snap +0 -37
- package/src/protractor/__tests__/__snapshots__/graphic.test.jsx.snap +0 -1234
- package/src/protractor/__tests__/__snapshots__/index.test.jsx.snap +0 -40
- package/src/ruler/__tests__/__snapshots__/graphic.test.jsx.snap +0 -160
- package/src/ruler/__tests__/__snapshots__/index.test.jsx.snap +0 -45
- package/src/ruler/__tests__/__snapshots__/unit-type.test.jsx.snap +0 -12
- package/src/ruler/__tests__/__snapshots__/unit.test.jsx.snap +0 -30
|
@@ -1,13 +1,66 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
3
3
|
import { UnitType } from '../unit-type';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
6
|
describe('unit-type', () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const theme = createTheme();
|
|
8
|
+
|
|
9
|
+
const renderComponent = (props = {}) => {
|
|
10
|
+
const defaultProps = {
|
|
11
|
+
label: 'cm',
|
|
12
|
+
...props,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return render(
|
|
16
|
+
<ThemeProvider theme={theme}>
|
|
17
|
+
<svg>
|
|
18
|
+
<UnitType {...defaultProps} />
|
|
19
|
+
</svg>
|
|
20
|
+
</ThemeProvider>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
describe('rendering', () => {
|
|
25
|
+
it('renders text element with label', () => {
|
|
26
|
+
const { container } = renderComponent({ label: 'cm' });
|
|
27
|
+
const text = container.querySelector('text');
|
|
28
|
+
expect(text).toBeInTheDocument();
|
|
29
|
+
expect(text).toHaveTextContent('cm');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('renders with default position', () => {
|
|
33
|
+
const { container } = renderComponent();
|
|
34
|
+
const text = container.querySelector('text');
|
|
35
|
+
expect(text).toHaveAttribute('x', '8');
|
|
36
|
+
expect(text).toHaveAttribute('y', '14');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders with custom position', () => {
|
|
40
|
+
const { container } = renderComponent({ x: 20, y: 30 });
|
|
41
|
+
const text = container.querySelector('text');
|
|
42
|
+
expect(text).toHaveAttribute('x', '20');
|
|
43
|
+
expect(text).toHaveAttribute('y', '30');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('renders with custom fontSize', () => {
|
|
47
|
+
const { container } = renderComponent({ fontSize: 16 });
|
|
48
|
+
const text = container.querySelector('text');
|
|
49
|
+
expect(text).toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('renders with different labels', () => {
|
|
53
|
+
const { container, rerender } = renderComponent({ label: 'in' });
|
|
54
|
+
expect(container.querySelector('text')).toHaveTextContent('in');
|
|
55
|
+
|
|
56
|
+
rerender(
|
|
57
|
+
<ThemeProvider theme={theme}>
|
|
58
|
+
<svg>
|
|
59
|
+
<UnitType label="mm" />
|
|
60
|
+
</svg>
|
|
61
|
+
</ThemeProvider>
|
|
62
|
+
);
|
|
63
|
+
expect(container.querySelector('text')).toHaveTextContent('mm');
|
|
11
64
|
});
|
|
12
65
|
});
|
|
13
66
|
});
|
|
@@ -1,15 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
3
3
|
import { Unit } from '../unit';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
6
|
describe('unit', () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const theme = createTheme();
|
|
8
|
+
|
|
9
|
+
const renderComponent = (props = {}) => {
|
|
10
|
+
const defaultProps = {
|
|
11
|
+
index: 2,
|
|
12
|
+
width: 30,
|
|
13
|
+
height: 20,
|
|
14
|
+
last: false,
|
|
15
|
+
config: { ticks: 10 },
|
|
16
|
+
...props,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return render(
|
|
20
|
+
<ThemeProvider theme={theme}>
|
|
21
|
+
<svg>
|
|
22
|
+
<Unit {...defaultProps} />
|
|
23
|
+
</svg>
|
|
24
|
+
</ThemeProvider>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
describe('rendering', () => {
|
|
29
|
+
it('renders group element with correct transform', () => {
|
|
30
|
+
const { container } = renderComponent({ index: 2, width: 30 });
|
|
31
|
+
const group = container.querySelector('g');
|
|
32
|
+
expect(group).toBeInTheDocument();
|
|
33
|
+
expect(group).toHaveStyle({ transform: 'translate(30px, 0px)' });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('renders label with index value', () => {
|
|
37
|
+
const { container } = renderComponent({ index: 5 });
|
|
38
|
+
const text = container.querySelector('text');
|
|
39
|
+
expect(text).toHaveTextContent('5');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('renders end tick when not last unit', () => {
|
|
43
|
+
const { container } = renderComponent({ last: false });
|
|
44
|
+
const lines = container.querySelectorAll('line');
|
|
45
|
+
// Should have end tick plus ticks based on config
|
|
46
|
+
expect(lines.length).toBeGreaterThan(0);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('does not render end tick when last unit', () => {
|
|
50
|
+
const { container } = renderComponent({ last: true });
|
|
51
|
+
const group = container.querySelector('g');
|
|
52
|
+
expect(group).toBeInTheDocument();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('renders correct number of tick marks', () => {
|
|
56
|
+
const { container } = renderComponent({ config: { ticks: 16 } });
|
|
57
|
+
const lines = container.querySelectorAll('line');
|
|
58
|
+
// Should render ticks based on config (16 ticks - 1 for range + 1 end tick = 16 total)
|
|
59
|
+
expect(lines.length).toBeGreaterThan(10);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('renders with different width', () => {
|
|
63
|
+
const { container } = renderComponent({ index: 3, width: 40 });
|
|
64
|
+
const group = container.querySelector('g');
|
|
65
|
+
expect(group).toHaveStyle({ transform: 'translate(80px, 0px)' });
|
|
13
66
|
});
|
|
14
67
|
});
|
|
15
68
|
});
|
package/src/ruler/graphic.jsx
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
4
|
import UnitType from './unit-type';
|
|
5
5
|
import range from 'lodash/range';
|
|
6
6
|
import Unit from './unit';
|
|
7
7
|
import { strokeColor, fillColor } from '../style-utils';
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const StyledBg = styled('rect')(({ theme }) => ({
|
|
10
|
+
stroke: strokeColor(theme),
|
|
11
|
+
strokeWidth: '2px',
|
|
12
|
+
fill: fillColor(theme),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
const Bg = ({ width, height }) => <StyledBg width={width} height={height} cx={0} cy={0} />;
|
|
10
16
|
|
|
11
17
|
Bg.propTypes = {
|
|
12
18
|
width: PropTypes.number.isRequired,
|
|
13
19
|
height: PropTypes.number.isRequired,
|
|
14
|
-
className: PropTypes.string.isRequired,
|
|
15
20
|
};
|
|
16
21
|
|
|
17
22
|
export class Graphic extends React.PureComponent {
|
|
@@ -20,18 +25,17 @@ export class Graphic extends React.PureComponent {
|
|
|
20
25
|
height: PropTypes.number.isRequired,
|
|
21
26
|
units: PropTypes.number.isRequired,
|
|
22
27
|
unit: PropTypes.object.isRequired,
|
|
23
|
-
classes: PropTypes.object.isRequired,
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
render() {
|
|
27
|
-
const { width, height,
|
|
31
|
+
const { width, height, units, unit } = this.props;
|
|
28
32
|
const viewBox = `0 0 ${width} ${height}`;
|
|
29
33
|
const unitWidth = width / units;
|
|
30
34
|
const unitHeight = height;
|
|
31
35
|
|
|
32
36
|
return (
|
|
33
37
|
<svg viewBox={viewBox}>
|
|
34
|
-
<Bg width={width} height={height}
|
|
38
|
+
<Bg width={width} height={height} />
|
|
35
39
|
<UnitType label={unit.type} />
|
|
36
40
|
{range(1, units + 1).map((r) => (
|
|
37
41
|
<Unit width={unitWidth} height={unitHeight} key={r} index={r} config={unit} last={r === units} />
|
|
@@ -40,12 +44,5 @@ export class Graphic extends React.PureComponent {
|
|
|
40
44
|
);
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
|
-
const styles = (theme) => ({
|
|
44
|
-
bg: {
|
|
45
|
-
stroke: strokeColor(theme),
|
|
46
|
-
strokeWidth: '2px',
|
|
47
|
-
fill: fillColor(theme),
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
47
|
|
|
51
|
-
export default
|
|
48
|
+
export default Graphic;
|
package/src/ruler/index.jsx
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
3
|
import Rotatable from '../rotatable';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
4
|
import RulerGraphic from './graphic';
|
|
6
5
|
import PropTypes from 'prop-types';
|
|
7
6
|
import Anchor from '../anchor';
|
|
8
7
|
|
|
8
|
+
const StyledRuler = styled('div')(({ theme }) => ({
|
|
9
|
+
cursor: 'move',
|
|
10
|
+
position: 'relative',
|
|
11
|
+
backgroundColor: theme.palette.secondary.light,
|
|
12
|
+
opacity: 1.0,
|
|
13
|
+
border: `solid 0px ${theme.palette.primary.main}`,
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
const StyledLeftAnchor = styled(Anchor)(() => ({
|
|
17
|
+
left: '-10px',
|
|
18
|
+
top: '40%',
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
const StyledRightAnchor = styled(Anchor)(() => ({
|
|
22
|
+
right: '-10px',
|
|
23
|
+
top: '40%',
|
|
24
|
+
}));
|
|
25
|
+
|
|
9
26
|
export class Ruler extends React.Component {
|
|
10
27
|
static propTypes = {
|
|
11
28
|
width: PropTypes.number,
|
|
12
29
|
height: PropTypes.number,
|
|
13
30
|
units: PropTypes.number.isRequired,
|
|
14
31
|
measure: PropTypes.oneOf(['imperial', 'metric']).isRequired,
|
|
15
|
-
classes: PropTypes.object.isRequired,
|
|
16
|
-
className: PropTypes.string,
|
|
17
32
|
startPosition: PropTypes.shape({
|
|
18
33
|
left: PropTypes.number.isRequired,
|
|
19
34
|
top: PropTypes.number.isRequired,
|
|
@@ -30,7 +45,7 @@ export class Ruler extends React.Component {
|
|
|
30
45
|
};
|
|
31
46
|
|
|
32
47
|
render() {
|
|
33
|
-
const {
|
|
48
|
+
const { width, height, units, measure, startPosition, label, tickCount } = this.props;
|
|
34
49
|
|
|
35
50
|
const unit =
|
|
36
51
|
measure === 'imperial'
|
|
@@ -44,38 +59,20 @@ export class Ruler extends React.Component {
|
|
|
44
59
|
};
|
|
45
60
|
return (
|
|
46
61
|
<Rotatable
|
|
47
|
-
className={className}
|
|
48
62
|
startPosition={startPosition}
|
|
49
63
|
handle={[
|
|
50
64
|
{ class: 'leftAnchor', origin: 'bottom right' },
|
|
51
65
|
{ class: 'rightAnchor', origin: 'bottom left' },
|
|
52
66
|
]}
|
|
53
67
|
>
|
|
54
|
-
<
|
|
68
|
+
<StyledRuler style={{ width: `${width}px`, height: `${height}px` }}>
|
|
55
69
|
<RulerGraphic width={width} height={height} units={units} unit={unit} />
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
</
|
|
70
|
+
<StyledLeftAnchor className="leftAnchor" />
|
|
71
|
+
<StyledRightAnchor className="rightAnchor" />
|
|
72
|
+
</StyledRuler>
|
|
59
73
|
</Rotatable>
|
|
60
74
|
);
|
|
61
75
|
}
|
|
62
76
|
}
|
|
63
|
-
const styles = (theme) => ({
|
|
64
|
-
ruler: {
|
|
65
|
-
cursor: 'move',
|
|
66
|
-
position: 'relative',
|
|
67
|
-
backgroundColor: theme.palette.secondary.light,
|
|
68
|
-
opacity: 1.0,
|
|
69
|
-
border: `solid 0px ${theme.palette.primary.main}`,
|
|
70
|
-
},
|
|
71
|
-
leftAnchor: {
|
|
72
|
-
left: '-10px',
|
|
73
|
-
top: '40%',
|
|
74
|
-
},
|
|
75
|
-
rightAnchor: {
|
|
76
|
-
right: '-10px',
|
|
77
|
-
top: '40%',
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
77
|
|
|
81
|
-
export default
|
|
78
|
+
export default Ruler;
|
package/src/ruler/unit-type.jsx
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { noSelect, strokeColor } from '../style-utils';
|
|
4
|
-
import {
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
|
|
6
|
+
const StyledText = styled('text')(({ theme }) => ({
|
|
7
|
+
...noSelect(),
|
|
8
|
+
fill: strokeColor(theme),
|
|
9
|
+
}));
|
|
5
10
|
|
|
6
11
|
export const UnitType = (props) => {
|
|
7
|
-
const {
|
|
12
|
+
const { label, x, y, textAlign, fill, fontSize, stroke } = props;
|
|
8
13
|
|
|
9
14
|
return (
|
|
10
|
-
<
|
|
11
|
-
className={classes.unitType}
|
|
15
|
+
<StyledText
|
|
12
16
|
x={x}
|
|
13
17
|
y={y}
|
|
14
18
|
textAnchor={textAlign}
|
|
@@ -17,12 +21,11 @@ export const UnitType = (props) => {
|
|
|
17
21
|
fontSize={fontSize}
|
|
18
22
|
>
|
|
19
23
|
{label}
|
|
20
|
-
</
|
|
24
|
+
</StyledText>
|
|
21
25
|
);
|
|
22
26
|
};
|
|
23
27
|
|
|
24
28
|
UnitType.propTypes = {
|
|
25
|
-
classes: PropTypes.object.isRequired,
|
|
26
29
|
label: PropTypes.string.isRequired,
|
|
27
30
|
x: PropTypes.number,
|
|
28
31
|
y: PropTypes.number,
|
|
@@ -40,6 +43,4 @@ UnitType.defaultProps = {
|
|
|
40
43
|
y: 14,
|
|
41
44
|
};
|
|
42
45
|
|
|
43
|
-
export default
|
|
44
|
-
unitType: { ...noSelect(), fill: strokeColor(theme) },
|
|
45
|
-
}))(UnitType);
|
|
46
|
+
export default UnitType;
|
package/src/ruler/unit.jsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
4
|
import { noSelect, strokeColor } from '../style-utils';
|
|
5
5
|
import range from 'lodash/range';
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const StyledTick = styled('line')(({ theme }) => ({
|
|
8
|
+
stroke: strokeColor(theme),
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
const Tick = ({ x, height, bottom, major, minor }) => {
|
|
12
12
|
const y1 = major ? bottom - height * 2 : minor ? bottom - height * 1.5 : bottom - height;
|
|
13
13
|
|
|
14
|
-
return <
|
|
15
|
-
}
|
|
14
|
+
return <StyledTick y1={y1} y2={bottom} x1={x} x2={x} />;
|
|
15
|
+
};
|
|
16
16
|
|
|
17
17
|
const Ticks = ({ count, width, height }) => {
|
|
18
18
|
return (
|
|
@@ -40,48 +40,44 @@ Ticks.propTypes = {
|
|
|
40
40
|
height: PropTypes.number.isRequired,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
const StyledEndTick = styled('line')(({ theme }) => ({
|
|
44
|
+
stroke: strokeColor(theme),
|
|
45
|
+
strokeWidth: 1,
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
const StyledLabel = styled('text')(({ theme }) => ({
|
|
49
|
+
textAnchor: 'end',
|
|
50
|
+
fontSize: '12px',
|
|
51
|
+
fill: strokeColor(theme),
|
|
52
|
+
...noSelect(),
|
|
53
|
+
}));
|
|
54
|
+
|
|
43
55
|
export class Unit extends React.Component {
|
|
44
56
|
static propTypes = {
|
|
45
57
|
index: PropTypes.number.isRequired,
|
|
46
58
|
width: PropTypes.number.isRequired,
|
|
47
59
|
height: PropTypes.number.isRequired,
|
|
48
|
-
classes: PropTypes.object.isRequired,
|
|
49
60
|
last: PropTypes.bool.isRequired,
|
|
50
61
|
config: PropTypes.object.isRequired,
|
|
51
62
|
};
|
|
52
63
|
|
|
53
64
|
render() {
|
|
54
|
-
const { index, width, height,
|
|
65
|
+
const { index, width, height, last, config } = this.props;
|
|
55
66
|
|
|
56
67
|
const style = {
|
|
57
68
|
transform: `translate(${width * (index - 1)}px, 0px)`,
|
|
58
69
|
};
|
|
59
70
|
return (
|
|
60
71
|
<g style={style}>
|
|
61
|
-
{!last && <
|
|
72
|
+
{!last && <StyledEndTick x1={width} y1={0} x2={width} y2={height} />}
|
|
62
73
|
|
|
63
74
|
<Ticks count={config.ticks} width={width} height={height} />
|
|
64
|
-
<
|
|
75
|
+
<StyledLabel width={width} x={width - 5} y={15}>
|
|
65
76
|
{index}
|
|
66
|
-
</
|
|
77
|
+
</StyledLabel>
|
|
67
78
|
</g>
|
|
68
79
|
);
|
|
69
80
|
}
|
|
70
81
|
}
|
|
71
82
|
|
|
72
|
-
export default
|
|
73
|
-
endTick: {
|
|
74
|
-
stroke: strokeColor(theme),
|
|
75
|
-
strokeWidth: 1,
|
|
76
|
-
},
|
|
77
|
-
label: {
|
|
78
|
-
textAnchor: 'end',
|
|
79
|
-
fontSize: '12px',
|
|
80
|
-
fill: strokeColor(theme),
|
|
81
|
-
...noSelect(),
|
|
82
|
-
},
|
|
83
|
-
base: {
|
|
84
|
-
fill: 'none',
|
|
85
|
-
stroke: 'red',
|
|
86
|
-
},
|
|
87
|
-
}))(Unit);
|
|
83
|
+
export default Unit;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`rotatable snapshot renders 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
className=""
|
|
6
|
-
onMouseDown={[Function]}
|
|
7
|
-
onMouseUp={[Function]}
|
|
8
|
-
style={
|
|
9
|
-
Object {
|
|
10
|
-
"left": 0,
|
|
11
|
-
"top": 0,
|
|
12
|
-
"transform": " rotate(0deg)",
|
|
13
|
-
"transformOrigin": undefined,
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
>
|
|
17
|
-
foo
|
|
18
|
-
</div>
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
exports[`rotatable snapshot renders with transforms 1`] = `
|
|
22
|
-
<div
|
|
23
|
-
className=""
|
|
24
|
-
onMouseDown={[Function]}
|
|
25
|
-
onMouseUp={[Function]}
|
|
26
|
-
style={
|
|
27
|
-
Object {
|
|
28
|
-
"left": 0,
|
|
29
|
-
"top": 0,
|
|
30
|
-
"transform": "translate(10px, 10px) rotate(10deg)",
|
|
31
|
-
"transformOrigin": "bottom left",
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
>
|
|
35
|
-
foo
|
|
36
|
-
</div>
|
|
37
|
-
`;
|