@lvce-editor/editor-worker 19.17.2 → 19.17.4
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/api/api.d.ts +2 -0
- package/dist/editorWorkerMain.js +247 -205
- package/dist/editorWorkerMain.min.js +1 -1
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -1540,12 +1540,12 @@ const launchColorPickerWorker = async () => {
|
|
|
1540
1540
|
return launchWorker(name, url);
|
|
1541
1541
|
};
|
|
1542
1542
|
|
|
1543
|
-
const state$
|
|
1543
|
+
const state$c = {};
|
|
1544
1544
|
const getOrCreate$3 = () => {
|
|
1545
|
-
if (!state$
|
|
1546
|
-
state$
|
|
1545
|
+
if (!state$c.workerPromise) {
|
|
1546
|
+
state$c.workerPromise = launchColorPickerWorker();
|
|
1547
1547
|
}
|
|
1548
|
-
return state$
|
|
1548
|
+
return state$c.workerPromise;
|
|
1549
1549
|
};
|
|
1550
1550
|
const invoke$9 = async (method, ...params) => {
|
|
1551
1551
|
const worker = await getOrCreate$3();
|
|
@@ -1572,6 +1572,7 @@ const loadContent$3 = async (state, parentUid) => {
|
|
|
1572
1572
|
|
|
1573
1573
|
const editorStates = create$j();
|
|
1574
1574
|
const {
|
|
1575
|
+
dispose: dispose$1,
|
|
1575
1576
|
getCommandIds,
|
|
1576
1577
|
registerCommands,
|
|
1577
1578
|
wrapGetter
|
|
@@ -1859,7 +1860,7 @@ const getInitialLineState = initialLineState => {
|
|
|
1859
1860
|
return deepCopy(initialLineState);
|
|
1860
1861
|
};
|
|
1861
1862
|
|
|
1862
|
-
const state$
|
|
1863
|
+
const state$b = {
|
|
1863
1864
|
warned: []
|
|
1864
1865
|
};
|
|
1865
1866
|
const flattenTokensArray = tokens => {
|
|
@@ -1871,10 +1872,10 @@ const flattenTokensArray = tokens => {
|
|
|
1871
1872
|
return flattened;
|
|
1872
1873
|
};
|
|
1873
1874
|
const warnDeprecatedArrayReturn = (languageId, fn) => {
|
|
1874
|
-
if (state$
|
|
1875
|
+
if (state$b.warned.includes(fn)) {
|
|
1875
1876
|
return;
|
|
1876
1877
|
}
|
|
1877
|
-
state$
|
|
1878
|
+
state$b.warned.push(fn);
|
|
1878
1879
|
console.warn(`tokenizers without hasArrayReturn=false are deprecated (language ${languageId})`);
|
|
1879
1880
|
};
|
|
1880
1881
|
const safeTokenizeLine = (languageId, tokenizeLine, line, lineStateAtStart, hasArrayReturn) => {
|
|
@@ -1935,14 +1936,14 @@ const TokenizePlainText = {
|
|
|
1935
1936
|
tokenizeLine
|
|
1936
1937
|
};
|
|
1937
1938
|
|
|
1938
|
-
const state$
|
|
1939
|
+
const state$a = {
|
|
1939
1940
|
enabled: false
|
|
1940
1941
|
};
|
|
1941
1942
|
const setEnabled$1 = value => {
|
|
1942
|
-
state$
|
|
1943
|
+
state$a.enabled = value;
|
|
1943
1944
|
};
|
|
1944
1945
|
const getEnabled$1 = () => {
|
|
1945
|
-
return state$
|
|
1946
|
+
return state$a.enabled;
|
|
1946
1947
|
};
|
|
1947
1948
|
|
|
1948
1949
|
const {
|
|
@@ -1950,25 +1951,25 @@ const {
|
|
|
1950
1951
|
set: set$6
|
|
1951
1952
|
} = SyntaxHighlightingWorker;
|
|
1952
1953
|
|
|
1953
|
-
const state$
|
|
1954
|
+
const state$9 = {
|
|
1954
1955
|
pending: Object.create(null),
|
|
1955
1956
|
tokenizePaths: Object.create(null),
|
|
1956
1957
|
tokenizers: Object.create(null)
|
|
1957
1958
|
};
|
|
1958
1959
|
const has = languageId => {
|
|
1959
|
-
return Object.hasOwn(state$
|
|
1960
|
+
return Object.hasOwn(state$9.tokenizers, languageId);
|
|
1960
1961
|
};
|
|
1961
1962
|
const set$5 = (languageId, tokenizer) => {
|
|
1962
|
-
state$
|
|
1963
|
+
state$9.tokenizers[languageId] = tokenizer;
|
|
1963
1964
|
};
|
|
1964
1965
|
const get$5 = languageId => {
|
|
1965
|
-
return state$
|
|
1966
|
+
return state$9.tokenizers[languageId];
|
|
1966
1967
|
};
|
|
1967
1968
|
const setTokenizePath = (languageId, tokenizePath) => {
|
|
1968
|
-
state$
|
|
1969
|
+
state$9.tokenizePaths[languageId] = tokenizePath;
|
|
1969
1970
|
};
|
|
1970
1971
|
const getTokenizePath$1 = languageId => {
|
|
1971
|
-
return state$
|
|
1972
|
+
return state$9.tokenizePaths[languageId] || '';
|
|
1972
1973
|
};
|
|
1973
1974
|
const setTokenizePaths = languages => {
|
|
1974
1975
|
for (const language of languages) {
|
|
@@ -1978,7 +1979,7 @@ const setTokenizePaths = languages => {
|
|
|
1978
1979
|
}
|
|
1979
1980
|
};
|
|
1980
1981
|
const isPending = languageId => {
|
|
1981
|
-
return Object.hasOwn(state$
|
|
1982
|
+
return Object.hasOwn(state$9.pending, languageId);
|
|
1982
1983
|
};
|
|
1983
1984
|
|
|
1984
1985
|
const tokenMaps = Object.create(null);
|
|
@@ -2811,14 +2812,14 @@ const getNewDeltaPercent = (height, scrollBarHeight, relativeY) => {
|
|
|
2811
2812
|
};
|
|
2812
2813
|
};
|
|
2813
2814
|
|
|
2814
|
-
const state$
|
|
2815
|
+
const state$8 = {
|
|
2815
2816
|
enabled: false
|
|
2816
2817
|
};
|
|
2817
2818
|
const setEnabled = value => {
|
|
2818
|
-
state$
|
|
2819
|
+
state$8.enabled = value;
|
|
2819
2820
|
};
|
|
2820
2821
|
const getEnabled = () => {
|
|
2821
|
-
return state$
|
|
2822
|
+
return state$8.enabled;
|
|
2822
2823
|
};
|
|
2823
2824
|
|
|
2824
2825
|
// TODO this should be in a separate scrolling module
|
|
@@ -3036,7 +3037,7 @@ const getUrlAtOffset = (editor, offset) => {
|
|
|
3036
3037
|
|
|
3037
3038
|
const EditorChange = 1;
|
|
3038
3039
|
|
|
3039
|
-
const state$
|
|
3040
|
+
const state$7 = Object.create(null);
|
|
3040
3041
|
|
|
3041
3042
|
/**
|
|
3042
3043
|
* Register a listener for a specific event type
|
|
@@ -3046,13 +3047,13 @@ const state$8 = Object.create(null);
|
|
|
3046
3047
|
const registerListener$1 = (listenerType, rpcId) => {
|
|
3047
3048
|
number(listenerType);
|
|
3048
3049
|
number(rpcId);
|
|
3049
|
-
if (!Object.hasOwn(state$
|
|
3050
|
-
state$
|
|
3050
|
+
if (!Object.hasOwn(state$7, listenerType)) {
|
|
3051
|
+
state$7[listenerType] = [];
|
|
3051
3052
|
}
|
|
3052
3053
|
|
|
3053
3054
|
// Avoid duplicate registrations
|
|
3054
|
-
if (!state$
|
|
3055
|
-
state$
|
|
3055
|
+
if (!state$7[listenerType].includes(rpcId)) {
|
|
3056
|
+
state$7[listenerType].push(rpcId);
|
|
3056
3057
|
}
|
|
3057
3058
|
};
|
|
3058
3059
|
|
|
@@ -3064,10 +3065,10 @@ const registerListener$1 = (listenerType, rpcId) => {
|
|
|
3064
3065
|
const unregisterListener$1 = (listenerType, rpcId) => {
|
|
3065
3066
|
number(listenerType);
|
|
3066
3067
|
number(rpcId);
|
|
3067
|
-
if (Object.hasOwn(state$
|
|
3068
|
-
const index = state$
|
|
3068
|
+
if (Object.hasOwn(state$7, listenerType)) {
|
|
3069
|
+
const index = state$7[listenerType].indexOf(rpcId);
|
|
3069
3070
|
if (index !== -1) {
|
|
3070
|
-
state$
|
|
3071
|
+
state$7[listenerType].splice(index, 1);
|
|
3071
3072
|
}
|
|
3072
3073
|
}
|
|
3073
3074
|
};
|
|
@@ -3079,7 +3080,7 @@ const unregisterListener$1 = (listenerType, rpcId) => {
|
|
|
3079
3080
|
*/
|
|
3080
3081
|
const getListeners = listenerType => {
|
|
3081
3082
|
number(listenerType);
|
|
3082
|
-
return state$
|
|
3083
|
+
return state$7[listenerType] || [];
|
|
3083
3084
|
};
|
|
3084
3085
|
|
|
3085
3086
|
/**
|
|
@@ -4235,6 +4236,96 @@ const diff2 = uid => {
|
|
|
4235
4236
|
return result;
|
|
4236
4237
|
};
|
|
4237
4238
|
|
|
4239
|
+
const addWidget$1 = widget => {
|
|
4240
|
+
const module = get$6(widget.id);
|
|
4241
|
+
if (!module) {
|
|
4242
|
+
throw new Error('unsupported widget');
|
|
4243
|
+
}
|
|
4244
|
+
return module.add(widget);
|
|
4245
|
+
};
|
|
4246
|
+
const renderWidget = widget => {
|
|
4247
|
+
const module = get$6(widget.id);
|
|
4248
|
+
if (!module) {
|
|
4249
|
+
throw new Error('unsupported widget');
|
|
4250
|
+
}
|
|
4251
|
+
return module.render(widget);
|
|
4252
|
+
};
|
|
4253
|
+
const removeWidget$1 = widget => {
|
|
4254
|
+
const module = get$6(widget.id);
|
|
4255
|
+
if (!module) {
|
|
4256
|
+
throw new Error('unsupported widget');
|
|
4257
|
+
}
|
|
4258
|
+
return module.remove(widget);
|
|
4259
|
+
};
|
|
4260
|
+
|
|
4261
|
+
const renderWidgets$1 = (oldState, newState) => {
|
|
4262
|
+
const addedWidgets = [];
|
|
4263
|
+
const changedWidgets = [];
|
|
4264
|
+
const removedWidgets = [];
|
|
4265
|
+
const oldWidgets = oldState.widgets || [];
|
|
4266
|
+
const newWidgets = newState.widgets || [];
|
|
4267
|
+
const oldWidgetMap = Object.create(null);
|
|
4268
|
+
const newWidgetMap = Object.create(null);
|
|
4269
|
+
for (const oldWidget of oldWidgets) {
|
|
4270
|
+
oldWidgetMap[oldWidget.id] = oldWidget;
|
|
4271
|
+
}
|
|
4272
|
+
for (const newWidget of newWidgets) {
|
|
4273
|
+
newWidgetMap[newWidget.id] = newWidget;
|
|
4274
|
+
}
|
|
4275
|
+
for (const oldWidget of oldWidgets) {
|
|
4276
|
+
if (Object.hasOwn(newWidgetMap, oldWidget.id)) {
|
|
4277
|
+
changedWidgets.push(newWidgetMap[oldWidget.id]);
|
|
4278
|
+
} else {
|
|
4279
|
+
removedWidgets.push(oldWidget);
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
for (const newWidget of newWidgets) {
|
|
4283
|
+
if (Object.hasOwn(oldWidgetMap, newWidget.id)) ; else {
|
|
4284
|
+
addedWidgets.push(newWidget);
|
|
4285
|
+
}
|
|
4286
|
+
}
|
|
4287
|
+
const addCommands = [];
|
|
4288
|
+
for (const addedWidget of addedWidgets) {
|
|
4289
|
+
const childCommands = addWidget$1(addedWidget);
|
|
4290
|
+
if (childCommands.length > 0) {
|
|
4291
|
+
addCommands.push(...childCommands);
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4294
|
+
const changeCommands = [];
|
|
4295
|
+
for (const changedWidget of changedWidgets) {
|
|
4296
|
+
const childCommands = renderWidget(changedWidget);
|
|
4297
|
+
if (childCommands.length > 0) {
|
|
4298
|
+
changeCommands.push(...childCommands);
|
|
4299
|
+
}
|
|
4300
|
+
}
|
|
4301
|
+
const removeCommands = [];
|
|
4302
|
+
for (const removedWidget of removedWidgets) {
|
|
4303
|
+
const childCommands = removeWidget$1(removedWidget);
|
|
4304
|
+
if (childCommands.length > 0) {
|
|
4305
|
+
removeCommands.push(...childCommands);
|
|
4306
|
+
}
|
|
4307
|
+
}
|
|
4308
|
+
const allCommands = [...addCommands, ...changeCommands, ...removeCommands];
|
|
4309
|
+
return allCommands.filter(item => item[0] !== 'Viewlet.setFocusContext');
|
|
4310
|
+
};
|
|
4311
|
+
|
|
4312
|
+
const disposeEditor = async editorUid => {
|
|
4313
|
+
const editor = get$7(editorUid)?.newState;
|
|
4314
|
+
if (!editor) {
|
|
4315
|
+
return [];
|
|
4316
|
+
}
|
|
4317
|
+
for (const widget of editor.widgets) {
|
|
4318
|
+
if (widget.id === ColorPicker$1) {
|
|
4319
|
+
await invoke$9('ColorPicker.dispose', widget.newState.uid);
|
|
4320
|
+
}
|
|
4321
|
+
}
|
|
4322
|
+
const commands = renderWidgets$1(editor, {
|
|
4323
|
+
widgets: []
|
|
4324
|
+
});
|
|
4325
|
+
dispose$1(editorUid);
|
|
4326
|
+
return commands;
|
|
4327
|
+
};
|
|
4328
|
+
|
|
4238
4329
|
// @ts-ignore
|
|
4239
4330
|
const getNewSelections$c = selections => {
|
|
4240
4331
|
const newSelections = [];
|
|
@@ -4429,6 +4520,12 @@ const editorReplaceSelections = (editor, replacement, origin) => {
|
|
|
4429
4520
|
return replaceRange(editor, selections, replacement, origin);
|
|
4430
4521
|
};
|
|
4431
4522
|
|
|
4523
|
+
const create$8 = () => {
|
|
4524
|
+
return Math.random();
|
|
4525
|
+
};
|
|
4526
|
+
|
|
4527
|
+
const Message = 9;
|
|
4528
|
+
|
|
4432
4529
|
const getAccurateColumnIndexAscii = async (line, guess, averageCharWidth, eventX, fontWeight, fontSize, fontFamily, letterSpacing, isMonospaceFont, charWidth) => {
|
|
4433
4530
|
for (let i = guess; i < line.length; i++) {
|
|
4434
4531
|
const width = await measureTextWidth(line.slice(0, i), fontWeight, fontSize, fontFamily, letterSpacing, isMonospaceFont, charWidth);
|
|
@@ -4442,7 +4539,7 @@ const getAccurateColumnIndexAscii = async (line, guess, averageCharWidth, eventX
|
|
|
4442
4539
|
const supported = () => {
|
|
4443
4540
|
return 'Segmenter' in Intl;
|
|
4444
4541
|
};
|
|
4445
|
-
const create$
|
|
4542
|
+
const create$7 = () => {
|
|
4446
4543
|
// @ts-ignore
|
|
4447
4544
|
const segmenter = new Intl.Segmenter();
|
|
4448
4545
|
return {
|
|
@@ -4477,7 +4574,7 @@ const create$8 = () => {
|
|
|
4477
4574
|
};
|
|
4478
4575
|
|
|
4479
4576
|
const getAccurateColumnIndexUnicode = async (line, guess, averageCharWidth, eventX, fontWeight, fontSize, fontFamily, letterSpacing) => {
|
|
4480
|
-
const segmenter = create$
|
|
4577
|
+
const segmenter = create$7();
|
|
4481
4578
|
const segments = segmenter.getSegments(line);
|
|
4482
4579
|
const isMonospaceFont = false;
|
|
4483
4580
|
const charWidth = 0;
|
|
@@ -4592,10 +4689,6 @@ const y = (editor, rowIndex) => {
|
|
|
4592
4689
|
return offsetY;
|
|
4593
4690
|
};
|
|
4594
4691
|
|
|
4595
|
-
const state$7 = {
|
|
4596
|
-
timeout: -1
|
|
4597
|
-
};
|
|
4598
|
-
|
|
4599
4692
|
/**
|
|
4600
4693
|
*
|
|
4601
4694
|
* @param {any} editor
|
|
@@ -4606,26 +4699,29 @@ const state$7 = {
|
|
|
4606
4699
|
* @returns
|
|
4607
4700
|
*/
|
|
4608
4701
|
// @ts-ignore
|
|
4609
|
-
const editorShowMessage =
|
|
4702
|
+
const editorShowMessage = (editor, rowIndex, columnIndex, message, _isError) => {
|
|
4610
4703
|
object(editor);
|
|
4611
4704
|
number(rowIndex);
|
|
4612
4705
|
number(columnIndex);
|
|
4613
4706
|
string(message);
|
|
4614
4707
|
const x$1 = x(editor, rowIndex, columnIndex);
|
|
4615
4708
|
const y$1 = y(editor, rowIndex);
|
|
4616
|
-
const
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
}
|
|
4628
|
-
return
|
|
4709
|
+
const existingWidget = editor.widgets.find(widget => widget.id === Message);
|
|
4710
|
+
const uid = existingWidget?.newState.uid ?? create$8();
|
|
4711
|
+
const newState = {
|
|
4712
|
+
message,
|
|
4713
|
+
uid,
|
|
4714
|
+
x: x$1,
|
|
4715
|
+
y: y$1
|
|
4716
|
+
};
|
|
4717
|
+
const widget = {
|
|
4718
|
+
id: Message,
|
|
4719
|
+
newState
|
|
4720
|
+
};
|
|
4721
|
+
return {
|
|
4722
|
+
...editor,
|
|
4723
|
+
widgets: [...editor.widgets.filter(item => item.id !== Message), widget]
|
|
4724
|
+
};
|
|
4629
4725
|
};
|
|
4630
4726
|
|
|
4631
4727
|
/**
|
|
@@ -4637,16 +4733,8 @@ const editorShowMessage = async (editor, rowIndex, columnIndex, message, isError
|
|
|
4637
4733
|
* @returns
|
|
4638
4734
|
*/
|
|
4639
4735
|
// @ts-ignore
|
|
4640
|
-
const showErrorMessage =
|
|
4641
|
-
return editorShowMessage(editor, rowIndex, columnIndex, message
|
|
4642
|
-
};
|
|
4643
|
-
|
|
4644
|
-
// @ts-ignore
|
|
4645
|
-
const editorHideMessage = async editor => {
|
|
4646
|
-
clearTimeout(state$7.timeout);
|
|
4647
|
-
state$7.timeout = -1;
|
|
4648
|
-
// await RendererProcess.invoke(/* Viewlet.send */ 'Viewlet.send', /* id */ editor.uid, /* method */ 'hideOverlayMessage')
|
|
4649
|
-
return editor;
|
|
4736
|
+
const showErrorMessage = (editor, rowIndex, columnIndex, message) => {
|
|
4737
|
+
return editorShowMessage(editor, rowIndex, columnIndex, message);
|
|
4650
4738
|
};
|
|
4651
4739
|
|
|
4652
4740
|
// @ts-ignore
|
|
@@ -4667,8 +4755,7 @@ const getMatchingClosingBrace$1 = brace => {
|
|
|
4667
4755
|
};
|
|
4668
4756
|
const braceCompletion = async (editor, text) => {
|
|
4669
4757
|
try {
|
|
4670
|
-
|
|
4671
|
-
const offset = offsetAt(editor, editor.cursor);
|
|
4758
|
+
const offset = getCursorOffset(editor);
|
|
4672
4759
|
// @ts-ignore
|
|
4673
4760
|
const result = await invoke$b('ExtensionHostBraceCompletion.executeBraceCompletionProvider', editor, offset, text);
|
|
4674
4761
|
if (result) {
|
|
@@ -4687,6 +4774,9 @@ const braceCompletion = async (editor, text) => {
|
|
|
4687
4774
|
return showErrorMessage(editor, position, getErrorMessage$5(error));
|
|
4688
4775
|
}
|
|
4689
4776
|
};
|
|
4777
|
+
const getCursorOffset = editor => {
|
|
4778
|
+
return offsetAt(editor, editor.selections[0], editor.selections[1]);
|
|
4779
|
+
};
|
|
4690
4780
|
|
|
4691
4781
|
const cancelSelection = editor => {
|
|
4692
4782
|
const {
|
|
@@ -4850,12 +4940,8 @@ const addWidgetToEditor = async (widgetId, focusKey, editor, factory, newStateGe
|
|
|
4850
4940
|
return newEditor;
|
|
4851
4941
|
};
|
|
4852
4942
|
|
|
4853
|
-
const create$7 = () => {
|
|
4854
|
-
return Math.random();
|
|
4855
|
-
};
|
|
4856
|
-
|
|
4857
4943
|
const create$6 = () => {
|
|
4858
|
-
const completionUid = create$
|
|
4944
|
+
const completionUid = create$8();
|
|
4859
4945
|
const widget = {
|
|
4860
4946
|
id: ColorPicker$1,
|
|
4861
4947
|
newState: {
|
|
@@ -5146,7 +5232,7 @@ const characterLeft = (line, columnIndex) => {
|
|
|
5146
5232
|
if (columnIndex > line.length) {
|
|
5147
5233
|
return 1;
|
|
5148
5234
|
}
|
|
5149
|
-
const segmenter = create$
|
|
5235
|
+
const segmenter = create$7();
|
|
5150
5236
|
const last = segmenter.at(line, columnIndex - 1);
|
|
5151
5237
|
if (!last) {
|
|
5152
5238
|
return 1;
|
|
@@ -5161,7 +5247,7 @@ const characterRight = (line, columnIndex) => {
|
|
|
5161
5247
|
if (!supported()) {
|
|
5162
5248
|
return 1;
|
|
5163
5249
|
}
|
|
5164
|
-
const segmenter = create$
|
|
5250
|
+
const segmenter = create$7();
|
|
5165
5251
|
const next = segmenter.at(line, columnIndex);
|
|
5166
5252
|
// @ts-ignore
|
|
5167
5253
|
return next.segment.length;
|
|
@@ -5677,7 +5763,7 @@ const format = async editor => {
|
|
|
5677
5763
|
|
|
5678
5764
|
// TODO configure editor message as widget
|
|
5679
5765
|
const displayErrorMessage = String(error);
|
|
5680
|
-
await editorShowMessage(editor, 0, 0, displayErrorMessage
|
|
5766
|
+
await editorShowMessage(editor, 0, 0, displayErrorMessage);
|
|
5681
5767
|
return editor;
|
|
5682
5768
|
}
|
|
5683
5769
|
};
|
|
@@ -5942,13 +6028,13 @@ const goTo = async ({
|
|
|
5942
6028
|
// TODO if editor is already disposed at this point, do nothing
|
|
5943
6029
|
if (isNoProviderFoundError(error)) {
|
|
5944
6030
|
const displayErrorMessage = getErrorMessage(error);
|
|
5945
|
-
await editorShowMessage(editor, rowIndex, columnIndex, displayErrorMessage
|
|
6031
|
+
await editorShowMessage(editor, rowIndex, columnIndex, displayErrorMessage);
|
|
5946
6032
|
return editor;
|
|
5947
6033
|
}
|
|
5948
6034
|
// @ts-ignore
|
|
5949
6035
|
// ErrorHandling.handleError(error, false)
|
|
5950
6036
|
const displayErrorMessage = getErrorMessage(error);
|
|
5951
|
-
await editorShowMessage(editor, rowIndex, columnIndex, displayErrorMessage
|
|
6037
|
+
await editorShowMessage(editor, rowIndex, columnIndex, displayErrorMessage);
|
|
5952
6038
|
return editor;
|
|
5953
6039
|
}
|
|
5954
6040
|
};
|
|
@@ -7091,7 +7177,7 @@ const Script = 2;
|
|
|
7091
7177
|
const Unknown$1 = 0;
|
|
7092
7178
|
|
|
7093
7179
|
const create$5 = () => {
|
|
7094
|
-
const completionUid = create$
|
|
7180
|
+
const completionUid = create$8();
|
|
7095
7181
|
const widget = {
|
|
7096
7182
|
id: CodeGenerator,
|
|
7097
7183
|
newState: {
|
|
@@ -7134,7 +7220,7 @@ const openCodeGenerator = async editor => {
|
|
|
7134
7220
|
};
|
|
7135
7221
|
|
|
7136
7222
|
const create$4 = () => {
|
|
7137
|
-
const completionUid = create$
|
|
7223
|
+
const completionUid = create$8();
|
|
7138
7224
|
const completionWidget = {
|
|
7139
7225
|
id: Completion,
|
|
7140
7226
|
newState: {
|
|
@@ -7191,7 +7277,7 @@ const openCompletion = async editor => {
|
|
|
7191
7277
|
};
|
|
7192
7278
|
|
|
7193
7279
|
const create$3 = () => {
|
|
7194
|
-
const uid = create$
|
|
7280
|
+
const uid = create$8();
|
|
7195
7281
|
const widget = {
|
|
7196
7282
|
id: Find,
|
|
7197
7283
|
newState: {
|
|
@@ -7309,7 +7395,7 @@ const getPositionAtCursor$1 = editor => {
|
|
|
7309
7395
|
};
|
|
7310
7396
|
|
|
7311
7397
|
const create$2 = () => {
|
|
7312
|
-
const completionUid = create$
|
|
7398
|
+
const completionUid = create$8();
|
|
7313
7399
|
const renameWidget = {
|
|
7314
7400
|
id: Rename$1,
|
|
7315
7401
|
newState: {
|
|
@@ -8289,7 +8375,7 @@ const setText = (editor, text) => {
|
|
|
8289
8375
|
};
|
|
8290
8376
|
|
|
8291
8377
|
const create$1 = () => {
|
|
8292
|
-
const uid = create$
|
|
8378
|
+
const uid = create$8();
|
|
8293
8379
|
const widget = {
|
|
8294
8380
|
id: Hover,
|
|
8295
8381
|
newState: {
|
|
@@ -8377,7 +8463,7 @@ const showHover = async state => {
|
|
|
8377
8463
|
};
|
|
8378
8464
|
|
|
8379
8465
|
const create = () => {
|
|
8380
|
-
const completionUid = create$
|
|
8466
|
+
const completionUid = create$8();
|
|
8381
8467
|
const widget = {
|
|
8382
8468
|
id: SourceAction$1,
|
|
8383
8469
|
newState: {
|
|
@@ -8925,7 +9011,7 @@ const toggleComment = async editor => {
|
|
|
8925
9011
|
} catch (error$1) {
|
|
8926
9012
|
error(error$1);
|
|
8927
9013
|
// TODO use correct position
|
|
8928
|
-
await editorShowMessage(/* editor */editor, /* rowIndex */0, /* columnIndex */0, /* message */String(error$1)
|
|
9014
|
+
await editorShowMessage(/* editor */editor, /* rowIndex */0, /* columnIndex */0, /* message */String(error$1));
|
|
8929
9015
|
return editor;
|
|
8930
9016
|
}
|
|
8931
9017
|
};
|
|
@@ -9240,6 +9326,7 @@ const editorUnindent = editor => {
|
|
|
9240
9326
|
|
|
9241
9327
|
const isFunctional = widgetId => {
|
|
9242
9328
|
switch (widgetId) {
|
|
9329
|
+
case Message:
|
|
9243
9330
|
case ColorPicker$1:
|
|
9244
9331
|
case Completion:
|
|
9245
9332
|
case Find:
|
|
@@ -9251,7 +9338,7 @@ const isFunctional = widgetId => {
|
|
|
9251
9338
|
return false;
|
|
9252
9339
|
}
|
|
9253
9340
|
};
|
|
9254
|
-
const addWidget
|
|
9341
|
+
const addWidget = (widget, id, render) => {
|
|
9255
9342
|
const commands = render(widget);
|
|
9256
9343
|
// TODO how to generate a unique integer id
|
|
9257
9344
|
// that doesn't collide with ids created in renderer worker?
|
|
@@ -9423,7 +9510,7 @@ const renderFull$4 = (oldState, newState) => {
|
|
|
9423
9510
|
};
|
|
9424
9511
|
|
|
9425
9512
|
const commandsToForward$5 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
9426
|
-
const render$
|
|
9513
|
+
const render$c = widget => {
|
|
9427
9514
|
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
9428
9515
|
const wrappedCommands = [];
|
|
9429
9516
|
const {
|
|
@@ -9438,8 +9525,8 @@ const render$b = widget => {
|
|
|
9438
9525
|
}
|
|
9439
9526
|
return wrappedCommands;
|
|
9440
9527
|
};
|
|
9441
|
-
const add$
|
|
9442
|
-
return addWidget
|
|
9528
|
+
const add$8 = widget => {
|
|
9529
|
+
return addWidget(widget, 'EditorCompletion', render$c);
|
|
9443
9530
|
};
|
|
9444
9531
|
const remove$7 = widget => {
|
|
9445
9532
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
@@ -9466,7 +9553,7 @@ const {
|
|
|
9466
9553
|
|
|
9467
9554
|
const EditorCompletionWidget = {
|
|
9468
9555
|
__proto__: null,
|
|
9469
|
-
add: add$
|
|
9556
|
+
add: add$8,
|
|
9470
9557
|
close: close$4,
|
|
9471
9558
|
closeDetails: closeDetails$1,
|
|
9472
9559
|
focusFirst: focusFirst$1,
|
|
@@ -9482,7 +9569,7 @@ const EditorCompletionWidget = {
|
|
|
9482
9569
|
handleWheel: handleWheel$1,
|
|
9483
9570
|
openDetails,
|
|
9484
9571
|
remove: remove$7,
|
|
9485
|
-
render: render$
|
|
9572
|
+
render: render$c,
|
|
9486
9573
|
selectCurrent: selectCurrent$1,
|
|
9487
9574
|
selectIndex: selectIndex$1,
|
|
9488
9575
|
toggleDetails: toggleDetails$1
|
|
@@ -9496,7 +9583,7 @@ const renderFull$3 = (oldState, newState) => {
|
|
|
9496
9583
|
};
|
|
9497
9584
|
|
|
9498
9585
|
const commandsToForward$4 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
9499
|
-
const render$
|
|
9586
|
+
const render$b = widget => {
|
|
9500
9587
|
const commands = renderFull$3(widget.oldState, widget.newState);
|
|
9501
9588
|
const wrappedCommands = [];
|
|
9502
9589
|
const {
|
|
@@ -9511,8 +9598,8 @@ const render$a = widget => {
|
|
|
9511
9598
|
}
|
|
9512
9599
|
return wrappedCommands;
|
|
9513
9600
|
};
|
|
9514
|
-
const add$
|
|
9515
|
-
return addWidget
|
|
9601
|
+
const add$7 = widget => {
|
|
9602
|
+
return addWidget(widget, 'FindWidget', render$b);
|
|
9516
9603
|
};
|
|
9517
9604
|
const remove$6 = widget => {
|
|
9518
9605
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
@@ -9549,7 +9636,7 @@ const {
|
|
|
9549
9636
|
|
|
9550
9637
|
const EditorFindWidget = {
|
|
9551
9638
|
__proto__: null,
|
|
9552
|
-
add: add$
|
|
9639
|
+
add: add$7,
|
|
9553
9640
|
close: close$3,
|
|
9554
9641
|
focusCloseButton,
|
|
9555
9642
|
focusFind,
|
|
@@ -9571,7 +9658,7 @@ const EditorFindWidget = {
|
|
|
9571
9658
|
handleReplaceInput,
|
|
9572
9659
|
handleToggleReplaceFocus,
|
|
9573
9660
|
remove: remove$6,
|
|
9574
|
-
render: render$
|
|
9661
|
+
render: render$b,
|
|
9575
9662
|
replace,
|
|
9576
9663
|
replaceAll,
|
|
9577
9664
|
toggleMatchCase,
|
|
@@ -9941,10 +10028,10 @@ const renderBounds$2 = {
|
|
|
9941
10028
|
},
|
|
9942
10029
|
isEqual: (oldState, newState) => oldState.x === newState.x && oldState.y === newState.y
|
|
9943
10030
|
};
|
|
9944
|
-
const render$
|
|
10031
|
+
const render$a = [renderHoverDom, renderBounds$2];
|
|
9945
10032
|
const renderHover = (oldState, newState) => {
|
|
9946
10033
|
const commands = [];
|
|
9947
|
-
for (const item of render$
|
|
10034
|
+
for (const item of render$a) {
|
|
9948
10035
|
if (!item.isEqual(oldState, newState)) {
|
|
9949
10036
|
commands.push(item.apply(oldState, newState));
|
|
9950
10037
|
}
|
|
@@ -9953,7 +10040,7 @@ const renderHover = (oldState, newState) => {
|
|
|
9953
10040
|
};
|
|
9954
10041
|
|
|
9955
10042
|
const commandsToForward$3 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
9956
|
-
const render$
|
|
10043
|
+
const render$9 = widget => {
|
|
9957
10044
|
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
9958
10045
|
const wrappedCommands = [];
|
|
9959
10046
|
const {
|
|
@@ -9968,8 +10055,8 @@ const render$8 = widget => {
|
|
|
9968
10055
|
}
|
|
9969
10056
|
return wrappedCommands;
|
|
9970
10057
|
};
|
|
9971
|
-
const add$
|
|
9972
|
-
return addWidget
|
|
10058
|
+
const add$6 = widget => {
|
|
10059
|
+
return addWidget(widget, 'EditorRename', render$9);
|
|
9973
10060
|
};
|
|
9974
10061
|
const remove$5 = widget => {
|
|
9975
10062
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
@@ -9983,11 +10070,11 @@ const {
|
|
|
9983
10070
|
const EditorRenameWidget = {
|
|
9984
10071
|
__proto__: null,
|
|
9985
10072
|
accept,
|
|
9986
|
-
add: add$
|
|
10073
|
+
add: add$6,
|
|
9987
10074
|
close: close$2,
|
|
9988
10075
|
handleInput,
|
|
9989
10076
|
remove: remove$5,
|
|
9990
|
-
render: render$
|
|
10077
|
+
render: render$9
|
|
9991
10078
|
};
|
|
9992
10079
|
|
|
9993
10080
|
const rerender = editor => {
|
|
@@ -10008,13 +10095,13 @@ const focusNext$1 = state => {
|
|
|
10008
10095
|
return focusIndex$1(state, nextIndex);
|
|
10009
10096
|
};
|
|
10010
10097
|
|
|
10011
|
-
const removeWidget
|
|
10098
|
+
const removeWidget = widget => {
|
|
10012
10099
|
// @ts-ignore
|
|
10013
|
-
return [['Viewlet.
|
|
10100
|
+
return [['Viewlet.dispose', widget.newState.uid]];
|
|
10014
10101
|
};
|
|
10015
10102
|
|
|
10016
10103
|
const commandsToForward$2 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
10017
|
-
const render$
|
|
10104
|
+
const render$8 = widget => {
|
|
10018
10105
|
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
10019
10106
|
const wrappedCommands = [];
|
|
10020
10107
|
const {
|
|
@@ -10029,10 +10116,10 @@ const render$7 = widget => {
|
|
|
10029
10116
|
}
|
|
10030
10117
|
return wrappedCommands;
|
|
10031
10118
|
};
|
|
10032
|
-
const add$
|
|
10033
|
-
return addWidget
|
|
10119
|
+
const add$5 = widget => {
|
|
10120
|
+
return addWidget(widget, 'EditorSourceActions', render$8);
|
|
10034
10121
|
};
|
|
10035
|
-
const remove$4 = removeWidget
|
|
10122
|
+
const remove$4 = removeWidget;
|
|
10036
10123
|
const {
|
|
10037
10124
|
close: close$1,
|
|
10038
10125
|
closeDetails,
|
|
@@ -10050,7 +10137,7 @@ const {
|
|
|
10050
10137
|
|
|
10051
10138
|
const EditorSourceActionWidget = {
|
|
10052
10139
|
__proto__: null,
|
|
10053
|
-
add: add$
|
|
10140
|
+
add: add$5,
|
|
10054
10141
|
close: close$1,
|
|
10055
10142
|
closeDetails,
|
|
10056
10143
|
focusFirst,
|
|
@@ -10060,7 +10147,7 @@ const EditorSourceActionWidget = {
|
|
|
10060
10147
|
focusPrevious,
|
|
10061
10148
|
handleWheel,
|
|
10062
10149
|
remove: remove$4,
|
|
10063
|
-
render: render$
|
|
10150
|
+
render: render$8,
|
|
10064
10151
|
selectCurrent,
|
|
10065
10152
|
selectIndex,
|
|
10066
10153
|
selectItem,
|
|
@@ -11947,79 +12034,6 @@ const renderIncremental = (oldState, newState) => {
|
|
|
11947
12034
|
return [SetPatches, newState.uid, patches];
|
|
11948
12035
|
};
|
|
11949
12036
|
|
|
11950
|
-
const addWidget = widget => {
|
|
11951
|
-
const module = get$6(widget.id);
|
|
11952
|
-
if (!module) {
|
|
11953
|
-
throw new Error('unsupported widget');
|
|
11954
|
-
}
|
|
11955
|
-
return module.add(widget);
|
|
11956
|
-
};
|
|
11957
|
-
const renderWidget = widget => {
|
|
11958
|
-
const module = get$6(widget.id);
|
|
11959
|
-
if (!module) {
|
|
11960
|
-
throw new Error('unsupported widget');
|
|
11961
|
-
}
|
|
11962
|
-
return module.render(widget);
|
|
11963
|
-
};
|
|
11964
|
-
const removeWidget = widget => {
|
|
11965
|
-
const module = get$6(widget.id);
|
|
11966
|
-
if (!module) {
|
|
11967
|
-
throw new Error('unsupported widget');
|
|
11968
|
-
}
|
|
11969
|
-
return module.remove(widget);
|
|
11970
|
-
};
|
|
11971
|
-
|
|
11972
|
-
const renderWidgets$1 = (oldState, newState) => {
|
|
11973
|
-
const addedWidgets = [];
|
|
11974
|
-
const changedWidgets = [];
|
|
11975
|
-
const removedWidgets = [];
|
|
11976
|
-
const oldWidgets = oldState.widgets || [];
|
|
11977
|
-
const newWidgets = newState.widgets || [];
|
|
11978
|
-
const oldWidgetMap = Object.create(null);
|
|
11979
|
-
const newWidgetMap = Object.create(null);
|
|
11980
|
-
for (const oldWidget of oldWidgets) {
|
|
11981
|
-
oldWidgetMap[oldWidget.id] = oldWidget;
|
|
11982
|
-
}
|
|
11983
|
-
for (const newWidget of newWidgets) {
|
|
11984
|
-
newWidgetMap[newWidget.id] = newWidget;
|
|
11985
|
-
}
|
|
11986
|
-
for (const oldWidget of oldWidgets) {
|
|
11987
|
-
if (Object.hasOwn(newWidgetMap, oldWidget.id)) {
|
|
11988
|
-
changedWidgets.push(newWidgetMap[oldWidget.id]);
|
|
11989
|
-
} else {
|
|
11990
|
-
removedWidgets.push(oldWidget);
|
|
11991
|
-
}
|
|
11992
|
-
}
|
|
11993
|
-
for (const newWidget of newWidgets) {
|
|
11994
|
-
if (Object.hasOwn(oldWidgetMap, newWidget.id)) ; else {
|
|
11995
|
-
addedWidgets.push(newWidget);
|
|
11996
|
-
}
|
|
11997
|
-
}
|
|
11998
|
-
const addCommands = [];
|
|
11999
|
-
for (const addedWidget of addedWidgets) {
|
|
12000
|
-
const childCommands = addWidget(addedWidget);
|
|
12001
|
-
if (childCommands.length > 0) {
|
|
12002
|
-
addCommands.push(...childCommands);
|
|
12003
|
-
}
|
|
12004
|
-
}
|
|
12005
|
-
const changeCommands = [];
|
|
12006
|
-
for (const changedWidget of changedWidgets) {
|
|
12007
|
-
const childCommands = renderWidget(changedWidget);
|
|
12008
|
-
if (childCommands.length > 0) {
|
|
12009
|
-
changeCommands.push(...childCommands);
|
|
12010
|
-
}
|
|
12011
|
-
}
|
|
12012
|
-
const removeCommands = [];
|
|
12013
|
-
for (const removedWidget of removedWidgets) {
|
|
12014
|
-
const childCommands = removeWidget(removedWidget);
|
|
12015
|
-
if (childCommands.length > 0) {
|
|
12016
|
-
removeCommands.push(...childCommands);
|
|
12017
|
-
}
|
|
12018
|
-
}
|
|
12019
|
-
const allCommands = [...addCommands, ...changeCommands, ...removeCommands];
|
|
12020
|
-
return allCommands.filter(item => item[0] !== 'Viewlet.setFocusContext');
|
|
12021
|
-
};
|
|
12022
|
-
|
|
12023
12037
|
const getRenderer = diffType => {
|
|
12024
12038
|
switch (diffType) {
|
|
12025
12039
|
case RenderCss:
|
|
@@ -12150,7 +12164,7 @@ const renderWidgets = {
|
|
|
12150
12164
|
isEqual: (oldState, newState) => oldState.widgets === newState.widgets,
|
|
12151
12165
|
multiple: true
|
|
12152
12166
|
};
|
|
12153
|
-
const render$
|
|
12167
|
+
const render$7 = [renderLines, renderSelections, renderCss, renderFocus$1, renderDecorations, renderGutterInfo, renderWidgets, renderFocusContext, renderAdditionalFocusContext];
|
|
12154
12168
|
const renderEditor = async id => {
|
|
12155
12169
|
const instance = get$7(id);
|
|
12156
12170
|
if (!instance) {
|
|
@@ -12162,7 +12176,7 @@ const renderEditor = async id => {
|
|
|
12162
12176
|
} = instance;
|
|
12163
12177
|
const commands = [];
|
|
12164
12178
|
set$8(id, newState, newState);
|
|
12165
|
-
for (const item of render$
|
|
12179
|
+
for (const item of render$7) {
|
|
12166
12180
|
if (item.isEqual(oldState, newState)) {
|
|
12167
12181
|
continue;
|
|
12168
12182
|
}
|
|
@@ -12393,6 +12407,7 @@ const commandMap = {
|
|
|
12393
12407
|
'Editor.deleteWordPartRight': wrapCommand(deleteWordPartRight),
|
|
12394
12408
|
'Editor.deleteWordRight': wrapCommand(deleteWordRight),
|
|
12395
12409
|
'Editor.diff2': diff2,
|
|
12410
|
+
'Editor.dispose': disposeEditor,
|
|
12396
12411
|
'Editor.executeWidgetCommand': wrapCommand(executeWidgetCommand),
|
|
12397
12412
|
'Editor.findAllReferences': wrapCommand(findAllReferences$1),
|
|
12398
12413
|
'Editor.format': wrapCommand(format),
|
|
@@ -12719,10 +12734,10 @@ const renderFocus = {
|
|
|
12719
12734
|
apply: (oldState, newState) => [Focus, '.CodeGeneratorInput', newState.focusSource],
|
|
12720
12735
|
isEqual: (oldState, newState) => oldState.focused === newState.focused && oldState.focusSource === newState.focusSource
|
|
12721
12736
|
};
|
|
12722
|
-
const render$
|
|
12737
|
+
const render$6 = [renderContent$1, renderBounds$1, renderFocus];
|
|
12723
12738
|
const renderFull$2 = (oldState, newState) => {
|
|
12724
12739
|
const commands = [];
|
|
12725
|
-
for (const item of render$
|
|
12740
|
+
for (const item of render$6) {
|
|
12726
12741
|
if (!item.isEqual(oldState, newState)) {
|
|
12727
12742
|
commands.push(item.apply(oldState, newState));
|
|
12728
12743
|
}
|
|
@@ -12730,7 +12745,7 @@ const renderFull$2 = (oldState, newState) => {
|
|
|
12730
12745
|
return commands;
|
|
12731
12746
|
};
|
|
12732
12747
|
|
|
12733
|
-
const render$
|
|
12748
|
+
const render$5 = widget => {
|
|
12734
12749
|
const commands = renderFull$2(widget.oldState, widget.newState);
|
|
12735
12750
|
const wrappedCommands = [];
|
|
12736
12751
|
const {
|
|
@@ -12746,16 +12761,16 @@ const render$4 = widget => {
|
|
|
12746
12761
|
}
|
|
12747
12762
|
return wrappedCommands;
|
|
12748
12763
|
};
|
|
12749
|
-
const add$
|
|
12750
|
-
return addWidget
|
|
12764
|
+
const add$4 = widget => {
|
|
12765
|
+
return addWidget(widget, 'EditorCodeGenerator', render$5);
|
|
12751
12766
|
};
|
|
12752
|
-
const remove$3 = removeWidget
|
|
12767
|
+
const remove$3 = removeWidget;
|
|
12753
12768
|
|
|
12754
12769
|
const EditorCodeGeneratorWidget = {
|
|
12755
12770
|
__proto__: null,
|
|
12756
|
-
add: add$
|
|
12771
|
+
add: add$4,
|
|
12757
12772
|
remove: remove$3,
|
|
12758
|
-
render: render$
|
|
12773
|
+
render: render$5
|
|
12759
12774
|
};
|
|
12760
12775
|
|
|
12761
12776
|
const renderFull$1 = (oldState, newState) => {
|
|
@@ -12766,7 +12781,7 @@ const renderFull$1 = (oldState, newState) => {
|
|
|
12766
12781
|
};
|
|
12767
12782
|
|
|
12768
12783
|
const commandsToForward$1 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetUid];
|
|
12769
|
-
const render$
|
|
12784
|
+
const render$4 = widget => {
|
|
12770
12785
|
const commands = renderFull$1(widget.oldState, widget.newState);
|
|
12771
12786
|
const wrappedCommands = [];
|
|
12772
12787
|
const {
|
|
@@ -12781,18 +12796,18 @@ const render$3 = widget => {
|
|
|
12781
12796
|
}
|
|
12782
12797
|
return wrappedCommands;
|
|
12783
12798
|
};
|
|
12784
|
-
const add$
|
|
12785
|
-
return addWidget
|
|
12799
|
+
const add$3 = widget => {
|
|
12800
|
+
return addWidget(widget, 'ColorPicker', render$4);
|
|
12786
12801
|
};
|
|
12787
|
-
const remove$2 = removeWidget
|
|
12802
|
+
const remove$2 = removeWidget;
|
|
12788
12803
|
const Commands = {};
|
|
12789
12804
|
|
|
12790
12805
|
const EditorColorPickerWidget = {
|
|
12791
12806
|
__proto__: null,
|
|
12792
12807
|
Commands,
|
|
12793
|
-
add: add$
|
|
12808
|
+
add: add$3,
|
|
12794
12809
|
remove: remove$2,
|
|
12795
|
-
render: render$
|
|
12810
|
+
render: render$4
|
|
12796
12811
|
};
|
|
12797
12812
|
|
|
12798
12813
|
const getCompletionDetailVirtualDom = content => {
|
|
@@ -12846,9 +12861,9 @@ const renderBounds = {
|
|
|
12846
12861
|
},
|
|
12847
12862
|
isEqual: (oldState, newState) => oldState.x === newState.x && oldState.y === newState.y && oldState.width === newState.width && oldState.height === newState.height
|
|
12848
12863
|
};
|
|
12849
|
-
const render$
|
|
12864
|
+
const render$3 = [renderContent, renderBounds];
|
|
12850
12865
|
const renderFull = (oldState, newState) => {
|
|
12851
|
-
return renderParts(render$
|
|
12866
|
+
return renderParts(render$3, oldState, newState);
|
|
12852
12867
|
};
|
|
12853
12868
|
|
|
12854
12869
|
const getWidgetState = (editor, id) => {
|
|
@@ -12867,7 +12882,7 @@ const getCompletionState = editor => {
|
|
|
12867
12882
|
return getWidgetState(editor, Completion);
|
|
12868
12883
|
};
|
|
12869
12884
|
|
|
12870
|
-
const render$
|
|
12885
|
+
const render$2 = widget => {
|
|
12871
12886
|
const commands = renderFull(widget.oldState, widget.newState);
|
|
12872
12887
|
const wrappedCommands = [];
|
|
12873
12888
|
const {
|
|
@@ -12882,10 +12897,10 @@ const render$1 = widget => {
|
|
|
12882
12897
|
}
|
|
12883
12898
|
return wrappedCommands;
|
|
12884
12899
|
};
|
|
12885
|
-
const add$
|
|
12886
|
-
return addWidget
|
|
12900
|
+
const add$2 = widget => {
|
|
12901
|
+
return addWidget(widget, 'EditorCompletionDetails', render$2);
|
|
12887
12902
|
};
|
|
12888
|
-
const remove$1 = removeWidget
|
|
12903
|
+
const remove$1 = removeWidget;
|
|
12889
12904
|
const handleEditorChange = (editor, state) => {
|
|
12890
12905
|
const completionState = getCompletionState(editor);
|
|
12891
12906
|
if (!completionState) {
|
|
@@ -12909,15 +12924,15 @@ const handleEditorDeleteLeft = (editor, state) => {
|
|
|
12909
12924
|
|
|
12910
12925
|
const EditorCompletionDetailWidget = {
|
|
12911
12926
|
__proto__: null,
|
|
12912
|
-
add: add$
|
|
12927
|
+
add: add$2,
|
|
12913
12928
|
handleEditorDeleteLeft,
|
|
12914
12929
|
handleEditorType,
|
|
12915
12930
|
remove: remove$1,
|
|
12916
|
-
render: render$
|
|
12931
|
+
render: render$2
|
|
12917
12932
|
};
|
|
12918
12933
|
|
|
12919
12934
|
const commandsToForward = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
12920
|
-
const render = widget => {
|
|
12935
|
+
const render$1 = widget => {
|
|
12921
12936
|
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
12922
12937
|
const wrappedCommands = [];
|
|
12923
12938
|
const {
|
|
@@ -12932,8 +12947,8 @@ const render = widget => {
|
|
|
12932
12947
|
}
|
|
12933
12948
|
return wrappedCommands;
|
|
12934
12949
|
};
|
|
12935
|
-
const add = widget => {
|
|
12936
|
-
return addWidget
|
|
12950
|
+
const add$1 = widget => {
|
|
12951
|
+
return addWidget(widget, 'EditorCompletion', render$1);
|
|
12937
12952
|
};
|
|
12938
12953
|
const remove = widget => {
|
|
12939
12954
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
@@ -12944,9 +12959,35 @@ const {
|
|
|
12944
12959
|
|
|
12945
12960
|
const EditorHoverWidget = {
|
|
12946
12961
|
__proto__: null,
|
|
12947
|
-
add,
|
|
12962
|
+
add: add$1,
|
|
12948
12963
|
close,
|
|
12949
12964
|
remove,
|
|
12965
|
+
render: render$1
|
|
12966
|
+
};
|
|
12967
|
+
|
|
12968
|
+
const render = widget => {
|
|
12969
|
+
const {
|
|
12970
|
+
message,
|
|
12971
|
+
uid,
|
|
12972
|
+
x,
|
|
12973
|
+
y
|
|
12974
|
+
} = widget.newState;
|
|
12975
|
+
const dom = [{
|
|
12976
|
+
childCount: 1,
|
|
12977
|
+
className: 'Viewlet EditorMessage EditorMessageText EditorOverlayMessage',
|
|
12978
|
+
style: `left:${x}px;top:${y}px;`,
|
|
12979
|
+
type: Div
|
|
12980
|
+
}, text(message)];
|
|
12981
|
+
return [[SetDom2, uid, dom]];
|
|
12982
|
+
};
|
|
12983
|
+
const add = widget => {
|
|
12984
|
+
return addWidget(widget, 'EditorMessage', render);
|
|
12985
|
+
};
|
|
12986
|
+
|
|
12987
|
+
const EditorMessageWidget = {
|
|
12988
|
+
__proto__: null,
|
|
12989
|
+
add,
|
|
12990
|
+
remove,
|
|
12950
12991
|
render
|
|
12951
12992
|
};
|
|
12952
12993
|
|
|
@@ -12956,6 +12997,7 @@ const registerWidgets = () => {
|
|
|
12956
12997
|
set$7(CompletionDetail, EditorCompletionDetailWidget);
|
|
12957
12998
|
set$7(Find, EditorFindWidget);
|
|
12958
12999
|
set$7(Hover, EditorHoverWidget);
|
|
13000
|
+
set$7(Message, EditorMessageWidget);
|
|
12959
13001
|
set$7(Rename$1, EditorRenameWidget);
|
|
12960
13002
|
set$7(SourceAction$1, EditorSourceActionWidget);
|
|
12961
13003
|
set$7(CodeGenerator, EditorCodeGeneratorWidget);
|