@ray-js/t-agent-ui-ray 0.0.5-beta-1
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/LICENSE.md +21 -0
- package/README-zh_CN.md +14 -0
- package/README.md +14 -0
- package/dist/ChatContainer/index.d.ts +9 -0
- package/dist/ChatContainer/index.js +124 -0
- package/dist/ChatContainer/index.less +10 -0
- package/dist/CustomCardRender/index.d.ts +8 -0
- package/dist/CustomCardRender/index.js +21 -0
- package/dist/CustomCardRender/index.less +2 -0
- package/dist/EchartsBlockRender/index.js +73 -0
- package/dist/EchartsBlockRender/index.json +3 -0
- package/dist/EchartsBlockRender/index.less +26 -0
- package/dist/EchartsBlockRender/index.rjs +15 -0
- package/dist/EchartsBlockRender/index.tyml +12 -0
- package/dist/EchartsBlockRender/loading.svg +1 -0
- package/dist/LowCodeCardRender/index.d.ts +8 -0
- package/dist/LowCodeCardRender/index.js +14 -0
- package/dist/LowCodeCardRender/index.less +2 -0
- package/dist/MarkdownRender/BlockParser.d.ts +18 -0
- package/dist/MarkdownRender/BlockParser.js +261 -0
- package/dist/MarkdownRender/index.d.ts +14 -0
- package/dist/MarkdownRender/index.js +72 -0
- package/dist/MarkdownRender/index.less +417 -0
- package/dist/MarkdownRender/theme/dark.less +65 -0
- package/dist/MarkdownRender/theme/light.less +64 -0
- package/dist/MessageInput/AsrInput.d.ts +14 -0
- package/dist/MessageInput/AsrInput.js +78 -0
- package/dist/MessageInput/icons/close-circle.svg +1 -0
- package/dist/MessageInput/icons/image.svg +1 -0
- package/dist/MessageInput/icons/loading.svg +1 -0
- package/dist/MessageInput/icons/plus.svg +1 -0
- package/dist/MessageInput/icons/send.svg +1 -0
- package/dist/MessageInput/icons/text.svg +11 -0
- package/dist/MessageInput/icons/video.svg +1 -0
- package/dist/MessageInput/icons/voice-active.svg +9 -0
- package/dist/MessageInput/icons/voice.svg +1 -0
- package/dist/MessageInput/index.d.ts +9 -0
- package/dist/MessageInput/index.js +246 -0
- package/dist/MessageInput/index.less +289 -0
- package/dist/MessageList/index.d.ts +12 -0
- package/dist/MessageList/index.js +61 -0
- package/dist/MessageList/index.less +19 -0
- package/dist/MessageRender/index.d.ts +10 -0
- package/dist/MessageRender/index.js +34 -0
- package/dist/MessageRender/index.less +14 -0
- package/dist/PrivateImage/index.d.ts +8 -0
- package/dist/PrivateImage/index.js +113 -0
- package/dist/TileRender/index.d.ts +11 -0
- package/dist/TileRender/index.js +32 -0
- package/dist/TileRender/index.less +4 -0
- package/dist/cards/WorkflowReplyCard/index.d.ts +11 -0
- package/dist/cards/WorkflowReplyCard/index.js +67 -0
- package/dist/cards/WorkflowReplyCard/index.less +37 -0
- package/dist/cards/map.d.ts +5 -0
- package/dist/cards/map.js +4 -0
- package/dist/contexts.d.ts +11 -0
- package/dist/contexts.js +16 -0
- package/dist/global.d.ts +19 -0
- package/dist/hooks/context.d.ts +11 -0
- package/dist/hooks/context.js +40 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/useAsrInput.d.ts +38 -0
- package/dist/hooks/useAsrInput.js +111 -0
- package/dist/hooks/useBlockInput.d.ts +18 -0
- package/dist/hooks/useBlockInput.js +148 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/dist/logger.d.ts +2 -0
- package/dist/logger.js +3 -0
- package/dist/renderOption.d.ts +2 -0
- package/dist/renderOption.js +76 -0
- package/dist/tiles/BubbleTile/Feedback.d.ts +8 -0
- package/dist/tiles/BubbleTile/Feedback.js +39 -0
- package/dist/tiles/BubbleTile/feedback.less +35 -0
- package/dist/tiles/BubbleTile/index.d.ts +6 -0
- package/dist/tiles/BubbleTile/index.js +123 -0
- package/dist/tiles/BubbleTile/index.less +56 -0
- package/dist/tiles/BubbleTile/notice.svg +1 -0
- package/dist/tiles/BubbleTile/thumb-down-empty.svg +1 -0
- package/dist/tiles/BubbleTile/thumb-up-fill.svg +1 -0
- package/dist/tiles/ButtonsTile/index.d.ts +5 -0
- package/dist/tiles/ButtonsTile/index.js +18 -0
- package/dist/tiles/ButtonsTile/index.less +25 -0
- package/dist/tiles/CardTile/index.d.ts +6 -0
- package/dist/tiles/CardTile/index.js +20 -0
- package/dist/tiles/CardTile/index.less +3 -0
- package/dist/tiles/DocumentsTile/index.d.ts +5 -0
- package/dist/tiles/DocumentsTile/index.js +23 -0
- package/dist/tiles/DocumentsTile/index.less +13 -0
- package/dist/tiles/ImageTile/index.d.ts +5 -0
- package/dist/tiles/ImageTile/index.js +37 -0
- package/dist/tiles/ImageTile/index.less +9 -0
- package/dist/tiles/RecommendationsTile/index.d.ts +5 -0
- package/dist/tiles/RecommendationsTile/index.js +31 -0
- package/dist/tiles/RecommendationsTile/index.less +13 -0
- package/dist/tiles/TextTile/index.d.ts +9 -0
- package/dist/tiles/TextTile/index.js +27 -0
- package/dist/tiles/TextTile/index.less +3 -0
- package/dist/tiles/TimeTile/index.d.ts +5 -0
- package/dist/tiles/TimeTile/index.js +35 -0
- package/dist/tiles/TimeTile/index.less +10 -0
- package/dist/tiles/TipTile/index.d.ts +6 -0
- package/dist/tiles/TipTile/index.js +12 -0
- package/dist/tiles/TipTile/index.less +9 -0
- package/dist/tiles/VideoTile/index.d.ts +5 -0
- package/dist/tiles/VideoTile/index.js +49 -0
- package/dist/tiles/VideoTile/index.less +37 -0
- package/dist/tiles/WorkflowTile/index.d.ts +11 -0
- package/dist/tiles/WorkflowTile/index.js +30 -0
- package/dist/tiles/WorkflowTile/index.less +31 -0
- package/dist/tiles/map.d.ts +3 -0
- package/dist/tiles/map.js +24 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.js +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="18" height="18" viewBox="0 0 18 18"><g><path d="M9,18Q9.22094,18,9.44161,17.9892Q9.66228,17.9783,9.88215,17.9567Q10.102,17.935,10.3206,17.9026Q10.5391,17.8702,10.7558,17.8271Q10.9725,17.784,11.1868,17.7303Q11.4011,17.6766,11.6126,17.6125Q11.824,17.5483,12.032,17.4739Q12.24,17.3995,12.4441,17.3149Q12.6483,17.2304,12.848,17.1359Q13.0477,17.0414,13.2426,16.9373Q13.4374,16.8331,13.6269,16.7196Q13.8164,16.606,14.0001,16.4832Q14.1838,16.3605,14.3613,16.2289Q14.5388,16.0973,14.7095,15.9571Q14.8803,15.8169,15.044,15.6686Q15.2077,15.5202,15.364,15.364Q15.5202,15.2077,15.6686,15.044Q15.8169,14.8803,15.9571,14.7095Q16.0973,14.5388,16.2289,14.3613Q16.3605,14.1838,16.4832,14.0001Q16.606,13.8164,16.7196,13.6269Q16.8331,13.4374,16.9373,13.2426Q17.0414,13.0477,17.1359,12.848Q17.2304,12.6483,17.3149,12.4441Q17.3995,12.24,17.4739,12.032Q17.5483,11.824,17.6125,11.6126Q17.6766,11.4011,17.7303,11.1868Q17.784,10.9725,17.8271,10.7558Q17.8702,10.5391,17.9026,10.3206Q17.935,10.102,17.9567,9.88215Q17.9783,9.66228,17.9892,9.44161Q18,9.22094,18,9Q18,8.77906,17.9892,8.55839Q17.9783,8.33772,17.9567,8.11785Q17.935,7.89797,17.9026,7.67943Q17.8702,7.46088,17.8271,7.24419Q17.784,7.02749,17.7303,6.81318Q17.6766,6.59886,17.6125,6.38744Q17.5483,6.17601,17.4739,5.96799Q17.3995,5.75997,17.3149,5.55585Q17.2304,5.35173,17.1359,5.152Q17.0414,4.95228,16.9373,4.75743Q16.8331,4.56258,16.7196,4.37308Q16.606,4.18357,16.4832,3.99987Q16.3605,3.81616,16.2289,3.63871Q16.0973,3.46125,15.9571,3.29046Q15.8169,3.11967,15.6686,2.95597Q15.5202,2.79227,15.364,2.63604Q15.2077,2.47981,15.044,2.33144Q14.8803,2.18307,14.7095,2.04291Q14.5388,1.90274,14.3613,1.77113Q14.1838,1.63952,14.0001,1.51677Q13.8164,1.39403,13.6269,1.28044Q13.4374,1.16686,13.2426,1.06271Q13.0477,0.958559,12.848,0.864096Q12.6483,0.769633,12.4441,0.685084Q12.24,0.600535,12.032,0.526103Q11.824,0.451672,11.6126,0.387537Q11.4011,0.323402,11.1868,0.269719Q10.9725,0.216035,10.7558,0.172932Q10.5391,0.12983,10.3206,0.0974114Q10.102,0.0649931,9.88215,0.0433375Q9.66228,0.0216818,9.44161,0.0108409Q9.22094,0,9,0Q8.77906,0,8.55839,0.0108409Q8.33772,0.0216818,8.11785,0.0433375Q7.89797,0.0649931,7.67943,0.0974114Q7.46088,0.12983,7.24419,0.172932Q7.02749,0.216035,6.81318,0.269719Q6.59886,0.323402,6.38744,0.387537Q6.17601,0.451672,5.96799,0.526103Q5.75997,0.600535,5.55585,0.685084Q5.35173,0.769633,5.152,0.864096Q4.95228,0.958559,4.75743,1.06271Q4.56258,1.16686,4.37308,1.28044Q4.18357,1.39403,3.99987,1.51677Q3.81616,1.63952,3.63871,1.77113Q3.46125,1.90274,3.29046,2.04291Q3.11967,2.18307,2.95597,2.33144Q2.79227,2.47981,2.63604,2.63604Q2.47981,2.79227,2.33144,2.95597Q2.18307,3.11967,2.04291,3.29046Q1.90274,3.46125,1.77113,3.63871Q1.63952,3.81616,1.51677,3.99987Q1.39403,4.18357,1.28044,4.37308Q1.16686,4.56258,1.06271,4.75743Q0.958559,4.95228,0.864096,5.152Q0.769633,5.35173,0.685084,5.55585Q0.600535,5.75997,0.526103,5.96799Q0.451672,6.17601,0.387537,6.38744Q0.323402,6.59886,0.269719,6.81318Q0.216035,7.02749,0.172932,7.24419Q0.12983,7.46088,0.0974114,7.67943Q0.0649931,7.89797,0.0433375,8.11785Q0.0216818,8.33772,0.0108409,8.55839Q0,8.77906,0,9Q0,9.22094,0.0108409,9.44161Q0.0216818,9.66228,0.0433375,9.88215Q0.0649931,10.102,0.0974114,10.3206Q0.12983,10.5391,0.172932,10.7558Q0.216035,10.9725,0.269719,11.1868Q0.323402,11.4011,0.387537,11.6126Q0.451672,11.824,0.526103,12.032Q0.600535,12.24,0.685084,12.4441Q0.769633,12.6483,0.864096,12.848Q0.958559,13.0477,1.06271,13.2426Q1.16686,13.4374,1.28044,13.6269Q1.39403,13.8164,1.51677,14.0001Q1.63952,14.1838,1.77113,14.3613Q1.90274,14.5388,2.04291,14.7095Q2.18307,14.8803,2.33144,15.044Q2.47981,15.2077,2.63604,15.364Q2.79227,15.5202,2.95597,15.6686Q3.11967,15.8169,3.29046,15.9571Q3.46125,16.0973,3.63871,16.2289Q3.81616,16.3605,3.99987,16.4832Q4.18357,16.606,4.37308,16.7196Q4.56258,16.8331,4.75743,16.9373Q4.95228,17.0414,5.152,17.1359Q5.35173,17.2304,5.55585,17.3149Q5.75997,17.3995,5.96799,17.4739Q6.17601,17.5483,6.38744,17.6125Q6.59886,17.6766,6.81318,17.7303Q7.02749,17.784,7.24419,17.8271Q7.46088,17.8702,7.67943,17.9026Q7.89797,17.935,8.11785,17.9567Q8.33772,17.9783,8.55839,17.9892Q8.77906,18,9,18ZM9,7.67813L11.4281,5.25L12.75,6.57187L10.3219,9L12.75,11.4281L11.4281,12.75L9,10.3219L6.57187,12.75L5.25,11.4281L7.67813,9L5.25,6.57187L6.57187,5.25L9,7.67813Z" fill-rule="evenodd" fill="#484848" fill-opacity="1"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="18" height="18" viewBox="0 0 18 18"><g><path d="M2,8.1005L4,6.1005L9.5,11.6005L13,8.1005L16,11.1005L16,2L2,2L2,8.1005ZM2,10.9289L2,16L5.1005,16L8.0858,13.0147L4,8.9289L2,10.9289ZM7.9289,16L16,16L16,13.9289L13,10.9289L7.9289,16ZM1,0L17,0C17.5523,0,18,0.44772,18,1L18,17C18,17.5523,17.5523,18,17,18L1,18C0.44772,18,0,17.5523,0,17L0,1C0,0.44772,0.44772,0,1,0ZM12.5,7C11.6716,7,11,6.32843,11,5.5C11,4.67157,11.6716,4,12.5,4C13.3284,4,14,4.67157,14,5.5C14,6.32843,13.3284,7,12.5,7Z" fill="#3D3D3D" fill-opacity="1"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1735889067185" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1851" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 170.666667v85.333333a256 256 0 1 1-223.573333 131.2L213.930667 345.6A341.333333 341.333333 0 1 0 512 170.666667z" fill="#000000" opacity=".3" p-id="1852"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14" viewBox="0 0 14 14"><g><path d="M8,1C8,0.447715,7.55228,0,7,0C6.44772,0,6,0.447715,6,1L6,6L1,6C0.447715,6,0,6.44772,0,7C0,7.55228,0.447715,8,1,8L6,8L6,13C6,13.5523,6.44772,14,7,14C7.55228,14,8,13.5523,8,13L8,8L13,8C13.5523,8,14,7.55228,14,7C14,6.44772,13.5523,6,13,6L8,6L8,1Z" fill-rule="evenodd" fill="#7b7c7e" fill-opacity="1"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="15" height="16" viewBox="0 0 15 16"><g><path d="M8.86363,4.64913L12.6721,8.45223C12.9279,8.7076,13.2747,8.85106,13.6364,8.85106C13.998,8.85106,14.3449,8.7076,14.6006,8.45223C14.8563,8.19686,15,7.85051,15,7.48936C15,7.12822,14.8563,6.78186,14.6006,6.52649L8.46424,0.398833C8.19901,0.133983,7.85171,0.00104061,7.50409,0.00000603356L7.49999,0C7.3132,0,7.13518,0.0375036,6.97307,0.105382C6.82515,0.167184,6.68592,0.25617,6.56303,0.37234C6.5527,0.3821,6.54252,0.392018,6.5325,0.402093L0.3994,6.52649C0.143668,6.78186,0,7.12822,0,7.48936C0,7.85051,0.143668,8.19686,0.3994,8.45223C0.655131,8.7076,1.00198,8.85106,1.36364,8.85106C1.7253,8.85106,2.07214,8.7076,2.32787,8.45223L6.13635,4.64915L6.13635,14.6383C6.13635,15.3903,6.74687,16,7.49999,16C8.25311,16,8.86363,15.3903,8.86363,14.6383L8.86363,4.64913Z" fill-rule="evenodd" fill="#fff" fill-opacity="1"/></g></svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="1" cy="5" r="1" fill="#7b7c7e"/>
|
|
3
|
+
<circle cx="1" cy="1" r="1" fill="#7b7c7e"/>
|
|
4
|
+
<circle cx="5" cy="5" r="1" fill="#7b7c7e"/>
|
|
5
|
+
<circle cx="5" cy="1" r="1" fill="#7b7c7e"/>
|
|
6
|
+
<rect x="8" y="4" width="2" height="2" rx="1" fill="#7b7c7e"/>
|
|
7
|
+
<rect x="8" width="2" height="2" rx="1" fill="#7b7c7e"/>
|
|
8
|
+
<rect x="12" y="4" width="2" height="2" rx="1" fill="#7b7c7e"/>
|
|
9
|
+
<rect x="12" width="2" height="2" rx="1" fill="#7b7c7e"/>
|
|
10
|
+
<rect y="8.5" width="14" height="1.5" rx="0.75" fill="#7b7c7e"/>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="20" height="18" viewBox="0 0 20 18"><g><path d="M7.82843,2L5.82843,4L2,4L2,16L18,16L18,4L14.1716,4L12.1716,2L7.82843,2ZM7,0L13,0L15,2L19,2C19.5523,2,20,2.44772,20,3L20,17C20,17.5523,19.5523,18,19,18L1,18C0.44772,18,0,17.5523,0,17L0,3C0,2.44772,0.44772,2,1,2L5,2L7,0ZM10,15C6.96243,15,4.5,12.5376,4.5,9.5C4.5,6.46243,6.96243,4,10,4C13.0376,4,15.5,6.46243,15.5,9.5C15.5,12.5376,13.0376,15,10,15ZM10,13C11.933,13,13.5,11.433,13.5,9.5C13.5,7.567,11.933,6,10,6C8.067,6,6.5,7.567,6.5,9.5C6.5,11.433,8.067,13,10,13Z" fill="#3D3D3D" fill-opacity="1"/></g></svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M26.1252 18.209C26.1251 18.001 26.1661 17.7951 26.2456 17.603C26.3252 17.4109 26.4418 17.2363 26.5888 17.0892C26.7359 16.9422 26.9104 16.8255 27.1025 16.746C27.2946 16.6664 27.5005 16.6254 27.7085 16.6254C27.9164 16.6254 28.1224 16.6664 28.3145 16.746C28.5066 16.8255 28.6811 16.9422 28.8282 17.0892C28.9752 17.2363 29.0918 17.4109 29.1714 17.603C29.2509 17.7951 29.2919 18.001 29.2918 18.209C29.2918 23.3548 25.5156 27.6179 20.5835 28.3795V30.084C20.5835 30.5039 20.4167 30.9066 20.1197 31.2036C19.8228 31.5005 19.4201 31.6673 19.0002 31.6673C18.5802 31.6673 18.1775 31.5005 17.8806 31.2036C17.5836 30.9066 17.4168 30.5039 17.4168 30.084V28.3795C12.4847 27.6179 8.7085 23.3548 8.7085 18.209C8.70846 18.001 8.74939 17.7951 8.82895 17.603C8.90851 17.4109 9.02513 17.2363 9.17216 17.0892C9.31919 16.9422 9.49374 16.8255 9.68586 16.746C9.87797 16.6664 10.0839 16.6254 10.2918 16.6254C10.4998 16.6254 10.7057 16.6664 10.8978 16.746C11.0899 16.8255 11.2645 16.9422 11.4115 17.0892C11.5585 17.2363 11.6752 17.4109 11.7547 17.603C11.8343 17.7951 11.8752 18.001 11.8752 18.209C11.8752 20.0987 12.6258 21.9109 13.962 23.2471C15.2982 24.5833 17.1105 25.334 19.0002 25.334C20.8898 25.334 22.7021 24.5833 24.0383 23.2471C25.3745 21.9109 26.1252 20.0987 26.1252 18.209ZM19.0002 6.33398C19.7279 6.33398 20.4485 6.47732 21.1209 6.75582C21.7932 7.03431 22.4041 7.44251 22.9187 7.9571C23.4333 8.47169 23.8415 9.0826 24.12 9.75495C24.3985 10.4273 24.5418 11.1479 24.5418 11.8757V18.209C24.5418 19.6787 23.958 21.0883 22.9187 22.1275C21.8794 23.1668 20.4699 23.7507 19.0002 23.7507C17.5304 23.7507 16.1209 23.1668 15.0816 22.1275C14.0423 21.0883 13.4585 19.6787 13.4585 18.209V11.8757C13.4585 10.4059 14.0423 8.99636 15.0816 7.9571C16.1209 6.91784 17.5304 6.33398 19.0002 6.33398Z" fill="url(#paint0_linear_1604_21452)"/>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="paint0_linear_1604_21452" x1="19.0002" y1="6.33398" x2="19.0002" y2="31.6673" gradientUnits="userSpaceOnUse">
|
|
5
|
+
<stop stop-color="white"/>
|
|
6
|
+
<stop offset="1" stop-color="white"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="18" height="18" viewBox="0 0 18 18"><defs><clipPath id="master_svg0_289_4169"><rect x="0" y="0" width="18" height="18" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_289_4169)"><g><path d="M6.613606552734375,1.738423447265625Q5.625091552734375,2.726938447265625,5.625091552734375,4.124908447265625L5.625091552734375,8.999908447265625Q5.625091552734375,10.397878447265626,6.613606552734375,11.386398447265625Q7.602121552734375,12.374908447265625,9.000091552734375,12.374908447265625Q10.398061552734376,12.374908447265625,11.386581552734375,11.386398447265625Q12.375091552734375,10.397878447265626,12.375091552734375,8.999908447265625L12.375091552734375,4.124908447265625Q12.375091552734375,2.726938447265625,11.386581552734375,1.738423447265625Q10.398061552734376,0.749908447265625,9.000091552734375,0.749908447265625Q7.602121552734375,0.749908447265625,6.613606552734375,1.738423447265625ZM7.125091552734375,8.999908447265625L7.125091552734375,4.124908447265625Q7.125091552734375,3.348258447265625,7.674261552734375,2.799078447265625Q8.223441552734375,2.249908447265625,9.000091552734375,2.249908447265625Q9.776741552734375,2.249908447265625,10.325921552734375,2.799078447265625Q10.875091552734375,3.348258447265625,10.875091552734375,4.124908447265625L10.875091552734375,8.999908447265625Q10.875091552734375,9.776558447265625,10.325921552734375,10.325738447265625Q9.776741552734375,10.874908447265625,9.000091552734375,10.874908447265625Q8.223441552734375,10.874908447265625,7.674271552734375,10.325738447265625Q7.125091552734375,9.776558447265625,7.125091552734375,8.999908447265625Z" fill-rule="evenodd" fill="#7b7c7e" fill-opacity="1"/></g><g><path d="M13.5078,13.132901552734374Q15.375,11.265711552734375,15.375,8.625091552734375Q15.375,8.551223052734375,15.3606,8.478773552734374Q15.3462,8.406324552734375,15.3179,8.338078552734375Q15.2896,8.269833552734376,15.2486,8.208413552734376Q15.2076,8.146994552734375,15.1553,8.094761552734376Q15.1031,8.042528552734375,15.0417,8.001489552734375Q14.9803,7.960450552734375,14.912,7.932181552734375Q14.8438,7.903913552734375,14.7713,7.889502552734375Q14.6989,7.875091552734375,14.625,7.875091552734375Q14.5511,7.875091552734375,14.4787,7.889502552734375Q14.4062,7.903913552734375,14.338,7.932181552734375Q14.2697,7.960450552734375,14.2083,8.001489552734375Q14.1469,8.042528552734375,14.0947,8.094761552734376Q14.0424,8.146994552734375,14.0014,8.208413552734376Q13.9604,8.269833552734376,13.9321,8.338078552734375Q13.9038,8.406324552734375,13.8894,8.478773552734374Q13.875,8.551223052734375,13.875,8.625091552734375Q13.875,10.644391552734374,12.44715,12.072241552734376Q11.019300000000001,13.500091552734375,9,13.500091552734375Q6.980700000000001,13.500091552734375,5.552849999999999,12.072241552734376Q4.125281,10.644671552734374,4.125,8.625886603734376L4.125,8.625091552734375Q4.125,8.600263952734375,4.123358,8.575490752734375Q4.123067,8.571101652734376,4.122725,8.566716252734375L4.122333,8.561892952734375Q4.111142,8.429558552734376,4.05519,8.309114552734375Q3.999238,8.188669552734375,3.90533,8.094761552734376Q3.799841,7.989272552734375,3.662013,7.932181552734375Q3.524184,7.875091552734375,3.375,7.875091552734375Q3.3055314,7.875091552734375,3.237245,7.887851552734375Q3.168958,7.900610552734375,3.104177,7.925695552734375Q3.039395,7.950780552734375,2.980323,7.987337552734375Q2.921252,8.023894552734376,2.869899,8.070678552734375Q2.818547,8.117463552734375,2.776661,8.172884552734375Q2.734776,8.228305552734374,2.703782,8.290476552734376Q2.672788,8.352648552734376,2.653741,8.419454552734376Q2.634694,8.486260552734375,2.628242,8.555429152734375Q2.625,8.590184952734376,2.625,8.625091552734375Q2.625,11.265711552734375,4.49219,13.132901552734374Q6.35938,15.000091552734375,9,15.000091552734375Q11.64062,15.000091552734375,13.5078,13.132901552734374Z" fill-rule="evenodd" fill="#7b7c7e" fill-opacity="1"/></g><g><path d="M8.25,14.250091552734375L8.25,16.500091552734375Q8.25,16.573961552734374,8.264410999999999,16.646411552734374Q8.278822,16.718861552734374,8.30709,16.787101552734374Q8.335359,16.855351552734376,8.376398,16.916771552734374Q8.417437,16.978191552734376,8.46967,17.030421552734374Q8.521903,17.082651552734376,8.583322,17.123691552734375Q8.644742,17.164731552734374,8.712987,17.193001552734376Q8.781233,17.221271552734375,8.853682,17.235681552734377Q8.9261315,17.250091552734375,9,17.250091552734375Q9.0738685,17.250091552734375,9.146318,17.235681552734377Q9.218767,17.221271552734375,9.287013,17.193001552734376Q9.355258,17.164731552734374,9.416678,17.123691552734375Q9.478097,17.082651552734376,9.53033,17.030421552734374Q9.582563,16.978191552734376,9.623602,16.916771552734374Q9.664641,16.855351552734376,9.69291,16.787101552734374Q9.721178,16.718861552734374,9.735589000000001,16.646411552734374Q9.75,16.573961552734374,9.75,16.500091552734375L9.75,14.250091552734375Q9.75,14.176223052734375,9.735589000000001,14.103773552734374Q9.721178,14.031324552734375,9.69291,13.963078552734375Q9.664641,13.894833552734376,9.623602,13.833413552734376Q9.582563,13.771994552734375,9.53033,13.719761552734376Q9.478097,13.667528552734375,9.416678,13.626489552734375Q9.355258,13.585450552734375,9.287013,13.557181552734376Q9.218767,13.528913552734375,9.146318,13.514502552734374Q9.0738685,13.500091552734375,9,13.500091552734375Q8.9261315,13.500091552734375,8.853682,13.514502552734374Q8.781233,13.528913552734375,8.712987,13.557181552734376Q8.644742,13.585450552734375,8.583322,13.626489552734375Q8.521903,13.667528552734375,8.46967,13.719761552734376Q8.417437,13.771994552734375,8.376398,13.833413552734376Q8.335359,13.894833552734376,8.30709,13.963078552734375Q8.278822,14.031324552734375,8.264410999999999,14.103773552734374Q8.25,14.176223052734375,8.25,14.250091552734375Z" fill-rule="evenodd" fill="#7b7c7e" fill-opacity="1"/></g></g></svg>
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
|
+
import "core-js/modules/esnext.iterator.filter.js";
|
|
3
|
+
import "core-js/modules/esnext.iterator.map.js";
|
|
4
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
5
|
+
import './index.less';
|
|
6
|
+
import { Button, View } from '@ray-js/components';
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { Image, Input, ScrollView, showToast } from '@ray-js/ray';
|
|
9
|
+
import { Asr, SocketStatus } from '@ray-js/t-agent-plugin-assistant';
|
|
10
|
+
import cx from 'clsx';
|
|
11
|
+
import PrivateImage from '../PrivateImage';
|
|
12
|
+
import imageSvg from './icons/image.svg';
|
|
13
|
+
import videoSvg from './icons/video.svg';
|
|
14
|
+
import loadingSvg from './icons/loading.svg';
|
|
15
|
+
import closeCircleSvg from './icons/close-circle.svg';
|
|
16
|
+
import { useChatAgent, useEmitEvent, useOnEvent, useRenderOptions, useBlockInput } from '../hooks';
|
|
17
|
+
import AsrInput from './AsrInput';
|
|
18
|
+
export default function MessageInput(props) {
|
|
19
|
+
const [moreOpen, setMoreOpen] = useState(false);
|
|
20
|
+
const {
|
|
21
|
+
text,
|
|
22
|
+
setText,
|
|
23
|
+
uploading,
|
|
24
|
+
uploaded,
|
|
25
|
+
setUploaded,
|
|
26
|
+
blocks,
|
|
27
|
+
loadBlocks,
|
|
28
|
+
upload
|
|
29
|
+
} = useBlockInput();
|
|
30
|
+
const [responding, setResponding] = useState(false);
|
|
31
|
+
const [mode, setMode] = useState('text');
|
|
32
|
+
const agent = useChatAgent();
|
|
33
|
+
const emitEvent = useEmitEvent();
|
|
34
|
+
useOnEvent('updateSocketStatus', status => {
|
|
35
|
+
if ((status === SocketStatus.FAILED || status === SocketStatus.CONNECTING) && responding) {
|
|
36
|
+
setResponding(false);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const hasMore = !!agent.plugins.assistant.options.multiModal;
|
|
40
|
+
const isMore = !text.length && hasMore;
|
|
41
|
+
const send = async input => {
|
|
42
|
+
if (!input || uploading || responding) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
setUploaded([]);
|
|
46
|
+
setText('');
|
|
47
|
+
setResponding(true);
|
|
48
|
+
try {
|
|
49
|
+
await agent.pushInputBlocks(blocks);
|
|
50
|
+
} finally {
|
|
51
|
+
setResponding(false);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
useOnEvent('sendMessage', async _ref => {
|
|
55
|
+
let {
|
|
56
|
+
blocks
|
|
57
|
+
} = _ref;
|
|
58
|
+
if (uploading || responding) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
setText('');
|
|
62
|
+
setMoreOpen(false);
|
|
63
|
+
setUploaded([]);
|
|
64
|
+
setResponding(true);
|
|
65
|
+
try {
|
|
66
|
+
await agent.pushInputBlocks(blocks);
|
|
67
|
+
} finally {
|
|
68
|
+
setResponding(false);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
useOnEvent('setInputBlocks', async _ref2 => {
|
|
72
|
+
let {
|
|
73
|
+
blocks
|
|
74
|
+
} = _ref2;
|
|
75
|
+
if (uploading || responding) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
loadBlocks(blocks);
|
|
79
|
+
setMoreOpen(false);
|
|
80
|
+
});
|
|
81
|
+
const openMoreClick = () => {
|
|
82
|
+
setMoreOpen(!moreOpen);
|
|
83
|
+
if (!moreOpen) {
|
|
84
|
+
emitEvent('scrollToBottom', {
|
|
85
|
+
animation: true
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const {
|
|
90
|
+
getStaticResourceBizType
|
|
91
|
+
} = useRenderOptions();
|
|
92
|
+
let container;
|
|
93
|
+
if (mode === 'text') {
|
|
94
|
+
container = /*#__PURE__*/React.createElement(View, {
|
|
95
|
+
className: "t-agent-message-input-text-bar"
|
|
96
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
97
|
+
className: "t-agent-message-input-text-group"
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
99
|
+
confirmType: "send",
|
|
100
|
+
value: text,
|
|
101
|
+
onInput: event => setText(event.detail.value),
|
|
102
|
+
placeholder: props.placeholder,
|
|
103
|
+
className: "t-agent-message-input-text-inner",
|
|
104
|
+
onConfirm: () => send(text),
|
|
105
|
+
maxLength: 200,
|
|
106
|
+
placeholderStyle: "color: var(--app-B1-N4)",
|
|
107
|
+
onFocus: () => {
|
|
108
|
+
setMoreOpen(false);
|
|
109
|
+
emitEvent('scrollToBottom', {
|
|
110
|
+
animation: true
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
114
|
+
onClick: async () => {
|
|
115
|
+
const auth = await Asr.authorize();
|
|
116
|
+
if (!auth) {
|
|
117
|
+
showToast({
|
|
118
|
+
icon: 'none',
|
|
119
|
+
title: I18n.t('chat.input.voice.requirePermission')
|
|
120
|
+
});
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
setMode('voice');
|
|
124
|
+
},
|
|
125
|
+
className: "t-agent-message-input-button t-agent-message-input-button-voice"
|
|
126
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
127
|
+
disabled: !isMore && (responding || uploading),
|
|
128
|
+
className: cx('t-agent-message-input-button', {
|
|
129
|
+
't-agent-message-input-button-more': isMore,
|
|
130
|
+
't-agent-message-input-button-more-open': moreOpen && isMore,
|
|
131
|
+
't-agent-message-input-button-send': !isMore
|
|
132
|
+
}),
|
|
133
|
+
onClick: async () => {
|
|
134
|
+
if (isMore) {
|
|
135
|
+
openMoreClick();
|
|
136
|
+
} else {
|
|
137
|
+
await send(text);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}));
|
|
141
|
+
} else {
|
|
142
|
+
container = /*#__PURE__*/React.createElement(AsrInput, {
|
|
143
|
+
onBack: () => setMode('text'),
|
|
144
|
+
moreOpen: moreOpen,
|
|
145
|
+
closeMore: () => setMoreOpen(false),
|
|
146
|
+
onMoreClick: openMoreClick,
|
|
147
|
+
sendDisabled: responding || uploading,
|
|
148
|
+
onSend: text => send(text),
|
|
149
|
+
hasMore: hasMore,
|
|
150
|
+
onError: error => {
|
|
151
|
+
showToast({
|
|
152
|
+
icon: 'error',
|
|
153
|
+
title: error.message
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
159
|
+
className: "".concat(props.className || '', " t-agent-message-input")
|
|
160
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
161
|
+
className: "t-agent-message-input-container"
|
|
162
|
+
}, props.renderTop, !!uploaded.length && /*#__PURE__*/React.createElement(ScrollView, {
|
|
163
|
+
scrollX: true,
|
|
164
|
+
scrollY: false,
|
|
165
|
+
enableFlex: true,
|
|
166
|
+
className: "t-agent-message-input-uploaded-files",
|
|
167
|
+
refresherTriggered: false
|
|
168
|
+
}, uploaded.map(file => {
|
|
169
|
+
let content;
|
|
170
|
+
switch (file.type) {
|
|
171
|
+
case 'image':
|
|
172
|
+
content = /*#__PURE__*/React.createElement(PrivateImage, {
|
|
173
|
+
className: "t-agent-message-input-uploaded-file-image",
|
|
174
|
+
mode: "aspectFill",
|
|
175
|
+
bizType: getStaticResourceBizType(file.url, 'image:view'),
|
|
176
|
+
src: file.url
|
|
177
|
+
});
|
|
178
|
+
break;
|
|
179
|
+
case 'video':
|
|
180
|
+
content = /*#__PURE__*/React.createElement(PrivateImage, {
|
|
181
|
+
bizType: getStaticResourceBizType(file.thumbUrl, 'videoThumb:view'),
|
|
182
|
+
className: "t-agent-message-input-uploaded-file-image",
|
|
183
|
+
mode: "aspectFill",
|
|
184
|
+
src: file.thumbUrl
|
|
185
|
+
});
|
|
186
|
+
break;
|
|
187
|
+
case 'loading':
|
|
188
|
+
content = /*#__PURE__*/React.createElement(View, {
|
|
189
|
+
className: "t-agent-message-input-uploaded-file-loading",
|
|
190
|
+
key: file.id
|
|
191
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
192
|
+
src: loadingSvg,
|
|
193
|
+
className: "t-agent-message-input-uploaded-file-loading-icon"
|
|
194
|
+
}));
|
|
195
|
+
break;
|
|
196
|
+
default:
|
|
197
|
+
content = null;
|
|
198
|
+
}
|
|
199
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
200
|
+
key: file.id,
|
|
201
|
+
className: "t-agent-message-input-uploaded-file"
|
|
202
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
203
|
+
onClick: () => {
|
|
204
|
+
setUploaded(prev => prev.filter(f => f.id !== file.id));
|
|
205
|
+
},
|
|
206
|
+
className: "t-agent-message-input-uploaded-file-delete",
|
|
207
|
+
src: closeCircleSvg
|
|
208
|
+
}), content);
|
|
209
|
+
})), container), /*#__PURE__*/React.createElement(View, {
|
|
210
|
+
className: "t-agent-message-input-panel ".concat(moreOpen ? '' : 't-agent-message-input-panel-close')
|
|
211
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
212
|
+
className: "t-agent-message-input-panel-content"
|
|
213
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
214
|
+
className: "t-agent-message-input-panel-button",
|
|
215
|
+
onClick: async () => {
|
|
216
|
+
try {
|
|
217
|
+
await upload('image', 1);
|
|
218
|
+
} catch (e) {
|
|
219
|
+
showToast({
|
|
220
|
+
icon: 'error',
|
|
221
|
+
title: I18n.t('common.upload.failed')
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
226
|
+
className: "t-agent-message-input-panel-button-icon"
|
|
227
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
228
|
+
src: imageSvg
|
|
229
|
+
}))), /*#__PURE__*/React.createElement(Button, {
|
|
230
|
+
className: "t-agent-message-input-panel-button",
|
|
231
|
+
onClick: async () => {
|
|
232
|
+
try {
|
|
233
|
+
await upload('video', 1);
|
|
234
|
+
} catch (e) {
|
|
235
|
+
showToast({
|
|
236
|
+
icon: 'error',
|
|
237
|
+
title: I18n.t('common.upload.failed')
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
242
|
+
className: "t-agent-message-input-panel-button-icon"
|
|
243
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
244
|
+
src: videoSvg
|
|
245
|
+
}))))));
|
|
246
|
+
}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
@keyframes t-agent-message-input-rotating {
|
|
2
|
+
from {
|
|
3
|
+
transform: rotate(0deg);
|
|
4
|
+
}
|
|
5
|
+
to {
|
|
6
|
+
transform: rotate(360deg);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
.t-agent-message-input-container {
|
|
12
|
+
--t-agent-input-border-color: var(--app-B1-N7);
|
|
13
|
+
padding-bottom: var(--t-agent-safe-bottom);
|
|
14
|
+
border-top: 2rpx solid var(--t-agent-input-border-color);
|
|
15
|
+
background: var(--app-B1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.t-agent-message-input-uploaded-files {
|
|
19
|
+
padding: 16rpx 32rpx 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.t-agent-message-input-uploaded-file {
|
|
23
|
+
width: 120rpx;
|
|
24
|
+
height: 120rpx;
|
|
25
|
+
border-radius: 32rpx;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
position: relative;
|
|
28
|
+
margin-right: 16rpx;
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
|
|
31
|
+
&:last-child {
|
|
32
|
+
margin-right: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.t-agent-message-input-uploaded-file-loading {
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
background: var(--app-B3);
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.t-agent-message-input-uploaded-file-loading-icon {
|
|
47
|
+
width: 64rpx;
|
|
48
|
+
height: 64rpx;
|
|
49
|
+
animation: t-agent-message-input-rotating 2s infinite;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.t-agent-message-input-uploaded-file-image {
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
background: var(--app-B3);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.t-agent-message-input-uploaded-file-delete {
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: 10rpx;
|
|
61
|
+
right: 10rpx;
|
|
62
|
+
width: 32rpx;
|
|
63
|
+
height: 32rpx;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.t-agent-message-input-text-bar {
|
|
67
|
+
display: flex;
|
|
68
|
+
padding: 16rpx 32rpx;
|
|
69
|
+
align-items: center;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.t-agent-message-input-text-group {
|
|
73
|
+
flex: 1;
|
|
74
|
+
position: relative;
|
|
75
|
+
margin-right: 16rpx;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.t-agent-message-input-text-inner {
|
|
79
|
+
height: 72rpx;
|
|
80
|
+
border-radius: 9999rpx;
|
|
81
|
+
border: 2rpx solid var(--t-agent-input-border-color);
|
|
82
|
+
background-color: var(--app-B1);
|
|
83
|
+
padding: 12rpx 80rpx 12rpx 32rpx;
|
|
84
|
+
font-size: 32rpx;
|
|
85
|
+
|
|
86
|
+
&:focus {
|
|
87
|
+
outline: 2rpx solid var(--app-M1);
|
|
88
|
+
background-color: var(--app-B3);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.t-agent-message-input-button {
|
|
93
|
+
--button-size: 68rpx;
|
|
94
|
+
background: transparent;
|
|
95
|
+
|
|
96
|
+
border-radius: 50%;
|
|
97
|
+
width: var(--button-size);
|
|
98
|
+
height: var(--button-size);
|
|
99
|
+
flex-basis: var(--button-size);
|
|
100
|
+
line-height: var(--button-size);
|
|
101
|
+
padding: 0;
|
|
102
|
+
margin: 0;
|
|
103
|
+
text-align: center;
|
|
104
|
+
color: transparent;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
|
|
109
|
+
background-size: contain;
|
|
110
|
+
background-origin: content-box;
|
|
111
|
+
|
|
112
|
+
&[disabled] {
|
|
113
|
+
opacity: 0.6;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.t-agent-message-input-button-more {
|
|
118
|
+
background: transparent url('icons/plus.svg') no-repeat center;
|
|
119
|
+
border: 2rpx solid var(--t-agent-input-border-color);
|
|
120
|
+
transition: all ease-in-out 0.2s;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.t-agent-message-input-button-more-open {
|
|
124
|
+
transform: rotate(45deg);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.t-agent-message-input-button-send {
|
|
128
|
+
background: var(--app-M1) url('icons/send.svg') no-repeat center;
|
|
129
|
+
transition: all ease-in-out 0.2s;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.t-agent-message-input-button-voice-send {
|
|
133
|
+
background: var(--app-M1) url('icons/send.svg') no-repeat center;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.t-agent-message-input-button-voice {
|
|
137
|
+
background: transparent url('icons/voice.svg') no-repeat center;
|
|
138
|
+
position: absolute;
|
|
139
|
+
top: 50%;
|
|
140
|
+
transform: translateY(-50%);
|
|
141
|
+
right: 10rpx;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.t-agent-message-input-panel {
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
height: 168rpx;
|
|
147
|
+
box-sizing: border-box;
|
|
148
|
+
transition: height .2s ease-in-out;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.t-agent-message-input-panel-close {
|
|
152
|
+
height: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.t-agent-message-input-panel-content {
|
|
156
|
+
background: var(--app-B1);
|
|
157
|
+
padding: 20rpx 24rpx 36rpx;
|
|
158
|
+
display: flex;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.t-agent-message-input-panel-button {
|
|
162
|
+
padding: 0;
|
|
163
|
+
margin-right: 48rpx;
|
|
164
|
+
background-color: var(--app-B3);
|
|
165
|
+
text-align: center;
|
|
166
|
+
border-radius: 32rpx;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.t-agent-message-input-panel-button-icon {
|
|
170
|
+
padding: 40rpx;
|
|
171
|
+
width: 112rpx;
|
|
172
|
+
height: 112rpx;
|
|
173
|
+
position: relative;
|
|
174
|
+
margin: auto;
|
|
175
|
+
|
|
176
|
+
image {
|
|
177
|
+
position: absolute;
|
|
178
|
+
top: 50%;
|
|
179
|
+
left: 50%;
|
|
180
|
+
transform: translate(-50%, -50%);
|
|
181
|
+
width: 36rpx;
|
|
182
|
+
height: 36rpx;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.t-agent-message-input-voice-bar {
|
|
187
|
+
height: 280rpx;
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: space-evenly;
|
|
191
|
+
position: relative;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.t-agent-message-input-button-text {
|
|
195
|
+
background: transparent url('icons/text.svg') no-repeat center;
|
|
196
|
+
border: 2rpx solid var(--t-agent-input-border-color);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.t-agent-message-input-button-voice-active {
|
|
200
|
+
background: var(--app-M1) url('icons/voice-active.svg') no-repeat center;
|
|
201
|
+
width: 116rpx;
|
|
202
|
+
height: 116rpx;
|
|
203
|
+
flex-basis: 116rpx;
|
|
204
|
+
outline: 0 solid var(--app-M1_1);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.t-agent-message-input-button-voice-active:active {
|
|
208
|
+
outline: 30rpx solid var(--app-M1_1);
|
|
209
|
+
animation: t-agent-message-input-button-voice-active-animation 3s infinite;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
@keyframes t-agent-message-input-button-voice-active-animation {
|
|
213
|
+
0% {
|
|
214
|
+
outline-width: 30rpx;
|
|
215
|
+
}
|
|
216
|
+
50% {
|
|
217
|
+
outline-width: 50rpx;
|
|
218
|
+
}
|
|
219
|
+
100% {
|
|
220
|
+
outline-width: 30rpx;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.t-agent-message-input-button-hide {
|
|
225
|
+
opacity: 0;
|
|
226
|
+
|
|
227
|
+
&[disabled] {
|
|
228
|
+
opacity: 0;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.t-agent-message-input-button-clear {
|
|
233
|
+
background: transparent url('icons/plus.svg') no-repeat center;
|
|
234
|
+
border: 2rpx solid var(--app-B1-N4);
|
|
235
|
+
transform: rotate(45deg);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.t-agent-message-input-voice-mask {
|
|
239
|
+
position: absolute;
|
|
240
|
+
bottom: 0;
|
|
241
|
+
left: 0;
|
|
242
|
+
right: 0;
|
|
243
|
+
height: 100vh;
|
|
244
|
+
background: linear-gradient(to top, var(--app-B3), rgba(0, 0, 0, 0)); //z-index: 100;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.t-agent-message-input-voice-bubble {
|
|
248
|
+
position: absolute;
|
|
249
|
+
bottom: calc(260rpx + var(--t-agent-safe-bottom));
|
|
250
|
+
min-height: 120rpx;
|
|
251
|
+
left: 50%;
|
|
252
|
+
transform: translateX(-50%);
|
|
253
|
+
width: 684rpx;
|
|
254
|
+
border-radius: 32rpx;
|
|
255
|
+
background: var(--app-M1);
|
|
256
|
+
text-align: left;
|
|
257
|
+
line-height: 56rpx;
|
|
258
|
+
padding: 32rpx 56rpx;
|
|
259
|
+
color: var(--app-M1-N1);
|
|
260
|
+
font-size: 32rpx;
|
|
261
|
+
transition: height 0.2s ease-in-out;
|
|
262
|
+
|
|
263
|
+
&::after {
|
|
264
|
+
content: '';
|
|
265
|
+
position: absolute;
|
|
266
|
+
bottom: -16rpx;
|
|
267
|
+
left: 50%;
|
|
268
|
+
transform: translateX(-50%);
|
|
269
|
+
width: 0;
|
|
270
|
+
height: 0;
|
|
271
|
+
border-left: 16rpx solid transparent;
|
|
272
|
+
border-right: 16rpx solid transparent;
|
|
273
|
+
border-top: 16rpx solid var(--app-M1);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.t-agent-message-input-voice-bubble-predicted {
|
|
278
|
+
color: var(--app-M1-N3);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.t-agent-message-input-voice-bubble-input {
|
|
282
|
+
background: transparent;
|
|
283
|
+
padding: 0;
|
|
284
|
+
color: var(--app-M1-N1);
|
|
285
|
+
font-size: 32rpx;
|
|
286
|
+
line-height: 56rpx;
|
|
287
|
+
border: none;
|
|
288
|
+
min-height: 56rpx;
|
|
289
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
className?: string;
|
|
5
|
+
roleSide?: {
|
|
6
|
+
user?: 'start' | 'end';
|
|
7
|
+
assistant?: 'start' | 'end';
|
|
8
|
+
[key: string]: 'start' | 'end';
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export default function MessageList(props: Props): React.JSX.Element;
|
|
12
|
+
export {};
|