@lvce-editor/renderer-process 21.20.0 → 22.0.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.
@@ -10,7 +10,7 @@ class AssertionError extends Error {
10
10
  }
11
11
  }
12
12
  const Object$1 = 1;
13
- const Number$1 = 2;
13
+ const Number = 2;
14
14
  const Array$1 = 3;
15
15
  const String$1 = 4;
16
16
  const Boolean$1 = 5;
@@ -20,7 +20,7 @@ const Unknown$1 = 8;
20
20
  const getType = value => {
21
21
  switch (typeof value) {
22
22
  case 'number':
23
- return Number$1;
23
+ return Number;
24
24
  case 'function':
25
25
  return Function;
26
26
  case 'string':
@@ -47,7 +47,7 @@ const object = value => {
47
47
  };
48
48
  const number = value => {
49
49
  const type = getType(value);
50
- if (type !== Number$1) {
50
+ if (type !== Number) {
51
51
  throw new AssertionError('expected value to be of type number');
52
52
  }
53
53
  };
@@ -63,12 +63,6 @@ const string = value => {
63
63
  throw new AssertionError('expected value to be of type string');
64
64
  }
65
65
  };
66
- const boolean = value => {
67
- const type = getType(value);
68
- if (type !== Boolean$1) {
69
- throw new AssertionError('expected value to be of type boolean');
70
- }
71
- };
72
66
 
73
67
  const readText = async () => {
74
68
  return navigator.clipboard.readText();
@@ -572,6 +566,21 @@ const attachEvent$1 = ($Node, eventMap, key, value, newEventMap) => {
572
566
  const wrapped = getWrappedListener$1(listener, eventMap.returnValue);
573
567
  $Node.addEventListener(keyLower, wrapped, options);
574
568
  };
569
+ const STYLE_REGEX = /([^:;]+):\s*([^;]+)/g;
570
+ const KEBAB_CASE_REGEX = /-([a-z])/g;
571
+ const setStyle = ($Element, styleString) => {
572
+ if (typeof styleString !== 'string') {
573
+ return;
574
+ }
575
+ let match;
576
+ while ((match = STYLE_REGEX.exec(styleString)) !== null) {
577
+ const key = match[1].trim();
578
+ const value = match[2].trim();
579
+ // Convert kebab-case to camelCase for CSS properties with dashes
580
+ const camelCaseKey = key.replaceAll(KEBAB_CASE_REGEX, (_, char) => char.toUpperCase());
581
+ $Element.style[camelCaseKey] = value;
582
+ }
583
+ };
575
584
  const setProp = ($Element, key, value, eventMap, newEventMap) => {
576
585
  switch (key) {
577
586
  case 'ariaActivedescendant':
@@ -595,6 +604,9 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
595
604
  $Element.removeAttribute('aria-owns');
596
605
  }
597
606
  break;
607
+ case 'childCount':
608
+ case 'type':
609
+ break;
598
610
  case 'height':
599
611
  case 'width':
600
612
  if ($Element instanceof HTMLImageElement) {
@@ -642,8 +654,11 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
642
654
  case 'onFocusIn':
643
655
  case 'onFocusOut':
644
656
  case 'onInput':
657
+ case 'onKeydown':
645
658
  case 'onKeyDown':
659
+ case 'onKeyUp':
646
660
  case 'onMouseDown':
661
+ case 'onMouseMove':
647
662
  case 'onMouseOut':
648
663
  case 'onMouseOver':
649
664
  case 'onPointerDown':
@@ -660,9 +675,7 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
660
675
  attachEvent$1($Element, eventMap, eventName, value, newEventMap);
661
676
  break;
662
677
  case 'style':
663
- throw new Error('style property is not supported');
664
- case 'childCount':
665
- case 'type':
678
+ setStyle($Element, value);
666
679
  break;
667
680
  case 'translate':
668
681
  $Element.style[key] = value;
@@ -844,7 +857,7 @@ const enabled = () => {
844
857
  return ignore;
845
858
  };
846
859
  let id$1 = 0;
847
- const create$G = () => {
860
+ const create$D = () => {
848
861
  return ++id$1;
849
862
  };
850
863
  const state$8 = Object.create(null);
@@ -859,7 +872,7 @@ const getFileHandles$1 = async ids => {
859
872
  return handles;
860
873
  };
861
874
  const add = promise => {
862
- const id = create$G();
875
+ const id = create$D();
863
876
  state$8[id] = promise;
864
877
  return id;
865
878
  };
@@ -1505,7 +1518,7 @@ const getWorkerDisplayName$1 = name => {
1505
1518
  }
1506
1519
  return `${name} worker`;
1507
1520
  };
1508
- const create$F = async ({
1521
+ const create$C = async ({
1509
1522
  name,
1510
1523
  url
1511
1524
  }) => {
@@ -1572,7 +1585,7 @@ const wrap = worker => {
1572
1585
 
1573
1586
  const IpcParentWithModuleWorker$2 = {
1574
1587
  __proto__: null,
1575
- create: create$F,
1588
+ create: create$C,
1576
1589
  wrap
1577
1590
  };
1578
1591
 
@@ -1580,7 +1593,7 @@ const isMessagePort$1 = value => {
1580
1593
  return value instanceof MessagePort;
1581
1594
  };
1582
1595
 
1583
- const create$E = async ({
1596
+ const create$B = async ({
1584
1597
  url
1585
1598
  }) => {
1586
1599
  string(url);
@@ -1601,10 +1614,10 @@ const create$E = async ({
1601
1614
 
1602
1615
  const IpcParentWithMessagePort$2 = {
1603
1616
  __proto__: null,
1604
- create: create$E
1617
+ create: create$B
1605
1618
  };
1606
1619
 
1607
- const create$D = async url => {
1620
+ const create$A = async url => {
1608
1621
  const referencePort = await new Promise(resolve => {
1609
1622
  globalThis.acceptReferencePort = resolve;
1610
1623
  import(url);
@@ -1615,7 +1628,7 @@ const create$D = async url => {
1615
1628
 
1616
1629
  const IpcParentWithReferencePort = {
1617
1630
  __proto__: null,
1618
- create: create$D
1631
+ create: create$A
1619
1632
  };
1620
1633
 
1621
1634
  const normalizeLine = line => {
@@ -1760,7 +1773,7 @@ const fixElectronParameters = value => {
1760
1773
  transfer
1761
1774
  };
1762
1775
  };
1763
- const attachEvents$9 = that => {
1776
+ const attachEvents$7 = that => {
1764
1777
  const handleMessage = (...args) => {
1765
1778
  const data = that.getData(...args);
1766
1779
  that.dispatchEvent(new MessageEvent('message', {
@@ -1777,7 +1790,7 @@ class Ipc extends EventTarget {
1777
1790
  constructor(rawIpc) {
1778
1791
  super();
1779
1792
  this._rawIpc = rawIpc;
1780
- attachEvents$9(this);
1793
+ attachEvents$7(this);
1781
1794
  }
1782
1795
  }
1783
1796
  const E_INCOMPATIBLE_NATIVE_MODULE = 'E_INCOMPATIBLE_NATIVE_MODULE';
@@ -2384,7 +2397,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
2384
2397
  const errorProperty = getErrorProperty(error, prettyError);
2385
2398
  return create$1$1(id, errorProperty);
2386
2399
  };
2387
- const create$C = (message, result) => {
2400
+ const create$z = (message, result) => {
2388
2401
  return {
2389
2402
  jsonrpc: Two$1,
2390
2403
  id: message.id,
@@ -2393,7 +2406,7 @@ const create$C = (message, result) => {
2393
2406
  };
2394
2407
  const getSuccessResponse = (message, result) => {
2395
2408
  const resultProperty = result ?? null;
2396
- return create$C(message, resultProperty);
2409
+ return create$z(message, resultProperty);
2397
2410
  };
2398
2411
  const getErrorResponseSimple = (id, error) => {
2399
2412
  return {
@@ -2720,7 +2733,7 @@ const PlainMessagePortRpcParent = {
2720
2733
  };
2721
2734
 
2722
2735
  // TODO add test
2723
- const create$B = async ({
2736
+ const create$y = async ({
2724
2737
  name,
2725
2738
  port,
2726
2739
  url
@@ -2736,7 +2749,7 @@ const create$B = async ({
2736
2749
 
2737
2750
  const IpcParentWithModuleWorkerWithMessagePort = {
2738
2751
  __proto__: null,
2739
- create: create$B
2752
+ create: create$y
2740
2753
  };
2741
2754
 
2742
2755
  const Web = 1;
@@ -2769,7 +2782,7 @@ const platform = getPlatform();
2769
2782
  const isElectron = platform === Electron;
2770
2783
 
2771
2784
  // TODO use handleIncomingIpc function
2772
- const create$A = async ({
2785
+ const create$x = async ({
2773
2786
  ipcId,
2774
2787
  port
2775
2788
  }) => {
@@ -2787,7 +2800,7 @@ const create$A = async ({
2787
2800
 
2788
2801
  const IpcParentWithElectron = {
2789
2802
  __proto__: null,
2790
- create: create$A
2803
+ create: create$x
2791
2804
  };
2792
2805
 
2793
2806
  const getModule = method => {
@@ -2898,7 +2911,7 @@ const hydrate$3 = async () => {
2898
2911
  };
2899
2912
 
2900
2913
  // TODO needed?
2901
- const dispose$j = () => {
2914
+ const dispose$h = () => {
2902
2915
  if (state$7.rpc) {
2903
2916
  // @ts-expect-error
2904
2917
  state$7.rpc.dispose();
@@ -2923,7 +2936,7 @@ const invokeAndTransfer = (method, ...params) => {
2923
2936
 
2924
2937
  const RendererWorker = {
2925
2938
  __proto__: null,
2926
- dispose: dispose$j,
2939
+ dispose: dispose$h,
2927
2940
  hydrate: hydrate$3,
2928
2941
  invoke: invoke$1,
2929
2942
  invokeAndTransfer,
@@ -2932,7 +2945,7 @@ const RendererWorker = {
2932
2945
  state: state$7
2933
2946
  };
2934
2947
 
2935
- const create$z = async ({
2948
+ const create$w = async ({
2936
2949
  method,
2937
2950
  ...options
2938
2951
  }) => {
@@ -3053,7 +3066,7 @@ const create$Notification = message => {
3053
3066
  $Notification.textContent = message;
3054
3067
  return $Notification;
3055
3068
  };
3056
- const create$y = (type, message) => {
3069
+ const create$v = (type, message) => {
3057
3070
  // TODO this pattern might be also useful for activitybar, sidebar etc., creating elements as late as possible, only when actually needed
3058
3071
  const $Notification = create$Notification(message);
3059
3072
  append$1($Notification);
@@ -3098,7 +3111,7 @@ const createWithOptions = (type, message, options) => {
3098
3111
  const $Notification = create$NotificationWithOptions(message, options);
3099
3112
  append$1($Notification);
3100
3113
  };
3101
- const dispose$i = id => {
3114
+ const dispose$g = id => {
3102
3115
  // const $Notification = state.$Notifications
3103
3116
  };
3104
3117
 
@@ -3115,7 +3128,7 @@ const set$6 = (canvasId, canvas) => {
3115
3128
  const get$4 = id => {
3116
3129
  return get$5(id);
3117
3130
  };
3118
- const create$x = async (canvasId, objectId) => {
3131
+ const create$u = async (canvasId, objectId) => {
3119
3132
  const canvas = document.createElement('canvas');
3120
3133
  const offscreenCanvas = canvas.transferControlToOffscreen();
3121
3134
  set$6(canvasId, canvas);
@@ -3150,7 +3163,6 @@ const Complementary = 'complementary';
3150
3163
  const Group = 'group';
3151
3164
  const ListBox = 'listbox';
3152
3165
  const Log = 'log';
3153
- const Main$1 = 'main';
3154
3166
  const Menu = 'menu';
3155
3167
  const None$2 = 'none';
3156
3168
  const Status = 'status';
@@ -3180,11 +3192,6 @@ const CompositionUpdate = 'compositionupdate';
3180
3192
  const ContextMenu = 'contextmenu';
3181
3193
  const Cut = 'cut';
3182
3194
  const DoubleClick = 'dblclick';
3183
- const DragEnd = 'dragend';
3184
- const DragLeave = 'dragleave';
3185
- const DragOver = 'dragover';
3186
- const DragStart = 'dragstart';
3187
- const Drop = 'drop';
3188
3195
  const Error$2 = 'error';
3189
3196
  const Focus = 'focus';
3190
3197
  const FocusIn = 'focusin';
@@ -3249,7 +3256,7 @@ const getElement = () => {
3249
3256
  return state$4.$PreviousFocusElement;
3250
3257
  };
3251
3258
 
3252
- const focus$f = $Element => {
3259
+ const focus$d = $Element => {
3253
3260
  if ($Element === document.activeElement) {
3254
3261
  return;
3255
3262
  }
@@ -3418,10 +3425,10 @@ const handleMouseLeave = event => {
3418
3425
  const handleKeyDown$5 = event => {
3419
3426
  state$3.handleKeyDown(event);
3420
3427
  };
3421
- const handleFocusOut$1 = event => {
3428
+ const handleFocusOut = event => {
3422
3429
  state$3.handleFocusOut(event);
3423
3430
  };
3424
- const create$Menu$1 = () => {
3431
+ const create$Menu = () => {
3425
3432
  // TODO set aria label on menu (e.g. File, Edit, Selection)
3426
3433
  const $Menu = document.createElement('ul');
3427
3434
  $Menu.className = 'Menu';
@@ -3440,8 +3447,8 @@ const create$Menu$1 = () => {
3440
3447
  // passive: true,
3441
3448
  // })
3442
3449
  $Menu.onkeydown = handleKeyDown$5;
3443
- $Menu.addEventListener(FocusOut, handleFocusOut$1);
3444
- $Menu.oncontextmenu = handleContextMenu$9;
3450
+ $Menu.addEventListener(FocusOut, handleFocusOut);
3451
+ $Menu.oncontextmenu = handleContextMenu$8;
3445
3452
  // $ContextMenu.onfocus = handleFocus
3446
3453
  // $ContextMenu.onblur = handleBlur
3447
3454
  return $Menu;
@@ -3470,19 +3477,19 @@ const handleBackDropMouseDown = event => {
3470
3477
  stopPropagation(event);
3471
3478
  send(/* Menu.hide */'Menu.hide');
3472
3479
  };
3473
- const handleContextMenu$9 = event => {
3480
+ const handleContextMenu$8 = event => {
3474
3481
  preventDefault(event);
3475
3482
  };
3476
3483
  const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mouseBlocking = false) => {
3477
3484
  if (mouseBlocking) {
3478
3485
  const $BackDrop = create$BackDrop();
3479
3486
  $BackDrop.onmousedown = handleBackDropMouseDown;
3480
- $BackDrop.oncontextmenu = handleContextMenu$9;
3487
+ $BackDrop.oncontextmenu = handleContextMenu$8;
3481
3488
  // @ts-expect-error
3482
3489
  state$3.$BackDrop = $BackDrop;
3483
3490
  append$1($BackDrop);
3484
3491
  }
3485
- const $Menu = create$Menu$1();
3492
+ const $Menu = create$Menu();
3486
3493
  renderInto($Menu, dom);
3487
3494
  setXAndY($Menu, x, y);
3488
3495
  $Menu.id = `Menu-${level}`;
@@ -3498,7 +3505,7 @@ const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mous
3498
3505
  state$3.$$Menus.push($Menu);
3499
3506
  append$1($Menu);
3500
3507
  if (level === 0) {
3501
- focus$f($Menu);
3508
+ focus$d($Menu);
3502
3509
  send('Focus.setFocus', FocusMenu);
3503
3510
  }
3504
3511
  };
@@ -4292,7 +4299,7 @@ const showError = (message, y, x) => {
4292
4299
  $ImagePreviewImage
4293
4300
  };
4294
4301
  };
4295
- const create$w = (uri, top, left) => {
4302
+ const create$t = (uri, top, left) => {
4296
4303
  const $ImagePreviewImage = document.createElement('img');
4297
4304
  $ImagePreviewImage.className = 'ImagePreviewImage';
4298
4305
  $ImagePreviewImage.src = uri;
@@ -4317,14 +4324,14 @@ const create$w = (uri, top, left) => {
4317
4324
  const update = (state, uri) => {
4318
4325
  state.$ImagePreviewImage.uri = uri;
4319
4326
  };
4320
- const dispose$h = state => {
4327
+ const dispose$f = state => {
4321
4328
  remove$1(state.$ImagePreview);
4322
4329
  };
4323
4330
 
4324
4331
  const ImagePreview$1 = {
4325
4332
  __proto__: null,
4326
- create: create$w,
4327
- dispose: dispose$h,
4333
+ create: create$t,
4334
+ dispose: dispose$f,
4328
4335
  showError,
4329
4336
  update
4330
4337
  };
@@ -4371,7 +4378,7 @@ const handleFocus$9 = () => {
4371
4378
 
4372
4379
  // TODO use context menu events function again
4373
4380
 
4374
- const handleContextMenu$8 = event => {
4381
+ const handleContextMenu$7 = event => {
4375
4382
  preventDefault(event);
4376
4383
  const {
4377
4384
  button,
@@ -4380,22 +4387,22 @@ const handleContextMenu$8 = event => {
4380
4387
  } = event;
4381
4388
  return ['handleContextMenu', button, clientX, clientY];
4382
4389
  };
4383
- const returnValue$8 = true;
4390
+ const returnValue$7 = true;
4384
4391
 
4385
4392
  const ViewletActivityBarEvents = {
4386
4393
  __proto__: null,
4387
4394
  handleBlur: handleBlur$9,
4388
- handleContextMenu: handleContextMenu$8,
4395
+ handleContextMenu: handleContextMenu$7,
4389
4396
  handleFocus: handleFocus$9,
4390
4397
  handleMouseDown: handleMouseDown$3,
4391
- returnValue: returnValue$8
4398
+ returnValue: returnValue$7
4392
4399
  };
4393
4400
 
4394
- const Events$5 = ViewletActivityBarEvents;
4401
+ const Events$4 = ViewletActivityBarEvents;
4395
4402
 
4396
4403
  const ViewletActivityBar = {
4397
4404
  __proto__: null,
4398
- Events: Events$5
4405
+ Events: Events$4
4399
4406
  };
4400
4407
 
4401
4408
  const executeViewletCommand = (uid, command, ...args) => {
@@ -4420,7 +4427,7 @@ const forwardViewletCommand = name => {
4420
4427
  forwardViewletCommand('clearFilter');
4421
4428
  forwardViewletCommand('close');
4422
4429
  forwardViewletCommand('closeEditor');
4423
- const closeMenu$1 = forwardViewletCommand('closeMenu');
4430
+ forwardViewletCommand('closeMenu');
4424
4431
  forwardViewletCommand('compositionEnd');
4425
4432
  forwardViewletCommand('compositionStart');
4426
4433
  forwardViewletCommand('compositionUpdate');
@@ -4434,7 +4441,7 @@ forwardViewletCommand('handleBeforeInput');
4434
4441
  forwardViewletCommand('handleBeforeInputFromContentEditable');
4435
4442
  const handleBlur$8 = forwardViewletCommand('handleBlur');
4436
4443
  const handleButtonClick = forwardViewletCommand('handleButtonClick');
4437
- const handleClick$6 = forwardViewletCommand('handleClick');
4444
+ const handleClick$5 = forwardViewletCommand('handleClick');
4438
4445
  const handleClickAction$2 = forwardViewletCommand('handleClickAction');
4439
4446
  forwardViewletCommand('handleClickAdd');
4440
4447
  const handleClickAt$3 = forwardViewletCommand('handleClickAt');
@@ -4447,29 +4454,29 @@ forwardViewletCommand('handleClickOpenFolder');
4447
4454
  forwardViewletCommand('handleClickRestore');
4448
4455
  const handleClickTab$2 = forwardViewletCommand('handleClickTab');
4449
4456
  forwardViewletCommand('handleClickToggleMaximize');
4450
- const handleContextMenu$7 = forwardViewletCommand('handleContextMenu');
4457
+ const handleContextMenu$6 = forwardViewletCommand('handleContextMenu');
4451
4458
  forwardViewletCommand('handleDoubleClick');
4452
- const handleDragEnd$1 = forwardViewletCommand('handleDragEnd');
4453
- const handleDragLeave$1 = forwardViewletCommand('handleDragLeave');
4454
- const handleDragOver$2 = forwardViewletCommand('handleDragOver');
4459
+ forwardViewletCommand('handleDragEnd');
4460
+ forwardViewletCommand('handleDragLeave');
4461
+ forwardViewletCommand('handleDragOver');
4462
+ forwardViewletCommand('handleDrop');
4463
+ forwardViewletCommand('handleDropFilePath');
4455
4464
  forwardViewletCommand('handleDrop');
4456
- const handleDropFilePath = forwardViewletCommand('handleDropFilePath');
4457
- const handleDropFiles = forwardViewletCommand('handleDrop');
4458
4465
  forwardViewletCommand('handleFeaturesClick');
4459
4466
  forwardViewletCommand('handleClickSize');
4460
4467
  forwardViewletCommand('handleClickDisable');
4461
4468
  forwardViewletCommand('handleClickUninstall');
4462
4469
  forwardViewletCommand('handleFilterInput');
4463
4470
  const handleFocus$8 = forwardViewletCommand('handleFocus');
4464
- const handleFocusIn$4 = forwardViewletCommand('handleFocusIn');
4471
+ const handleFocusIn$3 = forwardViewletCommand('handleFocusIn');
4465
4472
  forwardViewletCommand('handleIconError');
4466
4473
  const handleImageError = forwardViewletCommand('handleImageError');
4467
4474
  const handleInput$6 = forwardViewletCommand('handleInput');
4468
4475
  const handleKeyDown$4 = forwardViewletCommand('handleKeyDown');
4469
4476
  forwardViewletCommand('handleListBlur');
4470
4477
  forwardViewletCommand('handleListFocus');
4471
- const handleMenuClick$1 = forwardViewletCommand('handleMenuClick');
4472
- const handleMenuMouseOver$1 = forwardViewletCommand('handleMenuMouseOver');
4478
+ forwardViewletCommand('handleMenuClick');
4479
+ forwardViewletCommand('handleMenuMouseOver');
4473
4480
  const handleMouseDown$2 = forwardViewletCommand('handleMouseDown');
4474
4481
  forwardViewletCommand('handleMouseMove');
4475
4482
  const handleMouseOut$1 = forwardViewletCommand('handleMouseOut');
@@ -4493,14 +4500,14 @@ forwardViewletCommand('handleScrollBarMove');
4493
4500
  forwardViewletCommand('handleScrollBarVerticalPointerDown');
4494
4501
  forwardViewletCommand('handleSliderPointerDown');
4495
4502
  forwardViewletCommand('handleSliderPointerMove');
4496
- const handleTabClick = forwardViewletCommand('handleTabClick');
4497
- const handleTabContextMenu = forwardViewletCommand('handleTabContextMenu');
4498
- const handleTabDrop = forwardViewletCommand('handleTabDrop');
4503
+ forwardViewletCommand('handleTabClick');
4504
+ forwardViewletCommand('handleTabContextMenu');
4505
+ forwardViewletCommand('handleTabDrop');
4499
4506
  forwardViewletCommand('handleTabsClick');
4500
- const handleTabsDragOver = forwardViewletCommand('handleTabsDragOver');
4507
+ forwardViewletCommand('handleTabsDragOver');
4501
4508
  forwardViewletCommand('handleTabsPointerOut');
4502
4509
  forwardViewletCommand('handleTabsPointerOver');
4503
- const handleTabsWheel$1 = forwardViewletCommand('handleTabsWheel');
4510
+ forwardViewletCommand('handleTabsWheel');
4504
4511
  forwardViewletCommand('handleTouchEnd');
4505
4512
  forwardViewletCommand('handleTouchMove');
4506
4513
  forwardViewletCommand('handleTouchStart');
@@ -4541,21 +4548,21 @@ const ViewletAudioEvents = {
4541
4548
  handleAudioError
4542
4549
  };
4543
4550
 
4544
- const Events$4 = ViewletAudioEvents;
4551
+ const Events$3 = ViewletAudioEvents;
4545
4552
 
4546
4553
  const ViewletAudio = {
4547
4554
  __proto__: null,
4548
- Events: Events$4
4555
+ Events: Events$3
4549
4556
  };
4550
4557
 
4551
- const create$v = () => {
4558
+ const create$s = () => {
4552
4559
  const $Viewlet = document.createElement('div');
4553
4560
  $Viewlet.className = 'Viewlet Clock';
4554
4561
  return {
4555
4562
  $Viewlet
4556
4563
  };
4557
4564
  };
4558
- const dispose$g = state => {};
4565
+ const dispose$e = state => {};
4559
4566
  const refresh$4 = () => {};
4560
4567
  const setTime = (state, time) => {
4561
4568
  object(state);
@@ -4565,8 +4572,8 @@ const setTime = (state, time) => {
4565
4572
 
4566
4573
  const ViewletClock = {
4567
4574
  __proto__: null,
4568
- create: create$v,
4569
- dispose: dispose$g,
4575
+ create: create$s,
4576
+ dispose: dispose$e,
4570
4577
  refresh: refresh$4,
4571
4578
  setTime
4572
4579
  };
@@ -4594,7 +4601,7 @@ const stopTracking$1 = ($Target, pointerId, handlePointerMove, handlePointerUp)
4594
4601
  // TODO use pointerlost event instead
4595
4602
  $Target.removeEventListener(PointerUp, handlePointerUp);
4596
4603
  };
4597
- const create$u = (pointerDown, pointerMove, pointerUp) => {
4604
+ const create$r = (pointerDown, pointerMove, pointerUp) => {
4598
4605
  const shared = (fn, event) => {
4599
4606
  const message = fn(event);
4600
4607
  if (!message || message.length === 0) {
@@ -4627,7 +4634,7 @@ const create$u = (pointerDown, pointerMove, pointerUp) => {
4627
4634
  };
4628
4635
 
4629
4636
  const handleOffset = 20;
4630
- const handleSliderPointerDown = create$u(event => {
4637
+ const handleSliderPointerDown = create$r(event => {
4631
4638
  const {
4632
4639
  clientX,
4633
4640
  clientY
@@ -4651,12 +4658,12 @@ const handlePointerDown$2 = event => {
4651
4658
  }
4652
4659
  return [];
4653
4660
  };
4654
- const returnValue$7 = true;
4661
+ const returnValue$6 = true;
4655
4662
 
4656
4663
  const ViewletColorPickerEvents = {
4657
4664
  __proto__: null,
4658
4665
  handlePointerDown: handlePointerDown$2,
4659
- returnValue: returnValue$7
4666
+ returnValue: returnValue$6
4660
4667
  };
4661
4668
 
4662
4669
  const setColor = (state, color) => {
@@ -4709,14 +4716,14 @@ const ViewletDebugConsoleEvents = {
4709
4716
  handleInput: handleInput$5
4710
4717
  };
4711
4718
 
4712
- const create$t = () => {
4719
+ const create$q = () => {
4713
4720
  const $Viewlet = document.createElement('div');
4714
4721
  $Viewlet.className = 'Viewlet DebugConsole';
4715
4722
  return {
4716
4723
  $Viewlet
4717
4724
  };
4718
4725
  };
4719
- const setDom$9 = (state, dom) => {
4726
+ const setDom$8 = (state, dom) => {
4720
4727
  const {
4721
4728
  $Viewlet
4722
4729
  } = state;
@@ -4725,8 +4732,8 @@ const setDom$9 = (state, dom) => {
4725
4732
 
4726
4733
  const ViewletDebugConsole = {
4727
4734
  __proto__: null,
4728
- create: create$t,
4729
- setDom: setDom$9
4735
+ create: create$q,
4736
+ setDom: setDom$8
4730
4737
  };
4731
4738
 
4732
4739
  const handleKeyDown$3 = event => {
@@ -4762,7 +4769,7 @@ const setValue$2 = (state, value) => {
4762
4769
  const $Input = $Viewlet.querySelector('input');
4763
4770
  $Input.value = value;
4764
4771
  };
4765
- const focus$e = state => {
4772
+ const focus$c = state => {
4766
4773
  const {
4767
4774
  $Viewlet
4768
4775
  } = state;
@@ -4773,7 +4780,7 @@ const focus$e = state => {
4773
4780
  const ViewletDefineKeyBinding = {
4774
4781
  __proto__: null,
4775
4782
  Events: ViewletDefineKeyBindingEvents,
4776
- focus: focus$e,
4783
+ focus: focus$c,
4777
4784
  setValue: setValue$2
4778
4785
  };
4779
4786
 
@@ -4786,7 +4793,7 @@ const setMaskImage = ($Element, icon) => {
4786
4793
  }
4787
4794
  };
4788
4795
 
4789
- const create$s = icon => {
4796
+ const create$p = icon => {
4790
4797
  const $Icon = document.createElement('div');
4791
4798
  $Icon.className = 'MaskIcon';
4792
4799
  setMaskImage($Icon, icon);
@@ -4796,7 +4803,7 @@ const create$s = icon => {
4796
4803
 
4797
4804
  const create$Button = (label, icon) => {
4798
4805
  // TODO icon div might not be needed (unnecessary html element)
4799
- const $Icon = create$s(icon);
4806
+ const $Icon = create$p(icon);
4800
4807
  const $Button = document.createElement('button');
4801
4808
  $Button.className = 'IconButton';
4802
4809
  $Button.title = label;
@@ -4805,19 +4812,19 @@ const create$Button = (label, icon) => {
4805
4812
  return $Button;
4806
4813
  };
4807
4814
 
4808
- const handleClick$5 = index => {
4815
+ const handleClick$4 = index => {
4809
4816
  send(/* Dialog.handleClick */'Dialog.handleClick', /* index */index);
4810
4817
  };
4811
4818
 
4812
- const handleClick$4 = event => {
4819
+ const handleClick$3 = event => {
4813
4820
  const {
4814
4821
  target
4815
4822
  } = event;
4816
4823
  const index = getNodeIndex(target);
4817
- handleClick$5(index);
4824
+ handleClick$4(index);
4818
4825
  };
4819
4826
 
4820
- const create$r = () => {
4827
+ const create$o = () => {
4821
4828
  const $DialogTitle = document.createElement('h2');
4822
4829
  $DialogTitle.id = 'DialogTitle';
4823
4830
  const $DialogCloseButton = create$Button('Close', 'Close');
@@ -4844,7 +4851,7 @@ const create$r = () => {
4844
4851
  $Dialog.setAttribute(AriaLabelledBy, 'DialogTitle');
4845
4852
  $Dialog.setAttribute(AriaDescribedBy, 'DialogBodyErrorMessage');
4846
4853
  $Dialog.append($DialogHeader, $DialogBody);
4847
- $Dialog.onclick = handleClick$4;
4854
+ $Dialog.onclick = handleClick$3;
4848
4855
  return {
4849
4856
  $DialogBodyErrorCodeFrame,
4850
4857
  $DialogBodyErrorMessage,
@@ -4898,7 +4905,7 @@ const setErrorStack = (state, errorStack) => {
4898
4905
 
4899
4906
  const ViewletDialog = {
4900
4907
  __proto__: null,
4901
- create: create$r,
4908
+ create: create$o,
4902
4909
  postAppend,
4903
4910
  setButtons,
4904
4911
  setCodeFrame,
@@ -4952,7 +4959,7 @@ const handleClickAt$2 = event => {
4952
4959
  const handleLoad$3 = event => {
4953
4960
  return ['handleLoad'];
4954
4961
  };
4955
- const handleContextMenu$6 = event => {
4962
+ const handleContextMenu$5 = event => {
4956
4963
  preventDefault(event);
4957
4964
  const {
4958
4965
  button,
@@ -4961,7 +4968,7 @@ const handleContextMenu$6 = event => {
4961
4968
  } = event;
4962
4969
  return ['handleContextMenu', button, clientX, clientY];
4963
4970
  };
4964
- const handleSashCornerPointerDown = create$u(event => {
4971
+ const handleSashCornerPointerDown = create$r(event => {
4965
4972
  const {
4966
4973
  clientX,
4967
4974
  clientY
@@ -4980,15 +4987,15 @@ const handleSashCornerPointerDown = create$u(event => {
4980
4987
  } = event;
4981
4988
  return ['handleSashCornerPointerUp', clientX, clientY];
4982
4989
  });
4983
- const returnValue$6 = true;
4990
+ const returnValue$5 = true;
4984
4991
 
4985
4992
  const ViewletE2eTestEvents = {
4986
4993
  __proto__: null,
4987
4994
  handleClickAt: handleClickAt$2,
4988
- handleContextMenu: handleContextMenu$6,
4995
+ handleContextMenu: handleContextMenu$5,
4989
4996
  handleLoad: handleLoad$3,
4990
4997
  handleSashCornerPointerDown,
4991
- returnValue: returnValue$6
4998
+ returnValue: returnValue$5
4992
4999
  };
4993
5000
 
4994
5001
  // TODO could use browser view when running in electron
@@ -5049,7 +5056,7 @@ const handleClickAt$1 = event => {
5049
5056
  const handleLoad$2 = event => {
5050
5057
  return ['handleLoad'];
5051
5058
  };
5052
- const handleContextMenu$5 = event => {
5059
+ const handleContextMenu$4 = event => {
5053
5060
  preventDefault(event);
5054
5061
  const {
5055
5062
  button,
@@ -5058,14 +5065,14 @@ const handleContextMenu$5 = event => {
5058
5065
  } = event;
5059
5066
  return ['handleContextMenu', button, clientX, clientY];
5060
5067
  };
5061
- const returnValue$5 = true;
5068
+ const returnValue$4 = true;
5062
5069
 
5063
5070
  const ViewletE2eTestsEvents = {
5064
5071
  __proto__: null,
5065
5072
  handleClickAt: handleClickAt$1,
5066
- handleContextMenu: handleContextMenu$5,
5073
+ handleContextMenu: handleContextMenu$4,
5067
5074
  handleLoad: handleLoad$2,
5068
- returnValue: returnValue$5
5075
+ returnValue: returnValue$4
5069
5076
  };
5070
5077
 
5071
5078
  const sendToIframe = (contentWindow, message, origin, transfer) => {
@@ -5130,10 +5137,10 @@ const ViewletE2eTests = {
5130
5137
 
5131
5138
  const Script = 2;
5132
5139
 
5133
- const handleFocusIn$3 = event => {
5140
+ const handleFocusIn$2 = event => {
5134
5141
  preventDefault(event);
5135
5142
  const uid = fromEvent(event);
5136
- handleFocusIn$4(uid);
5143
+ handleFocusIn$3(uid);
5137
5144
  };
5138
5145
  const handleBlur$6 = event => {
5139
5146
  preventDefault(event);
@@ -5144,7 +5151,7 @@ const handleBlur$6 = event => {
5144
5151
  const ViewletEditorCodeGeneratorEvents = {
5145
5152
  __proto__: null,
5146
5153
  handleBlur: handleBlur$6,
5147
- handleFocusIn: handleFocusIn$3
5154
+ handleFocusIn: handleFocusIn$2
5148
5155
  };
5149
5156
 
5150
5157
  const setBounds$9 = (state, x, y, width, height) => {
@@ -5160,10 +5167,10 @@ const appendWidget$5 = state => {
5160
5167
  } = state;
5161
5168
  append$1($Viewlet);
5162
5169
  };
5163
- const dispose$f = state => {
5170
+ const dispose$d = state => {
5164
5171
  remove$1(state.$Viewlet);
5165
5172
  };
5166
- const focus$d = (state, key, source) => {
5173
+ const focus$b = (state, key, source) => {
5167
5174
  if (!key) {
5168
5175
  return;
5169
5176
  }
@@ -5186,12 +5193,12 @@ const ViewletEditorCodeGenerator = {
5186
5193
  __proto__: null,
5187
5194
  Events: ViewletEditorCodeGeneratorEvents,
5188
5195
  appendWidget: appendWidget$5,
5189
- dispose: dispose$f,
5190
- focus: focus$d,
5196
+ dispose: dispose$d,
5197
+ focus: focus$b,
5191
5198
  setBounds: setBounds$9
5192
5199
  };
5193
5200
 
5194
- const attachEvents$8 = ($Node, eventMap) => {
5201
+ const attachEvents$6 = ($Node, eventMap) => {
5195
5202
  for (const [key, value] of Object.entries(eventMap)) {
5196
5203
  $Node.addEventListener(key, value);
5197
5204
  }
@@ -5310,7 +5317,7 @@ const setNegativeMargin = (state, negativeMargin) => {
5310
5317
  setTop($ListItems, negativeMargin);
5311
5318
  };
5312
5319
 
5313
- const create$q = () => {
5320
+ const create$n = () => {
5314
5321
  const $ListItems = document.createElement('div');
5315
5322
  $ListItems.className = 'ListItems';
5316
5323
  $ListItems.role = ListBox;
@@ -5334,24 +5341,24 @@ const create$q = () => {
5334
5341
  $Viewlet
5335
5342
  };
5336
5343
  };
5337
- const attachEvents$7 = state => {
5344
+ const attachEvents$5 = state => {
5338
5345
  const {
5339
5346
  $ListItems,
5340
5347
  $ScrollBar,
5341
5348
  $Viewlet
5342
5349
  } = state;
5343
5350
  $Viewlet.addEventListener(Wheel, handleWheel$2, Passive);
5344
- attachEvents$8($ListItems, {
5351
+ attachEvents$6($ListItems, {
5345
5352
  [MouseDown]: handleMousedown
5346
5353
  });
5347
- attachEvents$8($ScrollBar, {
5354
+ attachEvents$6($ScrollBar, {
5348
5355
  [PointerDown]: handleScrollBarPointerDown$1
5349
5356
  });
5350
5357
  };
5351
5358
  // TODO show should be passed active cursor position
5352
5359
  // this would make this function easier to test as it would avoid dependency on globals of other files
5353
5360
 
5354
- const setDom$8 = (state, dom) => {
5361
+ const setDom$7 = (state, dom) => {
5355
5362
  const {
5356
5363
  $ListItems,
5357
5364
  $Viewlet
@@ -5363,7 +5370,7 @@ const setDom$8 = (state, dom) => {
5363
5370
  // TODO recycle nodes
5364
5371
  // TODO set right aria attributes on $EditorInput
5365
5372
  };
5366
- const dispose$e = state => {
5373
+ const dispose$c = state => {
5367
5374
  remove$1(state.$Viewlet);
5368
5375
  // state.$EditorInput.removeAttribute('aria-activedescendant')
5369
5376
  };
@@ -5393,13 +5400,13 @@ const setBounds$8 = (state, x, y, width, height) => {
5393
5400
 
5394
5401
  const ViewletEditorCompletion = {
5395
5402
  __proto__: null,
5396
- attachEvents: attachEvents$7,
5397
- create: create$q,
5398
- dispose: dispose$e,
5403
+ attachEvents: attachEvents$5,
5404
+ create: create$n,
5405
+ dispose: dispose$c,
5399
5406
  handleError: handleError$6,
5400
5407
  setBounds: setBounds$8,
5401
5408
  setContentHeight,
5402
- setDom: setDom$8,
5409
+ setDom: setDom$7,
5403
5410
  setNegativeMargin,
5404
5411
  setScrollBar: setScrollBar$2,
5405
5412
  setSize,
@@ -5409,15 +5416,15 @@ const ViewletEditorCompletion = {
5409
5416
  const handleClose = () => {
5410
5417
  return ['closeDetails'];
5411
5418
  };
5412
- const returnValue$4 = true;
5419
+ const returnValue$3 = true;
5413
5420
 
5414
5421
  const ViewletEditorCompletionDetailsEvents = {
5415
5422
  __proto__: null,
5416
5423
  handleClose,
5417
- returnValue: returnValue$4
5424
+ returnValue: returnValue$3
5418
5425
  };
5419
5426
 
5420
- const create$p = () => {
5427
+ const create$m = () => {
5421
5428
  const $Viewlet = document.createElement('div');
5422
5429
  $Viewlet.className = 'Viewlet EditorCompletionDetails';
5423
5430
  $Viewlet.id = 'CompletionsDetails';
@@ -5425,10 +5432,10 @@ const create$p = () => {
5425
5432
  $Viewlet
5426
5433
  };
5427
5434
  };
5428
- const attachEvents$6 = state => {
5435
+ const attachEvents$4 = state => {
5429
5436
  // TODO
5430
5437
  };
5431
- const setDom$7 = (state, dom) => {
5438
+ const setDom$6 = (state, dom) => {
5432
5439
  const {
5433
5440
  $Viewlet
5434
5441
  } = state;
@@ -5443,7 +5450,7 @@ const appendWidget$4 = state => {
5443
5450
  } = state;
5444
5451
  append$1($Viewlet);
5445
5452
  };
5446
- const dispose$d = state => {
5453
+ const dispose$b = state => {
5447
5454
  remove$1(state.$Viewlet);
5448
5455
  };
5449
5456
  const setBounds$7 = (state, x, y, width, height) => {
@@ -5457,11 +5464,11 @@ const ViewletEditorCompletionDetails = {
5457
5464
  __proto__: null,
5458
5465
  Events: ViewletEditorCompletionDetailsEvents,
5459
5466
  appendWidget: appendWidget$4,
5460
- attachEvents: attachEvents$6,
5461
- create: create$p,
5462
- dispose: dispose$d,
5467
+ attachEvents: attachEvents$4,
5468
+ create: create$m,
5469
+ dispose: dispose$b,
5463
5470
  setBounds: setBounds$7,
5464
- setDom: setDom$7
5471
+ setDom: setDom$6
5465
5472
  };
5466
5473
 
5467
5474
  // TODO not sure whether created dom node
@@ -5477,14 +5484,14 @@ const ViewletEditorCompletionDetails = {
5477
5484
 
5478
5485
  // TODO aria alert
5479
5486
 
5480
- const create$o = () => {
5487
+ const create$l = () => {
5481
5488
  const $Viewlet = document.createElement('div');
5482
5489
  $Viewlet.className = 'Viewlet EditorError';
5483
5490
  return {
5484
5491
  $Viewlet
5485
5492
  };
5486
5493
  };
5487
- const setDom$6 = (state, dom) => {
5494
+ const setDom$5 = (state, dom) => {
5488
5495
  const {
5489
5496
  $Viewlet
5490
5497
  } = state;
@@ -5499,13 +5506,13 @@ const setBounds$6 = (state, x, y, width, height) => {
5499
5506
 
5500
5507
  const ViewletEditorError = {
5501
5508
  __proto__: null,
5502
- create: create$o,
5509
+ create: create$l,
5503
5510
  setBounds: setBounds$6,
5504
- setDom: setDom$6
5511
+ setDom: setDom$5
5505
5512
  };
5506
5513
 
5507
- const returnValue$3 = true;
5508
- const handleSashPointerDown$2 = create$u(event => {
5514
+ const returnValue$2 = true;
5515
+ const handleSashPointerDown$2 = create$r(event => {
5509
5516
  const {
5510
5517
  clientX,
5511
5518
  clientY
@@ -5528,7 +5535,7 @@ const handleSashPointerDown$2 = create$u(event => {
5528
5535
  const ViewletEditorHoverEvents = {
5529
5536
  __proto__: null,
5530
5537
  handleSashPointerDown: handleSashPointerDown$2,
5531
- returnValue: returnValue$3
5538
+ returnValue: returnValue$2
5532
5539
  };
5533
5540
 
5534
5541
  const setBounds$5 = (state, x, y, width, height) => {
@@ -5544,7 +5551,7 @@ const appendWidget$3 = state => {
5544
5551
  } = state;
5545
5552
  append$1($Viewlet);
5546
5553
  };
5547
- const setDom$5 = (state, dom) => {
5554
+ const setDom$4 = (state, dom) => {
5548
5555
  const {
5549
5556
  $Viewlet
5550
5557
  } = state;
@@ -5556,7 +5563,7 @@ const ViewletEditorHover = {
5556
5563
  Events: ViewletEditorHoverEvents,
5557
5564
  appendWidget: appendWidget$3,
5558
5565
  setBounds: setBounds$5,
5559
- setDom: setDom$5
5566
+ setDom: setDom$4
5560
5567
  };
5561
5568
 
5562
5569
  const LeftClick = 0;
@@ -5639,7 +5646,7 @@ const handleWheel$1 = event => {
5639
5646
  *
5640
5647
  * @param {MouseEvent} event
5641
5648
  */
5642
- const handleContextMenu$4 = event => {
5649
+ const handleContextMenu$3 = event => {
5643
5650
  preventDefault(event);
5644
5651
  const {
5645
5652
  button,
@@ -5647,7 +5654,7 @@ const handleContextMenu$4 = event => {
5647
5654
  clientY
5648
5655
  } = event;
5649
5656
  const uid = fromEvent(event);
5650
- handleContextMenu$7(uid, button, clientX, clientY);
5657
+ handleContextMenu$6(uid, button, clientX, clientY);
5651
5658
  };
5652
5659
  const handleError$5 = event => {
5653
5660
  const uid = fromEvent(event);
@@ -5658,19 +5665,19 @@ const handleFocus$6 = event => {
5658
5665
  handleFocus$8(uid);
5659
5666
  };
5660
5667
 
5661
- const create$n = () => {
5668
+ const create$k = () => {
5662
5669
  const $Viewlet = document.createElement('div');
5663
5670
  $Viewlet.className = 'Viewlet EditorImage';
5664
5671
  return {
5665
5672
  $Viewlet
5666
5673
  };
5667
5674
  };
5668
- const attachEvents$5 = state => {
5675
+ const attachEvents$3 = state => {
5669
5676
  const {
5670
5677
  $Viewlet
5671
5678
  } = state;
5672
- attachEvents$8($Viewlet, {
5673
- [ContextMenu]: handleContextMenu$4,
5679
+ attachEvents$6($Viewlet, {
5680
+ [ContextMenu]: handleContextMenu$3,
5674
5681
  [FocusIn]: handleFocus$6,
5675
5682
  [PointerDown]: handlePointerDown$1,
5676
5683
  [PointerUp]: handlePointerUp
@@ -5691,7 +5698,7 @@ const setDragging = (state, isDragging) => {
5691
5698
  } = state;
5692
5699
  $Viewlet.classList.toggle('Dragging', isDragging);
5693
5700
  };
5694
- const setDom$4 = (state, dom) => {
5701
+ const setDom$3 = (state, dom) => {
5695
5702
  const {
5696
5703
  $Viewlet
5697
5704
  } = state;
@@ -5700,14 +5707,14 @@ const setDom$4 = (state, dom) => {
5700
5707
 
5701
5708
  const ViewletEditorImage = {
5702
5709
  __proto__: null,
5703
- attachEvents: attachEvents$5,
5704
- create: create$n,
5705
- setDom: setDom$4,
5710
+ attachEvents: attachEvents$3,
5711
+ create: create$k,
5712
+ setDom: setDom$3,
5706
5713
  setDragging,
5707
5714
  setTransform
5708
5715
  };
5709
5716
 
5710
- const create$m = () => {
5717
+ const create$j = () => {
5711
5718
  const $Viewlet = document.createElement('div');
5712
5719
  $Viewlet.className = 'Viewlet EditorText';
5713
5720
  $Viewlet.textContent = 'loading...';
@@ -5715,7 +5722,7 @@ const create$m = () => {
5715
5722
  $Viewlet
5716
5723
  };
5717
5724
  };
5718
- const dispose$c = state => {};
5725
+ const dispose$a = state => {};
5719
5726
  const refresh$3 = (state, context) => {
5720
5727
  object(state);
5721
5728
  string(context.content);
@@ -5724,20 +5731,20 @@ const refresh$3 = (state, context) => {
5724
5731
 
5725
5732
  const ViewletEditorPlainText = {
5726
5733
  __proto__: null,
5727
- create: create$m,
5728
- dispose: dispose$c,
5734
+ create: create$j,
5735
+ dispose: dispose$a,
5729
5736
  refresh: refresh$3
5730
5737
  };
5731
5738
 
5732
- const handleFocusIn$2 = event => {
5739
+ const handleFocusIn$1 = event => {
5733
5740
  preventDefault(event);
5734
5741
  const uid = fromEvent(event);
5735
- handleFocusIn$4(uid);
5742
+ handleFocusIn$3(uid);
5736
5743
  };
5737
5744
 
5738
5745
  const ViewletEditorSourceActionsEvents = {
5739
5746
  __proto__: null,
5740
- handleFocusIn: handleFocusIn$2
5747
+ handleFocusIn: handleFocusIn$1
5741
5748
  };
5742
5749
 
5743
5750
  const setBounds$4 = (state, x, y, width, height) => {
@@ -5753,7 +5760,7 @@ const appendWidget$2 = state => {
5753
5760
  } = state;
5754
5761
  append$1($Viewlet);
5755
5762
  };
5756
- const dispose$b = state => {
5763
+ const dispose$9 = state => {
5757
5764
  remove$1(state.$Viewlet);
5758
5765
  };
5759
5766
 
@@ -5761,7 +5768,7 @@ const ViewletEditorSourceActions = {
5761
5768
  __proto__: null,
5762
5769
  Events: ViewletEditorSourceActionsEvents,
5763
5770
  appendWidget: appendWidget$2,
5764
- dispose: dispose$b,
5771
+ dispose: dispose$9,
5765
5772
  setBounds: setBounds$4
5766
5773
  };
5767
5774
 
@@ -5995,7 +6002,7 @@ const handlePaste = event => {
5995
6002
  const text = getText(clipboardData);
5996
6003
  return ['paste', text];
5997
6004
  };
5998
- const handleScrollBarVerticalPointerDown = create$u(event => {
6005
+ const handleScrollBarVerticalPointerDown = create$r(event => {
5999
6006
  const {
6000
6007
  clientY
6001
6008
  } = event;
@@ -6050,7 +6057,7 @@ const handleScrollBarContextMenu = event => {
6050
6057
  preventDefault(event);
6051
6058
  stopPropagation(event);
6052
6059
  };
6053
- const handleContextMenu$3 = event => {
6060
+ const handleContextMenu$2 = event => {
6054
6061
  preventDefault(event);
6055
6062
  const {
6056
6063
  button,
@@ -6118,7 +6125,7 @@ const setLineInfos = (state, dom) => {
6118
6125
  // 1. create -> only create dom elements
6119
6126
  // 2. render -> fill elements with attributes and data
6120
6127
  // that way all dom nodes can be recycled
6121
- const create$l = () => {
6128
+ const create$i = () => {
6122
6129
  const $EditorInput = document.createElement('textarea');
6123
6130
  $EditorInput.className = 'EditorInput';
6124
6131
  $EditorInput.ariaAutoComplete = List;
@@ -6206,7 +6213,7 @@ const create$l = () => {
6206
6213
  $Editor.role = Code;
6207
6214
  $Editor.append($LayerGutter, $EditorContent);
6208
6215
  attachEventsFunctional($Editor, {
6209
- [ContextMenu]: handleContextMenu$3,
6216
+ [ContextMenu]: handleContextMenu$2,
6210
6217
  [Wheel]: handleWheel,
6211
6218
  returnValue: true
6212
6219
  });
@@ -6264,7 +6271,7 @@ const setSelections$1 = (state, cursorInfos, selectionInfos) => {
6264
6271
  setCursors(state, cursorInfos);
6265
6272
  setSelections$2(state, selectionInfos);
6266
6273
  };
6267
- const setFocused$2 = async (state, isFocused) => {
6274
+ const setFocused$1 = async (state, isFocused) => {
6268
6275
  const {
6269
6276
  $EditorInput
6270
6277
  } = state;
@@ -6285,7 +6292,7 @@ const setDecorationsDom$1 = (state, decorations) => {
6285
6292
  setDecorationsDom$2(state, decorations);
6286
6293
  };
6287
6294
 
6288
- const create$k = create$l;
6295
+ const create$h = create$i;
6289
6296
  const setText$1 = setText$2;
6290
6297
  const setSelections = setSelections$1;
6291
6298
  const setIncrementalEdits = setIncrementalEdits$1;
@@ -6321,20 +6328,20 @@ const hideOverlayMessage = state => {
6321
6328
  }
6322
6329
  }
6323
6330
  };
6324
- const setFocused$1 = setFocused$2;
6325
- const focus$c = setFocused$2;
6331
+ const setFocused = setFocused$1;
6332
+ const focus$a = setFocused$1;
6326
6333
  const setDecorationsDom = setDecorationsDom$1;
6327
6334
 
6328
6335
  const ViewletEditorText = {
6329
6336
  __proto__: null,
6330
- create: create$k,
6331
- focus: focus$c,
6337
+ create: create$h,
6338
+ focus: focus$a,
6332
6339
  handleError: handleError$4,
6333
6340
  hideOverlayMessage,
6334
6341
  highlightAsLink,
6335
6342
  renderGutter,
6336
6343
  setDecorationsDom,
6337
- setFocused: setFocused$1,
6344
+ setFocused,
6338
6345
  setIncrementalEdits,
6339
6346
  setScrollBar,
6340
6347
  setScrollBarHorizontal,
@@ -6343,7 +6350,7 @@ const ViewletEditorText = {
6343
6350
  showOverlayMessage
6344
6351
  };
6345
6352
 
6346
- const create$j = () => {
6353
+ const create$g = () => {
6347
6354
  const $Viewlet = document.createElement('div');
6348
6355
  $Viewlet.className = 'Viewlet EditorTextError';
6349
6356
  return {
@@ -6359,11 +6366,11 @@ const setMessage$3 = (state, message) => {
6359
6366
 
6360
6367
  const ViewletEditorTextError = {
6361
6368
  __proto__: null,
6362
- create: create$j,
6369
+ create: create$g,
6363
6370
  setMessage: setMessage$3
6364
6371
  };
6365
6372
 
6366
- const create$i = () => {
6373
+ const create$f = () => {
6367
6374
  const $Viewlet = document.createElement('div');
6368
6375
  $Viewlet.className = 'Viewlet EditorWidgetError EditorOverlayMessage';
6369
6376
  return {
@@ -6386,12 +6393,12 @@ const setBounds$3 = (state, x, y, width, height) => {
6386
6393
 
6387
6394
  const ViewletEditorWidgetError = {
6388
6395
  __proto__: null,
6389
- create: create$i,
6396
+ create: create$f,
6390
6397
  setBounds: setBounds$3,
6391
6398
  setMessage: setMessage$2
6392
6399
  };
6393
6400
 
6394
- const create$h = () => {
6401
+ const create$e = () => {
6395
6402
  const $Viewlet = document.createElement('div');
6396
6403
  $Viewlet.dataset.viewlet = 'Empty';
6397
6404
  $Viewlet.className = 'Viewlet';
@@ -6400,18 +6407,18 @@ const create$h = () => {
6400
6407
  };
6401
6408
  };
6402
6409
  const refresh$2 = (state, context) => {};
6403
- const focus$b = state => {};
6404
- const dispose$a = state => {};
6410
+ const focus$9 = state => {};
6411
+ const dispose$8 = state => {};
6405
6412
 
6406
6413
  const ViewletEmpty = {
6407
6414
  __proto__: null,
6408
- create: create$h,
6409
- dispose: dispose$a,
6410
- focus: focus$b,
6415
+ create: create$e,
6416
+ dispose: dispose$8,
6417
+ focus: focus$9,
6411
6418
  refresh: refresh$2
6412
6419
  };
6413
6420
 
6414
- const create$g = () => {
6421
+ const create$d = () => {
6415
6422
  const $Viewlet = document.createElement('div');
6416
6423
  $Viewlet.className = 'Viewlet EmptyEditor';
6417
6424
  return {
@@ -6421,10 +6428,10 @@ const create$g = () => {
6421
6428
 
6422
6429
  const ViewletEmptyEditor = {
6423
6430
  __proto__: null,
6424
- create: create$g
6431
+ create: create$d
6425
6432
  };
6426
6433
 
6427
- const create$f = () => {
6434
+ const create$c = () => {
6428
6435
  const $Viewlet = document.createElement('div');
6429
6436
  $Viewlet.className = 'Viewlet Error';
6430
6437
  return {
@@ -6440,7 +6447,7 @@ const setMessage$1 = (state, message) => {
6440
6447
 
6441
6448
  const ViewletError = {
6442
6449
  __proto__: null,
6443
- create: create$f,
6450
+ create: create$c,
6444
6451
  setMessage: setMessage$1
6445
6452
  };
6446
6453
 
@@ -6510,7 +6517,7 @@ const handleFocusClose = event => {
6510
6517
  const handleFocusReplaceAll = event => {
6511
6518
  return ['FindWidget.handleFocusReplaceAll'];
6512
6519
  };
6513
- const returnValue$2 = true;
6520
+ const returnValue$1 = true;
6514
6521
 
6515
6522
  const ViewletFindWidgetEvents = {
6516
6523
  __proto__: null,
@@ -6530,10 +6537,10 @@ const ViewletFindWidgetEvents = {
6530
6537
  handleReplaceFocus,
6531
6538
  handleReplaceInput,
6532
6539
  handleToggleReplaceFocus,
6533
- returnValue: returnValue$2
6540
+ returnValue: returnValue$1
6534
6541
  };
6535
6542
 
6536
- const create$e = () => {
6543
+ const create$b = () => {
6537
6544
  const $Viewlet = document.createElement('div');
6538
6545
  $Viewlet.className = 'Viewlet FindWidget';
6539
6546
  $Viewlet.role = Group;
@@ -6541,7 +6548,7 @@ const create$e = () => {
6541
6548
  $Viewlet
6542
6549
  };
6543
6550
  };
6544
- const focus$a = (state, key, source) => {
6551
+ const focus$8 = (state, key, source) => {
6545
6552
  if (!key) {
6546
6553
  return;
6547
6554
  }
@@ -6575,7 +6582,7 @@ const appendWidget$1 = state => {
6575
6582
  } = state;
6576
6583
  append$1($Viewlet);
6577
6584
  };
6578
- const setDom$3 = (state, dom) => {
6585
+ const setDom$2 = (state, dom) => {
6579
6586
  const {
6580
6587
  $Viewlet
6581
6588
  } = state;
@@ -6587,20 +6594,20 @@ const setBounds$2 = (state, x, y, width, height) => {
6587
6594
  } = state;
6588
6595
  setBounds$a($Viewlet, x, y, width, height);
6589
6596
  };
6590
- const dispose$9 = state => {
6597
+ const dispose$7 = state => {
6591
6598
  remove$1(state.$Viewlet);
6592
6599
  };
6593
- const Events$3 = ViewletFindWidgetEvents;
6600
+ const Events$2 = ViewletFindWidgetEvents;
6594
6601
 
6595
6602
  const ViewletFindWidget = {
6596
6603
  __proto__: null,
6597
- Events: Events$3,
6604
+ Events: Events$2,
6598
6605
  appendWidget: appendWidget$1,
6599
- create: create$e,
6600
- dispose: dispose$9,
6601
- focus: focus$a,
6606
+ create: create$b,
6607
+ dispose: dispose$7,
6608
+ focus: focus$8,
6602
6609
  setBounds: setBounds$2,
6603
- setDom: setDom$3,
6610
+ setDom: setDom$2,
6604
6611
  setValue: setValue$1
6605
6612
  };
6606
6613
 
@@ -6622,7 +6629,7 @@ const ViewletLocationsEvents = {
6622
6629
  handleLocationsMouseDown
6623
6630
  };
6624
6631
 
6625
- const setFocusedIndex$1 = (state, oldFocusedIndex, newFocusedIndex) => {
6632
+ const setFocusedIndex = (state, oldFocusedIndex, newFocusedIndex) => {
6626
6633
  const {
6627
6634
  $Viewlet
6628
6635
  } = state;
@@ -6645,7 +6652,7 @@ const handleError$3 = (state, message) => {
6645
6652
  } = state;
6646
6653
  $Message.textContent = message;
6647
6654
  };
6648
- const focus$9 = state => {
6655
+ const focus$7 = state => {
6649
6656
  const {
6650
6657
  $Locations
6651
6658
  } = state;
@@ -6657,9 +6664,9 @@ const focus$9 = state => {
6657
6664
  const ViewletImplementations = {
6658
6665
  __proto__: null,
6659
6666
  Events: ViewletLocationsEvents,
6660
- focus: focus$9,
6667
+ focus: focus$7,
6661
6668
  handleError: handleError$3,
6662
- setFocusedIndex: setFocusedIndex$1
6669
+ setFocusedIndex
6663
6670
  };
6664
6671
 
6665
6672
  const handleScrollBarPointerDown = event => {
@@ -6750,11 +6757,11 @@ const setColumnWidths = (state, columnWidth1, columnWidth2, columnWidth3) => {
6750
6757
  $Resizer1.style.left = `${paddingLeft + columnWidth1}px`;
6751
6758
  $Resizer2.style.left = `${paddingLeft + columnWidth1 + columnWidth2}px`;
6752
6759
  };
6753
- const Events$2 = ViewletkeyBindingsEvents;
6760
+ const Events$1 = ViewletkeyBindingsEvents;
6754
6761
 
6755
6762
  const ViewletKeyBindings = {
6756
6763
  __proto__: null,
6757
- Events: Events$2,
6764
+ Events: Events$1,
6758
6765
  setColumnWidths,
6759
6766
  setScrollBar: setScrollBar$2,
6760
6767
  setSize,
@@ -7259,7 +7266,7 @@ const handleBlur$3 = () => {
7259
7266
  const handleKeyDown$1 = handleKeyDown$2;
7260
7267
  const handleKeyUp = handleKeyUp$1;
7261
7268
 
7262
- const create$d = () => {
7269
+ const create$a = () => {
7263
7270
  // TODO use aria role splitter once supported https://github.com/w3c/aria/issues/1348
7264
7271
  const $SashSideBar = document.createElement('div');
7265
7272
  $SashSideBar.className = 'Viewlet Sash SashVertical';
@@ -7280,20 +7287,20 @@ const create$d = () => {
7280
7287
  $Viewlet
7281
7288
  };
7282
7289
  };
7283
- const attachEvents$4 = state => {
7290
+ const attachEvents$2 = state => {
7284
7291
  const {
7285
7292
  $SashPanel,
7286
7293
  $SashSideBar
7287
7294
  } = state;
7288
- attachEvents$8($SashSideBar, {
7295
+ attachEvents$6($SashSideBar, {
7289
7296
  [DoubleClick]: handleSashDoubleClick,
7290
7297
  [PointerDown]: handleSashPointerDown
7291
7298
  });
7292
- attachEvents$8($SashPanel, {
7299
+ attachEvents$6($SashPanel, {
7293
7300
  [DoubleClick]: handleSashDoubleClick,
7294
7301
  [PointerDown]: handleSashPointerDown
7295
7302
  });
7296
- attachEvents$8(window, {
7303
+ attachEvents$6(window, {
7297
7304
  [Blur]: handleBlur$3,
7298
7305
  [Focus]: handleFocus$2,
7299
7306
  [KeyDown]: handleKeyDown$1,
@@ -7314,404 +7321,74 @@ const setSashes = (state, sashSideBar, sashPanel) => {
7314
7321
 
7315
7322
  const ViewletLayout = {
7316
7323
  __proto__: null,
7317
- attachEvents: attachEvents$4,
7318
- create: create$d,
7324
+ attachEvents: attachEvents$2,
7325
+ create: create$a,
7319
7326
  setSashes
7320
7327
  };
7321
7328
 
7322
- const CopyMove = 'copyMove';
7323
-
7324
- const ResourceUrls = 'resourceurls';
7329
+ const ActivityBar = 'ActivityBar';
7330
+ const Audio$1 = 'Audio';
7331
+ const Clock = 'Clock';
7332
+ const ColorPicker = 'ColorPicker';
7333
+ const DebugConsole = 'Debug Console';
7334
+ const DefineKeyBinding = 'DefineKeyBinding';
7335
+ const Dialog = 'Dialog';
7336
+ const DiffEditor = 'DiffEditor';
7337
+ const EditorCompletion = 'EditorCompletion';
7338
+ const EmptyEditor = 'EmptyEditor';
7339
+ const EditorError = 'EditorError';
7340
+ const EditorHover = 'EditorHover';
7341
+ const EditorImage = 'EditorImage';
7342
+ const EditorPlainText = 'EditorPlainText';
7343
+ const EditorText = 'Editor';
7344
+ const EditorWidgetError = 'EditorWidgetError';
7345
+ const Empty = 'Empty';
7346
+ const Error$1 = 'Error';
7347
+ const FindWidget = 'FindWidget';
7348
+ const ImagePreview = 'ImagePreview';
7349
+ const InlineDiffEditor = 'InlineDiffEditor';
7350
+ const Implementations = 'Implementations';
7351
+ const KeyBindings = 'KeyBindings';
7352
+ const Layout = 'Layout';
7353
+ const Output = 'Output';
7354
+ const Panel = 'Panel';
7355
+ const References = 'References';
7356
+ const RunAndDebug = 'Run And Debug';
7357
+ const ScreenCapture = 'ScreenCapture';
7358
+ const SideBar = 'SideBar';
7359
+ const SimpleBrowser = 'SimpleBrowser';
7360
+ const SourceControl = 'Source Control';
7361
+ const StatusBar = 'StatusBar';
7362
+ const Storage = 'Storage';
7363
+ const Terminal = 'Terminal';
7364
+ const Terminals = 'Terminals';
7365
+ const Video = 'Video';
7366
+ const EditorSourceActions = 'EditorSourceActions';
7367
+ const E2eTests = 'E2eTests';
7368
+ const E2eTest = 'E2eTest';
7369
+ const WebView = 'WebView';
7370
+ const EditorCompletionDetails = 'EditorCompletionDetails';
7371
+ const EditorTextError = 'EditorTextError';
7372
+ const EditorRename = 'EditorRename';
7373
+ const EditorCodeGenerator = 'EditorCodeGenerator';
7325
7374
 
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
- __proto__: null,
7638
- attachEvents: attachEvents$2,
7639
- create: create$b,
7640
- setHighlight,
7641
- setScrollLeft,
7642
- setTabsDom: setTabsDom$2
7643
- };
7644
-
7645
- const ActivityBar = 'ActivityBar';
7646
- const Audio$1 = 'Audio';
7647
- const Clock = 'Clock';
7648
- const ColorPicker = 'ColorPicker';
7649
- const DebugConsole = 'Debug Console';
7650
- const DefineKeyBinding = 'DefineKeyBinding';
7651
- const Dialog = 'Dialog';
7652
- const DiffEditor = 'DiffEditor';
7653
- const EditorCompletion = 'EditorCompletion';
7654
- const EmptyEditor = 'EmptyEditor';
7655
- const EditorError = 'EditorError';
7656
- const EditorHover = 'EditorHover';
7657
- const EditorImage = 'EditorImage';
7658
- const EditorPlainText = 'EditorPlainText';
7659
- const EditorText = 'Editor';
7660
- const EditorWidgetError = 'EditorWidgetError';
7661
- const Empty = 'Empty';
7662
- const Error$1 = 'Error';
7663
- const FindWidget = 'FindWidget';
7664
- const ImagePreview = 'ImagePreview';
7665
- const InlineDiffEditor = 'InlineDiffEditor';
7666
- const Implementations = 'Implementations';
7667
- const KeyBindings = 'KeyBindings';
7668
- const Layout = 'Layout';
7669
- const Main = 'Main';
7670
- const MainTabs = 'MainTabs';
7671
- const Output = 'Output';
7672
- const Panel = 'Panel';
7673
- const References = 'References';
7674
- const RunAndDebug = 'Run And Debug';
7675
- const ScreenCapture = 'ScreenCapture';
7676
- const SideBar = 'SideBar';
7677
- const SimpleBrowser = 'SimpleBrowser';
7678
- const SourceControl = 'Source Control';
7679
- const StatusBar = 'StatusBar';
7680
- const Storage = 'Storage';
7681
- const Terminal = 'Terminal';
7682
- const Terminals = 'Terminals';
7683
- const TitleBar = 'TitleBar';
7684
- const TitleBarButtons = 'TitleBarButtons';
7685
- const TitleBarIcon = 'TitleBarIcon';
7686
- const TitleBarMenuBar = 'TitleBarMenuBar';
7687
- const Video = 'Video';
7688
- const TitleBarTitle = 'TitleBarTitle';
7689
- const EditorSourceActions = 'EditorSourceActions';
7690
- const E2eTests = 'E2eTests';
7691
- const E2eTest = 'E2eTest';
7692
- const WebView = 'WebView';
7693
- const EditorCompletionDetails = 'EditorCompletionDetails';
7694
- const EditorTextError = 'EditorTextError';
7695
- const EditorRename = 'EditorRename';
7696
- const EditorCodeGenerator = 'EditorCodeGenerator';
7697
-
7698
- const create$a = () => {
7699
- const $ViewletOutputContent = document.createElement('div');
7700
- $ViewletOutputContent.className = 'OutputContent';
7701
- $ViewletOutputContent.role = Log;
7702
- $ViewletOutputContent.tabIndex = 0;
7703
- const $ViewletOutputWidgets = document.createElement('div');
7704
- $ViewletOutputWidgets.className = 'OutputWidgets';
7705
- const $Viewlet = document.createElement('div');
7706
- $Viewlet.className = 'Viewlet Output';
7707
- $Viewlet.tabIndex = 0;
7708
- $Viewlet.append($ViewletOutputContent, $ViewletOutputWidgets);
7709
- return {
7710
- $Content: $ViewletOutputContent,
7711
- $Viewlet,
7712
- $ViewletOutputContent,
7713
- content: $ViewletOutputContent
7714
- };
7375
+ const create$9 = () => {
7376
+ const $ViewletOutputContent = document.createElement('div');
7377
+ $ViewletOutputContent.className = 'OutputContent';
7378
+ $ViewletOutputContent.role = Log;
7379
+ $ViewletOutputContent.tabIndex = 0;
7380
+ const $ViewletOutputWidgets = document.createElement('div');
7381
+ $ViewletOutputWidgets.className = 'OutputWidgets';
7382
+ const $Viewlet = document.createElement('div');
7383
+ $Viewlet.className = 'Viewlet Output';
7384
+ $Viewlet.tabIndex = 0;
7385
+ $Viewlet.append($ViewletOutputContent, $ViewletOutputWidgets);
7386
+ return {
7387
+ $Content: $ViewletOutputContent,
7388
+ $Viewlet,
7389
+ $ViewletOutputContent,
7390
+ content: $ViewletOutputContent
7391
+ };
7715
7392
  };
7716
7393
  const setText = (state, text) => {
7717
7394
  object(state);
@@ -7727,9 +7404,9 @@ const handleError$2 = (state, error) => {
7727
7404
  string(error);
7728
7405
  state.content.textContent = error;
7729
7406
  };
7730
- const focus$7 = state => {
7407
+ const focus$6 = state => {
7731
7408
  object(state);
7732
- focus$f(state.$ViewletOutputContent);
7409
+ focus$d(state.$ViewletOutputContent);
7733
7410
  send('Focus.setFocus', FocusOutput);
7734
7411
  };
7735
7412
 
@@ -7742,15 +7419,15 @@ const disposeFindWidget = state => {
7742
7419
  return;
7743
7420
  }
7744
7421
  };
7745
- const dispose$7 = state => {};
7422
+ const dispose$6 = state => {};
7746
7423
 
7747
7424
  const ViewletOutput = {
7748
7425
  __proto__: null,
7749
7426
  clear: clear$1,
7750
- create: create$a,
7751
- dispose: dispose$7,
7427
+ create: create$9,
7428
+ dispose: dispose$6,
7752
7429
  disposeFindWidget,
7753
- focus: focus$7,
7430
+ focus: focus$6,
7754
7431
  handleError: handleError$2,
7755
7432
  openFindWidget,
7756
7433
  setText
@@ -7801,7 +7478,7 @@ const UiStrings = {
7801
7478
  Close: 'Close',
7802
7479
  Maximize: 'Maximize'
7803
7480
  };
7804
- const create$9 = () => {
7481
+ const create$8 = () => {
7805
7482
  const $PanelTabs = document.createElement('div');
7806
7483
  $PanelTabs.className = 'PanelTabs';
7807
7484
  $PanelTabs.role = TabList;
@@ -7845,13 +7522,13 @@ const attachEvents$1 = state => {
7845
7522
  $ButtonMaximize,
7846
7523
  $PanelHeader
7847
7524
  } = state;
7848
- attachEvents$8($PanelHeader, {
7525
+ attachEvents$6($PanelHeader, {
7849
7526
  [Click]: handleHeaderClick$1
7850
7527
  });
7851
- attachEvents$8($ButtonMaximize, {
7528
+ attachEvents$6($ButtonMaximize, {
7852
7529
  [Click]: handleClickMaximize
7853
7530
  });
7854
- attachEvents$8($ButtonClose, {
7531
+ attachEvents$6($ButtonClose, {
7855
7532
  [Click]: handleClickClose
7856
7533
  });
7857
7534
  };
@@ -7863,14 +7540,14 @@ const setTabsDom$1 = (state, dom) => {
7863
7540
  };
7864
7541
 
7865
7542
  // TODO add test for focus method
7866
- const focus$6 = state => {
7543
+ const focus$5 = state => {
7867
7544
  object(state);
7868
7545
  if (!state.currentViewlet) {
7869
7546
  return;
7870
7547
  }
7871
7548
  state.currentViewlet.factory.focus(state.currentViewlet.state);
7872
7549
  };
7873
- const dispose$6 = state => {
7550
+ const dispose$5 = state => {
7874
7551
  if (state.$PanelContent) {
7875
7552
  state.$PanelContent.remove();
7876
7553
  state.$PanelContent = undefined;
@@ -7915,9 +7592,9 @@ const setActionsDom$1 = (state, actions, childUid) => {
7915
7592
  const ViewletPanel = {
7916
7593
  __proto__: null,
7917
7594
  attachEvents: attachEvents$1,
7918
- create: create$9,
7919
- dispose: dispose$6,
7920
- focus: focus$6,
7595
+ create: create$8,
7596
+ dispose: dispose$5,
7597
+ focus: focus$5,
7921
7598
  setActionsDom: setActionsDom$1,
7922
7599
  setSelectedIndex,
7923
7600
  setTabsDom: setTabsDom$1
@@ -7926,9 +7603,9 @@ const ViewletPanel = {
7926
7603
  const ViewletReferences = {
7927
7604
  __proto__: null,
7928
7605
  Events: ViewletLocationsEvents,
7929
- focus: focus$9,
7606
+ focus: focus$7,
7930
7607
  handleError: handleError$3,
7931
- setFocusedIndex: setFocusedIndex$1
7608
+ setFocusedIndex
7932
7609
  };
7933
7610
 
7934
7611
  const ViewletRunAndDebug = {
@@ -7943,7 +7620,7 @@ const handleLoadedMetaData = event => {
7943
7620
  target.play();
7944
7621
  };
7945
7622
 
7946
- const create$8 = () => {
7623
+ const create$7 = () => {
7947
7624
  const $Viewlet = document.createElement('div');
7948
7625
  $Viewlet.className = 'Viewlet ScreenCapture';
7949
7626
  return {
@@ -7963,7 +7640,7 @@ const setScreenCapture = (state, id) => {
7963
7640
 
7964
7641
  const ViewletScreenCapture = {
7965
7642
  __proto__: null,
7966
- create: create$8,
7643
+ create: create$7,
7967
7644
  setScreenCapture
7968
7645
  };
7969
7646
 
@@ -7983,7 +7660,7 @@ const handleHeaderClick = event => {
7983
7660
  }
7984
7661
  };
7985
7662
 
7986
- const create$7 = () => {
7663
+ const create$6 = () => {
7987
7664
  const $SideBarTitleAreaTitle = document.createElement('h2');
7988
7665
  $SideBarTitleAreaTitle.className = 'SideBarTitleAreaTitle';
7989
7666
  const $SideBarTitleArea = document.createElement('div');
@@ -8008,11 +7685,11 @@ const attachEvents = state => {
8008
7685
  const {
8009
7686
  $SideBarTitleArea
8010
7687
  } = state;
8011
- attachEvents$8($SideBarTitleArea, {
7688
+ attachEvents$6($SideBarTitleArea, {
8012
7689
  [Click]: handleHeaderClick
8013
7690
  });
8014
7691
  };
8015
- const dispose$5 = state => {
7692
+ const dispose$4 = state => {
8016
7693
  object(state);
8017
7694
  state.$SideBar.replaceChildren();
8018
7695
  };
@@ -8040,16 +7717,16 @@ const setActionsDom = (state, actions, parentId, eventMap = {}) => {
8040
7717
  }
8041
7718
  state.$Actions = $NewViewlet;
8042
7719
  };
8043
- const focus$5 = async () => {
7720
+ const focus$4 = async () => {
8044
7721
  // await
8045
7722
  };
8046
7723
 
8047
7724
  const ViewletSideBar = {
8048
7725
  __proto__: null,
8049
7726
  attachEvents,
8050
- create: create$7,
8051
- dispose: dispose$5,
8052
- focus: focus$5,
7727
+ create: create$6,
7728
+ dispose: dispose$4,
7729
+ focus: focus$4,
8053
7730
  setActionsDom,
8054
7731
  setTitle
8055
7732
  };
@@ -8143,7 +7820,7 @@ const handleContextMenu$1 = event => {
8143
7820
  clientY
8144
7821
  } = event;
8145
7822
  const uid = fromEvent(event);
8146
- handleContextMenu$7(uid, button, clientX, clientY);
7823
+ handleContextMenu$6(uid, button, clientX, clientY);
8147
7824
  };
8148
7825
 
8149
7826
  const handleFocus = event => {
@@ -8161,7 +7838,7 @@ const getButtonIndex = $Node => {
8161
7838
  }
8162
7839
  return index;
8163
7840
  };
8164
- const handleClick$3 = event => {
7841
+ const handleClick$2 = event => {
8165
7842
  const {
8166
7843
  target
8167
7844
  } = event;
@@ -8179,7 +7856,7 @@ const handleClick$3 = event => {
8179
7856
  if (index === -1) {
8180
7857
  return;
8181
7858
  }
8182
- handleClick$6(uid, index);
7859
+ handleClick$5(uid, index);
8183
7860
  };
8184
7861
  const handleMouseOver = event => {
8185
7862
  const {
@@ -8223,7 +7900,7 @@ const handleInput$1 = event => {
8223
7900
 
8224
7901
  const ViewletSourceControlEvents = {
8225
7902
  __proto__: null,
8226
- handleClick: handleClick$3,
7903
+ handleClick: handleClick$2,
8227
7904
  handleContextMenu: handleContextMenu$1,
8228
7905
  handleFocus,
8229
7906
  handleInput: handleInput$1,
@@ -8232,7 +7909,7 @@ const ViewletSourceControlEvents = {
8232
7909
  handleWheel: handleWheel$3
8233
7910
  };
8234
7911
 
8235
- const focus$4 = state => {
7912
+ const focus$3 = state => {
8236
7913
  const {
8237
7914
  $Viewlet
8238
7915
  } = state;
@@ -8242,24 +7919,24 @@ const focus$4 = state => {
8242
7919
  const ViewletSourceControl = {
8243
7920
  __proto__: null,
8244
7921
  Events: ViewletSourceControlEvents,
8245
- focus: focus$4
7922
+ focus: focus$3
8246
7923
  };
8247
7924
 
8248
- const handleClick$2 = event => {
7925
+ const handleClick$1 = event => {
8249
7926
  const uid = fromEvent(event);
8250
7927
  const {
8251
7928
  clientX,
8252
7929
  clientY
8253
7930
  } = event;
8254
- handleClick$6(uid, clientX, clientY);
7931
+ handleClick$5(uid, clientX, clientY);
8255
7932
  };
8256
7933
 
8257
7934
  const ViewletStatusBarEvents = {
8258
7935
  __proto__: null,
8259
- handleClick: handleClick$2
7936
+ handleClick: handleClick$1
8260
7937
  };
8261
7938
 
8262
- const create$6 = () => {
7939
+ const create$5 = () => {
8263
7940
  const $Viewlet = document.createElement('div');
8264
7941
  $Viewlet.id = 'StatusBar';
8265
7942
  $Viewlet.className = 'Viewlet StatusBar';
@@ -8267,18 +7944,18 @@ const create$6 = () => {
8267
7944
  $Viewlet.role = Status;
8268
7945
  $Viewlet.ariaRoleDescription = StatusBar$1;
8269
7946
  $Viewlet.ariaLive = 'off'; // see https://github.com/microsoft/vscode/issues/94677
8270
- $Viewlet.addEventListener('click', handleClick$2);
7947
+ $Viewlet.addEventListener('click', handleClick$1);
8271
7948
  return {
8272
7949
  $Viewlet
8273
7950
  };
8274
7951
  };
8275
- const setDom$2 = (state, dom) => {
7952
+ const setDom$1 = (state, dom) => {
8276
7953
  const {
8277
7954
  $Viewlet
8278
7955
  } = state;
8279
7956
  renderInto($Viewlet, dom, ViewletStatusBarEvents);
8280
7957
  };
8281
- const focus$3 = state => {
7958
+ const focus$2 = state => {
8282
7959
  object(state);
8283
7960
  const {
8284
7961
  $Viewlet
@@ -8288,26 +7965,26 @@ const focus$3 = state => {
8288
7965
 
8289
7966
  const ViewletStatusBar = {
8290
7967
  __proto__: null,
8291
- create: create$6,
8292
- focus: focus$3,
8293
- setDom: setDom$2
7968
+ create: create$5,
7969
+ focus: focus$2,
7970
+ setDom: setDom$1
8294
7971
  };
8295
7972
 
8296
- const handleClick$1 = event => {
7973
+ const handleClick = event => {
8297
7974
  const uid = fromEvent(event);
8298
- handleClick$6(uid);
7975
+ handleClick$5(uid);
8299
7976
  };
8300
7977
 
8301
7978
  const ViewletStorageEvents = {
8302
7979
  __proto__: null,
8303
- handleClick: handleClick$1
7980
+ handleClick
8304
7981
  };
8305
7982
 
8306
- const Events$1 = ViewletStorageEvents;
7983
+ const Events = ViewletStorageEvents;
8307
7984
 
8308
7985
  const ViewletStorage = {
8309
7986
  __proto__: null,
8310
- Events: Events$1
7987
+ Events
8311
7988
  };
8312
7989
 
8313
7990
  const handleClickTab = event => {
@@ -8319,7 +7996,7 @@ const handleClickTab = event => {
8319
7996
  handleClickTab$2(uid, index);
8320
7997
  };
8321
7998
 
8322
- const create$5 = () => {
7999
+ const create$4 = () => {
8323
8000
  const $Viewlet = document.createElement('div');
8324
8001
  $Viewlet.className = 'Viewlet Terminals';
8325
8002
  return {
@@ -8345,420 +8022,9 @@ const setTabsDom = (state, dom) => {
8345
8022
  };
8346
8023
 
8347
8024
  const ViewletTerminals = {
8348
- __proto__: null,
8349
- create: create$5,
8350
- setTabsDom
8351
- };
8352
-
8353
- const isInsideTitleBarMenu = $Element => {
8354
- return $Element.classList.contains('MenuItem') || $Element.classList.contains('Menu') || $Element.classList.contains('TitleBarTopLevelEntry') || $Element.classList.contains('TitleBarMenuBar');
8355
- };
8356
- const handleFocusOut = event => {
8357
- const {
8358
- relatedTarget,
8359
- target
8360
- } = event;
8361
- if (relatedTarget && isInsideTitleBarMenu(relatedTarget)) {
8362
- return;
8363
- }
8364
- if (target && isInsideTitleBarMenu(target)) {
8365
- return;
8366
- }
8367
- const uid = fromEvent(event);
8368
- closeMenu$1(uid);
8369
- };
8370
- const handlePointerOver = event => {
8371
- const {
8372
- target
8373
- } = event;
8374
- const index = getIndex(target);
8375
- const uid = fromEvent(event);
8376
- handleMouseOver$1(uid, index);
8377
- };
8378
- const handlePointerOut = event => {
8379
- const {
8380
- target
8381
- } = event;
8382
- const index = getIndex(target);
8383
- const uid = fromEvent(event);
8384
- handleMouseOut$1(uid, index);
8385
- };
8386
- const getIndex = $Target => {
8387
- if ($Target.classList.contains('TitleBarTopLevelEntry')) {
8388
- return getNodeIndex($Target);
8389
- }
8390
- return -1;
8391
- };
8392
- const handleClick = event => {
8393
- const {
8394
- button,
8395
- target
8396
- } = event;
8397
- const index = getIndex(target);
8398
- const uid = fromEvent(event);
8399
- handleClick$6(uid, button, index);
8400
- };
8401
- const getLevelAndIndex = event => {
8402
- const {
8403
- target
8404
- } = event;
8405
- const $Menu = target.closest('.Menu');
8406
- const index = findIndex($Menu, target);
8407
- const {
8408
- id
8409
- } = $Menu;
8410
- const level = Number.parseInt(id.slice(5));
8411
- return {
8412
- index,
8413
- level
8414
- };
8415
- };
8416
- const handleMenuMouseOver = event => {
8417
- // TODO just send pixel coordinates instead
8418
- const {
8419
- index,
8420
- level
8421
- } = getLevelAndIndex(event);
8422
- const uid = fromEvent(event);
8423
- handleMenuMouseOver$1(uid, level, index);
8424
- };
8425
- const handleMenuClick = event => {
8426
- const {
8427
- index,
8428
- level
8429
- } = getLevelAndIndex(event);
8430
- const uid = fromEvent(event);
8431
- handleMenuClick$1(uid, level, index);
8432
- };
8433
- const handleFocusIn$1 = event => {
8434
- const uid = fromEvent(event);
8435
- handleFocus$8(uid);
8436
- };
8437
-
8438
- const ViewletTitleBarMenuBarEvents = {
8439
- __proto__: null,
8440
- handleClick,
8441
- handleFocusIn: handleFocusIn$1,
8442
- handleFocusOut,
8443
- handleMenuClick,
8444
- handleMenuMouseOver,
8445
- handlePointerOut,
8446
- handlePointerOver
8447
- };
8448
-
8449
- const activeId = 'TitleBarEntryActive';
8450
- const dispose$4 = state => {};
8451
- const focus$2 = state => {
8452
- const {
8453
- $TitleBarMenuBar
8454
- } = state;
8455
- $TitleBarMenuBar.firstChild.focus();
8456
- };
8457
-
8458
- // TODO set proper tabIndex 0 to focused item https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html
8459
-
8460
- // TODO screenreader doesn't read top level label
8461
- // when menu is open,
8462
- // first item is selected,
8463
- // right is clicked it just reads
8464
- // "Expanded" instead of "Selection Expanded"
8465
-
8466
- // TODO sometimes screenreader reads too much (e.g. "File, expanded, opens menu, expanded")
8467
-
8468
- // TODO don't focus on separators
8469
-
8470
- // TODO don't focus on hover
8471
- // only focus on hover when it has already focus or the menu has focus
8472
-
8473
- // TODO title bar menu bar is very inefficient:
8474
-
8475
- // before: 5 times recalculate style
8476
- // 1.37ms Recalculate style
8477
- // 83us Update Layer tree
8478
- // 0.34ms paint
8479
- // 0.79ms composite layer
8480
- // 0.23ms Hit test
8481
- // 1.42ms Recalculate style
8482
- // 1.44ms Recalculate style
8483
- // 2.08ms Recalculate style
8484
- // 0.44ms Recalculate style
8485
- // 0.52ms Layout
8486
- // 0.16ms Update Layer Tree
8487
- // 48us hit test
8488
- // 16us Update Layer Tree
8489
- // 0.36ms paint
8490
- // 0.33ms composite layer
8491
-
8492
- // now: 2 recalculate styles
8493
- // 0.43ms recalculate style
8494
- // 0.53ms recalculate style
8495
- // 0.19ms layout
8496
- // 0.16ms update layer tree
8497
- // 30us hit test
8498
- // 17us update layer tree
8499
- // 0.17ms paint
8500
- // 0.19ms composite layers
8501
-
8502
- const setFocusedIndex = (state, unFocusIndex, focusIndex, oldIsMenuOpen, newIsMenuOpen) => {
8503
- object(state);
8504
- number(unFocusIndex);
8505
- number(focusIndex);
8506
- const {
8507
- $Viewlet
8508
- } = state;
8509
- if (focusIndex !== -1) {
8510
- $Viewlet.focus();
8511
- $Viewlet.setAttribute(AriaActiveDescendant, activeId);
8512
- }
8513
- };
8514
-
8515
- // TODO the focus variable is confusing: false means keep focus in menubar, true means focus the menu
8516
- const openMenu = (state, unFocusIndex, index, level, menuItems, menuFocusedIndex, focus, x, y, width, height) => {
8517
- object(state);
8518
- number(unFocusIndex);
8519
- number(index);
8520
- number(level);
8521
- array(menuItems);
8522
- number(menuFocusedIndex);
8523
- boolean(focus);
8524
- number(x);
8525
- number(y);
8526
- number(width);
8527
- number(height);
8528
- const {
8529
- $Viewlet
8530
- } = state;
8531
- // TODO this code is very unclean
8532
- $Viewlet.addEventListener('mouseenter', handlePointerOver, {
8533
- capture: true
8534
- });
8535
- if (unFocusIndex !== -1) {
8536
- $Viewlet.children[unFocusIndex].ariaExpanded = False;
8537
- $Viewlet.children[unFocusIndex].removeAttribute(AriaOwns);
8538
- }
8539
- $Viewlet.children[index].ariaExpanded = True;
8540
- const $$Menus = state$3.$$Menus;
8541
- state$3.$$Menus = [];
8542
- // @ts-expect-error
8543
- showControlled({
8544
- $Parent: $Viewlet.children[index],
8545
- handleFocusOut: handleFocusOut,
8546
- height,
8547
- items: menuItems,
8548
- level,
8549
- width,
8550
- x,
8551
- y
8552
- });
8553
- if (menuFocusedIndex !== -1) {
8554
- focusIndex(0, -1, menuFocusedIndex);
8555
- }
8556
- for (const $Menu of $$Menus) {
8557
- remove$1($Menu);
8558
- }
8559
- };
8560
-
8561
- // TODO there need to be two variants of closeMenu: one just closes menu, another close menu and focuses top level entry
8562
- const closeMenu = (state, unFocusIndex, index) => {
8563
- const {
8564
- $Viewlet
8565
- } = state;
8566
- if (unFocusIndex !== -1) {
8567
- $Viewlet.children[unFocusIndex].ariaExpanded = False;
8568
- $Viewlet.children[unFocusIndex].removeAttribute(AriaOwns);
8569
- }
8570
- if (index !== -1) {
8571
- $Viewlet.children[index].focus();
8572
- }
8573
- hide(/* restoreFocus */false);
8574
- $Viewlet.removeEventListener('mouseenter', handlePointerOver, {
8575
- capture: true
8576
- });
8577
- };
8578
- const create$Menu = () => {
8579
- const $Menu = document.createElement('div');
8580
- $Menu.className = 'Menu';
8581
- $Menu.role = Menu;
8582
- $Menu.tabIndex = -1;
8583
- // $ContextMenu.onmousedown = contextMenuHandleMouseDown
8584
- // TODO mousedown vs click? (click is usually better but mousedown is faster, why wait 100ms?)
8585
- // $Menu.addEventListener('mousedown', handleMouseDown)
8586
- // $Menu.addEventListener('mouseenter', handleMouseEnter, {
8587
- // capture: true,
8588
- // })
8589
- // $Menu.addEventListener('mouseleave', handleMouseLeave, {
8590
- // capture: true,
8591
- // })
8592
- // $Menu.addEventListener('mousemove', handleMouseMove, {
8593
- // passive: true,
8594
- // })
8595
- // $Menu.onkeydown = handleKeyDown
8596
- // $Menu.addEventListener('focusout', handleFocusOut)
8597
- // $Menu.oncontextmenu = handleContextMenu
8598
- // $ContextMenu.onfocus = handleFocus
8599
- // $ContextMenu.onblur = handleBlur
8600
- return $Menu;
8601
- };
8602
-
8603
- // TODO recycle menus
8604
- const setMenus = (state, changes, uid) => {
8605
- array(changes);
8606
- number(uid);
8607
- state.$$Menus ||= [];
8608
- const {
8609
- $$Menus
8610
- } = state;
8611
- for (const change of changes) {
8612
- const type = change[0];
8613
- switch (type) {
8614
- case 'addMenu':
8615
- {
8616
- const menu = change[1];
8617
- const dom = change[2];
8618
- const $Menu = create$Menu();
8619
- set$3($Menu, uid);
8620
- $Menu.onmouseover = handleMenuMouseOver;
8621
- $Menu.onclick = handleMenuClick;
8622
- const {
8623
- focusedIndex,
8624
- height,
8625
- level,
8626
- width,
8627
- x,
8628
- y
8629
- } = menu;
8630
- setBounds$a($Menu, x, y, width, height);
8631
- renderInto($Menu, dom);
8632
- $Menu.id = `Menu-${level}`;
8633
- append$1($Menu);
8634
- if (focusedIndex !== -1) {
8635
- const $Child = $Menu.children[focusedIndex];
8636
- // @ts-expect-error
8637
- $Child.focus();
8638
- }
8639
- $$Menus.push($Menu);
8640
- break;
8641
- }
8642
- case 'closeMenus':
8643
- {
8644
- const keepCount = change[1];
8645
- const $$ToDispose = $$Menus.slice(keepCount);
8646
- for (const $ToDispose of $$ToDispose) {
8647
- remove$1($ToDispose);
8648
- }
8649
- $$Menus.length = keepCount;
8650
- break;
8651
- }
8652
- case 'updateMenu':
8653
- {
8654
- const menu = change[1];
8655
- const newLength = change[2];
8656
- const dom = change[3];
8657
- const {
8658
- focusedIndex,
8659
- height,
8660
- level,
8661
- width,
8662
- x,
8663
- y
8664
- } = menu;
8665
- const $Menu = $$Menus[level];
8666
- setBounds$a($Menu, x, y, width, height);
8667
- renderInto($Menu, dom);
8668
- if (level === newLength - 1) {
8669
- if (focusedIndex === -1) {
8670
- $Menu.focus();
8671
- } else {
8672
- const $Child = $Menu.children[focusedIndex];
8673
- $Child.focus();
8674
- }
8675
- }
8676
- break;
8677
- }
8678
- // No default
8679
- }
8680
- }
8681
- };
8682
-
8683
- const ViewletTitleBarMenuBar = {
8684
- __proto__: null,
8685
- Events: ViewletTitleBarMenuBarEvents,
8686
- closeMenu,
8687
- dispose: dispose$4,
8688
- focus: focus$2,
8689
- openMenu,
8690
- setFocusedIndex,
8691
- setMenus
8692
- };
8693
-
8694
- const activeClassName = 'TitleBarActive';
8695
- const setFocused = (state, isFocused) => {
8696
- const {
8697
- $Viewlet
8698
- } = state;
8699
- $Viewlet.classList.toggle(activeClassName, isFocused);
8700
- };
8701
-
8702
- const ViewletTitleBar = {
8703
- __proto__: null,
8704
- Events: ViewletTitleBarMenuBarEvents,
8705
- closeMenu,
8706
- dispose: dispose$4,
8707
- focus: focus$2,
8708
- openMenu,
8709
- setFocused,
8710
- setFocusedIndex,
8711
- setMenus
8712
- };
8713
-
8714
- /**
8715
- *
8716
- * @param {MouseEvent} event
8717
- */
8718
- const handleTitleBarButtonsClick = event => {
8719
- const {
8720
- target
8721
- } = event;
8722
- return ['handleClick', target.className];
8723
- };
8724
- const returnValue$1 = true;
8725
-
8726
- const ViewletTitleBarButtonsEvents = {
8727
- __proto__: null,
8728
- handleTitleBarButtonsClick,
8729
- returnValue: returnValue$1
8730
- };
8731
-
8732
- const ViewletTitleBarButtons = {
8733
- __proto__: null,
8734
- Events: ViewletTitleBarButtonsEvents
8735
- };
8736
-
8737
- const Events = {};
8738
-
8739
- const ViewletTitleBarIcon = {
8740
- __proto__: null,
8741
- Events
8742
- };
8743
-
8744
- const create$4 = () => {
8745
- const $Viewlet = document.createElement('div');
8746
- $Viewlet.className = 'Viewlet TitleBarTitle';
8747
- return {
8748
- $Viewlet
8749
- };
8750
- };
8751
- const setDom$1 = (state, dom) => {
8752
- const {
8753
- $Viewlet
8754
- } = state;
8755
- renderInto($Viewlet, dom);
8756
- };
8757
-
8758
- const ViewletTitleBarTitle = {
8759
8025
  __proto__: null,
8760
8026
  create: create$4,
8761
- setDom: setDom$1
8027
+ setTabsDom
8762
8028
  };
8763
8029
 
8764
8030
  const handleVideoError$1 = (code, message) => {
@@ -8969,10 +8235,6 @@ const load$1 = moduleId => {
8969
8235
  return ViewletKeyBindings;
8970
8236
  case Layout:
8971
8237
  return ViewletLayout;
8972
- case Main:
8973
- return ViewletMain;
8974
- case MainTabs:
8975
- return ViewletMainTabs;
8976
8238
  case Output:
8977
8239
  return ViewletOutput;
8978
8240
  case Panel:
@@ -8997,16 +8259,6 @@ const load$1 = moduleId => {
8997
8259
  return Promise.resolve().then(function () { return ViewletTerminal; });
8998
8260
  case Terminals:
8999
8261
  return ViewletTerminals;
9000
- case TitleBar:
9001
- return ViewletTitleBar;
9002
- case TitleBarButtons:
9003
- return ViewletTitleBarButtons;
9004
- case TitleBarIcon:
9005
- return ViewletTitleBarIcon;
9006
- case TitleBarMenuBar:
9007
- return ViewletTitleBarMenuBar;
9008
- case TitleBarTitle:
9009
- return ViewletTitleBarTitle;
9010
8262
  case Video:
9011
8263
  return ViewletVideo;
9012
8264
  case WebView:
@@ -9910,7 +9162,7 @@ const commandMap = {
9910
9162
  'GetFilePathElectron.getFilePathElectron': getFilePathElectron,
9911
9163
  'HandleMessagePort.handleMessagePort': handleMessagePort,
9912
9164
  'InitData.getInitData': getInitData,
9913
- 'IpcParent.create': create$z,
9165
+ 'IpcParent.create': create$w,
9914
9166
  'KeyBindings.setIdentifiers': setIdentifiers,
9915
9167
  'Layout.getBounds': getBounds,
9916
9168
  'Location.getHref': getHref,
@@ -9925,10 +9177,10 @@ const commandMap = {
9925
9177
  'Menu.showControlled': showControlled,
9926
9178
  'Menu.showMenu': showMenu,
9927
9179
  'Meta.setThemeColor': setThemeColor,
9928
- 'Notification.create': create$y,
9180
+ 'Notification.create': create$v,
9929
9181
  'Notification.createWithOptions': createWithOptions,
9930
- 'Notification.dispose': dispose$i,
9931
- 'OffscreenCanvas.create': create$x,
9182
+ 'Notification.dispose': dispose$g,
9183
+ 'OffscreenCanvas.create': create$u,
9932
9184
  'OffscreenCanvas.create2': create2,
9933
9185
  'Open.openUrl': openUrl,
9934
9186
  'Performance.getMemory': getMemory,
@@ -9989,7 +9241,7 @@ const getConfiguredEditorWorkerUrl = () => {
9989
9241
  const editorWorkerUrl = getConfiguredEditorWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/editor-worker/dist/editorWorkerMain.js`;
9990
9242
 
9991
9243
  const launchEditorWorker = async port => {
9992
- const ipc = await create$z({
9244
+ const ipc = await create$w({
9993
9245
  method: ModuleWorkerWithMessagePort,
9994
9246
  name: 'Editor Worker',
9995
9247
  port,
@@ -10017,7 +9269,7 @@ const extensionHostWorkerUrl = getConfiguredExtensionHostWorkerUrl() || `${asset
10017
9269
 
10018
9270
  const launchExtensionHostWorker = async port => {
10019
9271
  const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
10020
- const ipc = await create$z({
9272
+ const ipc = await create$w({
10021
9273
  method: ModuleWorkerWithMessagePort,
10022
9274
  name,
10023
9275
  port,
@@ -10045,7 +9297,7 @@ const getConfiguredSyntaxHighlightingWorkerUrl = () => {
10045
9297
  const syntaxHighlightingWorkerUrl = getConfiguredSyntaxHighlightingWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/syntax-highlighting-worker/dist/syntaxHighlightingWorkerMain.js`;
10046
9298
 
10047
9299
  const launchSyntaxHighlightingWorker = async port => {
10048
- const ipc = await create$z({
9300
+ const ipc = await create$w({
10049
9301
  method: ModuleWorkerWithMessagePort,
10050
9302
  name: 'Syntax Highlighting Worker',
10051
9303
  port,
@@ -10078,7 +9330,7 @@ const launchWorkers = () => {
10078
9330
  const handleFocusIn = event => {
10079
9331
  preventDefault(event);
10080
9332
  const uid = fromEvent(event);
10081
- handleFocusIn$4(uid);
9333
+ handleFocusIn$3(uid);
10082
9334
  };
10083
9335
  const handleBlur$1 = event => {
10084
9336
  const uid = fromEvent(event);
@@ -10441,7 +9693,6 @@ const main = async () => {
10441
9693
  state$1.modules[EditorRename] = ViewletEditorRename;
10442
9694
  state$1.modules[EditorSourceActions] = ViewletEditorSourceActions;
10443
9695
  state$1.modules[FindWidget] = ViewletFindWidget;
10444
- state$1.modules[TitleBar] = ViewletTitleBar;
10445
9696
  // TODO this is discovered very late
10446
9697
  await launchWorkers();
10447
9698
  setIpc(RendererWorker);