diff options
Diffstat (limited to 'src/client/views')
| -rw-r--r-- | src/client/views/OCRUtils.ts | 7 | ||||
| -rw-r--r-- | src/client/views/collections/CollectionView.tsx | 4 | ||||
| -rw-r--r-- | src/client/views/nodes/DocumentContentsView.tsx | 3 | ||||
| -rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 2 | ||||
| -rw-r--r-- | src/client/views/nodes/MapBox/MarkerIcons.tsx | 109 | ||||
| -rw-r--r-- | src/client/views/nodes/WebBox.tsx | 2 | ||||
| -rw-r--r-- | src/client/views/nodes/audio/AudioWaveform.tsx | 1 |
7 files changed, 72 insertions, 56 deletions
diff --git a/src/client/views/OCRUtils.ts b/src/client/views/OCRUtils.ts deleted file mode 100644 index 282ec770e..000000000 --- a/src/client/views/OCRUtils.ts +++ /dev/null @@ -1,7 +0,0 @@ -// import tesseract from "node-tesseract-ocr"; -// const tesseract = require("node-tesseract"); - - -export namespace OCRUtils { - -} diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 0237ec95e..0656843cb 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -28,13 +28,11 @@ import { CollectionTreeView } from './CollectionTreeView'; import './CollectionView.scss'; import { CollectionFreeFormView } from './collectionFreeForm/CollectionFreeFormView'; import { CollectionGridView } from './collectionGrid/CollectionGridView'; -import { CollectionCalendarView} from './CollectionCalendarView'; +import { CollectionCalendarView } from './CollectionCalendarView'; import { CollectionLinearView } from './collectionLinear'; import { CollectionMulticolumnView } from './collectionMulticolumn/CollectionMulticolumnView'; import { CollectionMultirowView } from './collectionMulticolumn/CollectionMultirowView'; import { CollectionSchemaView } from './collectionSchema/CollectionSchemaView'; -const path = require('path'); - interface CollectionViewProps_ extends FieldViewProps { isAnnotationOverlay?: boolean; // is the collection an annotation overlay (eg an overlay on an image/video/etc) isAnnotationOverlayScrollable?: boolean; // whether the annotation overlay can be vertically scrolled (just for tree views, currently) diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx index 5b2bf4774..fa472312e 100644 --- a/src/client/views/nodes/DocumentContentsView.tsx +++ b/src/client/views/nodes/DocumentContentsView.tsx @@ -47,8 +47,7 @@ import { WebBox } from './WebBox'; import { FormattedTextBox } from './formattedText/FormattedTextBox'; import { ImportElementBox } from './importBox/ImportElementBox'; import { PresBox } from './trails/PresBox'; - -const JsxParser = require('react-jsx-parser').default; //TODO Why does this need to be imported like this? +import JsxParser from 'react-jsx-parser'; type BindingProps = Without<FieldViewProps, 'fieldKey'>; export interface JsxBindings { diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 2d5f68a69..2752fa7f5 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -53,7 +53,7 @@ import { LinkAnchorBox } from './LinkAnchorBox'; import { FormattedTextBox } from './formattedText/FormattedTextBox'; import { PresEffect, PresEffectDirection } from './trails'; import { PinProps, PresBox } from './trails/PresBox'; -const { Howl } = require('howler'); +import { Howl } from 'howler'; interface Window { MediaRecorder: MediaRecorder; diff --git a/src/client/views/nodes/MapBox/MarkerIcons.tsx b/src/client/views/nodes/MapBox/MarkerIcons.tsx index 146f296c1..a580fcaa0 100644 --- a/src/client/views/nodes/MapBox/MarkerIcons.tsx +++ b/src/client/views/nodes/MapBox/MarkerIcons.tsx @@ -1,11 +1,42 @@ import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { faShopify } from '@fortawesome/free-brands-svg-icons'; -import { faBasketball, faBicycle, faBowlFood, faBus, faCameraRetro, faCar, faCartShopping, faFilm, faFootball, faFutbol, faHockeyPuck, faHospital, faHotel, faHouse, faLandmark, faLocationDot, faLocationPin, faMapPin, faMasksTheater, faMugSaucer, faPersonHiking, faPlane, faSchool, faShirt, faShop, faSquareParking, faStar, faTrainSubway, faTree, faUtensils, faVolleyball } from '@fortawesome/free-solid-svg-icons'; +import { + faBasketball, + faBicycle, + faBowlFood, + faBus, + faCameraRetro, + faCar, + faCartShopping, + faFilm, + faFootball, + faFutbol, + faHockeyPuck, + faHospital, + faHotel, + faHouse, + faLandmark, + faLocationDot, + faLocationPin, + faMapPin, + faMasksTheater, + faMugSaucer, + faPersonHiking, + faPlane, + faSchool, + faShirt, + faShop, + faSquareParking, + faStar, + faTrainSubway, + faTree, + faUtensils, + faVolleyball, +} from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import React = require('react'); +import * as React from 'react'; export class MarkerIcons { - // static getMapboxIcon = (color: string) => { // return ( // <svg xmlns="http://www.w3.org/2000/svg" id="marker" data-name="marker" width="20" height="48" viewBox="0 0 20 35"> @@ -34,43 +65,39 @@ export class MarkerIcons { iconProps.color = color; } - return (<FontAwesomeIcon {...iconProps} size={size} />); - - - } - - static FAMarkerIconsMap: {[key: string]: IconProp} = { - 'MAP_PIN': faLocationDot, - 'RESTAURANT_ICON': faUtensils, - 'HOTEL_ICON': faHotel, - 'HOUSE_ICON': faHouse, - 'AIRPLANE_ICON': faPlane, - 'CAR_ICON': faCar, - 'BUS_ICON': faBus, - 'TRAIN_ICON': faTrainSubway, - 'BICYCLE_ICON': faBicycle, - 'PARKING_ICON': faSquareParking, - 'PHOTO_ICON': faCameraRetro, - 'CAFE_ICON': faMugSaucer, - 'STAR_ICON': faStar, - 'SHOPPING_CART_ICON': faCartShopping, - 'SHOPIFY_ICON': faShopify, - 'SHOP_ICON': faShop, - 'SHIRT_ICON': faShirt, - 'FOOD_ICON': faBowlFood, - 'LANDMARK_ICON': faLandmark, - 'HOSPITAL_ICON': faHospital, - 'NATURE_ICON': faTree, - 'HIKING_ICON': faPersonHiking, - 'SOCCER_ICON': faFutbol, - 'VOLLEYBALL_ICON': faVolleyball, - 'BASKETBALL_ICON': faBasketball, - 'HOCKEY_ICON': faHockeyPuck, - 'FOOTBALL_ICON': faFootball, - 'SCHOOL_ICON': faSchool, - 'THEATER_ICON': faMasksTheater, - 'FILM_ICON': faFilm + return <FontAwesomeIcon {...iconProps} size={size} />; } - -}
\ No newline at end of file + static FAMarkerIconsMap: { [key: string]: IconProp } = { + MAP_PIN: faLocationDot, + RESTAURANT_ICON: faUtensils, + HOTEL_ICON: faHotel, + HOUSE_ICON: faHouse, + AIRPLANE_ICON: faPlane, + CAR_ICON: faCar, + BUS_ICON: faBus, + TRAIN_ICON: faTrainSubway, + BICYCLE_ICON: faBicycle, + PARKING_ICON: faSquareParking, + PHOTO_ICON: faCameraRetro, + CAFE_ICON: faMugSaucer, + STAR_ICON: faStar, + SHOPPING_CART_ICON: faCartShopping, + SHOPIFY_ICON: faShopify, + SHOP_ICON: faShop, + SHIRT_ICON: faShirt, + FOOD_ICON: faBowlFood, + LANDMARK_ICON: faLandmark, + HOSPITAL_ICON: faHospital, + NATURE_ICON: faTree, + HIKING_ICON: faPersonHiking, + SOCCER_ICON: faFutbol, + VOLLEYBALL_ICON: faVolleyball, + BASKETBALL_ICON: faBasketball, + HOCKEY_ICON: faHockeyPuck, + FOOTBALL_ICON: faFootball, + SCHOOL_ICON: faSchool, + THEATER_ICON: faMasksTheater, + FILM_ICON: faFilm, + }; +} diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index 57045e2af..2522a674d 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -1,4 +1,5 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { htmlToText } from 'html-to-text'; import { action, computed, IReactionDisposer, makeObservable, observable, ObservableMap, reaction, runInAction } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; @@ -39,7 +40,6 @@ import { PinProps, PresBox } from './trails'; import './WebBox.scss'; const { CreateImage } = require('./WebBoxRenderer'); const _global = (window /* browser */ || global) /* node */ as any; -const htmlToText = require('html-to-text'); @observer export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps & FieldViewProps>() { public static LayoutString(fieldKey: string) { diff --git a/src/client/views/nodes/audio/AudioWaveform.tsx b/src/client/views/nodes/audio/AudioWaveform.tsx index 01392c4a5..c034d95ea 100644 --- a/src/client/views/nodes/audio/AudioWaveform.tsx +++ b/src/client/views/nodes/audio/AudioWaveform.tsx @@ -16,7 +16,6 @@ import { ObservableReactComponent } from '../../ObservableReactComponent'; * AudioWaveform * * Used in CollectionStackedTimeline to render a canvas with a visual of an audio waveform for AudioBox and VideoBox documents. - * Uses react-audio-waveform package. * Bins the audio data into audioBuckets which are passed to package to render the lines. * Calculates new buckets each time a new zoom factor or new set of trim bounds is created and stores it in a field on the layout doc with a title indicating the bounds and zoom for that list (see audioBucketField) */ |
