|
1075 | 1075 | {/if} |
1076 | 1076 | </div> |
1077 | 1077 |
|
1078 | | - <div class=" flex justify-between mt-1.5 mb-2.5 mx-0.5"> |
1079 | | - <div class="ml-1 self-end gap-0.5 flex items-center"> |
| 1078 | + <div class=" flex justify-between mt-1.5 mb-2.5 mx-0.5 max-w-full"> |
| 1079 | + <div class="ml-1 self-end gap-0.5 flex items-center flex-1 max-w-[80%]"> |
1080 | 1080 | <InputMenu |
1081 | 1081 | bind:selectedToolIds |
1082 | 1082 | {screenCaptureHandler} |
|
1129 | 1129 | </button> |
1130 | 1130 | </InputMenu> |
1131 | 1131 |
|
1132 | | - {#if $_user} |
1133 | | - {#if $config?.features?.enable_web_search && ($_user.role === 'admin' || $_user?.permissions?.features?.web_search)} |
1134 | | - <Tooltip content={$i18n.t('Search the internet')} placement="top"> |
1135 | | - <button |
1136 | | - on:click|preventDefault={() => (webSearchEnabled = !webSearchEnabled)} |
1137 | | - type="button" |
1138 | | - class="px-1.5 sm:px-2.5 py-1.5 flex gap-1.5 items-center text-sm rounded-full font-medium transition-colors duration-300 focus:outline-none max-w-full overflow-hidden {webSearchEnabled || |
1139 | | - ($settings?.webSearch ?? false) === 'always' |
1140 | | - ? 'bg-blue-100 dark:bg-blue-500/20 text-blue-500 dark:text-blue-400' |
1141 | | - : 'bg-transparent text-gray-600 dark:text-gray-400 border-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800'}" |
1142 | | - > |
1143 | | - <GlobeAlt className="size-5" strokeWidth="1.75" /> |
1144 | | - <span |
1145 | | - class="hidden sm:block whitespace-nowrap overflow-hidden text-ellipsis translate-y-[0.5px] mr-0.5" |
1146 | | - >{$i18n.t('Web Search')}</span |
| 1132 | + <div class="flex gap-0.5 items-center overflow-x-auto scrollbar-none flex-1"> |
| 1133 | + {#if $_user} |
| 1134 | + {#if $config?.features?.enable_web_search && ($_user.role === 'admin' || $_user?.permissions?.features?.web_search)} |
| 1135 | + <Tooltip content={$i18n.t('Search the internet')} placement="top"> |
| 1136 | + <button |
| 1137 | + on:click|preventDefault={() => (webSearchEnabled = !webSearchEnabled)} |
| 1138 | + type="button" |
| 1139 | + class="px-1.5 @sm:px-2.5 py-1.5 flex gap-1.5 items-center text-sm rounded-full font-medium transition-colors duration-300 focus:outline-none max-w-full overflow-hidden {webSearchEnabled || |
| 1140 | + ($settings?.webSearch ?? false) === 'always' |
| 1141 | + ? 'bg-blue-100 dark:bg-blue-500/20 text-blue-500 dark:text-blue-400' |
| 1142 | + : 'bg-transparent text-gray-600 dark:text-gray-400 border-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800'}" |
1147 | 1143 | > |
1148 | | - </button> |
1149 | | - </Tooltip> |
1150 | | - {/if} |
| 1144 | + <GlobeAlt className="size-5" strokeWidth="1.75" /> |
| 1145 | + <span |
| 1146 | + class="hidden @sm:block whitespace-nowrap overflow-hidden text-ellipsis translate-y-[0.5px] mr-0.5" |
| 1147 | + >{$i18n.t('Web Search')}</span |
| 1148 | + > |
| 1149 | + </button> |
| 1150 | + </Tooltip> |
| 1151 | + {/if} |
1151 | 1152 |
|
1152 | | - {#if $config?.features?.enable_image_generation && ($_user.role === 'admin' || $_user?.permissions?.features?.image_generation)} |
1153 | | - <Tooltip content={$i18n.t('Generate an image')} placement="top"> |
1154 | | - <button |
1155 | | - on:click|preventDefault={() => |
1156 | | - (imageGenerationEnabled = !imageGenerationEnabled)} |
1157 | | - type="button" |
1158 | | - class="px-1.5 sm:px-2.5 py-1.5 flex gap-1.5 items-center text-sm rounded-full font-medium transition-colors duration-300 focus:outline-none max-w-full overflow-hidden {imageGenerationEnabled |
1159 | | - ? 'bg-gray-100 dark:bg-gray-500/20 text-gray-600 dark:text-gray-400' |
1160 | | - : 'bg-transparent text-gray-600 dark:text-gray-300 border-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 '}" |
1161 | | - > |
1162 | | - <Photo className="size-5" strokeWidth="1.75" /> |
1163 | | - <span |
1164 | | - class="hidden sm:block whitespace-nowrap overflow-hidden text-ellipsis translate-y-[0.5px] mr-0.5" |
1165 | | - >{$i18n.t('Image')}</span |
| 1153 | + {#if $config?.features?.enable_image_generation && ($_user.role === 'admin' || $_user?.permissions?.features?.image_generation)} |
| 1154 | + <Tooltip content={$i18n.t('Generate an image')} placement="top"> |
| 1155 | + <button |
| 1156 | + on:click|preventDefault={() => |
| 1157 | + (imageGenerationEnabled = !imageGenerationEnabled)} |
| 1158 | + type="button" |
| 1159 | + class="px-1.5 @sm:px-2.5 py-1.5 flex gap-1.5 items-center text-sm rounded-full font-medium transition-colors duration-300 focus:outline-none max-w-full overflow-hidden {imageGenerationEnabled |
| 1160 | + ? 'bg-gray-100 dark:bg-gray-500/20 text-gray-600 dark:text-gray-400' |
| 1161 | + : 'bg-transparent text-gray-600 dark:text-gray-300 border-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 '}" |
1166 | 1162 | > |
1167 | | - </button> |
1168 | | - </Tooltip> |
1169 | | - {/if} |
| 1163 | + <Photo className="size-5" strokeWidth="1.75" /> |
| 1164 | + <span |
| 1165 | + class="hidden @sm:block whitespace-nowrap overflow-hidden text-ellipsis translate-y-[0.5px] mr-0.5" |
| 1166 | + >{$i18n.t('Image')}</span |
| 1167 | + > |
| 1168 | + </button> |
| 1169 | + </Tooltip> |
| 1170 | + {/if} |
1170 | 1171 |
|
1171 | | - {#if $_user.role === 'admin' || $_user?.permissions?.features?.code_interpreter} |
1172 | | - <Tooltip content={$i18n.t('Execute code for analysis')} placement="top"> |
1173 | | - <button |
1174 | | - on:click|preventDefault={() => |
1175 | | - (codeInterpreterEnabled = !codeInterpreterEnabled)} |
1176 | | - type="button" |
1177 | | - class="px-1.5 sm:px-2.5 py-1.5 flex gap-1.5 items-center text-sm rounded-full font-medium transition-colors duration-300 focus:outline-none max-w-full overflow-hidden {codeInterpreterEnabled |
1178 | | - ? 'bg-gray-100 dark:bg-gray-500/20 text-gray-600 dark:text-gray-400' |
1179 | | - : 'bg-transparent text-gray-600 dark:text-gray-300 border-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 '}" |
1180 | | - > |
1181 | | - <CommandLine className="size-5" strokeWidth="1.75" /> |
1182 | | - <span |
1183 | | - class="hidden sm:block whitespace-nowrap overflow-hidden text-ellipsis translate-y-[0.5px] mr-0.5" |
1184 | | - >{$i18n.t('Code Interpreter')}</span |
| 1172 | + {#if $_user.role === 'admin' || $_user?.permissions?.features?.code_interpreter} |
| 1173 | + <Tooltip content={$i18n.t('Execute code for analysis')} placement="top"> |
| 1174 | + <button |
| 1175 | + on:click|preventDefault={() => |
| 1176 | + (codeInterpreterEnabled = !codeInterpreterEnabled)} |
| 1177 | + type="button" |
| 1178 | + class="px-1.5 @sm:px-2.5 py-1.5 flex gap-1.5 items-center text-sm rounded-full font-medium transition-colors duration-300 focus:outline-none max-w-full overflow-hidden {codeInterpreterEnabled |
| 1179 | + ? 'bg-gray-100 dark:bg-gray-500/20 text-gray-600 dark:text-gray-400' |
| 1180 | + : 'bg-transparent text-gray-600 dark:text-gray-300 border-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 '}" |
1185 | 1181 | > |
1186 | | - </button> |
1187 | | - </Tooltip> |
| 1182 | + <CommandLine className="size-5" strokeWidth="1.75" /> |
| 1183 | + <span |
| 1184 | + class="hidden @sm:block whitespace-nowrap overflow-hidden text-ellipsis translate-y-[0.5px] mr-0.5" |
| 1185 | + >{$i18n.t('Code Interpreter')}</span |
| 1186 | + > |
| 1187 | + </button> |
| 1188 | + </Tooltip> |
| 1189 | + {/if} |
1188 | 1190 | {/if} |
1189 | | - {/if} |
| 1191 | + </div> |
1190 | 1192 | </div> |
1191 | 1193 |
|
1192 | | - <div class="self-end flex space-x-1 mr-1"> |
| 1194 | + <div class="self-end flex space-x-1 mr-1 flex-shrink-0"> |
1193 | 1195 | {#if !history?.currentId || history.messages[history.currentId]?.done == true} |
1194 | 1196 | <Tooltip content={$i18n.t('Record voice')}> |
1195 | 1197 | <button |
|
0 commit comments