chat-pane 2.4.23-d7dc428f → 2.4.23-e238e799

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 CHANGED
@@ -14812,7 +14812,13 @@ var longChatPane = {
14812
14812
  if (kb.holds(subject, ns.rdf('type'), ns.meeting('LongChat'))) {
14813
14813
  // subject is the object
14814
14814
  return 'Chat channnel';
14815
- } // Looks like a message -- might not havre any class declared
14815
+ }
14816
+ if (kb.holds(subject, ns.rdf('type'), ns.sioc('Thread'))) {
14817
+ // subject is the object
14818
+ return 'Thread';
14819
+ }
14820
+
14821
+ // Looks like a message -- might not havre any class declared
14816
14822
  if (kb.any(subject, ns.sioc('content')) && kb.any(subject, ns.dct('created'))) {
14817
14823
  return 'message';
14818
14824
  }
@@ -15102,12 +15108,23 @@ var longChatPane = {
15102
15108
 
15103
15109
  var chatChannel = subject;
15104
15110
  var selectedMessage = null;
15111
+ var thread = null;
15105
15112
  if (kb.holds(subject, ns.rdf('type'), ns.meeting('LongChat'))) {
15106
15113
  // subject is the chatChannel
15107
15114
  console.log('Chat channnel');
15108
15115
 
15109
15116
  // Looks like a message -- might not havre any class declared
15110
- } else if (kb.any(subject, ns.sioc('content')) && kb.any(subject, ns.dct('created'))) {
15117
+ } else if (kb.holds(subject, ns.rdf('type'), ns.sioc('Thread'))) {
15118
+ // subject is the chatChannel
15119
+ console.log('Thread is subject');
15120
+ thread = subject;
15121
+ var rootMessage = kb.the(null, ns.sioc('has_reply'), thread, thread.doc());
15122
+ if (!rootMessage) throw new Error('Thread has no root message ' + thread);
15123
+ chatChannel = kb.any(null, ns.wf('message'), rootMessage);
15124
+ if (!chatChannel) throw new Error('Thread root has no link to chatChannel');
15125
+ } else if (
15126
+ // Looks like a message -- might not havre any class declared
15127
+ kb.any(subject, ns.sioc('content')) && kb.any(subject, ns.dct('created'))) {
15111
15128
  console.log('message');
15112
15129
  selectedMessage = subject;
15113
15130
  chatChannel = kb.any(null, ns.wf('message'), selectedMessage);
@@ -15229,7 +15246,13 @@ var longChatPane = {
15229
15246
  // This is the top pane, title, scrollbar etc are ours
15230
15247
  options.solo = true;
15231
15248
  }
15232
- options.showThread = showThread;
15249
+ if (thread) {
15250
+ // Rendereing a thread as first class object
15251
+ options.thread = thread;
15252
+ } else {
15253
+ // either show thread *or* allow new threads. Threads don't nest but they could
15254
+ options.showThread = showThread;
15255
+ }
15233
15256
  _context6.next = 15;
15234
15257
  return solid_ui__WEBPACK_IMPORTED_MODULE_1__.infiniteMessageArea(dom, kb, chatChannel, options);
15235
15258
  case 15: