@microsoft/teams-js 2.7.2-beta.0 → 2.8.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1078,6 +1078,7 @@ __webpack_require__.d(__webpack_exports__, {
1078
1078
  "executeDeepLink": () => (/* reexport */ executeDeepLink),
1079
1079
  "files": () => (/* reexport */ files),
1080
1080
  "geoLocation": () => (/* reexport */ geoLocation),
1081
+ "getAdaptiveCardSchemaVersion": () => (/* reexport */ getAdaptiveCardSchemaVersion),
1081
1082
  "getContext": () => (/* reexport */ getContext),
1082
1083
  "getMruTabInstances": () => (/* reexport */ getMruTabInstances),
1083
1084
  "getTabInstances": () => (/* reexport */ getTabInstances),
@@ -1332,12 +1333,224 @@ function getLogger(namespace) {
1332
1333
 
1333
1334
  // EXTERNAL MODULE: ../../node_modules/uuid/index.js
1334
1335
  var uuid = __webpack_require__(22);
1336
+ ;// CONCATENATED MODULE: ./src/public/interfaces.ts
1337
+ /* eslint-disable @typescript-eslint/no-explicit-any*/
1338
+ /**
1339
+ * Allowed user file open preferences
1340
+ */
1341
+ var FileOpenPreference;
1342
+ (function (FileOpenPreference) {
1343
+ FileOpenPreference["Inline"] = "inline";
1344
+ FileOpenPreference["Desktop"] = "desktop";
1345
+ FileOpenPreference["Web"] = "web";
1346
+ })(FileOpenPreference || (FileOpenPreference = {}));
1347
+ /**
1348
+ * Possible Action Types
1349
+ *
1350
+ * @beta
1351
+ */
1352
+ var ActionObjectType;
1353
+ (function (ActionObjectType) {
1354
+ ActionObjectType["M365Content"] = "m365content";
1355
+ })(ActionObjectType || (ActionObjectType = {}));
1356
+ /**
1357
+ * These correspond with field names in the MSGraph
1358
+ *
1359
+ * @beta
1360
+ */
1361
+ var SecondaryM365ContentIdName;
1362
+ (function (SecondaryM365ContentIdName) {
1363
+ SecondaryM365ContentIdName["DriveId"] = "driveId";
1364
+ SecondaryM365ContentIdName["GroupId"] = "groupId";
1365
+ SecondaryM365ContentIdName["SiteId"] = "siteId";
1366
+ SecondaryM365ContentIdName["UserId"] = "userId";
1367
+ })(SecondaryM365ContentIdName || (SecondaryM365ContentIdName = {}));
1368
+ var ErrorCode;
1369
+ (function (ErrorCode) {
1370
+ /**
1371
+ * API not supported in the current platform.
1372
+ */
1373
+ ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
1374
+ /**
1375
+ * Internal error encountered while performing the required operation.
1376
+ */
1377
+ ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
1378
+ /**
1379
+ * API is not supported in the current context
1380
+ */
1381
+ ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
1382
+ /**
1383
+ Permissions denied by user
1384
+ */
1385
+ ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
1386
+ /**
1387
+ * Network issue
1388
+ */
1389
+ ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
1390
+ /**
1391
+ * Underlying hardware doesn't support the capability
1392
+ */
1393
+ ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
1394
+ /**
1395
+ * One or more arguments are invalid
1396
+ */
1397
+ ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
1398
+ /**
1399
+ * User is not authorized for this operation
1400
+ */
1401
+ ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
1402
+ /**
1403
+ * Could not complete the operation due to insufficient resources
1404
+ */
1405
+ ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
1406
+ /**
1407
+ * Platform throttled the request because of API was invoked too frequently
1408
+ */
1409
+ ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
1410
+ /**
1411
+ * User aborted the operation
1412
+ */
1413
+ ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
1414
+ /**
1415
+ * Could not complete the operation in the given time interval
1416
+ */
1417
+ ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
1418
+ /**
1419
+ * Platform code is old and doesn't implement this API
1420
+ */
1421
+ ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
1422
+ /**
1423
+ * The file specified was not found on the given location
1424
+ */
1425
+ ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
1426
+ /**
1427
+ * The return value is too big and has exceeded our size boundries
1428
+ */
1429
+ ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
1430
+ })(ErrorCode || (ErrorCode = {}));
1431
+ /** @hidden */
1432
+ var DevicePermission;
1433
+ (function (DevicePermission) {
1434
+ DevicePermission["GeoLocation"] = "geolocation";
1435
+ DevicePermission["Media"] = "media";
1436
+ })(DevicePermission || (DevicePermission = {}));
1437
+
1438
+ ;// CONCATENATED MODULE: ./src/public/constants.ts
1439
+ var HostClientType;
1440
+ (function (HostClientType) {
1441
+ HostClientType["desktop"] = "desktop";
1442
+ HostClientType["web"] = "web";
1443
+ HostClientType["android"] = "android";
1444
+ HostClientType["ios"] = "ios";
1445
+ HostClientType["ipados"] = "ipados";
1446
+ /**
1447
+ * @deprecated
1448
+ * As of 2.0.0, please use {@link teamsRoomsWindows} instead.
1449
+ */
1450
+ HostClientType["rigel"] = "rigel";
1451
+ HostClientType["surfaceHub"] = "surfaceHub";
1452
+ HostClientType["teamsRoomsWindows"] = "teamsRoomsWindows";
1453
+ HostClientType["teamsRoomsAndroid"] = "teamsRoomsAndroid";
1454
+ HostClientType["teamsPhones"] = "teamsPhones";
1455
+ HostClientType["teamsDisplays"] = "teamsDisplays";
1456
+ })(HostClientType || (HostClientType = {}));
1457
+ var HostName;
1458
+ (function (HostName) {
1459
+ /**
1460
+ * Office.com and Office Windows App
1461
+ */
1462
+ HostName["office"] = "Office";
1463
+ /**
1464
+ * For "desktop" specifically, this refers to the new, pre-release version of Outlook for Windows.
1465
+ * Also used on other platforms that map to a single Outlook client.
1466
+ */
1467
+ HostName["outlook"] = "Outlook";
1468
+ /**
1469
+ * Outlook for Windows: the classic, native, desktop client
1470
+ */
1471
+ HostName["outlookWin32"] = "OutlookWin32";
1472
+ /**
1473
+ * Microsoft-internal test Host
1474
+ */
1475
+ HostName["orange"] = "Orange";
1476
+ /**
1477
+ * Teams
1478
+ */
1479
+ HostName["teams"] = "Teams";
1480
+ })(HostName || (HostName = {}));
1481
+ // Ensure these declarations stay in sync with the framework.
1482
+ var FrameContexts;
1483
+ (function (FrameContexts) {
1484
+ FrameContexts["settings"] = "settings";
1485
+ FrameContexts["content"] = "content";
1486
+ FrameContexts["authentication"] = "authentication";
1487
+ FrameContexts["remove"] = "remove";
1488
+ FrameContexts["task"] = "task";
1489
+ FrameContexts["sidePanel"] = "sidePanel";
1490
+ FrameContexts["stage"] = "stage";
1491
+ FrameContexts["meetingStage"] = "meetingStage";
1492
+ })(FrameContexts || (FrameContexts = {}));
1493
+ /**
1494
+ * Indicates the team type, currently used to distinguish between different team
1495
+ * types in Office 365 for Education (team types 1, 2, 3, and 4).
1496
+ */
1497
+ var TeamType;
1498
+ (function (TeamType) {
1499
+ TeamType[TeamType["Standard"] = 0] = "Standard";
1500
+ TeamType[TeamType["Edu"] = 1] = "Edu";
1501
+ TeamType[TeamType["Class"] = 2] = "Class";
1502
+ TeamType[TeamType["Plc"] = 3] = "Plc";
1503
+ TeamType[TeamType["Staff"] = 4] = "Staff";
1504
+ })(TeamType || (TeamType = {}));
1505
+ /**
1506
+ * Indicates the various types of roles of a user in a team.
1507
+ */
1508
+ var UserTeamRole;
1509
+ (function (UserTeamRole) {
1510
+ UserTeamRole[UserTeamRole["Admin"] = 0] = "Admin";
1511
+ UserTeamRole[UserTeamRole["User"] = 1] = "User";
1512
+ UserTeamRole[UserTeamRole["Guest"] = 2] = "Guest";
1513
+ })(UserTeamRole || (UserTeamRole = {}));
1514
+ /**
1515
+ * Dialog module dimension enum
1516
+ */
1517
+ var DialogDimension;
1518
+ (function (DialogDimension) {
1519
+ DialogDimension["Large"] = "large";
1520
+ DialogDimension["Medium"] = "medium";
1521
+ DialogDimension["Small"] = "small";
1522
+ })(DialogDimension || (DialogDimension = {}));
1523
+
1524
+ /**
1525
+ * @deprecated
1526
+ * As of 2.0.0, please use {@link DialogDimension} instead.
1527
+ */
1528
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1529
+ var TaskModuleDimension = DialogDimension;
1530
+ /**
1531
+ * The type of the channel with which the content is associated.
1532
+ */
1533
+ var ChannelType;
1534
+ (function (ChannelType) {
1535
+ ChannelType["Regular"] = "Regular";
1536
+ ChannelType["Private"] = "Private";
1537
+ ChannelType["Shared"] = "Shared";
1538
+ })(ChannelType || (ChannelType = {}));
1539
+ var errorNotSupportedOnPlatform = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
1540
+ /**
1541
+ * @hidden
1542
+ *
1543
+ * Minimum Adaptive Card version supported by the host.
1544
+ */
1545
+ var minAdaptiveCardVersion = { majorVersion: 1, minorVersion: 5 };
1546
+
1335
1547
  ;// CONCATENATED MODULE: ./src/internal/utils.ts
1336
1548
  /* eslint-disable @typescript-eslint/ban-types */
1337
1549
  /* eslint-disable @typescript-eslint/no-unused-vars */
1338
1550
 
1339
1551
 
1340
1552
 
1553
+
1341
1554
  /**
1342
1555
  * @param pattern - reference pattern
1343
1556
  * @param host - candidate string
@@ -1656,211 +1869,22 @@ function createTeamsAppLink(params) {
1656
1869
  }
1657
1870
  return url.toString();
1658
1871
  }
1659
-
1660
- ;// CONCATENATED MODULE: ./src/public/interfaces.ts
1661
- /* eslint-disable @typescript-eslint/no-explicit-any*/
1662
- /**
1663
- * Allowed user file open preferences
1664
- */
1665
- var FileOpenPreference;
1666
- (function (FileOpenPreference) {
1667
- FileOpenPreference["Inline"] = "inline";
1668
- FileOpenPreference["Desktop"] = "desktop";
1669
- FileOpenPreference["Web"] = "web";
1670
- })(FileOpenPreference || (FileOpenPreference = {}));
1671
- /**
1672
- * Possible Action Types
1673
- *
1674
- * @beta
1675
- */
1676
- var ActionObjectType;
1677
- (function (ActionObjectType) {
1678
- ActionObjectType["M365Content"] = "m365content";
1679
- })(ActionObjectType || (ActionObjectType = {}));
1680
1872
  /**
1681
- * These correspond with field names in the MSGraph
1873
+ * @hidden
1874
+ * Checks if the Adaptive Card schema version is supported by the host.
1875
+ * @param hostAdaptiveCardSchemaVersion Host's supported Adaptive Card version in the runtime.
1682
1876
  *
1683
- * @beta
1877
+ * @returns true if the Adaptive Card Version is not supported and false if it is supported.
1684
1878
  */
1685
- var SecondaryM365ContentIdName;
1686
- (function (SecondaryM365ContentIdName) {
1687
- SecondaryM365ContentIdName["DriveId"] = "driveId";
1688
- SecondaryM365ContentIdName["GroupId"] = "groupId";
1689
- SecondaryM365ContentIdName["SiteId"] = "siteId";
1690
- SecondaryM365ContentIdName["UserId"] = "userId";
1691
- })(SecondaryM365ContentIdName || (SecondaryM365ContentIdName = {}));
1692
- var ErrorCode;
1693
- (function (ErrorCode) {
1694
- /**
1695
- * API not supported in the current platform.
1696
- */
1697
- ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
1698
- /**
1699
- * Internal error encountered while performing the required operation.
1700
- */
1701
- ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
1702
- /**
1703
- * API is not supported in the current context
1704
- */
1705
- ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
1706
- /**
1707
- Permissions denied by user
1708
- */
1709
- ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
1710
- /**
1711
- * Network issue
1712
- */
1713
- ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
1714
- /**
1715
- * Underlying hardware doesn't support the capability
1716
- */
1717
- ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
1718
- /**
1719
- * One or more arguments are invalid
1720
- */
1721
- ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
1722
- /**
1723
- * User is not authorized for this operation
1724
- */
1725
- ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
1726
- /**
1727
- * Could not complete the operation due to insufficient resources
1728
- */
1729
- ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
1730
- /**
1731
- * Platform throttled the request because of API was invoked too frequently
1732
- */
1733
- ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
1734
- /**
1735
- * User aborted the operation
1736
- */
1737
- ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
1738
- /**
1739
- * Could not complete the operation in the given time interval
1740
- */
1741
- ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
1742
- /**
1743
- * Platform code is old and doesn't implement this API
1744
- */
1745
- ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
1746
- /**
1747
- * The file specified was not found on the given location
1748
- */
1749
- ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
1750
- /**
1751
- * The return value is too big and has exceeded our size boundries
1752
- */
1753
- ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
1754
- })(ErrorCode || (ErrorCode = {}));
1755
- /** @hidden */
1756
- var DevicePermission;
1757
- (function (DevicePermission) {
1758
- DevicePermission["GeoLocation"] = "geolocation";
1759
- DevicePermission["Media"] = "media";
1760
- })(DevicePermission || (DevicePermission = {}));
1761
-
1762
- ;// CONCATENATED MODULE: ./src/public/constants.ts
1763
- var HostClientType;
1764
- (function (HostClientType) {
1765
- HostClientType["desktop"] = "desktop";
1766
- HostClientType["web"] = "web";
1767
- HostClientType["android"] = "android";
1768
- HostClientType["ios"] = "ios";
1769
- HostClientType["ipados"] = "ipados";
1770
- /**
1771
- * @deprecated
1772
- * As of 2.0.0, please use {@link teamsRoomsWindows} instead.
1773
- */
1774
- HostClientType["rigel"] = "rigel";
1775
- HostClientType["surfaceHub"] = "surfaceHub";
1776
- HostClientType["teamsRoomsWindows"] = "teamsRoomsWindows";
1777
- HostClientType["teamsRoomsAndroid"] = "teamsRoomsAndroid";
1778
- HostClientType["teamsPhones"] = "teamsPhones";
1779
- HostClientType["teamsDisplays"] = "teamsDisplays";
1780
- })(HostClientType || (HostClientType = {}));
1781
- var HostName;
1782
- (function (HostName) {
1783
- /**
1784
- * Office.com and Office Windows App
1785
- */
1786
- HostName["office"] = "Office";
1787
- /**
1788
- * For "desktop" specifically, this refers to the new, pre-release version of Outlook for Windows.
1789
- * Also used on other platforms that map to a single Outlook client.
1790
- */
1791
- HostName["outlook"] = "Outlook";
1792
- /**
1793
- * Outlook for Windows: the classic, native, desktop client
1794
- */
1795
- HostName["outlookWin32"] = "OutlookWin32";
1796
- /**
1797
- * Microsoft-internal test Host
1798
- */
1799
- HostName["orange"] = "Orange";
1800
- /**
1801
- * Teams
1802
- */
1803
- HostName["teams"] = "Teams";
1804
- })(HostName || (HostName = {}));
1805
- // Ensure these declarations stay in sync with the framework.
1806
- var FrameContexts;
1807
- (function (FrameContexts) {
1808
- FrameContexts["settings"] = "settings";
1809
- FrameContexts["content"] = "content";
1810
- FrameContexts["authentication"] = "authentication";
1811
- FrameContexts["remove"] = "remove";
1812
- FrameContexts["task"] = "task";
1813
- FrameContexts["sidePanel"] = "sidePanel";
1814
- FrameContexts["stage"] = "stage";
1815
- FrameContexts["meetingStage"] = "meetingStage";
1816
- })(FrameContexts || (FrameContexts = {}));
1817
- /**
1818
- * Indicates the team type, currently used to distinguish between different team
1819
- * types in Office 365 for Education (team types 1, 2, 3, and 4).
1820
- */
1821
- var TeamType;
1822
- (function (TeamType) {
1823
- TeamType[TeamType["Standard"] = 0] = "Standard";
1824
- TeamType[TeamType["Edu"] = 1] = "Edu";
1825
- TeamType[TeamType["Class"] = 2] = "Class";
1826
- TeamType[TeamType["Plc"] = 3] = "Plc";
1827
- TeamType[TeamType["Staff"] = 4] = "Staff";
1828
- })(TeamType || (TeamType = {}));
1829
- /**
1830
- * Indicates the various types of roles of a user in a team.
1831
- */
1832
- var UserTeamRole;
1833
- (function (UserTeamRole) {
1834
- UserTeamRole[UserTeamRole["Admin"] = 0] = "Admin";
1835
- UserTeamRole[UserTeamRole["User"] = 1] = "User";
1836
- UserTeamRole[UserTeamRole["Guest"] = 2] = "Guest";
1837
- })(UserTeamRole || (UserTeamRole = {}));
1838
- /**
1839
- * Dialog module dimension enum
1840
- */
1841
- var DialogDimension;
1842
- (function (DialogDimension) {
1843
- DialogDimension["Large"] = "large";
1844
- DialogDimension["Medium"] = "medium";
1845
- DialogDimension["Small"] = "small";
1846
- })(DialogDimension || (DialogDimension = {}));
1847
-
1848
- /**
1849
- * @deprecated
1850
- * As of 2.0.0, please use {@link DialogDimension} instead.
1851
- */
1852
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1853
- var TaskModuleDimension = DialogDimension;
1854
- /**
1855
- * The type of the channel with which the content is associated.
1856
- */
1857
- var ChannelType;
1858
- (function (ChannelType) {
1859
- ChannelType["Regular"] = "Regular";
1860
- ChannelType["Private"] = "Private";
1861
- ChannelType["Shared"] = "Shared";
1862
- })(ChannelType || (ChannelType = {}));
1863
- var errorNotSupportedOnPlatform = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
1879
+ function isHostAdaptiveCardSchemaVersionUnsupported(hostAdaptiveCardSchemaVersion) {
1880
+ var versionCheck = compareSDKVersions(hostAdaptiveCardSchemaVersion.majorVersion + "." + hostAdaptiveCardSchemaVersion.minorVersion, minAdaptiveCardVersion.majorVersion + "." + minAdaptiveCardVersion.minorVersion);
1881
+ if (versionCheck >= 0) {
1882
+ return false;
1883
+ }
1884
+ else {
1885
+ return true;
1886
+ }
1887
+ }
1864
1888
 
1865
1889
  ;// CONCATENATED MODULE: ./src/public/runtime.ts
1866
1890
  /* eslint-disable @typescript-eslint/ban-types */
@@ -1881,7 +1905,7 @@ var __assign = (undefined && undefined.__assign) || function () {
1881
1905
 
1882
1906
 
1883
1907
  var runtimeLogger = getLogger('runtime');
1884
- var latestRuntimeApiVersion = 1;
1908
+ var latestRuntimeApiVersion = 2;
1885
1909
  function isLatestRuntimeVersion(runtime) {
1886
1910
  return runtime.apiVersion === latestRuntimeApiVersion;
1887
1911
  }
@@ -1913,7 +1937,8 @@ function isRuntimeInitialized(runtime) {
1913
1937
  }
1914
1938
  var runtime = _uninitializedRuntime;
1915
1939
  var teamsRuntimeConfig = {
1916
- apiVersion: 1,
1940
+ apiVersion: 2,
1941
+ hostVersionsInfo: undefined,
1917
1942
  isLegacyTeams: true,
1918
1943
  supports: {
1919
1944
  appInstallDialog: {},
@@ -1922,7 +1947,9 @@ var teamsRuntimeConfig = {
1922
1947
  chat: {},
1923
1948
  conversations: {},
1924
1949
  dialog: {
1925
- bot: {},
1950
+ url: {
1951
+ bot: {},
1952
+ },
1926
1953
  update: {},
1927
1954
  },
1928
1955
  logs: {},
@@ -1996,12 +2023,20 @@ function fastForwardRuntime(outdatedRuntime) {
1996
2023
  var upgradeChain = [
1997
2024
  // This upgrade has been included for testing, it may be removed when there is a real upgrade implemented
1998
2025
  {
1999
- versionToUpgradeFrom: 0,
2026
+ versionToUpgradeFrom: 1,
2000
2027
  upgradeToNextVersion: function (previousVersionRuntime) {
2028
+ var _a;
2001
2029
  return {
2002
- apiVersion: 1,
2030
+ apiVersion: 2,
2031
+ hostVersionsInfo: undefined,
2003
2032
  isLegacyTeams: previousVersionRuntime.isLegacyTeams,
2004
- supports: __assign(__assign({}, previousVersionRuntime.supports), { calendar: previousVersionRuntime.supports.calendarV0 }),
2033
+ supports: __assign(__assign({}, previousVersionRuntime.supports), { dialog: previousVersionRuntime.supports.dialog
2034
+ ? {
2035
+ card: undefined,
2036
+ url: previousVersionRuntime.supports.dialog,
2037
+ update: (_a = previousVersionRuntime.supports.dialog) === null || _a === void 0 ? void 0 : _a.update,
2038
+ }
2039
+ : undefined }),
2005
2040
  };
2006
2041
  },
2007
2042
  },
@@ -2070,7 +2105,7 @@ function generateBackCompatRuntimeConfig(highestSupportedVersion) {
2070
2105
  }
2071
2106
  });
2072
2107
  var backCompatRuntimeConfig = {
2073
- apiVersion: 1,
2108
+ apiVersion: 2,
2074
2109
  isLegacyTeams: true,
2075
2110
  supports: newSupports,
2076
2111
  };
@@ -2101,7 +2136,7 @@ function setUnitializedRuntime() {
2101
2136
  * Limited to Microsoft-internal use
2102
2137
  */
2103
2138
  var _minRuntimeConfigToUninitialize = {
2104
- apiVersion: 1,
2139
+ apiVersion: 2,
2105
2140
  supports: {
2106
2141
  pages: {
2107
2142
  appButton: {},
@@ -2116,7 +2151,7 @@ var _minRuntimeConfigToUninitialize = {
2116
2151
  };
2117
2152
 
2118
2153
  ;// CONCATENATED MODULE: ./src/public/version.ts
2119
- var version = "2.7.2-beta.0";
2154
+ var version = "2.8.0-beta.0";
2120
2155
 
2121
2156
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2122
2157
 
@@ -2661,163 +2696,261 @@ var authentication;
2661
2696
 
2662
2697
 
2663
2698
 
2699
+
2664
2700
  /**
2665
- * Namespace to interact with the dialog module-specific part of the SDK.
2666
- *
2667
- * @beta
2668
- */
2669
- var dialog;
2670
- (function (dialog) {
2671
- var storedMessages = [];
2672
- /**
2673
- * @hidden
2674
- * Hide from docs because this function is only used during initialization
2675
- *
2676
- * Adds register handlers for messageForChild upon initialization and only in the tasks FrameContext. {@link FrameContexts.task}
2677
- * Function is called during app initialization
2678
- * @internal
2679
- * Limited to Microsoft-internal use
2680
- *
2681
- * @beta
2682
- */
2683
- function initialize() {
2684
- registerHandler('messageForChild', handleDialogMessage, false);
2685
- }
2686
- dialog.initialize = initialize;
2687
- function handleDialogMessage(message) {
2688
- if (!GlobalVars.frameContext) {
2689
- // GlobalVars.frameContext is currently not set
2690
- return;
2691
- }
2692
- if (GlobalVars.frameContext === FrameContexts.task) {
2693
- storedMessages.push(message);
2694
- }
2695
- else {
2696
- // Not in task FrameContext, remove 'messageForChild' handler
2697
- removeHandler('messageForChild');
2698
- }
2699
- }
2700
- /**
2701
- * Allows app to open a url based dialog.
2702
- *
2703
- * @remarks
2704
- * This function cannot be called from inside of a dialog
2705
- *
2706
- * @param urlDialogInfo - An object containing the parameters of the dialog module.
2707
- * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.
2708
- * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
2709
- *
2710
- * @returns a function that can be used to send messages to the dialog.
2711
- *
2712
- * @beta
2713
- */
2714
- function open(urlDialogInfo, submitHandler, messageFromChildHandler) {
2715
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2716
- if (!isSupported()) {
2717
- throw errorNotSupportedOnPlatform;
2718
- }
2719
- if (messageFromChildHandler) {
2720
- registerHandler('messageForParent', messageFromChildHandler);
2721
- }
2722
- var dialogInfo = getDialogInfoFromUrlDialogInfo(urlDialogInfo);
2723
- sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
2724
- submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
2725
- removeHandler('messageForParent');
2726
- });
2727
- }
2728
- dialog.open = open;
2729
- /**
2730
- * Submit the dialog module and close the dialog
2731
- *
2732
- * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it,
2733
- * If this function is called from a dialog while {@link M365ContentAction} is set in the context object by the host, result will be ignored
2734
- *
2735
- * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
2736
- *
2737
- * @beta
2738
- */
2739
- function submit(result, appIds) {
2740
- // FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)
2741
- // but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().
2742
- // FrameContexts.content will be removed once the bug is fixed.
2743
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
2744
- if (!isSupported()) {
2745
- throw errorNotSupportedOnPlatform;
2746
- }
2747
- // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
2748
- sendMessageToParent('tasks.completeTask', [result, appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : []]);
2749
- }
2750
- dialog.submit = submit;
2751
- /**
2752
- * Send message to the parent from dialog
2753
- *
2754
- * @remarks
2755
- * This function is only called from inside of a dialog
2756
- *
2757
- * @param message - The message to send to the parent
2758
- *
2759
- * @beta
2760
- */
2761
- function sendMessageToParentFromDialog(
2762
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2763
- message) {
2764
- ensureInitialized(runtime, FrameContexts.task);
2765
- if (!isSupported()) {
2766
- throw errorNotSupportedOnPlatform;
2767
- }
2768
- sendMessageToParent('messageForParent', [message]);
2769
- }
2770
- dialog.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
2701
+ * Namespace to interact with the dialog module-specific part of the SDK.
2702
+ *
2703
+ * @beta
2704
+ */
2705
+ var dialog;
2706
+ (function (dialog) {
2707
+ var storedMessages = [];
2771
2708
  /**
2772
- * Send message to the dialog from the parent
2709
+ * @hidden
2710
+ * Hide from docs because this function is only used during initialization
2773
2711
  *
2774
- * @param message - The message to send
2712
+ * Adds register handlers for messageForChild upon initialization and only in the tasks FrameContext. {@link FrameContexts.task}
2713
+ * Function is called during app initialization
2714
+ * @internal
2715
+ * Limited to Microsoft-internal use
2775
2716
  *
2776
2717
  * @beta
2777
2718
  */
2778
- function sendMessageToDialog(
2779
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2780
- message) {
2781
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2782
- if (!isSupported()) {
2783
- throw errorNotSupportedOnPlatform;
2784
- }
2785
- sendMessageToParent('messageForChild', [message]);
2719
+ function initialize() {
2720
+ registerHandler('messageForChild', handleDialogMessage, false);
2786
2721
  }
2787
- dialog.sendMessageToDialog = sendMessageToDialog;
2788
- /**
2789
- * Register a listener that will be triggered when a message is received from the app that opened the dialog.
2790
- *
2791
- * @remarks
2792
- * This function is only called from inside of a dialog.
2793
- *
2794
- * @param listener - The listener that will be triggered.
2795
- *
2796
- * @beta
2797
- */
2798
- function registerOnMessageFromParent(listener) {
2799
- ensureInitialized(runtime, FrameContexts.task);
2800
- if (!isSupported()) {
2801
- throw errorNotSupportedOnPlatform;
2722
+ dialog.initialize = initialize;
2723
+ function handleDialogMessage(message) {
2724
+ if (!GlobalVars.frameContext) {
2725
+ // GlobalVars.frameContext is currently not set
2726
+ return;
2802
2727
  }
2803
- // We need to remove the original 'messageForChild'
2804
- // handler since the original does not allow for post messages.
2805
- // It is replaced by the user specified listener that is passed in.
2806
- removeHandler('messageForChild');
2807
- registerHandler('messageForChild', listener);
2808
- storedMessages.reverse();
2809
- while (storedMessages.length > 0) {
2810
- var message = storedMessages.pop();
2811
- listener(message);
2728
+ if (GlobalVars.frameContext === FrameContexts.task) {
2729
+ storedMessages.push(message);
2730
+ }
2731
+ else {
2732
+ // Not in task FrameContext, remove 'messageForChild' handler
2733
+ removeHandler('messageForChild');
2812
2734
  }
2813
2735
  }
2814
- dialog.registerOnMessageFromParent = registerOnMessageFromParent;
2736
+ var url;
2737
+ (function (url) {
2738
+ /**
2739
+ * Allows app to open a url based dialog.
2740
+ *
2741
+ * @remarks
2742
+ * This function cannot be called from inside of a dialog
2743
+ *
2744
+ * @param urlDialogInfo - An object containing the parameters of the dialog module.
2745
+ * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.
2746
+ * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
2747
+ *
2748
+ * @beta
2749
+ */
2750
+ function open(urlDialogInfo, submitHandler, messageFromChildHandler) {
2751
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2752
+ if (!isSupported()) {
2753
+ throw errorNotSupportedOnPlatform;
2754
+ }
2755
+ if (messageFromChildHandler) {
2756
+ registerHandler('messageForParent', messageFromChildHandler);
2757
+ }
2758
+ var dialogInfo = getDialogInfoFromUrlDialogInfo(urlDialogInfo);
2759
+ sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
2760
+ submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
2761
+ removeHandler('messageForParent');
2762
+ });
2763
+ }
2764
+ url.open = open;
2765
+ /**
2766
+ * Submit the dialog module and close the dialog
2767
+ *
2768
+ * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it,
2769
+ * If this function is called from a dialog while {@link M365ContentAction} is set in the context object by the host, result will be ignored
2770
+ *
2771
+ * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
2772
+ *
2773
+ * @beta
2774
+ */
2775
+ function submit(result, appIds) {
2776
+ // FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)
2777
+ // but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().
2778
+ // FrameContexts.content will be removed once the bug is fixed.
2779
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
2780
+ if (!isSupported()) {
2781
+ throw errorNotSupportedOnPlatform;
2782
+ }
2783
+ // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
2784
+ sendMessageToParent('tasks.completeTask', [result, appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : []]);
2785
+ }
2786
+ url.submit = submit;
2787
+ /**
2788
+ * Send message to the parent from dialog
2789
+ *
2790
+ * @remarks
2791
+ * This function is only called from inside of a dialog
2792
+ *
2793
+ * @param message - The message to send to the parent
2794
+ *
2795
+ * @beta
2796
+ */
2797
+ function sendMessageToParentFromDialog(
2798
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2799
+ message) {
2800
+ ensureInitialized(runtime, FrameContexts.task);
2801
+ if (!isSupported()) {
2802
+ throw errorNotSupportedOnPlatform;
2803
+ }
2804
+ sendMessageToParent('messageForParent', [message]);
2805
+ }
2806
+ url.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
2807
+ /**
2808
+ * Send message to the dialog from the parent
2809
+ *
2810
+ * @param message - The message to send
2811
+ *
2812
+ * @beta
2813
+ */
2814
+ function sendMessageToDialog(
2815
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2816
+ message) {
2817
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2818
+ if (!isSupported()) {
2819
+ throw errorNotSupportedOnPlatform;
2820
+ }
2821
+ sendMessageToParent('messageForChild', [message]);
2822
+ }
2823
+ url.sendMessageToDialog = sendMessageToDialog;
2824
+ /**
2825
+ * Register a listener that will be triggered when a message is received from the app that opened the dialog.
2826
+ *
2827
+ * @remarks
2828
+ * This function is only called from inside of a dialog.
2829
+ *
2830
+ * @param listener - The listener that will be triggered.
2831
+ *
2832
+ * @beta
2833
+ */
2834
+ function registerOnMessageFromParent(listener) {
2835
+ ensureInitialized(runtime, FrameContexts.task);
2836
+ if (!isSupported()) {
2837
+ throw errorNotSupportedOnPlatform;
2838
+ }
2839
+ // We need to remove the original 'messageForChild'
2840
+ // handler since the original does not allow for post messages.
2841
+ // It is replaced by the user specified listener that is passed in.
2842
+ removeHandler('messageForChild');
2843
+ registerHandler('messageForChild', listener);
2844
+ storedMessages.reverse();
2845
+ while (storedMessages.length > 0) {
2846
+ var message = storedMessages.pop();
2847
+ listener(message);
2848
+ }
2849
+ }
2850
+ url.registerOnMessageFromParent = registerOnMessageFromParent;
2851
+ /**
2852
+ * Checks if dialog.url module is supported by the host
2853
+ *
2854
+ * @returns boolean to represent whether dialog.url module is supported
2855
+ *
2856
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
2857
+ *
2858
+ * @beta
2859
+ */
2860
+ function isSupported() {
2861
+ return ensureInitialized(runtime) && (runtime.supports.dialog && runtime.supports.dialog.url) !== undefined;
2862
+ }
2863
+ url.isSupported = isSupported;
2864
+ /**
2865
+ * Namespace to open a dialog that sends results to the bot framework
2866
+ *
2867
+ * @beta
2868
+ */
2869
+ var bot;
2870
+ (function (bot) {
2871
+ /**
2872
+ * Allows an app to open the dialog module using bot.
2873
+ *
2874
+ * @param botUrlDialogInfo - An object containing the parameters of the dialog module including completionBotId.
2875
+ * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.
2876
+ * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
2877
+ *
2878
+ * @returns a function that can be used to send messages to the dialog.
2879
+ *
2880
+ * @beta
2881
+ */
2882
+ function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
2883
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2884
+ if (!isSupported()) {
2885
+ throw errorNotSupportedOnPlatform;
2886
+ }
2887
+ if (messageFromChildHandler) {
2888
+ registerHandler('messageForParent', messageFromChildHandler);
2889
+ }
2890
+ var dialogInfo = getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo);
2891
+ sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
2892
+ submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
2893
+ removeHandler('messageForParent');
2894
+ });
2895
+ }
2896
+ bot.open = open;
2897
+ /**
2898
+ * Checks if dialog.url.bot capability is supported by the host
2899
+ *
2900
+ * @returns boolean to represent whether dialog.url.bot is supported
2901
+ *
2902
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
2903
+ *
2904
+ * @beta
2905
+ */
2906
+ function isSupported() {
2907
+ return (ensureInitialized(runtime) &&
2908
+ (runtime.supports.dialog && runtime.supports.dialog.url && runtime.supports.dialog.url.bot) !== undefined);
2909
+ }
2910
+ bot.isSupported = isSupported;
2911
+ })(bot = url.bot || (url.bot = {}));
2912
+ /**
2913
+ * @hidden
2914
+ *
2915
+ * Convert UrlDialogInfo to DialogInfo to send the information to host in {@linkcode open} API.
2916
+ *
2917
+ * @internal
2918
+ * Limited to Microsoft-internal use
2919
+ */
2920
+ function getDialogInfoFromUrlDialogInfo(urlDialogInfo) {
2921
+ var dialogInfo = {
2922
+ url: urlDialogInfo.url,
2923
+ height: urlDialogInfo.size ? urlDialogInfo.size.height : DialogDimension.Small,
2924
+ width: urlDialogInfo.size ? urlDialogInfo.size.width : DialogDimension.Small,
2925
+ title: urlDialogInfo.title,
2926
+ fallbackUrl: urlDialogInfo.fallbackUrl,
2927
+ };
2928
+ return dialogInfo;
2929
+ }
2930
+ url.getDialogInfoFromUrlDialogInfo = getDialogInfoFromUrlDialogInfo;
2931
+ /**
2932
+ * @hidden
2933
+ *
2934
+ * Convert BotUrlDialogInfo to DialogInfo to send the information to host in {@linkcode bot.open} API.
2935
+ *
2936
+ * @internal
2937
+ * Limited to Microsoft-internal use
2938
+ */
2939
+ function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo) {
2940
+ var dialogInfo = getDialogInfoFromUrlDialogInfo(botUrlDialogInfo);
2941
+ dialogInfo.completionBotId = botUrlDialogInfo.completionBotId;
2942
+ return dialogInfo;
2943
+ }
2944
+ url.getDialogInfoFromBotUrlDialogInfo = getDialogInfoFromBotUrlDialogInfo;
2945
+ })(url = dialog.url || (dialog.url = {}));
2815
2946
  /**
2816
2947
  * Checks if dialog capability is supported by the host
2817
2948
  * @returns boolean to represent whether dialog capabilty is supported
2818
2949
  *
2819
2950
  * @throws Error if {@linkcode app.initialize} has not successfully completed
2820
2951
  *
2952
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
2953
+ *
2821
2954
  * @beta
2822
2955
  */
2823
2956
  function isSupported() {
@@ -2864,98 +2997,169 @@ var dialog;
2864
2997
  update.isSupported = isSupported;
2865
2998
  })(update = dialog.update || (dialog.update = {}));
2866
2999
  /**
2867
- * Namespace to open a dialog that sends results to the bot framework
2868
- *
3000
+ * Subcapability for interacting with adaptive card dialogs
2869
3001
  * @beta
2870
3002
  */
2871
- var bot;
2872
- (function (bot) {
3003
+ var adaptiveCard;
3004
+ (function (adaptiveCard) {
2873
3005
  /**
2874
- * Allows an app to open the dialog module using bot.
3006
+ * Allows app to open an adaptive card based dialog.
2875
3007
  *
2876
- * @param botUrlDialogInfo - An object containing the parameters of the dialog module including completionBotId.
2877
- * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.
2878
- * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
3008
+ * @remarks
3009
+ * This function cannot be called from inside of a dialog
2879
3010
  *
2880
- * @returns a function that can be used to send messages to the dialog.
3011
+ * @param adaptiveCardDialogInfo - An object containing the parameters of the dialog module {@link AdaptiveCardDialogInfo}.
3012
+ * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.
2881
3013
  *
2882
3014
  * @beta
2883
3015
  */
2884
- function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
3016
+ function open(adaptiveCardDialogInfo, submitHandler) {
2885
3017
  ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2886
3018
  if (!isSupported()) {
2887
3019
  throw errorNotSupportedOnPlatform;
2888
3020
  }
2889
- if (messageFromChildHandler) {
2890
- registerHandler('messageForParent', messageFromChildHandler);
2891
- }
2892
- var dialogInfo = getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo);
3021
+ var dialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo);
2893
3022
  sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
2894
3023
  submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
2895
- removeHandler('messageForParent');
2896
3024
  });
2897
3025
  }
2898
- bot.open = open;
3026
+ adaptiveCard.open = open;
2899
3027
  /**
2900
- * Checks if dialog.bot capability is supported by the host
2901
- * @returns boolean to represent whether dialog.bot is supported
3028
+ * Checks if dialog.adaptiveCard module is supported by the host
3029
+ *
3030
+ * @returns boolean to represent whether dialog.adaptiveCard module is supported
2902
3031
  *
2903
3032
  * @throws Error if {@linkcode app.initialize} has not successfully completed
2904
3033
  *
2905
3034
  * @beta
2906
3035
  */
2907
3036
  function isSupported() {
2908
- return ensureInitialized(runtime) && runtime.supports.dialog
2909
- ? runtime.supports.dialog.bot
2910
- ? true
2911
- : false
2912
- : false;
3037
+ var isAdaptiveCardVersionSupported = runtime.hostVersionsInfo &&
3038
+ runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3039
+ !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3040
+ return (ensureInitialized(runtime) &&
3041
+ (isAdaptiveCardVersionSupported && runtime.supports.dialog && runtime.supports.dialog.card) !== undefined);
2913
3042
  }
2914
- bot.isSupported = isSupported;
2915
- })(bot = dialog.bot || (dialog.bot = {}));
2916
- /**
2917
- * @hidden
2918
- *
2919
- * Convert UrlDialogInfo to DialogInfo to send the information to host in {@linkcode open} API.
2920
- *
2921
- * @internal
2922
- * Limited to Microsoft-internal use
2923
- *
2924
- * @beta
2925
- */
2926
- function getDialogInfoFromUrlDialogInfo(urlDialogInfo) {
2927
- var dialogInfo = {
2928
- url: urlDialogInfo.url,
2929
- height: urlDialogInfo.size ? urlDialogInfo.size.height : DialogDimension.Small,
2930
- width: urlDialogInfo.size ? urlDialogInfo.size.width : DialogDimension.Small,
2931
- title: urlDialogInfo.title,
2932
- fallbackUrl: urlDialogInfo.fallbackUrl,
2933
- };
2934
- return dialogInfo;
2935
- }
2936
- dialog.getDialogInfoFromUrlDialogInfo = getDialogInfoFromUrlDialogInfo;
2937
- /**
2938
- * @hidden
2939
- *
2940
- * Convert BotUrlDialogInfo to DialogInfo to send the information to host in {@linkcode bot.open} API.
2941
- *
2942
- * @internal
2943
- * Limited to Microsoft-internal use
2944
- *
2945
- * @beta
2946
- */
2947
- function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo) {
2948
- var dialogInfo = {
2949
- url: botUrlDialogInfo.url,
2950
- height: botUrlDialogInfo.size ? botUrlDialogInfo.size.height : DialogDimension.Small,
2951
- width: botUrlDialogInfo.size ? botUrlDialogInfo.size.width : DialogDimension.Small,
2952
- title: botUrlDialogInfo.title,
2953
- fallbackUrl: botUrlDialogInfo.fallbackUrl,
2954
- completionBotId: botUrlDialogInfo.completionBotId,
2955
- };
2956
- return dialogInfo;
2957
- }
2958
- dialog.getDialogInfoFromBotUrlDialogInfo = getDialogInfoFromBotUrlDialogInfo;
3043
+ adaptiveCard.isSupported = isSupported;
3044
+ /**
3045
+ * Namespace for interaction with adaptive card dialogs that need to communicate with the bot framework
3046
+ *
3047
+ * @beta
3048
+ */
3049
+ var bot;
3050
+ (function (bot) {
3051
+ /**
3052
+ * Allows an app to open an adaptive card-based dialog module using bot.
3053
+ *
3054
+ * @param botAdaptiveCardDialogInfo - An object containing the parameters of the dialog module including completionBotId.
3055
+ * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.
3056
+ *
3057
+ * @beta
3058
+ */
3059
+ function open(botAdaptiveCardDialogInfo, submitHandler) {
3060
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3061
+ if (!isSupported()) {
3062
+ throw errorNotSupportedOnPlatform;
3063
+ }
3064
+ var dialogInfo = getDialogInfoFromBotAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);
3065
+ sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
3066
+ submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3067
+ });
3068
+ }
3069
+ bot.open = open;
3070
+ /**
3071
+ * Checks if dialog.adaptiveCard.bot capability is supported by the host
3072
+ *
3073
+ * @returns boolean to represent whether dialog.adaptiveCard.bot is supported
3074
+ *
3075
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
3076
+ *
3077
+ * @beta
3078
+ */
3079
+ function isSupported() {
3080
+ var isAdaptiveCardVersionSupported = runtime.hostVersionsInfo &&
3081
+ runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3082
+ !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3083
+ return (ensureInitialized(runtime) &&
3084
+ (isAdaptiveCardVersionSupported &&
3085
+ runtime.supports.dialog &&
3086
+ runtime.supports.dialog.card &&
3087
+ runtime.supports.dialog.card.bot) !== undefined);
3088
+ }
3089
+ bot.isSupported = isSupported;
3090
+ })(bot = adaptiveCard.bot || (adaptiveCard.bot = {}));
3091
+ /**
3092
+ * @hidden
3093
+ * Hide from docs
3094
+ * --------
3095
+ * Convert AdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.
3096
+ *
3097
+ * @internal
3098
+ */
3099
+ function getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo) {
3100
+ var dialogInfo = {
3101
+ card: adaptiveCardDialogInfo.card,
3102
+ height: adaptiveCardDialogInfo.size ? adaptiveCardDialogInfo.size.height : DialogDimension.Small,
3103
+ width: adaptiveCardDialogInfo.size ? adaptiveCardDialogInfo.size.width : DialogDimension.Small,
3104
+ title: adaptiveCardDialogInfo.title,
3105
+ };
3106
+ return dialogInfo;
3107
+ }
3108
+ adaptiveCard.getDialogInfoFromAdaptiveCardDialogInfo = getDialogInfoFromAdaptiveCardDialogInfo;
3109
+ /**
3110
+ * @hidden
3111
+ * Hide from docs
3112
+ * --------
3113
+ * Convert BotAdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.
3114
+ *
3115
+ * @internal
3116
+ */
3117
+ function getDialogInfoFromBotAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo) {
3118
+ var dialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);
3119
+ dialogInfo.completionBotId = botAdaptiveCardDialogInfo.completionBotId;
3120
+ return dialogInfo;
3121
+ }
3122
+ adaptiveCard.getDialogInfoFromBotAdaptiveCardDialogInfo = getDialogInfoFromBotAdaptiveCardDialogInfo;
3123
+ /**
3124
+ * @hidden
3125
+ * Converts {@link TaskInfo} to {@link AdaptiveCardDialogInfo}
3126
+ * @param taskInfo - TaskInfo object to convert
3127
+ * @returns - converted AdaptiveCardDialogInfo
3128
+ */
3129
+ function getAdaptiveCardDialogInfoFromTaskInfo(taskInfo) {
3130
+ // eslint-disable-next-line strict-null-checks/all
3131
+ var adaptiveCardDialogInfo = {
3132
+ card: taskInfo.card,
3133
+ size: {
3134
+ height: taskInfo.height ? taskInfo.height : DialogDimension.Small,
3135
+ width: taskInfo.width ? taskInfo.width : DialogDimension.Small,
3136
+ },
3137
+ title: taskInfo.title,
3138
+ };
3139
+ return adaptiveCardDialogInfo;
3140
+ }
3141
+ adaptiveCard.getAdaptiveCardDialogInfoFromTaskInfo = getAdaptiveCardDialogInfoFromTaskInfo;
3142
+ /**
3143
+ * @hidden
3144
+ * Converts {@link TaskInfo} to {@link BotAdaptiveCardDialogInfo}
3145
+ * @param taskInfo - TaskInfo object to convert
3146
+ * @returns - converted BotAdaptiveCardDialogInfo
3147
+ */
3148
+ function getBotAdaptiveCardDialogInfoFromTaskInfo(taskInfo) {
3149
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3150
+ var botAdaptiveCardDialogInfo = {
3151
+ card: taskInfo.card,
3152
+ size: {
3153
+ height: taskInfo.height ? taskInfo.height : DialogDimension.Small,
3154
+ width: taskInfo.width ? taskInfo.width : DialogDimension.Small,
3155
+ },
3156
+ title: taskInfo.title,
3157
+ completionBotId: taskInfo.completionBotId,
3158
+ };
3159
+ return botAdaptiveCardDialogInfo;
3160
+ }
3161
+ adaptiveCard.getBotAdaptiveCardDialogInfoFromTaskInfo = getBotAdaptiveCardDialogInfoFromTaskInfo;
3162
+ })(adaptiveCard = dialog.adaptiveCard || (dialog.adaptiveCard = {}));
2959
3163
  })(dialog || (dialog = {}));
2960
3164
 
2961
3165
  ;// CONCATENATED MODULE: ./src/public/menus.ts
@@ -4676,6 +4880,7 @@ function uninitializeCommunication() {
4676
4880
  CommunicationPrivate.childMessageQueue = [];
4677
4881
  CommunicationPrivate.nextMessageId = 0;
4678
4882
  CommunicationPrivate.callbacks = {};
4883
+ CommunicationPrivate.promiseCallbacks = {};
4679
4884
  }
4680
4885
  /**
4681
4886
  * @internal
@@ -6546,6 +6751,21 @@ var geoLocation;
6546
6751
  })(map = geoLocation.map || (geoLocation.map = {}));
6547
6752
  })(geoLocation || (geoLocation = {}));
6548
6753
 
6754
+ ;// CONCATENATED MODULE: ./src/public/adaptiveCards.ts
6755
+
6756
+ /**
6757
+ * @returns The {@linkcode: AdaptiveCardVersion} representing the Adaptive Card schema
6758
+ * version supported by the host, or undefined if the host does not support Adaptive Cards
6759
+ */
6760
+ function getAdaptiveCardSchemaVersion() {
6761
+ if (!runtime.hostVersionsInfo) {
6762
+ return undefined;
6763
+ }
6764
+ else {
6765
+ return runtime.hostVersionsInfo.adaptiveCardSchemaVersion;
6766
+ }
6767
+ }
6768
+
6549
6769
  ;// CONCATENATED MODULE: ./src/public/appWindow.ts
6550
6770
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
6551
6771
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -8447,9 +8667,9 @@ var tasks;
8447
8667
  (function (tasks) {
8448
8668
  /**
8449
8669
  * @deprecated
8450
- * As of 2.0.0, please use {@link dialog.open dialog.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for url based dialogs
8451
- * and {@link dialog.bot.open dialog.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for bot based dialogs. In Teams,
8452
- * this function can be used for adaptive card based dialogs. Support for adaptive card based dialogs is coming to other hosts in the future.
8670
+ * As of 2.0.0, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for url based dialogs
8671
+ * and {@link dialog.url.bot.open dialog.url.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for bot-based dialogs. In Teams,
8672
+ * this function can be used for Adaptive Card-based dialogs. Support for Adaptive Card-based dialogs is coming to other hosts in the future.
8453
8673
  *
8454
8674
  * Allows an app to open the task module.
8455
8675
  *
@@ -8461,15 +8681,19 @@ var tasks;
8461
8681
  ? /* eslint-disable-next-line strict-null-checks/all */ /* fix tracked by 5730662 */
8462
8682
  function (sdkResponse) { return submitHandler(sdkResponse.err, sdkResponse.result); }
8463
8683
  : undefined;
8464
- if (taskInfo.card !== undefined || taskInfo.url === undefined) {
8684
+ if (taskInfo.card === undefined && taskInfo.url === undefined) {
8685
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
8686
+ sendMessageToParent('tasks.startTask', [taskInfo], submitHandler);
8687
+ }
8688
+ else if (taskInfo.card) {
8465
8689
  ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
8466
8690
  sendMessageToParent('tasks.startTask', [taskInfo], submitHandler);
8467
8691
  }
8468
8692
  else if (taskInfo.completionBotId !== undefined) {
8469
- dialog.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
8693
+ dialog.url.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
8470
8694
  }
8471
8695
  else {
8472
- dialog.open(getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
8696
+ dialog.url.open(getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
8473
8697
  }
8474
8698
  return new ChildAppWindow();
8475
8699
  }
@@ -8502,7 +8726,7 @@ var tasks;
8502
8726
  * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
8503
8727
  */
8504
8728
  function submitTask(result, appIds) {
8505
- dialog.submit(result, appIds);
8729
+ dialog.url.submit(result, appIds);
8506
8730
  }
8507
8731
  tasks.submitTask = submitTask;
8508
8732
  /**
@@ -8759,6 +8983,7 @@ var LiveShareHost = /** @class */ (function () {
8759
8983
 
8760
8984
 
8761
8985
 
8986
+
8762
8987
 
8763
8988
 
8764
8989