esp-js-react 8.0.1-next.0 → 8.0.3-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 +68 -104
- package/.dist/esp-react.js.map +1 -1
- package/.dist/esp-react.min.js +1 -1
- package/.dist/esp-react.min.js.map +1 -1
- package/.dist/typings/connect.d.ts +2 -6
- package/.dist/typings/connectableComponent.d.ts +0 -16
- package/.dist/typings/espModelContextProvider.d.ts +24 -7
- package/.dist/typings/espRouterContextProvider.d.ts +5 -5
- package/.dist/typings/index.d.ts +2 -3
- package/.dist/typings/polimer/getEspPolimerImmutableModel.d.ts +21 -0
- package/.dist/typings/useModelSelector.d.ts +25 -1
- package/.dist/typings/viewBinder.d.ts +8 -1
- package/.dist/typings/viewBindingDecorator.d.ts +1 -1
- package/package.json +4 -4
- package/src/connect.tsx +2 -6
- package/src/connectableComponent.tsx +2 -19
- package/src/espModelContextProvider.tsx +26 -9
- package/src/espRouterContextProvider.tsx +5 -5
- package/src/index.ts +5 -9
- package/src/polimer/getEspPolimerImmutableModel.ts +50 -0
- package/src/useModelSelector.ts +31 -7
- package/src/viewBinder.tsx +13 -2
- package/src/viewBindingDecorator.ts +2 -2
- package/tests/connectableComponentTests.tsx +496 -0
- package/tests/espModelContextProviderTests.tsx +142 -0
- package/tests/espRouterContextProviderTests.tsx +54 -0
- package/tests/indexTests.ts +24 -91
- package/tests/testApi/asserts.ts +90 -0
- package/tests/testApi/testApi.tsx +100 -0
- package/tests/testApi/testModel.ts +44 -0
- package/tests/testApi/useStoreReceivedProps.ts +14 -0
- package/tests/testApi/viewFactory.tsx +31 -0
- package/tests/useModelSelectorTests.tsx +47 -153
- package/tests/viewBinderTests.tsx +61 -0
- package/.dist/typings/polimer/getEspReactRenderModel.d.ts +0 -21
- package/.dist/typings/viewBinderConnectable.d.ts +0 -15
- package/src/polimer/getEspReactRenderModel.ts +0 -50
- package/src/viewBinderConnectable.tsx +0 -54
- package/tests/connectableComponentLegacyTests.tsx +0 -405
- /package/.dist/typings/polimer/{polimerExtentsions.d.ts → polimerModelBuilderExtentsions.d.ts} +0 -0
- /package/src/polimer/{polimerExtentsions.ts → polimerModelBuilderExtentsions.ts} +0 -0
- /package/tests/{routerSpy.ts → testApi/routerSpy.ts} +0 -0
package/.dist/esp-react.js
CHANGED
|
@@ -63,9 +63,8 @@ exports.connect = void 0;
|
|
|
63
63
|
const React = __webpack_require__(155);
|
|
64
64
|
const connectableComponent_1 = __webpack_require__(397);
|
|
65
65
|
/**
|
|
66
|
-
* @
|
|
67
|
-
* @param
|
|
68
|
-
* @param createPublishEventProps
|
|
66
|
+
* @param mapModelToProps - maps the model to a different structure, that structure is sent as props to the view.
|
|
67
|
+
* @param createPublishEventProps - creates functions to publish events, the structure is sent as props to the view.
|
|
69
68
|
*/
|
|
70
69
|
const connect = function (mapModelToProps, createPublishEventProps) {
|
|
71
70
|
return function (view) {
|
|
@@ -103,21 +102,16 @@ const react_1 = __webpack_require__(155);
|
|
|
103
102
|
const esp_js_1 = __webpack_require__(152);
|
|
104
103
|
const espModelContextProvider_1 = __webpack_require__(963);
|
|
105
104
|
const viewBindingDecorator_1 = __webpack_require__(213);
|
|
106
|
-
const
|
|
105
|
+
const getEspPolimerImmutableModel_1 = __webpack_require__(894);
|
|
107
106
|
const useModelSelector_1 = __webpack_require__(743);
|
|
108
107
|
const getChildProps = (router, modelId, restProps, initialModel, mapModelToProps, publishEventProps) => {
|
|
109
|
-
|
|
110
|
-
const model = (0, getEspReactRenderModel_1.tryGetRenderModel)(initialModel);
|
|
108
|
+
const model = (0, getEspPolimerImmutableModel_1.tryGetPolimerImmutableModel)(initialModel);
|
|
111
109
|
let childProps = Object.assign(Object.assign(Object.assign({ modelId, router: router }, restProps), publishEventProps), { model });
|
|
112
110
|
if (mapModelToProps) {
|
|
113
111
|
childProps = Object.assign(Object.assign({}, childProps), mapModelToProps(model, publishEventProps));
|
|
114
112
|
}
|
|
115
113
|
return childProps;
|
|
116
114
|
};
|
|
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
115
|
const ConnectableComponent = (_a) => {
|
|
122
116
|
var { modelId, mapModelToProps, createPublishEventProps, view, viewContext } = _a, rest = __rest(_a, ["modelId", "mapModelToProps", "createPublishEventProps", "view", "viewContext"]);
|
|
123
117
|
const router = (0, espRouterContextProvider_1.useRouter)();
|
|
@@ -162,32 +156,49 @@ const espRouterContextProvider_1 = __webpack_require__(169);
|
|
|
162
156
|
const _log = esp_js_1.Logger.create('EspModelContextProvider');
|
|
163
157
|
exports.GetModelIdContext = (0, react_1.createContext)(null);
|
|
164
158
|
/**
|
|
165
|
-
* Returns a function
|
|
159
|
+
* Returns a function to get the ID of the model connected at a higher point in the V-DOM.
|
|
160
|
+
*
|
|
161
|
+
* To use this, please ensure your V-DOM has the EspModelContextProvider at a higher node.
|
|
166
162
|
*/
|
|
167
163
|
const useGetModelId = () => (0, react_1.useContext)(exports.GetModelIdContext)();
|
|
168
164
|
exports.useGetModelId = useGetModelId;
|
|
169
165
|
exports.GetModelContext = (0, react_1.createContext)(null);
|
|
170
166
|
/**
|
|
171
|
-
* Returns a function which will return the model
|
|
167
|
+
* Returns a function which will return the model connected at a higher point in the V-DOM.
|
|
168
|
+
*
|
|
169
|
+
* To use this, please ensure your V-DOM has the EspModelContextProvider at a higher node.
|
|
172
170
|
*/
|
|
173
171
|
const useGetModel = () => (0, react_1.useContext)(exports.GetModelContext)();
|
|
174
172
|
exports.useGetModel = useGetModel;
|
|
175
173
|
exports.PublishModelEventContext = (0, react_1.createContext)(null);
|
|
176
174
|
/**
|
|
177
|
-
* Returns a function which can be used to publish an event to the
|
|
175
|
+
* Returns a function which can be used to publish an event to the model connected at a higher point in the V-DOM.
|
|
178
176
|
*
|
|
179
|
-
* Effectively, this is a version of usePublishEvent() which closes over the
|
|
177
|
+
* Effectively, this is a version of usePublishEvent() which closes over the relevant modelId.
|
|
178
|
+
*
|
|
179
|
+
* To use this, please ensure your V-DOM has the EspModelContextProvider at a higher node.
|
|
180
180
|
*/
|
|
181
181
|
const usePublishModelEvent = () => (0, react_1.useContext)(exports.PublishModelEventContext);
|
|
182
182
|
exports.usePublishModelEvent = usePublishModelEvent;
|
|
183
183
|
exports.PublishModelEventWithEntityKeyContext = (0, react_1.createContext)(null);
|
|
184
184
|
/**
|
|
185
|
-
* Returns a function which can be used to publish an event to the
|
|
185
|
+
* Returns a function which can be used to publish an event to the model connected at a higher point in the V-DOM, allows an entityKey to be specified.
|
|
186
|
+
*
|
|
187
|
+
* Effectively, this is a version of usePublishEvent() which closes over the modelId.
|
|
186
188
|
*
|
|
187
|
-
*
|
|
189
|
+
* To use this, please ensure your V-DOM has the EspModelContextProvider at a higher node.
|
|
188
190
|
*/
|
|
189
191
|
const usePublishModelEventWithEntityKey = () => (0, react_1.useContext)(exports.PublishModelEventWithEntityKeyContext);
|
|
190
192
|
exports.usePublishModelEventWithEntityKey = usePublishModelEventWithEntityKey;
|
|
193
|
+
/**
|
|
194
|
+
* Sets up various ESP context so ESP hooks are available below this point in the V-DOM
|
|
195
|
+
*
|
|
196
|
+
* To use this, please ensure your V-DOM has the EspRouterContextProvider at a higher node.
|
|
197
|
+
* @param modelId
|
|
198
|
+
* @param children
|
|
199
|
+
* @param model
|
|
200
|
+
* @constructor
|
|
201
|
+
*/
|
|
191
202
|
const EspModelContextProvider = ({ modelId, children, model }) => {
|
|
192
203
|
const router = (0, espRouterContextProvider_1.useRouter)();
|
|
193
204
|
const getModelId = (0, react_1.useCallback)(() => {
|
|
@@ -226,8 +237,8 @@ const warnIfModelAccessedOutSideDispatchLoop = (router, modelId) => {
|
|
|
226
237
|
catch (e) {
|
|
227
238
|
stack = e.stack;
|
|
228
239
|
}
|
|
229
|
-
_log.warn(`EspModelContextProvider useGetModelId has been invoked outside of the models (${modelId}) dispatch loop
|
|
230
|
-
`This may have unknown state
|
|
240
|
+
_log.warn(`EspModelContextProvider useGetModelId has been invoked outside of the models (${modelId}) dispatch loop. ` +
|
|
241
|
+
`This may have unknown state issues.` +
|
|
231
242
|
stack);
|
|
232
243
|
}
|
|
233
244
|
};
|
|
@@ -262,13 +273,13 @@ const React = __webpack_require__(155);
|
|
|
262
273
|
const react_1 = __webpack_require__(155);
|
|
263
274
|
exports.RouterContext = (0, react_1.createContext)(null);
|
|
264
275
|
/**
|
|
265
|
-
* Get the esp Router from
|
|
276
|
+
* Get the esp Router from context.
|
|
266
277
|
*
|
|
267
|
-
* To use this, please ensure your V-DOM has the
|
|
278
|
+
* To use this, please ensure your V-DOM has the EspRouterContextProvider at a higher node:
|
|
268
279
|
*
|
|
269
|
-
* <
|
|
280
|
+
* <EspRouterContextProvider router={router}>
|
|
270
281
|
* <YourComponents />
|
|
271
|
-
* </
|
|
282
|
+
* </EspRouterContextProvider>
|
|
272
283
|
*/
|
|
273
284
|
const useRouter = () => {
|
|
274
285
|
const context = (0, react_1.useContext)(exports.RouterContext);
|
|
@@ -282,7 +293,7 @@ exports.PublishEventContext = (0, react_1.createContext)(null);
|
|
|
282
293
|
/**
|
|
283
294
|
* Returns a function which can be used to publish an event.
|
|
284
295
|
*
|
|
285
|
-
* To use this, please ensure your V-DOM has the
|
|
296
|
+
* To use this, please ensure your V-DOM has the EspRouterContextProvider at a higher node:
|
|
286
297
|
*
|
|
287
298
|
* <EspRouterContextProvider router={router}>
|
|
288
299
|
* <YourComponents />
|
|
@@ -313,29 +324,29 @@ exports.RouterProvider = exports.EspRouterContextProvider;
|
|
|
313
324
|
|
|
314
325
|
/***/ }),
|
|
315
326
|
|
|
316
|
-
/***/
|
|
327
|
+
/***/ 894:
|
|
317
328
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
318
329
|
|
|
319
330
|
|
|
320
331
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
321
|
-
exports.
|
|
322
|
-
exports.
|
|
332
|
+
exports.tryGetPolimerImmutableModel = exports.GetEspPolimerImmutableModelConsts = void 0;
|
|
333
|
+
exports.getEspPolimerImmutableModel = getEspPolimerImmutableModel;
|
|
323
334
|
const esp_js_1 = __webpack_require__(152);
|
|
324
|
-
var
|
|
325
|
-
(function (
|
|
326
|
-
|
|
335
|
+
var GetEspPolimerImmutableModelConsts;
|
|
336
|
+
(function (GetEspPolimerImmutableModelConsts) {
|
|
337
|
+
GetEspPolimerImmutableModelConsts.CustomDataKey = 'GetEspReactImmutableModelCustomDataKey';
|
|
327
338
|
/**
|
|
328
|
-
* If there is no @
|
|
339
|
+
* If there is no @getEspPolimerImmutableModel 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
|
|
329
340
|
*/
|
|
330
|
-
|
|
331
|
-
})(
|
|
341
|
+
GetEspPolimerImmutableModelConsts.HandlerFunctionName = 'getEspPolimerImmutableModel';
|
|
342
|
+
})(GetEspPolimerImmutableModelConsts || (exports.GetEspPolimerImmutableModelConsts = GetEspPolimerImmutableModelConsts = {}));
|
|
332
343
|
/**
|
|
333
344
|
* 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
|
|
334
345
|
*/
|
|
335
|
-
function
|
|
346
|
+
function getEspPolimerImmutableModel() {
|
|
336
347
|
return function (target, name, descriptor) {
|
|
337
348
|
let metadata = esp_js_1.EspDecoratorUtil.getOrCreateMetaData(target.constructor);
|
|
338
|
-
metadata.addCustomData(
|
|
349
|
+
metadata.addCustomData(GetEspPolimerImmutableModelConsts.CustomDataKey, { functionName: name });
|
|
339
350
|
return descriptor;
|
|
340
351
|
};
|
|
341
352
|
}
|
|
@@ -345,28 +356,28 @@ function getEspReactRenderModel() {
|
|
|
345
356
|
* This is basically a hook (not a React 'hook') to call a function on `model` and get a new subgraph to use as state.
|
|
346
357
|
*
|
|
347
358
|
*/
|
|
348
|
-
const
|
|
359
|
+
const tryGetPolimerImmutableModel = (model) => {
|
|
349
360
|
// does the given model have a decorated function we can invoke to get a different model to render?
|
|
350
361
|
if (esp_js_1.EspDecoratorUtil.hasMetadata(model)) {
|
|
351
|
-
let metadata = esp_js_1.EspDecoratorUtil.getCustomData(model,
|
|
362
|
+
let metadata = esp_js_1.EspDecoratorUtil.getCustomData(model, GetEspPolimerImmutableModelConsts.CustomDataKey);
|
|
352
363
|
if (metadata) {
|
|
353
364
|
return model[metadata.functionName]();
|
|
354
365
|
}
|
|
355
366
|
}
|
|
356
|
-
// else see if there is a function with name
|
|
357
|
-
let
|
|
358
|
-
if (
|
|
359
|
-
return
|
|
367
|
+
// else see if there is a function with name GetEspPolimerImmutableModelConsts.HandlerFunctionName we can invoke to get a different model to render?
|
|
368
|
+
let immutableModel = model[GetEspPolimerImmutableModelConsts.HandlerFunctionName];
|
|
369
|
+
if (immutableModel && esp_js_1.utils.isFunction(immutableModel)) {
|
|
370
|
+
return immutableModel.call(model);
|
|
360
371
|
}
|
|
361
372
|
// else return the initial model passed in
|
|
362
373
|
return model;
|
|
363
374
|
};
|
|
364
|
-
exports.
|
|
375
|
+
exports.tryGetPolimerImmutableModel = tryGetPolimerImmutableModel;
|
|
365
376
|
|
|
366
377
|
|
|
367
378
|
/***/ }),
|
|
368
379
|
|
|
369
|
-
/***/
|
|
380
|
+
/***/ 185:
|
|
370
381
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
371
382
|
|
|
372
383
|
|
|
@@ -410,7 +421,10 @@ const with_selector_1 = __webpack_require__(614);
|
|
|
410
421
|
const esp_js_1 = __webpack_require__(152);
|
|
411
422
|
const espRouterContextProvider_1 = __webpack_require__(169);
|
|
412
423
|
const espModelContextProvider_1 = __webpack_require__(963);
|
|
413
|
-
const
|
|
424
|
+
const getEspPolimerImmutableModel_1 = __webpack_require__(894);
|
|
425
|
+
/**
|
|
426
|
+
* Convenience API to create ModelSelectorOptions
|
|
427
|
+
*/
|
|
414
428
|
const modelSelectorOptions = () => {
|
|
415
429
|
let modelId = undefined;
|
|
416
430
|
let equalityFn = (a, b) => a === b;
|
|
@@ -440,14 +454,6 @@ const modelSelectorOptions = () => {
|
|
|
440
454
|
};
|
|
441
455
|
};
|
|
442
456
|
exports.modelSelectorOptions = modelSelectorOptions;
|
|
443
|
-
/**
|
|
444
|
-
* A hook which returns model state from the esp Router.
|
|
445
|
-
*
|
|
446
|
-
* This hooks wih observe updates and re-render the component if the model changes.
|
|
447
|
-
*
|
|
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
|
|
450
|
-
*/
|
|
451
457
|
const useModelSelector = (selector, options = (0, exports.modelSelectorOptions)()) => {
|
|
452
458
|
esp_js_1.Guard.isFunction(selector, 'You must pass a selector function to connectSelector');
|
|
453
459
|
const router = (0, espRouterContextProvider_1.useRouter)();
|
|
@@ -468,7 +474,7 @@ const useModelSelector = (selector, options = (0, exports.modelSelectorOptions)(
|
|
|
468
474
|
.subscribe((m) => {
|
|
469
475
|
// try and get a submodel to render
|
|
470
476
|
const nextModel = tryPreSelectPolimerImmutableModel
|
|
471
|
-
? (0,
|
|
477
|
+
? (0, getEspPolimerImmutableModel_1.tryGetPolimerImmutableModel)(m)
|
|
472
478
|
: m;
|
|
473
479
|
// if the above didn't manage to get a submodel,
|
|
474
480
|
// we need to mutate to force useSyncExternalStoreWithSelector to pick up the change
|
|
@@ -556,11 +562,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
556
562
|
exports.ViewBinder = void 0;
|
|
557
563
|
const viewBindingDecorator_1 = __webpack_require__(213);
|
|
558
564
|
const espRouterContextProvider_1 = __webpack_require__(169);
|
|
565
|
+
/**
|
|
566
|
+
* Takes a model with a @viewBinding decorator and dynamically crates the view specified by the decorator
|
|
567
|
+
*/
|
|
559
568
|
const ViewBinder = (_a) => {
|
|
560
569
|
var { model, viewContext } = _a, rest = __rest(_a, ["model", "viewContext"]);
|
|
561
570
|
if (model) {
|
|
562
571
|
const router = (0, espRouterContextProvider_1.useRouter)();
|
|
563
|
-
const newProps = Object.assign({
|
|
572
|
+
const newProps = Object.assign({ model,
|
|
573
|
+
router }, rest);
|
|
564
574
|
return (0, viewBindingDecorator_1.createViewForModel)(model, newProps, viewContext, null);
|
|
565
575
|
}
|
|
566
576
|
return null;
|
|
@@ -568,50 +578,6 @@ const ViewBinder = (_a) => {
|
|
|
568
578
|
exports.ViewBinder = ViewBinder;
|
|
569
579
|
|
|
570
580
|
|
|
571
|
-
/***/ }),
|
|
572
|
-
|
|
573
|
-
/***/ 639:
|
|
574
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
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);
|
|
582
|
-
const React = __webpack_require__(155);
|
|
583
|
-
const useModelSelector_1 = __webpack_require__(743);
|
|
584
|
-
const viewBindingDecorator_1 = __webpack_require__(213);
|
|
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) {
|
|
601
|
-
return null;
|
|
602
|
-
}
|
|
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));
|
|
611
|
-
};
|
|
612
|
-
exports.ViewBinderConnectable = ViewBinderConnectable;
|
|
613
|
-
|
|
614
|
-
|
|
615
581
|
/***/ }),
|
|
616
582
|
|
|
617
583
|
/***/ 213:
|
|
@@ -803,19 +769,17 @@ var exports = __webpack_exports__;
|
|
|
803
769
|
// notice_end
|
|
804
770
|
//
|
|
805
771
|
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.
|
|
772
|
+
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.getEspPolimerImmutableModel = exports.GetEspPolimerImmutableModelConsts = exports.DEFAULT_VIEW_KEY = exports.viewBinding = exports.ViewBinder = void 0;
|
|
807
773
|
// import for side effects
|
|
808
|
-
__webpack_require__(
|
|
774
|
+
__webpack_require__(185);
|
|
809
775
|
var viewBinder_1 = __webpack_require__(453);
|
|
810
776
|
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
777
|
var viewBindingDecorator_1 = __webpack_require__(213);
|
|
814
778
|
Object.defineProperty(exports, "viewBinding", ({ enumerable: true, get: function () { return viewBindingDecorator_1.viewBinding; } }));
|
|
815
779
|
Object.defineProperty(exports, "DEFAULT_VIEW_KEY", ({ enumerable: true, get: function () { return viewBindingDecorator_1.DEFAULT_VIEW_KEY; } }));
|
|
816
|
-
var
|
|
817
|
-
Object.defineProperty(exports, "
|
|
818
|
-
Object.defineProperty(exports, "
|
|
780
|
+
var getEspPolimerImmutableModel_1 = __webpack_require__(894);
|
|
781
|
+
Object.defineProperty(exports, "GetEspPolimerImmutableModelConsts", ({ enumerable: true, get: function () { return getEspPolimerImmutableModel_1.GetEspPolimerImmutableModelConsts; } }));
|
|
782
|
+
Object.defineProperty(exports, "getEspPolimerImmutableModel", ({ enumerable: true, get: function () { return getEspPolimerImmutableModel_1.getEspPolimerImmutableModel; } }));
|
|
819
783
|
var viewBindingDecorator_2 = __webpack_require__(213);
|
|
820
784
|
Object.defineProperty(exports, "createViewForModel", ({ enumerable: true, get: function () { return viewBindingDecorator_2.createViewForModel; } }));
|
|
821
785
|
var connect_1 = __webpack_require__(746);
|
package/.dist/esp-react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esp-react.js","mappings":"AA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,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;;;;;;;;AChHD;;;;;;;ACAA;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;ACtBA,eAAe;AACf;;;;;;;;;;;;;;GAcG;AACH,aAAa;AACb,EAAE;;;AAEF,0BAA0B;AAC1B,yBAAsC;AAEtC,4CAAwC;AAAhC,mHAAU;AAClB,uDAGiC;AAD7B,oJAAqB;AAEzB,sDAAqE;AAA7D,+HAAW;AAAE,yIAAgB;AACrC,wDAI0C;AAFtC,mKAA4B;AAC5B,uJAAsB;AAE1B,sDAA0D;AAAlD,6IAAkB;AAC1B,yCAGmB;AAFf,0GAAO;AAGX,sDAMgC;AAD5B,iJAAoB;AAExB,kDAO4B;AALxB,qIAAgB;AAEhB,6IAAoB;AAIxB,0DAUoC;AAThC,yIAAc;AAEd,6JAAwB;AAExB,uIAAa;AACb,+HAAS;AAET,mJAAmB;AACnB,2IAAe;AAEnB,yDAemC;AAd/B,sIAAa;AAEb,8IAAiB;AACjB,kIAAW;AAEX,0IAAe;AAEf,4JAAwB;AACxB,oJAAoB;AAEpB,sLAAqC;AACrC,8KAAiC;AACjC,0JAAuB","sources":["webpack://esp-js-react/webpack/universalModuleDefinition","webpack://esp-js-react/../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js","webpack://esp-js-react/../../node_modules/use-sync-external-store/with-selector.js","webpack://esp-js-react/./src/connect.tsx","webpack://esp-js-react/./src/connectableComponent.tsx","webpack://esp-js-react/./src/espModelContextProvider.tsx","webpack://esp-js-react/./src/espRouterContextProvider.tsx","webpack://esp-js-react/./src/polimer/getEspReactRenderModel.ts","webpack://esp-js-react/./src/polimer/polimerExtentsions.ts","webpack://esp-js-react/./src/useModelSelector.ts","webpack://esp-js-react/./src/viewBinder.tsx","webpack://esp-js-react/./src/viewBinderConnectable.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 \"react\"","webpack://esp-js-react/webpack/bootstrap","webpack://esp-js-react/./src/index.ts"],"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(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"esp-js\", \"esp-js-polimer\", \"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"esp-js-react\"] = factory(require(\"esp-js\"), require(\"esp-js-polimer\"), require(\"react\"));\n\telse\n\t\troot[\"esp-js-react\"] = factory(root[\"esp-js\"], root[\"esp-js-polimer\"], root[\"react\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__152__, __WEBPACK_EXTERNAL_MODULE__43__, __WEBPACK_EXTERNAL_MODULE__155__) => {\nreturn ","/**\n * @license React\n * use-sync-external-store-with-selector.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';var g=require(\"react\");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;\nexports.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]);\nt(function(){f.hasValue=!0;f.value=d},[d]);v(d);return d};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/use-sync-external-store-with-selector.production.min.js');\n} else {\n module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');\n}\n","import * as React from 'react';\nimport {ConnectableComponent, ConnectableComponentProps, CreatePublishEventProps, MapModelToProps} from './connectableComponent';\n\n/**\n * @deprecated\n */\nexport type ConnectableComponentFactory<TModel, TPublishEventProps, TModelMappedToProps = {}> = (view: React.ComponentType) => (props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) => React.JSX.Element;\n\n/**\n * @deprecated\n * @param mapModelToProps\n * @param createPublishEventProps\n */\nexport const connect = function <TModel, TPublishEventProps, TModelMappedToProps = {}>(\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>,\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>\n): ConnectableComponentFactory<TModel, TPublishEventProps, TModelMappedToProps> {\n return function (view: React.ComponentType) {\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 {useRouter} from './espRouterContextProvider';\nimport {useMemo} from 'react';\nimport {Router, utils} from 'esp-js';\nimport {EspModelContextProvider, useGetModelId} from './espModelContextProvider';\nimport {createViewForModel} from './viewBindingDecorator';\nimport {tryGetRenderModel} from './polimer/getEspReactRenderModel';\nimport {modelSelectorOptions, useModelSelector} from './useModelSelector';\n\n/**\n * @deprecated\n */\nexport type CreatePublishEventProps<TPublishEventProps> = (publishModelEvent: (eventType: string, event: any) => void) => TPublishEventProps;\n\n/**\n * @deprecated\n */\nexport type MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps = {}> = (model: TModel, publishEventProps: TPublishEventProps) => TModelMappedToProps;\n\n/**\n * @deprecated\n */\nexport interface ConnectableComponentProps<TModel = {}, TPublishEventProps = {}, TModelMappedToProps = {}> {\n modelId?: string;\n viewContext?: string;\n view?: React.ComponentType;\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\n/**\n * @deprecated\n */\nexport interface ConnectableComponentChildProps<TModel = object> {\n modelId: string;\n model: TModel;\n router: Router;\n [key: string]: any; // ...rest props\n}\n\nconst getChildProps = <TModel, TModelMappedToProps, TPublishEventProps>(\n router: Router,\n modelId: string,\n restProps: object,\n initialModel: TModel,\n mapModelToProps: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>,\n publishEventProps: TPublishEventProps\n): ConnectableComponentChildProps<TModel> => {\n // consume what this component owns, and let the rest end up in `...rest`\n const model = tryGetRenderModel<TModel>(initialModel);\n let childProps = {\n modelId,\n router: router,\n ...restProps,\n ...publishEventProps,\n model\n };\n if (mapModelToProps) {\n childProps = {\n ...childProps,\n ...(mapModelToProps(model, publishEventProps) as TModelMappedToProps)\n };\n }\n return childProps;\n};\n\n/**\n * @deprecated - use ViewBinderConnectable and ESP hooks if you need to dynamically bind a view to a model\n * or useModelSelector with other ESP hooks for direct model subscription.\n */\nexport const ConnectableComponent = <TModel = {}, TPublishEventProps = {}, TModelMappedToProps = {}>(\n {\n modelId,\n mapModelToProps,\n createPublishEventProps,\n view,\n viewContext,\n ...rest\n }: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>\n) => {\n const router = useRouter();\n modelId = modelId || useGetModelId();\n if (utils.stringIsEmpty(modelId) || !router) {\n return null;\n }\n const publishEventProps: TPublishEventProps = useMemo(\n () => {\n if (createPublishEventProps) {\n const publishModelEvent = (eventType: string, event: any) => {\n router.publishEvent(modelId, eventType, event);\n };\n return createPublishEventProps(publishModelEvent);\n }\n return {} as TPublishEventProps;\n },\n [router, modelId]\n );\n const model = useModelSelector<TModel, TModel>(\n m => m,\n modelSelectorOptions()\n .setModelId(modelId)\n .setTryPreSelectPolimerImmutableModel(false)\n );\n if (model == null) {\n return null;\n }\n let childProps = getChildProps(router, modelId, rest, model, mapModelToProps, publishEventProps);\n let viewElement = createViewForModel(model, childProps, viewContext, view);\n return (\n <EspModelContextProvider modelId={modelId} model={model} router={router} {...childProps}>\n {viewElement}\n </EspModelContextProvider>\n );\n};","import * as React from 'react';\nimport {DefaultModelAddress, Router, Status, Logger, utils} from 'esp-js';\nimport {useContext, useCallback, createContext, PropsWithChildren} from 'react';\nimport {useRouter} from './espRouterContextProvider';\n\nconst _log = Logger.create('EspModelContextProvider');\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 GetModelDelegate = <TModel = any, >() => TModel;\nexport const GetModelContext = createContext<GetModelDelegate>(null);\n/**\n * Returns a function which will return the model set at last dispatch.\n */\nexport const useGetModel = () => useContext(GetModelContext)();\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 EspModelContextProviderProps {\n modelId: string;\n model?: unknown;\n}\n\nexport const EspModelContextProvider = ({modelId, children, model}: PropsWithChildren<EspModelContextProviderProps>) => {\n const router = useRouter();\n const getModelId: () => string = useCallback(() => {\n return modelId;\n }, [router, modelId]);\n const getModel: () => any = useCallback(() => {\n warnIfModelAccessedOutSideDispatchLoop(router, modelId);\n return model;\n }, [model, router, modelId]);\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 <GetModelIdContext.Provider value={getModelId}>\n <PublishModelEventContext.Provider value={publishModelEvent}>\n <PublishModelEventWithEntityKeyContext.Provider value={publishModelEventWithEntityKey}>\n <GetModelContext.Provider value={getModel}>\n {children}\n </GetModelContext.Provider>\n </PublishModelEventWithEntityKeyContext.Provider>\n </PublishModelEventContext.Provider>\n </GetModelIdContext.Provider>\n );\n};\n\nconst warnIfModelAccessedOutSideDispatchLoop = (router: Router, modelId: string) => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (utils.stringIsEmpty(modelId)) {\n return;\n }\n let isDispatchModelUpdateStatus = router.isModelDispatchStatus(modelId, Status.DispatchModelUpdates);\n if (!isDispatchModelUpdateStatus) {\n let stack: string | undefined = undefined;\n try {\n // noinspection ExceptionCaughtLocallyJS\n throw new Error();\n } catch (e) {\n stack = (e as Error).stack;\n }\n _log.warn(\n `EspModelContextProvider useGetModelId has been invoked outside of the models (${modelId}) dispatch loop.` +\n `This may have unknown state state issues.` +\n stack\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 {ModelAddress, Router} from 'esp-js';\nimport {PropsWithChildren, createContext, useContext, useCallback} from 'react';\n\nexport const RouterContext = createContext<Router>(null);\n\n/**\n * Get the esp Router from the RouterContext\n *\n * To use this, please ensure your V-DOM has the EspRouterContext at a higher node:\n *\n * <EspRouterContext router={router}>\n * <YourComponents />\n * </EspRouterContext>\n */\nexport const useRouter = () => {\n const context: Router = useContext(RouterContext);\n if (context === undefined) {\n throw new Error('useRouter must be used within a RouterContext.Provider');\n }\n return context;\n};\n\nexport type PublishEventDelegate = (modelIdOrModelAddress: string | ModelAddress, eventType: string, event: any) => void;\nexport const PublishEventContext = createContext<PublishEventDelegate>(null);\n\n/**\n * Returns a function which can be used to publish an event.\n *\n * To use this, please ensure your V-DOM has the EspRouterContext at a higher node:\n *\n * <EspRouterContextProvider router={router}>\n * <YourComponents />\n * </EspRouterContextProvider>\n */\nexport const usePublishEvent = () => useContext(PublishEventContext);\n\nexport type EspRouterContextProviderProps = PropsWithChildren<{ router: Router; }>;\n\n/**\n * Used to set the router on the RouterContext making it available to components down the tree via the useRouter() hook.\n *\n * Also sets up the usePublishEvent() hook so nested components can publish to the router.\n */\nexport const EspRouterContextProvider = ({children, router}: EspRouterContextProviderProps) => {\n const publishEvent: PublishEventDelegate = useCallback((modelIdOrModelAddress: string, eventType: string, event: any) => {\n router.publishEvent(modelIdOrModelAddress, eventType, event);\n }, [router]);\n return (\n <RouterContext.Provider value={router}>\n <PublishEventContext.Provider value={publishEvent}>\n {children}\n </PublishEventContext.Provider>\n </RouterContext.Provider>\n );\n};\n\n/**\n * Used to set the router on the RouterContext making it available to components down the tree (via useRouter()).\n *\n * @deprecated use EspRouterContextProvider\n */\nexport const RouterProvider = EspRouterContextProvider;\n\n/**\n * Props for RouterProvider\n *\n * @deprecated use EspRouterContextProviderProps\n */\nexport type RouterProviderProps = EspRouterContextProviderProps;\n","import {EspMetadata, EspDecoratorUtil, utils} 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}\n\n/**\n * Returns the model which will be used to pluck state/props for the current view.\n *\n * This is basically a hook (not a React 'hook') to call a function on `model` and get a new subgraph to use as state.\n *\n */\nexport const tryGetRenderModel = <TRenderModel>(model: any): TRenderModel => {\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 return the initial model passed in\n return model;\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","import {useMemo} from 'react';\nimport {useSyncExternalStoreWithSelector} from 'use-sync-external-store/with-selector';\nimport {Guard, utils} from 'esp-js';\nimport {useRouter} from './espRouterContextProvider';\nimport {useGetModelId} from './espModelContextProvider';\nimport {tryGetRenderModel} from './polimer/getEspReactRenderModel';\n\nexport type ModelSelectorEqualityFn<T> = (last: T, next: T) => boolean;\n\n/**\n * @param modelId - the modelId of the model to be observed via the esp Router.\n * @param tryPreSelectPolimerImmutableModel - if true, and the esp model is an esp-js-polimer model, the immutable model will be used when calling the selector.\n * @param equalityFn - Equality function which will be applied against TSelected, defaults to instance equality (a === b).\n */\nexport type ModelSelectorOptions<TSelected> = {\n modelId?: string,\n tryPreSelectPolimerImmutableModel: boolean,\n equalityFn: ModelSelectorEqualityFn<TSelected>\n};\n\nexport interface EditableModelSelectorOptions<TSelected> extends ModelSelectorOptions<TSelected> {\n setModelId(modelId: string): this;\n\n setTryPreSelectPolimerImmutableModel(value: boolean): this;\n\n setEqualityFn(fn: (a: TSelected, b: TSelected) => boolean): this;\n}\n\nexport const modelSelectorOptions = <TSelected>() => {\n let modelId = undefined;\n let equalityFn: ModelSelectorEqualityFn<TSelected> = (a: TSelected, b: TSelected) => a === b;\n let tryPreSelectPolimerImmutableModel = true;\n return {\n get modelId() {\n return modelId;\n },\n setModelId(value: string) {\n modelId = value;\n return this;\n },\n get equalityFn() {\n return equalityFn;\n },\n setEqualityFn(value: ModelSelectorEqualityFn<TSelected>) {\n equalityFn = value;\n return this;\n },\n get tryPreSelectPolimerImmutableModel() {\n return tryPreSelectPolimerImmutableModel;\n },\n setTryPreSelectPolimerImmutableModel(value: boolean) {\n tryPreSelectPolimerImmutableModel = value;\n return this;\n }\n } as EditableModelSelectorOptions<TSelected>;\n};\n\nexport type UseModelSelector = <TModel, TSelected>(\n selector: (model: TModel) => TSelected,\n options?: ModelSelectorOptions<TSelected>\n) => TSelected;\n\n/**\n * A hook which returns model state from the esp Router.\n *\n * This hooks wih observe updates and re-render the component if the model changes.\n *\n * @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.\n * @param options\n */\nexport const useModelSelector: UseModelSelector = <TModel, TSelected>(\n selector: (model: TModel) => TSelected,\n options: ModelSelectorOptions<TSelected> = modelSelectorOptions<TSelected>()\n) => {\n Guard.isFunction(selector, 'You must pass a selector function to connectSelector');\n const router = useRouter();\n const modelId = options?.modelId || useGetModelId();\n const tryPreSelectPolimerImmutableModel = options?.tryPreSelectPolimerImmutableModel;\n const equalityFn = options?.equalityFn;\n const dependencies = useMemo(\n () => {\n // Because of how useSyncExternalStore works, there is an implicit dependency between the subscribe and getSnapshot functions.\n // 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.\n // Given that, we need to cache the state which getSnapshot will return.\n //\n // It's not ideal but shouldn't be a problem as here we've wrapped all these dependent functions inside a single useMemo()\n let model: TModel = null;\n return {\n subscribe: (stateChanged: () => void) => {\n const modelSubscriptionDisposable = router\n .getModelObservable(modelId)\n .subscribe(\n (m: any) => {\n // try and get a submodel to render\n const nextModel = tryPreSelectPolimerImmutableModel\n ? tryGetRenderModel(m)\n : m;\n // if the above didn't manage to get a submodel,\n // we need to mutate to force useSyncExternalStoreWithSelector to pick up the change\n model = nextModel === m\n ? Object.create(nextModel)\n : nextModel;\n stateChanged();\n }\n );\n return () => {\n model = null;\n modelSubscriptionDisposable.dispose();\n };\n },\n // React expects getSnapshot to be immutable, it'll only re-render if the instance changes\n getSnapshot: () => {\n return model;\n },\n // While getSnapshot needs to model to be immutable,\n // useSyncExternalStoreWithSelector builds on top of this, so the TSelected can defer to an equality check to determine if the change is propagated.\n // The selector here just maps the TSelected, useSyncExternalStoreWithSelector internally does the equality check.\n wrappedSelector: (snapshot: TModel) => {\n // The first time this renders, react calls getSnapshot and the selector before the router has pushed a change.\n // In that case, there is no state for any component to process, therefore, we return null;\n return snapshot\n ? selector(snapshot)\n : null;\n }\n };\n },\n // Don't cache check against 'selector' argument as that will likely change unless the caller memoizes it.\n [router, modelId]\n );\n\n // If we don't have a modelId, we still need to return a hook so React doesn't complain.\n // Additionally, we need to let the above expiration (dependencies) run to unsubscribe from any previous subscription.\n if (utils.stringIsEmpty(modelId)) {\n return useSyncExternalStoreWithSelector(\n noopSubscription.subscribe,\n noopSubscription.getSnapshot,\n undefined,\n noopSubscription.wrappedSelector,\n equalityFn\n );\n }\n\n // Docs on useSyncExternalStore https://github.com/reactwg/react-18/discussions/86\n // Redux's usage of this: https://github.com/reduxjs/react-redux/blob/master/src/hooks/useSelector.ts\n // Code: https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreWithSelector.js\n return useSyncExternalStoreWithSelector(\n dependencies.subscribe,\n dependencies.getSnapshot,\n undefined,\n dependencies.wrappedSelector,\n equalityFn,\n );\n};\n\nconst noopSubscription = {\n subscribe: () => { },\n getSnapshot: () => null,\n wrappedSelector: () => true\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 {createViewForModel} from './viewBindingDecorator';\nimport {useRouter} from './espRouterContextProvider';\n\nexport interface ViewBinderProps {\n model: any;\n viewContext: string;\n}\n\nexport const ViewBinder: React.FC<ViewBinderProps> = ({model, viewContext, ...rest}) => {\n if (model) {\n const router = useRouter();\n const newProps = Object.assign({}, {model, router}, rest);\n return createViewForModel(\n model,\n newProps,\n viewContext,\n null\n );\n }\n return null;\n};","import {useRouter} from './espRouterContextProvider';\nimport {EspModelContextProvider} from './espModelContextProvider';\nimport {Logger, Router} from 'esp-js';\nimport * as React from 'react';\nimport {modelSelectorOptions, useModelSelector} from './useModelSelector';\nimport {createViewForModel} from './viewBindingDecorator';\nimport {tryGetRenderModel} from './polimer/getEspReactRenderModel';\n\nconst _log = Logger.create('ViewBinderConnectable');\n\nexport interface ViewBinderConnectableProps {\n modelId?: string;\n viewContext?: string;\n view?: React.ComponentType;\n}\n\ninterface ViewBinderConnectableChildProps {\n modelId: string;\n model: object;\n router: Router;\n}\n\n/**\n * Dynamically binds a view found via @viewBinder(SomeJsXView) to a model managed by the Router.\n * Optionally provide a view override and/or a viewContext\n * @param modelId\n * @param viewContext\n * @param view\n * @constructor\n */\nexport const ViewBinderConnectable = ({modelId, viewContext, view}: ViewBinderConnectableProps) => {\n const router = useRouter();\n const model = useModelSelector<object, object>(\n m => m,\n modelSelectorOptions()\n .setModelId(modelId)\n .setTryPreSelectPolimerImmutableModel(false)\n );\n if (!model) {\n return null;\n }\n let renderModel = tryGetRenderModel<object>(model);\n const childProps: ViewBinderConnectableChildProps = {\n modelId,\n router: router,\n model: renderModel\n };\n let viewElement = createViewForModel(model, childProps, viewContext, view);\n return (\n <EspModelContextProvider modelId={modelId} router={router} model={renderModel} {...childProps}>\n {viewElement}\n </EspModelContextProvider>\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';\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: React.ComponentType) {\n let finalView: React.ComponentType = 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__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","// 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 {ViewBinder} from './viewBinder';\nexport {\n ViewBinderConnectableProps,\n ViewBinderConnectable\n} from './viewBinderConnectable';\nexport {viewBinding, DEFAULT_VIEW_KEY} from './viewBindingDecorator';\nexport {\n GetEspReactRenderModelMetadata,\n GetEspReactRenderModelConsts,\n getEspReactRenderModel\n} from './polimer/getEspReactRenderModel';\nexport {createViewForModel} from './viewBindingDecorator';\nexport {\n connect,\n ConnectableComponentFactory\n} from './connect';\nexport {\n CreatePublishEventProps,\n MapModelToProps,\n ConnectableComponentProps,\n ConnectableComponentChildProps,\n ConnectableComponent,\n} from './connectableComponent';\nexport {\n UseModelSelector,\n useModelSelector,\n EditableModelSelectorOptions,\n modelSelectorOptions,\n ModelSelectorOptions,\n ModelSelectorEqualityFn,\n} from './useModelSelector';\nexport {\n RouterProvider,\n RouterProviderProps,\n EspRouterContextProvider,\n EspRouterContextProviderProps,\n RouterContext,\n useRouter,\n PublishEventDelegate,\n PublishEventContext,\n usePublishEvent,\n} from './espRouterContextProvider';\nexport {\n useGetModelId,\n GetModelIdDelegate,\n GetModelIdContext,\n useGetModel,\n GetModelDelegate,\n GetModelContext,\n PublishModelEventDelegate,\n PublishModelEventContext,\n usePublishModelEvent,\n PublishModelEventWithEntityKeyDelegate,\n PublishModelEventWithEntityKeyContext,\n usePublishModelEventWithEntityKey,\n EspModelContextProvider,\n EspModelContextProviderProps,\n} from './espModelContextProvider';\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"esp-react.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACa,MAAM,mBAAO,CAAC,GAAO,EAAE,gBAAgB,+CAA+C;AACnG,wCAAwC,qBAAqB,cAAc,qBAAqB,OAAO,wBAAwB,YAAY,iBAAiB,eAAe,cAAc,OAAO,KAAK,IAAI,OAAO,2BAA2B,cAAc,qBAAqB,WAAW,IAAI,mBAAmB,WAAW,+BAA+B,IAAI,WAAW,iCAAiC,kBAAkB,cAAc,4BAA4B,cAAc,EAAE,YAAY;AACle,aAAa,cAAc,UAAU,MAAM,KAAK;;;;;;;;ACXnC;;AAEb,IAAI,IAAqC;AACzC,EAAE,yCAAyF;AAC3F,EAAE,KAAK,EAEN;;;;;;;;;;;;;;;;;;;;;;ACND,uCAA+B;AAC/B,wDAAiI;AAIjI;;;GAGG;AACI,MAAM,OAAO,GAAG,UACnB,eAAkF,EAClF,uBAAqE;IAErE,OAAO,UAAU,IAAyB;QACtC,OAAO,UAAU,KAAiF;YAC9F,MAAM,EAAC,OAAO,EAAE,WAAW,KAAa,KAAK,EAAb,IAAI,UAAI,KAAK,EAAvC,0BAA+B,CAAQ,CAAC;YAC9C,OAAO,oBAAC,2CAAoB,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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C;AAd/B,sIAAa;AAEb,8IAAiB;AACjB,kIAAW;AAEX,0IAAe;AAEf,4JAAwB;AACxB,oJAAoB;AAEpB,sLAAqC;AACrC,8KAAiC;AACjC,0JAAuB","sources":["webpack://esp-js-react/webpack/universalModuleDefinition","webpack://esp-js-react/../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js","webpack://esp-js-react/../../node_modules/use-sync-external-store/with-selector.js","webpack://esp-js-react/./src/connect.tsx","webpack://esp-js-react/./src/connectableComponent.tsx","webpack://esp-js-react/./src/espModelContextProvider.tsx","webpack://esp-js-react/./src/espRouterContextProvider.tsx","webpack://esp-js-react/./src/polimer/getEspPolimerImmutableModel.ts","webpack://esp-js-react/./src/polimer/polimerModelBuilderExtentsions.ts","webpack://esp-js-react/./src/useModelSelector.ts","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 \"react\"","webpack://esp-js-react/webpack/bootstrap","webpack://esp-js-react/./src/index.ts"],"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(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"esp-js\", \"esp-js-polimer\", \"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"esp-js-react\"] = factory(require(\"esp-js\"), require(\"esp-js-polimer\"), require(\"react\"));\n\telse\n\t\troot[\"esp-js-react\"] = factory(root[\"esp-js\"], root[\"esp-js-polimer\"], root[\"react\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__152__, __WEBPACK_EXTERNAL_MODULE__43__, __WEBPACK_EXTERNAL_MODULE__155__) => {\nreturn ","/**\n * @license React\n * use-sync-external-store-with-selector.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';var g=require(\"react\");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;\nexports.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]);\nt(function(){f.hasValue=!0;f.value=d},[d]);v(d);return d};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/use-sync-external-store-with-selector.production.min.js');\n} else {\n module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');\n}\n","import * as React from 'react';\nimport {ConnectableComponent, ConnectableComponentProps, CreatePublishEventProps, MapModelToProps} from './connectableComponent';\n\nexport type ConnectableComponentFactory<TModel, TPublishEventProps, TModelMappedToProps = {}> = (view: React.ComponentType) => (props: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>) => React.JSX.Element;\n\n/**\n * @param mapModelToProps - maps the model to a different structure, that structure is sent as props to the view.\n * @param createPublishEventProps - creates functions to publish events, the structure is sent as props to the view.\n */\nexport const connect = function <TModel, TPublishEventProps, TModelMappedToProps = {}>(\n mapModelToProps?: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>,\n createPublishEventProps?: CreatePublishEventProps<TPublishEventProps>\n): ConnectableComponentFactory<TModel, TPublishEventProps, TModelMappedToProps> {\n return function (view: React.ComponentType) {\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 {useRouter} from './espRouterContextProvider';\nimport {useMemo} from 'react';\nimport {Router, utils} from 'esp-js';\nimport {EspModelContextProvider, useGetModelId} from './espModelContextProvider';\nimport {createViewForModel} from './viewBindingDecorator';\nimport {tryGetPolimerImmutableModel} from './polimer/getEspPolimerImmutableModel';\nimport {modelSelectorOptions, useModelSelector} from './useModelSelector';\n\nexport type CreatePublishEventProps<TPublishEventProps> = (publishModelEvent: (eventType: string, event: any) => void) => TPublishEventProps;\n\nexport type MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps = {}> = (model: TModel, publishEventProps: TPublishEventProps) => TModelMappedToProps;\n\nexport interface ConnectableComponentProps<TModel = {}, TPublishEventProps = {}, TModelMappedToProps = {}> {\n modelId?: string;\n viewContext?: string;\n view?: React.ComponentType;\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 = object> {\n modelId: string;\n model: TModel;\n router: Router;\n [key: string]: any; // ...rest props\n}\n\nconst getChildProps = <TModel, TModelMappedToProps, TPublishEventProps>(\n router: Router,\n modelId: string,\n restProps: object,\n initialModel: TModel,\n mapModelToProps: MapModelToProps<TModel, TModelMappedToProps, TPublishEventProps>,\n publishEventProps: TPublishEventProps\n): ConnectableComponentChildProps<TModel> => {\n const model = tryGetPolimerImmutableModel<TModel>(initialModel);\n let childProps = {\n modelId,\n router: router,\n ...restProps,\n ...publishEventProps,\n model\n };\n if (mapModelToProps) {\n childProps = {\n ...childProps,\n ...(mapModelToProps(model, publishEventProps) as TModelMappedToProps)\n };\n }\n return childProps;\n};\n\nexport const ConnectableComponent = <TModel = {}, TPublishEventProps = {}, TModelMappedToProps = {}>(\n {\n modelId,\n mapModelToProps,\n createPublishEventProps,\n view,\n viewContext,\n ...rest\n }: ConnectableComponentProps<TModel, TPublishEventProps, TModelMappedToProps>\n) => {\n const router = useRouter();\n modelId = modelId || useGetModelId();\n if (utils.stringIsEmpty(modelId) || !router) {\n return null;\n }\n const publishEventProps: TPublishEventProps = useMemo(\n () => {\n if (createPublishEventProps) {\n const publishModelEvent = (eventType: string, event: any) => {\n router.publishEvent(modelId, eventType, event);\n };\n return createPublishEventProps(publishModelEvent);\n }\n return {} as TPublishEventProps;\n },\n [router, modelId]\n );\n const model = useModelSelector<TModel, TModel>(\n m => m,\n modelSelectorOptions()\n .setModelId(modelId)\n .setTryPreSelectPolimerImmutableModel(false)\n );\n if (model == null) {\n return null;\n }\n let childProps = getChildProps(router, modelId, rest, model, mapModelToProps, publishEventProps);\n let viewElement = createViewForModel(model, childProps, viewContext, view);\n return (\n <EspModelContextProvider modelId={modelId} model={model} router={router} {...childProps}>\n {viewElement}\n </EspModelContextProvider>\n );\n};","import * as React from 'react';\nimport {DefaultModelAddress, Router, Status, Logger, utils} from 'esp-js';\nimport {useContext, useCallback, createContext, PropsWithChildren} from 'react';\nimport {useRouter} from './espRouterContextProvider';\n\nconst _log = Logger.create('EspModelContextProvider');\n\nexport type GetModelIdDelegate = () => string;\nexport const GetModelIdContext = createContext<GetModelIdDelegate>(null);\n/**\n * Returns a function to get the ID of the model connected at a higher point in the V-DOM.\n *\n * To use this, please ensure your V-DOM has the EspModelContextProvider at a higher node.\n */\nexport const useGetModelId = () => useContext(GetModelIdContext)();\n\nexport type GetModelDelegate = <TModel = any, >() => TModel;\nexport const GetModelContext = createContext<GetModelDelegate>(null);\n/**\n * Returns a function which will return the model connected at a higher point in the V-DOM.\n *\n * To use this, please ensure your V-DOM has the EspModelContextProvider at a higher node.\n */\nexport const useGetModel = <TModel,>() => useContext(GetModelContext)() as TModel;\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 model connected at a higher point in the V-DOM.\n *\n * Effectively, this is a version of usePublishEvent() which closes over the relevant modelId.\n *\n * To use this, please ensure your V-DOM has the EspModelContextProvider at a higher node.\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 model connected at a higher point in the V-DOM, allows an entityKey to be specified.\n *\n * Effectively, this is a version of usePublishEvent() which closes over the modelId.\n *\n * To use this, please ensure your V-DOM has the EspModelContextProvider at a higher node.\n */\nexport const usePublishModelEventWithEntityKey = () => useContext(PublishModelEventWithEntityKeyContext);\n\nexport interface EspModelContextProviderProps {\n modelId: string;\n model?: unknown;\n}\n\n/**\n * Sets up various ESP context so ESP hooks are available below this point in the V-DOM\n *\n * To use this, please ensure your V-DOM has the EspRouterContextProvider at a higher node.\n * @param modelId\n * @param children\n * @param model\n * @constructor\n */\nexport const EspModelContextProvider = ({modelId, children, model}: PropsWithChildren<EspModelContextProviderProps>) => {\n const router = useRouter();\n const getModelId: () => string = useCallback(() => {\n return modelId;\n }, [router, modelId]);\n const getModel: () => any = useCallback(() => {\n warnIfModelAccessedOutSideDispatchLoop(router, modelId);\n return model;\n }, [model, router, modelId]);\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 <GetModelIdContext.Provider value={getModelId}>\n <PublishModelEventContext.Provider value={publishModelEvent}>\n <PublishModelEventWithEntityKeyContext.Provider value={publishModelEventWithEntityKey}>\n <GetModelContext.Provider value={getModel}>\n {children}\n </GetModelContext.Provider>\n </PublishModelEventWithEntityKeyContext.Provider>\n </PublishModelEventContext.Provider>\n </GetModelIdContext.Provider>\n );\n};\n\nconst warnIfModelAccessedOutSideDispatchLoop = (router: Router, modelId: string) => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (utils.stringIsEmpty(modelId)) {\n return;\n }\n let isDispatchModelUpdateStatus = router.isModelDispatchStatus(modelId, Status.DispatchModelUpdates);\n if (!isDispatchModelUpdateStatus) {\n let stack: string | undefined = undefined;\n try {\n // noinspection ExceptionCaughtLocallyJS\n throw new Error();\n } catch (e) {\n stack = (e as Error).stack;\n }\n _log.warn(\n `EspModelContextProvider useGetModelId has been invoked outside of the models (${modelId}) dispatch loop. ` +\n `This may have unknown state issues.` +\n stack\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 {ModelAddress, Router} from 'esp-js';\nimport {PropsWithChildren, createContext, useContext, useCallback} from 'react';\n\nexport const RouterContext = createContext<Router>(null);\n\n/**\n * Get the esp Router from context.\n *\n * To use this, please ensure your V-DOM has the EspRouterContextProvider at a higher node:\n *\n * <EspRouterContextProvider router={router}>\n * <YourComponents />\n * </EspRouterContextProvider>\n */\nexport const useRouter = () => {\n const context: Router = useContext(RouterContext);\n if (context === undefined) {\n throw new Error('useRouter must be used within a RouterContext.Provider');\n }\n return context;\n};\n\nexport type PublishEventDelegate = (modelIdOrModelAddress: string | ModelAddress, eventType: string, event: any) => void;\nexport const PublishEventContext = createContext<PublishEventDelegate>(null);\n\n/**\n * Returns a function which can be used to publish an event.\n *\n * To use this, please ensure your V-DOM has the EspRouterContextProvider at a higher node:\n *\n * <EspRouterContextProvider router={router}>\n * <YourComponents />\n * </EspRouterContextProvider>\n */\nexport const usePublishEvent = () => useContext(PublishEventContext);\n\nexport type EspRouterContextProviderProps = PropsWithChildren<{ router: Router; }>;\n\n/**\n * Used to set the router on the RouterContext making it available to components down the tree via the useRouter() hook.\n *\n * Also sets up the usePublishEvent() hook so nested components can publish to the router.\n */\nexport const EspRouterContextProvider = ({children, router}: EspRouterContextProviderProps) => {\n const publishEvent: PublishEventDelegate = useCallback((modelIdOrModelAddress: string, eventType: string, event: any) => {\n router.publishEvent(modelIdOrModelAddress, eventType, event);\n }, [router]);\n return (\n <RouterContext.Provider value={router}>\n <PublishEventContext.Provider value={publishEvent}>\n {children}\n </PublishEventContext.Provider>\n </RouterContext.Provider>\n );\n};\n\n/**\n * Used to set the router on the RouterContext making it available to components down the tree (via useRouter()).\n *\n * @deprecated use EspRouterContextProvider\n */\nexport const RouterProvider = EspRouterContextProvider;\n\n/**\n * Props for RouterProvider\n *\n * @deprecated use EspRouterContextProviderProps\n */\nexport type RouterProviderProps = EspRouterContextProviderProps;\n","import {EspMetadata, EspDecoratorUtil, utils} from 'esp-js';\n\nexport interface GetEspPolimerImmutableModelMetadata {\n functionName: string;\n}\n\nexport namespace GetEspPolimerImmutableModelConsts {\n export const CustomDataKey = 'GetEspReactImmutableModelCustomDataKey';\n /**\n * If there is no @getEspPolimerImmutableModel 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 = 'getEspPolimerImmutableModel';\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 getEspPolimerImmutableModel() {\n return function (target, name, descriptor) {\n let metadata: EspMetadata = EspDecoratorUtil.getOrCreateMetaData(target.constructor);\n metadata.addCustomData(\n GetEspPolimerImmutableModelConsts.CustomDataKey,\n <GetEspPolimerImmutableModelMetadata>{ functionName: name }\n );\n return descriptor;\n };\n}\n\n/**\n * Returns the model which will be used to pluck state/props for the current view.\n *\n * This is basically a hook (not a React 'hook') to call a function on `model` and get a new subgraph to use as state.\n *\n */\nexport const tryGetPolimerImmutableModel = <TImmutableModel>(model: any): TImmutableModel => {\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: GetEspPolimerImmutableModelMetadata = EspDecoratorUtil.getCustomData(model, GetEspPolimerImmutableModelConsts.CustomDataKey);\n if (metadata) {\n return model[metadata.functionName]();\n }\n }\n // else see if there is a function with name GetEspPolimerImmutableModelConsts.HandlerFunctionName we can invoke to get a different model to render?\n let immutableModel = model[GetEspPolimerImmutableModelConsts.HandlerFunctionName];\n if (immutableModel && utils.isFunction(immutableModel)) {\n return immutableModel.call(model);\n }\n // else return the initial model passed in\n return model;\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","import {useMemo} from 'react';\nimport {useSyncExternalStoreWithSelector} from 'use-sync-external-store/with-selector';\nimport {Guard, utils} from 'esp-js';\nimport {useRouter} from './espRouterContextProvider';\nimport {useGetModelId} from './espModelContextProvider';\nimport {tryGetPolimerImmutableModel} from './polimer/getEspPolimerImmutableModel';\n\nexport type ModelSelectorEqualityFn<T> = (last: T, next: T) => boolean;\n\n/**\n * Options affecting the subscription of the model to the Router.\n *\n * Use modelSelectorOptions() to create an instance of this type with sensible defaults.\n *\n * @param modelId - the modelId of the model to be observed via the esp Router.\n * @param tryPreSelectPolimerImmutableModel - if true, and the esp model is an esp-js-polimer model, the immutable model will be used when calling the selector.\n * @param equalityFn - Equality function which will be applied against TSelected, defaults to instance equality (a === b).\n */\nexport type ModelSelectorOptions<TSelected> = {\n modelId?: string,\n tryPreSelectPolimerImmutableModel: boolean,\n equalityFn: ModelSelectorEqualityFn<TSelected>\n};\n\n/**\n * Convenience API to build ModelSelectorOptions<TSelected>, has sensible defaulting.\n */\nexport interface EditableModelSelectorOptions<TSelected> extends ModelSelectorOptions<TSelected> {\n /**\n * Sets the model ID\n * @param modelId - default if unset: undefined\n */\n setModelId(modelId: string): this;\n\n /**\n * If the model is a PolimerModel and this set true, PolimerModel.getImmutableModel() will be selected by default.\n * @param value - default if unset: true\n */\n setTryPreSelectPolimerImmutableModel(value: boolean): this;\n\n /**\n * Equality function used when comparing the last TSelected with the next.\n * @param fn - default if unset: obj instance equality (e.g. a===b)\n */\n setEqualityFn(fn: (a: TSelected, b: TSelected) => boolean): this;\n}\n\n/**\n * Convenience API to create ModelSelectorOptions\n */\nexport const modelSelectorOptions = <TSelected>() => {\n let modelId = undefined;\n let equalityFn: ModelSelectorEqualityFn<TSelected> = (a: TSelected, b: TSelected) => a === b;\n let tryPreSelectPolimerImmutableModel = true;\n return {\n get modelId() {\n return modelId;\n },\n setModelId(value: string) {\n modelId = value;\n return this;\n },\n get equalityFn() {\n return equalityFn;\n },\n setEqualityFn(value: ModelSelectorEqualityFn<TSelected>) {\n equalityFn = value;\n return this;\n },\n get tryPreSelectPolimerImmutableModel() {\n return tryPreSelectPolimerImmutableModel;\n },\n setTryPreSelectPolimerImmutableModel(value: boolean) {\n tryPreSelectPolimerImmutableModel = value;\n return this;\n }\n } as EditableModelSelectorOptions<TSelected>;\n};\n\n/**\n * A hook which returns model state from the esp Router.\n *\n * This hooks wih observe updates and re-render the component if the model changes.\n *\n * To use this, please ensure your V-DOM has the EspRouterContextProvider at a higher node, and optionally EspModelContextProvider.\n *\n * @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.\n * @param options\n */\nexport type UseModelSelector = <TModel, TSelected>(\n selector: (model: TModel) => TSelected,\n options?: ModelSelectorOptions<TSelected>\n) => TSelected;\n\nexport const useModelSelector: UseModelSelector = <TModel, TSelected>(\n selector: (model: TModel) => TSelected,\n options: ModelSelectorOptions<TSelected> = modelSelectorOptions<TSelected>()\n) => {\n Guard.isFunction(selector, 'You must pass a selector function to connectSelector');\n const router = useRouter();\n const modelId = options?.modelId || useGetModelId();\n const tryPreSelectPolimerImmutableModel = options?.tryPreSelectPolimerImmutableModel;\n const equalityFn = options?.equalityFn;\n const dependencies = useMemo(\n () => {\n // Because of how useSyncExternalStore works, there is an implicit dependency between the subscribe and getSnapshot functions.\n // 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.\n // Given that, we need to cache the state which getSnapshot will return.\n //\n // It's not ideal but shouldn't be a problem as here we've wrapped all these dependent functions inside a single useMemo()\n let model: TModel = null;\n return {\n subscribe: (stateChanged: () => void) => {\n const modelSubscriptionDisposable = router\n .getModelObservable(modelId)\n .subscribe(\n (m: any) => {\n // try and get a submodel to render\n const nextModel = tryPreSelectPolimerImmutableModel\n ? tryGetPolimerImmutableModel(m)\n : m;\n // if the above didn't manage to get a submodel,\n // we need to mutate to force useSyncExternalStoreWithSelector to pick up the change\n model = nextModel === m\n ? Object.create(nextModel)\n : nextModel;\n stateChanged();\n }\n );\n return () => {\n model = null;\n modelSubscriptionDisposable.dispose();\n };\n },\n // React expects getSnapshot to be immutable, it'll only re-render if the instance changes\n getSnapshot: () => {\n return model;\n },\n // While getSnapshot needs to model to be immutable,\n // useSyncExternalStoreWithSelector builds on top of this, so the TSelected can defer to an equality check to determine if the change is propagated.\n // The selector here just maps the TSelected, useSyncExternalStoreWithSelector internally does the equality check.\n wrappedSelector: (snapshot: TModel) => {\n // The first time this renders, react calls getSnapshot and the selector before the router has pushed a change.\n // In that case, there is no state for any component to process, therefore, we return null;\n return snapshot\n ? selector(snapshot)\n : null;\n }\n };\n },\n // Don't cache check against 'selector' argument as that will likely change unless the caller memoizes it.\n [router, modelId]\n );\n\n // If we don't have a modelId, we still need to return a hook so React doesn't complain.\n // Additionally, we need to let the above expiration (dependencies) run to unsubscribe from any previous subscription.\n if (utils.stringIsEmpty(modelId)) {\n return useSyncExternalStoreWithSelector(\n noopSubscription.subscribe,\n noopSubscription.getSnapshot,\n undefined,\n noopSubscription.wrappedSelector,\n equalityFn\n );\n }\n\n // Docs on useSyncExternalStore https://github.com/reactwg/react-18/discussions/86\n // Redux's usage of this: https://github.com/reduxjs/react-redux/blob/master/src/hooks/useSelector.ts\n // Code: https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreWithSelector.js\n return useSyncExternalStoreWithSelector(\n dependencies.subscribe,\n dependencies.getSnapshot,\n undefined,\n dependencies.wrappedSelector,\n equalityFn,\n );\n};\n\nconst noopSubscription = {\n subscribe: () => { },\n getSnapshot: () => null,\n wrappedSelector: () => true\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 {createViewForModel} from './viewBindingDecorator';\nimport {useRouter} from './espRouterContextProvider';\n\nexport interface ViewBinderProps {\n model: any;\n viewContext?: string;\n /**\n * ...rest props, these will be passed to the child\n */\n [key: string]: any;\n}\n\n/**\n * Takes a model with a @viewBinding decorator and dynamically crates the view specified by the decorator\n */\nexport const ViewBinder: React.FC<ViewBinderProps> = ({model, viewContext, ...rest}) => {\n if (model) {\n const router = useRouter();\n const newProps = {\n model,\n router,\n ...rest\n };\n return createViewForModel(\n model,\n newProps,\n viewContext,\n null\n );\n }\n return null;\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';\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: object, displayContext: string, view: React.ComponentType) {\n let finalView: React.ComponentType = 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: any) {\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__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","// 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/polimerModelBuilderExtentsions';\n\nexport {ViewBinder} from './viewBinder';\nexport {viewBinding, DEFAULT_VIEW_KEY} from './viewBindingDecorator';\nexport {\n GetEspPolimerImmutableModelMetadata,\n GetEspPolimerImmutableModelConsts,\n getEspPolimerImmutableModel\n} from './polimer/getEspPolimerImmutableModel';\nexport {createViewForModel} from './viewBindingDecorator';\nexport {\n connect,\n ConnectableComponentFactory\n} from './connect';\nexport {\n CreatePublishEventProps,\n MapModelToProps,\n ConnectableComponentProps,\n ConnectableComponentChildProps,\n ConnectableComponent,\n} from './connectableComponent';\nexport {\n UseModelSelector,\n useModelSelector,\n EditableModelSelectorOptions,\n modelSelectorOptions,\n ModelSelectorOptions,\n ModelSelectorEqualityFn,\n} from './useModelSelector';\nexport {\n RouterProvider,\n RouterProviderProps,\n EspRouterContextProvider,\n EspRouterContextProviderProps,\n RouterContext,\n useRouter,\n PublishEventDelegate,\n PublishEventContext,\n usePublishEvent,\n} from './espRouterContextProvider';\nexport {\n useGetModelId,\n GetModelIdDelegate,\n GetModelIdContext,\n useGetModel,\n GetModelDelegate,\n GetModelContext,\n PublishModelEventDelegate,\n PublishModelEventContext,\n usePublishModelEvent,\n PublishModelEventWithEntityKeyDelegate,\n PublishModelEventWithEntityKeyContext,\n usePublishModelEventWithEntityKey,\n EspModelContextProvider,\n EspModelContextProviderProps,\n} from './espModelContextProvider';\n"],"names":[],"sourceRoot":""}
|