@lvce-editor/renderer-process 11.6.0 → 12.1.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,6 +98,7 @@ const getModuleId = commandId => {
98
98
  case 'FilePicker.showSaveFilePicker':
99
99
  return FilePicker;
100
100
  case 'FileSystemHandle.requestPermission':
101
+ case 'FileSystemHandle.getFileHandles':
101
102
  return FileSystemHandle;
102
103
  case 'ImagePreview.create':
103
104
  case 'ImagePreview.dispose':
@@ -194,7 +195,7 @@ const getModuleId = commandId => {
194
195
  case 'Window.reload':
195
196
  case 'Window.unmaximize':
196
197
  return Window;
197
- case 33111:
198
+ case 33_111:
198
199
  return Workbench;
199
200
  case 'WindowTitle.set':
200
201
  return WindowTitle;
@@ -340,7 +341,7 @@ const execute = (command, ...args) => {
340
341
  if (command in state$a.commands) {
341
342
  const fn = state$a.commands[command];
342
343
  if (typeof fn !== 'function') {
343
- throw new Error(`[renderer-worker] Command ${command} is not a function`);
344
+ throw new TypeError(`[renderer-worker] Command ${command} is not a function`);
344
345
  }
345
346
  return fn(...args);
346
347
  }
@@ -354,7 +355,7 @@ const ipcs = Object.create(null);
354
355
  const set$9 = (name, ipc) => {
355
356
  ipcs[name] = ipc;
356
357
  };
357
- const get$a = name => {
358
+ const get$9 = name => {
358
359
  return ipcs[name];
359
360
  };
360
361
  const remove$4 = name => {
@@ -450,8 +451,6 @@ const getModule$1 = method => {
450
451
  }
451
452
  };
452
453
 
453
- const shouldLaunchMultipleWorkers = true;
454
-
455
454
  const Two = '2.0';
456
455
  const create$4$1 = (method, params) => {
457
456
  return {
@@ -464,7 +463,7 @@ const callbacks = Object.create(null);
464
463
  const set$8 = (id, fn) => {
465
464
  callbacks[id] = fn;
466
465
  };
467
- const get$9 = id => {
466
+ const get$8 = id => {
468
467
  return callbacks[id];
469
468
  };
470
469
  const remove$3 = id => {
@@ -637,7 +636,7 @@ const warn$1 = (...args) => {
637
636
  console.warn(...args);
638
637
  };
639
638
  const resolve = (id, response) => {
640
- const fn = get$9(id);
639
+ const fn = get$8(id);
641
640
  if (!fn) {
642
641
  console.log(response);
643
642
  warn$1(`callback ${id} may already be disposed`);
@@ -989,6 +988,8 @@ const RendererWorker = {
989
988
  state: state$9
990
989
  };
991
990
 
991
+ const shouldLaunchMultipleWorkers = true;
992
+
992
993
  const create$I = async ({
993
994
  method,
994
995
  ...options
@@ -999,7 +1000,7 @@ const create$I = async ({
999
1000
  }
1000
1001
  // TODO rename method
1001
1002
  // TODO avoid cyclic dependency
1002
- const port = get$a(options.name);
1003
+ const port = get$9(options.name);
1003
1004
  remove$4(options.name);
1004
1005
  await invokeAndTransfer('Transferrable.transfer', options.id, port);
1005
1006
  return;
@@ -1694,11 +1695,11 @@ const create$H = () => {
1694
1695
  return ++id;
1695
1696
  };
1696
1697
  const state$8 = Object.create(null);
1697
- const get$8 = id => {
1698
+ const get$7 = id => {
1698
1699
  return state$8[id];
1699
1700
  };
1700
- const getFileHandles = async ids => {
1701
- const promises = ids.map(id => get$8(id));
1701
+ const getFileHandles$1 = async ids => {
1702
+ const promises = ids.map(id => get$7(id));
1702
1703
  const handles = await Promise.all(promises);
1703
1704
  return handles;
1704
1705
  };
@@ -1894,7 +1895,7 @@ const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
1894
1895
  };
1895
1896
 
1896
1897
  const set$6 = setComponentUid;
1897
- const get$7 = getComponentUid;
1898
+ const get$6 = getComponentUid;
1898
1899
  const fromEvent = getComponentUidFromEvent;
1899
1900
 
1900
1901
  const applyUidWorkaround = element => {
@@ -1904,7 +1905,7 @@ const applyUidWorkaround = element => {
1904
1905
  if (!editor) {
1905
1906
  throw new Error('no editor found');
1906
1907
  }
1907
- const editorUid = get$7(editor);
1908
+ const editorUid = get$6(editor);
1908
1909
  set$6(element, editorUid);
1909
1910
  };
1910
1911
 
@@ -2986,11 +2987,11 @@ const setBounds$3 = (state, x, y, width, height) => {
2986
2987
  const dispose$f = state => {
2987
2988
  remove$2(state.$Viewlet);
2988
2989
  };
2989
- const Events$9 = ViewletFindWidgetEvents;
2990
+ const Events$5 = ViewletFindWidgetEvents;
2990
2991
 
2991
2992
  const ViewletFindWidget = {
2992
2993
  __proto__: null,
2993
- Events: Events$9,
2994
+ Events: Events$5,
2994
2995
  appendWidget,
2995
2996
  create: create$D,
2996
2997
  dispose: dispose$f,
@@ -4245,14 +4246,17 @@ const ConfirmPrompt_ipc = {
4245
4246
  name: name$x
4246
4247
  };
4247
4248
 
4248
- const get$6 = ids => {
4249
+ const requestPermission = (handle, options) => {
4250
+ return handle.requestPermission(options);
4251
+ };
4252
+ const getFileHandles = ids => {
4249
4253
  // @ts-ignore
4250
- return getFileHandles(ids);
4254
+ return getFileHandles$1(ids);
4251
4255
  };
4252
4256
 
4253
4257
  const name$w = 'FileHandles';
4254
4258
  const Commands$x = {
4255
- get: get$6
4259
+ get: getFileHandles
4256
4260
  };
4257
4261
 
4258
4262
  const FileHandles_ipc = {
@@ -4475,13 +4479,10 @@ const FilePicker_ipc = {
4475
4479
  name: name$r
4476
4480
  };
4477
4481
 
4478
- const requestPermission = (handle, options) => {
4479
- return handle.requestPermission(options);
4480
- };
4481
-
4482
4482
  const name$q = 'FileSystemHandle';
4483
4483
  const Commands$r = {
4484
- requestPermission: requestPermission
4484
+ requestPermission: requestPermission,
4485
+ getFileHandles: getFileHandles
4485
4486
  };
4486
4487
 
4487
4488
  const FileSystemHandle_ipc = {
@@ -4858,6 +4859,12 @@ const OffscreenCanvas_ipc = {
4858
4859
  name: name$g
4859
4860
  };
4860
4861
 
4862
+ const create$BackDrop = () => {
4863
+ const $BackDrop = document.createElement('div');
4864
+ $BackDrop.className = 'BackDrop';
4865
+ return $BackDrop;
4866
+ };
4867
+
4861
4868
  // TODO this module should be called dom or dom utils
4862
4869
 
4863
4870
  // TODO this module makes for weird code splitting chunks,
@@ -4878,12 +4885,6 @@ const findIndex = ($Container, $Target) => {
4878
4885
  return -1;
4879
4886
  };
4880
4887
 
4881
- const create$BackDrop = () => {
4882
- const $BackDrop = document.createElement('div');
4883
- $BackDrop.className = 'BackDrop';
4884
- return $BackDrop;
4885
- };
4886
-
4887
4888
  const state$2 = {
4888
4889
  /**
4889
4890
  * @type {HTMLElement|undefined}
@@ -5329,42 +5330,6 @@ const ScreenCapture_ipc = {
5329
5330
  name: name$b
5330
5331
  };
5331
5332
 
5332
- const getTimeStamp = () => {
5333
- return performance.now();
5334
- };
5335
-
5336
- const waitForMutation = async maxDelay => {
5337
- const disposables = [];
5338
- await Promise.race([new Promise(resolve => {
5339
- const timeout = setTimeout(resolve, maxDelay);
5340
- // @ts-expect-error
5341
- disposables.push(() => {
5342
- clearTimeout(timeout);
5343
- });
5344
- }), new Promise(resolve => {
5345
- const callback = mutations => {
5346
- resolve(undefined);
5347
- };
5348
- const observer = new MutationObserver(callback);
5349
- observer.observe(document.body, {
5350
- childList: true,
5351
- attributes: true,
5352
- characterData: true,
5353
- subtree: true,
5354
- attributeOldValue: true,
5355
- characterDataOldValue: true
5356
- });
5357
- // @ts-expect-error
5358
- disposables.push(() => {
5359
- observer.disconnect();
5360
- });
5361
- })]);
5362
- for (const disposable of disposables) {
5363
- // @ts-expect-error
5364
- disposable();
5365
- }
5366
- };
5367
-
5368
5333
  const getEventClass = eventType => {
5369
5334
  switch (eventType) {
5370
5335
  case Wheel:
@@ -5511,6 +5476,42 @@ const querySelectorWithOptions = (selector, {
5511
5476
  return element;
5512
5477
  };
5513
5478
 
5479
+ const getTimeStamp = () => {
5480
+ return performance.now();
5481
+ };
5482
+
5483
+ const waitForMutation = async maxDelay => {
5484
+ const disposables = [];
5485
+ await Promise.race([new Promise(resolve => {
5486
+ const timeout = setTimeout(resolve, maxDelay);
5487
+ // @ts-expect-error
5488
+ disposables.push(() => {
5489
+ clearTimeout(timeout);
5490
+ });
5491
+ }), new Promise(resolve => {
5492
+ const callback = mutations => {
5493
+ resolve(undefined);
5494
+ };
5495
+ const observer = new MutationObserver(callback);
5496
+ observer.observe(document.body, {
5497
+ childList: true,
5498
+ attributes: true,
5499
+ characterData: true,
5500
+ subtree: true,
5501
+ attributeOldValue: true,
5502
+ characterDataOldValue: true
5503
+ });
5504
+ // @ts-expect-error
5505
+ disposables.push(() => {
5506
+ observer.disconnect();
5507
+ });
5508
+ })]);
5509
+ for (const disposable of disposables) {
5510
+ // @ts-expect-error
5511
+ disposable();
5512
+ }
5513
+ };
5514
+
5514
5515
  // TODO this should also come in via options
5515
5516
  const maxTimeout$1 = 2000;
5516
5517
  const performAction2 = async (locator, fnName, options) => {
@@ -6018,11 +6019,11 @@ const ViewletActivityBarEvents = {
6018
6019
  returnValue: returnValue$5
6019
6020
  };
6020
6021
 
6021
- const Events$8 = ViewletActivityBarEvents;
6022
+ const Events$4 = ViewletActivityBarEvents;
6022
6023
 
6023
6024
  const ViewletActivityBar = {
6024
6025
  __proto__: null,
6025
- Events: Events$8
6026
+ Events: Events$4
6026
6027
  };
6027
6028
 
6028
6029
  const handleAudioError = event => {
@@ -6045,11 +6046,11 @@ const ViewletAudioEvents = {
6045
6046
  handleAudioError
6046
6047
  };
6047
6048
 
6048
- const Events$7 = ViewletAudioEvents;
6049
+ const Events$3 = ViewletAudioEvents;
6049
6050
 
6050
6051
  const ViewletAudio = {
6051
6052
  __proto__: null,
6052
- Events: Events$7
6053
+ Events: Events$3
6053
6054
  };
6054
6055
 
6055
6056
  const create$t = () => {
@@ -7702,7 +7703,6 @@ const ViewletLocationsEvents = {
7702
7703
  handleLocationsMouseDown
7703
7704
  };
7704
7705
 
7705
- const Events$6 = ViewletLocationsEvents;
7706
7706
  const setFocusedIndex$2 = (state, oldFocusedIndex, newFocusedIndex) => {
7707
7707
  const {
7708
7708
  $Viewlet
@@ -7737,7 +7737,7 @@ const focus$a = state => {
7737
7737
 
7738
7738
  const ViewletImplementations = {
7739
7739
  __proto__: null,
7740
- Events: Events$6,
7740
+ Events: ViewletLocationsEvents,
7741
7741
  focus: focus$a,
7742
7742
  handleError: handleError$2,
7743
7743
  setFocusedIndex: setFocusedIndex$2
@@ -7831,11 +7831,11 @@ const setColumnWidths = (state, columnWidth1, columnWidth2, columnWidth3) => {
7831
7831
  $Resizer1.style.left = `${paddingLeft + columnWidth1}px`;
7832
7832
  $Resizer2.style.left = `${paddingLeft + columnWidth1 + columnWidth2}px`;
7833
7833
  };
7834
- const Events$5 = ViewletkeyBindingsEvents;
7834
+ const Events$2 = ViewletkeyBindingsEvents;
7835
7835
 
7836
7836
  const ViewletKeyBindings = {
7837
7837
  __proto__: null,
7838
- Events: Events$5,
7838
+ Events: Events$2,
7839
7839
  setColumnWidths,
7840
7840
  setScrollBar: setScrollBar$2,
7841
7841
  setSize,
@@ -8599,7 +8599,7 @@ const getUid = () => {
8599
8599
  if (!$Main) {
8600
8600
  return 0;
8601
8601
  }
8602
- return get$7($Main);
8602
+ return get$6($Main);
8603
8603
  };
8604
8604
  const handleTabsWheel = event => {
8605
8605
  const uid = getUid();
@@ -9006,7 +9006,7 @@ const ViewletProblems = {
9006
9006
 
9007
9007
  const ViewletReferences = {
9008
9008
  __proto__: null,
9009
- Events: Events$6,
9009
+ Events: ViewletLocationsEvents,
9010
9010
  focus: focus$a,
9011
9011
  handleError: handleError$2,
9012
9012
  setFocusedIndex: setFocusedIndex$2
@@ -9509,11 +9509,11 @@ const ViewletStorageEvents = {
9509
9509
  handleClick: handleClick$1
9510
9510
  };
9511
9511
 
9512
- const Events$4 = ViewletStorageEvents;
9512
+ const Events$1 = ViewletStorageEvents;
9513
9513
 
9514
9514
  const ViewletStorage = {
9515
9515
  __proto__: null,
9516
- Events: Events$4
9516
+ Events: Events$1
9517
9517
  };
9518
9518
 
9519
9519
  const handleClickTab = event => {
@@ -9618,24 +9618,22 @@ const handleTitleBarButtonsClick = event => {
9618
9618
  };
9619
9619
  const returnValue$1 = true;
9620
9620
 
9621
- const ViewletTitleBarButtonEvents = {
9621
+ const ViewletTitleBarButtonsEvents = {
9622
9622
  __proto__: null,
9623
9623
  handleTitleBarButtonsClick,
9624
9624
  returnValue: returnValue$1
9625
9625
  };
9626
9626
 
9627
- const Events$3 = ViewletTitleBarButtonEvents;
9628
-
9629
9627
  const ViewletTitleBarButtons = {
9630
9628
  __proto__: null,
9631
- Events: Events$3
9629
+ Events: ViewletTitleBarButtonsEvents
9632
9630
  };
9633
9631
 
9634
- const Events$2 = {};
9632
+ const Events = {};
9635
9633
 
9636
9634
  const ViewletTitleBarIcon = {
9637
9635
  __proto__: null,
9638
- Events: Events$2
9636
+ Events
9639
9637
  };
9640
9638
 
9641
9639
  const isInsideTitleBarMenu = $Element => {
@@ -9967,11 +9965,10 @@ const setMenus = (state, changes, uid) => {
9967
9965
  }
9968
9966
  }
9969
9967
  };
9970
- const Events$1 = ViewletTitleBarMenuBarEvents;
9971
9968
 
9972
9969
  const ViewletTitleBarMenuBar = {
9973
9970
  __proto__: null,
9974
- Events: Events$1,
9971
+ Events: ViewletTitleBarMenuBarEvents,
9975
9972
  closeMenu,
9976
9973
  dispose: dispose$3,
9977
9974
  focus: focus$2,
@@ -10023,11 +10020,9 @@ const ViewletVideoEvents = {
10023
10020
  handleVideoError
10024
10021
  };
10025
10022
 
10026
- const Events = ViewletVideoEvents;
10027
-
10028
10023
  const ViewletVideo = {
10029
10024
  __proto__: null,
10030
- Events
10025
+ Events: ViewletVideoEvents
10031
10026
  };
10032
10027
 
10033
10028
  const handleClickAt = event => {
@@ -10444,7 +10439,7 @@ const setDom2 = (viewletId, dom) => {
10444
10439
  let uid;
10445
10440
  if ($Viewlet) {
10446
10441
  try {
10447
- uid = get$7($Viewlet);
10442
+ uid = get$6($Viewlet);
10448
10443
  } catch {}
10449
10444
  }
10450
10445
  // TODO optimize rendering with virtual dom diffing
package/package.json CHANGED
@@ -1,27 +1,17 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "11.6.0",
3
+ "version": "12.1.0",
4
4
  "description": "",
5
- "main": "dist/rendererProcessMain.js",
6
- "type": "module",
7
- "directories": {
8
- "test": "test"
9
- },
10
5
  "keywords": [
11
6
  "lvce-editor",
12
7
  "renderer-process"
13
8
  ],
14
- "author": "Lvce Editor",
15
- "license": "MIT",
16
9
  "repository": {
17
10
  "type": "git",
18
11
  "url": "https://github.com/lvce-editor/renderer-process.git"
19
12
  },
20
- "nodemonConfig": {
21
- "watch": [
22
- "src"
23
- ],
24
- "ext": "ts,js",
25
- "exec": "node scripts/build.js"
26
- }
13
+ "license": "MIT",
14
+ "author": "Lvce Editor",
15
+ "type": "module",
16
+ "main": "dist/rendererProcessMain.js"
27
17
  }