Deploying to gh-pages from @ fishjar/kiss-translator@2a5e9db079 🚀

This commit is contained in:
fishjar
2025-07-23 13:06:19 +00:00
parent 5441473be4
commit 131f3121dd
8 changed files with 31 additions and 31 deletions

View File

@@ -34820,7 +34820,7 @@ fetchInterval:DEFAULT_FETCH_INTERVAL,// 任务间隔时间
apiName:OPT_TRANS_GOOGLE,// 接口自定义名称
isDisabled:false,// 是否禁用
httpTimeout:DEFAULT_HTTP_TIMEOUT// 超时时间
},[OPT_TRANS_GOOGLE_2]:{url:URL_GOOGLE_TRAN2,key:DEFAULT_GOOGLE_API_KEY,fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_GOOGLE_2,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_MICROSOFT]:{fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_MICROSOFT,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_BAIDU]:{fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_BAIDU,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_TENCENT]:{fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_TENCENT,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_VOLCENGINE]:{fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_VOLCENGINE,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_DEEPL]:{url:"https://api-free.deepl.com/v2/translate",key:"",fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_DEEPL,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_DEEPLFREE]:{fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_DEEPLFREE,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_DEEPLX]:{url:"http://localhost:1188/translate",key:"",fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_DEEPLX,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_NIUTRANS]:{url:"https://api.niutrans.com/NiuTransServer/translation",key:"",dictNo:"",memoryNo:"",fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_NIUTRANS,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_OPENAI]:defaultOpenaiApi,[OPT_TRANS_OPENAI_2]:defaultOpenaiApi,[OPT_TRANS_OPENAI_3]:defaultOpenaiApi,[OPT_TRANS_GEMINI]:{url:"https://generativelanguage.googleapis.com/v1/models/".concat(INPUT_PLACE_MODEL,":generateContent?key=").concat(INPUT_PLACE_KEY),key:"",model:"gemini-2.5-flash",systemPrompt:"You are a professional, authentic machine translation engine.",userPrompt:"Translate the following source text from ".concat(INPUT_PLACE_FROM," to ").concat(INPUT_PLACE_TO,". Output translation directly without any additional text.\n\nSource Text: ").concat(INPUT_PLACE_TEXT,"\n\nTranslated Text:"),temperature:0,maxTokens:2048,fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_GEMINI,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT*2},[OPT_TRANS_GEMINI_2]:{url:"https://generativelanguage.googleapis.com/v1beta/openai/chat/completions",key:"",model:"gemini-2.0-flash",systemPrompt:"You are a professional, authentic machine translation engine.",userPrompt:"Translate the following source text from ".concat(INPUT_PLACE_FROM," to ").concat(INPUT_PLACE_TO,". Output translation directly without any additional text.\n\nSource Text: ").concat(INPUT_PLACE_TEXT,"\n\nTranslated Text:"),temperature:0,reasoningEffort:"low",fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_GEMINI_2,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT*2},[OPT_TRANS_CLAUDE]:{url:"https://api.anthropic.com/v1/messages",key:"",model:"claude-3-haiku-20240307",systemPrompt:"You are a professional, authentic machine translation engine.",userPrompt:"Translate the following source text from ".concat(INPUT_PLACE_FROM," to ").concat(INPUT_PLACE_TO,". Output translation directly without any additional text.\n\nSource Text: ").concat(INPUT_PLACE_TEXT,"\n\nTranslated Text:"),temperature:0,maxTokens:1024,fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_CLAUDE,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT*2},[OPT_TRANS_CLOUDFLAREAI]:{url:"https://api.cloudflare.com/client/v4/accounts/{{ACCOUNT_ID}}/ai/run/@cf/meta/m2m100-1.2b",key:"",fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_CLOUDFLAREAI,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT*2},[OPT_TRANS_OLLAMA]:defaultOllamaApi,[OPT_TRANS_OLLAMA_2]:defaultOllamaApi,[OPT_TRANS_OLLAMA_3]:defaultOllamaApi,[OPT_TRANS_CUSTOMIZE]:defaultCustomApi,[OPT_TRANS_CUSTOMIZE_2]:defaultCustomApi,[OPT_TRANS_CUSTOMIZE_3]:defaultCustomApi,[OPT_TRANS_CUSTOMIZE_4]:defaultCustomApi,[OPT_TRANS_CUSTOMIZE_5]:defaultCustomApi};// 默认快捷键
},[OPT_TRANS_GOOGLE_2]:{url:URL_GOOGLE_TRAN2,key:DEFAULT_GOOGLE_API_KEY,fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_GOOGLE_2,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_MICROSOFT]:{fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_MICROSOFT,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_BAIDU]:{fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_BAIDU,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_TENCENT]:{fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_TENCENT,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_VOLCENGINE]:{fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_VOLCENGINE,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_DEEPL]:{url:"https://api-free.deepl.com/v2/translate",key:"",fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_DEEPL,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_DEEPLFREE]:{fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_DEEPLFREE,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_DEEPLX]:{url:"http://localhost:1188/translate",key:"",fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_DEEPLX,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_NIUTRANS]:{url:"https://api.niutrans.com/NiuTransServer/translation",key:"",dictNo:"",memoryNo:"",fetchLimit:DEFAULT_FETCH_LIMIT,fetchInterval:DEFAULT_FETCH_INTERVAL,apiName:OPT_TRANS_NIUTRANS,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT},[OPT_TRANS_OPENAI]:defaultOpenaiApi,[OPT_TRANS_OPENAI_2]:defaultOpenaiApi,[OPT_TRANS_OPENAI_3]:defaultOpenaiApi,[OPT_TRANS_GEMINI]:{url:"https://generativelanguage.googleapis.com/v1/models/".concat(INPUT_PLACE_MODEL,":generateContent?key=").concat(INPUT_PLACE_KEY),key:"",model:"gemini-2.5-flash",systemPrompt:"You are a professional, authentic machine translation engine.",userPrompt:"Translate the following source text from ".concat(INPUT_PLACE_FROM," to ").concat(INPUT_PLACE_TO,". Output translation directly without any additional text.\n\nSource Text: ").concat(INPUT_PLACE_TEXT,"\n\nTranslated Text:"),temperature:0,maxTokens:2048,fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_GEMINI,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT*2},[OPT_TRANS_GEMINI_2]:{url:"https://generativelanguage.googleapis.com/v1beta/openai/chat/completions",key:"",model:"gemini-2.0-flash",systemPrompt:"You are a professional, authentic machine translation engine.",userPrompt:"Translate the following source text from ".concat(INPUT_PLACE_FROM," to ").concat(INPUT_PLACE_TO,". Output translation directly without any additional text.\n\nSource Text: ").concat(INPUT_PLACE_TEXT,"\n\nTranslated Text:"),temperature:0,maxTokens:2048,fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_GEMINI_2,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT*2},[OPT_TRANS_CLAUDE]:{url:"https://api.anthropic.com/v1/messages",key:"",model:"claude-3-haiku-20240307",systemPrompt:"You are a professional, authentic machine translation engine.",userPrompt:"Translate the following source text from ".concat(INPUT_PLACE_FROM," to ").concat(INPUT_PLACE_TO,". Output translation directly without any additional text.\n\nSource Text: ").concat(INPUT_PLACE_TEXT,"\n\nTranslated Text:"),temperature:0,maxTokens:1024,fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_CLAUDE,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT*2},[OPT_TRANS_CLOUDFLAREAI]:{url:"https://api.cloudflare.com/client/v4/accounts/{{ACCOUNT_ID}}/ai/run/@cf/meta/m2m100-1.2b",key:"",fetchLimit:1,fetchInterval:500,apiName:OPT_TRANS_CLOUDFLAREAI,isDisabled:false,httpTimeout:DEFAULT_HTTP_TIMEOUT*2},[OPT_TRANS_OLLAMA]:defaultOllamaApi,[OPT_TRANS_OLLAMA_2]:defaultOllamaApi,[OPT_TRANS_OLLAMA_3]:defaultOllamaApi,[OPT_TRANS_CUSTOMIZE]:defaultCustomApi,[OPT_TRANS_CUSTOMIZE_2]:defaultCustomApi,[OPT_TRANS_CUSTOMIZE_3]:defaultCustomApi,[OPT_TRANS_CUSTOMIZE_4]:defaultCustomApi,[OPT_TRANS_CUSTOMIZE_5]:defaultCustomApi};// 默认快捷键
const OPT_SHORTCUT_TRANSLATE="toggleTranslate";const OPT_SHORTCUT_STYLE="toggleStyle";const OPT_SHORTCUT_POPUP="togglePopup";const OPT_SHORTCUT_SETTING="openSetting";const DEFAULT_SHORTCUTS={[OPT_SHORTCUT_TRANSLATE]:["AltLeft","KeyQ"],[OPT_SHORTCUT_STYLE]:["AltLeft","KeyC"],[OPT_SHORTCUT_POPUP]:["AltLeft","KeyK"],[OPT_SHORTCUT_SETTING]:["AltLeft","KeyO"]};const TRANS_MIN_LENGTH=5;// 最短翻译长度
const TRANS_MAX_LENGTH=5000;// 最长翻译长度
const TRANS_NEWLINE_LENGTH=20;// 换行字符数
@@ -34861,7 +34861,7 @@ subRulesSyncAt:0,// 订阅规则同步时间
dataCaches:{}// 缓存同步时间
};
;// CONCATENATED MODULE: ./src/index.js
function App(){var _I18N$about_md;const[lang,setLang]=(0,react.useState)("zh");const[data,loading,error]=useFetch("".concat(URL_RAW_PREFIX,"/").concat(I18N===null||I18N===void 0?void 0:(_I18N$about_md=I18N["about_md"])===null||_I18N$about_md===void 0?void 0:_I18N$about_md[lang]));return/*#__PURE__*/(0,jsx_runtime.jsxs)(Paper_Paper,{sx:{padding:2,margin:2},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Stack_Stack,{spacing:2,direction:"row",justifyContent:"flex-end",children:/*#__PURE__*/(0,jsx_runtime.jsx)(Button_Button,{variant:"text",onClick:()=>{setLang(pre=>pre==="zh"?"en":"zh");},children:lang==="zh"?"ENGLISH":"中文"})}),/*#__PURE__*/(0,jsx_runtime.jsx)(Divider_Divider,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(Link_Link,{href:"https://github.com/fishjar/kiss-translator",children:"KISS Translator v".concat("1.9.0")})}),/*#__PURE__*/(0,jsx_runtime.jsxs)(Stack_Stack,{spacing:2,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Link_Link,{href:"https://fishjar.github.io/kiss-translator/kiss-translator.user.js",children:"Install/Update Userscript for Tampermonkey/Violentmonkey"}),/*#__PURE__*/(0,jsx_runtime.jsx)(Link_Link,{href:"https://fishjar.github.io/kiss-translator/kiss-translator-ios-safari.user.js",children:"Install/Update Userscript for iOS Safari"}),/*#__PURE__*/(0,jsx_runtime.jsx)(Link_Link,{href:"https://fishjar.github.io/kiss-translator/options.html",children:"Open Options Page"})]}),loading?/*#__PURE__*/(0,jsx_runtime.jsx)("center",{children:/*#__PURE__*/(0,jsx_runtime.jsx)(CircularProgress_CircularProgress,{})}):/*#__PURE__*/(0,jsx_runtime.jsx)(ReactMarkdown,{children:error?error.message:data})]});}const src_root=client.createRoot(document.getElementById("root"));src_root.render(/*#__PURE__*/(0,jsx_runtime.jsx)(react.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(App,{})}));
function App(){var _I18N$about_md;const[lang,setLang]=(0,react.useState)("zh");const[data,loading,error]=useFetch("".concat(URL_RAW_PREFIX,"/").concat(I18N===null||I18N===void 0?void 0:(_I18N$about_md=I18N["about_md"])===null||_I18N$about_md===void 0?void 0:_I18N$about_md[lang]));return/*#__PURE__*/(0,jsx_runtime.jsxs)(Paper_Paper,{sx:{padding:2,margin:2},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Stack_Stack,{spacing:2,direction:"row",justifyContent:"flex-end",children:/*#__PURE__*/(0,jsx_runtime.jsx)(Button_Button,{variant:"text",onClick:()=>{setLang(pre=>pre==="zh"?"en":"zh");},children:lang==="zh"?"ENGLISH":"中文"})}),/*#__PURE__*/(0,jsx_runtime.jsx)(Divider_Divider,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(Link_Link,{href:"https://github.com/fishjar/kiss-translator",children:"KISS Translator v".concat("1.9.1")})}),/*#__PURE__*/(0,jsx_runtime.jsxs)(Stack_Stack,{spacing:2,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Link_Link,{href:"https://fishjar.github.io/kiss-translator/kiss-translator.user.js",children:"Install/Update Userscript for Tampermonkey/Violentmonkey"}),/*#__PURE__*/(0,jsx_runtime.jsx)(Link_Link,{href:"https://fishjar.github.io/kiss-translator/kiss-translator-ios-safari.user.js",children:"Install/Update Userscript for iOS Safari"}),/*#__PURE__*/(0,jsx_runtime.jsx)(Link_Link,{href:"https://fishjar.github.io/kiss-translator/options.html",children:"Open Options Page"})]}),loading?/*#__PURE__*/(0,jsx_runtime.jsx)("center",{children:/*#__PURE__*/(0,jsx_runtime.jsx)(CircularProgress_CircularProgress,{})}):/*#__PURE__*/(0,jsx_runtime.jsx)(ReactMarkdown,{children:error?error.message:data})]});}const src_root=client.createRoot(document.getElementById("root"));src_root.render(/*#__PURE__*/(0,jsx_runtime.jsx)(react.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(App,{})}));
})();
/******/ })()