@pie-element/drawing-response 11.0.0-next.43 → 11.1.2-next.1

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.
@@ -219,7 +219,6 @@ export default class TextDrawable {
219
219
  };
220
220
 
221
221
  newStage.on('click', stageClickHandler);
222
-
223
222
  this.eventListenersDetachArray.push(() => newStage.off('click', stageClickHandler));
224
223
  }
225
224
 
@@ -241,11 +240,38 @@ export default class TextDrawable {
241
240
  onDblTap: (e) => this.handleDblClick(e, text),
242
241
  onTransform: (e) => this.handleTransform(e, textNode),
243
242
  onTransformEnd: this.props.handleSessionChange,
244
- onMouseDown: this.handleMouseDown,
245
- onTouchStart: this.handleMouseDown,
246
- onMouseUp: this.handleMouseUp,
247
- onTouchEnd: this.handleMouseUp,
248
- onDragEnd: this.props.handleSessionChange,
243
+
244
+ onMouseDown: (e) => {
245
+ e.cancelBubble = true;
246
+ this.props.toggleTextSelected(true);
247
+ },
248
+ onTouchStart: (e) => {
249
+ e.cancelBubble = true;
250
+ this.props.toggleTextSelected(true);
251
+ },
252
+
253
+ onDragStart: (e) => {
254
+ e.cancelBubble = true;
255
+ this.props.toggleTextSelected(true);
256
+ },
257
+ onDragMove: (e) => {
258
+ e.cancelBubble = true;
259
+ },
260
+ onDragEnd: (e) => {
261
+ e.cancelBubble = true;
262
+ this.props.toggleTextSelected(false);
263
+ this.props.handleSessionChange();
264
+ },
265
+
266
+ onMouseUp: (e) => {
267
+ e.cancelBubble = true;
268
+ this.props.toggleTextSelected(false);
269
+ },
270
+ onTouchEnd: (e) => {
271
+ e.cancelBubble = true;
272
+ this.props.toggleTextSelected(false);
273
+ },
274
+
249
275
  onMouseEnter: this.props.onMouseOverElement,
250
276
  onMouseLeave: this.props.onMouseOutElement,
251
277
  };
@@ -289,4 +315,4 @@ export default class TextDrawable {
289
315
  ];
290
316
  });
291
317
  }
292
- }
318
+ }
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { createRoot } from 'react-dom/client';
3
- import isEmpty from 'lodash/isEmpty';
3
+ import { isEmpty } from 'lodash-es';
4
4
  import { renderMath } from '@pie-lib/math-rendering';
5
5
  import { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';
6
6