Skip to content

Commit

Permalink
Merge branch 'master' into undo-origin-panel-update
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jul 28, 2020
2 parents 2ef8dc0 + d57a379 commit 92505f9
Show file tree
Hide file tree
Showing 32 changed files with 355 additions and 328 deletions.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions x-pack/plugins/canvas/public/components/alignment_guide/index.js

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions x-pack/plugins/canvas/public/components/border_connection/index.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions x-pack/plugins/canvas/public/components/hover_annotation/index.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FC } from 'react';
import PropTypes from 'prop-types';
import { matrixToCSS } from '../../lib/dom';
import { TransformMatrix3d } from '../../lib/aeroelastic';

interface Props {
height: number;
transformMatrix: TransformMatrix3d;
width: number;
}

export const AlignmentGuide: FC<Props> = ({ transformMatrix, width, height }) => (
<div
className="canvasAlignmentGuide canvasInteractable canvasLayoutAnnotation"
style={{
background: 'magenta',
height,
marginLeft: -width / 2,
marginTop: -height / 2,
position: 'absolute',
transform: matrixToCSS(transformMatrix),
width,
}}
/>
);

AlignmentGuide.propTypes = {
height: PropTypes.number.isRequired,
transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired,
width: PropTypes.number.isRequired,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FC } from 'react';
import PropTypes from 'prop-types';
import { matrixToCSS } from '../../lib/dom';
import { TransformMatrix3d } from '../../lib/aeroelastic';

interface Props {
height: number;
transformMatrix: TransformMatrix3d;
width: number;
}

export const BorderConnection: FC<Props> = ({ transformMatrix, width, height }) => (
<div
className="canvasBorderConnection canvasLayoutAnnotation"
style={{
height,
marginLeft: -width / 2,
marginTop: -height / 2,
position: 'absolute',
transform: matrixToCSS(transformMatrix),
width,
}}
/>
);

BorderConnection.propTypes = {
height: PropTypes.number.isRequired,
transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired,
width: PropTypes.number.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import React, { FC } from 'react';
import PropTypes from 'prop-types';
import { matrixToCSS } from '../../lib/dom';
import { TransformMatrix3d } from '../../lib/aeroelastic';

export const BorderResizeHandle = ({ transformMatrix, zoomScale }) => (
interface Props {
transformMatrix: TransformMatrix3d;
zoomScale?: number;
}

export const BorderResizeHandle: FC<Props> = ({ transformMatrix, zoomScale = 1 }) => (
<div
className="canvasBorderResizeHandle canvasLayoutAnnotation"
style={{
Expand All @@ -19,4 +25,5 @@ export const BorderResizeHandle = ({ transformMatrix, zoomScale }) => (

BorderResizeHandle.propTypes = {
transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired,
zoomScale: PropTypes.number,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FC } from 'react';
import PropTypes from 'prop-types';
import { matrixToCSS } from '../../lib/dom';
import { TransformMatrix3d } from '../../lib/aeroelastic';

interface Props {
height: number;
transformMatrix: TransformMatrix3d;
width: number;
}

export const DragBoxAnnotation: FC<Props> = ({ transformMatrix, width, height }) => (
<div
className="canvasDragBoxAnnotation canvasLayoutAnnotation"
style={{
height,
marginLeft: -width / 2,
marginTop: -height / 2,
transform: matrixToCSS(transformMatrix),
width,
}}
/>
);

DragBoxAnnotation.propTypes = {
transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired,
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,32 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import React, { FC } from 'react';
import PropTypes from 'prop-types';
import { matrixToCSS } from '../../lib/dom';
import { TransformMatrix3d } from '../../lib/aeroelastic';

export const HoverAnnotation = ({ transformMatrix, width, height }) => {
const newStyle = {
width,
height,
marginLeft: -width / 2,
marginTop: -height / 2,
transform: matrixToCSS(transformMatrix),
};
return <div className="canvasHoverAnnotation canvasLayoutAnnotation" style={newStyle} />;
};
interface Props {
height: number;
transformMatrix: TransformMatrix3d;
width: number;
}

export const HoverAnnotation: FC<Props> = ({ transformMatrix, width, height }) => (
<div
className="canvasHoverAnnotation canvasLayoutAnnotation"
style={{
width,
height,
marginLeft: -width / 2,
marginTop: -height / 2,
transform: matrixToCSS(transformMatrix),
}}
/>
);

HoverAnnotation.propTypes = {
height: PropTypes.number.isRequired,
transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired,
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export { AlignmentGuide } from './alignment_guide';
export { DragBoxAnnotation } from './dragbox_annotation';
export { HoverAnnotation } from './hover_annotation';
export { TooltipAnnotation } from './tooltip_annotation';
export { RotationHandle } from './rotation_handle';
export { BorderConnection } from './border_connection';
export { BorderResizeHandle } from './border_resize_handle';
Loading

0 comments on commit 92505f9

Please sign in to comment.