solid-ui 2.4.26-029ae1f9 → 2.4.26-068520ea
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/main.js +315 -251
- package/dist/main.js.map +1 -1
- package/lib/chat/chatLogic.js +60 -37
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/infinite.js +177 -176
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/messageTools.js +71 -35
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/preferences.js +4 -0
- package/lib/preferences.js.map +1 -1
- package/lib/versionInfo.js +5 -5
- package/lib/versionInfo.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -2815,54 +2815,59 @@ var ChatChannel = /*#__PURE__*/function () {
|
|
|
2815
2815
|
return ChatChannel;
|
|
2816
2816
|
}(); // class ChatChannel
|
|
2817
2817
|
// ////////// Utility functions
|
|
2818
|
+
// Have to not loop forever if fed loops
|
|
2818
2819
|
exports.ChatChannel = ChatChannel;
|
|
2819
2820
|
function allVersions(_x5) {
|
|
2820
2821
|
return _allVersions.apply(this, arguments);
|
|
2821
2822
|
}
|
|
2822
2823
|
function _allVersions() {
|
|
2823
2824
|
_allVersions = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(message) {
|
|
2824
|
-
var versions, m, prev, next;
|
|
2825
|
+
var versions, done, m, prev, next;
|
|
2825
2826
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
2826
2827
|
while (1) switch (_context5.prev = _context5.next) {
|
|
2827
2828
|
case 0:
|
|
2828
2829
|
versions = [message];
|
|
2830
|
+
done = {};
|
|
2831
|
+
done[message.ur] = true;
|
|
2829
2832
|
m = message;
|
|
2830
|
-
case
|
|
2833
|
+
case 4:
|
|
2831
2834
|
if (false) {}
|
|
2832
2835
|
// earlier?
|
|
2833
2836
|
prev = _solidLogic.store.any(null, ns.dct('isReplacedBy'), m, m.doc());
|
|
2834
|
-
if (prev) {
|
|
2835
|
-
_context5.next =
|
|
2837
|
+
if (!(!prev || done[prev.uri])) {
|
|
2838
|
+
_context5.next = 8;
|
|
2836
2839
|
break;
|
|
2837
2840
|
}
|
|
2838
|
-
return _context5.abrupt("break",
|
|
2839
|
-
case 6:
|
|
2840
|
-
_context5.next = 8;
|
|
2841
|
-
return _solidLogic.store.fetcher.load(prev);
|
|
2841
|
+
return _context5.abrupt("break", 15);
|
|
2842
2842
|
case 8:
|
|
2843
|
+
_context5.next = 10;
|
|
2844
|
+
return _solidLogic.store.fetcher.load(prev);
|
|
2845
|
+
case 10:
|
|
2843
2846
|
versions.unshift(prev);
|
|
2847
|
+
done[prev.uri] = true;
|
|
2844
2848
|
m = prev;
|
|
2845
|
-
_context5.next =
|
|
2849
|
+
_context5.next = 4;
|
|
2846
2850
|
break;
|
|
2847
|
-
case
|
|
2851
|
+
case 15:
|
|
2848
2852
|
m = message;
|
|
2849
|
-
case
|
|
2853
|
+
case 16:
|
|
2850
2854
|
if (false) {}
|
|
2851
2855
|
// later?
|
|
2852
2856
|
next = _solidLogic.store.any(m, ns.dct('isReplacedBy'), null, m.doc());
|
|
2853
|
-
if (next) {
|
|
2854
|
-
_context5.next =
|
|
2857
|
+
if (!(!next || done[next.uri])) {
|
|
2858
|
+
_context5.next = 20;
|
|
2855
2859
|
break;
|
|
2856
2860
|
}
|
|
2857
|
-
return _context5.abrupt("break",
|
|
2858
|
-
case
|
|
2861
|
+
return _context5.abrupt("break", 25);
|
|
2862
|
+
case 20:
|
|
2859
2863
|
versions.push(next);
|
|
2864
|
+
done[next.uri] = true;
|
|
2860
2865
|
m = next;
|
|
2861
|
-
_context5.next =
|
|
2866
|
+
_context5.next = 16;
|
|
2862
2867
|
break;
|
|
2863
|
-
case
|
|
2868
|
+
case 25:
|
|
2864
2869
|
return _context5.abrupt("return", versions);
|
|
2865
|
-
case
|
|
2870
|
+
case 26:
|
|
2866
2871
|
case "end":
|
|
2867
2872
|
return _context5.stop();
|
|
2868
2873
|
}
|
|
@@ -2875,26 +2880,35 @@ function originalVersion(_x6) {
|
|
|
2875
2880
|
}
|
|
2876
2881
|
function _originalVersion() {
|
|
2877
2882
|
_originalVersion = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(message) {
|
|
2878
|
-
var msg;
|
|
2883
|
+
var msg, done;
|
|
2879
2884
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
2880
2885
|
while (1) switch (_context6.prev = _context6.next) {
|
|
2881
2886
|
case 0:
|
|
2882
2887
|
msg = message;
|
|
2883
|
-
|
|
2888
|
+
done = {}; // done[message.ur] = true
|
|
2889
|
+
case 2:
|
|
2884
2890
|
if (!msg) {
|
|
2885
|
-
_context6.next =
|
|
2891
|
+
_context6.next = 13;
|
|
2886
2892
|
break;
|
|
2887
2893
|
}
|
|
2894
|
+
if (!done[msg.uri]) {
|
|
2895
|
+
_context6.next = 6;
|
|
2896
|
+
break;
|
|
2897
|
+
}
|
|
2898
|
+
debug.error('originalVersion: verion loop' + message);
|
|
2899
|
+
return _context6.abrupt("return", message);
|
|
2900
|
+
case 6:
|
|
2901
|
+
done[msg.uri] = true;
|
|
2888
2902
|
message = msg;
|
|
2889
|
-
_context6.next =
|
|
2903
|
+
_context6.next = 10;
|
|
2890
2904
|
return _solidLogic.store.fetcher.load(message);
|
|
2891
|
-
case
|
|
2892
|
-
msg = _solidLogic.store.any(null, ns.dct('isReplacedBy'), message, message.doc());
|
|
2893
|
-
_context6.next =
|
|
2905
|
+
case 10:
|
|
2906
|
+
msg = _solidLogic.store.any(null, ns.dct('isReplacedBy'), message, message.doc());
|
|
2907
|
+
_context6.next = 2;
|
|
2894
2908
|
break;
|
|
2895
|
-
case
|
|
2909
|
+
case 13:
|
|
2896
2910
|
return _context6.abrupt("return", message);
|
|
2897
|
-
case
|
|
2911
|
+
case 14:
|
|
2898
2912
|
case "end":
|
|
2899
2913
|
return _context6.stop();
|
|
2900
2914
|
}
|
|
@@ -2907,26 +2921,35 @@ function mostRecentVersion(_x7) {
|
|
|
2907
2921
|
}
|
|
2908
2922
|
function _mostRecentVersion() {
|
|
2909
2923
|
_mostRecentVersion = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(message) {
|
|
2910
|
-
var msg;
|
|
2924
|
+
var msg, done;
|
|
2911
2925
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
2912
2926
|
while (1) switch (_context7.prev = _context7.next) {
|
|
2913
2927
|
case 0:
|
|
2914
2928
|
msg = message;
|
|
2915
|
-
|
|
2929
|
+
done = {};
|
|
2930
|
+
case 2:
|
|
2916
2931
|
if (!msg) {
|
|
2917
|
-
_context7.next =
|
|
2932
|
+
_context7.next = 13;
|
|
2918
2933
|
break;
|
|
2919
2934
|
}
|
|
2935
|
+
if (!done[msg.uri]) {
|
|
2936
|
+
_context7.next = 6;
|
|
2937
|
+
break;
|
|
2938
|
+
}
|
|
2939
|
+
debug.error('mostRecentVersion: verion loop' + message);
|
|
2940
|
+
return _context7.abrupt("return", message);
|
|
2941
|
+
case 6:
|
|
2942
|
+
done[msg.uri] = true;
|
|
2920
2943
|
message = msg;
|
|
2921
|
-
_context7.next =
|
|
2944
|
+
_context7.next = 10;
|
|
2922
2945
|
return _solidLogic.store.fetcher.load(message);
|
|
2923
|
-
case
|
|
2946
|
+
case 10:
|
|
2924
2947
|
msg = _solidLogic.store.any(message, ns.dct('isReplacedBy'), null, message.doc());
|
|
2925
|
-
_context7.next =
|
|
2948
|
+
_context7.next = 2;
|
|
2926
2949
|
break;
|
|
2927
|
-
case
|
|
2950
|
+
case 13:
|
|
2928
2951
|
return _context7.abrupt("return", message);
|
|
2929
|
-
case
|
|
2952
|
+
case 14:
|
|
2930
2953
|
case "end":
|
|
2931
2954
|
return _context7.stop();
|
|
2932
2955
|
}
|
|
@@ -3493,16 +3516,16 @@ function infiniteMessageArea(_x7, _x8, _x9, _x10) {
|
|
|
3493
3516
|
return _infiniteMessageArea.apply(this, arguments);
|
|
3494
3517
|
}
|
|
3495
3518
|
function _infiniteMessageArea() {
|
|
3496
|
-
_infiniteMessageArea = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3497
|
-
var syncMessages, _syncMessages, addMessage, _addMessage, insertPreviousMessages, _insertPreviousMessages, removePreviousMessages, createMessageTable, _createMessageTable, renderMessageTable, _renderMessageTable, addNewChatDocumentIfNewDay, _addNewChatDocumentIfNewDay, appendCurrentMessages, _appendCurrentMessages, loadMoreWhereNeeded, _loadMoreWhereNeeded, loadInitialContent, _loadInitialContent, newestFirst, channelObject, dateFolder, div, statusArea, userContext, liveMessageTable, earliest, latest, lock;
|
|
3498
|
-
return _regenerator["default"].wrap(function
|
|
3499
|
-
while (1) switch (
|
|
3519
|
+
_infiniteMessageArea = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(dom, wasStore, chatChannel, options) {
|
|
3520
|
+
var syncMessages, _syncMessages, addMessage, _addMessage, insertPreviousMessages, _insertPreviousMessages, removePreviousMessages, createMessageTable, _createMessageTable, renderMessageTable, _renderMessageTable, addNewChatDocumentIfNewDay, _addNewChatDocumentIfNewDay, appendCurrentMessages, _appendCurrentMessages, loadMoreWhereNeeded, _loadMoreWhereNeeded, loadInitialContent, _loadInitialContent, newestFirst, channelObject, dateFolder, div, statusArea, userContext, liveMessageTable, threadRootMessage, earliest, latest, thread, threadTime, lock;
|
|
3521
|
+
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
|
3522
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
3500
3523
|
case 0:
|
|
3501
3524
|
_loadInitialContent = function _loadInitialContent3() {
|
|
3502
|
-
_loadInitialContent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3503
|
-
var yank, fixScroll, live, selectedDocument, now, todayDocument, selectedMessageTable, selectedDate;
|
|
3504
|
-
return _regenerator["default"].wrap(function
|
|
3505
|
-
while (1) switch (
|
|
3525
|
+
_loadInitialContent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14() {
|
|
3526
|
+
var yank, fixScroll, live, selectedDocument, threadRootDocument, initialDocment, now, todayDocument, selectedMessageTable, selectedDate;
|
|
3527
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
|
3528
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
3506
3529
|
case 0:
|
|
3507
3530
|
fixScroll = function _fixScroll() {
|
|
3508
3531
|
if (options.selectedElement) {
|
|
@@ -3516,51 +3539,59 @@ function _infiniteMessageArea() {
|
|
|
3516
3539
|
}
|
|
3517
3540
|
};
|
|
3518
3541
|
yank = function _yank() {
|
|
3519
|
-
selectedMessageTable.selectedElement
|
|
3520
|
-
|
|
3521
|
-
|
|
3542
|
+
if (selectedMessageTable && selectedMessageTable.selectedElement) {
|
|
3543
|
+
selectedMessageTable.selectedElement.scrollIntoView({
|
|
3544
|
+
block: 'center'
|
|
3545
|
+
});
|
|
3546
|
+
}
|
|
3522
3547
|
};
|
|
3523
3548
|
if (options.selectedMessage) {
|
|
3524
3549
|
selectedDocument = options.selectedMessage.doc();
|
|
3550
|
+
}
|
|
3551
|
+
if (threadRootMessage) {
|
|
3552
|
+
threadRootDocument = threadRootMessage.doc();
|
|
3553
|
+
}
|
|
3554
|
+
initialDocment = selectedDocument || threadRootDocument;
|
|
3555
|
+
if (initialDocment) {
|
|
3525
3556
|
now = new Date();
|
|
3526
3557
|
todayDocument = dateFolder.leafDocumentFromDate(now);
|
|
3527
|
-
live = todayDocument.sameTerm(
|
|
3558
|
+
live = todayDocument.sameTerm(initialDocment);
|
|
3528
3559
|
}
|
|
3529
|
-
if (!(
|
|
3530
|
-
|
|
3560
|
+
if (!(initialDocment && !live)) {
|
|
3561
|
+
_context14.next = 18;
|
|
3531
3562
|
break;
|
|
3532
3563
|
}
|
|
3533
|
-
selectedDate = dateFolder.dateFromLeafDocument(
|
|
3534
|
-
|
|
3564
|
+
selectedDate = dateFolder.dateFromLeafDocument(initialDocment);
|
|
3565
|
+
_context14.next = 10;
|
|
3535
3566
|
return createMessageTable(selectedDate, live);
|
|
3536
|
-
case
|
|
3537
|
-
selectedMessageTable =
|
|
3567
|
+
case 10:
|
|
3568
|
+
selectedMessageTable = _context14.sent;
|
|
3538
3569
|
div.appendChild(selectedMessageTable);
|
|
3539
3570
|
earliest.messageTable = selectedMessageTable;
|
|
3540
3571
|
latest.messageTable = selectedMessageTable;
|
|
3541
3572
|
yank();
|
|
3542
3573
|
setTimeout(yank, 1000); // @@ kludge - restore position distubed by other cHANGES
|
|
3543
|
-
|
|
3574
|
+
_context14.next = 22;
|
|
3544
3575
|
break;
|
|
3545
|
-
case
|
|
3546
|
-
|
|
3576
|
+
case 18:
|
|
3577
|
+
_context14.next = 20;
|
|
3547
3578
|
return appendCurrentMessages();
|
|
3548
|
-
case
|
|
3579
|
+
case 20:
|
|
3549
3580
|
earliest.messageTable = liveMessageTable;
|
|
3550
3581
|
latest.messageTable = liveMessageTable;
|
|
3551
|
-
case
|
|
3552
|
-
|
|
3582
|
+
case 22:
|
|
3583
|
+
_context14.next = 24;
|
|
3553
3584
|
return loadMoreWhereNeeded(null, fixScroll);
|
|
3554
|
-
case
|
|
3585
|
+
case 24:
|
|
3555
3586
|
div.addEventListener('scroll', loadMoreWhereNeeded);
|
|
3556
3587
|
if (options.solo) {
|
|
3557
3588
|
document.body.addEventListener('scroll', loadMoreWhereNeeded);
|
|
3558
3589
|
}
|
|
3559
|
-
case
|
|
3590
|
+
case 26:
|
|
3560
3591
|
case "end":
|
|
3561
|
-
return
|
|
3592
|
+
return _context14.stop();
|
|
3562
3593
|
}
|
|
3563
|
-
},
|
|
3594
|
+
}, _callee14);
|
|
3564
3595
|
}));
|
|
3565
3596
|
return _loadInitialContent.apply(this, arguments);
|
|
3566
3597
|
};
|
|
@@ -3568,16 +3599,16 @@ function _infiniteMessageArea() {
|
|
|
3568
3599
|
return _loadInitialContent.apply(this, arguments);
|
|
3569
3600
|
};
|
|
3570
3601
|
_loadMoreWhereNeeded = function _loadMoreWhereNeeded3() {
|
|
3571
|
-
_loadMoreWhereNeeded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3602
|
+
_loadMoreWhereNeeded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(event, fixScroll) {
|
|
3572
3603
|
var freeze, magicZone, done, scrollBottom, scrollTop;
|
|
3573
|
-
return _regenerator["default"].wrap(function
|
|
3574
|
-
while (1) switch (
|
|
3604
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
3605
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
3575
3606
|
case 0:
|
|
3576
3607
|
if (!lock) {
|
|
3577
|
-
|
|
3608
|
+
_context13.next = 2;
|
|
3578
3609
|
break;
|
|
3579
3610
|
}
|
|
3580
|
-
return
|
|
3611
|
+
return _context13.abrupt("return");
|
|
3581
3612
|
case 2:
|
|
3582
3613
|
lock = true;
|
|
3583
3614
|
freeze = !fixScroll;
|
|
@@ -3585,36 +3616,36 @@ function _infiniteMessageArea() {
|
|
|
3585
3616
|
// const bottom = div.scrollHeight - top - div.clientHeight
|
|
3586
3617
|
case 5:
|
|
3587
3618
|
if (!(div.scrollTop < magicZone && earliest.messageTable && !earliest.messageTable.initial && earliest.messageTable.extendBackwards)) {
|
|
3588
|
-
|
|
3619
|
+
_context13.next = 21;
|
|
3589
3620
|
break;
|
|
3590
3621
|
}
|
|
3591
3622
|
if (!(div.scrollHeight === 0)) {
|
|
3592
|
-
|
|
3623
|
+
_context13.next = 10;
|
|
3593
3624
|
break;
|
|
3594
3625
|
}
|
|
3595
3626
|
// debug.log(' chat/loadMoreWhereNeeded: trying later...')
|
|
3596
3627
|
setTimeout(loadMoreWhereNeeded, 2000); // couple be less
|
|
3597
3628
|
lock = false;
|
|
3598
|
-
return
|
|
3629
|
+
return _context13.abrupt("return");
|
|
3599
3630
|
case 10:
|
|
3600
3631
|
// debug.log(' chat/loadMoreWhereNeeded: Going now')
|
|
3601
3632
|
scrollBottom = div.scrollHeight - div.scrollTop;
|
|
3602
3633
|
debug.log('infinite scroll: adding above: top ' + div.scrollTop);
|
|
3603
|
-
|
|
3634
|
+
_context13.next = 14;
|
|
3604
3635
|
return earliest.messageTable.extendBackwards();
|
|
3605
3636
|
case 14:
|
|
3606
|
-
done =
|
|
3637
|
+
done = _context13.sent;
|
|
3607
3638
|
if (freeze) {
|
|
3608
3639
|
div.scrollTop = div.scrollHeight - scrollBottom;
|
|
3609
3640
|
}
|
|
3610
3641
|
if (fixScroll) fixScroll();
|
|
3611
3642
|
if (!done) {
|
|
3612
|
-
|
|
3643
|
+
_context13.next = 19;
|
|
3613
3644
|
break;
|
|
3614
3645
|
}
|
|
3615
|
-
return
|
|
3646
|
+
return _context13.abrupt("break", 21);
|
|
3616
3647
|
case 19:
|
|
3617
|
-
|
|
3648
|
+
_context13.next = 5;
|
|
3618
3649
|
break;
|
|
3619
3650
|
case 21:
|
|
3620
3651
|
if (!(options.selectedMessage &&
|
|
@@ -3624,15 +3655,15 @@ function _infiniteMessageArea() {
|
|
|
3624
3655
|
latest.messageTable && !latest.messageTable["final"] &&
|
|
3625
3656
|
// there is more data to come
|
|
3626
3657
|
latest.messageTable.extendForwards)) {
|
|
3627
|
-
|
|
3658
|
+
_context13.next = 33;
|
|
3628
3659
|
break;
|
|
3629
3660
|
}
|
|
3630
3661
|
scrollTop = div.scrollTop;
|
|
3631
3662
|
debug.log('infinite scroll: adding below: bottom: ' + (div.scrollHeight - div.scrollTop - div.clientHeight));
|
|
3632
|
-
|
|
3663
|
+
_context13.next = 26;
|
|
3633
3664
|
return latest.messageTable.extendForwards();
|
|
3634
3665
|
case 26:
|
|
3635
|
-
done =
|
|
3666
|
+
done = _context13.sent;
|
|
3636
3667
|
// then add more data on the bottom
|
|
3637
3668
|
if (freeze) {
|
|
3638
3669
|
div.scrollTop = scrollTop; // while adding below keep same things in view
|
|
@@ -3640,20 +3671,20 @@ function _infiniteMessageArea() {
|
|
|
3640
3671
|
|
|
3641
3672
|
if (fixScroll) fixScroll();
|
|
3642
3673
|
if (!done) {
|
|
3643
|
-
|
|
3674
|
+
_context13.next = 31;
|
|
3644
3675
|
break;
|
|
3645
3676
|
}
|
|
3646
|
-
return
|
|
3677
|
+
return _context13.abrupt("break", 33);
|
|
3647
3678
|
case 31:
|
|
3648
|
-
|
|
3679
|
+
_context13.next = 21;
|
|
3649
3680
|
break;
|
|
3650
3681
|
case 33:
|
|
3651
3682
|
lock = false;
|
|
3652
3683
|
case 34:
|
|
3653
3684
|
case "end":
|
|
3654
|
-
return
|
|
3685
|
+
return _context13.stop();
|
|
3655
3686
|
}
|
|
3656
|
-
},
|
|
3687
|
+
}, _callee13);
|
|
3657
3688
|
}));
|
|
3658
3689
|
return _loadMoreWhereNeeded.apply(this, arguments);
|
|
3659
3690
|
};
|
|
@@ -3661,45 +3692,45 @@ function _infiniteMessageArea() {
|
|
|
3661
3692
|
return _loadMoreWhereNeeded.apply(this, arguments);
|
|
3662
3693
|
};
|
|
3663
3694
|
_appendCurrentMessages = function _appendCurrentMessage2() {
|
|
3664
|
-
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3695
|
+
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {
|
|
3665
3696
|
var now, chatDocument, messageTable;
|
|
3666
|
-
return _regenerator["default"].wrap(function
|
|
3667
|
-
while (1) switch (
|
|
3697
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
3698
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
3668
3699
|
case 0:
|
|
3669
3700
|
now = new Date();
|
|
3670
3701
|
chatDocument = dateFolder.leafDocumentFromDate(now); /// ///////////////////////////////////////////////////////////
|
|
3671
|
-
|
|
3702
|
+
_context12.next = 4;
|
|
3672
3703
|
return createMessageTable(now, true);
|
|
3673
3704
|
case 4:
|
|
3674
|
-
messageTable =
|
|
3705
|
+
messageTable = _context12.sent;
|
|
3675
3706
|
div.appendChild(messageTable);
|
|
3676
|
-
div.refresh = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3677
|
-
return _regenerator["default"].wrap(function
|
|
3678
|
-
while (1) switch (
|
|
3707
|
+
div.refresh = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
|
|
3708
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
3709
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
3679
3710
|
case 0:
|
|
3680
|
-
|
|
3711
|
+
_context11.next = 2;
|
|
3681
3712
|
return addNewChatDocumentIfNewDay(new Date());
|
|
3682
3713
|
case 2:
|
|
3683
|
-
|
|
3714
|
+
_context11.next = 4;
|
|
3684
3715
|
return syncMessages(chatChannel, messageTable);
|
|
3685
3716
|
case 4:
|
|
3686
3717
|
// @@ livemessagetable??
|
|
3687
3718
|
desktopNotification(chatChannel);
|
|
3688
3719
|
case 5:
|
|
3689
3720
|
case "end":
|
|
3690
|
-
return
|
|
3721
|
+
return _context11.stop();
|
|
3691
3722
|
}
|
|
3692
|
-
},
|
|
3723
|
+
}, _callee11);
|
|
3693
3724
|
})); // The short chat version the live update listening is done in the pane but we do it in the widget @@
|
|
3694
3725
|
_solidLogic.store.updater.addDownstreamChangeListener(chatDocument, div.refresh); // Live update
|
|
3695
3726
|
liveMessageTable = messageTable;
|
|
3696
3727
|
latest.messageTable = liveMessageTable;
|
|
3697
|
-
return
|
|
3728
|
+
return _context12.abrupt("return", messageTable);
|
|
3698
3729
|
case 11:
|
|
3699
3730
|
case "end":
|
|
3700
|
-
return
|
|
3731
|
+
return _context12.stop();
|
|
3701
3732
|
}
|
|
3702
|
-
},
|
|
3733
|
+
}, _callee12);
|
|
3703
3734
|
}));
|
|
3704
3735
|
return _appendCurrentMessages.apply(this, arguments);
|
|
3705
3736
|
};
|
|
@@ -3707,15 +3738,15 @@ function _infiniteMessageArea() {
|
|
|
3707
3738
|
return _appendCurrentMessages.apply(this, arguments);
|
|
3708
3739
|
};
|
|
3709
3740
|
_addNewChatDocumentIfNewDay = function _addNewChatDocumentIf2() {
|
|
3710
|
-
_addNewChatDocumentIfNewDay = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3741
|
+
_addNewChatDocumentIfNewDay = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
|
|
3711
3742
|
var newChatDocument, oldChatDocument, sts;
|
|
3712
|
-
return _regenerator["default"].wrap(function
|
|
3713
|
-
while (1) switch (
|
|
3743
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
3744
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
3714
3745
|
case 0:
|
|
3715
3746
|
// @@ Remove listener from previous table as it is now static
|
|
3716
3747
|
newChatDocument = dateFolder.leafDocumentFromDate(new Date());
|
|
3717
3748
|
if (newChatDocument.sameTerm(latest.messageTable.chatDocument)) {
|
|
3718
|
-
|
|
3749
|
+
_context10.next = 7;
|
|
3719
3750
|
break;
|
|
3720
3751
|
}
|
|
3721
3752
|
// It is a new day
|
|
@@ -3724,7 +3755,7 @@ function _infiniteMessageArea() {
|
|
|
3724
3755
|
delete liveMessageTable.inputRow;
|
|
3725
3756
|
}
|
|
3726
3757
|
oldChatDocument = latest.messageTable.chatDocument;
|
|
3727
|
-
|
|
3758
|
+
_context10.next = 6;
|
|
3728
3759
|
return appendCurrentMessages();
|
|
3729
3760
|
case 6:
|
|
3730
3761
|
// Adding a link in the document will ping listeners to add the new block too
|
|
@@ -3738,9 +3769,9 @@ function _infiniteMessageArea() {
|
|
|
3738
3769
|
}
|
|
3739
3770
|
case 7:
|
|
3740
3771
|
case "end":
|
|
3741
|
-
return
|
|
3772
|
+
return _context10.stop();
|
|
3742
3773
|
}
|
|
3743
|
-
},
|
|
3774
|
+
}, _callee10);
|
|
3744
3775
|
}));
|
|
3745
3776
|
return _addNewChatDocumentIfNewDay.apply(this, arguments);
|
|
3746
3777
|
};
|
|
@@ -3748,40 +3779,40 @@ function _infiniteMessageArea() {
|
|
|
3748
3779
|
return _addNewChatDocumentIfNewDay.apply(this, arguments);
|
|
3749
3780
|
};
|
|
3750
3781
|
_renderMessageTable = function _renderMessageTable3() {
|
|
3751
|
-
_renderMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3752
|
-
var scrollBackbutton, scrollForwardButton, extendBackwards, _extendBackwards, setScrollBackbuttonIcon,
|
|
3753
|
-
return _regenerator["default"].wrap(function
|
|
3754
|
-
while (1) switch (
|
|
3782
|
+
_renderMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(date, live) {
|
|
3783
|
+
var scrollBackbutton, scrollForwardButton, extendBackwards, _extendBackwards, setScrollBackbuttonIcon, extendForwards, _extendForwards, setScrollForwardButtonIcon, scrollForwardButtonHandler, _scrollForwardButtonHandler, messageTable, chatDocument, tr, test, titleTR, scrollBackbuttonCell, dateCell, scrollForwardButtonCell, sts, _iterator2, _step2, st;
|
|
3784
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
3785
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
3755
3786
|
case 0:
|
|
3756
3787
|
_scrollForwardButtonHandler = function _scrollForwardButtonH2() {
|
|
3757
|
-
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3758
|
-
return _regenerator["default"].wrap(function
|
|
3759
|
-
while (1) switch (
|
|
3788
|
+
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(_event) {
|
|
3789
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
3790
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
3760
3791
|
case 0:
|
|
3761
3792
|
if (!messageTable.extendedForwards) {
|
|
3762
|
-
|
|
3793
|
+
_context8.next = 6;
|
|
3763
3794
|
break;
|
|
3764
3795
|
}
|
|
3765
3796
|
removePreviousMessages(false, messageTable);
|
|
3766
3797
|
messageTable.extendedForwards = false;
|
|
3767
3798
|
setScrollForwardButtonIcon();
|
|
3768
|
-
|
|
3799
|
+
_context8.next = 9;
|
|
3769
3800
|
break;
|
|
3770
3801
|
case 6:
|
|
3771
|
-
|
|
3802
|
+
_context8.next = 8;
|
|
3772
3803
|
return extendForwards();
|
|
3773
3804
|
case 8:
|
|
3774
3805
|
// async
|
|
3775
3806
|
latest.messageTable.scrollIntoView(newestFirst);
|
|
3776
3807
|
case 9:
|
|
3777
3808
|
case "end":
|
|
3778
|
-
return
|
|
3809
|
+
return _context8.stop();
|
|
3779
3810
|
}
|
|
3780
|
-
},
|
|
3811
|
+
}, _callee8);
|
|
3781
3812
|
}));
|
|
3782
3813
|
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
3783
3814
|
};
|
|
3784
|
-
scrollForwardButtonHandler = function _scrollForwardButtonH(
|
|
3815
|
+
scrollForwardButtonHandler = function _scrollForwardButtonH(_x22) {
|
|
3785
3816
|
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
3786
3817
|
};
|
|
3787
3818
|
setScrollForwardButtonIcon = function _setScrollForwardButt() {
|
|
@@ -3794,55 +3825,27 @@ function _infiniteMessageArea() {
|
|
|
3794
3825
|
}
|
|
3795
3826
|
};
|
|
3796
3827
|
_extendForwards = function _extendForwards3() {
|
|
3797
|
-
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3828
|
+
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
3798
3829
|
var done;
|
|
3799
|
-
return _regenerator["default"].wrap(function
|
|
3800
|
-
while (1) switch (
|
|
3830
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
3831
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
3801
3832
|
case 0:
|
|
3802
|
-
|
|
3833
|
+
_context7.next = 2;
|
|
3803
3834
|
return insertPreviousMessages(false);
|
|
3804
3835
|
case 2:
|
|
3805
|
-
done =
|
|
3806
|
-
return
|
|
3836
|
+
done = _context7.sent;
|
|
3837
|
+
return _context7.abrupt("return", done);
|
|
3807
3838
|
case 4:
|
|
3808
3839
|
case "end":
|
|
3809
|
-
return
|
|
3840
|
+
return _context7.stop();
|
|
3810
3841
|
}
|
|
3811
|
-
},
|
|
3842
|
+
}, _callee7);
|
|
3812
3843
|
}));
|
|
3813
3844
|
return _extendForwards.apply(this, arguments);
|
|
3814
3845
|
};
|
|
3815
3846
|
extendForwards = function _extendForwards2() {
|
|
3816
3847
|
return _extendForwards.apply(this, arguments);
|
|
3817
3848
|
};
|
|
3818
|
-
_scrollBackbuttonHandler = function _scrollBackbuttonHand2() {
|
|
3819
|
-
_scrollBackbuttonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(_event) {
|
|
3820
|
-
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
3821
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
3822
|
-
case 0:
|
|
3823
|
-
if (!messageTable.extendedBack) {
|
|
3824
|
-
_context7.next = 6;
|
|
3825
|
-
break;
|
|
3826
|
-
}
|
|
3827
|
-
removePreviousMessages(true, messageTable);
|
|
3828
|
-
messageTable.extendedBack = false;
|
|
3829
|
-
setScrollBackbuttonIcon();
|
|
3830
|
-
_context7.next = 8;
|
|
3831
|
-
break;
|
|
3832
|
-
case 6:
|
|
3833
|
-
_context7.next = 8;
|
|
3834
|
-
return extendBackwards();
|
|
3835
|
-
case 8:
|
|
3836
|
-
case "end":
|
|
3837
|
-
return _context7.stop();
|
|
3838
|
-
}
|
|
3839
|
-
}, _callee7);
|
|
3840
|
-
}));
|
|
3841
|
-
return _scrollBackbuttonHandler.apply(this, arguments);
|
|
3842
|
-
};
|
|
3843
|
-
scrollBackbuttonHandler = function _scrollBackbuttonHand(_x22) {
|
|
3844
|
-
return _scrollBackbuttonHandler.apply(this, arguments);
|
|
3845
|
-
};
|
|
3846
3849
|
setScrollBackbuttonIcon = function _setScrollBackbuttonI() {
|
|
3847
3850
|
if (!scrollBackbutton) {
|
|
3848
3851
|
return;
|
|
@@ -3994,41 +3997,41 @@ function _infiniteMessageArea() {
|
|
|
3994
3997
|
// messageTable.style.visibility = 'collapse' // Hide files with no messages
|
|
3995
3998
|
}
|
|
3996
3999
|
_iterator2 = _createForOfIteratorHelper(sts);
|
|
3997
|
-
|
|
4000
|
+
_context9.prev = 26;
|
|
3998
4001
|
_iterator2.s();
|
|
3999
|
-
case
|
|
4002
|
+
case 28:
|
|
4000
4003
|
if ((_step2 = _iterator2.n()).done) {
|
|
4001
|
-
|
|
4004
|
+
_context9.next = 34;
|
|
4002
4005
|
break;
|
|
4003
4006
|
}
|
|
4004
4007
|
st = _step2.value;
|
|
4005
|
-
|
|
4008
|
+
_context9.next = 32;
|
|
4006
4009
|
return addMessage(st.object, messageTable);
|
|
4010
|
+
case 32:
|
|
4011
|
+
_context9.next = 28;
|
|
4012
|
+
break;
|
|
4007
4013
|
case 34:
|
|
4008
|
-
|
|
4014
|
+
_context9.next = 39;
|
|
4009
4015
|
break;
|
|
4010
4016
|
case 36:
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
_iterator2.e(_context10.t0);
|
|
4017
|
-
case 41:
|
|
4018
|
-
_context10.prev = 41;
|
|
4017
|
+
_context9.prev = 36;
|
|
4018
|
+
_context9.t0 = _context9["catch"](26);
|
|
4019
|
+
_iterator2.e(_context9.t0);
|
|
4020
|
+
case 39:
|
|
4021
|
+
_context9.prev = 39;
|
|
4019
4022
|
_iterator2.f();
|
|
4020
|
-
return
|
|
4021
|
-
case
|
|
4023
|
+
return _context9.finish(39);
|
|
4024
|
+
case 42:
|
|
4022
4025
|
messageTable.fresh = true;
|
|
4023
4026
|
|
|
4024
4027
|
// loadMessageTable(messageTable, chatDocument)
|
|
4025
4028
|
messageTable.fresh = false;
|
|
4026
|
-
return
|
|
4027
|
-
case
|
|
4029
|
+
return _context9.abrupt("return", messageTable);
|
|
4030
|
+
case 45:
|
|
4028
4031
|
case "end":
|
|
4029
|
-
return
|
|
4032
|
+
return _context9.stop();
|
|
4030
4033
|
}
|
|
4031
|
-
},
|
|
4034
|
+
}, _callee9, null, [[26, 36, 39, 42]]);
|
|
4032
4035
|
}));
|
|
4033
4036
|
return _renderMessageTable.apply(this, arguments);
|
|
4034
4037
|
};
|
|
@@ -4107,25 +4110,33 @@ function _infiniteMessageArea() {
|
|
|
4107
4110
|
case 0:
|
|
4108
4111
|
extremity = backwards ? earliest : latest;
|
|
4109
4112
|
date = extremity.messageTable.date; // day in mssecs
|
|
4110
|
-
|
|
4111
|
-
|
|
4113
|
+
// Are we at the top of a thread?
|
|
4114
|
+
if (!(backwards && earliest.limit && date <= earliest.limit)) {
|
|
4115
|
+
_context4.next = 4;
|
|
4116
|
+
break;
|
|
4117
|
+
}
|
|
4118
|
+
return _context4.abrupt("return", true);
|
|
4112
4119
|
case 4:
|
|
4120
|
+
_context4.next = 6;
|
|
4121
|
+
return dateFolder.loadPrevious(date, backwards);
|
|
4122
|
+
case 6:
|
|
4113
4123
|
date = _context4.sent;
|
|
4114
4124
|
// backwards
|
|
4125
|
+
|
|
4115
4126
|
debug.log("insertPreviousMessages: from ".concat(backwards ? 'backwards' : 'forwards', " loadPrevious: ").concat(date));
|
|
4116
4127
|
if (!(!date && !backwards && !liveMessageTable)) {
|
|
4117
|
-
_context4.next =
|
|
4128
|
+
_context4.next = 11;
|
|
4118
4129
|
break;
|
|
4119
4130
|
}
|
|
4120
|
-
_context4.next =
|
|
4131
|
+
_context4.next = 11;
|
|
4121
4132
|
return appendCurrentMessages();
|
|
4122
|
-
case
|
|
4133
|
+
case 11:
|
|
4123
4134
|
if (date) {
|
|
4124
|
-
_context4.next =
|
|
4135
|
+
_context4.next = 13;
|
|
4125
4136
|
break;
|
|
4126
4137
|
}
|
|
4127
4138
|
return _context4.abrupt("return", true);
|
|
4128
|
-
case
|
|
4139
|
+
case 13:
|
|
4129
4140
|
// done
|
|
4130
4141
|
live = false;
|
|
4131
4142
|
if (!backwards) {
|
|
@@ -4133,9 +4144,9 @@ function _infiniteMessageArea() {
|
|
|
4133
4144
|
doc = dateFolder.leafDocumentFromDate(date);
|
|
4134
4145
|
live = doc.sameTerm(todayDoc); // Is this todays?
|
|
4135
4146
|
}
|
|
4136
|
-
_context4.next =
|
|
4147
|
+
_context4.next = 17;
|
|
4137
4148
|
return createMessageTable(date, live);
|
|
4138
|
-
case
|
|
4149
|
+
case 17:
|
|
4139
4150
|
newMessageTable = _context4.sent;
|
|
4140
4151
|
extremity.messageTable = newMessageTable; // move pointer to earliest
|
|
4141
4152
|
if (backwards ? newestFirst : !newestFirst) {
|
|
@@ -4146,7 +4157,7 @@ function _infiniteMessageArea() {
|
|
|
4146
4157
|
div.insertBefore(newMessageTable, div.firstChild);
|
|
4147
4158
|
}
|
|
4148
4159
|
return _context4.abrupt("return", live);
|
|
4149
|
-
case
|
|
4160
|
+
case 21:
|
|
4150
4161
|
case "end":
|
|
4151
4162
|
return _context4.stop();
|
|
4152
4163
|
}
|
|
@@ -4159,64 +4170,66 @@ function _infiniteMessageArea() {
|
|
|
4159
4170
|
};
|
|
4160
4171
|
_addMessage = function _addMessage3() {
|
|
4161
4172
|
_addMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(message, messageTable) {
|
|
4162
|
-
var
|
|
4173
|
+
var thread, id;
|
|
4163
4174
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
4164
4175
|
while (1) switch (_context3.prev = _context3.next) {
|
|
4165
4176
|
case 0:
|
|
4166
|
-
|
|
4167
|
-
|
|
4177
|
+
if (!((0, _chatLogic.isDeleted)(message) && !options.showDeletedMessages)) {
|
|
4178
|
+
_context3.next = 2;
|
|
4179
|
+
break;
|
|
4180
|
+
}
|
|
4181
|
+
return _context3.abrupt("return");
|
|
4168
4182
|
case 2:
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
_context3.next = 5;
|
|
4183
|
+
if (!(0, _chatLogic.isReplaced)(message)) {
|
|
4184
|
+
_context3.next = 4;
|
|
4172
4185
|
break;
|
|
4173
4186
|
}
|
|
4174
4187
|
return _context3.abrupt("return");
|
|
4175
|
-
case
|
|
4188
|
+
case 4:
|
|
4176
4189
|
thread = _solidLogic.store.any(null, ns.sioc('has_member'), message, message.doc());
|
|
4177
4190
|
id = _solidLogic.store.any(message, ns.sioc('id'), null, message.doc());
|
|
4178
4191
|
if (id && !thread) {
|
|
4179
4192
|
thread = _solidLogic.store.any(null, ns.sioc('has_member'), id, message.doc());
|
|
4180
4193
|
}
|
|
4181
4194
|
if (!options.thread) {
|
|
4182
|
-
_context3.next =
|
|
4195
|
+
_context3.next = 20;
|
|
4183
4196
|
break;
|
|
4184
4197
|
}
|
|
4185
4198
|
if (!_solidLogic.store.holds(message, ns.sioc('has_reply'), options.thread)) {
|
|
4186
|
-
_context3.next =
|
|
4199
|
+
_context3.next = 12;
|
|
4187
4200
|
break;
|
|
4188
4201
|
}
|
|
4189
4202
|
// root of thread
|
|
4190
4203
|
debug.log(' addMessage: displaying root of thread ' + thread);
|
|
4191
|
-
_context3.next =
|
|
4204
|
+
_context3.next = 18;
|
|
4192
4205
|
break;
|
|
4193
|
-
case
|
|
4206
|
+
case 12:
|
|
4194
4207
|
if (!(thread && thread.sameTerm(options.thread))) {
|
|
4195
|
-
_context3.next =
|
|
4208
|
+
_context3.next = 16;
|
|
4196
4209
|
break;
|
|
4197
4210
|
}
|
|
4198
4211
|
debug.log(' addMessage: Displaying body of thread ' + message.uri.slice(-10));
|
|
4199
|
-
_context3.next =
|
|
4212
|
+
_context3.next = 18;
|
|
4200
4213
|
break;
|
|
4201
|
-
case
|
|
4214
|
+
case 16:
|
|
4202
4215
|
debug.log(' addMessage: Suppress non-thread message in thread table ' + message.uri.slice(-10));
|
|
4203
4216
|
return _context3.abrupt("return");
|
|
4204
|
-
case
|
|
4205
|
-
_context3.next =
|
|
4217
|
+
case 18:
|
|
4218
|
+
_context3.next = 26;
|
|
4206
4219
|
break;
|
|
4207
|
-
case
|
|
4220
|
+
case 20:
|
|
4208
4221
|
if (!thread) {
|
|
4209
|
-
_context3.next =
|
|
4222
|
+
_context3.next = 25;
|
|
4210
4223
|
break;
|
|
4211
4224
|
}
|
|
4212
4225
|
debug.log(' addMessage: Suppress thread message in non-thread table ' + message.uri.slice(-10));
|
|
4213
4226
|
return _context3.abrupt("return");
|
|
4214
|
-
case
|
|
4227
|
+
case 25:
|
|
4215
4228
|
debug.log(' addMessage: Normal non-thread message in non-thread table ' + message.uri.slice(-10));
|
|
4216
|
-
case
|
|
4217
|
-
_context3.next =
|
|
4229
|
+
case 26:
|
|
4230
|
+
_context3.next = 28;
|
|
4218
4231
|
return insertMessageIntoTable(channelObject, messageTable, message, messageTable.fresh, options, userContext);
|
|
4219
|
-
case
|
|
4232
|
+
case 28:
|
|
4220
4233
|
case "end":
|
|
4221
4234
|
return _context3.stop();
|
|
4222
4235
|
}
|
|
@@ -4318,16 +4331,27 @@ function _infiniteMessageArea() {
|
|
|
4318
4331
|
latest = {
|
|
4319
4332
|
messageTable: null
|
|
4320
4333
|
};
|
|
4334
|
+
if (options.thread) {
|
|
4335
|
+
thread = options.thread;
|
|
4336
|
+
threadRootMessage = _solidLogic.store.any(null, ns.sioc('has_reply'), thread, thread.doc());
|
|
4337
|
+
if (threadRootMessage) {
|
|
4338
|
+
threadTime = _solidLogic.store.any(threadRootMessage, ns.dct('created'), null, threadRootMessage.doc());
|
|
4339
|
+
if (threadTime) {
|
|
4340
|
+
earliest.limit = new Date(threadTime.value);
|
|
4341
|
+
debug.log(' inifinite: thread start at ' + earliest.limit);
|
|
4342
|
+
}
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4321
4345
|
lock = false;
|
|
4322
|
-
|
|
4346
|
+
_context15.next = 34;
|
|
4323
4347
|
return loadInitialContent();
|
|
4324
|
-
case 33:
|
|
4325
|
-
return _context16.abrupt("return", div);
|
|
4326
4348
|
case 34:
|
|
4349
|
+
return _context15.abrupt("return", div);
|
|
4350
|
+
case 35:
|
|
4327
4351
|
case "end":
|
|
4328
|
-
return
|
|
4352
|
+
return _context15.stop();
|
|
4329
4353
|
}
|
|
4330
|
-
},
|
|
4354
|
+
}, _callee15);
|
|
4331
4355
|
}));
|
|
4332
4356
|
return _infiniteMessageArea.apply(this, arguments);
|
|
4333
4357
|
}
|
|
@@ -5014,6 +5038,9 @@ var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_m
|
|
|
5014
5038
|
Object.defineProperty(exports, "__esModule", ({
|
|
5015
5039
|
value: true
|
|
5016
5040
|
}));
|
|
5041
|
+
exports.ActionClassFromEmoji = ActionClassFromEmoji;
|
|
5042
|
+
exports.emojiFromAction = emojiFromAction;
|
|
5043
|
+
exports.emojiFromActionClass = emojiFromActionClass;
|
|
5017
5044
|
exports.messageToolbar = messageToolbar;
|
|
5018
5045
|
exports.sentimentStrip = sentimentStrip;
|
|
5019
5046
|
exports.sentimentStripLinked = sentimentStripLinked;
|
|
@@ -5064,11 +5091,36 @@ var REPLY_ICON = 'noun-reply-5506924.svg';
|
|
|
5064
5091
|
/**
|
|
5065
5092
|
* Emoji in Unicode
|
|
5066
5093
|
*/
|
|
5067
|
-
var
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5094
|
+
var emojiMap = {};
|
|
5095
|
+
emojiMap[ns.schema('AgreeAction')] = '👍';
|
|
5096
|
+
emojiMap[ns.schema('DisagreeAction')] = '👎';
|
|
5097
|
+
emojiMap[ns.schema('EndorseAction')] = '⭐️';
|
|
5098
|
+
emojiMap[ns.schema('LikeAction')] = '❤️';
|
|
5099
|
+
function emojiFromActionClass(action) {
|
|
5100
|
+
return emojiMap[action] || null;
|
|
5101
|
+
}
|
|
5102
|
+
function ActionClassFromEmoji(emoji) {
|
|
5103
|
+
for (var a in emojiMap) {
|
|
5104
|
+
if (emojiMap[a] === emoji) {
|
|
5105
|
+
return rdf.sym(a.slice(1, -1)); // remove < >
|
|
5106
|
+
}
|
|
5107
|
+
}
|
|
5108
|
+
|
|
5109
|
+
return null;
|
|
5110
|
+
}
|
|
5111
|
+
|
|
5112
|
+
// Allow the qction to give its own emoji as content,
|
|
5113
|
+
// or get the emoji from the class lof action.
|
|
5114
|
+
function emojiFromAction(action) {
|
|
5115
|
+
var content = _solidLogic.store.any(action, ns.sioc('content'), null, action.doc());
|
|
5116
|
+
if (content) return content;
|
|
5117
|
+
var klass = _solidLogic.store.any(action, ns.rdf('type'), null, action.doc());
|
|
5118
|
+
if (klass) {
|
|
5119
|
+
var em = emojiFromActionClass(klass);
|
|
5120
|
+
if (em) return em;
|
|
5121
|
+
}
|
|
5122
|
+
return '⬜️';
|
|
5123
|
+
}
|
|
5072
5124
|
|
|
5073
5125
|
/**
|
|
5074
5126
|
* Create strip of sentiments expressed
|
|
@@ -5084,21 +5136,21 @@ function sentimentStrip(_x, _x2) {
|
|
|
5084
5136
|
*/
|
|
5085
5137
|
function _sentimentStrip() {
|
|
5086
5138
|
_sentimentStrip = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(target, doc) {
|
|
5087
|
-
var
|
|
5139
|
+
var versions, actions, strings;
|
|
5088
5140
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
5089
5141
|
while (1) switch (_context.prev = _context.next) {
|
|
5090
5142
|
case 0:
|
|
5091
5143
|
_context.next = 2;
|
|
5092
|
-
return (0, _chatLogic.
|
|
5144
|
+
return (0, _chatLogic.allVersions)(target);
|
|
5093
5145
|
case 2:
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
return _solidLogic.store.
|
|
5098
|
-
});
|
|
5099
|
-
|
|
5100
|
-
strings =
|
|
5101
|
-
return
|
|
5146
|
+
versions = _context.sent;
|
|
5147
|
+
debug.log('sentimentStrip Versions for ' + target, versions);
|
|
5148
|
+
actions = versions.map(function (version) {
|
|
5149
|
+
return _solidLogic.store.each(null, ns.schema('target'), version, doc);
|
|
5150
|
+
}).flat();
|
|
5151
|
+
debug.log('sentimentStrip: Actions for ' + target, actions);
|
|
5152
|
+
strings = actions.map(function (action) {
|
|
5153
|
+
return emojiFromAction(action) || '';
|
|
5102
5154
|
});
|
|
5103
5155
|
return _context.abrupt("return", dom.createTextNode(strings.join(' ')));
|
|
5104
5156
|
case 8:
|
|
@@ -5123,35 +5175,42 @@ function _sentimentStripLinked() {
|
|
|
5123
5175
|
case 0:
|
|
5124
5176
|
_refresh = function _refresh3() {
|
|
5125
5177
|
_refresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
5126
|
-
var actions, sentiments;
|
|
5178
|
+
var versions, actions, sentiments;
|
|
5127
5179
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
5128
5180
|
while (1) switch (_context2.prev = _context2.next) {
|
|
5129
5181
|
case 0:
|
|
5130
5182
|
strip.innerHTML = '';
|
|
5131
|
-
|
|
5132
|
-
|
|
5183
|
+
if (!(0, _chatLogic.isDeleted)(target)) {
|
|
5184
|
+
_context2.next = 3;
|
|
5185
|
+
break;
|
|
5186
|
+
}
|
|
5187
|
+
return _context2.abrupt("return", strip);
|
|
5133
5188
|
case 3:
|
|
5134
|
-
_context2.
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5189
|
+
_context2.next = 5;
|
|
5190
|
+
return (0, _chatLogic.allVersions)(target);
|
|
5191
|
+
case 5:
|
|
5192
|
+
versions = _context2.sent;
|
|
5193
|
+
debug.log('sentimentStripLinked: Versions for ' + target, versions);
|
|
5194
|
+
actions = versions.map(function (version) {
|
|
5195
|
+
return _solidLogic.store.each(null, ns.schema('target'), version, doc);
|
|
5196
|
+
}).flat();
|
|
5197
|
+
debug.log('sentimentStripLinked: Actions for ' + target, actions);
|
|
5198
|
+
if (!(actions.length === 0)) {
|
|
5199
|
+
_context2.next = 11;
|
|
5138
5200
|
break;
|
|
5139
5201
|
}
|
|
5140
|
-
_context2.
|
|
5141
|
-
|
|
5142
|
-
break;
|
|
5143
|
-
case 9:
|
|
5144
|
-
_context2.t2 = [];
|
|
5145
|
-
case 10:
|
|
5146
|
-
actions = _context2.t2;
|
|
5202
|
+
return _context2.abrupt("return", strip);
|
|
5203
|
+
case 11:
|
|
5147
5204
|
sentiments = actions.map(function (a) {
|
|
5148
|
-
return [_solidLogic.store.any(a, ns.rdf('type'), null, doc), _solidLogic.store.any(a, ns.schema('agent'), null, doc)];
|
|
5205
|
+
return [_solidLogic.store.any(a, ns.rdf('type'), null, doc), _solidLogic.store.any(a, ns.sioc('content'), null, doc), _solidLogic.store.any(a, ns.schema('agent'), null, doc)];
|
|
5149
5206
|
});
|
|
5207
|
+
debug.log(' Actions sentiments ', sentiments);
|
|
5150
5208
|
sentiments.sort();
|
|
5151
5209
|
sentiments.forEach(function (ss) {
|
|
5152
|
-
var _ss = (0, _slicedToArray2["default"])(ss,
|
|
5210
|
+
var _ss = (0, _slicedToArray2["default"])(ss, 3),
|
|
5153
5211
|
theClass = _ss[0],
|
|
5154
|
-
|
|
5212
|
+
content = _ss[1],
|
|
5213
|
+
agent = _ss[2];
|
|
5155
5214
|
var res;
|
|
5156
5215
|
if (agent) {
|
|
5157
5216
|
res = dom.createElement('a');
|
|
@@ -5159,10 +5218,11 @@ function _sentimentStripLinked() {
|
|
|
5159
5218
|
} else {
|
|
5160
5219
|
res = dom.createTextNode('');
|
|
5161
5220
|
}
|
|
5162
|
-
res.textContent =
|
|
5221
|
+
res.textContent = content || emojiMap[theClass] || '⬜️';
|
|
5163
5222
|
strip.appendChild(res);
|
|
5164
5223
|
});
|
|
5165
|
-
|
|
5224
|
+
debug.log(' Actions strip ', strip);
|
|
5225
|
+
case 16:
|
|
5166
5226
|
case "end":
|
|
5167
5227
|
return _context2.stop();
|
|
5168
5228
|
}
|
|
@@ -5174,7 +5234,7 @@ function _sentimentStripLinked() {
|
|
|
5174
5234
|
return _refresh.apply(this, arguments);
|
|
5175
5235
|
};
|
|
5176
5236
|
strip = dom.createElement('span');
|
|
5177
|
-
refresh().then(debug.log('sentimentStripLinked async refreshed'));
|
|
5237
|
+
refresh().then(debug.log('sentimentStripLinked: sentimentStripLinked async refreshed'));
|
|
5178
5238
|
strip.refresh = refresh;
|
|
5179
5239
|
return _context3.abrupt("return", strip);
|
|
5180
5240
|
case 6:
|
|
@@ -10346,6 +10406,10 @@ function recordSharedPreferences(subject, context) {
|
|
|
10346
10406
|
return new Promise(function (resolve, reject) {
|
|
10347
10407
|
var sharedPreferences = kb.any(subject, ns.ui('sharedPreferences'));
|
|
10348
10408
|
if (!sharedPreferences) {
|
|
10409
|
+
if (!kb.updater.editable(subject.doc())) {
|
|
10410
|
+
debug.log(" Cant make shared preferences, may not change ".concat(subject.doc));
|
|
10411
|
+
resolve(context);
|
|
10412
|
+
}
|
|
10349
10413
|
var sp = $rdf.sym(subject.doc().uri + '#SharedPreferences');
|
|
10350
10414
|
var ins = [$rdf.st(subject, ns.ui('sharedPreferences'), sp, subject.doc())];
|
|
10351
10415
|
debug.log('Creating shared preferences ' + sp);
|
|
@@ -13735,17 +13799,17 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
13735
13799
|
}));
|
|
13736
13800
|
exports.versionInfo = void 0;
|
|
13737
13801
|
var versionInfo = {
|
|
13738
|
-
buildTime: '2023-
|
|
13739
|
-
commit: '
|
|
13802
|
+
buildTime: '2023-04-08T06:36:47Z',
|
|
13803
|
+
commit: '068520eaaba7887dcdfeb64ba44cbe253b7de882',
|
|
13740
13804
|
npmInfo: {
|
|
13741
13805
|
'solid-ui': '2.4.26',
|
|
13742
13806
|
npm: '8.19.4',
|
|
13743
|
-
node: '16.
|
|
13744
|
-
v8: '9.4.146.26-node.
|
|
13807
|
+
node: '16.20.0',
|
|
13808
|
+
v8: '9.4.146.26-node.26',
|
|
13745
13809
|
uv: '1.43.0',
|
|
13746
13810
|
zlib: '1.2.11',
|
|
13747
13811
|
brotli: '1.0.9',
|
|
13748
|
-
ares: '1.
|
|
13812
|
+
ares: '1.19.0',
|
|
13749
13813
|
modules: '93',
|
|
13750
13814
|
nghttp2: '1.47.0',
|
|
13751
13815
|
napi: '8',
|