Skip to content

Commit

Permalink
SwG Release 0.1.22.195 (#37093)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisAntaki committed Dec 1, 2021
1 parent 833f52e commit 11ac1ee
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 61 deletions.
2 changes: 1 addition & 1 deletion third_party/subscriptions-project/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Version: 0.1.22.194 */
/** Version: 0.1.22.195 */
/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
*
Expand Down
33 changes: 9 additions & 24 deletions third_party/subscriptions-project/swg-gaa.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Version: 0.1.22.194 */
/** Version: 0.1.22.195 */
/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
*
Expand Down Expand Up @@ -252,6 +252,7 @@ const AnalyticsEvent = {
IMPRESSION_TWG_STATIC_BUTTON: 30,
IMPRESSION_TWG_DYNAMIC_BUTTON: 31,
IMPRESSION_TWG_STICKER_SELECTION_SCREEN: 32,
IMPRESSION_TWG_PUBLICATION_NOT_SET_UP: 33,
ACTION_SUBSCRIBE: 1000,
ACTION_PAYMENT_COMPLETE: 1001,
ACTION_ACCOUNT_CREATED: 1002,
Expand Down Expand Up @@ -305,6 +306,7 @@ const AnalyticsEvent = {
ACTION_TWG_FREE_TRANSACTION_START_NEXT_BUTTON_CLICK: 1050,
ACTION_TWG_PAID_TRANSACTION_START_NEXT_BUTTON_CLICK: 1051,
ACTION_TWG_STICKER_SELECTION_SCREEN_CLOSE_CLICK: 1052,
ACTION_TWG_ARTICLE_LEVEL_SUPPORTER_WALL_CTA_CLICK: 1053,
EVENT_PAYMENT_FAILED: 2000,
EVENT_CUSTOM: 3000,
EVENT_CONFIRM_TX_ID: 3001,
Expand Down Expand Up @@ -500,12 +502,6 @@ function parseUrl(url) {
function parseUrlWithA(a, url) {
a.href = url;

// IE11 doesn't provide full URL components when parsing relative URLs.
// Assigning to itself again does the trick.
if (!a.protocol) {
a.href = a.href;
}

/** @type {!LocationDef} */
const info = {
href: a.href,
Expand All @@ -519,22 +515,6 @@ function parseUrlWithA(a, url) {
origin: '', // Set below.
};

// Some IE11 specific polyfills.
// 1) IE11 strips out the leading '/' in the pathname.
if (info.pathname[0] !== '/') {
info.pathname = '/' + info.pathname;
}

// 2) For URLs with implicit ports, IE11 parses to default ports while
// other browsers leave the port field empty.
if (
(info.protocol == 'http:' && info.port == 80) ||
(info.protocol == 'https:' && info.port == 443)
) {
info.port = '';
info.host = info.hostname;
}

// For data URI a.origin is equal to the string 'null' which is not useful.
// We instead return the actual origin which is the full URL.
if (a.origin && a.origin != 'null') {
Expand Down Expand Up @@ -1008,7 +988,7 @@ const REGWALL_HTML = `
.gaa-metering-regwall--iframe {
border: none !important;
display: block !important;
height: 36px !important;
height: 44px !important;
margin: 0 0 30px !important;
width: 100% !important;
}
Expand Down Expand Up @@ -1111,6 +1091,11 @@ const GOOGLE_SIGN_IN_IFRAME_STYLES = `
#${GOOGLE_SIGN_IN_BUTTON_ID} {
margin: 0 auto;
}
#${SIGN_IN_WITH_GOOGLE_BUTTON_ID}{
width: 220px;
}
#${GOOGLE_3P_SIGN_IN_BUTTON_ID} > div,
#${SIGN_IN_WITH_GOOGLE_BUTTON_ID} > div,
#${GOOGLE_SIGN_IN_BUTTON_ID} > div {
Expand Down
71 changes: 35 additions & 36 deletions third_party/subscriptions-project/swg.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Version: 0.1.22.194 */
/** Version: 0.1.22.195 */
/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
*
Expand Down Expand Up @@ -64,6 +64,7 @@ const AnalyticsEvent = {
IMPRESSION_TWG_STATIC_BUTTON: 30,
IMPRESSION_TWG_DYNAMIC_BUTTON: 31,
IMPRESSION_TWG_STICKER_SELECTION_SCREEN: 32,
IMPRESSION_TWG_PUBLICATION_NOT_SET_UP: 33,
ACTION_SUBSCRIBE: 1000,
ACTION_PAYMENT_COMPLETE: 1001,
ACTION_ACCOUNT_CREATED: 1002,
Expand Down Expand Up @@ -117,6 +118,7 @@ const AnalyticsEvent = {
ACTION_TWG_FREE_TRANSACTION_START_NEXT_BUTTON_CLICK: 1050,
ACTION_TWG_PAID_TRANSACTION_START_NEXT_BUTTON_CLICK: 1051,
ACTION_TWG_STICKER_SELECTION_SCREEN_CLOSE_CLICK: 1052,
ACTION_TWG_ARTICLE_LEVEL_SUPPORTER_WALL_CTA_CLICK: 1053,
EVENT_PAYMENT_FAILED: 2000,
EVENT_CUSTOM: 3000,
EVENT_CONFIRM_TX_ID: 3001,
Expand Down Expand Up @@ -4520,12 +4522,6 @@ function parseUrl(url) {
function parseUrlWithA(a, url) {
a.href = url;

// IE11 doesn't provide full URL components when parsing relative URLs.
// Assigning to itself again does the trick.
if (!a.protocol) {
a.href = a.href;
}

/** @type {!LocationDef} */
const info = {
href: a.href,
Expand All @@ -4539,22 +4535,6 @@ function parseUrlWithA(a, url) {
origin: '', // Set below.
};

// Some IE11 specific polyfills.
// 1) IE11 strips out the leading '/' in the pathname.
if (info.pathname[0] !== '/') {
info.pathname = '/' + info.pathname;
}

// 2) For URLs with implicit ports, IE11 parses to default ports while
// other browsers leave the port field empty.
if (
(info.protocol == 'http:' && info.port == 80) ||
(info.protocol == 'https:' && info.port == 443)
) {
info.port = '';
info.host = info.hostname;
}

// For data URI a.origin is equal to the string 'null' which is not useful.
// We instead return the actual origin which is the full URL.
if (a.origin && a.origin != 'null') {
Expand Down Expand Up @@ -4839,7 +4819,7 @@ function feCached(url) {
*/
function feArgs(args) {
return Object.assign(args, {
'_client': 'SwG 0.1.22.194',
'_client': 'SwG 0.1.22.195',
});
}

Expand Down Expand Up @@ -5207,6 +5187,8 @@ class PayCompleteFlow {
.getClientConfig()
.then((clientConfig) => {
args['useUpdatedConfirmUi'] = clientConfig.useUpdatedOfferFlows;
args['skipAccountCreationScreen'] =
clientConfig.skipAccountCreationScreen;
return new ActivityIframeView(
this.win_,
this.activityPorts_,
Expand Down Expand Up @@ -5255,22 +5237,29 @@ class PayCompleteFlow {
return Promise.all([
this.activityIframeViewPromise_,
this.readyPromise_,
this.clientConfigManager_.getClientConfig(),
]).then((values) => {
const activityIframeView = values[0];
const accountCompletionRequest = new AccountCreationRequest();
accountCompletionRequest.setComplete(true);
activityIframeView.execute(accountCompletionRequest);
const clientConfig = values[2];
// Skip account creation screen if requested (needed for AMP)
if (!clientConfig.skipAccountCreationScreen) {
const accountCompletionRequest = new AccountCreationRequest();
accountCompletionRequest.setComplete(true);
activityIframeView.execute(accountCompletionRequest);
}
return activityIframeView
.acceptResult()
.catch(() => {
// Ignore errors.
})
.then(() => {
this.eventManager_.logSwgEvent(
AnalyticsEvent.ACTION_ACCOUNT_ACKNOWLEDGED,
true,
getEventParams$1(this.sku_ || '')
);
if (!clientConfig.skipAccountCreationScreen) {
this.eventManager_.logSwgEvent(
AnalyticsEvent.ACTION_ACCOUNT_ACKNOWLEDGED,
true,
getEventParams$1(this.sku_ || '')
);
}
this.deps_.entitlementsManager().setToastShown(true);
});
});
Expand Down Expand Up @@ -6143,7 +6132,7 @@ class ActivityPorts$1 {
'analyticsContext': context.toArray(),
'publicationId': pageConfig.getPublicationId(),
'productId': pageConfig.getProductId(),
'_client': 'SwG 0.1.22.194',
'_client': 'SwG 0.1.22.195',
'supportsEventManager': true,
},
args || {}
Expand Down Expand Up @@ -7022,7 +7011,7 @@ class AnalyticsService {
context.setTransactionId(getUuid());
}
context.setReferringOrigin(parseUrl(this.getReferrer_()).origin);
context.setClientVersion('SwG 0.1.22.194');
context.setClientVersion('SwG 0.1.22.195');
context.setUrl(getCanonicalUrl(this.doc_));

const utmParams = parseQueryString(this.getQueryString_());
Expand Down Expand Up @@ -8314,6 +8303,7 @@ class ClientConfig {
uiPredicates,
usePrefixedHostPath,
useUpdatedOfferFlows,
skipAccountCreationScreen,
} = {}) {
/** @const {./auto-prompt-config.AutoPromptConfig|undefined} */
this.autoPromptConfig = autoPromptConfig;
Expand All @@ -8327,6 +8317,9 @@ class ClientConfig {
/** @const {boolean} */
this.useUpdatedOfferFlows = useUpdatedOfferFlows || false;

/** @const {boolean} */
this.skipAccountCreationScreen = skipAccountCreationScreen || false;

/** @const {./auto-prompt-config.UiPredicates|undefined} */
this.uiPredicates = uiPredicates;

Expand Down Expand Up @@ -8552,6 +8545,7 @@ class ClientConfigManager {
paySwgVersion,
usePrefixedHostPath: json['usePrefixedHostPath'],
useUpdatedOfferFlows: json['useUpdatedOfferFlows'],
skipAccountCreationScreen: this.clientOptions_.skipAccountCreationScreen,
uiPredicates,
attributionParams,
});
Expand Down Expand Up @@ -8902,7 +8896,7 @@ class DeferredAccountFlow {
}
}

const CSS$1 = "body{margin:0;padding:0}swg-container,swg-loading,swg-loading-animate,swg-loading-image{display:block}swg-loading-container{-ms-flex-align:center!important;-ms-flex-pack:center!important;align-items:center!important;bottom:0!important;display:-ms-flexbox!important;display:flex!important;height:100%!important;justify-content:center!important;margin-top:5px!important;min-height:148px!important;width:100%!important;z-index:2147483647!important}@media (min-height:630px),(min-width:630px){swg-loading-container{background-color:#fff!important;border-top-left-radius:8px!important;border-top-right-radius:8px!important;box-shadow:0 1px 1px rgba(60,64,67,.3),0 1px 4px 1px rgba(60,64,67,.15)!important;margin-left:auto!important;margin-right:auto!important;width:560px!important}swg-loading-container.centered-on-desktop{border-radius:8px!important;height:120px!important;min-height:120px!important}}swg-loading{animation:mspin-rotate 1568.63ms linear infinite;height:36px;overflow:hidden;width:36px;z-index:2147483647!important}swg-loading-animate{animation:mspin-revrot 5332ms steps(4) infinite}swg-loading-image{animation:swg-loading-film 5332ms steps(324) infinite;background-image:url(https://news.google.com/swg/js/v1/loader.svg);background-size:100%;height:36px;width:11664px}@keyframes swg-loading-film{0%{transform:translateX(0)}to{transform:translateX(-11664px)}}@keyframes mspin-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes mspin-revrot{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}\n/*# sourceURL=/./src/ui/ui.css*/";
const CSS$1 = "body{margin:0;padding:0}swg-container,swg-loading,swg-loading-animate,swg-loading-image{display:block}swg-loading-container{-ms-flex-align:center!important;-ms-flex-pack:center!important;align-items:center!important;bottom:0!important;display:-ms-flexbox!important;display:flex!important;height:100%!important;justify-content:center!important;margin-top:5px!important;min-height:148px!important;width:100%!important;z-index:2147483647!important}@media (min-height:630px),(min-width:630px){swg-loading-container{background-color:#fff!important;border-top-left-radius:8px!important;border-top-right-radius:8px!important;box-shadow:0 1px 1px rgba(60,64,67,.3),0 1px 4px 1px rgba(60,64,67,.15)!important;margin-left:auto!important;margin-right:auto!important;width:560px!important}swg-loading-container.centered-on-desktop{border-radius:8px!important;height:120px!important;min-height:120px!important}}swg-loading{animation:mspin-rotate 1568.63ms linear infinite;height:36px;overflow:hidden;width:36px;z-index:2147483647!important}swg-loading-animate{animation:mspin-revrot 5332ms steps(4) infinite}swg-loading-image{animation:swg-loading-film 5332ms steps(324) infinite;background-image:url(https://news.google.com/swg/js/v1/loader.svg);background-size:100%;height:36px;width:11664px}@keyframes swg-loading-film{0%{transform:translateX(0)}to{transform:translateX(-11664px)}}@keyframes mspin-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes mspin-revrot{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}\n/*# sourceURL=/./src/ui/ui.css*/\n";

/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
Expand Down Expand Up @@ -17036,7 +17030,7 @@ class Propensity {
}
}

const CSS = ".swg-dialog,.swg-toast{background-color:#fff!important;box-sizing:border-box}.swg-toast{border:none!important;bottom:0!important;max-height:46px!important;position:fixed!important;z-index:2147483647!important}@media (min-width:871px) and (min-height:641px){.swg-dialog.swg-wide-dialog{left:-435px!important;width:870px!important}}@media (max-height:640px),(max-width:640px){.swg-dialog,.swg-toast{border-top-left-radius:8px!important;border-top-right-radius:8px!important;box-shadow:0 1px 1px rgba(60,64,67,.3),0 1px 4px 1px rgba(60,64,67,.15)!important;left:-240px!important;margin-left:50vw!important;width:480px!important}}@media (min-width:641px) and (min-height:641px){.swg-dialog{background-color:transparent!important;border:none!important;left:-315px!important;margin-left:50vw!important;width:630px!important}.swg-toast{border-radius:4px!important;bottom:8px!important;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)!important;left:8px!important}}@media (max-width:480px){.swg-dialog,.swg-toast{left:0!important;margin-left:0!important;right:0!important;width:100%!important}}\n/*# sourceURL=/./src/components/dialog.css*/";
const CSS = ".swg-dialog,.swg-toast{background-color:#fff!important;box-sizing:border-box}.swg-toast{border:none!important;bottom:0!important;max-height:46px!important;position:fixed!important;z-index:2147483647!important}@media (min-width:871px) and (min-height:641px){.swg-dialog.swg-wide-dialog{left:-435px!important;width:870px!important}}@media (max-height:640px),(max-width:640px){.swg-dialog,.swg-toast{border-top-left-radius:8px!important;border-top-right-radius:8px!important;box-shadow:0 1px 1px rgba(60,64,67,.3),0 1px 4px 1px rgba(60,64,67,.15)!important;left:-240px!important;margin-left:50vw!important;width:480px!important}}@media (min-width:641px) and (min-height:641px){.swg-dialog{background-color:transparent!important;border:none!important;left:-315px!important;margin-left:50vw!important;width:630px!important}.swg-toast{border-radius:4px!important;bottom:8px!important;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)!important;left:8px!important}}@media (max-width:480px){.swg-dialog,.swg-toast{left:0!important;margin-left:0!important;right:0!important;width:100%!important}}\n/*# sourceURL=/./src/components/dialog.css*/\n";

/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
Expand Down Expand Up @@ -17505,6 +17499,11 @@ class ConfiguredRuntime {
error = 'Unknown enablePropensity value: ' + v;
}
break;
case 'skipAccountCreationScreen':
if (!isBoolean(v)) {
error = 'Unknown skipAccountCreationScreen value: ' + v;
}
break;
default:
error = 'Unknown config property: ' + k;
}
Expand Down

0 comments on commit 11ac1ee

Please sign in to comment.