@lvce-editor/renderer-process 13.3.0 → 13.4.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.
@@ -1580,6 +1580,8 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
1580
1580
  case 'onInput':
1581
1581
  case 'onKeyDown':
1582
1582
  case 'onMouseDown':
1583
+ case 'onMouseOver':
1584
+ case 'onMouseOut':
1583
1585
  case 'onPointerDown':
1584
1586
  case 'onPointerOut':
1585
1587
  case 'onPointerOver':
@@ -1800,8 +1802,15 @@ const getEventListenerArgs = (params, event) => {
1800
1802
  }
1801
1803
  return serialized;
1802
1804
  };
1805
+ const isInputElement = element => {
1806
+ return element instanceof HTMLInputElement;
1807
+ };
1803
1808
  const preventEventsMaybe = (info, event) => {
1804
- if (info.preventDefault) {
1809
+ if (info.preventDefault === 2) {
1810
+ if (!isInputElement(event.target)) {
1811
+ event.preventDefault();
1812
+ }
1813
+ } else if (info.preventDefault) {
1805
1814
  event.preventDefault();
1806
1815
  }
1807
1816
  if (info.stopPropagation) {
@@ -1842,6 +1851,19 @@ const getEventListenerMap = id => {
1842
1851
  const map = listeners[id];
1843
1852
  return map;
1844
1853
  };
1854
+ const getActiveElementInside = $Viewlet => {
1855
+ if (!$Viewlet) {
1856
+ return undefined;
1857
+ }
1858
+ const $ActiveElement = document.activeElement;
1859
+ if (!$ActiveElement) {
1860
+ return undefined;
1861
+ }
1862
+ if (!$Viewlet.contains($ActiveElement)) {
1863
+ return undefined;
1864
+ }
1865
+ return $ActiveElement;
1866
+ };
1845
1867
  const queryInputs = $Viewlet => {
1846
1868
  return [...$Viewlet.querySelectorAll('input, textarea')];
1847
1869
  };
@@ -1869,9 +1891,7 @@ const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
1869
1891
  const oldTop = $Viewlet.style.top;
1870
1892
  const oldWidth = $Viewlet.style.width;
1871
1893
  const oldHeight = $Viewlet.style.height;
1872
- const {
1873
- activeElement
1874
- } = document;
1894
+ const activeElement = getActiveElementInside($Viewlet);
1875
1895
  const isTreeFocused = activeElement?.getAttribute('role') === 'tree';
1876
1896
  const isRootTree = $Viewlet.getAttribute('role') === 'tree' && activeElement === $Viewlet;
1877
1897
  const focused = activeElement?.getAttribute('name');
@@ -3451,7 +3471,7 @@ main();
3451
3471
  const Message = 'message';
3452
3472
  const Error$1 = 'error';
3453
3473
 
3454
- const withResolvers$1 = () => {
3474
+ const withResolvers = () => {
3455
3475
  /**
3456
3476
  * @type {any}
3457
3477
  */
@@ -3475,7 +3495,7 @@ const getFirstEvent = (eventTarget, eventMap) => {
3475
3495
  const {
3476
3496
  resolve,
3477
3497
  promise
3478
- } = withResolvers$1();
3498
+ } = withResolvers();
3479
3499
  const listenerMap = Object.create(null);
3480
3500
  const cleanup = value => {
3481
3501
  for (const event of Object.keys(eventMap)) {
@@ -4130,22 +4150,11 @@ const IpcChildWithModuleWorker$1 = {
4130
4150
  signal: signal$8,
4131
4151
  wrap: wrap$f
4132
4152
  };
4133
- const withResolvers = () => {
4134
- let _resolve;
4135
- const promise = new Promise(resolve => {
4136
- _resolve = resolve;
4137
- });
4138
- return {
4139
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
4140
- resolve: _resolve,
4141
- promise
4142
- };
4143
- };
4144
4153
  const waitForFirstMessage = async port => {
4145
4154
  const {
4146
4155
  resolve,
4147
4156
  promise
4148
- } = withResolvers();
4157
+ } = Promise.withResolvers();
4149
4158
  port.addEventListener('message', resolve, {
4150
4159
  once: true
4151
4160
  });
@@ -10929,7 +10938,7 @@ const waitForFrameToLoad = $Frame => {
10929
10938
  const {
10930
10939
  resolve,
10931
10940
  promise
10932
- } = withResolvers$1();
10941
+ } = withResolvers();
10933
10942
  $Frame.addEventListener('load', resolve, {
10934
10943
  once: true
10935
10944
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "13.3.0",
3
+ "version": "13.4.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lvce-editor",