@braze/web-sdk 4.9.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2204 -2230
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +1 -1
- package/shared-lib/event-types.js +9 -9
- package/shared-lib/indexed-db-adapter.js +13 -13
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +8 -8
- package/src/Card/models/captioned-image.js +19 -19
- package/src/Card/models/card.js +95 -94
- package/src/Card/models/classic-card.js +19 -19
- package/src/Card/models/control-card.js +9 -9
- package/src/Card/models/image-only.js +21 -22
- package/src/Card/models/index.js +0 -1
- package/src/Card/util/card-factory.js +39 -39
- package/src/ContentCards/content-cards-provider.js +114 -114
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/index.js +0 -1
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
- package/src/ContentCards/ui/hide-content-cards.js +2 -2
- package/src/ContentCards/ui/show-content-cards.js +14 -14
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +2 -2
- package/src/Core/disable-sdk.js +4 -4
- package/src/Core/enable-sdk.js +4 -4
- package/src/Core/get-device-id.js +9 -7
- package/src/Core/handle-braze-action.js +14 -14
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/open-session.js +5 -5
- package/src/Core/set-sdk-authentication-signature.js +2 -2
- package/src/Core/wipe-data.js +4 -4
- package/src/FeatureFlags/feature-flag-factory.js +10 -10
- package/src/FeatureFlags/feature-flag.js +7 -7
- package/src/FeatureFlags/feature-flags-provider.js +50 -50
- package/src/FeatureFlags/get-all-feature-flags.js +1 -1
- package/src/FeatureFlags/get-feature-flag.js +3 -5
- package/src/Feed/feed-provider-factory.js +8 -8
- package/src/Feed/feed-provider.js +15 -15
- package/src/Feed/get-cached-feed.js +2 -2
- package/src/Feed/request-feed-refresh.js +2 -2
- package/src/Feed/subscribe-to-feed-updates.js +2 -2
- package/src/Feed/ui/hide-feed.js +2 -2
- package/src/Feed/ui/show-feed.js +13 -13
- package/src/InAppMessage/display/html-message-to-html.js +11 -12
- package/src/InAppMessage/display/in-app-message-to-html.js +15 -15
- package/src/InAppMessage/display/modal-utils.js +8 -8
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager.js +38 -38
- package/src/InAppMessage/models/full-screen-message.js +31 -31
- package/src/InAppMessage/models/html-message.js +16 -16
- package/src/InAppMessage/models/in-app-message-button.js +5 -5
- package/src/InAppMessage/models/in-app-message.js +46 -46
- package/src/InAppMessage/models/modal-message.js +30 -30
- package/src/InAppMessage/models/slide-up-message.js +26 -26
- package/src/InAppMessage/ui/show-in-app-message.js +9 -9
- package/src/Push/is-push-blocked.js +2 -2
- package/src/Push/is-push-permission-granted.js +2 -2
- package/src/Push/is-push-supported.js +2 -2
- package/src/Push/push-manager.js +31 -31
- package/src/Push/utils/push-utils.js +9 -9
- package/src/User/user-manager.js +8 -8
- package/src/User/user.js +38 -37
- package/src/common/base-feed.js +15 -14
- package/src/common/base-provider.js +1 -1
- package/src/common/event-logger.js +2 -2
- package/src/common/feed-display.js +32 -32
- package/src/l10n/l10n-manager-factory.js +9 -9
- package/src/managers/auth-manager.js +6 -6
- package/src/managers/braze-instance.js +84 -92
- package/src/managers/device-manager.js +9 -9
- package/src/managers/network-manager.js +72 -69
- package/src/managers/server-config-manager.js +13 -13
- package/src/managers/session-manager.js +9 -9
- package/src/managers/storage-manager-factory.js +11 -11
- package/src/managers/storage-manager.js +110 -110
- package/src/managers/subscription-manager.js +3 -3
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +7 -7
- package/src/models/identifier.js +1 -1
- package/src/models/push-token.js +1 -1
- package/src/models/server-config.js +6 -6
- package/src/request-controller.js +129 -125
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +6 -6
- package/src/triggers/models/filter-set.js +8 -8
- package/src/triggers/models/filter.js +31 -31
- package/src/triggers/models/in-app-message-click-data.js +1 -1
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +4 -4
- package/src/triggers/models/push-click-data.js +3 -3
- package/src/triggers/models/trigger-condition.js +30 -30
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +32 -32
- package/src/triggers/triggers-provider.js +55 -55
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +5 -5
- package/src/ui/js/iam-css.js +4 -4
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +11 -11
- package/src/util/client-hints-parser.js +5 -5
- package/src/util/component-utils.js +2 -2
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +4 -5
- package/src/util/dom-utils.js +5 -5
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +17 -17
- package/src/util/user-agent-parser.js +11 -16
- package/src/util/validation-utils.js +9 -9
- package/src/Card/models/banner.js +0 -31
- package/src/ContentCards/log-content-cards-displayed.js +0 -5
package/package.json
CHANGED
|
@@ -4,5 +4,5 @@ import Ge from "./guid.js";
|
|
|
4
4
|
import Oe from "./indexed-db-adapter.js";
|
|
5
5
|
import Ue from "./logger.js";
|
|
6
6
|
import ke from "./supported-options.js";
|
|
7
|
-
const r = { On: ve, q: De, Cr: Be, Z: Ge,
|
|
7
|
+
const r = { On: ve, q: De, Cr: Be, Z: Ge, es: Oe, ts: Oe.ep, j: Ue, Yo: ke };
|
|
8
8
|
export default r;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const De = {
|
|
2
2
|
CustomEvent: "ce",
|
|
3
3
|
Pr: "p",
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
Mu: "pc",
|
|
5
|
+
cc: "ca",
|
|
6
|
+
Ka: "i",
|
|
7
7
|
qs: "ie",
|
|
8
8
|
P: "cci",
|
|
9
9
|
T: "ccic",
|
|
@@ -16,19 +16,19 @@ const De = {
|
|
|
16
16
|
Qi: "sbc",
|
|
17
17
|
Ki: "sfe",
|
|
18
18
|
eo: "iec",
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
Lu: "lr",
|
|
20
|
+
Tu: "uae",
|
|
21
21
|
R: "ci",
|
|
22
22
|
B: "cc",
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Ru: "lcaa",
|
|
24
|
+
Pu: "lcar",
|
|
25
25
|
Xn: "inc",
|
|
26
26
|
Jn: "add",
|
|
27
27
|
Qn: "rem",
|
|
28
28
|
Hn: "set",
|
|
29
29
|
Kn: "ncam",
|
|
30
|
-
|
|
30
|
+
Nu: "sgu",
|
|
31
31
|
Fr: "ffi",
|
|
32
32
|
},
|
|
33
|
-
Be = { Br: "feed_displayed",
|
|
33
|
+
Be = { Br: "feed_displayed", dc: "content_cards_displayed" };
|
|
34
34
|
export { De as EventTypes, Be as InternalEventTypes };
|
|
@@ -64,11 +64,11 @@ export default class Oe {
|
|
|
64
64
|
"...",
|
|
65
65
|
);
|
|
66
66
|
const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
|
|
67
|
-
for (const t in i.database.
|
|
67
|
+
for (const t in i.database.rs) {
|
|
68
68
|
const e = t;
|
|
69
|
-
i.database.
|
|
70
|
-
!n.objectStoreNames.contains(i.database.
|
|
71
|
-
n.createObjectStore(i.database.
|
|
69
|
+
i.database.rs.hasOwnProperty(t) &&
|
|
70
|
+
!n.objectStoreNames.contains(i.database.rs[e]) &&
|
|
71
|
+
n.createObjectStore(i.database.rs[e]);
|
|
72
72
|
}
|
|
73
73
|
}),
|
|
74
74
|
(o.onsuccess = (n) => {
|
|
@@ -249,7 +249,7 @@ export default class Oe {
|
|
|
249
249
|
};
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
ss(t, e) {
|
|
253
253
|
if (!this.isSupported()) return !1;
|
|
254
254
|
const n = this;
|
|
255
255
|
return this.nd((o) => {
|
|
@@ -304,11 +304,11 @@ export default class Oe {
|
|
|
304
304
|
clearData() {
|
|
305
305
|
if (!this.isSupported()) return !1;
|
|
306
306
|
const t = [];
|
|
307
|
-
for (const e in this.database.
|
|
307
|
+
for (const e in this.database.rs) {
|
|
308
308
|
const n = e;
|
|
309
|
-
this.database.
|
|
310
|
-
this.database.
|
|
311
|
-
t.push(this.database.
|
|
309
|
+
this.database.rs.hasOwnProperty(e) &&
|
|
310
|
+
this.database.rs[n] !== this.database.rs.se &&
|
|
311
|
+
t.push(this.database.rs[n]);
|
|
312
312
|
}
|
|
313
313
|
const e = this;
|
|
314
314
|
return this.nd(function (n) {
|
|
@@ -334,15 +334,15 @@ export default class Oe {
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
Oe.ep = {
|
|
337
|
-
|
|
337
|
+
Zt: {
|
|
338
338
|
od: "AppboyServiceWorkerAsyncStorage",
|
|
339
339
|
VERSION: 6,
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
rs: {
|
|
341
|
+
Na: "data",
|
|
342
342
|
kr: "pushClicks",
|
|
343
343
|
cu: "pushSubscribed",
|
|
344
344
|
dd: "fallbackDevice",
|
|
345
|
-
|
|
345
|
+
hs: "cardUpdates",
|
|
346
346
|
se: "optOut",
|
|
347
347
|
wr: "pendingData",
|
|
348
348
|
qh: "sdkAuthenticationSignature",
|
package/shared-lib/logger.js
CHANGED
|
@@ -24,13 +24,13 @@ const Ue = {
|
|
|
24
24
|
},
|
|
25
25
|
warn: function (n) {
|
|
26
26
|
if (Ue.zg) {
|
|
27
|
-
const o = "Braze SDK Warning: " + n + " (
|
|
27
|
+
const o = "Braze SDK Warning: " + n + " (v5.0.0)";
|
|
28
28
|
null != Ue.j ? Ue.j(o) : console.warn(o);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
error: function (n) {
|
|
32
32
|
if (Ue.zg) {
|
|
33
|
-
const o = "Braze SDK Error: " + n + " (
|
|
33
|
+
const o = "Braze SDK Error: " + n + " (v5.0.0)";
|
|
34
34
|
null != Ue.j ? Ue.j(o) : console.error(o);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
ho: "allowCrawlerActivity",
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
_o: "baseUrl",
|
|
4
|
+
Eo: "noCookies",
|
|
5
5
|
Io: "devicePropertyAllowlist",
|
|
6
6
|
Aa: "disablePushTokenMaintenance",
|
|
7
7
|
Ao: "enableLogging",
|
|
8
8
|
So: "enableSdkAuthentication",
|
|
9
9
|
qa: "manageServiceWorkerExternally",
|
|
10
10
|
No: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
Oo: "sessionTimeoutInSeconds",
|
|
12
|
+
wo: "appVersion",
|
|
13
|
+
Po: "appVersionNumber",
|
|
13
14
|
_a: "serviceWorkerLocation",
|
|
14
15
|
ka: "safariWebsitePushId",
|
|
15
16
|
Ba: "localization",
|
|
16
17
|
po: "contentSecurityNonce",
|
|
17
|
-
|
|
18
|
-
Lo: "allowUserSuppliedJavascript",
|
|
18
|
+
Ro: "allowUserSuppliedJavascript",
|
|
19
19
|
lo: "inAppMessageZIndex",
|
|
20
20
|
fo: "openInAppMessagesInNewTab",
|
|
21
21
|
en: "openNewsFeedCardsInNewTab",
|
|
22
22
|
mh: "requireExplicitInAppMessageDismissal",
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Co: "doNotLoadFontAwesome",
|
|
24
|
+
Lo: "sdkFlavor",
|
|
25
25
|
tn: "openCardsInNewTab",
|
|
26
26
|
};
|
|
@@ -6,27 +6,27 @@ export default class CaptionedImage extends Card {
|
|
|
6
6
|
(this.V = !0),
|
|
7
7
|
(this.test = !1);
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
tt() {
|
|
10
10
|
const t = {};
|
|
11
11
|
return (
|
|
12
|
-
(t[Card.
|
|
13
|
-
(t[Card.
|
|
14
|
-
(t[Card.
|
|
15
|
-
(t[Card.
|
|
16
|
-
(t[Card.
|
|
17
|
-
(t[Card.
|
|
18
|
-
(t[Card.
|
|
19
|
-
(t[Card.
|
|
20
|
-
(t[Card.
|
|
21
|
-
(t[Card.
|
|
22
|
-
(t[Card.
|
|
23
|
-
(t[Card.
|
|
24
|
-
(t[Card.
|
|
25
|
-
(t[Card.
|
|
26
|
-
(t[Card.
|
|
27
|
-
(t[Card.
|
|
28
|
-
(t[Card.
|
|
29
|
-
(t[Card.
|
|
12
|
+
(t[Card.it.st] = Card.et.ht),
|
|
13
|
+
(t[Card.it.rt] = this.id),
|
|
14
|
+
(t[Card.it.ot] = this.viewed),
|
|
15
|
+
(t[Card.it.ct] = this.title),
|
|
16
|
+
(t[Card.it.nt] = this.imageUrl),
|
|
17
|
+
(t[Card.it.dt] = this.description),
|
|
18
|
+
(t[Card.it.ut] = this.updated),
|
|
19
|
+
(t[Card.it.lt] = this.created),
|
|
20
|
+
(t[Card.it.ft] = this.categories),
|
|
21
|
+
(t[Card.it.xt] = this.expiresAt),
|
|
22
|
+
(t[Card.it.URL] = this.url),
|
|
23
|
+
(t[Card.it.bt] = this.linkText),
|
|
24
|
+
(t[Card.it.gt] = this.aspectRatio),
|
|
25
|
+
(t[Card.it.jt] = this.extras),
|
|
26
|
+
(t[Card.it.zt] = this.pinned),
|
|
27
|
+
(t[Card.it.kt] = this.dismissible),
|
|
28
|
+
(t[Card.it.qt] = this.clicked),
|
|
29
|
+
(t[Card.it.vt] = this.test),
|
|
30
30
|
t
|
|
31
31
|
);
|
|
32
32
|
}
|
package/src/Card/models/card.js
CHANGED
|
@@ -4,30 +4,31 @@ import {
|
|
|
4
4
|
} from "../../util/date-utils.js";
|
|
5
5
|
import { FEED_ANIMATION_DURATION as u } from "../../common/constants.js";
|
|
6
6
|
import E from "../../managers/subscription-manager.js";
|
|
7
|
+
import r from "../../../shared-lib/braze-shared-lib.js";
|
|
7
8
|
export default class Card {
|
|
8
|
-
constructor(t, i, s, h,
|
|
9
|
+
constructor(t, i, s, h, l, n, e, r, u, E, o, T, a, I, N, c) {
|
|
9
10
|
(this.id = t),
|
|
10
11
|
(this.viewed = i),
|
|
11
12
|
(this.title = s),
|
|
12
13
|
(this.imageUrl = h),
|
|
13
|
-
(this.description =
|
|
14
|
-
(this.created =
|
|
14
|
+
(this.description = l),
|
|
15
|
+
(this.created = n),
|
|
15
16
|
(this.updated = e),
|
|
16
17
|
(this.categories = r),
|
|
17
18
|
(this.expiresAt = u),
|
|
18
19
|
(this.url = E),
|
|
19
20
|
(this.linkText = o),
|
|
20
21
|
(this.aspectRatio = T),
|
|
21
|
-
(this.extras =
|
|
22
|
-
(this.pinned =
|
|
22
|
+
(this.extras = a),
|
|
23
|
+
(this.pinned = I),
|
|
23
24
|
(this.dismissible = N),
|
|
24
25
|
(this.clicked = c),
|
|
25
26
|
(this.id = t),
|
|
26
27
|
(this.viewed = i || !1),
|
|
27
28
|
(this.title = s || ""),
|
|
28
29
|
(this.imageUrl = h),
|
|
29
|
-
(this.description =
|
|
30
|
-
(this.created =
|
|
30
|
+
(this.description = l || ""),
|
|
31
|
+
(this.created = n || null),
|
|
31
32
|
(this.updated = e || null),
|
|
32
33
|
(this.categories = r || []),
|
|
33
34
|
(this.expiresAt = u || null),
|
|
@@ -37,27 +38,27 @@ export default class Card {
|
|
|
37
38
|
? (this.aspectRatio = null)
|
|
38
39
|
: ((T = parseFloat(T.toString())),
|
|
39
40
|
(this.aspectRatio = isNaN(T) ? null : T)),
|
|
40
|
-
(this.extras =
|
|
41
|
-
(this.pinned =
|
|
41
|
+
(this.extras = a || {}),
|
|
42
|
+
(this.pinned = I || !1),
|
|
42
43
|
(this.dismissible = N || !1),
|
|
43
44
|
(this.dismissed = !1),
|
|
44
45
|
(this.clicked = c || !1),
|
|
45
46
|
(this.isControl = !1),
|
|
46
47
|
(this.test = !1),
|
|
47
|
-
(this.
|
|
48
|
-
(this.
|
|
48
|
+
(this.Et = null),
|
|
49
|
+
(this.Tt = null);
|
|
49
50
|
}
|
|
50
51
|
subscribeToClickedEvent(t) {
|
|
51
|
-
return this.
|
|
52
|
+
return this.Nt().It(t);
|
|
52
53
|
}
|
|
53
54
|
subscribeToDismissedEvent(t) {
|
|
54
|
-
return this.
|
|
55
|
+
return this.St().It(t);
|
|
55
56
|
}
|
|
56
57
|
removeSubscription(t) {
|
|
57
|
-
this.
|
|
58
|
+
this.Nt().removeSubscription(t), this.St().removeSubscription(t);
|
|
58
59
|
}
|
|
59
60
|
removeAllSubscriptions() {
|
|
60
|
-
this.
|
|
61
|
+
this.Nt().removeAllSubscriptions(), this.St().removeAllSubscriptions();
|
|
61
62
|
}
|
|
62
63
|
dismissCard() {
|
|
63
64
|
if (!this.dismissible || this.dismissed) return;
|
|
@@ -74,123 +75,123 @@ export default class Card {
|
|
|
74
75
|
(t.style.margin = "0"),
|
|
75
76
|
setTimeout(function () {
|
|
76
77
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
77
|
-
}, Card.
|
|
78
|
+
}, Card.At));
|
|
78
79
|
}, u));
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
-
return null == this.
|
|
81
|
+
Nt() {
|
|
82
|
+
return null == this.Et && (this.Et = new E()), this.Et;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
return null == this.
|
|
84
|
+
St() {
|
|
85
|
+
return null == this.Tt && (this.Tt = new E()), this.Tt;
|
|
85
86
|
}
|
|
86
87
|
M() {
|
|
87
88
|
this.viewed = !0;
|
|
88
89
|
}
|
|
89
90
|
p() {
|
|
90
|
-
(this.viewed = !0), (this.clicked = !0), this.
|
|
91
|
+
(this.viewed = !0), (this.clicked = !0), this.Nt().Dt();
|
|
91
92
|
}
|
|
92
93
|
F() {
|
|
93
94
|
return (
|
|
94
95
|
!(!this.dismissible || this.dismissed) &&
|
|
95
|
-
((this.dismissed = !0), this.
|
|
96
|
+
((this.dismissed = !0), this.St().Dt(), !0)
|
|
96
97
|
);
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
-
if (null == t || t[Card.
|
|
100
|
-
if (t[Card.
|
|
99
|
+
Ct(t) {
|
|
100
|
+
if (null == t || t[Card.Rt.rt] !== this.id) return !0;
|
|
101
|
+
if (t[Card.Rt.Lt]) return !1;
|
|
101
102
|
if (
|
|
102
|
-
null != t[Card.
|
|
103
|
+
null != t[Card.Rt.ut] &&
|
|
103
104
|
null != this.updated &&
|
|
104
|
-
parseInt(t[Card.
|
|
105
|
+
parseInt(t[Card.Rt.ut]) < h(this.updated.valueOf())
|
|
105
106
|
)
|
|
106
107
|
return !0;
|
|
107
108
|
if (
|
|
108
|
-
(t[Card.
|
|
109
|
-
t[Card.
|
|
110
|
-
null != t[Card.
|
|
111
|
-
null != t[Card.
|
|
112
|
-
null != t[Card.
|
|
113
|
-
null != t[Card.
|
|
109
|
+
(t[Card.Rt.ot] && !this.viewed && (this.viewed = !0),
|
|
110
|
+
t[Card.Rt.qt] && !this.clicked && (this.clicked = t[Card.Rt.qt]),
|
|
111
|
+
null != t[Card.Rt.ct] && (this.title = t[Card.Rt.ct]),
|
|
112
|
+
null != t[Card.Rt.nt] && (this.imageUrl = t[Card.Rt.nt]),
|
|
113
|
+
null != t[Card.Rt.dt] && (this.description = t[Card.Rt.dt]),
|
|
114
|
+
null != t[Card.Rt.ut])
|
|
114
115
|
) {
|
|
115
|
-
const i = l(t[Card.
|
|
116
|
+
const i = l(t[Card.Rt.ut]);
|
|
116
117
|
null != i && (this.updated = i);
|
|
117
118
|
}
|
|
118
|
-
if (null != t[Card.
|
|
119
|
+
if (null != t[Card.Rt.xt]) {
|
|
119
120
|
let i;
|
|
120
|
-
(i = t[Card.
|
|
121
|
+
(i = t[Card.Rt.xt] === Card._t ? null : l(t[Card.Rt.xt])),
|
|
121
122
|
(this.expiresAt = i);
|
|
122
123
|
}
|
|
123
124
|
if (
|
|
124
|
-
(null != t[Card.
|
|
125
|
-
null != t[Card.
|
|
126
|
-
null != t[Card.
|
|
125
|
+
(null != t[Card.Rt.URL] && (this.url = t[Card.Rt.URL]),
|
|
126
|
+
null != t[Card.Rt.bt] && (this.linkText = t[Card.Rt.bt]),
|
|
127
|
+
null != t[Card.Rt.gt])
|
|
127
128
|
) {
|
|
128
|
-
const i = parseFloat(t[Card.
|
|
129
|
+
const i = parseFloat(t[Card.Rt.gt].toString());
|
|
129
130
|
this.aspectRatio = isNaN(i) ? null : i;
|
|
130
131
|
}
|
|
131
132
|
return (
|
|
132
|
-
null != t[Card.
|
|
133
|
-
null != t[Card.
|
|
134
|
-
null != t[Card.
|
|
135
|
-
null != t[Card.
|
|
133
|
+
null != t[Card.Rt.jt] && (this.extras = t[Card.Rt.jt]),
|
|
134
|
+
null != t[Card.Rt.zt] && (this.pinned = t[Card.Rt.zt]),
|
|
135
|
+
null != t[Card.Rt.kt] && (this.dismissible = t[Card.Rt.kt]),
|
|
136
|
+
null != t[Card.Rt.vt] && (this.test = t[Card.Rt.vt]),
|
|
136
137
|
!0
|
|
137
138
|
);
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
tt() {
|
|
141
|
+
r.j.error("Must be implemented in a subclass");
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
|
-
(Card.
|
|
144
|
-
(Card.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
144
|
+
(Card._t = -1),
|
|
145
|
+
(Card.Rt = {
|
|
146
|
+
rt: "id",
|
|
147
|
+
ot: "v",
|
|
148
|
+
kt: "db",
|
|
149
|
+
Lt: "r",
|
|
150
|
+
ut: "ca",
|
|
151
|
+
zt: "p",
|
|
152
|
+
xt: "ea",
|
|
153
|
+
jt: "e",
|
|
154
|
+
st: "tp",
|
|
155
|
+
nt: "i",
|
|
156
|
+
ct: "tt",
|
|
157
|
+
dt: "ds",
|
|
157
158
|
URL: "u",
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
bt: "dm",
|
|
160
|
+
gt: "ar",
|
|
161
|
+
qt: "cl",
|
|
162
|
+
vt: "t",
|
|
162
163
|
}),
|
|
163
|
-
(Card.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
(Card.et = {
|
|
165
|
+
ht: "captioned_image",
|
|
166
|
+
Ot: "text_announcement",
|
|
167
|
+
Mt: "short_news",
|
|
168
|
+
Pt: "banner_image",
|
|
169
|
+
Ut: "control",
|
|
169
170
|
}),
|
|
170
|
-
(Card.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
(Card.it = {
|
|
172
|
+
rt: "id",
|
|
173
|
+
ot: "v",
|
|
174
|
+
kt: "db",
|
|
175
|
+
lt: "cr",
|
|
176
|
+
ut: "ca",
|
|
177
|
+
zt: "p",
|
|
178
|
+
ft: "t",
|
|
179
|
+
xt: "ea",
|
|
180
|
+
jt: "e",
|
|
181
|
+
st: "tp",
|
|
182
|
+
nt: "i",
|
|
183
|
+
ct: "tt",
|
|
184
|
+
dt: "ds",
|
|
184
185
|
URL: "u",
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
bt: "dm",
|
|
187
|
+
gt: "ar",
|
|
188
|
+
qt: "cl",
|
|
189
|
+
vt: "s",
|
|
189
190
|
}),
|
|
190
|
-
(Card.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
(Card.Gt = {
|
|
192
|
+
Xt: "ADVERTISING",
|
|
193
|
+
Vt: "ANNOUNCEMENTS",
|
|
194
|
+
Wt: "NEWS",
|
|
195
|
+
Ft: "SOCIAL",
|
|
195
196
|
}),
|
|
196
|
-
(Card.
|
|
197
|
+
(Card.At = 400);
|
|
@@ -5,27 +5,27 @@ export default class ClassicCard extends Card {
|
|
|
5
5
|
(this.U = "ab-classic-card"),
|
|
6
6
|
(this.V = !0);
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
tt() {
|
|
9
9
|
const s = {};
|
|
10
10
|
return (
|
|
11
|
-
(s[Card.
|
|
12
|
-
(s[Card.
|
|
13
|
-
(s[Card.
|
|
14
|
-
(s[Card.
|
|
15
|
-
(s[Card.
|
|
16
|
-
(s[Card.
|
|
17
|
-
(s[Card.
|
|
18
|
-
(s[Card.
|
|
19
|
-
(s[Card.
|
|
20
|
-
(s[Card.
|
|
21
|
-
(s[Card.
|
|
22
|
-
(s[Card.
|
|
23
|
-
(s[Card.
|
|
24
|
-
(s[Card.
|
|
25
|
-
(s[Card.
|
|
26
|
-
(s[Card.
|
|
27
|
-
(s[Card.
|
|
28
|
-
(s[Card.
|
|
11
|
+
(s[Card.it.st] = Card.et.Mt),
|
|
12
|
+
(s[Card.it.rt] = this.id),
|
|
13
|
+
(s[Card.it.ot] = this.viewed),
|
|
14
|
+
(s[Card.it.ct] = this.title),
|
|
15
|
+
(s[Card.it.nt] = this.imageUrl),
|
|
16
|
+
(s[Card.it.dt] = this.description),
|
|
17
|
+
(s[Card.it.ut] = this.updated),
|
|
18
|
+
(s[Card.it.lt] = this.created),
|
|
19
|
+
(s[Card.it.ft] = this.categories),
|
|
20
|
+
(s[Card.it.xt] = this.expiresAt),
|
|
21
|
+
(s[Card.it.URL] = this.url),
|
|
22
|
+
(s[Card.it.bt] = this.linkText),
|
|
23
|
+
(s[Card.it.gt] = this.aspectRatio),
|
|
24
|
+
(s[Card.it.jt] = this.extras),
|
|
25
|
+
(s[Card.it.zt] = this.pinned),
|
|
26
|
+
(s[Card.it.kt] = this.dismissible),
|
|
27
|
+
(s[Card.it.qt] = this.clicked),
|
|
28
|
+
(s[Card.it.vt] = this.test),
|
|
29
29
|
s
|
|
30
30
|
);
|
|
31
31
|
}
|
|
@@ -6,17 +6,17 @@ export default class ControlCard extends Card {
|
|
|
6
6
|
(this.U = "ab-control-card"),
|
|
7
7
|
(this.V = !1);
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
tt() {
|
|
10
10
|
const l = {};
|
|
11
11
|
return (
|
|
12
|
-
(l[Card.
|
|
13
|
-
(l[Card.
|
|
14
|
-
(l[Card.
|
|
15
|
-
(l[Card.
|
|
16
|
-
(l[Card.
|
|
17
|
-
(l[Card.
|
|
18
|
-
(l[Card.
|
|
19
|
-
(l[Card.
|
|
12
|
+
(l[Card.it.st] = Card.et.Ut),
|
|
13
|
+
(l[Card.it.rt] = this.id),
|
|
14
|
+
(l[Card.it.ot] = this.viewed),
|
|
15
|
+
(l[Card.it.ut] = this.updated),
|
|
16
|
+
(l[Card.it.xt] = this.expiresAt),
|
|
17
|
+
(l[Card.it.jt] = this.extras),
|
|
18
|
+
(l[Card.it.zt] = this.pinned),
|
|
19
|
+
(l[Card.it.vt] = this.test),
|
|
20
20
|
l
|
|
21
21
|
);
|
|
22
22
|
}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import Card from "./card.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
(this.U = "ab-banner ab-image-only"),
|
|
2
|
+
export default class ImageOnly extends Card {
|
|
3
|
+
constructor(s, t, i, h, r, e, l, n, o, a, u, c, d, m) {
|
|
4
|
+
super(s, t, null, i, null, h, r, e, l, n, o, a, u, c, d, m),
|
|
5
|
+
(this.U = "ab-image-only"),
|
|
7
6
|
(this.V = !1),
|
|
8
7
|
(this.test = !1);
|
|
9
8
|
}
|
|
10
|
-
|
|
9
|
+
tt() {
|
|
11
10
|
const s = {};
|
|
12
11
|
return (
|
|
13
|
-
(s[Card.
|
|
14
|
-
(s[Card.
|
|
15
|
-
(s[Card.
|
|
16
|
-
(s[Card.
|
|
17
|
-
(s[Card.
|
|
18
|
-
(s[Card.
|
|
19
|
-
(s[Card.
|
|
20
|
-
(s[Card.
|
|
21
|
-
(s[Card.
|
|
22
|
-
(s[Card.
|
|
23
|
-
(s[Card.
|
|
24
|
-
(s[Card.
|
|
25
|
-
(s[Card.
|
|
26
|
-
(s[Card.
|
|
27
|
-
(s[Card.
|
|
28
|
-
(s[Card.
|
|
12
|
+
(s[Card.it.st] = Card.et.Pt),
|
|
13
|
+
(s[Card.it.rt] = this.id),
|
|
14
|
+
(s[Card.it.ot] = this.viewed),
|
|
15
|
+
(s[Card.it.nt] = this.imageUrl),
|
|
16
|
+
(s[Card.it.ut] = this.updated),
|
|
17
|
+
(s[Card.it.lt] = this.created),
|
|
18
|
+
(s[Card.it.ft] = this.categories),
|
|
19
|
+
(s[Card.it.xt] = this.expiresAt),
|
|
20
|
+
(s[Card.it.URL] = this.url),
|
|
21
|
+
(s[Card.it.bt] = this.linkText),
|
|
22
|
+
(s[Card.it.gt] = this.aspectRatio),
|
|
23
|
+
(s[Card.it.jt] = this.extras),
|
|
24
|
+
(s[Card.it.zt] = this.pinned),
|
|
25
|
+
(s[Card.it.kt] = this.dismissible),
|
|
26
|
+
(s[Card.it.qt] = this.clicked),
|
|
27
|
+
(s[Card.it.vt] = this.test),
|
|
29
28
|
s
|
|
30
29
|
);
|
|
31
30
|
}
|
package/src/Card/models/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as Card } from "./card.js";
|
|
2
|
-
export { default as Banner } from "./banner.js";
|
|
3
2
|
export { default as ImageOnly } from "./image-only.js";
|
|
4
3
|
export { default as CaptionedImage } from "./captioned-image.js";
|
|
5
4
|
export { default as ClassicCard } from "./classic-card.js";
|