@cntrl-site/sdk-nextjs 1.4.2 → 1.4.4
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/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +15 -0
- package/lib/components/items/Item.js +1 -1
- package/lib/utils/getCompoundBondaryStyles.js +4 -4
- package/package.json +1 -1
- package/src/components/items/Item.tsx +1 -1
- package/src/utils/getCompoundBondaryStyles.ts +4 -4
- package/cntrl-site-sdk-nextjs-1.2.0.tgz +0 -0
- package/cntrl-site-sdk-nextjs-1.3.3.tgz +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
|
|
5
|
+
<option name="myValues">
|
|
6
|
+
<value>
|
|
7
|
+
<list size="1">
|
|
8
|
+
<item index="0" class="java.lang.String" itemvalue="jsx" />
|
|
9
|
+
</list>
|
|
10
|
+
</value>
|
|
11
|
+
</option>
|
|
12
|
+
<option name="myCustomValuesEnabled" value="true" />
|
|
13
|
+
</inspection_tool>
|
|
14
|
+
</profile>
|
|
15
|
+
</component>
|
|
@@ -78,7 +78,7 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
|
|
|
78
78
|
}
|
|
79
79
|
const itemArticleOffset = sectionTop / window.innerWidth + stickyTop;
|
|
80
80
|
const maxStickyTo = articleHeight - itemArticleOffset - height;
|
|
81
|
-
const end = sticky.to
|
|
81
|
+
const end = sticky.to !== undefined
|
|
82
82
|
? Math.min(maxStickyTo, sticky.to)
|
|
83
83
|
: articleHeight - itemArticleOffset - height;
|
|
84
84
|
const wrapperHeight = end - sticky.from + height;
|
|
@@ -14,7 +14,7 @@ const positionMatrix = {
|
|
|
14
14
|
[sdk_1.AreaAnchor.BottomRight]: [1, 1]
|
|
15
15
|
};
|
|
16
16
|
function getCompoundHeight(compoundSettings, height) {
|
|
17
|
-
if (
|
|
17
|
+
if (height === undefined || !compoundSettings)
|
|
18
18
|
return;
|
|
19
19
|
if (compoundSettings.heightMode === 'relative') {
|
|
20
20
|
return `${height * 100}%`;
|
|
@@ -23,7 +23,7 @@ function getCompoundHeight(compoundSettings, height) {
|
|
|
23
23
|
}
|
|
24
24
|
exports.getCompoundHeight = getCompoundHeight;
|
|
25
25
|
function getCompoundWidth(compoundSettings, width, isRichText, exemplary) {
|
|
26
|
-
if (
|
|
26
|
+
if (width === undefined || !compoundSettings)
|
|
27
27
|
return;
|
|
28
28
|
if (compoundSettings.widthMode === 'relative') {
|
|
29
29
|
return `${width * 100}%`;
|
|
@@ -32,7 +32,7 @@ function getCompoundWidth(compoundSettings, width, isRichText, exemplary) {
|
|
|
32
32
|
}
|
|
33
33
|
exports.getCompoundWidth = getCompoundWidth;
|
|
34
34
|
function getCompoundTop(compoundSettings, top) {
|
|
35
|
-
if (
|
|
35
|
+
if (top === undefined || !compoundSettings)
|
|
36
36
|
return;
|
|
37
37
|
if (compoundSettings.heightMode === 'relative') {
|
|
38
38
|
return `${top * 100}%`;
|
|
@@ -42,7 +42,7 @@ function getCompoundTop(compoundSettings, top) {
|
|
|
42
42
|
}
|
|
43
43
|
exports.getCompoundTop = getCompoundTop;
|
|
44
44
|
function getCompoundLeft(compoundSettings, left) {
|
|
45
|
-
if (
|
|
45
|
+
if (left === undefined || !compoundSettings)
|
|
46
46
|
return;
|
|
47
47
|
if (compoundSettings.widthMode === 'relative') {
|
|
48
48
|
return `${left * 100}%`;
|
package/package.json
CHANGED
|
@@ -107,7 +107,7 @@ export const Item: FC<ItemWrapperProps> = ({ item, sectionId, articleHeight, isP
|
|
|
107
107
|
}
|
|
108
108
|
const itemArticleOffset = sectionTop / window.innerWidth + stickyTop;
|
|
109
109
|
const maxStickyTo = articleHeight - itemArticleOffset - height;
|
|
110
|
-
const end = sticky.to
|
|
110
|
+
const end = sticky.to !== undefined
|
|
111
111
|
? Math.min(maxStickyTo, sticky.to)
|
|
112
112
|
: articleHeight - itemArticleOffset - height;
|
|
113
113
|
const wrapperHeight = end - sticky.from + height;
|
|
@@ -14,7 +14,7 @@ const positionMatrix: Record<AreaAnchor, [number, number]> = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export function getCompoundHeight(compoundSettings: CompoundSettings | undefined, height: number | undefined) {
|
|
17
|
-
if (
|
|
17
|
+
if (height === undefined || !compoundSettings) return;
|
|
18
18
|
if (compoundSettings.heightMode === 'relative') {
|
|
19
19
|
return `${height * 100}%`;
|
|
20
20
|
}
|
|
@@ -22,7 +22,7 @@ export function getCompoundHeight(compoundSettings: CompoundSettings | undefined
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export function getCompoundWidth(compoundSettings: CompoundSettings | undefined, width: number | undefined, isRichText: boolean, exemplary?: number) {
|
|
25
|
-
if (
|
|
25
|
+
if (width === undefined || !compoundSettings) return;
|
|
26
26
|
if (compoundSettings.widthMode === 'relative') {
|
|
27
27
|
return `${width * 100}%`;
|
|
28
28
|
}
|
|
@@ -30,7 +30,7 @@ export function getCompoundWidth(compoundSettings: CompoundSettings | undefined,
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export function getCompoundTop(compoundSettings: CompoundSettings | undefined, top: number | undefined) {
|
|
33
|
-
if (
|
|
33
|
+
if (top === undefined || !compoundSettings) return;
|
|
34
34
|
if (compoundSettings.heightMode === 'relative') {
|
|
35
35
|
return `${top * 100}%`;
|
|
36
36
|
}
|
|
@@ -39,7 +39,7 @@ export function getCompoundTop(compoundSettings: CompoundSettings | undefined, t
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export function getCompoundLeft(compoundSettings: CompoundSettings | undefined, left: number | undefined) {
|
|
42
|
-
if (
|
|
42
|
+
if (left === undefined || !compoundSettings) return;
|
|
43
43
|
if (compoundSettings.widthMode === 'relative') {
|
|
44
44
|
return `${left * 100}%`;
|
|
45
45
|
}
|
|
Binary file
|
|
Binary file
|