@microsoft/teams-js 2.37.0-beta.0 → 2.38.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/README.md CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
24
24
 
25
25
  ### Production
26
26
 
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.36.0/js/MicrosoftTeams.min.js) or point your package manager at them.
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.37.0/js/MicrosoftTeams.min.js) or point your package manager at them.
28
28
 
29
29
  ## Usage
30
30
 
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
45
45
  ```html
46
46
  <!-- Microsoft Teams JavaScript API (via CDN) -->
47
47
  <script
48
- src="https://res.cdn.office.net/teams-js/2.36.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-Vg2zZJuta2CG1wHGm8f5belcapTREs0cxiGzaMgVWI/apjFxwHqOgYOon/OqPXP7"
48
+ src="https://res.cdn.office.net/teams-js/2.37.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-+OMQ/6mqZshXOsxUMXFX4gtF5cMsJTNH6ldUO3QThAsuQyv7R0ZpnpJmvrsPwzf4"
50
50
  crossorigin="anonymous"
51
51
  ></script>
52
52
 
53
53
  <!-- Microsoft Teams JavaScript API (via npm) -->
54
- <script src="node_modules/@microsoft/teams-js@2.36.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.37.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as appHelpers from '../../internal/appHelpers';
6
6
  import { AppId } from '../appId';
7
- import { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from '../constants';
7
+ import { ChannelType, FrameContexts, HostClientType, HostName, RenderingSurfaces, TeamType, UserTeamRole } from '../constants';
8
8
  import { ActionInfo, FileOpenPreference, HostToAppPerformanceMetrics, LocaleInfo } from '../interfaces';
9
9
  import * as lifecycle from './lifecycle';
10
10
  /** App Initialization Messages */
@@ -236,6 +236,11 @@ export interface PageInfo {
236
236
  * The context where page url is loaded (content, task, setting, remove, sidePanel)
237
237
  */
238
238
  frameContext: FrameContexts;
239
+ /**
240
+ * The mode or surface where the page is rendered (e.g. sidePanel, meetingStage, etc.)
241
+ * This will be used by the app developers in future to know where in the host the app is rendered instead of the frameContext.
242
+ */
243
+ renderingSurface?: RenderingSurfaces;
239
244
  /**
240
245
  * The developer-defined unique ID for the sub-page this content points to.
241
246
  * This field should be used to restore to a specific state within a page,
@@ -93,6 +93,20 @@ export declare enum FrameContexts {
93
93
  /** App's frame context from where meetingStage can be accessed in a meeting session, which is the primary area where video and presentation content is displayed during a meeting. */
94
94
  meetingStage = "meetingStage"
95
95
  }
96
+ /**
97
+ * RenderingSurfaces describes the context or surface in which your app is being displayed within the host application.
98
+ * This parameter allows your app to detect where it is rendered (for example, in a side panel or stage view)
99
+ * and adjust its behavior or UI accordingly. The intent is to help developers understand the user's context of use,
100
+ * not the exact pixel size or layout. If a host (such as Outlook Meeting Apps) changes the size of a surface (e.g., makes the side panel larger),
101
+ * it will still use the same RenderingSurface value. Developers are expected to use responsive UI techniques to adapt to size changes,
102
+ * since the user's context and intent remain the same even if the surface dimensions change.
103
+ */
104
+ export declare enum RenderingSurfaces {
105
+ /**
106
+ * The mode the copilot app rendered by the host.
107
+ */
108
+ copilotSidePanel = "copilotSidePanel"
109
+ }
96
110
  /**
97
111
  * Indicates the team type, currently used to distinguish between different team
98
112
  * types in Office 365 for Education (team types 1, 2, 3, and 4).
@@ -1,5 +1,5 @@
1
1
  export * as authentication from './authentication';
2
- export { ChannelType, DialogDimension, FrameContexts, HostClientType, HostName, TaskModuleDimension, TeamType, UserTeamRole, } from './constants';
2
+ export { ChannelType, DialogDimension, FrameContexts, HostClientType, HostName, RenderingSurfaces, TaskModuleDimension, TeamType, UserTeamRole, } from './constants';
3
3
  export { ActionInfo, ActionObjectType, AdaptiveCardVersion, AdaptiveCardDialogInfo, BaseActionObject, BotAdaptiveCardDialogInfo, BotUrlDialogInfo, Context, DeepLinkParameters, DialogInfo, DialogSize, EduType, ErrorCode, FileOpenPreference, FrameContext, FrameInfo, HostToAppPerformanceMetrics, LoadContext, LocaleInfo, M365ContentAction, ResumeContext, SdkError, SecondaryId, SecondaryM365ContentIdName, ShareDeepLinkParameters, TabInformation, TabInstance, TabInstanceParameters, TaskInfo, TeamInformation, UrlDialogInfo, } from './interfaces';
4
4
  export * as app from './app/app';
5
5
  export { AppId } from './appId';
@@ -1,4 +1,4 @@
1
- import { ChannelType, DialogDimension, HostClientType, HostName, TeamType, UserTeamRole } from './constants';
1
+ import { ChannelType, DialogDimension, HostClientType, HostName, RenderingSurfaces, TeamType, UserTeamRole } from './constants';
2
2
  import { FrameContexts } from './constants';
3
3
  /**
4
4
  * Represents information about tabs for an app
@@ -512,6 +512,13 @@ export interface Context {
512
512
  * The context where tab url is loaded (content, task, setting, remove, sidePanel)
513
513
  */
514
514
  frameContext?: FrameContexts;
515
+ /**
516
+ * @deprecated
517
+ * As of TeamsJS v2.0.0, please use {@link app.PageInfo.renderingSurface | app.Context.page.renderingSurface} instead
518
+ *
519
+ * The surface where the tab is rendered (sidePanel, meeting, chat, channel)
520
+ */
521
+ renderingSurface?: RenderingSurfaces;
515
522
  /**
516
523
  * @deprecated
517
524
  * As of TeamsJS v2.0.0, please use {@link app.Context | app.Context.sharepoint} instead
@@ -1 +1 @@
1
- export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/logs.js";export{e as logs};import*as r from"./private/conversations.js";export{r as conversations};import*as t from"./private/copilot/copilot.js";export{t as copilot};import*as o from"./private/externalAppAuthentication.js";export{o as externalAppAuthentication};import*as p from"./private/externalAppAuthenticationForCEA.js";export{p as externalAppAuthenticationForCEA};import*as i from"./private/externalAppCardActions.js";export{i as externalAppCardActions};import*as a from"./private/externalAppCardActionsForCEA.js";export{a as externalAppCardActionsForCEA};import*as s from"./private/externalAppCardActionsForDA.js";export{s as externalAppCardActionsForDA};import*as m from"./private/externalAppCommands.js";export{m as externalAppCommands};import*as n from"./private/files.js";export{n as files};import*as l from"./private/meetingRoom.js";export{l as meetingRoom};import*as c from"./private/messageChannels/messageChannels.js";export{c as messageChannels};import*as f from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{f as nestedAppAuthBridge};import*as u from"./private/notifications.js";export{u as notifications};import*as x from"./private/otherAppStateChange.js";export{x as otherAppStateChange};import*as j from"./private/remoteCamera.js";export{j as remoteCamera};import*as d from"./private/appEntity.js";export{d as appEntity};import*as g from"./private/teams/teams.js";export{g as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as v from"./private/hostEntity/hostEntity.js";export{v as hostEntity};import*as C from"./private/store.js";export{C as store};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,EduType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{activateChildProxyingCommunication,getCurrentFeatureFlagsState,overwriteFeatureFlagsState,setFeatureFlagsState}from"./public/featureFlags.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{ValidatedSafeString}from"./public/validatedSafeString.js";export{version}from"./public/version.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{UUID}from"./public/uuidObject.js";import*as A from"./public/liveShareHost.js";export{A as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as h from"./public/authentication.js";export{h as authentication};import*as S from"./public/app/app.js";export{S as app};import*as H from"./public/appInstallDialog.js";export{H as appInstallDialog};import*as F from"./public/barCode.js";export{F as barCode};import*as y from"./public/chat.js";export{y as chat};import*as T from"./public/clipboard.js";export{T as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as D from"./public/nestedAppAuth.js";export{D as nestedAppAuth};import*as I from"./public/geoLocation/geoLocation.js";export{I as geoLocation};import*as w from"./public/pages/pages.js";export{w as pages};import*as B from"./public/menus.js";export{B as menus};import*as P from"./public/media.js";export{P as media};import*as k from"./public/secondaryBrowser.js";export{k as secondaryBrowser};import*as L from"./public/location.js";export{L as location};import*as M from"./public/meeting/meeting.js";export{M as meeting};import*as U from"./public/monetization.js";export{U as monetization};import*as O from"./public/calendar.js";export{O as calendar};import*as V from"./public/mail/mail.js";export{V as mail};import*as z from"./public/teamsAPIs.js";export{z as teamsCore};import*as W from"./public/people.js";export{W as people};import*as N from"./public/profile.js";export{N as profile};import*as R from"./public/videoEffects.js";export{R as videoEffects};import*as q from"./public/search.js";export{q as search};import*as G from"./public/sharing/sharing.js";export{G as sharing};import*as J from"./public/stageView/stageView.js";export{J as stageView};import*as K from"./public/visualMedia/visualMedia.js";export{K as visualMedia};import*as Q from"./public/webStorage.js";export{Q as webStorage};import*as X from"./public/call.js";export{X as call};import*as Y from"./public/appInitialization.js";export{Y as appInitialization};import*as Z from"./public/thirdPartyCloudStorage.js";export{Z as thirdPartyCloudStorage};import*as $ from"./public/settings.js";export{$ as settings};import*as _ from"./public/tasks.js";export{_ as tasks};import*as ee from"./public/marketplace.js";export{ee as marketplace};
1
+ export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/logs.js";export{e as logs};import*as r from"./private/conversations.js";export{r as conversations};import*as t from"./private/copilot/copilot.js";export{t as copilot};import*as o from"./private/externalAppAuthentication.js";export{o as externalAppAuthentication};import*as p from"./private/externalAppAuthenticationForCEA.js";export{p as externalAppAuthenticationForCEA};import*as i from"./private/externalAppCardActions.js";export{i as externalAppCardActions};import*as a from"./private/externalAppCardActionsForCEA.js";export{a as externalAppCardActionsForCEA};import*as s from"./private/externalAppCardActionsForDA.js";export{s as externalAppCardActionsForDA};import*as m from"./private/externalAppCommands.js";export{m as externalAppCommands};import*as n from"./private/files.js";export{n as files};import*as l from"./private/meetingRoom.js";export{l as meetingRoom};import*as c from"./private/messageChannels/messageChannels.js";export{c as messageChannels};import*as f from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{f as nestedAppAuthBridge};import*as u from"./private/notifications.js";export{u as notifications};import*as x from"./private/otherAppStateChange.js";export{x as otherAppStateChange};import*as j from"./private/remoteCamera.js";export{j as remoteCamera};import*as d from"./private/appEntity.js";export{d as appEntity};import*as g from"./private/teams/teams.js";export{g as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as v from"./private/hostEntity/hostEntity.js";export{v as hostEntity};import*as C from"./private/store.js";export{C as store};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,RenderingSurfaces,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,EduType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{activateChildProxyingCommunication,getCurrentFeatureFlagsState,overwriteFeatureFlagsState,setFeatureFlagsState}from"./public/featureFlags.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{ValidatedSafeString}from"./public/validatedSafeString.js";export{version}from"./public/version.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{UUID}from"./public/uuidObject.js";import*as A from"./public/liveShareHost.js";export{A as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as h from"./public/authentication.js";export{h as authentication};import*as S from"./public/app/app.js";export{S as app};import*as H from"./public/appInstallDialog.js";export{H as appInstallDialog};import*as F from"./public/barCode.js";export{F as barCode};import*as y from"./public/chat.js";export{y as chat};import*as T from"./public/clipboard.js";export{T as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as D from"./public/nestedAppAuth.js";export{D as nestedAppAuth};import*as I from"./public/geoLocation/geoLocation.js";export{I as geoLocation};import*as w from"./public/pages/pages.js";export{w as pages};import*as B from"./public/menus.js";export{B as menus};import*as P from"./public/media.js";export{P as media};import*as k from"./public/secondaryBrowser.js";export{k as secondaryBrowser};import*as L from"./public/location.js";export{L as location};import*as M from"./public/meeting/meeting.js";export{M as meeting};import*as U from"./public/monetization.js";export{U as monetization};import*as O from"./public/calendar.js";export{O as calendar};import*as V from"./public/mail/mail.js";export{V as mail};import*as z from"./public/teamsAPIs.js";export{z as teamsCore};import*as W from"./public/people.js";export{W as people};import*as N from"./public/profile.js";export{N as profile};import*as R from"./public/videoEffects.js";export{R as videoEffects};import*as q from"./public/search.js";export{q as search};import*as G from"./public/sharing/sharing.js";export{G as sharing};import*as J from"./public/stageView/stageView.js";export{J as stageView};import*as K from"./public/visualMedia/visualMedia.js";export{K as visualMedia};import*as Q from"./public/webStorage.js";export{Q as webStorage};import*as X from"./public/call.js";export{X as call};import*as Y from"./public/appInitialization.js";export{Y as appInitialization};import*as Z from"./public/thirdPartyCloudStorage.js";export{Z as thirdPartyCloudStorage};import*as $ from"./public/settings.js";export{$ as settings};import*as _ from"./public/tasks.js";export{_ as tasks};import*as ee from"./public/marketplace.js";export{ee as marketplace};
@@ -1 +1 @@
1
- import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,openLinkHelper as s}from"../../internal/appHelpers.js";import{uninitializeCommunication as r,sendAndUnwrap as l,Communication as m}from"../../internal/communication.js";import{GlobalVars as d}from"../../internal/globalVars.js";import{uninitializeHandlers as p,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as u}from"../../internal/internalAPIs.js";import{getLogger as f,getApiVersionTag as h}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as I}from"../../internal/utils.js";import{AppId as g}from"../appId.js";import{HostName as y,HostClientType as S}from"../constants.js";import{version as T}from"../version.js";import*as C from"./lifecycle.js";export{C as lifecycle};import{_clearTelemetryPort as v}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as P}from"../../private/messageChannels/dataLayer.js";const j="v2",w=f("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var O,b;function F(){return d.initializeCompleted}function x(){return d.frameContext}function L(i){return e(h(j,"app.initialize"),i)}function A(e){m.currentWindow=e}function z(){d.initializeCalled&&(p(),d.initializeCalled=!1,d.initializeCompleted=!1,d.initializePromise=void 0,d.additionalValidOrigins=[],d.frameContext=void 0,d.hostClientType=void 0,d.isFramelessWindow=!1,v(),P(),r())}function D(){return new Promise((e=>{u(),e(l(h(j,"app.getContext"),"getContext"))})).then((e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:y.teams,clientType:e.hostClientType?e.hostClientType:S.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId,appId:e.appId?new g(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e)))}function k(){u(),i(h(j,"app.notifyAppLoaded"))}function U(){return t(h(j,"app.notifySuccess"))}function V(e){u(),n(h(j,"app.notifyFailure"),e)}function E(e){u(),a(h(j,"app.notifyExpectedFailure"),e)}function H(e){o(h(j,"app.registerOnThemeChangeHandler"),e)}function M(e){c(e)}function W(e){return s(h(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(O||(O={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(b||(b={})),w("teamsjs instance is version %s, starting at %s UTC (%s local)",T,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(I())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?w("teamsjs is being used from %s. %s",i,t):w("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{b as ExpectedFailureReason,O as FailedReason,N as Messages,A as _initialize,z as _uninitialize,D as getContext,x as getFrameContext,L as initialize,F as isInitialized,k as notifyAppLoaded,E as notifyExpectedFailure,V as notifyFailure,U as notifySuccess,W as openLink,M as registerHostToAppPerformanceMetricsHandler,H as registerOnThemeChangeHandler};
1
+ import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,openLinkHelper as r}from"../../internal/appHelpers.js";import{uninitializeCommunication as s,sendAndUnwrap as l,Communication as m}from"../../internal/communication.js";import{GlobalVars as d}from"../../internal/globalVars.js";import{uninitializeHandlers as p,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as u}from"../../internal/internalAPIs.js";import{getLogger as f,getApiVersionTag as h}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as g}from"../../internal/utils.js";import{AppId as I}from"../appId.js";import{HostName as y,HostClientType as S}from"../constants.js";import{version as T}from"../version.js";import*as C from"./lifecycle.js";export{C as lifecycle};import{_clearTelemetryPort as v}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as P}from"../../private/messageChannels/dataLayer.js";const j="v2",w=f("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var O,b;function F(){return d.initializeCompleted}function x(){return d.frameContext}function L(i){return e(h(j,"app.initialize"),i)}function A(e){m.currentWindow=e}function z(){d.initializeCalled&&(p(),d.initializeCalled=!1,d.initializeCompleted=!1,d.initializePromise=void 0,d.additionalValidOrigins=[],d.frameContext=void 0,d.hostClientType=void 0,d.isFramelessWindow=!1,v(),P(),s())}function D(){return new Promise((e=>{u(),e(l(h(j,"app.getContext"),"getContext"))})).then((e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:y.teams,clientType:e.hostClientType?e.hostClientType:S.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId,appId:e.appId?new I(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,renderingSurface:e.renderingSurface?e.renderingSurface:void 0,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e)))}function k(){u(),i(h(j,"app.notifyAppLoaded"))}function U(){return t(h(j,"app.notifySuccess"))}function V(e){u(),n(h(j,"app.notifyFailure"),e)}function E(e){u(),a(h(j,"app.notifyExpectedFailure"),e)}function H(e){o(h(j,"app.registerOnThemeChangeHandler"),e)}function M(e){c(e)}function W(e){return r(h(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(O||(O={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(b||(b={})),w("teamsjs instance is version %s, starting at %s UTC (%s local)",T,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(g())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?w("teamsjs is being used from %s. %s",i,t):w("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{b as ExpectedFailureReason,O as FailedReason,N as Messages,A as _initialize,z as _uninitialize,D as getContext,x as getFrameContext,L as initialize,F as isInitialized,k as notifyAppLoaded,E as notifyExpectedFailure,V as notifyFailure,U as notifySuccess,W as openLink,M as registerHostToAppPerformanceMetricsHandler,H as registerOnThemeChangeHandler};
@@ -1 +1 @@
1
- import{ErrorCode as e}from"./interfaces.js";var o,s,a,i,n,t,r;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.visionOS="visionOS",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(o||(o={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(s||(s={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(a||(a={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(i||(i={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(n||(n={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(t||(t={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(r||(r={}));const m={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},d={majorVersion:1,minorVersion:5},u={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},l=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),c=new Error("Invalid response: Received more images than the specified max limit in the response.");export{r as ChannelType,t as DialogDimension,a as FrameContexts,o as HostClientType,s as HostName,t as TaskModuleDimension,i as TeamType,n as UserTeamRole,l as errorInvalidCount,c as errorInvalidResponse,m as errorNotSupportedOnPlatform,d as minAdaptiveCardVersion,u as teamsMinAdaptiveCardVersion};
1
+ import{ErrorCode as e}from"./interfaces.js";var o,a,i,s,n,t,r,m;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.visionOS="visionOS",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(o||(o={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(a||(a={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(i||(i={})),function(e){e.copilotSidePanel="copilotSidePanel"}(s||(s={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(n||(n={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(t||(t={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(r||(r={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(m||(m={}));const d={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},l={majorVersion:1,minorVersion:5},u={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},c=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),f=new Error("Invalid response: Received more images than the specified max limit in the response.");export{m as ChannelType,r as DialogDimension,i as FrameContexts,o as HostClientType,a as HostName,s as RenderingSurfaces,r as TaskModuleDimension,n as TeamType,t as UserTeamRole,c as errorInvalidCount,f as errorInvalidResponse,d as errorNotSupportedOnPlatform,l as minAdaptiveCardVersion,u as teamsMinAdaptiveCardVersion};
@@ -1 +1 @@
1
- const t="2.37.0-beta.0";export{t as version};
1
+ const t="2.38.0-beta.0";export{t as version};
@@ -1005,6 +1005,7 @@ __webpack_require__.d(__webpack_exports__, {
1005
1005
  LiveShareHost: () => (/* reexport */ LiveShareHost),
1006
1006
  NotificationTypes: () => (/* reexport */ NotificationTypes),
1007
1007
  ParentAppWindow: () => (/* reexport */ ParentAppWindow),
1008
+ RenderingSurfaces: () => (/* reexport */ RenderingSurfaces),
1008
1009
  SecondaryM365ContentIdName: () => (/* reexport */ SecondaryM365ContentIdName),
1009
1010
  TaskModuleDimension: () => (/* reexport */ DialogDimension),
1010
1011
  TeamType: () => (/* reexport */ TeamType),
@@ -3433,6 +3434,21 @@ var FrameContexts;
3433
3434
  /** App's frame context from where meetingStage can be accessed in a meeting session, which is the primary area where video and presentation content is displayed during a meeting. */
3434
3435
  FrameContexts["meetingStage"] = "meetingStage";
3435
3436
  })(FrameContexts || (FrameContexts = {}));
3437
+ /**
3438
+ * RenderingSurfaces describes the context or surface in which your app is being displayed within the host application.
3439
+ * This parameter allows your app to detect where it is rendered (for example, in a side panel or stage view)
3440
+ * and adjust its behavior or UI accordingly. The intent is to help developers understand the user's context of use,
3441
+ * not the exact pixel size or layout. If a host (such as Outlook Meeting Apps) changes the size of a surface (e.g., makes the side panel larger),
3442
+ * it will still use the same RenderingSurface value. Developers are expected to use responsive UI techniques to adapt to size changes,
3443
+ * since the user's context and intent remain the same even if the surface dimensions change.
3444
+ */
3445
+ var RenderingSurfaces;
3446
+ (function (RenderingSurfaces) {
3447
+ /**
3448
+ * The mode the copilot app rendered by the host.
3449
+ */
3450
+ RenderingSurfaces["copilotSidePanel"] = "copilotSidePanel";
3451
+ })(RenderingSurfaces || (RenderingSurfaces = {}));
3436
3452
  /**
3437
3453
  * Indicates the team type, currently used to distinguish between different team
3438
3454
  * types in Office 365 for Education (team types 1, 2, 3, and 4).
@@ -4535,7 +4551,7 @@ function isSerializable(arg) {
4535
4551
  * @hidden
4536
4552
  * Package version.
4537
4553
  */
4538
- const version = "2.37.0-beta.0";
4554
+ const version = "2.38.0-beta.0";
4539
4555
 
4540
4556
  ;// ./src/public/featureFlags.ts
4541
4557
  // All build feature flags are defined inside this object. Any build feature flag must have its own unique getter and setter function. This pattern allows for client apps to treeshake unused code and avoid including code guarded by this feature flags in the final bundle. If this property isn't desired, use the below runtime feature flags object.
@@ -5436,6 +5452,7 @@ function transformLegacyContextToAppContext(legacyContext) {
5436
5452
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5437
5453
  // @ts-ignore
5438
5454
  frameContext: legacyContext.frameContext ? legacyContext.frameContext : GlobalVars.frameContext,
5455
+ renderingSurface: legacyContext.renderingSurface ? legacyContext.renderingSurface : undefined,
5439
5456
  subPageId: legacyContext.subEntityId,
5440
5457
  isFullScreen: legacyContext.isFullScreen,
5441
5458
  isMultiWindow: legacyContext.isMultiWindow,