@pie-lib/editable-html 11.35.0-mui-update.0 → 12.0.0-next.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.
- package/CHANGELOG.md +8 -121
- package/lib/editor.js +62 -48
- package/lib/editor.js.map +1 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +1 -1
- package/lib/plugins/characters/custom-popper.js +4 -0
- package/lib/plugins/characters/custom-popper.js.map +1 -1
- package/lib/plugins/css/index.js +6 -3
- package/lib/plugins/css/index.js.map +1 -1
- package/lib/plugins/html/icons/index.js +4 -0
- package/lib/plugins/html/icons/index.js.map +1 -1
- package/lib/plugins/image/component.js +35 -40
- package/lib/plugins/image/component.js.map +1 -1
- package/lib/plugins/index.js +2 -0
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/media/index.js +1 -1
- package/lib/plugins/media/index.js.map +1 -1
- package/lib/plugins/respArea/drag-in-the-blank/choice.js +10 -8
- package/lib/plugins/respArea/drag-in-the-blank/choice.js.map +1 -1
- package/lib/plugins/respArea/math-templated/index.js +7 -8
- package/lib/plugins/respArea/math-templated/index.js.map +1 -1
- package/lib/plugins/table/icons/index.js +3 -1
- package/lib/plugins/table/icons/index.js.map +1 -1
- package/lib/plugins/table/index.js +7 -0
- package/lib/plugins/table/index.js.map +1 -1
- package/lib/plugins/table/table-toolbar.js +2 -1
- package/lib/plugins/table/table-toolbar.js.map +1 -1
- package/lib/plugins/textAlign/icons/index.js +8 -1
- package/lib/plugins/textAlign/icons/index.js.map +1 -1
- package/lib/plugins/textAlign/index.js +0 -3
- package/lib/plugins/textAlign/index.js.map +1 -1
- package/lib/plugins/toolbar/editor-and-toolbar.js +0 -1
- package/lib/plugins/toolbar/editor-and-toolbar.js.map +1 -1
- package/lib/plugins/toolbar/toolbar-buttons.js +2 -1
- package/lib/plugins/toolbar/toolbar-buttons.js.map +1 -1
- package/lib/plugins/toolbar/toolbar.js +1 -4
- package/lib/plugins/toolbar/toolbar.js.map +1 -1
- package/lib/serialization.js +3 -3
- package/lib/serialization.js.map +1 -1
- package/package.json +16 -8
- package/src/__tests__/editor-utils.test.js +162 -0
- package/src/editor.jsx +54 -39
- package/src/index.jsx +0 -3
- package/src/plugins/characters/custom-popper.js +5 -0
- package/src/plugins/css/index.jsx +6 -3
- package/src/plugins/html/icons/index.jsx +5 -0
- package/src/plugins/image/__tests__/component.test.jsx +61 -29
- package/src/plugins/image/__tests__/image-toolbar-logic.test.jsx +69 -17
- package/src/plugins/image/__tests__/image-toolbar.test.jsx +6 -4
- package/src/plugins/image/component.jsx +19 -23
- package/src/plugins/index.jsx +2 -0
- package/src/plugins/math/__tests__/index.test.jsx +45 -26
- package/src/plugins/media/index.jsx +1 -1
- package/src/plugins/respArea/drag-in-the-blank/choice.jsx +9 -7
- package/src/plugins/respArea/math-templated/index.jsx +1 -1
- package/src/plugins/table/__tests__/table-toolbar.test.jsx +40 -7
- package/src/plugins/table/icons/index.jsx +3 -1
- package/src/plugins/table/index.jsx +8 -0
- package/src/plugins/table/table-toolbar.jsx +1 -0
- package/src/plugins/textAlign/icons/index.jsx +10 -1
- package/src/plugins/textAlign/index.jsx +0 -3
- package/src/plugins/toolbar/__tests__/default-toolbar.test.jsx +102 -69
- package/src/plugins/toolbar/__tests__/editor-and-toolbar.test.jsx +14 -11
- package/src/plugins/toolbar/__tests__/toolbar-buttons.test.jsx +81 -35
- package/src/plugins/toolbar/__tests__/toolbar.test.jsx +43 -37
- package/src/plugins/toolbar/editor-and-toolbar.jsx +0 -1
- package/src/plugins/toolbar/toolbar-buttons.jsx +1 -0
- package/src/plugins/toolbar/toolbar.jsx +1 -5
- package/src/serialization.jsx +3 -3
- package/src/__tests__/editor.test.jsx +0 -363
- package/src/plugins/image/__tests__/__snapshots__/component.test.jsx.snap +0 -51
- package/src/plugins/image/__tests__/__snapshots__/image-toolbar-logic.test.jsx.snap +0 -27
- package/src/plugins/image/__tests__/__snapshots__/image-toolbar.test.jsx.snap +0 -44
- package/src/plugins/math/__tests__/__snapshots__/index.test.jsx.snap +0 -48
- package/src/plugins/table/__tests__/__snapshots__/table-toolbar.test.jsx.snap +0 -44
- package/src/plugins/toolbar/__tests__/__snapshots__/default-toolbar.test.jsx.snap +0 -923
- package/src/plugins/toolbar/__tests__/__snapshots__/editor-and-toolbar.test.jsx.snap +0 -20
- package/src/plugins/toolbar/__tests__/__snapshots__/toolbar-buttons.test.jsx.snap +0 -36
- package/src/plugins/toolbar/__tests__/__snapshots__/toolbar.test.jsx.snap +0 -46
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [
|
|
6
|
+
# [12.0.0-next.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.21.3-next.0...@pie-lib/editable-html@12.0.0-next.0) (2026-01-19)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
## [11.21.3-next.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.35.0-mui-update.0...@pie-lib/editable-html@11.21.3-next.0) (2026-01-19)
|
|
15
15
|
|
|
16
16
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
17
17
|
|
|
@@ -19,200 +19,87 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
# [11.33.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.32.0-mui-update.0...@pie-lib/editable-html@11.33.0-mui-update.0) (2025-12-17)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @pie-lib/editable-html
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
# [11.32.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.31.0-mui-update.0...@pie-lib/editable-html@11.32.0-mui-update.0) (2025-12-17)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Bug Fixes
|
|
34
|
-
|
|
35
|
-
* choice render for both img and math ([39bc638](https://github.com/pie-framework/pie-lib/commit/39bc638070fc5e9c5f2b50d0d70698f80a32ecb9))
|
|
36
|
-
* fix math rendering issues after React, mui and drag upgrade for drag-in-the-blank ([6dc3c95](https://github.com/pie-framework/pie-lib/commit/6dc3c95c041be02015a9005133fe750e1ff78842))
|
|
37
|
-
* prevent math re-rendering issues when dragging choices over blanks ([b316544](https://github.com/pie-framework/pie-lib/commit/b316544f0d574f7f57b70e2de4d8bab2086a4151))
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
# [11.31.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.30.0-mui-update.0...@pie-lib/editable-html@11.31.0-mui-update.0) (2025-12-11)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Features
|
|
47
|
-
|
|
48
|
-
* updates for drag-in-the-blank ([0c096d8](https://github.com/pie-framework/pie-lib/commit/0c096d887f97edecd2dac68cda136b2d265dc7d5))
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
# [11.30.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.29.0-mui-update.0...@pie-lib/editable-html@11.30.0-mui-update.0) (2025-12-02)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### Features
|
|
58
|
-
|
|
59
|
-
* sync latest changes from dev ([c936e9c](https://github.com/pie-framework/pie-lib/commit/c936e9c7f9e095e7d9b9805ac2bf72bd271e05f1))
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
22
|
## [11.21.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.21.1...@pie-lib/editable-html@11.21.2) (2025-11-27)
|
|
66
23
|
|
|
67
24
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
68
25
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
26
|
## [11.21.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.17.2...@pie-lib/editable-html@11.21.1) (2025-10-22)
|
|
74
27
|
|
|
75
28
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
76
29
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
30
|
# [11.21.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.20.0...@pie-lib/editable-html@11.21.0) (2025-10-16)
|
|
82
31
|
|
|
83
32
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
84
33
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
34
|
# [11.20.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.17.0...@pie-lib/editable-html@11.20.0) (2025-10-16)
|
|
90
35
|
|
|
91
36
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
92
37
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
38
|
# [11.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.17.0...@pie-lib/editable-html@11.19.0) (2025-10-16)
|
|
98
39
|
|
|
99
40
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
100
41
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
42
|
# [11.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.17.0...@pie-lib/editable-html@11.18.0) (2025-10-16)
|
|
106
43
|
|
|
107
44
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
108
45
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
46
|
## [11.17.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.17.1...@pie-lib/editable-html@11.17.2) (2025-10-14)
|
|
114
47
|
|
|
115
48
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
116
49
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
50
|
## [11.17.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.17.0...@pie-lib/editable-html@11.17.1) (2025-10-09)
|
|
122
51
|
|
|
123
52
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
124
53
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
54
|
# [11.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.1.1...@pie-lib/editable-html@11.17.0) (2025-09-25)
|
|
130
55
|
|
|
131
|
-
|
|
132
56
|
### Bug Fixes
|
|
133
57
|
|
|
134
|
-
|
|
135
|
-
|
|
58
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
136
59
|
|
|
137
60
|
### Features
|
|
138
61
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
62
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
144
63
|
|
|
145
64
|
# [11.16.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.15.0...@pie-lib/editable-html@11.16.0) (2025-09-18)
|
|
146
65
|
|
|
147
66
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
148
67
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
68
|
# [11.15.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.14.0...@pie-lib/editable-html@11.15.0) (2025-09-18)
|
|
154
69
|
|
|
155
70
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
156
71
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
72
|
# [11.14.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.1.1...@pie-lib/editable-html@11.14.0) (2025-09-18)
|
|
162
73
|
|
|
163
|
-
|
|
164
74
|
### Bug Fixes
|
|
165
75
|
|
|
166
|
-
|
|
167
|
-
|
|
76
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
168
77
|
|
|
169
78
|
### Features
|
|
170
79
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
80
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
176
81
|
|
|
177
82
|
# [11.13.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.12.0...@pie-lib/editable-html@11.13.0) (2025-09-17)
|
|
178
83
|
|
|
179
84
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
180
85
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
86
|
# [11.12.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.11.0...@pie-lib/editable-html@11.12.0) (2025-09-17)
|
|
186
87
|
|
|
187
88
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
188
89
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
90
|
# [11.11.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.10.1...@pie-lib/editable-html@11.11.0) (2025-09-17)
|
|
194
91
|
|
|
195
92
|
**Note:** Version bump only for package @pie-lib/editable-html
|
|
196
93
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
94
|
## [11.10.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.1.1...@pie-lib/editable-html@11.10.1) (2025-08-11)
|
|
202
95
|
|
|
203
|
-
|
|
204
96
|
### Bug Fixes
|
|
205
97
|
|
|
206
|
-
|
|
207
|
-
|
|
98
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
208
99
|
|
|
209
100
|
### Features
|
|
210
101
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
102
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
216
103
|
|
|
217
104
|
# [11.10.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/editable-html@11.1.1...@pie-lib/editable-html@11.10.0) (2025-08-07)
|
|
218
105
|
|
package/lib/editor.js
CHANGED
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "DEFAULT_PLUGINS", {
|
|
|
17
17
|
return _plugins.DEFAULT_PLUGINS;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
exports.serialization = exports["default"] = exports.Editor = void 0;
|
|
20
|
+
exports.valueToSize = exports.serialization = exports["default"] = exports.buildSizeStyle = exports.Editor = void 0;
|
|
21
21
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
22
22
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
23
23
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -73,6 +73,53 @@ var createToolbarOpts = function createToolbarOpts(toolbarOpts, error, isHtmlMod
|
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Converts a value to a CSS size string
|
|
78
|
+
* @param {string|number} v - The value to convert
|
|
79
|
+
* @returns {string|undefined} CSS size string or undefined
|
|
80
|
+
*/
|
|
81
|
+
var valueToSize = exports.valueToSize = function valueToSize(v) {
|
|
82
|
+
if (!v) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
var calcRegex = /^calc\((.*)\)$/;
|
|
86
|
+
if (typeof v === 'string') {
|
|
87
|
+
if (v.endsWith('%')) {
|
|
88
|
+
return undefined;
|
|
89
|
+
} else if (v.endsWith('px') || v.endsWith('vh') || v.endsWith('vw') || v.endsWith('ch') || v.endsWith('em') || v.match(calcRegex)) {
|
|
90
|
+
return v;
|
|
91
|
+
} else {
|
|
92
|
+
var value = parseInt(v, 10);
|
|
93
|
+
return isNaN(value) ? value : "".concat(value, "px");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (typeof v === 'number') {
|
|
97
|
+
return "".concat(v, "px");
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Builds a style object for editor size constraints
|
|
103
|
+
* @param {Object} props - Editor props containing size values
|
|
104
|
+
* @returns {Object} Style object with width/height constraints
|
|
105
|
+
*/
|
|
106
|
+
var _buildSizeStyle = exports.buildSizeStyle = function buildSizeStyle(props) {
|
|
107
|
+
var minWidth = props.minWidth,
|
|
108
|
+
width = props.width,
|
|
109
|
+
maxWidth = props.maxWidth,
|
|
110
|
+
minHeight = props.minHeight,
|
|
111
|
+
height = props.height,
|
|
112
|
+
maxHeight = props.maxHeight;
|
|
113
|
+
return {
|
|
114
|
+
width: valueToSize(width),
|
|
115
|
+
minWidth: valueToSize(minWidth),
|
|
116
|
+
maxWidth: valueToSize(maxWidth),
|
|
117
|
+
height: valueToSize(height),
|
|
118
|
+
minHeight: valueToSize(minHeight),
|
|
119
|
+
maxHeight: valueToSize(maxHeight)
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
|
|
76
123
|
/**
|
|
77
124
|
* The maximum number of characters the editor can support
|
|
78
125
|
* @type {number}
|
|
@@ -588,25 +635,6 @@ var Editor = exports.Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
588
635
|
}
|
|
589
636
|
return _this.state.preBlurValue;
|
|
590
637
|
});
|
|
591
|
-
(0, _defineProperty2["default"])(_this, "valueToSize", function (v) {
|
|
592
|
-
if (!v) {
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
var calcRegex = /^calc\((.*)\)$/;
|
|
596
|
-
if (typeof v === 'string') {
|
|
597
|
-
if (v.endsWith('%')) {
|
|
598
|
-
return undefined;
|
|
599
|
-
} else if (v.endsWith('px') || v.endsWith('vh') || v.endsWith('vw') || v.endsWith('ch') || v.endsWith('em') || v.match(calcRegex)) {
|
|
600
|
-
return v;
|
|
601
|
-
} else {
|
|
602
|
-
var value = parseInt(v, 10);
|
|
603
|
-
return isNaN(value) ? value : "".concat(value, "px");
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
if (typeof v === 'number') {
|
|
607
|
-
return "".concat(v, "px");
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
638
|
(0, _defineProperty2["default"])(_this, "validateNode", function (node) {
|
|
611
639
|
if (node.object !== 'block') return;
|
|
612
640
|
var last = node.nodes.last();
|
|
@@ -904,37 +932,25 @@ var Editor = exports.Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
904
932
|
}
|
|
905
933
|
}, {
|
|
906
934
|
key: "buildSizeStyle",
|
|
907
|
-
value:
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
maxWidth = _this$props.maxWidth,
|
|
912
|
-
minHeight = _this$props.minHeight,
|
|
913
|
-
height = _this$props.height,
|
|
914
|
-
maxHeight = _this$props.maxHeight;
|
|
915
|
-
return {
|
|
916
|
-
width: this.valueToSize(width),
|
|
917
|
-
minWidth: this.valueToSize(minWidth),
|
|
918
|
-
maxWidth: this.valueToSize(maxWidth),
|
|
919
|
-
height: this.valueToSize(height),
|
|
920
|
-
minHeight: this.valueToSize(minHeight),
|
|
921
|
-
maxHeight: this.valueToSize(maxHeight)
|
|
922
|
-
};
|
|
935
|
+
value:
|
|
936
|
+
// Use the exported utility functions
|
|
937
|
+
function buildSizeStyle() {
|
|
938
|
+
return _buildSizeStyle(this.props);
|
|
923
939
|
}
|
|
924
940
|
}, {
|
|
925
941
|
key: "render",
|
|
926
942
|
value: function render() {
|
|
927
943
|
var _this4 = this,
|
|
928
944
|
_value$document;
|
|
929
|
-
var _this$
|
|
930
|
-
disabled = _this$
|
|
931
|
-
spellCheck = _this$
|
|
932
|
-
highlightShape = _this$
|
|
933
|
-
className = _this$
|
|
934
|
-
placeholder = _this$
|
|
935
|
-
pluginProps = _this$
|
|
936
|
-
onKeyDown = _this$
|
|
937
|
-
slateEditorExtraStyles = _this$
|
|
945
|
+
var _this$props = this.props,
|
|
946
|
+
disabled = _this$props.disabled,
|
|
947
|
+
spellCheck = _this$props.spellCheck,
|
|
948
|
+
highlightShape = _this$props.highlightShape,
|
|
949
|
+
className = _this$props.className,
|
|
950
|
+
placeholder = _this$props.placeholder,
|
|
951
|
+
pluginProps = _this$props.pluginProps,
|
|
952
|
+
onKeyDown = _this$props.onKeyDown,
|
|
953
|
+
slateEditorExtraStyles = _this$props.slateEditorExtraStyles;
|
|
938
954
|
// We don't want to send customPlugins to slate.
|
|
939
955
|
// Not sure if they would do any harm, but I think it's better to not send them.
|
|
940
956
|
// We use custom plugins to be able to add custom buttons
|
|
@@ -1134,9 +1150,7 @@ var Editor = exports.Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
1134
1150
|
extraCSSRules: null,
|
|
1135
1151
|
isEditor: false
|
|
1136
1152
|
});
|
|
1137
|
-
var StyledEditorWrapper = (0, _styles.styled)('div')(function (
|
|
1138
|
-
var theme = _ref6.theme,
|
|
1139
|
-
scheduled = _ref6.scheduled;
|
|
1153
|
+
var StyledEditorWrapper = (0, _styles.styled)('div')(function () {
|
|
1140
1154
|
return {
|
|
1141
1155
|
'&.withBg': {
|
|
1142
1156
|
backgroundColor: 'rgba(0,0,0,0.06)'
|