@atlaskit/editor-prosemirror

中文文档
9.0.0发布于 2026/09/17Apache-2.0TypeScriptESM + CJS近 30 天下载 291.6万

Package to group all prosemirror libraries in a single place

原始使用文档
文档目录6 节
  1. Usage
  2. Codemods
  3. How to run
  4. Troubleshooting
  5. DO NOT COMMIT THIS CHANGE
  6. Publishing

EditorProsemirror

Package to group all prosemirror libraries in a single place

Usage

import EditorProsemirror from '@atlaskit/editor-prosemirror';

Detailed docs and example usage can be found here.

Codemods

There are some codemods to help the migration. But, they are supposed to run only once and manual in the AFE repo.

  • optimistic-editor-prosemirror-usage

This one is reponsible to replace all prosemirror libraries usage with the new package e.g.:

// before

import { DecorationSet } from 'prosemirror-view';

// after

import { DecorationSet } from '@atlaskit/editor-prosemirror/view';

How to run

Run this script below

npx @atlaskit/codemod-cli --parser tsx --extensions ts,tsx --transform packages/editor/editor-prosemirror/codemods/optimistic-next-editor-prosemirror-usage/ packages

Troubleshooting

If you are getting this kind of error below:

import { Binding, NodePath, Scope } from '@babel/traverse';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at compileFunction (<anonymous>)
    at Object.compileFunction (node:vm:360:18)

Remove the token babel plugin from the babel.config.shared.js file.

DO NOT COMMIT THIS CHANGE

// file: babel.config.shared.js

    /** This override runs the tokens babel plugin on converted packages */
    {
      test: ['packages/'],
      // exclude plugin when building itself, or the tokens package it depends on
      exclude: [
        'packages/monorepo-tooling',
        'packages/design-system/tokens',
        'packages/design-system/eslint-plugin',
        'packages/design-system/storybook-addon',
        'packages/platform/feature-flags-codemods',
      ],
      plugins: [
        // Comment out this block
        //[
        //  './packages/design-system/tokens/babel-plugin',
        //  {
        //    shouldUseAutoFallback: true,
        //  },
        //],
      ],
    },

Publishing

Version bumps and publishing are managed through the changesets workflow.

版本与发布记录

@atlaskit/editor-prosemirror 共发布 45 个版本,首次发布于 2023/07/31;过去 12 个月发布了 9 个版本。

版本发布日期距今
9.0.0latest2026/09/171 个月前
8.0.32026/08/083 个月前
8.0.22026/08/063 个月前
8.0.12026/08/053 个月前
8.0.02026/06/164 个月前
7.3.02026/02/039 个月前

关于 @atlaskit/editor-prosemirror 的常见问题

@atlaskit/editor-prosemirror 是什么?

Package to group all prosemirror libraries in a single place

如何安装 @atlaskit/editor-prosemirror?

在项目目录运行 npm install @atlaskit/editor-prosemirror,或使用 pnpm add / yarn add / bun add。

@atlaskit/editor-prosemirror 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@atlaskit/editor-prosemirror 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@atlaskit/editor-prosemirror 可以商用吗?

@atlaskit/editor-prosemirror 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@atlaskit/editor-prosemirror 的下载量有多少?

根据 npm 官方下载统计,@atlaskit/editor-prosemirror 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,916,490 次,日均约 97,216 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@atlaskit/editor-prosemirror 还在维护吗?

最新版本 9.0.0 发布于 2026/09/17(1 个月前);至今共发布 45 个版本,其中过去 12 个月发布了 9 个;首次发布于 2023/07/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。