create-dan
Version:
Dan frameworks
1 lines • 10.9 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.Container = Container;\nexports.createUrl = createUrl;\nexports.default = void 0;\n\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/extends\"));\n\nvar _asyncToGenerator2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/asyncToGenerator\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _utils = require(\"../next-server/lib/utils\");\n\nexports.AppInitialProps = _utils.AppInitialProps;\n\nrequire(\"../client/router\");\n/**\n* `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization.\n* This allows for keeping state between navigation, custom error handling, injecting additional data.\n*/\n\n\nfunction appGetInitialProps(_x) {\n return _appGetInitialProps.apply(this, arguments);\n}\n\nfunction _appGetInitialProps() {\n _appGetInitialProps = (0, _asyncToGenerator2.default)(function* (_ref) {\n var {\n Component,\n ctx\n } = _ref;\n var pageProps = yield (0, _utils.loadGetInitialProps)(Component, ctx);\n return {\n pageProps\n };\n });\n return _appGetInitialProps.apply(this, arguments);\n}\n\nclass App extends _react.default.Component {\n // Kept here for backwards compatibility.\n // When someone ended App they could call `super.componentDidCatch`.\n // @deprecated This method is no longer needed. Errors are caught at the top level\n componentDidCatch(error, _errorInfo) {\n throw error;\n }\n\n render() {\n var {\n router,\n Component,\n pageProps\n } = this.props;\n var url = createUrl(router);\n return _react.default.createElement(Component, (0, _extends2.default)({}, pageProps, {\n url: url\n }));\n }\n\n}\n\nexports.default = App;\nApp.origGetInitialProps = appGetInitialProps;\nApp.getInitialProps = appGetInitialProps;\nvar warnContainer;\nvar warnUrl;\n\nif (true) {\n warnContainer = (0, _utils.execOnce)(() => {\n console.warn(\"Warning: the `Container` in `_app` has been deprecated and should be removed. https://err.sh/zeit/next.js/app-container-deprecated\");\n });\n warnUrl = (0, _utils.execOnce)(() => {\n console.error(\"Warning: the 'url' property is deprecated. https://err.sh/zeit/next.js/url-deprecated\");\n });\n} // @deprecated noop for now until removal\n\n\nfunction Container(p) {\n if (true) warnContainer();\n return p.children;\n}\n\nfunction createUrl(router) {\n // This is to make sure we don't references the router object at call time\n var {\n pathname,\n asPath,\n query\n } = router;\n return {\n get query() {\n if (true) warnUrl();\n return query;\n },\n\n get pathname() {\n if (true) warnUrl();\n return pathname;\n },\n\n get asPath() {\n if (true) warnUrl();\n return asPath;\n },\n\n back: () => {\n if (true) warnUrl();\n router.back();\n },\n push: (url, as) => {\n if (true) warnUrl();\n return router.push(url, as);\n },\n pushTo: (href, as) => {\n if (true) warnUrl();\n var pushRoute = as ? href : '';\n var pushUrl = as || href;\n return router.push(pushRoute, pushUrl);\n },\n replace: (url, as) => {\n if (true) warnUrl();\n return router.replace(url, as);\n },\n replaceTo: (href, as) => {\n if (true) warnUrl();\n var replaceRoute = as ? href : '';\n var replaceUrl = as || href;\n return router.replace(replaceRoute, replaceUrl);\n }\n };\n}","map":{"version":3,"sources":["/Users/sbourgal/Documents/Projets/DAN/dan-framework/template/node_modules/next/dist/pages/_app.js"],"names":["_interopRequireDefault","require","exports","__esModule","Container","createUrl","default","_extends2","_asyncToGenerator2","_react","_utils","AppInitialProps","appGetInitialProps","_x","_appGetInitialProps","apply","arguments","_ref","Component","ctx","pageProps","loadGetInitialProps","App","componentDidCatch","error","_errorInfo","render","router","props","url","createElement","origGetInitialProps","getInitialProps","warnContainer","warnUrl","execOnce","console","warn","p","children","pathname","asPath","query","back","push","as","pushTo","href","pushRoute","pushUrl","replace","replaceTo","replaceRoute","replaceUrl"],"mappings":"AAAA;;AAAa,IAAIA,sBAAsB,GAACC,OAAO,CAAC,sDAAD,CAAlC;;AAA2FC,OAAO,CAACC,UAAR,GAAmB,IAAnB;AAAwBD,OAAO,CAACE,SAAR,GAAkBA,SAAlB;AAA4BF,OAAO,CAACG,SAAR,GAAkBA,SAAlB;AAA4BH,OAA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AAuCP,OAAO;AAAG,aAAOO,MAAP;AAAe,KAA5O;;AAA6OE,IAAAA,IAAI,EAAC,MAAI;AAAC,gBAAuCT,OAAO;AAAGP,MAAAA,MAAM,CAACgB,IAAP;AAAe,KAAvT;AAAwTC,IAAAA,IAAI,EAAC,CAACf,GAAD,EAAKgB,EAAL,KAAU;AAAC,gBAAuCX,OAAO;AAAG,aAAOP,MAAM,CAACiB,IAAP,CAAYf,GAAZ,EAAgBgB,EAAhB,CAAP;AAA4B,KAArZ;AAAsZC,IAAAA,MAAM,EAAC,CAACC,IAAD,EAAMF,EAAN,KAAW;AAAC,gBAAuCX,OAAO;AAAG,UAAIc,SAAS,GAACH,EAAE,GAACE,IAAD,GAAM,EAAtB;AAAyB,UAAIE,OAAO,GAACJ,EAAE,IAAEE,IAAhB;AAAqB,aAAOpB,MAAM,CAACiB,IAAP,CAAYI,SAAZ,EAAsBC,OAAtB,CAAP;AAAuC,KAA/iB;AAAgjBC,IAAAA,OAAO,EAAC,CAACrB,GAAD,EAAKgB,EAAL,KAAU;AAAC,gBAAuCX,OAAO;AAAG,aAAOP,MAAM,CAACuB,OAAP,CAAerB,GAAf,EAAmBgB,EAAnB,CAAP;AAA+B,KAAnpB;AAAopBM,IAAAA,SAAS,EAAC,CAACJ,IAAD,EAAMF,EAAN,KAAW;AAAC,gBAAuCX,OAAO;AAAG,UAAIkB,YAAY,GAACP,EAAE,GAACE,IAAD,GAAM,EAAzB;AAA4B,UAAIM,UAAU,GAACR,EAAE,IAAEE,IAAnB;AAAwB,aAAOpB,MAAM,CAACuB,OAAP,CAAeE,YAAf,EAA4BC,UAA5B,CAAP;AAAgD;AAA/zB,GAAN;AAAw0B","sourcesContent":["\"use strict\";var _interopRequireDefault=require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");exports.__esModule=true;exports.Container=Container;exports.createUrl=createUrl;exports.default=void 0;var _extends2=_interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/extends\"));var _asyncToGenerator2=_interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/asyncToGenerator\"));var _react=_interopRequireDefault(require(\"react\"));var _utils=require(\"../next-server/lib/utils\");exports.AppInitialProps=_utils.AppInitialProps;require(\"../client/router\");/**\n * `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization.\n * This allows for keeping state between navigation, custom error handling, injecting additional data.\n */function appGetInitialProps(_x){return _appGetInitialProps.apply(this,arguments);}function _appGetInitialProps(){_appGetInitialProps=(0,_asyncToGenerator2.default)(function*(_ref){var{Component,ctx}=_ref;var pageProps=yield(0,_utils.loadGetInitialProps)(Component,ctx);return{pageProps};});return _appGetInitialProps.apply(this,arguments);}class App extends _react.default.Component{// Kept here for backwards compatibility.\n// When someone ended App they could call `super.componentDidCatch`.\n// @deprecated This method is no longer needed. Errors are caught at the top level\ncomponentDidCatch(error,_errorInfo){throw error;}render(){var{router,Component,pageProps}=this.props;var url=createUrl(router);return _react.default.createElement(Component,(0,_extends2.default)({},pageProps,{url:url}));}}exports.default=App;App.origGetInitialProps=appGetInitialProps;App.getInitialProps=appGetInitialProps;var warnContainer;var warnUrl;if(process.env.NODE_ENV!=='production'){warnContainer=(0,_utils.execOnce)(()=>{console.warn(\"Warning: the `Container` in `_app` has been deprecated and should be removed. https://err.sh/zeit/next.js/app-container-deprecated\");});warnUrl=(0,_utils.execOnce)(()=>{console.error(\"Warning: the 'url' property is deprecated. https://err.sh/zeit/next.js/url-deprecated\");});}// @deprecated noop for now until removal\nfunction Container(p){if(process.env.NODE_ENV!=='production')warnContainer();return p.children;}function createUrl(router){// This is to make sure we don't references the router object at call time\nvar{pathname,asPath,query}=router;return{get query(){if(process.env.NODE_ENV!=='production')warnUrl();return query;},get pathname(){if(process.env.NODE_ENV!=='production')warnUrl();return pathname;},get asPath(){if(process.env.NODE_ENV!=='production')warnUrl();return asPath;},back:()=>{if(process.env.NODE_ENV!=='production')warnUrl();router.back();},push:(url,as)=>{if(process.env.NODE_ENV!=='production')warnUrl();return router.push(url,as);},pushTo:(href,as)=>{if(process.env.NODE_ENV!=='production')warnUrl();var pushRoute=as?href:'';var pushUrl=as||href;return router.push(pushRoute,pushUrl);},replace:(url,as)=>{if(process.env.NODE_ENV!=='production')warnUrl();return router.replace(url,as);},replaceTo:(href,as)=>{if(process.env.NODE_ENV!=='production')warnUrl();var replaceRoute=as?href:'';var replaceUrl=as||href;return router.replace(replaceRoute,replaceUrl);}};}"]},"metadata":{},"sourceType":"script"}