solid-ui 2.4.22-d52421dc → 2.4.22-d6a4e62e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +9579 -9553
- package/dist/main.js.map +1 -1
- package/lib/acl/access-controller.js +14 -9
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +15 -10
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +13 -9
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +11 -7
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +18 -13
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/chat/bookmarks.js +21 -18
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +15 -9
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +17 -12
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +37 -29
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js +14 -14
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +23 -10
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +9 -4
- package/lib/chat/thread.js.map +1 -1
- package/lib/footer/index.js +10 -8
- package/lib/footer/index.js.map +1 -1
- package/lib/header/index.js +17 -9
- package/lib/header/index.js.map +1 -1
- package/lib/iconBase.js +3 -2
- package/lib/iconBase.js.map +1 -1
- package/lib/login/login.d.ts +9 -8
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +303 -313
- package/lib/login/login.js.map +1 -1
- package/lib/media/media-capture.js +20 -4
- package/lib/media/media-capture.js.map +1 -1
- package/lib/tabs.d.ts.map +1 -1
- package/lib/tabs.js +21 -18
- package/lib/tabs.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +7 -5
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/versionInfo.d.ts +9 -9
- package/lib/versionInfo.js +13 -13
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/error.d.ts +0 -12
- package/lib/widgets/error.d.ts.map +1 -1
- package/lib/widgets/error.js +5 -0
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +15 -17
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +8 -5
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +19 -21
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +15 -8
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +27 -22
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms.js +270 -27
- package/lib/widgets/forms.js.map +1 -1
- package/package.json +46 -44
package/lib/chat/infinite.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
@@ -11,7 +11,7 @@ exports.desktopNotification = desktopNotification;
|
|
|
11
11
|
exports.infiniteMessageArea = infiniteMessageArea;
|
|
12
12
|
exports.insertMessageIntoTable = insertMessageIntoTable;
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
15
|
|
|
16
16
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
17
|
|
|
@@ -33,10 +33,18 @@ var _message = require("./message");
|
|
|
33
33
|
|
|
34
34
|
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); }
|
|
35
35
|
|
|
36
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
37
|
-
|
|
38
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == (0, _typeof2["default"])(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
36
|
+
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; }
|
|
39
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Contains the [[infiniteMessageArea]] class
|
|
40
|
+
* @packageDocumentation
|
|
41
|
+
*/
|
|
42
|
+
// import { findBookmarkDocument } from './bookmarks'
|
|
43
|
+
// pull in first avoid cross-refs
|
|
44
|
+
// import * as style from '../style'
|
|
45
|
+
// import * as utils from '../utils'
|
|
46
|
+
// import * as pad from '../pad'
|
|
47
|
+
// import { DateFolder } from './dateFolder'
|
|
40
48
|
// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }
|
|
41
49
|
function desktopNotification(str) {
|
|
42
50
|
// Let's check if the browser supports notifications
|
|
@@ -124,17 +132,17 @@ function infiniteMessageArea(_x, _x2, _x3, _x4) {
|
|
|
124
132
|
}
|
|
125
133
|
|
|
126
134
|
function _infiniteMessageArea() {
|
|
127
|
-
_infiniteMessageArea = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
135
|
+
_infiniteMessageArea = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(dom, wasStore, chatChannel, options) {
|
|
128
136
|
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;
|
|
129
137
|
|
|
130
|
-
return
|
|
138
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
131
139
|
while (1) {
|
|
132
140
|
switch (_context12.prev = _context12.next) {
|
|
133
141
|
case 0:
|
|
134
142
|
_loadInitialContent = function _loadInitialContent3() {
|
|
135
|
-
_loadInitialContent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
143
|
+
_loadInitialContent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
|
|
136
144
|
var yank, fixScroll, live, selectedDocument, now, todayDocument, selectedMessageTable, selectedDate;
|
|
137
|
-
return
|
|
145
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
138
146
|
while (1) {
|
|
139
147
|
switch (_context11.prev = _context11.next) {
|
|
140
148
|
case 0:
|
|
@@ -217,9 +225,9 @@ function _infiniteMessageArea() {
|
|
|
217
225
|
};
|
|
218
226
|
|
|
219
227
|
_loadMoreWhereNeeded = function _loadMoreWhereNeeded3() {
|
|
220
|
-
_loadMoreWhereNeeded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
228
|
+
_loadMoreWhereNeeded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(event, fixScroll) {
|
|
221
229
|
var freeze, magicZone, done, scrollBottom, scrollTop;
|
|
222
|
-
return
|
|
230
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
223
231
|
while (1) {
|
|
224
232
|
switch (_context10.prev = _context10.next) {
|
|
225
233
|
case 0:
|
|
@@ -333,9 +341,9 @@ function _infiniteMessageArea() {
|
|
|
333
341
|
};
|
|
334
342
|
|
|
335
343
|
_appendCurrentMessages = function _appendCurrentMessage2() {
|
|
336
|
-
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
344
|
+
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
|
337
345
|
var now, chatDocument, messageTable;
|
|
338
|
-
return
|
|
346
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
339
347
|
while (1) {
|
|
340
348
|
switch (_context9.prev = _context9.next) {
|
|
341
349
|
case 0:
|
|
@@ -348,8 +356,8 @@ function _infiniteMessageArea() {
|
|
|
348
356
|
case 4:
|
|
349
357
|
messageTable = _context9.sent;
|
|
350
358
|
div.appendChild(messageTable);
|
|
351
|
-
div.refresh = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
352
|
-
return
|
|
359
|
+
div.refresh = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
360
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
353
361
|
while (1) {
|
|
354
362
|
switch (_context8.prev = _context8.next) {
|
|
355
363
|
case 0:
|
|
@@ -391,9 +399,9 @@ function _infiniteMessageArea() {
|
|
|
391
399
|
};
|
|
392
400
|
|
|
393
401
|
_addNewChatDocumentIfNewDay = function _addNewChatDocumentIf2() {
|
|
394
|
-
_addNewChatDocumentIfNewDay = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
402
|
+
_addNewChatDocumentIfNewDay = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
395
403
|
var newChatDocument, oldChatDocument, sts;
|
|
396
|
-
return
|
|
404
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
397
405
|
while (1) {
|
|
398
406
|
switch (_context7.prev = _context7.next) {
|
|
399
407
|
case 0:
|
|
@@ -450,9 +458,9 @@ function _infiniteMessageArea() {
|
|
|
450
458
|
}
|
|
451
459
|
|
|
452
460
|
function _extendBackwards() {
|
|
453
|
-
_extendBackwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
461
|
+
_extendBackwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
454
462
|
var done;
|
|
455
|
-
return
|
|
463
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
456
464
|
while (1) {
|
|
457
465
|
switch (_context.prev = _context.next) {
|
|
458
466
|
case 0:
|
|
@@ -507,8 +515,8 @@ function _infiniteMessageArea() {
|
|
|
507
515
|
|
|
508
516
|
|
|
509
517
|
function _scrollBackbuttonHandler() {
|
|
510
|
-
_scrollBackbuttonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
511
|
-
return
|
|
518
|
+
_scrollBackbuttonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
|
|
519
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
512
520
|
while (1) {
|
|
513
521
|
switch (_context2.prev = _context2.next) {
|
|
514
522
|
case 0:
|
|
@@ -542,9 +550,9 @@ function _infiniteMessageArea() {
|
|
|
542
550
|
}
|
|
543
551
|
|
|
544
552
|
function _extendForwards() {
|
|
545
|
-
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
553
|
+
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
546
554
|
var done;
|
|
547
|
-
return
|
|
555
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
548
556
|
while (1) {
|
|
549
557
|
switch (_context3.prev = _context3.next) {
|
|
550
558
|
case 0:
|
|
@@ -603,8 +611,8 @@ function _infiniteMessageArea() {
|
|
|
603
611
|
|
|
604
612
|
|
|
605
613
|
function _scrollForwardButtonHandler() {
|
|
606
|
-
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
607
|
-
return
|
|
614
|
+
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
|
|
615
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
608
616
|
while (1) {
|
|
609
617
|
switch (_context4.prev = _context4.next) {
|
|
610
618
|
case 0:
|
|
@@ -720,9 +728,9 @@ function _infiniteMessageArea() {
|
|
|
720
728
|
};
|
|
721
729
|
|
|
722
730
|
_createMessageTable = function _createMessageTable3() {
|
|
723
|
-
_createMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
731
|
+
_createMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(date, live) {
|
|
724
732
|
var chatDocument, messageTable, statusTR;
|
|
725
|
-
return
|
|
733
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
726
734
|
while (1) {
|
|
727
735
|
switch (_context6.prev = _context6.next) {
|
|
728
736
|
case 0:
|
|
@@ -792,9 +800,9 @@ function _infiniteMessageArea() {
|
|
|
792
800
|
};
|
|
793
801
|
|
|
794
802
|
_insertPreviousMessages = function _insertPreviousMessag2() {
|
|
795
|
-
_insertPreviousMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
803
|
+
_insertPreviousMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(backwards) {
|
|
796
804
|
var extremity, date, live, todayDoc, doc, newMessageTable;
|
|
797
|
-
return
|
|
805
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
798
806
|
while (1) {
|
|
799
807
|
switch (_context5.prev = _context5.next) {
|
|
800
808
|
case 0:
|
package/lib/chat/infinite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infinite.js","names":["desktopNotification","str","window","debug","warn","Notification","permission","requestPermission","then","insertMessageIntoTable","channelObject","messageTable","message","fresh","options","userContext","messageRow","renderMessageRow","selectedMessage","sameTerm","style","backgroundColor","selectedElement","done","ele","firstChild","nextSibling","newestFirst","newestfirst","dateString","AJAR_date","insertBefore","appendChild","infiniteMessageArea","dom","wasStore","chatChannel","syncMessages","addMessage","insertPreviousMessages","removePreviousMessages","createMessageTable","renderMessageTable","addNewChatDocumentIfNewDay","appendCurrentMessages","loadMoreWhereNeeded","loadInitialContent","yank","fixScroll","scrollIntoView","block","liveMessageTable","inputRow","selectedMessageTable","selectedDocument","doc","now","Date","todayDocument","dateFolder","leafDocumentFromDate","live","selectedDate","dateFromLeafDocument","div","earliest","latest","setTimeout","addEventListener","solo","document","body","event","lock","freeze","magicZone","scrollTop","initial","extendBackwards","scrollHeight","scrollBottom","log","clientHeight","extendForwards","chatDocument","refresh","store","updater","addDownstreamChangeListener","newChatDocument","removeChild","oldChatDocument","holds","ns","rdfs","sts","$rdf","st","update","err","alert","date","scrollBackbutton","scrollForwardButton","setAttribute","icons","iconBase","disabled","extendedBack","setScrollBackbuttonIcon","sense","scrollBackIcon","getScrollbackIcon","scrollBackbuttonHandler","_event","extendedForwards","setScrollForwardButtonIcon","scrollForwardIcon","getScrollForwardButtonIcon","scrollForwardButtonHandler","createElement","tr","renderMessageEditor","infinite","scrollBackbuttonTR","scrollBackbuttonCell","widgets","button","dateCell","textContent","shortDate","toISOString","scrollForwardButtonCell","extendedForward","statementsMatching","wf","length","forEach","object","fetcher","load","statusTR","response","status","errorMessageBlock","backwards","previousSibling","extr","extremity","loadPrevious","todayDoc","newMessageTable","mostRecentVersion","isDeleted","showDeletedMessages","about","displayed","ele2","AJAR_subject","uri","messages","map","stored","m","refreshTree","authorDateOnLeft","ChatChannel","statusArea"],"sources":["../../src/chat/infinite.js"],"sourcesContent":["/**\n * Contains the [[infiniteMessageArea]] class\n * @packageDocumentation\n */\n// import { findBookmarkDocument } from './bookmarks'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport { store } from 'solid-logic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport * as ns from '../ns'\n// import * as style from '../style'\n// import * as utils from '../utils'\nimport * as widgets from '../widgets'\n// import * as pad from '../pad'\n// import { DateFolder } from './dateFolder'\nimport { ChatChannel, isDeleted, mostRecentVersion } from './chatLogic'\nimport { renderMessageEditor, renderMessageRow } from './message'\n\n// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }\n\nexport function desktopNotification (str) {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n debug.warn('This browser does no t support desktop notification')\n } else if (Notification.permission === 'granted') {\n // Let's check whether notificatio n permissions have already been granted\n // eslint-disable-next-line no-new\n new Notification(str)\n } else if (Notification.permission !== 'denied') {\n // Otherwise, we need to ask the user for permission\n Notification.requestPermission().then(function (permission) {\n // If the user accepts, let's create a notification\n if (permission === 'granted') {\n // eslint-disable-next-line no-new\n new Notification(str)\n }\n })\n }\n // At last, if the user has denied notifications, and you\n // want to be respectful there is no need to bother them any more.\n}\n\n/**\n * Renders a chat message inside a `messageTable`\n */\nexport function insertMessageIntoTable (channelObject, messageTable, message, fresh, options, userContext) {\n const messageRow = renderMessageRow(channelObject,\n message,\n fresh,\n options,\n userContext\n )\n\n // const message = messageRow.AJAR_subject\n if (options.selectedMessage && options.selectedMessage.sameTerm(message)) {\n messageRow.style.backgroundColor = 'yellow'\n options.selectedElement = messageRow\n messageTable.selectedElement = messageRow\n }\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n const newestFirst = options.newestfirst === true\n const dateString = messageRow.AJAR_date\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(messageRow, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(messageRow)\n }\n}\n\n/**\n * Common code for a chat (discussion area of messages about something)\n * This version runs over a series of files for different time periods\n *\n * Parameters for the whole chat like its title are stored on\n * index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl\n *\n * Use to import store as param 2, now ignores it and uses the UI main store\n *\n * Options include:\n\n - shiftEnterSendsMessage: Use shift/enter to send message, Enter to add newline, instead of the reverse.\n - authorDateOnLeft: Display the author's anme and date of the message in the left column instead of first above the content\n - selectedMessage: Display one message highlighted with the chat around it\n - solo: By itelf on a webpage, so user scroll anywhere in the web page scan scroll the chat.\n - newestFirst: Arrange the chat messages chronologically newest at the top insted of at the bottom\n - infinite: Use infinite scroll\n - showDeletedMessages: Show messages which have been delted as \"deleted message\". Otherwise hide them.\n - expandImagesInline: If a URI by itself in a message looks like an image URI, replace it with the image\n - inlineImageHeightEms: The height (in ems) of images expaned from their URIs in the chat.\n\n */\nexport async function infiniteMessageArea (dom, wasStore, chatChannel, options) {\n // ///////////////////////////////////////////////////////////////////////\n\n function syncMessages (about, messageTable) {\n const displayed = {}\n let ele, ele2\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n displayed[ele.AJAR_subject.uri] = true\n }\n }\n\n const messages = store\n .statementsMatching(\n about,\n ns.wf('message'),\n null,\n messageTable.chatDocument\n )\n .map(st => {\n return st.object\n })\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n addMessage(m, messageTable)\n }\n })\n\n // eslint-disable-next-line space-in-parens\n for (ele = messageTable.firstChild; ele;) {\n ele2 = ele.nextSibling\n if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {\n messageTable.removeChild(ele)\n }\n ele = ele2\n }\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n // Refresh thumbs up etc\n widgets.refreshTree(ele) // Things inside may have changed too\n }\n }\n } // syncMessages\n\n // Called once per original message displayed\n function addMessage (message, messageTable) {\n const latest = mostRecentVersion(message)\n // const content = store.any(latest, ns.sioc('content'))\n if (isDeleted(latest) && !options.showDeletedMessages) {\n return // ignore deleted messaged -- @@ could also leave a placeholder\n }\n insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\n }\n\n /* Add a new messageTable at the top/bottom\n */\n async function insertPreviousMessages (backwards) {\n const extremity = backwards ? earliest : latest\n let date = extremity.messageTable.date // day in mssecs\n\n date = await dateFolder.loadPrevious(date, backwards) // backwards\n debug.log(\n `insertPreviousMessages: from ${\n backwards ? 'backwards' : 'forwards'\n } loadPrevious: ${date}`\n )\n if (!date && !backwards && !liveMessageTable) {\n await appendCurrentMessages() // If necessary skip to today and add that\n }\n if (!date) return true // done\n let live = false\n if (!backwards) {\n const todayDoc = dateFolder.leafDocumentFromDate(new Date())\n const doc = dateFolder.leafDocumentFromDate(date)\n live = doc.sameTerm(todayDoc) // Is this todays?\n }\n const newMessageTable = await createMessageTable(date, live)\n extremity.messageTable = newMessageTable // move pointer to earliest\n if (backwards ? newestFirst : !newestFirst) {\n // put on bottom or top\n div.appendChild(newMessageTable)\n } else {\n // put on top as we scroll back\n div.insertBefore(newMessageTable, div.firstChild)\n }\n return live // not done\n }\n\n /* Remove message tables earlier than this one\n */\n function removePreviousMessages (backwards, messageTable) {\n if (backwards ? newestFirst : !newestFirst) {\n // it was put on bottom\n while (messageTable.nextSibling) {\n div.removeChild(messageTable.nextSibling)\n }\n } else {\n // it was put on top as we scroll back\n while (messageTable.previousSibling) {\n div.removeChild(messageTable.previousSibling)\n }\n }\n const extr = backwards ? earliest : latest\n extr.messageTable = messageTable\n }\n\n /* Load and render message table\n ** @returns DOM element generates\n */\n async function createMessageTable (date, live) {\n debug.log(' createMessageTable for ' + date)\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n try {\n await store.fetcher.load(chatDocument)\n } catch (err) {\n const messageTable = dom.createElement('table')\n const statusTR = messageTable.appendChild(dom.createElement('tr')) // ### find status in exception\n if (err.response && err.response.status && err.response.status === 404) {\n debug.log('Error 404 for chat file ' + chatDocument)\n return renderMessageTable(date, live) // no mssage file is fine.. will be craeted later\n // statusTR.appendChild(widgets.errorMessageBlock(dom, 'no message file', 'white'))\n } else {\n debug.log('*** Error NON 404 for chat file ' + chatDocument)\n statusTR.appendChild(widgets.errorMessageBlock(dom, err, 'pink'))\n }\n return statusTR\n }\n return renderMessageTable(date, live)\n }\n\n function renderMessageTable (date, live) {\n let scrollBackbutton\n let scrollForwardButton\n\n /// ///////////////// Scroll down adding more above\n\n async function extendBackwards () {\n const done = await insertPreviousMessages(true)\n if (done) {\n if (scrollBackbutton) {\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n ) // T\n scrollBackbutton.disabled = true\n }\n messageTable.initial = true\n } else {\n messageTable.extendedBack = true\n }\n setScrollBackbuttonIcon()\n return done\n }\n\n function setScrollBackbuttonIcon () {\n if (!scrollBackbutton) {\n return\n }\n const sense = messageTable.extendedBack ? !newestFirst : newestFirst\n const scrollBackIcon = messageTable.initial\n ? 'noun_T-Block_1114655_000000.svg'\n : getScrollbackIcon(sense)\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollBackIcon\n )\n\n function getScrollbackIcon (sense) {\n return sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n async function scrollBackbuttonHandler (_event) {\n if (messageTable.extendedBack) {\n removePreviousMessages(true, messageTable)\n messageTable.extendedBack = false\n setScrollBackbuttonIcon()\n } else {\n await extendBackwards()\n }\n }\n\n /// ////////////// Scroll up adding more below\n\n async function extendForwards () {\n const done = await insertPreviousMessages(false)\n if (done) {\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n )\n scrollForwardButton.disabled = true\n messageTable.final = true\n } else {\n messageTable.extendedForwards = true\n }\n setScrollForwardButtonIcon()\n return done\n }\n\n function setScrollForwardButtonIcon () {\n const sense = messageTable.extendedForwards ? !newestFirst : newestFirst // noun_T-Block_1114657_000000.svg\n const scrollForwardIcon = messageTable.final\n ? 'noun_T-Block_1114657_000000.svg'\n : getScrollForwardButtonIcon(sense)\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollForwardIcon\n )\n\n function getScrollForwardButtonIcon (sense) {\n return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n async function scrollForwardButtonHandler (_event) {\n if (messageTable.extendedForwards) {\n removePreviousMessages(false, messageTable)\n messageTable.extendedForwards = false\n setScrollForwardButtonIcon()\n } else {\n await extendForwards() // async\n latest.messageTable.scrollIntoView(newestFirst)\n }\n }\n\n /// ///////////////////////\n /*\n options = options || {}\n options.authorDateOnLeft = true\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n*/\n const messageTable = dom.createElement('table')\n\n messageTable.extendBackwards = extendBackwards // Make function available to scroll stuff\n messageTable.extendForwards = extendForwards // Make function available to scroll stuff\n\n messageTable.date = date\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n messageTable.chatDocument = chatDocument\n\n messageTable.fresh = false\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n if (live) {\n messageTable.final = true\n liveMessageTable = messageTable\n latest.messageTable = messageTable\n const tr = renderMessageEditor(channelObject, messageTable, userContext, options)\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n messageTable.inputRow = tr\n }\n\n /// ///// Infinite scroll\n //\n // @@ listen for swipe past end event not just button\n if (options.infinite) {\n const scrollBackbuttonTR = dom.createElement('tr')\n const scrollBackbuttonCell = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\n )\n // up traingles: noun_1369237.svg\n // down triangles: noun_1369241.svg\n const scrollBackIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollBackbutton = widgets.button(\n dom,\n icons.iconBase + scrollBackIcon,\n 'Previous messages ...'\n )\n scrollBackbuttonCell.style = 'width:3em; height:3em;'\n scrollBackbutton.addEventListener('click', scrollBackbuttonHandler, false)\n messageTable.extendedBack = false\n scrollBackbuttonCell.appendChild(scrollBackbutton)\n setScrollBackbuttonIcon()\n\n const dateCell = scrollBackbuttonTR.appendChild(dom.createElement('td'))\n dateCell.style =\n 'text-align: center; vertical-align: middle; color: #888; font-style: italic;'\n dateCell.textContent = widgets.shortDate(date.toISOString(), true) // no time, only date\n\n // @@@@@@@@@@@ todo move this button to other end of message cell, o\n const scrollForwardButtonCell = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\n )\n const scrollForwardIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollForwardButton = widgets.button(\n dom,\n icons.iconBase + scrollForwardIcon,\n 'Later messages ...'\n )\n scrollForwardButtonCell.appendChild(scrollForwardButton)\n scrollForwardButtonCell.style = 'width:3em; height:3em;'\n scrollForwardButton.addEventListener(\n 'click',\n scrollForwardButtonHandler,\n false\n )\n messageTable.extendedForward = false\n setScrollForwardButtonIcon()\n\n messageTable.extendedForwards = false\n\n if (!newestFirst) {\n // opposite end from the entry field\n messageTable.insertBefore(scrollBackbuttonTR, messageTable.firstChild) // If not newestFirst\n } else {\n messageTable.appendChild(scrollBackbuttonTR) // newestFirst\n }\n }\n\n const sts = store.statementsMatching(null, ns.wf('message'), null, chatDocument)\n if (!live && sts.length === 0) {\n // not todays\n // no need buttomns at the moment\n // messageTable.style.visibility = 'collapse' // Hide files with no messages\n }\n sts.forEach(st => {\n addMessage(st.object, messageTable)\n })\n messageTable.fresh = true\n\n // loadMessageTable(messageTable, chatDocument)\n messageTable.fresh = false\n return messageTable\n } // renderMessageTable\n\n async function addNewChatDocumentIfNewDay () {\n // @@ Remove listener from previous table as it is now static\n const newChatDocument = dateFolder.leafDocumentFromDate(new Date())\n if (!newChatDocument.sameTerm(latest.messageTable.chatDocument)) {\n // It is a new day\n if (liveMessageTable.inputRow) {\n liveMessageTable.removeChild(liveMessageTable.inputRow)\n delete liveMessageTable.inputRow\n }\n const oldChatDocument = latest.messageTable.chatDocument\n await appendCurrentMessages()\n // Adding a link in the document will ping listeners to add the new block too\n if (\n !store.holds(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ) {\n const sts = [\n $rdf.st(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ]\n try {\n store.updater.update([], sts)\n } catch (err) {\n alert('Unable to link old chat file to new one:' + err)\n }\n }\n }\n }\n\n /*\n function messageCount () {\n var n = 0\n const tables = div.children\n for (let i = 0; i < tables.length; i++) {\n n += tables[i].children.length - 1\n // debug.log(' table length:' + tables[i].children.length)\n }\n return n\n }\n*/\n\n /* Add the live message block with entry field for today\n */\n async function appendCurrentMessages () {\n const now = new Date()\n const chatDocument = dateFolder.leafDocumentFromDate(now)\n\n /// ///////////////////////////////////////////////////////////\n const messageTable = await createMessageTable(now, true)\n div.appendChild(messageTable)\n div.refresh = async function () {\n // only the last messageTable is live\n await addNewChatDocumentIfNewDay(new Date())\n syncMessages(chatChannel, messageTable) // @@ livemessagetable??\n desktopNotification(chatChannel)\n } // The short chat version the live update listening is done in the pane but we do it in the widget @@\n store.updater.addDownstreamChangeListener(chatDocument, div.refresh) // Live update\n liveMessageTable = messageTable\n latest.messageTable = liveMessageTable\n return messageTable\n }\n\n async function loadMoreWhereNeeded (event, fixScroll) {\n if (lock) return\n lock = true\n const freeze = !fixScroll\n const magicZone = 150\n // const top = div.scrollTop\n // const bottom = div.scrollHeight - top - div.clientHeight\n let done\n\n while (\n div.scrollTop < magicZone &&\n earliest.messageTable &&\n !earliest.messageTable.initial &&\n earliest.messageTable.extendBackwards\n ) {\n // If this has been called before the element is actually in the\n // user's DOM tree, then this scrollTop check won't work -> loop forever\n // https://github.com/solidos/solid-ui/issues/366\n if (div.scrollHeight === 0) {\n // console.log(' chat/loadMoreWhereNeeded: trying later...')\n setTimeout(loadMoreWhereNeeded, 2000) // couple be less\n lock = false\n return // abandon now, do later\n }\n // console.log(' chat/loadMoreWhereNeeded: Going now')\n const scrollBottom = div.scrollHeight - div.scrollTop\n debug.log('infinite scroll: adding above: top ' + div.scrollTop)\n done = await earliest.messageTable.extendBackwards()\n if (freeze) {\n div.scrollTop = div.scrollHeight - scrollBottom\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n while (\n options.selectedMessage && // we started in the middle not at the bottom\n div.scrollHeight - div.scrollTop - div.clientHeight < magicZone && // we are scrolled right to the bottom\n latest.messageTable &&\n !latest.messageTable.final && // there is more data to come\n latest.messageTable.extendForwards\n ) {\n const scrollTop = div.scrollTop\n debug.log(\n 'infinite scroll: adding below: bottom: ' +\n (div.scrollHeight - div.scrollTop - div.clientHeight)\n )\n done = await latest.messageTable.extendForwards() // then add more data on the bottom\n if (freeze) {\n div.scrollTop = scrollTop // while adding below keep same things in view\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n lock = false\n }\n\n async function loadInitialContent () {\n function yank () {\n selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })\n }\n\n // During initial load ONLY keep scroll to selected thing or bottom\n function fixScroll () {\n if (options.selectedElement) {\n options.selectedElement.scrollIntoView({ block: 'center' }) // align tops or bottoms\n } else {\n if (liveMessageTable.inputRow.scrollIntoView) {\n liveMessageTable.inputRow.scrollIntoView(newestFirst) // align tops or bottoms\n }\n }\n }\n\n let live, selectedDocument\n if (options.selectedMessage) {\n selectedDocument = options.selectedMessage.doc()\n const now = new Date()\n const todayDocument = dateFolder.leafDocumentFromDate(now)\n live = todayDocument.sameTerm(selectedDocument)\n }\n let selectedMessageTable\n if (options.selectedMessage && !live) {\n const selectedDate = dateFolder.dateFromLeafDocument(selectedDocument)\n selectedMessageTable = await createMessageTable(selectedDate, live)\n div.appendChild(selectedMessageTable)\n earliest.messageTable = selectedMessageTable\n latest.messageTable = selectedMessageTable\n yank()\n setTimeout(yank, 1000) // @@ kludge - restore position distubed by other cHANGES\n } else {\n // Live end\n await appendCurrentMessages()\n earliest.messageTable = liveMessageTable\n latest.messageTable = liveMessageTable\n }\n\n await loadMoreWhereNeeded(null, fixScroll)\n div.addEventListener('scroll', loadMoreWhereNeeded)\n if (options.solo) {\n document.body.addEventListener('scroll', loadMoreWhereNeeded)\n }\n }\n\n // Body of main function\n\n options = options || {}\n options.authorDateOnLeft = false // @@ make a user optiosn\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n channelObject.div = div\n\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n // const messageTable = dom.createElement('table') // @@ check does this go in renderMessageTable\n\n let liveMessageTable\n const earliest = { messageTable: null } // Stuff about each end of the loaded days\n const latest = { messageTable: null }\n\n let lock = false\n\n await loadInitialContent()\n return div\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AAGA;;AACA;;;;;;+CAfA,oJ;;AAiBA;AAEO,SAASA,mBAAT,CAA8BC,GAA9B,EAAmC;EACxC;EACA,IAAI,EAAE,kBAAkBC,MAApB,CAAJ,EAAiC;IAC/BC,KAAK,CAACC,IAAN,CAAW,qDAAX;EACD,CAFD,MAEO,IAAIC,YAAY,CAACC,UAAb,KAA4B,SAAhC,EAA2C;IAChD;IACA;IACA,IAAID,YAAJ,CAAiBJ,GAAjB;EACD,CAJM,MAIA,IAAII,YAAY,CAACC,UAAb,KAA4B,QAAhC,EAA0C;IAC/C;IACAD,YAAY,CAACE,iBAAb,GAAiCC,IAAjC,CAAsC,UAAUF,UAAV,EAAsB;MAC1D;MACA,IAAIA,UAAU,KAAK,SAAnB,EAA8B;QAC5B;QACA,IAAID,YA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OA+hBC3B,kBAAkB,EA/hBnB;;UAAA;YAAA,mCAgiBEkB,GAhiBF;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C"}
|
|
1
|
+
{"version":3,"file":"infinite.js","names":["desktopNotification","str","window","debug","warn","Notification","permission","requestPermission","then","insertMessageIntoTable","channelObject","messageTable","message","fresh","options","userContext","messageRow","renderMessageRow","selectedMessage","sameTerm","style","backgroundColor","selectedElement","done","ele","firstChild","nextSibling","newestFirst","newestfirst","dateString","AJAR_date","insertBefore","appendChild","infiniteMessageArea","dom","wasStore","chatChannel","syncMessages","addMessage","insertPreviousMessages","removePreviousMessages","createMessageTable","renderMessageTable","addNewChatDocumentIfNewDay","appendCurrentMessages","loadMoreWhereNeeded","loadInitialContent","yank","fixScroll","scrollIntoView","block","liveMessageTable","inputRow","selectedMessageTable","selectedDocument","doc","now","Date","todayDocument","dateFolder","leafDocumentFromDate","live","selectedDate","dateFromLeafDocument","div","earliest","latest","setTimeout","addEventListener","solo","document","body","event","lock","freeze","magicZone","scrollTop","initial","extendBackwards","scrollHeight","scrollBottom","log","clientHeight","extendForwards","chatDocument","refresh","store","updater","addDownstreamChangeListener","newChatDocument","removeChild","oldChatDocument","holds","ns","rdfs","sts","$rdf","st","update","err","alert","date","scrollBackbutton","scrollForwardButton","setAttribute","icons","iconBase","disabled","extendedBack","setScrollBackbuttonIcon","sense","scrollBackIcon","getScrollbackIcon","scrollBackbuttonHandler","_event","extendedForwards","setScrollForwardButtonIcon","scrollForwardIcon","getScrollForwardButtonIcon","scrollForwardButtonHandler","createElement","tr","renderMessageEditor","infinite","scrollBackbuttonTR","scrollBackbuttonCell","widgets","button","dateCell","textContent","shortDate","toISOString","scrollForwardButtonCell","extendedForward","statementsMatching","wf","length","forEach","object","fetcher","load","statusTR","response","status","errorMessageBlock","backwards","previousSibling","extr","extremity","loadPrevious","todayDoc","newMessageTable","mostRecentVersion","isDeleted","showDeletedMessages","about","displayed","ele2","AJAR_subject","uri","messages","map","stored","m","refreshTree","authorDateOnLeft","ChatChannel","statusArea"],"sources":["../../src/chat/infinite.js"],"sourcesContent":["/**\n * Contains the [[infiniteMessageArea]] class\n * @packageDocumentation\n */\n// import { findBookmarkDocument } from './bookmarks'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport { store } from 'solid-logic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport * as ns from '../ns'\n// import * as style from '../style'\n// import * as utils from '../utils'\nimport * as widgets from '../widgets'\n// import * as pad from '../pad'\n// import { DateFolder } from './dateFolder'\nimport { ChatChannel, isDeleted, mostRecentVersion } from './chatLogic'\nimport { renderMessageEditor, renderMessageRow } from './message'\n\n// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }\n\nexport function desktopNotification (str) {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n debug.warn('This browser does no t support desktop notification')\n } else if (Notification.permission === 'granted') {\n // Let's check whether notificatio n permissions have already been granted\n // eslint-disable-next-line no-new\n new Notification(str)\n } else if (Notification.permission !== 'denied') {\n // Otherwise, we need to ask the user for permission\n Notification.requestPermission().then(function (permission) {\n // If the user accepts, let's create a notification\n if (permission === 'granted') {\n // eslint-disable-next-line no-new\n new Notification(str)\n }\n })\n }\n // At last, if the user has denied notifications, and you\n // want to be respectful there is no need to bother them any more.\n}\n\n/**\n * Renders a chat message inside a `messageTable`\n */\nexport function insertMessageIntoTable (channelObject, messageTable, message, fresh, options, userContext) {\n const messageRow = renderMessageRow(channelObject,\n message,\n fresh,\n options,\n userContext\n )\n\n // const message = messageRow.AJAR_subject\n if (options.selectedMessage && options.selectedMessage.sameTerm(message)) {\n messageRow.style.backgroundColor = 'yellow'\n options.selectedElement = messageRow\n messageTable.selectedElement = messageRow\n }\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n const newestFirst = options.newestfirst === true\n const dateString = messageRow.AJAR_date\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(messageRow, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(messageRow)\n }\n}\n\n/**\n * Common code for a chat (discussion area of messages about something)\n * This version runs over a series of files for different time periods\n *\n * Parameters for the whole chat like its title are stored on\n * index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl\n *\n * Use to import store as param 2, now ignores it and uses the UI main store\n *\n * Options include:\n\n - shiftEnterSendsMessage: Use shift/enter to send message, Enter to add newline, instead of the reverse.\n - authorDateOnLeft: Display the author's anme and date of the message in the left column instead of first above the content\n - selectedMessage: Display one message highlighted with the chat around it\n - solo: By itelf on a webpage, so user scroll anywhere in the web page scan scroll the chat.\n - newestFirst: Arrange the chat messages chronologically newest at the top insted of at the bottom\n - infinite: Use infinite scroll\n - showDeletedMessages: Show messages which have been delted as \"deleted message\". Otherwise hide them.\n - expandImagesInline: If a URI by itself in a message looks like an image URI, replace it with the image\n - inlineImageHeightEms: The height (in ems) of images expaned from their URIs in the chat.\n\n */\nexport async function infiniteMessageArea (dom, wasStore, chatChannel, options) {\n // ///////////////////////////////////////////////////////////////////////\n\n function syncMessages (about, messageTable) {\n const displayed = {}\n let ele, ele2\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n displayed[ele.AJAR_subject.uri] = true\n }\n }\n\n const messages = store\n .statementsMatching(\n about,\n ns.wf('message'),\n null,\n messageTable.chatDocument\n )\n .map(st => {\n return st.object\n })\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n addMessage(m, messageTable)\n }\n })\n\n // eslint-disable-next-line space-in-parens\n for (ele = messageTable.firstChild; ele;) {\n ele2 = ele.nextSibling\n if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {\n messageTable.removeChild(ele)\n }\n ele = ele2\n }\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n // Refresh thumbs up etc\n widgets.refreshTree(ele) // Things inside may have changed too\n }\n }\n } // syncMessages\n\n // Called once per original message displayed\n function addMessage (message, messageTable) {\n const latest = mostRecentVersion(message)\n // const content = store.any(latest, ns.sioc('content'))\n if (isDeleted(latest) && !options.showDeletedMessages) {\n return // ignore deleted messaged -- @@ could also leave a placeholder\n }\n insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\n }\n\n /* Add a new messageTable at the top/bottom\n */\n async function insertPreviousMessages (backwards) {\n const extremity = backwards ? earliest : latest\n let date = extremity.messageTable.date // day in mssecs\n\n date = await dateFolder.loadPrevious(date, backwards) // backwards\n debug.log(\n `insertPreviousMessages: from ${\n backwards ? 'backwards' : 'forwards'\n } loadPrevious: ${date}`\n )\n if (!date && !backwards && !liveMessageTable) {\n await appendCurrentMessages() // If necessary skip to today and add that\n }\n if (!date) return true // done\n let live = false\n if (!backwards) {\n const todayDoc = dateFolder.leafDocumentFromDate(new Date())\n const doc = dateFolder.leafDocumentFromDate(date)\n live = doc.sameTerm(todayDoc) // Is this todays?\n }\n const newMessageTable = await createMessageTable(date, live)\n extremity.messageTable = newMessageTable // move pointer to earliest\n if (backwards ? newestFirst : !newestFirst) {\n // put on bottom or top\n div.appendChild(newMessageTable)\n } else {\n // put on top as we scroll back\n div.insertBefore(newMessageTable, div.firstChild)\n }\n return live // not done\n }\n\n /* Remove message tables earlier than this one\n */\n function removePreviousMessages (backwards, messageTable) {\n if (backwards ? newestFirst : !newestFirst) {\n // it was put on bottom\n while (messageTable.nextSibling) {\n div.removeChild(messageTable.nextSibling)\n }\n } else {\n // it was put on top as we scroll back\n while (messageTable.previousSibling) {\n div.removeChild(messageTable.previousSibling)\n }\n }\n const extr = backwards ? earliest : latest\n extr.messageTable = messageTable\n }\n\n /* Load and render message table\n ** @returns DOM element generates\n */\n async function createMessageTable (date, live) {\n debug.log(' createMessageTable for ' + date)\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n try {\n await store.fetcher.load(chatDocument)\n } catch (err) {\n const messageTable = dom.createElement('table')\n const statusTR = messageTable.appendChild(dom.createElement('tr')) // ### find status in exception\n if (err.response && err.response.status && err.response.status === 404) {\n debug.log('Error 404 for chat file ' + chatDocument)\n return renderMessageTable(date, live) // no mssage file is fine.. will be craeted later\n // statusTR.appendChild(widgets.errorMessageBlock(dom, 'no message file', 'white'))\n } else {\n debug.log('*** Error NON 404 for chat file ' + chatDocument)\n statusTR.appendChild(widgets.errorMessageBlock(dom, err, 'pink'))\n }\n return statusTR\n }\n return renderMessageTable(date, live)\n }\n\n function renderMessageTable (date, live) {\n let scrollBackbutton\n let scrollForwardButton\n\n /// ///////////////// Scroll down adding more above\n\n async function extendBackwards () {\n const done = await insertPreviousMessages(true)\n if (done) {\n if (scrollBackbutton) {\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n ) // T\n scrollBackbutton.disabled = true\n }\n messageTable.initial = true\n } else {\n messageTable.extendedBack = true\n }\n setScrollBackbuttonIcon()\n return done\n }\n\n function setScrollBackbuttonIcon () {\n if (!scrollBackbutton) {\n return\n }\n const sense = messageTable.extendedBack ? !newestFirst : newestFirst\n const scrollBackIcon = messageTable.initial\n ? 'noun_T-Block_1114655_000000.svg'\n : getScrollbackIcon(sense)\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollBackIcon\n )\n\n function getScrollbackIcon (sense) {\n return sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n async function scrollBackbuttonHandler (_event) {\n if (messageTable.extendedBack) {\n removePreviousMessages(true, messageTable)\n messageTable.extendedBack = false\n setScrollBackbuttonIcon()\n } else {\n await extendBackwards()\n }\n }\n\n /// ////////////// Scroll up adding more below\n\n async function extendForwards () {\n const done = await insertPreviousMessages(false)\n if (done) {\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n )\n scrollForwardButton.disabled = true\n messageTable.final = true\n } else {\n messageTable.extendedForwards = true\n }\n setScrollForwardButtonIcon()\n return done\n }\n\n function setScrollForwardButtonIcon () {\n const sense = messageTable.extendedForwards ? !newestFirst : newestFirst // noun_T-Block_1114657_000000.svg\n const scrollForwardIcon = messageTable.final\n ? 'noun_T-Block_1114657_000000.svg'\n : getScrollForwardButtonIcon(sense)\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollForwardIcon\n )\n\n function getScrollForwardButtonIcon (sense) {\n return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n async function scrollForwardButtonHandler (_event) {\n if (messageTable.extendedForwards) {\n removePreviousMessages(false, messageTable)\n messageTable.extendedForwards = false\n setScrollForwardButtonIcon()\n } else {\n await extendForwards() // async\n latest.messageTable.scrollIntoView(newestFirst)\n }\n }\n\n /// ///////////////////////\n /*\n options = options || {}\n options.authorDateOnLeft = true\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n*/\n const messageTable = dom.createElement('table')\n\n messageTable.extendBackwards = extendBackwards // Make function available to scroll stuff\n messageTable.extendForwards = extendForwards // Make function available to scroll stuff\n\n messageTable.date = date\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n messageTable.chatDocument = chatDocument\n\n messageTable.fresh = false\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n if (live) {\n messageTable.final = true\n liveMessageTable = messageTable\n latest.messageTable = messageTable\n const tr = renderMessageEditor(channelObject, messageTable, userContext, options)\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n messageTable.inputRow = tr\n }\n\n /// ///// Infinite scroll\n //\n // @@ listen for swipe past end event not just button\n if (options.infinite) {\n const scrollBackbuttonTR = dom.createElement('tr')\n const scrollBackbuttonCell = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\n )\n // up traingles: noun_1369237.svg\n // down triangles: noun_1369241.svg\n const scrollBackIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollBackbutton = widgets.button(\n dom,\n icons.iconBase + scrollBackIcon,\n 'Previous messages ...'\n )\n scrollBackbuttonCell.style = 'width:3em; height:3em;'\n scrollBackbutton.addEventListener('click', scrollBackbuttonHandler, false)\n messageTable.extendedBack = false\n scrollBackbuttonCell.appendChild(scrollBackbutton)\n setScrollBackbuttonIcon()\n\n const dateCell = scrollBackbuttonTR.appendChild(dom.createElement('td'))\n dateCell.style =\n 'text-align: center; vertical-align: middle; color: #888; font-style: italic;'\n dateCell.textContent = widgets.shortDate(date.toISOString(), true) // no time, only date\n\n // @@@@@@@@@@@ todo move this button to other end of message cell, o\n const scrollForwardButtonCell = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\n )\n const scrollForwardIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollForwardButton = widgets.button(\n dom,\n icons.iconBase + scrollForwardIcon,\n 'Later messages ...'\n )\n scrollForwardButtonCell.appendChild(scrollForwardButton)\n scrollForwardButtonCell.style = 'width:3em; height:3em;'\n scrollForwardButton.addEventListener(\n 'click',\n scrollForwardButtonHandler,\n false\n )\n messageTable.extendedForward = false\n setScrollForwardButtonIcon()\n\n messageTable.extendedForwards = false\n\n if (!newestFirst) {\n // opposite end from the entry field\n messageTable.insertBefore(scrollBackbuttonTR, messageTable.firstChild) // If not newestFirst\n } else {\n messageTable.appendChild(scrollBackbuttonTR) // newestFirst\n }\n }\n\n const sts = store.statementsMatching(null, ns.wf('message'), null, chatDocument)\n if (!live && sts.length === 0) {\n // not todays\n // no need buttomns at the moment\n // messageTable.style.visibility = 'collapse' // Hide files with no messages\n }\n sts.forEach(st => {\n addMessage(st.object, messageTable)\n })\n messageTable.fresh = true\n\n // loadMessageTable(messageTable, chatDocument)\n messageTable.fresh = false\n return messageTable\n } // renderMessageTable\n\n async function addNewChatDocumentIfNewDay () {\n // @@ Remove listener from previous table as it is now static\n const newChatDocument = dateFolder.leafDocumentFromDate(new Date())\n if (!newChatDocument.sameTerm(latest.messageTable.chatDocument)) {\n // It is a new day\n if (liveMessageTable.inputRow) {\n liveMessageTable.removeChild(liveMessageTable.inputRow)\n delete liveMessageTable.inputRow\n }\n const oldChatDocument = latest.messageTable.chatDocument\n await appendCurrentMessages()\n // Adding a link in the document will ping listeners to add the new block too\n if (\n !store.holds(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ) {\n const sts = [\n $rdf.st(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ]\n try {\n store.updater.update([], sts)\n } catch (err) {\n alert('Unable to link old chat file to new one:' + err)\n }\n }\n }\n }\n\n /*\n function messageCount () {\n var n = 0\n const tables = div.children\n for (let i = 0; i < tables.length; i++) {\n n += tables[i].children.length - 1\n // debug.log(' table length:' + tables[i].children.length)\n }\n return n\n }\n*/\n\n /* Add the live message block with entry field for today\n */\n async function appendCurrentMessages () {\n const now = new Date()\n const chatDocument = dateFolder.leafDocumentFromDate(now)\n\n /// ///////////////////////////////////////////////////////////\n const messageTable = await createMessageTable(now, true)\n div.appendChild(messageTable)\n div.refresh = async function () {\n // only the last messageTable is live\n await addNewChatDocumentIfNewDay(new Date())\n syncMessages(chatChannel, messageTable) // @@ livemessagetable??\n desktopNotification(chatChannel)\n } // The short chat version the live update listening is done in the pane but we do it in the widget @@\n store.updater.addDownstreamChangeListener(chatDocument, div.refresh) // Live update\n liveMessageTable = messageTable\n latest.messageTable = liveMessageTable\n return messageTable\n }\n\n async function loadMoreWhereNeeded (event, fixScroll) {\n if (lock) return\n lock = true\n const freeze = !fixScroll\n const magicZone = 150\n // const top = div.scrollTop\n // const bottom = div.scrollHeight - top - div.clientHeight\n let done\n\n while (\n div.scrollTop < magicZone &&\n earliest.messageTable &&\n !earliest.messageTable.initial &&\n earliest.messageTable.extendBackwards\n ) {\n // If this has been called before the element is actually in the\n // user's DOM tree, then this scrollTop check won't work -> loop forever\n // https://github.com/solidos/solid-ui/issues/366\n if (div.scrollHeight === 0) {\n // console.log(' chat/loadMoreWhereNeeded: trying later...')\n setTimeout(loadMoreWhereNeeded, 2000) // couple be less\n lock = false\n return // abandon now, do later\n }\n // console.log(' chat/loadMoreWhereNeeded: Going now')\n const scrollBottom = div.scrollHeight - div.scrollTop\n debug.log('infinite scroll: adding above: top ' + div.scrollTop)\n done = await earliest.messageTable.extendBackwards()\n if (freeze) {\n div.scrollTop = div.scrollHeight - scrollBottom\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n while (\n options.selectedMessage && // we started in the middle not at the bottom\n div.scrollHeight - div.scrollTop - div.clientHeight < magicZone && // we are scrolled right to the bottom\n latest.messageTable &&\n !latest.messageTable.final && // there is more data to come\n latest.messageTable.extendForwards\n ) {\n const scrollTop = div.scrollTop\n debug.log(\n 'infinite scroll: adding below: bottom: ' +\n (div.scrollHeight - div.scrollTop - div.clientHeight)\n )\n done = await latest.messageTable.extendForwards() // then add more data on the bottom\n if (freeze) {\n div.scrollTop = scrollTop // while adding below keep same things in view\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n lock = false\n }\n\n async function loadInitialContent () {\n function yank () {\n selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })\n }\n\n // During initial load ONLY keep scroll to selected thing or bottom\n function fixScroll () {\n if (options.selectedElement) {\n options.selectedElement.scrollIntoView({ block: 'center' }) // align tops or bottoms\n } else {\n if (liveMessageTable.inputRow.scrollIntoView) {\n liveMessageTable.inputRow.scrollIntoView(newestFirst) // align tops or bottoms\n }\n }\n }\n\n let live, selectedDocument\n if (options.selectedMessage) {\n selectedDocument = options.selectedMessage.doc()\n const now = new Date()\n const todayDocument = dateFolder.leafDocumentFromDate(now)\n live = todayDocument.sameTerm(selectedDocument)\n }\n let selectedMessageTable\n if (options.selectedMessage && !live) {\n const selectedDate = dateFolder.dateFromLeafDocument(selectedDocument)\n selectedMessageTable = await createMessageTable(selectedDate, live)\n div.appendChild(selectedMessageTable)\n earliest.messageTable = selectedMessageTable\n latest.messageTable = selectedMessageTable\n yank()\n setTimeout(yank, 1000) // @@ kludge - restore position distubed by other cHANGES\n } else {\n // Live end\n await appendCurrentMessages()\n earliest.messageTable = liveMessageTable\n latest.messageTable = liveMessageTable\n }\n\n await loadMoreWhereNeeded(null, fixScroll)\n div.addEventListener('scroll', loadMoreWhereNeeded)\n if (options.solo) {\n document.body.addEventListener('scroll', loadMoreWhereNeeded)\n }\n }\n\n // Body of main function\n\n options = options || {}\n options.authorDateOnLeft = false // @@ make a user optiosn\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n channelObject.div = div\n\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n // const messageTable = dom.createElement('table') // @@ check does this go in renderMessageTable\n\n let liveMessageTable\n const earliest = { messageTable: null } // Stuff about each end of the loaded days\n const latest = { messageTable: null }\n\n let lock = false\n\n await loadInitialContent()\n return div\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AAGA;;AACA;;;;;;AAhBA;AACA;AACA;AACA;AACA;AAC+B;AAK/B;AACA;AAEA;AACA;AAIA;AAEO,SAASA,mBAAT,CAA8BC,GAA9B,EAAmC;EACxC;EACA,IAAI,EAAE,kBAAkBC,MAApB,CAAJ,EAAiC;IAC/BC,KAAK,CAACC,IAAN,CAAW,qDAAX;EACD,CAFD,MAEO,I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;cAAEmB,GAAG,EAAHA,GAAF;cAAOqI,UAAU,EAAVA,UAAP;cAAmBvG,GAAG,EAAEuG;YAAxB,CArhBf,EAqhBoD;YAEzD;;YAGMtG,QA1hBD,GA0hBY;cAAEtD,YAAY,EAAE;YAAhB,CA1hBZ,EA0hBmC;;YAClCuD,MA3hBD,GA2hBU;cAAEvD,YAAY,EAAE;YAAhB,CA3hBV;YA6hBD8D,IA7hBC,GA6hBM,KA7hBN;YAAA;YAAA,OA+hBC3B,kBAAkB,EA/hBnB;;UAAA;YAAA,mCAgiBEkB,GAhiBF;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C"}
|
package/lib/chat/message.js
CHANGED
|
@@ -14,6 +14,8 @@ exports.renderMessageEditor = renderMessageEditor;
|
|
|
14
14
|
exports.renderMessageRow = renderMessageRow;
|
|
15
15
|
exports.switchToEditor = switchToEditor;
|
|
16
16
|
|
|
17
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
18
|
+
|
|
17
19
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
18
20
|
|
|
19
21
|
var _infinite = require("./infinite");
|
|
@@ -54,8 +56,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
54
56
|
|
|
55
57
|
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; }
|
|
56
58
|
|
|
57
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
58
|
-
|
|
59
59
|
var dom = window.document;
|
|
60
60
|
var messageBodyStyle = style.messageBodyStyle;
|
|
61
61
|
var label = utils.label;
|
|
@@ -292,8 +292,8 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
function _handleFieldInput() {
|
|
295
|
-
_handleFieldInput = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
296
|
-
return
|
|
295
|
+
_handleFieldInput = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(_event) {
|
|
296
|
+
return _regenerator["default"].wrap(function _callee5$(_context6) {
|
|
297
297
|
while (1) {
|
|
298
298
|
switch (_context6.prev = _context6.next) {
|
|
299
299
|
case 0:
|
|
@@ -317,9 +317,9 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
317
317
|
|
|
318
318
|
|
|
319
319
|
function _sendMessage() {
|
|
320
|
-
_sendMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
320
|
+
_sendMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(text, fromMainField) {
|
|
321
321
|
var sendComplete, message, statusArea;
|
|
322
|
-
return
|
|
322
|
+
return _regenerator["default"].wrap(function _callee6$(_context7) {
|
|
323
323
|
while (1) {
|
|
324
324
|
switch (_context7.prev = _context7.next) {
|
|
325
325
|
case 0:
|
|
@@ -396,8 +396,8 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
396
396
|
function droppedFileHandler(files) {
|
|
397
397
|
var base = messageTable.chatDocument.dir().uri;
|
|
398
398
|
widgets.uploadFiles(_solidLogic.store.fetcher, files, base + 'Files', base + 'Pictures', /*#__PURE__*/function () {
|
|
399
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
400
|
-
return
|
|
399
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(theFile, destURI) {
|
|
400
|
+
return _regenerator["default"].wrap(function _callee$(_context2) {
|
|
401
401
|
while (1) {
|
|
402
402
|
switch (_context2.prev = _context2.next) {
|
|
403
403
|
case 0:
|
|
@@ -420,10 +420,10 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
420
420
|
|
|
421
421
|
|
|
422
422
|
var droppedURIHandler = /*#__PURE__*/function () {
|
|
423
|
-
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
423
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(uris) {
|
|
424
424
|
var _iterator, _step, uri;
|
|
425
425
|
|
|
426
|
-
return
|
|
426
|
+
return _regenerator["default"].wrap(function _callee2$(_context3) {
|
|
427
427
|
while (1) {
|
|
428
428
|
switch (_context3.prev = _context3.next) {
|
|
429
429
|
case 0:
|
|
@@ -489,8 +489,8 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
489
489
|
|
|
490
490
|
|
|
491
491
|
function _tookPicture() {
|
|
492
|
-
_tookPicture = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
493
|
-
return
|
|
492
|
+
_tookPicture = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(imageDoc) {
|
|
493
|
+
return _regenerator["default"].wrap(function _callee4$(_context5) {
|
|
494
494
|
while (1) {
|
|
495
495
|
switch (_context5.prev = _context5.next) {
|
|
496
496
|
case 0:
|
|
@@ -555,8 +555,8 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
555
555
|
field.setAttribute('style', messageBodyStyle + 'background-color: #eef;'); // Trap the Enter BEFORE it is used ti make a newline
|
|
556
556
|
|
|
557
557
|
field.addEventListener('keydown', /*#__PURE__*/function () {
|
|
558
|
-
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
559
|
-
return
|
|
558
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(e) {
|
|
559
|
+
return _regenerator["default"].wrap(function _callee3$(_context4) {
|
|
560
560
|
while (1) {
|
|
561
561
|
switch (_context4.prev = _context4.next) {
|
|
562
562
|
case 0:
|