@lvce-editor/renderer-process 12.4.0 → 12.6.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.
@@ -98,7 +98,8 @@ const getModuleId = commandId => {
98
98
  case 'FilePicker.showSaveFilePicker':
99
99
  return FilePicker;
100
100
  case 'FileSystemHandle.requestPermission':
101
- case 'FileSystemHandle.getFileHandles':
101
+ case 'FileSystemHandle.requestPermission':
102
+ case 'FileSystemHandle.addFileHandle':
102
103
  return FileSystemHandle;
103
104
  case 'ImagePreview.create':
104
105
  case 'ImagePreview.dispose':
@@ -1710,6 +1711,20 @@ const add = promise => {
1710
1711
  state$8[id] = promise;
1711
1712
  return id;
1712
1713
  };
1714
+ const addFileHandle$1 = fileHandle => {
1715
+ const promise = Promise.resolve(fileHandle);
1716
+ return add(promise);
1717
+ };
1718
+ let ignore = false;
1719
+ const startIgnore = () => {
1720
+ ignore = true;
1721
+ };
1722
+ const stopIgnore = () => {
1723
+ ignore = false;
1724
+ };
1725
+ const enabled = () => {
1726
+ return ignore;
1727
+ };
1713
1728
  const handleDataTransferFiles = event => {
1714
1729
  const items = [...event.dataTransfer.items];
1715
1730
  const promises = items.map(item => item.getAsFileSystemHandle());
@@ -1777,6 +1792,9 @@ const getEventListenerArgs = (params, event) => {
1777
1792
  };
1778
1793
  const createFn = info => {
1779
1794
  const fn = event => {
1795
+ if (enabled()) {
1796
+ return;
1797
+ }
1780
1798
  if (info.preventDefault) {
1781
1799
  event.preventDefault(event);
1782
1800
  }
@@ -1830,6 +1848,7 @@ const render = (elements, eventMap = {}, newEventMap = {}) => {
1830
1848
  return $Root;
1831
1849
  };
1832
1850
  const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
1851
+ startIgnore();
1833
1852
  const oldLeft = $Viewlet.style.left;
1834
1853
  const oldTop = $Viewlet.style.top;
1835
1854
  const oldWidth = $Viewlet.style.width;
@@ -1868,6 +1887,10 @@ const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
1868
1887
  if ($NewFocused) {
1869
1888
  const $Previous = $Hidden.firstChild;
1870
1889
  $Previous.className = $NewFocused.className;
1890
+ $Previous.placeholder = $NewFocused.placeholder;
1891
+ if ($NewFocused.childNodes) {
1892
+ $Previous.append(...$NewFocused.childNodes);
1893
+ }
1871
1894
  $NewFocused.replaceWith($Previous);
1872
1895
  }
1873
1896
  }
@@ -1895,6 +1918,7 @@ const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
1895
1918
  $Viewlet.style.left = oldLeft;
1896
1919
  $Viewlet.style.height = oldHeight;
1897
1920
  $Viewlet.style.width = oldWidth;
1921
+ stopIgnore();
1898
1922
  return $Viewlet;
1899
1923
  };
1900
1924
 
@@ -4254,9 +4278,11 @@ const requestPermission = (handle, options) => {
4254
4278
  return handle.requestPermission(options);
4255
4279
  };
4256
4280
  const getFileHandles = ids => {
4257
- // @ts-ignore
4258
4281
  return getFileHandles$1(ids);
4259
4282
  };
4283
+ const addFileHandle = fileHandle => {
4284
+ return addFileHandle$1(fileHandle);
4285
+ };
4260
4286
 
4261
4287
  const name$w = 'FileHandles';
4262
4288
  const Commands$x = {
@@ -4485,8 +4511,9 @@ const FilePicker_ipc = {
4485
4511
 
4486
4512
  const name$q = 'FileSystemHandle';
4487
4513
  const Commands$r = {
4488
- requestPermission: requestPermission,
4489
- getFileHandles: getFileHandles
4514
+ addFileHandle: addFileHandle,
4515
+ getFileHandles: getFileHandles,
4516
+ requestPermission: requestPermission
4490
4517
  };
4491
4518
 
4492
4519
  const FileSystemHandle_ipc = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "12.4.0",
3
+ "version": "12.6.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lvce-editor",