@microsoft/teams-js 2.0.0-beta.4-dev.5 → 2.0.0-beta.4-dev.8

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.
@@ -1121,7 +1121,7 @@ __webpack_require__.d(__webpack_exports__, {
1121
1121
  });
1122
1122
 
1123
1123
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1124
- var version = "2.0.0-beta.4-dev.5";
1124
+ var version = "2.0.0-beta.4-dev.8";
1125
1125
  /**
1126
1126
  * @hidden
1127
1127
  * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -1928,151 +1928,17 @@ var logs;
1928
1928
  logs.isSupported = isSupported;
1929
1929
  })(logs || (logs = {}));
1930
1930
 
1931
- ;// CONCATENATED MODULE: ./src/private/menus.ts
1932
-
1933
-
1934
-
1935
-
1936
- /**
1937
- * @hidden
1938
- * Namespace to interact with the menu-specific part of the SDK.
1939
- * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.
1940
- *
1941
- * Hide from docs until feature is complete
1942
- * @alpha
1943
- */
1944
- var menus;
1945
- (function (menus) {
1946
- /**
1947
- * Defines how a menu item should appear in the NavBar.
1948
- */
1949
- var DisplayMode;
1950
- (function (DisplayMode) {
1951
- /**
1952
- * Only place this item in the NavBar if there's room for it.
1953
- * If there's no room, item is shown in the overflow menu.
1954
- */
1955
- DisplayMode[DisplayMode["ifRoom"] = 0] = "ifRoom";
1956
- /**
1957
- * Never place this item in the NavBar.
1958
- * The item would always be shown in NavBar's overflow menu.
1959
- */
1960
- DisplayMode[DisplayMode["overflowOnly"] = 1] = "overflowOnly";
1961
- })(DisplayMode = menus.DisplayMode || (menus.DisplayMode = {}));
1962
- /**
1963
- * @hidden
1964
- * Represents information about menu item for Action Menu and Navigation Bar Menu.
1965
- */
1966
- var MenuItem = /** @class */ (function () {
1967
- function MenuItem() {
1968
- /**
1969
- * @hidden
1970
- * State of the menu item
1971
- */
1972
- this.enabled = true;
1973
- /**
1974
- * @hidden
1975
- * Whether the menu item is selected or not
1976
- */
1977
- this.selected = false;
1978
- }
1979
- return MenuItem;
1980
- }());
1981
- menus.MenuItem = MenuItem;
1982
- /**
1983
- * @hidden
1984
- * Represents information about type of list to display in Navigation Bar Menu.
1985
- */
1986
- var MenuListType;
1987
- (function (MenuListType) {
1988
- MenuListType["dropDown"] = "dropDown";
1989
- MenuListType["popOver"] = "popOver";
1990
- })(MenuListType = menus.MenuListType || (menus.MenuListType = {}));
1991
- var navBarMenuItemPressHandler;
1992
- var actionMenuItemPressHandler;
1993
- var viewConfigItemPressHandler;
1994
- function initialize() {
1995
- registerHandler('navBarMenuItemPress', handleNavBarMenuItemPress, false);
1996
- registerHandler('actionMenuItemPress', handleActionMenuItemPress, false);
1997
- registerHandler('setModuleView', handleViewConfigItemPress, false);
1998
- }
1999
- menus.initialize = initialize;
2000
- /**
2001
- * @hidden
2002
- * Registers list of view configurations and it's handler.
2003
- * Handler is responsible for listening selection of View Configuration.
2004
- *
2005
- * @param viewConfig - List of view configurations. Minimum 1 value is required.
2006
- * @param handler - The handler to invoke when the user selects view configuration.
2007
- */
2008
- function setUpViews(viewConfig, handler) {
2009
- ensureInitialized();
2010
- viewConfigItemPressHandler = handler;
2011
- sendMessageToParent('setUpViews', [viewConfig]);
2012
- }
2013
- menus.setUpViews = setUpViews;
2014
- function handleViewConfigItemPress(id) {
2015
- if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {
2016
- ensureInitialized();
2017
- sendMessageToParent('viewConfigItemPress', [id]);
2018
- }
2019
- }
2020
- /**
2021
- * @hidden
2022
- * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.
2023
- *
2024
- * @param items List of MenuItems for Navigation Bar Menu.
2025
- * @param handler The handler to invoke when the user selects menu item.
2026
- */
2027
- function setNavBarMenu(items, handler) {
2028
- ensureInitialized();
2029
- navBarMenuItemPressHandler = handler;
2030
- sendMessageToParent('setNavBarMenu', [items]);
2031
- }
2032
- menus.setNavBarMenu = setNavBarMenu;
2033
- function handleNavBarMenuItemPress(id) {
2034
- if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {
2035
- ensureInitialized();
2036
- sendMessageToParent('handleNavBarMenuItemPress', [id]);
2037
- }
2038
- }
2039
- /**
2040
- * @hidden
2041
- * Used to show Action Menu.
2042
- *
2043
- * @param params - Parameters for Menu Parameters
2044
- * @param handler - The handler to invoke when the user selects menu item.
2045
- */
2046
- function showActionMenu(params, handler) {
2047
- ensureInitialized();
2048
- actionMenuItemPressHandler = handler;
2049
- sendMessageToParent('showActionMenu', [params]);
2050
- }
2051
- menus.showActionMenu = showActionMenu;
2052
- function handleActionMenuItemPress(id) {
2053
- if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {
2054
- ensureInitialized();
2055
- sendMessageToParent('handleActionMenuItemPress', [id]);
2056
- }
2057
- }
2058
- function isSupported() {
2059
- return runtime.supports.menus ? true : false;
2060
- }
2061
- menus.isSupported = isSupported;
2062
- })(menus || (menus = {}));
2063
-
2064
1931
  ;// CONCATENATED MODULE: ./src/private/privateAPIs.ts
2065
1932
  /* eslint-disable @typescript-eslint/no-explicit-any */
2066
1933
 
2067
1934
 
2068
1935
 
2069
1936
 
2070
-
2071
1937
  /**
2072
1938
  * @internal
2073
1939
  */
2074
1940
  function initializePrivateApis() {
2075
- menus.initialize();
1941
+ //Keeping this API for any future usage, wherein privateAPIs need to be initialized
2076
1942
  }
2077
1943
  /**
2078
1944
  * @hidden
@@ -2542,6 +2408,135 @@ var authentication;
2542
2408
  }
2543
2409
  })(authentication || (authentication = {}));
2544
2410
 
2411
+ ;// CONCATENATED MODULE: ./src/public/menus.ts
2412
+
2413
+
2414
+
2415
+
2416
+ /**
2417
+ * Namespace to interact with the menu-specific part of the SDK.
2418
+ * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.
2419
+ */
2420
+ var menus;
2421
+ (function (menus) {
2422
+ /**
2423
+ * Defines how a menu item should appear in the NavBar.
2424
+ */
2425
+ var DisplayMode;
2426
+ (function (DisplayMode) {
2427
+ /**
2428
+ * Only place this item in the NavBar if there's room for it.
2429
+ * If there's no room, item is shown in the overflow menu.
2430
+ */
2431
+ DisplayMode[DisplayMode["ifRoom"] = 0] = "ifRoom";
2432
+ /**
2433
+ * Never place this item in the NavBar.
2434
+ * The item would always be shown in NavBar's overflow menu.
2435
+ */
2436
+ DisplayMode[DisplayMode["overflowOnly"] = 1] = "overflowOnly";
2437
+ })(DisplayMode = menus.DisplayMode || (menus.DisplayMode = {}));
2438
+ /**
2439
+ * @hidden
2440
+ * Represents information about menu item for Action Menu and Navigation Bar Menu.
2441
+ */
2442
+ var MenuItem = /** @class */ (function () {
2443
+ function MenuItem() {
2444
+ /**
2445
+ * @hidden
2446
+ * State of the menu item
2447
+ */
2448
+ this.enabled = true;
2449
+ /**
2450
+ * @hidden
2451
+ * Whether the menu item is selected or not
2452
+ */
2453
+ this.selected = false;
2454
+ }
2455
+ return MenuItem;
2456
+ }());
2457
+ menus.MenuItem = MenuItem;
2458
+ /**
2459
+ * @hidden
2460
+ * Represents information about type of list to display in Navigation Bar Menu.
2461
+ */
2462
+ var MenuListType;
2463
+ (function (MenuListType) {
2464
+ MenuListType["dropDown"] = "dropDown";
2465
+ MenuListType["popOver"] = "popOver";
2466
+ })(MenuListType = menus.MenuListType || (menus.MenuListType = {}));
2467
+ var navBarMenuItemPressHandler;
2468
+ var actionMenuItemPressHandler;
2469
+ var viewConfigItemPressHandler;
2470
+ function initialize() {
2471
+ registerHandler('navBarMenuItemPress', handleNavBarMenuItemPress, false);
2472
+ registerHandler('actionMenuItemPress', handleActionMenuItemPress, false);
2473
+ registerHandler('setModuleView', handleViewConfigItemPress, false);
2474
+ }
2475
+ menus.initialize = initialize;
2476
+ /**
2477
+ * @hidden
2478
+ * Registers list of view configurations and it's handler.
2479
+ * Handler is responsible for listening selection of View Configuration.
2480
+ *
2481
+ * @param viewConfig - List of view configurations. Minimum 1 value is required.
2482
+ * @param handler - The handler to invoke when the user selects view configuration.
2483
+ */
2484
+ function setUpViews(viewConfig, handler) {
2485
+ ensureInitialized();
2486
+ viewConfigItemPressHandler = handler;
2487
+ sendMessageToParent('setUpViews', [viewConfig]);
2488
+ }
2489
+ menus.setUpViews = setUpViews;
2490
+ function handleViewConfigItemPress(id) {
2491
+ if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {
2492
+ ensureInitialized();
2493
+ sendMessageToParent('viewConfigItemPress', [id]);
2494
+ }
2495
+ }
2496
+ /**
2497
+ * @hidden
2498
+ * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.
2499
+ *
2500
+ * @param items List of MenuItems for Navigation Bar Menu.
2501
+ * @param handler The handler to invoke when the user selects menu item.
2502
+ */
2503
+ function setNavBarMenu(items, handler) {
2504
+ ensureInitialized();
2505
+ navBarMenuItemPressHandler = handler;
2506
+ sendMessageToParent('setNavBarMenu', [items]);
2507
+ }
2508
+ menus.setNavBarMenu = setNavBarMenu;
2509
+ function handleNavBarMenuItemPress(id) {
2510
+ if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {
2511
+ ensureInitialized();
2512
+ sendMessageToParent('handleNavBarMenuItemPress', [id]);
2513
+ }
2514
+ }
2515
+ /**
2516
+ * @hidden
2517
+ * Used to show Action Menu.
2518
+ *
2519
+ * @param params - Parameters for Menu Parameters
2520
+ * @param handler - The handler to invoke when the user selects menu item.
2521
+ */
2522
+ function showActionMenu(params, handler) {
2523
+ ensureInitialized();
2524
+ actionMenuItemPressHandler = handler;
2525
+ sendMessageToParent('showActionMenu', [params]);
2526
+ }
2527
+ menus.showActionMenu = showActionMenu;
2528
+ function handleActionMenuItemPress(id) {
2529
+ if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {
2530
+ ensureInitialized();
2531
+ sendMessageToParent('handleActionMenuItemPress', [id]);
2532
+ }
2533
+ }
2534
+ function isSupported() {
2535
+ return runtime.supports.menus ? true : false;
2536
+ }
2537
+ menus.isSupported = isSupported;
2538
+ })(menus || (menus = {}));
2539
+
2545
2540
  ;// CONCATENATED MODULE: ./src/public/teamsAPIs.ts
2546
2541
 
2547
2542
  // Conflict with some names
@@ -2630,6 +2625,7 @@ var teamsCore;
2630
2625
 
2631
2626
 
2632
2627
 
2628
+
2633
2629
  /**
2634
2630
  * Namespace to interact with app initialization and lifecycle.
2635
2631
  *
@@ -2752,6 +2748,7 @@ var app_app;
2752
2748
  GlobalVars.initializeCompleted = true;
2753
2749
  });
2754
2750
  authentication.initialize();
2751
+ menus.initialize();
2755
2752
  pages.config.initialize();
2756
2753
  initializePrivateApis();
2757
2754
  }
@@ -6415,6 +6412,7 @@ var tasks;
6415
6412
 
6416
6413
 
6417
6414
 
6415
+
6418
6416
 
6419
6417
 
6420
6418
 
@@ -6432,7 +6430,7 @@ var tasks;
6432
6430
  * @alpha
6433
6431
  */
6434
6432
  var files;
6435
- (function (files) {
6433
+ (function (files_1) {
6436
6434
  /**
6437
6435
  * @hidden
6438
6436
  * Hide from docs
@@ -6447,7 +6445,7 @@ var files;
6447
6445
  CloudStorageProvider["GoogleDrive"] = "GOOGLEDRIVE";
6448
6446
  CloudStorageProvider["Egnyte"] = "EGNYTE";
6449
6447
  CloudStorageProvider["SharePoint"] = "SharePoint";
6450
- })(CloudStorageProvider = files.CloudStorageProvider || (files.CloudStorageProvider = {}));
6448
+ })(CloudStorageProvider = files_1.CloudStorageProvider || (files_1.CloudStorageProvider = {}));
6451
6449
  /**
6452
6450
  * @hidden
6453
6451
  * Hide from docs
@@ -6466,7 +6464,7 @@ var files;
6466
6464
  CloudStorageProviderType[CloudStorageProviderType["Search"] = 7] = "Search";
6467
6465
  CloudStorageProviderType[CloudStorageProviderType["AllFiles"] = 8] = "AllFiles";
6468
6466
  CloudStorageProviderType[CloudStorageProviderType["SharedWithMe"] = 9] = "SharedWithMe";
6469
- })(CloudStorageProviderType = files.CloudStorageProviderType || (files.CloudStorageProviderType = {}));
6467
+ })(CloudStorageProviderType = files_1.CloudStorageProviderType || (files_1.CloudStorageProviderType = {}));
6470
6468
  /**
6471
6469
  * @hidden
6472
6470
  * Hide from docs
@@ -6476,7 +6474,7 @@ var files;
6476
6474
  var SpecialDocumentLibraryType;
6477
6475
  (function (SpecialDocumentLibraryType) {
6478
6476
  SpecialDocumentLibraryType["ClassMaterials"] = "classMaterials";
6479
- })(SpecialDocumentLibraryType = files.SpecialDocumentLibraryType || (files.SpecialDocumentLibraryType = {}));
6477
+ })(SpecialDocumentLibraryType = files_1.SpecialDocumentLibraryType || (files_1.SpecialDocumentLibraryType = {}));
6480
6478
  /**
6481
6479
  * @hidden
6482
6480
  * Hide from docs
@@ -6486,7 +6484,19 @@ var files;
6486
6484
  var DocumentLibraryAccessType;
6487
6485
  (function (DocumentLibraryAccessType) {
6488
6486
  DocumentLibraryAccessType["Readonly"] = "readonly";
6489
- })(DocumentLibraryAccessType = files.DocumentLibraryAccessType || (files.DocumentLibraryAccessType = {}));
6487
+ })(DocumentLibraryAccessType = files_1.DocumentLibraryAccessType || (files_1.DocumentLibraryAccessType = {}));
6488
+ /**
6489
+ * @hidden
6490
+ * Hide from docs
6491
+ *
6492
+ * Download status enum
6493
+ */
6494
+ var FileDownloadStatus;
6495
+ (function (FileDownloadStatus) {
6496
+ FileDownloadStatus["Downloaded"] = "Downloaded";
6497
+ FileDownloadStatus["Downloading"] = "Downloading";
6498
+ FileDownloadStatus["Failed"] = "Failed";
6499
+ })(FileDownloadStatus = files_1.FileDownloadStatus || (files_1.FileDownloadStatus = {}));
6490
6500
  /**
6491
6501
  * @hidden
6492
6502
  * Hide from docs
@@ -6504,7 +6514,7 @@ var files;
6504
6514
  resolve(sendAndHandleSdkError('files.getCloudStorageFolders', channelId));
6505
6515
  });
6506
6516
  }
6507
- files.getCloudStorageFolders = getCloudStorageFolders;
6517
+ files_1.getCloudStorageFolders = getCloudStorageFolders;
6508
6518
  /**
6509
6519
  * @hidden
6510
6520
  * Hide from docs
@@ -6528,7 +6538,7 @@ var files;
6528
6538
  return result;
6529
6539
  });
6530
6540
  }
6531
- files.addCloudStorageFolder = addCloudStorageFolder;
6541
+ files_1.addCloudStorageFolder = addCloudStorageFolder;
6532
6542
  /**
6533
6543
  * @hidden
6534
6544
  * Hide from docs
@@ -6550,7 +6560,7 @@ var files;
6550
6560
  resolve(sendAndHandleSdkError('files.deleteCloudStorageFolder', channelId, folderToDelete));
6551
6561
  });
6552
6562
  }
6553
- files.deleteCloudStorageFolder = deleteCloudStorageFolder;
6563
+ files_1.deleteCloudStorageFolder = deleteCloudStorageFolder;
6554
6564
  /**
6555
6565
  * @hidden
6556
6566
  * Hide from docs
@@ -6572,7 +6582,7 @@ var files;
6572
6582
  resolve(sendAndHandleSdkError('files.getCloudStorageFolderContents', folder, providerCode));
6573
6583
  });
6574
6584
  }
6575
- files.getCloudStorageFolderContents = getCloudStorageFolderContents;
6585
+ files_1.getCloudStorageFolderContents = getCloudStorageFolderContents;
6576
6586
  /**
6577
6587
  * @hidden
6578
6588
  * Hide from docs
@@ -6593,7 +6603,7 @@ var files;
6593
6603
  }
6594
6604
  sendMessageToParent('files.openCloudStorageFile', [file, providerCode, fileOpenPreference]);
6595
6605
  }
6596
- files.openCloudStorageFile = openCloudStorageFile;
6606
+ files_1.openCloudStorageFile = openCloudStorageFile;
6597
6607
  /**
6598
6608
  * @hidden
6599
6609
  * Hide from docs.
@@ -6622,7 +6632,7 @@ var files;
6622
6632
  ];
6623
6633
  sendMessageToParent('openFilePreview', params);
6624
6634
  }
6625
- files.openFilePreview = openFilePreview;
6635
+ files_1.openFilePreview = openFilePreview;
6626
6636
  /**
6627
6637
  * @hidden
6628
6638
  * Allow 1st party apps to call this function to get the external
@@ -6637,7 +6647,7 @@ var files;
6637
6647
  resolve(sendAndHandleSdkError('files.getExternalProviders', excludeAddedProviders));
6638
6648
  });
6639
6649
  }
6640
- files.getExternalProviders = getExternalProviders;
6650
+ files_1.getExternalProviders = getExternalProviders;
6641
6651
  /**
6642
6652
  * @hidden
6643
6653
  * Allow 1st party apps to call this function to move files
@@ -6662,11 +6672,37 @@ var files;
6662
6672
  resolve(sendAndHandleSdkError('files.copyMoveFiles', selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove));
6663
6673
  });
6664
6674
  }
6665
- files.copyMoveFiles = copyMoveFiles;
6675
+ files_1.copyMoveFiles = copyMoveFiles;
6666
6676
  function isSupported() {
6667
6677
  return runtime.supports.files ? true : false;
6668
6678
  }
6669
- files.isSupported = isSupported;
6679
+ files_1.isSupported = isSupported;
6680
+ /**
6681
+ * @hidden
6682
+ * Hide from docs
6683
+ * ------
6684
+ * Gets list of downloads for current user
6685
+ * @param callback Callback that will be triggered post downloads load
6686
+ */
6687
+ function getFileDownloads(callback) {
6688
+ ensureInitialized(FrameContexts.content);
6689
+ if (!callback) {
6690
+ throw new Error('[files.getFileDownloads] Callback cannot be null');
6691
+ }
6692
+ sendMessageToParent('files.getFileDownloads', [], callback);
6693
+ }
6694
+ files_1.getFileDownloads = getFileDownloads;
6695
+ /**
6696
+ * @hidden
6697
+ * Hide from docs
6698
+ * ------
6699
+ * Open download preference folder
6700
+ */
6701
+ function openDownloadFolder() {
6702
+ ensureInitialized(FrameContexts.content);
6703
+ sendMessageToParent('files.openDownloadFolder', []);
6704
+ }
6705
+ files_1.openDownloadFolder = openDownloadFolder;
6670
6706
  })(files || (files = {}));
6671
6707
 
6672
6708
  ;// CONCATENATED MODULE: ./src/private/legacy.ts
@@ -7183,7 +7219,6 @@ var teams;
7183
7219
 
7184
7220
 
7185
7221
 
7186
-
7187
7222
 
7188
7223
  ;// CONCATENATED MODULE: ./src/index.ts
7189
7224