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

This commit is contained in:
fishjar
2025-11-16 13:06:36 +00:00
parent 5a1ee381fe
commit 61cdd92214
8 changed files with 66 additions and 68 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -34881,7 +34881,7 @@ function objectWithoutProperties_objectWithoutProperties(source, excluded) {
const Fetch_excluded=(/* unused pure expression or super */ null && (["execute"])),Fetch_excluded2=["execute"],Fetch_excluded3=["get"];const useAsync=()=>{const[data,setData]=(0,react.useState)(null);const[loading,setLoading]=(0,react.useState)(false);const[error,setError]=(0,react.useState)(null);const execute=(0,react.useCallback)(async function(fn){if(!fn){return;}setLoading(true);setError(null);try{for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}const res=await fn(...args);setData(res);setLoading(false);return res;}catch(err){setError((err===null||err===void 0?void 0:err.message)||"An unknown error occurred");setLoading(false);// throw err;
}},[]);const reset=(0,react.useCallback)(()=>{setData(null);setLoading(false);setError(null);},[]);return{data,loading,error,execute,reset};};const useAsyncNow=(fn,arg)=>{const _useAsync=useAsync(),{execute}=_useAsync,asyncState=_objectWithoutProperties(_useAsync,Fetch_excluded);useEffect(()=>{if(fn){execute(fn,arg);}},[execute,fn,arg]);return _objectSpread({},asyncState);};const useFetch=()=>{const _useAsync2=useAsync(),{execute}=_useAsync2,asyncState=objectWithoutProperties_objectWithoutProperties(_useAsync2,Fetch_excluded2);const requester=(0,react.useCallback)(async(url,options)=>{var _response$headers$get;const response=await fetch(url,options);if(!response.ok){const errorInfo=await response.text();throw new Error("Request failed: ".concat(response.status," ").concat(response.statusText," - ").concat(errorInfo));}if(response.status===204){return null;}if((_response$headers$get=response.headers.get("Content-Type"))!==null&&_response$headers$get!==void 0&&_response$headers$get.includes("json")){return response.json();}return response.text();},[]);const get=(0,react.useCallback)(async function(url){let options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};try{const result=await execute(requester,url,_objectSpread2(_objectSpread2({},options),{},{method:"GET"}));return result;}catch(err){return null;}},[execute,requester]);const post=(0,react.useCallback)(async function(url,body){let options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{const result=await execute(requester,url,_objectSpread2(_objectSpread2({},options),{},{method:"POST",headers:_objectSpread2({"Content-Type":"application/json"},options.headers),body:JSON.stringify(body)}));return result;}catch(err){return null;}},[execute,requester]);const put=(0,react.useCallback)(async function(url,body){let options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{const result=await execute(requester,url,_objectSpread2(_objectSpread2({},options),{},{method:"PUT",headers:_objectSpread2({"Content-Type":"application/json"},options.headers),body:JSON.stringify(body)}));return result;}catch(err){return null;}},[execute,requester]);const del=(0,react.useCallback)(async function(url){let options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};try{const result=await execute(requester,url,_objectSpread2(_objectSpread2({},options),{},{method:"DELETE"}));return result;}catch(err){return null;}},[execute,requester]);return _objectSpread2(_objectSpread2({},asyncState),{},{get,post,put,del});};const useGet=url=>{const _useFetch=useFetch(),{get}=_useFetch,fetchState=objectWithoutProperties_objectWithoutProperties(_useFetch,Fetch_excluded3);(0,react.useEffect)(()=>{if(url)get(url);},[url,get]);return _objectSpread2({},fetchState);};
;// CONCATENATED MODULE: ./src/config/app.js
const APP_NAME="KISS Translator".trim().split(/\s+/).join("-");const APP_LCNAME=APP_NAME.toLowerCase();const APP_UPNAME=APP_NAME.toUpperCase();const APP_CONSTS={fabID:"".concat(APP_LCNAME,"-fab"),boxID:"".concat(APP_LCNAME,"-box"),popupID:"".concat(APP_LCNAME,"-popup")};const APP_VERSION="2.0.10".split(".");const THEME_LIGHT="light";const THEME_DARK="dark";
const APP_NAME="KISS Translator".trim().split(/\s+/).join("-");const APP_LCNAME=APP_NAME.toLowerCase();const APP_UPNAME=APP_NAME.toUpperCase();const APP_CONSTS={fabID:"".concat(APP_LCNAME,"-fab"),boxID:"".concat(APP_LCNAME,"-box"),popupID:"".concat(APP_LCNAME,"-popup")};const APP_VERSION="2.0.11".split(".");const THEME_LIGHT="light";const THEME_DARK="dark";
;// CONCATENATED MODULE: ./src/config/api.js
const DEFAULT_HTTP_TIMEOUT=10000;// 调用超时时间
const DEFAULT_FETCH_LIMIT=10;// 默认最大任务数量
@@ -35217,7 +35217,7 @@ const CLIENT_WEB="web";const CLIENT_CHROME="chrome";const CLIENT_EDGE="edge";con
;// CONCATENATED MODULE: ./src/config/index.js
;// CONCATENATED MODULE: ./src/index.js
function App(){var _I18N$about_md;const[lang,setLang]=(0,react.useState)("zh");const{data,loading,error}=useGet("".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("2.0.10")})}),/*#__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||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}=useGet("".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("2.0.11")})}),/*#__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||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,{})}));
})();
/******/ })()

View File

@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_app_name__",
"description": "__MSG_app_description__",
"version": "2.0.10",
"version": "2.0.11",
"default_locale": "en",
"author": "Gabe<yugang2002@gmail.com>",
"homepage_url": "https://github.com/fishjar/kiss-translator",

View File

@@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "__MSG_app_name__",
"description": "__MSG_app_description__",
"version": "2.0.10",
"version": "2.0.11",
"default_locale": "en",
"author": "Gabe<yugang2002@gmail.com>",
"homepage_url": "https://github.com/fishjar/kiss-translator",

View File

@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_app_name__",
"description": "__MSG_app_description__",
"version": "2.0.10",
"version": "2.0.11",
"default_locale": "en",
"author": "Gabe<yugang2002@gmail.com>",
"homepage_url": "https://github.com/fishjar/kiss-translator",

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
2.0.10
2.0.11