@moneko/core 2.0.60 → 2.0.61
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/build/common.js +1 -1
- package/build/swcrc.js +1 -1
- package/build/tsloader.config.js +1 -1
- package/build/utils.js +1 -1
- package/lib/components/fallback-comp.js +1 -1
- package/lib/components/layout-menu.js +1 -1
- package/lib/localizable.js +1 -1
- package/lib/menu.js +1 -1
- package/lib/packages/back-stage/app.js +1 -1
- package/lib/packages/back-stage/layout.js +1 -1
- package/lib/packages/single-spa/bootstrap.js +1 -1
- package/lib/react-router-dom/use-navgate.js +1 -1
- package/lib/router/index.js +1 -1
- package/lib/styles/normalize.css +20 -22
- package/package.json +8 -9
- package/typings/global.d.ts +0 -34
- package/lib/styles/variables.css +0 -35
package/build/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _export(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{ENTRYPATH:function(){return ENTRYPATH},log:function(){return log},CONFIG:function(){return CONFIG},PUBLICPATH:function(){return PUBLICPATH}});var _fs=
|
|
1
|
+
"use strict";function _export(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{ENTRYPATH:function(){return ENTRYPATH},log:function(){return log},CONFIG:function(){return CONFIG},PUBLICPATH:function(){return PUBLICPATH}});var _fs=_interop_require_default(require("fs")),_path=_interop_require_default(require("path")),_readline=_interop_require_default(require("readline")),_chalk=_interop_require_default(require("chalk")),_webpackmerge=require("webpack-merge"),_processenv=require("./process-env"),_utils=require("./utils");function _interop_require_default(e){return e&&e.__esModule?e:{default:e}}var ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"},includeModule=[_processenv.pkgName,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],defaultSplitChunk={chunks:"all",minSize:1024,minChunks:1};"single-component"===_processenv.APPTYPE&&(defaultSplitChunk=!1);var defaultConfig={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===_processenv.APPTYPE?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:_processenv.PROGRAMPATH+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:"./node_modules/"+_processenv.pkgName+"/template/index.html",favicon:"./node_modules/"+_processenv.pkgName+"/template/favicon.ico",tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:defaultSplitChunk,runtimeChunk:"single-component"!==_processenv.APPTYPE&&"single",moduleFederation:[],rulesInclude:{less:includeModule,css:includeModule,js:includeModule,media:includeModule,fonts:includeModule}},log=function(e){_readline.default.cursorTo(process.stdout,0),process.stdout.write(e)},customConf=defaultConfig,configPath=null,normalConf={},envConf={};try{configPath=_path.default.join(_processenv.PROGRAMPATH,"./config/index.ts"),_fs.default.accessSync(configPath,_fs.default.constants.R_OK)}catch(error){configPath=null}if(configPath)try{var conf=eval((0,_utils.tfc)(configPath)).default;normalConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}if(_processenv.CUSTOMCONFIG){var customConfigPath=null;try{customConfigPath=_path.default.join(_processenv.PROGRAMPATH,"./config/"+_processenv.CUSTOMCONFIG+".ts"),_fs.default.accessSync(customConfigPath,_fs.default.constants.R_OK)}catch(error){customConfigPath=null}if(null!==customConfigPath)try{var conf=eval((0,_utils.tfc)(customConfigPath)).default;envConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}}customConf=(0,_webpackmerge.merge)(customConf,normalConf,envConf),!1===customConf.devtool&&(customConf.sourceMap=!1),!1===customConf.sourceMap&&(customConf.devtool=!1),customConf.fixBrowserRouter&&(customConf.htmlPluginOption.tags||(customConf.htmlPluginOption.tags=[]),customConf.htmlPluginOption.tags.push({textContent:"\n (function(l) {\n if (l.search[1] === '/' ) {\n var decoded = l.search.slice(1).split('&').map(function(s) { \n return s.replace(/~and~/g, '&')\n }).join('?');\n window.history.replaceState(null, null,\n l.pathname.slice(0, -1) + decoded + l.hash\n );\n }\n }(window.location))\n "}));var CONFIG=customConf,PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG:CONFIG,log:log};
|
package/build/swcrc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,r){for(var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,r){for(var t in r)Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}(exports,{swcMinifyOption:function(){return n},default:function(){return s}});var e=require("webpack-merge"),r=require("./common"),t=function(e){return e&&e.__esModule?e:{default:e}}(require("./envFlags")),o={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}},n={compress:{top_retain:[],keep_infinity:!0,global_defs:{"@alert":"console.log"},pure_funcs:["console.log","console.warn","console.error","console.info"],toplevel:!1,drop_console:!0,drop_debugger:!0,module:!1,ecma:2015,ie8:!1,keep_classnames:void 0,keep_fnames:!1},mangle:!0},s=function(n){void 0===n&&(n=!1);var s=Object.assign({module:{type:"es6",ignoreDynamic:!0,strict:!0,strictMode:!0,lazy:!0,noInterop:!0},jsc:{parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:n,development:n},constModules:{globals:{"env-flags":t.default}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(var r=0,t=Object.keys(e),o=t.length;r<o;r++)e[t[r]].transform=t[r]+"/"+e[t[r]].transform,e[t[r]].style&&(e[t[r]].style=t[r]+"/"+e[t[r]].style);return e}(r.CONFIG.importOnDemand||{})]]}},sourceMaps:!0},!n&&o);return r.CONFIG.swcrc&&(s=(0,e.merge)(s,"function"==typeof r.CONFIG.swcrc?r.CONFIG.swcrc(n):r.CONFIG.swcrc)),s};
|
package/build/tsloader.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _default}});var _fs=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _default}});var _fs=_interop_require_default(require("fs")),_reactrefreshtypescript=_interop_require_default(require("react-refresh-typescript")),_tsimportplugin=_interop_require_default(require("ts-import-plugin")),_webpackmerge=_interop_require_default(require("webpack-merge")),_common=require("./common"),_processenv=require("./process-env"),_utils=require("./utils");function _interop_require_default(e){return e&&e.__esModule?e:{default:e}}var importOnDemand=[];Array.isArray(_common.CONFIG.importOnDemand)&&Object.assign(importOnDemand,_common.CONFIG.importOnDemand.map(function(e){return(0,_tsimportplugin.default)(e)}));var beforeTransformers=[].concat(importOnDemand);_processenv.DEV&&_processenv.hasReact&&beforeTransformers.push((0,_reactrefreshtypescript.default)());var tsLoaderConfig={transpileOnly:!0,getCustomTransformers:function(){return{before:beforeTransformers}}};try{var customTsloaderConfigPath=(0,_utils.resolveProgramPath)("tsloader.config.ts");_fs.default.accessSync(customTsloaderConfigPath,_fs.default.constants.R_OK);var customTsloaderConfig=eval((0,_utils.tfc)(customTsloaderConfigPath)).default;tsLoaderConfig=(0,_webpackmerge.default)(tsLoaderConfig,(0,_utils.isFunction)(customTsloaderConfig)?customTsloaderConfig(process):customTsloaderConfig)}catch(error){}var _default=tsLoaderConfig;
|
package/build/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _export(e,r){for(var n in r)Object.defineProperty(e,n,{enumerable:!0,get:r[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{tfc:function(){return tfc},toUpperCaseString:function(){return toUpperCaseString},getIPAdress:function(){return getIPAdress},resolveProgramPath:function(){return resolveProgramPath},resolveNodeModulesPath:function(){return resolveNodeModulesPath},resolve:function(){return resolve},isObject:function(){return isObject},isFunction:function(){return isFunction}});var _os=require("os"),_path=
|
|
1
|
+
"use strict";function _export(e,r){for(var n in r)Object.defineProperty(e,n,{enumerable:!0,get:r[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{tfc:function(){return tfc},toUpperCaseString:function(){return toUpperCaseString},getIPAdress:function(){return getIPAdress},resolveProgramPath:function(){return resolveProgramPath},resolveNodeModulesPath:function(){return resolveNodeModulesPath},resolve:function(){return resolve},isObject:function(){return isObject},isFunction:function(){return isFunction}});var _os=require("os"),_path=_interop_require_default(require("path")),_core=require("@swc/core"),_resolversync=_interop_require_default(require("./resolver-sync"));function _interop_require_default(e){return e&&e.__esModule?e:{default:e}}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var swcOption={inputSourceMap:!1,sourceMaps:!1,module:{type:"commonjs"},jsc:{parser:{syntax:"typescript"},loose:!1}},tfc=function(filepath){var out=(0,_core.transformFileSync)(filepath,swcOption).code||"{}";try{return eval(out)}catch(error){return out}};function toUpperCaseString(e){return null==e?void 0:e.replace(/\b\w/g,function(e){return e.toUpperCase()}).replace(/\./g," ")}function getIPAdress(){var e=(0,_os.networkInterfaces)();for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))for(var n=e[r],t=0;t<n.length;t++){var o=n[t];if("IPv4"===o.family&&"127.0.0.1"!==o.address&&!o.address.startsWith("169.254")&&!o.internal)return o.address}}function resolveProgramPath(e){return _path.default.resolve(process.cwd(),"./"+e)}var resolveNodeModulesPath=function(e){return resolveProgramPath("node_modules/"+e)},resolve=function(e){return _resolversync.default.resolveSync({},process.cwd(),e)||e},funcTag="[object Function]",asyncTag="[object AsyncFunction]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isObject(e){var r=void 0===e?"undefined":_type_of(e);return null!==e&&("object"==r||"function"==r)}function isFunction(e){if(!isObject(e))return!1;var r=Object.prototype.toString.call(e);return r==funcTag||r==asyncTag||r==genTag||r==proxyTag}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import*as e from"react";export default e.memo(function(r){var t=r.directory,n=void 0===t?"components":t,o=r.compName,c=function(e,r){if(null==e)return{};var t,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r.indexOf(t=c[n])>=0||(o[t]=e[t]);return o}(r,["directory","compName"]),i=e.Fragment;try{i=require("@/"+n+"/"+o).default}catch(e){console.info(o+" 组件不存在, 请在 @/"+n+"/"+o+" 目录下新建 index.tsx, 并导出默认组件")}return e.isValidElement(i)?null:e.createElement(i,c)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(){return(e=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}import n,{isValidElement as t,useCallback as r,useEffect as o,useMemo as
|
|
1
|
+
function e(){return(e=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}import n,{isValidElement as t,useCallback as r,useEffect as o,useMemo as i}from"react";import{cx as l}from"@emotion/css";import{Menu as a}from"antd";import{useSearchParams as c,Link as u}from"react-router-dom";import m from"./iconfont";import p from"../localizable";import s,{expandMenu as d}from"../menu";export default n.memo(function(f){var y=f.collapsed,v=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n.indexOf(t=i[r])>=0||(o[t]=e[t]);return o}(f,["collapsed"]),h=s.menus,b=s.kv,g=s.activeKey,K=s.expandKey,O=p.t,I=c()[0],k=r(function(e){return e.map(function(e){var r=e.icon,o=e.itemIcon,i=e.disabled,l=e.type,a=e.key,c=e.path,p=e.label,s=e.children,d=O[p],f=Array.isArray(s)?k(s):s;return Object.assign({path:c,type:l,disabled:i,key:a,itemIcon:t(o)?o:o?n.createElement(m,{type:o}):null,icon:t(r)?r:r?n.createElement(m,{type:r}):null,label:!c||(null==f?void 0:f.length)?d:n.createElement(u,{preventScrollReset:!0,to:a+"?menuId="+a},d)},(null==f?void 0:f.length)&&{children:f})})},[O]),x=i(function(){return I.get("menuId")},[I]),j=i(function(){return k(h.filter(function(e){return!e.hideMenu}))},[k,h]),E=i(function(){return g?[g]:[]},[g]);return o(function(){var e=x&&b[x];if(e&&!y&&s.expandKey){var n=[].concat(s.expandKey);n.includes(x)||n.push(x),e.parentId&&!n.includes(e.parentId)&&n.push(e.parentId),d(n)}},[y,x,b]),o(function(){x!==g&&x&&(s.activeKey=x)},[g,x]),n.createElement(a,e({defaultSelectedKeys:E,selectedKeys:E,defaultOpenKeys:K,openKeys:y?void 0:K,onOpenChange:d,mode:"inline",subMenuCloseDelay:0,triggerSubMenuAction:"click",items:j},v,{className:l("layout-menu",v.className)}))});
|
package/lib/localizable.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{persistence as t}from"@moneko/common";import n from"shared-store-object";import e from"./persistentKey";var a,o={keys:function(){return[]}};try{o=hasLocales?require.context("@/locales/",!0,/\.(t|j)s$/):{keys:function(){return[]}}}catch(t){console.warn(t)}var r={},
|
|
1
|
+
import{persistence as t}from"@moneko/common";import n from"shared-store-object";import e from"./persistentKey";var a,o={keys:function(){return[]}};try{o=hasLocales?require.context("@/locales/",!0,/\.(t|j)s$/):{keys:function(){return[]}}}catch(t){console.warn(t)}var r={},i=[];null==o.keys||null==(a=o.keys())||a.map(function(t,n){var e=o(t).default;if(e&&"[object Object]"===Object.prototype.toString.call(e)){var a=e.language,l=void 0===a?t.replace(/(.*\/)*([^.]+).*/gi,"$2"):a,c=e.title,u=void 0===c?l:c,s=e.icon,g=e.translation;0===n&&i.splice(0),i.push({language:l,title:u,icon:s}),r[l]={language:l,title:u,icon:s,translation:new Proxy(void 0===g?{}:g,{get:function(t,n){return t[n]||n}})}}});var l=t.load(e.language,"zh_CN"),c=Object.assign({title:"简体中文",language:"zh_CN",translation:{}},r[l]||r.zh_CN),u=n({language:l,t:c.translation,locales:i});export function setLanguage(t){var n;u.language=t,u.t=(null==(n=r[t])?void 0:n.translation)||c.translation}export function interpolateString(t,n){return t.replace(/\${\w+}/g,function(t){var e=n[t.slice(2,-1)];return void 0!==e?e.toString():""})}export default u;
|
package/lib/menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function t(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}import{isEqual as
|
|
1
|
+
function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function t(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}function n(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}}import{isEqual as o,isFunction as a,persistence as i}from"@moneko/common";import u from"shared-store-object";import l from"./persistentKey";var f=i.load,c=u({activeKey:f(l.menuActiveKey,"home"),expandKey:f(l.menuExpandKey,[]),menus:f(l.menuMenus,[]),kv:f(l.menuKv,{}),tabs:f(l.menuTabs,[])}),s=function(e,r){if(void 0===r&&(r=[]),0===e.length)return r;var n=e[0],o=n.children,a=void 0===o?[]:o,i=n.i18n,u=n.label,l=n.hideMenu,f=t(n,["children","i18n","label","hideMenu"]),c=Object.create(null);return Object.assign(c,f,{label:i||u,props:void 0,element:void 0}),a.length&&(c.children=s(a)),l||r.push(c),s(e.slice(1),r)},y=function(e,r){for(var o,a=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=n(e))){t&&(e=t);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(o=a()).done;){var i=o.value,u=i.children,l=t(i,["children"]);r[i.key]=l,(null==u?void 0:u.length)&&y(u,r)}};export function setMenu(e){var r=s(e),t={};y(r,t),c.menus=r,c.kv=t}export function addTab(t){var a=c.kv[t.key];if(a&&!c.tabs.find(function(e){return e.key===t.key})){var i,u=((function(r){if(Array.isArray(r))return e(r)})(i=c.tabs)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||n(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([r({},a,{i18n:a.i18n||"route-"+a.key},t)]);o(u,c.tabs)||(c.tabs=u)}}export function openTab(e){c.activeKey=e.key,addTab(e)}export function closeTab(e,r,t){if(void 0===r&&(r="self"),e){for(var n,o=c.tabs,i=c.activeKey,u=[],l=[],f="self"===r,s=o.findIndex(function(r){return r.key===e}),y=0,d=o.length;y<d;y++){var b,v=o[y],p=(b=y,!1===v.closable||({left:b>=s,right:b<=s,other:b===s,self:e!==v.key})[r]);if(f){if(!p&&e===i){var m=y?y-1:y+1;o[m]&&(i=o[m].key,n=o[m])}}else p&&v.key===e&&i!==e&&(i=e,n=v);p||u.push(v),p&&l.push(v)}if(c.tabs=l,c.activeKey=i,a(t)){t(u,n);return}}}export function expandMenu(e){o(e,c.expandKey)||(c.expandKey=e)}export default c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(this,arguments)}import r,{useMemo as o}from"react";import{ConfigProvider as t}from"antd";import a from"antd/es/locale/en_US";import l from"antd/es/locale/zh_CN";import n from"dayjs";import i from"dayjs/plugin/relativeTime";import{RouterProvider as m}from"react-router-dom";import{createRouter as p,prefixRouter as f,routerData as c,RouterFragment as s}from"../../components/app-router";import u from"../../components/fallback";import d from"../../localizable";import{onlyLoginRouter as g}from"../../router";import"dayjs/locale/zh.js";import"dayjs/locale/en.js";import{global as h}from"@/store";var v={zh_CN:l,en_US:a};n.extend(i),t.config({prefixCls:providerConfig.prefixCls,iconPrefixCls:providerConfig.iconPrefixCls,theme:providerConfig.theme});export default function(){var a=h.isLogin,n=d.language,i=d.t,C=o(function(){return e({validateMessages:{required:""+i["ph:please-fill"]+"${label}!",types:{email:"${label}"+i["wrong-format"]},pattern:{mismatch:""+i["ph:fill-correct"]+"${label}!"}},locale:v[n]||l},providerConfig)},[n,i]);return r.createElement(s,null,r.createElement(t,
|
|
1
|
+
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(this,arguments)}import r,{useMemo as o}from"react";import{ConfigProvider as t}from"antd";import a from"antd/es/locale/en_US";import l from"antd/es/locale/zh_CN";import n from"dayjs";import i from"dayjs/plugin/relativeTime";import{RouterProvider as m}from"react-router-dom";import{createRouter as p,prefixRouter as f,routerData as c,RouterFragment as s}from"../../components/app-router";import u from"../../components/fallback";import d from"../../localizable";import{onlyLoginRouter as g}from"../../router";import"dayjs/locale/zh.js";import"dayjs/locale/en.js";import{global as h}from"@/store";var v={zh_CN:l,en_US:a};n.extend(i),t.config({prefixCls:providerConfig.prefixCls,iconPrefixCls:providerConfig.iconPrefixCls,theme:providerConfig.theme});export default function(){var a=h.isLogin,n=d.language,i=d.t,C=o(function(){return e({validateMessages:{required:""+i["ph:please-fill"]+"${label}!",types:{email:"${label}"+i["wrong-format"]},pattern:{mismatch:""+i["ph:fill-correct"]+"${label}!"}},locale:v[n]||l},providerConfig)},[n,i]);return r.createElement(s,null,r.createElement(t,C,r.createElement(m,{router:p(a?c:f(g,r.createElement(u,null)),{basename:programInfo.routeBaseName,window:window}),fallbackElement:r.createElement(u,null)})))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(){return(n=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n}).apply(this,arguments)}function e(){var n,t,o=(n=["\n .",", ."," {\n z-index: 2;\n }\n ."," {\n position: sticky;\n top: 64px;\n overflow: initial !important;\n margin: 16px 16px 0 !important;\n\n > .","-tabs-nav {\n .","-tabs-tab {\n border-color: var(--border-color, rgb(5 5 5 / 6%)) !important;\n border-bottom-color: var(--border-color, rgb(5 5 5 / 6%)) !important;\n border-radius: var(--border-radius) !important;\n backdrop-filter: blur(16px);\n background-color: rgba(255, 255, 255, 0.8);\n &.","-tabs-tab-active {\n background-color: rgba(255, 255, 255, 0.9);\n }\n }\n\n &::before {\n content: none;\n }\n }\n }\n ."," {\n width: 100% !important;\n min-height: 100vh !important;\n }\n .",", ."," {\n overflow-y: auto;\n max-height: 100vh;\n }\n ."," {\n overflow-y: auto;\n }\n ."," {\n overflow-y: auto;\n }\n ."," {\n display: flex;\n margin: 0 16px;\n flex-direction: column;\n z-index: 1;\n }\n ."," {\n border-radius: var(--border-radius);\n padding: 24px;\n background: var(--component-card-bg, #fff);\n box-shadow: var(--box-shadow-lite);\n flex: 1;\n transition-property: background-color, box-shadow;\n }\n .",", .",", ."," > svg {\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n }\n ."," {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n gap: 10px;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n padding: 14px;\n height: 68px;\n text-align: center;\n color: #de4553;\n transition-property: background-color, border-color;\n cursor: pointer;\n user-select: none;\n\n > svg,\n &::before {\n transition-property: opacity;\n }\n\n > svg {\n height: 32px;\n opacity: 0;\n }\n\n &::before {\n display: block;\n width: 22px;\n height: 32px;\n background: url(",") no-repeat center center / contain;\n opacity: 1;\n content: '';\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n }\n }\n"],t||(t=n.slice(0)),n.raw=t,n);return e=function(){return o},o}import t,{useCallback as o,useEffect as r,useMemo as i,useState as a,isValidElement as
|
|
1
|
+
function n(){return(n=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n}).apply(this,arguments)}function e(){var n,t,o=(n=["\n .",", ."," {\n z-index: 2;\n }\n ."," {\n position: sticky;\n top: 64px;\n overflow: initial !important;\n margin: 16px 16px 0 !important;\n\n > .","-tabs-nav {\n .","-tabs-tab {\n border-color: var(--border-color, rgb(5 5 5 / 6%)) !important;\n border-bottom-color: var(--border-color, rgb(5 5 5 / 6%)) !important;\n border-radius: var(--border-radius, 8px) !important;\n backdrop-filter: blur(16px);\n background-color: rgba(255, 255, 255, 0.8);\n &.","-tabs-tab-active {\n background-color: rgba(255, 255, 255, 0.9);\n }\n }\n\n &::before {\n content: none;\n }\n }\n }\n ."," {\n width: 100% !important;\n min-height: 100vh !important;\n }\n .",", ."," {\n overflow-y: auto;\n max-height: 100vh;\n }\n ."," {\n overflow-y: auto;\n }\n ."," {\n overflow-y: auto;\n }\n ."," {\n display: flex;\n margin: 0 16px;\n flex-direction: column;\n z-index: 1;\n }\n ."," {\n border-radius: var(--border-radius, 8px);\n padding: 24px;\n background: var(--component-card-bg, #fff);\n box-shadow: var(--box-shadow-lite);\n flex: 1;\n transition-property: background-color, box-shadow;\n }\n .",", .",", ."," > svg {\n transition-duration: var(--transition-duration, 0.3s);\n transition-timing-function: var(\n --transition-timing-function,\n cubic-bezier(0.94, -0.1, 0.1, 1.2)\n );\n }\n ."," {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n gap: 10px;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n padding: 14px;\n height: 68px;\n text-align: center;\n color: #de4553;\n transition-property: background-color, border-color;\n cursor: pointer;\n user-select: none;\n\n > svg,\n &::before {\n transition-property: opacity;\n }\n\n > svg {\n height: 32px;\n opacity: 0;\n }\n\n &::before {\n display: block;\n width: 22px;\n height: 32px;\n background: url(",") no-repeat center center / contain;\n opacity: 1;\n content: '';\n transition-duration: var(--transition-duration, 0.3s);\n transition-timing-function: var(\n --transition-timing-function,\n cubic-bezier(0.94, -0.1, 0.1, 1.2)\n );\n }\n }\n"],t||(t=n.slice(0)),n.raw=t,n);return e=function(){return o},o}import t,{useCallback as o,useEffect as r,useMemo as i,useState as a,isValidElement as c}from"react";import{ReloadOutlined as l,DeleteRowOutlined as m,CloseOutlined as s}from"@ant-design/icons";import{css as u,injectGlobal as d}from"@emotion/css";import{Tabs as p,Layout as f,Dropdown as b}from"antd";import{useAliveController as y}from"react-activation";import{useSearchParams as g,useOutlet as v,useNavigate as h}from"react-router-dom";import x from"../../components/fallback-comp";import k from"../../components/iconfont";import w from"../../components/layout-menu";import E from"../../localizable";import N,{openTab as T,closeTab as C}from"../../menu";var z=providerConfig.prefixCls,I=function(n){return z+"-dashboard-"+n},S={tabs:I("tabs"),layout:I("layout"),sider:I("sider"),header:I("header"),logo:I("logo"),section:I("section"),content:I("content"),view:I("view")},j=u(e(),S.header,S.tabs,S.tabs,z,z,z,S.layout,S.sider,S.section,S.section,S.sider,S.content,S.view,S.view,S.logo,S.logo,S.logo,require(favicon));d([j]);var O=[{label:"关闭左侧标签",icon:t.createElement(m,{style:{transform:"scaleX(-1)"}}),key:"left"},{label:"关闭右侧标签",icon:t.createElement(m,null),key:"right"},{label:"关闭其他标签",icon:t.createElement(s,null),key:"other"},{label:"刷新标签页",icon:t.createElement(l,null),key:"refresh"}];export default function(e){var l=e.children,m=N.activeKey,s=N.tabs,u=N.kv,d=E.t,z=v(),I=h(),j=y().dropScope,P=g()[0],K=a(!1),L=K[0],q=K[1],A=o(function(n){if(n)var e=window.setTimeout(function(){q(n),window.clearTimeout(e),e=null},0);else{q(n);var t=window.setTimeout(function(){window.clearTimeout(t),t=null},30)}},[]),B=o(function(n,e){if("refresh"===e){I("/refresh");return}n&&C(n,e,function(n,e){null==n||n.forEach(function(n){n.path&&j&&j(n.path)}),e&&I(e.path+"?menuId="+e.key)})},[j,I]),H=i(function(){return{menuId:P.get("menuId"),dynamicLabel:P.get("dynamicTitle")||""}},[P]),M=H.menuId,X=H.dynamicLabel;r(function(){M&&u[M]&&T({key:M,dynamicTitle:X})},[X,u,M]);var D=o(function(n){return n===m?O:O.filter(function(n){return(null==n?void 0:n.key)!=="refresh"})},[m]),F=o(function(n,e){"remove"===e&&"string"==typeof n&&B(n)},[B]),G=o(function(n){I(u[n].key+"?menuId="+u[n].key)},[u,I]),J=i(function(){return s.map(function(n){var e=n.key,o=n.icon,r=n.label,i=n.dynamicTitle,a=n.closable;return{key:e,label:t.createElement(b,{menu:{items:D(e),onClick:function(n){n.domEvent.stopPropagation(),B(e,n.key)}},trigger:["contextMenu"],destroyPopupOnHide:!0},t.createElement("div",null,c(o)?o:o?t.createElement(k,{type:o}):null,d[r||"route-"+e]+(i||""))),closable:a}})},[B,D,d,s]);return t.createElement(f,{className:S.layout},layoutSider?t.createElement(f.Sider,n({className:S.sider,trigger:null,collapsible:!0,collapsed:L,onBreakpoint:function(n){return A(n)},onCollapse:function(n){return A(n)},theme:"light",breakpoint:"md"},layoutSider),t.createElement("div",{className:S.logo,"data-title":projectName},t.createElement(x,{compName:"logo",show:!L})),t.createElement(w,{collapsed:L,theme:layoutSider.theme})):null,t.createElement(f,{className:S.section},t.createElement(x,{compName:"layout-header",className:S.header,collapsed:L,onCollapsed:function(){return A(!L)}}),t.createElement(p,{className:S.tabs,hideAdd:!0,onTabClick:G,activeKey:m,type:"editable-card",onEdit:F,items:J,animated:!0}),t.createElement(f.Content,{className:S.content},t.createElement("div",{className:S.view},l||z),t.createElement(x,{compName:"layout-footer"}))))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n,t,r,e,o,u,a){try{var i=n[u](a),l=i.value}catch(n){r(n);return}i.done?t(l):Promise.resolve(l).then(e,o)}function t(t){return function(){var r=this,e=arguments;return new Promise(function(o,u){var a=t.apply(r,e);function i(t){n(a,o,u,i,l,"next",t)}function l(t){n(a,o,u,i,l,"throw",t)}i(void 0)})}}function r(){return(r=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n}).apply(this,arguments)}
|
|
1
|
+
function n(n,t,r,e,o,u,a){try{var i=n[u](a),l=i.value}catch(n){r(n);return}i.done?t(l):Promise.resolve(l).then(e,o)}function t(t){return function(){var r=this,e=arguments;return new Promise(function(o,u){var a=t.apply(r,e);function i(t){n(a,o,u,i,l,"next",t)}function l(t){n(a,o,u,i,l,"throw",t)}i(void 0)})}}function r(){return(r=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n}).apply(this,arguments)}function e(n,t){var r,e,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(u){return function(i){return function(u){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,e&&(o=2&u[0]?e.return:u[0]?e.throw||((o=e.return)&&o.call(e),0):e.next)&&!(o=o.call(e,u[1])).done)return o;switch(e=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,e=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(n,a)}catch(n){u=[6,n],e=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,i])}}}import o from"react";import{isFunction as u}from"@moneko/common";import a from"./app";hasPersist&&require("../../persist");var i=APPENTRY?require(APPENTRY):null,l=require(ReactDOMPath),c=parseFloat(o.version);function s(n){var t=n.container,e=n.basename,u=n.fallback,i=n.language,s=function(n,t){if(null==n)return{};var r,e,o={},u=Object.keys(n);for(e=0;e<u.length;e++)t.indexOf(r=u[e])>=0||(o[r]=n[r]);return o}(n,["container","basename","fallback","language"]),f=(null==t?void 0:t.querySelector("#root"))||document.querySelector("#root"),p={basename:e,fallback:u,language:i};window.primaryApp=r({},s,{container:f}),c>=18?"ssr"===programInfo.renderMode?window.rootInstance=l.hydrateRoot(f,o.createElement(a,p)):(window.rootInstance=l.createRoot(f),window.rootInstance.render(o.createElement(a,p))):(module.hot?l.render:l.hydrate)(o.createElement(a,p),f)}window.__POWERED_BY_QIANKUN__||s({});export function bootstrap(){return f.apply(this,arguments)}function f(){return(f=t(function(){return e(this,function(n){return u(null==i?void 0:i.bootstrap)&&(null==i||i.bootstrap()),[2]})})).apply(this,arguments)}export function unmount(n){return p.apply(this,arguments)}function p(){return(p=t(function(n){var t,r;return e(this,function(e){return u(null==i?void 0:i.unmount)&&(null==i||i.unmount(n)),t=n.container,c>=18?window.rootInstance.unmount():(r=(null==t?void 0:t.querySelector("#root"))||document.querySelector("#root"),l.unmountComponentAtNode(r)),[2]})})).apply(this,arguments)}export function mount(n){return h.apply(this,arguments)}function h(){return(h=t(function(n){return e(this,function(t){return u(null==i?void 0:i.mount)&&(null==i||i.mount(n)),s(n),[2]})})).apply(this,arguments)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function t(r,t){var
|
|
1
|
+
function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function t(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}}function e(r,e){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=t(r))||e&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}import{useNavigate as n,useSearchParams as o}from"react-router-dom";export default function(a){var i,u=Array.from(new Set(["menuId","dynamicTitle"].concat(function(t){if(Array.isArray(t))return r(t)}(i=a||[])||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(i)||t(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))).filter(Boolean),l=n(),f=o()[0];return function(r,t){if(-1===r){l(-1);return}for(var n,o={},a=r.split("?"),i=new URLSearchParams(a[1]||""),c=e(f);!(n=c()).done;){var m=n.value,y=m[0],d=m[1];u.includes(y)&&(o[y]=d)}for(var s,b=e(i);!(s=b()).done;){var v=s.value,p=v[0],h=v[1];u.includes(p)&&(o[p]=h)}var S=new URLSearchParams(o).toString();l(S?a[0]+"?"+S:a[0],t)}};
|
package/lib/router/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(){return(e=Object.assign||function(
|
|
1
|
+
function r(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=Array(e);n<e;n++)t[n]=r[n];return t}function e(){return(e=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r}).apply(this,arguments)}import{createElement as n,lazy as t}from"react";import{isUndefined as o}from"@moneko/common";import{pathToRegexp as i}from"path-to-regexp";import{Outlet as a}from"react-router-dom";export function lazyImport(r){return t(function(){return new Promise(function(e){return import("@/pages/"+r.replace(/:/g,"$").replace(/^\//,"")).then(e).catch(function(){return Promise.resolve({default:a})})})})}export var myPkgs=[];export var myDemoKv={};export var mdxComponents={};function l(r,t){return n("h"+t,e({"data-prefix":"# ",role:"heading","aria-level":t},r))}if("library"===APPTYPE){var u,c,p=require.context("@pkg/",!0,/README\.mdx?$/),s={};try{s=require("@/components/components").default}catch(r){}Object.assign(mdxComponents,e({h1:function(r){return l(r,1)},h2:function(r){return l(r,2)},h3:function(r){return l(r,3)},h4:function(r){return l(r,4)},h5:function(r){return l(r,5)},h6:function(r){return l(r,6)},pre:function(r){var e=n("code",r);return r.className?n(mdxComponents.CodeBlock||"pre",{lang:r.className.replace("language-","").replace(/ .*$/,"")},e):e}},s)),null==(u=p.keys())||u.forEach(function(r){var n=r.substring(2).split("/").slice(0,-1).join("/"),t=p(r),o=t.basic,i=t.default;myPkgs.push(e({key:n,path:n,element:i},o,{props:{components:mdxComponents,path:n}}))});var h=require.context("@pkg/",!0,/\/examples\/(.+)\.mdx$/);null==(c=h.keys())||c.forEach(function(e){var n=e.substring(2).split("/"),t=n[0];Array.isArray(myDemoKv[t])||(myDemoKv[t]=[]);for(var o,i,a=h(e),l=a.matchAll(/```([^\r\n]+)?\r?\n([\s\S]*?)\r?\n```/g),u="",c="",p=null,s=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,n)}}(e))){t&&(e=t);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(l);!(i=s()).done;){var f=i.value;c=f[1]||"tsx",u=f[2],p=a.replace(f[0],"")}myDemoKv[t].push({language:c,code:u,description:p,title:null==(o=n.pop())?void 0:o.replace(/\.mdx$/,""),noInline:/render\([^\\)]*\);?(?=\s*$)/.test(u)})})}var f=[];try{f=require("@/router").default}catch(r){console.info("自定义路由请在 router 目录下新建 index.ts, 类型: RouterProps[]",r)}function m(r,e){return["*"===e&&"*"!==r?void 0:e,r].filter(Boolean).join("/")}var d=function(r){for(var e=[],n=0;n<r.length;n++)for(var t=r[n].split("/").slice(0,-1),o=e,i=0;i<t.length;i++){var a=t[i];if(""!==a){"."===a&&(a="*");var l=o;if(Array.isArray(o)){for(var u=0;u<o.length;u++)if(o[u].path===a){o=o[u].children;break}}if(l===o){var c=i===t.length-1?r[n]:t.slice(0,i+1).join("/")+"/",p={key:c=c.substring(2,c.lastIndexOf("/")),path:a,i18n:"route-"+c,children:[],alive:!1,element:lazyImport(c),hideMenu:c.includes(":"),props:{path:c}};Array.isArray(o)&&o.push(p),o=p.children}}}return e}(require.context("@/pages/",!0,/\.(t|j)sx$/,"lazy").keys().map(function(r){return r.replace(/\$/g,":")}));function y(r,n,t){return void 0===r&&(r=[]),r.map(function(r){var o=e({},r);return void 0===o.key&&(o.key=m(r.path,t)),void 0===o.i18n&&(o.i18n="route-"+o.key),void 0===o.alive&&(o.alive=!1),"*"===o.path&&void 0===o.hideMenu&&(o.hideMenu=!0),Array.isArray(o.children)&&(o.children=o.children.length?y(o.children,n,o.key):void 0),o.element||(o.element=lazyImport(o.key),o.props={path:o.key}),!!o.onlyLogin!==n||o.root?o:null}).filter(Boolean)}for(var v=[].concat(f),g=0,x=d.length;g<x;g++)!function r(n,t,i){var a,l=n.find(function(r){return r.path===t.path});l?(l.key=m(l.path,i),o(l.i18n)&&(l.i18n="route-"+l.key),o(l.alive)&&(l.alive=!1),o(l.element)&&t.element&&(l.element=t.element,l.props=t.props),o(l.hideMenu)&&(l.hideMenu="*"===l.path||l.key.includes(":")),Object.assign(l,e({},t,l)),t.children&&(!l.children&&Array.isArray(t.children)&&(l.children=t.children),null==(a=t.children)||a.forEach(function(e){r(null==l?void 0:l.children,e,null==l?void 0:l.key)}))):n.push(t)}(v,d[g]);export var onlyLoginRouter=y(v,!1);export var router=y(v,!0);export function matchUtil(r){var e={key:""};return!function n(t){for(var o=0,a=t.length;o<a;o++){if(t[o].path&&"*"!==t[o].path&&t[o].key)try{if(i(t[o].key).exec(r.substring(1))){e=t[o];return}}catch(r){}Array.isArray(t[o].children)&&n(t[o].children)}}(router),e}
|
package/lib/styles/normalize.css
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
@import url('tailwindcss/utilities');
|
|
2
|
-
@import url('./variables.css');
|
|
3
2
|
|
|
4
3
|
html,
|
|
5
4
|
body {
|
|
6
5
|
margin: 0;
|
|
7
6
|
padding: 0;
|
|
8
|
-
|
|
9
|
-
font-size: var(--font-size);
|
|
10
|
-
font-family:
|
|
11
|
-
|
|
7
|
+
inline-size: 100vi;
|
|
8
|
+
font-size: var(--font-size, 14px);
|
|
9
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
10
|
+
Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
11
|
+
'Noto Color Emoji', Helvetica, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans';
|
|
12
|
+
color: var(--text-color, rgb(0 0 0 / 65%));
|
|
12
13
|
line-height: 1.8;
|
|
13
|
-
transition-duration: var(--transition-duration);
|
|
14
|
+
transition-duration: var(--transition-duration, 0.3s);
|
|
14
15
|
transition-property: background-color, color;
|
|
15
|
-
transition-timing-function: var(--transition-timing-function);
|
|
16
|
+
transition-timing-function: var(--transition-timing-function, cubic-bezier(0.94, -0.1, 0.1, 1.2));
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
#root {
|
|
@@ -21,12 +22,12 @@ body {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
#root > main {
|
|
24
|
-
animation: route-in var(--transition-duration);
|
|
25
|
+
animation: route-in var(--transition-duration, 0.3s);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
input,
|
|
28
29
|
textarea {
|
|
29
|
-
caret-color:
|
|
30
|
+
caret-color: inherit;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
h1 {
|
|
@@ -36,7 +37,7 @@ h1 {
|
|
|
36
37
|
|
|
37
38
|
hr {
|
|
38
39
|
overflow: visible;
|
|
39
|
-
|
|
40
|
+
block-size: 0;
|
|
40
41
|
box-sizing: content-box;
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -52,7 +53,7 @@ a {
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
abbr[title] {
|
|
55
|
-
border-
|
|
56
|
+
border-block-end: none;
|
|
56
57
|
text-decoration: underline;
|
|
57
58
|
text-decoration: underline dotted;
|
|
58
59
|
}
|
|
@@ -82,11 +83,11 @@ sup {
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
sub {
|
|
85
|
-
|
|
86
|
+
inset-block-end: -0.25em;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
sup {
|
|
89
|
-
|
|
90
|
+
inset-block-start: -0.5em;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
img {
|
|
@@ -148,7 +149,7 @@ fieldset {
|
|
|
148
149
|
legend {
|
|
149
150
|
display: table;
|
|
150
151
|
padding: 0;
|
|
151
|
-
max-
|
|
152
|
+
max-inline-size: 100%;
|
|
152
153
|
white-space: normal;
|
|
153
154
|
color: inherit;
|
|
154
155
|
box-sizing: border-box;
|
|
@@ -170,10 +171,7 @@ summary {
|
|
|
170
171
|
display: list-item;
|
|
171
172
|
}
|
|
172
173
|
|
|
173
|
-
template
|
|
174
|
-
display: none;
|
|
175
|
-
}
|
|
176
|
-
|
|
174
|
+
template,
|
|
177
175
|
[hidden] {
|
|
178
176
|
display: none;
|
|
179
177
|
}
|
|
@@ -186,7 +184,7 @@ template {
|
|
|
186
184
|
|
|
187
185
|
[type='number']::-webkit-inner-spin-button,
|
|
188
186
|
[type='number']::-webkit-outer-spin-button {
|
|
189
|
-
|
|
187
|
+
block-size: auto;
|
|
190
188
|
}
|
|
191
189
|
|
|
192
190
|
[type='search'] {
|
|
@@ -204,8 +202,8 @@ template {
|
|
|
204
202
|
}
|
|
205
203
|
|
|
206
204
|
::-webkit-scrollbar {
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
inline-size: 4px;
|
|
206
|
+
block-size: 4px;
|
|
209
207
|
}
|
|
210
208
|
|
|
211
209
|
::-webkit-scrollbar-track,
|
|
@@ -215,7 +213,7 @@ template {
|
|
|
215
213
|
}
|
|
216
214
|
|
|
217
215
|
:hover::-webkit-scrollbar-thumb {
|
|
218
|
-
background-color: var(--primary-
|
|
216
|
+
background-color: var(--primary-selection);
|
|
219
217
|
}
|
|
220
218
|
|
|
221
219
|
::-webkit-scrollbar-thumb:hover {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.61",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,16 +15,15 @@
|
|
|
15
15
|
"author": "moneko",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@emotion/css": "11.10.
|
|
18
|
+
"@emotion/css": "11.10.8",
|
|
19
19
|
"@mapbox/rehype-prism": "0.8.0",
|
|
20
20
|
"@mdx-js/loader": "2.3.0",
|
|
21
|
-
"@moneko/common": "1.0
|
|
21
|
+
"@moneko/common": "1.1.0",
|
|
22
22
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
23
23
|
"@soda/friendly-errors-webpack-plugin": "1.8.1",
|
|
24
|
-
"@swc/core": "1.3.
|
|
24
|
+
"@swc/core": "1.3.56",
|
|
25
25
|
"@swc/css": "0.0.20",
|
|
26
|
-
"@swc/helpers": "0.5.
|
|
27
|
-
"@swc/plugin-emotion": "2.5.46",
|
|
26
|
+
"@swc/helpers": "0.5.1",
|
|
28
27
|
"add-asset-html-webpack-plugin": "5.0.2",
|
|
29
28
|
"core-js": "3.30.1",
|
|
30
29
|
"cross-env": "7.0.3",
|
|
@@ -42,15 +41,15 @@
|
|
|
42
41
|
"react-activation": "0.12.4",
|
|
43
42
|
"react-refresh": "0.14.0",
|
|
44
43
|
"react-refresh-typescript": "2.0.9",
|
|
45
|
-
"react-router": "6.
|
|
46
|
-
"react-router-dom": "6.
|
|
44
|
+
"react-router": "6.11.0",
|
|
45
|
+
"react-router-dom": "6.11.0",
|
|
47
46
|
"rehype-accessible-emojis": "0.3.2",
|
|
48
47
|
"rehype-figure": "1.0.1",
|
|
49
48
|
"shared-store-object": "1.0.7",
|
|
50
49
|
"style-loader": "3.3.2",
|
|
51
50
|
"style-resources-loader": "1.5.0",
|
|
52
51
|
"swc-loader": "0.2.3",
|
|
53
|
-
"swc-plugin-another-transform-imports": "0.2.
|
|
52
|
+
"swc-plugin-another-transform-imports": "0.2.3",
|
|
54
53
|
"ts-import-plugin": "3.0.0",
|
|
55
54
|
"ts-loader": "9.4.2",
|
|
56
55
|
"typescript": "5.0.4",
|
package/typings/global.d.ts
CHANGED
|
@@ -50,40 +50,6 @@ export declare type ConfigType<T = 'tsc'> = {
|
|
|
50
50
|
* @default 'swc'
|
|
51
51
|
*/
|
|
52
52
|
compiler: 'tsc' | 'swc';
|
|
53
|
-
emotion: {
|
|
54
|
-
/** sourceMap: 默认开启, 当构建为生产时将禁用
|
|
55
|
-
* @default true
|
|
56
|
-
*/
|
|
57
|
-
sourceMap?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* @description
|
|
60
|
-
* 自动将标签属性添加到样式中,以便由css或样式生成的类名包括结果分配到的变量的名称。
|
|
61
|
-
* @default 'dev-only'
|
|
62
|
-
*/
|
|
63
|
-
autoLabel?: 'never' | 'dev-only' | 'always';
|
|
64
|
-
/** 定义类名的格式
|
|
65
|
-
* @alias [local]: 样式表达式的结果被分配到的变量的名称。
|
|
66
|
-
* @alias [filename]: 样式表达式所在的文件名称(无扩展名)。
|
|
67
|
-
* @alias [dirname]: 包含样式表达式所在文件的目录的名称。
|
|
68
|
-
* @default '[local]'
|
|
69
|
-
* @description
|
|
70
|
-
* 此选项仅在autoLabel设置为 `dev-only` 或 `always` 时有效。
|
|
71
|
-
* 它允许您定义结果标签的格式。
|
|
72
|
-
* 格式通过字符串定义,其中变量部分用方括号括起来[]。
|
|
73
|
-
* 例如labelFormat:"my-classname--[local]",其中[local]将替换为结果分配给的变量的名称。
|
|
74
|
-
*/
|
|
75
|
-
labelFormat?: string;
|
|
76
|
-
/**
|
|
77
|
-
* @description
|
|
78
|
-
* 此选项假设您正在使用某些东西使 `@emotion/react` 的 jsx 函数适用于所有 jsx。如果您不这样做,并且不希望发生此类优化,请禁用此选项。
|
|
79
|
-
* @default true
|
|
80
|
-
*/
|
|
81
|
-
cssPropOptimization?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* @default true
|
|
84
|
-
*/
|
|
85
|
-
importMap?: boolean;
|
|
86
|
-
};
|
|
87
53
|
/** swc 配置项,仅当编译器为 swc 时有效 */
|
|
88
54
|
swcrc?: SwcConfig | ((isDev: boolean) => SwcConfig);
|
|
89
55
|
/**
|
package/lib/styles/variables.css
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--font-size: 14px;
|
|
3
|
-
--font-size-sm: 12px;
|
|
4
|
-
--font-size-xs: 10px;
|
|
5
|
-
--font-size-lg: 16px;
|
|
6
|
-
--border-base: 1px solid var(--border-color);
|
|
7
|
-
--border-color: rgb(5 5 5 / 6%);
|
|
8
|
-
--border-radius: 8px;
|
|
9
|
-
--body-background: #f8f8f8;
|
|
10
|
-
--component-background: rgb(255 255 255 / 80%);
|
|
11
|
-
--table-header-bg: rgb(0 0 0 / 2%);
|
|
12
|
-
--text-color: rgb(0 0 0 / 65%);
|
|
13
|
-
--text-secondary: #4e4e4e;
|
|
14
|
-
--text-heading: #1b1b1b;
|
|
15
|
-
--text-selection-bg: var(--primary-bg);
|
|
16
|
-
--text-shadow-color: rgb(0 0 0 / 10%);
|
|
17
|
-
--box-shadow-base: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%),
|
|
18
|
-
0 9px 28px 8px rgb(0 0 0 / 5%);
|
|
19
|
-
--font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica Neue',
|
|
20
|
-
'Arial', 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
21
|
-
'Noto Color Emoji', 'Helvetica', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans';
|
|
22
|
-
--transition-duration: 0.3s;
|
|
23
|
-
--transition-timing-function: cubic-bezier(0.94, -0.1, 0.1, 1.2);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
[data-theme='dark'] {
|
|
27
|
-
--text-color: #ffffffd9;
|
|
28
|
-
--text-secondary: #cdcdcd;
|
|
29
|
-
--text-heading: rgb(255 255 255 / 85%);
|
|
30
|
-
--text-shadow-color: rgb(255 255 255 / 10%);
|
|
31
|
-
--body-background: #000;
|
|
32
|
-
--component-background: rgb(20 20 20 / 80%);
|
|
33
|
-
--header-bg: rgb(20 20 20 / 90%);
|
|
34
|
-
--border-color: #303030;
|
|
35
|
-
}
|