UNPKG

@atlaskit/editor-plugin-code-block-advanced

Version:

CodeBlockAdvanced plugin for @atlaskit/editor-core

20 lines (19 loc) • 682 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.firstCodeBlockInDocument = void 0; var _view = require("@codemirror/view"); /** * Keeps 'first-node-in-document' class if it was added to a codeBlock by * platform/packages/editor/editor-plugin-block-controls/src/pm-plugins/first-node-dec-plugin.ts * * @param getPos * @returns CodeMirror Extension * @example */ var firstCodeBlockInDocument = exports.firstCodeBlockInDocument = function firstCodeBlockInDocument(getPos) { return _view.EditorView.editorAttributes.of({ class: (getPos === null || getPos === void 0 ? void 0 : getPos()) === 0 ? 'first-node-in-document' : '' }); };