chat-pane 2.4.23-b2e326d4 → 2.4.23-d4d21f8f

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.
@@ -79246,7 +79246,13 @@ const longChatPane = {
79246
79246
  if (kb.holds(subject, ns.rdf('type'), ns.meeting('LongChat'))) {
79247
79247
  // subject is the object
79248
79248
  return 'Chat channnel'
79249
- } // Looks like a message -- might not havre any class declared
79249
+ }
79250
+ if (kb.holds(subject, ns.rdf('type'), ns.sioc('Thread'))) {
79251
+ // subject is the object
79252
+ return 'Thread'
79253
+ }
79254
+
79255
+ // Looks like a message -- might not havre any class declared
79250
79256
  if (
79251
79257
  kb.any(subject, ns.sioc('content')) &&
79252
79258
  kb.any(subject, ns.dct('created'))
@@ -79514,12 +79520,21 @@ const longChatPane = {
79514
79520
 
79515
79521
  var chatChannel = subject
79516
79522
  var selectedMessage = null
79523
+ var thread = null
79517
79524
  if (kb.holds(subject, ns.rdf('type'), ns.meeting('LongChat'))) {
79518
79525
  // subject is the chatChannel
79519
79526
  console.log('Chat channnel')
79520
79527
 
79521
79528
  // Looks like a message -- might not havre any class declared
79522
- } else if (
79529
+ } else if (kb.holds(subject, ns.rdf('type'), ns.sioc('Thread'))) {
79530
+ // subject is the chatChannel
79531
+ console.log('Thread is subject')
79532
+ thread = subject
79533
+ const rootMessage = kb.the(null, ns.sioc('has_reply'), thread, thread.doc())
79534
+ if (!rootMessage) throw new Error('Thread has no root message ' + thread)
79535
+ chatChannel = kb.any(null, ns.wf('message'), rootMessage)
79536
+ if (!chatChannel) throw new Error('Thread root has no link to chatChannel')
79537
+ } else if ( // Looks like a message -- might not havre any class declared
79523
79538
  kb.any(subject, ns.sioc('content')) &&
79524
79539
  kb.any(subject, ns.dct('created'))
79525
79540
  ) {
@@ -79630,7 +79645,11 @@ const longChatPane = {
79630
79645
  // This is the top pane, title, scrollbar etc are ours
79631
79646
  options.solo = true
79632
79647
  }
79633
- options.showThread = showThread
79648
+ if (thread) { // Rendereing a thread as first class object
79649
+ options.thread = thread
79650
+ } else { // either show thread *or* allow new threads. Threads don't nest but they could
79651
+ options.showThread = showThread
79652
+ }
79634
79653
  const chatControl = await solid_ui__WEBPACK_IMPORTED_MODULE_1__.infiniteMessageArea(
79635
79654
  dom,
79636
79655
  kb,