Backed out changeset af872f8e8213 (bug 1949001) for causing xpc failures @ test_PanelTestProvider.js CLOSED TREE

This commit is contained in:
smolnar
2025-04-30 04:54:45 +03:00
parent b19d3e8fb3
commit a2d552f453
8 changed files with 196 additions and 267 deletions

View File

@@ -1553,23 +1553,6 @@ const MESSAGES = () => [
}, },
groups: [], groups: [],
}, },
{
id: "NEWTAB_PERSONALIZATION_MESSAGE",
template: "newtab_message",
content: {
messageType: "PersonalizedCard",
position: 1,
cardTitle: "Personalized Just for You!",
cardMessage:
"Were customizing your feed to show content that matters to you, while ensuring your privacy is always respected.",
ctaText: "Manage your settings",
linkText: "Learn how we protect and manage data",
},
trigger: {
id: "newtabMessageCheck",
},
groups: [],
},
]; ];
export const PanelTestProvider = { export const PanelTestProvider = {

View File

@@ -12,7 +12,6 @@ import { SectionContextMenu } from "../SectionContextMenu/SectionContextMenu";
import { InterestPicker } from "../InterestPicker/InterestPicker"; import { InterestPicker } from "../InterestPicker/InterestPicker";
import { AdBanner } from "../AdBanner/AdBanner.jsx"; import { AdBanner } from "../AdBanner/AdBanner.jsx";
import { PersonalizedCard } from "../PersonalizedCard/PersonalizedCard"; import { PersonalizedCard } from "../PersonalizedCard/PersonalizedCard";
import { MessageWrapper } from "content-src/components/MessageWrapper/MessageWrapper";
// Prefs // Prefs
const PREF_SECTIONS_CARDS_ENABLED = "discoverystream.sections.cards.enabled"; const PREF_SECTIONS_CARDS_ENABLED = "discoverystream.sections.cards.enabled";
@@ -33,6 +32,14 @@ const PREF_BILLBOARD_ENABLED = "newtabAdSize.billboard";
const PREF_LEADERBOARD_ENABLED = "newtabAdSize.leaderboard"; const PREF_LEADERBOARD_ENABLED = "newtabAdSize.leaderboard";
const PREF_LEADERBOARD_POSITION = "newtabAdSize.leaderboard.position"; const PREF_LEADERBOARD_POSITION = "newtabAdSize.leaderboard.position";
const PREF_BILLBOARD_POSITION = "newtabAdSize.billboard.position"; const PREF_BILLBOARD_POSITION = "newtabAdSize.billboard.position";
const PREF_INFERRED_PERSONALIZATION_ENABLED =
"discoverystream.sections.personalization.inferred.enabled";
const PREF_INFERRED_PERSONALIZATION_USER_ENABLED =
"discoverystream.sections.personalization.inferred.user.enabled";
const PREF_INFERRED_PERSONALIZATION_POSITION =
"discoverystream.sections.personalization.inferred.position";
const PREF_INFERRED_PERSONALIZATION_BLOCKED =
"discoverystream.sections.personalization.inferred.blocked";
function getLayoutData(responsiveLayouts, index) { function getLayoutData(responsiveLayouts, index) {
let layoutData = { let layoutData = {
@@ -352,7 +359,6 @@ function CardSections({
const { spocs, sectionPersonalization } = useSelector( const { spocs, sectionPersonalization } = useSelector(
state => state.DiscoveryStream state => state.DiscoveryStream
); );
const { messageData } = useSelector(state => state.Messages);
const personalizationEnabled = prefs[PREF_SECTIONS_PERSONALIZATION_ENABLED]; const personalizationEnabled = prefs[PREF_SECTIONS_PERSONALIZATION_ENABLED];
const interestPickerEnabled = prefs[PREF_INTEREST_PICKER_ENABLED]; const interestPickerEnabled = prefs[PREF_INTEREST_PICKER_ENABLED];
@@ -455,22 +461,22 @@ function CardSections({
); );
} }
const handleDismissP13nCard = () => {
dispatch(ac.SetPref(PREF_INFERRED_PERSONALIZATION_BLOCKED, true));
};
function displayP13nCard() { function displayP13nCard() {
if (messageData && Object.keys(messageData).length >= 1) { const row = prefs[PREF_INFERRED_PERSONALIZATION_POSITION];
if (messageData?.content?.messageType === "PersonalizedCard") { const cardBlocked = prefs[PREF_INFERRED_PERSONALIZATION_BLOCKED];
const row = messageData.content.position; const cardEnabled = prefs[PREF_INFERRED_PERSONALIZATION_ENABLED];
sectionsToRender.splice( const userEnabled = prefs[PREF_INFERRED_PERSONALIZATION_USER_ENABLED];
row,
0, if (!cardBlocked && cardEnabled && userEnabled) {
<MessageWrapper dispatch={dispatch} onDismiss={() => {}}> sectionsToRender.splice(
<PersonalizedCard row,
position={row} 0,
dispatch={dispatch} <PersonalizedCard row={row} onDismiss={handleDismissP13nCard} />
messageData={messageData} );
/>
</MessageWrapper>
);
}
} }
} }

View File

@@ -2,34 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
import React, { useCallback } from "react"; import React from "react";
import { SafeAnchor } from "../SafeAnchor/SafeAnchor";
import { actionCreators as ac, actionTypes as at } from "common/Actions.mjs";
export const PersonalizedCard = ({ export const PersonalizedCard = ({ onDismiss }) => {
dispatch,
handleDismiss,
handleClick,
handleBlock,
messageData,
}) => {
const wavingFox = const wavingFox =
"chrome://newtab/content/data/content/assets/waving-fox.svg"; "chrome://newtab/content/data/content/assets/waving-fox.svg";
const onDismiss = useCallback(() => {
handleDismiss();
handleBlock();
}, [handleDismiss, handleBlock]);
const onToggleClick = useCallback(
elementId => {
dispatch({ type: at.SHOW_PERSONALIZE });
dispatch(ac.UserEvent({ event: "SHOW_PERSONALIZE" }));
handleClick(elementId);
},
[dispatch, handleClick]
);
return ( return (
<aside className="personalized-card-wrapper"> <aside className="personalized-card-wrapper">
<div className="personalized-card-dismiss"> <div className="personalized-card-dismiss">
@@ -42,25 +20,17 @@ export const PersonalizedCard = ({
</div> </div>
<div className="personalized-card-inner"> <div className="personalized-card-inner">
<img src={wavingFox} alt="" /> <img src={wavingFox} alt="" />
<h2>{messageData.content.cardTitle}</h2> <h2>Personalized Just for You</h2>
<p>{messageData.content.cardMessage}</p> <p>
<moz-button Were customizing your feed to show content that matters to you, while
type="primary" ensuring your privacy is always respected.
class="personalized-card-cta" </p>
onClick={() => onToggleClick("open-personalization-panel")} <moz-button type="primary" class="personalized-card-cta">
> Manage your settings
{messageData.content.ctaText}
</moz-button> </moz-button>
<SafeAnchor <a href="https://www.mozilla.org/en-US/privacy/firefox/#notice">
className="personalized-card-link" Learn how we protect and manage data
dispatch={dispatch} </a>
url="https://www.mozilla.org/en-US/privacy/firefox/#notice"
onLinkClick={() => {
handleClick("link-click");
}}
>
{messageData.content.linkText}
</SafeAnchor>
</div> </div>
</aside> </aside>
); );

View File

@@ -36,7 +36,7 @@
font-weight: var(--font-weight-bold); font-weight: var(--font-weight-bold);
} }
.personalized-card-link { a {
color: var(--link-color); color: var(--link-color);
font-size: var(--font-size-small); font-size: var(--font-size-small);
} }
@@ -50,7 +50,7 @@
justify-self: initial; justify-self: initial;
} }
.personalized-card-link { a {
margin-top: 8px; margin-top: 8px;
margin-bottom: 15px; margin-bottom: 15px;
} }
@@ -76,7 +76,7 @@
width: 195px; width: 195px;
} }
.personalized-card-link { a {
margin-top: -60px; margin-top: -60px;
grid-column: 3; grid-column: 3;
} }
@@ -106,7 +106,7 @@
width: 220px; width: 220px;
} }
.personalized-card-link { a {
grid-column: 4; grid-column: 4;
margin-top: -50px; margin-top: -50px;
} }
@@ -125,7 +125,7 @@
margin-inline-end: 40px; margin-inline-end: 40px;
} }
.personalized-card-link { a {
width: 290px; width: 290px;
margin-top: -60px; margin-top: -60px;
} }

View File

@@ -53,7 +53,7 @@ function MessageWrapper({ children, dispatch, hiddenOverride, onDismiss }) {
} else { } else {
dispatch(ac.AlsoToMain(action)); dispatch(ac.AlsoToMain(action));
} }
onDismiss?.(); onDismiss();
}, [dispatch, message, onDismiss]); }, [dispatch, message, onDismiss]);
function handleDismiss() { function handleDismiss() {
@@ -93,26 +93,24 @@ function MessageWrapper({ children, dispatch, hiddenOverride, onDismiss }) {
} }
} }
if (!message || (!hiddenOverride && message.isHidden)) {
return null;
}
// only display the message if `isHidden` is false // only display the message if `isHidden` is false
return ( return (
<div (!message.isHidden || hiddenOverride) && (
ref={el => { <div
ref.current = [el]; ref={el => {
}} ref.current = [el];
className="message-wrapper" }}
> className="message-wrapper"
{React.cloneElement(children, { >
isIntersecting, {React.cloneElement(children, {
handleDismiss, isIntersecting,
handleClick, handleDismiss,
handleBlock, handleClick,
handleClose, handleBlock,
})} handleClose,
</div> })}
</div>
)
); );
} }

View File

@@ -8389,7 +8389,7 @@ main section {
font-size: var(--font-size-xxlarge); font-size: var(--font-size-xxlarge);
font-weight: var(--font-weight-bold); font-weight: var(--font-weight-bold);
} }
.personalized-card-wrapper .personalized-card-inner .personalized-card-link { .personalized-card-wrapper .personalized-card-inner a {
color: var(--link-color); color: var(--link-color);
font-size: var(--font-size-small); font-size: var(--font-size-small);
} }
@@ -8401,7 +8401,7 @@ main section {
.personalized-card-wrapper .personalized-card-inner img { .personalized-card-wrapper .personalized-card-inner img {
justify-self: initial; justify-self: initial;
} }
.personalized-card-wrapper .personalized-card-inner .personalized-card-link { .personalized-card-wrapper .personalized-card-inner a {
margin-top: 8px; margin-top: 8px;
margin-bottom: 15px; margin-bottom: 15px;
} }
@@ -8423,7 +8423,7 @@ main section {
margin-top: -30px; margin-top: -30px;
width: 195px; width: 195px;
} }
.personalized-card-wrapper .personalized-card-inner .personalized-card-link { .personalized-card-wrapper .personalized-card-inner a {
margin-top: -60px; margin-top: -60px;
grid-column: 3; grid-column: 3;
} }
@@ -8448,7 +8448,7 @@ main section {
margin-top: initial; margin-top: initial;
width: 220px; width: 220px;
} }
.personalized-card-wrapper .personalized-card-inner .personalized-card-link { .personalized-card-wrapper .personalized-card-inner a {
grid-column: 4; grid-column: 4;
margin-top: -50px; margin-top: -50px;
} }
@@ -8463,7 +8463,7 @@ main section {
.personalized-card-wrapper .personalized-card-inner .personalized-card-cta { .personalized-card-wrapper .personalized-card-inner .personalized-card-cta {
margin-inline-end: 40px; margin-inline-end: 40px;
} }
.personalized-card-wrapper .personalized-card-inner .personalized-card-link { .personalized-card-wrapper .personalized-card-inner a {
width: 290px; width: 290px;
margin-top: -60px; margin-top: -60px;
} }

View File

@@ -10962,29 +10962,10 @@ function InterestPicker({
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
const PersonalizedCard = ({ const PersonalizedCard = ({
dispatch, onDismiss
handleDismiss,
handleClick,
handleBlock,
messageData
}) => { }) => {
const wavingFox = "chrome://newtab/content/data/content/assets/waving-fox.svg"; const wavingFox = "chrome://newtab/content/data/content/assets/waving-fox.svg";
const onDismiss = (0,external_React_namespaceObject.useCallback)(() => {
handleDismiss();
handleBlock();
}, [handleDismiss, handleBlock]);
const onToggleClick = (0,external_React_namespaceObject.useCallback)(elementId => {
dispatch({
type: actionTypes.SHOW_PERSONALIZE
});
dispatch(actionCreators.UserEvent({
event: "SHOW_PERSONALIZE"
}));
handleClick(elementId);
}, [dispatch, handleClick]);
return /*#__PURE__*/external_React_default().createElement("aside", { return /*#__PURE__*/external_React_default().createElement("aside", {
className: "personalized-card-wrapper" className: "personalized-card-wrapper"
}, /*#__PURE__*/external_React_default().createElement("div", { }, /*#__PURE__*/external_React_default().createElement("div", {
@@ -10999,131 +10980,13 @@ const PersonalizedCard = ({
}, /*#__PURE__*/external_React_default().createElement("img", { }, /*#__PURE__*/external_React_default().createElement("img", {
src: wavingFox, src: wavingFox,
alt: "" alt: ""
}), /*#__PURE__*/external_React_default().createElement("h2", null, messageData.content.cardTitle), /*#__PURE__*/external_React_default().createElement("p", null, messageData.content.cardMessage), /*#__PURE__*/external_React_default().createElement("moz-button", { }), /*#__PURE__*/external_React_default().createElement("h2", null, "Personalized Just for You"), /*#__PURE__*/external_React_default().createElement("p", null, "We\u2019re customizing your feed to show content that matters to you, while ensuring your privacy is always respected."), /*#__PURE__*/external_React_default().createElement("moz-button", {
type: "primary", type: "primary",
class: "personalized-card-cta", class: "personalized-card-cta"
onClick: () => onToggleClick("open-personalization-panel") }, "Manage your settings"), /*#__PURE__*/external_React_default().createElement("a", {
}, messageData.content.ctaText), /*#__PURE__*/external_React_default().createElement(SafeAnchor, { href: "https://www.mozilla.org/en-US/privacy/firefox/#notice"
className: "personalized-card-link", }, "Learn how we protect and manage data")));
dispatch: dispatch,
url: "https://www.mozilla.org/en-US/privacy/firefox/#notice",
onLinkClick: () => {
handleClick("link-click");
}
}, messageData.content.linkText)));
}; };
;// CONCATENATED MODULE: ./content-src/components/MessageWrapper/MessageWrapper.jsx
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
function MessageWrapper({
children,
dispatch,
hiddenOverride,
onDismiss
}) {
const message = (0,external_ReactRedux_namespaceObject.useSelector)(state => state.Messages);
const [isIntersecting, setIsIntersecting] = (0,external_React_namespaceObject.useState)(false);
const [hasRun, setHasRun] = (0,external_React_namespaceObject.useState)();
const handleIntersection = (0,external_React_namespaceObject.useCallback)(() => {
setIsIntersecting(true);
const isVisible = document?.visibilityState && document.visibilityState === "visible";
// only send impression if messageId is defined and tab is visible
if (isVisible && message.messageData.id) {
setHasRun(true);
dispatch(actionCreators.AlsoToMain({
type: actionTypes.MESSAGE_IMPRESSION,
data: message.messageData
}));
}
}, [dispatch, message]);
(0,external_React_namespaceObject.useEffect)(() => {
const handleVisibilityChange = () => {
if (document.visibilityState === "visible" && !hasRun) {
handleIntersection();
}
};
document.addEventListener("visibilitychange", handleVisibilityChange);
return () => {
document.removeEventListener("visibilitychange", handleVisibilityChange);
};
}, [handleIntersection, hasRun]);
const ref = useIntersectionObserver(handleIntersection);
const handleClose = (0,external_React_namespaceObject.useCallback)(() => {
const action = {
type: actionTypes.MESSAGE_TOGGLE_VISIBILITY,
data: true
};
if (message.portID) {
dispatch(actionCreators.OnlyToOneContent(action, message.portID));
} else {
dispatch(actionCreators.AlsoToMain(action));
}
onDismiss?.();
}, [dispatch, message, onDismiss]);
function handleDismiss() {
const {
id
} = message.messageData;
if (id) {
dispatch(actionCreators.OnlyToMain({
type: actionTypes.MESSAGE_DISMISS,
data: {
message: message.messageData
}
}));
}
handleClose();
}
function handleBlock() {
const {
id
} = message.messageData;
if (id) {
dispatch(actionCreators.OnlyToMain({
type: actionTypes.MESSAGE_BLOCK,
data: id
}));
}
}
function handleClick(elementId) {
const {
id
} = message.messageData;
if (id) {
dispatch(actionCreators.OnlyToMain({
type: actionTypes.MESSAGE_CLICK,
data: {
message: message.messageData,
source: elementId || ""
}
}));
}
}
if (!message || !hiddenOverride && message.isHidden) {
return null;
}
// only display the message if `isHidden` is false
return /*#__PURE__*/external_React_default().createElement("div", {
ref: el => {
ref.current = [el];
},
className: "message-wrapper"
}, /*#__PURE__*/external_React_default().cloneElement(children, {
isIntersecting,
handleDismiss,
handleClick,
handleBlock,
handleClose
}));
}
;// CONCATENATED MODULE: ./content-src/components/DiscoveryStreamComponents/CardSections/CardSections.jsx ;// CONCATENATED MODULE: ./content-src/components/DiscoveryStreamComponents/CardSections/CardSections.jsx
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -11140,7 +11003,6 @@ function MessageWrapper({
// Prefs // Prefs
const CardSections_PREF_SECTIONS_CARDS_ENABLED = "discoverystream.sections.cards.enabled"; const CardSections_PREF_SECTIONS_CARDS_ENABLED = "discoverystream.sections.cards.enabled";
const PREF_SECTIONS_CARDS_THUMBS_UP_DOWN_ENABLED = "discoverystream.sections.cards.thumbsUpDown.enabled"; const PREF_SECTIONS_CARDS_THUMBS_UP_DOWN_ENABLED = "discoverystream.sections.cards.thumbsUpDown.enabled";
@@ -11156,6 +11018,10 @@ const CardSections_PREF_BILLBOARD_ENABLED = "newtabAdSize.billboard";
const CardSections_PREF_LEADERBOARD_ENABLED = "newtabAdSize.leaderboard"; const CardSections_PREF_LEADERBOARD_ENABLED = "newtabAdSize.leaderboard";
const CardSections_PREF_LEADERBOARD_POSITION = "newtabAdSize.leaderboard.position"; const CardSections_PREF_LEADERBOARD_POSITION = "newtabAdSize.leaderboard.position";
const CardSections_PREF_BILLBOARD_POSITION = "newtabAdSize.billboard.position"; const CardSections_PREF_BILLBOARD_POSITION = "newtabAdSize.billboard.position";
const PREF_INFERRED_PERSONALIZATION_ENABLED = "discoverystream.sections.personalization.inferred.enabled";
const PREF_INFERRED_PERSONALIZATION_USER_ENABLED = "discoverystream.sections.personalization.inferred.user.enabled";
const PREF_INFERRED_PERSONALIZATION_POSITION = "discoverystream.sections.personalization.inferred.position";
const PREF_INFERRED_PERSONALIZATION_BLOCKED = "discoverystream.sections.personalization.inferred.blocked";
function getLayoutData(responsiveLayouts, index) { function getLayoutData(responsiveLayouts, index) {
let layoutData = { let layoutData = {
classNames: [], classNames: [],
@@ -11436,9 +11302,6 @@ function CardSections({
spocs, spocs,
sectionPersonalization sectionPersonalization
} = (0,external_ReactRedux_namespaceObject.useSelector)(state => state.DiscoveryStream); } = (0,external_ReactRedux_namespaceObject.useSelector)(state => state.DiscoveryStream);
const {
messageData
} = (0,external_ReactRedux_namespaceObject.useSelector)(state => state.Messages);
const personalizationEnabled = prefs[PREF_SECTIONS_PERSONALIZATION_ENABLED]; const personalizationEnabled = prefs[PREF_SECTIONS_PERSONALIZATION_ENABLED];
const interestPickerEnabled = prefs[PREF_INTEREST_PICKER_ENABLED]; const interestPickerEnabled = prefs[PREF_INTEREST_PICKER_ENABLED];
@@ -11512,19 +11375,19 @@ function CardSections({
receivedFeedRank: interestPicker.receivedFeedRank receivedFeedRank: interestPicker.receivedFeedRank
})); }));
} }
const handleDismissP13nCard = () => {
dispatch(actionCreators.SetPref(PREF_INFERRED_PERSONALIZATION_BLOCKED, true));
};
function displayP13nCard() { function displayP13nCard() {
if (messageData && Object.keys(messageData).length >= 1) { const row = prefs[PREF_INFERRED_PERSONALIZATION_POSITION];
if (messageData?.content?.messageType === "PersonalizedCard") { const cardBlocked = prefs[PREF_INFERRED_PERSONALIZATION_BLOCKED];
const row = messageData.content.position; const cardEnabled = prefs[PREF_INFERRED_PERSONALIZATION_ENABLED];
sectionsToRender.splice(row, 0, /*#__PURE__*/external_React_default().createElement(MessageWrapper, { const userEnabled = prefs[PREF_INFERRED_PERSONALIZATION_USER_ENABLED];
dispatch: dispatch, if (!cardBlocked && cardEnabled && userEnabled) {
onDismiss: () => {} sectionsToRender.splice(row, 0, /*#__PURE__*/external_React_default().createElement(PersonalizedCard, {
}, /*#__PURE__*/external_React_default().createElement(PersonalizedCard, { row: row,
position: row, onDismiss: handleDismissP13nCard
dispatch: dispatch, }));
messageData: messageData
})));
}
} }
} }
displayP13nCard(); displayP13nCard();
@@ -14267,6 +14130,115 @@ function WallpaperFeatureHighlight({
outsideClickCallback: handleDismiss outsideClickCallback: handleDismiss
})); }));
} }
;// CONCATENATED MODULE: ./content-src/components/MessageWrapper/MessageWrapper.jsx
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
function MessageWrapper({
children,
dispatch,
hiddenOverride,
onDismiss
}) {
const message = (0,external_ReactRedux_namespaceObject.useSelector)(state => state.Messages);
const [isIntersecting, setIsIntersecting] = (0,external_React_namespaceObject.useState)(false);
const [hasRun, setHasRun] = (0,external_React_namespaceObject.useState)();
const handleIntersection = (0,external_React_namespaceObject.useCallback)(() => {
setIsIntersecting(true);
const isVisible = document?.visibilityState && document.visibilityState === "visible";
// only send impression if messageId is defined and tab is visible
if (isVisible && message.messageData.id) {
setHasRun(true);
dispatch(actionCreators.AlsoToMain({
type: actionTypes.MESSAGE_IMPRESSION,
data: message.messageData
}));
}
}, [dispatch, message]);
(0,external_React_namespaceObject.useEffect)(() => {
const handleVisibilityChange = () => {
if (document.visibilityState === "visible" && !hasRun) {
handleIntersection();
}
};
document.addEventListener("visibilitychange", handleVisibilityChange);
return () => {
document.removeEventListener("visibilitychange", handleVisibilityChange);
};
}, [handleIntersection, hasRun]);
const ref = useIntersectionObserver(handleIntersection);
const handleClose = (0,external_React_namespaceObject.useCallback)(() => {
const action = {
type: actionTypes.MESSAGE_TOGGLE_VISIBILITY,
data: true
};
if (message.portID) {
dispatch(actionCreators.OnlyToOneContent(action, message.portID));
} else {
dispatch(actionCreators.AlsoToMain(action));
}
onDismiss();
}, [dispatch, message, onDismiss]);
function handleDismiss() {
const {
id
} = message.messageData;
if (id) {
dispatch(actionCreators.OnlyToMain({
type: actionTypes.MESSAGE_DISMISS,
data: {
message: message.messageData
}
}));
}
handleClose();
}
function handleBlock() {
const {
id
} = message.messageData;
if (id) {
dispatch(actionCreators.OnlyToMain({
type: actionTypes.MESSAGE_BLOCK,
data: id
}));
}
}
function handleClick(elementId) {
const {
id
} = message.messageData;
if (id) {
dispatch(actionCreators.OnlyToMain({
type: actionTypes.MESSAGE_CLICK,
data: {
message: message.messageData,
source: elementId || ""
}
}));
}
}
// only display the message if `isHidden` is false
return (!message.isHidden || hiddenOverride) && /*#__PURE__*/external_React_default().createElement("div", {
ref: el => {
ref.current = [el];
},
className: "message-wrapper"
}, /*#__PURE__*/external_React_default().cloneElement(children, {
isIntersecting,
handleDismiss,
handleClick,
handleBlock,
handleClose
}));
}
;// CONCATENATED MODULE: ./content-src/components/Base/Base.jsx ;// CONCATENATED MODULE: ./content-src/components/Base/Base.jsx
function Base_extends() { Base_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Base_extends.apply(this, arguments); } function Base_extends() { Base_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Base_extends.apply(this, arguments); }
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public

View File

@@ -230,10 +230,10 @@ module.exports = function (config) {
}, },
"content-src/components/DiscoveryStreamComponents/CardSections/CardSections.jsx": "content-src/components/DiscoveryStreamComponents/CardSections/CardSections.jsx":
{ {
statements: 84.55, statements: 86.05,
lines: 84.03, lines: 85.48,
functions: 79.31, functions: 79.31,
branches: 53.62, branches: 54.41,
}, },
"content-src/components/DiscoveryStreamComponents/SectionContextMenu/SectionContextMenu.jsx": "content-src/components/DiscoveryStreamComponents/SectionContextMenu/SectionContextMenu.jsx":
{ {