@lvce-editor/editor-worker 18.14.0 → 18.15.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.
@@ -6132,7 +6132,17 @@ const handleTripleClick = (editor, modifier, x, y) => {
6132
6132
  return selectLine(editor);
6133
6133
  };
6134
6134
 
6135
- const handleMouseDown = (state, modifier, x, y, detail) => {
6135
+ const getModifier = (altKey, ctrlKey) => {
6136
+ if (altKey) {
6137
+ return Alt;
6138
+ }
6139
+ if (ctrlKey) {
6140
+ return Ctrl;
6141
+ }
6142
+ return 0;
6143
+ };
6144
+ const handleMouseDown = (state, button, altKey, ctrlKey, x, y, detail) => {
6145
+ const modifier = getModifier(altKey, ctrlKey);
6136
6146
  switch (detail) {
6137
6147
  case Double:
6138
6148
  return handleDoubleClick(state, modifier, x, y);
@@ -6341,20 +6351,8 @@ const handlePointerCaptureLost = editor => {
6341
6351
  return editor;
6342
6352
  };
6343
6353
 
6344
- const handlePointerDown$1 = (state, button, altKey, ctrlKey, x, y, detail) => {
6345
- const modifier = 0;
6346
- const clickDetail = Single; // TODO
6347
- // console.log({ detail })
6348
- switch (clickDetail) {
6349
- case Double:
6350
- return handleDoubleClick(state, modifier, x, y);
6351
- case Single:
6352
- return handleSingleClick(state, modifier, x, y);
6353
- case Triple:
6354
- return handleTripleClick(state, modifier, x, y);
6355
- default:
6356
- return state;
6357
- }
6354
+ const handlePointerDown$1 = state => {
6355
+ return state;
6358
6356
  };
6359
6357
 
6360
6358
  const moveRectangleSelection = (editor, position) => {
@@ -9560,6 +9558,7 @@ const HandleCompositionUpdate = 12;
9560
9558
  const HandleContextMenu = 13;
9561
9559
  const HandleCut = 14;
9562
9560
  const HandleFocus = 15;
9561
+ const HandleMouseDown = 18;
9563
9562
  const HandleMouseMove = 19;
9564
9563
  const HandlePaste = 20;
9565
9564
  const HandlePointerDown = 21;
@@ -11590,7 +11589,7 @@ const getEditorVirtualDom = ({
11590
11589
  }, ...selectionsDom, {
11591
11590
  childCount: textInfos.length,
11592
11591
  className: 'EditorRows',
11593
- // onMouseDown: DomEventListenerFunctions.HandleMouseDown,
11592
+ onMouseDown: HandleMouseDown,
11594
11593
  onPointerDown: HandlePointerDown,
11595
11594
  type: Div
11596
11595
  }, ...rowsDom, {
@@ -11914,9 +11913,12 @@ const renderEventListeners = () => {
11914
11913
  name: HandlePaste,
11915
11914
  params: ['paste', 'event.clipboardData ? event.clipboardData.getData("text/plain") : ""'],
11916
11915
  preventDefault: true
11916
+ }, {
11917
+ name: HandleMouseDown,
11918
+ params: ['handleMouseDown', 'event.button', 'event.altKey', 'event.ctrlKey', ClientX, ClientY, 'event.detail']
11917
11919
  }, {
11918
11920
  name: HandlePointerDown,
11919
- params: ['handlePointerDown', 'event.button', 'event.altKey', 'event.ctrlKey', ClientX, ClientY],
11921
+ params: ['handlePointerDown', 'event.button', 'event.altKey', 'event.ctrlKey', ClientX, ClientY, 'event.detail'],
11920
11922
  trackPointerEvents: [HandlePointerMove, HandlePointerUp]
11921
11923
  }, {
11922
11924
  name: HandlePointerMove,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "18.14.0",
3
+ "version": "18.15.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"