sfc-utils 1.3.53 → 1.3.55
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/brands2.js +1 -1
- package/components/authors.mjs +41 -0
- package/components/byline.mjs +79 -0
- package/components/captioncredit.mjs +31 -0
- package/components/heading.mjs +33 -0
- package/components/helpers/datehelpers.mjs +54 -0
- package/components/helpers/utilfunctions.mjs +12 -0
- package/components/sharebuttons.mjs +93 -0
- package/components/topper2.mjs +202 -0
- package/components/wcmimage2.mjs +113 -0
- package/css/nav2.less +1 -0
- package/example/gatsby-config.js +2 -2
- package/example/gatsby-node.js +7 -1
- package/example/project-config.json +3 -3
- package/example/src/components/layout.js +9 -9
- package/example/src/pages/index.js +36 -6
- package/example/src/styles/credittooltip.less +55 -0
- package/example/src/styles/footer.less +48 -38
- package/example/src/styles/{defaults.less → old css/defaults.less} +0 -0
- package/example/src/styles/old css/footer.less +345 -0
- package/example/src/styles/old css/nav.less +187 -0
- package/example/src/styles/old css/project.less +1 -0
- package/example/src/styles/old css/reset.css +95 -0
- package/example/src/styles/old css/seed.less +7 -0
- package/example/src/styles/{typography.css → old css/typography.css} +0 -0
- package/example/src/styles/old css/values.less +74 -0
- package/example/src/styles/project.less +1 -1
- package/example/src/styles/reset.css +4 -2
- package/example/src/styles/seed.less +4 -3
- package/example/src/styles/values.less +129 -0
- package/example/src/styles/variables.less +142 -0
- package/package.json +2 -1
- package/settings.js +10 -1
- package/styles/brandStylesCommon.less +164 -0
- package/styles/modules/share.module.less +25 -0
- package/styles/modules/topper2.module.less +143 -0
- package/styles/modules/wcmimage2.module.less +32 -0
- package/styles/values.less +128 -0
- package/styles/variables.less +143 -0
- package/topper.js +1 -1
package/example/gatsby-config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Add SFC utils
|
|
2
|
-
const {
|
|
2
|
+
const { getBrands2 } = require('../index')
|
|
3
3
|
const { getSettings } = require('./tempsettings')
|
|
4
4
|
const { DateTime } = require('luxon');
|
|
5
5
|
|
|
@@ -83,7 +83,7 @@ let plugins = [
|
|
|
83
83
|
resolve: 'gatsby-plugin-less',
|
|
84
84
|
options: {
|
|
85
85
|
lessOptions: {
|
|
86
|
-
modifyVars:
|
|
86
|
+
modifyVars: getBrands2(settings.PROJECT.MARKET_KEY).styles,
|
|
87
87
|
},
|
|
88
88
|
},
|
|
89
89
|
},
|
package/example/gatsby-node.js
CHANGED
|
@@ -4,12 +4,18 @@
|
|
|
4
4
|
* See: https://www.gatsbyjs.org/docs/node-apis/
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
var {requestImage} = require("./tasks/node-helpers");
|
|
8
|
+
let topperData = require("./src/data/topper2_settings.sheet.json");
|
|
8
9
|
|
|
9
10
|
// Import all the WCM photos you'd like to use in this project
|
|
10
11
|
// NOTE: Leave this as an empty array if you aren't importing any WCM photos, but you won't be able to use the WCMImage component
|
|
11
12
|
const wcmPhotos = [20374215]
|
|
12
13
|
|
|
14
|
+
// Add topper image to wcmPhotos list
|
|
15
|
+
let numStr = (topperData[0].Image).toString()
|
|
16
|
+
let isNum = /^\d+$/.test(numStr.trim())
|
|
17
|
+
if (isNum && !wcmPhotos.includes(numStr.trim())) wcmPhotos.push((numStr.trim()));
|
|
18
|
+
|
|
13
19
|
// Create nodes so GraphQL can access
|
|
14
20
|
exports.sourceNodes = async ({
|
|
15
21
|
actions,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"_comment": "The possible paywall values are 'meter' (hit the paywall after a certain number of free stories), 'paywall' (paywall immediately), 'free' (no wall), or 'meter-no-paywall' (count this against the reader's meter, but never show the paywall on this page)",
|
|
3
3
|
"PAYWALL_SETTING": "meter",
|
|
4
4
|
"EMBEDDED": false,
|
|
5
|
-
"GOOGLE_SHEETS": ["
|
|
5
|
+
"GOOGLE_SHEETS": ["1DUvYnFdxtBv1AXcDI9X00s_opUSu4uHJmd5LNemCN9E"],
|
|
6
6
|
"GOOGLE_DOCS": [],
|
|
7
7
|
|
|
8
8
|
"_domain_explainer": "NOTE: MAIN_DOMAIN will get swapped out based on the MARKEY_KEY when deployed on the server. If you are building it locally for a repo push, you need to set the domain manually here.",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
|
|
35
35
|
"AUTHORS": [
|
|
36
36
|
{
|
|
37
|
-
"AUTHOR_NAME": "
|
|
38
|
-
"AUTHOR_PAGE": "
|
|
37
|
+
"AUTHOR_NAME": "",
|
|
38
|
+
"AUTHOR_PAGE": ""
|
|
39
39
|
}
|
|
40
40
|
]
|
|
41
41
|
}
|
|
@@ -49,20 +49,19 @@ const Layout = ({
|
|
|
49
49
|
SOCIAL_TITLE = social_title || SOCIAL_TITLE
|
|
50
50
|
TITLE = title || TITLE
|
|
51
51
|
|
|
52
|
+
let styleSheetID;
|
|
53
|
+
if ((MARKET_KEY === "SFC") || (MARKET_KEY === "Houston") || (MARKET_KEY === "Albany")) {
|
|
54
|
+
styleSheetID = MARKET_KEY
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
styleSheetID = "default"
|
|
58
|
+
}
|
|
59
|
+
|
|
52
60
|
// Make sure url_add ends with a slash
|
|
53
61
|
if (url_add && url_add.slice(-1) !== "/"){
|
|
54
62
|
url_add += "/"
|
|
55
63
|
}
|
|
56
64
|
|
|
57
|
-
// Set fonts by MARKET_KEY
|
|
58
|
-
switch(MARKET_KEY){
|
|
59
|
-
case "SFC": require('../../../fonts/sfc.less'); break;
|
|
60
|
-
case "Houston": require('../../../fonts/houston.less'); break;
|
|
61
|
-
case "Albany": require('../../../fonts/albany.less'); break;
|
|
62
|
-
// TK many more
|
|
63
|
-
default: require('../../../fonts/default.less'); break;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
65
|
// Determine if app ver
|
|
67
66
|
// Either from the build settings or from the query string
|
|
68
67
|
const isApp = appCheck()
|
|
@@ -161,6 +160,7 @@ const Layout = ({
|
|
|
161
160
|
type="image/x-icon"
|
|
162
161
|
/>
|
|
163
162
|
<link rel="canonical" href={ CANONICAL_URL } />
|
|
163
|
+
<link rel="stylesheet" href={`https://files.sfchronicle.com/brand-styles/${styleSheetID}.css`} />
|
|
164
164
|
|
|
165
165
|
{(isApp || EMBEDDED) ? (
|
|
166
166
|
<meta name="robots" content="noindex, nofollow" />
|
|
@@ -1,31 +1,49 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { graphql } from 'gatsby'
|
|
3
3
|
import PropTypes from 'prop-types'
|
|
4
|
-
// import useSWR from 'swr'
|
|
5
|
-
// import { getData } from '../components/sfc/component-helpers/requesthelpers'
|
|
6
4
|
import Layout from '../components/layout'
|
|
7
5
|
import WCMImage from '../components/sfc/wcmimage'
|
|
8
6
|
import DropCap from '../components/sfc/dropcap'
|
|
9
7
|
import { useCanNativeLazyLoad } from '../components/sfc/component-helpers/customhooks'
|
|
8
|
+
import LazyLoad from 'react-lazyload'
|
|
10
9
|
import Topper from '../components/sfc/topper'
|
|
11
10
|
import RelatedSection from '../components/sfc/relatedsection'
|
|
12
11
|
import CreditsSection from '../components/sfc/creditssection'
|
|
13
12
|
import Ad from '../components/sfc/ad'
|
|
14
13
|
import Newsletter from '../components/sfc/newsletter'
|
|
14
|
+
import NavTop from '../components/sfc/navtop'
|
|
15
|
+
import Byline from '../../../components/byline.mjs'
|
|
16
|
+
import Topper2 from '../../../components/topper2.mjs'
|
|
17
|
+
|
|
15
18
|
let rawCredits;
|
|
16
19
|
try {
|
|
17
20
|
rawCredits = require('../data/credits.sheet.json')
|
|
18
|
-
} catch (err){
|
|
21
|
+
} catch (err) {
|
|
19
22
|
// It's fine
|
|
20
23
|
rawCredits = null;
|
|
21
24
|
}
|
|
25
|
+
|
|
22
26
|
let related_links;
|
|
23
|
-
try{
|
|
27
|
+
try {
|
|
24
28
|
related_links = require('../data/related_links.sheet.json')
|
|
25
|
-
} catch(err){
|
|
29
|
+
} catch(err) {
|
|
26
30
|
related_links = require('../data/sfc/related_links.json')
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
let topperSettings;
|
|
34
|
+
try {
|
|
35
|
+
topperSettings = require('../data/topper2_settings.sheet.json')
|
|
36
|
+
} catch {
|
|
37
|
+
topperSettings = null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// lazy loader wrapper for WCM Image
|
|
41
|
+
const LazyLoader = ({children}) => {
|
|
42
|
+
return (
|
|
43
|
+
<LazyLoad offset={300} resize once>{children}</LazyLoad>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
29
47
|
const IndexPage = ({ data }) => {
|
|
30
48
|
// easy hooks based request library
|
|
31
49
|
// const { data: responseData, error } = useSWR('https://api.kanye.rest', getData, {
|
|
@@ -39,11 +57,14 @@ const IndexPage = ({ data }) => {
|
|
|
39
57
|
const {
|
|
40
58
|
site: { siteMetadata },
|
|
41
59
|
allRelatedLinksJson: { nodes: relatedLinks },
|
|
60
|
+
allWcmPhotos
|
|
42
61
|
} = data
|
|
43
62
|
|
|
44
63
|
return (
|
|
45
64
|
<Layout meta={siteMetadata}>
|
|
46
|
-
<
|
|
65
|
+
<NavTop meta={siteMetadata} />
|
|
66
|
+
<Topper2 settings={topperSettings[0]} wcmData={allWcmPhotos} lazyloader={LazyLoader}/>
|
|
67
|
+
<Byline meta={siteMetadata}/>
|
|
47
68
|
<main>
|
|
48
69
|
<article>
|
|
49
70
|
<p>
|
|
@@ -134,6 +155,15 @@ export const query = graphql`
|
|
|
134
155
|
url
|
|
135
156
|
}
|
|
136
157
|
}
|
|
158
|
+
allWcmPhotos {
|
|
159
|
+
nodes {
|
|
160
|
+
photo {
|
|
161
|
+
ratio
|
|
162
|
+
wcmid
|
|
163
|
+
full_path
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
137
167
|
}
|
|
138
168
|
`
|
|
139
169
|
IndexPage.propTypes = {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@import (less) '../../../styles/variables.less';
|
|
2
|
+
|
|
3
|
+
body .__react_component_tooltip {
|
|
4
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 20%);
|
|
5
|
+
padding: 6px @s4;
|
|
6
|
+
pointer-events: all;
|
|
7
|
+
|
|
8
|
+
.flex-contact {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
a {
|
|
13
|
+
&:visited {
|
|
14
|
+
color: @black;
|
|
15
|
+
}
|
|
16
|
+
&:hover {
|
|
17
|
+
opacity: 0.6;
|
|
18
|
+
color: @black;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.svg-wrapper {
|
|
22
|
+
width: 25px;
|
|
23
|
+
height: 25px;
|
|
24
|
+
border-radius: 25px;
|
|
25
|
+
border: 1px solid @black;
|
|
26
|
+
margin: 0 2px;
|
|
27
|
+
}
|
|
28
|
+
svg {
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding: @s4;
|
|
31
|
+
// margin: 0 3px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.contact-name, .font-awesome a {
|
|
37
|
+
color: @black;
|
|
38
|
+
text-decoration: underline;
|
|
39
|
+
text-decoration-thickness: 1px;
|
|
40
|
+
text-decoration-color: @grey-75;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
|
|
43
|
+
&:hover {
|
|
44
|
+
color: @grey-50;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.contact-name[data-tip="{}"] {
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
color: @black;
|
|
51
|
+
&:hover {
|
|
52
|
+
color: inherit;
|
|
53
|
+
cursor: inherit;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
@import (less)
|
|
1
|
+
@import (less) '../../../styles/variables.less';
|
|
2
2
|
|
|
3
3
|
.pageFooter {
|
|
4
|
-
background-color:
|
|
4
|
+
background-color: @black;
|
|
5
5
|
overflow: auto;
|
|
6
|
-
padding:
|
|
6
|
+
padding: @s32 @s24;
|
|
7
7
|
position: relative;
|
|
8
8
|
|
|
9
9
|
&.invert {
|
|
10
|
-
background-color:
|
|
11
|
-
color:
|
|
10
|
+
background-color: @grey-pale;
|
|
11
|
+
color: @black;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.pageFooter--left {
|
|
16
16
|
text-indent: -9999px;
|
|
17
|
-
margin-bottom:
|
|
17
|
+
margin-bottom: @s16;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.pageFooter--left-logo {
|
|
@@ -146,56 +146,63 @@
|
|
|
146
146
|
list-style: none;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
.PageFooter,.wrapper,ul {
|
|
150
|
+
padding-top: @s16 !important;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.PageFooter,.section,ul {
|
|
154
|
+
padding-top: 0 !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
149
157
|
.pageFooter--right-links li {
|
|
150
|
-
margin-bottom:
|
|
158
|
+
margin-bottom: @s8;
|
|
151
159
|
padding: 0;
|
|
152
160
|
|
|
153
161
|
a {
|
|
154
|
-
color:
|
|
162
|
+
color: @white;
|
|
155
163
|
text-decoration: none;
|
|
156
164
|
&:hover {
|
|
157
|
-
color:
|
|
165
|
+
color: @grey-25;
|
|
158
166
|
}
|
|
159
167
|
&:visited{
|
|
160
|
-
color: @
|
|
168
|
+
color: @grey-50;
|
|
161
169
|
}
|
|
162
170
|
}
|
|
163
171
|
}
|
|
164
172
|
|
|
165
|
-
.invert .pageFooter--right-links li {
|
|
173
|
+
.invert .pageFooter--right-links li {
|
|
166
174
|
a {
|
|
167
|
-
color:
|
|
175
|
+
color: @black;
|
|
168
176
|
}
|
|
169
177
|
a:hover {
|
|
170
178
|
color: @brand;
|
|
171
179
|
}
|
|
172
|
-
|
|
173
|
-
color: @
|
|
180
|
+
a:visited{
|
|
181
|
+
color: @grey-50;
|
|
174
182
|
}
|
|
175
183
|
}
|
|
176
184
|
|
|
177
185
|
.pageFooter--right-links .section {
|
|
178
186
|
-webkit-column-count: 2;
|
|
179
187
|
column-count: 2;
|
|
180
|
-
margin:
|
|
188
|
+
margin: @s8 0 @s24;
|
|
181
189
|
}
|
|
182
190
|
|
|
183
191
|
.pageFooter--right-links .footer-title {
|
|
184
|
-
margin-bottom: 4px;
|
|
185
192
|
text-align: left;
|
|
186
193
|
text-transform: uppercase;
|
|
187
194
|
}
|
|
188
195
|
|
|
189
196
|
.pageFooter--branding {
|
|
190
|
-
border-top: 1px solid
|
|
197
|
+
border-top: 1px solid @grey-50;
|
|
191
198
|
float: left;
|
|
192
|
-
padding-top:
|
|
199
|
+
padding-top: @s16;
|
|
193
200
|
width: 100%;
|
|
194
|
-
color:
|
|
201
|
+
color: @white;
|
|
195
202
|
}
|
|
196
203
|
|
|
197
204
|
.invert .pageFooter--branding {
|
|
198
|
-
color:
|
|
205
|
+
color: @black;
|
|
199
206
|
}
|
|
200
207
|
|
|
201
208
|
.pageFooter--branding-logo {
|
|
@@ -209,7 +216,7 @@
|
|
|
209
216
|
}
|
|
210
217
|
@media (min-width:48rem) {
|
|
211
218
|
.pageFooter {
|
|
212
|
-
padding:
|
|
219
|
+
padding: @s32 @s64;
|
|
213
220
|
}
|
|
214
221
|
|
|
215
222
|
.pageFooter--wrapper {
|
|
@@ -226,13 +233,13 @@
|
|
|
226
233
|
}
|
|
227
234
|
|
|
228
235
|
.pageFooter--right-topLine {
|
|
229
|
-
border-bottom: 1px solid
|
|
230
|
-
margin-bottom:
|
|
236
|
+
border-bottom: 1px solid @grey-50;
|
|
237
|
+
margin-bottom: @s16;
|
|
231
238
|
position: static;
|
|
232
239
|
text-align: right;
|
|
233
240
|
|
|
234
241
|
a {
|
|
235
|
-
color:
|
|
242
|
+
color: @black;
|
|
236
243
|
}
|
|
237
244
|
}
|
|
238
245
|
|
|
@@ -248,14 +255,17 @@
|
|
|
248
255
|
|
|
249
256
|
.pageFooter--right-links .wrapper > li {
|
|
250
257
|
-webkit-box-flex: 0;
|
|
251
|
-
padding
|
|
258
|
+
padding: 0 @s16;
|
|
259
|
+
&:first-of-type {
|
|
260
|
+
padding-left: 0;
|
|
261
|
+
}
|
|
252
262
|
}
|
|
253
263
|
|
|
254
264
|
.pageFooter--right-links .section {
|
|
255
265
|
-webkit-column-count: 1;
|
|
256
266
|
column-count: 1;
|
|
257
267
|
margin-bottom: 0;
|
|
258
|
-
margin-right:
|
|
268
|
+
margin-right: @s4;
|
|
259
269
|
}
|
|
260
270
|
|
|
261
271
|
.pageFooter--right-links .section > li:last-child {
|
|
@@ -271,16 +281,16 @@
|
|
|
271
281
|
}
|
|
272
282
|
@media (min-width:58rem) {
|
|
273
283
|
.pageFooter {
|
|
274
|
-
padding:
|
|
284
|
+
padding: @s32;
|
|
275
285
|
}
|
|
276
286
|
|
|
277
287
|
.pageFooter--right {
|
|
278
|
-
width:
|
|
288
|
+
width: @md;
|
|
279
289
|
}
|
|
280
290
|
}
|
|
281
291
|
@media (min-width:88.75rem) {
|
|
282
292
|
.pageFooter {
|
|
283
|
-
padding:
|
|
293
|
+
padding: @s32 0;
|
|
284
294
|
}
|
|
285
295
|
|
|
286
296
|
.pageFooter--branding {
|
|
@@ -289,28 +299,28 @@
|
|
|
289
299
|
}
|
|
290
300
|
|
|
291
301
|
.pageFooter {
|
|
292
|
-
font-family: @sans
|
|
302
|
+
font-family: @sans;
|
|
293
303
|
font-variant-numeric: lining-nums;
|
|
294
|
-
font-weight:
|
|
304
|
+
font-weight: 400;
|
|
295
305
|
-moz-osx-font-smoothing: grayscale;
|
|
296
306
|
-webkit-font-smoothing: antialiased;
|
|
297
307
|
-webkit-text-stroke: 0.45px rgba(0,0,0,.1);
|
|
298
|
-
color:
|
|
308
|
+
color: @black;
|
|
299
309
|
font-size: 12px;
|
|
300
310
|
line-height: 1.17;
|
|
301
311
|
}
|
|
302
312
|
|
|
303
313
|
.pageFooter .footer-title {
|
|
304
|
-
font-family: @sans
|
|
314
|
+
font-family: @sans;
|
|
305
315
|
font-variant-numeric: lining-nums;
|
|
306
|
-
font-weight:
|
|
316
|
+
font-weight: 700;
|
|
307
317
|
-webkit-font-smoothing: antialiased;
|
|
308
318
|
letter-spacing: 1px;
|
|
309
|
-
color:
|
|
319
|
+
color: @white;
|
|
310
320
|
}
|
|
311
321
|
|
|
312
322
|
.pageFooter.invert .footer-title {
|
|
313
|
-
color:
|
|
323
|
+
color: @black;
|
|
314
324
|
}
|
|
315
325
|
|
|
316
326
|
.pageFooter .footer-title,
|
|
@@ -320,7 +330,7 @@
|
|
|
320
330
|
}
|
|
321
331
|
|
|
322
332
|
.pageFooter .return {
|
|
323
|
-
font-family: @sans
|
|
333
|
+
font-family: @sans;
|
|
324
334
|
font-variant-numeric: lining-nums;
|
|
325
335
|
font-weight: 400;
|
|
326
336
|
-webkit-font-smoothing: antialiased;
|
|
@@ -328,7 +338,7 @@
|
|
|
328
338
|
}
|
|
329
339
|
|
|
330
340
|
#scrollTop {
|
|
331
|
-
color:
|
|
341
|
+
color: @black;
|
|
332
342
|
min-width: 120px;
|
|
333
343
|
cursor: pointer;
|
|
334
344
|
font-size: 12px;
|
|
File without changes
|