Skip to content

Commit

Permalink
Merge pull request #9022 from google/infra/8414-browserlist-update
Browse files Browse the repository at this point in the history
Infra/8414 browserlist update
  • Loading branch information
tofumatt authored Jul 19, 2024
2 parents eb65825 + e8389b9 commit 6847b29
Show file tree
Hide file tree
Showing 10 changed files with 982 additions and 1,221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export default function setUpAdvancedTracking(
}
};

document.addEventListener( eventConfig.on, handleDOMEvent, true );
global.document.addEventListener(
eventConfig.on,
handleDOMEvent,
true
);

toRemove.push( [ eventConfig.on, handleDOMEvent, true ] );
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function CustomDimensionsNotice() {
hasMissingCustomDimensions &&
previousHasMissingCustomDimensions === false
) {
const currentFocusedElement = document.activeElement;
const currentFocusedElement = global.document.activeElement;

if (
currentFocusedElement &&
Expand Down
9 changes: 6 additions & 3 deletions assets/js/consent-mode/consent-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ import { isEqual } from 'lodash';
}
}
}
document.addEventListener(

global.document.addEventListener(
'wp_listen_for_consent_change',
actionConsentChange
);
Expand Down Expand Up @@ -76,11 +77,13 @@ import { isEqual } from 'lodash';
global._googlesitekitConsents = consentParameters;
}
}
document.addEventListener(

global.document.addEventListener(
'wp_consent_type_defined',
updateGrantedConsent
);
document.addEventListener( 'DOMContentLoaded', function () {

global.document.addEventListener( 'DOMContentLoaded', function () {
if ( ! global.waitfor_consent_hook ) {
updateGrantedConsent();
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/event-providers/contact-form-7.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

document.addEventListener( 'wpcf7mailsent', ( event ) => {
global.document.addEventListener( 'wpcf7mailsent', ( event ) => {
global._googlesitekit?.gtagEvent?.( 'contact', {
// eslint-disable-next-line sitekit/acronym-case
event_category: event.detail.contactFormId,
Expand Down
2 changes: 1 addition & 1 deletion assets/js/event-providers/optin-monster.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

document.addEventListener( 'om.Analytics.track', ( { detail } ) => {
global.document.addEventListener( 'om.Analytics.track', ( { detail } ) => {
if ( 'conversion' === detail.Analytics.type ) {
global._googlesitekit?.gtagEvent?.( 'submit_lead_form', {
campaignID: detail.Campaign.id,
Expand Down
25 changes: 0 additions & 25 deletions assets/sass/components/global/_googlesitekit-button-icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,14 @@
}

&.googlesitekit-button-icon--spinner__before {
/**
* TODO: Remove the fallback margin-{left|right} and html[dir="rtl"] specific
* overrides from `.mdc-button__label` when `postcss-preset-env` is configured
* to not polyfill `logical-properties-and-values`.
* @see https://github.com/google/site-kit-wp/pull/8372#discussion_r1527263640
* @see https://github.com/google/site-kit-wp/issues/8414
*/
.mdc-button__label {
margin-inline-start: 8px;
margin-left: 8px;

html[dir="rtl"] & {
margin-left: 0;
}
}
}

&.googlesitekit-button-icon--spinner__after {
/**
* TODO: Remove the fallback margin-{left|right} and html[dir="rtl"] specific
* overrides from `.mdc-button__label` when `postcss-preset-env` is configured
* to not polyfill `logical-properties-and-values`.
* @see https://github.com/google/site-kit-wp/pull/8372#discussion_r1527263640
* @see https://github.com/google/site-kit-wp/issues/8414
*/
/* stylelint-disable-next-line no-descending-specificity */
.mdc-button__label {
margin-inline-end: 8px;
margin-right: 8px;

html[dir="rtl"] & {
margin-right: 0;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,14 @@
flex-direction: column;
margin: $grid-gap-phone;

/**
* TODO: Remove fallback `right` inset and html[dir="rtl"] specific
* overrides when `postcss-preset-env` is configured to not polyfill
* `logical-properties-and-values`, so the `inset-inline-end` property
* can be used directly without the need for the workaround.
* @see https://github.com/google/site-kit-wp/issues/8414
*/
@media (min-width: $bp-tablet) {
bottom: 32px;
box-shadow: 0 8px $grid-gap-desktop 0 rgba(0, 0, 0, 0.25);
inset-inline-end: 32px;
margin: 0;
max-width: 296px;
position: fixed;
right: 32px;
z-index: $z-index-sk-overlay-notification;

html[dir="rtl"] & {
right: unset;
}
}

@media (min-width: $bp-desktop) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,39 +51,14 @@
}

&.googlesitekit-button-icon--spinner__before {
/**
* TODO: Remove the fallback margin-{left|right} and html[dir="rtl"] specific
* overrides from `.mdc-button__label` when `postcss-preset-env` is configured
* to not polyfill `logical-properties-and-values`.
* @see https://github.com/google/site-kit-wp/pull/8372#discussion_r1527263640
* @see https://github.com/google/site-kit-wp/issues/8414
*/
.mdc-button__label {
margin-inline-start: 8px;
margin-left: 8px;

html[dir="rtl"] & {
margin-left: 0;
}
}
}

&.googlesitekit-button-icon--spinner__after {
/**
* TODO: Remove the fallback margin-{left|right} and html[dir="rtl"] specific
* overrides from `.mdc-button__label` when `postcss-preset-env` is configured
* to not polyfill `logical-properties-and-values`.
* @see https://github.com/google/site-kit-wp/pull/8372#discussion_r1527263640
* @see https://github.com/google/site-kit-wp/issues/8414
*/
/* stylelint-disable-next-line no-descending-specificity */
.mdc-button__label {
margin-inline-end: 8px;
margin-right: 8px;

html[dir="rtl"] & {
margin-right: 0;
}
}
}
}
Expand Down
Loading

0 comments on commit 6847b29

Please sign in to comment.