@graphcommerce/image 11.0.0-canary.70 → 11.0.0-canary.73
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 +10 -0
- package/components/Image.tsx +2 -3
- package/config/config.ts +6 -5
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 11.0.0-canary.73
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2736](https://github.com/graphcommerce-org/graphcommerce/pull/2736) [`6d59e85`](https://github.com/graphcommerce-org/graphcommerce/commit/6d59e854e54cc8e483cae8af1690d3573ae1ec07) - Removed the import of `@graphcommerce/next-ui` from `@graphcommerce/image`, because `@graphcommerce/next-ui` depends on `@graphcommerce/image`. ([@bramvanderholst](https://github.com/bramvanderholst))
|
|
8
|
+
|
|
9
|
+
## 11.0.0-canary.72
|
|
10
|
+
|
|
11
|
+
## 11.0.0-canary.71
|
|
12
|
+
|
|
3
13
|
## 11.0.0-canary.70
|
|
4
14
|
|
|
5
15
|
## 11.0.0-canary.69
|
package/components/Image.tsx
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
/* eslint-disable jsx-a11y/alt-text */
|
|
11
11
|
import { imageQuality } from '@graphcommerce/next-config/config'
|
|
12
|
-
import { sxx } from '@graphcommerce/next-ui'
|
|
13
12
|
import type { SxProps, Theme } from '@mui/material'
|
|
14
13
|
import { styled, useForkRef } from '@mui/material'
|
|
15
14
|
import type { ImageConfigComplete, LoaderValue } from 'next/dist/shared/lib/image-config'
|
|
@@ -521,7 +520,7 @@ const Image = React.forwardRef<HTMLImageElement, ImageProps>(
|
|
|
521
520
|
width={width}
|
|
522
521
|
height={height}
|
|
523
522
|
data-nimg
|
|
524
|
-
sx={
|
|
523
|
+
sx={[style, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
525
524
|
/>
|
|
526
525
|
) : (
|
|
527
526
|
<Picture {...pictureProps}>
|
|
@@ -539,7 +538,7 @@ const Image = React.forwardRef<HTMLImageElement, ImageProps>(
|
|
|
539
538
|
loading={loading ?? 'lazy'}
|
|
540
539
|
width={width}
|
|
541
540
|
height={height}
|
|
542
|
-
sx={
|
|
541
|
+
sx={[style, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
543
542
|
sizes={sizes}
|
|
544
543
|
data-nimg
|
|
545
544
|
decoding='async'
|
package/config/config.ts
CHANGED
|
@@ -14,6 +14,10 @@ export type ImageLoaderPropsWithConfig = ImageLoaderProps & {
|
|
|
14
14
|
config: Readonly<ImageConfig>
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
const imageConfig =
|
|
18
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
19
|
+
(process.env.__NEXT_IMAGE_OPTS as unknown as ImageConfigComplete) || imageConfigDefault
|
|
20
|
+
|
|
17
21
|
/** @public */
|
|
18
22
|
export const {
|
|
19
23
|
deviceSizes: configDeviceSizes,
|
|
@@ -21,8 +25,7 @@ export const {
|
|
|
21
25
|
loader: configLoader,
|
|
22
26
|
path: configPath,
|
|
23
27
|
domains: configDomains,
|
|
24
|
-
|
|
25
|
-
} = (process.env.__NEXT_IMAGE_OPTS as unknown as ImageConfigComplete) || imageConfigDefault
|
|
28
|
+
} = imageConfig
|
|
26
29
|
|
|
27
30
|
function normalizeSrc(src: string): string {
|
|
28
31
|
return src[0] === '/' ? src.slice(1) : src
|
|
@@ -162,13 +165,11 @@ export function imageUrl(
|
|
|
162
165
|
const { width, quality = 'content' } = options
|
|
163
166
|
if (configLoader === 'custom') return src
|
|
164
167
|
|
|
165
|
-
const config =
|
|
166
|
-
(process.env.__NEXT_IMAGE_OPTS as unknown as ImageConfigComplete) || imageConfigDefault
|
|
167
168
|
const allSizes = [...configImageSizes, ...configDeviceSizes].sort((a, b) => a - b)
|
|
168
169
|
const snapped = allSizes.find((size) => size >= width) ?? allSizes[allSizes.length - 1]
|
|
169
170
|
|
|
170
171
|
return (urlLoaders[configLoader] ?? defaultLoader)({
|
|
171
|
-
config: { ...
|
|
172
|
+
config: { ...imageConfig, allSizes },
|
|
172
173
|
src,
|
|
173
174
|
width: snapped,
|
|
174
175
|
quality: typeof quality === 'number' ? quality : imageQuality[quality],
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/image",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "11.0.0-canary.
|
|
5
|
+
"version": "11.0.0-canary.73",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "tsc -W"
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@graphcommerce/eslint-config-pwa": "^11.0.0-canary.
|
|
22
|
-
"@graphcommerce/framer-utils": "^11.0.0-canary.
|
|
23
|
-
"@graphcommerce/next-config": "^11.0.0-canary.
|
|
24
|
-
"@graphcommerce/prettier-config-pwa": "^11.0.0-canary.
|
|
25
|
-
"@graphcommerce/typescript-config-pwa": "^11.0.0-canary.
|
|
21
|
+
"@graphcommerce/eslint-config-pwa": "^11.0.0-canary.73",
|
|
22
|
+
"@graphcommerce/framer-utils": "^11.0.0-canary.73",
|
|
23
|
+
"@graphcommerce/next-config": "^11.0.0-canary.73",
|
|
24
|
+
"@graphcommerce/prettier-config-pwa": "^11.0.0-canary.73",
|
|
25
|
+
"@graphcommerce/typescript-config-pwa": "^11.0.0-canary.73",
|
|
26
26
|
"@mui/material": "^7.0.0",
|
|
27
27
|
"next": "*",
|
|
28
28
|
"react": "^19.2.0",
|