sfc-utils 1.3.76 → 1.4.1

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.
@@ -0,0 +1,14 @@
1
+ import React from "react"
2
+
3
+ const DevHubCredit = () => {
4
+ return (
5
+ <>
6
+ <span className="devhub-credit">
7
+ Powered by the <a target="_blank" href="https://www.poynter.org/business-work/2022/coming-off-big-digital-subscription-growth-hearst-newspapers-plan-a-new-data-and-product-hub-for-2022/">Hearst Newspapers DevHub</a>.
8
+ <svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"/></svg>
9
+ </span>
10
+ </>
11
+ )
12
+ }
13
+
14
+ export default DevHubCredit
@@ -14,7 +14,7 @@ function debounce(fn, ms) {
14
14
  }
15
15
  }
16
16
 
17
- function appendLayoutScripts(isEmbedded, isAdRemoved) {
17
+ function appendLayoutScripts(isEmbedded, isAdRemoved, marketKey) {
18
18
  const isApp = appCheck();
19
19
 
20
20
  // React Helmet is actually terrible and runs these scripts twice, so we are including them async ourselves
@@ -50,15 +50,16 @@ function appendLayoutScripts(isEmbedded, isAdRemoved) {
50
50
  document.body.appendChild(script)
51
51
 
52
52
  // Init sailthru
53
- // if (window && window.Sailthru){
54
- // window.Sailthru.init({ customerId: thisBrand.attributes.sailCustomer })
55
- // }
53
+ if (window && window.Sailthru && marketKey){
54
+ window.Sailthru.init({ customerId: getBrands2(marketKey).attributes.sailCustomer })
55
+ }
56
56
  }
57
57
  }, 5000)
58
58
  }
59
59
 
60
60
  function formatHDN(isEmbedded, url_add, meta) {
61
61
  const isApp = appCheck();
62
+ const thisBrand = getBrands2(meta.PROJECT.MARKET_KEY);
62
63
 
63
64
  // Combine our settings with what Hearst puts on page
64
65
  let stringHDN = ''
@@ -67,7 +68,7 @@ function formatHDN(isEmbedded, url_add, meta) {
67
68
  const metaHDN = Object.assign({}, meta)
68
69
  metaHDN.URL_ADD = url_add
69
70
  // Add sailthru var
70
- // metaHDN.SAIL_CUST = thisBrand.attributes.sailCustomer
71
+ metaHDN.SAIL_CUST = thisBrand.attributes.sailCustomer;
71
72
  // Make sure this is free on app
72
73
  if (isApp) {
73
74
  metaHDN.PAYWALL_SETTING = "free"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.3.76",
3
+ "version": "1.4.1",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",
@@ -146,4 +146,14 @@ a {
146
146
 
147
147
  .og-pub-date {
148
148
  color: @grey-75;
149
+ }
150
+
151
+ .devhub-credit {
152
+ a {
153
+ text-decoration-color: @grey-75;
154
+ }
155
+ svg {
156
+ height: 0.75rem;
157
+ margin-left: @s4;
158
+ }
149
159
  }