From 9ccf3b1a6d0207c0587ffda58f84318670993e3b Mon Sep 17 00:00:00 2001 From: Yuriy Demidov Date: Thu, 6 Jun 2024 18:29:54 +0300 Subject: [PATCH] feat: add re-export of codemirror core modules (#266) Added submodule `@gravity-ui/markdown-editor/cm/*` with re-export of core codemirror modules --- package.json | 8 ++++++++ src/cm/autocomplete.ts | 1 + src/cm/commands.ts | 1 + src/cm/language.ts | 1 + src/cm/readme.md | 15 +++++++++++++++ src/cm/state.ts | 1 + src/cm/view.ts | 1 + src/pm/readme.md | 6 ++++++ 8 files changed, 34 insertions(+) create mode 100644 src/cm/autocomplete.ts create mode 100644 src/cm/commands.ts create mode 100644 src/cm/language.ts create mode 100644 src/cm/readme.md create mode 100644 src/cm/state.ts create mode 100644 src/cm/view.ts diff --git a/package.json b/package.json index 20c8c079..8b9acd09 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,11 @@ "require": "./build/cjs/bundle/*", "import": "./build/esm/bundle/*" }, + "./cm/*": { + "types": "./build/esm/cm/*", + "require": "./build/cjs/cm/*", + "import": "./build/esm/cm/*" + }, "./pm/*": { "types": "./build/esm/pm/*", "require": "./build/cjs/pm/*", @@ -109,6 +114,9 @@ "specs": [ "./build/esm/extensions/specs.d.ts" ], + "cm/*": [ + "./build/esm/cm/*" + ], "pm/*": [ "./build/esm/pm/*" ], diff --git a/src/cm/autocomplete.ts b/src/cm/autocomplete.ts new file mode 100644 index 00000000..3c414952 --- /dev/null +++ b/src/cm/autocomplete.ts @@ -0,0 +1 @@ +export * from '@codemirror/autocomplete'; diff --git a/src/cm/commands.ts b/src/cm/commands.ts new file mode 100644 index 00000000..34031c26 --- /dev/null +++ b/src/cm/commands.ts @@ -0,0 +1 @@ +export * from '@codemirror/commands'; diff --git a/src/cm/language.ts b/src/cm/language.ts new file mode 100644 index 00000000..9bfe6b6a --- /dev/null +++ b/src/cm/language.ts @@ -0,0 +1 @@ +export * from '@codemirror/language'; diff --git a/src/cm/readme.md b/src/cm/readme.md new file mode 100644 index 00000000..d4e8e3e6 --- /dev/null +++ b/src/cm/readme.md @@ -0,0 +1,15 @@ +## CM submodule + +### Re-exports codemirror core modules: + +- [@codemirror/autocomplete](https://github.com/codemirror/autocomplete) +- [@codemirror/commands](https://github.com/codemirror/commands) +- [@codemirror/language](https://github.com/codemirror/language) +- [@codemirror/state](https://github.com/codemirror/state) +- [@codemirror/view](https://github.com/codemirror/view) + +### Usage + +```js +import {EditorView} from '@gravity-ui/markdown-editor/cm/view'; +``` diff --git a/src/cm/state.ts b/src/cm/state.ts new file mode 100644 index 00000000..b6ef173d --- /dev/null +++ b/src/cm/state.ts @@ -0,0 +1 @@ +export * from '@codemirror/state'; diff --git a/src/cm/view.ts b/src/cm/view.ts new file mode 100644 index 00000000..6d964dc4 --- /dev/null +++ b/src/cm/view.ts @@ -0,0 +1 @@ +export * from '@codemirror/view'; diff --git a/src/pm/readme.md b/src/pm/readme.md index 2514716e..2ce5c5be 100644 --- a/src/pm/readme.md +++ b/src/pm/readme.md @@ -15,3 +15,9 @@ - [prosemirror-utils](https://github.com/atlassian/prosemirror-utils) - [prosemirror-test-builder](https://github.com/ProseMirror/prosemirror-test-builder) + +### Usage + +```js +import {EditorView} from '@gravity-ui/markdown-editor/pm/view'; +```