lilact 0.20.0 → 0.21.1
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/lilact.development.js +11 -14
- package/dist/lilact.development.js.map +2 -2
- package/dist/lilact.development.min.js +15 -15
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +11 -11
- package/docs/classes/accessories.ErrorBoundary.html +8 -8
- package/docs/classes/accessories.Suspense.html +7 -7
- package/docs/classes/components.Component.html +13 -11
- package/docs/classes/components.HTMLComponent.html +11 -11
- package/docs/classes/components.RootComponent.html +11 -11
- package/docs/functions/components.createComponent.html +1 -1
- package/docs/functions/components.createPortal.html +1 -1
- package/docs/functions/components.createRoot.html +1 -1
- package/docs/functions/components.memo.html +1 -1
- package/docs/functions/components.render.html +1 -1
- package/docs/static/demos/legacy-context.jsx +79 -0
- package/docs/static/index.html +1 -0
- package/docs/static/lilact.development.js +11 -14
- package/docs/static/lilact.development.js.map +2 -2
- package/docs/static/lilact.development.min.js +15 -15
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +11 -11
- package/examples/demos/legacy-context.jsx +79 -0
- package/examples/index.html +1 -0
- package/examples/lilact.development.js +11 -14
- package/examples/lilact.development.js.map +2 -2
- package/examples/lilact.development.min.js +15 -15
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +11 -11
- package/package.json +1 -1
- package/src/components.jsx +13 -12
- package/src/lilact.jsx +1 -1
|
@@ -2396,7 +2396,7 @@ var ComponentCore = class {
|
|
|
2396
2396
|
*/
|
|
2397
2397
|
// TODO: should componentDidUpdate be called after arranging/appending the outlet or before?
|
|
2398
2398
|
apply(next_props = this.props, next_state = this.next_state || this.state) {
|
|
2399
|
-
var _a, _b, _c, _d, _e;
|
|
2399
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
2400
2400
|
let do_rerender = true;
|
|
2401
2401
|
if (this.outlet && (this == null ? void 0 : this[MEMOIZED])) {
|
|
2402
2402
|
if (shallowEqual(this.props, next_props, "children") && shallowEqual((_a = this.props) == null ? void 0 : _a.children, next_props == null ? void 0 : next_props.children)) {
|
|
@@ -2415,6 +2415,12 @@ var ComponentCore = class {
|
|
|
2415
2415
|
if (this.component.constructor.defaultProps) {
|
|
2416
2416
|
next_props = { ...this.component.constructor.defaultProps, ...next_props };
|
|
2417
2417
|
}
|
|
2418
|
+
if (((_e = (_d = this == null ? void 0 : this.parent) == null ? void 0 : _d.component) == null ? void 0 : _e.context) || ((_g = (_f = this == null ? void 0 : this.parent) == null ? void 0 : _f.component) == null ? void 0 : _g.getChildContext)) {
|
|
2419
|
+
this.context = { ...this.parent.component.context, ...(_i = (_h = this.parent.component).getChildContext) == null ? void 0 : _i.call(_h) };
|
|
2420
|
+
if (this.component.constructor.contextTypes) {
|
|
2421
|
+
PropTypes.checkPropTypes(this.component.constructor.contextTypes, this.context, "context", this.entity.name);
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2418
2424
|
if (this.component.shouldComponentUpdate && !this.component.shouldComponentUpdate(next_state, next_props, this.context)) return;
|
|
2419
2425
|
if (typeof this.entity === "string") {
|
|
2420
2426
|
if (!(this.element instanceof Element)) {
|
|
@@ -2466,7 +2472,7 @@ var ComponentCore = class {
|
|
|
2466
2472
|
if (this == null ? void 0 : this.portal) {
|
|
2467
2473
|
this.element = this.portal;
|
|
2468
2474
|
}
|
|
2469
|
-
if (((
|
|
2475
|
+
if (((_k = (_j = this.outlet) == null ? void 0 : _j.constructor) == null ? void 0 : _k.name) !== "Array") {
|
|
2470
2476
|
this.outlet = [this.outlet];
|
|
2471
2477
|
}
|
|
2472
2478
|
this.outlet = [...this.outlet];
|
|
@@ -2985,20 +2991,11 @@ var Component = class {
|
|
|
2985
2991
|
componentWillUnmount () {}
|
|
2986
2992
|
getSnapshotBeforeUpdate (prevProps, prevState) {}
|
|
2987
2993
|
shouldComponentUpdate (nextProps, nextState) {}
|
|
2994
|
+
getChildContext ()
|
|
2988
2995
|
|
|
2989
2996
|
static getDerivedStateFromError (error) {}
|
|
2990
2997
|
static getDerivedStateFromProps (props, state) {}
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
*/
|
|
2994
|
-
/* // todo: maybe
|
|
2995
|
-
static get contextType() { }
|
|
2996
|
-
static set contextType(ctxt) { }
|
|
2997
|
-
|
|
2998
|
-
static get childContextTypes() {}
|
|
2999
|
-
static set childContextTypes(ctxt) { }
|
|
3000
|
-
|
|
3001
|
-
getChildContext()
|
|
2998
|
+
static contextType
|
|
3002
2999
|
*/
|
|
3003
3000
|
};
|
|
3004
3001
|
var HTMLComponent = class extends Component {
|
|
@@ -5950,7 +5947,7 @@ function transpileJSX(jsx2, {
|
|
|
5950
5947
|
|
|
5951
5948
|
// .tmp/src/lilact.jsx
|
|
5952
5949
|
var Lilact2 = {
|
|
5953
|
-
VERSION: "beta.
|
|
5950
|
+
VERSION: "beta.21",
|
|
5954
5951
|
// Configuration
|
|
5955
5952
|
defaultTransitionTimeout: 300,
|
|
5956
5953
|
defaultIsEqual: Object.is,
|