@next-core/brick-kit 2.204.2 → 2.205.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/index.bundle.js +76 -12
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +76 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/types/BrickAsComponent.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.bundle.js
CHANGED
|
@@ -13281,6 +13281,7 @@
|
|
|
13281
13281
|
}
|
|
13282
13282
|
})();
|
|
13283
13283
|
}, [runtimeBrick, updateBrick]);
|
|
13284
|
+
var previousObserverRef = React.useRef();
|
|
13284
13285
|
innerRefCallbackRef.current = /*#__PURE__*/function () {
|
|
13285
13286
|
var _ref6 = _asyncToGenerator__default["default"](function* (element) {
|
|
13286
13287
|
immediatelyRefCallback === null || immediatelyRefCallback === void 0 ? void 0 : immediatelyRefCallback(element);
|
|
@@ -13294,15 +13295,46 @@
|
|
|
13294
13295
|
// sub-brick rendering is ignored.
|
|
13295
13296
|
if (brick) {
|
|
13296
13297
|
if (element) {
|
|
13297
|
-
var _useBrick$lifeCycle;
|
|
13298
|
+
var _useBrick$lifeCycle, _useBrick$lifeCycle2;
|
|
13298
13299
|
updateBrick(brick, element);
|
|
13299
|
-
|
|
13300
|
-
|
|
13300
|
+
var onMount = (_useBrick$lifeCycle = useBrick.lifeCycle) === null || _useBrick$lifeCycle === void 0 ? void 0 : _useBrick$lifeCycle.onMount;
|
|
13301
|
+
if (onMount) {
|
|
13302
|
+
dispatchLifeCycleEvent(new CustomEvent("mount"), transformEvents(data, {
|
|
13303
|
+
onMount
|
|
13304
|
+
}).onMount, brick);
|
|
13305
|
+
}
|
|
13306
|
+
var onScrollIntoView = (_useBrick$lifeCycle2 = useBrick.lifeCycle) === null || _useBrick$lifeCycle2 === void 0 ? void 0 : _useBrick$lifeCycle2.onScrollIntoView;
|
|
13307
|
+
if (onScrollIntoView) {
|
|
13308
|
+
var _onScrollIntoView$thr;
|
|
13309
|
+
var threshold = (_onScrollIntoView$thr = onScrollIntoView.threshold) !== null && _onScrollIntoView$thr !== void 0 ? _onScrollIntoView$thr : 0.1;
|
|
13310
|
+
var observer = new IntersectionObserver((entries, observer) => {
|
|
13311
|
+
entries.forEach(entry => {
|
|
13312
|
+
if (entry.isIntersecting) {
|
|
13313
|
+
if (entry.intersectionRatio >= threshold) {
|
|
13314
|
+
dispatchLifeCycleEvent(new CustomEvent("scroll.into.view"), transformEvents(data, {
|
|
13315
|
+
onScrollIntoView: onScrollIntoView.handlers
|
|
13316
|
+
}).onScrollIntoView, brick);
|
|
13317
|
+
observer.disconnect();
|
|
13318
|
+
}
|
|
13319
|
+
}
|
|
13320
|
+
});
|
|
13321
|
+
}, {
|
|
13322
|
+
threshold
|
|
13323
|
+
});
|
|
13324
|
+
observer.observe(element);
|
|
13325
|
+
previousObserverRef.current = observer;
|
|
13301
13326
|
}
|
|
13302
13327
|
} else {
|
|
13303
|
-
var _useBrick$
|
|
13304
|
-
|
|
13305
|
-
|
|
13328
|
+
var _useBrick$lifeCycle3;
|
|
13329
|
+
var onUnmount = (_useBrick$lifeCycle3 = useBrick.lifeCycle) === null || _useBrick$lifeCycle3 === void 0 ? void 0 : _useBrick$lifeCycle3.onUnmount;
|
|
13330
|
+
if (onUnmount) {
|
|
13331
|
+
dispatchLifeCycleEvent(new CustomEvent("unmount"), transformEvents(data, {
|
|
13332
|
+
onUnmount
|
|
13333
|
+
}).onUnmount, brick);
|
|
13334
|
+
}
|
|
13335
|
+
if (previousObserverRef.current) {
|
|
13336
|
+
previousObserverRef.current.disconnect();
|
|
13337
|
+
previousObserverRef.current = undefined;
|
|
13306
13338
|
}
|
|
13307
13339
|
}
|
|
13308
13340
|
}
|
|
@@ -13559,6 +13591,7 @@
|
|
|
13559
13591
|
}
|
|
13560
13592
|
})();
|
|
13561
13593
|
}, [runtimeBrick, updateBrick]);
|
|
13594
|
+
var previousObserverRef = React.useRef();
|
|
13562
13595
|
innerRefCallbackRef.current = /*#__PURE__*/function () {
|
|
13563
13596
|
var _ref14 = _asyncToGenerator__default["default"](function* (element) {
|
|
13564
13597
|
elementRef.current = element;
|
|
@@ -13571,15 +13604,46 @@
|
|
|
13571
13604
|
// sub-brick rendering is ignored.
|
|
13572
13605
|
if (brick) {
|
|
13573
13606
|
if (element) {
|
|
13574
|
-
var _useBrick$
|
|
13607
|
+
var _useBrick$lifeCycle4, _useBrick$lifeCycle5;
|
|
13575
13608
|
updateBrick(brick, element);
|
|
13576
|
-
|
|
13577
|
-
|
|
13609
|
+
var onMount = (_useBrick$lifeCycle4 = useBrick.lifeCycle) === null || _useBrick$lifeCycle4 === void 0 ? void 0 : _useBrick$lifeCycle4.onMount;
|
|
13610
|
+
if (onMount) {
|
|
13611
|
+
dispatchLifeCycleEvent(new CustomEvent("mount"), transformEvents(data, {
|
|
13612
|
+
onMount
|
|
13613
|
+
}).onMount, brick);
|
|
13614
|
+
}
|
|
13615
|
+
var onScrollIntoView = (_useBrick$lifeCycle5 = useBrick.lifeCycle) === null || _useBrick$lifeCycle5 === void 0 ? void 0 : _useBrick$lifeCycle5.onScrollIntoView;
|
|
13616
|
+
if (onScrollIntoView) {
|
|
13617
|
+
var _onScrollIntoView$thr2;
|
|
13618
|
+
var threshold = (_onScrollIntoView$thr2 = onScrollIntoView.threshold) !== null && _onScrollIntoView$thr2 !== void 0 ? _onScrollIntoView$thr2 : 0.1;
|
|
13619
|
+
var observer = new IntersectionObserver((entries, observer) => {
|
|
13620
|
+
entries.forEach(entry => {
|
|
13621
|
+
if (entry.isIntersecting) {
|
|
13622
|
+
if (entry.intersectionRatio >= threshold) {
|
|
13623
|
+
dispatchLifeCycleEvent(new CustomEvent("scroll.into.view"), transformEvents(data, {
|
|
13624
|
+
onScrollIntoView: onScrollIntoView.handlers
|
|
13625
|
+
}).onScrollIntoView, brick);
|
|
13626
|
+
observer.disconnect();
|
|
13627
|
+
}
|
|
13628
|
+
}
|
|
13629
|
+
});
|
|
13630
|
+
}, {
|
|
13631
|
+
threshold
|
|
13632
|
+
});
|
|
13633
|
+
observer.observe(element);
|
|
13634
|
+
previousObserverRef.current = observer;
|
|
13578
13635
|
}
|
|
13579
13636
|
} else {
|
|
13580
|
-
var _useBrick$
|
|
13581
|
-
|
|
13582
|
-
|
|
13637
|
+
var _useBrick$lifeCycle6;
|
|
13638
|
+
var onUnmount = (_useBrick$lifeCycle6 = useBrick.lifeCycle) === null || _useBrick$lifeCycle6 === void 0 ? void 0 : _useBrick$lifeCycle6.onUnmount;
|
|
13639
|
+
if (onUnmount) {
|
|
13640
|
+
dispatchLifeCycleEvent(new CustomEvent("unmount"), transformEvents(data, {
|
|
13641
|
+
onUnmount
|
|
13642
|
+
}).onUnmount, brick);
|
|
13643
|
+
}
|
|
13644
|
+
if (previousObserverRef.current) {
|
|
13645
|
+
previousObserverRef.current.disconnect();
|
|
13646
|
+
previousObserverRef.current = undefined;
|
|
13583
13647
|
}
|
|
13584
13648
|
}
|
|
13585
13649
|
}
|