@microsoft/teams-js 2.57.0 → 2.59.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.57.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.58.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.57.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-wI+6jxWlHa8aibQ/NmnIWGj7xoMU4QuKf8DV9b03tgsSA6nTYsaIntp5lO8DmTpM"
48
+ src="https://res.cdn.office.net/teams-js/2.58.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-sMo/EOqQPa1OCup2/VBRum7oFeOS22kvs8WGDc45xK53tUVZzFR5WwFYDUYN1LO4"
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.57.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.58.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -1,4 +1,4 @@
1
- import { Context } from '../public/app/app';
1
+ import { BrandColorPalettes, Context, themeHandler } from '../public/app/app';
2
2
  import { FrameContexts } from '../public/constants';
3
3
  import { HostToAppPerformanceMetrics, LoadContext, ResumeContext } from '../public/interfaces';
4
4
  /**
@@ -49,7 +49,7 @@ export declare function registerHandlerHelper(apiVersionTag: string, name: strin
49
49
  * @internal
50
50
  * Limited to Microsoft-internal use
51
51
  */
52
- export declare function registerOnThemeChangeHandler(apiVersionTag: string, handler: (theme: string) => void): void;
52
+ export declare function registerOnThemeChangeHandler(apiVersionTag: string, handler: themeHandler): void;
53
53
  /**
54
54
  * @internal
55
55
  * Limited to Microsoft-internal use
@@ -59,7 +59,7 @@ export declare function registerOnContextChangeHandler(apiVersionTag: string, ha
59
59
  * @internal
60
60
  * Limited to Microsoft-internal use
61
61
  */
62
- export declare function handleThemeChange(theme: string): void;
62
+ export declare function handleThemeChange(theme: string, brandColorPalettes?: BrandColorPalettes): void;
63
63
  /**
64
64
  * @internal
65
65
  * Limited to Microsoft-internal use
@@ -92,6 +92,18 @@ export interface IExpectedFailureRequest {
92
92
  */
93
93
  message?: string;
94
94
  }
95
+ /**
96
+ * A brand color ramp supplied by the host.
97
+ */
98
+ export interface BrandColorRamp {
99
+ readonly [shade: string]: string | undefined;
100
+ }
101
+ /**
102
+ * Brand color palettes supplied by the host.
103
+ */
104
+ export interface BrandColorPalettes {
105
+ readonly [format: string]: BrandColorRamp | undefined;
106
+ }
95
107
  /**
96
108
  * Represents application information.
97
109
  */
@@ -105,6 +117,14 @@ export interface AppInfo {
105
117
  * The current UI theme of the host. Possible values: "default", "dark", "contrast" or "glass".
106
118
  */
107
119
  theme: string;
120
+ /**
121
+ * Brand color palettes supplied by the host.
122
+ *
123
+ * Each key identifies a palette format (for example, `"fluentui/v9"`), which defines its required shades and color
124
+ * syntax. Each update replaces the whole map rather than merging with it. `undefined` means no palettes are available,
125
+ * such as after the host clears them.
126
+ */
127
+ brandColorPalettes?: BrandColorPalettes;
108
128
  /**
109
129
  * Unique ID for the current session for use in correlating telemetry data. A session corresponds to the lifecycle of an app. A new session begins upon the creation of a webview (on Teams mobile) or iframe (in Teams desktop) hosting the app, and ends when it is destroyed.
110
130
  */
@@ -500,9 +520,11 @@ export interface Context {
500
520
  dialogParameters: Record<string, string>;
501
521
  }
502
522
  /**
503
- * This function is passed to registerOnThemeHandler. It is called every time the user changes their theme.
523
+ * Called when the host sends a theme or brand color palette update.
524
+ *
525
+ * The theme, palettes, or both may change with each update.
504
526
  */
505
- export type themeHandler = (theme: string) => void;
527
+ export type themeHandler = (theme: string, brandColorPalettes?: BrandColorPalettes) => void;
506
528
  /**
507
529
  * @hidden
508
530
  * This function is passed to registerOnContextChangeHandler. It is called every time the user changes their context.
@@ -602,12 +624,13 @@ export declare function notifyFailure(appInitializationFailedRequest: IFailedReq
602
624
  */
603
625
  export declare function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
604
626
  /**
605
- * Registers a handler for theme changes.
627
+ * Registers a handler for host theme or brand color palette updates.
606
628
  *
607
629
  * @remarks
608
630
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
631
+ * The theme, palettes, or both may change with each update.
609
632
  *
610
- * @param handler - The handler to invoke when the user changes their theme.
633
+ * @param handler - The handler to call when the host sends an update.
611
634
  */
612
635
  export declare function registerOnThemeChangeHandler(handler: themeHandler): void;
613
636
  /**
@@ -1,4 +1,4 @@
1
- import { HostFeatures } from './app/app';
1
+ import type { BrandColorPalettes, HostFeatures } from './app/app';
2
2
  import { ChannelType, DialogDimension, HostClientType, HostName, RenderingSurfaces, TeamType, UserTeamRole } from './constants';
3
3
  import { FrameContexts } from './constants';
4
4
  /**
@@ -379,6 +379,18 @@ export interface Context {
379
379
  * The current UI theme.
380
380
  */
381
381
  theme?: string;
382
+ /**
383
+ * @deprecated
384
+ * As of TeamsJS v2.0.0, please use
385
+ * {@link app.AppInfo.brandColorPalettes | app.Context.app.brandColorPalettes} instead
386
+ *
387
+ * Brand color palettes supplied by the host.
388
+ *
389
+ * Each key identifies a palette format (for example, `"fluentui/v9"`), which defines its required shades and color
390
+ * syntax. Each update replaces the whole map rather than merging with it. `undefined` means no palettes are available,
391
+ * such as after the host clears them.
392
+ */
393
+ brandColorPalettes?: BrandColorPalettes;
382
394
  /**
383
395
  * @deprecated
384
396
  * As of TeamsJS v2.0.0, please use {@link app.PageInfo.isFullScreen | app.Context.page.isFullScreen} instead
@@ -1,3 +1,4 @@
1
+ import type { BrandColorPalettes } from './app/app';
1
2
  import { Context, DeepLinkParameters, FrameContext, LoadContext, TabInformation, TabInstanceParameters } from './interfaces';
2
3
  /** Type of callback used to indicate when {@link executeDeepLink} completes */
3
4
  export type executeDeepLinkOnCompleteFunctionType = (status: boolean, reason?: string) => void;
@@ -11,8 +12,8 @@ export type getTabInstancesCallbackFunctionType = (tabInfo: TabInformation) => v
11
12
  export type registerBackButtonHandlerFunctionType = () => boolean;
12
13
  /** Register full screen handler function type */
13
14
  export type registerFullScreenHandlerFunctionType = (isFullScreen: boolean) => void;
14
- /** Register on theme change handler function type */
15
- export type registerOnThemeChangeHandlerFunctionType = (theme: string) => void;
15
+ /** Called when the host sends a theme or brand color palette update. */
16
+ export type registerOnThemeChangeHandlerFunctionType = (theme: string, brandColorPalettes?: BrandColorPalettes) => void;
16
17
  /**
17
18
  * @deprecated
18
19
  * As of TeamsJS v2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\<void\>} instead.
@@ -53,10 +54,11 @@ export declare function getContext(callback: getContextCallbackFunctionType): vo
53
54
  * @deprecated
54
55
  * As of TeamsJS v2.0.0, please use {@link app.registerOnThemeChangeHandler app.registerOnThemeChangeHandler(handler: registerOnThemeChangeHandlerFunctionType): void} instead.
55
56
  *
56
- * Registers a handler for theme changes.
57
+ * Registers a handler for host theme or brand color palette updates.
57
58
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
59
+ * The theme, palettes, or both may change with each update.
58
60
  *
59
- * @param handler - The handler to invoke when the user changes their theme.
61
+ * @param handler - The handler to call when the host sends an update.
60
62
  */
61
63
  export declare function registerOnThemeChangeHandler(handler: registerOnThemeChangeHandlerFunctionType): void;
62
64
  /**
@@ -98,7 +98,9 @@ interface IRuntimeV4 extends IBaseRuntime {
98
98
  };
99
99
  readonly shortcutRelay?: {};
100
100
  readonly stageView?: {
101
- readonly self?: {};
101
+ readonly self?: {
102
+ readonly closeResult?: {};
103
+ };
102
104
  };
103
105
  readonly store?: {};
104
106
  readonly teams?: {
@@ -6,12 +6,17 @@
6
6
  */
7
7
  /**
8
8
  * Closes the current stage view. This function will be a no-op if called from outside of a stage view.
9
+ * @param result - Optional opaque serialized result passed to the host when closing.
10
+ * An empty string is a result. Requires the host to advertise `stageView.self.closeResult` support;
11
+ * otherwise the request is rejected without closing. The SDK does not interpret the result.
9
12
  * @returns Promise that resolves or rejects with an error once the stage view is closed.
13
+ * The promise acknowledges closing; it does not return the result to the closing application.
14
+ * This does not add a result callback to `stageView.open()`.
10
15
  *
11
16
  * @beta
12
17
  * @throws Error if stageView.self.close is not supported in the current context or if `app.initialize()` has not resolved successfully.
13
18
  */
14
- export declare function close(): Promise<void>;
19
+ export declare function close(result?: string): Promise<void>;
15
20
  /**
16
21
  * Checks if stageView.self capability is supported by the host
17
22
  * @beta
@@ -21,3 +26,11 @@ export declare function close(): Promise<void>;
21
26
  *
22
27
  */
23
28
  export declare function isSupported(): boolean;
29
+ /**
30
+ * Checks whether the host supports passing a result when closing a stage view.
31
+ *
32
+ * @beta
33
+ * @returns true if the host supports Stage close results; otherwise false.
34
+ * @throws Error if {@linkcode app.initialize} has not successfully completed.
35
+ */
36
+ export declare function isCloseResultSupported(): boolean;
@@ -1 +1 @@
1
- var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","cr.m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.usgovcloud.microsoft","cr.m365copilotapp.svc.usgovcloud.microsoft","dod.m365copilotapp.svc.usgovcloud.microsoft","cr.dod.m365copilotapp.svc.usgovcloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","admin.microsoft.com","m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"],c={validOrigins:o};export{c as default,o as validOrigins};
1
+ var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate.office.com","copilot-connectors.core.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","cr.m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.usgovcloud.microsoft","cr.m365copilotapp.svc.usgovcloud.microsoft","dod.m365copilotapp.svc.usgovcloud.microsoft","cr.dod.m365copilotapp.svc.usgovcloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","admin.microsoft.com","m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"],c={validOrigins:o};export{c as default,o as validOrigins};
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getApiVersionTag as n,getLogger as r}from"./telemetry.js";import{runtime as l}from"../public/runtime.js";import{shouldEventBeRelayedToChild as a,sendMessageEventToChild as t}from"./childCommunication.js";import{sendMessageToParent as o}from"./communication.js";import{ensureInitialized as d}from"./internalAPIs.js";import{initializeBackStackHelper as i}from"./pagesHelpers.js";import{isNullOrUndefined as s}from"./typeCheckUtilities.js";const u=r("handlers");class c{static initializeHandlers(){c.handlers.themeChange=x,c.handlers.contextChange=v,c.handlers.load=S,c.handlers.beforeUnload=A,i()}static uninitializeHandlers(){c.handlers={},c.themeChangeHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.contextChangeHandler=null}}function f(){c.initializeHandlers()}function m(){c.uninitializeHandlers()}c.handlers={},c.themeChangeHandler=null,c.loadHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.hostToAppPerformanceMetricsHandler=null,c.contextChangeHandler=null;const H=u.extend("callHandler");function h(e,n){const r=c.handlers[e];if(r){H("Invoking the registered handler for message %s with arguments %o",e,n);return[!0,r.apply(this,n)]}return a()?(t(e,n),[!1,void 0]):(H("Handler for action message %s not found.",e),[!1,void 0])}function p(e,n,r,l=!0,a=[]){r?(c.handlers[n]=r,l&&o(e,"registerHandler",[n,...a])):delete c.handlers[n]}function g(e){delete c.handlers[e]}function b(e){return null!=c.handlers[e]}function C(e,n,r,a,t){r&&d(l,...a),t&&t(),p(e,n,r)}function U(e,n){c.themeChangeHandler=n,!s(n)&&o(e,"registerHandler",["themeChange"])}function T(e,n){c.contextChangeHandler=n,!s(n)&&o(e,"registerHandler",["contextChange"])}function x(e){c.themeChangeHandler&&c.themeChangeHandler(e),a()&&t("themeChange",[e])}function v(e){c.contextChangeHandler&&c.contextChangeHandler(e),a()&&t("contextChange",[e])}function y(e){c.hostToAppPerformanceMetricsHandler=e}function j(e){c.hostToAppPerformanceMetricsHandler&&c.hostToAppPerformanceMetricsHandler(e)}function O(e,n){c.loadHandler=n,!s(n)&&o(e,"registerHandler",["load"])}function S(e){const n={entityId:(r=e).entityId,contentUrl:new URL(r.contentUrl)};var r;c.resumeHandler?(c.resumeHandler(n),a()&&t("load",[n])):c.loadHandler&&(c.loadHandler(e),a()&&t("load",[e]))}function _(e,n){c.beforeUnloadHandler=n,!s(n)&&o(e,"registerHandler",["beforeUnload"])}function A(){return e(this,void 0,void 0,function*(){const e=()=>{o(n("v2","handleBeforeUnload"),"readyToUnload",[])};c.beforeSuspendOrTerminateHandler?(yield c.beforeSuspendOrTerminateHandler(),a()?t("beforeUnload"):e()):c.beforeUnloadHandler&&c.beforeUnloadHandler(e)||(a()?t("beforeUnload"):e())})}function P(e){c.beforeSuspendOrTerminateHandler=e,!s(e)&&o(n("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}function z(e){c.resumeHandler=e,!s(e)&&o(n("v2","registerOnResumeHandler"),"registerHandler",["load"])}export{h as callHandler,b as doesHandlerExist,v as handleContextChange,j as handleHostToAppPerformanceMetrics,x as handleThemeChange,f as initializeHandlers,P as registerBeforeSuspendOrTerminateHandler,_ as registerBeforeUnloadHandler,p as registerHandler,C as registerHandlerHelper,y as registerHostToAppPerformanceMetricsHandler,T as registerOnContextChangeHandler,O as registerOnLoadHandler,z as registerOnResumeHandler,U as registerOnThemeChangeHandler,g as removeHandler,m as uninitializeHandlers};
1
+ import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getApiVersionTag as n,getLogger as r}from"./telemetry.js";import{runtime as l}from"../public/runtime.js";import{shouldEventBeRelayedToChild as t,sendMessageEventToChild as a}from"./childCommunication.js";import{sendMessageToParent as o}from"./communication.js";import{ensureInitialized as d}from"./internalAPIs.js";import{initializeBackStackHelper as i}from"./pagesHelpers.js";import{isNullOrUndefined as s}from"./typeCheckUtilities.js";const u=r("handlers");class c{static initializeHandlers(){c.handlers.themeChange=v,c.handlers.contextChange=x,c.handlers.load=S,c.handlers.beforeUnload=A,i()}static uninitializeHandlers(){c.handlers={},c.themeChangeHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.contextChangeHandler=null}}function f(){c.initializeHandlers()}function m(){c.uninitializeHandlers()}c.handlers={},c.themeChangeHandler=null,c.loadHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.hostToAppPerformanceMetricsHandler=null,c.contextChangeHandler=null;const H=u.extend("callHandler");function h(e,n){const r=c.handlers[e];if(r){H("Invoking the registered handler for message %s with arguments %o",e,n);return[!0,r.apply(this,n)]}return t()?(a(e,n),[!1,void 0]):(H("Handler for action message %s not found.",e),[!1,void 0])}function p(e,n,r,l=!0,t=[]){r?(c.handlers[n]=r,l&&o(e,"registerHandler",[n,...t])):delete c.handlers[n]}function g(e){delete c.handlers[e]}function b(e){return null!=c.handlers[e]}function C(e,n,r,t,a){r&&d(l,...t),a&&a(),p(e,n,r)}function U(e,n){c.themeChangeHandler=n,!s(n)&&o(e,"registerHandler",["themeChange"])}function T(e,n){c.contextChangeHandler=n,!s(n)&&o(e,"registerHandler",["contextChange"])}function v(e,n){const r=!s(n);c.themeChangeHandler&&c.themeChangeHandler(e,r?n:void 0),t()&&a("themeChange",r?[e,n]:[e])}function x(e){c.contextChangeHandler&&c.contextChangeHandler(e),t()&&a("contextChange",[e])}function y(e){c.hostToAppPerformanceMetricsHandler=e}function j(e){c.hostToAppPerformanceMetricsHandler&&c.hostToAppPerformanceMetricsHandler(e)}function O(e,n){c.loadHandler=n,!s(n)&&o(e,"registerHandler",["load"])}function S(e){const n={entityId:(r=e).entityId,contentUrl:new URL(r.contentUrl)};var r;c.resumeHandler?(c.resumeHandler(n),t()&&a("load",[n])):c.loadHandler&&(c.loadHandler(e),t()&&a("load",[e]))}function _(e,n){c.beforeUnloadHandler=n,!s(n)&&o(e,"registerHandler",["beforeUnload"])}function A(){return e(this,void 0,void 0,function*(){const e=()=>{o(n("v2","handleBeforeUnload"),"readyToUnload",[])};c.beforeSuspendOrTerminateHandler?(yield c.beforeSuspendOrTerminateHandler(),t()?a("beforeUnload"):e()):c.beforeUnloadHandler&&c.beforeUnloadHandler(e)||(t()?a("beforeUnload"):e())})}function P(e){c.beforeSuspendOrTerminateHandler=e,!s(e)&&o(n("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}function z(e){c.resumeHandler=e,!s(e)&&o(n("v2","registerOnResumeHandler"),"registerHandler",["load"])}export{h as callHandler,b as doesHandlerExist,x as handleContextChange,j as handleHostToAppPerformanceMetrics,v as handleThemeChange,f as initializeHandlers,P as registerBeforeSuspendOrTerminateHandler,_ as registerBeforeUnloadHandler,p as registerHandler,C as registerHandlerHelper,y as registerHostToAppPerformanceMetricsHandler,T as registerOnContextChangeHandler,O as registerOnLoadHandler,z as registerOnResumeHandler,U as registerOnThemeChangeHandler,g as removeHandler,m as uninitializeHandlers};
@@ -1 +1 @@
1
- import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,registerOnContextChangeHandlerHelper as r,openLinkHelper as s}from"../../internal/appHelpers.js";import{uninitializeCommunication as l,sendAndUnwrap as m,Communication as d}from"../../internal/communication.js";import{GlobalVars as p}from"../../internal/globalVars.js";import{uninitializeHandlers as u,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as f}from"../../internal/internalAPIs.js";import{getLogger as h,getApiVersionTag as g}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as I}from"../../internal/utils.js";import{AppId as y}from"../appId.js";import{HostClientType as S,HostName as T}from"../constants.js";import{version as v}from"../version.js";import*as C from"./lifecycle.js";export{C as lifecycle};import{_clearTelemetryPort as w}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as P}from"../../private/messageChannels/dataLayer.js";const j="v2",O=h("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var F,b;function x(){return p.initializeCompleted}function L(){return p.frameContext}function A(i){return e(g(j,"app.initialize"),i)}function z(){var e,i;if(I())return null;const t=null!==(e=d.currentWindow)&&void 0!==e?e:window;if(t.parent===t)return null;const n=t.location.ancestorOrigins,a=null==n?void 0:n.item(0);if(a)return a;const o=null===(i=t.document)||void 0===i?void 0:i.referrer;if(!o)return null;try{const e=new URL(o).origin;return e===t.location.origin?null:e}catch(e){return null}}function D(e){d.currentWindow=e}function k(){p.initializeCalled&&(u(),p.initializeCalled=!1,p.initializeCompleted=!1,p.initializePromise=void 0,p.additionalValidOrigins=[],p.frameContext=void 0,p.hostClientType=void 0,p.isFramelessWindow=!1,w(),P(),l())}function U(){return new Promise(e=>{f(),e(m(g(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,messageId:e.messageId,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:T.teams,clientType:e.hostClientType?e.hostClientType:S.web,features:e.hostFeatures,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId,ancestors:e.hostAncestors},appLaunchId:e.appLaunchId,appId:e.appId?new y(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:p.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 H(){f(),i(g(j,"app.notifyAppLoaded"))}function V(){return t(g(j,"app.notifySuccess"))}function E(e){f(),n(g(j,"app.notifyFailure"),e)}function M(e){f(),a(g(j,"app.notifyExpectedFailure"),e)}function W(e){o(g(j,"app.registerOnThemeChangeHandler"),e)}function R(e){r(g(j,"app.registerOnContextChangeHandler"),e)}function B(e){c(e)}function G(e){return s(g(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(F||(F={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(b||(b={})),O("teamsjs instance is version %s, starting at %s UTC (%s local)",v,(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?O("teamsjs is being used from %s. %s",i,t):O("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{b as ExpectedFailureReason,F as FailedReason,N as Messages,D as _initialize,k as _uninitialize,U as getContext,L as getFrameContext,z as getImmediateParentOrigin,A as initialize,x as isInitialized,H as notifyAppLoaded,M as notifyExpectedFailure,E as notifyFailure,V as notifySuccess,G as openLink,B as registerHostToAppPerformanceMetricsHandler,R as registerOnContextChangeHandler,W as registerOnThemeChangeHandler};
1
+ import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,registerOnContextChangeHandlerHelper as r,openLinkHelper as s}from"../../internal/appHelpers.js";import{uninitializeCommunication as l,sendAndUnwrap as m,Communication as d}from"../../internal/communication.js";import{GlobalVars as p}from"../../internal/globalVars.js";import{uninitializeHandlers as u,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as f}from"../../internal/internalAPIs.js";import{getLogger as h,getApiVersionTag as g}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as I}from"../../internal/utils.js";import{AppId as y}from"../appId.js";import{HostClientType as S,HostName as T}from"../constants.js";import{version as C}from"../version.js";import*as v from"./lifecycle.js";export{v as lifecycle};import{_clearTelemetryPort as P}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as w}from"../../private/messageChannels/dataLayer.js";const j="v2",O=h("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var b,F;function x(){return p.initializeCompleted}function L(){return p.frameContext}function A(i){return e(g(j,"app.initialize"),i)}function z(){var e,i;if(I())return null;const t=null!==(e=d.currentWindow)&&void 0!==e?e:window;if(t.parent===t)return null;const n=t.location.ancestorOrigins,a=null==n?void 0:n.item(0);if(a)return a;const o=null===(i=t.document)||void 0===i?void 0:i.referrer;if(!o)return null;try{const e=new URL(o).origin;return e===t.location.origin?null:e}catch(e){return null}}function D(e){d.currentWindow=e}function k(){p.initializeCalled&&(u(),p.initializeCalled=!1,p.initializeCompleted=!1,p.initializePromise=void 0,p.additionalValidOrigins=[],p.frameContext=void 0,p.hostClientType=void 0,p.isFramelessWindow=!1,P(),w(),l())}function U(){return new Promise(e=>{f(),e(m(g(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",brandColorPalettes:e.brandColorPalettes,iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,messageId:e.messageId,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:T.teams,clientType:e.hostClientType?e.hostClientType:S.web,features:e.hostFeatures,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId,ancestors:e.hostAncestors},appLaunchId:e.appLaunchId,appId:e.appId?new y(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:p.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 H(){f(),i(g(j,"app.notifyAppLoaded"))}function V(){return t(g(j,"app.notifySuccess"))}function E(e){f(),n(g(j,"app.notifyFailure"),e)}function M(e){f(),a(g(j,"app.notifyExpectedFailure"),e)}function W(e){o(g(j,"app.registerOnThemeChangeHandler"),e)}function R(e){r(g(j,"app.registerOnContextChangeHandler"),e)}function B(e){c(e)}function G(e){return s(g(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(b||(b={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(F||(F={})),O("teamsjs instance is version %s, starting at %s UTC (%s local)",C,(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?O("teamsjs is being used from %s. %s",i,t):O("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{F as ExpectedFailureReason,b as FailedReason,N as Messages,D as _initialize,k as _uninitialize,U as getContext,L as getFrameContext,z as getImmediateParentOrigin,A as initialize,x as isInitialized,H as notifyAppLoaded,M as notifyExpectedFailure,E as notifyFailure,V as notifySuccess,G as openLink,B as registerHostToAppPerformanceMetricsHandler,R as registerOnContextChangeHandler,W as registerOnThemeChangeHandler};
@@ -1 +1 @@
1
- import{sendAndHandleSdkError as t}from"../../internal/communication.js";import{ensureInitialized as e}from"../../internal/internalAPIs.js";import{getApiVersionTag as o}from"../../internal/telemetry.js";import{FrameContexts as r,errorNotSupportedOnPlatform as n}from"../constants.js";import{runtime as i}from"../runtime.js";function s(){return new Promise(s=>{if(e(i,r.content),!m())throw n;s(t(o("v2","stageView.self.close"),"stageView.self.close"))})}function m(){var t;return e(i)&&void 0!==(null===(t=i.supports.stageView)||void 0===t?void 0:t.self)}export{s as close,m as isSupported};
1
+ import{sendAndHandleSdkError as e}from"../../internal/communication.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{getApiVersionTag as t}from"../../internal/telemetry.js";import{FrameContexts as i,errorNotSupportedOnPlatform as r}from"../constants.js";import{runtime as s}from"../runtime.js";function n(n){return new Promise(m=>{if(o(s,i.content),!l()||void 0!==n&&!f())throw r;if(void 0!==n&&"string"!=typeof n)throw new Error("[stageView.self.close] Result must be a string");m(e(t("v2","stageView.self.close"),"stageView.self.close",...void 0===n?[]:[n]))})}function l(){var e;return o(s)&&void 0!==(null===(e=s.supports.stageView)||void 0===e?void 0:e.self)}function f(){var e,t;return o(s)&&!!(null===(t=null===(e=s.supports.stageView)||void 0===e?void 0:e.self)||void 0===t?void 0:t.closeResult)}export{n as close,f as isCloseResultSupported,l as isSupported};
@@ -1 +1 @@
1
- const o="2.57.0";export{o as version};
1
+ const t="2.59.0-beta.0";export{t as version};
@@ -1979,6 +1979,7 @@ var self_namespaceObject = {};
1979
1979
  __webpack_require__.r(self_namespaceObject);
1980
1980
  __webpack_require__.d(self_namespaceObject, {
1981
1981
  close: () => (self_close),
1982
+ isCloseResultSupported: () => (isCloseResultSupported),
1982
1983
  isSupported: () => (self_isSupported)
1983
1984
  });
1984
1985
 
@@ -2338,7 +2339,7 @@ var ClipboardSupportedMimeType;
2338
2339
  })(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
2339
2340
 
2340
2341
  ;// ./src/artifactsForCDN/validDomains.json
2341
- const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","cr.m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.usgovcloud.microsoft","cr.m365copilotapp.svc.usgovcloud.microsoft","dod.m365copilotapp.svc.usgovcloud.microsoft","cr.dod.m365copilotapp.svc.usgovcloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","admin.microsoft.com","m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"]}');
2342
+ const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate.office.com","copilot-connectors.core.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","cr.m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.usgovcloud.microsoft","cr.m365copilotapp.svc.usgovcloud.microsoft","dod.m365copilotapp.svc.usgovcloud.microsoft","cr.dod.m365copilotapp.svc.usgovcloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","admin.microsoft.com","m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"]}');
2342
2343
  var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
2343
2344
  ;// ./src/internal/constants.ts
2344
2345
 
@@ -4707,7 +4708,7 @@ function isSerializable(arg) {
4707
4708
  * @hidden
4708
4709
  * Package version.
4709
4710
  */
4710
- const version = "2.57.0";
4711
+ const version = "2.59.0-beta.0";
4711
4712
 
4712
4713
  ;// ./src/public/featureFlags.ts
4713
4714
  // 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.
@@ -5685,12 +5686,13 @@ function notifyExpectedFailure(expectedFailureRequest) {
5685
5686
  notifyExpectedFailureHelper(getApiVersionTag(appTelemetryVersionNumber, "app.notifyExpectedFailure" /* ApiName.App_NotifyExpectedFailure */), expectedFailureRequest);
5686
5687
  }
5687
5688
  /**
5688
- * Registers a handler for theme changes.
5689
+ * Registers a handler for host theme or brand color palette updates.
5689
5690
  *
5690
5691
  * @remarks
5691
5692
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
5693
+ * The theme, palettes, or both may change with each update.
5692
5694
  *
5693
- * @param handler - The handler to invoke when the user changes their theme.
5695
+ * @param handler - The handler to call when the host sends an update.
5694
5696
  */
5695
5697
  function registerOnThemeChangeHandler(handler) {
5696
5698
  registerOnThemeChangeHandlerHelper(getApiVersionTag(appTelemetryVersionNumber, "app.registerOnThemeChangeHandler" /* ApiName.App_RegisterOnThemeChangeHandler */), handler);
@@ -5771,6 +5773,7 @@ function transformLegacyContextToAppContext(legacyContext) {
5771
5773
  locale: legacyContext.locale,
5772
5774
  sessionId: legacyContext.appSessionId ? legacyContext.appSessionId : '',
5773
5775
  theme: legacyContext.theme ? legacyContext.theme : 'default',
5776
+ brandColorPalettes: legacyContext.brandColorPalettes,
5774
5777
  iconPositionVertical: legacyContext.appIconPosition,
5775
5778
  osLocaleInfo: legacyContext.osLocaleInfo,
5776
5779
  messageId: legacyContext.messageId,
@@ -7952,12 +7955,13 @@ function handlers_registerOnContextChangeHandler(apiVersionTag, handler) {
7952
7955
  * @internal
7953
7956
  * Limited to Microsoft-internal use
7954
7957
  */
7955
- function handleThemeChange(theme) {
7958
+ function handleThemeChange(theme, brandColorPalettes) {
7959
+ const hasBrandColorPalettes = !isNullOrUndefined(brandColorPalettes);
7956
7960
  if (HandlersPrivate.themeChangeHandler) {
7957
- HandlersPrivate.themeChangeHandler(theme);
7961
+ HandlersPrivate.themeChangeHandler(theme, hasBrandColorPalettes ? brandColorPalettes : undefined);
7958
7962
  }
7959
7963
  if (shouldEventBeRelayedToChild()) {
7960
- sendMessageEventToChild('themeChange', [theme]);
7964
+ sendMessageEventToChild('themeChange', hasBrandColorPalettes ? [theme, brandColorPalettes] : [theme]);
7961
7965
  }
7962
7966
  }
7963
7967
  /**
@@ -18732,18 +18736,26 @@ function sharing_isSupported() {
18732
18736
  const stageViewTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
18733
18737
  /**
18734
18738
  * Closes the current stage view. This function will be a no-op if called from outside of a stage view.
18739
+ * @param result - Optional opaque serialized result passed to the host when closing.
18740
+ * An empty string is a result. Requires the host to advertise `stageView.self.closeResult` support;
18741
+ * otherwise the request is rejected without closing. The SDK does not interpret the result.
18735
18742
  * @returns Promise that resolves or rejects with an error once the stage view is closed.
18743
+ * The promise acknowledges closing; it does not return the result to the closing application.
18744
+ * This does not add a result callback to `stageView.open()`.
18736
18745
  *
18737
18746
  * @beta
18738
18747
  * @throws Error if stageView.self.close is not supported in the current context or if `app.initialize()` has not resolved successfully.
18739
18748
  */
18740
- function self_close() {
18749
+ function self_close(result) {
18741
18750
  return new Promise((resolve) => {
18742
18751
  ensureInitialized(runtime, FrameContexts.content);
18743
- if (!self_isSupported()) {
18752
+ if (!self_isSupported() || (result !== undefined && !isCloseResultSupported())) {
18744
18753
  throw errorNotSupportedOnPlatform;
18745
18754
  }
18746
- resolve(sendAndHandleSdkError(getApiVersionTag(stageViewTelemetryVersionNumber, "stageView.self.close" /* ApiName.StageView_Self_Close */), 'stageView.self.close'));
18755
+ if (result !== undefined && typeof result !== 'string') {
18756
+ throw new Error('[stageView.self.close] Result must be a string');
18757
+ }
18758
+ resolve(sendAndHandleSdkError(getApiVersionTag(stageViewTelemetryVersionNumber, "stageView.self.close" /* ApiName.StageView_Self_Close */), 'stageView.self.close', ...(result === undefined ? [] : [result])));
18747
18759
  });
18748
18760
  }
18749
18761
  /**
@@ -18758,6 +18770,17 @@ function self_isSupported() {
18758
18770
  var _a;
18759
18771
  return ensureInitialized(runtime) && ((_a = runtime.supports.stageView) === null || _a === void 0 ? void 0 : _a.self) !== undefined;
18760
18772
  }
18773
+ /**
18774
+ * Checks whether the host supports passing a result when closing a stage view.
18775
+ *
18776
+ * @beta
18777
+ * @returns true if the host supports Stage close results; otherwise false.
18778
+ * @throws Error if {@linkcode app.initialize} has not successfully completed.
18779
+ */
18780
+ function isCloseResultSupported() {
18781
+ var _a, _b;
18782
+ return ensureInitialized(runtime) && !!((_b = (_a = runtime.supports.stageView) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.closeResult);
18783
+ }
18761
18784
 
18762
18785
  ;// ./src/public/stageView/stageView.ts
18763
18786
  /**
@@ -19504,10 +19527,11 @@ function publicAPIs_getContext(callback) {
19504
19527
  * @deprecated
19505
19528
  * As of TeamsJS v2.0.0, please use {@link app.registerOnThemeChangeHandler app.registerOnThemeChangeHandler(handler: registerOnThemeChangeHandlerFunctionType): void} instead.
19506
19529
  *
19507
- * Registers a handler for theme changes.
19530
+ * Registers a handler for host theme or brand color palette updates.
19508
19531
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
19532
+ * The theme, palettes, or both may change with each update.
19509
19533
  *
19510
- * @param handler - The handler to invoke when the user changes their theme.
19534
+ * @param handler - The handler to call when the host sends an update.
19511
19535
  */
19512
19536
  function publicAPIs_registerOnThemeChangeHandler(handler) {
19513
19537
  registerOnThemeChangeHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, "registerOnThemeChangeHandlerHelper" /* ApiName.PublicAPIs_RegisterOnThemeChangeHandlerHelper */), handler);