Skip to content

Commit 2b61ca0

Browse files
authored
Merge pull request #77 from pnp/file-editor-functions-and-fixes
File editor functions and fixes
2 parents c20f511 + 1032b9d commit 2b61ca0

File tree

81 files changed

+9398
-7205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+9398
-7205
lines changed

package-lock.json

Lines changed: 2889 additions & 5152 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
{
22
"name": "sp-editor",
3-
"version": "7.1.2",
3+
"version": "7.2.0",
44
"private": true,
55
"homepage": ".",
66
"dependencies": {
7-
"@azure/msal-browser": "^3.24.0",
8-
"@azure/msal-react": "^2.1.0",
7+
"@azure/msal-browser": "^3.26.1",
8+
"@azure/msal-react": "^2.1.1",
99
"@craco/craco": "^7.1.0",
10-
"@fluentui/react": "^8.120.9",
11-
"@ionic/react": "^8.3.1",
12-
"@microsoft/mgt": "^4.2.5",
13-
"@microsoft/mgt-react": "^4.2.5",
10+
"@fluentui/react": "^8.121.6",
11+
"@ionic/react": "^8.3.3",
12+
"@microsoft/mgt": "^4.3.0",
13+
"@microsoft/mgt-react": "^4.3.0",
1414
"@microsoft/microsoft-graph-client": "^3.0.7",
1515
"@minoru/react-dnd-treeview": "^3.4.4",
16-
"@pnp/graph": "^4.5.0",
17-
"@pnp/logging": "^4.5.0",
18-
"@pnp/msaljsclient": "^4.5.0",
19-
"@pnp/sp": "^4.5.0",
20-
"@pnp/sp-admin": "^4.5.0",
21-
"@reduxjs/toolkit": "^2.2.7",
22-
"@testing-library/jest-dom": "^6.5.0",
16+
"@pnp/graph": "^4.6.0",
17+
"@pnp/logging": "^4.6.0",
18+
"@pnp/msaljsclient": "^4.6.0",
19+
"@pnp/sp": "^4.6.0",
20+
"@pnp/sp-admin": "^4.6.0",
21+
"@reduxjs/toolkit": "^2.3.0",
22+
"@testing-library/jest-dom": "^6.6.2",
2323
"@testing-library/react": "^16.0.1",
2424
"@testing-library/user-event": "^14.5.2",
25-
"@types/jest": "^29.5.13",
26-
"@types/node": "^22.6.1",
27-
"@types/react": "^18.3.8",
28-
"@types/react-dom": "^18.3.0",
25+
"@types/jest": "^29.5.14",
26+
"@types/node": "^22.7.9",
27+
"@types/react": "^18.3.12",
28+
"@types/react-dom": "^18.3.1",
2929
"@uifabric/theme-samples": "^7.5.33",
3030
"@vscode/codicons": "^0.0.36",
3131
"gsap": "^3.12.5",
@@ -35,8 +35,8 @@
3535
"react-dom": "^18.3.1",
3636
"react-live": "^4.1.7",
3737
"react-redux": "^9.1.2",
38-
"react-router": "^6.26.2",
39-
"react-router-dom": "^6.26.2",
38+
"react-router": "^6.27.0",
39+
"react-router-dom": "^6.27.0",
4040
"redux": "^5.0.1",
4141
"textarea-caret": "^3.1.0",
4242
"typesafe-actions": "^5.1.0",

public/@azure/msal-browser/app/IPublicClientApplication.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ import { AuthenticationResult } from "../response/AuthenticationResult.js";
1414
import { EventCallbackFunction } from "../event/EventMessage.js";
1515
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
1616
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
17+
import { EventType } from "../event/EventType.js";
1718
export interface IPublicClientApplication {
1819
initialize(request?: InitializeApplicationRequest): Promise<void>;
1920
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
2021
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
2122
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
2223
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
23-
addEventCallback(callback: EventCallbackFunction): string | null;
24+
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
2425
removeEventCallback(callbackId: string): void;
2526
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
2627
removePerformanceCallback(callbackId: string): boolean;

public/@azure/msal-browser/app/PublicClientApplication.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { EventCallbackFunction } from "../event/EventMessage.js";
1616
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
1717
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
1818
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
19+
import { EventType } from "../event/EventType.js";
1920
/**
2021
* The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications
2122
* to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.
@@ -95,8 +96,9 @@ export declare class PublicClientApplication implements IPublicClientApplication
9596
/**
9697
* Adds event callbacks to array
9798
* @param callback
99+
* @param eventTypes
98100
*/
99-
addEventCallback(callback: EventCallbackFunction): string | null;
101+
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
100102
/**
101103
* Removes callback with provided id from callback array
102104
* @param callbackId

public/@azure/msal-browser/app/PublicClientNext.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { BrowserConfiguration, Configuration } from "../config/Configuration.js"
1414
import { EventCallbackFunction } from "../event/EventMessage.js";
1515
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
1616
import { AuthenticationResult } from "../response/AuthenticationResult.js";
17+
import { EventType } from "../event/EventType.js";
1718
/**
1819
* PublicClientNext is an early look at the planned implementation of PublicClientApplication in the next major version of MSAL.js.
1920
* It contains support for multiple API implementations based on the runtime environment that it is running in.
@@ -96,7 +97,7 @@ export declare class PublicClientNext implements IPublicClientApplication {
9697
* Adds event callbacks to array
9798
* @param callback
9899
*/
99-
addEventCallback(callback: EventCallbackFunction): string | null;
100+
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
100101
/**
101102
* Removes callback with provided id from callback array
102103
* @param callbackId

public/@azure/msal-browser/controllers/IController.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
1010
import { ITokenCache } from "../cache/ITokenCache.js";
1111
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
1212
import { BrowserConfiguration } from "../config/Configuration.js";
13-
import { EventHandler } from "../event/EventHandler.js";
1413
import { AuthenticationResult } from "../response/AuthenticationResult.js";
1514
import { EventCallbackFunction } from "../event/EventMessage.js";
1615
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
1716
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
17+
import { EventType } from "../event/EventType.js";
1818
export interface IController {
1919
initialize(request?: InitializeApplicationRequest): Promise<void>;
2020
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
2121
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
2222
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
2323
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
2424
acquireTokenNative(request: PopupRequest | SilentRequest | SsoSilentRequest, apiId: ApiId, accountId?: string): Promise<AuthenticationResult>;
25-
addEventCallback(callback: EventCallbackFunction): string | null;
25+
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
2626
removeEventCallback(callbackId: string): void;
2727
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
2828
removePerformanceCallback(callbackId: string): boolean;
@@ -55,7 +55,5 @@ export interface IController {
5555
isBrowserEnv(): boolean;
5656
/** @internal */
5757
getPerformanceClient(): IPerformanceClient;
58-
/** @internal */
59-
getEventHandler(): EventHandler;
6058
}
6159
//# sourceMappingURL=IController.d.ts.map

public/@azure/msal-browser/controllers/NestedAppAuthController.d.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { NestedAppOperatingContext } from "../operatingcontext/NestedAppOperatin
1515
import { IBridgeProxy } from "../naa/IBridgeProxy.js";
1616
import { NestedAppAuthAdapter } from "../naa/mapping/NestedAppAuthAdapter.js";
1717
import { EventHandler } from "../event/EventHandler.js";
18+
import { EventType } from "../event/EventType.js";
1819
import { EventCallbackFunction } from "../event/EventMessage.js";
1920
import { AuthenticationResult } from "../response/AuthenticationResult.js";
2021
import { BrowserCacheManager } from "../cache/BrowserCacheManager.js";
@@ -30,11 +31,6 @@ export declare class NestedAppAuthController implements IController {
3031
protected readonly eventHandler: EventHandler;
3132
protected readonly nestedAppAuthAdapter: NestedAppAuthAdapter;
3233
constructor(operatingContext: NestedAppOperatingContext);
33-
/**
34-
* Returns the event handler instance
35-
* @returns EventHandler
36-
*/
37-
getEventHandler(): EventHandler;
3834
/**
3935
* Factory function to create a new instance of NestedAppAuthController
4036
* @param operatingContext
@@ -116,8 +112,9 @@ export declare class NestedAppAuthController implements IController {
116112
/**
117113
* Adds event callbacks to array
118114
* @param callback
115+
* @param eventTypes
119116
*/
120-
addEventCallback(callback: EventCallbackFunction): string | null;
117+
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
121118
/**
122119
* Removes callback with provided id from callback array
123120
* @param callbackId

public/@azure/msal-browser/controllers/StandardController.d.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { RedirectRequest } from "../request/RedirectRequest.js";
66
import { PopupRequest } from "../request/PopupRequest.js";
77
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
88
import { EventCallbackFunction } from "../event/EventMessage.js";
9+
import { EventType } from "../event/EventType.js";
910
import { EndSessionRequest } from "../request/EndSessionRequest.js";
1011
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
1112
import { INavigationClient } from "../navigation/INavigationClient.js";
@@ -47,6 +48,7 @@ export declare class StandardController implements IController {
4748
private activeIframeRequest;
4849
private ssoSilentMeasurement?;
4950
private acquireTokenByCodeAsyncMeasurement?;
51+
private listeningToStorageEvents;
5052
/**
5153
* @constructor
5254
* Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
@@ -285,7 +287,7 @@ export declare class StandardController implements IController {
285287
* Adds event callbacks to array
286288
* @param callback
287289
*/
288-
addEventCallback(callback: EventCallbackFunction): string | null;
290+
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
289291
/**
290292
* Removes callback with provided id from callback array
291293
* @param callbackId
@@ -313,6 +315,10 @@ export declare class StandardController implements IController {
313315
* Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
314316
*/
315317
disableAccountStorageEvents(): void;
318+
/**
319+
* Emit account added/removed events when cached accounts are changed in a different tab or frame
320+
*/
321+
protected handleAccountCacheChange(e: StorageEvent): void;
316322
/**
317323
* Gets the token cache for the application.
318324
*/
@@ -349,10 +355,6 @@ export declare class StandardController implements IController {
349355
* Returns the browser env indicator
350356
*/
351357
isBrowserEnv(): boolean;
352-
/**
353-
* Returns the event handler
354-
*/
355-
getEventHandler(): EventHandler;
356358
/**
357359
* Generates a correlation id for a request if none is provided.
358360
*

public/@azure/msal-browser/controllers/UnknownOperatingContextController.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { AuthenticationResult } from "../response/AuthenticationResult.js";
1414
import { ApiId, WrapperSKU } from "../utils/BrowserConstants.js";
1515
import { IController } from "./IController.js";
1616
import { UnknownOperatingContext } from "../operatingcontext/UnknownOperatingContext.js";
17-
import { EventHandler } from "../event/EventHandler.js";
1817
import { EventCallbackFunction } from "../event/EventMessage.js";
1918
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
19+
import { EventType } from "../event/EventType.js";
2020
/**
2121
* UnknownOperatingContextController class
2222
*
@@ -40,10 +40,8 @@ export declare class UnknownOperatingContextController implements IController {
4040
protected readonly browserCrypto: ICrypto;
4141
protected isBrowserEnvironment: boolean;
4242
protected initialized: boolean;
43-
protected readonly eventHandler: EventHandler;
4443
constructor(operatingContext: UnknownOperatingContext);
4544
getBrowserStorage(): BrowserCacheManager;
46-
getEventHandler(): EventHandler;
4745
getAccount(accountFilter: AccountFilter): AccountInfo | null;
4846
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
4947
getAccountByLocalId(localAccountId: string): AccountInfo | null;
@@ -56,7 +54,7 @@ export declare class UnknownOperatingContextController implements IController {
5654
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
5755
acquireTokenNative(request: PopupRequest | SilentRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "nativeBroker">>, apiId: ApiId, accountId?: string | undefined): Promise<AuthenticationResult>;
5856
acquireTokenByRefreshToken(commonRequest: CommonSilentFlowRequest, silentRequest: SilentRequest): Promise<AuthenticationResult>;
59-
addEventCallback(callback: EventCallbackFunction): string | null;
57+
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
6058
removeEventCallback(callbackId: string): void;
6159
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
6260
removePerformanceCallback(callbackId: string): boolean;
Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
1-
import { ICrypto, Logger } from "@azure/msal-common/browser";
1+
import { Logger } from "@azure/msal-common/browser";
22
import { InteractionType } from "../utils/BrowserConstants.js";
33
import { EventCallbackFunction, EventError, EventPayload } from "./EventMessage.js";
44
import { EventType } from "./EventType.js";
55
export declare class EventHandler {
66
private eventCallbacks;
77
private logger;
8-
private browserCrypto;
9-
private listeningToStorageEvents;
10-
constructor(logger: Logger, browserCrypto: ICrypto);
8+
constructor(logger?: Logger);
119
/**
1210
* Adds event callbacks to array
13-
* @param callback
11+
* @param callback - callback to be invoked when an event is raised
12+
* @param eventTypes - list of events that this callback will be invoked for, if not provided callback will be invoked for all events
13+
* @param callbackId - Identifier for the callback, used to locate and remove the callback when no longer required
1414
*/
15-
addEventCallback(callback: EventCallbackFunction): string | null;
15+
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>, callbackId?: string): string | null;
1616
/**
1717
* Removes callback with provided id from callback array
1818
* @param callbackId
1919
*/
2020
removeEventCallback(callbackId: string): void;
21-
/**
22-
* Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
23-
*/
24-
enableAccountStorageEvents(): void;
25-
/**
26-
* Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
27-
*/
28-
disableAccountStorageEvents(): void;
2921
/**
3022
* Emits events by calling callback with event message
3123
* @param eventType
@@ -34,9 +26,5 @@ export declare class EventHandler {
3426
* @param error
3527
*/
3628
emitEvent(eventType: EventType, interactionType?: InteractionType, payload?: EventPayload, error?: EventError): void;
37-
/**
38-
* Emit account added/removed events when cached accounts are changed in a different tab or frame
39-
*/
40-
private handleAccountCacheChange;
4129
}
4230
//# sourceMappingURL=EventHandler.d.ts.map

0 commit comments

Comments
 (0)