@stoker-platform/web-app 0.5.57 → 0.5.58
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/Collection.tsx +1 -1
- package/src/List.tsx +3 -2
- package/src/utils/runViewTransition.ts +10 -5
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/Collection.tsx
CHANGED
package/src/List.tsx
CHANGED
|
@@ -1320,8 +1320,9 @@ export function List({
|
|
|
1320
1320
|
>
|
|
1321
1321
|
<CardContent>
|
|
1322
1322
|
{metrics && hasMetrics && !relationList && (
|
|
1323
|
-
<div className="hidden lg:flex flex-row gap-4 mb-4 mt-4">
|
|
1323
|
+
<div className="hidden lg:flex flex-row gap-4 mb-4 mt-4 max-w-[calc(100vw-96px)]">
|
|
1324
1324
|
{metrics.map((metric: Metric | Chart, index: number) => {
|
|
1325
|
+
const hideThirdMetric = index >= 2 ? "hidden xl:grid" : undefined
|
|
1325
1326
|
if (
|
|
1326
1327
|
permissions?.Role &&
|
|
1327
1328
|
(!metric.roles || metric.roles.includes(permissions?.Role))
|
|
@@ -1337,7 +1338,7 @@ export function List({
|
|
|
1337
1338
|
return (
|
|
1338
1339
|
<div
|
|
1339
1340
|
key={`metric-${index}`}
|
|
1340
|
-
className="grid gap-3 place-content-center"
|
|
1341
|
+
className={cn("grid gap-3 place-content-center", hideThirdMetric)}
|
|
1341
1342
|
>
|
|
1342
1343
|
<Card className="p-4 pt-6 pb-6 h-[175px] min-w-[175px] flex flex-col place-content-center items-center bg-blue-500 dark:bg-blue-500/50 text-primary-foreground dark:text-primary">
|
|
1343
1344
|
<div className="relative bottom-2">
|
|
@@ -2,12 +2,17 @@ import { flushSync } from "react-dom"
|
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
4
|
export const runViewTransition = (callback: () => any) => {
|
|
5
|
-
if (document.startViewTransition) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
if (document.startViewTransition && document.visibilityState === "visible") {
|
|
6
|
+
try {
|
|
7
|
+
const transition = document.startViewTransition(() => {
|
|
8
|
+
flushSync(() => {
|
|
9
|
+
callback()
|
|
10
|
+
})
|
|
9
11
|
})
|
|
10
|
-
|
|
12
|
+
transition.finished.catch(() => {})
|
|
13
|
+
} catch {
|
|
14
|
+
callback()
|
|
15
|
+
}
|
|
11
16
|
} else {
|
|
12
17
|
callback()
|
|
13
18
|
}
|