@modusoperandi/licit 0.14.0 → 0.14.2

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.
Files changed (45) hide show
  1. package/dist/EditorCommands.js +1 -7
  2. package/dist/EditorCommands.js.flow +0 -4
  3. package/dist/EditorNodes.js +0 -3
  4. package/dist/EditorNodes.js.flow +0 -3
  5. package/dist/bom.xml +168 -169
  6. package/dist/buildEditorPlugins.js +1 -2
  7. package/dist/buildEditorPlugins.js.flow +0 -2
  8. package/dist/ui/Editor.js +0 -2
  9. package/dist/ui/Editor.js.flow +1 -3
  10. package/dist/ui/EditorToolbarConfig.js +0 -6
  11. package/dist/ui/EditorToolbarConfig.js.flow +0 -8
  12. package/package.json +3 -3
  13. package/src/EditorCommands.js +0 -4
  14. package/src/EditorNodes.js +0 -3
  15. package/src/buildEditorPlugins.js +0 -2
  16. package/src/ui/Editor.js +1 -3
  17. package/src/ui/EditorToolbarConfig.js +0 -8
  18. package/dist/ImageFromURLCommand.js +0 -19
  19. package/dist/ImageFromURLCommand.js.flow +0 -14
  20. package/dist/ImageNodeSpec.js +0 -109
  21. package/dist/ImageNodeSpec.js.flow +0 -90
  22. package/dist/ImageSourceCommand.js +0 -117
  23. package/dist/ImageSourceCommand.js.flow +0 -117
  24. package/dist/ImageUploadCommand.js +0 -49
  25. package/dist/ImageUploadCommand.js.flow +0 -36
  26. package/dist/ui/ImageAlignEditor.js +0 -71
  27. package/dist/ui/ImageAlignEditor.js.flow +0 -60
  28. package/dist/ui/ImageNodeView.js +0 -403
  29. package/dist/ui/ImageNodeView.js.flow +0 -404
  30. package/dist/ui/ImageResizeBox.js +0 -206
  31. package/dist/ui/ImageResizeBox.js.flow +0 -219
  32. package/dist/ui/ImageURLEditor.js +0 -108
  33. package/dist/ui/ImageURLEditor.js.flow +0 -119
  34. package/dist/ui/ImageUploadEditor.js +0 -123
  35. package/dist/ui/ImageUploadEditor.js.flow +0 -117
  36. package/package-lock.json.old +0 -32889
  37. package/src/ImageFromURLCommand.js +0 -14
  38. package/src/ImageNodeSpec.js +0 -90
  39. package/src/ImageSourceCommand.js +0 -117
  40. package/src/ImageUploadCommand.js +0 -36
  41. package/src/ui/ImageAlignEditor.js +0 -60
  42. package/src/ui/ImageNodeView.js +0 -404
  43. package/src/ui/ImageResizeBox.js +0 -219
  44. package/src/ui/ImageURLEditor.js +0 -119
  45. package/src/ui/ImageUploadEditor.js +0 -117
@@ -1,404 +0,0 @@
1
- // @flow
2
-
3
- import cx from 'classnames';
4
- import { Node } from 'prosemirror-model';
5
- import { Decoration } from 'prosemirror-view';
6
- import { NodeSelection } from 'prosemirror-state';
7
- import * as React from 'react';
8
- import ReactDOM from 'react-dom';
9
-
10
- import CustomNodeView from './CustomNodeView';
11
- import { FRAMESET_BODY_CLASSNAME } from './EditorFrameset';
12
- import Icon from './Icon';
13
- import ImageInlineEditor from './ImageInlineEditor';
14
- import ImageResizeBox from './ImageResizeBox';
15
- import { MIN_SIZE } from './ImageResizeBox';
16
- import { atAnchorBottomCenter } from '@modusoperandi/licit-ui-commands';
17
- import ResizeObserver from './ResizeObserver';
18
- import { createPopUp } from '@modusoperandi/licit-ui-commands';
19
- import resolveImage from './resolveImage';
20
- import uuid from './uuid';
21
-
22
- import './czi-image-view.css';
23
-
24
- import type { EditorRuntime } from '../Types';
25
- import type { NodeViewProps } from './CustomNodeView';
26
- import type { ResizeObserverEntry } from './ResizeObserver';
27
-
28
- const EMPTY_SRC =
29
- 'data:image/gif;base64,' +
30
- 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
31
-
32
- /* This value must be synced with the margin defined at .czi-image-view */
33
- const IMAGE_MARGIN = 2;
34
-
35
- const MAX_SIZE = 100000;
36
- const IMAGE_PLACEHOLDER_SIZE = 24;
37
-
38
- const DEFAULT_ORIGINAL_SIZE = {
39
- src: '',
40
- complete: false,
41
- height: 0,
42
- width: 0,
43
- };
44
-
45
- // Get the maxWidth that the image could be resized to.
46
- function getMaxResizeWidth(el: any): number {
47
- // Ideally, the image should bot be wider then its containing element.
48
- let node: any = el.parentElement;
49
- while (node && !node.offsetParent) {
50
- node = node.parentElement;
51
- }
52
- if (
53
- node &&
54
- node.offsetParent &&
55
- node.offsetParent.offsetWidth &&
56
- node.offsetParent.offsetWidth > 0
57
- ) {
58
- const { offsetParent } = node;
59
- const style = el.ownerDocument.defaultView.getComputedStyle(offsetParent);
60
- let width = offsetParent.clientWidth - IMAGE_MARGIN * 2;
61
- if (style.boxSizing === 'border-box') {
62
- const pl = parseInt(style.paddingLeft, 10);
63
- const pr = parseInt(style.paddingRight, 10);
64
- width -= pl + pr;
65
- }
66
- return Math.max(width, MIN_SIZE);
67
- }
68
- // Let the image resize freely.
69
- return MAX_SIZE;
70
- }
71
-
72
- async function resolveURL(runtime: ?EditorRuntime, src: ?string): ?string {
73
- if (!runtime) {
74
- return src;
75
- }
76
- const { canProxyImageSrc, getProxyImageSrc } = runtime;
77
- if (src && canProxyImageSrc && getProxyImageSrc && canProxyImageSrc(src)) {
78
- return await getProxyImageSrc(src);
79
- }
80
- return src;
81
- }
82
-
83
- class ImageViewBody extends React.PureComponent<any, any> {
84
- props: NodeViewProps;
85
-
86
- _body = null;
87
- _id = uuid();
88
- _inlineEditor = null;
89
- _mounted = false;
90
-
91
- state = {
92
- maxSize: {
93
- width: MAX_SIZE,
94
- height: MAX_SIZE,
95
- complete: false,
96
- },
97
- originalSize: DEFAULT_ORIGINAL_SIZE,
98
- };
99
-
100
- componentDidMount(): void {
101
- this._mounted = true;
102
- this._resolveOriginalSize();
103
- this._renderInlineEditor();
104
- }
105
-
106
- componentWillUnmount(): void {
107
- this._mounted = false;
108
- this._inlineEditor && this._inlineEditor.close();
109
- this._inlineEditor = null;
110
- }
111
-
112
- componentDidUpdate(prevProps: NodeViewProps): void {
113
- const prevSrc = prevProps.node.attrs.src;
114
- const { node } = this.props;
115
- const { src } = node.attrs;
116
- if (prevSrc !== src) {
117
- // A new image is provided, resolve it.
118
- this._resolveOriginalSize();
119
- }
120
- this._renderInlineEditor();
121
- }
122
-
123
- render(): React.Element<any> {
124
- const { originalSize, maxSize } = this.state;
125
- const { editorView, node, selected, focused } = this.props;
126
- const { readOnly } = editorView;
127
- const { attrs } = node;
128
- const { align, crop, rotate } = attrs;
129
-
130
- // It's only active when the image's fully loaded.
131
- const loading = originalSize === DEFAULT_ORIGINAL_SIZE;
132
- const active = !loading && focused && !readOnly && originalSize.complete;
133
- const src = originalSize.complete ? originalSize.src : EMPTY_SRC;
134
- const aspectRatio = loading ? 1 : originalSize.width / originalSize.height;
135
- const error = !loading && !originalSize.complete;
136
-
137
- let { width, height } = attrs;
138
-
139
- if (loading) {
140
- width = width || IMAGE_PLACEHOLDER_SIZE;
141
- height = height || IMAGE_PLACEHOLDER_SIZE;
142
- }
143
-
144
- if (width && !height) {
145
- height = width / aspectRatio;
146
- } else if (height && !width) {
147
- width = height * aspectRatio;
148
- } else if (!width && !height) {
149
- width = originalSize.width;
150
- height = originalSize.height;
151
- }
152
-
153
- let scale = 1;
154
- if (width > maxSize.width && (!crop || crop.width > maxSize.width)) {
155
- // Scale image to fit its containing space.
156
- // If the image is not cropped.
157
- width = maxSize.width;
158
- height = width / aspectRatio;
159
- scale = maxSize.width / width;
160
- }
161
-
162
- const className = cx('czi-image-view-body', {
163
- active,
164
- error,
165
- focused,
166
- loading,
167
- selected,
168
- });
169
-
170
- const resizeBox =
171
- active && !crop && !rotate ? (
172
- <ImageResizeBox
173
- height={height}
174
- onResizeEnd={this._onResizeEnd}
175
- src={src}
176
- width={width}
177
- />
178
- ) : null;
179
-
180
- const imageStyle: Object = {
181
- display: 'inline-block',
182
- height: height + 'px',
183
- left: '0',
184
- top: '0',
185
- width: width + 'px',
186
- position: 'relative',
187
- };
188
-
189
- const clipStyle: Object = {};
190
- if (crop) {
191
- const cropped = { ...crop };
192
- if (scale !== 1) {
193
- scale = maxSize.width / cropped.width;
194
- cropped.width *= scale;
195
- cropped.height *= scale;
196
- cropped.left *= scale;
197
- cropped.top *= scale;
198
- }
199
- clipStyle.width = cropped.width + 'px';
200
- clipStyle.height = cropped.height + 'px';
201
- imageStyle.left = cropped.left + 'px';
202
- imageStyle.top = cropped.top + 'px';
203
- }
204
-
205
- if (rotate) {
206
- clipStyle.transform = `rotate(${rotate}rad)`;
207
- }
208
-
209
- const errorView = error ? Icon.get('error') : null;
210
- const errorTitle = error
211
- ? `Unable to load image from ${attrs.src || ''}`
212
- : undefined;
213
-
214
- return (
215
- <span
216
- className={className}
217
- data-active={active ? 'true' : undefined}
218
- data-original-src={String(attrs.src)}
219
- id={this._id}
220
- ref={this._onBodyRef}
221
- title={errorTitle}
222
- >
223
- <span className="czi-image-view-body-img-clip" style={clipStyle}>
224
- <span style={imageStyle}>
225
- <img
226
- alt=""
227
- className="czi-image-view-body-img"
228
- data-align={align}
229
- height={height}
230
- id={`${this._id}-img`}
231
- src={src}
232
- width={width}
233
- />
234
- {errorView}
235
- </span>
236
- </span>
237
- {resizeBox}
238
- </span>
239
- );
240
- }
241
-
242
- _renderInlineEditor(): void {
243
- const el = document.getElementById(this._id);
244
- if (!el || el.getAttribute('data-active') !== 'true') {
245
- this._inlineEditor && this._inlineEditor.close();
246
- return;
247
- }
248
-
249
- const { node } = this.props;
250
- const editorProps = {
251
- value: node.attrs,
252
- onSelect: this._onChange,
253
- };
254
- if (this._inlineEditor) {
255
- this._inlineEditor.update(editorProps);
256
- } else {
257
- this._inlineEditor = createPopUp(ImageInlineEditor, editorProps, {
258
- anchor: el,
259
- autoDismiss: false,
260
- container: el.closest(`.${FRAMESET_BODY_CLASSNAME}`),
261
- position: atAnchorBottomCenter,
262
- onClose: () => {
263
- this._inlineEditor = null;
264
- },
265
- });
266
- }
267
- }
268
-
269
- _resolveOriginalSize = async (): Promise<void> => {
270
- if (!this._mounted) {
271
- // unmounted;
272
- return;
273
- }
274
-
275
- this.setState({ originalSize: DEFAULT_ORIGINAL_SIZE });
276
- const src = this.props.node.attrs.src;
277
- const url = await resolveURL(this.props.editorView.runtime, src);
278
- const originalSize = await resolveImage(url);
279
- if (!this._mounted) {
280
- // unmounted;
281
- return;
282
- }
283
- if (this.props.node.attrs.src !== src) {
284
- // src had changed.
285
- return;
286
- }
287
- if (!originalSize.complete) {
288
- originalSize.width = MIN_SIZE;
289
- originalSize.height = MIN_SIZE;
290
- }
291
- this.setState({ originalSize });
292
- };
293
-
294
- _onResizeEnd = (width: number, height: number): void => {
295
- const { getPos, node, editorView } = this.props;
296
- const pos = getPos();
297
- const attrs = {
298
- ...node.attrs,
299
- // TODO: Support UI for cropping later.
300
- crop: null,
301
- width,
302
- height,
303
- };
304
-
305
- let tr = editorView.state.tr;
306
- const { selection } = editorView.state;
307
- tr = tr.setNodeMarkup(pos, null, attrs);
308
- // [FS] IRAD-1005 2020-07-09
309
- // Upgrade outdated packages.
310
- // reset selection to original using the latest doc.
311
- const origSelection = NodeSelection.create(tr.doc, selection.from);
312
- tr = tr.setSelection(origSelection);
313
- editorView.dispatch(tr);
314
- };
315
-
316
- _onChange = (value: ?{ align: ?string }): void => {
317
- if (!this._mounted) {
318
- return;
319
- }
320
-
321
- const align = value ? value.align : null;
322
- const { getPos, node, editorView } = this.props;
323
- const pos = getPos();
324
- const attrs = {
325
- ...node.attrs,
326
- align,
327
- };
328
-
329
- let tr = editorView.state.tr;
330
- const { selection } = editorView.state;
331
- tr = tr.setNodeMarkup(pos, null, attrs);
332
- // [FS] IRAD-1005 2020-07-09
333
- // Upgrade outdated packages.
334
- // reset selection to original using the latest doc.
335
- const origSelection = NodeSelection.create(tr.doc, selection.from);
336
- tr = tr.setSelection(origSelection);
337
- editorView.dispatch(tr);
338
- };
339
-
340
- _onBodyRef = (ref: any): void => {
341
- if (ref) {
342
- this._body = ref;
343
- // Mounting
344
- const el = ReactDOM.findDOMNode(ref);
345
- if (el instanceof HTMLElement) {
346
- ResizeObserver.observe(el, this._onBodyResize);
347
- }
348
- } else {
349
- // Unmounting.
350
- const el = this._body && ReactDOM.findDOMNode(this._body);
351
- if (el instanceof HTMLElement) {
352
- ResizeObserver.unobserve(el);
353
- }
354
- this._body = null;
355
- }
356
- };
357
-
358
- _onBodyResize = (info: ResizeObserverEntry): void => {
359
- const width = this._body
360
- ? getMaxResizeWidth(ReactDOM.findDOMNode(this._body))
361
- : MAX_SIZE;
362
-
363
- this.setState({
364
- maxSize: {
365
- width,
366
- height: MAX_SIZE,
367
- complete: !!this._body,
368
- },
369
- });
370
- };
371
- }
372
-
373
- class ImageNodeView extends CustomNodeView {
374
- // @override
375
- createDOMElement(): HTMLElement {
376
- const el = document.createElement('span');
377
- el.className = 'czi-image-view';
378
- this._updateDOM(el);
379
- return el;
380
- }
381
-
382
- // @override
383
- update(node: Node, decorations: Array<Decoration>): boolean {
384
- super.update(node, decorations);
385
- this._updateDOM(this.dom);
386
- return true;
387
- }
388
-
389
- // @override
390
- renderReactComponent(): React.Element<any> {
391
- return <ImageViewBody {...this.props} />;
392
- }
393
-
394
- _updateDOM(el: HTMLElement): void {
395
- const { align } = this.props.node.attrs;
396
- let className = 'czi-image-view';
397
- if (align) {
398
- className += ' align-' + align;
399
- }
400
- el.className = className;
401
- }
402
- }
403
-
404
- export default ImageNodeView;
@@ -1,206 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.MIN_SIZE = exports.MAX_SIZE = void 0;
7
- var _classnames = _interopRequireDefault(require("classnames"));
8
- var _nullthrows = _interopRequireDefault(require("nullthrows"));
9
- var React = _interopRequireWildcard(require("react"));
10
- var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
11
- var _uuid = _interopRequireDefault(require("./uuid"));
12
- require("./czi-image-resize-box.css");
13
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
19
- const MIN_SIZE = 20;
20
- exports.MIN_SIZE = MIN_SIZE;
21
- const MAX_SIZE = 10000;
22
- exports.MAX_SIZE = MAX_SIZE;
23
- function setWidth(el, width, height) {
24
- el.style.width = width + 'px';
25
- }
26
- function setHeight(el, width, height) {
27
- el.style.height = height + 'px';
28
- }
29
- function setSize(el, width, height) {
30
- el.style.width = Math.round(width) + 'px';
31
- el.style.height = Math.round(height) + 'px';
32
- }
33
- const ResizeDirection = {
34
- top: setHeight,
35
- top_right: setSize,
36
- right: setWidth,
37
- bottom_right: setSize,
38
- bottom: setHeight,
39
- bottom_left: setSize,
40
- left: setWidth,
41
- top_left: setSize
42
- };
43
- class ImageResizeBoxControl extends React.PureComponent {
44
- constructor() {
45
- super(...arguments);
46
- _defineProperty(this, "props", void 0);
47
- _defineProperty(this, "_active", false);
48
- _defineProperty(this, "_el", null);
49
- _defineProperty(this, "_h", '');
50
- _defineProperty(this, "_rafID", 0);
51
- _defineProperty(this, "_w", '');
52
- _defineProperty(this, "_x1", 0);
53
- _defineProperty(this, "_x2", 0);
54
- _defineProperty(this, "_y1", 0);
55
- _defineProperty(this, "_y2", 0);
56
- _defineProperty(this, "_ww", 0);
57
- _defineProperty(this, "_hh", 0);
58
- _defineProperty(this, "_syncSize", () => {
59
- if (!this._active) {
60
- return;
61
- }
62
- const {
63
- direction,
64
- width,
65
- height
66
- } = this.props;
67
- const dx = (this._x2 - this._x1) * (/left/.test(direction) ? -1 : 1);
68
- const dy = (this._y2 - this._y1) * (/top/.test(direction) ? -1 : 1);
69
- const el = (0, _nullthrows.default)(this._el);
70
- const fn = (0, _nullthrows.default)(ResizeDirection[direction]);
71
- const aspect = width / height;
72
- let ww = (0, _licitUiCommands.clamp)(MIN_SIZE, width + Math.round(dx), MAX_SIZE);
73
- let hh = (0, _licitUiCommands.clamp)(MIN_SIZE, height + Math.round(dy), MAX_SIZE);
74
- if (fn === setSize) {
75
- hh = Math.max(ww / aspect, MIN_SIZE);
76
- ww = hh * aspect;
77
- }
78
- fn(el, Math.round(ww), Math.round(hh));
79
- this._ww = ww;
80
- this._hh = hh;
81
- });
82
- _defineProperty(this, "_onMouseDown", e => {
83
- e.preventDefault();
84
- e.stopPropagation();
85
- this._end();
86
- this._start(e);
87
- });
88
- _defineProperty(this, "_onMouseMove", e => {
89
- e.preventDefault();
90
- e.stopPropagation();
91
- this._x2 = e.clientX;
92
- this._y2 = e.clientY;
93
- this._rafID = requestAnimationFrame(this._syncSize);
94
- });
95
- _defineProperty(this, "_onMouseUp", e => {
96
- e.preventDefault();
97
- e.stopPropagation();
98
- this._x2 = e.clientX;
99
- this._y2 = e.clientY;
100
- const {
101
- direction
102
- } = this.props;
103
- const el = (0, _nullthrows.default)(this._el);
104
- el.classList.remove(direction);
105
- this._end();
106
- this.props.onResizeEnd(this._ww, this._hh);
107
- });
108
- }
109
- componentWillUnmount() {
110
- this._end();
111
- }
112
- render() {
113
- const {
114
- direction
115
- } = this.props;
116
- const className = (0, _classnames.default)({
117
- 'czi-image-resize-box-control': true,
118
- [direction]: true
119
- });
120
- return /*#__PURE__*/React.createElement("span", {
121
- className: className,
122
- onMouseDown: this._onMouseDown
123
- });
124
- }
125
- _start(e) {
126
- if (this._active) {
127
- this._end();
128
- }
129
- this._active = true;
130
- const {
131
- boxID,
132
- direction,
133
- width,
134
- height
135
- } = this.props;
136
- const el = (0, _nullthrows.default)(document.getElementById(boxID));
137
- el.className += ' ' + direction;
138
- this._el = el;
139
- this._x1 = e.clientX;
140
- this._y1 = e.clientY;
141
- this._x2 = this._x1;
142
- this._y2 = this._y1;
143
- this._w = this._el.style.width;
144
- this._h = this._el.style.height;
145
- this._ww = width;
146
- this._hh = height;
147
- document.addEventListener('mousemove', this._onMouseMove, true);
148
- document.addEventListener('mouseup', this._onMouseUp, true);
149
- }
150
- _end() {
151
- if (!this._active) {
152
- return;
153
- }
154
- this._active = false;
155
- document.removeEventListener('mousemove', this._onMouseMove, true);
156
- document.removeEventListener('mouseup', this._onMouseUp, true);
157
- const el = (0, _nullthrows.default)(this._el);
158
- el.style.width = this._w;
159
- el.style.height = this._h;
160
- el.className = 'czi-image-resize-box';
161
- this._el = null;
162
- this._rafID && cancelAnimationFrame(this._rafID);
163
- this._rafID = null;
164
- }
165
- }
166
- class ImageResizeBox extends React.PureComponent {
167
- constructor() {
168
- super(...arguments);
169
- _defineProperty(this, "props", void 0);
170
- _defineProperty(this, "_id", (0, _uuid.default)());
171
- }
172
- render() {
173
- const {
174
- onResizeEnd,
175
- width,
176
- height,
177
- src
178
- } = this.props;
179
- const style = {
180
- height: height + 'px',
181
- width: width + 'px'
182
- };
183
- const boxID = this._id;
184
- const controls = Object.keys(ResizeDirection).map(key => {
185
- return /*#__PURE__*/React.createElement(ImageResizeBoxControl, {
186
- boxID: boxID,
187
- config: ResizeDirection[key],
188
- direction: key,
189
- height: height,
190
- key: key,
191
- onResizeEnd: onResizeEnd,
192
- width: width
193
- });
194
- });
195
- return /*#__PURE__*/React.createElement("span", {
196
- className: "czi-image-resize-box",
197
- id: boxID,
198
- style: style
199
- }, controls, /*#__PURE__*/React.createElement("img", {
200
- className: "czi-image-resize-box-image",
201
- src: src
202
- }));
203
- }
204
- }
205
- var _default = ImageResizeBox;
206
- exports.default = _default;