summaryrefslogtreecommitdiff
path: root/node_modules/@jet-app/app-store/tmp/src/api/models/today-page.js
blob: 58017fac88a0623416d95de79dc7ff30f3fdb863 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
import * as base from "./base";
import * as metrics from "./metrics/metrics";
export var AdPlacementBehavior;
(function (AdPlacementBehavior) {
    AdPlacementBehavior["insertIntoShelf"] = "insertIntoShelf";
    AdPlacementBehavior["replaceOrganic"] = "replaceOrganic";
    AdPlacementBehavior["dropAd"] = "dropAd";
})(AdPlacementBehavior || (AdPlacementBehavior = {}));
/** @public */
export class TodayCardMedia extends base.ViewModel {
    constructor(kind) {
        super();
        this.kind = kind;
    }
    /**
     * @returns The best background color for the media. This is used to
     * determine the color the section background gradients. If undefined, the
     * default section background color will be used.
     */
    bestBackgroundColor() {
        return undefined;
    }
}
/** @public */
export class TodayCardMediaWithArtwork extends TodayCardMedia {
    constructor(kind, artworks, videos, artworkLayoutsWithMetrics) {
        super(kind);
        this.artworks = artworks;
        this.videos = videos;
        this.artworkLayoutsWithMetrics = artworkLayoutsWithMetrics;
    }
    bestBackgroundColor() {
        var _a, _b, _c;
        return (_b = (_a = this.videos[0]) === null || _a === void 0 ? void 0 : _a.preview.backgroundColor) !== null && _b !== void 0 ? _b : (_c = this.artworks[0]) === null || _c === void 0 ? void 0 : _c.backgroundColor;
    }
}
/** @public */
export class TodayCardMediaHero extends TodayCardMediaWithArtwork {
    constructor(artworks, videos) {
        super("hero", artworks, videos, []);
    }
    isValid() {
        const isArtworkValid = this.artworks.every((artwork) => artwork.isValid()) && this.artworks.length > 0;
        const isVideoValid = this.videos.every((video) => video.isValid()) && this.videos.length > 0;
        return (isArtworkValid || isVideoValid) && super.isValid();
    }
}
/** @public */
export class TodayCardMediaArtwork extends TodayCardMediaWithArtwork {
    constructor(artworks, videos, artworkLayoutsWithMetrics, titleBackingGradient) {
        super("artwork", artworks, videos, artworkLayoutsWithMetrics);
        this.titleBackingGradient = titleBackingGradient;
    }
}
/** @public */
export class TodayCardMediaAppIcon extends TodayCardMedia {
    constructor(icon) {
        super("appIcon");
        this.icon = icon;
    }
    bestBackgroundColor() {
        return this.icon.backgroundColor;
    }
}
/** @public */
export class TodayCardMediaBrandedSingleApp extends TodayCardMediaWithArtwork {
    constructor(icon, artworks, videos, artworkLayoutsWithMetrics, titleBackingGradient) {
        super("brandedSingleApp", artworks, videos, artworkLayoutsWithMetrics);
        this.icon = icon;
        this.titleBackingGradient = titleBackingGradient;
    }
    bestBackgroundColor() {
        var _a;
        return (_a = super.bestBackgroundColor()) !== null && _a !== void 0 ? _a : this.icon.backgroundColor;
    }
}
/** @public */
export class TodayCardMediaList extends TodayCardMediaWithArtwork {
    constructor(lockups, artworks, videos, artworkLayoutsWithMetrics, marketingText, isMediaDark) {
        super("list", artworks, videos, artworkLayoutsWithMetrics);
        this.lockups = lockups;
        this.marketingText = marketingText;
        this.isMediaDark = isMediaDark;
    }
}
/** @public */
export class TodayCardMediaMultiApp extends TodayCardMedia {
    constructor(lockups, additionalText) {
        super("multiApp");
        this.lockups = lockups;
        this.additionalText = additionalText;
    }
}
/** @public */
export class TodayCardInAppPurchase extends TodayCardMedia {
    constructor(lockup) {
        super("inAppPurchase");
        this.lockup = lockup;
    }
    bestBackgroundColor() {
        return this.lockup.icon.backgroundColor;
    }
}
/** @public */
export class TodayCardMediaRiver extends TodayCardMedia {
    constructor(lockups) {
        super("river");
        this.lockups = lockups;
        this.lockupImpressionLimit = 10;
    }
}
/** @public */
export class TodayCardMediaGrid extends TodayCardMedia {
    constructor(lockups, artworkGridType) {
        super("grid");
        this.lockups = lockups;
        this.artworkGridType = artworkGridType;
        this.lockupImpressionLimit = 3;
    }
}
/** @public */
export class TodayCardMediaVideo extends TodayCardMediaWithArtwork {
    constructor(videos, artworkLayoutsWithMetrics, description) {
        super("video", [], videos, artworkLayoutsWithMetrics);
        this.description = description;
    }
}
/** @public */
export class TodayCardMediaAppEvent extends TodayCardMediaWithArtwork {
    constructor(formattedDates, startDate, tintColor, artworks, videos, artworkLayoutsWithMetrics, blurStyle) {
        super("appEvent", artworks, videos, artworkLayoutsWithMetrics);
        this.formattedDates = formattedDates;
        this.startDate = startDate;
        this.tintColor = tintColor;
        this.blurStyle = blurStyle;
    }
}
/** @public */
export class TodayCardMediaMediumLockupWithAlignedRegion extends TodayCardMedia {
    constructor(mediumAdLockupWithAlignedRegionBackground) {
        super("mediumLockupWithAlignedRegion");
        this.mediumAdLockupWithAlignedRegionBackground = mediumAdLockupWithAlignedRegionBackground;
    }
}
/** @public */
export class TodayCardMediaMediumLockupWithScreenshots extends TodayCardMedia {
    constructor(mediumAdLockupWithScreenshotsBackground) {
        super("mediumLockupWithScreenshots");
        this.mediumAdLockupWithScreenshotsBackground = mediumAdLockupWithScreenshotsBackground;
    }
}
/**
 * @public
 * Media for a today card with a single lockup.
 */ export class TodayCardMediaSingleLockup extends TodayCardMedia {
    constructor(condensedAdLockupWithIconBackground) {
        super("singleLockup");
        this.condensedAdLockupWithIconBackground = condensedAdLockupWithIconBackground;
    }
    /**
     * @returns The best background color for the media. This is used to
     * determine the color the section background gradients. If undefined, the
     * default section background color will be used.
     */
    bestBackgroundColor() {
        var _a;
        return (_a = this.condensedAdLockupWithIconBackground) === null || _a === void 0 ? void 0 : _a.backgroundArtwork.backgroundColor;
    }
}
/** @public */
export class TodayCardOverlay extends base.Model {
    constructor(kind) {
        super();
        this.kind = kind;
    }
}
/** @public */
export class TodayCardLockupOverlay extends TodayCardOverlay {
    constructor(lockup) {
        super("lockup");
        this.lockup = lockup;
        this.displaysIcon = true;
    }
}
/**
 * @public
 * Variant of `TodayCardLockupOverlay` with additional functionality,
 * like optionally showing a transient `TodayCardParagraphOverlay` style overlay
 */
export class TodayCardMarketingLockupOverlay extends TodayCardOverlay {
    constructor(lockup, paragraph, hideBackground, artworkBackgroundColor) {
        super("marketingLockup");
        this.lockup = lockup;
        this.paragraph = paragraph;
        this.hideBackground = hideBackground;
        this.artworkBackgroundColor = artworkBackgroundColor;
    }
}
/** @public */
export class TodayCardLockupListOverlay extends TodayCardOverlay {
    constructor(lockups) {
        super("lockupList");
        this.lockups = lockups;
    }
}
/** @public */
export class TodayCardParagraphOverlay extends TodayCardOverlay {
    constructor(paragraph, style) {
        super("paragraph");
        this.paragraph = paragraph;
        this.style = style;
    }
}
/** @public */
export class TodayCardActionOverlay extends TodayCardOverlay {
    constructor(action) {
        super("action");
        this.action = action;
    }
}
/** @public */
export class TodayCardThreeLineOverlay extends TodayCardOverlay {
    constructor(heading, title, description) {
        super("threeLine");
        this.heading = heading;
        this.title = title;
        this.description = description;
    }
}
/**
 * @public
 * Overlay for Acquisition Editorial Items that promote the Arcade Service.
 */
export class TodayCardArcadeLockupOverlay extends TodayCardOverlay {
    constructor(arcadeLockup) {
        super("arcadeLockup");
        this.arcadeLockup = arcadeLockup;
    }
}
/**
 * @public
 * Overlay for App Event lockups.
 */
export class TodayCardAppEventLockupOverlay extends TodayCardOverlay {
    constructor(lockup) {
        super("appEventLockup");
        this.lockup = lockup;
    }
}
// endregion
// region Cards
/** @public */
export class TodayCard extends base.ViewModel {
    constructor() {
        super();
        this.heading = undefined;
        this.title = undefined;
        this.shortTitle = undefined;
        this.titleArtwork = undefined;
        this.media = undefined;
        this.heroMedia = undefined;
        this.overlay = undefined;
        this.style = undefined;
        this.clickAction = undefined;
        this.backgroundColor = undefined;
        this.inlineDescription = undefined;
        this.collapsedHeading = undefined;
        this.editorialDisplayOptions = undefined;
        this.supportsMediaMirroring = undefined;
    }
}
/** @public */
export class InlineTodayCards extends base.ViewModel {
    constructor(cards) {
        super();
        this.cards = cards;
    }
}
// endregion
/** @public */
export class TodayPage extends base.Model {
    constructor(shelfModels, onboardingCardIds, title, tabTitle, titleDetail, shortTitleDetail) {
        super();
        this.shelves = shelfModels;
        this.title = title;
        this.titleDetail = titleDetail;
        this.shortTitleDetail = shortTitleDetail;
        this.tabTitle = tabTitle;
        this.nextPage = null;
        if (onboardingCardIds) {
            this.onboardingCardIds = onboardingCardIds;
        }
        else {
            this.onboardingCardIds = [];
        }
        this.pageMetrics = new metrics.PageMetrics();
        this.pageRenderMetrics = {};
    }
}
//# sourceMappingURL=today-page.js.map