@lvce-editor/renderer-process 21.19.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);
@@ -3130,6 +3143,7 @@ const create2 = async (canvasId, objectId, width, height) => {
3130
3143
  canvas.height = height;
3131
3144
  }
3132
3145
  const offscreenCanvas = canvas.transferControlToOffscreen();
3146
+ canvas.dataset.id = canvasId;
3133
3147
  set$1$1(canvasId, {
3134
3148
  factory: {},
3135
3149
  state: {
@@ -3149,7 +3163,6 @@ const Complementary = 'complementary';
3149
3163
  const Group = 'group';
3150
3164
  const ListBox = 'listbox';
3151
3165
  const Log = 'log';
3152
- const Main$1 = 'main';
3153
3166
  const Menu = 'menu';
3154
3167
  const None$2 = 'none';
3155
3168
  const Status = 'status';
@@ -3179,11 +3192,6 @@ const CompositionUpdate = 'compositionupdate';
3179
3192
  const ContextMenu = 'contextmenu';
3180
3193
  const Cut = 'cut';
3181
3194
  const DoubleClick = 'dblclick';
3182
- const DragEnd = 'dragend';
3183
- const DragLeave = 'dragleave';
3184
- const DragOver = 'dragover';
3185
- const DragStart = 'dragstart';
3186
- const Drop = 'drop';
3187
3195
  const Error$2 = 'error';
3188
3196
  const Focus = 'focus';
3189
3197
  const FocusIn = 'focusin';
@@ -3248,7 +3256,7 @@ const getElement = () => {
3248
3256
  return state$4.$PreviousFocusElement;
3249
3257
  };
3250
3258
 
3251
- const focus$f = $Element => {
3259
+ const focus$d = $Element => {
3252
3260
  if ($Element === document.activeElement) {
3253
3261
  return;
3254
3262
  }
@@ -3417,10 +3425,10 @@ const handleMouseLeave = event => {
3417
3425
  const handleKeyDown$5 = event => {
3418
3426
  state$3.handleKeyDown(event);
3419
3427
  };
3420
- const handleFocusOut$1 = event => {
3428
+ const handleFocusOut = event => {
3421
3429
  state$3.handleFocusOut(event);
3422
3430
  };
3423
- const create$Menu$1 = () => {
3431
+ const create$Menu = () => {
3424
3432
  // TODO set aria label on menu (e.g. File, Edit, Selection)
3425
3433
  const $Menu = document.createElement('ul');
3426
3434
  $Menu.className = 'Menu';
@@ -3439,8 +3447,8 @@ const create$Menu$1 = () => {
3439
3447
  // passive: true,
3440
3448
  // })
3441
3449
  $Menu.onkeydown = handleKeyDown$5;
3442
- $Menu.addEventListener(FocusOut, handleFocusOut$1);
3443
- $Menu.oncontextmenu = handleContextMenu$9;
3450
+ $Menu.addEventListener(FocusOut, handleFocusOut);
3451
+ $Menu.oncontextmenu = handleContextMenu$8;
3444
3452
  // $ContextMenu.onfocus = handleFocus
3445
3453
  // $ContextMenu.onblur = handleBlur
3446
3454
  return $Menu;
@@ -3469,19 +3477,19 @@ const handleBackDropMouseDown = event => {
3469
3477
  stopPropagation(event);
3470
3478
  send(/* Menu.hide */'Menu.hide');
3471
3479
  };
3472
- const handleContextMenu$9 = event => {
3480
+ const handleContextMenu$8 = event => {
3473
3481
  preventDefault(event);
3474
3482
  };
3475
3483
  const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mouseBlocking = false) => {
3476
3484
  if (mouseBlocking) {
3477
3485
  const $BackDrop = create$BackDrop();
3478
3486
  $BackDrop.onmousedown = handleBackDropMouseDown;
3479
- $BackDrop.oncontextmenu = handleContextMenu$9;
3487
+ $BackDrop.oncontextmenu = handleContextMenu$8;
3480
3488
  // @ts-expect-error
3481
3489
  state$3.$BackDrop = $BackDrop;
3482
3490
  append$1($BackDrop);
3483
3491
  }
3484
- const $Menu = create$Menu$1();
3492
+ const $Menu = create$Menu();
3485
3493
  renderInto($Menu, dom);
3486
3494
  setXAndY($Menu, x, y);
3487
3495
  $Menu.id = `Menu-${level}`;
@@ -3497,7 +3505,7 @@ const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mous
3497
3505
  state$3.$$Menus.push($Menu);
3498
3506
  append$1($Menu);
3499
3507
  if (level === 0) {
3500
- focus$f($Menu);
3508
+ focus$d($Menu);
3501
3509
  send('Focus.setFocus', FocusMenu);
3502
3510
  }
3503
3511
  };
@@ -4291,7 +4299,7 @@ const showError = (message, y, x) => {
4291
4299
  $ImagePreviewImage
4292
4300
  };
4293
4301
  };
4294
- const create$w = (uri, top, left) => {
4302
+ const create$t = (uri, top, left) => {
4295
4303
  const $ImagePreviewImage = document.createElement('img');
4296
4304
  $ImagePreviewImage.className = 'ImagePreviewImage';
4297
4305
  $ImagePreviewImage.src = uri;
@@ -4316,14 +4324,14 @@ const create$w = (uri, top, left) => {
4316
4324
  const update = (state, uri) => {
4317
4325
  state.$ImagePreviewImage.uri = uri;
4318
4326
  };
4319
- const dispose$h = state => {
4327
+ const dispose$f = state => {
4320
4328
  remove$1(state.$ImagePreview);
4321
4329
  };
4322
4330
 
4323
4331
  const ImagePreview$1 = {
4324
4332
  __proto__: null,
4325
- create: create$w,
4326
- dispose: dispose$h,
4333
+ create: create$t,
4334
+ dispose: dispose$f,
4327
4335
  showError,
4328
4336
  update
4329
4337
  };
@@ -4370,7 +4378,7 @@ const handleFocus$9 = () => {
4370
4378
 
4371
4379
  // TODO use context menu events function again
4372
4380
 
4373
- const handleContextMenu$8 = event => {
4381
+ const handleContextMenu$7 = event => {
4374
4382
  preventDefault(event);
4375
4383
  const {
4376
4384
  button,
@@ -4379,22 +4387,22 @@ const handleContextMenu$8 = event => {
4379
4387
  } = event;
4380
4388
  return ['handleContextMenu', button, clientX, clientY];
4381
4389
  };
4382
- const returnValue$8 = true;
4390
+ const returnValue$7 = true;
4383
4391
 
4384
4392
  const ViewletActivityBarEvents = {
4385
4393
  __proto__: null,
4386
4394
  handleBlur: handleBlur$9,
4387
- handleContextMenu: handleContextMenu$8,
4395
+ handleContextMenu: handleContextMenu$7,
4388
4396
  handleFocus: handleFocus$9,
4389
4397
  handleMouseDown: handleMouseDown$3,
4390
- returnValue: returnValue$8
4398
+ returnValue: returnValue$7
4391
4399
  };
4392
4400
 
4393
- const Events$5 = ViewletActivityBarEvents;
4401
+ const Events$4 = ViewletActivityBarEvents;
4394
4402
 
4395
4403
  const ViewletActivityBar = {
4396
4404
  __proto__: null,
4397
- Events: Events$5
4405
+ Events: Events$4
4398
4406
  };
4399
4407
 
4400
4408
  const executeViewletCommand = (uid, command, ...args) => {
@@ -4419,7 +4427,7 @@ const forwardViewletCommand = name => {
4419
4427
  forwardViewletCommand('clearFilter');
4420
4428
  forwardViewletCommand('close');
4421
4429
  forwardViewletCommand('closeEditor');
4422
- const closeMenu$1 = forwardViewletCommand('closeMenu');
4430
+ forwardViewletCommand('closeMenu');
4423
4431
  forwardViewletCommand('compositionEnd');
4424
4432
  forwardViewletCommand('compositionStart');
4425
4433
  forwardViewletCommand('compositionUpdate');
@@ -4433,7 +4441,7 @@ forwardViewletCommand('handleBeforeInput');
4433
4441
  forwardViewletCommand('handleBeforeInputFromContentEditable');
4434
4442
  const handleBlur$8 = forwardViewletCommand('handleBlur');
4435
4443
  const handleButtonClick = forwardViewletCommand('handleButtonClick');
4436
- const handleClick$6 = forwardViewletCommand('handleClick');
4444
+ const handleClick$5 = forwardViewletCommand('handleClick');
4437
4445
  const handleClickAction$2 = forwardViewletCommand('handleClickAction');
4438
4446
  forwardViewletCommand('handleClickAdd');
4439
4447
  const handleClickAt$3 = forwardViewletCommand('handleClickAt');
@@ -4446,29 +4454,29 @@ forwardViewletCommand('handleClickOpenFolder');
4446
4454
  forwardViewletCommand('handleClickRestore');
4447
4455
  const handleClickTab$2 = forwardViewletCommand('handleClickTab');
4448
4456
  forwardViewletCommand('handleClickToggleMaximize');
4449
- const handleContextMenu$7 = forwardViewletCommand('handleContextMenu');
4457
+ const handleContextMenu$6 = forwardViewletCommand('handleContextMenu');
4450
4458
  forwardViewletCommand('handleDoubleClick');
4451
- const handleDragEnd$1 = forwardViewletCommand('handleDragEnd');
4452
- const handleDragLeave$1 = forwardViewletCommand('handleDragLeave');
4453
- const handleDragOver$2 = forwardViewletCommand('handleDragOver');
4459
+ forwardViewletCommand('handleDragEnd');
4460
+ forwardViewletCommand('handleDragLeave');
4461
+ forwardViewletCommand('handleDragOver');
4462
+ forwardViewletCommand('handleDrop');
4463
+ forwardViewletCommand('handleDropFilePath');
4454
4464
  forwardViewletCommand('handleDrop');
4455
- const handleDropFilePath = forwardViewletCommand('handleDropFilePath');
4456
- const handleDropFiles = forwardViewletCommand('handleDrop');
4457
4465
  forwardViewletCommand('handleFeaturesClick');
4458
4466
  forwardViewletCommand('handleClickSize');
4459
4467
  forwardViewletCommand('handleClickDisable');
4460
4468
  forwardViewletCommand('handleClickUninstall');
4461
4469
  forwardViewletCommand('handleFilterInput');
4462
4470
  const handleFocus$8 = forwardViewletCommand('handleFocus');
4463
- const handleFocusIn$4 = forwardViewletCommand('handleFocusIn');
4471
+ const handleFocusIn$3 = forwardViewletCommand('handleFocusIn');
4464
4472
  forwardViewletCommand('handleIconError');
4465
4473
  const handleImageError = forwardViewletCommand('handleImageError');
4466
4474
  const handleInput$6 = forwardViewletCommand('handleInput');
4467
4475
  const handleKeyDown$4 = forwardViewletCommand('handleKeyDown');
4468
4476
  forwardViewletCommand('handleListBlur');
4469
4477
  forwardViewletCommand('handleListFocus');
4470
- const handleMenuClick$1 = forwardViewletCommand('handleMenuClick');
4471
- const handleMenuMouseOver$1 = forwardViewletCommand('handleMenuMouseOver');
4478
+ forwardViewletCommand('handleMenuClick');
4479
+ forwardViewletCommand('handleMenuMouseOver');
4472
4480
  const handleMouseDown$2 = forwardViewletCommand('handleMouseDown');
4473
4481
  forwardViewletCommand('handleMouseMove');
4474
4482
  const handleMouseOut$1 = forwardViewletCommand('handleMouseOut');
@@ -4492,14 +4500,14 @@ forwardViewletCommand('handleScrollBarMove');
4492
4500
  forwardViewletCommand('handleScrollBarVerticalPointerDown');
4493
4501
  forwardViewletCommand('handleSliderPointerDown');
4494
4502
  forwardViewletCommand('handleSliderPointerMove');
4495
- const handleTabClick = forwardViewletCommand('handleTabClick');
4496
- const handleTabContextMenu = forwardViewletCommand('handleTabContextMenu');
4497
- const handleTabDrop = forwardViewletCommand('handleTabDrop');
4503
+ forwardViewletCommand('handleTabClick');
4504
+ forwardViewletCommand('handleTabContextMenu');
4505
+ forwardViewletCommand('handleTabDrop');
4498
4506
  forwardViewletCommand('handleTabsClick');
4499
- const handleTabsDragOver = forwardViewletCommand('handleTabsDragOver');
4507
+ forwardViewletCommand('handleTabsDragOver');
4500
4508
  forwardViewletCommand('handleTabsPointerOut');
4501
4509
  forwardViewletCommand('handleTabsPointerOver');
4502
- const handleTabsWheel$1 = forwardViewletCommand('handleTabsWheel');
4510
+ forwardViewletCommand('handleTabsWheel');
4503
4511
  forwardViewletCommand('handleTouchEnd');
4504
4512
  forwardViewletCommand('handleTouchMove');
4505
4513
  forwardViewletCommand('handleTouchStart');
@@ -4540,21 +4548,21 @@ const ViewletAudioEvents = {
4540
4548
  handleAudioError
4541
4549
  };
4542
4550
 
4543
- const Events$4 = ViewletAudioEvents;
4551
+ const Events$3 = ViewletAudioEvents;
4544
4552
 
4545
4553
  const ViewletAudio = {
4546
4554
  __proto__: null,
4547
- Events: Events$4
4555
+ Events: Events$3
4548
4556
  };
4549
4557
 
4550
- const create$v = () => {
4558
+ const create$s = () => {
4551
4559
  const $Viewlet = document.createElement('div');
4552
4560
  $Viewlet.className = 'Viewlet Clock';
4553
4561
  return {
4554
4562
  $Viewlet
4555
4563
  };
4556
4564
  };
4557
- const dispose$g = state => {};
4565
+ const dispose$e = state => {};
4558
4566
  const refresh$4 = () => {};
4559
4567
  const setTime = (state, time) => {
4560
4568
  object(state);
@@ -4564,8 +4572,8 @@ const setTime = (state, time) => {
4564
4572
 
4565
4573
  const ViewletClock = {
4566
4574
  __proto__: null,
4567
- create: create$v,
4568
- dispose: dispose$g,
4575
+ create: create$s,
4576
+ dispose: dispose$e,
4569
4577
  refresh: refresh$4,
4570
4578
  setTime
4571
4579
  };
@@ -4593,7 +4601,7 @@ const stopTracking$1 = ($Target, pointerId, handlePointerMove, handlePointerUp)
4593
4601
  // TODO use pointerlost event instead
4594
4602
  $Target.removeEventListener(PointerUp, handlePointerUp);
4595
4603
  };
4596
- const create$u = (pointerDown, pointerMove, pointerUp) => {
4604
+ const create$r = (pointerDown, pointerMove, pointerUp) => {
4597
4605
  const shared = (fn, event) => {
4598
4606
  const message = fn(event);
4599
4607
  if (!message || message.length === 0) {
@@ -4626,7 +4634,7 @@ const create$u = (pointerDown, pointerMove, pointerUp) => {
4626
4634
  };
4627
4635
 
4628
4636
  const handleOffset = 20;
4629
- const handleSliderPointerDown = create$u(event => {
4637
+ const handleSliderPointerDown = create$r(event => {
4630
4638
  const {
4631
4639
  clientX,
4632
4640
  clientY
@@ -4650,12 +4658,12 @@ const handlePointerDown$2 = event => {
4650
4658
  }
4651
4659
  return [];
4652
4660
  };
4653
- const returnValue$7 = true;
4661
+ const returnValue$6 = true;
4654
4662
 
4655
4663
  const ViewletColorPickerEvents = {
4656
4664
  __proto__: null,
4657
4665
  handlePointerDown: handlePointerDown$2,
4658
- returnValue: returnValue$7
4666
+ returnValue: returnValue$6
4659
4667
  };
4660
4668
 
4661
4669
  const setColor = (state, color) => {
@@ -4708,14 +4716,14 @@ const ViewletDebugConsoleEvents = {
4708
4716
  handleInput: handleInput$5
4709
4717
  };
4710
4718
 
4711
- const create$t = () => {
4719
+ const create$q = () => {
4712
4720
  const $Viewlet = document.createElement('div');
4713
4721
  $Viewlet.className = 'Viewlet DebugConsole';
4714
4722
  return {
4715
4723
  $Viewlet
4716
4724
  };
4717
4725
  };
4718
- const setDom$9 = (state, dom) => {
4726
+ const setDom$8 = (state, dom) => {
4719
4727
  const {
4720
4728
  $Viewlet
4721
4729
  } = state;
@@ -4724,8 +4732,8 @@ const setDom$9 = (state, dom) => {
4724
4732
 
4725
4733
  const ViewletDebugConsole = {
4726
4734
  __proto__: null,
4727
- create: create$t,
4728
- setDom: setDom$9
4735
+ create: create$q,
4736
+ setDom: setDom$8
4729
4737
  };
4730
4738
 
4731
4739
  const handleKeyDown$3 = event => {
@@ -4761,7 +4769,7 @@ const setValue$2 = (state, value) => {
4761
4769
  const $Input = $Viewlet.querySelector('input');
4762
4770
  $Input.value = value;
4763
4771
  };
4764
- const focus$e = state => {
4772
+ const focus$c = state => {
4765
4773
  const {
4766
4774
  $Viewlet
4767
4775
  } = state;
@@ -4772,7 +4780,7 @@ const focus$e = state => {
4772
4780
  const ViewletDefineKeyBinding = {
4773
4781
  __proto__: null,
4774
4782
  Events: ViewletDefineKeyBindingEvents,
4775
- focus: focus$e,
4783
+ focus: focus$c,
4776
4784
  setValue: setValue$2
4777
4785
  };
4778
4786
 
@@ -4785,7 +4793,7 @@ const setMaskImage = ($Element, icon) => {
4785
4793
  }
4786
4794
  };
4787
4795
 
4788
- const create$s = icon => {
4796
+ const create$p = icon => {
4789
4797
  const $Icon = document.createElement('div');
4790
4798
  $Icon.className = 'MaskIcon';
4791
4799
  setMaskImage($Icon, icon);
@@ -4795,7 +4803,7 @@ const create$s = icon => {
4795
4803
 
4796
4804
  const create$Button = (label, icon) => {
4797
4805
  // TODO icon div might not be needed (unnecessary html element)
4798
- const $Icon = create$s(icon);
4806
+ const $Icon = create$p(icon);
4799
4807
  const $Button = document.createElement('button');
4800
4808
  $Button.className = 'IconButton';
4801
4809
  $Button.title = label;
@@ -4804,19 +4812,19 @@ const create$Button = (label, icon) => {
4804
4812
  return $Button;
4805
4813
  };
4806
4814
 
4807
- const handleClick$5 = index => {
4815
+ const handleClick$4 = index => {
4808
4816
  send(/* Dialog.handleClick */'Dialog.handleClick', /* index */index);
4809
4817
  };
4810
4818
 
4811
- const handleClick$4 = event => {
4819
+ const handleClick$3 = event => {
4812
4820
  const {
4813
4821
  target
4814
4822
  } = event;
4815
4823
  const index = getNodeIndex(target);
4816
- handleClick$5(index);
4824
+ handleClick$4(index);
4817
4825
  };
4818
4826
 
4819
- const create$r = () => {
4827
+ const create$o = () => {
4820
4828
  const $DialogTitle = document.createElement('h2');
4821
4829
  $DialogTitle.id = 'DialogTitle';
4822
4830
  const $DialogCloseButton = create$Button('Close', 'Close');
@@ -4843,7 +4851,7 @@ const create$r = () => {
4843
4851
  $Dialog.setAttribute(AriaLabelledBy, 'DialogTitle');
4844
4852
  $Dialog.setAttribute(AriaDescribedBy, 'DialogBodyErrorMessage');
4845
4853
  $Dialog.append($DialogHeader, $DialogBody);
4846
- $Dialog.onclick = handleClick$4;
4854
+ $Dialog.onclick = handleClick$3;
4847
4855
  return {
4848
4856
  $DialogBodyErrorCodeFrame,
4849
4857
  $DialogBodyErrorMessage,
@@ -4897,7 +4905,7 @@ const setErrorStack = (state, errorStack) => {
4897
4905
 
4898
4906
  const ViewletDialog = {
4899
4907
  __proto__: null,
4900
- create: create$r,
4908
+ create: create$o,
4901
4909
  postAppend,
4902
4910
  setButtons,
4903
4911
  setCodeFrame,
@@ -4951,7 +4959,7 @@ const handleClickAt$2 = event => {
4951
4959
  const handleLoad$3 = event => {
4952
4960
  return ['handleLoad'];
4953
4961
  };
4954
- const handleContextMenu$6 = event => {
4962
+ const handleContextMenu$5 = event => {
4955
4963
  preventDefault(event);
4956
4964
  const {
4957
4965
  button,
@@ -4960,7 +4968,7 @@ const handleContextMenu$6 = event => {
4960
4968
  } = event;
4961
4969
  return ['handleContextMenu', button, clientX, clientY];
4962
4970
  };
4963
- const handleSashCornerPointerDown = create$u(event => {
4971
+ const handleSashCornerPointerDown = create$r(event => {
4964
4972
  const {
4965
4973
  clientX,
4966
4974
  clientY
@@ -4979,15 +4987,15 @@ const handleSashCornerPointerDown = create$u(event => {
4979
4987
  } = event;
4980
4988
  return ['handleSashCornerPointerUp', clientX, clientY];
4981
4989
  });
4982
- const returnValue$6 = true;
4990
+ const returnValue$5 = true;
4983
4991
 
4984
4992
  const ViewletE2eTestEvents = {
4985
4993
  __proto__: null,
4986
4994
  handleClickAt: handleClickAt$2,
4987
- handleContextMenu: handleContextMenu$6,
4995
+ handleContextMenu: handleContextMenu$5,
4988
4996
  handleLoad: handleLoad$3,
4989
4997
  handleSashCornerPointerDown,
4990
- returnValue: returnValue$6
4998
+ returnValue: returnValue$5
4991
4999
  };
4992
5000
 
4993
5001
  // TODO could use browser view when running in electron
@@ -5048,7 +5056,7 @@ const handleClickAt$1 = event => {
5048
5056
  const handleLoad$2 = event => {
5049
5057
  return ['handleLoad'];
5050
5058
  };
5051
- const handleContextMenu$5 = event => {
5059
+ const handleContextMenu$4 = event => {
5052
5060
  preventDefault(event);
5053
5061
  const {
5054
5062
  button,
@@ -5057,14 +5065,14 @@ const handleContextMenu$5 = event => {
5057
5065
  } = event;
5058
5066
  return ['handleContextMenu', button, clientX, clientY];
5059
5067
  };
5060
- const returnValue$5 = true;
5068
+ const returnValue$4 = true;
5061
5069
 
5062
5070
  const ViewletE2eTestsEvents = {
5063
5071
  __proto__: null,
5064
5072
  handleClickAt: handleClickAt$1,
5065
- handleContextMenu: handleContextMenu$5,
5073
+ handleContextMenu: handleContextMenu$4,
5066
5074
  handleLoad: handleLoad$2,
5067
- returnValue: returnValue$5
5075
+ returnValue: returnValue$4
5068
5076
  };
5069
5077
 
5070
5078
  const sendToIframe = (contentWindow, message, origin, transfer) => {
@@ -5129,10 +5137,10 @@ const ViewletE2eTests = {
5129
5137
 
5130
5138
  const Script = 2;
5131
5139
 
5132
- const handleFocusIn$3 = event => {
5140
+ const handleFocusIn$2 = event => {
5133
5141
  preventDefault(event);
5134
5142
  const uid = fromEvent(event);
5135
- handleFocusIn$4(uid);
5143
+ handleFocusIn$3(uid);
5136
5144
  };
5137
5145
  const handleBlur$6 = event => {
5138
5146
  preventDefault(event);
@@ -5143,7 +5151,7 @@ const handleBlur$6 = event => {
5143
5151
  const ViewletEditorCodeGeneratorEvents = {
5144
5152
  __proto__: null,
5145
5153
  handleBlur: handleBlur$6,
5146
- handleFocusIn: handleFocusIn$3
5154
+ handleFocusIn: handleFocusIn$2
5147
5155
  };
5148
5156
 
5149
5157
  const setBounds$9 = (state, x, y, width, height) => {
@@ -5159,10 +5167,10 @@ const appendWidget$5 = state => {
5159
5167
  } = state;
5160
5168
  append$1($Viewlet);
5161
5169
  };
5162
- const dispose$f = state => {
5170
+ const dispose$d = state => {
5163
5171
  remove$1(state.$Viewlet);
5164
5172
  };
5165
- const focus$d = (state, key, source) => {
5173
+ const focus$b = (state, key, source) => {
5166
5174
  if (!key) {
5167
5175
  return;
5168
5176
  }
@@ -5185,12 +5193,12 @@ const ViewletEditorCodeGenerator = {
5185
5193
  __proto__: null,
5186
5194
  Events: ViewletEditorCodeGeneratorEvents,
5187
5195
  appendWidget: appendWidget$5,
5188
- dispose: dispose$f,
5189
- focus: focus$d,
5196
+ dispose: dispose$d,
5197
+ focus: focus$b,
5190
5198
  setBounds: setBounds$9
5191
5199
  };
5192
5200
 
5193
- const attachEvents$8 = ($Node, eventMap) => {
5201
+ const attachEvents$6 = ($Node, eventMap) => {
5194
5202
  for (const [key, value] of Object.entries(eventMap)) {
5195
5203
  $Node.addEventListener(key, value);
5196
5204
  }
@@ -5309,7 +5317,7 @@ const setNegativeMargin = (state, negativeMargin) => {
5309
5317
  setTop($ListItems, negativeMargin);
5310
5318
  };
5311
5319
 
5312
- const create$q = () => {
5320
+ const create$n = () => {
5313
5321
  const $ListItems = document.createElement('div');
5314
5322
  $ListItems.className = 'ListItems';
5315
5323
  $ListItems.role = ListBox;
@@ -5333,24 +5341,24 @@ const create$q = () => {
5333
5341
  $Viewlet
5334
5342
  };
5335
5343
  };
5336
- const attachEvents$7 = state => {
5344
+ const attachEvents$5 = state => {
5337
5345
  const {
5338
5346
  $ListItems,
5339
5347
  $ScrollBar,
5340
5348
  $Viewlet
5341
5349
  } = state;
5342
5350
  $Viewlet.addEventListener(Wheel, handleWheel$2, Passive);
5343
- attachEvents$8($ListItems, {
5351
+ attachEvents$6($ListItems, {
5344
5352
  [MouseDown]: handleMousedown
5345
5353
  });
5346
- attachEvents$8($ScrollBar, {
5354
+ attachEvents$6($ScrollBar, {
5347
5355
  [PointerDown]: handleScrollBarPointerDown$1
5348
5356
  });
5349
5357
  };
5350
5358
  // TODO show should be passed active cursor position
5351
5359
  // this would make this function easier to test as it would avoid dependency on globals of other files
5352
5360
 
5353
- const setDom$8 = (state, dom) => {
5361
+ const setDom$7 = (state, dom) => {
5354
5362
  const {
5355
5363
  $ListItems,
5356
5364
  $Viewlet
@@ -5362,7 +5370,7 @@ const setDom$8 = (state, dom) => {
5362
5370
  // TODO recycle nodes
5363
5371
  // TODO set right aria attributes on $EditorInput
5364
5372
  };
5365
- const dispose$e = state => {
5373
+ const dispose$c = state => {
5366
5374
  remove$1(state.$Viewlet);
5367
5375
  // state.$EditorInput.removeAttribute('aria-activedescendant')
5368
5376
  };
@@ -5392,13 +5400,13 @@ const setBounds$8 = (state, x, y, width, height) => {
5392
5400
 
5393
5401
  const ViewletEditorCompletion = {
5394
5402
  __proto__: null,
5395
- attachEvents: attachEvents$7,
5396
- create: create$q,
5397
- dispose: dispose$e,
5403
+ attachEvents: attachEvents$5,
5404
+ create: create$n,
5405
+ dispose: dispose$c,
5398
5406
  handleError: handleError$6,
5399
5407
  setBounds: setBounds$8,
5400
5408
  setContentHeight,
5401
- setDom: setDom$8,
5409
+ setDom: setDom$7,
5402
5410
  setNegativeMargin,
5403
5411
  setScrollBar: setScrollBar$2,
5404
5412
  setSize,
@@ -5408,15 +5416,15 @@ const ViewletEditorCompletion = {
5408
5416
  const handleClose = () => {
5409
5417
  return ['closeDetails'];
5410
5418
  };
5411
- const returnValue$4 = true;
5419
+ const returnValue$3 = true;
5412
5420
 
5413
5421
  const ViewletEditorCompletionDetailsEvents = {
5414
5422
  __proto__: null,
5415
5423
  handleClose,
5416
- returnValue: returnValue$4
5424
+ returnValue: returnValue$3
5417
5425
  };
5418
5426
 
5419
- const create$p = () => {
5427
+ const create$m = () => {
5420
5428
  const $Viewlet = document.createElement('div');
5421
5429
  $Viewlet.className = 'Viewlet EditorCompletionDetails';
5422
5430
  $Viewlet.id = 'CompletionsDetails';
@@ -5424,10 +5432,10 @@ const create$p = () => {
5424
5432
  $Viewlet
5425
5433
  };
5426
5434
  };
5427
- const attachEvents$6 = state => {
5435
+ const attachEvents$4 = state => {
5428
5436
  // TODO
5429
5437
  };
5430
- const setDom$7 = (state, dom) => {
5438
+ const setDom$6 = (state, dom) => {
5431
5439
  const {
5432
5440
  $Viewlet
5433
5441
  } = state;
@@ -5442,7 +5450,7 @@ const appendWidget$4 = state => {
5442
5450
  } = state;
5443
5451
  append$1($Viewlet);
5444
5452
  };
5445
- const dispose$d = state => {
5453
+ const dispose$b = state => {
5446
5454
  remove$1(state.$Viewlet);
5447
5455
  };
5448
5456
  const setBounds$7 = (state, x, y, width, height) => {
@@ -5456,11 +5464,11 @@ const ViewletEditorCompletionDetails = {
5456
5464
  __proto__: null,
5457
5465
  Events: ViewletEditorCompletionDetailsEvents,
5458
5466
  appendWidget: appendWidget$4,
5459
- attachEvents: attachEvents$6,
5460
- create: create$p,
5461
- dispose: dispose$d,
5467
+ attachEvents: attachEvents$4,
5468
+ create: create$m,
5469
+ dispose: dispose$b,
5462
5470
  setBounds: setBounds$7,
5463
- setDom: setDom$7
5471
+ setDom: setDom$6
5464
5472
  };
5465
5473
 
5466
5474
  // TODO not sure whether created dom node
@@ -5476,14 +5484,14 @@ const ViewletEditorCompletionDetails = {
5476
5484
 
5477
5485
  // TODO aria alert
5478
5486
 
5479
- const create$o = () => {
5487
+ const create$l = () => {
5480
5488
  const $Viewlet = document.createElement('div');
5481
5489
  $Viewlet.className = 'Viewlet EditorError';
5482
5490
  return {
5483
5491
  $Viewlet
5484
5492
  };
5485
5493
  };
5486
- const setDom$6 = (state, dom) => {
5494
+ const setDom$5 = (state, dom) => {
5487
5495
  const {
5488
5496
  $Viewlet
5489
5497
  } = state;
@@ -5498,13 +5506,13 @@ const setBounds$6 = (state, x, y, width, height) => {
5498
5506
 
5499
5507
  const ViewletEditorError = {
5500
5508
  __proto__: null,
5501
- create: create$o,
5509
+ create: create$l,
5502
5510
  setBounds: setBounds$6,
5503
- setDom: setDom$6
5511
+ setDom: setDom$5
5504
5512
  };
5505
5513
 
5506
- const returnValue$3 = true;
5507
- const handleSashPointerDown$2 = create$u(event => {
5514
+ const returnValue$2 = true;
5515
+ const handleSashPointerDown$2 = create$r(event => {
5508
5516
  const {
5509
5517
  clientX,
5510
5518
  clientY
@@ -5527,7 +5535,7 @@ const handleSashPointerDown$2 = create$u(event => {
5527
5535
  const ViewletEditorHoverEvents = {
5528
5536
  __proto__: null,
5529
5537
  handleSashPointerDown: handleSashPointerDown$2,
5530
- returnValue: returnValue$3
5538
+ returnValue: returnValue$2
5531
5539
  };
5532
5540
 
5533
5541
  const setBounds$5 = (state, x, y, width, height) => {
@@ -5543,7 +5551,7 @@ const appendWidget$3 = state => {
5543
5551
  } = state;
5544
5552
  append$1($Viewlet);
5545
5553
  };
5546
- const setDom$5 = (state, dom) => {
5554
+ const setDom$4 = (state, dom) => {
5547
5555
  const {
5548
5556
  $Viewlet
5549
5557
  } = state;
@@ -5555,7 +5563,7 @@ const ViewletEditorHover = {
5555
5563
  Events: ViewletEditorHoverEvents,
5556
5564
  appendWidget: appendWidget$3,
5557
5565
  setBounds: setBounds$5,
5558
- setDom: setDom$5
5566
+ setDom: setDom$4
5559
5567
  };
5560
5568
 
5561
5569
  const LeftClick = 0;
@@ -5638,7 +5646,7 @@ const handleWheel$1 = event => {
5638
5646
  *
5639
5647
  * @param {MouseEvent} event
5640
5648
  */
5641
- const handleContextMenu$4 = event => {
5649
+ const handleContextMenu$3 = event => {
5642
5650
  preventDefault(event);
5643
5651
  const {
5644
5652
  button,
@@ -5646,7 +5654,7 @@ const handleContextMenu$4 = event => {
5646
5654
  clientY
5647
5655
  } = event;
5648
5656
  const uid = fromEvent(event);
5649
- handleContextMenu$7(uid, button, clientX, clientY);
5657
+ handleContextMenu$6(uid, button, clientX, clientY);
5650
5658
  };
5651
5659
  const handleError$5 = event => {
5652
5660
  const uid = fromEvent(event);
@@ -5657,19 +5665,19 @@ const handleFocus$6 = event => {
5657
5665
  handleFocus$8(uid);
5658
5666
  };
5659
5667
 
5660
- const create$n = () => {
5668
+ const create$k = () => {
5661
5669
  const $Viewlet = document.createElement('div');
5662
5670
  $Viewlet.className = 'Viewlet EditorImage';
5663
5671
  return {
5664
5672
  $Viewlet
5665
5673
  };
5666
5674
  };
5667
- const attachEvents$5 = state => {
5675
+ const attachEvents$3 = state => {
5668
5676
  const {
5669
5677
  $Viewlet
5670
5678
  } = state;
5671
- attachEvents$8($Viewlet, {
5672
- [ContextMenu]: handleContextMenu$4,
5679
+ attachEvents$6($Viewlet, {
5680
+ [ContextMenu]: handleContextMenu$3,
5673
5681
  [FocusIn]: handleFocus$6,
5674
5682
  [PointerDown]: handlePointerDown$1,
5675
5683
  [PointerUp]: handlePointerUp
@@ -5690,7 +5698,7 @@ const setDragging = (state, isDragging) => {
5690
5698
  } = state;
5691
5699
  $Viewlet.classList.toggle('Dragging', isDragging);
5692
5700
  };
5693
- const setDom$4 = (state, dom) => {
5701
+ const setDom$3 = (state, dom) => {
5694
5702
  const {
5695
5703
  $Viewlet
5696
5704
  } = state;
@@ -5699,14 +5707,14 @@ const setDom$4 = (state, dom) => {
5699
5707
 
5700
5708
  const ViewletEditorImage = {
5701
5709
  __proto__: null,
5702
- attachEvents: attachEvents$5,
5703
- create: create$n,
5704
- setDom: setDom$4,
5710
+ attachEvents: attachEvents$3,
5711
+ create: create$k,
5712
+ setDom: setDom$3,
5705
5713
  setDragging,
5706
5714
  setTransform
5707
5715
  };
5708
5716
 
5709
- const create$m = () => {
5717
+ const create$j = () => {
5710
5718
  const $Viewlet = document.createElement('div');
5711
5719
  $Viewlet.className = 'Viewlet EditorText';
5712
5720
  $Viewlet.textContent = 'loading...';
@@ -5714,7 +5722,7 @@ const create$m = () => {
5714
5722
  $Viewlet
5715
5723
  };
5716
5724
  };
5717
- const dispose$c = state => {};
5725
+ const dispose$a = state => {};
5718
5726
  const refresh$3 = (state, context) => {
5719
5727
  object(state);
5720
5728
  string(context.content);
@@ -5723,20 +5731,20 @@ const refresh$3 = (state, context) => {
5723
5731
 
5724
5732
  const ViewletEditorPlainText = {
5725
5733
  __proto__: null,
5726
- create: create$m,
5727
- dispose: dispose$c,
5734
+ create: create$j,
5735
+ dispose: dispose$a,
5728
5736
  refresh: refresh$3
5729
5737
  };
5730
5738
 
5731
- const handleFocusIn$2 = event => {
5739
+ const handleFocusIn$1 = event => {
5732
5740
  preventDefault(event);
5733
5741
  const uid = fromEvent(event);
5734
- handleFocusIn$4(uid);
5742
+ handleFocusIn$3(uid);
5735
5743
  };
5736
5744
 
5737
5745
  const ViewletEditorSourceActionsEvents = {
5738
5746
  __proto__: null,
5739
- handleFocusIn: handleFocusIn$2
5747
+ handleFocusIn: handleFocusIn$1
5740
5748
  };
5741
5749
 
5742
5750
  const setBounds$4 = (state, x, y, width, height) => {
@@ -5752,7 +5760,7 @@ const appendWidget$2 = state => {
5752
5760
  } = state;
5753
5761
  append$1($Viewlet);
5754
5762
  };
5755
- const dispose$b = state => {
5763
+ const dispose$9 = state => {
5756
5764
  remove$1(state.$Viewlet);
5757
5765
  };
5758
5766
 
@@ -5760,7 +5768,7 @@ const ViewletEditorSourceActions = {
5760
5768
  __proto__: null,
5761
5769
  Events: ViewletEditorSourceActionsEvents,
5762
5770
  appendWidget: appendWidget$2,
5763
- dispose: dispose$b,
5771
+ dispose: dispose$9,
5764
5772
  setBounds: setBounds$4
5765
5773
  };
5766
5774
 
@@ -5994,7 +6002,7 @@ const handlePaste = event => {
5994
6002
  const text = getText(clipboardData);
5995
6003
  return ['paste', text];
5996
6004
  };
5997
- const handleScrollBarVerticalPointerDown = create$u(event => {
6005
+ const handleScrollBarVerticalPointerDown = create$r(event => {
5998
6006
  const {
5999
6007
  clientY
6000
6008
  } = event;
@@ -6049,7 +6057,7 @@ const handleScrollBarContextMenu = event => {
6049
6057
  preventDefault(event);
6050
6058
  stopPropagation(event);
6051
6059
  };
6052
- const handleContextMenu$3 = event => {
6060
+ const handleContextMenu$2 = event => {
6053
6061
  preventDefault(event);
6054
6062
  const {
6055
6063
  button,
@@ -6117,7 +6125,7 @@ const setLineInfos = (state, dom) => {
6117
6125
  // 1. create -> only create dom elements
6118
6126
  // 2. render -> fill elements with attributes and data
6119
6127
  // that way all dom nodes can be recycled
6120
- const create$l = () => {
6128
+ const create$i = () => {
6121
6129
  const $EditorInput = document.createElement('textarea');
6122
6130
  $EditorInput.className = 'EditorInput';
6123
6131
  $EditorInput.ariaAutoComplete = List;
@@ -6205,7 +6213,7 @@ const create$l = () => {
6205
6213
  $Editor.role = Code;
6206
6214
  $Editor.append($LayerGutter, $EditorContent);
6207
6215
  attachEventsFunctional($Editor, {
6208
- [ContextMenu]: handleContextMenu$3,
6216
+ [ContextMenu]: handleContextMenu$2,
6209
6217
  [Wheel]: handleWheel,
6210
6218
  returnValue: true
6211
6219
  });
@@ -6263,7 +6271,7 @@ const setSelections$1 = (state, cursorInfos, selectionInfos) => {
6263
6271
  setCursors(state, cursorInfos);
6264
6272
  setSelections$2(state, selectionInfos);
6265
6273
  };
6266
- const setFocused$2 = async (state, isFocused) => {
6274
+ const setFocused$1 = async (state, isFocused) => {
6267
6275
  const {
6268
6276
  $EditorInput
6269
6277
  } = state;
@@ -6284,7 +6292,7 @@ const setDecorationsDom$1 = (state, decorations) => {
6284
6292
  setDecorationsDom$2(state, decorations);
6285
6293
  };
6286
6294
 
6287
- const create$k = create$l;
6295
+ const create$h = create$i;
6288
6296
  const setText$1 = setText$2;
6289
6297
  const setSelections = setSelections$1;
6290
6298
  const setIncrementalEdits = setIncrementalEdits$1;
@@ -6320,20 +6328,20 @@ const hideOverlayMessage = state => {
6320
6328
  }
6321
6329
  }
6322
6330
  };
6323
- const setFocused$1 = setFocused$2;
6324
- const focus$c = setFocused$2;
6331
+ const setFocused = setFocused$1;
6332
+ const focus$a = setFocused$1;
6325
6333
  const setDecorationsDom = setDecorationsDom$1;
6326
6334
 
6327
6335
  const ViewletEditorText = {
6328
6336
  __proto__: null,
6329
- create: create$k,
6330
- focus: focus$c,
6337
+ create: create$h,
6338
+ focus: focus$a,
6331
6339
  handleError: handleError$4,
6332
6340
  hideOverlayMessage,
6333
6341
  highlightAsLink,
6334
6342
  renderGutter,
6335
6343
  setDecorationsDom,
6336
- setFocused: setFocused$1,
6344
+ setFocused,
6337
6345
  setIncrementalEdits,
6338
6346
  setScrollBar,
6339
6347
  setScrollBarHorizontal,
@@ -6342,7 +6350,7 @@ const ViewletEditorText = {
6342
6350
  showOverlayMessage
6343
6351
  };
6344
6352
 
6345
- const create$j = () => {
6353
+ const create$g = () => {
6346
6354
  const $Viewlet = document.createElement('div');
6347
6355
  $Viewlet.className = 'Viewlet EditorTextError';
6348
6356
  return {
@@ -6358,11 +6366,11 @@ const setMessage$3 = (state, message) => {
6358
6366
 
6359
6367
  const ViewletEditorTextError = {
6360
6368
  __proto__: null,
6361
- create: create$j,
6369
+ create: create$g,
6362
6370
  setMessage: setMessage$3
6363
6371
  };
6364
6372
 
6365
- const create$i = () => {
6373
+ const create$f = () => {
6366
6374
  const $Viewlet = document.createElement('div');
6367
6375
  $Viewlet.className = 'Viewlet EditorWidgetError EditorOverlayMessage';
6368
6376
  return {
@@ -6385,12 +6393,12 @@ const setBounds$3 = (state, x, y, width, height) => {
6385
6393
 
6386
6394
  const ViewletEditorWidgetError = {
6387
6395
  __proto__: null,
6388
- create: create$i,
6396
+ create: create$f,
6389
6397
  setBounds: setBounds$3,
6390
6398
  setMessage: setMessage$2
6391
6399
  };
6392
6400
 
6393
- const create$h = () => {
6401
+ const create$e = () => {
6394
6402
  const $Viewlet = document.createElement('div');
6395
6403
  $Viewlet.dataset.viewlet = 'Empty';
6396
6404
  $Viewlet.className = 'Viewlet';
@@ -6399,18 +6407,18 @@ const create$h = () => {
6399
6407
  };
6400
6408
  };
6401
6409
  const refresh$2 = (state, context) => {};
6402
- const focus$b = state => {};
6403
- const dispose$a = state => {};
6410
+ const focus$9 = state => {};
6411
+ const dispose$8 = state => {};
6404
6412
 
6405
6413
  const ViewletEmpty = {
6406
6414
  __proto__: null,
6407
- create: create$h,
6408
- dispose: dispose$a,
6409
- focus: focus$b,
6415
+ create: create$e,
6416
+ dispose: dispose$8,
6417
+ focus: focus$9,
6410
6418
  refresh: refresh$2
6411
6419
  };
6412
6420
 
6413
- const create$g = () => {
6421
+ const create$d = () => {
6414
6422
  const $Viewlet = document.createElement('div');
6415
6423
  $Viewlet.className = 'Viewlet EmptyEditor';
6416
6424
  return {
@@ -6420,10 +6428,10 @@ const create$g = () => {
6420
6428
 
6421
6429
  const ViewletEmptyEditor = {
6422
6430
  __proto__: null,
6423
- create: create$g
6431
+ create: create$d
6424
6432
  };
6425
6433
 
6426
- const create$f = () => {
6434
+ const create$c = () => {
6427
6435
  const $Viewlet = document.createElement('div');
6428
6436
  $Viewlet.className = 'Viewlet Error';
6429
6437
  return {
@@ -6439,7 +6447,7 @@ const setMessage$1 = (state, message) => {
6439
6447
 
6440
6448
  const ViewletError = {
6441
6449
  __proto__: null,
6442
- create: create$f,
6450
+ create: create$c,
6443
6451
  setMessage: setMessage$1
6444
6452
  };
6445
6453
 
@@ -6509,7 +6517,7 @@ const handleFocusClose = event => {
6509
6517
  const handleFocusReplaceAll = event => {
6510
6518
  return ['FindWidget.handleFocusReplaceAll'];
6511
6519
  };
6512
- const returnValue$2 = true;
6520
+ const returnValue$1 = true;
6513
6521
 
6514
6522
  const ViewletFindWidgetEvents = {
6515
6523
  __proto__: null,
@@ -6529,10 +6537,10 @@ const ViewletFindWidgetEvents = {
6529
6537
  handleReplaceFocus,
6530
6538
  handleReplaceInput,
6531
6539
  handleToggleReplaceFocus,
6532
- returnValue: returnValue$2
6540
+ returnValue: returnValue$1
6533
6541
  };
6534
6542
 
6535
- const create$e = () => {
6543
+ const create$b = () => {
6536
6544
  const $Viewlet = document.createElement('div');
6537
6545
  $Viewlet.className = 'Viewlet FindWidget';
6538
6546
  $Viewlet.role = Group;
@@ -6540,7 +6548,7 @@ const create$e = () => {
6540
6548
  $Viewlet
6541
6549
  };
6542
6550
  };
6543
- const focus$a = (state, key, source) => {
6551
+ const focus$8 = (state, key, source) => {
6544
6552
  if (!key) {
6545
6553
  return;
6546
6554
  }
@@ -6574,7 +6582,7 @@ const appendWidget$1 = state => {
6574
6582
  } = state;
6575
6583
  append$1($Viewlet);
6576
6584
  };
6577
- const setDom$3 = (state, dom) => {
6585
+ const setDom$2 = (state, dom) => {
6578
6586
  const {
6579
6587
  $Viewlet
6580
6588
  } = state;
@@ -6586,20 +6594,20 @@ const setBounds$2 = (state, x, y, width, height) => {
6586
6594
  } = state;
6587
6595
  setBounds$a($Viewlet, x, y, width, height);
6588
6596
  };
6589
- const dispose$9 = state => {
6597
+ const dispose$7 = state => {
6590
6598
  remove$1(state.$Viewlet);
6591
6599
  };
6592
- const Events$3 = ViewletFindWidgetEvents;
6600
+ const Events$2 = ViewletFindWidgetEvents;
6593
6601
 
6594
6602
  const ViewletFindWidget = {
6595
6603
  __proto__: null,
6596
- Events: Events$3,
6604
+ Events: Events$2,
6597
6605
  appendWidget: appendWidget$1,
6598
- create: create$e,
6599
- dispose: dispose$9,
6600
- focus: focus$a,
6606
+ create: create$b,
6607
+ dispose: dispose$7,
6608
+ focus: focus$8,
6601
6609
  setBounds: setBounds$2,
6602
- setDom: setDom$3,
6610
+ setDom: setDom$2,
6603
6611
  setValue: setValue$1
6604
6612
  };
6605
6613
 
@@ -6621,7 +6629,7 @@ const ViewletLocationsEvents = {
6621
6629
  handleLocationsMouseDown
6622
6630
  };
6623
6631
 
6624
- const setFocusedIndex$1 = (state, oldFocusedIndex, newFocusedIndex) => {
6632
+ const setFocusedIndex = (state, oldFocusedIndex, newFocusedIndex) => {
6625
6633
  const {
6626
6634
  $Viewlet
6627
6635
  } = state;
@@ -6644,7 +6652,7 @@ const handleError$3 = (state, message) => {
6644
6652
  } = state;
6645
6653
  $Message.textContent = message;
6646
6654
  };
6647
- const focus$9 = state => {
6655
+ const focus$7 = state => {
6648
6656
  const {
6649
6657
  $Locations
6650
6658
  } = state;
@@ -6656,9 +6664,9 @@ const focus$9 = state => {
6656
6664
  const ViewletImplementations = {
6657
6665
  __proto__: null,
6658
6666
  Events: ViewletLocationsEvents,
6659
- focus: focus$9,
6667
+ focus: focus$7,
6660
6668
  handleError: handleError$3,
6661
- setFocusedIndex: setFocusedIndex$1
6669
+ setFocusedIndex
6662
6670
  };
6663
6671
 
6664
6672
  const handleScrollBarPointerDown = event => {
@@ -6749,11 +6757,11 @@ const setColumnWidths = (state, columnWidth1, columnWidth2, columnWidth3) => {
6749
6757
  $Resizer1.style.left = `${paddingLeft + columnWidth1}px`;
6750
6758
  $Resizer2.style.left = `${paddingLeft + columnWidth1 + columnWidth2}px`;
6751
6759
  };
6752
- const Events$2 = ViewletkeyBindingsEvents;
6760
+ const Events$1 = ViewletkeyBindingsEvents;
6753
6761
 
6754
6762
  const ViewletKeyBindings = {
6755
6763
  __proto__: null,
6756
- Events: Events$2,
6764
+ Events: Events$1,
6757
6765
  setColumnWidths,
6758
6766
  setScrollBar: setScrollBar$2,
6759
6767
  setSize,
@@ -7258,7 +7266,7 @@ const handleBlur$3 = () => {
7258
7266
  const handleKeyDown$1 = handleKeyDown$2;
7259
7267
  const handleKeyUp = handleKeyUp$1;
7260
7268
 
7261
- const create$d = () => {
7269
+ const create$a = () => {
7262
7270
  // TODO use aria role splitter once supported https://github.com/w3c/aria/issues/1348
7263
7271
  const $SashSideBar = document.createElement('div');
7264
7272
  $SashSideBar.className = 'Viewlet Sash SashVertical';
@@ -7279,20 +7287,20 @@ const create$d = () => {
7279
7287
  $Viewlet
7280
7288
  };
7281
7289
  };
7282
- const attachEvents$4 = state => {
7290
+ const attachEvents$2 = state => {
7283
7291
  const {
7284
7292
  $SashPanel,
7285
7293
  $SashSideBar
7286
7294
  } = state;
7287
- attachEvents$8($SashSideBar, {
7295
+ attachEvents$6($SashSideBar, {
7288
7296
  [DoubleClick]: handleSashDoubleClick,
7289
7297
  [PointerDown]: handleSashPointerDown
7290
7298
  });
7291
- attachEvents$8($SashPanel, {
7299
+ attachEvents$6($SashPanel, {
7292
7300
  [DoubleClick]: handleSashDoubleClick,
7293
7301
  [PointerDown]: handleSashPointerDown
7294
7302
  });
7295
- attachEvents$8(window, {
7303
+ attachEvents$6(window, {
7296
7304
  [Blur]: handleBlur$3,
7297
7305
  [Focus]: handleFocus$2,
7298
7306
  [KeyDown]: handleKeyDown$1,
@@ -7313,404 +7321,74 @@ const setSashes = (state, sashSideBar, sashPanel) => {
7313
7321
 
7314
7322
  const ViewletLayout = {
7315
7323
  __proto__: null,
7316
- attachEvents: attachEvents$4,
7317
- create: create$d,
7324
+ attachEvents: attachEvents$2,
7325
+ create: create$a,
7318
7326
  setSashes
7319
7327
  };
7320
7328
 
7321
- const CopyMove = 'copyMove';
7322
-
7323
- 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';
7324
7374
 
7325
- const setEffectAllowed = (dataTransfer, effectAllowed) => {
7326
- object(dataTransfer);
7327
- string(effectAllowed);
7328
- dataTransfer.effectAllowed = effectAllowed;
7329
- };
7330
- const getFilePaths = dataTransfer => {
7331
- const data = dataTransfer.getData(ResourceUrls);
7332
- if (data) {
7333
- const parsed = JSON.parse(data);
7334
- if (Array.isArray(parsed) && data.length > 0) {
7335
- return parsed;
7336
- }
7337
- }
7338
- return [];
7339
- };
7340
- const getFilePath = dataTransfer => {
7341
- const filePaths = getFilePaths(dataTransfer);
7342
- if (filePaths.length === 0) {
7343
- return '';
7344
- }
7345
- return filePaths[0];
7346
- };
7347
-
7348
- const handleDragOver$1 = event => {
7349
- preventDefault(event);
7350
- const {
7351
- clientX,
7352
- clientY
7353
- } = event;
7354
- const uid = fromEvent(event);
7355
- handleDragOver$2(uid, clientX, clientY);
7356
- };
7357
- const handleDragEnd = event => {
7358
- const {
7359
- clientX,
7360
- clientY
7361
- } = event;
7362
- const uid = fromEvent(event);
7363
- handleDragEnd$1(uid, clientX, clientY);
7364
- };
7365
- const handleDragLeave = event => {
7366
- const {
7367
- clientX,
7368
- clientY
7369
- } = event;
7370
- const uid = fromEvent(event);
7371
- handleDragLeave$1(uid, clientX, clientY);
7372
- };
7373
-
7374
- /**
7375
- *
7376
- * @param {DragEvent} event
7377
- */
7378
- const handleDrop$1 = event => {
7379
- preventDefault(event);
7380
- const {
7381
- clientX,
7382
- clientY,
7383
- dataTransfer
7384
- } = event;
7385
- const {
7386
- files
7387
- } = dataTransfer;
7388
- const uid = fromEvent(event);
7389
- if (files.length > 0) {
7390
- return handleDropFiles(uid, clientX, clientY, files);
7391
- }
7392
- const filePath = getFilePath(dataTransfer);
7393
- if (filePath) {
7394
- handleDropFilePath(uid, clientX, clientY, filePath);
7395
- }
7396
- };
7397
-
7398
- const handleContextMenu$2 = event => {
7399
- if (event.defaultPrevented) {
7400
- return;
7401
- }
7402
- preventDefault(event);
7403
- const {
7404
- clientX,
7405
- clientY
7406
- } = event;
7407
- const uid = fromEvent(event);
7408
- handleContextMenu$7(uid, clientX, clientY);
7409
- };
7410
-
7411
- // TODO Main should not be bound to Editor -> Lazy load Editor
7412
- const create$c = () => {
7413
- const $Viewlet = document.createElement('div');
7414
- $Viewlet.id = 'Main';
7415
- $Viewlet.className = 'Viewlet Main';
7416
- $Viewlet.role = Main$1;
7417
-
7418
- // const $MainTabs = document.createElement('div')
7419
- // $MainTabs.className = 'MainTabs'
7420
- // $MainTabs.onmousedown = handleTabsMouseDown
7421
- // $MainTabs.oncontextmenu = handleTabsContextMenu
7422
- // // TODO race condition: what if tab has already been closed?
7423
- // $Main.append($MainTabs, $MainContent)
7424
-
7425
- return {
7426
- $DragOverlay: undefined,
7427
- $Main: $Viewlet,
7428
- $MainContent: undefined,
7429
- $MainTabs: undefined,
7430
- $Viewlet
7431
- };
7432
- };
7433
- const attachEvents$3 = state => {
7434
- const {
7435
- $Viewlet
7436
- } = state;
7437
- attachEvents$8($Viewlet, {
7438
- [ContextMenu]: handleContextMenu$2,
7439
- [DragEnd]: handleDragEnd,
7440
- [DragLeave]: handleDragLeave,
7441
- [DragOver]: handleDragOver$1,
7442
- [Drop]: handleDrop$1
7443
- });
7444
- };
7445
- const dispose$8 = state => {};
7446
- const replaceEditor = (state, id, uri, languageId) => {};
7447
- const addEditor = (state, id, uri, languageId) => {};
7448
-
7449
- // TODO there are 3 cases
7450
- // 1. no editor group and no editor
7451
- // 2. editor group exists and new editor should be added
7452
- // 3. editor group exists and editor should be replaced
7453
- const openEditor = async (state, id, uri, languageId) => {};
7454
- const closeAllViewlets = state => {
7455
- const {
7456
- $Main
7457
- } = state;
7458
- while ($Main.firstChild) {
7459
- $Main.firstChild.remove();
7460
- }
7461
- state.$MainTabs = undefined;
7462
- };
7463
- const closeViewletAndTab = (state, index) => {
7464
- state.$MainTabs.remove();
7465
- state.$MainTabs = undefined;
7466
- };
7467
- const focus$8 = () => {};
7468
- const highlightDragOver = state => {
7469
- const {
7470
- $MainTabs
7471
- } = state;
7472
- $MainTabs.classList.add('DragOver');
7473
- };
7474
- const stopHighlightDragOver = state => {
7475
- const {
7476
- $MainTabs
7477
- } = state;
7478
- $MainTabs.classList.remove('DragOver');
7479
- };
7480
- const create$DragOverlay = () => {
7481
- const $Overlay = document.createElement('div');
7482
- $Overlay.className = 'DragOverlay';
7483
- return $Overlay;
7484
- };
7485
- const setDragOverlay = (state, visible, x, y, width, height) => {
7486
- const hasOverlay = state.$DragOverlay;
7487
- if (!visible) {
7488
- if (hasOverlay) {
7489
- state.$DragOverlay.remove();
7490
- state.$DragOverlay = undefined;
7491
- }
7492
- return;
7493
- }
7494
- if (!hasOverlay) {
7495
- state.$DragOverlay = create$DragOverlay();
7496
- }
7497
- const {
7498
- $DragOverlay
7499
- } = state;
7500
- setBounds$a($DragOverlay, x, y, width, height);
7501
- if (!hasOverlay) {
7502
- document.body.append($DragOverlay);
7503
- }
7504
- };
7505
-
7506
- const ViewletMain = {
7507
- __proto__: null,
7508
- addEditor,
7509
- attachEvents: attachEvents$3,
7510
- closeAllViewlets,
7511
- closeViewletAndTab,
7512
- create: create$c,
7513
- dispose: dispose$8,
7514
- focus: focus$8,
7515
- highlightDragOver,
7516
- openEditor,
7517
- replaceEditor,
7518
- setDragOverlay,
7519
- stopHighlightDragOver
7520
- };
7521
-
7522
- // TODO
7523
- const getUid = () => {
7524
- const $Main = document.getElementById('Main');
7525
- if (!$Main) {
7526
- return 0;
7527
- }
7528
- return get($Main);
7529
- };
7530
- const handleTabsWheel = event => {
7531
- const uid = getUid();
7532
- const {
7533
- deltaX,
7534
- deltaY
7535
- } = event;
7536
- handleTabsWheel$1(uid, deltaX, deltaY);
7537
- };
7538
- const handleDragStart = event => {
7539
- const {
7540
- dataTransfer,
7541
- target
7542
- } = event;
7543
- setEffectAllowed(dataTransfer, CopyMove);
7544
- dataTransfer.setData('x-lvce-drag', target.dataset.dragUid);
7545
- };
7546
- const handleDragOver = event => {
7547
- const {
7548
- clientX,
7549
- clientY
7550
- } = event;
7551
- const uid = getUid();
7552
- handleTabsDragOver(uid, clientX, clientY);
7553
- };
7554
-
7555
- /**
7556
- *
7557
- * @param {DragEvent} event
7558
- */
7559
- const handleDrop = event => {
7560
- preventDefault(event);
7561
- const {
7562
- clientX,
7563
- clientY,
7564
- dataTransfer
7565
- } = event;
7566
- const item = dataTransfer.getData('x-lvce-drag');
7567
- const uid = getUid();
7568
- handleTabDrop(uid, item, clientX, clientY);
7569
- };
7570
- const handleTabsMouseDown = event => {
7571
- const {
7572
- button,
7573
- clientX,
7574
- clientY
7575
- } = event;
7576
- const uid = getUid();
7577
- handleTabClick(uid, button, clientX, clientY);
7578
- };
7579
- const handleTabsContextMenu = event => {
7580
- const {
7581
- clientX,
7582
- clientY
7583
- } = event;
7584
- preventDefault(event);
7585
- const uid = getUid();
7586
- handleTabContextMenu(uid, clientX, clientY);
7587
- };
7588
-
7589
- const create$b = () => {
7590
- const $MainTabs = document.createElement('div');
7591
- $MainTabs.className = 'Viewlet MainTabs';
7592
- $MainTabs.role = TabList;
7593
- // TODO race condition: what if tab has already been closed?
7594
- return {
7595
- $MainTabs,
7596
- $Viewlet: $MainTabs
7597
- };
7598
- };
7599
- const attachEvents$2 = state => {
7600
- const {
7601
- $MainTabs
7602
- } = state;
7603
- attachEvents$8($MainTabs, {
7604
- [ContextMenu]: handleTabsContextMenu,
7605
- [DragOver]: handleDragOver,
7606
- [DragStart]: handleDragStart,
7607
- [Drop]: handleDrop,
7608
- [MouseDown]: handleTabsMouseDown
7609
- });
7610
- $MainTabs.addEventListener(Wheel, handleTabsWheel, Passive);
7611
- };
7612
- const setTabsDom$2 = (state, dom) => {
7613
- const {
7614
- $Viewlet
7615
- } = state;
7616
- renderInto($Viewlet, dom);
7617
- };
7618
- const setScrollLeft = (state, scrollLeft) => {
7619
- const {
7620
- $Viewlet
7621
- } = state;
7622
- $Viewlet.scrollLeft = scrollLeft;
7623
- };
7624
- const setHighlight = (state, highlightLeft) => {
7625
- const $ExistingHighlight = state.$Viewlet.querySelector('.TabDragHighlight');
7626
- if ($ExistingHighlight) {
7627
- $ExistingHighlight.remove();
7628
- }
7629
- const $Highlight = document.createElement('div');
7630
- $Highlight.className = 'TabDragHighlight';
7631
- $Highlight.style.left = `${highlightLeft}px`;
7632
- state.$Viewlet.append($Highlight);
7633
- };
7634
-
7635
- const ViewletMainTabs = {
7636
- __proto__: null,
7637
- attachEvents: attachEvents$2,
7638
- create: create$b,
7639
- setHighlight,
7640
- setScrollLeft,
7641
- setTabsDom: setTabsDom$2
7642
- };
7643
-
7644
- const ActivityBar = 'ActivityBar';
7645
- const Audio$1 = 'Audio';
7646
- const Clock = 'Clock';
7647
- const ColorPicker = 'ColorPicker';
7648
- const DebugConsole = 'Debug Console';
7649
- const DefineKeyBinding = 'DefineKeyBinding';
7650
- const Dialog = 'Dialog';
7651
- const DiffEditor = 'DiffEditor';
7652
- const EditorCompletion = 'EditorCompletion';
7653
- const EmptyEditor = 'EmptyEditor';
7654
- const EditorError = 'EditorError';
7655
- const EditorHover = 'EditorHover';
7656
- const EditorImage = 'EditorImage';
7657
- const EditorPlainText = 'EditorPlainText';
7658
- const EditorText = 'Editor';
7659
- const EditorWidgetError = 'EditorWidgetError';
7660
- const Empty = 'Empty';
7661
- const Error$1 = 'Error';
7662
- const FindWidget = 'FindWidget';
7663
- const ImagePreview = 'ImagePreview';
7664
- const InlineDiffEditor = 'InlineDiffEditor';
7665
- const Implementations = 'Implementations';
7666
- const KeyBindings = 'KeyBindings';
7667
- const Layout = 'Layout';
7668
- const Main = 'Main';
7669
- const MainTabs = 'MainTabs';
7670
- const Output = 'Output';
7671
- const Panel = 'Panel';
7672
- const References = 'References';
7673
- const RunAndDebug = 'Run And Debug';
7674
- const ScreenCapture = 'ScreenCapture';
7675
- const SideBar = 'SideBar';
7676
- const SimpleBrowser = 'SimpleBrowser';
7677
- const SourceControl = 'Source Control';
7678
- const StatusBar = 'StatusBar';
7679
- const Storage = 'Storage';
7680
- const Terminal = 'Terminal';
7681
- const Terminals = 'Terminals';
7682
- const TitleBar = 'TitleBar';
7683
- const TitleBarButtons = 'TitleBarButtons';
7684
- const TitleBarIcon = 'TitleBarIcon';
7685
- const TitleBarMenuBar = 'TitleBarMenuBar';
7686
- const Video = 'Video';
7687
- const TitleBarTitle = 'TitleBarTitle';
7688
- const EditorSourceActions = 'EditorSourceActions';
7689
- const E2eTests = 'E2eTests';
7690
- const E2eTest = 'E2eTest';
7691
- const WebView = 'WebView';
7692
- const EditorCompletionDetails = 'EditorCompletionDetails';
7693
- const EditorTextError = 'EditorTextError';
7694
- const EditorRename = 'EditorRename';
7695
- const EditorCodeGenerator = 'EditorCodeGenerator';
7696
-
7697
- const create$a = () => {
7698
- const $ViewletOutputContent = document.createElement('div');
7699
- $ViewletOutputContent.className = 'OutputContent';
7700
- $ViewletOutputContent.role = Log;
7701
- $ViewletOutputContent.tabIndex = 0;
7702
- const $ViewletOutputWidgets = document.createElement('div');
7703
- $ViewletOutputWidgets.className = 'OutputWidgets';
7704
- const $Viewlet = document.createElement('div');
7705
- $Viewlet.className = 'Viewlet Output';
7706
- $Viewlet.tabIndex = 0;
7707
- $Viewlet.append($ViewletOutputContent, $ViewletOutputWidgets);
7708
- return {
7709
- $Content: $ViewletOutputContent,
7710
- $Viewlet,
7711
- $ViewletOutputContent,
7712
- content: $ViewletOutputContent
7713
- };
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
+ };
7714
7392
  };
7715
7393
  const setText = (state, text) => {
7716
7394
  object(state);
@@ -7726,9 +7404,9 @@ const handleError$2 = (state, error) => {
7726
7404
  string(error);
7727
7405
  state.content.textContent = error;
7728
7406
  };
7729
- const focus$7 = state => {
7407
+ const focus$6 = state => {
7730
7408
  object(state);
7731
- focus$f(state.$ViewletOutputContent);
7409
+ focus$d(state.$ViewletOutputContent);
7732
7410
  send('Focus.setFocus', FocusOutput);
7733
7411
  };
7734
7412
 
@@ -7741,15 +7419,15 @@ const disposeFindWidget = state => {
7741
7419
  return;
7742
7420
  }
7743
7421
  };
7744
- const dispose$7 = state => {};
7422
+ const dispose$6 = state => {};
7745
7423
 
7746
7424
  const ViewletOutput = {
7747
7425
  __proto__: null,
7748
7426
  clear: clear$1,
7749
- create: create$a,
7750
- dispose: dispose$7,
7427
+ create: create$9,
7428
+ dispose: dispose$6,
7751
7429
  disposeFindWidget,
7752
- focus: focus$7,
7430
+ focus: focus$6,
7753
7431
  handleError: handleError$2,
7754
7432
  openFindWidget,
7755
7433
  setText
@@ -7800,7 +7478,7 @@ const UiStrings = {
7800
7478
  Close: 'Close',
7801
7479
  Maximize: 'Maximize'
7802
7480
  };
7803
- const create$9 = () => {
7481
+ const create$8 = () => {
7804
7482
  const $PanelTabs = document.createElement('div');
7805
7483
  $PanelTabs.className = 'PanelTabs';
7806
7484
  $PanelTabs.role = TabList;
@@ -7844,13 +7522,13 @@ const attachEvents$1 = state => {
7844
7522
  $ButtonMaximize,
7845
7523
  $PanelHeader
7846
7524
  } = state;
7847
- attachEvents$8($PanelHeader, {
7525
+ attachEvents$6($PanelHeader, {
7848
7526
  [Click]: handleHeaderClick$1
7849
7527
  });
7850
- attachEvents$8($ButtonMaximize, {
7528
+ attachEvents$6($ButtonMaximize, {
7851
7529
  [Click]: handleClickMaximize
7852
7530
  });
7853
- attachEvents$8($ButtonClose, {
7531
+ attachEvents$6($ButtonClose, {
7854
7532
  [Click]: handleClickClose
7855
7533
  });
7856
7534
  };
@@ -7862,14 +7540,14 @@ const setTabsDom$1 = (state, dom) => {
7862
7540
  };
7863
7541
 
7864
7542
  // TODO add test for focus method
7865
- const focus$6 = state => {
7543
+ const focus$5 = state => {
7866
7544
  object(state);
7867
7545
  if (!state.currentViewlet) {
7868
7546
  return;
7869
7547
  }
7870
7548
  state.currentViewlet.factory.focus(state.currentViewlet.state);
7871
7549
  };
7872
- const dispose$6 = state => {
7550
+ const dispose$5 = state => {
7873
7551
  if (state.$PanelContent) {
7874
7552
  state.$PanelContent.remove();
7875
7553
  state.$PanelContent = undefined;
@@ -7914,9 +7592,9 @@ const setActionsDom$1 = (state, actions, childUid) => {
7914
7592
  const ViewletPanel = {
7915
7593
  __proto__: null,
7916
7594
  attachEvents: attachEvents$1,
7917
- create: create$9,
7918
- dispose: dispose$6,
7919
- focus: focus$6,
7595
+ create: create$8,
7596
+ dispose: dispose$5,
7597
+ focus: focus$5,
7920
7598
  setActionsDom: setActionsDom$1,
7921
7599
  setSelectedIndex,
7922
7600
  setTabsDom: setTabsDom$1
@@ -7925,9 +7603,9 @@ const ViewletPanel = {
7925
7603
  const ViewletReferences = {
7926
7604
  __proto__: null,
7927
7605
  Events: ViewletLocationsEvents,
7928
- focus: focus$9,
7606
+ focus: focus$7,
7929
7607
  handleError: handleError$3,
7930
- setFocusedIndex: setFocusedIndex$1
7608
+ setFocusedIndex
7931
7609
  };
7932
7610
 
7933
7611
  const ViewletRunAndDebug = {
@@ -7942,7 +7620,7 @@ const handleLoadedMetaData = event => {
7942
7620
  target.play();
7943
7621
  };
7944
7622
 
7945
- const create$8 = () => {
7623
+ const create$7 = () => {
7946
7624
  const $Viewlet = document.createElement('div');
7947
7625
  $Viewlet.className = 'Viewlet ScreenCapture';
7948
7626
  return {
@@ -7962,7 +7640,7 @@ const setScreenCapture = (state, id) => {
7962
7640
 
7963
7641
  const ViewletScreenCapture = {
7964
7642
  __proto__: null,
7965
- create: create$8,
7643
+ create: create$7,
7966
7644
  setScreenCapture
7967
7645
  };
7968
7646
 
@@ -7982,7 +7660,7 @@ const handleHeaderClick = event => {
7982
7660
  }
7983
7661
  };
7984
7662
 
7985
- const create$7 = () => {
7663
+ const create$6 = () => {
7986
7664
  const $SideBarTitleAreaTitle = document.createElement('h2');
7987
7665
  $SideBarTitleAreaTitle.className = 'SideBarTitleAreaTitle';
7988
7666
  const $SideBarTitleArea = document.createElement('div');
@@ -8007,11 +7685,11 @@ const attachEvents = state => {
8007
7685
  const {
8008
7686
  $SideBarTitleArea
8009
7687
  } = state;
8010
- attachEvents$8($SideBarTitleArea, {
7688
+ attachEvents$6($SideBarTitleArea, {
8011
7689
  [Click]: handleHeaderClick
8012
7690
  });
8013
7691
  };
8014
- const dispose$5 = state => {
7692
+ const dispose$4 = state => {
8015
7693
  object(state);
8016
7694
  state.$SideBar.replaceChildren();
8017
7695
  };
@@ -8039,16 +7717,16 @@ const setActionsDom = (state, actions, parentId, eventMap = {}) => {
8039
7717
  }
8040
7718
  state.$Actions = $NewViewlet;
8041
7719
  };
8042
- const focus$5 = async () => {
7720
+ const focus$4 = async () => {
8043
7721
  // await
8044
7722
  };
8045
7723
 
8046
7724
  const ViewletSideBar = {
8047
7725
  __proto__: null,
8048
7726
  attachEvents,
8049
- create: create$7,
8050
- dispose: dispose$5,
8051
- focus: focus$5,
7727
+ create: create$6,
7728
+ dispose: dispose$4,
7729
+ focus: focus$4,
8052
7730
  setActionsDom,
8053
7731
  setTitle
8054
7732
  };
@@ -8142,7 +7820,7 @@ const handleContextMenu$1 = event => {
8142
7820
  clientY
8143
7821
  } = event;
8144
7822
  const uid = fromEvent(event);
8145
- handleContextMenu$7(uid, button, clientX, clientY);
7823
+ handleContextMenu$6(uid, button, clientX, clientY);
8146
7824
  };
8147
7825
 
8148
7826
  const handleFocus = event => {
@@ -8160,7 +7838,7 @@ const getButtonIndex = $Node => {
8160
7838
  }
8161
7839
  return index;
8162
7840
  };
8163
- const handleClick$3 = event => {
7841
+ const handleClick$2 = event => {
8164
7842
  const {
8165
7843
  target
8166
7844
  } = event;
@@ -8178,7 +7856,7 @@ const handleClick$3 = event => {
8178
7856
  if (index === -1) {
8179
7857
  return;
8180
7858
  }
8181
- handleClick$6(uid, index);
7859
+ handleClick$5(uid, index);
8182
7860
  };
8183
7861
  const handleMouseOver = event => {
8184
7862
  const {
@@ -8222,7 +7900,7 @@ const handleInput$1 = event => {
8222
7900
 
8223
7901
  const ViewletSourceControlEvents = {
8224
7902
  __proto__: null,
8225
- handleClick: handleClick$3,
7903
+ handleClick: handleClick$2,
8226
7904
  handleContextMenu: handleContextMenu$1,
8227
7905
  handleFocus,
8228
7906
  handleInput: handleInput$1,
@@ -8231,7 +7909,7 @@ const ViewletSourceControlEvents = {
8231
7909
  handleWheel: handleWheel$3
8232
7910
  };
8233
7911
 
8234
- const focus$4 = state => {
7912
+ const focus$3 = state => {
8235
7913
  const {
8236
7914
  $Viewlet
8237
7915
  } = state;
@@ -8241,24 +7919,24 @@ const focus$4 = state => {
8241
7919
  const ViewletSourceControl = {
8242
7920
  __proto__: null,
8243
7921
  Events: ViewletSourceControlEvents,
8244
- focus: focus$4
7922
+ focus: focus$3
8245
7923
  };
8246
7924
 
8247
- const handleClick$2 = event => {
7925
+ const handleClick$1 = event => {
8248
7926
  const uid = fromEvent(event);
8249
7927
  const {
8250
7928
  clientX,
8251
7929
  clientY
8252
7930
  } = event;
8253
- handleClick$6(uid, clientX, clientY);
7931
+ handleClick$5(uid, clientX, clientY);
8254
7932
  };
8255
7933
 
8256
7934
  const ViewletStatusBarEvents = {
8257
7935
  __proto__: null,
8258
- handleClick: handleClick$2
7936
+ handleClick: handleClick$1
8259
7937
  };
8260
7938
 
8261
- const create$6 = () => {
7939
+ const create$5 = () => {
8262
7940
  const $Viewlet = document.createElement('div');
8263
7941
  $Viewlet.id = 'StatusBar';
8264
7942
  $Viewlet.className = 'Viewlet StatusBar';
@@ -8266,18 +7944,18 @@ const create$6 = () => {
8266
7944
  $Viewlet.role = Status;
8267
7945
  $Viewlet.ariaRoleDescription = StatusBar$1;
8268
7946
  $Viewlet.ariaLive = 'off'; // see https://github.com/microsoft/vscode/issues/94677
8269
- $Viewlet.addEventListener('click', handleClick$2);
7947
+ $Viewlet.addEventListener('click', handleClick$1);
8270
7948
  return {
8271
7949
  $Viewlet
8272
7950
  };
8273
7951
  };
8274
- const setDom$2 = (state, dom) => {
7952
+ const setDom$1 = (state, dom) => {
8275
7953
  const {
8276
7954
  $Viewlet
8277
7955
  } = state;
8278
7956
  renderInto($Viewlet, dom, ViewletStatusBarEvents);
8279
7957
  };
8280
- const focus$3 = state => {
7958
+ const focus$2 = state => {
8281
7959
  object(state);
8282
7960
  const {
8283
7961
  $Viewlet
@@ -8287,26 +7965,26 @@ const focus$3 = state => {
8287
7965
 
8288
7966
  const ViewletStatusBar = {
8289
7967
  __proto__: null,
8290
- create: create$6,
8291
- focus: focus$3,
8292
- setDom: setDom$2
7968
+ create: create$5,
7969
+ focus: focus$2,
7970
+ setDom: setDom$1
8293
7971
  };
8294
7972
 
8295
- const handleClick$1 = event => {
7973
+ const handleClick = event => {
8296
7974
  const uid = fromEvent(event);
8297
- handleClick$6(uid);
7975
+ handleClick$5(uid);
8298
7976
  };
8299
7977
 
8300
7978
  const ViewletStorageEvents = {
8301
7979
  __proto__: null,
8302
- handleClick: handleClick$1
7980
+ handleClick
8303
7981
  };
8304
7982
 
8305
- const Events$1 = ViewletStorageEvents;
7983
+ const Events = ViewletStorageEvents;
8306
7984
 
8307
7985
  const ViewletStorage = {
8308
7986
  __proto__: null,
8309
- Events: Events$1
7987
+ Events
8310
7988
  };
8311
7989
 
8312
7990
  const handleClickTab = event => {
@@ -8318,7 +7996,7 @@ const handleClickTab = event => {
8318
7996
  handleClickTab$2(uid, index);
8319
7997
  };
8320
7998
 
8321
- const create$5 = () => {
7999
+ const create$4 = () => {
8322
8000
  const $Viewlet = document.createElement('div');
8323
8001
  $Viewlet.className = 'Viewlet Terminals';
8324
8002
  return {
@@ -8344,420 +8022,9 @@ const setTabsDom = (state, dom) => {
8344
8022
  };
8345
8023
 
8346
8024
  const ViewletTerminals = {
8347
- __proto__: null,
8348
- create: create$5,
8349
- setTabsDom
8350
- };
8351
-
8352
- const isInsideTitleBarMenu = $Element => {
8353
- return $Element.classList.contains('MenuItem') || $Element.classList.contains('Menu') || $Element.classList.contains('TitleBarTopLevelEntry') || $Element.classList.contains('TitleBarMenuBar');
8354
- };
8355
- const handleFocusOut = event => {
8356
- const {
8357
- relatedTarget,
8358
- target
8359
- } = event;
8360
- if (relatedTarget && isInsideTitleBarMenu(relatedTarget)) {
8361
- return;
8362
- }
8363
- if (target && isInsideTitleBarMenu(target)) {
8364
- return;
8365
- }
8366
- const uid = fromEvent(event);
8367
- closeMenu$1(uid);
8368
- };
8369
- const handlePointerOver = event => {
8370
- const {
8371
- target
8372
- } = event;
8373
- const index = getIndex(target);
8374
- const uid = fromEvent(event);
8375
- handleMouseOver$1(uid, index);
8376
- };
8377
- const handlePointerOut = event => {
8378
- const {
8379
- target
8380
- } = event;
8381
- const index = getIndex(target);
8382
- const uid = fromEvent(event);
8383
- handleMouseOut$1(uid, index);
8384
- };
8385
- const getIndex = $Target => {
8386
- if ($Target.classList.contains('TitleBarTopLevelEntry')) {
8387
- return getNodeIndex($Target);
8388
- }
8389
- return -1;
8390
- };
8391
- const handleClick = event => {
8392
- const {
8393
- button,
8394
- target
8395
- } = event;
8396
- const index = getIndex(target);
8397
- const uid = fromEvent(event);
8398
- handleClick$6(uid, button, index);
8399
- };
8400
- const getLevelAndIndex = event => {
8401
- const {
8402
- target
8403
- } = event;
8404
- const $Menu = target.closest('.Menu');
8405
- const index = findIndex($Menu, target);
8406
- const {
8407
- id
8408
- } = $Menu;
8409
- const level = Number.parseInt(id.slice(5));
8410
- return {
8411
- index,
8412
- level
8413
- };
8414
- };
8415
- const handleMenuMouseOver = event => {
8416
- // TODO just send pixel coordinates instead
8417
- const {
8418
- index,
8419
- level
8420
- } = getLevelAndIndex(event);
8421
- const uid = fromEvent(event);
8422
- handleMenuMouseOver$1(uid, level, index);
8423
- };
8424
- const handleMenuClick = event => {
8425
- const {
8426
- index,
8427
- level
8428
- } = getLevelAndIndex(event);
8429
- const uid = fromEvent(event);
8430
- handleMenuClick$1(uid, level, index);
8431
- };
8432
- const handleFocusIn$1 = event => {
8433
- const uid = fromEvent(event);
8434
- handleFocus$8(uid);
8435
- };
8436
-
8437
- const ViewletTitleBarMenuBarEvents = {
8438
- __proto__: null,
8439
- handleClick,
8440
- handleFocusIn: handleFocusIn$1,
8441
- handleFocusOut,
8442
- handleMenuClick,
8443
- handleMenuMouseOver,
8444
- handlePointerOut,
8445
- handlePointerOver
8446
- };
8447
-
8448
- const activeId = 'TitleBarEntryActive';
8449
- const dispose$4 = state => {};
8450
- const focus$2 = state => {
8451
- const {
8452
- $TitleBarMenuBar
8453
- } = state;
8454
- $TitleBarMenuBar.firstChild.focus();
8455
- };
8456
-
8457
- // TODO set proper tabIndex 0 to focused item https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html
8458
-
8459
- // TODO screenreader doesn't read top level label
8460
- // when menu is open,
8461
- // first item is selected,
8462
- // right is clicked it just reads
8463
- // "Expanded" instead of "Selection Expanded"
8464
-
8465
- // TODO sometimes screenreader reads too much (e.g. "File, expanded, opens menu, expanded")
8466
-
8467
- // TODO don't focus on separators
8468
-
8469
- // TODO don't focus on hover
8470
- // only focus on hover when it has already focus or the menu has focus
8471
-
8472
- // TODO title bar menu bar is very inefficient:
8473
-
8474
- // before: 5 times recalculate style
8475
- // 1.37ms Recalculate style
8476
- // 83us Update Layer tree
8477
- // 0.34ms paint
8478
- // 0.79ms composite layer
8479
- // 0.23ms Hit test
8480
- // 1.42ms Recalculate style
8481
- // 1.44ms Recalculate style
8482
- // 2.08ms Recalculate style
8483
- // 0.44ms Recalculate style
8484
- // 0.52ms Layout
8485
- // 0.16ms Update Layer Tree
8486
- // 48us hit test
8487
- // 16us Update Layer Tree
8488
- // 0.36ms paint
8489
- // 0.33ms composite layer
8490
-
8491
- // now: 2 recalculate styles
8492
- // 0.43ms recalculate style
8493
- // 0.53ms recalculate style
8494
- // 0.19ms layout
8495
- // 0.16ms update layer tree
8496
- // 30us hit test
8497
- // 17us update layer tree
8498
- // 0.17ms paint
8499
- // 0.19ms composite layers
8500
-
8501
- const setFocusedIndex = (state, unFocusIndex, focusIndex, oldIsMenuOpen, newIsMenuOpen) => {
8502
- object(state);
8503
- number(unFocusIndex);
8504
- number(focusIndex);
8505
- const {
8506
- $Viewlet
8507
- } = state;
8508
- if (focusIndex !== -1) {
8509
- $Viewlet.focus();
8510
- $Viewlet.setAttribute(AriaActiveDescendant, activeId);
8511
- }
8512
- };
8513
-
8514
- // TODO the focus variable is confusing: false means keep focus in menubar, true means focus the menu
8515
- const openMenu = (state, unFocusIndex, index, level, menuItems, menuFocusedIndex, focus, x, y, width, height) => {
8516
- object(state);
8517
- number(unFocusIndex);
8518
- number(index);
8519
- number(level);
8520
- array(menuItems);
8521
- number(menuFocusedIndex);
8522
- boolean(focus);
8523
- number(x);
8524
- number(y);
8525
- number(width);
8526
- number(height);
8527
- const {
8528
- $Viewlet
8529
- } = state;
8530
- // TODO this code is very unclean
8531
- $Viewlet.addEventListener('mouseenter', handlePointerOver, {
8532
- capture: true
8533
- });
8534
- if (unFocusIndex !== -1) {
8535
- $Viewlet.children[unFocusIndex].ariaExpanded = False;
8536
- $Viewlet.children[unFocusIndex].removeAttribute(AriaOwns);
8537
- }
8538
- $Viewlet.children[index].ariaExpanded = True;
8539
- const $$Menus = state$3.$$Menus;
8540
- state$3.$$Menus = [];
8541
- // @ts-expect-error
8542
- showControlled({
8543
- $Parent: $Viewlet.children[index],
8544
- handleFocusOut: handleFocusOut,
8545
- height,
8546
- items: menuItems,
8547
- level,
8548
- width,
8549
- x,
8550
- y
8551
- });
8552
- if (menuFocusedIndex !== -1) {
8553
- focusIndex(0, -1, menuFocusedIndex);
8554
- }
8555
- for (const $Menu of $$Menus) {
8556
- remove$1($Menu);
8557
- }
8558
- };
8559
-
8560
- // TODO there need to be two variants of closeMenu: one just closes menu, another close menu and focuses top level entry
8561
- const closeMenu = (state, unFocusIndex, index) => {
8562
- const {
8563
- $Viewlet
8564
- } = state;
8565
- if (unFocusIndex !== -1) {
8566
- $Viewlet.children[unFocusIndex].ariaExpanded = False;
8567
- $Viewlet.children[unFocusIndex].removeAttribute(AriaOwns);
8568
- }
8569
- if (index !== -1) {
8570
- $Viewlet.children[index].focus();
8571
- }
8572
- hide(/* restoreFocus */false);
8573
- $Viewlet.removeEventListener('mouseenter', handlePointerOver, {
8574
- capture: true
8575
- });
8576
- };
8577
- const create$Menu = () => {
8578
- const $Menu = document.createElement('div');
8579
- $Menu.className = 'Menu';
8580
- $Menu.role = Menu;
8581
- $Menu.tabIndex = -1;
8582
- // $ContextMenu.onmousedown = contextMenuHandleMouseDown
8583
- // TODO mousedown vs click? (click is usually better but mousedown is faster, why wait 100ms?)
8584
- // $Menu.addEventListener('mousedown', handleMouseDown)
8585
- // $Menu.addEventListener('mouseenter', handleMouseEnter, {
8586
- // capture: true,
8587
- // })
8588
- // $Menu.addEventListener('mouseleave', handleMouseLeave, {
8589
- // capture: true,
8590
- // })
8591
- // $Menu.addEventListener('mousemove', handleMouseMove, {
8592
- // passive: true,
8593
- // })
8594
- // $Menu.onkeydown = handleKeyDown
8595
- // $Menu.addEventListener('focusout', handleFocusOut)
8596
- // $Menu.oncontextmenu = handleContextMenu
8597
- // $ContextMenu.onfocus = handleFocus
8598
- // $ContextMenu.onblur = handleBlur
8599
- return $Menu;
8600
- };
8601
-
8602
- // TODO recycle menus
8603
- const setMenus = (state, changes, uid) => {
8604
- array(changes);
8605
- number(uid);
8606
- state.$$Menus ||= [];
8607
- const {
8608
- $$Menus
8609
- } = state;
8610
- for (const change of changes) {
8611
- const type = change[0];
8612
- switch (type) {
8613
- case 'addMenu':
8614
- {
8615
- const menu = change[1];
8616
- const dom = change[2];
8617
- const $Menu = create$Menu();
8618
- set$3($Menu, uid);
8619
- $Menu.onmouseover = handleMenuMouseOver;
8620
- $Menu.onclick = handleMenuClick;
8621
- const {
8622
- focusedIndex,
8623
- height,
8624
- level,
8625
- width,
8626
- x,
8627
- y
8628
- } = menu;
8629
- setBounds$a($Menu, x, y, width, height);
8630
- renderInto($Menu, dom);
8631
- $Menu.id = `Menu-${level}`;
8632
- append$1($Menu);
8633
- if (focusedIndex !== -1) {
8634
- const $Child = $Menu.children[focusedIndex];
8635
- // @ts-expect-error
8636
- $Child.focus();
8637
- }
8638
- $$Menus.push($Menu);
8639
- break;
8640
- }
8641
- case 'closeMenus':
8642
- {
8643
- const keepCount = change[1];
8644
- const $$ToDispose = $$Menus.slice(keepCount);
8645
- for (const $ToDispose of $$ToDispose) {
8646
- remove$1($ToDispose);
8647
- }
8648
- $$Menus.length = keepCount;
8649
- break;
8650
- }
8651
- case 'updateMenu':
8652
- {
8653
- const menu = change[1];
8654
- const newLength = change[2];
8655
- const dom = change[3];
8656
- const {
8657
- focusedIndex,
8658
- height,
8659
- level,
8660
- width,
8661
- x,
8662
- y
8663
- } = menu;
8664
- const $Menu = $$Menus[level];
8665
- setBounds$a($Menu, x, y, width, height);
8666
- renderInto($Menu, dom);
8667
- if (level === newLength - 1) {
8668
- if (focusedIndex === -1) {
8669
- $Menu.focus();
8670
- } else {
8671
- const $Child = $Menu.children[focusedIndex];
8672
- $Child.focus();
8673
- }
8674
- }
8675
- break;
8676
- }
8677
- // No default
8678
- }
8679
- }
8680
- };
8681
-
8682
- const ViewletTitleBarMenuBar = {
8683
- __proto__: null,
8684
- Events: ViewletTitleBarMenuBarEvents,
8685
- closeMenu,
8686
- dispose: dispose$4,
8687
- focus: focus$2,
8688
- openMenu,
8689
- setFocusedIndex,
8690
- setMenus
8691
- };
8692
-
8693
- const activeClassName = 'TitleBarActive';
8694
- const setFocused = (state, isFocused) => {
8695
- const {
8696
- $Viewlet
8697
- } = state;
8698
- $Viewlet.classList.toggle(activeClassName, isFocused);
8699
- };
8700
-
8701
- const ViewletTitleBar = {
8702
- __proto__: null,
8703
- Events: ViewletTitleBarMenuBarEvents,
8704
- closeMenu,
8705
- dispose: dispose$4,
8706
- focus: focus$2,
8707
- openMenu,
8708
- setFocused,
8709
- setFocusedIndex,
8710
- setMenus
8711
- };
8712
-
8713
- /**
8714
- *
8715
- * @param {MouseEvent} event
8716
- */
8717
- const handleTitleBarButtonsClick = event => {
8718
- const {
8719
- target
8720
- } = event;
8721
- return ['handleClick', target.className];
8722
- };
8723
- const returnValue$1 = true;
8724
-
8725
- const ViewletTitleBarButtonsEvents = {
8726
- __proto__: null,
8727
- handleTitleBarButtonsClick,
8728
- returnValue: returnValue$1
8729
- };
8730
-
8731
- const ViewletTitleBarButtons = {
8732
- __proto__: null,
8733
- Events: ViewletTitleBarButtonsEvents
8734
- };
8735
-
8736
- const Events = {};
8737
-
8738
- const ViewletTitleBarIcon = {
8739
- __proto__: null,
8740
- Events
8741
- };
8742
-
8743
- const create$4 = () => {
8744
- const $Viewlet = document.createElement('div');
8745
- $Viewlet.className = 'Viewlet TitleBarTitle';
8746
- return {
8747
- $Viewlet
8748
- };
8749
- };
8750
- const setDom$1 = (state, dom) => {
8751
- const {
8752
- $Viewlet
8753
- } = state;
8754
- renderInto($Viewlet, dom);
8755
- };
8756
-
8757
- const ViewletTitleBarTitle = {
8758
8025
  __proto__: null,
8759
8026
  create: create$4,
8760
- setDom: setDom$1
8027
+ setTabsDom
8761
8028
  };
8762
8029
 
8763
8030
  const handleVideoError$1 = (code, message) => {
@@ -8968,10 +8235,6 @@ const load$1 = moduleId => {
8968
8235
  return ViewletKeyBindings;
8969
8236
  case Layout:
8970
8237
  return ViewletLayout;
8971
- case Main:
8972
- return ViewletMain;
8973
- case MainTabs:
8974
- return ViewletMainTabs;
8975
8238
  case Output:
8976
8239
  return ViewletOutput;
8977
8240
  case Panel:
@@ -8996,16 +8259,6 @@ const load$1 = moduleId => {
8996
8259
  return Promise.resolve().then(function () { return ViewletTerminal; });
8997
8260
  case Terminals:
8998
8261
  return ViewletTerminals;
8999
- case TitleBar:
9000
- return ViewletTitleBar;
9001
- case TitleBarButtons:
9002
- return ViewletTitleBarButtons;
9003
- case TitleBarIcon:
9004
- return ViewletTitleBarIcon;
9005
- case TitleBarMenuBar:
9006
- return ViewletTitleBarMenuBar;
9007
- case TitleBarTitle:
9008
- return ViewletTitleBarTitle;
9009
8262
  case Video:
9010
8263
  return ViewletVideo;
9011
8264
  case WebView:
@@ -9909,7 +9162,7 @@ const commandMap = {
9909
9162
  'GetFilePathElectron.getFilePathElectron': getFilePathElectron,
9910
9163
  'HandleMessagePort.handleMessagePort': handleMessagePort,
9911
9164
  'InitData.getInitData': getInitData,
9912
- 'IpcParent.create': create$z,
9165
+ 'IpcParent.create': create$w,
9913
9166
  'KeyBindings.setIdentifiers': setIdentifiers,
9914
9167
  'Layout.getBounds': getBounds,
9915
9168
  'Location.getHref': getHref,
@@ -9924,10 +9177,10 @@ const commandMap = {
9924
9177
  'Menu.showControlled': showControlled,
9925
9178
  'Menu.showMenu': showMenu,
9926
9179
  'Meta.setThemeColor': setThemeColor,
9927
- 'Notification.create': create$y,
9180
+ 'Notification.create': create$v,
9928
9181
  'Notification.createWithOptions': createWithOptions,
9929
- 'Notification.dispose': dispose$i,
9930
- 'OffscreenCanvas.create': create$x,
9182
+ 'Notification.dispose': dispose$g,
9183
+ 'OffscreenCanvas.create': create$u,
9931
9184
  'OffscreenCanvas.create2': create2,
9932
9185
  'Open.openUrl': openUrl,
9933
9186
  'Performance.getMemory': getMemory,
@@ -9988,7 +9241,7 @@ const getConfiguredEditorWorkerUrl = () => {
9988
9241
  const editorWorkerUrl = getConfiguredEditorWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/editor-worker/dist/editorWorkerMain.js`;
9989
9242
 
9990
9243
  const launchEditorWorker = async port => {
9991
- const ipc = await create$z({
9244
+ const ipc = await create$w({
9992
9245
  method: ModuleWorkerWithMessagePort,
9993
9246
  name: 'Editor Worker',
9994
9247
  port,
@@ -10016,7 +9269,7 @@ const extensionHostWorkerUrl = getConfiguredExtensionHostWorkerUrl() || `${asset
10016
9269
 
10017
9270
  const launchExtensionHostWorker = async port => {
10018
9271
  const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
10019
- const ipc = await create$z({
9272
+ const ipc = await create$w({
10020
9273
  method: ModuleWorkerWithMessagePort,
10021
9274
  name,
10022
9275
  port,
@@ -10044,7 +9297,7 @@ const getConfiguredSyntaxHighlightingWorkerUrl = () => {
10044
9297
  const syntaxHighlightingWorkerUrl = getConfiguredSyntaxHighlightingWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/syntax-highlighting-worker/dist/syntaxHighlightingWorkerMain.js`;
10045
9298
 
10046
9299
  const launchSyntaxHighlightingWorker = async port => {
10047
- const ipc = await create$z({
9300
+ const ipc = await create$w({
10048
9301
  method: ModuleWorkerWithMessagePort,
10049
9302
  name: 'Syntax Highlighting Worker',
10050
9303
  port,
@@ -10077,7 +9330,7 @@ const launchWorkers = () => {
10077
9330
  const handleFocusIn = event => {
10078
9331
  preventDefault(event);
10079
9332
  const uid = fromEvent(event);
10080
- handleFocusIn$4(uid);
9333
+ handleFocusIn$3(uid);
10081
9334
  };
10082
9335
  const handleBlur$1 = event => {
10083
9336
  const uid = fromEvent(event);
@@ -10440,7 +9693,6 @@ const main = async () => {
10440
9693
  state$1.modules[EditorRename] = ViewletEditorRename;
10441
9694
  state$1.modules[EditorSourceActions] = ViewletEditorSourceActions;
10442
9695
  state$1.modules[FindWidget] = ViewletFindWidget;
10443
- state$1.modules[TitleBar] = ViewletTitleBar;
10444
9696
  // TODO this is discovered very late
10445
9697
  await launchWorkers();
10446
9698
  setIpc(RendererWorker);