sfc-utils 1.4.203 → 1.4.205
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/components/helpers/utilfunctions.mjs +17 -24
- package/components/layout/layoutscript.mjs +10 -3
- package/package.json +1 -1
- package/settings.js +2 -2
- package/example/.prettierrc +0 -5
- package/example/README.md +0 -8
- package/example/gatsby-config.js +0 -137
- package/example/gatsby-node.js +0 -66
- package/example/package-lock.json +0 -31884
- package/example/package.json +0 -71
- package/example/project-config.json +0 -38
- package/example/src/components/layout.js +0 -96
- package/example/src/components/sfc/ad.js +0 -47
- package/example/src/components/sfc/ai2html/ai2html_template.ai +5 -1368
- package/example/src/components/sfc/button.js +0 -40
- package/example/src/components/sfc/byline.js +0 -42
- package/example/src/components/sfc/component-helpers/customhooks.js +0 -17
- package/example/src/components/sfc/component-helpers/datehelpers.js +0 -55
- package/example/src/components/sfc/component-helpers/newsletterhelpers.js +0 -89
- package/example/src/components/sfc/component-helpers/requesthelpers.js +0 -7
- package/example/src/components/sfc/component-helpers/scrolldownhelpers.js +0 -11
- package/example/src/components/sfc/component-helpers/utilfunctions.js +0 -68
- package/example/src/components/sfc/creditline.js +0 -35
- package/example/src/components/sfc/credits.js +0 -17
- package/example/src/components/sfc/creditssection.js +0 -49
- package/example/src/components/sfc/dropcap.js +0 -15
- package/example/src/components/sfc/footer.js +0 -36
- package/example/src/components/sfc/geocoder.js +0 -148
- package/example/src/components/sfc/misccredit.js +0 -17
- package/example/src/components/sfc/navtop.js +0 -121
- package/example/src/components/sfc/newsletter.js +0 -157
- package/example/src/components/sfc/relatedlink.js +0 -23
- package/example/src/components/sfc/relatedrow.js +0 -23
- package/example/src/components/sfc/relatedsection.js +0 -27
- package/example/src/components/sfc/safelink.js +0 -86
- package/example/src/components/sfc/scrolldown.js +0 -22
- package/example/src/components/sfc/sharebuttons.js +0 -93
- package/example/src/components/sfc/topper.js +0 -88
- package/example/src/components/sfc/video.js +0 -74
- package/example/src/components/sfc/wcmimage.js +0 -131
- package/example/src/data/sfc/images/react.gif +0 -0
- package/example/src/data/sfc/related_links.json +0 -17
- package/example/src/html.js +0 -41
- package/example/src/pages/index.js +0 -166
- package/example/src/styles/credittooltip.less +0 -55
- package/example/src/styles/footer.less +0 -378
- package/example/src/styles/modules/ad.module.less +0 -21
- package/example/src/styles/modules/ai2html.module.less +0 -19
- package/example/src/styles/modules/button.module.less +0 -94
- package/example/src/styles/modules/byline.module.less +0 -11
- package/example/src/styles/modules/creditline.module.less +0 -12
- package/example/src/styles/modules/credits.module.less +0 -7
- package/example/src/styles/modules/creditssection.module.less +0 -17
- package/example/src/styles/modules/dropcap.module.less +0 -18
- package/example/src/styles/modules/geocoder.module.less +0 -79
- package/example/src/styles/modules/newsletter.module.less +0 -147
- package/example/src/styles/modules/relatedlink.module.less +0 -28
- package/example/src/styles/modules/relatedrow.module.less +0 -8
- package/example/src/styles/modules/relatedsection.module.less +0 -19
- package/example/src/styles/modules/scrolldown.module.less +0 -31
- package/example/src/styles/modules/share.module.less +0 -22
- package/example/src/styles/modules/topper.module.less +0 -63
- package/example/src/styles/modules/video.module.less +0 -27
- package/example/src/styles/modules/wcmimage.module.less +0 -20
- package/example/src/styles/nav.less +0 -187
- package/example/src/styles/old css/defaults.less +0 -99
- package/example/src/styles/old css/footer.less +0 -345
- package/example/src/styles/old css/nav.less +0 -187
- package/example/src/styles/old css/project.less +0 -1
- package/example/src/styles/old css/reset.css +0 -95
- package/example/src/styles/old css/seed.less +0 -7
- package/example/src/styles/old css/typography.css +0 -168
- package/example/src/styles/old css/values.less +0 -74
- package/example/src/styles/project.less +0 -1
- package/example/src/styles/reset.css +0 -97
- package/example/src/styles/seed.less +0 -6
- package/example/src/styles/values.less +0 -203
- package/example/src/styles/variables.less +0 -142
- package/example/static/manifest.webmanifest +0 -1
- package/example/tasks/create-c2p-sheet.js +0 -6
- package/example/tasks/deploy-addon.py +0 -14
- package/example/tasks/google-docs.js +0 -16
- package/example/tasks/google-sheets.js +0 -17
- package/example/tasks/node-helpers.js +0 -81
- package/example/tasks/post-build.sh +0 -7
- package/example/tasks/pre-build.sh +0 -18
- package/example/tempsettings.js +0 -28
package/example/package.json
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "utilstest",
|
|
3
|
-
"description": "A Hearst interactive project",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"author": "ewagstaff",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"axios": "0.27.2",
|
|
8
|
-
"css.gg": "2.0.0",
|
|
9
|
-
"gatsby": "4.13.0",
|
|
10
|
-
"gatsby-plugin-htaccess": "1.4.0",
|
|
11
|
-
"gatsby-plugin-html-attributes": "1.0.5",
|
|
12
|
-
"gatsby-plugin-less": "6.13.0",
|
|
13
|
-
"gatsby-plugin-preact": "6.13.0",
|
|
14
|
-
"gatsby-plugin-react-helmet": "5.13.0",
|
|
15
|
-
"gatsby-source-filesystem": "4.13.0",
|
|
16
|
-
"gatsby-transformer-json": "4.13.0",
|
|
17
|
-
"jump.js": "1.0.2",
|
|
18
|
-
"less": "4.1.1",
|
|
19
|
-
"preact": "10.5.13",
|
|
20
|
-
"preact-render-to-string": "5.2.0",
|
|
21
|
-
"prop-types": "15.7.2",
|
|
22
|
-
"react": "16.14.0",
|
|
23
|
-
"react-dom": "16.14.0",
|
|
24
|
-
"react-headroom": "3.1.1",
|
|
25
|
-
"react-helmet": "^6.1.0",
|
|
26
|
-
"react-lazyload": "3.2.0",
|
|
27
|
-
"require-directory": "2.1.1",
|
|
28
|
-
"swr": "^0.5.6"
|
|
29
|
-
},
|
|
30
|
-
"keywords": [
|
|
31
|
-
"gatsby"
|
|
32
|
-
],
|
|
33
|
-
"browserslist": [
|
|
34
|
-
"Chrome >= 61",
|
|
35
|
-
"ChromeAndroid >= 80",
|
|
36
|
-
"Safari >= 11",
|
|
37
|
-
"iOS >= 11",
|
|
38
|
-
"Firefox >= 60",
|
|
39
|
-
"FirefoxAndroid >= 68",
|
|
40
|
-
"Edge >= 16",
|
|
41
|
-
"Opera >= 48",
|
|
42
|
-
"Android >= 80",
|
|
43
|
-
"Samsung >= 8.2"
|
|
44
|
-
],
|
|
45
|
-
"license": "MIT",
|
|
46
|
-
"scripts": {
|
|
47
|
-
"deploy:git": "func() { npm run clean && export GATSBY_DEPLOY_ENV=\"$1\" && export GATSBY_DEPLOY_ORIGIN=\"$2\" && tasks/pre-build.sh && gatsby build --prefix-paths && tasks/post-build.sh; }; func",
|
|
48
|
-
"auth": "tasks/googleauth.js",
|
|
49
|
-
"sheets": "tasks/google-sheets.js",
|
|
50
|
-
"docs": "tasks/google-docs.js",
|
|
51
|
-
"dev": "export GATSBY_DEPLOY_ENV=development && gatsby develop -H 0.0.0.0",
|
|
52
|
-
"makec2p": "tasks/create-c2p-sheet.js",
|
|
53
|
-
"clean": "rm -rf .cache && rm -rf public_export && rm -rf public",
|
|
54
|
-
"format": "prettier --write \"src/**/*.js\"",
|
|
55
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
56
|
-
"analyze": "export ANALYZE_BUNDLE_SIZE=true && gatsby build"
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"babel-eslint": "10.1.0",
|
|
60
|
-
"eslint": "7.7.0",
|
|
61
|
-
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.27",
|
|
62
|
-
"luxon": "1.24.1",
|
|
63
|
-
"prettier": "2.0",
|
|
64
|
-
"probe-image-size": "^7.0.1",
|
|
65
|
-
"request": "^2.88.2"
|
|
66
|
-
},
|
|
67
|
-
"repository": {
|
|
68
|
-
"type": "git",
|
|
69
|
-
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
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
|
-
"PAYWALL_SETTING": "meter",
|
|
4
|
-
"EMBEDDED": false,
|
|
5
|
-
"GOOGLE_SHEETS": [
|
|
6
|
-
"1DUvYnFdxtBv1AXcDI9X00s_opUSu4uHJmd5LNemCN9E"
|
|
7
|
-
],
|
|
8
|
-
"GOOGLE_DOCS": [],
|
|
9
|
-
"_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.",
|
|
10
|
-
"MAIN_DOMAIN": "https://projects.sfchronicle.com",
|
|
11
|
-
"PROJECT": {
|
|
12
|
-
"_key_explainer": "NOTE: Change MARKET_KEY to deploy to other markets using their domain and settings. Accepted markets include: SFC, Houston, SanAntonio, Albany, CT",
|
|
13
|
-
"MARKET_KEY": "SFC",
|
|
14
|
-
"_comment": "IMPORTANT: SUBFOLDER and SLUG for used for file pathing and the deploy script! Take care with your edits to them! NOTE: Stage deploys will automatically go to 'projects/test-proj'",
|
|
15
|
-
"SUBFOLDER": "{%= subfolder_path %}",
|
|
16
|
-
"SLUG": "{%= app_slug %}",
|
|
17
|
-
"TITLE": "",
|
|
18
|
-
"DISPLAY_TITLE": "",
|
|
19
|
-
"SOCIAL_TITLE": "",
|
|
20
|
-
"IMAGE": "",
|
|
21
|
-
"DESCRIPTION": "",
|
|
22
|
-
"DECK": "",
|
|
23
|
-
"TWITTER_TEXT": "Some social text",
|
|
24
|
-
"_options_for_HEARST_CATEGORY": "Bay Area,Politics,Climate,Weather,California Wildfires,Food,Sports,Tech,Travel,US & World,Chronicle Vault,Opinion",
|
|
25
|
-
"HEARST_CATEGORY": "Bay Area",
|
|
26
|
-
"KEY_SUBJECTS": "Data",
|
|
27
|
-
"DATE": "January 1, 1970 6:00 PM",
|
|
28
|
-
"NEWSLETTER_ID": "SFC_NL_TopStories",
|
|
29
|
-
"NEWSLETTER_PROMO": "Get the Bay Area's best journalism delivered to my inbox daily",
|
|
30
|
-
"NEWSLETTER_LEGAL": "By subscribing, you agree to our <a href=\"https://www.sfchronicle.com/terms_of_use/\">Terms of Use</a> and acknowledge that your information will be used as described in our <a href=\"https://www.sfchronicle.com/privacy_policy/\"> Privacy Notice</a>.",
|
|
31
|
-
"AUTHORS": [
|
|
32
|
-
{
|
|
33
|
-
"AUTHOR_NAME": "Lesley Huang",
|
|
34
|
-
"AUTHOR_PAGE": "www.google.com"
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/* Layout wraps all pages so updates here effect everything */
|
|
2
|
-
|
|
3
|
-
import React, { Fragment, useEffect } from 'react'
|
|
4
|
-
import PropTypes from 'prop-types'
|
|
5
|
-
import { Helmet } from 'react-helmet'
|
|
6
|
-
import LayoutHelmet from '../../../components/layout/layouthelmet.mjs'
|
|
7
|
-
import Footer from './sfc/footer'
|
|
8
|
-
// Add SFC utils
|
|
9
|
-
import { appCheck } from '../../../index'
|
|
10
|
-
import { appendLayoutScripts, formatHDN } from "../../../components/helpers/utilfunctions.mjs"
|
|
11
|
-
// Import global styles needed in document
|
|
12
|
-
require('../styles/seed.less')
|
|
13
|
-
|
|
14
|
-
const Layout = ({
|
|
15
|
-
meta,
|
|
16
|
-
url_add = '',
|
|
17
|
-
description = false,
|
|
18
|
-
image = false,
|
|
19
|
-
social_title = false,
|
|
20
|
-
title = false,
|
|
21
|
-
embed = false,
|
|
22
|
-
children,
|
|
23
|
-
}) => {
|
|
24
|
-
// Determine if we need registration code
|
|
25
|
-
|
|
26
|
-
let {
|
|
27
|
-
EMBEDDED,
|
|
28
|
-
PROJECT: {
|
|
29
|
-
DESCRIPTION,
|
|
30
|
-
IMAGE,
|
|
31
|
-
SOCIAL_TITLE,
|
|
32
|
-
TITLE
|
|
33
|
-
},
|
|
34
|
-
} = meta
|
|
35
|
-
|
|
36
|
-
// Override these if they exist (but just use the default otherwise)
|
|
37
|
-
meta.PROJECT.DESCRIPTION = description || DESCRIPTION
|
|
38
|
-
meta.PROJECT.IMAGE = image || IMAGE
|
|
39
|
-
meta.PROJECT.SOCIAL_TITLE = social_title || SOCIAL_TITLE
|
|
40
|
-
meta.PROJECT.TITLE = title || TITLE
|
|
41
|
-
|
|
42
|
-
// If we're receiving `embed` as a prop, change this page's settings to be embed settings
|
|
43
|
-
if (embed) {
|
|
44
|
-
meta.EMBEDDED = true
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Make sure url_add ends with a slash
|
|
48
|
-
if (url_add && url_add.slice(-1) !== "/") {
|
|
49
|
-
url_add += "/"
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Determine if app ver
|
|
53
|
-
// Either from the build settings or from the query string
|
|
54
|
-
const isApp = appCheck()
|
|
55
|
-
|
|
56
|
-
// Combine our settings with what Hearst puts on page
|
|
57
|
-
let stringHDN = formatHDN(EMBEDDED, url_add, meta);
|
|
58
|
-
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
appendLayoutScripts(EMBEDDED);
|
|
61
|
-
}, [])
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<Fragment>
|
|
65
|
-
{/* Forcing HDN vars in so we can feed them to ensighten */}
|
|
66
|
-
<Helmet
|
|
67
|
-
script={[
|
|
68
|
-
{
|
|
69
|
-
type: 'text/javascript',
|
|
70
|
-
innerHTML: stringHDN,
|
|
71
|
-
},
|
|
72
|
-
]}
|
|
73
|
-
/>
|
|
74
|
-
|
|
75
|
-
<LayoutHelmet meta={meta} url_add={url_add} />
|
|
76
|
-
|
|
77
|
-
{/* Full project included here: */}
|
|
78
|
-
{children}
|
|
79
|
-
|
|
80
|
-
{/* Include footer unless it's embedded or the app version: */}
|
|
81
|
-
{!EMBEDDED && !isApp && <Footer meta={meta} />}
|
|
82
|
-
</Fragment>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
Layout.propTypes = {
|
|
87
|
-
meta: PropTypes.object.isRequired,
|
|
88
|
-
url_add: PropTypes.string,
|
|
89
|
-
children: PropTypes.node.isRequired,
|
|
90
|
-
image: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
91
|
-
description: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
92
|
-
title: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
93
|
-
social_title: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export default Layout
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import * as adStyles from '../../styles/modules/ad.module.less'
|
|
4
|
-
|
|
5
|
-
// Hearst ad -- make sure Juice is fully loaded before running the script logic
|
|
6
|
-
const Ad = ({ adLetter }) => {
|
|
7
|
-
const [loaded, setLoaded] = useState(false)
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
let attemptLoad = () => {
|
|
11
|
-
if (typeof hearstPlaceAd === "undefined"){
|
|
12
|
-
// The function isn't ready yet, so wait
|
|
13
|
-
setTimeout(() => {
|
|
14
|
-
attemptLoad()
|
|
15
|
-
}, 1000)
|
|
16
|
-
} else {
|
|
17
|
-
// We have the function, so set loaded
|
|
18
|
-
setLoaded(true)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Kick off loop
|
|
23
|
-
attemptLoad()
|
|
24
|
-
}, [])
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div className={adStyles.ad}>
|
|
28
|
-
<p className={adStyles.adhed}>Advertisement</p>
|
|
29
|
-
<div id={`${adLetter}Pflex`}>
|
|
30
|
-
{loaded &&
|
|
31
|
-
<script
|
|
32
|
-
type="text/javascript"
|
|
33
|
-
dangerouslySetInnerHTML={{
|
|
34
|
-
__html: `/*<![CDATA[*/hearstPlaceAd("${adLetter}Pflex");/*]]>*/`,
|
|
35
|
-
}}
|
|
36
|
-
></script>
|
|
37
|
-
}
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
Ad.propTypes = {
|
|
44
|
-
adLetter: PropTypes.string
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default Ad
|