Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"presets": ["env", "flow"],
"plugins": ["babel-plugin-transform-class-properties"]
"presets": ["@babel/preset-env", "@babel/preset-flow"],
"plugins": ["@babel/plugin-transform-class-properties"]
}
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,34 @@
"quill": "^1.3.4"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.0.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.6.1",
"babel-preset-flow": "^6.23.0",
"@babel/cli": "^7.24.6",
"@babel/core": "^7.11.0",
"@babel/eslint-parser": "^7.24.6",
"@babel/plugin-transform-class-properties": "^7.24.6",
"@babel/preset-env": "^7.24.6",
"@babel/preset-flow": "^7.24.6",
"copyfiles": "^1.2.0",
"eslint": "^4.9.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-flowtype": "^2.39.1",
"eslint-plugin-import": "^2.7.0",
"eslint": "^7.11.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.29.1",
"flow-bin": "^0.57.3",
"flow-copy-source": "^1.2.1",
"flow-copy-source": "^2.0.9",
"npm-run-all": "^4.1.2",
"quill": "^1.3.4",
"rimraf": "^2.6.2",
"webpack": "^3.8.1"
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
"scripts": {
"build": "yarn clean && yarn build:babel && yarn build:webpack && yarn build:copy-flow-source && yarn build:copy-ts-defs",
"build:babel": "babel src/ --out-dir dist",
"build:copy-flow-source": "flow-copy-source --verbose src dist",
"build:copy-ts-defs": "copyfiles index.d.ts dist",
"build:webpack": "webpack -p --progress --colors",
"build:webpack": "webpack build --progress --color",
"clean": "rimraf dist",
"dev:babel": "babel --watch src/ --out-dir dist",
"dev:webpack": "yarn dev:delay && webpack --progress --colors --watch",
"dev:webpack": "yarn dev:delay && webpack --progress --color --watch",
"dev:delay": "node -e \"setTimeout(() => {}, 3000)\"",
"prepublishOnly": "yarn build",
"start": "yarn clean && yarn npm-run-all --race --parallel dev:babel dev:webpack"
Expand Down
4 changes: 2 additions & 2 deletions src/BlotFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import deepmerge from 'deepmerge';
import type { Options } from './Options';
import DefaultOptions from './Options';
import Action from './actions/Action';
import BlotSpec from './specs/BlotSpec';
import type Action from './actions/Action';
import type BlotSpec from './specs/BlotSpec';

const dontMerge = (destination: Array<any>, source: Array<any>) => source;

Expand Down
2 changes: 1 addition & 1 deletion src/Options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow

import BlotSpec from './specs/BlotSpec';
import type BlotSpec from './specs/BlotSpec';
import ImageSpec from './specs/ImageSpec';
import IframeVideoSpec from './specs/IframeVideoSpec';

Expand Down
2 changes: 1 addition & 1 deletion src/actions/Action.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow

import BlotFormatter from '../BlotFormatter';
import type BlotFormatter from '../BlotFormatter';

export default class Action {
formatter: BlotFormatter;
Expand Down
2 changes: 1 addition & 1 deletion src/actions/ResizeAction.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import Action from './Action';
import BlotFormatter from '../BlotFormatter';
import type BlotFormatter from '../BlotFormatter';

export default class ResizeAction extends Action {
topLeftHandle: HTMLElement;
Expand Down
6 changes: 3 additions & 3 deletions src/actions/align/AlignAction.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// @flow

import Action from '../Action';
import BlotFormatter from '../../BlotFormatter';
import type BlotFormatter from '../../BlotFormatter';
import DefaultAligner from './DefaultAligner';
import { Aligner } from './Aligner';
import { Toolbar } from './Toolbar';
import type { Aligner } from './Aligner';
import type { Toolbar } from './Toolbar';
import DefaultToolbar from './DefaultToolbar';

export default class AlignAction extends Action {
Expand Down
2 changes: 1 addition & 1 deletion src/actions/align/DefaultAligner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow

import { Aligner } from './Aligner';
import type { Aligner } from './Aligner';
import type { Alignment } from './Alignment';
import type { AlignOptions } from '../../Options';

Expand Down
6 changes: 3 additions & 3 deletions src/actions/align/DefaultToolbar.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @flow

import { Toolbar } from './Toolbar';
import { Aligner } from './Aligner';
import type { Toolbar } from './Toolbar';
import type { Aligner } from './Aligner';
import type { Alignment } from './Alignment';
import BlotFormatter from '../../BlotFormatter';
import type BlotFormatter from '../../BlotFormatter';

export default class DefaultToolbar implements Toolbar {
toolbar: ?HTMLElement;
Expand Down
4 changes: 2 additions & 2 deletions src/actions/align/Toolbar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import { Aligner } from './Aligner';
import BlotFormatter from '../../BlotFormatter';
import type { Aligner } from './Aligner';
import type BlotFormatter from '../../BlotFormatter';

export interface Toolbar {
create(formatter: BlotFormatter, alignmentHelper: Aligner): HTMLElement;
Expand Down
4 changes: 2 additions & 2 deletions src/specs/BlotSpec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import BlotFormatter from '../BlotFormatter';
import Action from '../actions/Action';
import type BlotFormatter from '../BlotFormatter';
import type Action from '../actions/Action';
import AlignAction from '../actions/align/AlignAction';
import ResizeAction from '../actions/ResizeAction';
import DeleteAction from '../actions/DeleteAction';
Expand Down
2 changes: 1 addition & 1 deletion src/specs/IframeVideoSpec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import UnclickableBlotSpec from './UnclickableBlotSpec';
import BlotFormatter from '../BlotFormatter';
import type BlotFormatter from '../BlotFormatter';

export default class IframeVideoSpec extends UnclickableBlotSpec {
constructor(formatter: BlotFormatter) {
Expand Down
2 changes: 1 addition & 1 deletion src/specs/ImageSpec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import BlotSpec from './BlotSpec';
import BlotFormatter from '../BlotFormatter';
import type BlotFormatter from '../BlotFormatter';

export default class ImageSpec extends BlotSpec {
img: ?HTMLElement;
Expand Down
3 changes: 2 additions & 1 deletion src/specs/UnclickableBlotSpec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import BlotSpec from './BlotSpec';
import BlotFormatter from '../BlotFormatter';
import type BlotFormatter from '../BlotFormatter';

const MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
const PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
Expand Down Expand Up @@ -55,6 +55,7 @@ export default class UnclickableBlotSpec extends BlotSpec {

this.proxyImage = document.createElement('img');
this.proxyImage.src = canvas.toDataURL('image/png');
this.proxyImage.alt = '';
this.proxyImage.classList.add(PROXY_IMAGE_CLASS);

Object.assign(this.proxyImage.style, {
Expand Down
Loading