@lvce-editor/renderer-process 10.27.0 → 10.28.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.
@@ -19,7 +19,6 @@ const Download = 5;
19
19
  const EditorController = 6;
20
20
  const EditorError$1 = 7;
21
21
  const EditorHover$1 = 8;
22
- const EditorRename$1 = 9;
23
22
  const ImagePreview$2 = 10;
24
23
  const InitData = 11;
25
24
  const Layout$1 = 12;
@@ -91,10 +90,6 @@ const getModuleId = commandId => {
91
90
  return EditorError$1;
92
91
  case 'EditorHover.create':
93
92
  return EditorHover$1;
94
- case 'EditorRename.create':
95
- case 'EditorRename.dispose':
96
- case 'EditorRename.finish':
97
- return EditorRename$1;
98
93
  case 'FilePicker.showDirectoryPicker':
99
94
  case 'FilePicker.showFilePicker':
100
95
  case 'FilePicker.showSaveFilePicker':
@@ -179,6 +174,7 @@ const getModuleId = commandId => {
179
174
  case 'Viewlet.send':
180
175
  case 'Viewlet.sendMultiple':
181
176
  case 'Viewlet.setBounds':
177
+ case 'Viewlet.registerEventListeners':
182
178
  return Viewlet;
183
179
  case 549:
184
180
  case 550:
@@ -349,16 +345,16 @@ const setLoad = load => {
349
345
  };
350
346
 
351
347
  const ipcs = Object.create(null);
352
- const set$7 = (name, ipc) => {
348
+ const set$8 = (name, ipc) => {
353
349
  ipcs[name] = ipc;
354
350
  };
355
- const get$8 = name => {
351
+ const get$9 = name => {
356
352
  return ipcs[name];
357
353
  };
358
354
  const remove$4 = name => {
359
355
  delete ipcs[name];
360
356
  };
361
- const has = name => {
357
+ const has$1 = name => {
362
358
  return ipcs[name];
363
359
  };
364
360
 
@@ -461,10 +457,10 @@ const create$4$1 = (method, params) => {
461
457
  const state$a = {
462
458
  callbacks: Object.create(null)
463
459
  };
464
- const set$6 = (id, fn) => {
460
+ const set$7 = (id, fn) => {
465
461
  state$a.callbacks[id] = fn;
466
462
  };
467
- const get$7 = id => {
463
+ const get$8 = id => {
468
464
  return state$a.callbacks[id];
469
465
  };
470
466
  const remove$3 = id => {
@@ -483,14 +479,14 @@ const registerPromise = () => {
483
479
  resolve,
484
480
  promise
485
481
  } = Promise.withResolvers();
486
- set$6(id, resolve);
482
+ set$7(id, resolve);
487
483
  return {
488
484
  id,
489
485
  promise
490
486
  };
491
487
  };
492
488
  const resolve = (id, response) => {
493
- const fn = get$7(id);
489
+ const fn = get$8(id);
494
490
  if (!fn) {
495
491
  console.log(response);
496
492
  warn$1(`callback ${id} may already be disposed`);
@@ -689,7 +685,7 @@ const getErrorResponse = (message, error, preparePrettyError, logError) => {
689
685
  const errorProperty = getErrorProperty(error, prettyError);
690
686
  return create$1$1(message, errorProperty);
691
687
  };
692
- const create$N = (message, result) => {
688
+ const create$M = (message, result) => {
693
689
  return {
694
690
  jsonrpc: Two,
695
691
  id: message.id,
@@ -698,7 +694,7 @@ const create$N = (message, result) => {
698
694
  };
699
695
  const getSuccessResponse = (message, result) => {
700
696
  const resultProperty = result ?? null;
701
- return create$N(message, resultProperty);
697
+ return create$M(message, resultProperty);
702
698
  };
703
699
  const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
704
700
  try {
@@ -882,7 +878,7 @@ const launchWorker = async ({
882
878
  name,
883
879
  url
884
880
  }) => {
885
- const worker = await create$M({
881
+ const worker = await create$L({
886
882
  method: Auto,
887
883
  url,
888
884
  name
@@ -957,7 +953,7 @@ const hydrate$4 = async () => {
957
953
  };
958
954
 
959
955
  // TODO needed?
960
- const dispose$p = () => {
956
+ const dispose$o = () => {
961
957
  // @ts-expect-error
962
958
  if (state$9.rendererWorker) {
963
959
  // @ts-expect-error
@@ -980,7 +976,7 @@ const invokeAndTransfer = (method, ...params) => {
980
976
 
981
977
  const RendererWorker = {
982
978
  __proto__: null,
983
- dispose: dispose$p,
979
+ dispose: dispose$o,
984
980
  hydrate: hydrate$4,
985
981
  invoke: invoke$1,
986
982
  invokeAndTransfer,
@@ -989,17 +985,17 @@ const RendererWorker = {
989
985
  state: state$9
990
986
  };
991
987
 
992
- const create$M = async ({
988
+ const create$L = async ({
993
989
  method,
994
990
  ...options
995
991
  }) => {
996
- if (options.name && has(options.name)) {
992
+ if (options.name && has$1(options.name)) {
997
993
  if (!options.id) {
998
994
  throw new Error('id is required');
999
995
  }
1000
996
  // TODO rename method
1001
997
  // TODO avoid cyclic dependency
1002
- const port = get$8(options.name);
998
+ const port = get$9(options.name);
1003
999
  remove$4(options.name);
1004
1000
  await invokeAndTransfer('Transferrable.transfer', options.id, port);
1005
1001
  return;
@@ -1010,7 +1006,7 @@ const create$M = async ({
1010
1006
  };
1011
1007
 
1012
1008
  const launchEditorWorker = async port => {
1013
- const ipc = await create$M({
1009
+ const ipc = await create$L({
1014
1010
  name: 'Editor Worker',
1015
1011
  url: editorWorkerUrl,
1016
1012
  method: ModuleWorkerWithMessagePort,
@@ -1026,7 +1022,7 @@ const hydrate$3 = async () => {
1026
1022
  } = new MessageChannel();
1027
1023
  // TODO only launch port and send to renderer worker
1028
1024
  const promise = launchEditorWorker(port1);
1029
- set$7('Editor Worker', port2);
1025
+ set$8('Editor Worker', port2);
1030
1026
  await promise;
1031
1027
  };
1032
1028
 
@@ -1040,7 +1036,7 @@ const extensionHostWorkerUrl = getConfiguredExtensionHostWorkerUrl() || `${asset
1040
1036
 
1041
1037
  const launchExtensionHostWorker = async port => {
1042
1038
  const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
1043
- const ipc = await create$M({
1039
+ const ipc = await create$L({
1044
1040
  name,
1045
1041
  url: extensionHostWorkerUrl,
1046
1042
  method: ModuleWorkerWithMessagePort,
@@ -1057,14 +1053,14 @@ const hydrate$2 = async () => {
1057
1053
  // TODO only launch port and send to renderer worker
1058
1054
  const promise = launchExtensionHostWorker(port1);
1059
1055
  const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
1060
- set$7(name, port2);
1056
+ set$8(name, port2);
1061
1057
  await promise;
1062
1058
  };
1063
1059
 
1064
1060
  const syntaxHighlightingWorkerUrl = `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/syntax-highlighting-worker/dist/syntaxHighlightingWorkerMain.js`;
1065
1061
 
1066
1062
  const launchSyntaxHighlightingWorker = async port => {
1067
- const ipc = await create$M({
1063
+ const ipc = await create$L({
1068
1064
  name: 'Syntax Highlighting Worker',
1069
1065
  url: syntaxHighlightingWorkerUrl,
1070
1066
  method: ModuleWorkerWithMessagePort,
@@ -1080,7 +1076,7 @@ const hydrate$1 = async () => {
1080
1076
  } = new MessageChannel();
1081
1077
  // TODO only launch port and send to renderer worker
1082
1078
  const promise = launchSyntaxHighlightingWorker(port1);
1083
- set$7('Syntax Highlighting Worker', port2);
1079
+ set$8('Syntax Highlighting Worker', port2);
1084
1080
  await promise;
1085
1081
  };
1086
1082
 
@@ -1106,8 +1102,6 @@ const load$2 = moduleId => {
1106
1102
  return Promise.resolve().then(function () { return Download_ipc; });
1107
1103
  case EditorError$1:
1108
1104
  return Promise.resolve().then(function () { return EditorError_ipc; });
1109
- case EditorRename$1:
1110
- return Promise.resolve().then(function () { return EditorRename_ipc; });
1111
1105
  case FilePicker:
1112
1106
  return Promise.resolve().then(function () { return FilePicker_ipc; });
1113
1107
  case FileSystemHandle:
@@ -1169,11 +1163,10 @@ const load$2 = moduleId => {
1169
1163
  }
1170
1164
  };
1171
1165
 
1172
- // src/parts/ComponentUid/ComponentUid.ts
1166
+ // src/parts/UidSymbol/UidSymbol.ts
1173
1167
  var uidSymbol = Symbol("uid");
1174
- var setComponentUid = ($Element, uid) => {
1175
- $Element[uidSymbol] = uid;
1176
- };
1168
+
1169
+ // src/parts/GetUidTarget/GetUidTarget.ts
1177
1170
  var getUidTarget = $Element => {
1178
1171
  while ($Element) {
1179
1172
  if ($Element[uidSymbol]) {
@@ -1183,6 +1176,11 @@ var getUidTarget = $Element => {
1183
1176
  }
1184
1177
  return void 0;
1185
1178
  };
1179
+
1180
+ // src/parts/ComponentUid/ComponentUid.ts
1181
+ var setComponentUid = ($Element, uid) => {
1182
+ $Element[uidSymbol] = uid;
1183
+ };
1186
1184
  var getComponentUid = $Element => {
1187
1185
  const $Target = getUidTarget($Element);
1188
1186
  if (!$Target) {
@@ -1209,6 +1207,47 @@ var setIpc = value => {
1209
1207
  state$8.ipc = value;
1210
1208
  };
1211
1209
 
1210
+ // src/parts/NameAnonymousFunction/NameAnonymousFunction.ts
1211
+ var nameAnonymousFunction$1 = (fn, name) => {
1212
+ Object.defineProperty(fn, "name", {
1213
+ value: name
1214
+ });
1215
+ };
1216
+
1217
+ // src/parts/RegisterEventListeners/RegisterEventListeners.ts
1218
+ var listeners = /* @__PURE__ */Object.create(null);
1219
+ var getArgs = (params, event) => {
1220
+ return [...params];
1221
+ };
1222
+ var createFn = info => {
1223
+ const fn = event => {
1224
+ if (info.preventDefault) {
1225
+ event.preventDefault(event);
1226
+ }
1227
+ const uid = getComponentUidFromEvent(event);
1228
+ const args = getArgs(info.params);
1229
+ if (args.length === 0) {
1230
+ return;
1231
+ }
1232
+ const ipc = getIpc();
1233
+ ipc.send("Viewlet.executeViewletCommand", uid, ...args);
1234
+ };
1235
+ nameAnonymousFunction$1(fn, info.name);
1236
+ return fn;
1237
+ };
1238
+ var registerEventListeners = (id, eventListeners) => {
1239
+ const map = /* @__PURE__ */Object.create(null);
1240
+ for (const info of eventListeners) {
1241
+ const fn = createFn(info);
1242
+ map[info.name] = fn;
1243
+ }
1244
+ listeners[id] = map;
1245
+ };
1246
+ var getEventListenerMap = id => {
1247
+ const map = listeners[id];
1248
+ return map;
1249
+ };
1250
+
1212
1251
  // src/parts/ClearNode/ClearNode.ts
1213
1252
  var clearNode = $Node => {
1214
1253
  $Node.textContent = "";
@@ -1443,20 +1482,24 @@ var getEventListenerOptions$1 = eventName => {
1443
1482
  }
1444
1483
  };
1445
1484
 
1446
- // src/parts/NameAnonymousFunction/NameAnonymousFunction.ts
1447
- var nameAnonymousFunction$1 = (fn, name) => {
1448
- Object.defineProperty(fn, "name", {
1449
- value: name
1450
- });
1485
+ // src/parts/ListenerCache/ListenerCache.ts
1486
+ var cache$1 = /* @__PURE__ */new Map();
1487
+ var has = listener => {
1488
+ return cache$1.has(listener);
1489
+ };
1490
+ var set$6 = (listener, value) => {
1491
+ cache$1.set(listener, value);
1492
+ };
1493
+ var get$7 = listener => {
1494
+ return cache$1.get(listener);
1451
1495
  };
1452
1496
 
1453
1497
  // src/parts/GetWrappedListener/GetWrappedListener.ts
1454
- var cache$1 = /* @__PURE__ */new Map();
1455
1498
  var getWrappedListener$1 = (listener, returnValue) => {
1456
1499
  if (!returnValue) {
1457
1500
  return listener;
1458
1501
  }
1459
- if (!cache$1.has(listener)) {
1502
+ if (!has(listener)) {
1460
1503
  const wrapped = event => {
1461
1504
  const uid = getComponentUidFromEvent(event);
1462
1505
  const result = listener(event);
@@ -1467,13 +1510,17 @@ var getWrappedListener$1 = (listener, returnValue) => {
1467
1510
  ipc.send("Viewlet.executeViewletCommand", uid, ...result);
1468
1511
  };
1469
1512
  nameAnonymousFunction$1(wrapped, listener.name);
1470
- cache$1.set(listener, wrapped);
1513
+ set$6(listener, wrapped);
1471
1514
  }
1472
- return cache$1.get(listener);
1515
+ return get$7(listener);
1473
1516
  };
1474
1517
 
1475
1518
  // src/parts/AttachEvent/AttachEvent.ts
1476
- var attachEvent$1 = ($Node, eventMap, key, value) => {
1519
+ var attachEvent$1 = ($Node, eventMap, key, value, newEventMap) => {
1520
+ if (newEventMap && newEventMap[value]) {
1521
+ $Node.addEventListener(key, newEventMap[value]);
1522
+ return;
1523
+ }
1477
1524
  const listener = eventMap[value];
1478
1525
  if (!listener) {
1479
1526
  console.warn("listener not found", value);
@@ -1485,7 +1532,7 @@ var attachEvent$1 = ($Node, eventMap, key, value) => {
1485
1532
  };
1486
1533
 
1487
1534
  // src/parts/VirtualDomElementProp/VirtualDomElementProp.ts
1488
- var setProp = ($Element, key, value, eventMap) => {
1535
+ var setProp = ($Element, key, value, eventMap, newEventMap) => {
1489
1536
  switch (key) {
1490
1537
  case "maskImage":
1491
1538
  $Element.style.maskImage = `url('${value}')`;
@@ -1549,7 +1596,7 @@ var setProp = ($Element, key, value, eventMap) => {
1549
1596
  if (!eventMap || !value) {
1550
1597
  return;
1551
1598
  }
1552
- attachEvent$1($Element, eventMap, eventName, value);
1599
+ attachEvent$1($Element, eventMap, eventName, value, newEventMap);
1553
1600
  break;
1554
1601
  default:
1555
1602
  if (key.startsWith("data-")) {
@@ -1561,9 +1608,9 @@ var setProp = ($Element, key, value, eventMap) => {
1561
1608
  };
1562
1609
 
1563
1610
  // src/parts/VirtualDomElementProps/VirtualDomElementProps.ts
1564
- var setProps = ($Element, props, eventMap) => {
1611
+ var setProps = ($Element, props, eventMap, newEventMap) => {
1565
1612
  for (const key in props) {
1566
- setProp($Element, key, props[key], eventMap);
1613
+ setProp($Element, key, props[key], eventMap, newEventMap);
1567
1614
  }
1568
1615
  };
1569
1616
 
@@ -1571,28 +1618,28 @@ var setProps = ($Element, props, eventMap) => {
1571
1618
  var renderDomTextNode = element => {
1572
1619
  return document.createTextNode(element.text);
1573
1620
  };
1574
- var renderDomElement = (element, eventMap) => {
1621
+ var renderDomElement = (element, eventMap, newEventMap) => {
1575
1622
  const tag = getElementTag(element.type);
1576
1623
  const $Element = document.createElement(tag);
1577
- setProps($Element, element, eventMap);
1624
+ setProps($Element, element, eventMap, newEventMap);
1578
1625
  return $Element;
1579
1626
  };
1580
- var render = (element, eventMap) => {
1627
+ var render = (element, eventMap, newEventMap) => {
1581
1628
  switch (element.type) {
1582
1629
  case Text$2:
1583
1630
  return renderDomTextNode(element);
1584
1631
  default:
1585
- return renderDomElement(element, eventMap);
1632
+ return renderDomElement(element, eventMap, newEventMap);
1586
1633
  }
1587
1634
  };
1588
1635
 
1589
1636
  // src/parts/RenderInternal/RenderInternal.ts
1590
- var renderInternal2 = ($Parent, elements, eventMap) => {
1637
+ var renderInternal2 = ($Parent, elements, eventMap, newEventMap) => {
1591
1638
  const max = elements.length - 1;
1592
1639
  let stack = [];
1593
1640
  for (let i = max; i >= 0; i--) {
1594
1641
  const element = elements[i];
1595
- const $Element = render(element, eventMap);
1642
+ const $Element = render(element, eventMap, newEventMap);
1596
1643
  if (element.childCount > 0) {
1597
1644
  $Element.append(...stack.slice(0, element.childCount));
1598
1645
  stack = stack.slice(element.childCount);
@@ -1607,9 +1654,9 @@ var renderInto = ($Parent, dom, eventMap = {}) => {
1607
1654
  clearNode($Parent);
1608
1655
  renderInternal2($Parent, dom, eventMap);
1609
1656
  };
1610
- var render2 = (elements, eventMap = {}) => {
1657
+ var render2 = (elements, eventMap = {}, newEventMap = {}) => {
1611
1658
  const $Root = document.createElement("div");
1612
- renderInternal2($Root, elements, eventMap);
1659
+ renderInternal2($Root, elements, eventMap, newEventMap);
1613
1660
  return $Root;
1614
1661
  };
1615
1662
 
@@ -1629,7 +1676,8 @@ var rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
1629
1676
  inputMap[$Input.name] = $Input.value;
1630
1677
  }
1631
1678
  if (uid) {
1632
- const $New = render2(dom, eventMap).firstChild;
1679
+ const newEventMap = getEventListenerMap(uid);
1680
+ const $New = render2(dom, eventMap, newEventMap).firstChild;
1633
1681
  setComponentUid($New, uid);
1634
1682
  $Viewlet.replaceWith($New);
1635
1683
  $Viewlet = $New;
@@ -1804,7 +1852,7 @@ const stopTracking$1 = ($Target, pointerId, handlePointerMove, handlePointerUp)
1804
1852
  // TODO use pointerlost event instead
1805
1853
  $Target.removeEventListener(PointerUp, handlePointerUp);
1806
1854
  };
1807
- const create$L = (pointerDown, pointerMove, pointerUp) => {
1855
+ const create$K = (pointerDown, pointerMove, pointerUp) => {
1808
1856
  const shared = (fn, event) => {
1809
1857
  const message = fn(event);
1810
1858
  if (!message || message.length === 0) {
@@ -1837,7 +1885,7 @@ const create$L = (pointerDown, pointerMove, pointerUp) => {
1837
1885
  };
1838
1886
 
1839
1887
  const handleOffset = 20;
1840
- const handleSliderPointerDown = create$L(event => {
1888
+ const handleSliderPointerDown = create$K(event => {
1841
1889
  const {
1842
1890
  clientX,
1843
1891
  clientY
@@ -2094,9 +2142,15 @@ const handleFocusIn$4 = event => {
2094
2142
  const uid = fromEvent(event);
2095
2143
  handleFocusIn$5(uid);
2096
2144
  };
2145
+ const handleBlur$a = event => {
2146
+ preventDefault(event);
2147
+ const uid = fromEvent(event);
2148
+ handleBlur$b(uid);
2149
+ };
2097
2150
 
2098
2151
  const ViewletEditorCodeGeneratorEvents = {
2099
2152
  __proto__: null,
2153
+ handleBlur: handleBlur$a,
2100
2154
  handleFocusIn: handleFocusIn$4
2101
2155
  };
2102
2156
 
@@ -2113,7 +2167,7 @@ const appendWidget$5 = state => {
2113
2167
  } = state;
2114
2168
  append$1($Viewlet);
2115
2169
  };
2116
- const dispose$o = state => {
2170
+ const dispose$n = state => {
2117
2171
  remove$2(state.$Viewlet);
2118
2172
  };
2119
2173
  const focus$j = (state, key, source) => {
@@ -2139,7 +2193,7 @@ const ViewletEditorCodeGenerator = {
2139
2193
  __proto__: null,
2140
2194
  Events: ViewletEditorCodeGeneratorEvents,
2141
2195
  appendWidget: appendWidget$5,
2142
- dispose: dispose$o,
2196
+ dispose: dispose$n,
2143
2197
  focus: focus$j,
2144
2198
  setBounds: setBounds$9
2145
2199
  };
@@ -2292,7 +2346,7 @@ const setNegativeMargin = (state, negativeMargin) => {
2292
2346
  setTop($ListItems, negativeMargin);
2293
2347
  };
2294
2348
 
2295
- const create$K = () => {
2349
+ const create$J = () => {
2296
2350
  const $ListItems = document.createElement('div');
2297
2351
  $ListItems.className = 'ListItems';
2298
2352
  $ListItems.role = ListBox;
@@ -2345,7 +2399,7 @@ const setDom$b = (state, dom) => {
2345
2399
  // TODO recycle nodes
2346
2400
  // TODO set right aria attributes on $EditorInput
2347
2401
  };
2348
- const dispose$n = state => {
2402
+ const dispose$m = state => {
2349
2403
  remove$2(state.$Viewlet);
2350
2404
  // state.$EditorInput.removeAttribute('aria-activedescendant')
2351
2405
  };
@@ -2376,8 +2430,8 @@ const setBounds$8 = (state, x, y, width, height) => {
2376
2430
  const ViewletEditorCompletion = {
2377
2431
  __proto__: null,
2378
2432
  attachEvents: attachEvents$b,
2379
- create: create$K,
2380
- dispose: dispose$n,
2433
+ create: create$J,
2434
+ dispose: dispose$m,
2381
2435
  handleError: handleError$8,
2382
2436
  setBounds: setBounds$8,
2383
2437
  setContentHeight,
@@ -2399,7 +2453,7 @@ const ViewletEditorCompletionDetailsEvents = {
2399
2453
  returnValue: returnValue$a
2400
2454
  };
2401
2455
 
2402
- const create$J = () => {
2456
+ const create$I = () => {
2403
2457
  const $Viewlet = document.createElement('div');
2404
2458
  $Viewlet.className = 'Viewlet EditorCompletionDetails';
2405
2459
  $Viewlet.id = 'CompletionsDetails';
@@ -2425,7 +2479,7 @@ const appendWidget$4 = state => {
2425
2479
  } = state;
2426
2480
  append$1($Viewlet);
2427
2481
  };
2428
- const dispose$m = state => {
2482
+ const dispose$l = state => {
2429
2483
  remove$2(state.$Viewlet);
2430
2484
  };
2431
2485
  const setBounds$7 = (state, x, y, width, height) => {
@@ -2440,8 +2494,8 @@ const ViewletEditorCompletionDetails = {
2440
2494
  Events: ViewletEditorCompletionDetailsEvents,
2441
2495
  appendWidget: appendWidget$4,
2442
2496
  attachEvents: attachEvents$a,
2443
- create: create$J,
2444
- dispose: dispose$m,
2497
+ create: create$I,
2498
+ dispose: dispose$l,
2445
2499
  setBounds: setBounds$7,
2446
2500
  setDom: setDom$a
2447
2501
  };
@@ -2449,7 +2503,7 @@ const ViewletEditorCompletionDetails = {
2449
2503
  const rememberFocus = rememberFocus$1;
2450
2504
 
2451
2505
  const returnValue$9 = true;
2452
- const handleSashPointerDown$2 = create$L(event => {
2506
+ const handleSashPointerDown$2 = create$K(event => {
2453
2507
  const {
2454
2508
  clientX,
2455
2509
  clientY
@@ -2508,7 +2562,7 @@ const handleFocusIn$3 = event => {
2508
2562
  const uid = fromEvent(event);
2509
2563
  handleFocusIn$5(uid);
2510
2564
  };
2511
- const handleBlur$a = event => {
2565
+ const handleBlur$9 = event => {
2512
2566
  const uid = fromEvent(event);
2513
2567
  executeViewletCommand(uid, 'EditorRename.handleBlur');
2514
2568
  };
@@ -2525,7 +2579,7 @@ const handleInput$8 = event => {
2525
2579
 
2526
2580
  const ViewletEditorRenameEvents = {
2527
2581
  __proto__: null,
2528
- handleBlur: handleBlur$a,
2582
+ handleBlur: handleBlur$9,
2529
2583
  handleFocusIn: handleFocusIn$3,
2530
2584
  handleInput: handleInput$8
2531
2585
  };
@@ -2543,7 +2597,7 @@ const appendWidget$2 = state => {
2543
2597
  } = state;
2544
2598
  append$1($Viewlet);
2545
2599
  };
2546
- const dispose$l = state => {
2600
+ const dispose$k = state => {
2547
2601
  remove$2(state.$Viewlet);
2548
2602
  };
2549
2603
 
@@ -2551,7 +2605,7 @@ const ViewletEditorRename = {
2551
2605
  __proto__: null,
2552
2606
  Events: ViewletEditorRenameEvents,
2553
2607
  appendWidget: appendWidget$2,
2554
- dispose: dispose$l,
2608
+ dispose: dispose$k,
2555
2609
  setBounds: setBounds$5
2556
2610
  };
2557
2611
 
@@ -2579,7 +2633,7 @@ const appendWidget$1 = state => {
2579
2633
  } = state;
2580
2634
  append$1($Viewlet);
2581
2635
  };
2582
- const dispose$k = state => {
2636
+ const dispose$j = state => {
2583
2637
  remove$2(state.$Viewlet);
2584
2638
  };
2585
2639
 
@@ -2587,7 +2641,7 @@ const ViewletEditorSourceActions = {
2587
2641
  __proto__: null,
2588
2642
  Events: ViewletEditorSourceActionsEvents,
2589
2643
  appendWidget: appendWidget$1,
2590
- dispose: dispose$k,
2644
+ dispose: dispose$j,
2591
2645
  setBounds: setBounds$4
2592
2646
  };
2593
2647
 
@@ -2680,7 +2734,7 @@ const ViewletFindWidgetEvents = {
2680
2734
  returnValue: returnValue$8
2681
2735
  };
2682
2736
 
2683
- const create$I = () => {
2737
+ const create$H = () => {
2684
2738
  const $Viewlet = document.createElement('div');
2685
2739
  $Viewlet.className = 'Viewlet FindWidget';
2686
2740
  $Viewlet.role = Group;
@@ -2734,7 +2788,7 @@ const setBounds$3 = (state, x, y, width, height) => {
2734
2788
  } = state;
2735
2789
  setBounds$a($Viewlet, x, y, width, height);
2736
2790
  };
2737
- const dispose$j = state => {
2791
+ const dispose$i = state => {
2738
2792
  remove$2(state.$Viewlet);
2739
2793
  };
2740
2794
  const Events$c = ViewletFindWidgetEvents;
@@ -2743,8 +2797,8 @@ const ViewletFindWidget = {
2743
2797
  __proto__: null,
2744
2798
  Events: Events$c,
2745
2799
  appendWidget,
2746
- create: create$I,
2747
- dispose: dispose$j,
2800
+ create: create$H,
2801
+ dispose: dispose$i,
2748
2802
  focus: focus$i,
2749
2803
  setBounds: setBounds$3,
2750
2804
  setDom: setDom$8,
@@ -3254,7 +3308,7 @@ ${relevant}`;
3254
3308
 
3255
3309
  const Module = 'module';
3256
3310
 
3257
- const create$H = async ({
3311
+ const create$G = async ({
3258
3312
  url,
3259
3313
  name
3260
3314
  }) => {
@@ -3320,7 +3374,7 @@ const wrap = worker => {
3320
3374
 
3321
3375
  const IpcParentWithModuleWorker = {
3322
3376
  __proto__: null,
3323
- create: create$H,
3377
+ create: create$G,
3324
3378
  wrap
3325
3379
  };
3326
3380
 
@@ -3328,7 +3382,7 @@ const isMessagePort$1 = value => {
3328
3382
  return value instanceof MessagePort;
3329
3383
  };
3330
3384
 
3331
- const create$G = async ({
3385
+ const create$F = async ({
3332
3386
  url
3333
3387
  }) => {
3334
3388
  string(url);
@@ -3349,10 +3403,10 @@ const create$G = async ({
3349
3403
 
3350
3404
  const IpcParentWithMessagePort = {
3351
3405
  __proto__: null,
3352
- create: create$G
3406
+ create: create$F
3353
3407
  };
3354
3408
 
3355
- const create$F = async url => {
3409
+ const create$E = async url => {
3356
3410
  const referencePort = await new Promise(resolve => {
3357
3411
  globalThis.acceptReferencePort = resolve;
3358
3412
  import(url);
@@ -3363,7 +3417,7 @@ const create$F = async url => {
3363
3417
 
3364
3418
  const IpcParentWithReferencePort = {
3365
3419
  __proto__: null,
3366
- create: create$F
3420
+ create: create$E
3367
3421
  };
3368
3422
 
3369
3423
  const isWorker = value => {
@@ -3371,12 +3425,12 @@ const isWorker = value => {
3371
3425
  };
3372
3426
 
3373
3427
  // TODO add test
3374
- const create$E = async ({
3428
+ const create$D = async ({
3375
3429
  url,
3376
3430
  name,
3377
3431
  port
3378
3432
  }) => {
3379
- const worker = await create$H({
3433
+ const worker = await create$G({
3380
3434
  url,
3381
3435
  name
3382
3436
  });
@@ -3395,7 +3449,7 @@ const create$E = async ({
3395
3449
 
3396
3450
  const IpcParentWithModuleWorkerWithMessagePort = {
3397
3451
  __proto__: null,
3398
- create: create$E
3452
+ create: create$D
3399
3453
  };
3400
3454
 
3401
3455
  const handleIpcOnce = ipc => {
@@ -3926,7 +3980,7 @@ const IpcChildWithModuleWorkerAndMessagePort$1 = {
3926
3980
  };
3927
3981
 
3928
3982
  // TODO use handleIncomingIpc function
3929
- const create$D = async ({
3983
+ const create$C = async ({
3930
3984
  port,
3931
3985
  ipcId
3932
3986
  }) => {
@@ -3942,7 +3996,7 @@ const create$D = async ({
3942
3996
 
3943
3997
  const IpcParentWithElectron = {
3944
3998
  __proto__: null,
3945
- create: create$D
3999
+ create: create$C
3946
4000
  };
3947
4001
 
3948
4002
  const play = async src => {
@@ -3950,15 +4004,15 @@ const play = async src => {
3950
4004
  await audio.play();
3951
4005
  };
3952
4006
 
3953
- const name$z = 'Audio';
3954
- const Commands$A = {
4007
+ const name$y = 'Audio';
4008
+ const Commands$z = {
3955
4009
  play: play
3956
4010
  };
3957
4011
 
3958
4012
  const Audio_ipc = {
3959
4013
  __proto__: null,
3960
- Commands: Commands$A,
3961
- name: name$z
4014
+ Commands: Commands$z,
4015
+ name: name$y
3962
4016
  };
3963
4017
 
3964
4018
  const readText = async () => {
@@ -3979,8 +4033,8 @@ const execCopy = async () => {
3979
4033
  await writeText(text);
3980
4034
  };
3981
4035
 
3982
- const name$y = 'ClipBoard';
3983
- const Commands$z = {
4036
+ const name$x = 'ClipBoard';
4037
+ const Commands$y = {
3984
4038
  execCopy: execCopy,
3985
4039
  readText: readText,
3986
4040
  writeImage: writeImage,
@@ -3989,23 +4043,23 @@ const Commands$z = {
3989
4043
 
3990
4044
  const ClipBoard_ipc = {
3991
4045
  __proto__: null,
3992
- Commands: Commands$z,
3993
- name: name$y
4046
+ Commands: Commands$y,
4047
+ name: name$x
3994
4048
  };
3995
4049
 
3996
4050
  const prompt$1 = message => {
3997
4051
  return confirm(message);
3998
4052
  };
3999
4053
 
4000
- const name$x = 'ConfirmPrompt';
4001
- const Commands$y = {
4054
+ const name$w = 'ConfirmPrompt';
4055
+ const Commands$x = {
4002
4056
  prompt: prompt$1
4003
4057
  };
4004
4058
 
4005
4059
  const ConfirmPrompt_ipc = {
4006
4060
  __proto__: null,
4007
- Commands: Commands$y,
4008
- name: name$x
4061
+ Commands: Commands$x,
4062
+ name: name$w
4009
4063
  };
4010
4064
 
4011
4065
  const state$5 = {
@@ -4030,15 +4084,15 @@ const addCssStyleSheet = async (id, text) => {
4030
4084
  document.adoptedStyleSheets.push(sheet);
4031
4085
  };
4032
4086
 
4033
- const name$w = 'Css';
4034
- const Commands$x = {
4087
+ const name$v = 'Css';
4088
+ const Commands$w = {
4035
4089
  addCssStyleSheet: addCssStyleSheet
4036
4090
  };
4037
4091
 
4038
4092
  const Css_ipc = {
4039
4093
  __proto__: null,
4040
- Commands: Commands$x,
4041
- name: name$w
4094
+ Commands: Commands$w,
4095
+ name: name$v
4042
4096
  };
4043
4097
 
4044
4098
  const modules = ['ActivityBar', 'Ajax', 'Allocator', 'Callback', 'Command', 'Context', 'ContextMenu', 'Delay', 'Developer', 'DomPool', 'Editor', 'Exec', 'ExtensionHost', 'FileSystem', 'KeyBindings', 'Layout', 'Main', 'Notification', 'Panel', 'Parts', 'QuickPick', 'Renderer', 'RendererWorker', 'Search', 'SharedProcess', 'SideBar', 'StatusBar', 'TitleBar', 'Viewlet', 'ViewletController', 'ViewService', 'Vscode', 'Window', 'Workbench', 'Worker', 'Workspace'];
@@ -4058,15 +4112,15 @@ const showState = async () => {
4058
4112
  info(state);
4059
4113
  };
4060
4114
 
4061
- const name$v = 'Developer';
4062
- const Commands$w = {
4115
+ const name$u = 'Developer';
4116
+ const Commands$v = {
4063
4117
  showState: showState
4064
4118
  };
4065
4119
 
4066
4120
  const Developer_ipc = {
4067
4121
  __proto__: null,
4068
- Commands: Commands$w,
4069
- name: name$v
4122
+ Commands: Commands$v,
4123
+ name: name$u
4070
4124
  };
4071
4125
 
4072
4126
  const downloadFile = (fileName, url) => {
@@ -4076,15 +4130,15 @@ const downloadFile = (fileName, url) => {
4076
4130
  a.click();
4077
4131
  };
4078
4132
 
4079
- const name$u = 'Download';
4080
- const Commands$v = {
4133
+ const name$t = 'Download';
4134
+ const Commands$u = {
4081
4135
  downloadFile: downloadFile
4082
4136
  };
4083
4137
 
4084
4138
  const Download_ipc = {
4085
4139
  __proto__: null,
4086
- Commands: Commands$v,
4087
- name: name$u
4140
+ Commands: Commands$u,
4141
+ name: name$t
4088
4142
  };
4089
4143
 
4090
4144
  // based on https://github.com/microsoft/vscode/blob/5f87632829dc3ac80203e2377727935184399431/src/vs/base/browser/ui/aria/aria.ts (License MIT)
@@ -4173,7 +4227,7 @@ const AriaAlert = {
4173
4227
  // but that's difficult to know
4174
4228
 
4175
4229
  // TODO hide widget after timeout or mousemove
4176
- const create$C = (message, x, y) => {
4230
+ const create$B = (message, x, y) => {
4177
4231
  const $EditorError = document.createElement('div');
4178
4232
  $EditorError.className = 'EditorWidgetError';
4179
4233
  $EditorError.textContent = message;
@@ -4186,110 +4240,12 @@ const create$C = (message, x, y) => {
4186
4240
  };
4187
4241
  };
4188
4242
 
4189
- const name$t = 'EditorError';
4190
- const Commands$u = {
4191
- create: create$C
4192
- };
4193
-
4194
- const EditorError_ipc = {
4195
- __proto__: null,
4196
- Commands: Commands$u,
4197
- name: name$t
4198
- };
4199
-
4200
- const state$3 = {
4201
- /**
4202
- * @type {HTMLElement|undefined}
4203
- */
4204
- $PreviousFocusElement: undefined,
4205
- currentFocus: ''
4206
- };
4207
- const setElement = $Element => {
4208
- state$3.$PreviousFocusElement = $Element;
4209
- };
4210
- const getElement = () => {
4211
- return state$3.$PreviousFocusElement;
4212
- };
4213
-
4214
- const focus$h = $Element => {
4215
- if ($Element === document.activeElement) {
4216
- return;
4217
- }
4218
- setElement(document.activeElement);
4219
- $Element.focus({
4220
- preventScroll: true
4221
- });
4222
- };
4223
- const focusPrevious = () => {
4224
- const $Element = getElement();
4225
- if ($Element) {
4226
- // @ts-expect-error
4227
- $Element.focus();
4228
- }
4229
- };
4230
-
4231
- const create$B = () => {
4232
- const $InputBox = document.createElement('input');
4233
- $InputBox.className = 'InputBox';
4234
- $InputBox.spellcheck = false;
4235
- $InputBox.autocapitalize = 'off';
4236
- // $InputBox.autocomplete = 'off' // TODO needed?
4237
- $InputBox.type = 'text';
4238
- $InputBox.setAttribute('autocorrect', 'off'); // for ios
4239
- return $InputBox;
4240
- };
4241
-
4242
- const FocusDebugInput = 6;
4243
- const FocusEditorRename = 11;
4244
- const FocusExplorerEditBox = 14;
4245
- const FocusLocationList = 17;
4246
- const FocusMenu = 18;
4247
- const FocusQuickPickInput = 20;
4248
- const FocusSearchInput = 21;
4249
- const FocusSimpleBrowserInput = 23;
4250
- const FocusOutput = 28;
4251
-
4252
- const handleBlur$9 = () => {
4253
- send(/* EditorRename.abort */'EditorRename.abort');
4254
- };
4255
- const create$A = (x, y) => {
4256
- const $RenameWidgetInputBox = create$B();
4257
- $RenameWidgetInputBox.className = 'RenameWidgetInputBox';
4258
- $RenameWidgetInputBox.onblur = handleBlur$9;
4259
- const $RenameWidget = document.createElement('div');
4260
- $RenameWidget.className = 'RenameWidget';
4261
- $RenameWidget.append($RenameWidgetInputBox);
4262
- setXAndY($RenameWidget, x, y);
4263
- append$1($RenameWidget);
4264
- focus$h($RenameWidgetInputBox);
4265
- send('Focus.setFocus', FocusEditorRename);
4266
- return {
4267
- $RenameWidget,
4268
- $RenameWidgetInputBox
4269
- };
4270
- };
4271
- const dispose$i = state => {
4272
- // TODO focus editor
4273
- remove$2(state.$RenameWidget);
4274
- };
4275
-
4276
- // TODO could also be event based
4277
- // finish -> finish -> finishWithValue
4278
-
4279
- const finish = state => {
4280
- const value = state.$RenameWidgetInputBox.value;
4281
- // TODO don't like side effect here
4282
- return value;
4283
- };
4284
-
4285
- const name$s = 'EditorRename';
4243
+ const name$s = 'EditorError';
4286
4244
  const Commands$t = {
4287
- create: create$A,
4288
- dispose: dispose$i,
4289
- finish: finish
4245
+ create: create$B
4290
4246
  };
4291
4247
 
4292
- const EditorRename_ipc = {
4248
+ const EditorError_ipc = {
4293
4249
  __proto__: null,
4294
4250
  Commands: Commands$t,
4295
4251
  name: name$s
@@ -4370,7 +4326,7 @@ const showError = (message, y, x) => {
4370
4326
  $ImagePreviewImage
4371
4327
  };
4372
4328
  };
4373
- const create$z = (uri, top, left) => {
4329
+ const create$A = (uri, top, left) => {
4374
4330
  const $ImagePreviewImage = document.createElement('img');
4375
4331
  $ImagePreviewImage.className = 'ImagePreviewImage';
4376
4332
  $ImagePreviewImage.src = uri;
@@ -4401,7 +4357,7 @@ const dispose$h = state => {
4401
4357
 
4402
4358
  const ImagePreview = {
4403
4359
  __proto__: null,
4404
- create: create$z,
4360
+ create: create$A,
4405
4361
  dispose: dispose$h,
4406
4362
  showError,
4407
4363
  update
@@ -4409,7 +4365,7 @@ const ImagePreview = {
4409
4365
 
4410
4366
  const name$p = 'ImagePreview';
4411
4367
  const Commands$q = {
4412
- create: create$z,
4368
+ create: create$A,
4413
4369
  dispose: dispose$h,
4414
4370
  showError: showError,
4415
4371
  update: update
@@ -4487,7 +4443,7 @@ const InitData_ipc = {
4487
4443
 
4488
4444
  const name$n = 'IpcParent';
4489
4445
  const Commands$o = {
4490
- create: create$M
4446
+ create: create$L
4491
4447
  };
4492
4448
 
4493
4449
  const IpcParent_ipc = {
@@ -4607,7 +4563,7 @@ const create$Notification = message => {
4607
4563
  $Notification.textContent = message;
4608
4564
  return $Notification;
4609
4565
  };
4610
- const create$y = (type, message) => {
4566
+ const create$z = (type, message) => {
4611
4567
  // TODO this pattern might be also useful for activitybar, sidebar etc., creating elements as late as possible, only when actually needed
4612
4568
  const $Notification = create$Notification(message);
4613
4569
  append$1($Notification);
@@ -4660,7 +4616,7 @@ const name$h = 'Notification';
4660
4616
 
4661
4617
  // prettier-ignore
4662
4618
  const Commands$i = {
4663
- create: create$y,
4619
+ create: create$z,
4664
4620
  createWithOptions: createWithOptions,
4665
4621
  dispose: dispose$g
4666
4622
  };
@@ -4671,20 +4627,20 @@ const Notification_ipc = {
4671
4627
  name: name$h
4672
4628
  };
4673
4629
 
4674
- const state$2 = {
4630
+ const state$3 = {
4675
4631
  canvasObjects: Object.create(null)
4676
4632
  };
4677
4633
  const get$4 = id => {
4678
- return state$2.canvasObjects[id];
4634
+ return state$3.canvasObjects[id];
4679
4635
  };
4680
4636
  const set$3 = (canvasId, canvas) => {
4681
- state$2.canvasObjects[canvasId] = canvas;
4637
+ state$3.canvasObjects[canvasId] = canvas;
4682
4638
  };
4683
4639
 
4684
4640
  const get$3 = id => {
4685
4641
  return get$4(id);
4686
4642
  };
4687
- const create$x = async (canvasId, objectId) => {
4643
+ const create$y = async (canvasId, objectId) => {
4688
4644
  const canvas = document.createElement('canvas');
4689
4645
  const offscreenCanvas = canvas.transferControlToOffscreen();
4690
4646
  set$3(canvasId, canvas);
@@ -4695,7 +4651,7 @@ const name$g = 'OffscreenCanvas';
4695
4651
 
4696
4652
  // prettier-ignore
4697
4653
  const Commands$h = {
4698
- create: create$x
4654
+ create: create$y
4699
4655
  };
4700
4656
 
4701
4657
  const OffscreenCanvas_ipc = {
@@ -4730,6 +4686,46 @@ const create$BackDrop = () => {
4730
4686
  return $BackDrop;
4731
4687
  };
4732
4688
 
4689
+ const state$2 = {
4690
+ /**
4691
+ * @type {HTMLElement|undefined}
4692
+ */
4693
+ $PreviousFocusElement: undefined,
4694
+ currentFocus: ''
4695
+ };
4696
+ const setElement = $Element => {
4697
+ state$2.$PreviousFocusElement = $Element;
4698
+ };
4699
+ const getElement = () => {
4700
+ return state$2.$PreviousFocusElement;
4701
+ };
4702
+
4703
+ const focus$h = $Element => {
4704
+ if ($Element === document.activeElement) {
4705
+ return;
4706
+ }
4707
+ setElement(document.activeElement);
4708
+ $Element.focus({
4709
+ preventScroll: true
4710
+ });
4711
+ };
4712
+ const focusPrevious = () => {
4713
+ const $Element = getElement();
4714
+ if ($Element) {
4715
+ // @ts-expect-error
4716
+ $Element.focus();
4717
+ }
4718
+ };
4719
+
4720
+ const FocusDebugInput = 6;
4721
+ const FocusExplorerEditBox = 14;
4722
+ const FocusLocationList = 17;
4723
+ const FocusMenu = 18;
4724
+ const FocusQuickPickInput = 20;
4725
+ const FocusSearchInput = 21;
4726
+ const FocusSimpleBrowserInput = 23;
4727
+ const FocusOutput = 28;
4728
+
4733
4729
  // TODO when pressing tab -> focus next element in tab order and close menu
4734
4730
 
4735
4731
  // TODO menu and contextmenu should have own keybinding logic
@@ -5867,7 +5863,7 @@ const load$1 = moduleId => {
5867
5863
  }
5868
5864
  };
5869
5865
 
5870
- const create$w = (id, uid = id) => {
5866
+ const create$x = (id, uid = id) => {
5871
5867
  const module = state$6.modules[id];
5872
5868
  if (!module) {
5873
5869
  throw new Error(`module not found: ${id}`);
@@ -6044,7 +6040,7 @@ const sendMultiple = commands => {
6044
6040
  }
6045
6041
  case 'Viewlet.create':
6046
6042
  {
6047
- create$w(viewletId, method);
6043
+ create$x(viewletId, method);
6048
6044
  break;
6049
6045
  }
6050
6046
  case 'Viewlet.createFunctionalRoot':
@@ -6239,7 +6235,7 @@ const appendToBody = childId => {
6239
6235
  const getFn = command => {
6240
6236
  switch (command) {
6241
6237
  case 'Viewlet.create':
6242
- return create$w;
6238
+ return create$x;
6243
6239
  case 'Viewlet.send':
6244
6240
  return invoke;
6245
6241
  case 'Viewlet.show':
@@ -6314,7 +6310,8 @@ const Commands$9 = {
6314
6310
  send: invoke,
6315
6311
  sendMultiple: sendMultiple,
6316
6312
  setBounds: setBounds$2,
6317
- show: show
6313
+ show: show,
6314
+ registerEventListeners: registerEventListeners
6318
6315
  };
6319
6316
 
6320
6317
  const Viewlet_ipc = {
@@ -6585,7 +6582,7 @@ const waitForFrameToLoad = $Frame => {
6585
6582
  };
6586
6583
 
6587
6584
  // TODO could use browser view when running in electron
6588
- const create$v = async (uid, src, sandbox, csp, credentialless) => {
6585
+ const create$w = async (uid, src, sandbox, csp, credentialless) => {
6589
6586
  const $Iframe = document.createElement('iframe');
6590
6587
  setIframeCredentialless($Iframe, credentialless);
6591
6588
  setIframeCsp($Iframe, csp);
@@ -6627,7 +6624,7 @@ const dispose$d = uid => {
6627
6624
 
6628
6625
  const name = 'WebView';
6629
6626
  const Commands$1 = {
6630
- create: create$v,
6627
+ create: create$w,
6631
6628
  load: load,
6632
6629
  setPort: setPort$2,
6633
6630
  dispose: dispose$d
@@ -6735,7 +6732,7 @@ const ViewletAudio = {
6735
6732
  Events: Events$a
6736
6733
  };
6737
6734
 
6738
- const create$u = () => {
6735
+ const create$v = () => {
6739
6736
  const $Viewlet = document.createElement('div');
6740
6737
  $Viewlet.className = 'Viewlet BrowserViewOverview';
6741
6738
  return {
@@ -6751,11 +6748,11 @@ const setDom$6 = (state, dom) => {
6751
6748
 
6752
6749
  const ViewletBrowserViewOverview = {
6753
6750
  __proto__: null,
6754
- create: create$u,
6751
+ create: create$v,
6755
6752
  setDom: setDom$6
6756
6753
  };
6757
6754
 
6758
- const create$t = () => {
6755
+ const create$u = () => {
6759
6756
  const $Viewlet = document.createElement('div');
6760
6757
  $Viewlet.className = 'Viewlet Clock';
6761
6758
  return {
@@ -6772,7 +6769,7 @@ const setTime = (state, time) => {
6772
6769
 
6773
6770
  const ViewletClock = {
6774
6771
  __proto__: null,
6775
- create: create$t,
6772
+ create: create$u,
6776
6773
  dispose: dispose$c,
6777
6774
  refresh: refresh$3,
6778
6775
  setTime
@@ -6799,7 +6796,7 @@ const ViewletDebugConsoleEvents = {
6799
6796
  handleInput: handleInput$6
6800
6797
  };
6801
6798
 
6802
- const create$s = () => {
6799
+ const create$t = () => {
6803
6800
  const $Viewlet = document.createElement('div');
6804
6801
  $Viewlet.className = 'Viewlet DebugConsole';
6805
6802
  return {
@@ -6815,7 +6812,7 @@ const setDom$5 = (state, dom) => {
6815
6812
 
6816
6813
  const ViewletDebugConsole = {
6817
6814
  __proto__: null,
6818
- create: create$s,
6815
+ create: create$t,
6819
6816
  setDom: setDom$5
6820
6817
  };
6821
6818
 
@@ -6876,7 +6873,7 @@ const setMaskImage = ($Element, icon) => {
6876
6873
  }
6877
6874
  };
6878
6875
 
6879
- const create$r = icon => {
6876
+ const create$s = icon => {
6880
6877
  const $Icon = document.createElement('div');
6881
6878
  $Icon.className = 'MaskIcon';
6882
6879
  setMaskImage($Icon, icon);
@@ -6886,7 +6883,7 @@ const create$r = icon => {
6886
6883
 
6887
6884
  const create$Button = (label, icon) => {
6888
6885
  // TODO icon div might not be needed (unnecessary html element)
6889
- const $Icon = create$r(icon);
6886
+ const $Icon = create$s(icon);
6890
6887
  const $Button = document.createElement('button');
6891
6888
  $Button.className = 'IconButton';
6892
6889
  $Button.title = label;
@@ -6907,7 +6904,7 @@ const handleClick$6 = event => {
6907
6904
  handleClick$7(index);
6908
6905
  };
6909
6906
 
6910
- const create$q = () => {
6907
+ const create$r = () => {
6911
6908
  const $DialogTitle = document.createElement('h2');
6912
6909
  $DialogTitle.id = 'DialogTitle';
6913
6910
  const $DialogCloseButton = create$Button('Close', 'Close');
@@ -6988,7 +6985,7 @@ const setErrorStack = (state, errorStack) => {
6988
6985
 
6989
6986
  const ViewletDialog = {
6990
6987
  __proto__: null,
6991
- create: create$q,
6988
+ create: create$r,
6992
6989
  postAppend,
6993
6990
  setButtons,
6994
6991
  setCodeFrame,
@@ -7035,7 +7032,7 @@ const ViewletDiffEditor = {
7035
7032
 
7036
7033
  // TODO aria alert
7037
7034
 
7038
- const create$p = () => {
7035
+ const create$q = () => {
7039
7036
  const $Viewlet = document.createElement('div');
7040
7037
  $Viewlet.className = 'Viewlet EditorError';
7041
7038
  return {
@@ -7057,7 +7054,7 @@ const setBounds$1 = (state, x, y, width, height) => {
7057
7054
 
7058
7055
  const ViewletEditorError = {
7059
7056
  __proto__: null,
7060
- create: create$p,
7057
+ create: create$q,
7061
7058
  setBounds: setBounds$1,
7062
7059
  setDom: setDom$4
7063
7060
  };
@@ -7161,7 +7158,7 @@ const handleFocus$8 = event => {
7161
7158
  handleFocus$c(uid);
7162
7159
  };
7163
7160
 
7164
- const create$o = () => {
7161
+ const create$p = () => {
7165
7162
  const $Viewlet = document.createElement('div');
7166
7163
  $Viewlet.className = 'Viewlet EditorImage';
7167
7164
  return {
@@ -7204,13 +7201,13 @@ const setDom$3 = (state, dom) => {
7204
7201
  const ViewletEditorImage = {
7205
7202
  __proto__: null,
7206
7203
  attachEvents: attachEvents$8,
7207
- create: create$o,
7204
+ create: create$p,
7208
7205
  setDom: setDom$3,
7209
7206
  setDragging,
7210
7207
  setTransform
7211
7208
  };
7212
7209
 
7213
- const create$n = () => {
7210
+ const create$o = () => {
7214
7211
  const $Viewlet = document.createElement('div');
7215
7212
  $Viewlet.className = 'Viewlet EditorText';
7216
7213
  $Viewlet.textContent = 'loading...';
@@ -7227,7 +7224,7 @@ const refresh$2 = (state, context) => {
7227
7224
 
7228
7225
  const ViewletEditorPlainText = {
7229
7226
  __proto__: null,
7230
- create: create$n,
7227
+ create: create$o,
7231
7228
  dispose: dispose$b,
7232
7229
  refresh: refresh$2
7233
7230
  };
@@ -7486,7 +7483,7 @@ const handlePaste = event => {
7486
7483
  const text = getText(clipboardData);
7487
7484
  return ['paste', text];
7488
7485
  };
7489
- const handleScrollBarVerticalPointerDown = create$L(event => {
7486
+ const handleScrollBarVerticalPointerDown = create$K(event => {
7490
7487
  const {
7491
7488
  clientY
7492
7489
  } = event;
@@ -7609,7 +7606,7 @@ const setLineInfos = (state, dom) => {
7609
7606
  // 1. create -> only create dom elements
7610
7607
  // 2. render -> fill elements with attributes and data
7611
7608
  // that way all dom nodes can be recycled
7612
- const create$m = () => {
7609
+ const create$n = () => {
7613
7610
  const $EditorInput = document.createElement('textarea');
7614
7611
  $EditorInput.className = 'EditorInput';
7615
7612
  $EditorInput.ariaAutoComplete = List;
@@ -7776,7 +7773,7 @@ const setDecorationsDom$1 = (state, decorations) => {
7776
7773
  setDecorationsDom$2(state, decorations);
7777
7774
  };
7778
7775
 
7779
- const create$l = create$m;
7776
+ const create$m = create$n;
7780
7777
  const setText$1 = setText$2;
7781
7778
  const setSelections = setSelections$1;
7782
7779
  const setIncrementalEdits = setIncrementalEdits$1;
@@ -7818,7 +7815,7 @@ const setDecorationsDom = setDecorationsDom$1;
7818
7815
 
7819
7816
  const ViewletEditorText = {
7820
7817
  __proto__: null,
7821
- create: create$l,
7818
+ create: create$m,
7822
7819
  focus: focus$e,
7823
7820
  handleError: handleError$4,
7824
7821
  hideOverlayMessage,
@@ -7834,7 +7831,7 @@ const ViewletEditorText = {
7834
7831
  showOverlayMessage
7835
7832
  };
7836
7833
 
7837
- const create$k = () => {
7834
+ const create$l = () => {
7838
7835
  const $Viewlet = document.createElement('div');
7839
7836
  $Viewlet.className = 'Viewlet EditorWidgetError EditorOverlayMessage';
7840
7837
  return {
@@ -7857,12 +7854,12 @@ const setBounds = (state, x, y, width, height) => {
7857
7854
 
7858
7855
  const ViewletEditorWidgetError = {
7859
7856
  __proto__: null,
7860
- create: create$k,
7857
+ create: create$l,
7861
7858
  setBounds,
7862
7859
  setMessage: setMessage$3
7863
7860
  };
7864
7861
 
7865
- const create$j = () => {
7862
+ const create$k = () => {
7866
7863
  const $Viewlet = document.createElement('div');
7867
7864
  $Viewlet.dataset.viewlet = 'Empty';
7868
7865
  $Viewlet.className = 'Viewlet';
@@ -7876,13 +7873,13 @@ const dispose$a = state => {};
7876
7873
 
7877
7874
  const ViewletEmpty = {
7878
7875
  __proto__: null,
7879
- create: create$j,
7876
+ create: create$k,
7880
7877
  dispose: dispose$a,
7881
7878
  focus: focus$d,
7882
7879
  refresh: refresh$1
7883
7880
  };
7884
7881
 
7885
- const create$i = () => {
7882
+ const create$j = () => {
7886
7883
  const $Viewlet = document.createElement('div');
7887
7884
  $Viewlet.className = 'Viewlet Error';
7888
7885
  return {
@@ -7898,7 +7895,7 @@ const setMessage$2 = (state, message) => {
7898
7895
 
7899
7896
  const ViewletError = {
7900
7897
  __proto__: null,
7901
- create: create$i,
7898
+ create: create$j,
7902
7899
  setMessage: setMessage$2
7903
7900
  };
7904
7901
 
@@ -8115,7 +8112,7 @@ const ViewletExplorerEvents = {
8115
8112
  handleWheel: handleWheel$3
8116
8113
  };
8117
8114
 
8118
- const create$h = () => {
8115
+ const create$i = () => {
8119
8116
  const $Viewlet = document.createElement('div');
8120
8117
  $Viewlet.className = 'Viewlet Explorer';
8121
8118
  $Viewlet.tabIndex = 0;
@@ -8173,7 +8170,7 @@ const setDom$2 = (state, dom) => {
8173
8170
  const ViewletExplorer = {
8174
8171
  __proto__: null,
8175
8172
  Events: Events$9,
8176
- create: create$h,
8173
+ create: create$i,
8177
8174
  dispose: dispose$9,
8178
8175
  focusInput,
8179
8176
  handleError: handleError$3,
@@ -8321,7 +8318,7 @@ const handleTouchEnd = event => {
8321
8318
 
8322
8319
  // based on https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/extensions/browser/extensionsList.ts (License MIT)
8323
8320
 
8324
- const create$g = () => {
8321
+ const create$h = () => {
8325
8322
  const $ExtensionHeader = document.createElement('div');
8326
8323
  $ExtensionHeader.className = 'ExtensionHeader';
8327
8324
 
@@ -8466,7 +8463,7 @@ const ViewletExtensions = {
8466
8463
  __proto__: null,
8467
8464
  attachEvents: attachEvents$7,
8468
8465
  closeSuggest,
8469
- create: create$g,
8466
+ create: create$h,
8470
8467
  dispose: dispose$8,
8471
8468
  focus: focus$c,
8472
8469
  handleError: handleError$2,
@@ -9147,7 +9144,7 @@ const handleBlur$3 = () => {
9147
9144
  const handleKeyDown$1 = handleKeyDown$2;
9148
9145
  const handleKeyUp = handleKeyUp$1;
9149
9146
 
9150
- const create$f = () => {
9147
+ const create$g = () => {
9151
9148
  // TODO use aria role splitter once supported https://github.com/w3c/aria/issues/1348
9152
9149
  const $SashSideBar = document.createElement('div');
9153
9150
  $SashSideBar.className = 'Viewlet Sash SashVertical';
@@ -9203,7 +9200,7 @@ const setSashes = (state, sashSideBar, sashPanel) => {
9203
9200
  const ViewletLayout = {
9204
9201
  __proto__: null,
9205
9202
  attachEvents: attachEvents$6,
9206
- create: create$f,
9203
+ create: create$g,
9207
9204
  setSashes
9208
9205
  };
9209
9206
 
@@ -9221,7 +9218,7 @@ const handleContextMenu$7 = event => {
9221
9218
  };
9222
9219
 
9223
9220
  // TODO Main should not be bound to Editor -> Lazy load Editor
9224
- const create$e = () => {
9221
+ const create$f = () => {
9225
9222
  const $Viewlet = document.createElement('div');
9226
9223
  $Viewlet.id = 'Main';
9227
9224
  $Viewlet.className = 'Viewlet Main';
@@ -9321,7 +9318,7 @@ const ViewletMain = {
9321
9318
  attachEvents: attachEvents$5,
9322
9319
  closeAllViewlets,
9323
9320
  closeViewletAndTab,
9324
- create: create$e,
9321
+ create: create$f,
9325
9322
  dispose: dispose$7,
9326
9323
  focus: focus$a,
9327
9324
  highlightDragOver,
@@ -9348,8 +9345,7 @@ const handleTabsWheel = event => {
9348
9345
  handleTabsWheel$1(uid, deltaX, deltaY);
9349
9346
  };
9350
9347
  const handleDragStart = event => {
9351
- // @ts-expect-error
9352
- setEffectAllowed(CopyMove);
9348
+ setEffectAllowed(event.dataTransfer, CopyMove);
9353
9349
  };
9354
9350
  const handleTabsMouseDown = event => {
9355
9351
  const {
@@ -9370,7 +9366,7 @@ const handleTabsContextMenu = event => {
9370
9366
  handleTabContextMenu(uid, clientX, clientY);
9371
9367
  };
9372
9368
 
9373
- const create$d = () => {
9369
+ const create$e = () => {
9374
9370
  const $MainTabs = document.createElement('div');
9375
9371
  $MainTabs.className = 'Viewlet MainTabs';
9376
9372
  $MainTabs.role = TabList;
@@ -9407,12 +9403,12 @@ const setScrollLeft = (state, scrollLeft) => {
9407
9403
  const ViewletMainTabs = {
9408
9404
  __proto__: null,
9409
9405
  attachEvents: attachEvents$4,
9410
- create: create$d,
9406
+ create: create$e,
9411
9407
  setScrollLeft,
9412
9408
  setTabsDom: setTabsDom$2
9413
9409
  };
9414
9410
 
9415
- const create$c = () => {
9411
+ const create$d = () => {
9416
9412
  const $ViewletOutputContent = document.createElement('div');
9417
9413
  $ViewletOutputContent.className = 'OutputContent';
9418
9414
  $ViewletOutputContent.role = Log;
@@ -9464,7 +9460,7 @@ const dispose$6 = state => {};
9464
9460
  const ViewletOutput = {
9465
9461
  __proto__: null,
9466
9462
  clear,
9467
- create: create$c,
9463
+ create: create$d,
9468
9464
  dispose: dispose$6,
9469
9465
  disposeFindWidget,
9470
9466
  focus: focus$9,
@@ -9517,7 +9513,7 @@ const UiStrings = {
9517
9513
  Close: 'Close',
9518
9514
  Maximize: 'Maximize'
9519
9515
  };
9520
- const create$b = () => {
9516
+ const create$c = () => {
9521
9517
  const $PanelTabs = document.createElement('div');
9522
9518
  $PanelTabs.className = 'PanelTabs';
9523
9519
  $PanelTabs.role = TabList;
@@ -9630,7 +9626,7 @@ const setActionsDom$1 = (state, actions, childUid) => {
9630
9626
  const ViewletPanel = {
9631
9627
  __proto__: null,
9632
9628
  attachEvents: attachEvents$3,
9633
- create: create$b,
9629
+ create: create$c,
9634
9630
  dispose: dispose$5,
9635
9631
  focus: focus$8,
9636
9632
  setActionsDom: setActionsDom$1,
@@ -9701,6 +9697,17 @@ const ViewletProblems = {
9701
9697
  setFocusedIndex: setFocusedIndex$2
9702
9698
  };
9703
9699
 
9700
+ const create$b = () => {
9701
+ const $InputBox = document.createElement('input');
9702
+ $InputBox.className = 'InputBox';
9703
+ $InputBox.spellcheck = false;
9704
+ $InputBox.autocapitalize = 'off';
9705
+ // $InputBox.autocomplete = 'off' // TODO needed?
9706
+ $InputBox.type = 'text';
9707
+ $InputBox.setAttribute('autocorrect', 'off'); // for ios
9708
+ return $InputBox;
9709
+ };
9710
+
9704
9711
  const getIsMobile = () => {
9705
9712
  // @ts-ignore
9706
9713
  if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test') {
@@ -9846,7 +9853,7 @@ const focus$6 = state => {
9846
9853
  // - for nvda ariaRoleDescription works better
9847
9854
 
9848
9855
  const create$a = () => {
9849
- const $QuickPickInput = create$B();
9856
+ const $QuickPickInput = create$b();
9850
9857
  $QuickPickInput.setAttribute(AriaControls, Ids.QuickPickItems); // TODO use idl once supported
9851
9858
  $QuickPickInput.role = ComboBox;
9852
9859
  $QuickPickInput.ariaLabel = 'Type the name of a command to run.';
@@ -10225,6 +10232,10 @@ const handleHeaderClick$1 = event => {
10225
10232
  return ['togglePreserveCase'];
10226
10233
  case 'Toggle Search Details':
10227
10234
  return ['toggleSearchDetails'];
10235
+ case 'Search Only Open Editors':
10236
+ return ['toggleOpenEditors'];
10237
+ case 'Use Exclude Settings':
10238
+ return ['toggleUseIgnoreFiles'];
10228
10239
  default:
10229
10240
  return [];
10230
10241
  }
@@ -11592,7 +11603,7 @@ const handleContextMenu$1 = event => {
11592
11603
  } = event;
11593
11604
  return ['handleContextMenu', button, clientX, clientY];
11594
11605
  };
11595
- const handleSashCornerPointerDown = create$L(event => {
11606
+ const handleSashCornerPointerDown = create$K(event => {
11596
11607
  const {
11597
11608
  clientX,
11598
11609
  clientY