@lvce-editor/renderer-process 26.2.0 → 28.0.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.
@@ -274,7 +274,7 @@ const enabled = () => {
274
274
  };
275
275
 
276
276
  let id$1 = 0;
277
- const create$N = () => {
277
+ const create$L = () => {
278
278
  return ++id$1;
279
279
  };
280
280
 
@@ -290,7 +290,7 @@ const getFileHandles$1 = async ids => {
290
290
  return handles;
291
291
  };
292
292
  const add$1 = promise => {
293
- const id = create$N();
293
+ const id = create$L();
294
294
  state$9[id] = promise;
295
295
  return id;
296
296
  };
@@ -604,7 +604,7 @@ const Video$2 = 'video';
604
604
  const TextArea$1 = 'textarea';
605
605
  const Select$1 = 'select';
606
606
  const Option$1 = 'option';
607
- const Code$2 = 'code';
607
+ const Code$1 = 'code';
608
608
  const Label$1 = 'label';
609
609
  const Dt$2 = 'dt';
610
610
  const Iframe$1 = 'iframe';
@@ -644,7 +644,7 @@ const Span = 8;
644
644
  const Table = 9;
645
645
  const TBody = 10;
646
646
  const Td = 11;
647
- const Text$3 = 12;
647
+ const Text$2 = 12;
648
648
  const Th = 13;
649
649
  const THead = 14;
650
650
  const Tr$1 = 15;
@@ -684,7 +684,7 @@ const Video$1 = 61;
684
684
  const TextArea = 62;
685
685
  const Select = 63;
686
686
  const Option = 64;
687
- const Code$1 = 65;
687
+ const Code = 65;
688
688
  const Label = 66;
689
689
  const Dt$1 = 67;
690
690
  const Iframe = 68;
@@ -725,7 +725,7 @@ const VirtualDomElements = {
725
725
  Canvas,
726
726
  Circle,
727
727
  Cite,
728
- Code: Code$1,
728
+ Code,
729
729
  Col,
730
730
  ColGroup,
731
731
  Data,
@@ -785,7 +785,7 @@ const VirtualDomElements = {
785
785
  THead,
786
786
  Table,
787
787
  Td,
788
- Text: Text$3,
788
+ Text: Text$2,
789
789
  TextArea,
790
790
  Tfoot,
791
791
  Th,
@@ -808,7 +808,7 @@ const elementTagMap = {
808
808
  [Canvas]: Canvas$1,
809
809
  [Circle]: Circle$1,
810
810
  [Cite]: Cite$1,
811
- [Code$1]: Code$2,
811
+ [Code]: Code$1,
812
812
  [Col]: Col$1,
813
813
  [ColGroup]: ColGroup$1,
814
814
  [Data]: Data$1,
@@ -1169,7 +1169,7 @@ const getKeyCode = key => {
1169
1169
 
1170
1170
  const CtrlCmd = 1 << 11 >>> 0;
1171
1171
  const Shift = 1 << 10 >>> 0;
1172
- const Alt$1 = 1 << 9 >>> 0;
1172
+ const Alt = 1 << 9 >>> 0;
1173
1173
 
1174
1174
  const {
1175
1175
  getElementTag
@@ -1183,7 +1183,7 @@ const set$9 = (viewletId, instance) => {
1183
1183
  instances[viewletId] = instance;
1184
1184
  };
1185
1185
 
1186
- const getEventListenerOptions$1 = (eventName, value) => {
1186
+ const getEventListenerOptions = (eventName, value) => {
1187
1187
  if (value.passive) {
1188
1188
  return {
1189
1189
  passive: true
@@ -1204,18 +1204,18 @@ const getEventListenerOptions$1 = (eventName, value) => {
1204
1204
  }
1205
1205
  };
1206
1206
 
1207
- const cache$1 = new Map();
1207
+ const cache = new Map();
1208
1208
  const has$1 = listener => {
1209
- return cache$1.has(listener);
1209
+ return cache.has(listener);
1210
1210
  };
1211
1211
  const set$8 = (listener, value) => {
1212
- cache$1.set(listener, value);
1212
+ cache.set(listener, value);
1213
1213
  };
1214
1214
  const get$9 = listener => {
1215
- return cache$1.get(listener);
1215
+ return cache.get(listener);
1216
1216
  };
1217
1217
 
1218
- const getWrappedListener$1 = (listener, returnValue) => {
1218
+ const getWrappedListener = (listener, returnValue) => {
1219
1219
  if (!returnValue) {
1220
1220
  return listener;
1221
1221
  }
@@ -1250,7 +1250,7 @@ const getOptions = fn => {
1250
1250
  }
1251
1251
  return undefined;
1252
1252
  };
1253
- const attachEvent$1 = ($Node, eventMap, key, value, newEventMap) => {
1253
+ const attachEvent = ($Node, eventMap, key, value, newEventMap) => {
1254
1254
  const keyLower = key.toLowerCase();
1255
1255
  const listenersByEvent = attachedListeners.get($Node) || new Map();
1256
1256
  const previous = listenersByEvent.get(keyLower);
@@ -1274,8 +1274,8 @@ const attachEvent$1 = ($Node, eventMap, key, value, newEventMap) => {
1274
1274
  console.warn('listener not found', value);
1275
1275
  return;
1276
1276
  }
1277
- const options = getEventListenerOptions$1(key, value);
1278
- const wrapped = getWrappedListener$1(listener, eventMap.returnValue);
1277
+ const options = getEventListenerOptions(key, value);
1278
+ const wrapped = getWrappedListener(listener, eventMap.returnValue);
1279
1279
  $Node.addEventListener(keyLower, wrapped, options);
1280
1280
  listenersByEvent.set(keyLower, {
1281
1281
  listener: wrapped,
@@ -1326,7 +1326,7 @@ const setEventProp = ($Element, key, value, eventMap, newEventMap) => {
1326
1326
  return;
1327
1327
  }
1328
1328
  const eventName = key.slice(2).toLowerCase();
1329
- attachEvent$1($Element, eventMap, eventName, value, newEventMap);
1329
+ attachEvent($Element, eventMap, eventName, value, newEventMap);
1330
1330
  };
1331
1331
  const setProp = ($Element, key, value, eventMap, newEventMap) => {
1332
1332
  const optionalAttributeName = optionalAttributeProps.get(key);
@@ -1394,7 +1394,7 @@ const setProps = ($Element, props, eventMap, newEventMap) => {
1394
1394
  };
1395
1395
 
1396
1396
  const {
1397
- Text: Text$2,
1397
+ Text: Text$1,
1398
1398
  Reference} = VirtualDomElements;
1399
1399
 
1400
1400
  const renderDomTextNode = element => {
@@ -1418,7 +1418,7 @@ const render$1 = (element, eventMap, newEventMap) => {
1418
1418
  switch (element.type) {
1419
1419
  case Reference:
1420
1420
  return renderReferenceNode(element);
1421
- case Text$2:
1421
+ case Text$1:
1422
1422
  return renderDomTextNode(element);
1423
1423
  default:
1424
1424
  return renderDomElement(element, eventMap, newEventMap);
@@ -1491,7 +1491,7 @@ const removeAttribute = ($Element, key) => {
1491
1491
  const attributeName = propertyToAttribute[key] || key;
1492
1492
  $Element.removeAttribute(attributeName);
1493
1493
  };
1494
- const setText$3 = ($Element, value) => {
1494
+ const setText$1 = ($Element, value) => {
1495
1495
  $Element.nodeValue = value;
1496
1496
  };
1497
1497
  const removeChild = ($Element, index) => {
@@ -1635,7 +1635,7 @@ const applyMutationPatch = (state, patch, events) => {
1635
1635
  state.hasAppliedMutation = true;
1636
1636
  break;
1637
1637
  case SetText:
1638
- setText$3(state.current, patch.value);
1638
+ setText$1(state.current, patch.value);
1639
1639
  state.hasAppliedMutation = true;
1640
1640
  break;
1641
1641
  }
@@ -1866,9 +1866,17 @@ const hydrate$4 = () => {
1866
1866
 
1867
1867
  const shouldLaunchMultipleWorkers = true;
1868
1868
 
1869
+ const getConfig = () => {
1870
+ const configElement = document.getElementById('Config');
1871
+ if (!configElement?.textContent) {
1872
+ return {};
1873
+ }
1874
+ return JSON.parse(configElement.textContent);
1875
+ };
1869
1876
  const getInitData = () => {
1870
1877
  const initData = {
1871
1878
  Config: {
1879
+ ...getConfig(),
1872
1880
  shouldLaunchMultipleWorkers: shouldLaunchMultipleWorkers
1873
1881
  },
1874
1882
  Layout: {
@@ -2032,7 +2040,7 @@ const getWorkerDisplayName$1 = name => {
2032
2040
  }
2033
2041
  return `${name} worker`;
2034
2042
  };
2035
- const create$M = async ({
2043
+ const create$K = async ({
2036
2044
  name,
2037
2045
  url
2038
2046
  }) => {
@@ -2099,7 +2107,7 @@ const wrap = worker => {
2099
2107
 
2100
2108
  const IpcParentWithModuleWorker$2 = {
2101
2109
  __proto__: null,
2102
- create: create$M,
2110
+ create: create$K,
2103
2111
  wrap
2104
2112
  };
2105
2113
 
@@ -2107,7 +2115,7 @@ const isMessagePort$1 = value => {
2107
2115
  return value instanceof MessagePort;
2108
2116
  };
2109
2117
 
2110
- const create$L = async ({
2118
+ const create$J = async ({
2111
2119
  url
2112
2120
  }) => {
2113
2121
  string(url);
@@ -2128,10 +2136,10 @@ const create$L = async ({
2128
2136
 
2129
2137
  const IpcParentWithMessagePort$2 = {
2130
2138
  __proto__: null,
2131
- create: create$L
2139
+ create: create$J
2132
2140
  };
2133
2141
 
2134
- const create$K = async url => {
2142
+ const create$I = async url => {
2135
2143
  const referencePort = await new Promise(resolve => {
2136
2144
  globalThis.acceptReferencePort = resolve;
2137
2145
  import(url);
@@ -2142,7 +2150,7 @@ const create$K = async url => {
2142
2150
 
2143
2151
  const IpcParentWithReferencePort = {
2144
2152
  __proto__: null,
2145
- create: create$K
2153
+ create: create$I
2146
2154
  };
2147
2155
 
2148
2156
  const normalizeLine = line => {
@@ -2932,7 +2940,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
2932
2940
  const errorProperty = getErrorProperty(error, prettyError);
2933
2941
  return create$1$1(id, errorProperty);
2934
2942
  };
2935
- const create$J = (message, result) => {
2943
+ const create$H = (message, result) => {
2936
2944
  return {
2937
2945
  id: message.id,
2938
2946
  jsonrpc: Two$1,
@@ -2941,7 +2949,7 @@ const create$J = (message, result) => {
2941
2949
  };
2942
2950
  const getSuccessResponse = (message, result) => {
2943
2951
  const resultProperty = result ?? null;
2944
- return create$J(message, resultProperty);
2952
+ return create$H(message, resultProperty);
2945
2953
  };
2946
2954
  const getErrorResponseSimple = (id, error) => {
2947
2955
  return {
@@ -3035,7 +3043,7 @@ const handleJsonRpcMessage = async (...args) => {
3035
3043
 
3036
3044
  const Two = '2.0';
3037
3045
 
3038
- const create$I = (method, params) => {
3046
+ const create$G = (method, params) => {
3039
3047
  return {
3040
3048
  jsonrpc: Two,
3041
3049
  method,
@@ -3043,7 +3051,7 @@ const create$I = (method, params) => {
3043
3051
  };
3044
3052
  };
3045
3053
 
3046
- const create$H = (id, method, params) => {
3054
+ const create$F = (id, method, params) => {
3047
3055
  const message = {
3048
3056
  id,
3049
3057
  jsonrpc: Two,
@@ -3054,12 +3062,12 @@ const create$H = (id, method, params) => {
3054
3062
  };
3055
3063
 
3056
3064
  let id = 0;
3057
- const create$G = () => {
3065
+ const create$E = () => {
3058
3066
  return ++id;
3059
3067
  };
3060
3068
 
3061
3069
  const registerPromise = map => {
3062
- const id = create$G();
3070
+ const id = create$E();
3063
3071
  const {
3064
3072
  promise,
3065
3073
  resolve
@@ -3076,7 +3084,7 @@ const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer)
3076
3084
  id,
3077
3085
  promise
3078
3086
  } = registerPromise(callbacks);
3079
- const message = create$H(id, method, params);
3087
+ const message = create$F(id, method, params);
3080
3088
  if (useSendAndTransfer && ipc.sendAndTransfer) {
3081
3089
  ipc.sendAndTransfer(message);
3082
3090
  } else {
@@ -3112,7 +3120,7 @@ const createRpc = ipc => {
3112
3120
  * @deprecated
3113
3121
  */
3114
3122
  send(method, ...params) {
3115
- const message = create$I(method, params);
3123
+ const message = create$G(method, params);
3116
3124
  ipc.send(message);
3117
3125
  }
3118
3126
  };
@@ -3151,7 +3159,7 @@ const unhandleIpc = ipc => {
3151
3159
  }
3152
3160
  };
3153
3161
 
3154
- const create$F = async ({
3162
+ const create$D = async ({
3155
3163
  commandMap,
3156
3164
  window
3157
3165
  }) => {
@@ -3163,7 +3171,7 @@ const create$F = async ({
3163
3171
  return rpc;
3164
3172
  };
3165
3173
 
3166
- const create$E = async ({
3174
+ const create$C = async ({
3167
3175
  commandMap,
3168
3176
  isMessagePortOpen = true,
3169
3177
  messagePort
@@ -3185,7 +3193,7 @@ const isWorker = value => {
3185
3193
  return value instanceof Worker;
3186
3194
  };
3187
3195
 
3188
- const create$D = async ({
3196
+ const create$B = async ({
3189
3197
  commandMap,
3190
3198
  name,
3191
3199
  url
@@ -3205,7 +3213,7 @@ const create$D = async ({
3205
3213
  return workerRpc;
3206
3214
  };
3207
3215
 
3208
- const create$C = async ({
3216
+ const create$A = async ({
3209
3217
  commandMap,
3210
3218
  name,
3211
3219
  port,
@@ -3228,23 +3236,23 @@ const create$C = async ({
3228
3236
  return workerRpc;
3229
3237
  };
3230
3238
 
3231
- const create$B = async ({
3239
+ const create$z = async ({
3232
3240
  commandMap,
3233
3241
  messagePort
3234
3242
  }) => {
3235
- return create$E({
3243
+ return create$C({
3236
3244
  commandMap,
3237
3245
  messagePort
3238
3246
  });
3239
3247
  };
3240
3248
 
3241
3249
  // TODO add test
3242
- const create$A = async ({
3250
+ const create$y = async ({
3243
3251
  name,
3244
3252
  port,
3245
3253
  url
3246
3254
  }) => {
3247
- await create$C({
3255
+ await create$A({
3248
3256
  commandMap: {},
3249
3257
  name,
3250
3258
  port,
@@ -3255,7 +3263,7 @@ const create$A = async ({
3255
3263
 
3256
3264
  const IpcParentWithModuleWorkerWithMessagePort = {
3257
3265
  __proto__: null,
3258
- create: create$A
3266
+ create: create$y
3259
3267
  };
3260
3268
 
3261
3269
  const Web = 1;
@@ -3288,7 +3296,7 @@ const platform = getPlatform();
3288
3296
  const isElectron = platform === Electron;
3289
3297
 
3290
3298
  // TODO use handleIncomingIpc function
3291
- const create$z = async ({
3299
+ const create$x = async ({
3292
3300
  ipcId,
3293
3301
  port
3294
3302
  }) => {
@@ -3296,7 +3304,7 @@ const create$z = async ({
3296
3304
  if (!isElectron) {
3297
3305
  throw new Error('Electron api was requested but is not available');
3298
3306
  }
3299
- const rpc = await create$F({
3307
+ const rpc = await create$D({
3300
3308
  commandMap: {},
3301
3309
  window
3302
3310
  });
@@ -3306,7 +3314,7 @@ const create$z = async ({
3306
3314
 
3307
3315
  const IpcParentWithElectron = {
3308
3316
  __proto__: null,
3309
- create: create$z
3317
+ create: create$x
3310
3318
  };
3311
3319
 
3312
3320
  const getModule = method => {
@@ -3346,7 +3354,7 @@ const launchWorker = async ({
3346
3354
  name,
3347
3355
  url
3348
3356
  }) => {
3349
- const rpc = await create$D({
3357
+ const rpc = await create$B({
3350
3358
  commandMap: commandMapRef,
3351
3359
  name,
3352
3360
  url
@@ -3451,7 +3459,7 @@ const RendererWorker = {
3451
3459
  state: state$7
3452
3460
  };
3453
3461
 
3454
- const create$y = async ({
3462
+ const create$w = async ({
3455
3463
  method,
3456
3464
  ...options
3457
3465
  }) => {
@@ -3572,7 +3580,7 @@ const create$Notification = message => {
3572
3580
  $Notification.textContent = message;
3573
3581
  return $Notification;
3574
3582
  };
3575
- const create$x = (type, message) => {
3583
+ const create$v = (type, message) => {
3576
3584
  // TODO this pattern might be also useful for activitybar, sidebar etc., creating elements as late as possible, only when actually needed
3577
3585
  const $Notification = create$Notification(message);
3578
3586
  append$1($Notification);
@@ -3634,7 +3642,7 @@ const set$6 = (canvasId, canvas) => {
3634
3642
  const get$4 = id => {
3635
3643
  return get$5(id);
3636
3644
  };
3637
- const create$w = async (canvasId, objectId) => {
3645
+ const create$u = async (canvasId, objectId) => {
3638
3646
  const canvas = document.createElement('canvas');
3639
3647
  const offscreenCanvas = canvas.transferControlToOffscreen();
3640
3648
  set$6(canvasId, canvas);
@@ -3664,16 +3672,14 @@ const False = 'false';
3664
3672
 
3665
3673
  const Alert = 'alert';
3666
3674
  const Application = 'application';
3667
- const Code = 'code';
3668
3675
  const Complementary = 'complementary';
3669
3676
  const Group = 'group';
3670
3677
  const ListBox = 'listbox';
3671
3678
  const Log = 'log';
3672
3679
  const Menu = 'menu';
3673
- const None$2 = 'none';
3680
+ const None$1 = 'none';
3674
3681
  const Status = 'status';
3675
3682
  const TabList = 'tablist';
3676
- const TextBox = 'textbox';
3677
3683
  const ToolBar = 'toolbar';
3678
3684
 
3679
3685
  const create$BackDrop = () => {
@@ -3689,14 +3695,9 @@ const AriaActiveDescendant = 'aria-activedescendant';
3689
3695
  const AriaSelected = 'aria-selected';
3690
3696
  const AriaHidden = 'aria-hidden';
3691
3697
 
3692
- const BeforeInput = 'beforeinput';
3693
3698
  const Blur = 'blur';
3694
3699
  const Click = 'click';
3695
- const CompositionEnd = 'compositionend';
3696
- const CompositionStart = 'compositionstart';
3697
- const CompositionUpdate = 'compositionupdate';
3698
3700
  const ContextMenu = 'contextmenu';
3699
- const Cut = 'cut';
3700
3701
  const DoubleClick = 'dblclick';
3701
3702
  const Error$2 = 'error';
3702
3703
  const Focus = 'focus';
@@ -3709,7 +3710,6 @@ const MouseDown = 'mousedown';
3709
3710
  const MouseEnter = 'mouseenter';
3710
3711
  const MouseLeave = 'mouseleave';
3711
3712
  const MouseUp = 'mouseup';
3712
- const Paste = 'paste';
3713
3713
  const PointerDown = 'pointerdown';
3714
3714
  const PointerMove = 'pointermove';
3715
3715
  const PointerUp = 'pointerup';
@@ -3762,7 +3762,7 @@ const getElement = () => {
3762
3762
  return state$4.$PreviousFocusElement;
3763
3763
  };
3764
3764
 
3765
- const focus$e = $Element => {
3765
+ const focus$d = $Element => {
3766
3766
  if ($Element === document.activeElement) {
3767
3767
  return;
3768
3768
  }
@@ -3792,10 +3792,6 @@ const setYAndHeight = ($Element, y, height) => {
3792
3792
  $Element.style.translate = typeof y === 'string' ? y : `0 ${y}px`;
3793
3793
  $Element.style.height = typeof height === 'string' ? height : `${height}px`;
3794
3794
  };
3795
- const setXAndWidth = ($Element, x, width) => {
3796
- $Element.style.translate = `${x}px 0`;
3797
- $Element.style.width = `${width}px`;
3798
- };
3799
3795
  const setTop = ($Element, top) => {
3800
3796
  $Element.style.top = `${top}px`;
3801
3797
  };
@@ -3865,7 +3861,7 @@ const getLevel = $Menu => {
3865
3861
  // @ts-expect-error
3866
3862
  return state$3.$$Menus.indexOf($Menu);
3867
3863
  };
3868
- const handleMouseDown$4 = event => {
3864
+ const handleMouseDown$3 = event => {
3869
3865
  const $Target = event.target;
3870
3866
  const $Menu = $Target.closest('.Menu');
3871
3867
  const index = findIndex($Menu, $Target);
@@ -3942,7 +3938,7 @@ const create$Menu$1 = () => {
3942
3938
  $Menu.tabIndex = -1;
3943
3939
  // $ContextMenu.onmousedown = contextMenuHandleMouseDown
3944
3940
  // TODO mousedown vs click? (click is usually better but mousedown is faster, why wait 100ms?)
3945
- $Menu.addEventListener(MouseDown, handleMouseDown$4);
3941
+ $Menu.addEventListener(MouseDown, handleMouseDown$3);
3946
3942
  $Menu.addEventListener(MouseEnter, handleMouseEnter, {
3947
3943
  capture: true
3948
3944
  });
@@ -3954,7 +3950,7 @@ const create$Menu$1 = () => {
3954
3950
  // })
3955
3951
  $Menu.onkeydown = handleKeyDown$5;
3956
3952
  $Menu.addEventListener(FocusOut, handleFocusOut$1);
3957
- $Menu.oncontextmenu = handleContextMenu$8;
3953
+ $Menu.oncontextmenu = handleContextMenu$7;
3958
3954
  // $ContextMenu.onfocus = handleFocus
3959
3955
  // $ContextMenu.onblur = handleBlur
3960
3956
  return $Menu;
@@ -3987,14 +3983,14 @@ const handleBackDropMouseDown = event => {
3987
3983
  state$3.$BackDrop = undefined;
3988
3984
  }
3989
3985
  };
3990
- const handleContextMenu$8 = event => {
3986
+ const handleContextMenu$7 = event => {
3991
3987
  preventDefault(event);
3992
3988
  };
3993
3989
  const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mouseBlocking = false) => {
3994
3990
  if (mouseBlocking) {
3995
3991
  const $BackDrop = create$BackDrop();
3996
3992
  $BackDrop.onmousedown = handleBackDropMouseDown;
3997
- $BackDrop.oncontextmenu = handleContextMenu$8;
3993
+ $BackDrop.oncontextmenu = handleContextMenu$7;
3998
3994
  // @ts-expect-error
3999
3995
  state$3.$BackDrop = $BackDrop;
4000
3996
  append$1($BackDrop);
@@ -4015,7 +4011,7 @@ const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mous
4015
4011
  state$3.$$Menus.push($Menu);
4016
4012
  append$1($Menu);
4017
4013
  if (level === 0) {
4018
- focus$e($Menu);
4014
+ focus$d($Menu);
4019
4015
  send('Focus.setFocus', FocusMenu);
4020
4016
  }
4021
4017
  };
@@ -4856,7 +4852,7 @@ const showError = (message, y, x) => {
4856
4852
  $ImagePreviewImage
4857
4853
  };
4858
4854
  };
4859
- const create$v = (uri, top, left) => {
4855
+ const create$t = (uri, top, left) => {
4860
4856
  const $ImagePreviewImage = document.createElement('img');
4861
4857
  $ImagePreviewImage.className = 'ImagePreviewImage';
4862
4858
  $ImagePreviewImage.src = uri;
@@ -4887,7 +4883,7 @@ const dispose$g = state => {
4887
4883
 
4888
4884
  const ImagePreview$1 = {
4889
4885
  __proto__: null,
4890
- create: create$v,
4886
+ create: create$t,
4891
4887
  dispose: dispose$g,
4892
4888
  showError,
4893
4889
  update
@@ -4911,7 +4907,7 @@ const get$ItemFromEvent = event => {
4911
4907
  }
4912
4908
  return undefined;
4913
4909
  };
4914
- const handleMouseDown$3 = event => {
4910
+ const handleMouseDown$2 = event => {
4915
4911
  const {
4916
4912
  button,
4917
4913
  clientX,
@@ -4926,16 +4922,16 @@ const handleMouseDown$3 = event => {
4926
4922
  const index = getNodeIndex($Item);
4927
4923
  return ['handleClick', button, index, clientX, clientY];
4928
4924
  };
4929
- const handleBlur$9 = () => {
4925
+ const handleBlur$8 = () => {
4930
4926
  return ['handleBlur'];
4931
4927
  };
4932
- const handleFocus$9 = () => {
4928
+ const handleFocus$8 = () => {
4933
4929
  return ['handleFocus'];
4934
4930
  };
4935
4931
 
4936
4932
  // TODO use context menu events function again
4937
4933
 
4938
- const handleContextMenu$7 = event => {
4934
+ const handleContextMenu$6 = event => {
4939
4935
  preventDefault(event);
4940
4936
  const {
4941
4937
  button,
@@ -4948,10 +4944,10 @@ const returnValue$8 = true;
4948
4944
 
4949
4945
  const ViewletActivityBarEvents = {
4950
4946
  __proto__: null,
4951
- handleBlur: handleBlur$9,
4952
- handleContextMenu: handleContextMenu$7,
4953
- handleFocus: handleFocus$9,
4954
- handleMouseDown: handleMouseDown$3,
4947
+ handleBlur: handleBlur$8,
4948
+ handleContextMenu: handleContextMenu$6,
4949
+ handleFocus: handleFocus$8,
4950
+ handleMouseDown: handleMouseDown$2,
4955
4951
  returnValue: returnValue$8
4956
4952
  };
4957
4953
 
@@ -4996,7 +4992,7 @@ forwardViewletCommand('focusPrevious');
4996
4992
  const handleAudioError$1 = forwardViewletCommand('handleAudioError');
4997
4993
  forwardViewletCommand('handleBeforeInput');
4998
4994
  forwardViewletCommand('handleBeforeInputFromContentEditable');
4999
- const handleBlur$8 = forwardViewletCommand('handleBlur');
4995
+ const handleBlur$7 = forwardViewletCommand('handleBlur');
5000
4996
  const handleButtonClick = forwardViewletCommand('handleButtonClick');
5001
4997
  const handleClick$6 = forwardViewletCommand('handleClick');
5002
4998
  const handleClickAction$2 = forwardViewletCommand('handleClickAction');
@@ -5011,7 +5007,7 @@ forwardViewletCommand('handleClickOpenFolder');
5011
5007
  forwardViewletCommand('handleClickRestore');
5012
5008
  const handleClickTab$2 = forwardViewletCommand('handleClickTab');
5013
5009
  forwardViewletCommand('handleClickToggleMaximize');
5014
- const handleContextMenu$6 = forwardViewletCommand('handleContextMenu');
5010
+ const handleContextMenu$5 = forwardViewletCommand('handleContextMenu');
5015
5011
  forwardViewletCommand('handleDoubleClick');
5016
5012
  forwardViewletCommand('handleDragEnd');
5017
5013
  forwardViewletCommand('handleDragLeave');
@@ -5024,7 +5020,7 @@ forwardViewletCommand('handleClickSize');
5024
5020
  forwardViewletCommand('handleClickDisable');
5025
5021
  forwardViewletCommand('handleClickUninstall');
5026
5022
  forwardViewletCommand('handleFilterInput');
5027
- const handleFocus$8 = forwardViewletCommand('handleFocus');
5023
+ const handleFocus$7 = forwardViewletCommand('handleFocus');
5028
5024
  const handleFocusIn$4 = forwardViewletCommand('handleFocusIn');
5029
5025
  forwardViewletCommand('handleIconError');
5030
5026
  const handleImageError = forwardViewletCommand('handleImageError');
@@ -5034,7 +5030,7 @@ forwardViewletCommand('handleListBlur');
5034
5030
  forwardViewletCommand('handleListFocus');
5035
5031
  const handleMenuClick$1 = forwardViewletCommand('handleMenuClick');
5036
5032
  const handleMenuMouseOver$1 = forwardViewletCommand('handleMenuMouseOver');
5037
- const handleMouseDown$2 = forwardViewletCommand('handleMouseDown');
5033
+ const handleMouseDown$1 = forwardViewletCommand('handleMouseDown');
5038
5034
  forwardViewletCommand('handleMouseMove');
5039
5035
  const handleMouseOut$1 = forwardViewletCommand('handleMouseOut');
5040
5036
  const handleMouseOver$1 = forwardViewletCommand('handleMouseOver');
@@ -5068,7 +5064,7 @@ forwardViewletCommand('handleTabsWheel');
5068
5064
  forwardViewletCommand('handleTouchEnd');
5069
5065
  forwardViewletCommand('handleTouchMove');
5070
5066
  forwardViewletCommand('handleTouchStart');
5071
- const handleWheel$4 = forwardViewletCommand('handleWheel');
5067
+ const handleWheel$3 = forwardViewletCommand('handleWheel');
5072
5068
  const hidePanel = forwardViewletCommand('hidePanel');
5073
5069
  forwardViewletCommand('moveRectangleSelectionPx');
5074
5070
  forwardViewletCommand('moveSelectionPx');
@@ -5112,7 +5108,7 @@ const ViewletAudio = {
5112
5108
  Events: Events$4
5113
5109
  };
5114
5110
 
5115
- const create$u = () => {
5111
+ const create$s = () => {
5116
5112
  const $Viewlet = document.createElement('div');
5117
5113
  $Viewlet.className = 'Viewlet Clock';
5118
5114
  return {
@@ -5129,7 +5125,7 @@ const setTime = (state, time) => {
5129
5125
 
5130
5126
  const ViewletClock = {
5131
5127
  __proto__: null,
5132
- create: create$u,
5128
+ create: create$s,
5133
5129
  dispose: dispose$f,
5134
5130
  refresh: refresh$4,
5135
5131
  setTime
@@ -5158,7 +5154,7 @@ const stopTracking$1 = ($Target, pointerId, handlePointerMove, handlePointerUp)
5158
5154
  // TODO use pointerlost event instead
5159
5155
  $Target.removeEventListener(PointerUp, handlePointerUp);
5160
5156
  };
5161
- const create$t = (pointerDown, pointerMove, pointerUp) => {
5157
+ const create$r = (pointerDown, pointerMove, pointerUp) => {
5162
5158
  const shared = (fn, event) => {
5163
5159
  const message = fn(event);
5164
5160
  if (!message || message.length === 0) {
@@ -5191,7 +5187,7 @@ const create$t = (pointerDown, pointerMove, pointerUp) => {
5191
5187
  };
5192
5188
 
5193
5189
  const handleOffset = 20;
5194
- const handleSliderPointerDown = create$t(event => {
5190
+ const handleSliderPointerDown = create$r(event => {
5195
5191
  const {
5196
5192
  clientX,
5197
5193
  clientY
@@ -5262,18 +5258,18 @@ const handleInput$5 = event => {
5262
5258
  } = target;
5263
5259
  handleInput$6(uid, value);
5264
5260
  };
5265
- const handleFocus$7 = event => {
5261
+ const handleFocus$6 = event => {
5266
5262
  const uid = fromEvent(event);
5267
- handleFocus$8(uid);
5263
+ handleFocus$7(uid);
5268
5264
  };
5269
5265
 
5270
5266
  const ViewletDebugConsoleEvents = {
5271
5267
  __proto__: null,
5272
- handleFocus: handleFocus$7,
5268
+ handleFocus: handleFocus$6,
5273
5269
  handleInput: handleInput$5
5274
5270
  };
5275
5271
 
5276
- const create$s = () => {
5272
+ const create$q = () => {
5277
5273
  const $Viewlet = document.createElement('div');
5278
5274
  $Viewlet.className = 'Viewlet DebugConsole';
5279
5275
  return {
@@ -5289,7 +5285,7 @@ const setDom$9 = (state, dom) => {
5289
5285
 
5290
5286
  const ViewletDebugConsole = {
5291
5287
  __proto__: null,
5292
- create: create$s,
5288
+ create: create$q,
5293
5289
  setDom: setDom$9
5294
5290
  };
5295
5291
 
@@ -5306,14 +5302,14 @@ const handleKeyDown$3 = event => {
5306
5302
  } = event;
5307
5303
  handleKeyDown$4(uid, key, altKey, ctrlKey, shiftKey, metaKey);
5308
5304
  };
5309
- const handleBlur$7 = event => {
5305
+ const handleBlur$6 = event => {
5310
5306
  const uid = fromEvent(event);
5311
- handleBlur$8(uid);
5307
+ handleBlur$7(uid);
5312
5308
  };
5313
5309
 
5314
5310
  const ViewletDefineKeyBindingEvents = {
5315
5311
  __proto__: null,
5316
- handleBlur: handleBlur$7,
5312
+ handleBlur: handleBlur$6,
5317
5313
  handleKeyDown: handleKeyDown$3
5318
5314
  };
5319
5315
 
@@ -5326,7 +5322,7 @@ const setValue$2 = (state, value) => {
5326
5322
  const $Input = $Viewlet.querySelector('input');
5327
5323
  $Input.value = value;
5328
5324
  };
5329
- const focus$d = state => {
5325
+ const focus$c = state => {
5330
5326
  const {
5331
5327
  $Viewlet
5332
5328
  } = state;
@@ -5337,7 +5333,7 @@ const focus$d = state => {
5337
5333
  const ViewletDefineKeyBinding = {
5338
5334
  __proto__: null,
5339
5335
  Events: ViewletDefineKeyBindingEvents,
5340
- focus: focus$d,
5336
+ focus: focus$c,
5341
5337
  setValue: setValue$2
5342
5338
  };
5343
5339
 
@@ -5350,17 +5346,17 @@ const setMaskImage = ($Element, icon) => {
5350
5346
  }
5351
5347
  };
5352
5348
 
5353
- const create$r = icon => {
5349
+ const create$p = icon => {
5354
5350
  const $Icon = document.createElement('div');
5355
5351
  $Icon.className = 'MaskIcon';
5356
5352
  setMaskImage($Icon, icon);
5357
- $Icon.role = None$2;
5353
+ $Icon.role = None$1;
5358
5354
  return $Icon;
5359
5355
  };
5360
5356
 
5361
5357
  const create$Button = (label, icon) => {
5362
5358
  // TODO icon div might not be needed (unnecessary html element)
5363
- const $Icon = create$r(icon);
5359
+ const $Icon = create$p(icon);
5364
5360
  const $Button = document.createElement('button');
5365
5361
  $Button.className = 'IconButton';
5366
5362
  $Button.title = label;
@@ -5381,7 +5377,7 @@ const handleClick$4 = event => {
5381
5377
  handleClick$5(index);
5382
5378
  };
5383
5379
 
5384
- const create$q = () => {
5380
+ const create$o = () => {
5385
5381
  const $DialogTitle = document.createElement('h2');
5386
5382
  $DialogTitle.id = 'DialogTitle';
5387
5383
  const $DialogCloseButton = create$Button('Close', 'Close');
@@ -5462,7 +5458,7 @@ const setErrorStack = (state, errorStack) => {
5462
5458
 
5463
5459
  const ViewletDialog = {
5464
5460
  __proto__: null,
5465
- create: create$q,
5461
+ create: create$o,
5466
5462
  postAppend,
5467
5463
  setButtons,
5468
5464
  setCodeFrame,
@@ -5471,13 +5467,13 @@ const ViewletDialog = {
5471
5467
  setHeader
5472
5468
  };
5473
5469
 
5474
- const handleWheel$3 = event => {
5470
+ const handleWheel$2 = event => {
5475
5471
  const {
5476
5472
  deltaMode,
5477
5473
  deltaY
5478
5474
  } = event;
5479
5475
  const uid = fromEvent(event);
5480
- handleWheel$4(uid, deltaMode, deltaY);
5476
+ handleWheel$3(uid, deltaMode, deltaY);
5481
5477
  };
5482
5478
 
5483
5479
  const handleScrollBarPointerDown$2 = event => {
@@ -5487,10 +5483,10 @@ const handleScrollBarPointerDown$2 = event => {
5487
5483
  const ViewletDiffEditorEvents = {
5488
5484
  __proto__: null,
5489
5485
  handleScrollBarPointerDown: handleScrollBarPointerDown$2,
5490
- handleWheel: handleWheel$3
5486
+ handleWheel: handleWheel$2
5491
5487
  };
5492
5488
 
5493
- const setScrollBar$2 = (state, scrollBarY, scrollBarHeight, scrollBarThumbClass) => {
5489
+ const setScrollBar = (state, scrollBarY, scrollBarHeight, scrollBarThumbClass) => {
5494
5490
  const {
5495
5491
  $ScrollBarThumb
5496
5492
  } = state;
@@ -5503,7 +5499,7 @@ const setScrollBar$2 = (state, scrollBarY, scrollBarHeight, scrollBarThumbClass)
5503
5499
  const ViewletDiffEditor = {
5504
5500
  __proto__: null,
5505
5501
  Events: ViewletDiffEditorEvents,
5506
- setScrollBar: setScrollBar$2
5502
+ setScrollBar
5507
5503
  };
5508
5504
 
5509
5505
  const handleClickAt$2 = event => {
@@ -5516,7 +5512,7 @@ const handleClickAt$2 = event => {
5516
5512
  const handleLoad$3 = event => {
5517
5513
  return ['handleLoad'];
5518
5514
  };
5519
- const handleContextMenu$5 = event => {
5515
+ const handleContextMenu$4 = event => {
5520
5516
  preventDefault(event);
5521
5517
  const {
5522
5518
  button,
@@ -5525,7 +5521,7 @@ const handleContextMenu$5 = event => {
5525
5521
  } = event;
5526
5522
  return ['handleContextMenu', button, clientX, clientY];
5527
5523
  };
5528
- const handleSashCornerPointerDown = create$t(event => {
5524
+ const handleSashCornerPointerDown = create$r(event => {
5529
5525
  const {
5530
5526
  clientX,
5531
5527
  clientY
@@ -5549,14 +5545,14 @@ const returnValue$6 = true;
5549
5545
  const ViewletE2eTestEvents = {
5550
5546
  __proto__: null,
5551
5547
  handleClickAt: handleClickAt$2,
5552
- handleContextMenu: handleContextMenu$5,
5548
+ handleContextMenu: handleContextMenu$4,
5553
5549
  handleLoad: handleLoad$3,
5554
5550
  handleSashCornerPointerDown,
5555
5551
  returnValue: returnValue$6
5556
5552
  };
5557
5553
 
5558
5554
  // TODO could use browser view when running in electron
5559
- const setIframe$2 = (state, src, sandbox = []) => {
5555
+ const setIframe$3 = (state, src, sandbox = []) => {
5560
5556
  if (!src) {
5561
5557
  return;
5562
5558
  }
@@ -5599,7 +5595,7 @@ const setPreviewTransform = (state, transform) => {
5599
5595
  const ViewletE2eTest = {
5600
5596
  __proto__: null,
5601
5597
  Events: ViewletE2eTestEvents,
5602
- setIframe: setIframe$2,
5598
+ setIframe: setIframe$3,
5603
5599
  setPreviewTransform
5604
5600
  };
5605
5601
 
@@ -5613,7 +5609,7 @@ const handleClickAt$1 = event => {
5613
5609
  const handleLoad$2 = event => {
5614
5610
  return ['handleLoad'];
5615
5611
  };
5616
- const handleContextMenu$4 = event => {
5612
+ const handleContextMenu$3 = event => {
5617
5613
  preventDefault(event);
5618
5614
  const {
5619
5615
  button,
@@ -5627,7 +5623,7 @@ const returnValue$5 = true;
5627
5623
  const ViewletE2eTestsEvents = {
5628
5624
  __proto__: null,
5629
5625
  handleClickAt: handleClickAt$1,
5630
- handleContextMenu: handleContextMenu$4,
5626
+ handleContextMenu: handleContextMenu$3,
5631
5627
  handleLoad: handleLoad$2,
5632
5628
  returnValue: returnValue$5
5633
5629
  };
@@ -5647,7 +5643,7 @@ const handleLoad$1 = event => {
5647
5643
  console.log(event.target.src);
5648
5644
  send('E2eTests.handleLoad');
5649
5645
  };
5650
- const setIframe$1 = (state, src, sandbox = []) => {
5646
+ const setIframe$2 = (state, src, sandbox = []) => {
5651
5647
  if (!src) {
5652
5648
  return;
5653
5649
  }
@@ -5688,7 +5684,7 @@ const setPort$2 = (state, portId, origin) => {
5688
5684
  const ViewletE2eTests = {
5689
5685
  __proto__: null,
5690
5686
  Events: ViewletE2eTestsEvents,
5691
- setIframe: setIframe$1,
5687
+ setIframe: setIframe$2,
5692
5688
  setPort: setPort$2
5693
5689
  };
5694
5690
 
@@ -5699,15 +5695,15 @@ const handleFocusIn$3 = event => {
5699
5695
  const uid = fromEvent(event);
5700
5696
  handleFocusIn$4(uid);
5701
5697
  };
5702
- const handleBlur$6 = event => {
5698
+ const handleBlur$5 = event => {
5703
5699
  preventDefault(event);
5704
5700
  const uid = fromEvent(event);
5705
- handleBlur$8(uid);
5701
+ handleBlur$7(uid);
5706
5702
  };
5707
5703
 
5708
5704
  const ViewletEditorCodeGeneratorEvents = {
5709
5705
  __proto__: null,
5710
- handleBlur: handleBlur$6,
5706
+ handleBlur: handleBlur$5,
5711
5707
  handleFocusIn: handleFocusIn$3
5712
5708
  };
5713
5709
 
@@ -5727,7 +5723,7 @@ const appendWidget$5 = state => {
5727
5723
  const dispose$e = state => {
5728
5724
  remove$1(state.$Viewlet);
5729
5725
  };
5730
- const focus$c = (state, key, source) => {
5726
+ const focus$b = (state, key, source) => {
5731
5727
  if (!key) {
5732
5728
  return;
5733
5729
  }
@@ -5751,7 +5747,7 @@ const ViewletEditorCodeGenerator = {
5751
5747
  Events: ViewletEditorCodeGeneratorEvents,
5752
5748
  appendWidget: appendWidget$5,
5753
5749
  dispose: dispose$e,
5754
- focus: focus$c,
5750
+ focus: focus$b,
5755
5751
  setBounds: setBounds$9
5756
5752
  };
5757
5753
 
@@ -5812,7 +5808,7 @@ const handleScrollBarPointerDown$1 = event => {
5812
5808
  const uid = fromEvent(event);
5813
5809
  handleScrollBarClick(uid, clientY);
5814
5810
  };
5815
- const handleWheel$2 = event => {
5811
+ const handleWheel$1 = event => {
5816
5812
  const {
5817
5813
  deltaMode,
5818
5814
  deltaY
@@ -5825,7 +5821,7 @@ const Small$1 = 1;
5825
5821
  const Normal$1 = 2;
5826
5822
  const Large$1 = 3;
5827
5823
 
5828
- const None$1 = '';
5824
+ const None = '';
5829
5825
  const Small = 'Small';
5830
5826
  const Normal = 'Normal';
5831
5827
  const Large = 'Large';
@@ -5839,7 +5835,7 @@ const getClassName = size => {
5839
5835
  case Small$1:
5840
5836
  return Small;
5841
5837
  default:
5842
- return None$1;
5838
+ return None;
5843
5839
  }
5844
5840
  };
5845
5841
 
@@ -5868,7 +5864,7 @@ const setNegativeMargin = (state, negativeMargin) => {
5868
5864
  setTop($ListItems, negativeMargin);
5869
5865
  };
5870
5866
 
5871
- const create$p = () => {
5867
+ const create$n = () => {
5872
5868
  const $ListItems = document.createElement('div');
5873
5869
  $ListItems.className = 'ListItems';
5874
5870
  $ListItems.role = ListBox;
@@ -5898,7 +5894,7 @@ const attachEvents$5 = state => {
5898
5894
  $ScrollBar,
5899
5895
  $Viewlet
5900
5896
  } = state;
5901
- $Viewlet.addEventListener(Wheel, handleWheel$2, Passive);
5897
+ $Viewlet.addEventListener(Wheel, handleWheel$1, Passive);
5902
5898
  attachEvents$6($ListItems, {
5903
5899
  [MouseDown]: handleMousedown
5904
5900
  });
@@ -5935,7 +5931,7 @@ const showLoading = (state, x, y) => {
5935
5931
  $Viewlet.append($Loading);
5936
5932
  append$1($Viewlet);
5937
5933
  };
5938
- const handleError$6 = (state, error) => {
5934
+ const handleError$5 = (state, error) => {
5939
5935
  const {
5940
5936
  $Viewlet
5941
5937
  } = state;
@@ -5952,14 +5948,14 @@ const setBounds$8 = (state, x, y, width, height) => {
5952
5948
  const ViewletEditorCompletion = {
5953
5949
  __proto__: null,
5954
5950
  attachEvents: attachEvents$5,
5955
- create: create$p,
5951
+ create: create$n,
5956
5952
  dispose: dispose$d,
5957
- handleError: handleError$6,
5953
+ handleError: handleError$5,
5958
5954
  setBounds: setBounds$8,
5959
5955
  setContentHeight,
5960
5956
  setDom: setDom$8,
5961
5957
  setNegativeMargin,
5962
- setScrollBar: setScrollBar$2,
5958
+ setScrollBar,
5963
5959
  setSize,
5964
5960
  showLoading
5965
5961
  };
@@ -5975,7 +5971,7 @@ const ViewletEditorCompletionDetailsEvents = {
5975
5971
  returnValue: returnValue$4
5976
5972
  };
5977
5973
 
5978
- const create$o = () => {
5974
+ const create$m = () => {
5979
5975
  const $Viewlet = document.createElement('div');
5980
5976
  $Viewlet.className = 'Viewlet EditorCompletionDetails';
5981
5977
  $Viewlet.id = 'CompletionsDetails';
@@ -6016,7 +6012,7 @@ const ViewletEditorCompletionDetails = {
6016
6012
  Events: ViewletEditorCompletionDetailsEvents,
6017
6013
  appendWidget: appendWidget$4,
6018
6014
  attachEvents: attachEvents$4,
6019
- create: create$o,
6015
+ create: create$m,
6020
6016
  dispose: dispose$c,
6021
6017
  setBounds: setBounds$7,
6022
6018
  setDom: setDom$7
@@ -6035,7 +6031,7 @@ const ViewletEditorCompletionDetails = {
6035
6031
 
6036
6032
  // TODO aria alert
6037
6033
 
6038
- const create$n = () => {
6034
+ const create$l = () => {
6039
6035
  const $Viewlet = document.createElement('div');
6040
6036
  $Viewlet.className = 'Viewlet EditorError';
6041
6037
  return {
@@ -6057,13 +6053,13 @@ const setBounds$6 = (state, x, y, width, height) => {
6057
6053
 
6058
6054
  const ViewletEditorError = {
6059
6055
  __proto__: null,
6060
- create: create$n,
6056
+ create: create$l,
6061
6057
  setBounds: setBounds$6,
6062
6058
  setDom: setDom$6
6063
6059
  };
6064
6060
 
6065
6061
  const returnValue$3 = true;
6066
- const handleSashPointerDown$2 = create$t(event => {
6062
+ const handleSashPointerDown$2 = create$r(event => {
6067
6063
  const {
6068
6064
  clientX,
6069
6065
  clientY
@@ -6118,7 +6114,6 @@ const ViewletEditorHover = {
6118
6114
  };
6119
6115
 
6120
6116
  const LeftClick = 0;
6121
- const RightClick = 2;
6122
6117
 
6123
6118
  /**
6124
6119
  * @param {PointerEvent} event
@@ -6182,7 +6177,7 @@ const handlePointerDown$1 = event => {
6182
6177
  /**
6183
6178
  * @param {WheelEvent} event
6184
6179
  */
6185
- const handleWheel$1 = event => {
6180
+ const handleWheel = event => {
6186
6181
  const {
6187
6182
  clientX,
6188
6183
  clientY,
@@ -6190,14 +6185,14 @@ const handleWheel$1 = event => {
6190
6185
  deltaY
6191
6186
  } = event;
6192
6187
  const uid = fromEvent(event);
6193
- handleWheel$4(uid, clientX, clientY, deltaX, deltaY);
6188
+ handleWheel$3(uid, clientX, clientY, deltaX, deltaY);
6194
6189
  };
6195
6190
 
6196
6191
  /**
6197
6192
  *
6198
6193
  * @param {MouseEvent} event
6199
6194
  */
6200
- const handleContextMenu$3 = event => {
6195
+ const handleContextMenu$2 = event => {
6201
6196
  preventDefault(event);
6202
6197
  const {
6203
6198
  button,
@@ -6205,18 +6200,18 @@ const handleContextMenu$3 = event => {
6205
6200
  clientY
6206
6201
  } = event;
6207
6202
  const uid = fromEvent(event);
6208
- handleContextMenu$6(uid, button, clientX, clientY);
6203
+ handleContextMenu$5(uid, button, clientX, clientY);
6209
6204
  };
6210
- const handleError$5 = event => {
6205
+ const handleError$4 = event => {
6211
6206
  const uid = fromEvent(event);
6212
6207
  handleImageError(uid);
6213
6208
  };
6214
- const handleFocus$6 = event => {
6209
+ const handleFocus$5 = event => {
6215
6210
  const uid = fromEvent(event);
6216
- handleFocus$8(uid);
6211
+ handleFocus$7(uid);
6217
6212
  };
6218
6213
 
6219
- const create$m = () => {
6214
+ const create$k = () => {
6220
6215
  const $Viewlet = document.createElement('div');
6221
6216
  $Viewlet.className = 'Viewlet EditorImage';
6222
6217
  return {
@@ -6228,13 +6223,13 @@ const attachEvents$3 = state => {
6228
6223
  $Viewlet
6229
6224
  } = state;
6230
6225
  attachEvents$6($Viewlet, {
6231
- [ContextMenu]: handleContextMenu$3,
6232
- [FocusIn]: handleFocus$6,
6226
+ [ContextMenu]: handleContextMenu$2,
6227
+ [FocusIn]: handleFocus$5,
6233
6228
  [PointerDown]: handlePointerDown$1,
6234
6229
  [PointerUp]: handlePointerUp
6235
6230
  });
6236
- $Viewlet.addEventListener(Error$2, handleError$5, Capture);
6237
- $Viewlet.addEventListener(Wheel, handleWheel$1, Passive);
6231
+ $Viewlet.addEventListener(Error$2, handleError$4, Capture);
6232
+ $Viewlet.addEventListener(Wheel, handleWheel, Passive);
6238
6233
  };
6239
6234
  const setTransform = (state, transform) => {
6240
6235
  const {
@@ -6259,13 +6254,13 @@ const setDom$4 = (state, dom) => {
6259
6254
  const ViewletEditorImage = {
6260
6255
  __proto__: null,
6261
6256
  attachEvents: attachEvents$3,
6262
- create: create$m,
6257
+ create: create$k,
6263
6258
  setDom: setDom$4,
6264
6259
  setDragging,
6265
6260
  setTransform
6266
6261
  };
6267
6262
 
6268
- const create$l = () => {
6263
+ const create$j = () => {
6269
6264
  const $Viewlet = document.createElement('div');
6270
6265
  $Viewlet.className = 'Viewlet EditorText';
6271
6266
  $Viewlet.textContent = 'loading...';
@@ -6282,7 +6277,7 @@ const refresh$3 = (state, context) => {
6282
6277
 
6283
6278
  const ViewletEditorPlainText = {
6284
6279
  __proto__: null,
6285
- create: create$l,
6280
+ create: create$j,
6286
6281
  dispose: dispose$b,
6287
6282
  refresh: refresh$3
6288
6283
  };
@@ -6323,584 +6318,6 @@ const ViewletEditorSourceActions = {
6323
6318
  setBounds: setBounds$4
6324
6319
  };
6325
6320
 
6326
- const List = 'list';
6327
-
6328
- const Editor = 'editor';
6329
- const SideBar$1 = 'Side Bar';
6330
- const StatusBar$1 = 'Status Bar';
6331
-
6332
- const getEventListenerOptions = eventName => {
6333
- switch (eventName) {
6334
- case Wheel:
6335
- return {
6336
- passive: true
6337
- };
6338
- default:
6339
- return undefined;
6340
- }
6341
- };
6342
-
6343
- const cache = new Map();
6344
- const getWrappedListener = (listener, returnValue) => {
6345
- if (!returnValue) {
6346
- return listener;
6347
- }
6348
- if (!cache.has(listener)) {
6349
- const wrapped = event => {
6350
- const uid = fromEvent(event);
6351
- const result = listener(event);
6352
- // TODO check for empty array by value
6353
- if (result.length === 0) {
6354
- return;
6355
- }
6356
- send('Viewlet.executeViewletCommand', uid, ...result);
6357
- };
6358
- nameAnonymousFunction(wrapped, listener.name);
6359
- cache.set(listener, wrapped);
6360
- }
6361
- return cache.get(listener);
6362
- };
6363
-
6364
- const attachEvent = ($Node, eventMap, key, value) => {
6365
- const listener = eventMap[value];
6366
- if (!listener) {
6367
- console.warn('listener not found', value);
6368
- return;
6369
- }
6370
- const options = getEventListenerOptions(key);
6371
- const wrapped = getWrappedListener(listener, eventMap.returnValue);
6372
- $Node.addEventListener(key, wrapped, options);
6373
- };
6374
-
6375
- const attachEventsFunctional = ($Node, eventMap) => {
6376
- for (const [key] of Object.entries(eventMap)) {
6377
- if (key === 'returnValue') {
6378
- continue;
6379
- }
6380
- attachEvent($Node, eventMap, key, key);
6381
- }
6382
- };
6383
-
6384
- const Text$1 = 'text';
6385
-
6386
- const getText = clipBoardData => {
6387
- return clipBoardData.getData(Text$1);
6388
- };
6389
-
6390
- const detachEvent = ($Node, key, listener) => {
6391
- const wrapped = getWrappedListener(listener, true);
6392
- $Node.removeEventListener(key, wrapped);
6393
- };
6394
-
6395
- const None = 0;
6396
- const Ctrl = 1;
6397
- const Alt = 2;
6398
-
6399
- const getModifierKey = event => {
6400
- if (event.ctrlKey) {
6401
- return Ctrl;
6402
- }
6403
- if (event.altKey) {
6404
- return Alt;
6405
- }
6406
- return None;
6407
- };
6408
-
6409
- // TODO so many things in this file
6410
-
6411
-
6412
- // TODO go back to edit mode after pressing escape so screenreaders can navigate https://stackoverflow.com/questions/53909477/how-to-handle-tabbing-for-accessibility-with-a-textarea-that-uses-the-tab-button
6413
-
6414
- // TODO tree shake out mobile support when targeting electron -> less code -> less event listeners -> less memory -> less cpu
6415
-
6416
- const handleFocus$5 = event => {
6417
- return ['handleFocus'];
6418
- };
6419
- const handleMouseMove = event => {
6420
- const {
6421
- altKey,
6422
- clientX,
6423
- clientY
6424
- } = event;
6425
- return ['handleMouseMove', clientX, clientY, altKey];
6426
- };
6427
- const handleBlur$5 = event => {
6428
- // needed for save on blur
6429
- // also needed to close completions on blur
6430
- return ['handleBlur'];
6431
- };
6432
-
6433
- /**
6434
- *
6435
- * @param {InputEvent} event
6436
- */
6437
- const handleBeforeInput = event => {
6438
- preventDefault(event);
6439
- const {
6440
- data,
6441
- inputType
6442
- } = event;
6443
- return ['handleBeforeInput', inputType, data];
6444
- };
6445
-
6446
- // TODO composition should be better supported,
6447
- // for example
6448
- // - gedit draws a line below the composed text
6449
- // - codemirror 6 also draws that line
6450
- // - codemirror 5 also draws that line
6451
- // - vscode does not draw a line, but displays characters during composition
6452
-
6453
- const handleCompositionStart = event => {
6454
- const {
6455
- data
6456
- } = event;
6457
- return ['compositionStart', data];
6458
- };
6459
- const handleCompositionUpdate = event => {
6460
- const {
6461
- data
6462
- } = event;
6463
- return ['compositionUpdate', data];
6464
- };
6465
- const handleCompositionEnd = event => {
6466
- const {
6467
- data
6468
- } = event;
6469
- return ['compositionEnd', data];
6470
- };
6471
- const handleCut = event => {
6472
- preventDefault(event);
6473
- return ['cut'];
6474
- };
6475
- const isRightClick = event => {
6476
- return event.button === RightClick;
6477
- };
6478
- const handleEditorPointerMove = event => {
6479
- const {
6480
- altKey,
6481
- clientX,
6482
- clientY
6483
- } = event;
6484
- // TODO if/else should be in renderer worker
6485
- if (altKey) {
6486
- return ['moveRectangleSelectionPx', clientX, clientY];
6487
- }
6488
- return ['moveSelectionPx', clientX, clientY];
6489
- };
6490
- const handleEditorLostPointerCapture = event => {
6491
- const {
6492
- target
6493
- } = event;
6494
- detachEvent(target, PointerMove, handleEditorPointerMove);
6495
- detachEvent(target, LostPointerCapture, handleEditorLostPointerCapture);
6496
- return ['handlePointerCaptureLost'];
6497
- };
6498
-
6499
- /**
6500
- *
6501
- * @param {PointerEvent} event
6502
- */
6503
- const handleEditorPointerDown = event => {
6504
- const {
6505
- pointerId,
6506
- target
6507
- } = event;
6508
- target.setPointerCapture(pointerId);
6509
- attachEventsFunctional(target, {
6510
- [LostPointerCapture]: handleEditorLostPointerCapture,
6511
- [PointerMove]: handleEditorPointerMove,
6512
- returnValue: true
6513
- });
6514
- return [];
6515
- };
6516
- const handleMouseDown$1 = event => {
6517
- if (isRightClick(event)) {
6518
- return [];
6519
- }
6520
- preventDefault(event);
6521
- const {
6522
- clientX,
6523
- clientY,
6524
- detail
6525
- } = event;
6526
- const modifier = getModifierKey(event);
6527
- return ['handleMouseDown', modifier, clientX, clientY, detail];
6528
- };
6529
-
6530
- // TODO figure out whether it is possible to register hover provider without mousemove
6531
- // mousemove handler is called very often and could slow down editor / drain battery
6532
-
6533
- /**
6534
- *
6535
- * @param {WheelEvent} event
6536
- */
6537
- const handleWheel = event => {
6538
- const {
6539
- deltaMode,
6540
- deltaX,
6541
- deltaY
6542
- } = event;
6543
- // event.preventDefault()
6544
- // const state = EditorHelper.getStateFromEvent(event)
6545
- // TODO send editor id
6546
- return ['setDelta', deltaMode, deltaX, deltaY];
6547
- };
6548
- const handlePaste = event => {
6549
- preventDefault(event);
6550
- const {
6551
- clipboardData
6552
- } = event;
6553
- const text = getText(clipboardData);
6554
- return ['paste', text];
6555
- };
6556
- const handleScrollBarVerticalPointerDown = create$t(event => {
6557
- const {
6558
- clientY
6559
- } = event;
6560
- return ['handleScrollBarVerticalPointerDown', clientY];
6561
- }, event => {
6562
- const {
6563
- clientY
6564
- } = event;
6565
- return ['handleScrollBarVerticalMove', clientY];
6566
- }, () => {
6567
- return [];
6568
- });
6569
-
6570
- /**
6571
- *
6572
- * @param {PointerEvent} event
6573
- */
6574
- const handleScrollBarThumbHorizontalPointerMove = event => {
6575
- const {
6576
- clientX
6577
- } = event;
6578
- return ['handleScrollBarHorizontalMove', clientX];
6579
- };
6580
-
6581
- /**
6582
- *
6583
- * @param {PointerEvent} event
6584
- */
6585
- const handleScrollBarHorizontalPointerUp = event => {
6586
- const {
6587
- pointerId,
6588
- target
6589
- } = event;
6590
- stopTracking(target, pointerId, handleScrollBarThumbHorizontalPointerMove, handleScrollBarHorizontalPointerUp);
6591
- return [];
6592
- };
6593
-
6594
- /**
6595
- *
6596
- * @param {PointerEvent} event
6597
- */
6598
- const handleScrollBarHorizontalPointerDown = event => {
6599
- const {
6600
- clientX,
6601
- pointerId,
6602
- target
6603
- } = event;
6604
- startTracking(target, pointerId, handleScrollBarThumbHorizontalPointerMove, handleScrollBarHorizontalPointerUp);
6605
- return ['handleScrollBarHorizontalPointerDown', clientX];
6606
- };
6607
- const handleScrollBarContextMenu = event => {
6608
- preventDefault(event);
6609
- stopPropagation(event);
6610
- };
6611
- const handleContextMenu$2 = event => {
6612
- preventDefault(event);
6613
- const {
6614
- button,
6615
- clientX,
6616
- clientY
6617
- } = event;
6618
- return ['handleContextMenu', button, clientX, clientY];
6619
- };
6620
-
6621
- const setCursors = (state, dom) => {
6622
- object(state);
6623
- array(dom);
6624
- const {
6625
- $LayerCursor
6626
- } = state;
6627
- renderInto($LayerCursor, dom);
6628
- };
6629
-
6630
- const setDecorationsDom$2 = (state, decorations) => {
6631
- const {
6632
- $LayerDiagnostics
6633
- } = state;
6634
- renderInto($LayerDiagnostics, decorations);
6635
- };
6636
-
6637
- const setPosition$1 = (state, scrollBarY, scrollBarHeight) => {
6638
- const {
6639
- $ScrollBarThumbVertical
6640
- } = state;
6641
- $ScrollBarThumbVertical.style.translate = scrollBarY;
6642
- $ScrollBarThumbVertical.style.height = scrollBarHeight;
6643
- };
6644
- const setScrollBarHorizontal$2 = (state, scrollBarX, scrollBarWidth, deltaX) => {
6645
- const {
6646
- $ScrollBarThumbHorizontal
6647
- } = state;
6648
- setXAndWidth($ScrollBarThumbHorizontal, scrollBarX, scrollBarWidth);
6649
- };
6650
-
6651
- const setSelections$2 = (state, dom) => {
6652
- const {
6653
- $LayerSelections
6654
- } = state;
6655
- renderInto($LayerSelections, dom);
6656
- };
6657
-
6658
- const setLineInfos = (state, dom) => {
6659
- object(state);
6660
- array(dom);
6661
- const {
6662
- $LayerText
6663
- } = state;
6664
- renderInto($LayerText, dom);
6665
- };
6666
-
6667
- // TODO so many things in this file
6668
-
6669
-
6670
- // TODO go back to edit mode after pressing escape so screenreaders can navigate https://stackoverflow.com/questions/53909477/how-to-handle-tabbing-for-accessibility-with-a-textarea-that-uses-the-tab-button
6671
-
6672
- // TODO tree shake out mobile support when targeting electron -> less code -> less event listeners -> less memory -> less cpu
6673
-
6674
- // TODO all create functions should have no arguments
6675
- // and be split into two parts
6676
- // 1. create -> only create dom elements
6677
- // 2. render -> fill elements with attributes and data
6678
- // that way all dom nodes can be recycled
6679
- const create$k = () => {
6680
- const $EditorInput = document.createElement('textarea');
6681
- $EditorInput.className = 'EditorInput';
6682
- $EditorInput.ariaAutoComplete = List;
6683
- $EditorInput.ariaRoleDescription = Editor;
6684
- $EditorInput.ariaMultiLine = True;
6685
- $EditorInput.setAttribute('autocomplete', 'off');
6686
- $EditorInput.setAttribute('autocapitalize', 'off');
6687
- $EditorInput.setAttribute('autocorrect', 'off');
6688
- $EditorInput.setAttribute('wrap', 'off');
6689
- $EditorInput.setAttribute('spellcheck', False);
6690
- $EditorInput.role = TextBox;
6691
- // TODO where to best put listeners (side effects)
6692
- attachEventsFunctional($EditorInput, {
6693
- [BeforeInput]: handleBeforeInput,
6694
- [Blur]: handleBlur$5,
6695
- [CompositionEnd]: handleCompositionEnd,
6696
- [CompositionStart]: handleCompositionStart,
6697
- [CompositionUpdate]: handleCompositionUpdate,
6698
- [Cut]: handleCut,
6699
- [Focus]: handleFocus$5,
6700
- [Paste]: handlePaste,
6701
- returnValue: true
6702
- });
6703
- $EditorInput.name = 'editor';
6704
- const $LayerCursor = document.createElement('div');
6705
- $LayerCursor.className = 'LayerCursor';
6706
- const $LayerText = document.createElement('div');
6707
- $LayerText.className = 'EditorRows';
6708
- const $LayerGutter = document.createElement('div');
6709
- $LayerGutter.className = 'Gutter';
6710
- attachEventsFunctional($LayerText, {
6711
- [MouseDown]: handleMouseDown$1,
6712
- [PointerDown]: handleEditorPointerDown,
6713
- returnValue: true
6714
- });
6715
- const $ScrollBarThumbVertical = document.createElement('div');
6716
- $ScrollBarThumbVertical.className = 'ScrollBarThumb ScrollBarThumbVertical';
6717
-
6718
- // TODO only create $ScrollBarDiagnostics lazily when there are actually diagnostics
6719
- const $ScrollBarDiagnostics = document.createElement('div');
6720
- $ScrollBarDiagnostics.className = 'EditorScrollBarDiagnostics';
6721
- const $ScrollBarVertical = document.createElement('div');
6722
- $ScrollBarVertical.className = 'ScrollBar ScrollBarVertical';
6723
- attachEventsFunctional($ScrollBarVertical, {
6724
- [ContextMenu]: handleScrollBarContextMenu,
6725
- [PointerDown]: handleScrollBarVerticalPointerDown,
6726
- returnValue: true
6727
- });
6728
- $ScrollBarVertical.append($ScrollBarThumbVertical);
6729
- const $ScrollBarThumbHorizontal = document.createElement('div');
6730
- $ScrollBarThumbHorizontal.className = 'ScrollBarThumb ScrollBarThumbHorizontal';
6731
- const $ScrollBarHorizontal = document.createElement('div');
6732
- $ScrollBarHorizontal.className = 'ScrollBar ScrollBarHorizontal';
6733
- $ScrollBarHorizontal.append($ScrollBarThumbHorizontal);
6734
- attachEventsFunctional($ScrollBarHorizontal, {
6735
- [PointerDown]: handleScrollBarHorizontalPointerDown,
6736
- returnValue: true
6737
- });
6738
-
6739
- // $EditorRows.addEventListener('mousemove', handleMouseMove, { passive: true })
6740
-
6741
- // TODO function should be hoisted (maybe -> one listener for all editors (definitely))
6742
- // only problem is $EditorInput closure
6743
-
6744
- // TODO when mousedown on completions -> this shouldn't be called
6745
-
6746
- const $LayerSelections = document.createElement('div');
6747
- $LayerSelections.className = 'Selections';
6748
-
6749
- // TODO maybe use css grid to position layers on top of each other
6750
- // TODO maybe merge layerDiagnostics with LayerSelections
6751
- // TODO maybe this should be more generic, e.g. LayerDecorations
6752
- // where decoration = {top,left, width, height, type/className}
6753
- const $LayerDiagnostics = document.createElement('div');
6754
- $LayerDiagnostics.className = 'LayerDiagnostics';
6755
- const $EditorLayers = document.createElement('div');
6756
- $EditorLayers.className = 'EditorLayers';
6757
- $EditorLayers.append($LayerSelections, $LayerText, $LayerCursor, $LayerDiagnostics);
6758
- const $EditorContent = document.createElement('div');
6759
- $EditorContent.className = 'EditorContent';
6760
- $EditorContent.append($EditorInput, $EditorLayers, $ScrollBarDiagnostics, $ScrollBarVertical, $ScrollBarHorizontal);
6761
- $EditorContent.addEventListener('mousemove', handleMouseMove, Passive);
6762
- const $Editor = document.createElement('div');
6763
- $Editor.className = 'Viewlet Editor';
6764
- $Editor.role = Code;
6765
- $Editor.append($LayerGutter, $EditorContent);
6766
- attachEventsFunctional($Editor, {
6767
- [ContextMenu]: handleContextMenu$2,
6768
- [Wheel]: handleWheel,
6769
- returnValue: true
6770
- });
6771
- return {
6772
- $Editor,
6773
- $EditorInput,
6774
- $EditorLayers,
6775
- $LayerCursor,
6776
- $LayerDiagnostics,
6777
- $LayerGutter,
6778
- $LayerSelections,
6779
- $LayerText,
6780
- $ScrollBarDiagnostics,
6781
- $ScrollBarThumbHorizontal,
6782
- $ScrollBarThumbVertical,
6783
- $Viewlet: $Editor,
6784
- shouldIgnoreSelectionChange: false
6785
- };
6786
- };
6787
- const setText$2 = (state, dom) => {
6788
- setLineInfos(state, dom);
6789
- };
6790
- const setIncrementalEdits$1 = (state, incrementalEdits) => {
6791
- const {
6792
- $LayerText
6793
- } = state;
6794
- for (const incrementalEdit of incrementalEdits) {
6795
- const {
6796
- columnIndex,
6797
- rowIndex,
6798
- text
6799
- } = incrementalEdit;
6800
- const $Row = $LayerText.children[rowIndex];
6801
- const $Column = $Row.children[columnIndex];
6802
- if ($Column.firstChild) {
6803
- $Column.firstChild.nodeValue = text;
6804
- } else {
6805
- $Column.textContent = text;
6806
- }
6807
- }
6808
- };
6809
- const setScrollBar$1 = (state, scrollBarY, scrollBarHeight) => {
6810
- setPosition$1(state, scrollBarY, scrollBarHeight);
6811
- };
6812
- const setScrollBarHorizontal$1 = setScrollBarHorizontal$2;
6813
- const renderGutter$1 = (state, dom) => {
6814
- const {
6815
- $LayerGutter
6816
- } = state;
6817
- renderInto($LayerGutter, dom);
6818
- };
6819
- const setSelections$1 = (state, cursorInfos, selectionInfos) => {
6820
- array(cursorInfos);
6821
- array(selectionInfos);
6822
- setCursors(state, cursorInfos);
6823
- setSelections$2(state, selectionInfos);
6824
- };
6825
- const setFocused$2 = async (state, isFocused) => {
6826
- const {
6827
- $EditorInput
6828
- } = state;
6829
- let tries = 0;
6830
- while (!$EditorInput.isConnected && tries++ < 1000) {
6831
- await new Promise(resolve => {
6832
- requestAnimationFrame(resolve);
6833
- });
6834
- }
6835
- if (!$EditorInput.isConnected) {
6836
- warn$1('unmounted editor cannot be focused');
6837
- }
6838
- if (isFocused) {
6839
- $EditorInput.focus();
6840
- }
6841
- };
6842
- const setDecorationsDom$1 = (state, decorations) => {
6843
- setDecorationsDom$2(state, decorations);
6844
- };
6845
-
6846
- const create$j = create$k;
6847
- const setText$1 = setText$2;
6848
- const setSelections = setSelections$1;
6849
- const setIncrementalEdits = setIncrementalEdits$1;
6850
- const handleError$4 = (state, error) => {
6851
- state.$Viewlet.textContent = error;
6852
- };
6853
- const setScrollBar = setScrollBar$1;
6854
- const renderGutter = renderGutter$1;
6855
- const setScrollBarHorizontal = setScrollBarHorizontal$1;
6856
- const highlightAsLink = (state, relativeY, tokenIndex) => {
6857
- const $Row = state.$LayerText.children[relativeY];
6858
- if (!$Row) {
6859
- info('no row found');
6860
- return;
6861
- }
6862
- const $Token = $Row.children[tokenIndex + 1];
6863
- $Token.classList.add('EditorGoToDefinitionLink');
6864
- };
6865
- const showOverlayMessage = (state, x, y, content) => {
6866
- const $OverLayMessage = document.createElement('div');
6867
- $OverLayMessage.className = 'EditorOverlayMessage';
6868
- $OverLayMessage.style.position = 'fixed';
6869
- $OverLayMessage.textContent = content;
6870
- setXAndY($OverLayMessage, x, y);
6871
- append$1($OverLayMessage);
6872
- };
6873
- const hideOverlayMessage = state => {
6874
- // TODO pass id of the overlay message and remove widget by id
6875
- for (const $Widget of state$6.widgetSet) {
6876
- // @ts-expect-error
6877
- if ($Widget.className === 'EditorOverlayMessage') {
6878
- remove$1($Widget);
6879
- }
6880
- }
6881
- };
6882
- const setFocused$1 = setFocused$2;
6883
- const focus$b = setFocused$2;
6884
- const setDecorationsDom = setDecorationsDom$1;
6885
-
6886
- const ViewletEditorText = {
6887
- __proto__: null,
6888
- create: create$j,
6889
- focus: focus$b,
6890
- handleError: handleError$4,
6891
- hideOverlayMessage,
6892
- highlightAsLink,
6893
- renderGutter,
6894
- setDecorationsDom,
6895
- setFocused: setFocused$1,
6896
- setIncrementalEdits,
6897
- setScrollBar,
6898
- setScrollBarHorizontal,
6899
- setSelections,
6900
- setText: setText$1,
6901
- showOverlayMessage
6902
- };
6903
-
6904
6321
  const create$i = () => {
6905
6322
  const $Viewlet = document.createElement('div');
6906
6323
  $Viewlet.className = 'Viewlet EditorTextError';
@@ -7002,6 +6419,66 @@ const ViewletError = {
7002
6419
  setMessage: setMessage$1
7003
6420
  };
7004
6421
 
6422
+ const commandMap$1 = {};
6423
+
6424
+ const ViewletExtensionViewEvents = {
6425
+ __proto__: null,
6426
+ commandMap: commandMap$1
6427
+ };
6428
+
6429
+ const setIframeCredentialless = ($Iframe, credentialless) => {
6430
+ if (credentialless) {
6431
+ // @ts-ignore
6432
+ $Iframe.credentialless = credentialless;
6433
+ }
6434
+ };
6435
+
6436
+ const setIframeCsp = ($Iframe, csp) => {
6437
+ if (csp) {
6438
+ // @ts-ignore
6439
+ $Iframe.csp = csp;
6440
+ }
6441
+ };
6442
+
6443
+ const setIframeSandBox = ($Iframe, sandbox) => {
6444
+ if (sandbox.length === 0) {
6445
+ return;
6446
+ }
6447
+ $Iframe.sandbox.add(...sandbox);
6448
+ };
6449
+
6450
+ const setIframeSrc = ($Iframe, src, srcDoc = '') => {
6451
+ if (src) {
6452
+ $Iframe.src = src;
6453
+ } else if (srcDoc) {
6454
+ $Iframe.srcdoc = srcDoc;
6455
+ }
6456
+ };
6457
+
6458
+ const setIframe$1 = (state, src, sandbox = [], srcDoc = '', csp = '', credentialless = true, title = '') => {
6459
+ if (!src && !srcDoc) {
6460
+ return;
6461
+ }
6462
+ const {
6463
+ $Viewlet
6464
+ } = state;
6465
+ $Viewlet.textContent = '';
6466
+ const $Iframe = document.createElement('iframe');
6467
+ $Iframe.className = 'ExtensionViewIframe';
6468
+ $Iframe.title = title;
6469
+ setIframeCredentialless($Iframe, credentialless);
6470
+ setIframeCsp($Iframe, csp);
6471
+ setIframeSandBox($Iframe, sandbox);
6472
+ setIframeSrc($Iframe, src, srcDoc);
6473
+ $Viewlet.append($Iframe);
6474
+ };
6475
+
6476
+ const ViewletExtensionView = {
6477
+ __proto__: null,
6478
+ Events: ViewletExtensionViewEvents,
6479
+ setIframe: setIframe$1
6480
+ };
6481
+
7005
6482
  const handleInput$4 = event => {
7006
6483
  const {
7007
6484
  target
@@ -7227,13 +6704,13 @@ const handleScrollBarPointerDown = event => {
7227
6704
  const ViewletInlineDiffEditorEvents = {
7228
6705
  __proto__: null,
7229
6706
  handleScrollBarPointerDown,
7230
- handleWheel: handleWheel$3
6707
+ handleWheel: handleWheel$2
7231
6708
  };
7232
6709
 
7233
6710
  const ViewletInlineDiffEditor = {
7234
6711
  __proto__: null,
7235
6712
  Events: ViewletInlineDiffEditorEvents,
7236
- setScrollBar: setScrollBar$2
6713
+ setScrollBar
7237
6714
  };
7238
6715
 
7239
6716
  const handleResizerPointerMove = event => {
@@ -7314,7 +6791,7 @@ const ViewletKeyBindings = {
7314
6791
  __proto__: null,
7315
6792
  Events: Events$2,
7316
6793
  setColumnWidths,
7317
- setScrollBar: setScrollBar$2,
6794
+ setScrollBar,
7318
6795
  setSize,
7319
6796
  setValue
7320
6797
  };
@@ -7349,7 +6826,7 @@ const getKeyBindingIdentifier = event => {
7349
6826
  } = event;
7350
6827
  const modifierControl = ctrlKey ? CtrlCmd : 0;
7351
6828
  const modifierShift = shiftKey ? Shift : 0;
7352
- const modifierAlt = altKey ? Alt$1 : 0;
6829
+ const modifierAlt = altKey ? Alt : 0;
7353
6830
  const normalizedKey = normalizeKey(key, code);
7354
6831
  const keyCode = getKeyCode(normalizedKey);
7355
6832
  const identifier = modifierControl | modifierShift | modifierAlt | keyCode;
@@ -7521,10 +6998,10 @@ const EditorError = 'EditorError';
7521
6998
  const EditorHover = 'EditorHover';
7522
6999
  const EditorImage = 'EditorImage';
7523
7000
  const EditorPlainText = 'EditorPlainText';
7524
- const EditorText = 'Editor';
7525
7001
  const EditorWidgetError = 'EditorWidgetError';
7526
7002
  const Empty = 'Empty';
7527
7003
  const Error$1 = 'Error';
7004
+ const ExtensionView = 'ExtensionView';
7528
7005
  const FindWidget = 'FindWidget';
7529
7006
  const ImagePreview = 'ImagePreview';
7530
7007
  const InlineDiffEditor = 'InlineDiffEditor';
@@ -7536,10 +7013,10 @@ const Panel = 'Panel';
7536
7013
  const References = 'References';
7537
7014
  const RunAndDebug = 'Run And Debug';
7538
7015
  const ScreenCapture = 'ScreenCapture';
7539
- const SideBar = 'SideBar';
7016
+ const SideBar$1 = 'SideBar';
7540
7017
  const SimpleBrowser = 'SimpleBrowser';
7541
7018
  const SourceControl = 'Source Control';
7542
- const StatusBar = 'StatusBar';
7019
+ const StatusBar$1 = 'StatusBar';
7543
7020
  const Storage = 'Storage';
7544
7021
  const Terminal = 'Terminal';
7545
7022
  const Terminal2 = 'Terminal2';
@@ -7593,7 +7070,7 @@ const handleError$2 = (state, error) => {
7593
7070
  };
7594
7071
  const focus$7 = state => {
7595
7072
  object(state);
7596
- focus$e(state.$ViewletOutputContent);
7073
+ focus$d(state.$ViewletOutputContent);
7597
7074
  send('Focus.setFocus', FocusOutput);
7598
7075
  };
7599
7076
 
@@ -7831,6 +7308,9 @@ const ViewletScreenCapture = {
7831
7308
  setScreenCapture
7832
7309
  };
7833
7310
 
7311
+ const SideBar = 'Side Bar';
7312
+ const StatusBar = 'Status Bar';
7313
+
7834
7314
  const handleClickAction = (target, uid) => {
7835
7315
  const index = getNodeIndex(target);
7836
7316
  if (target && target.dataset && target.dataset.command) {
@@ -7857,7 +7337,7 @@ const create$8 = () => {
7857
7337
  $Viewlet.id = 'SideBar';
7858
7338
  $Viewlet.className = 'Viewlet SideBar';
7859
7339
  $Viewlet.role = Complementary;
7860
- $Viewlet.ariaRoleDescription = SideBar$1;
7340
+ $Viewlet.ariaRoleDescription = SideBar;
7861
7341
  $Viewlet.append($SideBarTitleArea);
7862
7342
  return {
7863
7343
  $Actions: undefined,
@@ -8007,12 +7487,12 @@ const handleContextMenu$1 = event => {
8007
7487
  clientY
8008
7488
  } = event;
8009
7489
  const uid = fromEvent(event);
8010
- handleContextMenu$6(uid, button, clientX, clientY);
7490
+ handleContextMenu$5(uid, button, clientX, clientY);
8011
7491
  };
8012
7492
 
8013
7493
  const handleFocus = event => {
8014
7494
  const uid = fromEvent(event);
8015
- handleFocus$8(uid);
7495
+ handleFocus$7(uid);
8016
7496
  };
8017
7497
  const getButtonIndex = $Node => {
8018
7498
  let index = -1;
@@ -8093,7 +7573,7 @@ const ViewletSourceControlEvents = {
8093
7573
  handleInput: handleInput$1,
8094
7574
  handleMouseOut,
8095
7575
  handleMouseOver,
8096
- handleWheel: handleWheel$3
7576
+ handleWheel: handleWheel$2
8097
7577
  };
8098
7578
 
8099
7579
  const focus$4 = state => {
@@ -8129,7 +7609,7 @@ const create$7 = () => {
8129
7609
  $Viewlet.className = 'Viewlet StatusBar';
8130
7610
  $Viewlet.tabIndex = 0;
8131
7611
  $Viewlet.role = Status;
8132
- $Viewlet.ariaRoleDescription = StatusBar$1;
7612
+ $Viewlet.ariaRoleDescription = StatusBar;
8133
7613
  $Viewlet.ariaLive = 'off'; // see https://github.com/microsoft/vscode/issues/94677
8134
7614
  $Viewlet.addEventListener('click', handleClick$2);
8135
7615
  return {
@@ -8296,7 +7776,7 @@ const handleMenuClick = event => {
8296
7776
  };
8297
7777
  const handleFocusIn$1 = event => {
8298
7778
  const uid = fromEvent(event);
8299
- handleFocus$8(uid);
7779
+ handleFocus$7(uid);
8300
7780
  };
8301
7781
 
8302
7782
  const ViewletTitleBarMenuBarEvents = {
@@ -8682,35 +8162,6 @@ const ViewletWebViewEvents = {
8682
8162
  returnValue
8683
8163
  };
8684
8164
 
8685
- const setIframeCredentialless = ($Iframe, credentialless) => {
8686
- if (credentialless) {
8687
- // @ts-ignore
8688
- $Iframe.credentialless = credentialless;
8689
- }
8690
- };
8691
-
8692
- const setIframeCsp = ($Iframe, csp) => {
8693
- if (csp) {
8694
- // @ts-ignore
8695
- $Iframe.csp = csp;
8696
- }
8697
- };
8698
-
8699
- const setIframeSandBox = ($Iframe, sandbox) => {
8700
- if (sandbox.length === 0) {
8701
- return;
8702
- }
8703
- $Iframe.sandbox.add(...sandbox);
8704
- };
8705
-
8706
- const setIframeSrc = ($Iframe, src, srcDoc = '') => {
8707
- if (src) {
8708
- $Iframe.src = src;
8709
- } else if (srcDoc) {
8710
- $Iframe.srcdoc = srcDoc;
8711
- }
8712
- };
8713
-
8714
8165
  // TODO could use browser view when running in electron
8715
8166
  const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '', credentialless = true) => {
8716
8167
  if (!src && !srcDoc) {
@@ -8790,12 +8241,12 @@ const moduleLoaders = {
8790
8241
  [EditorImage]: () => ViewletEditorImage,
8791
8242
  [EditorPlainText]: () => ViewletEditorPlainText,
8792
8243
  [EditorSourceActions]: () => ViewletEditorSourceActions,
8793
- [EditorText]: () => ViewletEditorText,
8794
8244
  [EditorTextError]: () => ViewletEditorTextError,
8795
8245
  [EditorWidgetError]: () => ViewletEditorWidgetError,
8796
8246
  [Empty]: () => ViewletEmpty,
8797
8247
  [EmptyEditor]: () => ViewletEmptyEditor,
8798
8248
  [Error$1]: () => ViewletError,
8249
+ [ExtensionView]: () => ViewletExtensionView,
8799
8250
  [FindWidget]: () => ViewletFindWidget,
8800
8251
  [ImagePreview]: () => ImagePreview$1,
8801
8252
  [Implementations]: () => ViewletImplementations,
@@ -8807,10 +8258,10 @@ const moduleLoaders = {
8807
8258
  [References]: () => ViewletReferences,
8808
8259
  [RunAndDebug]: () => ViewletRunAndDebug,
8809
8260
  [ScreenCapture]: () => ViewletScreenCapture,
8810
- [SideBar]: () => ViewletSideBar,
8261
+ [SideBar$1]: () => ViewletSideBar,
8811
8262
  [SimpleBrowser]: () => ViewletSimpleBrowser,
8812
8263
  [SourceControl]: () => ViewletSourceControl,
8813
- [StatusBar]: () => ViewletStatusBar,
8264
+ [StatusBar$1]: () => ViewletStatusBar,
8814
8265
  [Storage]: () => ViewletStorage,
8815
8266
  [Terminal]: () => Promise.resolve().then(function () { return ViewletTerminal; }),
8816
8267
  [Terminal2]: () => Promise.resolve().then(function () { return ViewletTerminal2; }),
@@ -9517,7 +8968,7 @@ const getFilePathElectron = async file => {
9517
8968
  };
9518
8969
 
9519
8970
  const handleMessagePort = async port => {
9520
- await create$B({
8971
+ await create$z({
9521
8972
  commandMap: {},
9522
8973
  messagePort: port
9523
8974
  });
@@ -9624,7 +9075,7 @@ const commandMap = {
9624
9075
  'GetFilePathElectron.getFilePathElectron': getFilePathElectron,
9625
9076
  'HandleMessagePort.handleMessagePort': handleMessagePort,
9626
9077
  'InitData.getInitData': getInitData,
9627
- 'IpcParent.create': create$y,
9078
+ 'IpcParent.create': create$w,
9628
9079
  'KeyBindings.setIdentifiers': setIdentifiers,
9629
9080
  'Layout.getBounds': getBounds,
9630
9081
  'Location.getHref': getHref,
@@ -9639,10 +9090,10 @@ const commandMap = {
9639
9090
  'Menu.showControlled': showControlled,
9640
9091
  'Menu.showMenu': showMenu,
9641
9092
  'Meta.setThemeColor': setThemeColor,
9642
- 'Notification.create': create$x,
9093
+ 'Notification.create': create$v,
9643
9094
  'Notification.createWithOptions': createWithOptions,
9644
9095
  'Notification.dispose': dispose$h,
9645
- 'OffscreenCanvas.create': create$w,
9096
+ 'OffscreenCanvas.create': create$u,
9646
9097
  'OffscreenCanvas.create2': create2,
9647
9098
  'Open.openUrl': openUrl,
9648
9099
  'Open.redirectToUrl': redirectToUrl,
@@ -9704,7 +9155,7 @@ const getConfiguredEditorWorkerUrl = () => {
9704
9155
  const editorWorkerUrl = getConfiguredEditorWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/editor-worker/dist/editorWorkerMain.js`;
9705
9156
 
9706
9157
  const launchEditorWorker = async port => {
9707
- const ipc = await create$y({
9158
+ const ipc = await create$w({
9708
9159
  method: ModuleWorkerWithMessagePort,
9709
9160
  name: 'Editor Worker',
9710
9161
  port,
@@ -9732,7 +9183,7 @@ const extensionHostWorkerUrl = getConfiguredExtensionHostWorkerUrl() || `${asset
9732
9183
 
9733
9184
  const launchExtensionHostWorker = async port => {
9734
9185
  const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
9735
- const ipc = await create$y({
9186
+ const ipc = await create$w({
9736
9187
  method: ModuleWorkerWithMessagePort,
9737
9188
  name,
9738
9189
  port,
@@ -9760,7 +9211,7 @@ const getConfiguredSyntaxHighlightingWorkerUrl = () => {
9760
9211
  const syntaxHighlightingWorkerUrl = getConfiguredSyntaxHighlightingWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/syntax-highlighting-worker/dist/syntaxHighlightingWorkerMain.js`;
9761
9212
 
9762
9213
  const launchSyntaxHighlightingWorker = async port => {
9763
- const ipc = await create$y({
9214
+ const ipc = await create$w({
9764
9215
  method: ModuleWorkerWithMessagePort,
9765
9216
  name: 'Syntax Highlighting Worker',
9766
9217
  port,
@@ -10231,11 +9682,11 @@ const create$2 = ({
10231
9682
 
10232
9683
  const handleBlur = event => {
10233
9684
  const uid = fromEvent(event);
10234
- handleBlur$8(uid);
9685
+ handleBlur$7(uid);
10235
9686
  };
10236
9687
  const handleMouseDown = (event, ...args) => {
10237
9688
  const uid = fromEvent(event);
10238
- handleMouseDown$2(uid, ...args);
9689
+ handleMouseDown$1(uid, ...args);
10239
9690
  };
10240
9691
  const handleKeyDown = (event, ...args) => {
10241
9692
  const uid = fromEvent(event);