esp-js-react 5.1.2 → 6.0.0-next.0

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.
@@ -291,9 +291,10 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
291
291
  o[k2] = m[k];
292
292
  }));
293
293
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
294
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
294
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
295
295
  };
296
296
  Object.defineProperty(exports, "__esModule", { value: true });
297
+ exports.PublishModelEventContext = exports.connect = exports.ConnectableComponent = exports.createViewForModel = exports.shouldUpdateMixin = exports.DEFAULT_VIEW_KEY = exports.viewBinding = exports.ViewBinder = exports.SmartComponent = exports.RouterContext = exports.HooksRouterProvider = exports.RouterProvider = void 0;
297
298
  // import for side effects
298
299
  __webpack_require__(6);
299
300
  var routerProvider_1 = __webpack_require__(8);
@@ -344,7 +345,7 @@ esp_js_polimer_1.PolimerModelBuilder.prototype.registerWithRouter = function ()
344
345
  let viewMappings = builder._viewMappings;
345
346
  if (viewMappings) {
346
347
  Object.keys(viewMappings).forEach(displayContext => {
347
- viewBindingDecorator_1.viewBinding(viewMappings[displayContext], displayContext)(model.constructor);
348
+ (0, viewBindingDecorator_1.viewBinding)(viewMappings[displayContext], displayContext)(model.constructor);
348
349
  });
349
350
  }
350
351
  return model;
@@ -486,7 +487,7 @@ class SmartComponent extends React.Component {
486
487
  }
487
488
  render() {
488
489
  if (this.state.model) {
489
- return viewBindingDecorator_1.createViewForModel(this.state.model, this._getChildProps(), this.props.viewContext, this.props.view);
490
+ return (0, viewBindingDecorator_1.createViewForModel)(this.state.model, this._getChildProps(), this.props.viewContext, this.props.view);
490
491
  }
491
492
  return null; // this (in react 15) will render a 'comment node' rather than any actual html
492
493
  }
@@ -551,7 +552,7 @@ class ViewBinder extends React.Component {
551
552
  if (this.props.model) {
552
553
  let _a = this.props, { model, viewContext } = _a, other = __rest(_a, ["model", "viewContext"]);
553
554
  let newProps = Object.assign({}, { model: this.props.model, router: this.context.router }, other);
554
- return viewBindingDecorator_1.createViewForModel(this.props.model, newProps, this.props.viewContext, null);
555
+ return (0, viewBindingDecorator_1.createViewForModel)(this.props.model, newProps, this.props.viewContext, null);
555
556
  }
556
557
  return null;
557
558
  }
@@ -612,7 +613,7 @@ function shouldUpdateMixin(itemsThatEffectUpdateSelector) {
612
613
  return class extends Constructor {
613
614
  shouldComponentUpdate(nextProps, nextState) {
614
615
  let newBindings = itemsThatEffectUpdateSelector(nextProps);
615
- let bindingsAreEqual = shallowEqual_1.shallowEqual(this._propBindings, newBindings);
616
+ let bindingsAreEqual = (0, shallowEqual_1.shallowEqual)(this._propBindings, newBindings);
616
617
  this._propBindings = newBindings;
617
618
  return !bindingsAreEqual;
618
619
  }
@@ -809,7 +810,7 @@ class ConnectableComponent extends React.Component {
809
810
  return null;
810
811
  }
811
812
  let childProps = this._getChildProps();
812
- let view = viewBindingDecorator_1.createViewForModel(this.state.model, childProps, this.props.viewContext, this.props.view);
813
+ let view = (0, viewBindingDecorator_1.createViewForModel)(this.state.model, childProps, this.props.viewContext, this.props.view);
813
814
  return (React.createElement(exports.HooksPublishModelEventProvider, { value: this.state.publishEvent }, view));
814
815
  }
815
816
  _getChildProps() {
@@ -847,7 +848,7 @@ ConnectableComponent.contextTypes = {
847
848
  router: PropTypes.instanceOf(esp_js_1.Router).isRequired,
848
849
  modelId: PropTypes.string
849
850
  };
850
- exports.connect = function (mapModelToProps, createPublishEventProps) {
851
+ const connect = function (mapModelToProps, createPublishEventProps) {
851
852
  return function (view) {
852
853
  return function (props) {
853
854
  const { modelId, viewContext } = props, rest = __rest(props, ["modelId", "viewContext"]);
@@ -855,6 +856,7 @@ exports.connect = function (mapModelToProps, createPublishEventProps) {
855
856
  };
856
857
  };
857
858
  };
859
+ exports.connect = connect;
858
860
 
859
861
 
860
862
  /***/ })
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///esp-js-react/webpack/universalModuleDefinition","webpack:///esp-js-react/webpack/bootstrap","webpack:///esp-js-react/src/viewBindingDecorator.ts","webpack:///esp-js-react/external \"react\"","webpack:///esp-js-react/external \"esp-js\"","webpack:///esp-js-react/external \"prop-types\"","webpack:///esp-js-react/src/getEspReactRenderModel.ts","webpack:///esp-js-react/src/index.ts","webpack:///esp-js-react/src/polimer/polimerExtentsions.ts","webpack:///esp-js-react/external \"esp-js-polimer\"","webpack:///esp-js-react/src/routerProvider.tsx","webpack:///esp-js-react/src/smartComponent.tsx","webpack:///esp-js-react/src/viewBinder.tsx","webpack:///esp-js-react/src/shouldUpdateMixin.ts","webpack:///esp-js-react/src/shallowEqual.ts","webpack:///esp-js-react/src/connectableComponent.tsx"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA,eAAe;AACf;;;;;;;;;;;;;;GAcG;AACH,aAAa;;;AAEb,qCAA+B;AAC/B,wCAA6B;AAGhB,wBAAgB,GAAG,kBAAk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,CAAC,CAAC;SACxC;QACD,qCAAqC;QACrC,OAAO,KAAK,CAAC;IACjB,CAAC;;AA1IL,oDA2IC;AAtIU,iCAAY,GAAG;IAClB,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,eAAM,CAAC,CAAC,UAAU;IAC/C,OAAO,EAAE,SAAS,CAAC,MAAM;CAC5B,CAAC;AAwIO,eAAO,GAAG,UACnB,eAAkF,EAClF,uBAAqE;IAErE,OAAO,UAAS,IAAqB;QACjC,OAAO,UAAS,KAAiF;YAC7F,MAAM,EAAC,OAAO,EAAE,WAAW,KAAa,KAAK,EAAb,IAAI,UAAI,KAAK,EAAvC,0BAA+B,CAAQ,CAAC;YAC9C,OAAO,oBAAC,oBAAoB,kBACxB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,eAAe,IAC5B,IAAI,EACV,CAAC;QACP,CAAC,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC","file":"esp-react.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"esp-js\"), require(\"prop-types\"), require(\"esp-js-polimer\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"esp-js\", \"prop-types\", \"esp-js-polimer\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"esp-js-react\"] = factory(require(\"react\"), require(\"esp-js\"), require(\"prop-types\"), require(\"esp-js-polimer\"));\n\telse\n\t\troot[\"esp-js-react\"] = factory(root[\"react\"], root[\"esp-js\"], root[\"prop-types\"], root[\"esp-js-polimer\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__7__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport {Guard} from 'esp-js';\nimport {ViewComponentTypes} from './connectableComponent';\n\nexport const DEFAULT_VIEW_KEY = 'default-view-key';\n\nfunction getMetadata(target) {\n if (!target._viewMetadata) {\n target._viewMetadata = new ViewMetadata();\n }\n return target._viewMetadata;\n}\n\n/**\n * Tries to get a view for the given model.\n *\n * It does this using the following order:\n * 1) If a @viewBinding decorator was used and a display context was given, try get a view for that\n * 2) Else if a view was explicitly provided use that\n * 3) Else if a @viewBinding decorator was used and there is a view associated with the default display context, use that view\n * @param model\n * @param props\n * @param displayContext\n * @param view\n */\nexport function createViewForModel(model: any, props, displayContext: string, view: ViewComponentTypes) {\n let finalView: ViewComponentTypes = view; // default to that passed in, if any.\n\n // displayContext = displayContext || DEFAULT_VIEW_KEY;\n // the view decorator isn't on the instance, it's on the constructor function that created that instance\n if (model) {\n let constructorFunction = model.constructor;\n if (constructorFunction._viewMetadata) {\n let viewMetadata = constructorFunction._viewMetadata;\n if (displayContext && viewMetadata.hasRegisteredViewContext(displayContext)) {\n let viewMetadataRegistration = viewMetadata.viewRegistrations[displayContext];\n // we've found a view for the display context, use that\n finalView = viewMetadataRegistration.view;\n }\n\n // if we've not found a view yet, and one wasn't provided, is there a default one?\n if (!finalView && viewMetadata.hasRegisteredViewContext(DEFAULT_VIEW_KEY)) {\n let viewMetadataRegistration = viewMetadata.viewRegistrations[DEFAULT_VIEW_KEY];\n finalView = viewMetadataRegistration.view;\n }\n }\n }\n if (!finalView) {\n throw new Error(`No suitable view found for model id '${model.modelId}' using context '${displayContext}'`);\n }\n return React.createElement(finalView, props);\n}\n\n/**\n * An ES7 style decorator that associates a model with a view\n * @param view the react component that will be used to display this model\n * @param displayContext an optional context allowing for different views to display the same model\n * @returns {Function}\n */\nexport function viewBinding(view: any, displayContext: string = DEFAULT_VIEW_KEY) {\n Guard.isDefined(view, 'view must be defined');\n Guard.isString(displayContext, 'displayContext must be a string');\n return function (target) {\n let viewMetadata = getMetadata(target);\n if (viewMetadata.hasRegisteredViewContext(displayContext)) {\n throw new Error(`Context ${displayContext} already registered for view`);\n }\n viewMetadata.viewRegistrations[displayContext] = new ViewMetadataRegistration(view, displayContext);\n };\n}\n\nexport class ViewMetadata {\n private _viewRegistrations = {};\n\n get viewRegistrations() {\n return this._viewRegistrations;\n }\n\n hasRegisteredViewContext(displayContext) {\n return typeof this._viewRegistrations[displayContext] !== 'undefined';\n }\n}\n\nexport class ViewMetadataRegistration {\n\n constructor(private _view, private _displayContext) {\n }\n\n get view() {\n return this._view;\n }\n\n get displayContext() {\n return this._displayContext;\n }\n}","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","import {EspMetadata, EspDecoratorUtil} from 'esp-js';\n\nexport interface GetEspReactRenderModelMetadata {\n functionName: string;\n}\n\nexport namespace GetEspReactRenderModelConsts {\n export const CustomDataKey = 'GetEspReactRenderModelCustomDataKey';\n /**\n * If there is no @getEspReactRenderModel decorator and a function by this name exists on a model, then it will be invoked to identify the sub model which will replaced the `model` prop passed to the child view of a ConnectableComponent\n */\n export const HandlerFunctionName = 'getEspReactRenderModel';\n}\n\n/**\n * A decorator which can be used to identify the render model which will replaced the `model` prop passed to the child view of a ConnectableComponent\n */\nexport function getEspReactRenderModel() {\n return function (target, name, descriptor) {\n let metadata: EspMetadata = EspDecoratorUtil.getOrCreateMetaData(target.constructor);\n metadata.addCustomData(\n GetEspReactRenderModelConsts.CustomDataKey,\n <GetEspReactRenderModelMetadata>{ functionName: name }\n );\n return descriptor;\n };\n}","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n//\n\n// import for side effects\nimport './polimer/polimerExtentsions';\n\nexport {RouterProvider, HooksRouterProvider, RouterContext} from './routerProvider';\nexport {SmartComponent} from './smartComponent';\nexport {ViewBinder} from './viewBinder';\nexport {viewBinding, DEFAULT_VIEW_KEY} from './viewBindingDecorator';\nexport * from './getEspReactRenderModel';\nexport {shouldUpdateMixin} from './shouldUpdateMixin';\nexport {createViewForModel} from './viewBindingDecorator';\nexport {\n ConnectableComponent,\n connect,\n ConnectableComponentProps,\n MapModelToProps,\n CreatePublishEventProps,\n ConnectableView,\n ConnectableComponentChildProps,\n PublishModelEventDelegate,\n PublishModelEventContext\n} from './connectableComponent';\n","import {PolimerModelBuilder, PolimerModel} from 'esp-js-polimer';\nimport {DEFAULT_VIEW_KEY, viewBinding} from '../viewBindingDecorator';\n\ndeclare module 'esp-js-polimer/.dist/typings/modelBuilder' {\n export interface PolimerModelBuilder<TModel> {\n withViewBindings?(view: any, displayContext?: string): PolimerModelBuilder<TModel>;\n }\n}\n\ninterface ViewMappings {\n [displayContext: string]: any;\n}\n\nPolimerModelBuilder.prototype.withViewBindings = function (view: any, displayContext: string = DEFAULT_VIEW_KEY): PolimerModelBuilder<any> {\n let builder = this;\n // store some metadata on the builder which we'll use later to tack onto the model\n let viewMappings: ViewMappings = builder._viewMappings || { };\n viewMappings[displayContext] = view;\n builder._viewMappings = viewMappings;\n return this;\n};\n\n// we need to replace the registerWithRouter in order to dynamically add the\n// @viewBinding decorator to it\nlet registerWithRouter = PolimerModelBuilder.prototype.registerWithRouter;\nPolimerModelBuilder.prototype.registerWithRouter = function (): PolimerModel<any> {\n let builder = this;\n let model = registerWithRouter.call(builder);\n let viewMappings: ViewMappings = builder._viewMappings;\n if (viewMappings) {\n Object.keys(viewMappings).forEach(displayContext => {\n viewBinding(viewMappings[displayContext], displayContext)(model.constructor);\n });\n }\n return model;\n};\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Router } from 'esp-js';\n\nexport interface RouterProviderProps {\n router: Router;\n}\n\nexport const RouterContext = React.createContext<Router>(null);\n\nexport const HooksRouterProvider = RouterContext.Provider;\n\nexport class RouterProvider extends React.Component<RouterProviderProps, any> {\n static childContextTypes = {\n router: PropTypes.instanceOf(Router).isRequired\n };\n getChildContext() {\n return {\n router: this.props.router\n };\n }\n render() {\n return (<HooksRouterProvider value={this.props.router}>{this.props.children}</HooksRouterProvider>);\n }\n}","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { createViewForModel } from './viewBindingDecorator';\nimport { Router } from 'esp-js';\n\nexport interface SmartComponentProps {\n modelId: string;\n view?: any;\n viewContext?: string;\n modelSelector?: (model: any) => any;\n [key: string]: any; // other props which will be passed through to the SmartComponent's view\n}\n\nexport interface SmartComponentState {\n model: any;\n}\n\nexport class SmartComponent extends React.Component<SmartComponentProps, SmartComponentState> {\n private _currentObservingModelId = false;\n private _observationSubscription = null;\n\n static contextTypes = {\n router: PropTypes.instanceOf(Router).isRequired\n };\n\n componentWillReceiveProps(nextProps: SmartComponentProps) {\n this._tryObserveModel(nextProps.modelId);\n }\n componentWillMount() {\n this._tryObserveModel(this.props.modelId);\n }\n componentWillUnmount() {\n this._tryDisposeObservationSubscription();\n }\n _tryObserveModel(modelId) {\n if(!modelId) {\n this._tryDisposeObservationSubscription();\n this.setState({model: null});\n } else if (modelId !== this._currentObservingModelId) {\n this._tryDisposeObservationSubscription();\n this._currentObservingModelId = modelId;\n this._observationSubscription = this.context.router\n .getModelObservable(modelId)\n .map(model => {\n return this.props.modelSelector\n ? this.props.modelSelector(model)\n : model;\n })\n .subscribe(model => {\n this.setState({model: model});\n });\n }\n }\n _tryDisposeObservationSubscription() {\n this._currentObservingModelId = null;\n if(this._observationSubscription) {\n this._observationSubscription.dispose();\n }\n }\n render() {\n if(this.state.model) {\n return createViewForModel(this.state.model, this._getChildProps(), this.props.viewContext, this.props.view);\n }\n return null; // this (in react 15) will render a 'comment node' rather than any actual html\n }\n _getChildProps() {\n // 'consume' the props we own, pass the rest down\n let {modelId, viewContext, view, modelSelector, ...other} = this.props;\n let newProps = {\n model: this.state.model,\n router: this.context.router\n };\n return Object.assign({}, newProps, other);\n }\n} ","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as esp from 'esp-js';\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { createViewForModel } from './viewBindingDecorator';\n\nexport interface ViewBinderProps {\n model: any;\n viewContext: string;\n}\n\nexport class ViewBinder extends React.Component<ViewBinderProps> {\n\n static contextTypes = {\n router: PropTypes.instanceOf(esp.Router).isRequired\n };\n\n render() {\n if(this.props.model) {\n let {model, viewContext, ...other} = this.props;\n let newProps = Object.assign({}, { model: this.props.model, router:this.context.router }, other);\n return createViewForModel(\n this.props.model,\n newProps,\n this.props.viewContext,\n null\n );\n }\n return null;\n }\n}","// notice_start\n/*\n * Copyright 2018 Keith Woods\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport {shallowEqual} from './shallowEqual';\n\n// WORKS (compiles at least):\n//\n// export function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n// return function <T extends {new(...args:any[]):{}}>(constructor:T) {\n// return class extends constructor {\n// _propBindings : {};\n// shouldComponentUpdate(nextProps, nextState) {\n// let newBindings = itemsThatEffectUpdateSelector(nextProps);\n// let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n// this._propBindings = newBindings;\n// return !bindingsAreEqual;\n// }\n// render() {\n// return React.createElement(<any>constructor, (<any>this).props);\n// }\n// };\n// };\n// }\n\nexport function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n return function <TConstructor extends { new(...args: any[]): {} }>(Constructor: TConstructor) {\n return class extends Constructor {\n _propBindings: {};\n shouldComponentUpdate(nextProps, nextState) {\n let newBindings = itemsThatEffectUpdateSelector(nextProps);\n let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n this._propBindings = newBindings;\n return !bindingsAreEqual;\n }\n render() {\n return React.createElement(<any>Constructor, (<any>this).props);\n }\n };\n };\n}\n\n// export function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n// return function(Comp: React.ComponentClass<TProps, TState>) {\n// return class extends React.Component<TProps, TState> {\n// _propBindings : {};\n// shouldComponentUpdate(nextProps, nextState) {\n// let newBindings = itemsThatEffectUpdateSelector(nextProps);\n// let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n// this._propBindings = newBindings;\n// return !bindingsAreEqual;\n// }\n// render() {\n// return React.createElement(Comp, this.props);\n// }\n// };\n// };\n// }","// taken from fbjs:\n// https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js\n// Licence (MIT) https://github.com/facebook/fbjs/blob/master/packages/fbjs/LICENSE\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule shallowEqual\n * @typechecks\n * @flow\n */\n\n/*eslint-disable no-self-compare */\n\n'use strict';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nexport function is(x: any, y: any): boolean {\n // SameValue algorithm\n if (x === y) { // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Added the nonzero y check to make Flow happy, but it is redundant\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nexport function shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null ||\n typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (\n !hasOwnProperty.call(objB, keysA[i]) ||\n !is(objA[keysA[i]], objB[keysA[i]])\n ) {\n return false;\n }\n }\n\n return true;\n}","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport {Disposable, Router, EspDecoratorUtil, utils, DisposableBase} from 'esp-js';\nimport {createViewForModel } from './viewBindingDecorator';\nimport {GetEspReactRenderModelConsts, GetEspReactRenderModelMetadata} from './getEspReactRenderModel';\n\nexport type PublishEvent = (eventType: string, event: any) => void;\n\nexport type CreatePublishEventProps<TPublishEventProps> = (publishEvent: PublishEvent) => TPublishEventProps;\n\nexport type MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps = {}> = (model: TModel, publishEventProps: TPublishEventProps) => TModelMappedToProps;\n\nexport type ViewComponentTypes = React.FunctionComponent | React.ClassType<any, any, any> | React.ComponentClass;\n\nexport interface ConnectableComponentProps<TModel ={}, TPublishEventProps = {}, TModelMappedToProps = {}> {\n modelId?: string;\n viewContext?: string;\n view?: ViewComponentTypes;\n /**\n * Provides a means to create a serious of 'publish event' callbacks which will be passed as props to the child view.\n */\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>;\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>;\n [key: string]: any; // ...rest props, including the result of mapPublish and mapPublish if 'connect' was used\n}\n\nexport interface ConnectableComponentChildProps<TModel> {\n modelId: string;\n model: TModel;\n router: Router;\n [key: string]: any; // ...rest props, including the result of mapPublish and mapPublish if 'connect' was used\n}\n\nexport interface State {\n model?: any;\n currentModelId?: string;\n publishProps?: any;\n publishEvent?: PublishModelEventDelegate;\n}\n\ninterface ConnectableComponentContext {\n router: Router;\n modelId: string;\n}\n\nexport type PublishModelEventDelegate = (eventType: string, event: any) => void;\n\nexport const PublishModelEventContext = React.createContext<PublishModelEventDelegate>(null);\n\nexport const HooksPublishModelEventProvider = PublishModelEventContext.Provider;\n\nexport class ConnectableComponent<TModel, TPublishEventProps = {}, TModelMappedToProps = {}> extends React.Component<ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, State> {\n private _isMounted = false;\n private _observationSubscription: Disposable;\n context: ConnectableComponentContext;\n\n static contextTypes = {\n router: PropTypes.instanceOf(Router).isRequired,\n modelId: PropTypes.string\n };\n\n constructor(props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, context: ConnectableComponentContext) {\n super(props, context);\n this.state = {model: null, currentModelId: null};\n }\n\n componentWillReceiveProps(nextProps: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, nextContext: ConnectableComponentContext) {\n const modelId = nextProps.modelId || nextContext.modelId;\n const oldModelId = this._getModelId();\n\n if (modelId === oldModelId) {\n return;\n }\n \n if(nextProps.modelId === oldModelId) {\n return;\n }\n\n this._tryObserveModel(modelId);\n }\n\n componentDidMount() {\n this._isMounted = true;\n this._tryObserveModel(this._getModelId());\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n this._tryDisposeModelSubscription();\n }\n\n private _getModelId(): string {\n // props override context\n return this.props.modelId || this.context.modelId;\n }\n\n private _tryObserveModel(modelId: string): void {\n this._tryDisposeModelSubscription();\n\n if (!modelId) {\n return;\n }\n\n let stateChanged = modelId !== this.state.currentModelId;\n\n let publishEvent = this.state.publishEvent;\n if (stateChanged) {\n publishEvent = this._publishEvent(this.context.router, modelId);\n }\n\n let publishProps = this.state.publishProps;\n // We only map the publish props once, as for well behaving components these callbacks should never change\n if (stateChanged && this.props.createPublishEventProps) {\n publishProps = this.props.createPublishEventProps(publishEvent);\n }\n\n if (stateChanged) {\n this.setState({\n currentModelId: modelId,\n publishEvent,\n publishProps\n });\n this._observationSubscription = this.context.router\n .getModelObservable(modelId)\n .subscribe(model => {\n if (this._isMounted) {\n this.setState({model});\n }\n });\n }\n }\n\n private _tryDisposeModelSubscription() {\n if(this._observationSubscription) {\n this._observationSubscription.dispose();\n this._observationSubscription = new DisposableBase();\n this.setState({model: null, currentModelId: null, publishProps: null, publishEvent: null});\n }\n }\n\n private _publishEvent = (router: Router, modelId: string) => (eventType: string, event: any) => router.publishEvent(modelId, eventType, event);\n\n public render() {\n if(this.state.model == null) {\n return null;\n }\n let childProps = this._getChildProps();\n let view = createViewForModel(this.state.model, childProps, this.props.viewContext, this.props.view);\n return (<HooksPublishModelEventProvider value={this.state.publishEvent}>{view}</HooksPublishModelEventProvider>);\n }\n\n private _getChildProps(): ConnectableComponentChildProps<TModel> {\n // consume what this component owns, and let the rest end up in `...rest`\n const {children, createPublishEventProps, modelId, mapModelToProps, view, viewContext, ...rest} = this.props;\n const model = this._getRenderModel(this.state.model);\n let childProps = {\n modelId,\n router: this.context.router,\n ...rest,\n ...this.state.publishProps,\n model\n };\n if (this.props.mapModelToProps) {\n childProps = {\n ...childProps,\n ...(this.props.mapModelToProps(model, this.state.publishProps) as any)\n };\n }\n return childProps;\n }\n\n /**\n * Sees if there is a special selector function which can be invoked to return a render model rather than the top level model model itself\n */\n private _getRenderModel(model: any): TModel {\n // does the given model have a decorated function we can invoke to get a different model to render?\n if (EspDecoratorUtil.hasMetadata(model)) {\n let metadata: GetEspReactRenderModelMetadata = EspDecoratorUtil.getCustomData(model, GetEspReactRenderModelConsts.CustomDataKey);\n if (metadata) {\n return model[metadata.functionName]();\n }\n }\n // else see if there is a function with name GetEspReactRenderModelConsts.HandlerFunctionName we can invoke to get a different model to render?\n let renderModelGetter = model[GetEspReactRenderModelConsts.HandlerFunctionName];\n if (renderModelGetter && utils.isFunction(renderModelGetter)) {\n return renderModelGetter.call(model);\n }\n // else just return the default model\n return model;\n }\n}\n\n// Lifting 'ConnectableView' into it's own type so it can be exported, else tsc doesn't correctly generated declaration files\nexport type ConnectableView = React.ComponentClass | React.SFC;\n\nexport const connect = function<TModel, TPublishEventProps, TModelMappedToProps = {}>(\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>,\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>\n): (view: ConnectableView) => (props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) => JSX.Element {\n return function(view: ConnectableView) {\n return function(props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) {\n const {modelId, viewContext, ...rest} = props;\n return <ConnectableComponent\n modelId={modelId}\n view={view}\n viewContext={viewContext}\n createPublishEventProps={createPublishEventProps}\n mapModelToProps={mapModelToProps}\n {...rest}\n />;\n };\n };\n};"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///esp-js-react/webpack/universalModuleDefinition","webpack:///esp-js-react/webpack/bootstrap","webpack:///esp-js-react/src/viewBindingDecorator.ts","webpack:///esp-js-react/external \"react\"","webpack:///esp-js-react/external \"esp-js\"","webpack:///esp-js-react/external \"prop-types\"","webpack:///esp-js-react/src/getEspReactRenderModel.ts","webpack:///esp-js-react/src/index.ts","webpack:///esp-js-react/src/polimer/polimerExtentsions.ts","webpack:///esp-js-react/external \"esp-js-polimer\"","webpack:///esp-js-react/src/routerProvider.tsx","webpack:///esp-js-react/src/smartComponent.tsx","webpack:///esp-js-react/src/viewBinder.tsx","webpack:///esp-js-react/src/shouldUpdateMixin.ts","webpack:///esp-js-react/src/shallowEqual.ts","webpack:///esp-js-react/src/connectableComponent.tsx"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA,eAAe;AACf;;;;;;;;;;;;;;GAcG;AACH,aAAa;;;AAEb,qCAA+B;AAC/B,wCAA6B;AAGhB,wBAAgB,GAAG,kBAAkB,CAAC;AAEnD,SAAS,WAAW,CAAC,MAAM;IACvB,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;QACvB,MAAM,CAAC,aAAa,GAAG,IAAI,YAAY,EAAE,CAAC;KAC7C;IACD,OAAO,MAAM,CAAC,aAAa,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;GA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;CAC5B,CAAC;AAwIC,MAAM,OAAO,GAAG,UACnB,eAAkF,EAClF,uBAAqE;IAErE,OAAO,UAAS,IAAqB;QACjC,OAAO,UAAS,KAAiF;YAC7F,MAAM,EAAC,OAAO,EAAE,WAAW,KAAa,KAAK,EAAb,IAAI,UAAI,KAAK,EAAvC,0BAA+B,CAAQ,CAAC;YAC9C,OAAO,oBAAC,oBAAoB,kBACxB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,eAAe,IAC5B,IAAI,EACV,CAAC;QACP,CAAC,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC;AAjBW,eAAO,WAiBlB","file":"esp-react.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"esp-js\"), require(\"prop-types\"), require(\"esp-js-polimer\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"esp-js\", \"prop-types\", \"esp-js-polimer\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"esp-js-react\"] = factory(require(\"react\"), require(\"esp-js\"), require(\"prop-types\"), require(\"esp-js-polimer\"));\n\telse\n\t\troot[\"esp-js-react\"] = factory(root[\"react\"], root[\"esp-js\"], root[\"prop-types\"], root[\"esp-js-polimer\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__7__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport {Guard} from 'esp-js';\nimport {ViewComponentTypes} from './connectableComponent';\n\nexport const DEFAULT_VIEW_KEY = 'default-view-key';\n\nfunction getMetadata(target) {\n if (!target._viewMetadata) {\n target._viewMetadata = new ViewMetadata();\n }\n return target._viewMetadata;\n}\n\n/**\n * Tries to get a view for the given model.\n *\n * It does this using the following order:\n * 1) If a @viewBinding decorator was used and a display context was given, try get a view for that\n * 2) Else if a view was explicitly provided use that\n * 3) Else if a @viewBinding decorator was used and there is a view associated with the default display context, use that view\n * @param model\n * @param props\n * @param displayContext\n * @param view\n */\nexport function createViewForModel(model: any, props, displayContext: string, view: ViewComponentTypes) {\n let finalView: ViewComponentTypes = view; // default to that passed in, if any.\n\n // displayContext = displayContext || DEFAULT_VIEW_KEY;\n // the view decorator isn't on the instance, it's on the constructor function that created that instance\n if (model) {\n let constructorFunction = model.constructor;\n if (constructorFunction._viewMetadata) {\n let viewMetadata = constructorFunction._viewMetadata;\n if (displayContext && viewMetadata.hasRegisteredViewContext(displayContext)) {\n let viewMetadataRegistration = viewMetadata.viewRegistrations[displayContext];\n // we've found a view for the display context, use that\n finalView = viewMetadataRegistration.view;\n }\n\n // if we've not found a view yet, and one wasn't provided, is there a default one?\n if (!finalView && viewMetadata.hasRegisteredViewContext(DEFAULT_VIEW_KEY)) {\n let viewMetadataRegistration = viewMetadata.viewRegistrations[DEFAULT_VIEW_KEY];\n finalView = viewMetadataRegistration.view;\n }\n }\n }\n if (!finalView) {\n throw new Error(`No suitable view found for model id '${model.modelId}' using context '${displayContext}'`);\n }\n return React.createElement(finalView, props);\n}\n\n/**\n * An ES7 style decorator that associates a model with a view\n * @param view the react component that will be used to display this model\n * @param displayContext an optional context allowing for different views to display the same model\n * @returns {Function}\n */\nexport function viewBinding(view: any, displayContext: string = DEFAULT_VIEW_KEY) {\n Guard.isDefined(view, 'view must be defined');\n Guard.isString(displayContext, 'displayContext must be a string');\n return function (target) {\n let viewMetadata = getMetadata(target);\n if (viewMetadata.hasRegisteredViewContext(displayContext)) {\n throw new Error(`Context ${displayContext} already registered for view`);\n }\n viewMetadata.viewRegistrations[displayContext] = new ViewMetadataRegistration(view, displayContext);\n };\n}\n\nexport class ViewMetadata {\n private _viewRegistrations = {};\n\n get viewRegistrations() {\n return this._viewRegistrations;\n }\n\n hasRegisteredViewContext(displayContext) {\n return typeof this._viewRegistrations[displayContext] !== 'undefined';\n }\n}\n\nexport class ViewMetadataRegistration {\n\n constructor(private _view, private _displayContext) {\n }\n\n get view() {\n return this._view;\n }\n\n get displayContext() {\n return this._displayContext;\n }\n}","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","import {EspMetadata, EspDecoratorUtil} from 'esp-js';\n\nexport interface GetEspReactRenderModelMetadata {\n functionName: string;\n}\n\nexport namespace GetEspReactRenderModelConsts {\n export const CustomDataKey = 'GetEspReactRenderModelCustomDataKey';\n /**\n * If there is no @getEspReactRenderModel decorator and a function by this name exists on a model, then it will be invoked to identify the sub model which will replaced the `model` prop passed to the child view of a ConnectableComponent\n */\n export const HandlerFunctionName = 'getEspReactRenderModel';\n}\n\n/**\n * A decorator which can be used to identify the render model which will replaced the `model` prop passed to the child view of a ConnectableComponent\n */\nexport function getEspReactRenderModel() {\n return function (target, name, descriptor) {\n let metadata: EspMetadata = EspDecoratorUtil.getOrCreateMetaData(target.constructor);\n metadata.addCustomData(\n GetEspReactRenderModelConsts.CustomDataKey,\n <GetEspReactRenderModelMetadata>{ functionName: name }\n );\n return descriptor;\n };\n}","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n//\n\n// import for side effects\nimport './polimer/polimerExtentsions';\n\nexport {RouterProvider, HooksRouterProvider, RouterContext} from './routerProvider';\nexport {SmartComponent} from './smartComponent';\nexport {ViewBinder} from './viewBinder';\nexport {viewBinding, DEFAULT_VIEW_KEY} from './viewBindingDecorator';\nexport * from './getEspReactRenderModel';\nexport {shouldUpdateMixin} from './shouldUpdateMixin';\nexport {createViewForModel} from './viewBindingDecorator';\nexport {\n ConnectableComponent,\n connect,\n ConnectableComponentProps,\n MapModelToProps,\n CreatePublishEventProps,\n ConnectableView,\n ConnectableComponentChildProps,\n PublishModelEventDelegate,\n PublishModelEventContext\n} from './connectableComponent';\n","import {PolimerModelBuilder, PolimerModel} from 'esp-js-polimer';\nimport {DEFAULT_VIEW_KEY, viewBinding} from '../viewBindingDecorator';\n\ndeclare module 'esp-js-polimer/.dist/typings/modelBuilder' {\n export interface PolimerModelBuilder<TModel> {\n withViewBindings?(view: any, displayContext?: string): PolimerModelBuilder<TModel>;\n }\n}\n\ninterface ViewMappings {\n [displayContext: string]: any;\n}\n\nPolimerModelBuilder.prototype.withViewBindings = function (view: any, displayContext: string = DEFAULT_VIEW_KEY): PolimerModelBuilder<any> {\n let builder = this;\n // store some metadata on the builder which we'll use later to tack onto the model\n let viewMappings: ViewMappings = builder._viewMappings || { };\n viewMappings[displayContext] = view;\n builder._viewMappings = viewMappings;\n return this;\n};\n\n// we need to replace the registerWithRouter in order to dynamically add the\n// @viewBinding decorator to it\nlet registerWithRouter = PolimerModelBuilder.prototype.registerWithRouter;\nPolimerModelBuilder.prototype.registerWithRouter = function (): PolimerModel<any> {\n let builder = this;\n let model = registerWithRouter.call(builder);\n let viewMappings: ViewMappings = builder._viewMappings;\n if (viewMappings) {\n Object.keys(viewMappings).forEach(displayContext => {\n viewBinding(viewMappings[displayContext], displayContext)(model.constructor);\n });\n }\n return model;\n};\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Router } from 'esp-js';\n\nexport interface RouterProviderProps {\n router: Router;\n}\n\nexport const RouterContext = React.createContext<Router>(null);\n\nexport const HooksRouterProvider = RouterContext.Provider;\n\nexport class RouterProvider extends React.Component<RouterProviderProps, any> {\n static childContextTypes = {\n router: PropTypes.instanceOf(Router).isRequired\n };\n getChildContext() {\n return {\n router: this.props.router\n };\n }\n render() {\n return (<HooksRouterProvider value={this.props.router}>{this.props.children}</HooksRouterProvider>);\n }\n}","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { createViewForModel } from './viewBindingDecorator';\nimport { Router } from 'esp-js';\n\nexport interface SmartComponentProps {\n modelId: string;\n view?: any;\n viewContext?: string;\n modelSelector?: (model: any) => any;\n [key: string]: any; // other props which will be passed through to the SmartComponent's view\n}\n\nexport interface SmartComponentState {\n model: any;\n}\n\nexport class SmartComponent extends React.Component<SmartComponentProps, SmartComponentState> {\n private _currentObservingModelId = false;\n private _observationSubscription = null;\n\n static contextTypes = {\n router: PropTypes.instanceOf(Router).isRequired\n };\n\n componentWillReceiveProps(nextProps: SmartComponentProps) {\n this._tryObserveModel(nextProps.modelId);\n }\n componentWillMount() {\n this._tryObserveModel(this.props.modelId);\n }\n componentWillUnmount() {\n this._tryDisposeObservationSubscription();\n }\n _tryObserveModel(modelId) {\n if(!modelId) {\n this._tryDisposeObservationSubscription();\n this.setState({model: null});\n } else if (modelId !== this._currentObservingModelId) {\n this._tryDisposeObservationSubscription();\n this._currentObservingModelId = modelId;\n this._observationSubscription = this.context.router\n .getModelObservable(modelId)\n .map(model => {\n return this.props.modelSelector\n ? this.props.modelSelector(model)\n : model;\n })\n .subscribe(model => {\n this.setState({model: model});\n });\n }\n }\n _tryDisposeObservationSubscription() {\n this._currentObservingModelId = null;\n if(this._observationSubscription) {\n this._observationSubscription.dispose();\n }\n }\n render() {\n if(this.state.model) {\n return createViewForModel(this.state.model, this._getChildProps(), this.props.viewContext, this.props.view);\n }\n return null; // this (in react 15) will render a 'comment node' rather than any actual html\n }\n _getChildProps() {\n // 'consume' the props we own, pass the rest down\n let {modelId, viewContext, view, modelSelector, ...other} = this.props;\n let newProps = {\n model: this.state.model,\n router: this.context.router\n };\n return Object.assign({}, newProps, other);\n }\n} ","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as esp from 'esp-js';\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { createViewForModel } from './viewBindingDecorator';\n\nexport interface ViewBinderProps {\n model: any;\n viewContext: string;\n}\n\nexport class ViewBinder extends React.Component<ViewBinderProps> {\n\n static contextTypes = {\n router: PropTypes.instanceOf(esp.Router).isRequired\n };\n\n render() {\n if(this.props.model) {\n let {model, viewContext, ...other} = this.props;\n let newProps = Object.assign({}, { model: this.props.model, router:this.context.router }, other);\n return createViewForModel(\n this.props.model,\n newProps,\n this.props.viewContext,\n null\n );\n }\n return null;\n }\n}","// notice_start\n/*\n * Copyright 2018 Keith Woods\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport {shallowEqual} from './shallowEqual';\n\n// WORKS (compiles at least):\n//\n// export function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n// return function <T extends {new(...args:any[]):{}}>(constructor:T) {\n// return class extends constructor {\n// _propBindings : {};\n// shouldComponentUpdate(nextProps, nextState) {\n// let newBindings = itemsThatEffectUpdateSelector(nextProps);\n// let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n// this._propBindings = newBindings;\n// return !bindingsAreEqual;\n// }\n// render() {\n// return React.createElement(<any>constructor, (<any>this).props);\n// }\n// };\n// };\n// }\n\nexport function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n return function <TConstructor extends { new(...args: any[]): {} }>(Constructor: TConstructor) {\n return class extends Constructor {\n _propBindings: {};\n shouldComponentUpdate(nextProps, nextState) {\n let newBindings = itemsThatEffectUpdateSelector(nextProps);\n let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n this._propBindings = newBindings;\n return !bindingsAreEqual;\n }\n render() {\n return React.createElement(<any>Constructor, (<any>this).props);\n }\n };\n };\n}\n\n// export function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n// return function(Comp: React.ComponentClass<TProps, TState>) {\n// return class extends React.Component<TProps, TState> {\n// _propBindings : {};\n// shouldComponentUpdate(nextProps, nextState) {\n// let newBindings = itemsThatEffectUpdateSelector(nextProps);\n// let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n// this._propBindings = newBindings;\n// return !bindingsAreEqual;\n// }\n// render() {\n// return React.createElement(Comp, this.props);\n// }\n// };\n// };\n// }","// taken from fbjs:\n// https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js\n// Licence (MIT) https://github.com/facebook/fbjs/blob/master/packages/fbjs/LICENSE\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule shallowEqual\n * @typechecks\n * @flow\n */\n\n/*eslint-disable no-self-compare */\n\n'use strict';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nexport function is(x: any, y: any): boolean {\n // SameValue algorithm\n if (x === y) { // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Added the nonzero y check to make Flow happy, but it is redundant\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nexport function shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null ||\n typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (\n !hasOwnProperty.call(objB, keysA[i]) ||\n !is(objA[keysA[i]], objB[keysA[i]])\n ) {\n return false;\n }\n }\n\n return true;\n}","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport {Disposable, Router, EspDecoratorUtil, utils, DisposableBase} from 'esp-js';\nimport {createViewForModel } from './viewBindingDecorator';\nimport {GetEspReactRenderModelConsts, GetEspReactRenderModelMetadata} from './getEspReactRenderModel';\n\nexport type PublishEvent = (eventType: string, event: any) => void;\n\nexport type CreatePublishEventProps<TPublishEventProps> = (publishEvent: PublishEvent) => TPublishEventProps;\n\nexport type MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps = {}> = (model: TModel, publishEventProps: TPublishEventProps) => TModelMappedToProps;\n\nexport type ViewComponentTypes = React.FunctionComponent | React.ClassType<any, any, any> | React.ComponentClass;\n\nexport interface ConnectableComponentProps<TModel ={}, TPublishEventProps = {}, TModelMappedToProps = {}> {\n modelId?: string;\n viewContext?: string;\n view?: ViewComponentTypes;\n /**\n * Provides a means to create a serious of 'publish event' callbacks which will be passed as props to the child view.\n */\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>;\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>;\n [key: string]: any; // ...rest props, including the result of mapPublish and mapPublish if 'connect' was used\n}\n\nexport interface ConnectableComponentChildProps<TModel> {\n modelId: string;\n model: TModel;\n router: Router;\n [key: string]: any; // ...rest props, including the result of mapPublish and mapPublish if 'connect' was used\n}\n\nexport interface State {\n model?: any;\n currentModelId?: string;\n publishProps?: any;\n publishEvent?: PublishModelEventDelegate;\n}\n\ninterface ConnectableComponentContext {\n router: Router;\n modelId: string;\n}\n\nexport type PublishModelEventDelegate = (eventType: string, event: any) => void;\n\nexport const PublishModelEventContext = React.createContext<PublishModelEventDelegate>(null);\n\nexport const HooksPublishModelEventProvider = PublishModelEventContext.Provider;\n\nexport class ConnectableComponent<TModel, TPublishEventProps = {}, TModelMappedToProps = {}> extends React.Component<ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, State> {\n private _isMounted = false;\n private _observationSubscription: Disposable;\n context: ConnectableComponentContext;\n\n static contextTypes = {\n router: PropTypes.instanceOf(Router).isRequired,\n modelId: PropTypes.string\n };\n\n constructor(props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, context: ConnectableComponentContext) {\n super(props, context);\n this.state = {model: null, currentModelId: null};\n }\n\n componentWillReceiveProps(nextProps: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, nextContext: ConnectableComponentContext) {\n const modelId = nextProps.modelId || nextContext.modelId;\n const oldModelId = this._getModelId();\n\n if (modelId === oldModelId) {\n return;\n }\n \n if(nextProps.modelId === oldModelId) {\n return;\n }\n\n this._tryObserveModel(modelId);\n }\n\n componentDidMount() {\n this._isMounted = true;\n this._tryObserveModel(this._getModelId());\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n this._tryDisposeModelSubscription();\n }\n\n private _getModelId(): string {\n // props override context\n return this.props.modelId || this.context.modelId;\n }\n\n private _tryObserveModel(modelId: string): void {\n this._tryDisposeModelSubscription();\n\n if (!modelId) {\n return;\n }\n\n let stateChanged = modelId !== this.state.currentModelId;\n\n let publishEvent = this.state.publishEvent;\n if (stateChanged) {\n publishEvent = this._publishEvent(this.context.router, modelId);\n }\n\n let publishProps = this.state.publishProps;\n // We only map the publish props once, as for well behaving components these callbacks should never change\n if (stateChanged && this.props.createPublishEventProps) {\n publishProps = this.props.createPublishEventProps(publishEvent);\n }\n\n if (stateChanged) {\n this.setState({\n currentModelId: modelId,\n publishEvent,\n publishProps\n });\n this._observationSubscription = this.context.router\n .getModelObservable(modelId)\n .subscribe(model => {\n if (this._isMounted) {\n this.setState({model});\n }\n });\n }\n }\n\n private _tryDisposeModelSubscription() {\n if(this._observationSubscription) {\n this._observationSubscription.dispose();\n this._observationSubscription = new DisposableBase();\n this.setState({model: null, currentModelId: null, publishProps: null, publishEvent: null});\n }\n }\n\n private _publishEvent = (router: Router, modelId: string) => (eventType: string, event: any) => router.publishEvent(modelId, eventType, event);\n\n public render() {\n if(this.state.model == null) {\n return null;\n }\n let childProps = this._getChildProps();\n let view = createViewForModel(this.state.model, childProps, this.props.viewContext, this.props.view);\n return (<HooksPublishModelEventProvider value={this.state.publishEvent}>{view}</HooksPublishModelEventProvider>);\n }\n\n private _getChildProps(): ConnectableComponentChildProps<TModel> {\n // consume what this component owns, and let the rest end up in `...rest`\n const {children, createPublishEventProps, modelId, mapModelToProps, view, viewContext, ...rest} = this.props;\n const model = this._getRenderModel(this.state.model);\n let childProps = {\n modelId,\n router: this.context.router,\n ...rest,\n ...this.state.publishProps,\n model\n };\n if (this.props.mapModelToProps) {\n childProps = {\n ...childProps,\n ...(this.props.mapModelToProps(model, this.state.publishProps) as any)\n };\n }\n return childProps;\n }\n\n /**\n * Sees if there is a special selector function which can be invoked to return a render model rather than the top level model model itself\n */\n private _getRenderModel(model: any): TModel {\n // does the given model have a decorated function we can invoke to get a different model to render?\n if (EspDecoratorUtil.hasMetadata(model)) {\n let metadata: GetEspReactRenderModelMetadata = EspDecoratorUtil.getCustomData(model, GetEspReactRenderModelConsts.CustomDataKey);\n if (metadata) {\n return model[metadata.functionName]();\n }\n }\n // else see if there is a function with name GetEspReactRenderModelConsts.HandlerFunctionName we can invoke to get a different model to render?\n let renderModelGetter = model[GetEspReactRenderModelConsts.HandlerFunctionName];\n if (renderModelGetter && utils.isFunction(renderModelGetter)) {\n return renderModelGetter.call(model);\n }\n // else just return the default model\n return model;\n }\n}\n\n// Lifting 'ConnectableView' into it's own type so it can be exported, else tsc doesn't correctly generated declaration files\nexport type ConnectableView = React.ComponentClass | React.SFC;\n\nexport const connect = function<TModel, TPublishEventProps, TModelMappedToProps = {}>(\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>,\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>\n): (view: ConnectableView) => (props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) => JSX.Element {\n return function(view: ConnectableView) {\n return function(props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) {\n const {modelId, viewContext, ...rest} = props;\n return <ConnectableComponent\n modelId={modelId}\n view={view}\n viewContext={viewContext}\n createPublishEventProps={createPublishEventProps}\n mapModelToProps={mapModelToProps}\n {...rest}\n />;\n };\n };\n};"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("esp-js"),require("prop-types"),require("esp-js-polimer")):"function"==typeof define&&define.amd?define(["react","esp-js","prop-types","esp-js-polimer"],t):"object"==typeof exports?exports["esp-js-react"]=t(require("react"),require("esp-js"),require("prop-types"),require("esp-js-polimer")):e["esp-js-react"]=t(e.react,e["esp-js"],e["prop-types"],e["esp-js-polimer"])}("undefined"!=typeof self?self:this,(function(e,t,r,o){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewMetadataRegistration=t.ViewMetadata=t.viewBinding=t.createViewForModel=t.DEFAULT_VIEW_KEY=void 0;const o=r(1),n=r(2);t.DEFAULT_VIEW_KEY="default-view-key",t.createViewForModel=function(e,r,n,i){let s=i;if(e){let r=e.constructor;if(r._viewMetadata){let e=r._viewMetadata;if(n&&e.hasRegisteredViewContext(n)){s=e.viewRegistrations[n].view}if(!s&&e.hasRegisteredViewContext(t.DEFAULT_VIEW_KEY)){s=e.viewRegistrations[t.DEFAULT_VIEW_KEY].view}}}if(!s)throw new Error(`No suitable view found for model id '${e.modelId}' using context '${n}'`);return o.createElement(s,r)},t.viewBinding=function(e,r=t.DEFAULT_VIEW_KEY){return n.Guard.isDefined(e,"view must be defined"),n.Guard.isString(r,"displayContext must be a string"),function(t){let o=function(e){return e._viewMetadata||(e._viewMetadata=new i),e._viewMetadata}(t);if(o.hasRegisteredViewContext(r))throw new Error(`Context ${r} already registered for view`);o.viewRegistrations[r]=new s(e,r)}};class i{constructor(){this._viewRegistrations={}}get viewRegistrations(){return this._viewRegistrations}hasRegisteredViewContext(e){return void 0!==this._viewRegistrations[e]}}t.ViewMetadata=i;class s{constructor(e,t){this._view=e,this._displayContext=t}get view(){return this._view}get displayContext(){return this._displayContext}}t.ViewMetadataRegistration=s},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEspReactRenderModel=t.GetEspReactRenderModelConsts=void 0;const o=r(2);var n;!function(e){e.CustomDataKey="GetEspReactRenderModelCustomDataKey",e.HandlerFunctionName="getEspReactRenderModel"}(n=t.GetEspReactRenderModelConsts||(t.GetEspReactRenderModelConsts={})),t.getEspReactRenderModel=function(){return function(e,t,r){return o.EspDecoratorUtil.getOrCreateMetaData(e.constructor).addCustomData(n.CustomDataKey,{functionName:t}),r}}},function(e,t,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(6);var i=r(8);Object.defineProperty(t,"RouterProvider",{enumerable:!0,get:function(){return i.RouterProvider}}),Object.defineProperty(t,"HooksRouterProvider",{enumerable:!0,get:function(){return i.HooksRouterProvider}}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return i.RouterContext}});var s=r(9);Object.defineProperty(t,"SmartComponent",{enumerable:!0,get:function(){return s.SmartComponent}});var u=r(10);Object.defineProperty(t,"ViewBinder",{enumerable:!0,get:function(){return u.ViewBinder}});var l=r(0);Object.defineProperty(t,"viewBinding",{enumerable:!0,get:function(){return l.viewBinding}}),Object.defineProperty(t,"DEFAULT_VIEW_KEY",{enumerable:!0,get:function(){return l.DEFAULT_VIEW_KEY}}),n(r(4),t);var d=r(11);Object.defineProperty(t,"shouldUpdateMixin",{enumerable:!0,get:function(){return d.shouldUpdateMixin}});var c=r(0);Object.defineProperty(t,"createViewForModel",{enumerable:!0,get:function(){return c.createViewForModel}});var p=r(13);Object.defineProperty(t,"ConnectableComponent",{enumerable:!0,get:function(){return p.ConnectableComponent}}),Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return p.connect}}),Object.defineProperty(t,"PublishModelEventContext",{enumerable:!0,get:function(){return p.PublishModelEventContext}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=r(7),n=r(0);o.PolimerModelBuilder.prototype.withViewBindings=function(e,t=n.DEFAULT_VIEW_KEY){let r=this._viewMappings||{};return r[t]=e,this._viewMappings=r,this};let i=o.PolimerModelBuilder.prototype.registerWithRouter;o.PolimerModelBuilder.prototype.registerWithRouter=function(){let e=i.call(this),t=this._viewMappings;return t&&Object.keys(t).forEach(r=>{n.viewBinding(t[r],r)(e.constructor)}),e}},function(e,t){e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RouterProvider=t.HooksRouterProvider=t.RouterContext=void 0;const o=r(1),n=r(3),i=r(2);t.RouterContext=o.createContext(null),t.HooksRouterProvider=t.RouterContext.Provider;class s extends o.Component{getChildContext(){return{router:this.props.router}}render(){return o.createElement(t.HooksRouterProvider,{value:this.props.router},this.props.children)}}t.RouterProvider=s,s.childContextTypes={router:n.instanceOf(i.Router).isRequired}},function(e,t,r){"use strict";var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.SmartComponent=void 0;const n=r(1),i=r(3),s=r(0),u=r(2);class l extends n.Component{constructor(){super(...arguments),this._currentObservingModelId=!1,this._observationSubscription=null}componentWillReceiveProps(e){this._tryObserveModel(e.modelId)}componentWillMount(){this._tryObserveModel(this.props.modelId)}componentWillUnmount(){this._tryDisposeObservationSubscription()}_tryObserveModel(e){e?e!==this._currentObservingModelId&&(this._tryDisposeObservationSubscription(),this._currentObservingModelId=e,this._observationSubscription=this.context.router.getModelObservable(e).map(e=>this.props.modelSelector?this.props.modelSelector(e):e).subscribe(e=>{this.setState({model:e})})):(this._tryDisposeObservationSubscription(),this.setState({model:null}))}_tryDisposeObservationSubscription(){this._currentObservingModelId=null,this._observationSubscription&&this._observationSubscription.dispose()}render(){return this.state.model?s.createViewForModel(this.state.model,this._getChildProps(),this.props.viewContext,this.props.view):null}_getChildProps(){let e=this.props,{modelId:t,viewContext:r,view:n,modelSelector:i}=e,s=o(e,["modelId","viewContext","view","modelSelector"]),u={model:this.state.model,router:this.context.router};return Object.assign({},u,s)}}t.SmartComponent=l,l.contextTypes={router:i.instanceOf(u.Router).isRequired}},function(e,t,r){"use strict";var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ViewBinder=void 0;const n=r(2),i=r(1),s=r(3),u=r(0);class l extends i.Component{render(){if(this.props.model){let e=this.props,{model:t,viewContext:r}=e,n=o(e,["model","viewContext"]),i=Object.assign({},{model:this.props.model,router:this.context.router},n);return u.createViewForModel(this.props.model,i,this.props.viewContext,null)}return null}}t.ViewBinder=l,l.contextTypes={router:s.instanceOf(n.Router).isRequired}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUpdateMixin=void 0;const o=r(1),n=r(12);t.shouldUpdateMixin=function(e){return function(t){return class extends t{shouldComponentUpdate(t,r){let o=e(t),i=n.shallowEqual(this._propBindings,o);return this._propBindings=o,!i}render(){return o.createElement(t,this.props)}}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shallowEqual=t.is=void 0;const o=Object.prototype.hasOwnProperty;function n(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}t.is=n,t.shallowEqual=function(e,t){if(n(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let i=0;i<r.length;i++)if(!o.call(t,r[i])||!n(e[r[i]],t[r[i]]))return!1;return!0}},function(e,t,r){"use strict";var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=t.ConnectableComponent=t.HooksPublishModelEventProvider=t.PublishModelEventContext=void 0;const n=r(1),i=r(3),s=r(2),u=r(0),l=r(4);t.PublishModelEventContext=n.createContext(null),t.HooksPublishModelEventProvider=t.PublishModelEventContext.Provider;class d extends n.Component{constructor(e,t){super(e,t),this._isMounted=!1,this._publishEvent=(e,t)=>(r,o)=>e.publishEvent(t,r,o),this.state={model:null,currentModelId:null}}componentWillReceiveProps(e,t){const r=e.modelId||t.modelId,o=this._getModelId();r!==o&&e.modelId!==o&&this._tryObserveModel(r)}componentDidMount(){this._isMounted=!0,this._tryObserveModel(this._getModelId())}componentWillUnmount(){this._isMounted=!1,this._tryDisposeModelSubscription()}_getModelId(){return this.props.modelId||this.context.modelId}_tryObserveModel(e){if(this._tryDisposeModelSubscription(),!e)return;let t=e!==this.state.currentModelId,r=this.state.publishEvent;t&&(r=this._publishEvent(this.context.router,e));let o=this.state.publishProps;t&&this.props.createPublishEventProps&&(o=this.props.createPublishEventProps(r)),t&&(this.setState({currentModelId:e,publishEvent:r,publishProps:o}),this._observationSubscription=this.context.router.getModelObservable(e).subscribe(e=>{this._isMounted&&this.setState({model:e})}))}_tryDisposeModelSubscription(){this._observationSubscription&&(this._observationSubscription.dispose(),this._observationSubscription=new s.DisposableBase,this.setState({model:null,currentModelId:null,publishProps:null,publishEvent:null}))}render(){if(null==this.state.model)return null;let e=this._getChildProps(),r=u.createViewForModel(this.state.model,e,this.props.viewContext,this.props.view);return n.createElement(t.HooksPublishModelEventProvider,{value:this.state.publishEvent},r)}_getChildProps(){const e=this.props,{children:t,createPublishEventProps:r,modelId:n,mapModelToProps:i,view:s,viewContext:u}=e,l=o(e,["children","createPublishEventProps","modelId","mapModelToProps","view","viewContext"]),d=this._getRenderModel(this.state.model);let c=Object.assign(Object.assign(Object.assign({modelId:n,router:this.context.router},l),this.state.publishProps),{model:d});return this.props.mapModelToProps&&(c=Object.assign(Object.assign({},c),this.props.mapModelToProps(d,this.state.publishProps))),c}_getRenderModel(e){if(s.EspDecoratorUtil.hasMetadata(e)){let t=s.EspDecoratorUtil.getCustomData(e,l.GetEspReactRenderModelConsts.CustomDataKey);if(t)return e[t.functionName]()}let t=e[l.GetEspReactRenderModelConsts.HandlerFunctionName];return t&&s.utils.isFunction(t)?t.call(e):e}}t.ConnectableComponent=d,d.contextTypes={router:i.instanceOf(s.Router).isRequired,modelId:i.string},t.connect=function(e,t){return function(r){return function(i){const{modelId:s,viewContext:u}=i,l=o(i,["modelId","viewContext"]);return n.createElement(d,Object.assign({modelId:s,view:r,viewContext:u,createPublishEventProps:t,mapModelToProps:e},l))}}}}])}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("esp-js"),require("prop-types"),require("esp-js-polimer")):"function"==typeof define&&define.amd?define(["react","esp-js","prop-types","esp-js-polimer"],t):"object"==typeof exports?exports["esp-js-react"]=t(require("react"),require("esp-js"),require("prop-types"),require("esp-js-polimer")):e["esp-js-react"]=t(e.react,e["esp-js"],e["prop-types"],e["esp-js-polimer"])}("undefined"!=typeof self?self:this,(function(e,t,o,r){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=5)}([function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewMetadataRegistration=t.ViewMetadata=t.viewBinding=t.createViewForModel=t.DEFAULT_VIEW_KEY=void 0;const r=o(1),n=o(2);t.DEFAULT_VIEW_KEY="default-view-key",t.createViewForModel=function(e,o,n,i){let s=i;if(e){let o=e.constructor;if(o._viewMetadata){let e=o._viewMetadata;if(n&&e.hasRegisteredViewContext(n)){s=e.viewRegistrations[n].view}if(!s&&e.hasRegisteredViewContext(t.DEFAULT_VIEW_KEY)){s=e.viewRegistrations[t.DEFAULT_VIEW_KEY].view}}}if(!s)throw new Error(`No suitable view found for model id '${e.modelId}' using context '${n}'`);return r.createElement(s,o)},t.viewBinding=function(e,o=t.DEFAULT_VIEW_KEY){return n.Guard.isDefined(e,"view must be defined"),n.Guard.isString(o,"displayContext must be a string"),function(t){let r=function(e){return e._viewMetadata||(e._viewMetadata=new i),e._viewMetadata}(t);if(r.hasRegisteredViewContext(o))throw new Error(`Context ${o} already registered for view`);r.viewRegistrations[o]=new s(e,o)}};class i{constructor(){this._viewRegistrations={}}get viewRegistrations(){return this._viewRegistrations}hasRegisteredViewContext(e){return void 0!==this._viewRegistrations[e]}}t.ViewMetadata=i;class s{constructor(e,t){this._view=e,this._displayContext=t}get view(){return this._view}get displayContext(){return this._displayContext}}t.ViewMetadataRegistration=s},function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t){e.exports=o},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEspReactRenderModel=t.GetEspReactRenderModelConsts=void 0;const r=o(2);var n;!function(e){e.CustomDataKey="GetEspReactRenderModelCustomDataKey",e.HandlerFunctionName="getEspReactRenderModel"}(n=t.GetEspReactRenderModelConsts||(t.GetEspReactRenderModelConsts={})),t.getEspReactRenderModel=function(){return function(e,t,o){return r.EspDecoratorUtil.getOrCreateMetaData(e.constructor).addCustomData(n.CustomDataKey,{functionName:t}),o}}},function(e,t,o){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),n=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||r(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.PublishModelEventContext=t.connect=t.ConnectableComponent=t.createViewForModel=t.shouldUpdateMixin=t.DEFAULT_VIEW_KEY=t.viewBinding=t.ViewBinder=t.SmartComponent=t.RouterContext=t.HooksRouterProvider=t.RouterProvider=void 0,o(6);var i=o(8);Object.defineProperty(t,"RouterProvider",{enumerable:!0,get:function(){return i.RouterProvider}}),Object.defineProperty(t,"HooksRouterProvider",{enumerable:!0,get:function(){return i.HooksRouterProvider}}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return i.RouterContext}});var s=o(9);Object.defineProperty(t,"SmartComponent",{enumerable:!0,get:function(){return s.SmartComponent}});var u=o(10);Object.defineProperty(t,"ViewBinder",{enumerable:!0,get:function(){return u.ViewBinder}});var l=o(0);Object.defineProperty(t,"viewBinding",{enumerable:!0,get:function(){return l.viewBinding}}),Object.defineProperty(t,"DEFAULT_VIEW_KEY",{enumerable:!0,get:function(){return l.DEFAULT_VIEW_KEY}}),n(o(4),t);var d=o(11);Object.defineProperty(t,"shouldUpdateMixin",{enumerable:!0,get:function(){return d.shouldUpdateMixin}});var c=o(0);Object.defineProperty(t,"createViewForModel",{enumerable:!0,get:function(){return c.createViewForModel}});var p=o(13);Object.defineProperty(t,"ConnectableComponent",{enumerable:!0,get:function(){return p.ConnectableComponent}}),Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return p.connect}}),Object.defineProperty(t,"PublishModelEventContext",{enumerable:!0,get:function(){return p.PublishModelEventContext}})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=o(7),n=o(0);r.PolimerModelBuilder.prototype.withViewBindings=function(e,t=n.DEFAULT_VIEW_KEY){let o=this._viewMappings||{};return o[t]=e,this._viewMappings=o,this};let i=r.PolimerModelBuilder.prototype.registerWithRouter;r.PolimerModelBuilder.prototype.registerWithRouter=function(){let e=i.call(this),t=this._viewMappings;return t&&Object.keys(t).forEach(o=>{(0,n.viewBinding)(t[o],o)(e.constructor)}),e}},function(e,t){e.exports=r},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RouterProvider=t.HooksRouterProvider=t.RouterContext=void 0;const r=o(1),n=o(3),i=o(2);t.RouterContext=r.createContext(null),t.HooksRouterProvider=t.RouterContext.Provider;class s extends r.Component{getChildContext(){return{router:this.props.router}}render(){return r.createElement(t.HooksRouterProvider,{value:this.props.router},this.props.children)}}t.RouterProvider=s,s.childContextTypes={router:n.instanceOf(i.Router).isRequired}},function(e,t,o){"use strict";var r=this&&this.__rest||function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]])}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.SmartComponent=void 0;const n=o(1),i=o(3),s=o(0),u=o(2);class l extends n.Component{constructor(){super(...arguments),this._currentObservingModelId=!1,this._observationSubscription=null}componentWillReceiveProps(e){this._tryObserveModel(e.modelId)}componentWillMount(){this._tryObserveModel(this.props.modelId)}componentWillUnmount(){this._tryDisposeObservationSubscription()}_tryObserveModel(e){e?e!==this._currentObservingModelId&&(this._tryDisposeObservationSubscription(),this._currentObservingModelId=e,this._observationSubscription=this.context.router.getModelObservable(e).map(e=>this.props.modelSelector?this.props.modelSelector(e):e).subscribe(e=>{this.setState({model:e})})):(this._tryDisposeObservationSubscription(),this.setState({model:null}))}_tryDisposeObservationSubscription(){this._currentObservingModelId=null,this._observationSubscription&&this._observationSubscription.dispose()}render(){return this.state.model?(0,s.createViewForModel)(this.state.model,this._getChildProps(),this.props.viewContext,this.props.view):null}_getChildProps(){let e=this.props,{modelId:t,viewContext:o,view:n,modelSelector:i}=e,s=r(e,["modelId","viewContext","view","modelSelector"]),u={model:this.state.model,router:this.context.router};return Object.assign({},u,s)}}t.SmartComponent=l,l.contextTypes={router:i.instanceOf(u.Router).isRequired}},function(e,t,o){"use strict";var r=this&&this.__rest||function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]])}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.ViewBinder=void 0;const n=o(2),i=o(1),s=o(3),u=o(0);class l extends i.Component{render(){if(this.props.model){let e=this.props,{model:t,viewContext:o}=e,n=r(e,["model","viewContext"]),i=Object.assign({},{model:this.props.model,router:this.context.router},n);return(0,u.createViewForModel)(this.props.model,i,this.props.viewContext,null)}return null}}t.ViewBinder=l,l.contextTypes={router:s.instanceOf(n.Router).isRequired}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUpdateMixin=void 0;const r=o(1),n=o(12);t.shouldUpdateMixin=function(e){return function(t){return class extends t{shouldComponentUpdate(t,o){let r=e(t),i=(0,n.shallowEqual)(this._propBindings,r);return this._propBindings=r,!i}render(){return r.createElement(t,this.props)}}}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shallowEqual=t.is=void 0;const r=Object.prototype.hasOwnProperty;function n(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}t.is=n,t.shallowEqual=function(e,t){if(n(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(let i=0;i<o.length;i++)if(!r.call(t,o[i])||!n(e[o[i]],t[o[i]]))return!1;return!0}},function(e,t,o){"use strict";var r=this&&this.__rest||function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]])}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.connect=t.ConnectableComponent=t.HooksPublishModelEventProvider=t.PublishModelEventContext=void 0;const n=o(1),i=o(3),s=o(2),u=o(0),l=o(4);t.PublishModelEventContext=n.createContext(null),t.HooksPublishModelEventProvider=t.PublishModelEventContext.Provider;class d extends n.Component{constructor(e,t){super(e,t),this._isMounted=!1,this._publishEvent=(e,t)=>(o,r)=>e.publishEvent(t,o,r),this.state={model:null,currentModelId:null}}componentWillReceiveProps(e,t){const o=e.modelId||t.modelId,r=this._getModelId();o!==r&&e.modelId!==r&&this._tryObserveModel(o)}componentDidMount(){this._isMounted=!0,this._tryObserveModel(this._getModelId())}componentWillUnmount(){this._isMounted=!1,this._tryDisposeModelSubscription()}_getModelId(){return this.props.modelId||this.context.modelId}_tryObserveModel(e){if(this._tryDisposeModelSubscription(),!e)return;let t=e!==this.state.currentModelId,o=this.state.publishEvent;t&&(o=this._publishEvent(this.context.router,e));let r=this.state.publishProps;t&&this.props.createPublishEventProps&&(r=this.props.createPublishEventProps(o)),t&&(this.setState({currentModelId:e,publishEvent:o,publishProps:r}),this._observationSubscription=this.context.router.getModelObservable(e).subscribe(e=>{this._isMounted&&this.setState({model:e})}))}_tryDisposeModelSubscription(){this._observationSubscription&&(this._observationSubscription.dispose(),this._observationSubscription=new s.DisposableBase,this.setState({model:null,currentModelId:null,publishProps:null,publishEvent:null}))}render(){if(null==this.state.model)return null;let e=this._getChildProps(),o=(0,u.createViewForModel)(this.state.model,e,this.props.viewContext,this.props.view);return n.createElement(t.HooksPublishModelEventProvider,{value:this.state.publishEvent},o)}_getChildProps(){const e=this.props,{children:t,createPublishEventProps:o,modelId:n,mapModelToProps:i,view:s,viewContext:u}=e,l=r(e,["children","createPublishEventProps","modelId","mapModelToProps","view","viewContext"]),d=this._getRenderModel(this.state.model);let c=Object.assign(Object.assign(Object.assign({modelId:n,router:this.context.router},l),this.state.publishProps),{model:d});return this.props.mapModelToProps&&(c=Object.assign(Object.assign({},c),this.props.mapModelToProps(d,this.state.publishProps))),c}_getRenderModel(e){if(s.EspDecoratorUtil.hasMetadata(e)){let t=s.EspDecoratorUtil.getCustomData(e,l.GetEspReactRenderModelConsts.CustomDataKey);if(t)return e[t.functionName]()}let t=e[l.GetEspReactRenderModelConsts.HandlerFunctionName];return t&&s.utils.isFunction(t)?t.call(e):e}}t.ConnectableComponent=d,d.contextTypes={router:i.instanceOf(s.Router).isRequired,modelId:i.string};t.connect=function(e,t){return function(o){return function(i){const{modelId:s,viewContext:u}=i,l=r(i,["modelId","viewContext"]);return n.createElement(d,Object.assign({modelId:s,view:o,viewContext:u,createPublishEventProps:t,mapModelToProps:e},l))}}}}])}));
2
2
  //# sourceMappingURL=esp-react.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///esp-js-react/webpack/universalModuleDefinition","webpack:///esp-js-react/webpack/bootstrap","webpack:///esp-js-react/src/viewBindingDecorator.ts","webpack:///esp-js-react/external \"react\"","webpack:///esp-js-react/external \"esp-js\"","webpack:///esp-js-react/external \"prop-types\"","webpack:///esp-js-react/src/getEspReactRenderModel.ts","webpack:///esp-js-react/src/index.ts","webpack:///esp-js-react/src/polimer/polimerExtentsions.ts","webpack:///esp-js-react/external \"esp-js-polimer\"","webpack:///esp-js-react/src/routerProvider.tsx","webpack:///esp-js-react/src/smartComponent.tsx","webpack:///esp-js-react/src/viewBinder.tsx","webpack:///esp-js-react/src/shouldUpdateMixin.ts","webpack:///esp-js-react/src/shallowEqual.ts","webpack:///esp-js-react/src/connectableComponent.tsx"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__7__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","DEFAULT_VIEW_KEY","model","props","displayContext","view","finalView","constructorFunction","constructor","_viewMetadata","viewMetadata","hasRegisteredViewContext","viewRegistrations","Error","modelId","React","createElement","Guard","isDefined","isString","target","ViewMetadata","getMetadata","ViewMetadataRegistration","_viewRegistrations","_view","_displayContext","GetEspReactRenderModelConsts","CustomDataKey","HandlerFunctionName","descriptor","EspDecoratorUtil","getOrCreateMetaData","addCustomData","functionName","RouterProvider","HooksRouterProvider","RouterContext","SmartComponent","ViewBinder","viewBinding","shouldUpdateMixin","createViewForModel","ConnectableComponent","connect","PublishModelEventContext","PolimerModelBuilder","withViewBindings","viewMappings","_viewMappings","registerWithRouter","keys","forEach","createContext","Provider","Component","router","children","childContextTypes","PropTypes","instanceOf","Router","isRequired","_currentObservingModelId","_observationSubscription","nextProps","_tryObserveModel","_tryDisposeObservationSubscription","context","getModelObservable","map","modelSelector","subscribe","setState","dispose","state","_getChildProps","viewContext","other","newProps","assign","contextTypes","esp","itemsThatEffectUpdateSelector","Constructor","nextState","newBindings","bindingsAreEqual","shallowEqual","_propBindings","is","x","y","objA","objB","keysA","keysB","length","HooksPublishModelEventProvider","super","_isMounted","_publishEvent","eventType","event","publishEvent","currentModelId","nextContext","oldModelId","_getModelId","_tryDisposeModelSubscription","stateChanged","publishProps","createPublishEventProps","DisposableBase","childProps","mapModelToProps","rest","_getRenderModel","hasMetadata","metadata","getCustomData","renderModelGetter","utils","isFunction","string"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,cAAeA,QAAQ,mBACpE,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,QAAS,SAAU,aAAc,kBAAmBJ,GAClC,iBAAZC,QACdA,QAAQ,gBAAkBD,EAAQG,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,cAAeA,QAAQ,mBAEtGJ,EAAK,gBAAkBC,EAAQD,EAAY,MAAGA,EAAK,UAAWA,EAAK,cAAeA,EAAK,mBARzF,CASmB,oBAATO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OAAH,wBACHA,GACCzJ,KAAK0C,MAAMgH,gBAAgBjH,EAAOzC,KAAKkH,MAAMoC,gBAGlDG,EAMH,gBAAgBhH,GAEpB,GAAI,EAAA6B,iBAAiBuF,YAAYpH,GAAQ,CACrC,IAAIqH,EAA2C,EAAAxF,iBAAiByF,cAActH,EAAO,EAAAyB,6BAA6BC,eAClH,GAAI2F,EACA,OAAOrH,EAAMqH,EAASrF,gBAI9B,IAAIuF,EAAoBvH,EAAM,EAAAyB,6BAA6BE,qBAC3D,OAAI4F,GAAqB,EAAAC,MAAMC,WAAWF,GAC/BA,EAAkBrJ,KAAK8B,GAG3BA,GAzIf,yBAKW,EAAA+E,aAAe,CAClBzB,OAAQG,EAAUC,WAAW,EAAAC,QAAQC,WACrChD,QAAS6C,EAAUiE,QAyId,EAAAhF,QAAU,SACnBuE,EACAH,GAEA,OAAO,SAAS3G,GACZ,OAAO,SAASF,GACZ,MAAM,QAACW,EAAO,YAAE+D,GAAwB1E,EAARiH,EAAI,EAAIjH,EAAlC,2BACN,OAAO,gBAACwC,EAAoB,eACxB7B,QAASA,EACTT,KAAMA,EACNwE,YAAaA,EACbmC,wBAAyBA,EACzBG,gBAAiBA,GACbC","file":"esp-react.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"esp-js\"), require(\"prop-types\"), require(\"esp-js-polimer\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"esp-js\", \"prop-types\", \"esp-js-polimer\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"esp-js-react\"] = factory(require(\"react\"), require(\"esp-js\"), require(\"prop-types\"), require(\"esp-js-polimer\"));\n\telse\n\t\troot[\"esp-js-react\"] = factory(root[\"react\"], root[\"esp-js\"], root[\"prop-types\"], root[\"esp-js-polimer\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__7__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport {Guard} from 'esp-js';\nimport {ViewComponentTypes} from './connectableComponent';\n\nexport const DEFAULT_VIEW_KEY = 'default-view-key';\n\nfunction getMetadata(target) {\n if (!target._viewMetadata) {\n target._viewMetadata = new ViewMetadata();\n }\n return target._viewMetadata;\n}\n\n/**\n * Tries to get a view for the given model.\n *\n * It does this using the following order:\n * 1) If a @viewBinding decorator was used and a display context was given, try get a view for that\n * 2) Else if a view was explicitly provided use that\n * 3) Else if a @viewBinding decorator was used and there is a view associated with the default display context, use that view\n * @param model\n * @param props\n * @param displayContext\n * @param view\n */\nexport function createViewForModel(model: any, props, displayContext: string, view: ViewComponentTypes) {\n let finalView: ViewComponentTypes = view; // default to that passed in, if any.\n\n // displayContext = displayContext || DEFAULT_VIEW_KEY;\n // the view decorator isn't on the instance, it's on the constructor function that created that instance\n if (model) {\n let constructorFunction = model.constructor;\n if (constructorFunction._viewMetadata) {\n let viewMetadata = constructorFunction._viewMetadata;\n if (displayContext && viewMetadata.hasRegisteredViewContext(displayContext)) {\n let viewMetadataRegistration = viewMetadata.viewRegistrations[displayContext];\n // we've found a view for the display context, use that\n finalView = viewMetadataRegistration.view;\n }\n\n // if we've not found a view yet, and one wasn't provided, is there a default one?\n if (!finalView && viewMetadata.hasRegisteredViewContext(DEFAULT_VIEW_KEY)) {\n let viewMetadataRegistration = viewMetadata.viewRegistrations[DEFAULT_VIEW_KEY];\n finalView = viewMetadataRegistration.view;\n }\n }\n }\n if (!finalView) {\n throw new Error(`No suitable view found for model id '${model.modelId}' using context '${displayContext}'`);\n }\n return React.createElement(finalView, props);\n}\n\n/**\n * An ES7 style decorator that associates a model with a view\n * @param view the react component that will be used to display this model\n * @param displayContext an optional context allowing for different views to display the same model\n * @returns {Function}\n */\nexport function viewBinding(view: any, displayContext: string = DEFAULT_VIEW_KEY) {\n Guard.isDefined(view, 'view must be defined');\n Guard.isString(displayContext, 'displayContext must be a string');\n return function (target) {\n let viewMetadata = getMetadata(target);\n if (viewMetadata.hasRegisteredViewContext(displayContext)) {\n throw new Error(`Context ${displayContext} already registered for view`);\n }\n viewMetadata.viewRegistrations[displayContext] = new ViewMetadataRegistration(view, displayContext);\n };\n}\n\nexport class ViewMetadata {\n private _viewRegistrations = {};\n\n get viewRegistrations() {\n return this._viewRegistrations;\n }\n\n hasRegisteredViewContext(displayContext) {\n return typeof this._viewRegistrations[displayContext] !== 'undefined';\n }\n}\n\nexport class ViewMetadataRegistration {\n\n constructor(private _view, private _displayContext) {\n }\n\n get view() {\n return this._view;\n }\n\n get displayContext() {\n return this._displayContext;\n }\n}","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","import {EspMetadata, EspDecoratorUtil} from 'esp-js';\n\nexport interface GetEspReactRenderModelMetadata {\n functionName: string;\n}\n\nexport namespace GetEspReactRenderModelConsts {\n export const CustomDataKey = 'GetEspReactRenderModelCustomDataKey';\n /**\n * If there is no @getEspReactRenderModel decorator and a function by this name exists on a model, then it will be invoked to identify the sub model which will replaced the `model` prop passed to the child view of a ConnectableComponent\n */\n export const HandlerFunctionName = 'getEspReactRenderModel';\n}\n\n/**\n * A decorator which can be used to identify the render model which will replaced the `model` prop passed to the child view of a ConnectableComponent\n */\nexport function getEspReactRenderModel() {\n return function (target, name, descriptor) {\n let metadata: EspMetadata = EspDecoratorUtil.getOrCreateMetaData(target.constructor);\n metadata.addCustomData(\n GetEspReactRenderModelConsts.CustomDataKey,\n <GetEspReactRenderModelMetadata>{ functionName: name }\n );\n return descriptor;\n };\n}","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n//\n\n// import for side effects\nimport './polimer/polimerExtentsions';\n\nexport {RouterProvider, HooksRouterProvider, RouterContext} from './routerProvider';\nexport {SmartComponent} from './smartComponent';\nexport {ViewBinder} from './viewBinder';\nexport {viewBinding, DEFAULT_VIEW_KEY} from './viewBindingDecorator';\nexport * from './getEspReactRenderModel';\nexport {shouldUpdateMixin} from './shouldUpdateMixin';\nexport {createViewForModel} from './viewBindingDecorator';\nexport {\n ConnectableComponent,\n connect,\n ConnectableComponentProps,\n MapModelToProps,\n CreatePublishEventProps,\n ConnectableView,\n ConnectableComponentChildProps,\n PublishModelEventDelegate,\n PublishModelEventContext\n} from './connectableComponent';\n","import {PolimerModelBuilder, PolimerModel} from 'esp-js-polimer';\nimport {DEFAULT_VIEW_KEY, viewBinding} from '../viewBindingDecorator';\n\ndeclare module 'esp-js-polimer/.dist/typings/modelBuilder' {\n export interface PolimerModelBuilder<TModel> {\n withViewBindings?(view: any, displayContext?: string): PolimerModelBuilder<TModel>;\n }\n}\n\ninterface ViewMappings {\n [displayContext: string]: any;\n}\n\nPolimerModelBuilder.prototype.withViewBindings = function (view: any, displayContext: string = DEFAULT_VIEW_KEY): PolimerModelBuilder<any> {\n let builder = this;\n // store some metadata on the builder which we'll use later to tack onto the model\n let viewMappings: ViewMappings = builder._viewMappings || { };\n viewMappings[displayContext] = view;\n builder._viewMappings = viewMappings;\n return this;\n};\n\n// we need to replace the registerWithRouter in order to dynamically add the\n// @viewBinding decorator to it\nlet registerWithRouter = PolimerModelBuilder.prototype.registerWithRouter;\nPolimerModelBuilder.prototype.registerWithRouter = function (): PolimerModel<any> {\n let builder = this;\n let model = registerWithRouter.call(builder);\n let viewMappings: ViewMappings = builder._viewMappings;\n if (viewMappings) {\n Object.keys(viewMappings).forEach(displayContext => {\n viewBinding(viewMappings[displayContext], displayContext)(model.constructor);\n });\n }\n return model;\n};\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Router } from 'esp-js';\n\nexport interface RouterProviderProps {\n router: Router;\n}\n\nexport const RouterContext = React.createContext<Router>(null);\n\nexport const HooksRouterProvider = RouterContext.Provider;\n\nexport class RouterProvider extends React.Component<RouterProviderProps, any> {\n static childContextTypes = {\n router: PropTypes.instanceOf(Router).isRequired\n };\n getChildContext() {\n return {\n router: this.props.router\n };\n }\n render() {\n return (<HooksRouterProvider value={this.props.router}>{this.props.children}</HooksRouterProvider>);\n }\n}","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { createViewForModel } from './viewBindingDecorator';\nimport { Router } from 'esp-js';\n\nexport interface SmartComponentProps {\n modelId: string;\n view?: any;\n viewContext?: string;\n modelSelector?: (model: any) => any;\n [key: string]: any; // other props which will be passed through to the SmartComponent's view\n}\n\nexport interface SmartComponentState {\n model: any;\n}\n\nexport class SmartComponent extends React.Component<SmartComponentProps, SmartComponentState> {\n private _currentObservingModelId = false;\n private _observationSubscription = null;\n\n static contextTypes = {\n router: PropTypes.instanceOf(Router).isRequired\n };\n\n componentWillReceiveProps(nextProps: SmartComponentProps) {\n this._tryObserveModel(nextProps.modelId);\n }\n componentWillMount() {\n this._tryObserveModel(this.props.modelId);\n }\n componentWillUnmount() {\n this._tryDisposeObservationSubscription();\n }\n _tryObserveModel(modelId) {\n if(!modelId) {\n this._tryDisposeObservationSubscription();\n this.setState({model: null});\n } else if (modelId !== this._currentObservingModelId) {\n this._tryDisposeObservationSubscription();\n this._currentObservingModelId = modelId;\n this._observationSubscription = this.context.router\n .getModelObservable(modelId)\n .map(model => {\n return this.props.modelSelector\n ? this.props.modelSelector(model)\n : model;\n })\n .subscribe(model => {\n this.setState({model: model});\n });\n }\n }\n _tryDisposeObservationSubscription() {\n this._currentObservingModelId = null;\n if(this._observationSubscription) {\n this._observationSubscription.dispose();\n }\n }\n render() {\n if(this.state.model) {\n return createViewForModel(this.state.model, this._getChildProps(), this.props.viewContext, this.props.view);\n }\n return null; // this (in react 15) will render a 'comment node' rather than any actual html\n }\n _getChildProps() {\n // 'consume' the props we own, pass the rest down\n let {modelId, viewContext, view, modelSelector, ...other} = this.props;\n let newProps = {\n model: this.state.model,\n router: this.context.router\n };\n return Object.assign({}, newProps, other);\n }\n} ","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as esp from 'esp-js';\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { createViewForModel } from './viewBindingDecorator';\n\nexport interface ViewBinderProps {\n model: any;\n viewContext: string;\n}\n\nexport class ViewBinder extends React.Component<ViewBinderProps> {\n\n static contextTypes = {\n router: PropTypes.instanceOf(esp.Router).isRequired\n };\n\n render() {\n if(this.props.model) {\n let {model, viewContext, ...other} = this.props;\n let newProps = Object.assign({}, { model: this.props.model, router:this.context.router }, other);\n return createViewForModel(\n this.props.model,\n newProps,\n this.props.viewContext,\n null\n );\n }\n return null;\n }\n}","// notice_start\n/*\n * Copyright 2018 Keith Woods\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport {shallowEqual} from './shallowEqual';\n\n// WORKS (compiles at least):\n//\n// export function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n// return function <T extends {new(...args:any[]):{}}>(constructor:T) {\n// return class extends constructor {\n// _propBindings : {};\n// shouldComponentUpdate(nextProps, nextState) {\n// let newBindings = itemsThatEffectUpdateSelector(nextProps);\n// let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n// this._propBindings = newBindings;\n// return !bindingsAreEqual;\n// }\n// render() {\n// return React.createElement(<any>constructor, (<any>this).props);\n// }\n// };\n// };\n// }\n\nexport function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n return function <TConstructor extends { new(...args: any[]): {} }>(Constructor: TConstructor) {\n return class extends Constructor {\n _propBindings: {};\n shouldComponentUpdate(nextProps, nextState) {\n let newBindings = itemsThatEffectUpdateSelector(nextProps);\n let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n this._propBindings = newBindings;\n return !bindingsAreEqual;\n }\n render() {\n return React.createElement(<any>Constructor, (<any>this).props);\n }\n };\n };\n}\n\n// export function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n// return function(Comp: React.ComponentClass<TProps, TState>) {\n// return class extends React.Component<TProps, TState> {\n// _propBindings : {};\n// shouldComponentUpdate(nextProps, nextState) {\n// let newBindings = itemsThatEffectUpdateSelector(nextProps);\n// let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n// this._propBindings = newBindings;\n// return !bindingsAreEqual;\n// }\n// render() {\n// return React.createElement(Comp, this.props);\n// }\n// };\n// };\n// }","// taken from fbjs:\n// https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js\n// Licence (MIT) https://github.com/facebook/fbjs/blob/master/packages/fbjs/LICENSE\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule shallowEqual\n * @typechecks\n * @flow\n */\n\n/*eslint-disable no-self-compare */\n\n'use strict';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nexport function is(x: any, y: any): boolean {\n // SameValue algorithm\n if (x === y) { // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Added the nonzero y check to make Flow happy, but it is redundant\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nexport function shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null ||\n typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (\n !hasOwnProperty.call(objB, keysA[i]) ||\n !is(objA[keysA[i]], objB[keysA[i]])\n ) {\n return false;\n }\n }\n\n return true;\n}","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport {Disposable, Router, EspDecoratorUtil, utils, DisposableBase} from 'esp-js';\nimport {createViewForModel } from './viewBindingDecorator';\nimport {GetEspReactRenderModelConsts, GetEspReactRenderModelMetadata} from './getEspReactRenderModel';\n\nexport type PublishEvent = (eventType: string, event: any) => void;\n\nexport type CreatePublishEventProps<TPublishEventProps> = (publishEvent: PublishEvent) => TPublishEventProps;\n\nexport type MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps = {}> = (model: TModel, publishEventProps: TPublishEventProps) => TModelMappedToProps;\n\nexport type ViewComponentTypes = React.FunctionComponent | React.ClassType<any, any, any> | React.ComponentClass;\n\nexport interface ConnectableComponentProps<TModel ={}, TPublishEventProps = {}, TModelMappedToProps = {}> {\n modelId?: string;\n viewContext?: string;\n view?: ViewComponentTypes;\n /**\n * Provides a means to create a serious of 'publish event' callbacks which will be passed as props to the child view.\n */\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>;\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>;\n [key: string]: any; // ...rest props, including the result of mapPublish and mapPublish if 'connect' was used\n}\n\nexport interface ConnectableComponentChildProps<TModel> {\n modelId: string;\n model: TModel;\n router: Router;\n [key: string]: any; // ...rest props, including the result of mapPublish and mapPublish if 'connect' was used\n}\n\nexport interface State {\n model?: any;\n currentModelId?: string;\n publishProps?: any;\n publishEvent?: PublishModelEventDelegate;\n}\n\ninterface ConnectableComponentContext {\n router: Router;\n modelId: string;\n}\n\nexport type PublishModelEventDelegate = (eventType: string, event: any) => void;\n\nexport const PublishModelEventContext = React.createContext<PublishModelEventDelegate>(null);\n\nexport const HooksPublishModelEventProvider = PublishModelEventContext.Provider;\n\nexport class ConnectableComponent<TModel, TPublishEventProps = {}, TModelMappedToProps = {}> extends React.Component<ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, State> {\n private _isMounted = false;\n private _observationSubscription: Disposable;\n context: ConnectableComponentContext;\n\n static contextTypes = {\n router: PropTypes.instanceOf(Router).isRequired,\n modelId: PropTypes.string\n };\n\n constructor(props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, context: ConnectableComponentContext) {\n super(props, context);\n this.state = {model: null, currentModelId: null};\n }\n\n componentWillReceiveProps(nextProps: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, nextContext: ConnectableComponentContext) {\n const modelId = nextProps.modelId || nextContext.modelId;\n const oldModelId = this._getModelId();\n\n if (modelId === oldModelId) {\n return;\n }\n \n if(nextProps.modelId === oldModelId) {\n return;\n }\n\n this._tryObserveModel(modelId);\n }\n\n componentDidMount() {\n this._isMounted = true;\n this._tryObserveModel(this._getModelId());\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n this._tryDisposeModelSubscription();\n }\n\n private _getModelId(): string {\n // props override context\n return this.props.modelId || this.context.modelId;\n }\n\n private _tryObserveModel(modelId: string): void {\n this._tryDisposeModelSubscription();\n\n if (!modelId) {\n return;\n }\n\n let stateChanged = modelId !== this.state.currentModelId;\n\n let publishEvent = this.state.publishEvent;\n if (stateChanged) {\n publishEvent = this._publishEvent(this.context.router, modelId);\n }\n\n let publishProps = this.state.publishProps;\n // We only map the publish props once, as for well behaving components these callbacks should never change\n if (stateChanged && this.props.createPublishEventProps) {\n publishProps = this.props.createPublishEventProps(publishEvent);\n }\n\n if (stateChanged) {\n this.setState({\n currentModelId: modelId,\n publishEvent,\n publishProps\n });\n this._observationSubscription = this.context.router\n .getModelObservable(modelId)\n .subscribe(model => {\n if (this._isMounted) {\n this.setState({model});\n }\n });\n }\n }\n\n private _tryDisposeModelSubscription() {\n if(this._observationSubscription) {\n this._observationSubscription.dispose();\n this._observationSubscription = new DisposableBase();\n this.setState({model: null, currentModelId: null, publishProps: null, publishEvent: null});\n }\n }\n\n private _publishEvent = (router: Router, modelId: string) => (eventType: string, event: any) => router.publishEvent(modelId, eventType, event);\n\n public render() {\n if(this.state.model == null) {\n return null;\n }\n let childProps = this._getChildProps();\n let view = createViewForModel(this.state.model, childProps, this.props.viewContext, this.props.view);\n return (<HooksPublishModelEventProvider value={this.state.publishEvent}>{view}</HooksPublishModelEventProvider>);\n }\n\n private _getChildProps(): ConnectableComponentChildProps<TModel> {\n // consume what this component owns, and let the rest end up in `...rest`\n const {children, createPublishEventProps, modelId, mapModelToProps, view, viewContext, ...rest} = this.props;\n const model = this._getRenderModel(this.state.model);\n let childProps = {\n modelId,\n router: this.context.router,\n ...rest,\n ...this.state.publishProps,\n model\n };\n if (this.props.mapModelToProps) {\n childProps = {\n ...childProps,\n ...(this.props.mapModelToProps(model, this.state.publishProps) as any)\n };\n }\n return childProps;\n }\n\n /**\n * Sees if there is a special selector function which can be invoked to return a render model rather than the top level model model itself\n */\n private _getRenderModel(model: any): TModel {\n // does the given model have a decorated function we can invoke to get a different model to render?\n if (EspDecoratorUtil.hasMetadata(model)) {\n let metadata: GetEspReactRenderModelMetadata = EspDecoratorUtil.getCustomData(model, GetEspReactRenderModelConsts.CustomDataKey);\n if (metadata) {\n return model[metadata.functionName]();\n }\n }\n // else see if there is a function with name GetEspReactRenderModelConsts.HandlerFunctionName we can invoke to get a different model to render?\n let renderModelGetter = model[GetEspReactRenderModelConsts.HandlerFunctionName];\n if (renderModelGetter && utils.isFunction(renderModelGetter)) {\n return renderModelGetter.call(model);\n }\n // else just return the default model\n return model;\n }\n}\n\n// Lifting 'ConnectableView' into it's own type so it can be exported, else tsc doesn't correctly generated declaration files\nexport type ConnectableView = React.ComponentClass | React.SFC;\n\nexport const connect = function<TModel, TPublishEventProps, TModelMappedToProps = {}>(\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>,\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>\n): (view: ConnectableView) => (props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) => JSX.Element {\n return function(view: ConnectableView) {\n return function(props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) {\n const {modelId, viewContext, ...rest} = props;\n return <ConnectableComponent\n modelId={modelId}\n view={view}\n viewContext={viewContext}\n createPublishEventProps={createPublishEventProps}\n mapModelToProps={mapModelToProps}\n {...rest}\n />;\n };\n };\n};"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///esp-js-react/webpack/universalModuleDefinition","webpack:///esp-js-react/webpack/bootstrap","webpack:///esp-js-react/src/viewBindingDecorator.ts","webpack:///esp-js-react/external \"react\"","webpack:///esp-js-react/external \"esp-js\"","webpack:///esp-js-react/external \"prop-types\"","webpack:///esp-js-react/src/getEspReactRenderModel.ts","webpack:///esp-js-react/src/index.ts","webpack:///esp-js-react/src/polimer/polimerExtentsions.ts","webpack:///esp-js-react/external \"esp-js-polimer\"","webpack:///esp-js-react/src/routerProvider.tsx","webpack:///esp-js-react/src/smartComponent.tsx","webpack:///esp-js-react/src/viewBinder.tsx","webpack:///esp-js-react/src/shouldUpdateMixin.ts","webpack:///esp-js-react/src/shallowEqual.ts","webpack:///esp-js-react/src/connectableComponent.tsx"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__7__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","DEFAULT_VIEW_KEY","model","props","displayContext","view","finalView","constructorFunction","constructor","_viewMetadata","viewMetadata","hasRegisteredViewContext","viewRegistrations","Error","modelId","React","createElement","Guard","isDefined","isString","target","ViewMetadata","getMetadata","ViewMetadataRegistration","_viewRegistrations","_view","_displayContext","GetEspReactRenderModelConsts","CustomDataKey","HandlerFunctionName","descriptor","EspDecoratorUtil","getOrCreateMetaData","addCustomData","functionName","RouterProvider","HooksRouterProvider","RouterContext","SmartComponent","ViewBinder","viewBinding","shouldUpdateMixin","createViewForModel","ConnectableComponent","connect","PublishModelEventContext","PolimerModelBuilder","withViewBindings","viewMappings","_viewMappings","registerWithRouter","keys","forEach","createContext","Provider","Component","router","children","childContextTypes","PropTypes","instanceOf","Router","isRequired","_currentObservingModelId","_observationSubscription","nextProps","_tryObserveModel","_tryDisposeObservationSubscription","context","getModelObservable","map","modelSelector","subscribe","setState","dispose","state","_getChildProps","viewContext","other","newProps","assign","contextTypes","esp","itemsThatEffectUpdateSelector","Constructor","nextState","newBindings","bindingsAreEqual","shallowEqual","_propBindings","is","x","y","objA","objB","keysA","keysB","length","HooksPublishModelEventProvider","super","_isMounted","_publishEvent","eventType","event","publishEvent","currentModelId","nextContext","oldModelId","_getModelId","_tryDisposeModelSubscription","stateChanged","publishProps","createPublishEventProps","DisposableBase","childProps","mapModelToProps","rest","_getRenderModel","hasMetadata","metadata","getCustomData","renderModelGetter","utils","isFunction","string"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,cAAeA,QAAQ,mBACpE,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,QAAS,SAAU,aAAc,kBAAmBJ,GAClC,iBAAZC,QACdA,QAAQ,gBAAkBD,EAAQG,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,cAAeA,QAAQ,mBAEtGJ,EAAK,gBAAkBC,EAAQD,EAAY,MAAGA,EAAK,UAAWA,EAAK,cAAeA,EAAK,mBARzF,CASmB,oBAATO,KAAuBA,KAAOC,MAAM,SAASC,EAAgCC,EAAgCC,EAAgCC,GACvJ,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUb,QAGnC,IAAIC,EAASU,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHf,QAAS,IAUV,OANAgB,EAAQH,GAAUI,KAAKhB,EAAOD,QAASC,EAAQA,EAAOD,QAASY,GAG/DX,EAAOc,GAAI,EAGJd,EAAOD,QA0Df,OArDAY,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASpB,EAASqB,EAAMC,GAC3CV,EAAoBW,EAAEvB,EAASqB,IA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D,QAAS6C,EAAUiE,QAyId,EAAAhF,QAAU,SACnBuE,EACAH,GAEA,OAAO,SAAS3G,GACZ,OAAO,SAASF,GACZ,MAAM,QAACW,EAAO,YAAE+D,GAAwB1E,EAARiH,EAAI,EAAIjH,EAAlC,2BACN,OAAO,gBAACwC,EAAoB,eACxB7B,QAASA,EACTT,KAAMA,EACNwE,YAAaA,EACbmC,wBAAyBA,EACzBG,gBAAiBA,GACbC","file":"esp-react.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"esp-js\"), require(\"prop-types\"), require(\"esp-js-polimer\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"esp-js\", \"prop-types\", \"esp-js-polimer\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"esp-js-react\"] = factory(require(\"react\"), require(\"esp-js\"), require(\"prop-types\"), require(\"esp-js-polimer\"));\n\telse\n\t\troot[\"esp-js-react\"] = factory(root[\"react\"], root[\"esp-js\"], root[\"prop-types\"], root[\"esp-js-polimer\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__7__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport {Guard} from 'esp-js';\nimport {ViewComponentTypes} from './connectableComponent';\n\nexport const DEFAULT_VIEW_KEY = 'default-view-key';\n\nfunction getMetadata(target) {\n if (!target._viewMetadata) {\n target._viewMetadata = new ViewMetadata();\n }\n return target._viewMetadata;\n}\n\n/**\n * Tries to get a view for the given model.\n *\n * It does this using the following order:\n * 1) If a @viewBinding decorator was used and a display context was given, try get a view for that\n * 2) Else if a view was explicitly provided use that\n * 3) Else if a @viewBinding decorator was used and there is a view associated with the default display context, use that view\n * @param model\n * @param props\n * @param displayContext\n * @param view\n */\nexport function createViewForModel(model: any, props, displayContext: string, view: ViewComponentTypes) {\n let finalView: ViewComponentTypes = view; // default to that passed in, if any.\n\n // displayContext = displayContext || DEFAULT_VIEW_KEY;\n // the view decorator isn't on the instance, it's on the constructor function that created that instance\n if (model) {\n let constructorFunction = model.constructor;\n if (constructorFunction._viewMetadata) {\n let viewMetadata = constructorFunction._viewMetadata;\n if (displayContext && viewMetadata.hasRegisteredViewContext(displayContext)) {\n let viewMetadataRegistration = viewMetadata.viewRegistrations[displayContext];\n // we've found a view for the display context, use that\n finalView = viewMetadataRegistration.view;\n }\n\n // if we've not found a view yet, and one wasn't provided, is there a default one?\n if (!finalView && viewMetadata.hasRegisteredViewContext(DEFAULT_VIEW_KEY)) {\n let viewMetadataRegistration = viewMetadata.viewRegistrations[DEFAULT_VIEW_KEY];\n finalView = viewMetadataRegistration.view;\n }\n }\n }\n if (!finalView) {\n throw new Error(`No suitable view found for model id '${model.modelId}' using context '${displayContext}'`);\n }\n return React.createElement(finalView, props);\n}\n\n/**\n * An ES7 style decorator that associates a model with a view\n * @param view the react component that will be used to display this model\n * @param displayContext an optional context allowing for different views to display the same model\n * @returns {Function}\n */\nexport function viewBinding(view: any, displayContext: string = DEFAULT_VIEW_KEY) {\n Guard.isDefined(view, 'view must be defined');\n Guard.isString(displayContext, 'displayContext must be a string');\n return function (target) {\n let viewMetadata = getMetadata(target);\n if (viewMetadata.hasRegisteredViewContext(displayContext)) {\n throw new Error(`Context ${displayContext} already registered for view`);\n }\n viewMetadata.viewRegistrations[displayContext] = new ViewMetadataRegistration(view, displayContext);\n };\n}\n\nexport class ViewMetadata {\n private _viewRegistrations = {};\n\n get viewRegistrations() {\n return this._viewRegistrations;\n }\n\n hasRegisteredViewContext(displayContext) {\n return typeof this._viewRegistrations[displayContext] !== 'undefined';\n }\n}\n\nexport class ViewMetadataRegistration {\n\n constructor(private _view, private _displayContext) {\n }\n\n get view() {\n return this._view;\n }\n\n get displayContext() {\n return this._displayContext;\n }\n}","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","import {EspMetadata, EspDecoratorUtil} from 'esp-js';\n\nexport interface GetEspReactRenderModelMetadata {\n functionName: string;\n}\n\nexport namespace GetEspReactRenderModelConsts {\n export const CustomDataKey = 'GetEspReactRenderModelCustomDataKey';\n /**\n * If there is no @getEspReactRenderModel decorator and a function by this name exists on a model, then it will be invoked to identify the sub model which will replaced the `model` prop passed to the child view of a ConnectableComponent\n */\n export const HandlerFunctionName = 'getEspReactRenderModel';\n}\n\n/**\n * A decorator which can be used to identify the render model which will replaced the `model` prop passed to the child view of a ConnectableComponent\n */\nexport function getEspReactRenderModel() {\n return function (target, name, descriptor) {\n let metadata: EspMetadata = EspDecoratorUtil.getOrCreateMetaData(target.constructor);\n metadata.addCustomData(\n GetEspReactRenderModelConsts.CustomDataKey,\n <GetEspReactRenderModelMetadata>{ functionName: name }\n );\n return descriptor;\n };\n}","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n//\n\n// import for side effects\nimport './polimer/polimerExtentsions';\n\nexport {RouterProvider, HooksRouterProvider, RouterContext} from './routerProvider';\nexport {SmartComponent} from './smartComponent';\nexport {ViewBinder} from './viewBinder';\nexport {viewBinding, DEFAULT_VIEW_KEY} from './viewBindingDecorator';\nexport * from './getEspReactRenderModel';\nexport {shouldUpdateMixin} from './shouldUpdateMixin';\nexport {createViewForModel} from './viewBindingDecorator';\nexport {\n ConnectableComponent,\n connect,\n ConnectableComponentProps,\n MapModelToProps,\n CreatePublishEventProps,\n ConnectableView,\n ConnectableComponentChildProps,\n PublishModelEventDelegate,\n PublishModelEventContext\n} from './connectableComponent';\n","import {PolimerModelBuilder, PolimerModel} from 'esp-js-polimer';\nimport {DEFAULT_VIEW_KEY, viewBinding} from '../viewBindingDecorator';\n\ndeclare module 'esp-js-polimer/.dist/typings/modelBuilder' {\n export interface PolimerModelBuilder<TModel> {\n withViewBindings?(view: any, displayContext?: string): PolimerModelBuilder<TModel>;\n }\n}\n\ninterface ViewMappings {\n [displayContext: string]: any;\n}\n\nPolimerModelBuilder.prototype.withViewBindings = function (view: any, displayContext: string = DEFAULT_VIEW_KEY): PolimerModelBuilder<any> {\n let builder = this;\n // store some metadata on the builder which we'll use later to tack onto the model\n let viewMappings: ViewMappings = builder._viewMappings || { };\n viewMappings[displayContext] = view;\n builder._viewMappings = viewMappings;\n return this;\n};\n\n// we need to replace the registerWithRouter in order to dynamically add the\n// @viewBinding decorator to it\nlet registerWithRouter = PolimerModelBuilder.prototype.registerWithRouter;\nPolimerModelBuilder.prototype.registerWithRouter = function (): PolimerModel<any> {\n let builder = this;\n let model = registerWithRouter.call(builder);\n let viewMappings: ViewMappings = builder._viewMappings;\n if (viewMappings) {\n Object.keys(viewMappings).forEach(displayContext => {\n viewBinding(viewMappings[displayContext], displayContext)(model.constructor);\n });\n }\n return model;\n};\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Router } from 'esp-js';\n\nexport interface RouterProviderProps {\n router: Router;\n}\n\nexport const RouterContext = React.createContext<Router>(null);\n\nexport const HooksRouterProvider = RouterContext.Provider;\n\nexport class RouterProvider extends React.Component<RouterProviderProps, any> {\n static childContextTypes = {\n router: PropTypes.instanceOf(Router).isRequired\n };\n getChildContext() {\n return {\n router: this.props.router\n };\n }\n render() {\n return (<HooksRouterProvider value={this.props.router}>{this.props.children}</HooksRouterProvider>);\n }\n}","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { createViewForModel } from './viewBindingDecorator';\nimport { Router } from 'esp-js';\n\nexport interface SmartComponentProps {\n modelId: string;\n view?: any;\n viewContext?: string;\n modelSelector?: (model: any) => any;\n [key: string]: any; // other props which will be passed through to the SmartComponent's view\n}\n\nexport interface SmartComponentState {\n model: any;\n}\n\nexport class SmartComponent extends React.Component<SmartComponentProps, SmartComponentState> {\n private _currentObservingModelId = false;\n private _observationSubscription = null;\n\n static contextTypes = {\n router: PropTypes.instanceOf(Router).isRequired\n };\n\n componentWillReceiveProps(nextProps: SmartComponentProps) {\n this._tryObserveModel(nextProps.modelId);\n }\n componentWillMount() {\n this._tryObserveModel(this.props.modelId);\n }\n componentWillUnmount() {\n this._tryDisposeObservationSubscription();\n }\n _tryObserveModel(modelId) {\n if(!modelId) {\n this._tryDisposeObservationSubscription();\n this.setState({model: null});\n } else if (modelId !== this._currentObservingModelId) {\n this._tryDisposeObservationSubscription();\n this._currentObservingModelId = modelId;\n this._observationSubscription = this.context.router\n .getModelObservable(modelId)\n .map(model => {\n return this.props.modelSelector\n ? this.props.modelSelector(model)\n : model;\n })\n .subscribe(model => {\n this.setState({model: model});\n });\n }\n }\n _tryDisposeObservationSubscription() {\n this._currentObservingModelId = null;\n if(this._observationSubscription) {\n this._observationSubscription.dispose();\n }\n }\n render() {\n if(this.state.model) {\n return createViewForModel(this.state.model, this._getChildProps(), this.props.viewContext, this.props.view);\n }\n return null; // this (in react 15) will render a 'comment node' rather than any actual html\n }\n _getChildProps() {\n // 'consume' the props we own, pass the rest down\n let {modelId, viewContext, view, modelSelector, ...other} = this.props;\n let newProps = {\n model: this.state.model,\n router: this.context.router\n };\n return Object.assign({}, newProps, other);\n }\n} ","// notice_start\n/*\n * Copyright 2015 Dev Shop Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as esp from 'esp-js';\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { createViewForModel } from './viewBindingDecorator';\n\nexport interface ViewBinderProps {\n model: any;\n viewContext: string;\n}\n\nexport class ViewBinder extends React.Component<ViewBinderProps> {\n\n static contextTypes = {\n router: PropTypes.instanceOf(esp.Router).isRequired\n };\n\n render() {\n if(this.props.model) {\n let {model, viewContext, ...other} = this.props;\n let newProps = Object.assign({}, { model: this.props.model, router:this.context.router }, other);\n return createViewForModel(\n this.props.model,\n newProps,\n this.props.viewContext,\n null\n );\n }\n return null;\n }\n}","// notice_start\n/*\n * Copyright 2018 Keith Woods\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// notice_end\n\nimport * as React from 'react';\nimport {shallowEqual} from './shallowEqual';\n\n// WORKS (compiles at least):\n//\n// export function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n// return function <T extends {new(...args:any[]):{}}>(constructor:T) {\n// return class extends constructor {\n// _propBindings : {};\n// shouldComponentUpdate(nextProps, nextState) {\n// let newBindings = itemsThatEffectUpdateSelector(nextProps);\n// let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n// this._propBindings = newBindings;\n// return !bindingsAreEqual;\n// }\n// render() {\n// return React.createElement(<any>constructor, (<any>this).props);\n// }\n// };\n// };\n// }\n\nexport function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n return function <TConstructor extends { new(...args: any[]): {} }>(Constructor: TConstructor) {\n return class extends Constructor {\n _propBindings: {};\n shouldComponentUpdate(nextProps, nextState) {\n let newBindings = itemsThatEffectUpdateSelector(nextProps);\n let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n this._propBindings = newBindings;\n return !bindingsAreEqual;\n }\n render() {\n return React.createElement(<any>Constructor, (<any>this).props);\n }\n };\n };\n}\n\n// export function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {\n// return function(Comp: React.ComponentClass<TProps, TState>) {\n// return class extends React.Component<TProps, TState> {\n// _propBindings : {};\n// shouldComponentUpdate(nextProps, nextState) {\n// let newBindings = itemsThatEffectUpdateSelector(nextProps);\n// let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);\n// this._propBindings = newBindings;\n// return !bindingsAreEqual;\n// }\n// render() {\n// return React.createElement(Comp, this.props);\n// }\n// };\n// };\n// }","// taken from fbjs:\n// https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js\n// Licence (MIT) https://github.com/facebook/fbjs/blob/master/packages/fbjs/LICENSE\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule shallowEqual\n * @typechecks\n * @flow\n */\n\n/*eslint-disable no-self-compare */\n\n'use strict';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nexport function is(x: any, y: any): boolean {\n // SameValue algorithm\n if (x === y) { // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Added the nonzero y check to make Flow happy, but it is redundant\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nexport function shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null ||\n typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (\n !hasOwnProperty.call(objB, keysA[i]) ||\n !is(objA[keysA[i]], objB[keysA[i]])\n ) {\n return false;\n }\n }\n\n return true;\n}","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport {Disposable, Router, EspDecoratorUtil, utils, DisposableBase} from 'esp-js';\nimport {createViewForModel } from './viewBindingDecorator';\nimport {GetEspReactRenderModelConsts, GetEspReactRenderModelMetadata} from './getEspReactRenderModel';\n\nexport type PublishEvent = (eventType: string, event: any) => void;\n\nexport type CreatePublishEventProps<TPublishEventProps> = (publishEvent: PublishEvent) => TPublishEventProps;\n\nexport type MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps = {}> = (model: TModel, publishEventProps: TPublishEventProps) => TModelMappedToProps;\n\nexport type ViewComponentTypes = React.FunctionComponent | React.ClassType<any, any, any> | React.ComponentClass;\n\nexport interface ConnectableComponentProps<TModel ={}, TPublishEventProps = {}, TModelMappedToProps = {}> {\n modelId?: string;\n viewContext?: string;\n view?: ViewComponentTypes;\n /**\n * Provides a means to create a serious of 'publish event' callbacks which will be passed as props to the child view.\n */\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>;\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>;\n [key: string]: any; // ...rest props, including the result of mapPublish and mapPublish if 'connect' was used\n}\n\nexport interface ConnectableComponentChildProps<TModel> {\n modelId: string;\n model: TModel;\n router: Router;\n [key: string]: any; // ...rest props, including the result of mapPublish and mapPublish if 'connect' was used\n}\n\nexport interface State {\n model?: any;\n currentModelId?: string;\n publishProps?: any;\n publishEvent?: PublishModelEventDelegate;\n}\n\ninterface ConnectableComponentContext {\n router: Router;\n modelId: string;\n}\n\nexport type PublishModelEventDelegate = (eventType: string, event: any) => void;\n\nexport const PublishModelEventContext = React.createContext<PublishModelEventDelegate>(null);\n\nexport const HooksPublishModelEventProvider = PublishModelEventContext.Provider;\n\nexport class ConnectableComponent<TModel, TPublishEventProps = {}, TModelMappedToProps = {}> extends React.Component<ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, State> {\n private _isMounted = false;\n private _observationSubscription: Disposable;\n context: ConnectableComponentContext;\n\n static contextTypes = {\n router: PropTypes.instanceOf(Router).isRequired,\n modelId: PropTypes.string\n };\n\n constructor(props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, context: ConnectableComponentContext) {\n super(props, context);\n this.state = {model: null, currentModelId: null};\n }\n\n componentWillReceiveProps(nextProps: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, nextContext: ConnectableComponentContext) {\n const modelId = nextProps.modelId || nextContext.modelId;\n const oldModelId = this._getModelId();\n\n if (modelId === oldModelId) {\n return;\n }\n \n if(nextProps.modelId === oldModelId) {\n return;\n }\n\n this._tryObserveModel(modelId);\n }\n\n componentDidMount() {\n this._isMounted = true;\n this._tryObserveModel(this._getModelId());\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n this._tryDisposeModelSubscription();\n }\n\n private _getModelId(): string {\n // props override context\n return this.props.modelId || this.context.modelId;\n }\n\n private _tryObserveModel(modelId: string): void {\n this._tryDisposeModelSubscription();\n\n if (!modelId) {\n return;\n }\n\n let stateChanged = modelId !== this.state.currentModelId;\n\n let publishEvent = this.state.publishEvent;\n if (stateChanged) {\n publishEvent = this._publishEvent(this.context.router, modelId);\n }\n\n let publishProps = this.state.publishProps;\n // We only map the publish props once, as for well behaving components these callbacks should never change\n if (stateChanged && this.props.createPublishEventProps) {\n publishProps = this.props.createPublishEventProps(publishEvent);\n }\n\n if (stateChanged) {\n this.setState({\n currentModelId: modelId,\n publishEvent,\n publishProps\n });\n this._observationSubscription = this.context.router\n .getModelObservable(modelId)\n .subscribe(model => {\n if (this._isMounted) {\n this.setState({model});\n }\n });\n }\n }\n\n private _tryDisposeModelSubscription() {\n if(this._observationSubscription) {\n this._observationSubscription.dispose();\n this._observationSubscription = new DisposableBase();\n this.setState({model: null, currentModelId: null, publishProps: null, publishEvent: null});\n }\n }\n\n private _publishEvent = (router: Router, modelId: string) => (eventType: string, event: any) => router.publishEvent(modelId, eventType, event);\n\n public render() {\n if(this.state.model == null) {\n return null;\n }\n let childProps = this._getChildProps();\n let view = createViewForModel(this.state.model, childProps, this.props.viewContext, this.props.view);\n return (<HooksPublishModelEventProvider value={this.state.publishEvent}>{view}</HooksPublishModelEventProvider>);\n }\n\n private _getChildProps(): ConnectableComponentChildProps<TModel> {\n // consume what this component owns, and let the rest end up in `...rest`\n const {children, createPublishEventProps, modelId, mapModelToProps, view, viewContext, ...rest} = this.props;\n const model = this._getRenderModel(this.state.model);\n let childProps = {\n modelId,\n router: this.context.router,\n ...rest,\n ...this.state.publishProps,\n model\n };\n if (this.props.mapModelToProps) {\n childProps = {\n ...childProps,\n ...(this.props.mapModelToProps(model, this.state.publishProps) as any)\n };\n }\n return childProps;\n }\n\n /**\n * Sees if there is a special selector function which can be invoked to return a render model rather than the top level model model itself\n */\n private _getRenderModel(model: any): TModel {\n // does the given model have a decorated function we can invoke to get a different model to render?\n if (EspDecoratorUtil.hasMetadata(model)) {\n let metadata: GetEspReactRenderModelMetadata = EspDecoratorUtil.getCustomData(model, GetEspReactRenderModelConsts.CustomDataKey);\n if (metadata) {\n return model[metadata.functionName]();\n }\n }\n // else see if there is a function with name GetEspReactRenderModelConsts.HandlerFunctionName we can invoke to get a different model to render?\n let renderModelGetter = model[GetEspReactRenderModelConsts.HandlerFunctionName];\n if (renderModelGetter && utils.isFunction(renderModelGetter)) {\n return renderModelGetter.call(model);\n }\n // else just return the default model\n return model;\n }\n}\n\n// Lifting 'ConnectableView' into it's own type so it can be exported, else tsc doesn't correctly generated declaration files\nexport type ConnectableView = React.ComponentClass | React.SFC;\n\nexport const connect = function<TModel, TPublishEventProps, TModelMappedToProps = {}>(\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>,\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>\n): (view: ConnectableView) => (props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) => JSX.Element {\n return function(view: ConnectableView) {\n return function(props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) {\n const {modelId, viewContext, ...rest} = props;\n return <ConnectableComponent\n modelId={modelId}\n view={view}\n viewContext={viewContext}\n createPublishEventProps={createPublishEventProps}\n mapModelToProps={mapModelToProps}\n {...rest}\n />;\n };\n };\n};"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esp-js-react",
3
- "version": "5.1.2",
3
+ "version": "6.0.0-next.0",
4
4
  "description": "Evented State Processor (ESP) React Components",
5
5
  "keywords": [
6
6
  "esp",
@@ -24,14 +24,14 @@
24
24
  "dev": "nps dev"
25
25
  },
26
26
  "dependencies": {
27
- "esp-js": "^5.1.2",
28
- "esp-js-polimer": "^5.1.2",
27
+ "esp-js": "^6.0.0-next.0",
28
+ "esp-js-polimer": "^6.0.0-next.0",
29
29
  "prop-types": "^15.7.2",
30
30
  "react": "16.13.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "jest": "26.0.1",
34
- "typescript": "3.9.5",
34
+ "typescript": "4.5.4",
35
35
  "webpack": "4.43.0",
36
36
  "webpack-cli": "^3.3.0",
37
37
  "webpack-dev-server": "3.11.0"
@@ -42,5 +42,5 @@
42
42
  "prop-types": "^15.7.2",
43
43
  "react": "16.8.6"
44
44
  },
45
- "gitHead": "72a27ff10354982c676c87e7faf9e5601951256b"
45
+ "gitHead": "5e62763688d4fa14c6bb859bd56e695d6a4f1747"
46
46
  }