aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2022-06-05 11:38:46 -0400
committermehekj <mehek.jethani@gmail.com>2022-06-05 11:38:46 -0400
commitb51b78c641c3e64f04cf878f02b5d7b1a620769e (patch)
treeb7f00a33f96e497f3d590505b4211c4279960bb6
parent30347f1ac971b3299cfbefd5505e20f5e82702e0 (diff)
cleanup
-rw-r--r--src/Utils.ts6
-rw-r--r--src/client/util/InteractionUtils.tsx3
-rw-r--r--src/client/views/GestureOverlay.tsx10
-rw-r--r--src/client/views/InkTranscription.tsx22
-rw-r--r--src/client/views/InkingStroke.tsx1
-rw-r--r--src/client/views/LightboxView.tsx4
-rw-r--r--src/client/views/Touchable.tsx2
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx5
-rw-r--r--src/client/views/collections/collectionFreeForm/MarqueeView.tsx1
-rw-r--r--src/client/views/nodes/DocumentLinksButton.tsx3
-rw-r--r--src/client/views/nodes/EquationBox.scss34
-rw-r--r--src/client/views/nodes/button/FontIconBox.tsx7
12 files changed, 13 insertions, 85 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index 8c0e8c7c0..523f4eb4f 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -5,12 +5,6 @@ import { Socket } from 'socket.io';
import { Colors } from './client/views/global/globalEnums';
import { Message } from './server/Message';
import Color = require('color');
-import { InkTool } from './fields/InkField';
-import { action } from 'mobx';
-import { CurrentUserUtils } from './client/util/CurrentUserUtils';
-import { CollectionFreeFormView } from './client/views/collections/collectionFreeForm';
-import { WidthSym, HeightSym } from './fields/Doc';
-import { NumCast } from './fields/Types';
export namespace Utils {
export let DRAG_THRESHOLD = 4;
diff --git a/src/client/util/InteractionUtils.tsx b/src/client/util/InteractionUtils.tsx
index e2c5fab64..289c5bc51 100644
--- a/src/client/util/InteractionUtils.tsx
+++ b/src/client/util/InteractionUtils.tsx
@@ -286,7 +286,7 @@ export namespace InteractionUtils {
// pen and eraser are both pointer type 'pen', but pen is button 0 and eraser is button 5. -syip2
case PENTYPE: return e.pointerType === PENTYPE && (e.button === -1 || e.button === 0);
case ERASERTYPE: return e.pointerType === PENTYPE && e.button === (e instanceof PointerEvent ? ERASER_BUTTON : ERASER_BUTTON);
- case TOUCHTYPE:
+ case TOUCHTYPE:
return e.pointerType === TOUCHTYPE;
default: return e.pointerType === type;
}
@@ -357,7 +357,6 @@ export namespace InteractionUtils {
}
export function IsDragging(oldTouches: Map<number, React.Touch>, newTouches: React.Touch[], leniency: number): boolean {
- console.log("getting here");
for (const touch of newTouches) {
if (touch) {
const oldTouch = oldTouches.get(touch.identifier);
diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx
index 566b7b65a..21b5a8d01 100644
--- a/src/client/views/GestureOverlay.tsx
+++ b/src/client/views/GestureOverlay.tsx
@@ -18,13 +18,13 @@ import { SelectionManager } from "../util/SelectionManager";
import { Transform } from "../util/Transform";
import { CollectionFreeFormViewChrome } from "./collections/CollectionMenu";
import "./GestureOverlay.scss";
-import { ActiveArrowEnd, ActiveArrowStart, ActiveArrowScale, ActiveDash, ActiveFillColor, ActiveInkBezierApprox, ActiveInkColor, ActiveInkWidth, SetActiveArrowStart, SetActiveDash, SetActiveFillColor, SetActiveInkColor, SetActiveInkWidth } from "./InkingStroke";
+import { ActiveArrowEnd, ActiveArrowScale, ActiveArrowStart, ActiveDash, ActiveFillColor, ActiveInkBezierApprox, ActiveInkColor, ActiveInkWidth, SetActiveArrowStart, SetActiveDash, SetActiveFillColor, SetActiveInkColor, SetActiveInkWidth } from "./InkingStroke";
+import { checkInksToGroup, createInkGroup } from "./nodes/button/FontIconBox";
import { DocumentView } from "./nodes/DocumentView";
import { RadialMenu } from "./nodes/RadialMenu";
import HorizontalPalette from "./Palette";
import { Touchable } from "./Touchable";
import TouchScrollableMenu, { TouchScrollableMenuItem } from "./TouchScrollableMenu";
-import { checkInksToGroup, createInkGroup } from "./nodes/button/FontIconBox";
@observer
export class GestureOverlay extends Touchable {
@@ -210,7 +210,7 @@ export class GestureOverlay extends Touchable {
const nts: any = this.getNewTouches(e);
this._holdTimer && clearTimeout(this._holdTimer);
this._holdTimer = undefined;
-
+
document.dispatchEvent(
new CustomEvent<InteractionUtils.MultiTouchEvent<TouchEvent>>("dashOnTouchMove",
{
@@ -296,9 +296,6 @@ export class GestureOverlay extends Touchable {
else if (thumb.clientX === leftMost) {
pointer = fingers.reduce((a, v) => a.clientX < v.clientX || v.identifier === thumb.identifier ? a : v);
}
- else {
- // console.log("not hand");
- }
this.pointerIdentifier = pointer?.identifier;
runInAction(() => {
@@ -632,7 +629,6 @@ export class GestureOverlay extends Touchable {
if (!actionPerformed) {
const newPoints = this._points.reduce((p, pts) => { p.push([pts.X, pts.Y]); return p; }, [] as number[][]);
newPoints.pop();
- // console.log("getting to bezier math");
const controlPoints: { X: number, Y: number }[] = [];
const bezierCurves = fitCurve(newPoints, 10);
diff --git a/src/client/views/InkTranscription.tsx b/src/client/views/InkTranscription.tsx
index 5e0667bed..6babb3915 100644
--- a/src/client/views/InkTranscription.tsx
+++ b/src/client/views/InkTranscription.tsx
@@ -4,12 +4,12 @@ import * as React from 'react';
import { Doc, DocListCast, HeightSym, WidthSym } from '../../fields/Doc';
import { InkData, InkField } from "../../fields/InkField";
import { Cast, DateCast, NumCast } from '../../fields/Types';
-import { DocumentType } from "../documents/DocumentTypes";
-import './InkTranscription.scss';
import { aggregateBounds } from '../../Utils';
-import { CollectionFreeFormView } from './collections/collectionFreeForm';
+import { DocumentType } from "../documents/DocumentTypes";
import { DocumentManager } from "../util/DocumentManager";
+import { CollectionFreeFormView } from './collections/collectionFreeForm';
import { InkingStroke } from './InkingStroke';
+import './InkTranscription.scss';
export class InkTranscription extends React.Component {
@@ -21,7 +21,6 @@ export class InkTranscription extends React.Component {
@observable _textRef: any;
private lastJiix: any;
private currGroup?: Doc;
- private containingLayout?: Doc;
constructor(props: Readonly<{}>) {
super(props);
@@ -104,29 +103,22 @@ export class InkTranscription extends React.Component {
return this._textRef = r;
}
- transcribeInk = (groupDoc: Doc | undefined, containingLayout: Doc, inkDocs: Doc[], math: boolean, ffView?: CollectionFreeFormView) => {
+ transcribeInk = (groupDoc: Doc | undefined, inkDocs: Doc[], math: boolean, ffView?: CollectionFreeFormView) => {
if (!groupDoc) return;
const validInks = inkDocs.filter(s => s.type === DocumentType.INK);
const strokes: InkData[] = [];
const times: number[] = [];
- // console.log(validInks);
validInks.filter(i => Cast(i.data, InkField)).forEach(i => {
const d = Cast(i.data, InkField, null);
- // const left = Math.min(...d?.inkData.map(pd => pd.X) ?? [0]);
- // const top = Math.min(...d?.inkData.map(pd => pd.Y) ?? [0]);
- // strokes.push(d.inkData.map(pd => ({ X: pd.X + NumCast(i.x) - left, Y: pd.Y + NumCast(i.y) - top })));
const inkStroke = DocumentManager.Instance.getDocumentView(i)?.ComponentView as InkingStroke;
strokes.push(d.inkData.map(pd => (inkStroke.ptToScreen({ X: pd.X, Y: pd.Y }))));
times.push(DateCast(i.creationDate).getDate().getTime());
});
this.currGroup = groupDoc;
- this.containingLayout = containingLayout;
const pointerData = { "events": strokes.map((stroke, i) => this.inkJSON(stroke, times[i])) };
- // console.log(JSON.stringify(pointerData));
- // console.log(pointerData);
const processGestures = false;
if (math) {
@@ -225,19 +217,15 @@ export class InkTranscription extends React.Component {
newCollection.title = word;
}
// nda - bug: when deleting a stroke before leaving writing mode, delete the stroke from unprocessed ink docs
- // console.log(newCollection);
newCollection && docView.props.addDocument?.(newCollection);
});
}
exportInk = (e: any, ref: any) => {
const exports = e.detail.exports;
- // console.log(e);
if (exports) {
if (exports['application/x-latex']) {
const latex = exports['application/x-latex'];
- // console.log(latex);
-
if (this.currGroup) {
this.currGroup.text = latex;
this.currGroup.title = latex;
@@ -282,10 +270,8 @@ export class InkTranscription extends React.Component {
}
}
const text = exports['text/plain'];
- // console.log(text);
if (this.currGroup) {
- // console.log("curr grouping");
this.currGroup.transcription = text;
this.currGroup.title = text.split("\n")[0];
}
diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx
index 6c95f0f77..40fe6aa68 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -253,7 +253,6 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps>() {
(point.X - inkLeft - inkStrokeWidth / 2) * inkScaleX + inkStrokeWidth / 2,
(point.Y - inkTop - inkStrokeWidth / 2) * inkScaleY + inkStrokeWidth / 2)).map(p => ({ X: p[0], Y: p[1] }));
const screenHdlPts = screenPts;
- console.log(screenPts);
const startMarker = StrCast(this.layoutDoc.strokeStartMarker);
const endMarker = StrCast(this.layoutDoc.strokeEndMarker);
diff --git a/src/client/views/LightboxView.tsx b/src/client/views/LightboxView.tsx
index c8f6b5f0b..40c68878d 100644
--- a/src/client/views/LightboxView.tsx
+++ b/src/client/views/LightboxView.tsx
@@ -5,7 +5,7 @@ import "normalize.css";
import * as React from 'react';
import { Doc, DocListCast, Opt } from '../../fields/Doc';
import { Cast, NumCast, StrCast } from '../../fields/Types';
-import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnTrue, Utils } from '../../Utils';
+import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnTrue } from '../../Utils';
import { DocUtils } from '../documents/Documents';
import { DocumentManager } from '../util/DocumentManager';
import { LinkManager } from '../util/LinkManager';
@@ -16,8 +16,6 @@ import { TabDocView } from './collections/TabDocView';
import "./LightboxView.scss";
import { DocumentView } from './nodes/DocumentView';
import { DefaultStyleProvider, wavyBorderPath } from './StyleProvider';
-import { CollectionMenu } from './collections/CollectionMenu';
-import { utils } from 'mocha';
interface LightboxViewProps {
PanelWidth: number;
diff --git a/src/client/views/Touchable.tsx b/src/client/views/Touchable.tsx
index c712e7ed3..789756a78 100644
--- a/src/client/views/Touchable.tsx
+++ b/src/client/views/Touchable.tsx
@@ -127,13 +127,11 @@ export abstract class Touchable<T = {}> extends React.Component<T> {
}
handle1PointerMove = (e: TouchEvent, me: InteractionUtils.MultiTouchEvent<TouchEvent>): any => {
- console.log("getting to handle1PointersMove");
e.stopPropagation();
e.preventDefault();
}
handle2PointersMove = (e: TouchEvent, me: InteractionUtils.MultiTouchEvent<TouchEvent>): any => {
- console.log("getting to handle2PointersMove");
e.stopPropagation();
e.preventDefault();
}
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index ca8073dac..f292bd96e 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -17,7 +17,7 @@ import { GestureUtils } from "../../../../pen-gestures/GestureUtils";
import { aggregateBounds, emptyFunction, intersectRect, returnFalse, setupMoveUpEvents, Utils } from "../../../../Utils";
import { CognitiveServices } from "../../../cognitive_services/CognitiveServices";
import { DocServer } from "../../../DocServer";
-import { Docs, DocumentOptions, DocUtils } from "../../../documents/Documents";
+import { Docs, DocUtils } from "../../../documents/Documents";
import { DocumentType } from "../../../documents/DocumentTypes";
import { CurrentUserUtils } from "../../../util/CurrentUserUtils";
import { DocumentManager } from "../../../util/DocumentManager";
@@ -50,7 +50,6 @@ import { CollectionFreeFormRemoteCursors } from "./CollectionFreeFormRemoteCurso
import "./CollectionFreeFormView.scss";
import { MarqueeView } from "./MarqueeView";
import React = require("react");
-import { InkTranscription } from "../../InkTranscription";
export const panZoomSchema = createSchema({
_panX: "number",
@@ -700,7 +699,6 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
@action
onPointerMove = (e: PointerEvent): void => {
- console.log("this is onPointerMove");
if (InteractionUtils.IsType(e, InteractionUtils.PENTYPE)) return;
if (InteractionUtils.IsType(e, InteractionUtils.TOUCHTYPE)) {
Doc.UserDoc().activeInkTool = InkTool.None;
@@ -823,7 +821,6 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
}
handle1PointerMove = (e: TouchEvent, me: InteractionUtils.MultiTouchEvent<TouchEvent>) => {
- console.log("getting here yeet");
if (!e.cancelBubble) {
const myTouches = InteractionUtils.GetMyTargetTouches(me, this.prevPoints, true);
if (myTouches[0]) {
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index f762c6619..b60742eba 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -267,7 +267,6 @@ export class MarqueeView extends React.Component<SubCollectionViewProps & Marque
MarqueeOptionsMenu.Instance.createCollection = this.collection;
MarqueeOptionsMenu.Instance.delete = this.delete;
MarqueeOptionsMenu.Instance.summarize = this.summary;
- // MarqueeOptionsMenu.Instance.inkToText = this.syntaxHighlight;
MarqueeOptionsMenu.Instance.showMarquee = this.showMarquee;
MarqueeOptionsMenu.Instance.hideMarquee = this.hideMarquee;
MarqueeOptionsMenu.Instance.jumpTo(e.clientX, e.clientY);
diff --git a/src/client/views/nodes/DocumentLinksButton.tsx b/src/client/views/nodes/DocumentLinksButton.tsx
index f9d2b9917..4a06354b2 100644
--- a/src/client/views/nodes/DocumentLinksButton.tsx
+++ b/src/client/views/nodes/DocumentLinksButton.tsx
@@ -20,9 +20,6 @@ import { DocumentView } from "./DocumentView";
import { LinkDescriptionPopup } from "./LinkDescriptionPopup";
import { TaskCompletionBox } from "./TaskCompletedBox";
import React = require("react");
-import { Transform } from "../../util/Transform";
-import { InkTool } from "../../../fields/InkField";
-import { CurrentUserUtils } from "../../util/CurrentUserUtils";
const higflyout = require("@hig/flyout");
export const { anchorPoints } = higflyout;
diff --git a/src/client/views/nodes/EquationBox.scss b/src/client/views/nodes/EquationBox.scss
index 229a1a485..c6a497831 100644
--- a/src/client/views/nodes/EquationBox.scss
+++ b/src/client/views/nodes/EquationBox.scss
@@ -2,38 +2,4 @@
.equationBox-cont {
transform-origin: top left;
- overflow: visible;
- width: 100%;
- height: 100%;
-}
-
-.button {
- position: absolute;
- display: flex;
- justify-content: center;
- align-items: center;
- top: 0;
- right: 0;
- width: 20px;
- height: 20px;
- border-radius: 5px;
- background: $dark-gray;
- color: white;
-
- svg {
- width: 12px;
- height: 12px;
- }
-}
-
-.ink-editor {
- top: 20px;
- min-width: 500px;
- min-height: 300px;
- background: $light-gray;
- pointer-events: all;
-
- button {
- float: right;
- }
} \ No newline at end of file
diff --git a/src/client/views/nodes/button/FontIconBox.tsx b/src/client/views/nodes/button/FontIconBox.tsx
index d87b23d86..d902a422e 100644
--- a/src/client/views/nodes/button/FontIconBox.tsx
+++ b/src/client/views/nodes/button/FontIconBox.tsx
@@ -5,7 +5,7 @@ import { action, computed, observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { ColorState, SketchPicker } from 'react-color';
-import { DataSym, Doc, DocListCast, HeightSym, LayoutSym, StrListCast, WidthSym } from '../../../../fields/Doc';
+import { Doc, HeightSym, StrListCast, WidthSym } from '../../../../fields/Doc';
import { InkTool } from '../../../../fields/InkField';
import { createSchema } from '../../../../fields/Schema';
import { ScriptField } from '../../../../fields/ScriptField';
@@ -14,7 +14,6 @@ import { WebField } from '../../../../fields/URLField';
import { aggregateBounds, Utils } from '../../../../Utils';
import { DocumentType } from '../../../documents/DocumentTypes';
import { CurrentUserUtils } from '../../../util/CurrentUserUtils';
-import { DocumentManager } from '../../../util/DocumentManager';
import { ScriptingGlobals } from "../../../util/ScriptingGlobals";
import { SelectionManager } from '../../../util/SelectionManager';
import { undoBatch, UndoManager } from '../../../util/UndoManager';
@@ -262,7 +261,7 @@ export class FontIconBox extends DocComponent<ButtonProps>() {
"Comic Sans MS", "Tahoma", "Impact", "Crimson Text"];
}
} catch (e) {
- // console.log(e);
+ console.log(e);
}
// Get items to place into the list
@@ -767,7 +766,7 @@ export function createInkGroup(inksToGroup?: Doc[], isSubGroup?: boolean) {
// TODO: nda - will probably need to go through and only remove the unprocessed selected docs
ffView.unprocessedDocs = [];
- InkTranscription.Instance.transcribeInk(newCollection, ffView.layoutDoc, selected, false, ffView);
+ InkTranscription.Instance.transcribeInk(newCollection, selected, false, ffView);
});
}
CollectionFreeFormView.collectionsWithUnprocessedInk.clear();