@microsoft/teams-js 2.15.0-beta.0 → 2.15.0-beta.2
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/MicrosoftTeams.d.ts +59 -93
- package/dist/MicrosoftTeams.js +235 -144
- package/dist/MicrosoftTeams.js.map +1 -1
- package/dist/MicrosoftTeams.min.js +1 -1
- package/dist/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
package/dist/MicrosoftTeams.js
CHANGED
@@ -824,12 +824,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
824
824
|
"appEntity": () => (/* reexport */ appEntity),
|
825
825
|
"appInitialization": () => (/* reexport */ appInitialization),
|
826
826
|
"appInstallDialog": () => (/* reexport */ appInstallDialog),
|
827
|
-
"appNotification": () => (/* reexport */ appNotification),
|
828
827
|
"authentication": () => (/* reexport */ authentication),
|
829
828
|
"barCode": () => (/* reexport */ barCode),
|
830
829
|
"calendar": () => (/* reexport */ calendar),
|
831
830
|
"call": () => (/* reexport */ call),
|
832
831
|
"chat": () => (/* reexport */ chat),
|
832
|
+
"clipboard": () => (/* reexport */ clipboard),
|
833
833
|
"conversations": () => (/* reexport */ conversations),
|
834
834
|
"dialog": () => (/* reexport */ dialog),
|
835
835
|
"enablePrintCapability": () => (/* reexport */ enablePrintCapability),
|
@@ -1288,6 +1288,16 @@ var DevicePermission;
|
|
1288
1288
|
DevicePermission["GeoLocation"] = "geolocation";
|
1289
1289
|
DevicePermission["Media"] = "media";
|
1290
1290
|
})(DevicePermission || (DevicePermission = {}));
|
1291
|
+
/**
|
1292
|
+
* Currently supported Mime type
|
1293
|
+
*/
|
1294
|
+
var ClipboardSupportedMimeType;
|
1295
|
+
(function (ClipboardSupportedMimeType) {
|
1296
|
+
ClipboardSupportedMimeType["TextPlain"] = "text/plain";
|
1297
|
+
ClipboardSupportedMimeType["TextHtml"] = "text/html";
|
1298
|
+
ClipboardSupportedMimeType["ImagePNG"] = "image/png";
|
1299
|
+
ClipboardSupportedMimeType["ImageJPEG"] = "image/jpeg";
|
1300
|
+
})(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
|
1291
1301
|
|
1292
1302
|
;// CONCATENATED MODULE: ./src/public/constants.ts
|
1293
1303
|
/** HostClientType represents the different client platforms on which host can be run. */
|
@@ -1303,6 +1313,8 @@ var HostClientType;
|
|
1303
1313
|
HostClientType["ios"] = "ios";
|
1304
1314
|
/** Represents the iPadOS client of host, which runs on iOS devices such as iPads. */
|
1305
1315
|
HostClientType["ipados"] = "ipados";
|
1316
|
+
/** The host is running on a macOS client, which runs on devices such as MacBooks. */
|
1317
|
+
HostClientType["macos"] = "macos";
|
1306
1318
|
/**
|
1307
1319
|
* @deprecated
|
1308
1320
|
* As of 2.0.0, please use {@link teamsRoomsWindows} instead.
|
@@ -1810,6 +1822,64 @@ function isHostAdaptiveCardSchemaVersionUnsupported(hostAdaptiveCardSchemaVersio
|
|
1810
1822
|
function isValidHttpsURL(url) {
|
1811
1823
|
return url.protocol === 'https:';
|
1812
1824
|
}
|
1825
|
+
/**
|
1826
|
+
* Convert base64 string to blob
|
1827
|
+
* @param base64Data string respresenting the content
|
1828
|
+
* @param contentType Mimetype
|
1829
|
+
* @returns Promise
|
1830
|
+
*/
|
1831
|
+
function base64ToBlob(mimeType, base64String) {
|
1832
|
+
return new Promise(function (resolve, reject) {
|
1833
|
+
if (!mimeType) {
|
1834
|
+
reject('MimeType cannot be null or empty.');
|
1835
|
+
}
|
1836
|
+
if (!base64String) {
|
1837
|
+
reject('Base64 string cannot be null or empty.');
|
1838
|
+
}
|
1839
|
+
var byteCharacters = atob(base64String);
|
1840
|
+
/**
|
1841
|
+
* For images we need to convert binary data to image to achieve that:
|
1842
|
+
* 1. A new Uint8Array is created with a length equal to the length of byteCharacters.
|
1843
|
+
* The byteCharacters is a string representing the base64 data decoded using atob.
|
1844
|
+
* 2. Then loop iterates over each character in the byteCharacters string and assigns the
|
1845
|
+
* corresponding character code to the corresponding index in the byteArray. The purpose
|
1846
|
+
* of this loop is to convert the base64 string to a binary representation, as the Blob
|
1847
|
+
* constructor expects binary data.
|
1848
|
+
*/
|
1849
|
+
if (mimeType.startsWith('image/')) {
|
1850
|
+
var byteArray = new Uint8Array(byteCharacters.length);
|
1851
|
+
for (var i = 0; i < byteCharacters.length; i++) {
|
1852
|
+
byteArray[i] = byteCharacters.charCodeAt(i);
|
1853
|
+
}
|
1854
|
+
resolve(new Blob([byteArray], { type: mimeType }));
|
1855
|
+
}
|
1856
|
+
resolve(new Blob([byteCharacters], { type: mimeType }));
|
1857
|
+
});
|
1858
|
+
}
|
1859
|
+
/**
|
1860
|
+
* Converts blob to base64 string.
|
1861
|
+
* @param blob Blob to convert to base64 string.
|
1862
|
+
*/
|
1863
|
+
function getBase64StringFromBlob(blob) {
|
1864
|
+
return new Promise(function (resolve, reject) {
|
1865
|
+
if (blob.size === 0) {
|
1866
|
+
reject(new Error('Blob cannot be empty.'));
|
1867
|
+
}
|
1868
|
+
var reader = new FileReader();
|
1869
|
+
reader.onloadend = function () {
|
1870
|
+
if (reader.result) {
|
1871
|
+
resolve(reader.result.toString().split(',')[1]);
|
1872
|
+
}
|
1873
|
+
else {
|
1874
|
+
reject(new Error('Failed to read the blob'));
|
1875
|
+
}
|
1876
|
+
};
|
1877
|
+
reader.onerror = function () {
|
1878
|
+
reject(reader.error);
|
1879
|
+
};
|
1880
|
+
reader.readAsDataURL(blob);
|
1881
|
+
});
|
1882
|
+
}
|
1813
1883
|
|
1814
1884
|
;// CONCATENATED MODULE: ./src/public/runtime.ts
|
1815
1885
|
/* eslint-disable @typescript-eslint/ban-types */
|
@@ -1824,13 +1894,24 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
1824
1894
|
};
|
1825
1895
|
return __assign.apply(this, arguments);
|
1826
1896
|
};
|
1897
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
1898
|
+
var t = {};
|
1899
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
1900
|
+
t[p] = s[p];
|
1901
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
1902
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
1903
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
1904
|
+
t[p[i]] = s[p[i]];
|
1905
|
+
}
|
1906
|
+
return t;
|
1907
|
+
};
|
1827
1908
|
|
1828
1909
|
|
1829
1910
|
|
1830
1911
|
|
1831
1912
|
|
1832
1913
|
var runtimeLogger = getLogger('runtime');
|
1833
|
-
var latestRuntimeApiVersion =
|
1914
|
+
var latestRuntimeApiVersion = 3;
|
1834
1915
|
function isLatestRuntimeVersion(runtime) {
|
1835
1916
|
return runtime.apiVersion === latestRuntimeApiVersion;
|
1836
1917
|
}
|
@@ -1862,7 +1943,7 @@ function isRuntimeInitialized(runtime) {
|
|
1862
1943
|
}
|
1863
1944
|
var runtime = _uninitializedRuntime;
|
1864
1945
|
var teamsRuntimeConfig = {
|
1865
|
-
apiVersion:
|
1946
|
+
apiVersion: 3,
|
1866
1947
|
hostVersionsInfo: teamsMinAdaptiveCardVersion,
|
1867
1948
|
isLegacyTeams: true,
|
1868
1949
|
supports: {
|
@@ -1951,7 +2032,6 @@ function fastForwardRuntime(outdatedRuntime) {
|
|
1951
2032
|
* Limited to Microsoft-internal use
|
1952
2033
|
*/
|
1953
2034
|
var upgradeChain = [
|
1954
|
-
// This upgrade has been included for testing, it may be removed when there is a real upgrade implemented
|
1955
2035
|
{
|
1956
2036
|
versionToUpgradeFrom: 1,
|
1957
2037
|
upgradeToNextVersion: function (previousVersionRuntime) {
|
@@ -1970,6 +2050,14 @@ var upgradeChain = [
|
|
1970
2050
|
};
|
1971
2051
|
},
|
1972
2052
|
},
|
2053
|
+
{
|
2054
|
+
versionToUpgradeFrom: 2,
|
2055
|
+
upgradeToNextVersion: function (previousVersionRuntime) {
|
2056
|
+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */ /* Intentionally assigned to unused variable to delete propery when destructuring */
|
2057
|
+
var _a = previousVersionRuntime.supports, _ = _a.appNotification, newSupports = __rest(_a, ["appNotification"]);
|
2058
|
+
return __assign(__assign({}, previousVersionRuntime), { apiVersion: 3, supports: newSupports });
|
2059
|
+
},
|
2060
|
+
},
|
1973
2061
|
];
|
1974
2062
|
var versionConstants = {
|
1975
2063
|
'1.9.0': [
|
@@ -2039,7 +2127,7 @@ function generateBackCompatRuntimeConfig(highestSupportedVersion) {
|
|
2039
2127
|
}
|
2040
2128
|
});
|
2041
2129
|
var backCompatRuntimeConfig = {
|
2042
|
-
apiVersion:
|
2130
|
+
apiVersion: latestRuntimeApiVersion,
|
2043
2131
|
hostVersionsInfo: teamsMinAdaptiveCardVersion,
|
2044
2132
|
isLegacyTeams: true,
|
2045
2133
|
supports: newSupports,
|
@@ -2071,7 +2159,7 @@ function setUnitializedRuntime() {
|
|
2071
2159
|
* Limited to Microsoft-internal use
|
2072
2160
|
*/
|
2073
2161
|
var _minRuntimeConfigToUninitialize = {
|
2074
|
-
apiVersion:
|
2162
|
+
apiVersion: latestRuntimeApiVersion,
|
2075
2163
|
supports: {
|
2076
2164
|
pages: {
|
2077
2165
|
appButton: {},
|
@@ -2090,7 +2178,7 @@ var _minRuntimeConfigToUninitialize = {
|
|
2090
2178
|
* @hidden
|
2091
2179
|
* Package version.
|
2092
2180
|
*/
|
2093
|
-
var version = "2.15.0-beta.
|
2181
|
+
var version = "2.15.0-beta.2";
|
2094
2182
|
|
2095
2183
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
2096
2184
|
|
@@ -2317,11 +2405,13 @@ var authentication;
|
|
2317
2405
|
GlobalVars.hostClientType === HostClientType.android ||
|
2318
2406
|
GlobalVars.hostClientType === HostClientType.ios ||
|
2319
2407
|
GlobalVars.hostClientType === HostClientType.ipados ||
|
2408
|
+
GlobalVars.hostClientType === HostClientType.macos ||
|
2320
2409
|
GlobalVars.hostClientType === HostClientType.rigel ||
|
2321
2410
|
GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||
|
2322
2411
|
GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||
|
2323
2412
|
GlobalVars.hostClientType === HostClientType.teamsPhones ||
|
2324
|
-
GlobalVars.hostClientType === HostClientType.teamsDisplays
|
2413
|
+
GlobalVars.hostClientType === HostClientType.teamsDisplays ||
|
2414
|
+
GlobalVars.hostClientType === HostClientType.surfaceHub) {
|
2325
2415
|
// Convert any relative URLs into absolute URLs before sending them over to the parent window.
|
2326
2416
|
var link = document.createElement('a');
|
2327
2417
|
link.href = authenticateParameters.url;
|
@@ -3954,7 +4044,7 @@ var pages;
|
|
3954
4044
|
pages.navigateToApp = navigateToApp;
|
3955
4045
|
/**
|
3956
4046
|
* Shares a deep link that a user can use to navigate back to a specific state in this page.
|
3957
|
-
* Please note that this method does yet work on mobile hosts.
|
4047
|
+
* Please note that this method does not yet work on mobile hosts.
|
3958
4048
|
*
|
3959
4049
|
* @param deepLinkParameters - ID and label for the link and fallback URL.
|
3960
4050
|
*/
|
@@ -5710,135 +5800,6 @@ var appInstallDialog;
|
|
5710
5800
|
appInstallDialog.isSupported = isSupported;
|
5711
5801
|
})(appInstallDialog || (appInstallDialog = {}));
|
5712
5802
|
|
5713
|
-
;// CONCATENATED MODULE: ./src/public/appNotification.ts
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5717
|
-
|
5718
|
-
/**
|
5719
|
-
* Namespace to interact with the appNotification specific part of the SDK
|
5720
|
-
* @beta
|
5721
|
-
*/
|
5722
|
-
var appNotification;
|
5723
|
-
(function (appNotification) {
|
5724
|
-
/**
|
5725
|
-
* @internal
|
5726
|
-
*
|
5727
|
-
* @hidden
|
5728
|
-
*
|
5729
|
-
* @beta
|
5730
|
-
*
|
5731
|
-
* This converts the notifcationActionUrl from a URL type to a string type for proper flow across the iframe
|
5732
|
-
* @param notificationDisplayParam - appNotification display parameter with the notificationActionUrl as a URL type
|
5733
|
-
* @returns a serialized object that can be sent to the host SDK
|
5734
|
-
*/
|
5735
|
-
function serializeParam(notificationDisplayParam) {
|
5736
|
-
var _a;
|
5737
|
-
return {
|
5738
|
-
title: notificationDisplayParam.title,
|
5739
|
-
content: notificationDisplayParam.content,
|
5740
|
-
notificationIconAsString: (_a = notificationDisplayParam.icon) === null || _a === void 0 ? void 0 : _a.href,
|
5741
|
-
displayDurationInSeconds: notificationDisplayParam.displayDurationInSeconds,
|
5742
|
-
notificationActionUrlAsString: notificationDisplayParam.notificationActionUrl.href,
|
5743
|
-
};
|
5744
|
-
}
|
5745
|
-
/**
|
5746
|
-
* Checks the valididty of the URL passed
|
5747
|
-
*
|
5748
|
-
* @param url
|
5749
|
-
* @returns True if a valid url was passed
|
5750
|
-
*
|
5751
|
-
* @beta
|
5752
|
-
*/
|
5753
|
-
function isValidUrl(url) {
|
5754
|
-
var validProtocols = ['https:'];
|
5755
|
-
return validProtocols.includes(url.protocol);
|
5756
|
-
}
|
5757
|
-
/**
|
5758
|
-
* Validates that the input string is of property length
|
5759
|
-
*
|
5760
|
-
* @param inputString and maximumLength
|
5761
|
-
* @returns True if string length is within specified limit
|
5762
|
-
*
|
5763
|
-
* @beta
|
5764
|
-
*/
|
5765
|
-
function isValidLength(inputString, maxLength) {
|
5766
|
-
return inputString.length <= maxLength;
|
5767
|
-
}
|
5768
|
-
/**
|
5769
|
-
* Validates that all the required appNotification display parameters are either supplied or satisfy the required checks
|
5770
|
-
* @param notificationDisplayParam
|
5771
|
-
* @throws Error if any of the required parameters aren't supplied
|
5772
|
-
* @throws Error if content or title length is beyond specific limit
|
5773
|
-
* @throws Error if invalid url is passed
|
5774
|
-
* @returns void
|
5775
|
-
*
|
5776
|
-
* @beta
|
5777
|
-
*/
|
5778
|
-
function validateNotificationDisplayParams(notificationDisplayParam) {
|
5779
|
-
var maxTitleLength = 75;
|
5780
|
-
var maxContentLength = 1500;
|
5781
|
-
if (!notificationDisplayParam.title) {
|
5782
|
-
throw new Error('Must supply notification title');
|
5783
|
-
}
|
5784
|
-
if (!isValidLength(notificationDisplayParam.title, maxTitleLength)) {
|
5785
|
-
throw new Error("Invalid notification title length: Maximum title length ".concat(maxTitleLength, ", title length supplied ").concat(notificationDisplayParam.title.length));
|
5786
|
-
}
|
5787
|
-
if (!notificationDisplayParam.content) {
|
5788
|
-
throw new Error('Must supply notification content');
|
5789
|
-
}
|
5790
|
-
if (!isValidLength(notificationDisplayParam.content, maxContentLength)) {
|
5791
|
-
throw new Error("Invalid notification content length: Maximum content length ".concat(maxContentLength, ", content length supplied ").concat(notificationDisplayParam.content.length));
|
5792
|
-
}
|
5793
|
-
if (!notificationDisplayParam.notificationActionUrl) {
|
5794
|
-
throw new Error('Must supply notification url');
|
5795
|
-
}
|
5796
|
-
if (!isValidUrl(notificationDisplayParam.notificationActionUrl)) {
|
5797
|
-
throw new Error('Invalid notificationAction url');
|
5798
|
-
}
|
5799
|
-
if ((notificationDisplayParam === null || notificationDisplayParam === void 0 ? void 0 : notificationDisplayParam.icon) !== undefined && !isValidUrl(notificationDisplayParam === null || notificationDisplayParam === void 0 ? void 0 : notificationDisplayParam.icon)) {
|
5800
|
-
throw new Error('Invalid icon url');
|
5801
|
-
}
|
5802
|
-
if (!notificationDisplayParam.displayDurationInSeconds) {
|
5803
|
-
throw new Error('Must supply notification display duration in seconds');
|
5804
|
-
}
|
5805
|
-
if (notificationDisplayParam.displayDurationInSeconds < 0) {
|
5806
|
-
throw new Error('Notification display time must be greater than zero');
|
5807
|
-
}
|
5808
|
-
}
|
5809
|
-
/**
|
5810
|
-
* Displays appNotification after making a validiity check on all of the required parameters, by calling the validateNotificationDisplayParams helper function
|
5811
|
-
* An interface object containing all the required parameters to be displayed on the notification would be passed in here
|
5812
|
-
* The notificationDisplayParam would be serialized before passing across to the message handler to ensure all objects passed contain simple parameters that would properly pass across the Iframe
|
5813
|
-
* @param notificationdisplayparam - Interface object with all the parameters required to display an appNotificiation
|
5814
|
-
* @returns a promise resolution upon conclusion
|
5815
|
-
* @throws Error if appNotification capability is not supported
|
5816
|
-
* @throws Error if notficationDisplayParam was not validated successfully
|
5817
|
-
*
|
5818
|
-
* @beta
|
5819
|
-
*/
|
5820
|
-
function displayInAppNotification(notificationDisplayParam) {
|
5821
|
-
ensureInitialized(runtime, FrameContexts.content, FrameContexts.stage, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
5822
|
-
if (!isSupported()) {
|
5823
|
-
throw errorNotSupportedOnPlatform;
|
5824
|
-
}
|
5825
|
-
validateNotificationDisplayParams(notificationDisplayParam);
|
5826
|
-
return sendAndHandleSdkError('appNotification.displayInAppNotification', serializeParam(notificationDisplayParam));
|
5827
|
-
}
|
5828
|
-
appNotification.displayInAppNotification = displayInAppNotification;
|
5829
|
-
/**
|
5830
|
-
* Checks if appNotification is supported by the host
|
5831
|
-
* @returns boolean to represent whether the appNotification capability is supported
|
5832
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
5833
|
-
*
|
5834
|
-
* @beta
|
5835
|
-
*/
|
5836
|
-
function isSupported() {
|
5837
|
-
return ensureInitialized(runtime) && runtime.supports.appNotification ? true : false;
|
5838
|
-
}
|
5839
|
-
appNotification.isSupported = isSupported;
|
5840
|
-
})(appNotification || (appNotification = {}));
|
5841
|
-
|
5842
5803
|
;// CONCATENATED MODULE: ./src/public/media.ts
|
5843
5804
|
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
5844
5805
|
var __extends = (undefined && undefined.__extends) || (function () {
|
@@ -6771,6 +6732,136 @@ var chat;
|
|
6771
6732
|
chat.isSupported = isSupported;
|
6772
6733
|
})(chat || (chat = {}));
|
6773
6734
|
|
6735
|
+
;// CONCATENATED MODULE: ./src/public/clipboard.ts
|
6736
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6737
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6738
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
6739
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6740
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6741
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
6742
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
6743
|
+
});
|
6744
|
+
};
|
6745
|
+
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
6746
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
6747
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
6748
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
6749
|
+
function step(op) {
|
6750
|
+
if (f) throw new TypeError("Generator is already executing.");
|
6751
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
6752
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
6753
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
6754
|
+
switch (op[0]) {
|
6755
|
+
case 0: case 1: t = op; break;
|
6756
|
+
case 4: _.label++; return { value: op[1], done: false };
|
6757
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
6758
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
6759
|
+
default:
|
6760
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
6761
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
6762
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
6763
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
6764
|
+
if (t[2]) _.ops.pop();
|
6765
|
+
_.trys.pop(); continue;
|
6766
|
+
}
|
6767
|
+
op = body.call(thisArg, _);
|
6768
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
6769
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
6770
|
+
}
|
6771
|
+
};
|
6772
|
+
|
6773
|
+
|
6774
|
+
|
6775
|
+
|
6776
|
+
|
6777
|
+
|
6778
|
+
/**
|
6779
|
+
* Interact with the system clipboard
|
6780
|
+
*
|
6781
|
+
* @beta
|
6782
|
+
*/
|
6783
|
+
var clipboard;
|
6784
|
+
(function (clipboard) {
|
6785
|
+
/**
|
6786
|
+
* Function to copy data to clipboard.
|
6787
|
+
* @remarks
|
6788
|
+
* Note: clipboard.write only supports Text, HTML, PNG, and JPEG data format.
|
6789
|
+
* MIME type for Text -> `text/plain`, HTML -> `text/html`, PNG/JPEG -> `image/(png | jpeg)`
|
6790
|
+
* Also, JPEG will be converted to PNG image when copying to clipboard.
|
6791
|
+
*
|
6792
|
+
* @param blob - A Blob object representing the data to be copied to clipboard.
|
6793
|
+
* @returns A string promise which resolves to success message from the clipboard or
|
6794
|
+
* rejects with error stating the reason for failure.
|
6795
|
+
*/
|
6796
|
+
function write(blob) {
|
6797
|
+
return __awaiter(this, void 0, void 0, function () {
|
6798
|
+
var base64StringContent, writeParams;
|
6799
|
+
return __generator(this, function (_a) {
|
6800
|
+
switch (_a.label) {
|
6801
|
+
case 0:
|
6802
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.stage, FrameContexts.sidePanel);
|
6803
|
+
if (!isSupported()) {
|
6804
|
+
throw errorNotSupportedOnPlatform;
|
6805
|
+
}
|
6806
|
+
if (!(blob.type && Object.values(ClipboardSupportedMimeType).includes(blob.type))) {
|
6807
|
+
throw new Error("Blob type ".concat(blob.type, " is not supported. Supported blob types are ").concat(Object.values(ClipboardSupportedMimeType)));
|
6808
|
+
}
|
6809
|
+
return [4 /*yield*/, getBase64StringFromBlob(blob)];
|
6810
|
+
case 1:
|
6811
|
+
base64StringContent = _a.sent();
|
6812
|
+
writeParams = {
|
6813
|
+
mimeType: blob.type,
|
6814
|
+
content: base64StringContent,
|
6815
|
+
};
|
6816
|
+
return [2 /*return*/, sendAndHandleSdkError('clipboard.writeToClipboard', writeParams)];
|
6817
|
+
}
|
6818
|
+
});
|
6819
|
+
});
|
6820
|
+
}
|
6821
|
+
clipboard.write = write;
|
6822
|
+
/**
|
6823
|
+
* Function to read data from clipboard.
|
6824
|
+
*
|
6825
|
+
* @returns A promise blob which resolves to the data read from the clipboard or
|
6826
|
+
* rejects stating the reason for failure.
|
6827
|
+
* Note: Returned blob type will contain one of the MIME type `image/png`, `text/plain` or `text/html`.
|
6828
|
+
*/
|
6829
|
+
function read() {
|
6830
|
+
return __awaiter(this, void 0, void 0, function () {
|
6831
|
+
var response, _a, _b;
|
6832
|
+
return __generator(this, function (_c) {
|
6833
|
+
switch (_c.label) {
|
6834
|
+
case 0:
|
6835
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.stage, FrameContexts.sidePanel);
|
6836
|
+
if (!isSupported()) {
|
6837
|
+
throw errorNotSupportedOnPlatform;
|
6838
|
+
}
|
6839
|
+
if (!isHostClientMobile()) return [3 /*break*/, 2];
|
6840
|
+
_b = (_a = JSON).parse;
|
6841
|
+
return [4 /*yield*/, sendAndHandleSdkError('clipboard.readFromClipboard')];
|
6842
|
+
case 1:
|
6843
|
+
response = _b.apply(_a, [_c.sent()]);
|
6844
|
+
return [2 /*return*/, base64ToBlob(response.mimeType, response.content)];
|
6845
|
+
case 2: return [2 /*return*/, sendAndHandleSdkError('clipboard.readFromClipboard')];
|
6846
|
+
}
|
6847
|
+
});
|
6848
|
+
});
|
6849
|
+
}
|
6850
|
+
clipboard.read = read;
|
6851
|
+
/**
|
6852
|
+
* Checks if clipboard capability is supported by the host
|
6853
|
+
* @returns boolean to represent whether the clipboard capability is supported
|
6854
|
+
*
|
6855
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
6856
|
+
*
|
6857
|
+
* @beta
|
6858
|
+
*/
|
6859
|
+
function isSupported() {
|
6860
|
+
return ensureInitialized(runtime) && navigator && navigator.clipboard && runtime.supports.clipboard ? true : false;
|
6861
|
+
}
|
6862
|
+
clipboard.isSupported = isSupported;
|
6863
|
+
})(clipboard || (clipboard = {}));
|
6864
|
+
|
6774
6865
|
;// CONCATENATED MODULE: ./src/public/geoLocation.ts
|
6775
6866
|
|
6776
6867
|
|
@@ -7145,7 +7236,7 @@ var location_location;
|
|
7145
7236
|
})(location_location || (location_location = {}));
|
7146
7237
|
|
7147
7238
|
;// CONCATENATED MODULE: ./src/public/meeting.ts
|
7148
|
-
var
|
7239
|
+
var meeting_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7149
7240
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7150
7241
|
return new (P || (P = Promise))(function (resolve, reject) {
|
7151
7242
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -7154,7 +7245,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
7154
7245
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
7155
7246
|
});
|
7156
7247
|
};
|
7157
|
-
var
|
7248
|
+
var meeting_generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
7158
7249
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
7159
7250
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
7160
7251
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
@@ -7587,9 +7678,9 @@ var meeting;
|
|
7587
7678
|
if (typeof isHostAudioless !== 'boolean') {
|
7588
7679
|
throw new Error('[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean');
|
7589
7680
|
}
|
7590
|
-
var micStateChangedCallback = function (micState) { return
|
7681
|
+
var micStateChangedCallback = function (micState) { return meeting_awaiter(_this, void 0, void 0, function () {
|
7591
7682
|
var newMicState, micStateDidUpdate, _a;
|
7592
|
-
return
|
7683
|
+
return meeting_generator(this, function (_b) {
|
7593
7684
|
switch (_b.label) {
|
7594
7685
|
case 0:
|
7595
7686
|
_b.trys.push([0, 2, , 3]);
|
@@ -8782,7 +8873,7 @@ var video_generator = (undefined && undefined.__generator) || function (thisArg,
|
|
8782
8873
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
8783
8874
|
}
|
8784
8875
|
};
|
8785
|
-
var
|
8876
|
+
var video_rest = (undefined && undefined.__rest) || function (s, e) {
|
8786
8877
|
var t = {};
|
8787
8878
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
8788
8879
|
t[p] = s[p];
|
@@ -9040,7 +9131,7 @@ var video;
|
|
9040
9131
|
}
|
9041
9132
|
else {
|
9042
9133
|
// The host may pass the VideoFrame with the old definition which has `data` instead of `videoFrameBuffer`
|
9043
|
-
var data = videoBufferData.data, newVideoBufferData =
|
9134
|
+
var data = videoBufferData.data, newVideoBufferData = video_rest(videoBufferData, ["data"]);
|
9044
9135
|
return video_assign(video_assign({}, newVideoBufferData), { videoFrameBuffer: data });
|
9045
9136
|
}
|
9046
9137
|
}
|