From 48ca60b077222fbdde65ca095033388a5678e75a Mon Sep 17 00:00:00 2001 From: Stella Chui <72764960+stellachui@users.noreply.github.com> Date: Tue, 23 Feb 2021 10:51:40 -0800 Subject: [PATCH] SwG Release 0.1.22.149 (#32758) --- third_party/subscriptions-project/config.js | 2 +- third_party/subscriptions-project/swg.js | 149 +++++++++++--------- 2 files changed, 81 insertions(+), 70 deletions(-) diff --git a/third_party/subscriptions-project/config.js b/third_party/subscriptions-project/config.js index df89724d3b36..639d1261aab5 100644 --- a/third_party/subscriptions-project/config.js +++ b/third_party/subscriptions-project/config.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** Version: 0.1.22.145 */ +/** Version: 0.1.22.149 */ /** * Copyright 2018 The Subscribe with Google Authors. All Rights Reserved. * diff --git a/third_party/subscriptions-project/swg.js b/third_party/subscriptions-project/swg.js index be5b6552d62d..021c3b948b8d 100644 --- a/third_party/subscriptions-project/swg.js +++ b/third_party/subscriptions-project/swg.js @@ -1,6 +1,6 @@ /** * Copyright 2018 The Subscribe with Google Authors. All Rights Reserved. -/* + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** Version: 0.1.22.145 */ +/** Version: 0.1.22.149 */ /** * Copyright 2018 The Subscribe with Google Authors. All Rights Reserved. * @@ -6232,7 +6232,7 @@ function feCached(url) { */ function feArgs(args) { return Object.assign(args, { - '_client': 'SwG 0.1.22.145', + '_client': 'SwG 0.1.22.149', }); } @@ -7351,7 +7351,7 @@ class ActivityPorts$1 { 'analyticsContext': context.toArray(), 'publicationId': pageConfig.getPublicationId(), 'productId': pageConfig.getProductId(), - '_client': 'SwG 0.1.22.145', + '_client': 'SwG 0.1.22.149', 'supportsEventManager': true, }, args || {} @@ -8193,7 +8193,7 @@ class AnalyticsService { context.setTransactionId(getUuid()); } context.setReferringOrigin(parseUrl$1(this.getReferrer_()).origin); - context.setClientVersion('SwG 0.1.22.145'); + context.setClientVersion('SwG 0.1.22.149'); context.setUrl(getCanonicalUrl(this.doc_)); const utmParams = parseQueryString$1(this.getQueryString_()); @@ -10779,12 +10779,21 @@ class MeterToastApi { .handleCancellations(this.activityIframeView_) .catch((reason) => { // Possibly call onConsumeCallback on all dialog cancellations to ensure unexpected - // dialog closes don't give access without a meter consumed. + // dialog closures don't give access without a meter consumed. if (this.onConsumeCallback_ && !this.onConsumeCallbackHandled_) { this.onConsumeCallbackHandled_ = true; this.onConsumeCallback_(); } - throw reason; + // Don't throw on cancel errors since they happen when a user closes the toast, + // which is expected. + if (!isCancelError(reason)) { + // eslint-disable-next-line no-console + console /*OK*/ + .error( + '[swg.js]: Error occurred during meter toast handling: ' + reason + ); + throw reason; + } }); return this.dialogManager_.openDialog().then((dialog) => { this.setDialogBoxShadow_(); @@ -17228,30 +17237,41 @@ class WaitForSubscriptionLookupApi { */ // NOTE: Please don't edit this file directly! -// You can (re)compile this file by running the "yarn build-i18n" shell command. +// This document describes how to change i18n strings in swg-js: https://docs.google.com/document/d/1FMEKJ_TmjHhqON0krE4xhDbTEj0I0DnvzxMzB2cWUWA/edit?resourcekey=0-TQ7hPOzAD4hX8x9PfweGSg#heading=h.q9gi7t4h1tyj const I18N_STRINGS = { - 'GAA_REGWALL_TITLE': { + 'SHOWCASE_REGWALL_TITLE': { 'de': 'Immer gut informiert mit Google', 'en': 'Get more with Google', - 'fr': 'Plus de possibilités avec Google', + 'es-ar': 'Disfruta más artículos con Google', + 'fr': 'Plus de contenus avec Google', 'pt-br': 'Veja mais com o Google', }, - 'GAA_REGWALL_DESCRIPTION': { + 'SHOWCASE_REGWALL_DESCRIPTION': { 'de': - 'Dieser Inhalt ist normalerweise kostenpflichtig. Google gewährt dir jedoch kostenlos Zugriff auf diesen Artikel und andere Inhalte, wenn du dich mit deinem Google-Konto bei AP News{publication} registrierst.', + 'Dieser Inhalt ist normalerweise kostenpflichtig. Google gewährt dir jedoch kostenlos Zugriff auf diesen Artikel und andere Inhalte, wenn du dich mit deinem Google-Konto bei AP News{publication} registrierst.', 'en': 'This content usually requires payment, but Google is giving you free access to this article and more when you register with AP News{publication} using your Google Account.', + 'es-ar': + 'Normalmente, es necesario pagar para ver este contenido, pero Google te ofrece acceso gratuito a este y otros artículos si te registras en AP News{publication} con tu Cuenta de Google.', 'fr': - 'Ce contenu est généralement payant, mais vous pouvez lire cet article et d'autres contenus gratuitement grâce à Google en vous inscrivant sur AP News{publication} avec votre compte Google.', + 'Ce contenu est généralement payant, mais vous pouvez lire cet article et d\'autres contenus gratuitement grâce à Google en vous inscrivant sur AP News{publication} avec votre compte Google.', 'pt-br': - 'Normalmente, é preciso pagar por este conteúdo. Porém, basta você se registrar na publicação AP News{publication} usando sua Conta do Google para ter acesso gratuito a esta matéria e muito mais.', + 'Normalmente, é preciso pagar por este conteúdo. Porém, basta você se registrar na publicação AP News{publication} usando sua Conta do Google para ter acesso gratuito a esta matéria e muito mais.', }, - 'GAA_REGWALL_PUBLISHER_SIGN_IN_BUTTON': { + 'SHOWCASE_REGWALL_PUBLISHER_SIGN_IN_BUTTON': { 'de': 'Du hast bereits ein Konto?', 'en': 'Already have an account?', - 'fr': 'Vous avez déjà un compte ?', - 'pt-br': 'Já tem uma conta?', + 'es-ar': '¿Ya tienes una cuenta?', + 'fr': 'Vous avez déjà un compte ?', + 'pt-br': 'Já tem uma conta?', + }, + 'SHOWCASE_REGWALL_GOOGLE_SIGN_IN_BUTTON': { + 'de': 'Über Google anmelden', + 'en': 'Sign in with Google', + 'es-ar': 'Acceder con Google', + 'fr': 'Se connecter avec Google', + 'pt-br': 'Fazer login com o Google', }, }; @@ -17298,10 +17318,6 @@ const REGWALL_DIALOG_ID = 'swg-regwall-dialog'; /** ID for the Regwall title element. */ const REGWALL_TITLE_ID = 'swg-regwall-title'; -/** Class the Regwall uses to disable scrolling. */ -const REGWALL_DISABLE_SCROLLING_CLASS = - 'gaa-metering-regwall--disable-scrolling'; - /** * HTML for the metering regwall dialog, where users can sign in with Google. * The script creates a dialog based on this HTML. @@ -17311,10 +17327,6 @@ const REGWALL_DISABLE_SCROLLING_CLASS = */ const REGWALL_HTML = `