@rme-sdk/extension-codemirror6 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,545 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
10
+ var __typeError = (msg) => {
11
+ throw TypeError(msg);
12
+ };
13
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
+ var __spreadValues = (a, b) => {
15
+ for (var prop in b || (b = {}))
16
+ if (__hasOwnProp.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ if (__getOwnPropSymbols)
19
+ for (var prop of __getOwnPropSymbols(b)) {
20
+ if (__propIsEnum.call(b, prop))
21
+ __defNormalProp(a, prop, b[prop]);
22
+ }
23
+ return a;
24
+ };
25
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
27
+ var __decoratorStart = (base) => {
28
+ var _a2;
29
+ return [, , , __create((_a2 = base == null ? void 0 : base[__knownSymbol("metadata")]) != null ? _a2 : null)];
30
+ };
31
+ var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
32
+ var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
33
+ var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
34
+ var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
35
+ var __runInitializers = (array, flags, self, value) => {
36
+ for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
37
+ return value;
38
+ };
39
+ var __decorateElement = (array, flags, name, decorators, target, extra) => {
40
+ var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
41
+ var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
42
+ var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
43
+ var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
44
+ return __privateGet(this, extra);
45
+ }, set [name](x) {
46
+ return __privateSet(this, extra, x);
47
+ } }, name));
48
+ k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
49
+ for (var i = decorators.length - 1; i >= 0; i--) {
50
+ ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
51
+ if (k) {
52
+ ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
53
+ if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
54
+ if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
55
+ }
56
+ it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
57
+ if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
58
+ else if (typeof it !== "object" || it === null) __typeError("Object expected");
59
+ else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
60
+ }
61
+ return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
62
+ };
63
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
64
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
65
+ var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
66
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
67
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
68
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
69
+
70
+ // src/codemirror-extension.ts
71
+ import {
72
+ command,
73
+ extension,
74
+ findParentNodeOfType,
75
+ isElementDomNode,
76
+ isEqual,
77
+ isTextSelection,
78
+ keyBinding,
79
+ NodeExtension,
80
+ nodeInputRule,
81
+ setBlockType
82
+ } from "@rme-sdk/core";
83
+ import { TextSelection as TextSelection2 } from "@rme-sdk/pm/state";
84
+
85
+ // src/codemirror-node-view.ts
86
+ import {
87
+ EditorState as CodeMirrorEditorState,
88
+ Compartment
89
+ } from "@codemirror/state";
90
+ import {
91
+ EditorView as CodeMirrorEditorView,
92
+ keymap
93
+ } from "@codemirror/view";
94
+ import { assertGet, isPromise, replaceNodeAtPosition } from "@rme-sdk/core";
95
+ import { exitCode } from "@rme-sdk/pm/commands";
96
+ import { Selection, TextSelection } from "@rme-sdk/pm/state";
97
+ var CodeMirror6NodeView = class {
98
+ constructor({
99
+ node,
100
+ view,
101
+ getPos,
102
+ extensions,
103
+ loadLanguage,
104
+ toggleName
105
+ }) {
106
+ __publicField(this, "dom");
107
+ __publicField(this, "node");
108
+ __publicField(this, "view");
109
+ __publicField(this, "getPos");
110
+ __publicField(this, "schema");
111
+ __publicField(this, "cm");
112
+ __publicField(this, "updating", false);
113
+ __publicField(this, "loadLanguage");
114
+ __publicField(this, "languageConf");
115
+ __publicField(this, "languageName");
116
+ __publicField(this, "toggleName");
117
+ this.node = node;
118
+ this.view = view;
119
+ this.getPos = getPos;
120
+ this.schema = node.type.schema;
121
+ this.loadLanguage = loadLanguage;
122
+ this.languageConf = new Compartment();
123
+ this.languageName = "";
124
+ this.toggleName = toggleName;
125
+ const changeFilter = CodeMirrorEditorState.changeFilter.of((tr) => {
126
+ if (!tr.docChanged && !this.updating) {
127
+ this.forwardSelection();
128
+ }
129
+ return true;
130
+ });
131
+ const startState = CodeMirrorEditorState.create({
132
+ doc: this.node.textContent,
133
+ extensions: [
134
+ keymap.of(this.codeMirrorKeymap()),
135
+ changeFilter,
136
+ this.languageConf.of([]),
137
+ ...extensions != null ? extensions : []
138
+ ]
139
+ });
140
+ this.cm = new CodeMirrorEditorView({
141
+ state: startState,
142
+ dispatch: this.valueChanged.bind(this)
143
+ });
144
+ this.dom = this.cm.dom;
145
+ this.updateLanguage();
146
+ }
147
+ update(node) {
148
+ if (node.type !== this.node.type) {
149
+ return false;
150
+ }
151
+ this.node = node;
152
+ this.updateLanguage();
153
+ const change = computeChange(this.cm.state.doc.toString(), node.textContent);
154
+ if (change) {
155
+ this.updating = true;
156
+ this.cm.dispatch({
157
+ changes: { from: change.from, to: change.to, insert: change.text }
158
+ });
159
+ this.updating = false;
160
+ }
161
+ return true;
162
+ }
163
+ updateLanguage() {
164
+ const languageName = this.node.attrs.language;
165
+ if (languageName === this.languageName) {
166
+ return;
167
+ }
168
+ const language = this.loadLanguage(languageName);
169
+ if (!language) {
170
+ return;
171
+ }
172
+ if (isPromise(language)) {
173
+ language.then((lang) => {
174
+ this.setLanguage(lang);
175
+ this.languageName = languageName;
176
+ });
177
+ return;
178
+ }
179
+ this.setLanguage(language);
180
+ this.languageName = languageName;
181
+ }
182
+ setLanguage(language) {
183
+ this.cm.dispatch({
184
+ effects: this.languageConf.reconfigure(language)
185
+ });
186
+ }
187
+ /**
188
+ * Synchronize the selections from ProseMirror to CodeMirrror
189
+ */
190
+ setSelection(anchor, head) {
191
+ this.cm.focus();
192
+ this.updating = true;
193
+ this.cm.dispatch({ selection: { anchor, head } });
194
+ this.updating = false;
195
+ }
196
+ selectNode() {
197
+ this.focus();
198
+ }
199
+ focus() {
200
+ this.cm.focus();
201
+ this.forwardSelection();
202
+ }
203
+ stopEvent() {
204
+ return true;
205
+ }
206
+ destroy() {
207
+ this.cm.destroy();
208
+ }
209
+ /**
210
+ * When the code editor is focused, we can keep the selection of the outer
211
+ * editor synchronized with the inner one, so that any commands executed on
212
+ * the outer editor see an accurate selection.
213
+ */
214
+ forwardSelection() {
215
+ if (!this.cm.hasFocus) {
216
+ return;
217
+ }
218
+ const state = this.view.state;
219
+ const selection = this.asProseMirrorSelection(state.doc);
220
+ if (!selection.eq(state.selection)) {
221
+ this.view.dispatch(state.tr.setSelection(selection));
222
+ }
223
+ }
224
+ /**
225
+ * This helper function translates from a CodeMirror selection to a
226
+ * ProseMirror selection.
227
+ */
228
+ asProseMirrorSelection(doc) {
229
+ const start = this.getPos() + 1;
230
+ const { anchor, head } = this.cm.state.selection.main;
231
+ return TextSelection.between(doc.resolve(anchor + start), doc.resolve(head + start));
232
+ }
233
+ /**
234
+ * A somewhat tricky aspect of nesting editor like this is handling cursor
235
+ * motion across the edges of the inner editor. This node view will have to
236
+ * take care of allowing the user to move the selection out of the code
237
+ * editor. For that purpose, it binds the arrow keys to handlers that check if
238
+ * further motion would ‘escape’ the editor, and if so, return the selection
239
+ * and focus to the outer editor.
240
+ *
241
+ * The keymap also binds ctrl-enter, which, in ProseMirror's base keymap,
242
+ * creates a new paragraph after a code block.
243
+ */
244
+ codeMirrorKeymap() {
245
+ return [
246
+ {
247
+ key: "ArrowUp",
248
+ run: this.maybeEscape("line", -1)
249
+ },
250
+ {
251
+ key: "ArrowLeft",
252
+ run: this.maybeEscape("char", -1)
253
+ },
254
+ {
255
+ key: "ArrowDown",
256
+ run: this.maybeEscape("line", 1)
257
+ },
258
+ {
259
+ key: "ArrowRight",
260
+ run: this.maybeEscape("char", 1)
261
+ },
262
+ {
263
+ key: "Ctrl-Enter",
264
+ run: () => {
265
+ if (exitCode(this.view.state, this.view.dispatch)) {
266
+ this.view.focus();
267
+ return true;
268
+ }
269
+ return false;
270
+ }
271
+ },
272
+ {
273
+ key: "Backspace",
274
+ run: () => {
275
+ const ranges = this.cm.state.selection.ranges;
276
+ if (ranges.length > 1) {
277
+ return false;
278
+ }
279
+ const selection = ranges[0];
280
+ if (selection && (!selection.empty || selection.anchor > 0)) {
281
+ return false;
282
+ }
283
+ if (this.cm.state.doc.lines >= 2) {
284
+ return false;
285
+ }
286
+ const state = this.view.state;
287
+ const toggleNode = assertGet(state.schema.nodes, this.toggleName);
288
+ const pos = this.getPos();
289
+ const tr = replaceNodeAtPosition({
290
+ pos,
291
+ tr: state.tr,
292
+ content: toggleNode.createChecked({}, this.node.content)
293
+ });
294
+ tr.setSelection(TextSelection.near(tr.doc.resolve(pos)));
295
+ this.view.dispatch(tr);
296
+ this.view.focus();
297
+ return true;
298
+ }
299
+ }
300
+ ];
301
+ }
302
+ /**
303
+ * When the actual content of the code editor is changed, the event handler
304
+ * registered in the node view's constructor calls this method. It'll compare
305
+ * the code block node's current value to the value in the editor, and
306
+ * dispatch a transaction if there is a difference.
307
+ */
308
+ valueChanged(tr) {
309
+ this.cm.update([tr]);
310
+ if (!tr.docChanged || this.updating) {
311
+ return;
312
+ }
313
+ const change = computeChange(this.node.textContent, tr.state.doc.toString());
314
+ if (change) {
315
+ const start = this.getPos() + 1;
316
+ const tr2 = this.view.state.tr.replaceWith(
317
+ start + change.from,
318
+ start + change.to,
319
+ change.text ? this.schema.text(change.text) : []
320
+ );
321
+ this.view.dispatch(tr2);
322
+ }
323
+ }
324
+ maybeEscape(unit, dir) {
325
+ return (view) => {
326
+ const { state } = view;
327
+ if (state.selection.ranges.some((range) => !range.empty)) {
328
+ return false;
329
+ }
330
+ const anchor = state.selection.main.anchor;
331
+ const line = state.doc.lineAt(anchor);
332
+ const lineOffset = anchor - line.from;
333
+ if (line.number !== (dir < 0 ? 1 : state.doc.lines) || unit === "char" && lineOffset !== (dir < 0 ? 0 : line.length)) {
334
+ return false;
335
+ }
336
+ const targetPos = this.getPos() + (dir < 0 ? 0 : this.node.nodeSize);
337
+ const selection = Selection.near(this.view.state.doc.resolve(targetPos), dir);
338
+ this.view.dispatch(this.view.state.tr.setSelection(selection).scrollIntoView());
339
+ this.view.focus();
340
+ return true;
341
+ };
342
+ }
343
+ };
344
+ function computeChange(oldVal, newVal) {
345
+ if (oldVal === newVal) {
346
+ return null;
347
+ }
348
+ let start = 0;
349
+ let oldEnd = oldVal.length;
350
+ let newEnd = newVal.length;
351
+ while (start < oldEnd && oldVal.charCodeAt(start) === newVal.charCodeAt(start)) {
352
+ ++start;
353
+ }
354
+ while (oldEnd > start && newEnd > start && oldVal.charCodeAt(oldEnd - 1) === newVal.charCodeAt(newEnd - 1)) {
355
+ oldEnd--;
356
+ newEnd--;
357
+ }
358
+ return { from: start, to: oldEnd, text: newVal.slice(start, newEnd) };
359
+ }
360
+
361
+ // src/codemirror-utils.ts
362
+ import { Selection as Selection2 } from "@rme-sdk/pm/state";
363
+ function arrowHandler(dir) {
364
+ return ({ dispatch, view, tr }) => {
365
+ if (!view) {
366
+ return false;
367
+ }
368
+ if (!(tr.selection.empty && view.endOfTextblock(dir))) {
369
+ return false;
370
+ }
371
+ const side = dir === "left" || dir === "up" ? -1 : 1;
372
+ const $head = tr.selection.$head;
373
+ const nextPos = Selection2.near(tr.doc.resolve(side > 0 ? $head.after() : $head.before()), side);
374
+ if (nextPos.$head && nextPos.$head.parent.type.name === "codeMirror") {
375
+ dispatch == null ? void 0 : dispatch(tr.setSelection(nextPos));
376
+ return true;
377
+ }
378
+ return false;
379
+ };
380
+ }
381
+
382
+ // src/codemirror-extension.ts
383
+ var _updateCodeMirror_dec, _createCodeMirror_dec, _enterKey_dec, _a, _CodeMirrorExtension_decorators, _init;
384
+ _CodeMirrorExtension_decorators = [extension({
385
+ defaultOptions: {
386
+ extensions: null,
387
+ languages: null,
388
+ toggleName: "paragraph"
389
+ }
390
+ })];
391
+ var CodeMirrorExtension2 = class extends (_a = NodeExtension, _enterKey_dec = [keyBinding({ shortcut: "Enter" })], _createCodeMirror_dec = [command()], _updateCodeMirror_dec = [command()], _a) {
392
+ constructor() {
393
+ super(...arguments);
394
+ __runInitializers(_init, 5, this);
395
+ __publicField(this, "languageMap", null);
396
+ }
397
+ get name() {
398
+ return "codeMirror";
399
+ }
400
+ createNodeSpec(extra, override) {
401
+ var _a2;
402
+ return __spreadProps(__spreadValues({
403
+ group: "block",
404
+ content: "text*",
405
+ marks: "",
406
+ defining: true
407
+ }, override), {
408
+ code: true,
409
+ attrs: __spreadProps(__spreadValues({}, extra.defaults()), {
410
+ language: { default: "" }
411
+ }),
412
+ parseDOM: [
413
+ {
414
+ tag: "pre",
415
+ getAttrs: (node) => isElementDomNode(node) ? extra.parse(node) : false
416
+ },
417
+ ...(_a2 = override.parseDOM) != null ? _a2 : []
418
+ ],
419
+ toDOM() {
420
+ return ["pre", ["code", 0]];
421
+ },
422
+ isolating: true
423
+ });
424
+ }
425
+ createNodeViews() {
426
+ return (node, view, getPos) => new CodeMirror6NodeView({
427
+ node,
428
+ view,
429
+ getPos,
430
+ extensions: this.options.extensions,
431
+ loadLanguage: this.loadLanguage.bind(this),
432
+ toggleName: this.options.toggleName
433
+ });
434
+ }
435
+ createKeymap() {
436
+ return {
437
+ ArrowLeft: arrowHandler("left"),
438
+ ArrowRight: arrowHandler("right"),
439
+ ArrowUp: arrowHandler("up"),
440
+ ArrowDown: arrowHandler("down")
441
+ };
442
+ }
443
+ /**
444
+ * Create an input rule that listens converts the code fence into a code block
445
+ * when typing triple back tick followed by a space.
446
+ */
447
+ createInputRules() {
448
+ const regexp = /^```(\S+) $/;
449
+ const getAttributes = (match) => {
450
+ var _a2;
451
+ const language = (_a2 = match[1]) != null ? _a2 : "";
452
+ return { language };
453
+ };
454
+ return [
455
+ nodeInputRule({
456
+ regexp,
457
+ type: this.type,
458
+ beforeDispatch: ({ tr, start }) => {
459
+ const $pos = tr.doc.resolve(start);
460
+ tr.setSelection(TextSelection2.near($pos));
461
+ },
462
+ getAttributes
463
+ })
464
+ ];
465
+ }
466
+ enterKey({ dispatch, tr }) {
467
+ var _a2;
468
+ if (!(isTextSelection(tr.selection) && tr.selection.empty)) {
469
+ return false;
470
+ }
471
+ const { nodeBefore, parent } = tr.selection.$anchor;
472
+ if (!(nodeBefore == null ? void 0 : nodeBefore.isText) || !parent.type.isTextblock) {
473
+ return false;
474
+ }
475
+ const regex = /^```(\S*)?$/;
476
+ const { text, nodeSize } = nodeBefore;
477
+ const { textContent } = parent;
478
+ if (!text) {
479
+ return false;
480
+ }
481
+ const matchesNodeBefore = text.match(regex);
482
+ const matchesParent = textContent.match(regex);
483
+ if (!matchesNodeBefore || !matchesParent) {
484
+ return false;
485
+ }
486
+ const language = (_a2 = matchesNodeBefore[1]) != null ? _a2 : "";
487
+ const pos = tr.selection.$from.before();
488
+ const end = pos + nodeSize + 1;
489
+ tr.replaceWith(pos, end, this.type.create({ language }));
490
+ tr.setSelection(TextSelection2.near(tr.doc.resolve(pos + 1)));
491
+ if (dispatch) {
492
+ dispatch(tr);
493
+ }
494
+ return true;
495
+ }
496
+ getLanguageMap() {
497
+ var _a2;
498
+ if (!this.languageMap) {
499
+ this.languageMap = {};
500
+ for (const language of (_a2 = this.options.languages) != null ? _a2 : []) {
501
+ for (const alias of language.alias) {
502
+ this.languageMap[alias] = language;
503
+ }
504
+ }
505
+ }
506
+ return this.languageMap;
507
+ }
508
+ loadLanguage(languageName) {
509
+ if (typeof languageName !== "string") {
510
+ return void 0;
511
+ }
512
+ const languageMap = this.getLanguageMap();
513
+ const language = languageMap[languageName.toLowerCase()];
514
+ if (!language) {
515
+ return void 0;
516
+ }
517
+ return language.support || language.load();
518
+ }
519
+ createCodeMirror(attributes) {
520
+ return setBlockType(this.type, attributes);
521
+ }
522
+ updateCodeMirror(attributes) {
523
+ const type = this.type;
524
+ return ({ state, dispatch, tr }) => {
525
+ const parent = findParentNodeOfType({ types: type, selection: state.selection });
526
+ if (!parent || isEqual(attributes, parent.node.attrs)) {
527
+ return false;
528
+ }
529
+ tr.setNodeMarkup(parent.pos, type, __spreadValues(__spreadValues({}, parent.node.attrs), attributes));
530
+ if (dispatch) {
531
+ dispatch(tr);
532
+ }
533
+ return true;
534
+ };
535
+ }
536
+ };
537
+ _init = __decoratorStart(_a);
538
+ __decorateElement(_init, 1, "enterKey", _enterKey_dec, CodeMirrorExtension2);
539
+ __decorateElement(_init, 1, "createCodeMirror", _createCodeMirror_dec, CodeMirrorExtension2);
540
+ __decorateElement(_init, 1, "updateCodeMirror", _updateCodeMirror_dec, CodeMirrorExtension2);
541
+ CodeMirrorExtension2 = __decorateElement(_init, 0, "CodeMirrorExtension", _CodeMirrorExtension_decorators, CodeMirrorExtension2);
542
+ __runInitializers(_init, 1, CodeMirrorExtension2);
543
+ export {
544
+ CodeMirrorExtension2 as CodeMirrorExtension
545
+ };
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@rme-sdk/extension-codemirror6",
3
+ "version": "1.1.0",
4
+ "description": "Add CodeMirror6 to your editor.",
5
+ "keywords": [
6
+ "remirror",
7
+ "remirror-extension",
8
+ "CodeMirror",
9
+ "editor"
10
+ ],
11
+ "homepage": "https://github.com/remirror/remirror/tree/HEAD/packages/remirror__extension-codemirror6",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/remirror/remirror.git",
15
+ "directory": "packages/remirror__extension-codemirror6"
16
+ },
17
+ "license": "MIT",
18
+ "contributors": [
19
+ "Ocavue <ocavue@gmail.com>"
20
+ ],
21
+ "sideEffects": false,
22
+ "type": "module",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/rme-sdk-extension-codemirror6.d.ts",
26
+ "import": "./dist/rme-sdk-extension-codemirror6.js",
27
+ "require": "./dist/rme-sdk-extension-codemirror6.cjs"
28
+ },
29
+ "./package.json": "./package.json"
30
+ },
31
+ "main": "./dist/rme-sdk-extension-codemirror6.cjs",
32
+ "module": "./dist/rme-sdk-extension-codemirror6.js",
33
+ "types": "./dist/rme-sdk-extension-codemirror6.d.ts",
34
+ "files": [
35
+ "dist",
36
+ "dist-types"
37
+ ],
38
+ "dependencies": {
39
+ "@babel/runtime": "^7.27.0",
40
+ "@codemirror/language": "^6.11.3",
41
+ "@codemirror/state": "^6.5.2",
42
+ "@codemirror/view": "^6.38.4",
43
+ "@rme-sdk/core": "1.1.0"
44
+ },
45
+ "devDependencies": {
46
+ "@rme-sdk/cli": "1.1.0",
47
+ "@rme-sdk/pm": "1.1.0"
48
+ },
49
+ "peerDependencies": {
50
+ "@rme-sdk/pm": "1.1.0"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "@rme-sdk": {
56
+ "sizeLimit": "100 KB"
57
+ },
58
+ "scripts": {
59
+ "build": "remirror-cli build"
60
+ }
61
+ }