stream-chat-react 8.1.3-beta.1 → 9.0.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/browser.full-bundle.js +178 -250
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +4 -4
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/Attachment/utils.js +2 -2
- package/dist/components/AutoCompleteTextarea/Textarea.d.ts +2 -1
- package/dist/components/AutoCompleteTextarea/Textarea.d.ts.map +1 -1
- package/dist/components/AutoCompleteTextarea/Textarea.js +10 -17
- package/dist/components/Channel/Channel.js +2 -2
- package/dist/components/Channel/hooks/useCreateChannelStateContext.js +2 -2
- package/dist/components/Channel/utils.js +2 -2
- package/dist/components/ChannelPreview/ChannelPreview.d.ts.map +1 -1
- package/dist/components/ChannelPreview/ChannelPreview.js +20 -4
- package/dist/components/ChatAutoComplete/ChatAutoComplete.js +1 -1
- package/dist/components/Message/utils.d.ts.map +1 -1
- package/dist/components/Message/utils.js +5 -10
- package/dist/components/MessageInput/MessageInput.d.ts +12 -8
- package/dist/components/MessageInput/MessageInput.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useAttachments.js +2 -2
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +2 -2
- package/dist/components/MessageInput/hooks/useMessageInputState.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useMessageInputState.js +24 -27
- package/dist/components/MessageInput/hooks/usePasteHandler.d.ts +1 -1
- package/dist/components/MessageInput/hooks/usePasteHandler.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/usePasteHandler.js +3 -1
- package/dist/components/MessageInput/hooks/useSubmitHandler.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useSubmitHandler.js +17 -15
- package/dist/components/MessageList/utils.js +3 -3
- package/dist/components/Thread/Thread.js +50 -10
- package/dist/index.cjs.js +116 -105
- package/dist/index.cjs.js.map +1 -1
- package/dist/stories/{connected-user.stories.d.ts → add-message.stories.d.ts} +1 -1
- package/dist/stories/add-message.stories.d.ts.map +1 -0
- package/dist/stories/{connected-user.stories.js → add-message.stories.js} +4 -3
- package/dist/stories/jump-to-message.stories.d.ts.map +1 -1
- package/dist/stories/jump-to-message.stories.js +0 -3
- package/dist/stories/mark-read.stories.d.ts.map +1 -1
- package/dist/stories/mark-read.stories.js +4 -25
- package/dist/stories/navigate-long-message-lists.stories.d.ts +4 -0
- package/dist/stories/navigate-long-message-lists.stories.d.ts.map +1 -0
- package/dist/stories/navigate-long-message-lists.stories.js +167 -0
- package/dist/utils.d.ts +5 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +5 -8
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -5
- package/dist/stories/connected-user.stories.d.ts.map +0 -1
|
@@ -5452,81 +5452,22 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
5452
5452
|
|
|
5453
5453
|
var ReactPlayer = unwrapExports(lib$8);
|
|
5454
5454
|
|
|
5455
|
-
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
5456
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
5457
|
-
// generators (like Math.random()).
|
|
5458
|
-
var getRandomValues;
|
|
5459
|
-
var rnds8 = new Uint8Array(16);
|
|
5460
|
-
function rng() {
|
|
5461
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
5462
|
-
if (!getRandomValues) {
|
|
5463
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
5464
|
-
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
5465
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
5466
|
-
|
|
5467
|
-
if (!getRandomValues) {
|
|
5468
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
5469
|
-
}
|
|
5470
|
-
}
|
|
5471
|
-
|
|
5472
|
-
return getRandomValues(rnds8);
|
|
5473
|
-
}
|
|
5474
|
-
|
|
5475
|
-
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
5476
|
-
|
|
5477
|
-
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
|
|
5478
|
-
function validate(uuid) {
|
|
5479
|
-
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
5480
|
-
}
|
|
5481
|
-
|
|
5482
|
-
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};/**
|
|
5483
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
5484
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
5485
|
-
*/
|
|
5486
|
-
|
|
5487
|
-
var byteToHex = [];
|
|
5488
|
-
|
|
5489
|
-
for (var i$1 = 0; i$1 < 256; ++i$1) {
|
|
5490
|
-
byteToHex.push((i$1 + 0x100).toString(16).substr(1));
|
|
5491
|
-
}
|
|
5492
|
-
|
|
5493
|
-
function stringify$2(arr) {
|
|
5494
|
-
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
5495
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
|
5496
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
5497
|
-
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
5498
|
-
// of the following:
|
|
5499
|
-
// - One or more input array values don't map to a hex octet (leading to
|
|
5500
|
-
// "undefined" in the uuid)
|
|
5501
|
-
// - Invalid input values for the RFC `version` or `variant` fields
|
|
5502
|
-
|
|
5503
|
-
if (!validate(uuid)) {
|
|
5504
|
-
throw TypeError('Stringified UUID is invalid');
|
|
5505
|
-
}
|
|
5506
|
-
|
|
5507
|
-
return uuid;
|
|
5508
|
-
}
|
|
5509
|
-
|
|
5510
5455
|
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
|
|
5511
|
-
function v4(options, buf, offset) {
|
|
5512
|
-
options = options || {};
|
|
5513
|
-
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
5514
5456
|
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5457
|
+
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};let nanoid = (size = 21) =>
|
|
5458
|
+
crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
|
|
5459
|
+
byte &= 63;
|
|
5460
|
+
if (byte < 36) {
|
|
5461
|
+
id += byte.toString(36);
|
|
5462
|
+
} else if (byte < 62) {
|
|
5463
|
+
id += (byte - 26).toString(36).toUpperCase();
|
|
5464
|
+
} else if (byte > 62) {
|
|
5465
|
+
id += '-';
|
|
5466
|
+
} else {
|
|
5467
|
+
id += '_';
|
|
5523
5468
|
}
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
}
|
|
5527
|
-
|
|
5528
|
-
return stringify$2(rnds);
|
|
5529
|
-
}
|
|
5469
|
+
return id
|
|
5470
|
+
}, '');
|
|
5530
5471
|
|
|
5531
5472
|
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var UnMemoizedAttachmentActions = function (props) {
|
|
5532
5473
|
var actionHandler = props.actionHandler, actions = props.actions, id = props.id, text = props.text;
|
|
@@ -11780,7 +11721,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
11780
11721
|
? 'actions'
|
|
11781
11722
|
: '';
|
|
11782
11723
|
}
|
|
11783
|
-
return (React__default['default'].createElement("div", { className: "str-chat__message-attachment str-chat__message-attachment--" + componentType + " str-chat__message-attachment--" + ((attachment === null || attachment === void 0 ? void 0 : attachment.type) || '') + " str-chat__message-attachment--" + componentType + "--" + extra, key: (isGalleryAttachmentType(attachment) ? '' : (attachment === null || attachment === void 0 ? void 0 : attachment.id) ||
|
|
11724
|
+
return (React__default['default'].createElement("div", { className: "str-chat__message-attachment str-chat__message-attachment--" + componentType + " str-chat__message-attachment--" + ((attachment === null || attachment === void 0 ? void 0 : attachment.type) || '') + " str-chat__message-attachment--" + componentType + "--" + extra, key: (isGalleryAttachmentType(attachment) ? '' : (attachment === null || attachment === void 0 ? void 0 : attachment.id) || nanoid()) + "-" + ((attachment === null || attachment === void 0 ? void 0 : attachment.type) || 'none') + " " }, children));
|
|
11784
11725
|
};
|
|
11785
11726
|
var renderAttachmentActions = function (props) {
|
|
11786
11727
|
var _a;
|
|
@@ -11957,8 +11898,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
11957
11898
|
return obj;
|
|
11958
11899
|
}
|
|
11959
11900
|
|
|
11960
|
-
module.exports = _defineProperty;
|
|
11961
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
11901
|
+
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
11962
11902
|
});
|
|
11963
11903
|
|
|
11964
11904
|
var _defineProperty = unwrapExports(defineProperty$1);
|
|
@@ -11969,8 +11909,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
11969
11909
|
if (Array.isArray(arr)) return arr;
|
|
11970
11910
|
}
|
|
11971
11911
|
|
|
11972
|
-
module.exports = _arrayWithHoles;
|
|
11973
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
11912
|
+
module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
11974
11913
|
});
|
|
11975
11914
|
|
|
11976
11915
|
unwrapExports(arrayWithHoles);
|
|
@@ -11978,14 +11917,17 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
11978
11917
|
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
|
|
11979
11918
|
var iterableToArrayLimit = createCommonjsModule$1(function (module) {
|
|
11980
11919
|
function _iterableToArrayLimit(arr, i) {
|
|
11981
|
-
|
|
11920
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
11921
|
+
|
|
11922
|
+
if (_i == null) return;
|
|
11982
11923
|
var _arr = [];
|
|
11983
11924
|
var _n = true;
|
|
11984
11925
|
var _d = false;
|
|
11985
|
-
|
|
11926
|
+
|
|
11927
|
+
var _s, _e;
|
|
11986
11928
|
|
|
11987
11929
|
try {
|
|
11988
|
-
for (
|
|
11930
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
11989
11931
|
_arr.push(_s.value);
|
|
11990
11932
|
|
|
11991
11933
|
if (i && _arr.length === i) break;
|
|
@@ -12004,8 +11946,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
12004
11946
|
return _arr;
|
|
12005
11947
|
}
|
|
12006
11948
|
|
|
12007
|
-
module.exports = _iterableToArrayLimit;
|
|
12008
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
11949
|
+
module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
12009
11950
|
});
|
|
12010
11951
|
|
|
12011
11952
|
unwrapExports(iterableToArrayLimit);
|
|
@@ -12022,8 +11963,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
12022
11963
|
return arr2;
|
|
12023
11964
|
}
|
|
12024
11965
|
|
|
12025
|
-
module.exports = _arrayLikeToArray;
|
|
12026
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
11966
|
+
module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
12027
11967
|
});
|
|
12028
11968
|
|
|
12029
11969
|
unwrapExports(arrayLikeToArray);
|
|
@@ -12039,8 +11979,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
12039
11979
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
|
12040
11980
|
}
|
|
12041
11981
|
|
|
12042
|
-
module.exports = _unsupportedIterableToArray;
|
|
12043
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
11982
|
+
module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
12044
11983
|
});
|
|
12045
11984
|
|
|
12046
11985
|
unwrapExports(unsupportedIterableToArray);
|
|
@@ -12051,8 +11990,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
12051
11990
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
12052
11991
|
}
|
|
12053
11992
|
|
|
12054
|
-
module.exports = _nonIterableRest;
|
|
12055
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
11993
|
+
module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
12056
11994
|
});
|
|
12057
11995
|
|
|
12058
11996
|
unwrapExports(nonIterableRest);
|
|
@@ -12063,8 +12001,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
12063
12001
|
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
|
|
12064
12002
|
}
|
|
12065
12003
|
|
|
12066
|
-
module.exports = _slicedToArray;
|
|
12067
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
12004
|
+
module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
12068
12005
|
});
|
|
12069
12006
|
|
|
12070
12007
|
var _slicedToArray = unwrapExports(slicedToArray);
|
|
@@ -36659,14 +36596,10 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
36659
36596
|
function escapeRegExp(text) {
|
|
36660
36597
|
return text.replace(/[-[\]{}()*+?.,\\^$|#]/g, '\\$&');
|
|
36661
36598
|
}
|
|
36662
|
-
|
|
36663
|
-
|
|
36664
|
-
|
|
36665
|
-
|
|
36666
|
-
function generateRandomId() {
|
|
36667
|
-
// prettier-ignore
|
|
36668
|
-
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
|
|
36669
|
-
}
|
|
36599
|
+
/**
|
|
36600
|
+
* @deprecated will be removed in the next major release
|
|
36601
|
+
*/
|
|
36602
|
+
var generateRandomId = nanoid;
|
|
36670
36603
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt#getting_whole_characters
|
|
36671
36604
|
var getWholeChar = function (str, i) {
|
|
36672
36605
|
var code = str.charCodeAt(i);
|
|
@@ -36886,14 +36819,11 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
36886
36819
|
}
|
|
36887
36820
|
|
|
36888
36821
|
return target;
|
|
36889
|
-
};
|
|
36890
|
-
|
|
36891
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36822
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
36892
36823
|
return _extends.apply(this, arguments);
|
|
36893
36824
|
}
|
|
36894
36825
|
|
|
36895
|
-
module.exports = _extends;
|
|
36896
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36826
|
+
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
36897
36827
|
});
|
|
36898
36828
|
|
|
36899
36829
|
var _extends$2 = unwrapExports(_extends_1);
|
|
@@ -36903,25 +36833,14 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
36903
36833
|
function _typeof(obj) {
|
|
36904
36834
|
"@babel/helpers - typeof";
|
|
36905
36835
|
|
|
36906
|
-
|
|
36907
|
-
|
|
36908
|
-
|
|
36909
|
-
|
|
36910
|
-
|
|
36911
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36912
|
-
} else {
|
|
36913
|
-
module.exports = _typeof = function _typeof(obj) {
|
|
36914
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
36915
|
-
};
|
|
36916
|
-
|
|
36917
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36918
|
-
}
|
|
36919
|
-
|
|
36920
|
-
return _typeof(obj);
|
|
36836
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
36837
|
+
return typeof obj;
|
|
36838
|
+
} : function (obj) {
|
|
36839
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
36840
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
36921
36841
|
}
|
|
36922
36842
|
|
|
36923
|
-
module.exports = _typeof;
|
|
36924
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36843
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
36925
36844
|
});
|
|
36926
36845
|
|
|
36927
36846
|
var _typeof = unwrapExports(_typeof_1);
|
|
@@ -36934,8 +36853,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
36934
36853
|
}
|
|
36935
36854
|
}
|
|
36936
36855
|
|
|
36937
|
-
module.exports = _classCallCheck;
|
|
36938
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36856
|
+
module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
36939
36857
|
});
|
|
36940
36858
|
|
|
36941
36859
|
var _classCallCheck = unwrapExports(classCallCheck);
|
|
@@ -36955,11 +36873,13 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
36955
36873
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
36956
36874
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
36957
36875
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
36876
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
36877
|
+
writable: false
|
|
36878
|
+
});
|
|
36958
36879
|
return Constructor;
|
|
36959
36880
|
}
|
|
36960
36881
|
|
|
36961
|
-
module.exports = _createClass;
|
|
36962
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36882
|
+
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
36963
36883
|
});
|
|
36964
36884
|
|
|
36965
36885
|
var _createClass = unwrapExports(createClass);
|
|
@@ -36974,8 +36894,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
36974
36894
|
return self;
|
|
36975
36895
|
}
|
|
36976
36896
|
|
|
36977
|
-
module.exports = _assertThisInitialized;
|
|
36978
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36897
|
+
module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
36979
36898
|
});
|
|
36980
36899
|
|
|
36981
36900
|
var _assertThisInitialized = unwrapExports(assertThisInitialized);
|
|
@@ -36986,14 +36905,11 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
36986
36905
|
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
36987
36906
|
o.__proto__ = p;
|
|
36988
36907
|
return o;
|
|
36989
|
-
};
|
|
36990
|
-
|
|
36991
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36908
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
36992
36909
|
return _setPrototypeOf(o, p);
|
|
36993
36910
|
}
|
|
36994
36911
|
|
|
36995
|
-
module.exports = _setPrototypeOf;
|
|
36996
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36912
|
+
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
36997
36913
|
});
|
|
36998
36914
|
|
|
36999
36915
|
unwrapExports(setPrototypeOf);
|
|
@@ -37012,11 +36928,13 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
37012
36928
|
configurable: true
|
|
37013
36929
|
}
|
|
37014
36930
|
});
|
|
36931
|
+
Object.defineProperty(subClass, "prototype", {
|
|
36932
|
+
writable: false
|
|
36933
|
+
});
|
|
37015
36934
|
if (superClass) setPrototypeOf(subClass, superClass);
|
|
37016
36935
|
}
|
|
37017
36936
|
|
|
37018
|
-
module.exports = _inherits;
|
|
37019
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36937
|
+
module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
37020
36938
|
});
|
|
37021
36939
|
|
|
37022
36940
|
var _inherits = unwrapExports(inherits);
|
|
@@ -37030,13 +36948,14 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
37030
36948
|
function _possibleConstructorReturn(self, call) {
|
|
37031
36949
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
37032
36950
|
return call;
|
|
36951
|
+
} else if (call !== void 0) {
|
|
36952
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
37033
36953
|
}
|
|
37034
36954
|
|
|
37035
36955
|
return assertThisInitialized(self);
|
|
37036
36956
|
}
|
|
37037
36957
|
|
|
37038
|
-
module.exports = _possibleConstructorReturn;
|
|
37039
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36958
|
+
module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
37040
36959
|
});
|
|
37041
36960
|
|
|
37042
36961
|
var _possibleConstructorReturn = unwrapExports(possibleConstructorReturn);
|
|
@@ -37046,13 +36965,11 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
37046
36965
|
function _getPrototypeOf(o) {
|
|
37047
36966
|
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
37048
36967
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
37049
|
-
};
|
|
37050
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36968
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
37051
36969
|
return _getPrototypeOf(o);
|
|
37052
36970
|
}
|
|
37053
36971
|
|
|
37054
|
-
module.exports = _getPrototypeOf;
|
|
37055
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
36972
|
+
module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
37056
36973
|
});
|
|
37057
36974
|
|
|
37058
36975
|
var _getPrototypeOf = unwrapExports(getPrototypeOf);
|
|
@@ -37700,10 +37617,14 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
37700
37617
|
return _this.textareaRef.selectionEnd;
|
|
37701
37618
|
});
|
|
37702
37619
|
|
|
37620
|
+
_defineProperty(_assertThisInitialized(_this), "_defaultShouldSubmit", function (event) {
|
|
37621
|
+
return event.key === 'Enter' && !event.shiftKey;
|
|
37622
|
+
});
|
|
37623
|
+
|
|
37703
37624
|
_defineProperty(_assertThisInitialized(_this), "_handleKeyDown", function (event) {
|
|
37704
|
-
var _this$props$
|
|
37705
|
-
|
|
37706
|
-
if (
|
|
37625
|
+
var _this$props$shouldSub = _this.props.shouldSubmit,
|
|
37626
|
+
shouldSubmit = _this$props$shouldSub === void 0 ? _this._defaultShouldSubmit : _this$props$shouldSub;
|
|
37627
|
+
if (shouldSubmit !== null && shouldSubmit !== void 0 && shouldSubmit(event)) return _this._onEnter(event);
|
|
37707
37628
|
if (event.key === ' ') return _this._onSpace(event);
|
|
37708
37629
|
if (event.key === 'Escape') return _this._closeAutocomplete();
|
|
37709
37630
|
});
|
|
@@ -37712,13 +37633,6 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
37712
37633
|
if (!_this.textareaRef) return;
|
|
37713
37634
|
var trigger = _this.state.currentTrigger;
|
|
37714
37635
|
|
|
37715
|
-
var hasFocus = _this.textareaRef.matches(':focus'); // Don't submit if the element doesn't have focus or the shift key is pressed, unless shift+Enter were provided as submit keys
|
|
37716
|
-
|
|
37717
|
-
|
|
37718
|
-
if (!hasFocus || event.shiftKey === true && !_this.keycodeSubmitShiftE || event.shiftKey === true && !_this.props.keycodeSubmitKeys) {
|
|
37719
|
-
return;
|
|
37720
|
-
}
|
|
37721
|
-
|
|
37722
37636
|
if (!trigger || !_this.state.data) {
|
|
37723
37637
|
// trigger a submit
|
|
37724
37638
|
_this._replaceWord();
|
|
@@ -37985,7 +37899,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
37985
37899
|
_defineProperty(_assertThisInitialized(_this), "_cleanUpProps", function () {
|
|
37986
37900
|
var props = _objectSpread({}, _this.props);
|
|
37987
37901
|
|
|
37988
|
-
var notSafe = ['additionalTextareaProps', 'className', 'closeCommandsList', 'closeMentionsList', 'closeOnClickOutside', 'containerClassName', 'containerStyle', 'disableMentions', 'dropdownClassName', 'dropdownStyle', 'grow', 'handleSubmit', 'innerRef', 'itemClassName', 'itemStyle', '
|
|
37902
|
+
var notSafe = ['additionalTextareaProps', 'className', 'closeCommandsList', 'closeMentionsList', 'closeOnClickOutside', 'containerClassName', 'containerStyle', 'disableMentions', 'dropdownClassName', 'dropdownStyle', 'grow', 'handleSubmit', 'innerRef', 'itemClassName', 'itemStyle', 'listClassName', 'listStyle', 'loaderClassName', 'loaderStyle', 'loadingComponent', 'minChar', 'movePopupAsYouType', 'onCaretPositionChange', 'onChange', 'ref', 'replaceWord', 'scrollToItem', 'shouldSubmit', 'showCommandsList', 'showMentionsList', 'SuggestionItem', 'SuggestionList', 'trigger', 'value']; // eslint-disable-next-line
|
|
37989
37903
|
|
|
37990
37904
|
for (var prop in props) {
|
|
37991
37905
|
if (notSafe.includes(prop)) delete props[prop];
|
|
@@ -37997,8 +37911,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
37997
37911
|
_defineProperty(_assertThisInitialized(_this), "_isCommand", function (text) {
|
|
37998
37912
|
if (text[0] !== '/') return false;
|
|
37999
37913
|
var tokens = text.split(' ');
|
|
38000
|
-
|
|
38001
|
-
return true;
|
|
37914
|
+
return tokens.length <= 1;
|
|
38002
37915
|
});
|
|
38003
37916
|
|
|
38004
37917
|
_defineProperty(_assertThisInitialized(_this), "_changeHandler", function (e) {
|
|
@@ -38204,9 +38117,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
38204
38117
|
currentTrigger: null,
|
|
38205
38118
|
data: null,
|
|
38206
38119
|
dataLoading: false,
|
|
38207
|
-
keycodeSubmitShiftE: false,
|
|
38208
38120
|
left: null,
|
|
38209
|
-
listenerIndex: {},
|
|
38210
38121
|
selectionEnd: 0,
|
|
38211
38122
|
selectionStart: 0,
|
|
38212
38123
|
top: null,
|
|
@@ -38265,7 +38176,10 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
38265
38176
|
var _this$state7 = this.state,
|
|
38266
38177
|
dataLoading = _this$state7.dataLoading,
|
|
38267
38178
|
value = _this$state7.value;
|
|
38268
|
-
if (!this.props.grow) maxRows = 1;
|
|
38179
|
+
if (!this.props.grow) maxRows = 1; // By setting defaultValue to undefined, avoid error:
|
|
38180
|
+
// ForwardRef(TextareaAutosize) contains a textarea with both value and defaultValue props.
|
|
38181
|
+
// Textarea elements must be either controlled or uncontrolled
|
|
38182
|
+
|
|
38269
38183
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
38270
38184
|
className: "rta ".concat(dataLoading === true ? 'rta--loading' : '', " ").concat(containerClassName || ''),
|
|
38271
38185
|
style: containerStyle
|
|
@@ -38287,7 +38201,9 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
38287
38201
|
},
|
|
38288
38202
|
style: style,
|
|
38289
38203
|
value: value
|
|
38290
|
-
}, this.props.additionalTextareaProps
|
|
38204
|
+
}, this.props.additionalTextareaProps, {
|
|
38205
|
+
defaultValue: undefined
|
|
38206
|
+
})));
|
|
38291
38207
|
}
|
|
38292
38208
|
}], [{
|
|
38293
38209
|
key: "getDerivedStateFromProps",
|
|
@@ -38333,7 +38249,6 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
38333
38249
|
dropdownStyle: propTypes$1.object,
|
|
38334
38250
|
itemClassName: propTypes$1.string,
|
|
38335
38251
|
itemStyle: propTypes$1.object,
|
|
38336
|
-
keycodeSubmitKeys: propTypes$1.array,
|
|
38337
38252
|
listClassName: propTypes$1.string,
|
|
38338
38253
|
listStyle: propTypes$1.object,
|
|
38339
38254
|
loaderClassName: propTypes$1.string,
|
|
@@ -38344,6 +38259,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
38344
38259
|
onCaretPositionChange: propTypes$1.func,
|
|
38345
38260
|
onChange: propTypes$1.func,
|
|
38346
38261
|
onSelect: propTypes$1.func,
|
|
38262
|
+
shouldSubmit: propTypes$1.func,
|
|
38347
38263
|
style: propTypes$1.object,
|
|
38348
38264
|
SuggestionList: propTypes$1.elementType,
|
|
38349
38265
|
trigger: triggerPropsCheck,
|
|
@@ -39324,7 +39240,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
39324
39240
|
return type;
|
|
39325
39241
|
}).join() : '') + pinned + reply_count + status + (updated_at && (isDayOrMoment(updated_at) || isDate(updated_at))
|
|
39326
39242
|
? updated_at.toISOString()
|
|
39327
|
-
: updated_at || '') + (user === null || user === void 0 ? void 0 : user.
|
|
39243
|
+
: updated_at || '') + (user === null || user === void 0 ? void 0 : user.updated_at);
|
|
39328
39244
|
})
|
|
39329
39245
|
.join();
|
|
39330
39246
|
var memoizedThreadMessageData = threadMessages
|
|
@@ -39335,7 +39251,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
39335
39251
|
return type;
|
|
39336
39252
|
}).join() : '') + pinned + status + (updated_at && (isDayOrMoment(updated_at) || isDate(updated_at))
|
|
39337
39253
|
? updated_at.toISOString()
|
|
39338
|
-
: updated_at || '') + (user === null || user === void 0 ? void 0 : user.
|
|
39254
|
+
: updated_at || '') + (user === null || user === void 0 ? void 0 : user.updated_at);
|
|
39339
39255
|
})
|
|
39340
39256
|
.join();
|
|
39341
39257
|
var channelStateContext = React.useMemo(function () { return ({
|
|
@@ -39753,7 +39669,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
39753
39669
|
return true;
|
|
39754
39670
|
};
|
|
39755
39671
|
var areMessagePropsEqual = function (prevProps, nextProps) {
|
|
39756
|
-
var _a, _b, _c, _d, _e, _f
|
|
39672
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39757
39673
|
var prevMessage = prevProps.message, prevMessageUI = prevProps.Message;
|
|
39758
39674
|
var nextMessage = nextProps.message, nextMessageUI = nextProps.Message;
|
|
39759
39675
|
if (prevMessageUI !== nextMessageUI)
|
|
@@ -39772,8 +39688,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
39772
39688
|
prevMessage.text === nextMessage.text &&
|
|
39773
39689
|
prevMessage.type === nextMessage.type &&
|
|
39774
39690
|
prevMessage.updated_at === nextMessage.updated_at &&
|
|
39775
|
-
((_e = prevMessage.user) === null || _e === void 0 ? void 0 : _e.
|
|
39776
|
-
((_g = prevMessage.user) === null || _g === void 0 ? void 0 : _g.name) === ((_h = nextMessage.user) === null || _h === void 0 ? void 0 : _h.name);
|
|
39691
|
+
((_e = prevMessage.user) === null || _e === void 0 ? void 0 : _e.updated_at) === ((_f = nextMessage.user) === null || _f === void 0 ? void 0 : _f.updated_at);
|
|
39777
39692
|
if (!messagesAreEqual)
|
|
39778
39693
|
return false;
|
|
39779
39694
|
var deepEqualProps = reactFastCompare(nextProps.readBy, prevProps.readBy) &&
|
|
@@ -39787,7 +39702,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
39787
39702
|
);
|
|
39788
39703
|
};
|
|
39789
39704
|
var areMessageUIPropsEqual = function (prevProps, nextProps) {
|
|
39790
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
39705
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
39791
39706
|
var prevLastReceivedId = prevProps.lastReceivedId, prevMessage = prevProps.message;
|
|
39792
39707
|
var nextLastReceivedId = nextProps.lastReceivedId, nextMessage = nextProps.message;
|
|
39793
39708
|
if (prevProps.editing !== nextProps.editing)
|
|
@@ -39807,7 +39722,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
39807
39722
|
prevLastReceivedId !== nextLastReceivedId) {
|
|
39808
39723
|
return false;
|
|
39809
39724
|
}
|
|
39810
|
-
|
|
39725
|
+
return (prevMessage.deleted_at === nextMessage.deleted_at &&
|
|
39811
39726
|
((_e = prevMessage.latest_reactions) === null || _e === void 0 ? void 0 : _e.length) === ((_f = nextMessage.latest_reactions) === null || _f === void 0 ? void 0 : _f.length) &&
|
|
39812
39727
|
((_g = prevMessage.own_reactions) === null || _g === void 0 ? void 0 : _g.length) === ((_h = nextMessage.own_reactions) === null || _h === void 0 ? void 0 : _h.length) &&
|
|
39813
39728
|
prevMessage.pinned === nextMessage.pinned &&
|
|
@@ -39816,11 +39731,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
39816
39731
|
prevMessage.text === nextMessage.text &&
|
|
39817
39732
|
prevMessage.type === nextMessage.type &&
|
|
39818
39733
|
prevMessage.updated_at === nextMessage.updated_at &&
|
|
39819
|
-
((_j = prevMessage.user) === null || _j === void 0 ? void 0 : _j.
|
|
39820
|
-
((_l = prevMessage.user) === null || _l === void 0 ? void 0 : _l.name) === ((_m = nextMessage.user) === null || _m === void 0 ? void 0 : _m.name);
|
|
39821
|
-
if (!messagesAreEqual)
|
|
39822
|
-
return false;
|
|
39823
|
-
return true;
|
|
39734
|
+
((_j = prevMessage.user) === null || _j === void 0 ? void 0 : _j.updated_at) === ((_k = nextMessage.user) === null || _k === void 0 ? void 0 : _k.updated_at));
|
|
39824
39735
|
};
|
|
39825
39736
|
var messageHasReactions = function (message) { return !!(message === null || message === void 0 ? void 0 : message.latest_reactions) && !!message.latest_reactions.length; };
|
|
39826
39737
|
var messageHasAttachments = function (message) { return !!(message === null || message === void 0 ? void 0 : message.attachments) && !!message.attachments.length; };
|
|
@@ -40781,8 +40692,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
40781
40692
|
};
|
|
40782
40693
|
}
|
|
40783
40694
|
|
|
40784
|
-
module.exports = _interopRequireDefault;
|
|
40785
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
40695
|
+
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
40786
40696
|
});
|
|
40787
40697
|
|
|
40788
40698
|
unwrapExports(interopRequireDefault);
|
|
@@ -42208,7 +42118,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
42208
42118
|
innerRef.current = ref;
|
|
42209
42119
|
}
|
|
42210
42120
|
}, [innerRef]);
|
|
42211
|
-
return (React__default['default'].createElement(ReactTextareaAutocomplete, { additionalTextareaProps: messageInput.additionalTextareaProps, "aria-label": cooldownRemaining ? t('Slow Mode ON') : placeholder, className: 'str-chat__textarea__textarea', closeCommandsList: messageInput.closeCommandsList, closeMentionsList: messageInput.closeMentionsList, containerClassName: 'str-chat__textarea', disabled: disabled || !!cooldownRemaining, disableMentions: messageInput.disableMentions, dropdownClassName: 'str-chat__emojisearch', grow: messageInput.grow, handleSubmit: props.handleSubmit || messageInput.handleSubmit, innerRef: updateInnerRef, itemClassName: 'str-chat__emojisearch__item',
|
|
42121
|
+
return (React__default['default'].createElement(ReactTextareaAutocomplete, { additionalTextareaProps: messageInput.additionalTextareaProps, "aria-label": cooldownRemaining ? t('Slow Mode ON') : placeholder, className: 'str-chat__textarea__textarea', closeCommandsList: messageInput.closeCommandsList, closeMentionsList: messageInput.closeMentionsList, containerClassName: 'str-chat__textarea', disabled: disabled || !!cooldownRemaining, disableMentions: messageInput.disableMentions, dropdownClassName: 'str-chat__emojisearch', grow: messageInput.grow, handleSubmit: props.handleSubmit || messageInput.handleSubmit, innerRef: updateInnerRef, itemClassName: 'str-chat__emojisearch__item', listClassName: 'str-chat__emojisearch__list', loadingComponent: LoadingIndicator, maxRows: messageInput.maxRows, minChar: 0, onBlur: props.onBlur, onChange: props.onChange || messageInput.handleChange, onFocus: props.onFocus, onPaste: props.onPaste || messageInput.onPaste, placeholder: cooldownRemaining ? t('Slow Mode ON') : placeholder, replaceWord: emojiReplace, rows: props.rows || 1, shouldSubmit: messageInput.shouldSubmit, showCommandsList: messageInput.showCommandsList, showMentionsList: messageInput.showMentionsList, SuggestionItem: SuggestionItem, SuggestionList: SuggestionList, trigger: messageInput.autocompleteTriggers || {}, value: props.value || messageInput.text }));
|
|
42212
42122
|
};
|
|
42213
42123
|
var ChatAutoComplete = React__default['default'].memo(UnMemoizedChatAutoComplete);
|
|
42214
42124
|
|
|
@@ -42536,7 +42446,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
42536
42446
|
Array.from(files)
|
|
42537
42447
|
.slice(0, maxFilesLeft)
|
|
42538
42448
|
.forEach(function (file) {
|
|
42539
|
-
var id =
|
|
42449
|
+
var id = nanoid();
|
|
42540
42450
|
if (file.type.startsWith('image/') &&
|
|
42541
42451
|
!file.type.endsWith('.photoshop') // photoshop files begin with 'image/'
|
|
42542
42452
|
) {
|
|
@@ -42787,25 +42697,27 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
42787
42697
|
_a.sent();
|
|
42788
42698
|
addNotification(t('Edit message request failed'), 'error');
|
|
42789
42699
|
return [3 /*break*/, 4];
|
|
42790
|
-
case 4: return [3 /*break*/,
|
|
42700
|
+
case 4: return [3 /*break*/, 13];
|
|
42791
42701
|
case 5:
|
|
42792
|
-
_a.trys.push([5,
|
|
42702
|
+
_a.trys.push([5, 12, , 13]);
|
|
42793
42703
|
dispatch({ type: 'clear' });
|
|
42794
|
-
if (!overrideSubmitHandler) return [3 /*break*/,
|
|
42795
|
-
overrideSubmitHandler(__assign$2(__assign$2({}, updatedMessage), { parent: parent }), channel.cid);
|
|
42796
|
-
|
|
42797
|
-
case 6: return [4 /*yield*/, sendMessage(__assign$2(__assign$2({}, updatedMessage), { parent: parent }), customMessageData)];
|
|
42798
|
-
case 7:
|
|
42704
|
+
if (!overrideSubmitHandler) return [3 /*break*/, 7];
|
|
42705
|
+
return [4 /*yield*/, overrideSubmitHandler(__assign$2(__assign$2({}, updatedMessage), { parent: parent }), channel.cid, customMessageData)];
|
|
42706
|
+
case 6:
|
|
42799
42707
|
_a.sent();
|
|
42800
|
-
|
|
42708
|
+
return [3 /*break*/, 9];
|
|
42709
|
+
case 7: return [4 /*yield*/, sendMessage(__assign$2(__assign$2({}, updatedMessage), { parent: parent }), customMessageData)];
|
|
42801
42710
|
case 8:
|
|
42802
|
-
|
|
42803
|
-
|
|
42711
|
+
_a.sent();
|
|
42712
|
+
_a.label = 9;
|
|
42804
42713
|
case 9:
|
|
42714
|
+
if (!publishTypingEvent) return [3 /*break*/, 11];
|
|
42715
|
+
return [4 /*yield*/, channel.stopTyping()];
|
|
42716
|
+
case 10:
|
|
42805
42717
|
_a.sent();
|
|
42806
|
-
_a.label =
|
|
42807
|
-
case
|
|
42808
|
-
case
|
|
42718
|
+
_a.label = 11;
|
|
42719
|
+
case 11: return [3 /*break*/, 13];
|
|
42720
|
+
case 12:
|
|
42809
42721
|
_a.sent();
|
|
42810
42722
|
dispatch({
|
|
42811
42723
|
getNewText: function () { return text; },
|
|
@@ -42817,16 +42729,18 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
42817
42729
|
});
|
|
42818
42730
|
}
|
|
42819
42731
|
addNotification(t('Send message request failed'), 'error');
|
|
42820
|
-
return [3 /*break*/,
|
|
42821
|
-
case
|
|
42732
|
+
return [3 /*break*/, 13];
|
|
42733
|
+
case 13: return [2 /*return*/];
|
|
42822
42734
|
}
|
|
42823
42735
|
});
|
|
42824
42736
|
}); };
|
|
42825
42737
|
return { handleSubmit: handleSubmit };
|
|
42826
42738
|
};
|
|
42827
42739
|
|
|
42828
|
-
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var usePasteHandler = function (uploadNewFiles, insertText) {
|
|
42740
|
+
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var usePasteHandler = function (uploadNewFiles, insertText, isUploadEnabled) {
|
|
42829
42741
|
var onPaste = React.useCallback(function (clipboardEvent) {
|
|
42742
|
+
if (!isUploadEnabled)
|
|
42743
|
+
return;
|
|
42830
42744
|
(function (event) { return __awaiter$1(void 0, void 0, void 0, function () {
|
|
42831
42745
|
var items, plainTextPromise, _loop_1, i, state_1, fileLikes, pastedText;
|
|
42832
42746
|
return __generator$1(this, function (_a) {
|
|
@@ -42876,30 +42790,31 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
42876
42790
|
|
|
42877
42791
|
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var emptyFileUploads = {};
|
|
42878
42792
|
var emptyImageUploads = {};
|
|
42793
|
+
var makeEmptyMessageInputState = function () { return ({
|
|
42794
|
+
attachments: [],
|
|
42795
|
+
emojiPickerIsOpen: false,
|
|
42796
|
+
fileOrder: [],
|
|
42797
|
+
fileUploads: __assign$2({}, emptyFileUploads),
|
|
42798
|
+
imageOrder: [],
|
|
42799
|
+
imageUploads: __assign$2({}, emptyImageUploads),
|
|
42800
|
+
mentioned_users: [],
|
|
42801
|
+
setText: function () { return null; },
|
|
42802
|
+
text: '',
|
|
42803
|
+
}); };
|
|
42879
42804
|
/**
|
|
42880
42805
|
* Initializes the state. Empty if the message prop is falsy.
|
|
42881
42806
|
*/
|
|
42882
42807
|
var initState = function (message) {
|
|
42883
42808
|
var _a, _b, _c;
|
|
42884
42809
|
if (!message) {
|
|
42885
|
-
return
|
|
42886
|
-
attachments: [],
|
|
42887
|
-
emojiPickerIsOpen: false,
|
|
42888
|
-
fileOrder: [],
|
|
42889
|
-
fileUploads: __assign$2({}, emptyFileUploads),
|
|
42890
|
-
imageOrder: [],
|
|
42891
|
-
imageUploads: __assign$2({}, emptyImageUploads),
|
|
42892
|
-
mentioned_users: [],
|
|
42893
|
-
setText: function () { return null; },
|
|
42894
|
-
text: '',
|
|
42895
|
-
};
|
|
42810
|
+
return makeEmptyMessageInputState();
|
|
42896
42811
|
}
|
|
42897
42812
|
// if message prop is defined, get image uploads, file uploads, text, etc.
|
|
42898
42813
|
var imageUploads = ((_a = message.attachments) === null || _a === void 0 ? void 0 : _a.filter(function (_a) {
|
|
42899
42814
|
var type = _a.type;
|
|
42900
42815
|
return type === 'image';
|
|
42901
42816
|
}).reduce(function (acc, attachment) {
|
|
42902
|
-
var id =
|
|
42817
|
+
var id = nanoid();
|
|
42903
42818
|
acc[id] = {
|
|
42904
42819
|
file: {
|
|
42905
42820
|
name: attachment.fallback || '',
|
|
@@ -42915,7 +42830,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
42915
42830
|
var type = _a.type;
|
|
42916
42831
|
return type === 'file';
|
|
42917
42832
|
}).reduce(function (acc, attachment) {
|
|
42918
|
-
var id =
|
|
42833
|
+
var id = nanoid();
|
|
42919
42834
|
acc[id] = {
|
|
42920
42835
|
file: {
|
|
42921
42836
|
name: attachment.title || '',
|
|
@@ -42957,16 +42872,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
42957
42872
|
case 'setText':
|
|
42958
42873
|
return __assign$2(__assign$2({}, state), { text: action.getNewText(state.text) });
|
|
42959
42874
|
case 'clear':
|
|
42960
|
-
return
|
|
42961
|
-
attachments: [],
|
|
42962
|
-
emojiPickerIsOpen: false,
|
|
42963
|
-
fileOrder: [],
|
|
42964
|
-
fileUploads: __assign$2({}, emptyFileUploads),
|
|
42965
|
-
imageOrder: [],
|
|
42966
|
-
imageUploads: __assign$2({}, emptyImageUploads),
|
|
42967
|
-
mentioned_users: [],
|
|
42968
|
-
text: '',
|
|
42969
|
-
};
|
|
42875
|
+
return makeEmptyMessageInputState();
|
|
42970
42876
|
case 'setImageUpload': {
|
|
42971
42877
|
var imageAlreadyExists = state.imageUploads[action.id];
|
|
42972
42878
|
if (!imageAlreadyExists && !action.file)
|
|
@@ -43009,9 +42915,14 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
43009
42915
|
* hook for MessageInput state
|
|
43010
42916
|
*/
|
|
43011
42917
|
var useMessageInputState = function (props) {
|
|
43012
|
-
var closeEmojiPickerOnClick = props.closeEmojiPickerOnClick, message = props.message;
|
|
42918
|
+
var additionalTextareaProps = props.additionalTextareaProps, closeEmojiPickerOnClick = props.closeEmojiPickerOnClick, message = props.message;
|
|
43013
42919
|
var _a = useChannelStateContext('useMessageInputState'), _b = _a.channelCapabilities, channelCapabilities = _b === void 0 ? {} : _b, channelConfig = _a.channelConfig;
|
|
43014
|
-
var
|
|
42920
|
+
var defaultValue = additionalTextareaProps === null || additionalTextareaProps === void 0 ? void 0 : additionalTextareaProps.defaultValue;
|
|
42921
|
+
var initialStateValue = message ||
|
|
42922
|
+
(Array.isArray(defaultValue)
|
|
42923
|
+
? { text: defaultValue.join('') }
|
|
42924
|
+
: { text: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.toString() });
|
|
42925
|
+
var _c = React.useReducer(messageInputReducer, initialStateValue, initState), state = _c[0], dispatch = _c[1];
|
|
43015
42926
|
var _d = useMessageInputText(props, state, dispatch), handleChange = _d.handleChange, insertText = _d.insertText, textareaRef = _d.textareaRef;
|
|
43016
42927
|
var _e = React.useState(false), showCommandsList = _e[0], setShowCommandsList = _e[1];
|
|
43017
42928
|
var _f = React.useState(false), showMentionsList = _f[0], setShowMentionsList = _f[1];
|
|
@@ -43034,8 +42945,8 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
43034
42945
|
var _g = useEmojiPicker(state, dispatch, insertText, textareaRef, closeEmojiPickerOnClick), closeEmojiPicker = _g.closeEmojiPicker, emojiPickerRef = _g.emojiPickerRef, handleEmojiKeyDown = _g.handleEmojiKeyDown, onSelectEmoji = _g.onSelectEmoji, openEmojiPicker = _g.openEmojiPicker;
|
|
43035
42946
|
var _h = useAttachments(props, state, dispatch, textareaRef), maxFilesLeft = _h.maxFilesLeft, numberOfUploads = _h.numberOfUploads, removeFile = _h.removeFile, removeImage = _h.removeImage, uploadFile = _h.uploadFile, uploadImage = _h.uploadImage, uploadNewFiles = _h.uploadNewFiles;
|
|
43036
42947
|
var handleSubmit = useSubmitHandler(props, state, dispatch, numberOfUploads).handleSubmit;
|
|
43037
|
-
var onPaste = usePasteHandler(uploadNewFiles, insertText).onPaste;
|
|
43038
42948
|
var isUploadEnabled = (channelConfig === null || channelConfig === void 0 ? void 0 : channelConfig.uploads) !== false && channelCapabilities['upload-file'] !== false;
|
|
42949
|
+
var onPaste = usePasteHandler(uploadNewFiles, insertText, isUploadEnabled).onPaste;
|
|
43039
42950
|
var onSelectUser = React.useCallback(function (item) {
|
|
43040
42951
|
dispatch({ type: 'addMentionedUser', user: item });
|
|
43041
42952
|
}, []);
|
|
@@ -43133,7 +43044,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
43133
43044
|
};
|
|
43134
43045
|
|
|
43135
43046
|
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useCreateMessageInputContext = function (value) {
|
|
43136
|
-
var additionalTextareaProps = value.additionalTextareaProps, attachments = value.attachments, autocompleteTriggers = value.autocompleteTriggers, clearEditingState = value.clearEditingState, closeCommandsList = value.closeCommandsList, closeEmojiPicker = value.closeEmojiPicker, closeMentionsList = value.closeMentionsList, cooldownInterval = value.cooldownInterval, cooldownRemaining = value.cooldownRemaining, disabled = value.disabled, disableMentions = value.disableMentions, doFileUploadRequest = value.doFileUploadRequest, doImageUploadRequest = value.doImageUploadRequest, emojiIndex = value.emojiIndex, emojiPickerIsOpen = value.emojiPickerIsOpen, emojiPickerRef = value.emojiPickerRef, errorHandler = value.errorHandler, fileOrder = value.fileOrder, fileUploads = value.fileUploads, focus = value.focus, grow = value.grow, handleChange = value.handleChange, handleEmojiKeyDown = value.handleEmojiKeyDown, handleSubmit = value.handleSubmit, imageOrder = value.imageOrder, imageUploads = value.imageUploads, insertText = value.insertText, isUploadEnabled = value.isUploadEnabled,
|
|
43047
|
+
var additionalTextareaProps = value.additionalTextareaProps, attachments = value.attachments, autocompleteTriggers = value.autocompleteTriggers, clearEditingState = value.clearEditingState, closeCommandsList = value.closeCommandsList, closeEmojiPicker = value.closeEmojiPicker, closeMentionsList = value.closeMentionsList, cooldownInterval = value.cooldownInterval, cooldownRemaining = value.cooldownRemaining, disabled = value.disabled, disableMentions = value.disableMentions, doFileUploadRequest = value.doFileUploadRequest, doImageUploadRequest = value.doImageUploadRequest, emojiIndex = value.emojiIndex, emojiPickerIsOpen = value.emojiPickerIsOpen, emojiPickerRef = value.emojiPickerRef, errorHandler = value.errorHandler, fileOrder = value.fileOrder, fileUploads = value.fileUploads, focus = value.focus, grow = value.grow, handleChange = value.handleChange, handleEmojiKeyDown = value.handleEmojiKeyDown, handleSubmit = value.handleSubmit, imageOrder = value.imageOrder, imageUploads = value.imageUploads, insertText = value.insertText, isUploadEnabled = value.isUploadEnabled, maxFilesLeft = value.maxFilesLeft, maxRows = value.maxRows, mentionAllAppUsers = value.mentionAllAppUsers, mentioned_users = value.mentioned_users, mentionQueryParams = value.mentionQueryParams, message = value.message, noFiles = value.noFiles, numberOfUploads = value.numberOfUploads, onPaste = value.onPaste, onSelectEmoji = value.onSelectEmoji, onSelectUser = value.onSelectUser, openCommandsList = value.openCommandsList, openEmojiPicker = value.openEmojiPicker, openMentionsList = value.openMentionsList, overrideSubmitHandler = value.overrideSubmitHandler, parent = value.parent, publishTypingEvent = value.publishTypingEvent, removeFile = value.removeFile, removeImage = value.removeImage, setCooldownRemaining = value.setCooldownRemaining, setText = value.setText, shouldSubmit = value.shouldSubmit, showCommandsList = value.showCommandsList, showMentionsList = value.showMentionsList, text = value.text, textareaRef = value.textareaRef, uploadFile = value.uploadFile, uploadImage = value.uploadImage, uploadNewFiles = value.uploadNewFiles, useMentionsTransliteration = value.useMentionsTransliteration;
|
|
43137
43048
|
var editing = message === null || message === void 0 ? void 0 : message.editing;
|
|
43138
43049
|
var fileUploadsValue = Object.entries(fileUploads)
|
|
43139
43050
|
// eslint-disable-next-line
|
|
@@ -43180,7 +43091,6 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
43180
43091
|
imageUploads: imageUploads,
|
|
43181
43092
|
insertText: insertText,
|
|
43182
43093
|
isUploadEnabled: isUploadEnabled,
|
|
43183
|
-
keycodeSubmitKeys: keycodeSubmitKeys,
|
|
43184
43094
|
maxFilesLeft: maxFilesLeft,
|
|
43185
43095
|
maxRows: maxRows,
|
|
43186
43096
|
mentionAllAppUsers: mentionAllAppUsers,
|
|
@@ -43202,6 +43112,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
43202
43112
|
removeImage: removeImage,
|
|
43203
43113
|
setCooldownRemaining: setCooldownRemaining,
|
|
43204
43114
|
setText: setText,
|
|
43115
|
+
shouldSubmit: shouldSubmit,
|
|
43205
43116
|
showCommandsList: showCommandsList,
|
|
43206
43117
|
showMentionsList: showMentionsList,
|
|
43207
43118
|
text: text,
|
|
@@ -43618,7 +43529,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
43618
43529
|
if (typeof text !== 'string' || (type !== 'success' && type !== 'error')) {
|
|
43619
43530
|
return;
|
|
43620
43531
|
}
|
|
43621
|
-
var id =
|
|
43532
|
+
var id = nanoid();
|
|
43622
43533
|
setNotifications(function (prevNotifications) { return __spreadArray(__spreadArray([], prevNotifications), [{ id: id, text: text, type: type }]); });
|
|
43623
43534
|
var timeout = setTimeout(function () {
|
|
43624
43535
|
return setNotifications(function (prevNotifications) {
|
|
@@ -43987,7 +43898,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
43987
43898
|
});
|
|
43988
43899
|
}); };
|
|
43989
43900
|
var createMessagePreview = function (text, attachments, parent, mentioned_users) {
|
|
43990
|
-
var clientSideID = client.userID + "-" +
|
|
43901
|
+
var clientSideID = client.userID + "-" + nanoid();
|
|
43991
43902
|
return __assign$2({ __html: text, attachments: attachments, created_at: new Date(), html: text, id: clientSideID, mentioned_users: mentioned_users, reactions: [], status: 'sending', text: text, type: 'regular', user: client.user }, ((parent === null || parent === void 0 ? void 0 : parent.id) ? { parent_id: parent.id } : null));
|
|
43992
43903
|
};
|
|
43993
43904
|
var sendMessage = function (_a, customMessageData) {
|
|
@@ -44751,8 +44662,10 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
44751
44662
|
var channel = props.channel, _a = props.Preview, Preview = _a === void 0 ? ChannelPreviewMessenger : _a, channelUpdateCount = props.channelUpdateCount;
|
|
44752
44663
|
var _b = useChatContext('ChannelPreview'), activeChannel = _b.channel, client = _b.client, setActiveChannel = _b.setActiveChannel;
|
|
44753
44664
|
var _c = useTranslationContext('ChannelPreview'), t = _c.t, userLanguage = _c.userLanguage;
|
|
44754
|
-
var _d = React.useState(channel.
|
|
44755
|
-
var _e = React.useState(
|
|
44665
|
+
var _d = React.useState(getDisplayTitle(channel, client.user)), displayTitle = _d[0], setDisplayTitle = _d[1];
|
|
44666
|
+
var _e = React.useState(getDisplayImage(channel, client.user)), displayImage = _e[0], setDisplayImage = _e[1];
|
|
44667
|
+
var _f = React.useState(channel.state.messages[channel.state.messages.length - 1]), lastMessage = _f[0], setLastMessage = _f[1];
|
|
44668
|
+
var _g = React.useState(0), unread = _g[0], setUnread = _g[1];
|
|
44756
44669
|
var isActive = (activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.cid) === channel.cid;
|
|
44757
44670
|
var muted = useIsChannelMuted(channel).muted;
|
|
44758
44671
|
React.useEffect(function () {
|
|
@@ -44789,10 +44702,24 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
44789
44702
|
channel.off('message.deleted', handleEvent);
|
|
44790
44703
|
};
|
|
44791
44704
|
}, [refreshUnreadCount, channelUpdateCount]);
|
|
44705
|
+
React.useEffect(function () {
|
|
44706
|
+
var handleEvent = function () {
|
|
44707
|
+
setDisplayTitle(function (displayTitle) {
|
|
44708
|
+
var newDisplayTitle = getDisplayTitle(channel, client.user);
|
|
44709
|
+
return displayTitle !== newDisplayTitle ? newDisplayTitle : displayTitle;
|
|
44710
|
+
});
|
|
44711
|
+
setDisplayImage(function (displayImage) {
|
|
44712
|
+
var newDisplayImage = getDisplayImage(channel, client.user);
|
|
44713
|
+
return displayImage !== newDisplayImage ? newDisplayImage : displayImage;
|
|
44714
|
+
});
|
|
44715
|
+
};
|
|
44716
|
+
client.on('user.updated', handleEvent);
|
|
44717
|
+
return function () {
|
|
44718
|
+
client.off('user.updated', handleEvent);
|
|
44719
|
+
};
|
|
44720
|
+
}, []);
|
|
44792
44721
|
if (!Preview)
|
|
44793
44722
|
return null;
|
|
44794
|
-
var displayImage = getDisplayImage(channel, client.user);
|
|
44795
|
-
var displayTitle = getDisplayTitle(channel, client.user);
|
|
44796
44723
|
var latestMessage = getLatestMessagePreview(channel, t, userLanguage);
|
|
44797
44724
|
return (React__default['default'].createElement(Preview, __assign$2({}, props, { active: isActive, displayImage: displayImage, displayTitle: displayTitle, lastMessage: lastMessage, latestMessage: latestMessage, setActiveChannel: setActiveChannel, unread: unread })));
|
|
44798
44725
|
};
|
|
@@ -45135,7 +45062,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
45135
45062
|
|
|
45136
45063
|
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
|
|
45137
45064
|
|
|
45138
|
-
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version = '
|
|
45065
|
+
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version = '9.0.0';
|
|
45139
45066
|
|
|
45140
45067
|
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useChat = function (_a) {
|
|
45141
45068
|
var _b, _c;
|
|
@@ -45964,10 +45891,10 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
45964
45891
|
var makeDateMessageId = function (date) {
|
|
45965
45892
|
var idSuffix;
|
|
45966
45893
|
try {
|
|
45967
|
-
idSuffix = !date ?
|
|
45894
|
+
idSuffix = !date ? nanoid() : date instanceof Date ? date.toISOString() : date;
|
|
45968
45895
|
}
|
|
45969
45896
|
catch (e) {
|
|
45970
|
-
idSuffix =
|
|
45897
|
+
idSuffix = nanoid();
|
|
45971
45898
|
}
|
|
45972
45899
|
return CUSTOM_MESSAGE_TYPE.date + "-" + idSuffix;
|
|
45973
45900
|
};
|
|
@@ -48093,7 +48020,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
48093
48020
|
var ThreadInner = function (props) {
|
|
48094
48021
|
var additionalMessageInputProps = props.additionalMessageInputProps, additionalMessageListProps = props.additionalMessageListProps, additionalParentMessageProps = props.additionalParentMessageProps, additionalVirtualizedMessageListProps = props.additionalVirtualizedMessageListProps, _a = props.autoFocus, autoFocus = _a === void 0 ? true : _a, _b = props.enableDateSeparator, enableDateSeparator = _b === void 0 ? false : _b, _c = props.fullWidth, fullWidth = _c === void 0 ? false : _c, PropInput = props.Input, PropMessage = props.Message, virtualized = props.virtualized;
|
|
48095
48022
|
var _d = useChannelStateContext('Thread'), thread = _d.thread, threadHasMore = _d.threadHasMore, threadLoadingMore = _d.threadLoadingMore, threadMessages = _d.threadMessages;
|
|
48096
|
-
var _e = useChannelActionContext('Thread'), closeThread = _e.closeThread, loadMoreThread = _e.loadMoreThread;
|
|
48023
|
+
var _e = useChannelActionContext('Thread'), closeThread = _e.closeThread, loadMoreThread = _e.loadMoreThread, sendMessage = _e.sendMessage;
|
|
48097
48024
|
var customClasses = useChatContext('Thread').customClasses;
|
|
48098
48025
|
var _f = useComponentContext('Thread'), ContextInput = _f.ThreadInput, ContextMessage = _f.Message, _g = _f.ThreadHeader, ThreadHeader = _g === void 0 ? DefaultThreadHeader : _g, _h = _f.ThreadStart, ThreadStart = _h === void 0 ? DefaultThreadStart : _h, _j = _f.VirtualMessage, VirtualMessage = _j === void 0 ? FixedHeightMessage : _j;
|
|
48099
48026
|
var messageList = React.useRef(null);
|
|
@@ -48106,15 +48033,19 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
48106
48033
|
loadMoreThread();
|
|
48107
48034
|
}
|
|
48108
48035
|
}, []);
|
|
48109
|
-
|
|
48110
|
-
|
|
48111
|
-
|
|
48112
|
-
|
|
48113
|
-
|
|
48114
|
-
|
|
48036
|
+
var threadSubmitHandler = function (message, _, customMessageData) { return __awaiter$1(void 0, void 0, void 0, function () {
|
|
48037
|
+
return __generator$1(this, function (_a) {
|
|
48038
|
+
switch (_a.label) {
|
|
48039
|
+
case 0: return [4 /*yield*/, sendMessage(message, customMessageData)];
|
|
48040
|
+
case 1:
|
|
48041
|
+
_a.sent();
|
|
48042
|
+
if (messageList.current) {
|
|
48043
|
+
messageList.current.scrollTop = messageList.current.scrollHeight;
|
|
48044
|
+
}
|
|
48045
|
+
return [2 /*return*/];
|
|
48115
48046
|
}
|
|
48116
|
-
}
|
|
48117
|
-
}
|
|
48047
|
+
});
|
|
48048
|
+
}); };
|
|
48118
48049
|
if (!thread)
|
|
48119
48050
|
return null;
|
|
48120
48051
|
var threadClass = (customClasses === null || customClasses === void 0 ? void 0 : customClasses.thread) || 'str-chat__thread';
|
|
@@ -48124,7 +48055,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
48124
48055
|
React__default['default'].createElement(Message, __assign$2({ initialMessage: true, message: thread, Message: ThreadMessage || FallbackMessage, threadList: true }, additionalParentMessageProps)),
|
|
48125
48056
|
React__default['default'].createElement(ThreadStart, null),
|
|
48126
48057
|
React__default['default'].createElement(ThreadMessageList, __assign$2({ disableDateSeparator: !enableDateSeparator, hasMore: threadHasMore, loadingMore: threadLoadingMore, loadMore: loadMoreThread, Message: ThreadMessage || FallbackMessage, messages: threadMessages || [], threadList: true }, (virtualized ? additionalVirtualizedMessageListProps : additionalMessageListProps)))),
|
|
48127
|
-
React__default['default'].createElement(MessageInput, __assign$2({ focus: autoFocus, Input: ThreadInput, parent: thread, publishTypingEvent: false }, additionalMessageInputProps))));
|
|
48058
|
+
React__default['default'].createElement(MessageInput, __assign$2({ focus: autoFocus, Input: ThreadInput, overrideSubmitHandler: threadSubmitHandler, parent: thread, publishTypingEvent: false }, additionalMessageInputProps))));
|
|
48128
48059
|
};
|
|
48129
48060
|
|
|
48130
48061
|
window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
|
|
@@ -48557,19 +48488,17 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
48557
48488
|
var interopRequireWildcard = createCommonjsModule$1(function (module) {
|
|
48558
48489
|
var _typeof = _typeof_1["default"];
|
|
48559
48490
|
|
|
48560
|
-
function _getRequireWildcardCache() {
|
|
48491
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
48561
48492
|
if (typeof WeakMap !== "function") return null;
|
|
48562
|
-
var
|
|
48563
|
-
|
|
48564
|
-
_getRequireWildcardCache = function _getRequireWildcardCache() {
|
|
48565
|
-
return
|
|
48566
|
-
};
|
|
48567
|
-
|
|
48568
|
-
return cache;
|
|
48493
|
+
var cacheBabelInterop = new WeakMap();
|
|
48494
|
+
var cacheNodeInterop = new WeakMap();
|
|
48495
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
|
|
48496
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
48497
|
+
})(nodeInterop);
|
|
48569
48498
|
}
|
|
48570
48499
|
|
|
48571
|
-
function _interopRequireWildcard(obj) {
|
|
48572
|
-
if (obj && obj.__esModule) {
|
|
48500
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
48501
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
48573
48502
|
return obj;
|
|
48574
48503
|
}
|
|
48575
48504
|
|
|
@@ -48579,7 +48508,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
48579
48508
|
};
|
|
48580
48509
|
}
|
|
48581
48510
|
|
|
48582
|
-
var cache = _getRequireWildcardCache();
|
|
48511
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
48583
48512
|
|
|
48584
48513
|
if (cache && cache.has(obj)) {
|
|
48585
48514
|
return cache.get(obj);
|
|
@@ -48589,7 +48518,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
48589
48518
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
48590
48519
|
|
|
48591
48520
|
for (var key in obj) {
|
|
48592
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
48521
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
48593
48522
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
48594
48523
|
|
|
48595
48524
|
if (desc && (desc.get || desc.set)) {
|
|
@@ -48609,8 +48538,7 @@ var StreamChatReact = (function (exports, React, streamChat) {
|
|
|
48609
48538
|
return newObj;
|
|
48610
48539
|
}
|
|
48611
48540
|
|
|
48612
|
-
module.exports = _interopRequireWildcard;
|
|
48613
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
48541
|
+
module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
48614
48542
|
});
|
|
48615
48543
|
|
|
48616
48544
|
unwrapExports(interopRequireWildcard);
|