@lvce-editor/renderer-process 10.58.0 → 10.60.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.
@@ -686,7 +686,7 @@ const getErrorResponse = (message, error, preparePrettyError, logError) => {
686
686
  const errorProperty = getErrorProperty(error, prettyError);
687
687
  return create$1$1(message, errorProperty);
688
688
  };
689
- const create$M = (message, result) => {
689
+ const create$L = (message, result) => {
690
690
  return {
691
691
  jsonrpc: Two,
692
692
  id: message.id,
@@ -695,7 +695,7 @@ const create$M = (message, result) => {
695
695
  };
696
696
  const getSuccessResponse = (message, result) => {
697
697
  const resultProperty = result ?? null;
698
- return create$M(message, resultProperty);
698
+ return create$L(message, resultProperty);
699
699
  };
700
700
  const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
701
701
  try {
@@ -879,7 +879,7 @@ const launchWorker = async ({
879
879
  name,
880
880
  url
881
881
  }) => {
882
- const worker = await create$L({
882
+ const worker = await create$K({
883
883
  method: Auto,
884
884
  url,
885
885
  name
@@ -954,7 +954,7 @@ const hydrate$4 = async () => {
954
954
  };
955
955
 
956
956
  // TODO needed?
957
- const dispose$n = () => {
957
+ const dispose$m = () => {
958
958
  // @ts-expect-error
959
959
  if (state$9.rendererWorker) {
960
960
  // @ts-expect-error
@@ -977,7 +977,7 @@ const invokeAndTransfer = (method, ...params) => {
977
977
 
978
978
  const RendererWorker = {
979
979
  __proto__: null,
980
- dispose: dispose$n,
980
+ dispose: dispose$m,
981
981
  hydrate: hydrate$4,
982
982
  invoke: invoke$1,
983
983
  invokeAndTransfer,
@@ -986,7 +986,7 @@ const RendererWorker = {
986
986
  state: state$9
987
987
  };
988
988
 
989
- const create$L = async ({
989
+ const create$K = async ({
990
990
  method,
991
991
  ...options
992
992
  }) => {
@@ -1007,7 +1007,7 @@ const create$L = async ({
1007
1007
  };
1008
1008
 
1009
1009
  const launchEditorWorker = async port => {
1010
- const ipc = await create$L({
1010
+ const ipc = await create$K({
1011
1011
  name: 'Editor Worker',
1012
1012
  url: editorWorkerUrl,
1013
1013
  method: ModuleWorkerWithMessagePort,
@@ -1037,7 +1037,7 @@ const extensionHostWorkerUrl = getConfiguredExtensionHostWorkerUrl() || `${asset
1037
1037
 
1038
1038
  const launchExtensionHostWorker = async port => {
1039
1039
  const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
1040
- const ipc = await create$L({
1040
+ const ipc = await create$K({
1041
1041
  name,
1042
1042
  url: extensionHostWorkerUrl,
1043
1043
  method: ModuleWorkerWithMessagePort,
@@ -1061,7 +1061,7 @@ const hydrate$2 = async () => {
1061
1061
  const syntaxHighlightingWorkerUrl = `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/syntax-highlighting-worker/dist/syntaxHighlightingWorkerMain.js`;
1062
1062
 
1063
1063
  const launchSyntaxHighlightingWorker = async port => {
1064
- const ipc = await create$L({
1064
+ const ipc = await create$K({
1065
1065
  name: 'Syntax Highlighting Worker',
1066
1066
  url: syntaxHighlightingWorkerUrl,
1067
1067
  method: ModuleWorkerWithMessagePort,
@@ -1209,7 +1209,7 @@ var A = "a";
1209
1209
  var Br = "br";
1210
1210
  var Cite = "cite";
1211
1211
  var Data = "data";
1212
- var Time$1 = "time";
1212
+ var Time = "time";
1213
1213
  var Tfoot = "tfoot";
1214
1214
  var Ul = "ul";
1215
1215
  var Video$1 = "video";
@@ -1231,7 +1231,7 @@ var Span2 = 8;
1231
1231
  var Table2 = 9;
1232
1232
  var TBody2 = 10;
1233
1233
  var Td2 = 11;
1234
- var Text$2 = 12;
1234
+ var Text$1 = 12;
1235
1235
  var Th2 = 13;
1236
1236
  var THead2 = 14;
1237
1237
  var Tr2 = 15;
@@ -1365,7 +1365,7 @@ var getElementTag = type => {
1365
1365
  case Data2:
1366
1366
  return Data;
1367
1367
  case Time2:
1368
- return Time$1;
1368
+ return Time;
1369
1369
  case Tfoot2:
1370
1370
  return Tfoot;
1371
1371
  case Ul2:
@@ -1551,6 +1551,13 @@ var setProp = ($Element, key, value, eventMap, newEventMap) => {
1551
1551
  $Element.removeAttribute("aria-owns");
1552
1552
  }
1553
1553
  break;
1554
+ case "ariaActivedescendant":
1555
+ if (value) {
1556
+ $Element.setAttribute("aria-activedescendant", value);
1557
+ } else {
1558
+ $Element.removeAttribute("aria-activedescendant");
1559
+ }
1560
+ break;
1554
1561
  case "ariaControls":
1555
1562
  $Element.setAttribute("aria-controls", value);
1556
1563
  break;
@@ -1616,7 +1623,7 @@ var renderDomElement = (element, eventMap, newEventMap) => {
1616
1623
  };
1617
1624
  var render = (element, eventMap, newEventMap) => {
1618
1625
  switch (element.type) {
1619
- case Text$2:
1626
+ case Text$1:
1620
1627
  return renderDomTextNode(element);
1621
1628
  default:
1622
1629
  return renderDomElement(element, eventMap, newEventMap);
@@ -1715,6 +1722,10 @@ var getEventListenerArg = (param, event) => {
1715
1722
  return event.button;
1716
1723
  case "event.target.value":
1717
1724
  return event.target.value;
1725
+ case "event.isTrusted":
1726
+ return event.isTrusted;
1727
+ case "event.target.className":
1728
+ return event.target.className;
1718
1729
  case "event.data":
1719
1730
  return event.data;
1720
1731
  case "event.deltaMode":
@@ -2011,7 +2022,7 @@ const stopTracking$1 = ($Target, pointerId, handlePointerMove, handlePointerUp)
2011
2022
  // TODO use pointerlost event instead
2012
2023
  $Target.removeEventListener(PointerUp, handlePointerUp);
2013
2024
  };
2014
- const create$K = (pointerDown, pointerMove, pointerUp) => {
2025
+ const create$J = (pointerDown, pointerMove, pointerUp) => {
2015
2026
  const shared = (fn, event) => {
2016
2027
  const message = fn(event);
2017
2028
  if (!message || message.length === 0) {
@@ -2044,7 +2055,7 @@ const create$K = (pointerDown, pointerMove, pointerUp) => {
2044
2055
  };
2045
2056
 
2046
2057
  const handleOffset = 20;
2047
- const handleSliderPointerDown = create$K(event => {
2058
+ const handleSliderPointerDown = create$J(event => {
2048
2059
  const {
2049
2060
  clientX,
2050
2061
  clientY
@@ -2059,7 +2070,7 @@ const handleSliderPointerDown = create$K(event => {
2059
2070
  }, () => {
2060
2071
  return [];
2061
2072
  });
2062
- const handlePointerDown$7 = event => {
2073
+ const handlePointerDown$6 = event => {
2063
2074
  const {
2064
2075
  target
2065
2076
  } = event;
@@ -2072,7 +2083,7 @@ const returnValue$9 = true;
2072
2083
 
2073
2084
  const ViewletColorPickerEvents = {
2074
2085
  __proto__: null,
2075
- handlePointerDown: handlePointerDown$7,
2086
+ handlePointerDown: handlePointerDown$6,
2076
2087
  returnValue: returnValue$9
2077
2088
  };
2078
2089
 
@@ -2214,9 +2225,9 @@ forwardViewletCommand('focusPrevious');
2214
2225
  const handleAudioError$1 = forwardViewletCommand('handleAudioError');
2215
2226
  const handleBeforeInput$2 = forwardViewletCommand('handleBeforeInput');
2216
2227
  forwardViewletCommand('handleBeforeInputFromContentEditable');
2217
- const handleBlur$b = forwardViewletCommand('handleBlur');
2228
+ const handleBlur$a = forwardViewletCommand('handleBlur');
2218
2229
  const handleButtonClick = forwardViewletCommand('handleButtonClick');
2219
- const handleClick$7 = forwardViewletCommand('handleClick');
2230
+ const handleClick$6 = forwardViewletCommand('handleClick');
2220
2231
  const handleClickAction$2 = forwardViewletCommand('handleClickAction');
2221
2232
  forwardViewletCommand('handleClickAdd');
2222
2233
  const handleClickAt$3 = forwardViewletCommand('handleClickAt');
@@ -2225,7 +2236,7 @@ forwardViewletCommand('handleClickCopy');
2225
2236
  forwardViewletCommand('handleClickMinimize');
2226
2237
  forwardViewletCommand('handleClickOk');
2227
2238
  forwardViewletCommand('handleClickOpenFile');
2228
- const handleClickOpenFolder$1 = forwardViewletCommand('handleClickOpenFolder');
2239
+ forwardViewletCommand('handleClickOpenFolder');
2229
2240
  forwardViewletCommand('handleClickRestore');
2230
2241
  const handleClickTab$2 = forwardViewletCommand('handleClickTab');
2231
2242
  forwardViewletCommand('handleClickToggleMaximize');
@@ -2242,7 +2253,7 @@ forwardViewletCommand('handleClickSize');
2242
2253
  forwardViewletCommand('handleClickDisable');
2243
2254
  forwardViewletCommand('handleClickUninstall');
2244
2255
  forwardViewletCommand('handleFilterInput');
2245
- const handleFocus$b = forwardViewletCommand('handleFocus');
2256
+ const handleFocus$a = forwardViewletCommand('handleFocus');
2246
2257
  const handleFocusIn$4 = forwardViewletCommand('handleFocusIn');
2247
2258
  forwardViewletCommand('handleIconError');
2248
2259
  const handleImageError$1 = forwardViewletCommand('handleImageError');
@@ -2257,7 +2268,7 @@ forwardViewletCommand('handleMouseMove');
2257
2268
  const handleMouseOut$1 = forwardViewletCommand('handleMouseOut');
2258
2269
  const handleMouseOver$1 = forwardViewletCommand('handleMouseOver');
2259
2270
  forwardViewletCommand('handlePointerCaptureLost');
2260
- const handlePointerDown$6 = forwardViewletCommand('handlePointerDown');
2271
+ const handlePointerDown$5 = forwardViewletCommand('handlePointerDown');
2261
2272
  const handlePointerMove$1 = forwardViewletCommand('handlePointerMove');
2262
2273
  forwardViewletCommand('handlePointerOver');
2263
2274
  const handlePointerUp$1 = forwardViewletCommand('handlePointerUp');
@@ -2301,22 +2312,22 @@ forwardViewletCommand('toggleReplace');
2301
2312
  forwardViewletCommand('toggleUseRegularExpression');
2302
2313
  forwardViewletCommand('type');
2303
2314
  forwardViewletCommand('typeWithAutoClosing');
2304
- const updateEditingValue = forwardViewletCommand('updateEditingValue');
2315
+ forwardViewletCommand('updateEditingValue');
2305
2316
 
2306
2317
  const handleFocusIn$3 = event => {
2307
2318
  preventDefault(event);
2308
2319
  const uid = fromEvent(event);
2309
2320
  handleFocusIn$4(uid);
2310
2321
  };
2311
- const handleBlur$a = event => {
2322
+ const handleBlur$9 = event => {
2312
2323
  preventDefault(event);
2313
2324
  const uid = fromEvent(event);
2314
- handleBlur$b(uid);
2325
+ handleBlur$a(uid);
2315
2326
  };
2316
2327
 
2317
2328
  const ViewletEditorCodeGeneratorEvents = {
2318
2329
  __proto__: null,
2319
- handleBlur: handleBlur$a,
2330
+ handleBlur: handleBlur$9,
2320
2331
  handleFocusIn: handleFocusIn$3
2321
2332
  };
2322
2333
 
@@ -2333,7 +2344,7 @@ const appendWidget$5 = state => {
2333
2344
  } = state;
2334
2345
  append$1($Viewlet);
2335
2346
  };
2336
- const dispose$m = state => {
2347
+ const dispose$l = state => {
2337
2348
  remove$2(state.$Viewlet);
2338
2349
  };
2339
2350
  const focus$i = (state, key, source) => {
@@ -2359,7 +2370,7 @@ const ViewletEditorCodeGenerator = {
2359
2370
  __proto__: null,
2360
2371
  Events: ViewletEditorCodeGeneratorEvents,
2361
2372
  appendWidget: appendWidget$5,
2362
- dispose: dispose$m,
2373
+ dispose: dispose$l,
2363
2374
  focus: focus$i,
2364
2375
  setBounds: setBounds$9
2365
2376
  };
@@ -2380,7 +2391,6 @@ const Status = 'status';
2380
2391
  const TabList = 'tablist';
2381
2392
  const TextBox = 'textbox';
2382
2393
  const ToolBar = 'toolbar';
2383
- const Tree = 'tree';
2384
2394
  const ComboBox = 'combobox';
2385
2395
 
2386
2396
  const attachEvents$c = ($Node, eventMap) => {
@@ -2512,7 +2522,7 @@ const setNegativeMargin = (state, negativeMargin) => {
2512
2522
  setTop($ListItems, negativeMargin);
2513
2523
  };
2514
2524
 
2515
- const create$J = () => {
2525
+ const create$I = () => {
2516
2526
  const $ListItems = document.createElement('div');
2517
2527
  $ListItems.className = 'ListItems';
2518
2528
  $ListItems.role = ListBox;
@@ -2565,7 +2575,7 @@ const setDom$a = (state, dom) => {
2565
2575
  // TODO recycle nodes
2566
2576
  // TODO set right aria attributes on $EditorInput
2567
2577
  };
2568
- const dispose$l = state => {
2578
+ const dispose$k = state => {
2569
2579
  remove$2(state.$Viewlet);
2570
2580
  // state.$EditorInput.removeAttribute('aria-activedescendant')
2571
2581
  };
@@ -2579,7 +2589,7 @@ const showLoading = (state, x, y) => {
2579
2589
  $Viewlet.append($Loading);
2580
2590
  append$1($Viewlet);
2581
2591
  };
2582
- const handleError$8 = (state, error) => {
2592
+ const handleError$7 = (state, error) => {
2583
2593
  const {
2584
2594
  $Viewlet
2585
2595
  } = state;
@@ -2596,9 +2606,9 @@ const setBounds$8 = (state, x, y, width, height) => {
2596
2606
  const ViewletEditorCompletion = {
2597
2607
  __proto__: null,
2598
2608
  attachEvents: attachEvents$b,
2599
- create: create$J,
2600
- dispose: dispose$l,
2601
- handleError: handleError$8,
2609
+ create: create$I,
2610
+ dispose: dispose$k,
2611
+ handleError: handleError$7,
2602
2612
  setBounds: setBounds$8,
2603
2613
  setContentHeight,
2604
2614
  setDom: setDom$a,
@@ -2619,7 +2629,7 @@ const ViewletEditorCompletionDetailsEvents = {
2619
2629
  returnValue: returnValue$8
2620
2630
  };
2621
2631
 
2622
- const create$I = () => {
2632
+ const create$H = () => {
2623
2633
  const $Viewlet = document.createElement('div');
2624
2634
  $Viewlet.className = 'Viewlet EditorCompletionDetails';
2625
2635
  $Viewlet.id = 'CompletionsDetails';
@@ -2645,7 +2655,7 @@ const appendWidget$4 = state => {
2645
2655
  } = state;
2646
2656
  append$1($Viewlet);
2647
2657
  };
2648
- const dispose$k = state => {
2658
+ const dispose$j = state => {
2649
2659
  remove$2(state.$Viewlet);
2650
2660
  };
2651
2661
  const setBounds$7 = (state, x, y, width, height) => {
@@ -2660,8 +2670,8 @@ const ViewletEditorCompletionDetails = {
2660
2670
  Events: ViewletEditorCompletionDetailsEvents,
2661
2671
  appendWidget: appendWidget$4,
2662
2672
  attachEvents: attachEvents$a,
2663
- create: create$I,
2664
- dispose: dispose$k,
2673
+ create: create$H,
2674
+ dispose: dispose$j,
2665
2675
  setBounds: setBounds$7,
2666
2676
  setDom: setDom$9
2667
2677
  };
@@ -2669,7 +2679,7 @@ const ViewletEditorCompletionDetails = {
2669
2679
  const rememberFocus = rememberFocus$1;
2670
2680
 
2671
2681
  const returnValue$7 = true;
2672
- const handleSashPointerDown$2 = create$K(event => {
2682
+ const handleSashPointerDown$2 = create$J(event => {
2673
2683
  const {
2674
2684
  clientX,
2675
2685
  clientY
@@ -2728,7 +2738,7 @@ const handleFocusIn$2 = event => {
2728
2738
  const uid = fromEvent(event);
2729
2739
  handleFocusIn$4(uid);
2730
2740
  };
2731
- const handleBlur$9 = event => {
2741
+ const handleBlur$8 = event => {
2732
2742
  const uid = fromEvent(event);
2733
2743
  executeViewletCommand(uid, 'EditorRename.handleBlur');
2734
2744
  };
@@ -2745,7 +2755,7 @@ const handleInput$6 = event => {
2745
2755
 
2746
2756
  const ViewletEditorRenameEvents = {
2747
2757
  __proto__: null,
2748
- handleBlur: handleBlur$9,
2758
+ handleBlur: handleBlur$8,
2749
2759
  handleFocusIn: handleFocusIn$2,
2750
2760
  handleInput: handleInput$6
2751
2761
  };
@@ -2763,7 +2773,7 @@ const appendWidget$2 = state => {
2763
2773
  } = state;
2764
2774
  append$1($Viewlet);
2765
2775
  };
2766
- const dispose$j = state => {
2776
+ const dispose$i = state => {
2767
2777
  remove$2(state.$Viewlet);
2768
2778
  };
2769
2779
 
@@ -2771,7 +2781,7 @@ const ViewletEditorRename = {
2771
2781
  __proto__: null,
2772
2782
  Events: ViewletEditorRenameEvents,
2773
2783
  appendWidget: appendWidget$2,
2774
- dispose: dispose$j,
2784
+ dispose: dispose$i,
2775
2785
  setBounds: setBounds$5
2776
2786
  };
2777
2787
 
@@ -2799,7 +2809,7 @@ const appendWidget$1 = state => {
2799
2809
  } = state;
2800
2810
  append$1($Viewlet);
2801
2811
  };
2802
- const dispose$i = state => {
2812
+ const dispose$h = state => {
2803
2813
  remove$2(state.$Viewlet);
2804
2814
  };
2805
2815
 
@@ -2807,7 +2817,7 @@ const ViewletEditorSourceActions = {
2807
2817
  __proto__: null,
2808
2818
  Events: ViewletEditorSourceActionsEvents,
2809
2819
  appendWidget: appendWidget$1,
2810
- dispose: dispose$i,
2820
+ dispose: dispose$h,
2811
2821
  setBounds: setBounds$4
2812
2822
  };
2813
2823
 
@@ -2859,7 +2869,7 @@ const handleReplaceInput = event => {
2859
2869
  const handleReplaceFocus = event => {
2860
2870
  return ['FindWidget.handleReplaceFocus'];
2861
2871
  };
2862
- const handleFocus$a = event => {
2872
+ const handleFocus$9 = event => {
2863
2873
  return ['FindWidget.handleFocus'];
2864
2874
  };
2865
2875
  const handleToggleReplaceFocus = event => {
@@ -2887,7 +2897,7 @@ const ViewletFindWidgetEvents = {
2887
2897
  handleClickReplace,
2888
2898
  handleClickReplaceAll,
2889
2899
  handleClickToggleReplace,
2890
- handleFocus: handleFocus$a,
2900
+ handleFocus: handleFocus$9,
2891
2901
  handleFocusClose,
2892
2902
  handleFocusNext,
2893
2903
  handleFocusPrevious,
@@ -2900,7 +2910,7 @@ const ViewletFindWidgetEvents = {
2900
2910
  returnValue: returnValue$6
2901
2911
  };
2902
2912
 
2903
- const create$H = () => {
2913
+ const create$G = () => {
2904
2914
  const $Viewlet = document.createElement('div');
2905
2915
  $Viewlet.className = 'Viewlet FindWidget';
2906
2916
  $Viewlet.role = Group;
@@ -2954,17 +2964,17 @@ const setBounds$3 = (state, x, y, width, height) => {
2954
2964
  } = state;
2955
2965
  setBounds$a($Viewlet, x, y, width, height);
2956
2966
  };
2957
- const dispose$h = state => {
2967
+ const dispose$g = state => {
2958
2968
  remove$2(state.$Viewlet);
2959
2969
  };
2960
- const Events$a = ViewletFindWidgetEvents;
2970
+ const Events$9 = ViewletFindWidgetEvents;
2961
2971
 
2962
2972
  const ViewletFindWidget = {
2963
2973
  __proto__: null,
2964
- Events: Events$a,
2974
+ Events: Events$9,
2965
2975
  appendWidget,
2966
- create: create$H,
2967
- dispose: dispose$h,
2976
+ create: create$G,
2977
+ dispose: dispose$g,
2968
2978
  focus: focus$h,
2969
2979
  setBounds: setBounds$3,
2970
2980
  setDom: setDom$7,
@@ -2990,7 +3000,6 @@ const EditorText = 'Editor';
2990
3000
  const EditorWidgetError = 'EditorWidgetError';
2991
3001
  const Empty = 'Empty';
2992
3002
  const Error$2 = 'Error';
2993
- const Explorer = 'Explorer';
2994
3003
  const Extensions = 'Extensions';
2995
3004
  const FindWidget = 'FindWidget';
2996
3005
  const ImagePreview$1 = 'ImagePreview';
@@ -3314,7 +3323,7 @@ const logError = async (error, prefix = '') => {
3314
3323
  print(prettyError, prefix);
3315
3324
  return prettyError;
3316
3325
  };
3317
- const handleError$7 = async (error, notify = true, prefix = '') => {
3326
+ const handleError$6 = async (error, notify = true, prefix = '') => {
3318
3327
  try {
3319
3328
  const prettyError = await logError(error, prefix);
3320
3329
  if (notify) {
@@ -3333,14 +3342,14 @@ const isChromeExtensionError = error => {
3333
3342
 
3334
3343
  const handleUnhandledRejection = event => {
3335
3344
  event.preventDefault();
3336
- handleError$7(event.reason, true, '[renderer process] Unhandled Rejection: ');
3345
+ handleError$6(event.reason, true, '[renderer process] Unhandled Rejection: ');
3337
3346
  };
3338
3347
  const handleUnhandledError = (message, filename, lineno, colno, error) => {
3339
3348
  if (isChromeExtensionError(message)) {
3340
3349
  // ignore errors from chrome extensions
3341
3350
  return;
3342
3351
  }
3343
- handleError$7(error, Boolean(error), '[renderer-process] Unhandled Error: ');
3352
+ handleError$6(error, Boolean(error), '[renderer-process] Unhandled Error: ');
3344
3353
  };
3345
3354
 
3346
3355
  const handleWindowMessage = event => {
@@ -3468,7 +3477,7 @@ const getWorkerDisplayName = name => {
3468
3477
  }
3469
3478
  return `${name} worker`;
3470
3479
  };
3471
- const create$G = async ({
3480
+ const create$F = async ({
3472
3481
  url,
3473
3482
  name
3474
3483
  }) => {
@@ -3535,7 +3544,7 @@ const wrap = worker => {
3535
3544
 
3536
3545
  const IpcParentWithModuleWorker = {
3537
3546
  __proto__: null,
3538
- create: create$G,
3547
+ create: create$F,
3539
3548
  wrap
3540
3549
  };
3541
3550
 
@@ -3543,7 +3552,7 @@ const isMessagePort$1 = value => {
3543
3552
  return value instanceof MessagePort;
3544
3553
  };
3545
3554
 
3546
- const create$F = async ({
3555
+ const create$E = async ({
3547
3556
  url
3548
3557
  }) => {
3549
3558
  string(url);
@@ -3564,10 +3573,10 @@ const create$F = async ({
3564
3573
 
3565
3574
  const IpcParentWithMessagePort = {
3566
3575
  __proto__: null,
3567
- create: create$F
3576
+ create: create$E
3568
3577
  };
3569
3578
 
3570
- const create$E = async url => {
3579
+ const create$D = async url => {
3571
3580
  const referencePort = await new Promise(resolve => {
3572
3581
  globalThis.acceptReferencePort = resolve;
3573
3582
  import(url);
@@ -3578,7 +3587,7 @@ const create$E = async url => {
3578
3587
 
3579
3588
  const IpcParentWithReferencePort = {
3580
3589
  __proto__: null,
3581
- create: create$E
3590
+ create: create$D
3582
3591
  };
3583
3592
 
3584
3593
  const isWorker = value => {
@@ -3586,12 +3595,12 @@ const isWorker = value => {
3586
3595
  };
3587
3596
 
3588
3597
  // TODO add test
3589
- const create$D = async ({
3598
+ const create$C = async ({
3590
3599
  url,
3591
3600
  name,
3592
3601
  port
3593
3602
  }) => {
3594
- const worker = await create$G({
3603
+ const worker = await create$F({
3595
3604
  url,
3596
3605
  name
3597
3606
  });
@@ -3610,7 +3619,7 @@ const create$D = async ({
3610
3619
 
3611
3620
  const IpcParentWithModuleWorkerWithMessagePort = {
3612
3621
  __proto__: null,
3613
- create: create$D
3622
+ create: create$C
3614
3623
  };
3615
3624
 
3616
3625
  const handleIpcOnce = ipc => {
@@ -4137,7 +4146,7 @@ const IpcChildWithModuleWorkerAndMessagePort$1 = {
4137
4146
  };
4138
4147
 
4139
4148
  // TODO use handleIncomingIpc function
4140
- const create$C = async ({
4149
+ const create$B = async ({
4141
4150
  port,
4142
4151
  ipcId
4143
4152
  }) => {
@@ -4153,7 +4162,7 @@ const create$C = async ({
4153
4162
 
4154
4163
  const IpcParentWithElectron = {
4155
4164
  __proto__: null,
4156
- create: create$C
4165
+ create: create$B
4157
4166
  };
4158
4167
 
4159
4168
  const play = async src => {
@@ -4384,7 +4393,7 @@ const AriaAlert = {
4384
4393
  // but that's difficult to know
4385
4394
 
4386
4395
  // TODO hide widget after timeout or mousemove
4387
- const create$B = (message, x, y) => {
4396
+ const create$A = (message, x, y) => {
4388
4397
  const $EditorError = document.createElement('div');
4389
4398
  $EditorError.className = 'EditorWidgetError';
4390
4399
  $EditorError.textContent = message;
@@ -4399,7 +4408,7 @@ const create$B = (message, x, y) => {
4399
4408
 
4400
4409
  const name$s = 'EditorError';
4401
4410
  const Commands$t = {
4402
- create: create$B
4411
+ create: create$A
4403
4412
  };
4404
4413
 
4405
4414
  const EditorError_ipc = {
@@ -4483,7 +4492,7 @@ const showError = (message, y, x) => {
4483
4492
  $ImagePreviewImage
4484
4493
  };
4485
4494
  };
4486
- const create$A = (uri, top, left) => {
4495
+ const create$z = (uri, top, left) => {
4487
4496
  const $ImagePreviewImage = document.createElement('img');
4488
4497
  $ImagePreviewImage.className = 'ImagePreviewImage';
4489
4498
  $ImagePreviewImage.src = uri;
@@ -4508,22 +4517,22 @@ const create$A = (uri, top, left) => {
4508
4517
  const update = (state, uri) => {
4509
4518
  state.$ImagePreviewImage.uri = uri;
4510
4519
  };
4511
- const dispose$g = state => {
4520
+ const dispose$f = state => {
4512
4521
  remove$2(state.$ImagePreview);
4513
4522
  };
4514
4523
 
4515
4524
  const ImagePreview = {
4516
4525
  __proto__: null,
4517
- create: create$A,
4518
- dispose: dispose$g,
4526
+ create: create$z,
4527
+ dispose: dispose$f,
4519
4528
  showError,
4520
4529
  update
4521
4530
  };
4522
4531
 
4523
4532
  const name$p = 'ImagePreview';
4524
4533
  const Commands$q = {
4525
- create: create$A,
4526
- dispose: dispose$g,
4534
+ create: create$z,
4535
+ dispose: dispose$f,
4527
4536
  showError: showError,
4528
4537
  update: update
4529
4538
  };
@@ -4600,7 +4609,7 @@ const InitData_ipc = {
4600
4609
 
4601
4610
  const name$n = 'IpcParent';
4602
4611
  const Commands$o = {
4603
- create: create$L
4612
+ create: create$K
4604
4613
  };
4605
4614
 
4606
4615
  const IpcParent_ipc = {
@@ -4720,7 +4729,7 @@ const create$Notification = message => {
4720
4729
  $Notification.textContent = message;
4721
4730
  return $Notification;
4722
4731
  };
4723
- const create$z = (type, message) => {
4732
+ const create$y = (type, message) => {
4724
4733
  // TODO this pattern might be also useful for activitybar, sidebar etc., creating elements as late as possible, only when actually needed
4725
4734
  const $Notification = create$Notification(message);
4726
4735
  append$1($Notification);
@@ -4765,7 +4774,7 @@ const createWithOptions = (type, message, options) => {
4765
4774
  const $Notification = create$NotificationWithOptions(message, options);
4766
4775
  append$1($Notification);
4767
4776
  };
4768
- const dispose$f = id => {
4777
+ const dispose$e = id => {
4769
4778
  // const $Notification = state.$Notifications
4770
4779
  };
4771
4780
 
@@ -4773,9 +4782,9 @@ const name$h = 'Notification';
4773
4782
 
4774
4783
  // prettier-ignore
4775
4784
  const Commands$i = {
4776
- create: create$z,
4785
+ create: create$y,
4777
4786
  createWithOptions: createWithOptions,
4778
- dispose: dispose$f
4787
+ dispose: dispose$e
4779
4788
  };
4780
4789
 
4781
4790
  const Notification_ipc = {
@@ -4797,7 +4806,7 @@ const set$4 = (canvasId, canvas) => {
4797
4806
  const get$3 = id => {
4798
4807
  return get$4(id);
4799
4808
  };
4800
- const create$y = async (canvasId, objectId) => {
4809
+ const create$x = async (canvasId, objectId) => {
4801
4810
  const canvas = document.createElement('canvas');
4802
4811
  const offscreenCanvas = canvas.transferControlToOffscreen();
4803
4812
  set$4(canvasId, canvas);
@@ -4808,7 +4817,7 @@ const name$g = 'OffscreenCanvas';
4808
4817
 
4809
4818
  // prettier-ignore
4810
4819
  const Commands$h = {
4811
- create: create$y
4820
+ create: create$x
4812
4821
  };
4813
4822
 
4814
4823
  const OffscreenCanvas_ipc = {
@@ -4873,7 +4882,6 @@ const focusPrevious = () => {
4873
4882
  };
4874
4883
 
4875
4884
  const FocusDebugInput = 6;
4876
- const FocusExplorerEditBox = 14;
4877
4885
  const FocusLocationList = 17;
4878
4886
  const FocusMenu = 18;
4879
4887
  const FocusQuickPickInput = 20;
@@ -4961,7 +4969,7 @@ const handleMouseDown$3 = event => {
4961
4969
  *
4962
4970
  * @param {MouseEvent} event
4963
4971
  */
4964
- const handleMouseEnter$1 = event => {
4972
+ const handleMouseEnter = event => {
4965
4973
  const {
4966
4974
  target,
4967
4975
  clientX,
@@ -4976,7 +4984,7 @@ const handleMouseEnter$1 = event => {
4976
4984
  const level = getLevel($Menu);
4977
4985
  send(/* Menu.handleMouseEnter */'Menu.handleMouseEnter', /* level */level, /* index */index, /* x */clientX, /* y */clientY, /* timeStamp */timeStamp);
4978
4986
  };
4979
- const handleMouseLeave$1 = event => {
4987
+ const handleMouseLeave = event => {
4980
4988
  const $RelatedTarget = event.relatedTarget;
4981
4989
  if ($RelatedTarget.classList.contains('MenuItem')) ;
4982
4990
  // RendererWorker.send(/* Menu.handleMouseLeave */ 'Menu.handleMouseLeave')
@@ -4998,10 +5006,10 @@ const create$Menu$1 = () => {
4998
5006
  // $ContextMenu.onmousedown = contextMenuHandleMouseDown
4999
5007
  // TODO mousedown vs click? (click is usually better but mousedown is faster, why wait 100ms?)
5000
5008
  $Menu.addEventListener(MouseDown, handleMouseDown$3);
5001
- $Menu.addEventListener(MouseEnter, handleMouseEnter$1, {
5009
+ $Menu.addEventListener(MouseEnter, handleMouseEnter, {
5002
5010
  capture: true
5003
5011
  });
5004
- $Menu.addEventListener(MouseLeave, handleMouseLeave$1, {
5012
+ $Menu.addEventListener(MouseLeave, handleMouseLeave, {
5005
5013
  capture: true
5006
5014
  });
5007
5015
  // $Menu.addEventListener('mousemove', handleMouseMove, {
@@ -5265,7 +5273,7 @@ const start = async (id, options) => {
5265
5273
  throw new VError$1(error, `Failed to start screen capture`);
5266
5274
  }
5267
5275
  };
5268
- const dispose$e = async (id, options) => {
5276
+ const dispose$d = async (id, options) => {
5269
5277
  try {
5270
5278
  number(id);
5271
5279
  const captureStream = get$2(id);
@@ -5280,7 +5288,7 @@ const dispose$e = async (id, options) => {
5280
5288
 
5281
5289
  const name$b = 'ScreenCapture';
5282
5290
  const Commands$c = {
5283
- dispose: dispose$e,
5291
+ dispose: dispose$d,
5284
5292
  start: start
5285
5293
  };
5286
5294
 
@@ -5290,6 +5298,113 @@ const ScreenCapture_ipc = {
5290
5298
  name: name$b
5291
5299
  };
5292
5300
 
5301
+ const getTimeStamp = () => {
5302
+ return performance.now();
5303
+ };
5304
+
5305
+ const waitForMutation = async maxDelay => {
5306
+ const disposables = [];
5307
+ await Promise.race([new Promise(resolve => {
5308
+ const timeout = setTimeout(resolve, maxDelay);
5309
+ // @ts-expect-error
5310
+ disposables.push(() => {
5311
+ clearTimeout(timeout);
5312
+ });
5313
+ }), new Promise(resolve => {
5314
+ const callback = mutations => {
5315
+ resolve(undefined);
5316
+ };
5317
+ const observer = new MutationObserver(callback);
5318
+ observer.observe(document.body, {
5319
+ childList: true,
5320
+ attributes: true,
5321
+ characterData: true,
5322
+ subtree: true,
5323
+ attributeOldValue: true,
5324
+ characterDataOldValue: true
5325
+ });
5326
+ // @ts-expect-error
5327
+ disposables.push(() => {
5328
+ observer.disconnect();
5329
+ });
5330
+ })]);
5331
+ for (const disposable of disposables) {
5332
+ // @ts-expect-error
5333
+ disposable();
5334
+ }
5335
+ };
5336
+
5337
+ const getEventClass = eventType => {
5338
+ switch (eventType) {
5339
+ case Wheel:
5340
+ return WheelEvent;
5341
+ case PointerDown:
5342
+ case PointerUp:
5343
+ case PointerMove:
5344
+ return PointerEvent;
5345
+ default:
5346
+ return Event;
5347
+ }
5348
+ };
5349
+
5350
+ const mouseEvent = (element, eventType, options) => {
5351
+ const event = new MouseEvent(eventType, options);
5352
+ element.dispatchEvent(event);
5353
+ };
5354
+ const mouseDown = (element, options) => {
5355
+ mouseEvent(element, MouseDown, options);
5356
+ };
5357
+ const mouseUp = (element, options) => {
5358
+ mouseEvent(element, MouseUp, options);
5359
+ };
5360
+ const contextMenu = (element, options) => {
5361
+ mouseEvent(element, ContextMenu, options);
5362
+ };
5363
+ const click = (element, options) => {
5364
+ mouseDown(element, options);
5365
+ mouseEvent(element, Click, options);
5366
+ mouseUp(element, options);
5367
+ if (options.button === 2 /* right */) {
5368
+ contextMenu(element, options);
5369
+ }
5370
+ };
5371
+ const hover = (element, options) => {
5372
+ mouseEvent(element, MouseEnter, options);
5373
+ };
5374
+ const type = (element, options) => {
5375
+ element.value = options.text;
5376
+ };
5377
+ const keyboardEvent = (element, eventType, options) => {
5378
+ const event = new KeyboardEvent(eventType, options);
5379
+ element.dispatchEvent(event);
5380
+ };
5381
+ const keyDown = (element, options) => {
5382
+ keyboardEvent(element, KeyDown, options);
5383
+ };
5384
+ const keyUp = (element, options) => {
5385
+ keyboardEvent(element, KeyUp, options);
5386
+ };
5387
+ const dispatchEvent = (element, options) => {
5388
+ const EventClass = getEventClass(options.type);
5389
+ const event = new EventClass(options.type, options.init);
5390
+ element.dispatchEvent(event);
5391
+ };
5392
+
5393
+ const ElementActions = {
5394
+ __proto__: null,
5395
+ click,
5396
+ contextMenu,
5397
+ dispatchEvent,
5398
+ hover,
5399
+ keyDown,
5400
+ keyUp,
5401
+ keyboardEvent,
5402
+ mouseDown,
5403
+ mouseEvent,
5404
+ mouseUp,
5405
+ type
5406
+ };
5407
+
5293
5408
  const htmlElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdo', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'link', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'];
5294
5409
 
5295
5410
  const querySelectorByText = (root, text) => {
@@ -5365,6 +5480,30 @@ const querySelectorWithOptions = (selector, {
5365
5480
  return element;
5366
5481
  };
5367
5482
 
5483
+ // TODO this should also come in via options
5484
+ const maxTimeout$1 = 2000;
5485
+ const performAction2 = async (locator, fnName, options) => {
5486
+ object(locator);
5487
+ string(fnName);
5488
+ object(options);
5489
+ const startTime = getTimeStamp();
5490
+ const endTime = startTime + maxTimeout$1;
5491
+ let currentTime = startTime;
5492
+ const fn = ElementActions[fnName];
5493
+ while (currentTime < endTime) {
5494
+ const element = querySelectorWithOptions(locator._selector, {
5495
+ hasText: locator._hasText,
5496
+ nth: locator._nth
5497
+ });
5498
+ if (element) {
5499
+ fn(element, options);
5500
+ return;
5501
+ }
5502
+ await waitForMutation(100);
5503
+ currentTime = getTimeStamp();
5504
+ }
5505
+ };
5506
+
5368
5507
  const toBeVisible$1 = locator => {
5369
5508
  return `expected selector to be visible ${locator._selector}`;
5370
5509
  };
@@ -5501,76 +5640,6 @@ const getFunction = fnName => {
5501
5640
  }
5502
5641
  };
5503
5642
 
5504
- const mouseEvent = (element, eventType, options) => {
5505
- const event = new MouseEvent(eventType, options);
5506
- element.dispatchEvent(event);
5507
- };
5508
- const mouseDown = (element, options) => {
5509
- mouseEvent(element, MouseDown, options);
5510
- };
5511
- const mouseUp = (element, options) => {
5512
- mouseEvent(element, MouseUp, options);
5513
- };
5514
- const contextMenu = (element, options) => {
5515
- mouseEvent(element, ContextMenu, options);
5516
- };
5517
- const click = (element, options) => {
5518
- mouseDown(element, options);
5519
- mouseEvent(element, Click, options);
5520
- mouseUp(element, options);
5521
- if (options.button === 2 /* right */) {
5522
- contextMenu(element, options);
5523
- }
5524
- };
5525
- const hover = (element, options) => {
5526
- mouseEvent(element, MouseEnter, options);
5527
- };
5528
- const type = (element, options) => {
5529
- element.value = options.text;
5530
- };
5531
- const keyboardEvent = (element, eventType, options) => {
5532
- const event = new KeyboardEvent(eventType, options);
5533
- element.dispatchEvent(event);
5534
- };
5535
- const keyDown = (element, options) => {
5536
- keyboardEvent(element, KeyDown, options);
5537
- };
5538
- const keyUp = (element, options) => {
5539
- keyboardEvent(element, KeyUp, options);
5540
- };
5541
- const getEventClass = eventType => {
5542
- switch (eventType) {
5543
- case Wheel:
5544
- return WheelEvent;
5545
- case PointerDown:
5546
- case PointerUp:
5547
- case PointerMove:
5548
- return PointerEvent;
5549
- default:
5550
- return Event;
5551
- }
5552
- };
5553
- const dispatchEvent = (element, options) => {
5554
- const EventClass = getEventClass(options.type);
5555
- const event = new EventClass(options.type, options.init);
5556
- element.dispatchEvent(event);
5557
- };
5558
-
5559
- const ElementActions = {
5560
- __proto__: null,
5561
- click,
5562
- contextMenu,
5563
- dispatchEvent,
5564
- hover,
5565
- keyDown,
5566
- keyUp,
5567
- keyboardEvent,
5568
- mouseDown,
5569
- mouseEvent,
5570
- mouseUp,
5571
- type
5572
- };
5573
-
5574
5643
  const press = options => {
5575
5644
  const element = document.activeElement;
5576
5645
  keyDown(element, options);
@@ -5684,53 +5753,12 @@ const showOverlay = (state, background, text) => {
5684
5753
  $TestOverlay.textContent = text;
5685
5754
  document.body.append($TestOverlay);
5686
5755
  };
5687
- const Time = {
5688
- getTimeStamp() {
5689
- return performance.now();
5690
- }
5691
- };
5692
5756
  const maxTimeout = 2000;
5693
- const Timeout = {
5694
- async short() {
5695
- await new Promise(resolve => setTimeout(resolve, 1000));
5696
- },
5697
- async waitForMutation(maxDelay) {
5698
- const disposables = [];
5699
- await Promise.race([new Promise(resolve => {
5700
- const timeout = setTimeout(resolve, maxDelay);
5701
- // @ts-expect-error
5702
- disposables.push(() => {
5703
- clearTimeout(timeout);
5704
- });
5705
- }), new Promise(resolve => {
5706
- const callback = mutations => {
5707
- resolve(undefined);
5708
- };
5709
- const observer = new MutationObserver(callback);
5710
- observer.observe(document.body, {
5711
- childList: true,
5712
- attributes: true,
5713
- characterData: true,
5714
- subtree: true,
5715
- attributeOldValue: true,
5716
- characterDataOldValue: true
5717
- });
5718
- // @ts-expect-error
5719
- disposables.push(() => {
5720
- observer.disconnect();
5721
- });
5722
- })]);
5723
- for (const disposable of disposables) {
5724
- // @ts-expect-error
5725
- disposable();
5726
- }
5727
- }
5728
- };
5729
5757
  const performAction = async (locator, fnName, options) => {
5730
5758
  object(locator);
5731
5759
  string(fnName);
5732
5760
  object(options);
5733
- const startTime = Time.getTimeStamp();
5761
+ const startTime = getTimeStamp();
5734
5762
  const endTime = startTime + maxTimeout;
5735
5763
  let currentTime = startTime;
5736
5764
  const fn = ElementActions[fnName];
@@ -5743,8 +5771,8 @@ const performAction = async (locator, fnName, options) => {
5743
5771
  fn(element, options);
5744
5772
  return;
5745
5773
  }
5746
- await Timeout.waitForMutation(100);
5747
- currentTime = Time.getTimeStamp();
5774
+ await waitForMutation(100);
5775
+ currentTime = getTimeStamp();
5748
5776
  }
5749
5777
  };
5750
5778
  const performKeyBoardAction = (fnName, options) => {
@@ -5758,7 +5786,7 @@ class AssertionError extends Error {
5758
5786
  }
5759
5787
  }
5760
5788
  const checkSingleElementCondition = async (locator, fnName, options) => {
5761
- const startTime = Time.getTimeStamp();
5789
+ const startTime = getTimeStamp();
5762
5790
  const endTime = startTime + maxTimeout;
5763
5791
  let currentTime = startTime;
5764
5792
  const fn = SingleElementConditions[fnName];
@@ -5773,15 +5801,15 @@ const checkSingleElementCondition = async (locator, fnName, options) => {
5773
5801
  return;
5774
5802
  }
5775
5803
  }
5776
- await Timeout.waitForMutation(100);
5777
- currentTime = Time.getTimeStamp();
5804
+ await waitForMutation(100);
5805
+ currentTime = getTimeStamp();
5778
5806
  }
5779
5807
  const errorMessageFn = getFunction(fnName);
5780
5808
  const message = errorMessageFn(locator, options);
5781
5809
  throw new AssertionError(message);
5782
5810
  };
5783
5811
  const checkMultiElementCondition = async (locator, fnName, options) => {
5784
- const startTime = Time.getTimeStamp();
5812
+ const startTime = getTimeStamp();
5785
5813
  const endTime = startTime + maxTimeout;
5786
5814
  let currentTime = startTime;
5787
5815
  const fn = MultiElementConditions[fnName];
@@ -5791,8 +5819,8 @@ const checkMultiElementCondition = async (locator, fnName, options) => {
5791
5819
  if (successful) {
5792
5820
  return;
5793
5821
  }
5794
- await Timeout.waitForMutation(100);
5795
- currentTime = Time.getTimeStamp();
5822
+ await waitForMutation(100);
5823
+ currentTime = getTimeStamp();
5796
5824
  }
5797
5825
  const errorMessageFn = getFunction(fnName);
5798
5826
  const message = errorMessageFn(locator, options);
@@ -5800,12 +5828,11 @@ const checkMultiElementCondition = async (locator, fnName, options) => {
5800
5828
  };
5801
5829
 
5802
5830
  const name$a = 'TestFrameWork';
5803
-
5804
- // prettier-ignore
5805
5831
  const Commands$b = {
5806
5832
  checkMultiElementCondition: checkMultiElementCondition,
5807
5833
  checkSingleElementCondition: checkSingleElementCondition,
5808
5834
  performAction: performAction,
5835
+ performAction2: performAction2,
5809
5836
  performKeyBoardAction: performKeyBoardAction,
5810
5837
  showOverlay: showOverlay
5811
5838
  };
@@ -5938,8 +5965,6 @@ const load$1 = moduleId => {
5938
5965
  return Promise.resolve().then(function () { return ViewletEmpty; });
5939
5966
  case Error$2:
5940
5967
  return Promise.resolve().then(function () { return ViewletError; });
5941
- case Explorer:
5942
- return Promise.resolve().then(function () { return ViewletExplorer; });
5943
5968
  case Extensions:
5944
5969
  return Promise.resolve().then(function () { return ViewletExtensions; });
5945
5970
  case FindWidget:
@@ -6017,7 +6042,7 @@ const load$1 = moduleId => {
6017
6042
  }
6018
6043
  };
6019
6044
 
6020
- const create$x = (id, uid = id) => {
6045
+ const create$w = (id, uid = id) => {
6021
6046
  const module = state$6.modules[id];
6022
6047
  if (!module) {
6023
6048
  throw new Error(`module not found: ${id}`);
@@ -6240,7 +6265,7 @@ const sendMultiple = commands => {
6240
6265
  }
6241
6266
  case 'Viewlet.create':
6242
6267
  {
6243
- create$x(viewletId, method);
6268
+ create$w(viewletId, method);
6244
6269
  break;
6245
6270
  }
6246
6271
  case 'Viewlet.createFunctionalRoot':
@@ -6257,7 +6282,7 @@ const sendMultiple = commands => {
6257
6282
  }
6258
6283
  case 'Viewlet.dispose':
6259
6284
  {
6260
- dispose$d(viewletId);
6285
+ dispose$c(viewletId);
6261
6286
  break;
6262
6287
  }
6263
6288
  case 'Viewlet.setPatches':
@@ -6275,7 +6300,7 @@ const sendMultiple = commands => {
6275
6300
  case 'Viewlet.handleError':
6276
6301
  {
6277
6302
  // @ts-expect-error
6278
- handleError$6(viewletId, method, ...args);
6303
+ handleError$5(viewletId, method, ...args);
6279
6304
  break;
6280
6305
  }
6281
6306
  case 'Viewlet.focus':
@@ -6327,7 +6352,7 @@ const sendMultiple = commands => {
6327
6352
  }
6328
6353
  }
6329
6354
  };
6330
- const dispose$d = id => {
6355
+ const dispose$c = id => {
6331
6356
  try {
6332
6357
  number(id);
6333
6358
  const {
@@ -6349,7 +6374,7 @@ const dispose$d = id => {
6349
6374
  throw new Error(`Failed to dispose ${id}`);
6350
6375
  }
6351
6376
  };
6352
- const handleError$6 = (id, parentId, message) => {
6377
+ const handleError$5 = (id, parentId, message) => {
6353
6378
  info(`[viewlet-error] ${id}: ${message}`);
6354
6379
  const instance = state$6.instances[id];
6355
6380
  if (instance?.state.$Viewlet.isConnected) {
@@ -6452,13 +6477,13 @@ const appendToBody = childId => {
6452
6477
  const getFn = command => {
6453
6478
  switch (command) {
6454
6479
  case 'Viewlet.create':
6455
- return create$x;
6480
+ return create$w;
6456
6481
  case 'Viewlet.send':
6457
6482
  return invoke;
6458
6483
  case 'Viewlet.show':
6459
6484
  return show;
6460
6485
  case 'Viewlet.dispose':
6461
- return dispose$d;
6486
+ return dispose$c;
6462
6487
  case 'Viewlet.setDom2':
6463
6488
  return setDom2;
6464
6489
  case 'Viewlet.setBounds':
@@ -6524,12 +6549,12 @@ const name$8 = 'Viewlet';
6524
6549
  const Commands$9 = {
6525
6550
  addKeyBindings: addKeyBindings,
6526
6551
  appendViewlet: appendViewlet,
6527
- dispose: dispose$d,
6552
+ dispose: dispose$c,
6528
6553
  executeCommands: executeCommands,
6529
6554
  focus: focus$f,
6530
6555
  focusElementByName: focusElementByName,
6531
6556
  focusSelector: focusSelector,
6532
- handleError: handleError$6,
6557
+ handleError: handleError$5,
6533
6558
  invoke: invoke,
6534
6559
  loadModule: loadModule,
6535
6560
  refresh: refresh$4,
@@ -6823,7 +6848,7 @@ const waitForFrameToLoad = $Frame => {
6823
6848
  };
6824
6849
 
6825
6850
  // TODO could use browser view when running in electron
6826
- const create$w = async (uid, src, sandbox, csp, credentialless, permissionPolicy, title) => {
6851
+ const create$v = async (uid, src, sandbox, csp, credentialless, permissionPolicy, title) => {
6827
6852
  const $Iframe = document.createElement('iframe');
6828
6853
  setIframeCredentialless($Iframe, credentialless);
6829
6854
  setIframeCsp($Iframe, csp);
@@ -6876,7 +6901,7 @@ const setPort$2 = (uid, port, origin, portType) => {
6876
6901
  params: [port, portType]
6877
6902
  }, origin, [port]);
6878
6903
  };
6879
- const dispose$c = uid => {
6904
+ const dispose$b = uid => {
6880
6905
  const $Iframe = get(uid);
6881
6906
  $Iframe.remove();
6882
6907
  remove(uid);
@@ -6884,12 +6909,12 @@ const dispose$c = uid => {
6884
6909
 
6885
6910
  const name = 'WebView';
6886
6911
  const Commands$1 = {
6887
- create: create$w,
6912
+ create: create$v,
6888
6913
  load: load,
6889
6914
  loadOnly: loadOnly,
6890
6915
  appendOnly: appendOnly,
6891
6916
  setPort: setPort$2,
6892
- dispose: dispose$c
6917
+ dispose: dispose$b
6893
6918
  };
6894
6919
 
6895
6920
  const WebView_ipc = {
@@ -6931,10 +6956,10 @@ const handleMouseDown$2 = event => {
6931
6956
  const index = getNodeIndex($Item);
6932
6957
  return ['handleClick', button, index, clientX, clientY];
6933
6958
  };
6934
- const handleBlur$8 = () => {
6959
+ const handleBlur$7 = () => {
6935
6960
  return ['handleBlur'];
6936
6961
  };
6937
- const handleFocus$9 = () => {
6962
+ const handleFocus$8 = () => {
6938
6963
  return ['handleFocus'];
6939
6964
  };
6940
6965
 
@@ -6953,18 +6978,18 @@ const returnValue$5 = true;
6953
6978
 
6954
6979
  const ViewletActivityBarEvents = {
6955
6980
  __proto__: null,
6956
- handleBlur: handleBlur$8,
6981
+ handleBlur: handleBlur$7,
6957
6982
  handleContextMenu: handleContextMenu$9,
6958
- handleFocus: handleFocus$9,
6983
+ handleFocus: handleFocus$8,
6959
6984
  handleMouseDown: handleMouseDown$2,
6960
6985
  returnValue: returnValue$5
6961
6986
  };
6962
6987
 
6963
- const Events$9 = ViewletActivityBarEvents;
6988
+ const Events$8 = ViewletActivityBarEvents;
6964
6989
 
6965
6990
  const ViewletActivityBar = {
6966
6991
  __proto__: null,
6967
- Events: Events$9
6992
+ Events: Events$8
6968
6993
  };
6969
6994
 
6970
6995
  const handleAudioError = event => {
@@ -6987,14 +7012,14 @@ const ViewletAudioEvents = {
6987
7012
  handleAudioError
6988
7013
  };
6989
7014
 
6990
- const Events$8 = ViewletAudioEvents;
7015
+ const Events$7 = ViewletAudioEvents;
6991
7016
 
6992
7017
  const ViewletAudio = {
6993
7018
  __proto__: null,
6994
- Events: Events$8
7019
+ Events: Events$7
6995
7020
  };
6996
7021
 
6997
- const create$v = () => {
7022
+ const create$u = () => {
6998
7023
  const $Viewlet = document.createElement('div');
6999
7024
  $Viewlet.className = 'Viewlet BrowserViewOverview';
7000
7025
  return {
@@ -7010,18 +7035,18 @@ const setDom$5 = (state, dom) => {
7010
7035
 
7011
7036
  const ViewletBrowserViewOverview = {
7012
7037
  __proto__: null,
7013
- create: create$v,
7038
+ create: create$u,
7014
7039
  setDom: setDom$5
7015
7040
  };
7016
7041
 
7017
- const create$u = () => {
7042
+ const create$t = () => {
7018
7043
  const $Viewlet = document.createElement('div');
7019
7044
  $Viewlet.className = 'Viewlet Clock';
7020
7045
  return {
7021
7046
  $Viewlet
7022
7047
  };
7023
7048
  };
7024
- const dispose$b = state => {};
7049
+ const dispose$a = state => {};
7025
7050
  const refresh$3 = () => {};
7026
7051
  const setTime = (state, time) => {
7027
7052
  object(state);
@@ -7031,8 +7056,8 @@ const setTime = (state, time) => {
7031
7056
 
7032
7057
  const ViewletClock = {
7033
7058
  __proto__: null,
7034
- create: create$u,
7035
- dispose: dispose$b,
7059
+ create: create$t,
7060
+ dispose: dispose$a,
7036
7061
  refresh: refresh$3,
7037
7062
  setTime
7038
7063
  };
@@ -7047,18 +7072,18 @@ const handleInput$4 = event => {
7047
7072
  } = target;
7048
7073
  handleInput$7(uid, value);
7049
7074
  };
7050
- const handleFocus$8 = event => {
7075
+ const handleFocus$7 = event => {
7051
7076
  const uid = fromEvent(event);
7052
- handleFocus$b(uid);
7077
+ handleFocus$a(uid);
7053
7078
  };
7054
7079
 
7055
7080
  const ViewletDebugConsoleEvents = {
7056
7081
  __proto__: null,
7057
- handleFocus: handleFocus$8,
7082
+ handleFocus: handleFocus$7,
7058
7083
  handleInput: handleInput$4
7059
7084
  };
7060
7085
 
7061
- const create$t = () => {
7086
+ const create$s = () => {
7062
7087
  const $Viewlet = document.createElement('div');
7063
7088
  $Viewlet.className = 'Viewlet DebugConsole';
7064
7089
  return {
@@ -7074,7 +7099,7 @@ const setDom$4 = (state, dom) => {
7074
7099
 
7075
7100
  const ViewletDebugConsole = {
7076
7101
  __proto__: null,
7077
- create: create$t,
7102
+ create: create$s,
7078
7103
  setDom: setDom$4
7079
7104
  };
7080
7105
 
@@ -7091,14 +7116,14 @@ const handleKeyDown$3 = event => {
7091
7116
  } = event;
7092
7117
  handleKeyDown$5(uid, key, altKey, ctrlKey, shiftKey, metaKey);
7093
7118
  };
7094
- const handleBlur$7 = event => {
7119
+ const handleBlur$6 = event => {
7095
7120
  const uid = fromEvent(event);
7096
- handleBlur$b(uid);
7121
+ handleBlur$a(uid);
7097
7122
  };
7098
7123
 
7099
7124
  const ViewletDefineKeyBindingEvents = {
7100
7125
  __proto__: null,
7101
- handleBlur: handleBlur$7,
7126
+ handleBlur: handleBlur$6,
7102
7127
  handleKeyDown: handleKeyDown$3
7103
7128
  };
7104
7129
 
@@ -7135,7 +7160,7 @@ const setMaskImage = ($Element, icon) => {
7135
7160
  }
7136
7161
  };
7137
7162
 
7138
- const create$s = icon => {
7163
+ const create$r = icon => {
7139
7164
  const $Icon = document.createElement('div');
7140
7165
  $Icon.className = 'MaskIcon';
7141
7166
  setMaskImage($Icon, icon);
@@ -7145,7 +7170,7 @@ const create$s = icon => {
7145
7170
 
7146
7171
  const create$Button = (label, icon) => {
7147
7172
  // TODO icon div might not be needed (unnecessary html element)
7148
- const $Icon = create$s(icon);
7173
+ const $Icon = create$r(icon);
7149
7174
  const $Button = document.createElement('button');
7150
7175
  $Button.className = 'IconButton';
7151
7176
  $Button.title = label;
@@ -7154,19 +7179,19 @@ const create$Button = (label, icon) => {
7154
7179
  return $Button;
7155
7180
  };
7156
7181
 
7157
- const handleClick$6 = index => {
7182
+ const handleClick$5 = index => {
7158
7183
  send(/* Dialog.handleClick */'Dialog.handleClick', /* index */index);
7159
7184
  };
7160
7185
 
7161
- const handleClick$5 = event => {
7186
+ const handleClick$4 = event => {
7162
7187
  const {
7163
7188
  target
7164
7189
  } = event;
7165
7190
  const index = getNodeIndex(target);
7166
- handleClick$6(index);
7191
+ handleClick$5(index);
7167
7192
  };
7168
7193
 
7169
- const create$r = () => {
7194
+ const create$q = () => {
7170
7195
  const $DialogTitle = document.createElement('h2');
7171
7196
  $DialogTitle.id = 'DialogTitle';
7172
7197
  const $DialogCloseButton = create$Button('Close', 'Close');
@@ -7193,7 +7218,7 @@ const create$r = () => {
7193
7218
  $Dialog.setAttribute(AriaLabelledBy, 'DialogTitle');
7194
7219
  $Dialog.setAttribute(AriaDescribedBy, 'DialogBodyErrorMessage');
7195
7220
  $Dialog.append($DialogHeader, $DialogBody);
7196
- $Dialog.onclick = handleClick$5;
7221
+ $Dialog.onclick = handleClick$4;
7197
7222
  return {
7198
7223
  $Viewlet: $Dialog,
7199
7224
  $DialogTitle,
@@ -7247,7 +7272,7 @@ const setErrorStack = (state, errorStack) => {
7247
7272
 
7248
7273
  const ViewletDialog = {
7249
7274
  __proto__: null,
7250
- create: create$r,
7275
+ create: create$q,
7251
7276
  postAppend,
7252
7277
  setButtons,
7253
7278
  setCodeFrame,
@@ -7294,7 +7319,7 @@ const ViewletDiffEditor = {
7294
7319
 
7295
7320
  // TODO aria alert
7296
7321
 
7297
- const create$q = () => {
7322
+ const create$p = () => {
7298
7323
  const $Viewlet = document.createElement('div');
7299
7324
  $Viewlet.className = 'Viewlet EditorError';
7300
7325
  return {
@@ -7316,7 +7341,7 @@ const setBounds$1 = (state, x, y, width, height) => {
7316
7341
 
7317
7342
  const ViewletEditorError = {
7318
7343
  __proto__: null,
7319
- create: create$q,
7344
+ create: create$p,
7320
7345
  setBounds: setBounds$1,
7321
7346
  setDom: setDom$3
7322
7347
  };
@@ -7364,7 +7389,7 @@ const handlePointerCaptureLost$1 = event => {
7364
7389
  /**
7365
7390
  * @param {PointerEvent} event
7366
7391
  */
7367
- const handlePointerDown$5 = event => {
7392
+ const handlePointerDown$4 = event => {
7368
7393
  const {
7369
7394
  pointerId,
7370
7395
  clientX,
@@ -7380,7 +7405,7 @@ const handlePointerDown$5 = event => {
7380
7405
  target.addEventListener(PointerUp, handlePointerUp);
7381
7406
  target.addEventListener(LostPointerCapture, handlePointerCaptureLost$1);
7382
7407
  const uid = fromEvent(event);
7383
- handlePointerDown$6(uid, pointerId, clientX, clientY);
7408
+ handlePointerDown$5(uid, pointerId, clientX, clientY);
7384
7409
  };
7385
7410
 
7386
7411
  /**
@@ -7411,16 +7436,16 @@ const handleContextMenu$8 = event => {
7411
7436
  const uid = fromEvent(event);
7412
7437
  handleContextMenu$b(uid, button, clientX, clientY);
7413
7438
  };
7414
- const handleError$5 = event => {
7439
+ const handleError$4 = event => {
7415
7440
  const uid = fromEvent(event);
7416
7441
  handleImageError$1(uid);
7417
7442
  };
7418
- const handleFocus$7 = event => {
7443
+ const handleFocus$6 = event => {
7419
7444
  const uid = fromEvent(event);
7420
- handleFocus$b(uid);
7445
+ handleFocus$a(uid);
7421
7446
  };
7422
7447
 
7423
- const create$p = () => {
7448
+ const create$o = () => {
7424
7449
  const $Viewlet = document.createElement('div');
7425
7450
  $Viewlet.className = 'Viewlet EditorImage';
7426
7451
  return {
@@ -7432,12 +7457,12 @@ const attachEvents$8 = state => {
7432
7457
  $Viewlet
7433
7458
  } = state;
7434
7459
  attachEvents$c($Viewlet, {
7435
- [PointerDown]: handlePointerDown$5,
7460
+ [PointerDown]: handlePointerDown$4,
7436
7461
  [PointerUp]: handlePointerUp,
7437
7462
  [ContextMenu]: handleContextMenu$8,
7438
- [FocusIn]: handleFocus$7
7463
+ [FocusIn]: handleFocus$6
7439
7464
  });
7440
- $Viewlet.addEventListener(Error$3, handleError$5, Capture);
7465
+ $Viewlet.addEventListener(Error$3, handleError$4, Capture);
7441
7466
  $Viewlet.addEventListener(Wheel, handleWheel$1, Passive);
7442
7467
  };
7443
7468
  const setTransform = (state, transform) => {
@@ -7463,13 +7488,13 @@ const setDom$2 = (state, dom) => {
7463
7488
  const ViewletEditorImage = {
7464
7489
  __proto__: null,
7465
7490
  attachEvents: attachEvents$8,
7466
- create: create$p,
7491
+ create: create$o,
7467
7492
  setDom: setDom$2,
7468
7493
  setDragging,
7469
7494
  setTransform
7470
7495
  };
7471
7496
 
7472
- const create$o = () => {
7497
+ const create$n = () => {
7473
7498
  const $Viewlet = document.createElement('div');
7474
7499
  $Viewlet.className = 'Viewlet EditorText';
7475
7500
  $Viewlet.textContent = 'loading...';
@@ -7477,7 +7502,7 @@ const create$o = () => {
7477
7502
  $Viewlet
7478
7503
  };
7479
7504
  };
7480
- const dispose$a = state => {};
7505
+ const dispose$9 = state => {};
7481
7506
  const refresh$2 = (state, context) => {
7482
7507
  object(state);
7483
7508
  string(context.content);
@@ -7486,8 +7511,8 @@ const refresh$2 = (state, context) => {
7486
7511
 
7487
7512
  const ViewletEditorPlainText = {
7488
7513
  __proto__: null,
7489
- create: create$o,
7490
- dispose: dispose$a,
7514
+ create: create$n,
7515
+ dispose: dispose$9,
7491
7516
  refresh: refresh$2
7492
7517
  };
7493
7518
 
@@ -7550,10 +7575,10 @@ const attachEventsFunctional = ($Node, eventMap) => {
7550
7575
  }
7551
7576
  };
7552
7577
 
7553
- const Text$1 = 'text';
7578
+ const Text = 'text';
7554
7579
 
7555
7580
  const getText = clipBoardData => {
7556
- return clipBoardData.getData(Text$1);
7581
+ return clipBoardData.getData(Text);
7557
7582
  };
7558
7583
 
7559
7584
  const detachEvent = ($Node, key, listener) => {
@@ -7605,7 +7630,7 @@ const toSimpleTouchEvent = event => {
7605
7630
 
7606
7631
  // TODO tree shake out mobile support when targeting electron -> less code -> less event listeners -> less memory -> less cpu
7607
7632
 
7608
- const handleFocus$6 = event => {
7633
+ const handleFocus$5 = event => {
7609
7634
  return ['handleFocus'];
7610
7635
  };
7611
7636
  const handleMouseMove = event => {
@@ -7616,7 +7641,7 @@ const handleMouseMove = event => {
7616
7641
  } = event;
7617
7642
  return ['handleMouseMove', clientX, clientY, altKey];
7618
7643
  };
7619
- const handleBlur$6 = event => {
7644
+ const handleBlur$5 = event => {
7620
7645
  // needed for save on blur
7621
7646
  // also needed to close completions on blur
7622
7647
  return ['handleBlur'];
@@ -7745,7 +7770,7 @@ const handlePaste = event => {
7745
7770
  const text = getText(clipboardData);
7746
7771
  return ['paste', text];
7747
7772
  };
7748
- const handleScrollBarVerticalPointerDown = create$K(event => {
7773
+ const handleScrollBarVerticalPointerDown = create$J(event => {
7749
7774
  const {
7750
7775
  clientY
7751
7776
  } = event;
@@ -7868,7 +7893,7 @@ const setLineInfos = (state, dom) => {
7868
7893
  // 1. create -> only create dom elements
7869
7894
  // 2. render -> fill elements with attributes and data
7870
7895
  // that way all dom nodes can be recycled
7871
- const create$n = () => {
7896
+ const create$m = () => {
7872
7897
  const $EditorInput = document.createElement('textarea');
7873
7898
  $EditorInput.className = 'EditorInput';
7874
7899
  $EditorInput.ariaAutoComplete = List;
@@ -7886,8 +7911,8 @@ const create$n = () => {
7886
7911
  [CompositionStart]: handleCompositionStart,
7887
7912
  [CompositionUpdate]: handleCompositionUpdate,
7888
7913
  [CompositionEnd]: handleCompositionEnd,
7889
- [Focus]: handleFocus$6,
7890
- [Blur]: handleBlur$6,
7914
+ [Focus]: handleFocus$5,
7915
+ [Blur]: handleBlur$5,
7891
7916
  [Cut]: handleCut,
7892
7917
  [Paste]: handlePaste,
7893
7918
  returnValue: true
@@ -8035,11 +8060,11 @@ const setDecorationsDom$1 = (state, decorations) => {
8035
8060
  setDecorationsDom$2(state, decorations);
8036
8061
  };
8037
8062
 
8038
- const create$m = create$n;
8063
+ const create$l = create$m;
8039
8064
  const setText$1 = setText$2;
8040
8065
  const setSelections = setSelections$1;
8041
8066
  const setIncrementalEdits = setIncrementalEdits$1;
8042
- const handleError$4 = (state, error) => {
8067
+ const handleError$3 = (state, error) => {
8043
8068
  state.$Viewlet.textContent = error;
8044
8069
  };
8045
8070
  const setScrollBar = setScrollBar$1;
@@ -8077,9 +8102,9 @@ const setDecorationsDom = setDecorationsDom$1;
8077
8102
 
8078
8103
  const ViewletEditorText = {
8079
8104
  __proto__: null,
8080
- create: create$m,
8105
+ create: create$l,
8081
8106
  focus: focus$d,
8082
- handleError: handleError$4,
8107
+ handleError: handleError$3,
8083
8108
  hideOverlayMessage,
8084
8109
  highlightAsLink,
8085
8110
  renderGutter,
@@ -8093,7 +8118,7 @@ const ViewletEditorText = {
8093
8118
  showOverlayMessage
8094
8119
  };
8095
8120
 
8096
- const create$l = () => {
8121
+ const create$k = () => {
8097
8122
  const $Viewlet = document.createElement('div');
8098
8123
  $Viewlet.className = 'Viewlet EditorWidgetError EditorOverlayMessage';
8099
8124
  return {
@@ -8116,12 +8141,12 @@ const setBounds = (state, x, y, width, height) => {
8116
8141
 
8117
8142
  const ViewletEditorWidgetError = {
8118
8143
  __proto__: null,
8119
- create: create$l,
8144
+ create: create$k,
8120
8145
  setBounds,
8121
8146
  setMessage: setMessage$3
8122
8147
  };
8123
8148
 
8124
- const create$k = () => {
8149
+ const create$j = () => {
8125
8150
  const $Viewlet = document.createElement('div');
8126
8151
  $Viewlet.dataset.viewlet = 'Empty';
8127
8152
  $Viewlet.className = 'Viewlet';
@@ -8131,17 +8156,17 @@ const create$k = () => {
8131
8156
  };
8132
8157
  const refresh$1 = (state, context) => {};
8133
8158
  const focus$c = state => {};
8134
- const dispose$9 = state => {};
8159
+ const dispose$8 = state => {};
8135
8160
 
8136
8161
  const ViewletEmpty = {
8137
8162
  __proto__: null,
8138
- create: create$k,
8139
- dispose: dispose$9,
8163
+ create: create$j,
8164
+ dispose: dispose$8,
8140
8165
  focus: focus$c,
8141
8166
  refresh: refresh$1
8142
8167
  };
8143
8168
 
8144
- const create$j = () => {
8169
+ const create$i = () => {
8145
8170
  const $Viewlet = document.createElement('div');
8146
8171
  $Viewlet.className = 'Viewlet Error';
8147
8172
  return {
@@ -8157,10 +8182,12 @@ const setMessage$2 = (state, message) => {
8157
8182
 
8158
8183
  const ViewletError = {
8159
8184
  __proto__: null,
8160
- create: create$j,
8185
+ create: create$i,
8161
8186
  setMessage: setMessage$2
8162
8187
  };
8163
8188
 
8189
+ const Polite = 'polite';
8190
+
8164
8191
  const handleContextMenu$6 = event => {
8165
8192
  preventDefault(event);
8166
8193
  const {
@@ -8172,274 +8199,6 @@ const handleContextMenu$6 = event => {
8172
8199
  handleContextMenu$b(uid, button, clientX, clientY);
8173
8200
  };
8174
8201
 
8175
- const CopyMove = 'copyMove';
8176
-
8177
- const Text = 'text';
8178
- const ResourceUrls = 'resourceurls';
8179
-
8180
- const setEffectAllowed = (dataTransfer, effectAllowed) => {
8181
- object(dataTransfer);
8182
- string(effectAllowed);
8183
- dataTransfer.effectAllowed = effectAllowed;
8184
- };
8185
- const setFilePath = (dataTransfer, filePath, fileName) => {
8186
- dataTransfer.setData(ResourceUrls, JSON.stringify([filePath]));
8187
- dataTransfer.setData(Text, filePath);
8188
- const dragImage = document.createElement('div');
8189
- dragImage.className = 'DragImage';
8190
- // if (Browser.getBrowser() !== 'chromium') {
8191
- // // chrome doesn't support border radius
8192
- // dragImage.style.borderRadius = '100px'
8193
- // }
8194
- dragImage.textContent = fileName;
8195
- document.body.append(dragImage);
8196
- dataTransfer.setDragImage(dragImage, -10, -10);
8197
- const handleTimeOut = () => {
8198
- dragImage.remove();
8199
- };
8200
- setTimeout(handleTimeOut, 0);
8201
- };
8202
- const getFilePaths = dataTransfer => {
8203
- const data = dataTransfer.getData(ResourceUrls);
8204
- if (data) {
8205
- const parsed = JSON.parse(data);
8206
- if (Array.isArray(parsed) && data.length > 0) {
8207
- return parsed;
8208
- }
8209
- }
8210
- return [];
8211
- };
8212
- const getFilePath = dataTransfer => {
8213
- const filePaths = getFilePaths(dataTransfer);
8214
- if (filePaths.length === 0) {
8215
- return '';
8216
- }
8217
- return filePaths[0];
8218
- };
8219
-
8220
- const handleDragStart$1 = event => {
8221
- const {
8222
- dataTransfer,
8223
- target
8224
- } = event;
8225
- // @ts-ignore
8226
- setEffectAllowed(dataTransfer, CopyMove);
8227
-
8228
- // @ts-ignore
8229
- if (target.classList.contains('TreeItem')) {
8230
- // @ts-ignore
8231
- const filePath = target.title;
8232
- // @ts-ignore
8233
- const fileName = target.textContent;
8234
- setFilePath(dataTransfer, filePath, fileName);
8235
- }
8236
- };
8237
- const handleDragOver$1 = event => {
8238
- preventDefault(event);
8239
- const {
8240
- clientX,
8241
- clientY
8242
- } = event;
8243
- const uid = fromEvent(event);
8244
- handleDragOver$2(uid, clientX, clientY);
8245
- };
8246
- const handleDragEnd = event => {
8247
- const {
8248
- clientX,
8249
- clientY
8250
- } = event;
8251
- const uid = fromEvent(event);
8252
- handleDragEnd$1(uid, clientX, clientY);
8253
- };
8254
- const handleDragLeave = event => {
8255
- const {
8256
- clientX,
8257
- clientY
8258
- } = event;
8259
- const uid = fromEvent(event);
8260
- handleDragLeave$1(uid, clientX, clientY);
8261
- };
8262
-
8263
- /**
8264
- *
8265
- * @param {DragEvent} event
8266
- */
8267
- const handleDrop$1 = event => {
8268
- preventDefault(event);
8269
- const {
8270
- dataTransfer,
8271
- clientX,
8272
- clientY
8273
- } = event;
8274
- const {
8275
- files
8276
- } = dataTransfer;
8277
- const uid = fromEvent(event);
8278
- if (files.length > 0) {
8279
- return handleDropFiles(uid, clientX, clientY, files);
8280
- }
8281
- const filePath = getFilePath(dataTransfer);
8282
- if (filePath) {
8283
- handleDropFilePath(uid, clientX, clientY, filePath);
8284
- }
8285
- };
8286
-
8287
- // TODO put drop into separate module and use executeCommand to call it
8288
-
8289
- // TODO drag and drop should be loaded on demand
8290
-
8291
- const handleFocus$5 = event => {
8292
- const {
8293
- target,
8294
- isTrusted
8295
- } = event;
8296
- if (!isTrusted || target.className === 'InputBox') {
8297
- return;
8298
- }
8299
- const uid = fromEvent(event);
8300
- handleFocus$b(uid);
8301
- };
8302
- const handleBlur$5 = event => {
8303
- const uid = fromEvent(event);
8304
- handleBlur$b(uid);
8305
- };
8306
- const handleClick$4 = event => {
8307
- preventDefault(event);
8308
- const {
8309
- button,
8310
- clientX,
8311
- clientY
8312
- } = event;
8313
- const uid = fromEvent(event);
8314
- handleClickAt$3(uid, button, clientX, clientY);
8315
- };
8316
- const handleClickOpenFolder = event => {
8317
- preventDefault(event);
8318
- const uid = fromEvent(event);
8319
- handleClickOpenFolder$1(uid);
8320
- };
8321
- const handlePointerDown$4 = event => {
8322
- const {
8323
- button,
8324
- clientX,
8325
- clientY
8326
- } = event;
8327
- const uid = fromEvent(event);
8328
- handlePointerDown$6(uid, button, clientX, clientY);
8329
- };
8330
- const handleMouseEnter = event => {
8331
- // const $Target = event.target
8332
- // const index = findIndex($Target)
8333
- // if (index === -1) {
8334
- // return
8335
- // }
8336
- // RendererWorker.send(
8337
- // /* Explorer.handleMouseEnter */ 'Explorer.handleMouseEnter',
8338
- // /* index */ index
8339
- // )
8340
- };
8341
- const handleMouseLeave = event => {
8342
- // const $Target = event.target
8343
- // const index = findIndex($Target)
8344
- // if (index === -1) {
8345
- // return
8346
- // }
8347
- // RendererWorker.send(
8348
- // /* Explorer.handleMouseLeave */ 'Explorer.handleMouseLeave',
8349
- // /* index */ index
8350
- // )
8351
- };
8352
- const handleEditingInput = event => {
8353
- const {
8354
- target
8355
- } = event;
8356
- const {
8357
- value
8358
- } = target;
8359
- const uid = fromEvent(event);
8360
- updateEditingValue(uid, value);
8361
- };
8362
-
8363
- const ViewletExplorerEvents = {
8364
- __proto__: null,
8365
- handleBlur: handleBlur$5,
8366
- handleClick: handleClick$4,
8367
- handleClickOpenFolder,
8368
- handleContextMenu: handleContextMenu$6,
8369
- handleDragEnd,
8370
- handleDragLeave,
8371
- handleDragOver: handleDragOver$1,
8372
- handleDragStart: handleDragStart$1,
8373
- handleDrop: handleDrop$1,
8374
- handleEditingInput,
8375
- handleFocus: handleFocus$5,
8376
- handleMouseEnter,
8377
- handleMouseLeave,
8378
- handlePointerDown: handlePointerDown$4,
8379
- handleWheel: handleWheel$2
8380
- };
8381
-
8382
- const create$i = () => {
8383
- const $Viewlet = document.createElement('div');
8384
- $Viewlet.className = 'Viewlet Explorer';
8385
- $Viewlet.tabIndex = 0;
8386
- $Viewlet.role = Tree;
8387
- $Viewlet.ariaLabel = 'Files Explorer';
8388
- return {
8389
- $Viewlet
8390
- };
8391
- };
8392
- const Events$7 = ViewletExplorerEvents;
8393
- const handleError$3 = (state, message) => {
8394
- object(state);
8395
- string(message);
8396
- const {
8397
- $Viewlet
8398
- } = state;
8399
- $Viewlet.textContent = message;
8400
- };
8401
- const focusInput = (state, id) => {
8402
- const $Input = document.getElementById(id);
8403
- if (!$Input) {
8404
- return;
8405
- }
8406
- $Input.focus();
8407
- send('Focus.setFocus', FocusExplorerEditBox);
8408
- };
8409
- const dispose$8 = state => {};
8410
- const setDropTargets = (state, oldDropTargets, newDropTargets) => {
8411
- // TODO use virtual dom for this
8412
- const {
8413
- $Viewlet
8414
- } = state;
8415
- for (const oldIndex of oldDropTargets) {
8416
- if (oldIndex === -1) {
8417
- $Viewlet.classList.remove('DropTarget');
8418
- } else {
8419
- $Viewlet.children[oldIndex].classList.remove('DropTarget');
8420
- }
8421
- }
8422
- for (const newIndex of newDropTargets) {
8423
- if (newIndex === -1) {
8424
- $Viewlet.classList.add('DropTarget');
8425
- } else {
8426
- $Viewlet.children[newIndex].classList.add('DropTarget');
8427
- }
8428
- }
8429
- };
8430
-
8431
- const ViewletExplorer = {
8432
- __proto__: null,
8433
- Events: Events$7,
8434
- create: create$i,
8435
- dispose: dispose$8,
8436
- focusInput,
8437
- handleError: handleError$3,
8438
- setDropTargets
8439
- };
8440
-
8441
- const Polite = 'polite';
8442
-
8443
8202
  const handleScrollBarThumbPointerMove = event => {
8444
8203
  const {
8445
8204
  clientY
@@ -8468,7 +8227,7 @@ const handleScrollBarPointerDown$1 = event => {
8468
8227
  };
8469
8228
  const handleFocus$4 = event => {
8470
8229
  const uid = fromEvent(event);
8471
- handleFocus$b(uid);
8230
+ handleFocus$a(uid);
8472
8231
  };
8473
8232
  const handlePointerDown$3 = event => {
8474
8233
  const {
@@ -8481,7 +8240,7 @@ const handlePointerDown$3 = event => {
8481
8240
  }
8482
8241
  const $Extension = target.closest('.ExtensionListItem');
8483
8242
  const index = getNodeIndex($Extension);
8484
- handleClick$7(uid, index);
8243
+ handleClick$6(uid, index);
8485
8244
  };
8486
8245
  const handleInput$3 = event => {
8487
8246
  const $Target = event.target;
@@ -9388,6 +9147,83 @@ const ViewletLayout = {
9388
9147
  setSashes
9389
9148
  };
9390
9149
 
9150
+ const CopyMove = 'copyMove';
9151
+
9152
+ const ResourceUrls = 'resourceurls';
9153
+
9154
+ const setEffectAllowed = (dataTransfer, effectAllowed) => {
9155
+ object(dataTransfer);
9156
+ string(effectAllowed);
9157
+ dataTransfer.effectAllowed = effectAllowed;
9158
+ };
9159
+ const getFilePaths = dataTransfer => {
9160
+ const data = dataTransfer.getData(ResourceUrls);
9161
+ if (data) {
9162
+ const parsed = JSON.parse(data);
9163
+ if (Array.isArray(parsed) && data.length > 0) {
9164
+ return parsed;
9165
+ }
9166
+ }
9167
+ return [];
9168
+ };
9169
+ const getFilePath = dataTransfer => {
9170
+ const filePaths = getFilePaths(dataTransfer);
9171
+ if (filePaths.length === 0) {
9172
+ return '';
9173
+ }
9174
+ return filePaths[0];
9175
+ };
9176
+
9177
+ const handleDragOver$1 = event => {
9178
+ preventDefault(event);
9179
+ const {
9180
+ clientX,
9181
+ clientY
9182
+ } = event;
9183
+ const uid = fromEvent(event);
9184
+ handleDragOver$2(uid, clientX, clientY);
9185
+ };
9186
+ const handleDragEnd = event => {
9187
+ const {
9188
+ clientX,
9189
+ clientY
9190
+ } = event;
9191
+ const uid = fromEvent(event);
9192
+ handleDragEnd$1(uid, clientX, clientY);
9193
+ };
9194
+ const handleDragLeave = event => {
9195
+ const {
9196
+ clientX,
9197
+ clientY
9198
+ } = event;
9199
+ const uid = fromEvent(event);
9200
+ handleDragLeave$1(uid, clientX, clientY);
9201
+ };
9202
+
9203
+ /**
9204
+ *
9205
+ * @param {DragEvent} event
9206
+ */
9207
+ const handleDrop$1 = event => {
9208
+ preventDefault(event);
9209
+ const {
9210
+ dataTransfer,
9211
+ clientX,
9212
+ clientY
9213
+ } = event;
9214
+ const {
9215
+ files
9216
+ } = dataTransfer;
9217
+ const uid = fromEvent(event);
9218
+ if (files.length > 0) {
9219
+ return handleDropFiles(uid, clientX, clientY, files);
9220
+ }
9221
+ const filePath = getFilePath(dataTransfer);
9222
+ if (filePath) {
9223
+ handleDropFilePath(uid, clientX, clientY, filePath);
9224
+ }
9225
+ };
9226
+
9391
9227
  const handleContextMenu$5 = event => {
9392
9228
  if (event.defaultPrevented) {
9393
9229
  return;
@@ -9987,7 +9823,7 @@ const handlePointerDown = event => {
9987
9823
  };
9988
9824
  const handleBlur$2 = event => {
9989
9825
  const uid = fromEvent(event);
9990
- handleBlur$b(uid);
9826
+ handleBlur$a(uid);
9991
9827
  };
9992
9828
 
9993
9829
  // TODO
@@ -10551,7 +10387,7 @@ const ViewletSimpleBrowser = {
10551
10387
 
10552
10388
  const handleFocus = event => {
10553
10389
  const uid = fromEvent(event);
10554
- handleFocus$b(uid);
10390
+ handleFocus$a(uid);
10555
10391
  };
10556
10392
  const getButtonIndex = $Node => {
10557
10393
  let index = -1;
@@ -10582,7 +10418,7 @@ const handleClick$3 = event => {
10582
10418
  if (index === -1) {
10583
10419
  return;
10584
10420
  }
10585
- handleClick$7(uid, index);
10421
+ handleClick$6(uid, index);
10586
10422
  };
10587
10423
  const handleMouseOver = event => {
10588
10424
  const {
@@ -10654,7 +10490,7 @@ const handleClick$2 = event => {
10654
10490
  clientX,
10655
10491
  clientY
10656
10492
  } = event;
10657
- handleClick$7(uid, clientX, clientY);
10493
+ handleClick$6(uid, clientX, clientY);
10658
10494
  };
10659
10495
 
10660
10496
  const ViewletStatusBarEvents = {
@@ -10698,7 +10534,7 @@ const ViewletStatusBar = {
10698
10534
 
10699
10535
  const handleClick$1 = event => {
10700
10536
  const uid = fromEvent(event);
10701
- handleClick$7(uid);
10537
+ handleClick$6(uid);
10702
10538
  };
10703
10539
 
10704
10540
  const ViewletStorageEvents = {
@@ -10804,7 +10640,7 @@ const create$6 = ({
10804
10640
 
10805
10641
  const handleBlur = event => {
10806
10642
  const uid = fromEvent(event);
10807
- handleBlur$b(uid);
10643
+ handleBlur$a(uid);
10808
10644
  };
10809
10645
  const handleMouseDown = (event, ...args) => {
10810
10646
  const uid = fromEvent(event);
@@ -11081,7 +10917,7 @@ const handleClick = event => {
11081
10917
  } = event;
11082
10918
  const index = getIndex(target);
11083
10919
  const uid = fromEvent(event);
11084
- handleClick$7(uid, button, index);
10920
+ handleClick$6(uid, button, index);
11085
10921
  };
11086
10922
  const getLevelAndIndex = event => {
11087
10923
  const {
@@ -11117,7 +10953,7 @@ const handleMenuClick = event => {
11117
10953
  };
11118
10954
  const handleFocusIn = event => {
11119
10955
  const uid = fromEvent(event);
11120
- handleFocus$b(uid);
10956
+ handleFocus$a(uid);
11121
10957
  };
11122
10958
 
11123
10959
  const ViewletTitleBarMenuBarEvents = {
@@ -11562,7 +11398,7 @@ const handleContextMenu$1 = event => {
11562
11398
  } = event;
11563
11399
  return ['handleContextMenu', button, clientX, clientY];
11564
11400
  };
11565
- const handleSashCornerPointerDown = create$K(event => {
11401
+ const handleSashCornerPointerDown = create$J(event => {
11566
11402
  const {
11567
11403
  clientX,
11568
11404
  clientY