sfc-utils 1.4.181 → 1.4.183
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/accountswap.js
CHANGED
|
@@ -13,7 +13,12 @@ const attachSigninHandler = async function () {
|
|
|
13
13
|
if (signinButton && !signinButton.dataset.realmAttached) {
|
|
14
14
|
signinButton.dataset.realmAttached = "true";
|
|
15
15
|
signinButton.onclick = function (e) {
|
|
16
|
-
if (
|
|
16
|
+
if (
|
|
17
|
+
window &&
|
|
18
|
+
window.treg &&
|
|
19
|
+
window.treg.realm &&
|
|
20
|
+
window.treg.realm.core
|
|
21
|
+
) {
|
|
17
22
|
window.treg.realm.core.login();
|
|
18
23
|
}
|
|
19
24
|
e.preventDefault();
|
|
@@ -34,11 +39,21 @@ const swapSubscribeForAccount = async function () {
|
|
|
34
39
|
const maxTries = 20; // 20 * 500ms = 10 seconds
|
|
35
40
|
while (!swapped && tries < maxTries) {
|
|
36
41
|
tries++;
|
|
37
|
-
if (
|
|
42
|
+
if (
|
|
43
|
+
window &&
|
|
44
|
+
window.treg &&
|
|
45
|
+
window.treg.identity &&
|
|
46
|
+
window.treg.identity.id
|
|
47
|
+
) {
|
|
38
48
|
const rightBlock = document.querySelector(".nav2-right");
|
|
39
49
|
if (rightBlock && rightBlock.innerText) {
|
|
40
50
|
rightBlock.innerHTML = `<a id="nav2-sub-box" href="${accountURL}"><div>Account</div></a>`;
|
|
41
|
-
if (
|
|
51
|
+
if (
|
|
52
|
+
window &&
|
|
53
|
+
window.treg &&
|
|
54
|
+
window.treg.realm &&
|
|
55
|
+
window.treg.realm.iframeProfile
|
|
56
|
+
) {
|
|
42
57
|
const subButton = document.querySelector("#nav2-sub-box");
|
|
43
58
|
if (subButton) {
|
|
44
59
|
subButton.onclick = function (e) {
|
|
@@ -27,7 +27,7 @@ const LayoutHelmet = ({
|
|
|
27
27
|
MARKET_KEY,
|
|
28
28
|
CANONICAL_URL,
|
|
29
29
|
ANALYTICS_CREDIT,
|
|
30
|
-
|
|
30
|
+
HEARST_CATEGORY,
|
|
31
31
|
},
|
|
32
32
|
} = meta;
|
|
33
33
|
|
|
@@ -128,8 +128,8 @@ const LayoutHelmet = ({
|
|
|
128
128
|
|
|
129
129
|
// Set section with fallback
|
|
130
130
|
let articleSection = "Local";
|
|
131
|
-
if (
|
|
132
|
-
articleSection =
|
|
131
|
+
if (HEARST_CATEGORY && typeof HEARST_CATEGORY === "string") {
|
|
132
|
+
articleSection = HEARST_CATEGORY.split(",")[0];
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
// Set the default schema that will be used as a fallback
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
2
|
import * as shareStyles from "../styles/modules/share.module.less";
|
|
3
3
|
import { appCheck } from "../appcheck.js";
|
|
4
|
+
import { trackEvent } from "../components/helpers/utilfunctions.mjs";
|
|
4
5
|
|
|
5
|
-
const ShareButtons = ({ meta, urlAdd }) => {
|
|
6
|
+
const ShareButtons = ({ meta, urlAdd, location = "Byline" }) => {
|
|
6
7
|
// We need to run appCheck in useEffect because we need to wait for the DOM to be ready
|
|
7
8
|
let [hideSocial, setHideSocial] = useState(false);
|
|
8
9
|
useEffect(() => {
|
|
@@ -37,7 +38,10 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
37
38
|
<a
|
|
38
39
|
href={`https://www.facebook.com/sharer/sharer.php?u=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%2F${urlAdd}`}
|
|
39
40
|
className={shareStyles.link}
|
|
40
|
-
onClick={
|
|
41
|
+
onClick={(e) => {
|
|
42
|
+
facebookClick(e);
|
|
43
|
+
trackEvent("Click", "Button", "Share", `Facebook|${location}`);
|
|
44
|
+
}}
|
|
41
45
|
>
|
|
42
46
|
<svg
|
|
43
47
|
className={shareStyles.svg}
|
|
@@ -59,6 +63,9 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
59
63
|
<a
|
|
60
64
|
href={`https://x.com/intent/post?url=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%2F${urlAdd}&text=${meta.PROJECT.TWITTER_TEXT}`}
|
|
61
65
|
className={shareStyles.link}
|
|
66
|
+
onClick={() => {
|
|
67
|
+
trackEvent("Click", "Button", "Share", `X|${location}`);
|
|
68
|
+
}}
|
|
62
69
|
>
|
|
63
70
|
{/* <svg
|
|
64
71
|
className={shareStyles.svg}
|
|
@@ -95,6 +102,9 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
95
102
|
<a
|
|
96
103
|
href={`https://bsky.app/intent/compose?text=${meta.PROJECT.TWITTER_TEXT}&url=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%${urlAdd}`}
|
|
97
104
|
className={shareStyles.link}
|
|
105
|
+
onClick={() => {
|
|
106
|
+
trackEvent("Click", "Button", "Share", `Bluesky|${location}`);
|
|
107
|
+
}}
|
|
98
108
|
>
|
|
99
109
|
<svg
|
|
100
110
|
className={shareStyles.svg}
|
|
@@ -107,7 +117,9 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
107
117
|
>
|
|
108
118
|
<path
|
|
109
119
|
data-name="Bluesky Logo"
|
|
110
|
-
fill="currentColor"
|
|
120
|
+
fill="currentColor"
|
|
121
|
+
d="M111.8 62.2C170.2 105.9 233 194.7 256 242.4c23-47.6 85.8-136.4 144.2-180.2c42.1-31.6 110.3-56 110.3 21.8c0 15.5-8.9 130.5-14.1 149.2C478.2 298 412 314.6 353.1 304.5c102.9 17.5 129.1 75.5 72.5 133.5c-107.4 110.2-154.3-27.6-166.3-62.9l0 0c-1.7-4.9-2.6-7.8-3.3-7.8s-1.6 3-3.3 7.8l0 0c-12 35.3-59 173.1-166.3 62.9c-56.5-58-30.4-116 72.5-133.5C100 314.6 33.8 298 15.7 233.1C10.4 214.4 1.5 99.4 1.5 83.9c0-77.8 68.2-53.4 110.3-21.8z"
|
|
122
|
+
/>
|
|
111
123
|
</svg>
|
|
112
124
|
</a>
|
|
113
125
|
</>
|
|
@@ -116,6 +128,9 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
116
128
|
<a
|
|
117
129
|
href={`mailto:?subject=${meta.PROJECT.TITLE}&body=${meta.PROJECT.DESCRIPTION}%0A%0A${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%2F${urlAdd}`}
|
|
118
130
|
className={shareStyles.link}
|
|
131
|
+
onClick={() => {
|
|
132
|
+
trackEvent("Click", "Button", "Share", `Email|${location}`);
|
|
133
|
+
}}
|
|
119
134
|
>
|
|
120
135
|
<svg
|
|
121
136
|
className={shareStyles.svg}
|