@graphcommerce/image 2.105.8 → 2.105.12
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/package.json +7 -7
- package/example/CHANGELOG.md +0 -54
- package/example/README.md +0 -23
- package/example/components/image.jpg +0 -0
- package/example/next-env.d.ts +0 -3
- package/example/next.config.js +0 -14
- package/example/package.json +0 -24
- package/example/pages/_app.tsx +0 -28
- package/example/pages/index.tsx +0 -138
- package/example/public/image.jpg +0 -0
- package/example/tsconfig.json +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/image",
|
|
3
|
-
"version": "2.105.
|
|
3
|
+
"version": "2.105.12",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "tsc -W"
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@graphcommerce/framer-utils": "^2.103.
|
|
19
|
+
"@graphcommerce/framer-utils": "^2.103.21"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@graphcommerce/browserslist-config-pwa": "^3.0.
|
|
23
|
-
"@graphcommerce/eslint-config-pwa": "^3.1.
|
|
24
|
-
"@graphcommerce/prettier-config-pwa": "^3.0.
|
|
25
|
-
"@graphcommerce/typescript-config-pwa": "^3.1.
|
|
22
|
+
"@graphcommerce/browserslist-config-pwa": "^3.0.3",
|
|
23
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.10",
|
|
24
|
+
"@graphcommerce/prettier-config-pwa": "^3.0.5",
|
|
25
|
+
"@graphcommerce/typescript-config-pwa": "^3.1.2",
|
|
26
26
|
"@playwright/test": "^1.17.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"react-dom": "^17.0.2",
|
|
33
33
|
"type-fest": "^2.8.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "bc5423d7547f8685db4cd8fc6d8f7a2a51ebed05"
|
|
36
36
|
}
|
package/example/CHANGELOG.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# [2.103.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/image-example@2.102.35...@graphcommerce/image-example@2.103.0) (2021-10-27)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Features
|
|
10
|
-
|
|
11
|
-
* **nextjs:** upgraded to nextjs 12 ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# 2.102.0 (2021-09-27)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Bug Fixes
|
|
21
|
-
|
|
22
|
-
* ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
|
|
23
|
-
* make packages private so they dont get published accidently ([f7b693f](https://github.com/ho-nl/m2-pwa/commit/f7b693ff6a4d232d0871f6a68922d14678853a96))
|
|
24
|
-
* versions ([b8b306c](https://github.com/ho-nl/m2-pwa/commit/b8b306c8f3a13415e441d0593c638ae2a3731cd6))
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### Features
|
|
28
|
-
|
|
29
|
-
* **image:** introduced completely rewritten Image component ([e3413b3](https://github.com/ho-nl/m2-pwa/commit/e3413b3a57392d6571ea64cb8d9c8dca05ea31df))
|
|
30
|
-
* renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of [@reachdigital](https://github.com/reachdigital) ([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
|
|
31
|
-
* upgraded to nextjs 11 ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
# Change Log
|
|
38
|
-
|
|
39
|
-
All notable changes to this project will be documented in this file. See
|
|
40
|
-
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
41
|
-
|
|
42
|
-
# [2.101.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/image-example@2.100.18...@graphcommerce/image-example@2.101.0) (2021-08-12)
|
|
43
|
-
|
|
44
|
-
### Features
|
|
45
|
-
|
|
46
|
-
- upgraded to nextjs 11
|
|
47
|
-
([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
|
|
48
|
-
|
|
49
|
-
## [2.100.11](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/image-example@2.100.10...@graphcommerce/image-example@2.100.11) (2021-07-20)
|
|
50
|
-
|
|
51
|
-
### Bug Fixes
|
|
52
|
-
|
|
53
|
-
- ignore md files from triggering version updates
|
|
54
|
-
([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
|
package/example/README.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# with-route-as-modal
|
|
2
|
-
|
|
3
|
-
On many popular social media, opening a post will update the URL but won't trigger a navigation and will instead display the content inside a modal. This behavior ensures the user won't lose the current UI context (scroll position). The URL still reflect the post's actual page location and any refresh will bring the user there. This behavior ensures great UX without neglecting SEO.
|
|
4
|
-
|
|
5
|
-
This example shows how to conditionally display a modal based on a route.
|
|
6
|
-
|
|
7
|
-
## Deploy your own
|
|
8
|
-
|
|
9
|
-
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):
|
|
10
|
-
|
|
11
|
-
[](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-route-as-modal&project-name=with-route-as-modal&repository-name=with-route-as-modal)
|
|
12
|
-
|
|
13
|
-
## How to use
|
|
14
|
-
|
|
15
|
-
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npx create-next-app --example with-route-as-modal with-route-as-modal-app
|
|
19
|
-
# or
|
|
20
|
-
yarn create next-app --example with-route-as-modal with-route-as-modal-app
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
|
|
Binary file
|
package/example/next-env.d.ts
DELETED
package/example/next.config.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
|
|
3
|
-
const withGraphCommerce = require('@graphcommerce/next-config').withYarn1Workspaces()
|
|
4
|
-
|
|
5
|
-
/** @type {import('next/dist/next-server/server/config').NextConfig} */
|
|
6
|
-
const config = {
|
|
7
|
-
images: {
|
|
8
|
-
domains: ['upload.wikimedia.org', 'backend.reachdigital.dev'],
|
|
9
|
-
// imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
|
|
10
|
-
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 2560, 3840],
|
|
11
|
-
},
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
module.exports = withGraphCommerce(config)
|
package/example/package.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@graphcommerce/image-example",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "2.103.45",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "next",
|
|
7
|
-
"build": "next build",
|
|
8
|
-
"start": "next start"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"@graphcommerce/image": "^2.105.8",
|
|
12
|
-
"@graphcommerce/next-config": "^2.109.3",
|
|
13
|
-
"@graphcommerce/next-ui": "^3.20.8",
|
|
14
|
-
"framer-motion": "^5.5.1",
|
|
15
|
-
"next": "^12.0.7",
|
|
16
|
-
"react": "^17.0.2",
|
|
17
|
-
"react-dom": "^17.0.2",
|
|
18
|
-
"react-focus-lock": "^2.7.1"
|
|
19
|
-
},
|
|
20
|
-
"license": "MIT",
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"typescript": "^4.5.4"
|
|
23
|
-
}
|
|
24
|
-
}
|
package/example/pages/_app.tsx
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export default function App({ Component, pageProps }) {
|
|
2
|
-
return (
|
|
3
|
-
<>
|
|
4
|
-
<style
|
|
5
|
-
// We're setting the global this way so that they are applied with JS disabled in development mode.
|
|
6
|
-
// eslint-disable-next-line react/no-danger
|
|
7
|
-
dangerouslySetInnerHTML={{
|
|
8
|
-
__html: `
|
|
9
|
-
body {
|
|
10
|
-
font-family: SF Pro Text, 'SF Pro Icons', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
|
|
11
|
-
padding: 20px;
|
|
12
|
-
margin: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
details {
|
|
16
|
-
margin-bottom: 1em;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
summary :is(h2, h3) {
|
|
20
|
-
display: inline;
|
|
21
|
-
}
|
|
22
|
-
`,
|
|
23
|
-
}}
|
|
24
|
-
/>
|
|
25
|
-
<Component {...pageProps} />
|
|
26
|
-
</>
|
|
27
|
-
)
|
|
28
|
-
}
|
package/example/pages/index.tsx
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { Image } from '@graphcommerce/image'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import image from '../components/image.jpg'
|
|
4
|
-
|
|
5
|
-
const imgWidth = image.width
|
|
6
|
-
const imgHeight = image.height
|
|
7
|
-
|
|
8
|
-
function Index() {
|
|
9
|
-
return (
|
|
10
|
-
<>
|
|
11
|
-
<h1>@graphcommerce/image</h1>
|
|
12
|
-
|
|
13
|
-
<p>The layout should never have a layout shift when loading the page</p>
|
|
14
|
-
<p>The layout should never have a layout shift when expanding a section</p>
|
|
15
|
-
|
|
16
|
-
<h2>Image with an external image</h2>
|
|
17
|
-
|
|
18
|
-
<details open style={{ maxWidth: 600 }}>
|
|
19
|
-
<summary>
|
|
20
|
-
<h3>layout=responsive</h3>
|
|
21
|
-
</summary>
|
|
22
|
-
<Image
|
|
23
|
-
src='https://backend.reachdigital.dev/media/catalog/product/cache/63405d393cd2d0278e3cc8b45744d4a7/2/0/205_1_3.jpg'
|
|
24
|
-
layout='responsive'
|
|
25
|
-
width={imgWidth}
|
|
26
|
-
height={imgHeight}
|
|
27
|
-
sizes={{ 0: '100vw', 600: '600px' }}
|
|
28
|
-
/>
|
|
29
|
-
</details>
|
|
30
|
-
|
|
31
|
-
<details open>
|
|
32
|
-
<summary>
|
|
33
|
-
<h3>layout=fixed</h3>
|
|
34
|
-
</summary>
|
|
35
|
-
<div style={{ overflowX: 'scroll' }}>
|
|
36
|
-
<Image
|
|
37
|
-
src='https://backend.reachdigital.dev/media/catalog/product/cache/63405d393cd2d0278e3cc8b45744d4a7/2/0/205_1_3.jpg'
|
|
38
|
-
layout='fixed'
|
|
39
|
-
width={imgWidth / 4}
|
|
40
|
-
height={imgHeight / 4}
|
|
41
|
-
/>
|
|
42
|
-
</div>
|
|
43
|
-
</details>
|
|
44
|
-
|
|
45
|
-
<details open>
|
|
46
|
-
<summary>
|
|
47
|
-
<h3>layout=intrinsic</h3>
|
|
48
|
-
</summary>
|
|
49
|
-
<Image
|
|
50
|
-
src='https://backend.reachdigital.dev/media/catalog/product/cache/63405d393cd2d0278e3cc8b45744d4a7/2/0/205_1_3.jpg'
|
|
51
|
-
layout='intrinsic'
|
|
52
|
-
width={imgWidth}
|
|
53
|
-
height={imgHeight}
|
|
54
|
-
sizes='calc(100vw - 40px)'
|
|
55
|
-
/>
|
|
56
|
-
</details>
|
|
57
|
-
|
|
58
|
-
<details open>
|
|
59
|
-
<summary>
|
|
60
|
-
<h3>layout=fill</h3>
|
|
61
|
-
</summary>
|
|
62
|
-
<div style={{ height: 200, backgroundColor: 'darkgray' }}>
|
|
63
|
-
<Image
|
|
64
|
-
src='https://backend.reachdigital.dev/media/catalog/product/cache/63405d393cd2d0278e3cc8b45744d4a7/2/0/205_1_3.jpg'
|
|
65
|
-
layout='fill'
|
|
66
|
-
style={{ objectFit: 'contain' }}
|
|
67
|
-
/>
|
|
68
|
-
</div>
|
|
69
|
-
</details>
|
|
70
|
-
|
|
71
|
-
<h2>Image with an relative image</h2>
|
|
72
|
-
|
|
73
|
-
<details>
|
|
74
|
-
<summary>
|
|
75
|
-
<h3>layout=responsive</h3>
|
|
76
|
-
</summary>
|
|
77
|
-
<Image src='/image.jpg' layout='responsive' width={imgWidth} height={imgHeight} />
|
|
78
|
-
</details>
|
|
79
|
-
|
|
80
|
-
<details>
|
|
81
|
-
<summary>
|
|
82
|
-
<h3>layout=fixed</h3>
|
|
83
|
-
</summary>
|
|
84
|
-
<Image src='/image.jpg' layout='fixed' width={imgWidth / 4} height={imgHeight / 4} />
|
|
85
|
-
</details>
|
|
86
|
-
|
|
87
|
-
<details>
|
|
88
|
-
<summary>
|
|
89
|
-
<h3>layout=intrinsic</h3>
|
|
90
|
-
</summary>
|
|
91
|
-
<Image src='/image.jpg' layout='intrinsic' width={imgWidth} height={imgHeight} />
|
|
92
|
-
</details>
|
|
93
|
-
|
|
94
|
-
<details>
|
|
95
|
-
<summary>
|
|
96
|
-
<h3>layout=fill</h3>
|
|
97
|
-
</summary>
|
|
98
|
-
<div style={{ height: 200, backgroundColor: 'darkgray' }}>
|
|
99
|
-
<Image src='/image.jpg' layout='fill' style={{ objectFit: 'contain' }} />
|
|
100
|
-
</div>
|
|
101
|
-
</details>
|
|
102
|
-
|
|
103
|
-
<h2>Image with an imported image</h2>
|
|
104
|
-
|
|
105
|
-
<details>
|
|
106
|
-
<summary>
|
|
107
|
-
<h3>layout=responsive</h3>
|
|
108
|
-
</summary>
|
|
109
|
-
<Image src={image} layout='responsive' sizes='100vw' />
|
|
110
|
-
</details>
|
|
111
|
-
|
|
112
|
-
<details>
|
|
113
|
-
<summary>
|
|
114
|
-
<h3>layout=fixed</h3>
|
|
115
|
-
</summary>
|
|
116
|
-
<Image src={image} layout='fixed' width={imgWidth / 4} height={imgHeight / 4} />
|
|
117
|
-
</details>
|
|
118
|
-
|
|
119
|
-
<details>
|
|
120
|
-
<summary>
|
|
121
|
-
<h3>layout=intrinsic</h3>
|
|
122
|
-
</summary>
|
|
123
|
-
<Image src={image} layout='intrinsic' sizes='100vw' />
|
|
124
|
-
</details>
|
|
125
|
-
|
|
126
|
-
<details>
|
|
127
|
-
<summary>
|
|
128
|
-
<h3>layout=fill</h3>
|
|
129
|
-
</summary>
|
|
130
|
-
<div style={{ height: 200, backgroundColor: 'darkgray' }}>
|
|
131
|
-
<Image src={image} layout='fill' style={{ objectFit: 'contain' }} />
|
|
132
|
-
</div>
|
|
133
|
-
</details>
|
|
134
|
-
</>
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export default Index
|
package/example/public/image.jpg
DELETED
|
Binary file
|
package/example/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es5",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"strict": false,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"noEmit": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"module": "esnext",
|
|
12
|
-
"moduleResolution": "node",
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"isolatedModules": true,
|
|
15
|
-
"jsx": "preserve"
|
|
16
|
-
},
|
|
17
|
-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
|
18
|
-
"exclude": ["**/node_modules", "**/.*/"]
|
|
19
|
-
}
|