esp-js-react 7.0.2 → 8.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.
- package/.dist/esp-react.js +468 -511
- package/.dist/esp-react.js.map +1 -1
- package/.dist/esp-react.min.js +2 -1
- package/.dist/esp-react.min.js.LICENSE.txt +9 -0
- package/.dist/esp-react.min.js.map +1 -1
- package/.dist/typings/connect.d.ts +12 -0
- package/.dist/typings/connectableComponent.d.ts +20 -46
- package/.dist/typings/{espModelContext.d.ts → espModelContextProvider.d.ts} +8 -9
- package/.dist/typings/espRouterContextProvider.d.ts +47 -0
- package/.dist/typings/index.d.ts +7 -6
- package/.dist/typings/{getEspReactRenderModel.d.ts → polimer/getEspReactRenderModel.d.ts} +7 -0
- package/.dist/typings/useModelSelector.d.ts +27 -0
- package/.dist/typings/viewBinder.d.ts +1 -8
- package/.dist/typings/viewBinderConnectable.d.ts +15 -0
- package/.dist/typings/viewBindingDecorator.d.ts +1 -2
- package/package.json +7 -6
- package/src/connect.tsx +31 -0
- package/src/connectableComponent.tsx +94 -190
- package/src/espModelContextProvider.tsx +95 -0
- package/src/espRouterContextProvider.tsx +88 -0
- package/src/index.ts +40 -18
- package/src/polimer/getEspReactRenderModel.ts +50 -0
- package/src/useModelSelector.ts +159 -0
- package/src/viewBinder.tsx +14 -22
- package/src/viewBinderConnectable.tsx +54 -0
- package/src/viewBindingDecorator.ts +2 -3
- package/tests/connectableComponentLegacyTests.tsx +405 -0
- package/tests/indexTests.ts +0 -12
- package/tests/routerSpy.ts +24 -0
- package/tests/useModelSelectorTests.tsx +361 -0
- package/.dist/typings/routerProvider.d.ts +0 -18
- package/.dist/typings/shallowEqual.d.ts +0 -21
- package/.dist/typings/shouldUpdateMixin.d.ts +0 -10
- package/.dist/typings/smartComponent.d.ts +0 -33
- package/.dist/typings/utils.d.ts +0 -5
- package/src/espModelContext.tsx +0 -69
- package/src/getEspReactRenderModel.ts +0 -27
- package/src/routerProvider.tsx +0 -47
- package/src/shallowEqual.ts +0 -70
- package/src/shouldUpdateMixin.ts +0 -73
- package/src/smartComponent.tsx +0 -93
- package/src/utils.ts +0 -61
- package/tests/connectableComponentTests.tsx +0 -390
package/.dist/esp-react.js
CHANGED
|
@@ -1,18 +1,49 @@
|
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("esp-js"), require("esp-js-polimer"), require("
|
|
3
|
+
module.exports = factory(require("esp-js"), require("esp-js-polimer"), require("react"));
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define(["esp-js", "esp-js-polimer", "
|
|
5
|
+
define(["esp-js", "esp-js-polimer", "react"], factory);
|
|
6
6
|
else if(typeof exports === 'object')
|
|
7
|
-
exports["esp-js-react"] = factory(require("esp-js"), require("esp-js-polimer"), require("
|
|
7
|
+
exports["esp-js-react"] = factory(require("esp-js"), require("esp-js-polimer"), require("react"));
|
|
8
8
|
else
|
|
9
|
-
root["esp-js-react"] = factory(root["esp-js"], root["esp-js-polimer"], root["
|
|
10
|
-
})(self, (__WEBPACK_EXTERNAL_MODULE__152__, __WEBPACK_EXTERNAL_MODULE__43__,
|
|
9
|
+
root["esp-js-react"] = factory(root["esp-js"], root["esp-js-polimer"], root["react"]);
|
|
10
|
+
})(self, (__WEBPACK_EXTERNAL_MODULE__152__, __WEBPACK_EXTERNAL_MODULE__43__, __WEBPACK_EXTERNAL_MODULE__155__) => {
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ "use strict";
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
14
14
|
|
|
15
|
-
/***/
|
|
15
|
+
/***/ 774:
|
|
16
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @license React
|
|
20
|
+
* use-sync-external-store-with-selector.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/
|
|
27
|
+
var g=__webpack_require__(155);function n(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var p="function"===typeof Object.is?Object.is:n,q=g.useSyncExternalStore,r=g.useRef,t=g.useEffect,u=g.useMemo,v=g.useDebugValue;
|
|
28
|
+
exports.useSyncExternalStoreWithSelector=function(a,b,e,l,h){var c=r(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=u(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==h&&f.hasValue){var b=f.value;if(h(b,a))return k=b}return k=a}b=k;if(p(d,a))return b;var e=l(a);if(void 0!==h&&h(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,h]);var d=q(a,c[0],c[1]);
|
|
29
|
+
t(function(){f.hasValue=!0;f.value=d},[d]);v(d);return d};
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/***/ }),
|
|
33
|
+
|
|
34
|
+
/***/ 614:
|
|
35
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
if (true) {
|
|
40
|
+
module.exports = __webpack_require__(774);
|
|
41
|
+
} else {}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/***/ }),
|
|
45
|
+
|
|
46
|
+
/***/ 746:
|
|
16
47
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
17
48
|
|
|
18
49
|
|
|
@@ -28,128 +59,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
28
59
|
return t;
|
|
29
60
|
};
|
|
30
61
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
31
|
-
exports.connect =
|
|
62
|
+
exports.connect = void 0;
|
|
32
63
|
const React = __webpack_require__(155);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
constructor(props, context) {
|
|
40
|
-
super(props, context);
|
|
41
|
-
this._isMounted = false;
|
|
42
|
-
this._publishEvent = (router, modelId) => (eventType, event) => router.publishEvent(modelId, eventType, event);
|
|
43
|
-
this.state = { model: null, currentModelId: null };
|
|
44
|
-
}
|
|
45
|
-
componentWillReceiveProps(nextProps, nextContext) {
|
|
46
|
-
const modelId = nextProps.modelId || nextContext.modelId;
|
|
47
|
-
const oldModelId = this._getModelId();
|
|
48
|
-
if (modelId === oldModelId) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (nextProps.modelId === oldModelId) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this._tryObserveModel(modelId);
|
|
55
|
-
}
|
|
56
|
-
componentDidMount() {
|
|
57
|
-
this._isMounted = true;
|
|
58
|
-
this._tryObserveModel(this._getModelId());
|
|
59
|
-
}
|
|
60
|
-
componentWillUnmount() {
|
|
61
|
-
this._isMounted = false;
|
|
62
|
-
this._tryDisposeModelSubscription();
|
|
63
|
-
}
|
|
64
|
-
_getModelId() {
|
|
65
|
-
// props override context
|
|
66
|
-
return this.props.modelId || this.context.modelId;
|
|
67
|
-
}
|
|
68
|
-
_tryObserveModel(modelId) {
|
|
69
|
-
this._tryDisposeModelSubscription();
|
|
70
|
-
if (!modelId) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
let stateChanged = modelId !== this.state.currentModelId;
|
|
74
|
-
let publishEvent = this.state.publishEvent;
|
|
75
|
-
if (stateChanged) {
|
|
76
|
-
publishEvent = this._publishEvent(this.context.router, modelId);
|
|
77
|
-
}
|
|
78
|
-
let publishProps = this.state.publishProps;
|
|
79
|
-
// We only map the publish props once, as for well behaving components these callbacks should never change
|
|
80
|
-
if (stateChanged && this.props.createPublishEventProps) {
|
|
81
|
-
publishProps = this.props.createPublishEventProps(publishEvent);
|
|
82
|
-
}
|
|
83
|
-
if (stateChanged) {
|
|
84
|
-
this.setState({
|
|
85
|
-
currentModelId: modelId,
|
|
86
|
-
publishEvent,
|
|
87
|
-
publishProps
|
|
88
|
-
});
|
|
89
|
-
this._observationSubscription = this.context.router
|
|
90
|
-
.getModelObservable(modelId)
|
|
91
|
-
.subscribe(model => {
|
|
92
|
-
if (this._isMounted) {
|
|
93
|
-
this.setState({ model });
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
_tryDisposeModelSubscription() {
|
|
99
|
-
if (this._observationSubscription) {
|
|
100
|
-
this._observationSubscription.dispose();
|
|
101
|
-
this._observationSubscription = new esp_js_1.DisposableBase();
|
|
102
|
-
this.setState({ model: null, currentModelId: null, publishProps: null, publishEvent: null });
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
render() {
|
|
106
|
-
if (this.state.model == null) {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
let childProps = this._getChildProps();
|
|
110
|
-
let view = (0, viewBindingDecorator_1.createViewForModel)(this.state.model, childProps, this.props.viewContext, this.props.view);
|
|
111
|
-
return (React.createElement(espModelContext_1.EspModelContext, Object.assign({ modelId: this.props.modelId, router: this.context.router }, childProps), view));
|
|
112
|
-
}
|
|
113
|
-
_getChildProps() {
|
|
114
|
-
// consume what this component owns, and let the rest end up in `...rest`
|
|
115
|
-
const _a = this.props, { children, createPublishEventProps, modelId, mapModelToProps, view, viewContext } = _a, rest = __rest(_a, ["children", "createPublishEventProps", "modelId", "mapModelToProps", "view", "viewContext"]);
|
|
116
|
-
const model = this._getRenderModel(this.state.model);
|
|
117
|
-
let childProps = Object.assign(Object.assign(Object.assign({ modelId, router: this.context.router }, rest), this.state.publishProps), { model });
|
|
118
|
-
if (this.props.mapModelToProps) {
|
|
119
|
-
childProps = Object.assign(Object.assign({}, childProps), this.props.mapModelToProps(model, this.state.publishProps));
|
|
120
|
-
}
|
|
121
|
-
return childProps;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* 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
|
|
125
|
-
*/
|
|
126
|
-
_getRenderModel(model) {
|
|
127
|
-
// does the given model have a decorated function we can invoke to get a different model to render?
|
|
128
|
-
if (esp_js_1.EspDecoratorUtil.hasMetadata(model)) {
|
|
129
|
-
let metadata = esp_js_1.EspDecoratorUtil.getCustomData(model, getEspReactRenderModel_1.GetEspReactRenderModelConsts.CustomDataKey);
|
|
130
|
-
if (metadata) {
|
|
131
|
-
return model[metadata.functionName]();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
// else see if there is a function with name GetEspReactRenderModelConsts.HandlerFunctionName we can invoke to get a different model to render?
|
|
135
|
-
let renderModelGetter = model[getEspReactRenderModel_1.GetEspReactRenderModelConsts.HandlerFunctionName];
|
|
136
|
-
if (renderModelGetter && esp_js_1.utils.isFunction(renderModelGetter)) {
|
|
137
|
-
return renderModelGetter.call(model);
|
|
138
|
-
}
|
|
139
|
-
// else just return the default model
|
|
140
|
-
return model;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
exports.ConnectableComponent = ConnectableComponent;
|
|
144
|
-
ConnectableComponent.contextTypes = {
|
|
145
|
-
router: PropTypes.instanceOf(esp_js_1.Router).isRequired,
|
|
146
|
-
modelId: PropTypes.string
|
|
147
|
-
};
|
|
64
|
+
const connectableComponent_1 = __webpack_require__(397);
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated
|
|
67
|
+
* @param mapModelToProps
|
|
68
|
+
* @param createPublishEventProps
|
|
69
|
+
*/
|
|
148
70
|
const connect = function (mapModelToProps, createPublishEventProps) {
|
|
149
71
|
return function (view) {
|
|
150
72
|
return function (props) {
|
|
151
73
|
const { modelId, viewContext } = props, rest = __rest(props, ["modelId", "viewContext"]);
|
|
152
|
-
return React.createElement(ConnectableComponent, Object.assign({ modelId: modelId, view: view, viewContext: viewContext, createPublishEventProps: createPublishEventProps, mapModelToProps: mapModelToProps }, rest));
|
|
74
|
+
return React.createElement(connectableComponent_1.ConnectableComponent, Object.assign({ modelId: modelId, view: view, viewContext: viewContext, createPublishEventProps: createPublishEventProps, mapModelToProps: mapModelToProps }, rest));
|
|
153
75
|
};
|
|
154
76
|
};
|
|
155
77
|
};
|
|
@@ -158,28 +80,98 @@ exports.connect = connect;
|
|
|
158
80
|
|
|
159
81
|
/***/ }),
|
|
160
82
|
|
|
161
|
-
/***/
|
|
83
|
+
/***/ 397:
|
|
84
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
88
|
+
var t = {};
|
|
89
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
90
|
+
t[p] = s[p];
|
|
91
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
92
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
93
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
94
|
+
t[p[i]] = s[p[i]];
|
|
95
|
+
}
|
|
96
|
+
return t;
|
|
97
|
+
};
|
|
98
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
99
|
+
exports.ConnectableComponent = void 0;
|
|
100
|
+
const React = __webpack_require__(155);
|
|
101
|
+
const espRouterContextProvider_1 = __webpack_require__(169);
|
|
102
|
+
const react_1 = __webpack_require__(155);
|
|
103
|
+
const esp_js_1 = __webpack_require__(152);
|
|
104
|
+
const espModelContextProvider_1 = __webpack_require__(963);
|
|
105
|
+
const viewBindingDecorator_1 = __webpack_require__(213);
|
|
106
|
+
const getEspReactRenderModel_1 = __webpack_require__(621);
|
|
107
|
+
const useModelSelector_1 = __webpack_require__(743);
|
|
108
|
+
const getChildProps = (router, modelId, restProps, initialModel, mapModelToProps, publishEventProps) => {
|
|
109
|
+
// consume what this component owns, and let the rest end up in `...rest`
|
|
110
|
+
const model = (0, getEspReactRenderModel_1.tryGetRenderModel)(initialModel);
|
|
111
|
+
let childProps = Object.assign(Object.assign(Object.assign({ modelId, router: router }, restProps), publishEventProps), { model });
|
|
112
|
+
if (mapModelToProps) {
|
|
113
|
+
childProps = Object.assign(Object.assign({}, childProps), mapModelToProps(model, publishEventProps));
|
|
114
|
+
}
|
|
115
|
+
return childProps;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated - use ViewBinderConnectable and ESP hooks if you need to dynamically bind a view to a model
|
|
119
|
+
* or useModelSelector with other ESP hooks for direct model subscription.
|
|
120
|
+
*/
|
|
121
|
+
const ConnectableComponent = (_a) => {
|
|
122
|
+
var { modelId, mapModelToProps, createPublishEventProps, view, viewContext } = _a, rest = __rest(_a, ["modelId", "mapModelToProps", "createPublishEventProps", "view", "viewContext"]);
|
|
123
|
+
const router = (0, espRouterContextProvider_1.useRouter)();
|
|
124
|
+
modelId = modelId || (0, espModelContextProvider_1.useGetModelId)();
|
|
125
|
+
if (esp_js_1.utils.stringIsEmpty(modelId) || !router) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
const publishEventProps = (0, react_1.useMemo)(() => {
|
|
129
|
+
if (createPublishEventProps) {
|
|
130
|
+
const publishModelEvent = (eventType, event) => {
|
|
131
|
+
router.publishEvent(modelId, eventType, event);
|
|
132
|
+
};
|
|
133
|
+
return createPublishEventProps(publishModelEvent);
|
|
134
|
+
}
|
|
135
|
+
return {};
|
|
136
|
+
}, [router, modelId]);
|
|
137
|
+
const model = (0, useModelSelector_1.useModelSelector)(m => m, (0, useModelSelector_1.modelSelectorOptions)()
|
|
138
|
+
.setModelId(modelId)
|
|
139
|
+
.setTryPreSelectPolimerImmutableModel(false));
|
|
140
|
+
if (model == null) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
let childProps = getChildProps(router, modelId, rest, model, mapModelToProps, publishEventProps);
|
|
144
|
+
let viewElement = (0, viewBindingDecorator_1.createViewForModel)(model, childProps, viewContext, view);
|
|
145
|
+
return (React.createElement(espModelContextProvider_1.EspModelContextProvider, Object.assign({ modelId: modelId, model: model, router: router }, childProps), viewElement));
|
|
146
|
+
};
|
|
147
|
+
exports.ConnectableComponent = ConnectableComponent;
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
/***/ }),
|
|
151
|
+
|
|
152
|
+
/***/ 963:
|
|
162
153
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
163
154
|
|
|
164
155
|
|
|
165
156
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
166
|
-
exports.
|
|
157
|
+
exports.EspModelContextProvider = exports.usePublishModelEventWithEntityKey = exports.PublishModelEventWithEntityKeyContext = exports.usePublishModelEvent = exports.PublishModelEventContext = exports.useGetModel = exports.GetModelContext = exports.useGetModelId = exports.GetModelIdContext = void 0;
|
|
167
158
|
const React = __webpack_require__(155);
|
|
168
159
|
const esp_js_1 = __webpack_require__(152);
|
|
169
160
|
const react_1 = __webpack_require__(155);
|
|
170
|
-
const
|
|
161
|
+
const espRouterContextProvider_1 = __webpack_require__(169);
|
|
162
|
+
const _log = esp_js_1.Logger.create('EspModelContextProvider');
|
|
171
163
|
exports.GetModelIdContext = (0, react_1.createContext)(null);
|
|
172
164
|
/**
|
|
173
165
|
* Returns a function which will return the ID of the model currently being rendered.
|
|
174
166
|
*/
|
|
175
|
-
const useGetModelId = () => (0, react_1.useContext)(exports.GetModelIdContext);
|
|
167
|
+
const useGetModelId = () => (0, react_1.useContext)(exports.GetModelIdContext)();
|
|
176
168
|
exports.useGetModelId = useGetModelId;
|
|
177
|
-
exports.
|
|
169
|
+
exports.GetModelContext = (0, react_1.createContext)(null);
|
|
178
170
|
/**
|
|
179
|
-
* Returns a function which
|
|
171
|
+
* Returns a function which will return the model set at last dispatch.
|
|
180
172
|
*/
|
|
181
|
-
const
|
|
182
|
-
exports.
|
|
173
|
+
const useGetModel = () => (0, react_1.useContext)(exports.GetModelContext)();
|
|
174
|
+
exports.useGetModel = useGetModel;
|
|
183
175
|
exports.PublishModelEventContext = (0, react_1.createContext)(null);
|
|
184
176
|
/**
|
|
185
177
|
* Returns a function which can be used to publish an event to the current model being rendered.
|
|
@@ -196,36 +188,137 @@ exports.PublishModelEventWithEntityKeyContext = (0, react_1.createContext)(null)
|
|
|
196
188
|
*/
|
|
197
189
|
const usePublishModelEventWithEntityKey = () => (0, react_1.useContext)(exports.PublishModelEventWithEntityKeyContext);
|
|
198
190
|
exports.usePublishModelEventWithEntityKey = usePublishModelEventWithEntityKey;
|
|
199
|
-
const
|
|
191
|
+
const EspModelContextProvider = ({ modelId, children, model }) => {
|
|
192
|
+
const router = (0, espRouterContextProvider_1.useRouter)();
|
|
200
193
|
const getModelId = (0, react_1.useCallback)(() => {
|
|
201
194
|
return modelId;
|
|
202
195
|
}, [router, modelId]);
|
|
203
|
-
const
|
|
204
|
-
router
|
|
205
|
-
|
|
196
|
+
const getModel = (0, react_1.useCallback)(() => {
|
|
197
|
+
warnIfModelAccessedOutSideDispatchLoop(router, modelId);
|
|
198
|
+
return model;
|
|
199
|
+
}, [model, router, modelId]);
|
|
206
200
|
const publishModelEvent = (0, react_1.useCallback)((eventType, event) => {
|
|
207
201
|
router.publishEvent(modelId, eventType, event);
|
|
208
202
|
}, [router, modelId]);
|
|
209
203
|
const publishModelEventWithEntityKey = (0, react_1.useCallback)((entityKey, eventType, event) => {
|
|
210
204
|
router.publishEvent(new esp_js_1.DefaultModelAddress(modelId, entityKey), eventType, event);
|
|
211
205
|
}, [router, modelId]);
|
|
212
|
-
return (React.createElement(
|
|
213
|
-
React.createElement(exports.
|
|
214
|
-
React.createElement(exports.
|
|
215
|
-
React.createElement(exports.
|
|
216
|
-
|
|
206
|
+
return (React.createElement(exports.GetModelIdContext.Provider, { value: getModelId },
|
|
207
|
+
React.createElement(exports.PublishModelEventContext.Provider, { value: publishModelEvent },
|
|
208
|
+
React.createElement(exports.PublishModelEventWithEntityKeyContext.Provider, { value: publishModelEventWithEntityKey },
|
|
209
|
+
React.createElement(exports.GetModelContext.Provider, { value: getModel }, children)))));
|
|
210
|
+
};
|
|
211
|
+
exports.EspModelContextProvider = EspModelContextProvider;
|
|
212
|
+
const warnIfModelAccessedOutSideDispatchLoop = (router, modelId) => {
|
|
213
|
+
if (true) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (esp_js_1.utils.stringIsEmpty(modelId)) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
let isDispatchModelUpdateStatus = router.isModelDispatchStatus(modelId, esp_js_1.Status.DispatchModelUpdates);
|
|
220
|
+
if (!isDispatchModelUpdateStatus) {
|
|
221
|
+
let stack = undefined;
|
|
222
|
+
try {
|
|
223
|
+
// noinspection ExceptionCaughtLocallyJS
|
|
224
|
+
throw new Error();
|
|
225
|
+
}
|
|
226
|
+
catch (e) {
|
|
227
|
+
stack = e.stack;
|
|
228
|
+
}
|
|
229
|
+
_log.warn(`EspModelContextProvider useGetModelId has been invoked outside of the models (${modelId}) dispatch loop.` +
|
|
230
|
+
`This may have unknown state state issues.` +
|
|
231
|
+
stack);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
/***/ }),
|
|
237
|
+
|
|
238
|
+
/***/ 169:
|
|
239
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
// notice_start
|
|
243
|
+
/*
|
|
244
|
+
* Copyright 2015 Dev Shop Limited
|
|
245
|
+
*
|
|
246
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
247
|
+
* you may not use this file except in compliance with the License.
|
|
248
|
+
* You may obtain a copy of the License at
|
|
249
|
+
*
|
|
250
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
251
|
+
*
|
|
252
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
253
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
254
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
255
|
+
* See the License for the specific language governing permissions and
|
|
256
|
+
* limitations under the License.
|
|
257
|
+
*/
|
|
258
|
+
// notice_end
|
|
259
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
260
|
+
exports.RouterProvider = exports.EspRouterContextProvider = exports.usePublishEvent = exports.PublishEventContext = exports.useRouter = exports.RouterContext = void 0;
|
|
261
|
+
const React = __webpack_require__(155);
|
|
262
|
+
const react_1 = __webpack_require__(155);
|
|
263
|
+
exports.RouterContext = (0, react_1.createContext)(null);
|
|
264
|
+
/**
|
|
265
|
+
* Get the esp Router from the RouterContext
|
|
266
|
+
*
|
|
267
|
+
* To use this, please ensure your V-DOM has the EspRouterContext at a higher node:
|
|
268
|
+
*
|
|
269
|
+
* <EspRouterContext router={router}>
|
|
270
|
+
* <YourComponents />
|
|
271
|
+
* </EspRouterContext>
|
|
272
|
+
*/
|
|
273
|
+
const useRouter = () => {
|
|
274
|
+
const context = (0, react_1.useContext)(exports.RouterContext);
|
|
275
|
+
if (context === undefined) {
|
|
276
|
+
throw new Error('useRouter must be used within a RouterContext.Provider');
|
|
277
|
+
}
|
|
278
|
+
return context;
|
|
279
|
+
};
|
|
280
|
+
exports.useRouter = useRouter;
|
|
281
|
+
exports.PublishEventContext = (0, react_1.createContext)(null);
|
|
282
|
+
/**
|
|
283
|
+
* Returns a function which can be used to publish an event.
|
|
284
|
+
*
|
|
285
|
+
* To use this, please ensure your V-DOM has the EspRouterContext at a higher node:
|
|
286
|
+
*
|
|
287
|
+
* <EspRouterContextProvider router={router}>
|
|
288
|
+
* <YourComponents />
|
|
289
|
+
* </EspRouterContextProvider>
|
|
290
|
+
*/
|
|
291
|
+
const usePublishEvent = () => (0, react_1.useContext)(exports.PublishEventContext);
|
|
292
|
+
exports.usePublishEvent = usePublishEvent;
|
|
293
|
+
/**
|
|
294
|
+
* Used to set the router on the RouterContext making it available to components down the tree via the useRouter() hook.
|
|
295
|
+
*
|
|
296
|
+
* Also sets up the usePublishEvent() hook so nested components can publish to the router.
|
|
297
|
+
*/
|
|
298
|
+
const EspRouterContextProvider = ({ children, router }) => {
|
|
299
|
+
const publishEvent = (0, react_1.useCallback)((modelIdOrModelAddress, eventType, event) => {
|
|
300
|
+
router.publishEvent(modelIdOrModelAddress, eventType, event);
|
|
301
|
+
}, [router]);
|
|
302
|
+
return (React.createElement(exports.RouterContext.Provider, { value: router },
|
|
303
|
+
React.createElement(exports.PublishEventContext.Provider, { value: publishEvent }, children)));
|
|
217
304
|
};
|
|
218
|
-
exports.
|
|
305
|
+
exports.EspRouterContextProvider = EspRouterContextProvider;
|
|
306
|
+
/**
|
|
307
|
+
* Used to set the router on the RouterContext making it available to components down the tree (via useRouter()).
|
|
308
|
+
*
|
|
309
|
+
* @deprecated use EspRouterContextProvider
|
|
310
|
+
*/
|
|
311
|
+
exports.RouterProvider = exports.EspRouterContextProvider;
|
|
219
312
|
|
|
220
313
|
|
|
221
314
|
/***/ }),
|
|
222
315
|
|
|
223
|
-
/***/
|
|
316
|
+
/***/ 621:
|
|
224
317
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
225
318
|
|
|
226
319
|
|
|
227
320
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
228
|
-
exports.GetEspReactRenderModelConsts = void 0;
|
|
321
|
+
exports.tryGetRenderModel = exports.GetEspReactRenderModelConsts = void 0;
|
|
229
322
|
exports.getEspReactRenderModel = getEspReactRenderModel;
|
|
230
323
|
const esp_js_1 = __webpack_require__(152);
|
|
231
324
|
var GetEspReactRenderModelConsts;
|
|
@@ -246,79 +339,29 @@ function getEspReactRenderModel() {
|
|
|
246
339
|
return descriptor;
|
|
247
340
|
};
|
|
248
341
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
/***/ }),
|
|
252
|
-
|
|
253
|
-
/***/ 872:
|
|
254
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
// notice_start
|
|
258
|
-
/*
|
|
259
|
-
* Copyright 2015 Dev Shop Limited
|
|
260
|
-
*
|
|
261
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
262
|
-
* you may not use this file except in compliance with the License.
|
|
263
|
-
* You may obtain a copy of the License at
|
|
342
|
+
/**
|
|
343
|
+
* Returns the model which will be used to pluck state/props for the current view.
|
|
264
344
|
*
|
|
265
|
-
*
|
|
345
|
+
* This is basically a hook (not a React 'hook') to call a function on `model` and get a new subgraph to use as state.
|
|
266
346
|
*
|
|
267
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
268
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
269
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
270
|
-
* See the License for the specific language governing permissions and
|
|
271
|
-
* limitations under the License.
|
|
272
347
|
*/
|
|
273
|
-
|
|
274
|
-
//
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
348
|
+
const tryGetRenderModel = (model) => {
|
|
349
|
+
// does the given model have a decorated function we can invoke to get a different model to render?
|
|
350
|
+
if (esp_js_1.EspDecoratorUtil.hasMetadata(model)) {
|
|
351
|
+
let metadata = esp_js_1.EspDecoratorUtil.getCustomData(model, GetEspReactRenderModelConsts.CustomDataKey);
|
|
352
|
+
if (metadata) {
|
|
353
|
+
return model[metadata.functionName]();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// else see if there is a function with name GetEspReactRenderModelConsts.HandlerFunctionName we can invoke to get a different model to render?
|
|
357
|
+
let renderModelGetter = model[GetEspReactRenderModelConsts.HandlerFunctionName];
|
|
358
|
+
if (renderModelGetter && esp_js_1.utils.isFunction(renderModelGetter)) {
|
|
359
|
+
return renderModelGetter.call(model);
|
|
280
360
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
if (k2 === undefined) k2 = k;
|
|
284
|
-
o[k2] = m[k];
|
|
285
|
-
}));
|
|
286
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
287
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
361
|
+
// else return the initial model passed in
|
|
362
|
+
return model;
|
|
288
363
|
};
|
|
289
|
-
|
|
290
|
-
exports.EspModelContext = exports.usePublishModelEventWithEntityKey = exports.PublishModelEventWithEntityKeyContext = exports.usePublishModelEvent = exports.PublishModelEventContext = exports.usePublishEvent = exports.PublishEventContext = exports.GetModelIdContext = exports.useGetModelId = exports.connect = exports.ConnectableComponent = exports.createViewForModel = exports.shouldUpdateMixin = exports.DEFAULT_VIEW_KEY = exports.viewBinding = exports.ViewBinder = exports.SmartComponent = exports.useRouter = exports.RouterContext = exports.RouterProvider = void 0;
|
|
291
|
-
// import for side effects
|
|
292
|
-
__webpack_require__(637);
|
|
293
|
-
var routerProvider_1 = __webpack_require__(182);
|
|
294
|
-
Object.defineProperty(exports, "RouterProvider", ({ enumerable: true, get: function () { return routerProvider_1.RouterProvider; } }));
|
|
295
|
-
Object.defineProperty(exports, "RouterContext", ({ enumerable: true, get: function () { return routerProvider_1.RouterContext; } }));
|
|
296
|
-
Object.defineProperty(exports, "useRouter", ({ enumerable: true, get: function () { return routerProvider_1.useRouter; } }));
|
|
297
|
-
var smartComponent_1 = __webpack_require__(438);
|
|
298
|
-
Object.defineProperty(exports, "SmartComponent", ({ enumerable: true, get: function () { return smartComponent_1.SmartComponent; } }));
|
|
299
|
-
var viewBinder_1 = __webpack_require__(453);
|
|
300
|
-
Object.defineProperty(exports, "ViewBinder", ({ enumerable: true, get: function () { return viewBinder_1.ViewBinder; } }));
|
|
301
|
-
var viewBindingDecorator_1 = __webpack_require__(213);
|
|
302
|
-
Object.defineProperty(exports, "viewBinding", ({ enumerable: true, get: function () { return viewBindingDecorator_1.viewBinding; } }));
|
|
303
|
-
Object.defineProperty(exports, "DEFAULT_VIEW_KEY", ({ enumerable: true, get: function () { return viewBindingDecorator_1.DEFAULT_VIEW_KEY; } }));
|
|
304
|
-
__exportStar(__webpack_require__(102), exports);
|
|
305
|
-
var shouldUpdateMixin_1 = __webpack_require__(79);
|
|
306
|
-
Object.defineProperty(exports, "shouldUpdateMixin", ({ enumerable: true, get: function () { return shouldUpdateMixin_1.shouldUpdateMixin; } }));
|
|
307
|
-
var viewBindingDecorator_2 = __webpack_require__(213);
|
|
308
|
-
Object.defineProperty(exports, "createViewForModel", ({ enumerable: true, get: function () { return viewBindingDecorator_2.createViewForModel; } }));
|
|
309
|
-
var connectableComponent_1 = __webpack_require__(397);
|
|
310
|
-
Object.defineProperty(exports, "ConnectableComponent", ({ enumerable: true, get: function () { return connectableComponent_1.ConnectableComponent; } }));
|
|
311
|
-
Object.defineProperty(exports, "connect", ({ enumerable: true, get: function () { return connectableComponent_1.connect; } }));
|
|
312
|
-
var espModelContext_1 = __webpack_require__(680);
|
|
313
|
-
Object.defineProperty(exports, "useGetModelId", ({ enumerable: true, get: function () { return espModelContext_1.useGetModelId; } }));
|
|
314
|
-
Object.defineProperty(exports, "GetModelIdContext", ({ enumerable: true, get: function () { return espModelContext_1.GetModelIdContext; } }));
|
|
315
|
-
Object.defineProperty(exports, "PublishEventContext", ({ enumerable: true, get: function () { return espModelContext_1.PublishEventContext; } }));
|
|
316
|
-
Object.defineProperty(exports, "usePublishEvent", ({ enumerable: true, get: function () { return espModelContext_1.usePublishEvent; } }));
|
|
317
|
-
Object.defineProperty(exports, "PublishModelEventContext", ({ enumerable: true, get: function () { return espModelContext_1.PublishModelEventContext; } }));
|
|
318
|
-
Object.defineProperty(exports, "usePublishModelEvent", ({ enumerable: true, get: function () { return espModelContext_1.usePublishModelEvent; } }));
|
|
319
|
-
Object.defineProperty(exports, "PublishModelEventWithEntityKeyContext", ({ enumerable: true, get: function () { return espModelContext_1.PublishModelEventWithEntityKeyContext; } }));
|
|
320
|
-
Object.defineProperty(exports, "usePublishModelEventWithEntityKey", ({ enumerable: true, get: function () { return espModelContext_1.usePublishModelEventWithEntityKey; } }));
|
|
321
|
-
Object.defineProperty(exports, "EspModelContext", ({ enumerable: true, get: function () { return espModelContext_1.EspModelContext; } }));
|
|
364
|
+
exports.tryGetRenderModel = tryGetRenderModel;
|
|
322
365
|
|
|
323
366
|
|
|
324
367
|
/***/ }),
|
|
@@ -356,202 +399,128 @@ esp_js_polimer_1.PolimerModelBuilder.prototype.registerWithRouter = function ()
|
|
|
356
399
|
|
|
357
400
|
/***/ }),
|
|
358
401
|
|
|
359
|
-
/***/
|
|
402
|
+
/***/ 743:
|
|
360
403
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
361
404
|
|
|
362
405
|
|
|
363
|
-
// notice_start
|
|
364
|
-
/*
|
|
365
|
-
* Copyright 2015 Dev Shop Limited
|
|
366
|
-
*
|
|
367
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
368
|
-
* you may not use this file except in compliance with the License.
|
|
369
|
-
* You may obtain a copy of the License at
|
|
370
|
-
*
|
|
371
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
372
|
-
*
|
|
373
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
374
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
375
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
376
|
-
* See the License for the specific language governing permissions and
|
|
377
|
-
* limitations under the License.
|
|
378
|
-
*/
|
|
379
|
-
// notice_end
|
|
380
406
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
381
|
-
exports.
|
|
382
|
-
const React = __webpack_require__(155);
|
|
383
|
-
const PropTypes = __webpack_require__(949);
|
|
384
|
-
const esp_js_1 = __webpack_require__(152);
|
|
407
|
+
exports.useModelSelector = exports.modelSelectorOptions = void 0;
|
|
385
408
|
const react_1 = __webpack_require__(155);
|
|
386
|
-
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
409
|
+
const with_selector_1 = __webpack_require__(614);
|
|
410
|
+
const esp_js_1 = __webpack_require__(152);
|
|
411
|
+
const espRouterContextProvider_1 = __webpack_require__(169);
|
|
412
|
+
const espModelContextProvider_1 = __webpack_require__(963);
|
|
413
|
+
const getEspReactRenderModel_1 = __webpack_require__(621);
|
|
414
|
+
const modelSelectorOptions = () => {
|
|
415
|
+
let modelId = undefined;
|
|
416
|
+
let equalityFn = (a, b) => a === b;
|
|
417
|
+
let tryPreSelectPolimerImmutableModel = true;
|
|
418
|
+
return {
|
|
419
|
+
get modelId() {
|
|
420
|
+
return modelId;
|
|
421
|
+
},
|
|
422
|
+
setModelId(value) {
|
|
423
|
+
modelId = value;
|
|
424
|
+
return this;
|
|
425
|
+
},
|
|
426
|
+
get equalityFn() {
|
|
427
|
+
return equalityFn;
|
|
428
|
+
},
|
|
429
|
+
setEqualityFn(value) {
|
|
430
|
+
equalityFn = value;
|
|
431
|
+
return this;
|
|
432
|
+
},
|
|
433
|
+
get tryPreSelectPolimerImmutableModel() {
|
|
434
|
+
return tryPreSelectPolimerImmutableModel;
|
|
435
|
+
},
|
|
436
|
+
setTryPreSelectPolimerImmutableModel(value) {
|
|
437
|
+
tryPreSelectPolimerImmutableModel = value;
|
|
438
|
+
return this;
|
|
439
|
+
}
|
|
440
|
+
};
|
|
402
441
|
};
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
/***/ }),
|
|
406
|
-
|
|
407
|
-
/***/ 234:
|
|
408
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
409
|
-
|
|
410
|
-
// taken from fbjs:
|
|
411
|
-
// https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js
|
|
412
|
-
// Licence (MIT) https://github.com/facebook/fbjs/blob/master/packages/fbjs/LICENSE
|
|
442
|
+
exports.modelSelectorOptions = modelSelectorOptions;
|
|
413
443
|
/**
|
|
414
|
-
*
|
|
444
|
+
* A hook which returns model state from the esp Router.
|
|
415
445
|
*
|
|
416
|
-
* This
|
|
417
|
-
* LICENSE file in the root directory of this source tree.
|
|
446
|
+
* This hooks wih observe updates and re-render the component if the model changes.
|
|
418
447
|
*
|
|
419
|
-
* @
|
|
420
|
-
* @
|
|
421
|
-
* @flow
|
|
448
|
+
* @param selector - a function to select a selection of the model - the selector does not need to be memoized, this selector will be cached against the modelId.
|
|
449
|
+
* @param options
|
|
422
450
|
*/
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
return true;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
/***/ }),
|
|
475
|
-
|
|
476
|
-
/***/ 79:
|
|
477
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
// notice_start
|
|
481
|
-
/*
|
|
482
|
-
* Copyright 2018 Keith Woods
|
|
483
|
-
*
|
|
484
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
485
|
-
* you may not use this file except in compliance with the License.
|
|
486
|
-
* You may obtain a copy of the License at
|
|
487
|
-
*
|
|
488
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
489
|
-
*
|
|
490
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
491
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
492
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
493
|
-
* See the License for the specific language governing permissions and
|
|
494
|
-
* limitations under the License.
|
|
495
|
-
*/
|
|
496
|
-
// notice_end
|
|
497
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
498
|
-
exports.shouldUpdateMixin = shouldUpdateMixin;
|
|
499
|
-
const React = __webpack_require__(155);
|
|
500
|
-
const shallowEqual_1 = __webpack_require__(234);
|
|
501
|
-
// WORKS (compiles at least):
|
|
502
|
-
//
|
|
503
|
-
// export function shouldUpdateMixin<TProps, TState, TPropBindings>(itemsThatEffectUpdateSelector: (nextProps: TProps) => TPropBindings) {
|
|
504
|
-
// return function <T extends {new(...args:any[]):{}}>(constructor:T) {
|
|
505
|
-
// return class extends constructor {
|
|
506
|
-
// _propBindings : {};
|
|
507
|
-
// shouldComponentUpdate(nextProps, nextState) {
|
|
508
|
-
// let newBindings = itemsThatEffectUpdateSelector(nextProps);
|
|
509
|
-
// let bindingsAreEqual = shallowEqual(this._propBindings, newBindings);
|
|
510
|
-
// this._propBindings = newBindings;
|
|
511
|
-
// return !bindingsAreEqual;
|
|
512
|
-
// }
|
|
513
|
-
// render() {
|
|
514
|
-
// return React.createElement(<any>constructor, (<any>this).props);
|
|
515
|
-
// }
|
|
516
|
-
// };
|
|
517
|
-
// };
|
|
518
|
-
// }
|
|
519
|
-
function shouldUpdateMixin(itemsThatEffectUpdateSelector) {
|
|
520
|
-
return function (Constructor) {
|
|
521
|
-
return class extends Constructor {
|
|
522
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
523
|
-
let newBindings = itemsThatEffectUpdateSelector(nextProps);
|
|
524
|
-
let bindingsAreEqual = (0, shallowEqual_1.shallowEqual)(this._propBindings, newBindings);
|
|
525
|
-
this._propBindings = newBindings;
|
|
526
|
-
return !bindingsAreEqual;
|
|
527
|
-
}
|
|
528
|
-
render() {
|
|
529
|
-
return React.createElement(Constructor, this.props);
|
|
451
|
+
const useModelSelector = (selector, options = (0, exports.modelSelectorOptions)()) => {
|
|
452
|
+
esp_js_1.Guard.isFunction(selector, 'You must pass a selector function to connectSelector');
|
|
453
|
+
const router = (0, espRouterContextProvider_1.useRouter)();
|
|
454
|
+
const modelId = (options === null || options === void 0 ? void 0 : options.modelId) || (0, espModelContextProvider_1.useGetModelId)();
|
|
455
|
+
const tryPreSelectPolimerImmutableModel = options === null || options === void 0 ? void 0 : options.tryPreSelectPolimerImmutableModel;
|
|
456
|
+
const equalityFn = options === null || options === void 0 ? void 0 : options.equalityFn;
|
|
457
|
+
const dependencies = (0, react_1.useMemo)(() => {
|
|
458
|
+
// Because of how useSyncExternalStore works, there is an implicit dependency between the subscribe and getSnapshot functions.
|
|
459
|
+
// When the subscription receives the new state from the Router, it can't pass this directly onto getSnapshot, React calls that when it deems it needs to.
|
|
460
|
+
// Given that, we need to cache the state which getSnapshot will return.
|
|
461
|
+
//
|
|
462
|
+
// It's not ideal but shouldn't be a problem as here we've wrapped all these dependent functions inside a single useMemo()
|
|
463
|
+
let model = null;
|
|
464
|
+
return {
|
|
465
|
+
subscribe: (stateChanged) => {
|
|
466
|
+
const modelSubscriptionDisposable = router
|
|
467
|
+
.getModelObservable(modelId)
|
|
468
|
+
.subscribe((m) => {
|
|
469
|
+
// try and get a submodel to render
|
|
470
|
+
const nextModel = tryPreSelectPolimerImmutableModel
|
|
471
|
+
? (0, getEspReactRenderModel_1.tryGetRenderModel)(m)
|
|
472
|
+
: m;
|
|
473
|
+
// if the above didn't manage to get a submodel,
|
|
474
|
+
// we need to mutate to force useSyncExternalStoreWithSelector to pick up the change
|
|
475
|
+
model = nextModel === m
|
|
476
|
+
? Object.create(nextModel)
|
|
477
|
+
: nextModel;
|
|
478
|
+
stateChanged();
|
|
479
|
+
});
|
|
480
|
+
return () => {
|
|
481
|
+
model = null;
|
|
482
|
+
modelSubscriptionDisposable.dispose();
|
|
483
|
+
};
|
|
484
|
+
},
|
|
485
|
+
// React expects getSnapshot to be immutable, it'll only re-render if the instance changes
|
|
486
|
+
getSnapshot: () => {
|
|
487
|
+
return model;
|
|
488
|
+
},
|
|
489
|
+
// While getSnapshot needs to model to be immutable,
|
|
490
|
+
// useSyncExternalStoreWithSelector builds on top of this, so the TSelected can defer to an equality check to determine if the change is propagated.
|
|
491
|
+
// The selector here just maps the TSelected, useSyncExternalStoreWithSelector internally does the equality check.
|
|
492
|
+
wrappedSelector: (snapshot) => {
|
|
493
|
+
// The first time this renders, react calls getSnapshot and the selector before the router has pushed a change.
|
|
494
|
+
// In that case, there is no state for any component to process, therefore, we return null;
|
|
495
|
+
return snapshot
|
|
496
|
+
? selector(snapshot)
|
|
497
|
+
: null;
|
|
530
498
|
}
|
|
531
499
|
};
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
//
|
|
536
|
-
//
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
//
|
|
541
|
-
//
|
|
542
|
-
//
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
500
|
+
},
|
|
501
|
+
// Don't cache check against 'selector' argument as that will likely change unless the caller memoizes it.
|
|
502
|
+
[router, modelId]);
|
|
503
|
+
// If we don't have a modelId, we still need to return a hook so React doesn't complain.
|
|
504
|
+
// Additionally, we need to let the above expiration (dependencies) run to unsubscribe from any previous subscription.
|
|
505
|
+
if (esp_js_1.utils.stringIsEmpty(modelId)) {
|
|
506
|
+
return (0, with_selector_1.useSyncExternalStoreWithSelector)(noopSubscription.subscribe, noopSubscription.getSnapshot, undefined, noopSubscription.wrappedSelector, equalityFn);
|
|
507
|
+
}
|
|
508
|
+
// Docs on useSyncExternalStore https://github.com/reactwg/react-18/discussions/86
|
|
509
|
+
// Redux's usage of this: https://github.com/reduxjs/react-redux/blob/master/src/hooks/useSelector.ts
|
|
510
|
+
// Code: https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreWithSelector.js
|
|
511
|
+
return (0, with_selector_1.useSyncExternalStoreWithSelector)(dependencies.subscribe, dependencies.getSnapshot, undefined, dependencies.wrappedSelector, equalityFn);
|
|
512
|
+
};
|
|
513
|
+
exports.useModelSelector = useModelSelector;
|
|
514
|
+
const noopSubscription = {
|
|
515
|
+
subscribe: () => { },
|
|
516
|
+
getSnapshot: () => null,
|
|
517
|
+
wrappedSelector: () => true
|
|
518
|
+
};
|
|
550
519
|
|
|
551
520
|
|
|
552
521
|
/***/ }),
|
|
553
522
|
|
|
554
|
-
/***/
|
|
523
|
+
/***/ 453:
|
|
555
524
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
556
525
|
|
|
557
526
|
|
|
@@ -584,128 +553,63 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
584
553
|
return t;
|
|
585
554
|
};
|
|
586
555
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
587
|
-
exports.
|
|
588
|
-
const React = __webpack_require__(155);
|
|
589
|
-
const PropTypes = __webpack_require__(949);
|
|
556
|
+
exports.ViewBinder = void 0;
|
|
590
557
|
const viewBindingDecorator_1 = __webpack_require__(213);
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
componentWillReceiveProps(nextProps) {
|
|
599
|
-
this._tryObserveModel(nextProps.modelId);
|
|
600
|
-
}
|
|
601
|
-
componentWillMount() {
|
|
602
|
-
this._tryObserveModel(this.props.modelId);
|
|
603
|
-
}
|
|
604
|
-
componentWillUnmount() {
|
|
605
|
-
this._tryDisposeObservationSubscription();
|
|
606
|
-
}
|
|
607
|
-
_tryObserveModel(modelId) {
|
|
608
|
-
if (!modelId) {
|
|
609
|
-
this._tryDisposeObservationSubscription();
|
|
610
|
-
this.setState({ model: null });
|
|
611
|
-
}
|
|
612
|
-
else if (modelId !== this._currentObservingModelId) {
|
|
613
|
-
this._tryDisposeObservationSubscription();
|
|
614
|
-
this._currentObservingModelId = modelId;
|
|
615
|
-
this._observationSubscription = this.context.router
|
|
616
|
-
.getModelObservable(modelId)
|
|
617
|
-
.map(model => {
|
|
618
|
-
return this.props.modelSelector
|
|
619
|
-
? this.props.modelSelector(model)
|
|
620
|
-
: model;
|
|
621
|
-
})
|
|
622
|
-
.subscribe(model => {
|
|
623
|
-
this.setState({ model: model });
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
_tryDisposeObservationSubscription() {
|
|
628
|
-
this._currentObservingModelId = null;
|
|
629
|
-
if (this._observationSubscription) {
|
|
630
|
-
this._observationSubscription.dispose();
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
render() {
|
|
634
|
-
if (this.state.model) {
|
|
635
|
-
return (0, viewBindingDecorator_1.createViewForModel)(this.state.model, this._getChildProps(), this.props.viewContext, this.props.view);
|
|
636
|
-
}
|
|
637
|
-
return null; // this (in react 15) will render a 'comment node' rather than any actual html
|
|
638
|
-
}
|
|
639
|
-
_getChildProps() {
|
|
640
|
-
// 'consume' the props we own, pass the rest down
|
|
641
|
-
let _a = this.props, { modelId, viewContext, view, modelSelector } = _a, other = __rest(_a, ["modelId", "viewContext", "view", "modelSelector"]);
|
|
642
|
-
let newProps = {
|
|
643
|
-
model: this.state.model,
|
|
644
|
-
router: this.context.router
|
|
645
|
-
};
|
|
646
|
-
return Object.assign({}, newProps, other);
|
|
558
|
+
const espRouterContextProvider_1 = __webpack_require__(169);
|
|
559
|
+
const ViewBinder = (_a) => {
|
|
560
|
+
var { model, viewContext } = _a, rest = __rest(_a, ["model", "viewContext"]);
|
|
561
|
+
if (model) {
|
|
562
|
+
const router = (0, espRouterContextProvider_1.useRouter)();
|
|
563
|
+
const newProps = Object.assign({}, { model, router }, rest);
|
|
564
|
+
return (0, viewBindingDecorator_1.createViewForModel)(model, newProps, viewContext, null);
|
|
647
565
|
}
|
|
648
|
-
|
|
649
|
-
exports.SmartComponent = SmartComponent;
|
|
650
|
-
SmartComponent.contextTypes = {
|
|
651
|
-
router: PropTypes.instanceOf(esp_js_1.Router).isRequired
|
|
566
|
+
return null;
|
|
652
567
|
};
|
|
568
|
+
exports.ViewBinder = ViewBinder;
|
|
653
569
|
|
|
654
570
|
|
|
655
571
|
/***/ }),
|
|
656
572
|
|
|
657
|
-
/***/
|
|
658
|
-
/***/ (
|
|
573
|
+
/***/ 639:
|
|
574
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
659
575
|
|
|
660
576
|
|
|
661
|
-
// notice_start
|
|
662
|
-
/*
|
|
663
|
-
* Copyright 2015 Dev Shop Limited
|
|
664
|
-
*
|
|
665
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
666
|
-
* you may not use this file except in compliance with the License.
|
|
667
|
-
* You may obtain a copy of the License at
|
|
668
|
-
*
|
|
669
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
670
|
-
*
|
|
671
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
672
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
673
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
674
|
-
* See the License for the specific language governing permissions and
|
|
675
|
-
* limitations under the License.
|
|
676
|
-
*/
|
|
677
|
-
// notice_end
|
|
678
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
679
|
-
var t = {};
|
|
680
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
681
|
-
t[p] = s[p];
|
|
682
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
683
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
684
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
685
|
-
t[p[i]] = s[p[i]];
|
|
686
|
-
}
|
|
687
|
-
return t;
|
|
688
|
-
};
|
|
689
577
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
690
|
-
exports.
|
|
691
|
-
const
|
|
578
|
+
exports.ViewBinderConnectable = void 0;
|
|
579
|
+
const espRouterContextProvider_1 = __webpack_require__(169);
|
|
580
|
+
const espModelContextProvider_1 = __webpack_require__(963);
|
|
581
|
+
const esp_js_1 = __webpack_require__(152);
|
|
692
582
|
const React = __webpack_require__(155);
|
|
693
|
-
const
|
|
583
|
+
const useModelSelector_1 = __webpack_require__(743);
|
|
694
584
|
const viewBindingDecorator_1 = __webpack_require__(213);
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
585
|
+
const getEspReactRenderModel_1 = __webpack_require__(621);
|
|
586
|
+
const _log = esp_js_1.Logger.create('ViewBinderConnectable');
|
|
587
|
+
/**
|
|
588
|
+
* Dynamically binds a view found via @viewBinder(SomeJsXView) to a model managed by the Router.
|
|
589
|
+
* Optionally provide a view override and/or a viewContext
|
|
590
|
+
* @param modelId
|
|
591
|
+
* @param viewContext
|
|
592
|
+
* @param view
|
|
593
|
+
* @constructor
|
|
594
|
+
*/
|
|
595
|
+
const ViewBinderConnectable = ({ modelId, viewContext, view }) => {
|
|
596
|
+
const router = (0, espRouterContextProvider_1.useRouter)();
|
|
597
|
+
const model = (0, useModelSelector_1.useModelSelector)(m => m, (0, useModelSelector_1.modelSelectorOptions)()
|
|
598
|
+
.setModelId(modelId)
|
|
599
|
+
.setTryPreSelectPolimerImmutableModel(false));
|
|
600
|
+
if (!model) {
|
|
702
601
|
return null;
|
|
703
602
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
603
|
+
let renderModel = (0, getEspReactRenderModel_1.tryGetRenderModel)(model);
|
|
604
|
+
const childProps = {
|
|
605
|
+
modelId,
|
|
606
|
+
router: router,
|
|
607
|
+
model: renderModel
|
|
608
|
+
};
|
|
609
|
+
let viewElement = (0, viewBindingDecorator_1.createViewForModel)(model, childProps, viewContext, view);
|
|
610
|
+
return (React.createElement(espModelContextProvider_1.EspModelContextProvider, Object.assign({ modelId: modelId, router: router, model: renderModel }, childProps), viewElement));
|
|
708
611
|
};
|
|
612
|
+
exports.ViewBinderConnectable = ViewBinderConnectable;
|
|
709
613
|
|
|
710
614
|
|
|
711
615
|
/***/ }),
|
|
@@ -841,13 +745,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__43__;
|
|
|
841
745
|
|
|
842
746
|
/***/ }),
|
|
843
747
|
|
|
844
|
-
/***/ 949:
|
|
845
|
-
/***/ ((module) => {
|
|
846
|
-
|
|
847
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__949__;
|
|
848
|
-
|
|
849
|
-
/***/ }),
|
|
850
|
-
|
|
851
748
|
/***/ 155:
|
|
852
749
|
/***/ ((module) => {
|
|
853
750
|
|
|
@@ -882,12 +779,72 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__155__;
|
|
|
882
779
|
/******/ }
|
|
883
780
|
/******/
|
|
884
781
|
/************************************************************************/
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
782
|
+
var __webpack_exports__ = {};
|
|
783
|
+
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
|
784
|
+
(() => {
|
|
785
|
+
var exports = __webpack_exports__;
|
|
786
|
+
|
|
787
|
+
// notice_start
|
|
788
|
+
/*
|
|
789
|
+
* Copyright 2015 Dev Shop Limited
|
|
790
|
+
*
|
|
791
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
792
|
+
* you may not use this file except in compliance with the License.
|
|
793
|
+
* You may obtain a copy of the License at
|
|
794
|
+
*
|
|
795
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
796
|
+
*
|
|
797
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
798
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
799
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
800
|
+
* See the License for the specific language governing permissions and
|
|
801
|
+
* limitations under the License.
|
|
802
|
+
*/
|
|
803
|
+
// notice_end
|
|
804
|
+
//
|
|
805
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
806
|
+
exports.EspModelContextProvider = exports.usePublishModelEventWithEntityKey = exports.PublishModelEventWithEntityKeyContext = exports.usePublishModelEvent = exports.PublishModelEventContext = exports.GetModelContext = exports.useGetModel = exports.GetModelIdContext = exports.useGetModelId = exports.usePublishEvent = exports.PublishEventContext = exports.useRouter = exports.RouterContext = exports.EspRouterContextProvider = exports.RouterProvider = exports.modelSelectorOptions = exports.useModelSelector = exports.ConnectableComponent = exports.connect = exports.createViewForModel = exports.getEspReactRenderModel = exports.GetEspReactRenderModelConsts = exports.DEFAULT_VIEW_KEY = exports.viewBinding = exports.ViewBinderConnectable = exports.ViewBinder = void 0;
|
|
807
|
+
// import for side effects
|
|
808
|
+
__webpack_require__(637);
|
|
809
|
+
var viewBinder_1 = __webpack_require__(453);
|
|
810
|
+
Object.defineProperty(exports, "ViewBinder", ({ enumerable: true, get: function () { return viewBinder_1.ViewBinder; } }));
|
|
811
|
+
var viewBinderConnectable_1 = __webpack_require__(639);
|
|
812
|
+
Object.defineProperty(exports, "ViewBinderConnectable", ({ enumerable: true, get: function () { return viewBinderConnectable_1.ViewBinderConnectable; } }));
|
|
813
|
+
var viewBindingDecorator_1 = __webpack_require__(213);
|
|
814
|
+
Object.defineProperty(exports, "viewBinding", ({ enumerable: true, get: function () { return viewBindingDecorator_1.viewBinding; } }));
|
|
815
|
+
Object.defineProperty(exports, "DEFAULT_VIEW_KEY", ({ enumerable: true, get: function () { return viewBindingDecorator_1.DEFAULT_VIEW_KEY; } }));
|
|
816
|
+
var getEspReactRenderModel_1 = __webpack_require__(621);
|
|
817
|
+
Object.defineProperty(exports, "GetEspReactRenderModelConsts", ({ enumerable: true, get: function () { return getEspReactRenderModel_1.GetEspReactRenderModelConsts; } }));
|
|
818
|
+
Object.defineProperty(exports, "getEspReactRenderModel", ({ enumerable: true, get: function () { return getEspReactRenderModel_1.getEspReactRenderModel; } }));
|
|
819
|
+
var viewBindingDecorator_2 = __webpack_require__(213);
|
|
820
|
+
Object.defineProperty(exports, "createViewForModel", ({ enumerable: true, get: function () { return viewBindingDecorator_2.createViewForModel; } }));
|
|
821
|
+
var connect_1 = __webpack_require__(746);
|
|
822
|
+
Object.defineProperty(exports, "connect", ({ enumerable: true, get: function () { return connect_1.connect; } }));
|
|
823
|
+
var connectableComponent_1 = __webpack_require__(397);
|
|
824
|
+
Object.defineProperty(exports, "ConnectableComponent", ({ enumerable: true, get: function () { return connectableComponent_1.ConnectableComponent; } }));
|
|
825
|
+
var useModelSelector_1 = __webpack_require__(743);
|
|
826
|
+
Object.defineProperty(exports, "useModelSelector", ({ enumerable: true, get: function () { return useModelSelector_1.useModelSelector; } }));
|
|
827
|
+
Object.defineProperty(exports, "modelSelectorOptions", ({ enumerable: true, get: function () { return useModelSelector_1.modelSelectorOptions; } }));
|
|
828
|
+
var espRouterContextProvider_1 = __webpack_require__(169);
|
|
829
|
+
Object.defineProperty(exports, "RouterProvider", ({ enumerable: true, get: function () { return espRouterContextProvider_1.RouterProvider; } }));
|
|
830
|
+
Object.defineProperty(exports, "EspRouterContextProvider", ({ enumerable: true, get: function () { return espRouterContextProvider_1.EspRouterContextProvider; } }));
|
|
831
|
+
Object.defineProperty(exports, "RouterContext", ({ enumerable: true, get: function () { return espRouterContextProvider_1.RouterContext; } }));
|
|
832
|
+
Object.defineProperty(exports, "useRouter", ({ enumerable: true, get: function () { return espRouterContextProvider_1.useRouter; } }));
|
|
833
|
+
Object.defineProperty(exports, "PublishEventContext", ({ enumerable: true, get: function () { return espRouterContextProvider_1.PublishEventContext; } }));
|
|
834
|
+
Object.defineProperty(exports, "usePublishEvent", ({ enumerable: true, get: function () { return espRouterContextProvider_1.usePublishEvent; } }));
|
|
835
|
+
var espModelContextProvider_1 = __webpack_require__(963);
|
|
836
|
+
Object.defineProperty(exports, "useGetModelId", ({ enumerable: true, get: function () { return espModelContextProvider_1.useGetModelId; } }));
|
|
837
|
+
Object.defineProperty(exports, "GetModelIdContext", ({ enumerable: true, get: function () { return espModelContextProvider_1.GetModelIdContext; } }));
|
|
838
|
+
Object.defineProperty(exports, "useGetModel", ({ enumerable: true, get: function () { return espModelContextProvider_1.useGetModel; } }));
|
|
839
|
+
Object.defineProperty(exports, "GetModelContext", ({ enumerable: true, get: function () { return espModelContextProvider_1.GetModelContext; } }));
|
|
840
|
+
Object.defineProperty(exports, "PublishModelEventContext", ({ enumerable: true, get: function () { return espModelContextProvider_1.PublishModelEventContext; } }));
|
|
841
|
+
Object.defineProperty(exports, "usePublishModelEvent", ({ enumerable: true, get: function () { return espModelContextProvider_1.usePublishModelEvent; } }));
|
|
842
|
+
Object.defineProperty(exports, "PublishModelEventWithEntityKeyContext", ({ enumerable: true, get: function () { return espModelContextProvider_1.PublishModelEventWithEntityKeyContext; } }));
|
|
843
|
+
Object.defineProperty(exports, "usePublishModelEventWithEntityKey", ({ enumerable: true, get: function () { return espModelContextProvider_1.usePublishModelEventWithEntityKey; } }));
|
|
844
|
+
Object.defineProperty(exports, "EspModelContextProvider", ({ enumerable: true, get: function () { return espModelContextProvider_1.EspModelContextProvider; } }));
|
|
845
|
+
|
|
846
|
+
})();
|
|
847
|
+
|
|
891
848
|
/******/ return __webpack_exports__;
|
|
892
849
|
/******/ })()
|
|
893
850
|
;
|