@lvce-editor/renderer-process 30.69.3 → 30.70.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 +230 -168
- package/package.json +1 -1
|
@@ -2009,102 +2009,6 @@ const initialize = () => {
|
|
|
2009
2009
|
}
|
|
2010
2010
|
};
|
|
2011
2011
|
|
|
2012
|
-
const isAvailable = () => {
|
|
2013
|
-
const tauriWindow = window;
|
|
2014
|
-
return typeof tauriWindow.__TAURI__?.core?.invoke === 'function';
|
|
2015
|
-
};
|
|
2016
|
-
const toggleDevtools = async () => {
|
|
2017
|
-
const tauriWindow = window;
|
|
2018
|
-
const core = tauriWindow.__TAURI__?.core;
|
|
2019
|
-
if (!core) {
|
|
2020
|
-
throw new Error('Tauri is not available');
|
|
2021
|
-
}
|
|
2022
|
-
await core.invoke('toggle_devtools');
|
|
2023
|
-
};
|
|
2024
|
-
const openNewWindow = async () => {
|
|
2025
|
-
const tauriWindow = window;
|
|
2026
|
-
const core = tauriWindow.__TAURI__?.core;
|
|
2027
|
-
if (!core) {
|
|
2028
|
-
throw new Error('Tauri is not available');
|
|
2029
|
-
}
|
|
2030
|
-
await core.invoke('open_new_window');
|
|
2031
|
-
};
|
|
2032
|
-
const openFolder = async () => {
|
|
2033
|
-
const tauriWindow = window;
|
|
2034
|
-
const dialog = tauriWindow.__TAURI__?.dialog;
|
|
2035
|
-
if (!dialog) {
|
|
2036
|
-
throw new Error('Tauri is not available');
|
|
2037
|
-
}
|
|
2038
|
-
return dialog.open({
|
|
2039
|
-
directory: true,
|
|
2040
|
-
multiple: false,
|
|
2041
|
-
title: 'Open Folder'
|
|
2042
|
-
});
|
|
2043
|
-
};
|
|
2044
|
-
|
|
2045
|
-
const getConfiguredDragAndDropWorkerUrl = () => {
|
|
2046
|
-
const workerUrls = getConfiguredWorkerUrl('workerUrls');
|
|
2047
|
-
return workerUrls?.['develop.dragAndDropWorkerPath'] || '';
|
|
2048
|
-
};
|
|
2049
|
-
|
|
2050
|
-
const dragAndDropWorkerUrl = getConfiguredDragAndDropWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/drag-and-drop-worker/dist/dragAndDropWorkerMain.js`;
|
|
2051
|
-
|
|
2052
|
-
const launchDragAndDropWorker = async () => {
|
|
2053
|
-
const generation = getGeneration();
|
|
2054
|
-
const trackedWorker = createRuntimeName('Drag And Drop Worker');
|
|
2055
|
-
try {
|
|
2056
|
-
const {
|
|
2057
|
-
port1,
|
|
2058
|
-
port2
|
|
2059
|
-
} = new MessageChannel();
|
|
2060
|
-
const workerRpc = await create$C({
|
|
2061
|
-
commandMap: {},
|
|
2062
|
-
name: trackedWorker.runtimeName,
|
|
2063
|
-
port: port1,
|
|
2064
|
-
url: dragAndDropWorkerUrl
|
|
2065
|
-
});
|
|
2066
|
-
trackRpc(workerRpc, generation, trackedWorker);
|
|
2067
|
-
const rpc = await create$E({
|
|
2068
|
-
commandMap: commandMapRef,
|
|
2069
|
-
messagePort: port2
|
|
2070
|
-
});
|
|
2071
|
-
return success(rpc);
|
|
2072
|
-
} catch (error) {
|
|
2073
|
-
return error$1(error);
|
|
2074
|
-
}
|
|
2075
|
-
};
|
|
2076
|
-
|
|
2077
|
-
const state$j = {
|
|
2078
|
-
rpc: undefined
|
|
2079
|
-
};
|
|
2080
|
-
const hydrate$3 = async () => {
|
|
2081
|
-
const result = await launchDragAndDropWorker();
|
|
2082
|
-
if (isError(result)) {
|
|
2083
|
-
state$j.rpc = undefined;
|
|
2084
|
-
return result;
|
|
2085
|
-
}
|
|
2086
|
-
state$j.rpc = result.value;
|
|
2087
|
-
return success(undefined);
|
|
2088
|
-
};
|
|
2089
|
-
const handleMessagePort$1 = async port => {
|
|
2090
|
-
if (!state$j.rpc) {
|
|
2091
|
-
const result = await hydrate$3();
|
|
2092
|
-
if (isError(result)) {
|
|
2093
|
-
throw result.error;
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
const rpc = state$j.rpc;
|
|
2097
|
-
if (!rpc) {
|
|
2098
|
-
throw new Error('Drag And Drop Worker failed to initialize');
|
|
2099
|
-
}
|
|
2100
|
-
await rpc.invokeAndTransfer('DragAndDrop.handleMessagePort', port);
|
|
2101
|
-
};
|
|
2102
|
-
const dispose$k = async () => {
|
|
2103
|
-
const rpc = state$j.rpc;
|
|
2104
|
-
state$j.rpc = undefined;
|
|
2105
|
-
await rpc?.dispose();
|
|
2106
|
-
};
|
|
2107
|
-
|
|
2108
2012
|
const uidSymbol = Symbol('uid');
|
|
2109
2013
|
|
|
2110
2014
|
const getUidTarget = $Element => {
|
|
@@ -2225,7 +2129,7 @@ const createIdGenerator = () => {
|
|
|
2225
2129
|
};
|
|
2226
2130
|
const create$A = createIdGenerator();
|
|
2227
2131
|
|
|
2228
|
-
const state$
|
|
2132
|
+
const state$j = Object.create(null);
|
|
2229
2133
|
const retainString = (item, index) => {
|
|
2230
2134
|
const value = new Promise(resolve => {
|
|
2231
2135
|
item.getAsString(resolve);
|
|
@@ -2276,25 +2180,25 @@ const retainItems = dataTransfer => {
|
|
|
2276
2180
|
};
|
|
2277
2181
|
const addItems = items => {
|
|
2278
2182
|
const id = create$A();
|
|
2279
|
-
state$
|
|
2183
|
+
state$j[id] = items;
|
|
2280
2184
|
return id;
|
|
2281
2185
|
};
|
|
2282
2186
|
const add$2 = dataTransfer => {
|
|
2283
2187
|
return addItems(retainItems(dataTransfer));
|
|
2284
2188
|
};
|
|
2285
2189
|
const acquire$2 = id => {
|
|
2286
|
-
const items = state$
|
|
2190
|
+
const items = state$j[id];
|
|
2287
2191
|
if (!items) {
|
|
2288
2192
|
throw new Error(`Drop data not found: ${id}`);
|
|
2289
2193
|
}
|
|
2290
|
-
delete state$
|
|
2194
|
+
delete state$j[id];
|
|
2291
2195
|
return items;
|
|
2292
2196
|
};
|
|
2293
2197
|
|
|
2294
|
-
const state$
|
|
2198
|
+
const state$i = Object.create(null);
|
|
2295
2199
|
const acquire$1 = id => {
|
|
2296
|
-
const promise = state$
|
|
2297
|
-
delete state$
|
|
2200
|
+
const promise = state$i[id];
|
|
2201
|
+
delete state$i[id];
|
|
2298
2202
|
return promise;
|
|
2299
2203
|
};
|
|
2300
2204
|
const getFileHandles = async ids => {
|
|
@@ -2304,7 +2208,7 @@ const getFileHandles = async ids => {
|
|
|
2304
2208
|
};
|
|
2305
2209
|
const add$1 = promise => {
|
|
2306
2210
|
const id = create$A();
|
|
2307
|
-
state$
|
|
2211
|
+
state$i[id] = promise;
|
|
2308
2212
|
return id;
|
|
2309
2213
|
};
|
|
2310
2214
|
const addFileHandle$1 = fileHandle => {
|
|
@@ -2498,14 +2402,14 @@ const getEventListenerArgs = (params, event) => {
|
|
|
2498
2402
|
return serialized;
|
|
2499
2403
|
};
|
|
2500
2404
|
|
|
2501
|
-
const state$
|
|
2405
|
+
const state$h = {
|
|
2502
2406
|
ipc: undefined
|
|
2503
2407
|
};
|
|
2504
2408
|
const getIpc = () => {
|
|
2505
|
-
return state$
|
|
2409
|
+
return state$h.ipc;
|
|
2506
2410
|
};
|
|
2507
2411
|
const setIpc = value => {
|
|
2508
|
-
state$
|
|
2412
|
+
state$h.ipc = value;
|
|
2509
2413
|
};
|
|
2510
2414
|
|
|
2511
2415
|
const nameAnonymousFunction$1 = (fn, name) => {
|
|
@@ -4135,6 +4039,130 @@ const createRenderer = (options = {}) => {
|
|
|
4135
4039
|
};
|
|
4136
4040
|
};
|
|
4137
4041
|
|
|
4042
|
+
const getMenuViewport = uid => {
|
|
4043
|
+
if (uid === undefined) {
|
|
4044
|
+
return {
|
|
4045
|
+
height: window.innerHeight,
|
|
4046
|
+
width: window.innerWidth,
|
|
4047
|
+
x: 0,
|
|
4048
|
+
y: 0
|
|
4049
|
+
};
|
|
4050
|
+
}
|
|
4051
|
+
const element = get$b(uid)?.state.$Viewlet;
|
|
4052
|
+
const workbench = element?.closest('.Workbench');
|
|
4053
|
+
if (!workbench) {
|
|
4054
|
+
throw new Error(`Menu owner workbench not found: ${uid}`);
|
|
4055
|
+
}
|
|
4056
|
+
const {
|
|
4057
|
+
height,
|
|
4058
|
+
width,
|
|
4059
|
+
x,
|
|
4060
|
+
y
|
|
4061
|
+
} = workbench.getBoundingClientRect();
|
|
4062
|
+
return {
|
|
4063
|
+
height,
|
|
4064
|
+
width,
|
|
4065
|
+
x,
|
|
4066
|
+
y
|
|
4067
|
+
};
|
|
4068
|
+
};
|
|
4069
|
+
|
|
4070
|
+
const isAvailable = () => {
|
|
4071
|
+
const tauriWindow = window;
|
|
4072
|
+
return typeof tauriWindow.__TAURI__?.core?.invoke === 'function';
|
|
4073
|
+
};
|
|
4074
|
+
const toggleDevtools = async () => {
|
|
4075
|
+
const tauriWindow = window;
|
|
4076
|
+
const core = tauriWindow.__TAURI__?.core;
|
|
4077
|
+
if (!core) {
|
|
4078
|
+
throw new Error('Tauri is not available');
|
|
4079
|
+
}
|
|
4080
|
+
await core.invoke('toggle_devtools');
|
|
4081
|
+
};
|
|
4082
|
+
const openNewWindow = async () => {
|
|
4083
|
+
const tauriWindow = window;
|
|
4084
|
+
const core = tauriWindow.__TAURI__?.core;
|
|
4085
|
+
if (!core) {
|
|
4086
|
+
throw new Error('Tauri is not available');
|
|
4087
|
+
}
|
|
4088
|
+
await core.invoke('open_new_window');
|
|
4089
|
+
};
|
|
4090
|
+
const openFolder = async () => {
|
|
4091
|
+
const tauriWindow = window;
|
|
4092
|
+
const dialog = tauriWindow.__TAURI__?.dialog;
|
|
4093
|
+
if (!dialog) {
|
|
4094
|
+
throw new Error('Tauri is not available');
|
|
4095
|
+
}
|
|
4096
|
+
return dialog.open({
|
|
4097
|
+
directory: true,
|
|
4098
|
+
multiple: false,
|
|
4099
|
+
title: 'Open Folder'
|
|
4100
|
+
});
|
|
4101
|
+
};
|
|
4102
|
+
|
|
4103
|
+
const getConfiguredDragAndDropWorkerUrl = () => {
|
|
4104
|
+
const workerUrls = getConfiguredWorkerUrl('workerUrls');
|
|
4105
|
+
return workerUrls?.['develop.dragAndDropWorkerPath'] || '';
|
|
4106
|
+
};
|
|
4107
|
+
|
|
4108
|
+
const dragAndDropWorkerUrl = getConfiguredDragAndDropWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/drag-and-drop-worker/dist/dragAndDropWorkerMain.js`;
|
|
4109
|
+
|
|
4110
|
+
const launchDragAndDropWorker = async () => {
|
|
4111
|
+
const generation = getGeneration();
|
|
4112
|
+
const trackedWorker = createRuntimeName('Drag And Drop Worker');
|
|
4113
|
+
try {
|
|
4114
|
+
const {
|
|
4115
|
+
port1,
|
|
4116
|
+
port2
|
|
4117
|
+
} = new MessageChannel();
|
|
4118
|
+
const workerRpc = await create$C({
|
|
4119
|
+
commandMap: {},
|
|
4120
|
+
name: trackedWorker.runtimeName,
|
|
4121
|
+
port: port1,
|
|
4122
|
+
url: dragAndDropWorkerUrl
|
|
4123
|
+
});
|
|
4124
|
+
trackRpc(workerRpc, generation, trackedWorker);
|
|
4125
|
+
const rpc = await create$E({
|
|
4126
|
+
commandMap: commandMapRef,
|
|
4127
|
+
messagePort: port2
|
|
4128
|
+
});
|
|
4129
|
+
return success(rpc);
|
|
4130
|
+
} catch (error) {
|
|
4131
|
+
return error$1(error);
|
|
4132
|
+
}
|
|
4133
|
+
};
|
|
4134
|
+
|
|
4135
|
+
const state$g = {
|
|
4136
|
+
rpc: undefined
|
|
4137
|
+
};
|
|
4138
|
+
const hydrate$3 = async () => {
|
|
4139
|
+
const result = await launchDragAndDropWorker();
|
|
4140
|
+
if (isError(result)) {
|
|
4141
|
+
state$g.rpc = undefined;
|
|
4142
|
+
return result;
|
|
4143
|
+
}
|
|
4144
|
+
state$g.rpc = result.value;
|
|
4145
|
+
return success(undefined);
|
|
4146
|
+
};
|
|
4147
|
+
const handleMessagePort$1 = async port => {
|
|
4148
|
+
if (!state$g.rpc) {
|
|
4149
|
+
const result = await hydrate$3();
|
|
4150
|
+
if (isError(result)) {
|
|
4151
|
+
throw result.error;
|
|
4152
|
+
}
|
|
4153
|
+
}
|
|
4154
|
+
const rpc = state$g.rpc;
|
|
4155
|
+
if (!rpc) {
|
|
4156
|
+
throw new Error('Drag And Drop Worker failed to initialize');
|
|
4157
|
+
}
|
|
4158
|
+
await rpc.invokeAndTransfer('DragAndDrop.handleMessagePort', port);
|
|
4159
|
+
};
|
|
4160
|
+
const dispose$k = async () => {
|
|
4161
|
+
const rpc = state$g.rpc;
|
|
4162
|
+
state$g.rpc = undefined;
|
|
4163
|
+
await rpc?.dispose();
|
|
4164
|
+
};
|
|
4165
|
+
|
|
4138
4166
|
const set$a = setComponentUid;
|
|
4139
4167
|
const get$9 = getComponentUid;
|
|
4140
4168
|
const fromEvent = getComponentUidFromEvent;
|
|
@@ -4453,22 +4481,27 @@ const create$y = async ({
|
|
|
4453
4481
|
url
|
|
4454
4482
|
}) => {
|
|
4455
4483
|
string(url);
|
|
4456
|
-
const
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4484
|
+
const {
|
|
4485
|
+
promise: portPromise,
|
|
4486
|
+
resolve
|
|
4487
|
+
} = withResolvers();
|
|
4488
|
+
Object.defineProperty(globalThis, 'acceptPort', {
|
|
4489
|
+
configurable: true,
|
|
4490
|
+
value: resolve
|
|
4461
4491
|
});
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4492
|
+
try {
|
|
4493
|
+
await import(url);
|
|
4494
|
+
const port = await portPromise;
|
|
4495
|
+
if (!port) {
|
|
4496
|
+
throw new IpcError('port must be defined');
|
|
4497
|
+
}
|
|
4498
|
+
if (!isMessagePort(port)) {
|
|
4499
|
+
throw new IpcError('port must be of type MessagePort');
|
|
4500
|
+
}
|
|
4501
|
+
return port;
|
|
4502
|
+
} finally {
|
|
4503
|
+
delete globalThis.acceptPort;
|
|
4470
4504
|
}
|
|
4471
|
-
return port;
|
|
4472
4505
|
};
|
|
4473
4506
|
|
|
4474
4507
|
const IpcParentWithMessagePort = {
|
|
@@ -4477,15 +4510,20 @@ const IpcParentWithMessagePort = {
|
|
|
4477
4510
|
};
|
|
4478
4511
|
|
|
4479
4512
|
const create$x = async url => {
|
|
4480
|
-
const
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4513
|
+
const {
|
|
4514
|
+
promise,
|
|
4515
|
+
resolve
|
|
4516
|
+
} = withResolvers();
|
|
4517
|
+
Object.defineProperty(globalThis, 'acceptReferencePort', {
|
|
4518
|
+
configurable: true,
|
|
4519
|
+
value: resolve
|
|
4486
4520
|
});
|
|
4487
|
-
|
|
4488
|
-
|
|
4521
|
+
try {
|
|
4522
|
+
await import(url);
|
|
4523
|
+
return await promise;
|
|
4524
|
+
} finally {
|
|
4525
|
+
delete globalThis.acceptReferencePort;
|
|
4526
|
+
}
|
|
4489
4527
|
};
|
|
4490
4528
|
|
|
4491
4529
|
const IpcParentWithReferencePort = {
|
|
@@ -10204,11 +10242,10 @@ const state$4 = {
|
|
|
10204
10242
|
pending: false
|
|
10205
10243
|
};
|
|
10206
10244
|
const waitForReady = async () => {
|
|
10207
|
-
|
|
10245
|
+
const timeout = withResolvers();
|
|
10246
|
+
const timer = setTimeout(() => timeout.reject(new Error('Application restart timed out')), 30_000);
|
|
10208
10247
|
try {
|
|
10209
|
-
await Promise.race([invoke$1('Reload.waitForReady'),
|
|
10210
|
-
timer = setTimeout(() => reject(new Error('Application restart timed out')), 30_000);
|
|
10211
|
-
})]);
|
|
10248
|
+
await Promise.race([invoke$1('Reload.waitForReady'), timeout.promise]);
|
|
10212
10249
|
} finally {
|
|
10213
10250
|
clearTimeout(timer);
|
|
10214
10251
|
}
|
|
@@ -10505,39 +10542,43 @@ const showFilePickerFallback = options => {
|
|
|
10505
10542
|
input.accept = options.accept;
|
|
10506
10543
|
}
|
|
10507
10544
|
document.body.append(input);
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10545
|
+
const {
|
|
10546
|
+
promise,
|
|
10547
|
+
reject,
|
|
10548
|
+
resolve
|
|
10549
|
+
} = withResolvers();
|
|
10550
|
+
const cleanup = () => {
|
|
10551
|
+
input.removeEventListener('change', onChange);
|
|
10552
|
+
input.removeEventListener('cancel', onCancel);
|
|
10553
|
+
input.remove();
|
|
10554
|
+
};
|
|
10555
|
+
const onChange = () => {
|
|
10556
|
+
const files = Array.from(input.files || [], file => ({
|
|
10557
|
+
file,
|
|
10558
|
+
kind: 'file',
|
|
10559
|
+
name: file.name,
|
|
10560
|
+
readonly: true
|
|
10561
|
+
}));
|
|
10562
|
+
cleanup();
|
|
10563
|
+
resolve(files);
|
|
10564
|
+
};
|
|
10565
|
+
const onCancel = () => {
|
|
10566
|
+
cleanup();
|
|
10567
|
+
resolve([]);
|
|
10568
|
+
};
|
|
10569
|
+
try {
|
|
10528
10570
|
input.addEventListener('change', onChange, {
|
|
10529
10571
|
once: true
|
|
10530
10572
|
});
|
|
10531
10573
|
input.addEventListener('cancel', onCancel, {
|
|
10532
10574
|
once: true
|
|
10533
10575
|
});
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
});
|
|
10576
|
+
input.click();
|
|
10577
|
+
} catch (error) {
|
|
10578
|
+
cleanup();
|
|
10579
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
10580
|
+
}
|
|
10581
|
+
return promise;
|
|
10541
10582
|
};
|
|
10542
10583
|
const showSaveFilePicker = options => {
|
|
10543
10584
|
// @ts-expect-error
|
|
@@ -10802,7 +10843,12 @@ const createWithOptions = (type, message, options) => {
|
|
|
10802
10843
|
};
|
|
10803
10844
|
const showWithOptions = (type, message, options) => {
|
|
10804
10845
|
const $Notification = create$NotificationWithOptions(message, options);
|
|
10805
|
-
|
|
10846
|
+
const {
|
|
10847
|
+
promise,
|
|
10848
|
+
reject,
|
|
10849
|
+
resolve
|
|
10850
|
+
} = withResolvers();
|
|
10851
|
+
try {
|
|
10806
10852
|
pendingChoices.set($Notification, resolve);
|
|
10807
10853
|
$Notification.onclick = event => {
|
|
10808
10854
|
const $Target = event.target;
|
|
@@ -10811,7 +10857,10 @@ const showWithOptions = (type, message, options) => {
|
|
|
10811
10857
|
}
|
|
10812
10858
|
};
|
|
10813
10859
|
append$1($Notification);
|
|
10814
|
-
})
|
|
10860
|
+
} catch (error) {
|
|
10861
|
+
reject(error);
|
|
10862
|
+
}
|
|
10863
|
+
return promise;
|
|
10815
10864
|
};
|
|
10816
10865
|
const dispose$3 = id => {
|
|
10817
10866
|
const $Notification = document.getElementById(id);
|
|
@@ -11600,14 +11649,21 @@ const createDropSession = items => {
|
|
|
11600
11649
|
const conditionTimeout = 2000;
|
|
11601
11650
|
const mutationTimeout = 100;
|
|
11602
11651
|
const waitForMutation = maxDelay => {
|
|
11603
|
-
|
|
11604
|
-
|
|
11652
|
+
const {
|
|
11653
|
+
promise,
|
|
11654
|
+
reject,
|
|
11655
|
+
resolve
|
|
11656
|
+
} = withResolvers();
|
|
11657
|
+
let observer;
|
|
11658
|
+
let timeout;
|
|
11659
|
+
try {
|
|
11660
|
+
observer = new MutationObserver(() => {
|
|
11605
11661
|
clearTimeout(timeout);
|
|
11606
|
-
observer
|
|
11662
|
+
observer?.disconnect();
|
|
11607
11663
|
resolve();
|
|
11608
11664
|
});
|
|
11609
|
-
|
|
11610
|
-
observer
|
|
11665
|
+
timeout = setTimeout(() => {
|
|
11666
|
+
observer?.disconnect();
|
|
11611
11667
|
resolve();
|
|
11612
11668
|
}, maxDelay);
|
|
11613
11669
|
observer.observe(document.body, {
|
|
@@ -11616,7 +11672,12 @@ const waitForMutation = maxDelay => {
|
|
|
11616
11672
|
childList: true,
|
|
11617
11673
|
subtree: true
|
|
11618
11674
|
});
|
|
11619
|
-
})
|
|
11675
|
+
} catch (error) {
|
|
11676
|
+
clearTimeout(timeout);
|
|
11677
|
+
observer?.disconnect();
|
|
11678
|
+
reject(error);
|
|
11679
|
+
}
|
|
11680
|
+
return promise;
|
|
11620
11681
|
};
|
|
11621
11682
|
const waitForCondition = async check => {
|
|
11622
11683
|
const endTime = performance.now() + conditionTimeout;
|
|
@@ -12250,6 +12311,7 @@ const commandMap = {
|
|
|
12250
12311
|
'MeasureTextBlockHeight.measureTextBlockHeight': measureTextBlockHeight,
|
|
12251
12312
|
'MeasureTextHeight.measureTextHeight': measureTextHeight,
|
|
12252
12313
|
'Menu.focusIndex': focusIndex,
|
|
12314
|
+
'Menu.getViewport': getMenuViewport,
|
|
12253
12315
|
'Menu.hide': hide,
|
|
12254
12316
|
'Menu.hideSubMenu': hideSubmenu,
|
|
12255
12317
|
'Menu.showControlled': showControlled,
|