Skip to content

Commit

Permalink
SwG Release 0.1.22.192 (#36744)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmicedcoffee committed Nov 3, 2021
1 parent 2d2f01c commit ce960f2
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 69 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.191 */
/** Version: 0.1.22.192 */
/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
*
Expand Down
127 changes: 64 additions & 63 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.191 */
/** Version: 0.1.22.192 */
/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
*
Expand Down Expand Up @@ -919,123 +919,123 @@ const REGWALL_HTML = `
.gaa-metering-regwall--iframe,
.gaa-metering-regwall--casl,
.gaa-metering-regwall--publisher-no-thanks-button {
all: initial;
box-sizing: border-box;
font-family: Roboto, arial, sans-serif;
all: initial !important;
box-sizing: border-box !important;
font-family: Roboto, arial, sans-serif !important;
}
.gaa-metering-regwall--dialog-spacer {
background: linear-gradient(0, #808080, transparent);
bottom: 0;
display: block;
position: fixed;
width: 100%;
background: linear-gradient(0, #808080, transparent) !important;
bottom: 0 !important;
display: block !important;
position: fixed !important;
width: 100% !important;
}
@keyframes slideUp {
from {transform: translate(0, 200px);}
to {transform: translate(0, 0);}
from {transform: translate(0, 200px) !important;}
to {transform: translate(0, 0) !important;}
}
.gaa-metering-regwall--dialog {
animation: slideUp 0.5s;
background: white;
border-radius: 12px 12px 0 0;
box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.3);
display: block;
margin: 0 auto;
max-width: 100%;
padding: 24px 20px;
pointer-events: auto;
width: 410px;
animation: slideUp 0.5s !important;
background: white !important;
border-radius: 12px 12px 0 0 !important;
box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.3) !important;
display: block !important;
margin: 0 auto !important;
max-width: 100% !important;
padding: 24px 20px !important;
pointer-events: auto !important;
width: 410px !important;
}
.gaa-metering-regwall--logo {
display: block;
margin: 0 auto 24px;
display: block !important;
margin: 0 auto 24px !important;
}
.gaa-metering-regwall--title {
color: #000;
display: block;
font-size: 16px;
margin: 0 0 8px;
outline: none !important;
color: #000 !important;
display: block !important;
font-size: 16px !important;
margin: 0 0 8px !important;
outline: none !important !important;
}
.gaa-metering-regwall--description {
color: #646464;
display: block;
font-size: 14px;
line-height: 19px;
margin: 0 0 30px;
color: #646464 !important;
display: block !important;
font-size: 14px !important;
line-height: 19px !important;
margin: 0 0 30px !important;
}
.gaa-metering-regwall--description strong {
color: #646464;
font-size: 14px;
line-height: 19px;
font-weight: bold;
color: #646464 !important;
font-size: 14px !important;
line-height: 19px !important;
font-weight: bold !important;
}
.gaa-metering-regwall--iframe {
border: none;
display: block;
height: 36px;
margin: 0 0 30px;
width: 100%;
border: none !important;
display: block !important;
height: 36px !important;
margin: 0 0 30px !important;
width: 100% !important;
}
.gaa-metering-regwall--casl {
color: #646464;
display: block;
font-size: 12px;
text-align: center;
margin: -16px auto 32px;
color: #646464 !important;
display: block !important;
font-size: 12px !important;
text-align: center !important;
margin: -16px auto 32px !important;
}
.gaa-metering-regwall--casl a {
color: #1967d2;
color: #1967d2 !important;
}
.gaa-metering-regwall--line {
background-color: #ddd;
display: block;
height: 1px;
margin: 0 0 24px;
background-color: #ddd !important;
display: block !important;
height: 1px !important;
margin: 0 0 24px !important;
}
.gaa-metering-regwall--publisher-sign-in-button,
.gaa-metering-regwall--publisher-no-thanks-button {
color: #1967d2;
display: block;
cursor: pointer;
font-size: 12px;
color: #1967d2 !important;
display: block !important;
cursor: pointer !important;
font-size: 12px !important;
}
.gaa-metering-regwall--publisher-sign-in-button {
}
.gaa-metering-regwall--publisher-no-thanks-button {
display: none;
float: right;
display: none !important;
float: right !important;
}
.gaa-metering-regwall--google-sign-in-button {
height: 36px;
margin: 0 auto 30px;
height: 36px !important;
margin: 0 auto 30px !important;
}
.gaa-metering-regwall--google-sign-in-button > div {
animation: swgGoogleSignInButtonfadeIn 0.32s;
animation: swgGoogleSignInButtonfadeIn 0.32s !important;
}
@keyframes swgGoogleSignInButtonfadeIn {
from {
opacity: 0;
opacity: 0 !important;
}
to {
opacity: 1;
opacity: 1 !important;
}
}
</style>
Expand Down Expand Up @@ -1301,6 +1301,7 @@ class GaaMeteringRegwall {
iframeUrl = addQueryParam(iframeUrl, 'lang', languageCode);

// Create and style container element.
// TODO: Consider using a FriendlyIframe here, to avoid CSS conflicts.
const containerEl = /** @type {!HTMLDivElement} */ (
self.document.createElement('div')
);
Expand Down
80 changes: 75 additions & 5 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.191 */
/** Version: 0.1.22.192 */
/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
*
Expand Down Expand Up @@ -196,6 +196,59 @@ class AccountCreationRequest {
}
}

/**
* @implements {Message}
*/
class ActionRequest {
/**
* @param {!Array<*>=} data
* @param {boolean=} includesLabel
*/
constructor(data = [], includesLabel = true) {
const base = includesLabel ? 1 : 0;

/** @private {?ActionType} */
this.action_ = data[base] == null ? null : data[base];
}

/**
* @return {?ActionType}
*/
getAction() {
return this.action_;
}

/**
* @param {!ActionType} value
*/
setAction(value) {
this.action_ = value;
}

/**
* @param {boolean=} includeLabel
* @return {!Array<?>}
* @override
*/
toArray(includeLabel = true) {
const arr = [
this.action_, // field 1 - action
];
if (includeLabel) {
arr.unshift(this.label());
}
return arr;
}

/**
* @return {string}
* @override
*/
label() {
return 'ActionRequest';
}
}

/**
* @implements {Message}
*/
Expand Down Expand Up @@ -1854,6 +1907,7 @@ class ViewSubscriptionsResponse {

const PROTO_MAP = {
'AccountCreationRequest': AccountCreationRequest,
'ActionRequest': ActionRequest,
'AlreadySubscribedResponse': AlreadySubscribedResponse,
'AnalyticsContext': AnalyticsContext,
'AnalyticsEventMeta': AnalyticsEventMeta,
Expand Down Expand Up @@ -4757,7 +4811,7 @@ function feCached(url) {
*/
function feArgs(args) {
return Object.assign(args, {
'_client': 'SwG 0.1.22.191',
'_client': 'SwG 0.1.22.192',
});
}

Expand Down Expand Up @@ -6061,7 +6115,7 @@ class ActivityPorts$1 {
'analyticsContext': context.toArray(),
'publicationId': pageConfig.getPublicationId(),
'productId': pageConfig.getProductId(),
'_client': 'SwG 0.1.22.191',
'_client': 'SwG 0.1.22.192',
'supportsEventManager': true,
},
args || {}
Expand Down Expand Up @@ -6940,7 +6994,7 @@ class AnalyticsService {
context.setTransactionId(getUuid());
}
context.setReferringOrigin(parseUrl(this.getReferrer_()).origin);
context.setClientVersion('SwG 0.1.22.191');
context.setClientVersion('SwG 0.1.22.192');
context.setUrl(getCanonicalUrl(this.doc_));

const utmParams = parseQueryString(this.getQueryString_());
Expand Down Expand Up @@ -10898,6 +10952,9 @@ class EntitlementsManager {
/** @private {boolean} */
this.blockNextNotification_ = false;

/** @private {boolean} */
this.blockNextToast_ = false;

/**
* String containing encoded metering parameters currently.
* We may expand this to contain more information in the future.
Expand Down Expand Up @@ -11236,6 +11293,12 @@ class EntitlementsManager {
this.blockNextNotification_ = true;
}

/**
*/
blockNextToast() {
this.blockNextToast_ = true;
}

/**
*/
unblockNextNotification() {
Expand Down Expand Up @@ -11369,6 +11432,9 @@ class EntitlementsManager {
// TODO(dvoytenko): what's the right action when pay flow was canceled?
const blockNotification = this.blockNextNotification_;
this.blockNextNotification_ = false;
// Let people specifically block toasts too, without blocking notifications.
const blockToast = this.blockNextToast_;
this.blockNextToast_ = false;
if (blockNotification) {
return;
}
Expand All @@ -11385,6 +11451,10 @@ class EntitlementsManager {
.logSwgEvent(AnalyticsEvent.EVENT_NO_ENTITLEMENTS, false);
return;
}

if (blockToast) {
return;
}
this.maybeShowToast_(entitlement);
}

Expand Down Expand Up @@ -16918,7 +16988,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 rgb(0 0 0/20%),0 2px 2px 0 rgb(0 0 0/14%),0 1px 5px 0 rgb(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*/";

/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
Expand Down

0 comments on commit ce960f2

Please sign in to comment.