solid-panes 3.5.9 → 3.5.13
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/.github/workflows/ci.yml +1 -1
- package/README.md +4 -0
- package/lib/dashboard/dashboardPane.d.ts.map +1 -1
- package/lib/dashboard/dashboardPane.js +6 -2
- package/lib/dashboard/dashboardPane.js.map +1 -1
- package/lib/form/pane.js +1 -1
- package/lib/form/pane.js.map +1 -1
- package/lib/humanReadablePane.js +55 -23
- package/lib/humanReadablePane.js.map +1 -1
- package/lib/outline/manager.js +201 -207
- package/lib/outline/manager.js.map +1 -1
- package/lib/registerPanes.js +1 -1
- package/lib/registerPanes.js.map +1 -1
- package/lib/versionInfo.d.ts +0 -1
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +18 -19
- package/lib/versionInfo.js.map +1 -1
- package/package.json +23 -22
- package/src/dashboard/dashboardPane.ts +5 -3
- package/src/form/pane.js +1 -1
- package/src/humanReadablePane.js +38 -14
- package/src/outline/manager.js +25 -21
- package/src/registerPanes.js +2 -2
- package/src/versionInfo.ts +18 -19
- package/webpack.config.js +1 -1
package/lib/outline/manager.js
CHANGED
|
@@ -428,23 +428,23 @@ function _default(context) {
|
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
function _getDashboardItems() {
|
|
431
|
-
_getDashboardItems = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
431
|
+
_getDashboardItems = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
|
|
432
432
|
var me, div, _yield$Promise$all, _yield$Promise$all2, books, pods, getPods, _getPods, getAddressBooks, _getAddressBooks;
|
|
433
433
|
|
|
434
|
-
return regeneratorRuntime.wrap(function
|
|
434
|
+
return regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
435
435
|
while (1) {
|
|
436
|
-
switch (
|
|
436
|
+
switch (_context7.prev = _context7.next) {
|
|
437
437
|
case 0:
|
|
438
438
|
_getAddressBooks = function _getAddressBooks3() {
|
|
439
|
-
_getAddressBooks = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
440
|
-
var
|
|
439
|
+
_getAddressBooks = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
440
|
+
var _context5;
|
|
441
441
|
|
|
442
|
-
return regeneratorRuntime.wrap(function
|
|
442
|
+
return regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
443
443
|
while (1) {
|
|
444
|
-
switch (
|
|
444
|
+
switch (_context6.prev = _context6.next) {
|
|
445
445
|
case 0:
|
|
446
|
-
|
|
447
|
-
|
|
446
|
+
_context6.prev = 0;
|
|
447
|
+
_context6.next = 3;
|
|
448
448
|
return UI.authn.findAppInstances({
|
|
449
449
|
me: me,
|
|
450
450
|
div: div,
|
|
@@ -452,8 +452,8 @@ function _default(context) {
|
|
|
452
452
|
}, ns.vcard('AddressBook'));
|
|
453
453
|
|
|
454
454
|
case 3:
|
|
455
|
-
|
|
456
|
-
return
|
|
455
|
+
_context5 = _context6.sent;
|
|
456
|
+
return _context6.abrupt("return", (_context5.instances || []).map(function (book, index) {
|
|
457
457
|
return {
|
|
458
458
|
paneName: 'contact',
|
|
459
459
|
tabName: "contact-".concat(index),
|
|
@@ -464,19 +464,19 @@ function _default(context) {
|
|
|
464
464
|
}));
|
|
465
465
|
|
|
466
466
|
case 7:
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
_context6.prev = 7;
|
|
468
|
+
_context6.t0 = _context6["catch"](0);
|
|
469
469
|
console.error('oops in globalAppTabs AddressBook');
|
|
470
470
|
|
|
471
471
|
case 10:
|
|
472
|
-
return
|
|
472
|
+
return _context6.abrupt("return", []);
|
|
473
473
|
|
|
474
474
|
case 11:
|
|
475
475
|
case "end":
|
|
476
|
-
return
|
|
476
|
+
return _context6.stop();
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
},
|
|
479
|
+
}, _callee5, null, [[0, 7]]);
|
|
480
480
|
}));
|
|
481
481
|
return _getAddressBooks.apply(this, arguments);
|
|
482
482
|
};
|
|
@@ -486,57 +486,57 @@ function _default(context) {
|
|
|
486
486
|
};
|
|
487
487
|
|
|
488
488
|
_getPods = function _getPods3() {
|
|
489
|
-
_getPods = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
490
|
-
var
|
|
489
|
+
_getPods = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
490
|
+
var addPodRoot, _addPodRoot, addPodRootFromUrl, _addPodRootFromUrl, pods, uri, podUrl;
|
|
491
491
|
|
|
492
|
-
return regeneratorRuntime.wrap(function
|
|
492
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
493
493
|
while (1) {
|
|
494
|
-
switch (
|
|
494
|
+
switch (_context4.prev = _context4.next) {
|
|
495
495
|
case 0:
|
|
496
496
|
_addPodRootFromUrl = function _addPodRootFromUrl3() {
|
|
497
|
-
_addPodRootFromUrl = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
497
|
+
_addPodRootFromUrl = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(url) {
|
|
498
498
|
var podStorage;
|
|
499
|
-
return regeneratorRuntime.wrap(function
|
|
499
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
500
500
|
while (1) {
|
|
501
|
-
switch (
|
|
501
|
+
switch (_context3.prev = _context3.next) {
|
|
502
502
|
case 0:
|
|
503
503
|
podStorage = new URL(url); // check that origin is not included in pods array
|
|
504
504
|
|
|
505
505
|
if (pods.some(function (pod) {
|
|
506
506
|
return pod.uri.includes(podStorage.origin);
|
|
507
507
|
})) {
|
|
508
|
-
|
|
508
|
+
_context3.next = 10;
|
|
509
509
|
break;
|
|
510
510
|
}
|
|
511
511
|
|
|
512
|
-
|
|
512
|
+
_context3.t0 = podStorage.pathname === '/';
|
|
513
513
|
|
|
514
|
-
if (
|
|
515
|
-
|
|
514
|
+
if (_context3.t0) {
|
|
515
|
+
_context3.next = 7;
|
|
516
516
|
break;
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
|
|
519
|
+
_context3.next = 6;
|
|
520
520
|
return addPodRoot(kb.sym("".concat(podStorage.origin, "/").concat(podStorage.pathname.split('/')[1], "/")));
|
|
521
521
|
|
|
522
522
|
case 6:
|
|
523
|
-
|
|
523
|
+
_context3.t0 = !_context3.sent;
|
|
524
524
|
|
|
525
525
|
case 7:
|
|
526
|
-
if (!
|
|
527
|
-
|
|
526
|
+
if (!_context3.t0) {
|
|
527
|
+
_context3.next = 10;
|
|
528
528
|
break;
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
|
|
531
|
+
_context3.next = 10;
|
|
532
532
|
return addPodRoot(kb.sym("".concat(podStorage.origin, "/")));
|
|
533
533
|
|
|
534
534
|
case 10:
|
|
535
535
|
case "end":
|
|
536
|
-
return
|
|
536
|
+
return _context3.stop();
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
},
|
|
539
|
+
}, _callee3);
|
|
540
540
|
}));
|
|
541
541
|
return _addPodRootFromUrl.apply(this, arguments);
|
|
542
542
|
};
|
|
@@ -546,32 +546,32 @@ function _default(context) {
|
|
|
546
546
|
};
|
|
547
547
|
|
|
548
548
|
_addPodRoot = function _addPodRoot3() {
|
|
549
|
-
_addPodRoot = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
550
|
-
return regeneratorRuntime.wrap(function
|
|
549
|
+
_addPodRoot = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(pod) {
|
|
550
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
551
551
|
while (1) {
|
|
552
|
-
switch (
|
|
552
|
+
switch (_context2.prev = _context2.next) {
|
|
553
553
|
case 0:
|
|
554
|
-
|
|
555
|
-
return
|
|
554
|
+
_context2.next = 2;
|
|
555
|
+
return checkForContainerRepresentation(pod);
|
|
556
556
|
|
|
557
557
|
case 2:
|
|
558
558
|
if (!kb.holds(pod, ns.rdf('type'), ns.space('Storage'), pod.doc())) {
|
|
559
|
-
|
|
559
|
+
_context2.next = 5;
|
|
560
560
|
break;
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
pods.push(pod);
|
|
564
|
-
return
|
|
564
|
+
return _context2.abrupt("return", true);
|
|
565
565
|
|
|
566
566
|
case 5:
|
|
567
|
-
return
|
|
567
|
+
return _context2.abrupt("return", false);
|
|
568
568
|
|
|
569
569
|
case 6:
|
|
570
570
|
case "end":
|
|
571
|
-
return
|
|
571
|
+
return _context2.stop();
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
},
|
|
574
|
+
}, _callee2);
|
|
575
575
|
}));
|
|
576
576
|
return _addPodRoot.apply(this, arguments);
|
|
577
577
|
};
|
|
@@ -580,114 +580,53 @@ function _default(context) {
|
|
|
580
580
|
return _addPodRoot.apply(this, arguments);
|
|
581
581
|
};
|
|
582
582
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
var response, podTurtle;
|
|
586
|
-
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
587
|
-
while (1) {
|
|
588
|
-
switch (_context3.prev = _context3.next) {
|
|
589
|
-
case 0:
|
|
590
|
-
_context3.next = 2;
|
|
591
|
-
return kb.fetcher.webOperation('GET', pod.uri, kb.fetcher.initFetchOptions(pod.uri, {
|
|
592
|
-
headers: {
|
|
593
|
-
accept: 'text/turtle'
|
|
594
|
-
}
|
|
595
|
-
}));
|
|
596
|
-
|
|
597
|
-
case 2:
|
|
598
|
-
response = _context3.sent;
|
|
599
|
-
podTurtle = response.responseText;
|
|
600
|
-
$rdf.parse(podTurtle, kb, pod.uri, 'text/turtle');
|
|
601
|
-
|
|
602
|
-
case 5:
|
|
603
|
-
case "end":
|
|
604
|
-
return _context3.stop();
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
}, _callee3);
|
|
608
|
-
}));
|
|
609
|
-
return _loadContainerRepresentation.apply(this, arguments);
|
|
610
|
-
};
|
|
611
|
-
|
|
612
|
-
loadContainerRepresentation = function _loadContainerReprese(_x6) {
|
|
613
|
-
return _loadContainerRepresentation.apply(this, arguments);
|
|
614
|
-
};
|
|
615
|
-
|
|
616
|
-
_context6.prev = 6;
|
|
617
|
-
_context6.next = 9;
|
|
583
|
+
_context4.prev = 4;
|
|
584
|
+
_context4.next = 7;
|
|
618
585
|
return kb.fetcher.load(me.doc());
|
|
619
586
|
|
|
620
|
-
case
|
|
621
|
-
|
|
587
|
+
case 7:
|
|
588
|
+
_context4.next = 13;
|
|
622
589
|
break;
|
|
623
590
|
|
|
624
|
-
case
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
console.error('Unable to load profile',
|
|
628
|
-
return
|
|
591
|
+
case 9:
|
|
592
|
+
_context4.prev = 9;
|
|
593
|
+
_context4.t0 = _context4["catch"](4);
|
|
594
|
+
console.error('Unable to load profile', _context4.t0);
|
|
595
|
+
return _context4.abrupt("return", []);
|
|
629
596
|
|
|
630
|
-
case
|
|
597
|
+
case 13:
|
|
631
598
|
pods = kb.each(me, ns.space('storage'), null, me.doc());
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
pods.map( /*#__PURE__*/function () {
|
|
642
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(pod) {
|
|
643
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
644
|
-
while (1) {
|
|
645
|
-
switch (_context2.prev = _context2.next) {
|
|
646
|
-
case 0:
|
|
647
|
-
if (kb.any(pod, ns.ldp('contains'), undefined, pod.doc())) {
|
|
648
|
-
_context2.next = 3;
|
|
649
|
-
break;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
_context2.next = 3;
|
|
653
|
-
return loadContainerRepresentation(pod);
|
|
654
|
-
|
|
655
|
-
case 3:
|
|
656
|
-
case "end":
|
|
657
|
-
return _context2.stop();
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}, _callee2);
|
|
661
|
-
}));
|
|
662
|
-
|
|
663
|
-
return function (_x9) {
|
|
664
|
-
return _ref.apply(this, arguments);
|
|
665
|
-
};
|
|
666
|
-
}());
|
|
667
|
-
_context6.next = 23;
|
|
599
|
+
_context4.prev = 14;
|
|
600
|
+
// if uri then SolidOS is a browse.html web app
|
|
601
|
+
uri = new URL(window.location.href).searchParams.get('uri');
|
|
602
|
+
podUrl = uri || window.location.href;
|
|
603
|
+
_context4.next = 19;
|
|
604
|
+
return addPodRootFromUrl(podUrl.substring(0, podUrl.lastIndexOf('/') + 1));
|
|
605
|
+
|
|
606
|
+
case 19:
|
|
607
|
+
_context4.next = 24;
|
|
668
608
|
break;
|
|
669
609
|
|
|
670
610
|
case 21:
|
|
671
|
-
|
|
672
|
-
|
|
611
|
+
_context4.prev = 21;
|
|
612
|
+
_context4.t1 = _context4["catch"](14);
|
|
613
|
+
console.error('cannot load container', _context4.t1);
|
|
673
614
|
|
|
674
|
-
case
|
|
675
|
-
|
|
676
|
-
|
|
615
|
+
case 24:
|
|
616
|
+
if (pods.length) {
|
|
617
|
+
_context4.next = 26;
|
|
618
|
+
break;
|
|
619
|
+
}
|
|
677
620
|
|
|
678
|
-
|
|
679
|
-
_context6.next = 31;
|
|
680
|
-
break;
|
|
621
|
+
return _context4.abrupt("return", []);
|
|
681
622
|
|
|
682
|
-
case
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
623
|
+
case 26:
|
|
624
|
+
return _context4.abrupt("return", pods.map(function (pod, index) {
|
|
625
|
+
function split(item) {
|
|
626
|
+
return item.uri.split('//')[1].slice(0, -1);
|
|
627
|
+
}
|
|
687
628
|
|
|
688
|
-
|
|
689
|
-
return _context6.abrupt("return", pods.map(function (pod, index) {
|
|
690
|
-
var label = pods.length > 1 ? pod.uri.split('//')[1].slice(0, -1) : 'Your storage';
|
|
629
|
+
var label = split(me).startsWith(split(pod)) ? 'Your storage' : split(pod);
|
|
691
630
|
return {
|
|
692
631
|
paneName: 'folder',
|
|
693
632
|
tabName: "folder-".concat(index),
|
|
@@ -697,12 +636,12 @@ function _default(context) {
|
|
|
697
636
|
};
|
|
698
637
|
}));
|
|
699
638
|
|
|
700
|
-
case
|
|
639
|
+
case 27:
|
|
701
640
|
case "end":
|
|
702
|
-
return
|
|
641
|
+
return _context4.stop();
|
|
703
642
|
}
|
|
704
643
|
}
|
|
705
|
-
},
|
|
644
|
+
}, _callee4, null, [[4, 9], [14, 21]]);
|
|
706
645
|
}));
|
|
707
646
|
return _getPods.apply(this, arguments);
|
|
708
647
|
};
|
|
@@ -713,15 +652,15 @@ function _default(context) {
|
|
|
713
652
|
|
|
714
653
|
me = UI.authn.currentUser();
|
|
715
654
|
div = dom.createElement('div');
|
|
716
|
-
|
|
655
|
+
_context7.next = 8;
|
|
717
656
|
return Promise.all([getAddressBooks(), getPods()]);
|
|
718
657
|
|
|
719
658
|
case 8:
|
|
720
|
-
_yield$Promise$all =
|
|
659
|
+
_yield$Promise$all = _context7.sent;
|
|
721
660
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
722
661
|
books = _yield$Promise$all2[0];
|
|
723
662
|
pods = _yield$Promise$all2[1];
|
|
724
|
-
return
|
|
663
|
+
return _context7.abrupt("return", [{
|
|
725
664
|
paneName: 'home',
|
|
726
665
|
label: 'Your stuff',
|
|
727
666
|
icon: UI.icons.iconBase + 'noun_547570.svg'
|
|
@@ -737,10 +676,10 @@ function _default(context) {
|
|
|
737
676
|
|
|
738
677
|
case 13:
|
|
739
678
|
case "end":
|
|
740
|
-
return
|
|
679
|
+
return _context7.stop();
|
|
741
680
|
}
|
|
742
681
|
}
|
|
743
|
-
},
|
|
682
|
+
}, _callee6);
|
|
744
683
|
}));
|
|
745
684
|
return _getDashboardItems.apply(this, arguments);
|
|
746
685
|
}
|
|
@@ -759,68 +698,76 @@ function _default(context) {
|
|
|
759
698
|
}
|
|
760
699
|
|
|
761
700
|
function _showDashboard() {
|
|
762
|
-
_showDashboard = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
701
|
+
_showDashboard = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
|
|
763
702
|
var options,
|
|
764
703
|
dashboardContainer,
|
|
765
704
|
outlineContainer,
|
|
766
|
-
|
|
705
|
+
_tab,
|
|
767
706
|
dashboard,
|
|
707
|
+
tab,
|
|
768
708
|
closeDashboard,
|
|
769
|
-
|
|
770
|
-
|
|
709
|
+
_args7 = arguments;
|
|
710
|
+
|
|
711
|
+
return regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
771
712
|
while (1) {
|
|
772
|
-
switch (
|
|
713
|
+
switch (_context8.prev = _context8.next) {
|
|
773
714
|
case 0:
|
|
774
715
|
closeDashboard = function _closeDashboard() {
|
|
775
716
|
dashboardContainer.style.display = 'none';
|
|
776
717
|
outlineContainer.style.display = 'inherit';
|
|
777
718
|
};
|
|
778
719
|
|
|
779
|
-
options =
|
|
720
|
+
options = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
|
|
780
721
|
dashboardContainer = getDashboardContainer();
|
|
781
722
|
outlineContainer = getOutlineContainer(); // reuse dashboard if already children already is inserted
|
|
782
723
|
|
|
783
724
|
if (!(dashboardContainer.childNodes.length > 0 && options.pane)) {
|
|
784
|
-
|
|
725
|
+
_context8.next = 12;
|
|
785
726
|
break;
|
|
786
727
|
}
|
|
787
728
|
|
|
788
729
|
outlineContainer.style.display = 'none';
|
|
789
730
|
dashboardContainer.style.display = 'inherit';
|
|
790
|
-
|
|
731
|
+
_tab = dashboardContainer.querySelector("[data-global-pane-name=\"".concat(options.pane, "\"]"));
|
|
791
732
|
|
|
792
|
-
if (!
|
|
793
|
-
|
|
733
|
+
if (!_tab) {
|
|
734
|
+
_context8.next = 11;
|
|
794
735
|
break;
|
|
795
736
|
}
|
|
796
737
|
|
|
797
|
-
|
|
798
|
-
|
|
738
|
+
_tab.click();
|
|
739
|
+
|
|
740
|
+
return _context8.abrupt("return");
|
|
799
741
|
|
|
800
742
|
case 11:
|
|
801
743
|
console.warn('Did not find the referred tab in global dashboard, will open first one');
|
|
802
744
|
|
|
803
745
|
case 12:
|
|
804
|
-
|
|
746
|
+
_context8.next = 14;
|
|
805
747
|
return globalAppTabs({
|
|
806
748
|
selectedTab: options.pane,
|
|
807
749
|
onClose: closeDashboard
|
|
808
750
|
});
|
|
809
751
|
|
|
810
752
|
case 14:
|
|
811
|
-
dashboard =
|
|
753
|
+
dashboard = _context8.sent;
|
|
812
754
|
// close the dashboard if user log out
|
|
813
755
|
UI.authn.authSession.onLogout(closeDashboard); // finally - switch to showing dashboard
|
|
814
756
|
|
|
815
757
|
outlineContainer.style.display = 'none';
|
|
816
758
|
dashboardContainer.appendChild(dashboard);
|
|
759
|
+
tab = dashboardContainer.querySelector("[data-global-pane-name=\"".concat(options.pane, "\"]"));
|
|
817
760
|
|
|
818
|
-
|
|
761
|
+
if (tab) {
|
|
762
|
+
tab.click();
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
case 20:
|
|
819
766
|
case "end":
|
|
820
|
-
return
|
|
767
|
+
return _context8.stop();
|
|
821
768
|
}
|
|
822
769
|
}
|
|
823
|
-
},
|
|
770
|
+
}, _callee7);
|
|
824
771
|
}));
|
|
825
772
|
return _showDashboard.apply(this, arguments);
|
|
826
773
|
}
|
|
@@ -851,55 +798,102 @@ function _default(context) {
|
|
|
851
798
|
}();
|
|
852
799
|
}
|
|
853
800
|
|
|
854
|
-
function
|
|
801
|
+
function checkForContainerRepresentation(_x) {
|
|
802
|
+
return _checkForContainerRepresentation.apply(this, arguments);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
function _checkForContainerRepresentation() {
|
|
806
|
+
_checkForContainerRepresentation = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(subject) {
|
|
807
|
+
var response, containerTurtle;
|
|
808
|
+
return regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
809
|
+
while (1) {
|
|
810
|
+
switch (_context9.prev = _context9.next) {
|
|
811
|
+
case 0:
|
|
812
|
+
if (kb.any(subject, ns.ldp('contains'), undefined, subject.doc())) {
|
|
813
|
+
_context9.next = 6;
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
_context9.next = 3;
|
|
818
|
+
return kb.fetcher.webOperation('GET', subject.uri, kb.fetcher.initFetchOptions(subject.uri, {
|
|
819
|
+
headers: {
|
|
820
|
+
accept: 'text/turtle'
|
|
821
|
+
}
|
|
822
|
+
}));
|
|
823
|
+
|
|
824
|
+
case 3:
|
|
825
|
+
response = _context9.sent;
|
|
826
|
+
containerTurtle = response.responseText;
|
|
827
|
+
$rdf.parse(containerTurtle, kb, subject.uri, 'text/turtle');
|
|
828
|
+
|
|
829
|
+
case 6:
|
|
830
|
+
case "end":
|
|
831
|
+
return _context9.stop();
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}, _callee8);
|
|
835
|
+
}));
|
|
836
|
+
return _checkForContainerRepresentation.apply(this, arguments);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
function getRelevantPanes(_x2, _x3) {
|
|
855
840
|
return _getRelevantPanes.apply(this, arguments);
|
|
856
841
|
}
|
|
857
842
|
|
|
858
843
|
function _getRelevantPanes() {
|
|
859
|
-
_getRelevantPanes = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
844
|
+
_getRelevantPanes = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(subject, context) {
|
|
860
845
|
var panes, relevantPanes, filteredPanes, firstRelevantPaneIndex, firstFilteredPaneIndex;
|
|
861
|
-
return regeneratorRuntime.wrap(function
|
|
846
|
+
return regeneratorRuntime.wrap(function _callee9$(_context10) {
|
|
862
847
|
while (1) {
|
|
863
|
-
switch (
|
|
848
|
+
switch (_context10.prev = _context10.next) {
|
|
864
849
|
case 0:
|
|
850
|
+
if (!subject.uri.endsWith('/')) {
|
|
851
|
+
_context10.next = 3;
|
|
852
|
+
break;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
_context10.next = 3;
|
|
856
|
+
return checkForContainerRepresentation(subject);
|
|
857
|
+
|
|
858
|
+
case 3:
|
|
865
859
|
panes = context.session.paneRegistry;
|
|
866
860
|
relevantPanes = panes.list.filter(function (pane) {
|
|
867
861
|
return pane.label(subject, context) && !pane.global;
|
|
868
862
|
});
|
|
869
863
|
|
|
870
864
|
if (!(relevantPanes.length === 0)) {
|
|
871
|
-
|
|
865
|
+
_context10.next = 7;
|
|
872
866
|
break;
|
|
873
867
|
}
|
|
874
868
|
|
|
875
|
-
return
|
|
869
|
+
return _context10.abrupt("return", [panes.byName('internal')]);
|
|
876
870
|
|
|
877
|
-
case
|
|
878
|
-
|
|
871
|
+
case 7:
|
|
872
|
+
_context10.next = 9;
|
|
879
873
|
return UI.authn.filterAvailablePanes(relevantPanes);
|
|
880
874
|
|
|
881
|
-
case
|
|
882
|
-
filteredPanes =
|
|
875
|
+
case 9:
|
|
876
|
+
filteredPanes = _context10.sent;
|
|
883
877
|
|
|
884
878
|
if (!(filteredPanes.length === 0)) {
|
|
885
|
-
|
|
879
|
+
_context10.next = 12;
|
|
886
880
|
break;
|
|
887
881
|
}
|
|
888
882
|
|
|
889
|
-
return
|
|
883
|
+
return _context10.abrupt("return", [relevantPanes[0]]);
|
|
890
884
|
|
|
891
|
-
case
|
|
885
|
+
case 12:
|
|
892
886
|
firstRelevantPaneIndex = panes.list.indexOf(relevantPanes[0]);
|
|
893
887
|
firstFilteredPaneIndex = panes.list.indexOf(filteredPanes[0]); // if the first relevant pane is loaded before the panes available wrt role, we still want to offer the most relevant pane
|
|
894
888
|
|
|
895
|
-
return
|
|
889
|
+
return _context10.abrupt("return", firstRelevantPaneIndex < firstFilteredPaneIndex ? [relevantPanes[0]].concat(filteredPanes) : filteredPanes);
|
|
896
890
|
|
|
897
|
-
case
|
|
891
|
+
case 15:
|
|
898
892
|
case "end":
|
|
899
|
-
return
|
|
893
|
+
return _context10.stop();
|
|
900
894
|
}
|
|
901
895
|
}
|
|
902
|
-
},
|
|
896
|
+
}, _callee9);
|
|
903
897
|
}));
|
|
904
898
|
return _getRelevantPanes.apply(this, arguments);
|
|
905
899
|
}
|
|
@@ -910,7 +904,7 @@ function _default(context) {
|
|
|
910
904
|
}) || relevantPanes[0];
|
|
911
905
|
}
|
|
912
906
|
|
|
913
|
-
function expandedHeaderTR(
|
|
907
|
+
function expandedHeaderTR(_x4, _x5, _x6) {
|
|
914
908
|
return _expandedHeaderTR.apply(this, arguments);
|
|
915
909
|
} // expandedHeaderTR
|
|
916
910
|
// / //////////////////////////////////////////////////////////////////////////
|
|
@@ -937,50 +931,50 @@ function _default(context) {
|
|
|
937
931
|
|
|
938
932
|
|
|
939
933
|
function _expandedHeaderTR() {
|
|
940
|
-
_expandedHeaderTR = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
934
|
+
_expandedHeaderTR = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(subject, requiredPane, options) {
|
|
941
935
|
var renderPaneIconTray, _renderPaneIconTray, tr, td, header, showHeader, icon, strong;
|
|
942
936
|
|
|
943
|
-
return regeneratorRuntime.wrap(function
|
|
937
|
+
return regeneratorRuntime.wrap(function _callee11$(_context12) {
|
|
944
938
|
while (1) {
|
|
945
|
-
switch (
|
|
939
|
+
switch (_context12.prev = _context12.next) {
|
|
946
940
|
case 0:
|
|
947
941
|
_renderPaneIconTray = function _renderPaneIconTray3() {
|
|
948
|
-
_renderPaneIconTray = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
942
|
+
_renderPaneIconTray = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(td) {
|
|
949
943
|
var options,
|
|
950
944
|
paneShownStyle,
|
|
951
945
|
paneHiddenStyle,
|
|
952
946
|
paneIconTray,
|
|
953
947
|
relevantPanes,
|
|
954
948
|
paneNumber,
|
|
955
|
-
|
|
956
|
-
return regeneratorRuntime.wrap(function
|
|
949
|
+
_args10 = arguments;
|
|
950
|
+
return regeneratorRuntime.wrap(function _callee10$(_context11) {
|
|
957
951
|
while (1) {
|
|
958
|
-
switch (
|
|
952
|
+
switch (_context11.prev = _context11.next) {
|
|
959
953
|
case 0:
|
|
960
|
-
options =
|
|
954
|
+
options = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {};
|
|
961
955
|
paneShownStyle = 'width: 24px; border-radius: 0.5em; border-top: solid #222 1px; border-left: solid #222 0.1em; border-bottom: solid #eee 0.1em; border-right: solid #eee 0.1em; margin-left: 1em; padding: 3px; background-color: #ffd;';
|
|
962
956
|
paneHiddenStyle = 'width: 24px; border-radius: 0.5em; margin-left: 1em; padding: 3px';
|
|
963
957
|
paneIconTray = td.appendChild(dom.createElement('nav'));
|
|
964
958
|
paneIconTray.style = 'display:flex; justify-content: flex-start; align-items: center;';
|
|
965
959
|
|
|
966
960
|
if (!options.hideList) {
|
|
967
|
-
|
|
961
|
+
_context11.next = 9;
|
|
968
962
|
break;
|
|
969
963
|
}
|
|
970
964
|
|
|
971
|
-
|
|
972
|
-
|
|
965
|
+
_context11.t0 = [];
|
|
966
|
+
_context11.next = 12;
|
|
973
967
|
break;
|
|
974
968
|
|
|
975
969
|
case 9:
|
|
976
|
-
|
|
970
|
+
_context11.next = 11;
|
|
977
971
|
return getRelevantPanes(subject, context);
|
|
978
972
|
|
|
979
973
|
case 11:
|
|
980
|
-
|
|
974
|
+
_context11.t0 = _context11.sent;
|
|
981
975
|
|
|
982
976
|
case 12:
|
|
983
|
-
relevantPanes =
|
|
977
|
+
relevantPanes = _context11.t0;
|
|
984
978
|
tr.firstPane = requiredPane || getPane(relevantPanes, subject);
|
|
985
979
|
paneNumber = relevantPanes.indexOf(tr.firstPane);
|
|
986
980
|
|
|
@@ -1097,19 +1091,19 @@ function _default(context) {
|
|
|
1097
1091
|
});
|
|
1098
1092
|
}
|
|
1099
1093
|
|
|
1100
|
-
return
|
|
1094
|
+
return _context11.abrupt("return", paneIconTray);
|
|
1101
1095
|
|
|
1102
1096
|
case 17:
|
|
1103
1097
|
case "end":
|
|
1104
|
-
return
|
|
1098
|
+
return _context11.stop();
|
|
1105
1099
|
}
|
|
1106
1100
|
}
|
|
1107
|
-
},
|
|
1101
|
+
}, _callee10);
|
|
1108
1102
|
}));
|
|
1109
1103
|
return _renderPaneIconTray.apply(this, arguments);
|
|
1110
1104
|
};
|
|
1111
1105
|
|
|
1112
|
-
renderPaneIconTray = function _renderPaneIconTray2(
|
|
1106
|
+
renderPaneIconTray = function _renderPaneIconTray2(_x9) {
|
|
1113
1107
|
return _renderPaneIconTray.apply(this, arguments);
|
|
1114
1108
|
};
|
|
1115
1109
|
|
|
@@ -1141,16 +1135,16 @@ function _default(context) {
|
|
|
1141
1135
|
UI.widgets.makeDraggable(strong, subject);
|
|
1142
1136
|
}
|
|
1143
1137
|
|
|
1144
|
-
|
|
1145
|
-
|
|
1138
|
+
_context12.t0 = header;
|
|
1139
|
+
_context12.next = 16;
|
|
1146
1140
|
return renderPaneIconTray(td, {
|
|
1147
1141
|
hideList: showHeader
|
|
1148
1142
|
});
|
|
1149
1143
|
|
|
1150
1144
|
case 16:
|
|
1151
|
-
|
|
1145
|
+
_context12.t1 = _context12.sent;
|
|
1152
1146
|
|
|
1153
|
-
|
|
1147
|
+
_context12.t0.appendChild.call(_context12.t0, _context12.t1);
|
|
1154
1148
|
|
|
1155
1149
|
// set DOM methods
|
|
1156
1150
|
tr.firstChild.tabulatorSelect = function () {
|
|
@@ -1161,14 +1155,14 @@ function _default(context) {
|
|
|
1161
1155
|
setSelected(this, false);
|
|
1162
1156
|
};
|
|
1163
1157
|
|
|
1164
|
-
return
|
|
1158
|
+
return _context12.abrupt("return", tr);
|
|
1165
1159
|
|
|
1166
1160
|
case 21:
|
|
1167
1161
|
case "end":
|
|
1168
|
-
return
|
|
1162
|
+
return _context12.stop();
|
|
1169
1163
|
}
|
|
1170
1164
|
}
|
|
1171
|
-
},
|
|
1165
|
+
}, _callee11);
|
|
1172
1166
|
}));
|
|
1173
1167
|
return _expandedHeaderTR.apply(this, arguments);
|
|
1174
1168
|
}
|