@microsoft/teams-js 2.2.1-beta.0 → 2.3.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.
package/LICENSE CHANGED
@@ -1,12 +1,12 @@
1
- Microsoft Teams JS Library
2
-
3
- Copyright (c) Microsoft Corporation
4
- All rights reserved.
5
-
6
- MIT License
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
-
1
+ Microsoft Teams JS Library
2
+
3
+ Copyright (c) Microsoft Corporation
4
+ All rights reserved.
5
+
6
+ MIT License
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
12
  THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,74 +1,74 @@
1
- # Microsoft Teams JavaScript client SDK
2
-
3
- Welcome to the Teams JavaScript client SDK! For breaking changes, please refer to our [changelog](./CHANGELOG.md) in the current `<root>/packages/teams-js` directory.
4
-
5
- This JavaScript library is part of the [Microsoft Teams developer platform](https://docs.microsoft.com/en-us/microsoftteams/platform/). See full [SDK reference documentation](https://docs.microsoft.com/javascript/api/overview/msteams-client?view=msteams-client-js-latest).
6
-
7
- ## Getting Started
8
-
9
- See [instructions](../../README.md#Getting-Started) in the monorepo root for how to clone and build the repository.
10
-
11
- Whenever building or testing the Teams client SDK, you can run `yarn build` or `yarn test` from the packages/teams-js directory.
12
-
13
- ## Installation
14
-
15
- To install the stable [version](https://docs.microsoft.com/javascript/api/overview/msteams-client?view=msteams-client-js-latest):
16
-
17
- ### npm
18
-
19
- `npm install --save @microsoft/teams-js`
20
-
21
- ### yarn
22
-
23
- `yarn add @microsoft/teams-js`
24
-
25
- ### Production
26
-
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.2.0/js/MicrosoftTeams.min.js) or point your package manager at them.
28
-
29
- ## Usage
30
-
31
- ### As a package
32
-
33
- Install either using npm or yarn.
34
-
35
- **If you are using any dependency loader** such as [RequireJS](http://requirejs.org/) or [SystemJS](https://github.com/systemjs/systemjs) or module bundler such as [browserify](http://browserify.org/), [webpack](https://webpack.github.io/), you can use `import` syntax to import specific modules. For e.g.
36
-
37
- ```typescript
38
- import { app } from '@microsoft/teams-js';
39
- ```
40
-
41
- ### As a script tag
42
-
43
- Reference the SDK inside of your `.html` page using:
44
-
45
- ```html
46
- <!-- Microsoft Teams JavaScript API (via CDN) -->
47
- <script
48
- src="https://res.cdn.office.net/teams-js/2.2.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-yBjE++eHeBPzIg+IKl9OHFqMbSdrzY2S/LW3qeitc5vqXewEYRWegByWzBN/chRh"
50
- crossorigin="anonymous"
51
- ></script>
52
-
53
- <!-- Microsoft Teams JavaScript API (via npm) -->
54
- <script src="node_modules/@microsoft/teams-js@2.2.0/dist/MicrosoftTeams.min.js"></script>
55
-
56
- <!-- Microsoft Teams JavaScript API (via local) -->
57
- <script src="MicrosoftTeams.min.js"></script>
58
- ```
59
-
60
- ### Dependencies
61
-
62
- Teams client SDK depends on [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) type. If you support older browsers and devices which may not yet provide it natively (e.g. IE 11), you need to provide a global polyfill, such as [es6-promise](https://www.npmjs.com/package/es6-promise), in your bundled application. If you're using a script tag to reference the Teams client SDK, you need to make sure the polyfill is included and initialized before the Teams client SDK is.
63
-
64
- ## Examples
65
-
66
- Stay tuned for examples coming soon.
67
-
68
- ## Testing
69
-
70
- The [Teams Test App](https://aka.ms/teams-test-app) is used to validate the Teams client SDK APIs.
71
-
72
- ## Contributing
73
-
74
- Please be sure to check out the [Contributor's guide](../../CONTRIBUTING.md) for crucial steps.
1
+ # Microsoft Teams JavaScript client SDK
2
+
3
+ Welcome to the Teams JavaScript client SDK! For breaking changes, please refer to our [changelog](./CHANGELOG.md) in the current `<root>/packages/teams-js` directory.
4
+
5
+ This JavaScript library is part of the [Microsoft Teams developer platform](https://docs.microsoft.com/en-us/microsoftteams/platform/). See full [SDK reference documentation](https://docs.microsoft.com/javascript/api/overview/msteams-client?view=msteams-client-js-latest).
6
+
7
+ ## Getting Started
8
+
9
+ See [instructions](../../README.md#Getting-Started) in the monorepo root for how to clone and build the repository.
10
+
11
+ Whenever building or testing the Teams client SDK, you can run `yarn build` or `yarn test` from the packages/teams-js directory.
12
+
13
+ ## Installation
14
+
15
+ To install the stable [version](https://docs.microsoft.com/javascript/api/overview/msteams-client?view=msteams-client-js-latest):
16
+
17
+ ### npm
18
+
19
+ `npm install --save @microsoft/teams-js`
20
+
21
+ ### yarn
22
+
23
+ `yarn add @microsoft/teams-js`
24
+
25
+ ### Production
26
+
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.2.0/js/MicrosoftTeams.min.js) or point your package manager at them.
28
+
29
+ ## Usage
30
+
31
+ ### As a package
32
+
33
+ Install either using npm or yarn.
34
+
35
+ **If you are using any dependency loader** such as [RequireJS](http://requirejs.org/) or [SystemJS](https://github.com/systemjs/systemjs) or module bundler such as [browserify](http://browserify.org/), [webpack](https://webpack.github.io/), you can use `import` syntax to import specific modules. For e.g.
36
+
37
+ ```typescript
38
+ import { app } from '@microsoft/teams-js';
39
+ ```
40
+
41
+ ### As a script tag
42
+
43
+ Reference the SDK inside of your `.html` page using:
44
+
45
+ ```html
46
+ <!-- Microsoft Teams JavaScript API (via CDN) -->
47
+ <script
48
+ src="https://res.cdn.office.net/teams-js/2.2.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-yBjE++eHeBPzIg+IKl9OHFqMbSdrzY2S/LW3qeitc5vqXewEYRWegByWzBN/chRh"
50
+ crossorigin="anonymous"
51
+ ></script>
52
+
53
+ <!-- Microsoft Teams JavaScript API (via npm) -->
54
+ <script src="node_modules/@microsoft/teams-js@2.2.0/dist/MicrosoftTeams.min.js"></script>
55
+
56
+ <!-- Microsoft Teams JavaScript API (via local) -->
57
+ <script src="MicrosoftTeams.min.js"></script>
58
+ ```
59
+
60
+ ### Dependencies
61
+
62
+ Teams client SDK depends on [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) type. If you support older browsers and devices which may not yet provide it natively (e.g. IE 11), you need to provide a global polyfill, such as [es6-promise](https://www.npmjs.com/package/es6-promise), in your bundled application. If you're using a script tag to reference the Teams client SDK, you need to make sure the polyfill is included and initialized before the Teams client SDK is.
63
+
64
+ ## Examples
65
+
66
+ Stay tuned for examples coming soon.
67
+
68
+ ## Testing
69
+
70
+ The [Teams Test App](https://aka.ms/teams-test-app) is used to validate the Teams client SDK APIs.
71
+
72
+ ## Contributing
73
+
74
+ Please be sure to check out the [Contributor's guide](../../CONTRIBUTING.md) for crucial steps.
@@ -5886,6 +5886,92 @@ export namespace video {
5886
5886
  function isSupported(): boolean;
5887
5887
  }
5888
5888
 
5889
+ /**
5890
+ * Allows your application to interact with the host M365 application's search box.
5891
+ * By integrating your application with the host's search box, users can search
5892
+ * your app using the same search box they use elsewhere in Teams, Outlook, or Office.
5893
+ *
5894
+ * This functionality is in Beta.
5895
+ * @beta
5896
+ */
5897
+ export namespace search {
5898
+ /**
5899
+ * This interface contains information pertaining to the contents of the host M365 application's search box
5900
+ *
5901
+ * @beta
5902
+ */
5903
+ interface SearchQuery {
5904
+ /** The current search term in the host search experience */
5905
+ searchTerm: string;
5906
+ /** Timestamp sequence value to ensure messages are processed in correct order / combine them. */
5907
+ timestamp: number;
5908
+ }
5909
+ /**
5910
+ * This type will store the SearchQuery and allow other logic to be made inside the handler.
5911
+ *
5912
+ * @beta
5913
+ */
5914
+ type SearchQueryHandler = (query: SearchQuery) => void;
5915
+ /**
5916
+ * Allows the caller to register for various events fired by the host search experience.
5917
+ * Calling this function indicates that your application intends to plug into the host's search box and handle search events,
5918
+ * when the user is actively using your page/tab.
5919
+ *
5920
+ * The host may visually update its search box, e.g. with the name or icon of your application.
5921
+ *
5922
+ * Your application should *not* re-render inside of these callbacks, there may be a large number
5923
+ * of onChangeHandler calls if the user is typing rapidly in the search box.
5924
+ *
5925
+ * @param onChangeHandler - This optional handler will be called when the user first starts using the
5926
+ * host's search box and as the user types their query. Can be used to put your application into a
5927
+ * word-wheeling state or to display suggestions as the user is typing.
5928
+ *
5929
+ * This handler will be called with an empty {@link SearchQuery.searchTerm} when search is beginning, and subsequently,
5930
+ * with the current contents of the search box.
5931
+ *
5932
+ * @param onClosedHandler - This handler will be called when the user exits or cancels their search.
5933
+ * Should be used to return your application to its most recent, non-search state. The value of {@link SearchQuery.searchTerm}
5934
+ * will be whatever the last query was before ending search.
5935
+ *
5936
+ * @param onExecuteHandler - The handler will be called when the user executes their
5937
+ * search (by pressing Enter for example). Should be used to display the full list of search results.
5938
+ * The value of {@link SearchQuery.searchTerm} is the complete query the user entered in the search box.
5939
+ *
5940
+ * @example
5941
+ * ``` ts
5942
+ * search.registerHandlers(
5943
+ query => {
5944
+ console.log(`Update your application with the changed search query: ${query.searchTerm}`);
5945
+ },
5946
+ query => {
5947
+ console.log('Update your application to handle the search experience being closed. Last query: ${query.searchTerm}');
5948
+ },
5949
+ query => {
5950
+ console.log(`Update your application to handle an executed search result: ${query.searchTerm}`);
5951
+ },
5952
+ );
5953
+ * ```
5954
+ *
5955
+ * @beta
5956
+ */
5957
+ function registerHandlers(onClosedHandler: SearchQueryHandler, onExecuteHandler: SearchQueryHandler, onChangeHandler?: SearchQueryHandler): void;
5958
+ /**
5959
+ * Allows the caller to unregister for all events fired by the host search experience. Calling
5960
+ * this function will cause your app to stop appearing in the set of search scopes in the hosts
5961
+ *
5962
+ * @beta
5963
+ */
5964
+ function unregisterHandlers(): void;
5965
+ /**
5966
+ * Checks if search capability is supported by the host
5967
+ * @returns true if the search capability is supported by the host and false otherwise
5968
+ * false if it is disabled
5969
+ *
5970
+ * @beta
5971
+ */
5972
+ function isSupported(): boolean;
5973
+ }
5974
+
5889
5975
  export namespace sharing {
5890
5976
  export const SharingAPIMessages: {
5891
5977
  shareWebContent: string;
@@ -1111,6 +1111,7 @@ __webpack_require__.d(__webpack_exports__, {
1111
1111
  "registerUserSettingsChangeHandler": () => (/* reexport */ registerUserSettingsChangeHandler),
1112
1112
  "remoteCamera": () => (/* reexport */ remoteCamera),
1113
1113
  "returnFocus": () => (/* reexport */ returnFocus),
1114
+ "search": () => (/* reexport */ search),
1114
1115
  "sendCustomEvent": () => (/* reexport */ sendCustomEvent),
1115
1116
  "sendCustomMessage": () => (/* reexport */ sendCustomMessage),
1116
1117
  "setFrameContext": () => (/* reexport */ setFrameContext),
@@ -1127,7 +1128,7 @@ __webpack_require__.d(__webpack_exports__, {
1127
1128
  });
1128
1129
 
1129
1130
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1130
- var version = "2.2.1-beta.0";
1131
+ var version = "2.3.0-beta.0";
1131
1132
  /**
1132
1133
  * @hidden
1133
1134
  * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -2346,6 +2347,7 @@ var runtime = {
2346
2347
  permissions: undefined,
2347
2348
  profile: undefined,
2348
2349
  remoteCamera: undefined,
2350
+ search: undefined,
2349
2351
  sharing: undefined,
2350
2352
  stageView: undefined,
2351
2353
  teams: {
@@ -6883,6 +6885,111 @@ var video;
6883
6885
  video.isSupported = isSupported;
6884
6886
  })(video || (video = {})); //end of video namespace
6885
6887
 
6888
+ ;// CONCATENATED MODULE: ./src/public/search.ts
6889
+
6890
+
6891
+
6892
+
6893
+
6894
+ /**
6895
+ * Allows your application to interact with the host M365 application's search box.
6896
+ * By integrating your application with the host's search box, users can search
6897
+ * your app using the same search box they use elsewhere in Teams, Outlook, or Office.
6898
+ *
6899
+ * This functionality is in Beta.
6900
+ * @beta
6901
+ */
6902
+ var search;
6903
+ (function (search) {
6904
+ var onChangeHandlerName = 'search.queryChange';
6905
+ var onClosedHandlerName = 'search.queryClose';
6906
+ var onExecutedHandlerName = 'search.queryExecute';
6907
+ /**
6908
+ * Allows the caller to register for various events fired by the host search experience.
6909
+ * Calling this function indicates that your application intends to plug into the host's search box and handle search events,
6910
+ * when the user is actively using your page/tab.
6911
+ *
6912
+ * The host may visually update its search box, e.g. with the name or icon of your application.
6913
+ *
6914
+ * Your application should *not* re-render inside of these callbacks, there may be a large number
6915
+ * of onChangeHandler calls if the user is typing rapidly in the search box.
6916
+ *
6917
+ * @param onChangeHandler - This optional handler will be called when the user first starts using the
6918
+ * host's search box and as the user types their query. Can be used to put your application into a
6919
+ * word-wheeling state or to display suggestions as the user is typing.
6920
+ *
6921
+ * This handler will be called with an empty {@link SearchQuery.searchTerm} when search is beginning, and subsequently,
6922
+ * with the current contents of the search box.
6923
+ *
6924
+ * @param onClosedHandler - This handler will be called when the user exits or cancels their search.
6925
+ * Should be used to return your application to its most recent, non-search state. The value of {@link SearchQuery.searchTerm}
6926
+ * will be whatever the last query was before ending search.
6927
+ *
6928
+ * @param onExecuteHandler - The handler will be called when the user executes their
6929
+ * search (by pressing Enter for example). Should be used to display the full list of search results.
6930
+ * The value of {@link SearchQuery.searchTerm} is the complete query the user entered in the search box.
6931
+ *
6932
+ * @example
6933
+ * ``` ts
6934
+ * search.registerHandlers(
6935
+ query => {
6936
+ console.log(`Update your application with the changed search query: ${query.searchTerm}`);
6937
+ },
6938
+ query => {
6939
+ console.log('Update your application to handle the search experience being closed. Last query: ${query.searchTerm}');
6940
+ },
6941
+ query => {
6942
+ console.log(`Update your application to handle an executed search result: ${query.searchTerm}`);
6943
+ },
6944
+ );
6945
+ * ```
6946
+ *
6947
+ * @beta
6948
+ */
6949
+ function registerHandlers(onClosedHandler, onExecuteHandler, onChangeHandler) {
6950
+ ensureInitialized(FrameContexts.content);
6951
+ if (!isSupported()) {
6952
+ throw errorNotSupportedOnPlatform;
6953
+ }
6954
+ registerHandler(onClosedHandlerName, onClosedHandler);
6955
+ registerHandler(onExecutedHandlerName, onExecuteHandler);
6956
+ if (onChangeHandler) {
6957
+ registerHandler(onChangeHandlerName, onChangeHandler);
6958
+ }
6959
+ }
6960
+ search.registerHandlers = registerHandlers;
6961
+ /**
6962
+ * Allows the caller to unregister for all events fired by the host search experience. Calling
6963
+ * this function will cause your app to stop appearing in the set of search scopes in the hosts
6964
+ *
6965
+ * @beta
6966
+ */
6967
+ function unregisterHandlers() {
6968
+ ensureInitialized(FrameContexts.content);
6969
+ if (!isSupported()) {
6970
+ throw errorNotSupportedOnPlatform;
6971
+ }
6972
+ // This should let the host know to stop making the app scope show up in the search experience
6973
+ // Can also be used to clean up handlers on the host if desired
6974
+ sendMessageToParent('search.unregister');
6975
+ removeHandler(onChangeHandlerName);
6976
+ removeHandler(onClosedHandlerName);
6977
+ removeHandler(onExecutedHandlerName);
6978
+ }
6979
+ search.unregisterHandlers = unregisterHandlers;
6980
+ /**
6981
+ * Checks if search capability is supported by the host
6982
+ * @returns true if the search capability is supported by the host and false otherwise
6983
+ * false if it is disabled
6984
+ *
6985
+ * @beta
6986
+ */
6987
+ function isSupported() {
6988
+ return runtime.supports.search ? true : false;
6989
+ }
6990
+ search.isSupported = isSupported;
6991
+ })(search || (search = {}));
6992
+
6886
6993
  ;// CONCATENATED MODULE: ./src/public/sharing.ts
6887
6994
 
6888
6995
 
@@ -7895,6 +8002,7 @@ var tasks;
7895
8002
 
7896
8003
 
7897
8004
 
8005
+
7898
8006
 
7899
8007
 
7900
8008