@lvce-editor/editor-worker 19.17.3 → 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 +243 -203
- 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
|
|
@@ -4852,12 +4940,8 @@ const addWidgetToEditor = async (widgetId, focusKey, editor, factory, newStateGe
|
|
|
4852
4940
|
return newEditor;
|
|
4853
4941
|
};
|
|
4854
4942
|
|
|
4855
|
-
const create$7 = () => {
|
|
4856
|
-
return Math.random();
|
|
4857
|
-
};
|
|
4858
|
-
|
|
4859
4943
|
const create$6 = () => {
|
|
4860
|
-
const completionUid = create$
|
|
4944
|
+
const completionUid = create$8();
|
|
4861
4945
|
const widget = {
|
|
4862
4946
|
id: ColorPicker$1,
|
|
4863
4947
|
newState: {
|
|
@@ -5148,7 +5232,7 @@ const characterLeft = (line, columnIndex) => {
|
|
|
5148
5232
|
if (columnIndex > line.length) {
|
|
5149
5233
|
return 1;
|
|
5150
5234
|
}
|
|
5151
|
-
const segmenter = create$
|
|
5235
|
+
const segmenter = create$7();
|
|
5152
5236
|
const last = segmenter.at(line, columnIndex - 1);
|
|
5153
5237
|
if (!last) {
|
|
5154
5238
|
return 1;
|
|
@@ -5163,7 +5247,7 @@ const characterRight = (line, columnIndex) => {
|
|
|
5163
5247
|
if (!supported()) {
|
|
5164
5248
|
return 1;
|
|
5165
5249
|
}
|
|
5166
|
-
const segmenter = create$
|
|
5250
|
+
const segmenter = create$7();
|
|
5167
5251
|
const next = segmenter.at(line, columnIndex);
|
|
5168
5252
|
// @ts-ignore
|
|
5169
5253
|
return next.segment.length;
|
|
@@ -5679,7 +5763,7 @@ const format = async editor => {
|
|
|
5679
5763
|
|
|
5680
5764
|
// TODO configure editor message as widget
|
|
5681
5765
|
const displayErrorMessage = String(error);
|
|
5682
|
-
await editorShowMessage(editor, 0, 0, displayErrorMessage
|
|
5766
|
+
await editorShowMessage(editor, 0, 0, displayErrorMessage);
|
|
5683
5767
|
return editor;
|
|
5684
5768
|
}
|
|
5685
5769
|
};
|
|
@@ -5944,13 +6028,13 @@ const goTo = async ({
|
|
|
5944
6028
|
// TODO if editor is already disposed at this point, do nothing
|
|
5945
6029
|
if (isNoProviderFoundError(error)) {
|
|
5946
6030
|
const displayErrorMessage = getErrorMessage(error);
|
|
5947
|
-
await editorShowMessage(editor, rowIndex, columnIndex, displayErrorMessage
|
|
6031
|
+
await editorShowMessage(editor, rowIndex, columnIndex, displayErrorMessage);
|
|
5948
6032
|
return editor;
|
|
5949
6033
|
}
|
|
5950
6034
|
// @ts-ignore
|
|
5951
6035
|
// ErrorHandling.handleError(error, false)
|
|
5952
6036
|
const displayErrorMessage = getErrorMessage(error);
|
|
5953
|
-
await editorShowMessage(editor, rowIndex, columnIndex, displayErrorMessage
|
|
6037
|
+
await editorShowMessage(editor, rowIndex, columnIndex, displayErrorMessage);
|
|
5954
6038
|
return editor;
|
|
5955
6039
|
}
|
|
5956
6040
|
};
|
|
@@ -7093,7 +7177,7 @@ const Script = 2;
|
|
|
7093
7177
|
const Unknown$1 = 0;
|
|
7094
7178
|
|
|
7095
7179
|
const create$5 = () => {
|
|
7096
|
-
const completionUid = create$
|
|
7180
|
+
const completionUid = create$8();
|
|
7097
7181
|
const widget = {
|
|
7098
7182
|
id: CodeGenerator,
|
|
7099
7183
|
newState: {
|
|
@@ -7136,7 +7220,7 @@ const openCodeGenerator = async editor => {
|
|
|
7136
7220
|
};
|
|
7137
7221
|
|
|
7138
7222
|
const create$4 = () => {
|
|
7139
|
-
const completionUid = create$
|
|
7223
|
+
const completionUid = create$8();
|
|
7140
7224
|
const completionWidget = {
|
|
7141
7225
|
id: Completion,
|
|
7142
7226
|
newState: {
|
|
@@ -7193,7 +7277,7 @@ const openCompletion = async editor => {
|
|
|
7193
7277
|
};
|
|
7194
7278
|
|
|
7195
7279
|
const create$3 = () => {
|
|
7196
|
-
const uid = create$
|
|
7280
|
+
const uid = create$8();
|
|
7197
7281
|
const widget = {
|
|
7198
7282
|
id: Find,
|
|
7199
7283
|
newState: {
|
|
@@ -7311,7 +7395,7 @@ const getPositionAtCursor$1 = editor => {
|
|
|
7311
7395
|
};
|
|
7312
7396
|
|
|
7313
7397
|
const create$2 = () => {
|
|
7314
|
-
const completionUid = create$
|
|
7398
|
+
const completionUid = create$8();
|
|
7315
7399
|
const renameWidget = {
|
|
7316
7400
|
id: Rename$1,
|
|
7317
7401
|
newState: {
|
|
@@ -8291,7 +8375,7 @@ const setText = (editor, text) => {
|
|
|
8291
8375
|
};
|
|
8292
8376
|
|
|
8293
8377
|
const create$1 = () => {
|
|
8294
|
-
const uid = create$
|
|
8378
|
+
const uid = create$8();
|
|
8295
8379
|
const widget = {
|
|
8296
8380
|
id: Hover,
|
|
8297
8381
|
newState: {
|
|
@@ -8379,7 +8463,7 @@ const showHover = async state => {
|
|
|
8379
8463
|
};
|
|
8380
8464
|
|
|
8381
8465
|
const create = () => {
|
|
8382
|
-
const completionUid = create$
|
|
8466
|
+
const completionUid = create$8();
|
|
8383
8467
|
const widget = {
|
|
8384
8468
|
id: SourceAction$1,
|
|
8385
8469
|
newState: {
|
|
@@ -8927,7 +9011,7 @@ const toggleComment = async editor => {
|
|
|
8927
9011
|
} catch (error$1) {
|
|
8928
9012
|
error(error$1);
|
|
8929
9013
|
// TODO use correct position
|
|
8930
|
-
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));
|
|
8931
9015
|
return editor;
|
|
8932
9016
|
}
|
|
8933
9017
|
};
|
|
@@ -9242,6 +9326,7 @@ const editorUnindent = editor => {
|
|
|
9242
9326
|
|
|
9243
9327
|
const isFunctional = widgetId => {
|
|
9244
9328
|
switch (widgetId) {
|
|
9329
|
+
case Message:
|
|
9245
9330
|
case ColorPicker$1:
|
|
9246
9331
|
case Completion:
|
|
9247
9332
|
case Find:
|
|
@@ -9253,7 +9338,7 @@ const isFunctional = widgetId => {
|
|
|
9253
9338
|
return false;
|
|
9254
9339
|
}
|
|
9255
9340
|
};
|
|
9256
|
-
const addWidget
|
|
9341
|
+
const addWidget = (widget, id, render) => {
|
|
9257
9342
|
const commands = render(widget);
|
|
9258
9343
|
// TODO how to generate a unique integer id
|
|
9259
9344
|
// that doesn't collide with ids created in renderer worker?
|
|
@@ -9425,7 +9510,7 @@ const renderFull$4 = (oldState, newState) => {
|
|
|
9425
9510
|
};
|
|
9426
9511
|
|
|
9427
9512
|
const commandsToForward$5 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
9428
|
-
const render$
|
|
9513
|
+
const render$c = widget => {
|
|
9429
9514
|
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
9430
9515
|
const wrappedCommands = [];
|
|
9431
9516
|
const {
|
|
@@ -9440,8 +9525,8 @@ const render$b = widget => {
|
|
|
9440
9525
|
}
|
|
9441
9526
|
return wrappedCommands;
|
|
9442
9527
|
};
|
|
9443
|
-
const add$
|
|
9444
|
-
return addWidget
|
|
9528
|
+
const add$8 = widget => {
|
|
9529
|
+
return addWidget(widget, 'EditorCompletion', render$c);
|
|
9445
9530
|
};
|
|
9446
9531
|
const remove$7 = widget => {
|
|
9447
9532
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
@@ -9468,7 +9553,7 @@ const {
|
|
|
9468
9553
|
|
|
9469
9554
|
const EditorCompletionWidget = {
|
|
9470
9555
|
__proto__: null,
|
|
9471
|
-
add: add$
|
|
9556
|
+
add: add$8,
|
|
9472
9557
|
close: close$4,
|
|
9473
9558
|
closeDetails: closeDetails$1,
|
|
9474
9559
|
focusFirst: focusFirst$1,
|
|
@@ -9484,7 +9569,7 @@ const EditorCompletionWidget = {
|
|
|
9484
9569
|
handleWheel: handleWheel$1,
|
|
9485
9570
|
openDetails,
|
|
9486
9571
|
remove: remove$7,
|
|
9487
|
-
render: render$
|
|
9572
|
+
render: render$c,
|
|
9488
9573
|
selectCurrent: selectCurrent$1,
|
|
9489
9574
|
selectIndex: selectIndex$1,
|
|
9490
9575
|
toggleDetails: toggleDetails$1
|
|
@@ -9498,7 +9583,7 @@ const renderFull$3 = (oldState, newState) => {
|
|
|
9498
9583
|
};
|
|
9499
9584
|
|
|
9500
9585
|
const commandsToForward$4 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
9501
|
-
const render$
|
|
9586
|
+
const render$b = widget => {
|
|
9502
9587
|
const commands = renderFull$3(widget.oldState, widget.newState);
|
|
9503
9588
|
const wrappedCommands = [];
|
|
9504
9589
|
const {
|
|
@@ -9513,8 +9598,8 @@ const render$a = widget => {
|
|
|
9513
9598
|
}
|
|
9514
9599
|
return wrappedCommands;
|
|
9515
9600
|
};
|
|
9516
|
-
const add$
|
|
9517
|
-
return addWidget
|
|
9601
|
+
const add$7 = widget => {
|
|
9602
|
+
return addWidget(widget, 'FindWidget', render$b);
|
|
9518
9603
|
};
|
|
9519
9604
|
const remove$6 = widget => {
|
|
9520
9605
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
@@ -9551,7 +9636,7 @@ const {
|
|
|
9551
9636
|
|
|
9552
9637
|
const EditorFindWidget = {
|
|
9553
9638
|
__proto__: null,
|
|
9554
|
-
add: add$
|
|
9639
|
+
add: add$7,
|
|
9555
9640
|
close: close$3,
|
|
9556
9641
|
focusCloseButton,
|
|
9557
9642
|
focusFind,
|
|
@@ -9573,7 +9658,7 @@ const EditorFindWidget = {
|
|
|
9573
9658
|
handleReplaceInput,
|
|
9574
9659
|
handleToggleReplaceFocus,
|
|
9575
9660
|
remove: remove$6,
|
|
9576
|
-
render: render$
|
|
9661
|
+
render: render$b,
|
|
9577
9662
|
replace,
|
|
9578
9663
|
replaceAll,
|
|
9579
9664
|
toggleMatchCase,
|
|
@@ -9943,10 +10028,10 @@ const renderBounds$2 = {
|
|
|
9943
10028
|
},
|
|
9944
10029
|
isEqual: (oldState, newState) => oldState.x === newState.x && oldState.y === newState.y
|
|
9945
10030
|
};
|
|
9946
|
-
const render$
|
|
10031
|
+
const render$a = [renderHoverDom, renderBounds$2];
|
|
9947
10032
|
const renderHover = (oldState, newState) => {
|
|
9948
10033
|
const commands = [];
|
|
9949
|
-
for (const item of render$
|
|
10034
|
+
for (const item of render$a) {
|
|
9950
10035
|
if (!item.isEqual(oldState, newState)) {
|
|
9951
10036
|
commands.push(item.apply(oldState, newState));
|
|
9952
10037
|
}
|
|
@@ -9955,7 +10040,7 @@ const renderHover = (oldState, newState) => {
|
|
|
9955
10040
|
};
|
|
9956
10041
|
|
|
9957
10042
|
const commandsToForward$3 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
9958
|
-
const render$
|
|
10043
|
+
const render$9 = widget => {
|
|
9959
10044
|
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
9960
10045
|
const wrappedCommands = [];
|
|
9961
10046
|
const {
|
|
@@ -9970,8 +10055,8 @@ const render$8 = widget => {
|
|
|
9970
10055
|
}
|
|
9971
10056
|
return wrappedCommands;
|
|
9972
10057
|
};
|
|
9973
|
-
const add$
|
|
9974
|
-
return addWidget
|
|
10058
|
+
const add$6 = widget => {
|
|
10059
|
+
return addWidget(widget, 'EditorRename', render$9);
|
|
9975
10060
|
};
|
|
9976
10061
|
const remove$5 = widget => {
|
|
9977
10062
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
@@ -9985,11 +10070,11 @@ const {
|
|
|
9985
10070
|
const EditorRenameWidget = {
|
|
9986
10071
|
__proto__: null,
|
|
9987
10072
|
accept,
|
|
9988
|
-
add: add$
|
|
10073
|
+
add: add$6,
|
|
9989
10074
|
close: close$2,
|
|
9990
10075
|
handleInput,
|
|
9991
10076
|
remove: remove$5,
|
|
9992
|
-
render: render$
|
|
10077
|
+
render: render$9
|
|
9993
10078
|
};
|
|
9994
10079
|
|
|
9995
10080
|
const rerender = editor => {
|
|
@@ -10010,13 +10095,13 @@ const focusNext$1 = state => {
|
|
|
10010
10095
|
return focusIndex$1(state, nextIndex);
|
|
10011
10096
|
};
|
|
10012
10097
|
|
|
10013
|
-
const removeWidget
|
|
10098
|
+
const removeWidget = widget => {
|
|
10014
10099
|
// @ts-ignore
|
|
10015
|
-
return [['Viewlet.
|
|
10100
|
+
return [['Viewlet.dispose', widget.newState.uid]];
|
|
10016
10101
|
};
|
|
10017
10102
|
|
|
10018
10103
|
const commandsToForward$2 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
10019
|
-
const render$
|
|
10104
|
+
const render$8 = widget => {
|
|
10020
10105
|
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
10021
10106
|
const wrappedCommands = [];
|
|
10022
10107
|
const {
|
|
@@ -10031,10 +10116,10 @@ const render$7 = widget => {
|
|
|
10031
10116
|
}
|
|
10032
10117
|
return wrappedCommands;
|
|
10033
10118
|
};
|
|
10034
|
-
const add$
|
|
10035
|
-
return addWidget
|
|
10119
|
+
const add$5 = widget => {
|
|
10120
|
+
return addWidget(widget, 'EditorSourceActions', render$8);
|
|
10036
10121
|
};
|
|
10037
|
-
const remove$4 = removeWidget
|
|
10122
|
+
const remove$4 = removeWidget;
|
|
10038
10123
|
const {
|
|
10039
10124
|
close: close$1,
|
|
10040
10125
|
closeDetails,
|
|
@@ -10052,7 +10137,7 @@ const {
|
|
|
10052
10137
|
|
|
10053
10138
|
const EditorSourceActionWidget = {
|
|
10054
10139
|
__proto__: null,
|
|
10055
|
-
add: add$
|
|
10140
|
+
add: add$5,
|
|
10056
10141
|
close: close$1,
|
|
10057
10142
|
closeDetails,
|
|
10058
10143
|
focusFirst,
|
|
@@ -10062,7 +10147,7 @@ const EditorSourceActionWidget = {
|
|
|
10062
10147
|
focusPrevious,
|
|
10063
10148
|
handleWheel,
|
|
10064
10149
|
remove: remove$4,
|
|
10065
|
-
render: render$
|
|
10150
|
+
render: render$8,
|
|
10066
10151
|
selectCurrent,
|
|
10067
10152
|
selectIndex,
|
|
10068
10153
|
selectItem,
|
|
@@ -11949,79 +12034,6 @@ const renderIncremental = (oldState, newState) => {
|
|
|
11949
12034
|
return [SetPatches, newState.uid, patches];
|
|
11950
12035
|
};
|
|
11951
12036
|
|
|
11952
|
-
const addWidget = widget => {
|
|
11953
|
-
const module = get$6(widget.id);
|
|
11954
|
-
if (!module) {
|
|
11955
|
-
throw new Error('unsupported widget');
|
|
11956
|
-
}
|
|
11957
|
-
return module.add(widget);
|
|
11958
|
-
};
|
|
11959
|
-
const renderWidget = widget => {
|
|
11960
|
-
const module = get$6(widget.id);
|
|
11961
|
-
if (!module) {
|
|
11962
|
-
throw new Error('unsupported widget');
|
|
11963
|
-
}
|
|
11964
|
-
return module.render(widget);
|
|
11965
|
-
};
|
|
11966
|
-
const removeWidget = widget => {
|
|
11967
|
-
const module = get$6(widget.id);
|
|
11968
|
-
if (!module) {
|
|
11969
|
-
throw new Error('unsupported widget');
|
|
11970
|
-
}
|
|
11971
|
-
return module.remove(widget);
|
|
11972
|
-
};
|
|
11973
|
-
|
|
11974
|
-
const renderWidgets$1 = (oldState, newState) => {
|
|
11975
|
-
const addedWidgets = [];
|
|
11976
|
-
const changedWidgets = [];
|
|
11977
|
-
const removedWidgets = [];
|
|
11978
|
-
const oldWidgets = oldState.widgets || [];
|
|
11979
|
-
const newWidgets = newState.widgets || [];
|
|
11980
|
-
const oldWidgetMap = Object.create(null);
|
|
11981
|
-
const newWidgetMap = Object.create(null);
|
|
11982
|
-
for (const oldWidget of oldWidgets) {
|
|
11983
|
-
oldWidgetMap[oldWidget.id] = oldWidget;
|
|
11984
|
-
}
|
|
11985
|
-
for (const newWidget of newWidgets) {
|
|
11986
|
-
newWidgetMap[newWidget.id] = newWidget;
|
|
11987
|
-
}
|
|
11988
|
-
for (const oldWidget of oldWidgets) {
|
|
11989
|
-
if (Object.hasOwn(newWidgetMap, oldWidget.id)) {
|
|
11990
|
-
changedWidgets.push(newWidgetMap[oldWidget.id]);
|
|
11991
|
-
} else {
|
|
11992
|
-
removedWidgets.push(oldWidget);
|
|
11993
|
-
}
|
|
11994
|
-
}
|
|
11995
|
-
for (const newWidget of newWidgets) {
|
|
11996
|
-
if (Object.hasOwn(oldWidgetMap, newWidget.id)) ; else {
|
|
11997
|
-
addedWidgets.push(newWidget);
|
|
11998
|
-
}
|
|
11999
|
-
}
|
|
12000
|
-
const addCommands = [];
|
|
12001
|
-
for (const addedWidget of addedWidgets) {
|
|
12002
|
-
const childCommands = addWidget(addedWidget);
|
|
12003
|
-
if (childCommands.length > 0) {
|
|
12004
|
-
addCommands.push(...childCommands);
|
|
12005
|
-
}
|
|
12006
|
-
}
|
|
12007
|
-
const changeCommands = [];
|
|
12008
|
-
for (const changedWidget of changedWidgets) {
|
|
12009
|
-
const childCommands = renderWidget(changedWidget);
|
|
12010
|
-
if (childCommands.length > 0) {
|
|
12011
|
-
changeCommands.push(...childCommands);
|
|
12012
|
-
}
|
|
12013
|
-
}
|
|
12014
|
-
const removeCommands = [];
|
|
12015
|
-
for (const removedWidget of removedWidgets) {
|
|
12016
|
-
const childCommands = removeWidget(removedWidget);
|
|
12017
|
-
if (childCommands.length > 0) {
|
|
12018
|
-
removeCommands.push(...childCommands);
|
|
12019
|
-
}
|
|
12020
|
-
}
|
|
12021
|
-
const allCommands = [...addCommands, ...changeCommands, ...removeCommands];
|
|
12022
|
-
return allCommands.filter(item => item[0] !== 'Viewlet.setFocusContext');
|
|
12023
|
-
};
|
|
12024
|
-
|
|
12025
12037
|
const getRenderer = diffType => {
|
|
12026
12038
|
switch (diffType) {
|
|
12027
12039
|
case RenderCss:
|
|
@@ -12152,7 +12164,7 @@ const renderWidgets = {
|
|
|
12152
12164
|
isEqual: (oldState, newState) => oldState.widgets === newState.widgets,
|
|
12153
12165
|
multiple: true
|
|
12154
12166
|
};
|
|
12155
|
-
const render$
|
|
12167
|
+
const render$7 = [renderLines, renderSelections, renderCss, renderFocus$1, renderDecorations, renderGutterInfo, renderWidgets, renderFocusContext, renderAdditionalFocusContext];
|
|
12156
12168
|
const renderEditor = async id => {
|
|
12157
12169
|
const instance = get$7(id);
|
|
12158
12170
|
if (!instance) {
|
|
@@ -12164,7 +12176,7 @@ const renderEditor = async id => {
|
|
|
12164
12176
|
} = instance;
|
|
12165
12177
|
const commands = [];
|
|
12166
12178
|
set$8(id, newState, newState);
|
|
12167
|
-
for (const item of render$
|
|
12179
|
+
for (const item of render$7) {
|
|
12168
12180
|
if (item.isEqual(oldState, newState)) {
|
|
12169
12181
|
continue;
|
|
12170
12182
|
}
|
|
@@ -12395,6 +12407,7 @@ const commandMap = {
|
|
|
12395
12407
|
'Editor.deleteWordPartRight': wrapCommand(deleteWordPartRight),
|
|
12396
12408
|
'Editor.deleteWordRight': wrapCommand(deleteWordRight),
|
|
12397
12409
|
'Editor.diff2': diff2,
|
|
12410
|
+
'Editor.dispose': disposeEditor,
|
|
12398
12411
|
'Editor.executeWidgetCommand': wrapCommand(executeWidgetCommand),
|
|
12399
12412
|
'Editor.findAllReferences': wrapCommand(findAllReferences$1),
|
|
12400
12413
|
'Editor.format': wrapCommand(format),
|
|
@@ -12721,10 +12734,10 @@ const renderFocus = {
|
|
|
12721
12734
|
apply: (oldState, newState) => [Focus, '.CodeGeneratorInput', newState.focusSource],
|
|
12722
12735
|
isEqual: (oldState, newState) => oldState.focused === newState.focused && oldState.focusSource === newState.focusSource
|
|
12723
12736
|
};
|
|
12724
|
-
const render$
|
|
12737
|
+
const render$6 = [renderContent$1, renderBounds$1, renderFocus];
|
|
12725
12738
|
const renderFull$2 = (oldState, newState) => {
|
|
12726
12739
|
const commands = [];
|
|
12727
|
-
for (const item of render$
|
|
12740
|
+
for (const item of render$6) {
|
|
12728
12741
|
if (!item.isEqual(oldState, newState)) {
|
|
12729
12742
|
commands.push(item.apply(oldState, newState));
|
|
12730
12743
|
}
|
|
@@ -12732,7 +12745,7 @@ const renderFull$2 = (oldState, newState) => {
|
|
|
12732
12745
|
return commands;
|
|
12733
12746
|
};
|
|
12734
12747
|
|
|
12735
|
-
const render$
|
|
12748
|
+
const render$5 = widget => {
|
|
12736
12749
|
const commands = renderFull$2(widget.oldState, widget.newState);
|
|
12737
12750
|
const wrappedCommands = [];
|
|
12738
12751
|
const {
|
|
@@ -12748,16 +12761,16 @@ const render$4 = widget => {
|
|
|
12748
12761
|
}
|
|
12749
12762
|
return wrappedCommands;
|
|
12750
12763
|
};
|
|
12751
|
-
const add$
|
|
12752
|
-
return addWidget
|
|
12764
|
+
const add$4 = widget => {
|
|
12765
|
+
return addWidget(widget, 'EditorCodeGenerator', render$5);
|
|
12753
12766
|
};
|
|
12754
|
-
const remove$3 = removeWidget
|
|
12767
|
+
const remove$3 = removeWidget;
|
|
12755
12768
|
|
|
12756
12769
|
const EditorCodeGeneratorWidget = {
|
|
12757
12770
|
__proto__: null,
|
|
12758
|
-
add: add$
|
|
12771
|
+
add: add$4,
|
|
12759
12772
|
remove: remove$3,
|
|
12760
|
-
render: render$
|
|
12773
|
+
render: render$5
|
|
12761
12774
|
};
|
|
12762
12775
|
|
|
12763
12776
|
const renderFull$1 = (oldState, newState) => {
|
|
@@ -12768,7 +12781,7 @@ const renderFull$1 = (oldState, newState) => {
|
|
|
12768
12781
|
};
|
|
12769
12782
|
|
|
12770
12783
|
const commandsToForward$1 = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetUid];
|
|
12771
|
-
const render$
|
|
12784
|
+
const render$4 = widget => {
|
|
12772
12785
|
const commands = renderFull$1(widget.oldState, widget.newState);
|
|
12773
12786
|
const wrappedCommands = [];
|
|
12774
12787
|
const {
|
|
@@ -12783,18 +12796,18 @@ const render$3 = widget => {
|
|
|
12783
12796
|
}
|
|
12784
12797
|
return wrappedCommands;
|
|
12785
12798
|
};
|
|
12786
|
-
const add$
|
|
12787
|
-
return addWidget
|
|
12799
|
+
const add$3 = widget => {
|
|
12800
|
+
return addWidget(widget, 'ColorPicker', render$4);
|
|
12788
12801
|
};
|
|
12789
|
-
const remove$2 = removeWidget
|
|
12802
|
+
const remove$2 = removeWidget;
|
|
12790
12803
|
const Commands = {};
|
|
12791
12804
|
|
|
12792
12805
|
const EditorColorPickerWidget = {
|
|
12793
12806
|
__proto__: null,
|
|
12794
12807
|
Commands,
|
|
12795
|
-
add: add$
|
|
12808
|
+
add: add$3,
|
|
12796
12809
|
remove: remove$2,
|
|
12797
|
-
render: render$
|
|
12810
|
+
render: render$4
|
|
12798
12811
|
};
|
|
12799
12812
|
|
|
12800
12813
|
const getCompletionDetailVirtualDom = content => {
|
|
@@ -12848,9 +12861,9 @@ const renderBounds = {
|
|
|
12848
12861
|
},
|
|
12849
12862
|
isEqual: (oldState, newState) => oldState.x === newState.x && oldState.y === newState.y && oldState.width === newState.width && oldState.height === newState.height
|
|
12850
12863
|
};
|
|
12851
|
-
const render$
|
|
12864
|
+
const render$3 = [renderContent, renderBounds];
|
|
12852
12865
|
const renderFull = (oldState, newState) => {
|
|
12853
|
-
return renderParts(render$
|
|
12866
|
+
return renderParts(render$3, oldState, newState);
|
|
12854
12867
|
};
|
|
12855
12868
|
|
|
12856
12869
|
const getWidgetState = (editor, id) => {
|
|
@@ -12869,7 +12882,7 @@ const getCompletionState = editor => {
|
|
|
12869
12882
|
return getWidgetState(editor, Completion);
|
|
12870
12883
|
};
|
|
12871
12884
|
|
|
12872
|
-
const render$
|
|
12885
|
+
const render$2 = widget => {
|
|
12873
12886
|
const commands = renderFull(widget.oldState, widget.newState);
|
|
12874
12887
|
const wrappedCommands = [];
|
|
12875
12888
|
const {
|
|
@@ -12884,10 +12897,10 @@ const render$1 = widget => {
|
|
|
12884
12897
|
}
|
|
12885
12898
|
return wrappedCommands;
|
|
12886
12899
|
};
|
|
12887
|
-
const add$
|
|
12888
|
-
return addWidget
|
|
12900
|
+
const add$2 = widget => {
|
|
12901
|
+
return addWidget(widget, 'EditorCompletionDetails', render$2);
|
|
12889
12902
|
};
|
|
12890
|
-
const remove$1 = removeWidget
|
|
12903
|
+
const remove$1 = removeWidget;
|
|
12891
12904
|
const handleEditorChange = (editor, state) => {
|
|
12892
12905
|
const completionState = getCompletionState(editor);
|
|
12893
12906
|
if (!completionState) {
|
|
@@ -12911,15 +12924,15 @@ const handleEditorDeleteLeft = (editor, state) => {
|
|
|
12911
12924
|
|
|
12912
12925
|
const EditorCompletionDetailWidget = {
|
|
12913
12926
|
__proto__: null,
|
|
12914
|
-
add: add$
|
|
12927
|
+
add: add$2,
|
|
12915
12928
|
handleEditorDeleteLeft,
|
|
12916
12929
|
handleEditorType,
|
|
12917
12930
|
remove: remove$1,
|
|
12918
|
-
render: render$
|
|
12931
|
+
render: render$2
|
|
12919
12932
|
};
|
|
12920
12933
|
|
|
12921
12934
|
const commandsToForward = [SetDom2, SetCss, AppendToBody, SetBounds2, RegisterEventListeners, SetSelectionByName, SetValueByName, SetFocusContext, SetUid, 'Viewlet.focusSelector'];
|
|
12922
|
-
const render = widget => {
|
|
12935
|
+
const render$1 = widget => {
|
|
12923
12936
|
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
12924
12937
|
const wrappedCommands = [];
|
|
12925
12938
|
const {
|
|
@@ -12934,8 +12947,8 @@ const render = widget => {
|
|
|
12934
12947
|
}
|
|
12935
12948
|
return wrappedCommands;
|
|
12936
12949
|
};
|
|
12937
|
-
const add = widget => {
|
|
12938
|
-
return addWidget
|
|
12950
|
+
const add$1 = widget => {
|
|
12951
|
+
return addWidget(widget, 'EditorCompletion', render$1);
|
|
12939
12952
|
};
|
|
12940
12953
|
const remove = widget => {
|
|
12941
12954
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
@@ -12946,9 +12959,35 @@ const {
|
|
|
12946
12959
|
|
|
12947
12960
|
const EditorHoverWidget = {
|
|
12948
12961
|
__proto__: null,
|
|
12949
|
-
add,
|
|
12962
|
+
add: add$1,
|
|
12950
12963
|
close,
|
|
12951
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,
|
|
12952
12991
|
render
|
|
12953
12992
|
};
|
|
12954
12993
|
|
|
@@ -12958,6 +12997,7 @@ const registerWidgets = () => {
|
|
|
12958
12997
|
set$7(CompletionDetail, EditorCompletionDetailWidget);
|
|
12959
12998
|
set$7(Find, EditorFindWidget);
|
|
12960
12999
|
set$7(Hover, EditorHoverWidget);
|
|
13000
|
+
set$7(Message, EditorMessageWidget);
|
|
12961
13001
|
set$7(Rename$1, EditorRenameWidget);
|
|
12962
13002
|
set$7(SourceAction$1, EditorSourceActionWidget);
|
|
12963
13003
|
set$7(CodeGenerator, EditorCodeGeneratorWidget);
|