@lvce-editor/renderer-process 19.0.0 → 19.2.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/rendererProcessMain.js +6 -20
- package/package.json +1 -1
|
@@ -141,6 +141,9 @@ const addCssStyleSheet = async (id, text) => {
|
|
|
141
141
|
await sheet.replace(text);
|
|
142
142
|
document.adoptedStyleSheets.push(sheet);
|
|
143
143
|
};
|
|
144
|
+
const getSelectionText = () => {
|
|
145
|
+
return document.getSelection()?.toString() || '';
|
|
146
|
+
};
|
|
144
147
|
|
|
145
148
|
const warn$1 = (...args) => {
|
|
146
149
|
console.warn(...args);
|
|
@@ -853,6 +856,8 @@ const getEventListenerArg = (param, event) => {
|
|
|
853
856
|
return event.target.dataset.name;
|
|
854
857
|
case 'event.target.dataset.index':
|
|
855
858
|
return event.target.dataset.index;
|
|
859
|
+
case 'event.target.nodeName':
|
|
860
|
+
return event.target.nodeName;
|
|
856
861
|
default:
|
|
857
862
|
return param;
|
|
858
863
|
}
|
|
@@ -9596,6 +9601,7 @@ const commandMap = {
|
|
|
9596
9601
|
'ClipBoard.writeText': writeText,
|
|
9597
9602
|
'ConfirmPrompt.prompt': prompt$1,
|
|
9598
9603
|
'Css.addCssStyleSheet': addCssStyleSheet,
|
|
9604
|
+
'Css.getSelectionText': getSelectionText,
|
|
9599
9605
|
'Developer.showState': showState,
|
|
9600
9606
|
'Download.downloadFile': downloadFile,
|
|
9601
9607
|
'FileHandles.get': get$8,
|
|
@@ -10153,26 +10159,6 @@ const isUint8Array = value => {
|
|
|
10153
10159
|
const CHAR_WIDTH = 12;
|
|
10154
10160
|
const CHAR_HEIGHT = 15;
|
|
10155
10161
|
|
|
10156
|
-
const supportsOffscreenCanvas = true;
|
|
10157
|
-
|
|
10158
|
-
(() => {
|
|
10159
|
-
try {
|
|
10160
|
-
supportsOffscreenCanvas ? (() => {
|
|
10161
|
-
const canvas = new OffscreenCanvas(CHAR_WIDTH, CHAR_HEIGHT);
|
|
10162
|
-
canvas.getContext("2d");
|
|
10163
|
-
canvas.transferToImageBitmap();
|
|
10164
|
-
})() : (() => {
|
|
10165
|
-
const canvas = document.createElement("canvas");
|
|
10166
|
-
canvas.width = CHAR_WIDTH;
|
|
10167
|
-
canvas.height = CHAR_HEIGHT;
|
|
10168
|
-
canvas.transferToImageBitmap();
|
|
10169
|
-
})();
|
|
10170
|
-
return true;
|
|
10171
|
-
} catch {
|
|
10172
|
-
return false;
|
|
10173
|
-
}
|
|
10174
|
-
})();
|
|
10175
|
-
|
|
10176
10162
|
const tmpCanvas = new OffscreenCanvas(CHAR_WIDTH, CHAR_HEIGHT) ;
|
|
10177
10163
|
tmpCanvas.getContext("2d", {
|
|
10178
10164
|
// desynchronized: true, // perf
|