@lvce-editor/main-area-worker 9.32.3 → 9.32.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mainAreaWorkerMain.js +176 -108
- package/package.json +1 -1
|
@@ -935,7 +935,10 @@ const constructError = (message, type, name) => {
|
|
|
935
935
|
if (ErrorConstructor === Error) {
|
|
936
936
|
const error = new Error(message);
|
|
937
937
|
if (name && name !== 'VError') {
|
|
938
|
-
error
|
|
938
|
+
Object.defineProperty(error, 'name', {
|
|
939
|
+
configurable: true,
|
|
940
|
+
value: name
|
|
941
|
+
});
|
|
939
942
|
}
|
|
940
943
|
return error;
|
|
941
944
|
}
|
|
@@ -966,31 +969,45 @@ const getParentStack = error => {
|
|
|
966
969
|
};
|
|
967
970
|
const MethodNotFound = -32601;
|
|
968
971
|
const Custom = -32001;
|
|
972
|
+
const setStack = (error, stack) => {
|
|
973
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, 'stack');
|
|
974
|
+
if (descriptor) {
|
|
975
|
+
if (!descriptor.configurable && !descriptor.writable) {
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
if (!descriptor.configurable && descriptor.writable) {
|
|
979
|
+
error.stack = stack;
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
Object.defineProperty(error, 'stack', {
|
|
984
|
+
configurable: true,
|
|
985
|
+
value: stack,
|
|
986
|
+
writable: true
|
|
987
|
+
});
|
|
988
|
+
};
|
|
969
989
|
const restoreExistingError = (error, currentStack) => {
|
|
970
990
|
if (typeof error.stack === 'string') {
|
|
971
|
-
error
|
|
991
|
+
setStack(error, `${error.stack}${NewLine}${currentStack}`);
|
|
972
992
|
}
|
|
973
993
|
return error;
|
|
974
994
|
};
|
|
975
995
|
const restoreMethodNotFoundError = (error, currentStack) => {
|
|
976
996
|
const restoredError = new JsonRpcError(error.message);
|
|
977
997
|
const parentStack = getParentStack(error);
|
|
978
|
-
restoredError
|
|
998
|
+
setStack(restoredError, `${parentStack}${NewLine}${currentStack}`);
|
|
979
999
|
return restoredError;
|
|
980
1000
|
};
|
|
981
1001
|
const restoreStackFromData = (restoredError, error, currentStack) => {
|
|
982
1002
|
if (error.data.stack && error.data.type && error.message) {
|
|
983
|
-
restoredError
|
|
1003
|
+
setStack(restoredError, `${error.data.type}: ${error.message}${NewLine}${error.data.stack}${NewLine}${currentStack}`);
|
|
984
1004
|
return;
|
|
985
1005
|
}
|
|
986
1006
|
if (error.data.stack) {
|
|
987
|
-
restoredError
|
|
1007
|
+
setStack(restoredError, error.data.stack);
|
|
988
1008
|
}
|
|
989
1009
|
};
|
|
990
1010
|
const applyDataProperties = (restoredError, error) => {
|
|
991
|
-
if (!error.data) {
|
|
992
|
-
return;
|
|
993
|
-
}
|
|
994
1011
|
restoreStackFromData(restoredError, error, getCurrentStack());
|
|
995
1012
|
if (error.data.codeFrame) {
|
|
996
1013
|
// @ts-ignore
|
|
@@ -1011,7 +1028,7 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
1011
1028
|
const indexNewLine = getNewLineIndex(lowerStack);
|
|
1012
1029
|
const parentStack = getParentStack(error);
|
|
1013
1030
|
// @ts-ignore
|
|
1014
|
-
restoredError
|
|
1031
|
+
setStack(restoredError, `${parentStack}${lowerStack.slice(indexNewLine)}`);
|
|
1015
1032
|
}
|
|
1016
1033
|
if (error.codeFrame) {
|
|
1017
1034
|
// @ts-ignore
|
|
@@ -4504,6 +4521,7 @@ const EditorGroupHeader = 'EditorGroupHeader';
|
|
|
4504
4521
|
const EmptyGroupHeader = 'EmptyGroupHeader';
|
|
4505
4522
|
const EmptyGroupCloseButton = 'EmptyGroupCloseButton';
|
|
4506
4523
|
const EditorGroup = 'EditorGroup';
|
|
4524
|
+
const EditorGroupEmpty = 'EditorGroup EditorGroupEmpty';
|
|
4507
4525
|
const EditorGroupsHorizontal = 'EditorGroupsHorizontal';
|
|
4508
4526
|
const EditorGroupsVertical = 'EditorGroupsVertical';
|
|
4509
4527
|
const EditorContainer = 'EditorContainer';
|
|
@@ -4515,6 +4533,7 @@ const MaskIconCircleFilled = 'MaskIcon MaskIconCircleFilled';
|
|
|
4515
4533
|
const MaskIconClose = 'MaskIcon MaskIconClose';
|
|
4516
4534
|
const MaskIconExtensions = 'MaskIcon MaskIconExtensions';
|
|
4517
4535
|
const MaskIconRecordKey = 'MaskIcon MaskIconRecordKey';
|
|
4536
|
+
const MaskIconSearch = 'MaskIcon MaskIconSearch';
|
|
4518
4537
|
const TextEditor = 'TextEditor';
|
|
4519
4538
|
const TextEditorLoading = 'TextEditor TextEditor--loading';
|
|
4520
4539
|
const EditorContentLoading = 'EditorContent EditorContent--loading';
|
|
@@ -5340,7 +5359,7 @@ const restoreAndCreateEditors = async (state, restoredLayout) => {
|
|
|
5340
5359
|
return newState;
|
|
5341
5360
|
};
|
|
5342
5361
|
|
|
5343
|
-
const loadContent = async (state, savedState) => {
|
|
5362
|
+
const loadContent$1 = async (state, savedState) => {
|
|
5344
5363
|
const homeDirUri = await loadHomeDirUri();
|
|
5345
5364
|
const stateWithHomeDir = {
|
|
5346
5365
|
...state,
|
|
@@ -5378,7 +5397,7 @@ const loadContent = async (state, savedState) => {
|
|
|
5378
5397
|
};
|
|
5379
5398
|
|
|
5380
5399
|
const handleWorkspaceChange = async (state, _workspacePath, savedState) => {
|
|
5381
|
-
return loadContent(state, savedState);
|
|
5400
|
+
return loadContent$1(state, savedState);
|
|
5382
5401
|
};
|
|
5383
5402
|
|
|
5384
5403
|
const handleWorkspaceRefresh = async (state, refresh = {}) => {
|
|
@@ -6273,31 +6292,36 @@ const HandleSashCornerPointerDown = 20;
|
|
|
6273
6292
|
const HandleSashCornerPointerMove = 21;
|
|
6274
6293
|
const HandleSashCornerPointerUp = 22;
|
|
6275
6294
|
|
|
6295
|
+
const textEditorNode = {
|
|
6296
|
+
childCount: 1,
|
|
6297
|
+
className: TextEditor,
|
|
6298
|
+
type: Div
|
|
6299
|
+
};
|
|
6300
|
+
const editorContentNode = {
|
|
6301
|
+
childCount: 1,
|
|
6302
|
+
className: EditorContent,
|
|
6303
|
+
type: Pre
|
|
6304
|
+
};
|
|
6276
6305
|
const renderContent = content => {
|
|
6277
|
-
return [
|
|
6278
|
-
childCount: 1,
|
|
6279
|
-
className: TextEditor,
|
|
6280
|
-
type: Div
|
|
6281
|
-
}, {
|
|
6282
|
-
childCount: 1,
|
|
6283
|
-
className: EditorContent,
|
|
6284
|
-
type: Pre
|
|
6285
|
-
}, text(content)];
|
|
6306
|
+
return [textEditorNode, editorContentNode, text(content)];
|
|
6286
6307
|
};
|
|
6287
6308
|
|
|
6309
|
+
const textEditorErrorNode = {
|
|
6310
|
+
childCount: 1,
|
|
6311
|
+
className: TextEditorError,
|
|
6312
|
+
type: Div
|
|
6313
|
+
};
|
|
6314
|
+
const editorContentErrorNode = {
|
|
6315
|
+
childCount: 2,
|
|
6316
|
+
className: EditorContentError,
|
|
6317
|
+
type: Div
|
|
6318
|
+
};
|
|
6319
|
+
const paragraphNode = {
|
|
6320
|
+
childCount: 1,
|
|
6321
|
+
type: P
|
|
6322
|
+
};
|
|
6288
6323
|
const renderError = errorMessage => {
|
|
6289
|
-
return [{
|
|
6290
|
-
childCount: 1,
|
|
6291
|
-
className: TextEditorError,
|
|
6292
|
-
type: Div
|
|
6293
|
-
}, {
|
|
6294
|
-
childCount: 2,
|
|
6295
|
-
className: EditorContentError,
|
|
6296
|
-
type: Div
|
|
6297
|
-
}, {
|
|
6298
|
-
childCount: 1,
|
|
6299
|
-
type: P
|
|
6300
|
-
}, text(`Error: ${errorMessage}`), {
|
|
6324
|
+
return [textEditorErrorNode, editorContentErrorNode, paragraphNode, text(`Error: ${errorMessage}`), {
|
|
6301
6325
|
childCount: 1,
|
|
6302
6326
|
className: mergeClassNames(Button, ButtonSecondary),
|
|
6303
6327
|
'data-action': RetryOpen,
|
|
@@ -6307,16 +6331,18 @@ const renderError = errorMessage => {
|
|
|
6307
6331
|
}, text(retry())];
|
|
6308
6332
|
};
|
|
6309
6333
|
|
|
6334
|
+
const textEditorLoadingNode = {
|
|
6335
|
+
childCount: 1,
|
|
6336
|
+
className: TextEditorLoading,
|
|
6337
|
+
type: Div
|
|
6338
|
+
};
|
|
6339
|
+
const editorContentLoadingNode = {
|
|
6340
|
+
childCount: 1,
|
|
6341
|
+
className: EditorContentLoading,
|
|
6342
|
+
type: Div
|
|
6343
|
+
};
|
|
6310
6344
|
const renderLoading = () => {
|
|
6311
|
-
return [
|
|
6312
|
-
childCount: 1,
|
|
6313
|
-
className: TextEditorLoading,
|
|
6314
|
-
type: Div
|
|
6315
|
-
}, {
|
|
6316
|
-
childCount: 1,
|
|
6317
|
-
className: EditorContentLoading,
|
|
6318
|
-
type: Div
|
|
6319
|
-
}, text('Loading...')];
|
|
6345
|
+
return [textEditorLoadingNode, editorContentLoadingNode, text('Loading...')];
|
|
6320
6346
|
};
|
|
6321
6347
|
|
|
6322
6348
|
const renderViewletReference = tab => {
|
|
@@ -6355,6 +6381,16 @@ const renderEditor = tab => {
|
|
|
6355
6381
|
return renderContent('');
|
|
6356
6382
|
};
|
|
6357
6383
|
|
|
6384
|
+
const dirtyIconNode = {
|
|
6385
|
+
childCount: 0,
|
|
6386
|
+
className: MaskIconCircleFilled,
|
|
6387
|
+
type: Div
|
|
6388
|
+
};
|
|
6389
|
+
const closeIconNode$1 = {
|
|
6390
|
+
childCount: 0,
|
|
6391
|
+
className: MaskIconClose,
|
|
6392
|
+
type: Div
|
|
6393
|
+
};
|
|
6358
6394
|
const renderTabActions = (isDirty, tabIndex, groupIndex) => {
|
|
6359
6395
|
if (isDirty) {
|
|
6360
6396
|
return [{
|
|
@@ -6365,11 +6401,7 @@ const renderTabActions = (isDirty, tabIndex, groupIndex) => {
|
|
|
6365
6401
|
'data-index': tabIndex,
|
|
6366
6402
|
onClick: HandleClickClose,
|
|
6367
6403
|
type: Button$2
|
|
6368
|
-
},
|
|
6369
|
-
childCount: 0,
|
|
6370
|
-
className: MaskIconCircleFilled,
|
|
6371
|
-
type: Div
|
|
6372
|
-
}];
|
|
6404
|
+
}, dirtyIconNode];
|
|
6373
6405
|
}
|
|
6374
6406
|
return [{
|
|
6375
6407
|
'aria-label': 'Close',
|
|
@@ -6379,23 +6411,26 @@ const renderTabActions = (isDirty, tabIndex, groupIndex) => {
|
|
|
6379
6411
|
'data-index': tabIndex,
|
|
6380
6412
|
onClick: HandleClickClose,
|
|
6381
6413
|
type: Button$2
|
|
6382
|
-
},
|
|
6383
|
-
childCount: 0,
|
|
6384
|
-
className: MaskIconClose,
|
|
6385
|
-
type: Div
|
|
6386
|
-
}];
|
|
6414
|
+
}, closeIconNode$1];
|
|
6387
6415
|
};
|
|
6388
6416
|
|
|
6389
6417
|
const ExtensionDetailScheme = 'extension-detail://';
|
|
6390
6418
|
const KeyBindingsUri = 'app://keybindings';
|
|
6391
6419
|
const RunningExtensionsScheme = 'running-extensions://';
|
|
6420
|
+
const SearchEditorScheme = 'search-editor://';
|
|
6421
|
+
const tabIconNode = {
|
|
6422
|
+
childCount: 1,
|
|
6423
|
+
className: TabIcon,
|
|
6424
|
+
role: None$1,
|
|
6425
|
+
type: Div
|
|
6426
|
+
};
|
|
6427
|
+
const tabTitleNode = {
|
|
6428
|
+
childCount: 1,
|
|
6429
|
+
className: TabTitle,
|
|
6430
|
+
type: Span
|
|
6431
|
+
};
|
|
6392
6432
|
const renderMaskIcon = className => {
|
|
6393
|
-
return [{
|
|
6394
|
-
childCount: 1,
|
|
6395
|
-
className: TabIcon,
|
|
6396
|
-
role: None$1,
|
|
6397
|
-
type: Div
|
|
6398
|
-
}, {
|
|
6433
|
+
return [tabIconNode, {
|
|
6399
6434
|
childCount: 0,
|
|
6400
6435
|
className,
|
|
6401
6436
|
type: Div
|
|
@@ -6411,6 +6446,9 @@ const renderTabIcon = tab => {
|
|
|
6411
6446
|
if (tab.uri?.startsWith(RunningExtensionsScheme)) {
|
|
6412
6447
|
return renderMaskIcon(MaskIconExtensions);
|
|
6413
6448
|
}
|
|
6449
|
+
if (tab.uri?.startsWith(SearchEditorScheme)) {
|
|
6450
|
+
return renderMaskIcon(MaskIconSearch);
|
|
6451
|
+
}
|
|
6414
6452
|
return [{
|
|
6415
6453
|
childCount: 0,
|
|
6416
6454
|
className: TabIcon,
|
|
@@ -6423,13 +6461,13 @@ const renderTab = (tab, isActive, tabIndex, groupIndex) => {
|
|
|
6423
6461
|
const closeButtonNodes = renderTabActions(tab.isDirty, tabIndex, groupIndex);
|
|
6424
6462
|
let className = MainTab;
|
|
6425
6463
|
if (isActive) {
|
|
6426
|
-
className
|
|
6464
|
+
className = mergeClassNames(className, MainTabSelected);
|
|
6427
6465
|
}
|
|
6428
6466
|
if (tab.isDirty) {
|
|
6429
|
-
className
|
|
6467
|
+
className = mergeClassNames(className, MainTabModified);
|
|
6430
6468
|
}
|
|
6431
6469
|
if (tab.isPreview) {
|
|
6432
|
-
className
|
|
6470
|
+
className = mergeClassNames(className, MainTabPreview);
|
|
6433
6471
|
}
|
|
6434
6472
|
return [{
|
|
6435
6473
|
'aria-selected': isActive,
|
|
@@ -6443,11 +6481,7 @@ const renderTab = (tab, isActive, tabIndex, groupIndex) => {
|
|
|
6443
6481
|
role: Tab$1,
|
|
6444
6482
|
title: tab.uriTitle || tab.uri || tab.title,
|
|
6445
6483
|
type: Div
|
|
6446
|
-
}, ...renderTabIcon(tab),
|
|
6447
|
-
childCount: 1,
|
|
6448
|
-
className: TabTitle,
|
|
6449
|
-
type: Span
|
|
6450
|
-
}, text(tab.title), ...closeButtonNodes];
|
|
6484
|
+
}, ...renderTabIcon(tab), tabTitleNode, text(tab.title), ...closeButtonNodes];
|
|
6451
6485
|
};
|
|
6452
6486
|
|
|
6453
6487
|
const getTabsVirtualDom = (group, groupIndex, tabsChildCount) => {
|
|
@@ -6466,6 +6500,11 @@ const isHtmlFile = tab => {
|
|
|
6466
6500
|
return tab.uri.endsWith('.html');
|
|
6467
6501
|
};
|
|
6468
6502
|
|
|
6503
|
+
const previewIconNode = {
|
|
6504
|
+
childCount: 0,
|
|
6505
|
+
className: MaskIconPreview,
|
|
6506
|
+
type: Div
|
|
6507
|
+
};
|
|
6469
6508
|
const renderEditorGroupActions = (group, groupIndex, splitButtonEnabled) => {
|
|
6470
6509
|
const activeTab = group.tabs.find(tab => tab.id === group.activeTabId);
|
|
6471
6510
|
const showTogglePreview = isHtmlFile(activeTab);
|
|
@@ -6484,11 +6523,7 @@ const renderEditorGroupActions = (group, groupIndex, splitButtonEnabled) => {
|
|
|
6484
6523
|
onClick: HandleClickAction,
|
|
6485
6524
|
title: togglePreview(),
|
|
6486
6525
|
type: Button$2
|
|
6487
|
-
},
|
|
6488
|
-
childCount: 0,
|
|
6489
|
-
className: MaskIconPreview,
|
|
6490
|
-
type: Div
|
|
6491
|
-
});
|
|
6526
|
+
}, previewIconNode);
|
|
6492
6527
|
}
|
|
6493
6528
|
if (splitButtonEnabled) {
|
|
6494
6529
|
buttons.push({
|
|
@@ -6529,6 +6564,11 @@ const emptyHeader = {
|
|
|
6529
6564
|
className: EmptyGroupHeader,
|
|
6530
6565
|
type: Div
|
|
6531
6566
|
};
|
|
6567
|
+
const closeIconNode = {
|
|
6568
|
+
childCount: 0,
|
|
6569
|
+
className: MaskIconClose,
|
|
6570
|
+
type: Div
|
|
6571
|
+
};
|
|
6532
6572
|
const renderEmptyGroupCloseButton = (group, groupIndex) => {
|
|
6533
6573
|
return [emptyHeader, {
|
|
6534
6574
|
childCount: 1,
|
|
@@ -6538,11 +6578,7 @@ const renderEmptyGroupCloseButton = (group, groupIndex) => {
|
|
|
6538
6578
|
onClick: HandleClickAction,
|
|
6539
6579
|
title: closeEditorGroup(),
|
|
6540
6580
|
type: Button$2
|
|
6541
|
-
},
|
|
6542
|
-
childCount: 0,
|
|
6543
|
-
className: MaskIconClose,
|
|
6544
|
-
type: Div
|
|
6545
|
-
}];
|
|
6581
|
+
}, closeIconNode];
|
|
6546
6582
|
};
|
|
6547
6583
|
|
|
6548
6584
|
const renderWaterMark = groupId => {
|
|
@@ -6565,7 +6601,7 @@ const renderEmptyEditorGroup = (group, groupIndex, style, closeButtonEnabled = t
|
|
|
6565
6601
|
const closeButtonDom = closeButtonEnabled ? renderEmptyGroupCloseButton(group) : [];
|
|
6566
6602
|
return [{
|
|
6567
6603
|
childCount: closeButtonEnabled ? 2 : 1,
|
|
6568
|
-
className:
|
|
6604
|
+
className: EditorGroupEmpty,
|
|
6569
6605
|
'data-groupId': String(group.id),
|
|
6570
6606
|
onContextMenu: HandleContextMenu,
|
|
6571
6607
|
style,
|
|
@@ -6574,6 +6610,11 @@ const renderEmptyEditorGroup = (group, groupIndex, style, closeButtonEnabled = t
|
|
|
6574
6610
|
}, ...closeButtonDom, ...renderWaterMark(group.id)];
|
|
6575
6611
|
};
|
|
6576
6612
|
|
|
6613
|
+
const editorContainerNode = {
|
|
6614
|
+
childCount: 1,
|
|
6615
|
+
className: EditorContainer,
|
|
6616
|
+
type: Div
|
|
6617
|
+
};
|
|
6577
6618
|
const renderEditorGroup = (group, groupIndex, splitButtonEnabled = false, sizeProperty = 'width', closeButtonEnabled = true) => {
|
|
6578
6619
|
const activeTab = group.tabs.find(tab => tab.id === group.activeTabId);
|
|
6579
6620
|
const style = `${sizeProperty}:${group.size}%;`;
|
|
@@ -6588,11 +6629,7 @@ const renderEditorGroup = (group, groupIndex, splitButtonEnabled = false, sizePr
|
|
|
6588
6629
|
'data-groupId': String(group.id),
|
|
6589
6630
|
style,
|
|
6590
6631
|
type: Div
|
|
6591
|
-
}, ...renderEditorGroupHeader(group, groupIndex, splitButtonEnabled),
|
|
6592
|
-
childCount: 1,
|
|
6593
|
-
className: EditorContainer,
|
|
6594
|
-
type: Div
|
|
6595
|
-
}, ...renderEditor(activeTab)];
|
|
6632
|
+
}, ...renderEditorGroupHeader(group, groupIndex, splitButtonEnabled), editorContainerNode, ...renderEditor(activeTab)];
|
|
6596
6633
|
};
|
|
6597
6634
|
|
|
6598
6635
|
const getSashClassName = direction => {
|
|
@@ -6617,22 +6654,24 @@ const renderSash = (direction, sashId) => {
|
|
|
6617
6654
|
}];
|
|
6618
6655
|
};
|
|
6619
6656
|
|
|
6657
|
+
const sashCornerNode = {
|
|
6658
|
+
childCount: 0,
|
|
6659
|
+
className: 'SashCorner',
|
|
6660
|
+
onPointerDown: HandleSashCornerPointerDown,
|
|
6661
|
+
role: None$1,
|
|
6662
|
+
type: Button$2
|
|
6663
|
+
};
|
|
6620
6664
|
const renderSashCorner = () => {
|
|
6621
|
-
return
|
|
6622
|
-
childCount: 0,
|
|
6623
|
-
className: 'SashCorner',
|
|
6624
|
-
onPointerDown: HandleSashCornerPointerDown,
|
|
6625
|
-
role: None$1,
|
|
6626
|
-
type: Button$2
|
|
6627
|
-
};
|
|
6665
|
+
return sashCornerNode;
|
|
6628
6666
|
};
|
|
6629
6667
|
|
|
6668
|
+
const mainNode$1 = {
|
|
6669
|
+
childCount: 1,
|
|
6670
|
+
className: Main,
|
|
6671
|
+
type: Div
|
|
6672
|
+
};
|
|
6630
6673
|
const renderSingleEditorGroup = (layout, splitButtonEnabled, sizeProperty = 'width') => {
|
|
6631
|
-
return [
|
|
6632
|
-
childCount: 1,
|
|
6633
|
-
className: Main,
|
|
6634
|
-
type: Div
|
|
6635
|
-
}, ...renderEditorGroup(layout.groups[0], 0, splitButtonEnabled, sizeProperty, false)];
|
|
6674
|
+
return [mainNode$1, ...renderEditorGroup(layout.groups[0], 0, splitButtonEnabled, sizeProperty, false)];
|
|
6636
6675
|
};
|
|
6637
6676
|
|
|
6638
6677
|
const getDirectionClassName = (direction, isSplit) => {
|
|
@@ -6643,7 +6682,12 @@ const getDirectionClassName = (direction, isSplit) => {
|
|
|
6643
6682
|
};
|
|
6644
6683
|
const getContainerClassName = (direction, childCount) => {
|
|
6645
6684
|
const directionClassName = getDirectionClassName(direction, childCount > 1);
|
|
6646
|
-
return directionClassName ?
|
|
6685
|
+
return directionClassName ? mergeClassNames(EDITOR_GROUPS_CONTAINER, directionClassName) : EDITOR_GROUPS_CONTAINER;
|
|
6686
|
+
};
|
|
6687
|
+
const mainNode = {
|
|
6688
|
+
childCount: 1,
|
|
6689
|
+
className: Main,
|
|
6690
|
+
type: Div
|
|
6647
6691
|
};
|
|
6648
6692
|
const getSizeProperty = direction => {
|
|
6649
6693
|
return direction === Vertical ? 'height' : 'width';
|
|
@@ -6717,11 +6761,7 @@ const getMainAreaVirtualDom = (layout, splitButtonEnabled = false) => {
|
|
|
6717
6761
|
}
|
|
6718
6762
|
const editorGroupsContainerClassName = getContainerClassName(direction, groups.length);
|
|
6719
6763
|
if (groups.length === 0) {
|
|
6720
|
-
return [{
|
|
6721
|
-
childCount: 1,
|
|
6722
|
-
className: Main,
|
|
6723
|
-
type: Div
|
|
6724
|
-
}, {
|
|
6764
|
+
return [mainNode, {
|
|
6725
6765
|
childCount: 0,
|
|
6726
6766
|
className: editorGroupsContainerClassName,
|
|
6727
6767
|
'data-groupId': '',
|
|
@@ -6736,11 +6776,7 @@ const getMainAreaVirtualDom = (layout, splitButtonEnabled = false) => {
|
|
|
6736
6776
|
} = renderSegmentChildren(direction, groups, splitButtonEnabled);
|
|
6737
6777
|
const sashCorner = getSashCorner(layout);
|
|
6738
6778
|
const sashCornerChildren = sashCorner ? [renderSashCorner()] : [];
|
|
6739
|
-
return [{
|
|
6740
|
-
childCount: 1,
|
|
6741
|
-
className: Main,
|
|
6742
|
-
type: Div
|
|
6743
|
-
}, {
|
|
6779
|
+
return [mainNode, {
|
|
6744
6780
|
childCount: childCount + sashCornerChildren.length,
|
|
6745
6781
|
className: editorGroupsContainerClassName,
|
|
6746
6782
|
role: None$1,
|
|
@@ -6962,6 +6998,13 @@ const reopenEditorWith = async context => {
|
|
|
6962
6998
|
}
|
|
6963
6999
|
};
|
|
6964
7000
|
|
|
7001
|
+
const resize$1 = (state, dimensions) => {
|
|
7002
|
+
return {
|
|
7003
|
+
...state,
|
|
7004
|
+
...dimensions
|
|
7005
|
+
};
|
|
7006
|
+
};
|
|
7007
|
+
|
|
6965
7008
|
const settingsUri = 'app://settings.json';
|
|
6966
7009
|
const saveEditorAndHandleSettingsChange = async tab => {
|
|
6967
7010
|
const editorState = await saveEditor(tab.editorUid);
|
|
@@ -7388,6 +7431,32 @@ const splitUp = (state, groupId) => {
|
|
|
7388
7431
|
return splitEditorGroup$1(state, resolvedGroupId, 'up');
|
|
7389
7432
|
};
|
|
7390
7433
|
|
|
7434
|
+
const pendingLoads = new Map();
|
|
7435
|
+
const loadContent = wrapSerialCommand(loadContent$1);
|
|
7436
|
+
const loadContentTracked = async (uid, ...args) => {
|
|
7437
|
+
const loading = loadContent(uid, ...args);
|
|
7438
|
+
pendingLoads.set(uid, loading);
|
|
7439
|
+
try {
|
|
7440
|
+
await loading;
|
|
7441
|
+
} finally {
|
|
7442
|
+
if (pendingLoads.get(uid) === loading) {
|
|
7443
|
+
pendingLoads.delete(uid);
|
|
7444
|
+
}
|
|
7445
|
+
}
|
|
7446
|
+
};
|
|
7447
|
+
const resize = async (uid, dimensions) => {
|
|
7448
|
+
const loading = pendingLoads.get(uid);
|
|
7449
|
+
if (loading) {
|
|
7450
|
+
await loading;
|
|
7451
|
+
}
|
|
7452
|
+
const instance = get(uid);
|
|
7453
|
+
if (!instance) {
|
|
7454
|
+
return [];
|
|
7455
|
+
}
|
|
7456
|
+
const resizedState = resize$1(instance.newState, dimensions);
|
|
7457
|
+
set(uid, instance.oldState, resizedState);
|
|
7458
|
+
return handleResize(resizedState, dimensions);
|
|
7459
|
+
};
|
|
7391
7460
|
const commandMap = {
|
|
7392
7461
|
'Main.closeActiveEditor': wrapSerialCommand(closeActiveEditor),
|
|
7393
7462
|
'Main.closeAll': wrapSerialCommand(closeAll$1),
|
|
@@ -7445,8 +7514,7 @@ const commandMap = {
|
|
|
7445
7514
|
'MainArea.handleHeaderDoubleClick': wrapSerialCommand(handleHeaderDoubleClick),
|
|
7446
7515
|
'MainArea.handleIconThemeChange': wrapSerialCommand(handleIconThemeChange),
|
|
7447
7516
|
'MainArea.handleModifiedStatusChange': wrapAsyncCommand(handleModifiedStatusChangeWithContext),
|
|
7448
|
-
'MainArea.handleResize':
|
|
7449
|
-
// TODO would need to have a function that returns newstate as well as commands
|
|
7517
|
+
'MainArea.handleResize': resize,
|
|
7450
7518
|
'MainArea.handleSashCornerPointerDown': wrapSerialCommand(handleSashCornerPointerDown),
|
|
7451
7519
|
'MainArea.handleSashCornerPointerMove': wrapSerialCommand(handleSashCornerPointerMove),
|
|
7452
7520
|
'MainArea.handleSashCornerPointerUp': wrapSerialCommand(handleSashCornerPointerUp),
|
|
@@ -7459,7 +7527,7 @@ const commandMap = {
|
|
|
7459
7527
|
'MainArea.handleWorkspaceRefresh': wrapAsyncCommand(handleWorkspaceRefreshWithContext),
|
|
7460
7528
|
'MainArea.hasActiveTextEditor': wrapGetter(hasActiveTextEditor),
|
|
7461
7529
|
'MainArea.initialize': initialize,
|
|
7462
|
-
'MainArea.loadContent':
|
|
7530
|
+
'MainArea.loadContent': loadContentTracked,
|
|
7463
7531
|
'MainArea.moveIntoNewWindow': wrapSerialCommand(moveIntoNewWindow),
|
|
7464
7532
|
'MainArea.newFile': wrapSerialCommand(newFile),
|
|
7465
7533
|
'MainArea.newWindow': wrapSerialCommand(newWindow),
|
|
@@ -7470,7 +7538,7 @@ const commandMap = {
|
|
|
7470
7538
|
'MainArea.render2': render2,
|
|
7471
7539
|
'MainArea.renderEventListeners': renderEventListeners,
|
|
7472
7540
|
'MainArea.reopenEditorWith': wrapSerialAsyncCommand(reopenEditorWith),
|
|
7473
|
-
'MainArea.resize':
|
|
7541
|
+
'MainArea.resize': resize,
|
|
7474
7542
|
'MainArea.restoreClosedTab': wrapSerialCommand(restoreClosedTab),
|
|
7475
7543
|
'MainArea.save': wrapSerialCommand(save),
|
|
7476
7544
|
'MainArea.saveState': wrapGetter(saveState),
|