brew-js-react 0.6.5 → 0.6.6
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/brew-js-react.js +18 -5
- package/dist/brew-js-react.js.map +1 -1
- package/dist/brew-js-react.min.js +2 -2
- package/dist/brew-js-react.min.js.map +1 -1
- package/package.json +1 -1
- package/view.d.ts +6 -1
- package/view.js +17 -4
package/dist/brew-js-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! brew-js-react v0.6.
|
|
1
|
+
/*! brew-js-react v0.6.6 | (c) misonou | https://misonou.github.io */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory(require("zeta-dom"), require("brew-js"), require("react"), require("react-dom"), require("zeta-dom-react"), require("waterpipe"), require("jquery"));
|
|
@@ -597,7 +597,7 @@ definePrototype(ErrorBoundary, Component, {
|
|
|
597
597
|
zeta_dom_dom.on(context.container, 'error', function (e) {
|
|
598
598
|
return emitter.emit(e, context, {
|
|
599
599
|
error: e.error
|
|
600
|
-
});
|
|
600
|
+
}, false);
|
|
601
601
|
});
|
|
602
602
|
self.forceUpdate();
|
|
603
603
|
});
|
|
@@ -655,6 +655,14 @@ definePrototype(ViewContainer, Component, {
|
|
|
655
655
|
parent.push(self);
|
|
656
656
|
self.setActive(true);
|
|
657
657
|
},
|
|
658
|
+
componentDidUpdate: function componentDidUpdate(prevProps) {
|
|
659
|
+
(prevProps.rootProps.ref || {}).current = null;
|
|
660
|
+
this.setContext(this.currentContext);
|
|
661
|
+
},
|
|
662
|
+
setContext: function setContext(context) {
|
|
663
|
+
this.currentContext = context;
|
|
664
|
+
(this.props.rootProps.ref || {}).current = context;
|
|
665
|
+
},
|
|
658
666
|
render: function render() {
|
|
659
667
|
/** @type {any} */
|
|
660
668
|
var self = this;
|
|
@@ -693,7 +701,12 @@ definePrototype(ViewContainer, Component, {
|
|
|
693
701
|
var rootProps = self.props.rootProps;
|
|
694
702
|
var initElement = executeOnce(function (element) {
|
|
695
703
|
defineOwnProperty(context, 'container', element, true);
|
|
696
|
-
|
|
704
|
+
zeta_dom_dom.on(element, 'error', function (e) {
|
|
705
|
+
if (context !== self.currentContext) {
|
|
706
|
+
e.handled();
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
self.setContext(self.currentContext || context);
|
|
697
710
|
});
|
|
698
711
|
var onLoad = executeOnce(function () {
|
|
699
712
|
var element = context.container;
|
|
@@ -717,14 +730,14 @@ definePrototype(ViewContainer, Component, {
|
|
|
717
730
|
}, true);
|
|
718
731
|
});
|
|
719
732
|
self.views.shift();
|
|
720
|
-
self.
|
|
733
|
+
self.setContext(context);
|
|
721
734
|
extend(self, _(context));
|
|
722
735
|
state.rendered++;
|
|
723
736
|
animateIn(element, 'show', '[brew-view]', true);
|
|
724
737
|
resolve();
|
|
725
738
|
});
|
|
726
739
|
context.on('error', function () {
|
|
727
|
-
return (rootProps.onError || noop).apply(this, arguments);
|
|
740
|
+
return (self.props.rootProps.onError || noop).apply(this, arguments);
|
|
728
741
|
});
|
|
729
742
|
self.abort = resolve;
|
|
730
743
|
self.views[2] = /*#__PURE__*/createElement(StateContext.Provider, {
|