solid-ui 2.4.14-bbf45639-6db2456f → 2.4.14-cc8aeb7b
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/lib/acl/access-groups.d.ts +2 -1
- package/lib/acl/access-groups.d.ts.map +1 -1
- package/lib/acl/access-groups.js +1 -4
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl.d.ts +2 -1
- package/lib/acl/acl.d.ts.map +1 -1
- package/lib/acl/acl.js +2 -6
- package/lib/acl/acl.js.map +1 -1
- package/lib/chat/bookmarks.js +30 -29
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +340 -0
- package/lib/chat/chatLogic.js.map +1 -0
- package/lib/chat/dateFolder.js +12 -12
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +285 -665
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js +445 -71
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +170 -108
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +162 -32
- package/lib/chat/thread.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/logic.d.ts +2 -2
- package/lib/logic.d.ts.map +1 -1
- package/lib/logic.js +16 -12
- package/lib/logic.js.map +1 -1
- package/lib/versionInfo.js +3 -3
- package/lib/versionInfo.js.map +1 -1
- package/lib/webpack-bundle.js +1470 -1136
- package/lib/webpack-bundle.js.map +1 -1
- package/lib/widgets/buttons.d.ts.map +1 -1
- package/lib/widgets/buttons.js +8 -1
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +5 -9
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +1 -3
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +8 -15
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/package.json +5 -5
package/lib/webpack-bundle.js
CHANGED
|
@@ -891,12 +891,9 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
891
891
|
var secondAttempt,
|
|
892
892
|
agent,
|
|
893
893
|
thing,
|
|
894
|
-
_this$_store,
|
|
895
|
-
_this$_store$fetcher,
|
|
896
894
|
message,
|
|
897
895
|
error,
|
|
898
896
|
_args4 = arguments;
|
|
899
|
-
|
|
900
897
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
901
898
|
while (1) {
|
|
902
899
|
switch (_context4.prev = _context4.next) {
|
|
@@ -914,7 +911,7 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
914
911
|
debug.log(" Not obvious: looking up dropped thing ".concat(thing));
|
|
915
912
|
_context4.prev = 5;
|
|
916
913
|
_context4.next = 8;
|
|
917
|
-
return
|
|
914
|
+
return this._store.fetcher.load(thing.doc());
|
|
918
915
|
|
|
919
916
|
case 8:
|
|
920
917
|
_context4.next = 15;
|
|
@@ -1745,18 +1742,14 @@ function putACLObject(kb, x, ac, aclDoc, callbackFunction) {
|
|
|
1745
1742
|
|
|
1746
1743
|
|
|
1747
1744
|
function putACLbyCombo(kb, x, byCombo, aclDoc, callbackFunction) {
|
|
1748
|
-
var _kb$updater;
|
|
1749
|
-
|
|
1750
1745
|
var kb2 = (0, _rdflib.graph)();
|
|
1751
1746
|
makeACLGraphbyCombo(kb2, x, byCombo, aclDoc, true); // const str = makeACLString = function(x, ac, aclDoc)
|
|
1752
1747
|
|
|
1753
|
-
|
|
1748
|
+
kb.updater.put(aclDoc, kb2.statementsMatching(undefined, undefined, undefined, aclDoc), 'text/turtle', function (uri, ok, message) {
|
|
1754
1749
|
if (!ok) {
|
|
1755
1750
|
callbackFunction(ok, message);
|
|
1756
1751
|
} else {
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
(_kb$fetcher = kb.fetcher) === null || _kb$fetcher === void 0 ? void 0 : _kb$fetcher.unload(aclDoc);
|
|
1752
|
+
kb.fetcher.unload(aclDoc);
|
|
1760
1753
|
makeACLGraphbyCombo(kb, x, byCombo, aclDoc, true);
|
|
1761
1754
|
kb.fetcher.requested[aclDoc.uri] = 'done'; // missing: save headers
|
|
1762
1755
|
|
|
@@ -5284,7 +5277,6 @@ var UI = {
|
|
|
5284
5277
|
var $rdf = UI.rdf;
|
|
5285
5278
|
var BOOK = $rdf.Namespace('http://www.w3.org/2002/01/bookmark#');
|
|
5286
5279
|
var BOOKMARK_ICON = 'noun_45961.svg';
|
|
5287
|
-
var kb = _logic.store;
|
|
5288
5280
|
var label = utils.label;
|
|
5289
5281
|
var dom = window.document || null;
|
|
5290
5282
|
/** Create a resource if it really does not exist
|
|
@@ -5295,19 +5287,20 @@ var dom = window.document || null;
|
|
|
5295
5287
|
|
|
5296
5288
|
function createIfNotExists(doc) {
|
|
5297
5289
|
return new Promise(function (resolve, reject) {
|
|
5298
|
-
|
|
5299
|
-
debug.log('createIfNotExists doc exists, all good ' + doc); //
|
|
5290
|
+
_logic.store.fetcher.load(doc).then(function (response) {
|
|
5291
|
+
debug.log('createIfNotExists doc exists, all good ' + doc); // store.fetcher.webOperation('HEAD', doc.uri).then(response => {
|
|
5300
5292
|
|
|
5301
5293
|
resolve(response);
|
|
5302
5294
|
}, function (err) {
|
|
5303
5295
|
if (err.response.status === 404) {
|
|
5304
5296
|
debug.log('createIfNotExists doc does NOT exist, will create... ' + doc);
|
|
5305
|
-
|
|
5297
|
+
|
|
5298
|
+
_logic.store.fetcher.webOperation('PUT', doc.uri, {
|
|
5306
5299
|
data: '',
|
|
5307
5300
|
contentType: 'text/turtle'
|
|
5308
5301
|
}).then(function (response) {
|
|
5309
5302
|
// fetcher.requested[doc.uri] = 'done' // do not need to read ?? but no headers
|
|
5310
|
-
delete
|
|
5303
|
+
delete _logic.store.fetcher.requested[doc.uri]; // delete cached 404 error
|
|
5311
5304
|
|
|
5312
5305
|
debug.log('createIfNotExists doc created ok ' + doc);
|
|
5313
5306
|
resolve(response);
|
|
@@ -5326,13 +5319,14 @@ function createIfNotExists(doc) {
|
|
|
5326
5319
|
|
|
5327
5320
|
function updatePromise(del, ins) {
|
|
5328
5321
|
return new Promise(function (resolve, reject) {
|
|
5329
|
-
|
|
5322
|
+
_logic.store.updater.update(del, ins, function (uri, ok, errorBody) {
|
|
5330
5323
|
if (!ok) {
|
|
5331
5324
|
reject(new Error(errorBody));
|
|
5332
5325
|
} else {
|
|
5333
5326
|
resolve();
|
|
5334
5327
|
}
|
|
5335
5328
|
}); // callback
|
|
5329
|
+
|
|
5336
5330
|
}); // promise
|
|
5337
5331
|
} // export findBookmarkDocument,
|
|
5338
5332
|
|
|
@@ -5461,8 +5455,8 @@ function _addBookmark() {
|
|
|
5461
5455
|
throw new Error('Must be logged on to add Bookmark');
|
|
5462
5456
|
|
|
5463
5457
|
case 4:
|
|
5464
|
-
author =
|
|
5465
|
-
title = label(author) + ': ' +
|
|
5458
|
+
author = _logic.store.any(target, ns.foaf('maker'));
|
|
5459
|
+
title = label(author) + ': ' + _logic.store.anyValue(target, ns.sioc('content')).slice(0, 80); // @@ add chat title too?
|
|
5466
5460
|
|
|
5467
5461
|
bookmarkDoc = context.bookmarkDocument;
|
|
5468
5462
|
bookmark = UI.widgets.newThing(bookmarkDoc, title);
|
|
@@ -5500,17 +5494,17 @@ function toggleBookmark(_x4, _x5, _x6) {
|
|
|
5500
5494
|
}
|
|
5501
5495
|
|
|
5502
5496
|
function _toggleBookmark() {
|
|
5503
|
-
_toggleBookmark = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(userContext, target,
|
|
5497
|
+
_toggleBookmark = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(userContext, target, bookmarstoreutton) {
|
|
5504
5498
|
var bookmarks, i, bookmark;
|
|
5505
5499
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
5506
5500
|
while (1) {
|
|
5507
5501
|
switch (_context3.prev = _context3.next) {
|
|
5508
5502
|
case 0:
|
|
5509
5503
|
_context3.next = 2;
|
|
5510
|
-
return
|
|
5504
|
+
return _logic.store.fetcher.load(userContext.bookmarkDocument);
|
|
5511
5505
|
|
|
5512
5506
|
case 2:
|
|
5513
|
-
bookmarks =
|
|
5507
|
+
bookmarks = _logic.store.each(null, BOOK('recalls'), target, userContext.bookmarkDocument);
|
|
5514
5508
|
|
|
5515
5509
|
if (!bookmarks.length) {
|
|
5516
5510
|
_context3.next = 24;
|
|
@@ -5535,10 +5529,10 @@ function _toggleBookmark() {
|
|
|
5535
5529
|
|
|
5536
5530
|
_context3.prev = 8;
|
|
5537
5531
|
_context3.next = 11;
|
|
5538
|
-
return updatePromise(
|
|
5532
|
+
return updatePromise(_logic.store.connectedStatements(bookmarks[i]), []);
|
|
5539
5533
|
|
|
5540
5534
|
case 11:
|
|
5541
|
-
|
|
5535
|
+
bookmarstoreutton.style.backgroundColor = 'white';
|
|
5542
5536
|
debug.log('Bookmark deleted: ' + bookmarks[i]);
|
|
5543
5537
|
_context3.next = 19;
|
|
5544
5538
|
break;
|
|
@@ -5564,7 +5558,7 @@ function _toggleBookmark() {
|
|
|
5564
5558
|
|
|
5565
5559
|
case 26:
|
|
5566
5560
|
bookmark = _context3.sent;
|
|
5567
|
-
|
|
5561
|
+
bookmarstoreutton.style.backgroundColor = 'yellow';
|
|
5568
5562
|
debug.log('Bookmark added: ' + bookmark);
|
|
5569
5563
|
|
|
5570
5564
|
case 29:
|
|
@@ -5583,26 +5577,26 @@ function renderBookmarksButton(_x7, _x8) {
|
|
|
5583
5577
|
|
|
5584
5578
|
function _renderBookmarksButton() {
|
|
5585
5579
|
_renderBookmarksButton = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(userContext, target) {
|
|
5586
|
-
var
|
|
5580
|
+
var setBookmarstoreuttonColor, _setBookmarstoreuttonColor, bookmarstoreutton;
|
|
5587
5581
|
|
|
5588
5582
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
5589
5583
|
while (1) {
|
|
5590
5584
|
switch (_context5.prev = _context5.next) {
|
|
5591
5585
|
case 0:
|
|
5592
|
-
|
|
5593
|
-
|
|
5586
|
+
_setBookmarstoreuttonColor = function _setBookmarstoreutton2() {
|
|
5587
|
+
_setBookmarstoreuttonColor = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(bookmarstoreutton) {
|
|
5594
5588
|
var bookmarked;
|
|
5595
5589
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
5596
5590
|
while (1) {
|
|
5597
5591
|
switch (_context4.prev = _context4.next) {
|
|
5598
5592
|
case 0:
|
|
5599
5593
|
_context4.next = 2;
|
|
5600
|
-
return
|
|
5594
|
+
return _logic.store.fetcher.load(userContext.bookmarkDocument);
|
|
5601
5595
|
|
|
5602
5596
|
case 2:
|
|
5603
|
-
bookmarked =
|
|
5604
|
-
|
|
5605
|
-
if (bookmarked)
|
|
5597
|
+
bookmarked = _logic.store.any(null, BOOK('recalls'), bookmarstoreutton.target, userContext.bookmarkDocument);
|
|
5598
|
+
bookmarstoreutton.style = UI.style.buttonStyle;
|
|
5599
|
+
if (bookmarked) bookmarstoreutton.style.backgroundColor = 'yellow';
|
|
5606
5600
|
|
|
5607
5601
|
case 5:
|
|
5608
5602
|
case "end":
|
|
@@ -5611,11 +5605,11 @@ function _renderBookmarksButton() {
|
|
|
5611
5605
|
}
|
|
5612
5606
|
}, _callee4);
|
|
5613
5607
|
}));
|
|
5614
|
-
return
|
|
5608
|
+
return _setBookmarstoreuttonColor.apply(this, arguments);
|
|
5615
5609
|
};
|
|
5616
5610
|
|
|
5617
|
-
|
|
5618
|
-
return
|
|
5611
|
+
setBookmarstoreuttonColor = function _setBookmarstoreutton(_x9) {
|
|
5612
|
+
return _setBookmarstoreuttonColor.apply(this, arguments);
|
|
5619
5613
|
};
|
|
5620
5614
|
|
|
5621
5615
|
if (!userContext.bookmarkDocument) {
|
|
@@ -5623,15 +5617,15 @@ function _renderBookmarksButton() {
|
|
|
5623
5617
|
break;
|
|
5624
5618
|
}
|
|
5625
5619
|
|
|
5626
|
-
|
|
5627
|
-
toggleBookmark(userContext, target,
|
|
5620
|
+
bookmarstoreutton = UI.widgets.button(dom, UI.icons.iconBase + BOOKMARK_ICON, label(BOOK('Bookmark')), function () {
|
|
5621
|
+
toggleBookmark(userContext, target, bookmarstoreutton);
|
|
5628
5622
|
});
|
|
5629
|
-
|
|
5623
|
+
bookmarstoreutton.target = target;
|
|
5630
5624
|
_context5.next = 7;
|
|
5631
|
-
return
|
|
5625
|
+
return setBookmarstoreuttonColor(bookmarstoreutton);
|
|
5632
5626
|
|
|
5633
5627
|
case 7:
|
|
5634
|
-
return _context5.abrupt("return",
|
|
5628
|
+
return _context5.abrupt("return", bookmarstoreutton);
|
|
5635
5629
|
|
|
5636
5630
|
case 8:
|
|
5637
5631
|
case "end":
|
|
@@ -5646,6 +5640,357 @@ function _renderBookmarksButton() {
|
|
|
5646
5640
|
|
|
5647
5641
|
/***/ }),
|
|
5648
5642
|
|
|
5643
|
+
/***/ "./lib/chat/chatLogic.js":
|
|
5644
|
+
/*!*******************************!*\
|
|
5645
|
+
!*** ./lib/chat/chatLogic.js ***!
|
|
5646
|
+
\*******************************/
|
|
5647
|
+
/*! no static exports found */
|
|
5648
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
5649
|
+
|
|
5650
|
+
"use strict";
|
|
5651
|
+
|
|
5652
|
+
|
|
5653
|
+
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
|
|
5654
|
+
|
|
5655
|
+
var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js");
|
|
5656
|
+
|
|
5657
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5658
|
+
value: true
|
|
5659
|
+
});
|
|
5660
|
+
exports.ChatChannel = void 0;
|
|
5661
|
+
exports._createIfNotExists = _createIfNotExists;
|
|
5662
|
+
exports.isDeleted = isDeleted;
|
|
5663
|
+
exports.isHidden = isHidden;
|
|
5664
|
+
exports.isReplaced = isReplaced;
|
|
5665
|
+
exports.mostRecentVersion = mostRecentVersion;
|
|
5666
|
+
exports.nick = nick;
|
|
5667
|
+
exports.originalVersion = originalVersion;
|
|
5668
|
+
|
|
5669
|
+
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"));
|
|
5670
|
+
|
|
5671
|
+
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
|
|
5672
|
+
|
|
5673
|
+
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js"));
|
|
5674
|
+
|
|
5675
|
+
var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js"));
|
|
5676
|
+
|
|
5677
|
+
var debug = _interopRequireWildcard(__webpack_require__(/*! ../debug */ "./lib/debug.js"));
|
|
5678
|
+
|
|
5679
|
+
var _index = __webpack_require__(/*! ../authn/index */ "./lib/authn/index.js");
|
|
5680
|
+
|
|
5681
|
+
var _dateFolder = __webpack_require__(/*! ./dateFolder */ "./lib/chat/dateFolder.js");
|
|
5682
|
+
|
|
5683
|
+
var _logic = __webpack_require__(/*! ../logic */ "./lib/logic.js");
|
|
5684
|
+
|
|
5685
|
+
var ns = _interopRequireWildcard(__webpack_require__(/*! ../ns */ "./lib/ns.js"));
|
|
5686
|
+
|
|
5687
|
+
var $rdf = _interopRequireWildcard(__webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js"));
|
|
5688
|
+
|
|
5689
|
+
var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ "./lib/utils/index.js"));
|
|
5690
|
+
|
|
5691
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
5692
|
+
|
|
5693
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
5694
|
+
|
|
5695
|
+
/**
|
|
5696
|
+
* Contains the [[ChatChannel]] class and logic for Solid Chat
|
|
5697
|
+
* @packageDocumentation
|
|
5698
|
+
*/
|
|
5699
|
+
// pull in first avoid cross-refs
|
|
5700
|
+
|
|
5701
|
+
/* The Solid logic for a 'LongChat'
|
|
5702
|
+
*/
|
|
5703
|
+
|
|
5704
|
+
/**
|
|
5705
|
+
* Common code for a chat (discussion area of messages about something)
|
|
5706
|
+
* This version runs over a series of files for different time periods
|
|
5707
|
+
*
|
|
5708
|
+
* Parameters for the whole chat like its title are stored on
|
|
5709
|
+
* index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl
|
|
5710
|
+
*
|
|
5711
|
+
*/
|
|
5712
|
+
var ChatChannel = /*#__PURE__*/function () {
|
|
5713
|
+
function ChatChannel(channel, options) {
|
|
5714
|
+
(0, _classCallCheck2["default"])(this, ChatChannel);
|
|
5715
|
+
this.channel = channel;
|
|
5716
|
+
this.channelRoot = channel.doc();
|
|
5717
|
+
this.options = options;
|
|
5718
|
+
this.dateFolder = new _dateFolder.DateFolder(this.channelRoot, 'chat.ttl');
|
|
5719
|
+
this.div = null; // : HTMLElement
|
|
5720
|
+
}
|
|
5721
|
+
/* Store a new message in the web,
|
|
5722
|
+
*/
|
|
5723
|
+
|
|
5724
|
+
|
|
5725
|
+
(0, _createClass2["default"])(ChatChannel, [{
|
|
5726
|
+
key: "createMessage",
|
|
5727
|
+
value: function () {
|
|
5728
|
+
var _createMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(text) {
|
|
5729
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
5730
|
+
while (1) {
|
|
5731
|
+
switch (_context.prev = _context.next) {
|
|
5732
|
+
case 0:
|
|
5733
|
+
return _context.abrupt("return", this.updateMessage(text));
|
|
5734
|
+
|
|
5735
|
+
case 1:
|
|
5736
|
+
case "end":
|
|
5737
|
+
return _context.stop();
|
|
5738
|
+
}
|
|
5739
|
+
}
|
|
5740
|
+
}, _callee, this);
|
|
5741
|
+
}));
|
|
5742
|
+
|
|
5743
|
+
function createMessage(_x) {
|
|
5744
|
+
return _createMessage.apply(this, arguments);
|
|
5745
|
+
}
|
|
5746
|
+
|
|
5747
|
+
return createMessage;
|
|
5748
|
+
}()
|
|
5749
|
+
/* Store a new message in the web,
|
|
5750
|
+
as a replacement for an existing one.
|
|
5751
|
+
The old one iis left, and the two are linked
|
|
5752
|
+
*/
|
|
5753
|
+
|
|
5754
|
+
}, {
|
|
5755
|
+
key: "updateMessage",
|
|
5756
|
+
value: function () {
|
|
5757
|
+
var _updateMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(text) {
|
|
5758
|
+
var oldMsg,
|
|
5759
|
+
deleteIt,
|
|
5760
|
+
sts,
|
|
5761
|
+
now,
|
|
5762
|
+
timestamp,
|
|
5763
|
+
dateStamp,
|
|
5764
|
+
chatDocument,
|
|
5765
|
+
message,
|
|
5766
|
+
me,
|
|
5767
|
+
msg,
|
|
5768
|
+
_args2 = arguments;
|
|
5769
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
5770
|
+
while (1) {
|
|
5771
|
+
switch (_context2.prev = _context2.next) {
|
|
5772
|
+
case 0:
|
|
5773
|
+
oldMsg = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
|
|
5774
|
+
deleteIt = _args2.length > 2 ? _args2[2] : undefined;
|
|
5775
|
+
sts = [];
|
|
5776
|
+
now = new Date();
|
|
5777
|
+
timestamp = '' + now.getTime();
|
|
5778
|
+
dateStamp = $rdf.term(now);
|
|
5779
|
+
chatDocument = oldMsg ? oldMsg.doc() : this.dateFolder.leafDocumentFromDate(now);
|
|
5780
|
+
message = _logic.store.sym(chatDocument.uri + '#' + 'Msg' + timestamp); // const content = store.literal(text)
|
|
5781
|
+
|
|
5782
|
+
me = _index.authn.currentUser(); // If already logged on
|
|
5783
|
+
|
|
5784
|
+
if (oldMsg) {
|
|
5785
|
+
// edit message replaces old one
|
|
5786
|
+
sts.push($rdf.st(mostRecentVersion(oldMsg), ns.dct('isReplacedBy'), message, chatDocument));
|
|
5787
|
+
|
|
5788
|
+
if (deleteIt) {
|
|
5789
|
+
sts.push($rdf.st(message, ns.schema('dateDeleted'), dateStamp, chatDocument));
|
|
5790
|
+
}
|
|
5791
|
+
} else {
|
|
5792
|
+
// link new message to channel
|
|
5793
|
+
sts.push($rdf.st(this.channel, ns.wf('message'), message, chatDocument));
|
|
5794
|
+
}
|
|
5795
|
+
|
|
5796
|
+
sts.push($rdf.st(message, ns.sioc('content'), _logic.store.literal(text), chatDocument));
|
|
5797
|
+
sts.push($rdf.st(message, ns.dct('created'), dateStamp, chatDocument));
|
|
5798
|
+
|
|
5799
|
+
if (me) {
|
|
5800
|
+
sts.push($rdf.st(message, ns.foaf('maker'), me, chatDocument));
|
|
5801
|
+
}
|
|
5802
|
+
|
|
5803
|
+
_context2.prev = 13;
|
|
5804
|
+
_context2.next = 16;
|
|
5805
|
+
return _logic.store.updater.update([], sts);
|
|
5806
|
+
|
|
5807
|
+
case 16:
|
|
5808
|
+
_context2.next = 24;
|
|
5809
|
+
break;
|
|
5810
|
+
|
|
5811
|
+
case 18:
|
|
5812
|
+
_context2.prev = 18;
|
|
5813
|
+
_context2.t0 = _context2["catch"](13);
|
|
5814
|
+
msg = 'Error saving chat message: ' + _context2.t0;
|
|
5815
|
+
debug.warn(msg);
|
|
5816
|
+
alert(msg);
|
|
5817
|
+
throw new Error(msg);
|
|
5818
|
+
|
|
5819
|
+
case 24:
|
|
5820
|
+
return _context2.abrupt("return", message);
|
|
5821
|
+
|
|
5822
|
+
case 25:
|
|
5823
|
+
case "end":
|
|
5824
|
+
return _context2.stop();
|
|
5825
|
+
}
|
|
5826
|
+
}
|
|
5827
|
+
}, _callee2, this, [[13, 18]]);
|
|
5828
|
+
}));
|
|
5829
|
+
|
|
5830
|
+
function updateMessage(_x2) {
|
|
5831
|
+
return _updateMessage.apply(this, arguments);
|
|
5832
|
+
}
|
|
5833
|
+
|
|
5834
|
+
return updateMessage;
|
|
5835
|
+
}()
|
|
5836
|
+
/* Mark a message as deleted
|
|
5837
|
+
* Wee add a new version of the message,m witha deletion flag (deletion date)
|
|
5838
|
+
* so that the deletion can be revoked by adding another non-deleted update
|
|
5839
|
+
*/
|
|
5840
|
+
|
|
5841
|
+
}, {
|
|
5842
|
+
key: "deleteMessage",
|
|
5843
|
+
value: function () {
|
|
5844
|
+
var _deleteMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(message) {
|
|
5845
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
5846
|
+
while (1) {
|
|
5847
|
+
switch (_context3.prev = _context3.next) {
|
|
5848
|
+
case 0:
|
|
5849
|
+
return _context3.abrupt("return", this.updateMessage('(message deleted)', message, true));
|
|
5850
|
+
|
|
5851
|
+
case 1:
|
|
5852
|
+
case "end":
|
|
5853
|
+
return _context3.stop();
|
|
5854
|
+
}
|
|
5855
|
+
}
|
|
5856
|
+
}, _callee3, this);
|
|
5857
|
+
}));
|
|
5858
|
+
|
|
5859
|
+
function deleteMessage(_x3) {
|
|
5860
|
+
return _deleteMessage.apply(this, arguments);
|
|
5861
|
+
}
|
|
5862
|
+
|
|
5863
|
+
return deleteMessage;
|
|
5864
|
+
}()
|
|
5865
|
+
}]);
|
|
5866
|
+
return ChatChannel;
|
|
5867
|
+
}(); // class ChatChannel
|
|
5868
|
+
|
|
5869
|
+
|
|
5870
|
+
exports.ChatChannel = ChatChannel;
|
|
5871
|
+
|
|
5872
|
+
function originalVersion(message) {
|
|
5873
|
+
var msg = message;
|
|
5874
|
+
|
|
5875
|
+
while (msg) {
|
|
5876
|
+
message = msg;
|
|
5877
|
+
msg = _logic.store.any(null, ns.dct('isReplacedBy'), message, message.doc());
|
|
5878
|
+
}
|
|
5879
|
+
|
|
5880
|
+
return message;
|
|
5881
|
+
}
|
|
5882
|
+
|
|
5883
|
+
function mostRecentVersion(message) {
|
|
5884
|
+
var msg = message;
|
|
5885
|
+
|
|
5886
|
+
while (msg) {
|
|
5887
|
+
message = msg;
|
|
5888
|
+
msg = _logic.store.any(message, ns.dct('isReplacedBy'), null, message.doc());
|
|
5889
|
+
}
|
|
5890
|
+
|
|
5891
|
+
return message;
|
|
5892
|
+
}
|
|
5893
|
+
|
|
5894
|
+
function isDeleted(message) {
|
|
5895
|
+
return _logic.store.holds(message, ns.schema('dateDeleted'), null, message.doc());
|
|
5896
|
+
}
|
|
5897
|
+
|
|
5898
|
+
function isReplaced(message) {
|
|
5899
|
+
return _logic.store.holds(message, ns.dct('isReplacedBy'), null, message.doc());
|
|
5900
|
+
}
|
|
5901
|
+
|
|
5902
|
+
function isHidden(message) {
|
|
5903
|
+
return this.isDeleted(message) || this.isReplaced(message);
|
|
5904
|
+
} // A Nickname for a person
|
|
5905
|
+
|
|
5906
|
+
|
|
5907
|
+
function nick(person) {
|
|
5908
|
+
var s = _logic.store.any(person, ns.foaf('nick'));
|
|
5909
|
+
|
|
5910
|
+
if (s) return '' + s.value;
|
|
5911
|
+
return '' + utils.label(person);
|
|
5912
|
+
}
|
|
5913
|
+
|
|
5914
|
+
function _createIfNotExists(_x4) {
|
|
5915
|
+
return _createIfNotExists2.apply(this, arguments);
|
|
5916
|
+
} // ends
|
|
5917
|
+
|
|
5918
|
+
|
|
5919
|
+
function _createIfNotExists2() {
|
|
5920
|
+
_createIfNotExists2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(doc) {
|
|
5921
|
+
var contentType,
|
|
5922
|
+
data,
|
|
5923
|
+
response,
|
|
5924
|
+
_args4 = arguments;
|
|
5925
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
5926
|
+
while (1) {
|
|
5927
|
+
switch (_context4.prev = _context4.next) {
|
|
5928
|
+
case 0:
|
|
5929
|
+
contentType = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : 'text/turtle';
|
|
5930
|
+
data = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : '';
|
|
5931
|
+
_context4.prev = 2;
|
|
5932
|
+
_context4.next = 5;
|
|
5933
|
+
return _logic.store.fetcher.load(doc);
|
|
5934
|
+
|
|
5935
|
+
case 5:
|
|
5936
|
+
response = _context4.sent;
|
|
5937
|
+
_context4.next = 28;
|
|
5938
|
+
break;
|
|
5939
|
+
|
|
5940
|
+
case 8:
|
|
5941
|
+
_context4.prev = 8;
|
|
5942
|
+
_context4.t0 = _context4["catch"](2);
|
|
5943
|
+
|
|
5944
|
+
if (!(_context4.t0.response.status === 404)) {
|
|
5945
|
+
_context4.next = 26;
|
|
5946
|
+
break;
|
|
5947
|
+
}
|
|
5948
|
+
|
|
5949
|
+
debug.log('createIfNotExists: doc does NOT exist, will create... ' + doc);
|
|
5950
|
+
_context4.prev = 12;
|
|
5951
|
+
_context4.next = 15;
|
|
5952
|
+
return _logic.store.fetcher.webOperation('PUT', doc.uri, {
|
|
5953
|
+
data: data,
|
|
5954
|
+
contentType: contentType
|
|
5955
|
+
});
|
|
5956
|
+
|
|
5957
|
+
case 15:
|
|
5958
|
+
response = _context4.sent;
|
|
5959
|
+
_context4.next = 22;
|
|
5960
|
+
break;
|
|
5961
|
+
|
|
5962
|
+
case 18:
|
|
5963
|
+
_context4.prev = 18;
|
|
5964
|
+
_context4.t1 = _context4["catch"](12);
|
|
5965
|
+
debug.log('createIfNotExists doc FAILED: ' + doc + ': ' + _context4.t1);
|
|
5966
|
+
throw _context4.t1;
|
|
5967
|
+
|
|
5968
|
+
case 22:
|
|
5969
|
+
delete _logic.store.fetcher.requested[doc.uri]; // delete cached 404 error
|
|
5970
|
+
// debug.log('createIfNotExists doc created ok ' + doc)
|
|
5971
|
+
|
|
5972
|
+
return _context4.abrupt("return", response);
|
|
5973
|
+
|
|
5974
|
+
case 26:
|
|
5975
|
+
debug.log('createIfNotExists doc load error NOT 404: ' + doc + ': ' + _context4.t0);
|
|
5976
|
+
throw _context4.t0;
|
|
5977
|
+
|
|
5978
|
+
case 28:
|
|
5979
|
+
return _context4.abrupt("return", response);
|
|
5980
|
+
|
|
5981
|
+
case 29:
|
|
5982
|
+
case "end":
|
|
5983
|
+
return _context4.stop();
|
|
5984
|
+
}
|
|
5985
|
+
}
|
|
5986
|
+
}, _callee4, null, [[2, 8], [12, 18]]);
|
|
5987
|
+
}));
|
|
5988
|
+
return _createIfNotExists2.apply(this, arguments);
|
|
5989
|
+
}
|
|
5990
|
+
//# sourceMappingURL=chatLogic.js.map
|
|
5991
|
+
|
|
5992
|
+
/***/ }),
|
|
5993
|
+
|
|
5649
5994
|
/***/ "./lib/chat/dateFolder.js":
|
|
5650
5995
|
/*!********************************!*\
|
|
5651
5996
|
!*** ./lib/chat/dateFolder.js ***!
|
|
@@ -5687,14 +6032,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
5687
6032
|
|
|
5688
6033
|
/**
|
|
5689
6034
|
* Contains the [[DateFolder]] class
|
|
5690
|
-
*
|
|
6035
|
+
* This tracks data stored in dated folders and sub-folders
|
|
6036
|
+
*
|
|
5691
6037
|
*/
|
|
5692
6038
|
// pull in first avoid cross-refs
|
|
5693
|
-
|
|
6039
|
+
|
|
5694
6040
|
/**
|
|
5695
6041
|
* Track back through the YYYY/MM/DD tree to find the previous/next day
|
|
5696
6042
|
*/
|
|
5697
|
-
|
|
5698
6043
|
var DateFolder = /*#__PURE__*/function () {
|
|
5699
6044
|
function DateFolder(rootThing, leafFileName, membershipProperty) {
|
|
5700
6045
|
(0, _classCallCheck2["default"])(this, DateFolder);
|
|
@@ -5718,7 +6063,7 @@ var DateFolder = /*#__PURE__*/function () {
|
|
|
5718
6063
|
var path = isoDate.split('T')[0].replace(/-/g, '/'); // Like "2018/05/07"
|
|
5719
6064
|
|
|
5720
6065
|
path = this.root.dir().uri + path + '/' + this.leafFileName;
|
|
5721
|
-
return
|
|
6066
|
+
return _logic.store.sym(path);
|
|
5722
6067
|
}
|
|
5723
6068
|
/* Generate a date object from the leaf file name
|
|
5724
6069
|
*/
|
|
@@ -5780,12 +6125,12 @@ var DateFolder = /*#__PURE__*/function () {
|
|
|
5780
6125
|
}
|
|
5781
6126
|
|
|
5782
6127
|
_folder = siblings.pop();
|
|
5783
|
-
leafDocument =
|
|
6128
|
+
leafDocument = _logic.store.sym(_folder.uri + thisDateFolder.leafFileName);
|
|
5784
6129
|
_context.next = 10;
|
|
5785
|
-
return
|
|
6130
|
+
return _logic.store.fetcher.load(leafDocument);
|
|
5786
6131
|
|
|
5787
6132
|
case 10:
|
|
5788
|
-
if (!(
|
|
6133
|
+
if (!(_logic.store.statementsMatching(null, ns.dct('created'), null, leafDocument).length > 0)) {
|
|
5789
6134
|
_context.next = 12;
|
|
5790
6135
|
break;
|
|
5791
6136
|
}
|
|
@@ -5829,10 +6174,10 @@ var DateFolder = /*#__PURE__*/function () {
|
|
|
5829
6174
|
// debug.log(' previousPeriod level' + level + ' file ' + file)
|
|
5830
6175
|
parent = file.dir();
|
|
5831
6176
|
_context2.next = 7;
|
|
5832
|
-
return
|
|
6177
|
+
return _logic.store.fetcher.load(parent);
|
|
5833
6178
|
|
|
5834
6179
|
case 7:
|
|
5835
|
-
siblings =
|
|
6180
|
+
siblings = _logic.store.each(parent, ns.ldp('contains'));
|
|
5836
6181
|
siblings = siblings.filter(younger);
|
|
5837
6182
|
_context2.next = 11;
|
|
5838
6183
|
return lastNonEmpty(siblings);
|
|
@@ -5871,10 +6216,10 @@ var DateFolder = /*#__PURE__*/function () {
|
|
|
5871
6216
|
|
|
5872
6217
|
case 21:
|
|
5873
6218
|
_context2.next = 23;
|
|
5874
|
-
return
|
|
6219
|
+
return _logic.store.fetcher.load(uncle);
|
|
5875
6220
|
|
|
5876
6221
|
case 23:
|
|
5877
|
-
cousins =
|
|
6222
|
+
cousins = _logic.store.each(uncle, ns.ldp('contains'));
|
|
5878
6223
|
_context2.next = 26;
|
|
5879
6224
|
return lastNonEmpty(cousins);
|
|
5880
6225
|
|
|
@@ -5910,7 +6255,7 @@ var DateFolder = /*#__PURE__*/function () {
|
|
|
5910
6255
|
break;
|
|
5911
6256
|
}
|
|
5912
6257
|
|
|
5913
|
-
doc =
|
|
6258
|
+
doc = _logic.store.sym(found.uri + this.leafFileName);
|
|
5914
6259
|
return _context3.abrupt("return", this.dateFromLeafDocument(doc));
|
|
5915
6260
|
|
|
5916
6261
|
case 10:
|
|
@@ -6081,152 +6426,53 @@ var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_m
|
|
|
6081
6426
|
Object.defineProperty(exports, "__esModule", {
|
|
6082
6427
|
value: true
|
|
6083
6428
|
});
|
|
6084
|
-
exports.createIfNotExists = createIfNotExists;
|
|
6085
6429
|
exports.desktopNotification = desktopNotification;
|
|
6086
6430
|
exports.infiniteMessageArea = infiniteMessageArea;
|
|
6431
|
+
exports.insertMessageIntoTable = insertMessageIntoTable;
|
|
6087
6432
|
|
|
6088
6433
|
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"));
|
|
6089
6434
|
|
|
6090
6435
|
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
|
|
6091
6436
|
|
|
6092
|
-
var _index = __webpack_require__(/*! ../authn/index */ "./lib/authn/index.js");
|
|
6093
|
-
|
|
6094
6437
|
var debug = _interopRequireWildcard(__webpack_require__(/*! ../debug */ "./lib/debug.js"));
|
|
6095
6438
|
|
|
6096
6439
|
var _iconBase = __webpack_require__(/*! ../iconBase */ "./lib/iconBase.js");
|
|
6097
6440
|
|
|
6098
6441
|
var _logic = __webpack_require__(/*! ../logic */ "./lib/logic.js");
|
|
6099
6442
|
|
|
6100
|
-
var _index2 = __webpack_require__(/*! ../media/index */ "./lib/media/index.js");
|
|
6101
|
-
|
|
6102
6443
|
var ns = _interopRequireWildcard(__webpack_require__(/*! ../ns */ "./lib/ns.js"));
|
|
6103
6444
|
|
|
6104
|
-
var
|
|
6105
|
-
|
|
6106
|
-
var _dateFolder = __webpack_require__(/*! ./dateFolder */ "./lib/chat/dateFolder.js");
|
|
6445
|
+
var _chatLogic = __webpack_require__(/*! ./chatLogic */ "./lib/chat/chatLogic.js");
|
|
6107
6446
|
|
|
6108
6447
|
var _message = __webpack_require__(/*! ./message */ "./lib/chat/message.js");
|
|
6109
6448
|
|
|
6110
|
-
var _bookmarks = __webpack_require__(/*! ./bookmarks */ "./lib/chat/bookmarks.js");
|
|
6111
|
-
|
|
6112
6449
|
var $rdf = _interopRequireWildcard(__webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js"));
|
|
6113
6450
|
|
|
6114
|
-
var style = _interopRequireWildcard(__webpack_require__(/*! ../style */ "./lib/style.js"));
|
|
6115
|
-
|
|
6116
|
-
var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ "./lib/utils/index.js"));
|
|
6117
|
-
|
|
6118
6451
|
var widgets = _interopRequireWildcard(__webpack_require__(/*! ../widgets */ "./lib/widgets/index.js"));
|
|
6119
6452
|
|
|
6120
6453
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
6121
6454
|
|
|
6122
6455
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
6123
6456
|
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
store: _logic.store,
|
|
6138
|
-
style: style,
|
|
6139
|
-
utils: utils,
|
|
6140
|
-
widgets: widgets
|
|
6141
|
-
};
|
|
6142
|
-
/* global alert */
|
|
6143
|
-
|
|
6144
|
-
var SERVER_MKDIRP_BUG = false; // Set false timbl 2021-10-31 should be fixed by now
|
|
6145
|
-
|
|
6146
|
-
function createIfNotExists(_x) {
|
|
6147
|
-
return _createIfNotExists.apply(this, arguments);
|
|
6148
|
-
}
|
|
6149
|
-
|
|
6150
|
-
function _createIfNotExists() {
|
|
6151
|
-
_createIfNotExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(doc) {
|
|
6152
|
-
var contentType,
|
|
6153
|
-
data,
|
|
6154
|
-
fetcher,
|
|
6155
|
-
response,
|
|
6156
|
-
_args = arguments;
|
|
6157
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
6158
|
-
while (1) {
|
|
6159
|
-
switch (_context.prev = _context.next) {
|
|
6160
|
-
case 0:
|
|
6161
|
-
contentType = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'text/turtle';
|
|
6162
|
-
data = _args.length > 2 && _args[2] !== undefined ? _args[2] : '';
|
|
6163
|
-
fetcher = UI.store.fetcher;
|
|
6164
|
-
_context.prev = 3;
|
|
6165
|
-
_context.next = 6;
|
|
6166
|
-
return fetcher.load(doc);
|
|
6167
|
-
|
|
6168
|
-
case 6:
|
|
6169
|
-
response = _context.sent;
|
|
6170
|
-
_context.next = 29;
|
|
6171
|
-
break;
|
|
6172
|
-
|
|
6173
|
-
case 9:
|
|
6174
|
-
_context.prev = 9;
|
|
6175
|
-
_context.t0 = _context["catch"](3);
|
|
6176
|
-
|
|
6177
|
-
if (!(_context.t0.response.status === 404)) {
|
|
6178
|
-
_context.next = 27;
|
|
6179
|
-
break;
|
|
6180
|
-
}
|
|
6181
|
-
|
|
6182
|
-
debug.log('createIfNotExists: doc does NOT exist, will create... ' + doc);
|
|
6183
|
-
_context.prev = 13;
|
|
6184
|
-
_context.next = 16;
|
|
6185
|
-
return fetcher.webOperation('PUT', doc.uri, {
|
|
6186
|
-
data: data,
|
|
6187
|
-
contentType: contentType
|
|
6188
|
-
});
|
|
6189
|
-
|
|
6190
|
-
case 16:
|
|
6191
|
-
response = _context.sent;
|
|
6192
|
-
_context.next = 23;
|
|
6193
|
-
break;
|
|
6194
|
-
|
|
6195
|
-
case 19:
|
|
6196
|
-
_context.prev = 19;
|
|
6197
|
-
_context.t1 = _context["catch"](13);
|
|
6198
|
-
debug.log('createIfNotExists doc FAILED: ' + doc + ': ' + _context.t1);
|
|
6199
|
-
throw _context.t1;
|
|
6200
|
-
|
|
6201
|
-
case 23:
|
|
6202
|
-
delete fetcher.requested[doc.uri]; // delete cached 404 error
|
|
6203
|
-
// debug.log('createIfNotExists doc created ok ' + doc)
|
|
6204
|
-
|
|
6205
|
-
return _context.abrupt("return", response);
|
|
6206
|
-
|
|
6207
|
-
case 27:
|
|
6208
|
-
debug.log('createIfNotExists doc load error NOT 404: ' + doc + ': ' + _context.t0);
|
|
6209
|
-
throw _context.t0;
|
|
6210
|
-
|
|
6211
|
-
case 29:
|
|
6212
|
-
return _context.abrupt("return", response);
|
|
6213
|
-
|
|
6214
|
-
case 30:
|
|
6215
|
-
case "end":
|
|
6216
|
-
return _context.stop();
|
|
6217
|
-
}
|
|
6218
|
-
}
|
|
6219
|
-
}, _callee, null, [[3, 9], [13, 19]]);
|
|
6220
|
-
}));
|
|
6221
|
-
return _createIfNotExists.apply(this, arguments);
|
|
6222
|
-
}
|
|
6223
|
-
|
|
6457
|
+
/**
|
|
6458
|
+
* Contains the [[infiniteMessageArea]] class
|
|
6459
|
+
* @packageDocumentation
|
|
6460
|
+
*/
|
|
6461
|
+
// import { authn } from '../authn/index'
|
|
6462
|
+
// import { media } from '../media/index'
|
|
6463
|
+
// import * as pad from '../pad'
|
|
6464
|
+
// import { DateFolder } from './dateFolder'
|
|
6465
|
+
// import { findBookmarkDocument } from './bookmarks'
|
|
6466
|
+
// pull in first avoid cross-refs
|
|
6467
|
+
// import * as style from '../style'
|
|
6468
|
+
// import * as utils from '../utils'
|
|
6469
|
+
// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }
|
|
6224
6470
|
function desktopNotification(str) {
|
|
6225
6471
|
// Let's check if the browser supports notifications
|
|
6226
6472
|
if (!('Notification' in window)) {
|
|
6227
|
-
debug.warn('This browser does
|
|
6473
|
+
debug.warn('This browser does no t support desktop notification');
|
|
6228
6474
|
} else if (Notification.permission === 'granted') {
|
|
6229
|
-
// Let's check whether
|
|
6475
|
+
// Let's check whether notificatio n permissions have already been granted
|
|
6230
6476
|
// eslint-disable-next-line no-new
|
|
6231
6477
|
new Notification(str);
|
|
6232
6478
|
} else if (Notification.permission !== 'denied') {
|
|
@@ -6242,33 +6488,84 @@ function desktopNotification(str) {
|
|
|
6242
6488
|
// want to be respectful there is no need to bother them any more.
|
|
6243
6489
|
|
|
6244
6490
|
}
|
|
6491
|
+
/**
|
|
6492
|
+
* Renders a chat message inside a `messageTable`
|
|
6493
|
+
*/
|
|
6494
|
+
|
|
6495
|
+
|
|
6496
|
+
function insertMessageIntoTable(channelObject, messageTable, message, fresh, options, userContext) {
|
|
6497
|
+
var messageRow = (0, _message.renderMessageRow)(channelObject, message, fresh, options, userContext); // const message = messageRow.AJAR_subject
|
|
6498
|
+
|
|
6499
|
+
if (options.selectedMessage && options.selectedMessage.sameTerm(message)) {
|
|
6500
|
+
messageRow.style.backgroundColor = 'yellow';
|
|
6501
|
+
options.selectedElement = messageRow;
|
|
6502
|
+
messageTable.selectedElement = messageRow;
|
|
6503
|
+
}
|
|
6504
|
+
|
|
6505
|
+
var done = false;
|
|
6506
|
+
|
|
6507
|
+
for (var ele = messageTable.firstChild;; ele = ele.nextSibling) {
|
|
6508
|
+
if (!ele) {
|
|
6509
|
+
// empty
|
|
6510
|
+
break;
|
|
6511
|
+
}
|
|
6512
|
+
|
|
6513
|
+
var newestFirst = options.newestfirst === true;
|
|
6514
|
+
var dateString = messageRow.AJAR_date;
|
|
6515
|
+
|
|
6516
|
+
if (dateString > ele.AJAR_date && newestFirst || dateString < ele.AJAR_date && !newestFirst) {
|
|
6517
|
+
messageTable.insertBefore(messageRow, ele);
|
|
6518
|
+
done = true;
|
|
6519
|
+
break;
|
|
6520
|
+
}
|
|
6521
|
+
}
|
|
6522
|
+
|
|
6523
|
+
if (!done) {
|
|
6524
|
+
messageTable.appendChild(messageRow);
|
|
6525
|
+
}
|
|
6526
|
+
}
|
|
6245
6527
|
/**
|
|
6246
6528
|
* Common code for a chat (discussion area of messages about something)
|
|
6247
6529
|
* This version runs over a series of files for different time periods
|
|
6248
6530
|
*
|
|
6249
6531
|
* Parameters for the whole chat like its title are stored on
|
|
6250
6532
|
* index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl
|
|
6533
|
+
*
|
|
6534
|
+
* Use to import store as param 2, now ignores it and uses the UI main store
|
|
6535
|
+
*
|
|
6536
|
+
* Options include:
|
|
6537
|
+
|
|
6538
|
+
- shiftEnterSendsMessage: Use shift/enter to send message, Enter to add newline, instead of the reverse.
|
|
6539
|
+
- authorDateOnLeft: Display the author's anme and date of the message in the left column instead of first above the content
|
|
6540
|
+
- selectedMessage: Display one message highlighted with the chat around it
|
|
6541
|
+
- solo: By itelf on a webpage, so user scroll anywhere in the web page scan scroll the chat.
|
|
6542
|
+
- newestFirst: Arrange the chat messages chronologically newest at the top insted of at the bottom
|
|
6543
|
+
- infinite: Use infinite scroll
|
|
6544
|
+
- showDeletedMessages: Show messages which have been delted as "deleted message". Otherwise hide them.
|
|
6545
|
+
- expandImagesInline: If a URI by itself in a message looks like an image URI, replace it with the image
|
|
6546
|
+
- inlineImageHeightEms: The height (in ems) of images expaned from their URIs in the chat.
|
|
6547
|
+
|
|
6251
6548
|
*/
|
|
6252
6549
|
|
|
6253
6550
|
|
|
6254
|
-
function infiniteMessageArea(_x2, _x3, _x4
|
|
6551
|
+
function infiniteMessageArea(_x, _x2, _x3, _x4) {
|
|
6255
6552
|
return _infiniteMessageArea.apply(this, arguments);
|
|
6256
6553
|
}
|
|
6257
6554
|
|
|
6258
6555
|
function _infiniteMessageArea() {
|
|
6259
|
-
_infiniteMessageArea = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
6260
|
-
var
|
|
6556
|
+
_infiniteMessageArea = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(dom, wasStore, chatChannel, options) {
|
|
6557
|
+
var syncMessages, addMessage, insertPreviousMessages, _insertPreviousMessages, removePreviousMessages, createMessageTable, _createMessageTable, renderMessageTable, addNewChatDocumentIfNewDay, _addNewChatDocumentIfNewDay, appendCurrentMessages, _appendCurrentMessages, loadMoreWhereNeeded, _loadMoreWhereNeeded, loadInitialContent, _loadInitialContent, newestFirst, channelObject, dateFolder, div, statusArea, userContext, liveMessageTable, earliest, latest, lock;
|
|
6261
6558
|
|
|
6262
|
-
return _regenerator["default"].wrap(function
|
|
6559
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
6263
6560
|
while (1) {
|
|
6264
|
-
switch (
|
|
6561
|
+
switch (_context12.prev = _context12.next) {
|
|
6265
6562
|
case 0:
|
|
6266
6563
|
_loadInitialContent = function _loadInitialContent3() {
|
|
6267
|
-
_loadInitialContent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
6564
|
+
_loadInitialContent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
|
|
6268
6565
|
var yank, fixScroll, live, selectedDocument, now, todayDocument, selectedMessageTable, selectedDate;
|
|
6269
|
-
return _regenerator["default"].wrap(function
|
|
6566
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
6270
6567
|
while (1) {
|
|
6271
|
-
switch (
|
|
6568
|
+
switch (_context11.prev = _context11.next) {
|
|
6272
6569
|
case 0:
|
|
6273
6570
|
fixScroll = function _fixScroll() {
|
|
6274
6571
|
if (options.selectedElement) {
|
|
@@ -6296,27 +6593,27 @@ function _infiniteMessageArea() {
|
|
|
6296
6593
|
}
|
|
6297
6594
|
|
|
6298
6595
|
if (!(options.selectedMessage && !live)) {
|
|
6299
|
-
|
|
6596
|
+
_context11.next = 15;
|
|
6300
6597
|
break;
|
|
6301
6598
|
}
|
|
6302
6599
|
|
|
6303
6600
|
selectedDate = dateFolder.dateFromLeafDocument(selectedDocument);
|
|
6304
|
-
|
|
6601
|
+
_context11.next = 7;
|
|
6305
6602
|
return createMessageTable(selectedDate, live);
|
|
6306
6603
|
|
|
6307
6604
|
case 7:
|
|
6308
|
-
selectedMessageTable =
|
|
6605
|
+
selectedMessageTable = _context11.sent;
|
|
6309
6606
|
div.appendChild(selectedMessageTable);
|
|
6310
6607
|
earliest.messageTable = selectedMessageTable;
|
|
6311
6608
|
latest.messageTable = selectedMessageTable;
|
|
6312
6609
|
yank();
|
|
6313
6610
|
setTimeout(yank, 1000); // @@ kludge - restore position distubed by other cHANGES
|
|
6314
6611
|
|
|
6315
|
-
|
|
6612
|
+
_context11.next = 19;
|
|
6316
6613
|
break;
|
|
6317
6614
|
|
|
6318
6615
|
case 15:
|
|
6319
|
-
|
|
6616
|
+
_context11.next = 17;
|
|
6320
6617
|
return appendCurrentMessages();
|
|
6321
6618
|
|
|
6322
6619
|
case 17:
|
|
@@ -6324,7 +6621,7 @@ function _infiniteMessageArea() {
|
|
|
6324
6621
|
latest.messageTable = liveMessageTable;
|
|
6325
6622
|
|
|
6326
6623
|
case 19:
|
|
6327
|
-
|
|
6624
|
+
_context11.next = 21;
|
|
6328
6625
|
return loadMoreWhereNeeded(null, fixScroll);
|
|
6329
6626
|
|
|
6330
6627
|
case 21:
|
|
@@ -6336,10 +6633,10 @@ function _infiniteMessageArea() {
|
|
|
6336
6633
|
|
|
6337
6634
|
case 23:
|
|
6338
6635
|
case "end":
|
|
6339
|
-
return
|
|
6636
|
+
return _context11.stop();
|
|
6340
6637
|
}
|
|
6341
6638
|
}
|
|
6342
|
-
},
|
|
6639
|
+
}, _callee11);
|
|
6343
6640
|
}));
|
|
6344
6641
|
return _loadInitialContent.apply(this, arguments);
|
|
6345
6642
|
};
|
|
@@ -6349,18 +6646,18 @@ function _infiniteMessageArea() {
|
|
|
6349
6646
|
};
|
|
6350
6647
|
|
|
6351
6648
|
_loadMoreWhereNeeded = function _loadMoreWhereNeeded3() {
|
|
6352
|
-
_loadMoreWhereNeeded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
6649
|
+
_loadMoreWhereNeeded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(event, fixScroll) {
|
|
6353
6650
|
var freeze, magicZone, done, scrollBottom, scrollTop;
|
|
6354
|
-
return _regenerator["default"].wrap(function
|
|
6651
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
6355
6652
|
while (1) {
|
|
6356
|
-
switch (
|
|
6653
|
+
switch (_context10.prev = _context10.next) {
|
|
6357
6654
|
case 0:
|
|
6358
6655
|
if (!lock) {
|
|
6359
|
-
|
|
6656
|
+
_context10.next = 2;
|
|
6360
6657
|
break;
|
|
6361
6658
|
}
|
|
6362
6659
|
|
|
6363
|
-
return
|
|
6660
|
+
return _context10.abrupt("return");
|
|
6364
6661
|
|
|
6365
6662
|
case 2:
|
|
6366
6663
|
lock = true;
|
|
@@ -6370,12 +6667,12 @@ function _infiniteMessageArea() {
|
|
|
6370
6667
|
|
|
6371
6668
|
case 5:
|
|
6372
6669
|
if (!(div.scrollTop < magicZone && earliest.messageTable && !earliest.messageTable.initial && earliest.messageTable.extendBackwards)) {
|
|
6373
|
-
|
|
6670
|
+
_context10.next = 21;
|
|
6374
6671
|
break;
|
|
6375
6672
|
}
|
|
6376
6673
|
|
|
6377
6674
|
if (!(div.scrollHeight === 0)) {
|
|
6378
|
-
|
|
6675
|
+
_context10.next = 10;
|
|
6379
6676
|
break;
|
|
6380
6677
|
}
|
|
6381
6678
|
|
|
@@ -6383,17 +6680,17 @@ function _infiniteMessageArea() {
|
|
|
6383
6680
|
setTimeout(loadMoreWhereNeeded, 2000); // couple be less
|
|
6384
6681
|
|
|
6385
6682
|
lock = false;
|
|
6386
|
-
return
|
|
6683
|
+
return _context10.abrupt("return");
|
|
6387
6684
|
|
|
6388
6685
|
case 10:
|
|
6389
6686
|
// console.log(' chat/loadMoreWhereNeeded: Going now')
|
|
6390
6687
|
scrollBottom = div.scrollHeight - div.scrollTop;
|
|
6391
6688
|
debug.log('infinite scroll: adding above: top ' + div.scrollTop);
|
|
6392
|
-
|
|
6689
|
+
_context10.next = 14;
|
|
6393
6690
|
return earliest.messageTable.extendBackwards();
|
|
6394
6691
|
|
|
6395
6692
|
case 14:
|
|
6396
|
-
done =
|
|
6693
|
+
done = _context10.sent;
|
|
6397
6694
|
|
|
6398
6695
|
if (freeze) {
|
|
6399
6696
|
div.scrollTop = div.scrollHeight - scrollBottom;
|
|
@@ -6402,14 +6699,14 @@ function _infiniteMessageArea() {
|
|
|
6402
6699
|
if (fixScroll) fixScroll();
|
|
6403
6700
|
|
|
6404
6701
|
if (!done) {
|
|
6405
|
-
|
|
6702
|
+
_context10.next = 19;
|
|
6406
6703
|
break;
|
|
6407
6704
|
}
|
|
6408
6705
|
|
|
6409
|
-
return
|
|
6706
|
+
return _context10.abrupt("break", 21);
|
|
6410
6707
|
|
|
6411
6708
|
case 19:
|
|
6412
|
-
|
|
6709
|
+
_context10.next = 5;
|
|
6413
6710
|
break;
|
|
6414
6711
|
|
|
6415
6712
|
case 21:
|
|
@@ -6417,17 +6714,17 @@ function _infiniteMessageArea() {
|
|
|
6417
6714
|
div.scrollHeight - div.scrollTop - div.clientHeight < magicZone && // we are scrolled right to the bottom
|
|
6418
6715
|
latest.messageTable && !latest.messageTable["final"] && // there is more data to come
|
|
6419
6716
|
latest.messageTable.extendForwards)) {
|
|
6420
|
-
|
|
6717
|
+
_context10.next = 33;
|
|
6421
6718
|
break;
|
|
6422
6719
|
}
|
|
6423
6720
|
|
|
6424
6721
|
scrollTop = div.scrollTop;
|
|
6425
6722
|
debug.log('infinite scroll: adding below: bottom: ' + (div.scrollHeight - div.scrollTop - div.clientHeight));
|
|
6426
|
-
|
|
6723
|
+
_context10.next = 26;
|
|
6427
6724
|
return latest.messageTable.extendForwards();
|
|
6428
6725
|
|
|
6429
6726
|
case 26:
|
|
6430
|
-
done =
|
|
6727
|
+
done = _context10.sent;
|
|
6431
6728
|
|
|
6432
6729
|
// then add more data on the bottom
|
|
6433
6730
|
if (freeze) {
|
|
@@ -6437,14 +6734,14 @@ function _infiniteMessageArea() {
|
|
|
6437
6734
|
if (fixScroll) fixScroll();
|
|
6438
6735
|
|
|
6439
6736
|
if (!done) {
|
|
6440
|
-
|
|
6737
|
+
_context10.next = 31;
|
|
6441
6738
|
break;
|
|
6442
6739
|
}
|
|
6443
6740
|
|
|
6444
|
-
return
|
|
6741
|
+
return _context10.abrupt("break", 33);
|
|
6445
6742
|
|
|
6446
6743
|
case 31:
|
|
6447
|
-
|
|
6744
|
+
_context10.next = 21;
|
|
6448
6745
|
break;
|
|
6449
6746
|
|
|
6450
6747
|
case 33:
|
|
@@ -6452,72 +6749,68 @@ function _infiniteMessageArea() {
|
|
|
6452
6749
|
|
|
6453
6750
|
case 34:
|
|
6454
6751
|
case "end":
|
|
6455
|
-
return
|
|
6752
|
+
return _context10.stop();
|
|
6456
6753
|
}
|
|
6457
6754
|
}
|
|
6458
|
-
},
|
|
6755
|
+
}, _callee10);
|
|
6459
6756
|
}));
|
|
6460
6757
|
return _loadMoreWhereNeeded.apply(this, arguments);
|
|
6461
6758
|
};
|
|
6462
6759
|
|
|
6463
|
-
loadMoreWhereNeeded = function _loadMoreWhereNeeded2(
|
|
6760
|
+
loadMoreWhereNeeded = function _loadMoreWhereNeeded2(_x10, _x11) {
|
|
6464
6761
|
return _loadMoreWhereNeeded.apply(this, arguments);
|
|
6465
6762
|
};
|
|
6466
6763
|
|
|
6467
6764
|
_appendCurrentMessages = function _appendCurrentMessage2() {
|
|
6468
|
-
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
6765
|
+
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
|
6469
6766
|
var now, chatDocument, messageTable;
|
|
6470
|
-
return _regenerator["default"].wrap(function
|
|
6767
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
6471
6768
|
while (1) {
|
|
6472
|
-
switch (
|
|
6769
|
+
switch (_context9.prev = _context9.next) {
|
|
6473
6770
|
case 0:
|
|
6474
6771
|
now = new Date();
|
|
6475
|
-
chatDocument = dateFolder.leafDocumentFromDate(now);
|
|
6476
|
-
/* Don't actually make the documemnt until a message is sent @@@@@ WHEN SERVER FIXED
|
|
6477
|
-
* currently server won't patch to a file ina non-existent directory
|
|
6478
|
-
*/
|
|
6772
|
+
chatDocument = dateFolder.leafDocumentFromDate(now); /// ///////////////////////////////////////////////////////////
|
|
6479
6773
|
|
|
6480
|
-
|
|
6481
|
-
if (SERVER_MKDIRP_BUG) {
|
|
6482
|
-
try {
|
|
6483
|
-
await createIfNotExists(chatDocument)
|
|
6484
|
-
} catch (e) {
|
|
6485
|
-
div.appendChild(UI.widgets.errorMessageBlock(
|
|
6486
|
-
dom, 'Problem accessing chat file: ' + e))
|
|
6487
|
-
return
|
|
6488
|
-
}
|
|
6489
|
-
}
|
|
6490
|
-
*/
|
|
6491
|
-
/// ///////////////////////////////////////////////////////////
|
|
6492
|
-
|
|
6493
|
-
_context14.next = 4;
|
|
6774
|
+
_context9.next = 4;
|
|
6494
6775
|
return createMessageTable(now, true);
|
|
6495
6776
|
|
|
6496
6777
|
case 4:
|
|
6497
|
-
messageTable =
|
|
6778
|
+
messageTable = _context9.sent;
|
|
6498
6779
|
div.appendChild(messageTable);
|
|
6780
|
+
div.refresh = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
6781
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
6782
|
+
while (1) {
|
|
6783
|
+
switch (_context8.prev = _context8.next) {
|
|
6784
|
+
case 0:
|
|
6785
|
+
_context8.next = 2;
|
|
6786
|
+
return addNewChatDocumentIfNewDay(new Date());
|
|
6787
|
+
|
|
6788
|
+
case 2:
|
|
6789
|
+
syncMessages(chatChannel, messageTable); // @@ livemessagetable??
|
|
6790
|
+
|
|
6791
|
+
desktopNotification(chatChannel);
|
|
6792
|
+
|
|
6793
|
+
case 4:
|
|
6794
|
+
case "end":
|
|
6795
|
+
return _context8.stop();
|
|
6796
|
+
}
|
|
6797
|
+
}
|
|
6798
|
+
}, _callee8);
|
|
6799
|
+
})); // The short chat version the live update listening is done in the pane but we do it in the widget @@
|
|
6499
6800
|
|
|
6500
|
-
div.refresh
|
|
6501
|
-
// only the last messageTable is live
|
|
6502
|
-
addNewTableIfNewDay(new Date()).then(function () {
|
|
6503
|
-
syncMessages(chatChannel, messageTable);
|
|
6504
|
-
desktopNotification(chatChannel);
|
|
6505
|
-
});
|
|
6506
|
-
}; // The short chat version fors live update in the pane but we do it in the widget
|
|
6507
|
-
|
|
6801
|
+
_logic.store.updater.addDownstreamChangeListener(chatDocument, div.refresh); // Live update
|
|
6508
6802
|
|
|
6509
|
-
kb.updater.addDownstreamChangeListener(chatDocument, div.refresh); // Live update
|
|
6510
6803
|
|
|
6511
6804
|
liveMessageTable = messageTable;
|
|
6512
6805
|
latest.messageTable = liveMessageTable;
|
|
6513
|
-
return
|
|
6806
|
+
return _context9.abrupt("return", messageTable);
|
|
6514
6807
|
|
|
6515
6808
|
case 11:
|
|
6516
6809
|
case "end":
|
|
6517
|
-
return
|
|
6810
|
+
return _context9.stop();
|
|
6518
6811
|
}
|
|
6519
6812
|
}
|
|
6520
|
-
},
|
|
6813
|
+
}, _callee9);
|
|
6521
6814
|
}));
|
|
6522
6815
|
return _appendCurrentMessages.apply(this, arguments);
|
|
6523
6816
|
};
|
|
@@ -6526,19 +6819,18 @@ function _infiniteMessageArea() {
|
|
|
6526
6819
|
return _appendCurrentMessages.apply(this, arguments);
|
|
6527
6820
|
};
|
|
6528
6821
|
|
|
6529
|
-
|
|
6530
|
-
|
|
6822
|
+
_addNewChatDocumentIfNewDay = function _addNewChatDocumentIf2() {
|
|
6823
|
+
_addNewChatDocumentIfNewDay = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
6531
6824
|
var newChatDocument, oldChatDocument, sts;
|
|
6532
|
-
return _regenerator["default"].wrap(function
|
|
6825
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
6533
6826
|
while (1) {
|
|
6534
|
-
switch (
|
|
6827
|
+
switch (_context7.prev = _context7.next) {
|
|
6535
6828
|
case 0:
|
|
6536
|
-
// let now = new Date()
|
|
6537
6829
|
// @@ Remove listener from previous table as it is now static
|
|
6538
|
-
newChatDocument = dateFolder.leafDocumentFromDate(
|
|
6830
|
+
newChatDocument = dateFolder.leafDocumentFromDate(new Date());
|
|
6539
6831
|
|
|
6540
6832
|
if (newChatDocument.sameTerm(latest.messageTable.chatDocument)) {
|
|
6541
|
-
|
|
6833
|
+
_context7.next = 7;
|
|
6542
6834
|
break;
|
|
6543
6835
|
}
|
|
6544
6836
|
|
|
@@ -6549,36 +6841,37 @@ function _infiniteMessageArea() {
|
|
|
6549
6841
|
}
|
|
6550
6842
|
|
|
6551
6843
|
oldChatDocument = latest.messageTable.chatDocument;
|
|
6552
|
-
|
|
6844
|
+
_context7.next = 6;
|
|
6553
6845
|
return appendCurrentMessages();
|
|
6554
6846
|
|
|
6555
6847
|
case 6:
|
|
6556
6848
|
// Adding a link in the document will ping listeners to add the new block too
|
|
6557
|
-
if (!
|
|
6849
|
+
if (!_logic.store.holds(oldChatDocument, ns.rdfs('seeAlso'), newChatDocument, oldChatDocument)) {
|
|
6558
6850
|
sts = [$rdf.st(oldChatDocument, ns.rdfs('seeAlso'), newChatDocument, oldChatDocument)];
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6851
|
+
|
|
6852
|
+
try {
|
|
6853
|
+
_logic.store.updater.update([], sts);
|
|
6854
|
+
} catch (err) {
|
|
6855
|
+
alert('Unable to link old chat file to new one:' + err);
|
|
6856
|
+
}
|
|
6564
6857
|
}
|
|
6565
6858
|
|
|
6566
6859
|
case 7:
|
|
6567
6860
|
case "end":
|
|
6568
|
-
return
|
|
6861
|
+
return _context7.stop();
|
|
6569
6862
|
}
|
|
6570
6863
|
}
|
|
6571
|
-
},
|
|
6864
|
+
}, _callee7);
|
|
6572
6865
|
}));
|
|
6573
|
-
return
|
|
6866
|
+
return _addNewChatDocumentIfNewDay.apply(this, arguments);
|
|
6574
6867
|
};
|
|
6575
6868
|
|
|
6576
|
-
|
|
6577
|
-
return
|
|
6869
|
+
addNewChatDocumentIfNewDay = function _addNewChatDocumentIf() {
|
|
6870
|
+
return _addNewChatDocumentIfNewDay.apply(this, arguments);
|
|
6578
6871
|
};
|
|
6579
6872
|
|
|
6580
6873
|
renderMessageTable = function _renderMessageTable(date, live) {
|
|
6581
|
-
var
|
|
6874
|
+
var scrollBacstoreutton;
|
|
6582
6875
|
var scrollForwardButton; /// ///////////////// Scroll down adding more above
|
|
6583
6876
|
|
|
6584
6877
|
function extendBackwards() {
|
|
@@ -6586,23 +6879,23 @@ function _infiniteMessageArea() {
|
|
|
6586
6879
|
}
|
|
6587
6880
|
|
|
6588
6881
|
function _extendBackwards() {
|
|
6589
|
-
_extendBackwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
6882
|
+
_extendBackwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
6590
6883
|
var done;
|
|
6591
|
-
return _regenerator["default"].wrap(function
|
|
6884
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
6592
6885
|
while (1) {
|
|
6593
|
-
switch (
|
|
6886
|
+
switch (_context.prev = _context.next) {
|
|
6594
6887
|
case 0:
|
|
6595
|
-
|
|
6888
|
+
_context.next = 2;
|
|
6596
6889
|
return insertPreviousMessages(true);
|
|
6597
6890
|
|
|
6598
6891
|
case 2:
|
|
6599
|
-
done =
|
|
6892
|
+
done = _context.sent;
|
|
6600
6893
|
|
|
6601
6894
|
if (done) {
|
|
6602
|
-
if (
|
|
6603
|
-
|
|
6895
|
+
if (scrollBacstoreutton) {
|
|
6896
|
+
scrollBacstoreutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + 'noun_T-Block_1114655_000000.svg'); // T
|
|
6604
6897
|
|
|
6605
|
-
|
|
6898
|
+
scrollBacstoreutton.disabled = true;
|
|
6606
6899
|
}
|
|
6607
6900
|
|
|
6608
6901
|
messageTable.initial = true;
|
|
@@ -6610,67 +6903,67 @@ function _infiniteMessageArea() {
|
|
|
6610
6903
|
messageTable.extendedBack = true;
|
|
6611
6904
|
}
|
|
6612
6905
|
|
|
6613
|
-
|
|
6614
|
-
return
|
|
6906
|
+
setScrollBacstoreuttonIcon();
|
|
6907
|
+
return _context.abrupt("return", done);
|
|
6615
6908
|
|
|
6616
6909
|
case 6:
|
|
6617
6910
|
case "end":
|
|
6618
|
-
return
|
|
6911
|
+
return _context.stop();
|
|
6619
6912
|
}
|
|
6620
6913
|
}
|
|
6621
|
-
},
|
|
6914
|
+
}, _callee);
|
|
6622
6915
|
}));
|
|
6623
6916
|
return _extendBackwards.apply(this, arguments);
|
|
6624
6917
|
}
|
|
6625
6918
|
|
|
6626
|
-
function
|
|
6627
|
-
if (!
|
|
6919
|
+
function setScrollBacstoreuttonIcon() {
|
|
6920
|
+
if (!scrollBacstoreutton) {
|
|
6628
6921
|
return;
|
|
6629
6922
|
}
|
|
6630
6923
|
|
|
6631
6924
|
var sense = messageTable.extendedBack ? !newestFirst : newestFirst;
|
|
6632
6925
|
var scrollBackIcon = messageTable.initial ? 'noun_T-Block_1114655_000000.svg' : getScrollbackIcon(sense);
|
|
6633
|
-
|
|
6926
|
+
scrollBacstoreutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollBackIcon);
|
|
6634
6927
|
|
|
6635
6928
|
function getScrollbackIcon(sense) {
|
|
6636
6929
|
return sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
6637
6930
|
}
|
|
6638
6931
|
}
|
|
6639
6932
|
|
|
6640
|
-
function
|
|
6641
|
-
return
|
|
6933
|
+
function scrollBacstoreuttonHandler(_x8) {
|
|
6934
|
+
return _scrollBacstoreuttonHandler.apply(this, arguments);
|
|
6642
6935
|
} /// ////////////// Scroll up adding more below
|
|
6643
6936
|
|
|
6644
6937
|
|
|
6645
|
-
function
|
|
6646
|
-
|
|
6647
|
-
return _regenerator["default"].wrap(function
|
|
6938
|
+
function _scrollBacstoreuttonHandler() {
|
|
6939
|
+
_scrollBacstoreuttonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
|
|
6940
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
6648
6941
|
while (1) {
|
|
6649
|
-
switch (
|
|
6942
|
+
switch (_context2.prev = _context2.next) {
|
|
6650
6943
|
case 0:
|
|
6651
6944
|
if (!messageTable.extendedBack) {
|
|
6652
|
-
|
|
6945
|
+
_context2.next = 6;
|
|
6653
6946
|
break;
|
|
6654
6947
|
}
|
|
6655
6948
|
|
|
6656
6949
|
removePreviousMessages(true, messageTable);
|
|
6657
6950
|
messageTable.extendedBack = false;
|
|
6658
|
-
|
|
6659
|
-
|
|
6951
|
+
setScrollBacstoreuttonIcon();
|
|
6952
|
+
_context2.next = 8;
|
|
6660
6953
|
break;
|
|
6661
6954
|
|
|
6662
6955
|
case 6:
|
|
6663
|
-
|
|
6956
|
+
_context2.next = 8;
|
|
6664
6957
|
return extendBackwards();
|
|
6665
6958
|
|
|
6666
6959
|
case 8:
|
|
6667
6960
|
case "end":
|
|
6668
|
-
return
|
|
6961
|
+
return _context2.stop();
|
|
6669
6962
|
}
|
|
6670
6963
|
}
|
|
6671
|
-
},
|
|
6964
|
+
}, _callee2);
|
|
6672
6965
|
}));
|
|
6673
|
-
return
|
|
6966
|
+
return _scrollBacstoreuttonHandler.apply(this, arguments);
|
|
6674
6967
|
}
|
|
6675
6968
|
|
|
6676
6969
|
function extendForwards() {
|
|
@@ -6678,20 +6971,20 @@ function _infiniteMessageArea() {
|
|
|
6678
6971
|
}
|
|
6679
6972
|
|
|
6680
6973
|
function _extendForwards() {
|
|
6681
|
-
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
6974
|
+
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
6682
6975
|
var done;
|
|
6683
|
-
return _regenerator["default"].wrap(function
|
|
6976
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
6684
6977
|
while (1) {
|
|
6685
|
-
switch (
|
|
6978
|
+
switch (_context3.prev = _context3.next) {
|
|
6686
6979
|
case 0:
|
|
6687
|
-
|
|
6980
|
+
_context3.next = 2;
|
|
6688
6981
|
return insertPreviousMessages(false);
|
|
6689
6982
|
|
|
6690
6983
|
case 2:
|
|
6691
|
-
done =
|
|
6984
|
+
done = _context3.sent;
|
|
6692
6985
|
|
|
6693
6986
|
if (done) {
|
|
6694
|
-
scrollForwardButton.firstChild.setAttribute('src',
|
|
6987
|
+
scrollForwardButton.firstChild.setAttribute('src', _iconBase.icons.iconBase + 'noun_T-Block_1114655_000000.svg');
|
|
6695
6988
|
scrollForwardButton.disabled = true;
|
|
6696
6989
|
messageTable["final"] = true;
|
|
6697
6990
|
} else {
|
|
@@ -6699,14 +6992,14 @@ function _infiniteMessageArea() {
|
|
|
6699
6992
|
}
|
|
6700
6993
|
|
|
6701
6994
|
setScrollForwardButtonIcon();
|
|
6702
|
-
return
|
|
6995
|
+
return _context3.abrupt("return", done);
|
|
6703
6996
|
|
|
6704
6997
|
case 6:
|
|
6705
6998
|
case "end":
|
|
6706
|
-
return
|
|
6999
|
+
return _context3.stop();
|
|
6707
7000
|
}
|
|
6708
7001
|
}
|
|
6709
|
-
},
|
|
7002
|
+
}, _callee3);
|
|
6710
7003
|
}));
|
|
6711
7004
|
return _extendForwards.apply(this, arguments);
|
|
6712
7005
|
}
|
|
@@ -6715,37 +7008,48 @@ function _infiniteMessageArea() {
|
|
|
6715
7008
|
var sense = messageTable.extendedForwards ? !newestFirst : newestFirst; // noun_T-Block_1114657_000000.svg
|
|
6716
7009
|
|
|
6717
7010
|
var scrollForwardIcon = messageTable["final"] ? 'noun_T-Block_1114657_000000.svg' : getScrollForwardButtonIcon(sense);
|
|
6718
|
-
scrollForwardButton.firstChild.setAttribute('src',
|
|
7011
|
+
scrollForwardButton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollForwardIcon);
|
|
6719
7012
|
|
|
6720
7013
|
function getScrollForwardButtonIcon(sense) {
|
|
6721
7014
|
return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
6722
7015
|
}
|
|
6723
7016
|
}
|
|
6724
7017
|
|
|
6725
|
-
function scrollForwardButtonHandler(
|
|
7018
|
+
function scrollForwardButtonHandler(_x9) {
|
|
6726
7019
|
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
6727
7020
|
} /// ///////////////////////
|
|
6728
7021
|
|
|
7022
|
+
/*
|
|
7023
|
+
options = options || {}
|
|
7024
|
+
options.authorDateOnLeft = true
|
|
7025
|
+
const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now
|
|
7026
|
+
const channelObject = new ChatChannel(chatChannel, options)
|
|
7027
|
+
const dateFolder = channelObject.dateFolder
|
|
7028
|
+
const div = dom.createElement('div')
|
|
7029
|
+
const statusArea = div.appendChild(dom.createElement('div'))
|
|
7030
|
+
const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff
|
|
7031
|
+
*/
|
|
7032
|
+
|
|
6729
7033
|
|
|
6730
7034
|
function _scrollForwardButtonHandler() {
|
|
6731
|
-
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
6732
|
-
return _regenerator["default"].wrap(function
|
|
7035
|
+
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
|
|
7036
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
6733
7037
|
while (1) {
|
|
6734
|
-
switch (
|
|
7038
|
+
switch (_context4.prev = _context4.next) {
|
|
6735
7039
|
case 0:
|
|
6736
7040
|
if (!messageTable.extendedForwards) {
|
|
6737
|
-
|
|
7041
|
+
_context4.next = 6;
|
|
6738
7042
|
break;
|
|
6739
7043
|
}
|
|
6740
7044
|
|
|
6741
7045
|
removePreviousMessages(false, messageTable);
|
|
6742
7046
|
messageTable.extendedForwards = false;
|
|
6743
7047
|
setScrollForwardButtonIcon();
|
|
6744
|
-
|
|
7048
|
+
_context4.next = 9;
|
|
6745
7049
|
break;
|
|
6746
7050
|
|
|
6747
7051
|
case 6:
|
|
6748
|
-
|
|
7052
|
+
_context4.next = 8;
|
|
6749
7053
|
return extendForwards();
|
|
6750
7054
|
|
|
6751
7055
|
case 8:
|
|
@@ -6754,10 +7058,10 @@ function _infiniteMessageArea() {
|
|
|
6754
7058
|
|
|
6755
7059
|
case 9:
|
|
6756
7060
|
case "end":
|
|
6757
|
-
return
|
|
7061
|
+
return _context4.stop();
|
|
6758
7062
|
}
|
|
6759
7063
|
}
|
|
6760
|
-
},
|
|
7064
|
+
}, _callee4);
|
|
6761
7065
|
}));
|
|
6762
7066
|
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
6763
7067
|
}
|
|
@@ -6777,7 +7081,7 @@ function _infiniteMessageArea() {
|
|
|
6777
7081
|
messageTable["final"] = true;
|
|
6778
7082
|
liveMessageTable = messageTable;
|
|
6779
7083
|
latest.messageTable = messageTable;
|
|
6780
|
-
var tr =
|
|
7084
|
+
var tr = (0, _message.renderMessageEditor)(channelObject, messageTable, userContext, options);
|
|
6781
7085
|
|
|
6782
7086
|
if (newestFirst) {
|
|
6783
7087
|
messageTable.insertBefore(tr, messageTable.firstChild); // If newestFirst
|
|
@@ -6792,27 +7096,27 @@ function _infiniteMessageArea() {
|
|
|
6792
7096
|
|
|
6793
7097
|
|
|
6794
7098
|
if (options.infinite) {
|
|
6795
|
-
var
|
|
6796
|
-
var
|
|
7099
|
+
var scrollBacstoreuttonTR = dom.createElement('tr');
|
|
7100
|
+
var scrollBacstoreuttonCell = scrollBacstoreuttonTR.appendChild(dom.createElement('td')); // up traingles: noun_1369237.svg
|
|
6797
7101
|
// down triangles: noun_1369241.svg
|
|
6798
7102
|
|
|
6799
7103
|
var scrollBackIcon = newestFirst ? 'noun_1369241.svg' : 'noun_1369237.svg'; // down and up arrows respoctively
|
|
6800
7104
|
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
7105
|
+
scrollBacstoreutton = widgets.button(dom, _iconBase.icons.iconBase + scrollBackIcon, 'Previous messages ...');
|
|
7106
|
+
scrollBacstoreuttonCell.style = 'width:3em; height:3em;';
|
|
7107
|
+
scrollBacstoreutton.addEventListener('click', scrollBacstoreuttonHandler, false);
|
|
6804
7108
|
messageTable.extendedBack = false;
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
var dateCell =
|
|
7109
|
+
scrollBacstoreuttonCell.appendChild(scrollBacstoreutton);
|
|
7110
|
+
setScrollBacstoreuttonIcon();
|
|
7111
|
+
var dateCell = scrollBacstoreuttonTR.appendChild(dom.createElement('td'));
|
|
6808
7112
|
dateCell.style = 'text-align: center; vertical-align: middle; color: #888; font-style: italic;';
|
|
6809
|
-
dateCell.textContent =
|
|
7113
|
+
dateCell.textContent = widgets.shortDate(date.toISOString(), true); // no time, only date
|
|
6810
7114
|
// @@@@@@@@@@@ todo move this button to other end of message cell, o
|
|
6811
7115
|
|
|
6812
|
-
var scrollForwardButtonCell =
|
|
7116
|
+
var scrollForwardButtonCell = scrollBacstoreuttonTR.appendChild(dom.createElement('td'));
|
|
6813
7117
|
var scrollForwardIcon = newestFirst ? 'noun_1369241.svg' : 'noun_1369237.svg'; // down and up arrows respoctively
|
|
6814
7118
|
|
|
6815
|
-
scrollForwardButton =
|
|
7119
|
+
scrollForwardButton = widgets.button(dom, _iconBase.icons.iconBase + scrollForwardIcon, 'Later messages ...');
|
|
6816
7120
|
scrollForwardButtonCell.appendChild(scrollForwardButton);
|
|
6817
7121
|
scrollForwardButtonCell.style = 'width:3em; height:3em;';
|
|
6818
7122
|
scrollForwardButton.addEventListener('click', scrollForwardButtonHandler, false);
|
|
@@ -6822,13 +7126,13 @@ function _infiniteMessageArea() {
|
|
|
6822
7126
|
|
|
6823
7127
|
if (!newestFirst) {
|
|
6824
7128
|
// opposite end from the entry field
|
|
6825
|
-
messageTable.insertBefore(
|
|
7129
|
+
messageTable.insertBefore(scrollBacstoreuttonTR, messageTable.firstChild); // If not newestFirst
|
|
6826
7130
|
} else {
|
|
6827
|
-
messageTable.appendChild(
|
|
7131
|
+
messageTable.appendChild(scrollBacstoreuttonTR); // newestFirst
|
|
6828
7132
|
}
|
|
6829
7133
|
}
|
|
6830
7134
|
|
|
6831
|
-
var sts =
|
|
7135
|
+
var sts = _logic.store.statementsMatching(null, ns.wf('message'), null, chatDocument);
|
|
6832
7136
|
|
|
6833
7137
|
if (!live && sts.length === 0) {// not todays
|
|
6834
7138
|
// no need buttomns at the moment
|
|
@@ -6845,57 +7149,57 @@ function _infiniteMessageArea() {
|
|
|
6845
7149
|
};
|
|
6846
7150
|
|
|
6847
7151
|
_createMessageTable = function _createMessageTable3() {
|
|
6848
|
-
_createMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
7152
|
+
_createMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(date, live) {
|
|
6849
7153
|
var chatDocument, messageTable, statusTR;
|
|
6850
|
-
return _regenerator["default"].wrap(function
|
|
7154
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
6851
7155
|
while (1) {
|
|
6852
|
-
switch (
|
|
7156
|
+
switch (_context6.prev = _context6.next) {
|
|
6853
7157
|
case 0:
|
|
6854
7158
|
debug.log(' createMessageTable for ' + date);
|
|
6855
7159
|
chatDocument = dateFolder.leafDocumentFromDate(date);
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
return
|
|
7160
|
+
_context6.prev = 2;
|
|
7161
|
+
_context6.next = 5;
|
|
7162
|
+
return _logic.store.fetcher.load(chatDocument);
|
|
6859
7163
|
|
|
6860
7164
|
case 5:
|
|
6861
|
-
|
|
7165
|
+
_context6.next = 19;
|
|
6862
7166
|
break;
|
|
6863
7167
|
|
|
6864
7168
|
case 7:
|
|
6865
|
-
|
|
6866
|
-
|
|
7169
|
+
_context6.prev = 7;
|
|
7170
|
+
_context6.t0 = _context6["catch"](2);
|
|
6867
7171
|
messageTable = dom.createElement('table');
|
|
6868
7172
|
statusTR = messageTable.appendChild(dom.createElement('tr')); // ### find status in exception
|
|
6869
7173
|
|
|
6870
|
-
if (!(
|
|
6871
|
-
|
|
7174
|
+
if (!(_context6.t0.response && _context6.t0.response.status && _context6.t0.response.status === 404)) {
|
|
7175
|
+
_context6.next = 16;
|
|
6872
7176
|
break;
|
|
6873
7177
|
}
|
|
6874
7178
|
|
|
6875
7179
|
debug.log('Error 404 for chat file ' + chatDocument);
|
|
6876
|
-
return
|
|
7180
|
+
return _context6.abrupt("return", renderMessageTable(date, live));
|
|
6877
7181
|
|
|
6878
7182
|
case 16:
|
|
6879
7183
|
debug.log('*** Error NON 404 for chat file ' + chatDocument);
|
|
6880
|
-
statusTR.appendChild(
|
|
7184
|
+
statusTR.appendChild(widgets.errorMessageBlock(dom, _context6.t0, 'pink'));
|
|
6881
7185
|
|
|
6882
7186
|
case 18:
|
|
6883
|
-
return
|
|
7187
|
+
return _context6.abrupt("return", statusTR);
|
|
6884
7188
|
|
|
6885
7189
|
case 19:
|
|
6886
|
-
return
|
|
7190
|
+
return _context6.abrupt("return", renderMessageTable(date, live));
|
|
6887
7191
|
|
|
6888
7192
|
case 20:
|
|
6889
7193
|
case "end":
|
|
6890
|
-
return
|
|
7194
|
+
return _context6.stop();
|
|
6891
7195
|
}
|
|
6892
7196
|
}
|
|
6893
|
-
},
|
|
7197
|
+
}, _callee6, null, [[2, 7]]);
|
|
6894
7198
|
}));
|
|
6895
7199
|
return _createMessageTable.apply(this, arguments);
|
|
6896
7200
|
};
|
|
6897
7201
|
|
|
6898
|
-
createMessageTable = function _createMessageTable2(
|
|
7202
|
+
createMessageTable = function _createMessageTable2(_x6, _x7) {
|
|
6899
7203
|
return _createMessageTable.apply(this, arguments);
|
|
6900
7204
|
};
|
|
6901
7205
|
|
|
@@ -6917,38 +7221,38 @@ function _infiniteMessageArea() {
|
|
|
6917
7221
|
};
|
|
6918
7222
|
|
|
6919
7223
|
_insertPreviousMessages = function _insertPreviousMessag2() {
|
|
6920
|
-
_insertPreviousMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
7224
|
+
_insertPreviousMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(backwards) {
|
|
6921
7225
|
var extremity, date, live, todayDoc, doc, newMessageTable;
|
|
6922
|
-
return _regenerator["default"].wrap(function
|
|
7226
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
6923
7227
|
while (1) {
|
|
6924
|
-
switch (
|
|
7228
|
+
switch (_context5.prev = _context5.next) {
|
|
6925
7229
|
case 0:
|
|
6926
7230
|
extremity = backwards ? earliest : latest;
|
|
6927
7231
|
date = extremity.messageTable.date; // day in mssecs
|
|
6928
7232
|
|
|
6929
|
-
|
|
7233
|
+
_context5.next = 4;
|
|
6930
7234
|
return dateFolder.loadPrevious(date, backwards);
|
|
6931
7235
|
|
|
6932
7236
|
case 4:
|
|
6933
|
-
date =
|
|
7237
|
+
date = _context5.sent;
|
|
6934
7238
|
// backwards
|
|
6935
7239
|
debug.log("insertPreviousMessages: from ".concat(backwards ? 'backwards' : 'forwards', " loadPrevious: ").concat(date));
|
|
6936
7240
|
|
|
6937
7241
|
if (!(!date && !backwards && !liveMessageTable)) {
|
|
6938
|
-
|
|
7242
|
+
_context5.next = 9;
|
|
6939
7243
|
break;
|
|
6940
7244
|
}
|
|
6941
7245
|
|
|
6942
|
-
|
|
7246
|
+
_context5.next = 9;
|
|
6943
7247
|
return appendCurrentMessages();
|
|
6944
7248
|
|
|
6945
7249
|
case 9:
|
|
6946
7250
|
if (date) {
|
|
6947
|
-
|
|
7251
|
+
_context5.next = 11;
|
|
6948
7252
|
break;
|
|
6949
7253
|
}
|
|
6950
7254
|
|
|
6951
|
-
return
|
|
7255
|
+
return _context5.abrupt("return", true);
|
|
6952
7256
|
|
|
6953
7257
|
case 11:
|
|
6954
7258
|
// done
|
|
@@ -6960,11 +7264,11 @@ function _infiniteMessageArea() {
|
|
|
6960
7264
|
live = doc.sameTerm(todayDoc); // Is this todays?
|
|
6961
7265
|
}
|
|
6962
7266
|
|
|
6963
|
-
|
|
7267
|
+
_context5.next = 15;
|
|
6964
7268
|
return createMessageTable(date, live);
|
|
6965
7269
|
|
|
6966
7270
|
case 15:
|
|
6967
|
-
newMessageTable =
|
|
7271
|
+
newMessageTable = _context5.sent;
|
|
6968
7272
|
extremity.messageTable = newMessageTable; // move pointer to earliest
|
|
6969
7273
|
|
|
6970
7274
|
if (backwards ? newestFirst : !newestFirst) {
|
|
@@ -6975,30 +7279,30 @@ function _infiniteMessageArea() {
|
|
|
6975
7279
|
div.insertBefore(newMessageTable, div.firstChild);
|
|
6976
7280
|
}
|
|
6977
7281
|
|
|
6978
|
-
return
|
|
7282
|
+
return _context5.abrupt("return", live);
|
|
6979
7283
|
|
|
6980
7284
|
case 19:
|
|
6981
7285
|
case "end":
|
|
6982
|
-
return
|
|
7286
|
+
return _context5.stop();
|
|
6983
7287
|
}
|
|
6984
7288
|
}
|
|
6985
|
-
},
|
|
7289
|
+
}, _callee5);
|
|
6986
7290
|
}));
|
|
6987
7291
|
return _insertPreviousMessages.apply(this, arguments);
|
|
6988
7292
|
};
|
|
6989
7293
|
|
|
6990
|
-
insertPreviousMessages = function _insertPreviousMessag(
|
|
7294
|
+
insertPreviousMessages = function _insertPreviousMessag(_x5) {
|
|
6991
7295
|
return _insertPreviousMessages.apply(this, arguments);
|
|
6992
7296
|
};
|
|
6993
7297
|
|
|
6994
7298
|
addMessage = function _addMessage(message, messageTable) {
|
|
6995
|
-
var
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
(
|
|
7299
|
+
var latest = (0, _chatLogic.mostRecentVersion)(message); // const content = store.any(latest, ns.sioc('content'))
|
|
7300
|
+
|
|
7301
|
+
if ((0, _chatLogic.isDeleted)(latest) && !options.showDeletedMessages) {
|
|
7302
|
+
return; // ignore deleted messaged -- @@ could also leave a placeholder
|
|
7303
|
+
}
|
|
7304
|
+
|
|
7305
|
+
insertMessageIntoTable(channelObject, messageTable, message, messageTable.fresh, options, userContext); // fresh from elsewhere
|
|
7002
7306
|
};
|
|
7003
7307
|
|
|
7004
7308
|
syncMessages = function _syncMessages(about, messageTable) {
|
|
@@ -7011,9 +7315,10 @@ function _infiniteMessageArea() {
|
|
|
7011
7315
|
}
|
|
7012
7316
|
}
|
|
7013
7317
|
|
|
7014
|
-
var messages =
|
|
7318
|
+
var messages = _logic.store.statementsMatching(about, ns.wf('message'), null, messageTable.chatDocument).map(function (st) {
|
|
7015
7319
|
return st.object;
|
|
7016
7320
|
});
|
|
7321
|
+
|
|
7017
7322
|
var stored = {};
|
|
7018
7323
|
messages.forEach(function (m) {
|
|
7019
7324
|
stored[m.uri] = true;
|
|
@@ -7036,368 +7341,28 @@ function _infiniteMessageArea() {
|
|
|
7036
7341
|
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
|
|
7037
7342
|
if (ele.AJAR_subject) {
|
|
7038
7343
|
// Refresh thumbs up etc
|
|
7039
|
-
|
|
7344
|
+
widgets.refreshTree(ele); // Things inside may have changed too
|
|
7040
7345
|
}
|
|
7041
7346
|
}
|
|
7042
7347
|
};
|
|
7043
7348
|
|
|
7044
|
-
|
|
7045
|
-
var form = dom.createElement('tr');
|
|
7046
|
-
var lhs = dom.createElement('td');
|
|
7047
|
-
var middle = dom.createElement('td');
|
|
7048
|
-
var rhs = dom.createElement('td');
|
|
7049
|
-
form.appendChild(lhs);
|
|
7050
|
-
form.appendChild(middle);
|
|
7051
|
-
form.appendChild(rhs);
|
|
7052
|
-
form.AJAR_date = '9999-01-01T00:00:00Z'; // ISO format for field sort
|
|
7053
|
-
|
|
7054
|
-
var field, sendButton;
|
|
7055
|
-
|
|
7056
|
-
function sendMessage(_x6) {
|
|
7057
|
-
return _sendMessage.apply(this, arguments);
|
|
7058
|
-
} // sendMessage
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
function _sendMessage() {
|
|
7062
|
-
_sendMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(text) {
|
|
7063
|
-
var now, sts, timestamp, dateStamp, chatDocument, message, content, sendComplete;
|
|
7064
|
-
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
7065
|
-
while (1) {
|
|
7066
|
-
switch (_context6.prev = _context6.next) {
|
|
7067
|
-
case 0:
|
|
7068
|
-
sendComplete = function _sendComplete() {
|
|
7069
|
-
var bindings = {
|
|
7070
|
-
'?msg': message,
|
|
7071
|
-
'?content': content,
|
|
7072
|
-
'?date': dateStamp,
|
|
7073
|
-
'?creator': me
|
|
7074
|
-
};
|
|
7075
|
-
(0, _message.renderMessage)(liveMessageTable, bindings, false, options, userContext); // not green
|
|
7076
|
-
|
|
7077
|
-
if (!text) {
|
|
7078
|
-
field.value = ''; // clear from out for reuse
|
|
7079
|
-
|
|
7080
|
-
field.setAttribute('style', messageBodyStyle);
|
|
7081
|
-
field.disabled = false;
|
|
7082
|
-
field.scrollIntoView(newestFirst); // allign bottom (top)
|
|
7083
|
-
|
|
7084
|
-
field.focus(); // Start typing next line immediately
|
|
7085
|
-
|
|
7086
|
-
field.select();
|
|
7087
|
-
}
|
|
7088
|
-
};
|
|
7089
|
-
|
|
7090
|
-
now = new Date();
|
|
7091
|
-
_context6.next = 4;
|
|
7092
|
-
return addNewTableIfNewDay(now);
|
|
7093
|
-
|
|
7094
|
-
case 4:
|
|
7095
|
-
if (!text) {
|
|
7096
|
-
field.setAttribute('style', messageBodyStyle + 'color: #bbb;'); // pendingedit
|
|
7097
|
-
|
|
7098
|
-
field.disabled = true;
|
|
7099
|
-
}
|
|
7100
|
-
|
|
7101
|
-
sts = [];
|
|
7102
|
-
timestamp = '' + now.getTime();
|
|
7103
|
-
dateStamp = $rdf.term(now);
|
|
7104
|
-
chatDocument = dateFolder.leafDocumentFromDate(now);
|
|
7105
|
-
message = kb.sym(chatDocument.uri + '#' + 'Msg' + timestamp);
|
|
7106
|
-
content = kb.literal(text || field.value); // if (text) field.value = text No - don't destroy half-finsihed user input
|
|
7107
|
-
|
|
7108
|
-
sts.push(new $rdf.Statement(chatChannel, ns.wf('message'), message, chatDocument));
|
|
7109
|
-
sts.push(new $rdf.Statement(message, ns.sioc('content'), content, chatDocument));
|
|
7110
|
-
sts.push(new $rdf.Statement(message, DCT('created'), dateStamp, chatDocument));
|
|
7111
|
-
|
|
7112
|
-
if (me) {
|
|
7113
|
-
sts.push(new $rdf.Statement(message, ns.foaf('maker'), me, chatDocument));
|
|
7114
|
-
}
|
|
7115
|
-
|
|
7116
|
-
if (!(SERVER_MKDIRP_BUG && (kb.fetcher.requested[chatDocument.uri] === undefined || kb.fetcher.requested[chatDocument.uri] === 404))) {
|
|
7117
|
-
_context6.next = 19;
|
|
7118
|
-
break;
|
|
7119
|
-
}
|
|
7120
|
-
|
|
7121
|
-
debug.log('@@@ SERVER_MKDIRP_BUG: Should only happen once: create chat file: ' + chatDocument);
|
|
7122
|
-
_context6.next = 19;
|
|
7123
|
-
return createIfNotExists(chatDocument);
|
|
7124
|
-
|
|
7125
|
-
case 19:
|
|
7126
|
-
_context6.prev = 19;
|
|
7127
|
-
_context6.next = 22;
|
|
7128
|
-
return updater.update([], sts);
|
|
7129
|
-
|
|
7130
|
-
case 22:
|
|
7131
|
-
_context6.next = 28;
|
|
7132
|
-
break;
|
|
7133
|
-
|
|
7134
|
-
case 24:
|
|
7135
|
-
_context6.prev = 24;
|
|
7136
|
-
_context6.t0 = _context6["catch"](19);
|
|
7137
|
-
form.appendChild(UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + _context6.t0));
|
|
7138
|
-
return _context6.abrupt("return");
|
|
7139
|
-
|
|
7140
|
-
case 28:
|
|
7141
|
-
sendComplete();
|
|
7142
|
-
|
|
7143
|
-
case 29:
|
|
7144
|
-
case "end":
|
|
7145
|
-
return _context6.stop();
|
|
7146
|
-
}
|
|
7147
|
-
}
|
|
7148
|
-
}, _callee6, null, [[19, 24]]);
|
|
7149
|
-
}));
|
|
7150
|
-
return _sendMessage.apply(this, arguments);
|
|
7151
|
-
}
|
|
7152
|
-
|
|
7153
|
-
form.appendChild(dom.createElement('br')); // DRAG AND DROP
|
|
7154
|
-
|
|
7155
|
-
function droppedFileHandler(files) {
|
|
7156
|
-
var base = messageTable.chatDocument.dir().uri;
|
|
7157
|
-
UI.widgets.uploadFiles(kb.fetcher, files, base + 'Files', base + 'Pictures', /*#__PURE__*/function () {
|
|
7158
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(theFile, destURI) {
|
|
7159
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
7160
|
-
while (1) {
|
|
7161
|
-
switch (_context2.prev = _context2.next) {
|
|
7162
|
-
case 0:
|
|
7163
|
-
_context2.next = 2;
|
|
7164
|
-
return sendMessage(destURI);
|
|
7165
|
-
|
|
7166
|
-
case 2:
|
|
7167
|
-
case "end":
|
|
7168
|
-
return _context2.stop();
|
|
7169
|
-
}
|
|
7170
|
-
}
|
|
7171
|
-
}, _callee2);
|
|
7172
|
-
}));
|
|
7173
|
-
|
|
7174
|
-
return function (_x7, _x8) {
|
|
7175
|
-
return _ref.apply(this, arguments);
|
|
7176
|
-
};
|
|
7177
|
-
}());
|
|
7178
|
-
} // When a set of URIs are dropped on the field
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
var droppedURIHandler = /*#__PURE__*/function () {
|
|
7182
|
-
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(uris) {
|
|
7183
|
-
var _iterator, _step, uri;
|
|
7184
|
-
|
|
7185
|
-
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
7186
|
-
while (1) {
|
|
7187
|
-
switch (_context3.prev = _context3.next) {
|
|
7188
|
-
case 0:
|
|
7189
|
-
_iterator = _createForOfIteratorHelper(uris);
|
|
7190
|
-
_context3.prev = 1;
|
|
7191
|
-
|
|
7192
|
-
_iterator.s();
|
|
7193
|
-
|
|
7194
|
-
case 3:
|
|
7195
|
-
if ((_step = _iterator.n()).done) {
|
|
7196
|
-
_context3.next = 9;
|
|
7197
|
-
break;
|
|
7198
|
-
}
|
|
7199
|
-
|
|
7200
|
-
uri = _step.value;
|
|
7201
|
-
_context3.next = 7;
|
|
7202
|
-
return sendMessage(uri);
|
|
7203
|
-
|
|
7204
|
-
case 7:
|
|
7205
|
-
_context3.next = 3;
|
|
7206
|
-
break;
|
|
7207
|
-
|
|
7208
|
-
case 9:
|
|
7209
|
-
_context3.next = 14;
|
|
7210
|
-
break;
|
|
7211
|
-
|
|
7212
|
-
case 11:
|
|
7213
|
-
_context3.prev = 11;
|
|
7214
|
-
_context3.t0 = _context3["catch"](1);
|
|
7215
|
-
|
|
7216
|
-
_iterator.e(_context3.t0);
|
|
7217
|
-
|
|
7218
|
-
case 14:
|
|
7219
|
-
_context3.prev = 14;
|
|
7220
|
-
|
|
7221
|
-
_iterator.f();
|
|
7222
|
-
|
|
7223
|
-
return _context3.finish(14);
|
|
7224
|
-
|
|
7225
|
-
case 17:
|
|
7226
|
-
case "end":
|
|
7227
|
-
return _context3.stop();
|
|
7228
|
-
}
|
|
7229
|
-
}
|
|
7230
|
-
}, _callee3, null, [[1, 11, 14, 17]]);
|
|
7231
|
-
}));
|
|
7232
|
-
|
|
7233
|
-
return function droppedURIHandler(_x9) {
|
|
7234
|
-
return _ref2.apply(this, arguments);
|
|
7235
|
-
};
|
|
7236
|
-
}(); // When we are actually logged on
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
function turnOnInput() {
|
|
7240
|
-
if (options.menuHandler && menuButton) {
|
|
7241
|
-
var menuOptions = {
|
|
7242
|
-
me: me,
|
|
7243
|
-
dom: dom,
|
|
7244
|
-
div: div,
|
|
7245
|
-
newBase: messageTable.chatDocument.dir().uri
|
|
7246
|
-
};
|
|
7247
|
-
menuButton.addEventListener('click', function (event) {
|
|
7248
|
-
options.menuHandler(event, chatChannel, menuOptions);
|
|
7249
|
-
}, false);
|
|
7250
|
-
} // Turn on message input
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
(0, _message.creatorAndDate)(lhs, me, '', null);
|
|
7254
|
-
field = dom.createElement('textarea');
|
|
7255
|
-
middle.innerHTML = '';
|
|
7256
|
-
middle.appendChild(field);
|
|
7257
|
-
field.rows = 3; // field.cols = 40
|
|
7258
|
-
|
|
7259
|
-
field.setAttribute('style', messageBodyStyle + 'background-color: #eef;'); // Trap the Enter BEFORE it is used ti make a newline
|
|
7260
|
-
|
|
7261
|
-
field.addEventListener('keydown', /*#__PURE__*/function () {
|
|
7262
|
-
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(e) {
|
|
7263
|
-
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
7264
|
-
while (1) {
|
|
7265
|
-
switch (_context4.prev = _context4.next) {
|
|
7266
|
-
case 0:
|
|
7267
|
-
if (!(e.keyCode === 13)) {
|
|
7268
|
-
_context4.next = 4;
|
|
7269
|
-
break;
|
|
7270
|
-
}
|
|
7271
|
-
|
|
7272
|
-
if (e.altKey) {
|
|
7273
|
-
_context4.next = 4;
|
|
7274
|
-
break;
|
|
7275
|
-
}
|
|
7276
|
-
|
|
7277
|
-
_context4.next = 4;
|
|
7278
|
-
return sendMessage();
|
|
7279
|
-
|
|
7280
|
-
case 4:
|
|
7281
|
-
case "end":
|
|
7282
|
-
return _context4.stop();
|
|
7283
|
-
}
|
|
7284
|
-
}
|
|
7285
|
-
}, _callee4);
|
|
7286
|
-
}));
|
|
7287
|
-
|
|
7288
|
-
return function (_x10) {
|
|
7289
|
-
return _ref3.apply(this, arguments);
|
|
7290
|
-
};
|
|
7291
|
-
}(), false);
|
|
7292
|
-
UI.widgets.makeDropTarget(field, droppedURIHandler, droppedFileHandler);
|
|
7293
|
-
rhs.innerHTML = '';
|
|
7294
|
-
sendButton = UI.widgets.button(dom, UI.icons.iconBase + 'noun_383448.svg', 'Send');
|
|
7295
|
-
sendButton.setAttribute('style', UI.style.buttonStyle + 'float: right;');
|
|
7296
|
-
sendButton.addEventListener('click', function (_event) {
|
|
7297
|
-
return sendMessage();
|
|
7298
|
-
}, false);
|
|
7299
|
-
rhs.appendChild(sendButton);
|
|
7300
|
-
var chatDocument = dateFolder.leafDocumentFromDate(new Date());
|
|
7301
|
-
var imageDoc;
|
|
7302
|
-
|
|
7303
|
-
function getImageDoc() {
|
|
7304
|
-
imageDoc = kb.sym(chatDocument.dir().uri + 'Image_' + Date.now() + '.png');
|
|
7305
|
-
return imageDoc;
|
|
7306
|
-
}
|
|
7307
|
-
|
|
7308
|
-
function tookPicture(_x11) {
|
|
7309
|
-
return _tookPicture.apply(this, arguments);
|
|
7310
|
-
}
|
|
7311
|
-
|
|
7312
|
-
function _tookPicture() {
|
|
7313
|
-
_tookPicture = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(imageDoc) {
|
|
7314
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
7315
|
-
while (1) {
|
|
7316
|
-
switch (_context5.prev = _context5.next) {
|
|
7317
|
-
case 0:
|
|
7318
|
-
if (!imageDoc) {
|
|
7319
|
-
_context5.next = 3;
|
|
7320
|
-
break;
|
|
7321
|
-
}
|
|
7322
|
-
|
|
7323
|
-
_context5.next = 3;
|
|
7324
|
-
return sendMessage(imageDoc.uri);
|
|
7325
|
-
|
|
7326
|
-
case 3:
|
|
7327
|
-
case "end":
|
|
7328
|
-
return _context5.stop();
|
|
7329
|
-
}
|
|
7330
|
-
}
|
|
7331
|
-
}, _callee5);
|
|
7332
|
-
}));
|
|
7333
|
-
return _tookPicture.apply(this, arguments);
|
|
7334
|
-
}
|
|
7335
|
-
|
|
7336
|
-
middle.appendChild(UI.media.cameraButton(dom, kb, getImageDoc, tookPicture));
|
|
7337
|
-
UI.pad.recordParticipation(chatChannel, chatChannel.doc()); // participation =
|
|
7338
|
-
} // turn on inpuut
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
var context = {
|
|
7342
|
-
div: middle,
|
|
7343
|
-
dom: dom
|
|
7344
|
-
};
|
|
7345
|
-
UI.authn.logIn(context).then(function (context) {
|
|
7346
|
-
me = context.me;
|
|
7347
|
-
turnOnInput();
|
|
7348
|
-
Object.assign(context, userContext);
|
|
7349
|
-
(0, _bookmarks.findBookmarkDocument)(context).then(function (context) {
|
|
7350
|
-
debug.log('Bookmark file: ' + context.bookmarkDocument);
|
|
7351
|
-
});
|
|
7352
|
-
});
|
|
7353
|
-
return form;
|
|
7354
|
-
};
|
|
7355
|
-
|
|
7356
|
-
kb = kb || UI.store;
|
|
7357
|
-
ns = UI.ns;
|
|
7358
|
-
WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#');
|
|
7359
|
-
DCT = $rdf.Namespace('http://purl.org/dc/terms/'); // const POSIX = $rdf.Namespace('http://www.w3.org/ns/posix/stat#')
|
|
7360
|
-
|
|
7349
|
+
// Body of main function
|
|
7361
7350
|
options = options || {};
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
dateFolder = new _dateFolder.DateFolder(chatChannel, 'chat.ttl');
|
|
7365
|
-
options.authorAboveContent = true; // var participation // An object tracking users use and prefs
|
|
7351
|
+
options.authorDateOnLeft = false; // @@ make a user optiosn
|
|
7366
7352
|
|
|
7367
|
-
|
|
7368
|
-
// 'font-size: 100%; margin: 0.1em 1em 0.1em 1em; background-color: white; white-space: pre-wrap; padding: 0.1em;'
|
|
7353
|
+
newestFirst = options.newestFirst === '1' || options.newestFirst === true; // hack for now
|
|
7369
7354
|
|
|
7355
|
+
channelObject = new _chatLogic.ChatChannel(chatChannel, options);
|
|
7356
|
+
dateFolder = channelObject.dateFolder;
|
|
7370
7357
|
div = dom.createElement('div');
|
|
7358
|
+
channelObject.div = div;
|
|
7371
7359
|
statusArea = div.appendChild(dom.createElement('div'));
|
|
7372
7360
|
userContext = {
|
|
7373
7361
|
dom: dom,
|
|
7374
7362
|
statusArea: statusArea,
|
|
7375
7363
|
div: statusArea
|
|
7376
7364
|
}; // logged on state, pointers to user's stuff
|
|
7377
|
-
|
|
7378
|
-
updater = UI.store.updater;
|
|
7379
|
-
/** Does a file exist on the web?
|
|
7380
|
-
* @returns {Boolean}
|
|
7381
|
-
*/
|
|
7382
|
-
|
|
7383
|
-
/*
|
|
7384
|
-
async function documentExists (doc) {
|
|
7385
|
-
try {
|
|
7386
|
-
await kb.fetcher.load(doc)
|
|
7387
|
-
} catch (err) {
|
|
7388
|
-
if (err.response.status === 404) {
|
|
7389
|
-
return false
|
|
7390
|
-
} else {
|
|
7391
|
-
debug.log('documentExists: doc load error NOT 404: ' + doc + ': ' + err)
|
|
7392
|
-
throw err
|
|
7393
|
-
}
|
|
7394
|
-
}
|
|
7395
|
-
return true
|
|
7396
|
-
}
|
|
7397
|
-
*/
|
|
7398
|
-
|
|
7399
|
-
/* Form for a new message
|
|
7400
|
-
*/
|
|
7365
|
+
// const messageTable = dom.createElement('table') // @@ check does this go in renderMessageTable
|
|
7401
7366
|
|
|
7402
7367
|
earliest = {
|
|
7403
7368
|
messageTable: null
|
|
@@ -7407,18 +7372,18 @@ function _infiniteMessageArea() {
|
|
|
7407
7372
|
messageTable: null
|
|
7408
7373
|
};
|
|
7409
7374
|
lock = false;
|
|
7410
|
-
|
|
7375
|
+
_context12.next = 30;
|
|
7411
7376
|
return loadInitialContent();
|
|
7412
7377
|
|
|
7413
|
-
case
|
|
7414
|
-
return
|
|
7378
|
+
case 30:
|
|
7379
|
+
return _context12.abrupt("return", div);
|
|
7415
7380
|
|
|
7416
|
-
case
|
|
7381
|
+
case 31:
|
|
7417
7382
|
case "end":
|
|
7418
|
-
return
|
|
7383
|
+
return _context12.stop();
|
|
7419
7384
|
}
|
|
7420
7385
|
}
|
|
7421
|
-
},
|
|
7386
|
+
}, _callee12);
|
|
7422
7387
|
}));
|
|
7423
7388
|
return _infiniteMessageArea.apply(this, arguments);
|
|
7424
7389
|
}
|
|
@@ -7436,6 +7401,8 @@ function _infiniteMessageArea() {
|
|
|
7436
7401
|
"use strict";
|
|
7437
7402
|
|
|
7438
7403
|
|
|
7404
|
+
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
|
|
7405
|
+
|
|
7439
7406
|
var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js");
|
|
7440
7407
|
|
|
7441
7408
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -7444,10 +7411,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7444
7411
|
exports.creatorAndDate = creatorAndDate;
|
|
7445
7412
|
exports.creatorAndDateHorizontal = creatorAndDateHorizontal;
|
|
7446
7413
|
exports.elementForImageURI = elementForImageURI;
|
|
7447
|
-
exports.
|
|
7414
|
+
exports.renderMessageEditor = renderMessageEditor;
|
|
7415
|
+
exports.renderMessageRow = renderMessageRow;
|
|
7416
|
+
exports.switchToEditor = switchToEditor;
|
|
7417
|
+
|
|
7418
|
+
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"));
|
|
7419
|
+
|
|
7420
|
+
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
|
|
7421
|
+
|
|
7422
|
+
var _infinite = __webpack_require__(/*! ./infinite */ "./lib/chat/infinite.js");
|
|
7448
7423
|
|
|
7449
7424
|
var _messageTools = __webpack_require__(/*! ./messageTools */ "./lib/chat/messageTools.js");
|
|
7450
7425
|
|
|
7426
|
+
var _bookmarks = __webpack_require__(/*! ./bookmarks */ "./lib/chat/bookmarks.js");
|
|
7427
|
+
|
|
7428
|
+
var _chatLogic = __webpack_require__(/*! ./chatLogic */ "./lib/chat/chatLogic.js");
|
|
7429
|
+
|
|
7430
|
+
var debug = _interopRequireWildcard(__webpack_require__(/*! ../debug */ "./lib/debug.js"));
|
|
7431
|
+
|
|
7451
7432
|
var _index = __webpack_require__(/*! ../authn/index */ "./lib/authn/index.js");
|
|
7452
7433
|
|
|
7453
7434
|
var _iconBase = __webpack_require__(/*! ../iconBase */ "./lib/iconBase.js");
|
|
@@ -7460,8 +7441,6 @@ var ns = _interopRequireWildcard(__webpack_require__(/*! ../ns */ "./lib/ns.js")
|
|
|
7460
7441
|
|
|
7461
7442
|
var pad = _interopRequireWildcard(__webpack_require__(/*! ../pad */ "./lib/pad.js"));
|
|
7462
7443
|
|
|
7463
|
-
var rdf = _interopRequireWildcard(__webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js"));
|
|
7464
|
-
|
|
7465
7444
|
var style = _interopRequireWildcard(__webpack_require__(/*! ../style */ "./lib/style.js"));
|
|
7466
7445
|
|
|
7467
7446
|
var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ "./lib/utils/index.js"));
|
|
@@ -7472,31 +7451,17 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
7472
7451
|
|
|
7473
7452
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
7474
7453
|
|
|
7475
|
-
|
|
7476
|
-
* Contains the [[renderMessage]] function,
|
|
7477
|
-
* along with [[elementForImageURI]],
|
|
7478
|
-
* [[creatorAndDate]], and [[creatorAndDateHorizontal]]
|
|
7479
|
-
* @packageDocumentation
|
|
7480
|
-
*/
|
|
7454
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
7481
7455
|
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
var
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
media: _index2.media,
|
|
7489
|
-
pad: pad,
|
|
7490
|
-
rdf: rdf,
|
|
7491
|
-
store: _logic.store,
|
|
7492
|
-
style: style,
|
|
7493
|
-
utils: utils,
|
|
7494
|
-
widgets: widgets
|
|
7495
|
-
};
|
|
7496
|
-
var dom = UI.dom || window.document; // const kb = UI.store
|
|
7456
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7457
|
+
|
|
7458
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
7459
|
+
|
|
7460
|
+
// const UI = { authn, icons, ns, media, pad, rdf, store, style, utils, widgets }
|
|
7461
|
+
var dom = window.document; // const store = store
|
|
7497
7462
|
|
|
7498
|
-
var messageBodyStyle =
|
|
7499
|
-
var label =
|
|
7463
|
+
var messageBodyStyle = style.messageBodyStyle;
|
|
7464
|
+
var label = utils.label;
|
|
7500
7465
|
/**
|
|
7501
7466
|
* HTML component for an image
|
|
7502
7467
|
*/
|
|
@@ -7509,14 +7474,14 @@ function elementForImageURI(imageUri, options) {
|
|
|
7509
7474
|
height = ('' + options.inlineImageHeightEms).trim();
|
|
7510
7475
|
}
|
|
7511
7476
|
|
|
7512
|
-
img.setAttribute('style', 'max-height: ' + height + 'em; border-radius: 1em; margin: 0.7em;'); //
|
|
7477
|
+
img.setAttribute('style', 'max-height: ' + height + 'em; border-radius: 1em; margin: 0.7em;'); // widgets.makeDropTarget(img, handleURIsDroppedOnMugshot, droppedFileHandler)
|
|
7513
7478
|
|
|
7514
7479
|
if (imageUri) img.setAttribute('src', imageUri);
|
|
7515
7480
|
var anchor = dom.createElement('a');
|
|
7516
7481
|
anchor.setAttribute('href', imageUri);
|
|
7517
7482
|
anchor.setAttribute('target', 'images');
|
|
7518
7483
|
anchor.appendChild(img);
|
|
7519
|
-
|
|
7484
|
+
widgets.makeDraggable(img, $rdf.sym(imageUri));
|
|
7520
7485
|
return anchor;
|
|
7521
7486
|
}
|
|
7522
7487
|
|
|
@@ -7526,7 +7491,7 @@ var anchor = function anchor(text, term) {
|
|
|
7526
7491
|
|
|
7527
7492
|
if (term && term.uri) {
|
|
7528
7493
|
a.setAttribute('href', term.uri);
|
|
7529
|
-
a.addEventListener('click',
|
|
7494
|
+
a.addEventListener('click', widgets.openHrefInOutlineMode, true);
|
|
7530
7495
|
a.setAttribute('style', 'color: #3B5998; text-decoration: none; '); // font-weight: bold
|
|
7531
7496
|
}
|
|
7532
7497
|
|
|
@@ -7535,7 +7500,8 @@ var anchor = function anchor(text, term) {
|
|
|
7535
7500
|
};
|
|
7536
7501
|
|
|
7537
7502
|
function nick(person) {
|
|
7538
|
-
var s =
|
|
7503
|
+
var s = _logic.store.any(person, ns.foaf('nick'));
|
|
7504
|
+
|
|
7539
7505
|
if (s) return '' + s.value;
|
|
7540
7506
|
return '' + label(person);
|
|
7541
7507
|
}
|
|
@@ -7549,7 +7515,7 @@ function creatorAndDate(td1, creator, date, message) {
|
|
|
7549
7515
|
var nickAnchor = td1.appendChild(anchor(nick(creator), creator));
|
|
7550
7516
|
|
|
7551
7517
|
if (creator.uri) {
|
|
7552
|
-
|
|
7518
|
+
_logic.store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (_ok, _body) {
|
|
7553
7519
|
nickAnchor.textContent = nick(creator);
|
|
7554
7520
|
});
|
|
7555
7521
|
}
|
|
@@ -7567,7 +7533,7 @@ function creatorAndDateHorizontal(td1, creator, date, message) {
|
|
|
7567
7533
|
var nickAnchor = td1.appendChild(anchor(label(creator), creator));
|
|
7568
7534
|
|
|
7569
7535
|
if (creator.uri) {
|
|
7570
|
-
|
|
7536
|
+
_logic.store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (_ok, _body) {
|
|
7571
7537
|
nickAnchor.textContent = nick(creator);
|
|
7572
7538
|
});
|
|
7573
7539
|
}
|
|
@@ -7578,65 +7544,54 @@ function creatorAndDateHorizontal(td1, creator, date, message) {
|
|
|
7578
7544
|
td1.appendChild(dom.createElement('br'));
|
|
7579
7545
|
}
|
|
7580
7546
|
/**
|
|
7581
|
-
* Renders a chat message
|
|
7547
|
+
* Renders a chat message, read-only mode
|
|
7582
7548
|
*/
|
|
7583
7549
|
|
|
7584
7550
|
|
|
7585
|
-
function
|
|
7551
|
+
function renderMessageRow(channelObject, message, fresh, options, userContext) {
|
|
7586
7552
|
var colorizeByAuthor = options.colorizeByAuthor === '1' || options.colorizeByAuthor === true;
|
|
7587
|
-
var creator = bindings['?creator'];
|
|
7588
|
-
var message = bindings['?msg'];
|
|
7589
|
-
var date = bindings['?date'];
|
|
7590
|
-
var content = bindings['?content'];
|
|
7591
|
-
var dateString = date.value;
|
|
7592
|
-
var messageRow = dom.createElement('tr');
|
|
7593
|
-
messageRow.AJAR_date = dateString;
|
|
7594
|
-
messageRow.AJAR_subject = message;
|
|
7595
7553
|
|
|
7596
|
-
|
|
7597
|
-
messageRow.style.backgroundColor = 'yellow';
|
|
7598
|
-
options.selectedElement = messageRow;
|
|
7599
|
-
messageTable.selectedElement = messageRow;
|
|
7600
|
-
}
|
|
7554
|
+
var creator = _logic.store.any(message, ns.foaf('maker'));
|
|
7601
7555
|
|
|
7602
|
-
var
|
|
7556
|
+
var date = _logic.store.any(message, ns.dct('created'));
|
|
7603
7557
|
|
|
7604
|
-
|
|
7605
|
-
if (!ele) {
|
|
7606
|
-
// empty
|
|
7607
|
-
break;
|
|
7608
|
-
}
|
|
7558
|
+
var latestVersion = (0, _chatLogic.mostRecentVersion)(message);
|
|
7609
7559
|
|
|
7610
|
-
|
|
7560
|
+
var content = _logic.store.any(latestVersion, ns.sioc('content'));
|
|
7611
7561
|
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
}
|
|
7617
|
-
}
|
|
7562
|
+
var originalMessage = (0, _chatLogic.originalVersion)(message);
|
|
7563
|
+
var edited = !message.sameTerm(originalMessage);
|
|
7564
|
+
|
|
7565
|
+
var sortDate = _logic.store.the(originalMessage, ns.dct('created'), null, originalMessage.doc()); // In message
|
|
7618
7566
|
|
|
7619
|
-
if (!done) {
|
|
7620
|
-
messageTable.appendChild(messageRow);
|
|
7621
|
-
}
|
|
7622
7567
|
|
|
7568
|
+
var messageRow = dom.createElement('tr');
|
|
7569
|
+
messageRow.AJAR_date = sortDate.value;
|
|
7570
|
+
messageRow.AJAR_subject = message;
|
|
7623
7571
|
var td1 = dom.createElement('td');
|
|
7624
7572
|
messageRow.appendChild(td1);
|
|
7625
7573
|
|
|
7626
|
-
if (options.
|
|
7574
|
+
if (!options.authorDateOnLeft) {
|
|
7627
7575
|
var img = dom.createElement('img');
|
|
7628
7576
|
img.setAttribute('style', 'max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;');
|
|
7629
|
-
|
|
7577
|
+
widgets.setImage(img, creator);
|
|
7630
7578
|
td1.appendChild(img);
|
|
7631
7579
|
} else {
|
|
7632
|
-
creatorAndDate(td1, creator,
|
|
7580
|
+
creatorAndDate(td1, creator, widgets.shortDate(sortDate.value), message);
|
|
7581
|
+
}
|
|
7582
|
+
|
|
7583
|
+
var bothDates = widgets.shortDate(sortDate.value);
|
|
7584
|
+
|
|
7585
|
+
if (edited) {
|
|
7586
|
+
bothDates += ' ... ' + widgets.shortDate(date.value);
|
|
7633
7587
|
} // Render the content ot the message itself
|
|
7634
7588
|
|
|
7635
7589
|
|
|
7636
7590
|
var td2 = messageRow.appendChild(dom.createElement('td'));
|
|
7637
7591
|
|
|
7638
|
-
if (options.
|
|
7639
|
-
creatorAndDateHorizontal(td2, creator,
|
|
7592
|
+
if (!options.authorDateOnLeft) {
|
|
7593
|
+
creatorAndDateHorizontal(td2, creator, bothDates, // widgets.shortDate(dateString)
|
|
7594
|
+
message);
|
|
7640
7595
|
}
|
|
7641
7596
|
|
|
7642
7597
|
var text = content.value.trim();
|
|
@@ -7666,7 +7621,7 @@ function renderMessage(messageTable, bindings, fresh, options, userContext) {
|
|
|
7666
7621
|
}
|
|
7667
7622
|
|
|
7668
7623
|
if (para) {
|
|
7669
|
-
var bgcolor = colorizeByAuthor ?
|
|
7624
|
+
var bgcolor = colorizeByAuthor ? pad.lightColorHash(creator) : getBgColor(fresh);
|
|
7670
7625
|
para.setAttribute('style', messageBodyStyle + 'background-color: ' + bgcolor + ';');
|
|
7671
7626
|
}
|
|
7672
7627
|
|
|
@@ -7685,7 +7640,7 @@ function renderMessage(messageTable, bindings, fresh, options, userContext) {
|
|
|
7685
7640
|
|
|
7686
7641
|
var td3 = dom.createElement('td');
|
|
7687
7642
|
messageRow.appendChild(td3);
|
|
7688
|
-
var toolsButton =
|
|
7643
|
+
var toolsButton = widgets.button(dom, _iconBase.icons.iconBase + 'noun_243787.svg', '...');
|
|
7689
7644
|
td3.appendChild(toolsButton);
|
|
7690
7645
|
toolsButton.addEventListener('click', function (_event) {
|
|
7691
7646
|
if (messageRow.toolTR) {
|
|
@@ -7696,7 +7651,7 @@ function renderMessage(messageTable, bindings, fresh, options, userContext) {
|
|
|
7696
7651
|
}
|
|
7697
7652
|
|
|
7698
7653
|
var toolsTR = dom.createElement('tr');
|
|
7699
|
-
var tools = (0, _messageTools.messageToolbar)(message, messageRow, userContext);
|
|
7654
|
+
var tools = (0, _messageTools.messageToolbar)(message, messageRow, userContext, channelObject);
|
|
7700
7655
|
tools.style = 'border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;'; // @@ fix
|
|
7701
7656
|
|
|
7702
7657
|
if (messageRow.nextSibling) {
|
|
@@ -7715,6 +7670,390 @@ function renderMessage(messageTable, bindings, fresh, options, userContext) {
|
|
|
7715
7670
|
});
|
|
7716
7671
|
return messageRow;
|
|
7717
7672
|
}
|
|
7673
|
+
|
|
7674
|
+
function switchToEditor(messageRow, message, channelObject, userContext) {
|
|
7675
|
+
var messageTable = messageRow.parentNode;
|
|
7676
|
+
var editRow = renderMessageEditor(channelObject, messageTable, userContext, channelObject.options, (0, _chatLogic.mostRecentVersion)(message));
|
|
7677
|
+
messageTable.insertBefore(editRow, messageRow);
|
|
7678
|
+
editRow.originalRow = messageRow;
|
|
7679
|
+
messageRow.style.visibility = 'hidden'; // Hide the original message. unhide if user cancels edit
|
|
7680
|
+
}
|
|
7681
|
+
/* Control for a new message -- or editing an old message ***************
|
|
7682
|
+
*
|
|
7683
|
+
*/
|
|
7684
|
+
|
|
7685
|
+
|
|
7686
|
+
function renderMessageEditor(channelObject, messageTable, userContext, options, originalMessage) {
|
|
7687
|
+
function revertEditing(messageEditor) {
|
|
7688
|
+
messageEditor.originalRow.style.visibility = 'visible'; // restore read-only version
|
|
7689
|
+
|
|
7690
|
+
messageEditor.parentNode.removeChild(messageEditor);
|
|
7691
|
+
}
|
|
7692
|
+
|
|
7693
|
+
function handleFieldInput(_x) {
|
|
7694
|
+
return _handleFieldInput.apply(this, arguments);
|
|
7695
|
+
}
|
|
7696
|
+
|
|
7697
|
+
function _handleFieldInput() {
|
|
7698
|
+
_handleFieldInput = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(_event) {
|
|
7699
|
+
return _regenerator["default"].wrap(function _callee5$(_context6) {
|
|
7700
|
+
while (1) {
|
|
7701
|
+
switch (_context6.prev = _context6.next) {
|
|
7702
|
+
case 0:
|
|
7703
|
+
_context6.next = 2;
|
|
7704
|
+
return sendMessage(field.value, true);
|
|
7705
|
+
|
|
7706
|
+
case 2:
|
|
7707
|
+
case "end":
|
|
7708
|
+
return _context6.stop();
|
|
7709
|
+
}
|
|
7710
|
+
}
|
|
7711
|
+
}, _callee5);
|
|
7712
|
+
}));
|
|
7713
|
+
return _handleFieldInput.apply(this, arguments);
|
|
7714
|
+
}
|
|
7715
|
+
|
|
7716
|
+
function sendMessage(_x2, _x3) {
|
|
7717
|
+
return _sendMessage.apply(this, arguments);
|
|
7718
|
+
} // sendMessage
|
|
7719
|
+
// DRAG AND DROP
|
|
7720
|
+
|
|
7721
|
+
|
|
7722
|
+
function _sendMessage() {
|
|
7723
|
+
_sendMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(text, fromMainField) {
|
|
7724
|
+
var sendComplete, message, statusArea;
|
|
7725
|
+
return _regenerator["default"].wrap(function _callee6$(_context7) {
|
|
7726
|
+
while (1) {
|
|
7727
|
+
switch (_context7.prev = _context7.next) {
|
|
7728
|
+
case 0:
|
|
7729
|
+
sendComplete = function _sendComplete(message, _text2) {
|
|
7730
|
+
// const dateStamp = store.any(message, ns.dct('created'), null, message.doc())
|
|
7731
|
+
// const content = $rdf.literal(text2)
|
|
7732
|
+
(0, _infinite.insertMessageIntoTable)(channelObject, messageTable, message, false, options, userContext); // not green
|
|
7733
|
+
|
|
7734
|
+
if (originalMessage) {
|
|
7735
|
+
// editing another message
|
|
7736
|
+
var oldRow = messageEditor.originalRow; // oldRow.style.display = '' // restore read-only version, re-attack
|
|
7737
|
+
|
|
7738
|
+
if (oldRow.parentNode) {
|
|
7739
|
+
oldRow.parentNode.removeChild(oldRow); // No longer needed old version
|
|
7740
|
+
} else {
|
|
7741
|
+
debug.warn('No parentNode on old message ' + oldRow.textContent);
|
|
7742
|
+
oldRow.style.backgroundColor = '#fee';
|
|
7743
|
+
oldRow.style.visibility = 'hidden'; // @@ FIX THIS AND REMOVE FROM DOM INSTEAD
|
|
7744
|
+
}
|
|
7745
|
+
|
|
7746
|
+
messageEditor.parentNode.removeChild(messageEditor); // no longer need editor
|
|
7747
|
+
} else {
|
|
7748
|
+
if (fromMainField) {
|
|
7749
|
+
field.value = ''; // clear from out for reuse
|
|
7750
|
+
|
|
7751
|
+
field.setAttribute('style', messageBodyStyle);
|
|
7752
|
+
field.disabled = false;
|
|
7753
|
+
field.scrollIntoView(options.newestFirst); // allign bottom (top)
|
|
7754
|
+
|
|
7755
|
+
field.focus(); // Start typing next line immediately
|
|
7756
|
+
|
|
7757
|
+
field.select();
|
|
7758
|
+
}
|
|
7759
|
+
} // await channelObject.div.refresh() // Add new day if nec @@ add back
|
|
7760
|
+
|
|
7761
|
+
};
|
|
7762
|
+
|
|
7763
|
+
// const me = authn.currentUser() // Must be logged on or wuld have got login button
|
|
7764
|
+
if (fromMainField) {
|
|
7765
|
+
field.setAttribute('style', messageBodyStyle + 'color: #bbb;'); // pendingedit
|
|
7766
|
+
|
|
7767
|
+
field.disabled = true;
|
|
7768
|
+
}
|
|
7769
|
+
|
|
7770
|
+
_context7.prev = 2;
|
|
7771
|
+
_context7.next = 5;
|
|
7772
|
+
return channelObject.updateMessage(text, originalMessage);
|
|
7773
|
+
|
|
7774
|
+
case 5:
|
|
7775
|
+
message = _context7.sent;
|
|
7776
|
+
_context7.next = 13;
|
|
7777
|
+
break;
|
|
7778
|
+
|
|
7779
|
+
case 8:
|
|
7780
|
+
_context7.prev = 8;
|
|
7781
|
+
_context7.t0 = _context7["catch"](2);
|
|
7782
|
+
statusArea = userContext.statusArea || messageEditor;
|
|
7783
|
+
statusArea.appendChild(widgets.errorMessageBlock(dom, 'Error writing message: ' + _context7.t0));
|
|
7784
|
+
return _context7.abrupt("return");
|
|
7785
|
+
|
|
7786
|
+
case 13:
|
|
7787
|
+
sendComplete(message, text);
|
|
7788
|
+
|
|
7789
|
+
case 14:
|
|
7790
|
+
case "end":
|
|
7791
|
+
return _context7.stop();
|
|
7792
|
+
}
|
|
7793
|
+
}
|
|
7794
|
+
}, _callee6, null, [[2, 8]]);
|
|
7795
|
+
}));
|
|
7796
|
+
return _sendMessage.apply(this, arguments);
|
|
7797
|
+
}
|
|
7798
|
+
|
|
7799
|
+
function droppedFileHandler(files) {
|
|
7800
|
+
var base = messageTable.chatDocument.dir().uri;
|
|
7801
|
+
widgets.uploadFiles(_logic.store.fetcher, files, base + 'Files', base + 'Pictures', /*#__PURE__*/function () {
|
|
7802
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(theFile, destURI) {
|
|
7803
|
+
return _regenerator["default"].wrap(function _callee$(_context2) {
|
|
7804
|
+
while (1) {
|
|
7805
|
+
switch (_context2.prev = _context2.next) {
|
|
7806
|
+
case 0:
|
|
7807
|
+
_context2.next = 2;
|
|
7808
|
+
return sendMessage(destURI);
|
|
7809
|
+
|
|
7810
|
+
case 2:
|
|
7811
|
+
case "end":
|
|
7812
|
+
return _context2.stop();
|
|
7813
|
+
}
|
|
7814
|
+
}
|
|
7815
|
+
}, _callee);
|
|
7816
|
+
}));
|
|
7817
|
+
|
|
7818
|
+
return function (_x4, _x5) {
|
|
7819
|
+
return _ref.apply(this, arguments);
|
|
7820
|
+
};
|
|
7821
|
+
}());
|
|
7822
|
+
} // When a set of URIs are dropped on the field
|
|
7823
|
+
|
|
7824
|
+
|
|
7825
|
+
var droppedURIHandler = /*#__PURE__*/function () {
|
|
7826
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(uris) {
|
|
7827
|
+
var _iterator, _step, uri;
|
|
7828
|
+
|
|
7829
|
+
return _regenerator["default"].wrap(function _callee2$(_context3) {
|
|
7830
|
+
while (1) {
|
|
7831
|
+
switch (_context3.prev = _context3.next) {
|
|
7832
|
+
case 0:
|
|
7833
|
+
_iterator = _createForOfIteratorHelper(uris);
|
|
7834
|
+
_context3.prev = 1;
|
|
7835
|
+
|
|
7836
|
+
_iterator.s();
|
|
7837
|
+
|
|
7838
|
+
case 3:
|
|
7839
|
+
if ((_step = _iterator.n()).done) {
|
|
7840
|
+
_context3.next = 9;
|
|
7841
|
+
break;
|
|
7842
|
+
}
|
|
7843
|
+
|
|
7844
|
+
uri = _step.value;
|
|
7845
|
+
_context3.next = 7;
|
|
7846
|
+
return sendMessage(uri);
|
|
7847
|
+
|
|
7848
|
+
case 7:
|
|
7849
|
+
_context3.next = 3;
|
|
7850
|
+
break;
|
|
7851
|
+
|
|
7852
|
+
case 9:
|
|
7853
|
+
_context3.next = 14;
|
|
7854
|
+
break;
|
|
7855
|
+
|
|
7856
|
+
case 11:
|
|
7857
|
+
_context3.prev = 11;
|
|
7858
|
+
_context3.t0 = _context3["catch"](1);
|
|
7859
|
+
|
|
7860
|
+
_iterator.e(_context3.t0);
|
|
7861
|
+
|
|
7862
|
+
case 14:
|
|
7863
|
+
_context3.prev = 14;
|
|
7864
|
+
|
|
7865
|
+
_iterator.f();
|
|
7866
|
+
|
|
7867
|
+
return _context3.finish(14);
|
|
7868
|
+
|
|
7869
|
+
case 17:
|
|
7870
|
+
case "end":
|
|
7871
|
+
return _context3.stop();
|
|
7872
|
+
}
|
|
7873
|
+
}
|
|
7874
|
+
}, _callee2, null, [[1, 11, 14, 17]]);
|
|
7875
|
+
}));
|
|
7876
|
+
|
|
7877
|
+
return function droppedURIHandler(_x6) {
|
|
7878
|
+
return _ref2.apply(this, arguments);
|
|
7879
|
+
};
|
|
7880
|
+
}(); // When we are actually logged on
|
|
7881
|
+
|
|
7882
|
+
|
|
7883
|
+
function turnOnInput() {
|
|
7884
|
+
function getImageDoc() {
|
|
7885
|
+
imageDoc = $rdf.sym(chatDocument.dir().uri + 'Image_' + Date.now() + '.png');
|
|
7886
|
+
return imageDoc;
|
|
7887
|
+
}
|
|
7888
|
+
|
|
7889
|
+
function tookPicture(_x7) {
|
|
7890
|
+
return _tookPicture.apply(this, arguments);
|
|
7891
|
+
} // Body of turnOnInput
|
|
7892
|
+
|
|
7893
|
+
|
|
7894
|
+
function _tookPicture() {
|
|
7895
|
+
_tookPicture = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(imageDoc) {
|
|
7896
|
+
return _regenerator["default"].wrap(function _callee4$(_context5) {
|
|
7897
|
+
while (1) {
|
|
7898
|
+
switch (_context5.prev = _context5.next) {
|
|
7899
|
+
case 0:
|
|
7900
|
+
if (!imageDoc) {
|
|
7901
|
+
_context5.next = 3;
|
|
7902
|
+
break;
|
|
7903
|
+
}
|
|
7904
|
+
|
|
7905
|
+
_context5.next = 3;
|
|
7906
|
+
return sendMessage(imageDoc.uri);
|
|
7907
|
+
|
|
7908
|
+
case 3:
|
|
7909
|
+
case "end":
|
|
7910
|
+
return _context5.stop();
|
|
7911
|
+
}
|
|
7912
|
+
}
|
|
7913
|
+
}, _callee4);
|
|
7914
|
+
}));
|
|
7915
|
+
return _tookPicture.apply(this, arguments);
|
|
7916
|
+
}
|
|
7917
|
+
|
|
7918
|
+
var menuButton;
|
|
7919
|
+
|
|
7920
|
+
if (options.menuHandler) {
|
|
7921
|
+
var _menuButton = widgets.button(dom, _iconBase.icons.iconBase + 'noun_243787.svg', 'More');
|
|
7922
|
+
|
|
7923
|
+
_menuButton.setAttribute('style', style.buttonStyle + 'float: right;'); // menuButton.addEventListener('click', _event => sendMessage(), false) (done in turnoninput)
|
|
7924
|
+
|
|
7925
|
+
|
|
7926
|
+
rhs.appendChild(_menuButton);
|
|
7927
|
+
}
|
|
7928
|
+
|
|
7929
|
+
if (options.menuHandler && menuButton) {
|
|
7930
|
+
var _me = _index.authn.currentUser();
|
|
7931
|
+
|
|
7932
|
+
var menuOptions = {
|
|
7933
|
+
me: _me,
|
|
7934
|
+
dom: dom,
|
|
7935
|
+
div: null,
|
|
7936
|
+
// @@ was: div
|
|
7937
|
+
newBase: messageTable.chatDocument.dir().uri
|
|
7938
|
+
};
|
|
7939
|
+
menuButton.addEventListener('click', function (event) {
|
|
7940
|
+
options.menuHandler(event, channelObject.chatChannel, menuOptions);
|
|
7941
|
+
}, false);
|
|
7942
|
+
}
|
|
7943
|
+
|
|
7944
|
+
var me = _index.authn.currentUser(); // If already logged on
|
|
7945
|
+
|
|
7946
|
+
|
|
7947
|
+
creatorAndDate(lhs, me, '', null);
|
|
7948
|
+
field = dom.createElement('textarea');
|
|
7949
|
+
middle.innerHTML = '';
|
|
7950
|
+
middle.appendChild(field);
|
|
7951
|
+
field.rows = 3;
|
|
7952
|
+
|
|
7953
|
+
if (originalMessage) {
|
|
7954
|
+
field.value = _logic.store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc());
|
|
7955
|
+
} // field.cols = 40
|
|
7956
|
+
|
|
7957
|
+
|
|
7958
|
+
field.setAttribute('style', messageBodyStyle + 'background-color: #eef;'); // Trap the Enter BEFORE it is used ti make a newline
|
|
7959
|
+
|
|
7960
|
+
field.addEventListener('keydown', /*#__PURE__*/function () {
|
|
7961
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(e) {
|
|
7962
|
+
return _regenerator["default"].wrap(function _callee3$(_context4) {
|
|
7963
|
+
while (1) {
|
|
7964
|
+
switch (_context4.prev = _context4.next) {
|
|
7965
|
+
case 0:
|
|
7966
|
+
if (!(e.code === 'Enter')) {
|
|
7967
|
+
_context4.next = 4;
|
|
7968
|
+
break;
|
|
7969
|
+
}
|
|
7970
|
+
|
|
7971
|
+
if (!(!e.shiftKey && !options.shiftEnterSendsMessage || e.shiftKey && options.shiftEnterSendsMessage)) {
|
|
7972
|
+
_context4.next = 4;
|
|
7973
|
+
break;
|
|
7974
|
+
}
|
|
7975
|
+
|
|
7976
|
+
_context4.next = 4;
|
|
7977
|
+
return handleFieldInput(e);
|
|
7978
|
+
|
|
7979
|
+
case 4:
|
|
7980
|
+
case "end":
|
|
7981
|
+
return _context4.stop();
|
|
7982
|
+
}
|
|
7983
|
+
}
|
|
7984
|
+
}, _callee3);
|
|
7985
|
+
}));
|
|
7986
|
+
|
|
7987
|
+
return function (_x8) {
|
|
7988
|
+
return _ref3.apply(this, arguments);
|
|
7989
|
+
};
|
|
7990
|
+
}(), false);
|
|
7991
|
+
widgets.makeDropTarget(field, droppedURIHandler, droppedFileHandler);
|
|
7992
|
+
rhs.innerHTML = '';
|
|
7993
|
+
sendButton = widgets.button(dom, sendIcon, 'Send');
|
|
7994
|
+
sendButton.style["float"] = 'right';
|
|
7995
|
+
sendButton.addEventListener('click', function (_event) {
|
|
7996
|
+
return handleFieldInput();
|
|
7997
|
+
}, false);
|
|
7998
|
+
rhs.appendChild(sendButton);
|
|
7999
|
+
|
|
8000
|
+
if (originalMessage) {
|
|
8001
|
+
// Are we editing another message?
|
|
8002
|
+
var cancelButton = rhs.appendChild(widgets.cancelButton(dom));
|
|
8003
|
+
cancelButton.style["float"] = 'left'; // cancelButton.firstChild.style.opacity = '0.3' // moved to buttons
|
|
8004
|
+
|
|
8005
|
+
cancelButton.addEventListener('click', function (_event) {
|
|
8006
|
+
return revertEditing(messageEditor);
|
|
8007
|
+
}, false);
|
|
8008
|
+
rhs.appendChild(cancelButton);
|
|
8009
|
+
}
|
|
8010
|
+
|
|
8011
|
+
var chatDocument = channelObject.dateFolder.leafDocumentFromDate(new Date());
|
|
8012
|
+
var imageDoc;
|
|
8013
|
+
middle.appendChild(_index2.media.cameraButton(dom, _logic.store, getImageDoc, tookPicture));
|
|
8014
|
+
pad.recordParticipation(channelObject.channel, channelObject.channel.doc()); // participation =
|
|
8015
|
+
} // turn on inpuut
|
|
8016
|
+
// Body of renderMessageEditor
|
|
8017
|
+
|
|
8018
|
+
|
|
8019
|
+
var sortDate, sendIcon;
|
|
8020
|
+
|
|
8021
|
+
if (originalMessage) {
|
|
8022
|
+
sortDate = _logic.store.anyValue(originalMessage, ns.dct('created'), null, originalMessage.doc()); // text = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())
|
|
8023
|
+
|
|
8024
|
+
sendIcon = _iconBase.icons.iconBase + 'noun_1180158.svg'; // Green check
|
|
8025
|
+
// cancelIcon = icons.iconBase + 'noun_1180156.svg' // Black cross
|
|
8026
|
+
} else {
|
|
8027
|
+
sendIcon = _iconBase.icons.iconBase + 'noun_383448.svg';
|
|
8028
|
+
sortDate = '9999-01-01T00:00:00Z'; // ISO format for field sort
|
|
8029
|
+
// text = ''
|
|
8030
|
+
}
|
|
8031
|
+
|
|
8032
|
+
var messageEditor = dom.createElement('tr');
|
|
8033
|
+
var lhs = dom.createElement('td');
|
|
8034
|
+
var middle = dom.createElement('td');
|
|
8035
|
+
var rhs = dom.createElement('td');
|
|
8036
|
+
messageEditor.appendChild(lhs);
|
|
8037
|
+
messageEditor.appendChild(middle);
|
|
8038
|
+
messageEditor.appendChild(rhs);
|
|
8039
|
+
messageEditor.AJAR_date = sortDate; // messageEditor.appendChild(dom.createElement('br'))
|
|
8040
|
+
|
|
8041
|
+
var field, sendButton;
|
|
8042
|
+
var context = {
|
|
8043
|
+
div: middle,
|
|
8044
|
+
dom: dom
|
|
8045
|
+
};
|
|
8046
|
+
|
|
8047
|
+
_index.authn.logIn(context).then(function (context) {
|
|
8048
|
+
// me = context.me
|
|
8049
|
+
turnOnInput();
|
|
8050
|
+
Object.assign(context, userContext);
|
|
8051
|
+
(0, _bookmarks.findBookmarkDocument)(context).then(function (_context) {// console.log('Bookmark file: ' + context.bookmarkDocument)
|
|
8052
|
+
});
|
|
8053
|
+
});
|
|
8054
|
+
|
|
8055
|
+
return messageEditor;
|
|
8056
|
+
} // renderMessageEditor
|
|
7718
8057
|
//# sourceMappingURL=message.js.map
|
|
7719
8058
|
|
|
7720
8059
|
/***/ }),
|
|
@@ -7746,28 +8085,28 @@ var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/r
|
|
|
7746
8085
|
|
|
7747
8086
|
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js"));
|
|
7748
8087
|
|
|
8088
|
+
var debug = _interopRequireWildcard(__webpack_require__(/*! ../debug */ "./lib/debug.js"));
|
|
8089
|
+
|
|
7749
8090
|
var _index = __webpack_require__(/*! ../authn/index */ "./lib/authn/index.js");
|
|
7750
8091
|
|
|
7751
8092
|
var _iconBase = __webpack_require__(/*! ../iconBase */ "./lib/iconBase.js");
|
|
7752
8093
|
|
|
7753
8094
|
var _logic = __webpack_require__(/*! ../logic */ "./lib/logic.js");
|
|
7754
8095
|
|
|
7755
|
-
var _index2 = __webpack_require__(/*! ../media/index */ "./lib/media/index.js");
|
|
7756
|
-
|
|
7757
8096
|
var ns = _interopRequireWildcard(__webpack_require__(/*! ../ns */ "./lib/ns.js"));
|
|
7758
8097
|
|
|
7759
|
-
var pad = _interopRequireWildcard(__webpack_require__(/*! ../pad */ "./lib/pad.js"));
|
|
7760
|
-
|
|
7761
8098
|
var rdf = _interopRequireWildcard(__webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js"));
|
|
7762
8099
|
|
|
7763
|
-
var style = _interopRequireWildcard(__webpack_require__(/*! ../style */ "./lib/style.js"));
|
|
7764
|
-
|
|
7765
8100
|
var utils = _interopRequireWildcard(__webpack_require__(/*! ../utils */ "./lib/utils/index.js"));
|
|
7766
8101
|
|
|
7767
8102
|
var widgets = _interopRequireWildcard(__webpack_require__(/*! ../widgets */ "./lib/widgets/index.js"));
|
|
7768
8103
|
|
|
7769
8104
|
var _bookmarks = __webpack_require__(/*! ./bookmarks */ "./lib/chat/bookmarks.js");
|
|
7770
8105
|
|
|
8106
|
+
var _chatLogic = __webpack_require__(/*! ./chatLogic */ "./lib/chat/chatLogic.js");
|
|
8107
|
+
|
|
8108
|
+
var _message = __webpack_require__(/*! ./message */ "./lib/chat/message.js");
|
|
8109
|
+
|
|
7771
8110
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
7772
8111
|
|
|
7773
8112
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -7781,52 +8120,29 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
7781
8120
|
* If you made it originally: edit, delete, attach
|
|
7782
8121
|
* @packageDocumentation
|
|
7783
8122
|
*/
|
|
7784
|
-
|
|
7785
|
-
|
|
8123
|
+
// import { media } from '../media/index'
|
|
8124
|
+
// import * as pad from '../pad'
|
|
7786
8125
|
// pull in first avoid cross-refs
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
pad: pad,
|
|
7793
|
-
rdf: rdf,
|
|
7794
|
-
store: _logic.store,
|
|
7795
|
-
style: style,
|
|
7796
|
-
utils: utils,
|
|
7797
|
-
widgets: widgets
|
|
7798
|
-
};
|
|
7799
|
-
var dom = window.document;
|
|
7800
|
-
var kb = _logic.store; // const label = UI.utils.label
|
|
7801
|
-
// THE UNUSED ICONS are here as reminders for possible future functionality
|
|
8126
|
+
// import * as style from '../style'
|
|
8127
|
+
// import { infiniteMessageArea } from './infinite.js'
|
|
8128
|
+
// import { renderMessage, creatorAndDate } from './message'
|
|
8129
|
+
// import * as debug from '../debug'
|
|
8130
|
+
var dom = window.document; // THE UNUSED ICONS are here as reminders for possible future functionality
|
|
7802
8131
|
// const BOOKMARK_ICON = 'noun_45961.svg'
|
|
7803
8132
|
// const HEART_ICON = 'noun_130259.svg' -> Add this to my (private) favorites
|
|
7804
8133
|
// const MENU_ICON = 'noun_897914.svg'
|
|
7805
8134
|
// const PAPERCLIP_ICON = 'noun_25830.svg' -> add attachments to this message
|
|
7806
8135
|
// const PIN_ICON = 'noun_562340.svg' -> pin this message permanently in the chat UI
|
|
7807
|
-
|
|
8136
|
+
|
|
8137
|
+
var PENCIL_ICON = 'noun_253504.svg'; // edit a message
|
|
7808
8138
|
// const SPANNER_ICON = 'noun_344563.svg' -> settings
|
|
7809
8139
|
|
|
7810
8140
|
var THUMBS_UP_ICON = 'noun_1384132.svg';
|
|
7811
|
-
var THUMBS_DOWN_ICON = 'noun_1384135.svg';
|
|
7812
|
-
// @@@@ use the one in rdflib.js when it is avaiable and delete this
|
|
7813
|
-
|
|
7814
|
-
function updatePromise(del, ins) {
|
|
7815
|
-
return new Promise(function (resolve, reject) {
|
|
7816
|
-
kb.updater.update(del, ins, function (uri, ok, errorBody) {
|
|
7817
|
-
if (!ok) {
|
|
7818
|
-
reject(new Error(errorBody));
|
|
7819
|
-
} else {
|
|
7820
|
-
resolve();
|
|
7821
|
-
}
|
|
7822
|
-
}); // callback
|
|
7823
|
-
}); // promise
|
|
7824
|
-
}
|
|
8141
|
+
var THUMBS_DOWN_ICON = 'noun_1384135.svg';
|
|
7825
8142
|
/**
|
|
7826
8143
|
* Emoji in Unicode
|
|
7827
8144
|
*/
|
|
7828
8145
|
|
|
7829
|
-
|
|
7830
8146
|
var emoji = {};
|
|
7831
8147
|
emoji[ns.schema('AgreeAction')] = '👍';
|
|
7832
8148
|
emoji[ns.schema('DisagreeAction')] = '👎';
|
|
@@ -7837,9 +8153,11 @@ emoji[ns.schema('LikeAction')] = '❤️';
|
|
|
7837
8153
|
*/
|
|
7838
8154
|
|
|
7839
8155
|
function sentimentStrip(target, doc) {
|
|
7840
|
-
|
|
8156
|
+
// alain seems not used
|
|
8157
|
+
var latest = (0, _chatLogic.mostRecentVersion)(target);
|
|
8158
|
+
var actions = _logic.store.holds(latest, ns.schema('dateDeleted').value, null, latest.doc()) ? _logic.store.each(null, ns.schema('target'), target, doc) : [];
|
|
7841
8159
|
var sentiments = actions.map(function (a) {
|
|
7842
|
-
return
|
|
8160
|
+
return _logic.store.any(a, ns.rdf('type'), null, doc);
|
|
7843
8161
|
});
|
|
7844
8162
|
sentiments.sort();
|
|
7845
8163
|
var strings = sentiments.map(function (x) {
|
|
@@ -7860,9 +8178,9 @@ function sentimentStripLinked(target, doc) {
|
|
|
7860
8178
|
|
|
7861
8179
|
function refresh() {
|
|
7862
8180
|
strip.innerHTML = '';
|
|
7863
|
-
var actions =
|
|
8181
|
+
var actions = (0, _chatLogic.mostRecentVersion)(target).uri !== ns.schema('dateDeleted').uri ? _logic.store.each(null, ns.schema('target'), target, doc) : [];
|
|
7864
8182
|
var sentiments = actions.map(function (a) {
|
|
7865
|
-
return [
|
|
8183
|
+
return [_logic.store.any(a, ns.rdf('type'), null, doc), _logic.store.any(a, ns.schema('agent'), null, doc)];
|
|
7866
8184
|
});
|
|
7867
8185
|
sentiments.sort();
|
|
7868
8186
|
sentiments.forEach(function (ss) {
|
|
@@ -7893,74 +8211,156 @@ function sentimentStripLinked(target, doc) {
|
|
|
7893
8211
|
*/
|
|
7894
8212
|
|
|
7895
8213
|
|
|
7896
|
-
function messageToolbar(message, messageRow, userContext) {
|
|
7897
|
-
|
|
8214
|
+
function messageToolbar(message, messageRow, userContext, channelObject) {
|
|
8215
|
+
function deleteMessage() {
|
|
8216
|
+
return _deleteMessage.apply(this, arguments);
|
|
8217
|
+
}
|
|
7898
8218
|
|
|
7899
|
-
function
|
|
7900
|
-
|
|
8219
|
+
function _deleteMessage() {
|
|
8220
|
+
_deleteMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
8221
|
+
var author, msg, area;
|
|
8222
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
8223
|
+
while (1) {
|
|
8224
|
+
switch (_context2.prev = _context2.next) {
|
|
8225
|
+
case 0:
|
|
8226
|
+
author = _logic.store.any(message, ns.foaf('maker'));
|
|
8227
|
+
|
|
8228
|
+
if (me) {
|
|
8229
|
+
_context2.next = 5;
|
|
8230
|
+
break;
|
|
8231
|
+
}
|
|
8232
|
+
|
|
8233
|
+
alert('You can\'t delete the message, you are not logged in.');
|
|
8234
|
+
_context2.next = 22;
|
|
8235
|
+
break;
|
|
8236
|
+
|
|
8237
|
+
case 5:
|
|
8238
|
+
if (!me.sameTerm(author)) {
|
|
8239
|
+
_context2.next = 21;
|
|
8240
|
+
break;
|
|
8241
|
+
}
|
|
8242
|
+
|
|
8243
|
+
_context2.prev = 6;
|
|
8244
|
+
_context2.next = 9;
|
|
8245
|
+
return channelObject.deleteMessage(message);
|
|
8246
|
+
|
|
8247
|
+
case 9:
|
|
8248
|
+
_context2.next = 18;
|
|
8249
|
+
break;
|
|
8250
|
+
|
|
8251
|
+
case 11:
|
|
8252
|
+
_context2.prev = 11;
|
|
8253
|
+
_context2.t0 = _context2["catch"](6);
|
|
8254
|
+
msg = 'Error deleting messaage ' + _context2.t0;
|
|
8255
|
+
debug.warn(msg);
|
|
8256
|
+
alert(msg);
|
|
8257
|
+
area = userContext.statusArea || messageRow.parentNode;
|
|
8258
|
+
area.appendChild(widgets.errorMessageBlock(dom, msg));
|
|
8259
|
+
|
|
8260
|
+
case 18:
|
|
8261
|
+
messageRow.parentNode.removeChild(messageRow);
|
|
8262
|
+
_context2.next = 22;
|
|
8263
|
+
break;
|
|
8264
|
+
|
|
8265
|
+
case 21:
|
|
8266
|
+
alert('You can\'t delete the message, you are not logged in as the author, ' + author);
|
|
8267
|
+
|
|
8268
|
+
case 22:
|
|
8269
|
+
closeToolbar();
|
|
8270
|
+
|
|
8271
|
+
case 23:
|
|
8272
|
+
case "end":
|
|
8273
|
+
return _context2.stop();
|
|
8274
|
+
}
|
|
8275
|
+
}
|
|
8276
|
+
}, _callee2, null, [[6, 11]]);
|
|
8277
|
+
}));
|
|
8278
|
+
return _deleteMessage.apply(this, arguments);
|
|
7901
8279
|
}
|
|
7902
8280
|
|
|
7903
|
-
function
|
|
7904
|
-
return
|
|
7905
|
-
} //
|
|
8281
|
+
function editMessage(_x) {
|
|
8282
|
+
return _editMessage.apply(this, arguments);
|
|
8283
|
+
} // alain TODO allow chat owner to fully delete message + sentiments and replacing messages
|
|
7906
8284
|
|
|
7907
8285
|
|
|
7908
|
-
function
|
|
7909
|
-
|
|
8286
|
+
function _editMessage() {
|
|
8287
|
+
_editMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(messageRow) {
|
|
7910
8288
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
7911
8289
|
while (1) {
|
|
7912
8290
|
switch (_context3.prev = _context3.next) {
|
|
7913
8291
|
case 0:
|
|
7914
|
-
|
|
7915
|
-
|
|
8292
|
+
if (me.value === _logic.store.any(message, ns.foaf('maker')).value) {
|
|
8293
|
+
closeToolbar(); // edit is a one-off action
|
|
7916
8294
|
|
|
7917
|
-
|
|
8295
|
+
(0, _message.switchToEditor)(messageRow, message, channelObject, userContext);
|
|
8296
|
+
}
|
|
8297
|
+
|
|
8298
|
+
case 1:
|
|
7918
8299
|
case "end":
|
|
7919
8300
|
return _context3.stop();
|
|
7920
8301
|
}
|
|
7921
8302
|
}
|
|
7922
8303
|
}, _callee3);
|
|
7923
8304
|
}));
|
|
7924
|
-
return
|
|
8305
|
+
return _editMessage.apply(this, arguments);
|
|
7925
8306
|
}
|
|
7926
8307
|
|
|
7927
|
-
var
|
|
8308
|
+
var div = dom.createElement('div'); // is message deleted ?
|
|
7928
8309
|
|
|
7929
|
-
if (
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
8310
|
+
if ((0, _chatLogic.mostRecentVersion)(message).value === ns.schema('dateDeleted').value) return div;
|
|
8311
|
+
|
|
8312
|
+
function closeToolbar() {
|
|
8313
|
+
div.parentElement.parentElement.removeChild(div.parentElement); // remive the TR
|
|
8314
|
+
}
|
|
8315
|
+
|
|
8316
|
+
function deleteThingThen(_x2) {
|
|
8317
|
+
return _deleteThingThen.apply(this, arguments);
|
|
8318
|
+
} // Things only the original author can do
|
|
8319
|
+
|
|
8320
|
+
|
|
8321
|
+
function _deleteThingThen() {
|
|
8322
|
+
_deleteThingThen = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(x) {
|
|
8323
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
7933
8324
|
while (1) {
|
|
7934
|
-
switch (
|
|
8325
|
+
switch (_context4.prev = _context4.next) {
|
|
7935
8326
|
case 0:
|
|
7936
|
-
|
|
7937
|
-
return
|
|
8327
|
+
_context4.next = 2;
|
|
8328
|
+
return _logic.store.updater.update(_logic.store.connectedStatements(x), []);
|
|
7938
8329
|
|
|
7939
8330
|
case 2:
|
|
7940
|
-
closeToolbar();
|
|
7941
|
-
|
|
7942
|
-
case 3:
|
|
7943
8331
|
case "end":
|
|
7944
|
-
return
|
|
8332
|
+
return _context4.stop();
|
|
7945
8333
|
}
|
|
7946
8334
|
}
|
|
7947
|
-
},
|
|
7948
|
-
}))
|
|
7949
|
-
|
|
8335
|
+
}, _callee4);
|
|
8336
|
+
}));
|
|
8337
|
+
return _deleteThingThen.apply(this, arguments);
|
|
8338
|
+
}
|
|
8339
|
+
|
|
8340
|
+
var me = _index.authn.currentUser(); // If already logged on
|
|
8341
|
+
|
|
8342
|
+
|
|
8343
|
+
if (me && _logic.store.holds(message, ns.foaf('maker'), me)) {
|
|
8344
|
+
// button to delete the message
|
|
8345
|
+
div.appendChild(widgets.deleteButtonWithCheck(dom, div, 'message', deleteMessage)); // button to edit the message
|
|
8346
|
+
|
|
8347
|
+
div.appendChild(widgets.button(dom, _iconBase.icons.iconBase + PENCIL_ICON, 'edit', function () {
|
|
8348
|
+
return editMessage(messageRow);
|
|
8349
|
+
}));
|
|
7950
8350
|
} // if mine
|
|
7951
8351
|
// Things anyone can do if they have a bookmark list async
|
|
7952
8352
|
|
|
7953
8353
|
/*
|
|
7954
|
-
var
|
|
7955
|
-
if (
|
|
7956
|
-
div.appendChild(
|
|
8354
|
+
var bookmarstoreutton = await bookmarks.renderBookmarksButton(userContext)
|
|
8355
|
+
if (bookmarstoreutton) {
|
|
8356
|
+
div.appendChild(bookmarstoreutton)
|
|
7957
8357
|
}
|
|
7958
8358
|
*/
|
|
7959
8359
|
// Things anyone can do if they have a bookmark list
|
|
7960
8360
|
|
|
7961
8361
|
|
|
7962
|
-
(0, _bookmarks.renderBookmarksButton)(userContext).then(function (
|
|
7963
|
-
if (
|
|
8362
|
+
(0, _bookmarks.renderBookmarksButton)(userContext).then(function (bookmarstoreutton) {
|
|
8363
|
+
if (bookmarstoreutton) div.appendChild(bookmarstoreutton);
|
|
7964
8364
|
});
|
|
7965
8365
|
/** Button to allow user to express a sentiment (like, endorse, etc) about a target
|
|
7966
8366
|
*
|
|
@@ -7977,39 +8377,39 @@ function messageToolbar(message, messageRow, userContext) {
|
|
|
7977
8377
|
button.style.backgroundColor = action ? 'yellow' : 'white';
|
|
7978
8378
|
}
|
|
7979
8379
|
|
|
7980
|
-
var button =
|
|
7981
|
-
var
|
|
8380
|
+
var button = widgets.button(dom, icon, utils.label(actionClass), /*#__PURE__*/function () {
|
|
8381
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_event) {
|
|
7982
8382
|
var insertMe, dirty, i, a;
|
|
7983
|
-
return _regenerator["default"].wrap(function
|
|
8383
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
7984
8384
|
while (1) {
|
|
7985
|
-
switch (
|
|
8385
|
+
switch (_context.prev = _context.next) {
|
|
7986
8386
|
case 0:
|
|
7987
8387
|
if (!action) {
|
|
7988
|
-
|
|
8388
|
+
_context.next = 7;
|
|
7989
8389
|
break;
|
|
7990
8390
|
}
|
|
7991
8391
|
|
|
7992
|
-
|
|
8392
|
+
_context.next = 3;
|
|
7993
8393
|
return deleteThingThen(action);
|
|
7994
8394
|
|
|
7995
8395
|
case 3:
|
|
7996
8396
|
action = null;
|
|
7997
8397
|
setColor();
|
|
7998
|
-
|
|
8398
|
+
_context.next = 25;
|
|
7999
8399
|
break;
|
|
8000
8400
|
|
|
8001
8401
|
case 7:
|
|
8002
8402
|
// no action
|
|
8003
|
-
action =
|
|
8004
|
-
insertMe = [
|
|
8005
|
-
|
|
8006
|
-
return
|
|
8403
|
+
action = widgets.newThing(doc);
|
|
8404
|
+
insertMe = [rdf.st(action, ns.schema('agent'), context.me, doc), rdf.st(action, ns.rdf('type'), actionClass, doc), rdf.st(action, ns.schema('target'), target, doc)];
|
|
8405
|
+
_context.next = 11;
|
|
8406
|
+
return _logic.store.updater.update([], insertMe);
|
|
8007
8407
|
|
|
8008
8408
|
case 11:
|
|
8009
8409
|
setColor();
|
|
8010
8410
|
|
|
8011
8411
|
if (!mutuallyExclusive) {
|
|
8012
|
-
|
|
8412
|
+
_context.next = 25;
|
|
8013
8413
|
break;
|
|
8014
8414
|
}
|
|
8015
8415
|
|
|
@@ -8019,18 +8419,18 @@ function messageToolbar(message, messageRow, userContext) {
|
|
|
8019
8419
|
|
|
8020
8420
|
case 15:
|
|
8021
8421
|
if (!(i < mutuallyExclusive.length)) {
|
|
8022
|
-
|
|
8422
|
+
_context.next = 24;
|
|
8023
8423
|
break;
|
|
8024
8424
|
}
|
|
8025
8425
|
|
|
8026
8426
|
a = existingAction(mutuallyExclusive[i]);
|
|
8027
8427
|
|
|
8028
8428
|
if (!a) {
|
|
8029
|
-
|
|
8429
|
+
_context.next = 21;
|
|
8030
8430
|
break;
|
|
8031
8431
|
}
|
|
8032
8432
|
|
|
8033
|
-
|
|
8433
|
+
_context.next = 20;
|
|
8034
8434
|
return deleteThingThen(a);
|
|
8035
8435
|
|
|
8036
8436
|
case 20:
|
|
@@ -8039,34 +8439,35 @@ function messageToolbar(message, messageRow, userContext) {
|
|
|
8039
8439
|
|
|
8040
8440
|
case 21:
|
|
8041
8441
|
i++;
|
|
8042
|
-
|
|
8442
|
+
_context.next = 15;
|
|
8043
8443
|
break;
|
|
8044
8444
|
|
|
8045
8445
|
case 24:
|
|
8046
8446
|
if (dirty) {
|
|
8047
|
-
//
|
|
8048
|
-
|
|
8447
|
+
// widgets.refreshTree(button.parentNode) // requires them all to be immediate siblings
|
|
8448
|
+
widgets.refreshTree(messageRow); // requires them all to be immediate siblings
|
|
8049
8449
|
}
|
|
8050
8450
|
|
|
8051
8451
|
case 25:
|
|
8052
8452
|
case "end":
|
|
8053
|
-
return
|
|
8453
|
+
return _context.stop();
|
|
8054
8454
|
}
|
|
8055
8455
|
}
|
|
8056
|
-
},
|
|
8456
|
+
}, _callee);
|
|
8057
8457
|
}));
|
|
8058
8458
|
|
|
8059
|
-
return function (
|
|
8060
|
-
return
|
|
8459
|
+
return function (_x3) {
|
|
8460
|
+
return _ref.apply(this, arguments);
|
|
8061
8461
|
};
|
|
8062
8462
|
}());
|
|
8063
8463
|
|
|
8064
8464
|
function existingAction(actionClass) {
|
|
8065
|
-
var actions =
|
|
8066
|
-
return
|
|
8465
|
+
var actions = _logic.store.each(null, ns.schema('agent'), context.me, doc).filter(function (x) {
|
|
8466
|
+
return _logic.store.holds(x, ns.rdf('type'), actionClass, doc);
|
|
8067
8467
|
}).filter(function (x) {
|
|
8068
|
-
return
|
|
8468
|
+
return _logic.store.holds(x, ns.schema('target'), target, doc);
|
|
8069
8469
|
});
|
|
8470
|
+
|
|
8070
8471
|
return actions.length ? actions[0] : null;
|
|
8071
8472
|
}
|
|
8072
8473
|
|
|
@@ -8084,23 +8485,23 @@ function messageToolbar(message, messageRow, userContext) {
|
|
|
8084
8485
|
// https://schema.org/AgreeAction
|
|
8085
8486
|
|
|
8086
8487
|
|
|
8087
|
-
me =
|
|
8488
|
+
me = _index.authn.currentUser(); // If already logged on
|
|
8489
|
+
// debug.log('Actions 3' + mostRecentVersion(message).value + ' ' + ns.schema('dateDeleted').value + ' ' + (mostRecentVersion(message).value !== ns.schema('dateDeleted').value))
|
|
8088
8490
|
|
|
8089
|
-
if (me) {
|
|
8090
|
-
// Things you mnust be logged in for
|
|
8491
|
+
if (me && (0, _chatLogic.mostRecentVersion)(message).value !== ns.schema('dateDeleted').value) {
|
|
8091
8492
|
var context1 = {
|
|
8092
8493
|
me: me,
|
|
8093
8494
|
dom: dom,
|
|
8094
8495
|
div: div
|
|
8095
8496
|
};
|
|
8096
|
-
div.appendChild(sentimentButton(context1, message, // @@ TODO use
|
|
8097
|
-
|
|
8497
|
+
div.appendChild(sentimentButton(context1, message, // @@ TODO use widgets.sentimentButton
|
|
8498
|
+
_iconBase.icons.iconBase + THUMBS_UP_ICON, ns.schema('AgreeAction'), message.doc(), [ns.schema('DisagreeAction')])); // Thumbs down
|
|
8098
8499
|
|
|
8099
|
-
div.appendChild(sentimentButton(context1, message,
|
|
8500
|
+
div.appendChild(sentimentButton(context1, message, _iconBase.icons.iconBase + THUMBS_DOWN_ICON, ns.schema('DisagreeAction'), message.doc(), [ns.schema('AgreeAction')]));
|
|
8100
8501
|
} // X button to remove the tool UI itself
|
|
8101
8502
|
|
|
8102
8503
|
|
|
8103
|
-
var cancelButton = div.appendChild(
|
|
8504
|
+
var cancelButton = div.appendChild(widgets.cancelButton(dom));
|
|
8104
8505
|
cancelButton.style["float"] = 'right';
|
|
8105
8506
|
cancelButton.firstChild.style.opacity = '0.3';
|
|
8106
8507
|
cancelButton.addEventListener('click', closeToolbar);
|
|
@@ -9956,37 +10357,41 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
9956
10357
|
|
|
9957
10358
|
// This module of solid-ui has a main quadstore for the app to use
|
|
9958
10359
|
//
|
|
9959
|
-
|
|
9960
|
-
|
|
10360
|
+
function thisFetch(_x, _x2) {
|
|
10361
|
+
return _thisFetch.apply(this, arguments);
|
|
10362
|
+
}
|
|
10363
|
+
|
|
10364
|
+
function _thisFetch() {
|
|
10365
|
+
_thisFetch = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(url, requestInit) {
|
|
10366
|
+
var omitCreds;
|
|
9961
10367
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
9962
10368
|
while (1) {
|
|
9963
10369
|
switch (_context.prev = _context.next) {
|
|
9964
10370
|
case 0:
|
|
9965
|
-
|
|
9966
|
-
|
|
10371
|
+
omitCreds = requestInit && requestInit.credentials && requestInit.credentials === 'omit';
|
|
10372
|
+
|
|
10373
|
+
if (!(_authSession["default"].info.webId && !omitCreds)) {
|
|
10374
|
+
_context.next = 5;
|
|
9967
10375
|
break;
|
|
9968
10376
|
}
|
|
9969
10377
|
|
|
9970
10378
|
return _context.abrupt("return", _authSession["default"].fetch(url, requestInit));
|
|
9971
10379
|
|
|
9972
|
-
case
|
|
10380
|
+
case 5:
|
|
9973
10381
|
return _context.abrupt("return", window.fetch(url, requestInit));
|
|
9974
10382
|
|
|
9975
|
-
case
|
|
10383
|
+
case 6:
|
|
9976
10384
|
case "end":
|
|
9977
10385
|
return _context.stop();
|
|
9978
10386
|
}
|
|
9979
10387
|
}
|
|
9980
10388
|
}, _callee);
|
|
9981
10389
|
}));
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
return _ref.apply(this, arguments);
|
|
9985
|
-
};
|
|
9986
|
-
}();
|
|
10390
|
+
return _thisFetch.apply(this, arguments);
|
|
10391
|
+
}
|
|
9987
10392
|
|
|
9988
10393
|
var solidLogicSingleton = new _solidLogic.SolidLogic({
|
|
9989
|
-
fetch:
|
|
10394
|
+
fetch: thisFetch
|
|
9990
10395
|
}, _authSession["default"]); // Make this directly accessible as it is what you need most of the time
|
|
9991
10396
|
|
|
9992
10397
|
exports.solidLogicSingleton = solidLogicSingleton;
|
|
@@ -15729,10 +16134,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15729
16134
|
});
|
|
15730
16135
|
exports["default"] = void 0;
|
|
15731
16136
|
var _default = {
|
|
15732
|
-
buildTime: '2022-01-
|
|
15733
|
-
commit: '
|
|
16137
|
+
buildTime: '2022-01-27T18:46:06Z',
|
|
16138
|
+
commit: 'cc8aeb7b875ceb73abd01a5b173aebaeea8692f8',
|
|
15734
16139
|
npmInfo: {
|
|
15735
|
-
'solid-ui': '2.4.14
|
|
16140
|
+
'solid-ui': '2.4.14',
|
|
15736
16141
|
npm: '6.14.15',
|
|
15737
16142
|
ares: '1.18.1',
|
|
15738
16143
|
brotli: '1.0.9',
|
|
@@ -16451,7 +16856,14 @@ function button(dom, iconURI, text, handler) {
|
|
|
16451
16856
|
|
|
16452
16857
|
|
|
16453
16858
|
function cancelButton(dom, handler) {
|
|
16454
|
-
|
|
16859
|
+
var b = button(dom, cancelIconURI, 'Cancel', handler);
|
|
16860
|
+
|
|
16861
|
+
if (b.firstChild) {
|
|
16862
|
+
// sigh for tsc
|
|
16863
|
+
b.firstChild.style.opacity = '0.3'; // Black X is too harsh: current language is grey X
|
|
16864
|
+
}
|
|
16865
|
+
|
|
16866
|
+
return b;
|
|
16455
16867
|
}
|
|
16456
16868
|
/* Make a continue button
|
|
16457
16869
|
*
|
|
@@ -19937,16 +20349,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
19937
20349
|
*/
|
|
19938
20350
|
// eslint-disable-next-line complexity
|
|
19939
20351
|
function autocompleteField(dom, container, already, subject, form, doc, callbackFunction) {
|
|
19940
|
-
var _kb$updater;
|
|
19941
|
-
|
|
19942
20352
|
function addOneIdAndRefresh(_x, _x2) {
|
|
19943
20353
|
return _addOneIdAndRefresh.apply(this, arguments);
|
|
19944
20354
|
}
|
|
19945
20355
|
|
|
19946
20356
|
function _addOneIdAndRefresh() {
|
|
19947
20357
|
_addOneIdAndRefresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(result, name) {
|
|
19948
|
-
var oldValue, oldName, deletables, insertables
|
|
19949
|
-
|
|
20358
|
+
var oldValue, oldName, deletables, insertables;
|
|
19950
20359
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
19951
20360
|
while (1) {
|
|
19952
20361
|
switch (_context.prev = _context.next) {
|
|
@@ -19983,7 +20392,7 @@ function autocompleteField(dom, container, already, subject, form, doc, callback
|
|
|
19983
20392
|
|
|
19984
20393
|
_context.prev = 9;
|
|
19985
20394
|
_context.next = 12;
|
|
19986
|
-
return
|
|
20395
|
+
return kb.updater.updateMany(deletables, insertables);
|
|
19987
20396
|
|
|
19988
20397
|
case 12:
|
|
19989
20398
|
_context.next = 19;
|
|
@@ -20015,8 +20424,7 @@ function autocompleteField(dom, container, already, subject, form, doc, callback
|
|
|
20015
20424
|
|
|
20016
20425
|
function _deleteOne() {
|
|
20017
20426
|
_deleteOne = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_result, _name) {
|
|
20018
|
-
var oldValue, deletables, insertables,
|
|
20019
|
-
|
|
20427
|
+
var oldValue, deletables, insertables, e2;
|
|
20020
20428
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
20021
20429
|
while (1) {
|
|
20022
20430
|
switch (_context2.prev = _context2.next) {
|
|
@@ -20040,7 +20448,7 @@ function autocompleteField(dom, container, already, subject, form, doc, callback
|
|
|
20040
20448
|
|
|
20041
20449
|
_context2.prev = 7;
|
|
20042
20450
|
_context2.next = 10;
|
|
20043
|
-
return
|
|
20451
|
+
return kb.updater.updateMany(deletables, insertables);
|
|
20044
20452
|
|
|
20045
20453
|
case 10:
|
|
20046
20454
|
_context2.next = 18;
|
|
@@ -20149,7 +20557,7 @@ function autocompleteField(dom, container, already, subject, form, doc, callback
|
|
|
20149
20557
|
|
|
20150
20558
|
|
|
20151
20559
|
var suppressEmptyUneditable = kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc);
|
|
20152
|
-
var editable =
|
|
20560
|
+
var editable = kb.updater.editable(doc.uri);
|
|
20153
20561
|
var autocompleteOptions = {
|
|
20154
20562
|
// cancelButton?: HTMLElement,
|
|
20155
20563
|
permanent: true,
|
|
@@ -20823,8 +21231,6 @@ function getPreferredLanguagesFor(_x) {
|
|
|
20823
21231
|
|
|
20824
21232
|
function _getPreferredLanguagesFor() {
|
|
20825
21233
|
_getPreferredLanguagesFor = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(person) {
|
|
20826
|
-
var _kb$fetcher;
|
|
20827
|
-
|
|
20828
21234
|
var doc, list, languageCodeArray;
|
|
20829
21235
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
20830
21236
|
while (1) {
|
|
@@ -20832,7 +21238,7 @@ function _getPreferredLanguagesFor() {
|
|
|
20832
21238
|
case 0:
|
|
20833
21239
|
doc = person.doc();
|
|
20834
21240
|
_context.next = 3;
|
|
20835
|
-
return
|
|
21241
|
+
return _logic.kb.fetcher.load(doc);
|
|
20836
21242
|
|
|
20837
21243
|
case 3:
|
|
20838
21244
|
list = _logic.kb.any(person, ns.schema('knowsLanguage'), null, doc);
|
|
@@ -21302,8 +21708,6 @@ function queryESCODataByName(_x, _x2, _x3) {
|
|
|
21302
21708
|
|
|
21303
21709
|
function _queryESCODataByName() {
|
|
21304
21710
|
_queryESCODataByName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(filter, theClass, queryTarget) {
|
|
21305
|
-
var _kb$fetcher;
|
|
21306
|
-
|
|
21307
21711
|
var limit, queryURI, response, text, json;
|
|
21308
21712
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
21309
21713
|
while (1) {
|
|
@@ -21321,11 +21725,11 @@ function _queryESCODataByName() {
|
|
|
21321
21725
|
queryURI = queryTarget.searchByNameURI.replace('$(name)', filter).replace('$(limit)', '' + limit).replace('$(targetClass)', theClass.toNT());
|
|
21322
21726
|
debug.log('Querying ESCO data - uri: ' + queryURI);
|
|
21323
21727
|
_context.next = 7;
|
|
21324
|
-
return
|
|
21728
|
+
return _logic.kb.fetcher.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
|
|
21325
21729
|
|
|
21326
21730
|
case 7:
|
|
21327
21731
|
response = _context.sent;
|
|
21328
|
-
text =
|
|
21732
|
+
text = response.responseText || '';
|
|
21329
21733
|
debug.log(' Query result text' + text.slice(0, 500) + '...');
|
|
21330
21734
|
|
|
21331
21735
|
if (!(text.length === 0)) {
|
|
@@ -21372,8 +21776,7 @@ function queryPublicDataByName(_x4, _x5, _x6, _x7) {
|
|
|
21372
21776
|
|
|
21373
21777
|
function _queryPublicDataByName() {
|
|
21374
21778
|
_queryPublicDataByName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(filter, theClass, languages, queryTarget) {
|
|
21375
|
-
var substituteStrings, languagePrefs, language, sparql, queryURI, response,
|
|
21376
|
-
|
|
21779
|
+
var substituteStrings, languagePrefs, language, sparql, queryURI, response, text, text2, json, bindings;
|
|
21377
21780
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
21378
21781
|
while (1) {
|
|
21379
21782
|
switch (_context2.prev = _context2.next) {
|
|
@@ -21428,7 +21831,7 @@ function _queryPublicDataByName() {
|
|
|
21428
21831
|
queryURI = substituteStrings(queryTarget.searchByNameURI);
|
|
21429
21832
|
_context2.prev = 18;
|
|
21430
21833
|
_context2.next = 21;
|
|
21431
|
-
return
|
|
21834
|
+
return _logic.kb.fetcher.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
|
|
21432
21835
|
|
|
21433
21836
|
case 21:
|
|
21434
21837
|
response = _context2.sent;
|
|
@@ -21505,8 +21908,6 @@ function queryPublicDataSelect(_x8, _x9) {
|
|
|
21505
21908
|
|
|
21506
21909
|
function _queryPublicDataSelect() {
|
|
21507
21910
|
_queryPublicDataSelect = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(sparql, queryTarget) {
|
|
21508
|
-
var _kb$fetcher3;
|
|
21509
|
-
|
|
21510
21911
|
var myUrlWithParams, queryURI, headers, options, response, text, text2, json, bindings;
|
|
21511
21912
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
21512
21913
|
while (1) {
|
|
@@ -21532,11 +21933,11 @@ function _queryPublicDataSelect() {
|
|
|
21532
21933
|
headers: headers
|
|
21533
21934
|
};
|
|
21534
21935
|
_context3.next = 11;
|
|
21535
|
-
return
|
|
21936
|
+
return _logic.kb.fetcher.webOperation('GET', queryURI, options);
|
|
21536
21937
|
|
|
21537
21938
|
case 11:
|
|
21538
21939
|
response = _context3.sent;
|
|
21539
|
-
text =
|
|
21940
|
+
text = response.responseText || '';
|
|
21540
21941
|
|
|
21541
21942
|
if (!(text.length === 0)) {
|
|
21542
21943
|
_context3.next = 15;
|
|
@@ -21568,8 +21969,6 @@ function queryPublicDataConstruct(_x10, _x11, _x12) {
|
|
|
21568
21969
|
|
|
21569
21970
|
function _queryPublicDataConstruct() {
|
|
21570
21971
|
_queryPublicDataConstruct = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(sparql, pubicId, queryTarget) {
|
|
21571
|
-
var _kb$fetcher4;
|
|
21572
|
-
|
|
21573
21972
|
var myUrlWithParams, queryURI, headers, options, response, text, report;
|
|
21574
21973
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
21575
21974
|
while (1) {
|
|
@@ -21598,11 +21997,11 @@ function _queryPublicDataConstruct() {
|
|
|
21598
21997
|
|
|
21599
21998
|
};
|
|
21600
21999
|
_context4.next = 12;
|
|
21601
|
-
return
|
|
22000
|
+
return _logic.kb.fetcher.webOperation('GET', queryURI, options);
|
|
21602
22001
|
|
|
21603
22002
|
case 12:
|
|
21604
22003
|
response = _context4.sent;
|
|
21605
|
-
text =
|
|
22004
|
+
text = response.responseText || 'No response text?';
|
|
21606
22005
|
report = text.length > 500 ? text.slice(0, 200) + ' ... ' + text.slice(-200) : text;
|
|
21607
22006
|
debug.log(' queryPublicDataConstruct result text:' + report);
|
|
21608
22007
|
|
|
@@ -67821,7 +68220,7 @@ var Formula = /*#__PURE__*/function (_Node) {
|
|
|
67821
68220
|
/*!******************************************!*\
|
|
67822
68221
|
!*** ./node_modules/rdflib/esm/index.js ***!
|
|
67823
68222
|
\******************************************/
|
|
67824
|
-
/*! exports provided: isStatement, isStore, isCollection, isRDFlibObject, isVariable, isTerm, isLiteral, isQuad, isNamedNode, isBlankNode, isSubject, isPredicate, isRDFObject, isGraph, BlankNode, Collection, convert, DataFactory, Empty, Fetcher, Formula, Store, jsonParser, Literal, log, N3Parser, NamedNode, Namespace, Node, parse, Query, queryToSPARQL, RDFaProcessor, RDFParser, serialize, Serializer, SPARQLToQuery, sparqlUpdateParser, Statement, term, UpdateManager, UpdatesSocket, UpdatesVia, uri, Util, Variable, IndexedFormula, NextId, fromNT, fetcher, graph, lit, st, sym, blankNode, defaultGraph, literal, namedNode, quad, triple, variable, termValue
|
|
68223
|
+
/*! exports provided: isStatement, isStore, isCollection, isRDFlibObject, isVariable, isTerm, isLiteral, isQuad, isNamedNode, isBlankNode, isSubject, isPredicate, isRDFObject, isGraph, BlankNode, Collection, convert, DataFactory, Empty, Fetcher, Formula, Store, jsonParser, Literal, log, N3Parser, NamedNode, Namespace, Node, parse, Query, queryToSPARQL, RDFaProcessor, RDFParser, serialize, Serializer, SPARQLToQuery, sparqlUpdateParser, Statement, term, UpdateManager, UpdatesSocket, UpdatesVia, uri, Util, Variable, IndexedFormula, NextId, fromNT, fetcher, graph, lit, st, sym, blankNode, defaultGraph, literal, namedNode, quad, triple, variable, termValue */
|
|
67825
68224
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
67826
68225
|
|
|
67827
68226
|
"use strict";
|
|
@@ -67841,150 +68240,128 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
67841
68240
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quad", function() { return quad; });
|
|
67842
68241
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triple", function() { return triple; });
|
|
67843
68242
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "variable", function() { return variable; });
|
|
67844
|
-
/* harmony
|
|
67845
|
-
/* harmony
|
|
67846
|
-
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
|
|
67847
|
-
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
|
|
67848
|
-
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
|
|
67849
|
-
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
|
|
67850
|
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
|
|
67851
|
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
|
|
67852
|
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
|
|
67853
|
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
|
|
67854
|
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
|
|
67855
|
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
|
|
67856
|
-
/* harmony import */ var _blank_node__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./blank-node */ "./node_modules/rdflib/esm/blank-node.js");
|
|
67857
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlankNode", function() { return _blank_node__WEBPACK_IMPORTED_MODULE_5__["default"]; });
|
|
67858
|
-
|
|
67859
|
-
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./collection */ "./node_modules/rdflib/esm/collection.js");
|
|
67860
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return _collection__WEBPACK_IMPORTED_MODULE_6__["default"]; });
|
|
67861
|
-
|
|
67862
|
-
/* harmony import */ var _convert__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./convert */ "./node_modules/rdflib/esm/convert.js");
|
|
67863
|
-
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "convert", function() { return _convert__WEBPACK_IMPORTED_MODULE_7__; });
|
|
67864
|
-
/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./empty */ "./node_modules/rdflib/esm/empty.js");
|
|
67865
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Empty", function() { return _empty__WEBPACK_IMPORTED_MODULE_8__["default"]; });
|
|
67866
|
-
|
|
67867
|
-
/* harmony import */ var _fetcher__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./fetcher */ "./node_modules/rdflib/esm/fetcher.js");
|
|
67868
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fetcher", function() { return _fetcher__WEBPACK_IMPORTED_MODULE_9__["default"]; });
|
|
67869
|
-
|
|
67870
|
-
/* harmony import */ var _formula__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./formula */ "./node_modules/rdflib/esm/formula.js");
|
|
67871
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Formula", function() { return _formula__WEBPACK_IMPORTED_MODULE_10__["default"]; });
|
|
67872
|
-
|
|
67873
|
-
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./store */ "./node_modules/rdflib/esm/store.js");
|
|
67874
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return _store__WEBPACK_IMPORTED_MODULE_11__["default"]; });
|
|
67875
|
-
|
|
67876
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IndexedFormula", function() { return _store__WEBPACK_IMPORTED_MODULE_11__["default"]; });
|
|
67877
|
-
|
|
67878
|
-
/* harmony import */ var _jsonparser__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./jsonparser */ "./node_modules/rdflib/esm/jsonparser.js");
|
|
67879
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jsonParser", function() { return _jsonparser__WEBPACK_IMPORTED_MODULE_12__["default"]; });
|
|
67880
|
-
|
|
67881
|
-
/* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./literal */ "./node_modules/rdflib/esm/literal.js");
|
|
67882
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Literal", function() { return _literal__WEBPACK_IMPORTED_MODULE_13__["default"]; });
|
|
68243
|
+
/* harmony import */ var _blank_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./blank-node */ "./node_modules/rdflib/esm/blank-node.js");
|
|
68244
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlankNode", function() { return _blank_node__WEBPACK_IMPORTED_MODULE_0__["default"]; });
|
|
67883
68245
|
|
|
67884
|
-
/* harmony import */ var
|
|
67885
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68246
|
+
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collection */ "./node_modules/rdflib/esm/collection.js");
|
|
68247
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return _collection__WEBPACK_IMPORTED_MODULE_1__["default"]; });
|
|
67886
68248
|
|
|
67887
|
-
/* harmony import */ var
|
|
67888
|
-
/* harmony reexport (
|
|
68249
|
+
/* harmony import */ var _convert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./convert */ "./node_modules/rdflib/esm/convert.js");
|
|
68250
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "convert", function() { return _convert__WEBPACK_IMPORTED_MODULE_2__; });
|
|
68251
|
+
/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./empty */ "./node_modules/rdflib/esm/empty.js");
|
|
68252
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Empty", function() { return _empty__WEBPACK_IMPORTED_MODULE_3__["default"]; });
|
|
67889
68253
|
|
|
67890
|
-
/* harmony import */ var
|
|
67891
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68254
|
+
/* harmony import */ var _fetcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fetcher */ "./node_modules/rdflib/esm/fetcher.js");
|
|
68255
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fetcher", function() { return _fetcher__WEBPACK_IMPORTED_MODULE_4__["default"]; });
|
|
67892
68256
|
|
|
67893
|
-
/* harmony import */ var
|
|
67894
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68257
|
+
/* harmony import */ var _formula__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./formula */ "./node_modules/rdflib/esm/formula.js");
|
|
68258
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Formula", function() { return _formula__WEBPACK_IMPORTED_MODULE_5__["default"]; });
|
|
67895
68259
|
|
|
67896
|
-
/* harmony import */ var
|
|
67897
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68260
|
+
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./store */ "./node_modules/rdflib/esm/store.js");
|
|
68261
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return _store__WEBPACK_IMPORTED_MODULE_6__["default"]; });
|
|
67898
68262
|
|
|
67899
|
-
/* harmony
|
|
67900
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return _parse__WEBPACK_IMPORTED_MODULE_19__["default"]; });
|
|
68263
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IndexedFormula", function() { return _store__WEBPACK_IMPORTED_MODULE_6__["default"]; });
|
|
67901
68264
|
|
|
67902
|
-
/* harmony import */ var
|
|
67903
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68265
|
+
/* harmony import */ var _jsonparser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./jsonparser */ "./node_modules/rdflib/esm/jsonparser.js");
|
|
68266
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jsonParser", function() { return _jsonparser__WEBPACK_IMPORTED_MODULE_7__["default"]; });
|
|
67904
68267
|
|
|
67905
|
-
/* harmony import */ var
|
|
67906
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68268
|
+
/* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./literal */ "./node_modules/rdflib/esm/literal.js");
|
|
68269
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Literal", function() { return _literal__WEBPACK_IMPORTED_MODULE_8__["default"]; });
|
|
67907
68270
|
|
|
67908
|
-
/* harmony import */ var
|
|
67909
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68271
|
+
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./log */ "./node_modules/rdflib/esm/log.js");
|
|
68272
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "log", function() { return _log__WEBPACK_IMPORTED_MODULE_9__["default"]; });
|
|
67910
68273
|
|
|
67911
|
-
/* harmony import */ var
|
|
67912
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68274
|
+
/* harmony import */ var _n3parser__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./n3parser */ "./node_modules/rdflib/esm/n3parser.js");
|
|
68275
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "N3Parser", function() { return _n3parser__WEBPACK_IMPORTED_MODULE_10__["default"]; });
|
|
67913
68276
|
|
|
67914
|
-
/* harmony import */ var
|
|
67915
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68277
|
+
/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./named-node */ "./node_modules/rdflib/esm/named-node.js");
|
|
68278
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NamedNode", function() { return _named_node__WEBPACK_IMPORTED_MODULE_11__["default"]; });
|
|
67916
68279
|
|
|
67917
|
-
/* harmony import */ var
|
|
67918
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68280
|
+
/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./namespace */ "./node_modules/rdflib/esm/namespace.js");
|
|
68281
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Namespace", function() { return _namespace__WEBPACK_IMPORTED_MODULE_12__["default"]; });
|
|
67919
68282
|
|
|
67920
|
-
/* harmony import */ var
|
|
67921
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68283
|
+
/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./node */ "./node_modules/rdflib/esm/node.js");
|
|
68284
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Node", function() { return _node__WEBPACK_IMPORTED_MODULE_13__["default"]; });
|
|
67922
68285
|
|
|
67923
|
-
/* harmony import */ var
|
|
67924
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68286
|
+
/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./parse */ "./node_modules/rdflib/esm/parse.js");
|
|
68287
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return _parse__WEBPACK_IMPORTED_MODULE_14__["default"]; });
|
|
67925
68288
|
|
|
67926
|
-
/* harmony import */ var
|
|
67927
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68289
|
+
/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./query */ "./node_modules/rdflib/esm/query.js");
|
|
68290
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Query", function() { return _query__WEBPACK_IMPORTED_MODULE_15__["Query"]; });
|
|
67928
68291
|
|
|
67929
|
-
/* harmony import */ var
|
|
67930
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68292
|
+
/* harmony import */ var _query_to_sparql__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./query-to-sparql */ "./node_modules/rdflib/esm/query-to-sparql.js");
|
|
68293
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "queryToSPARQL", function() { return _query_to_sparql__WEBPACK_IMPORTED_MODULE_16__["default"]; });
|
|
67931
68294
|
|
|
67932
|
-
/* harmony import */ var
|
|
67933
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68295
|
+
/* harmony import */ var _rdfaparser__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rdfaparser */ "./node_modules/rdflib/esm/rdfaparser.js");
|
|
68296
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RDFaProcessor", function() { return _rdfaparser__WEBPACK_IMPORTED_MODULE_17__["default"]; });
|
|
67934
68297
|
|
|
67935
|
-
/* harmony
|
|
68298
|
+
/* harmony import */ var _rdfxmlparser__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rdfxmlparser */ "./node_modules/rdflib/esm/rdfxmlparser.js");
|
|
68299
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RDFParser", function() { return _rdfxmlparser__WEBPACK_IMPORTED_MODULE_18__["default"]; });
|
|
67936
68300
|
|
|
67937
|
-
/* harmony import */ var
|
|
67938
|
-
/* harmony reexport (
|
|
67939
|
-
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./utils-js */ "./node_modules/rdflib/esm/utils-js.js");
|
|
67940
|
-
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "Util", function() { return _utils_js__WEBPACK_IMPORTED_MODULE_32__; });
|
|
67941
|
-
/* harmony import */ var _variable__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./variable */ "./node_modules/rdflib/esm/variable.js");
|
|
67942
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return _variable__WEBPACK_IMPORTED_MODULE_33__["default"]; });
|
|
68301
|
+
/* harmony import */ var _serialize__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./serialize */ "./node_modules/rdflib/esm/serialize.js");
|
|
68302
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "serialize", function() { return _serialize__WEBPACK_IMPORTED_MODULE_19__["default"]; });
|
|
67943
68303
|
|
|
67944
|
-
/* harmony import */ var
|
|
67945
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68304
|
+
/* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./serializer */ "./node_modules/rdflib/esm/serializer.js");
|
|
68305
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Serializer", function() { return _serializer__WEBPACK_IMPORTED_MODULE_20__["default"]; });
|
|
67946
68306
|
|
|
67947
|
-
/* harmony import */ var
|
|
67948
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68307
|
+
/* harmony import */ var _sparql_to_query__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./sparql-to-query */ "./node_modules/rdflib/esm/sparql-to-query.js");
|
|
68308
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SPARQLToQuery", function() { return _sparql_to_query__WEBPACK_IMPORTED_MODULE_21__["default"]; });
|
|
67949
68309
|
|
|
67950
|
-
/* harmony
|
|
68310
|
+
/* harmony import */ var _patch_parser__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./patch-parser */ "./node_modules/rdflib/esm/patch-parser.js");
|
|
68311
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sparqlUpdateParser", function() { return _patch_parser__WEBPACK_IMPORTED_MODULE_22__["default"]; });
|
|
67951
68312
|
|
|
67952
|
-
/* harmony
|
|
68313
|
+
/* harmony import */ var _statement__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./statement */ "./node_modules/rdflib/esm/statement.js");
|
|
68314
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Statement", function() { return _statement__WEBPACK_IMPORTED_MODULE_23__["default"]; });
|
|
67953
68315
|
|
|
67954
|
-
/* harmony
|
|
68316
|
+
/* harmony import */ var _update_manager__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./update-manager */ "./node_modules/rdflib/esm/update-manager.js");
|
|
68317
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UpdateManager", function() { return _update_manager__WEBPACK_IMPORTED_MODULE_24__["default"]; });
|
|
67955
68318
|
|
|
67956
|
-
/* harmony
|
|
68319
|
+
/* harmony import */ var _updates_via__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./updates-via */ "./node_modules/rdflib/esm/updates-via.js");
|
|
68320
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UpdatesSocket", function() { return _updates_via__WEBPACK_IMPORTED_MODULE_25__["UpdatesSocket"]; });
|
|
67957
68321
|
|
|
67958
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68322
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UpdatesVia", function() { return _updates_via__WEBPACK_IMPORTED_MODULE_25__["UpdatesVia"]; });
|
|
67959
68323
|
|
|
67960
|
-
/* harmony
|
|
68324
|
+
/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./uri */ "./node_modules/rdflib/esm/uri.js");
|
|
68325
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "uri", function() { return _uri__WEBPACK_IMPORTED_MODULE_26__; });
|
|
68326
|
+
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./utils-js */ "./node_modules/rdflib/esm/utils-js.js");
|
|
68327
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "Util", function() { return _utils_js__WEBPACK_IMPORTED_MODULE_27__; });
|
|
68328
|
+
/* harmony import */ var _variable__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./variable */ "./node_modules/rdflib/esm/variable.js");
|
|
68329
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return _variable__WEBPACK_IMPORTED_MODULE_28__["default"]; });
|
|
67961
68330
|
|
|
67962
|
-
/* harmony
|
|
68331
|
+
/* harmony import */ var _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./factories/rdflib-data-factory */ "./node_modules/rdflib/esm/factories/rdflib-data-factory.js");
|
|
68332
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataFactory", function() { return _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__["default"]; });
|
|
67963
68333
|
|
|
67964
|
-
/* harmony
|
|
68334
|
+
/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./utils/terms */ "./node_modules/rdflib/esm/utils/terms.js");
|
|
68335
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isStatement", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isStatement"]; });
|
|
67965
68336
|
|
|
67966
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68337
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isStore", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isStore"]; });
|
|
67967
68338
|
|
|
67968
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68339
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isCollection", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isCollection"]; });
|
|
67969
68340
|
|
|
67970
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68341
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRDFlibObject", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isRDFlibObject"]; });
|
|
67971
68342
|
|
|
67972
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68343
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isVariable", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isVariable"]; });
|
|
67973
68344
|
|
|
67974
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
68345
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTerm", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isTerm"]; });
|
|
67975
68346
|
|
|
67976
|
-
/* harmony
|
|
67977
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "termValue", function() { return _utils_termValue__WEBPACK_IMPORTED_MODULE_36__["termValue"]; });
|
|
68347
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLiteral", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isLiteral"]; });
|
|
67978
68348
|
|
|
68349
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isQuad", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isQuad"]; });
|
|
67979
68350
|
|
|
68351
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNamedNode", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isNamedNode"]; });
|
|
67980
68352
|
|
|
68353
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBlankNode", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isBlankNode"]; });
|
|
67981
68354
|
|
|
68355
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSubject", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isSubject"]; });
|
|
67982
68356
|
|
|
68357
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPredicate", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isPredicate"]; });
|
|
67983
68358
|
|
|
68359
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRDFObject", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isRDFObject"]; });
|
|
67984
68360
|
|
|
67985
|
-
|
|
68361
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isGraph", function() { return _utils_terms__WEBPACK_IMPORTED_MODULE_30__["isGraph"]; });
|
|
67986
68362
|
|
|
67987
|
-
|
|
68363
|
+
/* harmony import */ var _utils_termValue__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./utils/termValue */ "./node_modules/rdflib/esm/utils/termValue.js");
|
|
68364
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "termValue", function() { return _utils_termValue__WEBPACK_IMPORTED_MODULE_31__["termValue"]; });
|
|
67988
68365
|
|
|
67989
68366
|
|
|
67990
68367
|
|
|
@@ -68020,8 +68397,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
68020
68397
|
|
|
68021
68398
|
var boundDataFactory = {};
|
|
68022
68399
|
|
|
68023
|
-
for (var name in
|
|
68024
|
-
if (typeof
|
|
68400
|
+
for (var name in _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__["default"]) {
|
|
68401
|
+
if (typeof _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__["default"][name] === 'function') boundDataFactory[name] = _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__["default"][name].bind(_factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__["default"]);
|
|
68025
68402
|
}
|
|
68026
68403
|
|
|
68027
68404
|
var fetcher = boundDataFactory.fetcher,
|
|
@@ -68035,53 +68412,19 @@ var fetcher = boundDataFactory.fetcher,
|
|
|
68035
68412
|
literal = boundDataFactory.literal,
|
|
68036
68413
|
quad = boundDataFactory.quad,
|
|
68037
68414
|
triple = boundDataFactory.triple;
|
|
68038
|
-
var formula = new
|
|
68415
|
+
var formula = new _formula__WEBPACK_IMPORTED_MODULE_5__["default"]();
|
|
68039
68416
|
|
|
68040
68417
|
var fromNT = function fromNT(str) {
|
|
68041
68418
|
return formula.fromNT(str);
|
|
68042
68419
|
};
|
|
68043
68420
|
|
|
68044
|
-
var term =
|
|
68421
|
+
var term = _node__WEBPACK_IMPORTED_MODULE_13__["default"].fromValue; // TODO: this export is broken;
|
|
68045
68422
|
// it exports the _current_ value of nextId, which is always 0
|
|
68046
68423
|
|
|
68047
|
-
var NextId =
|
|
68048
|
-
|
|
68049
|
-
|
|
68050
|
-
|
|
68051
|
-
var ConnectedStore = /*#__PURE__*/function (_Store) {
|
|
68052
|
-
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ConnectedStore, _Store);
|
|
68053
|
-
|
|
68054
|
-
var _super = _createSuper(ConnectedStore);
|
|
68424
|
+
var NextId = _blank_node__WEBPACK_IMPORTED_MODULE_0__["default"].nextId;
|
|
68055
68425
|
|
|
68056
|
-
function ConnectedStore(features) {
|
|
68057
|
-
var _this;
|
|
68058
|
-
|
|
68059
|
-
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ConnectedStore);
|
|
68060
68426
|
|
|
68061
|
-
_this = _super.call(this, features);
|
|
68062
|
-
_this.fetcher = new _fetcher__WEBPACK_IMPORTED_MODULE_9__["default"](_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), {});
|
|
68063
|
-
return _this;
|
|
68064
|
-
}
|
|
68065
68427
|
|
|
68066
|
-
return ConnectedStore;
|
|
68067
|
-
}(_store__WEBPACK_IMPORTED_MODULE_11__["default"]);
|
|
68068
|
-
var LiveStore = /*#__PURE__*/function (_ConnectedStore) {
|
|
68069
|
-
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(LiveStore, _ConnectedStore);
|
|
68070
|
-
|
|
68071
|
-
var _super2 = _createSuper(LiveStore);
|
|
68072
|
-
|
|
68073
|
-
function LiveStore(features) {
|
|
68074
|
-
var _this2;
|
|
68075
|
-
|
|
68076
|
-
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, LiveStore);
|
|
68077
|
-
|
|
68078
|
-
_this2 = _super2.call(this, features);
|
|
68079
|
-
_this2.updater = new _update_manager__WEBPACK_IMPORTED_MODULE_29__["default"](_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this2));
|
|
68080
|
-
return _this2;
|
|
68081
|
-
}
|
|
68082
|
-
|
|
68083
|
-
return LiveStore;
|
|
68084
|
-
}(ConnectedStore);
|
|
68085
68428
|
|
|
68086
68429
|
/***/ }),
|
|
68087
68430
|
|
|
@@ -84229,52 +84572,50 @@ var ChatLogic = /** @class */ (function () {
|
|
|
84229
84572
|
this.profile = profile;
|
|
84230
84573
|
}
|
|
84231
84574
|
ChatLogic.prototype.setAcl = function (chatContainer, me, invitee) {
|
|
84232
|
-
var _a, _b;
|
|
84233
84575
|
return __awaiter(this, void 0, void 0, function () {
|
|
84234
84576
|
var chatAclDoc, aclBody;
|
|
84235
|
-
return __generator(this, function (
|
|
84236
|
-
switch (
|
|
84577
|
+
return __generator(this, function (_a) {
|
|
84578
|
+
switch (_a.label) {
|
|
84237
84579
|
case 0:
|
|
84238
84580
|
// Some servers don't present a Link http response header
|
|
84239
84581
|
// if the container doesn't exist yet, so refetch the container
|
|
84240
84582
|
// now that it has been created:
|
|
84241
|
-
return [4 /*yield*/,
|
|
84583
|
+
return [4 /*yield*/, this.store.fetcher.load(chatContainer)];
|
|
84242
84584
|
case 1:
|
|
84243
84585
|
// Some servers don't present a Link http response header
|
|
84244
84586
|
// if the container doesn't exist yet, so refetch the container
|
|
84245
84587
|
// now that it has been created:
|
|
84246
|
-
|
|
84588
|
+
_a.sent();
|
|
84247
84589
|
chatAclDoc = this.store.any(chatContainer, new rdflib_1.NamedNode("http://www.iana.org/assignments/link-relations/acl"));
|
|
84248
84590
|
if (!chatAclDoc) {
|
|
84249
84591
|
throw new Error("Chat ACL doc not found!");
|
|
84250
84592
|
}
|
|
84251
84593
|
aclBody = "\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#owner>\n a acl:Authorization;\n acl:agent <".concat(me.value, ">;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Write, acl:Control.\n<#invitee>\n a acl:Authorization;\n acl:agent <").concat(invitee.value, ">;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Append.\n");
|
|
84252
|
-
return [4 /*yield*/,
|
|
84594
|
+
return [4 /*yield*/, this.store.fetcher.webOperation("PUT", chatAclDoc.value, {
|
|
84253
84595
|
data: aclBody,
|
|
84254
84596
|
contentType: "text/turtle",
|
|
84255
|
-
})
|
|
84597
|
+
})];
|
|
84256
84598
|
case 2:
|
|
84257
|
-
|
|
84599
|
+
_a.sent();
|
|
84258
84600
|
return [2 /*return*/];
|
|
84259
84601
|
}
|
|
84260
84602
|
});
|
|
84261
84603
|
});
|
|
84262
84604
|
};
|
|
84263
84605
|
ChatLogic.prototype.addToPrivateTypeIndex = function (chatThing, me) {
|
|
84264
|
-
var _a;
|
|
84265
84606
|
return __awaiter(this, void 0, void 0, function () {
|
|
84266
84607
|
var privateTypeIndex, reg, ins;
|
|
84267
84608
|
var _this = this;
|
|
84268
|
-
return __generator(this, function (
|
|
84269
|
-
switch (
|
|
84609
|
+
return __generator(this, function (_a) {
|
|
84610
|
+
switch (_a.label) {
|
|
84270
84611
|
case 0:
|
|
84271
84612
|
privateTypeIndex = this.store.any(me, this.ns.solid("privateTypeIndex"));
|
|
84272
84613
|
if (!privateTypeIndex) {
|
|
84273
84614
|
throw new Error("Private type index not found!");
|
|
84274
84615
|
}
|
|
84275
|
-
return [4 /*yield*/,
|
|
84616
|
+
return [4 /*yield*/, this.store.fetcher.load(privateTypeIndex)];
|
|
84276
84617
|
case 1:
|
|
84277
|
-
|
|
84618
|
+
_a.sent();
|
|
84278
84619
|
reg = (0, uri_1.newThing)(privateTypeIndex);
|
|
84279
84620
|
ins = [
|
|
84280
84621
|
(0, rdflib_1.st)(reg, this.ns.rdf("type"), this.ns.solid("TypeRegistration"), privateTypeIndex.doc()),
|
|
@@ -84282,8 +84623,7 @@ var ChatLogic = /** @class */ (function () {
|
|
|
84282
84623
|
(0, rdflib_1.st)(reg, this.ns.solid("instance"), chatThing, privateTypeIndex.doc()),
|
|
84283
84624
|
];
|
|
84284
84625
|
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
84285
|
-
|
|
84286
|
-
(_a = _this.store.updater) === null || _a === void 0 ? void 0 : _a.update([], ins, function (_uri, ok, errm) {
|
|
84626
|
+
_this.store.updater.update([], ins, function (_uri, ok, errm) {
|
|
84287
84627
|
if (!ok) {
|
|
84288
84628
|
reject(new Error(errm));
|
|
84289
84629
|
}
|
|
@@ -84293,35 +84633,34 @@ var ChatLogic = /** @class */ (function () {
|
|
|
84293
84633
|
});
|
|
84294
84634
|
})];
|
|
84295
84635
|
case 2:
|
|
84296
|
-
|
|
84636
|
+
_a.sent();
|
|
84297
84637
|
return [2 /*return*/];
|
|
84298
84638
|
}
|
|
84299
84639
|
});
|
|
84300
84640
|
});
|
|
84301
84641
|
};
|
|
84302
84642
|
ChatLogic.prototype.findChat = function (invitee) {
|
|
84303
|
-
var _a;
|
|
84304
84643
|
return __awaiter(this, void 0, void 0, function () {
|
|
84305
84644
|
var me, podRoot, chatContainer, exists, e_1;
|
|
84306
|
-
return __generator(this, function (
|
|
84307
|
-
switch (
|
|
84645
|
+
return __generator(this, function (_a) {
|
|
84646
|
+
switch (_a.label) {
|
|
84308
84647
|
case 0: return [4 /*yield*/, this.profile.loadMe()];
|
|
84309
84648
|
case 1:
|
|
84310
|
-
me =
|
|
84649
|
+
me = _a.sent();
|
|
84311
84650
|
return [4 /*yield*/, this.profile.getPodRoot(me)];
|
|
84312
84651
|
case 2:
|
|
84313
|
-
podRoot =
|
|
84652
|
+
podRoot = _a.sent();
|
|
84314
84653
|
chatContainer = (0, determineChatContainer_1.determineChatContainer)(invitee, podRoot);
|
|
84315
84654
|
exists = true;
|
|
84316
|
-
|
|
84655
|
+
_a.label = 3;
|
|
84317
84656
|
case 3:
|
|
84318
|
-
|
|
84319
|
-
return [4 /*yield*/,
|
|
84657
|
+
_a.trys.push([3, 5, , 6]);
|
|
84658
|
+
return [4 /*yield*/, this.store.fetcher.load(new rdflib_1.NamedNode(chatContainer.value + "index.ttl#this"))];
|
|
84320
84659
|
case 4:
|
|
84321
|
-
|
|
84660
|
+
_a.sent();
|
|
84322
84661
|
return [3 /*break*/, 6];
|
|
84323
84662
|
case 5:
|
|
84324
|
-
e_1 =
|
|
84663
|
+
e_1 = _a.sent();
|
|
84325
84664
|
exists = false;
|
|
84326
84665
|
return [3 /*break*/, 6];
|
|
84327
84666
|
case 6: return [2 /*return*/, { me: me, chatContainer: chatContainer, exists: exists }];
|
|
@@ -84362,7 +84701,7 @@ var ChatLogic = /** @class */ (function () {
|
|
|
84362
84701
|
kb.add(newInstance, this.ns.dc("author"), newPaneOptions.me, newChatDoc);
|
|
84363
84702
|
}
|
|
84364
84703
|
return new Promise(function (resolve, reject) {
|
|
84365
|
-
updater
|
|
84704
|
+
updater.put(newChatDoc, kb.statementsMatching(undefined, undefined, undefined, newChatDoc), "text/turtle", function (uri2, ok, message) {
|
|
84366
84705
|
if (ok) {
|
|
84367
84706
|
resolve(__assign(__assign({}, newPaneOptions), { newInstance: newInstance }));
|
|
84368
84707
|
}
|
|
@@ -84410,28 +84749,27 @@ var ChatLogic = /** @class */ (function () {
|
|
|
84410
84749
|
});
|
|
84411
84750
|
};
|
|
84412
84751
|
ChatLogic.prototype.sendInvite = function (invitee, chatThing) {
|
|
84413
|
-
var _a, _b;
|
|
84414
84752
|
return __awaiter(this, void 0, void 0, function () {
|
|
84415
84753
|
var inviteeInbox, inviteBody, inviteResponse, locationStr;
|
|
84416
|
-
return __generator(this, function (
|
|
84417
|
-
switch (
|
|
84418
|
-
case 0: return [4 /*yield*/,
|
|
84754
|
+
return __generator(this, function (_a) {
|
|
84755
|
+
switch (_a.label) {
|
|
84756
|
+
case 0: return [4 /*yield*/, this.store.fetcher.load(invitee.doc())];
|
|
84419
84757
|
case 1:
|
|
84420
|
-
|
|
84758
|
+
_a.sent();
|
|
84421
84759
|
inviteeInbox = this.store.any(invitee, this.ns.ldp("inbox"), undefined, invitee.doc());
|
|
84422
84760
|
if (!inviteeInbox) {
|
|
84423
84761
|
throw new Error("Invitee inbox not found! ".concat(invitee.value));
|
|
84424
84762
|
}
|
|
84425
84763
|
inviteBody = "\n<> a <http://www.w3.org/ns/pim/meeting#LongChatInvite> ;\n".concat(this.ns.rdf("seeAlso"), " <").concat(chatThing.value, "> . \n ");
|
|
84426
|
-
return [4 /*yield*/,
|
|
84764
|
+
return [4 /*yield*/, this.store.fetcher.webOperation("POST", inviteeInbox.value, {
|
|
84427
84765
|
data: inviteBody,
|
|
84428
84766
|
contentType: "text/turtle",
|
|
84429
|
-
})
|
|
84767
|
+
})];
|
|
84430
84768
|
case 2:
|
|
84431
|
-
inviteResponse =
|
|
84432
|
-
locationStr = inviteResponse
|
|
84769
|
+
inviteResponse = _a.sent();
|
|
84770
|
+
locationStr = inviteResponse.headers.get("location");
|
|
84433
84771
|
if (!locationStr) {
|
|
84434
|
-
throw new Error("Invite sending returned a ".concat(inviteResponse
|
|
84772
|
+
throw new Error("Invite sending returned a ".concat(inviteResponse.status));
|
|
84435
84773
|
}
|
|
84436
84774
|
return [2 /*return*/];
|
|
84437
84775
|
}
|
|
@@ -84976,19 +85314,18 @@ var ProfileLogic = /** @class */ (function () {
|
|
|
84976
85314
|
this.authn = authn;
|
|
84977
85315
|
}
|
|
84978
85316
|
ProfileLogic.prototype.loadMe = function () {
|
|
84979
|
-
var _a;
|
|
84980
85317
|
return __awaiter(this, void 0, void 0, function () {
|
|
84981
85318
|
var me;
|
|
84982
|
-
return __generator(this, function (
|
|
84983
|
-
switch (
|
|
85319
|
+
return __generator(this, function (_a) {
|
|
85320
|
+
switch (_a.label) {
|
|
84984
85321
|
case 0:
|
|
84985
85322
|
me = this.authn.currentUser();
|
|
84986
85323
|
if (me === null) {
|
|
84987
85324
|
throw new Error("Current user not found! Not logged in?");
|
|
84988
85325
|
}
|
|
84989
|
-
return [4 /*yield*/,
|
|
85326
|
+
return [4 /*yield*/, this.store.fetcher.load(me.doc())];
|
|
84990
85327
|
case 1:
|
|
84991
|
-
|
|
85328
|
+
_a.sent();
|
|
84992
85329
|
return [2 /*return*/, me];
|
|
84993
85330
|
}
|
|
84994
85331
|
});
|
|
@@ -85002,14 +85339,13 @@ var ProfileLogic = /** @class */ (function () {
|
|
|
85002
85339
|
return podRoot;
|
|
85003
85340
|
};
|
|
85004
85341
|
ProfileLogic.prototype.getMainInbox = function (user) {
|
|
85005
|
-
var _a;
|
|
85006
85342
|
return __awaiter(this, void 0, void 0, function () {
|
|
85007
85343
|
var mainInbox;
|
|
85008
|
-
return __generator(this, function (
|
|
85009
|
-
switch (
|
|
85010
|
-
case 0: return [4 /*yield*/,
|
|
85344
|
+
return __generator(this, function (_a) {
|
|
85345
|
+
switch (_a.label) {
|
|
85346
|
+
case 0: return [4 /*yield*/, this.store.fetcher.load(user)];
|
|
85011
85347
|
case 1:
|
|
85012
|
-
|
|
85348
|
+
_a.sent();
|
|
85013
85349
|
mainInbox = this.store.any(user, this.ns.ldp("inbox"), undefined, user.doc());
|
|
85014
85350
|
if (!mainInbox) {
|
|
85015
85351
|
throw new Error("User main inbox not found!");
|
|
@@ -85108,16 +85444,15 @@ var UtilityLogic = /** @class */ (function () {
|
|
|
85108
85444
|
this.fetcher = fetcher;
|
|
85109
85445
|
}
|
|
85110
85446
|
UtilityLogic.prototype.findAclDocUrl = function (url) {
|
|
85111
|
-
var _a;
|
|
85112
85447
|
return __awaiter(this, void 0, void 0, function () {
|
|
85113
85448
|
var doc, docNode;
|
|
85114
|
-
return __generator(this, function (
|
|
85115
|
-
switch (
|
|
85449
|
+
return __generator(this, function (_a) {
|
|
85450
|
+
switch (_a.label) {
|
|
85116
85451
|
case 0:
|
|
85117
85452
|
doc = this.store.sym(url);
|
|
85118
|
-
return [4 /*yield*/,
|
|
85453
|
+
return [4 /*yield*/, this.store.fetcher.load(doc)];
|
|
85119
85454
|
case 1:
|
|
85120
|
-
|
|
85455
|
+
_a.sent();
|
|
85121
85456
|
docNode = this.store.any(doc, exports.ACL_LINK);
|
|
85122
85457
|
if (!docNode) {
|
|
85123
85458
|
throw new Error("No ACL link discovered for ".concat(url));
|
|
@@ -85235,16 +85570,15 @@ var UtilityLogic = /** @class */ (function () {
|
|
|
85235
85570
|
.map(function (st) { return st.object; });
|
|
85236
85571
|
};
|
|
85237
85572
|
UtilityLogic.prototype.getContainerMembers = function (containerUrl) {
|
|
85238
|
-
var _a;
|
|
85239
85573
|
return __awaiter(this, void 0, void 0, function () {
|
|
85240
85574
|
var containerNode, nodes;
|
|
85241
|
-
return __generator(this, function (
|
|
85242
|
-
switch (
|
|
85575
|
+
return __generator(this, function (_a) {
|
|
85576
|
+
switch (_a.label) {
|
|
85243
85577
|
case 0:
|
|
85244
85578
|
containerNode = this.store.sym(containerUrl);
|
|
85245
|
-
return [4 /*yield*/,
|
|
85579
|
+
return [4 /*yield*/, this.store.fetcher.load(containerNode)];
|
|
85246
85580
|
case 1:
|
|
85247
|
-
|
|
85581
|
+
_a.sent();
|
|
85248
85582
|
nodes = this.getContainerElements(containerNode);
|
|
85249
85583
|
return [2 /*return*/, nodes.map(function (node) { return node.value; })];
|
|
85250
85584
|
}
|