esp-js-react 6.5.1 → 7.0.1-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.
@@ -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;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AAI,cAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;YAC1D,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAK,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;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
+ {"version":3,"file":"esp-react.js","mappings":"AAAA;AACA;AACA;AACA;AAC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,QAAQ,CAAC,cAAc,EAAE,iCAAiC,CAAC,CAAC;IAClE,OAAO,UAAU,MAAM;QACnB,IAAI,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,YAAY,CAAC,wBAAwB,CAAC,cAAc,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,KAAK,CAAC,WAAW,cAAc,8BAA8B,CAAC,CAAC;QAC7E,CAAC;QACD,YAAY,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,IAAI,wBAAwB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACxG,CAAC,CAAC;AACN,CAAC;AAED,MAAa,YAAY;IAAzB;QACY,uBAAkB,GAAG,EAAE,CAAC;IASpC,CAAC;IAPG,IAAI,iBAAiB;QACjB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,wBAAwB,CAAC,cAAc;QACnC,OAAO,OAAO,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,KAAK,WAAW,CAAC;IAC1E,CAAC;CACJ;AAVD,oCAUC;AAED,MAAa,wBAAwB;IAEjC,YAAoB,KAAK,EAAU,eAAe;QAA9B,UAAK,GAAL,KAAK;QAAU,oBAAe,GAAf,eAAe;IAClD,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;CACJ;AAZD,4DAYC;;;;;;;;ACjHD;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://esp-js-react/webpack/universalModuleDefinition","webpack://esp-js-react/./src/connectableComponent.tsx","webpack://esp-js-react/./src/espModelContext.tsx","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/./src/routerProvider.tsx","webpack://esp-js-react/./src/shallowEqual.ts","webpack://esp-js-react/./src/shouldUpdateMixin.ts","webpack://esp-js-react/./src/smartComponent.tsx","webpack://esp-js-react/./src/viewBinder.tsx","webpack://esp-js-react/./src/viewBindingDecorator.ts","webpack://esp-js-react/external umd \"esp-js\"","webpack://esp-js-react/external umd \"esp-js-polimer\"","webpack://esp-js-react/external umd \"prop-types\"","webpack://esp-js-react/external umd \"react\"","webpack://esp-js-react/webpack/bootstrap","webpack://esp-js-react/webpack/before-startup","webpack://esp-js-react/webpack/startup","webpack://esp-js-react/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"esp-js\"), require(\"esp-js-polimer\"), require(\"prop-types\"), require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"esp-js\", \"esp-js-polimer\", \"prop-types\", \"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"esp-js-react\"] = factory(require(\"esp-js\"), require(\"esp-js-polimer\"), require(\"prop-types\"), require(\"react\"));\n\telse\n\t\troot[\"esp-js-react\"] = factory(root[\"esp-js\"], root[\"esp-js-polimer\"], root[\"prop-types\"], root[\"react\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__152__, __WEBPACK_EXTERNAL_MODULE__43__, __WEBPACK_EXTERNAL_MODULE__949__, __WEBPACK_EXTERNAL_MODULE__155__) => {\nreturn ","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';\nimport {EspModelContext} from './espModelContext';\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 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\n return (<EspModelContext modelId={this.props.modelId} router={this.context.router} {...childProps}>{view}</EspModelContext>);\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};","import * as React from 'react';\nimport {DefaultModelAddress, ModelAddress, Router} from 'esp-js';\nimport {useContext, useCallback, createContext, PropsWithChildren} from 'react';\nimport {RouterContext} from './routerProvider';\n\nexport type GetModelIdDelegate = () => string;\nexport const GetModelIdContext = createContext<GetModelIdDelegate>(null);\n/**\n * Returns a function which will return the ID of the model currently being rendered.\n */\nexport const useGetModelId = () => useContext(GetModelIdContext);\n\nexport type PublishEventDelegate = (modelIdOrModelAddress: string | ModelAddress, eventType: string, event: any) => void;\nexport const PublishEventContext = createContext<PublishEventDelegate>(null);\n/**\n * Returns a function which can be used to publish an event.\n */\nexport const usePublishEvent = () => useContext(PublishEventContext);\n\nexport type PublishModelEventDelegate = (eventType: string, event: any) => void;\nexport const PublishModelEventContext = createContext<PublishModelEventDelegate>(null);\n/**\n * Returns a function which can be used to publish an event to the current model being rendered.\n *\n * Effectively, this is a version of usePublishEvent() which closes over the current modelId.\n */\nexport const usePublishModelEvent = () => useContext(PublishModelEventContext);\n\nexport type PublishModelEventWithEntityKeyDelegate = (entityKey: string, eventType: string, event: any) => void;\nexport const PublishModelEventWithEntityKeyContext = createContext<PublishModelEventWithEntityKeyDelegate>(null);\n/**\n * Returns a function which can be used to publish an event to the current model being rendered, allows an entityKey to be specified.\n *\n * Effectively, this is a version of usePublishEvent() which closes over the current modelId.\n */\nexport const usePublishModelEventWithEntityKey = () => useContext(PublishModelEventWithEntityKeyContext);\n\nexport interface EspModelContextProps {\n modelId: string;\n router: Router;\n}\n\nexport const EspModelContext = ({modelId, children, router}: PropsWithChildren<EspModelContextProps>) => {\n const getModelId: () => string = useCallback(() => {\n return modelId;\n }, [router, modelId]);\n const publishEvent: PublishEventDelegate = useCallback((modelIdOrModelAddress: string, eventType: string, event: any) => {\n router.publishEvent(modelIdOrModelAddress, eventType, event);\n }, [router]);\n const publishModelEvent: PublishModelEventDelegate = useCallback((eventType: string, event: any) => {\n router.publishEvent(modelId, eventType, event);\n }, [router, modelId]);\n const publishModelEventWithEntityKey: PublishModelEventWithEntityKeyDelegate = useCallback((entityKey: string, eventType: string, event: any) => {\n router.publishEvent(new DefaultModelAddress(modelId, entityKey), eventType, event);\n }, [router, modelId]);\n return (\n <RouterContext.Provider value={router}>\n <GetModelIdContext.Provider value={getModelId}>\n <PublishEventContext.Provider value={publishEvent}>\n <PublishModelEventContext.Provider value={publishModelEvent}>\n <PublishModelEventWithEntityKeyContext.Provider value={publishModelEventWithEntityKey}>\n {children}\n </PublishModelEventWithEntityKeyContext.Provider>\n </PublishModelEventContext.Provider>\n </PublishEventContext.Provider>\n </GetModelIdContext.Provider>\n </RouterContext.Provider>\n );\n};","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, RouterContext, useRouter} 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} from './connectableComponent';\nexport {\n useGetModelId,\n GetModelIdDelegate,\n GetModelIdContext,\n\n PublishEventDelegate,\n PublishEventContext,\n usePublishEvent,\n\n PublishModelEventDelegate,\n PublishModelEventContext,\n usePublishModelEvent,\n\n PublishModelEventWithEntityKeyDelegate,\n PublishModelEventWithEntityKeyContext,\n usePublishModelEventWithEntityKey,\n\n EspModelContext,\n EspModelContextProps\n} from './espModelContext';\n","import {PolimerModelBuilder, PolimerModel} from 'esp-js-polimer';\nimport {DEFAULT_VIEW_KEY, viewBinding} from '../viewBindingDecorator';\n\ndeclare module 'esp-js-polimer/.dist/typings/modelBuilderUpdater' {\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","// 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';\nimport {useContext} from 'react';\n\nexport interface RouterProviderProps {\n router: Router;\n // React 18 Fix:\n // The current codebase is React 16, it will work with React 18, but there were changes to the types in React 18.\n // The `children` prop was removed from some React types that cause the RouterProvider to fail, this fixes that.\n children: any;\n}\n\nexport const RouterContext = React.createContext<Router>(null);\nexport const useRouter = () => useContext(RouterContext);\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 (<RouterContext.Provider value={this.props.router}>{this.props.children}</RouterContext.Provider>);\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}","// 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// }","// 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 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__152__;","module.exports = __WEBPACK_EXTERNAL_MODULE__43__;","module.exports = __WEBPACK_EXTERNAL_MODULE__949__;","module.exports = __WEBPACK_EXTERNAL_MODULE__155__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(872);\n",""],"names":[],"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,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))}}}}])}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("esp-js"),require("esp-js-polimer"),require("prop-types"),require("react")):"function"==typeof define&&define.amd?define(["esp-js","esp-js-polimer","prop-types","react"],t):"object"==typeof exports?exports["esp-js-react"]=t(require("esp-js"),require("esp-js-polimer"),require("prop-types"),require("react")):e["esp-js-react"]=t(e["esp-js"],e["esp-js-polimer"],e["prop-types"],e.react)}(self,((e,t,o,r)=>(()=>{"use strict";var n={397:function(e,t,o){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=void 0;const n=o(155),i=o(949),s=o(152),l=o(213),u=o(102),d=o(680);class a 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(),t=(0,l.createViewForModel)(this.state.model,e,this.props.viewContext,this.props.view);return n.createElement(d.EspModelContext,Object.assign({modelId:this.props.modelId,router:this.context.router},e),t)}_getChildProps(){const e=this.props,{children:t,createPublishEventProps:o,modelId:n,mapModelToProps:i,view:s,viewContext:l}=e,u=r(e,["children","createPublishEventProps","modelId","mapModelToProps","view","viewContext"]),d=this._getRenderModel(this.state.model);let a=Object.assign(Object.assign(Object.assign({modelId:n,router:this.context.router},u),this.state.publishProps),{model:d});return this.props.mapModelToProps&&(a=Object.assign(Object.assign({},a),this.props.mapModelToProps(d,this.state.publishProps))),a}_getRenderModel(e){if(s.EspDecoratorUtil.hasMetadata(e)){let t=s.EspDecoratorUtil.getCustomData(e,u.GetEspReactRenderModelConsts.CustomDataKey);if(t)return e[t.functionName]()}let t=e[u.GetEspReactRenderModelConsts.HandlerFunctionName];return t&&s.utils.isFunction(t)?t.call(e):e}}t.ConnectableComponent=a,a.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:l}=i,u=r(i,["modelId","viewContext"]);return n.createElement(a,Object.assign({modelId:s,view:o,viewContext:l,createPublishEventProps:t,mapModelToProps:e},u))}}}},680:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EspModelContext=t.usePublishModelEventWithEntityKey=t.PublishModelEventWithEntityKeyContext=t.usePublishModelEvent=t.PublishModelEventContext=t.usePublishEvent=t.PublishEventContext=t.useGetModelId=t.GetModelIdContext=void 0;const r=o(155),n=o(152),i=o(155),s=o(182);t.GetModelIdContext=(0,i.createContext)(null);t.useGetModelId=()=>(0,i.useContext)(t.GetModelIdContext),t.PublishEventContext=(0,i.createContext)(null);t.usePublishEvent=()=>(0,i.useContext)(t.PublishEventContext),t.PublishModelEventContext=(0,i.createContext)(null);t.usePublishModelEvent=()=>(0,i.useContext)(t.PublishModelEventContext),t.PublishModelEventWithEntityKeyContext=(0,i.createContext)(null);t.usePublishModelEventWithEntityKey=()=>(0,i.useContext)(t.PublishModelEventWithEntityKeyContext);t.EspModelContext=({modelId:e,children:o,router:l})=>{const u=(0,i.useCallback)((()=>e),[l,e]),d=(0,i.useCallback)(((e,t,o)=>{l.publishEvent(e,t,o)}),[l]),a=(0,i.useCallback)(((t,o)=>{l.publishEvent(e,t,o)}),[l,e]),p=(0,i.useCallback)(((t,o,r)=>{l.publishEvent(new n.DefaultModelAddress(e,t),o,r)}),[l,e]);return r.createElement(s.RouterContext.Provider,{value:l},r.createElement(t.GetModelIdContext.Provider,{value:u},r.createElement(t.PublishEventContext.Provider,{value:d},r.createElement(t.PublishModelEventContext.Provider,{value:a},r.createElement(t.PublishModelEventWithEntityKeyContext.Provider,{value:p},o)))))}},102:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GetEspReactRenderModelConsts=void 0,t.getEspReactRenderModel=function(){return function(e,t,o){return r.EspDecoratorUtil.getOrCreateMetaData(e.constructor).addCustomData(n.CustomDataKey,{functionName:t}),o}};const r=o(152);var n;!function(e){e.CustomDataKey="GetEspReactRenderModelCustomDataKey",e.HandlerFunctionName="getEspReactRenderModel"}(n||(t.GetEspReactRenderModelConsts=n={}))},872:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}: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.EspModelContext=t.usePublishModelEventWithEntityKey=t.PublishModelEventWithEntityKeyContext=t.usePublishModelEvent=t.PublishModelEventContext=t.usePublishEvent=t.PublishEventContext=t.GetModelIdContext=t.useGetModelId=t.connect=t.ConnectableComponent=t.createViewForModel=t.shouldUpdateMixin=t.DEFAULT_VIEW_KEY=t.viewBinding=t.ViewBinder=t.SmartComponent=t.useRouter=t.RouterContext=t.RouterProvider=void 0,o(637);var i=o(182);Object.defineProperty(t,"RouterProvider",{enumerable:!0,get:function(){return i.RouterProvider}}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return i.RouterContext}}),Object.defineProperty(t,"useRouter",{enumerable:!0,get:function(){return i.useRouter}});var s=o(438);Object.defineProperty(t,"SmartComponent",{enumerable:!0,get:function(){return s.SmartComponent}});var l=o(453);Object.defineProperty(t,"ViewBinder",{enumerable:!0,get:function(){return l.ViewBinder}});var u=o(213);Object.defineProperty(t,"viewBinding",{enumerable:!0,get:function(){return u.viewBinding}}),Object.defineProperty(t,"DEFAULT_VIEW_KEY",{enumerable:!0,get:function(){return u.DEFAULT_VIEW_KEY}}),n(o(102),t);var d=o(79);Object.defineProperty(t,"shouldUpdateMixin",{enumerable:!0,get:function(){return d.shouldUpdateMixin}});var a=o(213);Object.defineProperty(t,"createViewForModel",{enumerable:!0,get:function(){return a.createViewForModel}});var p=o(397);Object.defineProperty(t,"ConnectableComponent",{enumerable:!0,get:function(){return p.ConnectableComponent}}),Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return p.connect}});var c=o(680);Object.defineProperty(t,"useGetModelId",{enumerable:!0,get:function(){return c.useGetModelId}}),Object.defineProperty(t,"GetModelIdContext",{enumerable:!0,get:function(){return c.GetModelIdContext}}),Object.defineProperty(t,"PublishEventContext",{enumerable:!0,get:function(){return c.PublishEventContext}}),Object.defineProperty(t,"usePublishEvent",{enumerable:!0,get:function(){return c.usePublishEvent}}),Object.defineProperty(t,"PublishModelEventContext",{enumerable:!0,get:function(){return c.PublishModelEventContext}}),Object.defineProperty(t,"usePublishModelEvent",{enumerable:!0,get:function(){return c.usePublishModelEvent}}),Object.defineProperty(t,"PublishModelEventWithEntityKeyContext",{enumerable:!0,get:function(){return c.PublishModelEventWithEntityKeyContext}}),Object.defineProperty(t,"usePublishModelEventWithEntityKey",{enumerable:!0,get:function(){return c.usePublishModelEventWithEntityKey}}),Object.defineProperty(t,"EspModelContext",{enumerable:!0,get:function(){return c.EspModelContext}})},637:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=o(43),n=o(213);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}},182:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RouterProvider=t.useRouter=t.RouterContext=void 0;const r=o(155),n=o(949),i=o(152),s=o(155);t.RouterContext=r.createContext(null);t.useRouter=()=>(0,s.useContext)(t.RouterContext);class l extends r.Component{getChildContext(){return{router:this.props.router}}render(){return r.createElement(t.RouterContext.Provider,{value:this.props.router},this.props.children)}}t.RouterProvider=l,l.childContextTypes={router:n.instanceOf(i.Router).isRequired}},234:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is=r,t.shallowEqual=function(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let i=0;i<n.length;i++)if(!o.call(t,n[i])||!r(e[n[i]],t[n[i]]))return!1;return!0};const o=Object.prototype.hasOwnProperty;function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}},79:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),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)}}}};const r=o(155),n=o(234)},438:function(e,t,o){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(155),i=o(949),s=o(213),l=o(152);class u 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"]),l={model:this.state.model,router:this.context.router};return Object.assign({},l,s)}}t.SmartComponent=u,u.contextTypes={router:i.instanceOf(l.Router).isRequired}},453:function(e,t,o){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(152),i=o(155),s=o(949),l=o(213);class u 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,l.createViewForModel)(this.props.model,i,this.props.viewContext,null)}return null}}t.ViewBinder=u,u.contextTypes={router:s.instanceOf(n.Router).isRequired}},213:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ViewMetadataRegistration=t.ViewMetadata=t.DEFAULT_VIEW_KEY=void 0,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){e._viewMetadata||(e._viewMetadata=new i);return e._viewMetadata}(t);if(r.hasRegisteredViewContext(o))throw new Error(`Context ${o} already registered for view`);r.viewRegistrations[o]=new s(e,o)}};const r=o(155),n=o(152);t.DEFAULT_VIEW_KEY="default-view-key";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},152:t=>{t.exports=e},43:e=>{e.exports=t},949:e=>{e.exports=o},155:e=>{e.exports=r}},i={};var s=function e(t){var o=i[t];if(void 0!==o)return o.exports;var r=i[t]={exports:{}};return n[t].call(r.exports,r,r.exports,e),r.exports}(872);return s})()));
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,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,IAClCG,OAAOC,eAAezB,EAASqB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAS5B,GACX,oBAAX6B,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAezB,EAAS6B,OAAOC,YAAa,CAAE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AO,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,"file":"esp-react.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,UAAWA,QAAQ,kBAAmBA,QAAQ,cAAeA,QAAQ,UAC7E,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,SAAU,iBAAkB,aAAc,SAAUJ,GAClC,iBAAZC,QACdA,QAAQ,gBAAkBD,EAAQG,QAAQ,UAAWA,QAAQ,kBAAmBA,QAAQ,cAAeA,QAAQ,UAE/GJ,EAAK,gBAAkBC,EAAQD,EAAK,UAAWA,EAAK,kBAAmBA,EAAK,cAAeA,EAAY,MACxG,CATD,CASGO,MAAM,CAACC,EAAkCC,EAAiCC,EAAkCC,I,0eCT/G,eACA,SACA,SACA,SACA,SACA,SA2CA,MAAaC,UAAwFC,EAAMC,UAUvG,WAAAC,CAAYC,EAAmFC,GAC3FC,MAAMF,EAAOC,GAVT,KAAAE,YAAa,EAwFb,KAAAC,cAAgB,CAACC,EAAgBC,IAAoB,CAACC,EAAmBC,IAAeH,EAAOI,aAAaH,EAASC,EAAWC,GA7EpIE,KA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RtD,EAAOsD,cAAgB,IAAIQ,GAE/B,OAAO9D,EAAOsD,aAClB,CAoD2BS,CAAY/D,GAC/B,GAAIuD,EAAaC,yBAAyBzC,GACtC,MAAM,IAAI2C,MAAM,WAAW3C,iCAE/BwC,EAAaE,kBAAkB1C,GAAkB,IAAIiD,EAAyB/G,EAAM8D,EACxF,CACJ,EArEA,eACA,SAGa,EAAAL,iBAAmB,mBAmEhC,MAAaoD,EAAb,cACY,KAAAG,mBAAqB,CAAC,CASlC,CAPI,qBAAIR,GACA,OAAOjI,KAAKyI,kBAChB,CAEA,wBAAAT,CAAyBzC,GACrB,YAA0D,IAA5CvF,KAAKyI,mBAAmBlD,EAC1C,EATJ,iBAYA,MAAaiD,EAET,WAAAnJ,CAAoBqJ,EAAeC,GAAf,KAAAD,MAAAA,EAAe,KAAAC,gBAAAA,CACnC,CAEA,QAAIlH,GACA,OAAOzB,KAAK0I,KAChB,CAEA,kBAAInD,GACA,OAAOvF,KAAK2I,eAChB,EAXJ,4B,UCrGAlK,EAAOD,QAAUM,C,SCAjBL,EAAOD,QAAUO,C,UCAjBN,EAAOD,QAAUQ,C,UCAjBP,EAAOD,QAAUS,C,GCCb2J,EAA2B,CAAC,ECEhC,IAAIC,EDCJ,SAASC,EAAoBC,GAE5B,IAAIC,EAAeJ,EAAyBG,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaxK,QAGrB,IAAIC,EAASmK,EAAyBG,GAAY,CAGjDvK,QAAS,CAAC,GAOX,OAHA0K,EAAoBH,GAAUnG,KAAKnE,EAAOD,QAASC,EAAQA,EAAOD,QAASsK,GAGpErK,EAAOD,OACf,CCnB0BsK,CAAoB,K","sources":["webpack://esp-js-react/webpack/universalModuleDefinition","webpack://esp-js-react/./src/connectableComponent.tsx","webpack://esp-js-react/./src/espModelContext.tsx","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/./src/routerProvider.tsx","webpack://esp-js-react/./src/shallowEqual.ts","webpack://esp-js-react/./src/shouldUpdateMixin.ts","webpack://esp-js-react/./src/smartComponent.tsx","webpack://esp-js-react/./src/viewBinder.tsx","webpack://esp-js-react/./src/viewBindingDecorator.ts","webpack://esp-js-react/external umd \"esp-js\"","webpack://esp-js-react/external umd \"esp-js-polimer\"","webpack://esp-js-react/external umd \"prop-types\"","webpack://esp-js-react/external umd \"react\"","webpack://esp-js-react/webpack/bootstrap","webpack://esp-js-react/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"esp-js\"), require(\"esp-js-polimer\"), require(\"prop-types\"), require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"esp-js\", \"esp-js-polimer\", \"prop-types\", \"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"esp-js-react\"] = factory(require(\"esp-js\"), require(\"esp-js-polimer\"), require(\"prop-types\"), require(\"react\"));\n\telse\n\t\troot[\"esp-js-react\"] = factory(root[\"esp-js\"], root[\"esp-js-polimer\"], root[\"prop-types\"], root[\"react\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__152__, __WEBPACK_EXTERNAL_MODULE__43__, __WEBPACK_EXTERNAL_MODULE__949__, __WEBPACK_EXTERNAL_MODULE__155__) => {\nreturn ","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';\nimport {EspModelContext} from './espModelContext';\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 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\n return (<EspModelContext modelId={this.props.modelId} router={this.context.router} {...childProps}>{view}</EspModelContext>);\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};","import * as React from 'react';\nimport {DefaultModelAddress, ModelAddress, Router} from 'esp-js';\nimport {useContext, useCallback, createContext, PropsWithChildren} from 'react';\nimport {RouterContext} from './routerProvider';\n\nexport type GetModelIdDelegate = () => string;\nexport const GetModelIdContext = createContext<GetModelIdDelegate>(null);\n/**\n * Returns a function which will return the ID of the model currently being rendered.\n */\nexport const useGetModelId = () => useContext(GetModelIdContext);\n\nexport type PublishEventDelegate = (modelIdOrModelAddress: string | ModelAddress, eventType: string, event: any) => void;\nexport const PublishEventContext = createContext<PublishEventDelegate>(null);\n/**\n * Returns a function which can be used to publish an event.\n */\nexport const usePublishEvent = () => useContext(PublishEventContext);\n\nexport type PublishModelEventDelegate = (eventType: string, event: any) => void;\nexport const PublishModelEventContext = createContext<PublishModelEventDelegate>(null);\n/**\n * Returns a function which can be used to publish an event to the current model being rendered.\n *\n * Effectively, this is a version of usePublishEvent() which closes over the current modelId.\n */\nexport const usePublishModelEvent = () => useContext(PublishModelEventContext);\n\nexport type PublishModelEventWithEntityKeyDelegate = (entityKey: string, eventType: string, event: any) => void;\nexport const PublishModelEventWithEntityKeyContext = createContext<PublishModelEventWithEntityKeyDelegate>(null);\n/**\n * Returns a function which can be used to publish an event to the current model being rendered, allows an entityKey to be specified.\n *\n * Effectively, this is a version of usePublishEvent() which closes over the current modelId.\n */\nexport const usePublishModelEventWithEntityKey = () => useContext(PublishModelEventWithEntityKeyContext);\n\nexport interface EspModelContextProps {\n modelId: string;\n router: Router;\n}\n\nexport const EspModelContext = ({modelId, children, router}: PropsWithChildren<EspModelContextProps>) => {\n const getModelId: () => string = useCallback(() => {\n return modelId;\n }, [router, modelId]);\n const publishEvent: PublishEventDelegate = useCallback((modelIdOrModelAddress: string, eventType: string, event: any) => {\n router.publishEvent(modelIdOrModelAddress, eventType, event);\n }, [router]);\n const publishModelEvent: PublishModelEventDelegate = useCallback((eventType: string, event: any) => {\n router.publishEvent(modelId, eventType, event);\n }, [router, modelId]);\n const publishModelEventWithEntityKey: PublishModelEventWithEntityKeyDelegate = useCallback((entityKey: string, eventType: string, event: any) => {\n router.publishEvent(new DefaultModelAddress(modelId, entityKey), eventType, event);\n }, [router, modelId]);\n return (\n <RouterContext.Provider value={router}>\n <GetModelIdContext.Provider value={getModelId}>\n <PublishEventContext.Provider value={publishEvent}>\n <PublishModelEventContext.Provider value={publishModelEvent}>\n <PublishModelEventWithEntityKeyContext.Provider value={publishModelEventWithEntityKey}>\n {children}\n </PublishModelEventWithEntityKeyContext.Provider>\n </PublishModelEventContext.Provider>\n </PublishEventContext.Provider>\n </GetModelIdContext.Provider>\n </RouterContext.Provider>\n );\n};","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, RouterContext, useRouter} 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} from './connectableComponent';\nexport {\n useGetModelId,\n GetModelIdDelegate,\n GetModelIdContext,\n\n PublishEventDelegate,\n PublishEventContext,\n usePublishEvent,\n\n PublishModelEventDelegate,\n PublishModelEventContext,\n usePublishModelEvent,\n\n PublishModelEventWithEntityKeyDelegate,\n PublishModelEventWithEntityKeyContext,\n usePublishModelEventWithEntityKey,\n\n EspModelContext,\n EspModelContextProps\n} from './espModelContext';\n","import {PolimerModelBuilder, PolimerModel} from 'esp-js-polimer';\nimport {DEFAULT_VIEW_KEY, viewBinding} from '../viewBindingDecorator';\n\ndeclare module 'esp-js-polimer/.dist/typings/modelBuilderUpdater' {\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","// 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';\nimport {useContext} from 'react';\n\nexport interface RouterProviderProps {\n router: Router;\n // React 18 Fix:\n // The current codebase is React 16, it will work with React 18, but there were changes to the types in React 18.\n // The `children` prop was removed from some React types that cause the RouterProvider to fail, this fixes that.\n children: any;\n}\n\nexport const RouterContext = React.createContext<Router>(null);\nexport const useRouter = () => useContext(RouterContext);\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 (<RouterContext.Provider value={this.props.router}>{this.props.children}</RouterContext.Provider>);\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}","// 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// }","// 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 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__152__;","module.exports = __WEBPACK_EXTERNAL_MODULE__43__;","module.exports = __WEBPACK_EXTERNAL_MODULE__949__;","module.exports = __WEBPACK_EXTERNAL_MODULE__155__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(872);\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__152__","__WEBPACK_EXTERNAL_MODULE__43__","__WEBPACK_EXTERNAL_MODULE__949__","__WEBPACK_EXTERNAL_MODULE__155__","ConnectableComponent","React","Component","constructor","props","context","super","_isMounted","_publishEvent","router","modelId","eventType","event","publishEvent","this","state","model","currentModelId","componentWillReceiveProps","nextProps","nextContext","oldModelId","_getModelId","_tryObserveModel","componentDidMount","componentWillUnmount","_tryDisposeModelSubscription","stateChanged","publishProps","createPublishEventProps","setState","_observationSubscription","getModelObservable","subscribe","dispose","DisposableBase","render","childProps","_getChildProps","view","createViewForModel","viewContext","EspModelContext","children","mapModelToProps","rest","_getRenderModel","EspDecoratorUtil","hasMetadata","metadata","getCustomData","GetEspReactRenderModelConsts","CustomDataKey","functionName","renderModelGetter","HandlerFunctionName","utils","isFunction","call","contextTypes","PropTypes","instanceOf","Router","isRequired","string","connect","GetModelIdContext","createContext","useGetModelId","useContext","PublishEventContext","usePublishEvent","PublishModelEventContext","usePublishModelEvent","PublishModelEventWithEntityKeyContext","usePublishModelEventWithEntityKey","getModelId","useCallback","modelIdOrModelAddress","publishModelEvent","publishModelEventWithEntityKey","entityKey","DefaultModelAddress","RouterContext","Provider","value","target","name","descriptor","getOrCreateMetaData","addCustomData","RouterProvider","useRouter","SmartComponent","ViewBinder","viewBinding","DEFAULT_VIEW_KEY","shouldUpdateMixin","PolimerModelBuilder","prototype","withViewBindings","displayContext","viewMappings","_viewMappings","registerWithRouter","Object","keys","forEach","getChildContext","childContextTypes","objA","objB","is","keysA","keysB","length","i","hasOwnProperty","x","y","itemsThatEffectUpdateSelector","Constructor","shouldComponentUpdate","nextState","newBindings","bindingsAreEqual","shallowEqual","_propBindings","createElement","_currentObservingModelId","componentWillMount","_tryDisposeObservationSubscription","map","modelSelector","other","newProps","assign","esp","finalView","constructorFunction","_viewMetadata","viewMetadata","hasRegisteredViewContext","viewRegistrations","Error","Guard","isDefined","isString","ViewMetadata","getMetadata","ViewMetadataRegistration","_viewRegistrations","_view","_displayContext","__webpack_module_cache__","__webpack_exports__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
3
  import { Router } from 'esp-js';
4
- export declare type PublishEvent = (eventType: string, event: any) => void;
5
- export declare type CreatePublishEventProps<TPublishEventProps> = (publishEvent: PublishEvent) => TPublishEventProps;
6
- export declare type MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps = {}> = (model: TModel, publishEventProps: TPublishEventProps) => TModelMappedToProps;
7
- export declare type ViewComponentTypes = React.FunctionComponent | React.ClassType<any, any, any> | React.ComponentClass;
4
+ export type PublishEvent = (eventType: string, event: any) => void;
5
+ export type CreatePublishEventProps<TPublishEventProps> = (publishEvent: PublishEvent) => TPublishEventProps;
6
+ export type MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps = {}> = (model: TModel, publishEventProps: TPublishEventProps) => TModelMappedToProps;
7
+ export type ViewComponentTypes = React.FunctionComponent | React.ClassType<any, any, any> | React.ComponentClass;
8
8
  export interface ConnectableComponentProps<TModel = {}, TPublishEventProps = {}, TModelMappedToProps = {}> {
9
9
  modelId?: string;
10
10
  viewContext?: string;
@@ -32,9 +32,7 @@ interface ConnectableComponentContext {
32
32
  router: Router;
33
33
  modelId: string;
34
34
  }
35
- export declare type PublishModelEventDelegate = (eventType: string, event: any) => void;
36
- export declare const PublishModelEventContext: React.Context<PublishModelEventDelegate>;
37
- export declare const HooksPublishModelEventProvider: React.Provider<PublishModelEventDelegate>;
35
+ export type PublishModelEventDelegate = (eventType: string, event: any) => void;
38
36
  export declare class ConnectableComponent<TModel, TPublishEventProps = {}, TModelMappedToProps = {}> extends React.Component<ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>, State> {
39
37
  private _isMounted;
40
38
  private _observationSubscription;
@@ -58,6 +56,6 @@ export declare class ConnectableComponent<TModel, TPublishEventProps = {}, TMode
58
56
  */
59
57
  private _getRenderModel;
60
58
  }
61
- export declare type ConnectableView = React.ComponentClass | React.SFC;
59
+ export type ConnectableView = React.ComponentClass | React.SFC;
62
60
  export declare const connect: <TModel, TPublishEventProps, TModelMappedToProps = {}>(mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>, createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>) => (view: ConnectableView) => (props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) => JSX.Element;
63
61
  export {};