@moneko/core 2.0.0-beta.7 → 2.0.0-beta.8
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,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default:
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: React.NamedExoticComponent<{}>;
|
|
3
3
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _toArray(arr){return _arrayWithHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}import{useMemo,useState
|
|
1
|
+
function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _toArray(arr){return _arrayWithHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}import React,{useMemo,useState}from"react";import{useOutlet}from"react-router-dom";import FallbackComp from"../fallback-comp";var Fallback=function(){var _useOutlet;var outlet=(_useOutlet=useOutlet())===null||_useOutlet===void 0?void 0:_useOutlet.props.children;var _useState=_slicedToArray(useState(React.createElement(React.Fragment,null,"Loading...")),2),el=_useState[0],setEl=_useState[1];useMemo(function(){if(typeof fallbackCompPath==="string"){var pat=fallbackCompPath.replace(/@\//,"").split("/");var _pat=_toArray(pat),directory=_pat[0],path=_pat.slice(1);setEl(React.createElement(FallbackComp,{directory:directory,compName:path.join("/")}))}},[]);return outlet?outlet:el};export default React.memo(Fallback,function(){return true});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fallback/index.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fallback/index.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport FallbackComp from '../fallback-comp';\n\ndeclare const fallbackCompPath: string;\n\nconst Fallback: React.FC = () => {\n const outlet = useOutlet()?.props.children;\n const [el, setEl] = useState(<>Loading...</>);\n\n useMemo(() => {\n if (typeof fallbackCompPath === 'string') {\n const pat = fallbackCompPath.replace(/@\\//, '').split('/');\n const [directory, ...path] = pat;\n\n setEl(<FallbackComp directory={directory} compName={path.join('/')} />);\n }\n }, []);\n\n return outlet ? outlet : el;\n};\n\nexport default React.memo(Fallback, () => true);\n"],"names":["React","useMemo","useState","useOutlet","FallbackComp","Fallback","outlet","props","children","el","setEl","fallbackCompPath","pat","replace","split","directory","path","compName","join","memo"],"mappings":"AAAA,ykDAAA,OAAOA,OAASC,OAAO,CAAEC,QAAQ,KAAQ,OAAQ,AACjD,QAASC,SAAS,KAAQ,kBAAmB,AAC7C,QAAOC,iBAAkB,kBAAmB,CAI5C,IAAMC,SAAqB,UAAM,KAChBF,WAAf,IAAMG,OAASH,CAAAA,WAAAA,qBAAAA,oBAAAA,KAAAA,EAAAA,WAAaI,MAAMC,QAAQ,CAC1C,IAAoBN,yBAAAA,SAAS,wCAAE,kBAAxBO,GAAaP,aAATQ,MAASR,aAEpBD,QAAQ,UAAM,CACZ,GAAI,OAAOU,mBAAqB,SAAU,CACxC,IAAMC,IAAMD,iBAAiBE,OAAO,CAAC,MAAO,IAAIC,KAAK,CAAC,KACtD,IAA6BF,cAAAA,KAAtBG,UAAsBH,QAAX,AAAGI,KAAQJ,WAAX,GAElBF,MAAM,oBAACN,cAAaW,UAAWA,UAAWE,SAAUD,KAAKE,IAAI,CAAC,OAChE,CAAC,AACH,EAAG,EAAE,EAEL,OAAOZ,OAASA,OAASG,EAAE,AAC7B,CAEA,gBAAeT,MAAMmB,IAAI,CAACd,SAAU,kBAAM,IAAI,EAAE"}
|