@lvce-editor/renderer-process 21.7.0 → 21.9.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 +85 -73
- package/package.json +1 -1
|
@@ -234,6 +234,7 @@ const Option$2 = 'option';
|
|
|
234
234
|
const Code$2 = 'code';
|
|
235
235
|
const Label$2 = 'label';
|
|
236
236
|
const Dt$2 = 'dt';
|
|
237
|
+
const Iframe$1 = 'iframe';
|
|
237
238
|
const Audio$1$1 = 0;
|
|
238
239
|
const Button$1 = 1;
|
|
239
240
|
const Col$1 = 2;
|
|
@@ -289,8 +290,11 @@ const Option$1 = 64;
|
|
|
289
290
|
const Code$1 = 65;
|
|
290
291
|
const Label$1 = 66;
|
|
291
292
|
const Dt$1 = 67;
|
|
293
|
+
const Iframe = 68;
|
|
294
|
+
const Reference$1 = 100;
|
|
292
295
|
const VirtualDomElements$1 = {
|
|
293
296
|
__proto__: null,
|
|
297
|
+
Reference: Reference$1,
|
|
294
298
|
Text: Text$1};
|
|
295
299
|
const getElementTag$1 = type => {
|
|
296
300
|
switch (type) {
|
|
@@ -350,6 +354,8 @@ const getElementTag$1 = type => {
|
|
|
350
354
|
return Hr$2;
|
|
351
355
|
case I$1:
|
|
352
356
|
return I$2;
|
|
357
|
+
case Iframe:
|
|
358
|
+
return Iframe$1;
|
|
353
359
|
case Img$1:
|
|
354
360
|
return Img$2;
|
|
355
361
|
case Input$1:
|
|
@@ -413,6 +419,13 @@ const ElementTagMap = {
|
|
|
413
419
|
const {
|
|
414
420
|
getElementTag
|
|
415
421
|
} = ElementTagMap;
|
|
422
|
+
const instances = Object.create(null);
|
|
423
|
+
const get$1$1 = viewletId => {
|
|
424
|
+
return instances[viewletId];
|
|
425
|
+
};
|
|
426
|
+
const set$1$1 = (viewletId, instance) => {
|
|
427
|
+
instances[viewletId] = instance;
|
|
428
|
+
};
|
|
416
429
|
const getEventListenerOptions$1 = (eventName, value) => {
|
|
417
430
|
if (value.passive) {
|
|
418
431
|
return {
|
|
@@ -468,10 +481,10 @@ const cache$1 = new Map();
|
|
|
468
481
|
const has$1 = listener => {
|
|
469
482
|
return cache$1.has(listener);
|
|
470
483
|
};
|
|
471
|
-
const set$
|
|
484
|
+
const set$8 = (listener, value) => {
|
|
472
485
|
cache$1.set(listener, value);
|
|
473
486
|
};
|
|
474
|
-
const get$
|
|
487
|
+
const get$9 = listener => {
|
|
475
488
|
return cache$1.get(listener);
|
|
476
489
|
};
|
|
477
490
|
const nameAnonymousFunction$1 = (fn, name) => {
|
|
@@ -495,9 +508,9 @@ const getWrappedListener$1 = (listener, returnValue) => {
|
|
|
495
508
|
ipc.send('Viewlet.executeViewletCommand', uid, ...result);
|
|
496
509
|
};
|
|
497
510
|
nameAnonymousFunction$1(wrapped, listener.name);
|
|
498
|
-
set$
|
|
511
|
+
set$8(listener, wrapped);
|
|
499
512
|
}
|
|
500
|
-
return get$
|
|
513
|
+
return get$9(listener);
|
|
501
514
|
};
|
|
502
515
|
const getOptions = fn => {
|
|
503
516
|
if (fn.passive) {
|
|
@@ -634,7 +647,8 @@ const setProps = ($Element, props, eventMap, newEventMap) => {
|
|
|
634
647
|
}
|
|
635
648
|
};
|
|
636
649
|
const {
|
|
637
|
-
Text: Text$2
|
|
650
|
+
Text: Text$2,
|
|
651
|
+
Reference} = VirtualDomElements$1;
|
|
638
652
|
const renderDomTextNode = element => {
|
|
639
653
|
return document.createTextNode(element.text);
|
|
640
654
|
};
|
|
@@ -644,8 +658,15 @@ const renderDomElement = (element, eventMap, newEventMap) => {
|
|
|
644
658
|
setProps($Element, element, eventMap, newEventMap);
|
|
645
659
|
return $Element;
|
|
646
660
|
};
|
|
661
|
+
const renderReferenceNode = element => {
|
|
662
|
+
const instance = get$1$1(element.uid);
|
|
663
|
+
const $Node = instance.state.$Viewlet;
|
|
664
|
+
return $Node;
|
|
665
|
+
};
|
|
647
666
|
const render$1 = (element, eventMap, newEventMap) => {
|
|
648
667
|
switch (element.type) {
|
|
668
|
+
case Reference:
|
|
669
|
+
return renderReferenceNode(element);
|
|
649
670
|
case Text$2:
|
|
650
671
|
return renderDomTextNode(element);
|
|
651
672
|
default:
|
|
@@ -1187,13 +1208,6 @@ const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
|
1187
1208
|
stopIgnore();
|
|
1188
1209
|
return $Viewlet;
|
|
1189
1210
|
};
|
|
1190
|
-
const instances = Object.create(null);
|
|
1191
|
-
const get$9 = viewletId => {
|
|
1192
|
-
return instances[viewletId];
|
|
1193
|
-
};
|
|
1194
|
-
const set$8 = (viewletId, instance) => {
|
|
1195
|
-
instances[viewletId] = instance;
|
|
1196
|
-
};
|
|
1197
1211
|
|
|
1198
1212
|
const get$8 = ids => {
|
|
1199
1213
|
return getFileHandles$1(ids);
|
|
@@ -1934,7 +1948,7 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
1934
1948
|
return promise;
|
|
1935
1949
|
};
|
|
1936
1950
|
const Message$1 = 3;
|
|
1937
|
-
const create$5$
|
|
1951
|
+
const create$5$2 = async ({
|
|
1938
1952
|
isMessagePortOpen,
|
|
1939
1953
|
messagePort
|
|
1940
1954
|
}) => {
|
|
@@ -1985,7 +1999,7 @@ const wrap$5 = messagePort => {
|
|
|
1985
1999
|
};
|
|
1986
2000
|
const IpcParentWithMessagePort$1 = {
|
|
1987
2001
|
__proto__: null,
|
|
1988
|
-
create: create$5$
|
|
2002
|
+
create: create$5$2,
|
|
1989
2003
|
signal: signal$1,
|
|
1990
2004
|
wrap: wrap$5
|
|
1991
2005
|
};
|
|
@@ -2430,14 +2444,14 @@ const execute = (command, ...args) => {
|
|
|
2430
2444
|
};
|
|
2431
2445
|
|
|
2432
2446
|
const Two = '2.0';
|
|
2433
|
-
const create$
|
|
2447
|
+
const create$t$1 = (method, params) => {
|
|
2434
2448
|
return {
|
|
2435
2449
|
jsonrpc: Two,
|
|
2436
2450
|
method,
|
|
2437
2451
|
params
|
|
2438
2452
|
};
|
|
2439
2453
|
};
|
|
2440
|
-
const create$
|
|
2454
|
+
const create$s$1 = (id, method, params) => {
|
|
2441
2455
|
const message = {
|
|
2442
2456
|
id,
|
|
2443
2457
|
jsonrpc: Two,
|
|
@@ -2447,14 +2461,14 @@ const create$r$1 = (id, method, params) => {
|
|
|
2447
2461
|
return message;
|
|
2448
2462
|
};
|
|
2449
2463
|
let id = 0;
|
|
2450
|
-
const create$
|
|
2464
|
+
const create$r$1 = () => {
|
|
2451
2465
|
return ++id;
|
|
2452
2466
|
};
|
|
2453
2467
|
|
|
2454
2468
|
/* eslint-disable n/no-unsupported-features/es-syntax */
|
|
2455
2469
|
|
|
2456
2470
|
const registerPromise = map => {
|
|
2457
|
-
const id = create$
|
|
2471
|
+
const id = create$r$1();
|
|
2458
2472
|
const {
|
|
2459
2473
|
promise,
|
|
2460
2474
|
resolve
|
|
@@ -2472,7 +2486,7 @@ const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer)
|
|
|
2472
2486
|
id,
|
|
2473
2487
|
promise
|
|
2474
2488
|
} = registerPromise(callbacks);
|
|
2475
|
-
const message = create$
|
|
2489
|
+
const message = create$s$1(id, method, params);
|
|
2476
2490
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
2477
2491
|
ipc.sendAndTransfer(message);
|
|
2478
2492
|
} else {
|
|
@@ -2508,7 +2522,7 @@ const createRpc = ipc => {
|
|
|
2508
2522
|
* @deprecated
|
|
2509
2523
|
*/
|
|
2510
2524
|
send(method, ...params) {
|
|
2511
|
-
const message = create$
|
|
2525
|
+
const message = create$t$1(method, params);
|
|
2512
2526
|
ipc.send(message);
|
|
2513
2527
|
}
|
|
2514
2528
|
};
|
|
@@ -2544,7 +2558,7 @@ const unhandleIpc = ipc => {
|
|
|
2544
2558
|
ipc.onmessage = null;
|
|
2545
2559
|
}
|
|
2546
2560
|
};
|
|
2547
|
-
const create$
|
|
2561
|
+
const create$m$1 = async ({
|
|
2548
2562
|
commandMap,
|
|
2549
2563
|
window
|
|
2550
2564
|
}) => {
|
|
@@ -2557,12 +2571,12 @@ const create$l$1 = async ({
|
|
|
2557
2571
|
};
|
|
2558
2572
|
const ElectronWindowRpcClient = {
|
|
2559
2573
|
__proto__: null,
|
|
2560
|
-
create: create$
|
|
2574
|
+
create: create$m$1
|
|
2561
2575
|
};
|
|
2562
2576
|
const isWorker = value => {
|
|
2563
2577
|
return value instanceof Worker;
|
|
2564
2578
|
};
|
|
2565
|
-
const create$
|
|
2579
|
+
const create$c$1 = async ({
|
|
2566
2580
|
commandMap,
|
|
2567
2581
|
name,
|
|
2568
2582
|
url
|
|
@@ -2583,9 +2597,9 @@ const create$b$1 = async ({
|
|
|
2583
2597
|
};
|
|
2584
2598
|
const ModuleWorkerRpcParent = {
|
|
2585
2599
|
__proto__: null,
|
|
2586
|
-
create: create$
|
|
2600
|
+
create: create$c$1
|
|
2587
2601
|
};
|
|
2588
|
-
const create$
|
|
2602
|
+
const create$b$1 = async ({
|
|
2589
2603
|
commandMap,
|
|
2590
2604
|
name,
|
|
2591
2605
|
port,
|
|
@@ -2609,9 +2623,9 @@ const create$a$1 = async ({
|
|
|
2609
2623
|
};
|
|
2610
2624
|
const ModuleWorkerWithMessagePortRpcParent = {
|
|
2611
2625
|
__proto__: null,
|
|
2612
|
-
create: create$
|
|
2626
|
+
create: create$b$1
|
|
2613
2627
|
};
|
|
2614
|
-
const create$
|
|
2628
|
+
const create$5$1 = async ({
|
|
2615
2629
|
commandMap,
|
|
2616
2630
|
isMessagePortOpen = true,
|
|
2617
2631
|
messagePort
|
|
@@ -2628,18 +2642,18 @@ const create$4$1 = async ({
|
|
|
2628
2642
|
messagePort.start();
|
|
2629
2643
|
return rpc;
|
|
2630
2644
|
};
|
|
2631
|
-
const create$
|
|
2645
|
+
const create$4$1 = async ({
|
|
2632
2646
|
commandMap,
|
|
2633
2647
|
messagePort
|
|
2634
2648
|
}) => {
|
|
2635
|
-
return create$
|
|
2649
|
+
return create$5$1({
|
|
2636
2650
|
commandMap,
|
|
2637
2651
|
messagePort
|
|
2638
2652
|
});
|
|
2639
2653
|
};
|
|
2640
2654
|
const PlainMessagePortRpcParent = {
|
|
2641
2655
|
__proto__: null,
|
|
2642
|
-
create: create$
|
|
2656
|
+
create: create$4$1
|
|
2643
2657
|
};
|
|
2644
2658
|
|
|
2645
2659
|
// TODO add test
|
|
@@ -7658,13 +7672,6 @@ const ViewletOutput = {
|
|
|
7658
7672
|
setText
|
|
7659
7673
|
};
|
|
7660
7674
|
|
|
7661
|
-
const state$1 = {
|
|
7662
|
-
currentPanelView: undefined,
|
|
7663
|
-
currentSideBarView: undefined,
|
|
7664
|
-
instances: Object.create(null),
|
|
7665
|
-
modules: Object.create(null)
|
|
7666
|
-
};
|
|
7667
|
-
|
|
7668
7675
|
const handleClickClose = event => {
|
|
7669
7676
|
const uid = fromEvent(event);
|
|
7670
7677
|
hidePanel(uid);
|
|
@@ -7811,8 +7818,7 @@ const setActionsDom$1 = (state, actions, childUid) => {
|
|
|
7811
7818
|
const {
|
|
7812
7819
|
$PanelActions
|
|
7813
7820
|
} = state;
|
|
7814
|
-
const
|
|
7815
|
-
const instance = instances[childUid];
|
|
7821
|
+
const instance = get$1$1(childUid);
|
|
7816
7822
|
if (!instance) {
|
|
7817
7823
|
throw new Error(`child instance not found`);
|
|
7818
7824
|
}
|
|
@@ -8926,12 +8932,18 @@ const load$1 = moduleId => {
|
|
|
8926
8932
|
}
|
|
8927
8933
|
};
|
|
8928
8934
|
|
|
8935
|
+
const state$1 = {
|
|
8936
|
+
currentPanelView: undefined,
|
|
8937
|
+
currentSideBarView: undefined,
|
|
8938
|
+
modules: Object.create(null)
|
|
8939
|
+
};
|
|
8940
|
+
|
|
8929
8941
|
const create$3 = (id, uid = id) => {
|
|
8930
8942
|
const module = state$1.modules[id];
|
|
8931
8943
|
if (!module) {
|
|
8932
8944
|
throw new Error(`module not found: ${id}`);
|
|
8933
8945
|
}
|
|
8934
|
-
const existing = get$
|
|
8946
|
+
const existing = get$1$1(id);
|
|
8935
8947
|
if (existing?.state.$Viewlet.isConnected) {
|
|
8936
8948
|
existing.state.$Viewlet.remove();
|
|
8937
8949
|
}
|
|
@@ -8940,7 +8952,7 @@ const create$3 = (id, uid = id) => {
|
|
|
8940
8952
|
if (module.attachEvents) {
|
|
8941
8953
|
module.attachEvents(instanceState);
|
|
8942
8954
|
}
|
|
8943
|
-
set$
|
|
8955
|
+
set$1$1(uid, {
|
|
8944
8956
|
factory: module,
|
|
8945
8957
|
state: instanceState
|
|
8946
8958
|
});
|
|
@@ -8953,14 +8965,14 @@ const createFunctionalRoot = (id, uid = id, hasFunctionalEvents) => {
|
|
|
8953
8965
|
if (!module) {
|
|
8954
8966
|
throw new Error(`module not found: ${id}`);
|
|
8955
8967
|
}
|
|
8956
|
-
const existing = get$
|
|
8968
|
+
const existing = get$1$1(id);
|
|
8957
8969
|
if (existing?.state.$Viewlet.isConnected) {
|
|
8958
8970
|
existing.state.$Viewlet.remove();
|
|
8959
8971
|
}
|
|
8960
8972
|
const instanceState = {
|
|
8961
8973
|
$Viewlet: document.createElement('div')
|
|
8962
8974
|
};
|
|
8963
|
-
set$
|
|
8975
|
+
set$1$1(uid, {
|
|
8964
8976
|
factory: module,
|
|
8965
8977
|
state: instanceState
|
|
8966
8978
|
});
|
|
@@ -8983,7 +8995,7 @@ const loadModule = async id => {
|
|
|
8983
8995
|
};
|
|
8984
8996
|
const invoke = (viewletId, method, ...args) => {
|
|
8985
8997
|
string(method);
|
|
8986
|
-
const instance = get$
|
|
8998
|
+
const instance = get$1$1(viewletId);
|
|
8987
8999
|
if (!instance?.factory) {
|
|
8988
9000
|
if (viewletId && method !== 'setActionsDom') {
|
|
8989
9001
|
warn$1(`cannot execute ${method} viewlet instance ${viewletId} not found`);
|
|
@@ -9001,7 +9013,7 @@ const focus$1 = viewletId => {
|
|
|
9001
9013
|
// eslint-disable-next-line no-console
|
|
9002
9014
|
console.trace(`focus ${viewletId}`);
|
|
9003
9015
|
}
|
|
9004
|
-
const instance = get$
|
|
9016
|
+
const instance = get$1$1(viewletId);
|
|
9005
9017
|
if (instance.factory?.setFocused) {
|
|
9006
9018
|
instance.factory.setFocused(instance.state, true);
|
|
9007
9019
|
} else if (instance?.factory?.focus) {
|
|
@@ -9017,7 +9029,7 @@ const focusElementByName = (viewletId, name) => {
|
|
|
9017
9029
|
// eslint-disable-next-line no-console
|
|
9018
9030
|
console.trace(`focusByName ${viewletId} ${name}`);
|
|
9019
9031
|
}
|
|
9020
|
-
const instance = get$
|
|
9032
|
+
const instance = get$1$1(viewletId);
|
|
9021
9033
|
if (!instance) {
|
|
9022
9034
|
return;
|
|
9023
9035
|
}
|
|
@@ -9032,7 +9044,7 @@ const focusElementByName = (viewletId, name) => {
|
|
|
9032
9044
|
};
|
|
9033
9045
|
const setElementProperty = (viewletId, name, key, value) => {
|
|
9034
9046
|
const selector = `[name="${name}"]`;
|
|
9035
|
-
const instance = get$
|
|
9047
|
+
const instance = get$1$1(viewletId);
|
|
9036
9048
|
if (!instance) {
|
|
9037
9049
|
return;
|
|
9038
9050
|
}
|
|
@@ -9061,7 +9073,7 @@ const setCheckBoxValue = (viewletId, name, value) => {
|
|
|
9061
9073
|
};
|
|
9062
9074
|
const setSelectionByName = (viewletId, name, start, end) => {
|
|
9063
9075
|
const selector = `[name="${name}"]`;
|
|
9064
|
-
const instance = get$
|
|
9076
|
+
const instance = get$1$1(viewletId);
|
|
9065
9077
|
if (!instance) {
|
|
9066
9078
|
return;
|
|
9067
9079
|
}
|
|
@@ -9076,7 +9088,7 @@ const setSelectionByName = (viewletId, name, start, end) => {
|
|
|
9076
9088
|
$Element.selectionEnd = end;
|
|
9077
9089
|
};
|
|
9078
9090
|
const setUid = (viewletId, uid) => {
|
|
9079
|
-
const instance = get$
|
|
9091
|
+
const instance = get$1$1(viewletId);
|
|
9080
9092
|
if (!instance) {
|
|
9081
9093
|
return;
|
|
9082
9094
|
}
|
|
@@ -9086,7 +9098,7 @@ const setUid = (viewletId, uid) => {
|
|
|
9086
9098
|
set$3($Viewlet, uid);
|
|
9087
9099
|
};
|
|
9088
9100
|
const focusSelector = (viewletId, selector) => {
|
|
9089
|
-
const instance = get$
|
|
9101
|
+
const instance = get$1$1(viewletId);
|
|
9090
9102
|
if (!instance) {
|
|
9091
9103
|
return;
|
|
9092
9104
|
}
|
|
@@ -9104,7 +9116,7 @@ const focusSelector = (viewletId, selector) => {
|
|
|
9104
9116
|
* @deprecated
|
|
9105
9117
|
*/
|
|
9106
9118
|
const refresh$1 = (viewletId, viewletContext) => {
|
|
9107
|
-
const instance = get$
|
|
9119
|
+
const instance = get$1$1(viewletId);
|
|
9108
9120
|
if (instance) {
|
|
9109
9121
|
instance.factory.refresh(instance.state, viewletContext);
|
|
9110
9122
|
} else {
|
|
@@ -9123,10 +9135,10 @@ const createPlaceholder = (viewletId, parentId, top, left, width, height) => {
|
|
|
9123
9135
|
if (isSpecial(viewletId)) {
|
|
9124
9136
|
$PlaceHolder.id = viewletId;
|
|
9125
9137
|
}
|
|
9126
|
-
const parentInstance = get$
|
|
9138
|
+
const parentInstance = get$1$1(parentId);
|
|
9127
9139
|
const $Parent = parentInstance.state.$Viewlet;
|
|
9128
9140
|
$Parent.append($PlaceHolder);
|
|
9129
|
-
set$
|
|
9141
|
+
set$1$1(viewletId, {
|
|
9130
9142
|
state: {
|
|
9131
9143
|
$Viewlet: $PlaceHolder
|
|
9132
9144
|
}
|
|
@@ -9136,7 +9148,7 @@ const setDragData = (viewletId, dragData) => {
|
|
|
9136
9148
|
set$2(viewletId, dragData);
|
|
9137
9149
|
};
|
|
9138
9150
|
const setDom = (viewletId, dom) => {
|
|
9139
|
-
const instance = get$
|
|
9151
|
+
const instance = get$1$1(viewletId);
|
|
9140
9152
|
if (!instance) {
|
|
9141
9153
|
return;
|
|
9142
9154
|
}
|
|
@@ -9149,7 +9161,7 @@ const setDom = (viewletId, dom) => {
|
|
|
9149
9161
|
renderInto($Viewlet, dom, Events);
|
|
9150
9162
|
};
|
|
9151
9163
|
const setDom2 = (viewletId, dom) => {
|
|
9152
|
-
const instance = get$
|
|
9164
|
+
const instance = get$1$1(viewletId);
|
|
9153
9165
|
if (!instance) {
|
|
9154
9166
|
return;
|
|
9155
9167
|
}
|
|
@@ -9171,7 +9183,7 @@ const setDom2 = (viewletId, dom) => {
|
|
|
9171
9183
|
// @ts-ignore
|
|
9172
9184
|
set$3($NewViewlet, uid);
|
|
9173
9185
|
}
|
|
9174
|
-
set$
|
|
9186
|
+
set$1$1(viewletId, {
|
|
9175
9187
|
...instance,
|
|
9176
9188
|
state: {
|
|
9177
9189
|
...instance.state,
|
|
@@ -9180,7 +9192,7 @@ const setDom2 = (viewletId, dom) => {
|
|
|
9180
9192
|
});
|
|
9181
9193
|
};
|
|
9182
9194
|
const setPatches = (uid, patches) => {
|
|
9183
|
-
const instance = get$
|
|
9195
|
+
const instance = get$1$1(uid);
|
|
9184
9196
|
if (!instance) {
|
|
9185
9197
|
return;
|
|
9186
9198
|
}
|
|
@@ -9351,7 +9363,7 @@ const sendMultiple = commands => {
|
|
|
9351
9363
|
const dispose$3 = id => {
|
|
9352
9364
|
try {
|
|
9353
9365
|
number(id);
|
|
9354
|
-
const instance = get$
|
|
9366
|
+
const instance = get$1$1(id);
|
|
9355
9367
|
if (!instance) {
|
|
9356
9368
|
warn$1(`viewlet instance ${id} not found and cannot be disposed`);
|
|
9357
9369
|
return;
|
|
@@ -9362,14 +9374,14 @@ const dispose$3 = id => {
|
|
|
9362
9374
|
if (instance.state.$Viewlet?.isConnected) {
|
|
9363
9375
|
instance.state.$Viewlet.remove();
|
|
9364
9376
|
}
|
|
9365
|
-
set$
|
|
9377
|
+
set$1$1(id, undefined);
|
|
9366
9378
|
} catch {
|
|
9367
9379
|
throw new Error(`Failed to dispose ${id}`);
|
|
9368
9380
|
}
|
|
9369
9381
|
};
|
|
9370
9382
|
const handleError$1 = (id, parentId, message) => {
|
|
9371
9383
|
info(`[viewlet-error] ${id}: ${message}`);
|
|
9372
|
-
const instance = get$
|
|
9384
|
+
const instance = get$1$1(id);
|
|
9373
9385
|
if (instance?.state.$Viewlet.isConnected) {
|
|
9374
9386
|
instance.state.$Viewlet.remove();
|
|
9375
9387
|
}
|
|
@@ -9381,7 +9393,7 @@ const handleError$1 = (id, parentId, message) => {
|
|
|
9381
9393
|
instance.state.$Viewlet.textContent = `${message}`;
|
|
9382
9394
|
}
|
|
9383
9395
|
// TODO error should bubble up to until highest possible component
|
|
9384
|
-
const parentInstance = get$
|
|
9396
|
+
const parentInstance = get$1$1(parentId);
|
|
9385
9397
|
if (parentInstance?.factory?.handleError) {
|
|
9386
9398
|
parentInstance.factory.handleError(instance.state, message);
|
|
9387
9399
|
}
|
|
@@ -9395,9 +9407,9 @@ const appendViewlet = (parentId, childId, focus) => {
|
|
|
9395
9407
|
// TODO
|
|
9396
9408
|
return;
|
|
9397
9409
|
}
|
|
9398
|
-
const parentInstanceState = get$
|
|
9410
|
+
const parentInstanceState = get$1$1(parentId); // TODO must ensure that parent is already created
|
|
9399
9411
|
const parentModule = parentInstanceState.factory;
|
|
9400
|
-
const childInstance = get$
|
|
9412
|
+
const childInstance = get$1$1(childId);
|
|
9401
9413
|
if (!childInstance) {
|
|
9402
9414
|
throw new Error(`child instance ${childId} must be defined to be appended to parent ${parentId}`);
|
|
9403
9415
|
}
|
|
@@ -9416,12 +9428,12 @@ const ariaAnnounce = async message => {
|
|
|
9416
9428
|
const append = (parentId, childId, referenceNodes) => {
|
|
9417
9429
|
number(parentId);
|
|
9418
9430
|
number(childId);
|
|
9419
|
-
const parentInstance = get$
|
|
9431
|
+
const parentInstance = get$1$1(parentId);
|
|
9420
9432
|
if (!parentInstance) {
|
|
9421
9433
|
throw new Error(`cannot append child: instance ${parentId} not found`);
|
|
9422
9434
|
}
|
|
9423
9435
|
const $Parent = parentInstance.state.$Viewlet;
|
|
9424
|
-
const childInstance = get$
|
|
9436
|
+
const childInstance = get$1$1(childId);
|
|
9425
9437
|
if (!childInstance) {
|
|
9426
9438
|
throw new Error(`cannot append child: child instance not found ${childId}`);
|
|
9427
9439
|
}
|
|
@@ -9437,7 +9449,7 @@ const append = (parentId, childId, referenceNodes) => {
|
|
|
9437
9449
|
if (id === childId) {
|
|
9438
9450
|
for (let j = i - 1; j >= 0; j--) {
|
|
9439
9451
|
const beforeId = referenceNodes[j];
|
|
9440
|
-
const beforeInstance = get$
|
|
9452
|
+
const beforeInstance = get$1$1(beforeId);
|
|
9441
9453
|
if (beforeInstance) {
|
|
9442
9454
|
const $ReferenceNode = beforeInstance.state.$Viewlet;
|
|
9443
9455
|
$ReferenceNode.after($Child);
|
|
@@ -9446,7 +9458,7 @@ const append = (parentId, childId, referenceNodes) => {
|
|
|
9446
9458
|
}
|
|
9447
9459
|
for (let j = i + 1; j < referenceNodes.length; j++) {
|
|
9448
9460
|
const afterId = referenceNodes[j];
|
|
9449
|
-
const afterInstance = get$
|
|
9461
|
+
const afterInstance = get$1$1(afterId);
|
|
9450
9462
|
if (afterInstance) {
|
|
9451
9463
|
const $ReferenceNode = afterInstance.state.$Viewlet;
|
|
9452
9464
|
$ReferenceNode.before($Child);
|
|
@@ -9464,11 +9476,11 @@ const append = (parentId, childId, referenceNodes) => {
|
|
|
9464
9476
|
}
|
|
9465
9477
|
};
|
|
9466
9478
|
const replaceChildren = (parentId, childIds) => {
|
|
9467
|
-
const parentInstance = get$
|
|
9479
|
+
const parentInstance = get$1$1(parentId);
|
|
9468
9480
|
const $Parent = parentInstance.state.$Viewlet;
|
|
9469
9481
|
const $Fragment = document.createDocumentFragment();
|
|
9470
9482
|
for (const childId of childIds) {
|
|
9471
|
-
const childInstance = get$
|
|
9483
|
+
const childInstance = get$1$1(childId);
|
|
9472
9484
|
const $Child = childInstance.state.$Viewlet;
|
|
9473
9485
|
$Fragment.append($Child);
|
|
9474
9486
|
}
|
|
@@ -9476,7 +9488,7 @@ const replaceChildren = (parentId, childIds) => {
|
|
|
9476
9488
|
};
|
|
9477
9489
|
const appendToBody = childId => {
|
|
9478
9490
|
const $Parent = document.body;
|
|
9479
|
-
const childInstance = get$
|
|
9491
|
+
const childInstance = get$1$1(childId);
|
|
9480
9492
|
const $Child = childInstance.state.$Viewlet;
|
|
9481
9493
|
$Parent.append($Child);
|
|
9482
9494
|
};
|
|
@@ -9548,7 +9560,7 @@ const executeCommands = commands => {
|
|
|
9548
9560
|
}
|
|
9549
9561
|
};
|
|
9550
9562
|
const show = id => {
|
|
9551
|
-
const instance = get$
|
|
9563
|
+
const instance = get$1$1(id);
|
|
9552
9564
|
const $Viewlet = instance.state.$Viewlet;
|
|
9553
9565
|
const $Workbench = document.getElementById('Workbench');
|
|
9554
9566
|
// @ts-expect-error
|
|
@@ -9558,7 +9570,7 @@ const show = id => {
|
|
|
9558
9570
|
}
|
|
9559
9571
|
};
|
|
9560
9572
|
const setBounds$1 = (id, left, top, width, height) => {
|
|
9561
|
-
const instance = get$
|
|
9573
|
+
const instance = get$1$1(id);
|
|
9562
9574
|
if (!instance) {
|
|
9563
9575
|
return;
|
|
9564
9576
|
}
|
|
@@ -9566,7 +9578,7 @@ const setBounds$1 = (id, left, top, width, height) => {
|
|
|
9566
9578
|
setBounds$a($Viewlet, left, top, width, height);
|
|
9567
9579
|
};
|
|
9568
9580
|
const setProperty = (id, selector, property, value) => {
|
|
9569
|
-
const instance = get$
|
|
9581
|
+
const instance = get$1$1(id);
|
|
9570
9582
|
if (!instance) {
|
|
9571
9583
|
return;
|
|
9572
9584
|
}
|