Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
6.1 KiB

{"ast":null,"code":"\"use strict\";\n\nvar _classCallCheck = require(\"@babel/runtime/helpers/classCallCheck\");\n\nvar _assertThisInitialized = require(\"@babel/runtime/helpers/assertThisInitialized\");\n\nvar _createClass = require(\"@babel/runtime/helpers/createClass\");\n\nvar _inherits = require(\"@babel/runtime/helpers/inherits\");\n\nvar _possibleConstructorReturn = require(\"@babel/runtime/helpers/possibleConstructorReturn\");\n\nvar _getPrototypeOf = require(\"@babel/runtime/helpers/getPrototypeOf\");\n\nvar _toConsumableArray = require(\"@babel/runtime/helpers/toConsumableArray\");\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar react_1 = require(\"react\");\n\nvar isServer = false;\n\nexports[\"default\"] = function () {\n var mountedInstances = new Set();\n var state;\n\n function emitChange(component) {\n state = component.props.reduceComponentsToState(_toConsumableArray(mountedInstances), component.props);\n\n if (component.props.handleStateChange) {\n component.props.handleStateChange(state);\n }\n }\n\n return /*#__PURE__*/function (_react_1$Component) {\n _inherits(_class, _react_1$Component);\n\n var _super = _createSuper(_class);\n\n _createClass(_class, null, [{\n key: \"rewind\",\n // Used when server rendering\n value: function rewind() {\n var recordedState = state;\n state = undefined;\n mountedInstances.clear();\n return recordedState;\n }\n }]);\n\n function _class(props) {\n var _this;\n\n _classCallCheck(this, _class);\n\n _this = _super.call(this, props);\n\n if (isServer) {\n mountedInstances.add(_assertThisInitialized(_this));\n emitChange(_assertThisInitialized(_this));\n }\n\n return _this;\n }\n\n _createClass(_class, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n mountedInstances.add(this);\n emitChange(this);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n emitChange(this);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n mountedInstances[\"delete\"](this);\n emitChange(this);\n }\n }, {\n key: \"render\",\n value: function render() {\n return null;\n }\n }]);\n\n return _class;\n }(react_1.Component);\n};","map":{"version":3,"sources":["/home/gisle/projects/react/rpdata-frontend2/node_modules/next/dist/next-server/lib/side-effect.js"],"names":["Object","defineProperty","exports","value","react_1","require","isServer","mountedInstances","Set","state","emitChange","component","props","reduceComponentsToState","handleStateChange","recordedState","undefined","clear","add","Component"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;AACAA,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEC,EAAAA,KAAK,EAAE;AAAT,CAA7C;;AACA,IAAMC,OAAO,GAAGC,OAAO,CAAC,OAAD,CAAvB;;AACA,IAAMC,QAAQ,QAAd;;AACAJ,OAAO,WAAP,GAAkB,YAAM;AACpB,MAAMK,gBAAgB,GAAG,IAAIC,GAAJ,EAAzB;AACA,MAAIC,KAAJ;;AACA,WAASC,UAAT,CAAoBC,SAApB,EAA+B;AAC3BF,IAAAA,KAAK,GAAGE,SAAS,CAACC,KAAV,CAAgBC,uBAAhB,oBAA4CN,gBAA5C,GAA+DI,SAAS,CAACC,KAAzE,CAAR;;AACA,QAAID,SAAS,CAACC,KAAV,CAAgBE,iBAApB,EAAuC;AACnCH,MAAAA,SAAS,CAACC,KAAV,CAAgBE,iBAAhB,CAAkCL,KAAlC;AACH;AACJ;;AACD;AAAA;;AAAA;;AAAA;AAAA;AACI;AADJ,+BAEoB;AACZ,YAAMM,aAAa,GAAGN,KAAtB;AACAA,QAAAA,KAAK,GAAGO,SAAR;AACAT,QAAAA,gBAAgB,CAACU,KAAjB;AACA,eAAOF,aAAP;AACH;AAPL;;AAQI,oBAAYH,KAAZ,EAAmB;AAAA;;AAAA;;AACf,gCAAMA,KAAN;;AACA,UAAIN,QAAJ,EAAc;AACVC,QAAAA,gBAAgB,CAACW,GAAjB;AACAR,QAAAA,UAAU,+BAAV;AACH;;AALc;AAMlB;;AAdL;AAAA;AAAA,0CAewB;AAChBH,QAAAA,gBAAgB,CAACW,GAAjB,CAAqB,IAArB;AACAR,QAAAA,UAAU,CAAC,IAAD,CAAV;AACH;AAlBL;AAAA;AAAA,2CAmByB;AACjBA,QAAAA,UAAU,CAAC,IAAD,CAAV;AACH;AArBL;AAAA;AAAA,6CAsB2B;AACnBH,QAAAA,gBAAgB,UAAhB,CAAwB,IAAxB;AACAG,QAAAA,UAAU,CAAC,IAAD,CAAV;AACH;AAzBL;AAAA;AAAA,+BA0Ba;AACL,eAAO,IAAP;AACH;AA5BL;;AAAA;AAAA,IAAqBN,OAAO,CAACe,SAA7B;AA8BH,CAvCD","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst react_1 = require(\"react\");\nconst isServer = typeof window === 'undefined';\nexports.default = () => {\n const mountedInstances = new Set();\n let state;\n function emitChange(component) {\n state = component.props.reduceComponentsToState([...mountedInstances], component.props);\n if (component.props.handleStateChange) {\n component.props.handleStateChange(state);\n }\n }\n return class extends react_1.Component {\n // Used when server rendering\n static rewind() {\n const recordedState = state;\n state = undefined;\n mountedInstances.clear();\n return recordedState;\n }\n constructor(props) {\n super(props);\n if (isServer) {\n mountedInstances.add(this);\n emitChange(this);\n }\n }\n componentDidMount() {\n mountedInstances.add(this);\n emitChange(this);\n }\n componentDidUpdate() {\n emitChange(this);\n }\n componentWillUnmount() {\n mountedInstances.delete(this);\n emitChange(this);\n }\n render() {\n return null;\n }\n };\n};\n"]},"metadata":{},"sourceType":"script"}