@stoker-platform/web-app 0.5.216 → 0.5.217

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.217
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: fix image height and flicker issues
8
+
3
9
  ## 0.5.216
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.216",
3
+ "version": "0.5.217",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
package/src/Images.tsx CHANGED
@@ -381,7 +381,7 @@ const Row = ({ index, style, data }: RowProps) => {
381
381
  </div>
382
382
  </div>
383
383
  )}
384
- <div className={cn("grid", "gap-4", size)}>
384
+ <div className={cn("grid", "gap-4", "auto-rows-fr", size)}>
385
385
  {record[imagesConfig.imageField] ? (
386
386
  <CopyImageOverlay src={record[imagesConfig.imageField]} className="w-full h-full">
387
387
  <button
@@ -14,7 +14,7 @@ import { Check, X } from "lucide-react"
14
14
  import { LoadingSpinner } from "@/components/ui/loading-spinner"
15
15
  import { Button } from "@/components/ui/button"
16
16
  import { preloadCacheEnabled } from "./preloadCacheEnabled"
17
- import { useEffect, useRef, useState } from "react"
17
+ import { useLayoutEffect, useRef, useState } from "react"
18
18
  import { cn } from "@/lib/utils"
19
19
  import { getSafeUrl } from "./isSafeUrl"
20
20
 
@@ -23,7 +23,7 @@ const FormattedFieldImage = ({ src, alt, form }: { src: string; alt?: string; fo
23
23
  const [loadedSrc, setLoadedSrc] = useState<string | null>(null)
24
24
  const isLoaded = loadedSrc === src
25
25
 
26
- useEffect(() => {
26
+ useLayoutEffect(() => {
27
27
  if (imgRef.current?.complete && imgRef.current.naturalWidth > 0) {
28
28
  setLoadedSrc(src)
29
29
  }