UNPKG

1.26 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _options = require('./options');
8
9var _options2 = _interopRequireDefault(_options);
10
11var _utils = require('./utils');
12
13var _changes = require('./changes');
14
15var _validation = require('./validation');
16
17function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
19/**
20 * The core of the plugin, which does not relies on `slate-react`, and includes
21 * everything but behavior and rendering logic.
22 */
23function core(optsParam) {
24 var opts = new _options2.default(optsParam);
25
26 return {
27 schema: (0, _validation.schema)(opts),
28
29 changes: {
30 unwrapCodeBlockByKey: _changes.unwrapCodeBlockByKey.bind(null, opts),
31 wrapCodeBlockByKey: _changes.wrapCodeBlockByKey.bind(null, opts),
32 wrapCodeBlock: _changes.wrapCodeBlock.bind(null, opts),
33 unwrapCodeBlock: _changes.unwrapCodeBlock.bind(null, opts),
34 toggleCodeBlock: _changes.toggleCodeBlock.bind(null, opts)
35 },
36
37 utils: {
38 isInCodeBlock: _utils.isInCodeBlock.bind(null, opts),
39 deserializeCode: _utils.deserializeCode.bind(null, opts)
40 }
41 };
42}
43
44exports.default = core;
\No newline at end of file