diff --git a/.changeset/README.md b/.changeset/README.md deleted file mode 100644 index 4f3b76b096..0000000000 --- a/.changeset/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Changesets - -Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works -with multi-package repos, or single-package repos to help you version and publish your code. You can -find the full documentation for it [in our repository](https://github.com/changesets/changesets) - -We have a quick list of common questions to get you started engaging with this project in -[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json deleted file mode 100644 index 8c0407bbc4..0000000000 --- a/.changeset/config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://unpkg.com/@changesets/config@1.4.0/schema.json", - "changelog": "@changesets/cli/changelog", - "commit": false, - "linked": [], - "access": "restricted", - "baseBranch": "master", - "updateInternalDependencies": "patch", - "ignore": [] -} diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 5ed5ba34b0..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,21 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] - -# Change these settings to your own preference -indent_style = space -indent_size = 2 - -# We recommend you to keep these unchanged -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false \ No newline at end of file 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 deleted file mode 100644 index 8d826b745d..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: '🐛 Report a bug' -about: 'Report a reproducible bug or reproducible regression.' -labels: 'bug' ---- - -## Environment - - - - - -- @draft-js-plugins/editor version: -- plugin name and version: - -## Description - - - -## Reproducible Demo - - diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 049f37127c..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: 🤔 Questions and Help - url: https://draftjs.herokuapp.com/ - about: "Join the channel #draft-js-plugins after signing into the DraftJS Slack organization" diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index d5057d19cf..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: '💬 Feature request' -about: Suggest introduction of a new feature. -labels: 'feature request' ---- - -## Describe the feature - - - -## Motivation - - - -## Possible implementations - - - -## Related Issues - - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 91a8401f7f..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,24 +0,0 @@ -Please check out Contributing Guidelines. By following this template you help us to review your code. -https://github.com/draft-js-plugins/draft-js-plugins/blob/master/CONTRIBUTING.md - -## Checklist - -- [ ] Fix any eslint errors that occur -- [ ] Update change-log for every plugin you touch -- [ ] Add/Update tests if you add/change new functionality -- [ ] Add/Update docs if you add/change functionality -- [ ] Enable "Allow edits from maintainers" for this PR - -## Use-case/Problem - -Whether you're fixing a bug or writing a new feature, please open an issue first and discuss with us. We're also reachable on [the draft js slack](https://draftjs.herokuapp.com/) - -Briefly describe the use-case/problem you're solving, reference the issue for this bug/feature here - -## Implementation - -Briefly describe your solution - -## Demo - -If you're implementing or changing a feature, please add a gif to demo the change, thanks! diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 18b18751b0..0000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: 2 -updates: - - package-ecosystem: npm - directory: '/' - schedule: - interval: daily - open-pull-requests-limit: 10 - ignore: - - dependency-name: eslint-config-prettier - 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 - - dependency-name: '@types/draft-js' - versions: - - 0.11.1 - - dependency-name: '@rollup/plugin-node-resolve' - versions: - - 11.2.1 - - dependency-name: '@babel/core' - versions: - - 7.13.1 - - 7.13.10 - - dependency-name: rollup - versions: - - 2.38.4 - - dependency-name: '@typescript-eslint/parser' - versions: - - 4.14.2 - - dependency-name: 'animateplus' - - dependency-name: 'immutable' - - dependency-name: 'linaria' - - package-ecosystem: github-actions - directory: '/' - schedule: - interval: daily - open-pull-requests-limit: 10 diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 58e179fc2d..0000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 60 - -# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 7 - -# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) -onlyLabels: [] - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - pinned - - security - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Set to true to ignore issues with an assignee (defaults to false) -exemptAssignees: false - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -# closeComment: > -# Your comment here. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 -# Limit to only `issues` or `pulls` -# only: issues - -# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': -# pulls: -# daysUntilStale: 30 -# markComment: > -# This pull request has been automatically marked as stale because it has not had -# recent activity. It will be closed if no further activity occurs. Thank you -# for your contributions. - -# issues: -# exemptLabels: -# - confirmed diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml deleted file mode 100644 index 35d16eb403..0000000000 --- a/.github/workflows/dependabot-auto-merge.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: auto-merge - -on: - pull_request_target: - branches: - - master - -permissions: - contents: read - -jobs: - auto-merge: - permissions: - contents: none - runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' - steps: - - uses: ahmadnassri/action-dependabot-auto-merge@v2.6 - with: - github-token: ${{ secrets.AUTOMERGE_TOKEN }} - command: 'squash and merge' - target: minor diff --git a/.github/workflows/deployWebsite.yml b/.github/workflows/deployWebsite.yml deleted file mode 100644 index 29a3e8b59d..0000000000 --- a/.github/workflows/deployWebsite.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: deployWebsite - -on: workflow_dispatch - -permissions: - contents: read - -jobs: - deployWebsite: - permissions: - contents: write # for JamesIves/github-pages-deploy-action to push changes in repo - name: Deploy Website - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@master - with: - # 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 - uses: actions/setup-node@v4 - with: - node-version: 16.x - - - name: Install Dependencies - run: yarn - - - name: Install Dependencies - run: yarn - - - name: Build plugins - run: yarn build - - - name: Tests - run: yarn test - - - name: Build Website - run: ./scripts/publishGithubPages.sh - - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.7.3 - with: - branch: gh-pages - folder: packages/docs/out diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 4596a1406f..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Release - -on: - push: - branches: - - master - -jobs: - release: - name: Release - runs-on: ubuntu-latest - if: github.actor != 'dependabot[bot]' - steps: - - name: Checkout Repo - uses: actions/checkout@master - with: - # 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 - uses: actions/setup-node@v4 - with: - node-version: 16.x - - - name: Install Dependencies - run: yarn - - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 - with: - publish: yarn release - commit: 'chore(release): update monorepo packages versions' - title: 'Upcoming Release Changes' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 7032f293cd..0000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Close stale issues and PRs' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v9 - with: - stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.' - days-before-stale: 60 - days-before-close: 7 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 9d57a1bc45..0000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Tests - -on: - push: - branches: [master] - pull_request: - branches: [master] - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [16.x] - - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Cache node_modules - id: cache-modules - uses: actions/cache@v4 - with: - path: node_modules - key: ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('yarn.lock') }} - - - name: Install Dependencies - run: yarn - - - name: Build - run: yarn build - - - name: Tests - run: yarn test - - - name: Linting - run: yarn lint diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d76d5bf230..0000000000 --- a/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -.DS_Store -.idea -*.iml -.yarn -.yarnrc -distTs - -# Dependency directory -# Commenting this out is preferred by some people, see -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- -node_modules -package-lock.json - -# Browserify cache & build files -bundle.js -.bundle.js - -# build -/lib/ -.linaria-cache - -# NPM debug -npm-debug.log -npm-debug.log* - -# yarn errors -yarn-error.log - -# next.js -packages/docs/.next/ -packages/docs/out/ \ No newline at end of file diff --git a/.husky/.gitignore b/.husky/.gitignore deleted file mode 100644 index 31354ec138..0000000000 --- a/.husky/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_ diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index dc0378c348..0000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -yarn lint-staged \ No newline at end of file diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 45a4fb75db..0000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 844dd0fd06..0000000000 --- a/.prettierrc.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - semi: true, - trailingComma: 'all', - singleQuote: true, - printWidth: 120, - tabWidth: 2, - arrowParens: 'always', -}; diff --git a/.storybook/main.js b/.storybook/main.js deleted file mode 100644 index 419d62c9e0..0000000000 --- a/.storybook/main.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - core: { - builder: 'webpack5', - }, - stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'], - framework: '@storybook/react', - staticDirs: ['../stories/public'], -}; diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html deleted file mode 100644 index 15fc30962f..0000000000 --- a/.storybook/preview-head.html +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/.storybook/preview.js b/.storybook/preview.js deleted file mode 100644 index 2eae11746b..0000000000 --- a/.storybook/preview.js +++ /dev/null @@ -1 +0,0 @@ -import 'draft-js/dist/Draft.css'; diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js deleted file mode 100644 index 261f5abab9..0000000000 --- a/.storybook/webpack.config.js +++ /dev/null @@ -1,94 +0,0 @@ -const path = require('path'); - -const packages = [ - '@draft-js-plugins/editor', - '@draft-js-plugins/hashtag', - '@draft-js-plugins/linkify', - '@draft-js-plugins/anchor', - '@draft-js-plugins/mention', - '@draft-js-plugins/sticker', - '@draft-js-plugins/undo', - '@draft-js-plugins/emoji', - '@draft-js-plugins/utils', - '@draft-js-plugins/counter', - '@draft-js-plugins/drag-n-drop', - '@draft-js-plugins/drag-n-drop-upload', - '@draft-js-plugins/inline-toolbar', - '@draft-js-plugins/static-toolbar', - '@draft-js-plugins/side-toolbar', - '@draft-js-plugins/focus', - '@draft-js-plugins/alignment', - '@draft-js-plugins/text-alignment', - '@draft-js-plugins/image', - '@draft-js-plugins/resizeable', - '@draft-js-plugins/buttons', - '@draft-js-plugins/video', - '@draft-js-plugins/divider', -]; - -const packagesAliases = {}; -packages.forEach((name) => { - const [, folderName] = name.split('/'); - packagesAliases[name] = path.join( - __dirname, - '../packages', - folderName, - 'src' - ); -}); - -module.exports = async ({ config }) => { - config.module = { - rules: [ - { - test: /\.css$/, - exclude: [/linaria-cache/, /node_modules/], - use: [ - 'style-loader', - { - loader: 'css-loader', - options: { - modules: { - localIdentName: '[name]__[local]___[hash:base64:5]', - }, - }, - }, - ], - }, - { - test: /\.css$/, - include: [/linaria-cache/, /node_modules/], - use: ['style-loader', 'css-loader'], - }, - - { - test: /\.(js|jsx|ts|tsx)?$/, - use: [ - { loader: 'babel-loader' }, - { - loader: 'linaria/loader', - options: { - sourceMap: true, - }, - }, - ], - }, - { - test: /\.(png|jpg|gif|ico)$/, - use: [{ loader: 'file-loader', options: { name: '[name].[ext]' } }], - }, - ], - }; - - config.resolve = { - alias: { - ...packagesAliases, - react: path.join(__dirname, '..', 'node_modules', 'react'), - 'prop-types': path.join(__dirname, '..', 'node_modules', 'prop-types'), - }, - extensions: ['.ts', '.tsx', '.js', '.json', '.mjs'], - fallback: { path: require.resolve('path-browserify') }, - }; - - return config; -}; diff --git a/404.html b/404.html new file mode 100644 index 0000000000..be53c37a1e --- /dev/null +++ b/404.html @@ -0,0 +1,12 @@ +
Slack-like emoji autocompletion, Facebook-like stickers & mentions, and many more features out of the box to enhance your web application.
Facebook's rich-text editor framework DraftJS built on top of React allows you to create powerful editors. We're building a plugin architecture on top of it that aims to provide you with plug & play extensions. It comes with a set of plugins with great UX serving mobile & desktop as well as screen-readers. You can combine them in any way you want or build your own.
Because Unicorns are cooler than cats 😜
Special thanks to all the people from Stripe for their invaluable feedback and funding Nik's efforts during the Stripe Open Source Retreat.
Join the #draft-js-plugins channel after signing up to the DraftJS Slack organization or check out or collection of frequently asked questions here: FAQ.
by signing up to our newsletter