stream-chat-react 12.8.2 → 12.10.0
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/components/Attachment/components/WaveProgressBar.js +1 -1
- package/dist/components/Attachment/hooks/useAudioController.d.ts +1 -1
- package/dist/components/Attachment/hooks/useAudioController.js +1 -1
- package/dist/components/AutoCompleteTextarea/Textarea.js +0 -4
- package/dist/components/AutoCompleteTextarea/utils.js +1 -5
- package/dist/components/Channel/Channel.js +3 -2
- package/dist/components/Channel/channelState.d.ts +1 -3
- package/dist/components/Channel/channelState.js +1 -1
- package/dist/components/Channel/hooks/useIsMounted.d.ts +1 -1
- package/dist/components/ChannelList/hooks/useChannelListShape.d.ts +3 -3
- package/dist/components/ChannelList/hooks/useChannelListShape.js +54 -47
- package/dist/components/ChannelList/hooks/useChannelMembershipState.d.ts +3 -2
- package/dist/components/ChannelList/hooks/useChannelMembershipState.js +6 -15
- package/dist/components/ChannelList/hooks/useMobileNavigation.d.ts +1 -1
- package/dist/components/ChannelList/hooks/usePaginatedChannels.js +1 -1
- package/dist/components/ChannelList/hooks/useSelectedChannelState.d.ts +11 -0
- package/dist/components/ChannelList/hooks/useSelectedChannelState.js +20 -0
- package/dist/components/ChannelList/utils.d.ts +16 -6
- package/dist/components/ChannelList/utils.js +44 -18
- package/dist/components/ChannelSearch/SearchBar.d.ts +1 -1
- package/dist/components/ChannelSearch/SearchInput.d.ts +1 -1
- package/dist/components/ChannelSearch/hooks/useChannelSearch.js +1 -1
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/ChatAutoComplete/ChatAutoComplete.d.ts +2 -0
- package/dist/components/ChatAutoComplete/ChatAutoComplete.js +1 -1
- package/dist/components/Gallery/BaseImage.d.ts +1 -3
- package/dist/components/Gallery/Gallery.js +10 -2
- package/dist/components/Gallery/ModalGallery.js +5 -4
- package/dist/components/InfiniteScrollPaginator/InfiniteScroll.js +4 -4
- package/dist/components/MessageActions/hooks/useMessageActionsBoxPopper.d.ts +1 -1
- package/dist/components/MessageInput/hooks/useMessageInputText.d.ts +1 -1
- package/dist/components/MessageInput/hooks/useMessageInputText.js +2 -2
- package/dist/components/MessageInput/hooks/useTimeElapsed.js +1 -1
- package/dist/components/MessageList/MessageList.js +0 -1
- package/dist/components/MessageList/VirtualizedMessageList.d.ts +1 -1
- package/dist/components/MessageList/VirtualizedMessageList.js +2 -2
- package/dist/components/MessageList/hooks/MessageList/useMessageListScrollManager.js +1 -1
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.js +1 -1
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.d.ts +1 -1
- package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.js +2 -2
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.js +1 -1
- package/dist/components/MessageList/hooks/useMarkRead.d.ts +2 -4
- package/dist/components/MessageList/hooks/useMarkRead.js +14 -16
- package/dist/context/VirtualizedMessageListContext.d.ts +13 -0
- package/dist/context/VirtualizedMessageListContext.js +7 -0
- package/dist/experimental/index.browser.cjs.map +2 -2
- package/dist/experimental/index.node.cjs.map +2 -2
- package/dist/index.browser.cjs +721 -267
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +986 -286
- package/dist/index.node.cjs.map +4 -4
- package/package.json +17 -18
package/dist/index.node.cjs
CHANGED
|
@@ -416,6 +416,311 @@ var require_extend = __commonJS({
|
|
|
416
416
|
}
|
|
417
417
|
});
|
|
418
418
|
|
|
419
|
+
// node_modules/react-markdown/node_modules/react-is/cjs/react-is.production.min.js
|
|
420
|
+
var require_react_is_production_min = __commonJS({
|
|
421
|
+
"node_modules/react-markdown/node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
|
|
422
|
+
"use strict";
|
|
423
|
+
var b = Symbol.for("react.element");
|
|
424
|
+
var c = Symbol.for("react.portal");
|
|
425
|
+
var d = Symbol.for("react.fragment");
|
|
426
|
+
var e2 = Symbol.for("react.strict_mode");
|
|
427
|
+
var f = Symbol.for("react.profiler");
|
|
428
|
+
var g = Symbol.for("react.provider");
|
|
429
|
+
var h2 = Symbol.for("react.context");
|
|
430
|
+
var k = Symbol.for("react.server_context");
|
|
431
|
+
var l = Symbol.for("react.forward_ref");
|
|
432
|
+
var m = Symbol.for("react.suspense");
|
|
433
|
+
var n = Symbol.for("react.suspense_list");
|
|
434
|
+
var p = Symbol.for("react.memo");
|
|
435
|
+
var q = Symbol.for("react.lazy");
|
|
436
|
+
var t2 = Symbol.for("react.offscreen");
|
|
437
|
+
var u2;
|
|
438
|
+
u2 = Symbol.for("react.module.reference");
|
|
439
|
+
function v(a2) {
|
|
440
|
+
if ("object" === typeof a2 && null !== a2) {
|
|
441
|
+
var r = a2.$$typeof;
|
|
442
|
+
switch (r) {
|
|
443
|
+
case b:
|
|
444
|
+
switch (a2 = a2.type, a2) {
|
|
445
|
+
case d:
|
|
446
|
+
case f:
|
|
447
|
+
case e2:
|
|
448
|
+
case m:
|
|
449
|
+
case n:
|
|
450
|
+
return a2;
|
|
451
|
+
default:
|
|
452
|
+
switch (a2 = a2 && a2.$$typeof, a2) {
|
|
453
|
+
case k:
|
|
454
|
+
case h2:
|
|
455
|
+
case l:
|
|
456
|
+
case q:
|
|
457
|
+
case p:
|
|
458
|
+
case g:
|
|
459
|
+
return a2;
|
|
460
|
+
default:
|
|
461
|
+
return r;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
case c:
|
|
465
|
+
return r;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
exports2.ContextConsumer = h2;
|
|
470
|
+
exports2.ContextProvider = g;
|
|
471
|
+
exports2.Element = b;
|
|
472
|
+
exports2.ForwardRef = l;
|
|
473
|
+
exports2.Fragment = d;
|
|
474
|
+
exports2.Lazy = q;
|
|
475
|
+
exports2.Memo = p;
|
|
476
|
+
exports2.Portal = c;
|
|
477
|
+
exports2.Profiler = f;
|
|
478
|
+
exports2.StrictMode = e2;
|
|
479
|
+
exports2.Suspense = m;
|
|
480
|
+
exports2.SuspenseList = n;
|
|
481
|
+
exports2.isAsyncMode = function() {
|
|
482
|
+
return false;
|
|
483
|
+
};
|
|
484
|
+
exports2.isConcurrentMode = function() {
|
|
485
|
+
return false;
|
|
486
|
+
};
|
|
487
|
+
exports2.isContextConsumer = function(a2) {
|
|
488
|
+
return v(a2) === h2;
|
|
489
|
+
};
|
|
490
|
+
exports2.isContextProvider = function(a2) {
|
|
491
|
+
return v(a2) === g;
|
|
492
|
+
};
|
|
493
|
+
exports2.isElement = function(a2) {
|
|
494
|
+
return "object" === typeof a2 && null !== a2 && a2.$$typeof === b;
|
|
495
|
+
};
|
|
496
|
+
exports2.isForwardRef = function(a2) {
|
|
497
|
+
return v(a2) === l;
|
|
498
|
+
};
|
|
499
|
+
exports2.isFragment = function(a2) {
|
|
500
|
+
return v(a2) === d;
|
|
501
|
+
};
|
|
502
|
+
exports2.isLazy = function(a2) {
|
|
503
|
+
return v(a2) === q;
|
|
504
|
+
};
|
|
505
|
+
exports2.isMemo = function(a2) {
|
|
506
|
+
return v(a2) === p;
|
|
507
|
+
};
|
|
508
|
+
exports2.isPortal = function(a2) {
|
|
509
|
+
return v(a2) === c;
|
|
510
|
+
};
|
|
511
|
+
exports2.isProfiler = function(a2) {
|
|
512
|
+
return v(a2) === f;
|
|
513
|
+
};
|
|
514
|
+
exports2.isStrictMode = function(a2) {
|
|
515
|
+
return v(a2) === e2;
|
|
516
|
+
};
|
|
517
|
+
exports2.isSuspense = function(a2) {
|
|
518
|
+
return v(a2) === m;
|
|
519
|
+
};
|
|
520
|
+
exports2.isSuspenseList = function(a2) {
|
|
521
|
+
return v(a2) === n;
|
|
522
|
+
};
|
|
523
|
+
exports2.isValidElementType = function(a2) {
|
|
524
|
+
return "string" === typeof a2 || "function" === typeof a2 || a2 === d || a2 === f || a2 === e2 || a2 === m || a2 === n || a2 === t2 || "object" === typeof a2 && null !== a2 && (a2.$$typeof === q || a2.$$typeof === p || a2.$$typeof === g || a2.$$typeof === h2 || a2.$$typeof === l || a2.$$typeof === u2 || void 0 !== a2.getModuleId) ? true : false;
|
|
525
|
+
};
|
|
526
|
+
exports2.typeOf = v;
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
// node_modules/react-markdown/node_modules/react-is/cjs/react-is.development.js
|
|
531
|
+
var require_react_is_development = __commonJS({
|
|
532
|
+
"node_modules/react-markdown/node_modules/react-is/cjs/react-is.development.js"(exports2) {
|
|
533
|
+
"use strict";
|
|
534
|
+
if (process.env.NODE_ENV !== "production") {
|
|
535
|
+
(function() {
|
|
536
|
+
"use strict";
|
|
537
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
538
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
539
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
540
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
541
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
542
|
+
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
543
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
544
|
+
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
|
545
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
546
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
547
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
548
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
549
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
550
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
551
|
+
var enableScopeAPI = false;
|
|
552
|
+
var enableCacheElement = false;
|
|
553
|
+
var enableTransitionTracing = false;
|
|
554
|
+
var enableLegacyHidden = false;
|
|
555
|
+
var enableDebugTracing = false;
|
|
556
|
+
var REACT_MODULE_REFERENCE;
|
|
557
|
+
{
|
|
558
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
559
|
+
}
|
|
560
|
+
function isValidElementType(type) {
|
|
561
|
+
if (typeof type === "string" || typeof type === "function") {
|
|
562
|
+
return true;
|
|
563
|
+
}
|
|
564
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
567
|
+
if (typeof type === "object" && type !== null) {
|
|
568
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
569
|
+
// types supported by any Flight configuration anywhere since
|
|
570
|
+
// we don't know which Flight build this will end up being used
|
|
571
|
+
// with.
|
|
572
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
573
|
+
return true;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
function typeOf(object) {
|
|
579
|
+
if (typeof object === "object" && object !== null) {
|
|
580
|
+
var $$typeof = object.$$typeof;
|
|
581
|
+
switch ($$typeof) {
|
|
582
|
+
case REACT_ELEMENT_TYPE:
|
|
583
|
+
var type = object.type;
|
|
584
|
+
switch (type) {
|
|
585
|
+
case REACT_FRAGMENT_TYPE:
|
|
586
|
+
case REACT_PROFILER_TYPE:
|
|
587
|
+
case REACT_STRICT_MODE_TYPE:
|
|
588
|
+
case REACT_SUSPENSE_TYPE:
|
|
589
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
590
|
+
return type;
|
|
591
|
+
default:
|
|
592
|
+
var $$typeofType = type && type.$$typeof;
|
|
593
|
+
switch ($$typeofType) {
|
|
594
|
+
case REACT_SERVER_CONTEXT_TYPE:
|
|
595
|
+
case REACT_CONTEXT_TYPE:
|
|
596
|
+
case REACT_FORWARD_REF_TYPE:
|
|
597
|
+
case REACT_LAZY_TYPE:
|
|
598
|
+
case REACT_MEMO_TYPE:
|
|
599
|
+
case REACT_PROVIDER_TYPE:
|
|
600
|
+
return $$typeofType;
|
|
601
|
+
default:
|
|
602
|
+
return $$typeof;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
case REACT_PORTAL_TYPE:
|
|
606
|
+
return $$typeof;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
return void 0;
|
|
610
|
+
}
|
|
611
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
612
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
613
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
614
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
615
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
|
616
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
617
|
+
var Memo = REACT_MEMO_TYPE;
|
|
618
|
+
var Portal2 = REACT_PORTAL_TYPE;
|
|
619
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
620
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
621
|
+
var Suspense2 = REACT_SUSPENSE_TYPE;
|
|
622
|
+
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
623
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
624
|
+
var hasWarnedAboutDeprecatedIsConcurrentMode = false;
|
|
625
|
+
function isAsyncMode(object) {
|
|
626
|
+
{
|
|
627
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
628
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
629
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return false;
|
|
633
|
+
}
|
|
634
|
+
function isConcurrentMode(object) {
|
|
635
|
+
{
|
|
636
|
+
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
637
|
+
hasWarnedAboutDeprecatedIsConcurrentMode = true;
|
|
638
|
+
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return false;
|
|
642
|
+
}
|
|
643
|
+
function isContextConsumer(object) {
|
|
644
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
645
|
+
}
|
|
646
|
+
function isContextProvider(object) {
|
|
647
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
648
|
+
}
|
|
649
|
+
function isElement2(object) {
|
|
650
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
651
|
+
}
|
|
652
|
+
function isForwardRef(object) {
|
|
653
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
654
|
+
}
|
|
655
|
+
function isFragment(object) {
|
|
656
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
657
|
+
}
|
|
658
|
+
function isLazy(object) {
|
|
659
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
660
|
+
}
|
|
661
|
+
function isMemo(object) {
|
|
662
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
663
|
+
}
|
|
664
|
+
function isPortal(object) {
|
|
665
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
666
|
+
}
|
|
667
|
+
function isProfiler(object) {
|
|
668
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
669
|
+
}
|
|
670
|
+
function isStrictMode(object) {
|
|
671
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
672
|
+
}
|
|
673
|
+
function isSuspense(object) {
|
|
674
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
675
|
+
}
|
|
676
|
+
function isSuspenseList(object) {
|
|
677
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
678
|
+
}
|
|
679
|
+
exports2.ContextConsumer = ContextConsumer;
|
|
680
|
+
exports2.ContextProvider = ContextProvider;
|
|
681
|
+
exports2.Element = Element;
|
|
682
|
+
exports2.ForwardRef = ForwardRef;
|
|
683
|
+
exports2.Fragment = Fragment2;
|
|
684
|
+
exports2.Lazy = Lazy;
|
|
685
|
+
exports2.Memo = Memo;
|
|
686
|
+
exports2.Portal = Portal2;
|
|
687
|
+
exports2.Profiler = Profiler;
|
|
688
|
+
exports2.StrictMode = StrictMode;
|
|
689
|
+
exports2.Suspense = Suspense2;
|
|
690
|
+
exports2.SuspenseList = SuspenseList;
|
|
691
|
+
exports2.isAsyncMode = isAsyncMode;
|
|
692
|
+
exports2.isConcurrentMode = isConcurrentMode;
|
|
693
|
+
exports2.isContextConsumer = isContextConsumer;
|
|
694
|
+
exports2.isContextProvider = isContextProvider;
|
|
695
|
+
exports2.isElement = isElement2;
|
|
696
|
+
exports2.isForwardRef = isForwardRef;
|
|
697
|
+
exports2.isFragment = isFragment;
|
|
698
|
+
exports2.isLazy = isLazy;
|
|
699
|
+
exports2.isMemo = isMemo;
|
|
700
|
+
exports2.isPortal = isPortal;
|
|
701
|
+
exports2.isProfiler = isProfiler;
|
|
702
|
+
exports2.isStrictMode = isStrictMode;
|
|
703
|
+
exports2.isSuspense = isSuspense;
|
|
704
|
+
exports2.isSuspenseList = isSuspenseList;
|
|
705
|
+
exports2.isValidElementType = isValidElementType;
|
|
706
|
+
exports2.typeOf = typeOf;
|
|
707
|
+
})();
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
// node_modules/react-markdown/node_modules/react-is/index.js
|
|
713
|
+
var require_react_is = __commonJS({
|
|
714
|
+
"node_modules/react-markdown/node_modules/react-is/index.js"(exports2, module2) {
|
|
715
|
+
"use strict";
|
|
716
|
+
if (process.env.NODE_ENV === "production") {
|
|
717
|
+
module2.exports = require_react_is_production_min();
|
|
718
|
+
} else {
|
|
719
|
+
module2.exports = require_react_is_development();
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
|
|
419
724
|
// node_modules/inline-style-parser/index.js
|
|
420
725
|
var require_inline_style_parser = __commonJS({
|
|
421
726
|
"node_modules/inline-style-parser/index.js"(exports2, module2) {
|
|
@@ -2531,9 +2836,9 @@ var require_unified = __commonJS({
|
|
|
2531
2836
|
return typeof value === "function" && value.prototype && // A function with keys in its prototype is probably a constructor.
|
|
2532
2837
|
// Classes’ prototype methods are not enumerable, so we check if some value
|
|
2533
2838
|
// exists in the prototype.
|
|
2534
|
-
(
|
|
2839
|
+
(keys3(value.prototype) || name in value.prototype);
|
|
2535
2840
|
}
|
|
2536
|
-
function
|
|
2841
|
+
function keys3(value) {
|
|
2537
2842
|
var key;
|
|
2538
2843
|
for (key in value) {
|
|
2539
2844
|
return true;
|
|
@@ -10270,13 +10575,293 @@ var require_disallow_node = __commonJS({
|
|
|
10270
10575
|
}
|
|
10271
10576
|
});
|
|
10272
10577
|
|
|
10578
|
+
// node_modules/react-is/cjs/react-is.production.min.js
|
|
10579
|
+
var require_react_is_production_min2 = __commonJS({
|
|
10580
|
+
"node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
|
|
10581
|
+
"use strict";
|
|
10582
|
+
var b = "function" === typeof Symbol && Symbol.for;
|
|
10583
|
+
var c = b ? Symbol.for("react.element") : 60103;
|
|
10584
|
+
var d = b ? Symbol.for("react.portal") : 60106;
|
|
10585
|
+
var e2 = b ? Symbol.for("react.fragment") : 60107;
|
|
10586
|
+
var f = b ? Symbol.for("react.strict_mode") : 60108;
|
|
10587
|
+
var g = b ? Symbol.for("react.profiler") : 60114;
|
|
10588
|
+
var h2 = b ? Symbol.for("react.provider") : 60109;
|
|
10589
|
+
var k = b ? Symbol.for("react.context") : 60110;
|
|
10590
|
+
var l = b ? Symbol.for("react.async_mode") : 60111;
|
|
10591
|
+
var m = b ? Symbol.for("react.concurrent_mode") : 60111;
|
|
10592
|
+
var n = b ? Symbol.for("react.forward_ref") : 60112;
|
|
10593
|
+
var p = b ? Symbol.for("react.suspense") : 60113;
|
|
10594
|
+
var q = b ? Symbol.for("react.suspense_list") : 60120;
|
|
10595
|
+
var r = b ? Symbol.for("react.memo") : 60115;
|
|
10596
|
+
var t2 = b ? Symbol.for("react.lazy") : 60116;
|
|
10597
|
+
var v = b ? Symbol.for("react.block") : 60121;
|
|
10598
|
+
var w = b ? Symbol.for("react.fundamental") : 60117;
|
|
10599
|
+
var x = b ? Symbol.for("react.responder") : 60118;
|
|
10600
|
+
var y = b ? Symbol.for("react.scope") : 60119;
|
|
10601
|
+
function z(a2) {
|
|
10602
|
+
if ("object" === typeof a2 && null !== a2) {
|
|
10603
|
+
var u2 = a2.$$typeof;
|
|
10604
|
+
switch (u2) {
|
|
10605
|
+
case c:
|
|
10606
|
+
switch (a2 = a2.type, a2) {
|
|
10607
|
+
case l:
|
|
10608
|
+
case m:
|
|
10609
|
+
case e2:
|
|
10610
|
+
case g:
|
|
10611
|
+
case f:
|
|
10612
|
+
case p:
|
|
10613
|
+
return a2;
|
|
10614
|
+
default:
|
|
10615
|
+
switch (a2 = a2 && a2.$$typeof, a2) {
|
|
10616
|
+
case k:
|
|
10617
|
+
case n:
|
|
10618
|
+
case t2:
|
|
10619
|
+
case r:
|
|
10620
|
+
case h2:
|
|
10621
|
+
return a2;
|
|
10622
|
+
default:
|
|
10623
|
+
return u2;
|
|
10624
|
+
}
|
|
10625
|
+
}
|
|
10626
|
+
case d:
|
|
10627
|
+
return u2;
|
|
10628
|
+
}
|
|
10629
|
+
}
|
|
10630
|
+
}
|
|
10631
|
+
function A(a2) {
|
|
10632
|
+
return z(a2) === m;
|
|
10633
|
+
}
|
|
10634
|
+
exports2.AsyncMode = l;
|
|
10635
|
+
exports2.ConcurrentMode = m;
|
|
10636
|
+
exports2.ContextConsumer = k;
|
|
10637
|
+
exports2.ContextProvider = h2;
|
|
10638
|
+
exports2.Element = c;
|
|
10639
|
+
exports2.ForwardRef = n;
|
|
10640
|
+
exports2.Fragment = e2;
|
|
10641
|
+
exports2.Lazy = t2;
|
|
10642
|
+
exports2.Memo = r;
|
|
10643
|
+
exports2.Portal = d;
|
|
10644
|
+
exports2.Profiler = g;
|
|
10645
|
+
exports2.StrictMode = f;
|
|
10646
|
+
exports2.Suspense = p;
|
|
10647
|
+
exports2.isAsyncMode = function(a2) {
|
|
10648
|
+
return A(a2) || z(a2) === l;
|
|
10649
|
+
};
|
|
10650
|
+
exports2.isConcurrentMode = A;
|
|
10651
|
+
exports2.isContextConsumer = function(a2) {
|
|
10652
|
+
return z(a2) === k;
|
|
10653
|
+
};
|
|
10654
|
+
exports2.isContextProvider = function(a2) {
|
|
10655
|
+
return z(a2) === h2;
|
|
10656
|
+
};
|
|
10657
|
+
exports2.isElement = function(a2) {
|
|
10658
|
+
return "object" === typeof a2 && null !== a2 && a2.$$typeof === c;
|
|
10659
|
+
};
|
|
10660
|
+
exports2.isForwardRef = function(a2) {
|
|
10661
|
+
return z(a2) === n;
|
|
10662
|
+
};
|
|
10663
|
+
exports2.isFragment = function(a2) {
|
|
10664
|
+
return z(a2) === e2;
|
|
10665
|
+
};
|
|
10666
|
+
exports2.isLazy = function(a2) {
|
|
10667
|
+
return z(a2) === t2;
|
|
10668
|
+
};
|
|
10669
|
+
exports2.isMemo = function(a2) {
|
|
10670
|
+
return z(a2) === r;
|
|
10671
|
+
};
|
|
10672
|
+
exports2.isPortal = function(a2) {
|
|
10673
|
+
return z(a2) === d;
|
|
10674
|
+
};
|
|
10675
|
+
exports2.isProfiler = function(a2) {
|
|
10676
|
+
return z(a2) === g;
|
|
10677
|
+
};
|
|
10678
|
+
exports2.isStrictMode = function(a2) {
|
|
10679
|
+
return z(a2) === f;
|
|
10680
|
+
};
|
|
10681
|
+
exports2.isSuspense = function(a2) {
|
|
10682
|
+
return z(a2) === p;
|
|
10683
|
+
};
|
|
10684
|
+
exports2.isValidElementType = function(a2) {
|
|
10685
|
+
return "string" === typeof a2 || "function" === typeof a2 || a2 === e2 || a2 === m || a2 === g || a2 === f || a2 === p || a2 === q || "object" === typeof a2 && null !== a2 && (a2.$$typeof === t2 || a2.$$typeof === r || a2.$$typeof === h2 || a2.$$typeof === k || a2.$$typeof === n || a2.$$typeof === w || a2.$$typeof === x || a2.$$typeof === y || a2.$$typeof === v);
|
|
10686
|
+
};
|
|
10687
|
+
exports2.typeOf = z;
|
|
10688
|
+
}
|
|
10689
|
+
});
|
|
10690
|
+
|
|
10691
|
+
// node_modules/react-is/cjs/react-is.development.js
|
|
10692
|
+
var require_react_is_development2 = __commonJS({
|
|
10693
|
+
"node_modules/react-is/cjs/react-is.development.js"(exports2) {
|
|
10694
|
+
"use strict";
|
|
10695
|
+
if (process.env.NODE_ENV !== "production") {
|
|
10696
|
+
(function() {
|
|
10697
|
+
"use strict";
|
|
10698
|
+
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
10699
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
10700
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
10701
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
10702
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
10703
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
10704
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
10705
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
10706
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
10707
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
10708
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
10709
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
10710
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
10711
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
10712
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
10713
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
10714
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
10715
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
10716
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
10717
|
+
function isValidElementType(type) {
|
|
10718
|
+
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
10719
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
10720
|
+
}
|
|
10721
|
+
function typeOf(object) {
|
|
10722
|
+
if (typeof object === "object" && object !== null) {
|
|
10723
|
+
var $$typeof = object.$$typeof;
|
|
10724
|
+
switch ($$typeof) {
|
|
10725
|
+
case REACT_ELEMENT_TYPE:
|
|
10726
|
+
var type = object.type;
|
|
10727
|
+
switch (type) {
|
|
10728
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
10729
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
10730
|
+
case REACT_FRAGMENT_TYPE:
|
|
10731
|
+
case REACT_PROFILER_TYPE:
|
|
10732
|
+
case REACT_STRICT_MODE_TYPE:
|
|
10733
|
+
case REACT_SUSPENSE_TYPE:
|
|
10734
|
+
return type;
|
|
10735
|
+
default:
|
|
10736
|
+
var $$typeofType = type && type.$$typeof;
|
|
10737
|
+
switch ($$typeofType) {
|
|
10738
|
+
case REACT_CONTEXT_TYPE:
|
|
10739
|
+
case REACT_FORWARD_REF_TYPE:
|
|
10740
|
+
case REACT_LAZY_TYPE:
|
|
10741
|
+
case REACT_MEMO_TYPE:
|
|
10742
|
+
case REACT_PROVIDER_TYPE:
|
|
10743
|
+
return $$typeofType;
|
|
10744
|
+
default:
|
|
10745
|
+
return $$typeof;
|
|
10746
|
+
}
|
|
10747
|
+
}
|
|
10748
|
+
case REACT_PORTAL_TYPE:
|
|
10749
|
+
return $$typeof;
|
|
10750
|
+
}
|
|
10751
|
+
}
|
|
10752
|
+
return void 0;
|
|
10753
|
+
}
|
|
10754
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
10755
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
10756
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
10757
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
10758
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
10759
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
10760
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
|
10761
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
10762
|
+
var Memo = REACT_MEMO_TYPE;
|
|
10763
|
+
var Portal2 = REACT_PORTAL_TYPE;
|
|
10764
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
10765
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
10766
|
+
var Suspense2 = REACT_SUSPENSE_TYPE;
|
|
10767
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
10768
|
+
function isAsyncMode(object) {
|
|
10769
|
+
{
|
|
10770
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
10771
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
10772
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
10773
|
+
}
|
|
10774
|
+
}
|
|
10775
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
10776
|
+
}
|
|
10777
|
+
function isConcurrentMode(object) {
|
|
10778
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
10779
|
+
}
|
|
10780
|
+
function isContextConsumer(object) {
|
|
10781
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
10782
|
+
}
|
|
10783
|
+
function isContextProvider(object) {
|
|
10784
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
10785
|
+
}
|
|
10786
|
+
function isElement2(object) {
|
|
10787
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
10788
|
+
}
|
|
10789
|
+
function isForwardRef(object) {
|
|
10790
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
10791
|
+
}
|
|
10792
|
+
function isFragment(object) {
|
|
10793
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
10794
|
+
}
|
|
10795
|
+
function isLazy(object) {
|
|
10796
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
10797
|
+
}
|
|
10798
|
+
function isMemo(object) {
|
|
10799
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
10800
|
+
}
|
|
10801
|
+
function isPortal(object) {
|
|
10802
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
10803
|
+
}
|
|
10804
|
+
function isProfiler(object) {
|
|
10805
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
10806
|
+
}
|
|
10807
|
+
function isStrictMode(object) {
|
|
10808
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
10809
|
+
}
|
|
10810
|
+
function isSuspense(object) {
|
|
10811
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
10812
|
+
}
|
|
10813
|
+
exports2.AsyncMode = AsyncMode;
|
|
10814
|
+
exports2.ConcurrentMode = ConcurrentMode;
|
|
10815
|
+
exports2.ContextConsumer = ContextConsumer;
|
|
10816
|
+
exports2.ContextProvider = ContextProvider;
|
|
10817
|
+
exports2.Element = Element;
|
|
10818
|
+
exports2.ForwardRef = ForwardRef;
|
|
10819
|
+
exports2.Fragment = Fragment2;
|
|
10820
|
+
exports2.Lazy = Lazy;
|
|
10821
|
+
exports2.Memo = Memo;
|
|
10822
|
+
exports2.Portal = Portal2;
|
|
10823
|
+
exports2.Profiler = Profiler;
|
|
10824
|
+
exports2.StrictMode = StrictMode;
|
|
10825
|
+
exports2.Suspense = Suspense2;
|
|
10826
|
+
exports2.isAsyncMode = isAsyncMode;
|
|
10827
|
+
exports2.isConcurrentMode = isConcurrentMode;
|
|
10828
|
+
exports2.isContextConsumer = isContextConsumer;
|
|
10829
|
+
exports2.isContextProvider = isContextProvider;
|
|
10830
|
+
exports2.isElement = isElement2;
|
|
10831
|
+
exports2.isForwardRef = isForwardRef;
|
|
10832
|
+
exports2.isFragment = isFragment;
|
|
10833
|
+
exports2.isLazy = isLazy;
|
|
10834
|
+
exports2.isMemo = isMemo;
|
|
10835
|
+
exports2.isPortal = isPortal;
|
|
10836
|
+
exports2.isProfiler = isProfiler;
|
|
10837
|
+
exports2.isStrictMode = isStrictMode;
|
|
10838
|
+
exports2.isSuspense = isSuspense;
|
|
10839
|
+
exports2.isValidElementType = isValidElementType;
|
|
10840
|
+
exports2.typeOf = typeOf;
|
|
10841
|
+
})();
|
|
10842
|
+
}
|
|
10843
|
+
}
|
|
10844
|
+
});
|
|
10845
|
+
|
|
10846
|
+
// node_modules/react-is/index.js
|
|
10847
|
+
var require_react_is2 = __commonJS({
|
|
10848
|
+
"node_modules/react-is/index.js"(exports2, module2) {
|
|
10849
|
+
"use strict";
|
|
10850
|
+
if (process.env.NODE_ENV === "production") {
|
|
10851
|
+
module2.exports = require_react_is_production_min2();
|
|
10852
|
+
} else {
|
|
10853
|
+
module2.exports = require_react_is_development2();
|
|
10854
|
+
}
|
|
10855
|
+
}
|
|
10856
|
+
});
|
|
10857
|
+
|
|
10273
10858
|
// node_modules/mml-react/node_modules/react-markdown/lib/ast-to-react.js
|
|
10274
10859
|
var require_ast_to_react = __commonJS({
|
|
10275
10860
|
"node_modules/mml-react/node_modules/react-markdown/lib/ast-to-react.js"(exports2, module2) {
|
|
10276
10861
|
"use strict";
|
|
10277
|
-
var
|
|
10862
|
+
var React210 = require("react");
|
|
10278
10863
|
var xtend = require_immutable();
|
|
10279
|
-
var ReactIs2 =
|
|
10864
|
+
var ReactIs2 = require_react_is2();
|
|
10280
10865
|
function astToReact(node2, options) {
|
|
10281
10866
|
var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
10282
10867
|
var index3 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
|
|
@@ -10301,7 +10886,7 @@ var require_ast_to_react = __commonJS({
|
|
|
10301
10886
|
throw new Error("Renderer for type `".concat(node2.type, "` not defined or is not renderable"));
|
|
10302
10887
|
}
|
|
10303
10888
|
var nodeProps = getNodeProps(node2, key, options, renderer, parent, index3);
|
|
10304
|
-
return
|
|
10889
|
+
return React210.createElement(renderer, nodeProps, nodeProps.children || resolveChildren() || void 0);
|
|
10305
10890
|
function resolveChildren() {
|
|
10306
10891
|
return node2.children && node2.children.map(function(childNode, i) {
|
|
10307
10892
|
return astToReact(childNode, options, {
|
|
@@ -10315,7 +10900,7 @@ var require_ast_to_react = __commonJS({
|
|
|
10315
10900
|
var props = {
|
|
10316
10901
|
key
|
|
10317
10902
|
};
|
|
10318
|
-
var isSimpleRenderer = typeof renderer === "string" || renderer ===
|
|
10903
|
+
var isSimpleRenderer = typeof renderer === "string" || renderer === React210.Fragment;
|
|
10319
10904
|
if (opts.sourcePos && node2.position) {
|
|
10320
10905
|
props["data-sourcepos"] = flattenPosition2(node2.position);
|
|
10321
10906
|
}
|
|
@@ -10468,14 +11053,14 @@ var require_ast_to_react = __commonJS({
|
|
|
10468
11053
|
function mergeNodeChildren(node2, parsedChildren) {
|
|
10469
11054
|
var el = node2.element;
|
|
10470
11055
|
if (Array.isArray(el)) {
|
|
10471
|
-
var Fragment2 =
|
|
10472
|
-
return
|
|
11056
|
+
var Fragment2 = React210.Fragment || "div";
|
|
11057
|
+
return React210.createElement(Fragment2, null, el);
|
|
10473
11058
|
}
|
|
10474
11059
|
if (el.props.children || parsedChildren) {
|
|
10475
|
-
var children =
|
|
10476
|
-
return
|
|
11060
|
+
var children = React210.Children.toArray(el.props.children).concat(parsedChildren);
|
|
11061
|
+
return React210.cloneElement(el, null, children);
|
|
10477
11062
|
}
|
|
10478
|
-
return
|
|
11063
|
+
return React210.cloneElement(el, null);
|
|
10479
11064
|
}
|
|
10480
11065
|
function flattenPosition2(pos) {
|
|
10481
11066
|
return [pos.start.line, ":", pos.start.column, "-", pos.end.line, ":", pos.end.column].map(String).join("");
|
|
@@ -10599,9 +11184,9 @@ var require_renderers = __commonJS({
|
|
|
10599
11184
|
"node_modules/mml-react/node_modules/react-markdown/lib/renderers.js"(exports2, module2) {
|
|
10600
11185
|
"use strict";
|
|
10601
11186
|
var xtend = require_immutable();
|
|
10602
|
-
var
|
|
10603
|
-
var supportsStringRender = parseInt((
|
|
10604
|
-
var createElement =
|
|
11187
|
+
var React210 = require("react");
|
|
11188
|
+
var supportsStringRender = parseInt((React210.version || "16").slice(0, 2), 10) >= 16;
|
|
11189
|
+
var createElement = React210.createElement;
|
|
10605
11190
|
module2.exports = {
|
|
10606
11191
|
break: "br",
|
|
10607
11192
|
paragraph: "p",
|
|
@@ -10637,7 +11222,7 @@ var require_renderers = __commonJS({
|
|
|
10637
11222
|
}
|
|
10638
11223
|
function Root(props) {
|
|
10639
11224
|
var className = props.className;
|
|
10640
|
-
var root2 = !className &&
|
|
11225
|
+
var root2 = !className && React210.Fragment || "div";
|
|
10641
11226
|
return createElement(root2, className ? {
|
|
10642
11227
|
className
|
|
10643
11228
|
} : null, props.children);
|
|
@@ -10693,7 +11278,7 @@ var require_renderers = __commonJS({
|
|
|
10693
11278
|
var dangerous = props.allowDangerousHtml || props.escapeHtml === false;
|
|
10694
11279
|
var tag = props.isBlock ? "div" : "span";
|
|
10695
11280
|
if (!dangerous) {
|
|
10696
|
-
return createElement(
|
|
11281
|
+
return createElement(React210.Fragment || tag, null, props.value);
|
|
10697
11282
|
}
|
|
10698
11283
|
var nodeProps = {
|
|
10699
11284
|
dangerouslySetInnerHTML: {
|
|
@@ -10703,7 +11288,7 @@ var require_renderers = __commonJS({
|
|
|
10703
11288
|
return createElement(tag, nodeProps);
|
|
10704
11289
|
}
|
|
10705
11290
|
function ParsedHtml(props) {
|
|
10706
|
-
return props["data-sourcepos"] ?
|
|
11291
|
+
return props["data-sourcepos"] ? React210.cloneElement(props.element, {
|
|
10707
11292
|
"data-sourcepos": props["data-sourcepos"]
|
|
10708
11293
|
}) : props.element;
|
|
10709
11294
|
}
|
|
@@ -18555,8 +19140,8 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
18555
19140
|
function _interopDefault(ex) {
|
|
18556
19141
|
return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex;
|
|
18557
19142
|
}
|
|
18558
|
-
var
|
|
18559
|
-
var React__default = _interopDefault(
|
|
19143
|
+
var React210 = require("react");
|
|
19144
|
+
var React__default = _interopDefault(React210);
|
|
18560
19145
|
var parseXml = _interopDefault(require_src());
|
|
18561
19146
|
var dayjs = _interopDefault(require("dayjs"));
|
|
18562
19147
|
var sanitizeUrl4 = require("@braintree/sanitize-url");
|
|
@@ -18902,14 +19487,14 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
18902
19487
|
this.reset(true);
|
|
18903
19488
|
}
|
|
18904
19489
|
exports3.keys = function(object) {
|
|
18905
|
-
var
|
|
19490
|
+
var keys3 = [];
|
|
18906
19491
|
for (var key in object) {
|
|
18907
|
-
|
|
19492
|
+
keys3.push(key);
|
|
18908
19493
|
}
|
|
18909
|
-
|
|
19494
|
+
keys3.reverse();
|
|
18910
19495
|
return function next() {
|
|
18911
|
-
while (
|
|
18912
|
-
var key2 =
|
|
19496
|
+
while (keys3.length) {
|
|
19497
|
+
var key2 = keys3.pop();
|
|
18913
19498
|
if (key2 in object) {
|
|
18914
19499
|
next.value = key2;
|
|
18915
19500
|
next.done = false;
|
|
@@ -19341,8 +19926,8 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19341
19926
|
className: "mml-carousel__track"
|
|
19342
19927
|
}, React__default.createElement("div", {
|
|
19343
19928
|
className: "mml-carousel__slides"
|
|
19344
|
-
},
|
|
19345
|
-
return
|
|
19929
|
+
}, React210.Children.map(children, function(child) {
|
|
19930
|
+
return React210.cloneElement(child, {
|
|
19346
19931
|
className: "mml-carousel__slide",
|
|
19347
19932
|
slideWidth
|
|
19348
19933
|
});
|
|
@@ -19386,7 +19971,7 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19386
19971
|
};
|
|
19387
19972
|
var Input = function Input2(_ref) {
|
|
19388
19973
|
var name = _ref.name, label = _ref.label, _ref$value = _ref.value, value = _ref$value === void 0 ? "" : _ref$value, _ref$type = _ref.type, type = _ref$type === void 0 ? "text" : _ref$type, _ref$placeholder = _ref.placeholder, placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder;
|
|
19389
|
-
var _useState =
|
|
19974
|
+
var _useState = React210.useState(value), state = _useState[0], setState = _useState[1];
|
|
19390
19975
|
var id = "mml-" + name;
|
|
19391
19976
|
return React__default.createElement(React__default.Fragment, null, label && React__default.createElement("label", {
|
|
19392
19977
|
className: "mml-card-header",
|
|
@@ -19516,7 +20101,7 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19516
20101
|
};
|
|
19517
20102
|
var Number2 = function Number3(_ref) {
|
|
19518
20103
|
var name = _ref.name, value = _ref.value;
|
|
19519
|
-
var _useState =
|
|
20104
|
+
var _useState = React210.useState(parseInt("" + value, 10) || 0), state = _useState[0], setState = _useState[1];
|
|
19520
20105
|
return React__default.createElement("div", {
|
|
19521
20106
|
className: "mml-number"
|
|
19522
20107
|
}, React__default.createElement("input", {
|
|
@@ -19553,7 +20138,7 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19553
20138
|
var VIRTUOSO_START_INDEX = 1e4;
|
|
19554
20139
|
var DatePickerSelect = function DatePickerSelect2(props) {
|
|
19555
20140
|
var onChange = props.onChange, icalFilter = props.icalFilter, getItemData2 = props.getItemData, itemClassName = props.itemClassName, interval = props.interval, format = props.format, value = props.value;
|
|
19556
|
-
var generateItems =
|
|
20141
|
+
var generateItems = React210.useCallback(function(quantity, firstIdx) {
|
|
19557
20142
|
return Array(quantity).fill(true).map(function(_, idx) {
|
|
19558
20143
|
return getItemData2({
|
|
19559
20144
|
interval,
|
|
@@ -19565,11 +20150,11 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19565
20150
|
return !icalFilter || icalFilter && icalFilter(newItem.value);
|
|
19566
20151
|
});
|
|
19567
20152
|
}, [interval, format, value, icalFilter, getItemData2]);
|
|
19568
|
-
var _useState =
|
|
19569
|
-
var _useState2 =
|
|
19570
|
-
var initialIndexOffset =
|
|
19571
|
-
var _useState3 =
|
|
19572
|
-
var handleClick =
|
|
20153
|
+
var _useState = React210.useState(generateItems(ITEMS_PER_PAGE * 2, -ITEMS_PER_PAGE)), items = _useState[0], setItems = _useState[1];
|
|
20154
|
+
var _useState2 = React210.useState(VIRTUOSO_START_INDEX), firstItemIndex = _useState2[0], setFirstItemIndex = _useState2[1];
|
|
20155
|
+
var initialIndexOffset = React210.useRef(INITIAL_INDEX);
|
|
20156
|
+
var _useState3 = React210.useState(null), selectedIdx = _useState3[0], setSelectedIdx = _useState3[1];
|
|
20157
|
+
var handleClick = React210.useCallback(function(item) {
|
|
19573
20158
|
onChange(item.value);
|
|
19574
20159
|
var firstItemIndex2 = initialIndexOffset.current || 0;
|
|
19575
20160
|
var nextFirstItemIdx = firstItemIndex2 - INITIAL_INDEX - ITEMS_PER_PAGE;
|
|
@@ -19583,12 +20168,12 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19583
20168
|
}
|
|
19584
20169
|
setSelectedIdx(item.idx);
|
|
19585
20170
|
}, [setItems, generateItems, initialIndexOffset, onChange]);
|
|
19586
|
-
var appendItems =
|
|
20171
|
+
var appendItems = React210.useCallback(function(lastItemIndex) {
|
|
19587
20172
|
setItems(function(items2) {
|
|
19588
20173
|
return [].concat(items2, generateItems(ITEMS_PER_PAGE, lastItemIndex));
|
|
19589
20174
|
});
|
|
19590
20175
|
}, [setItems, generateItems]);
|
|
19591
|
-
var prependItems =
|
|
20176
|
+
var prependItems = React210.useCallback(function() {
|
|
19592
20177
|
var firstItemIndex2 = initialIndexOffset.current || 0;
|
|
19593
20178
|
var nextFirstItemIdx = firstItemIndex2 - INITIAL_INDEX - ITEMS_PER_PAGE;
|
|
19594
20179
|
if (initialIndexOffset) {
|
|
@@ -19600,7 +20185,7 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19600
20185
|
setFirstItemIndex(firstItemIndex2 - ITEMS_PER_PAGE);
|
|
19601
20186
|
return false;
|
|
19602
20187
|
}, [setItems, generateItems, initialIndexOffset]);
|
|
19603
|
-
|
|
20188
|
+
React210.useEffect(function() {
|
|
19604
20189
|
if (value) {
|
|
19605
20190
|
var initialSelectedIdx = null;
|
|
19606
20191
|
for (var i = 0; i < items.length; i++) {
|
|
@@ -19670,7 +20255,7 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19670
20255
|
};
|
|
19671
20256
|
var DatePicker = function DatePicker2(_ref) {
|
|
19672
20257
|
var name = _ref.name, selected = _ref.selected, dateInterval = _ref.dateInterval, timeInterval = _ref.timeInterval, dateFormat = _ref.dateFormat, timeFormat = _ref.timeFormat, fullDay = _ref.fullDay, icalFilter = _ref.icalFilter;
|
|
19673
|
-
var _useState =
|
|
20258
|
+
var _useState = React210.useState(selected), date = _useState[0], setDate = _useState[1];
|
|
19674
20259
|
var handleChangeDate = function handleChangeDate2(value) {
|
|
19675
20260
|
setDate(function(prevDate) {
|
|
19676
20261
|
return prevDate.set("date", value.get("date")).set("month", value.get("month")).set("year", value.get("year"));
|
|
@@ -19750,14 +20335,14 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19750
20335
|
}();
|
|
19751
20336
|
var Scheduler = function Scheduler2(_ref2) {
|
|
19752
20337
|
var name = _ref2.name, selected = _ref2.selected, icalAvailability = _ref2.icalAvailability, _ref2$duration = _ref2.duration, duration = _ref2$duration === void 0 ? 30 : _ref2$duration, _ref2$dateInterval = _ref2.dateInterval, dateInterval = _ref2$dateInterval === void 0 ? 1 : _ref2$dateInterval, _ref2$timeInterval = _ref2.timeInterval, timeInterval = _ref2$timeInterval === void 0 ? 30 : _ref2$timeInterval, _ref2$dateFormat = _ref2.dateFormat, dateFormat = _ref2$dateFormat === void 0 ? "ddd MMM DD" : _ref2$dateFormat, _ref2$timeFormat = _ref2.timeFormat, timeFormat = _ref2$timeFormat === void 0 ? "hh:mm A" : _ref2$timeFormat, _ref2$fullDay = _ref2.fullDay, fullDay = _ref2$fullDay === void 0 ? false : _ref2$fullDay;
|
|
19753
|
-
var _useState =
|
|
19754
|
-
var _useState2 =
|
|
19755
|
-
var _useState3 =
|
|
20338
|
+
var _useState = React210.useState(false), loading = _useState[0], setLoading = _useState[1];
|
|
20339
|
+
var _useState2 = React210.useState(""), error = _useState2[0], setError = _useState2[1];
|
|
20340
|
+
var _useState3 = React210.useState(function() {
|
|
19756
20341
|
return function() {
|
|
19757
20342
|
return true;
|
|
19758
20343
|
};
|
|
19759
20344
|
}), icalFilter = _useState3[0], setIcalFilter = _useState3[1];
|
|
19760
|
-
|
|
20345
|
+
React210.useEffect(function() {
|
|
19761
20346
|
if (!icalAvailability) return;
|
|
19762
20347
|
setLoading(true);
|
|
19763
20348
|
setupIcalFilter(icalAvailability, duration).then(setIcalFilter)["catch"](function(err) {
|
|
@@ -19961,13 +20546,13 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19961
20546
|
}
|
|
19962
20547
|
var MML2 = function MML3(_ref) {
|
|
19963
20548
|
var source = _ref.source, onSubmit = _ref.onSubmit, converters2 = _ref.converters, _ref$theme = _ref.theme, theme = _ref$theme === void 0 ? "" : _ref$theme, _ref$className = _ref.className, className = _ref$className === void 0 ? "" : _ref$className, _ref$Loading = _ref.Loading, Loading$1 = _ref$Loading === void 0 ? Loading : _ref$Loading, _ref$Error = _ref.Error, Error2 = _ref$Error === void 0 ? Error$1 : _ref$Error, _ref$Success = _ref.Success, Success$1 = _ref$Success === void 0 ? Success : _ref$Success;
|
|
19964
|
-
var _useState =
|
|
19965
|
-
var _useState2 =
|
|
20549
|
+
var _useState = React210.useState(""), error = _useState[0], setError = _useState[1];
|
|
20550
|
+
var _useState2 = React210.useState({
|
|
19966
20551
|
loading: false,
|
|
19967
20552
|
error: "",
|
|
19968
20553
|
success: ""
|
|
19969
20554
|
}), submitState = _useState2[0], setSubmitState = _useState2[1];
|
|
19970
|
-
var tree =
|
|
20555
|
+
var tree = React210.useMemo(function() {
|
|
19971
20556
|
try {
|
|
19972
20557
|
return Parse(source, converters2);
|
|
19973
20558
|
} catch (e2) {
|
|
@@ -19976,7 +20561,7 @@ var require_mml_react_cjs_development = __commonJS({
|
|
|
19976
20561
|
return null;
|
|
19977
20562
|
}
|
|
19978
20563
|
}, [source, converters2]);
|
|
19979
|
-
var handleSubmit =
|
|
20564
|
+
var handleSubmit = React210.useCallback(/* @__PURE__ */ function() {
|
|
19980
20565
|
var _ref2 = _asyncToGenerator(/* @__PURE__ */ runtime_1.mark(function _callee(event) {
|
|
19981
20566
|
var state;
|
|
19982
20567
|
return runtime_1.wrap(function _callee$(_context) {
|
|
@@ -20319,6 +20904,7 @@ __export(src_exports, {
|
|
|
20319
20904
|
enTranslations: () => en_default,
|
|
20320
20905
|
esTranslations: () => es_default,
|
|
20321
20906
|
escapeRegExp: () => escapeRegExp,
|
|
20907
|
+
extractSortValue: () => extractSortValue,
|
|
20322
20908
|
findLastPinnedChannelIndex: () => findLastPinnedChannelIndex,
|
|
20323
20909
|
frTranslations: () => fr_default,
|
|
20324
20910
|
getChannel: () => getChannel,
|
|
@@ -20782,16 +21368,16 @@ var import_react7 = require("react");
|
|
|
20782
21368
|
|
|
20783
21369
|
// src/store/hooks/useStateStore.ts
|
|
20784
21370
|
var import_react6 = require("react");
|
|
20785
|
-
function useStateStore(store,
|
|
21371
|
+
function useStateStore(store, selector7) {
|
|
20786
21372
|
const [state, setState] = (0, import_react6.useState)(() => {
|
|
20787
21373
|
if (!store) return void 0;
|
|
20788
|
-
return
|
|
21374
|
+
return selector7(store.getLatestValue());
|
|
20789
21375
|
});
|
|
20790
21376
|
(0, import_react6.useEffect)(() => {
|
|
20791
21377
|
if (!store) return;
|
|
20792
|
-
const unsubscribe = store.subscribeWithSelector(
|
|
21378
|
+
const unsubscribe = store.subscribeWithSelector(selector7, setState);
|
|
20793
21379
|
return unsubscribe;
|
|
20794
|
-
}, [store,
|
|
21380
|
+
}, [store, selector7]);
|
|
20795
21381
|
return state;
|
|
20796
21382
|
}
|
|
20797
21383
|
|
|
@@ -21565,7 +22151,7 @@ var WaveProgressBar = ({
|
|
|
21565
22151
|
const isDragging = (0, import_react27.useRef)(false);
|
|
21566
22152
|
const [root2, setRoot] = (0, import_react27.useState)(null);
|
|
21567
22153
|
const [trackAxisX, setTrackAxisX] = (0, import_react27.useState)();
|
|
21568
|
-
const lastRootWidth = (0, import_react27.useRef)();
|
|
22154
|
+
const lastRootWidth = (0, import_react27.useRef)(void 0);
|
|
21569
22155
|
const handleDragStart = (e2) => {
|
|
21570
22156
|
e2.preventDefault();
|
|
21571
22157
|
if (!progressIndicator) return;
|
|
@@ -21686,7 +22272,7 @@ var useAudioController = ({
|
|
|
21686
22272
|
const [canPlayRecord, setCanPlayRecord] = (0, import_react28.useState)(true);
|
|
21687
22273
|
const [secondsElapsed, setSecondsElapsed] = (0, import_react28.useState)(0);
|
|
21688
22274
|
const [playbackRateIndex, setPlaybackRateIndex] = (0, import_react28.useState)(0);
|
|
21689
|
-
const playTimeout = (0, import_react28.useRef)();
|
|
22275
|
+
const playTimeout = (0, import_react28.useRef)(void 0);
|
|
21690
22276
|
const audioRef = (0, import_react28.useRef)(null);
|
|
21691
22277
|
const registerError = (0, import_react28.useCallback)(
|
|
21692
22278
|
(e2) => {
|
|
@@ -23074,19 +23660,22 @@ var ModalGallery = (props) => {
|
|
|
23074
23660
|
source: imageSrc
|
|
23075
23661
|
};
|
|
23076
23662
|
}),
|
|
23077
|
-
|
|
23078
|
-
[images]
|
|
23663
|
+
[images, t2]
|
|
23079
23664
|
);
|
|
23080
|
-
return
|
|
23081
|
-
|
|
23082
|
-
|
|
23083
|
-
|
|
23084
|
-
|
|
23085
|
-
|
|
23086
|
-
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
|
|
23665
|
+
return (
|
|
23666
|
+
// ignore the TS error as react-image-gallery was on @types/react@18 while stream-chat-react being upgraded to React 19 (https://github.com/xiaolin/react-image-gallery/issues/809)
|
|
23667
|
+
// @ts-expect-error
|
|
23668
|
+
/* @__PURE__ */ import_react39.default.createElement(
|
|
23669
|
+
import_react_image_gallery.default,
|
|
23670
|
+
{
|
|
23671
|
+
items: formattedArray,
|
|
23672
|
+
renderItem,
|
|
23673
|
+
showIndex: true,
|
|
23674
|
+
showPlayButton: false,
|
|
23675
|
+
showThumbnails: false,
|
|
23676
|
+
startIndex: index3
|
|
23677
|
+
}
|
|
23678
|
+
)
|
|
23090
23679
|
);
|
|
23091
23680
|
};
|
|
23092
23681
|
|
|
@@ -23122,7 +23711,11 @@ var UnMemoizedGallery = (props) => {
|
|
|
23122
23711
|
backgroundImage: `url(${images[lastImageIndexInPreview].previewUrl || images[lastImageIndexInPreview].image_url || images[lastImageIndexInPreview].thumb_url})`,
|
|
23123
23712
|
...image2.style
|
|
23124
23713
|
},
|
|
23125
|
-
...innerRefs?.current && {
|
|
23714
|
+
...innerRefs?.current && {
|
|
23715
|
+
ref: (r) => {
|
|
23716
|
+
innerRefs.current[i] = r;
|
|
23717
|
+
}
|
|
23718
|
+
}
|
|
23126
23719
|
},
|
|
23127
23720
|
/* @__PURE__ */ import_react40.default.createElement("p", null, t2("{{ imageCount }} more", {
|
|
23128
23721
|
imageCount: images.length - countImagesDisplayedInPreview
|
|
@@ -23142,7 +23735,11 @@ var UnMemoizedGallery = (props) => {
|
|
|
23142
23735
|
src: (0, import_sanitize_url2.sanitizeUrl)(image2.previewUrl || image2.image_url || image2.thumb_url),
|
|
23143
23736
|
style: image2.style,
|
|
23144
23737
|
title: image2?.fallback || imageFallbackTitle,
|
|
23145
|
-
...innerRefs?.current && {
|
|
23738
|
+
...innerRefs?.current && {
|
|
23739
|
+
ref: (r) => {
|
|
23740
|
+
innerRefs.current[i] = r;
|
|
23741
|
+
}
|
|
23742
|
+
}
|
|
23146
23743
|
}
|
|
23147
23744
|
)
|
|
23148
23745
|
)
|
|
@@ -34528,7 +35125,7 @@ function rehypeFilter(options) {
|
|
|
34528
35125
|
|
|
34529
35126
|
// node_modules/react-markdown/lib/ast-to-react.js
|
|
34530
35127
|
var import_react48 = __toESM(require("react"), 1);
|
|
34531
|
-
var import_react_is = __toESM(
|
|
35128
|
+
var import_react_is = __toESM(require_react_is(), 1);
|
|
34532
35129
|
|
|
34533
35130
|
// node_modules/hast-util-whitespace/index.js
|
|
34534
35131
|
function whitespace(thing) {
|
|
@@ -37747,11 +38344,9 @@ var import_react62 = __toESM(require("react"));
|
|
|
37747
38344
|
var import_prop_types2 = __toESM(require("prop-types"));
|
|
37748
38345
|
var import_react_textarea_autosize = __toESM(require("react-textarea-autosize"));
|
|
37749
38346
|
var import_textarea_caret = __toESM(require("textarea-caret"));
|
|
37750
|
-
var import_react_is3 = require("react-is");
|
|
37751
38347
|
var import_clsx17 = __toESM(require("clsx"));
|
|
37752
38348
|
|
|
37753
38349
|
// src/components/AutoCompleteTextarea/utils.js
|
|
37754
|
-
var import_react_is2 = require("react-is");
|
|
37755
38350
|
var DEFAULT_CARET_POSITION = "next";
|
|
37756
38351
|
function defaultScrollToItem(container, item) {
|
|
37757
38352
|
if (!item) return;
|
|
@@ -37778,10 +38373,7 @@ var triggerPropsCheck = ({ trigger }) => {
|
|
|
37778
38373
|
return Error("Invalid prop trigger. Keys of the object has to be string / one character.");
|
|
37779
38374
|
}
|
|
37780
38375
|
const triggerSetting = settings;
|
|
37781
|
-
const { callback,
|
|
37782
|
-
if (!(0, import_react_is2.isValidElementType)(component)) {
|
|
37783
|
-
return Error("Invalid prop trigger: component should be defined.");
|
|
37784
|
-
}
|
|
38376
|
+
const { callback, dataProvider, output } = triggerSetting;
|
|
37785
38377
|
if (!dataProvider || typeof dataProvider !== "function") {
|
|
37786
38378
|
return Error("Invalid prop trigger: dataProvider should be defined.");
|
|
37787
38379
|
}
|
|
@@ -38314,9 +38906,6 @@ See https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for m
|
|
|
38314
38906
|
if (!Array.isArray(data)) {
|
|
38315
38907
|
throw new Error("Trigger provider has to provide an array!");
|
|
38316
38908
|
}
|
|
38317
|
-
if (!(0, import_react_is3.isValidElementType)(component)) {
|
|
38318
|
-
throw new Error("Component should be defined!");
|
|
38319
|
-
}
|
|
38320
38909
|
if (currentTrigger !== this.state.currentTrigger) return;
|
|
38321
38910
|
if (!data.length) {
|
|
38322
38911
|
this._closeAutocomplete();
|
|
@@ -38701,7 +39290,7 @@ ReactTextareaAutocomplete.propTypes = {
|
|
|
38701
39290
|
};
|
|
38702
39291
|
|
|
38703
39292
|
// src/components/Channel/Channel.tsx
|
|
38704
|
-
var
|
|
39293
|
+
var import_react258 = __toESM(require("react"));
|
|
38705
39294
|
var import_lodash23 = __toESM(require("lodash.debounce"));
|
|
38706
39295
|
var import_lodash24 = __toESM(require("lodash.defaultsdeep"));
|
|
38707
39296
|
var import_lodash25 = __toESM(require("lodash.throttle"));
|
|
@@ -38709,7 +39298,7 @@ var import_nanoid11 = require("nanoid");
|
|
|
38709
39298
|
var import_clsx64 = __toESM(require("clsx"));
|
|
38710
39299
|
|
|
38711
39300
|
// src/components/Channel/channelState.ts
|
|
38712
|
-
var
|
|
39301
|
+
var makeChannelReducer = () => (state, action) => {
|
|
38713
39302
|
switch (action.type) {
|
|
38714
39303
|
case "closeThread": {
|
|
38715
39304
|
return {
|
|
@@ -42585,13 +43174,13 @@ var useMessageInputText = (props, state, dispatch, findAndEnqueueURLsToEnrich) =
|
|
|
42585
43174
|
const { channel } = useChannelStateContext("useMessageInputText");
|
|
42586
43175
|
const { additionalTextareaProps, focus, parent, publishTypingEvent = true } = props;
|
|
42587
43176
|
const { text: text5 } = state;
|
|
42588
|
-
const textareaRef = (0, import_react75.useRef)();
|
|
43177
|
+
const textareaRef = (0, import_react75.useRef)(void 0);
|
|
42589
43178
|
(0, import_react75.useEffect)(() => {
|
|
42590
43179
|
if (focus && textareaRef.current) {
|
|
42591
43180
|
textareaRef.current.focus();
|
|
42592
43181
|
}
|
|
42593
43182
|
}, [focus]);
|
|
42594
|
-
const newCursorPosition = (0, import_react75.useRef)();
|
|
43183
|
+
const newCursorPosition = (0, import_react75.useRef)(void 0);
|
|
42595
43184
|
const insertText = (0, import_react75.useCallback)(
|
|
42596
43185
|
(textToInsert) => {
|
|
42597
43186
|
const { maxLength } = additionalTextareaProps || {};
|
|
@@ -44528,7 +45117,10 @@ var moveChannelUpwards = ({
|
|
|
44528
45117
|
const targetChannelExistsWithinList = targetChannelIndex >= 0;
|
|
44529
45118
|
const targetChannelAlreadyAtTheTop = targetChannelIndex === 0;
|
|
44530
45119
|
const considerPinnedChannels = shouldConsiderPinnedChannels(sort);
|
|
44531
|
-
|
|
45120
|
+
const isTargetChannelPinned = isChannelPinned(channelToMove);
|
|
45121
|
+
if (targetChannelAlreadyAtTheTop || considerPinnedChannels && isTargetChannelPinned) {
|
|
45122
|
+
return channels;
|
|
45123
|
+
}
|
|
44532
45124
|
const newChannels = [...channels];
|
|
44533
45125
|
if (targetChannelExistsWithinList) {
|
|
44534
45126
|
newChannels.splice(targetChannelIndex, 1);
|
|
@@ -44545,25 +45137,48 @@ var moveChannelUpwards = ({
|
|
|
44545
45137
|
return newChannels;
|
|
44546
45138
|
};
|
|
44547
45139
|
var shouldConsiderPinnedChannels = (sort) => {
|
|
44548
|
-
|
|
44549
|
-
if (
|
|
44550
|
-
|
|
44551
|
-
|
|
44552
|
-
|
|
45140
|
+
const value = extractSortValue({ atIndex: 0, sort, targetKey: "pinned_at" });
|
|
45141
|
+
if (typeof value !== "number") return false;
|
|
45142
|
+
return Math.abs(value) === 1;
|
|
45143
|
+
};
|
|
45144
|
+
var extractSortValue = ({
|
|
45145
|
+
atIndex,
|
|
45146
|
+
sort,
|
|
45147
|
+
targetKey
|
|
45148
|
+
}) => {
|
|
45149
|
+
if (!sort) return null;
|
|
45150
|
+
let option = null;
|
|
45151
|
+
if (Array.isArray(sort)) {
|
|
45152
|
+
option = sort[atIndex] ?? null;
|
|
45153
|
+
} else {
|
|
45154
|
+
let index3 = 0;
|
|
45155
|
+
for (const key in sort) {
|
|
45156
|
+
if (index3 !== atIndex) {
|
|
45157
|
+
index3++;
|
|
45158
|
+
continue;
|
|
45159
|
+
}
|
|
45160
|
+
if (key !== targetKey) {
|
|
45161
|
+
return null;
|
|
45162
|
+
}
|
|
45163
|
+
option = sort;
|
|
45164
|
+
break;
|
|
45165
|
+
}
|
|
45166
|
+
}
|
|
45167
|
+
return option?.[targetKey] ?? null;
|
|
44553
45168
|
};
|
|
44554
45169
|
var shouldConsiderArchivedChannels = (filters) => {
|
|
44555
45170
|
if (!filters) return false;
|
|
44556
|
-
return
|
|
45171
|
+
return typeof filters.archived === "boolean";
|
|
44557
45172
|
};
|
|
44558
45173
|
var isChannelPinned = (channel) => {
|
|
44559
45174
|
if (!channel) return false;
|
|
44560
|
-
const
|
|
44561
|
-
return
|
|
45175
|
+
const membership = channel.state.membership;
|
|
45176
|
+
return typeof membership.pinned_at === "string";
|
|
44562
45177
|
};
|
|
44563
45178
|
var isChannelArchived = (channel) => {
|
|
44564
45179
|
if (!channel) return false;
|
|
44565
|
-
const
|
|
44566
|
-
return
|
|
45180
|
+
const membership = channel.state.membership;
|
|
45181
|
+
return typeof membership.archived_at === "string";
|
|
44567
45182
|
};
|
|
44568
45183
|
|
|
44569
45184
|
// src/components/ChannelList/hooks/usePaginatedChannels.ts
|
|
@@ -44575,7 +45190,7 @@ var usePaginatedChannels = (client, filters, sort, options, activeChannelHandler
|
|
|
44575
45190
|
} = useChatContext("usePaginatedChannels");
|
|
44576
45191
|
const [channels, setChannels] = (0, import_react90.useState)([]);
|
|
44577
45192
|
const [hasNextPage, setHasNextPage] = (0, import_react90.useState)(true);
|
|
44578
|
-
const lastRecoveryTimestamp = (0, import_react90.useRef)();
|
|
45193
|
+
const lastRecoveryTimestamp = (0, import_react90.useRef)(void 0);
|
|
44579
45194
|
const recoveryThrottleInterval = recoveryThrottleIntervalMs < MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS ? MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS : recoveryThrottleIntervalMs ?? RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS;
|
|
44580
45195
|
const filterString = (0, import_react90.useMemo)(() => JSON.stringify(filters), [filters]);
|
|
44581
45196
|
const sortString = (0, import_react90.useMemo)(() => JSON.stringify(sort), [sort]);
|
|
@@ -44677,7 +45292,7 @@ var useChannelSearch = ({
|
|
|
44677
45292
|
const [query, setQuery] = (0, import_react91.useState)("");
|
|
44678
45293
|
const [results, setResults] = (0, import_react91.useState)([]);
|
|
44679
45294
|
const [searching, setSearching] = (0, import_react91.useState)(false);
|
|
44680
|
-
const searchQueryPromiseInProgress = (0, import_react91.useRef)();
|
|
45295
|
+
const searchQueryPromiseInProgress = (0, import_react91.useRef)(void 0);
|
|
44681
45296
|
const shouldIgnoreQueryResults = (0, import_react91.useRef)(false);
|
|
44682
45297
|
const inputRef = (0, import_react91.useRef)(null);
|
|
44683
45298
|
const searchBarRef = (0, import_react91.useRef)(null);
|
|
@@ -45426,33 +46041,33 @@ var useChannelListShapeDefaults = () => {
|
|
|
45426
46041
|
if (typeof customHandler === "function") {
|
|
45427
46042
|
return customHandler(setChannels, event);
|
|
45428
46043
|
}
|
|
45429
|
-
|
|
45430
|
-
|
|
46044
|
+
const channelType = event.channel_type;
|
|
46045
|
+
const channelId = event.channel_id;
|
|
46046
|
+
if (!channelType || !channelId) return;
|
|
46047
|
+
setChannels((currentChannels) => {
|
|
46048
|
+
const targetChannel = client.channel(channelType, channelId);
|
|
46049
|
+
const targetChannelIndex = currentChannels.indexOf(targetChannel);
|
|
45431
46050
|
const targetChannelExistsWithinList = targetChannelIndex >= 0;
|
|
45432
|
-
const targetChannel = channels[targetChannelIndex];
|
|
45433
46051
|
const isTargetChannelPinned = isChannelPinned(targetChannel);
|
|
45434
46052
|
const isTargetChannelArchived = isChannelArchived(targetChannel);
|
|
45435
46053
|
const considerArchivedChannels = shouldConsiderArchivedChannels(filters);
|
|
45436
46054
|
const considerPinnedChannels = shouldConsiderPinnedChannels(sort);
|
|
45437
46055
|
if (
|
|
45438
|
-
// target channel is archived
|
|
45439
|
-
isTargetChannelArchived &&
|
|
45440
|
-
|
|
46056
|
+
// filter is defined, target channel is archived and filter option is set to false
|
|
46057
|
+
considerArchivedChannels && isTargetChannelArchived && !filters.archived || // filter is defined, target channel isn't archived and filter option is set to true
|
|
46058
|
+
considerArchivedChannels && !isTargetChannelArchived && filters.archived || // sort option is defined, target channel is pinned
|
|
46059
|
+
considerPinnedChannels && isTargetChannelPinned || // list order is locked
|
|
45441
46060
|
lockChannelOrder || // target channel is not within the loaded list and loading from cache is disallowed
|
|
45442
46061
|
!targetChannelExistsWithinList && !allowNewMessagesFromUnfilteredChannels
|
|
45443
46062
|
) {
|
|
45444
|
-
return
|
|
45445
|
-
}
|
|
45446
|
-
const channelToMove = channels[targetChannelIndex] ?? (allowNewMessagesFromUnfilteredChannels && event.channel_type ? client.channel(event.channel_type, event.channel_id) : null);
|
|
45447
|
-
if (channelToMove) {
|
|
45448
|
-
return moveChannelUpwards({
|
|
45449
|
-
channels,
|
|
45450
|
-
channelToMove,
|
|
45451
|
-
channelToMoveIndexWithinChannels: targetChannelIndex,
|
|
45452
|
-
sort
|
|
45453
|
-
});
|
|
46063
|
+
return currentChannels;
|
|
45454
46064
|
}
|
|
45455
|
-
return
|
|
46065
|
+
return moveChannelUpwards({
|
|
46066
|
+
channels: currentChannels,
|
|
46067
|
+
channelToMove: targetChannel,
|
|
46068
|
+
channelToMoveIndexWithinChannels: targetChannelIndex,
|
|
46069
|
+
sort
|
|
46070
|
+
});
|
|
45456
46071
|
});
|
|
45457
46072
|
},
|
|
45458
46073
|
[client]
|
|
@@ -45478,7 +46093,7 @@ var useChannelListShapeDefaults = () => {
|
|
|
45478
46093
|
type: event.channel.type
|
|
45479
46094
|
});
|
|
45480
46095
|
const considerArchivedChannels = shouldConsiderArchivedChannels(filters);
|
|
45481
|
-
if (isChannelArchived(channel) && considerArchivedChannels) {
|
|
46096
|
+
if (isChannelArchived(channel) && considerArchivedChannels && !filters.archived) {
|
|
45482
46097
|
return;
|
|
45483
46098
|
}
|
|
45484
46099
|
if (!allowNewMessagesFromUnfilteredChannels) {
|
|
@@ -45500,26 +46115,33 @@ var useChannelListShapeDefaults = () => {
|
|
|
45500
46115
|
allowNewMessagesFromUnfilteredChannels,
|
|
45501
46116
|
customHandler,
|
|
45502
46117
|
event,
|
|
45503
|
-
setChannels
|
|
46118
|
+
setChannels,
|
|
46119
|
+
sort
|
|
45504
46120
|
}) => {
|
|
45505
46121
|
if (typeof customHandler === "function") {
|
|
45506
46122
|
return customHandler(setChannels, event);
|
|
45507
46123
|
}
|
|
45508
|
-
if (
|
|
45509
|
-
|
|
45510
|
-
client,
|
|
45511
|
-
id: event.channel.id,
|
|
45512
|
-
members: event.channel.members?.reduce((acc, { user, user_id }) => {
|
|
45513
|
-
const userId = user_id || user?.id;
|
|
45514
|
-
if (userId) {
|
|
45515
|
-
acc.push(userId);
|
|
45516
|
-
}
|
|
45517
|
-
return acc;
|
|
45518
|
-
}, []),
|
|
45519
|
-
type: event.channel.type
|
|
45520
|
-
});
|
|
45521
|
-
setChannels((channels) => (0, import_lodash11.default)([channel, ...channels], "cid"));
|
|
46124
|
+
if (!event.channel || !allowNewMessagesFromUnfilteredChannels) {
|
|
46125
|
+
return;
|
|
45522
46126
|
}
|
|
46127
|
+
const channel = await getChannel({
|
|
46128
|
+
client,
|
|
46129
|
+
id: event.channel.id,
|
|
46130
|
+
members: event.channel.members?.reduce((newMembers, { user, user_id }) => {
|
|
46131
|
+
const userId = user_id || user?.id;
|
|
46132
|
+
if (userId) newMembers.push(userId);
|
|
46133
|
+
return newMembers;
|
|
46134
|
+
}, []),
|
|
46135
|
+
type: event.channel.type
|
|
46136
|
+
});
|
|
46137
|
+
setChannels(
|
|
46138
|
+
(channels) => moveChannelUpwards({
|
|
46139
|
+
channels,
|
|
46140
|
+
channelToMove: channel,
|
|
46141
|
+
channelToMoveIndexWithinChannels: -1,
|
|
46142
|
+
sort
|
|
46143
|
+
})
|
|
46144
|
+
);
|
|
45523
46145
|
},
|
|
45524
46146
|
[client]
|
|
45525
46147
|
);
|
|
@@ -45537,29 +46159,37 @@ var useChannelListShapeDefaults = () => {
|
|
|
45537
46159
|
[]
|
|
45538
46160
|
);
|
|
45539
46161
|
const handleMemberUpdated = (0, import_react101.useCallback)(
|
|
45540
|
-
({
|
|
46162
|
+
({
|
|
46163
|
+
event,
|
|
46164
|
+
filters,
|
|
46165
|
+
lockChannelOrder,
|
|
46166
|
+
setChannels,
|
|
46167
|
+
sort
|
|
46168
|
+
}) => {
|
|
45541
46169
|
if (!event.member?.user || event.member.user.id !== client.userID || !event.channel_type) {
|
|
45542
46170
|
return;
|
|
45543
46171
|
}
|
|
45544
|
-
const member = event.member;
|
|
45545
46172
|
const channelType = event.channel_type;
|
|
45546
46173
|
const channelId = event.channel_id;
|
|
45547
46174
|
const considerPinnedChannels = shouldConsiderPinnedChannels(sort);
|
|
45548
|
-
const
|
|
46175
|
+
const considerArchivedChannels = shouldConsiderArchivedChannels(filters);
|
|
46176
|
+
const pinnedAtSort = extractSortValue({ atIndex: 0, sort, targetKey: "pinned_at" });
|
|
45549
46177
|
setChannels((currentChannels) => {
|
|
45550
46178
|
const targetChannel = client.channel(channelType, channelId);
|
|
45551
46179
|
const targetChannelIndex = currentChannels.indexOf(targetChannel);
|
|
45552
46180
|
const targetChannelExistsWithinList = targetChannelIndex >= 0;
|
|
46181
|
+
const isTargetChannelArchived = isChannelArchived(targetChannel);
|
|
46182
|
+
const isTargetChannelPinned = isChannelPinned(targetChannel);
|
|
45553
46183
|
if (!considerPinnedChannels || lockChannelOrder) return currentChannels;
|
|
45554
46184
|
const newChannels = [...currentChannels];
|
|
45555
46185
|
if (targetChannelExistsWithinList) {
|
|
45556
46186
|
newChannels.splice(targetChannelIndex, 1);
|
|
45557
46187
|
}
|
|
45558
|
-
if (
|
|
46188
|
+
if (considerArchivedChannels && isTargetChannelArchived && !filters.archived || considerArchivedChannels && !isTargetChannelArchived && filters.archived) {
|
|
45559
46189
|
return newChannels;
|
|
45560
46190
|
}
|
|
45561
46191
|
let lastPinnedChannelIndex = null;
|
|
45562
|
-
if (pinnedAtSort === 1 || pinnedAtSort === -1 && !
|
|
46192
|
+
if (pinnedAtSort === 1 || pinnedAtSort === -1 && !isTargetChannelPinned) {
|
|
45563
46193
|
lastPinnedChannelIndex = findLastPinnedChannelIndex({ channels: newChannels });
|
|
45564
46194
|
}
|
|
45565
46195
|
const newTargetChannelIndex = typeof lastPinnedChannelIndex === "number" ? lastPinnedChannelIndex + 1 : 0;
|
|
@@ -45689,8 +46319,8 @@ var usePrepareShapeHandlers = ({
|
|
|
45689
46319
|
sort
|
|
45690
46320
|
}) => {
|
|
45691
46321
|
const defaults = useChannelListShapeDefaults();
|
|
45692
|
-
const defaultHandleChannelListShapeRef = (0, import_react101.useRef)();
|
|
45693
|
-
const customHandleChannelListShapeRef = (0, import_react101.useRef)();
|
|
46322
|
+
const defaultHandleChannelListShapeRef = (0, import_react101.useRef)(void 0);
|
|
46323
|
+
const customHandleChannelListShapeRef = (0, import_react101.useRef)(void 0);
|
|
45694
46324
|
customHandleChannelListShapeRef.current = (event) => {
|
|
45695
46325
|
customHandleChannelListShape?.({ defaults, event, setChannels });
|
|
45696
46326
|
};
|
|
@@ -45760,6 +46390,7 @@ var usePrepareShapeHandlers = ({
|
|
|
45760
46390
|
case "member.updated":
|
|
45761
46391
|
defaults.handleMemberUpdated({
|
|
45762
46392
|
event,
|
|
46393
|
+
filters,
|
|
45763
46394
|
lockChannelOrder,
|
|
45764
46395
|
setChannels,
|
|
45765
46396
|
sort
|
|
@@ -46243,24 +46874,41 @@ var useUserPresenceChangedListener = (setChannels) => {
|
|
|
46243
46874
|
}, [client, setChannels]);
|
|
46244
46875
|
};
|
|
46245
46876
|
|
|
46246
|
-
// src/components/ChannelList/hooks/
|
|
46877
|
+
// src/components/ChannelList/hooks/useSelectedChannelState.ts
|
|
46247
46878
|
var import_react113 = require("react");
|
|
46248
|
-
var
|
|
46249
|
-
|
|
46250
|
-
channel?.state.membership || {}
|
|
46251
|
-
);
|
|
46252
|
-
const { client } = useChatContext();
|
|
46253
|
-
(0, import_react113.useEffect)(() => {
|
|
46254
|
-
if (!channel) return;
|
|
46255
|
-
const subscriptions = ["member.updated"].map(
|
|
46256
|
-
(v) => client.on(v, () => {
|
|
46257
|
-
setMembership(channel.state.membership);
|
|
46258
|
-
})
|
|
46259
|
-
);
|
|
46260
|
-
return () => subscriptions.forEach((subscription) => subscription.unsubscribe());
|
|
46261
|
-
}, [client, channel]);
|
|
46262
|
-
return membership;
|
|
46879
|
+
var import_shim = require("use-sync-external-store/shim");
|
|
46880
|
+
var noop = () => {
|
|
46263
46881
|
};
|
|
46882
|
+
function useSelectedChannelState({
|
|
46883
|
+
channel,
|
|
46884
|
+
stateChangeEventKeys = ["all"],
|
|
46885
|
+
selector: selector7
|
|
46886
|
+
}) {
|
|
46887
|
+
const subscribe = (0, import_react113.useCallback)(
|
|
46888
|
+
(onStoreChange) => {
|
|
46889
|
+
if (!channel) return noop;
|
|
46890
|
+
const subscriptions = stateChangeEventKeys.map(
|
|
46891
|
+
(et) => channel.on(et, () => {
|
|
46892
|
+
onStoreChange(selector7(channel));
|
|
46893
|
+
})
|
|
46894
|
+
);
|
|
46895
|
+
return () => subscriptions.forEach((subscription) => subscription.unsubscribe());
|
|
46896
|
+
},
|
|
46897
|
+
[channel, selector7, stateChangeEventKeys]
|
|
46898
|
+
);
|
|
46899
|
+
const getSnapshot = (0, import_react113.useCallback)(() => {
|
|
46900
|
+
if (!channel) return void 0;
|
|
46901
|
+
return selector7(channel);
|
|
46902
|
+
}, [channel, selector7]);
|
|
46903
|
+
return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot);
|
|
46904
|
+
}
|
|
46905
|
+
|
|
46906
|
+
// src/components/ChannelList/hooks/useChannelMembershipState.ts
|
|
46907
|
+
var selector = (c) => c.state.membership;
|
|
46908
|
+
var keys2 = ["member.updated"];
|
|
46909
|
+
function useChannelMembershipState(channel) {
|
|
46910
|
+
return useSelectedChannelState({ channel, selector, stateChangeEventKeys: keys2 });
|
|
46911
|
+
}
|
|
46264
46912
|
|
|
46265
46913
|
// src/components/ChannelPreview/icons.tsx
|
|
46266
46914
|
var import_react114 = __toESM(require("react"));
|
|
@@ -46745,12 +47393,12 @@ var ThreadAdapter = ({ children }) => {
|
|
|
46745
47393
|
useActiveThread({ activeThread });
|
|
46746
47394
|
return /* @__PURE__ */ import_react122.default.createElement(ThreadProvider, { thread: activeThread }, children);
|
|
46747
47395
|
};
|
|
46748
|
-
var
|
|
47396
|
+
var selector2 = ({ unreadThreadCount }) => ({
|
|
46749
47397
|
unreadThreadCount
|
|
46750
47398
|
});
|
|
46751
47399
|
var ChatViewSelector = () => {
|
|
46752
47400
|
const { client } = useChatContext();
|
|
46753
|
-
const { unreadThreadCount } = useStateStore(client.threads.state,
|
|
47401
|
+
const { unreadThreadCount } = useStateStore(client.threads.state, selector2);
|
|
46754
47402
|
const { activeChatView, setActiveChatView } = (0, import_react122.useContext)(ChatViewContext);
|
|
46755
47403
|
return /* @__PURE__ */ import_react122.default.createElement("div", { className: "str-chat__chat-view__selector" }, /* @__PURE__ */ import_react122.default.createElement(
|
|
46756
47404
|
"button",
|
|
@@ -46812,7 +47460,7 @@ var getTitleFromMessage = ({
|
|
|
46812
47460
|
var ThreadListItemUI = (props) => {
|
|
46813
47461
|
const { client } = useChatContext();
|
|
46814
47462
|
const thread = useThreadListItemContext();
|
|
46815
|
-
const
|
|
47463
|
+
const selector7 = (0, import_react123.useCallback)(
|
|
46816
47464
|
(nextValue) => ({
|
|
46817
47465
|
channel: nextValue.channel,
|
|
46818
47466
|
deletedAt: nextValue.deletedAt,
|
|
@@ -46824,7 +47472,7 @@ var ThreadListItemUI = (props) => {
|
|
|
46824
47472
|
);
|
|
46825
47473
|
const { channel, deletedAt, latestReply, ownUnreadMessageCount, parentMessage } = useStateStore(
|
|
46826
47474
|
thread.state,
|
|
46827
|
-
|
|
47475
|
+
selector7
|
|
46828
47476
|
);
|
|
46829
47477
|
const { displayTitle: channelDisplayTitle } = useChannelPreviewInfo({ channel });
|
|
46830
47478
|
const { activeThread, setActiveThread } = useThreadsViewContext();
|
|
@@ -46861,12 +47509,12 @@ var ThreadListEmptyPlaceholder = () => /* @__PURE__ */ import_react125.default.c
|
|
|
46861
47509
|
|
|
46862
47510
|
// src/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.tsx
|
|
46863
47511
|
var import_react126 = __toESM(require("react"));
|
|
46864
|
-
var
|
|
47512
|
+
var selector3 = (nextValue) => ({
|
|
46865
47513
|
unseenThreadIds: nextValue.unseenThreadIds
|
|
46866
47514
|
});
|
|
46867
47515
|
var ThreadListUnseenThreadsBanner = () => {
|
|
46868
47516
|
const { client } = useChatContext();
|
|
46869
|
-
const { unseenThreadIds } = useStateStore(client.threads.state,
|
|
47517
|
+
const { unseenThreadIds } = useStateStore(client.threads.state, selector3);
|
|
46870
47518
|
if (!unseenThreadIds.length) return null;
|
|
46871
47519
|
return /* @__PURE__ */ import_react126.default.createElement("div", { className: "str-chat__unseen-threads-banner" }, unseenThreadIds.length, " unread threads", /* @__PURE__ */ import_react126.default.createElement(
|
|
46872
47520
|
"button",
|
|
@@ -46880,19 +47528,19 @@ var ThreadListUnseenThreadsBanner = () => {
|
|
|
46880
47528
|
|
|
46881
47529
|
// src/components/Threads/ThreadList/ThreadListLoadingIndicator.tsx
|
|
46882
47530
|
var import_react127 = __toESM(require("react"));
|
|
46883
|
-
var
|
|
47531
|
+
var selector4 = (nextValue) => ({
|
|
46884
47532
|
isLoadingNext: nextValue.pagination.isLoadingNext
|
|
46885
47533
|
});
|
|
46886
47534
|
var ThreadListLoadingIndicator = () => {
|
|
46887
47535
|
const { LoadingIndicator: LoadingIndicator2 = LoadingIndicator } = useComponentContext();
|
|
46888
47536
|
const { client } = useChatContext();
|
|
46889
|
-
const { isLoadingNext } = useStateStore(client.threads.state,
|
|
47537
|
+
const { isLoadingNext } = useStateStore(client.threads.state, selector4);
|
|
46890
47538
|
if (!isLoadingNext) return null;
|
|
46891
47539
|
return /* @__PURE__ */ import_react127.default.createElement("div", { className: "str-chat__thread-list-loading-indicator" }, /* @__PURE__ */ import_react127.default.createElement(LoadingIndicator2, null));
|
|
46892
47540
|
};
|
|
46893
47541
|
|
|
46894
47542
|
// src/components/Threads/ThreadList/ThreadList.tsx
|
|
46895
|
-
var
|
|
47543
|
+
var selector5 = (nextValue) => ({ threads: nextValue.threads });
|
|
46896
47544
|
var computeItemKey = (_, item) => item.id;
|
|
46897
47545
|
var useThreadList = () => {
|
|
46898
47546
|
const { client } = useChatContext();
|
|
@@ -46921,7 +47569,7 @@ var ThreadList = ({ virtuosoProps }) => {
|
|
|
46921
47569
|
ThreadListLoadingIndicator: ThreadListLoadingIndicator2 = ThreadListLoadingIndicator,
|
|
46922
47570
|
ThreadListUnseenThreadsBanner: ThreadListUnseenThreadsBanner2 = ThreadListUnseenThreadsBanner
|
|
46923
47571
|
} = useComponentContext();
|
|
46924
|
-
const { threads } = useStateStore(client.threads.state,
|
|
47572
|
+
const { threads } = useStateStore(client.threads.state, selector5);
|
|
46925
47573
|
useThreadList();
|
|
46926
47574
|
return /* @__PURE__ */ import_react128.default.createElement("div", { className: "str-chat__thread-list-container" }, /* @__PURE__ */ import_react128.default.createElement(ThreadListUnseenThreadsBanner2, null), /* @__PURE__ */ import_react128.default.createElement(
|
|
46927
47575
|
import_react_virtuoso.Virtuoso,
|
|
@@ -50309,7 +50957,7 @@ var import_react194 = __toESM(require("react"));
|
|
|
50309
50957
|
var import_react193 = require("react");
|
|
50310
50958
|
var useTimeElapsed = ({ startOnMount } = {}) => {
|
|
50311
50959
|
const [secondsElapsed, setSecondsElapsed] = (0, import_react193.useState)(0);
|
|
50312
|
-
const updateInterval = (0, import_react193.useRef)();
|
|
50960
|
+
const updateInterval = (0, import_react193.useRef)(void 0);
|
|
50313
50961
|
const startCounter = (0, import_react193.useCallback)(() => {
|
|
50314
50962
|
if (updateInterval.current) return;
|
|
50315
50963
|
updateInterval.current = setInterval(() => {
|
|
@@ -51139,7 +51787,7 @@ var UnMemoizedChatAutoComplete = (props) => {
|
|
|
51139
51787
|
closeCommandsList: messageInput.closeCommandsList,
|
|
51140
51788
|
closeMentionsList: messageInput.closeMentionsList,
|
|
51141
51789
|
containerClassName: "str-chat__textarea str-chat__message-textarea-react-host",
|
|
51142
|
-
disabled: disabled || !!cooldownRemaining,
|
|
51790
|
+
disabled: (props.disabled ?? disabled) || !!cooldownRemaining,
|
|
51143
51791
|
disableMentions: messageInput.disableMentions,
|
|
51144
51792
|
grow: messageInput.grow,
|
|
51145
51793
|
handleSubmit: props.handleSubmit || messageInput.handleSubmit,
|
|
@@ -52534,7 +53182,7 @@ function useMessageListScrollManager(params) {
|
|
|
52534
53182
|
offsetHeight: 0,
|
|
52535
53183
|
scrollHeight: 0
|
|
52536
53184
|
});
|
|
52537
|
-
const messages = (0, import_react230.useRef)();
|
|
53185
|
+
const messages = (0, import_react230.useRef)(void 0);
|
|
52538
53186
|
const scrollTop = (0, import_react230.useRef)(0);
|
|
52539
53187
|
(0, import_react230.useLayoutEffect)(() => {
|
|
52540
53188
|
const prevMeasures = measures.current;
|
|
@@ -52742,25 +53390,26 @@ var useUnreadMessagesNotification = ({
|
|
|
52742
53390
|
|
|
52743
53391
|
// src/components/MessageList/hooks/useMarkRead.ts
|
|
52744
53392
|
var import_react235 = require("react");
|
|
53393
|
+
var hasReadLastMessage = (channel, userId) => {
|
|
53394
|
+
const latestMessageIdInChannel = channel.state.latestMessages.slice(-1)[0]?.id;
|
|
53395
|
+
const lastReadMessageIdServer = channel.state.read[userId]?.last_read_message_id;
|
|
53396
|
+
return latestMessageIdInChannel === lastReadMessageIdServer;
|
|
53397
|
+
};
|
|
52745
53398
|
var useMarkRead = ({
|
|
52746
53399
|
isMessageListScrolledToBottom,
|
|
52747
53400
|
messageListIsThread,
|
|
52748
|
-
unreadCount,
|
|
52749
53401
|
wasMarkedUnread
|
|
52750
53402
|
}) => {
|
|
52751
53403
|
const { client } = useChatContext("useMarkRead");
|
|
52752
53404
|
const { markRead, setChannelUnreadUiState } = useChannelActionContext("useMarkRead");
|
|
52753
53405
|
const { channel } = useChannelStateContext("useMarkRead");
|
|
52754
|
-
const previousRenderMessageListScrolledToBottom = (0, import_react235.useRef)(isMessageListScrolledToBottom);
|
|
52755
53406
|
(0, import_react235.useEffect)(() => {
|
|
52756
|
-
const shouldMarkRead = (
|
|
53407
|
+
const shouldMarkRead = () => !document.hidden && !wasMarkedUnread && !messageListIsThread && isMessageListScrolledToBottom && client.user?.id && !hasReadLastMessage(channel, client.user.id);
|
|
52757
53408
|
const onVisibilityChange = () => {
|
|
52758
|
-
if (shouldMarkRead(
|
|
53409
|
+
if (shouldMarkRead()) markRead();
|
|
52759
53410
|
};
|
|
52760
53411
|
const handleMessageNew = (event) => {
|
|
52761
|
-
const isOwnMessage = event.user?.id && event.user.id === client.user?.id;
|
|
52762
53412
|
const mainChannelUpdated = !event.message?.parent_id || event.message?.show_in_channel;
|
|
52763
|
-
if (isOwnMessage) return;
|
|
52764
53413
|
if (!isMessageListScrolledToBottom || wasMarkedUnread || document.hidden) {
|
|
52765
53414
|
setChannelUnreadUiState((prev) => {
|
|
52766
53415
|
const previousUnreadCount = prev?.unread_messages ?? 0;
|
|
@@ -52775,15 +53424,15 @@ var useMarkRead = ({
|
|
|
52775
53424
|
unread_messages: previousUnreadCount + 1
|
|
52776
53425
|
};
|
|
52777
53426
|
});
|
|
52778
|
-
} else if (mainChannelUpdated && shouldMarkRead(
|
|
53427
|
+
} else if (mainChannelUpdated && shouldMarkRead()) {
|
|
52779
53428
|
markRead();
|
|
52780
53429
|
}
|
|
52781
53430
|
};
|
|
52782
53431
|
channel.on("message.new", handleMessageNew);
|
|
52783
53432
|
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
52784
|
-
|
|
52785
|
-
|
|
52786
|
-
|
|
53433
|
+
if (shouldMarkRead()) {
|
|
53434
|
+
markRead();
|
|
53435
|
+
}
|
|
52787
53436
|
return () => {
|
|
52788
53437
|
channel.off("message.new", handleMessageNew);
|
|
52789
53438
|
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
@@ -52795,7 +53444,6 @@ var useMarkRead = ({
|
|
|
52795
53444
|
markRead,
|
|
52796
53445
|
messageListIsThread,
|
|
52797
53446
|
setChannelUnreadUiState,
|
|
52798
|
-
unreadCount,
|
|
52799
53447
|
wasMarkedUnread
|
|
52800
53448
|
]);
|
|
52801
53449
|
};
|
|
@@ -52939,10 +53587,10 @@ var InfiniteScroll = (props) => {
|
|
|
52939
53587
|
const loadPreviousPageFn = loadPreviousPage || loadMore;
|
|
52940
53588
|
const hasNextPageFlag = hasNextPage || hasMoreNewer;
|
|
52941
53589
|
const hasPreviousPageFlag = hasPreviousPage || hasMore;
|
|
52942
|
-
const scrollComponent = (0, import_react240.useRef)();
|
|
52943
|
-
const previousOffset = (0, import_react240.useRef)();
|
|
52944
|
-
const previousReverseOffset = (0, import_react240.useRef)();
|
|
52945
|
-
const scrollListenerRef = (0, import_react240.useRef)();
|
|
53590
|
+
const scrollComponent = (0, import_react240.useRef)(void 0);
|
|
53591
|
+
const previousOffset = (0, import_react240.useRef)(void 0);
|
|
53592
|
+
const previousReverseOffset = (0, import_react240.useRef)(void 0);
|
|
53593
|
+
const scrollListenerRef = (0, import_react240.useRef)(void 0);
|
|
52946
53594
|
scrollListenerRef.current = () => {
|
|
52947
53595
|
const element3 = scrollComponent.current;
|
|
52948
53596
|
if (!element3 || element3.offsetParent === null) {
|
|
@@ -53348,7 +53996,6 @@ var MessageListWithContext = (props) => {
|
|
|
53348
53996
|
useMarkRead({
|
|
53349
53997
|
isMessageListScrolledToBottom,
|
|
53350
53998
|
messageListIsThread: threadList,
|
|
53351
|
-
unreadCount: channelUnreadUiState?.unread_messages ?? 0,
|
|
53352
53999
|
wasMarkedUnread: !!channelUnreadUiState?.first_unread_message_id
|
|
53353
54000
|
});
|
|
53354
54001
|
const { messageGroupStyles, messages: enrichedMessages } = useEnrichedMessages({
|
|
@@ -53566,7 +54213,7 @@ var ScrollToBottomButton = import_react247.default.memo(
|
|
|
53566
54213
|
);
|
|
53567
54214
|
|
|
53568
54215
|
// src/components/MessageList/VirtualizedMessageList.tsx
|
|
53569
|
-
var
|
|
54216
|
+
var import_react257 = __toESM(require("react"));
|
|
53570
54217
|
var import_react_virtuoso2 = require("react-virtuoso");
|
|
53571
54218
|
|
|
53572
54219
|
// src/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.ts
|
|
@@ -53610,8 +54257,10 @@ var STATUSES_EXCLUDED_FROM_PREPEND = {
|
|
|
53610
54257
|
};
|
|
53611
54258
|
function usePrependedMessagesCount(messages, hasDateSeparator) {
|
|
53612
54259
|
const firstRealMessageIndex = hasDateSeparator ? 1 : 0;
|
|
53613
|
-
const firstMessageOnFirstLoadedPage = (0, import_react249.useRef)();
|
|
53614
|
-
const previousFirstMessageOnFirstLoadedPage = (0, import_react249.useRef)(
|
|
54260
|
+
const firstMessageOnFirstLoadedPage = (0, import_react249.useRef)(void 0);
|
|
54261
|
+
const previousFirstMessageOnFirstLoadedPage = (0, import_react249.useRef)(
|
|
54262
|
+
void 0
|
|
54263
|
+
);
|
|
53615
54264
|
const previousNumItemsPrepended = (0, import_react249.useRef)(0);
|
|
53616
54265
|
const numItemsPrepended = (0, import_react249.useMemo)(() => {
|
|
53617
54266
|
if (!messages || !messages.length) {
|
|
@@ -53693,7 +54342,7 @@ var useMessageSetKey = ({
|
|
|
53693
54342
|
messages
|
|
53694
54343
|
}) => {
|
|
53695
54344
|
const [messageSetKey, setMessageSetKey] = (0, import_react252.useState)(+/* @__PURE__ */ new Date());
|
|
53696
|
-
const firstMessageId = (0, import_react252.useRef)();
|
|
54345
|
+
const firstMessageId = (0, import_react252.useRef)(void 0);
|
|
53697
54346
|
(0, import_react252.useEffect)(() => {
|
|
53698
54347
|
const continuousSet = messages?.find((message) => message.id === firstMessageId.current);
|
|
53699
54348
|
if (!continuousSet) {
|
|
@@ -53714,7 +54363,7 @@ var useScrollToBottomOnNewMessage = ({
|
|
|
53714
54363
|
scrollToLatestMessageOnFocus
|
|
53715
54364
|
}) => {
|
|
53716
54365
|
const [newMessagesReceivedInBackground, setNewMessagesReceivedInBackground] = (0, import_react253.useState)(false);
|
|
53717
|
-
const scrollToBottomIfConfigured = (0, import_react253.useRef)();
|
|
54366
|
+
const scrollToBottomIfConfigured = (0, import_react253.useRef)(void 0);
|
|
53718
54367
|
scrollToBottomIfConfigured.current = (event) => {
|
|
53719
54368
|
if (!scrollToLatestMessageOnFocus || !newMessagesReceivedInBackground || event.target !== window) {
|
|
53720
54369
|
return;
|
|
@@ -53904,6 +54553,14 @@ var messageRenderer = (virtuosoIndex, _data, virtuosoContext) => {
|
|
|
53904
54553
|
));
|
|
53905
54554
|
};
|
|
53906
54555
|
|
|
54556
|
+
// src/context/VirtualizedMessageListContext.tsx
|
|
54557
|
+
var import_react256 = __toESM(require("react"));
|
|
54558
|
+
var VirtualizedMessageListContext = (0, import_react256.createContext)(void 0);
|
|
54559
|
+
var VirtualizedMessageListContextProvider = ({
|
|
54560
|
+
children,
|
|
54561
|
+
value
|
|
54562
|
+
}) => /* @__PURE__ */ import_react256.default.createElement(VirtualizedMessageListContext.Provider, { value }, children);
|
|
54563
|
+
|
|
53907
54564
|
// src/components/MessageList/VirtualizedMessageList.tsx
|
|
53908
54565
|
function captureResizeObserverExceededError(e2) {
|
|
53909
54566
|
if (e2.message === "ResizeObserver loop completed with undelivered notifications." || e2.message === "ResizeObserver loop limit exceeded") {
|
|
@@ -53911,7 +54568,7 @@ function captureResizeObserverExceededError(e2) {
|
|
|
53911
54568
|
}
|
|
53912
54569
|
}
|
|
53913
54570
|
function useCaptureResizeObserverExceededError() {
|
|
53914
|
-
(0,
|
|
54571
|
+
(0, import_react257.useEffect)(() => {
|
|
53915
54572
|
window.addEventListener("error", captureResizeObserverExceededError);
|
|
53916
54573
|
return () => {
|
|
53917
54574
|
window.removeEventListener("error", captureResizeObserverExceededError);
|
|
@@ -53998,8 +54655,8 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
53998
54655
|
} = useComponentContext("VirtualizedMessageList");
|
|
53999
54656
|
const MessageUIComponent = MessageUIComponentFromProps || MessageUIComponentFromContext;
|
|
54000
54657
|
const { client, customClasses } = useChatContext("VirtualizedMessageList");
|
|
54001
|
-
const virtuoso = (0,
|
|
54002
|
-
const lastRead = (0,
|
|
54658
|
+
const virtuoso = (0, import_react257.useRef)(null);
|
|
54659
|
+
const lastRead = (0, import_react257.useMemo)(() => channel.lastRead?.(), [channel]);
|
|
54003
54660
|
const {
|
|
54004
54661
|
show: showUnreadMessagesNotification,
|
|
54005
54662
|
toggleShowUnreadMessagesNotification
|
|
@@ -54011,7 +54668,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
54011
54668
|
const { giphyPreviewMessage, setGiphyPreviewMessage } = useGiphyPreview(
|
|
54012
54669
|
separateGiphyPreview
|
|
54013
54670
|
);
|
|
54014
|
-
const processedMessages = (0,
|
|
54671
|
+
const processedMessages = (0, import_react257.useMemo)(() => {
|
|
54015
54672
|
if (typeof messages === "undefined") {
|
|
54016
54673
|
return [];
|
|
54017
54674
|
}
|
|
@@ -54043,11 +54700,11 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
54043
54700
|
returnAllReadData,
|
|
54044
54701
|
userID: client.userID
|
|
54045
54702
|
});
|
|
54046
|
-
const lastReceivedMessageId = (0,
|
|
54703
|
+
const lastReceivedMessageId = (0, import_react257.useMemo)(() => getLastReceived(processedMessages), [
|
|
54047
54704
|
processedMessages
|
|
54048
54705
|
]);
|
|
54049
54706
|
const groupStylesFn = groupStyles || getGroupStyles;
|
|
54050
|
-
const messageGroupStyles = (0,
|
|
54707
|
+
const messageGroupStyles = (0, import_react257.useMemo)(
|
|
54051
54708
|
() => processedMessages.reduce((acc, message, i) => {
|
|
54052
54709
|
const style = groupStylesFn(
|
|
54053
54710
|
message,
|
|
@@ -54073,10 +54730,9 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
54073
54730
|
useMarkRead({
|
|
54074
54731
|
isMessageListScrolledToBottom,
|
|
54075
54732
|
messageListIsThread: !!threadList,
|
|
54076
|
-
unreadCount: channelUnreadUiState?.unread_messages ?? 0,
|
|
54077
54733
|
wasMarkedUnread: !!channelUnreadUiState?.first_unread_message_id
|
|
54078
54734
|
});
|
|
54079
|
-
const scrollToBottom = (0,
|
|
54735
|
+
const scrollToBottom = (0, import_react257.useCallback)(async () => {
|
|
54080
54736
|
if (hasMoreNewer) {
|
|
54081
54737
|
await jumpToLatestMessage();
|
|
54082
54738
|
return;
|
|
@@ -54098,7 +54754,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
54098
54754
|
const numItemsPrepended = usePrependedMessagesCount(processedMessages, !disableDateSeparator);
|
|
54099
54755
|
const { messageSetKey } = useMessageSetKey({ messages });
|
|
54100
54756
|
const shouldForceScrollToBottom = useShouldForceScrollToBottom(processedMessages, client.userID);
|
|
54101
|
-
const handleItemsRendered = (0,
|
|
54757
|
+
const handleItemsRendered = (0, import_react257.useMemo)(
|
|
54102
54758
|
() => makeItemsRenderedHandler([toggleShowUnreadMessagesNotification], processedMessages),
|
|
54103
54759
|
[processedMessages, toggleShowUnreadMessagesNotification]
|
|
54104
54760
|
);
|
|
@@ -54111,7 +54767,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
54111
54767
|
}
|
|
54112
54768
|
return isAtBottom ? stickToBottomScrollBehavior : false;
|
|
54113
54769
|
};
|
|
54114
|
-
const computeItemKey2 = (0,
|
|
54770
|
+
const computeItemKey2 = (0, import_react257.useCallback)(
|
|
54115
54771
|
(index3, _, { numItemsPrepended: numItemsPrepended2, processedMessages: processedMessages2 }) => processedMessages2[calculateItemIndex(index3, numItemsPrepended2)].id,
|
|
54116
54772
|
[]
|
|
54117
54773
|
);
|
|
@@ -54128,7 +54784,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
54128
54784
|
loadMore?.(messageLimit);
|
|
54129
54785
|
}
|
|
54130
54786
|
};
|
|
54131
|
-
(0,
|
|
54787
|
+
(0, import_react257.useEffect)(() => {
|
|
54132
54788
|
let scrollTimeout;
|
|
54133
54789
|
if (highlightedMessageId) {
|
|
54134
54790
|
const index3 = findMessageIndex(processedMessages, highlightedMessageId);
|
|
@@ -54144,7 +54800,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
54144
54800
|
}, [highlightedMessageId, processedMessages]);
|
|
54145
54801
|
if (!processedMessages) return null;
|
|
54146
54802
|
const dialogManagerId = threadList ? "virtualized-message-list-dialog-manager-thread" : "virtualized-message-list-dialog-manager";
|
|
54147
|
-
return /* @__PURE__ */
|
|
54803
|
+
return /* @__PURE__ */ import_react257.default.createElement(VirtualizedMessageListContextProvider, { value: { scrollToBottom } }, /* @__PURE__ */ import_react257.default.createElement(MessageListMainPanel2, null, /* @__PURE__ */ import_react257.default.createElement(DialogManagerProvider, { id: dialogManagerId }, !threadList && showUnreadMessagesNotification && /* @__PURE__ */ import_react257.default.createElement(UnreadMessagesNotification2, { unreadCount: channelUnreadUiState?.unread_messages }), /* @__PURE__ */ import_react257.default.createElement("div", { className: customClasses?.virtualizedMessageList || "str-chat__virtual-list" }, /* @__PURE__ */ import_react257.default.createElement(
|
|
54148
54804
|
import_react_virtuoso2.Virtuoso,
|
|
54149
54805
|
{
|
|
54150
54806
|
atBottomStateChange,
|
|
@@ -54209,7 +54865,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
54209
54865
|
...scrollSeekPlaceHolder ? { scrollSeek: scrollSeekPlaceHolder } : {},
|
|
54210
54866
|
...defaultItemHeight ? { defaultItemHeight } : {}
|
|
54211
54867
|
}
|
|
54212
|
-
))), TypingIndicator2 && /* @__PURE__ */
|
|
54868
|
+
))), TypingIndicator2 && /* @__PURE__ */ import_react257.default.createElement(TypingIndicator2, null)), /* @__PURE__ */ import_react257.default.createElement(
|
|
54213
54869
|
MessageListNotifications2,
|
|
54214
54870
|
{
|
|
54215
54871
|
hasNewMessages: newMessagesNotification,
|
|
@@ -54221,7 +54877,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
54221
54877
|
threadList,
|
|
54222
54878
|
unreadCount: threadList ? void 0 : channelUnreadUiState?.unread_messages
|
|
54223
54879
|
}
|
|
54224
|
-
), giphyPreviewMessage && /* @__PURE__ */
|
|
54880
|
+
), giphyPreviewMessage && /* @__PURE__ */ import_react257.default.createElement(GiphyPreviewMessage2, { message: giphyPreviewMessage }));
|
|
54225
54881
|
};
|
|
54226
54882
|
function VirtualizedMessageList(props) {
|
|
54227
54883
|
const {
|
|
@@ -54243,7 +54899,7 @@ function VirtualizedMessageList(props) {
|
|
|
54243
54899
|
suppressAutoscroll
|
|
54244
54900
|
} = useChannelStateContext("VirtualizedMessageList");
|
|
54245
54901
|
const messages = props.messages || contextMessages;
|
|
54246
|
-
return /* @__PURE__ */
|
|
54902
|
+
return /* @__PURE__ */ import_react257.default.createElement(
|
|
54247
54903
|
VirtualizedMessageListWithContext,
|
|
54248
54904
|
{
|
|
54249
54905
|
channel,
|
|
@@ -54434,7 +55090,7 @@ var ChannelContainer = ({
|
|
|
54434
55090
|
customClasses
|
|
54435
55091
|
});
|
|
54436
55092
|
const className = (0, import_clsx64.default)(chatClass, theme, channelClass, additionalClassName);
|
|
54437
|
-
return /* @__PURE__ */
|
|
55093
|
+
return /* @__PURE__ */ import_react258.default.createElement("div", { id: CHANNEL_CONTAINER_ID, ...props, className }, children);
|
|
54438
55094
|
};
|
|
54439
55095
|
var UnMemoizedChannel = (props) => {
|
|
54440
55096
|
const {
|
|
@@ -54448,15 +55104,15 @@ var UnMemoizedChannel = (props) => {
|
|
|
54448
55104
|
);
|
|
54449
55105
|
const channel = propsChannel || contextChannel;
|
|
54450
55106
|
if (channelsQueryState.queryInProgress === "reload" && LoadingIndicator2) {
|
|
54451
|
-
return /* @__PURE__ */
|
|
55107
|
+
return /* @__PURE__ */ import_react258.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react258.default.createElement(LoadingIndicator2, null));
|
|
54452
55108
|
}
|
|
54453
55109
|
if (channelsQueryState.error && LoadingErrorIndicator2) {
|
|
54454
|
-
return /* @__PURE__ */
|
|
55110
|
+
return /* @__PURE__ */ import_react258.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react258.default.createElement(LoadingErrorIndicator2, { error: channelsQueryState.error }));
|
|
54455
55111
|
}
|
|
54456
55112
|
if (!channel?.cid) {
|
|
54457
|
-
return /* @__PURE__ */
|
|
55113
|
+
return /* @__PURE__ */ import_react258.default.createElement(ChannelContainer, null, EmptyPlaceholder2);
|
|
54458
55114
|
}
|
|
54459
|
-
return /* @__PURE__ */
|
|
55115
|
+
return /* @__PURE__ */ import_react258.default.createElement(ChannelInner, { ...props, channel, key: channel.cid });
|
|
54460
55116
|
};
|
|
54461
55117
|
var ChannelInner = (props) => {
|
|
54462
55118
|
const {
|
|
@@ -54482,7 +55138,7 @@ var ChannelInner = (props) => {
|
|
|
54482
55138
|
optionalMessageInputProps = {},
|
|
54483
55139
|
skipMessageDataMemoization
|
|
54484
55140
|
} = props;
|
|
54485
|
-
const channelQueryOptions = (0,
|
|
55141
|
+
const channelQueryOptions = (0, import_react258.useMemo)(
|
|
54486
55142
|
() => (0, import_lodash24.default)(propChannelQueryOptions, {
|
|
54487
55143
|
messages: { limit: DEFAULT_INITIAL_CHANNEL_PAGE_SIZE }
|
|
54488
55144
|
}),
|
|
@@ -54498,12 +55154,13 @@ var ChannelInner = (props) => {
|
|
|
54498
55154
|
const chatContainerClass = getChatContainerClass(customClasses?.chatContainer);
|
|
54499
55155
|
const windowsEmojiClass = useImageFlagEmojisOnWindowsClass();
|
|
54500
55156
|
const thread = useThreadContext();
|
|
54501
|
-
const [channelConfig, setChannelConfig] = (0,
|
|
54502
|
-
const [notifications, setNotifications] = (0,
|
|
54503
|
-
const [quotedMessage, setQuotedMessage] = (0,
|
|
54504
|
-
const [channelUnreadUiState, _setChannelUnreadUiState] = (0,
|
|
54505
|
-
const notificationTimeouts = (0,
|
|
54506
|
-
const
|
|
55157
|
+
const [channelConfig, setChannelConfig] = (0, import_react258.useState)(channel.getConfig());
|
|
55158
|
+
const [notifications, setNotifications] = (0, import_react258.useState)([]);
|
|
55159
|
+
const [quotedMessage, setQuotedMessage] = (0, import_react258.useState)();
|
|
55160
|
+
const [channelUnreadUiState, _setChannelUnreadUiState] = (0, import_react258.useState)();
|
|
55161
|
+
const notificationTimeouts = (0, import_react258.useRef)([]);
|
|
55162
|
+
const channelReducer = (0, import_react258.useMemo)(() => makeChannelReducer(), []);
|
|
55163
|
+
const [state, dispatch] = (0, import_react258.useReducer)(
|
|
54507
55164
|
channelReducer,
|
|
54508
55165
|
// channel.initialized === false if client.channel().query() was not called, e.g. ChannelList is not used
|
|
54509
55166
|
// => Channel will call channel.watch() in useLayoutEffect => state.loading is used to signal the watch() call state
|
|
@@ -54514,9 +55171,9 @@ var ChannelInner = (props) => {
|
|
|
54514
55171
|
}
|
|
54515
55172
|
);
|
|
54516
55173
|
const isMounted = useIsMounted();
|
|
54517
|
-
const originalTitle = (0,
|
|
54518
|
-
const lastRead = (0,
|
|
54519
|
-
const online = (0,
|
|
55174
|
+
const originalTitle = (0, import_react258.useRef)("");
|
|
55175
|
+
const lastRead = (0, import_react258.useRef)(void 0);
|
|
55176
|
+
const online = (0, import_react258.useRef)(true);
|
|
54520
55177
|
const channelCapabilitiesArray = channel.data?.own_capabilities;
|
|
54521
55178
|
const throttledCopyStateFromChannel = (0, import_lodash25.default)(
|
|
54522
55179
|
() => dispatch({ channel, type: "copyStateFromChannelOnEvent" }),
|
|
@@ -54526,14 +55183,14 @@ var ChannelInner = (props) => {
|
|
|
54526
55183
|
trailing: true
|
|
54527
55184
|
}
|
|
54528
55185
|
);
|
|
54529
|
-
const setChannelUnreadUiState = (0,
|
|
55186
|
+
const setChannelUnreadUiState = (0, import_react258.useMemo)(
|
|
54530
55187
|
() => (0, import_lodash25.default)(_setChannelUnreadUiState, 200, {
|
|
54531
55188
|
leading: true,
|
|
54532
55189
|
trailing: false
|
|
54533
55190
|
}),
|
|
54534
55191
|
[]
|
|
54535
55192
|
);
|
|
54536
|
-
const markRead = (0,
|
|
55193
|
+
const markRead = (0, import_react258.useMemo)(
|
|
54537
55194
|
() => (0, import_lodash25.default)(
|
|
54538
55195
|
async (options) => {
|
|
54539
55196
|
const { updateChannelUiUnreadState = true } = options ?? {};
|
|
@@ -54628,7 +55285,7 @@ var ChannelInner = (props) => {
|
|
|
54628
55285
|
}
|
|
54629
55286
|
throttledCopyStateFromChannel();
|
|
54630
55287
|
};
|
|
54631
|
-
(0,
|
|
55288
|
+
(0, import_react258.useLayoutEffect)(() => {
|
|
54632
55289
|
let errored = false;
|
|
54633
55290
|
let done = false;
|
|
54634
55291
|
(async () => {
|
|
@@ -54694,16 +55351,16 @@ var ChannelInner = (props) => {
|
|
|
54694
55351
|
channelConfig?.read_events,
|
|
54695
55352
|
initializeOnMount
|
|
54696
55353
|
]);
|
|
54697
|
-
(0,
|
|
55354
|
+
(0, import_react258.useEffect)(() => {
|
|
54698
55355
|
if (!state.thread) return;
|
|
54699
55356
|
const message = state.messages?.find((m) => m.id === state.thread?.id);
|
|
54700
55357
|
if (message) dispatch({ message, type: "setThread" });
|
|
54701
55358
|
}, [state.messages, state.thread]);
|
|
54702
|
-
const addNotification = (0,
|
|
55359
|
+
const addNotification = (0, import_react258.useMemo)(
|
|
54703
55360
|
() => makeAddNotifications(setNotifications, notificationTimeouts.current),
|
|
54704
55361
|
[]
|
|
54705
55362
|
);
|
|
54706
|
-
const loadMoreFinished = (0,
|
|
55363
|
+
const loadMoreFinished = (0, import_react258.useCallback)(
|
|
54707
55364
|
(0, import_lodash23.default)(
|
|
54708
55365
|
(hasMore, messages) => {
|
|
54709
55366
|
if (!isMounted.current) return;
|
|
@@ -54764,8 +55421,8 @@ var ChannelInner = (props) => {
|
|
|
54764
55421
|
});
|
|
54765
55422
|
return queryResponse.messages.length;
|
|
54766
55423
|
};
|
|
54767
|
-
const clearHighlightedMessageTimeoutId = (0,
|
|
54768
|
-
const jumpToMessage = (0,
|
|
55424
|
+
const clearHighlightedMessageTimeoutId = (0, import_react258.useRef)(null);
|
|
55425
|
+
const jumpToMessage = (0, import_react258.useCallback)(
|
|
54769
55426
|
async (messageId, messageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
|
|
54770
55427
|
dispatch({ loadingMore: true, type: "setLoadingMore" });
|
|
54771
55428
|
await channel.state.loadMessageIntoState(messageId, void 0, messageLimit);
|
|
@@ -54785,14 +55442,14 @@ var ChannelInner = (props) => {
|
|
|
54785
55442
|
},
|
|
54786
55443
|
[channel, loadMoreFinished]
|
|
54787
55444
|
);
|
|
54788
|
-
const jumpToLatestMessage = (0,
|
|
55445
|
+
const jumpToLatestMessage = (0, import_react258.useCallback)(async () => {
|
|
54789
55446
|
await channel.state.loadMessageIntoState("latest");
|
|
54790
55447
|
loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages);
|
|
54791
55448
|
dispatch({
|
|
54792
55449
|
type: "jumpToLatestMessage"
|
|
54793
55450
|
});
|
|
54794
55451
|
}, [channel, loadMoreFinished]);
|
|
54795
|
-
const jumpToFirstUnreadMessage = (0,
|
|
55452
|
+
const jumpToFirstUnreadMessage = (0, import_react258.useCallback)(
|
|
54796
55453
|
async (queryMessageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
|
|
54797
55454
|
if (!channelUnreadUiState?.unread_messages) return;
|
|
54798
55455
|
let lastReadMessageId = channelUnreadUiState?.last_read_message_id;
|
|
@@ -54897,7 +55554,7 @@ var ChannelInner = (props) => {
|
|
|
54897
55554
|
},
|
|
54898
55555
|
[addNotification, channel, loadMoreFinished, t2, channelUnreadUiState]
|
|
54899
55556
|
);
|
|
54900
|
-
const deleteMessage = (0,
|
|
55557
|
+
const deleteMessage = (0, import_react258.useCallback)(
|
|
54901
55558
|
async (message) => {
|
|
54902
55559
|
if (!message?.id) {
|
|
54903
55560
|
throw new Error("Cannot delete a message - missing message ID.");
|
|
@@ -55046,7 +55703,7 @@ var ChannelInner = (props) => {
|
|
|
55046
55703
|
event?.preventDefault();
|
|
55047
55704
|
dispatch({ type: "closeThread" });
|
|
55048
55705
|
};
|
|
55049
|
-
const loadMoreThreadFinished = (0,
|
|
55706
|
+
const loadMoreThreadFinished = (0, import_react258.useCallback)(
|
|
55050
55707
|
(0, import_lodash23.default)(
|
|
55051
55708
|
(threadHasMore, threadMessages) => {
|
|
55052
55709
|
dispatch({
|
|
@@ -55107,7 +55764,7 @@ var ChannelInner = (props) => {
|
|
|
55107
55764
|
videoAttachmentSizeHandler: props.videoAttachmentSizeHandler || getVideoAttachmentConfiguration,
|
|
55108
55765
|
watcher_count: state.watcherCount
|
|
55109
55766
|
});
|
|
55110
|
-
const channelActionContextValue = (0,
|
|
55767
|
+
const channelActionContextValue = (0, import_react258.useMemo)(
|
|
55111
55768
|
() => ({
|
|
55112
55769
|
addNotification,
|
|
55113
55770
|
closeThread,
|
|
@@ -55148,7 +55805,7 @@ var ChannelInner = (props) => {
|
|
|
55148
55805
|
setChannelUnreadUiState
|
|
55149
55806
|
]
|
|
55150
55807
|
);
|
|
55151
|
-
const componentContextValue = (0,
|
|
55808
|
+
const componentContextValue = (0, import_react258.useMemo)(
|
|
55152
55809
|
() => ({
|
|
55153
55810
|
Attachment: props.Attachment,
|
|
55154
55811
|
AttachmentPreviewList: props.AttachmentPreviewList,
|
|
@@ -55276,26 +55933,26 @@ var ChannelInner = (props) => {
|
|
|
55276
55933
|
typing
|
|
55277
55934
|
});
|
|
55278
55935
|
if (state.error) {
|
|
55279
|
-
return /* @__PURE__ */
|
|
55936
|
+
return /* @__PURE__ */ import_react258.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react258.default.createElement(LoadingErrorIndicator2, { error: state.error }));
|
|
55280
55937
|
}
|
|
55281
55938
|
if (state.loading) {
|
|
55282
|
-
return /* @__PURE__ */
|
|
55939
|
+
return /* @__PURE__ */ import_react258.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react258.default.createElement(LoadingIndicator2, null));
|
|
55283
55940
|
}
|
|
55284
55941
|
if (!channel.watch) {
|
|
55285
|
-
return /* @__PURE__ */
|
|
55942
|
+
return /* @__PURE__ */ import_react258.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react258.default.createElement("div", null, t2("Channel Missing")));
|
|
55286
55943
|
}
|
|
55287
|
-
return /* @__PURE__ */
|
|
55944
|
+
return /* @__PURE__ */ import_react258.default.createElement(ChannelContainer, { className: windowsEmojiClass }, /* @__PURE__ */ import_react258.default.createElement(ChannelStateProvider, { value: channelStateContextValue }, /* @__PURE__ */ import_react258.default.createElement(ChannelActionProvider, { value: channelActionContextValue }, /* @__PURE__ */ import_react258.default.createElement(WithComponents, { overrides: componentContextValue }, /* @__PURE__ */ import_react258.default.createElement(TypingProvider, { value: typingContextValue }, /* @__PURE__ */ import_react258.default.createElement("div", { className: `${chatContainerClass}` }, dragAndDropWindow && /* @__PURE__ */ import_react258.default.createElement(DropzoneProvider, { ...optionalMessageInputProps }, children), !dragAndDropWindow && /* @__PURE__ */ import_react258.default.createElement(import_react258.default.Fragment, null, children)))))));
|
|
55288
55945
|
};
|
|
55289
|
-
var Channel =
|
|
55946
|
+
var Channel = import_react258.default.memo(UnMemoizedChannel);
|
|
55290
55947
|
|
|
55291
55948
|
// src/components/ChannelHeader/ChannelHeader.tsx
|
|
55292
|
-
var
|
|
55949
|
+
var import_react260 = __toESM(require("react"));
|
|
55293
55950
|
|
|
55294
55951
|
// src/components/ChannelHeader/icons.tsx
|
|
55295
|
-
var
|
|
55952
|
+
var import_react259 = __toESM(require("react"));
|
|
55296
55953
|
var MenuIcon2 = ({ title }) => {
|
|
55297
55954
|
const { t: t2 } = useTranslationContext("MenuIcon");
|
|
55298
|
-
return /* @__PURE__ */
|
|
55955
|
+
return /* @__PURE__ */ import_react259.default.createElement("svg", { "data-testid": "menu-icon", viewBox: "0 0 448 512", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react259.default.createElement("title", null, title ?? t2("Menu")), /* @__PURE__ */ import_react259.default.createElement(
|
|
55299
55956
|
"path",
|
|
55300
55957
|
{
|
|
55301
55958
|
d: "M0 88C0 74.75 10.75 64 24 64H424C437.3 64 448 74.75 448 88C448 101.3 437.3 112 424 112H24C10.75 112 0 101.3 0 88zM0 248C0 234.7 10.75 224 24 224H424C437.3 224 448 234.7 448 248C448 261.3 437.3 272 424 272H24C10.75 272 0 261.3 0 248zM424 432H24C10.75 432 0 421.3 0 408C0 394.7 10.75 384 24 384H424C437.3 384 448 394.7 448 408C448 421.3 437.3 432 424 432z",
|
|
@@ -55322,15 +55979,15 @@ var ChannelHeader = (props) => {
|
|
|
55322
55979
|
overrideTitle
|
|
55323
55980
|
});
|
|
55324
55981
|
const { member_count, subtitle } = channel?.data || {};
|
|
55325
|
-
return /* @__PURE__ */
|
|
55982
|
+
return /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__channel-header" }, /* @__PURE__ */ import_react260.default.createElement(
|
|
55326
55983
|
"button",
|
|
55327
55984
|
{
|
|
55328
55985
|
"aria-label": t2("aria/Menu"),
|
|
55329
55986
|
className: "str-chat__header-hamburger",
|
|
55330
55987
|
onClick: openMobileNav
|
|
55331
55988
|
},
|
|
55332
|
-
/* @__PURE__ */
|
|
55333
|
-
), /* @__PURE__ */
|
|
55989
|
+
/* @__PURE__ */ import_react260.default.createElement(MenuIcon3, null)
|
|
55990
|
+
), /* @__PURE__ */ import_react260.default.createElement(
|
|
55334
55991
|
Avatar2,
|
|
55335
55992
|
{
|
|
55336
55993
|
className: "str-chat__avatar--channel-header",
|
|
@@ -55338,35 +55995,35 @@ var ChannelHeader = (props) => {
|
|
|
55338
55995
|
image: displayImage,
|
|
55339
55996
|
name: displayTitle
|
|
55340
55997
|
}
|
|
55341
|
-
), /* @__PURE__ */
|
|
55998
|
+
), /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__channel-header-end" }, /* @__PURE__ */ import_react260.default.createElement("p", { className: "str-chat__channel-header-title" }, displayTitle, " ", live && /* @__PURE__ */ import_react260.default.createElement("span", { className: "str-chat__header-livestream-livelabel" }, t2("live"))), subtitle && /* @__PURE__ */ import_react260.default.createElement("p", { className: "str-chat__channel-header-subtitle" }, subtitle), /* @__PURE__ */ import_react260.default.createElement("p", { className: "str-chat__channel-header-info" }, !live && !!member_count && member_count > 0 && /* @__PURE__ */ import_react260.default.createElement(import_react260.default.Fragment, null, t2("{{ memberCount }} members", {
|
|
55342
55999
|
memberCount: member_count
|
|
55343
56000
|
}), ",", " "), t2("{{ watcherCount }} online", { watcherCount: watcher_count }))));
|
|
55344
56001
|
};
|
|
55345
56002
|
|
|
55346
56003
|
// src/components/Chat/Chat.tsx
|
|
55347
|
-
var
|
|
56004
|
+
var import_react264 = __toESM(require("react"));
|
|
55348
56005
|
|
|
55349
56006
|
// src/components/Chat/hooks/useChat.ts
|
|
55350
|
-
var
|
|
56007
|
+
var import_react261 = require("react");
|
|
55351
56008
|
var useChat = ({
|
|
55352
56009
|
client,
|
|
55353
56010
|
defaultLanguage = "en",
|
|
55354
56011
|
i18nInstance,
|
|
55355
56012
|
initialNavOpen
|
|
55356
56013
|
}) => {
|
|
55357
|
-
const [translators, setTranslators] = (0,
|
|
56014
|
+
const [translators, setTranslators] = (0, import_react261.useState)({
|
|
55358
56015
|
t: (key) => key,
|
|
55359
56016
|
tDateTimeParser: defaultDateTimeParser,
|
|
55360
56017
|
userLanguage: "en"
|
|
55361
56018
|
});
|
|
55362
|
-
const [channel, setChannel] = (0,
|
|
55363
|
-
const [mutes, setMutes] = (0,
|
|
55364
|
-
const [navOpen, setNavOpen] = (0,
|
|
55365
|
-
const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = (0,
|
|
56019
|
+
const [channel, setChannel] = (0, import_react261.useState)();
|
|
56020
|
+
const [mutes, setMutes] = (0, import_react261.useState)([]);
|
|
56021
|
+
const [navOpen, setNavOpen] = (0, import_react261.useState)(initialNavOpen);
|
|
56022
|
+
const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = (0, import_react261.useState)({});
|
|
55366
56023
|
const clientMutes = client.user?.mutes || [];
|
|
55367
56024
|
const closeMobileNav = () => setNavOpen(false);
|
|
55368
56025
|
const openMobileNav = () => setTimeout(() => setNavOpen(true), 100);
|
|
55369
|
-
const appSettings = (0,
|
|
56026
|
+
const appSettings = (0, import_react261.useRef)(null);
|
|
55370
56027
|
const getAppSettings = () => {
|
|
55371
56028
|
if (appSettings.current) {
|
|
55372
56029
|
return appSettings.current;
|
|
@@ -55374,11 +56031,11 @@ var useChat = ({
|
|
|
55374
56031
|
appSettings.current = client.getAppSettings();
|
|
55375
56032
|
return appSettings.current;
|
|
55376
56033
|
};
|
|
55377
|
-
(0,
|
|
56034
|
+
(0, import_react261.useEffect)(() => {
|
|
55378
56035
|
if (!client) return;
|
|
55379
56036
|
const userAgent = client.getUserAgent();
|
|
55380
56037
|
if (!userAgent.includes("stream-chat-react")) {
|
|
55381
|
-
client.setUserAgent(`stream-chat-react-12.
|
|
56038
|
+
client.setUserAgent(`stream-chat-react-12.10.0-${userAgent}`);
|
|
55382
56039
|
}
|
|
55383
56040
|
client.threads.registerSubscriptions();
|
|
55384
56041
|
client.polls.registerSubscriptions();
|
|
@@ -55387,7 +56044,7 @@ var useChat = ({
|
|
|
55387
56044
|
client.polls.unregisterSubscriptions();
|
|
55388
56045
|
};
|
|
55389
56046
|
}, [client]);
|
|
55390
|
-
(0,
|
|
56047
|
+
(0, import_react261.useEffect)(() => {
|
|
55391
56048
|
setMutes(clientMutes);
|
|
55392
56049
|
const handleEvent = (event) => {
|
|
55393
56050
|
setMutes(event.me?.mutes || []);
|
|
@@ -55395,7 +56052,7 @@ var useChat = ({
|
|
|
55395
56052
|
client.on("notification.mutes_updated", handleEvent);
|
|
55396
56053
|
return () => client.off("notification.mutes_updated", handleEvent);
|
|
55397
56054
|
}, [clientMutes?.length]);
|
|
55398
|
-
(0,
|
|
56055
|
+
(0, import_react261.useEffect)(() => {
|
|
55399
56056
|
let userLanguage = client.user?.language;
|
|
55400
56057
|
if (!userLanguage) {
|
|
55401
56058
|
const browserLanguage = window.navigator.language.slice(0, 2);
|
|
@@ -55412,7 +56069,7 @@ var useChat = ({
|
|
|
55412
56069
|
});
|
|
55413
56070
|
});
|
|
55414
56071
|
}, [i18nInstance]);
|
|
55415
|
-
const setActiveChannel = (0,
|
|
56072
|
+
const setActiveChannel = (0, import_react261.useCallback)(
|
|
55416
56073
|
async (activeChannel, watchers = {}, event) => {
|
|
55417
56074
|
if (event && event.preventDefault) event.preventDefault();
|
|
55418
56075
|
if (activeChannel && Object.keys(watchers).length) {
|
|
@@ -55423,7 +56080,7 @@ var useChat = ({
|
|
|
55423
56080
|
},
|
|
55424
56081
|
[]
|
|
55425
56082
|
);
|
|
55426
|
-
(0,
|
|
56083
|
+
(0, import_react261.useEffect)(() => {
|
|
55427
56084
|
setLatestMessageDatesByChannels({});
|
|
55428
56085
|
}, [client.user?.id]);
|
|
55429
56086
|
return {
|
|
@@ -55440,7 +56097,7 @@ var useChat = ({
|
|
|
55440
56097
|
};
|
|
55441
56098
|
|
|
55442
56099
|
// src/components/Chat/hooks/useCreateChatContext.ts
|
|
55443
|
-
var
|
|
56100
|
+
var import_react262 = require("react");
|
|
55444
56101
|
var useCreateChatContext = (value) => {
|
|
55445
56102
|
const {
|
|
55446
56103
|
channel,
|
|
@@ -55464,7 +56121,7 @@ var useCreateChatContext = (value) => {
|
|
|
55464
56121
|
const clientValues = `${client.clientID}${Object.keys(client.activeChannels).length}${Object.keys(client.listeners).length}${client.mutedChannels.length}
|
|
55465
56122
|
${client.user?.id}`;
|
|
55466
56123
|
const mutedUsersLength = mutes.length;
|
|
55467
|
-
const chatContext = (0,
|
|
56124
|
+
const chatContext = (0, import_react262.useMemo)(
|
|
55468
56125
|
() => ({
|
|
55469
56126
|
channel,
|
|
55470
56127
|
channelsQueryState,
|
|
@@ -55497,10 +56154,10 @@ var useCreateChatContext = (value) => {
|
|
|
55497
56154
|
};
|
|
55498
56155
|
|
|
55499
56156
|
// src/components/Chat/hooks/useChannelsQueryState.ts
|
|
55500
|
-
var
|
|
56157
|
+
var import_react263 = require("react");
|
|
55501
56158
|
var useChannelsQueryState = () => {
|
|
55502
|
-
const [error, setError] = (0,
|
|
55503
|
-
const [queryInProgress, setQueryInProgress] = (0,
|
|
56159
|
+
const [error, setError] = (0, import_react263.useState)(null);
|
|
56160
|
+
const [queryInProgress, setQueryInProgress] = (0, import_react263.useState)("uninitialized");
|
|
55504
56161
|
return {
|
|
55505
56162
|
error,
|
|
55506
56163
|
queryInProgress,
|
|
@@ -55551,11 +56208,11 @@ var Chat = (props) => {
|
|
|
55551
56208
|
useImageFlagEmojisOnWindows
|
|
55552
56209
|
});
|
|
55553
56210
|
if (!translators.t) return null;
|
|
55554
|
-
return /* @__PURE__ */
|
|
56211
|
+
return /* @__PURE__ */ import_react264.default.createElement(ChatProvider, { value: chatContextValue }, /* @__PURE__ */ import_react264.default.createElement(TranslationProvider, { value: translators }, children));
|
|
55555
56212
|
};
|
|
55556
56213
|
|
|
55557
56214
|
// src/components/Chat/hooks/useCreateChatClient.ts
|
|
55558
|
-
var
|
|
56215
|
+
var import_react265 = require("react");
|
|
55559
56216
|
var import_stream_chat6 = require("stream-chat");
|
|
55560
56217
|
var useCreateChatClient = ({
|
|
55561
56218
|
apiKey,
|
|
@@ -55563,13 +56220,13 @@ var useCreateChatClient = ({
|
|
|
55563
56220
|
tokenOrProvider,
|
|
55564
56221
|
userData
|
|
55565
56222
|
}) => {
|
|
55566
|
-
const [chatClient, setChatClient] = (0,
|
|
55567
|
-
const [cachedUserData, setCachedUserData] = (0,
|
|
56223
|
+
const [chatClient, setChatClient] = (0, import_react265.useState)(null);
|
|
56224
|
+
const [cachedUserData, setCachedUserData] = (0, import_react265.useState)(userData);
|
|
55568
56225
|
if (userData.id !== cachedUserData.id) {
|
|
55569
56226
|
setCachedUserData(userData);
|
|
55570
56227
|
}
|
|
55571
|
-
const [cachedOptions] = (0,
|
|
55572
|
-
(0,
|
|
56228
|
+
const [cachedOptions] = (0, import_react265.useState)(options);
|
|
56229
|
+
(0, import_react265.useEffect)(() => {
|
|
55573
56230
|
const client = new import_stream_chat6.StreamChat(apiKey, void 0, cachedOptions);
|
|
55574
56231
|
let didUserConnectInterrupt = false;
|
|
55575
56232
|
const connectionPromise = client.connectUser(cachedUserData, tokenOrProvider).then(() => {
|
|
@@ -55587,17 +56244,17 @@ var useCreateChatClient = ({
|
|
|
55587
56244
|
};
|
|
55588
56245
|
|
|
55589
56246
|
// src/components/Thread/Thread.tsx
|
|
55590
|
-
var
|
|
56247
|
+
var import_react270 = __toESM(require("react"));
|
|
55591
56248
|
var import_clsx65 = __toESM(require("clsx"));
|
|
55592
56249
|
|
|
55593
56250
|
// src/components/Thread/ThreadHeader.tsx
|
|
55594
|
-
var
|
|
56251
|
+
var import_react267 = __toESM(require("react"));
|
|
55595
56252
|
|
|
55596
56253
|
// src/components/Thread/icons.tsx
|
|
55597
|
-
var
|
|
56254
|
+
var import_react266 = __toESM(require("react"));
|
|
55598
56255
|
var CloseIcon3 = ({ title }) => {
|
|
55599
56256
|
const { t: t2 } = useTranslationContext("CloseIcon");
|
|
55600
|
-
return /* @__PURE__ */
|
|
56257
|
+
return /* @__PURE__ */ import_react266.default.createElement(
|
|
55601
56258
|
"svg",
|
|
55602
56259
|
{
|
|
55603
56260
|
"data-testid": "close-no-outline",
|
|
@@ -55605,8 +56262,8 @@ var CloseIcon3 = ({ title }) => {
|
|
|
55605
56262
|
viewBox: "0 0 24 24",
|
|
55606
56263
|
xmlns: "http://www.w3.org/2000/svg"
|
|
55607
56264
|
},
|
|
55608
|
-
/* @__PURE__ */
|
|
55609
|
-
/* @__PURE__ */
|
|
56265
|
+
/* @__PURE__ */ import_react266.default.createElement("title", null, title ?? t2("Close")),
|
|
56266
|
+
/* @__PURE__ */ import_react266.default.createElement(
|
|
55610
56267
|
"path",
|
|
55611
56268
|
{
|
|
55612
56269
|
d: "M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",
|
|
@@ -55626,7 +56283,7 @@ var ThreadHeader = (props) => {
|
|
|
55626
56283
|
overrideImage,
|
|
55627
56284
|
overrideTitle
|
|
55628
56285
|
});
|
|
55629
|
-
return /* @__PURE__ */
|
|
56286
|
+
return /* @__PURE__ */ import_react267.default.createElement("div", { className: "str-chat__thread-header" }, /* @__PURE__ */ import_react267.default.createElement("div", { className: "str-chat__thread-header-details" }, /* @__PURE__ */ import_react267.default.createElement("div", { className: "str-chat__thread-header-title" }, t2("Thread")), /* @__PURE__ */ import_react267.default.createElement("div", { className: "str-chat__thread-header-subtitle" }, displayTitle)), /* @__PURE__ */ import_react267.default.createElement(
|
|
55630
56287
|
"button",
|
|
55631
56288
|
{
|
|
55632
56289
|
"aria-label": t2("aria/Close thread"),
|
|
@@ -55634,20 +56291,20 @@ var ThreadHeader = (props) => {
|
|
|
55634
56291
|
"data-testid": "close-button",
|
|
55635
56292
|
onClick: closeThread
|
|
55636
56293
|
},
|
|
55637
|
-
/* @__PURE__ */
|
|
56294
|
+
/* @__PURE__ */ import_react267.default.createElement(CloseIcon3, null)
|
|
55638
56295
|
));
|
|
55639
56296
|
};
|
|
55640
56297
|
|
|
55641
56298
|
// src/components/Thread/ThreadHead.tsx
|
|
55642
|
-
var
|
|
56299
|
+
var import_react269 = __toESM(require("react"));
|
|
55643
56300
|
|
|
55644
56301
|
// src/components/Thread/ThreadStart.tsx
|
|
55645
|
-
var
|
|
56302
|
+
var import_react268 = __toESM(require("react"));
|
|
55646
56303
|
var ThreadStart = () => {
|
|
55647
56304
|
const { thread } = useChannelStateContext("ThreadStart");
|
|
55648
56305
|
const { t: t2 } = useTranslationContext("ThreadStart");
|
|
55649
56306
|
if (!thread?.reply_count) return null;
|
|
55650
|
-
return /* @__PURE__ */
|
|
56307
|
+
return /* @__PURE__ */ import_react268.default.createElement("div", { className: "str-chat__thread-start" }, t2("replyCount", { count: thread.reply_count }));
|
|
55651
56308
|
};
|
|
55652
56309
|
|
|
55653
56310
|
// src/components/Thread/ThreadHead.tsx
|
|
@@ -55655,7 +56312,7 @@ var ThreadHead = (props) => {
|
|
|
55655
56312
|
const { ThreadStart: ThreadStart2 = ThreadStart } = useComponentContext(
|
|
55656
56313
|
"ThreadHead"
|
|
55657
56314
|
);
|
|
55658
|
-
return /* @__PURE__ */
|
|
56315
|
+
return /* @__PURE__ */ import_react269.default.createElement("div", { className: "str-chat__parent-message-li" }, /* @__PURE__ */ import_react269.default.createElement(Message, { initialMessage: true, threadList: true, ...props }), /* @__PURE__ */ import_react269.default.createElement(ThreadStart2, null));
|
|
55659
56316
|
};
|
|
55660
56317
|
|
|
55661
56318
|
// src/components/Thread/Thread.tsx
|
|
@@ -55665,10 +56322,10 @@ var Thread = (props) => {
|
|
|
55665
56322
|
if (!thread && !threadInstance || channelConfig?.replies === false) return null;
|
|
55666
56323
|
return (
|
|
55667
56324
|
// FIXME: TS is having trouble here as at least one of the two would always be defined
|
|
55668
|
-
/* @__PURE__ */
|
|
56325
|
+
/* @__PURE__ */ import_react270.default.createElement(ThreadInner, { ...props, key: `thread-${(thread ?? threadInstance)?.id}-${channel?.cid}` })
|
|
55669
56326
|
);
|
|
55670
56327
|
};
|
|
55671
|
-
var
|
|
56328
|
+
var selector6 = (nextValue) => ({
|
|
55672
56329
|
isLoadingNext: nextValue.pagination.isLoadingNext,
|
|
55673
56330
|
isLoadingPrev: nextValue.pagination.isLoadingPrev,
|
|
55674
56331
|
parentMessage: nextValue.parentMessage,
|
|
@@ -55688,7 +56345,7 @@ var ThreadInner = (props) => {
|
|
|
55688
56345
|
virtualized
|
|
55689
56346
|
} = props;
|
|
55690
56347
|
const threadInstance = useThreadContext();
|
|
55691
|
-
const { isLoadingNext, isLoadingPrev, parentMessage, replies } = useStateStore(threadInstance?.state,
|
|
56348
|
+
const { isLoadingNext, isLoadingPrev, parentMessage, replies } = useStateStore(threadInstance?.state, selector6) ?? {};
|
|
55692
56349
|
const {
|
|
55693
56350
|
thread,
|
|
55694
56351
|
threadHasMore,
|
|
@@ -55710,7 +56367,7 @@ var ThreadInner = (props) => {
|
|
|
55710
56367
|
const FallbackMessage = virtualized && VirtualMessage ? VirtualMessage : ContextMessage;
|
|
55711
56368
|
const MessageUIComponent = ThreadMessage || FallbackMessage;
|
|
55712
56369
|
const ThreadMessageList = virtualized ? VirtualizedMessageList : MessageList;
|
|
55713
|
-
(0,
|
|
56370
|
+
(0, import_react270.useEffect)(() => {
|
|
55714
56371
|
if (thread?.id && thread?.reply_count) {
|
|
55715
56372
|
loadMoreThread();
|
|
55716
56373
|
}
|
|
@@ -55732,7 +56389,7 @@ var ThreadInner = (props) => {
|
|
|
55732
56389
|
const threadClass = customClasses?.thread || (0, import_clsx65.default)("str-chat__thread-container str-chat__thread", {
|
|
55733
56390
|
"str-chat__thread--virtualized": virtualized
|
|
55734
56391
|
});
|
|
55735
|
-
const head = /* @__PURE__ */
|
|
56392
|
+
const head = /* @__PURE__ */ import_react270.default.createElement(
|
|
55736
56393
|
ThreadHead2,
|
|
55737
56394
|
{
|
|
55738
56395
|
key: messageAsThread.id,
|
|
@@ -55741,7 +56398,7 @@ var ThreadInner = (props) => {
|
|
|
55741
56398
|
...additionalParentMessageProps
|
|
55742
56399
|
}
|
|
55743
56400
|
);
|
|
55744
|
-
return /* @__PURE__ */
|
|
56401
|
+
return /* @__PURE__ */ import_react270.default.createElement("div", { className: threadClass }, /* @__PURE__ */ import_react270.default.createElement(ThreadHeader2, { closeThread, thread: messageAsThread }), /* @__PURE__ */ import_react270.default.createElement(
|
|
55745
56402
|
ThreadMessageList,
|
|
55746
56403
|
{
|
|
55747
56404
|
disableDateSeparator: !enableDateSeparator,
|
|
@@ -55753,7 +56410,7 @@ var ThreadInner = (props) => {
|
|
|
55753
56410
|
...threadProps,
|
|
55754
56411
|
...virtualized ? additionalVirtualizedMessageListProps : additionalMessageListProps
|
|
55755
56412
|
}
|
|
55756
|
-
), /* @__PURE__ */
|
|
56413
|
+
), /* @__PURE__ */ import_react270.default.createElement(
|
|
55757
56414
|
MessageInput,
|
|
55758
56415
|
{
|
|
55759
56416
|
focus: autoFocus,
|
|
@@ -55767,12 +56424,12 @@ var ThreadInner = (props) => {
|
|
|
55767
56424
|
};
|
|
55768
56425
|
|
|
55769
56426
|
// src/components/Window/Window.tsx
|
|
55770
|
-
var
|
|
56427
|
+
var import_react271 = __toESM(require("react"));
|
|
55771
56428
|
var import_clsx66 = __toESM(require("clsx"));
|
|
55772
56429
|
var UnMemoizedWindow = (props) => {
|
|
55773
56430
|
const { children, thread: propThread } = props;
|
|
55774
56431
|
const { thread: contextThread } = useChannelStateContext("Window");
|
|
55775
|
-
return /* @__PURE__ */
|
|
56432
|
+
return /* @__PURE__ */ import_react271.default.createElement(
|
|
55776
56433
|
"div",
|
|
55777
56434
|
{
|
|
55778
56435
|
className: (0, import_clsx66.default)("str-chat__main-panel", {
|
|
@@ -55782,7 +56439,7 @@ var UnMemoizedWindow = (props) => {
|
|
|
55782
56439
|
children
|
|
55783
56440
|
);
|
|
55784
56441
|
};
|
|
55785
|
-
var Window =
|
|
56442
|
+
var Window = import_react271.default.memo(UnMemoizedWindow);
|
|
55786
56443
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55787
56444
|
0 && (module.exports = {
|
|
55788
56445
|
ACTIONS_NOT_WORKING_IN_THREAD,
|
|
@@ -56007,6 +56664,7 @@ var Window = import_react270.default.memo(UnMemoizedWindow);
|
|
|
56007
56664
|
enTranslations,
|
|
56008
56665
|
esTranslations,
|
|
56009
56666
|
escapeRegExp,
|
|
56667
|
+
extractSortValue,
|
|
56010
56668
|
findLastPinnedChannelIndex,
|
|
56011
56669
|
frTranslations,
|
|
56012
56670
|
getChannel,
|
|
@@ -56173,5 +56831,47 @@ is-buffer/index.js:
|
|
|
56173
56831
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
56174
56832
|
* @license MIT
|
|
56175
56833
|
*)
|
|
56834
|
+
|
|
56835
|
+
react-is/cjs/react-is.production.min.js:
|
|
56836
|
+
(**
|
|
56837
|
+
* @license React
|
|
56838
|
+
* react-is.production.min.js
|
|
56839
|
+
*
|
|
56840
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56841
|
+
*
|
|
56842
|
+
* This source code is licensed under the MIT license found in the
|
|
56843
|
+
* LICENSE file in the root directory of this source tree.
|
|
56844
|
+
*)
|
|
56845
|
+
|
|
56846
|
+
react-is/cjs/react-is.development.js:
|
|
56847
|
+
(**
|
|
56848
|
+
* @license React
|
|
56849
|
+
* react-is.development.js
|
|
56850
|
+
*
|
|
56851
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56852
|
+
*
|
|
56853
|
+
* This source code is licensed under the MIT license found in the
|
|
56854
|
+
* LICENSE file in the root directory of this source tree.
|
|
56855
|
+
*)
|
|
56856
|
+
|
|
56857
|
+
react-is/cjs/react-is.production.min.js:
|
|
56858
|
+
(** @license React v16.13.1
|
|
56859
|
+
* react-is.production.min.js
|
|
56860
|
+
*
|
|
56861
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56862
|
+
*
|
|
56863
|
+
* This source code is licensed under the MIT license found in the
|
|
56864
|
+
* LICENSE file in the root directory of this source tree.
|
|
56865
|
+
*)
|
|
56866
|
+
|
|
56867
|
+
react-is/cjs/react-is.development.js:
|
|
56868
|
+
(** @license React v16.13.1
|
|
56869
|
+
* react-is.development.js
|
|
56870
|
+
*
|
|
56871
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56872
|
+
*
|
|
56873
|
+
* This source code is licensed under the MIT license found in the
|
|
56874
|
+
* LICENSE file in the root directory of this source tree.
|
|
56875
|
+
*)
|
|
56176
56876
|
*/
|
|
56177
56877
|
//# sourceMappingURL=index.node.cjs.map
|