pds-dev-kit-web-test 0.3.23 → 0.3.25
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.
|
@@ -15,6 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
/* eslint-disable no-console */
|
|
18
19
|
/* eslint-disable react/destructuring-assignment */
|
|
19
20
|
var react_1 = require("react");
|
|
20
21
|
var DynamicLayout_1 = require("../../../../../../../DynamicLayout");
|
|
@@ -47,12 +48,19 @@ function Text(props) {
|
|
|
47
48
|
var cbRef = (0, react_1.useRef)(null);
|
|
48
49
|
var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 0.2, freezeOnceVisible: false });
|
|
49
50
|
var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
|
|
51
|
+
console.log('CB-REF', {
|
|
52
|
+
cbRef: cbRef,
|
|
53
|
+
current: cbRef.current,
|
|
54
|
+
text: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT,
|
|
55
|
+
entry: entry
|
|
56
|
+
});
|
|
50
57
|
var effectCssProperties = isVisible ? effect : {};
|
|
51
58
|
var isNoneEffectType = device === 'DESKTOP'
|
|
52
59
|
? CB_EFFECT_PROP_ENTANIM.CB_EFFECT_PROP_ENTANIM_SPEC_TYPE === 'NONE'
|
|
53
60
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
54
61
|
var hasEffect = !isNoneEffectType;
|
|
55
62
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
63
|
+
console.log({ hasEffect: hasEffect, effectVisibleStyle: effectVisibleStyle });
|
|
56
64
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), layoutStyle), effectCssProperties), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor }), hoverStyle: __assign(__assign(__assign({}, textHoverStyle), propsHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), onClick: onClickCLINK }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT })) }))] }));
|
|
57
65
|
}
|
|
58
66
|
function getTextStyles(props, device) {
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useIntersectionObserver = void 0;
|
|
4
|
+
/* eslint-disable no-console */
|
|
4
5
|
var react_1 = require("react");
|
|
5
6
|
function useIntersectionObserver(elementRef, _a) {
|
|
6
7
|
var _b = _a.threshold, threshold = _b === void 0 ? 0 : _b, _c = _a.root, root = _c === void 0 ? null : _c, _d = _a.rootMargin, rootMargin = _d === void 0 ? '0%' : _d, _e = _a.freezeOnceVisible, freezeOnceVisible = _e === void 0 ? false : _e;
|
|
7
8
|
var _f = (0, react_1.useState)(), entry = _f[0], setEntry = _f[1];
|
|
8
9
|
var frozen = (entry === null || entry === void 0 ? void 0 : entry.isIntersecting) && freezeOnceVisible;
|
|
9
|
-
var updateEntry = function (_a) {
|
|
10
|
-
var entry = _a[0];
|
|
11
|
-
setEntry(entry);
|
|
12
|
-
};
|
|
13
10
|
(0, react_1.useEffect)(function () {
|
|
11
|
+
var updateEntry = function (_a) {
|
|
12
|
+
var entry = _a[0];
|
|
13
|
+
setEntry(entry);
|
|
14
|
+
};
|
|
14
15
|
var node = elementRef === null || elementRef === void 0 ? void 0 : elementRef.current; // DOM Ref
|
|
15
16
|
var hasIOSupport = !!window.IntersectionObserver;
|
|
16
|
-
if (!hasIOSupport || frozen || !node)
|
|
17
|
+
if (!hasIOSupport || frozen || !node) {
|
|
18
|
+
console.log('returned', { hasIOSupport: hasIOSupport, frozen: frozen, node: node });
|
|
17
19
|
return;
|
|
20
|
+
}
|
|
18
21
|
var observerParams = { threshold: threshold, root: root, rootMargin: rootMargin };
|
|
19
22
|
var observer = new IntersectionObserver(updateEntry, observerParams);
|
|
20
23
|
observer.observe(node);
|
|
21
|
-
|
|
24
|
+
console.log('observe');
|
|
25
|
+
return function () {
|
|
26
|
+
console.log('disconnect,', { observer: observer });
|
|
27
|
+
observer.disconnect();
|
|
28
|
+
};
|
|
22
29
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
30
|
}, [elementRef === null || elementRef === void 0 ? void 0 : elementRef.current, JSON.stringify(threshold), root, rootMargin, frozen]);
|
|
24
31
|
return entry;
|
package/package.json
CHANGED
package/release-note.md
CHANGED