@prismicio/svelte 2.2.3 → 2.2.4-pr.67.08f1823
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/dist/PrismicImage.svelte
CHANGED
|
@@ -75,12 +75,15 @@
|
|
|
75
75
|
|
|
76
76
|
const ar = field.dimensions.width / field.dimensions.height
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
const castedWidth = castInt(width)
|
|
79
|
+
const castedHeight = castInt(height)
|
|
80
|
+
|
|
81
|
+
let resolvedWidth = castedWidth ?? field.dimensions.width
|
|
82
|
+
let resolvedHeight = castedHeight ?? field.dimensions.height
|
|
83
|
+
if (castedWidth != null && castedHeight == null) {
|
|
84
|
+
resolvedHeight = castedWidth / ar
|
|
85
|
+
} else if (castedWidth == null && castedHeight != null) {
|
|
86
|
+
resolvedWidth = castedHeight * ar
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
return { resolvedWidth, resolvedHeight }
|
package/dist/PrismicLink.svelte
CHANGED
package/package.json
CHANGED
package/src/PrismicImage.svelte
CHANGED
|
@@ -75,12 +75,15 @@
|
|
|
75
75
|
|
|
76
76
|
const ar = field.dimensions.width / field.dimensions.height
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
const castedWidth = castInt(width)
|
|
79
|
+
const castedHeight = castInt(height)
|
|
80
|
+
|
|
81
|
+
let resolvedWidth = castedWidth ?? field.dimensions.width
|
|
82
|
+
let resolvedHeight = castedHeight ?? field.dimensions.height
|
|
83
|
+
if (castedWidth != null && castedHeight == null) {
|
|
84
|
+
resolvedHeight = castedWidth / ar
|
|
85
|
+
} else if (castedWidth == null && castedHeight != null) {
|
|
86
|
+
resolvedWidth = castedHeight * ar
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
return { resolvedWidth, resolvedHeight }
|