Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { Component } from 'react';
import { Button, Icon } from 'choerodon-ui';
import PropTypes from 'prop-types';
import { isEqual } from 'lodash';
import ReactQuill, { Quill } from 'react-quill';
import 'react-quill/dist/quill.snow.css';
import LightBox from 'react-image-lightbox';
import { randomWord } from '../../common/utils';
import ImageDrop from './ImageDrop';
import Link from './Link';
import './BaseEditor.scss';
Quill.register('modules/imageDrop', ImageDrop);
Quill.register('formats/link', Link);
const defaultStyle = {
width: 498,
height: 200,
borderRight: 'none',
};
const defaultProps = {
mode: 'edit',
};
const propTypes = {
// eslint-disable-next-line react/forbid-prop-types
value: PropTypes.any,
placeholder: PropTypes.string,
toolbarHeight: PropTypes.oneOfType([
Quill.register(header, true);
// Add the SharePoint font sizes
let SizeClass = Quill.import('formats/size');
SizeClass.whitelist = [
'small',
'medium',
'mediumplus',
'large',
'xlarge',
'xlargeplus',
'xxlarge',
'xxxlarge',
'xxlargeplus',
'super'];
Quill.register(SizeClass, true);
return (
<div> this._wrapperRef = ref} className={`${styles.richtext && this.state.editing ? 'ql-active' : ''} ${this.props.className}`}>
<div style="{{top:this.state.wrapperTop}}" id="{this._toolbarId}">
{
showStyles && (
}
selectedKey={this.state.formats.header || 0}
options={this.ddStyleOpts}
onChanged={this.onChangeHeading}
onRenderOption={this.onRenderStyleOption}
onRenderTitle={this.onRenderStyleTitle}
/></div></div>
import React, { Component } from "react";
import PropTypes from "prop-types";
import ReactQuill, { Quill } from "react-quill";
import classNames from "classnames";
const BlockEmbed = Quill.import("blots/block/embed");
const Embed = Quill.import("blots/embed");
const SnowTheme = Quill.import("themes/snow");
const Link = Quill.import("formats/link");
import { withTranslation } from "react-i18next";
import constants from "../../../constants";
import "./rich-textarea-field.scss";
import Util from "../../../js/utils.js";
// NOTE: this routine is taken from Quill's themes/base module, which is not
// importable via react-quill.
const extractVideoUrl = url => {
let match =
url.match(
/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/,
) ||
url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);
if (match) {
isSignInPending,
loadUserData,
Person,
getFile,
putFile,
lookupProfile,
signUserOut
} from 'blockstack';
import update from 'immutability-helper';
const { encryptECIES, decryptECIES } = require('blockstack/lib/encryption');
const { getPublicKeyFromPrivate } = require('blockstack');
const Quill = ReactQuill.Quill;
const Font = ReactQuill.Quill.import('formats/font');
Font.whitelist = ['Ubuntu', 'Raleway', 'Roboto', 'Lato', 'Open Sans', 'Montserrat'] ; // allow ONLY these fonts and the default
ReactQuill.Quill.register(Font, true);
const blockstack = require("blockstack");
const avatarFallbackImage = 'https://s3.amazonaws.com/onename/avatar-placeholder.png';
export default class SingleConversation extends Component {
constructor(props) {
super(props);
this.state = {
person: {
name() {
return 'Anonymous';
},
avatarUrl() {
return avatarFallbackImage;
},
},
import Header from "../Header";
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.bubble.css';
import {
isSignInPending,
loadUserData,
Person,
getFile,
putFile,
lookupProfile,
signUserOut
} from "blockstack";
import update from 'immutability-helper';
const iconNew = 'http://www.iconj.com/ico/0/o/0o93qd5dr7.ico';
const Quill = ReactQuill.Quill;
const Font = ReactQuill.Quill.import('formats/font');
Font.whitelist = ['Ubuntu', 'Raleway', 'Roboto', 'Lato', 'Open Sans', 'Montserrat'] ; // allow ONLY these fonts and the default
ReactQuill.Quill.register(Font, true);
import SingleConversation from './SingleConversation';
import axios from 'axios';
const blockstack = require("blockstack");
const { encryptECIES, decryptECIES } = require('blockstack/lib/encryption');
const { getPublicKeyFromPrivate } = require('blockstack');
const avatarFallbackImage = 'https://s3.amazonaws.com/onename/avatar-placeholder.png';
export default class Conversations extends Component {
constructor(props) {
super(props);
this.state = {
person: {
name() {
return 'Anonymous';
putFile,
lookupProfile
} from 'blockstack';
import HotTable from 'react-handsontable';
import update from 'immutability-helper';
import {CSVLink, CSVDownload} from 'react-csv';
const formula = require('excel-formula');
const wordcount = require("wordcount");
const blockstack = require("blockstack");
const { encryptECIES, decryptECIES } = require('blockstack/lib/encryption');
const { getPublicKeyFromPrivate } = require('blockstack');
const avatarFallbackImage = 'https://s3.amazonaws.com/onename/avatar-placeholder.png';
const Quill = ReactQuill.Quill;
const Font = ReactQuill.Quill.import('formats/font');
Font.whitelist = ['Ubuntu', 'Raleway', 'Roboto', 'Lato', 'Open Sans', 'Montserrat'] ; // allow ONLY these fonts and the default
ReactQuill.Quill.register(Font, true);
export default class SingleSharedSheet extends Component {
constructor(props) {
super(props);
this.state = {
sheets: [],
sharedFile: [],
grid: [[]],
title : "",
user: "",
content:"",
updated: "",
words: "",
index: "",
save: "",
loading: "hide",
Person,
getFile,
putFile,
lookupProfile
} from 'blockstack';
import HotTable from 'react-handsontable';
import update from 'immutability-helper';
import {CSVLink, CSVDownload} from 'react-csv';
const formula = require('excel-formula');
const wordcount = require("wordcount");
const blockstack = require("blockstack");
const { encryptECIES, decryptECIES } = require('blockstack/lib/encryption');
const { getPublicKeyFromPrivate } = require('blockstack');
const avatarFallbackImage = 'https://s3.amazonaws.com/onename/avatar-placeholder.png';
const Quill = ReactQuill.Quill;
const Font = ReactQuill.Quill.import('formats/font');
Font.whitelist = ['Ubuntu', 'Raleway', 'Roboto', 'Lato', 'Open Sans', 'Montserrat'] ; // allow ONLY these fonts and the default
ReactQuill.Quill.register(Font, true);
export default class SingleSharedSheet extends Component {
constructor(props) {
super(props);
this.state = {
sheets: [],
sharedFile: [],
grid: [[]],
title : "",
user: "",
content:"",
updated: "",
words: "",
index: "",
import Profile from "../Profile";
import Signin from "../Signin";
import Header from "../Header";
import {
isSignInPending,
loadUserData,
Person,
getFile,
putFile,
lookupProfile
} from 'blockstack';
import update from 'immutability-helper';
const wordcount = require("wordcount");
const blockstack = require("blockstack");
const Quill = ReactQuill.Quill;
const Font = ReactQuill.Quill.import('formats/font');
const { encryptECIES, decryptECIES } = require('blockstack/lib/encryption');
const { getPublicKeyFromPrivate } = require('blockstack');
const timeout = null;
Font.whitelist = ['Ubuntu', 'Raleway', 'Roboto', 'Lato', 'Open Sans', 'Montserrat'] ; // allow ONLY these fonts and the default
ReactQuill.Quill.register(Font, true);
export default class SingleDoc extends Component {
constructor(props) {
super(props);
this.state = {
value: [],
contacts: [],
title : "",
content:"",
updated: "",
words: "",
import Header from "../Header";
import {
isSignInPending,
loadUserData,
Person,
getFile,
putFile,
lookupProfile,
signUserOut
} from 'blockstack';
import update from 'immutability-helper';
const { encryptECIES, decryptECIES } = require('blockstack/lib/encryption');
const { getPublicKeyFromPrivate } = require('blockstack');
const Quill = ReactQuill.Quill;
const Font = ReactQuill.Quill.import('formats/font');
Font.whitelist = ['Ubuntu', 'Raleway', 'Roboto', 'Lato', 'Open Sans', 'Montserrat'] ; // allow ONLY these fonts and the default
ReactQuill.Quill.register(Font, true);
const blockstack = require("blockstack");
const avatarFallbackImage = 'https://s3.amazonaws.com/onename/avatar-placeholder.png';
export default class SingleConversation extends Component {
constructor(props) {
super(props);
this.state = {
person: {
name() {
return 'Anonymous';
},
avatarUrl() {
return avatarFallbackImage;
loadUserData,
Person,
getFile,
putFile,
lookupProfile
} from 'blockstack';
import HotTable from 'react-handsontable';
import update from 'immutability-helper';
import {CSVLink, CSVDownload} from 'react-csv';
const formula = require('excel-formula');
const wordcount = require("wordcount");
const blockstack = require("blockstack");
const { encryptECIES, decryptECIES } = require('blockstack/lib/encryption');
const { getPublicKeyFromPrivate } = require('blockstack');
const avatarFallbackImage = 'https://s3.amazonaws.com/onename/avatar-placeholder.png';
const Quill = ReactQuill.Quill;
const Font = ReactQuill.Quill.import('formats/font');
Font.whitelist = ['Ubuntu', 'Raleway', 'Roboto', 'Lato', 'Open Sans', 'Montserrat'] ; // allow ONLY these fonts and the default
ReactQuill.Quill.register(Font, true);
export default class SingleSharedSheet extends Component {
constructor(props) {
super(props);
this.state = {
sheets: [],
sharedFile: [],
grid: [[]],
title : "",
user: "",
content:"",
updated: "",
words: "",