@lvce-editor/editor-worker 19.69.1 → 19.69.3

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.
@@ -1187,7 +1187,7 @@ const createMockRpc = ({
1187
1187
  };
1188
1188
 
1189
1189
  const rpcs = Object.create(null);
1190
- const set$h = (id, rpc) => {
1190
+ const set$i = (id, rpc) => {
1191
1191
  rpcs[id] = rpc;
1192
1192
  };
1193
1193
  const get$9 = id => {
@@ -1220,7 +1220,7 @@ const create$c = rpcId => {
1220
1220
  const mockRpc = createMockRpc({
1221
1221
  commandMap
1222
1222
  });
1223
- set$h(rpcId, mockRpc);
1223
+ set$i(rpcId, mockRpc);
1224
1224
  // @ts-ignore
1225
1225
  mockRpc[Symbol.dispose] = () => {
1226
1226
  remove$8(rpcId);
@@ -1229,7 +1229,7 @@ const create$c = rpcId => {
1229
1229
  return mockRpc;
1230
1230
  },
1231
1231
  set(rpc) {
1232
- set$h(rpcId, rpc);
1232
+ set$i(rpcId, rpc);
1233
1233
  }
1234
1234
  };
1235
1235
  };
@@ -1328,23 +1328,23 @@ const FocusEditorText$1 = 12;
1328
1328
 
1329
1329
  const {
1330
1330
  invoke: invoke$j,
1331
- set: set$g
1331
+ set: set$h
1332
1332
  } = create$c(DialogWorker);
1333
1333
 
1334
1334
  const {
1335
1335
  invoke: invoke$i,
1336
- set: set$f
1336
+ set: set$g
1337
1337
  } = create$c(DragAndDropWorker);
1338
1338
 
1339
1339
  const {
1340
1340
  invoke: invoke$h,
1341
- set: set$e
1341
+ set: set$f
1342
1342
  } = create$c(ErrorWorker);
1343
1343
 
1344
1344
  const {
1345
1345
  invoke: invoke$g,
1346
1346
  invokeAndTransfer: invokeAndTransfer$2,
1347
- set: set$d
1347
+ set: set$e
1348
1348
  } = create$c(ExtensionManagementWorker);
1349
1349
  const getLanguages$1 = (platform, assetDir) => {
1350
1350
  return invoke$g('Extensions.getLanguages', platform, assetDir);
@@ -1363,7 +1363,7 @@ const createLazyRpc = rpcId => {
1363
1363
  throw new Error('Lazy RPC launch was superseded');
1364
1364
  }
1365
1365
  activeRpc = rpc;
1366
- set$h(rpcId, rpc);
1366
+ set$i(rpcId, rpc);
1367
1367
  return rpc;
1368
1368
  };
1369
1369
  const ensureRpc = async () => {
@@ -1425,7 +1425,7 @@ const createLazyRpc = rpcId => {
1425
1425
 
1426
1426
  const {
1427
1427
  invoke: invoke$f,
1428
- set: set$c
1428
+ set: set$d
1429
1429
  } = create$c(OpenerWorker);
1430
1430
  const openUrl = async (url, platform) => {
1431
1431
  return invoke$f('Open.openUrl', url, platform);
@@ -1433,13 +1433,13 @@ const openUrl = async (url, platform) => {
1433
1433
 
1434
1434
  const {
1435
1435
  invoke: invoke$e,
1436
- set: set$b
1436
+ set: set$c
1437
1437
  } = create$c(TextMeasurementWorker);
1438
1438
 
1439
1439
  const {
1440
1440
  invoke: invoke$d,
1441
1441
  invokeAndTransfer: invokeAndTransfer$1,
1442
- set: set$a
1442
+ set: set$b
1443
1443
  } = create$c(RendererWorker);
1444
1444
  const showContextMenu2 = async (uid, menuId, x, y, args) => {
1445
1445
  number(uid);
@@ -1494,13 +1494,13 @@ const sendMessagePortToSyntaxHighlightingWorker$1 = async port => {
1494
1494
 
1495
1495
  const {
1496
1496
  invoke: invoke$c,
1497
- set: set$9
1497
+ set: set$a
1498
1498
  } = create$c(MarkdownWorker);
1499
1499
 
1500
1500
  const SyntaxHighlightingWorker = {
1501
1501
  __proto__: null,
1502
1502
  invoke: invoke$c,
1503
- set: set$9
1503
+ set: set$a
1504
1504
  };
1505
1505
 
1506
1506
  const toCommandId = key => {
@@ -1811,7 +1811,7 @@ const getKeys$2 = () => {
1811
1811
  const keys = editorStates.getKeys();
1812
1812
  return keys.map(String);
1813
1813
  };
1814
- const set$8 = (id, oldEditor, newEditor) => {
1814
+ const set$9 = (id, oldEditor, newEditor) => {
1815
1815
  editorStates.set(id, oldEditor, newEditor);
1816
1816
  };
1817
1817
 
@@ -1862,7 +1862,7 @@ const ToggleBlockComment$1 = 'toggleBlockComment';
1862
1862
  const Unknown$2 = 'unknown';
1863
1863
 
1864
1864
  const map$1 = Object.create(null);
1865
- const set$7 = (id, widget) => {
1865
+ const set$8 = (id, widget) => {
1866
1866
  map$1[id] = widget;
1867
1867
  };
1868
1868
  const get$7 = id => {
@@ -2506,7 +2506,7 @@ const getEnabled$1 = () => {
2506
2506
 
2507
2507
  const {
2508
2508
  invoke: invoke$b,
2509
- set: set$6
2509
+ set: set$7
2510
2510
  } = SyntaxHighlightingWorker;
2511
2511
 
2512
2512
  const state$c = {
@@ -2517,7 +2517,7 @@ const state$c = {
2517
2517
  const has = languageId => {
2518
2518
  return Object.hasOwn(state$c.tokenizers, languageId);
2519
2519
  };
2520
- const set$5 = (languageId, tokenizer) => {
2520
+ const set$6 = (languageId, tokenizer) => {
2521
2521
  state$c.tokenizers[languageId] = tokenizer;
2522
2522
  };
2523
2523
  const get$6 = languageId => {
@@ -2541,7 +2541,7 @@ const isPending = languageId => {
2541
2541
  };
2542
2542
 
2543
2543
  const tokenMaps = Object.create(null);
2544
- const set$4 = (languageId, tokenMap) => {
2544
+ const set$5 = (languageId, tokenMap) => {
2545
2545
  tokenMaps[languageId] = tokenMap;
2546
2546
  };
2547
2547
  const get$5 = languageId => {
@@ -2557,7 +2557,7 @@ const loadTokenizer = async (languageId, tokenizePath) => {
2557
2557
  if (getEnabled$1()) {
2558
2558
  // @ts-ignore
2559
2559
  const tokenMap = await invoke$b('Tokenizer.load', languageId, tokenizePath);
2560
- set$4(languageId, tokenMap);
2560
+ set$5(languageId, tokenMap);
2561
2561
  return;
2562
2562
  }
2563
2563
  try {
@@ -2573,8 +2573,8 @@ const loadTokenizer = async (languageId, tokenizePath) => {
2573
2573
  console.warn(`tokenizer.TokenMap should be an object in "${tokenizePath}"`);
2574
2574
  return;
2575
2575
  }
2576
- set$4(languageId, tokenizer.TokenMap);
2577
- set$5(languageId, tokenizer);
2576
+ set$5(languageId, tokenizer.TokenMap);
2577
+ set$6(languageId, tokenizer);
2578
2578
  } catch (error) {
2579
2579
  // TODO better error handling
2580
2580
  console.error(error);
@@ -2591,7 +2591,7 @@ const getTokenizer = languageId => {
2591
2591
  };
2592
2592
 
2593
2593
  const tokenizers = Object.create(null);
2594
- const set$3 = (id, value) => {
2594
+ const set$4 = (id, value) => {
2595
2595
  tokenizers[id] = value;
2596
2596
  };
2597
2597
  const get$4 = id => {
@@ -4372,7 +4372,7 @@ const scheduleDocumentAndCursorsSelections = async (editor, changes, selectionCh
4372
4372
  ...newEditor,
4373
4373
  decorations: linkDecorations
4374
4374
  };
4375
- set$8(editor.uid, editor, newEditorWithDecorations);
4375
+ set$9(editor.uid, editor, newEditorWithDecorations);
4376
4376
 
4377
4377
  // Notify main-area-worker about modified status change
4378
4378
  if (!editor.modified) {
@@ -5255,7 +5255,7 @@ const updateColorPickerValue = async (editorUid, value) => {
5255
5255
  return;
5256
5256
  }
5257
5257
  const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
5258
- set$8(editorUid, editor, newEditorWithDerivedState);
5258
+ set$9(editorUid, editor, newEditorWithDerivedState);
5259
5259
  };
5260
5260
 
5261
5261
  const getColorPickerWorkerCommandMap = () => ({
@@ -5466,7 +5466,7 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir, _langua
5466
5466
  x,
5467
5467
  y
5468
5468
  };
5469
- set$8(id, editor, editor);
5469
+ set$9(id, editor, editor);
5470
5470
  };
5471
5471
 
5472
5472
  const emptyEditor = {
@@ -5809,10 +5809,10 @@ const createEditor = async ({
5809
5809
  focused: true,
5810
5810
  textInfos
5811
5811
  };
5812
- set$8(id, emptyEditor, newEditor4);
5812
+ set$9(id, emptyEditor, newEditor4);
5813
5813
  const completionsOnTypeRaw = await get$3('editor.completionsOnType');
5814
5814
  const completionsOnType = Boolean(completionsOnTypeRaw);
5815
- set$8(id, emptyEditor, {
5815
+ set$9(id, emptyEditor, {
5816
5816
  ...newEditor4,
5817
5817
  completionsOnType
5818
5818
  });
@@ -5843,7 +5843,7 @@ const createStandaloneEditor = async ({
5843
5843
  const createdEditor = get$8(id).newState;
5844
5844
  await loadTokenizer(languageId, tokenizePath);
5845
5845
  const tokenizerId = createdEditor.tokenizerId + 1;
5846
- set$3(tokenizerId, getTokenizer(languageId));
5846
+ set$4(tokenizerId, getTokenizer(languageId));
5847
5847
  const configuredEditor = {
5848
5848
  ...createdEditor,
5849
5849
  charWidth,
@@ -5888,7 +5888,7 @@ const createStandaloneEditor = async ({
5888
5888
  selectionInfos
5889
5889
  };
5890
5890
  if (!createdEditor.lifecycle?.disposed) {
5891
- set$8(id, createdEditor, finalEditor);
5891
+ set$9(id, createdEditor, finalEditor);
5892
5892
  }
5893
5893
  };
5894
5894
 
@@ -6001,6 +6001,19 @@ const dispose$4 = uid => {
6001
6001
  pendingSaves.delete(uid);
6002
6002
  };
6003
6003
 
6004
+ const dismissals = new Map();
6005
+ const clear$2 = editorUid => {
6006
+ const dismissal = dismissals.get(editorUid);
6007
+ if (dismissal) {
6008
+ clearTimeout(dismissal.timeout);
6009
+ dismissals.delete(editorUid);
6010
+ }
6011
+ };
6012
+ const set$3 = (editorUid, dismissal) => {
6013
+ clear$2(editorUid);
6014
+ dismissals.set(editorUid, dismissal);
6015
+ };
6016
+
6004
6017
  const state$6 = {
6005
6018
  editor: undefined,
6006
6019
  timeout: -1,
@@ -6391,7 +6404,7 @@ const commitDiagnostics = async (editor, generation, diagnostics) => {
6391
6404
  return latest.newState;
6392
6405
  }
6393
6406
  const newEditor = mergeDiagnostics(latest.newState, editorWithDiagnostics);
6394
- set$8(editor.id, latest.oldState, newEditor);
6407
+ set$9(editor.id, latest.oldState, newEditor);
6395
6408
  requestDiagnosticSnapshots.set(editor.id, diagnostics);
6396
6409
  await invoke$5('Editor.renderPending', newEditor.id);
6397
6410
  await notifyDiagnosticsChange(newEditor.uri, newEditor.applicationId);
@@ -6546,6 +6559,7 @@ const disposeEditor = async editorUid => {
6546
6559
  dispose$2(editorUid);
6547
6560
  dispose$4(editorUid);
6548
6561
  clear$1(editorUid);
6562
+ clear$2(editorUid);
6549
6563
  dispose$1(editorUid);
6550
6564
  const pending = [];
6551
6565
  if (getEnabled$1()) {
@@ -10013,6 +10027,53 @@ const handleMouseDown = async (state, button, altKey, ctrlKey, x, y, detail, shi
10013
10027
  };
10014
10028
  };
10015
10029
 
10030
+ const editorHoverDismissDelay = 500;
10031
+ const handleMouseLeave = (viewletUid, editorUidValue) => {
10032
+ const targetEditorUid = editorUidValue ?? viewletUid;
10033
+ const editorUid = Number(targetEditorUid);
10034
+ const instance = get$8(editorUid);
10035
+ if (!instance) {
10036
+ return;
10037
+ }
10038
+ const {
10039
+ widgets = []
10040
+ } = instance.newState;
10041
+ clear$1(editorUid);
10042
+ clear$2(editorUid);
10043
+ const hoverWidget = widgets.find(widget => widget.id === Hover);
10044
+ if (!hoverWidget) {
10045
+ return;
10046
+ }
10047
+ const timeout = setTimeout(async () => {
10048
+ clear$2(editorUid);
10049
+ const latestInstance = get$8(editorUid);
10050
+ if (!latestInstance) {
10051
+ return;
10052
+ }
10053
+ const latestEditor = latestInstance.newState;
10054
+ const latestHoverWidget = latestEditor.widgets?.find(widget => widget.id === Hover);
10055
+ if (latestHoverWidget !== hoverWidget) {
10056
+ return;
10057
+ }
10058
+ const newEditor = {
10059
+ ...latestEditor,
10060
+ additionalFocus: 0,
10061
+ focused: true,
10062
+ widgetRevision: next(editorUid),
10063
+ widgets: removeEditorWidget(latestEditor.widgets, Hover)
10064
+ };
10065
+ set$9(editorUid, latestEditor, newEditor);
10066
+ await invoke$d('Editor.renderPending', editorUid);
10067
+ }, editorHoverDismissDelay);
10068
+ set$3(editorUid, {
10069
+ timeout
10070
+ });
10071
+ };
10072
+ const handleMouseEnter = (viewletUid, editorUidValue) => {
10073
+ const targetEditorUid = editorUidValue ?? viewletUid;
10074
+ clear$2(Number(targetEditorUid));
10075
+ };
10076
+
10016
10077
  const RE_ALPHA_NUMERIC = /[a-zA-Z\d]/;
10017
10078
  const isAlphaNumeric = char => {
10018
10079
  return RE_ALPHA_NUMERIC.test(char);
@@ -10432,7 +10493,7 @@ const showHover = async (editor, position, token) => {
10432
10493
  if (latestEditor === newEditor || !latestInstance || latestInstance.newState !== latestEditor || get$2().token !== token) {
10433
10494
  return;
10434
10495
  }
10435
- set$8(editor.uid, latestInstance.oldState, newEditor);
10496
+ set$9(editor.uid, latestInstance.oldState, newEditor);
10436
10497
  await invoke$d('Editor.renderPending', editor.uid);
10437
10498
  };
10438
10499
 
@@ -10694,7 +10755,7 @@ const continueScrollingAndMovingSelection = async editorUid => {
10694
10755
  }
10695
10756
  return;
10696
10757
  }
10697
- set$8(editor.uid, editor, derivedEditor);
10758
+ set$9(editor.uid, editor, derivedEditor);
10698
10759
  if (derivedEditor.hasListener) {
10699
10760
  requestAnimationFrame(() => continueScrollingAndMovingSelection(editorUid));
10700
10761
  }
@@ -11483,7 +11544,7 @@ const updateEditor = async (editorUid, editor, newEditor) => {
11483
11544
  return;
11484
11545
  }
11485
11546
  const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
11486
- set$8(editorUid, editor, newEditorWithDerivedState);
11547
+ set$9(editorUid, editor, newEditorWithDerivedState);
11487
11548
  };
11488
11549
  const applyDocumentEdits = async (editorUid, edits) => {
11489
11550
  const editor = getEditor$1(editorUid);
@@ -11533,7 +11594,7 @@ const launch = async () => {
11533
11594
  return;
11534
11595
  }
11535
11596
  const rpc = await launchFindWidgetWorker();
11536
- set$h(rpcId, rpc);
11597
+ set$i(rpcId, rpc);
11537
11598
  };
11538
11599
  const invoke$3 = async (method, ...params) => {
11539
11600
  const rpc = get$9(rpcId);
@@ -11664,7 +11725,7 @@ const createFn = (key, name, widgetId) => {
11664
11725
  const latestAfterInvoke = get$8(editor.uid).newState;
11665
11726
  const latestChildIndex = latestAfterInvoke.widgets.findIndex(isWidget);
11666
11727
  if (latestChildIndex === -1) {
11667
- set$8(editor.uid, editor, latestAfterInvoke);
11728
+ set$9(editor.uid, editor, latestAfterInvoke);
11668
11729
  await dispose$3();
11669
11730
  return latestAfterInvoke;
11670
11731
  }
@@ -11678,7 +11739,7 @@ const createFn = (key, name, widgetId) => {
11678
11739
  widgetRevision,
11679
11740
  widgets: removeEditorWidget(latest.widgets, widgetId)
11680
11741
  };
11681
- set$8(editor.uid, latest, newEditor);
11742
+ set$9(editor.uid, latest, newEditor);
11682
11743
  return newEditor;
11683
11744
  }
11684
11745
  const newState = {
@@ -11686,7 +11747,7 @@ const createFn = (key, name, widgetId) => {
11686
11747
  commands
11687
11748
  };
11688
11749
  const newEditor = updateWidget(latest, widgetId, newState);
11689
- set$8(editor.uid, editor, newEditor);
11750
+ set$9(editor.uid, editor, newEditor);
11690
11751
  return newEditor;
11691
11752
  };
11692
11753
  return fn;
@@ -12716,7 +12777,7 @@ const setLanguageId = async (editor, languageId, tokenizePath, isExplicit = fals
12716
12777
  await loadTokenizer(languageId, tokenizePath);
12717
12778
  const tokenizer = getTokenizer(languageId);
12718
12779
  const newTokenizerId = tokenizerId + 1;
12719
- set$3(newTokenizerId, tokenizer);
12780
+ set$4(newTokenizerId, tokenizer);
12720
12781
  return {
12721
12782
  ...editor,
12722
12783
  explicitLanguageId: isExplicit ? languageId : editor.explicitLanguageId,
@@ -14050,6 +14111,8 @@ const HandleKeyUp = 34;
14050
14111
  const HandleLightBulbClick = 35;
14051
14112
  const HandleMergeConflictActionClick = 36;
14052
14113
  const HandleMergeConflictActionsMouseDown = 37;
14114
+ const HandleMouseOut = 38;
14115
+ const HandleMouseOver = 39;
14053
14116
 
14054
14117
  const Button$1 = 1;
14055
14118
  const Div = 4;
@@ -14383,11 +14446,14 @@ const getEditorHoverClassName = (lineInfos, documentationVirtualDom, diagnostics
14383
14446
  const isDiagnosticOnly = diagnostics?.length === 1 && lineInfos.length === 0 && documentationVirtualDom.length === 0;
14384
14447
  return mergeClassNames('Viewlet', 'EditorHover', isDiagnosticOnly ? EditorHoverDiagnosticOnly : '');
14385
14448
  };
14386
- const getHoverVirtualDom = (lineInfos, documentationVirtualDom, diagnostics) => {
14449
+ const getHoverVirtualDom = (lineInfos, documentationVirtualDom, diagnostics, editorUid = 0) => {
14387
14450
  const dom = [];
14388
14451
  dom.push({
14389
14452
  childCount: getChildCount(lineInfos, documentationVirtualDom, diagnostics) + 1,
14390
14453
  className: getEditorHoverClassName(lineInfos, documentationVirtualDom, diagnostics),
14454
+ 'data-uid': editorUid,
14455
+ onMouseOut: HandleMouseOut,
14456
+ onMouseOver: HandleMouseOver,
14391
14457
  type: Div
14392
14458
  });
14393
14459
  if (diagnostics && diagnostics.length > 0) {
@@ -14417,10 +14483,10 @@ const getHoverVirtualDom = (lineInfos, documentationVirtualDom, diagnostics) =>
14417
14483
 
14418
14484
  const renderHoverDom = {
14419
14485
  apply(oldState, newState) {
14420
- const dom = getHoverVirtualDom(newState.lineInfos, newState.documentationVirtualDom, newState.diagnostics);
14486
+ const dom = getHoverVirtualDom(newState.lineInfos, newState.documentationVirtualDom, newState.diagnostics, newState.editorUid);
14421
14487
  return [/* method */SetDom2, dom];
14422
14488
  },
14423
- isEqual: (oldState, newState) => oldState.lineInfos === newState.lineInfos && oldState.documentationVirtualDom === newState.documentationVirtualDom && oldState.diagnostics === newState.diagnostics
14489
+ isEqual: (oldState, newState) => oldState.lineInfos === newState.lineInfos && oldState.documentationVirtualDom === newState.documentationVirtualDom && oldState.diagnostics === newState.diagnostics && oldState.editorUid === newState.editorUid
14424
14490
  };
14425
14491
  const renderBounds$2 = {
14426
14492
  apply(oldState, newState) {
@@ -14694,7 +14760,7 @@ const setSelections2 = async (editorUid, selections) => {
14694
14760
  const editor = getEditor$1(editorUid);
14695
14761
  const newEditor = setSelections$2(editor, selections);
14696
14762
  const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
14697
- set$8(editorUid, editor, newEditorWithDerivedState);
14763
+ set$9(editorUid, editor, newEditorWithDerivedState);
14698
14764
  };
14699
14765
  const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocus$1) => {
14700
14766
  const editor = getEditor$1(editorUid);
@@ -14718,7 +14784,7 @@ const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocu
14718
14784
  widgets: newWidgets
14719
14785
  };
14720
14786
  const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
14721
- set$8(editorUid, editor, newEditorWithDerivedState);
14787
+ set$9(editorUid, editor, newEditorWithDerivedState);
14722
14788
  await setFocus(FocusEditorText);
14723
14789
  if (unsetAdditionalFocus$1) {
14724
14790
  await unsetAdditionalFocus(unsetAdditionalFocus$1);
@@ -14731,7 +14797,7 @@ const applyEdits2 = async (editorUid, edits, selectionChanges) => {
14731
14797
  const editor = getEditor$1(editorUid);
14732
14798
  const newEditor = await applyEdit(editor, edits, selectionChanges);
14733
14799
  const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
14734
- set$8(editorUid, editor, newEditorWithDerivedState);
14800
+ set$9(editorUid, editor, newEditorWithDerivedState);
14735
14801
  };
14736
14802
  const getSourceActions = async editorUid => {
14737
14803
  const actions = await getEditorSourceActions(editorUid);
@@ -15402,7 +15468,7 @@ const handleMessagePort = async (port, rpcId) => {
15402
15468
  messagePort: port
15403
15469
  });
15404
15470
  if (rpcId) {
15405
- set$h(rpcId, rpc);
15471
+ set$i(rpcId, rpc);
15406
15472
  await initializeListener(rpcId);
15407
15473
  }
15408
15474
  };
@@ -15809,7 +15875,7 @@ const hotReload = async () => {
15809
15875
  await relaunchWorkers();
15810
15876
  const newEditors = await restoreWidgetState(keys, savedStates);
15811
15877
  for (const editor of newEditors) {
15812
- set$8(editor.newState.uid, editor.oldState, editor.newState);
15878
+ set$9(editor.newState.uid, editor.oldState, editor.newState);
15813
15879
  }
15814
15880
 
15815
15881
  // TODO ask renderer worker to rerender all editors
@@ -15847,7 +15913,7 @@ const initializeSyntaxHighlighting = async (syntaxHighlightingEnabled, syncIncre
15847
15913
  if (syntaxHighlightingEnabled) {
15848
15914
  setEnabled$1(true);
15849
15915
  const syntaxRpc = await createSyntaxHighlightingWorkerRpc();
15850
- set$6(syntaxRpc);
15916
+ set$7(syntaxRpc);
15851
15917
  }
15852
15918
  if (syncIncremental) {
15853
15919
  setEnabled(true);
@@ -16044,7 +16110,7 @@ const loadContent = async (state, savedState, largeFile = false) => {
16044
16110
  await loadTokenizer(computedLanguageId, tokenizePath);
16045
16111
  const tokenizer = getTokenizer(computedLanguageId);
16046
16112
  const newTokenizerId = state.tokenizerId + 1;
16047
- set$3(newTokenizerId, tokenizer);
16113
+ set$4(newTokenizerId, tokenizer);
16048
16114
  effectiveEditor.tokenizerId = newTokenizerId;
16049
16115
  }
16050
16116
  const savedHistory = existingEditor ? undefined : getSavedHistory(savedState, content);
@@ -16188,7 +16254,7 @@ const refreshGutterDecorationsAll = async () => {
16188
16254
  if (!latest) {
16189
16255
  continue;
16190
16256
  }
16191
- set$8(editor.id, latest.oldState, {
16257
+ set$9(editor.id, latest.oldState, {
16192
16258
  ...latest.newState,
16193
16259
  gutterDecorations: refreshedEditor.gutterDecorations
16194
16260
  });
@@ -17095,6 +17161,8 @@ const getEditorVirtualDom = ({
17095
17161
  className: Editor,
17096
17162
  'data-uid': uid,
17097
17163
  onContextMenu: HandleContextMenu,
17164
+ onMouseOut: HandleMouseOut,
17165
+ onMouseOver: HandleMouseOver,
17098
17166
  role: Code,
17099
17167
  type: Div
17100
17168
  }, ...breadcrumbsDom, ...gutterDom, ...getEditorContentVirtualDom({
@@ -17290,7 +17358,7 @@ const render2 = (uid, _diffResult) => {
17290
17358
  } = editor;
17291
17359
  // Diagnostics can change after the caller calculated its diff in a separate RPC.
17292
17360
  const diffResult = diff(oldState, newState);
17293
- set$8(uid, newState, newState);
17361
+ set$9(uid, newState, newState);
17294
17362
  const commands = applyRender(oldState, newState, diffResult);
17295
17363
  return commands;
17296
17364
  };
@@ -17399,7 +17467,7 @@ const renderEditor = async id => {
17399
17467
  oldState
17400
17468
  } = instance;
17401
17469
  const commands = [];
17402
- set$8(id, newState, newState);
17470
+ set$9(id, newState, newState);
17403
17471
  for (const item of render$7) {
17404
17472
  if (item.isEqual(oldState, newState)) {
17405
17473
  continue;
@@ -17436,6 +17504,12 @@ const renderEventListeners = () => {
17436
17504
  }, {
17437
17505
  name: HandleMouseMove,
17438
17506
  params: ['handleMouseMove', ClientX, ClientY, AltKey]
17507
+ }, {
17508
+ name: HandleMouseOut,
17509
+ params: ['handleMouseLeave', 'event.currentTarget.dataset.uid']
17510
+ }, {
17511
+ name: HandleMouseOver,
17512
+ params: ['handleMouseEnter', 'event.currentTarget.dataset.uid']
17439
17513
  }, {
17440
17514
  name: HandleKeyUp,
17441
17515
  params: ['handleKeyUp', Key]
@@ -17604,7 +17678,7 @@ const updateDebugInfo = async debugId => {
17604
17678
  ...newState,
17605
17679
  highlightedLine: newInfo.rowIndex
17606
17680
  };
17607
- set$8(key, oldState, newEditor);
17681
+ set$9(key, oldState, newEditor);
17608
17682
  // @ts-ignore
17609
17683
  await invoke$d('Editor.rerender', key);
17610
17684
  };
@@ -17701,7 +17775,7 @@ const wrapCommand$1 = (fn, preservesTypingCoalescing = false, returnState = true
17701
17775
  return returnState ? newEditor : undefined;
17702
17776
  }
17703
17777
  const newEditorWithDerivedState = await updateDerivedState(state, newEditor);
17704
- set$8(uid, state, newEditorWithDerivedState);
17778
+ set$9(uid, state, newEditorWithDerivedState);
17705
17779
  await dispose$3();
17706
17780
  if (editorDiagnosticEffect.isActive(state, newEditorWithDerivedState)) {
17707
17781
  void editorDiagnosticEffect.apply(newEditorWithDerivedState);
@@ -17730,7 +17804,7 @@ const wrapCommand$1 = (fn, preservesTypingCoalescing = false, returnState = true
17730
17804
  undoStack: finalEditor.undoStack,
17731
17805
  visualDecorations: finalEditor.visualDecorations
17732
17806
  });
17733
- set$8(otherUid, instance.oldState, synchronizedEditor);
17807
+ set$9(otherUid, instance.oldState, synchronizedEditor);
17734
17808
  if (editorDiagnosticEffect.isActive(editor, synchronizedEditor)) {
17735
17809
  void editorDiagnosticEffect.apply(synchronizedEditor);
17736
17810
  }
@@ -17881,6 +17955,8 @@ const commandMap = {
17881
17955
  'Editor.handleKeyUp': wrapCommand(handleKeyUp, true),
17882
17956
  'Editor.handleMergeConflictActionsMouseDown': wrapCommand(handleMergeConflictActionsMouseDown),
17883
17957
  'Editor.handleMouseDown': wrapCommand(handleMouseDown),
17958
+ 'Editor.handleMouseEnter': handleMouseEnter,
17959
+ 'Editor.handleMouseLeave': handleMouseLeave,
17884
17960
  'Editor.handleMouseMove': wrapCommand(handleMouseMove),
17885
17961
  'Editor.handleMouseMoveWithAltKey': wrapCommand(handleMouseMoveWithAltKey),
17886
17962
  'Editor.handleNativeSelectionChange': editorHandleNativeSelectionChange,
@@ -18008,6 +18084,8 @@ const commandMap = {
18008
18084
  'EditorCompletion.handleEditorClick': handleEditorClick,
18009
18085
  'EditorCompletion.handleEditorDeleteLeft': handleEditorDeleteLeft$1,
18010
18086
  'EditorCompletion.handleEditorType': handleEditorType$1,
18087
+ 'EditorCompletion.handleMouseEnter': handleMouseEnter,
18088
+ 'EditorCompletion.handleMouseLeave': handleMouseLeave,
18011
18089
  'EditorCompletion.handlePointerDown': handlePointerDown,
18012
18090
  'EditorCompletion.handleWheel': handleWheel$1,
18013
18091
  'EditorCompletion.openDetails': openDetails,
@@ -18060,6 +18138,8 @@ const commandMap = {
18060
18138
  'Font.ensure': ensure,
18061
18139
  'HandleMessagePort.handleMessagePort': handleMessagePort,
18062
18140
  'Hover.getHoverInfo': getEditorHoverInfo,
18141
+ 'Hover.handleMouseEnter': handleMouseEnter,
18142
+ 'Hover.handleMouseLeave': handleMouseLeave,
18063
18143
  'Hover.handleSashPointerDown': handleSashPointerDown,
18064
18144
  'Hover.handleSashPointerMove': handleSashPointerMove,
18065
18145
  'Hover.handleSashPointerUp': handleSashPointerUp,
@@ -18086,7 +18166,7 @@ const initializeDragAndDropWorker = async () => {
18086
18166
  commandMap: {},
18087
18167
  send: sendMessagePortToDragAndDropWorker
18088
18168
  });
18089
- set$f(rpc);
18169
+ set$g(rpc);
18090
18170
  };
18091
18171
 
18092
18172
  const initializeErrorWorker = async () => {
@@ -18096,7 +18176,7 @@ const initializeErrorWorker = async () => {
18096
18176
  return sendMessagePortToErrorWorker(port, EditorWorker);
18097
18177
  }
18098
18178
  });
18099
- set$e(rpc);
18179
+ set$f(rpc);
18100
18180
  };
18101
18181
 
18102
18182
  const createExtensionManagementWorkerRpc = async () => {
@@ -18112,7 +18192,7 @@ const createExtensionManagementWorkerRpc = async () => {
18112
18192
  const initializeExtensionManagementWorker = async () => {
18113
18193
  try {
18114
18194
  const rpc = await createExtensionManagementWorkerRpc();
18115
- set$d(rpc);
18195
+ set$e(rpc);
18116
18196
  } catch {
18117
18197
  // ignore
18118
18198
  }
@@ -18127,14 +18207,14 @@ const initializeOpenerWorker = async () => {
18127
18207
  commandMap: {},
18128
18208
  send: send$1
18129
18209
  });
18130
- set$c(rpc);
18210
+ set$d(rpc);
18131
18211
  };
18132
18212
 
18133
18213
  const initializeRendererWorker = async () => {
18134
18214
  const rpc = await create$d({
18135
18215
  commandMap: commandMap
18136
18216
  });
18137
- set$a(rpc);
18217
+ set$b(rpc);
18138
18218
  };
18139
18219
 
18140
18220
  const send = port => {
@@ -18145,7 +18225,7 @@ const initializeTextMeasurementWorker = async () => {
18145
18225
  commandMap: {},
18146
18226
  send
18147
18227
  });
18148
- set$b(rpc);
18228
+ set$c(rpc);
18149
18229
  };
18150
18230
 
18151
18231
  const listen = async () => {
@@ -18155,7 +18235,7 @@ const listen = async () => {
18155
18235
  commandMap: {},
18156
18236
  send: sendMessagePortToDialogWorker
18157
18237
  });
18158
- set$g(dialogRpc);
18238
+ set$h(dialogRpc);
18159
18239
  };
18160
18240
 
18161
18241
  const CodeGeneratorInput = 'CodeGeneratorInput';
@@ -18416,7 +18496,7 @@ const render$1 = widget => {
18416
18496
  newState,
18417
18497
  oldState
18418
18498
  } = widget;
18419
- const commands = newState.commands.length > 0 ? renderFull$3(oldState, newState) : [[SetDom2, newState.uid, getHoverVirtualDom(newState.lineInfos, newState.documentationVirtualDom, newState.diagnostics)], [SetBounds2, newState.uid, newState.x, newState.y, newState.width, newState.height]];
18499
+ const commands = newState.commands.length > 0 ? renderFull$3(oldState, newState) : [[SetDom2, newState.uid, getHoverVirtualDom(newState.lineInfos, newState.documentationVirtualDom, newState.diagnostics, newState.editorUid)], [SetBounds2, newState.uid, newState.x, newState.y, newState.width, newState.height]];
18420
18500
  const wrappedCommands = [];
18421
18501
  const {
18422
18502
  uid
@@ -18428,6 +18508,10 @@ const render$1 = widget => {
18428
18508
  wrappedCommands.push(['Viewlet.send', uid, ...command]);
18429
18509
  }
18430
18510
  }
18511
+ if (commands.every(([method]) => method !== RegisterEventListeners)) {
18512
+ wrappedCommands.unshift([RegisterEventListeners, uid, renderEventListeners()]);
18513
+ }
18514
+ wrappedCommands.push([SetUid, uid, newState.editorUid]);
18431
18515
  return wrappedCommands;
18432
18516
  };
18433
18517
  const add$1 = widget => {
@@ -18475,15 +18559,15 @@ const EditorMessageWidget = {
18475
18559
  };
18476
18560
 
18477
18561
  const registerWidgets = () => {
18478
- set$7(ColorPicker$2, EditorColorPickerWidget);
18479
- set$7(Completion, EditorCompletionWidget);
18480
- set$7(CompletionDetail, EditorCompletionDetailWidget);
18481
- set$7(Find, EditorFindWidget);
18482
- set$7(Hover, EditorHoverWidget);
18483
- set$7(Message, EditorMessageWidget);
18484
- set$7(Rename$1, EditorRenameWidget);
18485
- set$7(SourceAction$1, EditorSourceActionWidget);
18486
- set$7(CodeGenerator, EditorCodeGeneratorWidget);
18562
+ set$8(ColorPicker$2, EditorColorPickerWidget);
18563
+ set$8(Completion, EditorCompletionWidget);
18564
+ set$8(CompletionDetail, EditorCompletionDetailWidget);
18565
+ set$8(Find, EditorFindWidget);
18566
+ set$8(Hover, EditorHoverWidget);
18567
+ set$8(Message, EditorMessageWidget);
18568
+ set$8(Rename$1, EditorRenameWidget);
18569
+ set$8(SourceAction$1, EditorSourceActionWidget);
18570
+ set$8(CodeGenerator, EditorCodeGeneratorWidget);
18487
18571
  };
18488
18572
 
18489
18573
  const handleUnhandledRejection = event => {
@@ -84,11 +84,11 @@
84
84
  "id": "editor.wordWrap",
85
85
  "options": [
86
86
  {
87
- "id": "editor.on",
87
+ "id": "on",
88
88
  "label": "On"
89
89
  },
90
90
  {
91
- "id": "editor.off",
91
+ "id": "off",
92
92
  "label": "off"
93
93
  }
94
94
  ],
@@ -102,11 +102,11 @@
102
102
  "id": "editor.lineNumbers",
103
103
  "options": [
104
104
  {
105
- "id": "editor.on",
105
+ "id": "on",
106
106
  "label": "On"
107
107
  },
108
108
  {
109
- "id": "editor.off",
109
+ "id": "off",
110
110
  "label": "off"
111
111
  }
112
112
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.69.1",
3
+ "version": "19.69.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"