@lvce-editor/editor-worker 18.13.0 → 18.15.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 +24 -20
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -6132,7 +6132,17 @@ const handleTripleClick = (editor, modifier, x, y) => {
|
|
|
6132
6132
|
return selectLine(editor);
|
|
6133
6133
|
};
|
|
6134
6134
|
|
|
6135
|
-
const
|
|
6135
|
+
const getModifier = (altKey, ctrlKey) => {
|
|
6136
|
+
if (altKey) {
|
|
6137
|
+
return Alt;
|
|
6138
|
+
}
|
|
6139
|
+
if (ctrlKey) {
|
|
6140
|
+
return Ctrl;
|
|
6141
|
+
}
|
|
6142
|
+
return 0;
|
|
6143
|
+
};
|
|
6144
|
+
const handleMouseDown = (state, button, altKey, ctrlKey, x, y, detail) => {
|
|
6145
|
+
const modifier = getModifier(altKey, ctrlKey);
|
|
6136
6146
|
switch (detail) {
|
|
6137
6147
|
case Double:
|
|
6138
6148
|
return handleDoubleClick(state, modifier, x, y);
|
|
@@ -6341,20 +6351,8 @@ const handlePointerCaptureLost = editor => {
|
|
|
6341
6351
|
return editor;
|
|
6342
6352
|
};
|
|
6343
6353
|
|
|
6344
|
-
const handlePointerDown$1 =
|
|
6345
|
-
|
|
6346
|
-
const clickDetail = Single; // TODO
|
|
6347
|
-
// console.log({ detail })
|
|
6348
|
-
switch (clickDetail) {
|
|
6349
|
-
case Double:
|
|
6350
|
-
return handleDoubleClick(state, modifier, x, y);
|
|
6351
|
-
case Single:
|
|
6352
|
-
return handleSingleClick(state, modifier, x, y);
|
|
6353
|
-
case Triple:
|
|
6354
|
-
return handleTripleClick(state, modifier, x, y);
|
|
6355
|
-
default:
|
|
6356
|
-
return state;
|
|
6357
|
-
}
|
|
6354
|
+
const handlePointerDown$1 = state => {
|
|
6355
|
+
return state;
|
|
6358
6356
|
};
|
|
6359
6357
|
|
|
6360
6358
|
const moveRectangleSelection = (editor, position) => {
|
|
@@ -9560,6 +9558,7 @@ const HandleCompositionUpdate = 12;
|
|
|
9560
9558
|
const HandleContextMenu = 13;
|
|
9561
9559
|
const HandleCut = 14;
|
|
9562
9560
|
const HandleFocus = 15;
|
|
9561
|
+
const HandleMouseDown = 18;
|
|
9563
9562
|
const HandleMouseMove = 19;
|
|
9564
9563
|
const HandlePaste = 20;
|
|
9565
9564
|
const HandlePointerDown = 21;
|
|
@@ -10826,6 +10825,7 @@ const intialize = async (syntaxHighlightingEnabled, syncIncremental) => {
|
|
|
10826
10825
|
const kLineHeight = 'editor.lineHeight';
|
|
10827
10826
|
const kFontSize = 'editor.fontSize';
|
|
10828
10827
|
const kFontFamily = 'editor.fontFamily';
|
|
10828
|
+
const kLetterSpacing = 'editor.letterSpacing';
|
|
10829
10829
|
const kTabSize = 'editor.tabSize';
|
|
10830
10830
|
const kLineNumbers = 'editor.lineNumbers';
|
|
10831
10831
|
const kDiagnostics = 'editor.diagnostics';
|
|
@@ -10855,9 +10855,10 @@ const getFontFamily = async () => {
|
|
|
10855
10855
|
return (await get$1(kFontFamily)) || 'Fira Code';
|
|
10856
10856
|
};
|
|
10857
10857
|
const getLetterSpacing = async () => {
|
|
10858
|
-
{
|
|
10859
|
-
|
|
10860
|
-
}
|
|
10858
|
+
// if (!false) {
|
|
10859
|
+
// return 0
|
|
10860
|
+
// }
|
|
10861
|
+
return (await get$1(kLetterSpacing)) ?? 0.5;
|
|
10861
10862
|
};
|
|
10862
10863
|
const getTabSize = async () => {
|
|
10863
10864
|
return (await get$1(kTabSize)) || 2;
|
|
@@ -11588,7 +11589,7 @@ const getEditorVirtualDom = ({
|
|
|
11588
11589
|
}, ...selectionsDom, {
|
|
11589
11590
|
childCount: textInfos.length,
|
|
11590
11591
|
className: 'EditorRows',
|
|
11591
|
-
|
|
11592
|
+
onMouseDown: HandleMouseDown,
|
|
11592
11593
|
onPointerDown: HandlePointerDown,
|
|
11593
11594
|
type: Div
|
|
11594
11595
|
}, ...rowsDom, {
|
|
@@ -11912,9 +11913,12 @@ const renderEventListeners = () => {
|
|
|
11912
11913
|
name: HandlePaste,
|
|
11913
11914
|
params: ['paste', 'event.clipboardData ? event.clipboardData.getData("text/plain") : ""'],
|
|
11914
11915
|
preventDefault: true
|
|
11916
|
+
}, {
|
|
11917
|
+
name: HandleMouseDown,
|
|
11918
|
+
params: ['handleMouseDown', 'event.button', 'event.altKey', 'event.ctrlKey', ClientX, ClientY, 'event.detail']
|
|
11915
11919
|
}, {
|
|
11916
11920
|
name: HandlePointerDown,
|
|
11917
|
-
params: ['handlePointerDown', 'event.button', 'event.altKey', 'event.ctrlKey', ClientX, ClientY],
|
|
11921
|
+
params: ['handlePointerDown', 'event.button', 'event.altKey', 'event.ctrlKey', ClientX, ClientY, 'event.detail'],
|
|
11918
11922
|
trackPointerEvents: [HandlePointerMove, HandlePointerUp]
|
|
11919
11923
|
}, {
|
|
11920
11924
|
name: HandlePointerMove,
|