@lvce-editor/test-worker 14.1.0 → 14.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/api.d.ts CHANGED
@@ -288,6 +288,12 @@ interface Dialog {
288
288
  readonly showSaveFilePicker: () => Promise<void>;
289
289
  }
290
290
 
291
+ interface DiffView {
292
+ readonly open: (leftUri: string, rightUri: string) => Promise<void>;
293
+ readonly shouldHaveContentLeft: (expectedContent: string) => Promise<void>;
294
+ readonly shouldHaveContentRight: (expectedContent: string) => Promise<void>;
295
+ }
296
+
291
297
  interface Editor {
292
298
  readonly addAllMissingImports: () => Promise<void>;
293
299
  readonly cancelSelection: () => Promise<void>;
@@ -569,11 +575,6 @@ interface KeyBoard {
569
575
  readonly press: (key: string) => Promise<void>;
570
576
  }
571
577
 
572
- interface Layout {
573
- readonly handleWorkspaceRefresh: () => Promise<void>;
574
- readonly showSideBar: () => Promise<void>;
575
- }
576
-
577
578
  interface LanguageModels {
578
579
  readonly addModel: () => Promise<void>;
579
580
  readonly clearFilterInput: () => Promise<void>;
@@ -582,6 +583,11 @@ interface LanguageModels {
582
583
  readonly removeModel: (id: string) => Promise<void>;
583
584
  }
584
585
 
586
+ interface Layout {
587
+ readonly handleWorkspaceRefresh: () => Promise<void>;
588
+ readonly showSideBar: () => Promise<void>;
589
+ }
590
+
585
591
  interface Main {
586
592
  readonly closeActiveEditor: () => Promise<void>;
587
593
  readonly closeAllEditors: () => Promise<void>;
@@ -601,6 +607,7 @@ interface Main {
601
607
  readonly openUri: (uri: string) => Promise<void>;
602
608
  readonly save: () => Promise<void>;
603
609
  readonly saveAll: () => Promise<void>;
610
+ readonly saveState: (uid: number) => Promise<any>;
604
611
  readonly selectTab: (groupIndex: number, tabIndex: number) => Promise<void>;
605
612
  readonly splitDown: () => Promise<void>;
606
613
  readonly splitRight: () => Promise<void>;
@@ -816,6 +823,7 @@ export interface TestApi {
816
823
  readonly ContextMenu: ContextMenu
817
824
  readonly Developer: Developer
818
825
  readonly Dialog: Dialog
826
+ readonly DiffView: DiffView
819
827
  readonly Editor: Editor
820
828
  readonly EditorCompletion: EditorCompletion
821
829
  readonly EditorHover: EditorHover
@@ -831,8 +839,8 @@ export interface TestApi {
831
839
  readonly IframeInspector: IframeInspector
832
840
  readonly KeyBindingsEditor: KeyBindingsEditor
833
841
  readonly KeyBoard: KeyBoard
834
- readonly Layout: Layout
835
842
  readonly LanguageModels: LanguageModels
843
+ readonly Layout: Layout
836
844
  readonly Main: Main
837
845
  readonly Open: Open
838
846
  readonly Output: Output
@@ -2066,7 +2066,7 @@ const Chat = {
2066
2066
  useMockApi
2067
2067
  };
2068
2068
 
2069
- const open$9 = async sessionId => {
2069
+ const open$a = async sessionId => {
2070
2070
  await invoke('Main.openUri', `chat-debug://${sessionId}`);
2071
2071
  };
2072
2072
  const open2 = async ({
@@ -2148,7 +2148,7 @@ const ChatDebug = {
2148
2148
  closeDetails,
2149
2149
  handleClickRefresh,
2150
2150
  handleInput: handleInput$7,
2151
- open: open$9,
2151
+ open: open$a,
2152
2152
  open2,
2153
2153
  openTabPayload,
2154
2154
  openTabPreview,
@@ -2294,6 +2294,116 @@ const Dialog = {
2294
2294
  showSaveFilePicker
2295
2295
  };
2296
2296
 
2297
+ const openUri = async uri => {
2298
+ await invoke('Main.openUri', uri);
2299
+ };
2300
+ const saveState = async uid => {
2301
+ return invoke('Main.saveState', uid);
2302
+ };
2303
+ const splitRight = async () => {
2304
+ await invoke('Main.splitRight');
2305
+ };
2306
+ const splitDown = async () => {
2307
+ await invoke('Main.splitDown');
2308
+ };
2309
+ const openKeyBindings = async () => {
2310
+ await invoke('Main.openKeyBindings');
2311
+ };
2312
+ const handleClickTogglePreview = async () => {
2313
+ await invoke('Main.handleClickTogglePreview');
2314
+ };
2315
+ const closeAllEditors = async () => {
2316
+ await invoke('Main.closeAllEditors');
2317
+ };
2318
+ const closeTabsLeft = async () => {
2319
+ await invoke('Main.closeTabsLeft');
2320
+ };
2321
+ const handleModifiedStatusChange = async (uri, newStatus) => {
2322
+ await invoke('Main.handleModifiedStatusChange', uri, newStatus);
2323
+ };
2324
+ const closeTabsRight = async () => {
2325
+ await invoke('Main.closeTabsRight');
2326
+ };
2327
+ const selectTab$2 = async (groupIndex, tabIndex) => {
2328
+ await invoke('Main.selectTab', groupIndex, tabIndex);
2329
+ };
2330
+ const closeOthers = async () => {
2331
+ await invoke('Main.closeOthers');
2332
+ };
2333
+ const closeActiveEditor = async () => {
2334
+ await invoke('Main.closeActiveEditor');
2335
+ };
2336
+ const save = async () => {
2337
+ await invoke('Main.save');
2338
+ };
2339
+ const saveAll = async () => {
2340
+ await invoke('Main.saveAll');
2341
+ };
2342
+ const focusFirst$6 = async () => {
2343
+ await invoke('Main.focusFirst');
2344
+ };
2345
+ const focusNext$7 = async () => {
2346
+ await invoke('Main.focusNext');
2347
+ };
2348
+ const focusPrevious$6 = async () => {
2349
+ await invoke('Main.focusPrevious');
2350
+ };
2351
+ const focusLast$5 = async () => {
2352
+ await invoke('Main.focusLast');
2353
+ };
2354
+ const handleTabContextMenu = async (button, x, y) => {
2355
+ await invoke('Main.handleTabContextMenu', button, x, y);
2356
+ };
2357
+ const copyPath$2 = async () => {
2358
+ await invoke('Main.copyPath');
2359
+ };
2360
+ const copyRelativePath$1 = async () => {
2361
+ await invoke('Main.copyRelativePath');
2362
+ };
2363
+
2364
+ const Main = {
2365
+ closeActiveEditor,
2366
+ closeAllEditors,
2367
+ closeOthers,
2368
+ closeTabsLeft,
2369
+ closeTabsRight,
2370
+ copyPath: copyPath$2,
2371
+ copyRelativePath: copyRelativePath$1,
2372
+ focusFirst: focusFirst$6,
2373
+ focusLast: focusLast$5,
2374
+ focusNext: focusNext$7,
2375
+ focusPrevious: focusPrevious$6,
2376
+ handleClickTogglePreview,
2377
+ handleModifiedStatusChange,
2378
+ handleTabContextMenu,
2379
+ openKeyBindings,
2380
+ openUri,
2381
+ save,
2382
+ saveAll,
2383
+ saveState,
2384
+ selectTab: selectTab$2,
2385
+ splitDown,
2386
+ splitRight
2387
+ };
2388
+
2389
+ const open$9 = async (leftUri, rightUri) => {
2390
+ await openUri(`diff://${leftUri}<->${rightUri}`);
2391
+ };
2392
+ const shouldHaveContentLeft = async expectedContent => {
2393
+ const contentLeft = createLocator('.DiffEditorContentLeft');
2394
+ await expect$1(contentLeft).toHaveText(expectedContent);
2395
+ };
2396
+ const shouldHaveContentRight = async expectedContent => {
2397
+ const contentRight = createLocator('.DiffEditorContentRight');
2398
+ await expect$1(contentRight).toHaveText(expectedContent);
2399
+ };
2400
+
2401
+ const DiffView = {
2402
+ open: open$9,
2403
+ shouldHaveContentLeft,
2404
+ shouldHaveContentRight
2405
+ };
2406
+
2297
2407
  const isDiagnosticEqual = (actual, expected) => {
2298
2408
  return actual.rowIndex === expected.rowIndex && actual.columnIndex === expected.columnIndex && actual.endRowIndex === expected.endRowIndex && actual.endColumnIndex === expected.endColumnIndex && actual.message === expected.message && actual.type === expected.type;
2299
2409
  };
@@ -2846,7 +2956,7 @@ const focus$1 = async () => {
2846
2956
  const setDeltaY = async deltaY => {
2847
2957
  await invoke('Explorer.setDeltaY', deltaY);
2848
2958
  };
2849
- const focusNext$7 = async () => {
2959
+ const focusNext$6 = async () => {
2850
2960
  await invoke('Explorer.focusNext');
2851
2961
  };
2852
2962
  const selectUp = async () => {
@@ -2873,10 +2983,10 @@ const clickCurrent = async () => {
2873
2983
  const handleArrowLeft$1 = async () => {
2874
2984
  await invoke('Explorer.handleArrowLeft');
2875
2985
  };
2876
- const focusLast$5 = async () => {
2986
+ const focusLast$4 = async () => {
2877
2987
  await invoke('Explorer.focusLast');
2878
2988
  };
2879
- const focusFirst$6 = async () => {
2989
+ const focusFirst$5 = async () => {
2880
2990
  await invoke('Explorer.focusFirst');
2881
2991
  };
2882
2992
  const removeDirent = async () => {
@@ -2891,10 +3001,10 @@ const newFile = async () => {
2891
3001
  const newFolder = async () => {
2892
3002
  await invoke('Explorer.newFolder');
2893
3003
  };
2894
- const copyPath$2 = async () => {
3004
+ const copyPath$1 = async () => {
2895
3005
  await invoke('Explorer.copyPath');
2896
3006
  };
2897
- const copyRelativePath$1 = async () => {
3007
+ const copyRelativePath = async () => {
2898
3008
  await invoke('Explorer.copyRelativePath');
2899
3009
  };
2900
3010
  const handleClick$3 = async index => {
@@ -2951,15 +3061,15 @@ const Explorer = {
2951
3061
  cancelEdit,
2952
3062
  clickCurrent,
2953
3063
  collapseAll: collapseAll$2,
2954
- copyPath: copyPath$2,
2955
- copyRelativePath: copyRelativePath$1,
3064
+ copyPath: copyPath$1,
3065
+ copyRelativePath,
2956
3066
  expandAll,
2957
3067
  expandRecursively,
2958
3068
  focus: focus$1,
2959
- focusFirst: focusFirst$6,
3069
+ focusFirst: focusFirst$5,
2960
3070
  focusIndex: focusIndex$5,
2961
- focusLast: focusLast$5,
2962
- focusNext: focusNext$7,
3071
+ focusLast: focusLast$4,
3072
+ focusNext: focusNext$6,
2963
3073
  handleArrowLeft: handleArrowLeft$1,
2964
3074
  handleBlur,
2965
3075
  handleClick: handleClick$3,
@@ -3027,17 +3137,17 @@ const handleClickSetColorTheme = async () => {
3027
3137
  const selectFeature = name => {
3028
3138
  return invoke('ExtensionDetail.selectFeature', name);
3029
3139
  };
3030
- const selectTab$2 = name => {
3140
+ const selectTab$1 = name => {
3031
3141
  return invoke('ExtensionDetail.selectTab', name);
3032
3142
  };
3033
3143
  const selectDetails = async () => {
3034
- await selectTab$2('Details');
3144
+ await selectTab$1('Details');
3035
3145
  };
3036
3146
  const selectFeatures = async () => {
3037
- await selectTab$2('Features');
3147
+ await selectTab$1('Features');
3038
3148
  };
3039
3149
  const selectChangelog = async () => {
3040
- await selectTab$2('Changelog');
3150
+ await selectTab$1('Changelog');
3041
3151
  };
3042
3152
  const focusNextTab = async () => {
3043
3153
  await invoke('ExtensionDetail.focusNextTab');
@@ -3112,7 +3222,7 @@ const ExtensionDetail = {
3112
3222
  selectDetails,
3113
3223
  selectFeature,
3114
3224
  selectFeatures,
3115
- selectTab: selectTab$2
3225
+ selectTab: selectTab$1
3116
3226
  };
3117
3227
 
3118
3228
  const open$7 = async id => {
@@ -3192,11 +3302,14 @@ const getFileMapNode = async url => {
3192
3302
  const fileUrl = toFileUrl(url);
3193
3303
  const allFiles = await getDirents(fileUrl);
3194
3304
  const fileMap = Object.create(null);
3195
- await Promise.all(allFiles.map(async filePath => {
3196
- const content = await readFile$1(filePath);
3305
+ const contents = await Promise.all(allFiles.map(filePath => {
3306
+ return readFile$1(filePath);
3307
+ }));
3308
+ allFiles.map((filePath, index) => {
3309
+ const content = contents[index];
3197
3310
  const relativePaths = filePath.slice(fileUrl.length + 1);
3198
3311
  fileMap[relativePaths] = content;
3199
- }));
3312
+ });
3200
3313
  return fileMap;
3201
3314
  };
3202
3315
 
@@ -3360,10 +3473,10 @@ const FileSystem = {
3360
3473
  writeJson
3361
3474
  };
3362
3475
 
3363
- const focusNext$6 = async () => {
3476
+ const focusNext$5 = async () => {
3364
3477
  await invoke('FindWidget.focusNext');
3365
3478
  };
3366
- const focusPrevious$6 = async () => {
3479
+ const focusPrevious$5 = async () => {
3367
3480
  await invoke('FindWidget.focusPrevious');
3368
3481
  };
3369
3482
  const close = async () => {
@@ -3409,9 +3522,9 @@ const focusPreviousElement = async () => {
3409
3522
  const FindWidget = {
3410
3523
  close,
3411
3524
  focusElement,
3412
- focusNext: focusNext$6,
3525
+ focusNext: focusNext$5,
3413
3526
  focusNextElement,
3414
- focusPrevious: focusPrevious$6,
3527
+ focusPrevious: focusPrevious$5,
3415
3528
  focusPreviousElement,
3416
3529
  replace,
3417
3530
  replaceAll: replaceAll$1,
@@ -3435,24 +3548,24 @@ const IconTheme = {
3435
3548
  const selectIndex$4 = async index => {
3436
3549
  return invoke('IframeInspector.selectIndex', index);
3437
3550
  };
3438
- const focusNext$5 = async () => {
3551
+ const focusNext$4 = async () => {
3439
3552
  return invoke('IframeInspector.focusNext');
3440
3553
  };
3441
- const focusPrevious$5 = async () => {
3554
+ const focusPrevious$4 = async () => {
3442
3555
  return invoke('IframeInspector.focusPrevious');
3443
3556
  };
3444
- const focusFirst$5 = async () => {
3557
+ const focusFirst$4 = async () => {
3445
3558
  return invoke('IframeInspector.focusFirst');
3446
3559
  };
3447
- const focusLast$4 = async () => {
3560
+ const focusLast$3 = async () => {
3448
3561
  return invoke('IframeInspector.focusLast');
3449
3562
  };
3450
3563
 
3451
3564
  const IframeInspector = {
3452
- focusFirst: focusFirst$5,
3453
- focusLast: focusLast$4,
3454
- focusNext: focusNext$5,
3455
- focusPrevious: focusPrevious$5,
3565
+ focusFirst: focusFirst$4,
3566
+ focusLast: focusLast$3,
3567
+ focusNext: focusNext$4,
3568
+ focusPrevious: focusPrevious$4,
3456
3569
  selectIndex: selectIndex$4
3457
3570
  };
3458
3571
 
@@ -3471,19 +3584,19 @@ const handleWheel$1 = (deltaMode, deltaY) => {
3471
3584
  const handleDoubleClick = (x, y) => {
3472
3585
  return invoke('KeyBindings.handleDoubleClick', x, y);
3473
3586
  };
3474
- const focusNext$4 = () => {
3587
+ const focusNext$3 = () => {
3475
3588
  return invoke('KeyBindings.focusNext');
3476
3589
  };
3477
- const focusPrevious$4 = () => {
3590
+ const focusPrevious$3 = () => {
3478
3591
  return invoke('KeyBindings.focusPrevious');
3479
3592
  };
3480
- const focusFirst$4 = () => {
3593
+ const focusFirst$3 = () => {
3481
3594
  return invoke('KeyBindings.focusFirst');
3482
3595
  };
3483
3596
  const focusIndex$4 = index => {
3484
3597
  return invoke('KeyBindings.focusIndex', index);
3485
3598
  };
3486
- const focusLast$3 = () => {
3599
+ const focusLast$2 = () => {
3487
3600
  return invoke('KeyBindings.focusLast');
3488
3601
  };
3489
3602
  const toggleRecordingKeys = () => {
@@ -3532,11 +3645,11 @@ const KeyBindingsEditor = {
3532
3645
  clearInput,
3533
3646
  copyCommandId,
3534
3647
  copyCommandTitle,
3535
- focusFirst: focusFirst$4,
3648
+ focusFirst: focusFirst$3,
3536
3649
  focusIndex: focusIndex$4,
3537
- focusLast: focusLast$3,
3538
- focusNext: focusNext$4,
3539
- focusPrevious: focusPrevious$4,
3650
+ focusLast: focusLast$2,
3651
+ focusNext: focusNext$3,
3652
+ focusPrevious: focusPrevious$3,
3540
3653
  handleClick: handleClick$1,
3541
3654
  handleContextMenu: handleContextMenu$3,
3542
3655
  handleDoubleClick,
@@ -3605,18 +3718,6 @@ const KeyBoard = {
3605
3718
  press
3606
3719
  };
3607
3720
 
3608
- const showSideBar = async () => {
3609
- await execute$1('Layout.showSideBar');
3610
- };
3611
- const handleWorkspaceRefresh = async () => {
3612
- await invoke('Layout.handleWorkspaceRefresh');
3613
- };
3614
-
3615
- const Layout = {
3616
- handleWorkspaceRefresh,
3617
- showSideBar
3618
- };
3619
-
3620
3721
  const open$4 = async () => {
3621
3722
  await invoke('Main.openUri', 'language-models:///1');
3622
3723
  };
@@ -3641,92 +3742,16 @@ const LanguageModels = {
3641
3742
  removeModel
3642
3743
  };
3643
3744
 
3644
- const openUri = async uri => {
3645
- await invoke('Main.openUri', uri);
3646
- };
3647
- const splitRight = async () => {
3648
- await invoke('Main.splitRight');
3649
- };
3650
- const splitDown = async () => {
3651
- await invoke('Main.splitDown');
3652
- };
3653
- const openKeyBindings = async () => {
3654
- await invoke('Main.openKeyBindings');
3655
- };
3656
- const handleClickTogglePreview = async () => {
3657
- await invoke('Main.handleClickTogglePreview');
3658
- };
3659
- const closeAllEditors = async () => {
3660
- await invoke('Main.closeAllEditors');
3661
- };
3662
- const closeTabsLeft = async () => {
3663
- await invoke('Main.closeTabsLeft');
3664
- };
3665
- const handleModifiedStatusChange = async (uri, newStatus) => {
3666
- await invoke('Main.handleModifiedStatusChange', uri, newStatus);
3667
- };
3668
- const closeTabsRight = async () => {
3669
- await invoke('Main.closeTabsRight');
3670
- };
3671
- const selectTab$1 = async (groupIndex, tabIndex) => {
3672
- await invoke('Main.selectTab', groupIndex, tabIndex);
3673
- };
3674
- const closeOthers = async () => {
3675
- await invoke('Main.closeOthers');
3676
- };
3677
- const closeActiveEditor = async () => {
3678
- await invoke('Main.closeActiveEditor');
3679
- };
3680
- const save = async () => {
3681
- await invoke('Main.save');
3682
- };
3683
- const saveAll = async () => {
3684
- await invoke('Main.saveAll');
3685
- };
3686
- const focusFirst$3 = async () => {
3687
- await invoke('Main.focusFirst');
3688
- };
3689
- const focusNext$3 = async () => {
3690
- await invoke('Main.focusNext');
3691
- };
3692
- const focusPrevious$3 = async () => {
3693
- await invoke('Main.focusPrevious');
3694
- };
3695
- const focusLast$2 = async () => {
3696
- await invoke('Main.focusLast');
3697
- };
3698
- const handleTabContextMenu = async (button, x, y) => {
3699
- await invoke('Main.handleTabContextMenu', button, x, y);
3700
- };
3701
- const copyPath$1 = async () => {
3702
- await invoke('Main.copyPath');
3745
+ const showSideBar = async () => {
3746
+ await execute$1('Layout.showSideBar');
3703
3747
  };
3704
- const copyRelativePath = async () => {
3705
- await invoke('Main.copyRelativePath');
3748
+ const handleWorkspaceRefresh = async () => {
3749
+ await invoke('Layout.handleWorkspaceRefresh');
3706
3750
  };
3707
3751
 
3708
- const Main = {
3709
- closeActiveEditor,
3710
- closeAllEditors,
3711
- closeOthers,
3712
- closeTabsLeft,
3713
- closeTabsRight,
3714
- copyPath: copyPath$1,
3715
- copyRelativePath,
3716
- focusFirst: focusFirst$3,
3717
- focusLast: focusLast$2,
3718
- focusNext: focusNext$3,
3719
- focusPrevious: focusPrevious$3,
3720
- handleClickTogglePreview,
3721
- handleModifiedStatusChange,
3722
- handleTabContextMenu,
3723
- openKeyBindings,
3724
- openUri,
3725
- save,
3726
- saveAll,
3727
- selectTab: selectTab$1,
3728
- splitDown,
3729
- splitRight
3752
+ const Layout = {
3753
+ handleWorkspaceRefresh,
3754
+ showSideBar
3730
3755
  };
3731
3756
 
3732
3757
  const enableMemoryOpener = async () => {
@@ -4521,6 +4546,7 @@ const createApi = (platform, assetDir) => {
4521
4546
  ContextMenu,
4522
4547
  Developer,
4523
4548
  Dialog,
4549
+ DiffView,
4524
4550
  Editor,
4525
4551
  EditorCompletion,
4526
4552
  EditorHover,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "14.1.0",
3
+ "version": "14.2.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",