@inappstory/slide-api 0.1.8 → 0.1.10
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/dist/index.cjs +417 -337
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +103 -85
- package/dist/index.d.ts +103 -85
- package/dist/index.js +417 -337
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1074,12 +1074,6 @@ class EsModuleSdkApi {
|
|
|
1074
1074
|
get isWeb() {
|
|
1075
1075
|
return true;
|
|
1076
1076
|
}
|
|
1077
|
-
pauseUI() {
|
|
1078
|
-
this.sdkBinding.pauseUI();
|
|
1079
|
-
}
|
|
1080
|
-
resumeUI() {
|
|
1081
|
-
this.sdkBinding.resumeUI();
|
|
1082
|
-
}
|
|
1083
1077
|
get isExistsShowCardTextInput() {
|
|
1084
1078
|
return true;
|
|
1085
1079
|
}
|
|
@@ -1183,17 +1177,17 @@ class DataInput {
|
|
|
1183
1177
|
_elementNodeRef;
|
|
1184
1178
|
_layer;
|
|
1185
1179
|
_widgetApi;
|
|
1186
|
-
|
|
1180
|
+
_widgetCallbacks;
|
|
1187
1181
|
sdkApi;
|
|
1188
1182
|
static _className = "narrative-element-data-input";
|
|
1189
1183
|
static className() {
|
|
1190
1184
|
return DataInput._className;
|
|
1191
1185
|
}
|
|
1192
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1186
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1193
1187
|
this._elementNodeRef = _elementNodeRef;
|
|
1194
1188
|
this._layer = _layer;
|
|
1195
1189
|
this._widgetApi = _widgetApi;
|
|
1196
|
-
this.
|
|
1190
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1197
1191
|
this.sdkApi = sdkApi;
|
|
1198
1192
|
}
|
|
1199
1193
|
static isTypeOf(element) {
|
|
@@ -1202,7 +1196,7 @@ class DataInput {
|
|
|
1202
1196
|
mediaElementsLoadingPromises = [];
|
|
1203
1197
|
init(localData) {
|
|
1204
1198
|
try {
|
|
1205
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1199
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1206
1200
|
}
|
|
1207
1201
|
catch (e) {
|
|
1208
1202
|
console.error(e);
|
|
@@ -1227,30 +1221,30 @@ class DataInput {
|
|
|
1227
1221
|
get isLayerForcePaused() {
|
|
1228
1222
|
return false;
|
|
1229
1223
|
}
|
|
1230
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetDataInput.api`, `
|
|
1224
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetDataInput.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1231
1225
|
}
|
|
1232
1226
|
|
|
1233
1227
|
class Barcode {
|
|
1234
1228
|
_elementNodeRef;
|
|
1235
1229
|
_layer;
|
|
1236
1230
|
_widgetApi;
|
|
1237
|
-
|
|
1231
|
+
_widgetCallbacks;
|
|
1238
1232
|
sdkApi;
|
|
1239
1233
|
static _className = "narrative-element-barcode";
|
|
1240
1234
|
static className() {
|
|
1241
1235
|
return Barcode._className;
|
|
1242
1236
|
}
|
|
1243
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1237
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1244
1238
|
this._elementNodeRef = _elementNodeRef;
|
|
1245
1239
|
this._layer = _layer;
|
|
1246
1240
|
this._widgetApi = _widgetApi;
|
|
1247
|
-
this.
|
|
1241
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1248
1242
|
this.sdkApi = sdkApi;
|
|
1249
1243
|
}
|
|
1250
1244
|
mediaElementsLoadingPromises = [];
|
|
1251
1245
|
init(localData) {
|
|
1252
1246
|
try {
|
|
1253
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1247
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1254
1248
|
}
|
|
1255
1249
|
catch (e) {
|
|
1256
1250
|
console.error(e);
|
|
@@ -1272,7 +1266,7 @@ class Barcode {
|
|
|
1272
1266
|
get isLayerForcePaused() {
|
|
1273
1267
|
return false;
|
|
1274
1268
|
}
|
|
1275
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetBarcode.api`, `
|
|
1269
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetBarcode.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1276
1270
|
}
|
|
1277
1271
|
|
|
1278
1272
|
class ClickableBase {
|
|
@@ -1317,23 +1311,23 @@ class Copy {
|
|
|
1317
1311
|
_elementNodeRef;
|
|
1318
1312
|
_layer;
|
|
1319
1313
|
_widgetApi;
|
|
1320
|
-
|
|
1314
|
+
_widgetCallbacks;
|
|
1321
1315
|
sdkApi;
|
|
1322
1316
|
static _className = "narrative-element-copy";
|
|
1323
1317
|
static className() {
|
|
1324
1318
|
return Copy._className;
|
|
1325
1319
|
}
|
|
1326
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1320
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1327
1321
|
this._elementNodeRef = _elementNodeRef;
|
|
1328
1322
|
this._layer = _layer;
|
|
1329
1323
|
this._widgetApi = _widgetApi;
|
|
1330
|
-
this.
|
|
1324
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1331
1325
|
this.sdkApi = sdkApi;
|
|
1332
1326
|
}
|
|
1333
1327
|
mediaElementsLoadingPromises = [];
|
|
1334
1328
|
init(localData) {
|
|
1335
1329
|
try {
|
|
1336
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1330
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1337
1331
|
}
|
|
1338
1332
|
catch (e) {
|
|
1339
1333
|
console.error(e);
|
|
@@ -1355,7 +1349,7 @@ class Copy {
|
|
|
1355
1349
|
get isLayerForcePaused() {
|
|
1356
1350
|
return false;
|
|
1357
1351
|
}
|
|
1358
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetCopy.api`, `
|
|
1352
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetCopy.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1359
1353
|
}
|
|
1360
1354
|
|
|
1361
1355
|
class DateCountdown {
|
|
@@ -1363,24 +1357,24 @@ class DateCountdown {
|
|
|
1363
1357
|
_layer;
|
|
1364
1358
|
_layersNodesRefs;
|
|
1365
1359
|
_widgetApi;
|
|
1366
|
-
|
|
1360
|
+
_widgetCallbacks;
|
|
1367
1361
|
sdkApi;
|
|
1368
1362
|
static _className = "narrative-element-date-countdown";
|
|
1369
1363
|
static className() {
|
|
1370
1364
|
return DateCountdown._className;
|
|
1371
1365
|
}
|
|
1372
|
-
constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi,
|
|
1366
|
+
constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1373
1367
|
this._elementNodeRef = _elementNodeRef;
|
|
1374
1368
|
this._layer = _layer;
|
|
1375
1369
|
this._layersNodesRefs = _layersNodesRefs;
|
|
1376
1370
|
this._widgetApi = _widgetApi;
|
|
1377
|
-
this.
|
|
1371
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1378
1372
|
this.sdkApi = sdkApi;
|
|
1379
1373
|
}
|
|
1380
1374
|
mediaElementsLoadingPromises = [];
|
|
1381
1375
|
init(localData) {
|
|
1382
1376
|
try {
|
|
1383
|
-
this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this.
|
|
1377
|
+
this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this._widgetCallbacks, this.sdkApi);
|
|
1384
1378
|
}
|
|
1385
1379
|
catch (e) {
|
|
1386
1380
|
console.error(e);
|
|
@@ -1406,24 +1400,24 @@ class DateCountdown {
|
|
|
1406
1400
|
get isLayerForcePaused() {
|
|
1407
1401
|
return false;
|
|
1408
1402
|
}
|
|
1409
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetDateCountdown.api`, `
|
|
1403
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetDateCountdown.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1410
1404
|
}
|
|
1411
1405
|
|
|
1412
1406
|
class Poll {
|
|
1413
1407
|
_elementNodeRef;
|
|
1414
1408
|
_layer;
|
|
1415
1409
|
_widgetApi;
|
|
1416
|
-
|
|
1410
|
+
_widgetCallbacks;
|
|
1417
1411
|
sdkApi;
|
|
1418
1412
|
static _className = "narrative-element-poll";
|
|
1419
1413
|
static className() {
|
|
1420
1414
|
return Poll._className;
|
|
1421
1415
|
}
|
|
1422
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1416
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1423
1417
|
this._elementNodeRef = _elementNodeRef;
|
|
1424
1418
|
this._layer = _layer;
|
|
1425
1419
|
this._widgetApi = _widgetApi;
|
|
1426
|
-
this.
|
|
1420
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1427
1421
|
this.sdkApi = sdkApi;
|
|
1428
1422
|
}
|
|
1429
1423
|
static isTypeOf(element) {
|
|
@@ -1432,7 +1426,7 @@ class Poll {
|
|
|
1432
1426
|
mediaElementsLoadingPromises = [];
|
|
1433
1427
|
init(localData) {
|
|
1434
1428
|
try {
|
|
1435
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1429
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1436
1430
|
}
|
|
1437
1431
|
catch (e) {
|
|
1438
1432
|
console.error(e);
|
|
@@ -1457,7 +1451,7 @@ class Poll {
|
|
|
1457
1451
|
get isLayerForcePaused() {
|
|
1458
1452
|
return false;
|
|
1459
1453
|
}
|
|
1460
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetPoll.api`, `
|
|
1454
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetPoll.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1461
1455
|
}
|
|
1462
1456
|
|
|
1463
1457
|
class PollLayers {
|
|
@@ -1465,18 +1459,18 @@ class PollLayers {
|
|
|
1465
1459
|
_layer;
|
|
1466
1460
|
_layersNodesRefs;
|
|
1467
1461
|
_widgetApi;
|
|
1468
|
-
|
|
1462
|
+
_widgetCallbacks;
|
|
1469
1463
|
sdkApi;
|
|
1470
1464
|
static _className = "narrative-element-poll-layers";
|
|
1471
1465
|
static className() {
|
|
1472
1466
|
return PollLayers._className;
|
|
1473
1467
|
}
|
|
1474
|
-
constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi,
|
|
1468
|
+
constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1475
1469
|
this._elementNodeRef = _elementNodeRef;
|
|
1476
1470
|
this._layer = _layer;
|
|
1477
1471
|
this._layersNodesRefs = _layersNodesRefs;
|
|
1478
1472
|
this._widgetApi = _widgetApi;
|
|
1479
|
-
this.
|
|
1473
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1480
1474
|
this.sdkApi = sdkApi;
|
|
1481
1475
|
}
|
|
1482
1476
|
static isTypeOf(element) {
|
|
@@ -1485,7 +1479,7 @@ class PollLayers {
|
|
|
1485
1479
|
mediaElementsLoadingPromises = [];
|
|
1486
1480
|
init(localData) {
|
|
1487
1481
|
try {
|
|
1488
|
-
this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this.
|
|
1482
|
+
this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this._widgetCallbacks, this.sdkApi);
|
|
1489
1483
|
}
|
|
1490
1484
|
catch (e) {
|
|
1491
1485
|
console.error(e);
|
|
@@ -1507,24 +1501,24 @@ class PollLayers {
|
|
|
1507
1501
|
get isLayerForcePaused() {
|
|
1508
1502
|
return false;
|
|
1509
1503
|
}
|
|
1510
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetPollLayers.api`, `
|
|
1504
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetPollLayers.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1511
1505
|
}
|
|
1512
1506
|
|
|
1513
1507
|
class Products {
|
|
1514
1508
|
_elementNodeRef;
|
|
1515
1509
|
_layer;
|
|
1516
1510
|
_widgetApi;
|
|
1517
|
-
|
|
1511
|
+
_widgetCallbacks;
|
|
1518
1512
|
sdkApi;
|
|
1519
1513
|
static _className = "narrative-element-products";
|
|
1520
1514
|
static className() {
|
|
1521
1515
|
return Products._className;
|
|
1522
1516
|
}
|
|
1523
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1517
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1524
1518
|
this._elementNodeRef = _elementNodeRef;
|
|
1525
1519
|
this._layer = _layer;
|
|
1526
1520
|
this._widgetApi = _widgetApi;
|
|
1527
|
-
this.
|
|
1521
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1528
1522
|
this.sdkApi = sdkApi;
|
|
1529
1523
|
}
|
|
1530
1524
|
static isTypeOf(element) {
|
|
@@ -1533,7 +1527,7 @@ class Products {
|
|
|
1533
1527
|
mediaElementsLoadingPromises = [];
|
|
1534
1528
|
init(localData) {
|
|
1535
1529
|
try {
|
|
1536
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1530
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1537
1531
|
}
|
|
1538
1532
|
catch (e) {
|
|
1539
1533
|
console.error(e);
|
|
@@ -1564,24 +1558,24 @@ class Products {
|
|
|
1564
1558
|
get isLayerForcePaused() {
|
|
1565
1559
|
return this._widgetApi.isForcePaused(this._elementNodeRef);
|
|
1566
1560
|
}
|
|
1567
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetProducts.api`, `
|
|
1561
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetProducts.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1568
1562
|
}
|
|
1569
1563
|
|
|
1570
1564
|
class Quest {
|
|
1571
1565
|
_elementNodeRef;
|
|
1572
1566
|
_layer;
|
|
1573
1567
|
_widgetApi;
|
|
1574
|
-
|
|
1568
|
+
_widgetCallbacks;
|
|
1575
1569
|
sdkApi;
|
|
1576
1570
|
static _className = "narrative-element-quest";
|
|
1577
1571
|
static className() {
|
|
1578
1572
|
return Quest._className;
|
|
1579
1573
|
}
|
|
1580
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1574
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1581
1575
|
this._elementNodeRef = _elementNodeRef;
|
|
1582
1576
|
this._layer = _layer;
|
|
1583
1577
|
this._widgetApi = _widgetApi;
|
|
1584
|
-
this.
|
|
1578
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1585
1579
|
this.sdkApi = sdkApi;
|
|
1586
1580
|
}
|
|
1587
1581
|
static isTypeOf(element) {
|
|
@@ -1589,7 +1583,7 @@ class Quest {
|
|
|
1589
1583
|
}
|
|
1590
1584
|
mediaElementsLoadingPromises = [];
|
|
1591
1585
|
init(localData) {
|
|
1592
|
-
return this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1586
|
+
return this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1593
1587
|
}
|
|
1594
1588
|
onPause() { }
|
|
1595
1589
|
onResume() { }
|
|
@@ -1609,25 +1603,25 @@ class Quest {
|
|
|
1609
1603
|
get isLayerForcePaused() {
|
|
1610
1604
|
return false;
|
|
1611
1605
|
}
|
|
1612
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuest.api`, `
|
|
1606
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuest.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1613
1607
|
}
|
|
1614
1608
|
|
|
1615
1609
|
class Quiz {
|
|
1616
1610
|
_elementNodeRef;
|
|
1617
1611
|
_layer;
|
|
1618
1612
|
_widgetApi;
|
|
1619
|
-
|
|
1613
|
+
_widgetCallbacks;
|
|
1620
1614
|
sdkApi;
|
|
1621
1615
|
static _className = "narrative-element-quiz";
|
|
1622
1616
|
static className() {
|
|
1623
1617
|
return Quiz._className;
|
|
1624
1618
|
}
|
|
1625
1619
|
// widgetApi in ctor
|
|
1626
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1620
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1627
1621
|
this._elementNodeRef = _elementNodeRef;
|
|
1628
1622
|
this._layer = _layer;
|
|
1629
1623
|
this._widgetApi = _widgetApi;
|
|
1630
|
-
this.
|
|
1624
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1631
1625
|
this.sdkApi = sdkApi;
|
|
1632
1626
|
}
|
|
1633
1627
|
static isTypeOf(element) {
|
|
@@ -1636,7 +1630,7 @@ class Quiz {
|
|
|
1636
1630
|
mediaElementsLoadingPromises = [];
|
|
1637
1631
|
init(localData) {
|
|
1638
1632
|
try {
|
|
1639
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1633
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1640
1634
|
}
|
|
1641
1635
|
catch (e) {
|
|
1642
1636
|
console.error(e);
|
|
@@ -1661,24 +1655,24 @@ class Quiz {
|
|
|
1661
1655
|
get isLayerForcePaused() {
|
|
1662
1656
|
return false;
|
|
1663
1657
|
}
|
|
1664
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuiz.api`, `
|
|
1658
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuiz.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1665
1659
|
}
|
|
1666
1660
|
|
|
1667
1661
|
class QuizGrouped {
|
|
1668
1662
|
_elementNodeRef;
|
|
1669
1663
|
_layer;
|
|
1670
1664
|
_widgetApi;
|
|
1671
|
-
|
|
1665
|
+
_widgetCallbacks;
|
|
1672
1666
|
sdkApi;
|
|
1673
1667
|
static _className = "narrative-element-quiz-grouped";
|
|
1674
1668
|
static className() {
|
|
1675
1669
|
return QuizGrouped._className;
|
|
1676
1670
|
}
|
|
1677
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1671
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1678
1672
|
this._elementNodeRef = _elementNodeRef;
|
|
1679
1673
|
this._layer = _layer;
|
|
1680
1674
|
this._widgetApi = _widgetApi;
|
|
1681
|
-
this.
|
|
1675
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1682
1676
|
this.sdkApi = sdkApi;
|
|
1683
1677
|
}
|
|
1684
1678
|
static isTypeOf(element) {
|
|
@@ -1687,7 +1681,7 @@ class QuizGrouped {
|
|
|
1687
1681
|
mediaElementsLoadingPromises = [];
|
|
1688
1682
|
init(localData) {
|
|
1689
1683
|
try {
|
|
1690
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1684
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1691
1685
|
}
|
|
1692
1686
|
catch (e) {
|
|
1693
1687
|
console.error(e);
|
|
@@ -1712,24 +1706,24 @@ class QuizGrouped {
|
|
|
1712
1706
|
get isLayerForcePaused() {
|
|
1713
1707
|
return false;
|
|
1714
1708
|
}
|
|
1715
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuizGrouped.api`, `
|
|
1709
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuizGrouped.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1716
1710
|
}
|
|
1717
1711
|
|
|
1718
1712
|
class RangeSlider {
|
|
1719
1713
|
_elementNodeRef;
|
|
1720
1714
|
_layer;
|
|
1721
1715
|
_widgetApi;
|
|
1722
|
-
|
|
1716
|
+
_widgetCallbacks;
|
|
1723
1717
|
sdkApi;
|
|
1724
1718
|
static _className = "narrative-element-range-slider";
|
|
1725
1719
|
static className() {
|
|
1726
1720
|
return RangeSlider._className;
|
|
1727
1721
|
}
|
|
1728
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1722
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1729
1723
|
this._elementNodeRef = _elementNodeRef;
|
|
1730
1724
|
this._layer = _layer;
|
|
1731
1725
|
this._widgetApi = _widgetApi;
|
|
1732
|
-
this.
|
|
1726
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1733
1727
|
this.sdkApi = sdkApi;
|
|
1734
1728
|
}
|
|
1735
1729
|
static isTypeOf(element) {
|
|
@@ -1738,7 +1732,7 @@ class RangeSlider {
|
|
|
1738
1732
|
mediaElementsLoadingPromises = [];
|
|
1739
1733
|
init(localData) {
|
|
1740
1734
|
try {
|
|
1741
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1735
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1742
1736
|
}
|
|
1743
1737
|
catch (e) {
|
|
1744
1738
|
console.error(e);
|
|
@@ -1763,24 +1757,24 @@ class RangeSlider {
|
|
|
1763
1757
|
get isLayerForcePaused() {
|
|
1764
1758
|
return false;
|
|
1765
1759
|
}
|
|
1766
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetRangeSlider.api`, `
|
|
1760
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetRangeSlider.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1767
1761
|
}
|
|
1768
1762
|
|
|
1769
1763
|
class Rate {
|
|
1770
1764
|
_elementNodeRef;
|
|
1771
1765
|
_layer;
|
|
1772
1766
|
_widgetApi;
|
|
1773
|
-
|
|
1767
|
+
_widgetCallbacks;
|
|
1774
1768
|
sdkApi;
|
|
1775
1769
|
static _className = "narrative-element-rate";
|
|
1776
1770
|
static className() {
|
|
1777
1771
|
return Rate._className;
|
|
1778
1772
|
}
|
|
1779
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1773
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1780
1774
|
this._elementNodeRef = _elementNodeRef;
|
|
1781
1775
|
this._layer = _layer;
|
|
1782
1776
|
this._widgetApi = _widgetApi;
|
|
1783
|
-
this.
|
|
1777
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1784
1778
|
this.sdkApi = sdkApi;
|
|
1785
1779
|
}
|
|
1786
1780
|
static isTypeOf(element) {
|
|
@@ -1789,7 +1783,7 @@ class Rate {
|
|
|
1789
1783
|
mediaElementsLoadingPromises = [];
|
|
1790
1784
|
init(localData) {
|
|
1791
1785
|
try {
|
|
1792
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1786
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1793
1787
|
}
|
|
1794
1788
|
catch (e) {
|
|
1795
1789
|
console.error(e);
|
|
@@ -1814,7 +1808,7 @@ class Rate {
|
|
|
1814
1808
|
get isLayerForcePaused() {
|
|
1815
1809
|
return false;
|
|
1816
1810
|
}
|
|
1817
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetRate.api`, `
|
|
1811
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetRate.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1818
1812
|
}
|
|
1819
1813
|
|
|
1820
1814
|
class Share {
|
|
@@ -1822,19 +1816,19 @@ class Share {
|
|
|
1822
1816
|
_layer;
|
|
1823
1817
|
_layersNodesRefs;
|
|
1824
1818
|
_widgetApi;
|
|
1825
|
-
|
|
1819
|
+
_widgetCallbacks;
|
|
1826
1820
|
sdkApi;
|
|
1827
1821
|
static _className = "narrative-element-share";
|
|
1828
1822
|
static _widgetApiName = "_narrative_share";
|
|
1829
1823
|
static className() {
|
|
1830
1824
|
return Share._className;
|
|
1831
1825
|
}
|
|
1832
|
-
constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi,
|
|
1826
|
+
constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1833
1827
|
this._elementNodeRef = _elementNodeRef;
|
|
1834
1828
|
this._layer = _layer;
|
|
1835
1829
|
this._layersNodesRefs = _layersNodesRefs;
|
|
1836
1830
|
this._widgetApi = _widgetApi;
|
|
1837
|
-
this.
|
|
1831
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1838
1832
|
this.sdkApi = sdkApi;
|
|
1839
1833
|
}
|
|
1840
1834
|
static isTypeOf(element) {
|
|
@@ -1843,7 +1837,7 @@ class Share {
|
|
|
1843
1837
|
mediaElementsLoadingPromises = [];
|
|
1844
1838
|
init(localData) {
|
|
1845
1839
|
try {
|
|
1846
|
-
this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this.
|
|
1840
|
+
this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this._widgetCallbacks, this.sdkApi);
|
|
1847
1841
|
}
|
|
1848
1842
|
catch (e) {
|
|
1849
1843
|
console.error(e);
|
|
@@ -1868,7 +1862,7 @@ class Share {
|
|
|
1868
1862
|
get isLayerForcePaused() {
|
|
1869
1863
|
return false;
|
|
1870
1864
|
}
|
|
1871
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetShare.api`, `
|
|
1865
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetShare.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1872
1866
|
}
|
|
1873
1867
|
|
|
1874
1868
|
class SwipeUpItems {
|
|
@@ -1910,17 +1904,17 @@ class Test {
|
|
|
1910
1904
|
_elementNodeRef;
|
|
1911
1905
|
_layer;
|
|
1912
1906
|
_widgetApi;
|
|
1913
|
-
|
|
1907
|
+
_widgetCallbacks;
|
|
1914
1908
|
sdkApi;
|
|
1915
1909
|
static _className = "narrative-element-test";
|
|
1916
1910
|
static className() {
|
|
1917
1911
|
return Test._className;
|
|
1918
1912
|
}
|
|
1919
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1913
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1920
1914
|
this._elementNodeRef = _elementNodeRef;
|
|
1921
1915
|
this._layer = _layer;
|
|
1922
1916
|
this._widgetApi = _widgetApi;
|
|
1923
|
-
this.
|
|
1917
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1924
1918
|
this.sdkApi = sdkApi;
|
|
1925
1919
|
}
|
|
1926
1920
|
static isTypeOf(element) {
|
|
@@ -1929,7 +1923,7 @@ class Test {
|
|
|
1929
1923
|
mediaElementsLoadingPromises = [];
|
|
1930
1924
|
init(localData) {
|
|
1931
1925
|
try {
|
|
1932
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1926
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1933
1927
|
}
|
|
1934
1928
|
catch (e) {
|
|
1935
1929
|
console.error(e);
|
|
@@ -1957,30 +1951,30 @@ class Test {
|
|
|
1957
1951
|
get isLayerForcePaused() {
|
|
1958
1952
|
return false;
|
|
1959
1953
|
}
|
|
1960
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetTest.api`, `
|
|
1954
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetTest.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
1961
1955
|
}
|
|
1962
1956
|
|
|
1963
1957
|
class Vote {
|
|
1964
1958
|
_elementNodeRef;
|
|
1965
1959
|
_layer;
|
|
1966
1960
|
_widgetApi;
|
|
1967
|
-
|
|
1961
|
+
_widgetCallbacks;
|
|
1968
1962
|
sdkApi;
|
|
1969
1963
|
static _className = "narrative-element-vote";
|
|
1970
1964
|
static className() {
|
|
1971
1965
|
return Vote._className;
|
|
1972
1966
|
}
|
|
1973
|
-
constructor(_elementNodeRef, _layer, _widgetApi,
|
|
1967
|
+
constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
|
|
1974
1968
|
this._elementNodeRef = _elementNodeRef;
|
|
1975
1969
|
this._layer = _layer;
|
|
1976
1970
|
this._widgetApi = _widgetApi;
|
|
1977
|
-
this.
|
|
1971
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
1978
1972
|
this.sdkApi = sdkApi;
|
|
1979
1973
|
}
|
|
1980
1974
|
mediaElementsLoadingPromises = [];
|
|
1981
1975
|
init(localData) {
|
|
1982
1976
|
try {
|
|
1983
|
-
this._widgetApi.init(this._elementNodeRef, localData, this.
|
|
1977
|
+
this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
|
|
1984
1978
|
}
|
|
1985
1979
|
catch (e) {
|
|
1986
1980
|
console.error(e);
|
|
@@ -2002,7 +1996,7 @@ class Vote {
|
|
|
2002
1996
|
get isLayerForcePaused() {
|
|
2003
1997
|
return false;
|
|
2004
1998
|
}
|
|
2005
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetVote.api`, `
|
|
1999
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetVote.api`, `WidgetCallbacks`, `SDKApi`]; }
|
|
2006
2000
|
}
|
|
2007
2001
|
|
|
2008
2002
|
class Text {
|
|
@@ -2280,12 +2274,13 @@ class Video {
|
|
|
2280
2274
|
// clean up memory and cpu processes
|
|
2281
2275
|
// @ts-ignore
|
|
2282
2276
|
// _log("onBeforeUnmount", true)
|
|
2277
|
+
// console.log("onBeforeUnmount")
|
|
2283
2278
|
this._destroyVODPlayer();
|
|
2284
2279
|
}
|
|
2285
2280
|
_initVOD(vodData) {
|
|
2286
2281
|
const onWaiting = () => {
|
|
2287
2282
|
/**
|
|
2288
|
-
* When screen on pause - ignore onWaiting
|
|
2283
|
+
* When screen on pause - ignore onWaiting (or when SlideApi is destroyed)
|
|
2289
2284
|
* (triggered when video paused, not only when canplay = false)
|
|
2290
2285
|
*/
|
|
2291
2286
|
if (this._isScreenOnPause) {
|
|
@@ -2755,7 +2750,7 @@ class VideoStateAdapter {
|
|
|
2755
2750
|
// const
|
|
2756
2751
|
// }
|
|
2757
2752
|
// args nodeRef, elementClassName
|
|
2758
|
-
const tryCreateFromHtmlElement = (nodeRef, layer,
|
|
2753
|
+
const tryCreateFromHtmlElement = (nodeRef, layer, widgetCallbacks, sdkApi) => {
|
|
2759
2754
|
const layoutApi = layer.layoutService.layoutApi;
|
|
2760
2755
|
const layersNodesRefs = layer.slide.layersNodesRefs;
|
|
2761
2756
|
for (let elementClassName of nodeRef.classList.values()) {
|
|
@@ -2776,39 +2771,39 @@ const tryCreateFromHtmlElement = (nodeRef, layer, onWidgetComplete, sdkApi) => {
|
|
|
2776
2771
|
return new Video(nodeRef, layer, layoutApi.VideoPlayer, layer.sdkApi);
|
|
2777
2772
|
//////// widgets ///////
|
|
2778
2773
|
case Copy.className():
|
|
2779
|
-
return layoutApi.widgetCopyApi ? new Copy(nodeRef, layer, layoutApi.widgetCopyApi,
|
|
2774
|
+
return layoutApi.widgetCopyApi ? new Copy(nodeRef, layer, layoutApi.widgetCopyApi, widgetCallbacks, sdkApi) : null;
|
|
2780
2775
|
case Barcode.className():
|
|
2781
|
-
return layoutApi.widgetBarcodeApi ? new Barcode(nodeRef, layer, layoutApi.widgetBarcodeApi,
|
|
2776
|
+
return layoutApi.widgetBarcodeApi ? new Barcode(nodeRef, layer, layoutApi.widgetBarcodeApi, widgetCallbacks, sdkApi) : null;
|
|
2782
2777
|
case DataInput.className():
|
|
2783
|
-
return layoutApi.widgetDataInputApi ? new DataInput(nodeRef, layer, layoutApi.widgetDataInputApi,
|
|
2778
|
+
return layoutApi.widgetDataInputApi ? new DataInput(nodeRef, layer, layoutApi.widgetDataInputApi, widgetCallbacks, sdkApi) : null;
|
|
2784
2779
|
case DateCountdown.className():
|
|
2785
2780
|
return layoutApi.widgetDateCountdownApi
|
|
2786
|
-
? new DateCountdown(nodeRef, layer, layersNodesRefs, layoutApi.widgetDateCountdownApi,
|
|
2781
|
+
? new DateCountdown(nodeRef, layer, layersNodesRefs, layoutApi.widgetDateCountdownApi, widgetCallbacks, sdkApi)
|
|
2787
2782
|
: null;
|
|
2788
2783
|
case Poll.className():
|
|
2789
|
-
return layoutApi.widgetPollApi ? new Poll(nodeRef, layer, layoutApi.widgetPollApi,
|
|
2784
|
+
return layoutApi.widgetPollApi ? new Poll(nodeRef, layer, layoutApi.widgetPollApi, widgetCallbacks, sdkApi) : null;
|
|
2790
2785
|
case PollLayers.className():
|
|
2791
2786
|
return layoutApi.widgetPollLayersApi
|
|
2792
|
-
? new PollLayers(nodeRef, layer, layersNodesRefs, layoutApi.widgetPollLayersApi,
|
|
2787
|
+
? new PollLayers(nodeRef, layer, layersNodesRefs, layoutApi.widgetPollLayersApi, widgetCallbacks, sdkApi)
|
|
2793
2788
|
: null;
|
|
2794
2789
|
case Quest.className():
|
|
2795
|
-
return layoutApi.widgetQuestApi ? new Quest(nodeRef, layer, layoutApi.widgetQuestApi,
|
|
2790
|
+
return layoutApi.widgetQuestApi ? new Quest(nodeRef, layer, layoutApi.widgetQuestApi, widgetCallbacks, sdkApi) : null;
|
|
2796
2791
|
case Quiz.className():
|
|
2797
|
-
return layoutApi.widgetQuizApi ? new Quiz(nodeRef, layer, layoutApi.widgetQuizApi,
|
|
2792
|
+
return layoutApi.widgetQuizApi ? new Quiz(nodeRef, layer, layoutApi.widgetQuizApi, widgetCallbacks, sdkApi) : null;
|
|
2798
2793
|
case QuizGrouped.className():
|
|
2799
|
-
return layoutApi.widgetQuizGroupedApi ? new QuizGrouped(nodeRef, layer, layoutApi.widgetQuizGroupedApi,
|
|
2794
|
+
return layoutApi.widgetQuizGroupedApi ? new QuizGrouped(nodeRef, layer, layoutApi.widgetQuizGroupedApi, widgetCallbacks, sdkApi) : null;
|
|
2800
2795
|
case RangeSlider.className():
|
|
2801
|
-
return layoutApi.widgetRangeSliderApi ? new RangeSlider(nodeRef, layer, layoutApi.widgetRangeSliderApi,
|
|
2796
|
+
return layoutApi.widgetRangeSliderApi ? new RangeSlider(nodeRef, layer, layoutApi.widgetRangeSliderApi, widgetCallbacks, sdkApi) : null;
|
|
2802
2797
|
case Rate.className():
|
|
2803
|
-
return layoutApi.widgetRateApi ? new Rate(nodeRef, layer, layoutApi.widgetRateApi,
|
|
2798
|
+
return layoutApi.widgetRateApi ? new Rate(nodeRef, layer, layoutApi.widgetRateApi, widgetCallbacks, sdkApi) : null;
|
|
2804
2799
|
case Share.className():
|
|
2805
|
-
return layoutApi.widgetShareApi ? new Share(nodeRef, layer, layersNodesRefs, layoutApi.widgetShareApi,
|
|
2800
|
+
return layoutApi.widgetShareApi ? new Share(nodeRef, layer, layersNodesRefs, layoutApi.widgetShareApi, widgetCallbacks, sdkApi) : null;
|
|
2806
2801
|
case Test.className():
|
|
2807
|
-
return layoutApi.widgetTestApi ? new Test(nodeRef, layer, layoutApi.widgetTestApi,
|
|
2802
|
+
return layoutApi.widgetTestApi ? new Test(nodeRef, layer, layoutApi.widgetTestApi, widgetCallbacks, sdkApi) : null;
|
|
2808
2803
|
case Vote.className():
|
|
2809
|
-
return layoutApi.widgetVoteApi ? new Vote(nodeRef, layer, layoutApi.widgetVoteApi,
|
|
2804
|
+
return layoutApi.widgetVoteApi ? new Vote(nodeRef, layer, layoutApi.widgetVoteApi, widgetCallbacks, sdkApi) : null;
|
|
2810
2805
|
case Products.className():
|
|
2811
|
-
return layoutApi.widgetProductsApi ? new Products(nodeRef, layer, layoutApi.widgetProductsApi,
|
|
2806
|
+
return layoutApi.widgetProductsApi ? new Products(nodeRef, layer, layoutApi.widgetProductsApi, widgetCallbacks, sdkApi) : null;
|
|
2812
2807
|
}
|
|
2813
2808
|
}
|
|
2814
2809
|
return null;
|
|
@@ -2828,14 +2823,14 @@ class SlideTimeline {
|
|
|
2828
2823
|
slideDuration;
|
|
2829
2824
|
slideDisabledTimer;
|
|
2830
2825
|
slideReady;
|
|
2831
|
-
|
|
2826
|
+
_afterAppResumeQueuePush;
|
|
2832
2827
|
sdkApi;
|
|
2833
|
-
constructor(slideIndex, slideDuration, slideDisabledTimer, slideReady,
|
|
2828
|
+
constructor(slideIndex, slideDuration, slideDisabledTimer, slideReady, _afterAppResumeQueuePush, sdkApi) {
|
|
2834
2829
|
this.slideIndex = slideIndex;
|
|
2835
2830
|
this.slideDuration = slideDuration;
|
|
2836
2831
|
this.slideDisabledTimer = slideDisabledTimer;
|
|
2837
2832
|
this.slideReady = slideReady;
|
|
2838
|
-
this.
|
|
2833
|
+
this._afterAppResumeQueuePush = _afterAppResumeQueuePush;
|
|
2839
2834
|
this.sdkApi = sdkApi;
|
|
2840
2835
|
this.timelineDisabledState = this.slideDisabledTimer ? TimelineDisabledState.disabled : TimelineDisabledState.enabled;
|
|
2841
2836
|
}
|
|
@@ -2992,7 +2987,7 @@ class SlideTimeline {
|
|
|
2992
2987
|
// if app is paused (in background) - don't call start timeline (Android issues)
|
|
2993
2988
|
// @ts-ignore
|
|
2994
2989
|
// window._log(`Push startDisabledTimeline to queue at state: ${window.slideApi.state}, time: ${new Date().getTime()}`, true);
|
|
2995
|
-
this.
|
|
2990
|
+
this._afterAppResumeQueuePush(() => {
|
|
2996
2991
|
// @ts-ignore
|
|
2997
2992
|
// window._log(`Call startDisabledTimeline at state: ${window.slideApi.state}, time: ${new Date().getTime()}`, true);
|
|
2998
2993
|
if (this.isSDKSupportUpdateTimeline) {
|
|
@@ -3039,10 +3034,12 @@ class Layer {
|
|
|
3039
3034
|
_nodeRef;
|
|
3040
3035
|
_slide;
|
|
3041
3036
|
_slideReadyPromise;
|
|
3042
|
-
|
|
3037
|
+
_afterAppResumeQueuePush;
|
|
3043
3038
|
_afterStartInitQueuePush;
|
|
3044
3039
|
_showNextSlide;
|
|
3045
3040
|
sdkApi;
|
|
3041
|
+
_slidePauseUI;
|
|
3042
|
+
_slideResumeUI;
|
|
3046
3043
|
_slideIndex;
|
|
3047
3044
|
_cardId;
|
|
3048
3045
|
_cardType;
|
|
@@ -3052,14 +3049,16 @@ class Layer {
|
|
|
3052
3049
|
_disabledNavigation;
|
|
3053
3050
|
_elements = [];
|
|
3054
3051
|
_timeline;
|
|
3055
|
-
constructor(_nodeRef, _slide, _slideReadyPromise,
|
|
3052
|
+
constructor(_nodeRef, _slide, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, _showNextSlide, sdkApi, _slidePauseUI, _slideResumeUI) {
|
|
3056
3053
|
this._nodeRef = _nodeRef;
|
|
3057
3054
|
this._slide = _slide;
|
|
3058
3055
|
this._slideReadyPromise = _slideReadyPromise;
|
|
3059
|
-
this.
|
|
3056
|
+
this._afterAppResumeQueuePush = _afterAppResumeQueuePush;
|
|
3060
3057
|
this._afterStartInitQueuePush = _afterStartInitQueuePush;
|
|
3061
3058
|
this._showNextSlide = _showNextSlide;
|
|
3062
3059
|
this.sdkApi = sdkApi;
|
|
3060
|
+
this._slidePauseUI = _slidePauseUI;
|
|
3061
|
+
this._slideResumeUI = _slideResumeUI;
|
|
3063
3062
|
this._slideIndex = parseInt(this._nodeRef.getAttribute("data-index") ?? "0");
|
|
3064
3063
|
this._cardId = parseInt(this._nodeRef.getAttribute("data-id") ?? "0");
|
|
3065
3064
|
this._cardType = parseInt(this._nodeRef.getAttribute("data-card-type") ?? "1") || 1 /* CARD_TYPE.STORY */;
|
|
@@ -3067,7 +3066,7 @@ class Layer {
|
|
|
3067
3066
|
this._duration = parseInt(this._nodeRef.getAttribute("data-duration") ?? "") || DEFAULT_SLIDE_DURATION;
|
|
3068
3067
|
this._disabledTimer = this._nodeRef.getAttribute("data-disable-timer") === "1";
|
|
3069
3068
|
this._disabledNavigation = this._nodeRef.getAttribute("data-disable-navigation") === "1";
|
|
3070
|
-
this._timeline = new SlideTimeline(this._slideIndex, this._duration, this._disabledTimer, this._slideReadyPromise, this.
|
|
3069
|
+
this._timeline = new SlideTimeline(this._slideIndex, this._duration, this._disabledTimer, this._slideReadyPromise, this._afterAppResumeQueuePush, this.sdkApi);
|
|
3071
3070
|
const onWidgetComplete = (cardId, slideIndex) => {
|
|
3072
3071
|
// todo if nothing more widgets with disabled timers - we can start layer timeline
|
|
3073
3072
|
const fallback = () => this._showNextSlide(DEFAULT_SLIDE_DURATION);
|
|
@@ -3076,10 +3075,20 @@ class Layer {
|
|
|
3076
3075
|
this._timeline.startDisabledTimeline(fallback);
|
|
3077
3076
|
});
|
|
3078
3077
|
};
|
|
3078
|
+
const onWidgetRequirePauseUI = (cardId, slideIndex) => {
|
|
3079
|
+
this._slidePauseUI();
|
|
3080
|
+
};
|
|
3081
|
+
const onWidgetRequireResumeUI = (cardId, slideIndex) => {
|
|
3082
|
+
this._slideResumeUI();
|
|
3083
|
+
};
|
|
3079
3084
|
const _elementsNodes = this._nodeRef.querySelectorAll(".narrative-slide-elements .narrative-element");
|
|
3080
3085
|
let layerWithWidgetQuest = false;
|
|
3081
3086
|
_elementsNodes.forEach(item => {
|
|
3082
|
-
let element = tryCreateFromHtmlElement(item, this,
|
|
3087
|
+
let element = tryCreateFromHtmlElement(item, this, {
|
|
3088
|
+
onWidgetComplete,
|
|
3089
|
+
onWidgetRequirePauseUI,
|
|
3090
|
+
onWidgetRequireResumeUI,
|
|
3091
|
+
}, this.sdkApi);
|
|
3083
3092
|
if (element) {
|
|
3084
3093
|
this._elements.push(element);
|
|
3085
3094
|
if (element instanceof Quest) {
|
|
@@ -3094,7 +3103,11 @@ class Layer {
|
|
|
3094
3103
|
* - then init WidgetQuest with layer instead of WidgetQuest element (required for WidgetQuest slides navigation)
|
|
3095
3104
|
*/
|
|
3096
3105
|
if (this.isQuest && !layerWithWidgetQuest && this.layoutService.layoutApi.widgetQuestApi != null) {
|
|
3097
|
-
this._elements.push(new Quest(this._nodeRef, this, this.layoutService.layoutApi.widgetQuestApi,
|
|
3106
|
+
this._elements.push(new Quest(this._nodeRef, this, this.layoutService.layoutApi.widgetQuestApi, {
|
|
3107
|
+
onWidgetComplete,
|
|
3108
|
+
onWidgetRequirePauseUI,
|
|
3109
|
+
onWidgetRequireResumeUI,
|
|
3110
|
+
}, this.sdkApi));
|
|
3098
3111
|
}
|
|
3099
3112
|
}
|
|
3100
3113
|
init(localData) {
|
|
@@ -3104,7 +3117,10 @@ class Layer {
|
|
|
3104
3117
|
this.sdkApi.isAndroid && this._nodeRef.classList.add("_isAndroid");
|
|
3105
3118
|
}
|
|
3106
3119
|
const promises = this._elements.map(element => element.init(localData));
|
|
3107
|
-
this.
|
|
3120
|
+
if (this.sdkApi.isIOS) {
|
|
3121
|
+
// only for bug in WKWebWebkit
|
|
3122
|
+
this._initTextElementAutoWidthCorrection();
|
|
3123
|
+
}
|
|
3108
3124
|
this._initTextFit();
|
|
3109
3125
|
return promises;
|
|
3110
3126
|
}
|
|
@@ -3319,7 +3335,7 @@ class Layer {
|
|
|
3319
3335
|
element.onStop();
|
|
3320
3336
|
}
|
|
3321
3337
|
}
|
|
3322
|
-
async pause(resetVideoTime = false, stopAnimation = false) {
|
|
3338
|
+
async pause(resetVideoTime = false, stopAnimation = false, updateTimeline = true) {
|
|
3323
3339
|
return new Promise(resolve => {
|
|
3324
3340
|
const cb = () => {
|
|
3325
3341
|
let currentTime = this.videoElement?.pause(resetVideoTime) ?? null;
|
|
@@ -3337,7 +3353,9 @@ class Layer {
|
|
|
3337
3353
|
for (const element of this._elements) {
|
|
3338
3354
|
element.onPause();
|
|
3339
3355
|
}
|
|
3340
|
-
|
|
3356
|
+
if (updateTimeline) {
|
|
3357
|
+
this.timeline.slidePaused(currentTime);
|
|
3358
|
+
}
|
|
3341
3359
|
resolve({ currentTime });
|
|
3342
3360
|
};
|
|
3343
3361
|
const videoStartedPromise = this.videoElement?.videoStartedPromise;
|
|
@@ -3388,11 +3406,11 @@ class Layer {
|
|
|
3388
3406
|
get isLayerForcePaused() {
|
|
3389
3407
|
return this.elements.some(element => element.isLayerForcePaused);
|
|
3390
3408
|
}
|
|
3391
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Slide`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `(duration: number) => void`, `SDKApi`]; }
|
|
3409
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Slide`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `(duration: number) => void`, `SDKApi`, `() => Promise<void>`, `() => Promise<void>`]; }
|
|
3392
3410
|
}
|
|
3393
3411
|
const TextFit = (function () {
|
|
3394
3412
|
const defaultSettings = {
|
|
3395
|
-
step:
|
|
3413
|
+
step: 0.025,
|
|
3396
3414
|
maxSteps: 100,
|
|
3397
3415
|
};
|
|
3398
3416
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -3418,7 +3436,7 @@ const TextFit = (function () {
|
|
|
3418
3436
|
els = [els];
|
|
3419
3437
|
}
|
|
3420
3438
|
// Process each el we've passed.
|
|
3421
|
-
for (let i = 0; i < els.length; i
|
|
3439
|
+
for (let i = 0; i < els.length; ++i) {
|
|
3422
3440
|
processItem(els[i], settings);
|
|
3423
3441
|
}
|
|
3424
3442
|
};
|
|
@@ -3426,50 +3444,64 @@ const TextFit = (function () {
|
|
|
3426
3444
|
if (!isElement(el) || el.getAttribute("textFitted")) {
|
|
3427
3445
|
return false;
|
|
3428
3446
|
}
|
|
3429
|
-
let
|
|
3430
|
-
let low, high;
|
|
3447
|
+
let parent;
|
|
3431
3448
|
parent = el.parentElement;
|
|
3432
3449
|
if (!isElement(parent)) {
|
|
3433
3450
|
return false;
|
|
3434
3451
|
}
|
|
3435
3452
|
// Get element data.
|
|
3436
|
-
parentHeight = innerHeight(parent);
|
|
3453
|
+
const parentHeight = innerHeight(parent);
|
|
3437
3454
|
// Don't process if we can't find box dimensions
|
|
3438
3455
|
if (parentHeight <= 0) {
|
|
3439
3456
|
console.warn(`Set a static height and width on the target element ${el.outerHTML} before using textFit!`, el);
|
|
3440
3457
|
return;
|
|
3441
3458
|
}
|
|
3442
|
-
// Set textFitted attribute so we know this was processed.
|
|
3459
|
+
// Set textFitted attribute, so we know this was processed.
|
|
3443
3460
|
el.setAttribute("textFitted", "1");
|
|
3444
3461
|
let step = settings.step;
|
|
3445
|
-
|
|
3446
|
-
|
|
3462
|
+
const fontSize = parseFloat(window.getComputedStyle(el).fontSize);
|
|
3463
|
+
const fontSizeInEm = fontSize / parseFloat(window.getComputedStyle(parent).fontSize);
|
|
3464
|
+
const high = fontSizeInEm;
|
|
3465
|
+
const low = high - step * settings.maxSteps;
|
|
3447
3466
|
let size = high;
|
|
3448
3467
|
if (size < low)
|
|
3449
3468
|
return;
|
|
3450
3469
|
while (size >= low) {
|
|
3451
|
-
|
|
3452
|
-
|
|
3470
|
+
const elementHeight = innerHeight(el);
|
|
3471
|
+
// console.log(`TextFit for(${el.textContent}): processItem, fontSize: ${size}, parentHeight: ${parentHeight}px, elementHeight: ${elementHeight}px, high: ${high}em, low: ${low}em, step: ${step}em`);
|
|
3472
|
+
if (elementHeight > parentHeight) {
|
|
3453
3473
|
size -= step;
|
|
3454
|
-
el.style.fontSize = size + "
|
|
3474
|
+
el.style.fontSize = size + "em";
|
|
3455
3475
|
}
|
|
3456
3476
|
else {
|
|
3457
3477
|
break;
|
|
3458
3478
|
}
|
|
3459
3479
|
}
|
|
3460
3480
|
}
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3481
|
+
/**
|
|
3482
|
+
* Calculate height without padding.
|
|
3483
|
+
* solution that works for both cases of box-sizing: content-box and border-box
|
|
3484
|
+
* work on inline elements as well (using offset* instead of client*)
|
|
3485
|
+
* @see https://stackoverflow.com/questions/25197184/get-the-height-of-an-element-minus-padding-margin-border-widths
|
|
3486
|
+
* @param element
|
|
3487
|
+
* @return number
|
|
3488
|
+
*/
|
|
3489
|
+
function innerHeight(element) {
|
|
3490
|
+
const cs = window.getComputedStyle(element, null);
|
|
3491
|
+
// const paddingX = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);
|
|
3492
|
+
const paddingY = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);
|
|
3493
|
+
// const borderX = parseFloat(cs.borderLeftWidth) + parseFloat(cs.borderRightWidth);
|
|
3494
|
+
const borderY = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);
|
|
3495
|
+
// Element width and height minus padding and border
|
|
3496
|
+
// const elementWidth = element.offsetWidth - paddingX - borderX;
|
|
3497
|
+
const elementHeight = element.offsetHeight - paddingY - borderY;
|
|
3498
|
+
return elementHeight;
|
|
3466
3499
|
}
|
|
3467
3500
|
//Returns true if it is a DOM element
|
|
3468
|
-
// @ts-ignore
|
|
3469
3501
|
function isElement(o) {
|
|
3470
3502
|
return typeof HTMLElement === "object"
|
|
3471
3503
|
? o instanceof HTMLElement //DOM2
|
|
3472
|
-
: o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string";
|
|
3504
|
+
: Boolean(o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string");
|
|
3473
3505
|
}
|
|
3474
3506
|
})();
|
|
3475
3507
|
class TextElementAutoWidthCorrection {
|
|
@@ -3480,6 +3512,7 @@ class TextElementAutoWidthCorrection {
|
|
|
3480
3512
|
// text - can be multiline, use overflow-wrap: anywhere - for overflow prevent
|
|
3481
3513
|
// iOS 17.5 break text on second line despite on enough space
|
|
3482
3514
|
// fix it - detect and set min-width + max-width for text element
|
|
3515
|
+
// important - call only for iOS, issues for Web-sdk and instagram mode (slide scale transformation)
|
|
3483
3516
|
leadWidth = null;
|
|
3484
3517
|
tailWidth = null;
|
|
3485
3518
|
columnGap = null;
|
|
@@ -3561,24 +3594,28 @@ class TextElementAutoWidthCorrection {
|
|
|
3561
3594
|
class Slide {
|
|
3562
3595
|
_slidesNodesRefs;
|
|
3563
3596
|
_slideReadyPromise;
|
|
3564
|
-
|
|
3597
|
+
_afterAppResumeQueuePush;
|
|
3565
3598
|
_afterStartInitQueuePush;
|
|
3566
3599
|
_showNextSlide;
|
|
3567
3600
|
sdkApi;
|
|
3601
|
+
_slidePauseUI;
|
|
3602
|
+
_slideResumeUI;
|
|
3568
3603
|
_layers;
|
|
3569
3604
|
_start;
|
|
3570
|
-
constructor(_slidesNodesRefs, _slideReadyPromise,
|
|
3605
|
+
constructor(_slidesNodesRefs, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, _showNextSlide, sdkApi, _slidePauseUI, _slideResumeUI) {
|
|
3571
3606
|
this._slidesNodesRefs = _slidesNodesRefs;
|
|
3572
3607
|
this._slideReadyPromise = _slideReadyPromise;
|
|
3573
|
-
this.
|
|
3608
|
+
this._afterAppResumeQueuePush = _afterAppResumeQueuePush;
|
|
3574
3609
|
this._afterStartInitQueuePush = _afterStartInitQueuePush;
|
|
3575
3610
|
this._showNextSlide = _showNextSlide;
|
|
3576
3611
|
this.sdkApi = sdkApi;
|
|
3612
|
+
this._slidePauseUI = _slidePauseUI;
|
|
3613
|
+
this._slideResumeUI = _slideResumeUI;
|
|
3577
3614
|
this._start = window.performance.now();
|
|
3578
3615
|
if (!this._slidesNodesRefs.length) {
|
|
3579
3616
|
throw new Error("No slides found.");
|
|
3580
3617
|
}
|
|
3581
|
-
this._layers = this._slidesNodesRefs.map(item => new Layer(item, this, this._slideReadyPromise, this.
|
|
3618
|
+
this._layers = this._slidesNodesRefs.map(item => new Layer(item, this, this._slideReadyPromise, this._afterAppResumeQueuePush, this._afterStartInitQueuePush, this._showNextSlide, this.sdkApi, this._slidePauseUI, this._slideResumeUI));
|
|
3582
3619
|
this._activeLayer = this._layers[0];
|
|
3583
3620
|
}
|
|
3584
3621
|
_activeLayer;
|
|
@@ -3669,7 +3706,7 @@ class Slide {
|
|
|
3669
3706
|
get disabledNavigation() {
|
|
3670
3707
|
return this._activeLayer.disabledNavigation;
|
|
3671
3708
|
}
|
|
3672
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`Array`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `(duration: number) => void`, `SDKApi`]; }
|
|
3709
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`Array`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `(duration: number) => void`, `SDKApi`, `() => Promise<void>`, `() => Promise<void>`]; }
|
|
3673
3710
|
}
|
|
3674
3711
|
|
|
3675
3712
|
let SlideApi$1 = class SlideApi {
|
|
@@ -3685,6 +3722,7 @@ let SlideApi$1 = class SlideApi {
|
|
|
3685
3722
|
_getViewportWidth;
|
|
3686
3723
|
_getViewportHeight;
|
|
3687
3724
|
_overlappingActionBarHeight;
|
|
3725
|
+
_separateUserAndAppPause;
|
|
3688
3726
|
sdkApi;
|
|
3689
3727
|
constructor(config) {
|
|
3690
3728
|
this.config = config;
|
|
@@ -3694,6 +3732,7 @@ let SlideApi$1 = class SlideApi {
|
|
|
3694
3732
|
this._getViewportWidth = config.getViewportWidth;
|
|
3695
3733
|
this._getViewportHeight = config.getViewportHeight;
|
|
3696
3734
|
this._overlappingActionBarHeight = config.overlappingActionBarHeight ?? 0;
|
|
3735
|
+
this._separateUserAndAppPause = config.separateUserAndAppPause;
|
|
3697
3736
|
this.refreshSizes = proxy(this.refreshSizes, this);
|
|
3698
3737
|
this.initListeners();
|
|
3699
3738
|
this.refreshSizes();
|
|
@@ -3702,10 +3741,10 @@ let SlideApi$1 = class SlideApi {
|
|
|
3702
3741
|
if (slideBox && slideBox.innerText.trim() !== "{%content}".replace("{", "{{").replace("}", "}}")) {
|
|
3703
3742
|
this._slideInInit = null;
|
|
3704
3743
|
this._slideInRender = true;
|
|
3705
|
-
this._init(() => this._slideBoxRenderComplete(null)
|
|
3744
|
+
this._init(() => this._slideBoxRenderComplete(null)).then(({ slide, result, reason }) => {
|
|
3706
3745
|
this._slide = slide;
|
|
3707
3746
|
if (config.slideLoadedCb != null) {
|
|
3708
|
-
config.slideLoadedCb({ slide, result, reason });
|
|
3747
|
+
config.slideLoadedCb({ cardId: slide.cardId, slideIndex: slide.slideIndex, result, reason });
|
|
3709
3748
|
}
|
|
3710
3749
|
});
|
|
3711
3750
|
}
|
|
@@ -3715,6 +3754,7 @@ let SlideApi$1 = class SlideApi {
|
|
|
3715
3754
|
this.slide.onBeforeUnmount();
|
|
3716
3755
|
}
|
|
3717
3756
|
this.destroyListeners();
|
|
3757
|
+
this._state = 13 /* STATE.DESTROYED */;
|
|
3718
3758
|
}
|
|
3719
3759
|
initListeners() {
|
|
3720
3760
|
this._viewport.addEventListener("resize", this.refreshSizes);
|
|
@@ -3795,7 +3835,7 @@ let SlideApi$1 = class SlideApi {
|
|
|
3795
3835
|
async showSlide(html) {
|
|
3796
3836
|
const slideBox = this._slideWrapper.querySelector(`.${SlideApi.renderedBoxClassName}`);
|
|
3797
3837
|
const slideBoxPrerender = this._slideWrapper.querySelector(`.${SlideApi.prerenderBoxClassName}`);
|
|
3798
|
-
const _result = { slide: this.slide, result: false, reason: "" };
|
|
3838
|
+
const _result = { cardId: this.slide?.cardId ?? 0, slideIndex: this.slide?.slideIndex ?? 0, result: false, reason: "" };
|
|
3799
3839
|
if (slideBox && slideBoxPrerender) {
|
|
3800
3840
|
if (this._slideInRender) {
|
|
3801
3841
|
this._slideInRender = false;
|
|
@@ -3805,12 +3845,17 @@ let SlideApi$1 = class SlideApi {
|
|
|
3805
3845
|
this._slideInRender = true;
|
|
3806
3846
|
slideBoxPrerender.innerHTML = html;
|
|
3807
3847
|
const prevSlide = this.slide ? Object.assign(Object.create(Object.getPrototypeOf(this.slide)), this.slide) : null;
|
|
3808
|
-
const { slide, result, reason } = await this._init(() => this._slideBoxRenderComplete(prevSlide)
|
|
3848
|
+
const { slide, result, reason } = await this._init(() => this._slideBoxRenderComplete(prevSlide));
|
|
3809
3849
|
this._slide = slide;
|
|
3810
3850
|
_result.result = result;
|
|
3811
3851
|
_result.reason = reason;
|
|
3812
3852
|
}
|
|
3813
|
-
|
|
3853
|
+
else {
|
|
3854
|
+
_result.result = false;
|
|
3855
|
+
_result.reason = `Element .${SlideApi.renderedBoxClassName} or .${SlideApi.prerenderBoxClassName} does not found in DOM`;
|
|
3856
|
+
}
|
|
3857
|
+
_result.cardId = this.slide.cardId;
|
|
3858
|
+
_result.slideIndex = this.slide.slideIndex;
|
|
3814
3859
|
return _result;
|
|
3815
3860
|
}
|
|
3816
3861
|
handleBackpress() {
|
|
@@ -3864,44 +3909,50 @@ let SlideApi$1 = class SlideApi {
|
|
|
3864
3909
|
}
|
|
3865
3910
|
});
|
|
3866
3911
|
}
|
|
3912
|
+
// todo nullable
|
|
3867
3913
|
_slide;
|
|
3868
3914
|
_slideInInit;
|
|
3869
3915
|
_state;
|
|
3870
3916
|
_afterStartInitQueue = [];
|
|
3871
|
-
|
|
3917
|
+
_afterAppResumeQueue = [];
|
|
3872
3918
|
get state() {
|
|
3873
3919
|
return this._state;
|
|
3874
3920
|
}
|
|
3875
3921
|
async _onAllMediaLoaded(slide) {
|
|
3876
|
-
return
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3922
|
+
return Promise.all(slide.layers.flatMap(layer => layer.elements.flatMap(element => element.mediaElementsLoadingPromises))).then(_ => { });
|
|
3923
|
+
// return new Promise((resolve, reject) => {
|
|
3924
|
+
// const promises = slide.layers.flatMap(layer => layer.elements.flatMap(element => element.mediaElementsLoadingPromises));
|
|
3925
|
+
//
|
|
3926
|
+
// // console.log({ promises });
|
|
3927
|
+
//
|
|
3928
|
+
// let checkerTimerId: number | undefined = undefined;
|
|
3929
|
+
// let timeOutFired = false;
|
|
3930
|
+
// if (promises.length > 0) {
|
|
3931
|
+
// checkerTimerId = this.layoutService.env.setTimeout(() => {
|
|
3932
|
+
// timeOutFired = true;
|
|
3933
|
+
// reject("onAllMediaLoaded timeout");
|
|
3934
|
+
// }, 3000);
|
|
3935
|
+
// } else {
|
|
3936
|
+
// resolve();
|
|
3937
|
+
// return;
|
|
3938
|
+
// }
|
|
3939
|
+
// Promise.all(promises).then(
|
|
3940
|
+
// _ => {
|
|
3941
|
+
// checkerTimerId && this.layoutService.env.clearTimeout(checkerTimerId);
|
|
3942
|
+
// if (!timeOutFired) {
|
|
3943
|
+
// resolve();
|
|
3944
|
+
// }
|
|
3945
|
+
// },
|
|
3946
|
+
// reason => {
|
|
3947
|
+
// checkerTimerId && this.layoutService.env.clearTimeout(checkerTimerId);
|
|
3948
|
+
// if (!timeOutFired) {
|
|
3949
|
+
// reject(reason);
|
|
3950
|
+
// }
|
|
3951
|
+
// },
|
|
3952
|
+
// );
|
|
3953
|
+
// });
|
|
3954
|
+
}
|
|
3955
|
+
async _init(slideBoxCb) {
|
|
3905
3956
|
this._state = 0 /* STATE.INIT */;
|
|
3906
3957
|
const slideNodeRef = this._slideWrapper.querySelector(`.${SlideApi.prerenderBoxClassName} .narrative-slide`);
|
|
3907
3958
|
const slidesNodesRefs = Array.prototype.slice.call(this._slideWrapper.querySelectorAll(`.${SlideApi.prerenderBoxClassName} .narrative-slide.narrative-multi-slide`));
|
|
@@ -3912,53 +3963,59 @@ let SlideApi$1 = class SlideApi {
|
|
|
3912
3963
|
throw new Error("No slides found.");
|
|
3913
3964
|
}
|
|
3914
3965
|
let slideReadyResolve = null;
|
|
3915
|
-
|
|
3916
|
-
const slideReadyPromise = new Promise((resolve, reject) => {
|
|
3966
|
+
const slideReadyPromise = new Promise(resolve => {
|
|
3917
3967
|
slideReadyResolve = resolve;
|
|
3918
|
-
slideReadyReject = reject;
|
|
3919
3968
|
});
|
|
3920
|
-
const slide = new Slide(slidesNodesRefs, slideReadyPromise, this.
|
|
3969
|
+
const slide = new Slide(slidesNodesRefs, slideReadyPromise, this.afterAppResumeQueuePush.bind(this), this.afterStartInitQueuePush.bind(this), this.sdkApi.showNextSlide.bind(this), this.sdkApi, this.slidePauseUI.bind(this), this.slideResumeUI.bind(this));
|
|
3921
3970
|
this._slideInInit = slide;
|
|
3922
3971
|
slide.activeLayer.timeline.triggerSlideLoadState();
|
|
3923
|
-
const onAllMediaLoaded = this._onAllMediaLoaded(slide);
|
|
3924
3972
|
if (this.sdkApi.isAndroid) {
|
|
3925
3973
|
this._afterStartInitQueue = [];
|
|
3926
3974
|
}
|
|
3927
|
-
this.
|
|
3975
|
+
this._afterAppResumeQueue = [];
|
|
3928
3976
|
const result = { slide, result: false, reason: "" };
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3977
|
+
try {
|
|
3978
|
+
const onAllMediaLoaded = this._onAllMediaLoaded(slide);
|
|
3979
|
+
const fontsPromise = this._initAndLoadFonts(this.sdkApi.getCardFonts());
|
|
3980
|
+
const mediaAndFontsPromise = Promise.all([onAllMediaLoaded, fontsPromise]).then(() => {
|
|
3981
|
+
this.layoutService.env.clearTimeout(mediaResourcesTimeoutId);
|
|
3982
|
+
});
|
|
3983
|
+
let mediaResourcesTimeoutId = null;
|
|
3984
|
+
const mediaResourcesTimeoutPromise = new Promise((resolve, reject) => {
|
|
3985
|
+
mediaResourcesTimeoutId = this.layoutService.env.setTimeout(() => {
|
|
3986
|
+
// todo add detailed info about pending media resources
|
|
3987
|
+
reject("MediaResources loading timed out (5 sec).");
|
|
3988
|
+
}, 5000);
|
|
3989
|
+
});
|
|
3990
|
+
const mediaResourcesWithTimeoutPromise = Promise.race([mediaAndFontsPromise, mediaResourcesTimeoutPromise]);
|
|
3991
|
+
const elementsPromise = slide.init(await this.getLocalData());
|
|
3992
|
+
const finishRender = await elementsPromise;
|
|
3993
|
+
/**
|
|
3994
|
+
* если есть виджеты, которых надо ждать - то не завершаем рендеринг текущего слайда
|
|
3995
|
+
* пример - квест, если зашли в сторис а виджету нужно показать другой слайд вместо первого
|
|
3996
|
+
*/
|
|
3997
|
+
if (finishRender) {
|
|
3998
|
+
this._state = 1 /* STATE.INITED */;
|
|
3999
|
+
await mediaResourcesWithTimeoutPromise;
|
|
3940
4000
|
result.result = true;
|
|
3941
4001
|
slideBoxCb();
|
|
3942
|
-
this.layoutService.env.setTimeout(() => {
|
|
3943
|
-
slideReadyResolve();
|
|
3944
|
-
});
|
|
3945
4002
|
}
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
this.layoutService.env.setTimeout(() => {
|
|
3950
|
-
slideReadyReject();
|
|
3951
|
-
});
|
|
3952
|
-
result.result = false;
|
|
3953
|
-
result.reason = String(reason);
|
|
4003
|
+
else {
|
|
4004
|
+
this._state = 12 /* STATE.STOPPED */;
|
|
4005
|
+
result.result = true;
|
|
3954
4006
|
}
|
|
4007
|
+
this.layoutService.env.setTimeout(() => {
|
|
4008
|
+
slideReadyResolve();
|
|
4009
|
+
});
|
|
3955
4010
|
}
|
|
3956
|
-
|
|
3957
|
-
|
|
4011
|
+
catch (reason) {
|
|
4012
|
+
console.log("SlideInit, onAllMediaLoaded reject", reason);
|
|
4013
|
+
slideBoxCb();
|
|
3958
4014
|
this.layoutService.env.setTimeout(() => {
|
|
3959
4015
|
slideReadyResolve();
|
|
3960
4016
|
});
|
|
3961
|
-
result.result =
|
|
4017
|
+
result.result = false;
|
|
4018
|
+
result.reason = String(reason);
|
|
3962
4019
|
}
|
|
3963
4020
|
return result;
|
|
3964
4021
|
}
|
|
@@ -3974,6 +4031,8 @@ let SlideApi$1 = class SlideApi {
|
|
|
3974
4031
|
slideBoxPrerender.classList.remove(SlideApi.prerenderBoxClassName);
|
|
3975
4032
|
slideBox.classList.remove(SlideApi.renderedBoxClassName);
|
|
3976
4033
|
slideBox.classList.add(SlideApi.prerenderBoxClassName);
|
|
4034
|
+
// pause Video - prevent triggering onDataWaiting from VODPlayer
|
|
4035
|
+
prevSlide?.activeLayer.pause(false, true, false);
|
|
3977
4036
|
// 2 RAF - wait for browser render complete (CSS changes, etc.)
|
|
3978
4037
|
this.layoutService.env.requestAnimationFrame(() => {
|
|
3979
4038
|
this.layoutService.env.requestAnimationFrame(() => {
|
|
@@ -3987,34 +4046,10 @@ let SlideApi$1 = class SlideApi {
|
|
|
3987
4046
|
}
|
|
3988
4047
|
this._slideInRender = false;
|
|
3989
4048
|
}
|
|
3990
|
-
_slideBoxRenderError(prevSlide) {
|
|
3991
|
-
// if (!slideInRender) {
|
|
3992
|
-
// slideInRender = true;
|
|
3993
|
-
// return;
|
|
3994
|
-
// }
|
|
3995
|
-
const slideBox = this._slideWrapper.querySelector(`.${SlideApi.renderedBoxClassName}`);
|
|
3996
|
-
const slideBoxPrerender = this._slideWrapper.querySelector(`.${SlideApi.prerenderBoxClassName}`);
|
|
3997
|
-
if (slideBox && slideBoxPrerender) {
|
|
3998
|
-
const slides = Array.prototype.slice.call(slideBoxPrerender.querySelectorAll(".narrative-slide"));
|
|
3999
|
-
for (let i = 0; i < slides.length; ++i) {
|
|
4000
|
-
const slide = slides[i];
|
|
4001
|
-
if (slide) {
|
|
4002
|
-
slide.innerHTML = "";
|
|
4003
|
-
}
|
|
4004
|
-
}
|
|
4005
|
-
slideBoxPrerender.classList.remove(SlideApi.prerenderBoxClassName);
|
|
4006
|
-
slideBox.classList.remove(SlideApi.renderedBoxClassName);
|
|
4007
|
-
slideBox.classList.add(SlideApi.prerenderBoxClassName);
|
|
4008
|
-
prevSlide?.onBeforeUnmount();
|
|
4009
|
-
slideBox.innerHTML = "";
|
|
4010
|
-
slideBoxPrerender.classList.add(SlideApi.renderedBoxClassName);
|
|
4011
|
-
}
|
|
4012
|
-
// slideInRender = false;
|
|
4013
|
-
}
|
|
4014
4049
|
_slideConfig = {};
|
|
4015
4050
|
async slideStart(config) {
|
|
4016
4051
|
// console.log(`slideStart slideIdx: ${this.activeLayer.slideIndex} state: ${this._state}`);
|
|
4017
|
-
if (!(this._state ===
|
|
4052
|
+
if (!(this._state === 12 /* STATE.STOPPED */ || this._state === 1 /* STATE.INITED */)) {
|
|
4018
4053
|
return { currentTime: 0 };
|
|
4019
4054
|
}
|
|
4020
4055
|
this._state = 2 /* STATE.START */;
|
|
@@ -4029,30 +4064,32 @@ let SlideApi$1 = class SlideApi {
|
|
|
4029
4064
|
}
|
|
4030
4065
|
this._afterStartInitQueue = [];
|
|
4031
4066
|
}
|
|
4032
|
-
if (this.
|
|
4033
|
-
for (const job of this.
|
|
4067
|
+
if (this._afterAppResumeQueue && Array.isArray(this._afterAppResumeQueue)) {
|
|
4068
|
+
for (const job of this._afterAppResumeQueue) {
|
|
4034
4069
|
if (isFunction(job)) {
|
|
4035
4070
|
job();
|
|
4036
4071
|
}
|
|
4037
4072
|
}
|
|
4038
|
-
this.
|
|
4073
|
+
this._afterAppResumeQueue = [];
|
|
4039
4074
|
}
|
|
4040
4075
|
const { currentTime } = await this.slide.activeLayer.start(this._slideConfig.muted);
|
|
4041
4076
|
this._state = 3 /* STATE.STARTED */;
|
|
4042
4077
|
if (this.slide.activeLayer.isLayerForcePaused) {
|
|
4043
|
-
this._state =
|
|
4078
|
+
this._state = 9 /* STATE.USER_PAUSED */;
|
|
4044
4079
|
}
|
|
4045
4080
|
return { currentTime };
|
|
4046
4081
|
}
|
|
4047
4082
|
async slideRestart(config) {
|
|
4048
|
-
this._state =
|
|
4083
|
+
this._state = 12 /* STATE.STOPPED */;
|
|
4049
4084
|
return this.slideStart(config);
|
|
4050
4085
|
}
|
|
4051
4086
|
_pauseCbTimer = null;
|
|
4052
|
-
async
|
|
4087
|
+
async slideUserPause() {
|
|
4088
|
+
// apply user pause only if state is started or resumed
|
|
4053
4089
|
if (!(this._state === 3 /* STATE.STARTED */ || this._state === 5 /* STATE.RESUMED */)) {
|
|
4054
4090
|
return;
|
|
4055
4091
|
}
|
|
4092
|
+
// TODO - move to Android SlideApi adapter
|
|
4056
4093
|
// обход бага на андроиде (вызывает pause/resume при любом нажатии на экран, даже если это клик - для перехода по слайдам)
|
|
4057
4094
|
// поэтому делаем отложенный вызов (300мс) а если следом приходит stop - то отменяем таймер
|
|
4058
4095
|
const pauseCb = () => {
|
|
@@ -4063,15 +4100,16 @@ let SlideApi$1 = class SlideApi {
|
|
|
4063
4100
|
// stop pause event (from sdk) if _narrative_range_slider is active
|
|
4064
4101
|
return;
|
|
4065
4102
|
}
|
|
4066
|
-
this._state =
|
|
4103
|
+
this._state = 8 /* STATE.USER_PAUSE */;
|
|
4067
4104
|
// _log("pause: " + (performance.now() - window.start));
|
|
4068
4105
|
this.slide.activeLayer.pause(false, false);
|
|
4069
4106
|
// clean up
|
|
4070
4107
|
if (this._pauseCbTimer != null) {
|
|
4071
4108
|
clearTimeout(this._pauseCbTimer);
|
|
4072
4109
|
}
|
|
4073
|
-
this._state =
|
|
4110
|
+
this._state = 9 /* STATE.USER_PAUSED */;
|
|
4074
4111
|
};
|
|
4112
|
+
// todo move to Android adapter
|
|
4075
4113
|
if (this.sdkApi.isAndroid) {
|
|
4076
4114
|
this._pauseCbTimer = this.layoutService.env.setTimeout(pauseCb, 300);
|
|
4077
4115
|
}
|
|
@@ -4079,38 +4117,68 @@ let SlideApi$1 = class SlideApi {
|
|
|
4079
4117
|
pauseCb();
|
|
4080
4118
|
}
|
|
4081
4119
|
}
|
|
4082
|
-
async
|
|
4120
|
+
async slideUserResume() {
|
|
4083
4121
|
if (this._pauseCbTimer != null) {
|
|
4084
4122
|
// отменяем pause если есть (баг андроида - шлет pause/resume на простой клик)
|
|
4085
4123
|
clearTimeout(this._pauseCbTimer);
|
|
4086
4124
|
}
|
|
4087
|
-
if (this._state !==
|
|
4125
|
+
if (this._state !== 9 /* STATE.USER_PAUSED */) {
|
|
4088
4126
|
return;
|
|
4089
4127
|
}
|
|
4090
4128
|
this._state = 4 /* STATE.RESUME */;
|
|
4091
4129
|
// _log("resume: " + (performance.now() - window.start));
|
|
4092
|
-
|
|
4093
|
-
|
|
4130
|
+
// fallback for native sdk without user and app pause event
|
|
4131
|
+
if (!this._separateUserAndAppPause) {
|
|
4132
|
+
if (this._afterAppResumeQueue && Array.isArray(this._afterAppResumeQueue)) {
|
|
4133
|
+
for (const job of this._afterAppResumeQueue) {
|
|
4134
|
+
if (isFunction(job)) {
|
|
4135
|
+
job();
|
|
4136
|
+
}
|
|
4137
|
+
}
|
|
4138
|
+
this._afterAppResumeQueue = [];
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4141
|
+
this.slide.activeLayer.resume();
|
|
4142
|
+
this._state = 5 /* STATE.RESUMED */;
|
|
4143
|
+
}
|
|
4144
|
+
/**
|
|
4145
|
+
* Call on app gone background
|
|
4146
|
+
*/
|
|
4147
|
+
async slideAppPause() {
|
|
4148
|
+
this._state = 6 /* STATE.APP_PAUSE */;
|
|
4149
|
+
this.slide.activeLayer.pause(false, false);
|
|
4150
|
+
this._state = 7 /* STATE.APP_PAUSED */;
|
|
4151
|
+
}
|
|
4152
|
+
/**
|
|
4153
|
+
* Call on app gone foreground after a background
|
|
4154
|
+
*/
|
|
4155
|
+
async slideAppResume() {
|
|
4156
|
+
if (this._state !== 7 /* STATE.APP_PAUSED */) {
|
|
4157
|
+
return;
|
|
4158
|
+
}
|
|
4159
|
+
this._state = 4 /* STATE.RESUME */;
|
|
4160
|
+
if (this._afterAppResumeQueue && Array.isArray(this._afterAppResumeQueue)) {
|
|
4161
|
+
for (const job of this._afterAppResumeQueue) {
|
|
4094
4162
|
if (isFunction(job)) {
|
|
4095
4163
|
job();
|
|
4096
4164
|
}
|
|
4097
4165
|
}
|
|
4098
|
-
this.
|
|
4166
|
+
this._afterAppResumeQueue = [];
|
|
4099
4167
|
}
|
|
4100
4168
|
this.slide.activeLayer.resume();
|
|
4101
4169
|
this._state = 5 /* STATE.RESUMED */;
|
|
4102
4170
|
}
|
|
4103
4171
|
async slideStop(options) {
|
|
4104
|
-
if (!(this._state === 3 /* STATE.STARTED */ || this._state === 5 /* STATE.RESUMED */ || this._state ===
|
|
4172
|
+
if (!(this._state === 3 /* STATE.STARTED */ || this._state === 5 /* STATE.RESUMED */ || this._state === 9 /* STATE.USER_PAUSED */)) {
|
|
4105
4173
|
return;
|
|
4106
4174
|
}
|
|
4107
|
-
this._state =
|
|
4175
|
+
this._state = 11 /* STATE.STOP */;
|
|
4108
4176
|
if (this._pauseCbTimer != null) {
|
|
4109
4177
|
// отменяем pause если есть (баг андроида - шлет pause/resume на простой клик)
|
|
4110
4178
|
clearTimeout(this._pauseCbTimer);
|
|
4111
4179
|
}
|
|
4112
4180
|
await this.slide.activeLayer.stop(options);
|
|
4113
|
-
this._state =
|
|
4181
|
+
this._state = 12 /* STATE.STOPPED */;
|
|
4114
4182
|
}
|
|
4115
4183
|
slideTimerEnd() {
|
|
4116
4184
|
const defaultAction = () => {
|
|
@@ -4143,7 +4211,7 @@ let SlideApi$1 = class SlideApi {
|
|
|
4143
4211
|
// skip state checking and sdk issues
|
|
4144
4212
|
async slidePauseUI() {
|
|
4145
4213
|
await this.slide.activeLayer.pause(false, false);
|
|
4146
|
-
this._state =
|
|
4214
|
+
this._state = 10 /* STATE.FORCE_PAUSED */;
|
|
4147
4215
|
}
|
|
4148
4216
|
// for call from SlideApi internals (from widgets)
|
|
4149
4217
|
// skip state checking and sdk issues
|
|
@@ -4160,7 +4228,7 @@ let SlideApi$1 = class SlideApi {
|
|
|
4160
4228
|
this._slideConfig.muted = true;
|
|
4161
4229
|
}
|
|
4162
4230
|
get isStopped() {
|
|
4163
|
-
return this._state ===
|
|
4231
|
+
return this._state === 12 /* STATE.STOPPED */;
|
|
4164
4232
|
}
|
|
4165
4233
|
afterStartInitQueuePush(cb) {
|
|
4166
4234
|
if (!isFunction(cb)) {
|
|
@@ -4173,15 +4241,20 @@ let SlideApi$1 = class SlideApi {
|
|
|
4173
4241
|
cb();
|
|
4174
4242
|
}
|
|
4175
4243
|
}
|
|
4176
|
-
|
|
4244
|
+
afterAppResumeQueuePush(cb) {
|
|
4177
4245
|
if (!isFunction(cb)) {
|
|
4178
4246
|
return false;
|
|
4179
4247
|
}
|
|
4180
|
-
|
|
4248
|
+
let states = [4 /* STATE.RESUME */, 5 /* STATE.RESUMED */, 1 /* STATE.INITED */, 2 /* STATE.START */, 3 /* STATE.STARTED */, 8 /* STATE.USER_PAUSE */, 9 /* STATE.USER_PAUSED */];
|
|
4249
|
+
// fallback for native sdk without user and app pause event
|
|
4250
|
+
if (!this._separateUserAndAppPause) {
|
|
4251
|
+
states = [4 /* STATE.RESUME */, 5 /* STATE.RESUMED */, 1 /* STATE.INITED */, 2 /* STATE.START */, 3 /* STATE.STARTED */];
|
|
4252
|
+
}
|
|
4253
|
+
if (states.includes(this._state)) {
|
|
4181
4254
|
cb();
|
|
4182
4255
|
}
|
|
4183
4256
|
else {
|
|
4184
|
-
this.
|
|
4257
|
+
this._afterAppResumeQueue.push(cb);
|
|
4185
4258
|
}
|
|
4186
4259
|
}
|
|
4187
4260
|
get activeLayer() {
|
|
@@ -4760,7 +4833,7 @@ let SlideApi$1 = class SlideApi {
|
|
|
4760
4833
|
}
|
|
4761
4834
|
}
|
|
4762
4835
|
}
|
|
4763
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`{\n sdkApi: SDKApi;\n slideWrapper: HTMLElement;\n viewport: Window;\n userResizeHandler?: (data: { viewportWidth: number; viewportHeight: number; fontSize: number }) => void;\n slideRatio: number;\n isFullscreen: boolean;\n slideLoadedCb?: (data: {
|
|
4836
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`{\n sdkApi: SDKApi;\n slideWrapper: HTMLElement;\n viewport: Window;\n userResizeHandler?: (data: { viewportWidth: number; viewportHeight: number; fontSize: number }) => void;\n slideRatio: number;\n isFullscreen: boolean;\n slideLoadedCb?: (data: { cardId: number; slideIndex: number; result: boolean; reason?: string }) => void;\n getViewportWidth: () => number;\n getViewportHeight: () => number;\n overlappingActionBarHeight?: number;\n separateUserAndAppPause: boolean;\n }`]; }
|
|
4764
4837
|
};
|
|
4765
4838
|
|
|
4766
4839
|
const slideApiPeerDeps = {};
|
|
@@ -4809,6 +4882,7 @@ class SlideApi extends SlideApi$1 {
|
|
|
4809
4882
|
getViewportWidth: () => slideWrapper.clientWidth,
|
|
4810
4883
|
getViewportHeight: () => slideWrapper.clientHeight,
|
|
4811
4884
|
overlappingActionBarHeight: config.overlappingActionBarHeight,
|
|
4885
|
+
separateUserAndAppPause: true,
|
|
4812
4886
|
});
|
|
4813
4887
|
}
|
|
4814
4888
|
static get [Symbol.for("___CTOR_ARGS___")]() { return [`SDKInterface`, `{\n root: HTMLElement;\n slideRatio: number;\n isFullscreen: boolean;\n nonce?: string;\n viewport: Window;\n userResizeHandler?: (data: { viewportWidth: number; viewportHeight: number; fontSize: number }) => void;\n VODPlayer?: typeof VODPlayer;\n overlappingActionBarHeight?: number;\n }`]; }
|
|
@@ -14170,7 +14244,7 @@ FontLib.loadFont("OCR-B", 96, 100, "AAEAAAAPAIAAAwBwRkZUTXxHn14AADmUAAAAHEdERUYA
|
|
|
14170
14244
|
function ean13(opts,dwg) { return _ToAny(bwipp_ean13,opts,dwg); }function pdf417(opts,dwg) { return _ToAny(bwipp_pdf417,opts,dwg); }function qrcode(opts,dwg) { return _ToAny(bwipp_qrcode,opts,dwg); }
|
|
14171
14245
|
|
|
14172
14246
|
class WidgetBase {
|
|
14173
|
-
|
|
14247
|
+
_widgetCallbacks;
|
|
14174
14248
|
sdkApi;
|
|
14175
14249
|
static DEFAULTS = {
|
|
14176
14250
|
slide: null,
|
|
@@ -14199,8 +14273,8 @@ class WidgetBase {
|
|
|
14199
14273
|
id;
|
|
14200
14274
|
startReadyPromise = null;
|
|
14201
14275
|
startReadyResolve = null;
|
|
14202
|
-
constructor(element, options,
|
|
14203
|
-
this.
|
|
14276
|
+
constructor(element, options, _widgetCallbacks, sdkApi, elementIdGetter, slideGetter) {
|
|
14277
|
+
this._widgetCallbacks = _widgetCallbacks;
|
|
14204
14278
|
this.sdkApi = sdkApi;
|
|
14205
14279
|
this.options = extend({}, this.constructor.DEFAULTS, options);
|
|
14206
14280
|
this.element = element;
|
|
@@ -14388,7 +14462,13 @@ class WidgetBase {
|
|
|
14388
14462
|
this.constructor.sendStatisticEventToApp(this.sdkApi, name, data, devPayload, options);
|
|
14389
14463
|
}
|
|
14390
14464
|
onWidgetComplete() {
|
|
14391
|
-
this.
|
|
14465
|
+
this._widgetCallbacks.onWidgetComplete(this.cardId, this.slideIndex);
|
|
14466
|
+
}
|
|
14467
|
+
onWidgetRequirePauseUI() {
|
|
14468
|
+
this._widgetCallbacks.onWidgetRequirePauseUI(this.cardId, this.slideIndex);
|
|
14469
|
+
}
|
|
14470
|
+
onWidgetRequireResumeUI() {
|
|
14471
|
+
this._widgetCallbacks.onWidgetRequireResumeUI(this.cardId, this.slideIndex);
|
|
14392
14472
|
}
|
|
14393
14473
|
_showLayer(layers, selectIndex, withStatEvent = false) {
|
|
14394
14474
|
if (this.sdkApi.isExistsShowLayer()) {
|
|
@@ -14440,7 +14520,7 @@ class WidgetBase {
|
|
|
14440
14520
|
return `story/${this.cardId}/widget/${this.elementId}/promo-code/${promotionalCodeId}`;
|
|
14441
14521
|
}
|
|
14442
14522
|
}
|
|
14443
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
14523
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`, `(element: HTMLElement) => string`, `(element: HTMLElement) => HTMLElement`]; }
|
|
14444
14524
|
}
|
|
14445
14525
|
|
|
14446
14526
|
class WidgetBarcode extends WidgetBase {
|
|
@@ -14464,8 +14544,8 @@ class WidgetBarcode extends WidgetBase {
|
|
|
14464
14544
|
msgNoMoreCodes;
|
|
14465
14545
|
msgTryAgain;
|
|
14466
14546
|
msgBarcodeRenderError;
|
|
14467
|
-
constructor(element, options,
|
|
14468
|
-
super(element, options,
|
|
14547
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
14548
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
14469
14549
|
this.captionView = this.element.querySelector(".narrative-element-text-lines");
|
|
14470
14550
|
this.clipboardTarget = getTagData(element, "clipboardTarget");
|
|
14471
14551
|
this.isPromotionalCode = getTagData(element, "clipboardType") === "promocode";
|
|
@@ -14714,8 +14794,8 @@ class WidgetBarcode extends WidgetBase {
|
|
|
14714
14794
|
static api = {
|
|
14715
14795
|
widgetClassName: WidgetBarcode.widgetClassName,
|
|
14716
14796
|
onRefreshUserData: WidgetBarcode.onRefreshUserData,
|
|
14717
|
-
init: function (element, localData,
|
|
14718
|
-
WidgetBarcode.initWidget(element, localData, (element, options) => new WidgetBarcode(element, options,
|
|
14797
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
14798
|
+
WidgetBarcode.initWidget(element, localData, (element, options) => new WidgetBarcode(element, options, widgetCallbacks, sdkApi));
|
|
14719
14799
|
},
|
|
14720
14800
|
onStart: function (element) {
|
|
14721
14801
|
WidgetBarcode.getInstance(element)?.onStart();
|
|
@@ -14742,7 +14822,7 @@ class WidgetBarcode extends WidgetBase {
|
|
|
14742
14822
|
return false;
|
|
14743
14823
|
},
|
|
14744
14824
|
};
|
|
14745
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
14825
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
14746
14826
|
}
|
|
14747
14827
|
|
|
14748
14828
|
class WidgetCopy extends WidgetBase {
|
|
@@ -14764,8 +14844,8 @@ class WidgetCopy extends WidgetBase {
|
|
|
14764
14844
|
geometry;
|
|
14765
14845
|
resultLayer;
|
|
14766
14846
|
resultLayerGeometry;
|
|
14767
|
-
constructor(element, options,
|
|
14768
|
-
super(element, options,
|
|
14847
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
14848
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
14769
14849
|
this.button = this.element.querySelector(".narrative-element-text-lines");
|
|
14770
14850
|
this.clipboardTarget = getTagData(element, "clipboardTarget");
|
|
14771
14851
|
this.isPromotionalCode = getTagData(element, "clipboardType") === "promocode";
|
|
@@ -14972,10 +15052,10 @@ class WidgetCopy extends WidgetBase {
|
|
|
14972
15052
|
static api = {
|
|
14973
15053
|
widgetClassName: WidgetCopy.widgetClassName,
|
|
14974
15054
|
onRefreshUserData: WidgetCopy.onRefreshUserData,
|
|
14975
|
-
init: function (element, localData,
|
|
15055
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
14976
15056
|
// prevent initWidget for result layer
|
|
14977
15057
|
if (!element.classList.contains("narrative-element-copy-result-variant")) {
|
|
14978
|
-
WidgetCopy.initWidget(element, localData, (element, options) => new WidgetCopy(element, options,
|
|
15058
|
+
WidgetCopy.initWidget(element, localData, (element, options) => new WidgetCopy(element, options, widgetCallbacks, sdkApi));
|
|
14979
15059
|
}
|
|
14980
15060
|
},
|
|
14981
15061
|
onStart: function (element) {
|
|
@@ -15003,7 +15083,7 @@ class WidgetCopy extends WidgetBase {
|
|
|
15003
15083
|
return false;
|
|
15004
15084
|
},
|
|
15005
15085
|
};
|
|
15006
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
15086
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
15007
15087
|
}
|
|
15008
15088
|
|
|
15009
15089
|
class WidgetDataInput extends WidgetBase {
|
|
@@ -15026,8 +15106,8 @@ class WidgetDataInput extends WidgetBase {
|
|
|
15026
15106
|
* @param onWidgetComplete
|
|
15027
15107
|
* @param sdkApi
|
|
15028
15108
|
*/
|
|
15029
|
-
constructor(element, options,
|
|
15030
|
-
super(element, options,
|
|
15109
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
15110
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
15031
15111
|
this.label = this.element.querySelector(".label-view .label");
|
|
15032
15112
|
this.elementRect = this.element.getBoundingClientRect();
|
|
15033
15113
|
this.inputElement = getValueOrException(this.element.querySelector(".input-view .input"), "Empty .input-view .input");
|
|
@@ -15107,7 +15187,7 @@ class WidgetDataInput extends WidgetBase {
|
|
|
15107
15187
|
const data = JSON.parse(dataString);
|
|
15108
15188
|
data.size = getElementBounding(this.env, this.elementRect);
|
|
15109
15189
|
if (!this.disableTimer) {
|
|
15110
|
-
this.
|
|
15190
|
+
this.onWidgetRequirePauseUI();
|
|
15111
15191
|
}
|
|
15112
15192
|
try {
|
|
15113
15193
|
data.text.value = data.text.value.replaceAll("\\n", "\n").replaceAll("\\r", "\r").replaceAll("\\t", "\t");
|
|
@@ -15168,14 +15248,14 @@ class WidgetDataInput extends WidgetBase {
|
|
|
15168
15248
|
}
|
|
15169
15249
|
}
|
|
15170
15250
|
if (needResumeUITimer && !this.disableTimer) {
|
|
15171
|
-
this.
|
|
15251
|
+
this.onWidgetRequireResumeUI();
|
|
15172
15252
|
}
|
|
15173
15253
|
}
|
|
15174
15254
|
static api = {
|
|
15175
15255
|
widgetClassName: WidgetDataInput.widgetClassName,
|
|
15176
15256
|
onRefreshUserData: WidgetDataInput.onRefreshUserData,
|
|
15177
|
-
init: function (element, localData,
|
|
15178
|
-
WidgetDataInput.initWidget(element, localData, (element, options) => new WidgetDataInput(element, options,
|
|
15257
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
15258
|
+
WidgetDataInput.initWidget(element, localData, (element, options) => new WidgetDataInput(element, options, widgetCallbacks, sdkApi));
|
|
15179
15259
|
},
|
|
15180
15260
|
onStart: function (element) {
|
|
15181
15261
|
WidgetDataInput.getInstance(element)?.onStart();
|
|
@@ -15197,7 +15277,7 @@ class WidgetDataInput extends WidgetBase {
|
|
|
15197
15277
|
WidgetDataInput.getInstanceById(id)?.setUserText(text);
|
|
15198
15278
|
},
|
|
15199
15279
|
};
|
|
15200
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
15280
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
15201
15281
|
}
|
|
15202
15282
|
|
|
15203
15283
|
class WidgetDateCountdown extends WidgetBase {
|
|
@@ -15225,8 +15305,8 @@ class WidgetDateCountdown extends WidgetBase {
|
|
|
15225
15305
|
thirdGroup1;
|
|
15226
15306
|
thirdGroup2;
|
|
15227
15307
|
thirdGroupCaption;
|
|
15228
|
-
constructor(element, options,
|
|
15229
|
-
super(element, options,
|
|
15308
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
15309
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
15230
15310
|
this.label = this.element.querySelector(".label-view .label");
|
|
15231
15311
|
this.messages = {
|
|
15232
15312
|
days: getTagData(this.element, "tDays") ?? "",
|
|
@@ -15404,8 +15484,8 @@ class WidgetDateCountdown extends WidgetBase {
|
|
|
15404
15484
|
static api = {
|
|
15405
15485
|
widgetClassName: WidgetDateCountdown.widgetClassName,
|
|
15406
15486
|
onRefreshUserData: WidgetDateCountdown.onRefreshUserData,
|
|
15407
|
-
init: function (element, layers, localData,
|
|
15408
|
-
WidgetDateCountdown.initWidget(element, localData, (element, options) => new WidgetDateCountdown(element, { ...options, layers },
|
|
15487
|
+
init: function (element, layers, localData, widgetCallbacks, sdkApi) {
|
|
15488
|
+
WidgetDateCountdown.initWidget(element, localData, (element, options) => new WidgetDateCountdown(element, { ...options, layers }, widgetCallbacks, sdkApi));
|
|
15409
15489
|
},
|
|
15410
15490
|
onStart: function (element) {
|
|
15411
15491
|
WidgetDateCountdown.getInstance(element)?.onStart();
|
|
@@ -15420,7 +15500,7 @@ class WidgetDateCountdown extends WidgetBase {
|
|
|
15420
15500
|
WidgetDateCountdown.getInstance(element)?.onResume();
|
|
15421
15501
|
},
|
|
15422
15502
|
};
|
|
15423
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
15503
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
15424
15504
|
}
|
|
15425
15505
|
|
|
15426
15506
|
const displaySlide = function (slides, localData, sdkApi) {
|
|
@@ -15577,8 +15657,8 @@ class WidgetPoll extends WidgetBase {
|
|
|
15577
15657
|
* @param options
|
|
15578
15658
|
* @param onWidgetComplete
|
|
15579
15659
|
*/
|
|
15580
|
-
constructor(element, options,
|
|
15581
|
-
super(element, options,
|
|
15660
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
15661
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
15582
15662
|
this.label = this.element.querySelector(".label-view .label");
|
|
15583
15663
|
this.percentFillMask = this.element.querySelector(".percent-filled-variants-view-group-mask");
|
|
15584
15664
|
this.maskedVariants = slice.call(this.element.querySelectorAll(".variants-box .variants-view-group.percent-filled-variants-view-group .variant-view"));
|
|
@@ -15721,7 +15801,7 @@ class WidgetPoll extends WidgetBase {
|
|
|
15721
15801
|
const data = JSON.parse(dataString);
|
|
15722
15802
|
data.size = getElementBounding(this.env, this.elementRect);
|
|
15723
15803
|
if (!this.disableTimer) {
|
|
15724
|
-
this.
|
|
15804
|
+
this.onWidgetRequirePauseUI();
|
|
15725
15805
|
}
|
|
15726
15806
|
this.nativeDialogueWasOpened = false;
|
|
15727
15807
|
try {
|
|
@@ -15755,7 +15835,7 @@ class WidgetPoll extends WidgetBase {
|
|
|
15755
15835
|
const data = JSON.parse(dataString);
|
|
15756
15836
|
data.size = getElementBounding(this.env, this.elementRect);
|
|
15757
15837
|
if (!this.disableTimer) {
|
|
15758
|
-
this.
|
|
15838
|
+
this.onWidgetRequirePauseUI();
|
|
15759
15839
|
}
|
|
15760
15840
|
try {
|
|
15761
15841
|
data.text.value = data.text.value.replaceAll("\\n", "\n").replaceAll("\\r", "\r").replaceAll("\\t", "\t");
|
|
@@ -15997,7 +16077,7 @@ class WidgetPoll extends WidgetBase {
|
|
|
15997
16077
|
this._selectVariant(this.selectedVariant);
|
|
15998
16078
|
}
|
|
15999
16079
|
if (!this.disableTimer && this.nativeDialogueWasOpened) {
|
|
16000
|
-
this.
|
|
16080
|
+
this.onWidgetRequireResumeUI();
|
|
16001
16081
|
this.nativeDialogueWasOpened = false;
|
|
16002
16082
|
}
|
|
16003
16083
|
this.localData["_p_g_" + this.elementId + "_user_response_on_" + buttonPosition] = text;
|
|
@@ -16028,8 +16108,8 @@ class WidgetPoll extends WidgetBase {
|
|
|
16028
16108
|
static api = {
|
|
16029
16109
|
widgetClassName: WidgetPoll.widgetClassName,
|
|
16030
16110
|
onRefreshUserData: WidgetPoll.onRefreshUserData,
|
|
16031
|
-
init: function (element, localData,
|
|
16032
|
-
WidgetPoll.initWidget(element, localData, (element, options) => new WidgetPoll(element, options,
|
|
16111
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
16112
|
+
WidgetPoll.initWidget(element, localData, (element, options) => new WidgetPoll(element, options, widgetCallbacks, sdkApi));
|
|
16033
16113
|
},
|
|
16034
16114
|
onStart: function (element) {
|
|
16035
16115
|
WidgetPoll.getInstance(element)?.onStart();
|
|
@@ -16075,7 +16155,7 @@ class WidgetPoll extends WidgetBase {
|
|
|
16075
16155
|
}
|
|
16076
16156
|
},
|
|
16077
16157
|
};
|
|
16078
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
16158
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
16079
16159
|
}
|
|
16080
16160
|
|
|
16081
16161
|
class WidgetPollLayers extends WidgetBase {
|
|
@@ -16092,8 +16172,8 @@ class WidgetPollLayers extends WidgetBase {
|
|
|
16092
16172
|
variantsTexts;
|
|
16093
16173
|
selectedVariant;
|
|
16094
16174
|
layers;
|
|
16095
|
-
constructor(element, options,
|
|
16096
|
-
super(element, options,
|
|
16175
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
16176
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
16097
16177
|
this.layers = this.options.layers;
|
|
16098
16178
|
this.label = this.element.querySelector(".label-view .label");
|
|
16099
16179
|
this.variants = slice.call(this.element.querySelectorAll(".variants-box .variant-view"));
|
|
@@ -16205,8 +16285,8 @@ class WidgetPollLayers extends WidgetBase {
|
|
|
16205
16285
|
static api = {
|
|
16206
16286
|
widgetClassName: WidgetPollLayers.widgetClassName,
|
|
16207
16287
|
onRefreshUserData: WidgetPollLayers.onRefreshUserData,
|
|
16208
|
-
init: function (element, layers, localData,
|
|
16209
|
-
WidgetPollLayers.initWidget(element, localData, (element, options) => new WidgetPollLayers(element, { ...options, layers },
|
|
16288
|
+
init: function (element, layers, localData, widgetCallbacks, sdkApi) {
|
|
16289
|
+
WidgetPollLayers.initWidget(element, localData, (element, options) => new WidgetPollLayers(element, { ...options, layers }, widgetCallbacks, sdkApi));
|
|
16210
16290
|
},
|
|
16211
16291
|
onStart: function (element) {
|
|
16212
16292
|
WidgetPollLayers.getInstance(element)?.onStart();
|
|
@@ -16230,7 +16310,7 @@ class WidgetPollLayers extends WidgetBase {
|
|
|
16230
16310
|
return false;
|
|
16231
16311
|
},
|
|
16232
16312
|
};
|
|
16233
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
16313
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
16234
16314
|
}
|
|
16235
16315
|
|
|
16236
16316
|
class Formatter {
|
|
@@ -16857,8 +16937,8 @@ class WidgetProducts extends WidgetBase {
|
|
|
16857
16937
|
swipeGestureDetector = null;
|
|
16858
16938
|
isClickCapturedByWidget = false;
|
|
16859
16939
|
isScreenSupportsTouch = false;
|
|
16860
|
-
constructor(element, options,
|
|
16861
|
-
super(element, options,
|
|
16940
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
16941
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
16862
16942
|
this.captionView = this.element.querySelector(".narrative-element-text-lines");
|
|
16863
16943
|
const linkTarget = decodeURIComponent(getTagData(element, "linkTarget") ?? "[]");
|
|
16864
16944
|
try {
|
|
@@ -17095,7 +17175,7 @@ class WidgetProducts extends WidgetBase {
|
|
|
17095
17175
|
}
|
|
17096
17176
|
this._statEventWidgetClick();
|
|
17097
17177
|
if (!this.disableTimer) {
|
|
17098
|
-
this.
|
|
17178
|
+
this.onWidgetRequirePauseUI();
|
|
17099
17179
|
}
|
|
17100
17180
|
if (!this.isTransparentElement()) {
|
|
17101
17181
|
this.element.classList.add("loader");
|
|
@@ -17146,7 +17226,7 @@ class WidgetProducts extends WidgetBase {
|
|
|
17146
17226
|
this.productsView?.parentElement?.removeChild(this.productsView);
|
|
17147
17227
|
this.revokeOffersMediaResources(this.currentModels);
|
|
17148
17228
|
if (!this.disableTimer) {
|
|
17149
|
-
this.
|
|
17229
|
+
this.onWidgetRequireResumeUI();
|
|
17150
17230
|
}
|
|
17151
17231
|
this.isOpen = false;
|
|
17152
17232
|
this.currentModels = [];
|
|
@@ -17335,8 +17415,8 @@ class WidgetProducts extends WidgetBase {
|
|
|
17335
17415
|
static api = {
|
|
17336
17416
|
widgetClassName: WidgetProducts.widgetClassName,
|
|
17337
17417
|
onRefreshUserData: WidgetProducts.onRefreshUserData,
|
|
17338
|
-
init: function (element, localData,
|
|
17339
|
-
WidgetProducts.initWidget(element, localData, (element, options) => new WidgetProducts(element, options,
|
|
17418
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
17419
|
+
WidgetProducts.initWidget(element, localData, (element, options) => new WidgetProducts(element, options, widgetCallbacks, sdkApi));
|
|
17340
17420
|
},
|
|
17341
17421
|
onStart: function (element) {
|
|
17342
17422
|
WidgetProducts.getInstance(element)?.onStart();
|
|
@@ -17385,7 +17465,7 @@ class WidgetProducts extends WidgetBase {
|
|
|
17385
17465
|
return false;
|
|
17386
17466
|
},
|
|
17387
17467
|
};
|
|
17388
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
17468
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
17389
17469
|
}
|
|
17390
17470
|
|
|
17391
17471
|
class WidgetQuest extends WidgetBase {
|
|
@@ -17405,11 +17485,11 @@ class WidgetQuest extends WidgetBase {
|
|
|
17405
17485
|
navigationNextSlide;
|
|
17406
17486
|
slideDisabledNavigation;
|
|
17407
17487
|
finalSlide;
|
|
17408
|
-
constructor(element, options,
|
|
17488
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
17409
17489
|
const isWidget = !hasClass(element, "narrative-slide");
|
|
17410
17490
|
const elementIdGetter = (element) => getValueOrDefault(getTagData(element, "elementId"), "");
|
|
17411
17491
|
const slideGetter = (element) => isWidget ? getValueOrException(element.closest(".narrative-slide"), "Empty slide") : element;
|
|
17412
|
-
super(element, options,
|
|
17492
|
+
super(element, options, widgetCallbacks, sdkApi, elementIdGetter, slideGetter);
|
|
17413
17493
|
this.isWidget = isWidget;
|
|
17414
17494
|
this.slideCount = getTagDataAsNumber(this.slide, "slideCount") ?? 0;
|
|
17415
17495
|
const nonFinalSlide = getTagDataAsNumber(this.slide, "nonFinalSlide");
|
|
@@ -17716,9 +17796,9 @@ class WidgetQuest extends WidgetBase {
|
|
|
17716
17796
|
static api = {
|
|
17717
17797
|
widgetClassName: WidgetQuest.widgetClassName,
|
|
17718
17798
|
onRefreshUserData: WidgetQuest.onRefreshUserData,
|
|
17719
|
-
init: function (element, localData,
|
|
17799
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
17720
17800
|
return new Promise(function (resolve, reject) {
|
|
17721
|
-
WidgetQuest.initWidget(element, localData, (element, options) => new WidgetQuest(element, options,
|
|
17801
|
+
WidgetQuest.initWidget(element, localData, (element, options) => new WidgetQuest(element, options, widgetCallbacks, sdkApi)).then(localData => {
|
|
17722
17802
|
const widget = WidgetQuest.getInstance(element);
|
|
17723
17803
|
if (widget) {
|
|
17724
17804
|
resolve(widget.init());
|
|
@@ -17760,7 +17840,7 @@ class WidgetQuest extends WidgetBase {
|
|
|
17760
17840
|
return { continueDefaultNavigation: true };
|
|
17761
17841
|
},
|
|
17762
17842
|
};
|
|
17763
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
17843
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
17764
17844
|
}
|
|
17765
17845
|
|
|
17766
17846
|
class WidgetQuiz extends WidgetBase {
|
|
@@ -17775,8 +17855,8 @@ class WidgetQuiz extends WidgetBase {
|
|
|
17775
17855
|
answers;
|
|
17776
17856
|
questionCount;
|
|
17777
17857
|
selectedAnswer;
|
|
17778
|
-
constructor(element, options,
|
|
17779
|
-
super(element, options,
|
|
17858
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
17859
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
17780
17860
|
this.question = this.element.querySelector(".label-view .label");
|
|
17781
17861
|
this.answers = slice.call(this.element.querySelectorAll(".variants-box .variant-view-group"));
|
|
17782
17862
|
this.questionCount = getValueOrException(getTagDataAsNumber(this.slide, "quizCount"), "Empty quizCount");
|
|
@@ -17924,8 +18004,8 @@ class WidgetQuiz extends WidgetBase {
|
|
|
17924
18004
|
static api = {
|
|
17925
18005
|
widgetClassName: WidgetQuiz.widgetClassName,
|
|
17926
18006
|
onRefreshUserData: WidgetQuiz.onRefreshUserData,
|
|
17927
|
-
init: function (element, localData,
|
|
17928
|
-
WidgetQuiz.initWidget(element, localData, (element, options) => new WidgetQuiz(element, options,
|
|
18007
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
18008
|
+
WidgetQuiz.initWidget(element, localData, (element, options) => new WidgetQuiz(element, options, widgetCallbacks, sdkApi));
|
|
17929
18009
|
},
|
|
17930
18010
|
onStart: function (element) {
|
|
17931
18011
|
WidgetQuiz.getInstance(element)?.onStart();
|
|
@@ -17954,7 +18034,7 @@ class WidgetQuiz extends WidgetBase {
|
|
|
17954
18034
|
return true;
|
|
17955
18035
|
},
|
|
17956
18036
|
};
|
|
17957
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
18037
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
17958
18038
|
}
|
|
17959
18039
|
|
|
17960
18040
|
class WidgetQuizGrouped extends WidgetBase {
|
|
@@ -17976,8 +18056,8 @@ class WidgetQuizGrouped extends WidgetBase {
|
|
|
17976
18056
|
* @param onWidgetComplete
|
|
17977
18057
|
* @param sdkApi
|
|
17978
18058
|
*/
|
|
17979
|
-
constructor(element, options,
|
|
17980
|
-
super(element, options,
|
|
18059
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
18060
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
17981
18061
|
this.question = this.element.querySelector(".label-view .label");
|
|
17982
18062
|
this.answers = slice.call(this.element.querySelectorAll(".variants-box .variant-view-group"));
|
|
17983
18063
|
this.questionCount = getValueOrException(getTagDataAsNumber(this.slide, "quizCount"), "Empty quizCount");
|
|
@@ -18129,8 +18209,8 @@ class WidgetQuizGrouped extends WidgetBase {
|
|
|
18129
18209
|
static api = {
|
|
18130
18210
|
widgetClassName: WidgetQuizGrouped.widgetClassName,
|
|
18131
18211
|
onRefreshUserData: WidgetQuizGrouped.onRefreshUserData,
|
|
18132
|
-
init: function (element, localData,
|
|
18133
|
-
WidgetQuizGrouped.initWidget(element, localData, (element, options) => new WidgetQuizGrouped(element, options,
|
|
18212
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
18213
|
+
WidgetQuizGrouped.initWidget(element, localData, (element, options) => new WidgetQuizGrouped(element, options, widgetCallbacks, sdkApi));
|
|
18134
18214
|
},
|
|
18135
18215
|
onStart: function (element) {
|
|
18136
18216
|
WidgetQuizGrouped.getInstance(element)?.onStart();
|
|
@@ -18159,7 +18239,7 @@ class WidgetQuizGrouped extends WidgetBase {
|
|
|
18159
18239
|
return true;
|
|
18160
18240
|
},
|
|
18161
18241
|
};
|
|
18162
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
18242
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
18163
18243
|
}
|
|
18164
18244
|
|
|
18165
18245
|
// Polyfill Number.isNaN(value)
|
|
@@ -18331,8 +18411,8 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
18331
18411
|
* @param options
|
|
18332
18412
|
* @param onWidgetComplete
|
|
18333
18413
|
*/
|
|
18334
|
-
constructor(element, options,
|
|
18335
|
-
super(element, options,
|
|
18414
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
18415
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
18336
18416
|
this.hasSubmitButton = Boolean(this.element.querySelector(".submit-button-view"));
|
|
18337
18417
|
this.topScale = this.element.querySelector(".top-scale-bar-view-group");
|
|
18338
18418
|
this.snapPosition = false;
|
|
@@ -18777,8 +18857,8 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
18777
18857
|
static api = {
|
|
18778
18858
|
widgetClassName: WidgetRangeSlider.widgetClassName,
|
|
18779
18859
|
onRefreshUserData: WidgetRangeSlider.onRefreshUserData,
|
|
18780
|
-
init: function (element, localData,
|
|
18781
|
-
WidgetRangeSlider.initWidget(element, localData, (element, options) => new WidgetRangeSlider(element, options,
|
|
18860
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
18861
|
+
WidgetRangeSlider.initWidget(element, localData, (element, options) => new WidgetRangeSlider(element, options, widgetCallbacks, sdkApi));
|
|
18782
18862
|
},
|
|
18783
18863
|
onStart: function (element) {
|
|
18784
18864
|
WidgetRangeSlider.getInstance(element)?.onStart();
|
|
@@ -18807,7 +18887,7 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
18807
18887
|
return false;
|
|
18808
18888
|
},
|
|
18809
18889
|
};
|
|
18810
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
18890
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
18811
18891
|
}
|
|
18812
18892
|
|
|
18813
18893
|
class WidgetRate extends WidgetBase {
|
|
@@ -18830,8 +18910,8 @@ class WidgetRate extends WidgetBase {
|
|
|
18830
18910
|
selectedStar;
|
|
18831
18911
|
answerSelectDuration;
|
|
18832
18912
|
elementRect;
|
|
18833
|
-
constructor(element, options,
|
|
18834
|
-
super(element, options,
|
|
18913
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
18914
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
18835
18915
|
this.label = this.element.querySelector(".label-view .label");
|
|
18836
18916
|
this.stars = slice.call(this.element.querySelectorAll(".input-view"));
|
|
18837
18917
|
this.submitToStores = Boolean(getValueOrDefault(getTagDataAsNumber(this.element, "submitToStores"), 0));
|
|
@@ -18945,7 +19025,7 @@ class WidgetRate extends WidgetBase {
|
|
|
18945
19025
|
const data = JSON.parse(dataString);
|
|
18946
19026
|
data.size = getElementBounding(this.env, this.elementRect);
|
|
18947
19027
|
if (!this.disableTimer) {
|
|
18948
|
-
this.
|
|
19028
|
+
this.onWidgetRequirePauseUI();
|
|
18949
19029
|
}
|
|
18950
19030
|
this.nativeDialogueWasOpened = true;
|
|
18951
19031
|
try {
|
|
@@ -19003,7 +19083,7 @@ class WidgetRate extends WidgetBase {
|
|
|
19003
19083
|
this._selectStar(this.selectedStar, true);
|
|
19004
19084
|
}
|
|
19005
19085
|
if (!this.disableTimer && this.nativeDialogueWasOpened) {
|
|
19006
|
-
this.
|
|
19086
|
+
this.onWidgetRequireResumeUI();
|
|
19007
19087
|
this.nativeDialogueWasOpened = false;
|
|
19008
19088
|
}
|
|
19009
19089
|
this.localData["_r_g_" + this.elementId + "_user_response"] = text;
|
|
@@ -19034,8 +19114,8 @@ class WidgetRate extends WidgetBase {
|
|
|
19034
19114
|
static api = {
|
|
19035
19115
|
widgetClassName: WidgetRate.widgetClassName,
|
|
19036
19116
|
onRefreshUserData: WidgetRate.onRefreshUserData,
|
|
19037
|
-
init: function (element, localData,
|
|
19038
|
-
WidgetRate.initWidget(element, localData, (element, options) => new WidgetRate(element, options,
|
|
19117
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
19118
|
+
WidgetRate.initWidget(element, localData, (element, options) => new WidgetRate(element, options, widgetCallbacks, sdkApi));
|
|
19039
19119
|
},
|
|
19040
19120
|
onStart: function (element) {
|
|
19041
19121
|
WidgetRate.getInstance(element)?.onStart();
|
|
@@ -19064,7 +19144,7 @@ class WidgetRate extends WidgetBase {
|
|
|
19064
19144
|
WidgetRate.getInstanceById(id)?.setUserText(text);
|
|
19065
19145
|
},
|
|
19066
19146
|
};
|
|
19067
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
19147
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
19068
19148
|
}
|
|
19069
19149
|
|
|
19070
19150
|
class WidgetShare extends WidgetBase {
|
|
@@ -19081,8 +19161,8 @@ class WidgetShare extends WidgetBase {
|
|
|
19081
19161
|
shareTarget;
|
|
19082
19162
|
withLayer;
|
|
19083
19163
|
btnDisabled;
|
|
19084
|
-
constructor(element, options,
|
|
19085
|
-
super(element, options,
|
|
19164
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
19165
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
19086
19166
|
this.shareType = getTagData(this.element, "shareType");
|
|
19087
19167
|
this.shareTarget = getTagData(this.element, "shareTarget");
|
|
19088
19168
|
this.layers = this.options.layers;
|
|
@@ -19174,11 +19254,11 @@ class WidgetShare extends WidgetBase {
|
|
|
19174
19254
|
static api = {
|
|
19175
19255
|
widgetClassName: WidgetShare.widgetClassName,
|
|
19176
19256
|
onRefreshUserData: WidgetShare.onRefreshUserData,
|
|
19177
|
-
init: function (element, layers, localData,
|
|
19257
|
+
init: function (element, layers, localData, widgetCallbacks, sdkApi) {
|
|
19178
19258
|
WidgetShare.initWidget(element, localData, (element, options) => new WidgetShare(element, {
|
|
19179
19259
|
...options,
|
|
19180
19260
|
layers,
|
|
19181
|
-
},
|
|
19261
|
+
}, widgetCallbacks, sdkApi));
|
|
19182
19262
|
},
|
|
19183
19263
|
onStart: function (element) {
|
|
19184
19264
|
WidgetShare.getInstance(element)?.onStart();
|
|
@@ -19199,7 +19279,7 @@ class WidgetShare extends WidgetBase {
|
|
|
19199
19279
|
WidgetShare.getInstanceById(id)?._complete(isSuccess);
|
|
19200
19280
|
},
|
|
19201
19281
|
};
|
|
19202
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
19282
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
19203
19283
|
}
|
|
19204
19284
|
|
|
19205
19285
|
class WidgetTest extends WidgetBase {
|
|
@@ -19224,8 +19304,8 @@ class WidgetTest extends WidgetBase {
|
|
|
19224
19304
|
timeLeftDefault;
|
|
19225
19305
|
timeline;
|
|
19226
19306
|
isWidgetTimerInit = false;
|
|
19227
|
-
constructor(element, options,
|
|
19228
|
-
super(element, options,
|
|
19307
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
19308
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
19229
19309
|
this.label = this.element.querySelector(".label-view .label");
|
|
19230
19310
|
this.variants = slice.call(this.element.querySelectorAll(".variants-box .variant-view"));
|
|
19231
19311
|
this.testCount = getValueOrException(getTagDataAsNumber(this.slide, "testCount"), "Empty testCount");
|
|
@@ -19453,8 +19533,8 @@ class WidgetTest extends WidgetBase {
|
|
|
19453
19533
|
static api = {
|
|
19454
19534
|
widgetClassName: WidgetTest.widgetClassName,
|
|
19455
19535
|
onRefreshUserData: WidgetTest.onRefreshUserData,
|
|
19456
|
-
init: function (element, localData,
|
|
19457
|
-
WidgetTest.initWidget(element, localData, (element, options) => new WidgetTest(element, options,
|
|
19536
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
19537
|
+
WidgetTest.initWidget(element, localData, (element, options) => new WidgetTest(element, options, widgetCallbacks, sdkApi));
|
|
19458
19538
|
},
|
|
19459
19539
|
onStart: function (element) {
|
|
19460
19540
|
WidgetTest.getInstance(element)?.onStart();
|
|
@@ -19490,7 +19570,7 @@ class WidgetTest extends WidgetBase {
|
|
|
19490
19570
|
return true;
|
|
19491
19571
|
},
|
|
19492
19572
|
};
|
|
19493
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
19573
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
19494
19574
|
}
|
|
19495
19575
|
|
|
19496
19576
|
class WidgetVote extends WidgetBase {
|
|
@@ -19519,8 +19599,8 @@ class WidgetVote extends WidgetBase {
|
|
|
19519
19599
|
* @param onWidgetComplete
|
|
19520
19600
|
* @param sdkApi
|
|
19521
19601
|
*/
|
|
19522
|
-
constructor(element, options,
|
|
19523
|
-
super(element, options,
|
|
19602
|
+
constructor(element, options, widgetCallbacks, sdkApi) {
|
|
19603
|
+
super(element, options, widgetCallbacks, sdkApi);
|
|
19524
19604
|
this.voteAllocation = getTagData(this.slide, "voteAllocation");
|
|
19525
19605
|
this.label = this.element.querySelector(".label-view .label");
|
|
19526
19606
|
this.variants = slice.call(this.element.querySelectorAll(".variants-box .variant-view-group"));
|
|
@@ -19903,8 +19983,8 @@ class WidgetVote extends WidgetBase {
|
|
|
19903
19983
|
static api = {
|
|
19904
19984
|
widgetClassName: WidgetVote.widgetClassName,
|
|
19905
19985
|
onRefreshUserData: WidgetVote.onRefreshUserData,
|
|
19906
|
-
init: function (element, localData,
|
|
19907
|
-
WidgetVote.initWidget(element, localData, (element, options) => new WidgetVote(element, options,
|
|
19986
|
+
init: function (element, localData, widgetCallbacks, sdkApi) {
|
|
19987
|
+
WidgetVote.initWidget(element, localData, (element, options) => new WidgetVote(element, options, widgetCallbacks, sdkApi));
|
|
19908
19988
|
},
|
|
19909
19989
|
onStart: function (element) {
|
|
19910
19990
|
WidgetVote.getInstance(element)?.onStart();
|
|
@@ -19940,7 +20020,7 @@ class WidgetVote extends WidgetBase {
|
|
|
19940
20020
|
return true;
|
|
19941
20021
|
},
|
|
19942
20022
|
};
|
|
19943
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `
|
|
20023
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
|
|
19944
20024
|
}
|
|
19945
20025
|
|
|
19946
20026
|
class EsModuleLayoutApi {
|