@moneko/core 3.0.0-beta.20 → 3.0.0-beta.21

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.
@@ -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)}import{pathToRegexp as t}from"path-to-regexp";export function lazyImport(e){return new Promise(function(r){return import("@/pages/"+e.replace(/:/g,"$").replace(/^\//,"")).then(r).catch(function(){return Promise.resolve({default:null})})})}export var myPkgs=[];export var myDemoKv={};export var mdxComponents={};if("library"===APPTYPE&&import.meta.webpackContext){var n,o=import.meta.webpackContext("@pkg/",{recursive:!0,regExp:/README\.mdx?$/,mode:"sync"}),i={};try{i=(await import("@/components/components")).default}catch(e){}Object.assign(mdxComponents,r({},i)),null==(n=null==o?void 0:o.keys())||n.forEach(function(e){var t=e.substring(2).split("/").slice(0,-1).join("/"),n=o(e),i=n.basic,a=n.default;myPkgs.push(r({key:t,path:t,element:a},i,{props:{components:mdxComponents,path:t}}))});var a=import.meta.webpackContext("@pkg/",{recursive:!0,regExp:/\/examples\/(.+)\.mdx$/,mode:"sync"});a.keys().forEach(function(r){var t=r.substring(2).split("/"),n=t[0];Array.isArray(myDemoKv[n])||(myDemoKv[n]=[]);for(var o,i,l=a(r),c=l.matchAll(/```([^\r\n]+)?\r?\n([\s\S]*?)\r?\n```/g),p="",u="",s=null,m=function(r,t){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=function(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)}}(r))){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.")}(c);!(i=m()).done;){var d=i.value;u=d[1]||"tsx",p=d[2],s=l.replace(d[0],"")}myDemoKv[n].push({language:u,code:p,description:s,title:null==(o=t.pop())?void 0:o.replace(/\.mdx$/,""),noInline:/render\([^\\)]*\);?(?=\s*$)/.test(p)})})}var l=[];try{l=(await import("@/router")).default}catch(e){console.info("自定义路由请在 router 目录下新建 index.ts, 类型: RouterProps[]",e)}function c(e,r){return["*"===r&&"*"!==e?void 0:r,e].filter(Boolean).join("/")}var p=[];import.meta.webpackContext&&(p=import.meta.webpackContext("@/pages/",{recursive:!0,regExp:/\.(t|j)sx$/,mode:"lazy"}));var u=function(e){for(var r=[],t=0;t<e.length;t++)for(var n=e[t].split("/").slice(0,-1),o=r,i=0;i<n.length;i++){var a=n[i];if(""!==a){"."===a&&(a="*");var l=o;if(Array.isArray(o)){for(var c=0;c<o.length;c++)if(o[c].path===a){o=o[c].children;break}}if(l===o){var p=i===n.length-1?e[t]:n.slice(0,i+1).join("/")+"/",u={key:p=p.substring(2,p.lastIndexOf("/")),path:a,i18n:"route-"+p,children:[],alive:!1,element:lazyImport(p),hideMenu:p.includes(":"),props:{path:p}};Array.isArray(o)&&o.push(u),o=u.children}}}return r}(p.keys().map(function(e){return e.replace(/\$/g,":")}));function s(e,t,n){return void 0===e&&(e=[]),e.map(function(e){var o=r({},e);return void 0===o.key&&(o.key=c(e.path,n)),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?s(o.children,t,o.key):void 0),o.element||(o.element=lazyImport(o.key),o.props={path:o.key}),!!o.onlyLogin!==t||o.root?o:null}).filter(Boolean)}for(var m=[].concat(l),d=0,h=u.length;d<h;d++)!function e(t,n,o){var i,a=t.find(function(e){return e.path===n.path});a?(a.key=c(a.path,o),void 0===a.i18n&&(a.i18n="route-"+a.key),void 0===a.alive&&(a.alive=!1),void 0===a.element&&n.element&&(a.element=n.element,a.props=n.props),void 0===a.hideMenu&&(a.hideMenu="*"===a.path||a.key.includes(":")),Object.assign(a,r({},n,a)),n.children&&(!a.children&&Array.isArray(n.children)&&(a.children=n.children),null==(i=n.children)||i.forEach(function(r){e(null==a?void 0:a.children,r,null==a?void 0:a.key)}))):t.push(n)}(m,u[d]);export var onlyLoginRouter=s(m,!1);export var router=s(m,!0);export function matchUtil(e){var r={key:""};return!function n(o){for(var i=0,a=o.length;i<a;i++){if(o[i].path&&"*"!==o[i].path&&o[i].key)try{if(t(o[i].key).exec(e.substring(1))){r=o[i];return}}catch(e){}Array.isArray(o[i].children)&&n(o[i].children)}}(router),r}
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)}import{pathToRegexp as t}from"path-to-regexp";export function lazyImport(e){return new Promise(function(r){return import("@/pages/"+e.replace(/:/g,"$").replace(/^\//,"")).then(r).catch(function(){return Promise.resolve({default:null})})})}export var myPkgs=[];export var myDemoKv={};export var mdxComponents={};if("library"===APPTYPE&&import.meta.webpackContext){var n,o=import.meta.webpackContext("@pkg/",{recursive:!0,regExp:/README\.mdx?$/,mode:"sync"}),i={};try{i=(await import("@/components/components")).default}catch(e){}Object.assign(mdxComponents,r({},i)),null==(n=null==o?void 0:o.keys())||n.forEach(function(e){var t=e.substring(2).split("/").slice(0,-1).join("/"),n=o(e),i=n.frontmatte,a=n.default;myPkgs.push(r({key:t,path:t,element:a},i,{props:{components:mdxComponents,path:t}}))});var a=import.meta.webpackContext("@pkg/",{recursive:!0,regExp:/\/examples\/(.+)\.mdx$/,mode:"sync"});a.keys().forEach(function(r){var t=r.substring(2).split("/"),n=t[0];Array.isArray(myDemoKv[n])||(myDemoKv[n]=[]);for(var o,i,l=a(r),c=l.matchAll(/```([^\r\n]+)?\r?\n([\s\S]*?)\r?\n```/g),p="",u="",s=null,m=function(r,t){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=function(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)}}(r))){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.")}(c);!(i=m()).done;){var d=i.value;u=d[1]||"tsx",p=d[2],s=l.replace(d[0],"")}myDemoKv[n].push({language:u,code:p,description:s,title:null==(o=t.pop())?void 0:o.replace(/\.mdx$/,""),noInline:/render\([^\\)]*\);?(?=\s*$)/.test(p)})})}var l=[];try{l=(await import("@/router")).default}catch(e){console.info("自定义路由请在 router 目录下新建 index.ts, 类型: RouterProps[]",e)}function c(e,r){return["*"===r&&"*"!==e?void 0:r,e].filter(Boolean).join("/")}var p=[];import.meta.webpackContext&&(p=import.meta.webpackContext("@/pages/",{recursive:!0,regExp:/\.(t|j)sx$/,mode:"lazy"}));var u=function(e){for(var r=[],t=0;t<e.length;t++)for(var n=e[t].split("/").slice(0,-1),o=r,i=0;i<n.length;i++){var a=n[i];if(""!==a){"."===a&&(a="*");var l=o;if(Array.isArray(o)){for(var c=0;c<o.length;c++)if(o[c].path===a){o=o[c].children;break}}if(l===o){var p=i===n.length-1?e[t]:n.slice(0,i+1).join("/")+"/",u={key:p=p.substring(2,p.lastIndexOf("/")),path:a,i18n:"route-"+p,children:[],alive:!1,element:lazyImport(p),hideMenu:p.includes(":"),props:{path:p}};Array.isArray(o)&&o.push(u),o=u.children}}}return r}(p.keys().map(function(e){return e.replace(/\$/g,":")}));function s(e,t,n){return void 0===e&&(e=[]),e.map(function(e){var o=r({},e);return void 0===o.key&&(o.key=c(e.path,n)),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?s(o.children,t,o.key):void 0),o.element||(o.element=lazyImport(o.key),o.props={path:o.key}),!!o.onlyLogin!==t||o.root?o:null}).filter(Boolean)}for(var m=[].concat(l),d=0,h=u.length;d<h;d++)!function e(t,n,o){var i,a=t.find(function(e){return e.path===n.path});a?(a.key=c(a.path,o),void 0===a.i18n&&(a.i18n="route-"+a.key),void 0===a.alive&&(a.alive=!1),void 0===a.element&&n.element&&(a.element=n.element,a.props=n.props),void 0===a.hideMenu&&(a.hideMenu="*"===a.path||a.key.includes(":")),Object.assign(a,r({},n,a)),n.children&&(!a.children&&Array.isArray(n.children)&&(a.children=n.children),null==(i=n.children)||i.forEach(function(r){e(null==a?void 0:a.children,r,null==a?void 0:a.key)}))):t.push(n)}(m,u[d]);export var onlyLoginRouter=s(m,!1);export var router=s(m,!0);export function matchUtil(e){var r={key:""};return!function n(o){for(var i=0,a=o.length;i<a;i++){if(o[i].path&&"*"!==o[i].path&&o[i].key)try{if(t(o[i].key).exec(e.substring(1))){r=o[i];return}}catch(e){}Array.isArray(o[i].children)&&n(o[i].children)}}(router),r}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.0.0-beta.20",
3
+ "version": "3.0.0-beta.21",
4
4
  "description": "core",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",