@lvce-editor/renderer-process 25.1.0 → 25.2.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 +1639 -1650
- package/package.json +1 -1
|
@@ -120,24 +120,24 @@ const confirm$1 = message => {
|
|
|
120
120
|
return window.confirm(message);
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
-
const state$
|
|
123
|
+
const state$a = {
|
|
124
124
|
styleSheets: Object.create(null)
|
|
125
125
|
};
|
|
126
|
-
const set$
|
|
127
|
-
state$
|
|
126
|
+
const set$a = (id, sheet) => {
|
|
127
|
+
state$a.styleSheets[id] = sheet;
|
|
128
128
|
};
|
|
129
|
-
const get$
|
|
130
|
-
return state$
|
|
129
|
+
const get$b = id => {
|
|
130
|
+
return state$a.styleSheets[id];
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
const addCssStyleSheet = (id, text) => {
|
|
134
|
-
const existing = get$
|
|
134
|
+
const existing = get$b(id);
|
|
135
135
|
if (existing) {
|
|
136
136
|
existing.replaceSync(text);
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
139
|
const sheet = new CSSStyleSheet({});
|
|
140
|
-
set$
|
|
140
|
+
set$a(id, sheet);
|
|
141
141
|
sheet.replaceSync(text);
|
|
142
142
|
document.adoptedStyleSheets.push(sheet);
|
|
143
143
|
};
|
|
@@ -181,6 +181,7 @@ const downloadFile = (fileName, url) => {
|
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
const uidSymbol = Symbol('uid');
|
|
184
|
+
|
|
184
185
|
const getUidTarget = $Element => {
|
|
185
186
|
while ($Element) {
|
|
186
187
|
if ($Element[uidSymbol]) {
|
|
@@ -190,6 +191,7 @@ const getUidTarget = $Element => {
|
|
|
190
191
|
}
|
|
191
192
|
return undefined;
|
|
192
193
|
};
|
|
194
|
+
|
|
193
195
|
const setComponentUid = ($Element, uid) => {
|
|
194
196
|
$Element[uidSymbol] = uid;
|
|
195
197
|
};
|
|
@@ -207,6 +209,7 @@ const getComponentUidFromEvent = event => {
|
|
|
207
209
|
} = event;
|
|
208
210
|
return getComponentUid(currentTarget || target);
|
|
209
211
|
};
|
|
212
|
+
|
|
210
213
|
const dragInfos = Object.create(null);
|
|
211
214
|
const setDragInfo = (id, data) => {
|
|
212
215
|
dragInfos[id] = data;
|
|
@@ -217,6 +220,7 @@ const getDragInfo = id => {
|
|
|
217
220
|
const isDragInfoOld = data => {
|
|
218
221
|
return Array.isArray(data);
|
|
219
222
|
};
|
|
223
|
+
|
|
220
224
|
const setDragImage = (dataTransfer, label) => {
|
|
221
225
|
const dragImage = document.createElement('div');
|
|
222
226
|
dragImage.className = 'DragImage';
|
|
@@ -228,6 +232,7 @@ const setDragImage = (dataTransfer, label) => {
|
|
|
228
232
|
};
|
|
229
233
|
setTimeout(handleTimeOut, 0);
|
|
230
234
|
};
|
|
235
|
+
|
|
231
236
|
const applyDragInfoMaybe = event => {
|
|
232
237
|
const {
|
|
233
238
|
dataTransfer,
|
|
@@ -253,8 +258,10 @@ const applyDragInfoMaybe = event => {
|
|
|
253
258
|
}
|
|
254
259
|
}
|
|
255
260
|
};
|
|
261
|
+
|
|
256
262
|
const PointerMove$1 = 'pointermove';
|
|
257
263
|
const lostpointercapture = 'lostpointercapture';
|
|
264
|
+
|
|
258
265
|
let ignore = false;
|
|
259
266
|
const startIgnore = () => {
|
|
260
267
|
ignore = true;
|
|
@@ -265,14 +272,16 @@ const stopIgnore = () => {
|
|
|
265
272
|
const enabled = () => {
|
|
266
273
|
return ignore;
|
|
267
274
|
};
|
|
275
|
+
|
|
268
276
|
let id$1 = 0;
|
|
269
277
|
const create$N = () => {
|
|
270
278
|
return ++id$1;
|
|
271
279
|
};
|
|
272
|
-
|
|
280
|
+
|
|
281
|
+
const state$9 = Object.create(null);
|
|
273
282
|
const acquire$1 = id => {
|
|
274
|
-
const promise = state$
|
|
275
|
-
delete state$
|
|
283
|
+
const promise = state$9[id];
|
|
284
|
+
delete state$9[id];
|
|
276
285
|
return promise;
|
|
277
286
|
};
|
|
278
287
|
const getFileHandles$1 = async ids => {
|
|
@@ -282,13 +291,14 @@ const getFileHandles$1 = async ids => {
|
|
|
282
291
|
};
|
|
283
292
|
const add$1 = promise => {
|
|
284
293
|
const id = create$N();
|
|
285
|
-
state$
|
|
294
|
+
state$9[id] = promise;
|
|
286
295
|
return id;
|
|
287
296
|
};
|
|
288
297
|
const addFileHandle$1 = fileHandle => {
|
|
289
298
|
const promise = Promise.resolve(fileHandle);
|
|
290
299
|
return add$1(promise);
|
|
291
300
|
};
|
|
301
|
+
|
|
292
302
|
const unwrapItemString = async item => {
|
|
293
303
|
const {
|
|
294
304
|
resolve,
|
|
@@ -344,6 +354,22 @@ const handleDataTransferFiles = event => {
|
|
|
344
354
|
const ids = promises.map(promise => add$1(promise));
|
|
345
355
|
return ids;
|
|
346
356
|
};
|
|
357
|
+
const handleClipboardDataFiles = event => {
|
|
358
|
+
if (!event.clipboardData) {
|
|
359
|
+
return [];
|
|
360
|
+
}
|
|
361
|
+
const files = [];
|
|
362
|
+
for (const item of event.clipboardData.items) {
|
|
363
|
+
if (item.kind !== 'file') {
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
const file = item.getAsFile();
|
|
367
|
+
if (file) {
|
|
368
|
+
files.push(file);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return files;
|
|
372
|
+
};
|
|
347
373
|
const getEventListenerArg = (param, event) => {
|
|
348
374
|
switch (param) {
|
|
349
375
|
case 'event.altKey':
|
|
@@ -354,6 +380,8 @@ const getEventListenerArg = (param, event) => {
|
|
|
354
380
|
return event.clientX;
|
|
355
381
|
case 'event.clientY':
|
|
356
382
|
return event.clientY;
|
|
383
|
+
case 'event.clipboardData.files':
|
|
384
|
+
return handleClipboardDataFiles(event);
|
|
357
385
|
case 'event.ctrlKey':
|
|
358
386
|
return event.ctrlKey;
|
|
359
387
|
case 'event.data':
|
|
@@ -421,6 +449,7 @@ const getEventListenerArg = (param, event) => {
|
|
|
421
449
|
return param;
|
|
422
450
|
}
|
|
423
451
|
};
|
|
452
|
+
|
|
424
453
|
const getEventListenerArgs = (params, event) => {
|
|
425
454
|
const serialized = [];
|
|
426
455
|
for (const param of params) {
|
|
@@ -428,6 +457,7 @@ const getEventListenerArgs = (params, event) => {
|
|
|
428
457
|
}
|
|
429
458
|
return serialized;
|
|
430
459
|
};
|
|
460
|
+
|
|
431
461
|
const state$8 = {
|
|
432
462
|
ipc: undefined
|
|
433
463
|
};
|
|
@@ -437,14 +467,17 @@ const getIpc = () => {
|
|
|
437
467
|
const setIpc = value => {
|
|
438
468
|
state$8.ipc = value;
|
|
439
469
|
};
|
|
470
|
+
|
|
440
471
|
const nameAnonymousFunction$1 = (fn, name) => {
|
|
441
472
|
Object.defineProperty(fn, 'name', {
|
|
442
473
|
value: name
|
|
443
474
|
});
|
|
444
475
|
};
|
|
476
|
+
|
|
445
477
|
const isInputElement = element => {
|
|
446
478
|
return element instanceof HTMLInputElement;
|
|
447
479
|
};
|
|
480
|
+
|
|
448
481
|
const preventEventsMaybe = (info, event) => {
|
|
449
482
|
if (info.preventDefault === 2) {
|
|
450
483
|
if (!isInputElement(event.target)) {
|
|
@@ -457,6 +490,7 @@ const preventEventsMaybe = (info, event) => {
|
|
|
457
490
|
event.stopPropagation();
|
|
458
491
|
}
|
|
459
492
|
};
|
|
493
|
+
|
|
460
494
|
const applyPointerTrackMaybe = (info, map, event) => {
|
|
461
495
|
const {
|
|
462
496
|
trackPointerEvents
|
|
@@ -500,6 +534,7 @@ const createFn = (info, map) => {
|
|
|
500
534
|
}
|
|
501
535
|
return fn;
|
|
502
536
|
};
|
|
537
|
+
|
|
503
538
|
const listeners = Object.create(null);
|
|
504
539
|
const registerEventListeners = (id, eventListeners) => {
|
|
505
540
|
const map = Object.create(null);
|
|
@@ -513,64 +548,67 @@ const getEventListenerMap = id => {
|
|
|
513
548
|
const map = listeners[id];
|
|
514
549
|
return map;
|
|
515
550
|
};
|
|
551
|
+
|
|
516
552
|
const clearNode = $Node => {
|
|
517
553
|
$Node.textContent = '';
|
|
518
554
|
};
|
|
519
|
-
|
|
520
|
-
const
|
|
521
|
-
const
|
|
522
|
-
const
|
|
523
|
-
const
|
|
524
|
-
const
|
|
525
|
-
const
|
|
526
|
-
const
|
|
527
|
-
const
|
|
528
|
-
const
|
|
529
|
-
const
|
|
530
|
-
const
|
|
531
|
-
const
|
|
532
|
-
const
|
|
533
|
-
const
|
|
534
|
-
const
|
|
535
|
-
const
|
|
536
|
-
const
|
|
537
|
-
const
|
|
538
|
-
const
|
|
539
|
-
const
|
|
540
|
-
const
|
|
541
|
-
const
|
|
555
|
+
|
|
556
|
+
const Audio$3 = 'audio';
|
|
557
|
+
const Button$1 = 'button';
|
|
558
|
+
const Col$1 = 'col';
|
|
559
|
+
const ColGroup$1 = 'colgroup';
|
|
560
|
+
const Del$1 = 'del';
|
|
561
|
+
const Div$1 = 'div';
|
|
562
|
+
const H1$1 = 'h1';
|
|
563
|
+
const H2$1 = 'h2';
|
|
564
|
+
const H3$1 = 'h3';
|
|
565
|
+
const H4$1 = 'h4';
|
|
566
|
+
const H5$1 = 'h5';
|
|
567
|
+
const H6$1 = 'h6';
|
|
568
|
+
const I$1 = 'i';
|
|
569
|
+
const Img$1 = 'img';
|
|
570
|
+
const Input$1 = 'input';
|
|
571
|
+
const Ins$1 = 'ins';
|
|
572
|
+
const Kbd$1 = 'kbd';
|
|
573
|
+
const Span$1 = 'span';
|
|
574
|
+
const Table$1 = 'table';
|
|
575
|
+
const TBody$1 = 'tbody';
|
|
576
|
+
const Td$1 = 'td';
|
|
577
|
+
const Th$1 = 'th';
|
|
578
|
+
const THead$1 = 'thead';
|
|
542
579
|
const Tr$2 = 'tr';
|
|
543
|
-
const Article$
|
|
544
|
-
const Aside$
|
|
545
|
-
const Footer$
|
|
546
|
-
const Header$
|
|
547
|
-
const Nav$
|
|
548
|
-
const Section$
|
|
549
|
-
const Search$
|
|
550
|
-
const Dd$
|
|
580
|
+
const Article$1 = 'article';
|
|
581
|
+
const Aside$1 = 'aside';
|
|
582
|
+
const Footer$1 = 'footer';
|
|
583
|
+
const Header$1 = 'header';
|
|
584
|
+
const Nav$1 = 'nav';
|
|
585
|
+
const Section$1 = 'section';
|
|
586
|
+
const Search$1 = 'search';
|
|
587
|
+
const Dd$1 = 'dd';
|
|
551
588
|
const Dl$2 = 'dl';
|
|
552
|
-
const Figcaption$
|
|
553
|
-
const Figure$
|
|
554
|
-
const Hr$
|
|
589
|
+
const Figcaption$1 = 'figcaption';
|
|
590
|
+
const Figure$1 = 'figure';
|
|
591
|
+
const Hr$1 = 'hr';
|
|
555
592
|
const Li$2 = 'li';
|
|
556
593
|
const Ol$2 = 'ol';
|
|
557
|
-
const P$
|
|
558
|
-
const Pre$
|
|
559
|
-
const A$
|
|
594
|
+
const P$1 = 'p';
|
|
595
|
+
const Pre$1 = 'pre';
|
|
596
|
+
const A$1 = 'a';
|
|
560
597
|
const Br$2 = 'br';
|
|
561
|
-
const Cite$
|
|
562
|
-
const Data$
|
|
563
|
-
const Time$
|
|
564
|
-
const Tfoot$
|
|
565
|
-
const Ul$
|
|
598
|
+
const Cite$1 = 'cite';
|
|
599
|
+
const Data$1 = 'data';
|
|
600
|
+
const Time$1 = 'time';
|
|
601
|
+
const Tfoot$1 = 'tfoot';
|
|
602
|
+
const Ul$1 = 'ul';
|
|
566
603
|
const Video$2 = 'video';
|
|
567
|
-
const TextArea$
|
|
568
|
-
const Select$
|
|
569
|
-
const Option$
|
|
604
|
+
const TextArea$1 = 'textarea';
|
|
605
|
+
const Select$1 = 'select';
|
|
606
|
+
const Option$1 = 'option';
|
|
570
607
|
const Code$2 = 'code';
|
|
571
|
-
const Label$
|
|
608
|
+
const Label$1 = 'label';
|
|
572
609
|
const Dt$2 = 'dt';
|
|
573
610
|
const Iframe$1 = 'iframe';
|
|
611
|
+
const Main$1 = 'main';
|
|
574
612
|
const Em$1 = 'em';
|
|
575
613
|
const Strong$1 = 'strong';
|
|
576
614
|
const Style$1 = 'style';
|
|
@@ -579,65 +617,78 @@ const Head$1 = 'head';
|
|
|
579
617
|
const Title$1 = 'title';
|
|
580
618
|
const Meta$1 = 'meta';
|
|
581
619
|
const Canvas$1 = 'canvas';
|
|
620
|
+
const Circle$1 = 'circle';
|
|
582
621
|
const Form$1 = 'form';
|
|
583
|
-
const
|
|
622
|
+
const Defs$1 = 'defs';
|
|
623
|
+
const Ellipse$1 = 'ellipse';
|
|
624
|
+
const G$2 = 'g';
|
|
625
|
+
const Line$1 = 'line';
|
|
626
|
+
const Path$1 = 'path';
|
|
627
|
+
const Polygon$1 = 'polygon';
|
|
628
|
+
const Polyline$1 = 'polyline';
|
|
629
|
+
const Quote$3 = 'quote';
|
|
584
630
|
const BlockQuote$1 = 'blockquote';
|
|
585
|
-
const
|
|
586
|
-
const
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
const
|
|
590
|
-
const
|
|
591
|
-
const
|
|
592
|
-
const
|
|
593
|
-
const
|
|
594
|
-
const
|
|
595
|
-
const
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
const
|
|
599
|
-
const
|
|
631
|
+
const Rect$1 = 'rect';
|
|
632
|
+
const Svg$1 = 'svg';
|
|
633
|
+
const Use$1 = 'use';
|
|
634
|
+
|
|
635
|
+
const Audio$2 = 0;
|
|
636
|
+
const Button = 1;
|
|
637
|
+
const Col = 2;
|
|
638
|
+
const ColGroup = 3;
|
|
639
|
+
const Div = 4;
|
|
640
|
+
const H1 = 5;
|
|
641
|
+
const Input = 6;
|
|
642
|
+
const Kbd = 7;
|
|
643
|
+
const Span = 8;
|
|
644
|
+
const Table = 9;
|
|
645
|
+
const TBody = 10;
|
|
646
|
+
const Td = 11;
|
|
647
|
+
const Text$3 = 12;
|
|
648
|
+
const Th = 13;
|
|
649
|
+
const THead = 14;
|
|
600
650
|
const Tr$1 = 15;
|
|
601
|
-
const I
|
|
602
|
-
const Img
|
|
603
|
-
const Ins
|
|
604
|
-
const Del
|
|
605
|
-
const H2
|
|
606
|
-
const H3
|
|
607
|
-
const H4
|
|
608
|
-
const H5
|
|
609
|
-
const H6
|
|
610
|
-
const Article
|
|
611
|
-
const Aside
|
|
612
|
-
const Footer
|
|
613
|
-
const Header
|
|
614
|
-
const Nav
|
|
615
|
-
const Section
|
|
616
|
-
const Search
|
|
617
|
-
const Dd
|
|
651
|
+
const I = 16;
|
|
652
|
+
const Img = 17;
|
|
653
|
+
const Ins = 20;
|
|
654
|
+
const Del = 21;
|
|
655
|
+
const H2 = 22;
|
|
656
|
+
const H3 = 23;
|
|
657
|
+
const H4 = 24;
|
|
658
|
+
const H5 = 25;
|
|
659
|
+
const H6 = 26;
|
|
660
|
+
const Article = 27;
|
|
661
|
+
const Aside = 28;
|
|
662
|
+
const Footer = 29;
|
|
663
|
+
const Header = 30;
|
|
664
|
+
const Nav = 40;
|
|
665
|
+
const Section = 41;
|
|
666
|
+
const Search = 42;
|
|
667
|
+
const Dd = 43;
|
|
618
668
|
const Dl$1 = 44;
|
|
619
|
-
const Figcaption
|
|
620
|
-
const Figure
|
|
621
|
-
const Hr
|
|
669
|
+
const Figcaption = 45;
|
|
670
|
+
const Figure = 46;
|
|
671
|
+
const Hr = 47;
|
|
622
672
|
const Li$1 = 48;
|
|
623
673
|
const Ol$1 = 49;
|
|
624
|
-
const P
|
|
625
|
-
const Pre
|
|
626
|
-
const A
|
|
674
|
+
const P = 50;
|
|
675
|
+
const Pre = 51;
|
|
676
|
+
const A = 53;
|
|
627
677
|
const Br$1 = 55;
|
|
628
|
-
const Cite
|
|
629
|
-
const Data
|
|
630
|
-
const Time
|
|
631
|
-
const Tfoot
|
|
632
|
-
const Ul
|
|
678
|
+
const Cite = 56;
|
|
679
|
+
const Data = 57;
|
|
680
|
+
const Time = 58;
|
|
681
|
+
const Tfoot = 59;
|
|
682
|
+
const Ul = 60;
|
|
633
683
|
const Video$1 = 61;
|
|
634
|
-
const TextArea
|
|
635
|
-
const Select
|
|
636
|
-
const Option
|
|
684
|
+
const TextArea = 62;
|
|
685
|
+
const Select = 63;
|
|
686
|
+
const Option = 64;
|
|
637
687
|
const Code$1 = 65;
|
|
638
|
-
const Label
|
|
688
|
+
const Label = 66;
|
|
639
689
|
const Dt$1 = 67;
|
|
640
690
|
const Iframe = 68;
|
|
691
|
+
const Main = 69;
|
|
641
692
|
const Strong = 70;
|
|
642
693
|
const Em = 71;
|
|
643
694
|
const Style = 72;
|
|
@@ -649,550 +700,1051 @@ const Canvas = 77;
|
|
|
649
700
|
const Form = 78;
|
|
650
701
|
const BlockQuote = 79;
|
|
651
702
|
const Quote$2 = 80;
|
|
703
|
+
const Circle = 81;
|
|
704
|
+
const Defs = 82;
|
|
705
|
+
const Ellipse = 83;
|
|
706
|
+
const G$1 = 84;
|
|
707
|
+
const Line = 85;
|
|
708
|
+
const Path = 86;
|
|
709
|
+
const Polygon = 87;
|
|
710
|
+
const Polyline = 88;
|
|
711
|
+
const Rect = 89;
|
|
712
|
+
const Svg = 90;
|
|
713
|
+
const Use = 91;
|
|
652
714
|
const Reference$1 = 100;
|
|
653
|
-
|
|
715
|
+
|
|
716
|
+
const VirtualDomElements = {
|
|
654
717
|
__proto__: null,
|
|
718
|
+
A,
|
|
719
|
+
Article,
|
|
720
|
+
Aside,
|
|
721
|
+
Audio: Audio$2,
|
|
722
|
+
BlockQuote,
|
|
723
|
+
Br: Br$1,
|
|
724
|
+
Button,
|
|
725
|
+
Canvas,
|
|
726
|
+
Circle,
|
|
727
|
+
Cite,
|
|
728
|
+
Code: Code$1,
|
|
729
|
+
Col,
|
|
730
|
+
ColGroup,
|
|
731
|
+
Data,
|
|
732
|
+
Dd,
|
|
733
|
+
Defs,
|
|
734
|
+
Del,
|
|
735
|
+
Div,
|
|
736
|
+
Dl: Dl$1,
|
|
737
|
+
Dt: Dt$1,
|
|
738
|
+
Ellipse,
|
|
739
|
+
Em,
|
|
740
|
+
Figcaption,
|
|
741
|
+
Figure,
|
|
742
|
+
Footer,
|
|
743
|
+
Form,
|
|
744
|
+
G: G$1,
|
|
745
|
+
H1,
|
|
746
|
+
H2,
|
|
747
|
+
H3,
|
|
748
|
+
H4,
|
|
749
|
+
H5,
|
|
750
|
+
H6,
|
|
751
|
+
Head,
|
|
752
|
+
Header,
|
|
753
|
+
Hr,
|
|
754
|
+
Html,
|
|
755
|
+
I,
|
|
756
|
+
Iframe,
|
|
757
|
+
Img,
|
|
758
|
+
Input,
|
|
759
|
+
Ins,
|
|
760
|
+
Kbd,
|
|
761
|
+
Label,
|
|
762
|
+
Li: Li$1,
|
|
763
|
+
Line,
|
|
764
|
+
Main,
|
|
765
|
+
Meta,
|
|
766
|
+
Nav,
|
|
767
|
+
Ol: Ol$1,
|
|
768
|
+
Option,
|
|
769
|
+
P,
|
|
770
|
+
Path,
|
|
771
|
+
Polygon,
|
|
772
|
+
Polyline,
|
|
773
|
+
Pre,
|
|
774
|
+
Quote: Quote$2,
|
|
775
|
+
Rect,
|
|
655
776
|
Reference: Reference$1,
|
|
656
|
-
|
|
777
|
+
Search,
|
|
778
|
+
Section,
|
|
779
|
+
Select,
|
|
780
|
+
Span,
|
|
781
|
+
Strong,
|
|
782
|
+
Style,
|
|
783
|
+
Svg,
|
|
784
|
+
TBody,
|
|
785
|
+
THead,
|
|
786
|
+
Table,
|
|
787
|
+
Td,
|
|
788
|
+
Text: Text$3,
|
|
789
|
+
TextArea,
|
|
790
|
+
Tfoot,
|
|
791
|
+
Th,
|
|
792
|
+
Time,
|
|
793
|
+
Title,
|
|
794
|
+
Tr: Tr$1,
|
|
795
|
+
Ul,
|
|
796
|
+
Use,
|
|
797
|
+
Video: Video$1
|
|
798
|
+
};
|
|
799
|
+
|
|
657
800
|
const getElementTag$1 = type => {
|
|
658
801
|
switch (type) {
|
|
659
|
-
case A
|
|
660
|
-
return A$
|
|
661
|
-
case Article
|
|
662
|
-
return Article$
|
|
663
|
-
case Aside
|
|
664
|
-
return Aside$
|
|
665
|
-
case Audio$
|
|
666
|
-
return Audio$
|
|
802
|
+
case A:
|
|
803
|
+
return A$1;
|
|
804
|
+
case Article:
|
|
805
|
+
return Article$1;
|
|
806
|
+
case Aside:
|
|
807
|
+
return Aside$1;
|
|
808
|
+
case Audio$2:
|
|
809
|
+
return Audio$3;
|
|
667
810
|
case BlockQuote:
|
|
668
811
|
return BlockQuote$1;
|
|
669
812
|
case Br$1:
|
|
670
813
|
return Br$2;
|
|
671
|
-
case Button
|
|
672
|
-
return Button$
|
|
814
|
+
case Button:
|
|
815
|
+
return Button$1;
|
|
673
816
|
case Canvas:
|
|
674
817
|
return Canvas$1;
|
|
675
|
-
case
|
|
676
|
-
return
|
|
818
|
+
case Circle:
|
|
819
|
+
return Circle$1;
|
|
820
|
+
case Cite:
|
|
821
|
+
return Cite$1;
|
|
677
822
|
case Code$1:
|
|
678
823
|
return Code$2;
|
|
679
|
-
case Col
|
|
680
|
-
return Col$
|
|
681
|
-
case ColGroup
|
|
682
|
-
return ColGroup$
|
|
683
|
-
case Data
|
|
684
|
-
return Data$
|
|
685
|
-
case Dd
|
|
686
|
-
return Dd$
|
|
687
|
-
case
|
|
688
|
-
return
|
|
689
|
-
case
|
|
690
|
-
return
|
|
824
|
+
case Col:
|
|
825
|
+
return Col$1;
|
|
826
|
+
case ColGroup:
|
|
827
|
+
return ColGroup$1;
|
|
828
|
+
case Data:
|
|
829
|
+
return Data$1;
|
|
830
|
+
case Dd:
|
|
831
|
+
return Dd$1;
|
|
832
|
+
case Defs:
|
|
833
|
+
return Defs$1;
|
|
834
|
+
case Del:
|
|
835
|
+
return Del$1;
|
|
836
|
+
case Div:
|
|
837
|
+
return Div$1;
|
|
691
838
|
case Dl$1:
|
|
692
839
|
return Dl$2;
|
|
693
840
|
case Dt$1:
|
|
694
841
|
return Dt$2;
|
|
842
|
+
case Ellipse:
|
|
843
|
+
return Ellipse$1;
|
|
695
844
|
case Em:
|
|
696
845
|
return Em$1;
|
|
697
|
-
case Figcaption
|
|
698
|
-
return Figcaption$
|
|
699
|
-
case Figure
|
|
700
|
-
return Figure$
|
|
701
|
-
case Footer
|
|
702
|
-
return Footer$
|
|
846
|
+
case Figcaption:
|
|
847
|
+
return Figcaption$1;
|
|
848
|
+
case Figure:
|
|
849
|
+
return Figure$1;
|
|
850
|
+
case Footer:
|
|
851
|
+
return Footer$1;
|
|
703
852
|
case Form:
|
|
704
853
|
return Form$1;
|
|
705
|
-
case
|
|
706
|
-
return
|
|
707
|
-
case
|
|
708
|
-
return
|
|
709
|
-
case
|
|
710
|
-
return
|
|
711
|
-
case
|
|
712
|
-
return
|
|
713
|
-
case
|
|
714
|
-
return
|
|
715
|
-
case
|
|
716
|
-
return
|
|
854
|
+
case G$1:
|
|
855
|
+
return G$2;
|
|
856
|
+
case H1:
|
|
857
|
+
return H1$1;
|
|
858
|
+
case H2:
|
|
859
|
+
return H2$1;
|
|
860
|
+
case H3:
|
|
861
|
+
return H3$1;
|
|
862
|
+
case H4:
|
|
863
|
+
return H4$1;
|
|
864
|
+
case H5:
|
|
865
|
+
return H5$1;
|
|
866
|
+
case H6:
|
|
867
|
+
return H6$1;
|
|
717
868
|
case Head:
|
|
718
869
|
return Head$1;
|
|
719
|
-
case Header
|
|
720
|
-
return Header$
|
|
721
|
-
case Hr
|
|
722
|
-
return Hr$
|
|
870
|
+
case Header:
|
|
871
|
+
return Header$1;
|
|
872
|
+
case Hr:
|
|
873
|
+
return Hr$1;
|
|
723
874
|
case Html:
|
|
724
875
|
return Html$1;
|
|
725
|
-
case I
|
|
726
|
-
return I$
|
|
876
|
+
case I:
|
|
877
|
+
return I$1;
|
|
727
878
|
case Iframe:
|
|
728
879
|
return Iframe$1;
|
|
729
|
-
case Img
|
|
730
|
-
return Img$
|
|
731
|
-
case Input
|
|
732
|
-
return Input$
|
|
733
|
-
case Ins
|
|
734
|
-
return Ins$
|
|
735
|
-
case Kbd
|
|
736
|
-
return Kbd$
|
|
737
|
-
case Label
|
|
738
|
-
return Label$
|
|
880
|
+
case Img:
|
|
881
|
+
return Img$1;
|
|
882
|
+
case Input:
|
|
883
|
+
return Input$1;
|
|
884
|
+
case Ins:
|
|
885
|
+
return Ins$1;
|
|
886
|
+
case Kbd:
|
|
887
|
+
return Kbd$1;
|
|
888
|
+
case Label:
|
|
889
|
+
return Label$1;
|
|
739
890
|
case Li$1:
|
|
740
891
|
return Li$2;
|
|
892
|
+
case Line:
|
|
893
|
+
return Line$1;
|
|
894
|
+
case Main:
|
|
895
|
+
return Main$1;
|
|
741
896
|
case Meta:
|
|
742
897
|
return Meta$1;
|
|
743
|
-
case Nav
|
|
744
|
-
return Nav$
|
|
898
|
+
case Nav:
|
|
899
|
+
return Nav$1;
|
|
745
900
|
case Ol$1:
|
|
746
901
|
return Ol$2;
|
|
747
|
-
case Option
|
|
748
|
-
return Option$
|
|
749
|
-
case P
|
|
750
|
-
return P$
|
|
751
|
-
case
|
|
752
|
-
return
|
|
902
|
+
case Option:
|
|
903
|
+
return Option$1;
|
|
904
|
+
case P:
|
|
905
|
+
return P$1;
|
|
906
|
+
case Path:
|
|
907
|
+
return Path$1;
|
|
908
|
+
case Polygon:
|
|
909
|
+
return Polygon$1;
|
|
910
|
+
case Polyline:
|
|
911
|
+
return Polyline$1;
|
|
912
|
+
case Pre:
|
|
913
|
+
return Pre$1;
|
|
753
914
|
case Quote$2:
|
|
754
|
-
return Quote$
|
|
755
|
-
case
|
|
756
|
-
return
|
|
757
|
-
case
|
|
758
|
-
return
|
|
759
|
-
case
|
|
760
|
-
return
|
|
761
|
-
case
|
|
762
|
-
return
|
|
915
|
+
return Quote$3;
|
|
916
|
+
case Rect:
|
|
917
|
+
return Rect$1;
|
|
918
|
+
case Search:
|
|
919
|
+
return Search$1;
|
|
920
|
+
case Section:
|
|
921
|
+
return Section$1;
|
|
922
|
+
case Select:
|
|
923
|
+
return Select$1;
|
|
924
|
+
case Span:
|
|
925
|
+
return Span$1;
|
|
763
926
|
case Strong:
|
|
764
927
|
return Strong$1;
|
|
765
928
|
case Style:
|
|
766
929
|
return Style$1;
|
|
767
|
-
case
|
|
768
|
-
return
|
|
769
|
-
case
|
|
770
|
-
return
|
|
771
|
-
case
|
|
772
|
-
return
|
|
773
|
-
case
|
|
774
|
-
return
|
|
775
|
-
case
|
|
776
|
-
return
|
|
777
|
-
case
|
|
778
|
-
return
|
|
779
|
-
case
|
|
780
|
-
return
|
|
781
|
-
case
|
|
782
|
-
return
|
|
930
|
+
case Svg:
|
|
931
|
+
return Svg$1;
|
|
932
|
+
case Table:
|
|
933
|
+
return Table$1;
|
|
934
|
+
case TBody:
|
|
935
|
+
return TBody$1;
|
|
936
|
+
case Td:
|
|
937
|
+
return Td$1;
|
|
938
|
+
case TextArea:
|
|
939
|
+
return TextArea$1;
|
|
940
|
+
case Tfoot:
|
|
941
|
+
return Tfoot$1;
|
|
942
|
+
case Th:
|
|
943
|
+
return Th$1;
|
|
944
|
+
case THead:
|
|
945
|
+
return THead$1;
|
|
946
|
+
case Time:
|
|
947
|
+
return Time$1;
|
|
783
948
|
case Title:
|
|
784
949
|
return Title$1;
|
|
785
950
|
case Tr$1:
|
|
786
951
|
return Tr$2;
|
|
787
|
-
case Ul
|
|
788
|
-
return Ul$
|
|
952
|
+
case Ul:
|
|
953
|
+
return Ul$1;
|
|
954
|
+
case Use:
|
|
955
|
+
return Use$1;
|
|
789
956
|
case Video$1:
|
|
790
957
|
return Video$2;
|
|
791
958
|
default:
|
|
792
959
|
throw new Error(`element tag not found ${type}`);
|
|
793
960
|
}
|
|
794
961
|
};
|
|
962
|
+
|
|
795
963
|
const ElementTagMap = {
|
|
796
964
|
__proto__: null,
|
|
797
965
|
getElementTag: getElementTag$1
|
|
798
966
|
};
|
|
799
|
-
const {
|
|
800
|
-
getElementTag
|
|
801
|
-
} = ElementTagMap;
|
|
802
|
-
const instances = Object.create(null);
|
|
803
|
-
const get$1$1 = viewletId => {
|
|
804
|
-
return instances[viewletId];
|
|
805
|
-
};
|
|
806
|
-
const set$1$1 = (viewletId, instance) => {
|
|
807
|
-
instances[viewletId] = instance;
|
|
808
|
-
};
|
|
809
|
-
const getEventListenerOptions$1 = (eventName, value) => {
|
|
810
|
-
if (value.passive) {
|
|
811
|
-
return {
|
|
812
|
-
passive: true
|
|
813
|
-
};
|
|
814
|
-
}
|
|
815
|
-
if (value.capture) {
|
|
816
|
-
return {
|
|
817
|
-
capture: true
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
switch (eventName) {
|
|
821
|
-
case 'wheel':
|
|
822
|
-
return {
|
|
823
|
-
passive: true
|
|
824
|
-
};
|
|
825
|
-
default:
|
|
826
|
-
return undefined;
|
|
827
|
-
}
|
|
828
|
-
};
|
|
829
|
-
const cache$1 = new Map();
|
|
830
|
-
const has$1 = listener => {
|
|
831
|
-
return cache$1.has(listener);
|
|
832
|
-
};
|
|
833
|
-
const set$8 = (listener, value) => {
|
|
834
|
-
cache$1.set(listener, value);
|
|
835
|
-
};
|
|
836
|
-
const get$9 = listener => {
|
|
837
|
-
return cache$1.get(listener);
|
|
838
|
-
};
|
|
839
|
-
const getWrappedListener$1 = (listener, returnValue) => {
|
|
840
|
-
if (!returnValue) {
|
|
841
|
-
return listener;
|
|
842
|
-
}
|
|
843
|
-
if (!has$1(listener)) {
|
|
844
|
-
const wrapped = event => {
|
|
845
|
-
const uid = getComponentUidFromEvent(event);
|
|
846
|
-
const result = listener(event);
|
|
847
|
-
// TODO check for empty array by value
|
|
848
|
-
if (result.length === 0) {
|
|
849
|
-
return;
|
|
850
|
-
}
|
|
851
|
-
const ipc = getIpc();
|
|
852
|
-
ipc.send('Viewlet.executeViewletCommand', uid, ...result);
|
|
853
|
-
};
|
|
854
|
-
nameAnonymousFunction$1(wrapped, listener.name);
|
|
855
|
-
set$8(listener, wrapped);
|
|
856
|
-
}
|
|
857
|
-
return get$9(listener);
|
|
858
|
-
};
|
|
859
|
-
const attachedListeners = new WeakMap();
|
|
860
|
-
const getOptions = fn => {
|
|
861
|
-
if (fn.passive) {
|
|
862
|
-
return {
|
|
863
|
-
passive: true
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
if (fn.capture) {
|
|
867
|
-
return {
|
|
868
|
-
capture: true
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
|
-
return undefined;
|
|
872
|
-
};
|
|
873
|
-
const attachEvent$1 = ($Node, eventMap, key, value, newEventMap) => {
|
|
874
|
-
const keyLower = key.toLowerCase();
|
|
875
|
-
const listenersByEvent = attachedListeners.get($Node) || new Map();
|
|
876
|
-
const previous = listenersByEvent.get(keyLower);
|
|
877
|
-
if (previous) {
|
|
878
|
-
$Node.removeEventListener(keyLower, previous.listener, previous.options);
|
|
879
|
-
}
|
|
880
|
-
if (newEventMap && newEventMap[value]) {
|
|
881
|
-
const fn = newEventMap[value];
|
|
882
|
-
const options = getOptions(fn);
|
|
883
|
-
// TODO support event listener options
|
|
884
|
-
$Node.addEventListener(keyLower, newEventMap[value], options);
|
|
885
|
-
listenersByEvent.set(keyLower, {
|
|
886
|
-
listener: newEventMap[value],
|
|
887
|
-
options
|
|
888
|
-
});
|
|
889
|
-
attachedListeners.set($Node, listenersByEvent);
|
|
890
|
-
return;
|
|
891
|
-
}
|
|
892
|
-
const listener = eventMap[value];
|
|
893
|
-
if (!listener) {
|
|
894
|
-
console.warn('listener not found', value);
|
|
895
|
-
return;
|
|
896
|
-
}
|
|
897
|
-
const options = getEventListenerOptions$1(key, value);
|
|
898
|
-
const wrapped = getWrappedListener$1(listener, eventMap.returnValue);
|
|
899
|
-
$Node.addEventListener(keyLower, wrapped, options);
|
|
900
|
-
listenersByEvent.set(keyLower, {
|
|
901
|
-
listener: wrapped,
|
|
902
|
-
options
|
|
903
|
-
});
|
|
904
|
-
attachedListeners.set($Node, listenersByEvent);
|
|
905
|
-
};
|
|
906
|
-
const STYLE_REGEX = /([^:;]+):\s*([^;]+)/g;
|
|
907
|
-
const KEBAB_CASE_REGEX = /-([a-z])/g;
|
|
908
|
-
const setStyle = ($Element, styleString) => {
|
|
909
|
-
if (typeof styleString !== 'string') {
|
|
910
|
-
return;
|
|
911
|
-
}
|
|
912
|
-
let match;
|
|
913
|
-
while ((match = STYLE_REGEX.exec(styleString)) !== null) {
|
|
914
|
-
const key = match[1].trim();
|
|
915
|
-
const value = match[2].trim();
|
|
916
|
-
// Convert kebab-case to camelCase for CSS properties with dashes
|
|
917
|
-
const camelCaseKey = key.replaceAll(KEBAB_CASE_REGEX, (_, char) => char.toUpperCase());
|
|
918
|
-
$Element.style[camelCaseKey] = value;
|
|
919
|
-
}
|
|
920
|
-
};
|
|
921
|
-
const setProp = ($Element, key, value, eventMap, newEventMap) => {
|
|
922
|
-
switch (key) {
|
|
923
|
-
case 'ariaActivedescendant':
|
|
924
|
-
if (value) {
|
|
925
|
-
$Element.setAttribute('aria-activedescendant', value);
|
|
926
|
-
} else {
|
|
927
|
-
$Element.removeAttribute('aria-activedescendant');
|
|
928
|
-
}
|
|
929
|
-
break;
|
|
930
|
-
case 'ariaControls':
|
|
931
|
-
$Element.setAttribute('aria-controls', value);
|
|
932
|
-
break;
|
|
933
|
-
case 'ariaLabelledBy':
|
|
934
|
-
$Element.setAttribute('aria-labelledby', value);
|
|
935
|
-
break;
|
|
936
|
-
case 'ariaOwns':
|
|
937
|
-
// TODO remove this once idl is supported
|
|
938
|
-
if (value) {
|
|
939
|
-
$Element.setAttribute('aria-owns', value);
|
|
940
|
-
} else {
|
|
941
|
-
$Element.removeAttribute('aria-owns');
|
|
942
|
-
}
|
|
943
|
-
break;
|
|
944
|
-
case 'childCount':
|
|
945
|
-
case 'type':
|
|
946
|
-
break;
|
|
947
|
-
case 'height':
|
|
948
|
-
case 'width':
|
|
949
|
-
if ($Element instanceof HTMLImageElement) {
|
|
950
|
-
$Element[key] = value;
|
|
951
|
-
} else if (typeof value === 'number') {
|
|
952
|
-
$Element.style[key] = `${value}px`;
|
|
953
|
-
} else {
|
|
954
|
-
$Element.style[key] = value;
|
|
955
|
-
}
|
|
956
|
-
break;
|
|
957
|
-
case 'id':
|
|
958
|
-
if (value) {
|
|
959
|
-
$Element[key] = value;
|
|
960
|
-
} else {
|
|
961
|
-
$Element.removeAttribute(key);
|
|
962
|
-
}
|
|
963
|
-
break;
|
|
964
|
-
case 'inputType':
|
|
965
|
-
// @ts-ignore
|
|
966
|
-
$Element.type = value;
|
|
967
|
-
break;
|
|
968
|
-
case 'left':
|
|
969
|
-
case 'marginTop':
|
|
970
|
-
case 'paddingLeft':
|
|
971
|
-
case 'paddingRight':
|
|
972
|
-
case 'top':
|
|
973
|
-
$Element.style[key] = typeof value === 'number' ? `${value}px` : value;
|
|
974
|
-
break;
|
|
975
|
-
case 'maskImage':
|
|
976
|
-
$Element.style.maskImage = `url('${value}')`;
|
|
977
|
-
$Element.style.webkitMaskImage = `url('${value}')`;
|
|
978
|
-
break;
|
|
979
|
-
case 'onBlur':
|
|
980
|
-
case 'onChange':
|
|
981
|
-
case 'onClick':
|
|
982
|
-
case 'onContextMenu':
|
|
983
|
-
case 'onDblClick':
|
|
984
|
-
case 'onDragEnd':
|
|
985
|
-
case 'onDragEnter':
|
|
986
|
-
case 'onDragLeave':
|
|
987
|
-
case 'onDragOver':
|
|
988
|
-
case 'onDragStart':
|
|
989
|
-
case 'onDrop':
|
|
990
|
-
case 'onFocus':
|
|
991
|
-
case 'onFocusIn':
|
|
992
|
-
case 'onFocusOut':
|
|
993
|
-
case 'onInput':
|
|
994
|
-
case 'onKeydown':
|
|
995
|
-
case 'onKeyDown':
|
|
996
|
-
case 'onKeyUp':
|
|
997
|
-
case 'onMouseDown':
|
|
998
|
-
case 'onMouseMove':
|
|
999
|
-
case 'onMouseOut':
|
|
1000
|
-
case 'onMouseOver':
|
|
1001
|
-
case 'onMouseUp':
|
|
1002
|
-
case 'onPointerDown':
|
|
1003
|
-
case 'onPointerMove':
|
|
1004
|
-
case 'onPointerOut':
|
|
1005
|
-
case 'onPointerOver':
|
|
1006
|
-
case 'onScroll':
|
|
1007
|
-
case 'onSelectionChange':
|
|
1008
|
-
case 'onSubmit':
|
|
1009
|
-
case 'onWheel':
|
|
1010
|
-
const eventName = key.slice(2).toLowerCase();
|
|
1011
|
-
if (!eventMap || !value) {
|
|
1012
|
-
return;
|
|
1013
|
-
}
|
|
1014
|
-
attachEvent$1($Element, eventMap, eventName, value, newEventMap);
|
|
1015
|
-
break;
|
|
1016
|
-
case 'style':
|
|
1017
|
-
setStyle($Element, value);
|
|
1018
|
-
break;
|
|
1019
|
-
case 'translate':
|
|
1020
|
-
$Element.style[key] = value;
|
|
1021
|
-
break;
|
|
1022
|
-
default:
|
|
1023
|
-
if (key.startsWith('data-')) {
|
|
1024
|
-
$Element.dataset[key.slice('data-'.length)] = value;
|
|
1025
|
-
} else {
|
|
1026
|
-
$Element[key] = value;
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
};
|
|
1030
|
-
const setProps = ($Element, props, eventMap, newEventMap) => {
|
|
1031
|
-
for (const key in props) {
|
|
1032
|
-
setProp($Element, key, props[key], eventMap, newEventMap);
|
|
1033
|
-
}
|
|
1034
|
-
};
|
|
1035
|
-
const {
|
|
1036
|
-
Text: Text$2,
|
|
1037
|
-
Reference} = VirtualDomElements$1;
|
|
1038
|
-
const renderDomTextNode = element => {
|
|
1039
|
-
return document.createTextNode(element.text);
|
|
1040
|
-
};
|
|
1041
|
-
const renderDomElement = (element, eventMap, newEventMap) => {
|
|
1042
|
-
const tag = getElementTag(element.type);
|
|
1043
|
-
const $Element = document.createElement(tag);
|
|
1044
|
-
setProps($Element, element, eventMap, newEventMap);
|
|
1045
|
-
return $Element;
|
|
1046
|
-
};
|
|
1047
|
-
const renderReferenceNode = element => {
|
|
1048
|
-
const instance = get$1$1(element.uid);
|
|
1049
|
-
if (!instance || !instance.state) {
|
|
1050
|
-
return document.createTextNode('Reference node not found');
|
|
1051
|
-
}
|
|
1052
|
-
const $Node = instance.state.$Viewlet;
|
|
1053
|
-
return $Node;
|
|
1054
|
-
};
|
|
1055
|
-
const render$1 = (element, eventMap, newEventMap) => {
|
|
1056
|
-
switch (element.type) {
|
|
1057
|
-
case Reference:
|
|
1058
|
-
return renderReferenceNode(element);
|
|
1059
|
-
case Text$2:
|
|
1060
|
-
return renderDomTextNode(element);
|
|
1061
|
-
default:
|
|
1062
|
-
return renderDomElement(element, eventMap, newEventMap);
|
|
1063
|
-
}
|
|
1064
|
-
};
|
|
1065
|
-
const renderInternal = ($Parent, elements, eventMap, newEventMap) => {
|
|
1066
|
-
const max = elements.length - 1;
|
|
1067
|
-
let stack = [];
|
|
1068
|
-
for (let i = max; i >= 0; i--) {
|
|
1069
|
-
const element = elements[i];
|
|
1070
|
-
const $Element = render$1(element, eventMap, newEventMap);
|
|
1071
|
-
if (element.childCount > 0) {
|
|
1072
|
-
// @ts-expect-error
|
|
1073
|
-
$Element.append(...stack.slice(0, element.childCount));
|
|
1074
|
-
stack = stack.slice(element.childCount);
|
|
1075
|
-
}
|
|
1076
|
-
stack.unshift($Element);
|
|
1077
|
-
}
|
|
1078
|
-
$Parent.append(...stack);
|
|
1079
|
-
};
|
|
1080
|
-
const renderInto = ($Parent, dom, eventMap = {}) => {
|
|
1081
|
-
clearNode($Parent);
|
|
1082
|
-
renderInternal($Parent, dom, eventMap);
|
|
1083
|
-
};
|
|
1084
|
-
|
|
1085
|
-
/**
|
|
1086
|
-
*
|
|
1087
|
-
* @param {any[]} elements
|
|
1088
|
-
* @returns
|
|
1089
|
-
*/
|
|
1090
|
-
const render = (elements, eventMap = {}, newEventMap = {}) => {
|
|
1091
|
-
const $Root = document.createElement('div');
|
|
1092
|
-
renderInternal($Root, elements, eventMap, newEventMap);
|
|
1093
|
-
return $Root;
|
|
1094
|
-
};
|
|
1095
|
-
const rememberFocus2 = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
1096
|
-
if (uid) {
|
|
1097
|
-
const newEventMap = getEventListenerMap(uid);
|
|
1098
|
-
const $New = render(dom, eventMap, newEventMap).firstChild;
|
|
1099
|
-
setComponentUid($New, uid);
|
|
1100
|
-
$Viewlet.replaceWith($New);
|
|
1101
|
-
$Viewlet = $New;
|
|
1102
|
-
} else {
|
|
1103
|
-
renderInto($Viewlet, dom, eventMap);
|
|
1104
|
-
}
|
|
1105
|
-
return $Viewlet;
|
|
1106
|
-
};
|
|
1107
967
|
|
|
1108
|
-
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
968
|
+
const Backspace$1 = 'Backspace';
|
|
969
|
+
const Tab$1 = 'Tab';
|
|
970
|
+
const Space$1 = ' ';
|
|
971
|
+
const Space2 = 'Space';
|
|
972
|
+
const Enter$1 = 'Enter';
|
|
973
|
+
const Escape$1 = 'Escape';
|
|
974
|
+
const PageUp$1 = 'PageUp';
|
|
975
|
+
const PageDown$1 = 'PageDown';
|
|
976
|
+
const Home$1 = 'Home';
|
|
977
|
+
const End$1 = 'End';
|
|
978
|
+
const LeftArrow$1 = 'ArrowLeft';
|
|
979
|
+
const RightArrow$1 = 'ArrowRight';
|
|
980
|
+
const UpArrow$1 = 'ArrowUp';
|
|
981
|
+
const DownArrow$1 = 'ArrowDown';
|
|
982
|
+
const Insert$1 = 'Insert';
|
|
983
|
+
const Delete$1 = 'Delete';
|
|
984
|
+
const Digit0$1 = '0';
|
|
985
|
+
const Digit1$1 = '1';
|
|
986
|
+
const Digit2$1 = '2';
|
|
987
|
+
const Digit3$1 = '3';
|
|
988
|
+
const Digit4$1 = '4';
|
|
989
|
+
const Digit5$1 = '5';
|
|
990
|
+
const Digit6$1 = '6';
|
|
991
|
+
const Digit7$1 = '7';
|
|
992
|
+
const Digit8$1 = '8';
|
|
993
|
+
const Digit9$1 = '9';
|
|
994
|
+
const KeyA$1 = 'a';
|
|
995
|
+
const KeyB$1 = 'b';
|
|
996
|
+
const KeyC$1 = 'c';
|
|
997
|
+
const KeyD$1 = 'd';
|
|
998
|
+
const KeyE$1 = 'e';
|
|
999
|
+
const KeyF$1 = 'f';
|
|
1000
|
+
const KeyG$1 = 'g';
|
|
1001
|
+
const KeyH$1 = 'h';
|
|
1002
|
+
const KeyI$1 = 'i';
|
|
1003
|
+
const KeyJ$1 = 'j';
|
|
1004
|
+
const KeyK$1 = 'k';
|
|
1005
|
+
const KeyL$1 = 'l';
|
|
1006
|
+
const KeyM$1 = 'm';
|
|
1007
|
+
const KeyN$1 = 'n';
|
|
1008
|
+
const KeyO$1 = 'o';
|
|
1009
|
+
const KeyP$1 = 'p';
|
|
1010
|
+
const KeyQ$1 = 'q';
|
|
1011
|
+
const KeyR$1 = 'r';
|
|
1012
|
+
const KeyS$1 = 's';
|
|
1013
|
+
const KeyT$1 = 't';
|
|
1014
|
+
const KeyU$1 = 'u';
|
|
1015
|
+
const KeyV$1 = 'v';
|
|
1016
|
+
const KeyW$1 = 'w';
|
|
1017
|
+
const KeyX$1 = 'x';
|
|
1018
|
+
const KeyY$1 = 'y';
|
|
1019
|
+
const KeyZ$1 = 'z';
|
|
1020
|
+
const F1$1 = 'F1';
|
|
1021
|
+
const F2$1 = 'F2';
|
|
1022
|
+
const F3$1 = 'F3';
|
|
1023
|
+
const F4$1 = 'F4';
|
|
1024
|
+
const F5$1 = 'F5';
|
|
1025
|
+
const F6$1 = 'F6';
|
|
1026
|
+
const F7$1 = 'F7';
|
|
1027
|
+
const F8$1 = 'F8';
|
|
1028
|
+
const F9$1 = 'F9';
|
|
1029
|
+
const F10$1 = 'F10';
|
|
1030
|
+
const F11$1 = 'F11';
|
|
1031
|
+
const F12$1 = 'F12';
|
|
1032
|
+
const F13$1 = 'F13';
|
|
1033
|
+
const F14$1 = 'F14';
|
|
1034
|
+
const F15$1 = 'F15';
|
|
1035
|
+
const F16$1 = 'F16';
|
|
1036
|
+
const F17$1 = 'F17';
|
|
1037
|
+
const F18$1 = 'F18';
|
|
1038
|
+
const F19$1 = 'F19';
|
|
1039
|
+
const F20$1 = 'F20';
|
|
1040
|
+
const F21$1 = 'F21';
|
|
1041
|
+
const F22$1 = 'F22';
|
|
1042
|
+
const F23$1 = 'F23';
|
|
1043
|
+
const F24$1 = 'F24';
|
|
1044
|
+
const SemiColon$1 = ';';
|
|
1045
|
+
const Equal$1 = '=';
|
|
1046
|
+
const Comma$1 = ',';
|
|
1047
|
+
const Minus$1 = '-';
|
|
1048
|
+
const Period$1 = '.';
|
|
1049
|
+
const Slash$1 = '/';
|
|
1050
|
+
const Backquote$1 = '`';
|
|
1051
|
+
const Backquote2 = 'Backquote';
|
|
1052
|
+
const BracketLeft$1 = '[';
|
|
1053
|
+
const Backslash$1 = '\\';
|
|
1054
|
+
const BracketRight$1 = ']';
|
|
1055
|
+
const Quote$1 = `'`;
|
|
1056
|
+
const Star$1 = '*';
|
|
1057
|
+
const Plus$1 = '+';
|
|
1118
1058
|
|
|
1119
|
-
|
|
1120
|
-
const
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
const
|
|
1158
|
-
const
|
|
1159
|
-
const
|
|
1160
|
-
const
|
|
1161
|
-
const
|
|
1162
|
-
const
|
|
1163
|
-
const
|
|
1164
|
-
const
|
|
1165
|
-
const
|
|
1166
|
-
const
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1059
|
+
const Unknown = 0;
|
|
1060
|
+
const Backspace = 1;
|
|
1061
|
+
const Tab = 2;
|
|
1062
|
+
const Enter = 3;
|
|
1063
|
+
const Escape = 8;
|
|
1064
|
+
const Space = 9;
|
|
1065
|
+
const PageUp = 10;
|
|
1066
|
+
const PageDown = 11;
|
|
1067
|
+
const End = 255;
|
|
1068
|
+
const Home = 12;
|
|
1069
|
+
const LeftArrow = 13;
|
|
1070
|
+
const UpArrow = 14;
|
|
1071
|
+
const RightArrow = 15;
|
|
1072
|
+
const DownArrow = 16;
|
|
1073
|
+
const Insert = 17;
|
|
1074
|
+
const Delete = 18;
|
|
1075
|
+
const Digit0 = 19;
|
|
1076
|
+
const Digit1 = 20;
|
|
1077
|
+
const Digit2 = 21;
|
|
1078
|
+
const Digit3 = 22;
|
|
1079
|
+
const Digit4 = 23;
|
|
1080
|
+
const Digit5 = 24;
|
|
1081
|
+
const Digit6 = 25;
|
|
1082
|
+
const Digit7 = 26;
|
|
1083
|
+
const Digit8 = 27;
|
|
1084
|
+
const Digit9 = 28;
|
|
1085
|
+
const KeyA = 29;
|
|
1086
|
+
const KeyB = 30;
|
|
1087
|
+
const KeyC = 31;
|
|
1088
|
+
const KeyD = 32;
|
|
1089
|
+
const KeyE = 33;
|
|
1090
|
+
const KeyF = 34;
|
|
1091
|
+
const KeyG = 35;
|
|
1092
|
+
const KeyH = 36;
|
|
1093
|
+
const KeyI = 37;
|
|
1094
|
+
const KeyJ = 38;
|
|
1095
|
+
const KeyK = 39;
|
|
1096
|
+
const KeyL = 40;
|
|
1097
|
+
const KeyM = 41;
|
|
1098
|
+
const KeyN = 42;
|
|
1099
|
+
const KeyO = 43;
|
|
1100
|
+
const KeyP = 44;
|
|
1101
|
+
const KeyQ = 45;
|
|
1102
|
+
const KeyR = 46;
|
|
1103
|
+
const KeyS = 47;
|
|
1104
|
+
const KeyT = 48;
|
|
1105
|
+
const KeyU = 49;
|
|
1106
|
+
const KeyV = 50;
|
|
1107
|
+
const KeyW = 51;
|
|
1108
|
+
const KeyX = 52;
|
|
1109
|
+
const KeyY = 53;
|
|
1110
|
+
const KeyZ = 54;
|
|
1111
|
+
const F1 = 57;
|
|
1112
|
+
const F2 = 58;
|
|
1113
|
+
const F3 = 59;
|
|
1114
|
+
const F4 = 60;
|
|
1115
|
+
const F5 = 61;
|
|
1116
|
+
const F6 = 62;
|
|
1117
|
+
const F7 = 63;
|
|
1118
|
+
const F8 = 64;
|
|
1119
|
+
const F9 = 65;
|
|
1120
|
+
const F10 = 66;
|
|
1121
|
+
const F11 = 67;
|
|
1122
|
+
const F12 = 68;
|
|
1123
|
+
const F13 = 69;
|
|
1124
|
+
const F14 = 70;
|
|
1125
|
+
const F15 = 71;
|
|
1126
|
+
const F16 = 72;
|
|
1127
|
+
const F17 = 72;
|
|
1128
|
+
const F18 = 74;
|
|
1129
|
+
const F19 = 75;
|
|
1130
|
+
const F20 = 76;
|
|
1131
|
+
const F21 = 77;
|
|
1132
|
+
const F22 = 78;
|
|
1133
|
+
const F23 = 79;
|
|
1134
|
+
const F24 = 80;
|
|
1135
|
+
const SemiColon = 83;
|
|
1136
|
+
const Equal = 84;
|
|
1137
|
+
const Comma = 85;
|
|
1138
|
+
const Minus = 86;
|
|
1139
|
+
const Period = 87;
|
|
1140
|
+
const Slash = 88;
|
|
1141
|
+
const Backquote = 89;
|
|
1142
|
+
const BracketLeft = 90;
|
|
1143
|
+
const Backslash = 91;
|
|
1144
|
+
const BracketRight = 92;
|
|
1145
|
+
const Quote = 93;
|
|
1146
|
+
const Star = 131;
|
|
1147
|
+
const Plus = 132;
|
|
1148
|
+
|
|
1149
|
+
const getKeyCode = key => {
|
|
1150
|
+
switch (key) {
|
|
1151
|
+
case Backquote$1:
|
|
1152
|
+
case Backquote2:
|
|
1153
|
+
return Backquote;
|
|
1154
|
+
case Backslash$1:
|
|
1155
|
+
return Backslash;
|
|
1156
|
+
case Backspace$1:
|
|
1157
|
+
return Backspace;
|
|
1158
|
+
case BracketLeft$1:
|
|
1159
|
+
return BracketLeft;
|
|
1160
|
+
case BracketRight$1:
|
|
1161
|
+
return BracketRight;
|
|
1162
|
+
case Comma$1:
|
|
1163
|
+
return Comma;
|
|
1164
|
+
case Delete$1:
|
|
1165
|
+
return Delete;
|
|
1166
|
+
case Digit0$1:
|
|
1167
|
+
return Digit0;
|
|
1168
|
+
case Digit1$1:
|
|
1169
|
+
return Digit1;
|
|
1170
|
+
case Digit2$1:
|
|
1171
|
+
return Digit2;
|
|
1172
|
+
case Digit3$1:
|
|
1173
|
+
return Digit3;
|
|
1174
|
+
case Digit4$1:
|
|
1175
|
+
return Digit4;
|
|
1176
|
+
case Digit5$1:
|
|
1177
|
+
return Digit5;
|
|
1178
|
+
case Digit6$1:
|
|
1179
|
+
return Digit6;
|
|
1180
|
+
case Digit7$1:
|
|
1181
|
+
return Digit7;
|
|
1182
|
+
case Digit8$1:
|
|
1183
|
+
return Digit8;
|
|
1184
|
+
case Digit9$1:
|
|
1185
|
+
return Digit9;
|
|
1186
|
+
case DownArrow$1:
|
|
1187
|
+
return DownArrow;
|
|
1188
|
+
case End$1:
|
|
1189
|
+
return End;
|
|
1190
|
+
case Enter$1:
|
|
1191
|
+
return Enter;
|
|
1192
|
+
case Equal$1:
|
|
1193
|
+
return Equal;
|
|
1194
|
+
case Escape$1:
|
|
1195
|
+
return Escape;
|
|
1196
|
+
case F1$1:
|
|
1197
|
+
return F1;
|
|
1198
|
+
case F10$1:
|
|
1199
|
+
return F10;
|
|
1200
|
+
case F11$1:
|
|
1201
|
+
return F11;
|
|
1202
|
+
case F12$1:
|
|
1203
|
+
return F12;
|
|
1204
|
+
case F13$1:
|
|
1205
|
+
return F13;
|
|
1206
|
+
case F14$1:
|
|
1207
|
+
return F14;
|
|
1208
|
+
case F15$1:
|
|
1209
|
+
return F15;
|
|
1210
|
+
case F16$1:
|
|
1211
|
+
return F16;
|
|
1212
|
+
case F17$1:
|
|
1213
|
+
return F17;
|
|
1214
|
+
case F18$1:
|
|
1215
|
+
return F18;
|
|
1216
|
+
case F19$1:
|
|
1217
|
+
return F19;
|
|
1218
|
+
case F2$1:
|
|
1219
|
+
return F2;
|
|
1220
|
+
case F20$1:
|
|
1221
|
+
return F20;
|
|
1222
|
+
case F21$1:
|
|
1223
|
+
return F21;
|
|
1224
|
+
case F22$1:
|
|
1225
|
+
return F22;
|
|
1226
|
+
case F23$1:
|
|
1227
|
+
return F23;
|
|
1228
|
+
case F24$1:
|
|
1229
|
+
return F24;
|
|
1230
|
+
case F3$1:
|
|
1231
|
+
return F3;
|
|
1232
|
+
case F4$1:
|
|
1233
|
+
return F4;
|
|
1234
|
+
case F5$1:
|
|
1235
|
+
return F5;
|
|
1236
|
+
case F6$1:
|
|
1237
|
+
return F6;
|
|
1238
|
+
case F7$1:
|
|
1239
|
+
return F7;
|
|
1240
|
+
case F8$1:
|
|
1241
|
+
return F8;
|
|
1242
|
+
case F9$1:
|
|
1243
|
+
return F9;
|
|
1244
|
+
case Home$1:
|
|
1245
|
+
return Home;
|
|
1246
|
+
case Insert$1:
|
|
1247
|
+
return Insert;
|
|
1248
|
+
case KeyA$1:
|
|
1249
|
+
return KeyA;
|
|
1250
|
+
case KeyB$1:
|
|
1251
|
+
return KeyB;
|
|
1252
|
+
case KeyC$1:
|
|
1253
|
+
return KeyC;
|
|
1254
|
+
case KeyD$1:
|
|
1255
|
+
return KeyD;
|
|
1256
|
+
case KeyE$1:
|
|
1257
|
+
return KeyE;
|
|
1258
|
+
case KeyF$1:
|
|
1259
|
+
return KeyF;
|
|
1260
|
+
case KeyG$1:
|
|
1261
|
+
return KeyG;
|
|
1262
|
+
case KeyH$1:
|
|
1263
|
+
return KeyH;
|
|
1264
|
+
case KeyI$1:
|
|
1265
|
+
return KeyI;
|
|
1266
|
+
case KeyJ$1:
|
|
1267
|
+
return KeyJ;
|
|
1268
|
+
case KeyK$1:
|
|
1269
|
+
return KeyK;
|
|
1270
|
+
case KeyL$1:
|
|
1271
|
+
return KeyL;
|
|
1272
|
+
case KeyM$1:
|
|
1273
|
+
return KeyM;
|
|
1274
|
+
case KeyN$1:
|
|
1275
|
+
return KeyN;
|
|
1276
|
+
case KeyO$1:
|
|
1277
|
+
return KeyO;
|
|
1278
|
+
case KeyP$1:
|
|
1279
|
+
return KeyP;
|
|
1280
|
+
case KeyQ$1:
|
|
1281
|
+
return KeyQ;
|
|
1282
|
+
case KeyR$1:
|
|
1283
|
+
return KeyR;
|
|
1284
|
+
case KeyS$1:
|
|
1285
|
+
return KeyS;
|
|
1286
|
+
case KeyT$1:
|
|
1287
|
+
return KeyT;
|
|
1288
|
+
case KeyU$1:
|
|
1289
|
+
return KeyU;
|
|
1290
|
+
case KeyV$1:
|
|
1291
|
+
return KeyV;
|
|
1292
|
+
case KeyW$1:
|
|
1293
|
+
return KeyW;
|
|
1294
|
+
case KeyX$1:
|
|
1295
|
+
return KeyX;
|
|
1296
|
+
case KeyY$1:
|
|
1297
|
+
return KeyY;
|
|
1298
|
+
case KeyZ$1:
|
|
1299
|
+
return KeyZ;
|
|
1300
|
+
case LeftArrow$1:
|
|
1301
|
+
return LeftArrow;
|
|
1302
|
+
case Minus$1:
|
|
1303
|
+
return Minus;
|
|
1304
|
+
case PageDown$1:
|
|
1305
|
+
return PageDown;
|
|
1306
|
+
case PageUp$1:
|
|
1307
|
+
return PageUp;
|
|
1308
|
+
case Period$1:
|
|
1309
|
+
return Period;
|
|
1310
|
+
case Plus$1:
|
|
1311
|
+
return Plus;
|
|
1312
|
+
case Quote$1:
|
|
1313
|
+
return Quote;
|
|
1314
|
+
case RightArrow$1:
|
|
1315
|
+
return RightArrow;
|
|
1316
|
+
case SemiColon$1:
|
|
1317
|
+
return SemiColon;
|
|
1318
|
+
case Slash$1:
|
|
1319
|
+
return Slash;
|
|
1320
|
+
case Space$1:
|
|
1321
|
+
case Space2:
|
|
1322
|
+
return Space;
|
|
1323
|
+
case Star$1:
|
|
1324
|
+
return Star;
|
|
1325
|
+
case Tab$1:
|
|
1326
|
+
return Tab;
|
|
1327
|
+
case UpArrow$1:
|
|
1328
|
+
return UpArrow;
|
|
1329
|
+
default:
|
|
1330
|
+
return Unknown;
|
|
1331
|
+
}
|
|
1332
|
+
};
|
|
1333
|
+
|
|
1334
|
+
const CtrlCmd = 1 << 11 >>> 0;
|
|
1335
|
+
const Shift = 1 << 10 >>> 0;
|
|
1336
|
+
const Alt$1 = 1 << 9 >>> 0;
|
|
1337
|
+
|
|
1338
|
+
const {
|
|
1339
|
+
getElementTag
|
|
1340
|
+
} = ElementTagMap;
|
|
1341
|
+
|
|
1342
|
+
const instances = Object.create(null);
|
|
1343
|
+
const get$a = viewletId => {
|
|
1344
|
+
return instances[viewletId];
|
|
1345
|
+
};
|
|
1346
|
+
const set$9 = (viewletId, instance) => {
|
|
1347
|
+
instances[viewletId] = instance;
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1350
|
+
const getEventListenerOptions$1 = (eventName, value) => {
|
|
1351
|
+
if (value.passive) {
|
|
1352
|
+
return {
|
|
1353
|
+
passive: true
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
if (value.capture) {
|
|
1357
|
+
return {
|
|
1358
|
+
capture: true
|
|
1359
|
+
};
|
|
1360
|
+
}
|
|
1361
|
+
switch (eventName) {
|
|
1362
|
+
case 'wheel':
|
|
1363
|
+
return {
|
|
1364
|
+
passive: true
|
|
1365
|
+
};
|
|
1366
|
+
default:
|
|
1367
|
+
return undefined;
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1371
|
+
const cache$1 = new Map();
|
|
1372
|
+
const has$1 = listener => {
|
|
1373
|
+
return cache$1.has(listener);
|
|
1374
|
+
};
|
|
1375
|
+
const set$8 = (listener, value) => {
|
|
1376
|
+
cache$1.set(listener, value);
|
|
1377
|
+
};
|
|
1378
|
+
const get$9 = listener => {
|
|
1379
|
+
return cache$1.get(listener);
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1382
|
+
const getWrappedListener$1 = (listener, returnValue) => {
|
|
1383
|
+
if (!returnValue) {
|
|
1384
|
+
return listener;
|
|
1385
|
+
}
|
|
1386
|
+
if (!has$1(listener)) {
|
|
1387
|
+
const wrapped = event => {
|
|
1388
|
+
const uid = getComponentUidFromEvent(event);
|
|
1389
|
+
const result = listener(event);
|
|
1390
|
+
// TODO check for empty array by value
|
|
1391
|
+
if (result.length === 0) {
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
const ipc = getIpc();
|
|
1395
|
+
ipc.send('Viewlet.executeViewletCommand', uid, ...result);
|
|
1396
|
+
};
|
|
1397
|
+
nameAnonymousFunction$1(wrapped, listener.name);
|
|
1398
|
+
set$8(listener, wrapped);
|
|
1399
|
+
}
|
|
1400
|
+
return get$9(listener);
|
|
1401
|
+
};
|
|
1402
|
+
|
|
1403
|
+
const attachedListeners = new WeakMap();
|
|
1404
|
+
const getOptions = fn => {
|
|
1405
|
+
if (fn.passive) {
|
|
1406
|
+
return {
|
|
1407
|
+
passive: true
|
|
1408
|
+
};
|
|
1409
|
+
}
|
|
1410
|
+
if (fn.capture) {
|
|
1411
|
+
return {
|
|
1412
|
+
capture: true
|
|
1413
|
+
};
|
|
1414
|
+
}
|
|
1415
|
+
return undefined;
|
|
1416
|
+
};
|
|
1417
|
+
const attachEvent$1 = ($Node, eventMap, key, value, newEventMap) => {
|
|
1418
|
+
const keyLower = key.toLowerCase();
|
|
1419
|
+
const listenersByEvent = attachedListeners.get($Node) || new Map();
|
|
1420
|
+
const previous = listenersByEvent.get(keyLower);
|
|
1421
|
+
if (previous) {
|
|
1422
|
+
$Node.removeEventListener(keyLower, previous.listener, previous.options);
|
|
1423
|
+
}
|
|
1424
|
+
if (newEventMap && newEventMap[value]) {
|
|
1425
|
+
const fn = newEventMap[value];
|
|
1426
|
+
const options = getOptions(fn);
|
|
1427
|
+
// TODO support event listener options
|
|
1428
|
+
$Node.addEventListener(keyLower, newEventMap[value], options);
|
|
1429
|
+
listenersByEvent.set(keyLower, {
|
|
1430
|
+
listener: newEventMap[value],
|
|
1431
|
+
options
|
|
1432
|
+
});
|
|
1433
|
+
attachedListeners.set($Node, listenersByEvent);
|
|
1434
|
+
return;
|
|
1435
|
+
}
|
|
1436
|
+
const listener = eventMap[value];
|
|
1437
|
+
if (!listener) {
|
|
1438
|
+
console.warn('listener not found', value);
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
const options = getEventListenerOptions$1(key, value);
|
|
1442
|
+
const wrapped = getWrappedListener$1(listener, eventMap.returnValue);
|
|
1443
|
+
$Node.addEventListener(keyLower, wrapped, options);
|
|
1444
|
+
listenersByEvent.set(keyLower, {
|
|
1445
|
+
listener: wrapped,
|
|
1446
|
+
options
|
|
1447
|
+
});
|
|
1448
|
+
attachedListeners.set($Node, listenersByEvent);
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1451
|
+
const STYLE_REGEX = /([^:;]+):\s*([^;]+)/g;
|
|
1452
|
+
const KEBAB_CASE_REGEX = /-([a-z])/g;
|
|
1453
|
+
const setStyle = ($Element, styleString) => {
|
|
1454
|
+
if (typeof styleString !== 'string') {
|
|
1455
|
+
return;
|
|
1456
|
+
}
|
|
1457
|
+
let match;
|
|
1458
|
+
while ((match = STYLE_REGEX.exec(styleString)) !== null) {
|
|
1459
|
+
const key = match[1].trim();
|
|
1460
|
+
const value = match[2].trim();
|
|
1461
|
+
// Convert kebab-case to camelCase for CSS properties with dashes
|
|
1462
|
+
const camelCaseKey = key.replaceAll(KEBAB_CASE_REGEX, (_, char) => char.toUpperCase());
|
|
1463
|
+
$Element.style[camelCaseKey] = value;
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
const setProp = ($Element, key, value, eventMap, newEventMap) => {
|
|
1468
|
+
switch (key) {
|
|
1469
|
+
case 'ariaActivedescendant':
|
|
1470
|
+
if (value) {
|
|
1471
|
+
$Element.setAttribute('aria-activedescendant', value);
|
|
1472
|
+
} else {
|
|
1473
|
+
$Element.removeAttribute('aria-activedescendant');
|
|
1474
|
+
}
|
|
1475
|
+
break;
|
|
1476
|
+
case 'ariaControls':
|
|
1477
|
+
$Element.setAttribute('aria-controls', value);
|
|
1478
|
+
break;
|
|
1479
|
+
case 'ariaLabelledBy':
|
|
1480
|
+
$Element.setAttribute('aria-labelledby', value);
|
|
1481
|
+
break;
|
|
1482
|
+
case 'ariaOwns':
|
|
1483
|
+
// TODO remove this once idl is supported
|
|
1484
|
+
if (value) {
|
|
1485
|
+
$Element.setAttribute('aria-owns', value);
|
|
1486
|
+
} else {
|
|
1487
|
+
$Element.removeAttribute('aria-owns');
|
|
1488
|
+
}
|
|
1489
|
+
break;
|
|
1490
|
+
case 'childCount':
|
|
1491
|
+
case 'type':
|
|
1492
|
+
break;
|
|
1493
|
+
case 'height':
|
|
1494
|
+
case 'width':
|
|
1495
|
+
if ($Element instanceof HTMLImageElement) {
|
|
1496
|
+
$Element[key] = value;
|
|
1497
|
+
} else if (typeof value === 'number') {
|
|
1498
|
+
$Element.style[key] = `${value}px`;
|
|
1499
|
+
} else {
|
|
1500
|
+
$Element.style[key] = value;
|
|
1501
|
+
}
|
|
1502
|
+
break;
|
|
1503
|
+
case 'id':
|
|
1504
|
+
if (value) {
|
|
1505
|
+
$Element[key] = value;
|
|
1506
|
+
} else {
|
|
1507
|
+
$Element.removeAttribute(key);
|
|
1508
|
+
}
|
|
1509
|
+
break;
|
|
1510
|
+
case 'inputType':
|
|
1511
|
+
// @ts-ignore
|
|
1512
|
+
$Element.type = value;
|
|
1513
|
+
break;
|
|
1514
|
+
case 'left':
|
|
1515
|
+
case 'marginTop':
|
|
1516
|
+
case 'paddingLeft':
|
|
1517
|
+
case 'paddingRight':
|
|
1518
|
+
case 'top':
|
|
1519
|
+
$Element.style[key] = typeof value === 'number' ? `${value}px` : value;
|
|
1520
|
+
break;
|
|
1521
|
+
case 'maskImage':
|
|
1522
|
+
$Element.style.maskImage = `url('${value}')`;
|
|
1523
|
+
$Element.style.webkitMaskImage = `url('${value}')`;
|
|
1524
|
+
break;
|
|
1525
|
+
case 'onBlur':
|
|
1526
|
+
case 'onChange':
|
|
1527
|
+
case 'onClick':
|
|
1528
|
+
case 'onContextMenu':
|
|
1529
|
+
case 'onDblClick':
|
|
1530
|
+
case 'onDragEnd':
|
|
1531
|
+
case 'onDragEnter':
|
|
1532
|
+
case 'onDragLeave':
|
|
1533
|
+
case 'onDragOver':
|
|
1534
|
+
case 'onDragStart':
|
|
1535
|
+
case 'onDrop':
|
|
1536
|
+
case 'onFocus':
|
|
1537
|
+
case 'onFocusIn':
|
|
1538
|
+
case 'onFocusOut':
|
|
1539
|
+
case 'onInput':
|
|
1540
|
+
case 'onKeydown':
|
|
1541
|
+
case 'onKeyDown':
|
|
1542
|
+
case 'onKeyUp':
|
|
1543
|
+
case 'onMouseDown':
|
|
1544
|
+
case 'onMouseMove':
|
|
1545
|
+
case 'onMouseOut':
|
|
1546
|
+
case 'onMouseOver':
|
|
1547
|
+
case 'onMouseUp':
|
|
1548
|
+
case 'onPointerDown':
|
|
1549
|
+
case 'onPointerMove':
|
|
1550
|
+
case 'onPointerOut':
|
|
1551
|
+
case 'onPointerOver':
|
|
1552
|
+
case 'onScroll':
|
|
1553
|
+
case 'onSelectionChange':
|
|
1554
|
+
case 'onSubmit':
|
|
1555
|
+
case 'onWheel':
|
|
1556
|
+
const eventName = key.slice(2).toLowerCase();
|
|
1557
|
+
if (!eventMap || !value) {
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
attachEvent$1($Element, eventMap, eventName, value, newEventMap);
|
|
1561
|
+
break;
|
|
1562
|
+
case 'style':
|
|
1563
|
+
setStyle($Element, value);
|
|
1564
|
+
break;
|
|
1565
|
+
case 'translate':
|
|
1566
|
+
$Element.style[key] = value;
|
|
1567
|
+
break;
|
|
1568
|
+
default:
|
|
1569
|
+
if (key.startsWith('data-')) {
|
|
1570
|
+
$Element.dataset[key.slice('data-'.length)] = value;
|
|
1571
|
+
} else {
|
|
1572
|
+
$Element[key] = value;
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1577
|
+
const setProps = ($Element, props, eventMap, newEventMap) => {
|
|
1578
|
+
for (const key in props) {
|
|
1579
|
+
setProp($Element, key, props[key], eventMap, newEventMap);
|
|
1580
|
+
}
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
const {
|
|
1584
|
+
Text: Text$2,
|
|
1585
|
+
Reference} = VirtualDomElements;
|
|
1586
|
+
|
|
1587
|
+
const renderDomTextNode = element => {
|
|
1588
|
+
return document.createTextNode(element.text);
|
|
1589
|
+
};
|
|
1590
|
+
const renderDomElement = (element, eventMap, newEventMap) => {
|
|
1591
|
+
const tag = getElementTag(element.type);
|
|
1592
|
+
const $Element = document.createElement(tag);
|
|
1593
|
+
setProps($Element, element, eventMap, newEventMap);
|
|
1594
|
+
return $Element;
|
|
1595
|
+
};
|
|
1596
|
+
const renderReferenceNode = element => {
|
|
1597
|
+
const instance = get$a(element.uid);
|
|
1598
|
+
if (!instance || !instance.state) {
|
|
1599
|
+
return document.createTextNode('Reference node not found');
|
|
1600
|
+
}
|
|
1601
|
+
const $Node = instance.state.$Viewlet;
|
|
1602
|
+
return $Node;
|
|
1603
|
+
};
|
|
1604
|
+
const render$1 = (element, eventMap, newEventMap) => {
|
|
1605
|
+
switch (element.type) {
|
|
1606
|
+
case Reference:
|
|
1607
|
+
return renderReferenceNode(element);
|
|
1608
|
+
case Text$2:
|
|
1609
|
+
return renderDomTextNode(element);
|
|
1610
|
+
default:
|
|
1611
|
+
return renderDomElement(element, eventMap, newEventMap);
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1615
|
+
const renderInternal = ($Parent, elements, eventMap, newEventMap) => {
|
|
1616
|
+
const max = elements.length - 1;
|
|
1617
|
+
let stack = [];
|
|
1618
|
+
for (let i = max; i >= 0; i--) {
|
|
1619
|
+
const element = elements[i];
|
|
1620
|
+
const $Element = render$1(element, eventMap, newEventMap);
|
|
1621
|
+
if (element.childCount > 0) {
|
|
1622
|
+
// @ts-expect-error
|
|
1623
|
+
$Element.append(...stack.slice(0, element.childCount));
|
|
1624
|
+
stack = stack.slice(element.childCount);
|
|
1625
|
+
}
|
|
1626
|
+
stack.unshift($Element);
|
|
1627
|
+
}
|
|
1628
|
+
$Parent.append(...stack);
|
|
1629
|
+
};
|
|
1630
|
+
|
|
1631
|
+
const renderInto = ($Parent, dom, eventMap = {}) => {
|
|
1632
|
+
clearNode($Parent);
|
|
1633
|
+
renderInternal($Parent, dom, eventMap);
|
|
1634
|
+
};
|
|
1635
|
+
/**
|
|
1636
|
+
*
|
|
1637
|
+
* @param {any[]} elements
|
|
1638
|
+
* @returns
|
|
1639
|
+
*/
|
|
1640
|
+
const render = (elements, eventMap = {}, newEventMap = {}) => {
|
|
1641
|
+
const $Root = document.createElement('div');
|
|
1642
|
+
renderInternal($Root, elements, eventMap, newEventMap);
|
|
1643
|
+
return $Root;
|
|
1644
|
+
};
|
|
1645
|
+
|
|
1646
|
+
const rememberFocus2 = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
1647
|
+
if (uid) {
|
|
1648
|
+
const newEventMap = getEventListenerMap(uid);
|
|
1649
|
+
const $New = render(dom, eventMap, newEventMap).firstChild;
|
|
1650
|
+
setComponentUid($New, uid);
|
|
1651
|
+
$Viewlet.replaceWith($New);
|
|
1652
|
+
$Viewlet = $New;
|
|
1653
|
+
} else {
|
|
1654
|
+
renderInto($Viewlet, dom, eventMap);
|
|
1655
|
+
}
|
|
1656
|
+
return $Viewlet;
|
|
1657
|
+
};
|
|
1658
|
+
|
|
1659
|
+
// Map of property names to attribute names for cases where they differ
|
|
1660
|
+
const propertyToAttribute = {
|
|
1661
|
+
className: 'class',
|
|
1662
|
+
htmlFor: 'for',
|
|
1663
|
+
ariaActivedescendant: 'aria-activedescendant',
|
|
1664
|
+
ariaControls: 'aria-controls',
|
|
1665
|
+
ariaLabelledBy: 'aria-labelledby',
|
|
1666
|
+
ariaOwns: 'aria-owns',
|
|
1667
|
+
inputType: 'type'
|
|
1668
|
+
};
|
|
1669
|
+
// Style properties that need to be set on element.style
|
|
1670
|
+
const styleProperties = new Set(['width', 'height', 'top', 'left', 'marginTop', 'paddingLeft', 'paddingRight']);
|
|
1671
|
+
const removeAttribute = ($Element, key) => {
|
|
1672
|
+
// Handle style properties
|
|
1673
|
+
if (styleProperties.has(key)) {
|
|
1674
|
+
// @ts-ignore - dynamic style property access
|
|
1675
|
+
$Element.style[key] = '';
|
|
1676
|
+
return;
|
|
1677
|
+
}
|
|
1678
|
+
const attributeName = propertyToAttribute[key] || key;
|
|
1679
|
+
$Element.removeAttribute(attributeName);
|
|
1680
|
+
};
|
|
1681
|
+
const setText$3 = ($Element, value) => {
|
|
1682
|
+
$Element.nodeValue = value;
|
|
1683
|
+
};
|
|
1684
|
+
const removeChild = ($Element, index) => {
|
|
1685
|
+
const $Child = $Element.childNodes[index];
|
|
1686
|
+
if ($Child) {
|
|
1687
|
+
$Child.remove();
|
|
1688
|
+
}
|
|
1689
|
+
};
|
|
1690
|
+
const add = ($Element, nodes, eventMap = {}) => {
|
|
1691
|
+
renderInternal($Element, nodes, eventMap, eventMap);
|
|
1692
|
+
};
|
|
1693
|
+
const replace = ($Element, nodes, eventMap = {}) => {
|
|
1694
|
+
// Create a temporary container to render the new nodes
|
|
1695
|
+
const $Temp = document.createElement('div');
|
|
1696
|
+
renderInternal($Temp, nodes, eventMap, eventMap);
|
|
1697
|
+
// Replace the current element with the new node(s)
|
|
1698
|
+
const $NewNode = $Temp.firstChild;
|
|
1699
|
+
if (!$NewNode) {
|
|
1700
|
+
// No node was created, just remove the old element
|
|
1701
|
+
$Element.remove();
|
|
1702
|
+
return $Element;
|
|
1703
|
+
}
|
|
1704
|
+
$Element.replaceWith($NewNode);
|
|
1705
|
+
return $NewNode;
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
const SetText = 1;
|
|
1709
|
+
const Replace = 2;
|
|
1710
|
+
const SetAttribute = 3;
|
|
1711
|
+
const RemoveAttribute = 4;
|
|
1712
|
+
const Add = 6;
|
|
1713
|
+
const NavigateChild = 7;
|
|
1714
|
+
const NavigateParent = 8;
|
|
1715
|
+
const RemoveChild = 9;
|
|
1716
|
+
const NavigateSibling = 10;
|
|
1717
|
+
const SetReferenceNodeUid = 11;
|
|
1718
|
+
|
|
1719
|
+
const applyPatch = ($Element, patches, eventMap = {}, id = 0) => {
|
|
1720
|
+
const events = getEventListenerMap(id) || eventMap;
|
|
1721
|
+
let $Current = $Element;
|
|
1722
|
+
let hasAppliedMutation = false;
|
|
1723
|
+
for (let patchIndex = 0; patchIndex < patches.length; patchIndex++) {
|
|
1724
|
+
const patch = patches[patchIndex];
|
|
1725
|
+
try {
|
|
1726
|
+
switch (patch.type) {
|
|
1727
|
+
case Add:
|
|
1728
|
+
add($Current, patch.nodes, events);
|
|
1729
|
+
hasAppliedMutation = true;
|
|
1730
|
+
break;
|
|
1731
|
+
case NavigateChild:
|
|
1732
|
+
{
|
|
1733
|
+
const $Children = $Current.childNodes;
|
|
1734
|
+
const $Child = $Children[patch.index];
|
|
1735
|
+
if (!$Child) {
|
|
1736
|
+
const nextPatch = patches[patchIndex + 1];
|
|
1737
|
+
if (nextPatch && nextPatch.type === Replace && patch.index === $Children.length) {
|
|
1738
|
+
const $Placeholder = document.createComment('virtual-dom-placeholder');
|
|
1739
|
+
$Current.append($Placeholder);
|
|
1740
|
+
$Current = $Placeholder;
|
|
1741
|
+
break;
|
|
1742
|
+
}
|
|
1743
|
+
console.error('Cannot navigate to child: child not found at index', {
|
|
1744
|
+
$Current,
|
|
1745
|
+
index: patch.index,
|
|
1746
|
+
childCount: $Children.length
|
|
1747
|
+
});
|
|
1196
1748
|
return;
|
|
1197
1749
|
}
|
|
1198
1750
|
$Current = $Child;
|
|
@@ -1253,7 +1805,7 @@ const applyPatch = ($Element, patches, eventMap = {}, id = 0) => {
|
|
|
1253
1805
|
case SetReferenceNodeUid:
|
|
1254
1806
|
{
|
|
1255
1807
|
// Get the new reference node instance
|
|
1256
|
-
const instance = get$
|
|
1808
|
+
const instance = get$a(patch.uid);
|
|
1257
1809
|
if (!instance || !instance.state) {
|
|
1258
1810
|
console.error('Cannot set reference node uid: instance not found', {
|
|
1259
1811
|
uid: patch.uid
|
|
@@ -1281,6 +1833,7 @@ const applyPatch = ($Element, patches, eventMap = {}, id = 0) => {
|
|
|
1281
1833
|
}
|
|
1282
1834
|
}
|
|
1283
1835
|
};
|
|
1836
|
+
|
|
1284
1837
|
const getActiveElementInside = $Viewlet => {
|
|
1285
1838
|
if (!$Viewlet) {
|
|
1286
1839
|
return undefined;
|
|
@@ -1294,9 +1847,11 @@ const getActiveElementInside = $Viewlet => {
|
|
|
1294
1847
|
}
|
|
1295
1848
|
return $ActiveElement;
|
|
1296
1849
|
};
|
|
1850
|
+
|
|
1297
1851
|
const queryInputs = $Viewlet => {
|
|
1298
1852
|
return [...$Viewlet.querySelectorAll('input, textarea, select')];
|
|
1299
1853
|
};
|
|
1854
|
+
|
|
1300
1855
|
const focusElement = $Element => {
|
|
1301
1856
|
$Element.focus({
|
|
1302
1857
|
preventScroll: true
|
|
@@ -3238,7 +3793,7 @@ const create2 = async (canvasId, objectId, width, height) => {
|
|
|
3238
3793
|
}
|
|
3239
3794
|
const offscreenCanvas = canvas.transferControlToOffscreen();
|
|
3240
3795
|
canvas.dataset.id = canvasId;
|
|
3241
|
-
set$
|
|
3796
|
+
set$9(canvasId, {
|
|
3242
3797
|
factory: {},
|
|
3243
3798
|
state: {
|
|
3244
3799
|
$Viewlet: canvas
|
|
@@ -3686,12 +4241,11 @@ const hide = (restoreFocus = true) => {
|
|
|
3686
4241
|
}
|
|
3687
4242
|
};
|
|
3688
4243
|
|
|
3689
|
-
const openUrl =
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
}
|
|
4244
|
+
const openUrl = url => {
|
|
4245
|
+
window.open(url);
|
|
4246
|
+
};
|
|
4247
|
+
const redirectToUrl = url => {
|
|
4248
|
+
window.location.href = url;
|
|
3695
4249
|
};
|
|
3696
4250
|
|
|
3697
4251
|
const isElectronUserAgentSpecificMemoryError = error => {
|
|
@@ -4001,7 +4555,6 @@ const performAction2 = async (locator, fnName, options) => {
|
|
|
4001
4555
|
throw new Error(`element not found`);
|
|
4002
4556
|
}
|
|
4003
4557
|
fn(element, options);
|
|
4004
|
-
return;
|
|
4005
4558
|
};
|
|
4006
4559
|
|
|
4007
4560
|
const toHaveText$1 = locator => {
|
|
@@ -4264,10 +4817,7 @@ const performAction = async (locator, fnName, options) => {
|
|
|
4264
4817
|
if (!element) {
|
|
4265
4818
|
throw new Error(`element not found`);
|
|
4266
4819
|
}
|
|
4267
|
-
|
|
4268
|
-
fn(element, options);
|
|
4269
|
-
return;
|
|
4270
|
-
}
|
|
4820
|
+
fn(element, options);
|
|
4271
4821
|
};
|
|
4272
4822
|
const performKeyBoardAction = (fnName, options) => {
|
|
4273
4823
|
const fn = KeyBoardActions[fnName];
|
|
@@ -4344,11 +4894,12 @@ const transferToWebView = objectId => {
|
|
|
4344
4894
|
// TODO allow specifying transfer origin from renderer worker
|
|
4345
4895
|
// TODO allow specifing method from renderer worker
|
|
4346
4896
|
const port = acquire(objectId);
|
|
4897
|
+
const targetOrigin = new URL($Iframe.src || location.href, location.href).origin;
|
|
4347
4898
|
contentWindow.postMessage({
|
|
4348
4899
|
jsonrpc: '2.0',
|
|
4349
4900
|
method: 'handlePort',
|
|
4350
4901
|
params: [port]
|
|
4351
|
-
},
|
|
4902
|
+
}, targetOrigin, [port]);
|
|
4352
4903
|
};
|
|
4353
4904
|
|
|
4354
4905
|
const attachEvents$6 = ($Node, eventMap) => {
|
|
@@ -5964,14 +6515,14 @@ const detachEvent = ($Node, key, listener) => {
|
|
|
5964
6515
|
|
|
5965
6516
|
const None = 0;
|
|
5966
6517
|
const Ctrl = 1;
|
|
5967
|
-
const Alt
|
|
6518
|
+
const Alt = 2;
|
|
5968
6519
|
|
|
5969
6520
|
const getModifierKey = event => {
|
|
5970
6521
|
if (event.ctrlKey) {
|
|
5971
6522
|
return Ctrl;
|
|
5972
6523
|
}
|
|
5973
6524
|
if (event.altKey) {
|
|
5974
|
-
return Alt
|
|
6525
|
+
return Alt;
|
|
5975
6526
|
}
|
|
5976
6527
|
return None;
|
|
5977
6528
|
};
|
|
@@ -6671,603 +7222,233 @@ const create$d = () => {
|
|
|
6671
7222
|
};
|
|
6672
7223
|
const focus$9 = (state, key, source) => {
|
|
6673
7224
|
if (!key) {
|
|
6674
|
-
return;
|
|
6675
|
-
}
|
|
6676
|
-
if (source !== Script) {
|
|
6677
|
-
return;
|
|
6678
|
-
}
|
|
6679
|
-
const {
|
|
6680
|
-
$Viewlet
|
|
6681
|
-
} = state;
|
|
6682
|
-
const $Element = $Viewlet.querySelector(key);
|
|
6683
|
-
if (!$Element) {
|
|
6684
|
-
console.warn(`element not found: ${key}`);
|
|
6685
|
-
return;
|
|
6686
|
-
}
|
|
6687
|
-
$Element.focus();
|
|
6688
|
-
applyUidWorkaround($Viewlet);
|
|
6689
|
-
};
|
|
6690
|
-
const setValue$1 = (state, value) => {
|
|
6691
|
-
const {
|
|
6692
|
-
$Viewlet
|
|
6693
|
-
} = state;
|
|
6694
|
-
const $InputBox = $Viewlet.querySelector('.MultilineInputBox');
|
|
6695
|
-
if (!$InputBox) {
|
|
6696
|
-
return;
|
|
6697
|
-
}
|
|
6698
|
-
$InputBox.value = value;
|
|
6699
|
-
};
|
|
6700
|
-
const appendWidget$1 = state => {
|
|
6701
|
-
const {
|
|
6702
|
-
$Viewlet
|
|
6703
|
-
} = state;
|
|
6704
|
-
append$1($Viewlet);
|
|
6705
|
-
};
|
|
6706
|
-
const setDom$3 = (state, dom) => {
|
|
6707
|
-
const {
|
|
6708
|
-
$Viewlet
|
|
6709
|
-
} = state;
|
|
6710
|
-
rememberFocus($Viewlet, dom, ViewletFindWidgetEvents, 0);
|
|
6711
|
-
};
|
|
6712
|
-
const setBounds$2 = (state, x, y, width, height) => {
|
|
6713
|
-
const {
|
|
6714
|
-
$Viewlet
|
|
6715
|
-
} = state;
|
|
6716
|
-
setBounds$a($Viewlet, x, y, width, height);
|
|
6717
|
-
};
|
|
6718
|
-
const dispose$8 = state => {
|
|
6719
|
-
remove$1(state.$Viewlet);
|
|
6720
|
-
};
|
|
6721
|
-
const Events$3 = ViewletFindWidgetEvents;
|
|
6722
|
-
|
|
6723
|
-
const ViewletFindWidget = {
|
|
6724
|
-
__proto__: null,
|
|
6725
|
-
Events: Events$3,
|
|
6726
|
-
appendWidget: appendWidget$1,
|
|
6727
|
-
create: create$d,
|
|
6728
|
-
dispose: dispose$8,
|
|
6729
|
-
focus: focus$9,
|
|
6730
|
-
setBounds: setBounds$2,
|
|
6731
|
-
setDom: setDom$3,
|
|
6732
|
-
setValue: setValue$1
|
|
6733
|
-
};
|
|
6734
|
-
|
|
6735
|
-
const handleLocationsMouseDown = event => {
|
|
6736
|
-
if (event.button !== LeftClick) {
|
|
6737
|
-
return;
|
|
6738
|
-
}
|
|
6739
|
-
const $Target = event.target;
|
|
6740
|
-
if ($Target.classList.contains('TreeItem')) {
|
|
6741
|
-
const index = getNodeIndex($Target);
|
|
6742
|
-
send(/* ViewletLocations.selectIndex */'Locations.selectIndex', /* index */index);
|
|
6743
|
-
} else if ($Target.classList.contains('LocationList')) {
|
|
6744
|
-
send(/* ViewletLocations.focusIndex */'Locations.focusIndex', /* index */-1);
|
|
6745
|
-
}
|
|
6746
|
-
};
|
|
6747
|
-
|
|
6748
|
-
const ViewletLocationsEvents = {
|
|
6749
|
-
__proto__: null,
|
|
6750
|
-
handleLocationsMouseDown
|
|
6751
|
-
};
|
|
6752
|
-
|
|
6753
|
-
const setFocusedIndex$1 = (state, oldFocusedIndex, newFocusedIndex) => {
|
|
6754
|
-
const {
|
|
6755
|
-
$Viewlet
|
|
6756
|
-
} = state;
|
|
6757
|
-
const $Locations = $Viewlet.children[1];
|
|
6758
|
-
if (oldFocusedIndex === -1) {
|
|
6759
|
-
$Locations.classList.remove('FocusOutline');
|
|
6760
|
-
} else {
|
|
6761
|
-
$Locations.children[oldFocusedIndex].classList.remove('Focused');
|
|
6762
|
-
}
|
|
6763
|
-
if (newFocusedIndex === -1) {
|
|
6764
|
-
$Locations.classList.add('FocusOutline');
|
|
6765
|
-
} else {
|
|
6766
|
-
$Locations.setAttribute(AriaActiveDescendant, `Reference-${newFocusedIndex}`);
|
|
6767
|
-
$Locations.children[newFocusedIndex].classList.add('Focused');
|
|
6768
|
-
}
|
|
6769
|
-
};
|
|
6770
|
-
const handleError$3 = (state, message) => {
|
|
6771
|
-
const {
|
|
6772
|
-
$Message
|
|
6773
|
-
} = state;
|
|
6774
|
-
$Message.textContent = message;
|
|
6775
|
-
};
|
|
6776
|
-
const focus$8 = state => {
|
|
6777
|
-
const {
|
|
6778
|
-
$Locations
|
|
6779
|
-
} = state;
|
|
6780
|
-
$Locations.classList.add('FocusOutline');
|
|
6781
|
-
$Locations.focus();
|
|
6782
|
-
send('Focus.setFocus', FocusLocationList);
|
|
6783
|
-
};
|
|
6784
|
-
|
|
6785
|
-
const ViewletImplementations = {
|
|
6786
|
-
__proto__: null,
|
|
6787
|
-
Events: ViewletLocationsEvents,
|
|
6788
|
-
focus: focus$8,
|
|
6789
|
-
handleError: handleError$3,
|
|
6790
|
-
setFocusedIndex: setFocusedIndex$1
|
|
6791
|
-
};
|
|
6792
|
-
|
|
6793
|
-
const handleScrollBarPointerDown = event => {
|
|
6794
|
-
// TODO
|
|
6795
|
-
};
|
|
6796
|
-
|
|
6797
|
-
const ViewletInlineDiffEditorEvents = {
|
|
6798
|
-
__proto__: null,
|
|
6799
|
-
handleScrollBarPointerDown,
|
|
6800
|
-
handleWheel: handleWheel$3
|
|
6801
|
-
};
|
|
6802
|
-
|
|
6803
|
-
const ViewletInlineDiffEditor = {
|
|
6804
|
-
__proto__: null,
|
|
6805
|
-
Events: ViewletInlineDiffEditorEvents,
|
|
6806
|
-
setScrollBar: setScrollBar$2
|
|
6807
|
-
};
|
|
6808
|
-
|
|
6809
|
-
const handleResizerPointerMove = event => {
|
|
6810
|
-
const {
|
|
6811
|
-
clientX
|
|
6812
|
-
} = event;
|
|
6813
|
-
const uid = fromEvent(event);
|
|
6814
|
-
handleResizerMove(uid, clientX);
|
|
6815
|
-
};
|
|
6816
|
-
|
|
6817
|
-
// TODO use lostpointercapture event instead
|
|
6818
|
-
const handleResizerPointerUp = event => {
|
|
6819
|
-
const {
|
|
6820
|
-
pointerId,
|
|
6821
|
-
target
|
|
6822
|
-
} = event;
|
|
6823
|
-
stopTracking(target, pointerId, handleResizerPointerMove, handleResizerPointerUp);
|
|
6824
|
-
};
|
|
6825
|
-
const handleResizerPointerDown = event => {
|
|
6826
|
-
const {
|
|
6827
|
-
clientX,
|
|
6828
|
-
pointerId,
|
|
6829
|
-
target
|
|
6830
|
-
} = event;
|
|
6831
|
-
startTracking(target, pointerId, handleResizerPointerMove, handleResizerPointerUp);
|
|
6832
|
-
const id = target.nextSibling ? 1 : 2;
|
|
6833
|
-
const uid = fromEvent(event);
|
|
6834
|
-
handleResizerClick(uid, id, clientX);
|
|
6835
|
-
};
|
|
6836
|
-
const getPointerDownFunction = event => {
|
|
6837
|
-
const {
|
|
6838
|
-
target
|
|
6839
|
-
} = event;
|
|
6840
|
-
switch (target.className) {
|
|
6841
|
-
case 'Resizer':
|
|
6842
|
-
return handleResizerPointerDown;
|
|
6843
|
-
default:
|
|
6844
|
-
return undefined;
|
|
7225
|
+
return;
|
|
6845
7226
|
}
|
|
6846
|
-
|
|
6847
|
-
const handlePointerDown = event => {
|
|
6848
|
-
const pointerDownFunction = getPointerDownFunction(event);
|
|
6849
|
-
if (!pointerDownFunction) {
|
|
7227
|
+
if (source !== Script) {
|
|
6850
7228
|
return;
|
|
6851
7229
|
}
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
const
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
7230
|
+
const {
|
|
7231
|
+
$Viewlet
|
|
7232
|
+
} = state;
|
|
7233
|
+
const $Element = $Viewlet.querySelector(key);
|
|
7234
|
+
if (!$Element) {
|
|
7235
|
+
console.warn(`element not found: ${key}`);
|
|
7236
|
+
return;
|
|
7237
|
+
}
|
|
7238
|
+
$Element.focus();
|
|
7239
|
+
applyUidWorkaround($Viewlet);
|
|
6861
7240
|
};
|
|
6862
|
-
|
|
6863
|
-
const setValue = (state, value) => {
|
|
7241
|
+
const setValue$1 = (state, value) => {
|
|
6864
7242
|
const {
|
|
6865
7243
|
$Viewlet
|
|
6866
7244
|
} = state;
|
|
6867
|
-
const $InputBox = $Viewlet.querySelector('
|
|
7245
|
+
const $InputBox = $Viewlet.querySelector('.MultilineInputBox');
|
|
7246
|
+
if (!$InputBox) {
|
|
7247
|
+
return;
|
|
7248
|
+
}
|
|
6868
7249
|
$InputBox.value = value;
|
|
6869
7250
|
};
|
|
6870
|
-
const
|
|
6871
|
-
const paddingLeft = 15;
|
|
7251
|
+
const appendWidget$1 = state => {
|
|
6872
7252
|
const {
|
|
6873
7253
|
$Viewlet
|
|
6874
7254
|
} = state;
|
|
6875
|
-
|
|
6876
|
-
const $Resizer1 = $$Resizers[0];
|
|
6877
|
-
const $Resizer2 = $$Resizers[1];
|
|
6878
|
-
$Resizer1.style.left = `${paddingLeft + columnWidth1}px`;
|
|
6879
|
-
$Resizer2.style.left = `${paddingLeft + columnWidth1 + columnWidth2}px`;
|
|
7255
|
+
append$1($Viewlet);
|
|
6880
7256
|
};
|
|
6881
|
-
const
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
setColumnWidths,
|
|
6887
|
-
setScrollBar: setScrollBar$2,
|
|
6888
|
-
setSize,
|
|
6889
|
-
setValue
|
|
7257
|
+
const setDom$3 = (state, dom) => {
|
|
7258
|
+
const {
|
|
7259
|
+
$Viewlet
|
|
7260
|
+
} = state;
|
|
7261
|
+
rememberFocus($Viewlet, dom, ViewletFindWidgetEvents, 0);
|
|
6890
7262
|
};
|
|
6891
|
-
|
|
6892
|
-
const
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
if ($Target.id === 'SashSideBar') {
|
|
6897
|
-
return 'SideBar';
|
|
6898
|
-
}
|
|
6899
|
-
return '';
|
|
7263
|
+
const setBounds$2 = (state, x, y, width, height) => {
|
|
7264
|
+
const {
|
|
7265
|
+
$Viewlet
|
|
7266
|
+
} = state;
|
|
7267
|
+
setBounds$a($Viewlet, x, y, width, height);
|
|
6900
7268
|
};
|
|
7269
|
+
const dispose$8 = state => {
|
|
7270
|
+
remove$1(state.$Viewlet);
|
|
7271
|
+
};
|
|
7272
|
+
const Events$3 = ViewletFindWidgetEvents;
|
|
6901
7273
|
|
|
6902
|
-
const
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
const RightArrow$1 = 'ArrowRight';
|
|
6914
|
-
const UpArrow$1 = 'ArrowUp';
|
|
6915
|
-
const DownArrow$1 = 'ArrowDown';
|
|
6916
|
-
const Insert$1 = 'Insert';
|
|
6917
|
-
const Delete$1 = 'Delete';
|
|
6918
|
-
const Digit0$1 = '0';
|
|
6919
|
-
const Digit1$1 = '1';
|
|
6920
|
-
const Digit2$1 = '2';
|
|
6921
|
-
const Digit3$1 = '3';
|
|
6922
|
-
const Digit4$1 = '4';
|
|
6923
|
-
const Digit5$1 = '5';
|
|
6924
|
-
const Digit6$1 = '6';
|
|
6925
|
-
const Digit7$1 = '7';
|
|
6926
|
-
const Digit8$1 = '8';
|
|
6927
|
-
const Digit9$1 = '9';
|
|
6928
|
-
const KeyA$1 = 'a';
|
|
6929
|
-
const KeyB$1 = 'b';
|
|
6930
|
-
const KeyC$1 = 'c';
|
|
6931
|
-
const KeyD$1 = 'd';
|
|
6932
|
-
const KeyE$1 = 'e';
|
|
6933
|
-
const KeyF$1 = 'f';
|
|
6934
|
-
const KeyG$1 = 'g';
|
|
6935
|
-
const KeyH$1 = 'h';
|
|
6936
|
-
const KeyI$1 = 'i';
|
|
6937
|
-
const KeyJ$1 = 'j';
|
|
6938
|
-
const KeyK$1 = 'k';
|
|
6939
|
-
const KeyL$1 = 'l';
|
|
6940
|
-
const KeyM$1 = 'm';
|
|
6941
|
-
const KeyN$1 = 'n';
|
|
6942
|
-
const KeyO$1 = 'o';
|
|
6943
|
-
const KeyP$1 = 'p';
|
|
6944
|
-
const KeyQ$1 = 'q';
|
|
6945
|
-
const KeyR$1 = 'r';
|
|
6946
|
-
const KeyS$1 = 's';
|
|
6947
|
-
const KeyT$1 = 't';
|
|
6948
|
-
const KeyU$1 = 'u';
|
|
6949
|
-
const KeyV$1 = 'v';
|
|
6950
|
-
const KeyW$1 = 'w';
|
|
6951
|
-
const KeyX$1 = 'x';
|
|
6952
|
-
const KeyY$1 = 'y';
|
|
6953
|
-
const KeyZ$1 = 'z';
|
|
6954
|
-
const F1$1 = 'F1';
|
|
6955
|
-
const F2$1 = 'F2';
|
|
6956
|
-
const F3$1 = 'F3';
|
|
6957
|
-
const F4$1 = 'F4';
|
|
6958
|
-
const F5$1 = 'F5';
|
|
6959
|
-
const F6$1 = 'F6';
|
|
6960
|
-
const F7$1 = 'F7';
|
|
6961
|
-
const F8$1 = 'F8';
|
|
6962
|
-
const F9$1 = 'F9';
|
|
6963
|
-
const F10$1 = 'F10';
|
|
6964
|
-
const F11$1 = 'F11';
|
|
6965
|
-
const F12$1 = 'F12';
|
|
6966
|
-
const F13$1 = 'F13';
|
|
6967
|
-
const F14$1 = 'F14';
|
|
6968
|
-
const F15$1 = 'F15';
|
|
6969
|
-
const F16$1 = 'F16';
|
|
6970
|
-
const F17$1 = 'F17';
|
|
6971
|
-
const F18$1 = 'F18';
|
|
6972
|
-
const F19$1 = 'F19';
|
|
6973
|
-
const F20$1 = 'F20';
|
|
6974
|
-
const F21$1 = 'F21';
|
|
6975
|
-
const F22$1 = 'F22';
|
|
6976
|
-
const F23$1 = 'F23';
|
|
6977
|
-
const F24$1 = 'F24';
|
|
6978
|
-
const SemiColon$1 = ';';
|
|
6979
|
-
const Equal$1 = '=';
|
|
6980
|
-
const Comma$1 = ',';
|
|
6981
|
-
const Minus$1 = '-';
|
|
6982
|
-
const Period$1 = '.';
|
|
6983
|
-
const Slash$1 = '/';
|
|
6984
|
-
const Backquote$1 = '`';
|
|
6985
|
-
const Backquote2 = 'Backquote';
|
|
6986
|
-
const BracketLeft$1 = '[';
|
|
6987
|
-
const Backslash$1 = '\\';
|
|
6988
|
-
const BracketRight$1 = ']';
|
|
6989
|
-
const Quote$1 = `'`;
|
|
6990
|
-
const Star$1 = '*';
|
|
6991
|
-
const Plus$1 = '+';
|
|
6992
|
-
|
|
6993
|
-
const Unknown = 0;
|
|
6994
|
-
const Backspace = 1;
|
|
6995
|
-
const Tab = 2;
|
|
6996
|
-
const Enter = 3;
|
|
6997
|
-
const Escape = 8;
|
|
6998
|
-
const Space = 9;
|
|
6999
|
-
const PageUp = 10;
|
|
7000
|
-
const PageDown = 11;
|
|
7001
|
-
const End = 255;
|
|
7002
|
-
const Home = 12;
|
|
7003
|
-
const LeftArrow = 13;
|
|
7004
|
-
const UpArrow = 14;
|
|
7005
|
-
const RightArrow = 15;
|
|
7006
|
-
const DownArrow = 16;
|
|
7007
|
-
const Insert = 17;
|
|
7008
|
-
const Delete = 18;
|
|
7009
|
-
const Digit0 = 19;
|
|
7010
|
-
const Digit1 = 20;
|
|
7011
|
-
const Digit2 = 21;
|
|
7012
|
-
const Digit3 = 22;
|
|
7013
|
-
const Digit4 = 23;
|
|
7014
|
-
const Digit5 = 24;
|
|
7015
|
-
const Digit6 = 25;
|
|
7016
|
-
const Digit7 = 26;
|
|
7017
|
-
const Digit8 = 27;
|
|
7018
|
-
const Digit9 = 28;
|
|
7019
|
-
const KeyA = 29;
|
|
7020
|
-
const KeyB = 30;
|
|
7021
|
-
const KeyC = 31;
|
|
7022
|
-
const KeyD = 32;
|
|
7023
|
-
const KeyE = 33;
|
|
7024
|
-
const KeyF = 34;
|
|
7025
|
-
const KeyG = 35;
|
|
7026
|
-
const KeyH = 36;
|
|
7027
|
-
const KeyI = 37;
|
|
7028
|
-
const KeyJ = 38;
|
|
7029
|
-
const KeyK = 39;
|
|
7030
|
-
const KeyL = 40;
|
|
7031
|
-
const KeyM = 41;
|
|
7032
|
-
const KeyN = 42;
|
|
7033
|
-
const KeyO = 43;
|
|
7034
|
-
const KeyP = 44;
|
|
7035
|
-
const KeyQ = 45;
|
|
7036
|
-
const KeyR = 46;
|
|
7037
|
-
const KeyS = 47;
|
|
7038
|
-
const KeyT = 48;
|
|
7039
|
-
const KeyU = 49;
|
|
7040
|
-
const KeyV = 50;
|
|
7041
|
-
const KeyW = 51;
|
|
7042
|
-
const KeyX = 52;
|
|
7043
|
-
const KeyY = 53;
|
|
7044
|
-
const KeyZ = 54;
|
|
7045
|
-
const F1 = 57;
|
|
7046
|
-
const F2 = 58;
|
|
7047
|
-
const F3 = 59;
|
|
7048
|
-
const F4 = 60;
|
|
7049
|
-
const F5 = 61;
|
|
7050
|
-
const F6 = 62;
|
|
7051
|
-
const F7 = 63;
|
|
7052
|
-
const F8 = 64;
|
|
7053
|
-
const F9 = 65;
|
|
7054
|
-
const F10 = 66;
|
|
7055
|
-
const F11 = 67;
|
|
7056
|
-
const F12 = 68;
|
|
7057
|
-
const F13 = 69;
|
|
7058
|
-
const F14 = 70;
|
|
7059
|
-
const F15 = 71;
|
|
7060
|
-
const F16 = 72;
|
|
7061
|
-
const F17 = 72;
|
|
7062
|
-
const F18 = 74;
|
|
7063
|
-
const F19 = 75;
|
|
7064
|
-
const F20 = 76;
|
|
7065
|
-
const F21 = 77;
|
|
7066
|
-
const F22 = 78;
|
|
7067
|
-
const F23 = 79;
|
|
7068
|
-
const F24 = 80;
|
|
7069
|
-
const SemiColon = 83;
|
|
7070
|
-
const Equal = 84;
|
|
7071
|
-
const Comma = 85;
|
|
7072
|
-
const Minus = 86;
|
|
7073
|
-
const Period = 87;
|
|
7074
|
-
const Slash = 88;
|
|
7075
|
-
const Backquote = 89;
|
|
7076
|
-
const BracketLeft = 90;
|
|
7077
|
-
const Backslash = 91;
|
|
7078
|
-
const BracketRight = 92;
|
|
7079
|
-
const Quote = 93;
|
|
7080
|
-
const Star = 131;
|
|
7081
|
-
const Plus = 132;
|
|
7274
|
+
const ViewletFindWidget = {
|
|
7275
|
+
__proto__: null,
|
|
7276
|
+
Events: Events$3,
|
|
7277
|
+
appendWidget: appendWidget$1,
|
|
7278
|
+
create: create$d,
|
|
7279
|
+
dispose: dispose$8,
|
|
7280
|
+
focus: focus$9,
|
|
7281
|
+
setBounds: setBounds$2,
|
|
7282
|
+
setDom: setDom$3,
|
|
7283
|
+
setValue: setValue$1
|
|
7284
|
+
};
|
|
7082
7285
|
|
|
7083
|
-
const
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
return KeyE;
|
|
7192
|
-
case KeyF$1:
|
|
7193
|
-
return KeyF;
|
|
7194
|
-
case KeyG$1:
|
|
7195
|
-
return KeyG;
|
|
7196
|
-
case KeyH$1:
|
|
7197
|
-
return KeyH;
|
|
7198
|
-
case KeyI$1:
|
|
7199
|
-
return KeyI;
|
|
7200
|
-
case KeyJ$1:
|
|
7201
|
-
return KeyJ;
|
|
7202
|
-
case KeyK$1:
|
|
7203
|
-
return KeyK;
|
|
7204
|
-
case KeyL$1:
|
|
7205
|
-
return KeyL;
|
|
7206
|
-
case KeyM$1:
|
|
7207
|
-
return KeyM;
|
|
7208
|
-
case KeyN$1:
|
|
7209
|
-
return KeyN;
|
|
7210
|
-
case KeyO$1:
|
|
7211
|
-
return KeyO;
|
|
7212
|
-
case KeyP$1:
|
|
7213
|
-
return KeyP;
|
|
7214
|
-
case KeyQ$1:
|
|
7215
|
-
return KeyQ;
|
|
7216
|
-
case KeyR$1:
|
|
7217
|
-
return KeyR;
|
|
7218
|
-
case KeyS$1:
|
|
7219
|
-
return KeyS;
|
|
7220
|
-
case KeyT$1:
|
|
7221
|
-
return KeyT;
|
|
7222
|
-
case KeyU$1:
|
|
7223
|
-
return KeyU;
|
|
7224
|
-
case KeyV$1:
|
|
7225
|
-
return KeyV;
|
|
7226
|
-
case KeyW$1:
|
|
7227
|
-
return KeyW;
|
|
7228
|
-
case KeyX$1:
|
|
7229
|
-
return KeyX;
|
|
7230
|
-
case KeyY$1:
|
|
7231
|
-
return KeyY;
|
|
7232
|
-
case KeyZ$1:
|
|
7233
|
-
return KeyZ;
|
|
7234
|
-
case LeftArrow$1:
|
|
7235
|
-
return LeftArrow;
|
|
7236
|
-
case Minus$1:
|
|
7237
|
-
return Minus;
|
|
7238
|
-
case PageDown$1:
|
|
7239
|
-
return PageDown;
|
|
7240
|
-
case PageUp$1:
|
|
7241
|
-
return PageUp;
|
|
7242
|
-
case Period$1:
|
|
7243
|
-
return Period;
|
|
7244
|
-
case Plus$1:
|
|
7245
|
-
return Plus;
|
|
7246
|
-
case Quote$1:
|
|
7247
|
-
return Quote;
|
|
7248
|
-
case RightArrow$1:
|
|
7249
|
-
return RightArrow;
|
|
7250
|
-
case SemiColon$1:
|
|
7251
|
-
return SemiColon;
|
|
7252
|
-
case Slash$1:
|
|
7253
|
-
return Slash;
|
|
7254
|
-
case Space$1:
|
|
7255
|
-
case Space2:
|
|
7256
|
-
return Space;
|
|
7257
|
-
case Star$1:
|
|
7258
|
-
return Star;
|
|
7259
|
-
case Tab$1:
|
|
7260
|
-
return Tab;
|
|
7261
|
-
case UpArrow$1:
|
|
7262
|
-
return UpArrow;
|
|
7286
|
+
const handleLocationsMouseDown = event => {
|
|
7287
|
+
if (event.button !== LeftClick) {
|
|
7288
|
+
return;
|
|
7289
|
+
}
|
|
7290
|
+
const $Target = event.target;
|
|
7291
|
+
if ($Target.classList.contains('TreeItem')) {
|
|
7292
|
+
const index = getNodeIndex($Target);
|
|
7293
|
+
send(/* ViewletLocations.selectIndex */'Locations.selectIndex', /* index */index);
|
|
7294
|
+
} else if ($Target.classList.contains('LocationList')) {
|
|
7295
|
+
send(/* ViewletLocations.focusIndex */'Locations.focusIndex', /* index */-1);
|
|
7296
|
+
}
|
|
7297
|
+
};
|
|
7298
|
+
|
|
7299
|
+
const ViewletLocationsEvents = {
|
|
7300
|
+
__proto__: null,
|
|
7301
|
+
handleLocationsMouseDown
|
|
7302
|
+
};
|
|
7303
|
+
|
|
7304
|
+
const setFocusedIndex$1 = (state, oldFocusedIndex, newFocusedIndex) => {
|
|
7305
|
+
const {
|
|
7306
|
+
$Viewlet
|
|
7307
|
+
} = state;
|
|
7308
|
+
const $Locations = $Viewlet.children[1];
|
|
7309
|
+
if (oldFocusedIndex === -1) {
|
|
7310
|
+
$Locations.classList.remove('FocusOutline');
|
|
7311
|
+
} else {
|
|
7312
|
+
$Locations.children[oldFocusedIndex].classList.remove('Focused');
|
|
7313
|
+
}
|
|
7314
|
+
if (newFocusedIndex === -1) {
|
|
7315
|
+
$Locations.classList.add('FocusOutline');
|
|
7316
|
+
} else {
|
|
7317
|
+
$Locations.setAttribute(AriaActiveDescendant, `Reference-${newFocusedIndex}`);
|
|
7318
|
+
$Locations.children[newFocusedIndex].classList.add('Focused');
|
|
7319
|
+
}
|
|
7320
|
+
};
|
|
7321
|
+
const handleError$3 = (state, message) => {
|
|
7322
|
+
const {
|
|
7323
|
+
$Message
|
|
7324
|
+
} = state;
|
|
7325
|
+
$Message.textContent = message;
|
|
7326
|
+
};
|
|
7327
|
+
const focus$8 = state => {
|
|
7328
|
+
const {
|
|
7329
|
+
$Locations
|
|
7330
|
+
} = state;
|
|
7331
|
+
$Locations.classList.add('FocusOutline');
|
|
7332
|
+
$Locations.focus();
|
|
7333
|
+
send('Focus.setFocus', FocusLocationList);
|
|
7334
|
+
};
|
|
7335
|
+
|
|
7336
|
+
const ViewletImplementations = {
|
|
7337
|
+
__proto__: null,
|
|
7338
|
+
Events: ViewletLocationsEvents,
|
|
7339
|
+
focus: focus$8,
|
|
7340
|
+
handleError: handleError$3,
|
|
7341
|
+
setFocusedIndex: setFocusedIndex$1
|
|
7342
|
+
};
|
|
7343
|
+
|
|
7344
|
+
const handleScrollBarPointerDown = event => {
|
|
7345
|
+
// TODO
|
|
7346
|
+
};
|
|
7347
|
+
|
|
7348
|
+
const ViewletInlineDiffEditorEvents = {
|
|
7349
|
+
__proto__: null,
|
|
7350
|
+
handleScrollBarPointerDown,
|
|
7351
|
+
handleWheel: handleWheel$3
|
|
7352
|
+
};
|
|
7353
|
+
|
|
7354
|
+
const ViewletInlineDiffEditor = {
|
|
7355
|
+
__proto__: null,
|
|
7356
|
+
Events: ViewletInlineDiffEditorEvents,
|
|
7357
|
+
setScrollBar: setScrollBar$2
|
|
7358
|
+
};
|
|
7359
|
+
|
|
7360
|
+
const handleResizerPointerMove = event => {
|
|
7361
|
+
const {
|
|
7362
|
+
clientX
|
|
7363
|
+
} = event;
|
|
7364
|
+
const uid = fromEvent(event);
|
|
7365
|
+
handleResizerMove(uid, clientX);
|
|
7366
|
+
};
|
|
7367
|
+
|
|
7368
|
+
// TODO use lostpointercapture event instead
|
|
7369
|
+
const handleResizerPointerUp = event => {
|
|
7370
|
+
const {
|
|
7371
|
+
pointerId,
|
|
7372
|
+
target
|
|
7373
|
+
} = event;
|
|
7374
|
+
stopTracking(target, pointerId, handleResizerPointerMove, handleResizerPointerUp);
|
|
7375
|
+
};
|
|
7376
|
+
const handleResizerPointerDown = event => {
|
|
7377
|
+
const {
|
|
7378
|
+
clientX,
|
|
7379
|
+
pointerId,
|
|
7380
|
+
target
|
|
7381
|
+
} = event;
|
|
7382
|
+
startTracking(target, pointerId, handleResizerPointerMove, handleResizerPointerUp);
|
|
7383
|
+
const id = target.nextSibling ? 1 : 2;
|
|
7384
|
+
const uid = fromEvent(event);
|
|
7385
|
+
handleResizerClick(uid, id, clientX);
|
|
7386
|
+
};
|
|
7387
|
+
const getPointerDownFunction = event => {
|
|
7388
|
+
const {
|
|
7389
|
+
target
|
|
7390
|
+
} = event;
|
|
7391
|
+
switch (target.className) {
|
|
7392
|
+
case 'Resizer':
|
|
7393
|
+
return handleResizerPointerDown;
|
|
7263
7394
|
default:
|
|
7264
|
-
return
|
|
7395
|
+
return undefined;
|
|
7396
|
+
}
|
|
7397
|
+
};
|
|
7398
|
+
const handlePointerDown = event => {
|
|
7399
|
+
const pointerDownFunction = getPointerDownFunction(event);
|
|
7400
|
+
if (!pointerDownFunction) {
|
|
7401
|
+
return;
|
|
7265
7402
|
}
|
|
7403
|
+
pointerDownFunction(event);
|
|
7266
7404
|
};
|
|
7267
7405
|
|
|
7268
|
-
const
|
|
7269
|
-
|
|
7270
|
-
|
|
7406
|
+
const ViewletkeyBindingsEvents = {
|
|
7407
|
+
__proto__: null,
|
|
7408
|
+
handlePointerDown,
|
|
7409
|
+
handleResizerPointerDown,
|
|
7410
|
+
handleResizerPointerMove,
|
|
7411
|
+
handleResizerPointerUp
|
|
7412
|
+
};
|
|
7413
|
+
|
|
7414
|
+
const setValue = (state, value) => {
|
|
7415
|
+
const {
|
|
7416
|
+
$Viewlet
|
|
7417
|
+
} = state;
|
|
7418
|
+
const $InputBox = $Viewlet.querySelector('input');
|
|
7419
|
+
$InputBox.value = value;
|
|
7420
|
+
};
|
|
7421
|
+
const setColumnWidths = (state, columnWidth1, columnWidth2, columnWidth3) => {
|
|
7422
|
+
const paddingLeft = 15;
|
|
7423
|
+
const {
|
|
7424
|
+
$Viewlet
|
|
7425
|
+
} = state;
|
|
7426
|
+
const $$Resizers = $Viewlet.querySelectorAll('.Resizer');
|
|
7427
|
+
const $Resizer1 = $$Resizers[0];
|
|
7428
|
+
const $Resizer2 = $$Resizers[1];
|
|
7429
|
+
$Resizer1.style.left = `${paddingLeft + columnWidth1}px`;
|
|
7430
|
+
$Resizer2.style.left = `${paddingLeft + columnWidth1 + columnWidth2}px`;
|
|
7431
|
+
};
|
|
7432
|
+
const Events$2 = ViewletkeyBindingsEvents;
|
|
7433
|
+
|
|
7434
|
+
const ViewletKeyBindings = {
|
|
7435
|
+
__proto__: null,
|
|
7436
|
+
Events: Events$2,
|
|
7437
|
+
setColumnWidths,
|
|
7438
|
+
setScrollBar: setScrollBar$2,
|
|
7439
|
+
setSize,
|
|
7440
|
+
setValue
|
|
7441
|
+
};
|
|
7442
|
+
|
|
7443
|
+
const getSashId = $Target => {
|
|
7444
|
+
if ($Target.id === 'SashPanel') {
|
|
7445
|
+
return 'Panel';
|
|
7446
|
+
}
|
|
7447
|
+
if ($Target.id === 'SashSideBar') {
|
|
7448
|
+
return 'SideBar';
|
|
7449
|
+
}
|
|
7450
|
+
return '';
|
|
7451
|
+
};
|
|
7271
7452
|
|
|
7272
7453
|
const normalizeKey = (key, code) => {
|
|
7273
7454
|
if (key.length === 1) {
|
|
@@ -7289,7 +7470,7 @@ const getKeyBindingIdentifier = event => {
|
|
|
7289
7470
|
} = event;
|
|
7290
7471
|
const modifierControl = ctrlKey ? CtrlCmd : 0;
|
|
7291
7472
|
const modifierShift = shiftKey ? Shift : 0;
|
|
7292
|
-
const modifierAlt = altKey ? Alt : 0;
|
|
7473
|
+
const modifierAlt = altKey ? Alt$1 : 0;
|
|
7293
7474
|
const normalizedKey = normalizeKey(key, code);
|
|
7294
7475
|
const keyCode = getKeyCode(normalizedKey);
|
|
7295
7476
|
const identifier = modifierControl | modifierShift | modifierAlt | keyCode;
|
|
@@ -7706,7 +7887,7 @@ const setActionsDom$1 = (state, actions, childUid) => {
|
|
|
7706
7887
|
const {
|
|
7707
7888
|
$PanelActions
|
|
7708
7889
|
} = state;
|
|
7709
|
-
const instance = get$
|
|
7890
|
+
const instance = get$a(childUid);
|
|
7710
7891
|
if (!instance) {
|
|
7711
7892
|
throw new Error(`child instance not found`);
|
|
7712
7893
|
}
|
|
@@ -8403,6 +8584,69 @@ const create$Menu = () => {
|
|
|
8403
8584
|
// $ContextMenu.onblur = handleBlur
|
|
8404
8585
|
return $Menu;
|
|
8405
8586
|
};
|
|
8587
|
+
const addMenu = ($$Menus, change, uid) => {
|
|
8588
|
+
const menu = change[1];
|
|
8589
|
+
const dom = change[2];
|
|
8590
|
+
const $Menu = create$Menu();
|
|
8591
|
+
set$3($Menu, uid);
|
|
8592
|
+
$Menu.onmouseover = handleMenuMouseOver;
|
|
8593
|
+
$Menu.onclick = handleMenuClick;
|
|
8594
|
+
const {
|
|
8595
|
+
focusedIndex,
|
|
8596
|
+
height,
|
|
8597
|
+
level,
|
|
8598
|
+
width,
|
|
8599
|
+
x,
|
|
8600
|
+
y
|
|
8601
|
+
} = menu;
|
|
8602
|
+
setBounds$a($Menu, x, y, width, height);
|
|
8603
|
+
renderInto($Menu, dom);
|
|
8604
|
+
$Menu.id = `Menu-${level}`;
|
|
8605
|
+
append$1($Menu);
|
|
8606
|
+
if (focusedIndex !== -1) {
|
|
8607
|
+
const $Child = $Menu.children[focusedIndex];
|
|
8608
|
+
// @ts-expect-error
|
|
8609
|
+
$Child.focus();
|
|
8610
|
+
}
|
|
8611
|
+
$$Menus.push($Menu);
|
|
8612
|
+
};
|
|
8613
|
+
const closeMenus = ($$Menus, change) => {
|
|
8614
|
+
const keepCount = change[1];
|
|
8615
|
+
const $$ToDispose = $$Menus.slice(keepCount);
|
|
8616
|
+
for (const $ToDispose of $$ToDispose) {
|
|
8617
|
+
remove$1($ToDispose);
|
|
8618
|
+
}
|
|
8619
|
+
$$Menus.length = keepCount;
|
|
8620
|
+
};
|
|
8621
|
+
const updateMenu = ($$Menus, change) => {
|
|
8622
|
+
const menu = change[1];
|
|
8623
|
+
const newLength = change[2];
|
|
8624
|
+
const dom = change[3];
|
|
8625
|
+
const {
|
|
8626
|
+
focusedIndex,
|
|
8627
|
+
height,
|
|
8628
|
+
level,
|
|
8629
|
+
width,
|
|
8630
|
+
x,
|
|
8631
|
+
y
|
|
8632
|
+
} = menu;
|
|
8633
|
+
const $Menu = $$Menus[level];
|
|
8634
|
+
setBounds$a($Menu, x, y, width, height);
|
|
8635
|
+
renderInto($Menu, dom);
|
|
8636
|
+
if (level === newLength - 1) {
|
|
8637
|
+
if (focusedIndex === -1) {
|
|
8638
|
+
$Menu.focus();
|
|
8639
|
+
} else {
|
|
8640
|
+
const $Child = $Menu.children[focusedIndex];
|
|
8641
|
+
$Child.focus();
|
|
8642
|
+
}
|
|
8643
|
+
}
|
|
8644
|
+
};
|
|
8645
|
+
const menuHandlers = {
|
|
8646
|
+
addMenu,
|
|
8647
|
+
closeMenus,
|
|
8648
|
+
updateMenu
|
|
8649
|
+
};
|
|
8406
8650
|
|
|
8407
8651
|
// TODO recycle menus
|
|
8408
8652
|
const setMenus = (state, changes, uid) => {
|
|
@@ -8414,72 +8658,9 @@ const setMenus = (state, changes, uid) => {
|
|
|
8414
8658
|
} = state;
|
|
8415
8659
|
for (const change of changes) {
|
|
8416
8660
|
const type = change[0];
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
const menu = change[1];
|
|
8421
|
-
const dom = change[2];
|
|
8422
|
-
const $Menu = create$Menu();
|
|
8423
|
-
set$3($Menu, uid);
|
|
8424
|
-
$Menu.onmouseover = handleMenuMouseOver;
|
|
8425
|
-
$Menu.onclick = handleMenuClick;
|
|
8426
|
-
const {
|
|
8427
|
-
focusedIndex,
|
|
8428
|
-
height,
|
|
8429
|
-
level,
|
|
8430
|
-
width,
|
|
8431
|
-
x,
|
|
8432
|
-
y
|
|
8433
|
-
} = menu;
|
|
8434
|
-
setBounds$a($Menu, x, y, width, height);
|
|
8435
|
-
renderInto($Menu, dom);
|
|
8436
|
-
$Menu.id = `Menu-${level}`;
|
|
8437
|
-
append$1($Menu);
|
|
8438
|
-
if (focusedIndex !== -1) {
|
|
8439
|
-
const $Child = $Menu.children[focusedIndex];
|
|
8440
|
-
// @ts-expect-error
|
|
8441
|
-
$Child.focus();
|
|
8442
|
-
}
|
|
8443
|
-
$$Menus.push($Menu);
|
|
8444
|
-
break;
|
|
8445
|
-
}
|
|
8446
|
-
case 'closeMenus':
|
|
8447
|
-
{
|
|
8448
|
-
const keepCount = change[1];
|
|
8449
|
-
const $$ToDispose = $$Menus.slice(keepCount);
|
|
8450
|
-
for (const $ToDispose of $$ToDispose) {
|
|
8451
|
-
remove$1($ToDispose);
|
|
8452
|
-
}
|
|
8453
|
-
$$Menus.length = keepCount;
|
|
8454
|
-
break;
|
|
8455
|
-
}
|
|
8456
|
-
case 'updateMenu':
|
|
8457
|
-
{
|
|
8458
|
-
const menu = change[1];
|
|
8459
|
-
const newLength = change[2];
|
|
8460
|
-
const dom = change[3];
|
|
8461
|
-
const {
|
|
8462
|
-
focusedIndex,
|
|
8463
|
-
height,
|
|
8464
|
-
level,
|
|
8465
|
-
width,
|
|
8466
|
-
x,
|
|
8467
|
-
y
|
|
8468
|
-
} = menu;
|
|
8469
|
-
const $Menu = $$Menus[level];
|
|
8470
|
-
setBounds$a($Menu, x, y, width, height);
|
|
8471
|
-
renderInto($Menu, dom);
|
|
8472
|
-
if (level === newLength - 1) {
|
|
8473
|
-
if (focusedIndex === -1) {
|
|
8474
|
-
$Menu.focus();
|
|
8475
|
-
} else {
|
|
8476
|
-
const $Child = $Menu.children[focusedIndex];
|
|
8477
|
-
$Child.focus();
|
|
8478
|
-
}
|
|
8479
|
-
}
|
|
8480
|
-
break;
|
|
8481
|
-
}
|
|
8482
|
-
// No default
|
|
8661
|
+
const handler = menuHandlers[type];
|
|
8662
|
+
if (handler) {
|
|
8663
|
+
handler($$Menus, change, uid);
|
|
8483
8664
|
}
|
|
8484
8665
|
}
|
|
8485
8666
|
};
|
|
@@ -8711,111 +8892,64 @@ const ViewletWebView = {
|
|
|
8711
8892
|
setPosition
|
|
8712
8893
|
};
|
|
8713
8894
|
|
|
8895
|
+
const moduleLoaders = {
|
|
8896
|
+
[ActivityBar]: () => ViewletActivityBar,
|
|
8897
|
+
[Audio$1]: () => ViewletAudio,
|
|
8898
|
+
[Clock]: () => ViewletClock,
|
|
8899
|
+
[ColorPicker]: () => ViewletColorPicker,
|
|
8900
|
+
[DebugConsole]: () => ViewletDebugConsole,
|
|
8901
|
+
[DefineKeyBinding]: () => ViewletDefineKeyBinding,
|
|
8902
|
+
[Dialog]: () => ViewletDialog,
|
|
8903
|
+
[DiffEditor]: () => ViewletDiffEditor,
|
|
8904
|
+
[E2eTest]: () => ViewletE2eTest,
|
|
8905
|
+
[E2eTests]: () => ViewletE2eTests,
|
|
8906
|
+
[EditorCodeGenerator]: () => ViewletEditorCodeGenerator,
|
|
8907
|
+
[EditorCompletion]: () => ViewletEditorCompletion,
|
|
8908
|
+
[EditorCompletionDetails]: () => ViewletEditorCompletionDetails,
|
|
8909
|
+
[EditorError]: () => ViewletEditorError,
|
|
8910
|
+
[EditorHover]: () => ViewletEditorHover,
|
|
8911
|
+
[EditorImage]: () => ViewletEditorImage,
|
|
8912
|
+
[EditorPlainText]: () => ViewletEditorPlainText,
|
|
8913
|
+
[EditorSourceActions]: () => ViewletEditorSourceActions,
|
|
8914
|
+
[EditorText]: () => ViewletEditorText,
|
|
8915
|
+
[EditorTextError]: () => ViewletEditorTextError,
|
|
8916
|
+
[EditorWidgetError]: () => ViewletEditorWidgetError,
|
|
8917
|
+
[Empty]: () => ViewletEmpty,
|
|
8918
|
+
[EmptyEditor]: () => ViewletEmptyEditor,
|
|
8919
|
+
[Error$1]: () => ViewletError,
|
|
8920
|
+
[FindWidget]: () => ViewletFindWidget,
|
|
8921
|
+
[ImagePreview]: () => ImagePreview$1,
|
|
8922
|
+
[Implementations]: () => ViewletImplementations,
|
|
8923
|
+
[InlineDiffEditor]: () => ViewletInlineDiffEditor,
|
|
8924
|
+
[KeyBindings]: () => ViewletKeyBindings,
|
|
8925
|
+
[Layout]: () => ViewletLayout,
|
|
8926
|
+
[Output]: () => ViewletOutput,
|
|
8927
|
+
[Panel]: () => ViewletPanel,
|
|
8928
|
+
[References]: () => ViewletReferences,
|
|
8929
|
+
[RunAndDebug]: () => ViewletRunAndDebug,
|
|
8930
|
+
[ScreenCapture]: () => ViewletScreenCapture,
|
|
8931
|
+
[SideBar]: () => ViewletSideBar,
|
|
8932
|
+
[SimpleBrowser]: () => ViewletSimpleBrowser,
|
|
8933
|
+
[SourceControl]: () => ViewletSourceControl,
|
|
8934
|
+
[StatusBar]: () => ViewletStatusBar,
|
|
8935
|
+
[Storage]: () => ViewletStorage,
|
|
8936
|
+
[Terminal]: () => Promise.resolve().then(function () { return ViewletTerminal; }),
|
|
8937
|
+
[Terminal2]: () => Promise.resolve().then(function () { return ViewletTerminal2; }),
|
|
8938
|
+
[Terminals]: () => ViewletTerminals,
|
|
8939
|
+
[TitleBar]: () => ViewletTitleBar,
|
|
8940
|
+
[TitleBarButtons]: () => ViewletTitleBarButtons,
|
|
8941
|
+
[TitleBarIcon]: () => ViewletTitleBarIcon,
|
|
8942
|
+
[TitleBarMenuBar]: () => ViewletTitleBarMenuBar,
|
|
8943
|
+
[TitleBarTitle]: () => ViewletTitleBarTitle,
|
|
8944
|
+
[Video]: () => ViewletVideo,
|
|
8945
|
+
[WebView]: () => ViewletWebView
|
|
8946
|
+
};
|
|
8714
8947
|
const load$1 = moduleId => {
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
case Audio$1:
|
|
8719
|
-
return ViewletAudio;
|
|
8720
|
-
case Clock:
|
|
8721
|
-
return ViewletClock;
|
|
8722
|
-
case ColorPicker:
|
|
8723
|
-
return ViewletColorPicker;
|
|
8724
|
-
case DebugConsole:
|
|
8725
|
-
return ViewletDebugConsole;
|
|
8726
|
-
case DefineKeyBinding:
|
|
8727
|
-
return ViewletDefineKeyBinding;
|
|
8728
|
-
case Dialog:
|
|
8729
|
-
return ViewletDialog;
|
|
8730
|
-
case DiffEditor:
|
|
8731
|
-
return ViewletDiffEditor;
|
|
8732
|
-
case E2eTest:
|
|
8733
|
-
return ViewletE2eTest;
|
|
8734
|
-
case E2eTests:
|
|
8735
|
-
return ViewletE2eTests;
|
|
8736
|
-
case EditorCodeGenerator:
|
|
8737
|
-
return ViewletEditorCodeGenerator;
|
|
8738
|
-
case EditorCompletion:
|
|
8739
|
-
return ViewletEditorCompletion;
|
|
8740
|
-
case EditorCompletionDetails:
|
|
8741
|
-
return ViewletEditorCompletionDetails;
|
|
8742
|
-
case EditorError:
|
|
8743
|
-
return ViewletEditorError;
|
|
8744
|
-
case EditorHover:
|
|
8745
|
-
return ViewletEditorHover;
|
|
8746
|
-
case EditorImage:
|
|
8747
|
-
return ViewletEditorImage;
|
|
8748
|
-
case EditorPlainText:
|
|
8749
|
-
return ViewletEditorPlainText;
|
|
8750
|
-
case EditorSourceActions:
|
|
8751
|
-
return ViewletEditorSourceActions;
|
|
8752
|
-
case EditorText:
|
|
8753
|
-
return ViewletEditorText;
|
|
8754
|
-
case EditorTextError:
|
|
8755
|
-
return ViewletEditorTextError;
|
|
8756
|
-
case EditorWidgetError:
|
|
8757
|
-
return ViewletEditorWidgetError;
|
|
8758
|
-
case Empty:
|
|
8759
|
-
return ViewletEmpty;
|
|
8760
|
-
case EmptyEditor:
|
|
8761
|
-
return ViewletEmptyEditor;
|
|
8762
|
-
case Error$1:
|
|
8763
|
-
return ViewletError;
|
|
8764
|
-
case FindWidget:
|
|
8765
|
-
return ViewletFindWidget;
|
|
8766
|
-
case ImagePreview:
|
|
8767
|
-
return ImagePreview$1;
|
|
8768
|
-
case Implementations:
|
|
8769
|
-
return ViewletImplementations;
|
|
8770
|
-
case InlineDiffEditor:
|
|
8771
|
-
return ViewletInlineDiffEditor;
|
|
8772
|
-
case KeyBindings:
|
|
8773
|
-
return ViewletKeyBindings;
|
|
8774
|
-
case Layout:
|
|
8775
|
-
return ViewletLayout;
|
|
8776
|
-
case Output:
|
|
8777
|
-
return ViewletOutput;
|
|
8778
|
-
case Panel:
|
|
8779
|
-
return ViewletPanel;
|
|
8780
|
-
case References:
|
|
8781
|
-
return ViewletReferences;
|
|
8782
|
-
case RunAndDebug:
|
|
8783
|
-
return ViewletRunAndDebug;
|
|
8784
|
-
case ScreenCapture:
|
|
8785
|
-
return ViewletScreenCapture;
|
|
8786
|
-
case SideBar:
|
|
8787
|
-
return ViewletSideBar;
|
|
8788
|
-
case SimpleBrowser:
|
|
8789
|
-
return ViewletSimpleBrowser;
|
|
8790
|
-
case SourceControl:
|
|
8791
|
-
return ViewletSourceControl;
|
|
8792
|
-
case StatusBar:
|
|
8793
|
-
return ViewletStatusBar;
|
|
8794
|
-
case Storage:
|
|
8795
|
-
return ViewletStorage;
|
|
8796
|
-
case Terminal:
|
|
8797
|
-
return Promise.resolve().then(function () { return ViewletTerminal; });
|
|
8798
|
-
case Terminal2:
|
|
8799
|
-
return Promise.resolve().then(function () { return ViewletTerminal2; });
|
|
8800
|
-
case Terminals:
|
|
8801
|
-
return ViewletTerminals;
|
|
8802
|
-
case TitleBar:
|
|
8803
|
-
return ViewletTitleBar;
|
|
8804
|
-
case TitleBarButtons:
|
|
8805
|
-
return ViewletTitleBarButtons;
|
|
8806
|
-
case TitleBarIcon:
|
|
8807
|
-
return ViewletTitleBarIcon;
|
|
8808
|
-
case TitleBarMenuBar:
|
|
8809
|
-
return ViewletTitleBarMenuBar;
|
|
8810
|
-
case TitleBarTitle:
|
|
8811
|
-
return ViewletTitleBarTitle;
|
|
8812
|
-
case Video:
|
|
8813
|
-
return ViewletVideo;
|
|
8814
|
-
case WebView:
|
|
8815
|
-
return ViewletWebView;
|
|
8816
|
-
default:
|
|
8817
|
-
throw new Error(`${moduleId} module not found in renderer process`);
|
|
8948
|
+
const loadModule = moduleLoaders[moduleId];
|
|
8949
|
+
if (!loadModule) {
|
|
8950
|
+
throw new Error(`${moduleId} module not found in renderer process`);
|
|
8818
8951
|
}
|
|
8952
|
+
return loadModule();
|
|
8819
8953
|
};
|
|
8820
8954
|
|
|
8821
8955
|
const state$1 = {
|
|
@@ -8829,7 +8963,7 @@ const create$4 = (id, uid = id) => {
|
|
|
8829
8963
|
if (!module) {
|
|
8830
8964
|
throw new Error(`module not found: ${id}`);
|
|
8831
8965
|
}
|
|
8832
|
-
const existing = get$
|
|
8966
|
+
const existing = get$a(id);
|
|
8833
8967
|
if (existing?.state.$Viewlet.isConnected) {
|
|
8834
8968
|
existing.state.$Viewlet.remove();
|
|
8835
8969
|
}
|
|
@@ -8838,7 +8972,7 @@ const create$4 = (id, uid = id) => {
|
|
|
8838
8972
|
if (module.attachEvents) {
|
|
8839
8973
|
module.attachEvents(instanceState);
|
|
8840
8974
|
}
|
|
8841
|
-
set$
|
|
8975
|
+
set$9(uid, {
|
|
8842
8976
|
factory: module,
|
|
8843
8977
|
state: instanceState
|
|
8844
8978
|
});
|
|
@@ -8851,14 +8985,14 @@ const createFunctionalRoot = (id, uid = id, hasFunctionalEvents) => {
|
|
|
8851
8985
|
if (!module) {
|
|
8852
8986
|
throw new Error(`module not found: ${id}`);
|
|
8853
8987
|
}
|
|
8854
|
-
const existing = get$
|
|
8988
|
+
const existing = get$a(id);
|
|
8855
8989
|
if (existing?.state.$Viewlet.isConnected) {
|
|
8856
8990
|
existing.state.$Viewlet.remove();
|
|
8857
8991
|
}
|
|
8858
8992
|
const instanceState = {
|
|
8859
8993
|
$Viewlet: document.createElement('div')
|
|
8860
8994
|
};
|
|
8861
|
-
set$
|
|
8995
|
+
set$9(uid, {
|
|
8862
8996
|
factory: module,
|
|
8863
8997
|
state: instanceState
|
|
8864
8998
|
});
|
|
@@ -8881,7 +9015,7 @@ const loadModule = async id => {
|
|
|
8881
9015
|
};
|
|
8882
9016
|
const invoke = (viewletId, method, ...args) => {
|
|
8883
9017
|
string(method);
|
|
8884
|
-
const instance = get$
|
|
9018
|
+
const instance = get$a(viewletId);
|
|
8885
9019
|
if (!instance?.factory) {
|
|
8886
9020
|
if (viewletId && method !== 'setActionsDom') {
|
|
8887
9021
|
warn$1(`cannot execute ${method} viewlet instance ${viewletId} not found`);
|
|
@@ -8899,7 +9033,7 @@ const focus$1 = viewletId => {
|
|
|
8899
9033
|
// eslint-disable-next-line no-console
|
|
8900
9034
|
console.trace(`focus ${viewletId}`);
|
|
8901
9035
|
}
|
|
8902
|
-
const instance = get$
|
|
9036
|
+
const instance = get$a(viewletId);
|
|
8903
9037
|
if (instance.factory?.setFocused) {
|
|
8904
9038
|
instance.factory.setFocused(instance.state, true);
|
|
8905
9039
|
} else if (instance?.factory?.focus) {
|
|
@@ -8915,7 +9049,7 @@ const focusElementByName = (viewletId, name) => {
|
|
|
8915
9049
|
// eslint-disable-next-line no-console
|
|
8916
9050
|
console.trace(`focusByName ${viewletId} ${name}`);
|
|
8917
9051
|
}
|
|
8918
|
-
const instance = get$
|
|
9052
|
+
const instance = get$a(viewletId);
|
|
8919
9053
|
if (!instance) {
|
|
8920
9054
|
return;
|
|
8921
9055
|
}
|
|
@@ -8930,7 +9064,7 @@ const focusElementByName = (viewletId, name) => {
|
|
|
8930
9064
|
};
|
|
8931
9065
|
const setElementProperty = (viewletId, name, key, value) => {
|
|
8932
9066
|
const selector = `[name="${name}"]`;
|
|
8933
|
-
const instance = get$
|
|
9067
|
+
const instance = get$a(viewletId);
|
|
8934
9068
|
if (!instance) {
|
|
8935
9069
|
return;
|
|
8936
9070
|
}
|
|
@@ -8959,7 +9093,7 @@ const setCheckBoxValue = (viewletId, name, value) => {
|
|
|
8959
9093
|
};
|
|
8960
9094
|
const setSelectionByName = (viewletId, name, start, end) => {
|
|
8961
9095
|
const selector = `[name="${name}"]`;
|
|
8962
|
-
const instance = get$
|
|
9096
|
+
const instance = get$a(viewletId);
|
|
8963
9097
|
if (!instance) {
|
|
8964
9098
|
return;
|
|
8965
9099
|
}
|
|
@@ -8974,7 +9108,7 @@ const setSelectionByName = (viewletId, name, start, end) => {
|
|
|
8974
9108
|
$Element.selectionEnd = end;
|
|
8975
9109
|
};
|
|
8976
9110
|
const setUid = (viewletId, uid) => {
|
|
8977
|
-
const instance = get$
|
|
9111
|
+
const instance = get$a(viewletId);
|
|
8978
9112
|
if (!instance) {
|
|
8979
9113
|
return;
|
|
8980
9114
|
}
|
|
@@ -8984,7 +9118,7 @@ const setUid = (viewletId, uid) => {
|
|
|
8984
9118
|
set$3($Viewlet, uid);
|
|
8985
9119
|
};
|
|
8986
9120
|
const focusSelector = (viewletId, selector) => {
|
|
8987
|
-
const instance = get$
|
|
9121
|
+
const instance = get$a(viewletId);
|
|
8988
9122
|
if (!instance) {
|
|
8989
9123
|
return;
|
|
8990
9124
|
}
|
|
@@ -9002,7 +9136,7 @@ const focusSelector = (viewletId, selector) => {
|
|
|
9002
9136
|
* @deprecated
|
|
9003
9137
|
*/
|
|
9004
9138
|
const refresh$1 = (viewletId, viewletContext) => {
|
|
9005
|
-
const instance = get$
|
|
9139
|
+
const instance = get$a(viewletId);
|
|
9006
9140
|
if (instance) {
|
|
9007
9141
|
instance.factory.refresh(instance.state, viewletContext);
|
|
9008
9142
|
} else {
|
|
@@ -9021,10 +9155,10 @@ const createPlaceholder = (viewletId, parentId, top, left, width, height) => {
|
|
|
9021
9155
|
if (isSpecial(viewletId)) {
|
|
9022
9156
|
$PlaceHolder.id = viewletId;
|
|
9023
9157
|
}
|
|
9024
|
-
const parentInstance = get$
|
|
9158
|
+
const parentInstance = get$a(parentId);
|
|
9025
9159
|
const $Parent = parentInstance.state.$Viewlet;
|
|
9026
9160
|
$Parent.append($PlaceHolder);
|
|
9027
|
-
set$
|
|
9161
|
+
set$9(viewletId, {
|
|
9028
9162
|
state: {
|
|
9029
9163
|
$Viewlet: $PlaceHolder
|
|
9030
9164
|
}
|
|
@@ -9034,7 +9168,7 @@ const setDragData = (viewletId, dragData) => {
|
|
|
9034
9168
|
set$2(viewletId, dragData);
|
|
9035
9169
|
};
|
|
9036
9170
|
const setDom = (viewletId, dom) => {
|
|
9037
|
-
const instance = get$
|
|
9171
|
+
const instance = get$a(viewletId);
|
|
9038
9172
|
if (!instance) {
|
|
9039
9173
|
return;
|
|
9040
9174
|
}
|
|
@@ -9047,7 +9181,7 @@ const setDom = (viewletId, dom) => {
|
|
|
9047
9181
|
renderInto($Viewlet, dom, Events);
|
|
9048
9182
|
};
|
|
9049
9183
|
const setDom2 = (viewletId, dom) => {
|
|
9050
|
-
const instance = get$
|
|
9184
|
+
const instance = get$a(viewletId);
|
|
9051
9185
|
if (!instance) {
|
|
9052
9186
|
return;
|
|
9053
9187
|
}
|
|
@@ -9069,7 +9203,7 @@ const setDom2 = (viewletId, dom) => {
|
|
|
9069
9203
|
// @ts-ignore
|
|
9070
9204
|
set$3($NewViewlet, uid);
|
|
9071
9205
|
}
|
|
9072
|
-
set$
|
|
9206
|
+
set$9(viewletId, {
|
|
9073
9207
|
...instance,
|
|
9074
9208
|
state: {
|
|
9075
9209
|
...instance.state,
|
|
@@ -9078,7 +9212,7 @@ const setDom2 = (viewletId, dom) => {
|
|
|
9078
9212
|
});
|
|
9079
9213
|
};
|
|
9080
9214
|
const setPatches = (uid, patches) => {
|
|
9081
|
-
const instance = get$
|
|
9215
|
+
const instance = get$a(uid);
|
|
9082
9216
|
if (!instance) {
|
|
9083
9217
|
return;
|
|
9084
9218
|
}
|
|
@@ -9137,167 +9271,12 @@ const attachWindowEvents = () => {
|
|
|
9137
9271
|
|
|
9138
9272
|
// TODO this code is bad
|
|
9139
9273
|
const sendMultiple = commands => {
|
|
9140
|
-
|
|
9141
|
-
const [_, viewletId, method, ...args] = command;
|
|
9142
|
-
switch (_) {
|
|
9143
|
-
case 'Css.addCssStyleSheet':
|
|
9144
|
-
case 'Viewlet.addCss':
|
|
9145
|
-
case 'Viewlet.setCss':
|
|
9146
|
-
// @ts-ignore
|
|
9147
|
-
addCssStyleSheet(viewletId, method, ...args);
|
|
9148
|
-
break;
|
|
9149
|
-
case 'Viewlet.addKeyBindings':
|
|
9150
|
-
addKeyBindings(viewletId, method);
|
|
9151
|
-
break;
|
|
9152
|
-
case 'Viewlet.append':
|
|
9153
|
-
{
|
|
9154
|
-
// @ts-expect-error
|
|
9155
|
-
append(viewletId, method, ...args);
|
|
9156
|
-
break;
|
|
9157
|
-
}
|
|
9158
|
-
case 'Viewlet.appendToBody':
|
|
9159
|
-
{
|
|
9160
|
-
// @ts-expect-error
|
|
9161
|
-
appendToBody(viewletId, method, ...args);
|
|
9162
|
-
break;
|
|
9163
|
-
}
|
|
9164
|
-
case 'Viewlet.appendViewlet':
|
|
9165
|
-
{
|
|
9166
|
-
// @ts-expect-error
|
|
9167
|
-
appendViewlet(viewletId, method, ...args);
|
|
9168
|
-
break;
|
|
9169
|
-
}
|
|
9170
|
-
case 'Viewlet.ariaAnnounce':
|
|
9171
|
-
{
|
|
9172
|
-
ariaAnnounce(viewletId);
|
|
9173
|
-
break;
|
|
9174
|
-
}
|
|
9175
|
-
case 'Viewlet.attachWindowEvents':
|
|
9176
|
-
// @ts-ignore
|
|
9177
|
-
attachWindowEvents(viewletId, method, ...args);
|
|
9178
|
-
break;
|
|
9179
|
-
case 'Viewlet.create':
|
|
9180
|
-
{
|
|
9181
|
-
create$4(viewletId, method);
|
|
9182
|
-
break;
|
|
9183
|
-
}
|
|
9184
|
-
case 'Viewlet.createFunctionalRoot':
|
|
9185
|
-
{
|
|
9186
|
-
// @ts-ignore
|
|
9187
|
-
createFunctionalRoot(viewletId, method, ...args);
|
|
9188
|
-
break;
|
|
9189
|
-
}
|
|
9190
|
-
case 'Viewlet.createPlaceholder':
|
|
9191
|
-
{
|
|
9192
|
-
// @ts-expect-error
|
|
9193
|
-
createPlaceholder(viewletId, method, ...args);
|
|
9194
|
-
break;
|
|
9195
|
-
}
|
|
9196
|
-
case 'Viewlet.dispose':
|
|
9197
|
-
{
|
|
9198
|
-
dispose$3(viewletId);
|
|
9199
|
-
break;
|
|
9200
|
-
}
|
|
9201
|
-
case 'Viewlet.focus':
|
|
9202
|
-
{
|
|
9203
|
-
focus$1(viewletId);
|
|
9204
|
-
break;
|
|
9205
|
-
}
|
|
9206
|
-
case 'Viewlet.focusElementByName':
|
|
9207
|
-
// @ts-ignore
|
|
9208
|
-
focusElementByName(viewletId, method, ...args);
|
|
9209
|
-
break;
|
|
9210
|
-
case 'Viewlet.focusSelector':
|
|
9211
|
-
// @ts-ignore
|
|
9212
|
-
focusSelector(viewletId, method, ...args);
|
|
9213
|
-
break;
|
|
9214
|
-
case 'Viewlet.focusSelector':
|
|
9215
|
-
// @ts-ignore
|
|
9216
|
-
focusSelector(viewletId, method, ...args);
|
|
9217
|
-
break;
|
|
9218
|
-
case 'Viewlet.handleError':
|
|
9219
|
-
{
|
|
9220
|
-
// @ts-expect-error
|
|
9221
|
-
handleError$1(viewletId, method, ...args);
|
|
9222
|
-
break;
|
|
9223
|
-
}
|
|
9224
|
-
case 'Viewlet.move':
|
|
9225
|
-
// @ts-ignore
|
|
9226
|
-
move(viewletId, method, ...args);
|
|
9227
|
-
break;
|
|
9228
|
-
case 'Viewlet.registerEventListeners':
|
|
9229
|
-
// @ts-ignore
|
|
9230
|
-
registerEventListeners(viewletId, method, ...args);
|
|
9231
|
-
break;
|
|
9232
|
-
case 'Viewlet.removeKeyBindings':
|
|
9233
|
-
removeKeyBindings(viewletId);
|
|
9234
|
-
break;
|
|
9235
|
-
case 'Viewlet.replaceChildren':
|
|
9236
|
-
// @ts-ignore
|
|
9237
|
-
replaceChildren(viewletId, method, ...args);
|
|
9238
|
-
break;
|
|
9239
|
-
case 'Viewlet.send':
|
|
9240
|
-
invoke(viewletId, method, ...args);
|
|
9241
|
-
break;
|
|
9242
|
-
case 'Viewlet.setBounds':
|
|
9243
|
-
{
|
|
9244
|
-
// @ts-expect-error
|
|
9245
|
-
setBounds$1(viewletId, method, ...args);
|
|
9246
|
-
break;
|
|
9247
|
-
}
|
|
9248
|
-
case 'Viewlet.setCheckBoxValue':
|
|
9249
|
-
// @ts-ignore
|
|
9250
|
-
setCheckBoxValue(viewletId, method, ...args);
|
|
9251
|
-
break;
|
|
9252
|
-
case 'Viewlet.setDom':
|
|
9253
|
-
// @ts-expect-error
|
|
9254
|
-
setDom(viewletId, method, ...args);
|
|
9255
|
-
break;
|
|
9256
|
-
case 'Viewlet.setDom2':
|
|
9257
|
-
// @ts-ignore
|
|
9258
|
-
setDom2(viewletId, method, ...args);
|
|
9259
|
-
break;
|
|
9260
|
-
case 'Viewlet.setDragData':
|
|
9261
|
-
// @ts-ignore
|
|
9262
|
-
setDragData(viewletId, method, ...args);
|
|
9263
|
-
break;
|
|
9264
|
-
case 'Viewlet.setInputValues':
|
|
9265
|
-
// @ts-ignore
|
|
9266
|
-
setInputValues(viewletId, method, ...args);
|
|
9267
|
-
break;
|
|
9268
|
-
case 'Viewlet.setPatches':
|
|
9269
|
-
{
|
|
9270
|
-
// @ts-ignore
|
|
9271
|
-
setPatches(viewletId, method, ...args);
|
|
9272
|
-
break;
|
|
9273
|
-
}
|
|
9274
|
-
case 'Viewlet.setProperty':
|
|
9275
|
-
// @ts-ignore
|
|
9276
|
-
setProperty(viewletId, method, ...args);
|
|
9277
|
-
break;
|
|
9278
|
-
case 'Viewlet.setSelectionByName':
|
|
9279
|
-
// @ts-ignore
|
|
9280
|
-
setSelectionByName(viewletId, method, ...args);
|
|
9281
|
-
break;
|
|
9282
|
-
case 'Viewlet.setUid':
|
|
9283
|
-
// @ts-ignore
|
|
9284
|
-
setUid(viewletId, method, ...args);
|
|
9285
|
-
break;
|
|
9286
|
-
case 'Viewlet.setValueByName':
|
|
9287
|
-
// @ts-ignore
|
|
9288
|
-
setValueByName(viewletId, method, ...args);
|
|
9289
|
-
break;
|
|
9290
|
-
default:
|
|
9291
|
-
{
|
|
9292
|
-
invoke(viewletId, method, ...args);
|
|
9293
|
-
}
|
|
9294
|
-
}
|
|
9295
|
-
}
|
|
9274
|
+
executeCommands(commands);
|
|
9296
9275
|
};
|
|
9297
9276
|
const dispose$3 = id => {
|
|
9298
9277
|
try {
|
|
9299
9278
|
number(id);
|
|
9300
|
-
const instance = get$
|
|
9279
|
+
const instance = get$a(id);
|
|
9301
9280
|
if (!instance) {
|
|
9302
9281
|
warn$1(`viewlet instance ${id} not found and cannot be disposed`);
|
|
9303
9282
|
return;
|
|
@@ -9308,14 +9287,14 @@ const dispose$3 = id => {
|
|
|
9308
9287
|
if (instance.state.$Viewlet?.isConnected) {
|
|
9309
9288
|
instance.state.$Viewlet.remove();
|
|
9310
9289
|
}
|
|
9311
|
-
set$
|
|
9290
|
+
set$9(id, undefined);
|
|
9312
9291
|
} catch {
|
|
9313
9292
|
throw new Error(`Failed to dispose ${id}`);
|
|
9314
9293
|
}
|
|
9315
9294
|
};
|
|
9316
9295
|
const handleError$1 = (id, parentId, message) => {
|
|
9317
9296
|
info(`[viewlet-error] ${id}: ${message}`);
|
|
9318
|
-
const instance = get$
|
|
9297
|
+
const instance = get$a(id);
|
|
9319
9298
|
if (instance?.state.$Viewlet.isConnected) {
|
|
9320
9299
|
instance.state.$Viewlet.remove();
|
|
9321
9300
|
}
|
|
@@ -9327,7 +9306,7 @@ const handleError$1 = (id, parentId, message) => {
|
|
|
9327
9306
|
instance.state.$Viewlet.textContent = `${message}`;
|
|
9328
9307
|
}
|
|
9329
9308
|
// TODO error should bubble up to until highest possible component
|
|
9330
|
-
const parentInstance = get$
|
|
9309
|
+
const parentInstance = get$a(parentId);
|
|
9331
9310
|
if (parentInstance?.factory?.handleError) {
|
|
9332
9311
|
parentInstance.factory.handleError(instance.state, message);
|
|
9333
9312
|
}
|
|
@@ -9341,9 +9320,9 @@ const appendViewlet = (parentId, childId, focus) => {
|
|
|
9341
9320
|
// TODO
|
|
9342
9321
|
return;
|
|
9343
9322
|
}
|
|
9344
|
-
const parentInstanceState = get$
|
|
9323
|
+
const parentInstanceState = get$a(parentId); // TODO must ensure that parent is already created
|
|
9345
9324
|
const parentModule = parentInstanceState.factory;
|
|
9346
|
-
const childInstance = get$
|
|
9325
|
+
const childInstance = get$a(childId);
|
|
9347
9326
|
if (!childInstance) {
|
|
9348
9327
|
throw new Error(`child instance ${childId} must be defined to be appended to parent ${parentId}`);
|
|
9349
9328
|
}
|
|
@@ -9359,49 +9338,70 @@ const ariaAnnounce = async message => {
|
|
|
9359
9338
|
const AriaAlert$1 = await Promise.resolve().then(function () { return AriaAlert; });
|
|
9360
9339
|
AriaAlert$1.alert(message);
|
|
9361
9340
|
};
|
|
9341
|
+
const prependChild = ($Parent, $Child) => {
|
|
9342
|
+
$Parent.prepend($Child);
|
|
9343
|
+
return true;
|
|
9344
|
+
};
|
|
9345
|
+
const appendAfterPreviousReference = (referenceNodes, childIndex, $Child) => {
|
|
9346
|
+
for (let i = childIndex - 1; i >= 0; i--) {
|
|
9347
|
+
const beforeId = referenceNodes[i];
|
|
9348
|
+
const beforeInstance = get$a(beforeId);
|
|
9349
|
+
if (beforeInstance) {
|
|
9350
|
+
const $ReferenceNode = beforeInstance.state.$Viewlet;
|
|
9351
|
+
$ReferenceNode.after($Child);
|
|
9352
|
+
return true;
|
|
9353
|
+
}
|
|
9354
|
+
}
|
|
9355
|
+
return false;
|
|
9356
|
+
};
|
|
9357
|
+
const appendBeforeNextReference = (referenceNodes, childIndex, $Child) => {
|
|
9358
|
+
for (let i = childIndex + 1; i < referenceNodes.length; i++) {
|
|
9359
|
+
const afterId = referenceNodes[i];
|
|
9360
|
+
const afterInstance = get$a(afterId);
|
|
9361
|
+
if (afterInstance) {
|
|
9362
|
+
const $ReferenceNode = afterInstance.state.$Viewlet;
|
|
9363
|
+
$ReferenceNode.before($Child);
|
|
9364
|
+
return true;
|
|
9365
|
+
}
|
|
9366
|
+
}
|
|
9367
|
+
return false;
|
|
9368
|
+
};
|
|
9369
|
+
const appendWithReferenceNodes = ($Parent, $Child, childId, referenceNodes) => {
|
|
9370
|
+
if (childId === referenceNodes[0]) {
|
|
9371
|
+
return prependChild($Parent, $Child);
|
|
9372
|
+
}
|
|
9373
|
+
const childIndex = referenceNodes.indexOf(childId);
|
|
9374
|
+
if (childIndex === -1) {
|
|
9375
|
+
$Parent.append($Child);
|
|
9376
|
+
return false;
|
|
9377
|
+
}
|
|
9378
|
+
if (appendAfterPreviousReference(referenceNodes, childIndex, $Child)) {
|
|
9379
|
+
return true;
|
|
9380
|
+
}
|
|
9381
|
+
if (appendBeforeNextReference(referenceNodes, childIndex, $Child)) {
|
|
9382
|
+
return true;
|
|
9383
|
+
}
|
|
9384
|
+
$Parent.append($Child);
|
|
9385
|
+
return false;
|
|
9386
|
+
};
|
|
9362
9387
|
const append = (parentId, childId, referenceNodes) => {
|
|
9363
9388
|
number(parentId);
|
|
9364
9389
|
number(childId);
|
|
9365
|
-
const parentInstance = get$
|
|
9390
|
+
const parentInstance = get$a(parentId);
|
|
9366
9391
|
if (!parentInstance) {
|
|
9367
9392
|
throw new Error(`cannot append child: instance ${parentId} not found`);
|
|
9368
9393
|
}
|
|
9369
9394
|
const $Parent = parentInstance.state.$Viewlet;
|
|
9370
|
-
const childInstance = get$
|
|
9395
|
+
const childInstance = get$a(childId);
|
|
9371
9396
|
if (!childInstance) {
|
|
9372
9397
|
throw new Error(`cannot append child: child instance not found ${childId}`);
|
|
9373
9398
|
}
|
|
9374
9399
|
const $Child = childInstance.state.$Viewlet;
|
|
9375
9400
|
if (referenceNodes) {
|
|
9376
9401
|
// TODO this might be too inefficient
|
|
9377
|
-
if (childId
|
|
9378
|
-
$Parent.prepend($Child);
|
|
9402
|
+
if (appendWithReferenceNodes($Parent, $Child, childId, referenceNodes)) {
|
|
9379
9403
|
return;
|
|
9380
9404
|
}
|
|
9381
|
-
for (let i = 0; i < referenceNodes.length; i++) {
|
|
9382
|
-
const id = referenceNodes[i];
|
|
9383
|
-
if (id === childId) {
|
|
9384
|
-
for (let j = i - 1; j >= 0; j--) {
|
|
9385
|
-
const beforeId = referenceNodes[j];
|
|
9386
|
-
const beforeInstance = get$1$1(beforeId);
|
|
9387
|
-
if (beforeInstance) {
|
|
9388
|
-
const $ReferenceNode = beforeInstance.state.$Viewlet;
|
|
9389
|
-
$ReferenceNode.after($Child);
|
|
9390
|
-
return;
|
|
9391
|
-
}
|
|
9392
|
-
}
|
|
9393
|
-
for (let j = i + 1; j < referenceNodes.length; j++) {
|
|
9394
|
-
const afterId = referenceNodes[j];
|
|
9395
|
-
const afterInstance = get$1$1(afterId);
|
|
9396
|
-
if (afterInstance) {
|
|
9397
|
-
const $ReferenceNode = afterInstance.state.$Viewlet;
|
|
9398
|
-
$ReferenceNode.before($Child);
|
|
9399
|
-
return;
|
|
9400
|
-
}
|
|
9401
|
-
}
|
|
9402
|
-
}
|
|
9403
|
-
}
|
|
9404
|
-
$Parent.append($Child);
|
|
9405
9405
|
} else {
|
|
9406
9406
|
$Parent.append($Child);
|
|
9407
9407
|
}
|
|
@@ -9410,11 +9410,11 @@ const append = (parentId, childId, referenceNodes) => {
|
|
|
9410
9410
|
}
|
|
9411
9411
|
};
|
|
9412
9412
|
const replaceChildren = (parentId, childIds) => {
|
|
9413
|
-
const parentInstance = get$
|
|
9413
|
+
const parentInstance = get$a(parentId);
|
|
9414
9414
|
const $Parent = parentInstance.state.$Viewlet;
|
|
9415
9415
|
const $Fragment = document.createDocumentFragment();
|
|
9416
9416
|
for (const childId of childIds) {
|
|
9417
|
-
const childInstance = get$
|
|
9417
|
+
const childInstance = get$a(childId);
|
|
9418
9418
|
const $Child = childInstance.state.$Viewlet;
|
|
9419
9419
|
$Fragment.append($Child);
|
|
9420
9420
|
}
|
|
@@ -9422,72 +9422,10 @@ const replaceChildren = (parentId, childIds) => {
|
|
|
9422
9422
|
};
|
|
9423
9423
|
const appendToBody = childId => {
|
|
9424
9424
|
const $Parent = document.body;
|
|
9425
|
-
const childInstance = get$
|
|
9425
|
+
const childInstance = get$a(childId);
|
|
9426
9426
|
const $Child = childInstance.state.$Viewlet;
|
|
9427
9427
|
$Parent.append($Child);
|
|
9428
9428
|
};
|
|
9429
|
-
const getFn = command => {
|
|
9430
|
-
switch (command) {
|
|
9431
|
-
case 'Css.addCssStyleSheet':
|
|
9432
|
-
case 'Viewlet.addCss':
|
|
9433
|
-
case 'Viewlet.setCss':
|
|
9434
|
-
return addCssStyleSheet;
|
|
9435
|
-
case 'Viewlet.addKeyBindings':
|
|
9436
|
-
return addKeyBindings;
|
|
9437
|
-
case 'Viewlet.append':
|
|
9438
|
-
return append;
|
|
9439
|
-
case 'Viewlet.appendToBody':
|
|
9440
|
-
return appendToBody;
|
|
9441
|
-
case 'Viewlet.appendViewlet':
|
|
9442
|
-
return appendViewlet;
|
|
9443
|
-
case 'Viewlet.ariaAnnounce':
|
|
9444
|
-
return ariaAnnounce;
|
|
9445
|
-
case 'Viewlet.attachWindowEvents':
|
|
9446
|
-
return attachWindowEvents;
|
|
9447
|
-
case 'Viewlet.create':
|
|
9448
|
-
return create$4;
|
|
9449
|
-
case 'Viewlet.createFunctionalRoot':
|
|
9450
|
-
return createFunctionalRoot;
|
|
9451
|
-
case 'Viewlet.createPlaceholder':
|
|
9452
|
-
return createPlaceholder;
|
|
9453
|
-
case 'Viewlet.dispose':
|
|
9454
|
-
return dispose$3;
|
|
9455
|
-
case 'Viewlet.focus':
|
|
9456
|
-
return focus$1;
|
|
9457
|
-
case 'Viewlet.focusElementByName':
|
|
9458
|
-
return focusElementByName;
|
|
9459
|
-
case 'Viewlet.focusSelector':
|
|
9460
|
-
return focusSelector;
|
|
9461
|
-
case 'Viewlet.registerEventListeners':
|
|
9462
|
-
return registerEventListeners;
|
|
9463
|
-
case 'Viewlet.replaceChildren':
|
|
9464
|
-
return replaceChildren;
|
|
9465
|
-
case 'Viewlet.send':
|
|
9466
|
-
return invoke;
|
|
9467
|
-
case 'Viewlet.setBounds':
|
|
9468
|
-
return setBounds$1;
|
|
9469
|
-
case 'Viewlet.setCheckBoxValue':
|
|
9470
|
-
return setCheckBoxValue;
|
|
9471
|
-
case 'Viewlet.setDom':
|
|
9472
|
-
return setDom;
|
|
9473
|
-
case 'Viewlet.setDom2':
|
|
9474
|
-
return setDom2;
|
|
9475
|
-
case 'Viewlet.setDragData':
|
|
9476
|
-
return setDragData;
|
|
9477
|
-
case 'Viewlet.setInputValues':
|
|
9478
|
-
return setInputValues;
|
|
9479
|
-
case 'Viewlet.setPatches':
|
|
9480
|
-
return setPatches;
|
|
9481
|
-
case 'Viewlet.setProperty':
|
|
9482
|
-
return setProperty;
|
|
9483
|
-
case 'Viewlet.setValueByName':
|
|
9484
|
-
return setValueByName;
|
|
9485
|
-
case 'Viewlet.show':
|
|
9486
|
-
return show;
|
|
9487
|
-
default:
|
|
9488
|
-
throw new Error(`unknown command ${command}`);
|
|
9489
|
-
}
|
|
9490
|
-
};
|
|
9491
9429
|
const executeCommands = commands => {
|
|
9492
9430
|
for (const [command, ...args] of commands) {
|
|
9493
9431
|
const fn = getFn(command);
|
|
@@ -9496,7 +9434,7 @@ const executeCommands = commands => {
|
|
|
9496
9434
|
}
|
|
9497
9435
|
};
|
|
9498
9436
|
const show = id => {
|
|
9499
|
-
const instance = get$
|
|
9437
|
+
const instance = get$a(id);
|
|
9500
9438
|
const $Viewlet = instance.state.$Viewlet;
|
|
9501
9439
|
const $Workbench = document.getElementById('Workbench');
|
|
9502
9440
|
// @ts-expect-error
|
|
@@ -9506,7 +9444,7 @@ const show = id => {
|
|
|
9506
9444
|
}
|
|
9507
9445
|
};
|
|
9508
9446
|
const setBounds$1 = (id, left, top, width, height) => {
|
|
9509
|
-
const instance = get$
|
|
9447
|
+
const instance = get$a(id);
|
|
9510
9448
|
if (!instance) {
|
|
9511
9449
|
return;
|
|
9512
9450
|
}
|
|
@@ -9514,7 +9452,7 @@ const setBounds$1 = (id, left, top, width, height) => {
|
|
|
9514
9452
|
setBounds$a($Viewlet, left, top, width, height);
|
|
9515
9453
|
};
|
|
9516
9454
|
const setProperty = (id, selector, property, value) => {
|
|
9517
|
-
const instance = get$
|
|
9455
|
+
const instance = get$a(id);
|
|
9518
9456
|
if (!instance) {
|
|
9519
9457
|
return;
|
|
9520
9458
|
}
|
|
@@ -9525,6 +9463,49 @@ const setProperty = (id, selector, property, value) => {
|
|
|
9525
9463
|
}
|
|
9526
9464
|
$Element[property] = value;
|
|
9527
9465
|
};
|
|
9466
|
+
const commandHandlers = {
|
|
9467
|
+
'Css.addCssStyleSheet': addCssStyleSheet,
|
|
9468
|
+
'Viewlet.addCss': addCssStyleSheet,
|
|
9469
|
+
'Viewlet.addKeyBindings': addKeyBindings,
|
|
9470
|
+
'Viewlet.append': append,
|
|
9471
|
+
'Viewlet.appendToBody': appendToBody,
|
|
9472
|
+
'Viewlet.appendViewlet': appendViewlet,
|
|
9473
|
+
'Viewlet.ariaAnnounce': ariaAnnounce,
|
|
9474
|
+
'Viewlet.attachWindowEvents': attachWindowEvents,
|
|
9475
|
+
'Viewlet.create': create$4,
|
|
9476
|
+
'Viewlet.createFunctionalRoot': createFunctionalRoot,
|
|
9477
|
+
'Viewlet.createPlaceholder': createPlaceholder,
|
|
9478
|
+
'Viewlet.dispose': dispose$3,
|
|
9479
|
+
'Viewlet.focus': focus$1,
|
|
9480
|
+
'Viewlet.focusElementByName': focusElementByName,
|
|
9481
|
+
'Viewlet.focusSelector': focusSelector,
|
|
9482
|
+
'Viewlet.handleError': handleError$1,
|
|
9483
|
+
'Viewlet.move': move,
|
|
9484
|
+
'Viewlet.registerEventListeners': registerEventListeners,
|
|
9485
|
+
'Viewlet.removeKeyBindings': removeKeyBindings,
|
|
9486
|
+
'Viewlet.replaceChildren': replaceChildren,
|
|
9487
|
+
'Viewlet.send': invoke,
|
|
9488
|
+
'Viewlet.setBounds': setBounds$1,
|
|
9489
|
+
'Viewlet.setCheckBoxValue': setCheckBoxValue,
|
|
9490
|
+
'Viewlet.setCss': addCssStyleSheet,
|
|
9491
|
+
'Viewlet.setDom': setDom,
|
|
9492
|
+
'Viewlet.setDom2': setDom2,
|
|
9493
|
+
'Viewlet.setDragData': setDragData,
|
|
9494
|
+
'Viewlet.setInputValues': setInputValues,
|
|
9495
|
+
'Viewlet.setPatches': setPatches,
|
|
9496
|
+
'Viewlet.setProperty': setProperty,
|
|
9497
|
+
'Viewlet.setSelectionByName': setSelectionByName,
|
|
9498
|
+
'Viewlet.setUid': setUid,
|
|
9499
|
+
'Viewlet.setValueByName': setValueByName,
|
|
9500
|
+
'Viewlet.show': show
|
|
9501
|
+
};
|
|
9502
|
+
const getFn = command => {
|
|
9503
|
+
const fn = commandHandlers[command];
|
|
9504
|
+
if (!fn) {
|
|
9505
|
+
throw new Error(`unknown command ${command}`);
|
|
9506
|
+
}
|
|
9507
|
+
return fn;
|
|
9508
|
+
};
|
|
9528
9509
|
|
|
9529
9510
|
const LocalStorage = 1;
|
|
9530
9511
|
const SessionStorage = 2;
|
|
@@ -9627,7 +9608,7 @@ const handleMessagePort = async port => {
|
|
|
9627
9608
|
};
|
|
9628
9609
|
|
|
9629
9610
|
const set = ($Iframe, permissionPolicy) => {
|
|
9630
|
-
if (permissionPolicy
|
|
9611
|
+
if (!permissionPolicy) {
|
|
9631
9612
|
return;
|
|
9632
9613
|
}
|
|
9633
9614
|
$Iframe.allow = permissionPolicy;
|
|
@@ -9748,6 +9729,7 @@ const commandMap = {
|
|
|
9748
9729
|
'OffscreenCanvas.create': create$w,
|
|
9749
9730
|
'OffscreenCanvas.create2': create2,
|
|
9750
9731
|
'Open.openUrl': openUrl,
|
|
9732
|
+
'Open.redirectToUrl': redirectToUrl,
|
|
9751
9733
|
'Performance.getMemory': getMemory,
|
|
9752
9734
|
'Performance.measureUserAgentSpecificMemory': measureUserAgentSpecificMemory,
|
|
9753
9735
|
'PointerCapture.mock': mock,
|
|
@@ -9971,15 +9953,9 @@ const isNormalStackLine = line => {
|
|
|
9971
9953
|
};
|
|
9972
9954
|
const isApplicationUsefulLine = (line, index) => {
|
|
9973
9955
|
if (index === 0) {
|
|
9974
|
-
|
|
9975
|
-
return false;
|
|
9976
|
-
}
|
|
9977
|
-
return true;
|
|
9978
|
-
}
|
|
9979
|
-
if (RE_RESTORE_JSON_RPC_ERROR.test(line) || RE_JSON_RPC_INVOKE.test(line) || RE_UNWRAP_JSON_RPC_RESULT.test(line) || RE_CONSTRUCT_ERROR.test(line) || RE_HANDLE_JSON_RPC_MESSAGE.test(line)) {
|
|
9980
|
-
return false;
|
|
9956
|
+
return !RE_ASSERT.test(line);
|
|
9981
9957
|
}
|
|
9982
|
-
return
|
|
9958
|
+
return !(RE_RESTORE_JSON_RPC_ERROR.test(line) || RE_JSON_RPC_INVOKE.test(line) || RE_UNWRAP_JSON_RPC_RESULT.test(line) || RE_CONSTRUCT_ERROR.test(line) || RE_HANDLE_JSON_RPC_MESSAGE.test(line));
|
|
9983
9959
|
};
|
|
9984
9960
|
const cleanLine = line => {
|
|
9985
9961
|
if (line.startsWith(' at async Module.')) {
|
|
@@ -10034,10 +10010,7 @@ const cleanStack = stack => {
|
|
|
10034
10010
|
};
|
|
10035
10011
|
|
|
10036
10012
|
const isActualSourceFile = path => {
|
|
10037
|
-
|
|
10038
|
-
return false;
|
|
10039
|
-
}
|
|
10040
|
-
return true;
|
|
10013
|
+
return !(path === '<anonymous>' || path === 'debugger eval code' || path.startsWith('"') || path.startsWith(`'`) || path.startsWith(')') || path.startsWith('file://'));
|
|
10041
10014
|
};
|
|
10042
10015
|
|
|
10043
10016
|
const getIsFirefox = () => {
|
|
@@ -10421,6 +10394,10 @@ const reduceWrite = (state, action) => {
|
|
|
10421
10394
|
};
|
|
10422
10395
|
const reduce = (state, action) => {
|
|
10423
10396
|
switch (action.type) {
|
|
10397
|
+
case 'focus':
|
|
10398
|
+
{
|
|
10399
|
+
return;
|
|
10400
|
+
}
|
|
10424
10401
|
case 'write':
|
|
10425
10402
|
{
|
|
10426
10403
|
return;
|
|
@@ -10535,6 +10512,17 @@ const setMessage = ($Old, $New, message) => {
|
|
|
10535
10512
|
$New.removeAttribute(AriaHidden);
|
|
10536
10513
|
$New.textContent = message;
|
|
10537
10514
|
};
|
|
10515
|
+
const getElements = () => {
|
|
10516
|
+
const $AriaAlert1 = getAriaAlert1();
|
|
10517
|
+
const $AriaAlert2 = getAriaAlert2();
|
|
10518
|
+
if (!$AriaAlert1 || !$AriaAlert2) {
|
|
10519
|
+
throw new Error('aria alert elements not found');
|
|
10520
|
+
}
|
|
10521
|
+
return {
|
|
10522
|
+
$AriaAlert1,
|
|
10523
|
+
$AriaAlert2
|
|
10524
|
+
};
|
|
10525
|
+
};
|
|
10538
10526
|
const alert$1 = message => {
|
|
10539
10527
|
if (!message) {
|
|
10540
10528
|
return;
|
|
@@ -10549,9 +10537,10 @@ const alert$1 = message => {
|
|
|
10549
10537
|
document.body.append($AriaMessages);
|
|
10550
10538
|
setElements($AriaMessages, $AriaAlert1, $AriaAlert2);
|
|
10551
10539
|
}
|
|
10552
|
-
const
|
|
10553
|
-
|
|
10554
|
-
|
|
10540
|
+
const {
|
|
10541
|
+
$AriaAlert1,
|
|
10542
|
+
$AriaAlert2
|
|
10543
|
+
} = getElements();
|
|
10555
10544
|
if ($AriaAlert1.textContent === message) {
|
|
10556
10545
|
setMessage($AriaAlert1, $AriaAlert2, message);
|
|
10557
10546
|
} else {
|