@lvce-editor/test-worker 4.23.0 → 4.25.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/api.d.ts CHANGED
@@ -109,6 +109,8 @@ declare const acceptEdit: () => Promise<void>;
109
109
  declare const updateEditingValue: (value: string) => Promise<void>;
110
110
  declare const expandAll: () => Promise<void>;
111
111
  declare const handleDragOver: (x: number, y: number) => Promise<void>;
112
+ declare const handleCut: () => Promise<void>;
113
+ declare const handlePaste: () => Promise<void>;
112
114
  declare const selectIndices: (indices: readonly number[]) => Promise<void>;
113
115
  declare const addWebExtension: (relativePath: string) => Promise<void>;
114
116
  declare const addNodeExtension: (relativePath: string) => Promise<void>;
@@ -184,6 +186,12 @@ declare const selectItem$1: (label: string) => Promise<void>;
184
186
  declare const selectIndex$2: (index: number) => Promise<void>;
185
187
  declare const selectCurrentIndex$1: () => Promise<void>;
186
188
  declare const executeCommand: (label: string) => Promise<void>;
189
+ declare const handleClickSectionWatch: () => Promise<void>;
190
+ declare const addWatchExpression: (expression: string) => Promise<void>;
191
+ declare const handleWatchValueChange: () => Promise<void>;
192
+ declare const acceptWatchExpressionEdit: () => Promise<void>;
193
+ declare const selectIndex$3: (index: number) => Promise<void>;
194
+ declare const handleRename: () => Promise<void>;
187
195
  declare const setValue$2: (value: string) => Promise<void>;
188
196
  declare const setReplaceValue: (value: string) => Promise<void>;
189
197
  declare const setExcludeValue: (value: string) => Promise<void>;
@@ -195,7 +203,7 @@ declare const collapseDetails: () => Promise<void>;
195
203
  declare const dismissItem: () => Promise<void>;
196
204
  declare const focusFirst$6: () => Promise<void>;
197
205
  declare const focusIndex$2: (index: number) => Promise<void>;
198
- declare const selectIndex$3: (index: number) => Promise<void>;
206
+ declare const selectIndex$4: (index: number) => Promise<void>;
199
207
  declare const focusNext$8: () => Promise<void>;
200
208
  declare const handleWheel$1: (deltaMode: number, deltaY: number) => Promise<void>;
201
209
  declare const focusNextPage: () => Promise<void>;
@@ -210,7 +218,7 @@ declare const toggleReplace: () => Promise<void>;
210
218
  declare const update: (settings: any) => Promise<void>;
211
219
  declare const open$4: (id: string) => Promise<void>;
212
220
  declare const hide: () => Promise<void>;
213
- declare const selectIndex$4: (index: number) => Promise<void>;
221
+ declare const selectIndex$5: (index: number) => Promise<void>;
214
222
  declare const acceptInput: () => Promise<void>;
215
223
  declare const handleInput$2: (text: string) => Promise<void>;
216
224
  declare const handleClickSourceControlButtons: (index: number, name: string) => Promise<void>;
@@ -263,7 +271,7 @@ declare namespace EditorCompletion {
263
271
  export { selectCurrentIndex, selectIndex };
264
272
  }
265
273
  declare namespace Explorer {
266
- export { acceptEdit, cancelEdit, clickCurrent, expandAll, expandRecursively, focus$1 as focus, focusFirst$1 as focusFirst, focusIndex, focusLast$1 as focusLast, focusNext$2 as focusNext, handleArrowLeft, handleBlur, handleClick$1 as handleClick, handleClickAt, handleDragLeave, handleDragOver, handleDrop, handleInputBlur, newFile, newFolder, openContextMenu$1 as openContextMenu, refresh, removeDirent, rename$1 as rename, renameDirent, selectAll$1 as selectAll, selectDown, selectIndices, selectUp, updateEditingValue };
274
+ export { acceptEdit, cancelEdit, clickCurrent, expandAll, expandRecursively, focus$1 as focus, focusFirst$1 as focusFirst, focusIndex, focusLast$1 as focusLast, focusNext$2 as focusNext, handleArrowLeft, handleBlur, handleClick$1 as handleClick, handleClickAt, handleCut, handleDragLeave, handleDragOver, handleDrop, handleInputBlur, handlePaste, newFile, newFolder, openContextMenu$1 as openContextMenu, refresh, removeDirent, rename$1 as rename, renameDirent, selectAll$1 as selectAll, selectDown, selectIndices, selectUp, updateEditingValue };
267
275
  }
268
276
  declare namespace Extension {
269
277
  export { addNodeExtension, addWebExtension };
@@ -304,8 +312,11 @@ declare namespace Problems {
304
312
  declare namespace QuickPick {
305
313
  export { executeCommand, focusFirst$5 as focusFirst, focusIndex$1 as focusIndex, focusLast$5 as focusLast, focusNext$7 as focusNext, focusPrevious$5 as focusPrevious, handleClickAt$1 as handleClickAt, handleInput$1 as handleInput, open$3 as open, selectCurrentIndex$1 as selectCurrentIndex, selectIndex$2 as selectIndex, selectItem$1 as selectItem, setValue$1 as setValue };
306
314
  }
315
+ declare namespace RunAndDebug {
316
+ export { acceptWatchExpressionEdit, addWatchExpression, handleClickSectionWatch, handleRename, handleWatchValueChange, selectIndex$3 as selectIndex };
317
+ }
307
318
  declare namespace Search {
308
- export { clearSearchResults, collapseDetails, dismissItem, focusFirst$6 as focusFirst, focusIndex$2 as focusIndex, focusNext$8 as focusNext, focusNextPage, focusPrevious$6 as focusPrevious, focusPreviousPage, handleWheel$1 as handleWheel, openDetails, replaceAll, selectIndex$3 as selectIndex, setExcludeValue, setIncludeValue, setReplaceValue, setValue$2 as setValue, toggleMatchCase, toggleMatchWholeWord, togglePreserveCase, toggleReplace, toggleSearchDetails, toggleUseRegularExpression };
319
+ export { clearSearchResults, collapseDetails, dismissItem, focusFirst$6 as focusFirst, focusIndex$2 as focusIndex, focusNext$8 as focusNext, focusNextPage, focusPrevious$6 as focusPrevious, focusPreviousPage, handleWheel$1 as handleWheel, openDetails, replaceAll, selectIndex$4 as selectIndex, setExcludeValue, setIncludeValue, setReplaceValue, setValue$2 as setValue, toggleMatchCase, toggleMatchWholeWord, togglePreserveCase, toggleReplace, toggleSearchDetails, toggleUseRegularExpression };
309
320
  }
310
321
  declare namespace Settings {
311
322
  export { update };
@@ -314,7 +325,7 @@ declare namespace SideBar {
314
325
  export { hide, open$4 as open };
315
326
  }
316
327
  declare namespace SourceControl {
317
- export { acceptInput, handleClickSourceControlButtons, handleInput$2 as handleInput, selectIndex$4 as selectIndex };
328
+ export { acceptInput, handleClickSourceControlButtons, handleInput$2 as handleInput, selectIndex$5 as selectIndex };
318
329
  }
319
330
  declare namespace StatusBar {
320
331
  export { update$1 as update };
@@ -349,6 +360,7 @@ export interface TestApi {
349
360
  readonly Platform: typeof Platform,
350
361
  readonly Problems: typeof Problems,
351
362
  readonly QuickPick: typeof QuickPick,
363
+ readonly RunAndDebug: typeof RunAndDebug,
352
364
  readonly Search: typeof Search,
353
365
  readonly Settings: typeof Settings,
354
366
  readonly SideBar: typeof SideBar,
@@ -513,7 +513,7 @@ const create$4 = (method, params) => {
513
513
  };
514
514
  };
515
515
  const callbacks = Object.create(null);
516
- const set$3 = (id, fn) => {
516
+ const set$2 = (id, fn) => {
517
517
  callbacks[id] = fn;
518
518
  };
519
519
  const get$2 = id => {
@@ -532,7 +532,7 @@ const registerPromise = () => {
532
532
  resolve,
533
533
  promise
534
534
  } = Promise.withResolvers();
535
- set$3(id, resolve);
535
+ set$2(id, resolve);
536
536
  return {
537
537
  id,
538
538
  promise
@@ -746,18 +746,18 @@ const getErrorProperty = (error, prettyError) => {
746
746
  }
747
747
  };
748
748
  };
749
- const create$1$1 = (message, error) => {
749
+ const create$1$1 = (id, error) => {
750
750
  return {
751
751
  jsonrpc: Two,
752
- id: message.id,
752
+ id,
753
753
  error
754
754
  };
755
755
  };
756
- const getErrorResponse = (message, error, preparePrettyError, logError) => {
756
+ const getErrorResponse = (id, error, preparePrettyError, logError) => {
757
757
  const prettyError = preparePrettyError(error);
758
758
  logError(error, prettyError);
759
759
  const errorProperty = getErrorProperty(error, prettyError);
760
- return create$1$1(message, errorProperty);
760
+ return create$1$1(id, errorProperty);
761
761
  };
762
762
  const create$5 = (message, result) => {
763
763
  return {
@@ -770,12 +770,27 @@ const getSuccessResponse = (message, result) => {
770
770
  const resultProperty = result ?? null;
771
771
  return create$5(message, resultProperty);
772
772
  };
773
+ const getErrorResponseSimple = (id, error) => {
774
+ return {
775
+ jsonrpc: Two,
776
+ id,
777
+ error: {
778
+ code: Custom,
779
+ // @ts-ignore
780
+ message: error.message,
781
+ data: error
782
+ }
783
+ };
784
+ };
773
785
  const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
774
786
  try {
775
787
  const result = requiresSocket(message.method) ? await execute(message.method, ipc, ...message.params) : await execute(message.method, ...message.params);
776
788
  return getSuccessResponse(message, result);
777
789
  } catch (error) {
778
- return getErrorResponse(message, error, preparePrettyError, logError);
790
+ if (ipc.canUseSimpleErrorResponse) {
791
+ return getErrorResponseSimple(message.id, error);
792
+ }
793
+ return getErrorResponse(message.id, error, preparePrettyError, logError);
779
794
  }
780
795
  };
781
796
  const defaultPreparePrettyError = error => {
@@ -830,7 +845,7 @@ const handleJsonRpcMessage = async (...args) => {
830
845
  try {
831
846
  ipc.send(response);
832
847
  } catch (error) {
833
- const errorResponse = getErrorResponse(message, error, preparePrettyError, logError);
848
+ const errorResponse = getErrorResponse(message.id, error, preparePrettyError, logError);
834
849
  ipc.send(errorResponse);
835
850
  }
836
851
  return;
@@ -988,7 +1003,7 @@ const printTestError = async error => {
988
1003
  };
989
1004
 
990
1005
  const rpcs = Object.create(null);
991
- const set$b = (id, rpc) => {
1006
+ const set$g = (id, rpc) => {
992
1007
  rpcs[id] = rpc;
993
1008
  };
994
1009
  const get$1 = id => {
@@ -1012,21 +1027,24 @@ const create$1 = rpcId => {
1012
1027
  return rpc.invokeAndTransfer(method, ...params);
1013
1028
  },
1014
1029
  set(rpc) {
1015
- set$b(rpcId, rpc);
1030
+ set$g(rpcId, rpc);
1031
+ },
1032
+ async dispose() {
1033
+ const rpc = get$1(rpcId);
1034
+ await rpc.dispose();
1016
1035
  }
1017
1036
  };
1018
1037
  };
1019
1038
  const RendererWorker$1 = 1;
1020
1039
  const {
1021
- invoke: invoke$2,
1022
- invokeAndTransfer: invokeAndTransfer$2,
1023
- set: set$2
1024
- } = create$1(RendererWorker$1);
1040
+ invoke: invoke$3,
1041
+ invokeAndTransfer: invokeAndTransfer$3,
1042
+ set: set$3} = create$1(RendererWorker$1);
1025
1043
  const RendererWorker = {
1026
1044
  __proto__: null,
1027
- invoke: invoke$2,
1028
- invokeAndTransfer: invokeAndTransfer$2,
1029
- set: set$2
1045
+ invoke: invoke$3,
1046
+ invokeAndTransfer: invokeAndTransfer$3,
1047
+ set: set$3
1030
1048
  };
1031
1049
 
1032
1050
  const {
@@ -1933,7 +1951,7 @@ const TestFrameWorkComponentEditor = {
1933
1951
  type
1934
1952
  };
1935
1953
 
1936
- const selectIndex$4 = async index => {
1954
+ const selectIndex$5 = async index => {
1937
1955
  await invoke('EditorCompletion.selectIndex', index);
1938
1956
  };
1939
1957
  const selectCurrentIndex$1 = async () => {
@@ -1943,7 +1961,7 @@ const selectCurrentIndex$1 = async () => {
1943
1961
  const TestFrameWorkComponentEditorCompletion = {
1944
1962
  __proto__: null,
1945
1963
  selectCurrentIndex: selectCurrentIndex$1,
1946
- selectIndex: selectIndex$4
1964
+ selectIndex: selectIndex$5
1947
1965
  };
1948
1966
 
1949
1967
  /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
@@ -2038,6 +2056,14 @@ const expandAll = async () => {
2038
2056
  const handleDragOver = async (x, y) => {
2039
2057
  await invoke('Explorer.handleDragOver', x, y);
2040
2058
  };
2059
+ const handleCut = async () => {
2060
+ // @ts-ignore
2061
+ await invoke('Explorer.handleCut');
2062
+ };
2063
+ const handlePaste = async () => {
2064
+ // @ts-ignore
2065
+ await invoke('Explorer.handlePaste');
2066
+ };
2041
2067
  const selectIndices = async indices => {
2042
2068
  await invoke('Explorer.selectIndices', indices);
2043
2069
  };
@@ -2058,10 +2084,12 @@ const TestFrameWorkComponentExplorer = {
2058
2084
  handleBlur,
2059
2085
  handleClick: handleClick$1,
2060
2086
  handleClickAt: handleClickAt$1,
2087
+ handleCut,
2061
2088
  handleDragLeave,
2062
2089
  handleDragOver,
2063
2090
  handleDrop,
2064
2091
  handleInputBlur,
2092
+ handlePaste,
2065
2093
  newFile,
2066
2094
  newFolder,
2067
2095
  openContextMenu,
@@ -2204,7 +2232,7 @@ const TestFrameWorkComponentIconTheme = {
2204
2232
  setIconTheme
2205
2233
  };
2206
2234
 
2207
- const selectIndex$3 = async index => {
2235
+ const selectIndex$4 = async index => {
2208
2236
  return invoke('IframeInspector.selectIndex', index);
2209
2237
  };
2210
2238
  const focusNext$5 = async () => {
@@ -2226,7 +2254,7 @@ const TestFrameWorkComponentIframeInspector = {
2226
2254
  focusLast: focusLast$4,
2227
2255
  focusNext: focusNext$5,
2228
2256
  focusPrevious: focusPrevious$5,
2229
- selectIndex: selectIndex$3
2257
+ selectIndex: selectIndex$4
2230
2258
  };
2231
2259
 
2232
2260
  const open$3 = async () => {
@@ -2527,7 +2555,7 @@ const selectItem = async label => {
2527
2555
  // @ts-ignore
2528
2556
  await invoke('QuickPick.selectItem', label);
2529
2557
  };
2530
- const selectIndex$2 = async index => {
2558
+ const selectIndex$3 = async index => {
2531
2559
  // @ts-ignore
2532
2560
  await invoke('QuickPick.selectIndex', index);
2533
2561
  };
@@ -2556,11 +2584,46 @@ const TestFrameWorkComponentQuickPick = {
2556
2584
  handleInput: handleInput$1,
2557
2585
  open: open$1,
2558
2586
  selectCurrentIndex,
2559
- selectIndex: selectIndex$2,
2587
+ selectIndex: selectIndex$3,
2560
2588
  selectItem,
2561
2589
  setValue: setValue$1
2562
2590
  };
2563
2591
 
2592
+ const handleClickSectionWatch = async () => {
2593
+ // @ts-ignore
2594
+ await invoke('Run And Debug.handleClickSectionWatch');
2595
+ };
2596
+ const addWatchExpression = async expression => {
2597
+ // @ts-ignore
2598
+ await invoke('Run And Debug.addWatchExpression', expression);
2599
+ };
2600
+ const handleWatchValueChange = async () => {
2601
+ // @ts-ignore
2602
+ await invoke('Run And Debug.handleWatchValueChange');
2603
+ };
2604
+ const acceptWatchExpressionEdit = async () => {
2605
+ // @ts-ignore
2606
+ await invoke('Run And Debug.acceptWatchExpressionEdit');
2607
+ };
2608
+ const selectIndex$2 = async index => {
2609
+ // @ts-ignore
2610
+ await invoke('Run And Debug.selectIndex', index);
2611
+ };
2612
+ const handleRename = async () => {
2613
+ // @ts-ignore
2614
+ await invoke('Run And Debug.handleRename');
2615
+ };
2616
+
2617
+ const TestFrameWorkComponentRunAndDebug = {
2618
+ __proto__: null,
2619
+ acceptWatchExpressionEdit,
2620
+ addWatchExpression,
2621
+ handleClickSectionWatch,
2622
+ handleRename,
2623
+ handleWatchValueChange,
2624
+ selectIndex: selectIndex$2
2625
+ };
2626
+
2564
2627
  const Script = 2;
2565
2628
 
2566
2629
  const setValue = async value => {
@@ -2897,6 +2960,7 @@ const TestFrameWorkComponent = {
2897
2960
  Platform: TestFrameWorkComponentPlatform,
2898
2961
  Problems: TestFrameWorkComponentProblems,
2899
2962
  QuickPick: TestFrameWorkComponentQuickPick,
2963
+ RunAndDebug: TestFrameWorkComponentRunAndDebug,
2900
2964
  Search: TestFrameWorkComponentSearch,
2901
2965
  Settings: TestFrameWorkComponentSettings,
2902
2966
  SideBar: TestFrameWorkComponentSideBar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "4.23.0",
3
+ "version": "4.25.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",