UNPKG

create-dan

Version:

Dan frameworks

1 lines 12.7 kB
{"ast":null,"code":"\"use strict\";\n\nvar _classCallCheck = require(\"@babel/runtime-corejs2/helpers/classCallCheck\");\n\nvar _createClass = require(\"@babel/runtime-corejs2/helpers/createClass\");\n\nvar _possibleConstructorReturn = require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\");\n\nvar _getPrototypeOf = require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\");\n\nvar _inherits = require(\"@babel/runtime-corejs2/helpers/inherits\");\n\nvar _regeneratorRuntime = require(\"@babel/runtime-corejs2/regenerator\");\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\"])(\n /*#__PURE__*/\n _regeneratorRuntime.mark(function _callee(_ref) {\n var Component, ctx, pageProps;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n Component = _ref.Component, ctx = _ref.ctx;\n _context.next = 3;\n return (0, _utils.loadGetInitialProps)(Component, ctx);\n\n case 3:\n pageProps = _context.sent;\n return _context.abrupt(\"return\", {\n pageProps: pageProps\n });\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _appGetInitialProps.apply(this, arguments);\n}\n\nvar App =\n/*#__PURE__*/\nfunction (_react$default$Compon) {\n _inherits(App, _react$default$Compon);\n\n function App() {\n _classCallCheck(this, App);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(App).apply(this, arguments));\n }\n\n _createClass(App, [{\n key: \"componentDidCatch\",\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 value: function componentDidCatch(error, _errorInfo) {\n throw error;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n router = _this$props.router,\n Component = _this$props.Component,\n pageProps = _this$props.pageProps;\n var url = createUrl(router);\n return _react[\"default\"].createElement(Component, (0, _extends2[\"default\"])({}, pageProps, {\n url: url\n }));\n }\n }]);\n\n return App;\n}(_react[\"default\"].Component);\n\nexports[\"default\"] = App;\nApp.origGetInitialProps = appGetInitialProps;\nApp.getInitialProps = appGetInitialProps;\nvar warnContainer;\nvar warnUrl;\n\nif (true) {\n warnContainer = (0, _utils.execOnce)(function () {\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)(function () {\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 pathname = router.pathname,\n asPath = router.asPath,\n query = router.query;\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: function back() {\n if (true) warnUrl();\n router.back();\n },\n push: function push(url, as) {\n if (true) warnUrl();\n return router.push(url, as);\n },\n pushTo: function 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: function replace(url, as) {\n if (true) warnUrl();\n return router.replace(url, as);\n },\n replaceTo: function 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","_extends2","_asyncToGenerator2","_react","_utils","AppInitialProps","appGetInitialProps","_x","_appGetInitialProps","apply","arguments","_ref","Component","ctx","loadGetInitialProps","pageProps","App","error","_errorInfo","props","router","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,OAAO,WAAP,GAAgB,KAAK,CAArB;;AAAuB,IAAII,SAAS,GAACN,sBAAsB,CAACC,OAAO,CAAC,wCAAD,CAAR,CAApC;;AAAwF,IAAIM,kBAAkB,GAACP,sBAAsB,CAACC,OAAO,CAAC,iDAAD,CAAR,CAA7C;;AAA0G,IAAIO,MAAM,GAACR,sBAAsB,CAACC,OAAO,CAAC,OAAD,CAAR,CAAjC;;AAAoD,IAAIQ,MAAM,GAACR,OAAO,CAAC,0BAAD,CAAlB;;AAA+CC,OAAO,CAACQ,eAAR,GAAwBD,MAAM,CAACC,eAA/B;;AAA+CT,OAAO,CAAC,kBAAD,CAAP;AAA4B;;;;;;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AYf,GAAZ,EAAgBgB,EAAhB,CAAP;AAA4B,KAArZ;AAAsZC,IAAAA,MAAM,EAAC,gBAACC,IAAD,EAAMF,EAAN,EAAW;AAAC,gBAAuCX,OAAO;AAAG,UAAIc,SAAS,GAACH,EAAE,GAACE,IAAD,GAAM,EAAtB;AAAyB,UAAIE,OAAO,GAACJ,EAAE,IAAEE,IAAhB;AAAqB,aAAOnB,MAAM,CAACgB,IAAP,CAAYI,SAAZ,EAAsBC,OAAtB,CAAP;AAAuC,KAA/iB;AAAgjBC,IAAAA,OAAO,EAAC,iBAACrB,GAAD,EAAKgB,EAAL,EAAU;AAAC,gBAAuCX,OAAO;AAAG,aAAON,MAAM,CAACsB,OAAP,CAAerB,GAAf,EAAmBgB,EAAnB,CAAP;AAA+B,KAAnpB;AAAopBM,IAAAA,SAAS,EAAC,mBAACJ,IAAD,EAAMF,EAAN,EAAW;AAAC,gBAAuCX,OAAO;AAAG,UAAIkB,YAAY,GAACP,EAAE,GAACE,IAAD,GAAM,EAAzB;AAA4B,UAAIM,UAAU,GAACR,EAAE,IAAEE,IAAnB;AAAwB,aAAOnB,MAAM,CAACsB,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"}