bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/container.jsx
Arthurk12 d2b2acbf2d fix(whiteboard): re-adds right click to cancel
Re-adds cancelling text annotation on right click. To achieve this,
some mechanisms that were previously used to handle live synced annotations
were rescued. So this partially reverts 40b18b0.
2022-09-01 12:40:14 +00:00

56 lines
2.0 KiB
JavaScript
Executable File

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import PropTypes from 'prop-types';
import WhiteboardOverlayService from './service';
import WhiteboardToolbarService from '../whiteboard-toolbar/service';
import WhiteboardOverlay from './component';
const WhiteboardOverlayContainer = (props) => {
const { drawSettings } = props;
if (Object.keys(drawSettings).length > 0) {
return (
<WhiteboardOverlay {...props} />
);
}
return null;
};
export default withTracker(() => ({
undoAnnotation: WhiteboardToolbarService.undoAnnotation,
clearPreview: WhiteboardOverlayService.clearPreview,
contextMenuHandler: WhiteboardOverlayService.contextMenuHandler,
sendAnnotation: WhiteboardOverlayService.sendAnnotation,
sendLiveSyncPreviewAnnotation: WhiteboardOverlayService.sendLiveSyncPreviewAnnotation,
addAnnotationToDiscardedList: WhiteboardOverlayService.addAnnotationToDiscardedList,
setTextShapeActiveId: WhiteboardOverlayService.setTextShapeActiveId,
resetTextShapeSession: WhiteboardOverlayService.resetTextShapeSession,
drawSettings: WhiteboardOverlayService.getWhiteboardToolbarValues(),
userId: WhiteboardOverlayService.getCurrentUserId(),
updateCursor: WhiteboardOverlayService.updateCursor,
}))(WhiteboardOverlayContainer);
WhiteboardOverlayContainer.propTypes = {
drawSettings: PropTypes.oneOfType([
PropTypes.shape({
// Annotation color
color: PropTypes.number.isRequired,
// Annotation thickness (not normalized)
thickness: PropTypes.number.isRequired,
// The name of the tool currently selected
tool: PropTypes.string.isRequired,
// Font size for the text shape
textFontSize: PropTypes.number.isRequired,
// Current active text shape value
textShapeValue: PropTypes.string.isRequired,
// Text active text shape id
textShapeActiveId: PropTypes.string.isRequired,
}),
PropTypes.object.isRequired,
]),
};
WhiteboardOverlayContainer.defaultProps = {
drawSettings: {},
};