@graphcommerce/graphcms-ui 3.0.4 → 3.0.7

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,33 +1,53 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1353](https://github.com/graphcommerce-org/graphcommerce/pull/1353) [`0e5ee7ba8`](https://github.com/graphcommerce-org/graphcommerce/commit/0e5ee7ba89698e5e711001e846ed182528060cba) Thanks [@paales](https://github.com/paales)! - Eslint: enable rules that were previously disabled and make fixes
8
+
9
+ - Updated dependencies [[`49a2d6617`](https://github.com/graphcommerce-org/graphcommerce/commit/49a2d661712e1787fba46c6195f7b559189e23d9), [`f67da3cfb`](https://github.com/graphcommerce-org/graphcommerce/commit/f67da3cfbe2dcf5ea23519d088c5aa0074029182), [`218766869`](https://github.com/graphcommerce-org/graphcommerce/commit/218766869f7468c067a590857c942f3819f8add4), [`0e5ee7ba8`](https://github.com/graphcommerce-org/graphcommerce/commit/0e5ee7ba89698e5e711001e846ed182528060cba), [`829b8690b`](https://github.com/graphcommerce-org/graphcommerce/commit/829b8690bc5d0a46e596299e4120e9837a9f179c)]:
10
+ - @graphcommerce/next-ui@4.4.0
11
+
12
+ ## 3.0.6
13
+
14
+ ### Patch Changes
15
+
16
+ - [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`ae7385b94`](https://github.com/graphcommerce-org/graphcommerce/commit/ae7385b943e591fcd6fe9e5747f22e03a73e481a) Thanks [@paales](https://github.com/paales)! - RichText component’s first and last element should have no marginTop and marginBottom respectively unless withMargin is specified
17
+
18
+ - Updated dependencies [[`5266388ea`](https://github.com/graphcommerce-org/graphcommerce/commit/5266388eaffda41592623ef7a3ddbbe03c8e0dad), [`9b35403d9`](https://github.com/graphcommerce-org/graphcommerce/commit/9b35403d9dbb2606ac7cf3bb641a0f9cc3d8a2ba), [`0298a0de1`](https://github.com/graphcommerce-org/graphcommerce/commit/0298a0de1d13e543c4124a6a099297b4e27e2b05), [`815132ea4`](https://github.com/graphcommerce-org/graphcommerce/commit/815132ea43937b4b84b59ec9974ac593cb4eb456), [`3326742a0`](https://github.com/graphcommerce-org/graphcommerce/commit/3326742a0dceb45f0cac4741ca09dc4d4f09ad90), [`7a3799bfc`](https://github.com/graphcommerce-org/graphcommerce/commit/7a3799bfc107f26aa9991a91db5f228e3476f4aa), [`9a77f88ed`](https://github.com/graphcommerce-org/graphcommerce/commit/9a77f88ed26cbecdae9a135c3cb234a5b7ecf4df), [`0eeaad304`](https://github.com/graphcommerce-org/graphcommerce/commit/0eeaad30461b1d5b486438f0287fa76d49429044), [`bc5213547`](https://github.com/graphcommerce-org/graphcommerce/commit/bc52135471479c83d989449dad24798112e898f4), [`3f1912f55`](https://github.com/graphcommerce-org/graphcommerce/commit/3f1912f553318d5888f8af2b841918ef4ae96a84), [`b6c68cda8`](https://github.com/graphcommerce-org/graphcommerce/commit/b6c68cda8836a1d0c78ef351899cec9ec1037385)]:
19
+ - @graphcommerce/next-ui@4.3.0
20
+
21
+ ## 3.0.5
22
+
23
+ ### Patch Changes
24
+
25
+ - [#1307](https://github.com/ho-nl/m2-pwa/pull/1307) [`bd10506d3`](https://github.com/ho-nl/m2-pwa/commit/bd10506d32fdbc91d01dadc29a12ebd1e0943655) Thanks [@paales](https://github.com/paales)! - All default exports are now named exports internally and all `index.tsx` are renamed to the component name.
26
+
27
+ * [#1307](https://github.com/ho-nl/m2-pwa/pull/1307) [`27cb1f2d8`](https://github.com/ho-nl/m2-pwa/commit/27cb1f2d8dbfb8f1b301ce56fb6a2b6c1fc6a5ef) Thanks [@paales](https://github.com/paales)! - upgrade dependencies
28
+
29
+ * Updated dependencies [[`3d63b39f7`](https://github.com/ho-nl/m2-pwa/commit/3d63b39f7e330d1827a32dba782667d7b21adaba), [`bd10506d3`](https://github.com/ho-nl/m2-pwa/commit/bd10506d32fdbc91d01dadc29a12ebd1e0943655), [`27cb1f2d8`](https://github.com/ho-nl/m2-pwa/commit/27cb1f2d8dbfb8f1b301ce56fb6a2b6c1fc6a5ef)]:
30
+ - @graphcommerce/next-ui@4.2.4
31
+ - @graphcommerce/graphql@3.0.4
32
+ - @graphcommerce/image@3.1.1
33
+
3
34
  ## 3.0.4
4
35
 
5
36
  ### Patch Changes
6
37
 
7
- - [#1285](https://github.com/ho-nl/m2-pwa/pull/1285)
8
- [`27368edbd`](https://github.com/ho-nl/m2-pwa/commit/27368edbdb0543658bf925cfa33b61de0e6dda38)
9
- Thanks [@paales](https://github.com/paales)! - Make sure svg icons from graphcms aren't actually
10
- processed by the next image optimization
11
- - Updated dependencies
12
- [[`c85294ba6`](https://github.com/ho-nl/m2-pwa/commit/c85294ba6d742ce78c074559a1e95409b25a5017)]:
38
+ - [#1285](https://github.com/ho-nl/m2-pwa/pull/1285) [`27368edbd`](https://github.com/ho-nl/m2-pwa/commit/27368edbdb0543658bf925cfa33b61de0e6dda38) Thanks [@paales](https://github.com/paales)! - Make sure svg icons from graphcms aren't actually processed by the next image optimization
39
+ - Updated dependencies [[`c85294ba6`](https://github.com/ho-nl/m2-pwa/commit/c85294ba6d742ce78c074559a1e95409b25a5017)]:
13
40
  - @graphcommerce/next-ui@4.1.3
14
41
 
15
42
  ## 3.0.3
16
43
 
17
44
  ### Patch Changes
18
45
 
19
- - [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96)
20
- Thanks [@paales](https://github.com/paales)! - made packages public
46
+ - [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96) Thanks [@paales](https://github.com/paales)! - made packages public
21
47
 
22
- * [#1278](https://github.com/ho-nl/m2-pwa/pull/1278)
23
- [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20)
24
- Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Upgraded dependencies to the latest version
48
+ * [#1278](https://github.com/ho-nl/m2-pwa/pull/1278) [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Upgraded dependencies to the latest version
25
49
 
26
- * Updated dependencies
27
- [[`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96),
28
- [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20),
29
- [`3a719c88c`](https://github.com/ho-nl/m2-pwa/commit/3a719c88cad1eab58602de28c41adc0fc4827e1d),
30
- [`5ffcb56bf`](https://github.com/ho-nl/m2-pwa/commit/5ffcb56bfcbe49ebeaf24f9341e819a145ab9a14)]:
50
+ * Updated dependencies [[`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96), [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20), [`3a719c88c`](https://github.com/ho-nl/m2-pwa/commit/3a719c88cad1eab58602de28c41adc0fc4827e1d), [`5ffcb56bf`](https://github.com/ho-nl/m2-pwa/commit/5ffcb56bfcbe49ebeaf24f9341e819a145ab9a14)]:
31
51
  - @graphcommerce/graphql@3.0.3
32
52
  - @graphcommerce/image@3.1.0
33
53
  - @graphcommerce/next-ui@4.1.2
@@ -36,28 +56,13 @@
36
56
 
37
57
  ### Patch Changes
38
58
 
39
- - [#1276](https://github.com/ho-nl/m2-pwa/pull/1276)
40
- [`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2)
41
- Thanks [@paales](https://github.com/paales)! - We've moved lots of internal packages from
42
- `dependencies` to `peerDependencies`. The result of this is that there will be significantly less
43
- duplicate packages in the node_modules folders.
44
-
45
- * [#1276](https://github.com/ho-nl/m2-pwa/pull/1276)
46
- [`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)
47
- Thanks [@paales](https://github.com/paales)! - Upgraded to
48
- [NextJS 12.1](https://nextjs.org/blog/next-12-1)! This is just for compatibility, but we'll be
49
- implementing
50
- [On-demand Incremental Static Regeneration](https://nextjs.org/blog/next-12-1#on-demand-incremental-static-regeneration-beta)
51
- soon.
52
-
53
- This will greatly reduce the requirement to rebuid stuff and we'll add a management UI on the
54
- frontend to be able to revalidate pages manually.
55
-
56
- * Updated dependencies
57
- [[`381e4c86a`](https://github.com/ho-nl/m2-pwa/commit/381e4c86a8321ce96e1fa5c7d3c0a0c0ff3e02c7),
58
- [`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2),
59
- [`e7c8e2756`](https://github.com/ho-nl/m2-pwa/commit/e7c8e2756d637cbcd2e793d62ef5721d35d9fa7b),
60
- [`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)]:
59
+ - [#1276](https://github.com/ho-nl/m2-pwa/pull/1276) [`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2) Thanks [@paales](https://github.com/paales)! - We've moved lots of internal packages from `dependencies` to `peerDependencies`. The result of this is that there will be significantly less duplicate packages in the node_modules folders.
60
+
61
+ * [#1276](https://github.com/ho-nl/m2-pwa/pull/1276) [`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d) Thanks [@paales](https://github.com/paales)! - Upgraded to [NextJS 12.1](https://nextjs.org/blog/next-12-1)! This is just for compatibility, but we'll be implementing [On-demand Incremental Static Regeneration](https://nextjs.org/blog/next-12-1#on-demand-incremental-static-regeneration-beta) soon.
62
+
63
+ This will greatly reduce the requirement to rebuid stuff and we'll add a management UI on the frontend to be able to revalidate pages manually.
64
+
65
+ * Updated dependencies [[`381e4c86a`](https://github.com/ho-nl/m2-pwa/commit/381e4c86a8321ce96e1fa5c7d3c0a0c0ff3e02c7), [`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2), [`e7c8e2756`](https://github.com/ho-nl/m2-pwa/commit/e7c8e2756d637cbcd2e793d62ef5721d35d9fa7b), [`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)]:
61
66
  - @graphcommerce/next-ui@4.1.1
62
67
  - @graphcommerce/graphql@3.0.2
63
68
  - @graphcommerce/image@3.0.2
@@ -66,11 +71,8 @@
66
71
 
67
72
  ### Patch Changes
68
73
 
69
- - [`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514)
70
- Thanks [@paales](https://github.com/paales)! - Added homepage and repository package.json files,
71
- so that the packages link to back to the website and repository
72
- - Updated dependencies
73
- [[`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514)]:
74
+ - [`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514) Thanks [@paales](https://github.com/paales)! - Added homepage and repository package.json files, so that the packages link to back to the website and repository
75
+ - Updated dependencies [[`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514)]:
74
76
  - @graphcommerce/graphql@3.0.1
75
77
  - @graphcommerce/image@3.0.1
76
78
  - @graphcommerce/next-ui@4.0.1
@@ -79,100 +81,79 @@
79
81
 
80
82
  ### Major Changes
81
83
 
82
- - [#1258](https://github.com/ho-nl/m2-pwa/pull/1258)
83
- [`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)
84
- Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5
84
+ - [#1258](https://github.com/ho-nl/m2-pwa/pull/1258) [`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05) Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5
85
85
 
86
86
  ### Patch Changes
87
87
 
88
- - Updated dependencies
89
- [[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)]:
88
+ - Updated dependencies [[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)]:
90
89
  - @graphcommerce/graphql@3.0.0
91
90
  - @graphcommerce/image@3.0.0
92
91
  - @graphcommerce/next-ui@4.0.0
93
92
 
94
- All notable changes to this project will be documented in this file. See
95
- [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
93
+ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
96
94
 
97
95
  ## [2.106.12](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.106.11...@graphcommerce/graphcms-ui@2.106.12) (2021-12-17)
98
96
 
99
97
  ### Bug Fixes
100
98
 
101
- - make sure we're able to render table_header_cell and do not throw when rendering unknown elements
102
- in production
103
- ([f7b7972](https://github.com/ho-nl/m2-pwa/commit/f7b797272f5765801c3f2e217fa9905f65dbe6d6))
99
+ - make sure we're able to render table_header_cell and do not throw when rendering unknown elements in production ([f7b7972](https://github.com/ho-nl/m2-pwa/commit/f7b797272f5765801c3f2e217fa9905f65dbe6d6))
104
100
 
105
101
  # [2.106.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.105.4...@graphcommerce/graphcms-ui@2.106.0) (2021-12-01)
106
102
 
107
103
  ### Bug Fixes
108
104
 
109
105
  - build ([72d9353](https://github.com/ho-nl/m2-pwa/commit/72d935376a1967cc976c20b984ef15a862e5d0f4))
110
- - fontWeights
111
- ([7172527](https://github.com/ho-nl/m2-pwa/commit/71725272fe9f0b854d918ae357a668f641bfe8e5))
112
- - hero text spacing
113
- ([79dd6aa](https://github.com/ho-nl/m2-pwa/commit/79dd6aa2fe576104ebbbdd092f6b415d319dec48))
114
- - render bug stroke variable fonts
115
- ([582de18](https://github.com/ho-nl/m2-pwa/commit/582de187800ee9c53718bf43a39ca77398d21b91)),
116
- closes
117
- [/github.com/rsms/inter/issues/292#issuecomment-674993644](https://github.com//github.com/rsms/inter/issues/292/issues/issuecomment-674993644)
106
+ - fontWeights ([7172527](https://github.com/ho-nl/m2-pwa/commit/71725272fe9f0b854d918ae357a668f641bfe8e5))
107
+ - hero text spacing ([79dd6aa](https://github.com/ho-nl/m2-pwa/commit/79dd6aa2fe576104ebbbdd092f6b415d319dec48))
108
+ - render bug stroke variable fonts ([582de18](https://github.com/ho-nl/m2-pwa/commit/582de187800ee9c53718bf43a39ca77398d21b91)), closes [/github.com/rsms/inter/issues/292#issuecomment-674993644](https://github.com//github.com/rsms/inter/issues/292/issues/issuecomment-674993644)
118
109
 
119
110
  ### Features
120
111
 
121
- - breakpointVal
122
- ([0294503](https://github.com/ho-nl/m2-pwa/commit/029450343051cf6995babad9f9b42c7e6ad1094e))
123
- - responsiveTyp
124
- ([6108b61](https://github.com/ho-nl/m2-pwa/commit/6108b6148e76ddbbe2db1614f10aaf88423db5ca))
112
+ - breakpointVal ([0294503](https://github.com/ho-nl/m2-pwa/commit/029450343051cf6995babad9f9b42c7e6ad1094e))
113
+ - responsiveTyp ([6108b61](https://github.com/ho-nl/m2-pwa/commit/6108b6148e76ddbbe2db1614f10aaf88423db5ca))
125
114
 
126
115
  # [2.105.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.104.29...@graphcommerce/graphcms-ui@2.105.0) (2021-11-12)
127
116
 
128
117
  ### Features
129
118
 
130
- - added tons of translations
131
- ([9bb0ac7](https://github.com/ho-nl/m2-pwa/commit/9bb0ac709b58df6ea6141e92e4923a5ca9ae2963))
119
+ - added tons of translations ([9bb0ac7](https://github.com/ho-nl/m2-pwa/commit/9bb0ac709b58df6ea6141e92e4923a5ca9ae2963))
132
120
 
133
121
  ## [2.104.29](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.104.28...@graphcommerce/graphcms-ui@2.104.29) (2021-11-12)
134
122
 
135
123
  ### Bug Fixes
136
124
 
137
- - must have smaller sizes for mobile
138
- ([34cf81e](https://github.com/ho-nl/m2-pwa/commit/34cf81eed6c5996f70be8b2c10888e44fad4d57f))
125
+ - must have smaller sizes for mobile ([34cf81e](https://github.com/ho-nl/m2-pwa/commit/34cf81eed6c5996f70be8b2c10888e44fad4d57f))
139
126
 
140
127
  ## [2.104.18](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.104.17...@graphcommerce/graphcms-ui@2.104.18) (2021-11-04)
141
128
 
142
129
  ### Bug Fixes
143
130
 
144
- - remove hardcoded fontSize
145
- ([e4e09e1](https://github.com/ho-nl/m2-pwa/commit/e4e09e11baeb8edeff634550b8cdb88571d96911))
131
+ - remove hardcoded fontSize ([e4e09e1](https://github.com/ho-nl/m2-pwa/commit/e4e09e11baeb8edeff634550b8cdb88571d96911))
146
132
 
147
133
  ## [2.104.16](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.104.15...@graphcommerce/graphcms-ui@2.104.16) (2021-11-03)
148
134
 
149
135
  ### Bug Fixes
150
136
 
151
- - various accessibility improvements
152
- ([47481a9](https://github.com/ho-nl/m2-pwa/commit/47481a9a882ba87968de6dd797557b0b275d75fb))
137
+ - various accessibility improvements ([47481a9](https://github.com/ho-nl/m2-pwa/commit/47481a9a882ba87968de6dd797557b0b275d75fb))
153
138
 
154
139
  ## [2.104.9](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.104.8...@graphcommerce/graphcms-ui@2.104.9) (2021-11-02)
155
140
 
156
141
  ### Bug Fixes
157
142
 
158
- - color from palette
159
- ([283cca1](https://github.com/ho-nl/m2-pwa/commit/283cca169ec00cbac8b973e14e6b77a443e26c99))
160
- - darkMode
161
- ([c7573de](https://github.com/ho-nl/m2-pwa/commit/c7573de6bb80643b26931c35ac61735539e7fbf0))
143
+ - color from palette ([283cca1](https://github.com/ho-nl/m2-pwa/commit/283cca169ec00cbac8b973e14e6b77a443e26c99))
144
+ - darkMode ([c7573de](https://github.com/ho-nl/m2-pwa/commit/c7573de6bb80643b26931c35ac61735539e7fbf0))
162
145
 
163
146
  ## [2.104.3](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.104.2...@graphcommerce/graphcms-ui@2.104.3) (2021-10-28)
164
147
 
165
148
  ### Bug Fixes
166
149
 
167
- - default heading margins for CMS content
168
- ([ac7c24f](https://github.com/ho-nl/m2-pwa/commit/ac7c24f731abf9573ad93d534d84b9f7c1b16a2b))
150
+ - default heading margins for CMS content ([ac7c24f](https://github.com/ho-nl/m2-pwa/commit/ac7c24f731abf9573ad93d534d84b9f7c1b16a2b))
169
151
 
170
152
  # [2.104.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.103.30...@graphcommerce/graphcms-ui@2.104.0) (2021-10-27)
171
153
 
172
154
  ### Features
173
155
 
174
- - **nextjs:** upgraded to nextjs 12
175
- ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
156
+ - **nextjs:** upgraded to nextjs 12 ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
176
157
 
177
158
  ## [2.103.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.103.0...@graphcommerce/graphcms-ui@2.103.1) (2021-09-27)
178
159
 
@@ -182,75 +163,53 @@ All notable changes to this project will be documented in this file. See
182
163
 
183
164
  ### Bug Fixes
184
165
 
185
- - ignore md files from triggering version updates
186
- ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
187
- - implement next-ui barrel imports
188
- ([75bea70](https://github.com/ho-nl/m2-pwa/commit/75bea703dba898f18a2a1dfa3243ebd0a4e6f0e1))
189
- - narrow quote on mobile
190
- ([e06ccc2](https://github.com/ho-nl/m2-pwa/commit/e06ccc25048124431dcdb786f1719f688a5e429c))
191
- - remove conflicting files
192
- ([0c17ae4](https://github.com/ho-nl/m2-pwa/commit/0c17ae46be62b775ac83b35f11c532ce2d9401a3))
193
- - since all links are of next/link we need to add passHref for custom components
194
- ([16fb931](https://github.com/ho-nl/m2-pwa/commit/16fb93100d367203ea79bb4f93357221253f2ecd))
166
+ - ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
167
+ - implement next-ui barrel imports ([75bea70](https://github.com/ho-nl/m2-pwa/commit/75bea703dba898f18a2a1dfa3243ebd0a4e6f0e1))
168
+ - narrow quote on mobile ([e06ccc2](https://github.com/ho-nl/m2-pwa/commit/e06ccc25048124431dcdb786f1719f688a5e429c))
169
+ - remove conflicting files ([0c17ae4](https://github.com/ho-nl/m2-pwa/commit/0c17ae46be62b775ac83b35f11c532ce2d9401a3))
170
+ - since all links are of next/link we need to add passHref for custom components ([16fb931](https://github.com/ho-nl/m2-pwa/commit/16fb93100d367203ea79bb4f93357221253f2ecd))
195
171
 
196
172
  ### Features
197
173
 
198
- - created stacked-pages package
199
- ([d86008e](https://github.com/ho-nl/m2-pwa/commit/d86008ee659ccb25b194a41d624b394a1ddbd088))
200
- - **image:** introduced completely rewritten Image component
201
- ([e3413b3](https://github.com/ho-nl/m2-pwa/commit/e3413b3a57392d6571ea64cb8d9c8dca05ea31df))
202
- - implemented the ability to load graphcms content by URL
203
- ([99bc970](https://github.com/ho-nl/m2-pwa/commit/99bc970fc46d40b7efa99a71819529aeaa206bb4))
204
- - introduced graphcms-ui package to quickly build pages
205
- ([04d89c3](https://github.com/ho-nl/m2-pwa/commit/04d89c3fecf25f64923caf437eeb4b73f8887102))
206
- - introduces framer-next-pages and framer-sheet to next-ui and soxbase package
207
- ([e04ad8a](https://github.com/ho-nl/m2-pwa/commit/e04ad8a94cd1fd5a7c5575c9db7916b6e8a88f16))
208
- - next.js 11
209
- ([7d61407](https://github.com/ho-nl/m2-pwa/commit/7d614075a778f488045034f74be4f75b93f63c43))
210
- - **playwright:** added new playwright package to enable browser testing
211
- ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
212
- - renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of
213
- [@reachdigital](https://github.com/reachdigital)
214
- ([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
215
- - upgrade to node 14
216
- ([d079a75](https://github.com/ho-nl/m2-pwa/commit/d079a751e9bfd8dc7f5009d2c9f31c336a0c96ab))
217
- - upgraded to nextjs 11
218
- ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
174
+ - created stacked-pages package ([d86008e](https://github.com/ho-nl/m2-pwa/commit/d86008ee659ccb25b194a41d624b394a1ddbd088))
175
+ - **image:** introduced completely rewritten Image component ([e3413b3](https://github.com/ho-nl/m2-pwa/commit/e3413b3a57392d6571ea64cb8d9c8dca05ea31df))
176
+ - implemented the ability to load graphcms content by URL ([99bc970](https://github.com/ho-nl/m2-pwa/commit/99bc970fc46d40b7efa99a71819529aeaa206bb4))
177
+ - introduced graphcms-ui package to quickly build pages ([04d89c3](https://github.com/ho-nl/m2-pwa/commit/04d89c3fecf25f64923caf437eeb4b73f8887102))
178
+ - introduces framer-next-pages and framer-sheet to next-ui and soxbase package ([e04ad8a](https://github.com/ho-nl/m2-pwa/commit/e04ad8a94cd1fd5a7c5575c9db7916b6e8a88f16))
179
+ - next.js 11 ([7d61407](https://github.com/ho-nl/m2-pwa/commit/7d614075a778f488045034f74be4f75b93f63c43))
180
+ - **playwright:** added new playwright package to enable browser testing ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
181
+ - 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))
182
+ - upgrade to node 14 ([d079a75](https://github.com/ho-nl/m2-pwa/commit/d079a751e9bfd8dc7f5009d2c9f31c336a0c96ab))
183
+ - upgraded to nextjs 11 ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
219
184
 
220
185
  ### Reverts
221
186
 
222
- - Revert "chore: upgrade @apollo/client"
223
- ([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
187
+ - Revert "chore: upgrade @apollo/client" ([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
224
188
 
225
189
  # Change Log
226
190
 
227
- All notable changes to this project will be documented in this file. See
228
- [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
191
+ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
229
192
 
230
193
  # [2.102.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.101.9...@graphcommerce/graphcms-ui@2.102.0) (2021-08-12)
231
194
 
232
195
  ### Features
233
196
 
234
- - upgraded to nextjs 11
235
- ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
197
+ - upgraded to nextjs 11 ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
236
198
 
237
199
  ## [2.101.9](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.101.8...@graphcommerce/graphcms-ui@2.101.9) (2021-08-09)
238
200
 
239
201
  ### Reverts
240
202
 
241
- - Revert "chore: upgrade @apollo/client"
242
- ([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
203
+ - Revert "chore: upgrade @apollo/client" ([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
243
204
 
244
205
  # [2.101.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.100.18...@graphcommerce/graphcms-ui@2.101.0) (2021-07-26)
245
206
 
246
207
  ### Features
247
208
 
248
- - **playwright:** added new playwright package to enable browser testing
249
- ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
209
+ - **playwright:** added new playwright package to enable browser testing ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
250
210
 
251
211
  ## [2.100.11](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphcms-ui@2.100.10...@graphcommerce/graphcms-ui@2.100.11) (2021-07-20)
252
212
 
253
213
  ### Bug Fixes
254
214
 
255
- - ignore md files from triggering version updates
256
- ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
215
+ - ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
@@ -1,22 +1,59 @@
1
+ /* eslint-disable @typescript-eslint/no-use-before-define */
1
2
  import { SxProps, Theme } from '@mui/material'
2
3
  import { defaultRenderers } from './defaultRenderers'
3
4
  import { defaultSxRenderer } from './defaultSxRenderer'
4
5
  import {
5
6
  AdditionalProps,
6
7
  Renderers,
8
+ Renderer,
7
9
  SxRenderer,
8
10
  TextNode,
9
11
  ElementOrTextNode,
10
12
  ElementNode,
13
+ SimpleElement,
11
14
  } from './types'
12
15
 
13
- const RenderText = ({ classes, text, ...textProps }: TextNode) => {
14
- let result = <>{text}</>
15
- if (textProps.bold) result = <strong>{result}</strong>
16
- if (textProps.italic) result = <em>{result}</em>
17
- if (textProps.underlined) result = <em>{result}</em>
16
+ const sxArr = (sxAny?: SxProps<Theme> | false) => {
17
+ if (!sxAny) return []
18
+ return Array.isArray(sxAny) ? sxAny : [sxAny]
19
+ }
20
+
21
+ function useRenderProps(
22
+ { first, last, sxRenderer }: Pick<AdditionalProps, 'first' | 'last' | 'sxRenderer'>,
23
+ type?: ElementNode['type'],
24
+ ) {
25
+ if (!type) return []
26
+ const sx: SxProps<Theme> = sxRenderer?.[type] ?? []
27
+
28
+ return [
29
+ ...sxArr(sxRenderer.all),
30
+ ...sxArr(sx),
31
+ ...sxArr(first && sxRenderer.first),
32
+ ...sxArr(last && sxRenderer.last),
33
+ ]
34
+ }
35
+
36
+ function RenderText({
37
+ text,
38
+ renderers,
39
+ sxRenderer,
40
+ first,
41
+ last,
42
+ ...textProps
43
+ }: TextNode & AdditionalProps) {
44
+ let type: 'bold' | 'italic' | 'underlined' | undefined
45
+
46
+ if (textProps.bold) type = 'bold'
47
+ if (textProps.italic) type = 'italic'
48
+ if (textProps.underlined) type = 'underlined'
18
49
 
19
- return result
50
+ const sx = useRenderProps({ first, last, sxRenderer }, type)
51
+
52
+ if (!type) return <>{text}</>
53
+
54
+ const Component: Renderer<SimpleElement> = renderers[type]
55
+
56
+ return <Component sx={sx}>{text}</Component>
20
57
  }
21
58
 
22
59
  export function isTextNode(node: ElementOrTextNode): node is TextNode {
@@ -46,29 +83,37 @@ function RenderNode(node: ElementOrTextNode & AdditionalProps) {
46
83
 
47
84
  function RenderChildren({
48
85
  childNodes,
86
+ noMargin,
49
87
  ...props
50
- }: { childNodes: ElementNode['children'] } & AdditionalProps) {
88
+ }: { childNodes: ElementNode['children']; noMargin?: boolean } & AdditionalProps) {
51
89
  return (
52
90
  <>
53
91
  {childNodes.map((node, key) => (
54
- // Since we don't know any unique identifiers of the element and since this doesn't rerender often this is fine.
55
- // eslint-disable-next-line react/no-array-index-key
56
- <RenderNode {...node} {...props} key={key} />
92
+ <RenderNode
93
+ {...node}
94
+ {...props}
95
+ // Since we don't know any unique identifiers of the element and since this doesn't rerender often this is fine.
96
+ // eslint-disable-next-line react/no-array-index-key
97
+ key={key}
98
+ first={noMargin && key === 0}
99
+ last={noMargin && key === childNodes.length - 1}
100
+ />
57
101
  ))}
58
102
  </>
59
103
  )
60
104
  }
61
105
 
62
106
  function RenderElement(element: ElementNode & AdditionalProps) {
63
- const { type, children, sxRenderer, renderers, ...props } = element
107
+ const { type, children, sxRenderer, renderers, first, last, ...props } = element
64
108
 
65
109
  // todo: this has the any type, could be improved
66
- const Component = renderers[type]
67
- const sx = sxRenderer?.[type] ?? []
110
+ const Component: Renderer<SimpleElement> = renderers[type]
111
+
112
+ const sx = useRenderProps({ first, last, sxRenderer }, type)
68
113
 
69
114
  if (Component) {
70
115
  return (
71
- <Component {...props} sx={[sxRenderer.all, ...(Array.isArray(sx) ? sx : [sx])]}>
116
+ <Component {...props} sx={sx}>
72
117
  <RenderChildren childNodes={children} sxRenderer={sxRenderer} renderers={renderers} />
73
118
  </Component>
74
119
  )
@@ -76,17 +121,12 @@ function RenderElement(element: ElementNode & AdditionalProps) {
76
121
 
77
122
  if (process.env.NODE_ENV !== 'production') {
78
123
  console.error(element)
79
- throw Error(`RichText: Unknown Element: ${element.type}`)
124
+ throw Error(`RichText: Unknown Element: ${type}`)
80
125
  }
81
126
  return <RenderChildren childNodes={children} sxRenderer={sxRenderer} renderers={renderers} />
82
127
  }
83
128
 
84
- export type RichTextProps = { raw: ElementNode } & {
85
- renderers?: Partial<Renderers>
86
- sxRenderer?: SxRenderer
87
- }
88
-
89
- export function mergeSxRenderer(base: SxRenderer, sxRenderer?: SxRenderer) {
129
+ function mergeSxRenderer(base: SxRenderer, sxRenderer?: SxRenderer) {
90
130
  if (!sxRenderer) return base
91
131
 
92
132
  return Object.fromEntries(
@@ -106,12 +146,38 @@ export function mergeSxRenderer(base: SxRenderer, sxRenderer?: SxRenderer) {
106
146
  ) as SxRenderer
107
147
  }
108
148
 
109
- export function RichText({ raw, sxRenderer, renderers }: RichTextProps) {
149
+ export type RichTextProps = { raw: ElementNode } & {
150
+ renderers?: Partial<Renderers>
151
+ /**
152
+ * Allows you to theme all the types of components
153
+ *
154
+ * ```tsx
155
+ * function MyComponent()f {
156
+ * return <RichText
157
+ * sxRenderer={{
158
+ * paragraph: (theme) => ({
159
+ * columnCount: { xs: 1, md: getColumnCount(props, 2) },
160
+ * columnGap: theme.spacings.md,
161
+ * }),
162
+ * //other props here
163
+ * }}
164
+ * />
165
+ * }
166
+ * ```
167
+ */
168
+ sxRenderer?: SxRenderer
169
+
170
+ /** By default the component will render the first and last element without any margins */
171
+ withMargin?: boolean
172
+ }
173
+
174
+ export function RichText({ raw, sxRenderer, renderers, withMargin = false }: RichTextProps) {
110
175
  return (
111
176
  <RenderChildren
112
177
  childNodes={raw.children}
113
178
  sxRenderer={mergeSxRenderer(defaultSxRenderer, sxRenderer)}
114
179
  renderers={{ ...defaultRenderers, ...renderers }}
180
+ noMargin={!withMargin}
115
181
  />
116
182
  )
117
183
  }
@@ -27,9 +27,9 @@ export const defaultRenderers: Renderers = {
27
27
  video: ({ src, width, height, title, mimeType }) => (
28
28
  <Asset asset={{ url: src, alt: title, width, height, mimeType }} />
29
29
  ),
30
- link: ({ href, ...props }) => (
30
+ link: ({ href, openInNewTab, ...props }) => (
31
31
  <PageLink href={href} passHref>
32
- <Link underline='hover' {...props} />
32
+ <Link underline='hover' {...props} target={openInNewTab ? '_blank' : undefined} />
33
33
  </PageLink>
34
34
  ),
35
35
  table: (props) => <Box component='table' {...props} />,
@@ -39,4 +39,7 @@ export const defaultRenderers: Renderers = {
39
39
  table_row: (props) => <Box component='tr' {...props} />,
40
40
  table_cell: (props) => <Box component='td' {...props} />,
41
41
  code: (props) => <Box component='code' {...props} />,
42
+ bold: (props) => <Box component='strong' fontWeight='bold' {...props} />,
43
+ italic: (props) => <Box component='em' fontStyle='italic' {...props} />,
44
+ underlined: (props) => <Box component='span' {...props} />,
42
45
  }
@@ -5,7 +5,12 @@ export const defaultSxRenderer: SxRenderer = {
5
5
  '&:empty': {
6
6
  display: 'none',
7
7
  },
8
- '&:last-of-type': { marginBottom: 0 },
8
+ },
9
+ first: {
10
+ marginTop: 0,
11
+ },
12
+ last: {
13
+ marginBottom: 0,
9
14
  },
10
15
  paragraph: {
11
16
  marginBottom: '1em',
@@ -18,22 +23,18 @@ export const defaultSxRenderer: SxRenderer = {
18
23
  'heading-two': {
19
24
  marginTop: '0.5em',
20
25
  marginBottom: '0.5em',
21
- '&:first-of-type': { marginTop: 0 },
22
26
  },
23
27
  'heading-three': {
24
28
  marginTop: '0.5em',
25
29
  marginBottom: '0.5em',
26
- '&:first-of-type': { marginTop: 0 },
27
30
  },
28
31
  'heading-four': {
29
32
  marginTop: '0.5em',
30
33
  marginBottom: '0.5em',
31
- '&:first-of-type': { marginTop: 0 },
32
34
  },
33
35
  'heading-five': {
34
36
  marginTop: '0.5em',
35
37
  marginBottom: '0.5em',
36
- '&:first-of-type': { marginTop: 0 },
37
38
  },
38
39
  image: {
39
40
  width: '100%',
@@ -100,4 +101,7 @@ export const defaultSxRenderer: SxRenderer = {
100
101
  link: {
101
102
  wordBreak: 'break-word',
102
103
  },
104
+ underlined: {
105
+ textDecoration: 'underline',
106
+ },
103
107
  }
@@ -22,8 +22,11 @@ type BaseElementTypes =
22
22
  | 'table_row'
23
23
  | 'table_cell'
24
24
  | 'code'
25
+ | 'bold'
26
+ | 'italic'
27
+ | 'underlined'
25
28
 
26
- type SimpleElement = {
29
+ export type SimpleElement = {
27
30
  children: ElementOrTextNode[]
28
31
  type: LiteralUnion<BaseElementTypes, string>
29
32
  }
@@ -40,6 +43,7 @@ type LinkElement = {
40
43
  type: 'link'
41
44
  children: ElementOrTextNode[]
42
45
  href: string
46
+ openInNewTab?: boolean
43
47
  }
44
48
 
45
49
  type ImageElement = {
@@ -72,8 +76,8 @@ export type ElementNode = SimpleElement | LinkElement | ImageElement | VideoElem
72
76
  export type ElementOrTextNode = ElementNode | TextNode
73
77
 
74
78
  type RendererBase = { sx?: SxProps<Theme>; children?: React.ReactNode }
75
- type Renderer<P extends ElementNode> = (
76
- props: Omit<P, 'children'> & RendererBase,
79
+ export type Renderer<P extends ElementNode> = (
80
+ props: Omit<P, 'children' | 'type'> & RendererBase,
77
81
  ) => React.ReactElement | null
78
82
 
79
83
  export type Renderers = {
@@ -86,7 +90,12 @@ export type Renderers = {
86
90
  }
87
91
 
88
92
  export type SxRenderer = {
89
- [k in keyof Renderers | 'all']?: SxProps<Theme>
93
+ [k in keyof Renderers | 'all' | 'first' | 'last']?: SxProps<Theme>
90
94
  }
91
95
 
92
- export type AdditionalProps = { renderers: Renderers; sxRenderer: SxRenderer }
96
+ export type AdditionalProps = {
97
+ renderers: Renderers
98
+ sxRenderer: SxRenderer
99
+ first?: boolean
100
+ last?: boolean
101
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/graphcms-ui",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "3.0.4",
5
+ "version": "3.0.7",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,15 +12,15 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.0.4",
16
- "@graphcommerce/prettier-config-pwa": "^4.0.2",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.2",
16
+ "@graphcommerce/prettier-config-pwa": "^4.0.3",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
- "@playwright/test": "^1.19.1"
18
+ "@playwright/test": "^1.19.2"
19
19
  },
20
20
  "dependencies": {
21
- "@graphcommerce/graphql": "^3.0.3",
22
- "@graphcommerce/image": "^3.1.0",
23
- "@graphcommerce/next-ui": "^4.1.3",
21
+ "@graphcommerce/graphql": "^3.0.4",
22
+ "@graphcommerce/image": "^3.1.1",
23
+ "@graphcommerce/next-ui": "^4.4.0",
24
24
  "type-fest": "^2.12.0"
25
25
  },
26
26
  "peerDependencies": {