@lvce-editor/renderer-process 30.30.2 → 30.32.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 +131 -93
- package/package.json +1 -1
|
@@ -118,25 +118,25 @@ const confirm = message => {
|
|
|
118
118
|
return window.confirm(message);
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
-
const state$
|
|
121
|
+
const state$d = {
|
|
122
122
|
styleSheets: Object.create(null),
|
|
123
123
|
texts: Object.create(null)
|
|
124
124
|
};
|
|
125
125
|
const set$b = (id, sheet) => {
|
|
126
|
-
state$
|
|
126
|
+
state$d.styleSheets[id] = sheet;
|
|
127
127
|
};
|
|
128
128
|
const get$9 = id => {
|
|
129
|
-
return state$
|
|
129
|
+
return state$d.styleSheets[id];
|
|
130
130
|
};
|
|
131
131
|
const setText$2 = (id, text) => {
|
|
132
|
-
state$
|
|
132
|
+
state$d.texts[id] = text;
|
|
133
133
|
};
|
|
134
134
|
const getText = id => {
|
|
135
|
-
return state$
|
|
135
|
+
return state$d.texts[id];
|
|
136
136
|
};
|
|
137
137
|
const remove$5 = id => {
|
|
138
|
-
delete state$
|
|
139
|
-
delete state$
|
|
138
|
+
delete state$d.styleSheets[id];
|
|
139
|
+
delete state$d.texts[id];
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
const addCssStyleSheet = (id, text) => {
|
|
@@ -338,10 +338,10 @@ const createIdGenerator = () => {
|
|
|
338
338
|
};
|
|
339
339
|
const create$J = createIdGenerator();
|
|
340
340
|
|
|
341
|
-
const state$
|
|
341
|
+
const state$c = Object.create(null);
|
|
342
342
|
const acquire$1 = id => {
|
|
343
|
-
const promise = state$
|
|
344
|
-
delete state$
|
|
343
|
+
const promise = state$c[id];
|
|
344
|
+
delete state$c[id];
|
|
345
345
|
return promise;
|
|
346
346
|
};
|
|
347
347
|
const getFileHandles$1 = async ids => {
|
|
@@ -351,7 +351,7 @@ const getFileHandles$1 = async ids => {
|
|
|
351
351
|
};
|
|
352
352
|
const add$1 = promise => {
|
|
353
353
|
const id = create$J();
|
|
354
|
-
state$
|
|
354
|
+
state$c[id] = promise;
|
|
355
355
|
return id;
|
|
356
356
|
};
|
|
357
357
|
const addFileHandle$1 = fileHandle => {
|
|
@@ -547,14 +547,14 @@ const getEventListenerArgs = (params, event) => {
|
|
|
547
547
|
return serialized;
|
|
548
548
|
};
|
|
549
549
|
|
|
550
|
-
const state$
|
|
550
|
+
const state$b = {
|
|
551
551
|
ipc: undefined
|
|
552
552
|
};
|
|
553
553
|
const getIpc = () => {
|
|
554
|
-
return state$
|
|
554
|
+
return state$b.ipc;
|
|
555
555
|
};
|
|
556
556
|
const setIpc = value => {
|
|
557
|
-
state$
|
|
557
|
+
state$b.ipc = value;
|
|
558
558
|
};
|
|
559
559
|
|
|
560
560
|
const nameAnonymousFunction$1 = (fn, name) => {
|
|
@@ -3621,7 +3621,7 @@ const launchRendererWorker = async () => {
|
|
|
3621
3621
|
};
|
|
3622
3622
|
|
|
3623
3623
|
const selector = 'script.RendererWorkerTrace';
|
|
3624
|
-
const state$
|
|
3624
|
+
const state$a = {
|
|
3625
3625
|
enabled: false,
|
|
3626
3626
|
entries: []
|
|
3627
3627
|
};
|
|
@@ -3671,14 +3671,14 @@ const isCommand = value => {
|
|
|
3671
3671
|
};
|
|
3672
3672
|
const initialize = search => {
|
|
3673
3673
|
const searchParams = new URLSearchParams(search);
|
|
3674
|
-
state$
|
|
3675
|
-
state$
|
|
3674
|
+
state$a.enabled = searchParams.has('traceRendererWorker');
|
|
3675
|
+
state$a.entries = [];
|
|
3676
3676
|
};
|
|
3677
3677
|
const record = (direction, method, params) => {
|
|
3678
|
-
if (!state$
|
|
3678
|
+
if (!state$a.enabled) {
|
|
3679
3679
|
return;
|
|
3680
3680
|
}
|
|
3681
|
-
state$
|
|
3681
|
+
state$a.entries.push({
|
|
3682
3682
|
direction,
|
|
3683
3683
|
method,
|
|
3684
3684
|
params: serialize(params),
|
|
@@ -3686,7 +3686,7 @@ const record = (direction, method, params) => {
|
|
|
3686
3686
|
});
|
|
3687
3687
|
};
|
|
3688
3688
|
const listen = rpc => {
|
|
3689
|
-
if (!state$
|
|
3689
|
+
if (!state$a.enabled) {
|
|
3690
3690
|
return;
|
|
3691
3691
|
}
|
|
3692
3692
|
const ipc = rpc.ipc;
|
|
@@ -3701,7 +3701,7 @@ const listen = rpc => {
|
|
|
3701
3701
|
});
|
|
3702
3702
|
};
|
|
3703
3703
|
const exportToDom = () => {
|
|
3704
|
-
if (!state$
|
|
3704
|
+
if (!state$a.enabled) {
|
|
3705
3705
|
return;
|
|
3706
3706
|
}
|
|
3707
3707
|
const existing = document.querySelector(selector);
|
|
@@ -3709,7 +3709,7 @@ const exportToDom = () => {
|
|
|
3709
3709
|
script.className = 'RendererWorkerTrace';
|
|
3710
3710
|
script.type = 'application/json';
|
|
3711
3711
|
script.textContent = JSON.stringify({
|
|
3712
|
-
entries: state$
|
|
3712
|
+
entries: state$a.entries,
|
|
3713
3713
|
version: 1
|
|
3714
3714
|
});
|
|
3715
3715
|
if (!existing) {
|
|
@@ -3717,53 +3717,53 @@ const exportToDom = () => {
|
|
|
3717
3717
|
}
|
|
3718
3718
|
};
|
|
3719
3719
|
const scheduleExport = () => {
|
|
3720
|
-
if (!state$
|
|
3720
|
+
if (!state$a.enabled) {
|
|
3721
3721
|
return;
|
|
3722
3722
|
}
|
|
3723
3723
|
queueMicrotask(exportToDom);
|
|
3724
3724
|
};
|
|
3725
3725
|
|
|
3726
|
-
const state$
|
|
3726
|
+
const state$9 = {
|
|
3727
3727
|
rpc: undefined
|
|
3728
3728
|
};
|
|
3729
3729
|
const hydrate$2 = async () => {
|
|
3730
3730
|
const result = await launchRendererWorker();
|
|
3731
3731
|
if (isError(result)) {
|
|
3732
|
-
state$
|
|
3732
|
+
state$9.rpc = undefined;
|
|
3733
3733
|
return result;
|
|
3734
3734
|
}
|
|
3735
|
-
state$
|
|
3735
|
+
state$9.rpc = result.value;
|
|
3736
3736
|
listen(result.value);
|
|
3737
3737
|
return success(undefined);
|
|
3738
3738
|
};
|
|
3739
3739
|
|
|
3740
3740
|
// TODO needed?
|
|
3741
3741
|
const dispose$j = () => {
|
|
3742
|
-
if (state$
|
|
3743
|
-
state$
|
|
3742
|
+
if (state$9.rpc) {
|
|
3743
|
+
state$9.rpc.dispose();
|
|
3744
3744
|
}
|
|
3745
3745
|
};
|
|
3746
3746
|
const send = (method, ...params) => {
|
|
3747
3747
|
record('sent', method, params);
|
|
3748
3748
|
// @ts-ignore
|
|
3749
|
-
state$
|
|
3749
|
+
state$9.rpc.send(method, ...params);
|
|
3750
3750
|
};
|
|
3751
3751
|
const invoke$1 = (method, ...params) => {
|
|
3752
3752
|
record('sent', method, params);
|
|
3753
3753
|
// @ts-ignore
|
|
3754
|
-
return state$
|
|
3754
|
+
return state$9.rpc.invoke(method, ...params);
|
|
3755
3755
|
};
|
|
3756
3756
|
const sendAndTransfer = message => {
|
|
3757
3757
|
if (Array.isArray(message) && typeof message[0] === 'string') {
|
|
3758
3758
|
record('sent', message[0], message.slice(1));
|
|
3759
3759
|
}
|
|
3760
3760
|
// @ts-expect-error
|
|
3761
|
-
state$
|
|
3761
|
+
state$9.rpc.sendAndTransfer(message);
|
|
3762
3762
|
};
|
|
3763
3763
|
const invokeAndTransfer = (method, ...params) => {
|
|
3764
3764
|
record('sent', method, params);
|
|
3765
3765
|
// @ts-ignore
|
|
3766
|
-
return state$
|
|
3766
|
+
return state$9.rpc.invokeAndTransfer(method, ...params);
|
|
3767
3767
|
};
|
|
3768
3768
|
|
|
3769
3769
|
const RendererWorker = {
|
|
@@ -3774,7 +3774,7 @@ const RendererWorker = {
|
|
|
3774
3774
|
invokeAndTransfer,
|
|
3775
3775
|
send,
|
|
3776
3776
|
sendAndTransfer,
|
|
3777
|
-
state: state$
|
|
3777
|
+
state: state$9
|
|
3778
3778
|
};
|
|
3779
3779
|
|
|
3780
3780
|
const create$u = async ({
|
|
@@ -3893,7 +3893,7 @@ const create$Button = (label, icon) => {
|
|
|
3893
3893
|
};
|
|
3894
3894
|
|
|
3895
3895
|
// TODO this file is not needed when all elements are position fixed
|
|
3896
|
-
const state$
|
|
3896
|
+
const state$8 = {
|
|
3897
3897
|
$Widgets: undefined,
|
|
3898
3898
|
widgetSet: new Set()
|
|
3899
3899
|
};
|
|
@@ -3905,20 +3905,20 @@ const create$Widgets = () => {
|
|
|
3905
3905
|
};
|
|
3906
3906
|
const append$1 = $Element => {
|
|
3907
3907
|
// TODO should not call append in the first place if it is already in DOM
|
|
3908
|
-
if (state$
|
|
3908
|
+
if (state$8.widgetSet.has($Element)) {
|
|
3909
3909
|
return;
|
|
3910
3910
|
}
|
|
3911
|
-
state$
|
|
3912
|
-
if (state$
|
|
3911
|
+
state$8.widgetSet.add($Element);
|
|
3912
|
+
if (state$8.$Widgets) {
|
|
3913
3913
|
// @ts-expect-error
|
|
3914
|
-
state$
|
|
3914
|
+
state$8.$Widgets.append($Element);
|
|
3915
3915
|
} else {
|
|
3916
3916
|
// @ts-expect-error
|
|
3917
|
-
state$
|
|
3917
|
+
state$8.$Widgets = create$Widgets();
|
|
3918
3918
|
// @ts-expect-error
|
|
3919
|
-
state$
|
|
3919
|
+
state$8.$Widgets.append($Element);
|
|
3920
3920
|
// @ts-expect-error
|
|
3921
|
-
document.body.append(state$
|
|
3921
|
+
document.body.append(state$8.$Widgets);
|
|
3922
3922
|
}
|
|
3923
3923
|
};
|
|
3924
3924
|
const remove$1 = $Element => {
|
|
@@ -3926,13 +3926,13 @@ const remove$1 = $Element => {
|
|
|
3926
3926
|
// TODO $Element should always be defined
|
|
3927
3927
|
return;
|
|
3928
3928
|
}
|
|
3929
|
-
state$
|
|
3929
|
+
state$8.widgetSet.delete($Element);
|
|
3930
3930
|
$Element.remove();
|
|
3931
3931
|
// TODO state.$Widgets should always be defined at this point
|
|
3932
|
-
if (state$
|
|
3932
|
+
if (state$8.widgetSet.size === 0 && state$8.$Widgets) {
|
|
3933
3933
|
// @ts-expect-error
|
|
3934
|
-
state$
|
|
3935
|
-
state$
|
|
3934
|
+
state$8.$Widgets.remove();
|
|
3935
|
+
state$8.$Widgets = undefined;
|
|
3936
3936
|
}
|
|
3937
3937
|
};
|
|
3938
3938
|
|
|
@@ -4008,11 +4008,11 @@ const dispose$h = id => {
|
|
|
4008
4008
|
// const $Notification = state.$Notifications
|
|
4009
4009
|
};
|
|
4010
4010
|
|
|
4011
|
-
const state$
|
|
4011
|
+
const state$7 = {
|
|
4012
4012
|
canvasObjects: Object.create(null)
|
|
4013
4013
|
};
|
|
4014
4014
|
const set$6 = (canvasId, canvas) => {
|
|
4015
|
-
state$
|
|
4015
|
+
state$7.canvasObjects[canvasId] = canvas;
|
|
4016
4016
|
};
|
|
4017
4017
|
|
|
4018
4018
|
const create$r = async (canvasId, objectId) => {
|
|
@@ -4111,19 +4111,19 @@ const findIndex = ($Container, $Target) => {
|
|
|
4111
4111
|
return -1;
|
|
4112
4112
|
};
|
|
4113
4113
|
|
|
4114
|
-
const state$
|
|
4114
|
+
const state$6 = {
|
|
4115
4115
|
/**
|
|
4116
4116
|
* @type {HTMLElement|undefined}
|
|
4117
4117
|
*/
|
|
4118
4118
|
$PreviousFocusElement: undefined};
|
|
4119
4119
|
const setElement = $Element => {
|
|
4120
|
-
state$
|
|
4120
|
+
state$6.$PreviousFocusElement = $Element;
|
|
4121
4121
|
};
|
|
4122
4122
|
const getElement = () => {
|
|
4123
|
-
return state$
|
|
4123
|
+
return state$6.$PreviousFocusElement;
|
|
4124
4124
|
};
|
|
4125
4125
|
|
|
4126
|
-
const focus$
|
|
4126
|
+
const focus$e = $Element => {
|
|
4127
4127
|
if ($Element === document.activeElement) {
|
|
4128
4128
|
return;
|
|
4129
4129
|
}
|
|
@@ -4209,7 +4209,7 @@ const FocusOutput = 28;
|
|
|
4209
4209
|
|
|
4210
4210
|
// TODO keyboard handling
|
|
4211
4211
|
|
|
4212
|
-
const state$
|
|
4212
|
+
const state$5 = {
|
|
4213
4213
|
$$Menus: [],
|
|
4214
4214
|
$BackDrop: undefined,
|
|
4215
4215
|
anchorTime: -1,
|
|
@@ -4220,7 +4220,7 @@ const state$4 = {
|
|
|
4220
4220
|
};
|
|
4221
4221
|
const getLevel = $Menu => {
|
|
4222
4222
|
// @ts-expect-error
|
|
4223
|
-
return state$
|
|
4223
|
+
return state$5.$$Menus.indexOf($Menu);
|
|
4224
4224
|
};
|
|
4225
4225
|
const handleMouseDown$4 = event => {
|
|
4226
4226
|
const $Target = event.target;
|
|
@@ -4286,10 +4286,10 @@ const handleMouseLeave = event => {
|
|
|
4286
4286
|
|
|
4287
4287
|
// const handleBlur = (event) => {}
|
|
4288
4288
|
const handleKeyDown$4 = event => {
|
|
4289
|
-
state$
|
|
4289
|
+
state$5.handleKeyDown(event);
|
|
4290
4290
|
};
|
|
4291
4291
|
const handleFocusOut$1 = event => {
|
|
4292
|
-
state$
|
|
4292
|
+
state$5.handleFocusOut(event);
|
|
4293
4293
|
};
|
|
4294
4294
|
const create$Menu$1 = () => {
|
|
4295
4295
|
// TODO set aria label on menu (e.g. File, Edit, Selection)
|
|
@@ -4317,7 +4317,7 @@ const create$Menu$1 = () => {
|
|
|
4317
4317
|
return $Menu;
|
|
4318
4318
|
};
|
|
4319
4319
|
const focusIndex = (level, oldFocusedIndex, newFocusedIndex) => {
|
|
4320
|
-
const $Menu = state$
|
|
4320
|
+
const $Menu = state$5.$$Menus[level];
|
|
4321
4321
|
if (oldFocusedIndex !== -1) {
|
|
4322
4322
|
// @ts-expect-error
|
|
4323
4323
|
$Menu.children[oldFocusedIndex].classList.remove('MenuItemFocused');
|
|
@@ -4339,21 +4339,21 @@ const handleBackDropMouseDown = event => {
|
|
|
4339
4339
|
preventDefault(event);
|
|
4340
4340
|
stopPropagation(event);
|
|
4341
4341
|
send(/* Menu.hide */'Menu.hide');
|
|
4342
|
-
if (state$
|
|
4343
|
-
remove$1(state$
|
|
4344
|
-
state$
|
|
4342
|
+
if (state$5.$BackDrop) {
|
|
4343
|
+
remove$1(state$5.$BackDrop);
|
|
4344
|
+
state$5.$BackDrop = undefined;
|
|
4345
4345
|
}
|
|
4346
4346
|
};
|
|
4347
4347
|
const handleContextMenu$7 = event => {
|
|
4348
4348
|
preventDefault(event);
|
|
4349
4349
|
};
|
|
4350
4350
|
const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom = [], mouseBlocking = false) => {
|
|
4351
|
-
if (mouseBlocking && !state$
|
|
4351
|
+
if (mouseBlocking && !state$5.$BackDrop) {
|
|
4352
4352
|
const $BackDrop = create$BackDrop();
|
|
4353
4353
|
$BackDrop.onmousedown = handleBackDropMouseDown;
|
|
4354
4354
|
$BackDrop.oncontextmenu = handleContextMenu$7;
|
|
4355
4355
|
// @ts-expect-error
|
|
4356
|
-
state$
|
|
4356
|
+
state$5.$BackDrop = $BackDrop;
|
|
4357
4357
|
append$1($BackDrop);
|
|
4358
4358
|
}
|
|
4359
4359
|
const $Menu = create$Menu$1();
|
|
@@ -4361,7 +4361,7 @@ const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom = [],
|
|
|
4361
4361
|
setXAndY($Menu, x, y);
|
|
4362
4362
|
$Menu.id = `Menu-${level}`;
|
|
4363
4363
|
if (parentIndex !== -1) {
|
|
4364
|
-
const $ParentMenu = state$
|
|
4364
|
+
const $ParentMenu = state$5.$$Menus[level - 1];
|
|
4365
4365
|
// @ts-expect-error
|
|
4366
4366
|
const $ParentMenuItem = $ParentMenu.children[parentIndex];
|
|
4367
4367
|
$ParentMenuItem.ariaExpanded = True;
|
|
@@ -4369,22 +4369,22 @@ const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom = [],
|
|
|
4369
4369
|
}
|
|
4370
4370
|
|
|
4371
4371
|
// @ts-expect-error
|
|
4372
|
-
state$
|
|
4372
|
+
state$5.$$Menus.push($Menu);
|
|
4373
4373
|
append$1($Menu);
|
|
4374
4374
|
if (level === 0) {
|
|
4375
|
-
focus$
|
|
4375
|
+
focus$e($Menu);
|
|
4376
4376
|
send('Focus.setFocus', FocusMenu);
|
|
4377
4377
|
}
|
|
4378
4378
|
};
|
|
4379
4379
|
const hideSubmenu = level => {
|
|
4380
|
-
const $$ChildMenus = state$
|
|
4380
|
+
const $$ChildMenus = state$5.$$Menus.slice(level);
|
|
4381
4381
|
for (const $ChildMenu of $$ChildMenus) {
|
|
4382
4382
|
remove$1($ChildMenu);
|
|
4383
4383
|
}
|
|
4384
|
-
state$
|
|
4385
|
-
if (state$
|
|
4386
|
-
remove$1(state$
|
|
4387
|
-
state$
|
|
4384
|
+
state$5.$$Menus = state$5.$$Menus.slice(0, level);
|
|
4385
|
+
if (state$5.$$Menus.length === 0 && state$5.$BackDrop) {
|
|
4386
|
+
remove$1(state$5.$BackDrop);
|
|
4387
|
+
state$5.$BackDrop = undefined;
|
|
4388
4388
|
}
|
|
4389
4389
|
};
|
|
4390
4390
|
|
|
@@ -4426,9 +4426,9 @@ const showControlled = ({
|
|
|
4426
4426
|
// TODO menu should not necessarily know about parent (titleBarMenuBar)
|
|
4427
4427
|
// it should be the other way around
|
|
4428
4428
|
// @ts-expect-error
|
|
4429
|
-
state$
|
|
4430
|
-
state$
|
|
4431
|
-
state$
|
|
4429
|
+
state$5.$Parent = $Parent;
|
|
4430
|
+
state$5.handleFocusOut = handleFocusOut;
|
|
4431
|
+
state$5.handleKeyDown = handleKeyDown;
|
|
4432
4432
|
if ($Parent) {
|
|
4433
4433
|
// state.$Menu.ariaLabel=''
|
|
4434
4434
|
// state.$Menu.ariaLabelledBy =$Parent.id
|
|
@@ -4440,13 +4440,13 @@ const showControlled = ({
|
|
|
4440
4440
|
// TODO have function to show submenu
|
|
4441
4441
|
|
|
4442
4442
|
const hide = (restoreFocus = true) => {
|
|
4443
|
-
for (const $Menu of state$
|
|
4443
|
+
for (const $Menu of state$5.$$Menus) {
|
|
4444
4444
|
remove$1($Menu);
|
|
4445
4445
|
}
|
|
4446
|
-
state$
|
|
4447
|
-
if (state$
|
|
4448
|
-
remove$1(state$
|
|
4449
|
-
state$
|
|
4446
|
+
state$5.$$Menus = [];
|
|
4447
|
+
if (state$5.$BackDrop) {
|
|
4448
|
+
remove$1(state$5.$BackDrop);
|
|
4449
|
+
state$5.$BackDrop = undefined;
|
|
4450
4450
|
}
|
|
4451
4451
|
// TODO focus previous item
|
|
4452
4452
|
if (restoreFocus) {
|
|
@@ -5285,25 +5285,25 @@ const set$3 = setComponentUid;
|
|
|
5285
5285
|
const get = getComponentUid;
|
|
5286
5286
|
const fromEvent = getComponentUidFromEvent;
|
|
5287
5287
|
|
|
5288
|
-
const state$
|
|
5288
|
+
const state$4 = {
|
|
5289
5289
|
currentDragInfo: undefined
|
|
5290
5290
|
};
|
|
5291
5291
|
const set$2 = (id, data) => {
|
|
5292
|
-
state$
|
|
5292
|
+
state$4.currentDragInfo = data;
|
|
5293
5293
|
setDragInfo(id, data);
|
|
5294
5294
|
};
|
|
5295
5295
|
const getCurrent = () => {
|
|
5296
|
-
return state$
|
|
5296
|
+
return state$4.currentDragInfo;
|
|
5297
5297
|
};
|
|
5298
5298
|
|
|
5299
|
-
const state$
|
|
5299
|
+
const state$3 = {
|
|
5300
5300
|
identifiers: new Uint32Array()
|
|
5301
5301
|
};
|
|
5302
5302
|
const setIdentifiers$1 = identifiers => {
|
|
5303
|
-
state$
|
|
5303
|
+
state$3.identifiers = identifiers;
|
|
5304
5304
|
};
|
|
5305
5305
|
const getIdentifiers = () => {
|
|
5306
|
-
return state$
|
|
5306
|
+
return state$3.identifiers;
|
|
5307
5307
|
};
|
|
5308
5308
|
|
|
5309
5309
|
// TODO store keybindings as JSON somewhere
|
|
@@ -5321,6 +5321,30 @@ const setIdentifiers = identifiers => {
|
|
|
5321
5321
|
setIdentifiers$1(identifiers);
|
|
5322
5322
|
};
|
|
5323
5323
|
|
|
5324
|
+
const pendingBatches = new Map();
|
|
5325
|
+
const state$2 = {
|
|
5326
|
+
nextTransactionId: 1
|
|
5327
|
+
};
|
|
5328
|
+
const queue = (uid, commands) => {
|
|
5329
|
+
const transactionId = state$2.nextTransactionId++;
|
|
5330
|
+
pendingBatches.set(transactionId, {
|
|
5331
|
+
commands,
|
|
5332
|
+
uid
|
|
5333
|
+
});
|
|
5334
|
+
return transactionId;
|
|
5335
|
+
};
|
|
5336
|
+
const take = (uid, transactionId) => {
|
|
5337
|
+
const batch = pendingBatches.get(transactionId);
|
|
5338
|
+
if (!batch) {
|
|
5339
|
+
throw new Error(`pending viewlet command transaction not found: ${transactionId}`);
|
|
5340
|
+
}
|
|
5341
|
+
if (batch.uid !== uid) {
|
|
5342
|
+
throw new Error(`pending viewlet command transaction ${transactionId} belongs to ${batch.uid}, not ${uid}`);
|
|
5343
|
+
}
|
|
5344
|
+
pendingBatches.delete(transactionId);
|
|
5345
|
+
return batch.commands;
|
|
5346
|
+
};
|
|
5347
|
+
|
|
5324
5348
|
const rememberFocus = rememberFocus$1;
|
|
5325
5349
|
|
|
5326
5350
|
const handleImageLoad = event => {
|
|
@@ -5821,7 +5845,7 @@ const setValue$2 = (state, value) => {
|
|
|
5821
5845
|
const $Input = $Viewlet.querySelector(':scope input');
|
|
5822
5846
|
$Input.value = value;
|
|
5823
5847
|
};
|
|
5824
|
-
const focus$
|
|
5848
|
+
const focus$d = state => {
|
|
5825
5849
|
const {
|
|
5826
5850
|
$Viewlet
|
|
5827
5851
|
} = state;
|
|
@@ -5832,7 +5856,7 @@ const focus$c = state => {
|
|
|
5832
5856
|
const ViewletDefineKeyBinding = {
|
|
5833
5857
|
__proto__: null,
|
|
5834
5858
|
Events: ViewletDefineKeyBindingEvents,
|
|
5835
|
-
focus: focus$
|
|
5859
|
+
focus: focus$d,
|
|
5836
5860
|
setValue: setValue$2
|
|
5837
5861
|
};
|
|
5838
5862
|
|
|
@@ -6194,7 +6218,7 @@ const appendWidget$5 = state => {
|
|
|
6194
6218
|
const dispose$e = state => {
|
|
6195
6219
|
remove$1(state.$Viewlet);
|
|
6196
6220
|
};
|
|
6197
|
-
const focus$
|
|
6221
|
+
const focus$c = (state, key, source) => {
|
|
6198
6222
|
if (!key) {
|
|
6199
6223
|
return;
|
|
6200
6224
|
}
|
|
@@ -6218,7 +6242,7 @@ const ViewletEditorCodeGenerator = {
|
|
|
6218
6242
|
Events: ViewletEditorCodeGeneratorEvents,
|
|
6219
6243
|
appendWidget: appendWidget$5,
|
|
6220
6244
|
dispose: dispose$e,
|
|
6221
|
-
focus: focus$
|
|
6245
|
+
focus: focus$c,
|
|
6222
6246
|
setBounds: setBounds$9
|
|
6223
6247
|
};
|
|
6224
6248
|
|
|
@@ -6846,14 +6870,14 @@ const create$e = () => {
|
|
|
6846
6870
|
};
|
|
6847
6871
|
};
|
|
6848
6872
|
const refresh$1 = (state, context) => {};
|
|
6849
|
-
const focus$
|
|
6873
|
+
const focus$b = state => {};
|
|
6850
6874
|
const dispose$9 = state => {};
|
|
6851
6875
|
|
|
6852
6876
|
const ViewletEmpty = {
|
|
6853
6877
|
__proto__: null,
|
|
6854
6878
|
create: create$e,
|
|
6855
6879
|
dispose: dispose$9,
|
|
6856
|
-
focus: focus$
|
|
6880
|
+
focus: focus$b,
|
|
6857
6881
|
refresh: refresh$1
|
|
6858
6882
|
};
|
|
6859
6883
|
|
|
@@ -6926,6 +6950,9 @@ const setIframeSrc = ($Iframe, src, srcDoc = '') => {
|
|
|
6926
6950
|
}
|
|
6927
6951
|
};
|
|
6928
6952
|
|
|
6953
|
+
const focus$a = state => {
|
|
6954
|
+
state.$Viewlet.focus();
|
|
6955
|
+
};
|
|
6929
6956
|
const setIframe$1 = (state, src, sandbox = [], srcDoc = '', csp = '', credentialless = true, title = '') => {
|
|
6930
6957
|
if (!src && !srcDoc) {
|
|
6931
6958
|
return;
|
|
@@ -6947,6 +6974,7 @@ const setIframe$1 = (state, src, sandbox = [], srcDoc = '', csp = '', credential
|
|
|
6947
6974
|
const ViewletExtensionView = {
|
|
6948
6975
|
__proto__: null,
|
|
6949
6976
|
Events: ViewletExtensionViewEvents,
|
|
6977
|
+
focus: focus$a,
|
|
6950
6978
|
setIframe: setIframe$1
|
|
6951
6979
|
};
|
|
6952
6980
|
|
|
@@ -7541,7 +7569,7 @@ const handleError$2 = (state, error) => {
|
|
|
7541
7569
|
};
|
|
7542
7570
|
const focus$7 = state => {
|
|
7543
7571
|
object(state);
|
|
7544
|
-
focus$
|
|
7572
|
+
focus$e(state.$ViewletOutputContent);
|
|
7545
7573
|
send('Focus.setFocus', FocusOutput);
|
|
7546
7574
|
};
|
|
7547
7575
|
|
|
@@ -8381,8 +8409,8 @@ const openMenu = (state, unFocusIndex, index, level, menuItems, menuFocusedIndex
|
|
|
8381
8409
|
$Viewlet.children[unFocusIndex].removeAttribute(AriaOwns);
|
|
8382
8410
|
}
|
|
8383
8411
|
$Viewlet.children[index].ariaExpanded = True;
|
|
8384
|
-
const $$Menus = state$
|
|
8385
|
-
state$
|
|
8412
|
+
const $$Menus = state$5.$$Menus;
|
|
8413
|
+
state$5.$$Menus = [];
|
|
8386
8414
|
// @ts-expect-error
|
|
8387
8415
|
showControlled({
|
|
8388
8416
|
$Parent: $Viewlet.children[index],
|
|
@@ -9128,6 +9156,12 @@ const attachWindowEvents = () => {
|
|
|
9128
9156
|
const sendMultiple = commands => {
|
|
9129
9157
|
executeCommands(commands);
|
|
9130
9158
|
};
|
|
9159
|
+
const queueCommands = (uid, commands) => {
|
|
9160
|
+
return queue(uid, commands);
|
|
9161
|
+
};
|
|
9162
|
+
const commitPending = (uid, transactionId) => {
|
|
9163
|
+
executeCommands(take(uid, transactionId));
|
|
9164
|
+
};
|
|
9131
9165
|
const dispose$3 = id => {
|
|
9132
9166
|
try {
|
|
9133
9167
|
number(id);
|
|
@@ -9351,6 +9385,7 @@ const commandHandlers = {
|
|
|
9351
9385
|
'Viewlet.appendViewlet': appendViewlet,
|
|
9352
9386
|
'Viewlet.ariaAnnounce': ariaAnnounce,
|
|
9353
9387
|
'Viewlet.attachWindowEvents': attachWindowEvents,
|
|
9388
|
+
'Viewlet.commitPending': commitPending,
|
|
9354
9389
|
'Viewlet.create': create$2,
|
|
9355
9390
|
'Viewlet.createFunctionalRoot': createFunctionalRoot,
|
|
9356
9391
|
'Viewlet.createPlaceholder': createPlaceholder,
|
|
@@ -9490,7 +9525,9 @@ const getFilePathElectron = async file => {
|
|
|
9490
9525
|
|
|
9491
9526
|
const handleMessagePort = async port => {
|
|
9492
9527
|
await create$x({
|
|
9493
|
-
commandMap: {
|
|
9528
|
+
commandMap: {
|
|
9529
|
+
'Viewlet.queueCommands': queueCommands
|
|
9530
|
+
},
|
|
9494
9531
|
messagePort: port
|
|
9495
9532
|
});
|
|
9496
9533
|
};
|
|
@@ -9822,6 +9859,7 @@ const commandMap = {
|
|
|
9822
9859
|
'Viewlet.handleError': handleError$1,
|
|
9823
9860
|
'Viewlet.invoke': invoke,
|
|
9824
9861
|
'Viewlet.loadModule': loadModule,
|
|
9862
|
+
'Viewlet.queueCommands': queueCommands,
|
|
9825
9863
|
'Viewlet.refresh': refresh,
|
|
9826
9864
|
'Viewlet.registerEventListeners': registerEventListeners,
|
|
9827
9865
|
'Viewlet.removeKeyBindings': removeKeyBindings,
|