@chayns-components/core 5.0.0-beta.938 → 5.0.0-beta.940
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.
|
@@ -72,7 +72,7 @@ const getUsableHeight = async shouldRemovePadding => {
|
|
|
72
72
|
let usableHeight;
|
|
73
73
|
const {
|
|
74
74
|
bottomBarHeight,
|
|
75
|
-
|
|
75
|
+
offsetTop,
|
|
76
76
|
windowHeight
|
|
77
77
|
} = await (0, _chaynsApi.getWindowMetrics)();
|
|
78
78
|
const {
|
|
@@ -86,8 +86,8 @@ const getUsableHeight = async shouldRemovePadding => {
|
|
|
86
86
|
if (bottomBarHeight) {
|
|
87
87
|
usableHeight -= bottomBarHeight;
|
|
88
88
|
}
|
|
89
|
-
if (
|
|
90
|
-
usableHeight -=
|
|
89
|
+
if (offsetTop) {
|
|
90
|
+
usableHeight -= offsetTop;
|
|
91
91
|
}
|
|
92
92
|
return usableHeight;
|
|
93
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageProvider.js","names":["_chaynsApi","require","_pageProvider","getPagePadding","runtimeEnvironment","getEnvironment","includes","matchMedia","PAGE_BREAKPOINTS","desktop","matches","exports","getPageProviderInformation","padding","split","parseValue","value","parsed","parseInt","replace","Number","isNaN","length","top","right","bottom","left","vertical","horizontal","map","getUsableHeight","shouldRemovePadding","usableHeight","bottomBarHeight","
|
|
1
|
+
{"version":3,"file":"pageProvider.js","names":["_chaynsApi","require","_pageProvider","getPagePadding","runtimeEnvironment","getEnvironment","includes","matchMedia","PAGE_BREAKPOINTS","desktop","matches","exports","getPageProviderInformation","padding","split","parseValue","value","parsed","parseInt","replace","Number","isNaN","length","top","right","bottom","left","vertical","horizontal","map","getUsableHeight","shouldRemovePadding","usableHeight","bottomBarHeight","offsetTop","windowHeight","getWindowMetrics"],"sources":["../../../src/utils/pageProvider.ts"],"sourcesContent":["import { getEnvironment, getWindowMetrics } from 'chayns-api';\nimport { PAGE_BREAKPOINTS } from '../constants/pageProvider';\n\nexport const getPagePadding = () => {\n const { runtimeEnvironment } = getEnvironment();\n\n if (typeof runtimeEnvironment === 'number' && [4, 5].includes(runtimeEnvironment)) {\n return '0';\n }\n\n if (matchMedia(PAGE_BREAKPOINTS.desktop).matches) {\n return '35px 43px 30px';\n }\n\n return '15px 10px 20px';\n};\n\ntype PaddingValues = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nconst getPageProviderInformation = (): PaddingValues => {\n const padding = getPagePadding().split(' ');\n\n const parseValue = (value: string): number => {\n const parsed = parseInt(value.replace('px', ''), 10);\n return Number.isNaN(parsed) ? 0 : parsed;\n };\n\n if (padding.length === 1) {\n const value = parseValue(padding[0] ?? '');\n return { top: value, right: value, bottom: value, left: value };\n }\n\n if (padding.length === 2) {\n const [vertical, horizontal] = padding.map(parseValue);\n return {\n top: vertical ?? 0,\n right: horizontal ?? 0,\n bottom: vertical ?? 0,\n left: horizontal ?? 0,\n };\n }\n\n if (padding.length === 3) {\n const [top, horizontal, bottom] = padding.map(parseValue);\n return {\n top: top ?? 0,\n right: horizontal ?? 0,\n bottom: bottom ?? 0,\n left: horizontal ?? 0,\n };\n }\n\n if (padding.length === 4) {\n const [top, right, bottom, left] = padding.map(parseValue);\n return { top: top ?? 0, right: right ?? 0, bottom: bottom ?? 0, left: left ?? 0 };\n }\n\n return { top: 0, right: 0, bottom: 0, left: 0 };\n};\n\nexport const getUsableHeight = async (shouldRemovePadding?: boolean) => {\n let usableHeight;\n\n const { bottomBarHeight, offsetTop, windowHeight } = await getWindowMetrics();\n\n const { bottom, top } = shouldRemovePadding\n ? { bottom: 0, top: 0 }\n : getPageProviderInformation();\n\n usableHeight = windowHeight - bottom - top;\n\n if (bottomBarHeight) {\n usableHeight -= bottomBarHeight;\n }\n\n if (offsetTop) {\n usableHeight -= offsetTop;\n }\n\n return usableHeight;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC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BAA0B,CAAC,CAAC;EAElCoB,YAAY,GAAGG,YAAY,GAAGV,MAAM,GAAGF,GAAG;EAE1C,IAAIU,eAAe,EAAE;IACjBD,YAAY,IAAIC,eAAe;EACnC;EAEA,IAAIC,SAAS,EAAE;IACXF,YAAY,IAAIE,SAAS;EAC7B;EAEA,OAAOF,YAAY;AACvB,CAAC;AAACrB,OAAA,CAAAmB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -65,7 +65,7 @@ export const getUsableHeight = async shouldRemovePadding => {
|
|
|
65
65
|
let usableHeight;
|
|
66
66
|
const {
|
|
67
67
|
bottomBarHeight,
|
|
68
|
-
|
|
68
|
+
offsetTop,
|
|
69
69
|
windowHeight
|
|
70
70
|
} = await getWindowMetrics();
|
|
71
71
|
const {
|
|
@@ -79,8 +79,8 @@ export const getUsableHeight = async shouldRemovePadding => {
|
|
|
79
79
|
if (bottomBarHeight) {
|
|
80
80
|
usableHeight -= bottomBarHeight;
|
|
81
81
|
}
|
|
82
|
-
if (
|
|
83
|
-
usableHeight -=
|
|
82
|
+
if (offsetTop) {
|
|
83
|
+
usableHeight -= offsetTop;
|
|
84
84
|
}
|
|
85
85
|
return usableHeight;
|
|
86
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageProvider.js","names":["getEnvironment","getWindowMetrics","PAGE_BREAKPOINTS","getPagePadding","runtimeEnvironment","includes","matchMedia","desktop","matches","getPageProviderInformation","padding","split","parseValue","value","parsed","parseInt","replace","Number","isNaN","length","top","right","bottom","left","vertical","horizontal","map","getUsableHeight","shouldRemovePadding","usableHeight","bottomBarHeight","
|
|
1
|
+
{"version":3,"file":"pageProvider.js","names":["getEnvironment","getWindowMetrics","PAGE_BREAKPOINTS","getPagePadding","runtimeEnvironment","includes","matchMedia","desktop","matches","getPageProviderInformation","padding","split","parseValue","value","parsed","parseInt","replace","Number","isNaN","length","top","right","bottom","left","vertical","horizontal","map","getUsableHeight","shouldRemovePadding","usableHeight","bottomBarHeight","offsetTop","windowHeight"],"sources":["../../../src/utils/pageProvider.ts"],"sourcesContent":["import { getEnvironment, getWindowMetrics } from 'chayns-api';\nimport { PAGE_BREAKPOINTS } from '../constants/pageProvider';\n\nexport const getPagePadding = () => {\n const { runtimeEnvironment } = getEnvironment();\n\n if (typeof runtimeEnvironment === 'number' && [4, 5].includes(runtimeEnvironment)) {\n return '0';\n }\n\n if (matchMedia(PAGE_BREAKPOINTS.desktop).matches) {\n return '35px 43px 30px';\n }\n\n return '15px 10px 20px';\n};\n\ntype PaddingValues = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nconst getPageProviderInformation = (): PaddingValues => {\n const padding = getPagePadding().split(' ');\n\n const parseValue = (value: string): number => {\n const parsed = parseInt(value.replace('px', ''), 10);\n return Number.isNaN(parsed) ? 0 : parsed;\n };\n\n if (padding.length === 1) {\n const value = parseValue(padding[0] ?? '');\n return { top: value, right: value, bottom: value, left: value };\n }\n\n if (padding.length === 2) {\n const [vertical, horizontal] = padding.map(parseValue);\n return {\n top: vertical ?? 0,\n right: horizontal ?? 0,\n bottom: vertical ?? 0,\n left: horizontal ?? 0,\n };\n }\n\n if (padding.length === 3) {\n const [top, horizontal, bottom] = padding.map(parseValue);\n return {\n top: top ?? 0,\n right: horizontal ?? 0,\n bottom: bottom ?? 0,\n left: horizontal ?? 0,\n };\n }\n\n if (padding.length === 4) {\n const [top, right, bottom, left] = padding.map(parseValue);\n return { top: top ?? 0, right: right ?? 0, bottom: bottom ?? 0, left: left ?? 0 };\n }\n\n return { top: 0, right: 0, bottom: 0, left: 0 };\n};\n\nexport const getUsableHeight = async (shouldRemovePadding?: boolean) => {\n let usableHeight;\n\n const { bottomBarHeight, offsetTop, windowHeight } = await getWindowMetrics();\n\n const { bottom, top } = shouldRemovePadding\n ? { bottom: 0, top: 0 }\n : getPageProviderInformation();\n\n usableHeight = windowHeight - bottom - top;\n\n if (bottomBarHeight) {\n usableHeight -= bottomBarHeight;\n }\n\n if (offset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AAGQ,mBAAmB,GACrC;IAAEN,MAAM,EAAE,CAAC;IAAEF,GAAG,EAAE;EAAE,CAAC,GACrBX,0BAA0B,CAAC,CAAC;EAElCoB,YAAY,GAAGG,YAAY,GAAGV,MAAM,GAAGF,GAAG;EAE1C,IAAIU,eAAe,EAAE;IACjBD,YAAY,IAAIC,eAAe;EACnC;EAEA,IAAIC,SAAS,EAAE;IACXF,YAAY,IAAIE,SAAS;EAC7B;EAEA,OAAOF,YAAY;AACvB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.940",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@babel/preset-env": "^7.26.0",
|
|
57
57
|
"@babel/preset-react": "^7.26.3",
|
|
58
58
|
"@babel/preset-typescript": "^7.26.0",
|
|
59
|
-
"@types/react": "^18.3.
|
|
59
|
+
"@types/react": "^18.3.18",
|
|
60
60
|
"@types/react-dom": "^18.3.5",
|
|
61
61
|
"@types/react-helmet": "^6.1.11",
|
|
62
62
|
"@types/styled-components": "^5.1.34",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@chayns/colors": "^2.0.0",
|
|
74
|
-
"@chayns/uac-service": "^0.0.
|
|
74
|
+
"@chayns/uac-service": "^0.0.51",
|
|
75
75
|
"@react-hook/resize-observer": "^2.0.2",
|
|
76
76
|
"clsx": "^2.1.1",
|
|
77
77
|
"react-helmet": "^6.1.0",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "8cdbd6072312b59f71698401b5eab20214a48c62"
|
|
91
91
|
}
|