diff --git a/.changeset/brave-bugs-build.md b/.changeset/brave-bugs-build.md
new file mode 100644
index 0000000000..ec01fd3cdf
--- /dev/null
+++ b/.changeset/brave-bugs-build.md
@@ -0,0 +1,24 @@
+---
+'@draft-js-plugins/alignment': patch
+'@draft-js-plugins/anchor': patch
+'@draft-js-plugins/counter': patch
+'@draft-js-plugins/divider': patch
+'@draft-js-plugins/drag-n-drop': patch
+'@draft-js-plugins/drag-n-drop-upload': patch
+'@draft-js-plugins/emoji': patch
+'@draft-js-plugins/focus': patch
+'@draft-js-plugins/hashtag': patch
+'@draft-js-plugins/image': patch
+'@draft-js-plugins/inline-toolbar': patch
+'@draft-js-plugins/linkify': patch
+'@draft-js-plugins/mention': patch
+'@draft-js-plugins/resizeable': patch
+'@draft-js-plugins/side-toolbar': patch
+'@draft-js-plugins/static-toolbar': patch
+'@draft-js-plugins/sticker': patch
+'@draft-js-plugins/text-alignment': patch
+'@draft-js-plugins/undo': patch
+'@draft-js-plugins/video': patch
+---
+
+Use `@vectorworks/draft-js-plugins` for editor types and add it as a peer dependency.
diff --git a/.changeset/silent-snails-smile.md b/.changeset/silent-snails-smile.md
new file mode 100644
index 0000000000..91b9ef4b40
--- /dev/null
+++ b/.changeset/silent-snails-smile.md
@@ -0,0 +1,5 @@
+---
+'@vectorworks/draft-js-plugins': patch
+---
+
+Upgrade Immutable.js to version 5.1.5 or later.
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index debd02c77c..0000000000
--- a/.eslintignore
+++ /dev/null
@@ -1,8 +0,0 @@
-**/node_modules/**
-node_modules
-lib/**
-scripts/**
-distTs/**
-**/lib/**
-**/.next/**
-**/out/**
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 5d2a573b7d..0000000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,158 +0,0 @@
-module.exports = {
- parser: 'babel-eslint',
- plugins: ['@typescript-eslint', 'react-hooks', 'no-only-tests'],
- parserOptions: {
- ecmaVersion: 2020,
- sourceType: 'module',
- },
- overrides: [
- {
- extends: [
- 'plugin:@typescript-eslint/eslint-recommended',
- 'plugin:@typescript-eslint/recommended',
- 'prettier',
- ],
- files: ['**/*.ts', '**/*.tsx'],
- parser: '@typescript-eslint/parser',
- rules: {
- 'react/jsx-indent': 0, //disabeld as it throws the error: "TypeError: Cannot read property 'type' of null"
- '@typescript-eslint/ban-ts-comment': [
- 0,
- {
- 'ts-ignore': 'allow-with-description',
- },
- ],
- '@typescript-eslint/explicit-function-return-type': [
- 'error',
- {
- allowExpressions: true,
- allowHigherOrderFunctions: true,
- allowTypedFunctionExpressions: true,
- },
- ],
- '@typescript-eslint/explicit-member-accessibility': 0,
- '@typescript-eslint/no-explicit-any': ['error'],
- '@typescript-eslint/no-non-null-assertion': 0,
- '@typescript-eslint/no-unused-vars': 'error',
- '@typescript-eslint/no-use-before-define': [
- 'error',
- { functions: false },
- ],
- '@typescript-eslint/no-var-requires': 1,
- '@typescript-eslint/no-empty-function': 1,
-
- //disable rules as we use @typescript-eslint/no-use-before-define
- 'no-use-before-define': 0,
- },
- },
- ],
- env: {
- browser: true,
- jest: true,
- node: true,
- },
- extends: [
- 'airbnb',
- 'eslint:recommended',
- 'plugin:react/recommended',
- 'plugin:import/errors',
- ],
- rules: {
- 'no-multi-spaces': 0,
- 'padded-blocks': 0,
- camelcase: 0,
- 'react/sort-comp': 0,
- 'no-cond-assign': 0,
- 'react/no-did-update-set-state': 0,
- 'no-restricted-syntax': 0,
- 'no-lonely-if': 0,
- 'no-prototype-builtins': 0,
- 'no-console': 'error',
- 'spaced-comment': 0,
- 'space-before-function-paren': 0,
- 'no-confusing-arrow': 0,
- 'no-mixed-operators': 0,
- indent: 0,
- curly: 0,
- 'max-len': 0,
- 'comma-dangle': 0,
- 'arrow-parens': 0,
- 'no-underscore-dangle': 0,
- 'new-cap': 0,
- 'react/prop-types': 0,
- 'react/forbid-prop-types': 0,
- 'react/prefer-stateless-function': 0,
- 'react/jsx-filename-extension': 0,
- 'import/no-extraneous-dependencies': 0,
- 'import/prefer-default-export': 0,
- 'jsx-a11y/no-static-element-interactions': 0,
- 'class-methods-use-this': 0,
- 'import/no-webpack-loader-syntax': 0,
- 'import/extensions': 0,
- 'jsx-a11y/img-has-alt': 0,
- 'react/require-default-props': 0,
- 'react/display-name': 1,
- 'react/no-direct-mutation-state': 1,
- 'no-restricted-imports': [
- 'error',
- {
- name: 'lodash-es',
- message:
- 'Please use lodash instead. Rollup will replace lodash with lodash-es for esm.',
- },
- ],
- },
- settings: {
- 'import/core-modules': [
- '@draft-js-plugins/alignment',
- '@draft-js-plugins/alignment/lib/plugin.css',
- '@draft-js-plugins/text-alignment',
- '@draft-js-plugins/text-alignment/lib/plugin.css',
- '@draft-js-plugins/anchor',
- '@draft-js-plugins/anchor/lib/plugin.css',
- '@draft-js-plugins/buttons',
- '@draft-js-plugins/buttons/lib/plugin.css',
- '@draft-js-plugins/counter',
- '@draft-js-plugins/counter/lib/plugin.css',
- '@draft-js-plugins/utils',
- '@draft-js-plugins/drag-n-drop',
- '@draft-js-plugins/drag-n-drop/lib/plugin.css',
- '@draft-js-plugins/drag-n-drop-upload',
- '@draft-js-plugins/drag-n-drop-upload/utils/file',
- '@draft-js-plugins/drag-n-drop-upload/lib/plugin.css',
- '@draft-js-plugins/emoji',
- '@draft-js-plugins/emoji/lib/plugin.css',
- '@draft-js-plugins/focus',
- '@draft-js-plugins/focus/lib/plugin.css',
- '@draft-js-plugins/hashtag',
- '@draft-js-plugins/hashtag/lib/plugin.css',
- '@draft-js-plugins/image',
- '@draft-js-plugins/image/lib/plugin.css',
- '@draft-js-plugins/inline-toolbar',
- '@draft-js-plugins/inline-toolbar/lib/plugin.css',
- '@draft-js-plugins/linkify',
- '@draft-js-plugins/linkify/lib/plugin.css',
- '@draft-js-plugins/mention',
- '@draft-js-plugins/mention/lib/plugin.css',
- '@draft-js-plugins/editor',
- '@draft-js-plugins/editor/lib/plugin.css',
- '@draft-js-plugins/resizeable',
- '@draft-js-plugins/side-toolbar',
- '@draft-js-plugins/side-toolbar/lib/plugin.css',
- '@draft-js-plugins/static-toolbar',
- '@draft-js-plugins/static-toolbar/lib/plugin.css',
- '@draft-js-plugins/sticker',
- '@draft-js-plugins/sticker/lib/plugin.css',
- '@draft-js-plugins/undo',
- '@draft-js-plugins/undo/lib/plugin.css',
- '@draft-js-plugins/video',
- '@draft-js-plugins/video/lib/plugin.css',
- '@draft-js-plugins/divider',
- '@draft-js-plugins/divider/lib/plugin.css',
- ],
- 'import/resolver': {
- node: true,
- 'eslint-import-resolver-typescript': true,
- },
- },
-};
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 8d826b745d..8f3101a792 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -14,7 +14,7 @@ All necessary environmental info that will help triage this
Especially include:
-->
-- @draft-js-plugins/editor version:
+- @vectorworks/draft-js-plugins version:
- plugin name and version:
## Description
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 18b18751b0..7a7303360c 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -10,10 +10,6 @@ updates:
versions:
- 8.0.0
- 8.3.0
- - dependency-name: '@storybook/react'
- versions:
- - 6.2.2
- - 6.2.9
- dependency-name: next
versions:
- 10.1.1
@@ -35,7 +31,6 @@ updates:
- 4.14.2
- dependency-name: 'animateplus'
- dependency-name: 'immutable'
- - dependency-name: 'linaria'
- package-ecosystem: github-actions
directory: '/'
schedule:
diff --git a/.github/workflows/deployWebsite.yml b/.github/workflows/deployWebsite.yml
index f7dcfd70b7..2b0afe6704 100644
--- a/.github/workflows/deployWebsite.yml
+++ b/.github/workflows/deployWebsite.yml
@@ -18,10 +18,10 @@ jobs:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- - name: Setup Node.js 16.x
+ - name: Setup Node.js 24.x
uses: actions/setup-node@v4
with:
- node-version: 16.x
+ node-version: 24.x
- name: Install Dependencies
run: yarn
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4596a1406f..36b01af5f1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -5,6 +5,11 @@ on:
branches:
- master
+permissions:
+ contents: write
+ packages: write
+ pull-requests: write
+
jobs:
release:
name: Release
@@ -17,10 +22,12 @@ jobs:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- - name: Setup Node.js 16.x
+ - name: Setup Node.js 24.x
uses: actions/setup-node@v4
with:
- node-version: 16.x
+ node-version: 24.x
+ registry-url: https://npm.pkg.github.com
+ scope: '@vectorworks'
- name: Install Dependencies
run: yarn
@@ -34,4 +41,5 @@ jobs:
title: 'Upcoming Release Changes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 9d57a1bc45..c53133f9f9 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
- node-version: [16.x]
+ node-version: [24.x]
steps:
- uses: actions/checkout@v4
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000000..20018ca70a
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+@vectorworks:registry=https://npm.pkg.github.com/Vectorworks
diff --git a/.nvmrc b/.nvmrc
index 45a4fb75db..a45fd52cc5 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-8
+24
diff --git a/.storybook/main.js b/.storybook/main.js
index 419d62c9e0..dedcf3fe46 100644
--- a/.storybook/main.js
+++ b/.storybook/main.js
@@ -1,8 +1,5 @@
module.exports = {
- core: {
- builder: 'webpack5',
- },
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],
- framework: '@storybook/react',
+ framework: '@storybook/react-webpack5',
staticDirs: ['../stories/public'],
};
diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js
index 261f5abab9..e0c1a27183 100644
--- a/.storybook/webpack.config.js
+++ b/.storybook/webpack.config.js
@@ -1,7 +1,7 @@
const path = require('path');
const packages = [
- '@draft-js-plugins/editor',
+ ['@vectorworks/draft-js-plugins', 'editor'],
'@draft-js-plugins/hashtag',
'@draft-js-plugins/linkify',
'@draft-js-plugins/anchor',
@@ -27,8 +27,10 @@ const packages = [
];
const packagesAliases = {};
-packages.forEach((name) => {
- const [, folderName] = name.split('/');
+packages.forEach((packageDetails) => {
+ const [name, folderName] = Array.isArray(packageDetails)
+ ? packageDetails
+ : [packageDetails, packageDetails.split('/')[1]];
packagesAliases[name] = path.join(
__dirname,
'../packages',
@@ -62,11 +64,16 @@ module.exports = async ({ config }) => {
},
{
- test: /\.(js|jsx|ts|tsx)?$/,
+ test: /\.(js|jsx|ts|tsx)$/,
+ exclude: /node_modules/,
+ use: [{ loader: 'babel-loader' }],
+ },
+ {
+ test: /\.(js|jsx|ts|tsx)$/,
+ include: path.resolve(__dirname, '../packages'),
use: [
- { loader: 'babel-loader' },
{
- loader: 'linaria/loader',
+ loader: '@wyw-in-js/webpack-loader',
options: {
sourceMap: true,
},
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index aaf9fa0709..37a8fdc414 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -57,7 +57,7 @@ Because of the structure of this repository you can not just use your own fork o
2. Install Yarn `npm install --global yarn` and install node modules `yarn install`
-3. Reference the needed sub packages in your code f.ex. the plugin editor `import PluginEditor from '@draft-js-plugins/editor';`
+3. Reference the needed sub packages in your code f.ex. the plugin editor `import PluginEditor from '@vectorworks/draft-js-plugins';`
4. When using Webpack you need to tell it how to compile the draft-js-plugins code, you do that by adding an additional loader like this:
@@ -91,7 +91,7 @@ module: {
```
resolve: {
alias: {
- '@draft-js-plugins/editor': path.join(__dirname, 'node_modules', 'draft-js-plugins', 'packages', 'plugins-editor', 'src'),
+ '@vectorworks/draft-js-plugins': path.join(__dirname, 'node_modules', 'draft-js-plugins', 'packages', 'plugins-editor', 'src'),
'@draft-js-plugins/hashtag': path.join(__dirname, 'node_modules', 'draft-js-plugins', 'packages', 'hashtag', 'src'),
'@draft-js-plugins/linkify': path.join(__dirname, 'node_modules', 'draft-js-plugins', 'packages', 'linkify', 'src'),
'@draft-js-plugins/mention': path.join(__dirname, 'node_modules', 'draft-js-plugins', 'packages', 'mention', 'src'),
diff --git a/README.md b/README.md
index 7edf487d14..54f69eb7c3 100644
--- a/README.md
+++ b/README.md
@@ -60,19 +60,31 @@ Checkout [the website](https://www.draft-js-plugins.com/)!
First, install the editor with `npm`:
+```sh
+npm config set @vectorworks:registry=https://npm.pkg.github.com/Vectorworks
+npm login --scope=@vectorworks --auth-type=legacy --registry=https://npm.pkg.github.com
```
-$ npm install @draft-js-plugins/editor --save
+
+Use a personal access token with the `read:packages` scope when the package is
+private.
+
```
+$ npm install @vectorworks/draft-js-plugins --save
+```
+
+The package uses Immutable.js 5. Draft.js retains its own compatible
+Immutable.js 3 transitive dependency, so no application-level override is
+needed.
Then import the editor somewhere in your code and you're ready to go!
```js
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
```
## Documentation
-### @draft-js-plugins/editor
+### @vectorworks/draft-js-plugins
#### Editor
@@ -92,7 +104,7 @@ Usage:
```js
import React, { Component } from 'react';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createHashtagPlugin from '@draft-js-plugins/hashtag';
import createLinkifyPlugin from '@draft-js-plugins/linkify';
import { EditorState } from 'draft-js';
diff --git a/babel.config.js b/babel.config.js
index 595fba04a9..6bab1638e9 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -1,25 +1,10 @@
-const removeLinariaImport = () => ({
- name: 'remove-linaria-import',
- visitor: {
- ImportDeclaration(path) {
- if (path.node.source && path.node.source.value === 'linaria') {
- path.remove();
- }
- },
- },
-});
-
module.exports = {
presets: [
//using loose true because of this issue: https://github.com/storybookjs/storybook/issues/12093
['@babel/preset-env', { loose: true }],
- '@babel/react',
- '@babel/flow',
- '@babel/typescript',
- 'linaria/babel',
- ],
- plugins: [
- ['@babel/plugin-proposal-class-properties', { loose: true }],
- removeLinariaImport,
+ '@babel/preset-react',
+ '@babel/preset-flow',
+ '@babel/preset-typescript',
],
+ plugins: [['@babel/plugin-transform-class-properties', { loose: true }]],
};
diff --git a/biome.json b/biome.json
new file mode 100644
index 0000000000..98d68a8673
--- /dev/null
+++ b/biome.json
@@ -0,0 +1,49 @@
+{
+ "$schema": "https://biomejs.dev/schemas/2.5.12/schema.json",
+ "vcs": {
+ "enabled": true,
+ "clientKind": "git",
+ "useIgnoreFile": true
+ },
+ "files": {
+ "includes": [
+ "**",
+ "!!**/lib/**",
+ "!!distTs/**",
+ "!!scripts/**",
+ "!!interfaces/CSSModule.js"
+ ]
+ },
+ "formatter": {
+ "enabled": false
+ },
+ "linter": {
+ "enabled": true,
+ "rules": {
+ "preset": "none",
+ "correctness": {
+ "noUndeclaredVariables": "error",
+ "noUnusedVariables": "error"
+ },
+ "suspicious": {
+ "noConsole": "error",
+ "noFocusedTests": "error"
+ }
+ }
+ },
+ "javascript": {
+ "globals": [
+ "afterAll",
+ "afterEach",
+ "beforeAll",
+ "beforeEach",
+ "describe",
+ "expect",
+ "it",
+ "jest",
+ "test",
+ "xdescribe",
+ "xit"
+ ]
+ }
+}
diff --git a/jest.config.base.js b/jest.config.base.js
index d477c93388..31841445e8 100644
--- a/jest.config.base.js
+++ b/jest.config.base.js
@@ -7,23 +7,12 @@ module.exports = {
setupFilesAfterEnv: [`${__dirname}/jestHelper.js`],
moduleFileExtensions: ['jsx', 'js', 'ts', 'tsx'],
transform: {
- '^.+\\.tsx?$': 'ts-jest',
+ '^.+\\.tsx?$': ['ts-jest', { babelConfig: `${__dirname}/babel.config.js` }],
'^.+\\.(js|jsx)$': 'babel-jest',
},
moduleDirectories: ['node_modules', 'src'],
testPathIgnorePatterns: ['./node_modules/'],
collectCoverageFrom: [],
coveragePathIgnorePatterns: ['.stories.*'],
- coverageThreshold: {
- global: {},
- },
transformIgnorePatterns: [`${__dirname}/node_modules/(?!lodash-es)`],
- globals: {
- 'ts-jest': {
- babelConfig: `${__dirname}/babel.config.js`,
- // pervent memory leak since jest 27 update
- // see https://github.com/kulshekhar/ts-jest/issues/1967
- isolatedModules: true,
- },
- },
};
diff --git a/jest.d.ts b/jest.d.ts
new file mode 100644
index 0000000000..7b0828bfa8
--- /dev/null
+++ b/jest.d.ts
@@ -0,0 +1 @@
+import '@testing-library/jest-dom';
diff --git a/jestHelper.js b/jestHelper.js
index c459d57ac9..150e187500 100644
--- a/jestHelper.js
+++ b/jestHelper.js
@@ -1,2 +1,2 @@
-require('@testing-library/jest-dom/extend-expect');
+require('@testing-library/jest-dom');
require('regenerator-runtime/runtime');
diff --git a/package.json b/package.json
index f26c0a5e03..63bd64e3de 100644
--- a/package.json
+++ b/package.json
@@ -2,6 +2,9 @@
"name": "draft-js-plugins",
"description": "A Plugin Architecture on top of Draft.JS",
"version": "0.0.0",
+ "engines": {
+ "node": ">=24"
+ },
"author": {
"name": "Nik Graf",
"email": "nik@nikgraf.com",
@@ -9,57 +12,67 @@
},
"dependencies": {
"draft-js": "^0.11.0",
- "eslint-plugin-import": "^2.32.0",
- "react": "^17.0.2",
- "react-dom": "^17.0.2"
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1"
+ },
+ "resolutions": {
+ "@types/react": "^18.3.27",
+ "core-js": "^3.50.0",
+ "flat-cache": "5.0.0",
+ "test-exclude": "8.0.0"
+ },
+ "overrides": {
+ "@types/react": "^18.3.27",
+ "core-js": "^3.50.0",
+ "flat-cache": "5.0.0",
+ "test-exclude": "8.0.0"
},
"devDependencies": {
"@babel/core": "7.28.5",
- "@babel/plugin-proposal-class-properties": "7.18.6",
+ "@babel/plugin-transform-class-properties": "7.28.6",
"@babel/preset-env": "7.28.3",
+ "@babel/preset-flow": "7.27.1",
"@babel/preset-react": "7.28.5",
"@babel/preset-typescript": "7.27.1",
+ "@biomejs/biome": "^2.5.10",
"@changesets/cli": "^2.29.5",
+ "@linaria/core": "8.2.0",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-node-resolve": "^14.1.0",
- "@storybook/builder-webpack5": "^6.5.16",
- "@storybook/manager-webpack5": "^6.5.16",
- "@storybook/react": "^6.5.16",
- "@testing-library/jest-dom": "^5.16.5",
- "@testing-library/react": "^12.1.5",
- "@testing-library/react-hooks": "^8.0.1",
+ "@storybook/react-webpack5": "10.6.0",
+ "@testing-library/dom": "^10.4.1",
+ "@testing-library/jest-dom": "^7.0.1",
+ "@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.1",
- "@types/jest": "^27.5.0",
- "@types/react-dom": "^18.0.3",
- "@typescript-eslint/eslint-plugin": "4.33.0",
- "@typescript-eslint/parser": "^4.33.0",
- "babel-eslint": "^10.1.0",
- "babel-jest": "^29.7.0",
+ "@types/jest": "30.0.0",
+ "@types/react": "^18.3.27",
+ "@types/react-dom": "^18.3.7",
+ "@wyw-in-js/rollup": "2.5.1",
+ "@wyw-in-js/shared": "2.5.0",
+ "@wyw-in-js/transform": "2.5.1",
+ "@wyw-in-js/webpack-loader": "2.5.1",
+ "babel-jest": "30.5.1",
"babel-loader": "^8.2.5",
"babel-plugin-transform-rename-import": "^2.3.0",
"css-loader": "6.8.1",
- "eslint": "^7.32.0",
- "eslint-config-airbnb": "^14.1.0",
- "eslint-config-prettier": "^8.8.0",
- "eslint-import-resolver-typescript": "2.7.1",
- "eslint-plugin-jsx-a11y": "4.0.0",
- "eslint-plugin-no-only-tests": "^3.3.0",
- "eslint-plugin-react": "^7.37.5",
- "eslint-plugin-react-hooks": "^4.6.2",
+ "fast-glob": "^3.3.3",
"husky": "^8.0.3",
- "jest": "^27.5.1",
- "linaria": "2.1",
+ "immutable": "^5.1.5",
+ "jest": "30.5.1",
+ "jest-environment-jsdom": "30.5.1",
"lint-staged": "^13.2.2",
- "matched": "^5.0.1",
- "multer": "^1.4.4",
+ "multer": "^2.3.0",
+ "path-browserify": "^1.0.1",
"prettier": "^3.6.2",
"prismjs": "^1.30.0",
- "rimraf": "^5.0.7",
+ "rimraf": "^6.1.3",
"rollup": "^2.79.2",
+ "rollup-plugin-css-only": "4.5.5",
+ "storybook": "10.6.0",
"style-loader": "3.3.4",
- "ts-jest": "27.1.4",
+ "ts-jest": "29.4.12",
"ts-node": "10.9.2",
- "typescript": "4.9.5",
+ "typescript": "^5.9.3",
"webpack": "^5.102.1"
},
"keywords": [
@@ -76,11 +89,7 @@
"lint-staged": {
"*.(js|ts|tsx)": [
"prettier --write",
- "git add",
- "eslint"
- ],
- "*.(ts|tsx)": [
- "bash -c tsc --noEmit"
+ "biome lint --write"
]
},
"main": "lib/index.js",
@@ -91,20 +100,20 @@
"private": true,
"repository": {
"type": "git",
- "url": "https://github.com/draft-js-plugins/draft-js-plugins.git"
+ "url": "https://github.com/Vectorworks/draft-js-plugins.git"
},
"scripts": {
"alex": "alex README.md",
- "build-storybook": "build-storybook",
- "lint": "yarn lint:eslint && yarn tsc",
- "lint:eslint": "eslint --ext .js,.ts,.tsx ./",
- "lint:eslint:fix": "eslint --fix ./",
- "storybook": "start-storybook -p 6006",
+ "build-storybook": "storybook build",
+ "lint": "yarn lint:biome && yarn tsc",
+ "lint:biome": "biome lint ./",
+ "lint:biome:fix": "biome lint --write ./",
+ "storybook": "storybook dev -p 6006",
"test": "yarn build:dts && yarn test:jest",
"test:jest": "jest",
"test:watch": "yarn test -- --watch",
"build": "yarn build:dts && yarn workspaces run build",
- "build:dts": "yarn workspace @draft-js-plugins/editor run build && yarn workspace @draft-js-plugins/utils run build && yarn workspace @draft-js-plugins/buttons run build",
+ "build:dts": "yarn workspace @vectorworks/draft-js-plugins run build && yarn workspace @draft-js-plugins/utils run build && yarn workspace @draft-js-plugins/buttons run build",
"prerelease": "yarn build",
"release": "changeset publish",
"postinstall": "husky install"
diff --git a/packages/alignment/README.md b/packages/alignment/README.md
index d03e69185d..8803707be9 100644
--- a/packages/alignment/README.md
+++ b/packages/alignment/README.md
@@ -1,6 +1,6 @@
# DraftJS Alignment Plugin
-_This is a plugin for the `@draft-js-plugins/editor`._
+_This is a plugin for the `@vectorworks/draft-js-plugins`._
Usage:
diff --git a/packages/alignment/jest.config.js b/packages/alignment/jest.config.js
index f053e09bd2..917137a21f 100644
--- a/packages/alignment/jest.config.js
+++ b/packages/alignment/jest.config.js
@@ -4,5 +4,4 @@ const packageName = require('./package').name;
module.exports = {
...base,
displayName: packageName,
- name: packageName,
};
diff --git a/packages/alignment/package.json b/packages/alignment/package.json
index 304523c989..1780a2a764 100644
--- a/packages/alignment/package.json
+++ b/packages/alignment/package.json
@@ -30,7 +30,7 @@
"build": "yarn build:js && yarn build:dts && yarn build:css",
"build:js": "yarn rollup --config ../../rollup.config.js",
"build:dts": "tsc -d",
- "build:css": "node ../../scripts/build-css.js $(pwd)",
+ "build:css": "node ../../scripts/build-css.js",
"test": "jest"
},
"license": "MIT",
@@ -39,6 +39,7 @@
"@draft-js-plugins/utils": "^4.2.1"
},
"peerDependencies": {
+ "@vectorworks/draft-js-plugins": "^4.1.4",
"draft-js": "^0.10.1 || ^0.11.0",
"react": "^16.8.0 || ^17.0.0 || >=18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || >=18.0.0"
diff --git a/packages/alignment/src/createDecorator.tsx b/packages/alignment/src/createDecorator.tsx
index f998e9c72d..c3ed7d271a 100644
--- a/packages/alignment/src/createDecorator.tsx
+++ b/packages/alignment/src/createDecorator.tsx
@@ -99,5 +99,5 @@ export default ({ store }: { store: AlignmentPluginStore }) =>
(BlockAlignmentDecorator as any).WrappedComponent =
WrappedComponent.WrappedComponent || WrappedComponent;
- return BlockAlignmentDecorator;
+ return BlockAlignmentDecorator as unknown as ComponentType;
};
diff --git a/packages/alignment/src/index.tsx b/packages/alignment/src/index.tsx
index 3b9216ef4e..f1962dfdcc 100644
--- a/packages/alignment/src/index.tsx
+++ b/packages/alignment/src/index.tsx
@@ -1,6 +1,6 @@
import React, { ComponentType, ReactElement } from 'react';
import { ContentBlock, EditorState } from 'draft-js';
-import { EditorPlugin } from '@draft-js-plugins/editor';
+import { EditorPlugin } from '@vectorworks/draft-js-plugins';
import { createStore, Store } from '@draft-js-plugins/utils';
import createDecorator from './createDecorator';
import AlignmentTool from './AlignmentTool';
diff --git a/packages/alignment/src/theme.ts b/packages/alignment/src/theme.ts
index 14d9ccae64..ca957a936b 100644
--- a/packages/alignment/src/theme.ts
+++ b/packages/alignment/src/theme.ts
@@ -1,5 +1,5 @@
import { DraftJsButtonTheme } from '@draft-js-plugins/buttons';
-import { css } from 'linaria';
+import { css } from '@linaria/core';
export interface AlignmentPluginTheme {
buttonStyles: DraftJsButtonTheme;
diff --git a/packages/anchor/README.md b/packages/anchor/README.md
index 8e0b2eccc6..f81395bd47 100644
--- a/packages/anchor/README.md
+++ b/packages/anchor/README.md
@@ -1,6 +1,6 @@
# Draft.js Link Plugin
-_This is a plugin for the `@draft-js-plugins/editor`._
+_This is a plugin for the `@vectorworks/draft-js-plugins`._
This plugin allows you to add link entities via the [inline toolbar](https://www.draft-js-plugins.com/plugin/inline-toolbar). It also provides a decorator that formats the created entities. HTTP, HTTPS, as well as email addresses (with or without mailto: attached to it) are supported.
diff --git a/packages/anchor/jest.config.js b/packages/anchor/jest.config.js
index f053e09bd2..917137a21f 100644
--- a/packages/anchor/jest.config.js
+++ b/packages/anchor/jest.config.js
@@ -4,5 +4,4 @@ const packageName = require('./package').name;
module.exports = {
...base,
displayName: packageName,
- name: packageName,
};
diff --git a/packages/anchor/package.json b/packages/anchor/package.json
index bc390f3b8d..5bf24849c3 100644
--- a/packages/anchor/package.json
+++ b/packages/anchor/package.json
@@ -32,7 +32,7 @@
"build": "yarn build:js && yarn build:dts && yarn build:css",
"build:js": "yarn rollup --config ../../rollup.config.js",
"build:dts": "tsc -d",
- "build:css": "node ../../scripts/build-css.js $(pwd)",
+ "build:css": "node ../../scripts/build-css.js",
"test": "jest"
},
"license": "MIT",
@@ -44,6 +44,7 @@
"tlds": "^1.261.0"
},
"peerDependencies": {
+ "@vectorworks/draft-js-plugins": "^4.1.4",
"draft-js": "^0.10.1 || ^0.11.0",
"react": "^16.8.0 || ^17.0.0 || >=18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || >=18.0.0"
diff --git a/packages/anchor/src/index.tsx b/packages/anchor/src/index.tsx
index 5a9281c778..0bbcc2b755 100644
--- a/packages/anchor/src/index.tsx
+++ b/packages/anchor/src/index.tsx
@@ -3,7 +3,7 @@ import React, {
ComponentType,
ReactElement,
} from 'react';
-import { EditorPlugin } from '@draft-js-plugins/editor';
+import { EditorPlugin } from '@vectorworks/draft-js-plugins';
import EditorUtils from '@draft-js-plugins/utils';
import { EditorState } from 'draft-js';
import DefaultLink, { LinkPubProps } from './components/Link';
diff --git a/packages/anchor/src/theme.ts b/packages/anchor/src/theme.ts
index 7163d77e9f..134592e309 100644
--- a/packages/anchor/src/theme.ts
+++ b/packages/anchor/src/theme.ts
@@ -1,4 +1,4 @@
-import { css } from 'linaria';
+import { css } from '@linaria/core';
export interface AnchorPluginTheme {
input: string;
diff --git a/packages/buttons/jest.config.js b/packages/buttons/jest.config.js
index f053e09bd2..917137a21f 100644
--- a/packages/buttons/jest.config.js
+++ b/packages/buttons/jest.config.js
@@ -4,5 +4,4 @@ const packageName = require('./package').name;
module.exports = {
...base,
displayName: packageName,
- name: packageName,
};
diff --git a/packages/counter/README.md b/packages/counter/README.md
index 31c9c71318..aac523f10a 100644
--- a/packages/counter/README.md
+++ b/packages/counter/README.md
@@ -1,6 +1,6 @@
# DraftJS Counter Plugin
-_This is a plugin for the `@draft-js-plugins/editor`._
+_This is a plugin for the `@vectorworks/draft-js-plugins`._
This plugin adds character and word counting functionality to your editor!
diff --git a/packages/counter/jest.config.js b/packages/counter/jest.config.js
index f053e09bd2..917137a21f 100644
--- a/packages/counter/jest.config.js
+++ b/packages/counter/jest.config.js
@@ -4,5 +4,4 @@ const packageName = require('./package').name;
module.exports = {
...base,
displayName: packageName,
- name: packageName,
};
diff --git a/packages/counter/package.json b/packages/counter/package.json
index 6cbac8d592..f6cbc0c889 100644
--- a/packages/counter/package.json
+++ b/packages/counter/package.json
@@ -31,7 +31,7 @@
"build": "yarn build:js && yarn build:dts && yarn build:css",
"build:js": "yarn rollup --config ../../rollup.config.js",
"build:dts": "tsc -d --emitDeclarationOnly --declarationDir lib",
- "build:css": "node ../../scripts/build-css.js $(pwd)",
+ "build:css": "node ../../scripts/build-css.js",
"test": "jest"
},
"license": "MIT",
@@ -41,6 +41,7 @@
"punycode": "^2.3.1"
},
"peerDependencies": {
+ "@vectorworks/draft-js-plugins": "^4.1.4",
"draft-js": "^0.10.1 || ^0.11.0",
"react": "^16.8.0 || ^17.0.0 || >=18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || >=18.0.0"
diff --git a/packages/counter/src/CharCounter/__test__/index.test.tsx b/packages/counter/src/CharCounter/__test__/index.test.tsx
index 47a0876281..6892788929 100644
--- a/packages/counter/src/CharCounter/__test__/index.test.tsx
+++ b/packages/counter/src/CharCounter/__test__/index.test.tsx
@@ -1,10 +1,11 @@
import React from 'react';
+import '@testing-library/jest-dom';
import { screen, render } from '@testing-library/react';
-import { PluginFunctions } from '@draft-js-plugins/editor';
+import { PluginFunctions } from '@vectorworks/draft-js-plugins';
import { EditorState, ContentState } from 'draft-js';
import createCounterPlugin from '../../index';
-jest.mock('linaria');
+jest.mock('@linaria/core');
describe('CounterPlugin Character Counter', () => {
const createEditorStateFromText = (text: string): EditorState => {
diff --git a/packages/counter/src/CustomCounter/__test__/index.test.tsx b/packages/counter/src/CustomCounter/__test__/index.test.tsx
index 5c0ebe1060..d78c404299 100644
--- a/packages/counter/src/CustomCounter/__test__/index.test.tsx
+++ b/packages/counter/src/CustomCounter/__test__/index.test.tsx
@@ -1,10 +1,11 @@
import React from 'react';
+import '@testing-library/jest-dom';
import { screen, render } from '@testing-library/react';
import { EditorState, ContentState } from 'draft-js';
-import { PluginFunctions } from '@draft-js-plugins/editor';
+import { PluginFunctions } from '@vectorworks/draft-js-plugins';
import createCounterPlugin from '../../index';
-jest.mock('linaria');
+jest.mock('@linaria/core');
describe('CounterPlugin Line Counter', () => {
const createEditorStateFromText = (text: string): EditorState => {
diff --git a/packages/counter/src/LineCounter/__test__/index.test.tsx b/packages/counter/src/LineCounter/__test__/index.test.tsx
index 0625deb938..0f326ac2bb 100644
--- a/packages/counter/src/LineCounter/__test__/index.test.tsx
+++ b/packages/counter/src/LineCounter/__test__/index.test.tsx
@@ -1,10 +1,11 @@
import React from 'react';
+import '@testing-library/jest-dom';
import { screen, render } from '@testing-library/react';
import { EditorState, ContentState } from 'draft-js';
-import { PluginFunctions } from '@draft-js-plugins/editor';
+import { PluginFunctions } from '@vectorworks/draft-js-plugins';
import createCounterPlugin from '../../index';
-jest.mock('linaria');
+jest.mock('@linaria/core');
describe('CounterPlugin Line Counter', () => {
const createEditorStateFromText = (text: string): EditorState => {
diff --git a/packages/counter/src/WordCounter/__test__/index.test.tsx b/packages/counter/src/WordCounter/__test__/index.test.tsx
index 0132d420fe..0095244e9a 100644
--- a/packages/counter/src/WordCounter/__test__/index.test.tsx
+++ b/packages/counter/src/WordCounter/__test__/index.test.tsx
@@ -1,10 +1,11 @@
import React from 'react';
+import '@testing-library/jest-dom';
import { screen, render } from '@testing-library/react';
import { EditorState, ContentState } from 'draft-js';
-import { PluginFunctions } from '@draft-js-plugins/editor';
+import { PluginFunctions } from '@vectorworks/draft-js-plugins';
import createCounterPlugin from '../../index';
-jest.mock('linaria');
+jest.mock('@linaria/core');
describe('CounterPlugin Word Counter', () => {
const createEditorStateFromText = (text: string): EditorState => {
diff --git a/packages/counter/src/index.tsx b/packages/counter/src/index.tsx
index da3ca8632d..6b50bc1957 100644
--- a/packages/counter/src/index.tsx
+++ b/packages/counter/src/index.tsx
@@ -1,6 +1,6 @@
import React, { ComponentType, ReactElement } from 'react';
import { EditorState } from 'draft-js';
-import { EditorPlugin } from '@draft-js-plugins/editor';
+import { EditorPlugin } from '@vectorworks/draft-js-plugins';
import CharCounter, { CharCounterPubProps } from './CharCounter';
import WordCounter, { WordCounterPubParams } from './WordCounter';
import LineCounter, { LineCounterPubParams } from './LineCounter';
diff --git a/packages/counter/src/theme.ts b/packages/counter/src/theme.ts
index 7022a690c3..87ebdc06a6 100644
--- a/packages/counter/src/theme.ts
+++ b/packages/counter/src/theme.ts
@@ -1,4 +1,4 @@
-import { css } from 'linaria';
+import { css } from '@linaria/core';
export interface CounterPluginTheme {
counter?: string;
diff --git a/packages/divider/README.md b/packages/divider/README.md
index a1aec54ce5..3b48f3d244 100644
--- a/packages/divider/README.md
+++ b/packages/divider/README.md
@@ -1,6 +1,6 @@
# DraftJS Divider Plugin
-_This is a plugin for the `@draft-js-plugins/editor`._
+_This is a plugin for the `@vectorworks/draft-js-plugins`._
## Usage
diff --git a/packages/divider/jest.config.js b/packages/divider/jest.config.js
index f053e09bd2..917137a21f 100644
--- a/packages/divider/jest.config.js
+++ b/packages/divider/jest.config.js
@@ -4,5 +4,4 @@ const packageName = require('./package').name;
module.exports = {
...base,
displayName: packageName,
- name: packageName,
};
diff --git a/packages/divider/package.json b/packages/divider/package.json
index 096b0b7ff8..847acafaeb 100644
--- a/packages/divider/package.json
+++ b/packages/divider/package.json
@@ -31,7 +31,7 @@
"build": "yarn build:js && yarn build:dts && yarn build:css",
"build:js": "yarn rollup --config ../../rollup.config.js",
"build:dts": "tsc -d",
- "build:css": "node ../../scripts/build-css.js $(pwd)",
+ "build:css": "node ../../scripts/build-css.js",
"test": "jest"
},
"license": "MIT",
@@ -40,6 +40,7 @@
"prop-types": "^15.8.1"
},
"peerDependencies": {
+ "@vectorworks/draft-js-plugins": "^4.1.4",
"draft-js": "^0.10.1 || ^0.11.0",
"react": "^16.8.0 || ^17.0.0 || >=18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || >=18.0.0"
diff --git a/packages/divider/src/index.tsx b/packages/divider/src/index.tsx
index 97e5f43a70..0ccf6bad78 100644
--- a/packages/divider/src/index.tsx
+++ b/packages/divider/src/index.tsx
@@ -1,5 +1,5 @@
import React, { ComponentType, ReactElement } from 'react';
-import { EditorPlugin } from '@draft-js-plugins/editor';
+import { EditorPlugin } from '@vectorworks/draft-js-plugins';
import DefaultDivider, {
DefaultDividerProps,
} from './components/DefaultDivider';
diff --git a/packages/divider/src/theme.ts b/packages/divider/src/theme.ts
index 463e099a3a..36b5af229b 100644
--- a/packages/divider/src/theme.ts
+++ b/packages/divider/src/theme.ts
@@ -1,10 +1,10 @@
-import { css } from 'linaria';
+import { css } from '@linaria/core';
export interface DividerPluginTheme {
divider?: string;
}
-export const defaultTheme = {
+export const defaultTheme: { divider: string } = {
divider: css`
display: flex;
align-items: center;
diff --git a/packages/docs/components/Examples/alignment/SimpleAlignmentEditor/index.js b/packages/docs/components/Examples/alignment/SimpleAlignmentEditor/index.js
index 4e55295f47..c456cd774e 100644
--- a/packages/docs/components/Examples/alignment/SimpleAlignmentEditor/index.js
+++ b/packages/docs/components/Examples/alignment/SimpleAlignmentEditor/index.js
@@ -4,9 +4,9 @@ import {
DefaultDraftBlockRenderMap,
EditorState,
} from 'draft-js';
-import Immutable from 'immutable';
+import { Map } from 'immutable';
-import Editor, { composeDecorators } from '@draft-js-plugins/editor';
+import Editor, { composeDecorators } from '@vectorworks/draft-js-plugins';
import createAlignmentPlugin from '@draft-js-plugins/alignment';
@@ -79,7 +79,7 @@ function BlockWrapper({ children }) {
return {children}
;
}
-const blockRenderMap = Immutable.Map({
+const blockRenderMap = Map({
atomic: {
element: 'figure',
wrapper: ,
diff --git a/packages/docs/components/Examples/alignment/ThemedAlignmentEditor/index.js b/packages/docs/components/Examples/alignment/ThemedAlignmentEditor/index.js
index 85fb50015a..bbc5f224a8 100644
--- a/packages/docs/components/Examples/alignment/ThemedAlignmentEditor/index.js
+++ b/packages/docs/components/Examples/alignment/ThemedAlignmentEditor/index.js
@@ -4,8 +4,8 @@ import {
DefaultDraftBlockRenderMap,
EditorState,
} from 'draft-js';
-import Immutable from 'immutable';
-import Editor, { composeDecorators } from '@draft-js-plugins/editor';
+import { Map } from 'immutable';
+import Editor, { composeDecorators } from '@vectorworks/draft-js-plugins';
import createAlignmentPlugin from '@draft-js-plugins/alignment';
import createFocusPlugin from '@draft-js-plugins/focus';
import createColorBlockPlugin from './colorBlockPlugin';
@@ -83,7 +83,7 @@ function BlockWrapper({ children }) {
return {children}
;
}
-const blockRenderMap = Immutable.Map({
+const blockRenderMap = Map({
atomic: {
element: 'figure',
wrapper: ,
diff --git a/packages/docs/components/Examples/anchor/CustomInlineToolbarEditor/index.js b/packages/docs/components/Examples/anchor/CustomInlineToolbarEditor/index.js
index 4a15f1cf2b..2fba5f5f7d 100644
--- a/packages/docs/components/Examples/anchor/CustomInlineToolbarEditor/index.js
+++ b/packages/docs/components/Examples/anchor/CustomInlineToolbarEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createInlineToolbarPlugin from '@draft-js-plugins/inline-toolbar';
import createLinkPlugin from '@draft-js-plugins/anchor';
import {
diff --git a/packages/docs/components/Examples/anchor/SimpleLinkPluginEditor/index.js b/packages/docs/components/Examples/anchor/SimpleLinkPluginEditor/index.js
index 4e11bcdaf0..2c92eff049 100644
--- a/packages/docs/components/Examples/anchor/SimpleLinkPluginEditor/index.js
+++ b/packages/docs/components/Examples/anchor/SimpleLinkPluginEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createInlineToolbarPlugin from '@draft-js-plugins/inline-toolbar';
import createLinkPlugin from '@draft-js-plugins/anchor';
import {
diff --git a/packages/docs/components/Examples/anchor/gettingStarted.js b/packages/docs/components/Examples/anchor/gettingStarted.js
index 7cc606f643..6f7125b939 100644
--- a/packages/docs/components/Examples/anchor/gettingStarted.js
+++ b/packages/docs/components/Examples/anchor/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createLinkPlugin from '@draft-js-plugins/anchor';
import createInlineToolbarPlugin from '@draft-js-plugins/inline-toolbar';
import {
diff --git a/packages/docs/components/Examples/counter/CustomCounterEditor/index.js b/packages/docs/components/Examples/counter/CustomCounterEditor/index.js
index f61cb95fbd..6ee8ccdb45 100644
--- a/packages/docs/components/Examples/counter/CustomCounterEditor/index.js
+++ b/packages/docs/components/Examples/counter/CustomCounterEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createCounterPlugin from '@draft-js-plugins/counter';
import editorStyles from './editorStyles.module.css';
import counterStyles from './counterStyles.module.css';
diff --git a/packages/docs/components/Examples/counter/SimpleCounterEditor/index.js b/packages/docs/components/Examples/counter/SimpleCounterEditor/index.js
index 2651e96615..657a4ed8c8 100644
--- a/packages/docs/components/Examples/counter/SimpleCounterEditor/index.js
+++ b/packages/docs/components/Examples/counter/SimpleCounterEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createCounterPlugin from '@draft-js-plugins/counter';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/counter/gettingStarted.js b/packages/docs/components/Examples/counter/gettingStarted.js
index dcbcf0e956..dcd47e5d1d 100644
--- a/packages/docs/components/Examples/counter/gettingStarted.js
+++ b/packages/docs/components/Examples/counter/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createCounterPlugin from '@draft-js-plugins/counter';
import React from 'react';
diff --git a/packages/docs/components/Examples/divider/DividerWithSideToolbarEditor/index.js b/packages/docs/components/Examples/divider/DividerWithSideToolbarEditor/index.js
index f290722248..e04fbf3968 100644
--- a/packages/docs/components/Examples/divider/DividerWithSideToolbarEditor/index.js
+++ b/packages/docs/components/Examples/divider/DividerWithSideToolbarEditor/index.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { convertFromRaw, EditorState } from 'draft-js';
-import Editor, { composeDecorators } from '@draft-js-plugins/editor';
+import Editor, { composeDecorators } from '@vectorworks/draft-js-plugins';
import createFocusPlugin from '@draft-js-plugins/focus';
import createSideToolbarPlugin from '@draft-js-plugins/side-toolbar';
import createDividerPlugin from '@draft-js-plugins/divider';
diff --git a/packages/docs/components/Examples/divider/gettingStarted.js b/packages/docs/components/Examples/divider/gettingStarted.js
index 13f4918c63..575436684a 100644
--- a/packages/docs/components/Examples/divider/gettingStarted.js
+++ b/packages/docs/components/Examples/divider/gettingStarted.js
@@ -1,6 +1,6 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createDividerPlugin from '@draft-js-plugins/divider';
import React from 'react';
diff --git a/packages/docs/components/Examples/drag-n-drop/CustomImageEditor/index.js b/packages/docs/components/Examples/drag-n-drop/CustomImageEditor/index.js
index 49b63bea63..05da177d9d 100644
--- a/packages/docs/components/Examples/drag-n-drop/CustomImageEditor/index.js
+++ b/packages/docs/components/Examples/drag-n-drop/CustomImageEditor/index.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { convertFromRaw, EditorState } from 'draft-js';
-import Editor, { composeDecorators } from '@draft-js-plugins/editor';
+import Editor, { composeDecorators } from '@vectorworks/draft-js-plugins';
import createImagePlugin from '@draft-js-plugins/image';
diff --git a/packages/docs/components/Examples/drag-n-drop/gettingStarted.js b/packages/docs/components/Examples/drag-n-drop/gettingStarted.js
index 5b8c26b131..392dadfe71 100644
--- a/packages/docs/components/Examples/drag-n-drop/gettingStarted.js
+++ b/packages/docs/components/Examples/drag-n-drop/gettingStarted.js
@@ -1,6 +1,6 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createImagePlugin from '@draft-js-plugins/image';
import React from 'react';
diff --git a/packages/docs/components/Examples/emoji/CustomEmojiEditor/index.js b/packages/docs/components/Examples/emoji/CustomEmojiEditor/index.js
index 8b95e2a234..d60d3ffdf4 100644
--- a/packages/docs/components/Examples/emoji/CustomEmojiEditor/index.js
+++ b/packages/docs/components/Examples/emoji/CustomEmojiEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createEmojiPlugin from '@draft-js-plugins/emoji';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/emoji/SimpleEmojiEditor/index.js b/packages/docs/components/Examples/emoji/SimpleEmojiEditor/index.js
index cc8d1d41da..b3a1280da5 100644
--- a/packages/docs/components/Examples/emoji/SimpleEmojiEditor/index.js
+++ b/packages/docs/components/Examples/emoji/SimpleEmojiEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createEmojiPlugin from '@draft-js-plugins/emoji';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/emoji/gettingStarted.js b/packages/docs/components/Examples/emoji/gettingStarted.js
index 0058cec2bc..d2c62a06ec 100644
--- a/packages/docs/components/Examples/emoji/gettingStarted.js
+++ b/packages/docs/components/Examples/emoji/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createEmojiPlugin from '@draft-js-plugins/emoji';
import React from 'react';
diff --git a/packages/docs/components/Examples/focus/SimpleFocusEditor/index.js b/packages/docs/components/Examples/focus/SimpleFocusEditor/index.js
index 362d85343b..632c351bab 100644
--- a/packages/docs/components/Examples/focus/SimpleFocusEditor/index.js
+++ b/packages/docs/components/Examples/focus/SimpleFocusEditor/index.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { convertFromRaw, EditorState } from 'draft-js';
-import Editor, { composeDecorators } from '@draft-js-plugins/editor';
+import Editor, { composeDecorators } from '@vectorworks/draft-js-plugins';
import createFocusPlugin from '@draft-js-plugins/focus';
import createColorBlockPlugin from './colorBlockPlugin';
diff --git a/packages/docs/components/Examples/hashtag/CustomHashtagEditor/index.js b/packages/docs/components/Examples/hashtag/CustomHashtagEditor/index.js
index bdad3d7fbb..7cba84d824 100644
--- a/packages/docs/components/Examples/hashtag/CustomHashtagEditor/index.js
+++ b/packages/docs/components/Examples/hashtag/CustomHashtagEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createHashtagPlugin from '@draft-js-plugins/hashtag';
import editorStyles from './editorStyles.module.css';
import hashtagStyles from './hashtagStyles.module.css';
diff --git a/packages/docs/components/Examples/hashtag/SimpleHashtagEditor/index.js b/packages/docs/components/Examples/hashtag/SimpleHashtagEditor/index.js
index 9d85aaf16a..17c74b243e 100644
--- a/packages/docs/components/Examples/hashtag/SimpleHashtagEditor/index.js
+++ b/packages/docs/components/Examples/hashtag/SimpleHashtagEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createHashtagPlugin from '@draft-js-plugins/hashtag';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/hashtag/gettingStarted.js b/packages/docs/components/Examples/hashtag/gettingStarted.js
index 21319c38a9..eabe72a405 100644
--- a/packages/docs/components/Examples/hashtag/gettingStarted.js
+++ b/packages/docs/components/Examples/hashtag/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createHashtagPlugin from '@draft-js-plugins/hashtag';
import React from 'react';
diff --git a/packages/docs/components/Examples/image/AddImageEditor/index.js b/packages/docs/components/Examples/image/AddImageEditor/index.js
index c8e98675e7..72e4bfaf08 100644
--- a/packages/docs/components/Examples/image/AddImageEditor/index.js
+++ b/packages/docs/components/Examples/image/AddImageEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createImagePlugin from '@draft-js-plugins/image';
import ImageAdd from './ImageAdd';
diff --git a/packages/docs/components/Examples/image/CustomImageEditor/index.js b/packages/docs/components/Examples/image/CustomImageEditor/index.js
index e006e51cd2..f88ab8a315 100644
--- a/packages/docs/components/Examples/image/CustomImageEditor/index.js
+++ b/packages/docs/components/Examples/image/CustomImageEditor/index.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { convertFromRaw, EditorState } from 'draft-js';
-import Editor, { composeDecorators } from '@draft-js-plugins/editor';
+import Editor, { composeDecorators } from '@vectorworks/draft-js-plugins';
import createImagePlugin from '@draft-js-plugins/image';
diff --git a/packages/docs/components/Examples/image/SimpleImageEditor/index.js b/packages/docs/components/Examples/image/SimpleImageEditor/index.js
index d0d871bb33..e5c3bfd283 100644
--- a/packages/docs/components/Examples/image/SimpleImageEditor/index.js
+++ b/packages/docs/components/Examples/image/SimpleImageEditor/index.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { convertFromRaw, EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createImagePlugin from '@draft-js-plugins/image';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/image/gettingStarted.js b/packages/docs/components/Examples/image/gettingStarted.js
index 5b8c26b131..392dadfe71 100644
--- a/packages/docs/components/Examples/image/gettingStarted.js
+++ b/packages/docs/components/Examples/image/gettingStarted.js
@@ -1,6 +1,6 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createImagePlugin from '@draft-js-plugins/image';
import React from 'react';
diff --git a/packages/docs/components/Examples/inline-toolbar/CustomInlineToolbarEditor/index.js b/packages/docs/components/Examples/inline-toolbar/CustomInlineToolbarEditor/index.js
index 0e8d300d8c..5d3640626d 100644
--- a/packages/docs/components/Examples/inline-toolbar/CustomInlineToolbarEditor/index.js
+++ b/packages/docs/components/Examples/inline-toolbar/CustomInlineToolbarEditor/index.js
@@ -1,7 +1,7 @@
/* eslint-disable react/no-multi-comp */
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createInlineToolbarPlugin, {
Separator,
diff --git a/packages/docs/components/Examples/inline-toolbar/SimpleInlineToolbarEditor/index.tsx b/packages/docs/components/Examples/inline-toolbar/SimpleInlineToolbarEditor/index.tsx
index be535322f1..a80af164e6 100644
--- a/packages/docs/components/Examples/inline-toolbar/SimpleInlineToolbarEditor/index.tsx
+++ b/packages/docs/components/Examples/inline-toolbar/SimpleInlineToolbarEditor/index.tsx
@@ -6,7 +6,7 @@ import React, {
useState,
} from 'react';
import { EditorState } from 'draft-js';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createInlineToolbarPlugin from '@draft-js-plugins/inline-toolbar';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/inline-toolbar/ThemedInlineToolbarEditor/index.js b/packages/docs/components/Examples/inline-toolbar/ThemedInlineToolbarEditor/index.js
index f44c913195..213ca22a09 100644
--- a/packages/docs/components/Examples/inline-toolbar/ThemedInlineToolbarEditor/index.js
+++ b/packages/docs/components/Examples/inline-toolbar/ThemedInlineToolbarEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createInlineToolbarPlugin from '@draft-js-plugins/inline-toolbar';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/inline-toolbar/gettingStarted.js b/packages/docs/components/Examples/inline-toolbar/gettingStarted.js
index 823c2a30c4..88de7a5708 100644
--- a/packages/docs/components/Examples/inline-toolbar/gettingStarted.js
+++ b/packages/docs/components/Examples/inline-toolbar/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createInlineToolbarPlugin from '@draft-js-plugins/inline-toolbar';
import React from 'react';
diff --git a/packages/docs/components/Examples/linkify/CustomComponentLinkifyEditor/index.js b/packages/docs/components/Examples/linkify/CustomComponentLinkifyEditor/index.js
index 671f480a45..eef7bb3dff 100644
--- a/packages/docs/components/Examples/linkify/CustomComponentLinkifyEditor/index.js
+++ b/packages/docs/components/Examples/linkify/CustomComponentLinkifyEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createLinkifyPlugin from '@draft-js-plugins/linkify';
import linkifyIt from 'linkify-it';
import tlds from 'tlds';
diff --git a/packages/docs/components/Examples/linkify/CustomLinkifyEditor/index.js b/packages/docs/components/Examples/linkify/CustomLinkifyEditor/index.js
index 1fdaa12645..148430b79e 100644
--- a/packages/docs/components/Examples/linkify/CustomLinkifyEditor/index.js
+++ b/packages/docs/components/Examples/linkify/CustomLinkifyEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createLinkifyPlugin from '@draft-js-plugins/linkify';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/linkify/SimpleLinkifyEditor/index.js b/packages/docs/components/Examples/linkify/SimpleLinkifyEditor/index.js
index e4082bdd96..8fdc31f786 100644
--- a/packages/docs/components/Examples/linkify/SimpleLinkifyEditor/index.js
+++ b/packages/docs/components/Examples/linkify/SimpleLinkifyEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createLinkifyPlugin from '@draft-js-plugins/linkify';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/linkify/gettingStarted.js b/packages/docs/components/Examples/linkify/gettingStarted.js
index bd1cc68eed..aa8cc091cf 100644
--- a/packages/docs/components/Examples/linkify/gettingStarted.js
+++ b/packages/docs/components/Examples/linkify/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createLinkifyPlugin from '@draft-js-plugins/linkify';
import React from 'react';
diff --git a/packages/docs/components/Examples/mention/CustomComponentMentionEditor/CustomComponentMentionEditor.tsx b/packages/docs/components/Examples/mention/CustomComponentMentionEditor/CustomComponentMentionEditor.tsx
index e34358f92e..7fb694f4f6 100644
--- a/packages/docs/components/Examples/mention/CustomComponentMentionEditor/CustomComponentMentionEditor.tsx
+++ b/packages/docs/components/Examples/mention/CustomComponentMentionEditor/CustomComponentMentionEditor.tsx
@@ -6,7 +6,7 @@ import React, {
useState,
} from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createMentionPlugin, {
defaultSuggestionsFilter,
} from '@draft-js-plugins/mention';
diff --git a/packages/docs/components/Examples/mention/CustomMentionEditor/CustomMentionEditor.tsx b/packages/docs/components/Examples/mention/CustomMentionEditor/CustomMentionEditor.tsx
index 4dad2b8f45..861da06bab 100644
--- a/packages/docs/components/Examples/mention/CustomMentionEditor/CustomMentionEditor.tsx
+++ b/packages/docs/components/Examples/mention/CustomMentionEditor/CustomMentionEditor.tsx
@@ -7,7 +7,7 @@ import React, {
useState,
} from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createMentionPlugin, {
defaultSuggestionsFilter,
MentionData,
diff --git a/packages/docs/components/Examples/mention/MultiMentionTriggers/MultiMentionTriggers.tsx b/packages/docs/components/Examples/mention/MultiMentionTriggers/MultiMentionTriggers.tsx
index 8bec6320c0..f36f6662d5 100644
--- a/packages/docs/components/Examples/mention/MultiMentionTriggers/MultiMentionTriggers.tsx
+++ b/packages/docs/components/Examples/mention/MultiMentionTriggers/MultiMentionTriggers.tsx
@@ -1,6 +1,6 @@
import React, { ReactElement, useRef, useState, useCallback } from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createMentionPlugin, {
defaultSuggestionsFilter,
} from '@draft-js-plugins/mention';
diff --git a/packages/docs/components/Examples/mention/RemoteMentionEditor/RemoteMentionEditor.tsx b/packages/docs/components/Examples/mention/RemoteMentionEditor/RemoteMentionEditor.tsx
index ba67c85dd2..9953e28445 100644
--- a/packages/docs/components/Examples/mention/RemoteMentionEditor/RemoteMentionEditor.tsx
+++ b/packages/docs/components/Examples/mention/RemoteMentionEditor/RemoteMentionEditor.tsx
@@ -7,7 +7,7 @@ import React, {
} from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createMentionPlugin from '@draft-js-plugins/mention';
import editorStyles from './RemoteMentionEditor.module.css';
diff --git a/packages/docs/components/Examples/mention/SimpleMentionEditor/SimpleMentionEditor.tsx b/packages/docs/components/Examples/mention/SimpleMentionEditor/SimpleMentionEditor.tsx
index c16ab8d6d9..0ce942dc67 100644
--- a/packages/docs/components/Examples/mention/SimpleMentionEditor/SimpleMentionEditor.tsx
+++ b/packages/docs/components/Examples/mention/SimpleMentionEditor/SimpleMentionEditor.tsx
@@ -6,7 +6,7 @@ import React, {
useState,
} from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createMentionPlugin, {
defaultSuggestionsFilter,
} from '@draft-js-plugins/mention';
diff --git a/packages/docs/components/Examples/resizeable/SimpleResizeableEditor/index.js b/packages/docs/components/Examples/resizeable/SimpleResizeableEditor/index.js
index 7c479200cf..7812cc0a38 100644
--- a/packages/docs/components/Examples/resizeable/SimpleResizeableEditor/index.js
+++ b/packages/docs/components/Examples/resizeable/SimpleResizeableEditor/index.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { convertFromRaw, EditorState } from 'draft-js';
-import Editor, { composeDecorators } from '@draft-js-plugins/editor';
+import Editor, { composeDecorators } from '@vectorworks/draft-js-plugins';
import createResizeablePlugin from '@draft-js-plugins/resizeable';
diff --git a/packages/docs/components/Examples/side-toolbar/CustomSideToolbarEditor/index.js b/packages/docs/components/Examples/side-toolbar/CustomSideToolbarEditor/index.js
index e8d6e8c081..4754c00ea3 100644
--- a/packages/docs/components/Examples/side-toolbar/CustomSideToolbarEditor/index.js
+++ b/packages/docs/components/Examples/side-toolbar/CustomSideToolbarEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import {
HeadlineOneButton,
HeadlineTwoButton,
diff --git a/packages/docs/components/Examples/side-toolbar/SimpleSideToolbarEditor/index.js b/packages/docs/components/Examples/side-toolbar/SimpleSideToolbarEditor/index.js
index 5efadb66b5..e4595d80b3 100644
--- a/packages/docs/components/Examples/side-toolbar/SimpleSideToolbarEditor/index.js
+++ b/packages/docs/components/Examples/side-toolbar/SimpleSideToolbarEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createSideToolbarPlugin from '@draft-js-plugins/side-toolbar';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/side-toolbar/gettingStarted.js b/packages/docs/components/Examples/side-toolbar/gettingStarted.js
index 9e8305971d..09ca5f7c10 100644
--- a/packages/docs/components/Examples/side-toolbar/gettingStarted.js
+++ b/packages/docs/components/Examples/side-toolbar/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createSideToolbarPlugin from '@draft-js-plugins/side-toolbar';
import React from 'react';
diff --git a/packages/docs/components/Examples/static-toolbar/CustomToolbarEditor/index.js b/packages/docs/components/Examples/static-toolbar/CustomToolbarEditor/index.js
index 739f19b929..14639a2920 100644
--- a/packages/docs/components/Examples/static-toolbar/CustomToolbarEditor/index.js
+++ b/packages/docs/components/Examples/static-toolbar/CustomToolbarEditor/index.js
@@ -1,7 +1,7 @@
/* eslint-disable react/no-multi-comp */
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createToolbarPlugin, {
Separator,
diff --git a/packages/docs/components/Examples/static-toolbar/SimpleToolbarEditor/index.js b/packages/docs/components/Examples/static-toolbar/SimpleToolbarEditor/index.js
index 46e045026a..11113b1807 100644
--- a/packages/docs/components/Examples/static-toolbar/SimpleToolbarEditor/index.js
+++ b/packages/docs/components/Examples/static-toolbar/SimpleToolbarEditor/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createToolbarPlugin from '@draft-js-plugins/static-toolbar';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/static-toolbar/ThemedToolbarEditor/index.js b/packages/docs/components/Examples/static-toolbar/ThemedToolbarEditor/index.js
index 023a8e92ce..7aaed43f08 100644
--- a/packages/docs/components/Examples/static-toolbar/ThemedToolbarEditor/index.js
+++ b/packages/docs/components/Examples/static-toolbar/ThemedToolbarEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createToolbarPlugin from '@draft-js-plugins/static-toolbar';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/static-toolbar/gettingStarted.js b/packages/docs/components/Examples/static-toolbar/gettingStarted.js
index 07791774fe..9ef92154d5 100644
--- a/packages/docs/components/Examples/static-toolbar/gettingStarted.js
+++ b/packages/docs/components/Examples/static-toolbar/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createToolbarPlugin from '@draft-js-plugins/static-toolbar';
import React from 'react';
diff --git a/packages/docs/components/Examples/sticker/CustomStickerEditor/index.js b/packages/docs/components/Examples/sticker/CustomStickerEditor/index.js
index b3edeaf21e..1eb58f3fa4 100644
--- a/packages/docs/components/Examples/sticker/CustomStickerEditor/index.js
+++ b/packages/docs/components/Examples/sticker/CustomStickerEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createStickerPlugin from '@draft-js-plugins/sticker';
import editorStyles from './editorStyles.module.css';
import stickers from './stickers';
diff --git a/packages/docs/components/Examples/sticker/SimpleStickerEditor/index.js b/packages/docs/components/Examples/sticker/SimpleStickerEditor/index.js
index 1c87f9a276..19f76774a4 100644
--- a/packages/docs/components/Examples/sticker/SimpleStickerEditor/index.js
+++ b/packages/docs/components/Examples/sticker/SimpleStickerEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createStickerPlugin from '@draft-js-plugins/sticker';
import editorStyles from './editorStyles.module.css';
import stickers from './stickers';
diff --git a/packages/docs/components/Examples/sticker/gettingStarted.js b/packages/docs/components/Examples/sticker/gettingStarted.js
index cafcecc2ec..449fc5e9bc 100644
--- a/packages/docs/components/Examples/sticker/gettingStarted.js
+++ b/packages/docs/components/Examples/sticker/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createStickerPlugin from '@draft-js-plugins/sticker';
import React from 'react';
import { fromJS } from 'immutable';
diff --git a/packages/docs/components/Examples/text-alignment/CustomStaticToolbarPlugin/index.js b/packages/docs/components/Examples/text-alignment/CustomStaticToolbarPlugin/index.js
index 01b4e063ae..9807ba4f62 100644
--- a/packages/docs/components/Examples/text-alignment/CustomStaticToolbarPlugin/index.js
+++ b/packages/docs/components/Examples/text-alignment/CustomStaticToolbarPlugin/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createStaticToolbarPlugin from '@draft-js-plugins/static-toolbar';
import createTextAlignmentPlugin from '@draft-js-plugins/text-alignment';
import {
diff --git a/packages/docs/components/Examples/text-alignment/SimpleTextAlignmentPlugin/index.js b/packages/docs/components/Examples/text-alignment/SimpleTextAlignmentPlugin/index.js
index 174e155e5f..0d5ab96674 100644
--- a/packages/docs/components/Examples/text-alignment/SimpleTextAlignmentPlugin/index.js
+++ b/packages/docs/components/Examples/text-alignment/SimpleTextAlignmentPlugin/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import Editor, { createEditorStateWithText } from '@draft-js-plugins/editor';
+import Editor, { createEditorStateWithText } from '@vectorworks/draft-js-plugins';
import createStaticToolbarPlugin from '@draft-js-plugins/static-toolbar';
import createTextAlignmentPlugin from '@draft-js-plugins/text-alignment';
import {
diff --git a/packages/docs/components/Examples/text-alignment/gettingStarted.js b/packages/docs/components/Examples/text-alignment/gettingStarted.js
index e01a2c3dac..54a8e251be 100644
--- a/packages/docs/components/Examples/text-alignment/gettingStarted.js
+++ b/packages/docs/components/Examples/text-alignment/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createTextAlignmentPlugin from '@draft-js-plugins/text-alignment';
import createStaticToolbarPlugin from '@draft-js-plugins/static-toolbar';
import {
diff --git a/packages/docs/components/Examples/undo/CustomUndoEditor/index.js b/packages/docs/components/Examples/undo/CustomUndoEditor/index.js
index 4b41eafa39..a35b854375 100644
--- a/packages/docs/components/Examples/undo/CustomUndoEditor/index.js
+++ b/packages/docs/components/Examples/undo/CustomUndoEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createUndoPlugin from '@draft-js-plugins/undo';
import editorStyles from './editorStyles.module.css';
import buttonStyles from './buttonStyles.module.css';
diff --git a/packages/docs/components/Examples/undo/SimpleUndoEditor/index.js b/packages/docs/components/Examples/undo/SimpleUndoEditor/index.js
index df5633f8d9..094562e419 100644
--- a/packages/docs/components/Examples/undo/SimpleUndoEditor/index.js
+++ b/packages/docs/components/Examples/undo/SimpleUndoEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createUndoPlugin from '@draft-js-plugins/undo';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/undo/gettingStarted.js b/packages/docs/components/Examples/undo/gettingStarted.js
index 07be9a6c46..8321ddc317 100644
--- a/packages/docs/components/Examples/undo/gettingStarted.js
+++ b/packages/docs/components/Examples/undo/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createUndoPlugin from '@draft-js-plugins/undo';
import React from 'react';
diff --git a/packages/docs/components/Examples/video/CustomAddVideoVideoEditor/index.js b/packages/docs/components/Examples/video/CustomAddVideoVideoEditor/index.js
index 15f0f1aac4..82ba9391e4 100644
--- a/packages/docs/components/Examples/video/CustomAddVideoVideoEditor/index.js
+++ b/packages/docs/components/Examples/video/CustomAddVideoVideoEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createVideoPlugin from '@draft-js-plugins/video';
import VideoAdd from './VideoAdd';
import editorStyles from './editorStyles.module.css';
diff --git a/packages/docs/components/Examples/video/CustomVideoEditor/index.js b/packages/docs/components/Examples/video/CustomVideoEditor/index.js
index 5764a9de1e..983f3293f2 100644
--- a/packages/docs/components/Examples/video/CustomVideoEditor/index.js
+++ b/packages/docs/components/Examples/video/CustomVideoEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState, convertFromRaw } from 'draft-js';
-import Editor, { composeDecorators } from '@draft-js-plugins/editor';
+import Editor, { composeDecorators } from '@vectorworks/draft-js-plugins';
import createAlignmentPlugin from '@draft-js-plugins/alignment';
@@ -38,8 +38,7 @@ const initialState = {
blocks: [
{
key: '9gm3s',
- text:
- 'You can have video in your text field. This is a very rudimentary example, but you can enhance the video plugin with resizing, focus or alignment plugins.',
+ text: 'You can have video in your text field. This is a very rudimentary example, but you can enhance the video plugin with resizing, focus or alignment plugins.',
type: 'unstyled',
depth: 0,
inlineStyleRanges: [],
diff --git a/packages/docs/components/Examples/video/SimpleVideoEditor/index.js b/packages/docs/components/Examples/video/SimpleVideoEditor/index.js
index 5079f7e16a..664643c7a7 100644
--- a/packages/docs/components/Examples/video/SimpleVideoEditor/index.js
+++ b/packages/docs/components/Examples/video/SimpleVideoEditor/index.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { EditorState, convertFromRaw } from 'draft-js';
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createVideoPlugin from '@draft-js-plugins/video';
import editorStyles from './editorStyles.module.css';
@@ -21,8 +21,7 @@ const initialState = {
blocks: [
{
key: '9gm3s',
- text:
- 'You can have video in your text field. This is a very rudimentary example, but you can enhance the video plugin with resizing, focus or alignment plugins.',
+ text: 'You can have video in your text field. This is a very rudimentary example, but you can enhance the video plugin with resizing, focus or alignment plugins.',
type: 'unstyled',
depth: 0,
inlineStyleRanges: [],
diff --git a/packages/docs/components/Examples/video/gettingStarted.js b/packages/docs/components/Examples/video/gettingStarted.js
index ed330d274a..77db012148 100644
--- a/packages/docs/components/Examples/video/gettingStarted.js
+++ b/packages/docs/components/Examples/video/gettingStarted.js
@@ -1,5 +1,5 @@
// It is important to import the Editor which accepts plugins.
-import Editor from '@draft-js-plugins/editor';
+import Editor from '@vectorworks/draft-js-plugins';
import createVideoPlugin from '@draft-js-plugins/video';
import React from 'react';
diff --git a/packages/docs/components/UnicornEditor/UnicornEditor.tsx b/packages/docs/components/UnicornEditor/UnicornEditor.tsx
index 200d5899a2..68d5af0f58 100644
--- a/packages/docs/components/UnicornEditor/UnicornEditor.tsx
+++ b/packages/docs/components/UnicornEditor/UnicornEditor.tsx
@@ -1,6 +1,6 @@
import createAlignmentPlugin from '@draft-js-plugins/alignment';
import createBlockDndPlugin from '@draft-js-plugins/drag-n-drop';
-import Editor, { composeDecorators } from '@draft-js-plugins/editor';
+import Editor, { composeDecorators } from '@vectorworks/draft-js-plugins';
import createEmojiPlugin from '@draft-js-plugins/emoji';
import createFocusPlugin from '@draft-js-plugins/focus';
import createHashtagPlugin from '@draft-js-plugins/hashtag';
diff --git a/packages/docs/package.json b/packages/docs/package.json
index 0c8bb8e9f2..7ae9d4f036 100644
--- a/packages/docs/package.json
+++ b/packages/docs/package.json
@@ -12,7 +12,7 @@
"dependencies": {
"animateplus": "1.4.0",
"clsx": "^2.1.1",
- "immutable": "^4.0.0-rc.12",
+ "immutable": "^5.1.5",
"next": "12.3.1",
"prismjs": "^1.30.0",
"react-share": "^4.4.1",
diff --git a/packages/docs/pages/plugin/alignment/index.js b/packages/docs/pages/plugin/alignment/index.js
index 2ed436cb81..b6a780e83c 100644
--- a/packages/docs/pages/plugin/alignment/index.js
+++ b/packages/docs/pages/plugin/alignment/index.js
@@ -61,7 +61,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/anchor/index.js b/packages/docs/pages/plugin/anchor/index.js
index f424b4f771..89320ea406 100644
--- a/packages/docs/pages/plugin/anchor/index.js
+++ b/packages/docs/pages/plugin/anchor/index.js
@@ -43,7 +43,7 @@ export default class App extends Component {
inline toolbar. It also
provides a decorator that formats the created entities.
-
+
diff --git a/packages/docs/pages/plugin/counter/index.js b/packages/docs/pages/plugin/counter/index.js
index 205b082b63..437d888a34 100644
--- a/packages/docs/pages/plugin/counter/index.js
+++ b/packages/docs/pages/plugin/counter/index.js
@@ -63,7 +63,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/divider/index.js b/packages/docs/pages/plugin/divider/index.js
index b070149a19..d48ed31dee 100644
--- a/packages/docs/pages/plugin/divider/index.js
+++ b/packages/docs/pages/plugin/divider/index.js
@@ -33,7 +33,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/drag-n-drop/index.js b/packages/docs/pages/plugin/drag-n-drop/index.js
index 3ee1d9dfcd..7054c7990d 100644
--- a/packages/docs/pages/plugin/drag-n-drop/index.js
+++ b/packages/docs/pages/plugin/drag-n-drop/index.js
@@ -35,7 +35,7 @@ export default class App extends Component {
Getting Started
-
+
diff --git a/packages/docs/pages/plugin/emoji/index.js b/packages/docs/pages/plugin/emoji/index.js
index aca6108df2..e54dcbdaf4 100644
--- a/packages/docs/pages/plugin/emoji/index.js
+++ b/packages/docs/pages/plugin/emoji/index.js
@@ -98,7 +98,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/focus/index.js b/packages/docs/pages/plugin/focus/index.js
index e0466a0de3..6256e47bc5 100644
--- a/packages/docs/pages/plugin/focus/index.js
+++ b/packages/docs/pages/plugin/focus/index.js
@@ -43,7 +43,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/hashtag/index.js b/packages/docs/pages/plugin/hashtag/index.js
index ac44a2e2c5..222c4cc225 100644
--- a/packages/docs/pages/plugin/hashtag/index.js
+++ b/packages/docs/pages/plugin/hashtag/index.js
@@ -51,7 +51,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/image/index.js b/packages/docs/pages/plugin/image/index.js
index eca07cf3d2..c073922cd3 100644
--- a/packages/docs/pages/plugin/image/index.js
+++ b/packages/docs/pages/plugin/image/index.js
@@ -49,7 +49,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/inline-toolbar/index.js b/packages/docs/pages/plugin/inline-toolbar/index.js
index 025f048b09..428889f017 100644
--- a/packages/docs/pages/plugin/inline-toolbar/index.js
+++ b/packages/docs/pages/plugin/inline-toolbar/index.js
@@ -49,7 +49,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/linkify/index.js b/packages/docs/pages/plugin/linkify/index.js
index 455560bab3..7c57676c31 100644
--- a/packages/docs/pages/plugin/linkify/index.js
+++ b/packages/docs/pages/plugin/linkify/index.js
@@ -47,7 +47,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/mention/index.tsx b/packages/docs/pages/plugin/mention/index.tsx
index f76a70b3ac..1cb7e6b50e 100644
--- a/packages/docs/pages/plugin/mention/index.tsx
+++ b/packages/docs/pages/plugin/mention/index.tsx
@@ -81,7 +81,7 @@ export default function Mention(): ReactElement {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/resizeable/index.js b/packages/docs/pages/plugin/resizeable/index.js
index 5fc8165adf..9a8c055dd5 100644
--- a/packages/docs/pages/plugin/resizeable/index.js
+++ b/packages/docs/pages/plugin/resizeable/index.js
@@ -47,7 +47,7 @@ export default class App extends Component {
Getting Started
-
+
Notes
diff --git a/packages/docs/pages/plugin/side-toolbar/index.js b/packages/docs/pages/plugin/side-toolbar/index.js
index 780a20391a..38fa54ef4b 100644
--- a/packages/docs/pages/plugin/side-toolbar/index.js
+++ b/packages/docs/pages/plugin/side-toolbar/index.js
@@ -49,7 +49,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/static-toolbar/index.js b/packages/docs/pages/plugin/static-toolbar/index.js
index c63f97b031..af9317bd35 100644
--- a/packages/docs/pages/plugin/static-toolbar/index.js
+++ b/packages/docs/pages/plugin/static-toolbar/index.js
@@ -53,7 +53,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/sticker/index.js b/packages/docs/pages/plugin/sticker/index.js
index f34184b404..99816827f7 100644
--- a/packages/docs/pages/plugin/sticker/index.js
+++ b/packages/docs/pages/plugin/sticker/index.js
@@ -44,7 +44,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/text-alignment/index.js b/packages/docs/pages/plugin/text-alignment/index.js
index 2adfcd8cb2..62ad726359 100644
--- a/packages/docs/pages/plugin/text-alignment/index.js
+++ b/packages/docs/pages/plugin/text-alignment/index.js
@@ -47,7 +47,7 @@ export default class App extends Component {
static toolbar, you can
alos use it with other toolbars.
-
+
diff --git a/packages/docs/pages/plugin/undo/index.js b/packages/docs/pages/plugin/undo/index.js
index 6508fe7121..6d7583a66e 100644
--- a/packages/docs/pages/plugin/undo/index.js
+++ b/packages/docs/pages/plugin/undo/index.js
@@ -43,7 +43,7 @@ export default class App extends Component {
Getting Started
-
+
Importing the default styles
diff --git a/packages/docs/pages/plugin/video/index.js b/packages/docs/pages/plugin/video/index.js
index ab83322774..a210919361 100644
--- a/packages/docs/pages/plugin/video/index.js
+++ b/packages/docs/pages/plugin/video/index.js
@@ -38,7 +38,7 @@ export default class App extends Component {
Getting Started
-
+
diff --git a/packages/drag-n-drop-upload/README.md b/packages/drag-n-drop-upload/README.md
index c5a5a9cf52..e6517854b0 100644
--- a/packages/drag-n-drop-upload/README.md
+++ b/packages/drag-n-drop-upload/README.md
@@ -1,6 +1,6 @@
# DraftJS Drag & Drop File Upload Plugin
-_This is a plugin for the `@draft-js-plugins/editor`._
+_This is a plugin for the `@vectorworks/draft-js-plugins`._
This plugin adds dropping & uploading files functionality to your editor!
diff --git a/packages/drag-n-drop-upload/jest.config.js b/packages/drag-n-drop-upload/jest.config.js
index f053e09bd2..917137a21f 100644
--- a/packages/drag-n-drop-upload/jest.config.js
+++ b/packages/drag-n-drop-upload/jest.config.js
@@ -4,5 +4,4 @@ const packageName = require('./package').name;
module.exports = {
...base,
displayName: packageName,
- name: packageName,
};
diff --git a/packages/drag-n-drop-upload/package.json b/packages/drag-n-drop-upload/package.json
index 5c4c0bdbf1..5af1b6d0d1 100644
--- a/packages/drag-n-drop-upload/package.json
+++ b/packages/drag-n-drop-upload/package.json
@@ -34,6 +34,7 @@
},
"license": "MIT",
"peerDependencies": {
+ "@vectorworks/draft-js-plugins": "^4.1.4",
"draft-js": "^0.10.1 || ^0.11.0",
"react": "^16.8.0 || ^17.0.0 || >=18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || >=18.0.0"
diff --git a/packages/drag-n-drop-upload/src/components/UploadPlaceholder.tsx b/packages/drag-n-drop-upload/src/components/UploadPlaceholder.tsx
index 1c12495a61..4ce05b4d2c 100644
--- a/packages/drag-n-drop-upload/src/components/UploadPlaceholder.tsx
+++ b/packages/drag-n-drop-upload/src/components/UploadPlaceholder.tsx
@@ -5,20 +5,20 @@ interface UploadPlaceholderParams {
block: ContentBlock;
blockProps: {
resizeData: {
- name: string,
- progress: string
- }
+ name: string;
+ progress: string;
+ };
};
}
-export default function UploadPlaceholder(props: UploadPlaceholderParams): ReactElement {
- const {
- blockProps,
- block,
- } = props;
+export default function UploadPlaceholder(
+ props: UploadPlaceholderParams
+): ReactElement {
+ const { blockProps, block } = props;
return (
-
- {' '}
+
+ {' '}
);
}
diff --git a/packages/drag-n-drop-upload/src/handleDroppedFiles.ts b/packages/drag-n-drop-upload/src/handleDroppedFiles.ts
index 699e573fe6..fe48862aaa 100644
--- a/packages/drag-n-drop-upload/src/handleDroppedFiles.ts
+++ b/packages/drag-n-drop-upload/src/handleDroppedFiles.ts
@@ -1,4 +1,4 @@
-import { PluginFunctions } from '@draft-js-plugins/editor';
+import { PluginFunctions } from '@vectorworks/draft-js-plugins';
import { DraftHandleValue, EditorState, SelectionState } from 'draft-js';
import { DndUploadPluginConfig, FileToUpload, PlaceholderBlockType } from '.';
import { insertPlaceholder } from './components/insertPlaceholder';
diff --git a/packages/drag-n-drop-upload/src/index.ts b/packages/drag-n-drop-upload/src/index.ts
index 7306aec2ab..d595a7cb69 100644
--- a/packages/drag-n-drop-upload/src/index.ts
+++ b/packages/drag-n-drop-upload/src/index.ts
@@ -1,4 +1,4 @@
-import { EditorPlugin } from '@draft-js-plugins/editor';
+import { EditorPlugin } from '@vectorworks/draft-js-plugins';
import { EditorState } from 'draft-js';
import UploadPlaceholder from './components/UploadPlaceholder';
import handleDroppedFiles, { FileData } from './handleDroppedFiles';
diff --git a/packages/drag-n-drop-upload/src/modifiers/removeBlock.ts b/packages/drag-n-drop-upload/src/modifiers/removeBlock.ts
index 85b848dfa2..827bb94e6c 100644
--- a/packages/drag-n-drop-upload/src/modifiers/removeBlock.ts
+++ b/packages/drag-n-drop-upload/src/modifiers/removeBlock.ts
@@ -2,27 +2,26 @@ import { Modifier, EditorState, SelectionState } from 'draft-js';
export default function removeBlock(
editorState: EditorState,
- blockKey: string,
+ blockKey: string
): EditorState {
-
const content = editorState.getCurrentContent();
const block = content.getBlockForKey(blockKey);
- const targetRange = new SelectionState({
+ const targetRange = new SelectionState().merge({
anchorKey: blockKey,
anchorOffset: 0,
focusKey: blockKey,
focusOffset: block.getLength(),
});
- const withoutBlock = Modifier.removeRange(content, targetRange, "backward");
+ const withoutBlock = Modifier.removeRange(content, targetRange, 'backward');
const resetBlock = Modifier.setBlockType(
withoutBlock,
withoutBlock.getSelectionAfter(),
- "unstyled"
+ 'unstyled'
);
- const newState = EditorState.push(editorState, resetBlock, "remove-range");
+ const newState = EditorState.push(editorState, resetBlock, 'remove-range');
const newStateWithoutBlock = EditorState.forceSelection(
newState,
resetBlock.getSelectionAfter()
diff --git a/packages/drag-n-drop-upload/src/modifiers/replaceBlock.ts b/packages/drag-n-drop-upload/src/modifiers/replaceBlock.ts
index 44a7e6f016..65d63e0a1a 100644
--- a/packages/drag-n-drop-upload/src/modifiers/replaceBlock.ts
+++ b/packages/drag-n-drop-upload/src/modifiers/replaceBlock.ts
@@ -12,7 +12,7 @@ export default function replaceBlock(
): EditorState {
let content = editorState.getCurrentContent();
- const targetRange = new SelectionState({
+ const targetRange = new SelectionState().merge({
anchorKey: blockKey,
anchorOffset: 0,
focusKey: blockKey,
diff --git a/packages/drag-n-drop-upload/src/utils/block.ts b/packages/drag-n-drop-upload/src/utils/block.ts
index f5d286dbf4..71ccd0136e 100644
--- a/packages/drag-n-drop-upload/src/utils/block.ts
+++ b/packages/drag-n-drop-upload/src/utils/block.ts
@@ -1,13 +1,13 @@
-import { ContentBlock, EditorState } from 'draft-js';
+import { BlockMap, ContentBlock, EditorState } from 'draft-js';
import { FileResult } from './file';
// Filter editorState's blockMap
export function getBlocksWhereEntityData(
editorState: EditorState,
filter: (block: FileResult | null) => boolean
-): boolean {
+): BlockMap {
const contentState = editorState.getCurrentContent();
- return contentState.get('blockMap').filter((block: ContentBlock) => {
+ return contentState.getBlockMap().filter((block: ContentBlock) => {
const entityData = block.getEntityAt(0)
? contentState.getEntity(block.getEntityAt(0)).getData()
: null;
diff --git a/packages/drag-n-drop/README.md b/packages/drag-n-drop/README.md
index b487c88674..952de4e1b2 100644
--- a/packages/drag-n-drop/README.md
+++ b/packages/drag-n-drop/README.md
@@ -1,6 +1,6 @@
# DraftJS Block Drag & Drop Plugin
-_This is a plugin for the `@draft-js-plugins/editor`._
+_This is a plugin for the `@vectorworks/draft-js-plugins`._
This plugin adds drag and drop functionality to your editor!
diff --git a/packages/drag-n-drop/jest.config.js b/packages/drag-n-drop/jest.config.js
index f053e09bd2..917137a21f 100644
--- a/packages/drag-n-drop/jest.config.js
+++ b/packages/drag-n-drop/jest.config.js
@@ -4,5 +4,4 @@ const packageName = require('./package').name;
module.exports = {
...base,
displayName: packageName,
- name: packageName,
};
diff --git a/packages/drag-n-drop/package.json b/packages/drag-n-drop/package.json
index 1dcd3ab8a1..fcee3482e7 100644
--- a/packages/drag-n-drop/package.json
+++ b/packages/drag-n-drop/package.json
@@ -34,9 +34,10 @@
},
"license": "MIT",
"dependencies": {
- "immutable": "~3.7.4"
+ "immutable": "^5.1.5"
},
"peerDependencies": {
+ "@vectorworks/draft-js-plugins": "^4.1.4",
"draft-js": "^0.10.1 || ^0.11.0",
"react": "^16.8.0 || ^17.0.0 || >=18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || >=18.0.0"
diff --git a/packages/drag-n-drop/src/createDecorator.tsx b/packages/drag-n-drop/src/createDecorator.tsx
index d7f88346b3..f30a42d66a 100644
--- a/packages/drag-n-drop/src/createDecorator.tsx
+++ b/packages/drag-n-drop/src/createDecorator.tsx
@@ -20,38 +20,41 @@ const getDisplayName = (WrappedComponent: WrappedComponentType): string => {
export default ({ store }: { store: DndPluginStore }) =>
(WrappedComponent: WrappedComponentType): WrappedComponentType => {
- const BlockDraggableDecorator: WrappedComponentType = React.forwardRef(
- (props: Omit, ref): ReactElement => {
- // Handle start-drag and set dataTransfer data with blockKey
- const startDrag = (event: DragEvent): void => {
- event.dataTransfer.dropEffect = 'move'; // eslint-disable-line no-param-reassign
- // declare data and give info that its an existing key and a block needs to be moved
- event.dataTransfer.setData(
- 'text',
- `${DRAFTJS_BLOCK_KEY}:${props.block.getKey()}`
- );
- };
-
- // If this is rendered before the store is initialized default to read only
- // NOTE(@mxstbr): Reference issue: draft-js-plugins/draft-js-plugins#926
- const readOnly = store.getReadOnly ? store.getReadOnly() : true;
-
- return (
-
+ const BlockDraggableDecorator = React.forwardRef<
+ unknown,
+ Omit
+ >((props, ref): ReactElement => {
+ // Handle start-drag and set dataTransfer data with blockKey
+ const startDrag = (event: DragEvent): void => {
+ event.dataTransfer.dropEffect = 'move'; // eslint-disable-line no-param-reassign
+ // declare data and give info that its an existing key and a block needs to be moved
+ event.dataTransfer.setData(
+ 'text',
+ `${DRAFTJS_BLOCK_KEY}:${props.block.getKey()}`
);
- }
- );
+ };
+
+ // If this is rendered before the store is initialized default to read only
+ // NOTE(@mxstbr): Reference issue: draft-js-plugins/draft-js-plugins#926
+ const readOnly = store.getReadOnly ? store.getReadOnly() : true;
+
+ return (
+
+ );
+ });
BlockDraggableDecorator.displayName = `BlockDraggable(${getDisplayName(
WrappedComponent
)})`;
// eslint-disable-next-line no-redeclare
- BlockDraggableDecorator.WrappedComponent =
+ const decoratedComponent =
+ BlockDraggableDecorator as unknown as WrappedComponentType;
+ decoratedComponent.WrappedComponent =
WrappedComponent.WrappedComponent || WrappedComponent;
- return BlockDraggableDecorator;
+ return decoratedComponent;
};
diff --git a/packages/drag-n-drop/src/handleDrop.ts b/packages/drag-n-drop/src/handleDrop.ts
index e0ad9f60d0..17227430ac 100644
--- a/packages/drag-n-drop/src/handleDrop.ts
+++ b/packages/drag-n-drop/src/handleDrop.ts
@@ -47,7 +47,7 @@ export default (
);
// force to new selection
- const newSelection = new SelectionState({
+ const newSelection = new SelectionState().merge({
anchorKey: blockKey,
anchorOffset: 0,
focusKey: blockKey,
diff --git a/packages/drag-n-drop/src/index.tsx b/packages/drag-n-drop/src/index.tsx
index d18f4cb3d7..91f39380e3 100644
--- a/packages/drag-n-drop/src/index.tsx
+++ b/packages/drag-n-drop/src/index.tsx
@@ -1,4 +1,4 @@
-import { EditorPlugin } from '@draft-js-plugins/editor';
+import { EditorPlugin } from '@vectorworks/draft-js-plugins';
import handleDrop from './handleDrop';
import createDecorator from './createDecorator';
diff --git a/packages/drag-n-drop/src/modifiers/addBlock.ts b/packages/drag-n-drop/src/modifiers/addBlock.ts
index 97687fdcba..773c43d12a 100644
--- a/packages/drag-n-drop/src/modifiers/addBlock.ts
+++ b/packages/drag-n-drop/src/modifiers/addBlock.ts
@@ -30,7 +30,7 @@ export default function addBlock(
// deciding on the postion to split the text
const targetSelection = afterRemovalContentState.getSelectionAfter();
- const blockKeyForTarget = targetSelection.get('focusKey');
+ const blockKeyForTarget = targetSelection.getFocusKey();
const block = currentContentState.getBlockForKey(blockKeyForTarget);
let insertionTargetSelection;
let insertionTargetBlock;
@@ -72,6 +72,7 @@ export default function addBlock(
const charData = CharacterMetadata.create({ entity: entityKey });
const fragmentArray = [
+ // @ts-expect-error @types/draft-js does not model ContentBlock's Record initializer with Immutable v5.
new ContentBlock({
key: genKey(),
type,
@@ -80,6 +81,7 @@ export default function addBlock(
}),
// new contentblock so we can continue wrting right away after inserting the block
+ // @ts-expect-error @types/draft-js does not model ContentBlock's Record initializer with Immutable v5.
new ContentBlock({
key: genKey(),
type: 'unstyled',
diff --git a/packages/drag-n-drop/src/modifiers/removeBlock.ts b/packages/drag-n-drop/src/modifiers/removeBlock.ts
index 0ae8b8ea88..d97348b630 100644
--- a/packages/drag-n-drop/src/modifiers/removeBlock.ts
+++ b/packages/drag-n-drop/src/modifiers/removeBlock.ts
@@ -17,14 +17,14 @@ export default function removeBlock(
afterBlock.getLength() === 0 &&
afterBlock === contentState.getBlockMap().last()
) {
- targetRange = new SelectionState({
+ targetRange = new SelectionState().merge({
anchorKey: blockKey,
anchorOffset: 0,
focusKey: afterKey,
focusOffset: 0,
});
} else {
- targetRange = new SelectionState({
+ targetRange = new SelectionState().merge({
anchorKey: blockKey,
anchorOffset: 0,
focusKey: blockKey,
diff --git a/packages/editor/README.md b/packages/editor/README.md
index 669975e055..8adca87045 100644
--- a/packages/editor/README.md
+++ b/packages/editor/README.md
@@ -1,3 +1,26 @@
-# @draft-js-plugins/editor
+# @vectorworks/draft-js-plugins
+
+## Installation
+
+Configure npm to resolve the `@vectorworks` scope from GitHub Packages:
+
+```ini
+@vectorworks:registry=https://npm.pkg.github.com/Vectorworks
+```
+
+For a private package, authenticate with a personal access token that has the
+`read:packages` scope:
+
+```sh
+npm login --scope=@vectorworks --auth-type=legacy --registry=https://npm.pkg.github.com
+```
+
+Enter the token as the password when prompted.
+
+Then install the editor:
+
+```sh
+npm install @vectorworks/draft-js-plugins
+```
Checkout www.draft-js-plugins.com
diff --git a/packages/editor/jest.config.js b/packages/editor/jest.config.js
index f053e09bd2..917137a21f 100644
--- a/packages/editor/jest.config.js
+++ b/packages/editor/jest.config.js
@@ -4,5 +4,4 @@ const packageName = require('./package').name;
module.exports = {
...base,
displayName: packageName,
- name: packageName,
};
diff --git a/packages/editor/package.json b/packages/editor/package.json
index 901ad16222..9c3a621351 100644
--- a/packages/editor/package.json
+++ b/packages/editor/package.json
@@ -1,6 +1,9 @@
{
- "name": "@draft-js-plugins/editor",
+ "name": "@vectorworks/draft-js-plugins",
"version": "4.1.4",
+ "engines": {
+ "node": ">=24"
+ },
"sideEffects": false,
"description": "Editor for DraftJS Plugins",
"author": {
@@ -10,7 +13,7 @@
},
"repository": {
"type": "git",
- "url": "https://github.com/draft-js-plugins/draft-js-plugins.git"
+ "url": "git+https://github.com/Vectorworks/draft-js-plugins.git"
},
"main": "lib/index.cjs.js",
"module": "lib/index.esm.js",
@@ -35,7 +38,7 @@
},
"license": "MIT",
"dependencies": {
- "immutable": "~3.7.4",
+ "immutable": "^5.1.5",
"prop-types": "^15.8.1"
},
"peerDependencies": {
@@ -47,6 +50,6 @@
"@types/draft-js": "^0.11.10"
},
"publishConfig": {
- "access": "public"
+ "registry": "https://npm.pkg.github.com/Vectorworks"
}
}
diff --git a/packages/editor/src/Editor/MultiDecorator.ts b/packages/editor/src/Editor/MultiDecorator.ts
index 22f592a255..3d87661121 100644
--- a/packages/editor/src/Editor/MultiDecorator.ts
+++ b/packages/editor/src/Editor/MultiDecorator.ts
@@ -1,15 +1,15 @@
import { CompositeDecorator, ContentBlock, ContentState } from 'draft-js';
-import Immutable from 'immutable';
+import { List } from 'immutable';
const KEY_SEPARATOR = '-';
export default class MultiDecorator {
- decorators: Immutable.List;
+ decorators: List;
constructor(
- decorators: Immutable.List | CompositeDecorator[]
+ decorators: List | CompositeDecorator[]
) {
- this.decorators = Immutable.List(decorators);
+ this.decorators = List(decorators);
}
/**
@@ -18,7 +18,7 @@ export default class MultiDecorator {
getDecorations(
block: ContentBlock,
contentState: ContentState
- ): Immutable.List {
+ ): List {
const decorations: string[] = new Array(block.getText().length).fill(null);
this.decorators.forEach((decorator, i) => {
@@ -33,7 +33,7 @@ export default class MultiDecorator {
});
});
- return Immutable.List(decorations);
+ return List(decorations);
}
/**
@@ -61,7 +61,7 @@ export default class MultiDecorator {
const parts = key.split(KEY_SEPARATOR);
const index = Number(parts[0]);
- return this.decorators.get(index);
+ return this.decorators.get(index)!;
}
/**
diff --git a/packages/editor/src/Editor/__test__/MultiDecorator.test.ts b/packages/editor/src/Editor/__test__/MultiDecorator.test.ts
index 830908332f..260abbbb4d 100644
--- a/packages/editor/src/Editor/__test__/MultiDecorator.test.ts
+++ b/packages/editor/src/Editor/__test__/MultiDecorator.test.ts
@@ -2,9 +2,9 @@ import Draft from 'draft-js';
import MultiDecorator from '../MultiDecorator';
describe('MultiDecorator', () => {
- const contentBlock = new Draft.ContentBlock({
- text: 'AAA BBB CCC ABC',
- });
+ const contentBlock = Draft.ContentState.createFromText(
+ 'AAA BBB CCC ABC'
+ ).getFirstBlock();
const firstDecorator = new Draft.CompositeDecorator([
{
diff --git a/packages/editor/src/Editor/createCompositeDecorator.tsx b/packages/editor/src/Editor/createCompositeDecorator.tsx
index 3ac6c5054e..0b77ac63ac 100644
--- a/packages/editor/src/Editor/createCompositeDecorator.tsx
+++ b/packages/editor/src/Editor/createCompositeDecorator.tsx
@@ -7,13 +7,16 @@ import { List } from 'immutable';
import React, { ReactElement } from 'react';
export default function createCompositeDecorator(
- decorators: Immutable.List,
+ decorators: List,
getEditorState: () => EditorState,
setEditorState: (state: EditorState) => void
): CompositeDecorator {
- const convertedDecorators = List(decorators)
- .map((decorator) => {
- const Component = decorator!.component;
+ const convertedDecorators: DraftDecorator[] = decorators
+ .toArray()
+ .map((decorator): DraftDecorator => {
+ const Component = decorator.component as React.ComponentType<
+ Record
+ >;
const DecoratedComponent = (
props: Record
): ReactElement => (
@@ -24,11 +27,11 @@ export default function createCompositeDecorator(
/>
);
return {
- ...decorator,
+ strategy: decorator.strategy,
component: DecoratedComponent,
+ props: decorator.props,
};
- })
- .toJS();
+ });
return new CompositeDecorator(convertedDecorators);
}
diff --git a/packages/editor/src/Editor/index.tsx b/packages/editor/src/Editor/index.tsx
index f09925713e..033281647c 100644
--- a/packages/editor/src/Editor/index.tsx
+++ b/packages/editor/src/Editor/index.tsx
@@ -10,7 +10,7 @@ import {
EditorProps,
EditorState,
} from 'draft-js';
-import { Map } from 'immutable';
+import { List } from 'immutable';
import PropTypes from 'prop-types';
import React, { Component, KeyboardEvent, ReactElement } from 'react';
import { AriaProps, EditorPlugin, EditorRef, PluginFunctions } from '..';
@@ -33,7 +33,7 @@ export interface PluginEditorProps extends Omit {
// should be DraftDecoratorType but it is not accessible and does not habe decorators or _decorators
interface DecoratorType {
- decorators?: Immutable.List;
+ decorators?: List;
_decorators?: string[];
}
@@ -228,10 +228,10 @@ class PluginEditor extends Component {
resolveblockRenderMap = (): DraftBlockRenderMap => {
let blockRenderMap = this.props
.plugins!.filter((plug) => plug.blockRenderMap !== undefined)
- .reduce(
+ .reduce(
(maps, plug) => maps.merge(plug.blockRenderMap!),
- Map({})
- ) as DraftBlockRenderMap;
+ DefaultDraftBlockRenderMap.clear()
+ );
if (this.props.defaultBlockRenderMap) {
blockRenderMap = DefaultDraftBlockRenderMap.merge(blockRenderMap);
}
diff --git a/packages/editor/src/Editor/resolveDecorators.ts b/packages/editor/src/Editor/resolveDecorators.ts
index 7bc805845e..67e85e86b1 100644
--- a/packages/editor/src/Editor/resolveDecorators.ts
+++ b/packages/editor/src/Editor/resolveDecorators.ts
@@ -18,7 +18,7 @@ const getDecoratorsFromProps = ({
}: PluginEditorProps): List =>
List([{ decorators }, ...plugins])
.filter((plugin) => plugin?.decorators !== undefined)
- .flatMap((plugin) => plugin?.decorators) as List<
+ .flatMap((plugin) => plugin!.decorators || []) as List<
CompositeDecorator | DraftDecorator
>;
@@ -29,14 +29,14 @@ export default function resolveDecorators(
): MultiDecorator {
const decorators = getDecoratorsFromProps(props);
const compositeDecorator = createCompositeDecorator(
- decorators.filter((decorator) => !decoratorIsCustom(decorator!)) as List<
- DraftDecorator
- >,
+ decorators.filter(
+ (decorator) => !decoratorIsCustom(decorator!)
+ ) as List,
getEditorState,
onChange
);
const customDecorators = decorators.filter((decorator) =>
decoratorIsCustom(decorator)
- ) as List;
+ ) as unknown as List;
return new MultiDecorator(customDecorators.push(compositeDecorator));
}
diff --git a/packages/emoji/README.md b/packages/emoji/README.md
index c67cc3bdad..8669350cbb 100644
--- a/packages/emoji/README.md
+++ b/packages/emoji/README.md
@@ -1,6 +1,6 @@
# DraftJS Emoji Plugin
-_This is a plugin for the `@draft-js-plugins/editor`._
+_This is a plugin for the `@vectorworks/draft-js-plugins`._
This plugin provides consistent Emoji display across all platforms, independent of the host system.
diff --git a/packages/emoji/jest.config.js b/packages/emoji/jest.config.js
index f053e09bd2..917137a21f 100644
--- a/packages/emoji/jest.config.js
+++ b/packages/emoji/jest.config.js
@@ -4,5 +4,4 @@ const packageName = require('./package').name;
module.exports = {
...base,
displayName: packageName,
- name: packageName,
};
diff --git a/packages/emoji/package.json b/packages/emoji/package.json
index 44c6a1ab23..30e929d04f 100644
--- a/packages/emoji/package.json
+++ b/packages/emoji/package.json
@@ -33,7 +33,7 @@
"build": "yarn build:js && yarn build:dts && yarn build:css",
"build:js": "yarn rollup --config ../../rollup.config.js",
"build:dts": "tsc -d --emitDeclarationOnly --declarationDir lib",
- "build:css": "node ../../scripts/build-css.js $(pwd)",
+ "build:css": "node ../../scripts/build-css.js",
"test": "jest"
},
"license": "MIT",
@@ -46,7 +46,7 @@
"emoji-toolkit": "^7.0",
"emojibase": "^6.1.0",
"emojibase-data": "^7.0.1",
- "immutable": "~3.7.4",
+ "immutable": "^5.1.5",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"prop-types": "^15.8.1",
@@ -56,13 +56,11 @@
"to-style": "^1.3.3"
},
"peerDependencies": {
+ "@vectorworks/draft-js-plugins": "^4.1.4",
"draft-js": "^0.10.1 || ^0.11.0",
"react": "^16.8.0 || ^17.0.0 || >=18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || >=18.0.0"
},
- "devDependencies": {
- "@types/react-icons": "3.0.0"
- },
"publishConfig": {
"access": "public"
}
diff --git a/packages/emoji/src/__test__/EmojiSelect.test.tsx b/packages/emoji/src/__test__/EmojiSelect.test.tsx
index e7b95800ac..79f330f28d 100644
--- a/packages/emoji/src/__test__/EmojiSelect.test.tsx
+++ b/packages/emoji/src/__test__/EmojiSelect.test.tsx
@@ -1,5 +1,6 @@
import { EditorState } from 'draft-js';
import React from 'react';
+import '@testing-library/jest-dom';
import { fireEvent, render, RenderResult } from '@testing-library/react';
import { EmojiPluginStore } from '../index';
import EmojiSelect from '../components/EmojiSelect/index';
diff --git a/packages/emoji/src/components/EmojiSuggestions/index.tsx b/packages/emoji/src/components/EmojiSuggestions/index.tsx
index 15a33fd8c7..1bbbf4ad2a 100644
--- a/packages/emoji/src/components/EmojiSuggestions/index.tsx
+++ b/packages/emoji/src/components/EmojiSuggestions/index.tsx
@@ -12,8 +12,8 @@ import {
SelectionState,
} from 'draft-js';
import utils from '@draft-js-plugins/utils';
-import { AriaProps } from '@draft-js-plugins/editor';
-import { List } from 'immutable';
+import { AriaProps } from '@vectorworks/draft-js-plugins';
+import { is, List, Map } from 'immutable';
import Entry from './Entry';
import {
EmojiImageProps,
@@ -31,6 +31,20 @@ import { EmojiShape } from '../../constants/type';
import Popover from './Popover';
import { warning } from '../../utils/warning';
+interface Leaf {
+ start: number;
+ end: number;
+}
+
+const isLeaf = (value: unknown): value is Leaf => {
+ if (typeof value !== 'object' || value === null) {
+ return false;
+ }
+
+ const { start, end } = value as Record;
+ return typeof start === 'number' && typeof end === 'number';
+};
+
export interface EmojiSuggestionsPubParams {
isActive?: boolean;
focusedOptionIndex?: number;
@@ -60,7 +74,7 @@ export default class EmojiSuggestions extends Component
key!: string;
filteredEmojis?: List;
activeOffsetKey?: string;
- lastSelectionIsInsideWord?: Immutable.Iterable;
+ lastSelectionIsInsideWord?: Map;
lastSearchValue?: string;
UNSAFE_componentWillMount(): void {
@@ -143,16 +157,22 @@ export default class EmojiSuggestions extends Component
);
// a leave can be empty when it is removed due e.g. using backspace
- const leaves = offsetDetails
- .filter((offsetDetail) => offsetDetail!.blockKey === anchorKey)
- .map((offsetDetail) =>
- editorState
+ const leaves = offsetDetails.reduce