@lvce-editor/renderer-process 9.4.1 → 9.6.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.
@@ -52,6 +52,7 @@ const PointerCapture = 42;
52
52
  const GetFilePathElectron = 43;
53
53
  const HandleMessagePort = 44;
54
54
  const MeasureTextBlockHeight = 45;
55
+ const WebView$1 = 46;
55
56
 
56
57
  const getModuleId = commandId => {
57
58
  switch (commandId) {
@@ -207,6 +208,9 @@ const getModuleId = commandId => {
207
208
  return GetFilePathElectron;
208
209
  case 'HandleMessagePort.handleMessagePort':
209
210
  return HandleMessagePort;
211
+ case 'WebView.create':
212
+ case 'WebView.setPort':
213
+ return WebView$1;
210
214
  default:
211
215
  throw new CommandNotFoundError(commandId);
212
216
  }
@@ -364,7 +368,7 @@ const handleBeforeInstallPrompt = event => {
364
368
  const handleContentSecurityPolicyViolation = event => {
365
369
  };
366
370
 
367
- const load$1 = moduleId => {
371
+ const load$2 = moduleId => {
368
372
  switch (moduleId) {
369
373
  case Audio$3:
370
374
  return Promise.resolve().then(function () { return Audio_ipc; });
@@ -436,6 +440,8 @@ const load$1 = moduleId => {
436
440
  return Promise.resolve().then(function () { return GetFilePathElectron_ipc; });
437
441
  case HandleMessagePort:
438
442
  return Promise.resolve().then(function () { return HandleMessagePort_ipc; });
443
+ case WebView$1:
444
+ return Promise.resolve().then(function () { return WebView_ipc; });
439
445
  default:
440
446
  throw new Error(`module ${moduleId} not found`);
441
447
  }
@@ -747,7 +753,7 @@ const getErrorResponse = (message, error, preparePrettyError, logError) => {
747
753
  const errorProperty = getErrorProperty(error, prettyError);
748
754
  return create$1$1(message, errorProperty);
749
755
  };
750
- const create$L = (message, result) => {
756
+ const create$M = (message, result) => {
751
757
  return {
752
758
  jsonrpc: Two,
753
759
  id: message.id,
@@ -756,7 +762,7 @@ const create$L = (message, result) => {
756
762
  };
757
763
  const getSuccessResponse = (message, result) => {
758
764
  const resultProperty = result ?? null;
759
- return create$L(message, resultProperty);
765
+ return create$M(message, resultProperty);
760
766
  };
761
767
  const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
762
768
  try {
@@ -934,7 +940,7 @@ const has = name => {
934
940
  return ipcs[name];
935
941
  };
936
942
 
937
- const create$K = async ({
943
+ const create$L = async ({
938
944
  method,
939
945
  ...options
940
946
  }) => {
@@ -1008,7 +1014,7 @@ const launchWorker = async ({
1008
1014
  name,
1009
1015
  url
1010
1016
  }) => {
1011
- const worker = await create$K({
1017
+ const worker = await create$L({
1012
1018
  method: Auto,
1013
1019
  url,
1014
1020
  name
@@ -1494,7 +1500,7 @@ const handleUnhandledError = (message, filename, lineno, colno, error) => {
1494
1500
  const editorWorkerUrl = `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/editor-worker/dist/editorWorkerMain.js`;
1495
1501
 
1496
1502
  const launchEditorWorker = async port => {
1497
- const ipc = await create$K({
1503
+ const ipc = await create$L({
1498
1504
  name: 'Editor Worker',
1499
1505
  url: editorWorkerUrl,
1500
1506
  method: ModuleWorkerWithMessagePort,
@@ -1520,7 +1526,7 @@ const extensionHostWorkerUrl = `${assetDir}/packages/extension-host-worker/src/e
1520
1526
 
1521
1527
  const launchExtensionHostWorker = async port => {
1522
1528
  const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
1523
- const ipc = await create$K({
1529
+ const ipc = await create$L({
1524
1530
  name,
1525
1531
  url: extensionHostWorkerUrl,
1526
1532
  method: ModuleWorkerWithMessagePort,
@@ -1544,7 +1550,7 @@ const hydrate$2 = async () => {
1544
1550
  const syntaxHighlightingWorkerUrl = `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/syntax-highlighting-worker/dist/syntaxHighlightingWorkerMain.js`;
1545
1551
 
1546
1552
  const launchSyntaxHighlightingWorker = async port => {
1547
- const ipc = await create$K({
1553
+ const ipc = await create$L({
1548
1554
  name: 'Syntax Highlighting Worker',
1549
1555
  url: syntaxHighlightingWorkerUrl,
1550
1556
  method: ModuleWorkerWithMessagePort,
@@ -2445,7 +2451,7 @@ const setNegativeMargin = (state, negativeMargin) => {
2445
2451
  setTop($ListItems, negativeMargin);
2446
2452
  };
2447
2453
 
2448
- const create$J = () => {
2454
+ const create$K = () => {
2449
2455
  const $ListItems = document.createElement('div');
2450
2456
  $ListItems.className = 'ListItems';
2451
2457
  $ListItems.role = ListBox;
@@ -2528,7 +2534,7 @@ const setBounds$5 = (state, x, y, width, height) => {
2528
2534
  const ViewletEditorCompletion = {
2529
2535
  __proto__: null,
2530
2536
  attachEvents: attachEvents$b,
2531
- create: create$J,
2537
+ create: create$K,
2532
2538
  dispose: dispose$i,
2533
2539
  handleError: handleError$7,
2534
2540
  setBounds: setBounds$5,
@@ -2619,7 +2625,7 @@ const main = async () => {
2619
2625
  if ('SecurityPolicyViolationEvent' in self) {
2620
2626
  self.addEventListener('securitypolicyviolation', handleContentSecurityPolicyViolation);
2621
2627
  }
2622
- setLoad(load$1);
2628
+ setLoad(load$2);
2623
2629
  if (platform === Web) {
2624
2630
  // disable prompt to download app as pwa
2625
2631
  // @ts-expect-error
@@ -2637,15 +2643,15 @@ const play = async src => {
2637
2643
  await audio.play();
2638
2644
  };
2639
2645
 
2640
- const name$y = 'Audio';
2641
- const Commands$z = {
2646
+ const name$z = 'Audio';
2647
+ const Commands$A = {
2642
2648
  play: play
2643
2649
  };
2644
2650
 
2645
2651
  const Audio_ipc = {
2646
2652
  __proto__: null,
2647
- Commands: Commands$z,
2648
- name: name$y
2653
+ Commands: Commands$A,
2654
+ name: name$z
2649
2655
  };
2650
2656
 
2651
2657
  const readText = async () => {
@@ -2666,8 +2672,8 @@ const execCopy = async () => {
2666
2672
  await writeText(text);
2667
2673
  };
2668
2674
 
2669
- const name$x = 'ClipBoard';
2670
- const Commands$y = {
2675
+ const name$y = 'ClipBoard';
2676
+ const Commands$z = {
2671
2677
  execCopy: execCopy,
2672
2678
  readText: readText,
2673
2679
  writeImage: writeImage,
@@ -2676,23 +2682,23 @@ const Commands$y = {
2676
2682
 
2677
2683
  const ClipBoard_ipc = {
2678
2684
  __proto__: null,
2679
- Commands: Commands$y,
2680
- name: name$x
2685
+ Commands: Commands$z,
2686
+ name: name$y
2681
2687
  };
2682
2688
 
2683
2689
  const prompt$1 = message => {
2684
2690
  return confirm(message);
2685
2691
  };
2686
2692
 
2687
- const name$w = 'ConfirmPrompt';
2688
- const Commands$x = {
2693
+ const name$x = 'ConfirmPrompt';
2694
+ const Commands$y = {
2689
2695
  prompt: prompt$1
2690
2696
  };
2691
2697
 
2692
2698
  const ConfirmPrompt_ipc = {
2693
2699
  __proto__: null,
2694
- Commands: Commands$x,
2695
- name: name$w
2700
+ Commands: Commands$y,
2701
+ name: name$x
2696
2702
  };
2697
2703
 
2698
2704
  const state$5 = {
@@ -2717,15 +2723,15 @@ const addCssStyleSheet = async (id, text) => {
2717
2723
  document.adoptedStyleSheets.push(sheet);
2718
2724
  };
2719
2725
 
2720
- const name$v = 'Css';
2721
- const Commands$w = {
2726
+ const name$w = 'Css';
2727
+ const Commands$x = {
2722
2728
  addCssStyleSheet: addCssStyleSheet
2723
2729
  };
2724
2730
 
2725
2731
  const Css_ipc = {
2726
2732
  __proto__: null,
2727
- Commands: Commands$w,
2728
- name: name$v
2733
+ Commands: Commands$x,
2734
+ name: name$w
2729
2735
  };
2730
2736
 
2731
2737
  const modules = ['ActivityBar', 'Ajax', 'Allocator', 'Callback', 'Command', 'Context', 'ContextMenu', 'Delay', 'Developer', 'DomPool', 'Editor', 'Exec', 'ExtensionHost', 'FileSystem', 'KeyBindings', 'Layout', 'Main', 'Notification', 'Panel', 'Parts', 'QuickPick', 'Renderer', 'RendererWorker', 'Search', 'SharedProcess', 'SideBar', 'StatusBar', 'TitleBar', 'Viewlet', 'ViewletController', 'ViewService', 'Vscode', 'Window', 'Workbench', 'Worker', 'Workspace'];
@@ -2745,15 +2751,15 @@ const showState = async () => {
2745
2751
  info(state);
2746
2752
  };
2747
2753
 
2748
- const name$u = 'Developer';
2749
- const Commands$v = {
2754
+ const name$v = 'Developer';
2755
+ const Commands$w = {
2750
2756
  showState: showState
2751
2757
  };
2752
2758
 
2753
2759
  const Developer_ipc = {
2754
2760
  __proto__: null,
2755
- Commands: Commands$v,
2756
- name: name$u
2761
+ Commands: Commands$w,
2762
+ name: name$v
2757
2763
  };
2758
2764
 
2759
2765
  const downloadFile = (fileName, url) => {
@@ -2763,15 +2769,15 @@ const downloadFile = (fileName, url) => {
2763
2769
  a.click();
2764
2770
  };
2765
2771
 
2766
- const name$t = 'Download';
2767
- const Commands$u = {
2772
+ const name$u = 'Download';
2773
+ const Commands$v = {
2768
2774
  downloadFile: downloadFile
2769
2775
  };
2770
2776
 
2771
2777
  const Download_ipc = {
2772
2778
  __proto__: null,
2773
- Commands: Commands$u,
2774
- name: name$t
2779
+ Commands: Commands$v,
2780
+ name: name$u
2775
2781
  };
2776
2782
 
2777
2783
  // based on https://github.com/microsoft/vscode/blob/5f87632829dc3ac80203e2377727935184399431/src/vs/base/browser/ui/aria/aria.ts (License MIT)
@@ -2860,7 +2866,7 @@ const AriaAlert = {
2860
2866
  // but that's difficult to know
2861
2867
 
2862
2868
  // TODO hide widget after timeout or mousemove
2863
- const create$I = (message, x, y) => {
2869
+ const create$J = (message, x, y) => {
2864
2870
  const $EditorError = document.createElement('div');
2865
2871
  $EditorError.className = 'EditorWidgetError';
2866
2872
  $EditorError.textContent = message;
@@ -2873,15 +2879,15 @@ const create$I = (message, x, y) => {
2873
2879
  };
2874
2880
  };
2875
2881
 
2876
- const name$s = 'EditorError';
2877
- const Commands$t = {
2878
- create: create$I
2882
+ const name$t = 'EditorError';
2883
+ const Commands$u = {
2884
+ create: create$J
2879
2885
  };
2880
2886
 
2881
2887
  const EditorError_ipc = {
2882
2888
  __proto__: null,
2883
- Commands: Commands$t,
2884
- name: name$s
2889
+ Commands: Commands$u,
2890
+ name: name$t
2885
2891
  };
2886
2892
 
2887
2893
  const state$3 = {
@@ -2915,7 +2921,7 @@ const focusPrevious = () => {
2915
2921
  }
2916
2922
  };
2917
2923
 
2918
- const create$H = () => {
2924
+ const create$I = () => {
2919
2925
  const $InputBox = document.createElement('input');
2920
2926
  $InputBox.className = 'InputBox';
2921
2927
  $InputBox.spellcheck = false;
@@ -2939,8 +2945,8 @@ const FocusOutput = 28;
2939
2945
  const handleBlur$9 = () => {
2940
2946
  send(/* EditorRename.abort */'EditorRename.abort');
2941
2947
  };
2942
- const create$G = (x, y) => {
2943
- const $RenameWidgetInputBox = create$H();
2948
+ const create$H = (x, y) => {
2949
+ const $RenameWidgetInputBox = create$I();
2944
2950
  $RenameWidgetInputBox.className = 'RenameWidgetInputBox';
2945
2951
  $RenameWidgetInputBox.onblur = handleBlur$9;
2946
2952
  const $RenameWidget = document.createElement('div');
@@ -2969,17 +2975,17 @@ const finish = state => {
2969
2975
  return value;
2970
2976
  };
2971
2977
 
2972
- const name$r = 'EditorRename';
2973
- const Commands$s = {
2974
- create: create$G,
2978
+ const name$s = 'EditorRename';
2979
+ const Commands$t = {
2980
+ create: create$H,
2975
2981
  dispose: dispose$h,
2976
2982
  finish: finish
2977
2983
  };
2978
2984
 
2979
2985
  const EditorRename_ipc = {
2980
2986
  __proto__: null,
2981
- Commands: Commands$s,
2982
- name: name$r
2987
+ Commands: Commands$t,
2988
+ name: name$s
2983
2989
  };
2984
2990
 
2985
2991
  const showDirectoryPicker = options => {
@@ -2995,8 +3001,8 @@ const showSaveFilePicker = options => {
2995
3001
  return window.showSaveFilePicker(options);
2996
3002
  };
2997
3003
 
2998
- const name$q = 'FilePicker';
2999
- const Commands$r = {
3004
+ const name$r = 'FilePicker';
3005
+ const Commands$s = {
3000
3006
  showDirectoryPicker: showDirectoryPicker,
3001
3007
  showFilePicker: showFilePicker,
3002
3008
  showSaveFilePicker: showSaveFilePicker
@@ -3004,23 +3010,23 @@ const Commands$r = {
3004
3010
 
3005
3011
  const FilePicker_ipc = {
3006
3012
  __proto__: null,
3007
- Commands: Commands$r,
3008
- name: name$q
3013
+ Commands: Commands$s,
3014
+ name: name$r
3009
3015
  };
3010
3016
 
3011
3017
  const requestPermission = (handle, options) => {
3012
3018
  return handle.requestPermission(options);
3013
3019
  };
3014
3020
 
3015
- const name$p = 'FileSystemHandle';
3016
- const Commands$q = {
3021
+ const name$q = 'FileSystemHandle';
3022
+ const Commands$r = {
3017
3023
  requestPermission: requestPermission
3018
3024
  };
3019
3025
 
3020
3026
  const FileSystemHandle_ipc = {
3021
3027
  __proto__: null,
3022
- Commands: Commands$q,
3023
- name: name$p
3028
+ Commands: Commands$r,
3029
+ name: name$q
3024
3030
  };
3025
3031
 
3026
3032
  const handleImageLoad = event => {
@@ -3057,7 +3063,7 @@ const showError = (message, y, x) => {
3057
3063
  $ImagePreviewImage
3058
3064
  };
3059
3065
  };
3060
- const create$F = (uri, top, left) => {
3066
+ const create$G = (uri, top, left) => {
3061
3067
  const $ImagePreviewImage = document.createElement('img');
3062
3068
  $ImagePreviewImage.className = 'ImagePreviewImage';
3063
3069
  $ImagePreviewImage.src = uri;
@@ -3088,15 +3094,15 @@ const dispose$g = state => {
3088
3094
 
3089
3095
  const ImagePreview = {
3090
3096
  __proto__: null,
3091
- create: create$F,
3097
+ create: create$G,
3092
3098
  dispose: dispose$g,
3093
3099
  showError,
3094
3100
  update
3095
3101
  };
3096
3102
 
3097
- const name$o = 'ImagePreview';
3098
- const Commands$p = {
3099
- create: create$F,
3103
+ const name$p = 'ImagePreview';
3104
+ const Commands$q = {
3105
+ create: create$G,
3100
3106
  dispose: dispose$g,
3101
3107
  showError: showError,
3102
3108
  update: update
@@ -3104,8 +3110,8 @@ const Commands$p = {
3104
3110
 
3105
3111
  const ImagePreview_ipc = {
3106
3112
  __proto__: null,
3107
- Commands: Commands$p,
3108
- name: name$o
3113
+ Commands: Commands$q,
3114
+ name: name$p
3109
3115
  };
3110
3116
 
3111
3117
  const getTitleBarHeight = () => {
@@ -3161,41 +3167,41 @@ const getInitData = () => {
3161
3167
  return initData;
3162
3168
  };
3163
3169
 
3164
- const name$n = 'InitData';
3165
- const Commands$o = {
3170
+ const name$o = 'InitData';
3171
+ const Commands$p = {
3166
3172
  getInitData: getInitData
3167
3173
  };
3168
3174
 
3169
3175
  const InitData_ipc = {
3170
3176
  __proto__: null,
3171
- Commands: Commands$o,
3172
- name: name$n
3177
+ Commands: Commands$p,
3178
+ name: name$o
3173
3179
  };
3174
3180
 
3175
- const name$m = 'IpcParent';
3176
- const Commands$n = {
3177
- create: create$K
3181
+ const name$n = 'IpcParent';
3182
+ const Commands$o = {
3183
+ create: create$L
3178
3184
  };
3179
3185
 
3180
3186
  const IpcParent_ipc = {
3181
3187
  __proto__: null,
3182
- Commands: Commands$n,
3183
- name: name$m
3188
+ Commands: Commands$o,
3189
+ name: name$n
3184
3190
  };
3185
3191
 
3186
- const name$l = 'Layout';
3187
- const Commands$m = {
3192
+ const name$m = 'Layout';
3193
+ const Commands$n = {
3188
3194
  getBounds: getBounds
3189
3195
  };
3190
3196
 
3191
3197
  const Layout_ipc = {
3192
3198
  __proto__: null,
3193
- Commands: Commands$m,
3194
- name: name$l
3199
+ Commands: Commands$n,
3200
+ name: name$m
3195
3201
  };
3196
3202
 
3197
- const name$k = 'Location';
3198
- const Commands$l = {
3203
+ const name$l = 'Location';
3204
+ const Commands$m = {
3199
3205
  getHref: getHref,
3200
3206
  getPathName: getPathName,
3201
3207
  hydrate: hydrate,
@@ -3204,8 +3210,8 @@ const Commands$l = {
3204
3210
 
3205
3211
  const Location_ipc = {
3206
3212
  __proto__: null,
3207
- Commands: Commands$l,
3208
- name: name$k
3213
+ Commands: Commands$m,
3214
+ name: name$l
3209
3215
  };
3210
3216
 
3211
3217
  const getElementHeight = $Element => {
@@ -3228,15 +3234,15 @@ const measureTextHeight = (text, fontSize, fontFamily) => {
3228
3234
  return getElementHeight($Measure);
3229
3235
  };
3230
3236
 
3231
- const name$j = 'MeasureTextHeight';
3232
- const Commands$k = {
3237
+ const name$k = 'MeasureTextHeight';
3238
+ const Commands$l = {
3233
3239
  measureTextHeight: measureTextHeight
3234
3240
  };
3235
3241
 
3236
3242
  const MeasureTextHeight_ipc = {
3237
3243
  __proto__: null,
3238
- Commands: Commands$k,
3239
- name: name$j
3244
+ Commands: Commands$l,
3245
+ name: name$k
3240
3246
  };
3241
3247
 
3242
3248
  const measureTextBlockHeight = (text, fontSize, fontFamily, lineHeight, width) => {
@@ -3257,15 +3263,15 @@ const measureTextBlockHeight = (text, fontSize, fontFamily, lineHeight, width) =
3257
3263
  return getElementHeight($Measure);
3258
3264
  };
3259
3265
 
3260
- const name$i = 'MeasureTextBlockHeight';
3261
- const Commands$j = {
3266
+ const name$j = 'MeasureTextBlockHeight';
3267
+ const Commands$k = {
3262
3268
  measureTextBlockHeight: measureTextBlockHeight
3263
3269
  };
3264
3270
 
3265
3271
  const MeasureTextBlockHeight_ipc = {
3266
3272
  __proto__: null,
3267
- Commands: Commands$j,
3268
- name: name$i
3273
+ Commands: Commands$k,
3274
+ name: name$j
3269
3275
  };
3270
3276
 
3271
3277
  const setThemeColor = color => {
@@ -3277,15 +3283,15 @@ const setThemeColor = color => {
3277
3283
  meta.content = color;
3278
3284
  };
3279
3285
 
3280
- const name$h = 'Meta';
3281
- const Commands$i = {
3286
+ const name$i = 'Meta';
3287
+ const Commands$j = {
3282
3288
  setThemeColor: setThemeColor
3283
3289
  };
3284
3290
 
3285
3291
  const Meta_ipc = {
3286
3292
  __proto__: null,
3287
- Commands: Commands$i,
3288
- name: name$h
3293
+ Commands: Commands$j,
3294
+ name: name$i
3289
3295
  };
3290
3296
 
3291
3297
  const create$Notification = message => {
@@ -3294,7 +3300,7 @@ const create$Notification = message => {
3294
3300
  $Notification.textContent = message;
3295
3301
  return $Notification;
3296
3302
  };
3297
- const create$E = (type, message) => {
3303
+ const create$F = (type, message) => {
3298
3304
  // TODO this pattern might be also useful for activitybar, sidebar etc., creating elements as late as possible, only when actually needed
3299
3305
  const $Notification = create$Notification(message);
3300
3306
  append$1($Notification);
@@ -3343,19 +3349,19 @@ const dispose$f = id => {
3343
3349
  // const $Notification = state.$Notifications
3344
3350
  };
3345
3351
 
3346
- const name$g = 'Notification';
3352
+ const name$h = 'Notification';
3347
3353
 
3348
3354
  // prettier-ignore
3349
- const Commands$h = {
3350
- create: create$E,
3355
+ const Commands$i = {
3356
+ create: create$F,
3351
3357
  createWithOptions: createWithOptions,
3352
3358
  dispose: dispose$f
3353
3359
  };
3354
3360
 
3355
3361
  const Notification_ipc = {
3356
3362
  __proto__: null,
3357
- Commands: Commands$h,
3358
- name: name$g
3363
+ Commands: Commands$i,
3364
+ name: name$h
3359
3365
  };
3360
3366
 
3361
3367
  const state$2 = {
@@ -3371,24 +3377,24 @@ const set$3 = (canvasId, canvas) => {
3371
3377
  const get$3 = id => {
3372
3378
  return get$4(id);
3373
3379
  };
3374
- const create$D = async (canvasId, objectId) => {
3380
+ const create$E = async (canvasId, objectId) => {
3375
3381
  const canvas = document.createElement('canvas');
3376
3382
  const offscreenCanvas = canvas.transferControlToOffscreen();
3377
3383
  set$3(canvasId, canvas);
3378
3384
  await invokeAndTransfer('Transferrable.transfer', objectId, offscreenCanvas);
3379
3385
  };
3380
3386
 
3381
- const name$f = 'OffscreenCanvas';
3387
+ const name$g = 'OffscreenCanvas';
3382
3388
 
3383
3389
  // prettier-ignore
3384
- const Commands$g = {
3385
- create: create$D
3390
+ const Commands$h = {
3391
+ create: create$E
3386
3392
  };
3387
3393
 
3388
3394
  const OffscreenCanvas_ipc = {
3389
3395
  __proto__: null,
3390
- Commands: Commands$g,
3391
- name: name$f
3396
+ Commands: Commands$h,
3397
+ name: name$g
3392
3398
  };
3393
3399
 
3394
3400
  // TODO this module should be called dom or dom utils
@@ -3681,8 +3687,8 @@ const hide = (restoreFocus = true) => {
3681
3687
  }
3682
3688
  };
3683
3689
 
3684
- const name$e = 'Menu';
3685
- const Commands$f = {
3690
+ const name$f = 'Menu';
3691
+ const Commands$g = {
3686
3692
  focusIndex: focusIndex,
3687
3693
  hide: hide,
3688
3694
  hideSubMenu: hideSubMenu,
@@ -3692,23 +3698,23 @@ const Commands$f = {
3692
3698
 
3693
3699
  const Menu_ipc = {
3694
3700
  __proto__: null,
3695
- Commands: Commands$f,
3696
- name: name$e
3701
+ Commands: Commands$g,
3702
+ name: name$f
3697
3703
  };
3698
3704
 
3699
3705
  const openUrl = url => {
3700
3706
  open(url);
3701
3707
  };
3702
3708
 
3703
- const name$d = 'Open';
3704
- const Commands$e = {
3709
+ const name$e = 'Open';
3710
+ const Commands$f = {
3705
3711
  openUrl: openUrl
3706
3712
  };
3707
3713
 
3708
3714
  const Open_ipc = {
3709
3715
  __proto__: null,
3710
- Commands: Commands$e,
3711
- name: name$d
3716
+ Commands: Commands$f,
3717
+ name: name$e
3712
3718
  };
3713
3719
 
3714
3720
  const isElectronUserAgentSpecificMemoryError = error => {
@@ -3747,18 +3753,18 @@ const getMemory = () => {
3747
3753
  };
3748
3754
  };
3749
3755
 
3750
- const name$c = 'Performance';
3756
+ const name$d = 'Performance';
3751
3757
 
3752
3758
  // prettier-ignore
3753
- const Commands$d = {
3759
+ const Commands$e = {
3754
3760
  getMemory: getMemory,
3755
3761
  measureUserAgentSpecificMemory: measureUserAgentSpecificMemory
3756
3762
  };
3757
3763
 
3758
3764
  const Performance_ipc = {
3759
3765
  __proto__: null,
3760
- Commands: Commands$d,
3761
- name: name$c
3766
+ Commands: Commands$e,
3767
+ name: name$d
3762
3768
  };
3763
3769
 
3764
3770
  const prompt = (message, defaultValue) => {
@@ -3766,15 +3772,15 @@ const prompt = (message, defaultValue) => {
3766
3772
  return window.prompt(message, defaultValue);
3767
3773
  };
3768
3774
 
3769
- const name$b = 'Prompt';
3770
- const Commands$c = {
3775
+ const name$c = 'Prompt';
3776
+ const Commands$d = {
3771
3777
  prompt: prompt
3772
3778
  };
3773
3779
 
3774
3780
  const Prompt_ipc = {
3775
3781
  __proto__: null,
3776
- Commands: Commands$c,
3777
- name: name$b
3782
+ Commands: Commands$d,
3783
+ name: name$c
3778
3784
  };
3779
3785
 
3780
3786
  const screenCaptures = Object.create(null);
@@ -3815,16 +3821,16 @@ const dispose$e = async (id, options) => {
3815
3821
  }
3816
3822
  };
3817
3823
 
3818
- const name$a = 'ScreenCapture';
3819
- const Commands$b = {
3824
+ const name$b = 'ScreenCapture';
3825
+ const Commands$c = {
3820
3826
  dispose: dispose$e,
3821
3827
  start: start
3822
3828
  };
3823
3829
 
3824
3830
  const ScreenCapture_ipc = {
3825
3831
  __proto__: null,
3826
- Commands: Commands$b,
3827
- name: name$a
3832
+ Commands: Commands$c,
3833
+ name: name$b
3828
3834
  };
3829
3835
 
3830
3836
  const htmlElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdo', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'link', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'];
@@ -4330,10 +4336,10 @@ const checkMultiElementCondition = async (locator, fnName, options) => {
4330
4336
  throw new AssertionError(message);
4331
4337
  };
4332
4338
 
4333
- const name$9 = 'TestFrameWork';
4339
+ const name$a = 'TestFrameWork';
4334
4340
 
4335
4341
  // prettier-ignore
4336
- const Commands$a = {
4342
+ const Commands$b = {
4337
4343
  checkMultiElementCondition: checkMultiElementCondition,
4338
4344
  checkSingleElementCondition: checkSingleElementCondition,
4339
4345
  performAction: performAction,
@@ -4343,8 +4349,8 @@ const Commands$a = {
4343
4349
 
4344
4350
  const TestFrameWork_ipc = {
4345
4351
  __proto__: null,
4346
- Commands: Commands$a,
4347
- name: name$9
4352
+ Commands: Commands$b,
4353
+ name: name$a
4348
4354
  };
4349
4355
 
4350
4356
  const webViews = Object.create(null);
@@ -4389,16 +4395,16 @@ const transferToWebView = objectId => {
4389
4395
  }, '*', [port]);
4390
4396
  };
4391
4397
 
4392
- const name$8 = 'Transferrable';
4393
- const Commands$9 = {
4398
+ const name$9 = 'Transferrable';
4399
+ const Commands$a = {
4394
4400
  transfer: transfer,
4395
4401
  transferToWebView: transferToWebView
4396
4402
  };
4397
4403
 
4398
4404
  const Transferrable_ipc = {
4399
4405
  __proto__: null,
4400
- Commands: Commands$9,
4401
- name: name$8
4406
+ Commands: Commands$a,
4407
+ name: name$9
4402
4408
  };
4403
4409
 
4404
4410
  const state = {
@@ -4428,7 +4434,7 @@ const setIdentifiers = identifiers => {
4428
4434
 
4429
4435
  const rememberFocus = rememberFocus$1;
4430
4436
 
4431
- const load = moduleId => {
4437
+ const load$1 = moduleId => {
4432
4438
  switch (moduleId) {
4433
4439
  case ImagePreview$1:
4434
4440
  return Promise.resolve().then(function () { return ImagePreview; });
@@ -4547,7 +4553,7 @@ const load = moduleId => {
4547
4553
  }
4548
4554
  };
4549
4555
 
4550
- const create$C = (id, uid = id) => {
4556
+ const create$D = (id, uid = id) => {
4551
4557
  const module = state$6.modules[id];
4552
4558
  if (!module) {
4553
4559
  throw new Error(`module not found: ${id}`);
@@ -4591,7 +4597,7 @@ const removeKeyBindings = id => {
4591
4597
  };
4592
4598
  const loadModule = async id => {
4593
4599
  try {
4594
- const module = await load(id);
4600
+ const module = await load$1(id);
4595
4601
  state$6.modules[id] = module;
4596
4602
  } catch (error) {
4597
4603
  throw new VError$1(error, `Failed to load ${id}`);
@@ -4714,7 +4720,7 @@ const sendMultiple = commands => {
4714
4720
  }
4715
4721
  case 'Viewlet.create':
4716
4722
  {
4717
- create$C(viewletId, method);
4723
+ create$D(viewletId, method);
4718
4724
  break;
4719
4725
  }
4720
4726
  case 'Viewlet.createFunctionalRoot':
@@ -4909,7 +4915,7 @@ const appendToBody = childId => {
4909
4915
  const getFn = command => {
4910
4916
  switch (command) {
4911
4917
  case 'Viewlet.create':
4912
- return create$C;
4918
+ return create$D;
4913
4919
  case 'Viewlet.send':
4914
4920
  return invoke;
4915
4921
  case 'Viewlet.show':
@@ -4968,8 +4974,8 @@ const setBounds$4 = (id, left, top, width, height) => {
4968
4974
  setBounds$6($Viewlet, left, top, width, height);
4969
4975
  };
4970
4976
 
4971
- const name$7 = 'Viewlet';
4972
- const Commands$8 = {
4977
+ const name$8 = 'Viewlet';
4978
+ const Commands$9 = {
4973
4979
  addKeyBindings: addKeyBindings,
4974
4980
  appendViewlet: appendViewlet,
4975
4981
  dispose: dispose$d,
@@ -4989,8 +4995,8 @@ const Commands$8 = {
4989
4995
 
4990
4996
  const Viewlet_ipc = {
4991
4997
  __proto__: null,
4992
- Commands: Commands$8,
4993
- name: name$7
4998
+ Commands: Commands$9,
4999
+ name: name$8
4994
5000
  };
4995
5001
 
4996
5002
  const LocalStorage = 1;
@@ -5033,8 +5039,8 @@ const clear$1 = storageType => {
5033
5039
  storage.clear();
5034
5040
  };
5035
5041
 
5036
- const name$6 = 'WebStorage';
5037
- const Commands$7 = {
5042
+ const name$7 = 'WebStorage';
5043
+ const Commands$8 = {
5038
5044
  clear: clear$1,
5039
5045
  getAll: getAll,
5040
5046
  getItem: getItem,
@@ -5044,8 +5050,8 @@ const Commands$7 = {
5044
5050
 
5045
5051
  const WebStorage_ipc = {
5046
5052
  __proto__: null,
5047
- Commands: Commands$7,
5048
- name: name$6
5053
+ Commands: Commands$8,
5054
+ name: name$7
5049
5055
  };
5050
5056
 
5051
5057
  const reload$1 = () => {
@@ -5075,8 +5081,8 @@ const onVisibilityChange = () => {
5075
5081
  document.addEventListener('pointerleave', handlePointerLeave);
5076
5082
  };
5077
5083
 
5078
- const name$5 = 'Window';
5079
- const Commands$6 = {
5084
+ const name$6 = 'Window';
5085
+ const Commands$7 = {
5080
5086
  close: close,
5081
5087
  maximize: maximize,
5082
5088
  minimize: minimize,
@@ -5087,34 +5093,34 @@ const Commands$6 = {
5087
5093
 
5088
5094
  const Window_ipc = {
5089
5095
  __proto__: null,
5090
- Commands: Commands$6,
5091
- name: name$5
5096
+ Commands: Commands$7,
5097
+ name: name$6
5092
5098
  };
5093
5099
 
5094
5100
  const set = title => {
5095
5101
  document.title = title;
5096
5102
  };
5097
5103
 
5098
- const name$4 = 'WindowTitle';
5099
- const Commands$5 = {
5104
+ const name$5 = 'WindowTitle';
5105
+ const Commands$6 = {
5100
5106
  set: set
5101
5107
  };
5102
5108
 
5103
5109
  const WindowTitle_ipc = {
5104
5110
  __proto__: null,
5105
- Commands: Commands$5,
5106
- name: name$4
5111
+ Commands: Commands$6,
5112
+ name: name$5
5107
5113
  };
5108
5114
 
5109
- const name$3 = 'KeyBindings';
5110
- const Commands$4 = {
5115
+ const name$4 = 'KeyBindings';
5116
+ const Commands$5 = {
5111
5117
  setIdentifiers: setIdentifiers
5112
5118
  };
5113
5119
 
5114
5120
  const KeyBindings_ipc = {
5115
5121
  __proto__: null,
5116
- Commands: Commands$4,
5117
- name: name$3
5122
+ Commands: Commands$5,
5123
+ name: name$4
5118
5124
  };
5119
5125
 
5120
5126
  // workaround for not being setPointerCapture() not working on
@@ -5130,16 +5136,16 @@ const unmock = () => {
5130
5136
  Element.prototype.releasePointerCapture = globalThis._originalReleasePointerCapture;
5131
5137
  };
5132
5138
 
5133
- const name$2 = 'PointerCapture';
5134
- const Commands$3 = {
5139
+ const name$3 = 'PointerCapture';
5140
+ const Commands$4 = {
5135
5141
  mock: mock,
5136
5142
  unmock: unmock
5137
5143
  };
5138
5144
 
5139
5145
  const PointerCapture_ipc = {
5140
5146
  __proto__: null,
5141
- Commands: Commands$3,
5142
- name: name$2
5147
+ Commands: Commands$4,
5148
+ name: name$3
5143
5149
  };
5144
5150
 
5145
5151
  const isFile = value => {
@@ -5157,15 +5163,15 @@ const getFilePathElectron = async file => {
5157
5163
  return filePath;
5158
5164
  };
5159
5165
 
5160
- const name$1 = 'GetFilePathElectron';
5161
- const Commands$2 = {
5166
+ const name$2 = 'GetFilePathElectron';
5167
+ const Commands$3 = {
5162
5168
  getFilePathElectron: getFilePathElectron
5163
5169
  };
5164
5170
 
5165
5171
  const GetFilePathElectron_ipc = {
5166
5172
  __proto__: null,
5167
- Commands: Commands$2,
5168
- name: name$1
5173
+ Commands: Commands$3,
5174
+ name: name$2
5169
5175
  };
5170
5176
 
5171
5177
  const MessagePort$1 = 1;
@@ -5722,19 +5728,44 @@ const handleMessagePort = async port => {
5722
5728
  handleIpc(ipc);
5723
5729
  };
5724
5730
 
5725
- const name = 'HandleMessagePort';
5726
- const Commands$1 = {
5731
+ const name$1 = 'HandleMessagePort';
5732
+ const Commands$2 = {
5727
5733
  handleMessagePort: handleMessagePort
5728
5734
  };
5729
5735
 
5730
5736
  const HandleMessagePort_ipc = {
5731
5737
  __proto__: null,
5732
- Commands: Commands$1,
5733
- name
5738
+ Commands: Commands$2,
5739
+ name: name$1
5734
5740
  };
5735
5741
 
5736
- const Message = 'message';
5737
- const Error$1 = 'error';
5742
+ const setIframeCredentialless = ($Iframe, credentialless) => {
5743
+ if (credentialless) {
5744
+ // @ts-ignore
5745
+ $Iframe.credentialless = credentialless;
5746
+ }
5747
+ };
5748
+
5749
+ const setIframeCsp = ($Iframe, csp) => {
5750
+ if (csp) {
5751
+ // @ts-ignore
5752
+ $Iframe.csp = csp;
5753
+ }
5754
+ };
5755
+
5756
+ const setIframeSandBox = ($Iframe, sandbox) => {
5757
+ for (const element of sandbox) {
5758
+ $Iframe.sandbox.add(element);
5759
+ }
5760
+ };
5761
+
5762
+ const setIframeSrc = ($Iframe, src, srcDoc = '') => {
5763
+ if (src) {
5764
+ $Iframe.src = src;
5765
+ } else if (srcDoc) {
5766
+ $Iframe.srcdoc = srcDoc;
5767
+ }
5768
+ };
5738
5769
 
5739
5770
  const withResolvers = () => {
5740
5771
  /**
@@ -5756,6 +5787,69 @@ const withResolvers = () => {
5756
5787
  };
5757
5788
  };
5758
5789
 
5790
+ const waitForFrameToLoad = $Frame => {
5791
+ const {
5792
+ resolve,
5793
+ promise
5794
+ } = withResolvers();
5795
+ $Frame.addEventListener('load', resolve, {
5796
+ once: true
5797
+ });
5798
+ return promise;
5799
+ };
5800
+
5801
+ // TODO could use browser view when running in electron
5802
+ const create$C = async (uid, src, sandbox, csp, credentialless) => {
5803
+ const $Iframe = document.createElement('iframe');
5804
+ setIframeCredentialless($Iframe, credentialless);
5805
+ setIframeCsp($Iframe, csp);
5806
+ setIframeSandBox($Iframe, sandbox);
5807
+ setIframeSrc($Iframe, src);
5808
+ $Iframe.className = 'E2eTestIframe WebViewIframe';
5809
+ set$1(uid, $Iframe);
5810
+ // TODO make make waitForFrameToLoad a separate command
5811
+ };
5812
+ const load = async uid => {
5813
+ const $Iframe = get(uid);
5814
+ const promise = waitForFrameToLoad($Iframe);
5815
+ const parent = document.getElementById('Workbench');
5816
+ parent.append($Iframe);
5817
+ await promise;
5818
+ };
5819
+
5820
+ // TODO rename to sendMessage
5821
+ const setPort$2 = (uid, port, origin) => {
5822
+ const $Iframe = get(uid);
5823
+ // TODO use jsonrpc invoke
5824
+ const {
5825
+ contentWindow
5826
+ } = $Iframe;
5827
+ if (!contentWindow) {
5828
+ throw new Error(`content window not found`);
5829
+ }
5830
+ contentWindow.postMessage({
5831
+ jsonrpc: '2.0',
5832
+ method: 'setPort',
5833
+ params: [port]
5834
+ }, origin, [port]);
5835
+ };
5836
+
5837
+ const name = 'WebView';
5838
+ const Commands$1 = {
5839
+ create: create$C,
5840
+ load: load,
5841
+ setPort: setPort$2
5842
+ };
5843
+
5844
+ const WebView_ipc = {
5845
+ __proto__: null,
5846
+ Commands: Commands$1,
5847
+ name
5848
+ };
5849
+
5850
+ const Message = 'message';
5851
+ const Error$1 = 'error';
5852
+
5759
5853
  const getFirstEvent = (eventTarget, eventMap) => {
5760
5854
  const {
5761
5855
  resolve,
@@ -7051,7 +7145,7 @@ const setDecorationsDom$2 = (state, decorations) => {
7051
7145
  renderInto($LayerDiagnostics, decorations);
7052
7146
  };
7053
7147
 
7054
- const setPosition = (state, scrollBarY, scrollBarHeight) => {
7148
+ const setPosition$1 = (state, scrollBarY, scrollBarHeight) => {
7055
7149
  const {
7056
7150
  $ScrollBarThumbVertical
7057
7151
  } = state;
@@ -7224,7 +7318,7 @@ const setIncrementalEdits$1 = (state, incrementalEdits) => {
7224
7318
  }
7225
7319
  };
7226
7320
  const setScrollBar$1 = (state, scrollBarY, scrollBarHeight) => {
7227
- setPosition(state, scrollBarY, scrollBarHeight);
7321
+ setPosition$1(state, scrollBarY, scrollBarHeight);
7228
7322
  };
7229
7323
  const setScrollBarHorizontal$1 = setScrollBarHorizontal$2;
7230
7324
  const renderGutter$1 = (state, dom) => {
@@ -9442,7 +9536,7 @@ const focus$6 = state => {
9442
9536
  // - for nvda ariaRoleDescription works better
9443
9537
 
9444
9538
  const create$a = () => {
9445
- const $QuickPickInput = create$H();
9539
+ const $QuickPickInput = create$I();
9446
9540
  $QuickPickInput.setAttribute(AriaControls, Ids.QuickPickItems); // TODO use idl once supported
9447
9541
  $QuickPickInput.role = ComboBox;
9448
9542
  $QuickPickInput.ariaLabel = 'Type the name of a command to run.';
@@ -11295,34 +11389,6 @@ const ViewletWebViewEvents = {
11295
11389
  returnValue
11296
11390
  };
11297
11391
 
11298
- const setIframeCredentialless = ($Iframe, credentialless) => {
11299
- if (credentialless) {
11300
- // @ts-ignore
11301
- $Iframe.credentialless = credentialless;
11302
- }
11303
- };
11304
-
11305
- const setIframeCsp = ($Iframe, csp) => {
11306
- if (csp) {
11307
- // @ts-ignore
11308
- $Iframe.csp = csp;
11309
- }
11310
- };
11311
-
11312
- const setIframeSandBox = ($Iframe, sandbox) => {
11313
- for (const element of sandbox) {
11314
- $Iframe.sandbox.add(element);
11315
- }
11316
- };
11317
-
11318
- const setIframeSrc = ($Iframe, src, srcDoc) => {
11319
- if (src) {
11320
- $Iframe.src = src;
11321
- } else if (srcDoc) {
11322
- $Iframe.srcdoc = srcDoc;
11323
- }
11324
- };
11325
-
11326
11392
  // TODO could use browser view when running in electron
11327
11393
  const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '', credentialless = true) => {
11328
11394
  if (!src && !srcDoc) {
@@ -11367,10 +11433,15 @@ const setPort = (state, portId, origin) => {
11367
11433
  once: true
11368
11434
  });
11369
11435
  };
11436
+ const setPosition = (state, id, x, y, width, height) => {
11437
+ const $Iframe = get(id);
11438
+ setBounds$6($Iframe, x, y, width, height);
11439
+ };
11370
11440
 
11371
11441
  const ViewletWebView = {
11372
11442
  __proto__: null,
11373
11443
  Events: ViewletWebViewEvents,
11374
11444
  setIframe,
11375
- setPort
11445
+ setPort,
11446
+ setPosition
11376
11447
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "9.4.1",
3
+ "version": "9.6.0",
4
4
  "description": "",
5
5
  "main": "dist/diffWorkerMain.js",
6
6
  "type": "module",