@lvce-editor/editor-worker 7.15.0 → 7.17.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.
- package/dist/editorWorkerMain.js +157 -93
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -1188,7 +1188,8 @@ const getPortTuple = () => {
|
|
|
1188
1188
|
|
|
1189
1189
|
const ModuleWorkerAndWorkaroundForChromeDevtoolsBug = 6;
|
|
1190
1190
|
|
|
1191
|
-
const launchWorker = async (name, url) => {
|
|
1191
|
+
const launchWorker = async (name, url, intializeCommand) => {
|
|
1192
|
+
// TODO use transferMessagePortRpc
|
|
1192
1193
|
const {
|
|
1193
1194
|
port1,
|
|
1194
1195
|
port2
|
|
@@ -1207,6 +1208,9 @@ const launchWorker = async (name, url) => {
|
|
|
1207
1208
|
isMessagePortOpen: true
|
|
1208
1209
|
});
|
|
1209
1210
|
port2.start();
|
|
1211
|
+
if (intializeCommand) {
|
|
1212
|
+
await rpc.invoke(intializeCommand);
|
|
1213
|
+
}
|
|
1210
1214
|
return rpc;
|
|
1211
1215
|
};
|
|
1212
1216
|
|
|
@@ -1261,6 +1265,7 @@ const IndentLess = 'indentLess';
|
|
|
1261
1265
|
const IndentMore = 'indentMore';
|
|
1262
1266
|
const InsertLineBreak = 'insertLineBreak';
|
|
1263
1267
|
const LineComment = 'lineComment';
|
|
1268
|
+
const Rename$1 = 'rename';
|
|
1264
1269
|
const ToggleBlockComment$1 = 'toggleBlockComment';
|
|
1265
1270
|
|
|
1266
1271
|
const map$1 = Object.create(null);
|
|
@@ -1314,7 +1319,7 @@ const get$4 = id => {
|
|
|
1314
1319
|
number(id);
|
|
1315
1320
|
return editors[id];
|
|
1316
1321
|
};
|
|
1317
|
-
const getKeys = () => {
|
|
1322
|
+
const getKeys$1 = () => {
|
|
1318
1323
|
return Object.keys(editors);
|
|
1319
1324
|
};
|
|
1320
1325
|
const set$6 = (id, oldEditor, newEditor) => {
|
|
@@ -2505,6 +2510,48 @@ const applyEdit = async (editor, changes) => {
|
|
|
2505
2510
|
return scheduleDocumentAndCursorsSelections(editor, changes);
|
|
2506
2511
|
};
|
|
2507
2512
|
|
|
2513
|
+
// TODO maybe use a separate worker for bulk edits and bulk edit history
|
|
2514
|
+
|
|
2515
|
+
const getTextChanges = (editor, changes) => {
|
|
2516
|
+
const textChanges = [];
|
|
2517
|
+
for (const change of changes) {
|
|
2518
|
+
if (change.uri === editor.uri) {
|
|
2519
|
+
for (const edit of change.edits) {
|
|
2520
|
+
const startPosition = positionAt(editor, edit.offset);
|
|
2521
|
+
const endPosition = positionAt(editor, edit.offset + edit.deleted);
|
|
2522
|
+
const deleted = getSelectionText(editor, {
|
|
2523
|
+
start: startPosition,
|
|
2524
|
+
end: endPosition
|
|
2525
|
+
});
|
|
2526
|
+
const textChange = {
|
|
2527
|
+
start: startPosition,
|
|
2528
|
+
end: endPosition,
|
|
2529
|
+
inserted: [edit.inserted],
|
|
2530
|
+
deleted,
|
|
2531
|
+
origin: Rename$1
|
|
2532
|
+
};
|
|
2533
|
+
textChanges.push(textChange);
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
return textChanges;
|
|
2538
|
+
};
|
|
2539
|
+
const applyWorkspaceEdit = async (editor, changes) => {
|
|
2540
|
+
object(editor);
|
|
2541
|
+
array(changes);
|
|
2542
|
+
const textChanges = getTextChanges(editor, changes);
|
|
2543
|
+
if (textChanges.length === 0) {
|
|
2544
|
+
return;
|
|
2545
|
+
}
|
|
2546
|
+
// TODO
|
|
2547
|
+
// for now only apply edits to single file, if it matches the uri
|
|
2548
|
+
//
|
|
2549
|
+
// in the future:
|
|
2550
|
+
// 1. if a change targets the current editor, apply an edit to this editor
|
|
2551
|
+
// 2. else, use file system worker to write file change
|
|
2552
|
+
return scheduleDocumentAndCursorsSelections(editor, textChanges);
|
|
2553
|
+
};
|
|
2554
|
+
|
|
2508
2555
|
const handleBlur$1 = editor => {
|
|
2509
2556
|
if (editor.focusKey !== Empty) {
|
|
2510
2557
|
return editor;
|
|
@@ -2900,11 +2947,7 @@ const launchRenameWorker = async () => {
|
|
|
2900
2947
|
const name = 'Rename Worker';
|
|
2901
2948
|
const url = 'renameWorkerMain.js';
|
|
2902
2949
|
const rpc = await launchWorker(name, url);
|
|
2903
|
-
|
|
2904
|
-
await rpc.invoke('Rename.initialize');
|
|
2905
|
-
} catch {
|
|
2906
|
-
// ignore
|
|
2907
|
-
}
|
|
2950
|
+
await rpc.invoke('Rename.initialize');
|
|
2908
2951
|
return rpc;
|
|
2909
2952
|
};
|
|
2910
2953
|
|
|
@@ -5217,8 +5260,8 @@ const create$4 = () => {
|
|
|
5217
5260
|
const launchCompletionWorker = async () => {
|
|
5218
5261
|
const name = 'Completion Worker';
|
|
5219
5262
|
const url = 'completionWorkerMain.js';
|
|
5220
|
-
const
|
|
5221
|
-
await
|
|
5263
|
+
const intializeCommand = 'Completions.initialize';
|
|
5264
|
+
const rpc = await launchWorker(name, url, intializeCommand);
|
|
5222
5265
|
return rpc;
|
|
5223
5266
|
};
|
|
5224
5267
|
|
|
@@ -5389,7 +5432,6 @@ const create$2 = () => {
|
|
|
5389
5432
|
};
|
|
5390
5433
|
|
|
5391
5434
|
const newStateGenerator$1 = async (state, parentUid) => {
|
|
5392
|
-
// const editor: any = {}
|
|
5393
5435
|
const {
|
|
5394
5436
|
uid,
|
|
5395
5437
|
x,
|
|
@@ -5397,7 +5439,11 @@ const newStateGenerator$1 = async (state, parentUid) => {
|
|
|
5397
5439
|
width,
|
|
5398
5440
|
height
|
|
5399
5441
|
} = state;
|
|
5400
|
-
|
|
5442
|
+
const editor = get$4(parentUid);
|
|
5443
|
+
const {
|
|
5444
|
+
languageId
|
|
5445
|
+
} = editor;
|
|
5446
|
+
await invoke$4('Rename.create', uid, x, y, width, height, parentUid, languageId);
|
|
5401
5447
|
await invoke$4('Rename.loadContent', uid);
|
|
5402
5448
|
const diff = await invoke$4('Rename.diff2', uid);
|
|
5403
5449
|
const commands = await invoke$4('Rename.render2', uid, diff);
|
|
@@ -7615,7 +7661,7 @@ const render$c = widget => {
|
|
|
7615
7661
|
return wrappedCommands;
|
|
7616
7662
|
};
|
|
7617
7663
|
const add$7 = widget => {
|
|
7618
|
-
return addWidget$1(widget, '
|
|
7664
|
+
return addWidget$1(widget, 'EditorCompletion', render$c);
|
|
7619
7665
|
};
|
|
7620
7666
|
const remove$7 = widget => {
|
|
7621
7667
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
@@ -7636,13 +7682,13 @@ const {
|
|
|
7636
7682
|
toggleDetails,
|
|
7637
7683
|
closeDetails,
|
|
7638
7684
|
handleWheel,
|
|
7639
|
-
close: close$
|
|
7685
|
+
close: close$2
|
|
7640
7686
|
} = createFns(['handleEditorType', 'focusFirst', 'focusNext', 'focusPrevious', 'focusLast', 'handleEditorDeleteLeft', 'openDetails', 'focusIndex', 'handleEditorBlur', 'handleEditorClick', 'openDetails', 'selectCurrent', 'selectIndex', 'toggleDetails', 'closeDetails', 'handleWheel', 'close'], 'Completions', Completion);
|
|
7641
7687
|
|
|
7642
7688
|
const EditorCompletionWidget = {
|
|
7643
7689
|
__proto__: null,
|
|
7644
7690
|
add: add$7,
|
|
7645
|
-
close: close$
|
|
7691
|
+
close: close$2,
|
|
7646
7692
|
closeDetails,
|
|
7647
7693
|
focusFirst,
|
|
7648
7694
|
focusIndex: focusIndex$1,
|
|
@@ -7691,7 +7737,7 @@ const remove$6 = widget => {
|
|
|
7691
7737
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
7692
7738
|
};
|
|
7693
7739
|
const {
|
|
7694
|
-
close,
|
|
7740
|
+
close: close$1,
|
|
7695
7741
|
focusCloseButton,
|
|
7696
7742
|
focusFind,
|
|
7697
7743
|
focusNext: focusNext$1,
|
|
@@ -7704,7 +7750,7 @@ const {
|
|
|
7704
7750
|
focusToggleReplace,
|
|
7705
7751
|
handleBlur,
|
|
7706
7752
|
handleFocus,
|
|
7707
|
-
handleInput,
|
|
7753
|
+
handleInput: handleInput$1,
|
|
7708
7754
|
handleReplaceFocus,
|
|
7709
7755
|
handleReplaceInput,
|
|
7710
7756
|
handleToggleReplaceFocus,
|
|
@@ -7714,7 +7760,7 @@ const {
|
|
|
7714
7760
|
const EditorFindWidget = {
|
|
7715
7761
|
__proto__: null,
|
|
7716
7762
|
add: add$6,
|
|
7717
|
-
close,
|
|
7763
|
+
close: close$1,
|
|
7718
7764
|
focusCloseButton,
|
|
7719
7765
|
focusFind,
|
|
7720
7766
|
focusNext: focusNext$1,
|
|
@@ -7727,7 +7773,7 @@ const EditorFindWidget = {
|
|
|
7727
7773
|
focusToggleReplace,
|
|
7728
7774
|
handleBlur,
|
|
7729
7775
|
handleFocus,
|
|
7730
|
-
handleInput,
|
|
7776
|
+
handleInput: handleInput$1,
|
|
7731
7777
|
handleReplaceFocus,
|
|
7732
7778
|
handleReplaceInput,
|
|
7733
7779
|
handleToggleReplaceFocus,
|
|
@@ -7943,6 +7989,46 @@ const renderHover = (oldState, newState) => {
|
|
|
7943
7989
|
return commands;
|
|
7944
7990
|
};
|
|
7945
7991
|
|
|
7992
|
+
const removeWidget$1 = widget => {
|
|
7993
|
+
// @ts-ignore
|
|
7994
|
+
return [['Viewlet.send', widget.newState.uid, 'dispose']];
|
|
7995
|
+
};
|
|
7996
|
+
|
|
7997
|
+
const render$9 = widget => {
|
|
7998
|
+
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
7999
|
+
const wrappedCommands = [];
|
|
8000
|
+
const {
|
|
8001
|
+
uid
|
|
8002
|
+
} = widget.newState;
|
|
8003
|
+
for (const command of commands) {
|
|
8004
|
+
if (command[0] === SetDom2 || command[0] === SetCss || command[0] === AppendToBody || command[0] === SetBounds2 || command[0] === RegisterEventListeners || command[0] === SetSelectionByName || command[0] === SetValueByName || command[0] === SetFocusContext || command[0] === SetUid || command[0] === 'Viewlet.focusSelector') {
|
|
8005
|
+
wrappedCommands.push(command);
|
|
8006
|
+
} else {
|
|
8007
|
+
wrappedCommands.push(['Viewlet.send', uid, ...command]);
|
|
8008
|
+
}
|
|
8009
|
+
}
|
|
8010
|
+
return wrappedCommands;
|
|
8011
|
+
};
|
|
8012
|
+
const add$5 = widget => {
|
|
8013
|
+
return addWidget$1(widget, 'EditorRename', render$9);
|
|
8014
|
+
};
|
|
8015
|
+
const remove$5 = removeWidget$1;
|
|
8016
|
+
const {
|
|
8017
|
+
handleInput,
|
|
8018
|
+
close,
|
|
8019
|
+
accept
|
|
8020
|
+
} = createFns(['handleInput', 'close', 'accept'], 'Rename', Rename);
|
|
8021
|
+
|
|
8022
|
+
const EditorRenameWidget = {
|
|
8023
|
+
__proto__: null,
|
|
8024
|
+
accept,
|
|
8025
|
+
add: add$5,
|
|
8026
|
+
close,
|
|
8027
|
+
handleInput,
|
|
8028
|
+
remove: remove$5,
|
|
8029
|
+
render: render$9
|
|
8030
|
+
};
|
|
8031
|
+
|
|
7946
8032
|
const rerender = editor => {
|
|
7947
8033
|
// TODO avoid slow clone
|
|
7948
8034
|
return structuredClone(editor);
|
|
@@ -8564,13 +8650,17 @@ const getKeyBindings = () => {
|
|
|
8564
8650
|
}];
|
|
8565
8651
|
};
|
|
8566
8652
|
|
|
8653
|
+
const getKeys = () => {
|
|
8654
|
+
return getKeys$1();
|
|
8655
|
+
};
|
|
8656
|
+
|
|
8567
8657
|
const getDiagnostics = editor => {
|
|
8568
8658
|
return executeDiagnosticProvider(editor);
|
|
8569
8659
|
};
|
|
8570
8660
|
const getProblems = async () => {
|
|
8571
8661
|
// TODO maybe combine querying diagnostics for problems view with diagnostics for editor
|
|
8572
8662
|
// or query the diagnostics for the problems view directtly from the extension host worker
|
|
8573
|
-
const keys = getKeys();
|
|
8663
|
+
const keys = getKeys$1();
|
|
8574
8664
|
const editors = keys.map(key => {
|
|
8575
8665
|
const numericKey = parseInt(key);
|
|
8576
8666
|
const editor = get$4(numericKey);
|
|
@@ -9490,7 +9580,7 @@ const renderWidget = widget => {
|
|
|
9490
9580
|
}
|
|
9491
9581
|
return module.render(widget);
|
|
9492
9582
|
};
|
|
9493
|
-
const removeWidget
|
|
9583
|
+
const removeWidget = widget => {
|
|
9494
9584
|
const module = get$5(widget.id);
|
|
9495
9585
|
if (!module) {
|
|
9496
9586
|
throw new Error('unsupported widget');
|
|
@@ -9645,7 +9735,7 @@ const renderWidgets = {
|
|
|
9645
9735
|
}
|
|
9646
9736
|
const removeCommands = [];
|
|
9647
9737
|
for (const removedWidget of removedWidgets) {
|
|
9648
|
-
const childCommands = removeWidget
|
|
9738
|
+
const childCommands = removeWidget(removedWidget);
|
|
9649
9739
|
if (childCommands.length > 0) {
|
|
9650
9740
|
removeCommands.push(...childCommands);
|
|
9651
9741
|
}
|
|
@@ -9655,7 +9745,7 @@ const renderWidgets = {
|
|
|
9655
9745
|
},
|
|
9656
9746
|
multiple: true
|
|
9657
9747
|
};
|
|
9658
|
-
const render$
|
|
9748
|
+
const render$8 = [renderLines, renderSelections, renderScrollBarX, renderScrollBarY, renderFocus$1, renderDecorations, renderGutterInfo, renderWidgets];
|
|
9659
9749
|
const renderEditor = async id => {
|
|
9660
9750
|
const instance = get$4(id);
|
|
9661
9751
|
if (!instance) {
|
|
@@ -9667,7 +9757,7 @@ const renderEditor = async id => {
|
|
|
9667
9757
|
} = instance;
|
|
9668
9758
|
const commands = [];
|
|
9669
9759
|
set$6(id, newState, newState);
|
|
9670
|
-
for (const item of render$
|
|
9760
|
+
for (const item of render$8) {
|
|
9671
9761
|
if (!item.isEqual(oldState, newState)) {
|
|
9672
9762
|
const result = await item.apply(oldState, newState);
|
|
9673
9763
|
// @ts-ignore
|
|
@@ -9733,7 +9823,7 @@ const getDebugHighlight = async debugId => {
|
|
|
9733
9823
|
};
|
|
9734
9824
|
|
|
9735
9825
|
const getKey = () => {
|
|
9736
|
-
const keys = getKeys();
|
|
9826
|
+
const keys = getKeys$1();
|
|
9737
9827
|
return parseInt(keys[0]);
|
|
9738
9828
|
};
|
|
9739
9829
|
const updateDebugInfo = async debugId => {
|
|
@@ -9767,7 +9857,7 @@ const editorDiagnosticEffect = {
|
|
|
9767
9857
|
}
|
|
9768
9858
|
};
|
|
9769
9859
|
|
|
9770
|
-
const keep = ['ActivateByEvent.activateByEvent', 'Editor.applyEdit2', 'Editor.applyEdits2', 'Editor.closeFind2', 'Editor.closeWidget2', 'Editor.create', 'Editor.getKeyBindings', 'Editor.getLines2', 'Editor.getPositionAtCursor', 'Editor.getOffsetAtCursor', 'Editor.getQuickPickMenuEntries', 'Editor.getSelections', 'Editor.getSelections2', 'Editor.getText', 'Editor.getWordAt', 'Editor.getWordAt2', 'Editor.getWordAtOffset2', 'Editor.getUri', 'Editor.getWordBefore', 'Editor.getWordBefore2', 'Editor.offsetAt', 'Editor.render', 'Editor.setSelections2', 'Editor.updateDebugInfo', 'Editor.getLanguageId', 'Editor.getProblems', 'Font.ensure', 'HandleMessagePort.handleMessagePort', 'Hover.getHoverInfo', 'Hover.handleSashPointerDown', 'Hover.handleSashPointerMove', 'Hover.handleSashPointerUp', 'Hover.loadContent', 'Hover.render', 'Initialize.initialize', 'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker'
|
|
9860
|
+
const keep = ['ActivateByEvent.activateByEvent', 'ExtensionHostManagement.activateByEvent', 'Editor.applyEdit2', 'Editor.applyEdits2', 'Editor.closeFind2', 'Editor.closeWidget2', 'Editor.create', 'Editor.getKeyBindings', 'Editor.getLines2', 'Editor.getPositionAtCursor', 'Editor.getOffsetAtCursor', 'Editor.getQuickPickMenuEntries', 'Editor.getSelections', 'Editor.getSelections2', 'Editor.getText', 'Editor.getWordAt', 'Editor.getWordAt2', 'Editor.getWordAtOffset2', 'Editor.getUri', 'Editor.getWordBefore', 'Editor.getWordBefore2', 'Editor.offsetAt', 'Editor.render', 'Editor.setSelections2', 'Editor.updateDebugInfo', 'Editor.getLanguageId', 'Editor.getProblems', 'Editor.getKeys', 'Font.ensure', 'HandleMessagePort.handleMessagePort', 'Hover.getHoverInfo', 'Hover.handleSashPointerDown', 'Hover.handleSashPointerMove', 'Hover.handleSashPointerUp', 'Hover.loadContent', 'Hover.render', 'Initialize.initialize', 'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker'
|
|
9771
9861
|
// 'ColorPicker.handleSliderPointerDown',
|
|
9772
9862
|
// 'ColorPicker.handleSliderPointerMove',
|
|
9773
9863
|
// 'ColorPicker.loadContent',
|
|
@@ -9856,12 +9946,14 @@ const wrapCommands = commands => {
|
|
|
9856
9946
|
|
|
9857
9947
|
const commandMap = {
|
|
9858
9948
|
'ActivateByEvent.activateByEvent': activateByEvent,
|
|
9949
|
+
'ExtensionHostManagement.activateByEvent': activateByEvent,
|
|
9859
9950
|
'CodeGenerator.accept': codeGeneratorAccept,
|
|
9860
9951
|
'ColorPicker.loadContent': loadContent$2,
|
|
9861
9952
|
'Editor.addCursorAbove': addCursorAbove,
|
|
9862
9953
|
'Editor.addCursorBelow': addCursorBelow,
|
|
9863
9954
|
'Editor.applyEdit': applyEdit,
|
|
9864
9955
|
'Editor.applyEdit2': applyEdits2,
|
|
9956
|
+
'Editor.applyWorkspaceEdit': applyWorkspaceEdit,
|
|
9865
9957
|
'Editor.braceCompletion': braceCompletion,
|
|
9866
9958
|
'Editor.cancelSelection': cancelSelection,
|
|
9867
9959
|
'Editor.closeCodeGenerator': closeCodeGenerator,
|
|
@@ -9907,15 +9999,17 @@ const commandMap = {
|
|
|
9907
9999
|
'Editor.findAllReferences': findAllReferences,
|
|
9908
10000
|
'Editor.format': format,
|
|
9909
10001
|
'Editor.getKeyBindings': getKeyBindings,
|
|
10002
|
+
'Editor.getKeys': getKeys,
|
|
10003
|
+
'Editor.getLanguageId': getLanguageId,
|
|
9910
10004
|
'Editor.getLines2': getLines2,
|
|
9911
10005
|
'Editor.getOffsetAtCursor': getOffsetAtCursor,
|
|
9912
10006
|
'Editor.getPositionAtCursor': getPositionAtCursor,
|
|
10007
|
+
'Editor.getProblems': getProblems,
|
|
9913
10008
|
'Editor.getQuickPickMenuEntries': getQuickPickMenuEntries,
|
|
9914
10009
|
'Editor.getSelections': getSelections,
|
|
9915
10010
|
'Editor.getSelections2': getSelections2,
|
|
9916
|
-
'Editor.getLanguageId': getLanguageId,
|
|
9917
|
-
'Editor.getUri': getUri,
|
|
9918
10011
|
'Editor.getText': getText,
|
|
10012
|
+
'Editor.getUri': getUri,
|
|
9919
10013
|
'Editor.getWordAt': getWordAt$1,
|
|
9920
10014
|
'Editor.getWordAt2': getWordAt,
|
|
9921
10015
|
'Editor.getWordAtOffset2': getWordAtOffset2,
|
|
@@ -9968,7 +10062,6 @@ const commandMap = {
|
|
|
9968
10062
|
'Editor.paste': paste,
|
|
9969
10063
|
'Editor.pasteText': pasteText,
|
|
9970
10064
|
'Editor.render': renderEditor,
|
|
9971
|
-
'Editor.getProblems': getProblems,
|
|
9972
10065
|
'Editor.renderEventListeners': renderEventListeners,
|
|
9973
10066
|
'Editor.replaceRange': replaceRange,
|
|
9974
10067
|
'Editor.rerender': rerender,
|
|
@@ -10011,7 +10104,7 @@ const commandMap = {
|
|
|
10011
10104
|
'Editor.unIndent': editorUnindent,
|
|
10012
10105
|
'Editor.updateDebugInfo': updateDebugInfo,
|
|
10013
10106
|
'Editor.updateDiagnostics': updateDiagnostics,
|
|
10014
|
-
'EditorCompletion.close': close$
|
|
10107
|
+
'EditorCompletion.close': close$2,
|
|
10015
10108
|
'EditorCompletion.closeDetails': closeDetails,
|
|
10016
10109
|
'EditorCompletion.focusFirst': focusFirst,
|
|
10017
10110
|
'EditorCompletion.focusIndex': focusIndex$1,
|
|
@@ -10026,8 +10119,11 @@ const commandMap = {
|
|
|
10026
10119
|
'EditorCompletion.selectCurrent': selectCurrent,
|
|
10027
10120
|
'EditorCompletion.selectIndex': selectIndex,
|
|
10028
10121
|
'EditorCompletion.toggleDetails': toggleDetails,
|
|
10122
|
+
'EditorRename.accept': accept,
|
|
10123
|
+
'EditorRename.close': close,
|
|
10124
|
+
'EditorRename.handleInput': handleInput,
|
|
10029
10125
|
'EditorSourceActions.focusNext': focusNext,
|
|
10030
|
-
'FindWidget.close': close,
|
|
10126
|
+
'FindWidget.close': close$1,
|
|
10031
10127
|
'FindWidget.focusCloseButton': focusCloseButton,
|
|
10032
10128
|
'FindWidget.focusFind': focusFind,
|
|
10033
10129
|
'FindWidget.focusNext': focusNext$1,
|
|
@@ -10040,7 +10136,7 @@ const commandMap = {
|
|
|
10040
10136
|
'FindWidget.focusToggleReplace': focusToggleReplace,
|
|
10041
10137
|
'FindWidget.handleBlur': handleBlur,
|
|
10042
10138
|
'FindWidget.handleFocus': handleFocus,
|
|
10043
|
-
'FindWidget.handleInput': handleInput,
|
|
10139
|
+
'FindWidget.handleInput': handleInput$1,
|
|
10044
10140
|
'FindWidget.handleReplaceFocus': handleReplaceFocus,
|
|
10045
10141
|
'FindWidget.handleReplaceInput': handleReplaceInput,
|
|
10046
10142
|
'FindWidget.handleToggleReplaceFocus': handleToggleReplaceFocus,
|
|
@@ -10066,11 +10162,6 @@ const listen = async () => {
|
|
|
10066
10162
|
set$8(rpc);
|
|
10067
10163
|
};
|
|
10068
10164
|
|
|
10069
|
-
const removeWidget = widget => {
|
|
10070
|
-
// @ts-ignore
|
|
10071
|
-
return [['Viewlet.send', widget.newState.uid, 'dispose']];
|
|
10072
|
-
};
|
|
10073
|
-
|
|
10074
10165
|
const CodeGeneratorInput = 'CodeGeneratorInput';
|
|
10075
10166
|
|
|
10076
10167
|
const getCodeGeneratorVirtualDom = state => {
|
|
@@ -10124,10 +10215,10 @@ const renderFocus = {
|
|
|
10124
10215
|
return [Focus, '.CodeGeneratorInput', newState.focusSource];
|
|
10125
10216
|
}
|
|
10126
10217
|
};
|
|
10127
|
-
const render$
|
|
10218
|
+
const render$7 = [renderContent$1, renderBounds$2, renderFocus];
|
|
10128
10219
|
const renderFull$2 = (oldState, newState) => {
|
|
10129
10220
|
const commands = [];
|
|
10130
|
-
for (const item of render$
|
|
10221
|
+
for (const item of render$7) {
|
|
10131
10222
|
if (!item.isEqual(oldState, newState)) {
|
|
10132
10223
|
commands.push(item.apply(oldState, newState));
|
|
10133
10224
|
}
|
|
@@ -10135,7 +10226,7 @@ const renderFull$2 = (oldState, newState) => {
|
|
|
10135
10226
|
return commands;
|
|
10136
10227
|
};
|
|
10137
10228
|
|
|
10138
|
-
const render$
|
|
10229
|
+
const render$6 = widget => {
|
|
10139
10230
|
const commands = renderFull$2(widget.oldState, widget.newState);
|
|
10140
10231
|
const wrappedCommands = [];
|
|
10141
10232
|
const {
|
|
@@ -10151,16 +10242,16 @@ const render$7 = widget => {
|
|
|
10151
10242
|
}
|
|
10152
10243
|
return wrappedCommands;
|
|
10153
10244
|
};
|
|
10154
|
-
const add$
|
|
10155
|
-
return addWidget$1(widget, 'EditorCodeGenerator', render$
|
|
10245
|
+
const add$4 = widget => {
|
|
10246
|
+
return addWidget$1(widget, 'EditorCodeGenerator', render$6);
|
|
10156
10247
|
};
|
|
10157
|
-
const remove$
|
|
10248
|
+
const remove$4 = removeWidget$1;
|
|
10158
10249
|
|
|
10159
10250
|
const EditorCodeGeneratorWidget = {
|
|
10160
10251
|
__proto__: null,
|
|
10161
|
-
add: add$
|
|
10162
|
-
remove: remove$
|
|
10163
|
-
render: render$
|
|
10252
|
+
add: add$4,
|
|
10253
|
+
remove: remove$4,
|
|
10254
|
+
render: render$6
|
|
10164
10255
|
};
|
|
10165
10256
|
|
|
10166
10257
|
const renderFull$1 = (oldState, newState) => {
|
|
@@ -10170,7 +10261,7 @@ const renderFull$1 = (oldState, newState) => {
|
|
|
10170
10261
|
return commands;
|
|
10171
10262
|
};
|
|
10172
10263
|
|
|
10173
|
-
const render$
|
|
10264
|
+
const render$5 = widget => {
|
|
10174
10265
|
const commands = renderFull$1(widget.oldState, widget.newState);
|
|
10175
10266
|
const wrappedCommands = [];
|
|
10176
10267
|
const {
|
|
@@ -10185,18 +10276,18 @@ const render$6 = widget => {
|
|
|
10185
10276
|
}
|
|
10186
10277
|
return wrappedCommands;
|
|
10187
10278
|
};
|
|
10188
|
-
const add$
|
|
10189
|
-
return addWidget$1(widget, 'ColorPicker', render$
|
|
10279
|
+
const add$3 = widget => {
|
|
10280
|
+
return addWidget$1(widget, 'ColorPicker', render$5);
|
|
10190
10281
|
};
|
|
10191
|
-
const remove$
|
|
10282
|
+
const remove$3 = removeWidget$1;
|
|
10192
10283
|
const Commands = {};
|
|
10193
10284
|
|
|
10194
10285
|
const EditorColorPickerWidget = {
|
|
10195
10286
|
__proto__: null,
|
|
10196
10287
|
Commands,
|
|
10197
|
-
add: add$
|
|
10198
|
-
remove: remove$
|
|
10199
|
-
render: render$
|
|
10288
|
+
add: add$3,
|
|
10289
|
+
remove: remove$3,
|
|
10290
|
+
render: render$5
|
|
10200
10291
|
};
|
|
10201
10292
|
|
|
10202
10293
|
const getCompletionDetailVirtualDom = content => {
|
|
@@ -10254,9 +10345,9 @@ const renderBounds$1 = {
|
|
|
10254
10345
|
return [/* method */SetBounds, /* x */x, /* y */y, /* width */width, /* height */height];
|
|
10255
10346
|
}
|
|
10256
10347
|
};
|
|
10257
|
-
const render$
|
|
10348
|
+
const render$4 = [renderContent, renderBounds$1];
|
|
10258
10349
|
const renderFull = (oldState, newState) => {
|
|
10259
|
-
return renderParts(render$
|
|
10350
|
+
return renderParts(render$4, oldState, newState);
|
|
10260
10351
|
};
|
|
10261
10352
|
|
|
10262
10353
|
const getWidgetState = (editor, id) => {
|
|
@@ -10275,7 +10366,7 @@ const getCompletionState = editor => {
|
|
|
10275
10366
|
return getWidgetState(editor, Completion);
|
|
10276
10367
|
};
|
|
10277
10368
|
|
|
10278
|
-
const render$
|
|
10369
|
+
const render$3 = widget => {
|
|
10279
10370
|
const commands = renderFull(widget.oldState, widget.newState);
|
|
10280
10371
|
const wrappedCommands = [];
|
|
10281
10372
|
const {
|
|
@@ -10290,10 +10381,10 @@ const render$4 = widget => {
|
|
|
10290
10381
|
}
|
|
10291
10382
|
return wrappedCommands;
|
|
10292
10383
|
};
|
|
10293
|
-
const add$
|
|
10294
|
-
return addWidget$1(widget, 'EditorCompletionDetails', render$
|
|
10384
|
+
const add$2 = widget => {
|
|
10385
|
+
return addWidget$1(widget, 'EditorCompletionDetails', render$3);
|
|
10295
10386
|
};
|
|
10296
|
-
const remove$
|
|
10387
|
+
const remove$2 = removeWidget$1;
|
|
10297
10388
|
const handleEditorType = (editor, state) => {
|
|
10298
10389
|
const completionState = getCompletionState(editor);
|
|
10299
10390
|
if (!completionState) {
|
|
@@ -10325,49 +10416,22 @@ const handleEditorDeleteLeft = (editor, state) => {
|
|
|
10325
10416
|
|
|
10326
10417
|
const EditorCompletionDetailWidget = {
|
|
10327
10418
|
__proto__: null,
|
|
10328
|
-
add: add$
|
|
10419
|
+
add: add$2,
|
|
10329
10420
|
handleEditorDeleteLeft,
|
|
10330
10421
|
handleEditorType,
|
|
10331
|
-
remove: remove$3,
|
|
10332
|
-
render: render$4
|
|
10333
|
-
};
|
|
10334
|
-
|
|
10335
|
-
const render$3 = widget => {
|
|
10336
|
-
const commands = renderHover(widget.oldState, widget.newState);
|
|
10337
|
-
const wrappedCommands = [];
|
|
10338
|
-
const {
|
|
10339
|
-
uid
|
|
10340
|
-
} = widget.newState;
|
|
10341
|
-
for (const command of commands) {
|
|
10342
|
-
if (command[0] === SetDom2) {
|
|
10343
|
-
wrappedCommands.push([command[0], uid, ...command.slice(1)]);
|
|
10344
|
-
} else {
|
|
10345
|
-
wrappedCommands.push(['Viewlet.send', uid, ...command]);
|
|
10346
|
-
}
|
|
10347
|
-
}
|
|
10348
|
-
return wrappedCommands;
|
|
10349
|
-
};
|
|
10350
|
-
const add$2 = widget => {
|
|
10351
|
-
return addWidget$1(widget, 'EditorHover', render$3);
|
|
10352
|
-
};
|
|
10353
|
-
const remove$2 = removeWidget;
|
|
10354
|
-
|
|
10355
|
-
const EditorHoverWidget = {
|
|
10356
|
-
__proto__: null,
|
|
10357
|
-
add: add$2,
|
|
10358
10422
|
remove: remove$2,
|
|
10359
10423
|
render: render$3
|
|
10360
10424
|
};
|
|
10361
10425
|
|
|
10362
10426
|
const render$2 = widget => {
|
|
10363
|
-
const commands =
|
|
10427
|
+
const commands = renderHover(widget.oldState, widget.newState);
|
|
10364
10428
|
const wrappedCommands = [];
|
|
10365
10429
|
const {
|
|
10366
10430
|
uid
|
|
10367
10431
|
} = widget.newState;
|
|
10368
10432
|
for (const command of commands) {
|
|
10369
|
-
if (command[0] === SetDom2
|
|
10370
|
-
wrappedCommands.push(command);
|
|
10433
|
+
if (command[0] === SetDom2) {
|
|
10434
|
+
wrappedCommands.push([command[0], uid, ...command.slice(1)]);
|
|
10371
10435
|
} else {
|
|
10372
10436
|
wrappedCommands.push(['Viewlet.send', uid, ...command]);
|
|
10373
10437
|
}
|
|
@@ -10375,11 +10439,11 @@ const render$2 = widget => {
|
|
|
10375
10439
|
return wrappedCommands;
|
|
10376
10440
|
};
|
|
10377
10441
|
const add$1 = widget => {
|
|
10378
|
-
return addWidget$1(widget, '
|
|
10442
|
+
return addWidget$1(widget, 'EditorHover', render$2);
|
|
10379
10443
|
};
|
|
10380
|
-
const remove$1 = removeWidget;
|
|
10444
|
+
const remove$1 = removeWidget$1;
|
|
10381
10445
|
|
|
10382
|
-
const
|
|
10446
|
+
const EditorHoverWidget = {
|
|
10383
10447
|
__proto__: null,
|
|
10384
10448
|
add: add$1,
|
|
10385
10449
|
remove: remove$1,
|
|
@@ -10513,7 +10577,7 @@ const render = widget => {
|
|
|
10513
10577
|
const add = widget => {
|
|
10514
10578
|
return addWidget$1(widget, 'EditorSourceActions', render);
|
|
10515
10579
|
};
|
|
10516
|
-
const remove = removeWidget;
|
|
10580
|
+
const remove = removeWidget$1;
|
|
10517
10581
|
|
|
10518
10582
|
const EditorSourceActionWidget = {
|
|
10519
10583
|
__proto__: null,
|