@micromag/ckeditor 0.2.359 → 0.2.379

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.
package/es/index.js ADDED
@@ -0,0 +1,40 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
+
4
+ var InlinePlugin = function InlinePlugin(editor) {
5
+ editor.conversion.elementToElement({
6
+ model: 'paragraph',
7
+ view: 'span'
8
+ });
9
+ };
10
+
11
+ var MarkerPlugin = function MarkerPlugin(editor) {
12
+ var options = editor.config.get('highlight.options') || [];
13
+ var markers = options.filter(function (_ref) {
14
+ var _ref$color = _ref.color,
15
+ color = _ref$color === void 0 ? null : _ref$color;
16
+ return color !== null;
17
+ });
18
+ editor.conversion.attributeToElement({
19
+ model: {
20
+ key: 'highlight',
21
+ values: markers.map(function (_ref2) {
22
+ var model = _ref2.model;
23
+ return model;
24
+ })
25
+ },
26
+ view: markers.reduce(function (map, _ref3) {
27
+ var model = _ref3.model,
28
+ color = _ref3.color;
29
+ return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, model, {
30
+ name: 'mark',
31
+ styles: {
32
+ 'background-color': color,
33
+ 'box-shadow': "0.05em 0px 0px ".concat(color, ", -0.05em 0px 0px ").concat(color)
34
+ }
35
+ }));
36
+ }, {})
37
+ });
38
+ };
39
+
40
+ export { InlinePlugin, MarkerPlugin };
package/lib/index.js ADDED
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
+ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
11
+ var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
12
+
13
+ var InlinePlugin = function InlinePlugin(editor) {
14
+ editor.conversion.elementToElement({
15
+ model: 'paragraph',
16
+ view: 'span'
17
+ });
18
+ };
19
+
20
+ var MarkerPlugin = function MarkerPlugin(editor) {
21
+ var options = editor.config.get('highlight.options') || [];
22
+ var markers = options.filter(function (_ref) {
23
+ var _ref$color = _ref.color,
24
+ color = _ref$color === void 0 ? null : _ref$color;
25
+ return color !== null;
26
+ });
27
+ editor.conversion.attributeToElement({
28
+ model: {
29
+ key: 'highlight',
30
+ values: markers.map(function (_ref2) {
31
+ var model = _ref2.model;
32
+ return model;
33
+ })
34
+ },
35
+ view: markers.reduce(function (map, _ref3) {
36
+ var model = _ref3.model,
37
+ color = _ref3.color;
38
+ return _objectSpread__default["default"](_objectSpread__default["default"]({}, map), {}, _defineProperty__default["default"]({}, model, {
39
+ name: 'mark',
40
+ styles: {
41
+ 'background-color': color,
42
+ 'box-shadow': "0.05em 0px 0px ".concat(color, ", -0.05em 0px 0px ").concat(color)
43
+ }
44
+ }));
45
+ }, {})
46
+ });
47
+ };
48
+
49
+ exports.InlinePlugin = InlinePlugin;
50
+ exports.MarkerPlugin = MarkerPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/ckeditor",
3
- "version": "0.2.359",
3
+ "version": "0.2.379",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -29,13 +29,24 @@
29
29
  }
30
30
  ],
31
31
  "license": "ISC",
32
- "main": "dist/index.js",
32
+ "main": "lib/index.js",
33
+ "module": "es/index.js",
34
+ "exports": {
35
+ ".": "./lib/index.js",
36
+ "./build": "./dist/ckeditor.js"
37
+ },
38
+ "browser": {
39
+ ".": "./es/index.js",
40
+ "./build": "./dist/ckeditor.js"
41
+ },
33
42
  "files": [
34
43
  "dist",
35
- "inline.js"
44
+ "es",
45
+ "lib"
36
46
  ],
37
47
  "scripts": {
38
- "prepare": "rm -rf dist && ../../node_modules/.bin/webpack --mode production --config webpack.config.js"
48
+ "build:ckeditor": "../../node_modules/.bin/webpack --mode production --config webpack.config.js",
49
+ "prepare": "rm -rf dist && ../../scripts/prepare-package.sh && npm run build:ckeditor"
39
50
  },
40
51
  "devDependencies": {
41
52
  "react": "^16.8.0 || ^17.0.0",
@@ -48,7 +59,6 @@
48
59
  "dependencies": {
49
60
  "@babel/runtime": "^7.13.10",
50
61
  "@ckeditor/ckeditor5-basic-styles": "^31.0.0",
51
- "@ckeditor/ckeditor5-build-inline": "^24.0.0",
52
62
  "@ckeditor/ckeditor5-editor-inline": "^31.0.0",
53
63
  "@ckeditor/ckeditor5-essentials": "^31.0.0",
54
64
  "@ckeditor/ckeditor5-highlight": "^31.0.0",
@@ -59,5 +69,5 @@
59
69
  "publishConfig": {
60
70
  "access": "public"
61
71
  },
62
- "gitHead": "fb098eacb955f175a81adec86daa7db7b4ee70bb"
72
+ "gitHead": "b3261cde1fac196f335a2f2b3091494919dd62b2"
63
73
  }