stream-chat-react 12.9.0 → 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.js +2 -2
- package/dist/components/ChannelList/hooks/useMobileNavigation.d.ts +1 -1
- package/dist/components/ChannelList/hooks/usePaginatedChannels.js +1 -1
- 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/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 +572 -178
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +836 -197
- package/dist/index.node.cjs.map +4 -4
- package/package.json +12 -15
package/dist/index.browser.cjs
CHANGED
|
@@ -416,6 +416,200 @@ var require_extend = __commonJS({
|
|
|
416
416
|
}
|
|
417
417
|
});
|
|
418
418
|
|
|
419
|
+
// node_modules/react-markdown/node_modules/react-is/cjs/react-is.development.js
|
|
420
|
+
var require_react_is_development = __commonJS({
|
|
421
|
+
"node_modules/react-markdown/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
422
|
+
"use strict";
|
|
423
|
+
if (true) {
|
|
424
|
+
(function() {
|
|
425
|
+
"use strict";
|
|
426
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
427
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
428
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
429
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
430
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
431
|
+
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
432
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
433
|
+
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
|
434
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
435
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
436
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
437
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
438
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
439
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
440
|
+
var enableScopeAPI = false;
|
|
441
|
+
var enableCacheElement = false;
|
|
442
|
+
var enableTransitionTracing = false;
|
|
443
|
+
var enableLegacyHidden = false;
|
|
444
|
+
var enableDebugTracing = false;
|
|
445
|
+
var REACT_MODULE_REFERENCE;
|
|
446
|
+
{
|
|
447
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
448
|
+
}
|
|
449
|
+
function isValidElementType(type) {
|
|
450
|
+
if (typeof type === "string" || typeof type === "function") {
|
|
451
|
+
return true;
|
|
452
|
+
}
|
|
453
|
+
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) {
|
|
454
|
+
return true;
|
|
455
|
+
}
|
|
456
|
+
if (typeof type === "object" && type !== null) {
|
|
457
|
+
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
|
|
458
|
+
// types supported by any Flight configuration anywhere since
|
|
459
|
+
// we don't know which Flight build this will end up being used
|
|
460
|
+
// with.
|
|
461
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
462
|
+
return true;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return false;
|
|
466
|
+
}
|
|
467
|
+
function typeOf(object) {
|
|
468
|
+
if (typeof object === "object" && object !== null) {
|
|
469
|
+
var $$typeof = object.$$typeof;
|
|
470
|
+
switch ($$typeof) {
|
|
471
|
+
case REACT_ELEMENT_TYPE:
|
|
472
|
+
var type = object.type;
|
|
473
|
+
switch (type) {
|
|
474
|
+
case REACT_FRAGMENT_TYPE:
|
|
475
|
+
case REACT_PROFILER_TYPE:
|
|
476
|
+
case REACT_STRICT_MODE_TYPE:
|
|
477
|
+
case REACT_SUSPENSE_TYPE:
|
|
478
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
479
|
+
return type;
|
|
480
|
+
default:
|
|
481
|
+
var $$typeofType = type && type.$$typeof;
|
|
482
|
+
switch ($$typeofType) {
|
|
483
|
+
case REACT_SERVER_CONTEXT_TYPE:
|
|
484
|
+
case REACT_CONTEXT_TYPE:
|
|
485
|
+
case REACT_FORWARD_REF_TYPE:
|
|
486
|
+
case REACT_LAZY_TYPE:
|
|
487
|
+
case REACT_MEMO_TYPE:
|
|
488
|
+
case REACT_PROVIDER_TYPE:
|
|
489
|
+
return $$typeofType;
|
|
490
|
+
default:
|
|
491
|
+
return $$typeof;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
case REACT_PORTAL_TYPE:
|
|
495
|
+
return $$typeof;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return void 0;
|
|
499
|
+
}
|
|
500
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
501
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
502
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
503
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
504
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
|
505
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
506
|
+
var Memo = REACT_MEMO_TYPE;
|
|
507
|
+
var Portal2 = REACT_PORTAL_TYPE;
|
|
508
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
509
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
510
|
+
var Suspense2 = REACT_SUSPENSE_TYPE;
|
|
511
|
+
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
512
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
513
|
+
var hasWarnedAboutDeprecatedIsConcurrentMode = false;
|
|
514
|
+
function isAsyncMode(object) {
|
|
515
|
+
{
|
|
516
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
517
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
518
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return false;
|
|
522
|
+
}
|
|
523
|
+
function isConcurrentMode(object) {
|
|
524
|
+
{
|
|
525
|
+
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
526
|
+
hasWarnedAboutDeprecatedIsConcurrentMode = true;
|
|
527
|
+
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return false;
|
|
531
|
+
}
|
|
532
|
+
function isContextConsumer(object) {
|
|
533
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
534
|
+
}
|
|
535
|
+
function isContextProvider(object) {
|
|
536
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
537
|
+
}
|
|
538
|
+
function isElement2(object) {
|
|
539
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
540
|
+
}
|
|
541
|
+
function isForwardRef(object) {
|
|
542
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
543
|
+
}
|
|
544
|
+
function isFragment(object) {
|
|
545
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
546
|
+
}
|
|
547
|
+
function isLazy(object) {
|
|
548
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
549
|
+
}
|
|
550
|
+
function isMemo(object) {
|
|
551
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
552
|
+
}
|
|
553
|
+
function isPortal(object) {
|
|
554
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
555
|
+
}
|
|
556
|
+
function isProfiler(object) {
|
|
557
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
558
|
+
}
|
|
559
|
+
function isStrictMode(object) {
|
|
560
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
561
|
+
}
|
|
562
|
+
function isSuspense(object) {
|
|
563
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
564
|
+
}
|
|
565
|
+
function isSuspenseList(object) {
|
|
566
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
567
|
+
}
|
|
568
|
+
exports.ContextConsumer = ContextConsumer;
|
|
569
|
+
exports.ContextProvider = ContextProvider;
|
|
570
|
+
exports.Element = Element;
|
|
571
|
+
exports.ForwardRef = ForwardRef;
|
|
572
|
+
exports.Fragment = Fragment2;
|
|
573
|
+
exports.Lazy = Lazy;
|
|
574
|
+
exports.Memo = Memo;
|
|
575
|
+
exports.Portal = Portal2;
|
|
576
|
+
exports.Profiler = Profiler;
|
|
577
|
+
exports.StrictMode = StrictMode;
|
|
578
|
+
exports.Suspense = Suspense2;
|
|
579
|
+
exports.SuspenseList = SuspenseList;
|
|
580
|
+
exports.isAsyncMode = isAsyncMode;
|
|
581
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
582
|
+
exports.isContextConsumer = isContextConsumer;
|
|
583
|
+
exports.isContextProvider = isContextProvider;
|
|
584
|
+
exports.isElement = isElement2;
|
|
585
|
+
exports.isForwardRef = isForwardRef;
|
|
586
|
+
exports.isFragment = isFragment;
|
|
587
|
+
exports.isLazy = isLazy;
|
|
588
|
+
exports.isMemo = isMemo;
|
|
589
|
+
exports.isPortal = isPortal;
|
|
590
|
+
exports.isProfiler = isProfiler;
|
|
591
|
+
exports.isStrictMode = isStrictMode;
|
|
592
|
+
exports.isSuspense = isSuspense;
|
|
593
|
+
exports.isSuspenseList = isSuspenseList;
|
|
594
|
+
exports.isValidElementType = isValidElementType;
|
|
595
|
+
exports.typeOf = typeOf;
|
|
596
|
+
})();
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
// node_modules/react-markdown/node_modules/react-is/index.js
|
|
602
|
+
var require_react_is = __commonJS({
|
|
603
|
+
"node_modules/react-markdown/node_modules/react-is/index.js"(exports, module2) {
|
|
604
|
+
"use strict";
|
|
605
|
+
if (false) {
|
|
606
|
+
module2.exports = null;
|
|
607
|
+
} else {
|
|
608
|
+
module2.exports = require_react_is_development();
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
|
|
419
613
|
// node_modules/inline-style-parser/index.js
|
|
420
614
|
var require_inline_style_parser = __commonJS({
|
|
421
615
|
"node_modules/inline-style-parser/index.js"(exports, module2) {
|
|
@@ -2535,7 +2729,7 @@ var require_unified = __commonJS({
|
|
|
2535
2729
|
processor.stringify = stringify3;
|
|
2536
2730
|
processor.run = run;
|
|
2537
2731
|
processor.runSync = runSync;
|
|
2538
|
-
processor.process =
|
|
2732
|
+
processor.process = process2;
|
|
2539
2733
|
processor.processSync = processSync;
|
|
2540
2734
|
return processor;
|
|
2541
2735
|
function processor() {
|
|
@@ -2715,7 +2909,7 @@ var require_unified = __commonJS({
|
|
|
2715
2909
|
}
|
|
2716
2910
|
return Compiler(node2, file);
|
|
2717
2911
|
}
|
|
2718
|
-
function
|
|
2912
|
+
function process2(doc, cb) {
|
|
2719
2913
|
freeze();
|
|
2720
2914
|
assertParser2("process", processor.Parser);
|
|
2721
2915
|
assertCompiler2("process", processor.Compiler);
|
|
@@ -2744,7 +2938,7 @@ var require_unified = __commonJS({
|
|
|
2744
2938
|
assertParser2("processSync", processor.Parser);
|
|
2745
2939
|
assertCompiler2("processSync", processor.Compiler);
|
|
2746
2940
|
file = vfile2(doc);
|
|
2747
|
-
|
|
2941
|
+
process2(file, done);
|
|
2748
2942
|
assertDone2("processSync", "process", complete);
|
|
2749
2943
|
return file;
|
|
2750
2944
|
function done(error) {
|
|
@@ -8274,13 +8468,180 @@ var require_disallow_node = __commonJS({
|
|
|
8274
8468
|
}
|
|
8275
8469
|
});
|
|
8276
8470
|
|
|
8471
|
+
// node_modules/react-is/cjs/react-is.development.js
|
|
8472
|
+
var require_react_is_development2 = __commonJS({
|
|
8473
|
+
"node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
8474
|
+
"use strict";
|
|
8475
|
+
if (true) {
|
|
8476
|
+
(function() {
|
|
8477
|
+
"use strict";
|
|
8478
|
+
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
8479
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
8480
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
8481
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
8482
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
8483
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
8484
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
8485
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
8486
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
8487
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
8488
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
8489
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
8490
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
8491
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
8492
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
8493
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
8494
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
8495
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
8496
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
8497
|
+
function isValidElementType(type) {
|
|
8498
|
+
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
8499
|
+
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);
|
|
8500
|
+
}
|
|
8501
|
+
function typeOf(object) {
|
|
8502
|
+
if (typeof object === "object" && object !== null) {
|
|
8503
|
+
var $$typeof = object.$$typeof;
|
|
8504
|
+
switch ($$typeof) {
|
|
8505
|
+
case REACT_ELEMENT_TYPE:
|
|
8506
|
+
var type = object.type;
|
|
8507
|
+
switch (type) {
|
|
8508
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
8509
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
8510
|
+
case REACT_FRAGMENT_TYPE:
|
|
8511
|
+
case REACT_PROFILER_TYPE:
|
|
8512
|
+
case REACT_STRICT_MODE_TYPE:
|
|
8513
|
+
case REACT_SUSPENSE_TYPE:
|
|
8514
|
+
return type;
|
|
8515
|
+
default:
|
|
8516
|
+
var $$typeofType = type && type.$$typeof;
|
|
8517
|
+
switch ($$typeofType) {
|
|
8518
|
+
case REACT_CONTEXT_TYPE:
|
|
8519
|
+
case REACT_FORWARD_REF_TYPE:
|
|
8520
|
+
case REACT_LAZY_TYPE:
|
|
8521
|
+
case REACT_MEMO_TYPE:
|
|
8522
|
+
case REACT_PROVIDER_TYPE:
|
|
8523
|
+
return $$typeofType;
|
|
8524
|
+
default:
|
|
8525
|
+
return $$typeof;
|
|
8526
|
+
}
|
|
8527
|
+
}
|
|
8528
|
+
case REACT_PORTAL_TYPE:
|
|
8529
|
+
return $$typeof;
|
|
8530
|
+
}
|
|
8531
|
+
}
|
|
8532
|
+
return void 0;
|
|
8533
|
+
}
|
|
8534
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
8535
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
8536
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
8537
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
8538
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
8539
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
8540
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
|
8541
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
8542
|
+
var Memo = REACT_MEMO_TYPE;
|
|
8543
|
+
var Portal2 = REACT_PORTAL_TYPE;
|
|
8544
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
8545
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
8546
|
+
var Suspense2 = REACT_SUSPENSE_TYPE;
|
|
8547
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
8548
|
+
function isAsyncMode(object) {
|
|
8549
|
+
{
|
|
8550
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
8551
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
8552
|
+
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.");
|
|
8553
|
+
}
|
|
8554
|
+
}
|
|
8555
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
8556
|
+
}
|
|
8557
|
+
function isConcurrentMode(object) {
|
|
8558
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
8559
|
+
}
|
|
8560
|
+
function isContextConsumer(object) {
|
|
8561
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
8562
|
+
}
|
|
8563
|
+
function isContextProvider(object) {
|
|
8564
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
8565
|
+
}
|
|
8566
|
+
function isElement2(object) {
|
|
8567
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
8568
|
+
}
|
|
8569
|
+
function isForwardRef(object) {
|
|
8570
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
8571
|
+
}
|
|
8572
|
+
function isFragment(object) {
|
|
8573
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
8574
|
+
}
|
|
8575
|
+
function isLazy(object) {
|
|
8576
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
8577
|
+
}
|
|
8578
|
+
function isMemo(object) {
|
|
8579
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
8580
|
+
}
|
|
8581
|
+
function isPortal(object) {
|
|
8582
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
8583
|
+
}
|
|
8584
|
+
function isProfiler(object) {
|
|
8585
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
8586
|
+
}
|
|
8587
|
+
function isStrictMode(object) {
|
|
8588
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
8589
|
+
}
|
|
8590
|
+
function isSuspense(object) {
|
|
8591
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
8592
|
+
}
|
|
8593
|
+
exports.AsyncMode = AsyncMode;
|
|
8594
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
8595
|
+
exports.ContextConsumer = ContextConsumer;
|
|
8596
|
+
exports.ContextProvider = ContextProvider;
|
|
8597
|
+
exports.Element = Element;
|
|
8598
|
+
exports.ForwardRef = ForwardRef;
|
|
8599
|
+
exports.Fragment = Fragment2;
|
|
8600
|
+
exports.Lazy = Lazy;
|
|
8601
|
+
exports.Memo = Memo;
|
|
8602
|
+
exports.Portal = Portal2;
|
|
8603
|
+
exports.Profiler = Profiler;
|
|
8604
|
+
exports.StrictMode = StrictMode;
|
|
8605
|
+
exports.Suspense = Suspense2;
|
|
8606
|
+
exports.isAsyncMode = isAsyncMode;
|
|
8607
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
8608
|
+
exports.isContextConsumer = isContextConsumer;
|
|
8609
|
+
exports.isContextProvider = isContextProvider;
|
|
8610
|
+
exports.isElement = isElement2;
|
|
8611
|
+
exports.isForwardRef = isForwardRef;
|
|
8612
|
+
exports.isFragment = isFragment;
|
|
8613
|
+
exports.isLazy = isLazy;
|
|
8614
|
+
exports.isMemo = isMemo;
|
|
8615
|
+
exports.isPortal = isPortal;
|
|
8616
|
+
exports.isProfiler = isProfiler;
|
|
8617
|
+
exports.isStrictMode = isStrictMode;
|
|
8618
|
+
exports.isSuspense = isSuspense;
|
|
8619
|
+
exports.isValidElementType = isValidElementType;
|
|
8620
|
+
exports.typeOf = typeOf;
|
|
8621
|
+
})();
|
|
8622
|
+
}
|
|
8623
|
+
}
|
|
8624
|
+
});
|
|
8625
|
+
|
|
8626
|
+
// node_modules/react-is/index.js
|
|
8627
|
+
var require_react_is2 = __commonJS({
|
|
8628
|
+
"node_modules/react-is/index.js"(exports, module2) {
|
|
8629
|
+
"use strict";
|
|
8630
|
+
if (false) {
|
|
8631
|
+
module2.exports = null;
|
|
8632
|
+
} else {
|
|
8633
|
+
module2.exports = require_react_is_development2();
|
|
8634
|
+
}
|
|
8635
|
+
}
|
|
8636
|
+
});
|
|
8637
|
+
|
|
8277
8638
|
// node_modules/mml-react/node_modules/react-markdown/lib/ast-to-react.js
|
|
8278
8639
|
var require_ast_to_react = __commonJS({
|
|
8279
8640
|
"node_modules/mml-react/node_modules/react-markdown/lib/ast-to-react.js"(exports, module2) {
|
|
8280
8641
|
"use strict";
|
|
8281
|
-
var
|
|
8642
|
+
var React211 = require("react");
|
|
8282
8643
|
var xtend = require_immutable();
|
|
8283
|
-
var ReactIs2 =
|
|
8644
|
+
var ReactIs2 = require_react_is2();
|
|
8284
8645
|
function astToReact(node2, options) {
|
|
8285
8646
|
var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
8286
8647
|
var index3 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
|
|
@@ -8305,7 +8666,7 @@ var require_ast_to_react = __commonJS({
|
|
|
8305
8666
|
throw new Error("Renderer for type `".concat(node2.type, "` not defined or is not renderable"));
|
|
8306
8667
|
}
|
|
8307
8668
|
var nodeProps = getNodeProps(node2, key, options, renderer, parent, index3);
|
|
8308
|
-
return
|
|
8669
|
+
return React211.createElement(renderer, nodeProps, nodeProps.children || resolveChildren() || void 0);
|
|
8309
8670
|
function resolveChildren() {
|
|
8310
8671
|
return node2.children && node2.children.map(function(childNode, i) {
|
|
8311
8672
|
return astToReact(childNode, options, {
|
|
@@ -8319,7 +8680,7 @@ var require_ast_to_react = __commonJS({
|
|
|
8319
8680
|
var props = {
|
|
8320
8681
|
key
|
|
8321
8682
|
};
|
|
8322
|
-
var isSimpleRenderer = typeof renderer === "string" || renderer ===
|
|
8683
|
+
var isSimpleRenderer = typeof renderer === "string" || renderer === React211.Fragment;
|
|
8323
8684
|
if (opts.sourcePos && node2.position) {
|
|
8324
8685
|
props["data-sourcepos"] = flattenPosition2(node2.position);
|
|
8325
8686
|
}
|
|
@@ -8472,14 +8833,14 @@ var require_ast_to_react = __commonJS({
|
|
|
8472
8833
|
function mergeNodeChildren(node2, parsedChildren) {
|
|
8473
8834
|
var el = node2.element;
|
|
8474
8835
|
if (Array.isArray(el)) {
|
|
8475
|
-
var Fragment2 =
|
|
8476
|
-
return
|
|
8836
|
+
var Fragment2 = React211.Fragment || "div";
|
|
8837
|
+
return React211.createElement(Fragment2, null, el);
|
|
8477
8838
|
}
|
|
8478
8839
|
if (el.props.children || parsedChildren) {
|
|
8479
|
-
var children =
|
|
8480
|
-
return
|
|
8840
|
+
var children = React211.Children.toArray(el.props.children).concat(parsedChildren);
|
|
8841
|
+
return React211.cloneElement(el, null, children);
|
|
8481
8842
|
}
|
|
8482
|
-
return
|
|
8843
|
+
return React211.cloneElement(el, null);
|
|
8483
8844
|
}
|
|
8484
8845
|
function flattenPosition2(pos) {
|
|
8485
8846
|
return [pos.start.line, ":", pos.start.column, "-", pos.end.line, ":", pos.end.column].map(String).join("");
|
|
@@ -8603,9 +8964,9 @@ var require_renderers = __commonJS({
|
|
|
8603
8964
|
"node_modules/mml-react/node_modules/react-markdown/lib/renderers.js"(exports, module2) {
|
|
8604
8965
|
"use strict";
|
|
8605
8966
|
var xtend = require_immutable();
|
|
8606
|
-
var
|
|
8607
|
-
var supportsStringRender = parseInt((
|
|
8608
|
-
var createElement =
|
|
8967
|
+
var React211 = require("react");
|
|
8968
|
+
var supportsStringRender = parseInt((React211.version || "16").slice(0, 2), 10) >= 16;
|
|
8969
|
+
var createElement = React211.createElement;
|
|
8609
8970
|
module2.exports = {
|
|
8610
8971
|
break: "br",
|
|
8611
8972
|
paragraph: "p",
|
|
@@ -8641,7 +9002,7 @@ var require_renderers = __commonJS({
|
|
|
8641
9002
|
}
|
|
8642
9003
|
function Root(props) {
|
|
8643
9004
|
var className = props.className;
|
|
8644
|
-
var root2 = !className &&
|
|
9005
|
+
var root2 = !className && React211.Fragment || "div";
|
|
8645
9006
|
return createElement(root2, className ? {
|
|
8646
9007
|
className
|
|
8647
9008
|
} : null, props.children);
|
|
@@ -8697,7 +9058,7 @@ var require_renderers = __commonJS({
|
|
|
8697
9058
|
var dangerous = props.allowDangerousHtml || props.escapeHtml === false;
|
|
8698
9059
|
var tag = props.isBlock ? "div" : "span";
|
|
8699
9060
|
if (!dangerous) {
|
|
8700
|
-
return createElement(
|
|
9061
|
+
return createElement(React211.Fragment || tag, null, props.value);
|
|
8701
9062
|
}
|
|
8702
9063
|
var nodeProps = {
|
|
8703
9064
|
dangerouslySetInnerHTML: {
|
|
@@ -8707,7 +9068,7 @@ var require_renderers = __commonJS({
|
|
|
8707
9068
|
return createElement(tag, nodeProps);
|
|
8708
9069
|
}
|
|
8709
9070
|
function ParsedHtml(props) {
|
|
8710
|
-
return props["data-sourcepos"] ?
|
|
9071
|
+
return props["data-sourcepos"] ? React211.cloneElement(props.element, {
|
|
8711
9072
|
"data-sourcepos": props["data-sourcepos"]
|
|
8712
9073
|
}) : props.element;
|
|
8713
9074
|
}
|
|
@@ -18869,7 +19230,7 @@ var WaveProgressBar = ({
|
|
|
18869
19230
|
const isDragging = (0, import_react27.useRef)(false);
|
|
18870
19231
|
const [root2, setRoot] = (0, import_react27.useState)(null);
|
|
18871
19232
|
const [trackAxisX, setTrackAxisX] = (0, import_react27.useState)();
|
|
18872
|
-
const lastRootWidth = (0, import_react27.useRef)();
|
|
19233
|
+
const lastRootWidth = (0, import_react27.useRef)(void 0);
|
|
18873
19234
|
const handleDragStart = (e2) => {
|
|
18874
19235
|
e2.preventDefault();
|
|
18875
19236
|
if (!progressIndicator) return;
|
|
@@ -18990,7 +19351,7 @@ var useAudioController = ({
|
|
|
18990
19351
|
const [canPlayRecord, setCanPlayRecord] = (0, import_react28.useState)(true);
|
|
18991
19352
|
const [secondsElapsed, setSecondsElapsed] = (0, import_react28.useState)(0);
|
|
18992
19353
|
const [playbackRateIndex, setPlaybackRateIndex] = (0, import_react28.useState)(0);
|
|
18993
|
-
const playTimeout = (0, import_react28.useRef)();
|
|
19354
|
+
const playTimeout = (0, import_react28.useRef)(void 0);
|
|
18994
19355
|
const audioRef = (0, import_react28.useRef)(null);
|
|
18995
19356
|
const registerError = (0, import_react28.useCallback)(
|
|
18996
19357
|
(e2) => {
|
|
@@ -20378,19 +20739,22 @@ var ModalGallery = (props) => {
|
|
|
20378
20739
|
source: imageSrc
|
|
20379
20740
|
};
|
|
20380
20741
|
}),
|
|
20381
|
-
|
|
20382
|
-
[images]
|
|
20742
|
+
[images, t2]
|
|
20383
20743
|
);
|
|
20384
|
-
return
|
|
20385
|
-
|
|
20386
|
-
|
|
20387
|
-
|
|
20388
|
-
|
|
20389
|
-
|
|
20390
|
-
|
|
20391
|
-
|
|
20392
|
-
|
|
20393
|
-
|
|
20744
|
+
return (
|
|
20745
|
+
// 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)
|
|
20746
|
+
// @ts-expect-error
|
|
20747
|
+
/* @__PURE__ */ import_react39.default.createElement(
|
|
20748
|
+
import_react_image_gallery.default,
|
|
20749
|
+
{
|
|
20750
|
+
items: formattedArray,
|
|
20751
|
+
renderItem,
|
|
20752
|
+
showIndex: true,
|
|
20753
|
+
showPlayButton: false,
|
|
20754
|
+
showThumbnails: false,
|
|
20755
|
+
startIndex: index3
|
|
20756
|
+
}
|
|
20757
|
+
)
|
|
20394
20758
|
);
|
|
20395
20759
|
};
|
|
20396
20760
|
|
|
@@ -20426,7 +20790,11 @@ var UnMemoizedGallery = (props) => {
|
|
|
20426
20790
|
backgroundImage: `url(${images[lastImageIndexInPreview].previewUrl || images[lastImageIndexInPreview].image_url || images[lastImageIndexInPreview].thumb_url})`,
|
|
20427
20791
|
...image3.style
|
|
20428
20792
|
},
|
|
20429
|
-
...innerRefs?.current && {
|
|
20793
|
+
...innerRefs?.current && {
|
|
20794
|
+
ref: (r) => {
|
|
20795
|
+
innerRefs.current[i] = r;
|
|
20796
|
+
}
|
|
20797
|
+
}
|
|
20430
20798
|
},
|
|
20431
20799
|
/* @__PURE__ */ import_react40.default.createElement("p", null, t2("{{ imageCount }} more", {
|
|
20432
20800
|
imageCount: images.length - countImagesDisplayedInPreview
|
|
@@ -20446,7 +20814,11 @@ var UnMemoizedGallery = (props) => {
|
|
|
20446
20814
|
src: (0, import_sanitize_url2.sanitizeUrl)(image3.previewUrl || image3.image_url || image3.thumb_url),
|
|
20447
20815
|
style: image3.style,
|
|
20448
20816
|
title: image3?.fallback || imageFallbackTitle,
|
|
20449
|
-
...innerRefs?.current && {
|
|
20817
|
+
...innerRefs?.current && {
|
|
20818
|
+
ref: (r) => {
|
|
20819
|
+
innerRefs.current[i] = r;
|
|
20820
|
+
}
|
|
20821
|
+
}
|
|
20450
20822
|
}
|
|
20451
20823
|
)
|
|
20452
20824
|
)
|
|
@@ -22421,7 +22793,7 @@ function base() {
|
|
|
22421
22793
|
processor.stringify = stringify3;
|
|
22422
22794
|
processor.run = run;
|
|
22423
22795
|
processor.runSync = runSync;
|
|
22424
|
-
processor.process =
|
|
22796
|
+
processor.process = process2;
|
|
22425
22797
|
processor.processSync = processSync;
|
|
22426
22798
|
return processor;
|
|
22427
22799
|
function processor() {
|
|
@@ -22598,7 +22970,7 @@ function base() {
|
|
|
22598
22970
|
complete = true;
|
|
22599
22971
|
}
|
|
22600
22972
|
}
|
|
22601
|
-
function
|
|
22973
|
+
function process2(doc, callback) {
|
|
22602
22974
|
processor.freeze();
|
|
22603
22975
|
assertParser("process", processor.Parser);
|
|
22604
22976
|
assertCompiler("process", processor.Compiler);
|
|
@@ -29962,7 +30334,7 @@ function rehypeFilter(options) {
|
|
|
29962
30334
|
|
|
29963
30335
|
// node_modules/react-markdown/lib/ast-to-react.js
|
|
29964
30336
|
var import_react48 = __toESM(require("react"), 1);
|
|
29965
|
-
var import_react_is = __toESM(
|
|
30337
|
+
var import_react_is = __toESM(require_react_is(), 1);
|
|
29966
30338
|
|
|
29967
30339
|
// node_modules/hast-util-whitespace/index.js
|
|
29968
30340
|
function whitespace(thing) {
|
|
@@ -33181,11 +33553,9 @@ var import_react62 = __toESM(require("react"));
|
|
|
33181
33553
|
var import_prop_types2 = __toESM(require("prop-types"));
|
|
33182
33554
|
var import_react_textarea_autosize = __toESM(require("react-textarea-autosize"));
|
|
33183
33555
|
var import_textarea_caret = __toESM(require("textarea-caret"));
|
|
33184
|
-
var import_react_is3 = require("react-is");
|
|
33185
33556
|
var import_clsx17 = __toESM(require("clsx"));
|
|
33186
33557
|
|
|
33187
33558
|
// src/components/AutoCompleteTextarea/utils.js
|
|
33188
|
-
var import_react_is2 = require("react-is");
|
|
33189
33559
|
var DEFAULT_CARET_POSITION = "next";
|
|
33190
33560
|
function defaultScrollToItem(container, item2) {
|
|
33191
33561
|
if (!item2) return;
|
|
@@ -33212,10 +33582,7 @@ var triggerPropsCheck = ({ trigger }) => {
|
|
|
33212
33582
|
return Error("Invalid prop trigger. Keys of the object has to be string / one character.");
|
|
33213
33583
|
}
|
|
33214
33584
|
const triggerSetting = settings;
|
|
33215
|
-
const { callback,
|
|
33216
|
-
if (!(0, import_react_is2.isValidElementType)(component)) {
|
|
33217
|
-
return Error("Invalid prop trigger: component should be defined.");
|
|
33218
|
-
}
|
|
33585
|
+
const { callback, dataProvider, output } = triggerSetting;
|
|
33219
33586
|
if (!dataProvider || typeof dataProvider !== "function") {
|
|
33220
33587
|
return Error("Invalid prop trigger: dataProvider should be defined.");
|
|
33221
33588
|
}
|
|
@@ -33748,9 +34115,6 @@ See https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for m
|
|
|
33748
34115
|
if (!Array.isArray(data)) {
|
|
33749
34116
|
throw new Error("Trigger provider has to provide an array!");
|
|
33750
34117
|
}
|
|
33751
|
-
if (!(0, import_react_is3.isValidElementType)(component)) {
|
|
33752
|
-
throw new Error("Component should be defined!");
|
|
33753
|
-
}
|
|
33754
34118
|
if (currentTrigger !== this.state.currentTrigger) return;
|
|
33755
34119
|
if (!data.length) {
|
|
33756
34120
|
this._closeAutocomplete();
|
|
@@ -34135,7 +34499,7 @@ ReactTextareaAutocomplete.propTypes = {
|
|
|
34135
34499
|
};
|
|
34136
34500
|
|
|
34137
34501
|
// src/components/Channel/Channel.tsx
|
|
34138
|
-
var
|
|
34502
|
+
var import_react259 = __toESM(require("react"));
|
|
34139
34503
|
var import_lodash23 = __toESM(require("lodash.debounce"));
|
|
34140
34504
|
var import_lodash24 = __toESM(require("lodash.defaultsdeep"));
|
|
34141
34505
|
var import_lodash25 = __toESM(require("lodash.throttle"));
|
|
@@ -34143,7 +34507,7 @@ var import_nanoid11 = require("nanoid");
|
|
|
34143
34507
|
var import_clsx64 = __toESM(require("clsx"));
|
|
34144
34508
|
|
|
34145
34509
|
// src/components/Channel/channelState.ts
|
|
34146
|
-
var
|
|
34510
|
+
var makeChannelReducer = () => (state, action) => {
|
|
34147
34511
|
switch (action.type) {
|
|
34148
34512
|
case "closeThread": {
|
|
34149
34513
|
return {
|
|
@@ -38019,13 +38383,13 @@ var useMessageInputText = (props, state, dispatch, findAndEnqueueURLsToEnrich) =
|
|
|
38019
38383
|
const { channel } = useChannelStateContext("useMessageInputText");
|
|
38020
38384
|
const { additionalTextareaProps, focus, parent, publishTypingEvent = true } = props;
|
|
38021
38385
|
const { text: text6 } = state;
|
|
38022
|
-
const textareaRef = (0, import_react75.useRef)();
|
|
38386
|
+
const textareaRef = (0, import_react75.useRef)(void 0);
|
|
38023
38387
|
(0, import_react75.useEffect)(() => {
|
|
38024
38388
|
if (focus && textareaRef.current) {
|
|
38025
38389
|
textareaRef.current.focus();
|
|
38026
38390
|
}
|
|
38027
38391
|
}, [focus]);
|
|
38028
|
-
const newCursorPosition = (0, import_react75.useRef)();
|
|
38392
|
+
const newCursorPosition = (0, import_react75.useRef)(void 0);
|
|
38029
38393
|
const insertText = (0, import_react75.useCallback)(
|
|
38030
38394
|
(textToInsert) => {
|
|
38031
38395
|
const { maxLength } = additionalTextareaProps || {};
|
|
@@ -40035,7 +40399,7 @@ var usePaginatedChannels = (client, filters, sort, options, activeChannelHandler
|
|
|
40035
40399
|
} = useChatContext("usePaginatedChannels");
|
|
40036
40400
|
const [channels, setChannels] = (0, import_react90.useState)([]);
|
|
40037
40401
|
const [hasNextPage, setHasNextPage] = (0, import_react90.useState)(true);
|
|
40038
|
-
const lastRecoveryTimestamp = (0, import_react90.useRef)();
|
|
40402
|
+
const lastRecoveryTimestamp = (0, import_react90.useRef)(void 0);
|
|
40039
40403
|
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;
|
|
40040
40404
|
const filterString = (0, import_react90.useMemo)(() => JSON.stringify(filters), [filters]);
|
|
40041
40405
|
const sortString = (0, import_react90.useMemo)(() => JSON.stringify(sort), [sort]);
|
|
@@ -40137,7 +40501,7 @@ var useChannelSearch = ({
|
|
|
40137
40501
|
const [query, setQuery] = (0, import_react91.useState)("");
|
|
40138
40502
|
const [results, setResults] = (0, import_react91.useState)([]);
|
|
40139
40503
|
const [searching, setSearching] = (0, import_react91.useState)(false);
|
|
40140
|
-
const searchQueryPromiseInProgress = (0, import_react91.useRef)();
|
|
40504
|
+
const searchQueryPromiseInProgress = (0, import_react91.useRef)(void 0);
|
|
40141
40505
|
const shouldIgnoreQueryResults = (0, import_react91.useRef)(false);
|
|
40142
40506
|
const inputRef = (0, import_react91.useRef)(null);
|
|
40143
40507
|
const searchBarRef = (0, import_react91.useRef)(null);
|
|
@@ -41164,8 +41528,8 @@ var usePrepareShapeHandlers = ({
|
|
|
41164
41528
|
sort
|
|
41165
41529
|
}) => {
|
|
41166
41530
|
const defaults = useChannelListShapeDefaults();
|
|
41167
|
-
const defaultHandleChannelListShapeRef = (0, import_react101.useRef)();
|
|
41168
|
-
const customHandleChannelListShapeRef = (0, import_react101.useRef)();
|
|
41531
|
+
const defaultHandleChannelListShapeRef = (0, import_react101.useRef)(void 0);
|
|
41532
|
+
const customHandleChannelListShapeRef = (0, import_react101.useRef)(void 0);
|
|
41169
41533
|
customHandleChannelListShapeRef.current = (event) => {
|
|
41170
41534
|
customHandleChannelListShape?.({ defaults, event, setChannels });
|
|
41171
41535
|
};
|
|
@@ -45802,7 +46166,7 @@ var import_react194 = __toESM(require("react"));
|
|
|
45802
46166
|
var import_react193 = require("react");
|
|
45803
46167
|
var useTimeElapsed = ({ startOnMount } = {}) => {
|
|
45804
46168
|
const [secondsElapsed, setSecondsElapsed] = (0, import_react193.useState)(0);
|
|
45805
|
-
const updateInterval = (0, import_react193.useRef)();
|
|
46169
|
+
const updateInterval = (0, import_react193.useRef)(void 0);
|
|
45806
46170
|
const startCounter = (0, import_react193.useCallback)(() => {
|
|
45807
46171
|
if (updateInterval.current) return;
|
|
45808
46172
|
updateInterval.current = setInterval(() => {
|
|
@@ -48027,7 +48391,7 @@ function useMessageListScrollManager(params) {
|
|
|
48027
48391
|
offsetHeight: 0,
|
|
48028
48392
|
scrollHeight: 0
|
|
48029
48393
|
});
|
|
48030
|
-
const messages = (0, import_react231.useRef)();
|
|
48394
|
+
const messages = (0, import_react231.useRef)(void 0);
|
|
48031
48395
|
const scrollTop = (0, import_react231.useRef)(0);
|
|
48032
48396
|
(0, import_react231.useLayoutEffect)(() => {
|
|
48033
48397
|
const prevMeasures = measures.current;
|
|
@@ -48235,25 +48599,26 @@ var useUnreadMessagesNotification = ({
|
|
|
48235
48599
|
|
|
48236
48600
|
// src/components/MessageList/hooks/useMarkRead.ts
|
|
48237
48601
|
var import_react236 = require("react");
|
|
48602
|
+
var hasReadLastMessage = (channel, userId) => {
|
|
48603
|
+
const latestMessageIdInChannel = channel.state.latestMessages.slice(-1)[0]?.id;
|
|
48604
|
+
const lastReadMessageIdServer = channel.state.read[userId]?.last_read_message_id;
|
|
48605
|
+
return latestMessageIdInChannel === lastReadMessageIdServer;
|
|
48606
|
+
};
|
|
48238
48607
|
var useMarkRead = ({
|
|
48239
48608
|
isMessageListScrolledToBottom,
|
|
48240
48609
|
messageListIsThread,
|
|
48241
|
-
unreadCount,
|
|
48242
48610
|
wasMarkedUnread
|
|
48243
48611
|
}) => {
|
|
48244
48612
|
const { client } = useChatContext("useMarkRead");
|
|
48245
48613
|
const { markRead, setChannelUnreadUiState } = useChannelActionContext("useMarkRead");
|
|
48246
48614
|
const { channel } = useChannelStateContext("useMarkRead");
|
|
48247
|
-
const previousRenderMessageListScrolledToBottom = (0, import_react236.useRef)(isMessageListScrolledToBottom);
|
|
48248
48615
|
(0, import_react236.useEffect)(() => {
|
|
48249
|
-
const shouldMarkRead = (
|
|
48616
|
+
const shouldMarkRead = () => !document.hidden && !wasMarkedUnread && !messageListIsThread && isMessageListScrolledToBottom && client.user?.id && !hasReadLastMessage(channel, client.user.id);
|
|
48250
48617
|
const onVisibilityChange = () => {
|
|
48251
|
-
if (shouldMarkRead(
|
|
48618
|
+
if (shouldMarkRead()) markRead();
|
|
48252
48619
|
};
|
|
48253
48620
|
const handleMessageNew = (event) => {
|
|
48254
|
-
const isOwnMessage = event.user?.id && event.user.id === client.user?.id;
|
|
48255
48621
|
const mainChannelUpdated = !event.message?.parent_id || event.message?.show_in_channel;
|
|
48256
|
-
if (isOwnMessage) return;
|
|
48257
48622
|
if (!isMessageListScrolledToBottom || wasMarkedUnread || document.hidden) {
|
|
48258
48623
|
setChannelUnreadUiState((prev) => {
|
|
48259
48624
|
const previousUnreadCount = prev?.unread_messages ?? 0;
|
|
@@ -48268,15 +48633,15 @@ var useMarkRead = ({
|
|
|
48268
48633
|
unread_messages: previousUnreadCount + 1
|
|
48269
48634
|
};
|
|
48270
48635
|
});
|
|
48271
|
-
} else if (mainChannelUpdated && shouldMarkRead(
|
|
48636
|
+
} else if (mainChannelUpdated && shouldMarkRead()) {
|
|
48272
48637
|
markRead();
|
|
48273
48638
|
}
|
|
48274
48639
|
};
|
|
48275
48640
|
channel.on("message.new", handleMessageNew);
|
|
48276
48641
|
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
48277
|
-
|
|
48278
|
-
|
|
48279
|
-
|
|
48642
|
+
if (shouldMarkRead()) {
|
|
48643
|
+
markRead();
|
|
48644
|
+
}
|
|
48280
48645
|
return () => {
|
|
48281
48646
|
channel.off("message.new", handleMessageNew);
|
|
48282
48647
|
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
@@ -48288,7 +48653,6 @@ var useMarkRead = ({
|
|
|
48288
48653
|
markRead,
|
|
48289
48654
|
messageListIsThread,
|
|
48290
48655
|
setChannelUnreadUiState,
|
|
48291
|
-
unreadCount,
|
|
48292
48656
|
wasMarkedUnread
|
|
48293
48657
|
]);
|
|
48294
48658
|
};
|
|
@@ -48432,10 +48796,10 @@ var InfiniteScroll = (props) => {
|
|
|
48432
48796
|
const loadPreviousPageFn = loadPreviousPage || loadMore;
|
|
48433
48797
|
const hasNextPageFlag = hasNextPage || hasMoreNewer;
|
|
48434
48798
|
const hasPreviousPageFlag = hasPreviousPage || hasMore;
|
|
48435
|
-
const scrollComponent = (0, import_react241.useRef)();
|
|
48436
|
-
const previousOffset = (0, import_react241.useRef)();
|
|
48437
|
-
const previousReverseOffset = (0, import_react241.useRef)();
|
|
48438
|
-
const scrollListenerRef = (0, import_react241.useRef)();
|
|
48799
|
+
const scrollComponent = (0, import_react241.useRef)(void 0);
|
|
48800
|
+
const previousOffset = (0, import_react241.useRef)(void 0);
|
|
48801
|
+
const previousReverseOffset = (0, import_react241.useRef)(void 0);
|
|
48802
|
+
const scrollListenerRef = (0, import_react241.useRef)(void 0);
|
|
48439
48803
|
scrollListenerRef.current = () => {
|
|
48440
48804
|
const element4 = scrollComponent.current;
|
|
48441
48805
|
if (!element4 || element4.offsetParent === null) {
|
|
@@ -48841,7 +49205,6 @@ var MessageListWithContext = (props) => {
|
|
|
48841
49205
|
useMarkRead({
|
|
48842
49206
|
isMessageListScrolledToBottom,
|
|
48843
49207
|
messageListIsThread: threadList,
|
|
48844
|
-
unreadCount: channelUnreadUiState?.unread_messages ?? 0,
|
|
48845
49208
|
wasMarkedUnread: !!channelUnreadUiState?.first_unread_message_id
|
|
48846
49209
|
});
|
|
48847
49210
|
const { messageGroupStyles, messages: enrichedMessages } = useEnrichedMessages({
|
|
@@ -49059,7 +49422,7 @@ var ScrollToBottomButton = import_react248.default.memo(
|
|
|
49059
49422
|
);
|
|
49060
49423
|
|
|
49061
49424
|
// src/components/MessageList/VirtualizedMessageList.tsx
|
|
49062
|
-
var
|
|
49425
|
+
var import_react258 = __toESM(require("react"));
|
|
49063
49426
|
var import_react_virtuoso3 = require("react-virtuoso");
|
|
49064
49427
|
|
|
49065
49428
|
// src/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.ts
|
|
@@ -49103,8 +49466,10 @@ var STATUSES_EXCLUDED_FROM_PREPEND = {
|
|
|
49103
49466
|
};
|
|
49104
49467
|
function usePrependedMessagesCount(messages, hasDateSeparator) {
|
|
49105
49468
|
const firstRealMessageIndex = hasDateSeparator ? 1 : 0;
|
|
49106
|
-
const firstMessageOnFirstLoadedPage = (0, import_react250.useRef)();
|
|
49107
|
-
const previousFirstMessageOnFirstLoadedPage = (0, import_react250.useRef)(
|
|
49469
|
+
const firstMessageOnFirstLoadedPage = (0, import_react250.useRef)(void 0);
|
|
49470
|
+
const previousFirstMessageOnFirstLoadedPage = (0, import_react250.useRef)(
|
|
49471
|
+
void 0
|
|
49472
|
+
);
|
|
49108
49473
|
const previousNumItemsPrepended = (0, import_react250.useRef)(0);
|
|
49109
49474
|
const numItemsPrepended = (0, import_react250.useMemo)(() => {
|
|
49110
49475
|
if (!messages || !messages.length) {
|
|
@@ -49186,7 +49551,7 @@ var useMessageSetKey = ({
|
|
|
49186
49551
|
messages
|
|
49187
49552
|
}) => {
|
|
49188
49553
|
const [messageSetKey, setMessageSetKey] = (0, import_react253.useState)(+/* @__PURE__ */ new Date());
|
|
49189
|
-
const firstMessageId = (0, import_react253.useRef)();
|
|
49554
|
+
const firstMessageId = (0, import_react253.useRef)(void 0);
|
|
49190
49555
|
(0, import_react253.useEffect)(() => {
|
|
49191
49556
|
const continuousSet = messages?.find((message) => message.id === firstMessageId.current);
|
|
49192
49557
|
if (!continuousSet) {
|
|
@@ -49207,7 +49572,7 @@ var useScrollToBottomOnNewMessage = ({
|
|
|
49207
49572
|
scrollToLatestMessageOnFocus
|
|
49208
49573
|
}) => {
|
|
49209
49574
|
const [newMessagesReceivedInBackground, setNewMessagesReceivedInBackground] = (0, import_react254.useState)(false);
|
|
49210
|
-
const scrollToBottomIfConfigured = (0, import_react254.useRef)();
|
|
49575
|
+
const scrollToBottomIfConfigured = (0, import_react254.useRef)(void 0);
|
|
49211
49576
|
scrollToBottomIfConfigured.current = (event) => {
|
|
49212
49577
|
if (!scrollToLatestMessageOnFocus || !newMessagesReceivedInBackground || event.target !== window) {
|
|
49213
49578
|
return;
|
|
@@ -49397,6 +49762,14 @@ var messageRenderer = (virtuosoIndex, _data, virtuosoContext) => {
|
|
|
49397
49762
|
));
|
|
49398
49763
|
};
|
|
49399
49764
|
|
|
49765
|
+
// src/context/VirtualizedMessageListContext.tsx
|
|
49766
|
+
var import_react257 = __toESM(require("react"));
|
|
49767
|
+
var VirtualizedMessageListContext = (0, import_react257.createContext)(void 0);
|
|
49768
|
+
var VirtualizedMessageListContextProvider = ({
|
|
49769
|
+
children,
|
|
49770
|
+
value
|
|
49771
|
+
}) => /* @__PURE__ */ import_react257.default.createElement(VirtualizedMessageListContext.Provider, { value }, children);
|
|
49772
|
+
|
|
49400
49773
|
// src/components/MessageList/VirtualizedMessageList.tsx
|
|
49401
49774
|
function captureResizeObserverExceededError(e2) {
|
|
49402
49775
|
if (e2.message === "ResizeObserver loop completed with undelivered notifications." || e2.message === "ResizeObserver loop limit exceeded") {
|
|
@@ -49404,7 +49777,7 @@ function captureResizeObserverExceededError(e2) {
|
|
|
49404
49777
|
}
|
|
49405
49778
|
}
|
|
49406
49779
|
function useCaptureResizeObserverExceededError() {
|
|
49407
|
-
(0,
|
|
49780
|
+
(0, import_react258.useEffect)(() => {
|
|
49408
49781
|
window.addEventListener("error", captureResizeObserverExceededError);
|
|
49409
49782
|
return () => {
|
|
49410
49783
|
window.removeEventListener("error", captureResizeObserverExceededError);
|
|
@@ -49491,8 +49864,8 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49491
49864
|
} = useComponentContext("VirtualizedMessageList");
|
|
49492
49865
|
const MessageUIComponent = MessageUIComponentFromProps || MessageUIComponentFromContext;
|
|
49493
49866
|
const { client, customClasses } = useChatContext("VirtualizedMessageList");
|
|
49494
|
-
const virtuoso = (0,
|
|
49495
|
-
const lastRead = (0,
|
|
49867
|
+
const virtuoso = (0, import_react258.useRef)(null);
|
|
49868
|
+
const lastRead = (0, import_react258.useMemo)(() => channel.lastRead?.(), [channel]);
|
|
49496
49869
|
const {
|
|
49497
49870
|
show: showUnreadMessagesNotification,
|
|
49498
49871
|
toggleShowUnreadMessagesNotification
|
|
@@ -49504,7 +49877,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49504
49877
|
const { giphyPreviewMessage, setGiphyPreviewMessage } = useGiphyPreview(
|
|
49505
49878
|
separateGiphyPreview
|
|
49506
49879
|
);
|
|
49507
|
-
const processedMessages = (0,
|
|
49880
|
+
const processedMessages = (0, import_react258.useMemo)(() => {
|
|
49508
49881
|
if (typeof messages === "undefined") {
|
|
49509
49882
|
return [];
|
|
49510
49883
|
}
|
|
@@ -49536,11 +49909,11 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49536
49909
|
returnAllReadData,
|
|
49537
49910
|
userID: client.userID
|
|
49538
49911
|
});
|
|
49539
|
-
const lastReceivedMessageId = (0,
|
|
49912
|
+
const lastReceivedMessageId = (0, import_react258.useMemo)(() => getLastReceived(processedMessages), [
|
|
49540
49913
|
processedMessages
|
|
49541
49914
|
]);
|
|
49542
49915
|
const groupStylesFn = groupStyles || getGroupStyles;
|
|
49543
|
-
const messageGroupStyles = (0,
|
|
49916
|
+
const messageGroupStyles = (0, import_react258.useMemo)(
|
|
49544
49917
|
() => processedMessages.reduce((acc, message, i) => {
|
|
49545
49918
|
const style = groupStylesFn(
|
|
49546
49919
|
message,
|
|
@@ -49566,10 +49939,9 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49566
49939
|
useMarkRead({
|
|
49567
49940
|
isMessageListScrolledToBottom,
|
|
49568
49941
|
messageListIsThread: !!threadList,
|
|
49569
|
-
unreadCount: channelUnreadUiState?.unread_messages ?? 0,
|
|
49570
49942
|
wasMarkedUnread: !!channelUnreadUiState?.first_unread_message_id
|
|
49571
49943
|
});
|
|
49572
|
-
const scrollToBottom = (0,
|
|
49944
|
+
const scrollToBottom = (0, import_react258.useCallback)(async () => {
|
|
49573
49945
|
if (hasMoreNewer) {
|
|
49574
49946
|
await jumpToLatestMessage();
|
|
49575
49947
|
return;
|
|
@@ -49591,7 +49963,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49591
49963
|
const numItemsPrepended = usePrependedMessagesCount(processedMessages, !disableDateSeparator);
|
|
49592
49964
|
const { messageSetKey } = useMessageSetKey({ messages });
|
|
49593
49965
|
const shouldForceScrollToBottom = useShouldForceScrollToBottom(processedMessages, client.userID);
|
|
49594
|
-
const handleItemsRendered = (0,
|
|
49966
|
+
const handleItemsRendered = (0, import_react258.useMemo)(
|
|
49595
49967
|
() => makeItemsRenderedHandler([toggleShowUnreadMessagesNotification], processedMessages),
|
|
49596
49968
|
[processedMessages, toggleShowUnreadMessagesNotification]
|
|
49597
49969
|
);
|
|
@@ -49604,7 +49976,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49604
49976
|
}
|
|
49605
49977
|
return isAtBottom ? stickToBottomScrollBehavior : false;
|
|
49606
49978
|
};
|
|
49607
|
-
const computeItemKey2 = (0,
|
|
49979
|
+
const computeItemKey2 = (0, import_react258.useCallback)(
|
|
49608
49980
|
(index3, _, { numItemsPrepended: numItemsPrepended2, processedMessages: processedMessages2 }) => processedMessages2[calculateItemIndex(index3, numItemsPrepended2)].id,
|
|
49609
49981
|
[]
|
|
49610
49982
|
);
|
|
@@ -49621,7 +49993,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49621
49993
|
loadMore?.(messageLimit);
|
|
49622
49994
|
}
|
|
49623
49995
|
};
|
|
49624
|
-
(0,
|
|
49996
|
+
(0, import_react258.useEffect)(() => {
|
|
49625
49997
|
let scrollTimeout;
|
|
49626
49998
|
if (highlightedMessageId) {
|
|
49627
49999
|
const index3 = findMessageIndex(processedMessages, highlightedMessageId);
|
|
@@ -49637,7 +50009,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49637
50009
|
}, [highlightedMessageId, processedMessages]);
|
|
49638
50010
|
if (!processedMessages) return null;
|
|
49639
50011
|
const dialogManagerId = threadList ? "virtualized-message-list-dialog-manager-thread" : "virtualized-message-list-dialog-manager";
|
|
49640
|
-
return /* @__PURE__ */
|
|
50012
|
+
return /* @__PURE__ */ import_react258.default.createElement(VirtualizedMessageListContextProvider, { value: { scrollToBottom } }, /* @__PURE__ */ import_react258.default.createElement(MessageListMainPanel2, null, /* @__PURE__ */ import_react258.default.createElement(DialogManagerProvider, { id: dialogManagerId }, !threadList && showUnreadMessagesNotification && /* @__PURE__ */ import_react258.default.createElement(UnreadMessagesNotification2, { unreadCount: channelUnreadUiState?.unread_messages }), /* @__PURE__ */ import_react258.default.createElement("div", { className: customClasses?.virtualizedMessageList || "str-chat__virtual-list" }, /* @__PURE__ */ import_react258.default.createElement(
|
|
49641
50013
|
import_react_virtuoso3.Virtuoso,
|
|
49642
50014
|
{
|
|
49643
50015
|
atBottomStateChange,
|
|
@@ -49702,7 +50074,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49702
50074
|
...scrollSeekPlaceHolder ? { scrollSeek: scrollSeekPlaceHolder } : {},
|
|
49703
50075
|
...defaultItemHeight ? { defaultItemHeight } : {}
|
|
49704
50076
|
}
|
|
49705
|
-
))), TypingIndicator2 && /* @__PURE__ */
|
|
50077
|
+
))), TypingIndicator2 && /* @__PURE__ */ import_react258.default.createElement(TypingIndicator2, null)), /* @__PURE__ */ import_react258.default.createElement(
|
|
49706
50078
|
MessageListNotifications2,
|
|
49707
50079
|
{
|
|
49708
50080
|
hasNewMessages: newMessagesNotification,
|
|
@@ -49714,7 +50086,7 @@ var VirtualizedMessageListWithContext = (props) => {
|
|
|
49714
50086
|
threadList,
|
|
49715
50087
|
unreadCount: threadList ? void 0 : channelUnreadUiState?.unread_messages
|
|
49716
50088
|
}
|
|
49717
|
-
), giphyPreviewMessage && /* @__PURE__ */
|
|
50089
|
+
), giphyPreviewMessage && /* @__PURE__ */ import_react258.default.createElement(GiphyPreviewMessage2, { message: giphyPreviewMessage }));
|
|
49718
50090
|
};
|
|
49719
50091
|
function VirtualizedMessageList(props) {
|
|
49720
50092
|
const {
|
|
@@ -49736,7 +50108,7 @@ function VirtualizedMessageList(props) {
|
|
|
49736
50108
|
suppressAutoscroll
|
|
49737
50109
|
} = useChannelStateContext("VirtualizedMessageList");
|
|
49738
50110
|
const messages = props.messages || contextMessages;
|
|
49739
|
-
return /* @__PURE__ */
|
|
50111
|
+
return /* @__PURE__ */ import_react258.default.createElement(
|
|
49740
50112
|
VirtualizedMessageListWithContext,
|
|
49741
50113
|
{
|
|
49742
50114
|
channel,
|
|
@@ -49927,7 +50299,7 @@ var ChannelContainer = ({
|
|
|
49927
50299
|
customClasses
|
|
49928
50300
|
});
|
|
49929
50301
|
const className = (0, import_clsx64.default)(chatClass, theme, channelClass, additionalClassName);
|
|
49930
|
-
return /* @__PURE__ */
|
|
50302
|
+
return /* @__PURE__ */ import_react259.default.createElement("div", { id: CHANNEL_CONTAINER_ID, ...props, className }, children);
|
|
49931
50303
|
};
|
|
49932
50304
|
var UnMemoizedChannel = (props) => {
|
|
49933
50305
|
const {
|
|
@@ -49941,15 +50313,15 @@ var UnMemoizedChannel = (props) => {
|
|
|
49941
50313
|
);
|
|
49942
50314
|
const channel = propsChannel || contextChannel;
|
|
49943
50315
|
if (channelsQueryState.queryInProgress === "reload" && LoadingIndicator2) {
|
|
49944
|
-
return /* @__PURE__ */
|
|
50316
|
+
return /* @__PURE__ */ import_react259.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react259.default.createElement(LoadingIndicator2, null));
|
|
49945
50317
|
}
|
|
49946
50318
|
if (channelsQueryState.error && LoadingErrorIndicator2) {
|
|
49947
|
-
return /* @__PURE__ */
|
|
50319
|
+
return /* @__PURE__ */ import_react259.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react259.default.createElement(LoadingErrorIndicator2, { error: channelsQueryState.error }));
|
|
49948
50320
|
}
|
|
49949
50321
|
if (!channel?.cid) {
|
|
49950
|
-
return /* @__PURE__ */
|
|
50322
|
+
return /* @__PURE__ */ import_react259.default.createElement(ChannelContainer, null, EmptyPlaceholder2);
|
|
49951
50323
|
}
|
|
49952
|
-
return /* @__PURE__ */
|
|
50324
|
+
return /* @__PURE__ */ import_react259.default.createElement(ChannelInner, { ...props, channel, key: channel.cid });
|
|
49953
50325
|
};
|
|
49954
50326
|
var ChannelInner = (props) => {
|
|
49955
50327
|
const {
|
|
@@ -49975,7 +50347,7 @@ var ChannelInner = (props) => {
|
|
|
49975
50347
|
optionalMessageInputProps = {},
|
|
49976
50348
|
skipMessageDataMemoization
|
|
49977
50349
|
} = props;
|
|
49978
|
-
const channelQueryOptions = (0,
|
|
50350
|
+
const channelQueryOptions = (0, import_react259.useMemo)(
|
|
49979
50351
|
() => (0, import_lodash24.default)(propChannelQueryOptions, {
|
|
49980
50352
|
messages: { limit: DEFAULT_INITIAL_CHANNEL_PAGE_SIZE }
|
|
49981
50353
|
}),
|
|
@@ -49991,12 +50363,13 @@ var ChannelInner = (props) => {
|
|
|
49991
50363
|
const chatContainerClass = getChatContainerClass(customClasses?.chatContainer);
|
|
49992
50364
|
const windowsEmojiClass = useImageFlagEmojisOnWindowsClass();
|
|
49993
50365
|
const thread = useThreadContext();
|
|
49994
|
-
const [channelConfig, setChannelConfig] = (0,
|
|
49995
|
-
const [notifications, setNotifications] = (0,
|
|
49996
|
-
const [quotedMessage, setQuotedMessage] = (0,
|
|
49997
|
-
const [channelUnreadUiState, _setChannelUnreadUiState] = (0,
|
|
49998
|
-
const notificationTimeouts = (0,
|
|
49999
|
-
const
|
|
50366
|
+
const [channelConfig, setChannelConfig] = (0, import_react259.useState)(channel.getConfig());
|
|
50367
|
+
const [notifications, setNotifications] = (0, import_react259.useState)([]);
|
|
50368
|
+
const [quotedMessage, setQuotedMessage] = (0, import_react259.useState)();
|
|
50369
|
+
const [channelUnreadUiState, _setChannelUnreadUiState] = (0, import_react259.useState)();
|
|
50370
|
+
const notificationTimeouts = (0, import_react259.useRef)([]);
|
|
50371
|
+
const channelReducer = (0, import_react259.useMemo)(() => makeChannelReducer(), []);
|
|
50372
|
+
const [state, dispatch] = (0, import_react259.useReducer)(
|
|
50000
50373
|
channelReducer,
|
|
50001
50374
|
// channel.initialized === false if client.channel().query() was not called, e.g. ChannelList is not used
|
|
50002
50375
|
// => Channel will call channel.watch() in useLayoutEffect => state.loading is used to signal the watch() call state
|
|
@@ -50007,9 +50380,9 @@ var ChannelInner = (props) => {
|
|
|
50007
50380
|
}
|
|
50008
50381
|
);
|
|
50009
50382
|
const isMounted = useIsMounted();
|
|
50010
|
-
const originalTitle = (0,
|
|
50011
|
-
const lastRead = (0,
|
|
50012
|
-
const online = (0,
|
|
50383
|
+
const originalTitle = (0, import_react259.useRef)("");
|
|
50384
|
+
const lastRead = (0, import_react259.useRef)(void 0);
|
|
50385
|
+
const online = (0, import_react259.useRef)(true);
|
|
50013
50386
|
const channelCapabilitiesArray = channel.data?.own_capabilities;
|
|
50014
50387
|
const throttledCopyStateFromChannel = (0, import_lodash25.default)(
|
|
50015
50388
|
() => dispatch({ channel, type: "copyStateFromChannelOnEvent" }),
|
|
@@ -50019,14 +50392,14 @@ var ChannelInner = (props) => {
|
|
|
50019
50392
|
trailing: true
|
|
50020
50393
|
}
|
|
50021
50394
|
);
|
|
50022
|
-
const setChannelUnreadUiState = (0,
|
|
50395
|
+
const setChannelUnreadUiState = (0, import_react259.useMemo)(
|
|
50023
50396
|
() => (0, import_lodash25.default)(_setChannelUnreadUiState, 200, {
|
|
50024
50397
|
leading: true,
|
|
50025
50398
|
trailing: false
|
|
50026
50399
|
}),
|
|
50027
50400
|
[]
|
|
50028
50401
|
);
|
|
50029
|
-
const markRead = (0,
|
|
50402
|
+
const markRead = (0, import_react259.useMemo)(
|
|
50030
50403
|
() => (0, import_lodash25.default)(
|
|
50031
50404
|
async (options) => {
|
|
50032
50405
|
const { updateChannelUiUnreadState = true } = options ?? {};
|
|
@@ -50121,7 +50494,7 @@ var ChannelInner = (props) => {
|
|
|
50121
50494
|
}
|
|
50122
50495
|
throttledCopyStateFromChannel();
|
|
50123
50496
|
};
|
|
50124
|
-
(0,
|
|
50497
|
+
(0, import_react259.useLayoutEffect)(() => {
|
|
50125
50498
|
let errored = false;
|
|
50126
50499
|
let done = false;
|
|
50127
50500
|
(async () => {
|
|
@@ -50187,16 +50560,16 @@ var ChannelInner = (props) => {
|
|
|
50187
50560
|
channelConfig?.read_events,
|
|
50188
50561
|
initializeOnMount
|
|
50189
50562
|
]);
|
|
50190
|
-
(0,
|
|
50563
|
+
(0, import_react259.useEffect)(() => {
|
|
50191
50564
|
if (!state.thread) return;
|
|
50192
50565
|
const message = state.messages?.find((m) => m.id === state.thread?.id);
|
|
50193
50566
|
if (message) dispatch({ message, type: "setThread" });
|
|
50194
50567
|
}, [state.messages, state.thread]);
|
|
50195
|
-
const addNotification = (0,
|
|
50568
|
+
const addNotification = (0, import_react259.useMemo)(
|
|
50196
50569
|
() => makeAddNotifications(setNotifications, notificationTimeouts.current),
|
|
50197
50570
|
[]
|
|
50198
50571
|
);
|
|
50199
|
-
const loadMoreFinished = (0,
|
|
50572
|
+
const loadMoreFinished = (0, import_react259.useCallback)(
|
|
50200
50573
|
(0, import_lodash23.default)(
|
|
50201
50574
|
(hasMore, messages) => {
|
|
50202
50575
|
if (!isMounted.current) return;
|
|
@@ -50257,8 +50630,8 @@ var ChannelInner = (props) => {
|
|
|
50257
50630
|
});
|
|
50258
50631
|
return queryResponse.messages.length;
|
|
50259
50632
|
};
|
|
50260
|
-
const clearHighlightedMessageTimeoutId = (0,
|
|
50261
|
-
const jumpToMessage = (0,
|
|
50633
|
+
const clearHighlightedMessageTimeoutId = (0, import_react259.useRef)(null);
|
|
50634
|
+
const jumpToMessage = (0, import_react259.useCallback)(
|
|
50262
50635
|
async (messageId, messageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
|
|
50263
50636
|
dispatch({ loadingMore: true, type: "setLoadingMore" });
|
|
50264
50637
|
await channel.state.loadMessageIntoState(messageId, void 0, messageLimit);
|
|
@@ -50278,14 +50651,14 @@ var ChannelInner = (props) => {
|
|
|
50278
50651
|
},
|
|
50279
50652
|
[channel, loadMoreFinished]
|
|
50280
50653
|
);
|
|
50281
|
-
const jumpToLatestMessage = (0,
|
|
50654
|
+
const jumpToLatestMessage = (0, import_react259.useCallback)(async () => {
|
|
50282
50655
|
await channel.state.loadMessageIntoState("latest");
|
|
50283
50656
|
loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages);
|
|
50284
50657
|
dispatch({
|
|
50285
50658
|
type: "jumpToLatestMessage"
|
|
50286
50659
|
});
|
|
50287
50660
|
}, [channel, loadMoreFinished]);
|
|
50288
|
-
const jumpToFirstUnreadMessage = (0,
|
|
50661
|
+
const jumpToFirstUnreadMessage = (0, import_react259.useCallback)(
|
|
50289
50662
|
async (queryMessageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
|
|
50290
50663
|
if (!channelUnreadUiState?.unread_messages) return;
|
|
50291
50664
|
let lastReadMessageId = channelUnreadUiState?.last_read_message_id;
|
|
@@ -50390,7 +50763,7 @@ var ChannelInner = (props) => {
|
|
|
50390
50763
|
},
|
|
50391
50764
|
[addNotification, channel, loadMoreFinished, t2, channelUnreadUiState]
|
|
50392
50765
|
);
|
|
50393
|
-
const deleteMessage = (0,
|
|
50766
|
+
const deleteMessage = (0, import_react259.useCallback)(
|
|
50394
50767
|
async (message) => {
|
|
50395
50768
|
if (!message?.id) {
|
|
50396
50769
|
throw new Error("Cannot delete a message - missing message ID.");
|
|
@@ -50539,7 +50912,7 @@ var ChannelInner = (props) => {
|
|
|
50539
50912
|
event?.preventDefault();
|
|
50540
50913
|
dispatch({ type: "closeThread" });
|
|
50541
50914
|
};
|
|
50542
|
-
const loadMoreThreadFinished = (0,
|
|
50915
|
+
const loadMoreThreadFinished = (0, import_react259.useCallback)(
|
|
50543
50916
|
(0, import_lodash23.default)(
|
|
50544
50917
|
(threadHasMore, threadMessages) => {
|
|
50545
50918
|
dispatch({
|
|
@@ -50600,7 +50973,7 @@ var ChannelInner = (props) => {
|
|
|
50600
50973
|
videoAttachmentSizeHandler: props.videoAttachmentSizeHandler || getVideoAttachmentConfiguration,
|
|
50601
50974
|
watcher_count: state.watcherCount
|
|
50602
50975
|
});
|
|
50603
|
-
const channelActionContextValue = (0,
|
|
50976
|
+
const channelActionContextValue = (0, import_react259.useMemo)(
|
|
50604
50977
|
() => ({
|
|
50605
50978
|
addNotification,
|
|
50606
50979
|
closeThread,
|
|
@@ -50641,7 +51014,7 @@ var ChannelInner = (props) => {
|
|
|
50641
51014
|
setChannelUnreadUiState
|
|
50642
51015
|
]
|
|
50643
51016
|
);
|
|
50644
|
-
const componentContextValue = (0,
|
|
51017
|
+
const componentContextValue = (0, import_react259.useMemo)(
|
|
50645
51018
|
() => ({
|
|
50646
51019
|
Attachment: props.Attachment,
|
|
50647
51020
|
AttachmentPreviewList: props.AttachmentPreviewList,
|
|
@@ -50769,26 +51142,26 @@ var ChannelInner = (props) => {
|
|
|
50769
51142
|
typing
|
|
50770
51143
|
});
|
|
50771
51144
|
if (state.error) {
|
|
50772
|
-
return /* @__PURE__ */
|
|
51145
|
+
return /* @__PURE__ */ import_react259.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react259.default.createElement(LoadingErrorIndicator2, { error: state.error }));
|
|
50773
51146
|
}
|
|
50774
51147
|
if (state.loading) {
|
|
50775
|
-
return /* @__PURE__ */
|
|
51148
|
+
return /* @__PURE__ */ import_react259.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react259.default.createElement(LoadingIndicator2, null));
|
|
50776
51149
|
}
|
|
50777
51150
|
if (!channel.watch) {
|
|
50778
|
-
return /* @__PURE__ */
|
|
51151
|
+
return /* @__PURE__ */ import_react259.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react259.default.createElement("div", null, t2("Channel Missing")));
|
|
50779
51152
|
}
|
|
50780
|
-
return /* @__PURE__ */
|
|
51153
|
+
return /* @__PURE__ */ import_react259.default.createElement(ChannelContainer, { className: windowsEmojiClass }, /* @__PURE__ */ import_react259.default.createElement(ChannelStateProvider, { value: channelStateContextValue }, /* @__PURE__ */ import_react259.default.createElement(ChannelActionProvider, { value: channelActionContextValue }, /* @__PURE__ */ import_react259.default.createElement(WithComponents, { overrides: componentContextValue }, /* @__PURE__ */ import_react259.default.createElement(TypingProvider, { value: typingContextValue }, /* @__PURE__ */ import_react259.default.createElement("div", { className: `${chatContainerClass}` }, dragAndDropWindow && /* @__PURE__ */ import_react259.default.createElement(DropzoneProvider, { ...optionalMessageInputProps }, children), !dragAndDropWindow && /* @__PURE__ */ import_react259.default.createElement(import_react259.default.Fragment, null, children)))))));
|
|
50781
51154
|
};
|
|
50782
|
-
var Channel =
|
|
51155
|
+
var Channel = import_react259.default.memo(UnMemoizedChannel);
|
|
50783
51156
|
|
|
50784
51157
|
// src/components/ChannelHeader/ChannelHeader.tsx
|
|
50785
|
-
var
|
|
51158
|
+
var import_react261 = __toESM(require("react"));
|
|
50786
51159
|
|
|
50787
51160
|
// src/components/ChannelHeader/icons.tsx
|
|
50788
|
-
var
|
|
51161
|
+
var import_react260 = __toESM(require("react"));
|
|
50789
51162
|
var MenuIcon2 = ({ title }) => {
|
|
50790
51163
|
const { t: t2 } = useTranslationContext("MenuIcon");
|
|
50791
|
-
return /* @__PURE__ */
|
|
51164
|
+
return /* @__PURE__ */ import_react260.default.createElement("svg", { "data-testid": "menu-icon", viewBox: "0 0 448 512", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react260.default.createElement("title", null, title ?? t2("Menu")), /* @__PURE__ */ import_react260.default.createElement(
|
|
50792
51165
|
"path",
|
|
50793
51166
|
{
|
|
50794
51167
|
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",
|
|
@@ -50815,15 +51188,15 @@ var ChannelHeader = (props) => {
|
|
|
50815
51188
|
overrideTitle
|
|
50816
51189
|
});
|
|
50817
51190
|
const { member_count, subtitle } = channel?.data || {};
|
|
50818
|
-
return /* @__PURE__ */
|
|
51191
|
+
return /* @__PURE__ */ import_react261.default.createElement("div", { className: "str-chat__channel-header" }, /* @__PURE__ */ import_react261.default.createElement(
|
|
50819
51192
|
"button",
|
|
50820
51193
|
{
|
|
50821
51194
|
"aria-label": t2("aria/Menu"),
|
|
50822
51195
|
className: "str-chat__header-hamburger",
|
|
50823
51196
|
onClick: openMobileNav
|
|
50824
51197
|
},
|
|
50825
|
-
/* @__PURE__ */
|
|
50826
|
-
), /* @__PURE__ */
|
|
51198
|
+
/* @__PURE__ */ import_react261.default.createElement(MenuIcon3, null)
|
|
51199
|
+
), /* @__PURE__ */ import_react261.default.createElement(
|
|
50827
51200
|
Avatar2,
|
|
50828
51201
|
{
|
|
50829
51202
|
className: "str-chat__avatar--channel-header",
|
|
@@ -50831,35 +51204,35 @@ var ChannelHeader = (props) => {
|
|
|
50831
51204
|
image: displayImage,
|
|
50832
51205
|
name: displayTitle
|
|
50833
51206
|
}
|
|
50834
|
-
), /* @__PURE__ */
|
|
51207
|
+
), /* @__PURE__ */ import_react261.default.createElement("div", { className: "str-chat__channel-header-end" }, /* @__PURE__ */ import_react261.default.createElement("p", { className: "str-chat__channel-header-title" }, displayTitle, " ", live && /* @__PURE__ */ import_react261.default.createElement("span", { className: "str-chat__header-livestream-livelabel" }, t2("live"))), subtitle && /* @__PURE__ */ import_react261.default.createElement("p", { className: "str-chat__channel-header-subtitle" }, subtitle), /* @__PURE__ */ import_react261.default.createElement("p", { className: "str-chat__channel-header-info" }, !live && !!member_count && member_count > 0 && /* @__PURE__ */ import_react261.default.createElement(import_react261.default.Fragment, null, t2("{{ memberCount }} members", {
|
|
50835
51208
|
memberCount: member_count
|
|
50836
51209
|
}), ",", " "), t2("{{ watcherCount }} online", { watcherCount: watcher_count }))));
|
|
50837
51210
|
};
|
|
50838
51211
|
|
|
50839
51212
|
// src/components/Chat/Chat.tsx
|
|
50840
|
-
var
|
|
51213
|
+
var import_react265 = __toESM(require("react"));
|
|
50841
51214
|
|
|
50842
51215
|
// src/components/Chat/hooks/useChat.ts
|
|
50843
|
-
var
|
|
51216
|
+
var import_react262 = require("react");
|
|
50844
51217
|
var useChat = ({
|
|
50845
51218
|
client,
|
|
50846
51219
|
defaultLanguage = "en",
|
|
50847
51220
|
i18nInstance,
|
|
50848
51221
|
initialNavOpen
|
|
50849
51222
|
}) => {
|
|
50850
|
-
const [translators, setTranslators] = (0,
|
|
51223
|
+
const [translators, setTranslators] = (0, import_react262.useState)({
|
|
50851
51224
|
t: (key) => key,
|
|
50852
51225
|
tDateTimeParser: defaultDateTimeParser,
|
|
50853
51226
|
userLanguage: "en"
|
|
50854
51227
|
});
|
|
50855
|
-
const [channel, setChannel] = (0,
|
|
50856
|
-
const [mutes, setMutes] = (0,
|
|
50857
|
-
const [navOpen, setNavOpen] = (0,
|
|
50858
|
-
const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = (0,
|
|
51228
|
+
const [channel, setChannel] = (0, import_react262.useState)();
|
|
51229
|
+
const [mutes, setMutes] = (0, import_react262.useState)([]);
|
|
51230
|
+
const [navOpen, setNavOpen] = (0, import_react262.useState)(initialNavOpen);
|
|
51231
|
+
const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = (0, import_react262.useState)({});
|
|
50859
51232
|
const clientMutes = client.user?.mutes || [];
|
|
50860
51233
|
const closeMobileNav = () => setNavOpen(false);
|
|
50861
51234
|
const openMobileNav = () => setTimeout(() => setNavOpen(true), 100);
|
|
50862
|
-
const appSettings = (0,
|
|
51235
|
+
const appSettings = (0, import_react262.useRef)(null);
|
|
50863
51236
|
const getAppSettings = () => {
|
|
50864
51237
|
if (appSettings.current) {
|
|
50865
51238
|
return appSettings.current;
|
|
@@ -50867,11 +51240,11 @@ var useChat = ({
|
|
|
50867
51240
|
appSettings.current = client.getAppSettings();
|
|
50868
51241
|
return appSettings.current;
|
|
50869
51242
|
};
|
|
50870
|
-
(0,
|
|
51243
|
+
(0, import_react262.useEffect)(() => {
|
|
50871
51244
|
if (!client) return;
|
|
50872
51245
|
const userAgent = client.getUserAgent();
|
|
50873
51246
|
if (!userAgent.includes("stream-chat-react")) {
|
|
50874
|
-
client.setUserAgent(`stream-chat-react-12.
|
|
51247
|
+
client.setUserAgent(`stream-chat-react-12.10.0-${userAgent}`);
|
|
50875
51248
|
}
|
|
50876
51249
|
client.threads.registerSubscriptions();
|
|
50877
51250
|
client.polls.registerSubscriptions();
|
|
@@ -50880,7 +51253,7 @@ var useChat = ({
|
|
|
50880
51253
|
client.polls.unregisterSubscriptions();
|
|
50881
51254
|
};
|
|
50882
51255
|
}, [client]);
|
|
50883
|
-
(0,
|
|
51256
|
+
(0, import_react262.useEffect)(() => {
|
|
50884
51257
|
setMutes(clientMutes);
|
|
50885
51258
|
const handleEvent = (event) => {
|
|
50886
51259
|
setMutes(event.me?.mutes || []);
|
|
@@ -50888,7 +51261,7 @@ var useChat = ({
|
|
|
50888
51261
|
client.on("notification.mutes_updated", handleEvent);
|
|
50889
51262
|
return () => client.off("notification.mutes_updated", handleEvent);
|
|
50890
51263
|
}, [clientMutes?.length]);
|
|
50891
|
-
(0,
|
|
51264
|
+
(0, import_react262.useEffect)(() => {
|
|
50892
51265
|
let userLanguage = client.user?.language;
|
|
50893
51266
|
if (!userLanguage) {
|
|
50894
51267
|
const browserLanguage = window.navigator.language.slice(0, 2);
|
|
@@ -50905,7 +51278,7 @@ var useChat = ({
|
|
|
50905
51278
|
});
|
|
50906
51279
|
});
|
|
50907
51280
|
}, [i18nInstance]);
|
|
50908
|
-
const setActiveChannel = (0,
|
|
51281
|
+
const setActiveChannel = (0, import_react262.useCallback)(
|
|
50909
51282
|
async (activeChannel, watchers = {}, event) => {
|
|
50910
51283
|
if (event && event.preventDefault) event.preventDefault();
|
|
50911
51284
|
if (activeChannel && Object.keys(watchers).length) {
|
|
@@ -50916,7 +51289,7 @@ var useChat = ({
|
|
|
50916
51289
|
},
|
|
50917
51290
|
[]
|
|
50918
51291
|
);
|
|
50919
|
-
(0,
|
|
51292
|
+
(0, import_react262.useEffect)(() => {
|
|
50920
51293
|
setLatestMessageDatesByChannels({});
|
|
50921
51294
|
}, [client.user?.id]);
|
|
50922
51295
|
return {
|
|
@@ -50933,7 +51306,7 @@ var useChat = ({
|
|
|
50933
51306
|
};
|
|
50934
51307
|
|
|
50935
51308
|
// src/components/Chat/hooks/useCreateChatContext.ts
|
|
50936
|
-
var
|
|
51309
|
+
var import_react263 = require("react");
|
|
50937
51310
|
var useCreateChatContext = (value) => {
|
|
50938
51311
|
const {
|
|
50939
51312
|
channel,
|
|
@@ -50957,7 +51330,7 @@ var useCreateChatContext = (value) => {
|
|
|
50957
51330
|
const clientValues = `${client.clientID}${Object.keys(client.activeChannels).length}${Object.keys(client.listeners).length}${client.mutedChannels.length}
|
|
50958
51331
|
${client.user?.id}`;
|
|
50959
51332
|
const mutedUsersLength = mutes.length;
|
|
50960
|
-
const chatContext = (0,
|
|
51333
|
+
const chatContext = (0, import_react263.useMemo)(
|
|
50961
51334
|
() => ({
|
|
50962
51335
|
channel,
|
|
50963
51336
|
channelsQueryState,
|
|
@@ -50990,10 +51363,10 @@ var useCreateChatContext = (value) => {
|
|
|
50990
51363
|
};
|
|
50991
51364
|
|
|
50992
51365
|
// src/components/Chat/hooks/useChannelsQueryState.ts
|
|
50993
|
-
var
|
|
51366
|
+
var import_react264 = require("react");
|
|
50994
51367
|
var useChannelsQueryState = () => {
|
|
50995
|
-
const [error, setError] = (0,
|
|
50996
|
-
const [queryInProgress, setQueryInProgress] = (0,
|
|
51368
|
+
const [error, setError] = (0, import_react264.useState)(null);
|
|
51369
|
+
const [queryInProgress, setQueryInProgress] = (0, import_react264.useState)("uninitialized");
|
|
50997
51370
|
return {
|
|
50998
51371
|
error,
|
|
50999
51372
|
queryInProgress,
|
|
@@ -51044,11 +51417,11 @@ var Chat = (props) => {
|
|
|
51044
51417
|
useImageFlagEmojisOnWindows
|
|
51045
51418
|
});
|
|
51046
51419
|
if (!translators.t) return null;
|
|
51047
|
-
return /* @__PURE__ */
|
|
51420
|
+
return /* @__PURE__ */ import_react265.default.createElement(ChatProvider, { value: chatContextValue }, /* @__PURE__ */ import_react265.default.createElement(TranslationProvider, { value: translators }, children));
|
|
51048
51421
|
};
|
|
51049
51422
|
|
|
51050
51423
|
// src/components/Chat/hooks/useCreateChatClient.ts
|
|
51051
|
-
var
|
|
51424
|
+
var import_react266 = require("react");
|
|
51052
51425
|
var import_stream_chat6 = require("stream-chat");
|
|
51053
51426
|
var useCreateChatClient = ({
|
|
51054
51427
|
apiKey,
|
|
@@ -51056,13 +51429,13 @@ var useCreateChatClient = ({
|
|
|
51056
51429
|
tokenOrProvider,
|
|
51057
51430
|
userData
|
|
51058
51431
|
}) => {
|
|
51059
|
-
const [chatClient, setChatClient] = (0,
|
|
51060
|
-
const [cachedUserData, setCachedUserData] = (0,
|
|
51432
|
+
const [chatClient, setChatClient] = (0, import_react266.useState)(null);
|
|
51433
|
+
const [cachedUserData, setCachedUserData] = (0, import_react266.useState)(userData);
|
|
51061
51434
|
if (userData.id !== cachedUserData.id) {
|
|
51062
51435
|
setCachedUserData(userData);
|
|
51063
51436
|
}
|
|
51064
|
-
const [cachedOptions] = (0,
|
|
51065
|
-
(0,
|
|
51437
|
+
const [cachedOptions] = (0, import_react266.useState)(options);
|
|
51438
|
+
(0, import_react266.useEffect)(() => {
|
|
51066
51439
|
const client = new import_stream_chat6.StreamChat(apiKey, void 0, cachedOptions);
|
|
51067
51440
|
let didUserConnectInterrupt = false;
|
|
51068
51441
|
const connectionPromise = client.connectUser(cachedUserData, tokenOrProvider).then(() => {
|
|
@@ -51080,17 +51453,17 @@ var useCreateChatClient = ({
|
|
|
51080
51453
|
};
|
|
51081
51454
|
|
|
51082
51455
|
// src/components/Thread/Thread.tsx
|
|
51083
|
-
var
|
|
51456
|
+
var import_react271 = __toESM(require("react"));
|
|
51084
51457
|
var import_clsx65 = __toESM(require("clsx"));
|
|
51085
51458
|
|
|
51086
51459
|
// src/components/Thread/ThreadHeader.tsx
|
|
51087
|
-
var
|
|
51460
|
+
var import_react268 = __toESM(require("react"));
|
|
51088
51461
|
|
|
51089
51462
|
// src/components/Thread/icons.tsx
|
|
51090
|
-
var
|
|
51463
|
+
var import_react267 = __toESM(require("react"));
|
|
51091
51464
|
var CloseIcon3 = ({ title }) => {
|
|
51092
51465
|
const { t: t2 } = useTranslationContext("CloseIcon");
|
|
51093
|
-
return /* @__PURE__ */
|
|
51466
|
+
return /* @__PURE__ */ import_react267.default.createElement(
|
|
51094
51467
|
"svg",
|
|
51095
51468
|
{
|
|
51096
51469
|
"data-testid": "close-no-outline",
|
|
@@ -51098,8 +51471,8 @@ var CloseIcon3 = ({ title }) => {
|
|
|
51098
51471
|
viewBox: "0 0 24 24",
|
|
51099
51472
|
xmlns: "http://www.w3.org/2000/svg"
|
|
51100
51473
|
},
|
|
51101
|
-
/* @__PURE__ */
|
|
51102
|
-
/* @__PURE__ */
|
|
51474
|
+
/* @__PURE__ */ import_react267.default.createElement("title", null, title ?? t2("Close")),
|
|
51475
|
+
/* @__PURE__ */ import_react267.default.createElement(
|
|
51103
51476
|
"path",
|
|
51104
51477
|
{
|
|
51105
51478
|
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",
|
|
@@ -51119,7 +51492,7 @@ var ThreadHeader = (props) => {
|
|
|
51119
51492
|
overrideImage,
|
|
51120
51493
|
overrideTitle
|
|
51121
51494
|
});
|
|
51122
|
-
return /* @__PURE__ */
|
|
51495
|
+
return /* @__PURE__ */ import_react268.default.createElement("div", { className: "str-chat__thread-header" }, /* @__PURE__ */ import_react268.default.createElement("div", { className: "str-chat__thread-header-details" }, /* @__PURE__ */ import_react268.default.createElement("div", { className: "str-chat__thread-header-title" }, t2("Thread")), /* @__PURE__ */ import_react268.default.createElement("div", { className: "str-chat__thread-header-subtitle" }, displayTitle)), /* @__PURE__ */ import_react268.default.createElement(
|
|
51123
51496
|
"button",
|
|
51124
51497
|
{
|
|
51125
51498
|
"aria-label": t2("aria/Close thread"),
|
|
@@ -51127,20 +51500,20 @@ var ThreadHeader = (props) => {
|
|
|
51127
51500
|
"data-testid": "close-button",
|
|
51128
51501
|
onClick: closeThread
|
|
51129
51502
|
},
|
|
51130
|
-
/* @__PURE__ */
|
|
51503
|
+
/* @__PURE__ */ import_react268.default.createElement(CloseIcon3, null)
|
|
51131
51504
|
));
|
|
51132
51505
|
};
|
|
51133
51506
|
|
|
51134
51507
|
// src/components/Thread/ThreadHead.tsx
|
|
51135
|
-
var
|
|
51508
|
+
var import_react270 = __toESM(require("react"));
|
|
51136
51509
|
|
|
51137
51510
|
// src/components/Thread/ThreadStart.tsx
|
|
51138
|
-
var
|
|
51511
|
+
var import_react269 = __toESM(require("react"));
|
|
51139
51512
|
var ThreadStart = () => {
|
|
51140
51513
|
const { thread } = useChannelStateContext("ThreadStart");
|
|
51141
51514
|
const { t: t2 } = useTranslationContext("ThreadStart");
|
|
51142
51515
|
if (!thread?.reply_count) return null;
|
|
51143
|
-
return /* @__PURE__ */
|
|
51516
|
+
return /* @__PURE__ */ import_react269.default.createElement("div", { className: "str-chat__thread-start" }, t2("replyCount", { count: thread.reply_count }));
|
|
51144
51517
|
};
|
|
51145
51518
|
|
|
51146
51519
|
// src/components/Thread/ThreadHead.tsx
|
|
@@ -51148,7 +51521,7 @@ var ThreadHead = (props) => {
|
|
|
51148
51521
|
const { ThreadStart: ThreadStart2 = ThreadStart } = useComponentContext(
|
|
51149
51522
|
"ThreadHead"
|
|
51150
51523
|
);
|
|
51151
|
-
return /* @__PURE__ */
|
|
51524
|
+
return /* @__PURE__ */ import_react270.default.createElement("div", { className: "str-chat__parent-message-li" }, /* @__PURE__ */ import_react270.default.createElement(Message, { initialMessage: true, threadList: true, ...props }), /* @__PURE__ */ import_react270.default.createElement(ThreadStart2, null));
|
|
51152
51525
|
};
|
|
51153
51526
|
|
|
51154
51527
|
// src/components/Thread/Thread.tsx
|
|
@@ -51158,7 +51531,7 @@ var Thread = (props) => {
|
|
|
51158
51531
|
if (!thread && !threadInstance || channelConfig?.replies === false) return null;
|
|
51159
51532
|
return (
|
|
51160
51533
|
// FIXME: TS is having trouble here as at least one of the two would always be defined
|
|
51161
|
-
/* @__PURE__ */
|
|
51534
|
+
/* @__PURE__ */ import_react271.default.createElement(ThreadInner, { ...props, key: `thread-${(thread ?? threadInstance)?.id}-${channel?.cid}` })
|
|
51162
51535
|
);
|
|
51163
51536
|
};
|
|
51164
51537
|
var selector6 = (nextValue) => ({
|
|
@@ -51203,7 +51576,7 @@ var ThreadInner = (props) => {
|
|
|
51203
51576
|
const FallbackMessage = virtualized && VirtualMessage ? VirtualMessage : ContextMessage;
|
|
51204
51577
|
const MessageUIComponent = ThreadMessage || FallbackMessage;
|
|
51205
51578
|
const ThreadMessageList = virtualized ? VirtualizedMessageList : MessageList;
|
|
51206
|
-
(0,
|
|
51579
|
+
(0, import_react271.useEffect)(() => {
|
|
51207
51580
|
if (thread?.id && thread?.reply_count) {
|
|
51208
51581
|
loadMoreThread();
|
|
51209
51582
|
}
|
|
@@ -51225,7 +51598,7 @@ var ThreadInner = (props) => {
|
|
|
51225
51598
|
const threadClass = customClasses?.thread || (0, import_clsx65.default)("str-chat__thread-container str-chat__thread", {
|
|
51226
51599
|
"str-chat__thread--virtualized": virtualized
|
|
51227
51600
|
});
|
|
51228
|
-
const head = /* @__PURE__ */
|
|
51601
|
+
const head = /* @__PURE__ */ import_react271.default.createElement(
|
|
51229
51602
|
ThreadHead2,
|
|
51230
51603
|
{
|
|
51231
51604
|
key: messageAsThread.id,
|
|
@@ -51234,7 +51607,7 @@ var ThreadInner = (props) => {
|
|
|
51234
51607
|
...additionalParentMessageProps
|
|
51235
51608
|
}
|
|
51236
51609
|
);
|
|
51237
|
-
return /* @__PURE__ */
|
|
51610
|
+
return /* @__PURE__ */ import_react271.default.createElement("div", { className: threadClass }, /* @__PURE__ */ import_react271.default.createElement(ThreadHeader2, { closeThread, thread: messageAsThread }), /* @__PURE__ */ import_react271.default.createElement(
|
|
51238
51611
|
ThreadMessageList,
|
|
51239
51612
|
{
|
|
51240
51613
|
disableDateSeparator: !enableDateSeparator,
|
|
@@ -51246,7 +51619,7 @@ var ThreadInner = (props) => {
|
|
|
51246
51619
|
...threadProps,
|
|
51247
51620
|
...virtualized ? additionalVirtualizedMessageListProps : additionalMessageListProps
|
|
51248
51621
|
}
|
|
51249
|
-
), /* @__PURE__ */
|
|
51622
|
+
), /* @__PURE__ */ import_react271.default.createElement(
|
|
51250
51623
|
MessageInput,
|
|
51251
51624
|
{
|
|
51252
51625
|
focus: autoFocus,
|
|
@@ -51260,12 +51633,12 @@ var ThreadInner = (props) => {
|
|
|
51260
51633
|
};
|
|
51261
51634
|
|
|
51262
51635
|
// src/components/Window/Window.tsx
|
|
51263
|
-
var
|
|
51636
|
+
var import_react272 = __toESM(require("react"));
|
|
51264
51637
|
var import_clsx66 = __toESM(require("clsx"));
|
|
51265
51638
|
var UnMemoizedWindow = (props) => {
|
|
51266
51639
|
const { children, thread: propThread } = props;
|
|
51267
51640
|
const { thread: contextThread } = useChannelStateContext("Window");
|
|
51268
|
-
return /* @__PURE__ */
|
|
51641
|
+
return /* @__PURE__ */ import_react272.default.createElement(
|
|
51269
51642
|
"div",
|
|
51270
51643
|
{
|
|
51271
51644
|
className: (0, import_clsx66.default)("str-chat__main-panel", {
|
|
@@ -51275,7 +51648,7 @@ var UnMemoizedWindow = (props) => {
|
|
|
51275
51648
|
children
|
|
51276
51649
|
);
|
|
51277
51650
|
};
|
|
51278
|
-
var Window =
|
|
51651
|
+
var Window = import_react272.default.memo(UnMemoizedWindow);
|
|
51279
51652
|
/*! Bundled license information:
|
|
51280
51653
|
|
|
51281
51654
|
is-buffer/index.js:
|
|
@@ -51285,5 +51658,26 @@ is-buffer/index.js:
|
|
|
51285
51658
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
51286
51659
|
* @license MIT
|
|
51287
51660
|
*)
|
|
51661
|
+
|
|
51662
|
+
react-is/cjs/react-is.development.js:
|
|
51663
|
+
(**
|
|
51664
|
+
* @license React
|
|
51665
|
+
* react-is.development.js
|
|
51666
|
+
*
|
|
51667
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
51668
|
+
*
|
|
51669
|
+
* This source code is licensed under the MIT license found in the
|
|
51670
|
+
* LICENSE file in the root directory of this source tree.
|
|
51671
|
+
*)
|
|
51672
|
+
|
|
51673
|
+
react-is/cjs/react-is.development.js:
|
|
51674
|
+
(** @license React v16.13.1
|
|
51675
|
+
* react-is.development.js
|
|
51676
|
+
*
|
|
51677
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
51678
|
+
*
|
|
51679
|
+
* This source code is licensed under the MIT license found in the
|
|
51680
|
+
* LICENSE file in the root directory of this source tree.
|
|
51681
|
+
*)
|
|
51288
51682
|
*/
|
|
51289
51683
|
//# sourceMappingURL=index.browser.cjs.map
|