@lvce-editor/renderer-process 21.20.0 → 22.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.
@@ -572,6 +572,21 @@ const attachEvent$1 = ($Node, eventMap, key, value, newEventMap) => {
572
572
  const wrapped = getWrappedListener$1(listener, eventMap.returnValue);
573
573
  $Node.addEventListener(keyLower, wrapped, options);
574
574
  };
575
+ const STYLE_REGEX = /([^:;]+):\s*([^;]+)/g;
576
+ const KEBAB_CASE_REGEX = /-([a-z])/g;
577
+ const setStyle = ($Element, styleString) => {
578
+ if (typeof styleString !== 'string') {
579
+ return;
580
+ }
581
+ let match;
582
+ while ((match = STYLE_REGEX.exec(styleString)) !== null) {
583
+ const key = match[1].trim();
584
+ const value = match[2].trim();
585
+ // Convert kebab-case to camelCase for CSS properties with dashes
586
+ const camelCaseKey = key.replaceAll(KEBAB_CASE_REGEX, (_, char) => char.toUpperCase());
587
+ $Element.style[camelCaseKey] = value;
588
+ }
589
+ };
575
590
  const setProp = ($Element, key, value, eventMap, newEventMap) => {
576
591
  switch (key) {
577
592
  case 'ariaActivedescendant':
@@ -595,6 +610,9 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
595
610
  $Element.removeAttribute('aria-owns');
596
611
  }
597
612
  break;
613
+ case 'childCount':
614
+ case 'type':
615
+ break;
598
616
  case 'height':
599
617
  case 'width':
600
618
  if ($Element instanceof HTMLImageElement) {
@@ -642,8 +660,11 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
642
660
  case 'onFocusIn':
643
661
  case 'onFocusOut':
644
662
  case 'onInput':
663
+ case 'onKeydown':
645
664
  case 'onKeyDown':
665
+ case 'onKeyUp':
646
666
  case 'onMouseDown':
667
+ case 'onMouseMove':
647
668
  case 'onMouseOut':
648
669
  case 'onMouseOver':
649
670
  case 'onPointerDown':
@@ -660,9 +681,7 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
660
681
  attachEvent$1($Element, eventMap, eventName, value, newEventMap);
661
682
  break;
662
683
  case 'style':
663
- throw new Error('style property is not supported');
664
- case 'childCount':
665
- case 'type':
684
+ setStyle($Element, value);
666
685
  break;
667
686
  case 'translate':
668
687
  $Element.style[key] = value;
@@ -844,7 +863,7 @@ const enabled = () => {
844
863
  return ignore;
845
864
  };
846
865
  let id$1 = 0;
847
- const create$G = () => {
866
+ const create$E = () => {
848
867
  return ++id$1;
849
868
  };
850
869
  const state$8 = Object.create(null);
@@ -859,7 +878,7 @@ const getFileHandles$1 = async ids => {
859
878
  return handles;
860
879
  };
861
880
  const add = promise => {
862
- const id = create$G();
881
+ const id = create$E();
863
882
  state$8[id] = promise;
864
883
  return id;
865
884
  };
@@ -1505,7 +1524,7 @@ const getWorkerDisplayName$1 = name => {
1505
1524
  }
1506
1525
  return `${name} worker`;
1507
1526
  };
1508
- const create$F = async ({
1527
+ const create$D = async ({
1509
1528
  name,
1510
1529
  url
1511
1530
  }) => {
@@ -1572,7 +1591,7 @@ const wrap = worker => {
1572
1591
 
1573
1592
  const IpcParentWithModuleWorker$2 = {
1574
1593
  __proto__: null,
1575
- create: create$F,
1594
+ create: create$D,
1576
1595
  wrap
1577
1596
  };
1578
1597
 
@@ -1580,7 +1599,7 @@ const isMessagePort$1 = value => {
1580
1599
  return value instanceof MessagePort;
1581
1600
  };
1582
1601
 
1583
- const create$E = async ({
1602
+ const create$C = async ({
1584
1603
  url
1585
1604
  }) => {
1586
1605
  string(url);
@@ -1601,10 +1620,10 @@ const create$E = async ({
1601
1620
 
1602
1621
  const IpcParentWithMessagePort$2 = {
1603
1622
  __proto__: null,
1604
- create: create$E
1623
+ create: create$C
1605
1624
  };
1606
1625
 
1607
- const create$D = async url => {
1626
+ const create$B = async url => {
1608
1627
  const referencePort = await new Promise(resolve => {
1609
1628
  globalThis.acceptReferencePort = resolve;
1610
1629
  import(url);
@@ -1615,7 +1634,7 @@ const create$D = async url => {
1615
1634
 
1616
1635
  const IpcParentWithReferencePort = {
1617
1636
  __proto__: null,
1618
- create: create$D
1637
+ create: create$B
1619
1638
  };
1620
1639
 
1621
1640
  const normalizeLine = line => {
@@ -1760,7 +1779,7 @@ const fixElectronParameters = value => {
1760
1779
  transfer
1761
1780
  };
1762
1781
  };
1763
- const attachEvents$9 = that => {
1782
+ const attachEvents$7 = that => {
1764
1783
  const handleMessage = (...args) => {
1765
1784
  const data = that.getData(...args);
1766
1785
  that.dispatchEvent(new MessageEvent('message', {
@@ -1777,7 +1796,7 @@ class Ipc extends EventTarget {
1777
1796
  constructor(rawIpc) {
1778
1797
  super();
1779
1798
  this._rawIpc = rawIpc;
1780
- attachEvents$9(this);
1799
+ attachEvents$7(this);
1781
1800
  }
1782
1801
  }
1783
1802
  const E_INCOMPATIBLE_NATIVE_MODULE = 'E_INCOMPATIBLE_NATIVE_MODULE';
@@ -2384,7 +2403,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
2384
2403
  const errorProperty = getErrorProperty(error, prettyError);
2385
2404
  return create$1$1(id, errorProperty);
2386
2405
  };
2387
- const create$C = (message, result) => {
2406
+ const create$A = (message, result) => {
2388
2407
  return {
2389
2408
  jsonrpc: Two$1,
2390
2409
  id: message.id,
@@ -2393,7 +2412,7 @@ const create$C = (message, result) => {
2393
2412
  };
2394
2413
  const getSuccessResponse = (message, result) => {
2395
2414
  const resultProperty = result ?? null;
2396
- return create$C(message, resultProperty);
2415
+ return create$A(message, resultProperty);
2397
2416
  };
2398
2417
  const getErrorResponseSimple = (id, error) => {
2399
2418
  return {
@@ -2720,7 +2739,7 @@ const PlainMessagePortRpcParent = {
2720
2739
  };
2721
2740
 
2722
2741
  // TODO add test
2723
- const create$B = async ({
2742
+ const create$z = async ({
2724
2743
  name,
2725
2744
  port,
2726
2745
  url
@@ -2736,7 +2755,7 @@ const create$B = async ({
2736
2755
 
2737
2756
  const IpcParentWithModuleWorkerWithMessagePort = {
2738
2757
  __proto__: null,
2739
- create: create$B
2758
+ create: create$z
2740
2759
  };
2741
2760
 
2742
2761
  const Web = 1;
@@ -2769,7 +2788,7 @@ const platform = getPlatform();
2769
2788
  const isElectron = platform === Electron;
2770
2789
 
2771
2790
  // TODO use handleIncomingIpc function
2772
- const create$A = async ({
2791
+ const create$y = async ({
2773
2792
  ipcId,
2774
2793
  port
2775
2794
  }) => {
@@ -2787,7 +2806,7 @@ const create$A = async ({
2787
2806
 
2788
2807
  const IpcParentWithElectron = {
2789
2808
  __proto__: null,
2790
- create: create$A
2809
+ create: create$y
2791
2810
  };
2792
2811
 
2793
2812
  const getModule = method => {
@@ -2898,7 +2917,7 @@ const hydrate$3 = async () => {
2898
2917
  };
2899
2918
 
2900
2919
  // TODO needed?
2901
- const dispose$j = () => {
2920
+ const dispose$i = () => {
2902
2921
  if (state$7.rpc) {
2903
2922
  // @ts-expect-error
2904
2923
  state$7.rpc.dispose();
@@ -2923,7 +2942,7 @@ const invokeAndTransfer = (method, ...params) => {
2923
2942
 
2924
2943
  const RendererWorker = {
2925
2944
  __proto__: null,
2926
- dispose: dispose$j,
2945
+ dispose: dispose$i,
2927
2946
  hydrate: hydrate$3,
2928
2947
  invoke: invoke$1,
2929
2948
  invokeAndTransfer,
@@ -2932,7 +2951,7 @@ const RendererWorker = {
2932
2951
  state: state$7
2933
2952
  };
2934
2953
 
2935
- const create$z = async ({
2954
+ const create$x = async ({
2936
2955
  method,
2937
2956
  ...options
2938
2957
  }) => {
@@ -3053,7 +3072,7 @@ const create$Notification = message => {
3053
3072
  $Notification.textContent = message;
3054
3073
  return $Notification;
3055
3074
  };
3056
- const create$y = (type, message) => {
3075
+ const create$w = (type, message) => {
3057
3076
  // TODO this pattern might be also useful for activitybar, sidebar etc., creating elements as late as possible, only when actually needed
3058
3077
  const $Notification = create$Notification(message);
3059
3078
  append$1($Notification);
@@ -3098,7 +3117,7 @@ const createWithOptions = (type, message, options) => {
3098
3117
  const $Notification = create$NotificationWithOptions(message, options);
3099
3118
  append$1($Notification);
3100
3119
  };
3101
- const dispose$i = id => {
3120
+ const dispose$h = id => {
3102
3121
  // const $Notification = state.$Notifications
3103
3122
  };
3104
3123
 
@@ -3115,7 +3134,7 @@ const set$6 = (canvasId, canvas) => {
3115
3134
  const get$4 = id => {
3116
3135
  return get$5(id);
3117
3136
  };
3118
- const create$x = async (canvasId, objectId) => {
3137
+ const create$v = async (canvasId, objectId) => {
3119
3138
  const canvas = document.createElement('canvas');
3120
3139
  const offscreenCanvas = canvas.transferControlToOffscreen();
3121
3140
  set$6(canvasId, canvas);
@@ -3150,7 +3169,6 @@ const Complementary = 'complementary';
3150
3169
  const Group = 'group';
3151
3170
  const ListBox = 'listbox';
3152
3171
  const Log = 'log';
3153
- const Main$1 = 'main';
3154
3172
  const Menu = 'menu';
3155
3173
  const None$2 = 'none';
3156
3174
  const Status = 'status';
@@ -3180,11 +3198,6 @@ const CompositionUpdate = 'compositionupdate';
3180
3198
  const ContextMenu = 'contextmenu';
3181
3199
  const Cut = 'cut';
3182
3200
  const DoubleClick = 'dblclick';
3183
- const DragEnd = 'dragend';
3184
- const DragLeave = 'dragleave';
3185
- const DragOver = 'dragover';
3186
- const DragStart = 'dragstart';
3187
- const Drop = 'drop';
3188
3201
  const Error$2 = 'error';
3189
3202
  const Focus = 'focus';
3190
3203
  const FocusIn = 'focusin';
@@ -3249,7 +3262,7 @@ const getElement = () => {
3249
3262
  return state$4.$PreviousFocusElement;
3250
3263
  };
3251
3264
 
3252
- const focus$f = $Element => {
3265
+ const focus$e = $Element => {
3253
3266
  if ($Element === document.activeElement) {
3254
3267
  return;
3255
3268
  }
@@ -3441,7 +3454,7 @@ const create$Menu$1 = () => {
3441
3454
  // })
3442
3455
  $Menu.onkeydown = handleKeyDown$5;
3443
3456
  $Menu.addEventListener(FocusOut, handleFocusOut$1);
3444
- $Menu.oncontextmenu = handleContextMenu$9;
3457
+ $Menu.oncontextmenu = handleContextMenu$8;
3445
3458
  // $ContextMenu.onfocus = handleFocus
3446
3459
  // $ContextMenu.onblur = handleBlur
3447
3460
  return $Menu;
@@ -3470,14 +3483,14 @@ const handleBackDropMouseDown = event => {
3470
3483
  stopPropagation(event);
3471
3484
  send(/* Menu.hide */'Menu.hide');
3472
3485
  };
3473
- const handleContextMenu$9 = event => {
3486
+ const handleContextMenu$8 = event => {
3474
3487
  preventDefault(event);
3475
3488
  };
3476
3489
  const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mouseBlocking = false) => {
3477
3490
  if (mouseBlocking) {
3478
3491
  const $BackDrop = create$BackDrop();
3479
3492
  $BackDrop.onmousedown = handleBackDropMouseDown;
3480
- $BackDrop.oncontextmenu = handleContextMenu$9;
3493
+ $BackDrop.oncontextmenu = handleContextMenu$8;
3481
3494
  // @ts-expect-error
3482
3495
  state$3.$BackDrop = $BackDrop;
3483
3496
  append$1($BackDrop);
@@ -3498,7 +3511,7 @@ const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mous
3498
3511
  state$3.$$Menus.push($Menu);
3499
3512
  append$1($Menu);
3500
3513
  if (level === 0) {
3501
- focus$f($Menu);
3514
+ focus$e($Menu);
3502
3515
  send('Focus.setFocus', FocusMenu);
3503
3516
  }
3504
3517
  };
@@ -4223,6 +4236,12 @@ const transferToWebView = objectId => {
4223
4236
  }, '*', [port]);
4224
4237
  };
4225
4238
 
4239
+ const attachEvents$6 = ($Node, eventMap) => {
4240
+ for (const [key, value] of Object.entries(eventMap)) {
4241
+ $Node.addEventListener(key, value);
4242
+ }
4243
+ };
4244
+
4226
4245
  const set$3 = setComponentUid;
4227
4246
  const get = getComponentUid;
4228
4247
  const fromEvent = getComponentUidFromEvent;
@@ -4292,7 +4311,7 @@ const showError = (message, y, x) => {
4292
4311
  $ImagePreviewImage
4293
4312
  };
4294
4313
  };
4295
- const create$w = (uri, top, left) => {
4314
+ const create$u = (uri, top, left) => {
4296
4315
  const $ImagePreviewImage = document.createElement('img');
4297
4316
  $ImagePreviewImage.className = 'ImagePreviewImage';
4298
4317
  $ImagePreviewImage.src = uri;
@@ -4317,14 +4336,14 @@ const create$w = (uri, top, left) => {
4317
4336
  const update = (state, uri) => {
4318
4337
  state.$ImagePreviewImage.uri = uri;
4319
4338
  };
4320
- const dispose$h = state => {
4339
+ const dispose$g = state => {
4321
4340
  remove$1(state.$ImagePreview);
4322
4341
  };
4323
4342
 
4324
4343
  const ImagePreview$1 = {
4325
4344
  __proto__: null,
4326
- create: create$w,
4327
- dispose: dispose$h,
4345
+ create: create$u,
4346
+ dispose: dispose$g,
4328
4347
  showError,
4329
4348
  update
4330
4349
  };
@@ -4371,7 +4390,7 @@ const handleFocus$9 = () => {
4371
4390
 
4372
4391
  // TODO use context menu events function again
4373
4392
 
4374
- const handleContextMenu$8 = event => {
4393
+ const handleContextMenu$7 = event => {
4375
4394
  preventDefault(event);
4376
4395
  const {
4377
4396
  button,
@@ -4385,7 +4404,7 @@ const returnValue$8 = true;
4385
4404
  const ViewletActivityBarEvents = {
4386
4405
  __proto__: null,
4387
4406
  handleBlur: handleBlur$9,
4388
- handleContextMenu: handleContextMenu$8,
4407
+ handleContextMenu: handleContextMenu$7,
4389
4408
  handleFocus: handleFocus$9,
4390
4409
  handleMouseDown: handleMouseDown$3,
4391
4410
  returnValue: returnValue$8
@@ -4447,14 +4466,14 @@ forwardViewletCommand('handleClickOpenFolder');
4447
4466
  forwardViewletCommand('handleClickRestore');
4448
4467
  const handleClickTab$2 = forwardViewletCommand('handleClickTab');
4449
4468
  forwardViewletCommand('handleClickToggleMaximize');
4450
- const handleContextMenu$7 = forwardViewletCommand('handleContextMenu');
4469
+ const handleContextMenu$6 = forwardViewletCommand('handleContextMenu');
4451
4470
  forwardViewletCommand('handleDoubleClick');
4452
- const handleDragEnd$1 = forwardViewletCommand('handleDragEnd');
4453
- const handleDragLeave$1 = forwardViewletCommand('handleDragLeave');
4454
- const handleDragOver$2 = forwardViewletCommand('handleDragOver');
4471
+ forwardViewletCommand('handleDragEnd');
4472
+ forwardViewletCommand('handleDragLeave');
4473
+ forwardViewletCommand('handleDragOver');
4474
+ forwardViewletCommand('handleDrop');
4475
+ forwardViewletCommand('handleDropFilePath');
4455
4476
  forwardViewletCommand('handleDrop');
4456
- const handleDropFilePath = forwardViewletCommand('handleDropFilePath');
4457
- const handleDropFiles = forwardViewletCommand('handleDrop');
4458
4477
  forwardViewletCommand('handleFeaturesClick');
4459
4478
  forwardViewletCommand('handleClickSize');
4460
4479
  forwardViewletCommand('handleClickDisable');
@@ -4493,14 +4512,14 @@ forwardViewletCommand('handleScrollBarMove');
4493
4512
  forwardViewletCommand('handleScrollBarVerticalPointerDown');
4494
4513
  forwardViewletCommand('handleSliderPointerDown');
4495
4514
  forwardViewletCommand('handleSliderPointerMove');
4496
- const handleTabClick = forwardViewletCommand('handleTabClick');
4497
- const handleTabContextMenu = forwardViewletCommand('handleTabContextMenu');
4498
- const handleTabDrop = forwardViewletCommand('handleTabDrop');
4515
+ forwardViewletCommand('handleTabClick');
4516
+ forwardViewletCommand('handleTabContextMenu');
4517
+ forwardViewletCommand('handleTabDrop');
4499
4518
  forwardViewletCommand('handleTabsClick');
4500
- const handleTabsDragOver = forwardViewletCommand('handleTabsDragOver');
4519
+ forwardViewletCommand('handleTabsDragOver');
4501
4520
  forwardViewletCommand('handleTabsPointerOut');
4502
4521
  forwardViewletCommand('handleTabsPointerOver');
4503
- const handleTabsWheel$1 = forwardViewletCommand('handleTabsWheel');
4522
+ forwardViewletCommand('handleTabsWheel');
4504
4523
  forwardViewletCommand('handleTouchEnd');
4505
4524
  forwardViewletCommand('handleTouchMove');
4506
4525
  forwardViewletCommand('handleTouchStart');
@@ -4548,14 +4567,14 @@ const ViewletAudio = {
4548
4567
  Events: Events$4
4549
4568
  };
4550
4569
 
4551
- const create$v = () => {
4570
+ const create$t = () => {
4552
4571
  const $Viewlet = document.createElement('div');
4553
4572
  $Viewlet.className = 'Viewlet Clock';
4554
4573
  return {
4555
4574
  $Viewlet
4556
4575
  };
4557
4576
  };
4558
- const dispose$g = state => {};
4577
+ const dispose$f = state => {};
4559
4578
  const refresh$4 = () => {};
4560
4579
  const setTime = (state, time) => {
4561
4580
  object(state);
@@ -4565,8 +4584,8 @@ const setTime = (state, time) => {
4565
4584
 
4566
4585
  const ViewletClock = {
4567
4586
  __proto__: null,
4568
- create: create$v,
4569
- dispose: dispose$g,
4587
+ create: create$t,
4588
+ dispose: dispose$f,
4570
4589
  refresh: refresh$4,
4571
4590
  setTime
4572
4591
  };
@@ -4594,7 +4613,7 @@ const stopTracking$1 = ($Target, pointerId, handlePointerMove, handlePointerUp)
4594
4613
  // TODO use pointerlost event instead
4595
4614
  $Target.removeEventListener(PointerUp, handlePointerUp);
4596
4615
  };
4597
- const create$u = (pointerDown, pointerMove, pointerUp) => {
4616
+ const create$s = (pointerDown, pointerMove, pointerUp) => {
4598
4617
  const shared = (fn, event) => {
4599
4618
  const message = fn(event);
4600
4619
  if (!message || message.length === 0) {
@@ -4627,7 +4646,7 @@ const create$u = (pointerDown, pointerMove, pointerUp) => {
4627
4646
  };
4628
4647
 
4629
4648
  const handleOffset = 20;
4630
- const handleSliderPointerDown = create$u(event => {
4649
+ const handleSliderPointerDown = create$s(event => {
4631
4650
  const {
4632
4651
  clientX,
4633
4652
  clientY
@@ -4709,7 +4728,7 @@ const ViewletDebugConsoleEvents = {
4709
4728
  handleInput: handleInput$5
4710
4729
  };
4711
4730
 
4712
- const create$t = () => {
4731
+ const create$r = () => {
4713
4732
  const $Viewlet = document.createElement('div');
4714
4733
  $Viewlet.className = 'Viewlet DebugConsole';
4715
4734
  return {
@@ -4725,7 +4744,7 @@ const setDom$9 = (state, dom) => {
4725
4744
 
4726
4745
  const ViewletDebugConsole = {
4727
4746
  __proto__: null,
4728
- create: create$t,
4747
+ create: create$r,
4729
4748
  setDom: setDom$9
4730
4749
  };
4731
4750
 
@@ -4762,7 +4781,7 @@ const setValue$2 = (state, value) => {
4762
4781
  const $Input = $Viewlet.querySelector('input');
4763
4782
  $Input.value = value;
4764
4783
  };
4765
- const focus$e = state => {
4784
+ const focus$d = state => {
4766
4785
  const {
4767
4786
  $Viewlet
4768
4787
  } = state;
@@ -4773,7 +4792,7 @@ const focus$e = state => {
4773
4792
  const ViewletDefineKeyBinding = {
4774
4793
  __proto__: null,
4775
4794
  Events: ViewletDefineKeyBindingEvents,
4776
- focus: focus$e,
4795
+ focus: focus$d,
4777
4796
  setValue: setValue$2
4778
4797
  };
4779
4798
 
@@ -4786,7 +4805,7 @@ const setMaskImage = ($Element, icon) => {
4786
4805
  }
4787
4806
  };
4788
4807
 
4789
- const create$s = icon => {
4808
+ const create$q = icon => {
4790
4809
  const $Icon = document.createElement('div');
4791
4810
  $Icon.className = 'MaskIcon';
4792
4811
  setMaskImage($Icon, icon);
@@ -4796,7 +4815,7 @@ const create$s = icon => {
4796
4815
 
4797
4816
  const create$Button = (label, icon) => {
4798
4817
  // TODO icon div might not be needed (unnecessary html element)
4799
- const $Icon = create$s(icon);
4818
+ const $Icon = create$q(icon);
4800
4819
  const $Button = document.createElement('button');
4801
4820
  $Button.className = 'IconButton';
4802
4821
  $Button.title = label;
@@ -4817,7 +4836,7 @@ const handleClick$4 = event => {
4817
4836
  handleClick$5(index);
4818
4837
  };
4819
4838
 
4820
- const create$r = () => {
4839
+ const create$p = () => {
4821
4840
  const $DialogTitle = document.createElement('h2');
4822
4841
  $DialogTitle.id = 'DialogTitle';
4823
4842
  const $DialogCloseButton = create$Button('Close', 'Close');
@@ -4898,7 +4917,7 @@ const setErrorStack = (state, errorStack) => {
4898
4917
 
4899
4918
  const ViewletDialog = {
4900
4919
  __proto__: null,
4901
- create: create$r,
4920
+ create: create$p,
4902
4921
  postAppend,
4903
4922
  setButtons,
4904
4923
  setCodeFrame,
@@ -4952,7 +4971,7 @@ const handleClickAt$2 = event => {
4952
4971
  const handleLoad$3 = event => {
4953
4972
  return ['handleLoad'];
4954
4973
  };
4955
- const handleContextMenu$6 = event => {
4974
+ const handleContextMenu$5 = event => {
4956
4975
  preventDefault(event);
4957
4976
  const {
4958
4977
  button,
@@ -4961,7 +4980,7 @@ const handleContextMenu$6 = event => {
4961
4980
  } = event;
4962
4981
  return ['handleContextMenu', button, clientX, clientY];
4963
4982
  };
4964
- const handleSashCornerPointerDown = create$u(event => {
4983
+ const handleSashCornerPointerDown = create$s(event => {
4965
4984
  const {
4966
4985
  clientX,
4967
4986
  clientY
@@ -4985,7 +5004,7 @@ const returnValue$6 = true;
4985
5004
  const ViewletE2eTestEvents = {
4986
5005
  __proto__: null,
4987
5006
  handleClickAt: handleClickAt$2,
4988
- handleContextMenu: handleContextMenu$6,
5007
+ handleContextMenu: handleContextMenu$5,
4989
5008
  handleLoad: handleLoad$3,
4990
5009
  handleSashCornerPointerDown,
4991
5010
  returnValue: returnValue$6
@@ -5049,7 +5068,7 @@ const handleClickAt$1 = event => {
5049
5068
  const handleLoad$2 = event => {
5050
5069
  return ['handleLoad'];
5051
5070
  };
5052
- const handleContextMenu$5 = event => {
5071
+ const handleContextMenu$4 = event => {
5053
5072
  preventDefault(event);
5054
5073
  const {
5055
5074
  button,
@@ -5063,7 +5082,7 @@ const returnValue$5 = true;
5063
5082
  const ViewletE2eTestsEvents = {
5064
5083
  __proto__: null,
5065
5084
  handleClickAt: handleClickAt$1,
5066
- handleContextMenu: handleContextMenu$5,
5085
+ handleContextMenu: handleContextMenu$4,
5067
5086
  handleLoad: handleLoad$2,
5068
5087
  returnValue: returnValue$5
5069
5088
  };
@@ -5160,10 +5179,10 @@ const appendWidget$5 = state => {
5160
5179
  } = state;
5161
5180
  append$1($Viewlet);
5162
5181
  };
5163
- const dispose$f = state => {
5182
+ const dispose$e = state => {
5164
5183
  remove$1(state.$Viewlet);
5165
5184
  };
5166
- const focus$d = (state, key, source) => {
5185
+ const focus$c = (state, key, source) => {
5167
5186
  if (!key) {
5168
5187
  return;
5169
5188
  }
@@ -5186,17 +5205,11 @@ const ViewletEditorCodeGenerator = {
5186
5205
  __proto__: null,
5187
5206
  Events: ViewletEditorCodeGeneratorEvents,
5188
5207
  appendWidget: appendWidget$5,
5189
- dispose: dispose$f,
5190
- focus: focus$d,
5208
+ dispose: dispose$e,
5209
+ focus: focus$c,
5191
5210
  setBounds: setBounds$9
5192
5211
  };
5193
5212
 
5194
- const attachEvents$8 = ($Node, eventMap) => {
5195
- for (const [key, value] of Object.entries(eventMap)) {
5196
- $Node.addEventListener(key, value);
5197
- }
5198
- };
5199
-
5200
5213
  const Passive = {
5201
5214
  passive: true
5202
5215
  };
@@ -5310,7 +5323,7 @@ const setNegativeMargin = (state, negativeMargin) => {
5310
5323
  setTop($ListItems, negativeMargin);
5311
5324
  };
5312
5325
 
5313
- const create$q = () => {
5326
+ const create$o = () => {
5314
5327
  const $ListItems = document.createElement('div');
5315
5328
  $ListItems.className = 'ListItems';
5316
5329
  $ListItems.role = ListBox;
@@ -5334,17 +5347,17 @@ const create$q = () => {
5334
5347
  $Viewlet
5335
5348
  };
5336
5349
  };
5337
- const attachEvents$7 = state => {
5350
+ const attachEvents$5 = state => {
5338
5351
  const {
5339
5352
  $ListItems,
5340
5353
  $ScrollBar,
5341
5354
  $Viewlet
5342
5355
  } = state;
5343
5356
  $Viewlet.addEventListener(Wheel, handleWheel$2, Passive);
5344
- attachEvents$8($ListItems, {
5357
+ attachEvents$6($ListItems, {
5345
5358
  [MouseDown]: handleMousedown
5346
5359
  });
5347
- attachEvents$8($ScrollBar, {
5360
+ attachEvents$6($ScrollBar, {
5348
5361
  [PointerDown]: handleScrollBarPointerDown$1
5349
5362
  });
5350
5363
  };
@@ -5363,7 +5376,7 @@ const setDom$8 = (state, dom) => {
5363
5376
  // TODO recycle nodes
5364
5377
  // TODO set right aria attributes on $EditorInput
5365
5378
  };
5366
- const dispose$e = state => {
5379
+ const dispose$d = state => {
5367
5380
  remove$1(state.$Viewlet);
5368
5381
  // state.$EditorInput.removeAttribute('aria-activedescendant')
5369
5382
  };
@@ -5393,9 +5406,9 @@ const setBounds$8 = (state, x, y, width, height) => {
5393
5406
 
5394
5407
  const ViewletEditorCompletion = {
5395
5408
  __proto__: null,
5396
- attachEvents: attachEvents$7,
5397
- create: create$q,
5398
- dispose: dispose$e,
5409
+ attachEvents: attachEvents$5,
5410
+ create: create$o,
5411
+ dispose: dispose$d,
5399
5412
  handleError: handleError$6,
5400
5413
  setBounds: setBounds$8,
5401
5414
  setContentHeight,
@@ -5417,7 +5430,7 @@ const ViewletEditorCompletionDetailsEvents = {
5417
5430
  returnValue: returnValue$4
5418
5431
  };
5419
5432
 
5420
- const create$p = () => {
5433
+ const create$n = () => {
5421
5434
  const $Viewlet = document.createElement('div');
5422
5435
  $Viewlet.className = 'Viewlet EditorCompletionDetails';
5423
5436
  $Viewlet.id = 'CompletionsDetails';
@@ -5425,7 +5438,7 @@ const create$p = () => {
5425
5438
  $Viewlet
5426
5439
  };
5427
5440
  };
5428
- const attachEvents$6 = state => {
5441
+ const attachEvents$4 = state => {
5429
5442
  // TODO
5430
5443
  };
5431
5444
  const setDom$7 = (state, dom) => {
@@ -5443,7 +5456,7 @@ const appendWidget$4 = state => {
5443
5456
  } = state;
5444
5457
  append$1($Viewlet);
5445
5458
  };
5446
- const dispose$d = state => {
5459
+ const dispose$c = state => {
5447
5460
  remove$1(state.$Viewlet);
5448
5461
  };
5449
5462
  const setBounds$7 = (state, x, y, width, height) => {
@@ -5457,9 +5470,9 @@ const ViewletEditorCompletionDetails = {
5457
5470
  __proto__: null,
5458
5471
  Events: ViewletEditorCompletionDetailsEvents,
5459
5472
  appendWidget: appendWidget$4,
5460
- attachEvents: attachEvents$6,
5461
- create: create$p,
5462
- dispose: dispose$d,
5473
+ attachEvents: attachEvents$4,
5474
+ create: create$n,
5475
+ dispose: dispose$c,
5463
5476
  setBounds: setBounds$7,
5464
5477
  setDom: setDom$7
5465
5478
  };
@@ -5477,7 +5490,7 @@ const ViewletEditorCompletionDetails = {
5477
5490
 
5478
5491
  // TODO aria alert
5479
5492
 
5480
- const create$o = () => {
5493
+ const create$m = () => {
5481
5494
  const $Viewlet = document.createElement('div');
5482
5495
  $Viewlet.className = 'Viewlet EditorError';
5483
5496
  return {
@@ -5499,13 +5512,13 @@ const setBounds$6 = (state, x, y, width, height) => {
5499
5512
 
5500
5513
  const ViewletEditorError = {
5501
5514
  __proto__: null,
5502
- create: create$o,
5515
+ create: create$m,
5503
5516
  setBounds: setBounds$6,
5504
5517
  setDom: setDom$6
5505
5518
  };
5506
5519
 
5507
5520
  const returnValue$3 = true;
5508
- const handleSashPointerDown$2 = create$u(event => {
5521
+ const handleSashPointerDown$2 = create$s(event => {
5509
5522
  const {
5510
5523
  clientX,
5511
5524
  clientY
@@ -5639,7 +5652,7 @@ const handleWheel$1 = event => {
5639
5652
  *
5640
5653
  * @param {MouseEvent} event
5641
5654
  */
5642
- const handleContextMenu$4 = event => {
5655
+ const handleContextMenu$3 = event => {
5643
5656
  preventDefault(event);
5644
5657
  const {
5645
5658
  button,
@@ -5647,7 +5660,7 @@ const handleContextMenu$4 = event => {
5647
5660
  clientY
5648
5661
  } = event;
5649
5662
  const uid = fromEvent(event);
5650
- handleContextMenu$7(uid, button, clientX, clientY);
5663
+ handleContextMenu$6(uid, button, clientX, clientY);
5651
5664
  };
5652
5665
  const handleError$5 = event => {
5653
5666
  const uid = fromEvent(event);
@@ -5658,19 +5671,19 @@ const handleFocus$6 = event => {
5658
5671
  handleFocus$8(uid);
5659
5672
  };
5660
5673
 
5661
- const create$n = () => {
5674
+ const create$l = () => {
5662
5675
  const $Viewlet = document.createElement('div');
5663
5676
  $Viewlet.className = 'Viewlet EditorImage';
5664
5677
  return {
5665
5678
  $Viewlet
5666
5679
  };
5667
5680
  };
5668
- const attachEvents$5 = state => {
5681
+ const attachEvents$3 = state => {
5669
5682
  const {
5670
5683
  $Viewlet
5671
5684
  } = state;
5672
- attachEvents$8($Viewlet, {
5673
- [ContextMenu]: handleContextMenu$4,
5685
+ attachEvents$6($Viewlet, {
5686
+ [ContextMenu]: handleContextMenu$3,
5674
5687
  [FocusIn]: handleFocus$6,
5675
5688
  [PointerDown]: handlePointerDown$1,
5676
5689
  [PointerUp]: handlePointerUp
@@ -5700,14 +5713,14 @@ const setDom$4 = (state, dom) => {
5700
5713
 
5701
5714
  const ViewletEditorImage = {
5702
5715
  __proto__: null,
5703
- attachEvents: attachEvents$5,
5704
- create: create$n,
5716
+ attachEvents: attachEvents$3,
5717
+ create: create$l,
5705
5718
  setDom: setDom$4,
5706
5719
  setDragging,
5707
5720
  setTransform
5708
5721
  };
5709
5722
 
5710
- const create$m = () => {
5723
+ const create$k = () => {
5711
5724
  const $Viewlet = document.createElement('div');
5712
5725
  $Viewlet.className = 'Viewlet EditorText';
5713
5726
  $Viewlet.textContent = 'loading...';
@@ -5715,7 +5728,7 @@ const create$m = () => {
5715
5728
  $Viewlet
5716
5729
  };
5717
5730
  };
5718
- const dispose$c = state => {};
5731
+ const dispose$b = state => {};
5719
5732
  const refresh$3 = (state, context) => {
5720
5733
  object(state);
5721
5734
  string(context.content);
@@ -5724,8 +5737,8 @@ const refresh$3 = (state, context) => {
5724
5737
 
5725
5738
  const ViewletEditorPlainText = {
5726
5739
  __proto__: null,
5727
- create: create$m,
5728
- dispose: dispose$c,
5740
+ create: create$k,
5741
+ dispose: dispose$b,
5729
5742
  refresh: refresh$3
5730
5743
  };
5731
5744
 
@@ -5753,7 +5766,7 @@ const appendWidget$2 = state => {
5753
5766
  } = state;
5754
5767
  append$1($Viewlet);
5755
5768
  };
5756
- const dispose$b = state => {
5769
+ const dispose$a = state => {
5757
5770
  remove$1(state.$Viewlet);
5758
5771
  };
5759
5772
 
@@ -5761,7 +5774,7 @@ const ViewletEditorSourceActions = {
5761
5774
  __proto__: null,
5762
5775
  Events: ViewletEditorSourceActionsEvents,
5763
5776
  appendWidget: appendWidget$2,
5764
- dispose: dispose$b,
5777
+ dispose: dispose$a,
5765
5778
  setBounds: setBounds$4
5766
5779
  };
5767
5780
 
@@ -5995,7 +6008,7 @@ const handlePaste = event => {
5995
6008
  const text = getText(clipboardData);
5996
6009
  return ['paste', text];
5997
6010
  };
5998
- const handleScrollBarVerticalPointerDown = create$u(event => {
6011
+ const handleScrollBarVerticalPointerDown = create$s(event => {
5999
6012
  const {
6000
6013
  clientY
6001
6014
  } = event;
@@ -6050,7 +6063,7 @@ const handleScrollBarContextMenu = event => {
6050
6063
  preventDefault(event);
6051
6064
  stopPropagation(event);
6052
6065
  };
6053
- const handleContextMenu$3 = event => {
6066
+ const handleContextMenu$2 = event => {
6054
6067
  preventDefault(event);
6055
6068
  const {
6056
6069
  button,
@@ -6118,7 +6131,7 @@ const setLineInfos = (state, dom) => {
6118
6131
  // 1. create -> only create dom elements
6119
6132
  // 2. render -> fill elements with attributes and data
6120
6133
  // that way all dom nodes can be recycled
6121
- const create$l = () => {
6134
+ const create$j = () => {
6122
6135
  const $EditorInput = document.createElement('textarea');
6123
6136
  $EditorInput.className = 'EditorInput';
6124
6137
  $EditorInput.ariaAutoComplete = List;
@@ -6206,7 +6219,7 @@ const create$l = () => {
6206
6219
  $Editor.role = Code;
6207
6220
  $Editor.append($LayerGutter, $EditorContent);
6208
6221
  attachEventsFunctional($Editor, {
6209
- [ContextMenu]: handleContextMenu$3,
6222
+ [ContextMenu]: handleContextMenu$2,
6210
6223
  [Wheel]: handleWheel,
6211
6224
  returnValue: true
6212
6225
  });
@@ -6285,7 +6298,7 @@ const setDecorationsDom$1 = (state, decorations) => {
6285
6298
  setDecorationsDom$2(state, decorations);
6286
6299
  };
6287
6300
 
6288
- const create$k = create$l;
6301
+ const create$i = create$j;
6289
6302
  const setText$1 = setText$2;
6290
6303
  const setSelections = setSelections$1;
6291
6304
  const setIncrementalEdits = setIncrementalEdits$1;
@@ -6322,13 +6335,13 @@ const hideOverlayMessage = state => {
6322
6335
  }
6323
6336
  };
6324
6337
  const setFocused$1 = setFocused$2;
6325
- const focus$c = setFocused$2;
6338
+ const focus$b = setFocused$2;
6326
6339
  const setDecorationsDom = setDecorationsDom$1;
6327
6340
 
6328
6341
  const ViewletEditorText = {
6329
6342
  __proto__: null,
6330
- create: create$k,
6331
- focus: focus$c,
6343
+ create: create$i,
6344
+ focus: focus$b,
6332
6345
  handleError: handleError$4,
6333
6346
  hideOverlayMessage,
6334
6347
  highlightAsLink,
@@ -6343,7 +6356,7 @@ const ViewletEditorText = {
6343
6356
  showOverlayMessage
6344
6357
  };
6345
6358
 
6346
- const create$j = () => {
6359
+ const create$h = () => {
6347
6360
  const $Viewlet = document.createElement('div');
6348
6361
  $Viewlet.className = 'Viewlet EditorTextError';
6349
6362
  return {
@@ -6359,11 +6372,11 @@ const setMessage$3 = (state, message) => {
6359
6372
 
6360
6373
  const ViewletEditorTextError = {
6361
6374
  __proto__: null,
6362
- create: create$j,
6375
+ create: create$h,
6363
6376
  setMessage: setMessage$3
6364
6377
  };
6365
6378
 
6366
- const create$i = () => {
6379
+ const create$g = () => {
6367
6380
  const $Viewlet = document.createElement('div');
6368
6381
  $Viewlet.className = 'Viewlet EditorWidgetError EditorOverlayMessage';
6369
6382
  return {
@@ -6386,12 +6399,12 @@ const setBounds$3 = (state, x, y, width, height) => {
6386
6399
 
6387
6400
  const ViewletEditorWidgetError = {
6388
6401
  __proto__: null,
6389
- create: create$i,
6402
+ create: create$g,
6390
6403
  setBounds: setBounds$3,
6391
6404
  setMessage: setMessage$2
6392
6405
  };
6393
6406
 
6394
- const create$h = () => {
6407
+ const create$f = () => {
6395
6408
  const $Viewlet = document.createElement('div');
6396
6409
  $Viewlet.dataset.viewlet = 'Empty';
6397
6410
  $Viewlet.className = 'Viewlet';
@@ -6400,18 +6413,18 @@ const create$h = () => {
6400
6413
  };
6401
6414
  };
6402
6415
  const refresh$2 = (state, context) => {};
6403
- const focus$b = state => {};
6404
- const dispose$a = state => {};
6416
+ const focus$a = state => {};
6417
+ const dispose$9 = state => {};
6405
6418
 
6406
6419
  const ViewletEmpty = {
6407
6420
  __proto__: null,
6408
- create: create$h,
6409
- dispose: dispose$a,
6410
- focus: focus$b,
6421
+ create: create$f,
6422
+ dispose: dispose$9,
6423
+ focus: focus$a,
6411
6424
  refresh: refresh$2
6412
6425
  };
6413
6426
 
6414
- const create$g = () => {
6427
+ const create$e = () => {
6415
6428
  const $Viewlet = document.createElement('div');
6416
6429
  $Viewlet.className = 'Viewlet EmptyEditor';
6417
6430
  return {
@@ -6421,10 +6434,10 @@ const create$g = () => {
6421
6434
 
6422
6435
  const ViewletEmptyEditor = {
6423
6436
  __proto__: null,
6424
- create: create$g
6437
+ create: create$e
6425
6438
  };
6426
6439
 
6427
- const create$f = () => {
6440
+ const create$d = () => {
6428
6441
  const $Viewlet = document.createElement('div');
6429
6442
  $Viewlet.className = 'Viewlet Error';
6430
6443
  return {
@@ -6440,7 +6453,7 @@ const setMessage$1 = (state, message) => {
6440
6453
 
6441
6454
  const ViewletError = {
6442
6455
  __proto__: null,
6443
- create: create$f,
6456
+ create: create$d,
6444
6457
  setMessage: setMessage$1
6445
6458
  };
6446
6459
 
@@ -6533,7 +6546,7 @@ const ViewletFindWidgetEvents = {
6533
6546
  returnValue: returnValue$2
6534
6547
  };
6535
6548
 
6536
- const create$e = () => {
6549
+ const create$c = () => {
6537
6550
  const $Viewlet = document.createElement('div');
6538
6551
  $Viewlet.className = 'Viewlet FindWidget';
6539
6552
  $Viewlet.role = Group;
@@ -6541,7 +6554,7 @@ const create$e = () => {
6541
6554
  $Viewlet
6542
6555
  };
6543
6556
  };
6544
- const focus$a = (state, key, source) => {
6557
+ const focus$9 = (state, key, source) => {
6545
6558
  if (!key) {
6546
6559
  return;
6547
6560
  }
@@ -6587,7 +6600,7 @@ const setBounds$2 = (state, x, y, width, height) => {
6587
6600
  } = state;
6588
6601
  setBounds$a($Viewlet, x, y, width, height);
6589
6602
  };
6590
- const dispose$9 = state => {
6603
+ const dispose$8 = state => {
6591
6604
  remove$1(state.$Viewlet);
6592
6605
  };
6593
6606
  const Events$3 = ViewletFindWidgetEvents;
@@ -6596,9 +6609,9 @@ const ViewletFindWidget = {
6596
6609
  __proto__: null,
6597
6610
  Events: Events$3,
6598
6611
  appendWidget: appendWidget$1,
6599
- create: create$e,
6600
- dispose: dispose$9,
6601
- focus: focus$a,
6612
+ create: create$c,
6613
+ dispose: dispose$8,
6614
+ focus: focus$9,
6602
6615
  setBounds: setBounds$2,
6603
6616
  setDom: setDom$3,
6604
6617
  setValue: setValue$1
@@ -6645,7 +6658,7 @@ const handleError$3 = (state, message) => {
6645
6658
  } = state;
6646
6659
  $Message.textContent = message;
6647
6660
  };
6648
- const focus$9 = state => {
6661
+ const focus$8 = state => {
6649
6662
  const {
6650
6663
  $Locations
6651
6664
  } = state;
@@ -6657,7 +6670,7 @@ const focus$9 = state => {
6657
6670
  const ViewletImplementations = {
6658
6671
  __proto__: null,
6659
6672
  Events: ViewletLocationsEvents,
6660
- focus: focus$9,
6673
+ focus: focus$8,
6661
6674
  handleError: handleError$3,
6662
6675
  setFocusedIndex: setFocusedIndex$1
6663
6676
  };
@@ -7259,7 +7272,7 @@ const handleBlur$3 = () => {
7259
7272
  const handleKeyDown$1 = handleKeyDown$2;
7260
7273
  const handleKeyUp = handleKeyUp$1;
7261
7274
 
7262
- const create$d = () => {
7275
+ const create$b = () => {
7263
7276
  // TODO use aria role splitter once supported https://github.com/w3c/aria/issues/1348
7264
7277
  const $SashSideBar = document.createElement('div');
7265
7278
  $SashSideBar.className = 'Viewlet Sash SashVertical';
@@ -7280,20 +7293,20 @@ const create$d = () => {
7280
7293
  $Viewlet
7281
7294
  };
7282
7295
  };
7283
- const attachEvents$4 = state => {
7296
+ const attachEvents$2 = state => {
7284
7297
  const {
7285
7298
  $SashPanel,
7286
7299
  $SashSideBar
7287
7300
  } = state;
7288
- attachEvents$8($SashSideBar, {
7301
+ attachEvents$6($SashSideBar, {
7289
7302
  [DoubleClick]: handleSashDoubleClick,
7290
7303
  [PointerDown]: handleSashPointerDown
7291
7304
  });
7292
- attachEvents$8($SashPanel, {
7305
+ attachEvents$6($SashPanel, {
7293
7306
  [DoubleClick]: handleSashDoubleClick,
7294
7307
  [PointerDown]: handleSashPointerDown
7295
7308
  });
7296
- attachEvents$8(window, {
7309
+ attachEvents$6(window, {
7297
7310
  [Blur]: handleBlur$3,
7298
7311
  [Focus]: handleFocus$2,
7299
7312
  [KeyDown]: handleKeyDown$1,
@@ -7313,333 +7326,10 @@ const setSashes = (state, sashSideBar, sashPanel) => {
7313
7326
  };
7314
7327
 
7315
7328
  const ViewletLayout = {
7316
- __proto__: null,
7317
- attachEvents: attachEvents$4,
7318
- create: create$d,
7319
- setSashes
7320
- };
7321
-
7322
- const CopyMove = 'copyMove';
7323
-
7324
- const ResourceUrls = 'resourceurls';
7325
-
7326
- const setEffectAllowed = (dataTransfer, effectAllowed) => {
7327
- object(dataTransfer);
7328
- string(effectAllowed);
7329
- dataTransfer.effectAllowed = effectAllowed;
7330
- };
7331
- const getFilePaths = dataTransfer => {
7332
- const data = dataTransfer.getData(ResourceUrls);
7333
- if (data) {
7334
- const parsed = JSON.parse(data);
7335
- if (Array.isArray(parsed) && data.length > 0) {
7336
- return parsed;
7337
- }
7338
- }
7339
- return [];
7340
- };
7341
- const getFilePath = dataTransfer => {
7342
- const filePaths = getFilePaths(dataTransfer);
7343
- if (filePaths.length === 0) {
7344
- return '';
7345
- }
7346
- return filePaths[0];
7347
- };
7348
-
7349
- const handleDragOver$1 = event => {
7350
- preventDefault(event);
7351
- const {
7352
- clientX,
7353
- clientY
7354
- } = event;
7355
- const uid = fromEvent(event);
7356
- handleDragOver$2(uid, clientX, clientY);
7357
- };
7358
- const handleDragEnd = event => {
7359
- const {
7360
- clientX,
7361
- clientY
7362
- } = event;
7363
- const uid = fromEvent(event);
7364
- handleDragEnd$1(uid, clientX, clientY);
7365
- };
7366
- const handleDragLeave = event => {
7367
- const {
7368
- clientX,
7369
- clientY
7370
- } = event;
7371
- const uid = fromEvent(event);
7372
- handleDragLeave$1(uid, clientX, clientY);
7373
- };
7374
-
7375
- /**
7376
- *
7377
- * @param {DragEvent} event
7378
- */
7379
- const handleDrop$1 = event => {
7380
- preventDefault(event);
7381
- const {
7382
- clientX,
7383
- clientY,
7384
- dataTransfer
7385
- } = event;
7386
- const {
7387
- files
7388
- } = dataTransfer;
7389
- const uid = fromEvent(event);
7390
- if (files.length > 0) {
7391
- return handleDropFiles(uid, clientX, clientY, files);
7392
- }
7393
- const filePath = getFilePath(dataTransfer);
7394
- if (filePath) {
7395
- handleDropFilePath(uid, clientX, clientY, filePath);
7396
- }
7397
- };
7398
-
7399
- const handleContextMenu$2 = event => {
7400
- if (event.defaultPrevented) {
7401
- return;
7402
- }
7403
- preventDefault(event);
7404
- const {
7405
- clientX,
7406
- clientY
7407
- } = event;
7408
- const uid = fromEvent(event);
7409
- handleContextMenu$7(uid, clientX, clientY);
7410
- };
7411
-
7412
- // TODO Main should not be bound to Editor -> Lazy load Editor
7413
- const create$c = () => {
7414
- const $Viewlet = document.createElement('div');
7415
- $Viewlet.id = 'Main';
7416
- $Viewlet.className = 'Viewlet Main';
7417
- $Viewlet.role = Main$1;
7418
-
7419
- // const $MainTabs = document.createElement('div')
7420
- // $MainTabs.className = 'MainTabs'
7421
- // $MainTabs.onmousedown = handleTabsMouseDown
7422
- // $MainTabs.oncontextmenu = handleTabsContextMenu
7423
- // // TODO race condition: what if tab has already been closed?
7424
- // $Main.append($MainTabs, $MainContent)
7425
-
7426
- return {
7427
- $DragOverlay: undefined,
7428
- $Main: $Viewlet,
7429
- $MainContent: undefined,
7430
- $MainTabs: undefined,
7431
- $Viewlet
7432
- };
7433
- };
7434
- const attachEvents$3 = state => {
7435
- const {
7436
- $Viewlet
7437
- } = state;
7438
- attachEvents$8($Viewlet, {
7439
- [ContextMenu]: handleContextMenu$2,
7440
- [DragEnd]: handleDragEnd,
7441
- [DragLeave]: handleDragLeave,
7442
- [DragOver]: handleDragOver$1,
7443
- [Drop]: handleDrop$1
7444
- });
7445
- };
7446
- const dispose$8 = state => {};
7447
- const replaceEditor = (state, id, uri, languageId) => {};
7448
- const addEditor = (state, id, uri, languageId) => {};
7449
-
7450
- // TODO there are 3 cases
7451
- // 1. no editor group and no editor
7452
- // 2. editor group exists and new editor should be added
7453
- // 3. editor group exists and editor should be replaced
7454
- const openEditor = async (state, id, uri, languageId) => {};
7455
- const closeAllViewlets = state => {
7456
- const {
7457
- $Main
7458
- } = state;
7459
- while ($Main.firstChild) {
7460
- $Main.firstChild.remove();
7461
- }
7462
- state.$MainTabs = undefined;
7463
- };
7464
- const closeViewletAndTab = (state, index) => {
7465
- state.$MainTabs.remove();
7466
- state.$MainTabs = undefined;
7467
- };
7468
- const focus$8 = () => {};
7469
- const highlightDragOver = state => {
7470
- const {
7471
- $MainTabs
7472
- } = state;
7473
- $MainTabs.classList.add('DragOver');
7474
- };
7475
- const stopHighlightDragOver = state => {
7476
- const {
7477
- $MainTabs
7478
- } = state;
7479
- $MainTabs.classList.remove('DragOver');
7480
- };
7481
- const create$DragOverlay = () => {
7482
- const $Overlay = document.createElement('div');
7483
- $Overlay.className = 'DragOverlay';
7484
- return $Overlay;
7485
- };
7486
- const setDragOverlay = (state, visible, x, y, width, height) => {
7487
- const hasOverlay = state.$DragOverlay;
7488
- if (!visible) {
7489
- if (hasOverlay) {
7490
- state.$DragOverlay.remove();
7491
- state.$DragOverlay = undefined;
7492
- }
7493
- return;
7494
- }
7495
- if (!hasOverlay) {
7496
- state.$DragOverlay = create$DragOverlay();
7497
- }
7498
- const {
7499
- $DragOverlay
7500
- } = state;
7501
- setBounds$a($DragOverlay, x, y, width, height);
7502
- if (!hasOverlay) {
7503
- document.body.append($DragOverlay);
7504
- }
7505
- };
7506
-
7507
- const ViewletMain = {
7508
- __proto__: null,
7509
- addEditor,
7510
- attachEvents: attachEvents$3,
7511
- closeAllViewlets,
7512
- closeViewletAndTab,
7513
- create: create$c,
7514
- dispose: dispose$8,
7515
- focus: focus$8,
7516
- highlightDragOver,
7517
- openEditor,
7518
- replaceEditor,
7519
- setDragOverlay,
7520
- stopHighlightDragOver
7521
- };
7522
-
7523
- // TODO
7524
- const getUid = () => {
7525
- const $Main = document.getElementById('Main');
7526
- if (!$Main) {
7527
- return 0;
7528
- }
7529
- return get($Main);
7530
- };
7531
- const handleTabsWheel = event => {
7532
- const uid = getUid();
7533
- const {
7534
- deltaX,
7535
- deltaY
7536
- } = event;
7537
- handleTabsWheel$1(uid, deltaX, deltaY);
7538
- };
7539
- const handleDragStart = event => {
7540
- const {
7541
- dataTransfer,
7542
- target
7543
- } = event;
7544
- setEffectAllowed(dataTransfer, CopyMove);
7545
- dataTransfer.setData('x-lvce-drag', target.dataset.dragUid);
7546
- };
7547
- const handleDragOver = event => {
7548
- const {
7549
- clientX,
7550
- clientY
7551
- } = event;
7552
- const uid = getUid();
7553
- handleTabsDragOver(uid, clientX, clientY);
7554
- };
7555
-
7556
- /**
7557
- *
7558
- * @param {DragEvent} event
7559
- */
7560
- const handleDrop = event => {
7561
- preventDefault(event);
7562
- const {
7563
- clientX,
7564
- clientY,
7565
- dataTransfer
7566
- } = event;
7567
- const item = dataTransfer.getData('x-lvce-drag');
7568
- const uid = getUid();
7569
- handleTabDrop(uid, item, clientX, clientY);
7570
- };
7571
- const handleTabsMouseDown = event => {
7572
- const {
7573
- button,
7574
- clientX,
7575
- clientY
7576
- } = event;
7577
- const uid = getUid();
7578
- handleTabClick(uid, button, clientX, clientY);
7579
- };
7580
- const handleTabsContextMenu = event => {
7581
- const {
7582
- clientX,
7583
- clientY
7584
- } = event;
7585
- preventDefault(event);
7586
- const uid = getUid();
7587
- handleTabContextMenu(uid, clientX, clientY);
7588
- };
7589
-
7590
- const create$b = () => {
7591
- const $MainTabs = document.createElement('div');
7592
- $MainTabs.className = 'Viewlet MainTabs';
7593
- $MainTabs.role = TabList;
7594
- // TODO race condition: what if tab has already been closed?
7595
- return {
7596
- $MainTabs,
7597
- $Viewlet: $MainTabs
7598
- };
7599
- };
7600
- const attachEvents$2 = state => {
7601
- const {
7602
- $MainTabs
7603
- } = state;
7604
- attachEvents$8($MainTabs, {
7605
- [ContextMenu]: handleTabsContextMenu,
7606
- [DragOver]: handleDragOver,
7607
- [DragStart]: handleDragStart,
7608
- [Drop]: handleDrop,
7609
- [MouseDown]: handleTabsMouseDown
7610
- });
7611
- $MainTabs.addEventListener(Wheel, handleTabsWheel, Passive);
7612
- };
7613
- const setTabsDom$2 = (state, dom) => {
7614
- const {
7615
- $Viewlet
7616
- } = state;
7617
- renderInto($Viewlet, dom);
7618
- };
7619
- const setScrollLeft = (state, scrollLeft) => {
7620
- const {
7621
- $Viewlet
7622
- } = state;
7623
- $Viewlet.scrollLeft = scrollLeft;
7624
- };
7625
- const setHighlight = (state, highlightLeft) => {
7626
- const $ExistingHighlight = state.$Viewlet.querySelector('.TabDragHighlight');
7627
- if ($ExistingHighlight) {
7628
- $ExistingHighlight.remove();
7629
- }
7630
- const $Highlight = document.createElement('div');
7631
- $Highlight.className = 'TabDragHighlight';
7632
- $Highlight.style.left = `${highlightLeft}px`;
7633
- state.$Viewlet.append($Highlight);
7634
- };
7635
-
7636
- const ViewletMainTabs = {
7637
7329
  __proto__: null,
7638
7330
  attachEvents: attachEvents$2,
7639
7331
  create: create$b,
7640
- setHighlight,
7641
- setScrollLeft,
7642
- setTabsDom: setTabsDom$2
7332
+ setSashes
7643
7333
  };
7644
7334
 
7645
7335
  const ActivityBar = 'ActivityBar';
@@ -7666,8 +7356,6 @@ const InlineDiffEditor = 'InlineDiffEditor';
7666
7356
  const Implementations = 'Implementations';
7667
7357
  const KeyBindings = 'KeyBindings';
7668
7358
  const Layout = 'Layout';
7669
- const Main = 'Main';
7670
- const MainTabs = 'MainTabs';
7671
7359
  const Output = 'Output';
7672
7360
  const Panel = 'Panel';
7673
7361
  const References = 'References';
@@ -7729,7 +7417,7 @@ const handleError$2 = (state, error) => {
7729
7417
  };
7730
7418
  const focus$7 = state => {
7731
7419
  object(state);
7732
- focus$f(state.$ViewletOutputContent);
7420
+ focus$e(state.$ViewletOutputContent);
7733
7421
  send('Focus.setFocus', FocusOutput);
7734
7422
  };
7735
7423
 
@@ -7845,13 +7533,13 @@ const attachEvents$1 = state => {
7845
7533
  $ButtonMaximize,
7846
7534
  $PanelHeader
7847
7535
  } = state;
7848
- attachEvents$8($PanelHeader, {
7536
+ attachEvents$6($PanelHeader, {
7849
7537
  [Click]: handleHeaderClick$1
7850
7538
  });
7851
- attachEvents$8($ButtonMaximize, {
7539
+ attachEvents$6($ButtonMaximize, {
7852
7540
  [Click]: handleClickMaximize
7853
7541
  });
7854
- attachEvents$8($ButtonClose, {
7542
+ attachEvents$6($ButtonClose, {
7855
7543
  [Click]: handleClickClose
7856
7544
  });
7857
7545
  };
@@ -7926,7 +7614,7 @@ const ViewletPanel = {
7926
7614
  const ViewletReferences = {
7927
7615
  __proto__: null,
7928
7616
  Events: ViewletLocationsEvents,
7929
- focus: focus$9,
7617
+ focus: focus$8,
7930
7618
  handleError: handleError$3,
7931
7619
  setFocusedIndex: setFocusedIndex$1
7932
7620
  };
@@ -8008,7 +7696,7 @@ const attachEvents = state => {
8008
7696
  const {
8009
7697
  $SideBarTitleArea
8010
7698
  } = state;
8011
- attachEvents$8($SideBarTitleArea, {
7699
+ attachEvents$6($SideBarTitleArea, {
8012
7700
  [Click]: handleHeaderClick
8013
7701
  });
8014
7702
  };
@@ -8143,7 +7831,7 @@ const handleContextMenu$1 = event => {
8143
7831
  clientY
8144
7832
  } = event;
8145
7833
  const uid = fromEvent(event);
8146
- handleContextMenu$7(uid, button, clientX, clientY);
7834
+ handleContextMenu$6(uid, button, clientX, clientY);
8147
7835
  };
8148
7836
 
8149
7837
  const handleFocus = event => {
@@ -8969,10 +8657,6 @@ const load$1 = moduleId => {
8969
8657
  return ViewletKeyBindings;
8970
8658
  case Layout:
8971
8659
  return ViewletLayout;
8972
- case Main:
8973
- return ViewletMain;
8974
- case MainTabs:
8975
- return ViewletMainTabs;
8976
8660
  case Output:
8977
8661
  return ViewletOutput;
8978
8662
  case Panel:
@@ -9323,6 +9007,15 @@ const move = async (uid, selector, target) => {
9323
9007
  // @ts-ignore
9324
9008
  $Target.moveBefore($Source, null);
9325
9009
  };
9010
+ const attachWindowEvents = () => {
9011
+ attachEvents$6(window, {
9012
+ [Blur]: handleBlur$3,
9013
+ [Focus]: handleFocus$2,
9014
+ [KeyDown]: handleKeyDown$1,
9015
+ [KeyUp]: handleKeyUp,
9016
+ [Resize]: handleResize
9017
+ });
9018
+ };
9326
9019
 
9327
9020
  // TODO this code is bad
9328
9021
  const sendMultiple = commands => {
@@ -9361,6 +9054,10 @@ const sendMultiple = commands => {
9361
9054
  ariaAnnounce(viewletId);
9362
9055
  break;
9363
9056
  }
9057
+ case 'Viewlet.attachWindowEvents':
9058
+ // @ts-ignore
9059
+ attachWindowEvents(viewletId, method, ...args);
9060
+ break;
9364
9061
  case 'Viewlet.create':
9365
9062
  {
9366
9063
  create$3(viewletId, method);
@@ -9627,6 +9324,8 @@ const getFn = command => {
9627
9324
  return appendViewlet;
9628
9325
  case 'Viewlet.ariaAnnounce':
9629
9326
  return ariaAnnounce;
9327
+ case 'Viewlet.attachWindowEvents':
9328
+ return attachWindowEvents;
9630
9329
  case 'Viewlet.create':
9631
9330
  return create$3;
9632
9331
  case 'Viewlet.createFunctionalRoot':
@@ -9910,7 +9609,7 @@ const commandMap = {
9910
9609
  'GetFilePathElectron.getFilePathElectron': getFilePathElectron,
9911
9610
  'HandleMessagePort.handleMessagePort': handleMessagePort,
9912
9611
  'InitData.getInitData': getInitData,
9913
- 'IpcParent.create': create$z,
9612
+ 'IpcParent.create': create$x,
9914
9613
  'KeyBindings.setIdentifiers': setIdentifiers,
9915
9614
  'Layout.getBounds': getBounds,
9916
9615
  'Location.getHref': getHref,
@@ -9925,10 +9624,10 @@ const commandMap = {
9925
9624
  'Menu.showControlled': showControlled,
9926
9625
  'Menu.showMenu': showMenu,
9927
9626
  'Meta.setThemeColor': setThemeColor,
9928
- 'Notification.create': create$y,
9627
+ 'Notification.create': create$w,
9929
9628
  'Notification.createWithOptions': createWithOptions,
9930
- 'Notification.dispose': dispose$i,
9931
- 'OffscreenCanvas.create': create$x,
9629
+ 'Notification.dispose': dispose$h,
9630
+ 'OffscreenCanvas.create': create$v,
9932
9631
  'OffscreenCanvas.create2': create2,
9933
9632
  'Open.openUrl': openUrl,
9934
9633
  'Performance.getMemory': getMemory,
@@ -9989,7 +9688,7 @@ const getConfiguredEditorWorkerUrl = () => {
9989
9688
  const editorWorkerUrl = getConfiguredEditorWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/editor-worker/dist/editorWorkerMain.js`;
9990
9689
 
9991
9690
  const launchEditorWorker = async port => {
9992
- const ipc = await create$z({
9691
+ const ipc = await create$x({
9993
9692
  method: ModuleWorkerWithMessagePort,
9994
9693
  name: 'Editor Worker',
9995
9694
  port,
@@ -10017,7 +9716,7 @@ const extensionHostWorkerUrl = getConfiguredExtensionHostWorkerUrl() || `${asset
10017
9716
 
10018
9717
  const launchExtensionHostWorker = async port => {
10019
9718
  const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
10020
- const ipc = await create$z({
9719
+ const ipc = await create$x({
10021
9720
  method: ModuleWorkerWithMessagePort,
10022
9721
  name,
10023
9722
  port,
@@ -10045,7 +9744,7 @@ const getConfiguredSyntaxHighlightingWorkerUrl = () => {
10045
9744
  const syntaxHighlightingWorkerUrl = getConfiguredSyntaxHighlightingWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/syntax-highlighting-worker/dist/syntaxHighlightingWorkerMain.js`;
10046
9745
 
10047
9746
  const launchSyntaxHighlightingWorker = async port => {
10048
- const ipc = await create$z({
9747
+ const ipc = await create$x({
10049
9748
  method: ModuleWorkerWithMessagePort,
10050
9749
  name: 'Syntax Highlighting Worker',
10051
9750
  port,