@blumessage/react-chat 1.5.1 → 1.5.2

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.
@@ -1007,7 +1007,25 @@ helpBubbleBackgroundColor = "#000000", }, ref) => {
1007
1007
  ? 'bg-gray-900 border-gray-700'
1008
1008
  : 'bg-white border-gray-100'}`, style: { padding: isMobile ? '12px 16px' : '16px 24px' }, children: (0, jsx_runtime_1.jsxs)("div", { className: `flex items-center rounded-2xl px-4 py-3 border ${theme === 'dark'
1009
1009
  ? 'bg-gray-800 border-gray-600'
1010
- : 'bg-gray-50 border-gray-200'}`, children: [(0, jsx_runtime_1.jsx)("textarea", { className: `flex-1 border-none bg-transparent outline-none text-sm font-inherit resize-none ${theme === 'dark' ? 'text-gray-100' : 'text-gray-700'}`, placeholder: placeholder, value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyPress, rows: 1, style: {
1010
+ : 'bg-gray-50 border-gray-200'}`, children: [(0, jsx_runtime_1.jsx)("textarea", { className: `flex-1 border-none bg-transparent outline-none text-sm font-inherit resize-none ${theme === 'dark' ? 'text-gray-100' : 'text-gray-700'}`, placeholder: placeholder, value: inputValue, onChange: (e) => {
1011
+ const newValue = e.target.value;
1012
+ if (newValue.length <= 1000) {
1013
+ setInputValue(newValue);
1014
+ }
1015
+ }, onPaste: (e) => {
1016
+ e.preventDefault();
1017
+ const pastedText = e.clipboardData.getData('text');
1018
+ const currentValue = inputValue;
1019
+ const newValue = currentValue + pastedText;
1020
+ if (newValue.length <= 1000) {
1021
+ setInputValue(newValue);
1022
+ }
1023
+ else {
1024
+ // Truncate to exactly 1000 characters
1025
+ const truncatedValue = newValue.substring(0, 1000);
1026
+ setInputValue(truncatedValue);
1027
+ }
1028
+ }, onKeyDown: handleKeyPress, rows: 1, maxLength: 1000, style: {
1011
1029
  minHeight: '20px',
1012
1030
  maxHeight: isMobile ? '100px' : '120px',
1013
1031
  overflowY: inputValue.split('\n').length > 4 ? 'auto' : 'hidden',