@lvce-editor/renderer-process 10.29.0 → 10.31.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.
@@ -2074,7 +2074,7 @@ const handleContextMenu$c = forwardViewletCommand('handleContextMenu');
2074
2074
  const handleDoubleClick = forwardViewletCommand('handleDoubleClick');
2075
2075
  const handleDragEnd$1 = forwardViewletCommand('handleDragEnd');
2076
2076
  const handleDragLeave$1 = forwardViewletCommand('handleDragLeave');
2077
- const handleDragOver$1 = forwardViewletCommand('handleDragOver');
2077
+ const handleDragOver$2 = forwardViewletCommand('handleDragOver');
2078
2078
  forwardViewletCommand('handleDrop');
2079
2079
  const handleDropFilePath = forwardViewletCommand('handleDropFilePath');
2080
2080
  const handleDropFiles = forwardViewletCommand('handleDrop');
@@ -2113,10 +2113,12 @@ forwardViewletCommand('handleScrollBarVerticalPointerDown');
2113
2113
  forwardViewletCommand('handleSliderPointerDown');
2114
2114
  forwardViewletCommand('handleSliderPointerMove');
2115
2115
  const handleTabClick = forwardViewletCommand('handleTabClick');
2116
+ const handleTabDrop = forwardViewletCommand('handleTabDrop');
2116
2117
  const handleTabContextMenu = forwardViewletCommand('handleTabContextMenu');
2117
2118
  forwardViewletCommand('handleTabsPointerOut');
2118
2119
  forwardViewletCommand('handleTabsPointerOver');
2119
2120
  const handleTabsWheel$1 = forwardViewletCommand('handleTabsWheel');
2121
+ const handleTabsDragOver = forwardViewletCommand('handleTabsDragOver');
2120
2122
  const handleTouchEnd$1 = forwardViewletCommand('handleTouchEnd');
2121
2123
  const handleTouchMove$1 = forwardViewletCommand('handleTouchMove');
2122
2124
  const handleTouchStart$1 = forwardViewletCommand('handleTouchStart');
@@ -5881,8 +5883,11 @@ const create$x = (id, uid = id) => {
5881
5883
  factory: module
5882
5884
  };
5883
5885
  };
5884
- const createFunctionalRoot = (id, uid = id) => {
5885
- const module = state$6.modules[id];
5886
+ const createFunctionalRoot = (id, uid = id, hasFunctionalEvents) => {
5887
+ let module = state$6.modules[id];
5888
+ if (hasFunctionalEvents) {
5889
+ module = {};
5890
+ }
5886
5891
  if (!module) {
5887
5892
  throw new Error(`module not found: ${id}`);
5888
5893
  }
@@ -7776,7 +7781,7 @@ const setSelections$1 = (state, cursorInfos, selectionInfos) => {
7776
7781
  setCursors(state, cursorInfos);
7777
7782
  setSelections$2(state, selectionInfos);
7778
7783
  };
7779
- const setFocused$3 = async (state, isFocused) => {
7784
+ const setFocused$2 = async (state, isFocused) => {
7780
7785
  const {
7781
7786
  $EditorInput
7782
7787
  } = state;
@@ -7833,8 +7838,8 @@ const hideOverlayMessage = state => {
7833
7838
  }
7834
7839
  }
7835
7840
  };
7836
- const setFocused$2 = setFocused$3;
7837
- const focus$e = setFocused$3;
7841
+ const setFocused$1 = setFocused$2;
7842
+ const focus$e = setFocused$2;
7838
7843
  const setDecorationsDom = setDecorationsDom$1;
7839
7844
 
7840
7845
  const ViewletEditorText = {
@@ -7846,7 +7851,7 @@ const ViewletEditorText = {
7846
7851
  highlightAsLink,
7847
7852
  renderGutter,
7848
7853
  setDecorationsDom,
7849
- setFocused: setFocused$2,
7854
+ setFocused: setFocused$1,
7850
7855
  setIncrementalEdits,
7851
7856
  setScrollBar,
7852
7857
  setScrollBarHorizontal,
@@ -7984,21 +7989,26 @@ const handleDragStart$1 = event => {
7984
7989
  dataTransfer,
7985
7990
  target
7986
7991
  } = event;
7992
+ // @ts-ignore
7987
7993
  setEffectAllowed(dataTransfer, CopyMove);
7994
+
7995
+ // @ts-ignore
7988
7996
  if (target.classList.contains('TreeItem')) {
7997
+ // @ts-ignore
7989
7998
  const filePath = target.title;
7999
+ // @ts-ignore
7990
8000
  const fileName = target.textContent;
7991
8001
  setFilePath(dataTransfer, filePath, fileName);
7992
8002
  }
7993
8003
  };
7994
- const handleDragOver = event => {
8004
+ const handleDragOver$1 = event => {
7995
8005
  preventDefault(event);
7996
8006
  const {
7997
8007
  clientX,
7998
8008
  clientY
7999
8009
  } = event;
8000
8010
  const uid = fromEvent(event);
8001
- handleDragOver$1(uid, clientX, clientY);
8011
+ handleDragOver$2(uid, clientX, clientY);
8002
8012
  };
8003
8013
  const handleDragEnd = event => {
8004
8014
  const {
@@ -8021,7 +8031,7 @@ const handleDragLeave = event => {
8021
8031
  *
8022
8032
  * @param {DragEvent} event
8023
8033
  */
8024
- const handleDrop = event => {
8034
+ const handleDrop$1 = event => {
8025
8035
  preventDefault(event);
8026
8036
  const {
8027
8037
  dataTransfer,
@@ -8125,9 +8135,9 @@ const ViewletExplorerEvents = {
8125
8135
  handleContextMenu: handleContextMenu$7,
8126
8136
  handleDragEnd,
8127
8137
  handleDragLeave,
8128
- handleDragOver,
8138
+ handleDragOver: handleDragOver$1,
8129
8139
  handleDragStart: handleDragStart$1,
8130
- handleDrop,
8140
+ handleDrop: handleDrop$1,
8131
8141
  handleEditingInput,
8132
8142
  handleFocus: handleFocus$6,
8133
8143
  handleMouseEnter,
@@ -9268,8 +9278,8 @@ const attachEvents$5 = state => {
9268
9278
  $Viewlet
9269
9279
  } = state;
9270
9280
  attachEvents$c($Viewlet, {
9271
- [Drop]: handleDrop,
9272
- [DragOver]: handleDragOver,
9281
+ [Drop]: handleDrop$1,
9282
+ [DragOver]: handleDragOver$1,
9273
9283
  [DragEnd]: handleDragEnd,
9274
9284
  [DragLeave]: handleDragLeave,
9275
9285
  [ContextMenu]: handleContextMenu$6
@@ -9369,7 +9379,36 @@ const handleTabsWheel = event => {
9369
9379
  handleTabsWheel$1(uid, deltaX, deltaY);
9370
9380
  };
9371
9381
  const handleDragStart = event => {
9372
- setEffectAllowed(event.dataTransfer, CopyMove);
9382
+ const {
9383
+ target,
9384
+ dataTransfer
9385
+ } = event;
9386
+ setEffectAllowed(dataTransfer, CopyMove);
9387
+ dataTransfer.setData('x-lvce-drag', target.dataset.dragUid);
9388
+ };
9389
+ const handleDragOver = event => {
9390
+ const {
9391
+ clientX,
9392
+ clientY
9393
+ } = event;
9394
+ const uid = getUid();
9395
+ handleTabsDragOver(uid, clientX, clientY);
9396
+ };
9397
+
9398
+ /**
9399
+ *
9400
+ * @param {DragEvent} event
9401
+ */
9402
+ const handleDrop = event => {
9403
+ preventDefault(event);
9404
+ const {
9405
+ dataTransfer,
9406
+ clientX,
9407
+ clientY
9408
+ } = event;
9409
+ const item = dataTransfer.getData('x-lvce-drag');
9410
+ const uid = getUid();
9411
+ handleTabDrop(uid, item, clientX, clientY);
9373
9412
  };
9374
9413
  const handleTabsMouseDown = event => {
9375
9414
  const {
@@ -9405,9 +9444,11 @@ const attachEvents$4 = state => {
9405
9444
  $MainTabs
9406
9445
  } = state;
9407
9446
  attachEvents$c($MainTabs, {
9408
- [MouseDown]: handleTabsMouseDown,
9409
9447
  [ContextMenu]: handleTabsContextMenu,
9410
- [DragStart]: handleDragStart
9448
+ [DragOver]: handleDragOver,
9449
+ [DragStart]: handleDragStart,
9450
+ [Drop]: handleDrop,
9451
+ [MouseDown]: handleTabsMouseDown
9411
9452
  });
9412
9453
  $MainTabs.addEventListener(Wheel, handleTabsWheel, Passive);
9413
9454
  };
@@ -9423,11 +9464,22 @@ const setScrollLeft = (state, scrollLeft) => {
9423
9464
  } = state;
9424
9465
  $Viewlet.scrollLeft = scrollLeft;
9425
9466
  };
9467
+ const setHighlight = (state, highlightLeft) => {
9468
+ const $ExistingHighlight = state.$Viewlet.querySelector('.TabDragHighlight');
9469
+ if ($ExistingHighlight) {
9470
+ $ExistingHighlight.remove();
9471
+ }
9472
+ const $Highlight = document.createElement('div');
9473
+ $Highlight.className = 'TabDragHighlight';
9474
+ $Highlight.style.left = `${highlightLeft}px`;
9475
+ state.$Viewlet.append($Highlight);
9476
+ };
9426
9477
 
9427
9478
  const ViewletMainTabs = {
9428
9479
  __proto__: null,
9429
9480
  attachEvents: attachEvents$4,
9430
9481
  create: create$e,
9482
+ setHighlight,
9431
9483
  setScrollLeft,
9432
9484
  setTabsDom: setTabsDom$2
9433
9485
  };
@@ -11002,7 +11054,7 @@ const attachEvents = state => {
11002
11054
  });
11003
11055
  };
11004
11056
  const activeClassName = 'TitleBarActive';
11005
- const setFocused$1 = (state, isFocused) => {
11057
+ const setFocused = (state, isFocused) => {
11006
11058
  const {
11007
11059
  $Viewlet
11008
11060
  } = state;
@@ -11017,7 +11069,7 @@ const ViewletTitleBar = {
11017
11069
  __proto__: null,
11018
11070
  attachEvents,
11019
11071
  create: create$3,
11020
- setFocused: setFocused$1
11072
+ setFocused
11021
11073
  };
11022
11074
 
11023
11075
  /**
@@ -11444,25 +11496,11 @@ const ViewletTitleBarTitle = {
11444
11496
  setDom
11445
11497
  };
11446
11498
 
11447
- const setFocused = (state, selector) => {
11448
- if (selector === true) {
11449
- selector = 'button';
11450
- }
11451
- if (!selector) {
11452
- return;
11453
- }
11454
- const {
11455
- $Viewlet
11456
- } = state;
11457
- const $Focusable = $Viewlet.querySelector(selector);
11458
- $Focusable.focus();
11459
- };
11460
11499
  const Events = {};
11461
11500
 
11462
11501
  const ViewletAbout = {
11463
11502
  __proto__: null,
11464
- Events,
11465
- setFocused
11503
+ Events
11466
11504
  };
11467
11505
 
11468
11506
  const create$1 = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "10.29.0",
3
+ "version": "10.31.0",
4
4
  "description": "",
5
5
  "main": "dist/rendererProcessMain.js",
6
6
  "type": "module",