@lvce-editor/renderer-process 27.0.0 → 29.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.
- package/dist/rendererProcessMain.js +225 -174
- package/package.json +1 -1
|
@@ -76,10 +76,8 @@ const readText = async () => {
|
|
|
76
76
|
const normalizeItems = async items => {
|
|
77
77
|
const normalized = [];
|
|
78
78
|
for (const clipboardItem of items) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
79
|
+
const webTypes = clipboardItem.types.filter(type => type.startsWith('web '));
|
|
80
|
+
for (const type of webTypes) {
|
|
83
81
|
const blob = await clipboardItem.getType(type);
|
|
84
82
|
normalized.push({
|
|
85
83
|
blob,
|
|
@@ -98,11 +96,11 @@ const writeText = async text => {
|
|
|
98
96
|
string(text);
|
|
99
97
|
await navigator.clipboard.writeText(text);
|
|
100
98
|
};
|
|
101
|
-
const
|
|
99
|
+
const toClipboardItem = options => {
|
|
102
100
|
return new ClipboardItem(options);
|
|
103
101
|
};
|
|
104
102
|
const write$1 = async itemOptions => {
|
|
105
|
-
const items = itemOptions.map(
|
|
103
|
+
const items = itemOptions.map(toClipboardItem);
|
|
106
104
|
await navigator.clipboard.write(items);
|
|
107
105
|
};
|
|
108
106
|
const writeImage = async blob => {
|
|
@@ -184,7 +182,7 @@ const uidSymbol = Symbol('uid');
|
|
|
184
182
|
|
|
185
183
|
const getUidTarget = $Element => {
|
|
186
184
|
while ($Element) {
|
|
187
|
-
if ($Element
|
|
185
|
+
if (Object.getOwnPropertyDescriptor($Element, uidSymbol)?.value) {
|
|
188
186
|
return $Element;
|
|
189
187
|
}
|
|
190
188
|
$Element = $Element.parentNode;
|
|
@@ -193,14 +191,18 @@ const getUidTarget = $Element => {
|
|
|
193
191
|
};
|
|
194
192
|
|
|
195
193
|
const setComponentUid = ($Element, uid) => {
|
|
196
|
-
$Element
|
|
194
|
+
Object.defineProperty($Element, uidSymbol, {
|
|
195
|
+
configurable: true,
|
|
196
|
+
value: uid,
|
|
197
|
+
writable: true
|
|
198
|
+
});
|
|
197
199
|
};
|
|
198
200
|
const getComponentUid = $Element => {
|
|
199
201
|
const $Target = getUidTarget($Element);
|
|
200
202
|
if (!$Target) {
|
|
201
203
|
return 0;
|
|
202
204
|
}
|
|
203
|
-
return $Target
|
|
205
|
+
return Object.getOwnPropertyDescriptor($Target, uidSymbol)?.value;
|
|
204
206
|
};
|
|
205
207
|
const getComponentUidFromEvent = event => {
|
|
206
208
|
const {
|
|
@@ -227,10 +229,10 @@ const setDragImage = (dataTransfer, label) => {
|
|
|
227
229
|
dragImage.textContent = label;
|
|
228
230
|
document.body.append(dragImage);
|
|
229
231
|
dataTransfer.setDragImage(dragImage, -10, -10);
|
|
230
|
-
const
|
|
232
|
+
const handleTimeout = () => {
|
|
231
233
|
dragImage.remove();
|
|
232
234
|
};
|
|
233
|
-
setTimeout(
|
|
235
|
+
setTimeout(handleTimeout, 0);
|
|
234
236
|
};
|
|
235
237
|
|
|
236
238
|
const applyDragInfoMaybe = event => {
|
|
@@ -451,10 +453,7 @@ const getEventListenerArg = (param, event) => {
|
|
|
451
453
|
};
|
|
452
454
|
|
|
453
455
|
const getEventListenerArgs = (params, event) => {
|
|
454
|
-
const serialized =
|
|
455
|
-
for (const param of params) {
|
|
456
|
-
serialized.push(getEventListenerArg(param, event));
|
|
457
|
-
}
|
|
456
|
+
const serialized = Array.from(params, param => getEventListenerArg(param, event));
|
|
458
457
|
return serialized;
|
|
459
458
|
};
|
|
460
459
|
|
|
@@ -1257,13 +1256,13 @@ const attachEvent = ($Node, eventMap, key, value, newEventMap) => {
|
|
|
1257
1256
|
if (previous) {
|
|
1258
1257
|
$Node.removeEventListener(keyLower, previous.listener, previous.options);
|
|
1259
1258
|
}
|
|
1260
|
-
|
|
1261
|
-
|
|
1259
|
+
const fn = newEventMap?.[value];
|
|
1260
|
+
if (fn) {
|
|
1262
1261
|
const options = getOptions(fn);
|
|
1263
1262
|
// TODO support event listener options
|
|
1264
|
-
$Node.addEventListener(keyLower,
|
|
1263
|
+
$Node.addEventListener(keyLower, fn, options);
|
|
1265
1264
|
listenersByEvent.set(keyLower, {
|
|
1266
|
-
listener:
|
|
1265
|
+
listener: fn,
|
|
1267
1266
|
options
|
|
1268
1267
|
});
|
|
1269
1268
|
attachedListeners.set($Node, listenersByEvent);
|
|
@@ -1681,7 +1680,7 @@ const getActiveElementInside = $Viewlet => {
|
|
|
1681
1680
|
};
|
|
1682
1681
|
|
|
1683
1682
|
const queryInputs = $Viewlet => {
|
|
1684
|
-
return [...$Viewlet.querySelectorAll('input, textarea, select')];
|
|
1683
|
+
return [...$Viewlet.querySelectorAll(':scope input, :scope textarea, :scope select')];
|
|
1685
1684
|
};
|
|
1686
1685
|
|
|
1687
1686
|
const focusElement = $Element => {
|
|
@@ -1707,7 +1706,7 @@ const createHiddenContainer = (activeElement, focused) => {
|
|
|
1707
1706
|
return $Hidden;
|
|
1708
1707
|
};
|
|
1709
1708
|
const restoreFocusedElement = ($Hidden, $New, focused) => {
|
|
1710
|
-
const $NewFocused = $New.querySelector(`[name="${focused}"]`);
|
|
1709
|
+
const $NewFocused = $New.querySelector(`[name="${CSS.escape(focused)}"]`);
|
|
1711
1710
|
if (!$NewFocused) {
|
|
1712
1711
|
return;
|
|
1713
1712
|
}
|
|
@@ -1742,7 +1741,7 @@ const restoreFocus = ($Viewlet, isRootTree, isTreeFocused, focused) => {
|
|
|
1742
1741
|
return;
|
|
1743
1742
|
}
|
|
1744
1743
|
if (isTreeFocused) {
|
|
1745
|
-
const $Tree = $Viewlet.querySelector('[role="tree"]');
|
|
1744
|
+
const $Tree = $Viewlet.querySelector(':scope [role="tree"]');
|
|
1746
1745
|
if ($Tree) {
|
|
1747
1746
|
// @ts-ignore
|
|
1748
1747
|
focusElement($Tree);
|
|
@@ -1752,7 +1751,7 @@ const restoreFocus = ($Viewlet, isRootTree, isTreeFocused, focused) => {
|
|
|
1752
1751
|
if (!focused) {
|
|
1753
1752
|
return;
|
|
1754
1753
|
}
|
|
1755
|
-
const $Focused = $Viewlet.querySelector(`[name="${focused}"]`);
|
|
1754
|
+
const $Focused = $Viewlet.querySelector(`[name="${CSS.escape(focused)}"]`);
|
|
1756
1755
|
if ($Focused) {
|
|
1757
1756
|
// @ts-ignore
|
|
1758
1757
|
focusElement($Focused);
|
|
@@ -1817,9 +1816,9 @@ const addFileHandle = fileHandle => {
|
|
|
1817
1816
|
const getTitleBarHeight = () => {
|
|
1818
1817
|
if (
|
|
1819
1818
|
// @ts-expect-error
|
|
1820
|
-
navigator.windowControlsOverlay?.getTitlebarAreaRect) {
|
|
1819
|
+
globalThis.navigator.windowControlsOverlay?.getTitlebarAreaRect) {
|
|
1821
1820
|
// @ts-expect-error
|
|
1822
|
-
const titleBarRect = navigator.windowControlsOverlay.getTitlebarAreaRect();
|
|
1821
|
+
const titleBarRect = globalThis.navigator.windowControlsOverlay.getTitlebarAreaRect();
|
|
1823
1822
|
return titleBarRect.height;
|
|
1824
1823
|
}
|
|
1825
1824
|
return 0;
|
|
@@ -1866,9 +1865,17 @@ const hydrate$4 = () => {
|
|
|
1866
1865
|
|
|
1867
1866
|
const shouldLaunchMultipleWorkers = true;
|
|
1868
1867
|
|
|
1868
|
+
const getConfig = () => {
|
|
1869
|
+
const configElement = document.getElementById('Config');
|
|
1870
|
+
if (!configElement?.textContent) {
|
|
1871
|
+
return {};
|
|
1872
|
+
}
|
|
1873
|
+
return JSON.parse(configElement.textContent);
|
|
1874
|
+
};
|
|
1869
1875
|
const getInitData = () => {
|
|
1870
1876
|
const initData = {
|
|
1871
1877
|
Config: {
|
|
1878
|
+
...getConfig(),
|
|
1872
1879
|
shouldLaunchMultipleWorkers: shouldLaunchMultipleWorkers
|
|
1873
1880
|
},
|
|
1874
1881
|
Layout: {
|
|
@@ -2069,7 +2076,7 @@ const getData$1 = event => {
|
|
|
2069
2076
|
};
|
|
2070
2077
|
const wrap = worker => {
|
|
2071
2078
|
let handleMessage;
|
|
2072
|
-
|
|
2079
|
+
const wrapped = {
|
|
2073
2080
|
get onmessage() {
|
|
2074
2081
|
return handleMessage;
|
|
2075
2082
|
},
|
|
@@ -2079,7 +2086,7 @@ const wrap = worker => {
|
|
|
2079
2086
|
const data = getData$1(event);
|
|
2080
2087
|
listener({
|
|
2081
2088
|
data,
|
|
2082
|
-
target:
|
|
2089
|
+
target: wrapped
|
|
2083
2090
|
});
|
|
2084
2091
|
};
|
|
2085
2092
|
} else {
|
|
@@ -2095,6 +2102,7 @@ const wrap = worker => {
|
|
|
2095
2102
|
worker.postMessage(message, transfer);
|
|
2096
2103
|
}
|
|
2097
2104
|
};
|
|
2105
|
+
return wrapped;
|
|
2098
2106
|
};
|
|
2099
2107
|
|
|
2100
2108
|
const IpcParentWithModuleWorker$2 = {
|
|
@@ -2112,7 +2120,10 @@ const create$J = async ({
|
|
|
2112
2120
|
}) => {
|
|
2113
2121
|
string(url);
|
|
2114
2122
|
const portPromise = await new Promise(resolve => {
|
|
2115
|
-
globalThis
|
|
2123
|
+
Object.defineProperty(globalThis, 'acceptPort', {
|
|
2124
|
+
configurable: true,
|
|
2125
|
+
value: resolve
|
|
2126
|
+
});
|
|
2116
2127
|
});
|
|
2117
2128
|
await import(url);
|
|
2118
2129
|
const port = await portPromise;
|
|
@@ -2133,7 +2144,10 @@ const IpcParentWithMessagePort$2 = {
|
|
|
2133
2144
|
|
|
2134
2145
|
const create$I = async url => {
|
|
2135
2146
|
const referencePort = await new Promise(resolve => {
|
|
2136
|
-
globalThis
|
|
2147
|
+
Object.defineProperty(globalThis, 'acceptReferencePort', {
|
|
2148
|
+
configurable: true,
|
|
2149
|
+
value: resolve
|
|
2150
|
+
});
|
|
2137
2151
|
import(url);
|
|
2138
2152
|
});
|
|
2139
2153
|
delete globalThis.acceptReferencePort;
|
|
@@ -3534,7 +3548,7 @@ const create$Widgets = () => {
|
|
|
3534
3548
|
return $Widgets;
|
|
3535
3549
|
};
|
|
3536
3550
|
const append$1 = $Element => {
|
|
3537
|
-
// TODO should not call append in the first place if it is already in
|
|
3551
|
+
// TODO should not call append in the first place if it is already in DOM
|
|
3538
3552
|
if (state$6.widgetSet.has($Element)) {
|
|
3539
3553
|
return;
|
|
3540
3554
|
}
|
|
@@ -3672,7 +3686,7 @@ const Menu = 'menu';
|
|
|
3672
3686
|
const None$1 = 'none';
|
|
3673
3687
|
const Status = 'status';
|
|
3674
3688
|
const TabList = 'tablist';
|
|
3675
|
-
const
|
|
3689
|
+
const Toolbar = 'toolbar';
|
|
3676
3690
|
|
|
3677
3691
|
const create$BackDrop = () => {
|
|
3678
3692
|
const $BackDrop = document.createElement('div');
|
|
@@ -3722,7 +3736,7 @@ const stopPropagation = event => {
|
|
|
3722
3736
|
event.stopPropagation();
|
|
3723
3737
|
};
|
|
3724
3738
|
|
|
3725
|
-
// TODO this module should be called
|
|
3739
|
+
// TODO this module should be called DOM or DOM utils
|
|
3726
3740
|
|
|
3727
3741
|
// TODO this module makes for weird code splitting chunks,
|
|
3728
3742
|
// maybe duplicate the code per file for better chunks
|
|
@@ -3824,8 +3838,8 @@ const FocusOutput = 28;
|
|
|
3824
3838
|
// TODO using .style.top, .style.left causes chrome devtools to show many layout shift -> maybe use transform instead
|
|
3825
3839
|
|
|
3826
3840
|
// TODO when cycling through items, recalculate style is much slower
|
|
3827
|
-
// than in
|
|
3828
|
-
// paint is also faster in
|
|
3841
|
+
// than in VS Code (1.49ms vs 0.33ms)
|
|
3842
|
+
// paint is also faster in VS Code (0.32ms vs 0.14ms)
|
|
3829
3843
|
|
|
3830
3844
|
// TODO focus on menu is not announced to screenreader
|
|
3831
3845
|
|
|
@@ -3964,7 +3978,7 @@ const focusIndex = (level, oldFocusedIndex, newFocusedIndex) => {
|
|
|
3964
3978
|
}
|
|
3965
3979
|
};
|
|
3966
3980
|
|
|
3967
|
-
// TODO replace function that recycles menu
|
|
3981
|
+
// TODO replace function that recycles menu DOM nodes
|
|
3968
3982
|
|
|
3969
3983
|
const handleBackDropMouseDown = event => {
|
|
3970
3984
|
preventDefault(event);
|
|
@@ -3978,7 +3992,7 @@ const handleBackDropMouseDown = event => {
|
|
|
3978
3992
|
const handleContextMenu$7 = event => {
|
|
3979
3993
|
preventDefault(event);
|
|
3980
3994
|
};
|
|
3981
|
-
const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mouseBlocking = false) => {
|
|
3995
|
+
const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom = [], mouseBlocking = false) => {
|
|
3982
3996
|
if (mouseBlocking) {
|
|
3983
3997
|
const $BackDrop = create$BackDrop();
|
|
3984
3998
|
$BackDrop.onmousedown = handleBackDropMouseDown;
|
|
@@ -4007,7 +4021,7 @@ const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mous
|
|
|
4007
4021
|
send('Focus.setFocus', FocusMenu);
|
|
4008
4022
|
}
|
|
4009
4023
|
};
|
|
4010
|
-
const
|
|
4024
|
+
const hideSubmenu = level => {
|
|
4011
4025
|
const $$ChildMenus = state$3.$$Menus.slice(level);
|
|
4012
4026
|
for (const $ChildMenu of $$ChildMenus) {
|
|
4013
4027
|
remove$1($ChildMenu);
|
|
@@ -4053,7 +4067,6 @@ const showControlled = ({
|
|
|
4053
4067
|
x,
|
|
4054
4068
|
y
|
|
4055
4069
|
}) => {
|
|
4056
|
-
// @ts-expect-error
|
|
4057
4070
|
showMenu(x, y, width, height, items, level);
|
|
4058
4071
|
// TODO menu should not necessarily know about parent (titleBarMenuBar)
|
|
4059
4072
|
// it should be the other way around
|
|
@@ -4090,7 +4103,7 @@ const openUrl = url => {
|
|
|
4090
4103
|
window.open(url);
|
|
4091
4104
|
};
|
|
4092
4105
|
const redirectToUrl = url => {
|
|
4093
|
-
window.location.
|
|
4106
|
+
window.location.assign(url);
|
|
4094
4107
|
};
|
|
4095
4108
|
|
|
4096
4109
|
const isElectronUserAgentSpecificMemoryError = error => {
|
|
@@ -4103,9 +4116,9 @@ const isElectronUserAgentSpecificMemoryError = error => {
|
|
|
4103
4116
|
const measureUserAgentSpecificMemory = async () => {
|
|
4104
4117
|
try {
|
|
4105
4118
|
// @ts-expect-error
|
|
4106
|
-
if (performance?.measureUserAgentSpecificMemory) {
|
|
4119
|
+
if (globalThis.performance?.measureUserAgentSpecificMemory) {
|
|
4107
4120
|
// @ts-expect-error
|
|
4108
|
-
const memory = await performance.measureUserAgentSpecificMemory();
|
|
4121
|
+
const memory = await globalThis.performance.measureUserAgentSpecificMemory();
|
|
4109
4122
|
return memory;
|
|
4110
4123
|
}
|
|
4111
4124
|
} catch (error) {
|
|
@@ -4150,7 +4163,7 @@ const getCombinedErrorMessage = (error, message) => {
|
|
|
4150
4163
|
if (message) {
|
|
4151
4164
|
return `${message}: ${error}`;
|
|
4152
4165
|
}
|
|
4153
|
-
return
|
|
4166
|
+
return String(error);
|
|
4154
4167
|
};
|
|
4155
4168
|
|
|
4156
4169
|
const mergeStacks = (parent, child) => {
|
|
@@ -4172,7 +4185,8 @@ const getErrorStack = error => {
|
|
|
4172
4185
|
return error.stack;
|
|
4173
4186
|
}
|
|
4174
4187
|
if (error && error.lineNumber && error.columnNumber && error.fileName) {
|
|
4175
|
-
const
|
|
4188
|
+
const testError = new Error();
|
|
4189
|
+
const normalStackLooksLike = testError.stack;
|
|
4176
4190
|
// @ts-ignore
|
|
4177
4191
|
if (/^[$\w]+@.*/.test(normalStackLooksLike)) {
|
|
4178
4192
|
// firefox stack trace
|
|
@@ -4538,7 +4552,7 @@ const press = options => {
|
|
|
4538
4552
|
keyUp(element, options);
|
|
4539
4553
|
};
|
|
4540
4554
|
|
|
4541
|
-
const
|
|
4555
|
+
const KeyboardActions = {
|
|
4542
4556
|
__proto__: null,
|
|
4543
4557
|
press
|
|
4544
4558
|
};
|
|
@@ -4686,8 +4700,8 @@ const performAction = async (locator, fnName, options) => {
|
|
|
4686
4700
|
}
|
|
4687
4701
|
fn(element, options);
|
|
4688
4702
|
};
|
|
4689
|
-
const
|
|
4690
|
-
const fn =
|
|
4703
|
+
const performKeyboardAction = (fnName, options) => {
|
|
4704
|
+
const fn = KeyboardActions[fnName];
|
|
4691
4705
|
fn(options);
|
|
4692
4706
|
};
|
|
4693
4707
|
const checkSingleElementCondition = async (locator, fnName, options) => {
|
|
@@ -4761,7 +4775,8 @@ const transferToWebView = objectId => {
|
|
|
4761
4775
|
// TODO allow specifying transfer origin from renderer worker
|
|
4762
4776
|
// TODO allow specifing method from renderer worker
|
|
4763
4777
|
const port = acquire(objectId);
|
|
4764
|
-
const
|
|
4778
|
+
const targetUrl = new URL($Iframe.src || location.href, location.href);
|
|
4779
|
+
const targetOrigin = targetUrl.origin;
|
|
4765
4780
|
contentWindow.postMessage({
|
|
4766
4781
|
jsonrpc: '2.0',
|
|
4767
4782
|
method: 'handlePort',
|
|
@@ -4793,7 +4808,7 @@ const getIdentifiers = () => {
|
|
|
4793
4808
|
return state$2.identifiers;
|
|
4794
4809
|
};
|
|
4795
4810
|
|
|
4796
|
-
// TODO store keybindings as
|
|
4811
|
+
// TODO store keybindings as JSON somewhere
|
|
4797
4812
|
|
|
4798
4813
|
// TODO sort keybindings by `when` priority -> focus.editorCompletions: 10, focus.editor:9 etc.
|
|
4799
4814
|
|
|
@@ -4801,7 +4816,7 @@ const getIdentifiers = () => {
|
|
|
4801
4816
|
// could remove some context logic and have less user configuration when these are default
|
|
4802
4817
|
// e.g. arrow down focuses next, arrow up always focuses previous item (like in aria spec)
|
|
4803
4818
|
|
|
4804
|
-
// TODO
|
|
4819
|
+
// TODO UI should only have keys -> commands get resolved inside renderer worker
|
|
4805
4820
|
// TODO should toggle terminal, not only open
|
|
4806
4821
|
|
|
4807
4822
|
const setIdentifiers = identifiers => {
|
|
@@ -5221,7 +5236,7 @@ const setOffsetX = (state, offsetX) => {
|
|
|
5221
5236
|
const {
|
|
5222
5237
|
$Viewlet
|
|
5223
5238
|
} = state;
|
|
5224
|
-
const $ColorPickerSliderThumb = $Viewlet.querySelector('.ColorPickerSliderThumb');
|
|
5239
|
+
const $ColorPickerSliderThumb = $Viewlet.querySelector(':scope .ColorPickerSliderThumb');
|
|
5225
5240
|
setXAndYTransform($ColorPickerSliderThumb, offsetX, 0);
|
|
5226
5241
|
applyUidWorkaround($Viewlet);
|
|
5227
5242
|
};
|
|
@@ -5311,14 +5326,14 @@ const setValue$2 = (state, value) => {
|
|
|
5311
5326
|
const {
|
|
5312
5327
|
$Viewlet
|
|
5313
5328
|
} = state;
|
|
5314
|
-
const $Input = $Viewlet.querySelector('input');
|
|
5329
|
+
const $Input = $Viewlet.querySelector(':scope input');
|
|
5315
5330
|
$Input.value = value;
|
|
5316
5331
|
};
|
|
5317
5332
|
const focus$c = state => {
|
|
5318
5333
|
const {
|
|
5319
5334
|
$Viewlet
|
|
5320
5335
|
} = state;
|
|
5321
|
-
const $Input = $Viewlet.querySelector('input');
|
|
5336
|
+
const $Input = $Viewlet.querySelector(':scope input');
|
|
5322
5337
|
$Input.focus();
|
|
5323
5338
|
};
|
|
5324
5339
|
|
|
@@ -5347,7 +5362,7 @@ const create$p = icon => {
|
|
|
5347
5362
|
};
|
|
5348
5363
|
|
|
5349
5364
|
const create$Button = (label, icon) => {
|
|
5350
|
-
// TODO icon div might not be needed (unnecessary
|
|
5365
|
+
// TODO icon div might not be needed (unnecessary HTML element)
|
|
5351
5366
|
const $Icon = create$p(icon);
|
|
5352
5367
|
const $Button = document.createElement('button');
|
|
5353
5368
|
$Button.className = 'IconButton';
|
|
@@ -5544,14 +5559,14 @@ const ViewletE2eTestEvents = {
|
|
|
5544
5559
|
};
|
|
5545
5560
|
|
|
5546
5561
|
// TODO could use browser view when running in electron
|
|
5547
|
-
const setIframe$
|
|
5562
|
+
const setIframe$3 = (state, src, sandbox = []) => {
|
|
5548
5563
|
if (!src) {
|
|
5549
5564
|
return;
|
|
5550
5565
|
}
|
|
5551
5566
|
const {
|
|
5552
5567
|
$Viewlet
|
|
5553
5568
|
} = state;
|
|
5554
|
-
const $Parent = $Viewlet.querySelector('.E2eTestIframeWrapper');
|
|
5569
|
+
const $Parent = $Viewlet.querySelector(':scope .E2eTestIframeWrapper');
|
|
5555
5570
|
const $Iframe = document.createElement('iframe');
|
|
5556
5571
|
for (const element of sandbox) {
|
|
5557
5572
|
$Iframe.sandbox.add(element);
|
|
@@ -5564,7 +5579,7 @@ const setPreviewTransform = (state, transform) => {
|
|
|
5564
5579
|
const {
|
|
5565
5580
|
$Viewlet
|
|
5566
5581
|
} = state;
|
|
5567
|
-
const $Parent = $Viewlet.querySelector('.E2eTestIframeWrapper');
|
|
5582
|
+
const $Parent = $Viewlet.querySelector(':scope .E2eTestIframeWrapper');
|
|
5568
5583
|
$Parent.style.transform = transform;
|
|
5569
5584
|
};
|
|
5570
5585
|
// export const setPort = (state, portId, origin) => {
|
|
@@ -5587,7 +5602,7 @@ const setPreviewTransform = (state, transform) => {
|
|
|
5587
5602
|
const ViewletE2eTest = {
|
|
5588
5603
|
__proto__: null,
|
|
5589
5604
|
Events: ViewletE2eTestEvents,
|
|
5590
|
-
setIframe: setIframe$
|
|
5605
|
+
setIframe: setIframe$3,
|
|
5591
5606
|
setPreviewTransform
|
|
5592
5607
|
};
|
|
5593
5608
|
|
|
@@ -5635,7 +5650,7 @@ const handleLoad$1 = event => {
|
|
|
5635
5650
|
console.log(event.target.src);
|
|
5636
5651
|
send('E2eTests.handleLoad');
|
|
5637
5652
|
};
|
|
5638
|
-
const setIframe$
|
|
5653
|
+
const setIframe$2 = (state, src, sandbox = []) => {
|
|
5639
5654
|
if (!src) {
|
|
5640
5655
|
return;
|
|
5641
5656
|
}
|
|
@@ -5676,7 +5691,7 @@ const setPort$2 = (state, portId, origin) => {
|
|
|
5676
5691
|
const ViewletE2eTests = {
|
|
5677
5692
|
__proto__: null,
|
|
5678
5693
|
Events: ViewletE2eTestsEvents,
|
|
5679
|
-
setIframe: setIframe$
|
|
5694
|
+
setIframe: setIframe$2,
|
|
5680
5695
|
setPort: setPort$2
|
|
5681
5696
|
};
|
|
5682
5697
|
|
|
@@ -5927,7 +5942,7 @@ const handleError$5 = (state, error) => {
|
|
|
5927
5942
|
const {
|
|
5928
5943
|
$Viewlet
|
|
5929
5944
|
} = state;
|
|
5930
|
-
$Viewlet.textContent =
|
|
5945
|
+
$Viewlet.textContent = String(error);
|
|
5931
5946
|
};
|
|
5932
5947
|
const setBounds$8 = (state, x, y, width, height) => {
|
|
5933
5948
|
const {
|
|
@@ -6010,7 +6025,7 @@ const ViewletEditorCompletionDetails = {
|
|
|
6010
6025
|
setDom: setDom$7
|
|
6011
6026
|
};
|
|
6012
6027
|
|
|
6013
|
-
// TODO not sure whether created
|
|
6028
|
+
// TODO not sure whether created DOM node
|
|
6014
6029
|
// should stay in state or be removed
|
|
6015
6030
|
// one option would result in less memory usage
|
|
6016
6031
|
// the other option would result in less garbage collection
|
|
@@ -6227,7 +6242,7 @@ const setTransform = (state, transform) => {
|
|
|
6227
6242
|
const {
|
|
6228
6243
|
$Viewlet
|
|
6229
6244
|
} = state;
|
|
6230
|
-
const $ImageWrapper = $Viewlet.querySelector('.ImageContent');
|
|
6245
|
+
const $ImageWrapper = $Viewlet.querySelector(':scope .ImageContent');
|
|
6231
6246
|
$ImageWrapper.style.transform = transform;
|
|
6232
6247
|
};
|
|
6233
6248
|
const setDragging = (state, isDragging) => {
|
|
@@ -6411,6 +6426,66 @@ const ViewletError = {
|
|
|
6411
6426
|
setMessage: setMessage$1
|
|
6412
6427
|
};
|
|
6413
6428
|
|
|
6429
|
+
const commandMap$1 = {};
|
|
6430
|
+
|
|
6431
|
+
const ViewletExtensionViewEvents = {
|
|
6432
|
+
__proto__: null,
|
|
6433
|
+
commandMap: commandMap$1
|
|
6434
|
+
};
|
|
6435
|
+
|
|
6436
|
+
const setIframeCredentialless = ($Iframe, credentialless) => {
|
|
6437
|
+
if (credentialless) {
|
|
6438
|
+
// @ts-ignore
|
|
6439
|
+
$Iframe.credentialless = credentialless;
|
|
6440
|
+
}
|
|
6441
|
+
};
|
|
6442
|
+
|
|
6443
|
+
const setIframeCsp = ($Iframe, csp) => {
|
|
6444
|
+
if (csp) {
|
|
6445
|
+
// @ts-ignore
|
|
6446
|
+
$Iframe.csp = csp;
|
|
6447
|
+
}
|
|
6448
|
+
};
|
|
6449
|
+
|
|
6450
|
+
const setIframeSandBox = ($Iframe, sandbox) => {
|
|
6451
|
+
if (sandbox.length === 0) {
|
|
6452
|
+
return;
|
|
6453
|
+
}
|
|
6454
|
+
$Iframe.sandbox.add(...sandbox);
|
|
6455
|
+
};
|
|
6456
|
+
|
|
6457
|
+
const setIframeSrc = ($Iframe, src, srcDoc = '') => {
|
|
6458
|
+
if (src) {
|
|
6459
|
+
$Iframe.src = src;
|
|
6460
|
+
} else if (srcDoc) {
|
|
6461
|
+
$Iframe.srcdoc = srcDoc;
|
|
6462
|
+
}
|
|
6463
|
+
};
|
|
6464
|
+
|
|
6465
|
+
const setIframe$1 = (state, src, sandbox = [], srcDoc = '', csp = '', credentialless = true, title = '') => {
|
|
6466
|
+
if (!src && !srcDoc) {
|
|
6467
|
+
return;
|
|
6468
|
+
}
|
|
6469
|
+
const {
|
|
6470
|
+
$Viewlet
|
|
6471
|
+
} = state;
|
|
6472
|
+
$Viewlet.textContent = '';
|
|
6473
|
+
const $Iframe = document.createElement('iframe');
|
|
6474
|
+
$Iframe.className = 'ExtensionViewIframe';
|
|
6475
|
+
$Iframe.title = title;
|
|
6476
|
+
setIframeCredentialless($Iframe, credentialless);
|
|
6477
|
+
setIframeCsp($Iframe, csp);
|
|
6478
|
+
setIframeSandBox($Iframe, sandbox);
|
|
6479
|
+
setIframeSrc($Iframe, src, srcDoc);
|
|
6480
|
+
$Viewlet.append($Iframe);
|
|
6481
|
+
};
|
|
6482
|
+
|
|
6483
|
+
const ViewletExtensionView = {
|
|
6484
|
+
__proto__: null,
|
|
6485
|
+
Events: ViewletExtensionViewEvents,
|
|
6486
|
+
setIframe: setIframe$1
|
|
6487
|
+
};
|
|
6488
|
+
|
|
6414
6489
|
const handleInput$4 = event => {
|
|
6415
6490
|
const {
|
|
6416
6491
|
target
|
|
@@ -6530,7 +6605,7 @@ const setValue$1 = (state, value) => {
|
|
|
6530
6605
|
const {
|
|
6531
6606
|
$Viewlet
|
|
6532
6607
|
} = state;
|
|
6533
|
-
const $InputBox = $Viewlet.querySelector('.MultilineInputBox');
|
|
6608
|
+
const $InputBox = $Viewlet.querySelector(':scope .MultilineInputBox');
|
|
6534
6609
|
if (!$InputBox) {
|
|
6535
6610
|
return;
|
|
6536
6611
|
}
|
|
@@ -6593,7 +6668,7 @@ const setFocusedIndex$1 = (state, oldFocusedIndex, newFocusedIndex) => {
|
|
|
6593
6668
|
const {
|
|
6594
6669
|
$Viewlet
|
|
6595
6670
|
} = state;
|
|
6596
|
-
const $Locations = $Viewlet.
|
|
6671
|
+
const $Locations = $Viewlet.querySelector(':scope .LocationList');
|
|
6597
6672
|
if (oldFocusedIndex === -1) {
|
|
6598
6673
|
$Locations.classList.remove('FocusOutline');
|
|
6599
6674
|
} else {
|
|
@@ -6703,7 +6778,7 @@ const setValue = (state, value) => {
|
|
|
6703
6778
|
const {
|
|
6704
6779
|
$Viewlet
|
|
6705
6780
|
} = state;
|
|
6706
|
-
const $InputBox = $Viewlet.querySelector('input');
|
|
6781
|
+
const $InputBox = $Viewlet.querySelector(':scope input');
|
|
6707
6782
|
$InputBox.value = value;
|
|
6708
6783
|
};
|
|
6709
6784
|
const setColumnWidths = (state, columnWidth1, columnWidth2, columnWidth3) => {
|
|
@@ -6711,7 +6786,7 @@ const setColumnWidths = (state, columnWidth1, columnWidth2, columnWidth3) => {
|
|
|
6711
6786
|
const {
|
|
6712
6787
|
$Viewlet
|
|
6713
6788
|
} = state;
|
|
6714
|
-
const $$Resizers = $Viewlet.querySelectorAll('.Resizer');
|
|
6789
|
+
const $$Resizers = $Viewlet.querySelectorAll(':scope .Resizer');
|
|
6715
6790
|
const $Resizer1 = $$Resizers[0];
|
|
6716
6791
|
const $Resizer2 = $$Resizers[1];
|
|
6717
6792
|
$Resizer1.style.left = `${paddingLeft + columnWidth1}px`;
|
|
@@ -6858,9 +6933,9 @@ const handleKeyUp = handleKeyUp$1;
|
|
|
6858
6933
|
|
|
6859
6934
|
const create$c = () => {
|
|
6860
6935
|
// TODO use aria role splitter once supported https://github.com/w3c/aria/issues/1348
|
|
6861
|
-
const $
|
|
6862
|
-
$
|
|
6863
|
-
$
|
|
6936
|
+
const $SashSidebar = document.createElement('div');
|
|
6937
|
+
$SashSidebar.className = 'Viewlet Sash SashVertical';
|
|
6938
|
+
$SashSidebar.id = 'SashSideBar';
|
|
6864
6939
|
|
|
6865
6940
|
// TODO use aria role splitter once supported https://github.com/w3c/aria/issues/1348
|
|
6866
6941
|
const $SashPanel = document.createElement('div');
|
|
@@ -6870,19 +6945,19 @@ const create$c = () => {
|
|
|
6870
6945
|
$Viewlet.id = 'Workbench';
|
|
6871
6946
|
$Viewlet.className = 'Viewlet Layout Workbench';
|
|
6872
6947
|
$Viewlet.role = Application;
|
|
6873
|
-
$Viewlet.append($
|
|
6948
|
+
$Viewlet.append($SashSidebar, $SashPanel);
|
|
6874
6949
|
return {
|
|
6875
6950
|
$SashPanel,
|
|
6876
|
-
$
|
|
6951
|
+
$SashSidebar,
|
|
6877
6952
|
$Viewlet
|
|
6878
6953
|
};
|
|
6879
6954
|
};
|
|
6880
6955
|
const attachEvents$2 = state => {
|
|
6881
6956
|
const {
|
|
6882
6957
|
$SashPanel,
|
|
6883
|
-
$
|
|
6958
|
+
$SashSidebar
|
|
6884
6959
|
} = state;
|
|
6885
|
-
attachEvents$6($
|
|
6960
|
+
attachEvents$6($SashSidebar, {
|
|
6886
6961
|
[DoubleClick]: handleSashDoubleClick,
|
|
6887
6962
|
[PointerDown]: handleSashPointerDown
|
|
6888
6963
|
});
|
|
@@ -6898,13 +6973,13 @@ const attachEvents$2 = state => {
|
|
|
6898
6973
|
[Resize]: handleResize
|
|
6899
6974
|
});
|
|
6900
6975
|
};
|
|
6901
|
-
const setSashes = (state,
|
|
6976
|
+
const setSashes = (state, sashSidebar, sashPanel) => {
|
|
6902
6977
|
const {
|
|
6903
6978
|
$SashPanel,
|
|
6904
|
-
$
|
|
6979
|
+
$SashSidebar
|
|
6905
6980
|
} = state;
|
|
6906
|
-
setBounds$a($
|
|
6907
|
-
$
|
|
6981
|
+
setBounds$a($SashSidebar, sashSidebar.x, sashSidebar.y, sashSidebar.width, sashSidebar.height);
|
|
6982
|
+
$SashSidebar.classList.toggle('SashActive', sashSidebar.active);
|
|
6908
6983
|
setBounds$a($SashPanel, sashPanel.x, sashPanel.y, sashPanel.width, sashPanel.height);
|
|
6909
6984
|
$SashPanel.classList.toggle('SashActive', sashPanel.active);
|
|
6910
6985
|
};
|
|
@@ -6933,6 +7008,7 @@ const EditorPlainText = 'EditorPlainText';
|
|
|
6933
7008
|
const EditorWidgetError = 'EditorWidgetError';
|
|
6934
7009
|
const Empty = 'Empty';
|
|
6935
7010
|
const Error$1 = 'Error';
|
|
7011
|
+
const ExtensionView = 'ExtensionView';
|
|
6936
7012
|
const FindWidget = 'FindWidget';
|
|
6937
7013
|
const ImagePreview = 'ImagePreview';
|
|
6938
7014
|
const InlineDiffEditor = 'InlineDiffEditor';
|
|
@@ -6944,7 +7020,7 @@ const Panel = 'Panel';
|
|
|
6944
7020
|
const References = 'References';
|
|
6945
7021
|
const RunAndDebug = 'Run And Debug';
|
|
6946
7022
|
const ScreenCapture = 'ScreenCapture';
|
|
6947
|
-
const
|
|
7023
|
+
const Sidebar$1 = 'SideBar';
|
|
6948
7024
|
const SimpleBrowser = 'SimpleBrowser';
|
|
6949
7025
|
const SourceControl = 'Source Control';
|
|
6950
7026
|
const StatusBar$1 = 'StatusBar';
|
|
@@ -7082,16 +7158,16 @@ const create$a = () => {
|
|
|
7082
7158
|
const $ButtonMaximize = create$Button(UiStrings.Maximize, 'ChevronUp');
|
|
7083
7159
|
// TODO use event delegation
|
|
7084
7160
|
|
|
7085
|
-
const $
|
|
7086
|
-
$
|
|
7087
|
-
$
|
|
7088
|
-
$
|
|
7161
|
+
const $PanelToolbar = document.createElement('div');
|
|
7162
|
+
$PanelToolbar.className = 'PanelToolBar';
|
|
7163
|
+
$PanelToolbar.role = Toolbar;
|
|
7164
|
+
$PanelToolbar.append($ButtonMaximize, $ButtonClose);
|
|
7089
7165
|
const $PanelActions = document.createElement('div');
|
|
7090
7166
|
$PanelActions.className = 'Actions';
|
|
7091
7167
|
$PanelActions.role = 'toolbar';
|
|
7092
7168
|
const $PanelHeader = document.createElement('div');
|
|
7093
7169
|
$PanelHeader.className = 'PanelHeader';
|
|
7094
|
-
$PanelHeader.append($PanelTabs, $PanelActions, $
|
|
7170
|
+
$PanelHeader.append($PanelTabs, $PanelActions, $PanelToolbar);
|
|
7095
7171
|
// const $PanelContent = document.createElement('div')
|
|
7096
7172
|
// $PanelContent.id = 'PanelContent'
|
|
7097
7173
|
const $Viewlet = document.createElement('div');
|
|
@@ -7207,7 +7283,7 @@ const ViewletRunAndDebug = {
|
|
|
7207
7283
|
__proto__: null
|
|
7208
7284
|
};
|
|
7209
7285
|
|
|
7210
|
-
const
|
|
7286
|
+
const handleLoadedMetadata = event => {
|
|
7211
7287
|
// TODO should send event to renderer worker, renderer worker should invoke play method
|
|
7212
7288
|
const {
|
|
7213
7289
|
target
|
|
@@ -7229,7 +7305,7 @@ const setScreenCapture = (state, id) => {
|
|
|
7229
7305
|
const $Video = document.createElement('video');
|
|
7230
7306
|
const screenCapture = get$2(id);
|
|
7231
7307
|
$Video.srcObject = screenCapture;
|
|
7232
|
-
$Video.onloadedmetadata =
|
|
7308
|
+
$Video.onloadedmetadata = handleLoadedMetadata;
|
|
7233
7309
|
$Viewlet.append($Video);
|
|
7234
7310
|
};
|
|
7235
7311
|
|
|
@@ -7239,7 +7315,7 @@ const ViewletScreenCapture = {
|
|
|
7239
7315
|
setScreenCapture
|
|
7240
7316
|
};
|
|
7241
7317
|
|
|
7242
|
-
const
|
|
7318
|
+
const Sidebar = 'Side Bar';
|
|
7243
7319
|
const StatusBar = 'Status Bar';
|
|
7244
7320
|
|
|
7245
7321
|
const handleClickAction = (target, uid) => {
|
|
@@ -7259,44 +7335,44 @@ const handleHeaderClick = event => {
|
|
|
7259
7335
|
};
|
|
7260
7336
|
|
|
7261
7337
|
const create$8 = () => {
|
|
7262
|
-
const $
|
|
7263
|
-
$
|
|
7264
|
-
const $
|
|
7265
|
-
$
|
|
7266
|
-
$
|
|
7338
|
+
const $SidebarTitleAreaTitle = document.createElement('h2');
|
|
7339
|
+
$SidebarTitleAreaTitle.className = 'SideBarTitleAreaTitle';
|
|
7340
|
+
const $SidebarTitleArea = document.createElement('div');
|
|
7341
|
+
$SidebarTitleArea.className = 'SideBarTitleArea';
|
|
7342
|
+
$SidebarTitleArea.append($SidebarTitleAreaTitle);
|
|
7267
7343
|
const $Viewlet = document.createElement('div');
|
|
7268
7344
|
$Viewlet.id = 'SideBar';
|
|
7269
7345
|
$Viewlet.className = 'Viewlet SideBar';
|
|
7270
7346
|
$Viewlet.role = Complementary;
|
|
7271
|
-
$Viewlet.ariaRoleDescription =
|
|
7272
|
-
$Viewlet.append($
|
|
7347
|
+
$Viewlet.ariaRoleDescription = Sidebar;
|
|
7348
|
+
$Viewlet.append($SidebarTitleArea);
|
|
7273
7349
|
return {
|
|
7274
7350
|
$Actions: undefined,
|
|
7275
|
-
$
|
|
7276
|
-
$
|
|
7277
|
-
$
|
|
7278
|
-
$
|
|
7351
|
+
$Sidebar: $Viewlet,
|
|
7352
|
+
$SidebarContent: undefined,
|
|
7353
|
+
$SidebarTitleArea,
|
|
7354
|
+
$SidebarTitleAreaTitle,
|
|
7279
7355
|
$Viewlet
|
|
7280
7356
|
};
|
|
7281
7357
|
};
|
|
7282
7358
|
const attachEvents = state => {
|
|
7283
7359
|
const {
|
|
7284
|
-
$
|
|
7360
|
+
$SidebarTitleArea
|
|
7285
7361
|
} = state;
|
|
7286
|
-
attachEvents$6($
|
|
7362
|
+
attachEvents$6($SidebarTitleArea, {
|
|
7287
7363
|
[Click]: handleHeaderClick
|
|
7288
7364
|
});
|
|
7289
7365
|
};
|
|
7290
7366
|
const dispose$5 = state => {
|
|
7291
7367
|
object(state);
|
|
7292
|
-
state.$
|
|
7368
|
+
state.$Sidebar.replaceChildren();
|
|
7293
7369
|
};
|
|
7294
7370
|
const setTitle = (state, name) => {
|
|
7295
7371
|
const {
|
|
7296
|
-
$
|
|
7372
|
+
$SidebarTitleAreaTitle
|
|
7297
7373
|
} = state;
|
|
7298
|
-
$
|
|
7299
|
-
$
|
|
7374
|
+
$SidebarTitleAreaTitle.title = name;
|
|
7375
|
+
$SidebarTitleAreaTitle.textContent = name;
|
|
7300
7376
|
};
|
|
7301
7377
|
const setActionsDom = (state, actions, parentId, eventMap = {}) => {
|
|
7302
7378
|
if (actions.length === 0) {
|
|
@@ -7304,14 +7380,14 @@ const setActionsDom = (state, actions, parentId, eventMap = {}) => {
|
|
|
7304
7380
|
}
|
|
7305
7381
|
const {
|
|
7306
7382
|
$Actions,
|
|
7307
|
-
$
|
|
7383
|
+
$SidebarTitleArea
|
|
7308
7384
|
} = state;
|
|
7309
7385
|
const $Parent = document.createElement('div');
|
|
7310
7386
|
const $NewViewlet = rememberFocus$1($Parent, actions, {}, parentId);
|
|
7311
7387
|
if ($Actions) {
|
|
7312
7388
|
$Actions.replaceWith($NewViewlet);
|
|
7313
7389
|
} else {
|
|
7314
|
-
$
|
|
7390
|
+
$SidebarTitleArea.append($NewViewlet);
|
|
7315
7391
|
}
|
|
7316
7392
|
state.$Actions = $NewViewlet;
|
|
7317
7393
|
};
|
|
@@ -7319,7 +7395,7 @@ const focus$5 = async () => {
|
|
|
7319
7395
|
// await
|
|
7320
7396
|
};
|
|
7321
7397
|
|
|
7322
|
-
const
|
|
7398
|
+
const ViewletSidebar = {
|
|
7323
7399
|
__proto__: null,
|
|
7324
7400
|
attachEvents,
|
|
7325
7401
|
create: create$8,
|
|
@@ -7511,7 +7587,7 @@ const focus$4 = state => {
|
|
|
7511
7587
|
const {
|
|
7512
7588
|
$Viewlet
|
|
7513
7589
|
} = state;
|
|
7514
|
-
$Viewlet.querySelector('input').focus();
|
|
7590
|
+
$Viewlet.querySelector(':scope input').focus();
|
|
7515
7591
|
};
|
|
7516
7592
|
|
|
7517
7593
|
const ViewletSourceControl = {
|
|
@@ -8093,35 +8169,6 @@ const ViewletWebViewEvents = {
|
|
|
8093
8169
|
returnValue
|
|
8094
8170
|
};
|
|
8095
8171
|
|
|
8096
|
-
const setIframeCredentialless = ($Iframe, credentialless) => {
|
|
8097
|
-
if (credentialless) {
|
|
8098
|
-
// @ts-ignore
|
|
8099
|
-
$Iframe.credentialless = credentialless;
|
|
8100
|
-
}
|
|
8101
|
-
};
|
|
8102
|
-
|
|
8103
|
-
const setIframeCsp = ($Iframe, csp) => {
|
|
8104
|
-
if (csp) {
|
|
8105
|
-
// @ts-ignore
|
|
8106
|
-
$Iframe.csp = csp;
|
|
8107
|
-
}
|
|
8108
|
-
};
|
|
8109
|
-
|
|
8110
|
-
const setIframeSandBox = ($Iframe, sandbox) => {
|
|
8111
|
-
if (sandbox.length === 0) {
|
|
8112
|
-
return;
|
|
8113
|
-
}
|
|
8114
|
-
$Iframe.sandbox.add(...sandbox);
|
|
8115
|
-
};
|
|
8116
|
-
|
|
8117
|
-
const setIframeSrc = ($Iframe, src, srcDoc = '') => {
|
|
8118
|
-
if (src) {
|
|
8119
|
-
$Iframe.src = src;
|
|
8120
|
-
} else if (srcDoc) {
|
|
8121
|
-
$Iframe.srcdoc = srcDoc;
|
|
8122
|
-
}
|
|
8123
|
-
};
|
|
8124
|
-
|
|
8125
8172
|
// TODO could use browser view when running in electron
|
|
8126
8173
|
const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '', credentialless = true) => {
|
|
8127
8174
|
if (!src && !srcDoc) {
|
|
@@ -8130,7 +8177,7 @@ const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '', credentialle
|
|
|
8130
8177
|
const {
|
|
8131
8178
|
$Viewlet
|
|
8132
8179
|
} = state;
|
|
8133
|
-
const $Parent = $Viewlet.querySelector('.WebViewWrapper');
|
|
8180
|
+
const $Parent = $Viewlet.querySelector(':scope .WebViewWrapper');
|
|
8134
8181
|
if (!$Parent) {
|
|
8135
8182
|
throw new Error('webview wrapper not found');
|
|
8136
8183
|
}
|
|
@@ -8206,6 +8253,7 @@ const moduleLoaders = {
|
|
|
8206
8253
|
[Empty]: () => ViewletEmpty,
|
|
8207
8254
|
[EmptyEditor]: () => ViewletEmptyEditor,
|
|
8208
8255
|
[Error$1]: () => ViewletError,
|
|
8256
|
+
[ExtensionView]: () => ViewletExtensionView,
|
|
8209
8257
|
[FindWidget]: () => ViewletFindWidget,
|
|
8210
8258
|
[ImagePreview]: () => ImagePreview$1,
|
|
8211
8259
|
[Implementations]: () => ViewletImplementations,
|
|
@@ -8217,7 +8265,7 @@ const moduleLoaders = {
|
|
|
8217
8265
|
[References]: () => ViewletReferences,
|
|
8218
8266
|
[RunAndDebug]: () => ViewletRunAndDebug,
|
|
8219
8267
|
[ScreenCapture]: () => ViewletScreenCapture,
|
|
8220
|
-
[
|
|
8268
|
+
[Sidebar$1]: () => ViewletSidebar,
|
|
8221
8269
|
[SimpleBrowser]: () => ViewletSimpleBrowser,
|
|
8222
8270
|
[SourceControl]: () => ViewletSourceControl,
|
|
8223
8271
|
[StatusBar$1]: () => ViewletStatusBar,
|
|
@@ -8243,7 +8291,7 @@ const load$1 = moduleId => {
|
|
|
8243
8291
|
|
|
8244
8292
|
const state$1 = {
|
|
8245
8293
|
currentPanelView: undefined,
|
|
8246
|
-
|
|
8294
|
+
currentSidebarView: undefined,
|
|
8247
8295
|
modules: Object.create(null)
|
|
8248
8296
|
};
|
|
8249
8297
|
|
|
@@ -8377,7 +8425,7 @@ const setInputValues = (viewletId, items) => {
|
|
|
8377
8425
|
setElementProperty(viewletId, name, 'value', value);
|
|
8378
8426
|
}
|
|
8379
8427
|
};
|
|
8380
|
-
const
|
|
8428
|
+
const setCheckboxValue = (viewletId, name, value) => {
|
|
8381
8429
|
setElementProperty(viewletId, name, 'checked', value);
|
|
8382
8430
|
};
|
|
8383
8431
|
const setSelectionByName = (viewletId, name, start, end) => {
|
|
@@ -8452,18 +8500,18 @@ const isSpecial = id => {
|
|
|
8452
8500
|
return specialIds.has(id);
|
|
8453
8501
|
};
|
|
8454
8502
|
const createPlaceholder = (viewletId, parentId, top, left, width, height) => {
|
|
8455
|
-
const $
|
|
8456
|
-
$
|
|
8457
|
-
setBounds$a($
|
|
8503
|
+
const $Placeholder = document.createElement('div');
|
|
8504
|
+
$Placeholder.className = `Viewlet ${viewletId}`;
|
|
8505
|
+
setBounds$a($Placeholder, left, top, width, height);
|
|
8458
8506
|
if (isSpecial(viewletId)) {
|
|
8459
|
-
$
|
|
8507
|
+
$Placeholder.id = viewletId;
|
|
8460
8508
|
}
|
|
8461
8509
|
const parentInstance = get$a(parentId);
|
|
8462
8510
|
const $Parent = parentInstance.state.$Viewlet;
|
|
8463
|
-
$Parent.append($
|
|
8511
|
+
$Parent.append($Placeholder);
|
|
8464
8512
|
set$9(viewletId, {
|
|
8465
8513
|
state: {
|
|
8466
|
-
$Viewlet: $
|
|
8514
|
+
$Viewlet: $Placeholder
|
|
8467
8515
|
}
|
|
8468
8516
|
});
|
|
8469
8517
|
};
|
|
@@ -8500,7 +8548,7 @@ const setDom2 = (viewletId, dom) => {
|
|
|
8500
8548
|
uid = get($Viewlet);
|
|
8501
8549
|
} catch {}
|
|
8502
8550
|
}
|
|
8503
|
-
// TODO optimize rendering with virtual
|
|
8551
|
+
// TODO optimize rendering with virtual DOM diffing
|
|
8504
8552
|
const $NewViewlet = rememberFocus($Viewlet, dom, Events, viewletId);
|
|
8505
8553
|
if (uid) {
|
|
8506
8554
|
// @ts-ignore
|
|
@@ -8607,7 +8655,7 @@ const handleError$1 = (id, parentId, message) => {
|
|
|
8607
8655
|
return;
|
|
8608
8656
|
}
|
|
8609
8657
|
if (instance?.state.$Viewlet) {
|
|
8610
|
-
instance.state.$Viewlet.textContent =
|
|
8658
|
+
instance.state.$Viewlet.textContent = String(message);
|
|
8611
8659
|
}
|
|
8612
8660
|
// TODO error should bubble up to until highest possible component
|
|
8613
8661
|
const parentInstance = get$a(parentId);
|
|
@@ -8726,22 +8774,23 @@ const replaceChildren = (parentId, childIds) => {
|
|
|
8726
8774
|
$Parent.replaceChildren($Fragment);
|
|
8727
8775
|
};
|
|
8728
8776
|
const applyLateFocusMaybe = () => {
|
|
8729
|
-
if (focusCallback
|
|
8777
|
+
if (focusCallback === emptyFocusCallback) {
|
|
8778
|
+
return;
|
|
8779
|
+
}
|
|
8780
|
+
const {
|
|
8781
|
+
id,
|
|
8782
|
+
selector
|
|
8783
|
+
} = focusCallback;
|
|
8784
|
+
focusCallback = emptyFocusCallback;
|
|
8785
|
+
const instance = get$a(id);
|
|
8786
|
+
if (instance) {
|
|
8730
8787
|
const {
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
const {
|
|
8738
|
-
$Viewlet
|
|
8739
|
-
} = instance.state;
|
|
8740
|
-
const $Element = $Viewlet.querySelector(selector);
|
|
8741
|
-
if ($Element) {
|
|
8742
|
-
$Element.focus();
|
|
8743
|
-
focusCallback = emptyFocusCallback;
|
|
8744
|
-
}
|
|
8788
|
+
$Viewlet
|
|
8789
|
+
} = instance.state;
|
|
8790
|
+
const $Element = $Viewlet.querySelector(selector);
|
|
8791
|
+
if ($Element) {
|
|
8792
|
+
$Element.focus();
|
|
8793
|
+
focusCallback = emptyFocusCallback;
|
|
8745
8794
|
}
|
|
8746
8795
|
}
|
|
8747
8796
|
};
|
|
@@ -8812,7 +8861,7 @@ const commandHandlers = {
|
|
|
8812
8861
|
'Viewlet.replaceChildren': replaceChildren,
|
|
8813
8862
|
'Viewlet.send': invoke,
|
|
8814
8863
|
'Viewlet.setBounds': setBounds$1,
|
|
8815
|
-
'Viewlet.setCheckBoxValue':
|
|
8864
|
+
'Viewlet.setCheckBoxValue': setCheckboxValue,
|
|
8816
8865
|
'Viewlet.setCss': addCssStyleSheet,
|
|
8817
8866
|
'Viewlet.setDom': setDom,
|
|
8818
8867
|
'Viewlet.setDom2': setDom2,
|
|
@@ -8900,15 +8949,17 @@ const set$1 = title => {
|
|
|
8900
8949
|
|
|
8901
8950
|
// workaround for not being setPointerCapture() not working on
|
|
8902
8951
|
// synthetic events
|
|
8952
|
+
let originalSetPointerCapture;
|
|
8953
|
+
let originalReleasePointerCapture;
|
|
8903
8954
|
const mock = () => {
|
|
8904
|
-
|
|
8905
|
-
|
|
8955
|
+
originalSetPointerCapture = Element.prototype.setPointerCapture;
|
|
8956
|
+
originalReleasePointerCapture = Element.prototype.releasePointerCapture;
|
|
8906
8957
|
Element.prototype.setPointerCapture = () => {};
|
|
8907
8958
|
Element.prototype.releasePointerCapture = () => {};
|
|
8908
8959
|
};
|
|
8909
8960
|
const unmock = () => {
|
|
8910
|
-
Element.prototype.setPointerCapture =
|
|
8911
|
-
Element.prototype.releasePointerCapture =
|
|
8961
|
+
Element.prototype.setPointerCapture = originalSetPointerCapture;
|
|
8962
|
+
Element.prototype.releasePointerCapture = originalReleasePointerCapture;
|
|
8912
8963
|
};
|
|
8913
8964
|
|
|
8914
8965
|
const isFile = value => {
|
|
@@ -9045,7 +9096,7 @@ const commandMap = {
|
|
|
9045
9096
|
'MeasureTextHeight.measureTextHeight': measureTextHeight,
|
|
9046
9097
|
'Menu.focusIndex': focusIndex,
|
|
9047
9098
|
'Menu.hide': hide,
|
|
9048
|
-
'Menu.hideSubMenu':
|
|
9099
|
+
'Menu.hideSubMenu': hideSubmenu,
|
|
9049
9100
|
'Menu.showControlled': showControlled,
|
|
9050
9101
|
'Menu.showMenu': showMenu,
|
|
9051
9102
|
'Meta.setThemeColor': setThemeColor,
|
|
@@ -9067,7 +9118,7 @@ const commandMap = {
|
|
|
9067
9118
|
'TestFrameWork.checkSingleElementCondition': checkSingleElementCondition,
|
|
9068
9119
|
'TestFrameWork.performAction': performAction,
|
|
9069
9120
|
'TestFrameWork.performAction2': performAction2,
|
|
9070
|
-
'TestFrameWork.performKeyBoardAction':
|
|
9121
|
+
'TestFrameWork.performKeyBoardAction': performKeyboardAction,
|
|
9071
9122
|
'TestFrameWork.showOverlay': showOverlay,
|
|
9072
9123
|
'TestFrameWork.transfer': transfer,
|
|
9073
9124
|
'TestFrameWork.transferToWebView': transferToWebView,
|
|
@@ -9345,9 +9396,9 @@ const getIsFirefox = () => {
|
|
|
9345
9396
|
}
|
|
9346
9397
|
if (
|
|
9347
9398
|
// @ts-expect-error
|
|
9348
|
-
navigator.userAgentData?.brands) {
|
|
9399
|
+
globalThis.navigator.userAgentData?.brands) {
|
|
9349
9400
|
// @ts-expect-error
|
|
9350
|
-
return navigator.userAgentData.brands.includes('Firefox');
|
|
9401
|
+
return globalThis.navigator.userAgentData.brands.includes('Firefox');
|
|
9351
9402
|
}
|
|
9352
9403
|
return navigator.userAgent.toLowerCase().includes('firefox');
|
|
9353
9404
|
};
|
|
@@ -9509,7 +9560,7 @@ const handleError = async (error, notify = true, prefix = '') => {
|
|
|
9509
9560
|
};
|
|
9510
9561
|
|
|
9511
9562
|
const isChromeExtensionError = error => {
|
|
9512
|
-
return
|
|
9563
|
+
return String(error) === 'Script error.';
|
|
9513
9564
|
};
|
|
9514
9565
|
|
|
9515
9566
|
const handleUnhandledRejection = event => {
|
|
@@ -9791,7 +9842,7 @@ const create = () => {
|
|
|
9791
9842
|
const $Viewlet = document.createElement('div');
|
|
9792
9843
|
const term = new Dl();
|
|
9793
9844
|
term.open($Viewlet);
|
|
9794
|
-
term.write('Hello from \
|
|
9845
|
+
term.write('Hello from \u{1B}[1;3;31mxterm.js\u{1B}[0m $ ');
|
|
9795
9846
|
return {
|
|
9796
9847
|
$Viewlet
|
|
9797
9848
|
};
|