UNPKG

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

Version:

CodeBlockAdvanced plugin for @atlaskit/editor-core

25 lines (24 loc) 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.firstCodeBlockInDocument = void 0; var _view = require("@codemirror/view"); var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure"); /** * 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) { if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_breakout_resizing', 'isEnabled', true)) { return _view.EditorView.editorAttributes.of({ class: (getPos === null || getPos === void 0 ? void 0 : getPos()) === 0 ? 'first-node-in-document' : '' }); } else { return []; } };